From ef9e700545733daa0ceb6227480308e7851a32af Mon Sep 17 00:00:00 2001
From: sjplimp <sjplimp@f3b2605a-c512-4ea7-a41b-209d697bcdaa>
Date: Wed, 6 Jun 2012 22:47:51 +0000
Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8226
 f3b2605a-c512-4ea7-a41b-209d697bcdaa

---
 src/ASPHERE/compute_erotate_asphere.cpp       |   86 +-
 src/ASPHERE/compute_erotate_asphere.h         |    2 +-
 src/ASPHERE/compute_temp_asphere.cpp          |  210 +-
 src/ASPHERE/compute_temp_asphere.h            |    2 +-
 src/ASPHERE/fix_nh_asphere.cpp                |   12 +-
 src/ASPHERE/fix_nh_asphere.h                  |    2 +-
 src/ASPHERE/fix_nph_asphere.cpp               |    6 +-
 src/ASPHERE/fix_nph_asphere.h                 |    2 +-
 src/ASPHERE/fix_npt_asphere.cpp               |    6 +-
 src/ASPHERE/fix_npt_asphere.h                 |    2 +-
 src/ASPHERE/fix_nve_asphere.cpp               |   12 +-
 src/ASPHERE/fix_nve_asphere.h                 |    2 +-
 src/ASPHERE/fix_nve_asphere_noforce.cpp       |   12 +-
 src/ASPHERE/fix_nve_asphere_noforce.h         |    4 +-
 src/ASPHERE/fix_nve_line.cpp                  |    4 +-
 src/ASPHERE/fix_nve_line.h                    |    2 +-
 src/ASPHERE/fix_nve_tri.cpp                   |   10 +-
 src/ASPHERE/fix_nve_tri.h                     |    2 +-
 src/ASPHERE/fix_nvt_asphere.cpp               |    4 +-
 src/ASPHERE/fix_nvt_asphere.h                 |    2 +-
 src/ASPHERE/pair_gayberne.cpp                 |  268 +-
 src/ASPHERE/pair_gayberne.h                   |   10 +-
 src/ASPHERE/pair_line_lj.cpp                  |  324 +-
 src/ASPHERE/pair_line_lj.h                    |    2 +-
 src/ASPHERE/pair_resquared.cpp                |   62 +-
 src/ASPHERE/pair_resquared.h                  |   10 +-
 src/ASPHERE/pair_tri_lj.cpp                   |  484 +--
 src/ASPHERE/pair_tri_lj.h                     |    2 +-
 src/CLASS2/angle_class2.cpp                   |   28 +-
 src/CLASS2/angle_class2.h                     |    2 +-
 src/CLASS2/bond_class2.cpp                    |   10 +-
 src/CLASS2/bond_class2.h                      |    2 +-
 src/CLASS2/dihedral_class2.cpp                |  152 +-
 src/CLASS2/dihedral_class2.h                  |    2 +-
 src/CLASS2/improper_class2.cpp                |  360 +-
 src/CLASS2/improper_class2.h                  |    2 +-
 src/CLASS2/pair_lj_class2.cpp                 |   96 +-
 src/CLASS2/pair_lj_class2.h                   |    2 +-
 src/CLASS2/pair_lj_class2_coul_cut.cpp        |  136 +-
 src/CLASS2/pair_lj_class2_coul_cut.h          |    2 +-
 src/CLASS2/pair_lj_class2_coul_long.cpp       |  142 +-
 src/CLASS2/pair_lj_class2_coul_long.h         |    2 +-
 src/COLLOID/fix_wall_colloid.cpp              |   28 +-
 src/COLLOID/fix_wall_colloid.h                |    2 +-
 src/COLLOID/pair_colloid.cpp                  |  212 +-
 src/COLLOID/pair_colloid.h                    |    2 +-
 src/COLLOID/pair_yukawa_colloid.cpp           |   68 +-
 src/COLLOID/pair_yukawa_colloid.h             |    2 +-
 src/DIPOLE/atom_vec_dipole.cpp                |  168 +-
 src/DIPOLE/atom_vec_dipole.h                  |    2 +-
 src/DIPOLE/pair_dipole_cut.cpp                |  272 +-
 src/DIPOLE/pair_dipole_cut.h                  |    2 +-
 src/FLD/pair_brownian.cpp                     |  276 +-
 src/FLD/pair_brownian.h                       |    6 +-
 src/FLD/pair_brownian_poly.cpp                |  194 +-
 src/FLD/pair_brownian_poly.h                  |    4 +-
 src/FLD/pair_lubricate.cpp                    |  248 +-
 src/FLD/pair_lubricate.h                      |    2 +-
 src/FLD/pair_lubricateU.cpp                   | 1088 ++---
 src/FLD/pair_lubricateU.h                     |    2 +-
 src/FLD/pair_lubricateU_poly.cpp              |  812 ++--
 src/FLD/pair_lubricateU_poly.h                |    2 +-
 src/FLD/pair_lubricate_poly.cpp               |  234 +-
 src/FLD/pair_lubricate_poly.h                 |    2 +-
 src/GPU/fix_gpu.cpp                           |   18 +-
 src/GPU/fix_gpu.h                             |    2 +-
 src/GPU/gpu_extra.h                           |   28 +-
 src/GPU/pair_buck_coul_cut_gpu.cpp            |  158 +-
 src/GPU/pair_buck_coul_cut_gpu.h              |    2 +-
 src/GPU/pair_buck_coul_long_gpu.cpp           |  170 +-
 src/GPU/pair_buck_coul_long_gpu.h             |    2 +-
 src/GPU/pair_buck_gpu.cpp                     |  106 +-
 src/GPU/pair_buck_gpu.h                       |    2 +-
 src/GPU/pair_coul_long_gpu.cpp                |  162 +-
 src/GPU/pair_coul_long_gpu.h                  |    2 +-
 src/GPU/pair_eam_alloy_gpu.cpp                |   24 +-
 src/GPU/pair_eam_alloy_gpu.h                  |    2 +-
 src/GPU/pair_eam_fs_gpu.cpp                   |   28 +-
 src/GPU/pair_eam_fs_gpu.h                     |    2 +-
 src/GPU/pair_eam_gpu.cpp                      |   94 +-
 src/GPU/pair_eam_gpu.h                        |    4 +-
 src/GPU/pair_gayberne_gpu.cpp                 |  172 +-
 src/GPU/pair_gayberne_gpu.h                   |    2 +-
 src/GPU/pair_lj96_cut_gpu.cpp                 |   98 +-
 src/GPU/pair_lj96_cut_gpu.h                   |    2 +-
 src/GPU/pair_lj_charmm_coul_long_gpu.cpp      |  242 +-
 src/GPU/pair_lj_charmm_coul_long_gpu.h        |    2 +-
 src/GPU/pair_lj_class2_coul_long_gpu.cpp      |  156 +-
 src/GPU/pair_lj_class2_coul_long_gpu.h        |    2 +-
 src/GPU/pair_lj_class2_gpu.cpp                |   98 +-
 src/GPU/pair_lj_class2_gpu.h                  |    2 +-
 src/GPU/pair_lj_cut_coul_cut_gpu.cpp          |  128 +-
 src/GPU/pair_lj_cut_coul_cut_gpu.h            |    2 +-
 src/GPU/pair_lj_cut_coul_long_gpu.cpp         |  192 +-
 src/GPU/pair_lj_cut_coul_long_gpu.h           |    2 +-
 src/GPU/pair_lj_cut_gpu.cpp                   |  100 +-
 src/GPU/pair_lj_cut_gpu.h                     |    2 +-
 src/GPU/pair_lj_expand_gpu.cpp                |  106 +-
 src/GPU/pair_lj_expand_gpu.h                  |    2 +-
 src/GPU/pair_lj_sdk_coul_long_gpu.cpp         |  194 +-
 src/GPU/pair_lj_sdk_coul_long_gpu.h           |    2 +-
 src/GPU/pair_lj_sdk_gpu.cpp                   |  144 +-
 src/GPU/pair_lj_sdk_gpu.h                     |    2 +-
 src/GPU/pair_morse_gpu.cpp                    |  100 +-
 src/GPU/pair_morse_gpu.h                      |    2 +-
 src/GPU/pair_resquared_gpu.cpp                |   72 +-
 src/GPU/pair_resquared_gpu.h                  |    2 +-
 src/GPU/pair_table_gpu.cpp                    |  200 +-
 src/GPU/pair_table_gpu.h                      |    2 +-
 src/GPU/pair_yukawa_gpu.cpp                   |   98 +-
 src/GPU/pair_yukawa_gpu.h                     |    2 +-
 src/GPU/pppm_gpu.cpp                          |  250 +-
 src/GPU/pppm_gpu.h                            |    6 +-
 src/GRANULAR/fix_freeze.cpp                   |    2 +-
 src/GRANULAR/fix_freeze.h                     |    2 +-
 src/GRANULAR/fix_pour.cpp                     |  114 +-
 src/GRANULAR/fix_pour.h                       |    2 +-
 src/GRANULAR/fix_wall_gran.cpp                |  134 +-
 src/GRANULAR/fix_wall_gran.h                  |   12 +-
 src/GRANULAR/pair_gran_hertz_history.cpp      |  296 +-
 src/GRANULAR/pair_gran_hertz_history.h        |    2 +-
 src/GRANULAR/pair_gran_hooke.cpp              |  206 +-
 src/GRANULAR/pair_gran_hooke.h                |    2 +-
 src/GRANULAR/pair_gran_hooke_history.cpp      |  278 +-
 src/GRANULAR/pair_gran_hooke_history.h        |    2 +-
 src/KIM/pair_kim.cpp                          |  292 +-
 src/KIM/pair_kim.h                            |    6 +-
 src/KSPACE/ewald.cpp                          |  724 ++--
 src/KSPACE/ewald.h                            |    2 +-
 src/KSPACE/fft3d.cpp                          |  216 +-
 src/KSPACE/fft3d.h                            |   52 +-
 src/KSPACE/fft3d_wrap.cpp                     |   18 +-
 src/KSPACE/fft3d_wrap.h                       |    4 +-
 src/KSPACE/kissfft.h                          |   62 +-
 src/KSPACE/pair_born_coul_long.cpp            |  186 +-
 src/KSPACE/pair_born_coul_long.h              |    2 +-
 src/KSPACE/pair_buck_coul_long.cpp            |  140 +-
 src/KSPACE/pair_buck_coul_long.h              |    2 +-
 src/KSPACE/pair_coul_long.cpp                 |  164 +-
 src/KSPACE/pair_coul_long.h                   |    2 +-
 src/KSPACE/pair_lj_charmm_coul_long.cpp       |  634 +--
 src/KSPACE/pair_lj_charmm_coul_long.h         |    2 +-
 src/KSPACE/pair_lj_cut_coul_long.cpp          |  534 +--
 src/KSPACE/pair_lj_cut_coul_long.h            |    2 +-
 src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp    |  466 +-
 src/KSPACE/pair_lj_cut_coul_long_tip4p.h      |    2 +-
 src/KSPACE/pppm.cpp                           | 1110 ++---
 src/KSPACE/pppm.h                             |   16 +-
 src/KSPACE/pppm_cg.cpp                        |  106 +-
 src/KSPACE/pppm_cg.h                          |    2 +-
 src/KSPACE/pppm_tip4p.cpp                     |   54 +-
 src/KSPACE/pppm_tip4p.h                       |    4 +-
 src/KSPACE/remap.cpp                          |  206 +-
 src/KSPACE/remap.h                            |   54 +-
 src/KSPACE/remap_wrap.cpp                     |   18 +-
 src/KSPACE/remap_wrap.h                       |    4 +-
 src/MANYBODY/fix_qeq_comb.cpp                 |   52 +-
 src/MANYBODY/fix_qeq_comb.h                   |    2 +-
 src/MANYBODY/pair_adp.cpp                     |  216 +-
 src/MANYBODY/pair_adp.h                       |    6 +-
 src/MANYBODY/pair_airebo.cpp                  | 3822 ++++++++---------
 src/MANYBODY/pair_airebo.h                    |    4 +-
 src/MANYBODY/pair_comb.cpp                    |  744 ++--
 src/MANYBODY/pair_comb.h                      |   54 +-
 src/MANYBODY/pair_eam.cpp                     |  228 +-
 src/MANYBODY/pair_eam.h                       |    2 +-
 src/MANYBODY/pair_eam_alloy.cpp               |   24 +-
 src/MANYBODY/pair_eam_alloy.h                 |    2 +-
 src/MANYBODY/pair_eam_fs.cpp                  |   28 +-
 src/MANYBODY/pair_eam_fs.h                    |    2 +-
 src/MANYBODY/pair_eim.cpp                     |  108 +-
 src/MANYBODY/pair_eim.h                       |    6 +-
 src/MANYBODY/pair_lcbop.cpp                   |    4 +-
 src/MANYBODY/pair_rebo.cpp                    |    2 +-
 src/MANYBODY/pair_rebo.h                      |    2 +-
 src/MANYBODY/pair_sw.cpp                      |  155 +-
 src/MANYBODY/pair_sw.h                        |    6 +-
 src/MANYBODY/pair_tersoff.cpp                 |  198 +-
 src/MANYBODY/pair_tersoff.h                   |   32 +-
 src/MANYBODY/pair_tersoff_zbl.cpp             |   70 +-
 src/MANYBODY/pair_tersoff_zbl.h               |   10 +-
 src/MC/fix_bond_break.cpp                     |   26 +-
 src/MC/fix_bond_break.h                       |    2 +-
 src/MC/fix_bond_create.cpp                    |   86 +-
 src/MC/fix_bond_create.h                      |    4 +-
 src/MC/fix_bond_swap.cpp                      |  286 +-
 src/MC/fix_bond_swap.h                        |    4 +-
 src/MC/fix_gcmc.cpp                           |  176 +-
 src/MC/fix_gcmc.h                             |   22 +-
 src/MC/pair_dsmc.cpp                          |   78 +-
 src/MC/pair_dsmc.h                            |    6 +-
 src/MEAM/pair_meam.cpp                        |   84 +-
 src/MEAM/pair_meam.h                          |   42 +-
 src/MOLECULE/angle_charmm.cpp                 |   12 +-
 src/MOLECULE/angle_charmm.h                   |    2 +-
 src/MOLECULE/angle_cosine.cpp                 |   12 +-
 src/MOLECULE/angle_cosine.h                   |    2 +-
 src/MOLECULE/angle_cosine_delta.cpp           |   26 +-
 src/MOLECULE/angle_cosine_delta.h             |    2 +-
 src/MOLECULE/angle_cosine_periodic.cpp        |   14 +-
 src/MOLECULE/angle_cosine_periodic.h          |    4 +-
 src/MOLECULE/angle_cosine_squared.cpp         |   16 +-
 src/MOLECULE/angle_cosine_squared.h           |    2 +-
 src/MOLECULE/angle_harmonic.cpp               |   12 +-
 src/MOLECULE/angle_harmonic.h                 |    2 +-
 src/MOLECULE/angle_hybrid.cpp                 |   28 +-
 src/MOLECULE/angle_hybrid.h                   |    4 +-
 src/MOLECULE/angle_table.cpp                  |   76 +-
 src/MOLECULE/angle_table.h                    |    4 +-
 src/MOLECULE/atom_vec_angle.cpp               |  162 +-
 src/MOLECULE/atom_vec_angle.h                 |    2 +-
 src/MOLECULE/atom_vec_bond.cpp                |  144 +-
 src/MOLECULE/atom_vec_bond.h                  |    2 +-
 src/MOLECULE/atom_vec_full.cpp                |  230 +-
 src/MOLECULE/atom_vec_full.h                  |    2 +-
 src/MOLECULE/atom_vec_molecular.cpp           |  228 +-
 src/MOLECULE/atom_vec_molecular.h             |    2 +-
 src/MOLECULE/bond_fene.cpp                    |    8 +-
 src/MOLECULE/bond_fene.h                      |    2 +-
 src/MOLECULE/bond_fene_expand.cpp             |    8 +-
 src/MOLECULE/bond_fene_expand.h               |    2 +-
 src/MOLECULE/bond_harmonic.cpp                |    8 +-
 src/MOLECULE/bond_harmonic.h                  |    2 +-
 src/MOLECULE/bond_morse.cpp                   |    4 +-
 src/MOLECULE/bond_morse.h                     |    2 +-
 src/MOLECULE/bond_nonlinear.cpp               |    2 +-
 src/MOLECULE/bond_nonlinear.h                 |    2 +-
 src/MOLECULE/bond_quartic.cpp                 |   36 +-
 src/MOLECULE/bond_quartic.h                   |    2 +-
 src/MOLECULE/bond_table.cpp                   |   50 +-
 src/MOLECULE/bond_table.h                     |    4 +-
 src/MOLECULE/dihedral_charmm.cpp              |   86 +-
 src/MOLECULE/dihedral_charmm.h                |    2 +-
 src/MOLECULE/dihedral_harmonic.cpp            |   68 +-
 src/MOLECULE/dihedral_harmonic.h              |    2 +-
 src/MOLECULE/dihedral_helix.cpp               |   46 +-
 src/MOLECULE/dihedral_helix.h                 |    2 +-
 src/MOLECULE/dihedral_hybrid.cpp              |   30 +-
 src/MOLECULE/dihedral_hybrid.h                |    4 +-
 src/MOLECULE/dihedral_multi_harmonic.cpp      |   44 +-
 src/MOLECULE/dihedral_multi_harmonic.h        |    2 +-
 src/MOLECULE/dihedral_opls.cpp                |   42 +-
 src/MOLECULE/dihedral_opls.h                  |    2 +-
 src/MOLECULE/improper_cvff.cpp                |   50 +-
 src/MOLECULE/improper_cvff.h                  |    2 +-
 src/MOLECULE/improper_harmonic.cpp            |   44 +-
 src/MOLECULE/improper_harmonic.h              |    2 +-
 src/MOLECULE/improper_hybrid.cpp              |   32 +-
 src/MOLECULE/improper_hybrid.h                |    4 +-
 src/MOLECULE/improper_umbrella.cpp            |   46 +-
 src/MOLECULE/improper_umbrella.h              |    2 +-
 src/MOLECULE/pair_hbond_dreiding_lj.cpp       |  290 +-
 src/MOLECULE/pair_hbond_dreiding_lj.h         |    2 +-
 src/MOLECULE/pair_hbond_dreiding_morse.cpp    |  255 +-
 src/MOLECULE/pair_hbond_dreiding_morse.h      |    2 +-
 src/MOLECULE/pair_lj_charmm_coul_charmm.cpp   |  194 +-
 src/MOLECULE/pair_lj_charmm_coul_charmm.h     |    2 +-
 .../pair_lj_charmm_coul_charmm_implicit.cpp   |  156 +-
 .../pair_lj_charmm_coul_charmm_implicit.h     |    2 +-
 src/OPT/pair_eam_alloy_opt.cpp                |    4 +-
 src/OPT/pair_eam_alloy_opt.h                  |    2 +-
 src/OPT/pair_eam_fs_opt.cpp                   |    4 +-
 src/OPT/pair_eam_fs_opt.h                     |    2 +-
 src/OPT/pair_eam_opt.cpp                      |  254 +-
 src/OPT/pair_eam_opt.h                        |    2 +-
 src/OPT/pair_lj_charmm_coul_long_opt.cpp      |  397 +-
 src/OPT/pair_lj_charmm_coul_long_opt.h        |    4 +-
 src/OPT/pair_lj_cut_coul_long_opt.cpp         |  132 +-
 src/OPT/pair_lj_cut_coul_long_opt.h           |    4 +-
 src/OPT/pair_lj_cut_coul_long_tip4p_opt.cpp   |  472 +-
 src/OPT/pair_lj_cut_coul_long_tip4p_opt.h     |    2 +-
 src/OPT/pair_lj_cut_opt.cpp                   |  162 +-
 src/OPT/pair_lj_cut_opt.h                     |    2 +-
 src/OPT/pair_morse_opt.cpp                    |  154 +-
 src/OPT/pair_morse_opt.h                      |    2 +-
 src/PERI/atom_vec_peri.cpp                    |  192 +-
 src/PERI/atom_vec_peri.h                      |    2 +-
 src/PERI/compute_damage_atom.cpp              |    6 +-
 src/PERI/compute_damage_atom.h                |    2 +-
 src/PERI/fix_peri_neigh.cpp                   |   24 +-
 src/PERI/fix_peri_neigh.h                     |    2 +-
 src/PERI/pair_peri_lps.cpp                    |  230 +-
 src/PERI/pair_peri_lps.h                      |   36 +-
 src/PERI/pair_peri_pmb.cpp                    |   72 +-
 src/PERI/pair_peri_pmb.h                      |    4 +-
 src/POEMS/fix_poems.cpp                       |  316 +-
 src/POEMS/fix_poems.h                         |    6 +-
 src/REAX/fix_reax_bonds.cpp                   |   84 +-
 src/REAX/fix_reax_bonds.h                     |    2 +-
 src/REAX/pair_reax.cpp                        |  244 +-
 src/REAX/pair_reax.h                          |   14 +-
 src/REAX/pair_reax_fortran.h                  |   37 +-
 src/REPLICA/compute_event_displace.cpp        |   34 +-
 src/REPLICA/compute_event_displace.h          |    2 +-
 src/REPLICA/fix_event.cpp                     |   10 +-
 src/REPLICA/fix_event.h                       |    2 +-
 src/REPLICA/fix_event_prd.cpp                 |    8 +-
 src/REPLICA/fix_event_prd.h                   |    2 +-
 src/REPLICA/fix_event_tad.cpp                 |    8 +-
 src/REPLICA/fix_event_tad.h                   |    4 +-
 src/REPLICA/fix_neb.cpp                       |   70 +-
 src/REPLICA/fix_neb.h                         |    2 +-
 src/REPLICA/neb.cpp                           |   98 +-
 src/REPLICA/neb.h                             |    4 +-
 src/REPLICA/prd.cpp                           |  118 +-
 src/REPLICA/prd.h                             |    6 +-
 src/REPLICA/tad.cpp                           |  285 +-
 src/REPLICA/tad.h                             |    4 +-
 src/REPLICA/temper.cpp                        |   58 +-
 src/REPLICA/temper.h                          |    2 +-
 src/REPLICA/verlet_split.cpp                  |  158 +-
 src/REPLICA/verlet_split.h                    |    4 +-
 src/SHOCK/fix_append_atoms.cpp                |  156 +-
 src/SHOCK/fix_append_atoms.h                  |    4 +-
 src/SHOCK/fix_msst.cpp                        |  221 +-
 src/SHOCK/fix_msst.h                          |   14 +-
 src/SHOCK/fix_nphug.cpp                       |   72 +-
 src/SHOCK/fix_nphug.h                         |    4 +-
 src/SHOCK/fix_wall_piston.cpp                 |   56 +-
 src/SHOCK/fix_wall_piston.h                   |    2 +-
 src/SRD/fix_srd.cpp                           | 1156 ++---
 src/SRD/fix_srd.h                             |   26 +-
 src/SRD/fix_wall_srd.cpp                      |   36 +-
 src/SRD/fix_wall_srd.h                        |    4 +-
 src/STUBS/mpi.h                               |   20 +-
 src/USER-ATC/fix_atc.cpp                      |   46 +-
 src/USER-ATC/fix_atc.h                        |    8 +-
 src/USER-AWPMD/atom_vec_wavepacket.cpp        |  286 +-
 src/USER-AWPMD/atom_vec_wavepacket.h          |   14 +-
 src/USER-AWPMD/fix_nve_awpmd.cpp              |   17 +-
 src/USER-AWPMD/fix_nve_awpmd.h                |    2 +-
 src/USER-AWPMD/pair_awpmd_cut.cpp             |  126 +-
 src/USER-AWPMD/pair_awpmd_cut.h               |   18 +-
 src/USER-CG-CMM/angle_cg_cmm.cpp              |   38 +-
 src/USER-CG-CMM/angle_cg_cmm.h                |    6 +-
 src/USER-CG-CMM/angle_sdk.cpp                 |   96 +-
 src/USER-CG-CMM/angle_sdk.h                   |    8 +-
 src/USER-CG-CMM/cg_cmm_parms.cpp              |    2 +-
 src/USER-CG-CMM/cg_cmm_parms.h                |    2 +-
 src/USER-CG-CMM/lj_sdk_common.h               |    7 +-
 src/USER-CG-CMM/pair_cg_cmm.cpp               |   14 +-
 src/USER-CG-CMM/pair_cg_cmm.h                 |    2 +-
 src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp      |   18 +-
 src/USER-CG-CMM/pair_cg_cmm_coul_cut.h        |    2 +-
 src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp     |   62 +-
 src/USER-CG-CMM/pair_cg_cmm_coul_long.h       |    2 +-
 src/USER-CG-CMM/pair_cmm_common.cpp           |   54 +-
 src/USER-CG-CMM/pair_cmm_common.h             |  102 +-
 src/USER-CG-CMM/pair_lj_sdk.cpp               |  148 +-
 src/USER-CG-CMM/pair_lj_sdk.h                 |    6 +-
 src/USER-CG-CMM/pair_lj_sdk_coul_long.cpp     |  262 +-
 src/USER-CG-CMM/pair_lj_sdk_coul_long.h       |    4 +-
 src/USER-COLVARS/colvarproxy_lammps.cpp       |   57 +-
 src/USER-COLVARS/colvarproxy_lammps.h         |   12 +-
 src/USER-COLVARS/fix_colvars.cpp              |  188 +-
 src/USER-COLVARS/fix_colvars.h                |   12 +-
 src/USER-CUDA/atom_vec_angle_cuda.cpp         |  227 +-
 src/USER-CUDA/atom_vec_angle_cuda.h           |   14 +-
 src/USER-CUDA/atom_vec_atomic_cuda.cpp        |  159 +-
 src/USER-CUDA/atom_vec_atomic_cuda.h          |   16 +-
 src/USER-CUDA/atom_vec_charge_cuda.cpp        |  161 +-
 src/USER-CUDA/atom_vec_charge_cuda.h          |   14 +-
 src/USER-CUDA/atom_vec_full_cuda.cpp          |  259 +-
 src/USER-CUDA/atom_vec_full_cuda.h            |   14 +-
 src/USER-CUDA/comm_cuda.cpp                   |  763 ++--
 src/USER-CUDA/comm_cuda.h                     |    8 +-
 src/USER-CUDA/compute_pe_cuda.cpp             |   18 +-
 src/USER-CUDA/compute_pe_cuda.h               |   16 +-
 src/USER-CUDA/compute_pressure_cuda.cpp       |   20 +-
 src/USER-CUDA/compute_pressure_cuda.h         |   16 +-
 src/USER-CUDA/compute_temp_cuda.cpp           |   58 +-
 src/USER-CUDA/compute_temp_cuda.h             |   22 +-
 src/USER-CUDA/compute_temp_partial_cuda.cpp   |   86 +-
 src/USER-CUDA/compute_temp_partial_cuda.h     |   20 +-
 src/USER-CUDA/cuda.cpp                        | 1342 +++---
 src/USER-CUDA/cuda.h                          |  230 +-
 src/USER-CUDA/cuda_data.h                     | 1250 +++---
 src/USER-CUDA/cuda_modify_flags.h             |   14 +-
 src/USER-CUDA/cuda_neigh_list.cpp             |  251 +-
 src/USER-CUDA/cuda_neigh_list.h               |   94 +-
 src/USER-CUDA/domain_cuda.cpp                 |   10 +-
 src/USER-CUDA/domain_cuda.h                   |    4 +-
 src/USER-CUDA/fft3d_cuda.cpp                  |  122 +-
 src/USER-CUDA/fft3d_cuda.h                    |   62 +-
 src/USER-CUDA/fft3d_wrap_cuda.cpp             |   44 +-
 src/USER-CUDA/fft3d_wrap_cuda.h               |   18 +-
 src/USER-CUDA/fix_addforce_cuda.cpp           |   24 +-
 src/USER-CUDA/fix_addforce_cuda.h             |   16 +-
 src/USER-CUDA/fix_aveforce_cuda.cpp           |   38 +-
 src/USER-CUDA/fix_aveforce_cuda.h             |   16 +-
 src/USER-CUDA/fix_enforce2d_cuda.cpp          |   38 +-
 src/USER-CUDA/fix_enforce2d_cuda.h            |   14 +-
 src/USER-CUDA/fix_freeze_cuda.cpp             |   20 +-
 src/USER-CUDA/fix_freeze_cuda.h               |   16 +-
 src/USER-CUDA/fix_gravity_cuda.cpp            |   32 +-
 src/USER-CUDA/fix_gravity_cuda.h              |   14 +-
 src/USER-CUDA/fix_nh_cuda.cpp                 |  655 ++-
 src/USER-CUDA/fix_nh_cuda.h                   |    8 +-
 src/USER-CUDA/fix_npt_cuda.cpp                |    6 +-
 src/USER-CUDA/fix_npt_cuda.h                  |    2 +-
 src/USER-CUDA/fix_nve_cuda.cpp                |  110 +-
 src/USER-CUDA/fix_nve_cuda.h                  |   50 +-
 src/USER-CUDA/fix_nvt_cuda.cpp                |    4 +-
 src/USER-CUDA/fix_nvt_cuda.h                  |    2 +-
 src/USER-CUDA/fix_set_force_cuda.cpp          |   44 +-
 src/USER-CUDA/fix_set_force_cuda.h            |   18 +-
 src/USER-CUDA/fix_shake_cuda.cpp              |  688 +--
 src/USER-CUDA/fix_shake_cuda.h                |   22 +-
 src/USER-CUDA/fix_temp_berendsen_cuda.cpp     |   57 +-
 src/USER-CUDA/fix_temp_berendsen_cuda.h       |   14 +-
 src/USER-CUDA/fix_temp_rescale_cuda.cpp       |   50 +-
 src/USER-CUDA/fix_temp_rescale_cuda.h         |   14 +-
 src/USER-CUDA/fix_temp_rescale_limit_cuda.cpp |   64 +-
 src/USER-CUDA/fix_temp_rescale_limit_cuda.h   |   14 +-
 src/USER-CUDA/fix_viscous_cuda.cpp            |   18 +-
 src/USER-CUDA/fix_viscous_cuda.h              |   14 +-
 src/USER-CUDA/modify_cuda.cpp                 |  240 +-
 src/USER-CUDA/modify_cuda.h                   |    2 +-
 src/USER-CUDA/neigh_full_cuda.cpp             |  257 +-
 src/USER-CUDA/neighbor_cuda.cpp               |   70 +-
 src/USER-CUDA/neighbor_cuda.h                 |    2 +-
 src/USER-CUDA/pair_born_coul_long_cuda.cpp    |  126 +-
 src/USER-CUDA/pair_born_coul_long_cuda.h      |   40 +-
 src/USER-CUDA/pair_buck_coul_cut_cuda.cpp     |  126 +-
 src/USER-CUDA/pair_buck_coul_cut_cuda.h       |   40 +-
 src/USER-CUDA/pair_buck_coul_long_cuda.cpp    |  118 +-
 src/USER-CUDA/pair_buck_coul_long_cuda.h      |   40 +-
 src/USER-CUDA/pair_buck_cuda.cpp              |  116 +-
 src/USER-CUDA/pair_buck_cuda.h                |   40 +-
 src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp   |  138 +-
 src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.h     |   42 +-
 src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp |  138 +-
 src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.h   |   42 +-
 src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp  |  138 +-
 src/USER-CUDA/pair_cg_cmm_coul_long_cuda.h    |   42 +-
 src/USER-CUDA/pair_cg_cmm_cuda.cpp            |  136 +-
 src/USER-CUDA/pair_cg_cmm_cuda.h              |   52 +-
 src/USER-CUDA/pair_eam_alloy_cuda.cpp         |   24 +-
 src/USER-CUDA/pair_eam_alloy_cuda.h           |    2 +-
 src/USER-CUDA/pair_eam_cuda.cpp               |  148 +-
 src/USER-CUDA/pair_eam_cuda.h                 |   58 +-
 src/USER-CUDA/pair_eam_fs_cuda.cpp            |   28 +-
 src/USER-CUDA/pair_eam_fs_cuda.h              |    2 +-
 src/USER-CUDA/pair_gran_hooke_cuda.cpp        |  134 +-
 src/USER-CUDA/pair_gran_hooke_cuda.h          |   40 +-
 src/USER-CUDA/pair_lj96_cut_cuda.cpp          |  114 +-
 src/USER-CUDA/pair_lj96_cut_cuda.h            |   40 +-
 .../pair_lj_charmm_coul_charmm_cuda.cpp       |  154 +-
 .../pair_lj_charmm_coul_charmm_cuda.h         |   48 +-
 ...ir_lj_charmm_coul_charmm_implicit_cuda.cpp |  142 +-
 ...pair_lj_charmm_coul_charmm_implicit_cuda.h |   48 +-
 .../pair_lj_charmm_coul_long_cuda.cpp         |  148 +-
 src/USER-CUDA/pair_lj_charmm_coul_long_cuda.h |   48 +-
 .../pair_lj_class2_coul_cut_cuda.cpp          |  114 +-
 src/USER-CUDA/pair_lj_class2_coul_cut_cuda.h  |   40 +-
 .../pair_lj_class2_coul_long_cuda.cpp         |  102 +-
 src/USER-CUDA/pair_lj_class2_coul_long_cuda.h |   40 +-
 src/USER-CUDA/pair_lj_class2_cuda.cpp         |  102 +-
 src/USER-CUDA/pair_lj_class2_cuda.h           |   40 +-
 src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp   |  114 +-
 src/USER-CUDA/pair_lj_cut_coul_cut_cuda.h     |   40 +-
 src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp |  116 +-
 src/USER-CUDA/pair_lj_cut_coul_debye_cuda.h   |   40 +-
 src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp  |  112 +-
 src/USER-CUDA/pair_lj_cut_coul_long_cuda.h    |   40 +-
 src/USER-CUDA/pair_lj_cut_cuda.cpp            |  112 +-
 src/USER-CUDA/pair_lj_cut_cuda.h              |   40 +-
 .../pair_lj_cut_experimental_cuda.cpp         |  112 +-
 src/USER-CUDA/pair_lj_cut_experimental_cuda.h |   40 +-
 src/USER-CUDA/pair_lj_expand_cuda.cpp         |  120 +-
 src/USER-CUDA/pair_lj_expand_cuda.h           |   40 +-
 .../pair_lj_gromacs_coul_gromacs_cuda.cpp     |  172 +-
 .../pair_lj_gromacs_coul_gromacs_cuda.h       |   58 +-
 src/USER-CUDA/pair_lj_gromacs_cuda.cpp        |  164 +-
 src/USER-CUDA/pair_lj_gromacs_cuda.h          |   58 +-
 src/USER-CUDA/pair_lj_sdk_coul_cut_cuda.cpp   |  138 +-
 src/USER-CUDA/pair_lj_sdk_coul_cut_cuda.h     |   42 +-
 src/USER-CUDA/pair_lj_sdk_coul_debye_cuda.cpp |  138 +-
 src/USER-CUDA/pair_lj_sdk_coul_debye_cuda.h   |   42 +-
 src/USER-CUDA/pair_lj_sdk_coul_long_cuda.cpp  |  130 +-
 src/USER-CUDA/pair_lj_sdk_coul_long_cuda.h    |   42 +-
 src/USER-CUDA/pair_lj_sdk_cuda.cpp            |  128 +-
 src/USER-CUDA/pair_lj_sdk_cuda.h              |   52 +-
 src/USER-CUDA/pair_lj_smooth_cuda.cpp         |  164 +-
 src/USER-CUDA/pair_lj_smooth_cuda.h           |   58 +-
 src/USER-CUDA/pair_morse_cuda.cpp             |  112 +-
 src/USER-CUDA/pair_morse_cuda.h               |   40 +-
 src/USER-CUDA/pair_sw_cuda.cpp                |   88 +-
 src/USER-CUDA/pair_sw_cuda.h                  |   48 +-
 src/USER-CUDA/pair_tersoff_cuda.cpp           |   88 +-
 src/USER-CUDA/pair_tersoff_cuda.h             |   48 +-
 src/USER-CUDA/pair_tersoff_zbl_cuda.cpp       |   34 +-
 src/USER-CUDA/pair_tersoff_zbl_cuda.h         |   32 +-
 src/USER-CUDA/pppm_cuda.cpp                   |  372 +-
 src/USER-CUDA/pppm_cuda.h                     |   48 +-
 src/USER-CUDA/verlet_cuda.cpp                 | 1316 +++---
 src/USER-CUDA/verlet_cuda.h                   |   50 +-
 src/USER-EFF/atom_vec_electron.cpp            |  250 +-
 src/USER-EFF/atom_vec_electron.h              |   14 +-
 src/USER-EFF/compute_ke_atom_eff.cpp          |   12 +-
 src/USER-EFF/compute_ke_atom_eff.h            |    4 +-
 src/USER-EFF/compute_ke_eff.cpp               |    6 +-
 src/USER-EFF/compute_ke_eff.h                 |   10 +-
 src/USER-EFF/compute_temp_deform_eff.cpp      |   51 +-
 src/USER-EFF/compute_temp_deform_eff.h        |    2 +-
 src/USER-EFF/compute_temp_eff.cpp             |   18 +-
 src/USER-EFF/compute_temp_eff.h               |   12 +-
 src/USER-EFF/compute_temp_region_eff.cpp      |   31 +-
 src/USER-EFF/compute_temp_region_eff.h        |    4 +-
 src/USER-EFF/fix_langevin_eff.cpp             |  165 +-
 src/USER-EFF/fix_langevin_eff.h               |    2 +-
 src/USER-EFF/fix_nh_eff.cpp                   |   12 +-
 src/USER-EFF/fix_nh_eff.h                     |    2 +-
 src/USER-EFF/fix_nph_eff.cpp                  |    6 +-
 src/USER-EFF/fix_nph_eff.h                    |    2 +-
 src/USER-EFF/fix_npt_eff.cpp                  |    6 +-
 src/USER-EFF/fix_npt_eff.h                    |    2 +-
 src/USER-EFF/fix_nve_eff.cpp                  |   13 +-
 src/USER-EFF/fix_nve_eff.h                    |    2 +-
 src/USER-EFF/fix_nvt_eff.cpp                  |    4 +-
 src/USER-EFF/fix_nvt_eff.h                    |    2 +-
 src/USER-EFF/fix_nvt_sllod_eff.cpp            |    6 +-
 src/USER-EFF/fix_nvt_sllod_eff.h              |    2 +-
 src/USER-EFF/fix_temp_rescale_eff.cpp         |   31 +-
 src/USER-EFF/fix_temp_rescale_eff.h           |    2 +-
 src/USER-EFF/pair_eff_cut.cpp                 |  162 +-
 src/USER-EFF/pair_eff_cut.h                   |   12 +-
 src/USER-EFF/pair_eff_inline.h                |  122 +-
 src/USER-EWALDN/ewald_n.cpp                   |  683 ++-
 src/USER-EWALDN/ewald_n.h                     |   12 +-
 src/USER-EWALDN/math_complex.h                |    5 +-
 src/USER-EWALDN/math_vector.h                 |  140 +-
 src/USER-EWALDN/pair_buck_coul.cpp            |  596 +--
 src/USER-EWALDN/pair_buck_coul.h              |    4 +-
 src/USER-EWALDN/pair_lj_coul.cpp              |  574 +--
 src/USER-EWALDN/pair_lj_coul.h                |    4 +-
 src/USER-MISC/angle_cosine_shift.cpp          |   20 +-
 src/USER-MISC/angle_cosine_shift.h            |    2 +-
 src/USER-MISC/angle_cosine_shift_exp.cpp      |   28 +-
 src/USER-MISC/angle_cosine_shift_exp.h        |    2 +-
 src/USER-MISC/angle_dipole.cpp                |   22 +-
 src/USER-MISC/angle_dipole.h                  |    2 +-
 src/USER-MISC/bond_harmonic_shift.cpp         |   18 +-
 src/USER-MISC/bond_harmonic_shift.h           |    2 +-
 src/USER-MISC/bond_harmonic_shift_cut.cpp     |   20 +-
 src/USER-MISC/bond_harmonic_shift_cut.h       |    2 +-
 src/USER-MISC/compute_ackland_atom.cpp        |  194 +-
 src/USER-MISC/compute_ackland_atom.h          |    2 +-
 src/USER-MISC/compute_temp_rotate.cpp         |   22 +-
 src/USER-MISC/compute_temp_rotate.h           |    2 +-
 src/USER-MISC/dihedral_cosine_shift_exp.cpp   |   56 +-
 src/USER-MISC/dihedral_cosine_shift_exp.h     |    2 +-
 src/USER-MISC/dihedral_table.cpp              |  208 +-
 src/USER-MISC/dihedral_table.h                |   78 +-
 src/USER-MISC/fix_addtorque.cpp               |   16 +-
 src/USER-MISC/fix_addtorque.h                 |    2 +-
 src/USER-MISC/fix_imd.cpp                     |  161 +-
 src/USER-MISC/fix_imd.h                       |   46 +-
 src/USER-MISC/fix_smd.cpp                     |   44 +-
 src/USER-MISC/fix_smd.h                       |    4 +-
 src/USER-MISC/improper_cossq.cpp              |   38 +-
 src/USER-MISC/improper_cossq.h                |    2 +-
 src/USER-MISC/improper_ring.cpp               |  100 +-
 src/USER-MISC/improper_ring.h                 |    2 +-
 src/USER-MISC/pair_cdeam.cpp                  | 1098 ++---
 src/USER-MISC/pair_cdeam.h                    |   70 +-
 src/USER-MISC/pair_coul_diel.cpp              |   94 +-
 src/USER-MISC/pair_coul_diel.h                |    2 +-
 src/USER-MISC/pair_dipole_sf.cpp              |  322 +-
 src/USER-MISC/pair_dipole_sf.h                |    2 +-
 src/USER-MISC/pair_edip.cpp                   |  214 +-
 src/USER-MISC/pair_edip.h                     |    4 +-
 src/USER-MISC/pair_gauss_cut.cpp              |   97 +-
 src/USER-MISC/pair_gauss_cut.h                |    2 +-
 src/USER-MISC/pair_lj_sf.cpp                  |  122 +-
 src/USER-MISC/pair_lj_sf.h                    |    2 +-
 src/USER-MISC/pair_meam_spline.cpp            |  611 ++-
 src/USER-MISC/pair_meam_spline.h              |  362 +-
 src/USER-MISC/pair_tersoff_table.cpp          |  612 +--
 src/USER-MISC/pair_tersoff_table.h            |    6 +-
 src/USER-OMP/angle_charmm_omp.cpp             |   16 +-
 src/USER-OMP/angle_charmm_omp.h               |    2 +-
 src/USER-OMP/angle_class2_omp.cpp             |   18 +-
 src/USER-OMP/angle_class2_omp.h               |    2 +-
 src/USER-OMP/angle_cosine_delta_omp.cpp       |   32 +-
 src/USER-OMP/angle_cosine_delta_omp.h         |    2 +-
 src/USER-OMP/angle_cosine_omp.cpp             |   12 +-
 src/USER-OMP/angle_cosine_omp.h               |    2 +-
 src/USER-OMP/angle_cosine_periodic_omp.cpp    |   16 +-
 src/USER-OMP/angle_cosine_periodic_omp.h      |    2 +-
 src/USER-OMP/angle_cosine_shift_exp_omp.cpp   |   26 +-
 src/USER-OMP/angle_cosine_shift_exp_omp.h     |    2 +-
 src/USER-OMP/angle_cosine_shift_omp.cpp       |   16 +-
 src/USER-OMP/angle_cosine_shift_omp.h         |    2 +-
 src/USER-OMP/angle_cosine_squared_omp.cpp     |   18 +-
 src/USER-OMP/angle_cosine_squared_omp.h       |    2 +-
 src/USER-OMP/angle_dipole_omp.cpp             |   14 +-
 src/USER-OMP/angle_dipole_omp.h               |    2 +-
 src/USER-OMP/angle_harmonic_omp.cpp           |   16 +-
 src/USER-OMP/angle_harmonic_omp.h             |    2 +-
 src/USER-OMP/angle_sdk_omp.cpp                |   64 +-
 src/USER-OMP/angle_sdk_omp.h                  |    2 +-
 src/USER-OMP/angle_table_omp.cpp              |   20 +-
 src/USER-OMP/angle_table_omp.h                |    2 +-
 src/USER-OMP/bond_class2_omp.cpp              |   12 +-
 src/USER-OMP/bond_class2_omp.h                |    2 +-
 src/USER-OMP/bond_fene_expand_omp.cpp         |   18 +-
 src/USER-OMP/bond_fene_expand_omp.h           |    2 +-
 src/USER-OMP/bond_fene_omp.cpp                |   18 +-
 src/USER-OMP/bond_fene_omp.h                  |    2 +-
 src/USER-OMP/bond_harmonic_omp.cpp            |   12 +-
 src/USER-OMP/bond_harmonic_omp.h              |    2 +-
 src/USER-OMP/bond_harmonic_shift_cut_omp.cpp  |   12 +-
 src/USER-OMP/bond_harmonic_shift_cut_omp.h    |    2 +-
 src/USER-OMP/bond_harmonic_shift_omp.cpp      |   12 +-
 src/USER-OMP/bond_harmonic_shift_omp.h        |    2 +-
 src/USER-OMP/bond_morse_omp.cpp               |   12 +-
 src/USER-OMP/bond_morse_omp.h                 |    2 +-
 src/USER-OMP/bond_nonlinear_omp.cpp           |   12 +-
 src/USER-OMP/bond_nonlinear_omp.h             |    2 +-
 src/USER-OMP/bond_quartic_omp.cpp             |   36 +-
 src/USER-OMP/bond_quartic_omp.h               |    2 +-
 src/USER-OMP/bond_table_omp.cpp               |   12 +-
 src/USER-OMP/bond_table_omp.h                 |    2 +-
 src/USER-OMP/dihedral_charmm_omp.cpp          |   87 +-
 src/USER-OMP/dihedral_charmm_omp.h            |    2 +-
 src/USER-OMP/dihedral_class2_omp.cpp          |  143 +-
 src/USER-OMP/dihedral_class2_omp.h            |    2 +-
 .../dihedral_cosine_shift_exp_omp.cpp         |   55 +-
 src/USER-OMP/dihedral_cosine_shift_exp_omp.h  |    2 +-
 src/USER-OMP/dihedral_harmonic_omp.cpp        |   68 +-
 src/USER-OMP/dihedral_harmonic_omp.h          |    2 +-
 src/USER-OMP/dihedral_helix_omp.cpp           |   44 +-
 src/USER-OMP/dihedral_helix_omp.h             |    2 +-
 src/USER-OMP/dihedral_multi_harmonic_omp.cpp  |   54 +-
 src/USER-OMP/dihedral_multi_harmonic_omp.h    |    2 +-
 src/USER-OMP/dihedral_opls_omp.cpp            |   45 +-
 src/USER-OMP/dihedral_opls_omp.h              |    2 +-
 src/USER-OMP/dihedral_table_omp.cpp           |   52 +-
 src/USER-OMP/dihedral_table_omp.h             |    2 +-
 src/USER-OMP/ewald_omp.cpp                    |  326 +-
 src/USER-OMP/ewald_omp.h                      |    2 +-
 src/USER-OMP/fix_gravity_omp.cpp              |   23 +-
 src/USER-OMP/fix_gravity_omp.h                |    2 +-
 src/USER-OMP/fix_nve_sphere_omp.cpp           |   32 +-
 src/USER-OMP/fix_nve_sphere_omp.h             |    2 +-
 src/USER-OMP/fix_omp.cpp                      |   86 +-
 src/USER-OMP/fix_omp.h                        |    4 +-
 src/USER-OMP/fix_peri_neigh_omp.cpp           |    5 +-
 src/USER-OMP/fix_peri_neigh_omp.h             |    4 +-
 src/USER-OMP/fix_qeq_comb_omp.cpp             |   33 +-
 src/USER-OMP/fix_shear_history_omp.cpp        |   70 +-
 src/USER-OMP/fix_shear_history_omp.h          |    2 +-
 src/USER-OMP/fix_wall_gran_omp.cpp            |   79 +-
 src/USER-OMP/fix_wall_gran_omp.h              |    2 +-
 src/USER-OMP/improper_class2_omp.cpp          |  360 +-
 src/USER-OMP/improper_class2_omp.h            |    4 +-
 src/USER-OMP/improper_cossq_omp.cpp           |  131 +-
 src/USER-OMP/improper_cossq_omp.h             |    2 +-
 src/USER-OMP/improper_cvff_omp.cpp            |   52 +-
 src/USER-OMP/improper_cvff_omp.h              |    2 +-
 src/USER-OMP/improper_harmonic_omp.cpp        |   46 +-
 src/USER-OMP/improper_harmonic_omp.h          |    2 +-
 src/USER-OMP/improper_ring_omp.cpp            |  190 +-
 src/USER-OMP/improper_ring_omp.h              |    2 +-
 src/USER-OMP/improper_umbrella_omp.cpp        |   48 +-
 src/USER-OMP/improper_umbrella_omp.h          |    2 +-
 src/USER-OMP/neigh_derive_omp.cpp             |   17 +-
 src/USER-OMP/neigh_full_omp.cpp               |  204 +-
 src/USER-OMP/neigh_gran_omp.cpp               |  256 +-
 src/USER-OMP/neigh_half_bin_omp.cpp           |  126 +-
 src/USER-OMP/neigh_half_multi_omp.cpp         |  134 +-
 src/USER-OMP/neigh_half_nsq_omp.cpp           |   42 +-
 src/USER-OMP/neigh_respa_omp.cpp              |  324 +-
 src/USER-OMP/neighbor_omp.h                   |   30 +-
 src/USER-OMP/pair_adp_omp.cpp                 |  174 +-
 src/USER-OMP/pair_adp_omp.h                   |    2 +-
 src/USER-OMP/pair_airebo_omp.cpp              | 3174 +++++++-------
 src/USER-OMP/pair_airebo_omp.h                |   10 +-
 src/USER-OMP/pair_beck_omp.cpp                |   48 +-
 src/USER-OMP/pair_beck_omp.h                  |    2 +-
 src/USER-OMP/pair_born_coul_long_omp.cpp      |   98 +-
 src/USER-OMP/pair_born_coul_long_omp.h        |    2 +-
 src/USER-OMP/pair_born_coul_wolf_omp.cpp      |   94 +-
 src/USER-OMP/pair_born_coul_wolf_omp.h        |    2 +-
 src/USER-OMP/pair_born_omp.cpp                |   58 +-
 src/USER-OMP/pair_born_omp.h                  |    2 +-
 src/USER-OMP/pair_brownian_omp.cpp            |  198 +-
 src/USER-OMP/pair_brownian_omp.h              |    2 +-
 src/USER-OMP/pair_brownian_poly_omp.cpp       |  170 +-
 src/USER-OMP/pair_brownian_poly_omp.h         |    2 +-
 src/USER-OMP/pair_buck_coul_cut_omp.cpp       |   82 +-
 src/USER-OMP/pair_buck_coul_cut_omp.h         |    2 +-
 src/USER-OMP/pair_buck_coul_long_omp.cpp      |   96 +-
 src/USER-OMP/pair_buck_coul_long_omp.h        |    2 +-
 src/USER-OMP/pair_buck_coul_omp.cpp           |  156 +-
 src/USER-OMP/pair_buck_coul_omp.h             |    2 +-
 src/USER-OMP/pair_buck_omp.cpp                |   62 +-
 src/USER-OMP/pair_buck_omp.h                  |    2 +-
 src/USER-OMP/pair_cdeam_omp.cpp               |  362 +-
 src/USER-OMP/pair_cdeam_omp.h                 |    4 +-
 src/USER-OMP/pair_colloid_omp.cpp             |  154 +-
 src/USER-OMP/pair_colloid_omp.h               |    2 +-
 src/USER-OMP/pair_comb_omp.cpp                |  262 +-
 src/USER-OMP/pair_coul_cut_omp.cpp            |   46 +-
 src/USER-OMP/pair_coul_cut_omp.h              |    2 +-
 src/USER-OMP/pair_coul_debye_omp.cpp          |   50 +-
 src/USER-OMP/pair_coul_debye_omp.h            |    2 +-
 src/USER-OMP/pair_coul_diel_omp.cpp           |   58 +-
 src/USER-OMP/pair_coul_diel_omp.h             |    2 +-
 src/USER-OMP/pair_coul_long_omp.cpp           |  104 +-
 src/USER-OMP/pair_coul_long_omp.h             |    2 +-
 src/USER-OMP/pair_coul_wolf_omp.cpp           |   70 +-
 src/USER-OMP/pair_coul_wolf_omp.h             |    2 +-
 src/USER-OMP/pair_dipole_cut_omp.cpp          |  228 +-
 src/USER-OMP/pair_dipole_cut_omp.h            |    2 +-
 src/USER-OMP/pair_dipole_sf_omp.cpp           |  284 +-
 src/USER-OMP/pair_dipole_sf_omp.h             |    2 +-
 src/USER-OMP/pair_dpd_omp.cpp                 |   88 +-
 src/USER-OMP/pair_dpd_omp.h                   |    2 +-
 src/USER-OMP/pair_dpd_tstat_omp.cpp           |   74 +-
 src/USER-OMP/pair_dpd_tstat_omp.h             |    2 +-
 src/USER-OMP/pair_eam_alloy_omp.cpp           |   24 +-
 src/USER-OMP/pair_eam_alloy_omp.h             |    2 +-
 src/USER-OMP/pair_eam_fs_omp.cpp              |   28 +-
 src/USER-OMP/pair_eam_fs_omp.h                |    2 +-
 src/USER-OMP/pair_eam_omp.cpp                 |  126 +-
 src/USER-OMP/pair_eam_omp.h                   |    2 +-
 src/USER-OMP/pair_edip_omp.cpp                |  116 +-
 src/USER-OMP/pair_eim_omp.cpp                 |   98 +-
 src/USER-OMP/pair_eim_omp.h                   |    2 +-
 src/USER-OMP/pair_gauss_cut_omp.cpp           |   50 +-
 src/USER-OMP/pair_gauss_cut_omp.h             |    2 +-
 src/USER-OMP/pair_gauss_omp.cpp               |   58 +-
 src/USER-OMP/pair_gauss_omp.h                 |    2 +-
 src/USER-OMP/pair_gayberne_omp.cpp            |  120 +-
 src/USER-OMP/pair_gayberne_omp.h              |    2 +-
 src/USER-OMP/pair_gran_hertz_history_omp.cpp  |  216 +-
 src/USER-OMP/pair_gran_hertz_history_omp.h    |    2 +-
 src/USER-OMP/pair_gran_hooke_history_omp.cpp  |  224 +-
 src/USER-OMP/pair_gran_hooke_history_omp.h    |    2 +-
 src/USER-OMP/pair_gran_hooke_omp.cpp          |  190 +-
 src/USER-OMP/pair_gran_hooke_omp.h            |    2 +-
 src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp   |  212 +-
 src/USER-OMP/pair_hbond_dreiding_lj_omp.h     |    2 +-
 .../pair_hbond_dreiding_morse_omp.cpp         |  210 +-
 src/USER-OMP/pair_hbond_dreiding_morse_omp.h  |    2 +-
 src/USER-OMP/pair_line_lj_omp.cpp             |  342 +-
 src/USER-OMP/pair_line_lj_omp.h               |    2 +-
 src/USER-OMP/pair_lj96_cut_omp.cpp            |   56 +-
 src/USER-OMP/pair_lj96_cut_omp.h              |    2 +-
 ...air_lj_charmm_coul_charmm_implicit_omp.cpp |  136 +-
 .../pair_lj_charmm_coul_charmm_implicit_omp.h |    2 +-
 .../pair_lj_charmm_coul_charmm_omp.cpp        |  136 +-
 src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h |    2 +-
 src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp |  172 +-
 src/USER-OMP/pair_lj_charmm_coul_long_omp.h   |    2 +-
 src/USER-OMP/pair_lj_charmm_coul_pppm_omp.cpp |  176 +-
 src/USER-OMP/pair_lj_charmm_coul_pppm_omp.h   |    2 +-
 src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp  |   86 +-
 src/USER-OMP/pair_lj_class2_coul_cut_omp.h    |    2 +-
 src/USER-OMP/pair_lj_class2_coul_long_omp.cpp |  102 +-
 src/USER-OMP/pair_lj_class2_coul_long_omp.h   |    2 +-
 src/USER-OMP/pair_lj_class2_coul_pppm_omp.cpp |  114 +-
 src/USER-OMP/pair_lj_class2_coul_pppm_omp.h   |    2 +-
 src/USER-OMP/pair_lj_class2_omp.cpp           |   56 +-
 src/USER-OMP/pair_lj_class2_omp.h             |    2 +-
 src/USER-OMP/pair_lj_coul_omp.cpp             |  164 +-
 src/USER-OMP/pair_lj_coul_omp.h               |    2 +-
 src/USER-OMP/pair_lj_cubic_omp.cpp            |   64 +-
 src/USER-OMP/pair_lj_cubic_omp.h              |    2 +-
 src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp     |   84 +-
 src/USER-OMP/pair_lj_cut_coul_cut_omp.h       |    2 +-
 src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp   |   88 +-
 src/USER-OMP/pair_lj_cut_coul_debye_omp.h     |    2 +-
 src/USER-OMP/pair_lj_cut_coul_long_omp.cpp    |  138 +-
 src/USER-OMP/pair_lj_cut_coul_long_omp.h      |    2 +-
 .../pair_lj_cut_coul_long_tip4p_omp.cpp       |  472 +-
 .../pair_lj_cut_coul_long_tip4p_omp.h         |    2 +-
 src/USER-OMP/pair_lj_cut_coul_pppm_omp.cpp    |  150 +-
 src/USER-OMP/pair_lj_cut_coul_pppm_omp.h      |    2 +-
 .../pair_lj_cut_coul_pppm_tip4p_omp.cpp       |  492 +--
 .../pair_lj_cut_coul_pppm_tip4p_omp.h         |    2 +-
 src/USER-OMP/pair_lj_cut_omp.cpp              |   52 +-
 src/USER-OMP/pair_lj_cut_omp.h                |    2 +-
 src/USER-OMP/pair_lj_expand_omp.cpp           |   58 +-
 src/USER-OMP/pair_lj_expand_omp.h             |    2 +-
 .../pair_lj_gromacs_coul_gromacs_omp.cpp      |  104 +-
 .../pair_lj_gromacs_coul_gromacs_omp.h        |    2 +-
 src/USER-OMP/pair_lj_gromacs_omp.cpp          |   54 +-
 src/USER-OMP/pair_lj_gromacs_omp.h            |    2 +-
 src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp    |  196 +-
 src/USER-OMP/pair_lj_sdk_coul_long_omp.h      |    2 +-
 src/USER-OMP/pair_lj_sdk_omp.cpp              |   96 +-
 src/USER-OMP/pair_lj_sdk_omp.h                |    2 +-
 src/USER-OMP/pair_lj_sf_omp.cpp               |   58 +-
 src/USER-OMP/pair_lj_sf_omp.h                 |    2 +-
 src/USER-OMP/pair_lj_smooth_linear_omp.cpp    |   52 +-
 src/USER-OMP/pair_lj_smooth_linear_omp.h      |    2 +-
 src/USER-OMP/pair_lj_smooth_omp.cpp           |   82 +-
 src/USER-OMP/pair_lj_smooth_omp.h             |    2 +-
 src/USER-OMP/pair_lubricate_omp.cpp           |  196 +-
 src/USER-OMP/pair_lubricate_omp.h             |    2 +-
 src/USER-OMP/pair_lubricate_poly_omp.cpp      |  206 +-
 src/USER-OMP/pair_lubricate_poly_omp.h        |    2 +-
 src/USER-OMP/pair_meam_spline_omp.cpp         |  192 +-
 src/USER-OMP/pair_meam_spline_omp.h           |    2 +-
 src/USER-OMP/pair_morse_omp.cpp               |   52 +-
 src/USER-OMP/pair_morse_omp.h                 |    2 +-
 src/USER-OMP/pair_peri_lps_omp.cpp            |   91 +-
 src/USER-OMP/pair_peri_lps_omp.h              |    2 +-
 src/USER-OMP/pair_peri_pmb_omp.cpp            |   58 +-
 src/USER-OMP/pair_peri_pmb_omp.h              |    2 +-
 src/USER-OMP/pair_rebo_omp.cpp                |    2 +-
 src/USER-OMP/pair_rebo_omp.h                  |    2 +-
 src/USER-OMP/pair_resquared_omp.cpp           |   22 +-
 src/USER-OMP/pair_resquared_omp.h             |    2 +-
 src/USER-OMP/pair_soft_omp.cpp                |   48 +-
 src/USER-OMP/pair_soft_omp.h                  |    2 +-
 src/USER-OMP/pair_sw_omp.cpp                  |   68 +-
 src/USER-OMP/pair_sw_omp.h                    |    2 +-
 src/USER-OMP/pair_table_omp.cpp               |  146 +-
 src/USER-OMP/pair_table_omp.h                 |    2 +-
 src/USER-OMP/pair_tersoff_omp.cpp             |  100 +-
 src/USER-OMP/pair_tersoff_table_omp.cpp       |  472 +-
 src/USER-OMP/pair_tersoff_zbl_omp.cpp         |   71 +-
 src/USER-OMP/pair_tersoff_zbl_omp.h           |    6 +-
 src/USER-OMP/pair_tri_lj_omp.cpp              |  480 +--
 src/USER-OMP/pair_tri_lj_omp.h                |    2 +-
 src/USER-OMP/pair_yukawa_colloid_omp.cpp      |   52 +-
 src/USER-OMP/pair_yukawa_colloid_omp.h        |    2 +-
 src/USER-OMP/pair_yukawa_omp.cpp              |   56 +-
 src/USER-OMP/pair_yukawa_omp.h                |    2 +-
 src/USER-OMP/pppm_cg_omp.cpp                  |  395 +-
 src/USER-OMP/pppm_cg_omp.h                    |    4 +-
 src/USER-OMP/pppm_omp.cpp                     |  396 +-
 src/USER-OMP/pppm_omp.h                       |    4 +-
 src/USER-OMP/pppm_proxy.cpp                   |    3 +-
 src/USER-OMP/pppm_proxy.h                     |    2 +-
 src/USER-OMP/pppm_tip4p_omp.cpp               |  238 +-
 src/USER-OMP/pppm_tip4p_omp.h                 |    6 +-
 src/USER-OMP/pppm_tip4p_proxy.cpp             |    3 +-
 src/USER-OMP/pppm_tip4p_proxy.h               |    2 +-
 src/USER-OMP/thr_data.cpp                     |   21 +-
 src/USER-OMP/thr_data.h                       |    6 +-
 src/USER-OMP/thr_omp.cpp                      |  716 +--
 src/USER-OMP/thr_omp.h                        |   84 +-
 src/USER-REAXC/fix_qeq_reax.cpp               |  112 +-
 src/USER-REAXC/fix_qeq_reax.h                 |   14 +-
 src/USER-REAXC/fix_reax_c.cpp                 |   10 +-
 src/USER-REAXC/fix_reax_c.h                   |    4 +-
 src/USER-REAXC/fix_reaxc_bonds.cpp            |   97 +-
 src/USER-REAXC/fix_reaxc_bonds.h              |    2 +-
 src/USER-REAXC/pair_reax_c.cpp                |  194 +-
 src/USER-REAXC/pair_reax_c.h                  |    6 +-
 src/USER-REAXC/reaxc_allocate.cpp             |  430 +-
 src/USER-REAXC/reaxc_allocate.h               |   14 +-
 src/USER-REAXC/reaxc_basic_comm.cpp           |   92 +-
 src/USER-REAXC/reaxc_basic_comm.h             |   10 +-
 src/USER-REAXC/reaxc_bond_orders.cpp          |  880 ++--
 src/USER-REAXC/reaxc_bond_orders.h            |   26 +-
 src/USER-REAXC/reaxc_bonds.cpp                |  160 +-
 src/USER-REAXC/reaxc_bonds.h                  |   10 +-
 src/USER-REAXC/reaxc_control.cpp              |   56 +-
 src/USER-REAXC/reaxc_control.h                |    6 +-
 src/USER-REAXC/reaxc_defs.h                   |   42 +-
 src/USER-REAXC/reaxc_ffield.cpp               |  606 +--
 src/USER-REAXC/reaxc_ffield.h                 |    6 +-
 src/USER-REAXC/reaxc_forces.cpp               |  714 +--
 src/USER-REAXC/reaxc_forces.h                 |   14 +-
 src/USER-REAXC/reaxc_hydrogen_bonds.cpp       |  282 +-
 src/USER-REAXC/reaxc_hydrogen_bonds.h         |    8 +-
 src/USER-REAXC/reaxc_init_md.cpp              |  408 +-
 src/USER-REAXC/reaxc_init_md.h                |   12 +-
 src/USER-REAXC/reaxc_io_tools.cpp             | 1152 ++---
 src/USER-REAXC/reaxc_io_tools.h               |  108 +-
 src/USER-REAXC/reaxc_list.cpp                 |   42 +-
 src/USER-REAXC/reaxc_list.h                   |    6 +-
 src/USER-REAXC/reaxc_lookup.cpp               |  226 +-
 src/USER-REAXC/reaxc_lookup.h                 |   10 +-
 src/USER-REAXC/reaxc_multi_body.cpp           |  268 +-
 src/USER-REAXC/reaxc_multi_body.h             |    9 +-
 src/USER-REAXC/reaxc_nonbonded.cpp            |  342 +-
 src/USER-REAXC/reaxc_nonbonded.h              |   16 +-
 src/USER-REAXC/reaxc_reset_tools.cpp          |   59 +-
 src/USER-REAXC/reaxc_reset_tools.h            |   12 +-
 src/USER-REAXC/reaxc_system_props.cpp         |  218 +-
 src/USER-REAXC/reaxc_system_props.h           |   14 +-
 src/USER-REAXC/reaxc_tool_box.cpp             |   95 +-
 src/USER-REAXC/reaxc_tool_box.h               |    6 +-
 src/USER-REAXC/reaxc_torsion_angles.cpp       |  846 ++--
 src/USER-REAXC/reaxc_torsion_angles.h         |    8 +-
 src/USER-REAXC/reaxc_traj.cpp                 |  876 ++--
 src/USER-REAXC/reaxc_traj.h                   |   14 +-
 src/USER-REAXC/reaxc_types.h                  |  162 +-
 src/USER-REAXC/reaxc_valence_angles.cpp       |  788 ++--
 src/USER-REAXC/reaxc_valence_angles.h         |   12 +-
 src/USER-REAXC/reaxc_vector.cpp               |   69 +-
 src/USER-REAXC/reaxc_vector.h                 |    6 +-
 src/USER-SPH/atom_vec_meso.cpp                | 1308 +++---
 src/USER-SPH/atom_vec_meso.h                  |    2 +-
 src/USER-SPH/compute_meso_e_atom.cpp          |    6 +-
 src/USER-SPH/compute_meso_e_atom.h            |    2 +-
 src/USER-SPH/compute_meso_rho_atom.cpp        |    6 +-
 src/USER-SPH/compute_meso_rho_atom.h          |    2 +-
 src/USER-SPH/compute_meso_t_atom.cpp          |   12 +-
 src/USER-SPH/compute_meso_t_atom.h            |    2 +-
 src/USER-SPH/fix_meso.cpp                     |    1 -
 src/USER-SPH/fix_meso.h                       |    2 +-
 src/USER-SPH/fix_meso_stationary.cpp          |    1 -
 src/USER-SPH/fix_meso_stationary.h            |    2 +-
 src/USER-SPH/pair_sph_heatconduction.h        |    2 +-
 src/USER-SPH/pair_sph_idealgas.h              |    2 +-
 src/USER-SPH/pair_sph_lj.h                    |    2 +-
 src/USER-SPH/pair_sph_rhosum.cpp              |    1 -
 src/USER-SPH/pair_sph_rhosum.h                |    2 +-
 src/USER-SPH/pair_sph_taitwater.h             |    2 +-
 src/USER-SPH/pair_sph_taitwater_morris.h      |    2 +-
 src/XTC/dump_xtc.cpp                          |  490 +--
 src/XTC/dump_xtc.h                            |    4 +-
 src/XTC/xdr_compat.cpp                        |  232 +-
 src/XTC/xdr_compat.h                          |   97 +-
 src/accelerator_cuda.h                        |    6 +-
 src/accelerator_omp.h                         |    2 +-
 src/angle.cpp                                 |  114 +-
 src/angle.h                                   |    4 +-
 src/atom.cpp                                  |  244 +-
 src/atom.h                                    |    6 +-
 src/atom_vec.cpp                              |    2 +-
 src/atom_vec.h                                |    4 +-
 src/atom_vec_atomic.cpp                       |  126 +-
 src/atom_vec_atomic.h                         |    2 +-
 src/atom_vec_charge.cpp                       |  132 +-
 src/atom_vec_charge.h                         |    2 +-
 src/atom_vec_ellipsoid.cpp                    |  316 +-
 src/atom_vec_ellipsoid.h                      |    2 +-
 src/atom_vec_hybrid.cpp                       |  236 +-
 src/atom_vec_hybrid.h                         |    2 +-
 src/atom_vec_line.cpp                         |  202 +-
 src/atom_vec_line.h                           |    2 +-
 src/atom_vec_sphere.cpp                       |  378 +-
 src/atom_vec_sphere.h                         |    2 +-
 src/atom_vec_tri.cpp                          |  448 +-
 src/atom_vec_tri.h                            |    2 +-
 src/balance.cpp                               |  264 +-
 src/balance.h                                 |    2 +-
 src/bond.cpp                                  |   82 +-
 src/bond.h                                    |    2 +-
 src/bond_hybrid.cpp                           |   28 +-
 src/bond_hybrid.h                             |    4 +-
 src/change_box.cpp                            |  232 +-
 src/change_box.h                              |    2 +-
 src/comm.cpp                                  |  704 +--
 src/comm.h                                    |    4 +-
 src/compute.cpp                               |   12 +-
 src/compute.h                                 |    2 +-
 src/compute_angle_local.cpp                   |   68 +-
 src/compute_angle_local.h                     |    2 +-
 src/compute_atom_molecule.cpp                 |  100 +-
 src/compute_atom_molecule.h                   |    2 +-
 src/compute_bond_local.cpp                    |   28 +-
 src/compute_bond_local.h                      |    2 +-
 src/compute_centro_atom.cpp                   |  100 +-
 src/compute_centro_atom.h                     |    2 +-
 src/compute_cluster_atom.cpp                  |   64 +-
 src/compute_cluster_atom.h                    |    2 +-
 src/compute_cna_atom.cpp                      |  176 +-
 src/compute_cna_atom.h                        |    2 +-
 src/compute_com.cpp                           |    2 +-
 src/compute_com.h                             |    2 +-
 src/compute_com_molecule.cpp                  |    4 +-
 src/compute_com_molecule.h                    |    2 +-
 src/compute_coord_atom.cpp                    |   24 +-
 src/compute_coord_atom.h                      |    2 +-
 src/compute_dihedral_local.cpp                |  102 +-
 src/compute_dihedral_local.h                  |    2 +-
 src/compute_displace_atom.cpp                 |   46 +-
 src/compute_displace_atom.h                   |    2 +-
 src/compute_erotate_sphere.cpp                |   10 +-
 src/compute_erotate_sphere.h                  |    2 +-
 src/compute_group_group.cpp                   |  140 +-
 src/compute_group_group.h                     |    2 +-
 src/compute_gyration.cpp                      |    2 +-
 src/compute_gyration.h                        |    2 +-
 src/compute_gyration_molecule.cpp             |    8 +-
 src/compute_gyration_molecule.h               |    2 +-
 src/compute_heat_flux.cpp                     |   30 +-
 src/compute_heat_flux.h                       |    2 +-
 src/compute_improper_local.cpp                |   96 +-
 src/compute_improper_local.h                  |    2 +-
 src/compute_ke.cpp                            |   10 +-
 src/compute_ke.h                              |    2 +-
 src/compute_ke_atom.cpp                       |   10 +-
 src/compute_ke_atom.h                         |    2 +-
 src/compute_msd.cpp                           |   46 +-
 src/compute_msd.h                             |    2 +-
 src/compute_msd_molecule.cpp                  |    4 +-
 src/compute_msd_molecule.h                    |    2 +-
 src/compute_pair.cpp                          |    8 +-
 src/compute_pair.h                            |    2 +-
 src/compute_pair_local.cpp                    |   72 +-
 src/compute_pair_local.h                      |    4 +-
 src/compute_pe.cpp                            |    4 +-
 src/compute_pe.h                              |    2 +-
 src/compute_pe_atom.cpp                       |    6 +-
 src/compute_pe_atom.h                         |    2 +-
 src/compute_pressure.cpp                      |   30 +-
 src/compute_pressure.h                        |    2 +-
 src/compute_property_atom.cpp                 |  162 +-
 src/compute_property_atom.h                   |    2 +-
 src/compute_property_local.cpp                |  108 +-
 src/compute_property_local.h                  |    2 +-
 src/compute_property_molecule.cpp             |    4 +-
 src/compute_property_molecule.h               |    2 +-
 src/compute_rdf.cpp                           |   54 +-
 src/compute_rdf.h                             |   14 +-
 src/compute_reduce.cpp                        |  308 +-
 src/compute_reduce.h                          |    2 +-
 src/compute_reduce_region.cpp                 |  140 +-
 src/compute_reduce_region.h                   |    2 +-
 src/compute_slice.cpp                         |  164 +-
 src/compute_slice.h                           |    2 +-
 src/compute_stress_atom.cpp                   |   66 +-
 src/compute_stress_atom.h                     |    2 +-
 src/compute_temp.cpp                          |   10 +-
 src/compute_temp.h                            |    2 +-
 src/compute_temp_com.cpp                      |   12 +-
 src/compute_temp_com.h                        |    2 +-
 src/compute_temp_deform.cpp                   |   34 +-
 src/compute_temp_deform.h                     |    2 +-
 src/compute_temp_partial.cpp                  |   30 +-
 src/compute_temp_partial.h                    |    2 +-
 src/compute_temp_profile.cpp                  |   88 +-
 src/compute_temp_profile.h                    |    4 +-
 src/compute_temp_ramp.cpp                     |   12 +-
 src/compute_temp_ramp.h                       |    2 +-
 src/compute_temp_region.cpp                   |   28 +-
 src/compute_temp_region.h                     |    2 +-
 src/compute_temp_sphere.cpp                   |  138 +-
 src/compute_temp_sphere.h                     |    2 +-
 src/compute_ti.cpp                            |   22 +-
 src/compute_ti.h                              |    6 +-
 src/create_atoms.cpp                          |  108 +-
 src/create_atoms.h                            |    2 +-
 src/create_box.cpp                            |    4 +-
 src/create_box.h                              |    2 +-
 src/delete_atoms.cpp                          |   38 +-
 src/delete_atoms.h                            |    2 +-
 src/delete_bonds.cpp                          |  412 +-
 src/delete_bonds.h                            |    2 +-
 src/dihedral.cpp                              |  150 +-
 src/dihedral.h                                |    6 +-
 src/displace_atoms.cpp                        |   42 +-
 src/displace_atoms.h                          |    2 +-
 src/domain.cpp                                |  472 +-
 src/domain.h                                  |   10 +-
 src/dump.cpp                                  |  156 +-
 src/dump.h                                    |    2 +-
 src/dump_atom.cpp                             |   16 +-
 src/dump_atom.h                               |    2 +-
 src/dump_cfg.cpp                              |  112 +-
 src/dump_cfg.h                                |    2 +-
 src/dump_custom.cpp                           |  860 ++--
 src/dump_custom.h                             |    4 +-
 src/dump_dcd.cpp                              |   48 +-
 src/dump_dcd.h                                |    2 +-
 src/dump_image.cpp                            |  342 +-
 src/dump_image.h                              |    2 +-
 src/dump_local.cpp                            |   54 +-
 src/dump_local.h                              |    2 +-
 src/dump_xyz.cpp                              |    8 +-
 src/dump_xyz.h                                |    2 +-
 src/error.cpp                                 |   18 +-
 src/error.h                                   |    2 +-
 src/finish.cpp                                |  520 +--
 src/finish.h                                  |    2 +-
 src/fix.cpp                                   |    4 +-
 src/fix.h                                     |    2 +-
 src/fix_adapt.cpp                             |  130 +-
 src/fix_adapt.h                               |    2 +-
 src/fix_addforce.cpp                          |   86 +-
 src/fix_addforce.h                            |    2 +-
 src/fix_ave_atom.cpp                          |  112 +-
 src/fix_ave_atom.h                            |    2 +-
 src/fix_ave_correlate.cpp                     |  190 +-
 src/fix_ave_correlate.h                       |    4 +-
 src/fix_ave_histo.cpp                         |  444 +-
 src/fix_ave_histo.h                           |    2 +-
 src/fix_ave_spatial.cpp                       |  604 +--
 src/fix_ave_spatial.h                         |    4 +-
 src/fix_ave_time.cpp                          |  462 +-
 src/fix_ave_time.h                            |    2 +-
 src/fix_aveforce.cpp                          |   42 +-
 src/fix_aveforce.h                            |    2 +-
 src/fix_box_relax.cpp                         |  102 +-
 src/fix_box_relax.h                           |    4 +-
 src/fix_deform.cpp                            |  564 +--
 src/fix_deform.h                              |    2 +-
 src/fix_deposit.cpp                           |   90 +-
 src/fix_deposit.h                             |    2 +-
 src/fix_drag.cpp                              |   24 +-
 src/fix_drag.h                                |    2 +-
 src/fix_dt_reset.cpp                          |   10 +-
 src/fix_dt_reset.h                            |    2 +-
 src/fix_efield.cpp                            |   26 +-
 src/fix_efield.h                              |    2 +-
 src/fix_enforce2d.cpp                         |   14 +-
 src/fix_enforce2d.h                           |    2 +-
 src/fix_evaporate.cpp                         |  128 +-
 src/fix_evaporate.h                           |    2 +-
 src/fix_external.cpp                          |    6 +-
 src/fix_external.h                            |    2 +-
 src/fix_gravity.cpp                           |   40 +-
 src/fix_gravity.h                             |    2 +-
 src/fix_heat.cpp                              |   26 +-
 src/fix_heat.h                                |    2 +-
 src/fix_indent.cpp                            |  256 +-
 src/fix_indent.h                              |    2 +-
 src/fix_langevin.cpp                          |  362 +-
 src/fix_langevin.h                            |    2 +-
 src/fix_lineforce.cpp                         |    2 +-
 src/fix_lineforce.h                           |    2 +-
 src/fix_minimize.cpp                          |   16 +-
 src/fix_minimize.h                            |    2 +-
 src/fix_momentum.cpp                          |   36 +-
 src/fix_momentum.h                            |    2 +-
 src/fix_move.cpp                              |  536 +--
 src/fix_move.h                                |    2 +-
 src/fix_nh.cpp                                |  598 +--
 src/fix_nh.h                                  |   16 +-
 src/fix_nh_sphere.cpp                         |    6 +-
 src/fix_nh_sphere.h                           |    2 +-
 src/fix_nph.cpp                               |    6 +-
 src/fix_nph.h                                 |    2 +-
 src/fix_nph_sphere.cpp                        |    6 +-
 src/fix_nph_sphere.h                          |    2 +-
 src/fix_npt.cpp                               |    6 +-
 src/fix_npt.h                                 |    2 +-
 src/fix_npt_sphere.cpp                        |    6 +-
 src/fix_npt_sphere.h                          |    2 +-
 src/fix_nve.cpp                               |   46 +-
 src/fix_nve.h                                 |    2 +-
 src/fix_nve_limit.cpp                         |  122 +-
 src/fix_nve_limit.h                           |    2 +-
 src/fix_nve_noforce.cpp                       |    2 +-
 src/fix_nve_noforce.h                         |    2 +-
 src/fix_nve_sphere.cpp                        |   28 +-
 src/fix_nve_sphere.h                          |    2 +-
 src/fix_nvt.cpp                               |    4 +-
 src/fix_nvt.h                                 |    2 +-
 src/fix_nvt_sllod.cpp                         |    8 +-
 src/fix_nvt_sllod.h                           |    2 +-
 src/fix_nvt_sphere.cpp                        |    4 +-
 src/fix_nvt_sphere.h                          |    2 +-
 src/fix_orient_fcc.cpp                        |  104 +-
 src/fix_orient_fcc.h                          |    4 +-
 src/fix_planeforce.cpp                        |    2 +-
 src/fix_planeforce.h                          |    2 +-
 src/fix_press_berendsen.cpp                   |  104 +-
 src/fix_press_berendsen.h                     |    2 +-
 src/fix_print.cpp                             |   16 +-
 src/fix_print.h                               |    2 +-
 src/fix_read_restart.cpp                      |    4 +-
 src/fix_read_restart.h                        |    2 +-
 src/fix_recenter.cpp                          |    2 +-
 src/fix_recenter.h                            |    4 +-
 src/fix_respa.cpp                             |   12 +-
 src/fix_respa.h                               |    2 +-
 src/fix_restrain.cpp                          |  180 +-
 src/fix_restrain.h                            |    2 +-
 src/fix_rigid.cpp                             |  646 +--
 src/fix_rigid.h                               |    2 +-
 src/fix_rigid_nve.cpp                         |  100 +-
 src/fix_rigid_nve.h                           |    2 +-
 src/fix_rigid_nvt.cpp                         |  326 +-
 src/fix_rigid_nvt.h                           |    4 +-
 src/fix_setforce.cpp                          |   72 +-
 src/fix_setforce.h                            |    2 +-
 src/fix_shake.cpp                             |  494 +--
 src/fix_shake.h                               |    2 +-
 src/fix_shear_history.cpp                     |   46 +-
 src/fix_shear_history.h                       |    2 +-
 src/fix_spring.cpp                            |   88 +-
 src/fix_spring.h                              |    2 +-
 src/fix_spring_rg.cpp                         |    6 +-
 src/fix_spring_rg.h                           |    2 +-
 src/fix_spring_self.cpp                       |    4 +-
 src/fix_spring_self.h                         |    2 +-
 src/fix_store_force.cpp                       |    2 +-
 src/fix_store_force.h                         |    2 +-
 src/fix_store_state.cpp                       |  190 +-
 src/fix_store_state.h                         |    2 +-
 src/fix_temp_berendsen.cpp                    |   34 +-
 src/fix_temp_berendsen.h                      |    2 +-
 src/fix_temp_rescale.cpp                      |   38 +-
 src/fix_temp_rescale.h                        |    2 +-
 src/fix_thermal_conductivity.cpp              |   78 +-
 src/fix_thermal_conductivity.h                |    2 +-
 src/fix_tmd.cpp                               |  118 +-
 src/fix_tmd.h                                 |    2 +-
 src/fix_ttm.cpp                               |  114 +-
 src/fix_ttm.h                                 |    6 +-
 src/fix_viscosity.cpp                         |   68 +-
 src/fix_viscosity.h                           |    2 +-
 src/fix_viscous.cpp                           |    7 +-
 src/fix_viscous.h                             |    2 +-
 src/fix_wall.cpp                              |   34 +-
 src/fix_wall.h                                |    6 +-
 src/fix_wall_harmonic.cpp                     |    8 +-
 src/fix_wall_harmonic.h                       |    2 +-
 src/fix_wall_lj126.cpp                        |    8 +-
 src/fix_wall_lj126.h                          |    2 +-
 src/fix_wall_lj93.cpp                         |   12 +-
 src/fix_wall_lj93.h                           |    2 +-
 src/fix_wall_reflect.cpp                      |   62 +-
 src/fix_wall_reflect.h                        |    2 +-
 src/fix_wall_region.cpp                       |   68 +-
 src/fix_wall_region.h                         |    2 +-
 src/force.cpp                                 |   24 +-
 src/force.h                                   |    6 +-
 src/group.cpp                                 |  212 +-
 src/group.h                                   |    4 +-
 src/image.cpp                                 |  203 +-
 src/image.h                                   |    8 +-
 src/improper.cpp                              |  150 +-
 src/improper.h                                |    6 +-
 src/input.cpp                                 |  150 +-
 src/input.h                                   |    2 +-
 src/integrate.cpp                             |    2 +-
 src/integrate.h                               |    2 +-
 src/irregular.cpp                             |   44 +-
 src/irregular.h                               |    4 +-
 src/kspace.cpp                                |   22 +-
 src/kspace.h                                  |    4 +-
 src/lammps.cpp                                |  184 +-
 src/lammps.h                                  |    2 +-
 src/lattice.cpp                               |  112 +-
 src/lattice.h                                 |    4 +-
 src/library.cpp                               |   22 +-
 src/library.h                                 |    4 +-
 src/lmptype.h                                 |    2 +-
 src/lmpwindows.h                              |    2 +-
 src/main.cpp                                  |    2 +-
 src/math_const.h                              |    2 +-
 src/math_extra.cpp                            |   94 +-
 src/math_extra.h                              |   74 +-
 src/memory.cpp                                |   12 +-
 src/memory.h                                  |  222 +-
 src/min.cpp                                   |   68 +-
 src/min.h                                     |    2 +-
 src/min_cg.cpp                                |   70 +-
 src/min_cg.h                                  |    2 +-
 src/min_fire.cpp                              |   90 +-
 src/min_fire.h                                |    2 +-
 src/min_hftn.cpp                              |  878 ++--
 src/min_hftn.h                                |   96 +-
 src/min_linesearch.cpp                        |  254 +-
 src/min_linesearch.h                          |    2 +-
 src/min_quickmin.cpp                          |   78 +-
 src/min_quickmin.h                            |    2 +-
 src/min_sd.cpp                                |   16 +-
 src/min_sd.h                                  |    2 +-
 src/minimize.cpp                              |    2 +-
 src/minimize.h                                |    4 +-
 src/modify.cpp                                |   78 +-
 src/modify.h                                  |    2 +-
 src/neigh_bond.cpp                            |  278 +-
 src/neigh_bond.h                              |    2 +-
 src/neigh_derive.cpp                          |   40 +-
 src/neigh_derive.h                            |    2 +-
 src/neigh_full.cpp                            |  202 +-
 src/neigh_full.h                              |    2 +-
 src/neigh_gran.cpp                            |  242 +-
 src/neigh_gran.h                              |    2 +-
 src/neigh_half_bin.cpp                        |  128 +-
 src/neigh_half_bin.h                          |    2 +-
 src/neigh_half_multi.cpp                      |  134 +-
 src/neigh_half_multi.h                        |    2 +-
 src/neigh_half_nsq.cpp                        |   42 +-
 src/neigh_half_nsq.h                          |    2 +-
 src/neigh_list.cpp                            |   34 +-
 src/neigh_list.h                              |    4 +-
 src/neigh_request.cpp                         |    6 +-
 src/neigh_request.h                           |    4 +-
 src/neigh_respa.cpp                           |  344 +-
 src/neigh_respa.h                             |    2 +-
 src/neigh_stencil.cpp                         |  188 +-
 src/neighbor.cpp                              |  694 +--
 src/neighbor.h                                |   42 +-
 src/output.cpp                                |  154 +-
 src/output.h                                  |    2 +-
 src/pack.h                                    |  138 +-
 src/pair.cpp                                  |  336 +-
 src/pair.h                                    |   22 +-
 src/pair_beck.cpp                             |  112 +-
 src/pair_beck.h                               |    2 +-
 src/pair_born.cpp                             |  140 +-
 src/pair_born.h                               |    4 +-
 src/pair_born_coul_wolf.cpp                   |  154 +-
 src/pair_born_coul_wolf.h                     |    4 +-
 src/pair_buck.cpp                             |   98 +-
 src/pair_buck.h                               |    2 +-
 src/pair_buck_coul_cut.cpp                    |  134 +-
 src/pair_buck_coul_cut.h                      |    2 +-
 src/pair_coul_cut.cpp                         |   52 +-
 src/pair_coul_cut.h                           |    2 +-
 src/pair_coul_debye.cpp                       |   50 +-
 src/pair_coul_debye.h                         |    2 +-
 src/pair_coul_wolf.cpp                        |   90 +-
 src/pair_coul_wolf.h                          |    4 +-
 src/pair_dpd.cpp                              |  110 +-
 src/pair_dpd.h                                |    2 +-
 src/pair_dpd_tstat.cpp                        |   67 +-
 src/pair_dpd_tstat.h                          |    2 +-
 src/pair_gauss.cpp                            |  124 +-
 src/pair_gauss.h                              |   10 +-
 src/pair_hybrid.cpp                           |  104 +-
 src/pair_hybrid.h                             |    2 +-
 src/pair_hybrid_overlay.cpp                   |   40 +-
 src/pair_hybrid_overlay.h                     |    2 +-
 src/pair_lj96_cut.cpp                         |  270 +-
 src/pair_lj96_cut.h                           |    2 +-
 src/pair_lj_cubic.cpp                         |  102 +-
 src/pair_lj_cubic.h                           |    6 +-
 src/pair_lj_cut.cpp                           |  258 +-
 src/pair_lj_cut.h                             |    2 +-
 src/pair_lj_cut_coul_cut.cpp                  |  134 +-
 src/pair_lj_cut_coul_cut.h                    |    2 +-
 src/pair_lj_cut_coul_debye.cpp                |   96 +-
 src/pair_lj_cut_coul_debye.h                  |    2 +-
 src/pair_lj_expand.cpp                        |  112 +-
 src/pair_lj_expand.h                          |    2 +-
 src/pair_lj_gromacs.cpp                       |   96 +-
 src/pair_lj_gromacs.h                         |    2 +-
 src/pair_lj_gromacs_coul_gromacs.cpp          |  136 +-
 src/pair_lj_gromacs_coul_gromacs.h            |    2 +-
 src/pair_lj_smooth.cpp                        |  146 +-
 src/pair_lj_smooth.h                          |    2 +-
 src/pair_lj_smooth_linear.cpp                 |  100 +-
 src/pair_lj_smooth_linear.h                   |    2 +-
 src/pair_morse.cpp                            |   90 +-
 src/pair_morse.h                              |    2 +-
 src/pair_soft.cpp                             |   74 +-
 src/pair_soft.h                               |    2 +-
 src/pair_table.cpp                            |  230 +-
 src/pair_table.h                              |    2 +-
 src/pair_yukawa.cpp                           |   80 +-
 src/pair_yukawa.h                             |    2 +-
 src/pointers.h                                |    4 +-
 src/procmap.cpp                               |  243 +-
 src/procmap.h                                 |    6 +-
 src/random_mars.cpp                           |    6 +-
 src/random_mars.h                             |    2 +-
 src/random_park.cpp                           |    6 +-
 src/random_park.h                             |    2 +-
 src/read_data.cpp                             |  610 +--
 src/read_data.h                               |    2 +-
 src/read_dump.cpp                             |  735 ++--
 src/read_dump.h                               |   23 +-
 src/read_dump_native.cpp                      |  338 +-
 src/read_dump_native.h                        |   17 +-
 src/read_restart.cpp                          |  174 +-
 src/read_restart.h                            |    2 +-
 src/region.cpp                                |   50 +-
 src/region.h                                  |    4 +-
 src/region_block.cpp                          |   16 +-
 src/region_block.h                            |    2 +-
 src/region_cone.cpp                           |   60 +-
 src/region_cone.h                             |    2 +-
 src/region_cylinder.cpp                       |   14 +-
 src/region_cylinder.h                         |    2 +-
 src/region_intersect.cpp                      |   52 +-
 src/region_intersect.h                        |    2 +-
 src/region_plane.cpp                          |    2 +-
 src/region_plane.h                            |    2 +-
 src/region_prism.cpp                          |   38 +-
 src/region_prism.h                            |    2 +-
 src/region_sphere.cpp                         |    2 +-
 src/region_sphere.h                           |    2 +-
 src/region_union.cpp                          |   38 +-
 src/region_union.h                            |    2 +-
 src/replicate.cpp                             |  172 +-
 src/replicate.h                               |    2 +-
 src/respa.cpp                                 |  134 +-
 src/respa.h                                   |    2 +-
 src/run.cpp                                   |   18 +-
 src/run.h                                     |    2 +-
 src/set.cpp                                   |  366 +-
 src/set.h                                     |    2 +-
 src/special.cpp                               |  262 +-
 src/special.h                                 |    2 +-
 src/suffix.h                                  |    2 +-
 src/thermo.cpp                                |  384 +-
 src/thermo.h                                  |    2 +-
 src/timer.cpp                                 |    2 +-
 src/timer.h                                   |    2 +-
 src/universe.cpp                              |   36 +-
 src/universe.h                                |    4 +-
 src/update.cpp                                |   34 +-
 src/update.h                                  |    2 +-
 src/variable.cpp                              | 1698 ++++----
 src/variable.h                                |    8 +-
 src/velocity.cpp                              |  196 +-
 src/velocity.h                                |    2 +-
 src/verlet.cpp                                |   48 +-
 src/verlet.h                                  |    2 +-
 src/write_restart.cpp                         |   52 +-
 src/write_restart.h                           |    2 +-
 1408 files changed, 59989 insertions(+), 59919 deletions(-)

diff --git a/src/ASPHERE/compute_erotate_asphere.cpp b/src/ASPHERE/compute_erotate_asphere.cpp
index a18b62c1f1..5a85385675 100644
--- a/src/ASPHERE/compute_erotate_asphere.cpp
+++ b/src/ASPHERE/compute_erotate_asphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -41,9 +41,9 @@ ComputeERotateAsphere(LAMMPS *lmp, int narg, char **arg) :
   avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
   avec_line = (AtomVecLine *) atom->style_match("line");
   avec_tri = (AtomVecTri *) atom->style_match("tri");
-  if (!avec_ellipsoid && !avec_line && !avec_tri) 
+  if (!avec_ellipsoid && !avec_line && !avec_tri)
     error->all(FLERR,"Compute erotate/asphere requires "
-	       "atom style ellipsoid or line or tri");
+               "atom style ellipsoid or line or tri");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -67,7 +67,7 @@ void ComputeERotateAsphere::init()
       if (line && line[i] >= 0) flag = 1;
       if (tri && tri[i] >= 0) flag = 1;
       if (!flag)
-	error->one(FLERR,"Compute erotate/asphere requires extended particles");
+        error->one(FLERR,"Compute erotate/asphere requires extended particles");
     }
 
   pfactor = 0.5 * force->mvv2e;
@@ -106,53 +106,53 @@ double ComputeERotateAsphere::compute_scalar()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       if (ellipsoid && ellipsoid[i] >= 0) {
-	shape = ebonus[ellipsoid[i]].shape;
-	quat = ebonus[ellipsoid[i]].quat;
-
-	// principal moments of inertia
-	
-	inertia[0] = rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]) / 5.0;
-	inertia[1] = rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]) / 5.0;
-	inertia[2] = rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]) / 5.0;
-	
-	// wbody = angular velocity in body frame
-	
-	MathExtra::quat_to_mat(quat,rot);
-	MathExtra::transpose_matvec(rot,angmom[i],wbody);
-	wbody[0] /= inertia[0];
-	wbody[1] /= inertia[1];
-	wbody[2] /= inertia[2];
-	
-	erotate += inertia[0]*wbody[0]*wbody[0] +
-	  inertia[1]*wbody[1]*wbody[1] + inertia[2]*wbody[2]*wbody[2];
+        shape = ebonus[ellipsoid[i]].shape;
+        quat = ebonus[ellipsoid[i]].quat;
+
+        // principal moments of inertia
+
+        inertia[0] = rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]) / 5.0;
+        inertia[1] = rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]) / 5.0;
+        inertia[2] = rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]) / 5.0;
+
+        // wbody = angular velocity in body frame
+
+        MathExtra::quat_to_mat(quat,rot);
+        MathExtra::transpose_matvec(rot,angmom[i],wbody);
+        wbody[0] /= inertia[0];
+        wbody[1] /= inertia[1];
+        wbody[2] /= inertia[2];
+
+        erotate += inertia[0]*wbody[0]*wbody[0] +
+          inertia[1]*wbody[1]*wbody[1] + inertia[2]*wbody[2]*wbody[2];
 
       } else if (line && line[i] >= 0) {
-	length = lbonus[line[i]].length;
+        length = lbonus[line[i]].length;
 
-	erotate += (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] + 
-		    omega[i][2]*omega[i][2]) * length*length*rmass[i] / 12.0;
+        erotate += (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] +
+                    omega[i][2]*omega[i][2]) * length*length*rmass[i] / 12.0;
 
       } else if (tri && tri[i] >= 0) {
 
-	// principal moments of inertia
-
-	inertia[0] = tbonus[tri[i]].inertia[0];
-	inertia[1] = tbonus[tri[i]].inertia[1];
-	inertia[2] = tbonus[tri[i]].inertia[2];
-
-	// wbody = angular velocity in body frame
-	
-	MathExtra::quat_to_mat(tbonus[tri[i]].quat,rot);
-	MathExtra::transpose_matvec(rot,angmom[i],wbody);
-	wbody[0] /= inertia[0];
-	wbody[1] /= inertia[1];
-	wbody[2] /= inertia[2];
-	
-	erotate += inertia[0]*wbody[0]*wbody[0] +
-	  inertia[1]*wbody[1]*wbody[1] + inertia[2]*wbody[2]*wbody[2];
+        // principal moments of inertia
+
+        inertia[0] = tbonus[tri[i]].inertia[0];
+        inertia[1] = tbonus[tri[i]].inertia[1];
+        inertia[2] = tbonus[tri[i]].inertia[2];
+
+        // wbody = angular velocity in body frame
+
+        MathExtra::quat_to_mat(tbonus[tri[i]].quat,rot);
+        MathExtra::transpose_matvec(rot,angmom[i],wbody);
+        wbody[0] /= inertia[0];
+        wbody[1] /= inertia[1];
+        wbody[2] /= inertia[2];
+
+        erotate += inertia[0]*wbody[0]*wbody[0] +
+          inertia[1]*wbody[1]*wbody[1] + inertia[2]*wbody[2]*wbody[2];
       }
     }
-  
+
   MPI_Allreduce(&erotate,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
   scalar *= pfactor;
   return scalar;
diff --git a/src/ASPHERE/compute_erotate_asphere.h b/src/ASPHERE/compute_erotate_asphere.h
index e29d15ec24..9318c46323 100644
--- a/src/ASPHERE/compute_erotate_asphere.h
+++ b/src/ASPHERE/compute_erotate_asphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/ASPHERE/compute_temp_asphere.cpp b/src/ASPHERE/compute_temp_asphere.cpp
index 69139369cf..1df8fef867 100755
--- a/src/ASPHERE/compute_temp_asphere.cpp
+++ b/src/ASPHERE/compute_temp_asphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -76,7 +76,7 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :
   // error check
 
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-  if (!avec) 
+  if (!avec)
     error->all(FLERR,"Compute temp/asphere requires atom style ellipsoid");
 }
 
@@ -101,7 +101,7 @@ void ComputeTempAsphere::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (ellipsoid[i] < 0)
-	error->one(FLERR,"Compute temp/asphere requires extended particles");
+        error->one(FLERR,"Compute temp/asphere requires extended particles");
 
   if (tempbias) {
     int i = modify->find_compute(id_bias);
@@ -154,7 +154,7 @@ void ComputeTempAsphere::dof_compute()
     int count = 0;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	if (tbias->dof_remove(i)) count++;
+        if (tbias->dof_remove(i)) count++;
     int count_all;
     MPI_Allreduce(&count,&count_all,1,MPI_INT,MPI_SUM,world);
     dof -= nper*count_all;
@@ -187,7 +187,7 @@ double ComputeTempAsphere::compute_scalar()
   double *shape,*quat;
   double wbody[3],inertia[3];
   double rot[3][3];
-  
+
   // sum translational and rotational energy for each particle
   // no point particles since divide by inertia
 
@@ -196,52 +196,52 @@ double ComputeTempAsphere::compute_scalar()
   if (mode == ALL) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * rmass[i];
-
-	// principal moments of inertia
-
-	shape = bonus[ellipsoid[i]].shape;
-	quat = bonus[ellipsoid[i]].quat;
-
-	inertia[0] = INERTIA*rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]);
-	inertia[1] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]);
-	inertia[2] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]);
-
-	// wbody = angular velocity in body frame
-      
-	MathExtra::quat_to_mat(quat,rot);
-	MathExtra::transpose_matvec(rot,angmom[i],wbody);
-	wbody[0] /= inertia[0];
-	wbody[1] /= inertia[1];
-	wbody[2] /= inertia[2];
-	
-	t += inertia[0]*wbody[0]*wbody[0] +
-	  inertia[1]*wbody[1]*wbody[1] + inertia[2]*wbody[2]*wbody[2];
+        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * rmass[i];
+
+        // principal moments of inertia
+
+        shape = bonus[ellipsoid[i]].shape;
+        quat = bonus[ellipsoid[i]].quat;
+
+        inertia[0] = INERTIA*rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]);
+        inertia[1] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]);
+        inertia[2] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]);
+
+        // wbody = angular velocity in body frame
+
+        MathExtra::quat_to_mat(quat,rot);
+        MathExtra::transpose_matvec(rot,angmom[i],wbody);
+        wbody[0] /= inertia[0];
+        wbody[1] /= inertia[1];
+        wbody[2] /= inertia[2];
+
+        t += inertia[0]*wbody[0]*wbody[0] +
+          inertia[1]*wbody[1]*wbody[1] + inertia[2]*wbody[2]*wbody[2];
       }
 
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
 
-	// principal moments of inertia
-
-	shape = bonus[ellipsoid[i]].shape;
-	quat = bonus[ellipsoid[i]].quat;
-
-	inertia[0] = INERTIA*rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]);
-	inertia[1] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]);
-	inertia[2] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]);
-
-	// wbody = angular velocity in body frame
-      
-	MathExtra::quat_to_mat(quat,rot);
-	MathExtra::transpose_matvec(rot,angmom[i],wbody);
-	wbody[0] /= inertia[0];
-	wbody[1] /= inertia[1];
-	wbody[2] /= inertia[2];
-	
-	t += inertia[0]*wbody[0]*wbody[0] +
-	  inertia[1]*wbody[1]*wbody[1] + inertia[2]*wbody[2]*wbody[2];
+        // principal moments of inertia
+
+        shape = bonus[ellipsoid[i]].shape;
+        quat = bonus[ellipsoid[i]].quat;
+
+        inertia[0] = INERTIA*rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]);
+        inertia[1] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]);
+        inertia[2] = INERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]);
+
+        // wbody = angular velocity in body frame
+
+        MathExtra::quat_to_mat(quat,rot);
+        MathExtra::transpose_matvec(rot,angmom[i],wbody);
+        wbody[0] /= inertia[0];
+        wbody[1] /= inertia[1];
+        wbody[2] /= inertia[2];
+
+        t += inertia[0]*wbody[0]*wbody[0] +
+          inertia[1]*wbody[1]*wbody[1] + inertia[2]*wbody[2]*wbody[2];
       }
   }
 
@@ -287,71 +287,71 @@ void ComputeTempAsphere::compute_vector()
   if (mode == ALL) {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	massone = rmass[i];
-	t[0] += massone * v[i][0]*v[i][0];
-	t[1] += massone * v[i][1]*v[i][1];
-	t[2] += massone * v[i][2]*v[i][2];
-	t[3] += massone * v[i][0]*v[i][1];
-	t[4] += massone * v[i][0]*v[i][2];
-	t[5] += massone * v[i][1]*v[i][2];
-	
-	// principal moments of inertia
-
-	shape = bonus[ellipsoid[i]].shape;
-	quat = bonus[ellipsoid[i]].quat;
-
-	inertia[0] = INERTIA*massone * (shape[1]*shape[1]+shape[2]*shape[2]);
-	inertia[1] = INERTIA*massone * (shape[0]*shape[0]+shape[2]*shape[2]);
-	inertia[2] = INERTIA*massone * (shape[0]*shape[0]+shape[1]*shape[1]);
-	
-	// wbody = angular velocity in body frame
-	
-	MathExtra::quat_to_mat(quat,rot);
-	MathExtra::transpose_matvec(rot,angmom[i],wbody);
-	wbody[0] /= inertia[0];
-	wbody[1] /= inertia[1];
-	wbody[2] /= inertia[2];
-	
-	// rotational kinetic energy
-	
-	t[0] += inertia[0]*wbody[0]*wbody[0];
-	t[1] += inertia[1]*wbody[1]*wbody[1];
-	t[2] += inertia[2]*wbody[2]*wbody[2];
-	t[3] += inertia[0]*wbody[0]*wbody[1];
-	t[4] += inertia[1]*wbody[0]*wbody[2];
-	t[5] += inertia[2]*wbody[1]*wbody[2];
+        massone = rmass[i];
+        t[0] += massone * v[i][0]*v[i][0];
+        t[1] += massone * v[i][1]*v[i][1];
+        t[2] += massone * v[i][2]*v[i][2];
+        t[3] += massone * v[i][0]*v[i][1];
+        t[4] += massone * v[i][0]*v[i][2];
+        t[5] += massone * v[i][1]*v[i][2];
+
+        // principal moments of inertia
+
+        shape = bonus[ellipsoid[i]].shape;
+        quat = bonus[ellipsoid[i]].quat;
+
+        inertia[0] = INERTIA*massone * (shape[1]*shape[1]+shape[2]*shape[2]);
+        inertia[1] = INERTIA*massone * (shape[0]*shape[0]+shape[2]*shape[2]);
+        inertia[2] = INERTIA*massone * (shape[0]*shape[0]+shape[1]*shape[1]);
+
+        // wbody = angular velocity in body frame
+
+        MathExtra::quat_to_mat(quat,rot);
+        MathExtra::transpose_matvec(rot,angmom[i],wbody);
+        wbody[0] /= inertia[0];
+        wbody[1] /= inertia[1];
+        wbody[2] /= inertia[2];
+
+        // rotational kinetic energy
+
+        t[0] += inertia[0]*wbody[0]*wbody[0];
+        t[1] += inertia[1]*wbody[1]*wbody[1];
+        t[2] += inertia[2]*wbody[2]*wbody[2];
+        t[3] += inertia[0]*wbody[0]*wbody[1];
+        t[4] += inertia[1]*wbody[0]*wbody[2];
+        t[5] += inertia[2]*wbody[1]*wbody[2];
       }
 
   } else {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	
-	// principal moments of inertia
-
-	shape = bonus[ellipsoid[i]].shape;
-	quat = bonus[ellipsoid[i]].quat;
-	massone = rmass[i];
-
-	inertia[0] = INERTIA*massone * (shape[1]*shape[1]+shape[2]*shape[2]);
-	inertia[1] = INERTIA*massone * (shape[0]*shape[0]+shape[2]*shape[2]);
-	inertia[2] = INERTIA*massone * (shape[0]*shape[0]+shape[1]*shape[1]);
-	
-	// wbody = angular velocity in body frame
-	
-	MathExtra::quat_to_mat(quat,rot);
-	MathExtra::transpose_matvec(rot,angmom[i],wbody);
-	wbody[0] /= inertia[0];
-	wbody[1] /= inertia[1];
-	wbody[2] /= inertia[2];
-	
-	// rotational kinetic energy
-	
-	t[0] += inertia[0]*wbody[0]*wbody[0];
-	t[1] += inertia[1]*wbody[1]*wbody[1];
-	t[2] += inertia[2]*wbody[2]*wbody[2];
-	t[3] += inertia[0]*wbody[0]*wbody[1];
-	t[4] += inertia[1]*wbody[0]*wbody[2];
-	t[5] += inertia[2]*wbody[1]*wbody[2];
+
+        // principal moments of inertia
+
+        shape = bonus[ellipsoid[i]].shape;
+        quat = bonus[ellipsoid[i]].quat;
+        massone = rmass[i];
+
+        inertia[0] = INERTIA*massone * (shape[1]*shape[1]+shape[2]*shape[2]);
+        inertia[1] = INERTIA*massone * (shape[0]*shape[0]+shape[2]*shape[2]);
+        inertia[2] = INERTIA*massone * (shape[0]*shape[0]+shape[1]*shape[1]);
+
+        // wbody = angular velocity in body frame
+
+        MathExtra::quat_to_mat(quat,rot);
+        MathExtra::transpose_matvec(rot,angmom[i],wbody);
+        wbody[0] /= inertia[0];
+        wbody[1] /= inertia[1];
+        wbody[2] /= inertia[2];
+
+        // rotational kinetic energy
+
+        t[0] += inertia[0]*wbody[0]*wbody[0];
+        t[1] += inertia[1]*wbody[1]*wbody[1];
+        t[2] += inertia[2]*wbody[2]*wbody[2];
+        t[3] += inertia[0]*wbody[0]*wbody[1];
+        t[4] += inertia[1]*wbody[0]*wbody[2];
+        t[5] += inertia[2]*wbody[1]*wbody[2];
       }
   }
 
diff --git a/src/ASPHERE/compute_temp_asphere.h b/src/ASPHERE/compute_temp_asphere.h
index 715150f5e4..ee7e73b435 100755
--- a/src/ASPHERE/compute_temp_asphere.h
+++ b/src/ASPHERE/compute_temp_asphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/ASPHERE/fix_nh_asphere.cpp b/src/ASPHERE/fix_nh_asphere.cpp
index a8290924da..476d4a6e5c 100644
--- a/src/ASPHERE/fix_nh_asphere.cpp
+++ b/src/ASPHERE/fix_nh_asphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,7 +35,7 @@ FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) :
   FixNH(lmp, narg, arg)
 {
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-  if (!avec) 
+  if (!avec)
     error->all(FLERR,"Compute nvt/nph/npt asphere requires atom style ellipsoid");
 }
 
@@ -53,7 +53,7 @@ void FixNHAsphere::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (ellipsoid[i] < 0)
-	error->one(FLERR,"Fix nvt/nph/npt asphere requires extended particles");
+        error->one(FLERR,"Fix nvt/nph/npt asphere requires extended particles");
 
   FixNH::init();
 }
@@ -76,7 +76,7 @@ void FixNHAsphere::nve_v()
 
   // update angular momentum by 1/2 step for all particles
 
-  for (int i = 0; i < nlocal; i++) {    
+  for (int i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
       angmom[i][0] += dtf*torque[i][0];
       angmom[i][1] += dtf*torque[i][1];
@@ -127,7 +127,7 @@ void FixNHAsphere::nve_x()
       inertia[0] = rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]) / 5.0;
       inertia[1] = rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]) / 5.0;
       inertia[2] = rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]) / 5.0;
-      
+
       // compute omega at 1/2 step from angmom at 1/2 step and current q
       // update quaternion a full step via Richardson iteration
       // returns new normalized quaternion
@@ -152,7 +152,7 @@ void FixNHAsphere::nh_v_temp()
   int nlocal = atom->nlocal;
   if (igroup == atom->firstgroup) nlocal = atom->nfirst;
 
-  for (int i = 0; i < nlocal; i++) {    
+  for (int i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
       angmom[i][0] *= factor_eta;
       angmom[i][1] *= factor_eta;
diff --git a/src/ASPHERE/fix_nh_asphere.h b/src/ASPHERE/fix_nh_asphere.h
index 5c98e412ce..8f01b2538f 100644
--- a/src/ASPHERE/fix_nh_asphere.h
+++ b/src/ASPHERE/fix_nh_asphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/ASPHERE/fix_nph_asphere.cpp b/src/ASPHERE/fix_nph_asphere.cpp
index 76a3495693..a1a113a337 100644
--- a/src/ASPHERE/fix_nph_asphere.cpp
+++ b/src/ASPHERE/fix_nph_asphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ FixNPHAsphere::FixNPHAsphere(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = (char *) "all";
@@ -56,7 +56,7 @@ FixNPHAsphere::FixNPHAsphere(LAMMPS *lmp, int narg, char **arg) :
   id_press = new char[n];
   strcpy(id_press,id);
   strcat(id_press,"_press");
-  
+
   newarg = new char*[4];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";
diff --git a/src/ASPHERE/fix_nph_asphere.h b/src/ASPHERE/fix_nph_asphere.h
index 7dfd992269..91f36b45c3 100644
--- a/src/ASPHERE/fix_nph_asphere.h
+++ b/src/ASPHERE/fix_nph_asphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/ASPHERE/fix_npt_asphere.cpp b/src/ASPHERE/fix_npt_asphere.cpp
index 6296302e67..dab72dc29f 100755
--- a/src/ASPHERE/fix_npt_asphere.cpp
+++ b/src/ASPHERE/fix_npt_asphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ FixNPTAsphere::FixNPTAsphere(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = (char *) "all";
@@ -56,7 +56,7 @@ FixNPTAsphere::FixNPTAsphere(LAMMPS *lmp, int narg, char **arg) :
   id_press = new char[n];
   strcpy(id_press,id);
   strcat(id_press,"_press");
-  
+
   newarg = new char*[4];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";
diff --git a/src/ASPHERE/fix_npt_asphere.h b/src/ASPHERE/fix_npt_asphere.h
index 1b874928e6..b6e93993f2 100755
--- a/src/ASPHERE/fix_npt_asphere.h
+++ b/src/ASPHERE/fix_npt_asphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/ASPHERE/fix_nve_asphere.cpp b/src/ASPHERE/fix_nve_asphere.cpp
index 6504219245..1590e1f20e 100755
--- a/src/ASPHERE/fix_nve_asphere.cpp
+++ b/src/ASPHERE/fix_nve_asphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -34,11 +34,11 @@ using namespace FixConst;
 
 /* ---------------------------------------------------------------------- */
 
-FixNVEAsphere::FixNVEAsphere(LAMMPS *lmp, int narg, char **arg) : 
+FixNVEAsphere::FixNVEAsphere(LAMMPS *lmp, int narg, char **arg) :
   FixNVE(lmp, narg, arg)
 {
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-  if (!avec) 
+  if (!avec)
     error->all(FLERR,"Compute nve/asphere requires atom style ellipsoid");
 }
 
@@ -56,7 +56,7 @@ void FixNVEAsphere::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (ellipsoid[i] < 0)
-	error->one(FLERR,"Fix nve/asphere requires extended particles");
+        error->one(FLERR,"Fix nve/asphere requires extended particles");
 
   FixNVE::init();
 }
@@ -96,7 +96,7 @@ void FixNVEAsphere::initial_integrate(int vflag)
       x[i][2] += dtv * v[i][2];
 
       // update angular momentum by 1/2 step
-      
+
       angmom[i][0] += dtf * torque[i][0];
       angmom[i][1] += dtf * torque[i][1];
       angmom[i][2] += dtf * torque[i][2];
@@ -140,7 +140,7 @@ void FixNVEAsphere::final_integrate()
       v[i][0] += dtfm * f[i][0];
       v[i][1] += dtfm * f[i][1];
       v[i][2] += dtfm * f[i][2];
-  
+
       angmom[i][0] += dtf * torque[i][0];
       angmom[i][1] += dtf * torque[i][1];
       angmom[i][2] += dtf * torque[i][2];
diff --git a/src/ASPHERE/fix_nve_asphere.h b/src/ASPHERE/fix_nve_asphere.h
index fe6334fd1f..1af9895207 100755
--- a/src/ASPHERE/fix_nve_asphere.h
+++ b/src/ASPHERE/fix_nve_asphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/ASPHERE/fix_nve_asphere_noforce.cpp b/src/ASPHERE/fix_nve_asphere_noforce.cpp
index 2fb8bd98ef..8ce195f120 100644
--- a/src/ASPHERE/fix_nve_asphere_noforce.cpp
+++ b/src/ASPHERE/fix_nve_asphere_noforce.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ FixNVEAsphereNoforce::FixNVEAsphereNoforce(LAMMPS *lmp, int narg, char **arg) :
   // error check
 
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-  if (!atom->ellipsoid_flag) 
+  if (!atom->ellipsoid_flag)
     error->all(FLERR,"Fix nve/asphere/noforce requires atom style ellipsoid");
 }
 
@@ -59,7 +59,7 @@ void FixNVEAsphereNoforce::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (ellipsoid[i] < 0)
-	error->one(FLERR,"Fix nve/asphere/noforce requires extended particles");
+        error->one(FLERR,"Fix nve/asphere/noforce requires extended particles");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -94,15 +94,15 @@ void FixNVEAsphereNoforce::initial_integrate(int vflag)
 
       shape = bonus[ellipsoid[i]].shape;
       quat = bonus[ellipsoid[i]].quat;
-	
+
       inertia[0] = rmass[i] * (shape[1]*shape[1]+shape[2]*shape[2]) / 5.0;
       inertia[1] = rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]) / 5.0;
       inertia[2] = rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]) / 5.0;
-      
+
       // compute omega at 1/2 step from angmom at 1/2 step and current q
       // update quaternion a full step via Richardson iteration
       // returns new normalized quaternion
-      
+
       MathExtra::mq_to_omega(angmom[i],quat,inertia,omega);
       MathExtra::richardson(quat,angmom[i],omega,inertia,dtq);
     }
diff --git a/src/ASPHERE/fix_nve_asphere_noforce.h b/src/ASPHERE/fix_nve_asphere_noforce.h
index 6e0209d722..b3d306b1ec 100755
--- a/src/ASPHERE/fix_nve_asphere_noforce.h
+++ b/src/ASPHERE/fix_nve_asphere_noforce.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -29,7 +29,7 @@ class FixNVEAsphereNoforce : public FixNVENoforce {
   FixNVEAsphereNoforce(class LAMMPS *, int, char **);
   void initial_integrate(int);
   void init();
-  
+
  private:
   double dtq;
   class AtomVecEllipsoid *avec;
diff --git a/src/ASPHERE/fix_nve_line.cpp b/src/ASPHERE/fix_nve_line.cpp
index 5f022db24a..1350713acf 100644
--- a/src/ASPHERE/fix_nve_line.cpp
+++ b/src/ASPHERE/fix_nve_line.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -155,7 +155,7 @@ void FixNVELine::final_integrate()
       dtfm = dtf / rmass[i];
       v[i][0] += dtfm * f[i][0];
       v[i][1] += dtfm * f[i][1];
-      
+
       length = bonus[line[i]].length;
       dtirotate = dtfrotate / (length*length*rmass[i]);
       omega[i][2] += dtirotate * torque[i][2];
diff --git a/src/ASPHERE/fix_nve_line.h b/src/ASPHERE/fix_nve_line.h
index 2a2e957be2..00b3f57f9e 100644
--- a/src/ASPHERE/fix_nve_line.h
+++ b/src/ASPHERE/fix_nve_line.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/ASPHERE/fix_nve_tri.cpp b/src/ASPHERE/fix_nve_tri.cpp
index 9048f89269..eb90127346 100644
--- a/src/ASPHERE/fix_nve_tri.cpp
+++ b/src/ASPHERE/fix_nve_tri.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -109,7 +109,7 @@ void FixNVETri::initial_integrate(int vflag)
       x[i][2] += dtv * v[i][2];
 
       // update angular momentum by 1/2 step
-      
+
       angmom[i][0] += dtf * torque[i][0];
       angmom[i][1] += dtf * torque[i][1];
       angmom[i][2] += dtf * torque[i][2];
@@ -119,9 +119,9 @@ void FixNVETri::initial_integrate(int vflag)
       // returns new normalized quaternion
 
       MathExtra::mq_to_omega(angmom[i],bonus[tri[i]].quat,
-			     bonus[tri[i]].inertia,omega);
+                             bonus[tri[i]].inertia,omega);
       MathExtra::richardson(bonus[tri[i]].quat,angmom[i],omega,
-			    bonus[tri[i]].inertia,dtq);
+                            bonus[tri[i]].inertia,dtq);
     }
 }
 
@@ -149,7 +149,7 @@ void FixNVETri::final_integrate()
       v[i][0] += dtfm * f[i][0];
       v[i][1] += dtfm * f[i][1];
       v[i][2] += dtfm * f[i][2];
-  
+
       angmom[i][0] += dtf * torque[i][0];
       angmom[i][1] += dtf * torque[i][1];
       angmom[i][2] += dtf * torque[i][2];
diff --git a/src/ASPHERE/fix_nve_tri.h b/src/ASPHERE/fix_nve_tri.h
index a3877a938f..bf533662e0 100644
--- a/src/ASPHERE/fix_nve_tri.h
+++ b/src/ASPHERE/fix_nve_tri.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/ASPHERE/fix_nvt_asphere.cpp b/src/ASPHERE/fix_nvt_asphere.cpp
index 4ec80141c0..796bbdf40c 100755
--- a/src/ASPHERE/fix_nvt_asphere.cpp
+++ b/src/ASPHERE/fix_nvt_asphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,7 +37,7 @@ FixNVTAsphere::FixNVTAsphere(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = group->names[igroup];
diff --git a/src/ASPHERE/fix_nvt_asphere.h b/src/ASPHERE/fix_nvt_asphere.h
index 223c073ec1..e12f596413 100755
--- a/src/ASPHERE/fix_nvt_asphere.h
+++ b/src/ASPHERE/fix_nvt_asphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp
index e3ad48491b..3af5e5994d 100755
--- a/src/ASPHERE/pair_gayberne.cpp
+++ b/src/ASPHERE/pair_gayberne.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -99,7 +99,7 @@ void PairGayBerne::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -135,81 +135,81 @@ void PairGayBerne::compute(int eflag, int vflag)
 
       if (rsq < cutsq[itype][jtype]) {
 
-	switch (form[itype][jtype]) {
-	case SPHERE_SPHERE:
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  forcelj *= -r2inv;
-	  if (eflag) one_eng = 
-		       r6inv*(r6inv*lj3[itype][jtype]-lj4[itype][jtype]) -
-		       offset[itype][jtype];
-	  fforce[0] = r12[0]*forcelj;
-	  fforce[1] = r12[1]*forcelj;
-	  fforce[2] = r12[2]*forcelj;
-	  ttor[0] = ttor[1] = ttor[2] = 0.0;
-	  rtor[0] = rtor[1] = rtor[2] = 0.0;
-	  break;
+        switch (form[itype][jtype]) {
+        case SPHERE_SPHERE:
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          forcelj *= -r2inv;
+          if (eflag) one_eng =
+                       r6inv*(r6inv*lj3[itype][jtype]-lj4[itype][jtype]) -
+                       offset[itype][jtype];
+          fforce[0] = r12[0]*forcelj;
+          fforce[1] = r12[1]*forcelj;
+          fforce[2] = r12[2]*forcelj;
+          ttor[0] = ttor[1] = ttor[2] = 0.0;
+          rtor[0] = rtor[1] = rtor[2] = 0.0;
+          break;
 
         case SPHERE_ELLIPSE:
-	  jquat = bonus[ellipsoid[j]].quat;
-	  MathExtra::quat_to_mat_trans(jquat,a2);
-	  MathExtra::diag_times3(well[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,b2);
-	  MathExtra::diag_times3(shape2[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,g2);
-	  one_eng = gayberne_lj(j,i,a2,b2,g2,r12,rsq,fforce,rtor);
-	  ttor[0] = ttor[1] = ttor[2] = 0.0;
-	  break;
+          jquat = bonus[ellipsoid[j]].quat;
+          MathExtra::quat_to_mat_trans(jquat,a2);
+          MathExtra::diag_times3(well[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,b2);
+          MathExtra::diag_times3(shape2[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,g2);
+          one_eng = gayberne_lj(j,i,a2,b2,g2,r12,rsq,fforce,rtor);
+          ttor[0] = ttor[1] = ttor[2] = 0.0;
+          break;
 
         case ELLIPSE_SPHERE:
-	  one_eng = gayberne_lj(i,j,a1,b1,g1,r12,rsq,fforce,ttor);
-	  rtor[0] = rtor[1] = rtor[2] = 0.0;
-	  break;
-
-	default:
-	  jquat = bonus[ellipsoid[j]].quat;
-	  MathExtra::quat_to_mat_trans(jquat,a2);
-	  MathExtra::diag_times3(well[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,b2);
-	  MathExtra::diag_times3(shape2[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,g2);
-	  one_eng = gayberne_analytic(i,j,a1,a2,b1,b2,g1,g2,r12,rsq,
-				      fforce,ttor,rtor);
-	  break;
-	}
+          one_eng = gayberne_lj(i,j,a1,b1,g1,r12,rsq,fforce,ttor);
+          rtor[0] = rtor[1] = rtor[2] = 0.0;
+          break;
+
+        default:
+          jquat = bonus[ellipsoid[j]].quat;
+          MathExtra::quat_to_mat_trans(jquat,a2);
+          MathExtra::diag_times3(well[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,b2);
+          MathExtra::diag_times3(shape2[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,g2);
+          one_eng = gayberne_analytic(i,j,a1,a2,b1,b2,g1,g2,r12,rsq,
+                                      fforce,ttor,rtor);
+          break;
+        }
 
         fforce[0] *= factor_lj;
-	fforce[1] *= factor_lj;
-	fforce[2] *= factor_lj;
+        fforce[1] *= factor_lj;
+        fforce[2] *= factor_lj;
         ttor[0] *= factor_lj;
-	ttor[1] *= factor_lj;
-	ttor[2] *= factor_lj;
+        ttor[1] *= factor_lj;
+        ttor[2] *= factor_lj;
 
         f[i][0] += fforce[0];
-	f[i][1] += fforce[1];
-	f[i][2] += fforce[2];
+        f[i][1] += fforce[1];
+        f[i][2] += fforce[2];
         tor[i][0] += ttor[0];
-	tor[i][1] += ttor[1];
-	tor[i][2] += ttor[2];
+        tor[i][1] += ttor[1];
+        tor[i][2] += ttor[2];
 
         if (newton_pair || j < nlocal) {
           rtor[0] *= factor_lj;
-	  rtor[1] *= factor_lj;
-	  rtor[2] *= factor_lj;
+          rtor[1] *= factor_lj;
+          rtor[2] *= factor_lj;
           f[j][0] -= fforce[0];
-	  f[j][1] -= fforce[1];
-	  f[j][2] -= fforce[2];
+          f[j][1] -= fforce[1];
+          f[j][2] -= fforce[2];
           tor[j][0] += rtor[0];
-	  tor[j][1] += rtor[1];
-	  tor[j][2] += rtor[2];
+          tor[j][1] += rtor[1];
+          tor[j][2] += rtor[2];
         }
 
         if (eflag) evdwl = factor_lj*one_eng;
 
-	if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
-				 evdwl,0.0,fforce[0],fforce[1],fforce[2],
-				 -r12[0],-r12[1],-r12[2]);
+        if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
+                                 evdwl,0.0,fforce[0],fforce[1],fforce[2],
+                                 -r12[0],-r12[1],-r12[2]);
       }
     }
   }
@@ -263,14 +263,14 @@ void PairGayBerne::settings(int narg, char **arg)
   upsilon = force->numeric(arg[1])/2.0;
   mu = force->numeric(arg[2]);
   cut_global = force->numeric(arg[3]);
-  
+
   // reset cutoffs that have been explicitly set
 
   if (allocated) {
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -296,7 +296,7 @@ void PairGayBerne::coeff(int narg, char **arg)
   double eja_one = force->numeric(arg[7]);
   double ejb_one = force->numeric(arg[8]);
   double ejc_one = force->numeric(arg[9]);
-  
+
   double cut_one = cut_global;
   if (narg == 11) cut_one = force->numeric(arg[10]);
 
@@ -307,18 +307,18 @@ void PairGayBerne::coeff(int narg, char **arg)
       sigma[i][j] = sigma_one;
       cut[i][j] = cut_one;
       if (eia_one != 0.0 || eib_one != 0.0 || eic_one != 0.0) {
-	well[i][0] = pow(eia_one,-1.0/mu);
+        well[i][0] = pow(eia_one,-1.0/mu);
         well[i][1] = pow(eib_one,-1.0/mu);
-	well[i][2] = pow(eic_one,-1.0/mu);
-	if (eia_one == eib_one && eib_one == eic_one) setwell[i] = 2;
-	else setwell[i] = 1;
+        well[i][2] = pow(eic_one,-1.0/mu);
+        if (eia_one == eib_one && eib_one == eic_one) setwell[i] = 2;
+        else setwell[i] = 1;
       }
       if (eja_one != 0.0 || ejb_one != 0.0 || ejc_one != 0.0) {
-	well[j][0] = pow(eja_one,-1.0/mu);
+        well[j][0] = pow(eja_one,-1.0/mu);
         well[j][1] = pow(ejb_one,-1.0/mu);
-	well[j][2] = pow(ejc_one,-1.0/mu);
-	if (eja_one == ejb_one && ejb_one == ejc_one) setwell[j] = 2;
-	else setwell[j] = 1;
+        well[j][2] = pow(ejc_one,-1.0/mu);
+        if (eja_one == ejb_one && ejb_one == ejc_one) setwell[j] = 2;
+        else setwell[j] = 1;
       }
       setflag[i][j] = 1;
       count++;
@@ -349,7 +349,7 @@ void PairGayBerne::init_style()
     shape2[i][0] = shape1[i][0]*shape1[i][0];
     shape2[i][1] = shape1[i][1]*shape1[i][1];
     shape2[i][2] = shape1[i][2]*shape1[i][2];
-    lshape[i] = (shape1[i][0]*shape1[i][1]+shape1[i][2]*shape1[i][2]) * 
+    lshape[i] = (shape1[i][0]*shape1[i][1]+shape1[i][2]*shape1[i][2]) *
       sqrt(shape1[i][0]*shape1[i][1]);
   }
 }
@@ -365,41 +365,41 @@ double PairGayBerne::init_one(int i, int j)
 
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
   }
-  
+
   lj1[i][j] = 48.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
   lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
   lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
   lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
-     
+
   if (offset_flag) {
     double ratio = sigma[i][j] / cut[i][j];
     offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
   } else offset[i][j] = 0.0;
 
   int ishape = 0;
-  if (shape1[i][0] != shape1[i][1] || 
-      shape1[i][0] != shape1[i][2] || 
+  if (shape1[i][0] != shape1[i][1] ||
+      shape1[i][0] != shape1[i][2] ||
       shape1[i][1] != shape1[i][2]) ishape = 1;
   if (setwell[i] == 1) ishape = 1;
   int jshape = 0;
-  if (shape1[j][0] != shape1[j][1] || 
-      shape1[j][0] != shape1[j][2] || 
+  if (shape1[j][0] != shape1[j][1] ||
+      shape1[j][0] != shape1[j][2] ||
       shape1[j][1] != shape1[j][2]) jshape = 1;
   if (setwell[j] == 1) jshape = 1;
-  
+
   if (ishape == 0 && jshape == 0)
     form[i][i] = form[j][j] = form[i][j] = form[j][i] = SPHERE_SPHERE;
   else if (ishape == 0) {
     form[i][i] = SPHERE_SPHERE; form[j][j] = ELLIPSE_ELLIPSE;
-    form[i][j] = SPHERE_ELLIPSE; form[j][i] = ELLIPSE_SPHERE; 
+    form[i][j] = SPHERE_ELLIPSE; form[j][i] = ELLIPSE_SPHERE;
   } else if (jshape == 0) {
     form[j][j] = SPHERE_SPHERE; form[i][i] = ELLIPSE_ELLIPSE;
-    form[j][i] = SPHERE_ELLIPSE; form[i][j] = ELLIPSE_SPHERE; 
-  } else 
+    form[j][i] = SPHERE_ELLIPSE; form[i][j] = ELLIPSE_SPHERE;
+  } else
     form[i][i] = form[j][j] = form[i][j] = form[j][i] = ELLIPSE_ELLIPSE;
 
   epsilon[j][i] = epsilon[i][j];
@@ -696,9 +696,9 @@ double PairGayBerne::gayberne_analytic(const int i,const int j,double a1[3][3],
 ------------------------------------------------------------------------- */
 
 double PairGayBerne::gayberne_lj(const int i,const int j,double a1[3][3],
-				 double b1[3][3],double g1[3][3],
+                                 double b1[3][3],double g1[3][3],
                                  double *r12,const double rsq,double *fforce,
-				 double *ttor)
+                                 double *ttor)
 {
   double tempv[3], tempv2[3];
   double temp[3][3];
@@ -713,9 +713,9 @@ double PairGayBerne::gayberne_lj(const int i,const int j,double a1[3][3],
   // compute distance of closest approach
 
   double g12[3][3];
-  g12[0][0] = g1[0][0]+shape2[type[j]][0];  
-  g12[1][1] = g1[1][1]+shape2[type[j]][0];  
-  g12[2][2] = g1[2][2]+shape2[type[j]][0];  
+  g12[0][0] = g1[0][0]+shape2[type[j]][0];
+  g12[1][1] = g1[1][1]+shape2[type[j]][0];
+  g12[2][2] = g1[2][2]+shape2[type[j]][0];
   g12[0][1] = g1[0][1]; g12[1][0] = g1[1][0];
   g12[0][2] = g1[0][2]; g12[2][0] = g1[2][0];
   g12[1][2] = g1[1][2]; g12[2][1] = g1[2][1];
@@ -750,9 +750,9 @@ double PairGayBerne::gayberne_lj(const int i,const int j,double a1[3][3],
 
   double b12[3][3];
   double iota[3];
-  b12[0][0] = b1[0][0] + well[type[j]][0];  
-  b12[1][1] = b1[1][1] + well[type[j]][0];  
-  b12[2][2] = b1[2][2] + well[type[j]][0];  
+  b12[0][0] = b1[0][0] + well[type[j]][0];
+  b12[1][1] = b1[1][1] + well[type[j]][0];
+  b12[2][2] = b1[2][2] + well[type[j]][0];
   b12[0][1] = b1[0][1]; b12[1][0] = b1[1][0];
   b12[0][2] = b1[0][2]; b12[2][0] = b1[2][0];
   b12[1][2] = b1[1][2]; b12[2][1] = b1[2][1];
@@ -853,58 +853,58 @@ void PairGayBerne::compute_eta_torque(double m[3][3], double m2[3][3],
   double den = m[1][0]*m[0][2]*m[2][1]-m[0][0]*m[1][2]*m[2][1]-
     m[0][2]*m[2][0]*m[1][1]+m[0][1]*m[2][0]*m[1][2]-
     m[1][0]*m[0][1]*m[2][2]+m[0][0]*m[1][1]*m[2][2];
-  
+
   ans[0][0] = s[0]*(m[1][2]*m[0][1]*m2[0][2]+2.0*m[1][1]*m[2][2]*m2[0][0]-
-		    m[1][1]*m2[0][2]*m[0][2]-2.0*m[1][2]*m2[0][0]*m[2][1]+
-		    m2[0][1]*m[0][2]*m[2][1]-m2[0][1]*m[0][1]*m[2][2]-
-		    m[1][0]*m[2][2]*m2[0][1]+m[2][0]*m[1][2]*m2[0][1]+
-		    m[1][0]*m2[0][2]*m[2][1]-m2[0][2]*m[2][0]*m[1][1])/den;
-  
+                    m[1][1]*m2[0][2]*m[0][2]-2.0*m[1][2]*m2[0][0]*m[2][1]+
+                    m2[0][1]*m[0][2]*m[2][1]-m2[0][1]*m[0][1]*m[2][2]-
+                    m[1][0]*m[2][2]*m2[0][1]+m[2][0]*m[1][2]*m2[0][1]+
+                    m[1][0]*m2[0][2]*m[2][1]-m2[0][2]*m[2][0]*m[1][1])/den;
+
   ans[0][1] = s[0]*(m[0][2]*m2[0][0]*m[2][1]-m[2][2]*m2[0][0]*m[0][1]+
-		    2.0*m[0][0]*m[2][2]*m2[0][1]-m[0][0]*m2[0][2]*m[1][2]-
-		    2.0*m[2][0]*m[0][2]*m2[0][1]+m2[0][2]*m[1][0]*m[0][2]-
-		    m[2][2]*m[1][0]*m2[0][0]+m[2][0]*m2[0][0]*m[1][2]+
-		    m[2][0]*m2[0][2]*m[0][1]-m2[0][2]*m[0][0]*m[2][1])/den;
-  
+                    2.0*m[0][0]*m[2][2]*m2[0][1]-m[0][0]*m2[0][2]*m[1][2]-
+                    2.0*m[2][0]*m[0][2]*m2[0][1]+m2[0][2]*m[1][0]*m[0][2]-
+                    m[2][2]*m[1][0]*m2[0][0]+m[2][0]*m2[0][0]*m[1][2]+
+                    m[2][0]*m2[0][2]*m[0][1]-m2[0][2]*m[0][0]*m[2][1])/den;
+
   ans[0][2] = s[0]*(m[0][1]*m[1][2]*m2[0][0]-m[0][2]*m2[0][0]*m[1][1]-
-		    m[0][0]*m[1][2]*m2[0][1]+m[1][0]*m[0][2]*m2[0][1]-
-		    m2[0][1]*m[0][0]*m[2][1]-m[2][0]*m[1][1]*m2[0][0]+
-		    2.0*m[1][1]*m[0][0]*m2[0][2]-2.0*m[1][0]*m2[0][2]*m[0][1]+
-		    m[1][0]*m[2][1]*m2[0][0]+m[2][0]*m2[0][1]*m[0][1])/den;
-  
+                    m[0][0]*m[1][2]*m2[0][1]+m[1][0]*m[0][2]*m2[0][1]-
+                    m2[0][1]*m[0][0]*m[2][1]-m[2][0]*m[1][1]*m2[0][0]+
+                    2.0*m[1][1]*m[0][0]*m2[0][2]-2.0*m[1][0]*m2[0][2]*m[0][1]+
+                    m[1][0]*m[2][1]*m2[0][0]+m[2][0]*m2[0][1]*m[0][1])/den;
+
   ans[1][0] = s[1]*(-m[1][1]*m2[1][2]*m[0][2]+2.0*m[1][1]*m[2][2]*m2[1][0]+
-		    m[1][2]*m[0][1]*m2[1][2]-2.0*m[1][2]*m2[1][0]*m[2][1]+
-		    m2[1][1]*m[0][2]*m[2][1]-m2[1][1]*m[0][1]*m[2][2]-
-		    m[1][0]*m[2][2]*m2[1][1]+m[2][0]*m[1][2]*m2[1][1]-
-		    m2[1][2]*m[2][0]*m[1][1]+m[1][0]*m2[1][2]*m[2][1])/den;
-  
+                    m[1][2]*m[0][1]*m2[1][2]-2.0*m[1][2]*m2[1][0]*m[2][1]+
+                    m2[1][1]*m[0][2]*m[2][1]-m2[1][1]*m[0][1]*m[2][2]-
+                    m[1][0]*m[2][2]*m2[1][1]+m[2][0]*m[1][2]*m2[1][1]-
+                    m2[1][2]*m[2][0]*m[1][1]+m[1][0]*m2[1][2]*m[2][1])/den;
+
   ans[1][1] = s[1]*(m[0][2]*m2[1][0]*m[2][1]-m[0][1]*m[2][2]*m2[1][0]+
-		    2.0*m[2][2]*m[0][0]*m2[1][1]-m2[1][2]*m[0][0]*m[1][2]-
-		    2.0*m[2][0]*m2[1][1]*m[0][2]-m[1][0]*m[2][2]*m2[1][0]+
-		    m[2][0]*m[1][2]*m2[1][0]+m[1][0]*m2[1][2]*m[0][2]-
-		    m[0][0]*m2[1][2]*m[2][1]+m2[1][2]*m[0][1]*m[2][0])/den;
-  
+                    2.0*m[2][2]*m[0][0]*m2[1][1]-m2[1][2]*m[0][0]*m[1][2]-
+                    2.0*m[2][0]*m2[1][1]*m[0][2]-m[1][0]*m[2][2]*m2[1][0]+
+                    m[2][0]*m[1][2]*m2[1][0]+m[1][0]*m2[1][2]*m[0][2]-
+                    m[0][0]*m2[1][2]*m[2][1]+m2[1][2]*m[0][1]*m[2][0])/den;
+
   ans[1][2] = s[1]*(m[0][1]*m[1][2]*m2[1][0]-m[0][2]*m2[1][0]*m[1][1]-
-		    m[0][0]*m[1][2]*m2[1][1]+m[1][0]*m[0][2]*m2[1][1]+
-		    2.0*m[1][1]*m[0][0]*m2[1][2]-m[0][0]*m2[1][1]*m[2][1]+
-		    m[0][1]*m[2][0]*m2[1][1]-m2[1][0]*m[2][0]*m[1][1]-
-		    2.0*m[1][0]*m[0][1]*m2[1][2]+m[1][0]*m2[1][0]*m[2][1])/den;
-  
+                    m[0][0]*m[1][2]*m2[1][1]+m[1][0]*m[0][2]*m2[1][1]+
+                    2.0*m[1][1]*m[0][0]*m2[1][2]-m[0][0]*m2[1][1]*m[2][1]+
+                    m[0][1]*m[2][0]*m2[1][1]-m2[1][0]*m[2][0]*m[1][1]-
+                    2.0*m[1][0]*m[0][1]*m2[1][2]+m[1][0]*m2[1][0]*m[2][1])/den;
+
   ans[2][0] = s[2]*(-m[1][1]*m[0][2]*m2[2][2]+m[0][1]*m[1][2]*m2[2][2]+
-		    2.0*m[1][1]*m2[2][0]*m[2][2]-m[0][1]*m2[2][1]*m[2][2]+
-		    m[0][2]*m[2][1]*m2[2][1]-2.0*m2[2][0]*m[2][1]*m[1][2]-
-		    m[1][0]*m2[2][1]*m[2][2]+m[1][2]*m[2][0]*m2[2][1]-
-		    m[1][1]*m[2][0]*m2[2][2]+m[2][1]*m[1][0]*m2[2][2])/den;
-  
+                    2.0*m[1][1]*m2[2][0]*m[2][2]-m[0][1]*m2[2][1]*m[2][2]+
+                    m[0][2]*m[2][1]*m2[2][1]-2.0*m2[2][0]*m[2][1]*m[1][2]-
+                    m[1][0]*m2[2][1]*m[2][2]+m[1][2]*m[2][0]*m2[2][1]-
+                    m[1][1]*m[2][0]*m2[2][2]+m[2][1]*m[1][0]*m2[2][2])/den;
+
   ans[2][1] = s[2]*-(m[0][1]*m[2][2]*m2[2][0]-m[0][2]*m2[2][0]*m[2][1]-
-		     2.0*m2[2][1]*m[0][0]*m[2][2]+m[1][2]*m2[2][2]*m[0][0]+
-		     2.0*m2[2][1]*m[0][2]*m[2][0]+m[1][0]*m2[2][0]*m[2][2]-
-		     m[1][0]*m[0][2]*m2[2][2]-m[1][2]*m[2][0]*m2[2][0]+
-		     m[0][0]*m2[2][2]*m[2][1]-m2[2][2]*m[0][1]*m[2][0])/den;
-  
+                     2.0*m2[2][1]*m[0][0]*m[2][2]+m[1][2]*m2[2][2]*m[0][0]+
+                     2.0*m2[2][1]*m[0][2]*m[2][0]+m[1][0]*m2[2][0]*m[2][2]-
+                     m[1][0]*m[0][2]*m2[2][2]-m[1][2]*m[2][0]*m2[2][0]+
+                     m[0][0]*m2[2][2]*m[2][1]-m2[2][2]*m[0][1]*m[2][0])/den;
+
   ans[2][2] = s[2]*(m[0][1]*m[1][2]*m2[2][0]-m[0][2]*m2[2][0]*m[1][1]-
-		    m[0][0]*m[1][2]*m2[2][1]+m[1][0]*m[0][2]*m2[2][1]-
-		    m[1][1]*m[2][0]*m2[2][0]-m[2][1]*m2[2][1]*m[0][0]+
-		    2.0*m[1][1]*m2[2][2]*m[0][0]+m[2][1]*m[1][0]*m2[2][0]+
-		    m[2][0]*m[0][1]*m2[2][1]-2.0*m2[2][2]*m[1][0]*m[0][1])/den;
+                    m[0][0]*m[1][2]*m2[2][1]+m[1][0]*m[0][2]*m2[2][1]-
+                    m[1][1]*m[2][0]*m2[2][0]-m[2][1]*m2[2][1]*m[0][0]+
+                    2.0*m[1][1]*m2[2][2]*m[0][0]+m[2][1]*m[1][0]*m2[2][0]+
+                    m[2][0]*m[0][1]*m2[2][1]-2.0*m2[2][2]*m[1][0]*m[0][1])/den;
 }
diff --git a/src/ASPHERE/pair_gayberne.h b/src/ASPHERE/pair_gayberne.h
index 1fa0a8a0e7..450f8f3a95 100755
--- a/src/ASPHERE/pair_gayberne.h
+++ b/src/ASPHERE/pair_gayberne.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,12 +60,12 @@ class PairGayBerne : public Pair {
   void allocate();
   double gayberne_analytic(const int i, const int j, double a1[3][3],
                            double a2[3][3], double b1[3][3], double b2[3][3],
-                           double g1[3][3], double g2[3][3], double *r12, 
-                           const double rsq, double *fforce, double *ttor, 
+                           double g1[3][3], double g2[3][3], double *r12,
+                           const double rsq, double *fforce, double *ttor,
                            double *rtor);
   double gayberne_lj(const int i, const int j, double a1[3][3],
-                     double b1[3][3],double g1[3][3],double *r12, 
-		     const double rsq, double *fforce, double *ttor);
+                     double b1[3][3],double g1[3][3],double *r12,
+                     const double rsq, double *fforce, double *ttor);
   void compute_eta_torque(double m[3][3], double m2[3][3],
                           double *s, double ans[3][3]);
 };
diff --git a/src/ASPHERE/pair_line_lj.cpp b/src/ASPHERE/pair_line_lj.cpp
index f875158e6e..2088ca20f2 100644
--- a/src/ASPHERE/pair_line_lj.cpp
+++ b/src/ASPHERE/pair_line_lj.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -88,12 +88,12 @@ void PairLineLJ::compute(int eflag, int vflag)
   int nlocal = atom->nlocal;
   int nall = nlocal + atom->nghost;
   int newton_pair = force->newton_pair;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // grow discrete list if necessary and initialize
 
   if (nall > nmax) {
@@ -116,7 +116,7 @@ void PairLineLJ::compute(int eflag, int vflag)
     itype = type[i];
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
@@ -126,179 +126,179 @@ void PairLineLJ::compute(int eflag, int vflag)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq >= cutsq[itype][jtype]) continue;
-      
+
       // line/line interactions = NxN particles
-      
+
       evdwl = 0.0;
       if (line[i] >= 0 && line[j] >= 0) {
-	if (dnum[i] == 0) discretize(i,sigma[itype][itype]);
-	npi = dnum[i];
-	ifirst = dfirst[i];
-	if (dnum[j] == 0) discretize(j,sigma[jtype][jtype]);
-	npj = dnum[j];
-	jfirst = dfirst[j];
-
-	for (ni = 0; ni < npi; ni++) {
-	  dxi = discrete[ifirst+ni].dx;
-	  dyi = discrete[ifirst+ni].dy;
-
-	  for (nj = 0; nj < npj; nj++) {
-	    dxj = discrete[jfirst+nj].dx;
-	    dyj = discrete[jfirst+nj].dy;
-
-	    xi[0] = x[i][0] + dxi;
-	    xi[1] = x[i][1] + dyi;
-	    xj[0] = x[j][0] + dxj;
-	    xj[1] = x[j][1] + dyj;
-
-	    delx = xi[0] - xj[0];
-	    dely = xi[1] - xj[1];
-	    rsq = delx*delx + dely*dely;
-
-	    sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
-	    sig3 = sig*sig*sig;
-	    term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	    term1 = 2.0 * term2 * sig3*sig3;
-	    r2inv = 1.0/rsq;
-	    r6inv = r2inv*r2inv*r2inv;
-	    forcelj = r6inv * (term1*r6inv - term2);
-	    fpair = forcelj*r2inv;
-
-	    if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	    fi[0] = delx*fpair;
-	    fi[1] = dely*fpair;
-	    f[i][0] += fi[0];
-	    f[i][1] += fi[1];
-	    torque[i][2] += dxi*fi[1] - dyi*fi[0];
-
-	    if (newton_pair || j < nlocal) {
-	      fj[0] = -delx*fpair;
-	      fj[1] = -dely*fpair;
-	      f[j][0] += fj[0];
-	      f[j][1] += fj[1];
-	      torque[j][2] += dxj*fj[1] - dyj*fj[0];
-	    }
-	  }
-	}
+        if (dnum[i] == 0) discretize(i,sigma[itype][itype]);
+        npi = dnum[i];
+        ifirst = dfirst[i];
+        if (dnum[j] == 0) discretize(j,sigma[jtype][jtype]);
+        npj = dnum[j];
+        jfirst = dfirst[j];
+
+        for (ni = 0; ni < npi; ni++) {
+          dxi = discrete[ifirst+ni].dx;
+          dyi = discrete[ifirst+ni].dy;
+
+          for (nj = 0; nj < npj; nj++) {
+            dxj = discrete[jfirst+nj].dx;
+            dyj = discrete[jfirst+nj].dy;
+
+            xi[0] = x[i][0] + dxi;
+            xi[1] = x[i][1] + dyi;
+            xj[0] = x[j][0] + dxj;
+            xj[1] = x[j][1] + dyj;
+
+            delx = xi[0] - xj[0];
+            dely = xi[1] - xj[1];
+            rsq = delx*delx + dely*dely;
+
+            sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
+            sig3 = sig*sig*sig;
+            term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+            term1 = 2.0 * term2 * sig3*sig3;
+            r2inv = 1.0/rsq;
+            r6inv = r2inv*r2inv*r2inv;
+            forcelj = r6inv * (term1*r6inv - term2);
+            fpair = forcelj*r2inv;
+
+            if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+            fi[0] = delx*fpair;
+            fi[1] = dely*fpair;
+            f[i][0] += fi[0];
+            f[i][1] += fi[1];
+            torque[i][2] += dxi*fi[1] - dyi*fi[0];
+
+            if (newton_pair || j < nlocal) {
+              fj[0] = -delx*fpair;
+              fj[1] = -dely*fpair;
+              f[j][0] += fj[0];
+              f[j][1] += fj[1];
+              torque[j][2] += dxj*fj[1] - dyj*fj[0];
+            }
+          }
+        }
 
       // line/particle interaction = Nx1 particles
       // convert line into Np particles based on sigma and line length
 
       } else if (line[i] >= 0) {
-	if (dnum[i] == 0) discretize(i,sigma[itype][itype]);
-	npi = dnum[i];
-	ifirst = dfirst[i];
-
-	for (ni = 0; ni < npi; ni++) {
-	  dxi = discrete[ifirst+ni].dx;
-	  dyi = discrete[ifirst+ni].dy;
-
-	  xi[0] = x[i][0] + dxi;
-	  xi[1] = x[i][1] + dyi;
-	  xj[0] = x[j][0];
-	  xj[1] = x[j][1];
-
-	  delx = xi[0] - xj[0];
-	  dely = xi[1] - xj[1];
-	  rsq = delx*delx + dely*dely;
-
-	  sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
-	  sig3 = sig*sig*sig;
-	  term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	  term1 = 2.0 * term2 * sig3*sig3;
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (term1*r6inv - term2);
-	  fpair = forcelj*r2inv;
-	  
-	  if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	  fi[0] = delx*fpair;
-	  fi[1] = dely*fpair;
-	  f[i][0] += fi[0];
-	  f[i][1] += fi[1];
-	  torque[i][2] += dxi*fi[1] - dyi*fi[0];
-	  
-	  if (newton_pair || j < nlocal) {
-	    fj[0] = -delx*fpair;
-	    fj[1] = -dely*fpair;
-	    f[j][0] += fj[0];
-	    f[j][1] += fj[1];
-	  }
-	}
+        if (dnum[i] == 0) discretize(i,sigma[itype][itype]);
+        npi = dnum[i];
+        ifirst = dfirst[i];
+
+        for (ni = 0; ni < npi; ni++) {
+          dxi = discrete[ifirst+ni].dx;
+          dyi = discrete[ifirst+ni].dy;
+
+          xi[0] = x[i][0] + dxi;
+          xi[1] = x[i][1] + dyi;
+          xj[0] = x[j][0];
+          xj[1] = x[j][1];
+
+          delx = xi[0] - xj[0];
+          dely = xi[1] - xj[1];
+          rsq = delx*delx + dely*dely;
+
+          sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
+          sig3 = sig*sig*sig;
+          term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+          term1 = 2.0 * term2 * sig3*sig3;
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (term1*r6inv - term2);
+          fpair = forcelj*r2inv;
+
+          if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+          fi[0] = delx*fpair;
+          fi[1] = dely*fpair;
+          f[i][0] += fi[0];
+          f[i][1] += fi[1];
+          torque[i][2] += dxi*fi[1] - dyi*fi[0];
+
+          if (newton_pair || j < nlocal) {
+            fj[0] = -delx*fpair;
+            fj[1] = -dely*fpair;
+            f[j][0] += fj[0];
+            f[j][1] += fj[1];
+          }
+        }
 
       // particle/line interaction = Nx1 particles
       // convert line into Np particles based on sigma and line length
 
       } else if (line[j] >= 0) {
-	if (dnum[j] == 0) discretize(j,sigma[jtype][jtype]);
-	npj = dnum[j];
-	jfirst = dfirst[j];
-
-	for (nj = 0; nj < npj; nj++) {
-	  dxj = discrete[jfirst+nj].dx;
-	  dyj = discrete[jfirst+nj].dy;
-
-	  xi[0] = x[i][0];
-	  xi[1] = x[i][1];
-	  xj[0] = x[j][0] + dxj;
-	  xj[1] = x[j][1] + dyj;
-
-	  delx = xi[0] - xj[0];
-	  dely = xi[1] - xj[1];
-	  rsq = delx*delx + dely*dely;
-
-	  sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
-	  sig3 = sig*sig*sig;
-	  term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	  term1 = 2.0 * term2 * sig3*sig3;
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (term1*r6inv - term2);
-	  fpair = forcelj*r2inv;
-	  
-	  if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	  fi[0] = delx*fpair;
-	  fi[1] = dely*fpair;
-	  f[i][0] += fi[0];
-	  f[i][1] += fi[1];
-	  
-	  if (newton_pair || j < nlocal) {
-	    f[j][0] += fj[0];
-	    f[j][1] += fj[1];
-	    fj[0] = -delx*fpair;
-	    fj[1] = -dely*fpair;
-	    torque[j][2] += dxj*fj[1] - dyj*fj[0];
-	  }
-	}
-	
+        if (dnum[j] == 0) discretize(j,sigma[jtype][jtype]);
+        npj = dnum[j];
+        jfirst = dfirst[j];
+
+        for (nj = 0; nj < npj; nj++) {
+          dxj = discrete[jfirst+nj].dx;
+          dyj = discrete[jfirst+nj].dy;
+
+          xi[0] = x[i][0];
+          xi[1] = x[i][1];
+          xj[0] = x[j][0] + dxj;
+          xj[1] = x[j][1] + dyj;
+
+          delx = xi[0] - xj[0];
+          dely = xi[1] - xj[1];
+          rsq = delx*delx + dely*dely;
+
+          sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
+          sig3 = sig*sig*sig;
+          term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+          term1 = 2.0 * term2 * sig3*sig3;
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (term1*r6inv - term2);
+          fpair = forcelj*r2inv;
+
+          if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+          fi[0] = delx*fpair;
+          fi[1] = dely*fpair;
+          f[i][0] += fi[0];
+          f[i][1] += fi[1];
+
+          if (newton_pair || j < nlocal) {
+            f[j][0] += fj[0];
+            f[j][1] += fj[1];
+            fj[0] = -delx*fpair;
+            fj[1] = -dely*fpair;
+            torque[j][2] += dxj*fj[1] - dyj*fj[0];
+          }
+        }
+
       // particle/particle interaction = 1x1 particles
 
       } else {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = forcelj*r2inv;
-
-	if (eflag)
-	  evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = forcelj*r2inv;
+
+        if (eflag)
+          evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
       }
 
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,0.0,fpair,delx,dely,delz);
+                           evdwl,0.0,fpair,delx,dely,delz);
     }
   }
 
@@ -306,7 +306,7 @@ void PairLineLJ::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLineLJ::allocate()
@@ -331,7 +331,7 @@ void PairLineLJ::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLineLJ::settings(int narg, char **arg)
@@ -346,7 +346,7 @@ void PairLineLJ::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -356,7 +356,7 @@ void PairLineLJ::settings(int narg, char **arg)
 
 void PairLineLJ::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) 
+  if (narg < 4 || narg > 5)
     error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
@@ -392,7 +392,7 @@ double PairLineLJ::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
   }
diff --git a/src/ASPHERE/pair_line_lj.h b/src/ASPHERE/pair_line_lj.h
index b6c2d3bc0b..8a802ad295 100644
--- a/src/ASPHERE/pair_line_lj.h
+++ b/src/ASPHERE/pair_line_lj.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/ASPHERE/pair_resquared.cpp b/src/ASPHERE/pair_resquared.cpp
index c2654ca7fd..a1684afe22 100755
--- a/src/ASPHERE/pair_resquared.cpp
+++ b/src/ASPHERE/pair_resquared.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,8 +35,8 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-PairRESquared::PairRESquared(LAMMPS *lmp) : Pair(lmp), 
-					    b_alpha(45.0/56.0),
+PairRESquared::PairRESquared(LAMMPS *lmp) : Pair(lmp),
+                                            b_alpha(45.0/56.0),
                                             cr60(pow(60.0,1.0/3.0))
 {
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
@@ -103,7 +103,7 @@ void PairRESquared::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -133,7 +133,7 @@ void PairRESquared::compute(int eflag, int vflag)
       // compute if less than cutoff
 
       if (rsq < cutsq[itype][jtype]) {
-	fforce[0] = fforce[1] = fforce[2] = 0.0;
+        fforce[0] = fforce[1] = fforce[2] = 0.0;
 
         switch (form[itype][jtype]) {
 
@@ -197,9 +197,9 @@ void PairRESquared::compute(int eflag, int vflag)
 
         if (eflag) evdwl = factor_lj*one_eng;
 
-	if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
-				 evdwl,0.0,fforce[0],fforce[1],fforce[2],
-				 -r12[0],-r12[1],-r12[2]);
+        if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
+                                 evdwl,0.0,fforce[0],fforce[1],fforce[2],
+                                 -r12[0],-r12[1],-r12[2]);
       }
     }
   }
@@ -250,7 +250,7 @@ void PairRESquared::settings(int narg, char **arg)
   if (narg != 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
-  
+
   // reset cutoffs that have been explicitly set
 
   if (allocated) {
@@ -283,7 +283,7 @@ void PairRESquared::coeff(int narg, char **arg)
   double eja_one = force->numeric(arg[7]);
   double ejb_one = force->numeric(arg[8]);
   double ejc_one = force->numeric(arg[9]);
-  
+
   double cut_one = cut_global;
   if (narg == 11) cut_one = force->numeric(arg[10]);
 
@@ -348,12 +348,12 @@ double PairRESquared::init_one(int i, int j)
     error->all(FLERR,"Pair resquared epsilon a,b,c coeffs are not all set");
 
   int ishape = 0;
-  if (shape1[i][0] != 0.0 && shape1[i][1] != 0.0 && shape1[i][2] != 0.0) 
+  if (shape1[i][0] != 0.0 && shape1[i][1] != 0.0 && shape1[i][2] != 0.0)
     ishape = 1;
   int jshape = 0;
-  if (shape1[j][0] != 0.0 && shape1[j][1] != 0.0 && shape1[j][2] != 0.0) 
+  if (shape1[j][0] != 0.0 && shape1[j][1] != 0.0 && shape1[j][2] != 0.0)
     jshape = 1;
-  
+
   if (ishape == 0 && jshape == 0) {
     form[i][j] = SPHERE_SPHERE;
     form[j][i] = SPHERE_SPHERE;
@@ -384,12 +384,12 @@ double PairRESquared::init_one(int i, int j)
     sigma[i][j] = sigma[j][i];
     cut[i][j] = cut[j][i];
   }
-  
+
   lj1[i][j] = 48.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
   lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
   lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
   lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
-     
+
   if (offset_flag) {
     double ratio = sigma[i][j] / cut[i][j];
     offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
@@ -513,7 +513,7 @@ void PairRESquared::precompute_i(const int i,RE2Vars &ws)
     MathExtra::plus3(ws.lAsa[i],ws.lAtwo[i],ws.lAsa[i]);
   }
 }
-                                      
+
 /* ----------------------------------------------------------------------
    Compute the derivative of the determinant of m, using m and the
    derivative of m (m2)
@@ -545,7 +545,7 @@ double PairRESquared::resquared_analytic(const int i, const int j,
                                          double *rtor)
 {
   int *type = atom->type;
-    
+
   // pair computations for energy, force, torque
 
   double z1[3],z2[3];        // A1*rhat  # don't need to store
@@ -568,7 +568,7 @@ double PairRESquared::resquared_analytic(const int i, const int j,
   double sigh;               // sigma/h12
   double tprod;              // eta*chi*sigh
   double Ua,Ur;              // attractive/repulsive parts of potential
-    
+
   // pair computations for force, torque
 
   double sec;                          // sigma*eta*chi
@@ -593,7 +593,7 @@ double PairRESquared::resquared_analytic(const int i, const int j,
   double ddH;                          // derivative of det(H12)
   double deta,dchi,dh12;               // derivatives of eta,chi,h12
   double dUr,dUa;                      // derivatives of Ua,Ur
-      
+
   // pair computations for torque
 
   double fwae[3];        // -fourw'*aTe
@@ -715,7 +715,7 @@ double PairRESquared::resquared_analytic(const int i, const int j,
   hsec = h12+3.0*sec;
   dspu = 1.0/h12-1.0/hsec+stemp;
   pbsu = 3.0*sigma[type[i]][type[j]]/hsec;
-  
+
   stemp = 1.0/(shape1[type[i]][0]*cr60+h12)+
           1.0/(shape1[type[i]][1]*cr60+h12)+
           1.0/(shape1[type[i]][2]*cr60+h12)+
@@ -725,7 +725,7 @@ double PairRESquared::resquared_analytic(const int i, const int j,
   hsec = h12+b_alpha*sec;
   dspr = 7.0/h12-1.0/hsec+stemp;
   pbsr = b_alpha*sigma[type[i]][type[j]]/hsec;
-  
+
   for (int i=0; i<3; i++) {
     u[0] = -rhat[i]*rhat[0];
     u[1] = -rhat[i]*rhat[1];
@@ -757,7 +757,7 @@ double PairRESquared::resquared_analytic(const int i, const int j,
     dUr = pbsr*(eta*dchi+deta*chi)-dh12*dspr;
     fforce[i]=dUr*Ur+dUa*Ua;
   }
-    
+
   // torque on i
 
   MathExtra::vecmat(fourw,wi.aTe,fwae);
@@ -787,7 +787,7 @@ double PairRESquared::resquared_analytic(const int i, const int j,
     dUr = pbsr*(eta*dchi + deta*chi)-dh12*dspr;
     ttor[i] = -(dUa*Ua+dUr*Ur);
   }
-  
+
   // torque on j
 
   if (!(force->newton_pair || j < atom->nlocal))
@@ -829,12 +829,12 @@ double PairRESquared::resquared_analytic(const int i, const int j,
 ------------------------------------------------------------------------- */
 
 double PairRESquared::resquared_lj(const int i, const int j,
-                                   const RE2Vars &wi, const double *r, 
-                                   const double rsq, double *fforce, 
+                                   const RE2Vars &wi, const double *r,
+                                   const double rsq, double *fforce,
                                    double *ttor, bool calc_torque)
 {
   int *type = atom->type;
-    
+
   // pair computations for energy, force, torque
 
   double rnorm;              // L2 norm of r
@@ -847,7 +847,7 @@ double PairRESquared::resquared_lj(const int i, const int j,
   double sigh;               // sigma/h12
   double tprod;              // chi*sigh
   double Ua,Ur;              // attractive/repulsive parts of potential
-    
+
   // pair computations for force, torque
 
   double sec;                          // sigma*chi
@@ -863,7 +863,7 @@ double PairRESquared::resquared_lj(const int i, const int j,
   double dchi,dh12;                    // derivatives of chi,h12
   double dUr,dUa;                      // derivatives of Ua,Ur
   double h12p3;                        // h12^3
-      
+
   // pair computations for torque
 
   double fwae[3];        // -fourw'*aTe
@@ -943,7 +943,7 @@ double PairRESquared::resquared_lj(const int i, const int j,
   hsec = h12+3.0*sec;
   dspu = 1.0/h12-1.0/hsec+stemp;
   pbsu = 3.0*sigma[type[i]][type[j]]/hsec;
-  
+
   stemp = 1.0/(shape1[type[i]][0]*cr60+h12)+
           1.0/(shape1[type[i]][1]*cr60+h12)+
           1.0/(shape1[type[i]][2]*cr60+h12)+
@@ -951,7 +951,7 @@ double PairRESquared::resquared_lj(const int i, const int j,
   hsec = h12+b_alpha*sec;
   dspr = 7.0/h12-1.0/hsec+stemp;
   pbsr = b_alpha*sigma[type[i]][type[j]]/hsec;
-  
+
   for (int i=0; i<3; i++) {
     u[0] = -rhat[i]*rhat[0];
     u[1] = -rhat[i]*rhat[1];
@@ -966,7 +966,7 @@ double PairRESquared::resquared_lj(const int i, const int j,
     dUr = pbsr*dchi-dh12*dspr;
     fforce[i]=dUr*Ur+dUa*Ua;
   }
-    
+
   // torque on i
 
   if (calc_torque) {
diff --git a/src/ASPHERE/pair_resquared.h b/src/ASPHERE/pair_resquared.h
index da0b24a8b8..f2c2b0106a 100755
--- a/src/ASPHERE/pair_resquared.h
+++ b/src/ASPHERE/pair_resquared.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,7 +64,7 @@ class PairRESquared : public Pair {
     double A[3][3];     // Rotation matrix (lab->body)
     double aTe[3][3];   // A'*E
     double gamma[3][3]; // A'*S^2*A
-  
+
     // per particle precomputations for torque
 
     double sa[3][3];       // S^2*A;
@@ -72,7 +72,7 @@ class PairRESquared : public Pair {
     double lAtwo[3][3][3]; // A'*S^2*lA
     double lAsa[3][3][3];  // lAtwo+lA'*sa
   };
-    
+
   void allocate();
 
   void precompute_i(const int i,RE2Vars &ws);
@@ -82,8 +82,8 @@ class PairRESquared : public Pair {
                             const double *r, const double rsq,
                             double *fforce, double *ttor,
                             double *rtor);
-  double resquared_lj(const int i, const int j, const RE2Vars &wi, 
-                      const double *r, const double rsq, double *fforce, 
+  double resquared_lj(const int i, const int j, const RE2Vars &wi,
+                      const double *r, const double rsq, double *fforce,
                       double *ttor, bool calc_torque);
 
   double cr60;         // 60^1/3
diff --git a/src/ASPHERE/pair_tri_lj.cpp b/src/ASPHERE/pair_tri_lj.cpp
index 13650bb611..ec0a07abee 100644
--- a/src/ASPHERE/pair_tri_lj.cpp
+++ b/src/ASPHERE/pair_tri_lj.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -92,12 +92,12 @@ void PairTriLJ::compute(int eflag, int vflag)
   int nlocal = atom->nlocal;
   int nall = nlocal + atom->nghost;
   int newton_pair = force->newton_pair;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // grow discrete list if necessary and initialize
 
   if (nall > nmax) {
@@ -130,259 +130,259 @@ void PairTriLJ::compute(int eflag, int vflag)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq >= cutsq[itype][jtype]) continue;
-      
+
       // tri/tri interactions = NxN particles
       // c1,c2,c3 = corner pts of triangle I or J
-      
+
       evdwl = 0.0;
       if (tri[i] >= 0 && tri[j] >= 0) {
-	if (dnum[i] == 0) {
-	  MathExtra::quat_to_mat(bonus[tri[i]].quat,p);
-	  MathExtra::matvec(p,bonus[tri[i]].c1,dc1);
-	  MathExtra::matvec(p,bonus[tri[i]].c2,dc2);
-	  MathExtra::matvec(p,bonus[tri[i]].c3,dc3);
-	  dfirst[i] = ndiscrete;
-	  discretize(i,sigma[itype][itype],dc1,dc2,dc3);
-	  dnum[i] = ndiscrete - dfirst[i];
-	}
-	npi = dnum[i];
-	ifirst = dfirst[i];
-
-	if (dnum[j] == 0) {
-	  MathExtra::quat_to_mat(bonus[tri[j]].quat,p);
-	  MathExtra::matvec(p,bonus[tri[j]].c1,dc1);
-	  MathExtra::matvec(p,bonus[tri[j]].c2,dc2);
-	  MathExtra::matvec(p,bonus[tri[j]].c3,dc3);
-	  dfirst[j] = ndiscrete;
-	  discretize(j,sigma[jtype][jtype],dc1,dc2,dc3);
-	  dnum[j] = ndiscrete - dfirst[j];
-	}
-	npj = dnum[j];
-	jfirst = dfirst[j];
-
-	for (ni = 0; ni < npi; ni++) {
-	  dxi = discrete[ifirst+ni].dx;
-	  dyi = discrete[ifirst+ni].dy;
-	  dzi = discrete[ifirst+ni].dz;
-
-	  for (nj = 0; nj < npj; nj++) {
-	    dxj = discrete[jfirst+nj].dx;
-	    dyj = discrete[jfirst+nj].dy;
-	    dzj = discrete[jfirst+nj].dz;
-
-	    xi[0] = x[i][0] + dxi;
-	    xi[1] = x[i][1] + dyi;
-	    xi[2] = x[i][2] + dzi;
-	    xj[0] = x[j][0] + dxj;
-	    xj[1] = x[j][1] + dyj;
-	    xj[2] = x[j][2] + dzj;
-
-	    delx = xi[0] - xj[0];
-	    dely = xi[1] - xj[1];
-	    delz = xi[2] - xj[2];
-	    rsq = delx*delx + dely*dely + delz*delz;
- 
-	    sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
-	    sig3 = sig*sig*sig;
-	    term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	    term1 = 2.0 * term2 * sig3*sig3;
-	    r2inv = 1.0/rsq;
-	    r6inv = r2inv*r2inv*r2inv;
-	    forcelj = r6inv * (term1*r6inv - term2);
-	    fpair = forcelj*r2inv;
-	    
-	    if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	    fi[0] = delx*fpair;
-	    fi[1] = dely*fpair;
-	    fi[2] = delz*fpair;
-	    f[i][0] += fi[0];
-	    f[i][1] += fi[1];
-	    f[i][2] += fi[2];
-	    ti[0] = dyi*fi[2] - dzi*fi[1];
-	    ti[1] = dzi*fi[0] - dxi*fi[2];
-	    ti[2] = dxi*fi[1] - dyi*fi[0];
-	    torque[i][0] += ti[0];
-	    torque[i][1] += ti[1];
-	    torque[i][2] += ti[2];
-
-	    if (newton_pair || j < nlocal) {
-	      fj[0] = -delx*fpair;
-	      fj[1] = -dely*fpair;
-	      fj[2] = -delz*fpair;
-	      f[j][0] += fj[0];
-	      f[j][1] += fj[1];
-	      f[j][2] += fj[2];
-	      tj[0] = dyj*fj[2] - dzj*fj[1];
-	      tj[1] = dzj*fj[0] - dxj*fj[2];
-	      tj[2] = dxj*fj[1] - dyj*fj[0];
-	      torque[j][0] += tj[0];
-	      torque[j][1] += tj[1];
-	      torque[j][2] += tj[2];
-	    }
-	  }
-	}
+        if (dnum[i] == 0) {
+          MathExtra::quat_to_mat(bonus[tri[i]].quat,p);
+          MathExtra::matvec(p,bonus[tri[i]].c1,dc1);
+          MathExtra::matvec(p,bonus[tri[i]].c2,dc2);
+          MathExtra::matvec(p,bonus[tri[i]].c3,dc3);
+          dfirst[i] = ndiscrete;
+          discretize(i,sigma[itype][itype],dc1,dc2,dc3);
+          dnum[i] = ndiscrete - dfirst[i];
+        }
+        npi = dnum[i];
+        ifirst = dfirst[i];
+
+        if (dnum[j] == 0) {
+          MathExtra::quat_to_mat(bonus[tri[j]].quat,p);
+          MathExtra::matvec(p,bonus[tri[j]].c1,dc1);
+          MathExtra::matvec(p,bonus[tri[j]].c2,dc2);
+          MathExtra::matvec(p,bonus[tri[j]].c3,dc3);
+          dfirst[j] = ndiscrete;
+          discretize(j,sigma[jtype][jtype],dc1,dc2,dc3);
+          dnum[j] = ndiscrete - dfirst[j];
+        }
+        npj = dnum[j];
+        jfirst = dfirst[j];
+
+        for (ni = 0; ni < npi; ni++) {
+          dxi = discrete[ifirst+ni].dx;
+          dyi = discrete[ifirst+ni].dy;
+          dzi = discrete[ifirst+ni].dz;
+
+          for (nj = 0; nj < npj; nj++) {
+            dxj = discrete[jfirst+nj].dx;
+            dyj = discrete[jfirst+nj].dy;
+            dzj = discrete[jfirst+nj].dz;
+
+            xi[0] = x[i][0] + dxi;
+            xi[1] = x[i][1] + dyi;
+            xi[2] = x[i][2] + dzi;
+            xj[0] = x[j][0] + dxj;
+            xj[1] = x[j][1] + dyj;
+            xj[2] = x[j][2] + dzj;
+
+            delx = xi[0] - xj[0];
+            dely = xi[1] - xj[1];
+            delz = xi[2] - xj[2];
+            rsq = delx*delx + dely*dely + delz*delz;
+
+            sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
+            sig3 = sig*sig*sig;
+            term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+            term1 = 2.0 * term2 * sig3*sig3;
+            r2inv = 1.0/rsq;
+            r6inv = r2inv*r2inv*r2inv;
+            forcelj = r6inv * (term1*r6inv - term2);
+            fpair = forcelj*r2inv;
+
+            if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+            fi[0] = delx*fpair;
+            fi[1] = dely*fpair;
+            fi[2] = delz*fpair;
+            f[i][0] += fi[0];
+            f[i][1] += fi[1];
+            f[i][2] += fi[2];
+            ti[0] = dyi*fi[2] - dzi*fi[1];
+            ti[1] = dzi*fi[0] - dxi*fi[2];
+            ti[2] = dxi*fi[1] - dyi*fi[0];
+            torque[i][0] += ti[0];
+            torque[i][1] += ti[1];
+            torque[i][2] += ti[2];
+
+            if (newton_pair || j < nlocal) {
+              fj[0] = -delx*fpair;
+              fj[1] = -dely*fpair;
+              fj[2] = -delz*fpair;
+              f[j][0] += fj[0];
+              f[j][1] += fj[1];
+              f[j][2] += fj[2];
+              tj[0] = dyj*fj[2] - dzj*fj[1];
+              tj[1] = dzj*fj[0] - dxj*fj[2];
+              tj[2] = dxj*fj[1] - dyj*fj[0];
+              torque[j][0] += tj[0];
+              torque[j][1] += tj[1];
+              torque[j][2] += tj[2];
+            }
+          }
+        }
 
       // tri/particle interaction = Nx1 particles
       // c1,c2,c3 = corner pts of triangle I
 
       } else if (tri[i] >= 0) {
 
-	if (dnum[i] == 0) {
-	  MathExtra::quat_to_mat(bonus[tri[i]].quat,p);
-	  MathExtra::matvec(p,bonus[tri[i]].c1,dc1);
-	  MathExtra::matvec(p,bonus[tri[i]].c2,dc2);
-	  MathExtra::matvec(p,bonus[tri[i]].c3,dc3);
-	  dfirst[i] = ndiscrete;
-	  discretize(i,sigma[itype][itype],dc1,dc2,dc3);
-	  dnum[i] = ndiscrete - dfirst[i];
-	}
-	npi = dnum[i];
-	ifirst = dfirst[i];
-
-	for (ni = 0; ni < npi; ni++) {
-	  dxi = discrete[ifirst+ni].dx;
-	  dyi = discrete[ifirst+ni].dy;
-	  dzi = discrete[ifirst+ni].dz;
-
-	  xi[0] = x[i][0] + dxi;
-	  xi[1] = x[i][1] + dyi;
-	  xi[2] = x[i][2] + dzi;
-	  xj[0] = x[j][0];
-	  xj[1] = x[j][1];
-	  xj[2] = x[j][2];
-
-	  delx = xi[0] - xj[0];
-	  dely = xi[1] - xj[1];
-	  delz = xi[2] - xj[2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-
-	  sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
-	  sig3 = sig*sig*sig;
-	  term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	  term1 = 2.0 * term2 * sig3*sig3;
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (term1*r6inv - term2);
-	  fpair = forcelj*r2inv;
-	  
-	  if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	  fi[0] = delx*fpair;
-	  fi[1] = dely*fpair;
-	  fi[2] = delz*fpair;
-	  f[i][0] += fi[0];
-	  f[i][1] += fi[1];
-	  f[i][2] += fi[2];
-	  ti[0] = dyi*fi[2] - dzi*fi[1];
-	  ti[1] = dzi*fi[0] - dxi*fi[2];
-	  ti[2] = dxi*fi[1] - dyi*fi[0];
-	  torque[i][2] += ti[0];
-	  torque[i][1] += ti[1];
-	  torque[i][2] += ti[2];
-	  
-	  if (newton_pair || j < nlocal) {
-	    fj[0] = -delx*fpair;
-	    fj[1] = -dely*fpair;
-	    fj[2] = -delz*fpair;
-	    f[j][0] += fj[0];
-	    f[j][1] += fj[1];
-	    f[j][2] += fj[2];
-	  }
-	}
+        if (dnum[i] == 0) {
+          MathExtra::quat_to_mat(bonus[tri[i]].quat,p);
+          MathExtra::matvec(p,bonus[tri[i]].c1,dc1);
+          MathExtra::matvec(p,bonus[tri[i]].c2,dc2);
+          MathExtra::matvec(p,bonus[tri[i]].c3,dc3);
+          dfirst[i] = ndiscrete;
+          discretize(i,sigma[itype][itype],dc1,dc2,dc3);
+          dnum[i] = ndiscrete - dfirst[i];
+        }
+        npi = dnum[i];
+        ifirst = dfirst[i];
+
+        for (ni = 0; ni < npi; ni++) {
+          dxi = discrete[ifirst+ni].dx;
+          dyi = discrete[ifirst+ni].dy;
+          dzi = discrete[ifirst+ni].dz;
+
+          xi[0] = x[i][0] + dxi;
+          xi[1] = x[i][1] + dyi;
+          xi[2] = x[i][2] + dzi;
+          xj[0] = x[j][0];
+          xj[1] = x[j][1];
+          xj[2] = x[j][2];
+
+          delx = xi[0] - xj[0];
+          dely = xi[1] - xj[1];
+          delz = xi[2] - xj[2];
+          rsq = delx*delx + dely*dely + delz*delz;
+
+          sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
+          sig3 = sig*sig*sig;
+          term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+          term1 = 2.0 * term2 * sig3*sig3;
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (term1*r6inv - term2);
+          fpair = forcelj*r2inv;
+
+          if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+          fi[0] = delx*fpair;
+          fi[1] = dely*fpair;
+          fi[2] = delz*fpair;
+          f[i][0] += fi[0];
+          f[i][1] += fi[1];
+          f[i][2] += fi[2];
+          ti[0] = dyi*fi[2] - dzi*fi[1];
+          ti[1] = dzi*fi[0] - dxi*fi[2];
+          ti[2] = dxi*fi[1] - dyi*fi[0];
+          torque[i][2] += ti[0];
+          torque[i][1] += ti[1];
+          torque[i][2] += ti[2];
+
+          if (newton_pair || j < nlocal) {
+            fj[0] = -delx*fpair;
+            fj[1] = -dely*fpair;
+            fj[2] = -delz*fpair;
+            f[j][0] += fj[0];
+            f[j][1] += fj[1];
+            f[j][2] += fj[2];
+          }
+        }
 
       // particle/tri interaction = Nx1 particles
       // c1,c2,c3 = corner pts of triangle J
 
       } else if (tri[j] >= 0) {
-	if (dnum[j] == 0) {
-	  MathExtra::quat_to_mat(bonus[tri[j]].quat,p);
-	  MathExtra::matvec(p,bonus[tri[j]].c1,dc1);
-	  MathExtra::matvec(p,bonus[tri[j]].c2,dc2);
-	  MathExtra::matvec(p,bonus[tri[j]].c3,dc3);
-	  dfirst[j] = ndiscrete;
-	  discretize(j,sigma[jtype][jtype],dc1,dc2,dc3);
-	  dnum[j] = ndiscrete - dfirst[j];
-	}
-	npj = dnum[j];
-	jfirst = dfirst[j];
-
-	for (nj = 0; nj < npj; nj++) {
-	  dxj = discrete[jfirst+nj].dx;
-	  dyj = discrete[jfirst+nj].dy;
-	  dzj = discrete[jfirst+nj].dz;
-
-	  xi[0] = x[i][0];
-	  xi[1] = x[i][1];
-	  xi[2] = x[i][2];
-	  xj[0] = x[j][0] + dxj;
-	  xj[1] = x[j][1] + dyj;
-	  xj[2] = x[j][2] + dzj;
-
-	  delx = xi[0] - xj[0];
-	  dely = xi[1] - xj[1];
-	  delz = xi[2] - xj[2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-
-	  sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
-	  sig3 = sig*sig*sig;
-	  term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	  term1 = 2.0 * term2 * sig3*sig3;
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (term1*r6inv - term2);
-	  fpair = forcelj*r2inv;
-	  
-	  if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	  fi[0] = delx*fpair;
-	  fi[1] = dely*fpair;
-	  fi[2] = delz*fpair;
-	  f[i][0] += fi[0];
-	  f[i][1] += fi[1];
-	  f[i][2] += fi[2];
-	  
-	  if (newton_pair || j < nlocal) {
-	    fj[0] = -delx*fpair;
-	    fj[1] = -dely*fpair;
-	    fj[2] = -delz*fpair;
-	    f[j][0] += fj[0];
-	    f[j][1] += fj[1];
-	    f[j][2] += fj[2];
-	    tj[0] = dyj*fj[2] - dzj*fj[1];
-	    tj[1] = dzj*fj[0] - dxj*fj[2];
-	    tj[2] = dxj*fj[1] - dyj*fj[0];
-	    torque[j][0] += tj[0];
-	    torque[j][1] += tj[1];
-	    torque[j][2] += tj[2];
-	  }
-	}
+        if (dnum[j] == 0) {
+          MathExtra::quat_to_mat(bonus[tri[j]].quat,p);
+          MathExtra::matvec(p,bonus[tri[j]].c1,dc1);
+          MathExtra::matvec(p,bonus[tri[j]].c2,dc2);
+          MathExtra::matvec(p,bonus[tri[j]].c3,dc3);
+          dfirst[j] = ndiscrete;
+          discretize(j,sigma[jtype][jtype],dc1,dc2,dc3);
+          dnum[j] = ndiscrete - dfirst[j];
+        }
+        npj = dnum[j];
+        jfirst = dfirst[j];
+
+        for (nj = 0; nj < npj; nj++) {
+          dxj = discrete[jfirst+nj].dx;
+          dyj = discrete[jfirst+nj].dy;
+          dzj = discrete[jfirst+nj].dz;
+
+          xi[0] = x[i][0];
+          xi[1] = x[i][1];
+          xi[2] = x[i][2];
+          xj[0] = x[j][0] + dxj;
+          xj[1] = x[j][1] + dyj;
+          xj[2] = x[j][2] + dzj;
+
+          delx = xi[0] - xj[0];
+          dely = xi[1] - xj[1];
+          delz = xi[2] - xj[2];
+          rsq = delx*delx + dely*dely + delz*delz;
+
+          sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
+          sig3 = sig*sig*sig;
+          term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+          term1 = 2.0 * term2 * sig3*sig3;
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (term1*r6inv - term2);
+          fpair = forcelj*r2inv;
+
+          if (eflag) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+          fi[0] = delx*fpair;
+          fi[1] = dely*fpair;
+          fi[2] = delz*fpair;
+          f[i][0] += fi[0];
+          f[i][1] += fi[1];
+          f[i][2] += fi[2];
+
+          if (newton_pair || j < nlocal) {
+            fj[0] = -delx*fpair;
+            fj[1] = -dely*fpair;
+            fj[2] = -delz*fpair;
+            f[j][0] += fj[0];
+            f[j][1] += fj[1];
+            f[j][2] += fj[2];
+            tj[0] = dyj*fj[2] - dzj*fj[1];
+            tj[1] = dzj*fj[0] - dxj*fj[2];
+            tj[2] = dxj*fj[1] - dyj*fj[0];
+            torque[j][0] += tj[0];
+            torque[j][1] += tj[1];
+            torque[j][2] += tj[2];
+          }
+        }
 
       // particle/particle interaction = 1x1 particles
 
       } else {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = forcelj*r2inv;
-
-	if (eflag)
-	  evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = forcelj*r2inv;
+
+        if (eflag)
+          evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
       }
 
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,0.0,fpair,delx,dely,delz);
+                           evdwl,0.0,fpair,delx,dely,delz);
     }
   }
 
@@ -390,7 +390,7 @@ void PairTriLJ::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairTriLJ::allocate()
@@ -415,7 +415,7 @@ void PairTriLJ::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairTriLJ::settings(int narg, char **arg)
@@ -430,7 +430,7 @@ void PairTriLJ::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -440,7 +440,7 @@ void PairTriLJ::settings(int narg, char **arg)
 
 void PairTriLJ::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) 
+  if (narg < 4 || narg > 5)
     error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
@@ -476,7 +476,7 @@ double PairTriLJ::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
   }
@@ -504,7 +504,7 @@ double PairTriLJ::init_one(int i, int j)
 ------------------------------------------------------------------------- */
 
 void PairTriLJ::discretize(int i, double sigma,
-			  double *c1, double *c2, double *c3)
+                          double *c1, double *c2, double *c3)
 {
   double c1c2[3],c2c3[3],c1c3[3];
 
@@ -529,7 +529,7 @@ void PairTriLJ::discretize(int i, double sigma,
     if (ndiscrete == dmax) {
       dmax += DELTA;
       discrete = (Discrete *)
-	memory->srealloc(discrete,dmax*sizeof(Discrete),"pair:discrete");
+        memory->srealloc(discrete,dmax*sizeof(Discrete),"pair:discrete");
     }
     discrete[ndiscrete].dx = centroid[0];
     discrete[ndiscrete].dy = centroid[1];
@@ -582,7 +582,7 @@ void PairTriLJ::discretize(int i, double sigma,
 
 /*
 void PairTriLJ::discretize(int i, double sigma,
-			  double *c1, double *c2, double *c3)
+                          double *c1, double *c2, double *c3)
 {
   double centroid[3],dc1[3],dc2[3],dc3[3];
 
@@ -605,7 +605,7 @@ void PairTriLJ::discretize(int i, double sigma,
     if (ndiscrete == dmax) {
       dmax += DELTA;
       discrete = (Discrete *)
-	memory->srealloc(discrete,dmax*sizeof(Discrete),"pair:discrete");
+        memory->srealloc(discrete,dmax*sizeof(Discrete),"pair:discrete");
     }
     discrete[ndiscrete].dx = centroid[0];
     discrete[ndiscrete].dy = centroid[1];
diff --git a/src/ASPHERE/pair_tri_lj.h b/src/ASPHERE/pair_tri_lj.h
index df65b0fd10..f37903055b 100644
--- a/src/ASPHERE/pair_tri_lj.h
+++ b/src/ASPHERE/pair_tri_lj.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/CLASS2/angle_class2.cpp b/src/CLASS2/angle_class2.cpp
index ac74f441f7..4129216ed3 100644
--- a/src/CLASS2/angle_class2.cpp
+++ b/src/CLASS2/angle_class2.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -116,10 +116,10 @@ void AngleClass2::compute(int eflag, int vflag)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
@@ -131,14 +131,14 @@ void AngleClass2::compute(int eflag, int vflag)
     dtheta3 = dtheta2*dtheta;
     dtheta4 = dtheta3*dtheta;
 
-    de_angle = 2.0*k2[type]*dtheta + 3.0*k3[type]*dtheta2 + 
+    de_angle = 2.0*k2[type]*dtheta + 3.0*k3[type]*dtheta2 +
       4.0*k4[type]*dtheta3;
 
     a = -de_angle*s;
     a11 = a*c / rsq1;
     a12 = -a / (r1*r2);
     a22 = a*c / rsq2;
-        
+
     f1[0] = a11*delx1 + a12*delx2;
     f1[1] = a11*dely1 + a12*dely2;
     f1[2] = a11*delz1 + a12*delz2;
@@ -227,7 +227,7 @@ void AngleClass2::compute(int eflag, int vflag)
     }
 
     if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
   }
 }
 
@@ -283,7 +283,7 @@ void AngleClass2::coeff(int narg, char **arg)
     double bb_k_one = force->numeric(arg[2]);
     double bb_r1_one = force->numeric(arg[3]);
     double bb_r2_one = force->numeric(arg[4]);
-    
+
     for (int i = ilo; i <= ihi; i++) {
       bb_k[i] = bb_k_one;
       bb_r1[i] = bb_r1_one;
@@ -299,7 +299,7 @@ void AngleClass2::coeff(int narg, char **arg)
     double ba_k2_one = force->numeric(arg[3]);
     double ba_r1_one = force->numeric(arg[4]);
     double ba_r2_one = force->numeric(arg[5]);
-    
+
     for (int i = ilo; i <= ihi; i++) {
       ba_k1[i] = ba_k1_one;
       ba_k2[i] = ba_k2_one;
@@ -316,7 +316,7 @@ void AngleClass2::coeff(int narg, char **arg)
     double k2_one = force->numeric(arg[2]);
     double k3_one = force->numeric(arg[3]);
     double k4_one = force->numeric(arg[4]);
-    
+
     // convert theta0 from degrees to radians
 
     for (int i = ilo; i <= ihi; i++) {
@@ -365,7 +365,7 @@ void AngleClass2::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void AngleClass2::read_restart(FILE *fp)
@@ -381,7 +381,7 @@ void AngleClass2::read_restart(FILE *fp)
     fread(&bb_k[1],sizeof(double),atom->nangletypes,fp);
     fread(&bb_r1[1],sizeof(double),atom->nangletypes,fp);
     fread(&bb_r2[1],sizeof(double),atom->nangletypes,fp);
-    
+
     fread(&ba_k1[1],sizeof(double),atom->nangletypes,fp);
     fread(&ba_k2[1],sizeof(double),atom->nangletypes,fp);
     fread(&ba_r1[1],sizeof(double),atom->nangletypes,fp);
@@ -427,7 +427,7 @@ double AngleClass2::single(int type, int i1, int i2, int i3)
   c /= r1*r2;
   if (c > 1.0) c = 1.0;
   if (c < -1.0) c = -1.0;
-        
+
   double s = sqrt(1.0 - c*c);
   if (s < SMALL) s = SMALL;
   s = 1.0/s;
@@ -436,9 +436,9 @@ double AngleClass2::single(int type, int i1, int i2, int i3)
   double dtheta2 = dtheta*dtheta;
   double dtheta3 = dtheta2*dtheta;
   double dtheta4 = dtheta3*dtheta;
-  
+
   double energy = k2[type]*dtheta2 + k3[type]*dtheta3 + k4[type]*dtheta4;
-  
+
   double dr1 = r1 - bb_r1[type];
   double dr2 = r2 - bb_r2[type];
   energy += bb_k[type]*dr1*dr2;
diff --git a/src/CLASS2/angle_class2.h b/src/CLASS2/angle_class2.h
index 7db51c2e0b..7f862f628d 100644
--- a/src/CLASS2/angle_class2.h
+++ b/src/CLASS2/angle_class2.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/CLASS2/bond_class2.cpp b/src/CLASS2/bond_class2.cpp
index f18d687fe7..2234227abe 100644
--- a/src/CLASS2/bond_class2.cpp
+++ b/src/CLASS2/bond_class2.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -124,7 +124,7 @@ void BondClass2::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   set coeffs from one line in input script or data file 
+   set coeffs from one line in input script or data file
 ------------------------------------------------------------------------- */
 
 void BondClass2::coeff(int narg, char **arg)
@@ -154,7 +154,7 @@ void BondClass2::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   return an equilbrium bond length 
+   return an equilbrium bond length
 ------------------------------------------------------------------------- */
 
 double BondClass2::equilibrium_distance(int i)
@@ -163,7 +163,7 @@ double BondClass2::equilibrium_distance(int i)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void BondClass2::write_restart(FILE *fp)
@@ -175,7 +175,7 @@ void BondClass2::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void BondClass2::read_restart(FILE *fp)
diff --git a/src/CLASS2/bond_class2.h b/src/CLASS2/bond_class2.h
index 233117bbb8..52c2a06895 100644
--- a/src/CLASS2/bond_class2.h
+++ b/src/CLASS2/bond_class2.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/CLASS2/dihedral_class2.cpp b/src/CLASS2/dihedral_class2.cpp
index 07dd32442f..dcf204a37d 100644
--- a/src/CLASS2/dihedral_class2.cpp
+++ b/src/CLASS2/dihedral_class2.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -181,19 +181,19 @@ void DihedralClass2::compute(int eflag, int vflag)
     costh12 = (vb1x*vb2x + vb1y*vb2y + vb1z*vb2z) * r12c1;
     costh13 = c0;
     costh23 = (vb2xm*vb3x + vb2ym*vb3y + vb2zm*vb3z) * r12c2;
-          
+
     // cos and sin of 2 angles and final c
 
     sin2 = MAX(1.0 - costh12*costh12,0.0);
     sc1 = sqrt(sin2);
     if (sc1 < SMALL) sc1 = SMALL;
     sc1 = 1.0/sc1;
-          
+
     sin2 = MAX(1.0 - costh23*costh23,0.0);
     sc2 = sqrt(sin2);
     if (sc2 < SMALL) sc2 = SMALL;
     sc2 = 1.0/sc2;
-          
+
     s1 = sc1 * sc1;
     s2 = sc2 * sc2;
     s12 = sc1 * sc2;
@@ -205,19 +205,19 @@ void DihedralClass2::compute(int eflag, int vflag)
       int me;
       MPI_Comm_rank(world,&me);
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
-		me,update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+                me,update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
 
@@ -235,7 +235,7 @@ void DihedralClass2::compute(int eflag, int vflag)
     a12 = r12c1 * (costh12*c*s1 + costh23*s12);
     a13 = rb1*rb3*s12;
     a23 = r12c2 * (-costh23*c*s2 - costh12*s12);
-          
+
     sx1  = a11*vb1x + a12*vb2x + a13*vb3x;
     sx2  = a12*vb1x + a22*vb2x + a23*vb3x;
     sx12 = a13*vb1x + a23*vb2x + a33*vb3x;
@@ -263,18 +263,18 @@ void DihedralClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	dphidr[i][j] = -dcosphidr[i][j] / sinphi;
+        dphidr[i][j] = -dcosphidr[i][j] / sinphi;
 
     // energy
 
     dphi1 = phi - phi1[type];
     dphi2 = 2.0*phi - phi2[type];
     dphi3 = 3.0*phi - phi3[type];
-    
+
     if (eflag) edihedral = k1[type]*(1.0 - cos(dphi1)) +
-		 k2[type]*(1.0 - cos(dphi2)) +
-		 k3[type]*(1.0 - cos(dphi3));
-    
+                 k2[type]*(1.0 - cos(dphi2)) +
+                 k3[type]*(1.0 - cos(dphi3));
+
     de_dihedral = k1[type]*sin(dphi1) + 2.0*k2[type]*sin(dphi2) +
       3.0*k3[type]*sin(dphi3);
 
@@ -282,18 +282,18 @@ void DihedralClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] = de_dihedral*dphidr[i][j];
+        fabcd[i][j] = de_dihedral*dphidr[i][j];
 
     // set up d(bond)/d(r) array
     // dbonddr(i,j,k) = bond i, atom j, coordinate k
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++)
-	for (k = 0; k < 3; k++)
-	  dbonddr[i][j][k] = 0.0;
-    
+        for (k = 0; k < 3; k++)
+          dbonddr[i][j][k] = 0.0;
+
     // bond1
-    
+
     dbonddr[0][0][0] = vb1x / r1;
     dbonddr[0][0][1] = vb1y / r1;
     dbonddr[0][0][2] = vb1z / r1;
@@ -311,7 +311,7 @@ void DihedralClass2::compute(int eflag, int vflag)
     dbonddr[1][2][2] = -vb2z / r2;
 
     // bond3
-    
+
     dbonddr[2][2][0] = vb3x / r3;
     dbonddr[2][2][1] = vb3y / r3;
     dbonddr[2][2][2] = vb3z / r3;
@@ -324,71 +324,71 @@ void DihedralClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 2; i++)
       for (j = 0; j < 4; j++)
-	for (k = 0; k < 3; k++)
-	  dthetadr[i][j][k] = 0.0;
-    
+        for (k = 0; k < 3; k++)
+          dthetadr[i][j][k] = 0.0;
+
     t1 = costh12 / r1mag2;
     t2 = costh23 / r2mag2;
     t3 = costh12 / r2mag2;
     t4 = costh23 / r3mag2;
-    
+
     // angle12
-    
+
     dthetadr[0][0][0] = sc1 * ((t1 * vb1x) - (vb2x * r12c1));
     dthetadr[0][0][1] = sc1 * ((t1 * vb1y) - (vb2y * r12c1));
     dthetadr[0][0][2] = sc1 * ((t1 * vb1z) - (vb2z * r12c1));
-    
+
     dthetadr[0][1][0] = sc1 * ((-t1 * vb1x) + (vb2x * r12c1) +
-			       (-t3 * vb2x) + (vb1x * r12c1));
+                               (-t3 * vb2x) + (vb1x * r12c1));
     dthetadr[0][1][1] = sc1 * ((-t1 * vb1y) + (vb2y * r12c1) +
-			       (-t3 * vb2y) + (vb1y * r12c1));
+                               (-t3 * vb2y) + (vb1y * r12c1));
     dthetadr[0][1][2] = sc1 * ((-t1 * vb1z) + (vb2z * r12c1) +
-			       (-t3 * vb2z) + (vb1z * r12c1));
-    
-    dthetadr[0][2][0] = sc1 * ((t3 * vb2x) - (vb1x * r12c1)); 
+                               (-t3 * vb2z) + (vb1z * r12c1));
+
+    dthetadr[0][2][0] = sc1 * ((t3 * vb2x) - (vb1x * r12c1));
     dthetadr[0][2][1] = sc1 * ((t3 * vb2y) - (vb1y * r12c1));
     dthetadr[0][2][2] = sc1 * ((t3 * vb2z) - (vb1z * r12c1));
-    
+
     // angle23
-    
+
     dthetadr[1][1][0] = sc2 * ((t2 * vb2x) + (vb3x * r12c2));
     dthetadr[1][1][1] = sc2 * ((t2 * vb2y) + (vb3y * r12c2));
     dthetadr[1][1][2] = sc2 * ((t2 * vb2z) + (vb3z * r12c2));
-    
+
     dthetadr[1][2][0] = sc2 * ((-t2 * vb2x) - (vb3x * r12c2) +
-			       (t4 * vb3x) + (vb2x * r12c2));
+                               (t4 * vb3x) + (vb2x * r12c2));
     dthetadr[1][2][1] = sc2 * ((-t2 * vb2y) - (vb3y * r12c2) +
-			       (t4 * vb3y) + (vb2y * r12c2));
+                               (t4 * vb3y) + (vb2y * r12c2));
     dthetadr[1][2][2] = sc2 * ((-t2 * vb2z) - (vb3z * r12c2) +
-			       (t4 * vb3z) + (vb2z * r12c2));
-    
+                               (t4 * vb3z) + (vb2z * r12c2));
+
     dthetadr[1][3][0] = -sc2 * ((t4 * vb3x) + (vb2x * r12c2));
     dthetadr[1][3][1] = -sc2 * ((t4 * vb3y) + (vb2y * r12c2));
     dthetadr[1][3][2] = -sc2 * ((t4 * vb3z) + (vb2z * r12c2));
-    
+
     // mid-bond/torsion coupling
     // energy on bond2 (middle bond)
-    
+
     cos2phi = cos(2.0*phi);
     cos3phi = cos(3.0*phi);
-    
+
     bt1 = mbt_f1[type] * cosphi;
     bt2 = mbt_f2[type] * cos2phi;
     bt3 = mbt_f3[type] * cos3phi;
     sumbte = bt1 + bt2 + bt3;
     db = r2 - mbt_r0[type];
     if (eflag) edihedral += db * sumbte;
-    
+
     // force on bond2
-    
+
     bt1 = -mbt_f1[type] * sinphi;
     bt2 = -2.0 * mbt_f2[type] * sin(2.0*phi);
     bt3 = -3.0 * mbt_f3[type] * sin(3.0*phi);
     sumbtf = bt1 + bt2 + bt3;
-    
+
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*dbonddr[1][i][j];
+        fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*dbonddr[1][i][j];
 
     // end-bond/torsion coupling
     // energy on bond1 (first bond)
@@ -410,7 +410,7 @@ void DihedralClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] -= db*sumbtf*dphidr[i][j] + sumbte*dbonddr[0][i][j];
+        fabcd[i][j] -= db*sumbtf*dphidr[i][j] + sumbte*dbonddr[0][i][j];
 
     // end-bond/torsion coupling
     // energy on bond3 (last bond)
@@ -432,7 +432,7 @@ void DihedralClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*dbonddr[2][i][j];
+        fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*dbonddr[2][i][j];
 
     // angle/torsion coupling
     // energy on angle1
@@ -454,7 +454,7 @@ void DihedralClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] -= da*sumbtf*dphidr[i][j] + sumbte*dthetadr[0][i][j];
+        fabcd[i][j] -= da*sumbtf*dphidr[i][j] + sumbte*dthetadr[0][i][j];
 
     // energy on angle2
 
@@ -475,20 +475,20 @@ void DihedralClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] += da*sumbtf*dphidr[i][j] + sumbte*dthetadr[1][i][j];
+        fabcd[i][j] += da*sumbtf*dphidr[i][j] + sumbte*dthetadr[1][i][j];
 
     // angle/angle/torsion coupling
 
     da1 = acos(costh12) - aat_theta0_1[type];
     da2 = acos(costh23) - aat_theta0_2[type];
-          
+
     if (eflag) edihedral += aat_k[type]*da1*da2*cosphi;
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] -= aat_k[type] * 
-	  (cosphi * (da2*dthetadr[0][i][j] - da1*dthetadr[1][i][j]) +
-	   sinphi * da1*da2*dphidr[i][j]);
+        fabcd[i][j] -= aat_k[type] *
+          (cosphi * (da2*dthetadr[0][i][j] - da1*dthetadr[1][i][j]) +
+           sinphi * da1*da2*dphidr[i][j]);
 
     // bond1/bond3 coupling
 
@@ -502,7 +502,7 @@ void DihedralClass2::compute(int eflag, int vflag)
       tk2 = -bb13t_k[type] * dr2 / r1;
 
       if (eflag) edihedral += bb13t_k[type]*dr1*dr2;
-        
+
       fabcd[0][0] += tk2 * vb1x;
       fabcd[0][1] += tk2 * vb1y;
       fabcd[0][2] += tk2 * vb1z;
@@ -510,7 +510,7 @@ void DihedralClass2::compute(int eflag, int vflag)
       fabcd[1][0] -= tk2 * vb1x;
       fabcd[1][1] -= tk2 * vb1y;
       fabcd[1][2] -= tk2 * vb1z;
-        
+
       fabcd[2][0] -= tk1 * vb3x;
       fabcd[2][1] -= tk1 * vb3y;
       fabcd[2][2] -= tk1 * vb3z;
@@ -548,8 +548,8 @@ void DihedralClass2::compute(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,
-	       fabcd[0],fabcd[2],fabcd[3],
-	       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+               fabcd[0],fabcd[2],fabcd[3],
+               vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
   }
 }
 
@@ -608,7 +608,7 @@ void DihedralClass2::allocate()
   memory->create(setflag_aat,n+1,"dihedral:setflag_aat");
   memory->create(setflag_bb13t,n+1,"dihedral:setflag_bb13t");
   for (int i = 1; i <= n; i++)
-    setflag[i] = setflag_d[i] = setflag_mbt[i] = setflag_ebt[i] = 
+    setflag[i] = setflag_d[i] = setflag_mbt[i] = setflag_ebt[i] =
       setflag_at[i] = setflag_aat[i] = setflag_bb13t[i] = 0;
 }
 
@@ -639,7 +639,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     double f2_one = force->numeric(arg[3]);
     double f3_one = force->numeric(arg[4]);
     double r0_one = force->numeric(arg[5]);
-    
+
     for (int i = ilo; i <= ihi; i++) {
       mbt_f1[i] = f1_one;
       mbt_f2[i] = f2_one;
@@ -660,7 +660,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     double f3_2_one = force->numeric(arg[7]);
     double r0_1_one = force->numeric(arg[8]);
     double r0_2_one = force->numeric(arg[9]);
-    
+
     for (int i = ilo; i <= ihi; i++) {
       ebt_f1_1[i] = f1_1_one;
       ebt_f2_1[i] = f2_1_one;
@@ -687,7 +687,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     double theta0_2_one = force->numeric(arg[9]);
 
     // convert theta0's from degrees to radians
-    
+
     for (int i = ilo; i <= ihi; i++) {
       at_f1_1[i] = f1_1_one;
       at_f2_1[i] = f2_1_one;
@@ -709,7 +709,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     double theta0_2_one = force->numeric(arg[4]);
 
     // convert theta0's from degrees to radians
-    
+
     for (int i = ilo; i <= ihi; i++) {
       aat_k[i] = k_one;
       aat_theta0_1[i] = theta0_1_one/180.0 * MY_PI;
@@ -724,7 +724,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     double k_one = force->numeric(arg[2]);
     double r10_one = force->numeric(arg[3]);
     double r30_one = force->numeric(arg[4]);
-    
+
     for (int i = ilo; i <= ihi; i++) {
       bb13t_k[i] = k_one;
       bb13t_r10[i] = r10_one;
@@ -742,7 +742,7 @@ void DihedralClass2::coeff(int narg, char **arg)
     double phi2_one = force->numeric(arg[4]);
     double k3_one = force->numeric(arg[5]);
     double phi3_one = force->numeric(arg[6]);
-    
+
     // convert phi's from degrees to radians
 
     for (int i = ilo; i <= ihi; i++) {
@@ -761,12 +761,12 @@ void DihedralClass2::coeff(int narg, char **arg)
 
   for (int i = ilo; i <= ihi; i++)
     if (setflag_d[i] == 1 && setflag_mbt[i] == 1 && setflag_ebt[i] == 1 &&
-	setflag_at[i] == 1 && setflag_aat[i] == 1 && setflag_bb13t[i] == 1)
+        setflag_at[i] == 1 && setflag_aat[i] == 1 && setflag_bb13t[i] == 1)
       setflag[i] = 1;
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void DihedralClass2::write_restart(FILE *fp)
@@ -813,7 +813,7 @@ void DihedralClass2::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void DihedralClass2::read_restart(FILE *fp)
diff --git a/src/CLASS2/dihedral_class2.h b/src/CLASS2/dihedral_class2.h
index 66173efaea..c84ab1d5e9 100644
--- a/src/CLASS2/dihedral_class2.h
+++ b/src/CLASS2/dihedral_class2.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp
index 8a77a16d54..5c05493840 100644
--- a/src/CLASS2/improper_class2.cpp
+++ b/src/CLASS2/improper_class2.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -91,10 +91,10 @@ void ImproperClass2::compute(int eflag, int vflag)
   for (i = 0; i < 3; i++)
     for (j = 0; j < 4; j++)
       for (k = 0; k < 3; k++) {
-	dthetadr[i][j][k] = 0.0;
-	drAB[i][j][k] = 0.0;
-	drCB[i][j][k] = 0.0;
-	drDB[i][j][k] = 0.0;
+        dthetadr[i][j][k] = 0.0;
+        drAB[i][j][k] = 0.0;
+        drCB[i][j][k] = 0.0;
+        drDB[i][j][k] = 0.0;
       }
 
   double **x = atom->x;
@@ -133,43 +133,43 @@ void ImproperClass2::compute(int eflag, int vflag)
     // bond lengths and associated values
 
     for (i = 0; i < 3; i++) {
-      rmag2[i] = delr[i][0]*delr[i][0] + delr[i][1]*delr[i][1] + 
-	delr[i][2]*delr[i][2];
+      rmag2[i] = delr[i][0]*delr[i][0] + delr[i][1]*delr[i][1] +
+        delr[i][2]*delr[i][2];
       rmag[i] = sqrt(rmag2[i]);
       rinvmag[i] = 1.0/rmag[i];
     }
 
     // angle ABC, CBD, ABD
 
-    costheta[0] = (delr[0][0]*delr[1][0] + delr[0][1]*delr[1][1] +  
-		   delr[0][2]*delr[1][2]) / (rmag[0]*rmag[1]);
-    costheta[1] = (delr[1][0]*delr[2][0] + delr[1][1]*delr[2][1] + 
-		   delr[1][2]*delr[2][2]) / (rmag[1]*rmag[2]);
-    costheta[2] = (delr[0][0]*delr[2][0] + delr[0][1]*delr[2][1] + 
-		   delr[0][2]*delr[2][2]) / (rmag[0]*rmag[2]);
+    costheta[0] = (delr[0][0]*delr[1][0] + delr[0][1]*delr[1][1] +
+                   delr[0][2]*delr[1][2]) / (rmag[0]*rmag[1]);
+    costheta[1] = (delr[1][0]*delr[2][0] + delr[1][1]*delr[2][1] +
+                   delr[1][2]*delr[2][2]) / (rmag[1]*rmag[2]);
+    costheta[2] = (delr[0][0]*delr[2][0] + delr[0][1]*delr[2][1] +
+                   delr[0][2]*delr[2][2]) / (rmag[0]*rmag[2]);
 
     // angle error check
 
     for (i = 0; i < 3; i++) {
       if (costheta[i] == -1.0) {
-	int me;
-	MPI_Comm_rank(world,&me);
-	if (screen) {
-	  char str[128];
-	  sprintf(str,
-		  "Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
-		  me,update->ntimestep,
-		  atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	  error->warning(FLERR,str,0);
-	  fprintf(screen,"  1st atom: %d %g %g %g\n",
-		  me,x[i1][0],x[i1][1],x[i1][2]);
-	  fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		  me,x[i2][0],x[i2][1],x[i2][2]);
-	  fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		  me,x[i3][0],x[i3][1],x[i3][2]);
-	  fprintf(screen,"  4th atom: %d %g %g %g\n",
-		  me,x[i4][0],x[i4][1],x[i4][2]);
-	}
+        int me;
+        MPI_Comm_rank(world,&me);
+        if (screen) {
+          char str[128];
+          sprintf(str,
+                  "Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
+                  me,update->ntimestep,
+                  atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+          error->warning(FLERR,str,0);
+          fprintf(screen,"  1st atom: %d %g %g %g\n",
+                  me,x[i1][0],x[i1][1],x[i1][2]);
+          fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                  me,x[i2][0],x[i2][1],x[i2][2]);
+          fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                  me,x[i3][0],x[i3][1],x[i3][2]);
+          fprintf(screen,"  4th atom: %d %g %g %g\n",
+                  me,x[i4][0],x[i4][1],x[i4][2]);
+        }
       }
     }
 
@@ -223,7 +223,7 @@ void ImproperClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++)
-	ddelr[i][j] = 0.0;
+        ddelr[i][j] = 0.0;
 
     ddelr[0][0] = 1.0;
     ddelr[0][1] = -1.0;
@@ -238,19 +238,19 @@ void ImproperClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++)
-	for (k = 0; k < 3; k++) {
-	  dr[i][j][k] = delr[i][k] * ddelr[i][j] / rmag[i];
-	  dinvr[i][j][k] = -dr[i][j][k] / rmag2[i];
-	}
+        for (k = 0; k < 3; k++) {
+          dr[i][j][k] = delr[i][k] * ddelr[i][j] / rmag[i];
+          dinvr[i][j][k] = -dr[i][j][k] / rmag2[i];
+        }
 
     // compute d(1 / (|r_AB| * |r_CB| * |r_DB|) / dr
     // i = atom A/B/C/D, j = X/Y/Z
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	dinv3r[i][j] = rinvmag[1] * (rinvmag[2] * dinvr[0][i][j] +
-				     rinvmag[0] * dinvr[2][i][j]) +
-	  rinvmag[2] * rinvmag[0] * dinvr[1][i][j];
+        dinv3r[i][j] = rinvmag[1] * (rinvmag[2] * dinvr[0][i][j] +
+                                     rinvmag[0] * dinvr[2][i][j]) +
+          rinvmag[2] * rinvmag[0] * dinvr[1][i][j];
 
     // compute d(theta)/d(r) for 3 angles
     // angleABC
@@ -259,30 +259,30 @@ void ImproperClass2::compute(int eflag, int vflag)
     tt3 = costheta[0] / rmag2[1];
     sc1 = 1.0 / sqrt(1.0 - cossqtheta[0]);
 
-    dthetadr[0][0][0] = sc1 * ((tt1 * delr[0][0]) - 
-			       (delr[1][0] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][0][1] = sc1 * ((tt1 * delr[0][1]) - 
-			       (delr[1][1] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][0][2] = sc1 * ((tt1 * delr[0][2]) - 
-			       (delr[1][2] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][1][0] = -sc1 * ((tt1 * delr[0][0]) - 
-				(delr[1][0] * rinvmag[0] * rinvmag[1]) +
-				(tt3 * delr[1][0]) - 
-				(delr[0][0] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][1][1] = -sc1 * ((tt1 * delr[0][1]) - 
-				(delr[1][1] * rinvmag[0] * rinvmag[1]) +
-				(tt3 * delr[1][1]) - 
-				(delr[0][1] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][1][2] = -sc1 * ((tt1 * delr[0][2]) - 
-				(delr[1][2] * rinvmag[0] * rinvmag[1]) +
-				(tt3 * delr[1][2]) - 
-				(delr[0][2] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][2][0] = sc1 * ((tt3 * delr[1][0]) - 
-			       (delr[0][0] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][2][1] = sc1 * ((tt3 * delr[1][1]) - 
-			       (delr[0][1] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][2][2] = sc1 * ((tt3 * delr[1][2]) - 
-			       (delr[0][2] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][0][0] = sc1 * ((tt1 * delr[0][0]) -
+                               (delr[1][0] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][0][1] = sc1 * ((tt1 * delr[0][1]) -
+                               (delr[1][1] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][0][2] = sc1 * ((tt1 * delr[0][2]) -
+                               (delr[1][2] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][1][0] = -sc1 * ((tt1 * delr[0][0]) -
+                                (delr[1][0] * rinvmag[0] * rinvmag[1]) +
+                                (tt3 * delr[1][0]) -
+                                (delr[0][0] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][1][1] = -sc1 * ((tt1 * delr[0][1]) -
+                                (delr[1][1] * rinvmag[0] * rinvmag[1]) +
+                                (tt3 * delr[1][1]) -
+                                (delr[0][1] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][1][2] = -sc1 * ((tt1 * delr[0][2]) -
+                                (delr[1][2] * rinvmag[0] * rinvmag[1]) +
+                                (tt3 * delr[1][2]) -
+                                (delr[0][2] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][2][0] = sc1 * ((tt3 * delr[1][0]) -
+                               (delr[0][0] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][2][1] = sc1 * ((tt3 * delr[1][1]) -
+                               (delr[0][1] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][2][2] = sc1 * ((tt3 * delr[1][2]) -
+                               (delr[0][2] * rinvmag[0] * rinvmag[1]));
 
     // angleCBD
 
@@ -290,30 +290,30 @@ void ImproperClass2::compute(int eflag, int vflag)
     tt3 = costheta[1] / rmag2[2];
     sc1 = 1.0 / sqrt(1.0 - cossqtheta[1]);
 
-    dthetadr[1][2][0] = sc1 * ((tt1 * delr[1][0]) - 
-			       (delr[2][0] * rinvmag[1] * rinvmag[2]));
-    dthetadr[1][2][1] = sc1 * ((tt1 * delr[1][1]) - 
-			       (delr[2][1] * rinvmag[1] * rinvmag[2]));
-    dthetadr[1][2][2] = sc1 * ((tt1 * delr[1][2]) - 
-			       (delr[2][2] * rinvmag[1] * rinvmag[2]));
-    dthetadr[1][1][0] = -sc1 * ((tt1 * delr[1][0]) - 
-				(delr[2][0] * rinvmag[1] * rinvmag[2]) +
-				(tt3 * delr[2][0]) - 
-				(delr[1][0] * rinvmag[2] * rinvmag[1]));
-    dthetadr[1][1][1] = -sc1 * ((tt1 * delr[1][1]) - 
-				(delr[2][1] * rinvmag[1] * rinvmag[2]) +
-				(tt3 * delr[2][1]) - 
-				(delr[1][1] * rinvmag[2] * rinvmag[1]));
-    dthetadr[1][1][2] = -sc1 * ((tt1 * delr[1][2]) - 
-				(delr[2][2] * rinvmag[1] * rinvmag[2]) +
-				(tt3 * delr[2][2]) - 
-				(delr[1][2] * rinvmag[2] * rinvmag[1]));
-    dthetadr[1][3][0] = sc1 * ((tt3 * delr[2][0]) - 
-			       (delr[1][0] * rinvmag[2] * rinvmag[1]));
-    dthetadr[1][3][1] = sc1 * ((tt3 * delr[2][1]) - 
-			       (delr[1][1] * rinvmag[2] * rinvmag[1]));
-    dthetadr[1][3][2] = sc1 * ((tt3 * delr[2][2]) - 
-			       (delr[1][2] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][2][0] = sc1 * ((tt1 * delr[1][0]) -
+                               (delr[2][0] * rinvmag[1] * rinvmag[2]));
+    dthetadr[1][2][1] = sc1 * ((tt1 * delr[1][1]) -
+                               (delr[2][1] * rinvmag[1] * rinvmag[2]));
+    dthetadr[1][2][2] = sc1 * ((tt1 * delr[1][2]) -
+                               (delr[2][2] * rinvmag[1] * rinvmag[2]));
+    dthetadr[1][1][0] = -sc1 * ((tt1 * delr[1][0]) -
+                                (delr[2][0] * rinvmag[1] * rinvmag[2]) +
+                                (tt3 * delr[2][0]) -
+                                (delr[1][0] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][1][1] = -sc1 * ((tt1 * delr[1][1]) -
+                                (delr[2][1] * rinvmag[1] * rinvmag[2]) +
+                                (tt3 * delr[2][1]) -
+                                (delr[1][1] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][1][2] = -sc1 * ((tt1 * delr[1][2]) -
+                                (delr[2][2] * rinvmag[1] * rinvmag[2]) +
+                                (tt3 * delr[2][2]) -
+                                (delr[1][2] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][3][0] = sc1 * ((tt3 * delr[2][0]) -
+                               (delr[1][0] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][3][1] = sc1 * ((tt3 * delr[2][1]) -
+                               (delr[1][1] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][3][2] = sc1 * ((tt3 * delr[2][2]) -
+                               (delr[1][2] * rinvmag[2] * rinvmag[1]));
 
     // angleABD
 
@@ -321,30 +321,30 @@ void ImproperClass2::compute(int eflag, int vflag)
     tt3 = costheta[2] / rmag2[2];
     sc1 = 1.0 / sqrt(1.0 - cossqtheta[2]);
 
-    dthetadr[2][0][0] = sc1 * ((tt1 * delr[0][0]) - 
-			       (delr[2][0] * rinvmag[0] * rinvmag[2]));
-    dthetadr[2][0][1] = sc1 * ((tt1 * delr[0][1]) - 
-			       (delr[2][1] * rinvmag[0] * rinvmag[2]));
-    dthetadr[2][0][2] = sc1 * ((tt1 * delr[0][2]) - 
-			       (delr[2][2] * rinvmag[0] * rinvmag[2]));
-    dthetadr[2][1][0] = -sc1 * ((tt1 * delr[0][0]) - 
-				(delr[2][0] * rinvmag[0] * rinvmag[2]) +
-				(tt3 * delr[2][0]) - 
-				(delr[0][0] * rinvmag[2] * rinvmag[0]));
-    dthetadr[2][1][1] = -sc1 * ((tt1 * delr[0][1]) - 
-				(delr[2][1] * rinvmag[0] * rinvmag[2]) +
-				(tt3 * delr[2][1]) - 
-				(delr[0][1] * rinvmag[2] * rinvmag[0]));
-    dthetadr[2][1][2] = -sc1 * ((tt1 * delr[0][2]) - 
-				(delr[2][2] * rinvmag[0] * rinvmag[2]) +
-				(tt3 * delr[2][2]) - 
-				(delr[0][2] * rinvmag[2] * rinvmag[0]));
-    dthetadr[2][3][0] = sc1 * ((tt3 * delr[2][0]) - 
-			       (delr[0][0] * rinvmag[2] * rinvmag[0]));
-    dthetadr[2][3][1] = sc1 * ((tt3 * delr[2][1]) - 
-			       (delr[0][1] * rinvmag[2] * rinvmag[0]));
-    dthetadr[2][3][2] = sc1 * ((tt3 * delr[2][2]) - 
-			       (delr[0][2] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][0][0] = sc1 * ((tt1 * delr[0][0]) -
+                               (delr[2][0] * rinvmag[0] * rinvmag[2]));
+    dthetadr[2][0][1] = sc1 * ((tt1 * delr[0][1]) -
+                               (delr[2][1] * rinvmag[0] * rinvmag[2]));
+    dthetadr[2][0][2] = sc1 * ((tt1 * delr[0][2]) -
+                               (delr[2][2] * rinvmag[0] * rinvmag[2]));
+    dthetadr[2][1][0] = -sc1 * ((tt1 * delr[0][0]) -
+                                (delr[2][0] * rinvmag[0] * rinvmag[2]) +
+                                (tt3 * delr[2][0]) -
+                                (delr[0][0] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][1][1] = -sc1 * ((tt1 * delr[0][1]) -
+                                (delr[2][1] * rinvmag[0] * rinvmag[2]) +
+                                (tt3 * delr[2][1]) -
+                                (delr[0][1] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][1][2] = -sc1 * ((tt1 * delr[0][2]) -
+                                (delr[2][2] * rinvmag[0] * rinvmag[2]) +
+                                (tt3 * delr[2][2]) -
+                                (delr[0][2] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][3][0] = sc1 * ((tt3 * delr[2][0]) -
+                               (delr[0][0] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][3][1] = sc1 * ((tt3 * delr[2][1]) -
+                               (delr[0][1] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][3][2] = sc1 * ((tt3 * delr[2][2]) -
+                               (delr[0][2] * rinvmag[2] * rinvmag[0]));
 
     // compute d( 1 / sin(theta))/dr
     // i = angle, j = atom, k = direction
@@ -352,8 +352,8 @@ void ImproperClass2::compute(int eflag, int vflag)
     for (i = 0; i < 3; i++) {
       cossin2 = -costheta[i] / sinsqtheta[i];
       for (j = 0; j < 4; j++)
-	for (k = 0; k < 3; k++)
-	  dinvsth[i][j][k] = cossin2 * dthetadr[i][j][k];
+        for (k = 0; k < 3; k++)
+          dinvsth[i][j][k] = cossin2 * dthetadr[i][j][k];
     }
 
     // compute d(1 / sin(theta) * |r_AB| * |r_CB| * |r_DB|)/dr
@@ -361,12 +361,12 @@ void ImproperClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++) {
-	dinvs3r[0][i][j] = (invstheta[1] * dinv3r[i][j]) +
-	  (inv3r * dinvsth[1][i][j]);
-	dinvs3r[1][i][j] = (invstheta[2] * dinv3r[i][j]) +
-	  (inv3r * dinvsth[2][i][j]);
-	dinvs3r[2][i][j] = (invstheta[0] * dinv3r[i][j]) +
-	  (inv3r * dinvsth[0][i][j]);
+        dinvs3r[0][i][j] = (invstheta[1] * dinv3r[i][j]) +
+          (inv3r * dinvsth[1][i][j]);
+        dinvs3r[1][i][j] = (invstheta[2] * dinv3r[i][j]) +
+          (inv3r * dinvsth[2][i][j]);
+        dinvs3r[2][i][j] = (invstheta[0] * dinv3r[i][j]) +
+          (inv3r * dinvsth[0][i][j]);
       }
 
     // drCB(i,j,k), etc
@@ -390,12 +390,12 @@ void ImproperClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++) {
-	cross(delr[1],drDB[i][j],rCBxdrDB);
-	cross(drCB[i][j],delr[2],drCBxrDB);
-	for (k = 0; k < 3; k++) dd[k] = rCBxdrDB[k] + drCBxrDB[k];
-	dot1 = dot(dd,delr[0]);
-	dot2 = dot(rCBxrDB,drAB[i][j]);
-	fdot[0][j][i] = dot1 + dot2;
+        cross(delr[1],drDB[i][j],rCBxdrDB);
+        cross(drCB[i][j],delr[2],drCBxrDB);
+        for (k = 0; k < 3; k++) dd[k] = rCBxdrDB[k] + drCBxrDB[k];
+        dot1 = dot(dd,delr[0]);
+        dot2 = dot(rCBxrDB,drAB[i][j]);
+        fdot[0][j][i] = dot1 + dot2;
       }
 
     // d((r_DB x r_AB) dot r_CB)
@@ -407,12 +407,12 @@ void ImproperClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++) {
-	cross(delr[2],drAB[i][j],rDBxdrAB);
-	cross(drDB[i][j],delr[0],drDBxrAB);
-	for (k = 0; k < 3; k++) dd[k] = rDBxdrAB[k] + drDBxrAB[k];
-	dot1 = dot(dd,delr[1]);
-	dot2 = dot(rDBxrAB,drCB[i][j]);
-	fdot[1][j][i] = dot1 + dot2;
+        cross(delr[2],drAB[i][j],rDBxdrAB);
+        cross(drDB[i][j],delr[0],drDBxrAB);
+        for (k = 0; k < 3; k++) dd[k] = rDBxdrAB[k] + drDBxrAB[k];
+        dot1 = dot(dd,delr[1]);
+        dot2 = dot(rDBxrAB,drCB[i][j]);
+        fdot[1][j][i] = dot1 + dot2;
       }
 
     // d((r_AB x r_CB) dot r_DB)
@@ -424,33 +424,33 @@ void ImproperClass2::compute(int eflag, int vflag)
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++) {
-	cross(delr[0],drCB[i][j],rABxdrCB);
-	cross(drAB[i][j],delr[1],drABxrCB);
-	for (k = 0; k < 3; k++) dd[k] = rABxdrCB[k] + drABxrCB[k];
-	dot1 = dot(dd,delr[2]);
-	dot2 = dot(rABxrCB,drDB[i][j]);
-	fdot[2][j][i] = dot1 + dot2;
+        cross(delr[0],drCB[i][j],rABxdrCB);
+        cross(drAB[i][j],delr[1],drABxrCB);
+        for (k = 0; k < 3; k++) dd[k] = rABxdrCB[k] + drABxrCB[k];
+        dot1 = dot(dd,delr[2]);
+        dot2 = dot(rABxrCB,drDB[i][j]);
+        fdot[2][j][i] = dot1 + dot2;
       }
 
     // force on each atom
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++) {
-	ftmp = (fdot[0][i][j] * invs3r[0]) + 
-	  (dinvs3r[0][i][j] * dotCBDBAB);
-	dchi[0][i][j] = ftmp / cos(chiABCD);
-	ftmp = (fdot[1][i][j] * invs3r[1]) + 
-	  (dinvs3r[1][i][j] * dotDBABCB);
-	dchi[1][i][j] = ftmp / cos(chiCBDA);
-	ftmp = (fdot[2][i][j] * invs3r[2]) + 
-	  (dinvs3r[2][i][j] * dotABCBDB);
-	dchi[2][i][j] = ftmp / cos(chiDBAC);
-	dtotalchi[i][j] = (dchi[0][i][j]+dchi[1][i][j]+dchi[2][i][j]) / 3.0;
+        ftmp = (fdot[0][i][j] * invs3r[0]) +
+          (dinvs3r[0][i][j] * dotCBDBAB);
+        dchi[0][i][j] = ftmp / cos(chiABCD);
+        ftmp = (fdot[1][i][j] * invs3r[1]) +
+          (dinvs3r[1][i][j] * dotDBABCB);
+        dchi[1][i][j] = ftmp / cos(chiCBDA);
+        ftmp = (fdot[2][i][j] * invs3r[2]) +
+          (dinvs3r[2][i][j] * dotABCBDB);
+        dchi[2][i][j] = ftmp / cos(chiDBAC);
+        dtotalchi[i][j] = (dchi[0][i][j]+dchi[1][i][j]+dchi[2][i][j]) / 3.0;
       }
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] = -2.0*k0[type] * deltachi*dtotalchi[i][j];
+        fabcd[i][j] = -2.0*k0[type] * deltachi*dtotalchi[i][j];
 
     // apply force to each of 4 atoms
 
@@ -480,11 +480,11 @@ void ImproperClass2::compute(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,eimproper,
-	       fabcd[0],fabcd[2],fabcd[3],
-	       delr[0][0],delr[0][1],delr[0][2],
-	       delr[1][0],delr[1][1],delr[1][2],
-	       delr[2][0]-delr[1][0],delr[2][1]-delr[1][1],
-	       delr[2][2]-delr[1][2]);
+               fabcd[0],fabcd[2],fabcd[3],
+               delr[0][0],delr[0][1],delr[0][2],
+               delr[1][0],delr[1][1],delr[1][2],
+               delr[2][0]-delr[1][0],delr[2][1]-delr[1][1],
+               delr[2][2]-delr[1][2]);
   }
 
   // compute angle-angle interactions
@@ -541,7 +541,7 @@ void ImproperClass2::coeff(int narg, char **arg)
     double theta0_1_one = force->numeric(arg[5]);
     double theta0_2_one = force->numeric(arg[6]);
     double theta0_3_one = force->numeric(arg[7]);
-    
+
     // convert theta0's from degrees to radians
 
     for (int i = ilo; i <= ihi; i++) {
@@ -578,7 +578,7 @@ void ImproperClass2::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void ImproperClass2::write_restart(FILE *fp)
@@ -595,7 +595,7 @@ void ImproperClass2::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void ImproperClass2::read_restart(FILE *fp)
@@ -681,7 +681,7 @@ void ImproperClass2::angleangle(int eflag, int vflag)
     rBC = sqrt(rBCmag2);
     rBDmag2 = delxBD*delxBD + delyBD*delyBD + delzBD*delzBD;
     rBD = sqrt(rBDmag2);
-        
+
     // angle ABC, ABD, CBD
 
     costhABC = (delxAB*delxBC + delyAB*delyBC + delzAB*delzBC) / (rAB * rBC);
@@ -705,17 +705,17 @@ void ImproperClass2::angleangle(int eflag, int vflag)
 
     // energy
 
-    if (eflag) eimproper = aa_k2[type] * dthABC * dthABD + 
-		 aa_k1[type] * dthABC * dthCBD +
-		 aa_k3[type] * dthABD * dthCBD;
+    if (eflag) eimproper = aa_k2[type] * dthABC * dthABD +
+                 aa_k1[type] * dthABC * dthCBD +
+                 aa_k3[type] * dthABD * dthCBD;
 
     // d(theta)/d(r) array
     // angle i, atom j, coordinate k
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++)
-	for (k = 0; k < 3; k++)
-	  dthetadr[i][j][k] = 0.0;
+        for (k = 0; k < 3; k++)
+          dthetadr[i][j][k] = 0.0;
 
     // angle ABC
 
@@ -728,11 +728,11 @@ void ImproperClass2::angleangle(int eflag, int vflag)
     dthetadr[0][0][1] = sc1 * ((t1 * delyAB) - (delyBC * r12));
     dthetadr[0][0][2] = sc1 * ((t1 * delzAB) - (delzBC * r12));
     dthetadr[0][1][0] = sc1 * ((-t1 * delxAB) + (delxBC * r12) +
-			       (-t3 * delxBC) + (delxAB * r12));
+                               (-t3 * delxBC) + (delxAB * r12));
     dthetadr[0][1][1] = sc1 * ((-t1 * delyAB) + (delyBC * r12) +
-			       (-t3 * delyBC) + (delyAB * r12));
+                               (-t3 * delyBC) + (delyAB * r12));
     dthetadr[0][1][2] = sc1 * ((-t1 * delzAB) + (delzBC * r12) +
-			       (-t3 * delzBC) + (delzAB * r12));
+                               (-t3 * delzBC) + (delzAB * r12));
     dthetadr[0][2][0] = sc1 * ((t3 * delxBC) - (delxAB * r12));
     dthetadr[0][2][1] = sc1 * ((t3 * delyBC) - (delyAB * r12));
     dthetadr[0][2][2] = sc1 * ((t3 * delzBC) - (delzAB * r12));
@@ -748,11 +748,11 @@ void ImproperClass2::angleangle(int eflag, int vflag)
     dthetadr[1][2][1] = sc1 * ((t1 * delyBC) - (delyBD * r12));
     dthetadr[1][2][2] = sc1 * ((t1 * delzBC) - (delzBD * r12));
     dthetadr[1][1][0] = sc1 * ((-t1 * delxBC) + (delxBD * r12) +
-			       (-t3 * delxBD) + (delxBC * r12));
+                               (-t3 * delxBD) + (delxBC * r12));
     dthetadr[1][1][1] = sc1 * ((-t1 * delyBC) + (delyBD * r12) +
-			       (-t3 * delyBD) + (delyBC * r12));
+                               (-t3 * delyBD) + (delyBC * r12));
     dthetadr[1][1][2] = sc1 * ((-t1 * delzBC) + (delzBD * r12) +
-			       (-t3 * delzBD) + (delzBC * r12));
+                               (-t3 * delzBD) + (delzBC * r12));
     dthetadr[1][3][0] = sc1 * ((t3 * delxBD) - (delxBC * r12));
     dthetadr[1][3][1] = sc1 * ((t3 * delyBD) - (delyBC * r12));
     dthetadr[1][3][2] = sc1 * ((t3 * delzBD) - (delzBC * r12));
@@ -768,11 +768,11 @@ void ImproperClass2::angleangle(int eflag, int vflag)
     dthetadr[2][0][1] = sc1 * ((t1 * delyAB) - (delyBD * r12));
     dthetadr[2][0][2] = sc1 * ((t1 * delzAB) - (delzBD * r12));
     dthetadr[2][1][0] = sc1 * ((-t1 * delxAB) + (delxBD * r12) +
-			       (-t3 * delxBD) + (delxAB * r12));
+                               (-t3 * delxBD) + (delxAB * r12));
     dthetadr[2][1][1] = sc1 * ((-t1 * delyAB) + (delyBD * r12) +
-			       (-t3 * delyBD) + (delyAB * r12));
+                               (-t3 * delyBD) + (delyAB * r12));
     dthetadr[2][1][2] = sc1 * ((-t1 * delzAB) + (delzBD * r12) +
-			       (-t3 * delzBD) + (delzAB * r12));
+                               (-t3 * delzBD) + (delzAB * r12));
     dthetadr[2][3][0] = sc1 * ((t3 * delxBD) - (delxAB * r12));
     dthetadr[2][3][1] = sc1 * ((t3 * delyBD) - (delyAB * r12));
     dthetadr[2][3][2] = sc1 * ((t3 * delzBD) - (delzAB * r12));
@@ -781,13 +781,13 @@ void ImproperClass2::angleangle(int eflag, int vflag)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] = - 
-	  ((aa_k1[type] * 
-	    (dthABC*dthetadr[1][i][j] + dthCBD*dthetadr[0][i][j])) +
-	   (aa_k2[type] * 
-	    (dthABC*dthetadr[2][i][j] + dthABD*dthetadr[0][i][j])) +
-	   (aa_k3[type] *
-	    (dthABD*dthetadr[1][i][j] + dthCBD*dthetadr[2][i][j])));
+        fabcd[i][j] = -
+          ((aa_k1[type] *
+            (dthABC*dthetadr[1][i][j] + dthCBD*dthetadr[0][i][j])) +
+           (aa_k2[type] *
+            (dthABC*dthetadr[2][i][j] + dthABD*dthetadr[0][i][j])) +
+           (aa_k3[type] *
+            (dthABD*dthetadr[1][i][j] + dthCBD*dthetadr[2][i][j])));
 
     // apply force to each of 4 atoms
 
@@ -817,8 +817,8 @@ void ImproperClass2::angleangle(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,eimproper,
-	       fabcd[0],fabcd[2],fabcd[3],
-	       delxAB,delyAB,delzAB,delxBC,delyBC,delzBC,delxBD,delyBD,delzBD);
+               fabcd[0],fabcd[2],fabcd[3],
+               delxAB,delyAB,delzAB,delxBC,delyBC,delzBC,delxBD,delyBD,delzBD);
   }
 }
 
diff --git a/src/CLASS2/improper_class2.h b/src/CLASS2/improper_class2.h
index 1e47b407c4..b6e40aad3e 100644
--- a/src/CLASS2/improper_class2.h
+++ b/src/CLASS2/improper_class2.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp
index ee5d7d3e32..5c8b419b19 100644
--- a/src/CLASS2/pair_lj_class2.cpp
+++ b/src/CLASS2/pair_lj_class2.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -73,7 +73,7 @@ void PairLJClass2::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -97,30 +97,30 @@ void PairLJClass2::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	rinv = sqrt(r2inv);
-	r3inv = r2inv*rinv;
-	r6inv = r3inv*r3inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        rinv = sqrt(r2inv);
+        r3inv = r2inv*rinv;
+        r6inv = r3inv*r3inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -129,7 +129,7 @@ void PairLJClass2::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLJClass2::allocate()
@@ -155,7 +155,7 @@ void PairLJClass2::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLJClass2::settings(int narg, char **arg)
@@ -170,7 +170,7 @@ void PairLJClass2::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -218,9 +218,9 @@ double PairLJClass2::init_one(int i, int j)
 
   if (setflag[i][j] == 0) {
     epsilon[i][j] = 2.0 * sqrt(epsilon[i][i]*epsilon[j][j]) *
-      pow(sigma[i][i],3.0) * pow(sigma[j][j],3.0) / 
+      pow(sigma[i][i],3.0) * pow(sigma[j][j],3.0) /
       (pow(sigma[i][i],6.0) + pow(sigma[j][j],6.0));
-    sigma[i][j] = 
+    sigma[i][j] =
       pow((0.5 * (pow(sigma[i][i],6.0) + pow(sigma[j][j],6.0))),1.0/6.0);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
   }
@@ -255,22 +255,22 @@ double PairLJClass2::init_one(int i, int j)
       if (type[k] == j) count[1] += 1.0;
     }
     MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
-        
+
     double sig3 = sigma[i][j]*sigma[i][j]*sigma[i][j];
     double sig6 = sig3*sig3;
     double rc3 = cut[i][j]*cut[i][j]*cut[i][j];
     double rc6 = rc3*rc3;
     etail_ij = 2.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
       sig6 * (sig3 - 3.0*rc3) / (3.0*rc6);
-    ptail_ij = 2.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
+    ptail_ij = 2.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
       sig6 * (sig3 - 2.0*rc3) / rc6;
-  } 
+  }
 
   return cut[i][j];
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairLJClass2::write_restart(FILE *fp)
@@ -282,9 +282,9 @@ void PairLJClass2::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -305,14 +305,14 @@ void PairLJClass2::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -348,8 +348,8 @@ void PairLJClass2::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJClass2::single(int i, int j, int itype, int jtype, double rsq,
-			    double factor_coul, double factor_lj,
-			    double &fforce)
+                            double factor_coul, double factor_lj,
+                            double &fforce)
 {
   double r2inv,rinv,r3inv,r6inv,forcelj,philj;
 
diff --git a/src/CLASS2/pair_lj_class2.h b/src/CLASS2/pair_lj_class2.h
index 766f5787b9..674599d523 100644
--- a/src/CLASS2/pair_lj_class2.h
+++ b/src/CLASS2/pair_lj_class2.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp
index 9cd784ff58..5e5671c76f 100644
--- a/src/CLASS2/pair_lj_class2_coul_cut.cpp
+++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -81,7 +81,7 @@ void PairLJClass2CoulCut::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -107,43 +107,43 @@ void PairLJClass2CoulCut::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq[itype][jtype])
-	  forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
-	else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  rinv = sqrt(r2inv);
-	  r3inv = r2inv*rinv;
-	  r6inv = r3inv*r3inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	} else forcelj = 0.0;
-
-	fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq[itype][jtype])
-	    ecoul = factor_coul * qqrd2e * qtmp*q[j]*sqrt(r2inv);
-	  else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq[itype][jtype])
+          forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
+        else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          rinv = sqrt(r2inv);
+          r3inv = r2inv*rinv;
+          r6inv = r3inv*r3inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+        } else forcelj = 0.0;
+
+        fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq[itype][jtype])
+            ecoul = factor_coul * qqrd2e * qtmp*q[j]*sqrt(r2inv);
+          else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -152,7 +152,7 @@ void PairLJClass2CoulCut::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLJClass2CoulCut::allocate()
@@ -181,7 +181,7 @@ void PairLJClass2CoulCut::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLJClass2CoulCut::settings(int narg, char **arg)
@@ -198,10 +198,10 @@ void PairLJClass2CoulCut::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) {
-	  cut_lj[i][j] = cut_lj_global;
-	  cut_coul[i][j] = cut_coul_global;
-	}
+        if (setflag[i][j]) {
+          cut_lj[i][j] = cut_lj_global;
+          cut_coul[i][j] = cut_coul_global;
+        }
   }
 }
 
@@ -264,9 +264,9 @@ double PairLJClass2CoulCut::init_one(int i, int j)
 
   if (setflag[i][j] == 0) {
     epsilon[i][j] = 2.0 * sqrt(epsilon[i][i]*epsilon[j][j]) *
-      pow(sigma[i][i],3.0) * pow(sigma[j][j],3.0) / 
+      pow(sigma[i][i],3.0) * pow(sigma[j][j],3.0) /
       (pow(sigma[i][i],6.0) + pow(sigma[j][j],6.0));
-    sigma[i][j] = 
+    sigma[i][j] =
       pow((0.5 * (pow(sigma[i][i],6.0) + pow(sigma[j][j],6.0))),1.0/6.0);
     cut_lj[i][j] = mix_distance(cut_lj[i][i],cut_lj[j][j]);
     cut_coul[i][j] = mix_distance(cut_coul[i][i],cut_coul[j][j]);
@@ -308,22 +308,22 @@ double PairLJClass2CoulCut::init_one(int i, int j)
       if (type[k] == j) count[1] += 1.0;
     }
     MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
-        
+
     double sig3 = sigma[i][j]*sigma[i][j]*sigma[i][j];
     double sig6 = sig3*sig3;
     double rc3 = cut_lj[i][j]*cut_lj[i][j]*cut_lj[i][j];
     double rc6 = rc3*rc3;
     etail_ij = 2.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
       sig6 * (sig3 - 3.0*rc3) / (3.0*rc6);
-    ptail_ij = 2.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
+    ptail_ij = 2.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
       sig6 * (sig3 - 2.0*rc3) / rc6;
-  } 
+  }
 
   return cut;
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairLJClass2CoulCut::write_restart(FILE *fp)
@@ -335,10 +335,10 @@ void PairLJClass2CoulCut::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj[i][j],sizeof(double),1,fp);
-	fwrite(&cut_coul[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj[i][j],sizeof(double),1,fp);
+        fwrite(&cut_coul[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -359,16 +359,16 @@ void PairLJClass2CoulCut::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj[i][j],sizeof(double),1,fp);
-	  fread(&cut_coul[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_coul[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut_lj[i][j],sizeof(double),1,fp);
+          fread(&cut_coul[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_coul[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -406,9 +406,9 @@ void PairLJClass2CoulCut::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJClass2CoulCut::single(int i, int j, int itype, int jtype,
-				   double rsq,
-				   double factor_coul, double factor_lj,
-				   double &fforce)
+                                   double rsq,
+                                   double factor_coul, double factor_lj,
+                                   double &fforce)
 {
   double r2inv,rinv,r3inv,r6inv,forcecoul,forcelj,phicoul,philj;
 
diff --git a/src/CLASS2/pair_lj_class2_coul_cut.h b/src/CLASS2/pair_lj_class2_coul_cut.h
index 823bfe6c17..4f754406dc 100644
--- a/src/CLASS2/pair_lj_class2_coul_cut.h
+++ b/src/CLASS2/pair_lj_class2_coul_cut.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp
index 3dbf8e2ec3..76feaea620 100644
--- a/src/CLASS2/pair_lj_class2_coul_long.cpp
+++ b/src/CLASS2/pair_lj_class2_coul_long.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -90,7 +90,7 @@ void PairLJClass2CoulLong::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -116,51 +116,51 @@ void PairLJClass2CoulLong::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  r = sqrt(rsq);
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  rinv = sqrt(r2inv);
-	  r3inv = r2inv*rinv;
-	  r6inv = r3inv*r3inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = prefactor*erfc;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          r = sqrt(rsq);
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          rinv = sqrt(r2inv);
+          r3inv = r2inv*rinv;
+          r6inv = r3inv*r3inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            ecoul = prefactor*erfc;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -169,7 +169,7 @@ void PairLJClass2CoulLong::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLJClass2CoulLong::allocate()
@@ -196,7 +196,7 @@ void PairLJClass2CoulLong::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLJClass2CoulLong::settings(int narg, char **arg)
@@ -213,7 +213,7 @@ void PairLJClass2CoulLong::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
+        if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
   }
 }
 
@@ -265,7 +265,7 @@ void PairLJClass2CoulLong::init_style()
 
   // insure use of KSpace long-range solver, set g_ewald
 
- if (force->kspace == NULL) 
+ if (force->kspace == NULL)
     error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 }
@@ -281,9 +281,9 @@ double PairLJClass2CoulLong::init_one(int i, int j)
 
   if (setflag[i][j] == 0) {
     epsilon[i][j] = 2.0 * sqrt(epsilon[i][i]*epsilon[j][j]) *
-      pow(sigma[i][i],3.0) * pow(sigma[j][j],3.0) / 
+      pow(sigma[i][i],3.0) * pow(sigma[j][j],3.0) /
       (pow(sigma[i][i],6.0) + pow(sigma[j][j],6.0));
-    sigma[i][j] = 
+    sigma[i][j] =
       pow((0.5 * (pow(sigma[i][i],6.0) + pow(sigma[j][j],6.0))),1.0/6.0);
     cut_lj[i][j] = mix_distance(cut_lj[i][i],cut_lj[j][j]);
   }
@@ -322,22 +322,22 @@ double PairLJClass2CoulLong::init_one(int i, int j)
       if (type[k] == j) count[1] += 1.0;
     }
     MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
-        
+
     double sig3 = sigma[i][j]*sigma[i][j]*sigma[i][j];
     double sig6 = sig3*sig3;
     double rc3 = cut_lj[i][j]*cut_lj[i][j]*cut_lj[i][j];
     double rc6 = rc3*rc3;
     etail_ij = 2.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
       sig6 * (sig3 - 3.0*rc3) / (3.0*rc6);
-    ptail_ij = 2.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
+    ptail_ij = 2.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
       sig6 * (sig3 - 2.0*rc3) / rc6;
-  } 
+  }
 
   return cut;
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairLJClass2CoulLong::write_restart(FILE *fp)
@@ -349,9 +349,9 @@ void PairLJClass2CoulLong::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -372,14 +372,14 @@ void PairLJClass2CoulLong::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut_lj[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -417,9 +417,9 @@ void PairLJClass2CoulLong::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJClass2CoulLong::single(int i, int j, int itype, int jtype,
-				    double rsq,
-				    double factor_coul, double factor_lj,
-				    double &fforce)
+                                    double rsq,
+                                    double factor_coul, double factor_lj,
+                                    double &fforce)
 {
   double r2inv,r,rinv,r3inv,r6inv,grij,expm2,t,erfc,prefactor;
   double forcecoul,forcelj,phicoul,philj;
diff --git a/src/CLASS2/pair_lj_class2_coul_long.h b/src/CLASS2/pair_lj_class2_coul_long.h
index 0e5ebd6a1a..148633cd4a 100644
--- a/src/CLASS2/pair_lj_class2_coul_long.h
+++ b/src/CLASS2/pair_lj_class2_coul_long.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/COLLOID/fix_wall_colloid.cpp b/src/COLLOID/fix_wall_colloid.cpp
index 33717104c2..1ce2cbabd8 100644
--- a/src/COLLOID/fix_wall_colloid.cpp
+++ b/src/COLLOID/fix_wall_colloid.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -29,14 +29,14 @@ using namespace FixConst;
 
 /* ---------------------------------------------------------------------- */
 
-FixWallColloid::FixWallColloid(LAMMPS *lmp, int narg, char **arg) : 
+FixWallColloid::FixWallColloid(LAMMPS *lmp, int narg, char **arg) :
   FixWall(lmp, narg, arg) {}
 
 /* ---------------------------------------------------------------------- */
 
 void FixWallColloid::init()
 {
-  if (!atom->sphere_flag) 
+  if (!atom->sphere_flag)
     error->all(FLERR,"Fix wall/colloid requires atom style sphere");
 
   // insure all particles in group are extended particles
@@ -101,8 +101,8 @@ void FixWallColloid::wall_particle(int m, int which, double coord)
       if (delta >= cutoff[m]) continue;
       rad = radius[i];
       if (rad >= delta) {
-	onflag = 1;
-	continue;
+        onflag = 1;
+        continue;
       }
 
       new_coeff2 = coeff2[m]*rad*rad*rad;
@@ -116,9 +116,9 @@ void FixWallColloid::wall_particle(int m, int which, double coord)
       r4inv = r2inv*r2inv;
       r8inv = r4inv*r4inv;
       fwall = side * (coeff1[m]*(rad8*rad + 27.0*rad4*rad2*rad*pow(delta,2.0)
-				 + 63.0*rad4*rad*pow(delta,4.0)
-				 + 21.0*rad2*rad*pow(delta,6.0))*r8inv - 
-		      new_coeff2*r2inv);
+                                 + 63.0*rad4*rad*pow(delta,4.0)
+                                 + 21.0*rad2*rad*pow(delta,6.0))*r8inv -
+                      new_coeff2*r2inv);
       f[i][dim] -= fwall;
 
       r2 = rad - delta;
@@ -131,9 +131,9 @@ void FixWallColloid::wall_particle(int m, int which, double coord)
       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)))*
-		   (-rinv2)*rinv3);
+                             + (3.5*diam+delta)*r4inv3*r2inv3*rinv3) -
+        coeff4[m]*((diam*delta-r2*r3*(log(-r2)-log(r3)))*
+                   (-rinv2)*rinv3);
 
       // offset depends on particle size
 
@@ -147,9 +147,9 @@ void FixWallColloid::wall_particle(int m, int which, double coord)
       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)))*
-		   (-rinv2)*rinv3);
+                           + (3.5*diam+cutoff[m])*r4inv3*r2inv3*rinv3) -
+        coeff4[m]*((diam*cutoff[m]-r2*r3*(log(-r2)-log(r3)))*
+                   (-rinv2)*rinv3);
       ewall[0] -= eoffset;
 
       ewall[m+1] += fwall;
diff --git a/src/COLLOID/fix_wall_colloid.h b/src/COLLOID/fix_wall_colloid.h
index 03e3b9e88f..61aa4078f9 100644
--- a/src/COLLOID/fix_wall_colloid.h
+++ b/src/COLLOID/fix_wall_colloid.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/COLLOID/pair_colloid.cpp b/src/COLLOID/pair_colloid.cpp
index 04211a3509..b1111119ea 100644
--- a/src/COLLOID/pair_colloid.cpp
+++ b/src/COLLOID/pair_colloid.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,7 +50,7 @@ PairColloid::~PairColloid()
     memory->destroy(a1);
     memory->destroy(a2);
     memory->destroy(diameter);
-    memory->destroy(cut);		
+    memory->destroy(cut);
     memory->destroy(offset);
     memory->destroy(sigma3);
     memory->destroy(sigma6);
@@ -87,7 +87,7 @@ void PairColloid::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -103,7 +103,7 @@ void PairColloid::compute(int eflag, int vflag)
       j = jlist[jj];
       factor_lj = special_lj[sbmask(j)];
       j &= NEIGHMASK;
-     
+
       delx = xtmp - x[j][0];
       dely = ytmp - x[j][1];
       delz = ztmp - x[j][2];
@@ -113,87 +113,87 @@ void PairColloid::compute(int eflag, int vflag)
       if (rsq >= cutsq[itype][jtype]) continue;
 
       switch (form[itype][jtype]) {
-      case SMALL_SMALL: 
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-	if (eflag) evdwl = r6inv*(r6inv*lj3[itype][jtype]-lj4[itype][jtype]) -
-		     offset[itype][jtype];
-	break;
-	
+      case SMALL_SMALL:
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+        if (eflag) evdwl = r6inv*(r6inv*lj3[itype][jtype]-lj4[itype][jtype]) -
+                     offset[itype][jtype];
+        break;
+
       case SMALL_LARGE:
-	c2 = a2[itype][jtype];
-	K[1] = c2*c2;
-	K[2] = rsq;
-	K[0] = K[1] - rsq;
-	K[4] = rsq*rsq;
-	K[3] = K[1] - K[2];
-	K[3] *= K[3]*K[3];
-	K[6] = K[3]*K[3];
-	fR = sigma3[itype][jtype]*a12[itype][jtype]*c2*K[1]/K[3];
-	fpair = 4.0/15.0*fR*factor_lj * 
-	  (2.0*(K[1]+K[2]) * (K[1]*(5.0*K[1]+22.0*K[2])+5.0*K[4]) * 
-	   sigma6[itype][jtype]/K[6]-5.0) / K[0];
-	if (eflag) 
-	  evdwl = 2.0/9.0*fR * 
-	    (1.0-(K[1]*(K[1]*(K[1]/3.0+3.0*K[2])+4.2*K[4])+K[2]*K[4]) *
-	     sigma6[itype][jtype]/K[6]) - offset[itype][jtype];
-	if (rsq <= K[1]) error->one(FLERR,"Overlapping small/large in pair colloid");
-	break;
+        c2 = a2[itype][jtype];
+        K[1] = c2*c2;
+        K[2] = rsq;
+        K[0] = K[1] - rsq;
+        K[4] = rsq*rsq;
+        K[3] = K[1] - K[2];
+        K[3] *= K[3]*K[3];
+        K[6] = K[3]*K[3];
+        fR = sigma3[itype][jtype]*a12[itype][jtype]*c2*K[1]/K[3];
+        fpair = 4.0/15.0*fR*factor_lj *
+          (2.0*(K[1]+K[2]) * (K[1]*(5.0*K[1]+22.0*K[2])+5.0*K[4]) *
+           sigma6[itype][jtype]/K[6]-5.0) / K[0];
+        if (eflag)
+          evdwl = 2.0/9.0*fR *
+            (1.0-(K[1]*(K[1]*(K[1]/3.0+3.0*K[2])+4.2*K[4])+K[2]*K[4]) *
+             sigma6[itype][jtype]/K[6]) - offset[itype][jtype];
+        if (rsq <= K[1]) error->one(FLERR,"Overlapping small/large in pair colloid");
+        break;
 
       case LARGE_LARGE:
-	r = sqrt(rsq);
-	c1 = a1[itype][jtype];
-	c2 = a2[itype][jtype];
-	K[0] = c1*c2;
-	K[1] = c1+c2;
-	K[2] = c1-c2;
-	K[3] = K[1]+r;
-	K[4] = K[1]-r;
-	K[5] = K[2]+r;
-	K[6] = K[2]-r;
-	K[7] = 1.0/(K[3]*K[4]);
-	K[8] = 1.0/(K[5]*K[6]);
-	g[0] = pow(K[3],-7.0);
-	g[1] = pow(K[4],-7.0);
-	g[2] = pow(K[5],-7.0);
-	g[3] = pow(K[6],-7.0);
-	h[0] = ((K[3]+5.0*K[1])*K[3]+30.0*K[0])*g[0];
-	h[1] = ((K[4]+5.0*K[1])*K[4]+30.0*K[0])*g[1];
-	h[2] = ((K[5]+5.0*K[2])*K[5]-30.0*K[0])*g[2];
-	h[3] = ((K[6]+5.0*K[2])*K[6]-30.0*K[0])*g[3];
-	g[0] *= 42.0*K[0]/K[3]+6.0*K[1]+K[3];
-	g[1] *= 42.0*K[0]/K[4]+6.0*K[1]+K[4];
-	g[2] *= -42.0*K[0]/K[5]+6.0*K[2]+K[5];
-	g[3] *= -42.0*K[0]/K[6]+6.0*K[2]+K[6];
-	
-	fR = a12[itype][jtype]*sigma6[itype][jtype]/r/37800.0;
-	evdwl = fR * (h[0]-h[1]-h[2]+h[3]);
-	dUR = evdwl/r + 5.0*fR*(g[0]+g[1]-g[2]-g[3]);
-	dUA = -a12[itype][jtype]/3.0*r*((2.0*K[0]*K[7]+1.0)*K[7] + 
-					(2.0*K[0]*K[8]-1.0)*K[8]);
-	fpair = factor_lj * (dUR+dUA)/r;
-	if (eflag)
-	  evdwl += a12[itype][jtype]/6.0 * 
-	    (2.0*K[0]*(K[7]+K[8])-log(K[8]/K[7])) - offset[itype][jtype];
-	if (r <= K[1]) error->one(FLERR,"Overlapping large/large in pair colloid");
-	break;
+        r = sqrt(rsq);
+        c1 = a1[itype][jtype];
+        c2 = a2[itype][jtype];
+        K[0] = c1*c2;
+        K[1] = c1+c2;
+        K[2] = c1-c2;
+        K[3] = K[1]+r;
+        K[4] = K[1]-r;
+        K[5] = K[2]+r;
+        K[6] = K[2]-r;
+        K[7] = 1.0/(K[3]*K[4]);
+        K[8] = 1.0/(K[5]*K[6]);
+        g[0] = pow(K[3],-7.0);
+        g[1] = pow(K[4],-7.0);
+        g[2] = pow(K[5],-7.0);
+        g[3] = pow(K[6],-7.0);
+        h[0] = ((K[3]+5.0*K[1])*K[3]+30.0*K[0])*g[0];
+        h[1] = ((K[4]+5.0*K[1])*K[4]+30.0*K[0])*g[1];
+        h[2] = ((K[5]+5.0*K[2])*K[5]-30.0*K[0])*g[2];
+        h[3] = ((K[6]+5.0*K[2])*K[6]-30.0*K[0])*g[3];
+        g[0] *= 42.0*K[0]/K[3]+6.0*K[1]+K[3];
+        g[1] *= 42.0*K[0]/K[4]+6.0*K[1]+K[4];
+        g[2] *= -42.0*K[0]/K[5]+6.0*K[2]+K[5];
+        g[3] *= -42.0*K[0]/K[6]+6.0*K[2]+K[6];
+
+        fR = a12[itype][jtype]*sigma6[itype][jtype]/r/37800.0;
+        evdwl = fR * (h[0]-h[1]-h[2]+h[3]);
+        dUR = evdwl/r + 5.0*fR*(g[0]+g[1]-g[2]-g[3]);
+        dUA = -a12[itype][jtype]/3.0*r*((2.0*K[0]*K[7]+1.0)*K[7] +
+                                        (2.0*K[0]*K[8]-1.0)*K[8]);
+        fpair = factor_lj * (dUR+dUA)/r;
+        if (eflag)
+          evdwl += a12[itype][jtype]/6.0 *
+            (2.0*K[0]*(K[7]+K[8])-log(K[8]/K[7])) - offset[itype][jtype];
+        if (r <= K[1]) error->one(FLERR,"Overlapping large/large in pair colloid");
+        break;
       }
-      
+
       if (eflag) evdwl *= factor_lj;
 
       f[i][0] += delx*fpair;
       f[i][1] += dely*fpair;
       f[i][2] += delz*fpair;
       if (newton_pair || j < nlocal) {
-	f[j][0] -= delx*fpair;
-	f[j][1] -= dely*fpair;
-	f[j][2] -= delz*fpair;
+        f[j][0] -= delx*fpair;
+        f[j][1] -= dely*fpair;
+        f[j][2] -= delz*fpair;
       }
 
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,0.0,fpair,delx,dely,delz);
+                           evdwl,0.0,fpair,delx,dely,delz);
     }
   }
 
@@ -201,7 +201,7 @@ void PairColloid::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairColloid::allocate()
@@ -235,7 +235,7 @@ void PairColloid::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairColloid::settings(int narg, char **arg)
@@ -250,7 +250,7 @@ void PairColloid::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -275,7 +275,7 @@ void PairColloid::coeff(int narg, char **arg)
   double cut_one = cut_global;
   if (narg == 7) cut_one = force->numeric(arg[6]);
 
-  if (d1_one < 0.0 || d2_one < 0.0) 
+  if (d1_one < 0.0 || d2_one < 0.0)
     error->all(FLERR,"Invalid d1 or d2 value for pair colloid coeff");
 
   int count = 0;
@@ -284,7 +284,7 @@ void PairColloid::coeff(int narg, char **arg)
       a12[i][j] = a12_one;
       sigma[i][j] = sigma_one;
       if (i == j && d1_one != d2_one)
-	error->all(FLERR,"Invalid d1 or d2 value for pair colloid coeff");
+        error->all(FLERR,"Invalid d1 or d2 value for pair colloid coeff");
       d1[i][j] = d1_one;
       d2[i][j] = d2_one;
       diameter[i][j] = 0.5*(d1_one+d2_one);
@@ -349,7 +349,7 @@ double PairColloid::init_one(int i, int j)
   offset[j][i] = offset[i][j] = 0.0;
   if (offset_flag) {
     double tmp;
-    offset[j][i] = offset[i][j] = 
+    offset[j][i] = offset[i][j] =
       single(0,0,i,j,cut[i][j]*cut[i][j],0.0,1.0,tmp);
   }
 
@@ -357,7 +357,7 @@ double PairColloid::init_one(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairColloid::write_restart(FILE *fp)
@@ -369,11 +369,11 @@ void PairColloid::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&a12[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&d1[i][j],sizeof(double),1,fp);
-	fwrite(&d2[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&a12[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&d1[i][j],sizeof(double),1,fp);
+        fwrite(&d2[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -394,18 +394,18 @@ void PairColloid::read_restart(FILE *fp)
       if (comm->me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (comm->me == 0) {
-	  fread(&a12[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&d1[i][j],sizeof(double),1,fp);
-	  fread(&d2[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&a12[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&d1[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&d2[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (comm->me == 0) {
+          fread(&a12[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&d1[i][j],sizeof(double),1,fp);
+          fread(&d2[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&a12[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&d1[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&d2[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -441,8 +441,8 @@ void PairColloid::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairColloid::single(int i, int j, int itype, int jtype, double rsq,
-			   double factor_coul, double factor_lj,
-			   double &fforce)
+                           double factor_coul, double factor_lj,
+                           double &fforce)
 {
   double K[9],h[4],g[4];
   double r,r2inv,r6inv,forcelj,c1,c2,phi,fR,dUR,dUA;
@@ -467,11 +467,11 @@ double PairColloid::single(int i, int j, int itype, int jtype, double rsq,
     K[3] *= K[3]*K[3];
     K[6] = K[3]*K[3];
     fR = sigma3[itype][jtype]*a12[itype][jtype]*c2*K[1]/K[3];
-    fforce = 4.0/15.0*fR*factor_lj * 
-      (2.0*(K[1]+K[2])*(K[1]*(5.0*K[1]+22.0*K[2])+5.0*K[4]) * 
+    fforce = 4.0/15.0*fR*factor_lj *
+      (2.0*(K[1]+K[2])*(K[1]*(5.0*K[1]+22.0*K[2])+5.0*K[4]) *
        sigma6[itype][jtype]/K[6] - 5.0)/K[0];
-    phi = 2.0/9.0*fR * 
-      (1.0-(K[1]*(K[1]*(K[1]/3.0+3.0*K[2])+4.2*K[4])+K[2]*K[4]) * 
+    phi = 2.0/9.0*fR *
+      (1.0-(K[1]*(K[1]*(K[1]/3.0+3.0*K[2])+4.2*K[4])+K[2]*K[4]) *
        sigma6[itype][jtype]/K[6]) - offset[itype][jtype];
     break;
 
@@ -500,14 +500,14 @@ double PairColloid::single(int i, int j, int itype, int jtype, double rsq,
     g[1] *= 42.0*K[0]/K[4]+6.0*K[1]+K[4];
     g[2] *= -42.0*K[0]/K[5]+6.0*K[2]+K[5];
     g[3] *= -42.0*K[0]/K[6]+6.0*K[2]+K[6];
-    
+
     fR = a12[itype][jtype]*sigma6[itype][jtype]/r/37800.0;
     phi = fR * (h[0]-h[1]-h[2]+h[3]);
     dUR = phi/r + 5.0*fR*(g[0]+g[1]-g[2]-g[3]);
-    dUA = -a12[itype][jtype]/3.0*r*((2.0*K[0]*K[7]+1.0)*K[7] + 
-				    (2.0*K[0]*K[8]-1.0)*K[8]);
+    dUA = -a12[itype][jtype]/3.0*r*((2.0*K[0]*K[7]+1.0)*K[7] +
+                                    (2.0*K[0]*K[8]-1.0)*K[8]);
     fforce = factor_lj*(dUR+dUA)/r;
-    phi += a12[itype][jtype]/6.0*(2.0*K[0]*(K[7]+K[8])-log(K[8]/K[7])) - 
+    phi += a12[itype][jtype]/6.0*(2.0*K[0]*(K[7]+K[8])-log(K[8]/K[7])) -
       offset[itype][jtype];
     break;
   }
diff --git a/src/COLLOID/pair_colloid.h b/src/COLLOID/pair_colloid.h
index a9b720330a..18eec2290c 100644
--- a/src/COLLOID/pair_colloid.h
+++ b/src/COLLOID/pair_colloid.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/COLLOID/pair_yukawa_colloid.cpp b/src/COLLOID/pair_yukawa_colloid.cpp
index ca68a56c9c..d311e44a48 100644
--- a/src/COLLOID/pair_yukawa_colloid.cpp
+++ b/src/COLLOID/pair_yukawa_colloid.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -58,7 +58,7 @@ void PairYukawaColloid::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -82,32 +82,32 @@ void PairYukawaColloid::compute(int eflag, int vflag)
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
       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)));
-	forceyukawa = a[itype][jtype] * screening;
-
-	fpair = factor*forceyukawa * rinv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  evdwl = a[itype][jtype]/kappa * screening - offset[itype][jtype];
-	  evdwl *= factor;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        screening = exp(-kappa*(r-(radi+radj)));
+        forceyukawa = a[itype][jtype] * screening;
+
+        fpair = factor*forceyukawa * rinv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          evdwl = a[itype][jtype]/kappa * screening - offset[itype][jtype];
+          evdwl *= factor;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -123,7 +123,7 @@ void PairYukawaColloid::init_style()
 {
   if (!atom->sphere_flag)
     error->all(FLERR,"Pair yukawa/colloid requires atom style sphere");
-  
+
   neighbor->request(this);
 
   // require that atom radii are identical within each type
@@ -131,7 +131,7 @@ void PairYukawaColloid::init_style()
   for (int i = 1; i <= atom->ntypes; i++)
     if (!atom->radius_consistency(i,rad[i]))
       error->all(FLERR,"Pair yukawa/colloid requires atoms with same type "
-		 "have same radius");
+                 "have same radius");
 }
 
 /* ----------------------------------------------------------------------
@@ -159,12 +159,12 @@ double PairYukawaColloid::init_one(int i, int j)
 /* ---------------------------------------------------------------------- */
 
 double PairYukawaColloid::single(int i, int j, int itype, int jtype,
-				 double rsq,
-				 double factor_coul, double factor_lj,
-				 double &fforce)
+                                 double rsq,
+                                 double factor_coul, double factor_lj,
+                                 double &fforce)
 {
   double r2inv,r,rinv,screening,forceyukawa,phi;
-  
+
   r2inv = 1.0/rsq;
   r = sqrt(rsq);
   rinv = 1.0/r;
@@ -172,6 +172,6 @@ double PairYukawaColloid::single(int i, int j, int itype, int jtype,
   forceyukawa = a[itype][jtype] * screening;
   fforce = factor_lj*forceyukawa * rinv;
 
-  phi = a[itype][jtype]/kappa * screening  - offset[itype][jtype]; 
+  phi = a[itype][jtype]/kappa * screening  - offset[itype][jtype];
   return factor_lj*phi;
 }
diff --git a/src/COLLOID/pair_yukawa_colloid.h b/src/COLLOID/pair_yukawa_colloid.h
index 29d5b6521f..be04d790a2 100644
--- a/src/COLLOID/pair_yukawa_colloid.h
+++ b/src/COLLOID/pair_yukawa_colloid.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/DIPOLE/atom_vec_dipole.cpp b/src/DIPOLE/atom_vec_dipole.cpp
index 86d0119eaa..02f048e3d8 100644
--- a/src/DIPOLE/atom_vec_dipole.cpp
+++ b/src/DIPOLE/atom_vec_dipole.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,7 +50,7 @@ AtomVecDipole::AtomVecDipole(LAMMPS *lmp, int narg, char **arg) :
 /* ----------------------------------------------------------------------
    grow atom arrays
    n = 0 grows arrays by DELTA
-   n > 0 allocates arrays to size n 
+   n > 0 allocates arrays to size n
 ------------------------------------------------------------------------- */
 
 void AtomVecDipole::grow(int n)
@@ -73,7 +73,7 @@ void AtomVecDipole::grow(int n)
   mu = memory->grow(atom->mu,nmax,4,"atom:mu");
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
 }
 
@@ -113,14 +113,14 @@ void AtomVecDipole::copy(int i, int j, int delflag)
   mu[j][3] = mu[i][3];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecDipole::pack_comm(int n, int *list, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -162,7 +162,7 @@ int AtomVecDipole::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecDipole::pack_comm_vel(int n, int *list, double *buf,
-				 int pbc_flag, int *pbc)
+                                 int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -193,38 +193,38 @@ int AtomVecDipole::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = mu[j][0];
-	buf[m++] = mu[j][1];
-	buf[m++] = mu[j][2];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = mu[j][0];
+        buf[m++] = mu[j][1];
+        buf[m++] = mu[j][2];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = mu[j][0];
-	buf[m++] = mu[j][1];
-	buf[m++] = mu[j][2];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = mu[j][0];
+        buf[m++] = mu[j][1];
+        buf[m++] = mu[j][2];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -336,7 +336,7 @@ void AtomVecDipole::unpack_reverse(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecDipole::pack_border(int n, int *list, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -388,7 +388,7 @@ int AtomVecDipole::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecDipole::pack_border_vel(int n, int *list, double *buf,
-				   int pbc_flag, int *pbc)
+                                   int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -424,48 +424,48 @@ int AtomVecDipole::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = q[j];
-	buf[m++] = mu[j][0];
-	buf[m++] = mu[j][1];
-	buf[m++] = mu[j][2];
-	buf[m++] = mu[j][3];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = q[j];
+        buf[m++] = mu[j][0];
+        buf[m++] = mu[j][1];
+        buf[m++] = mu[j][2];
+        buf[m++] = mu[j][3];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = q[j];
-	buf[m++] = mu[j][0];
-	buf[m++] = mu[j][1];
-	buf[m++] = mu[j][2];
-	buf[m++] = mu[j][3];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = q[j];
+        buf[m++] = mu[j][0];
+        buf[m++] = mu[j][1];
+        buf[m++] = mu[j][2];
+        buf[m++] = mu[j][3];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -585,7 +585,7 @@ int AtomVecDipole::pack_exchange(int i, double *buf)
   buf[m++] = mu[i][3];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -618,9 +618,9 @@ int AtomVecDipole::unpack_exchange(double *buf)
   mu[nlocal][3] = buf[m++];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -639,9 +639,9 @@ int AtomVecDipole::size_restart()
   int n = 16 * nlocal;
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -649,7 +649,7 @@ int AtomVecDipole::size_restart()
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecDipole::pack_restart(int i, double *buf)
@@ -673,7 +673,7 @@ int AtomVecDipole::pack_restart(int i, double *buf)
   buf[m++] = mu[i][3];
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
 
   buf[0] = m;
@@ -778,9 +778,9 @@ void AtomVecDipole::data_atom(double *coord, int imagetmp, char **values)
   mu[nlocal][0] = atof(values[6]);
   mu[nlocal][1] = atof(values[7]);
   mu[nlocal][2] = atof(values[8]);
-  mu[nlocal][3] = sqrt(mu[nlocal][0]*mu[nlocal][0] + 
-		       mu[nlocal][1]*mu[nlocal][1] + 
-		       mu[nlocal][2]*mu[nlocal][2]);
+  mu[nlocal][3] = sqrt(mu[nlocal][0]*mu[nlocal][0] +
+                       mu[nlocal][1]*mu[nlocal][1] +
+                       mu[nlocal][2]*mu[nlocal][2]);
 
   image[nlocal] = imagetmp;
 
@@ -803,14 +803,14 @@ int AtomVecDipole::data_atom_hybrid(int nlocal, char **values)
   mu[nlocal][0] = atof(values[1]);
   mu[nlocal][1] = atof(values[2]);
   mu[nlocal][2] = atof(values[3]);
-  mu[nlocal][3] = sqrt(mu[nlocal][0]*mu[nlocal][0] + 
-		       mu[nlocal][1]*mu[nlocal][1] + 
-		       mu[nlocal][2]*mu[nlocal][2]);
+  mu[nlocal][3] = sqrt(mu[nlocal][0]*mu[nlocal][0] +
+                       mu[nlocal][1]*mu[nlocal][1] +
+                       mu[nlocal][2]*mu[nlocal][2]);
   return 4;
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecDipole::memory_usage()
diff --git a/src/DIPOLE/atom_vec_dipole.h b/src/DIPOLE/atom_vec_dipole.h
index 6aa17157bc..52b751f10d 100644
--- a/src/DIPOLE/atom_vec_dipole.h
+++ b/src/DIPOLE/atom_vec_dipole.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/DIPOLE/pair_dipole_cut.cpp b/src/DIPOLE/pair_dipole_cut.cpp
index f443854b90..e95955062b 100644
--- a/src/DIPOLE/pair_dipole_cut.cpp
+++ b/src/DIPOLE/pair_dipole_cut.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -86,7 +86,7 @@ void PairDipoleCut::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -112,142 +112,142 @@ void PairDipoleCut::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	rinv = sqrt(r2inv);
+        r2inv = 1.0/rsq;
+        rinv = sqrt(r2inv);
+
+        // atom can have both a charge and dipole
+        // i,j = charge-charge, dipole-dipole, dipole-charge, or charge-dipole
 
-	// atom can have both a charge and dipole
-	// i,j = charge-charge, dipole-dipole, dipole-charge, or charge-dipole
+        forcecoulx = forcecouly = forcecoulz = 0.0;
+        tixcoul = tiycoul = tizcoul = 0.0;
+        tjxcoul = tjycoul = tjzcoul = 0.0;
 
-	forcecoulx = forcecouly = forcecoulz = 0.0;
-	tixcoul = tiycoul = tizcoul = 0.0;
-	tjxcoul = tjycoul = tjzcoul = 0.0;
-	
-	if (rsq < cut_coulsq[itype][jtype]) {
+        if (rsq < cut_coulsq[itype][jtype]) {
 
-	  if (qtmp != 0.0 && q[j] != 0.0) {
+          if (qtmp != 0.0 && q[j] != 0.0) {
             r3inv = r2inv*rinv;
-	    pre1 = qtmp*q[j]*r3inv;
+            pre1 = qtmp*q[j]*r3inv;
 
-	    forcecoulx += pre1*delx;
-	    forcecouly += pre1*dely;
-	    forcecoulz += pre1*delz;
-	  }
+            forcecoulx += pre1*delx;
+            forcecouly += pre1*dely;
+            forcecoulz += pre1*delz;
+          }
 
-	  if (mu[i][3] > 0.0 && mu[j][3] > 0.0) { 
+          if (mu[i][3] > 0.0 && mu[j][3] > 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
-	    r7inv = r5inv*r2inv;
+            r7inv = r5inv*r2inv;
 
             pdotp = mu[i][0]*mu[j][0] + mu[i][1]*mu[j][1] + mu[i][2]*mu[j][2];
             pidotr = mu[i][0]*delx + mu[i][1]*dely + mu[i][2]*delz;
             pjdotr = mu[j][0]*delx + mu[j][1]*dely + mu[j][2]*delz;
 
-	    pre1 = 3.0*r5inv*pdotp - 15.0*r7inv*pidotr*pjdotr;
-	    pre2 = 3.0*r5inv*pjdotr;
-	    pre3 = 3.0*r5inv*pidotr;
-	    pre4 = -1.0*r3inv;
-
-	    forcecoulx += pre1*delx + pre2*mu[i][0] + pre3*mu[j][0];
-	    forcecouly += pre1*dely + pre2*mu[i][1] + pre3*mu[j][1];
-	    forcecoulz += pre1*delz + pre2*mu[i][2] + pre3*mu[j][2];
-	    
-	    crossx = pre4 * (mu[i][1]*mu[j][2] - mu[i][2]*mu[j][1]);
-	    crossy = pre4 * (mu[i][2]*mu[j][0] - mu[i][0]*mu[j][2]);
-	    crossz = pre4 * (mu[i][0]*mu[j][1] - mu[i][1]*mu[j][0]);
-
-	    tixcoul += crossx + pre2 * (mu[i][1]*delz - mu[i][2]*dely);
-	    tiycoul += crossy + pre2 * (mu[i][2]*delx - mu[i][0]*delz);
-	    tizcoul += crossz + pre2 * (mu[i][0]*dely - mu[i][1]*delx);
-	    tjxcoul += -crossx + pre3 * (mu[j][1]*delz - mu[j][2]*dely);
-	    tjycoul += -crossy + pre3 * (mu[j][2]*delx - mu[j][0]*delz);
-	    tjzcoul += -crossz + pre3 * (mu[j][0]*dely - mu[j][1]*delx);
-	  }
-
-	  if (mu[i][3] > 0.0 && q[j] != 0.0) { 
+            pre1 = 3.0*r5inv*pdotp - 15.0*r7inv*pidotr*pjdotr;
+            pre2 = 3.0*r5inv*pjdotr;
+            pre3 = 3.0*r5inv*pidotr;
+            pre4 = -1.0*r3inv;
+
+            forcecoulx += pre1*delx + pre2*mu[i][0] + pre3*mu[j][0];
+            forcecouly += pre1*dely + pre2*mu[i][1] + pre3*mu[j][1];
+            forcecoulz += pre1*delz + pre2*mu[i][2] + pre3*mu[j][2];
+
+            crossx = pre4 * (mu[i][1]*mu[j][2] - mu[i][2]*mu[j][1]);
+            crossy = pre4 * (mu[i][2]*mu[j][0] - mu[i][0]*mu[j][2]);
+            crossz = pre4 * (mu[i][0]*mu[j][1] - mu[i][1]*mu[j][0]);
+
+            tixcoul += crossx + pre2 * (mu[i][1]*delz - mu[i][2]*dely);
+            tiycoul += crossy + pre2 * (mu[i][2]*delx - mu[i][0]*delz);
+            tizcoul += crossz + pre2 * (mu[i][0]*dely - mu[i][1]*delx);
+            tjxcoul += -crossx + pre3 * (mu[j][1]*delz - mu[j][2]*dely);
+            tjycoul += -crossy + pre3 * (mu[j][2]*delx - mu[j][0]*delz);
+            tjzcoul += -crossz + pre3 * (mu[j][0]*dely - mu[j][1]*delx);
+          }
+
+          if (mu[i][3] > 0.0 && q[j] != 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
             pidotr = mu[i][0]*delx + mu[i][1]*dely + mu[i][2]*delz;
-	    pre1 = 3.0*q[j]*r5inv * pidotr;
-	    pre2 = q[j]*r3inv;
+            pre1 = 3.0*q[j]*r5inv * pidotr;
+            pre2 = q[j]*r3inv;
 
-	    forcecoulx += pre2*mu[i][0] - pre1*delx;
+            forcecoulx += pre2*mu[i][0] - pre1*delx;
             forcecouly += pre2*mu[i][1] - pre1*dely;
             forcecoulz += pre2*mu[i][2] - pre1*delz;
-	    tixcoul += pre2 * (mu[i][1]*delz - mu[i][2]*dely);
-	    tiycoul += pre2 * (mu[i][2]*delx - mu[i][0]*delz);
-	    tizcoul += pre2 * (mu[i][0]*dely - mu[i][1]*delx);
-	  }
+            tixcoul += pre2 * (mu[i][1]*delz - mu[i][2]*dely);
+            tiycoul += pre2 * (mu[i][2]*delx - mu[i][0]*delz);
+            tizcoul += pre2 * (mu[i][0]*dely - mu[i][1]*delx);
+          }
 
-	  if (mu[j][3] > 0.0 && qtmp != 0.0) { 
+          if (mu[j][3] > 0.0 && qtmp != 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
             pjdotr = mu[j][0]*delx + mu[j][1]*dely + mu[j][2]*delz;
-	    pre1 = 3.0*qtmp*r5inv * pjdotr;
-	    pre2 = qtmp*r3inv;
+            pre1 = 3.0*qtmp*r5inv * pjdotr;
+            pre2 = qtmp*r3inv;
 
-	    forcecoulx += pre1*delx - pre2*mu[j][0];
+            forcecoulx += pre1*delx - pre2*mu[j][0];
             forcecouly += pre1*dely - pre2*mu[j][1];
             forcecoulz += pre1*delz - pre2*mu[j][2];
-	    tjxcoul += -pre2 * (mu[j][1]*delz - mu[j][2]*dely);
-	    tjycoul += -pre2 * (mu[j][2]*delx - mu[j][0]*delz);
-	    tjzcoul += -pre2 * (mu[j][0]*dely - mu[j][1]*delx);
-	  }
-	}
-
-	// LJ interaction
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  forcelj *= factor_lj * r2inv;
-	} else forcelj = 0.0;
-	  
-	// total force
-
-	fq = factor_coul*qqrd2e;
-	fx = fq*forcecoulx + delx*forcelj;
-	fy = fq*forcecouly + dely*forcelj;
-	fz = fq*forcecoulz + delz*forcelj;
-	
-	// force & torque accumulation
-
-	f[i][0] += fx;
-	f[i][1] += fy;
-	f[i][2] += fz;
-	torque[i][0] += fq*tixcoul;
-	torque[i][1] += fq*tiycoul;
-	torque[i][2] += fq*tizcoul;
-
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	  torque[j][0] += fq*tjxcoul;
-	  torque[j][1] += fq*tjycoul;
-	  torque[j][2] += fq*tjzcoul;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq[itype][jtype]) {
-	    ecoul = qtmp*q[j]*rinv;
-	    if (mu[i][3] > 0.0 && mu[j][3] > 0.0)
-	      ecoul += r3inv*pdotp - 3.0*r5inv*pidotr*pjdotr;
-	    if (mu[i][3] > 0.0 && q[j] != 0.0) 
-	      ecoul += -q[j]*r3inv*pidotr;
-	    if (mu[j][3] > 0.0 && qtmp != 0.0)
-	      ecoul += qtmp*r3inv*pjdotr;
-	    ecoul *= factor_coul*qqrd2e;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
-				 evdwl,ecoul,fx,fy,fz,delx,dely,delz);
+            tjxcoul += -pre2 * (mu[j][1]*delz - mu[j][2]*dely);
+            tjycoul += -pre2 * (mu[j][2]*delx - mu[j][0]*delz);
+            tjzcoul += -pre2 * (mu[j][0]*dely - mu[j][1]*delx);
+          }
+        }
+
+        // LJ interaction
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          forcelj *= factor_lj * r2inv;
+        } else forcelj = 0.0;
+
+        // total force
+
+        fq = factor_coul*qqrd2e;
+        fx = fq*forcecoulx + delx*forcelj;
+        fy = fq*forcecouly + dely*forcelj;
+        fz = fq*forcecoulz + delz*forcelj;
+
+        // force & torque accumulation
+
+        f[i][0] += fx;
+        f[i][1] += fy;
+        f[i][2] += fz;
+        torque[i][0] += fq*tixcoul;
+        torque[i][1] += fq*tiycoul;
+        torque[i][2] += fq*tizcoul;
+
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+          torque[j][0] += fq*tjxcoul;
+          torque[j][1] += fq*tjycoul;
+          torque[j][2] += fq*tjzcoul;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq[itype][jtype]) {
+            ecoul = qtmp*q[j]*rinv;
+            if (mu[i][3] > 0.0 && mu[j][3] > 0.0)
+              ecoul += r3inv*pdotp - 3.0*r5inv*pidotr*pjdotr;
+            if (mu[i][3] > 0.0 && q[j] != 0.0)
+              ecoul += -q[j]*r3inv*pidotr;
+            if (mu[j][3] > 0.0 && qtmp != 0.0)
+              ecoul += qtmp*r3inv*pjdotr;
+            ecoul *= factor_coul*qqrd2e;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
+                                 evdwl,ecoul,fx,fy,fz,delx,dely,delz);
       }
     }
   }
@@ -256,7 +256,7 @@ void PairDipoleCut::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairDipoleCut::allocate()
@@ -285,7 +285,7 @@ void PairDipoleCut::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairDipoleCut::settings(int narg, char **arg)
@@ -303,10 +303,10 @@ void PairDipoleCut::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) {
-	  cut_lj[i][j] = cut_lj_global;
-	  cut_coul[i][j] = cut_coul_global;
-	}
+        if (setflag[i][j]) {
+          cut_lj[i][j] = cut_lj_global;
+          cut_coul[i][j] = cut_coul_global;
+        }
   }
 }
 
@@ -316,7 +316,7 @@ void PairDipoleCut::settings(int narg, char **arg)
 
 void PairDipoleCut::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 6) 
+  if (narg < 4 || narg > 6)
     error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
@@ -367,7 +367,7 @@ double PairDipoleCut::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut_lj[i][j] = mix_distance(cut_lj[i][i],cut_lj[j][j]);
     cut_coul[i][j] = mix_distance(cut_coul[i][i],cut_coul[j][j]);
@@ -381,12 +381,12 @@ double PairDipoleCut::init_one(int i, int j)
   lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
   lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
   lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
-     
+
   if (offset_flag) {
     double ratio = sigma[i][j] / cut_lj[i][j];
     offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
   } else offset[i][j] = 0.0;
-  
+
   cut_ljsq[j][i] = cut_ljsq[i][j];
   cut_coulsq[j][i] = cut_coulsq[i][j];
   lj1[j][i] = lj1[i][j];
@@ -411,10 +411,10 @@ void PairDipoleCut::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj[i][j],sizeof(double),1,fp);
-	fwrite(&cut_coul[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj[i][j],sizeof(double),1,fp);
+        fwrite(&cut_coul[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -436,16 +436,16 @@ void PairDipoleCut::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj[i][j],sizeof(double),1,fp);
-	  fread(&cut_coul[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_coul[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut_lj[i][j],sizeof(double),1,fp);
+          fread(&cut_coul[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_coul[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
diff --git a/src/DIPOLE/pair_dipole_cut.h b/src/DIPOLE/pair_dipole_cut.h
index f787dda55d..212e5f8a2b 100644
--- a/src/DIPOLE/pair_dipole_cut.h
+++ b/src/DIPOLE/pair_dipole_cut.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/FLD/pair_brownian.cpp b/src/FLD/pair_brownian.cpp
index 586c83cd0a..b4966dca52 100755
--- a/src/FLD/pair_brownian.cpp
+++ b/src/FLD/pair_brownian.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -104,37 +104,37 @@ void PairBrownian::compute(int eflag, int vflag)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	double wallhi[3], walllo[3];
-	for (int j = 0; j < 3; j++){
-	  wallhi[j] = domain->prd[j];
-	  walllo[j] = 0;
-	}    
-	for (int m = 0; m < wallfix->nwall; m++){
-	  int dim = wallfix->wallwhich[m] / 2;
-	  int side = wallfix->wallwhich[m] % 2;
-	  if (wallfix->wallstyle[m] == VARIABLE){
-	    wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	  }	   
-	  else wallcoord = wallfix->coord0[m];	   
-	  if (side == 0) walllo[dim] = wallcoord;
-	  else wallhi[dim] = wallcoord;	   
-	}
-	for (int j = 0; j < 3; j++)
-	  dims[j] = wallhi[j] - walllo[j];
+        double wallhi[3], walllo[3];
+        for (int j = 0; j < 3; j++){
+          wallhi[j] = domain->prd[j];
+          walllo[j] = 0;
+        }
+        for (int m = 0; m < wallfix->nwall; m++){
+          int dim = wallfix->wallwhich[m] / 2;
+          int side = wallfix->wallwhich[m] % 2;
+          if (wallfix->wallstyle[m] == VARIABLE){
+            wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+          }
+          else wallcoord = wallfix->coord0[m];
+          if (side == 0) walllo[dim] = wallcoord;
+          else wallhi[dim] = wallcoord;
+        }
+        for (int j = 0; j < 3; j++)
+          dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0);
-	//RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0);
+        //RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	//RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        //RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
@@ -156,8 +156,8 @@ void PairBrownian::compute(int eflag, int vflag)
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];       
-    
+    jnum = numneigh[i];
+
     // FLD contribution to force and torque due to isotropic terms
 
     if (flagfld) {
@@ -165,12 +165,12 @@ void PairBrownian::compute(int eflag, int vflag)
       f[i][1] += prethermostat*sqrt(R0)*(random->uniform()-0.5);
       f[i][2] += prethermostat*sqrt(R0)*(random->uniform()-0.5);
       if (flaglog) {
-	torque[i][0] += prethermostat*sqrt(RT0)*(random->uniform()-0.5);
-	torque[i][1] += prethermostat*sqrt(RT0)*(random->uniform()-0.5);
-	torque[i][2] += prethermostat*sqrt(RT0)*(random->uniform()-0.5);
+        torque[i][0] += prethermostat*sqrt(RT0)*(random->uniform()-0.5);
+        torque[i][1] += prethermostat*sqrt(RT0)*(random->uniform()-0.5);
+        torque[i][2] += prethermostat*sqrt(RT0)*(random->uniform()-0.5);
       }
     }
-    
+
     if (!flagHI) continue;
 
     for (jj = 0; jj < jnum; jj++) {
@@ -184,25 +184,25 @@ void PairBrownian::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);      
-          
+        r = sqrt(rsq);
+
         // scalar resistances a_sq and a_sh
 
         h_sep = r - 2.0*radi;
-        
+
         // check for overlaps
 
         if (h_sep < 0.0) overlaps++;
-        
+
         // if less than minimum gap, use minimum gap instead
 
         if (r < cut_inner[itype][jtype])
-          h_sep = cut_inner[itype][jtype] - 2.0*radi;          
-        
+          h_sep = cut_inner[itype][jtype] - 2.0*radi;
+
         // scale h_sep by radi
 
         h_sep = h_sep/radi;
-  
+
         // scalar resistances
 
         if (flaglog) {
@@ -211,70 +211,70 @@ void PairBrownian::compute(int eflag, int vflag)
           a_pu = 8.0*MY_PI*mu*pow(radi,3.0)*(3.0/160.0*log(1.0/h_sep));
         } else
           a_sq = 6.0*MY_PI*mu*radi*(1.0/4.0/h_sep);
-         
+
         // generate the Pairwise Brownian Force: a_sq
 
         Fbmag = prethermostat*sqrt(a_sq);
-        
+
         // generate a random number
 
         randr = random->uniform()-0.5;
-          
+
         // contribution due to Brownian motion
 
         fx = Fbmag*randr*delx/r;
         fy = Fbmag*randr*dely/r;
         fz = Fbmag*randr*delz/r;
-        
+
         // add terms due to a_sh
 
         if (flaglog) {
 
           // generate two orthogonal vectors to the line of centers
 
-          p1[0] = delx/r; p1[1] = dely/r; p1[2] = delz/r;                    
+          p1[0] = delx/r; p1[1] = dely/r; p1[2] = delz/r;
           set_3_orthogonal_vectors(p1,p2,p3);
-          
+
           // magnitude
 
-          Fbmag = prethermostat*sqrt(a_sh);          
-          
+          Fbmag = prethermostat*sqrt(a_sh);
+
           // force in each of the two directions
 
           randr = random->uniform()-0.5;
           fx += Fbmag*randr*p2[0];
           fy += Fbmag*randr*p2[1];
           fz += Fbmag*randr*p2[2];
-          
+
           randr = random->uniform()-0.5;
           fx += Fbmag*randr*p3[0];
           fy += Fbmag*randr*p3[1];
-          fz += Fbmag*randr*p3[2];          
-        }       
-        
+          fz += Fbmag*randr*p3[2];
+        }
+
         // scale forces to appropriate units
 
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
+
         // sum to total force
 
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;   
-
-	if (newton_pair || j < nlocal) {
-	  //randr = random->uniform()-0.5;
-	  //fx = Fbmag*randr*delx/r;
-	  //fy = Fbmag*randr*dely/r;
-	  //fz = Fbmag*randr*delz/r;
-
-	  f[j][0] += fx;
-	  f[j][1] += fy;
-	  f[j][2] += fz;  
-	}
-        
+        f[i][2] -= fz;
+
+        if (newton_pair || j < nlocal) {
+          //randr = random->uniform()-0.5;
+          //fx = Fbmag*randr*delx/r;
+          //fy = Fbmag*randr*dely/r;
+          //fz = Fbmag*randr*delz/r;
+
+          f[j][0] += fx;
+          f[j][1] += fy;
+          f[j][2] += fz;
+        }
+
         // torque due to the Brownian Force
 
         if (flaglog) {
@@ -284,56 +284,56 @@ void PairBrownian::compute(int eflag, int vflag)
           xl[0] = -delx/r*radi;
           xl[1] = -dely/r*radi;
           xl[2] = -delz/r*radi;
-          
+
           // torque = xl_cross_F
 
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;              
-        
+          tz = xl[0]*fy - xl[1]*fx;
+
           // torque is same on both particles
 
           torque[i][0] -= tx;
           torque[i][1] -= ty;
-          torque[i][2] -= tz;          
-        
-	  if (newton_pair || j < nlocal) {
-	    torque[j][0] -= tx;
-	    torque[j][1] -= ty;
-	    torque[j][2] -= tz;       
-	  }
+          torque[i][2] -= tz;
+
+          if (newton_pair || j < nlocal) {
+            torque[j][0] -= tx;
+            torque[j][1] -= ty;
+            torque[j][2] -= tz;
+          }
 
           // torque due to a_pu
 
-          Fbmag = prethermostat*sqrt(a_pu);         
-          
+          Fbmag = prethermostat*sqrt(a_pu);
+
           // force in each direction
 
           randr = random->uniform()-0.5;
           tx = Fbmag*randr*p2[0];
           ty = Fbmag*randr*p2[1];
           tz = Fbmag*randr*p2[2];
-          
+
           randr = random->uniform()-0.5;
           tx += Fbmag*randr*p3[0];
           ty += Fbmag*randr*p3[1];
-          tz += Fbmag*randr*p3[2];    
-          
+          tz += Fbmag*randr*p3[2];
+
           // torque has opposite sign on two particles
 
           torque[i][0] -= tx;
           torque[i][1] -= ty;
-          torque[i][2] -= tz;          
-        
-	  if (newton_pair || j < nlocal) {
-	    torque[j][0] += tx;
-	    torque[j][1] += ty;
-	    torque[j][2] += tz;  
-	  }     
+          torque[i][2] -= tz;
+
+          if (newton_pair || j < nlocal) {
+            torque[j][0] += tx;
+            torque[j][1] += ty;
+            torque[j][2] += tz;
+          }
         }
 
         if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
-				 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
+                                 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
       }
     }
   }
@@ -346,7 +346,7 @@ void PairBrownian::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairBrownian::allocate()
@@ -366,7 +366,7 @@ void PairBrownian::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairBrownian::settings(int narg, char **arg)
@@ -374,12 +374,12 @@ void PairBrownian::settings(int narg, char **arg)
   if (narg != 7 && narg != 9) error->all(FLERR,"Illegal pair_style command");
 
   mu = atof(arg[0]);
-  flaglog = atoi(arg[1]);  
-  flagfld = atoi(arg[2]);  
-  cut_inner_global = atof(arg[3]); 
-  cut_global = atof(arg[4]); 
-  t_target = atof(arg[5]); 
-  seed = atoi(arg[6]); 
+  flaglog = atoi(arg[1]);
+  flagfld = atoi(arg[2]);
+  cut_inner_global = atof(arg[3]);
+  cut_global = atof(arg[4]);
+  t_target = atof(arg[5]);
+  seed = atoi(arg[6]);
 
   flagHI = flagVF = 1;
   if (narg == 9) {
@@ -389,9 +389,9 @@ void PairBrownian::settings(int narg, char **arg)
 
   if (flaglog == 1 && flagHI == 0) {
     error->warning(FLERR,"Cannot include log terms without 1/r terms; "
-		   "setting flagHI to 1");
+                   "setting flagHI to 1");
     flagHI = 1;
-  } 
+  }
 
   // initialize Marsaglia RNG with processor-unique seed
 
@@ -427,7 +427,7 @@ void PairBrownian::coeff(int narg, char **arg)
 
   double cut_inner_one = cut_inner_global;
   double cut_one = cut_global;
-  
+
   if (narg == 4) {
     cut_inner_one = atof(arg[2]);
     cut_one = atof(arg[3]);
@@ -459,8 +459,8 @@ void PairBrownian::init_style()
 
   if (force->newton_pair == 0 && comm->me == 0)
     error->warning(FLERR,
-		   "Pair brownian needs newton pair on for "
-		   "momentum conservation");
+                   "Pair brownian needs newton pair on for "
+                   "momentum conservation");
 
   int irequest = neighbor->request(this);
 
@@ -472,7 +472,7 @@ void PairBrownian::init_style()
   int nlocal = atom->nlocal;
 
   for (int i = 0; i < nlocal; i++)
-    if (radius[i] == 0.0) 
+    if (radius[i] == 0.0)
       error->one(FLERR,"Pair brownian requires extended particles");
 
   // require monodisperse system with same radii for all types
@@ -485,7 +485,7 @@ void PairBrownian::init_style()
       error->all(FLERR,"Pair brownian requires monodisperse particles");
     rad = radtype;
   }
-  
+
   // set the isotropic constants that depend on the volume fraction
   // vol_T = total volume
   // check for fix deform, if exists it must use "remap v"
@@ -499,52 +499,52 @@ void PairBrownian::init_style()
 
   flagdeform = flagwall = 0;
   for (int i = 0; i < modify->nfix; i++){
-    if (strcmp(modify->fix[i]->style,"deform") == 0) 
+    if (strcmp(modify->fix[i]->style,"deform") == 0)
       flagdeform = 1;
     else if (strstr(modify->fix[i]->style,"wall") != NULL){
       flagwall = 1; // Walls exist
       if (((FixWall *) modify->fix[i])->varflag ) {
-	flagwall = 2; // Moving walls exist
-	wallfix = (FixWall *) modify->fix[i];
+        flagwall = 2; // Moving walls exist
+        wallfix = (FixWall *) modify->fix[i];
       }
     }
   }
-  
+
   // set the isotropic constants depending on the volume fraction
-  // vol_T = total volumeshearing = flagdeform = flagwall = 0;  
+  // vol_T = total volumeshearing = flagdeform = flagwall = 0;
   double vol_T, wallcoord;
   if (!flagwall) vol_T = domain->xprd*domain->yprd*domain->zprd;
-  else {    
+  else {
     double wallhi[3], walllo[3];
     for (int j = 0; j < 3; j++){
       wallhi[j] = domain->prd[j];
       walllo[j] = 0;
-    }    
+    }
     for (int m = 0; m < wallfix->nwall; m++){
       int dim = wallfix->wallwhich[m] / 2;
       int side = wallfix->wallwhich[m] % 2;
       if (wallfix->wallstyle[m] == VARIABLE){
-	wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
-	// Since fix->wall->init happens after pair->init_style
-	wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+        wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
+        // Since fix->wall->init happens after pair->init_style
+        wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
       }
-      
+
       else wallcoord = wallfix->coord0[m];
-      
+
       if (side == 0) walllo[dim] = wallcoord;
       else wallhi[dim] = wallcoord;
     }
-    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) * 
+    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) *
       (wallhi[2] - walllo[2]);
   }
-   
+
   // vol_P = volume of particles, assuming mono-dispersity
   // vol_f = volume fraction
 
   vol_P = atom->natoms*(4.0/3.0)*MY_PI*pow(rad,3.0);
-  
+
   double vol_f = vol_P/vol_T;
-  
+
   // set isotropic constants
   if (!flagVF) vol_f = 0;
 
@@ -553,7 +553,7 @@ void PairBrownian::init_style()
     RT0 = 8*MY_PI*mu*pow(rad,3.0);  // not actually needed
   } else {
     R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-    RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);     
+    RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
   }
 }
 
@@ -574,7 +574,7 @@ double PairBrownian::init_one(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairBrownian::write_restart(FILE *fp)
@@ -586,8 +586,8 @@ void PairBrownian::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&cut_inner[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&cut_inner[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -608,12 +608,12 @@ void PairBrownian::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&cut_inner[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&cut_inner[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -678,11 +678,11 @@ void PairBrownian::read_restart_settings(FILE *fp)
 /* ----------------------------------------------------------------------*/
 
 void PairBrownian::set_3_orthogonal_vectors(double p1[3],
-					    double p2[3], double p3[3])
+                                            double p2[3], double p3[3])
 {
   double norm;
   int ix,iy,iz;
-  
+
   // find the index of maximum magnitude and store it in iz
 
   if (fabs(p1[0]) > fabs(p1[1])) {
@@ -694,7 +694,7 @@ void PairBrownian::set_3_orthogonal_vectors(double p1[3],
     ix=2;
     iy=0;
   }
-    
+
   if (iz==0) {
     if (fabs(p1[0]) < fabs(p1[2])) {
       iz = 2;
@@ -708,24 +708,24 @@ void PairBrownian::set_3_orthogonal_vectors(double p1[3],
       iy = 1;
     }
   }
-    
+
   // set p2 arbitrarily such that it's orthogonal to p1
 
   p2[ix]=1.0;
-  p2[iy]=1.0; 
+  p2[iy]=1.0;
   p2[iz] = -(p1[ix]*p2[ix] + p1[iy]*p2[iy])/p1[iz];
-      
+
   // normalize p2
 
   norm = sqrt(p2[0]*p2[0] + p2[1]*p2[1] + p2[2]*p2[2]);
-              
+
   p2[0] = p2[0]/norm;
   p2[1] = p2[1]/norm;
   p2[2] = p2[2]/norm;
-      
+
   // Set p3 by taking the cross product p3=p2xp1
 
   p3[0] = p1[1]*p2[2] - p1[2]*p2[1];
   p3[1] = p1[2]*p2[0] - p1[0]*p2[2];
-  p3[2] = p1[0]*p2[1] - p1[1]*p2[0]; 
+  p3[2] = p1[0]*p2[1] - p1[1]*p2[0];
 }
diff --git a/src/FLD/pair_brownian.h b/src/FLD/pair_brownian.h
index 97b7b8cb7b..99fad06a14 100644
--- a/src/FLD/pair_brownian.h
+++ b/src/FLD/pair_brownian.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -28,7 +28,7 @@ class PairBrownian : public Pair {
  public:
   PairBrownian(class LAMMPS *);
   virtual ~PairBrownian();
-  virtual void compute(int, int); 
+  virtual void compute(int, int);
   void settings(int, char **);
   void coeff(int, char **);
   virtual double init_one(int, int);
@@ -36,7 +36,7 @@ class PairBrownian : public Pair {
   void write_restart(FILE *);
   void read_restart(FILE *);
   void write_restart_settings(FILE *);
-  void read_restart_settings(FILE *); 
+  void read_restart_settings(FILE *);
 
  protected:
   double cut_inner_global,cut_global;
diff --git a/src/FLD/pair_brownian_poly.cpp b/src/FLD/pair_brownian_poly.cpp
index eeec6e33fc..379f2a7ce9 100644
--- a/src/FLD/pair_brownian_poly.cpp
+++ b/src/FLD/pair_brownian_poly.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -81,7 +81,7 @@ void PairBrownianPoly::compute(int eflag, int vflag)
   double prethermostat;
   double xl[3],a_sq,a_sh,a_pu,Fbmag;
   double p1[3],p2[3],p3[3];
-  
+
 
   // This section of code adjusts R0/RT0/RS0 if necessary due to changes
   // in the volume fraction as a result of fix deform or moving walls
@@ -90,37 +90,37 @@ void PairBrownianPoly::compute(int eflag, int vflag)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	double wallhi[3], walllo[3];
-	for (j = 0; j < 3; j++){
-	  wallhi[j] = domain->prd[j];
-	  walllo[j] = 0;
-	}    
-	for (int m = 0; m < wallfix->nwall; m++){
-	  int dim = wallfix->wallwhich[m] / 2;
-	  int side = wallfix->wallwhich[m] % 2;
-	  if (wallfix->wallstyle[m] == VARIABLE){
-	    wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	  }	   
-	  else wallcoord = wallfix->coord0[m];	   
-	  if (side == 0) walllo[dim] = wallcoord;
-	  else wallhi[dim] = wallcoord;	   
-	}
-	for (j = 0; j < 3; j++)
-	  dims[j] = wallhi[j] - walllo[j];
+        double wallhi[3], walllo[3];
+        for (j = 0; j < 3; j++){
+          wallhi[j] = domain->prd[j];
+          walllo[j] = 0;
+        }
+        for (int m = 0; m < wallfix->nwall; m++){
+          int dim = wallfix->wallwhich[m] / 2;
+          int side = wallfix->wallwhich[m] % 2;
+          if (wallfix->wallstyle[m] == VARIABLE){
+            wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+          }
+          else wallcoord = wallfix->coord0[m];
+          if (side == 0) walllo[dim] = wallcoord;
+          else wallhi[dim] = wallcoord;
+        }
+        for (j = 0; j < 3; j++)
+          dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0);
-	//RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0);
+        //RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	//RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        //RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
   // scale factor for Brownian moments
@@ -142,8 +142,8 @@ void PairBrownianPoly::compute(int eflag, int vflag)
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];       
-    
+    jnum = numneigh[i];
+
     // FLD contribution to force and torque due to isotropic terms
 
     if (flagfld) {
@@ -151,16 +151,16 @@ void PairBrownianPoly::compute(int eflag, int vflag)
       f[i][1] += prethermostat*sqrt(R0*radi)*(random->uniform()-0.5);
       f[i][2] += prethermostat*sqrt(R0*radi)*(random->uniform()-0.5);
       if (flaglog) {
-	const double radi3 = radi*radi*radi;
-	torque[i][0] += prethermostat*sqrt(RT0*radi3) * 
-	  (random->uniform()-0.5);
-	torque[i][1] += prethermostat*sqrt(RT0*radi3) * 
-	  (random->uniform()-0.5);
-	torque[i][2] += prethermostat*sqrt(RT0*radi3) * 
-	  (random->uniform()-0.5);
+        const double radi3 = radi*radi*radi;
+        torque[i][0] += prethermostat*sqrt(RT0*radi3) *
+          (random->uniform()-0.5);
+        torque[i][1] += prethermostat*sqrt(RT0*radi3) *
+          (random->uniform()-0.5);
+        torque[i][2] += prethermostat*sqrt(RT0*radi3) *
+          (random->uniform()-0.5);
       }
     }
-    
+
     if (!flagHI) continue;
 
     for (jj = 0; jj < jnum; jj++) {
@@ -175,99 +175,99 @@ void PairBrownianPoly::compute(int eflag, int vflag)
       radj = radius[j];
 
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);      
-          
+        r = sqrt(rsq);
+
         // scalar resistances a_sq and a_sh
 
         h_sep = r - radi-radj;
-        
+
         // check for overlaps
 
         if (h_sep < 0.0) overlaps++;
-        
+
         // if less than minimum gap, use minimum gap instead
 
         if (r < cut_inner[itype][jtype])
           h_sep = cut_inner[itype][jtype] - radi-radj;
-        
+
         // scale h_sep by radi
 
         h_sep = h_sep/radi;
         beta0 = radj/radi;
         beta1 = 1.0 + beta0;
-  
+
         // scalar resistances
 
         if (flaglog) {
-          a_sq = beta0*beta0/beta1/beta1/h_sep + 
-	    (1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3.0)*log(1.0/h_sep);
-          a_sq += (1.0+18.0*beta0-29.0*beta0*beta0+18.0*pow(beta0,3.0) + 
-		   pow(beta0,4.0))/21.0/pow(beta1,4.0)*h_sep*log(1.0/h_sep);
+          a_sq = beta0*beta0/beta1/beta1/h_sep +
+            (1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3.0)*log(1.0/h_sep);
+          a_sq += (1.0+18.0*beta0-29.0*beta0*beta0+18.0*pow(beta0,3.0) +
+                   pow(beta0,4.0))/21.0/pow(beta1,4.0)*h_sep*log(1.0/h_sep);
           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.0) * 
-	    log(1.0/h_sep);
-          a_sh += 4.0*(16.0-45.0*beta0+58.0*beta0*beta0-45.0*pow(beta0,3.0) + 
-		       16.0*pow(beta0,4.0))/375.0/pow(beta1,4.0) * 
-	    h_sep*log(1.0/h_sep);
+          a_sh = 4.0*beta0*(2.0+beta0+2.0*beta0*beta0)/15.0/pow(beta1,3.0) *
+            log(1.0/h_sep);
+          a_sh += 4.0*(16.0-45.0*beta0+58.0*beta0*beta0-45.0*pow(beta0,3.0) +
+                       16.0*pow(beta0,4.0))/375.0/pow(beta1,4.0) *
+            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.0))/250.0/pow(beta1,3.0)*h_sep*log(1.0/h_sep);
+          a_pu += (32.0-33.0*beta0+83.0*beta0*beta0+43.0 *
+                   pow(beta0,3.0))/250.0/pow(beta1,3.0)*h_sep*log(1.0/h_sep);
           a_pu *= 8.0*MY_PI*mu*pow(radi,3.0);
 
         } else a_sq = 6.0*MY_PI*mu*radi*(beta0*beta0/beta1/beta1/h_sep);
-         
+
         // generate the Pairwise Brownian Force: a_sq
 
         Fbmag = prethermostat*sqrt(a_sq);
-        
+
         // generate a random number
 
         randr = random->uniform()-0.5;
-          
+
         // contribution due to Brownian motion
 
         fx = Fbmag*randr*delx/r;
         fy = Fbmag*randr*dely/r;
         fz = Fbmag*randr*delz/r;
-        
+
         // add terms due to a_sh
 
         if (flaglog) {
 
           // generate two orthogonal vectors to the line of centers
 
-          p1[0] = delx/r; p1[1] = dely/r; p1[2] = delz/r;                    
+          p1[0] = delx/r; p1[1] = dely/r; p1[2] = delz/r;
           set_3_orthogonal_vectors(p1,p2,p3);
-          
+
           // magnitude
 
-          Fbmag = prethermostat*sqrt(a_sh);          
-          
+          Fbmag = prethermostat*sqrt(a_sh);
+
           // force in each of the two directions
 
           randr = random->uniform()-0.5;
           fx += Fbmag*randr*p2[0];
           fy += Fbmag*randr*p2[1];
           fz += Fbmag*randr*p2[2];
-          
+
           randr = random->uniform()-0.5;
           fx += Fbmag*randr*p3[0];
           fy += Fbmag*randr*p3[1];
-          fz += Fbmag*randr*p3[2];          
-        }       
-        
+          fz += Fbmag*randr*p3[2];
+        }
+
         // scale forces to appropriate units
 
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
+
         // sum to total Force
 
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;   
+        f[i][2] -= fz;
 
         // torque due to the Brownian Force
 
@@ -278,47 +278,47 @@ void PairBrownianPoly::compute(int eflag, int vflag)
           xl[0] = -delx/r*radi;
           xl[1] = -dely/r*radi;
           xl[2] = -delz/r*radi;
-          
+
           // torque = xl_cross_F
 
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;              
-        
+          tz = xl[0]*fy - xl[1]*fx;
+
           // torque is same on both particles
 
           torque[i][0] -= tx;
           torque[i][1] -= ty;
-          torque[i][2] -= tz;          
-        
+          torque[i][2] -= tz;
+
           // torque due to a_pu
 
-          Fbmag = prethermostat*sqrt(a_pu);         
-          
+          Fbmag = prethermostat*sqrt(a_pu);
+
           // force in each direction
 
           randr = random->uniform()-0.5;
           tx = Fbmag*randr*p2[0];
           ty = Fbmag*randr*p2[1];
           tz = Fbmag*randr*p2[2];
-          
+
           randr = random->uniform()-0.5;
           tx += Fbmag*randr*p3[0];
           ty += Fbmag*randr*p3[1];
-          tz += Fbmag*randr*p3[2];    
-          
+          tz += Fbmag*randr*p3[2];
+
           // torque has opposite sign on two particles
 
           torque[i][0] -= tx;
           torque[i][1] -= ty;
-          torque[i][2] -= tz;          
-        
+          torque[i][2] -= tz;
+
         }
 
-	// set j = nlocal so that only I gets tallied
+        // set j = nlocal so that only I gets tallied
 
         if (evflag) ev_tally_xyz(i,nlocal,nlocal,0,
-				 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
+                                 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
       }
     }
   }
@@ -343,61 +343,61 @@ void PairBrownianPoly::init_style()
   int nlocal = atom->nlocal;
 
   for (int i = 0; i < nlocal; i++)
-    if (radius[i] == 0.0) 
+    if (radius[i] == 0.0)
       error->one(FLERR,"Pair brownian/poly requires extended particles");
 
   int irequest = neighbor->request(this);
   neighbor->requests[irequest]->half = 0;
   neighbor->requests[irequest]->full = 1;
-  
+
   // set the isotropic constants that depend on the volume fraction
   // vol_T = total volume
   double vol_T, wallcoord;
   if (!flagwall) vol_T = domain->xprd*domain->yprd*domain->zprd;
-  else {    
+  else {
     double wallhi[3], walllo[3];
     for (int j = 0; j < 3; j++){
       wallhi[j] = domain->prd[j];
       walllo[j] = 0;
-    }    
+    }
     for (int m = 0; m < wallfix->nwall; m++){
       int dim = wallfix->wallwhich[m] / 2;
       int side = wallfix->wallwhich[m] % 2;
       if (wallfix->wallstyle[m] == VARIABLE){
-	wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
-	// Since fix->wall->init happens after pair->init_style
-	wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+        wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
+        // Since fix->wall->init happens after pair->init_style
+        wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
       }
-      
+
       else wallcoord = wallfix->coord0[m];
-      
+
       if (side == 0) walllo[dim] = wallcoord;
       else wallhi[dim] = wallcoord;
     }
-    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) * 
+    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) *
       (wallhi[2] - walllo[2]);
   }
 
-  
+
   // vol_P = volume of particles, assuming mono-dispersity
   // vol_f = volume fraction
 
   double volP = 0.0;
   for (int i = 0; i < nlocal; i++)
-    volP += (4.0/3.0)*MY_PI*pow(atom->radius[i],3.0); 
+    volP += (4.0/3.0)*MY_PI*pow(atom->radius[i],3.0);
   MPI_Allreduce(&volP,&vol_P,1,MPI_DOUBLE,MPI_SUM,world);
 
   double vol_f = vol_P/vol_T;
 
   if (!flagVF) vol_f = 0;
   // set isotropic constants
- 
+
   if (flaglog == 0) {
     R0  = 6*MY_PI*mu*(1.0 + 2.16*vol_f);
     RT0 = 8*MY_PI*mu;
   } else {
     R0  = 6*MY_PI*mu*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-    RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);     
+    RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
   }
 }
 
@@ -412,6 +412,6 @@ double PairBrownianPoly::init_one(int i, int j)
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
   }
 
-  cut_inner[j][i] = cut_inner[i][j]; 
+  cut_inner[j][i] = cut_inner[i][j];
   return cut[i][j];
 }
diff --git a/src/FLD/pair_brownian_poly.h b/src/FLD/pair_brownian_poly.h
index 98dd18ce5c..f4bbb2ea56 100644
--- a/src/FLD/pair_brownian_poly.h
+++ b/src/FLD/pair_brownian_poly.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -28,7 +28,7 @@ class PairBrownianPoly : public PairBrownian {
  public:
   PairBrownianPoly(class LAMMPS *);
   ~PairBrownianPoly() {}
-  void compute(int, int); 
+  void compute(int, int);
   double init_one(int, int);
   void init_style();
 };
diff --git a/src/FLD/pair_lubricate.cpp b/src/FLD/pair_lubricate.cpp
index 53f348b8b9..4da0b28dc5 100755
--- a/src/FLD/pair_lubricate.cpp
+++ b/src/FLD/pair_lubricate.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -84,7 +84,7 @@ void PairLubricate::compute(int eflag, int vflag)
   double xtmp,ytmp,ztmp,delx,dely,delz,fpair,fx,fy,fz,tx,ty,tz;
   double rsq,r,h_sep,radi,tfmag;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3,wt1,wt2,wt3,wdotn;  
+  double vt1,vt2,vt3,wt1,wt2,wt3,wdotn;
   double inertia,inv_inertia,vRS0;
   double vi[3],vj[3],wi[3],wj[3],xl[3];
   double a_sq,a_sh,a_pu,Fbmag,del,delmin,eta;
@@ -110,7 +110,7 @@ void PairLubricate::compute(int eflag, int vflag)
   int newton_pair = force->newton_pair;
 
   int overlaps = 0;
-    
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
@@ -134,10 +134,10 @@ void PairLubricate::compute(int eflag, int vflag)
       i = ilist[ii];
       itype = type[i];
       radi = radius[i];
-      
+
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
-	h_rate[4]*lamda[2] + h_ratelo[0];
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
+        h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       v[i][0] -= vstream[0];
@@ -153,7 +153,7 @@ void PairLubricate::compute(int eflag, int vflag)
 
     Ef[0][0] = h_rate[0]/domain->xprd;
     Ef[1][1] = h_rate[1]/domain->yprd;
-    Ef[2][2] = h_rate[2]/domain->zprd; 
+    Ef[2][2] = h_rate[2]/domain->zprd;
     Ef[0][1] = Ef[1][0] = 0.5 * h_rate[5]/domain->yprd;
     Ef[0][2] = Ef[2][0] = 0.5 * h_rate[4]/domain->zprd;
     Ef[1][2] = Ef[2][1] = 0.5 * h_rate[3]/domain->zprd;
@@ -163,7 +163,7 @@ void PairLubricate::compute(int eflag, int vflag)
 
     comm->forward_comm_pair(this);
   }
-  
+
   // This section of code adjusts R0/RT0/RS0 if necessary due to changes
   // in the volume fraction as a result of fix deform or moving walls
 
@@ -171,45 +171,45 @@ void PairLubricate::compute(int eflag, int vflag)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	 double wallhi[3], walllo[3];
-	 for (int j = 0; j < 3; j++){
-	   wallhi[j] = domain->prd[j];
-	   walllo[j] = 0;
-	 }    
-	 for (int m = 0; m < wallfix->nwall; m++){
-	   int dim = wallfix->wallwhich[m] / 2;
-	   int side = wallfix->wallwhich[m] % 2;
-	   if (wallfix->wallstyle[m] == VARIABLE){
-	     wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	   }	   
-	   else wallcoord = wallfix->coord0[m];	   
-	   if (side == 0) walllo[dim] = wallcoord;
-	   else wallhi[dim] = wallcoord;	   
-	 }
-	 for (int j = 0; j < 3; j++)
-	   dims[j] = wallhi[j] - walllo[j];
+         double wallhi[3], walllo[3];
+         for (int j = 0; j < 3; j++){
+           wallhi[j] = domain->prd[j];
+           walllo[j] = 0;
+         }
+         for (int m = 0; m < wallfix->nwall; m++){
+           int dim = wallfix->wallwhich[m] / 2;
+           int side = wallfix->wallwhich[m] % 2;
+           if (wallfix->wallstyle[m] == VARIABLE){
+             wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+           }
+           else wallcoord = wallfix->coord0[m];
+           if (side == 0) walllo[dim] = wallcoord;
+           else wallhi[dim] = wallcoord;
+         }
+         for (int j = 0; j < 3; j++)
+           dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0);
-	RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
-	  (1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0);
+        RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
+          (1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
-	  (1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
+          (1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
-  
+
   // end of R0 adjustment code
-  
+
 
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
@@ -219,30 +219,30 @@ void PairLubricate::compute(int eflag, int vflag)
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];   
+    jnum = numneigh[i];
 
     // angular velocity
 
     wi[0] = omega[i][0];
     wi[1] = omega[i][1];
-    wi[2] = omega[i][2];          
-     
+    wi[2] = omega[i][2];
+
     // FLD contribution to force and torque due to isotropic terms
     // FLD contribution to stress from isotropic RS0
 
     if (flagfld) {
       f[i][0] -= vxmu2f*R0*v[i][0];
       f[i][1] -= vxmu2f*R0*v[i][1];
-      f[i][2] -= vxmu2f*R0*v[i][2];    
+      f[i][2] -= vxmu2f*R0*v[i][2];
       torque[i][0] -= vxmu2f*RT0*wi[0];
       torque[i][1] -= vxmu2f*RT0*wi[1];
-      torque[i][2] -= vxmu2f*RT0*wi[2];   
+      torque[i][2] -= vxmu2f*RT0*wi[2];
 
       if (shearing && vflag_either) {
-	vRS0 = -vxmu2f * RS0;
-	v_tally_tensor(i,i,nlocal,newton_pair,
-		       vRS0*Ef[0][0],vRS0*Ef[1][1],vRS0*Ef[2][2],
-		       vRS0*Ef[0][1],vRS0*Ef[0][2],vRS0*Ef[1][2]);
+        vRS0 = -vxmu2f * RS0;
+        v_tally_tensor(i,i,nlocal,newton_pair,
+                       vRS0*Ef[0][0],vRS0*Ef[1][1],vRS0*Ef[2][2],
+                       vRS0*Ef[0][1],vRS0*Ef[0][2],vRS0*Ef[1][2]);
       }
     }
 
@@ -259,20 +259,20 @@ void PairLubricate::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-  
+        r = sqrt(rsq);
+
         // angular momentum = I*omega = 2/5 * M*R^2 * omega
-	
-	wj[0] = omega[j][0];
-	wj[1] = omega[j][1];
-	wj[2] = omega[j][2];              
+
+        wj[0] = omega[j][0];
+        wj[1] = omega[j][1];
+        wj[2] = omega[j][2];
 
         // xl = point of closest approach on particle i from its center
 
         xl[0] = -delx/r*radi;
         xl[1] = -dely/r*radi;
         xl[2] = -delz/r*radi;
-  
+
         // velocity at the point of closest approach on both particles
         // v = v + omega_cross_xl - Ef.xl
 
@@ -280,41 +280,41 @@ void PairLubricate::compute(int eflag, int vflag)
 
         vi[0] = v[i][0] + (wi[1]*xl[2] - wi[2]*xl[1])
                         - (Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
-        
+
         vi[1] = v[i][1] + (wi[2]*xl[0] - wi[0]*xl[2])
                         - (Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
-        
+
         vi[2] = v[i][2] + (wi[0]*xl[1] - wi[1]*xl[0])
                         - (Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
-  
+
         // particle j
 
         vj[0] = v[j][0] - (wj[1]*xl[2] - wj[2]*xl[1])
                         + (Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
-        
+
         vj[1] = v[j][1] - (wj[2]*xl[0] - wj[0]*xl[2])
                         + (Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
-        
+
         vj[2] = v[j][2] - (wj[0]*xl[1] - wj[1]*xl[0])
                         + (Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
-        
+
         // scalar resistances XA and YA
 
         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])
-          h_sep = cut_inner[itype][jtype] - 2.0*radi;          
-        
+          h_sep = cut_inner[itype][jtype] - 2.0*radi;
+
         // scale h_sep by radi
 
         h_sep = h_sep/radi;
-  
+
         // scalar resistances
 
         if (flaglog) {
@@ -323,14 +323,14 @@ void PairLubricate::compute(int eflag, int vflag)
           a_pu = 8.0*MY_PI*mu*pow(radi,3.0)*(3.0/160.0*log(1.0/h_sep));
         } else
           a_sq = 6.0*MY_PI*mu*radi*(1.0/4.0/h_sep);
-  
+
         // relative velocity at the point of closest approach
-	// includes fluid velocity
+        // includes fluid velocity
 
         vr1 = vi[0] - vj[0];
         vr2 = vi[1] - vj[1];
         vr3 = vi[2] - vj[2];
-        
+
         // normal component (vr.n)n
 
         vnnr = (vr1*delx + vr2*dely + vr3*delz)/r;
@@ -355,7 +355,7 @@ void PairLubricate::compute(int eflag, int vflag)
         if (flaglog) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
 
         // scale forces for appropriate units
@@ -363,65 +363,65 @@ void PairLubricate::compute(int eflag, int vflag)
         fx *= vxmu2f;
         fy *= vxmu2f;
         fz *= vxmu2f;
-        
+
         // add to total force
 
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;    
-        
+        f[i][2] -= fz;
+
         if (newton_pair || j < nlocal) {
           f[j][0] += fx;
           f[j][1] += fy;
-          f[j][2] += fz;    
+          f[j][2] += fz;
         }
-  
+
         // torque due to this force
 
         if (flaglog) {
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;                  
-    
+          tz = xl[0]*fy - xl[1]*fx;
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-            
+          torque[i][2] -= vxmu2f*tz;
+
           if (newton_pair || j < nlocal) {
             torque[j][0] -= vxmu2f*tx;
             torque[j][1] -= vxmu2f*ty;
             torque[j][2] -= vxmu2f*tz;
           }
-          
+
           // torque due to a_pu
 
-          wdotn = ((wi[0]-wj[0])*delx + (wi[1]-wj[1])*dely + 
-		   (wi[2]-wj[2])*delz)/r;
+          wdotn = ((wi[0]-wj[0])*delx + (wi[1]-wj[1])*dely +
+                   (wi[2]-wj[2])*delz)/r;
           wt1 = (wi[0]-wj[0]) - wdotn*delx/r;
           wt2 = (wi[1]-wj[1]) - wdotn*dely/r;
           wt3 = (wi[2]-wj[2]) - wdotn*delz/r;
-          
+
           tx = a_pu*wt1;
           ty = a_pu*wt2;
           tz = a_pu*wt3;
-          
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-            
+          torque[i][2] -= vxmu2f*tz;
+
           if (newton_pair || j < nlocal) {
             torque[j][0] += vxmu2f*tx;
             torque[j][1] += vxmu2f*ty;
             torque[j][2] += vxmu2f*tz;
           }
-        }        
+        }
 
         if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
-				 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
+                                 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
       }
     }
   }
-  
+
   // restore streaming component of velocity, omega, angmom
 
   if (shearing) {
@@ -432,10 +432,10 @@ void PairLubricate::compute(int eflag, int vflag)
       i = ilist[ii];
       itype = type[i];
       radi = radius[i];
-      
+
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
-	h_rate[4]*lamda[2] + h_ratelo[0];
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
+        h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       v[i][0] += vstream[0];
@@ -457,12 +457,12 @@ void PairLubricate::compute(int eflag, int vflag)
     if (overlaps_all && comm->me == 0)
       printf("Number of overlaps = %d\n",overlaps);
   }
-  
+
   if (vflag_fdotr) virial_fdotr_compute();
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLubricate::allocate()
@@ -482,7 +482,7 @@ void PairLubricate::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLubricate::settings(int narg, char **arg)
@@ -503,9 +503,9 @@ void PairLubricate::settings(int narg, char **arg)
 
   if (flaglog == 1 && flagHI == 0) {
     error->warning(FLERR,"Cannot include log terms without 1/r terms; "
-		   "setting flagHI to 1");
+                   "setting flagHI to 1");
     flagHI = 1;
-  }      
+  }
 
   // reset cutoffs that have been explicitly set
 
@@ -587,51 +587,51 @@ void PairLubricate::init_style()
   // due to walls, set volume appropriately; if walls will
   // move, set appropriate flag so that volume and v.f. corrections
   // are re-calculated at every step.
-  
+
   shearing = flagdeform = flagwall = 0;
   for (int i = 0; i < modify->nfix; i++){
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       shearing = flagdeform = 1;
-      if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP) 
-	error->all(FLERR,"Using pair lubricate with inconsistent "
-		   "fix deform remap option");
+      if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
+        error->all(FLERR,"Using pair lubricate with inconsistent "
+                   "fix deform remap option");
     }
     if (strstr(modify->fix[i]->style,"wall") != NULL){
       flagwall = 1; // Walls exist
       if (((FixWall *) modify->fix[i])->varflag ) {
-	flagwall = 2; // Moving walls exist
-	wallfix = (FixWall *) modify->fix[i];
+        flagwall = 2; // Moving walls exist
+        wallfix = (FixWall *) modify->fix[i];
       }
     }
   }
-  
+
   // set the isotropic constants that depend on the volume fraction
   // vol_T = total volume
 
   double vol_T;
   double wallcoord;
   if (!flagwall) vol_T = domain->xprd*domain->yprd*domain->zprd;
-  else {    
+  else {
     double wallhi[3], walllo[3];
     for (int j = 0; j < 3; j++){
       wallhi[j] = domain->prd[j];
       walllo[j] = 0;
-    }    
+    }
     for (int m = 0; m < wallfix->nwall; m++){
       int dim = wallfix->wallwhich[m] / 2;
       int side = wallfix->wallwhich[m] % 2;
       if (wallfix->wallstyle[m] == VARIABLE){
-	wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
-	//Since fix->wall->init happens after pair->init_style
-	wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+        wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
+        //Since fix->wall->init happens after pair->init_style
+        wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
       }
 
       else wallcoord = wallfix->coord0[m];
-      
+
       if (side == 0) walllo[dim] = wallcoord;
       else wallhi[dim] = wallcoord;
     }
-    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) * 
+    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) *
       (wallhi[2] - walllo[2]);
   }
 
@@ -642,16 +642,16 @@ void PairLubricate::init_style()
   double vol_f = vol_P/vol_T;
 
   if (!flagVF) vol_f = 0;
-  
+
   // set isotropic constants for FLD
- 
+
   if (flaglog == 0) {
     R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
     RT0 = 8*MY_PI*mu*pow(rad,3.0);
     RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
   } else {
     R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-    RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
+    RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
     RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
   }
 
@@ -680,7 +680,7 @@ double PairLubricate::init_one(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairLubricate::write_restart(FILE *fp)
@@ -692,8 +692,8 @@ void PairLubricate::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&cut_inner[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&cut_inner[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -714,12 +714,12 @@ void PairLubricate::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&cut_inner[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&cut_inner[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -757,7 +757,7 @@ void PairLubricate::read_restart_settings(FILE *fp)
     fread(&offset_flag,sizeof(int),1,fp);
     fread(&mix_flag,sizeof(int),1,fp);
     fread(&flagHI,sizeof(int),1,fp);
-    fread(&flagVF,sizeof(int),1,fp); 
+    fread(&flagVF,sizeof(int),1,fp);
   }
   MPI_Bcast(&mu,1,MPI_DOUBLE,0,world);
   MPI_Bcast(&flaglog,1,MPI_INT,0,world);
@@ -773,7 +773,7 @@ void PairLubricate::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 int PairLubricate::pack_comm(int n, int *list, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   int i,j,m;
 
@@ -834,7 +834,7 @@ int PairLubricate::pre_adapt(char *name, int ilo, int ihi, int jlo, int jhi)
 ------------------------------------------------------------------------- */
 
 void PairLubricate::adapt(int which, int ilo, int ihi, int jlo, int jhi,
-			  double value)
+                          double value)
 {
   mu = value;
 }
diff --git a/src/FLD/pair_lubricate.h b/src/FLD/pair_lubricate.h
index 3db8e92b38..eb2d3ee228 100644
--- a/src/FLD/pair_lubricate.h
+++ b/src/FLD/pair_lubricate.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/FLD/pair_lubricateU.cpp b/src/FLD/pair_lubricateU.cpp
index 419ac3fcbe..bbb89b3f02 100644
--- a/src/FLD/pair_lubricateU.cpp
+++ b/src/FLD/pair_lubricateU.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -108,7 +108,7 @@ PairLubricateU::~PairLubricateU()
 
 void PairLubricateU::compute(int eflag, int vflag)
 {
-  int i,j,ii,jj,inum,jnum,itype,jtype; 
+  int i,j,ii,jj,inum,jnum,itype,jtype;
 
   double **x = atom->x;
   double **v = atom->v;
@@ -122,7 +122,7 @@ void PairLubricateU::compute(int eflag, int vflag)
 
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   // skip compute() if called from integrate::setup()
   // this is b/c do not want compute() to update velocities twice on a restart
   // when restarting, call compute on step N (last step of prev run),
@@ -155,16 +155,16 @@ void PairLubricateU::compute(int eflag, int vflag)
       xl[i][j] = x[i][j];
     }
   }
-  
+
   // Stage one of Midpoint method
   // Solve for velocities based on intial positions
 
   stage_one();
-  
+
   // find positions at half the timestep and store in xl
 
   intermediates(nall,xl);
-  
+
   // store back the saved forces and torques in original arrays
 
   for(i=0;i<nlocal+nghost;i++) {
@@ -173,10 +173,10 @@ void PairLubricateU::compute(int eflag, int vflag)
       torque[i][j] = Tl[i][j];
     }
   }
-  
+
   // stage two: this will give the final velocities
 
-  stage_two(xl);  
+  stage_two(xl);
 }
 
 /* ------------------------------------------------------------------------
@@ -185,8 +185,8 @@ void PairLubricateU::compute(int eflag, int vflag)
 
 void PairLubricateU::stage_one()
 {
-  int i,j,ii,jj,inum,jnum,itype,jtype; 
-  
+  int i,j,ii,jj,inum,jnum,itype,jtype;
+
   double **x = atom->x;
   double **v = atom->v;
   double **f = atom->f;
@@ -201,13 +201,13 @@ void PairLubricateU::stage_one()
   double vxmu2f = force->vxmu2f;
   double inv_inertia,mo_inertia;
   int *ilist;
-  
+
   double radi;
   int nprocs = comm->nprocs;
-  
+
   inum = list->inum;
   ilist = list->ilist;
-  
+
   if (6*inum > cgmax) {
     memory->destroy(bcg);
     memory->destroy(xcg);
@@ -227,149 +227,149 @@ void PairLubricateU::stage_one()
   double alpha,beta;
   double normi,error,normig;
   double send[2],recv[2],rcg_dot_rcg;
-  
-  // First compute R_FE*E  
+
+  // First compute R_FE*E
 
   compute_RE();
-  
-  // Reverse communication of forces and torques to 
+
+  // Reverse communication of forces and torques to
   // accumulate the net force on each of the particles
-  
+
   if (newton_pair) comm->reverse_comm();
-  
+
   // CONJUGATE GRADIENT
   // Find the right hand side= -ve of all forces/torques
   // b = 6*Npart in overall size
-  
+
   for(ii = 0; ii < inum; ii++) {
-    i = ilist[ii];  
+    i = ilist[ii];
     for (j = 0; j < 3; j++) {
       bcg[6*ii+j] = -f[i][j];
-      bcg[6*ii+j+3] = -torque[i][j];  
+      bcg[6*ii+j+3] = -torque[i][j];
     }
-  } 
-  
-  // Start solving the equation : F^H = -F^P -F^B - F^H_{Ef}   
+  }
+
+  // Start solving the equation : F^H = -F^P -F^B - F^H_{Ef}
   // Store initial guess for velocity and angular-velocities/angular momentum
   // NOTE velocities and angular velocities are assumed relative to the fluid
-  
+
   for (ii=0;ii<inum;ii++)
-    for (j=0;j<3;j++) {      
+    for (j=0;j<3;j++) {
       xcg[6*ii+j] = 0.0;
-      xcg[6*ii+j+3] = 0.0;       
+      xcg[6*ii+j+3] = 0.0;
     }
-  
+
   // Copy initial guess to the global arrays to be acted upon by R_{FU}
   // and returned by f and torque arrays
-  
+
   copy_vec_uo(inum,xcg,v,omega);
-  
+
   // set velocities for ghost particles
-  
+
   comm->forward_comm_pair(this);
-  
+
   // Find initial residual
-  
+
   compute_RU();
-  
+
   // reverse communication of forces and torques
-  
+
   if (newton_pair) comm->reverse_comm();
-  
+
   copy_uo_vec(inum,f,torque,RU);
-  
+
   for (i=0;i<6*inum;i++)
     rcg[i] = bcg[i] - RU[i];
-  
+
   // Set initial conjugate direction
-  
+
   for (i=0;i<6*inum;i++)
     pcg[i] = rcg[i];
-  
+
   // Find initial norm of the residual or norm of the RHS (either is fine)
-  
+
   normi = dot_vec_vec(6*inum,bcg,bcg);
-  
+
   MPI_Allreduce(&normi,&normig,1,MPI_DOUBLE,MPI_SUM,world);
-  
+
   // Loop until convergence
-  
-  do {    
+
+  do {
     // find R*p
-    
+
     copy_vec_uo(inum,pcg,v,omega);
-    
-    // set velocities for ghost particles   
-    
+
+    // set velocities for ghost particles
+
     comm->forward_comm_pair(this);
-    
+
     compute_RU();
-    
+
     // reverse communication of forces and torques
-    
+
     if (newton_pair) comm->reverse_comm();
-    
-    
-    copy_uo_vec(inum,f,torque,RU);  
-    
+
+
+    copy_uo_vec(inum,f,torque,RU);
+
     // Find alpha
-    
+
     send[0] = dot_vec_vec(6*inum,rcg,rcg);
     send[1] = dot_vec_vec(6*inum,RU,pcg);
-    
+
     MPI_Allreduce(send,recv,2,MPI_DOUBLE,MPI_SUM,world);
-    
+
     alpha = recv[0]/recv[1];
     rcg_dot_rcg = recv[0];
-    
+
     // Find new x
-    
+
     for (i=0;i<6*inum;i++)
       xcg[i] = xcg[i] + alpha*pcg[i];
-    
+
     // find new residual
-    
+
     for (i=0;i<6*inum;i++)
       rcg1[i] = rcg[i] - alpha*RU[i];
-    
+
     // find beta
-    
+
     send[0] = dot_vec_vec(6*inum,rcg1,rcg1);
-    
+
     MPI_Allreduce(send,recv,1,MPI_DOUBLE,MPI_SUM,world);
-    
+
     beta = recv[0]/rcg_dot_rcg;
-    
+
     // Find new conjugate direction
-    
+
     for (i=0;i<6*inum;i++)
       pcg[i] = rcg1[i] + beta*pcg[i];
-    
+
     for (i=0;i<6*inum;i++)
       rcg[i] = rcg1[i];
-    
+
     // Find relative error
-    
-    error = sqrt(recv[0]/normig);    
-    
-  } while (error > TOL);  
-  
+
+    error = sqrt(recv[0]/normig);
+
+  } while (error > TOL);
+
   // update the final converged velocities in respective arrays
-  
+
   copy_vec_uo(inum,xcg,v,omega);
 
-  // set velocities for ghost particles  
+  // set velocities for ghost particles
 
   comm->forward_comm_pair(this);
-  
-  // Find actual particle's velocities from relative velocities 
-  // Only non-zero component of fluid's vel : vx=gdot*y and wz=-gdot/2  
+
+  // Find actual particle's velocities from relative velocities
+  // Only non-zero component of fluid's vel : vx=gdot*y and wz=-gdot/2
 
   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;
   }
@@ -385,7 +385,7 @@ void PairLubricateU::intermediates(int nall, double **xl)
   double **x = atom->x;
   double **v = atom->v;
   double dtv = update->dt;
-  
+
   for (i=0;i<nall;i++) {
     xl[i][0] = x[i][0] + 0.5*dtv*v[i][0];
     xl[i][1] = x[i][1] + 0.5*dtv*v[i][1];
@@ -399,7 +399,7 @@ void PairLubricateU::intermediates(int nall, double **xl)
 
 void PairLubricateU::stage_two(double **x)
 {
-  int i,j,ii,jj,inum,jnum,itype,jtype; 
+  int i,j,ii,jj,inum,jnum,itype,jtype;
   double **v = atom->v;
   double **f = atom->f;
   double **omega = atom->omega;
@@ -413,163 +413,163 @@ void PairLubricateU::stage_two(double **x)
   double vxmu2f = force->vxmu2f;
   double inv_inertia,mo_inertia;
   int *ilist;
-  
+
   double radi;
   int nprocs = comm->nprocs;
-  
+
   inum = list->inum;
   ilist = list->ilist;
-  
+
   double alpha,beta;
   double normi,error,normig;
   double send[2],recv[2],rcg_dot_rcg;
-  
-  // First compute R_FE*E  
+
+  // First compute R_FE*E
 
   compute_RE(x);
-  
-  // Reverse communication of forces and torques to 
+
+  // Reverse communication of forces and torques to
   // accumulate the net force on each of the particles
-  
+
   if (newton_pair) comm->reverse_comm();
-  
+
   // CONJUGATE GRADIENT
   // Find the right hand side= -ve of all forces/torques
   // b = 6*Npart in overall size
-  
+
   for(ii = 0; ii < inum; ii++) {
-    i = ilist[ii];  
+    i = ilist[ii];
     for (j = 0; j < 3; j++) {
       bcg[6*ii+j] = -f[i][j];
-      bcg[6*ii+j+3] = -torque[i][j];  
+      bcg[6*ii+j+3] = -torque[i][j];
     }
-  } 
-  
-  // Start solving the equation : F^H = -F^P -F^B - F^H_{Ef}   
+  }
+
+  // Start solving the equation : F^H = -F^P -F^B - F^H_{Ef}
   // Store initial guess for velocity and angular-velocities/angular momentum
   // NOTE velocities and angular velocities are assumed relative to the fluid
-  
+
   for (ii=0;ii<inum;ii++)
-    for (j=0;j<3;j++) {      
+    for (j=0;j<3;j++) {
       xcg[6*ii+j] = 0.0;
-      xcg[6*ii+j+3] = 0.0;       
+      xcg[6*ii+j+3] = 0.0;
     }
-  
+
   // Copy initial guess to the global arrays to be acted upon by R_{FU}
   // and returned by f and torque arrays
-  
+
   copy_vec_uo(inum,xcg,v,omega);
-  
+
   // set velocities for ghost particles
-  
+
   comm->forward_comm_pair(this);
-  
+
   // Find initial residual
-  
+
   compute_RU(x);
-  
+
   // reverse communication of forces and torques
-  
+
   if (newton_pair) comm->reverse_comm();
-  
+
   copy_uo_vec(inum,f,torque,RU);
-  
+
   for (i=0;i<6*inum;i++)
     rcg[i] = bcg[i] - RU[i];
-  
+
   // Set initial conjugate direction
-  
+
   for (i=0;i<6*inum;i++)
     pcg[i] = rcg[i];
-  
+
   // Find initial norm of the residual or norm of the RHS (either is fine)
-  
+
   normi = dot_vec_vec(6*inum,bcg,bcg);
-  
+
   MPI_Allreduce(&normi,&normig,1,MPI_DOUBLE,MPI_SUM,world);
-  
+
   // Loop until convergence
-  
-  do {    
+
+  do {
     // find R*p
-    
+
     copy_vec_uo(inum,pcg,v,omega);
-    
-    // set velocities for ghost particles   
-    
+
+    // set velocities for ghost particles
+
     comm->forward_comm_pair(this);
-    
+
     compute_RU(x);
-    
+
     // reverse communication of forces and torques
-    
+
     if (newton_pair) comm->reverse_comm();
-    
-    copy_uo_vec(inum,f,torque,RU);  
-    
+
+    copy_uo_vec(inum,f,torque,RU);
+
     // Find alpha
-    
+
     send[0] = dot_vec_vec(6*inum,rcg,rcg);
     send[1] = dot_vec_vec(6*inum,RU,pcg);
-    
+
     MPI_Allreduce(send,recv,2,MPI_DOUBLE,MPI_SUM,world);
-    
+
     alpha = recv[0]/recv[1];
     rcg_dot_rcg = recv[0];
-    
+
     // Find new x
-    
+
     for (i=0;i<6*inum;i++)
       xcg[i] = xcg[i] + alpha*pcg[i];
-    
+
     // find new residual
-    
+
     for (i=0;i<6*inum;i++)
       rcg1[i] = rcg[i] - alpha*RU[i];
-    
+
     // find beta
-    
+
     send[0] = dot_vec_vec(6*inum,rcg1,rcg1);
-    
+
     MPI_Allreduce(send,recv,1,MPI_DOUBLE,MPI_SUM,world);
-    
+
     beta = recv[0]/rcg_dot_rcg;
-    
+
     // Find new conjugate direction
-    
+
     for (i=0;i<6*inum;i++)
       pcg[i] = rcg1[i] + beta*pcg[i];
-    
+
     for (i=0;i<6*inum;i++)
       rcg[i] = rcg1[i];
-    
+
     // Find relative error
-    
-    error = sqrt(recv[0]/normig);    
-    
-  } while (error > TOL);  
-  
-  
+
+    error = sqrt(recv[0]/normig);
+
+  } while (error > TOL);
+
+
   // update the final converged velocities in respective arrays
-  
+
   copy_vec_uo(inum,xcg,v,omega);
-  
+
   // set velocities for ghost particles
-  
+
   comm->forward_comm_pair(this);
-  
+
   // Compute the viscosity/pressure
-  
+
   if (evflag) compute_Fh(x);
-  
-  // Find actual particle's velocities from relative velocities 
+
+  // Find actual particle's velocities from relative velocities
   // Only non-zero component of fluid's vel : vx=gdot*y and wz=-gdot/2
-  
+
   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;
   }
@@ -586,10 +586,10 @@ void PairLubricateU::compute_Fh(double **x)
   double xtmp,ytmp,ztmp,delx,dely,delz,fpair,fx,fy,fz,tx,ty,tz;
   double rsq,r,h_sep,radi,tfmag;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3,wdotn,wt1,wt2,wt3;   
+  double vt1,vt2,vt3,wdotn,wt1,wt2,wt3;
   double inv_inertia;
   int *ilist,*jlist,*numneigh,**firstneigh;
-  
+
   double **v = atom->v;
   double **f = atom->f;
   double **omega = atom->omega;
@@ -603,12 +603,12 @@ void PairLubricateU::compute_Fh(double **x)
   double vxmu2f = force->vxmu2f;
   int overlaps = 0;
   double vi[3],vj[3],wi[3],wj[3],xl[3],a_sq,a_sh,a_pu,Fbmag,del,delmin,eta;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // This section of code adjusts R0/RT0/RS0 if necessary due to changes
   // in the volume fraction as a result of fix deform or moving walls
 
@@ -616,43 +616,43 @@ void PairLubricateU::compute_Fh(double **x)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	 double wallhi[3], walllo[3];
-	 for (int j = 0; j < 3; j++){
-	   wallhi[j] = domain->prd[j];
-	   walllo[j] = 0;
-	 }    
-	 for (int m = 0; m < wallfix->nwall; m++){
-	   int dim = wallfix->wallwhich[m] / 2;
-	   int side = wallfix->wallwhich[m] % 2;
-	   if (wallfix->wallstyle[m] == VARIABLE){
-	     wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	   }	   
-	   else wallcoord = wallfix->coord0[m];	   
-	   if (side == 0) walllo[dim] = wallcoord;
-	   else wallhi[dim] = wallcoord;	   
-	 }
-	 for (int j = 0; j < 3; j++)
-	   dims[j] = wallhi[j] - walllo[j];
+         double wallhi[3], walllo[3];
+         for (int j = 0; j < 3; j++){
+           wallhi[j] = domain->prd[j];
+           walllo[j] = 0;
+         }
+         for (int m = 0; m < wallfix->nwall; m++){
+           int dim = wallfix->wallwhich[m] / 2;
+           int side = wallfix->wallwhich[m] % 2;
+           if (wallfix->wallstyle[m] == VARIABLE){
+             wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+           }
+           else wallcoord = wallfix->coord0[m];
+           if (side == 0) walllo[dim] = wallcoord;
+           else wallhi[dim] = wallcoord;
+         }
+         for (int j = 0; j < 3; j++)
+           dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	//	R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
-	//	RT0 = 8*MY_PI*mu*pow(rad,3);
-	RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
-	  (1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        //        R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
+        //        RT0 = 8*MY_PI*mu*pow(rad,3);
+        RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
+          (1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	//	R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	//	RT0 = 8*MY_PI*mu*pow(rad,3)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
-	  (1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        //        R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        //        RT0 = 8*MY_PI*mu*pow(rad,3)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
+          (1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
- 
+
   // end of R0 adjustment code
 
   // Set force to zero which is the final value after this pair interaction
@@ -661,11 +661,11 @@ void PairLubricateU::compute_Fh(double **x)
       f[i][j] = 0.0;
       torque[i][j] = 0.0;
     }
-  
+
   // reverse communication of forces and torques
 
   if (newton_pair) comm->reverse_comm(); // not really needed
-  
+
   // Find additional contribution from the stresslets
 
   for (ii = 0; ii < inum; ii++) {
@@ -676,8 +676,8 @@ void PairLubricateU::compute_Fh(double **x)
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];   
-    
+    jnum = numneigh[i];
+
     // Find the contribution to stress from isotropic RS0
     // Set psuedo force to obtain the required contribution
     // need to set delx  and fy only
@@ -687,15 +687,15 @@ void PairLubricateU::compute_Fh(double **x)
     fz = 0.0; delz = 0.0;
     if (evflag)
       ev_tally_xyz(i,i,nlocal,newton_pair,0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
-    
+
     // Find angular velocity
 
     wi[0] = omega[i][0];
     wi[1] = omega[i][1];
-    wi[2] = omega[i][2];          
-    
+    wi[2] = omega[i][2];
+
     if (!flagHI) continue;
-    
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
@@ -705,23 +705,23 @@ void PairLubricateU::compute_Fh(double **x)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-        
+        r = sqrt(rsq);
+
         // Use omega directly if it exists, else angmom
         // angular momentum = I*omega = 2/5 * M*R^2 * omega
-        
-	wj[0] = omega[j][0];
-	wj[1] = omega[j][1];
-	wj[2] = omega[j][2];              
-        
+
+        wj[0] = omega[j][0];
+        wj[1] = omega[j][1];
+        wj[2] = omega[j][2];
+
         // loc of the point of closest approach on particle i from its cente
 
         xl[0] = -delx/r*radi;
         xl[1] = -dely/r*radi;
         xl[2] = -delz/r*radi;
-        
+
         // velocity at the point of closest approach on both particles
         // v = v + omega_cross_xl
 
@@ -730,54 +730,54 @@ void PairLubricateU::compute_Fh(double **x)
         vi[0] = v[i][0] + (wi[1]*xl[2] - wi[2]*xl[1]);
         vi[1] = v[i][1] + (wi[2]*xl[0] - wi[0]*xl[2]);
         vi[2] = v[i][2] + (wi[0]*xl[1] - wi[1]*xl[0]);
-        
+
         // particle j
 
         vj[0] = v[j][0] - (wj[1]*xl[2] - wj[2]*xl[1]);
         vj[1] = v[j][1] - (wj[2]*xl[0] - wj[0]*xl[2]);
         vj[2] = v[j][2] - (wj[0]*xl[1] - wj[1]*xl[0]);
-        
-        
+
+
         // Relative  velocity at the point of closest approach
-	// include contribution from Einf of the fluid
-
-        vr1 = vi[0] - vj[0] - 
-	  2.0*(Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
-        vr2 = vi[1] - vj[1] - 
-	  2.0*(Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
-        vr3 = vi[2] - vj[2] - 
-	  2.0*(Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
-        
+        // include contribution from Einf of the fluid
+
+        vr1 = vi[0] - vj[0] -
+          2.0*(Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
+        vr2 = vi[1] - vj[1] -
+          2.0*(Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
+        vr3 = vi[2] - vj[2] -
+          2.0*(Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
+
         // Normal component (vr.n)n
 
         vnnr = (vr1*delx + vr2*dely + vr3*delz)/r;
         vn1 = vnnr*delx/r;
         vn2 = vnnr*dely/r;
         vn3 = vnnr*delz/r;
-        
+
         // Tangential component vr - (vr.n)n
 
         vt1 = vr1 - vn1;
         vt2 = vr2 - vn2;
         vt3 = vr3 - vn3;
-        
+
         // Find the scalar resistances a_sq, a_sh and a_pu
 
         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])
-          h_sep = cut_inner[itype][jtype] - 2.0*radi;          
-        
+          h_sep = cut_inner[itype][jtype] - 2.0*radi;
+
         // Scale h_sep by radi
 
         h_sep = h_sep/radi;
-        
+
         // Scalar resistances
 
         if (flaglog) {
@@ -785,45 +785,45 @@ void PairLubricateU::compute_Fh(double **x)
           a_sh = 6.0*MY_PI*mu*radi*(1.0/6.0*log(1.0/h_sep));
         } else
           a_sq = 6.0*MY_PI*mu*radi*(1.0/4.0/h_sep);
-                
+
         // Find force due to squeeze type motion
 
         fx  = a_sq*vn1;
         fy  = a_sq*vn2;
         fz  = a_sq*vn3;
-        
+
         // Find force due to all shear kind of motions
 
         if (flaglog) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
-        
+
         // Scale forces to obtain in appropriate units
 
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
+
         if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
-				 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
+                                 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
       }
     }
   }
 }
 
-/* ---------------------------------------------------------------------- 
-  computes R_FU * U 
+/* ----------------------------------------------------------------------
+  computes R_FU * U
 ---------------------------------------------------------------------- */
-  
+
 void PairLubricateU::compute_RU()
 {
   int i,j,ii,jj,inum,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz,fpair,fx,fy,fz,tx,ty,tz;
   double rsq,r,h_sep,radi,tfmag;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3,wdotn,wt1,wt2,wt3;   
+  double vt1,vt2,vt3,wdotn,wt1,wt2,wt3;
   double inv_inertia;
   int *ilist,*jlist,*numneigh,**firstneigh;
 
@@ -842,7 +842,7 @@ void PairLubricateU::compute_RU()
   double vxmu2f = force->vxmu2f;
   int overlaps = 0;
   double vi[3],vj[3],wi[3],wj[3],xl[3],a_sq,a_sh,a_pu,Fbmag,del,delmin,eta;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
@@ -855,37 +855,37 @@ void PairLubricateU::compute_RU()
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	 double wallhi[3], walllo[3];
-	 for (int j = 0; j < 3; j++){
-	   wallhi[j] = domain->prd[j];
-	   walllo[j] = 0;
-	 }    
-	 for (int m = 0; m < wallfix->nwall; m++){
-	   int dim = wallfix->wallwhich[m] / 2;
-	   int side = wallfix->wallwhich[m] % 2;
-	   if (wallfix->wallstyle[m] == VARIABLE){
-	     wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	   }	   
-	   else wallcoord = wallfix->coord0[m];	   
-	   if (side == 0) walllo[dim] = wallcoord;
-	   else wallhi[dim] = wallcoord;	   
-	 }
-	 for (int j = 0; j < 3; j++)
-	   dims[j] = wallhi[j] - walllo[j];
+         double wallhi[3], walllo[3];
+         for (int j = 0; j < 3; j++){
+           wallhi[j] = domain->prd[j];
+           walllo[j] = 0;
+         }
+         for (int m = 0; m < wallfix->nwall; m++){
+           int dim = wallfix->wallwhich[m] / 2;
+           int side = wallfix->wallwhich[m] % 2;
+           if (wallfix->wallstyle[m] == VARIABLE){
+             wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+           }
+           else wallcoord = wallfix->coord0[m];
+           if (side == 0) walllo[dim] = wallcoord;
+           else wallhi[dim] = wallcoord;
+         }
+         for (int j = 0; j < 3; j++)
+           dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0);
-	//	RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0);
+        //        RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	//	RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        //        RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
@@ -897,7 +897,7 @@ void PairLubricateU::compute_RU()
       f[i][j] = 0.0;
       torque[i][j] = 0.0;
     }
-  
+
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
     xtmp = x[i][0];
@@ -906,25 +906,25 @@ void PairLubricateU::compute_RU()
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];   
-    
+    jnum = numneigh[i];
+
     // Find angular velocity
 
     wi[0] = omega[i][0];
     wi[1] = omega[i][1];
-    wi[2] = omega[i][2];          
-     
+    wi[2] = omega[i][2];
+
     // Contribution due to the isotropic terms
 
     f[i][0] += -vxmu2f*R0*v[i][0];
     f[i][1] += -vxmu2f*R0*v[i][1];
-    f[i][2] += -vxmu2f*R0*v[i][2];    
-    
+    f[i][2] += -vxmu2f*R0*v[i][2];
+
     torque[i][0] += -vxmu2f*RT0*wi[0];
     torque[i][1] += -vxmu2f*RT0*wi[1];
-    torque[i][2] += -vxmu2f*RT0*wi[2];   
-    
-    if (!flagHI) continue; 
+    torque[i][2] += -vxmu2f*RT0*wi[2];
+
+    if (!flagHI) continue;
 
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
@@ -937,21 +937,21 @@ void PairLubricateU::compute_RU()
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-  
+        r = sqrt(rsq);
+
         // Use omega directly if it exists, else angmom
         // angular momentum = I*omega = 2/5 * M*R^2 * omega
 
-	wj[0] = omega[j][0];
-	wj[1] = omega[j][1];
-	wj[2] = omega[j][2];              
+        wj[0] = omega[j][0];
+        wj[1] = omega[j][1];
+        wj[2] = omega[j][2];
 
         // loc of the point of closest approach on particle i from its center
 
         xl[0] = -delx/r*radi;
         xl[1] = -dely/r*radi;
         xl[2] = -delz/r*radi;
-  
+
         // velocity at the point of closest approach on both particles
         // v = v + omega_cross_xl
 
@@ -960,30 +960,30 @@ void PairLubricateU::compute_RU()
         vi[0] = v[i][0] + (wi[1]*xl[2] - wi[2]*xl[1]);
         vi[1] = v[i][1] + (wi[2]*xl[0] - wi[0]*xl[2]);
         vi[2] = v[i][2] + (wi[0]*xl[1] - wi[1]*xl[0]);
-  
+
         // particle j
 
         vj[0] = v[j][0] - (wj[1]*xl[2] - wj[2]*xl[1]);
         vj[1] = v[j][1] - (wj[2]*xl[0] - wj[0]*xl[2]);
         vj[2] = v[j][2] - (wj[0]*xl[1] - wj[1]*xl[0]);
-  
+
         // Find the scalar resistances a_sq and a_sh
 
         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])
-          h_sep = cut_inner[itype][jtype] - 2.0*radi;          
-        
+          h_sep = cut_inner[itype][jtype] - 2.0*radi;
+
         // Scale h_sep by radi
 
         h_sep = h_sep/radi;
-  
+
         // Scalar resistances
 
         if (flaglog) {
@@ -992,7 +992,7 @@ void PairLubricateU::compute_RU()
           a_pu = 8.0*MY_PI*mu*pow(radi,3.0)*(3.0/160.0*log(1.0/h_sep));
         } else
           a_sq = 6.0*MY_PI*mu*radi*(1.0/4.0/h_sep);
-  
+
         // Relative  velocity at the point of closest approach
 
         vr1 = vi[0] - vj[0];
@@ -1017,83 +1017,83 @@ void PairLubricateU::compute_RU()
         fx  = a_sq*vn1;
         fy  = a_sq*vn2;
         fz  = a_sq*vn3;
-        
+
         // Find force due to all shear kind of motions
 
         if (flaglog) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
-        
+
         // Scale forces to obtain in appropriate units
 
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
+
         // Add to the total forc
 
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;    
-        
+        f[i][2] -= fz;
+
         if (newton_pair || j < nlocal) {
           f[j][0] += fx;
           f[j][1] += fy;
-          f[j][2] += fz;    
+          f[j][2] += fz;
         }
-  
+
         // Find torque due to this force
 
         if (flaglog) {
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;                  
-  
+          tz = xl[0]*fy - xl[1]*fx;
+
           // Why a scale factor ?
 
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-            
+          torque[i][2] -= vxmu2f*tz;
+
           if(newton_pair || j < nlocal) {
             torque[j][0] -= vxmu2f*tx;
             torque[j][1] -= vxmu2f*ty;
             torque[j][2] -= vxmu2f*tz;
           }
-          
+
           // Torque due to a_pu
 
-          wdotn = ((wi[0]-wj[0])*delx + 
-		   (wi[1]-wj[1])*dely + (wi[2]-wj[2])*delz)/r;
+          wdotn = ((wi[0]-wj[0])*delx +
+                   (wi[1]-wj[1])*dely + (wi[2]-wj[2])*delz)/r;
           wt1 = (wi[0]-wj[0]) - wdotn*delx/r;
           wt2 = (wi[1]-wj[1]) - wdotn*dely/r;
           wt3 = (wi[2]-wj[2]) - wdotn*delz/r;
-          
+
           tx = a_pu*wt1;
           ty = a_pu*wt2;
           tz = a_pu*wt3;
-          
+
           // add to total
 
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-            
+          torque[i][2] -= vxmu2f*tz;
+
           if (newton_pair || j < nlocal) {
             torque[j][0] += vxmu2f*tx;
             torque[j][1] += vxmu2f*ty;
             torque[j][2] += vxmu2f*tz;
           }
-        }      
+        }
       }
     }
   }
 }
 
-/* ---------------------------------------------------------------------- 
-  computes R_FU * U 
+/* ----------------------------------------------------------------------
+  computes R_FU * U
 ---------------------------------------------------------------------- */
 
 void PairLubricateU::compute_RU(double **x)
@@ -1102,10 +1102,10 @@ void PairLubricateU::compute_RU(double **x)
   double xtmp,ytmp,ztmp,delx,dely,delz,fpair,fx,fy,fz,tx,ty,tz;
   double rsq,r,h_sep,radi,tfmag;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3,wdotn,wt1,wt2,wt3;   
+  double vt1,vt2,vt3,wdotn,wt1,wt2,wt3;
   double inv_inertia;
   int *ilist,*jlist,*numneigh,**firstneigh;
-  
+
   double **v = atom->v;
   double **f = atom->f;
   double **omega = atom->omega;
@@ -1119,12 +1119,12 @@ void PairLubricateU::compute_RU(double **x)
   double vxmu2f = force->vxmu2f;
   int overlaps = 0;
   double vi[3],vj[3],wi[3],wj[3],xl[3],a_sq,a_sh,a_pu,Fbmag,del,delmin,eta;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // This section of code adjusts R0/RT0/RS0 if necessary due to changes
   // in the volume fraction as a result of fix deform or moving walls
 
@@ -1132,37 +1132,37 @@ void PairLubricateU::compute_RU(double **x)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	 double wallhi[3], walllo[3];
-	 for (int j = 0; j < 3; j++){
-	   wallhi[j] = domain->prd[j];
-	   walllo[j] = 0;
-	 }    
-	 for (int m = 0; m < wallfix->nwall; m++){
-	   int dim = wallfix->wallwhich[m] / 2;
-	   int side = wallfix->wallwhich[m] % 2;
-	   if (wallfix->wallstyle[m] == VARIABLE){
-	     wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	   }	   
-	   else wallcoord = wallfix->coord0[m];	   
-	   if (side == 0) walllo[dim] = wallcoord;
-	   else wallhi[dim] = wallcoord;	   
-	 }
-	 for (int j = 0; j < 3; j++)
-	   dims[j] = wallhi[j] - walllo[j];
+         double wallhi[3], walllo[3];
+         for (int j = 0; j < 3; j++){
+           wallhi[j] = domain->prd[j];
+           walllo[j] = 0;
+         }
+         for (int m = 0; m < wallfix->nwall; m++){
+           int dim = wallfix->wallwhich[m] / 2;
+           int side = wallfix->wallwhich[m] % 2;
+           if (wallfix->wallstyle[m] == VARIABLE){
+             wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+           }
+           else wallcoord = wallfix->coord0[m];
+           if (side == 0) walllo[dim] = wallcoord;
+           else wallhi[dim] = wallcoord;
+         }
+         for (int j = 0; j < 3; j++)
+           dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0);
-	//	RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0);
+        //        RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	//	RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        //        RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
@@ -1174,7 +1174,7 @@ void PairLubricateU::compute_RU(double **x)
       f[i][j] = 0.0;
       torque[i][j] = 0.0;
     }
-  
+
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
     xtmp = x[i][0];
@@ -1183,24 +1183,24 @@ void PairLubricateU::compute_RU(double **x)
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];   
-    
+    jnum = numneigh[i];
+
     // Find angular velocity
-    
+
     wi[0] = omega[i][0];
     wi[1] = omega[i][1];
     wi[2] = omega[i][2];
-    
+
     // Contribution due to the isotropic terms
-    
+
     f[i][0] += -vxmu2f*R0*v[i][0];
     f[i][1] += -vxmu2f*R0*v[i][1];
-    f[i][2] += -vxmu2f*R0*v[i][2];    
-    
+    f[i][2] += -vxmu2f*R0*v[i][2];
+
     torque[i][0] += -vxmu2f*RT0*wi[0];
     torque[i][1] += -vxmu2f*RT0*wi[1];
-    torque[i][2] += -vxmu2f*RT0*wi[2];   
-    
+    torque[i][2] += -vxmu2f*RT0*wi[2];
+
     if (!flagHI) continue;
 
     for (jj = 0; jj < jnum; jj++) {
@@ -1212,177 +1212,177 @@ void PairLubricateU::compute_RU(double **x)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-        
+        r = sqrt(rsq);
+
         // Use omega directly if it exists, else angmom
         // angular momentum = I*omega = 2/5 * M*R^2 * omega
-        
-	wj[0] = omega[j][0];
-	wj[1] = omega[j][1];
-	wj[2] = omega[j][2];              
-        
+
+        wj[0] = omega[j][0];
+        wj[1] = omega[j][1];
+        wj[2] = omega[j][2];
+
         // loc of the point of closest approach on particle i from its center
-        
+
         xl[0] = -delx/r*radi;
         xl[1] = -dely/r*radi;
         xl[2] = -delz/r*radi;
-        
+
         // velocity at the point of closest approach on both particles
         // v = v + omega_cross_xl
-        
+
         // particle i
-        
+
         vi[0] = v[i][0] + (wi[1]*xl[2] - wi[2]*xl[1]);
         vi[1] = v[i][1] + (wi[2]*xl[0] - wi[0]*xl[2]);
         vi[2] = v[i][2] + (wi[0]*xl[1] - wi[1]*xl[0]);
-        
+
         // particle j
-        
+
         vj[0] = v[j][0] - (wj[1]*xl[2] - wj[2]*xl[1]);
         vj[1] = v[j][1] - (wj[2]*xl[0] - wj[0]*xl[2]);
         vj[2] = v[j][2] - (wj[0]*xl[1] - wj[1]*xl[0]);
-        
+
         // Find the scalar resistances a_sq and a_sh
-        
+
         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])
-          h_sep = cut_inner[itype][jtype] - 2.0*radi;          
-        
+          h_sep = cut_inner[itype][jtype] - 2.0*radi;
+
         // Scale h_sep by radi
-        
+
         h_sep = h_sep/radi;
-        
+
         // Scalar resistances
-        
+
         if (flaglog) {
           a_sq = 6.0*MY_PI*mu*radi*(1.0/4.0/h_sep + 9.0/40.0*log(1.0/h_sep));
           a_sh = 6.0*MY_PI*mu*radi*(1.0/6.0*log(1.0/h_sep));
           a_pu = 8.0*MY_PI*mu*pow(radi,3.0)*(3.0/160.0*log(1.0/h_sep));
         } else
           a_sq = 6.0*MY_PI*mu*radi*(1.0/4.0/h_sep);
-        
+
         // Relative  velocity at the point of closest approach
-        
+
         vr1 = vi[0] - vj[0];
         vr2 = vi[1] - vj[1];
         vr3 = vi[2] - vj[2];
-        
+
         // Normal component (vr.n)n
-        
+
         vnnr = (vr1*delx + vr2*dely + vr3*delz)/r;
         vn1 = vnnr*delx/r;
         vn2 = vnnr*dely/r;
         vn3 = vnnr*delz/r;
-        
+
         // Tangential component vr - (vr.n)n
-        
+
         vt1 = vr1 - vn1;
         vt2 = vr2 - vn2;
         vt3 = vr3 - vn3;
-        
+
         // Find force due to squeeze type motion
-        
+
         fx  = a_sq*vn1;
         fy  = a_sq*vn2;
         fz  = a_sq*vn3;
-        
+
         // Find force due to all shear kind of motions
-        
+
         if (flaglog) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
-        
+
         // Scale forces to obtain in appropriate units
-        
+
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
+
         // Add to the total force
-        
+
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;    
-        
+        f[i][2] -= fz;
+
         if (newton_pair || j < nlocal) {
           f[j][0] += fx;
           f[j][1] += fy;
-          f[j][2] += fz;    
+          f[j][2] += fz;
         }
-        
+
         // Find torque due to this force
-        
+
         if (flaglog) {
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;                  
-          
+          tz = xl[0]*fy - xl[1]*fx;
+
           // Why a scale factor ?
-          
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-          
+          torque[i][2] -= vxmu2f*tz;
+
           if(newton_pair || j < nlocal) {
             torque[j][0] -= vxmu2f*tx;
             torque[j][1] -= vxmu2f*ty;
             torque[j][2] -= vxmu2f*tz;
           }
-          
+
           // Torque due to a_pu
-          
-          wdotn = ((wi[0]-wj[0])*delx + 
+
+          wdotn = ((wi[0]-wj[0])*delx +
                    (wi[1]-wj[1])*dely + (wi[2]-wj[2])*delz)/r;
           wt1 = (wi[0]-wj[0]) - wdotn*delx/r;
           wt2 = (wi[1]-wj[1]) - wdotn*dely/r;
           wt3 = (wi[2]-wj[2]) - wdotn*delz/r;
-          
+
           tx = a_pu*wt1;
           ty = a_pu*wt2;
           tz = a_pu*wt3;
-          
+
           // add to total
-          
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-          
+          torque[i][2] -= vxmu2f*tz;
+
           if (newton_pair || j < nlocal) {
             torque[j][0] += vxmu2f*tx;
             torque[j][1] += vxmu2f*ty;
             torque[j][2] += vxmu2f*tz;
           }
-        }      
+        }
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   This computes R_{FE}*E , where E is the rate of strain of tensor which is 
+   This computes R_{FE}*E , where E is the rate of strain of tensor which is
    known apriori, as it depends only on the known fluid velocity.
    So, this part of the hydrodynamic interaction can be pre computed and
    transferred to the RHS
    ---------------------------------------------------------------------- */
-  
+
 void PairLubricateU::compute_RE()
 {
   int i,j,ii,jj,inum,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz,fpair,fx,fy,fz,tx,ty,tz;
   double rsq,r,h_sep,radi,tfmag;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3;  
+  double vt1,vt2,vt3;
   double inv_inertia;
   int *ilist,*jlist,*numneigh,**firstneigh;
 
@@ -1400,7 +1400,7 @@ void PairLubricateU::compute_RE()
   double vxmu2f = force->vxmu2f;
   int overlaps = 0;
   double vi[3],vj[3],wi[3],wj[3],xl[3],a_sq,a_sh,a_pu,Fbmag,del,delmin,eta;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
@@ -1416,10 +1416,10 @@ void PairLubricateU::compute_RE()
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];   
-       
-    // No contribution from isotropic terms due to E    
-    
+    jnum = numneigh[i];
+
+    // No contribution from isotropic terms due to E
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
@@ -1431,51 +1431,51 @@ void PairLubricateU::compute_RE()
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-  
+        r = sqrt(rsq);
+
         // loc of the point of closest approach on particle i from its center
 
         xl[0] = -delx/r*radi;
         xl[1] = -dely/r*radi;
         xl[2] = -delz/r*radi;
-  
+
         // Find the scalar resistances a_sq and a_sh
 
         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])
-          h_sep = cut_inner[itype][jtype] - 2.0*radi;          
-        
+          h_sep = cut_inner[itype][jtype] - 2.0*radi;
+
         // Scale h_sep by radi
 
         h_sep = h_sep/radi;
-  
+
         // Scalar resistance for Squeeze type motions
 
         if (flaglog)
           a_sq = 6*MY_PI*mu*radi*(1.0/4.0/h_sep + 9.0/40.0*log(1/h_sep));
         else
           a_sq = 6*MY_PI*mu*radi*(1.0/4.0/h_sep);
-        
+
         // Scalar resistance for Shear type motions
 
         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
 
         vr1 = -2.0*(Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
         vr2 = -2.0*(Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
-        vr3 = -2.0*(Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);        
-            
+        vr3 = -2.0*(Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
+
         // Normal component (vr.n)n
 
         vnnr = (vr1*delx + vr2*dely + vr3*delz)/r;
@@ -1494,54 +1494,54 @@ void PairLubricateU::compute_RE()
         fx  = a_sq*vn1;
         fy  = a_sq*vn2;
         fz  = a_sq*vn3;
-        
+
         // Find force due to all shear kind of motions
 
         if (flaglog) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
-        
+
         // Scale forces to obtain in appropriate units
 
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
+
         // Add to the total forc
 
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;    
-        
+        f[i][2] -= fz;
+
         if (newton_pair || j < nlocal) {
           f[j][0] += fx;
           f[j][1] += fy;
-          f[j][2] += fz;    
+          f[j][2] += fz;
         }
-        
+
         // Find torque due to this force
 
         if (flaglog) {
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;                  
-  
+          tz = xl[0]*fy - xl[1]*fx;
+
           // Why a scale factor ?
 
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-            
+          torque[i][2] -= vxmu2f*tz;
+
           if (newton_pair || j < nlocal) {
             torque[j][0] -= vxmu2f*tx;
             torque[j][1] -= vxmu2f*ty;
             torque[j][2] -= vxmu2f*tz;
           }
-          
+
           // NOTE No a_pu term needed as they add up to zero
-        }      
+        }
       }
     }
   }
@@ -1552,7 +1552,7 @@ void PairLubricateU::compute_RE()
 }
 
 /* ----------------------------------------------------------------------
-   This computes R_{FE}*E , where E is the rate of strain of tensor which is 
+   This computes R_{FE}*E , where E is the rate of strain of tensor which is
    known apriori, as it depends only on the known fluid velocity.
    So, this part of the hydrodynamic interaction can be pre computed and
    transferred to the RHS
@@ -1564,10 +1564,10 @@ void PairLubricateU::compute_RE(double **x)
   double xtmp,ytmp,ztmp,delx,dely,delz,fpair,fx,fy,fz,tx,ty,tz;
   double rsq,r,h_sep,radi,tfmag;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3;  
+  double vt1,vt2,vt3;
   double inv_inertia;
   int *ilist,*jlist,*numneigh,**firstneigh;
-  
+
   double **v = atom->v;
   double **f = atom->f;
   double **omega = atom->omega;
@@ -1581,14 +1581,14 @@ void PairLubricateU::compute_RE(double **x)
   double vxmu2f = force->vxmu2f;
   int overlaps = 0;
   double vi[3],vj[3],wi[3],wj[3],xl[3],a_sq,a_sh,a_pu,Fbmag,del,delmin,eta;
-  
+
   if (!flagHI) return;
 
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
     xtmp = x[i][0];
@@ -1597,10 +1597,10 @@ void PairLubricateU::compute_RE(double **x)
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];   
-    
-    // No contribution from isotropic terms due to E    
-    
+    jnum = numneigh[i];
+
+    // No contribution from isotropic terms due to E
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
@@ -1610,123 +1610,123 @@ void PairLubricateU::compute_RE(double **x)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-        
+        r = sqrt(rsq);
+
         // loc of the point of closest approach on particle i from its center
-        
+
         xl[0] = -delx/r*radi;
         xl[1] = -dely/r*radi;
         xl[2] = -delz/r*radi;
-        
+
         // Find the scalar resistances a_sq and a_sh
-        
+
         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])
-          h_sep = cut_inner[itype][jtype] - 2.0*radi;          
-        
+          h_sep = cut_inner[itype][jtype] - 2.0*radi;
+
         // Scale h_sep by radi
-        
+
         h_sep = h_sep/radi;
-        
+
         // Scalar resistance for Squeeze type motions
-        
+
         if (flaglog)
           a_sq = 6*MY_PI*mu*radi*(1.0/4.0/h_sep + 9.0/40.0*log(1/h_sep));
         else
           a_sq = 6*MY_PI*mu*radi*(1.0/4.0/h_sep);
-        
+
         // Scalar resistance for Shear type motions
-        
+
         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
-        
+
         vr1 = -2.0*(Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
         vr2 = -2.0*(Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
-        vr3 = -2.0*(Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);        
-        
+        vr3 = -2.0*(Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
+
         // Normal component (vr.n)n
-        
+
         vnnr = (vr1*delx + vr2*dely + vr3*delz)/r;
         vn1 = vnnr*delx/r;
         vn2 = vnnr*dely/r;
         vn3 = vnnr*delz/r;
-        
+
         // Tangential component vr - (vr.n)n
-        
+
         vt1 = vr1 - vn1;
         vt2 = vr2 - vn2;
         vt3 = vr3 - vn3;
-        
+
         // Find force due to squeeze type motion
-        
+
         fx  = a_sq*vn1;
         fy  = a_sq*vn2;
         fz  = a_sq*vn3;
-        
+
         // Find force due to all shear kind of motions
-        
+
         if (flaglog) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
-        
+
         // Scale forces to obtain in appropriate units
-        
+
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
+
         // Add to the total forc
-        
+
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;    
-        
+        f[i][2] -= fz;
+
         if (newton_pair || j < nlocal) {
           f[j][0] += fx;
           f[j][1] += fy;
-          f[j][2] += fz;    
+          f[j][2] += fz;
         }
-        
+
         // Find torque due to this force
-        
+
         if (flaglog) {
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;                  
-          
+          tz = xl[0]*fy - xl[1]*fx;
+
           // Why a scale factor ?
-          
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-          
+          torque[i][2] -= vxmu2f*tz;
+
           if (newton_pair || j < nlocal) {
             torque[j][0] -= vxmu2f*tx;
             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);
@@ -1734,7 +1734,7 @@ void PairLubricateU::compute_RE(double **x)
 
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLubricateU::allocate()
@@ -1754,7 +1754,7 @@ void PairLubricateU::allocate()
 }
 
 /*-----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLubricateU::settings(int narg, char **arg)
@@ -1766,7 +1766,7 @@ void PairLubricateU::settings(int narg, char **arg)
   cut_inner_global = atof(arg[2]);
   cut_global = atof(arg[3]);
   gdot =  atof(arg[4]);
-  
+
   flagHI = flagVF = 1;
   if (narg == 7) {
     flagHI = atoi(arg[5]);
@@ -1775,9 +1775,9 @@ void PairLubricateU::settings(int narg, char **arg)
 
   if (flaglog == 1 && flagHI == 0) {
     error->warning(FLERR,"Cannot include log terms without 1/r terms; "
-		   "setting flagHI to 1.");
+                   "setting flagHI to 1.");
     flagHI = 1;
-  } 
+  }
 
   // reset cutoffs that have been explicitly set
 
@@ -1790,7 +1790,7 @@ void PairLubricateU::settings(int narg, char **arg)
           cut[i][j] = cut_global;
         }
   }
-  
+
   // store the rate of strain tensor
 
   Ef[0][0] = 0.0;
@@ -1801,7 +1801,7 @@ void PairLubricateU::settings(int narg, char **arg)
   Ef[1][2] = 0.0;
   Ef[2][0] = 0.0;
   Ef[2][1] = 0.0;
-  Ef[2][2] = 0.0; 
+  Ef[2][2] = 0.0;
 }
 
 /*-----------------------------------------------------------------------
@@ -1863,7 +1863,7 @@ void PairLubricateU::init_style()
       error->all(FLERR,"Pair lubricateU requires monodisperse particles");
     radi = radtype;
   }
-  
+
   // check for fix deform, if exists it must use "remap v"
   // If box will change volume, set appropriate flag so that volume
   // and v.f. corrections are re-calculated at every step.
@@ -1875,46 +1875,46 @@ void PairLubricateU::init_style()
 
   flagdeform = flagwall = 0;
   for (int i = 0; i < modify->nfix; i++){
-    if (strcmp(modify->fix[i]->style,"deform") == 0) 
+    if (strcmp(modify->fix[i]->style,"deform") == 0)
       flagdeform = 1;
     else if (strstr(modify->fix[i]->style,"wall") != NULL){
       flagwall = 1; // Walls exist
       if (((FixWall *) modify->fix[i])->varflag ) {
-	flagwall = 2; // Moving walls exist
-	wallfix = (FixWall *) modify->fix[i];
+        flagwall = 2; // Moving walls exist
+        wallfix = (FixWall *) modify->fix[i];
       }
     }
   }
-  
+
   // set the isotropic constants depending on the volume fraction
-  // vol_T = total volumeshearing = flagdeform = flagwall = 0;  
+  // vol_T = total volumeshearing = flagdeform = flagwall = 0;
   double vol_T, wallcoord;
     if (!flagwall) vol_T = domain->xprd*domain->yprd*domain->zprd;
-  else {    
+  else {
     double wallhi[3], walllo[3];
     for (int j = 0; j < 3; j++){
       wallhi[j] = domain->prd[j];
       walllo[j] = 0;
-    }    
+    }
     for (int m = 0; m < wallfix->nwall; m++){
       int dim = wallfix->wallwhich[m] / 2;
       int side = wallfix->wallwhich[m] % 2;
       if (wallfix->wallstyle[m] == VARIABLE){
-	wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
-	//Since fix->wall->init happens after pair->init_style
-	wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+        wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
+        //Since fix->wall->init happens after pair->init_style
+        wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
       }
 
       else wallcoord = wallfix->coord0[m];
-      
+
       if (side == 0) walllo[dim] = wallcoord;
       else wallhi[dim] = wallcoord;
     }
-    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) * 
+    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) *
       (wallhi[2] - walllo[2]);
   }
-   
-  
+
+
   // assuming monodisperse spheres, vol_P = volume of the particles
 
   double tmp = 0.0;
@@ -1922,11 +1922,11 @@ void PairLubricateU::init_style()
   MPI_Allreduce(&tmp,&rad,1,MPI_DOUBLE,MPI_MAX,world);
 
   vol_P = atom->natoms * (4.0/3.0)*MY_PI*pow(rad,3.0);
-  
+
   // vol_f = volume fraction
 
   double vol_f = vol_P/vol_T;
-  
+
   if (!flagVF) vol_f = 0;
 
   // set the isotropic constant
@@ -1959,7 +1959,7 @@ double PairLubricateU::init_one(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairLubricateU::write_restart(FILE *fp)
@@ -1971,8 +1971,8 @@ void PairLubricateU::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&cut_inner[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&cut_inner[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -1993,12 +1993,12 @@ void PairLubricateU::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&cut_inner[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&cut_inner[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -2048,8 +2048,8 @@ void PairLubricateU::read_restart_settings(FILE *fp)
 
 /*---------------------------------------------------------------------------*/
 
-void PairLubricateU::copy_vec_uo(int inum, double *xcg, 
-				 double **v, double **omega)
+void PairLubricateU::copy_vec_uo(int inum, double *xcg,
+                                 double **v, double **omega)
 {
   int i,j,ii;
   int *ilist;
@@ -2059,16 +2059,16 @@ void PairLubricateU::copy_vec_uo(int inum, double *xcg,
 
   double *rmass = atom->rmass;
   int *type = atom->type;
-  
+
   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++) {       
+    inertia = 0.4*rmass[i]*radi*radi;
+
+    for (j=0;j<3;j++) {
       v[i][j] = xcg[6*ii+j];
       omega[i][j] = xcg[6*ii+j+3];
     }
@@ -2077,17 +2077,17 @@ void PairLubricateU::copy_vec_uo(int inum, double *xcg,
 
 /*---------------------------------------------------------------------------*/
 
-void PairLubricateU::copy_uo_vec(int inum, double **f, double **torque, 
-				 double *RU)
+void PairLubricateU::copy_uo_vec(int inum, double **f, double **torque,
+                                 double *RU)
 {
   int i,j,ii;
   int *ilist;
-  
+
   ilist = list->ilist;
-  
+
   for (ii=0;ii<inum;ii++) {
     i = ilist[ii];
-    for (j=0;j<3;j++) {       
+    for (j=0;j<3;j++) {
       RU[6*ii+j] = f[i][j];
       RU[6*ii+j+3] = torque[i][j];
     }
@@ -2097,7 +2097,7 @@ void PairLubricateU::copy_uo_vec(int inum, double **f, double **torque,
 /* ---------------------------------------------------------------------- */
 
 int PairLubricateU::pack_comm(int n, int *list, double *buf,
-			      int pbc_flag, int *pbc)
+                              int pbc_flag, int *pbc)
 {
   int i,j,m;
 
diff --git a/src/FLD/pair_lubricateU.h b/src/FLD/pair_lubricateU.h
index a4b18d0382..ca8f15a232 100644
--- a/src/FLD/pair_lubricateU.h
+++ b/src/FLD/pair_lubricateU.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/FLD/pair_lubricateU_poly.cpp b/src/FLD/pair_lubricateU_poly.cpp
index 4662910241..19b4ae818c 100644
--- a/src/FLD/pair_lubricateU_poly.cpp
+++ b/src/FLD/pair_lubricateU_poly.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ enum{EDGE,CONSTANT,VARIABLE};
 
 /* ---------------------------------------------------------------------- */
 
-PairLubricateUPoly::PairLubricateUPoly(LAMMPS *lmp) : 
+PairLubricateUPoly::PairLubricateUPoly(LAMMPS *lmp) :
   PairLubricateU(lmp) {}
 
 /* ----------------------------------------------------------------------
@@ -80,7 +80,7 @@ void PairLubricateUPoly::compute(int eflag, int vflag)
 
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   // grow per-atom arrays if necessary
   // need to be atom->nmax in length
 
@@ -120,16 +120,16 @@ void PairLubricateUPoly::compute(int eflag, int vflag)
       xl[i][j] = x[i][j];
     }
   }
-  
+
   // Stage one of Midpoint method
   // Solve for velocities based on intial positions
 
   iterate(atom->x,1);
-  
+
   // Find positions at half the timestep and store in xl
 
   intermediates(nall,xl);
-  
+
   // Store back the saved forces and torques in original arrays
 
   for(i=0;i<nlocal+nghost;i++) {
@@ -138,7 +138,7 @@ void PairLubricateUPoly::compute(int eflag, int vflag)
       torque[i][j] = Tl[i][j];
     }
   }
-  
+
   // Stage two: This will give the final velocities
 
   iterate(xl,2);
@@ -150,7 +150,7 @@ void PairLubricateUPoly::compute(int eflag, int vflag)
 
 void PairLubricateUPoly::iterate(double **x, int stage)
 {
-  int i,j,ii,itype; 
+  int i,j,ii,itype;
 
   int inum = list->inum;
   int *ilist = list->ilist;
@@ -161,155 +161,155 @@ void PairLubricateUPoly::iterate(double **x, int stage)
   double normi,error,normig;
   double send[2],recv[2],rcg_dot_rcg;
   double mo_inertia,radi;
-  
+
   double **v = atom->v;
   double **f = atom->f;
   double **omega = atom->omega;
   double **angmom = atom->angmom;
   double **torque = atom->torque;
   double *radius = atom->radius;
-  
-  // First compute R_FE*E  
+
+  // First compute R_FE*E
 
   compute_RE(x);
-  
-  // Reverse communication of forces and torques to 
+
+  // Reverse communication of forces and torques to
   // accumulate the net force on each of the particles
-  
+
   if (newton_pair) comm->reverse_comm();
-  
+
   // CONJUGATE GRADIENT
   // Find the right hand side= -ve of all forces/torques
   // b = 6*Npart in overall size
-  
+
   for(ii = 0; ii < inum; ii++) {
-    i = ilist[ii];  
+    i = ilist[ii];
     for (j = 0; j < 3; j++) {
       bcg[6*ii+j] = -f[i][j];
-      bcg[6*ii+j+3] = -torque[i][j];  
+      bcg[6*ii+j+3] = -torque[i][j];
     }
-  } 
-  
-  // Start solving the equation : F^H = -F^P -F^B - F^H_{Ef}   
+  }
+
+  // Start solving the equation : F^H = -F^P -F^B - F^H_{Ef}
   // Store initial guess for velocity and angular-velocities/angular momentum
   // NOTE velocities and angular velocities are assumed relative to the fluid
-  
+
   for (ii=0;ii<inum;ii++)
-    for (j=0;j<3;j++) {      
+    for (j=0;j<3;j++) {
       xcg[6*ii+j] = 0.0;
-      xcg[6*ii+j+3] = 0.0;       
+      xcg[6*ii+j+3] = 0.0;
     }
-  
+
   // Copy initial guess to the global arrays to be acted upon by R_{FU}
   // and returned by f and torque arrays
-  
+
   copy_vec_uo(inum,xcg,v,omega);
-  
+
   // set velocities for ghost particles
-  
+
   comm->forward_comm_pair(this);
-  
+
   // Find initial residual
-  
+
   compute_RU(x);
-  
+
   // reverse communication of forces and torques
-  
+
   if (newton_pair) comm->reverse_comm();
-  
+
   copy_uo_vec(inum,f,torque,RU);
-  
+
   for (i=0;i<6*inum;i++)
     rcg[i] = bcg[i] - RU[i];
-  
+
   // Set initial conjugate direction
-  
+
   for (i=0;i<6*inum;i++)
     pcg[i] = rcg[i];
-  
+
   // Find initial norm of the residual or norm of the RHS (either is fine)
-  
+
   normi = dot_vec_vec(6*inum,bcg,bcg);
-  
+
   MPI_Allreduce(&normi,&normig,1,MPI_DOUBLE,MPI_SUM,world);
-  
+
   // Loop until convergence
-  
-  do {    
+
+  do {
     // find R*p
-    
+
     copy_vec_uo(inum,pcg,v,omega);
-    
-    // set velocities for ghost particles   
-    
+
+    // set velocities for ghost particles
+
     comm->forward_comm_pair(this);
-    
+
     compute_RU(x);
-    
+
     // reverse communication of forces and torques
-    
+
     if (newton_pair) comm->reverse_comm();
-    
-    copy_uo_vec(inum,f,torque,RU);  
-    
+
+    copy_uo_vec(inum,f,torque,RU);
+
     // Find alpha
-    
+
     send[0] = dot_vec_vec(6*inum,rcg,rcg);
     send[1] = dot_vec_vec(6*inum,RU,pcg);
-    
+
     MPI_Allreduce(send,recv,2,MPI_DOUBLE,MPI_SUM,world);
-    
+
     alpha = recv[0]/recv[1];
     rcg_dot_rcg = recv[0];
-    
+
     // Find new x
-    
+
     for (i=0;i<6*inum;i++)
       xcg[i] = xcg[i] + alpha*pcg[i];
-    
+
     // find new residual
-    
+
     for (i=0;i<6*inum;i++)
       rcg1[i] = rcg[i] - alpha*RU[i];
-    
+
     // find beta
-    
+
     send[0] = dot_vec_vec(6*inum,rcg1,rcg1);
-    
+
     MPI_Allreduce(send,recv,1,MPI_DOUBLE,MPI_SUM,world);
-    
+
     beta = recv[0]/rcg_dot_rcg;
-    
+
     // Find new conjugate direction
-    
+
     for (i=0;i<6*inum;i++)
       pcg[i] = rcg1[i] + beta*pcg[i];
-    
+
     for (i=0;i<6*inum;i++)
       rcg[i] = rcg1[i];
-    
+
     // Find relative error
-    
-    error = sqrt(recv[0]/normig);    
-    
-  } while (error > TOL);  
-  
-  
+
+    error = sqrt(recv[0]/normig);
+
+  } while (error > TOL);
+
+
   // update the final converged velocities in respective arrays
-  
+
   copy_vec_uo(inum,xcg,v,omega);
-  
+
   // set velocities for ghost particles
-  
+
   comm->forward_comm_pair(this);
-  
+
   // compute the viscosity/pressure
-  
+
   if (evflag && stage == 2) compute_Fh(x);
-  
-  // find actual particle's velocities from relative velocities 
+
+  // find actual particle's velocities from relative velocities
   // only non-zero component of fluid's vel : vx=gdot*y and wz=-gdot/2
-  
+
   for (ii=0;ii<inum;ii++) {
     i = ilist[ii];
     itype = type[i];
@@ -338,10 +338,10 @@ void PairLubricateUPoly::compute_Fh(double **x)
   double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz;
   double rsq,r,h_sep,radi,radj;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3;   
+  double vt1,vt2,vt3;
   double inv_inertia;
   double vi[3],vj[3],wi[3],wj[3],xl[3],jl[3],pre[2];
-  
+
   double **v = atom->v;
   double **f = atom->f;
   double **omega = atom->omega;
@@ -353,12 +353,12 @@ void PairLubricateUPoly::compute_Fh(double **x)
   double vxmu2f = force->vxmu2f;
   double a_sq = 0.0;
   double a_sh = 0.0;
- 
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   beta[0][0] = beta[1][0] = beta[1][4] = 0.0;
 
   // This section of code adjusts R0/RT0/RS0 if necessary due to changes
@@ -368,37 +368,37 @@ void PairLubricateUPoly::compute_Fh(double **x)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	 double wallhi[3], walllo[3];
-	 for (int j = 0; j < 3; j++){
-	   wallhi[j] = domain->prd[j];
-	   walllo[j] = 0;
-	 }    
-	 for (int m = 0; m < wallfix->nwall; m++){
-	   int dim = wallfix->wallwhich[m] / 2;
-	   int side = wallfix->wallwhich[m] % 2;
-	   if (wallfix->wallstyle[m] == VARIABLE){
-	     wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	   }	   
-	   else wallcoord = wallfix->coord0[m];	   
-	   if (side == 0) walllo[dim] = wallcoord;
-	   else wallhi[dim] = wallcoord;	   
-	 }
-	 for (int j = 0; j < 3; j++)
-	   dims[j] = wallhi[j] - walllo[j];
+         double wallhi[3], walllo[3];
+         for (int j = 0; j < 3; j++){
+           wallhi[j] = domain->prd[j];
+           walllo[j] = 0;
+         }
+         for (int m = 0; m < wallfix->nwall; m++){
+           int dim = wallfix->wallwhich[m] / 2;
+           int side = wallfix->wallwhich[m] % 2;
+           if (wallfix->wallstyle[m] == VARIABLE){
+             wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+           }
+           else wallcoord = wallfix->coord0[m];
+           if (side == 0) walllo[dim] = wallcoord;
+           else wallhi[dim] = wallcoord;
+         }
+         for (int j = 0; j < 3; j++)
+           dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	//R0  = 6*MY_PI*mu*(1.0 + 2.16*vol_f);
-	//RT0 = 8*MY_PI*mu;
-	RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        //R0  = 6*MY_PI*mu*(1.0 + 2.16*vol_f);
+        //RT0 = 8*MY_PI*mu;
+        RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	//R0  = 6*MY_PI*mu*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	//RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        //R0  = 6*MY_PI*mu*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        //RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
@@ -410,11 +410,11 @@ void PairLubricateUPoly::compute_Fh(double **x)
       f[i][j] = 0.0;
       torque[i][j] = 0.0;
     }
-  
+
   // reverse communication of forces and torques
 
   if (newton_pair) comm->reverse_comm(); // not really needed
-  
+
   // Find additional contribution from the stresslets
 
   for (ii = 0; ii < inum; ii++) {
@@ -425,10 +425,10 @@ void PairLubricateUPoly::compute_Fh(double **x)
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];   
+    jnum = numneigh[i];
     pre[1] = 8.0*(pre[0] = MY_PI*mu*radi)*radi*radi; // BROKEN?? Should be "+"??
     pre[0] *= 6.0;
-    
+
     // Find the contribution to stress from isotropic RS0
     // Set psuedo force to obtain the required contribution
     // need to set delx  and fy only
@@ -438,13 +438,13 @@ void PairLubricateUPoly::compute_Fh(double **x)
     fz = 0.0; delz = 0.0;
     if (evflag)
       ev_tally_xyz(i,i,nlocal,newton_pair,0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
-    
+
     // Find angular velocity
 
     wi[0] = omega[i][0];
     wi[1] = omega[i][1];
-    wi[2] = omega[i][2];          
-    
+    wi[2] = omega[i][2];
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       delx = xtmp - x[j][0];
@@ -453,19 +453,19 @@ void PairLubricateUPoly::compute_Fh(double **x)
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
       radj = radius[j];
-      
+
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-        
+        r = sqrt(rsq);
+
         // Use omega directly if it exists, else angmom
         // angular momentum = I*omega = 2/5 * M*R^2 * omega
-        
-	wj[0] = omega[j][0];
-	wj[1] = omega[j][1];
-	wj[2] = omega[j][2];              
-        
+
+        wj[0] = omega[j][0];
+        wj[1] = omega[j][1];
+        wj[2] = omega[j][2];
+
         // loc of the point of closest approach on particle i from its cente
-	// POC for j is in opposite direction as for i
+        // POC for j is in opposite direction as for i
 
         xl[0] = -delx/r*radi;
         xl[1] = -dely/r*radi;
@@ -473,7 +473,7 @@ void PairLubricateUPoly::compute_Fh(double **x)
         jl[0] = delx/r*radj;
         jl[1] = dely/r*radj;
         jl[2] = delz/r*radj;
-        
+
         h_sep = r - radi-radj;
 
         // velocity at the point of closest approach on both particles
@@ -484,53 +484,53 @@ void PairLubricateUPoly::compute_Fh(double **x)
         vi[0] = v[i][0] + (wi[1]*xl[2] - wi[2]*xl[1]);
         vi[1] = v[i][1] + (wi[2]*xl[0] - wi[0]*xl[2]);
         vi[2] = v[i][2] + (wi[0]*xl[1] - wi[1]*xl[0]);
-        
+
         // particle j
 
         vj[0] = v[j][0] + (wj[1]*jl[2] - wj[2]*jl[1]);
         vj[1] = v[j][1] + (wj[2]*jl[0] - wj[0]*jl[2]);
         vj[2] = v[j][2] + (wj[0]*jl[1] - wj[1]*jl[0]);
-        
-        
+
+
         // Relative  velocity at the point of closest approach
-	// include contribution from Einf of the fluid
-
-        vr1 = vi[0] - vj[0] - 
-	  2.0*(Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
-        vr2 = vi[1] - vj[1] - 
-	  2.0*(Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
-        vr3 = vi[2] - vj[2] - 
-	  2.0*(Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
-        
+        // include contribution from Einf of the fluid
+
+        vr1 = vi[0] - vj[0] -
+          2.0*(Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
+        vr2 = vi[1] - vj[1] -
+          2.0*(Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
+        vr3 = vi[2] - vj[2] -
+          2.0*(Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
+
         // Normal component (vr.n)n
 
         vnnr = (vr1*delx + vr2*dely + vr3*delz)/r;
         vn1 = vnnr*delx/r;
         vn2 = vnnr*dely/r;
         vn3 = vnnr*delz/r;
-        
+
         // Tangential component vr - (vr.n)n
 
         vt1 = vr1 - vn1;
         vt2 = vr2 - vn2;
         vt3 = vr3 - vn3;
-        
+
         // 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])
-          h_sep = cut_inner[itype][jtype] - radi-radj;          
-        
+          h_sep = cut_inner[itype][jtype] - radi-radj;
+
         // Scale h_sep by radi
 
         h_sep = h_sep/radi;
-	beta[0][1] = radj/radi;
-	beta[1][1] = 1.0 + beta[0][1];
+        beta[0][1] = radj/radi;
+        beta[1][1] = 1.0 + beta[0][1];
 
         /*beta0 = radj/radi;
         beta1 = 1.0 + beta0;*/
@@ -538,33 +538,33 @@ void PairLubricateUPoly::compute_Fh(double **x)
         // Scalar resistances
 
         if (flaglog) {
-	  beta[0][2] = beta[0][1]*beta[0][1];
-	  beta[0][3] = beta[0][2]*beta[0][1];
-	  beta[0][4] = beta[0][3]*beta[0][1];
-	  beta[1][2] = beta[1][1]*beta[1][1];
-	  beta[1][3] = beta[1][2]*beta[1][1];
-	  double log_h_sep_beta13 = log(1.0/h_sep)/beta[1][3];
-	  double h_sep_beta11 = h_sep/beta[1][1];
-
-	  a_sq = pre[0]*(beta[0][2]/beta[1][2]/h_sep
-		+((0.2+1.4*beta[0][1]+0.2*beta[0][2])
-		  +(1.0+18.0*(beta[0][1]+beta[0][3])-29.0*beta[0][2]
-		    +beta[0][4])*h_sep_beta11/21.0)*log_h_sep_beta13);
-
-	  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_sq = beta0*beta0/beta1/beta1/h_sep
-		  +(1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3)*log(1.0/h_sep);
+          beta[0][2] = beta[0][1]*beta[0][1];
+          beta[0][3] = beta[0][2]*beta[0][1];
+          beta[0][4] = beta[0][3]*beta[0][1];
+          beta[1][2] = beta[1][1]*beta[1][1];
+          beta[1][3] = beta[1][2]*beta[1][1];
+          double log_h_sep_beta13 = log(1.0/h_sep)/beta[1][3];
+          double h_sep_beta11 = h_sep/beta[1][1];
+
+          a_sq = pre[0]*(beta[0][2]/beta[1][2]/h_sep
+                +((0.2+1.4*beta[0][1]+0.2*beta[0][2])
+                  +(1.0+18.0*(beta[0][1]+beta[0][3])-29.0*beta[0][2]
+                    +beta[0][4])*h_sep_beta11/21.0)*log_h_sep_beta13);
+
+          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_sq = beta0*beta0/beta1/beta1/h_sep
+                  +(1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3)*log(1.0/h_sep);
           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*log(1.0/h_sep);
+                  +pow(beta0,4))/21.0/pow(beta1,4)*h_sep*log(1.0/h_sep);
           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);
+                  +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);
+                  +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;*/
         } else {
           //a_sq = 6.0*MY_PI*mu*radi*(beta0*beta0/beta1/beta1/h_sep);
@@ -576,34 +576,34 @@ void PairLubricateUPoly::compute_Fh(double **x)
         fx  = a_sq*vn1;
         fy  = a_sq*vn2;
         fz  = a_sq*vn3;
-        
+
         // Find force due to all shear kind of motions
 
         if (flaglog) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
-        
+
         // Scale forces to obtain in appropriate units
 
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
-	// set j = nlocal so that only I gets tallied
+
+        // set j = nlocal so that only I gets tallied
 
         if (evflag) ev_tally_xyz(i,nlocal,nlocal,0,
-				 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
+                                 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
       }
     }
   }
 }
 
-/* ---------------------------------------------------------------------- 
-  computes R_FU * U 
+/* ----------------------------------------------------------------------
+  computes R_FU * U
 ---------------------------------------------------------------------- */
-  
+
 void PairLubricateUPoly::compute_RU(double **x)
 {
   int i,j,ii,jj,inum,jnum,itype,jtype;
@@ -618,10 +618,10 @@ void PairLubricateUPoly::compute_RU(double **x)
   double rsq,r,radi,radj,h_sep;
   //double beta0,beta1;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3,wdotn,wt1,wt2,wt3;   
+  double vt1,vt2,vt3,wdotn,wt1,wt2,wt3;
   double inv_inertia;
   double vi[3],vj[3],wi[3],wj[3],xl[3],jl[3],pre[2];
-  
+
   double **v = atom->v;
   double **f = atom->f;
   double **omega = atom->omega;
@@ -634,14 +634,14 @@ void PairLubricateUPoly::compute_RU(double **x)
   double a_sq = 0.0;
   double a_sh = 0.0;
   double a_pu = 0.0;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
 
   beta[0][0] = beta[1][0] = beta[1][4] = 0.0;
-  
+
  // This section of code adjusts R0/RT0/RS0 if necessary due to changes
   // in the volume fraction as a result of fix deform or moving walls
 
@@ -649,50 +649,50 @@ void PairLubricateUPoly::compute_RU(double **x)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	 double wallhi[3], walllo[3];
-	 for (j = 0; j < 3; j++){
-	   wallhi[j] = domain->prd[j];
-	   walllo[j] = 0;
-	 }    
-	 for (int m = 0; m < wallfix->nwall; m++){
-	   int dim = wallfix->wallwhich[m] / 2;
-	   int side = wallfix->wallwhich[m] % 2;
-	   if (wallfix->wallstyle[m] == VARIABLE){
-	     wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	   }	   
-	   else wallcoord = wallfix->coord0[m];	   
-	   if (side == 0) walllo[dim] = wallcoord;
-	   else wallhi[dim] = wallcoord;	   
-	 }
-	 for (j = 0; j < 3; j++)
-	   dims[j] = wallhi[j] - walllo[j];
+         double wallhi[3], walllo[3];
+         for (j = 0; j < 3; j++){
+           wallhi[j] = domain->prd[j];
+           walllo[j] = 0;
+         }
+         for (int m = 0; m < wallfix->nwall; m++){
+           int dim = wallfix->wallwhich[m] / 2;
+           int side = wallfix->wallwhich[m] % 2;
+           if (wallfix->wallstyle[m] == VARIABLE){
+             wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+           }
+           else wallcoord = wallfix->coord0[m];
+           if (side == 0) walllo[dim] = wallcoord;
+           else wallhi[dim] = wallcoord;
+         }
+         for (j = 0; j < 3; j++)
+           dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	R0  = 6*MY_PI*mu*(1.0 + 2.16*vol_f);
-	RT0 = 8*MY_PI*mu;
-	//	RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*(1.0 + 2.16*vol_f);
+        RT0 = 8*MY_PI*mu;
+        //        RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	R0  = 6*MY_PI*mu*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	//	RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        //        RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
   // end of R0 adjustment code
 
   // Initialize f to zero
-  
+
   for (i=0;i<nlocal+nghost;i++)
     for (j=0;j<3;j++) {
       f[i][j] = 0.0;
       torque[i][j] = 0.0;
     }
-  
+
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
     xtmp = x[i][0];
@@ -701,26 +701,26 @@ void PairLubricateUPoly::compute_RU(double **x)
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];   
+    jnum = numneigh[i];
     pre[1] = 8.0*(pre[0] = MY_PI*mu*radi)*radi*radi;
     pre[0] *= 6.0;
-    
+
     // Find angular velocity
-    
+
     wi[0] = omega[i][0];
     wi[1] = omega[i][1];
-    wi[2] = omega[i][2];          
-    
+    wi[2] = omega[i][2];
+
     // Contribution due to the isotropic terms
 
     f[i][0] += -vxmu2f*R0*radi*v[i][0];
     f[i][1] += -vxmu2f*R0*radi*v[i][1];
-    f[i][2] += -vxmu2f*R0*radi*v[i][2];    
-    
+    f[i][2] += -vxmu2f*R0*radi*v[i][2];
+
     const double radi3 = radi*radi*radi;
     torque[i][0] += -vxmu2f*RT0*radi3*wi[0];
     torque[i][1] += -vxmu2f*RT0*radi3*wi[1];
-    torque[i][2] += -vxmu2f*RT0*radi3*wi[2];   
+    torque[i][2] += -vxmu2f*RT0*radi3*wi[2];
 
     if (!flagHI) continue;
 
@@ -732,184 +732,184 @@ void PairLubricateUPoly::compute_RU(double **x)
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
       radj = radius[j];
-      
+
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-        
-	wj[0] = omega[j][0];
-	wj[1] = omega[j][1];
-	wj[2] = omega[j][2];              
-        
+        r = sqrt(rsq);
+
+        wj[0] = omega[j][0];
+        wj[1] = omega[j][1];
+        wj[2] = omega[j][2];
+
         // loc of the point of closest approach on particle i from its center
-        
+
         xl[0] = -delx/r*radi;
         xl[1] = -dely/r*radi;
         xl[2] = -delz/r*radi;
         jl[0] = delx/r*radj;
         jl[1] = dely/r*radj;
         jl[2] = delz/r*radj;
-        
+
         // velocity at the point of closest approach on both particles
         // v = v + omega_cross_xl
-        
+
         // particle i
-        
+
         vi[0] = v[i][0] + (wi[1]*xl[2] - wi[2]*xl[1]);
         vi[1] = v[i][1] + (wi[2]*xl[0] - wi[0]*xl[2]);
         vi[2] = v[i][2] + (wi[0]*xl[1] - wi[1]*xl[0]);
-        
+
         // particle j
-        
+
         vj[0] = v[j][0] + (wj[1]*jl[2] - wj[2]*jl[1]);
         vj[1] = v[j][1] + (wj[2]*jl[0] - wj[0]*jl[2]);
         vj[2] = v[j][2] + (wj[0]*jl[1] - wj[1]*jl[0]);
-        
+
         // Find the scalar resistances a_sq and a_sh
-        
+
         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])
-          h_sep = cut_inner[itype][jtype] - radi-radj;          
-        
+          h_sep = cut_inner[itype][jtype] - radi-radj;
+
         // Scale h_sep by radi
-        
+
         h_sep = h_sep/radi;
-	beta[0][1] = radj/radi;
-	beta[1][1] = 1.0 + beta[0][1];
+        beta[0][1] = radj/radi;
+        beta[1][1] = 1.0 + beta[0][1];
 
         // Scalar resistances
-        
+
         if (flaglog) {
-	  beta[0][2] = beta[0][1]*beta[0][1];
-	  beta[0][3] = beta[0][2]*beta[0][1];
-	  beta[0][4] = beta[0][3]*beta[0][1];
-	  beta[1][2] = beta[1][1]*beta[1][1];
-	  beta[1][3] = beta[1][2]*beta[1][1];
-	  double log_h_sep_beta13 = log(1.0/h_sep)/beta[1][3];
-	  double h_sep_beta11 = h_sep/beta[1][1];
-
-	  a_sq = pre[0]*(beta[0][2]/beta[1][2]/h_sep
-		+((0.2+1.4*beta[0][1]+0.2*beta[0][2])
-		  +(1.0+18.0*(beta[0][1]+beta[0][3])-29.0*beta[0][2]
-		    +beta[0][4])*h_sep_beta11/21.0)*log_h_sep_beta13);
-
-	  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));
+          beta[0][2] = beta[0][1]*beta[0][1];
+          beta[0][3] = beta[0][2]*beta[0][1];
+          beta[0][4] = beta[0][3]*beta[0][1];
+          beta[1][2] = beta[1][1]*beta[1][1];
+          beta[1][3] = beta[1][2]*beta[1][1];
+          double log_h_sep_beta13 = log(1.0/h_sep)/beta[1][3];
+          double h_sep_beta11 = h_sep/beta[1][1];
+
+          a_sq = pre[0]*(beta[0][2]/beta[1][2]/h_sep
+                +((0.2+1.4*beta[0][1]+0.2*beta[0][2])
+                  +(1.0+18.0*(beta[0][1]+beta[0][3])-29.0*beta[0][2]
+                    +beta[0][4])*h_sep_beta11/21.0)*log_h_sep_beta13);
+
+          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)*log(1.0/h_sep);
+                  +(1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3)*log(1.0/h_sep);
           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*log(1.0/h_sep);
+                  +pow(beta0,4))/21.0/pow(beta1,4)*h_sep*log(1.0/h_sep);
           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);
+                  +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);
+                  +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 = 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);
+                  +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));
+        } else
+          a_sq = pre[0]*(beta[0][1]*beta[0][1]/(beta[1][1]*beta[1][1]*h_sep));
 
         // Relative  velocity at the point of closest approach
-        
+
         vr1 = vi[0] - vj[0];
         vr2 = vi[1] - vj[1];
         vr3 = vi[2] - vj[2];
-        
+
         // Normal component (vr.n)n
-        
+
         vnnr = (vr1*delx + vr2*dely + vr3*delz)/r;
         vn1 = vnnr*delx/r;
         vn2 = vnnr*dely/r;
         vn3 = vnnr*delz/r;
-        
+
         // Tangential component vr - (vr.n)n
-        
+
         vt1 = vr1 - vn1;
         vt2 = vr2 - vn2;
         vt3 = vr3 - vn3;
-        
+
         // Find force due to squeeze type motion
-        
+
         fx  = a_sq*vn1;
         fy  = a_sq*vn2;
         fz  = a_sq*vn3;
-        
+
         // Find force due to all shear kind of motions
-        
+
         if (flaglog) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
-        
+
         // Scale forces to obtain in appropriate units
-        
+
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
+
         // Add to the total forc
-        
+
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;    
-        
+        f[i][2] -= fz;
+
         // Find torque due to this force
-        
+
         if (flaglog) {
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;                  
-          
+          tz = xl[0]*fy - xl[1]*fx;
+
           // Why a scale factor ?
-          
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-          
+          torque[i][2] -= vxmu2f*tz;
+
           // Torque due to a_pu
-          
-          wdotn = ((wi[0]-wj[0])*delx + 
+
+          wdotn = ((wi[0]-wj[0])*delx +
                    (wi[1]-wj[1])*dely + (wi[2]-wj[2])*delz)/r;
           wt1 = (wi[0]-wj[0]) - wdotn*delx/r;
           wt2 = (wi[1]-wj[1]) - wdotn*dely/r;
           wt3 = (wi[2]-wj[2]) - wdotn*delz/r;
-          
+
           tx = a_pu*wt1;
           ty = a_pu*wt2;
           tz = a_pu*wt3;
-          
+
           // add to total
-          
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-        }      
+          torque[i][2] -= vxmu2f*tz;
+        }
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   This computes R_{FE}*E , where E is the rate of strain of tensor which is 
+   This computes R_{FE}*E , where E is the rate of strain of tensor which is
    known apriori, as it depends only on the known fluid velocity.
    So, this part of the hydrodynamic interaction can be pre computed and
    transferred to the RHS
@@ -919,17 +919,17 @@ void PairLubricateUPoly::compute_RE(double **x)
 {
   int i,j,ii,jj,inum,jnum,itype,jtype;
   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;
   //double beta0,beta1,lhsep;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3;  
+  double vt1,vt2,vt3;
   double xl[3],pre[2];
-  
+
   double **f = atom->f;
   double **torque = atom->torque;
   double *radius = atom->radius;
@@ -946,7 +946,7 @@ void PairLubricateUPoly::compute_RE(double **x)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   beta[0][0] = beta[1][0] = beta[1][4] = 0.0;
 
   for (ii = 0; ii < inum; ii++) {
@@ -960,8 +960,8 @@ void PairLubricateUPoly::compute_RE(double **x)
     jnum = numneigh[i];
     pre[1] = 8.0*(pre[0] = MY_PI*mu*radi)*radi*radi;
     pre[0] *= 6.0;
-    
-    // No contribution from isotropic terms due to E    
+
+    // No contribution from isotropic terms due to E
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       delx = xtmp - x[j][0];
@@ -970,161 +970,161 @@ void PairLubricateUPoly::compute_RE(double **x)
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
       radj = radius[j];
-      
+
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-        
+        r = sqrt(rsq);
+
         // loc of the point of closest approach on particle i from its center
-        
+
         xl[0] = -delx/r*radi;
         xl[1] = -dely/r*radi;
         xl[2] = -delz/r*radi;
-        
+
         // Find the scalar resistances a_sq and a_sh
-        
+
         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])
           h_sep = cut_inner[itype][jtype] - radi-radj;
-        
+
         // Scale h_sep by radi
-        
+
         h_sep = h_sep/radi;
-	beta[0][1] = radj/radi;
-	beta[1][1] = 1.0 + beta[0][1];
+        beta[0][1] = radj/radi;
+        beta[1][1] = 1.0 + beta[0][1];
 
         /*beta0 = radj/radi;
         beta1 = 1.0 + beta0;
-	lhsep = log(1.0/h_sep);*/
-        
+        lhsep = log(1.0/h_sep);*/
+
         // Scalar resistance for Squeeze type motions
-        
+
 
         if (flaglog) {
-	  beta[0][2] = beta[0][1]*beta[0][1];
-	  beta[0][3] = beta[0][2]*beta[0][1];
-	  beta[0][4] = beta[0][3]*beta[0][1];
-	  beta[1][2] = beta[1][1]*beta[1][1];
-	  beta[1][3] = beta[1][2]*beta[1][1];
-	  double log_h_sep_beta13 = log(1.0/h_sep)/beta[1][3];
-	  double h_sep_beta11 = h_sep/beta[1][1];
-
-	  a_sq = pre[0]*(beta[0][2]/beta[1][2]/h_sep
-		+((0.2+1.4*beta[0][1]+0.2*beta[0][2])
-		  +(1.0+18.0*(beta[0][1]+beta[0][3])-29.0*beta[0][2]
-		    +beta[0][4])*h_sep_beta11/21.0)*log_h_sep_beta13);
-
-	  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));
+          beta[0][2] = beta[0][1]*beta[0][1];
+          beta[0][3] = beta[0][2]*beta[0][1];
+          beta[0][4] = beta[0][3]*beta[0][1];
+          beta[1][2] = beta[1][1]*beta[1][1];
+          beta[1][3] = beta[1][2]*beta[1][1];
+          double log_h_sep_beta13 = log(1.0/h_sep)/beta[1][3];
+          double h_sep_beta11 = h_sep/beta[1][1];
+
+          a_sq = pre[0]*(beta[0][2]/beta[1][2]/h_sep
+                +((0.2+1.4*beta[0][1]+0.2*beta[0][2])
+                  +(1.0+18.0*(beta[0][1]+beta[0][3])-29.0*beta[0][2]
+                    +beta[0][4])*h_sep_beta11/21.0)*log_h_sep_beta13);
+
+          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;
+                  +(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;
+                  +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);
+                  +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);
+                  +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 = 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);
+                  +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
+        } else
           a_sq = pre[0]*(beta[0][1]*beta[0][1]/(beta[1][1]*beta[1][1]*h_sep));
 
         // Relative velocity at the point of closest approach due to Ef only
 
         vr1 = -2.0*(Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
         vr2 = -2.0*(Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
-        vr3 = -2.0*(Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);        
-        
+        vr3 = -2.0*(Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
+
         // Normal component (vr.n)n
-        
+
         vnnr = (vr1*delx + vr2*dely + vr3*delz)/r;
         vn1 = vnnr*delx/r;
         vn2 = vnnr*dely/r;
         vn3 = vnnr*delz/r;
-        
+
         // Tangential component vr - (vr.n)n
-        
+
         vt1 = vr1 - vn1;
         vt2 = vr2 - vn2;
         vt3 = vr3 - vn3;
-        
+
         // Find force due to squeeze type motion
-        
+
         fx  = a_sq*vn1;
         fy  = a_sq*vn2;
         fz  = a_sq*vn3;
-        
+
         // Find force due to all shear kind of motions
-        
+
         if (flaglog) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
-        
+
         // Scale forces to obtain in appropriate units
-        
+
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
+
         // Add to the total forc
-        
+
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;    
-        
+        f[i][2] -= fz;
+
         // Find torque due to this force
-        
+
         if (flaglog) {
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;                  
-          
+          tz = xl[0]*fy - xl[1]*fx;
+
           // Why a scale factor ?
-          
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-          
+          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);
 }
 
 /*-----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLubricateUPoly::settings(int narg, char **arg)
 {
   int itype;
-  
+
   if (narg < 5 || narg > 7) error->all(FLERR,"Illegal pair_style command");
 
   mu = atof(arg[0]);
@@ -1139,9 +1139,9 @@ void PairLubricateUPoly::settings(int narg, char **arg)
 
   if (flaglog == 1 && flagHI == 0) {
     error->warning(FLERR,"Cannot include log terms without 1/r terms; "
-		   "setting flagHI to 1");
+                   "setting flagHI to 1");
     flagHI = 1;
-  } 
+  }
 
   // reset cutoffs that have been explicitly set
 
@@ -1154,7 +1154,7 @@ void PairLubricateUPoly::settings(int narg, char **arg)
           cut[i][j] = cut_global;
         }
   }
-  
+
   // Store the rate of strain tensor
 
   Ef[0][0] = 0.0;
@@ -1165,8 +1165,8 @@ void PairLubricateUPoly::settings(int narg, char **arg)
   Ef[1][2] = 0.0;
   Ef[2][0] = 0.0;
   Ef[2][1] = 0.0;
-  Ef[2][2] = 0.0; 
-  
+  Ef[2][2] = 0.0;
+
 
 }
 
@@ -1180,7 +1180,7 @@ void PairLubricateUPoly::init_style()
     error->all(FLERR,"Pair lubricateU/poly requires newton pair off");
   if (comm->ghost_velocity == 0)
     error->all(FLERR,
-	       "Pair lubricateU/poly requires ghost atoms store velocity");
+               "Pair lubricateU/poly requires ghost atoms store velocity");
   if (!atom->sphere_flag)
     error->all(FLERR,"Pair lubricate/poly requires atom style sphere");
 
@@ -1192,10 +1192,10 @@ void PairLubricateUPoly::init_style()
   int nlocal = atom->nlocal;
 
   for (int i = 0; i < nlocal; i++)
-    if (radius[i] == 0.0) 
+    if (radius[i] == 0.0)
       error->one(FLERR,"Pair lubricate/poly requires extended particles");
   // Set the isotropic constants depending on the volume fraction
-  
+
   // Find the total volume
   // check for fix deform, if exists it must use "remap v"
   // If box will change volume, set appropriate flag so that volume
@@ -1208,46 +1208,46 @@ void PairLubricateUPoly::init_style()
 
   flagdeform = flagwall = 0;
   for (int i = 0; i < modify->nfix; i++){
-    if (strcmp(modify->fix[i]->style,"deform") == 0) 
+    if (strcmp(modify->fix[i]->style,"deform") == 0)
       flagdeform = 1;
     else if (strstr(modify->fix[i]->style,"wall") != NULL){
       flagwall = 1; // Walls exist
       if (((FixWall *) modify->fix[i])->varflag ) {
-	flagwall = 2; // Moving walls exist
-	wallfix = (FixWall *) modify->fix[i];
+        flagwall = 2; // Moving walls exist
+        wallfix = (FixWall *) modify->fix[i];
       }
     }
   }
-  
+
 
   // set the isotropic constants depending on the volume fraction
-  // vol_T = total volumeshearing = flagdeform = flagwall = 0;  
+  // vol_T = total volumeshearing = flagdeform = flagwall = 0;
   double vol_T, wallcoord;
     if (!flagwall) vol_T = domain->xprd*domain->yprd*domain->zprd;
-  else {    
+  else {
     double wallhi[3], walllo[3];
     for (int j = 0; j < 3; j++){
       wallhi[j] = domain->prd[j];
       walllo[j] = 0;
-    }    
+    }
     for (int m = 0; m < wallfix->nwall; m++){
       int dim = wallfix->wallwhich[m] / 2;
       int side = wallfix->wallwhich[m] % 2;
       if (wallfix->wallstyle[m] == VARIABLE){
-	wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
-	//Since fix->wall->init happens after pair->init_style
-	wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+        wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
+        //Since fix->wall->init happens after pair->init_style
+        wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
       }
 
       else wallcoord = wallfix->coord0[m];
-      
+
       if (side == 0) walllo[dim] = wallcoord;
       else wallhi[dim] = wallcoord;
     }
-    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) * 
+    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) *
       (wallhi[2] - walllo[2]);
   }
-  
+
   // Assuming monodisperse spheres, find the volume of the particles
 
   double volP = 0.0;
@@ -1266,14 +1266,14 @@ void PairLubricateUPoly::init_style()
   if (!comm->me) {
     if(logfile)
       fprintf(logfile, "lubricateU: vol_f = %g, vol_p = %g, vol_T = %g\n",
-	  vol_f,vol_P,vol_T);
+          vol_f,vol_P,vol_T);
     if (screen)
       fprintf(screen, "lubricateU: vol_f = %g, vol_p = %g, vol_T = %g\n",
-	  vol_f,vol_P,vol_T);
+          vol_f,vol_P,vol_T);
   }
 
   // Set the isotropic constant
-  
+
   if (flaglog == 0) {
     R0  = 6*MY_PI*mu*(1.0 + 2.16*vol_f);
     RT0 = 8*MY_PI*mu;  // Not needed actually
diff --git a/src/FLD/pair_lubricateU_poly.h b/src/FLD/pair_lubricateU_poly.h
index 7faf0b2bcf..755788b718 100644
--- a/src/FLD/pair_lubricateU_poly.h
+++ b/src/FLD/pair_lubricateU_poly.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/FLD/pair_lubricate_poly.cpp b/src/FLD/pair_lubricate_poly.cpp
index f03fae3dfa..168b6e8285 100644
--- a/src/FLD/pair_lubricate_poly.cpp
+++ b/src/FLD/pair_lubricate_poly.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,7 +69,7 @@ void PairLubricatePoly::compute(int eflag, int vflag)
   double xtmp,ytmp,ztmp,delx,dely,delz,fpair,fx,fy,fz,tx,ty,tz;
   double rsq,r,h_sep,h_sepj,beta0,beta1,betaj,betaj1,radi,radj,tfmag;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3,wt1,wt2,wt3,wdotn;  
+  double vt1,vt2,vt3,wt1,wt2,wt3,wdotn;
   double inertia,inv_inertia,vRS0;
   double vi[3],vj[3],wi[3],wj[3],xl[3],jl[3];
   double a_sq,a_sh,a_pu,Fbmag,del,delmin,eta;
@@ -95,7 +95,7 @@ void PairLubricatePoly::compute(int eflag, int vflag)
   int newton_pair = force->newton_pair;
 
   int overlaps = 0;
-    
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
@@ -120,8 +120,8 @@ void PairLubricatePoly::compute(int eflag, int vflag)
       itype = type[i];
       radi = radius[i];
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
-	h_rate[4]*lamda[2] + h_ratelo[0];
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
+        h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       v[i][0] -= vstream[0];
@@ -137,7 +137,7 @@ void PairLubricatePoly::compute(int eflag, int vflag)
 
     Ef[0][0] = h_rate[0]/domain->xprd;
     Ef[1][1] = h_rate[1]/domain->yprd;
-    Ef[2][2] = h_rate[2]/domain->zprd; 
+    Ef[2][2] = h_rate[2]/domain->zprd;
     Ef[0][1] = Ef[1][0] = 0.5 * h_rate[5]/domain->yprd;
     Ef[0][2] = Ef[2][0] = 0.5 * h_rate[4]/domain->zprd;
     Ef[1][2] = Ef[2][1] = 0.5 * h_rate[3]/domain->zprd;
@@ -147,7 +147,7 @@ void PairLubricatePoly::compute(int eflag, int vflag)
 
     comm->forward_comm_pair(this);
   }
-  
+
   // This section of code adjusts R0/RT0/RS0 if necessary due to changes
   // in the volume fraction as a result of fix deform or moving walls
 
@@ -155,43 +155,43 @@ void PairLubricatePoly::compute(int eflag, int vflag)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	 double wallhi[3], walllo[3];
-	 for (int j = 0; j < 3; j++){
-	   wallhi[j] = domain->prd[j];
-	   walllo[j] = 0;
-	 }    
-	 for (int m = 0; m < wallfix->nwall; m++){
-	   int dim = wallfix->wallwhich[m] / 2;
-	   int side = wallfix->wallwhich[m] % 2;
-	   if (wallfix->wallstyle[m] == VARIABLE){
-	     wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	   }	   
-	   else wallcoord = wallfix->coord0[m];	   
-	   if (side == 0) walllo[dim] = wallcoord;
-	   else wallhi[dim] = wallcoord;	   
-	 }
-	 for (int j = 0; j < 3; j++)
-	   dims[j] = wallhi[j] - walllo[j];
+         double wallhi[3], walllo[3];
+         for (int j = 0; j < 3; j++){
+           wallhi[j] = domain->prd[j];
+           walllo[j] = 0;
+         }
+         for (int m = 0; m < wallfix->nwall; m++){
+           int dim = wallfix->wallwhich[m] / 2;
+           int side = wallfix->wallwhich[m] % 2;
+           if (wallfix->wallstyle[m] == VARIABLE){
+             wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+           }
+           else wallcoord = wallfix->coord0[m];
+           if (side == 0) walllo[dim] = wallcoord;
+           else wallhi[dim] = wallcoord;
+         }
+         for (int j = 0; j < 3; j++)
+           dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	R0  = 6*MY_PI*mu*(1.0 + 2.16*vol_f);
-	RT0 = 8*MY_PI*mu;
-	RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*(1.0 + 2.16*vol_f);
+        RT0 = 8*MY_PI*mu;
+        RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	R0  = 6*MY_PI*mu*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
 
-  // end of R0 adjustment code  
- 
+  // end of R0 adjustment code
+
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
     xtmp = x[i][0];
@@ -199,15 +199,15 @@ void PairLubricatePoly::compute(int eflag, int vflag)
     ztmp = x[i][2];
     itype = type[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];   
+    jnum = numneigh[i];
     radi = radius[i];
 
     // angular velocity
 
     wi[0] = omega[i][0];
     wi[1] = omega[i][1];
-    wi[2] = omega[i][2];          
-     
+    wi[2] = omega[i][2];
+
     // FLD contribution to force and torque due to isotropic terms
     // FLD contribution to stress from isotropic RS0
 
@@ -215,21 +215,21 @@ void PairLubricatePoly::compute(int eflag, int vflag)
       f[i][0] -= vxmu2f*R0*radi*v[i][0];
       f[i][1] -= vxmu2f*R0*radi*v[i][1];
       f[i][2] -= vxmu2f*R0*radi*v[i][2];
-      const double radi3 = radi*radi*radi;    
+      const double radi3 = radi*radi*radi;
       torque[i][0] -= vxmu2f*RT0*radi3*wi[0];
       torque[i][1] -= vxmu2f*RT0*radi3*wi[1];
-      torque[i][2] -= vxmu2f*RT0*radi3*wi[2];   
-    
+      torque[i][2] -= vxmu2f*RT0*radi3*wi[2];
+
       if (shearing && vflag_either) {
-	vRS0 = -vxmu2f * RS0*radi3;
-	v_tally_tensor(i,i,nlocal,newton_pair,
-		       vRS0*Ef[0][0],vRS0*Ef[1][1],vRS0*Ef[2][2],
-		       vRS0*Ef[0][1],vRS0*Ef[0][2],vRS0*Ef[1][2]);
+        vRS0 = -vxmu2f * RS0*radi3;
+        v_tally_tensor(i,i,nlocal,newton_pair,
+                       vRS0*Ef[0][0],vRS0*Ef[1][1],vRS0*Ef[2][2],
+                       vRS0*Ef[0][1],vRS0*Ef[0][2],vRS0*Ef[1][2]);
       }
     }
 
     if (!flagHI) continue;
-    
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       delx = xtmp - x[j][0];
@@ -240,13 +240,13 @@ void PairLubricatePoly::compute(int eflag, int vflag)
       radj = atom->radius[j];
 
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-  
+        r = sqrt(rsq);
+
         // angular momentum = I*omega = 2/5 * M*R^2 * omega
 
-	wj[0] = omega[j][0];
-	wj[1] = omega[j][1];
-	wj[2] = omega[j][2];              
+        wj[0] = omega[j][0];
+        wj[1] = omega[j][1];
+        wj[2] = omega[j][2];
 
         // xl = point of closest approach on particle i from its center
 
@@ -256,7 +256,7 @@ void PairLubricatePoly::compute(int eflag, int vflag)
         jl[0] = -delx/r*radj;
         jl[1] = -dely/r*radj;
         jl[2] = -delz/r*radj;
-  
+
         // velocity at the point of closest approach on both particles
         // v = v + omega_cross_xl - Ef.xl
 
@@ -264,71 +264,71 @@ void PairLubricatePoly::compute(int eflag, int vflag)
 
         vi[0] = v[i][0] + (wi[1]*xl[2] - wi[2]*xl[1])
                         - (Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
-        
+
         vi[1] = v[i][1] + (wi[2]*xl[0] - wi[0]*xl[2])
                         - (Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
-        
+
         vi[2] = v[i][2] + (wi[0]*xl[1] - wi[1]*xl[0])
                         - (Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
-  
+
         // particle j
 
         vj[0] = v[j][0] - (wj[1]*jl[2] - wj[2]*jl[1])
                         + (Ef[0][0]*jl[0] + Ef[0][1]*jl[1] + Ef[0][2]*jl[2]);
-        
+
         vj[1] = v[j][1] - (wj[2]*jl[0] - wj[0]*jl[2])
                         + (Ef[1][0]*jl[0] + Ef[1][1]*jl[1] + Ef[1][2]*jl[2]);
-        
+
         vj[2] = v[j][2] - (wj[0]*jl[1] - wj[1]*jl[0])
                         + (Ef[2][0]*jl[0] + Ef[2][1]*jl[1] + Ef[2][2]*jl[2]);
-        
+
         // scalar resistances XA and YA
 
         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])
-          h_sep = cut_inner[itype][jtype] - radi-radj;          
-        
+          h_sep = cut_inner[itype][jtype] - radi-radj;
+
         // scale h_sep by radi
 
         h_sep = h_sep/radi;
         beta0 = radj/radi;
         beta1 = 1.0 + beta0;
-  
+
         // scalar resistances
 
         if (flaglog) {
-          a_sq = beta0*beta0/beta1/beta1/h_sep + 
-	    (1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3.0)*log(1.0/h_sep);
-          a_sq += (1.0+18.0*beta0-29.0*beta0*beta0+18.0 * 
-		   pow(beta0,3.0)+pow(beta0,4.0))/21.0/pow(beta1,4.0) * 
-	    h_sep*log(1.0/h_sep);
+          a_sq = beta0*beta0/beta1/beta1/h_sep +
+            (1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3.0)*log(1.0/h_sep);
+          a_sq += (1.0+18.0*beta0-29.0*beta0*beta0+18.0 *
+                   pow(beta0,3.0)+pow(beta0,4.0))/21.0/pow(beta1,4.0) *
+            h_sep*log(1.0/h_sep);
           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.0) * 
-	    log(1.0/h_sep);
-          a_sh += 4.0*(16.0-45.0*beta0+58.0*beta0*beta0-45.0*pow(beta0,3.0) + 
-		       16.0*pow(beta0,4.0))/375.0/pow(beta1,4.0) * 
-	    h_sep*log(1.0/h_sep);
+          a_sh = 4.0*beta0*(2.0+beta0+2.0*beta0*beta0)/15.0/pow(beta1,3.0) *
+            log(1.0/h_sep);
+          a_sh += 4.0*(16.0-45.0*beta0+58.0*beta0*beta0-45.0*pow(beta0,3.0) +
+                       16.0*pow(beta0,4.0))/375.0/pow(beta1,4.0) *
+            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.0))/250.0/pow(beta1,3.0)*h_sep*log(1.0/h_sep);
+          a_pu += (32.0-33.0*beta0+83.0*beta0*beta0+43.0 *
+                   pow(beta0,3.0))/250.0/pow(beta1,3.0)*h_sep*log(1.0/h_sep);
           a_pu *= 8.0*MY_PI*mu*pow(radi,3.0);
         } else a_sq = 6.0*MY_PI*mu*radi*(beta0*beta0/beta1/beta1/h_sep);
-  
+
         // relative velocity at the point of closest approach
-	// includes fluid velocity
+        // includes fluid velocity
 
         vr1 = vi[0] - vj[0];
         vr2 = vi[1] - vj[1];
         vr3 = vi[2] - vj[2];
-        
+
         // normal component (vr.n)n
 
         vnnr = (vr1*delx + vr2*dely + vr3*delz)/r;
@@ -353,7 +353,7 @@ void PairLubricatePoly::compute(int eflag, int vflag)
         if (flaglog) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
 
         // scale forces for appropriate units
@@ -361,50 +361,50 @@ void PairLubricatePoly::compute(int eflag, int vflag)
         fx *= vxmu2f;
         fy *= vxmu2f;
         fz *= vxmu2f;
-        
+
         // add to total force
 
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;    
-        
+        f[i][2] -= fz;
+
         // torque due to this force
 
         if (flaglog) {
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;                  
-    
+          tz = xl[0]*fy - xl[1]*fx;
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
+          torque[i][2] -= vxmu2f*tz;
 
           // torque due to a_pu
 
-          wdotn = ((wi[0]-wj[0])*delx + (wi[1]-wj[1])*dely + 
-		   (wi[2]-wj[2])*delz)/r;
+          wdotn = ((wi[0]-wj[0])*delx + (wi[1]-wj[1])*dely +
+                   (wi[2]-wj[2])*delz)/r;
           wt1 = (wi[0]-wj[0]) - wdotn*delx/r;
           wt2 = (wi[1]-wj[1]) - wdotn*dely/r;
           wt3 = (wi[2]-wj[2]) - wdotn*delz/r;
-          
+
           tx = a_pu*wt1;
           ty = a_pu*wt2;
           tz = a_pu*wt3;
-          
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
+          torque[i][2] -= vxmu2f*tz;
 
-        }        
+        }
 
-	// set j = nlocal so that only I gets tallied
+        // set j = nlocal so that only I gets tallied
 
         if (evflag) ev_tally_xyz(i,nlocal,nlocal,0,
-				 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
+                                 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
       }
     }
   }
-  
+
   // restore streaming component of velocity, omega, angmom
 
   if (shearing) {
@@ -415,10 +415,10 @@ void PairLubricatePoly::compute(int eflag, int vflag)
       i = ilist[ii];
       itype = type[i];
       radi = atom->radius[i];
-      
+
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
-	h_rate[4]*lamda[2] + h_ratelo[0];
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
+        h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       v[i][0] += vstream[0];
@@ -452,7 +452,7 @@ void PairLubricatePoly::init_style()
     error->all(FLERR,"Pair lubricate/poly requires newton pair off");
   if (comm->ghost_velocity == 0)
     error->all(FLERR,
-	       "Pair lubricate/poly requires ghost atoms store velocity");
+               "Pair lubricate/poly requires ghost atoms store velocity");
   if (!atom->sphere_flag)
     error->all(FLERR,"Pair lubricate/poly requires atom style sphere");
 
@@ -464,7 +464,7 @@ void PairLubricatePoly::init_style()
   int nlocal = atom->nlocal;
 
   for (int i = 0; i < nlocal; i++)
-    if (radius[i] == 0.0) 
+    if (radius[i] == 0.0)
       error->one(FLERR,"Pair lubricate/poly requires extended particles");
 
   int irequest = neighbor->request(this);
@@ -482,20 +482,20 @@ void PairLubricatePoly::init_style()
   // due to walls, set volume appropriately; if walls will
   // move, set appropriate flag so that volume and v.f. corrections
   // are re-calculated at every step.
-  
+
   shearing = flagdeform = flagwall = 0;
   for (int i = 0; i < modify->nfix; i++){
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       shearing = flagdeform = 1;
-      if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP) 
-	error->all(FLERR,"Using pair lubricate with inconsistent "
-		   "fix deform remap option");
+      if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
+        error->all(FLERR,"Using pair lubricate with inconsistent "
+                   "fix deform remap option");
     }
     if (strstr(modify->fix[i]->style,"wall") != NULL){
       flagwall = 1; // Walls exist
       if (((FixWall *) modify->fix[i])->varflag ) {
-	flagwall = 2; // Moving walls exist
-	wallfix = (FixWall *) modify->fix[i];
+        flagwall = 2; // Moving walls exist
+        wallfix = (FixWall *) modify->fix[i];
       }
     }
   }
@@ -503,26 +503,26 @@ void PairLubricatePoly::init_style()
   double vol_T;
   double wallcoord;
   if (!flagwall) vol_T = domain->xprd*domain->yprd*domain->zprd;
-  else {    
+  else {
     double wallhi[3], walllo[3];
     for (int j = 0; j < 3; j++){
       wallhi[j] = domain->prd[j];
       walllo[j] = 0;
-    }    
+    }
     for (int m = 0; m < wallfix->nwall; m++){
       int dim = wallfix->wallwhich[m] / 2;
       int side = wallfix->wallwhich[m] % 2;
       if (wallfix->wallstyle[m] == VARIABLE){
-	wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
-	//Since fix->wall->init happens after pair->init_style
-	wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+        wallfix->varindex[m] = input->variable->find(wallfix->varstr[m]);
+        //Since fix->wall->init happens after pair->init_style
+        wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
       }
       else wallcoord = wallfix->coord0[m];
-      
+
       if (side == 0) walllo[dim] = wallcoord;
       else wallhi[dim] = wallcoord;
     }
-    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) * 
+    vol_T = (wallhi[0] - walllo[0]) * (wallhi[1] - walllo[1]) *
       (wallhi[2] - walllo[2]);
   }
 
@@ -534,16 +534,16 @@ void PairLubricatePoly::init_style()
   double vol_f = vol_P/vol_T;
 
   if (!flagVF) vol_f = 0;
-  
+
   // set isotropic constants
- 
+
   if (flaglog == 0) {
     R0  = 6*MY_PI*mu*(1.0 + 2.16*vol_f);
     RT0 = 8*MY_PI*mu;
     RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
   } else {
     R0  = 6*MY_PI*mu*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-    RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
+    RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
     RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
   }
 
@@ -553,9 +553,9 @@ void PairLubricatePoly::init_style()
   for (int i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       shearing = 1;
-      if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP) 
-	error->all(FLERR,"Using pair lubricate/poly with inconsistent "
-		   "fix deform remap option");
+      if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
+        error->all(FLERR,"Using pair lubricate/poly with inconsistent "
+                   "fix deform remap option");
     }
 
   // set Ef = 0 since used whether shearing or not
diff --git a/src/FLD/pair_lubricate_poly.h b/src/FLD/pair_lubricate_poly.h
index 0a31137dd3..28103b9f64 100644
--- a/src/FLD/pair_lubricate_poly.h
+++ b/src/FLD/pair_lubricate_poly.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp
index c7a468cf45..190ee86dd9 100644
--- a/src/GPU/fix_gpu.cpp
+++ b/src/GPU/fix_gpu.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,7 +45,7 @@ extern double lmp_gpu_forces(double **f, double **tor, double *eatom,
 FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (lmp->cuda) 
+  if (lmp->cuda)
     error->all(FLERR,"Cannot use fix GPU with USER-CUDA mode enabled");
 
   if (narg < 7) error->all(FLERR,"Illegal fix GPU command");
@@ -73,7 +73,7 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
   _particle_split = force->numeric(arg[6]);
   if (_particle_split==0 || _particle_split>1)
     error->all(FLERR,"Illegal fix GPU command");
-    
+
   int nthreads = 1;
   int threads_per_atom = -1;
   if (narg == 9) {
@@ -88,15 +88,15 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
 
   if (nthreads < 1)
     error->all(FLERR,"Illegal fix GPU command");
-    
+
   #ifndef _OPENMP
   if (nthreads > 1)
     error->all(FLERR,"No OpenMP support compiled in");
   #endif
 
   int gpu_flag = lmp_init_device(universe->uworld, world, first_gpu, last_gpu,
-				 _gpu_mode, _particle_split, nthreads,
-				 threads_per_atom);
+                                 _gpu_mode, _particle_split, nthreads,
+                                 threads_per_atom);
   GPU_EXTRA::check_flag(gpu_flag,error,world);
 }
 
@@ -125,11 +125,11 @@ void FixGPU::init()
 
   if (_gpu_mode == GPU_NEIGH || _gpu_mode == GPU_HYB_NEIGH)
     if (force->pair_match("hybrid",1) != NULL ||
-	force->pair_match("hybrid/overlay",1) != NULL)
+        force->pair_match("hybrid/overlay",1) != NULL)
       error->all(FLERR,"Cannot use pair hybrid with GPU neighbor builds");
   if (_particle_split < 0)
     if (force->pair_match("hybrid",1) != NULL ||
-	force->pair_match("hybrid/overlay",1) != NULL)
+        force->pair_match("hybrid/overlay",1) != NULL)
       error->all(FLERR,"Fix GPU split must be positive for hybrid pair styles");
 }
 
@@ -140,7 +140,7 @@ void FixGPU::setup(int vflag)
   if (_gpu_mode == GPU_NEIGH || _gpu_mode == GPU_HYB_NEIGH)
     if (neighbor->exclude_setting()!=0)
       error->all(FLERR,
-		 "Cannot use neigh_modify exclude with GPU neighbor builds");
+                 "Cannot use neigh_modify exclude with GPU neighbor builds");
   post_force(vflag);
 }
 
diff --git a/src/GPU/fix_gpu.h b/src/GPU/fix_gpu.h
index d9856102f7..88e8d30889 100644
--- a/src/GPU/fix_gpu.h
+++ b/src/GPU/fix_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/gpu_extra.h b/src/GPU/gpu_extra.h
index 9299d3b571..2c83806c00 100644
--- a/src/GPU/gpu_extra.h
+++ b/src/GPU/gpu_extra.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -24,33 +24,33 @@
 namespace GPU_EXTRA {
 
   inline void check_flag(int error_flag, LAMMPS_NS::Error *error,
-                         MPI_Comm &world) { 
+                         MPI_Comm &world) {
     int all_success;
     MPI_Allreduce(&error_flag, &all_success, 1, MPI_INT, MPI_MIN, world);
     if (all_success != 0) {
       if (all_success == -1)
-	error->all(FLERR,
-		   "The package gpu command is required for gpu styles"); 
+        error->all(FLERR,
+                   "The package gpu command is required for gpu styles");
       else if (all_success == -2)
-	error->all(FLERR,
-		   "Could not find/initialize a specified accelerator device");
+        error->all(FLERR,
+                   "Could not find/initialize a specified accelerator device");
       else if (all_success == -3)
-	error->all(FLERR,"Insufficient memory on accelerator");
+        error->all(FLERR,"Insufficient memory on accelerator");
       else if (all_success == -4)
-	error->all(FLERR,"GPU library not compiled for this accelerator");
+        error->all(FLERR,"GPU library not compiled for this accelerator");
       else if (all_success == -5)
-	error->all(FLERR,
-		   "Double precision is not supported on this accelerator");
+        error->all(FLERR,
+                   "Double precision is not supported on this accelerator");
       else if (all_success == -6)
-	error->all(FLERR,"Unable to initialize accelerator for use");
+        error->all(FLERR,"Unable to initialize accelerator for use");
       else if (all_success == -7)
-	error->all(FLERR,
+        error->all(FLERR,
                    "Accelerator sharing is not currently supported on system");
       else if (all_success == -8)
-	error->all(FLERR,
+        error->all(FLERR,
                    "GPU particle split must be set to 1 for this pair style.");
       else
-	error->all(FLERR,"Unknown error in GPU library");
+        error->all(FLERR,"Unknown error in GPU library");
     }
   };
 
diff --git a/src/GPU/pair_buck_coul_cut_gpu.cpp b/src/GPU/pair_buck_coul_cut_gpu.cpp
index a3db1e0dd3..9a7485713b 100644
--- a/src/GPU/pair_buck_coul_cut_gpu.cpp
+++ b/src/GPU/pair_buck_coul_cut_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -38,40 +38,40 @@
 // External functions from cuda library for atom decomposition
 
 int buckc_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv,
-		   double **host_buck1, double **host_buck2, double **host_a,
-		   double **host_c, double **offset, double *special_lj,
-		   const int inum, const int nall, const int max_nbors,
-		   const int maxspecial, const double cell_size,
-		   int &gpu_mode, FILE *screen, double **host_cut_ljsq,
-		   double **host_cut_coulsq, double *host_special_coul,
-		   const double qqrd2e);
+                   double **host_buck1, double **host_buck2, double **host_a,
+                   double **host_c, double **offset, double *special_lj,
+                   const int inum, const int nall, const int max_nbors,
+                   const int maxspecial, const double cell_size,
+                   int &gpu_mode, FILE *screen, double **host_cut_ljsq,
+                   double **host_cut_coulsq, double *host_special_coul,
+                   const double qqrd2e);
 void buckc_gpu_clear();
 int ** buckc_gpu_compute_n(const int ago, const int inum_full, const int nall,
-			   double **host_x, int *host_type, double *sublo,
-			   double *subhi, int *tag, int **nspecial, 
-			   int **special, const bool eflag, const bool vflag,
-			   const bool eatom, const bool vatom, int &host_start,
-			   int **ilist, int **jnum, const double cpu_time,
-			   bool &success, double *host_q, double *boxlo,
-			   double *prd);
+                           double **host_x, int *host_type, double *sublo,
+                           double *subhi, int *tag, int **nspecial,
+                           int **special, const bool eflag, const bool vflag,
+                           const bool eatom, const bool vatom, int &host_start,
+                           int **ilist, int **jnum, const double cpu_time,
+                           bool &success, double *host_q, double *boxlo,
+                           double *prd);
 void buckc_gpu_compute(const int ago, const int inum_full, const int nall,
-		       double **host_x, int *host_type, int *ilist, int *numj,
-		       int **firstneigh, const bool eflag, const bool vflag,
-		       const bool eatom, const bool vatom, int &host_start,
-		       const double cpu_time, bool &success, double *host_q,
-		       const int nlocal, double *boxlo, double *prd);
+                       double **host_x, int *host_type, int *ilist, int *numj,
+                       int **firstneigh, const bool eflag, const bool vflag,
+                       const bool eatom, const bool vatom, int &host_start,
+                       const double cpu_time, bool &success, double *host_q,
+                       const int nlocal, double *boxlo, double *prd);
 double buckc_gpu_bytes();
 
 using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-PairBuckCoulCutGPU::PairBuckCoulCutGPU(LAMMPS *lmp) : PairBuckCoulCut(lmp), 
-						      gpu_mode(GPU_FORCE)
+PairBuckCoulCutGPU::PairBuckCoulCutGPU(LAMMPS *lmp) : PairBuckCoulCut(lmp),
+                                                      gpu_mode(GPU_FORCE)
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -89,30 +89,30 @@ void PairBuckCoulCutGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
   int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = buckc_gpu_compute_n(neighbor->ago, inum, nall,
-				     atom->x, atom->type, domain->sublo,
-				     domain->subhi, atom->tag, atom->nspecial,
-				     atom->special, eflag, vflag, eflag_atom,
-				     vflag_atom, host_start, 
-				     &ilist, &numneigh, cpu_time, success, 
-				     atom->q, domain->boxlo, domain->prd);
+                                     atom->x, atom->type, domain->sublo,
+                                     domain->subhi, atom->tag, atom->nspecial,
+                                     atom->special, eflag, vflag, eflag_atom,
+                                     vflag_atom, host_start,
+                                     &ilist, &numneigh, cpu_time, success,
+                                     atom->q, domain->boxlo, domain->prd);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     buckc_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		      ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		      vflag_atom, host_start, cpu_time, success, atom->q,
-		      atom->nlocal, domain->boxlo, domain->prd);
+                      ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                      vflag_atom, host_start, cpu_time, success, atom->q,
+                      atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -130,9 +130,9 @@ void PairBuckCoulCutGPU::compute(int eflag, int vflag)
 
 void PairBuckCoulCutGPU::init_style()
 {
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,
-	       "Cannot use newton pair with buck/coul/cut/gpu pair style");
+               "Cannot use newton pair with buck/coul/cut/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
@@ -154,18 +154,18 @@ void PairBuckCoulCutGPU::init_style()
   int maxspecial=0;
   if (atom->molecular)
     maxspecial=atom->maxspecial;
-  int success = buckc_gpu_init(atom->ntypes+1, cutsq, rhoinv, buck1, buck2, 
-			       a, c, offset, force->special_lj, atom->nlocal,
-			       atom->nlocal+atom->nghost, 300, maxspecial,
-			       cell_size, gpu_mode, screen, cut_ljsq,
-			       cut_coulsq, force->special_coul, force->qqrd2e);
+  int success = buckc_gpu_init(atom->ntypes+1, cutsq, rhoinv, buck1, buck2,
+                               a, c, offset, force->special_lj, atom->nlocal,
+                               atom->nlocal+atom->nghost, 300, maxspecial,
+                               cell_size, gpu_mode, screen, cut_ljsq,
+                               cut_coulsq, force->special_coul, force->qqrd2e);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
     int irequest = neighbor->request(this);
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->full = 1;
-  } 
+  }
 }
 
 /* ---------------------------------------------------------------------- */
@@ -179,8 +179,8 @@ double PairBuckCoulCutGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairBuckCoulCutGPU::cpu_compute(int start, int inum, int eflag, int vflag,
-				     int *ilist, int *numneigh,
-				     int **firstneigh) {
+                                     int *ilist, int *numneigh,
+                                     int **firstneigh) {
   int i,j,ii,jj,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,qtmp,delx,dely,delz,evdwl,ecoul,fpair;
   double rsq,r2inv,r6inv,forcecoul,forcebuck,factor_coul,factor_lj;
@@ -188,7 +188,7 @@ void PairBuckCoulCutGPU::cpu_compute(int start, int inum, int eflag, int vflag,
   int *jlist;
 
   evdwl = ecoul = 0.0;
-  
+
   double **x = atom->x;
   double **f = atom->f;
   double *q = atom->q;
@@ -196,7 +196,7 @@ void PairBuckCoulCutGPU::cpu_compute(int start, int inum, int eflag, int vflag,
   double *special_coul = force->special_coul;
   double *special_lj = force->special_lj;
   double qqrd2e = force->qqrd2e;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = start; ii < inum; ii++) {
@@ -222,37 +222,37 @@ void PairBuckCoulCutGPU::cpu_compute(int start, int inum, int eflag, int vflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-  
-	if (rsq < cut_coulsq[itype][jtype])
-	  forcecoul = qqrd2e * qtmp*q[j]/r;
-	else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  rexp = exp(-r*rhoinv[itype][jtype]);
-	  forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
-	} else forcebuck = 0.0;
-	
-	fpair = (factor_coul*forcecoul + factor_lj*forcebuck) * r2inv;
-	
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  if (rsq < cut_coulsq[itype][jtype])
-	    ecoul = factor_coul * qqrd2e * qtmp*q[j]/r;
-	  else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+
+        if (rsq < cut_coulsq[itype][jtype])
+          forcecoul = qqrd2e * qtmp*q[j]/r;
+        else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          rexp = exp(-r*rhoinv[itype][jtype]);
+          forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
+        } else forcebuck = 0.0;
+
+        fpair = (factor_coul*forcecoul + factor_lj*forcebuck) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          if (rsq < cut_coulsq[itype][jtype])
+            ecoul = factor_coul * qqrd2e * qtmp*q[j]/r;
+          else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_buck_coul_cut_gpu.h b/src/GPU/pair_buck_coul_cut_gpu.h
index 85a4fafa56..e4535a197b 100644
--- a/src/GPU/pair_buck_coul_cut_gpu.h
+++ b/src/GPU/pair_buck_coul_cut_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_buck_coul_long_gpu.cpp b/src/GPU/pair_buck_coul_long_gpu.cpp
index 724f7846f2..6787062a09 100644
--- a/src/GPU/pair_buck_coul_long_gpu.cpp
+++ b/src/GPU/pair_buck_coul_long_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -47,40 +47,40 @@
 // External functions from cuda library for atom decomposition
 
 int buckcl_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv,
-		    double **host_buck1, double **host_buck2, double **host_a,
-		    double **host_c, double **offset, double *special_lj,
-		    const int inum, const int nall, const int max_nbors,
-		    const int maxspecial, const double cell_size,
-		    int &gpu_mode, FILE *screen, double **host_cut_ljsq,
-		    double host_cut_coulsq, double *host_special_coul,
-		    const double qqrd2e, const double g_ewald);
+                    double **host_buck1, double **host_buck2, double **host_a,
+                    double **host_c, double **offset, double *special_lj,
+                    const int inum, const int nall, const int max_nbors,
+                    const int maxspecial, const double cell_size,
+                    int &gpu_mode, FILE *screen, double **host_cut_ljsq,
+                    double host_cut_coulsq, double *host_special_coul,
+                    const double qqrd2e, const double g_ewald);
 void buckcl_gpu_clear();
 int** buckcl_gpu_compute_n(const int ago, const int inum_full, const int nall,
-			   double **host_x, int *host_type, double *sublo,
-			   double *subhi, int *tag, int **nspecial, 
-			   int **special, const bool eflag, const bool vflag,
-			   const bool eatom, const bool vatom, int &host_start,
-			   int **ilist, int **jnum,  const double cpu_time,
-			   bool &success, double *host_q, double *boxlo,
-			   double *prd);
+                           double **host_x, int *host_type, double *sublo,
+                           double *subhi, int *tag, int **nspecial,
+                           int **special, const bool eflag, const bool vflag,
+                           const bool eatom, const bool vatom, int &host_start,
+                           int **ilist, int **jnum,  const double cpu_time,
+                           bool &success, double *host_q, double *boxlo,
+                           double *prd);
 void buckcl_gpu_compute(const int ago, const int inum_full, const int nall,
-			double **host_x, int *host_type, int *ilist, int *numj,
-			int **firstneigh, const bool eflag, const bool vflag,
-			const bool eatom, const bool vatom, int &host_start,
-			const double cpu_time, bool &success, double *host_q,
-			const int nlocal, double *boxlo, double *prd);
+                        double **host_x, int *host_type, int *ilist, int *numj,
+                        int **firstneigh, const bool eflag, const bool vflag,
+                        const bool eatom, const bool vatom, int &host_start,
+                        const double cpu_time, bool &success, double *host_q,
+                        const int nlocal, double *boxlo, double *prd);
 double buckcl_gpu_bytes();
 
 using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-PairBuckCoulLongGPU::PairBuckCoulLongGPU(LAMMPS *lmp) : 
+PairBuckCoulLongGPU::PairBuckCoulLongGPU(LAMMPS *lmp) :
   PairBuckCoulLong(lmp), gpu_mode(GPU_FORCE)
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -98,30 +98,30 @@ void PairBuckCoulLongGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;    
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = buckcl_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				      atom->type, domain->sublo, domain->subhi,
-				      atom->tag, atom->nspecial, atom->special,
-				      eflag, vflag, eflag_atom, vflag_atom,
-				      host_start, &ilist, &numneigh, cpu_time,
-				      success, atom->q, domain->boxlo,
-				      domain->prd);
+                                      atom->type, domain->sublo, domain->subhi,
+                                      atom->tag, atom->nspecial, atom->special,
+                                      eflag, vflag, eflag_atom, vflag_atom,
+                                      host_start, &ilist, &numneigh, cpu_time,
+                                      success, atom->q, domain->boxlo,
+                                      domain->prd);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     buckcl_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		       ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		       vflag_atom, host_start, cpu_time, success, atom->q,
-		       atom->nlocal, domain->boxlo, domain->prd);
+                       ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                       vflag_atom, host_start, cpu_time, success, atom->q,
+                       atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -141,10 +141,10 @@ void PairBuckCoulLongGPU::init_style()
 {
   if (!atom->q_flag)
     error->all(FLERR,
-	       "Pair style buck/coul/long/gpu requires atom attribute q");
-  if (force->newton_pair) 
+               "Pair style buck/coul/long/gpu requires atom attribute q");
+  if (force->newton_pair)
     error->all(FLERR,
-	       "Cannot use newton pair with buck/coul/long/gpu pair style");
+               "Cannot use newton pair with buck/coul/long/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
@@ -174,12 +174,12 @@ void PairBuckCoulLongGPU::init_style()
   int maxspecial=0;
   if (atom->molecular)
     maxspecial=atom->maxspecial;
-  int success = buckcl_gpu_init(atom->ntypes+1, cutsq,  rhoinv, buck1, buck2, 
-				a, c, offset, force->special_lj, atom->nlocal,
-				atom->nlocal+atom->nghost, 300, maxspecial,
-				cell_size, gpu_mode, screen, cut_ljsq,
-				cut_coulsq, force->special_coul, force->qqrd2e,
-				g_ewald);
+  int success = buckcl_gpu_init(atom->ntypes+1, cutsq,  rhoinv, buck1, buck2,
+                                a, c, offset, force->special_lj, atom->nlocal,
+                                atom->nlocal+atom->nghost, 300, maxspecial,
+                                cell_size, gpu_mode, screen, cut_ljsq,
+                                cut_coulsq, force->special_coul, force->qqrd2e,
+                                g_ewald);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -200,8 +200,8 @@ double PairBuckCoulLongGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairBuckCoulLongGPU::cpu_compute(int start, int inum, int eflag,
-				       int vflag, int *ilist, int *numneigh,
-				       int **firstneigh)
+                                       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;
@@ -246,44 +246,44 @@ void PairBuckCoulLongGPU::cpu_compute(int start, int inum, int eflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-	if (rsq < cut_coulsq) {
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  rexp = exp(-r*rhoinv[itype][jtype]);
-	  forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
-	} else forcebuck = 0.0;
-
-	fpair = (forcecoul + factor_lj*forcebuck) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = prefactor*erfc;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+        if (rsq < cut_coulsq) {
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          rexp = exp(-r*rhoinv[itype][jtype]);
+          forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
+        } else forcebuck = 0.0;
+
+        fpair = (forcecoul + factor_lj*forcebuck) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            ecoul = prefactor*erfc;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_buck_coul_long_gpu.h b/src/GPU/pair_buck_coul_long_gpu.h
index 28b44b1094..8c8315b1c9 100644
--- a/src/GPU/pair_buck_coul_long_gpu.h
+++ b/src/GPU/pair_buck_coul_long_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_buck_gpu.cpp b/src/GPU/pair_buck_gpu.cpp
index d297a212ab..56443acff2 100644
--- a/src/GPU/pair_buck_gpu.cpp
+++ b/src/GPU/pair_buck_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -38,24 +38,24 @@
 // External functions from cuda library for atom decomposition
 
 int buck_gpu_init(const int ntypes, double **cutsq, double **host_rhoinv,
-		  double **host_buck1, double **host_buck2, 
-		  double **host_a, double **host_c,       
-		  double **offset, double *special_lj, const int inum,
-		  const int nall, const int max_nbors,  const int maxspecial,
-		  const double cell_size, int &gpu_mode, FILE *screen);
+                  double **host_buck1, double **host_buck2,
+                  double **host_a, double **host_c,
+                  double **offset, double *special_lj, const int inum,
+                  const int nall, const int max_nbors,  const int maxspecial,
+                  const double cell_size, int &gpu_mode, FILE *screen);
 void buck_gpu_clear();
 int ** buck_gpu_compute_n(const int ago, const int inum_full, const int nall,
-			  double **host_x, int *host_type, double *sublo,
-			  double *subhi, int *tag, int **nspecial,
-			  int **special, const bool eflag, const bool vflag,
-			  const bool eatom, const bool vatom, int &host_start,
-			  int **ilist, int **jnum, const double cpu_time,
-			  bool &success);
+                          double **host_x, int *host_type, double *sublo,
+                          double *subhi, int *tag, int **nspecial,
+                          int **special, const bool eflag, const bool vflag,
+                          const bool eatom, const bool vatom, int &host_start,
+                          int **ilist, int **jnum, const double cpu_time,
+                          bool &success);
 void buck_gpu_compute(const int ago, const int inum_full, const int nall,
-		      double **host_x, int *host_type, int *ilist, int *numj,
-		      int **firstneigh, const bool eflag, const bool vflag,
-		      const bool eatom, const bool vatom, int &host_start,
-		      const double cpu_time, bool &success);
+                      double **host_x, int *host_type, int *ilist, int *numj,
+                      int **firstneigh, const bool eflag, const bool vflag,
+                      const bool eatom, const bool vatom, int &host_start,
+                      const double cpu_time, bool &success);
 double buck_gpu_bytes();
 
 using namespace LAMMPS_NS;
@@ -66,7 +66,7 @@ PairBuckGPU::PairBuckGPU(LAMMPS *lmp) : PairBuck(lmp), gpu_mode(GPU_FORCE)
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -84,28 +84,28 @@ void PairBuckGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
   int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = buck_gpu_compute_n(neighbor->ago, inum, nall,
-				    atom->x, atom->type, domain->sublo,
-				    domain->subhi, atom->tag, atom->nspecial,
-				    atom->special, eflag, vflag, eflag_atom,
-				    vflag_atom, host_start, 
-				    &ilist, &numneigh, cpu_time, success);
+                                    atom->x, atom->type, domain->sublo,
+                                    domain->subhi, atom->tag, atom->nspecial,
+                                    atom->special, eflag, vflag, eflag_atom,
+                                    vflag_atom, host_start,
+                                    &ilist, &numneigh, cpu_time, success);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     buck_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		     vflag_atom, host_start, cpu_time, success);
+                     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                     vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -123,7 +123,7 @@ void PairBuckGPU::compute(int eflag, int vflag)
 
 void PairBuckGPU::init_style()
 {
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with buck/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -146,10 +146,10 @@ void PairBuckGPU::init_style()
   int maxspecial=0;
   if (atom->molecular)
     maxspecial=atom->maxspecial;
-  int success = buck_gpu_init(atom->ntypes+1, cutsq, rhoinv, buck1, buck2, 
-			      a, c, offset, force->special_lj, atom->nlocal,
-			      atom->nlocal+atom->nghost, 300, maxspecial,
-			      cell_size, gpu_mode, screen);
+  int success = buck_gpu_init(atom->ntypes+1, cutsq, rhoinv, buck1, buck2,
+                              a, c, offset, force->special_lj, atom->nlocal,
+                              atom->nlocal+atom->nghost, 300, maxspecial,
+                              cell_size, gpu_mode, screen);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -169,8 +169,8 @@ double PairBuckGPU::memory_usage()
 
 /* ---------------------------------------------------------------------- */
 
-void PairBuckGPU::cpu_compute(int start, int inum, int eflag, int vflag, 
-			       int *ilist, int *numneigh, int **firstneigh) {
+void PairBuckGPU::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 rsq,r2inv,r6inv,forcebuck,factor_lj;
@@ -205,24 +205,24 @@ void PairBuckGPU::cpu_compute(int start, int inum, int eflag, int vflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r = sqrt(rsq);
-	rexp = exp(-r*rhoinv[itype][jtype]);
-	forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
-	fpair = factor_lj*forcebuck*r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r = sqrt(rsq);
+        rexp = exp(-r*rhoinv[itype][jtype]);
+        forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
+        fpair = factor_lj*forcebuck*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_buck_gpu.h b/src/GPU/pair_buck_gpu.h
index 3969ca1b90..8f8daab983 100644
--- a/src/GPU/pair_buck_gpu.h
+++ b/src/GPU/pair_buck_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_coul_long_gpu.cpp b/src/GPU/pair_coul_long_gpu.cpp
index 349bb4a837..3b8b522f9d 100644
--- a/src/GPU/pair_coul_long_gpu.cpp
+++ b/src/GPU/pair_coul_long_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -47,36 +47,36 @@
 // External functions from cuda library for atom decomposition
 
 int cl_gpu_init(const int nlocal, const int nall, const int max_nbors,
-		const int maxspecial, const double cell_size, int &gpu_mode,
-		FILE *screen, double host_cut_coulsq, double *host_special_coul, 
-		const double qqrd2e, const double g_ewald);
+                const int maxspecial, const double cell_size, int &gpu_mode,
+                FILE *screen, double host_cut_coulsq, double *host_special_coul,
+                const double qqrd2e, const double g_ewald);
 void cl_gpu_clear();
 int ** cl_gpu_compute_n(const int ago, const int inum,
-			const int nall, double **host_x, int *host_type, 
-			double *sublo, double *subhi, int *tag, 
-			int **nspecial, int **special, const bool eflag,
-			const bool vflag, const bool eatom, const bool vatom,
-			int &host_start, int **ilist, int **jnum,
-			const double cpu_time, bool &success, double *host_q,
-			double *boxlo, double *prd);
+                        const int nall, double **host_x, int *host_type,
+                        double *sublo, double *subhi, int *tag,
+                        int **nspecial, int **special, const bool eflag,
+                        const bool vflag, const bool eatom, const bool vatom,
+                        int &host_start, int **ilist, int **jnum,
+                        const double cpu_time, bool &success, double *host_q,
+                        double *boxlo, double *prd);
 void cl_gpu_compute(const int ago, const int inum, const int nall,
-		    double **host_x, int *host_type, int *ilist, int *numj,
-		    int **firstneigh, const bool eflag, const bool vflag,
-		    const bool eatom, const bool vatom, int &host_start,
-		    const double cpu_time, bool &success, double *host_q,
-		    const int nlocal, double *boxlo, double *prd);
+                    double **host_x, int *host_type, int *ilist, int *numj,
+                    int **firstneigh, const bool eflag, const bool vflag,
+                    const bool eatom, const bool vatom, int &host_start,
+                    const double cpu_time, bool &success, double *host_q,
+                    const int nlocal, double *boxlo, double *prd);
 double cl_gpu_bytes();
 
 using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-PairCoulLongGPU::PairCoulLongGPU(LAMMPS *lmp) : 
+PairCoulLongGPU::PairCoulLongGPU(LAMMPS *lmp) :
   PairCoulLong(lmp), gpu_mode(GPU_FORCE)
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -94,30 +94,30 @@ void PairCoulLongGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;    
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = cl_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				  atom->type, domain->sublo, domain->subhi,
-				  atom->tag, atom->nspecial, atom->special,
-				  eflag, vflag, eflag_atom, vflag_atom,
-				  host_start, &ilist, &numneigh, cpu_time,
-				  success, atom->q, domain->boxlo,
-				  domain->prd);
+                                  atom->type, domain->sublo, domain->subhi,
+                                  atom->tag, atom->nspecial, atom->special,
+                                  eflag, vflag, eflag_atom, vflag_atom,
+                                  host_start, &ilist, &numneigh, cpu_time,
+                                  success, atom->q, domain->boxlo,
+                                  domain->prd);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     cl_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		   ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		   vflag_atom, host_start, cpu_time, success, atom->q,
-		   atom->nlocal, domain->boxlo, domain->prd);
+                   ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                   vflag_atom, host_start, cpu_time, success, atom->q,
+                   atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -139,7 +139,7 @@ void PairCoulLongGPU::init_style()
 
   if (!atom->q_flag)
     error->all(FLERR,"Pair style coul/long/gpu requires atom attribute q");
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with coul/long/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -160,9 +160,9 @@ void PairCoulLongGPU::init_style()
   int maxspecial=0;
   if (atom->molecular)
     maxspecial=atom->maxspecial;
-  int success = cl_gpu_init(atom->nlocal, atom->nlocal+atom->nghost, 300, 
-			    maxspecial, cell_size, gpu_mode, screen, cut_coulsq,
-			    force->special_coul, force->qqrd2e, g_ewald);
+  int success = cl_gpu_init(atom->nlocal, atom->nlocal+atom->nghost, 300,
+                            maxspecial, cell_size, gpu_mode, screen, cut_coulsq,
+                            force->special_coul, force->qqrd2e, g_ewald);
 
   GPU_EXTRA::check_flag(success,error,world);
 
@@ -184,8 +184,8 @@ double PairCoulLongGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairCoulLongGPU::cpu_compute(int start, int inum, int eflag,
-				  int vflag, int *ilist, int *numneigh,
-				  int **firstneigh)
+                                  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;
@@ -230,49 +230,49 @@ void PairCoulLongGPU::cpu_compute(int start, int inum, int eflag,
       r2inv = 1.0/rsq;
 
       if (rsq < cut_coulsq) {
-	if (!ncoultablebits || rsq <= tabinnersq) {
-	  r = sqrt(rsq);
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else {
-	  union_int_float_t rsq_lookup;
-	  rsq_lookup.f = rsq;
-	  itable = rsq_lookup.i & ncoulmask;
-	  itable >>= ncoulshiftbits;
-	  fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	  table = ftable[itable] + fraction*dftable[itable];
-	  forcecoul = qtmp*q[j] * table;
-	  if (factor_coul < 1.0) {
-	    table = ctable[itable] + fraction*dctable[itable];
-	    prefactor = qtmp*q[j] * table;
-	    forcecoul -= (1.0-factor_coul)*prefactor;
-	  }
-	}
-
-	fpair = forcecoul * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	}
-
-	if (evflag) ev_tally_full(i,0.0,ecoul,fpair,delx,dely,delz);
+        if (!ncoultablebits || rsq <= tabinnersq) {
+          r = sqrt(rsq);
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else {
+          union_int_float_t rsq_lookup;
+          rsq_lookup.f = rsq;
+          itable = rsq_lookup.i & ncoulmask;
+          itable >>= ncoulshiftbits;
+          fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+          table = ftable[itable] + fraction*dftable[itable];
+          forcecoul = qtmp*q[j] * table;
+          if (factor_coul < 1.0) {
+            table = ctable[itable] + fraction*dctable[itable];
+            prefactor = qtmp*q[j] * table;
+            forcecoul -= (1.0-factor_coul)*prefactor;
+          }
+        }
+
+        fpair = forcecoul * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+        }
+
+        if (evflag) ev_tally_full(i,0.0,ecoul,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_coul_long_gpu.h b/src/GPU/pair_coul_long_gpu.h
index e4f2b1c899..42285481ab 100644
--- a/src/GPU/pair_coul_long_gpu.h
+++ b/src/GPU/pair_coul_long_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp
index 2cb80a34d7..2bf370e36f 100644
--- a/src/GPU/pair_eam_alloy_gpu.cpp
+++ b/src/GPU/pair_eam_alloy_gpu.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -96,9 +96,9 @@ void PairEAMAlloyGPU::coeff(int narg, char **arg)
   for (i = 1; i <= n; i++) {
     for (j = i; j <= n; j++) {
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
-	count++;
+        setflag[i][j] = 1;
+        if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
+        count++;
       }
     }
   }
@@ -147,7 +147,7 @@ void PairEAMAlloyGPU::read_file(char *filename)
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
     error->all(FLERR,"Incorrect element names in EAM potential file");
-  
+
   char **words = new char*[file->nelements+1];
   nwords = 0;
   strtok(line," \t\n\r\f");
@@ -164,7 +164,7 @@ void PairEAMAlloyGPU::read_file(char *filename)
   if (me == 0) {
     fgets(line,MAXLINE,fptr);
     sscanf(line,"%d %lg %d %lg %lg",
-	   &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
+           &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
   }
 
   MPI_Bcast(&file->nrho,1,MPI_INT,0,world);
@@ -177,7 +177,7 @@ void PairEAMAlloyGPU::read_file(char *filename)
   memory->create(file->frho,file->nelements,file->nrho+1,"pair:frho");
   memory->create(file->rhor,file->nelements,file->nr+1,"pair:rhor");
   memory->create(file->z2r,file->nelements,file->nelements,file->nr+1,
-		 "pair:z2r");
+                 "pair:z2r");
 
   int i,j,tmp;
   for (i = 0; i < file->nelements; i++) {
@@ -226,7 +226,7 @@ void PairEAMAlloyGPU::file2array()
 
   // allocate frho arrays
   // nfrho = # of setfl elements + 1 for zero array
-  
+
   nfrho = setfl->nelements + 1;
   memory->destroy(frho);
   memory->create(frho,nfrho,nrho+1,"pair:frho");
@@ -307,12 +307,12 @@ void PairEAMAlloyGPU::file2array()
       irow = map[i];
       icol = map[j];
       if (irow == -1 || icol == -1) {
-	type2z2r[i][j] = 0;
-	continue;
+        type2z2r[i][j] = 0;
+        continue;
       }
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
diff --git a/src/GPU/pair_eam_alloy_gpu.h b/src/GPU/pair_eam_alloy_gpu.h
index 3305a4ea24..6c32631738 100644
--- a/src/GPU/pair_eam_alloy_gpu.h
+++ b/src/GPU/pair_eam_alloy_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp
index 1b52920e30..efb5716088 100644
--- a/src/GPU/pair_eam_fs_gpu.cpp
+++ b/src/GPU/pair_eam_fs_gpu.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -96,9 +96,9 @@ void PairEAMFSGPU::coeff(int narg, char **arg)
   for (i = 1; i <= n; i++) {
     for (j = i; j <= n; j++) {
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	if (i == j) atom->set_mass(i,fs->mass[map[i]]);
-	count++;
+        setflag[i][j] = 1;
+        if (i == j) atom->set_mass(i,fs->mass[map[i]]);
+        count++;
       }
     }
   }
@@ -147,7 +147,7 @@ void PairEAMFSGPU::read_file(char *filename)
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
     error->all(FLERR,"Incorrect element names in EAM potential file");
-  
+
   char **words = new char*[file->nelements+1];
   nwords = 0;
   strtok(line," \t\n\r\f");
@@ -164,7 +164,7 @@ void PairEAMFSGPU::read_file(char *filename)
   if (me == 0) {
     fgets(line,MAXLINE,fptr);
     sscanf(line,"%d %lg %d %lg %lg",
-	   &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
+           &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
   }
 
   MPI_Bcast(&file->nrho,1,MPI_INT,0,world);
@@ -175,11 +175,11 @@ void PairEAMFSGPU::read_file(char *filename)
 
   file->mass = new double[file->nelements];
   memory->create(file->frho,file->nelements,file->nrho+1,
-					      "pair:frho");
+                                              "pair:frho");
   memory->create(file->rhor,file->nelements,file->nelements,
-		 file->nr+1,"pair:rhor");
+                 file->nr+1,"pair:rhor");
   memory->create(file->z2r,file->nelements,file->nelements,
-		 file->nr+1,"pair:z2r");
+                 file->nr+1,"pair:z2r");
 
   int i,j,tmp;
   for (i = 0; i < file->nelements; i++) {
@@ -231,7 +231,7 @@ void PairEAMFSGPU::file2array()
 
   // allocate frho arrays
   // nfrho = # of fs elements + 1 for zero array
-  
+
   nfrho = fs->nelements + 1;
   memory->destroy(frho);
   memory->create(frho,nfrho,nrho+1,"pair:frho");
@@ -316,12 +316,12 @@ void PairEAMFSGPU::file2array()
       irow = map[i];
       icol = map[j];
       if (irow == -1 || icol == -1) {
-	type2z2r[i][j] = 0;
-	continue;
+        type2z2r[i][j] = 0;
+        continue;
       }
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
diff --git a/src/GPU/pair_eam_fs_gpu.h b/src/GPU/pair_eam_fs_gpu.h
index 49733e5739..06aaa2c645 100644
--- a/src/GPU/pair_eam_fs_gpu.h
+++ b/src/GPU/pair_eam_fs_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp
index 8342d8a620..344409cd34 100644
--- a/src/GPU/pair_eam_gpu.cpp
+++ b/src/GPU/pair_eam_gpu.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,30 +38,30 @@ using namespace LAMMPS_NS;
 // External functions from cuda library for atom decomposition
 
 int eam_gpu_init(const int ntypes, double host_cutforcesq,
-		 int **host_type2rhor, int **host_type2z2r,
+                 int **host_type2rhor, int **host_type2z2r,
                  int *host_type2frho, double ***host_rhor_spline,
-		 double ***host_z2r_spline, double ***host_frho_spline,
+                 double ***host_z2r_spline, double ***host_frho_spline,
                  double rdr, double rdrho, int nrhor, int nrho, int nz2r,
-		 int nfrho, int nr, const int nlocal, const int nall,
-		 const int max_nbors, const int maxspecial, 
-		 const double cell_size, int &gpu_mode, FILE *screen, 
-		 int &fp_size);
+                 int nfrho, int nr, const int nlocal, const int nall,
+                 const int max_nbors, const int maxspecial,
+                 const double cell_size, int &gpu_mode, FILE *screen,
+                 int &fp_size);
 void eam_gpu_clear();
 int** eam_gpu_compute_n(const int ago, const int inum_full, const int nall,
-			double **host_x, int *host_type, double *sublo,
-			double *subhi, int *tag, int **nspecial, int **special,
-			const bool eflag, const bool vflag, const bool eatom,
-			const bool vatom, int &host_start, int **ilist,
-			int **jnum,  const double cpu_time, bool &success,
-			int &inum, void **fp_ptr);
-void eam_gpu_compute(const int ago, const int inum_full, const int nlocal, 
-		     const int nall,double **host_x, int *host_type, 
-		     int *ilist, int *numj, int **firstneigh, 
-		     const bool eflag, const bool vflag,
-		     const bool eatom, const bool vatom, int &host_start,
-		     const double cpu_time, bool &success, void **fp_ptr);
+                        double **host_x, int *host_type, double *sublo,
+                        double *subhi, int *tag, int **nspecial, int **special,
+                        const bool eflag, const bool vflag, const bool eatom,
+                        const bool vatom, int &host_start, int **ilist,
+                        int **jnum,  const double cpu_time, bool &success,
+                        int &inum, void **fp_ptr);
+void eam_gpu_compute(const int ago, const int inum_full, const int nlocal,
+                     const int nall,double **host_x, int *host_type,
+                     int *ilist, int *numj, int **firstneigh,
+                     const bool eflag, const bool vflag,
+                     const bool eatom, const bool vatom, int &host_start,
+                     const double cpu_time, bool &success, void **fp_ptr);
 void eam_gpu_compute_force(int *ilist, const bool eflag, const bool vflag,
-			   const bool eatom, const bool vatom);
+                           const bool eatom, const bool vatom);
 double eam_gpu_bytes();
 
 /* ---------------------------------------------------------------------- */
@@ -70,7 +70,7 @@ PairEAMGPU::PairEAMGPU(LAMMPS *lmp) : PairEAM(lmp), gpu_mode(GPU_FORCE)
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -100,44 +100,44 @@ void PairEAMGPU::compute(int eflag, int vflag)
   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 nall = atom->nlocal + atom->nghost;
   int inum, host_start, inum_dev;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh; 
-  if (gpu_mode != GPU_FORCE) { 
+  int *ilist, *numneigh, **firstneigh;
+  if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = eam_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				   atom->type, domain->sublo, domain->subhi,
-				   atom->tag, atom->nspecial, atom->special,
-				   eflag, vflag, eflag_atom, vflag_atom,
-				   host_start, &ilist, &numneigh, cpu_time,
-				   success, inum_dev, &fp_pinned);
+                                   atom->type, domain->sublo, domain->subhi,
+                                   atom->tag, atom->nspecial, atom->special,
+                                   eflag, vflag, eflag_atom, vflag_atom,
+                                   host_start, &ilist, &numneigh, cpu_time,
+                                   success, inum_dev, &fp_pinned);
   } else { // gpu_mode == GPU_FORCE
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     eam_gpu_compute(neighbor->ago, inum, nlocal, nall, atom->x, atom->type,
-		    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		    vflag_atom, host_start, cpu_time, success, &fp_pinned);
+                    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                    vflag_atom, host_start, cpu_time, success, &fp_pinned);
   }
-    
+
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
 
   // communicate derivative of embedding function
 
   comm->forward_comm_pair(this);
-    
+
   // compute forces on each atom on GPU
-  if (gpu_mode != GPU_FORCE) 
+  if (gpu_mode != GPU_FORCE)
     eam_gpu_compute_force(NULL, eflag, vflag, eflag_atom, vflag_atom);
   else
     eam_gpu_compute_force(ilist, eflag, vflag, eflag_atom, vflag_atom);
@@ -149,14 +149,14 @@ void PairEAMGPU::compute(int eflag, int vflag)
 
 void PairEAMGPU::init_style()
 {
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with eam/gpu pair style");
-  
+
   // convert read-in file(s) to arrays and spline them
 
   file2array();
   array2spline();
-  
+
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
   double cut;
@@ -173,18 +173,18 @@ void PairEAMGPU::init_style()
     }
   }
   double cell_size = sqrt(maxcut) + neighbor->skin;
-  
+
   int maxspecial=0;
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int fp_size;
   int success = eam_gpu_init(atom->ntypes+1, cutforcesq, type2rhor, type2z2r,
-			     type2frho, rhor_spline, z2r_spline, frho_spline,
-			     rdr, rdrho, nrhor, nrho, nz2r, nfrho, nr,
-			     atom->nlocal, atom->nlocal+atom->nghost, 300,
-			     maxspecial, cell_size, gpu_mode, screen, fp_size);
+                             type2frho, rhor_spline, z2r_spline, frho_spline,
+                             rdr, rdrho, nrhor, nrho, nz2r, nfrho, nr,
+                             atom->nlocal, atom->nlocal+atom->nghost, 300,
+                             maxspecial, cell_size, gpu_mode, screen, fp_size);
   GPU_EXTRA::check_flag(success,error,world);
-  
+
   if (gpu_mode == GPU_FORCE) {
     int irequest = neighbor->request(this);
     neighbor->requests[irequest]->half = 0;
@@ -199,8 +199,8 @@ void PairEAMGPU::init_style()
 
 /* ---------------------------------------------------------------------- */
 
-int PairEAMGPU::pack_comm(int n, int *list, double *buf, int pbc_flag, 
-			  int *pbc)
+int PairEAMGPU::pack_comm(int n, int *list, double *buf, int pbc_flag,
+                          int *pbc)
 {
   int i,j,m;
 
diff --git a/src/GPU/pair_eam_gpu.h b/src/GPU/pair_eam_gpu.h
index 24c9e22f32..08a2013efe 100644
--- a/src/GPU/pair_eam_gpu.h
+++ b/src/GPU/pair_eam_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -44,7 +44,7 @@ class PairEAMGPU : public PairEAM {
   double cpu_time;
   int *gpulist;
   void *fp_pinned;
-  bool fp_single;  
+  bool fp_single;
 };
 
 }
diff --git a/src/GPU/pair_gayberne_gpu.cpp b/src/GPU/pair_gayberne_gpu.cpp
index f4a094b7ab..c4ddc17e38 100644
--- a/src/GPU/pair_gayberne_gpu.cpp
+++ b/src/GPU/pair_gayberne_gpu.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -40,26 +40,26 @@
 // External functions from cuda library for atom decomposition
 
 int gb_gpu_init(const int ntypes, const double gamma, const double upsilon,
-		const double mu, double **shape, double **well, double **cutsq,
-		double **sigma, double **epsilon, double *host_lshape,
-		int **form, double **host_lj1, double **host_lj2,
-		double **host_lj3, double **host_lj4, double **offset,
-		double *special_lj, const int nlocal, const int nall,
-		const int max_nbors, const int maxspecial,
-		const double cell_size,	int &gpu_mode, FILE *screen);
+                const double mu, double **shape, double **well, double **cutsq,
+                double **sigma, double **epsilon, double *host_lshape,
+                int **form, double **host_lj1, double **host_lj2,
+                double **host_lj3, double **host_lj4, double **offset,
+                double *special_lj, const int nlocal, const int nall,
+                const int max_nbors, const int maxspecial,
+                const double cell_size,        int &gpu_mode, FILE *screen);
 void gb_gpu_clear();
 int ** gb_gpu_compute_n(const int ago, const int inum, const int nall,
-			double **host_x, int *host_type, double *sublo,
-			double *subhi, int *tag, int **nspecial, int **special,
-			const bool eflag, const bool vflag,
-			const bool eatom, const bool vatom, int &host_start,
-			int **ilist, int **jnum, const double cpu_time,
-			bool &success, double **host_quat);
+                        double **host_x, int *host_type, double *sublo,
+                        double *subhi, int *tag, int **nspecial, int **special,
+                        const bool eflag, const bool vflag,
+                        const bool eatom, const bool vatom, int &host_start,
+                        int **ilist, int **jnum, const double cpu_time,
+                        bool &success, double **host_quat);
 int * gb_gpu_compute(const int ago, const int inum, const int nall,
-		     double **host_x, int *host_type, int *ilist, int *numj,
-		     int **firstneigh, const bool eflag, const bool vflag,
-		     const bool eatom, const bool vatom, int &host_start,
-		     const double cpu_time, bool &success, double **host_quat);
+                     double **host_x, int *host_type, int *ilist, int *numj,
+                     int **firstneigh, const bool eflag, const bool vflag,
+                     const bool eatom, const bool vatom, int &host_start,
+                     const double cpu_time, bool &success, double **host_quat);
 double gb_gpu_bytes();
 
 using namespace LAMMPS_NS;
@@ -72,11 +72,11 @@ PairGayBerneGPU::PairGayBerneGPU(LAMMPS *lmp) : PairGayBerne(lmp),
                                                 gpu_mode(GPU_FORCE)
 {
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-  if (!avec) 
+  if (!avec)
     error->all(FLERR,"Pair gayberne/gpu requires atom style ellipsoid");
   quat_nmax = 0;
   quat = NULL;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -101,7 +101,7 @@ void PairGayBerneGPU::compute(int eflag, int vflag)
   int inum, host_start;
 
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;  
+  int *ilist, *numneigh, **firstneigh;
 
   if (nall > quat_nmax) {
     quat_nmax = static_cast<int>(1.1 * nall);
@@ -122,19 +122,19 @@ void PairGayBerneGPU::compute(int eflag, int vflag)
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = gb_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				  atom->type, domain->sublo, domain->subhi,
-				  atom->tag, atom->nspecial, atom->special,
-				  eflag, vflag, eflag_atom, vflag_atom,
-				  host_start, &ilist, &numneigh, cpu_time,
-				  success, quat);
+                                  atom->type, domain->sublo, domain->subhi,
+                                  atom->tag, atom->nspecial, atom->special,
+                                  eflag, vflag, eflag_atom, vflag_atom,
+                                  host_start, &ilist, &numneigh, cpu_time,
+                                  success, quat);
   } else {
     inum = list->inum;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     ilist = gb_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-			   list->ilist, numneigh, firstneigh, eflag, vflag,
-			   eflag_atom, vflag_atom, host_start,
-			   cpu_time, success, quat);
+                           list->ilist, numneigh, firstneigh, eflag, vflag,
+                           eflag_atom, vflag_atom, host_start,
+                           cpu_time, success, quat);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -152,7 +152,7 @@ void PairGayBerneGPU::compute(int eflag, int vflag)
 
 void PairGayBerneGPU::init_style()
 {
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with gayberne/gpu pair style");
   if (!atom->ellipsoid_flag)
     error->all(FLERR,"Pair gayberne/gpu requires atom style ellipsoid");
@@ -169,7 +169,7 @@ void PairGayBerneGPU::init_style()
     shape2[i][0] = shape1[i][0]*shape1[i][0];
     shape2[i][1] = shape1[i][1]*shape1[i][1];
     shape2[i][2] = shape1[i][2]*shape1[i][2];
-    lshape[i] = (shape1[i][0]*shape1[i][1]+shape1[i][2]*shape1[i][2]) * 
+    lshape[i] = (shape1[i][0]*shape1[i][1]+shape1[i][2]*shape1[i][2]) *
       sqrt(shape1[i][0]*shape1[i][1]);
   }
 
@@ -194,11 +194,11 @@ void PairGayBerneGPU::init_style()
   int maxspecial=0;
   if (atom->molecular)
     maxspecial=atom->maxspecial;
-  int success = gb_gpu_init(atom->ntypes+1, gamma, upsilon, mu, 
-			    shape2, well, cutsq, sigma, epsilon, lshape, form,
-			    lj1, lj2, lj3, lj4, offset, force->special_lj, 
-			    atom->nlocal, atom->nlocal+atom->nghost, 300, 
-			    maxspecial, cell_size, gpu_mode, screen);
+  int success = gb_gpu_init(atom->ntypes+1, gamma, upsilon, mu,
+                            shape2, well, cutsq, sigma, epsilon, lshape, form,
+                            lj1, lj2, lj3, lj4, offset, force->special_lj,
+                            atom->nlocal, atom->nlocal+atom->nghost, 300,
+                            maxspecial, cell_size, gpu_mode, screen);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -221,7 +221,7 @@ double PairGayBerneGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairGayBerneGPU::cpu_compute(int start, int inum, int eflag, int vflag,
-				  int *ilist, int *numneigh, int **firstneigh)
+                                  int *ilist, int *numneigh, int **firstneigh)
 {
   int i,j,ii,jj,jnum,itype,jtype;
   double evdwl,one_eng,rsq,r2inv,r6inv,forcelj,factor_lj;
@@ -273,68 +273,68 @@ void PairGayBerneGPU::cpu_compute(int start, int inum, int eflag, int vflag,
 
       if (rsq < cutsq[itype][jtype]) {
 
-	switch (form[itype][jtype]) {
-	case SPHERE_SPHERE:
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  forcelj *= -r2inv;
-	  if (eflag) one_eng = 
-	    r6inv*(r6inv*lj3[itype][jtype]-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  fforce[0] = r12[0]*forcelj;
-	  fforce[1] = r12[1]*forcelj;
-	  fforce[2] = r12[2]*forcelj;
-	  ttor[0] = ttor[1] = ttor[2] = 0.0;
-	  rtor[0] = rtor[1] = rtor[2] = 0.0;
-	  break;
+        switch (form[itype][jtype]) {
+        case SPHERE_SPHERE:
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          forcelj *= -r2inv;
+          if (eflag) one_eng =
+            r6inv*(r6inv*lj3[itype][jtype]-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          fforce[0] = r12[0]*forcelj;
+          fforce[1] = r12[1]*forcelj;
+          fforce[2] = r12[2]*forcelj;
+          ttor[0] = ttor[1] = ttor[2] = 0.0;
+          rtor[0] = rtor[1] = rtor[2] = 0.0;
+          break;
 
         case SPHERE_ELLIPSE:
-	  jquat = bonus[ellipsoid[j]].quat;
-	  MathExtra::quat_to_mat_trans(jquat,a2);
-	  MathExtra::diag_times3(well[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,b2);
-	  MathExtra::diag_times3(shape2[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,g2);
-	  one_eng = gayberne_lj(j,i,a2,b2,g2,r12,rsq,fforce,rtor);
-	  ttor[0] = ttor[1] = ttor[2] = 0.0;
-	  break;
+          jquat = bonus[ellipsoid[j]].quat;
+          MathExtra::quat_to_mat_trans(jquat,a2);
+          MathExtra::diag_times3(well[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,b2);
+          MathExtra::diag_times3(shape2[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,g2);
+          one_eng = gayberne_lj(j,i,a2,b2,g2,r12,rsq,fforce,rtor);
+          ttor[0] = ttor[1] = ttor[2] = 0.0;
+          break;
 
         case ELLIPSE_SPHERE:
-	  one_eng = gayberne_lj(i,j,a1,b1,g1,r12,rsq,fforce,ttor);
-	  rtor[0] = rtor[1] = rtor[2] = 0.0;
-	  break;
-
-	default:
-	  jquat = bonus[ellipsoid[j]].quat;
-	  MathExtra::quat_to_mat_trans(jquat,a2);
-	  MathExtra::diag_times3(well[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,b2);
-	  MathExtra::diag_times3(shape2[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,g2);
-	  one_eng = gayberne_analytic(i,j,a1,a2,b1,b2,g1,g2,r12,rsq,
-				      fforce,ttor,rtor);
-	  break;
-	}
+          one_eng = gayberne_lj(i,j,a1,b1,g1,r12,rsq,fforce,ttor);
+          rtor[0] = rtor[1] = rtor[2] = 0.0;
+          break;
+
+        default:
+          jquat = bonus[ellipsoid[j]].quat;
+          MathExtra::quat_to_mat_trans(jquat,a2);
+          MathExtra::diag_times3(well[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,b2);
+          MathExtra::diag_times3(shape2[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,g2);
+          one_eng = gayberne_analytic(i,j,a1,a2,b1,b2,g1,g2,r12,rsq,
+                                      fforce,ttor,rtor);
+          break;
+        }
 
         fforce[0] *= factor_lj;
-	fforce[1] *= factor_lj;
-	fforce[2] *= factor_lj;
+        fforce[1] *= factor_lj;
+        fforce[2] *= factor_lj;
         ttor[0] *= factor_lj;
-	ttor[1] *= factor_lj;
-	ttor[2] *= factor_lj;
+        ttor[1] *= factor_lj;
+        ttor[2] *= factor_lj;
 
         f[i][0] += fforce[0];
-	f[i][1] += fforce[1];
-	f[i][2] += fforce[2];
+        f[i][1] += fforce[1];
+        f[i][2] += fforce[2];
         tor[i][0] += ttor[0];
-	tor[i][1] += ttor[1];
-	tor[i][2] += ttor[2];
+        tor[i][1] += ttor[1];
+        tor[i][2] += ttor[2];
 
         if (eflag) evdwl = factor_lj*one_eng;
 
-	if (evflag) ev_tally_xyz_full(i,evdwl,0.0,fforce[0],fforce[1],fforce[2],
-				      -r12[0],-r12[1],-r12[2]);
+        if (evflag) ev_tally_xyz_full(i,evdwl,0.0,fforce[0],fforce[1],fforce[2],
+                                      -r12[0],-r12[1],-r12[2]);
       }
     }
   }
diff --git a/src/GPU/pair_gayberne_gpu.h b/src/GPU/pair_gayberne_gpu.h
index 00e80a965b..cdfdeb8932 100644
--- a/src/GPU/pair_gayberne_gpu.h
+++ b/src/GPU/pair_gayberne_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_lj96_cut_gpu.cpp b/src/GPU/pair_lj96_cut_gpu.cpp
index b9c70b80af..cd61efe8ed 100644
--- a/src/GPU/pair_lj96_cut_gpu.cpp
+++ b/src/GPU/pair_lj96_cut_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -38,23 +38,23 @@
 // External functions from cuda library for atom decomposition
 
 int lj96_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
-		  double **host_lj2, double **host_lj3, double **host_lj4, 
-		  double **offset, double *special_lj, const int nlocal, 
-		  const int nall, const int max_nbors, const int maxspecial,
-		  const double cell_size, int &gpu_mode, FILE *screen);
+                  double **host_lj2, double **host_lj3, double **host_lj4,
+                  double **offset, double *special_lj, const int nlocal,
+                  const int nall, const int max_nbors, const int maxspecial,
+                  const double cell_size, int &gpu_mode, FILE *screen);
 void lj96_gpu_clear();
 int ** lj96_gpu_compute_n(const int ago, const int inum, const int nall,
-			  double **host_x, int *host_type, double *sublo,
-			  double *subhi, int *tag, int **nspecial,
-			  int **special, const bool eflag, const bool vflag,
-			  const bool eatom, const bool vatom, int &host_start,
-			  int **ilist, int **jnum,
-			  const double cpu_time, bool &success);
+                          double **host_x, int *host_type, double *sublo,
+                          double *subhi, int *tag, int **nspecial,
+                          int **special, const bool eflag, const bool vflag,
+                          const bool eatom, const bool vatom, int &host_start,
+                          int **ilist, int **jnum,
+                          const double cpu_time, bool &success);
 void lj96_gpu_compute(const int ago, const int inum, const int nall,
                       double **host_x, int *host_type, int *ilist, int *numj,
-		      int **firstneigh, const bool eflag, const bool vflag,
-		      const bool eatom, const bool vatom, int &host_start,
-		      const double cpu_time, bool &success);
+                      int **firstneigh, const bool eflag, const bool vflag,
+                      const bool eatom, const bool vatom, int &host_start,
+                      const double cpu_time, bool &success);
 double lj96_gpu_bytes();
 
 using namespace LAMMPS_NS;
@@ -65,7 +65,7 @@ PairLJ96CutGPU::PairLJ96CutGPU(LAMMPS *lmp) : PairLJ96Cut(lmp), gpu_mode(GPU_FOR
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -83,28 +83,28 @@ void PairLJ96CutGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;  
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = lj96_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				    atom->type, domain->sublo, domain->subhi,
-				    atom->tag, atom->nspecial, atom->special,
-				    eflag, vflag, eflag_atom, vflag_atom,
-				    host_start, &ilist, &numneigh, cpu_time,
-				    success);
+                                    atom->type, domain->sublo, domain->subhi,
+                                    atom->tag, atom->nspecial, atom->special,
+                                    eflag, vflag, eflag_atom, vflag_atom,
+                                    host_start, &ilist, &numneigh, cpu_time,
+                                    success);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     lj96_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		     vflag_atom, host_start, cpu_time, success);
+                     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                     vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -124,7 +124,7 @@ void PairLJ96CutGPU::init_style()
 {
   cut_respa = NULL;
 
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with lj96/cut/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -148,9 +148,9 @@ void PairLJ96CutGPU::init_style()
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int success = lj96_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4,
-			      offset, force->special_lj, atom->nlocal,
-			      atom->nlocal+atom->nghost, 300, maxspecial,
-			      cell_size, gpu_mode, screen);
+                              offset, force->special_lj, atom->nlocal,
+                              atom->nlocal+atom->nghost, 300, maxspecial,
+                              cell_size, gpu_mode, screen);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -171,7 +171,7 @@ double PairLJ96CutGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairLJ96CutGPU::cpu_compute(int start, int inum, int eflag, int vflag,
-				 int *ilist, int *numneigh, int **firstneigh)
+                                 int *ilist, int *numneigh, int **firstneigh)
 {
   int i,j,ii,jj,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
@@ -206,23 +206,23 @@ void PairLJ96CutGPU::cpu_compute(int start, int inum, int eflag, int vflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r3inv = sqrt(r6inv);
-	forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r3inv = sqrt(r6inv);
+        forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_lj96_cut_gpu.h b/src/GPU/pair_lj96_cut_gpu.h
index a83b7d5368..43c63354dc 100644
--- a/src/GPU/pair_lj96_cut_gpu.h
+++ b/src/GPU/pair_lj96_cut_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp
index 17db620b83..c750f4aeae 100644
--- a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp
+++ b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -47,42 +47,42 @@
 // External functions from cuda library for atom decomposition
 
 int crml_gpu_init(const int ntypes, double cut_bothsq, double **host_lj1,
-		  double **host_lj2, double **host_lj3, double **host_lj4, 
-		  double **offset, double *special_lj, const int nlocal, 
-		  const int nall, const int max_nbors, const int maxspecial,
-		  const double cell_size, int &gpu_mode, FILE *screen,
-		  double host_cut_ljsq, double host_cut_coulsq,
-		  double *host_special_coul, const double qqrd2e,
-		  const double g_ewald, const double cut_lj_innersq,
-		  const double denom_lj, double **epsilon, double **sigma,
-		  const bool mix_arithmetic);
+                  double **host_lj2, double **host_lj3, double **host_lj4,
+                  double **offset, double *special_lj, const int nlocal,
+                  const int nall, const int max_nbors, const int maxspecial,
+                  const double cell_size, int &gpu_mode, FILE *screen,
+                  double host_cut_ljsq, double host_cut_coulsq,
+                  double *host_special_coul, const double qqrd2e,
+                  const double g_ewald, const double cut_lj_innersq,
+                  const double denom_lj, double **epsilon, double **sigma,
+                  const bool mix_arithmetic);
 void crml_gpu_clear();
 int ** crml_gpu_compute_n(const int ago, const int inum,
-			  const int nall, double **host_x, int *host_type, 
-			  double *sublo, double *subhi, int *tag,
-			  int **nspecial, int **special, const bool eflag,
-			  const bool vflag, const bool eatom, const bool vatom,
-			  int &host_start, int **ilist, int **jnum,
-			  const double cpu_time, bool &success, double *host_q,
-			  double *boxlo, double *prd);
+                          const int nall, double **host_x, int *host_type,
+                          double *sublo, double *subhi, int *tag,
+                          int **nspecial, int **special, const bool eflag,
+                          const bool vflag, const bool eatom, const bool vatom,
+                          int &host_start, int **ilist, int **jnum,
+                          const double cpu_time, bool &success, double *host_q,
+                          double *boxlo, double *prd);
 void crml_gpu_compute(const int ago, const int inum, const int nall,
-		      double **host_x, int *host_type, int *ilist, int *numj,
-		      int **firstneigh, const bool eflag, const bool vflag,
-		      const bool eatom, const bool vatom, int &host_start,
-		      const double cpu_time, bool &success, double *host_q,
-		      const int nlocal, double *boxlo, double *prd);
+                      double **host_x, int *host_type, int *ilist, int *numj,
+                      int **firstneigh, const bool eflag, const bool vflag,
+                      const bool eatom, const bool vatom, int &host_start,
+                      const double cpu_time, bool &success, double *host_q,
+                      const int nlocal, double *boxlo, double *prd);
 double crml_gpu_bytes();
 
 using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-PairLJCharmmCoulLongGPU::PairLJCharmmCoulLongGPU(LAMMPS *lmp) : 
+PairLJCharmmCoulLongGPU::PairLJCharmmCoulLongGPU(LAMMPS *lmp) :
   PairLJCharmmCoulLong(lmp), gpu_mode(GPU_FORCE)
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -100,30 +100,30 @@ void PairLJCharmmCoulLongGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;    
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = crml_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				    atom->type, domain->sublo, domain->subhi,
-				    atom->tag, atom->nspecial, atom->special,
-				    eflag, vflag, eflag_atom, vflag_atom,
-				    host_start, &ilist, &numneigh, cpu_time,
-				    success, atom->q, domain->boxlo,
-				    domain->prd);
+                                    atom->type, domain->sublo, domain->subhi,
+                                    atom->tag, atom->nspecial, atom->special,
+                                    eflag, vflag, eflag_atom, vflag_atom,
+                                    host_start, &ilist, &numneigh, cpu_time,
+                                    success, atom->q, domain->boxlo,
+                                    domain->prd);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     crml_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		     vflag_atom, host_start, cpu_time, success, atom->q,
-		     atom->nlocal, domain->boxlo, domain->prd);
+                     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                     vflag_atom, host_start, cpu_time, success, atom->q,
+                     atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -145,7 +145,7 @@ void PairLJCharmmCoulLongGPU::init_style()
 
   if (!atom->q_flag)
     error->all(FLERR,"Pair style lj/charmm/coul/long/gpu requires atom attribute q");
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with lj/charmm/coul/long/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -162,7 +162,7 @@ void PairLJCharmmCoulLongGPU::init_style()
   cut_coulsq = cut_coul * cut_coul;
   cut_bothsq = MAX(cut_ljsq,cut_coulsq);
 
-  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) * 
+  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) *
     (cut_ljsq-cut_lj_innersq);
 
   double cell_size = sqrt(cut_bothsq) + neighbor->skin;
@@ -185,18 +185,18 @@ void PairLJCharmmCoulLongGPU::init_style()
   for (int i = 1; i < atom->ntypes + 1; i++)
     for (int j = i + 1; j < atom->ntypes + 1; j++) {
       if (epsilon[i][j] != sqrt(epsilon[i][i] * epsilon[j][j]))
-	arithmetic = false;
+        arithmetic = false;
       if (sigma[i][j] != 0.5 * (sigma[i][i] + sigma[j][j]))
-	arithmetic = false;
+        arithmetic = false;
     }
 
   int success = crml_gpu_init(atom->ntypes+1, cut_bothsq, lj1, lj2, lj3, lj4,
-			      offset, force->special_lj, atom->nlocal,
-			      atom->nlocal+atom->nghost, 300, maxspecial,
-			      cell_size, gpu_mode, screen, cut_ljsq, 
-			      cut_coulsq, force->special_coul, force->qqrd2e,
-			      g_ewald, cut_lj_innersq,denom_lj,epsilon,sigma,
-			      arithmetic);
+                              offset, force->special_lj, atom->nlocal,
+                              atom->nlocal+atom->nghost, 300, maxspecial,
+                              cell_size, gpu_mode, screen, cut_ljsq,
+                              cut_coulsq, force->special_coul, force->qqrd2e,
+                              g_ewald, cut_lj_innersq,denom_lj,epsilon,sigma,
+                              arithmetic);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -217,8 +217,8 @@ double PairLJCharmmCoulLongGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairLJCharmmCoulLongGPU::cpu_compute(int start, int inum, int eflag,
-					  int vflag, int *ilist,
-					  int *numneigh, int **firstneigh)
+                                          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;
@@ -263,77 +263,77 @@ void PairLJCharmmCoulLongGPU::cpu_compute(int start, int inum, int eflag,
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_bothsq) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  jtype = type[j];
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  if (rsq > cut_lj_innersq) {
-	    switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	      (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	    switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	      (rsq-cut_lj_innersq) / denom_lj;
-	    philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	    forcelj = forcelj*switch1 + philj*switch2;
-	  }
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	      evdwl *= switch1;
-	    }
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq) {
+          r6inv = r2inv*r2inv*r2inv;
+          jtype = type[j];
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          if (rsq > cut_lj_innersq) {
+            switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+              (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+            switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+              (rsq-cut_lj_innersq) / denom_lj;
+            philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+            forcelj = forcelj*switch1 + philj*switch2;
+          }
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+              evdwl *= switch1;
+            }
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.h b/src/GPU/pair_lj_charmm_coul_long_gpu.h
index b445f0bc63..a4a2799521 100644
--- a/src/GPU/pair_lj_charmm_coul_long_gpu.h
+++ b/src/GPU/pair_lj_charmm_coul_long_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.cpp b/src/GPU/pair_lj_class2_coul_long_gpu.cpp
index f2f677a726..9c02f93c18 100644
--- a/src/GPU/pair_lj_class2_coul_long_gpu.cpp
+++ b/src/GPU/pair_lj_class2_coul_long_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -47,39 +47,39 @@
 // External functions from cuda library for atom decomposition
 
 int c2cl_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
-		  double **host_lj2, double **host_lj3, double **host_lj4, 
-		  double **offset, double *special_lj, const int nlocal, 
-		  const int nall, const int max_nbors, const int maxspecial,
-		  const double cell_size, int &gpu_mode, FILE *screen,
-		  double **host_cut_ljsq, double host_cut_coulsq,
-		  double *host_special_coul, const double qqrd2e,
-		  const double g_ewald);
+                  double **host_lj2, double **host_lj3, double **host_lj4,
+                  double **offset, double *special_lj, const int nlocal,
+                  const int nall, const int max_nbors, const int maxspecial,
+                  const double cell_size, int &gpu_mode, FILE *screen,
+                  double **host_cut_ljsq, double host_cut_coulsq,
+                  double *host_special_coul, const double qqrd2e,
+                  const double g_ewald);
 void c2cl_gpu_clear();
 int ** c2cl_gpu_compute_n(const int ago, const int inum,
-			  const int nall, double **host_x, int *host_type, 
-			  double *sublo, double *subhi, int *tag, 
-			  int **nspecial, int **special, const bool eflag,
-			  const bool vflag, const bool eatom, const bool vatom,
-			  int &host_start, int **ilist, int **jnum,
-			  const double cpu_time, bool &success, double *host_q,
-			  double *boxlo, double *prd);
+                          const int nall, double **host_x, int *host_type,
+                          double *sublo, double *subhi, int *tag,
+                          int **nspecial, int **special, const bool eflag,
+                          const bool vflag, const bool eatom, const bool vatom,
+                          int &host_start, int **ilist, int **jnum,
+                          const double cpu_time, bool &success, double *host_q,
+                          double *boxlo, double *prd);
 void c2cl_gpu_compute(const int ago, const int inum, const int nall,
-		      double **host_x, int *host_type, int *ilist, int *numj,
-		      int **firstneigh, const bool eflag, const bool vflag,
-		      const bool eatom, const bool vatom, int &host_start,
-		      const double cpu_time, bool &success, double *host_q,
-		      const int nlocal, double *boxlo, double *prd);
+                      double **host_x, int *host_type, int *ilist, int *numj,
+                      int **firstneigh, const bool eflag, const bool vflag,
+                      const bool eatom, const bool vatom, int &host_start,
+                      const double cpu_time, bool &success, double *host_q,
+                      const int nlocal, double *boxlo, double *prd);
 double c2cl_gpu_bytes();
 
 using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-PairLJClass2CoulLongGPU::PairLJClass2CoulLongGPU(LAMMPS *lmp) : 
+PairLJClass2CoulLongGPU::PairLJClass2CoulLongGPU(LAMMPS *lmp) :
   PairLJClass2CoulLong(lmp), gpu_mode(GPU_FORCE)
 {
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -97,30 +97,30 @@ void PairLJClass2CoulLongGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;    
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = c2cl_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				    atom->type, domain->sublo, domain->subhi,
-				    atom->tag, atom->nspecial, atom->special,
-				    eflag, vflag, eflag_atom, vflag_atom,
-				    host_start, &ilist, &numneigh, cpu_time,
-				    success, atom->q, domain->boxlo,
-				    domain->prd);
+                                    atom->type, domain->sublo, domain->subhi,
+                                    atom->tag, atom->nspecial, atom->special,
+                                    eflag, vflag, eflag_atom, vflag_atom,
+                                    host_start, &ilist, &numneigh, cpu_time,
+                                    success, atom->q, domain->boxlo,
+                                    domain->prd);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     c2cl_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		     vflag_atom, host_start, cpu_time, success, atom->q,
-		     atom->nlocal, domain->boxlo, domain->prd);
+                     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                     vflag_atom, host_start, cpu_time, success, atom->q,
+                     atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -140,7 +140,7 @@ void PairLJClass2CoulLongGPU::init_style()
 {
   if (!atom->q_flag)
     error->all(FLERR,"Pair style lj/class2/coul/long/gpu requires atom attribute q");
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with lj/class2/coul/long/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -196,8 +196,8 @@ double PairLJClass2CoulLongGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairLJClass2CoulLongGPU::cpu_compute(int start, int inum, int eflag,
-				       int vflag, int *ilist, int *numneigh,
-				       int **firstneigh)
+                                       int vflag, int *ilist, int *numneigh,
+                                       int **firstneigh)
 {
   int i,j,ii,jj,jnum,itype,jtype;
   double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
@@ -241,45 +241,45 @@ void PairLJClass2CoulLongGPU::cpu_compute(int start, int inum, int eflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  r = sqrt(rsq);
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  rinv = sqrt(r2inv);
-	  r3inv = r2inv*rinv;
-	  r6inv = r3inv*r3inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = prefactor*erfc;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          r = sqrt(rsq);
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          rinv = sqrt(r2inv);
+          r3inv = r2inv*rinv;
+          r6inv = r3inv*r3inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            ecoul = prefactor*erfc;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.h b/src/GPU/pair_lj_class2_coul_long_gpu.h
index 5cc5276f97..096ae41860 100644
--- a/src/GPU/pair_lj_class2_coul_long_gpu.h
+++ b/src/GPU/pair_lj_class2_coul_long_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_lj_class2_gpu.cpp b/src/GPU/pair_lj_class2_gpu.cpp
index 9a1019d58a..8e1100b097 100644
--- a/src/GPU/pair_lj_class2_gpu.cpp
+++ b/src/GPU/pair_lj_class2_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -38,23 +38,23 @@
 // External functions from cuda library for atom decomposition
 
 int lj96_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
-		  double **host_lj2, double **host_lj3, double **host_lj4, 
-		  double **offset, double *special_lj, const int nlocal, 
-		  const int nall, const int max_nbors, const int maxspecial,
-		  const double cell_size, int &gpu_mode, FILE *screen);
+                  double **host_lj2, double **host_lj3, double **host_lj4,
+                  double **offset, double *special_lj, const int nlocal,
+                  const int nall, const int max_nbors, const int maxspecial,
+                  const double cell_size, int &gpu_mode, FILE *screen);
 void lj96_gpu_clear();
 int ** lj96_gpu_compute_n(const int ago, const int inum, const int nall,
-			  double **host_x, int *host_type, double *sublo,
-			  double *subhi, int *tag, int **nspecial,
-			  int **special, const bool eflag, const bool vflag,
-			  const bool eatom, const bool vatom, int &host_start,
-			  int **ilist, int **jnum,
-			  const double cpu_time, bool &success);
+                          double **host_x, int *host_type, double *sublo,
+                          double *subhi, int *tag, int **nspecial,
+                          int **special, const bool eflag, const bool vflag,
+                          const bool eatom, const bool vatom, int &host_start,
+                          int **ilist, int **jnum,
+                          const double cpu_time, bool &success);
 void lj96_gpu_compute(const int ago, const int inum, const int nall,
                       double **host_x, int *host_type, int *ilist, int *numj,
-		      int **firstneigh, const bool eflag, const bool vflag,
-		      const bool eatom, const bool vatom, int &host_start,
-		      const double cpu_time, bool &success);
+                      int **firstneigh, const bool eflag, const bool vflag,
+                      const bool eatom, const bool vatom, int &host_start,
+                      const double cpu_time, bool &success);
 double lj96_gpu_bytes();
 
 using namespace LAMMPS_NS;
@@ -64,7 +64,7 @@ using namespace LAMMPS_NS;
 PairLJClass2GPU::PairLJClass2GPU(LAMMPS *lmp) : PairLJClass2(lmp), gpu_mode(GPU_FORCE)
 {
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -82,28 +82,28 @@ void PairLJClass2GPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;  
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = lj96_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				    atom->type, domain->sublo, domain->subhi,
-				    atom->tag, atom->nspecial, atom->special,
-				    eflag, vflag, eflag_atom, vflag_atom,
-				    host_start, &ilist, &numneigh, cpu_time,
-				    success);
+                                    atom->type, domain->sublo, domain->subhi,
+                                    atom->tag, atom->nspecial, atom->special,
+                                    eflag, vflag, eflag_atom, vflag_atom,
+                                    host_start, &ilist, &numneigh, cpu_time,
+                                    success);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     lj96_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		     vflag_atom, host_start, cpu_time, success);
+                     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                     vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -121,7 +121,7 @@ void PairLJClass2GPU::compute(int eflag, int vflag)
 
 void PairLJClass2GPU::init_style()
 {
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with lj/class2/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -145,9 +145,9 @@ void PairLJClass2GPU::init_style()
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int success = lj96_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4,
-			      offset, force->special_lj, atom->nlocal,
-			      atom->nlocal+atom->nghost, 300, maxspecial,
-			      cell_size, gpu_mode, screen);
+                              offset, force->special_lj, atom->nlocal,
+                              atom->nlocal+atom->nghost, 300, maxspecial,
+                              cell_size, gpu_mode, screen);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -168,7 +168,7 @@ double PairLJClass2GPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairLJClass2GPU::cpu_compute(int start, int inum, int eflag, int vflag,
-				 int *ilist, int *numneigh, int **firstneigh)
+                                 int *ilist, int *numneigh, int **firstneigh)
 {
   int i,j,ii,jj,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
@@ -203,23 +203,23 @@ void PairLJClass2GPU::cpu_compute(int start, int inum, int eflag, int vflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r3inv = sqrt(r6inv);
-	forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r3inv = sqrt(r6inv);
+        forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_lj_class2_gpu.h b/src/GPU/pair_lj_class2_gpu.h
index 21c893b04a..2512a6cdba 100644
--- a/src/GPU/pair_lj_class2_gpu.h
+++ b/src/GPU/pair_lj_class2_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp
index 53f6fd94b3..8d83ceb255 100644
--- a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp
+++ b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -38,28 +38,28 @@
 // External functions from cuda library for atom decomposition
 
 int ljc_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
-                 double **host_lj2, double **host_lj3, double **host_lj4, 
-                 double **offset, double *special_lj, const int nlocal, 
+                 double **host_lj2, double **host_lj3, double **host_lj4,
+                 double **offset, double *special_lj, const int nlocal,
                  const int nall, const int max_nbors, const int maxspecial,
                  const double cell_size, int &gpu_mode, FILE *screen,
                  double **host_cut_ljsq, double **host_cut_coulsq,
                  double *host_special_coul, const double qqrd2e);
 void ljc_gpu_clear();
 int ** ljc_gpu_compute_n(const int ago, const int inum,
-			 const int nall, double **host_x, int *host_type, 
-			 double *sublo, double *subhi, int *tag, int **nspecial,
-			 int **special, const bool eflag, const bool vflag,
-			 const bool eatom, const bool vatom, int &host_start,
-			 int **ilist, int **jnum, const double cpu_time,
-			 bool &success, double *host_q, double *boxlo,
-			 double *prd);
+                         const int nall, double **host_x, int *host_type,
+                         double *sublo, double *subhi, int *tag, int **nspecial,
+                         int **special, const bool eflag, const bool vflag,
+                         const bool eatom, const bool vatom, int &host_start,
+                         int **ilist, int **jnum, const double cpu_time,
+                         bool &success, double *host_q, double *boxlo,
+                         double *prd);
 void ljc_gpu_compute(const int ago, const int inum,
-	 	     const int nall, double **host_x, int *host_type,
+                      const int nall, double **host_x, int *host_type,
                      int *ilist, int *numj, int **firstneigh,
-		     const bool eflag, const bool vflag, const bool eatom,
+                     const bool eflag, const bool vflag, const bool eatom,
                      const bool vatom, int &host_start, const double cpu_time,
                      bool &success, double *host_q, const int nlocal,
-		     double *boxlo, double *prd);
+                     double *boxlo, double *prd);
 double ljc_gpu_bytes();
 
 using namespace LAMMPS_NS;
@@ -70,7 +70,7 @@ PairLJCutCoulCutGPU::PairLJCutCoulCutGPU(LAMMPS *lmp) : PairLJCutCoulCut(lmp), g
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -88,30 +88,30 @@ void PairLJCutCoulCutGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;  
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = ljc_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				   atom->type, domain->sublo, domain->subhi,
-				   atom->tag, atom->nspecial, atom->special,
-				   eflag, vflag, eflag_atom, vflag_atom,
-				   host_start, &ilist, &numneigh, cpu_time,
-				   success, atom->q, domain->boxlo, 
-				   domain->prd);
+                                   atom->type, domain->sublo, domain->subhi,
+                                   atom->tag, atom->nspecial, atom->special,
+                                   eflag, vflag, eflag_atom, vflag_atom,
+                                   host_start, &ilist, &numneigh, cpu_time,
+                                   success, atom->q, domain->boxlo,
+                                   domain->prd);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     ljc_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		    vflag_atom, host_start, cpu_time, success, atom->q,
-		    atom->nlocal, domain->boxlo, domain->prd);
+                    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                    vflag_atom, host_start, cpu_time, success, atom->q,
+                    atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -132,7 +132,7 @@ void PairLJCutCoulCutGPU::init_style()
   if (!atom->q_flag)
     error->all(FLERR,"Pair style lj/cut/coul/cut/gpu requires atom attribute q");
 
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with lj/cut/coul/cut/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -156,10 +156,10 @@ void PairLJCutCoulCutGPU::init_style()
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int success = ljc_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4,
-			     offset, force->special_lj, atom->nlocal,
-			     atom->nlocal+atom->nghost, 300, maxspecial,
-			     cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq,
-			     force->special_coul, force->qqrd2e);
+                             offset, force->special_lj, atom->nlocal,
+                             atom->nlocal+atom->nghost, 300, maxspecial,
+                             cell_size, gpu_mode, screen, cut_ljsq, cut_coulsq,
+                             force->special_coul, force->qqrd2e);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -180,8 +180,8 @@ double PairLJCutCoulCutGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutCoulCutGPU::cpu_compute(int start, int inum, int eflag, int vflag,
-				      int *ilist, int *numneigh,
-				      int **firstneigh)
+                                      int *ilist, int *numneigh,
+                                      int **firstneigh)
 {
   int i,j,ii,jj,jnum,itype,jtype;
   double qtmp,xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
@@ -223,35 +223,35 @@ void PairLJCutCoulCutGPU::cpu_compute(int start, int inum, int eflag, int vflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq[itype][jtype])
-	  forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
-	else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	} else forcelj = 0.0;
-
-	fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  if (rsq < cut_coulsq[itype][jtype])
-	    ecoul = factor_coul * qqrd2e * qtmp*q[j]*sqrt(r2inv);
-	  else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq[itype][jtype])
+          forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
+        else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        } else forcelj = 0.0;
+
+        fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          if (rsq < cut_coulsq[itype][jtype])
+            ecoul = factor_coul * qqrd2e * qtmp*q[j]*sqrt(r2inv);
+          else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.h b/src/GPU/pair_lj_cut_coul_cut_gpu.h
index f03b16325c..036b084549 100644
--- a/src/GPU/pair_lj_cut_coul_cut_gpu.h
+++ b/src/GPU/pair_lj_cut_coul_cut_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.cpp b/src/GPU/pair_lj_cut_coul_long_gpu.cpp
index 00b8ef3897..1e96fe6572 100644
--- a/src/GPU/pair_lj_cut_coul_long_gpu.cpp
+++ b/src/GPU/pair_lj_cut_coul_long_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -47,28 +47,28 @@
 // External functions from cuda library for atom decomposition
 
 int ljcl_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
-		  double **host_lj2, double **host_lj3, double **host_lj4, 
-		  double **offset, double *special_lj, const int nlocal, 
-		  const int nall, const int max_nbors, const int maxspecial,
-		  const double cell_size, int &gpu_mode, FILE *screen,
-		  double **host_cut_ljsq, double host_cut_coulsq,
-		  double *host_special_coul, const double qqrd2e,
-		  const double g_ewald);
+                  double **host_lj2, double **host_lj3, double **host_lj4,
+                  double **offset, double *special_lj, const int nlocal,
+                  const int nall, const int max_nbors, const int maxspecial,
+                  const double cell_size, int &gpu_mode, FILE *screen,
+                  double **host_cut_ljsq, double host_cut_coulsq,
+                  double *host_special_coul, const double qqrd2e,
+                  const double g_ewald);
 void ljcl_gpu_clear();
 int ** ljcl_gpu_compute_n(const int ago, const int inum,
-			  const int nall, double **host_x, int *host_type, 
-			  double *sublo, double *subhi, int *tag, 
-			  int **nspecial, int **special, const bool eflag,
-			  const bool vflag, const bool eatom, const bool vatom,
-			  int &host_start, int **ilist, int **jnum,
-			  const double cpu_time, bool &success, double *host_q,
-			  double *boxlo, double *prd);
+                          const int nall, double **host_x, int *host_type,
+                          double *sublo, double *subhi, int *tag,
+                          int **nspecial, int **special, const bool eflag,
+                          const bool vflag, const bool eatom, const bool vatom,
+                          int &host_start, int **ilist, int **jnum,
+                          const double cpu_time, bool &success, double *host_q,
+                          double *boxlo, double *prd);
 void ljcl_gpu_compute(const int ago, const int inum, const int nall,
-		      double **host_x, int *host_type, int *ilist, int *numj,
-		      int **firstneigh, const bool eflag, const bool vflag,
-		      const bool eatom, const bool vatom, int &host_start,
-		      const double cpu_time, bool &success, double *host_q,
-		      const int nlocal, double *boxlo, double *prd);
+                      double **host_x, int *host_type, int *ilist, int *numj,
+                      int **firstneigh, const bool eflag, const bool vflag,
+                      const bool eatom, const bool vatom, int &host_start,
+                      const double cpu_time, bool &success, double *host_q,
+                      const int nlocal, double *boxlo, double *prd);
 double ljcl_gpu_bytes();
 
 using namespace LAMMPS_NS;
@@ -80,7 +80,7 @@ PairLJCutCoulLongGPU::PairLJCutCoulLongGPU(LAMMPS *lmp) :
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -98,30 +98,30 @@ void PairLJCutCoulLongGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;    
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = ljcl_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				    atom->type, domain->sublo, domain->subhi,
-				    atom->tag, atom->nspecial, atom->special,
-				    eflag, vflag, eflag_atom, vflag_atom,
-				    host_start, &ilist, &numneigh, cpu_time,
-				    success, atom->q, domain->boxlo,
-				    domain->prd);
+                                    atom->type, domain->sublo, domain->subhi,
+                                    atom->tag, atom->nspecial, atom->special,
+                                    eflag, vflag, eflag_atom, vflag_atom,
+                                    host_start, &ilist, &numneigh, cpu_time,
+                                    success, atom->q, domain->boxlo,
+                                    domain->prd);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     ljcl_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		     vflag_atom, host_start, cpu_time, success, atom->q,
-		     atom->nlocal, domain->boxlo, domain->prd);
+                     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                     vflag_atom, host_start, cpu_time, success, atom->q,
+                     atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -143,7 +143,7 @@ void PairLJCutCoulLongGPU::init_style()
 
   if (!atom->q_flag)
     error->all(FLERR,"Pair style lj/cut/coul/long/gpu requires atom attribute q");
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with lj/cut/coul/long/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -203,8 +203,8 @@ double PairLJCutCoulLongGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutCoulLongGPU::cpu_compute(int start, int inum, int eflag,
-				       int vflag, int *ilist, int *numneigh,
-				       int **firstneigh)
+                                       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;
@@ -249,64 +249,64 @@ void PairLJCutCoulLongGPU::cpu_compute(int start, int inum, int eflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.h b/src/GPU/pair_lj_cut_coul_long_gpu.h
index 9ff26f483e..1904203925 100644
--- a/src/GPU/pair_lj_cut_coul_long_gpu.h
+++ b/src/GPU/pair_lj_cut_coul_long_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_lj_cut_gpu.cpp b/src/GPU/pair_lj_cut_gpu.cpp
index 6e954d7ad1..3d4db278c6 100644
--- a/src/GPU/pair_lj_cut_gpu.cpp
+++ b/src/GPU/pair_lj_cut_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -38,23 +38,23 @@
 // External functions from cuda library for atom decomposition
 
 int ljl_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
-		 double **host_lj2, double **host_lj3, double **host_lj4, 
-		 double **offset, double *special_lj, const int nlocal, 
-		 const int nall, const int max_nbors, const int maxspecial,
-		 const double cell_size, int &gpu_mode, FILE *screen);
+                 double **host_lj2, double **host_lj3, double **host_lj4,
+                 double **offset, double *special_lj, const int nlocal,
+                 const int nall, const int max_nbors, const int maxspecial,
+                 const double cell_size, int &gpu_mode, FILE *screen);
 void ljl_gpu_clear();
 int ** ljl_gpu_compute_n(const int ago, const int inum,
-			 const int nall, double **host_x, int *host_type, 
-			 double *sublo, double *subhi, int *tag, int **nspecial,
-			 int **special, const bool eflag, const bool vflag,
-			 const bool eatom, const bool vatom, int &host_start,
-			 int **ilist, int **jnum,
-			 const double cpu_time, bool &success);
-void ljl_gpu_compute(const int ago, const int inum, const int nall, 
-		     double **host_x, int *host_type, int *ilist, int *numj,
-		     int **firstneigh, const bool eflag, const bool vflag,
-		     const bool eatom, const bool vatom, int &host_start,
-		     const double cpu_time, bool &success);
+                         const int nall, double **host_x, int *host_type,
+                         double *sublo, double *subhi, int *tag, int **nspecial,
+                         int **special, const bool eflag, const bool vflag,
+                         const bool eatom, const bool vatom, int &host_start,
+                         int **ilist, int **jnum,
+                         const double cpu_time, bool &success);
+void ljl_gpu_compute(const int ago, const int inum, const int nall,
+                     double **host_x, int *host_type, int *ilist, int *numj,
+                     int **firstneigh, const bool eflag, const bool vflag,
+                     const bool eatom, const bool vatom, int &host_start,
+                     const double cpu_time, bool &success);
 double ljl_gpu_bytes();
 
 using namespace LAMMPS_NS;
@@ -65,7 +65,7 @@ PairLJCutGPU::PairLJCutGPU(LAMMPS *lmp) : PairLJCut(lmp), gpu_mode(GPU_FORCE)
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -83,28 +83,28 @@ void PairLJCutGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
   int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = ljl_gpu_compute_n(neighbor->ago, inum, nall,
-				   atom->x, atom->type, domain->sublo,
-				   domain->subhi, atom->tag, atom->nspecial,
-				   atom->special, eflag, vflag, eflag_atom,
-				   vflag_atom, host_start, 
-				   &ilist, &numneigh, cpu_time, success);
+                                   atom->x, atom->type, domain->sublo,
+                                   domain->subhi, atom->tag, atom->nspecial,
+                                   atom->special, eflag, vflag, eflag_atom,
+                                   vflag_atom, host_start,
+                                   &ilist, &numneigh, cpu_time, success);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     ljl_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		    vflag_atom, host_start, cpu_time, success);
+                    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                    vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -124,7 +124,7 @@ void PairLJCutGPU::init_style()
 {
   cut_respa = NULL;
 
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with lj/cut/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -148,9 +148,9 @@ void PairLJCutGPU::init_style()
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int success = ljl_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4,
-			     offset, force->special_lj, atom->nlocal,
-			     atom->nlocal+atom->nghost, 300, maxspecial,
-			     cell_size, gpu_mode, screen);
+                             offset, force->special_lj, atom->nlocal,
+                             atom->nlocal+atom->nghost, 300, maxspecial,
+                             cell_size, gpu_mode, screen);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -170,8 +170,8 @@ double PairLJCutGPU::memory_usage()
 
 /* ---------------------------------------------------------------------- */
 
-void PairLJCutGPU::cpu_compute(int start, int inum, int eflag, int vflag, 
-			       int *ilist, int *numneigh, int **firstneigh) {
+void PairLJCutGPU::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 rsq,r2inv,r6inv,forcelj,factor_lj;
@@ -205,22 +205,22 @@ void PairLJCutGPU::cpu_compute(int start, int inum, int eflag, int vflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_lj_cut_gpu.h b/src/GPU/pair_lj_cut_gpu.h
index d748651276..0229adc62b 100644
--- a/src/GPU/pair_lj_cut_gpu.h
+++ b/src/GPU/pair_lj_cut_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_lj_expand_gpu.cpp b/src/GPU/pair_lj_expand_gpu.cpp
index 5bce6dba7c..11f5495b8e 100644
--- a/src/GPU/pair_lj_expand_gpu.cpp
+++ b/src/GPU/pair_lj_expand_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -38,24 +38,24 @@
 // External functions from cuda library for atom decomposition
 
 int lje_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
-		 double **host_lj2, double **host_lj3, double **host_lj4, 
-		 double **offset, double **shift, double *special_lj, 
-		 const int nlocal, const int nall, const int max_nbors,
-		 const int maxspecial, const double cell_size, int &gpu_mode,
-		 FILE *screen);
+                 double **host_lj2, double **host_lj3, double **host_lj4,
+                 double **offset, double **shift, double *special_lj,
+                 const int nlocal, const int nall, const int max_nbors,
+                 const int maxspecial, const double cell_size, int &gpu_mode,
+                 FILE *screen);
 void lje_gpu_clear();
 int ** lje_gpu_compute_n(const int ago, const int inum, const int nall,
-			 double **host_x, int *host_type, double *sublo,
-			 double *subhi, int *tag, int **nspecial,
-			 int **special, const bool eflag, const bool vflag,
-			 const bool eatom, const bool vatom, int &host_start,
-			 int **ilist, int **jnum,
-			 const double cpu_time, bool &success);
+                         double **host_x, int *host_type, double *sublo,
+                         double *subhi, int *tag, int **nspecial,
+                         int **special, const bool eflag, const bool vflag,
+                         const bool eatom, const bool vatom, int &host_start,
+                         int **ilist, int **jnum,
+                         const double cpu_time, bool &success);
 void lje_gpu_compute(const int ago, const int inum, const int nall,
-		     double **host_x, int *host_type, int *ilist, int *numj,
-		     int **firstneigh, const bool eflag, const bool vflag,
-		     const bool eatom, const bool vatom, int &host_start,
-		     const double cpu_time, bool &success);
+                     double **host_x, int *host_type, int *ilist, int *numj,
+                     int **firstneigh, const bool eflag, const bool vflag,
+                     const bool eatom, const bool vatom, int &host_start,
+                     const double cpu_time, bool &success);
 double lje_gpu_bytes();
 
 using namespace LAMMPS_NS;
@@ -66,7 +66,7 @@ PairLJExpandGPU::PairLJExpandGPU(LAMMPS *lmp) : PairLJExpand(lmp), gpu_mode(GPU_
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -84,28 +84,28 @@ void PairLJExpandGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;    
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = lje_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				   atom->type, domain->sublo, domain->subhi,
-				   atom->tag, atom->nspecial, atom->special,
-				   eflag, vflag, eflag_atom, vflag_atom,
-				   host_start, &ilist, &numneigh, cpu_time,
-				   success);
+                                   atom->type, domain->sublo, domain->subhi,
+                                   atom->tag, atom->nspecial, atom->special,
+                                   eflag, vflag, eflag_atom, vflag_atom,
+                                   host_start, &ilist, &numneigh, cpu_time,
+                                   success);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     lje_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		    vflag_atom, host_start, cpu_time, success);
+                    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                    vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -123,7 +123,7 @@ void PairLJExpandGPU::compute(int eflag, int vflag)
 
 void PairLJExpandGPU::init_style()
 {
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with lj/expand/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -147,9 +147,9 @@ void PairLJExpandGPU::init_style()
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int success = lje_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4,
-			     offset, shift, force->special_lj, atom->nlocal,
-			     atom->nlocal+atom->nghost, 300, maxspecial,
-			     cell_size, gpu_mode, screen);
+                             offset, shift, force->special_lj, atom->nlocal,
+                             atom->nlocal+atom->nghost, 300, maxspecial,
+                             cell_size, gpu_mode, screen);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -170,7 +170,7 @@ double PairLJExpandGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairLJExpandGPU::cpu_compute(int start, int inum, int eflag, int vflag,
-				  int *ilist, int *numneigh, int **firstneigh)
+                                  int *ilist, int *numneigh, int **firstneigh)
 {
   int i,j,ii,jj,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
@@ -206,25 +206,25 @@ void PairLJExpandGPU::cpu_compute(int start, int inum, int eflag, int vflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	rshift = r - shift[itype][jtype];
-	rshiftsq = rshift*rshift;
-	r2inv = 1.0/rshiftsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj/rshift/r;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
+        r = sqrt(rsq);
+        rshift = r - shift[itype][jtype];
+        rshiftsq = rshift*rshift;
+        r2inv = 1.0/rshiftsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj/rshift/r;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_lj_expand_gpu.h b/src/GPU/pair_lj_expand_gpu.h
index 15a82640d3..2187ab254f 100644
--- a/src/GPU/pair_lj_expand_gpu.h
+++ b/src/GPU/pair_lj_expand_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp
index 98656e50fd..2103295037 100644
--- a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp
+++ b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -47,28 +47,28 @@
 // External functions from cuda library for atom decomposition
 
 int cmml_gpu_init(const int ntypes, double **cutsq, int **lj_type,
-		  double **host_lj1, double **host_lj2, double **host_lj3,
-		  double **host_lj4, double **offset, double *special_lj,
-		  const int nlocal, const int nall, const int max_nbors,
-		  const int maxspecial, const double cell_size, int &gpu_mode,
-		  FILE *screen, double **host_cut_ljsq, double host_cut_coulsq,
-		  double *host_special_coul, const double qqrd2e,
-		  const double g_ewald);
+                  double **host_lj1, double **host_lj2, double **host_lj3,
+                  double **host_lj4, double **offset, double *special_lj,
+                  const int nlocal, const int nall, const int max_nbors,
+                  const int maxspecial, const double cell_size, int &gpu_mode,
+                  FILE *screen, double **host_cut_ljsq, double host_cut_coulsq,
+                  double *host_special_coul, const double qqrd2e,
+                  const double g_ewald);
 void cmml_gpu_clear();
 int ** cmml_gpu_compute_n(const int ago, const int inum, const int nall,
-			  double **host_x, int *host_type, double *sublo,
-			  double *subhi, int *tag, int **nspecial,
-			  int **special, const bool eflag, const bool vflag,
-			  const bool eatom, const bool vatom, int &host_start,
-			  int **ilist, int **jnum, const double cpu_time,
-			  bool &success, double *host_q, double *boxlo,
-			  double *prd);
+                          double **host_x, int *host_type, double *sublo,
+                          double *subhi, int *tag, int **nspecial,
+                          int **special, const bool eflag, const bool vflag,
+                          const bool eatom, const bool vatom, int &host_start,
+                          int **ilist, int **jnum, const double cpu_time,
+                          bool &success, double *host_q, double *boxlo,
+                          double *prd);
 void cmml_gpu_compute(const int ago, const int inum, const int nall,
-		      double **host_x, int *host_type, int *ilist, int *numj,
-		      int **firstneigh, const bool eflag, const bool vflag,
-		      const bool eatom, const bool vatom, int &host_start,
-		      const double cpu_time, bool &success, double *host_q,
-		      const int nlocal, double *boxlo, double *prd);
+                      double **host_x, int *host_type, int *ilist, int *numj,
+                      int **firstneigh, const bool eflag, const bool vflag,
+                      const bool eatom, const bool vatom, int &host_start,
+                      const double cpu_time, bool &success, double *host_q,
+                      const int nlocal, double *boxlo, double *prd);
 double cmml_gpu_bytes();
 
 #include "lj_sdk_common.h"
@@ -83,7 +83,7 @@ PairLJSDKCoulLongGPU::PairLJSDKCoulLongGPU(LAMMPS *lmp) :
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -101,30 +101,30 @@ void PairLJSDKCoulLongGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;    
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = cmml_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				    atom->type, domain->sublo, domain->subhi,
-				    atom->tag, atom->nspecial, atom->special,
-				    eflag, vflag, eflag_atom, vflag_atom,
-				    host_start, &ilist, &numneigh, cpu_time,
-				    success, atom->q, domain->boxlo,
-				    domain->prd);
+                                    atom->type, domain->sublo, domain->subhi,
+                                    atom->tag, atom->nspecial, atom->special,
+                                    eflag, vflag, eflag_atom, vflag_atom,
+                                    host_start, &ilist, &numneigh, cpu_time,
+                                    success, atom->q, domain->boxlo,
+                                    domain->prd);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     cmml_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		     vflag_atom, host_start, cpu_time, success, atom->q,
-		     atom->nlocal, domain->boxlo, domain->prd);
+                     ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                     vflag_atom, host_start, cpu_time, success, atom->q,
+                     atom->nlocal, domain->boxlo, domain->prd);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -147,7 +147,7 @@ void PairLJSDKCoulLongGPU::init_style()
 {
   if (!atom->q_flag)
     error->all(FLERR,"Pair style lj/sdk/coul/long/gpu requires atom attribute q");
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with lj/sdk/coul/long/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -183,11 +183,11 @@ void PairLJSDKCoulLongGPU::init_style()
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int success = cmml_gpu_init(atom->ntypes+1, cutsq, lj_type, lj1, lj2, lj3,
-			      lj4, offset, force->special_lj, atom->nlocal,
-			      atom->nlocal+atom->nghost, 300, maxspecial,
-			      cell_size, gpu_mode, screen, cut_ljsq,
-			      cut_coulsq, force->special_coul,
-			      force->qqrd2e, g_ewald);
+                              lj4, offset, force->special_lj, atom->nlocal,
+                              atom->nlocal+atom->nghost, 300, maxspecial,
+                              cell_size, gpu_mode, screen, cut_ljsq,
+                              cut_coulsq, force->special_coul,
+                              force->qqrd2e, g_ewald);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -208,7 +208,7 @@ double PairLJSDKCoulLongGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 template <int EVFLAG, int EFLAG>
 void PairLJSDKCoulLongGPU::cpu_compute(int start, int inum, int *ilist,
-				       int *numneigh, int **firstneigh)
+                                       int *numneigh, int **firstneigh)
 {
   int i,j,ii,jj;
   double qtmp,xtmp,ytmp,ztmp;
@@ -255,11 +255,11 @@ void PairLJSDKCoulLongGPU::cpu_compute(int start, int inum, int *ilist,
       double fpair = 0.0;
 
       if (rsq < cutsq[itype][jtype]) {
-  	r2inv = 1.0/rsq;
-	const int ljt = lj_type[itype][jtype];
+          r2inv = 1.0/rsq;
+        const int ljt = lj_type[itype][jtype];
 
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
             const double r = sqrt(rsq);
             const double grij = g_ewald * r;
             const double expm2 = exp(-grij*grij);
@@ -272,7 +272,7 @@ void PairLJSDKCoulLongGPU::cpu_compute(int start, int inum, int *ilist,
               forcecoul -= (1.0-factor_coul)*prefactor;
               if (EFLAG) ecoul -= (1.0-factor_coul)*prefactor;
             }
-	  } else {
+          } else {
             union_int_float_t rsq_lookup;
             rsq_lookup.f = rsq;
             int itable = rsq_lookup.i & ncoulmask;
@@ -291,56 +291,56 @@ void PairLJSDKCoulLongGPU::cpu_compute(int start, int inum, int *ilist,
               forcecoul -= (1.0-factor_coul)*prefactor;
               if (EFLAG) ecoul -= (1.0-factor_coul)*prefactor;
             }
-	  }
-	} else {
-	  forcecoul = 0.0;
-	  ecoul = 0.0;
-	}
-
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-
-	  if (ljt == LJ12_4) {
-	    const double r4inv=r2inv*r2inv;
-	    forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
-			     - lj2[itype][jtype]);
-
-	    if (EFLAG)
-	      evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
-			     - lj4[itype][jtype]) - offset[itype][jtype];
-	  
-	  } else if (ljt == LJ9_6) {
-	    const double r3inv = r2inv*sqrt(r2inv);
-	    const double r6inv = r3inv*r3inv;
-	    forcelj = r6inv*(lj1[itype][jtype]*r3inv
-			     - lj2[itype][jtype]);
-	    if (EFLAG)
-	      evdwl = r6inv*(lj3[itype][jtype]*r3inv
-			     - lj4[itype][jtype]) - offset[itype][jtype];
-
-	  } else if (ljt == LJ12_6) {
-	    const double r6inv = r2inv*r2inv*r2inv;
-	    forcelj = r6inv*(lj1[itype][jtype]*r6inv
-			     - lj2[itype][jtype]);
-	    if (EFLAG)
-	      evdwl = r6inv*(lj3[itype][jtype]*r6inv
-			     - lj4[itype][jtype]) - offset[itype][jtype];
-	  }
-
-	  if (EFLAG) evdwl *= factor_lj;
-
-	} else {
-	  forcelj=0.0;
-	  evdwl = 0.0;
-	}
-
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-
-	if (EVFLAG) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
+          }
+        } else {
+          forcecoul = 0.0;
+          ecoul = 0.0;
+        }
+
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+
+          if (ljt == LJ12_4) {
+            const double r4inv=r2inv*r2inv;
+            forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
+                             - lj2[itype][jtype]);
+
+            if (EFLAG)
+              evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
+                             - lj4[itype][jtype]) - offset[itype][jtype];
+
+          } else if (ljt == LJ9_6) {
+            const double r3inv = r2inv*sqrt(r2inv);
+            const double r6inv = r3inv*r3inv;
+            forcelj = r6inv*(lj1[itype][jtype]*r3inv
+                             - lj2[itype][jtype]);
+            if (EFLAG)
+              evdwl = r6inv*(lj3[itype][jtype]*r3inv
+                             - lj4[itype][jtype]) - offset[itype][jtype];
+
+          } else if (ljt == LJ12_6) {
+            const double r6inv = r2inv*r2inv*r2inv;
+            forcelj = r6inv*(lj1[itype][jtype]*r6inv
+                             - lj2[itype][jtype]);
+            if (EFLAG)
+              evdwl = r6inv*(lj3[itype][jtype]*r6inv
+                             - lj4[itype][jtype]) - offset[itype][jtype];
+          }
+
+          if (EFLAG) evdwl *= factor_lj;
+
+        } else {
+          forcelj=0.0;
+          evdwl = 0.0;
+        }
+
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+
+        if (EVFLAG) ev_tally_full(i,evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.h b/src/GPU/pair_lj_sdk_coul_long_gpu.h
index 595c05c118..f8530bf352 100644
--- a/src/GPU/pair_lj_sdk_coul_long_gpu.h
+++ b/src/GPU/pair_lj_sdk_coul_long_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_lj_sdk_gpu.cpp b/src/GPU/pair_lj_sdk_gpu.cpp
index 6d610e9f97..745433458b 100644
--- a/src/GPU/pair_lj_sdk_gpu.cpp
+++ b/src/GPU/pair_lj_sdk_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -37,25 +37,25 @@
 
 // External functions from cuda library for atom decomposition
 
-int cmm_gpu_init(const int ntypes, double **cutsq, int **cg_types, 
-		 double **host_lj1, double **host_lj2, double **host_lj3,
-		 double **host_lj4, double **offset, double *special_lj,
-		 const int nlocal, const int nall, const int max_nbors,
-		 const int maxspecial, const double cell_size, int &gpu_mode,
-		 FILE *screen);
+int cmm_gpu_init(const int ntypes, double **cutsq, int **cg_types,
+                 double **host_lj1, double **host_lj2, double **host_lj3,
+                 double **host_lj4, double **offset, double *special_lj,
+                 const int nlocal, const int nall, const int max_nbors,
+                 const int maxspecial, const double cell_size, int &gpu_mode,
+                 FILE *screen);
 void cmm_gpu_clear();
 int ** cmm_gpu_compute_n(const int ago, const int inum, const int nall,
-			 double **host_x, int *host_type, double *sublo,
-			 double *subhi, int *tag, int **nspecial,
-			 int **special, const bool eflag, const bool vflag,
-			 const bool eatom, const bool vatom, int &host_start,
-			 int **ilist, int **jnum,
-			 const double cpu_time, bool &success);
+                         double **host_x, int *host_type, double *sublo,
+                         double *subhi, int *tag, int **nspecial,
+                         int **special, const bool eflag, const bool vflag,
+                         const bool eatom, const bool vatom, int &host_start,
+                         int **ilist, int **jnum,
+                         const double cpu_time, bool &success);
 void cmm_gpu_compute(const int ago, const int inum, const int nall,
-		     double **host_x, int *host_type, int *ilist, int *numj,
-		     int **firstneigh, const bool eflag, const bool vflag,
-		     const bool eatom, const bool vatom, int &host_start,
-		     const double cpu_time, bool &success);
+                     double **host_x, int *host_type, int *ilist, int *numj,
+                     int **firstneigh, const bool eflag, const bool vflag,
+                     const bool eatom, const bool vatom, int &host_start,
+                     const double cpu_time, bool &success);
 double cmm_gpu_bytes();
 
 #include "lj_sdk_common.h"
@@ -69,7 +69,7 @@ PairLJSDKGPU::PairLJSDKGPU(LAMMPS *lmp) : PairLJSDK(lmp), gpu_mode(GPU_FORCE)
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -87,28 +87,28 @@ void PairLJSDKGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;    
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = cmm_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				   atom->type, domain->sublo, domain->subhi,
-				   atom->tag, atom->nspecial, atom->special,
-				   eflag, vflag, eflag_atom, vflag_atom,
-				   host_start, &ilist, &numneigh, cpu_time,
-				   success);
+                                   atom->type, domain->sublo, domain->subhi,
+                                   atom->tag, atom->nspecial, atom->special,
+                                   eflag, vflag, eflag_atom, vflag_atom,
+                                   host_start, &ilist, &numneigh, cpu_time,
+                                   success);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     cmm_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		    vflag_atom, host_start, cpu_time, success);
+                    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                    vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -129,7 +129,7 @@ void PairLJSDKGPU::compute(int eflag, int vflag)
 
 void PairLJSDKGPU::init_style()
 {
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with lj/sdk/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -153,9 +153,9 @@ void PairLJSDKGPU::init_style()
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int success = cmm_gpu_init(atom->ntypes+1,cutsq,lj_type,lj1,lj2,lj3,lj4,
-			     offset, force->special_lj, atom->nlocal,
-			     atom->nlocal+atom->nghost, 300, maxspecial,
-			     cell_size, gpu_mode, screen);
+                             offset, force->special_lj, atom->nlocal,
+                             atom->nlocal+atom->nghost, 300, maxspecial,
+                             cell_size, gpu_mode, screen);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -176,7 +176,7 @@ double PairLJSDKGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 template <int EVFLAG, int EFLAG>
 void PairLJSDKGPU::cpu_compute(int start, int inum, int *ilist,
-			       int *numneigh, int **firstneigh)
+                               int *numneigh, int **firstneigh)
 {
   int i,j,ii,jj,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
@@ -214,43 +214,43 @@ void PairLJSDKGPU::cpu_compute(int start, int inum, int *ilist,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	const int ljt = lj_type[itype][jtype];
-
-	if (ljt == LJ12_4) {
-	  const double r4inv=r2inv*r2inv;
-	  forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
-			   - lj2[itype][jtype]);
-
-	  if (EFLAG)
-	    evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
-			   - lj4[itype][jtype]) - offset[itype][jtype];
-	  
-	} else if (ljt == LJ9_6) {
-	  const double r3inv = r2inv*sqrt(r2inv);
-	  const double r6inv = r3inv*r3inv;
-	  forcelj = r6inv*(lj1[itype][jtype]*r3inv
-			   - lj2[itype][jtype]);
-	  if (EFLAG)
-	    evdwl = r6inv*(lj3[itype][jtype]*r3inv
-			   - lj4[itype][jtype]) - offset[itype][jtype];
-
-	} else if (ljt == LJ12_6) {
-	  const double r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv*(lj1[itype][jtype]*r6inv
-			  - lj2[itype][jtype]);
-	  if (EFLAG)
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv
-			   - lj4[itype][jtype]) - offset[itype][jtype];
-	} else continue;
-
-	fpair = factor_lj*forcelj*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-
-	if (EVFLAG) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        const int ljt = lj_type[itype][jtype];
+
+        if (ljt == LJ12_4) {
+          const double r4inv=r2inv*r2inv;
+          forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
+                           - lj2[itype][jtype]);
+
+          if (EFLAG)
+            evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
+                           - lj4[itype][jtype]) - offset[itype][jtype];
+
+        } else if (ljt == LJ9_6) {
+          const double r3inv = r2inv*sqrt(r2inv);
+          const double r6inv = r3inv*r3inv;
+          forcelj = r6inv*(lj1[itype][jtype]*r3inv
+                           - lj2[itype][jtype]);
+          if (EFLAG)
+            evdwl = r6inv*(lj3[itype][jtype]*r3inv
+                           - lj4[itype][jtype]) - offset[itype][jtype];
+
+        } else if (ljt == LJ12_6) {
+          const double r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv*(lj1[itype][jtype]*r6inv
+                          - lj2[itype][jtype]);
+          if (EFLAG)
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv
+                           - lj4[itype][jtype]) - offset[itype][jtype];
+        } else continue;
+
+        fpair = factor_lj*forcelj*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+
+        if (EVFLAG) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/GPU/pair_lj_sdk_gpu.h b/src/GPU/pair_lj_sdk_gpu.h
index a800ece1d7..c99ea363bc 100644
--- a/src/GPU/pair_lj_sdk_gpu.h
+++ b/src/GPU/pair_lj_sdk_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_morse_gpu.cpp b/src/GPU/pair_morse_gpu.cpp
index 41f420f621..0deae8ef12 100644
--- a/src/GPU/pair_morse_gpu.cpp
+++ b/src/GPU/pair_morse_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -38,23 +38,23 @@
 // External functions from cuda library for atom decomposition
 
 int mor_gpu_init(const int ntypes, double **cutsq, double **host_morse1,
-		 double **host_r0, double **host_alpha, double **host_d0, 
-		 double **offset, double *special_lj, const int nlocal, 
-		 const int nall, const int max_nbors, const int maxspecial,
-		 const double cell_size, int &gpu_mode, FILE *screen);
+                 double **host_r0, double **host_alpha, double **host_d0,
+                 double **offset, double *special_lj, const int nlocal,
+                 const int nall, const int max_nbors, const int maxspecial,
+                 const double cell_size, int &gpu_mode, FILE *screen);
 void mor_gpu_clear();
 int ** mor_gpu_compute_n(const int ago, const int inum,
-			 const int nall, double **host_x, int *host_type, 
-			 double *sublo, double *subhi, int *tag, int **nspecial,
-			 int **special, const bool eflag, const bool vflag,
-			 const bool eatom, const bool vatom, int &host_start,
-			 int **ilist, int **jnum,
-			 const double cpu_time, bool &success);
-void mor_gpu_compute(const int ago, const int inum, const int nall, 
-		     double **host_x, int *host_type, int *ilist, int *numj,
-		     int **firstneigh, const bool eflag, const bool vflag,
-		     const bool eatom, const bool vatom, int &host_start,
-		     const double cpu_time, bool &success);
+                         const int nall, double **host_x, int *host_type,
+                         double *sublo, double *subhi, int *tag, int **nspecial,
+                         int **special, const bool eflag, const bool vflag,
+                         const bool eatom, const bool vatom, int &host_start,
+                         int **ilist, int **jnum,
+                         const double cpu_time, bool &success);
+void mor_gpu_compute(const int ago, const int inum, const int nall,
+                     double **host_x, int *host_type, int *ilist, int *numj,
+                     int **firstneigh, const bool eflag, const bool vflag,
+                     const bool eatom, const bool vatom, int &host_start,
+                     const double cpu_time, bool &success);
 double mor_gpu_bytes();
 
 using namespace LAMMPS_NS;
@@ -64,7 +64,7 @@ using namespace LAMMPS_NS;
 PairMorseGPU::PairMorseGPU(LAMMPS *lmp) : PairMorse(lmp), gpu_mode(GPU_FORCE)
 {
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -82,28 +82,28 @@ void PairMorseGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;    
+  int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = mor_gpu_compute_n(neighbor->ago, inum, nall,
-				   atom->x, atom->type, domain->sublo,
-				   domain->subhi, atom->tag, atom->nspecial,
-				   atom->special, eflag, vflag, eflag_atom,
-				   vflag_atom, host_start, &ilist, &numneigh,
-				   cpu_time, success);
+                                   atom->x, atom->type, domain->sublo,
+                                   domain->subhi, atom->tag, atom->nspecial,
+                                   atom->special, eflag, vflag, eflag_atom,
+                                   vflag_atom, host_start, &ilist, &numneigh,
+                                   cpu_time, success);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     mor_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		    vflag_atom, host_start, cpu_time, success);
+                    ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                    vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -121,7 +121,7 @@ void PairMorseGPU::compute(int eflag, int vflag)
 
 void PairMorseGPU::init_style()
 {
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with morse/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -145,9 +145,9 @@ void PairMorseGPU::init_style()
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int success = mor_gpu_init(atom->ntypes+1, cutsq, morse1, r0, alpha, d0,
-			     offset, force->special_lj, atom->nlocal,
-			     atom->nlocal+atom->nghost, 300, maxspecial,
-			     cell_size, gpu_mode, screen);
+                             offset, force->special_lj, atom->nlocal,
+                             atom->nlocal+atom->nghost, 300, maxspecial,
+                             cell_size, gpu_mode, screen);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -168,7 +168,7 @@ double PairMorseGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairMorseGPU::cpu_compute(int start, int inum, int eflag, int vflag,
-			       int *ilist, int *numneigh, int **firstneigh)
+                               int *ilist, int *numneigh, int **firstneigh)
 {
   int i,j,ii,jj,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
@@ -203,22 +203,22 @@ void PairMorseGPU::cpu_compute(int start, int inum, int eflag, int vflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	dr = r - r0[itype][jtype];
-	dexp = exp(-alpha[itype][jtype] * dr);
-	fpair = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
+        r = sqrt(rsq);
+        dr = r - r0[itype][jtype];
+        dexp = exp(-alpha[itype][jtype] * dr);
+        fpair = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_morse_gpu.h b/src/GPU/pair_morse_gpu.h
index 4cc3fe2649..13dd0ab796 100644
--- a/src/GPU/pair_morse_gpu.h
+++ b/src/GPU/pair_morse_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_resquared_gpu.cpp b/src/GPU/pair_resquared_gpu.cpp
index 8c9939f49b..07cf75906e 100644
--- a/src/GPU/pair_resquared_gpu.cpp
+++ b/src/GPU/pair_resquared_gpu.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -40,25 +40,25 @@
 // External functions from cuda library for atom decomposition
 
 int re_gpu_init(const int ntypes, double **shape, double **well,
-		double **cutsq, double **sigma, double **epsilon,
-		int **form, double **host_lj1,
-		double **host_lj2, double **host_lj3, double **host_lj4,
-		double **offset, double *special_lj, const int nlocal,
-		const int nall,	const int max_nbors, const int maxspecial,
-		const double cell_size,	int &gpu_mode, FILE *screen);
+                double **cutsq, double **sigma, double **epsilon,
+                int **form, double **host_lj1,
+                double **host_lj2, double **host_lj3, double **host_lj4,
+                double **offset, double *special_lj, const int nlocal,
+                const int nall,        const int max_nbors, const int maxspecial,
+                const double cell_size,        int &gpu_mode, FILE *screen);
 void re_gpu_clear();
 int ** re_gpu_compute_n(const int ago, const int inum, const int nall,
-			double **host_x, int *host_type, double *sublo,
-			double *subhi, int *tag, int **nspecial, int **special,
-			const bool eflag, const bool vflag,
-			const bool eatom, const bool vatom, int &host_start,
-			int **ilist, int **jnum, const double cpu_time,
-			bool &success, double **host_quat);
+                        double **host_x, int *host_type, double *sublo,
+                        double *subhi, int *tag, int **nspecial, int **special,
+                        const bool eflag, const bool vflag,
+                        const bool eatom, const bool vatom, int &host_start,
+                        int **ilist, int **jnum, const double cpu_time,
+                        bool &success, double **host_quat);
 int * re_gpu_compute(const int ago, const int inum, const int nall,
-		     double **host_x, int *host_type, int *ilist, int *numj,
-		     int **firstneigh, const bool eflag, const bool vflag,
-		     const bool eatom, const bool vatom, int &host_start,
-		     const double cpu_time, bool &success, double **host_quat);
+                     double **host_x, int *host_type, int *ilist, int *numj,
+                     int **firstneigh, const bool eflag, const bool vflag,
+                     const bool eatom, const bool vatom, int &host_start,
+                     const double cpu_time, bool &success, double **host_quat);
 double re_gpu_bytes();
 
 using namespace LAMMPS_NS;
@@ -71,11 +71,11 @@ PairRESquaredGPU::PairRESquaredGPU(LAMMPS *lmp) : PairRESquared(lmp),
                                                 gpu_mode(GPU_FORCE)
 {
   avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-  if (!avec) 
+  if (!avec)
     error->all(FLERR,"Pair resquared/gpu requires atom style ellipsoid");
   quat_nmax = 0;
   quat = NULL;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -100,7 +100,7 @@ void PairRESquaredGPU::compute(int eflag, int vflag)
   int inum, host_start;
 
   bool success = true;
-  int *ilist, *numneigh, **firstneigh;  
+  int *ilist, *numneigh, **firstneigh;
 
   if (nall > quat_nmax) {
     quat_nmax = static_cast<int>(1.1 * nall);
@@ -121,19 +121,19 @@ void PairRESquaredGPU::compute(int eflag, int vflag)
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = re_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				  atom->type, domain->sublo, domain->subhi,
-				  atom->tag, atom->nspecial, atom->special,
-				  eflag, vflag, eflag_atom, vflag_atom,
-				  host_start, &ilist, &numneigh, cpu_time,
-				  success, quat);
+                                  atom->type, domain->sublo, domain->subhi,
+                                  atom->tag, atom->nspecial, atom->special,
+                                  eflag, vflag, eflag_atom, vflag_atom,
+                                  host_start, &ilist, &numneigh, cpu_time,
+                                  success, quat);
   } else {
     inum = list->inum;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     ilist = re_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-			   list->ilist, numneigh, firstneigh, eflag, vflag,
-			   eflag_atom, vflag_atom, host_start,
-			   cpu_time, success, quat);
+                           list->ilist, numneigh, firstneigh, eflag, vflag,
+                           eflag_atom, vflag_atom, host_start,
+                           cpu_time, success, quat);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -151,7 +151,7 @@ void PairRESquaredGPU::compute(int eflag, int vflag)
 
 void PairRESquaredGPU::init_style()
 {
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with resquared/gpu pair style");
   if (!atom->ellipsoid_flag)
     error->all(FLERR,"Pair resquared/gpu requires atom style ellipsoid");
@@ -193,10 +193,10 @@ void PairRESquaredGPU::init_style()
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int success = re_gpu_init(atom->ntypes+1, shape1, well, cutsq, sigma,
-			    epsilon, form, lj1, lj2, lj3, lj4, offset,
-			    force->special_lj, atom->nlocal, 
-			    atom->nlocal+atom->nghost, 300, maxspecial,
-			    cell_size, gpu_mode, screen);
+                            epsilon, form, lj1, lj2, lj3, lj4, offset,
+                            force->special_lj, atom->nlocal,
+                            atom->nlocal+atom->nghost, 300, maxspecial,
+                            cell_size, gpu_mode, screen);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -219,7 +219,7 @@ double PairRESquaredGPU::memory_usage()
 /* ---------------------------------------------------------------------- */
 
 void PairRESquaredGPU::cpu_compute(int start, int inum, int eflag, int vflag,
-				  int *ilist, int *numneigh, int **firstneigh)
+                                  int *ilist, int *numneigh, int **firstneigh)
 {
   int i,j,ii,jj,jnum,itype,jtype;
   double evdwl,one_eng,rsq,r2inv,r6inv,forcelj,factor_lj;
@@ -308,8 +308,8 @@ void PairRESquaredGPU::cpu_compute(int start, int inum, int eflag, int vflag,
 
         if (eflag) evdwl = factor_lj*one_eng;
 
-	if (evflag) ev_tally_xyz_full(i,evdwl,0.0,fforce[0],fforce[1],
-				      fforce[2],-r12[0],-r12[1],-r12[2]);
+        if (evflag) ev_tally_xyz_full(i,evdwl,0.0,fforce[0],fforce[1],
+                                      fforce[2],-r12[0],-r12[1],-r12[2]);
       }
     }
   }
diff --git a/src/GPU/pair_resquared_gpu.h b/src/GPU/pair_resquared_gpu.h
index 6f95a8b17d..7250886167 100644
--- a/src/GPU/pair_resquared_gpu.h
+++ b/src/GPU/pair_resquared_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_table_gpu.cpp b/src/GPU/pair_table_gpu.cpp
index fcd7e7edf8..797ac8268d 100644
--- a/src/GPU/pair_table_gpu.cpp
+++ b/src/GPU/pair_table_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -42,37 +42,37 @@
 
 // External functions from cuda library for atom decomposition
 
-int table_gpu_init(const int ntypes, double **cutsq, 
-		   double ***host_table_coeffs, double **host_table_data, 
-		   double *special_lj, const int nlocal, const int nall,
-		   const int max_nbors, const int maxspecial,
-		   const double cell_size, int &gpu_mode, FILE *screen, 
-		   int tabstyle, int ntables, int tablength);
+int table_gpu_init(const int ntypes, double **cutsq,
+                   double ***host_table_coeffs, double **host_table_data,
+                   double *special_lj, const int nlocal, const int nall,
+                   const int max_nbors, const int maxspecial,
+                   const double cell_size, int &gpu_mode, FILE *screen,
+                   int tabstyle, int ntables, int tablength);
 void table_gpu_clear();
 int ** table_gpu_compute_n(const int ago, const int inum, const int nall,
-			   double **host_x, int *host_type, double *sublo,
-			   double *subhi, int *tag, int **nspecial,
-			   int **special, const bool eflag, const bool vflag,
-			   const bool eatom, const bool vatom, int &host_start,
-			   int **ilist, int **jnum, const double cpu_time,
-			   bool &success);
-void table_gpu_compute(const int ago, const int inum, const int nall, 
-		       double **host_x, int *host_type, int *ilist, int *numj,
-		       int **firstneigh, const bool eflag, const bool vflag,
-		       const bool eatom, const bool vatom, int &host_start,
-		       const double cpu_time, bool &success);
+                           double **host_x, int *host_type, double *sublo,
+                           double *subhi, int *tag, int **nspecial,
+                           int **special, const bool eflag, const bool vflag,
+                           const bool eatom, const bool vatom, int &host_start,
+                           int **ilist, int **jnum, const double cpu_time,
+                           bool &success);
+void table_gpu_compute(const int ago, const int inum, const int nall,
+                       double **host_x, int *host_type, int *ilist, int *numj,
+                       int **firstneigh, const bool eflag, const bool vflag,
+                       const bool eatom, const bool vatom, int &host_start,
+                       const double cpu_time, bool &success);
 double table_gpu_bytes();
 
 using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-PairTableGPU::PairTableGPU(LAMMPS *lmp) : PairTable(lmp), 
-					  gpu_mode(GPU_FORCE)
+PairTableGPU::PairTableGPU(LAMMPS *lmp) : PairTable(lmp),
+                                          gpu_mode(GPU_FORCE)
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -90,28 +90,28 @@ void PairTableGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
   int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = table_gpu_compute_n(neighbor->ago, inum, nall, atom->x,
-				     atom->type, domain->sublo, domain->subhi,
-				     atom->tag, atom->nspecial, atom->special,
-				     eflag, vflag, eflag_atom, vflag_atom,
-				     host_start, &ilist, &numneigh, cpu_time,
-				     success);
+                                     atom->type, domain->sublo, domain->subhi,
+                                     atom->tag, atom->nspecial, atom->special,
+                                     eflag, vflag, eflag_atom, vflag_atom,
+                                     host_start, &ilist, &numneigh, cpu_time,
+                                     success);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     table_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		      ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		      vflag_atom, host_start, cpu_time, success);
+                      ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                      vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -129,11 +129,11 @@ void PairTableGPU::compute(int eflag, int vflag)
 
 void PairTableGPU::init_style()
 {
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with table/gpu pair style");
 
   int ntypes = atom->ntypes;
-  
+
   // Repeat cutsq calculation because done after call to init_style
   double maxcut = -1.0;
   double cut;
@@ -150,12 +150,12 @@ void PairTableGPU::init_style()
     }
   }
   double cell_size = sqrt(maxcut) + neighbor->skin;
-  
+
   // pack tables and send them to device
   double ***table_coeffs = NULL;
   double **table_data = NULL;
   memory->create(table_coeffs, ntypes+1, ntypes+1, 6, "table:coeffs");
-    
+
   Table *tb;
   for (int i = 1; i <= atom->ntypes; i++)
     for (int j = 1; j <= atom->ntypes; j++) {
@@ -168,7 +168,7 @@ void PairTableGPU::init_style()
       table_coeffs[i][j][4] = tb->invdelta;
       table_coeffs[i][j][5] = tb->deltasq6;
     }
-  
+
   if (tabstyle != BITMAP) {
     memory->create(table_data, ntables, 6*tablength, "table:data");
     for (int n = 0; n < ntables; n++) {
@@ -196,7 +196,7 @@ void PairTableGPU::init_style()
           table_data[n][6*k+3] = tb->e2[k];
           table_data[n][6*k+4] = tb->f2[k];
         }
-      } 
+      }
     }
   } else {
     int ntable = 1 << tablength;
@@ -212,17 +212,17 @@ void PairTableGPU::init_style()
         table_data[n][6*k+4] = tb->df[k];
         table_data[n][6*k+5] = tb->drsq[k];
       }
-    }   
+    }
   }
- 
+
   int maxspecial=0;
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int success = table_gpu_init(atom->ntypes+1, cutsq, table_coeffs, table_data,
-			       force->special_lj, atom->nlocal,
-			       atom->nlocal+atom->nghost, 300, maxspecial,
-			       cell_size, gpu_mode, screen, tabstyle, ntables,
-			       tablength);
+                               force->special_lj, atom->nlocal,
+                               atom->nlocal+atom->nghost, 300, maxspecial,
+                               cell_size, gpu_mode, screen, tabstyle, ntables,
+                               tablength);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -230,7 +230,7 @@ void PairTableGPU::init_style()
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->full = 1;
   }
-  
+
   memory->destroy(table_coeffs);
   memory->destroy(table_data);
 }
@@ -245,17 +245,17 @@ double PairTableGPU::memory_usage()
 
 /* ---------------------------------------------------------------------- */
 
-void PairTableGPU::cpu_compute(int start, int inum, int eflag, int vflag, 
-			       int *ilist, int *numneigh, int **firstneigh) {
+void PairTableGPU::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 xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
   double rsq,factor_lj,fraction,value,a,b;
   int *jlist;
   Table *tb;
-  
+
   union_int_float_t rsq_lookup;
   int tlm1 = tablength - 1;
-  
+
   double **x = atom->x;
   double **f = atom->f;
   int *type = atom->type;
@@ -284,58 +284,58 @@ void PairTableGPU::cpu_compute(int start, int inum, int eflag, int vflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	tb = &tables[tabindex[itype][jtype]];
-	if (rsq < tb->innersq)
-	  error->one(FLERR,"Pair distance < table inner cutoff");
- 
-	if (tabstyle == LOOKUP) {
-	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
-	  if (itable >= tlm1)
-	    error->one(FLERR,"Pair distance > table outer cutoff");
-	  fpair = factor_lj * tb->f[itable];
-	} else if (tabstyle == LINEAR) {
-	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
-	  if (itable >= tlm1)
-	    error->one(FLERR,"Pair distance > table outer cutoff");
-	  fraction = (rsq - tb->rsq[itable]) * tb->invdelta;
-	  value = tb->f[itable] + fraction*tb->df[itable];
-	  fpair = factor_lj * value;
-	} else if (tabstyle == SPLINE) {
-	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
-	  if (itable >= tlm1)
-	    error->one(FLERR,"Pair distance > table outer cutoff");
-	  b = (rsq - tb->rsq[itable]) * tb->invdelta;
-	  a = 1.0 - b;
-	  value = a * tb->f[itable] + b * tb->f[itable+1] + 
-	    ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) * 
+        tb = &tables[tabindex[itype][jtype]];
+        if (rsq < tb->innersq)
+          error->one(FLERR,"Pair distance < table inner cutoff");
+
+        if (tabstyle == LOOKUP) {
+          itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
+          if (itable >= tlm1)
+            error->one(FLERR,"Pair distance > table outer cutoff");
+          fpair = factor_lj * tb->f[itable];
+        } else if (tabstyle == LINEAR) {
+          itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
+          if (itable >= tlm1)
+            error->one(FLERR,"Pair distance > table outer cutoff");
+          fraction = (rsq - tb->rsq[itable]) * tb->invdelta;
+          value = tb->f[itable] + fraction*tb->df[itable];
+          fpair = factor_lj * value;
+        } else if (tabstyle == SPLINE) {
+          itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
+          if (itable >= tlm1)
+            error->one(FLERR,"Pair distance > table outer cutoff");
+          b = (rsq - tb->rsq[itable]) * tb->invdelta;
+          a = 1.0 - b;
+          value = a * tb->f[itable] + b * tb->f[itable+1] +
+            ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) *
             tb->deltasq6;
-	  fpair = factor_lj * value;
-	} else {
-	  rsq_lookup.f = rsq;
-	  itable = rsq_lookup.i & tb->nmask;
-	  itable >>= tb->nshiftbits;
-	  fraction = (rsq_lookup.f - tb->rsq[itable]) * tb->drsq[itable];
-	  value = tb->f[itable] + fraction*tb->df[itable];
-	  fpair = factor_lj * value;
-	}
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-
-	if (eflag) {
-	  if (tabstyle == LOOKUP)
-	    evdwl = tb->e[itable];
-	  else if (tabstyle == LINEAR || tabstyle == BITMAP)
-	    evdwl = tb->e[itable] + fraction*tb->de[itable];
-	  else
-	    evdwl = a * tb->e[itable] + b * tb->e[itable+1] + 
-	      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * 
-	      tb->deltasq6;
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
+          fpair = factor_lj * value;
+        } else {
+          rsq_lookup.f = rsq;
+          itable = rsq_lookup.i & tb->nmask;
+          itable >>= tb->nshiftbits;
+          fraction = (rsq_lookup.f - tb->rsq[itable]) * tb->drsq[itable];
+          value = tb->f[itable] + fraction*tb->df[itable];
+          fpair = factor_lj * value;
+        }
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+
+        if (eflag) {
+          if (tabstyle == LOOKUP)
+            evdwl = tb->e[itable];
+          else if (tabstyle == LINEAR || tabstyle == BITMAP)
+            evdwl = tb->e[itable] + fraction*tb->de[itable];
+          else
+            evdwl = a * tb->e[itable] + b * tb->e[itable+1] +
+              ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) *
+              tb->deltasq6;
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_table_gpu.h b/src/GPU/pair_table_gpu.h
index fd7c65144d..4e6640abd3 100644
--- a/src/GPU/pair_table_gpu.h
+++ b/src/GPU/pair_table_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pair_yukawa_gpu.cpp b/src/GPU/pair_yukawa_gpu.cpp
index d76dc837df..49554e5469 100644
--- a/src/GPU/pair_yukawa_gpu.cpp
+++ b/src/GPU/pair_yukawa_gpu.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -38,35 +38,35 @@
 // External functions from cuda library for atom decomposition
 
 int yukawa_gpu_init(const int ntypes, double **cutsq, double kappa,
-		    double **host_a, double **offset, double *special_lj, 
-		    const int inum, const int nall, const int max_nbors,  
-		    const int maxspecial, const double cell_size, 
-		    int &gpu_mode, FILE *screen);
+                    double **host_a, double **offset, double *special_lj,
+                    const int inum, const int nall, const int max_nbors,
+                    const int maxspecial, const double cell_size,
+                    int &gpu_mode, FILE *screen);
 void yukawa_gpu_clear();
 int ** yukawa_gpu_compute_n(const int ago, const int inum_full, const int nall,
-			    double **host_x, int *host_type, double *sublo,
-			    double *subhi, int *tag, int **nspecial,
-			    int **special, const bool eflag, const bool vflag,
-			    const bool eatom, const bool vatom,
-			    int &host_start, int **ilist, int **jnum,
-			    const double cpu_time, bool &success);
+                            double **host_x, int *host_type, double *sublo,
+                            double *subhi, int *tag, int **nspecial,
+                            int **special, const bool eflag, const bool vflag,
+                            const bool eatom, const bool vatom,
+                            int &host_start, int **ilist, int **jnum,
+                            const double cpu_time, bool &success);
 void yukawa_gpu_compute(const int ago, const int inum_full, const int nall,
-			double **host_x, int *host_type, int *ilist, int *numj,
-			int **firstneigh, const bool eflag, const bool vflag,
-			const bool eatom, const bool vatom, int &host_start,
-			const double cpu_time, bool &success);
+                        double **host_x, int *host_type, int *ilist, int *numj,
+                        int **firstneigh, const bool eflag, const bool vflag,
+                        const bool eatom, const bool vatom, int &host_start,
+                        const double cpu_time, bool &success);
 double yukawa_gpu_bytes();
 
 using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-PairYukawaGPU::PairYukawaGPU(LAMMPS *lmp) : PairYukawa(lmp), 
-					    gpu_mode(GPU_FORCE)
+PairYukawaGPU::PairYukawaGPU(LAMMPS *lmp) : PairYukawa(lmp),
+                                            gpu_mode(GPU_FORCE)
 {
   respa_enable = 0;
   cpu_time = 0.0;
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
@@ -84,28 +84,28 @@ void PairYukawaGPU::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   int nall = atom->nlocal + atom->nghost;
   int inum, host_start;
-  
+
   bool success = true;
   int *ilist, *numneigh, **firstneigh;
   if (gpu_mode != GPU_FORCE) {
     inum = atom->nlocal;
     firstneigh = yukawa_gpu_compute_n(neighbor->ago, inum, nall,
-				      atom->x, atom->type, domain->sublo,
-				      domain->subhi, atom->tag, atom->nspecial,
-				      atom->special, eflag, vflag, eflag_atom,
-				      vflag_atom, host_start, 
-				      &ilist, &numneigh, cpu_time, success);
+                                      atom->x, atom->type, domain->sublo,
+                                      domain->subhi, atom->tag, atom->nspecial,
+                                      atom->special, eflag, vflag, eflag_atom,
+                                      vflag_atom, host_start,
+                                      &ilist, &numneigh, cpu_time, success);
   } else {
     inum = list->inum;
     ilist = list->ilist;
     numneigh = list->numneigh;
     firstneigh = list->firstneigh;
     yukawa_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
-		       ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
-		       vflag_atom, host_start, cpu_time, success);
+                       ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
+                       vflag_atom, host_start, cpu_time, success);
   }
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
@@ -123,7 +123,7 @@ void PairYukawaGPU::compute(int eflag, int vflag)
 
 void PairYukawaGPU::init_style()
 {
-  if (force->newton_pair) 
+  if (force->newton_pair)
     error->all(FLERR,"Cannot use newton pair with yukawa/gpu pair style");
 
   // Repeat cutsq calculation because done after call to init_style
@@ -147,9 +147,9 @@ void PairYukawaGPU::init_style()
   if (atom->molecular)
     maxspecial=atom->maxspecial;
   int success = yukawa_gpu_init(atom->ntypes+1, cutsq, kappa, a,
-				offset, force->special_lj, atom->nlocal,
-				atom->nlocal+atom->nghost, 300, maxspecial,
-				cell_size, gpu_mode, screen);
+                                offset, force->special_lj, atom->nlocal,
+                                atom->nlocal+atom->nghost, 300, maxspecial,
+                                cell_size, gpu_mode, screen);
   GPU_EXTRA::check_flag(success,error,world);
 
   if (gpu_mode == GPU_FORCE) {
@@ -169,8 +169,8 @@ double PairYukawaGPU::memory_usage()
 
 /* ---------------------------------------------------------------------- */
 
-void PairYukawaGPU::cpu_compute(int start, int inum, int eflag, int vflag, 
-			       int *ilist, int *numneigh, int **firstneigh) {
+void PairYukawaGPU::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 rsq,r2inv,r,rinv,screening,forceyukawa,factor;
@@ -204,24 +204,24 @@ void PairYukawaGPU::cpu_compute(int start, int inum, int eflag, int vflag,
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	screening = exp(-kappa*r);
-	forceyukawa = a[itype][jtype] * screening * (kappa + rinv);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        screening = exp(-kappa*r);
+        forceyukawa = a[itype][jtype] * screening * (kappa + rinv);
 
-	fpair = factor*forceyukawa * r2inv;
+        fpair = factor*forceyukawa * r2inv;
 
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
 
-	if (eflag) {
-	  evdwl = a[itype][jtype] * screening * rinv - offset[itype][jtype];
-	  evdwl *= factor;
-	}
+        if (eflag) {
+          evdwl = a[itype][jtype] * screening * rinv - offset[itype][jtype];
+          evdwl *= factor;
+        }
 
-	if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
+        if (evflag) ev_tally_full(i,evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
diff --git a/src/GPU/pair_yukawa_gpu.h b/src/GPU/pair_yukawa_gpu.h
index f5a54e6e75..85bc3d0b70 100644
--- a/src/GPU/pair_yukawa_gpu.h
+++ b/src/GPU/pair_yukawa_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp
index 50e55329dc..5cdbb75e84 100644
--- a/src/GPU/pppm_gpu.cpp
+++ b/src/GPU/pppm_gpu.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,15 +65,15 @@ using namespace MathConst;
 #endif
 
 FFT_SCALAR* PPPM_GPU_API(init)(const int nlocal, const int nall, FILE *screen,
-			       const int order, const int nxlo_out, 
-			       const int nylo_out, const int nzlo_out,
-			       const int nxhi_out, const int nyhi_out,
-			       const int nzhi_out, FFT_SCALAR **rho_coeff,
-			       FFT_SCALAR **_vd_brick, 
-			       const double slab_volfactor,
-			       const int nx_pppm, const int ny_pppm,
-			       const int nz_pppm, const bool split, 
-			       int &success);
+                               const int order, const int nxlo_out,
+                               const int nylo_out, const int nzlo_out,
+                               const int nxhi_out, const int nyhi_out,
+                               const int nzhi_out, FFT_SCALAR **rho_coeff,
+                               FFT_SCALAR **_vd_brick,
+                               const double slab_volfactor,
+                               const int nx_pppm, const int ny_pppm,
+                               const int nz_pppm, const bool split,
+                               int &success);
 void PPPM_GPU_API(clear)(const double poisson_time);
 int PPPM_GPU_API(spread)(const int ago, const int nlocal, const int nall,
                       double **host_x, int *host_type, bool &success,
@@ -93,11 +93,11 @@ PPPMGPU::PPPMGPU(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
   kspace_split = false;
   im_real_space = false;
 
-  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); 
+  GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
 }
 
 /* ----------------------------------------------------------------------
-   free all memory 
+   free all memory
 ------------------------------------------------------------------------- */
 
 PPPMGPU::~PPPMGPU()
@@ -106,13 +106,13 @@ PPPMGPU::~PPPMGPU()
 }
 
 /* ----------------------------------------------------------------------
-   called once before run 
+   called once before run
 ------------------------------------------------------------------------- */
 
 void PPPMGPU::init()
 {
   PPPM::init();
-  
+
   if (strcmp(update->integrate_style,"verlet/split") == 0)
     kspace_split=true;
 
@@ -130,25 +130,25 @@ void PPPMGPU::init()
   int success;
   FFT_SCALAR *data, *h_brick;
   h_brick = PPPM_GPU_API(init)(atom->nlocal, atom->nlocal+atom->nghost, screen,
-			       order, nxlo_out, nylo_out, nzlo_out, nxhi_out,
-			       nyhi_out, nzhi_out, rho_coeff, &data, 
-			       slab_volfactor,nx_pppm,ny_pppm,nz_pppm,
-			       kspace_split,success);
+                               order, nxlo_out, nylo_out, nzlo_out, nxhi_out,
+                               nyhi_out, nzhi_out, rho_coeff, &data,
+                               slab_volfactor,nx_pppm,ny_pppm,nz_pppm,
+                               kspace_split,success);
 
   GPU_EXTRA::check_flag(success,error,world);
 
   density_brick_gpu =
     create_3d_offset(nzlo_out,nzhi_out,nylo_out,nyhi_out,
-		     nxlo_out,nxhi_out,"pppm:density_brick_gpu",h_brick,1);
+                     nxlo_out,nxhi_out,"pppm:density_brick_gpu",h_brick,1);
   vd_brick =
     create_3d_offset(nzlo_out,nzhi_out,nylo_out,nyhi_out,
-		     nxlo_out,nxhi_out,"pppm:vd_brick",data,4);
+                     nxlo_out,nxhi_out,"pppm:vd_brick",data,4);
 
   poisson_time=0;
 }
 
 /* ----------------------------------------------------------------------
-   compute the PPPMGPU long-range force, energy, virial 
+   compute the PPPMGPU long-range force, energy, virial
 ------------------------------------------------------------------------- */
 
 void PPPMGPU::compute(int eflag, int vflag)
@@ -167,10 +167,10 @@ void PPPMGPU::compute(int eflag, int vflag)
   }
 
   bool success = true;
-  int flag=PPPM_GPU_API(spread)(neighbor->ago, atom->nlocal, atom->nlocal + 
-			     atom->nghost, atom->x, atom->type, success,
-			     atom->q, domain->boxlo, delxinv, delyinv,
-			     delzinv);
+  int flag=PPPM_GPU_API(spread)(neighbor->ago, atom->nlocal, atom->nlocal +
+                             atom->nghost, atom->x, atom->type, success,
+                             atom->q, domain->boxlo, delxinv, delyinv,
+                             delzinv);
   if (!success)
     error->one(FLERR,"Insufficient memory on accelerator");
   if (flag != 0)
@@ -189,7 +189,7 @@ void PPPMGPU::compute(int eflag, int vflag)
   int i,j;
 
   // convert atoms from box to lamda coords
-  
+
   if (triclinic == 0) boxlo = domain->boxlo;
   else {
     boxlo = domain->boxlo_lamda;
@@ -207,7 +207,7 @@ void PPPMGPU::compute(int eflag, int vflag)
   // compute potential gradient on my FFT grid and
   //   portion of e_long on this proc's FFT grid
   // return gradients (electric fields) in 3d brick decomposition
-  
+
   poisson();
 
   // all procs communicate E-field values to fill ghost cells
@@ -232,9 +232,9 @@ void PPPMGPU::compute(int eflag, int vflag)
 
     if (eflag_atom) {
       for (i = 0; i < nlocal; i++) {
-	eatom[i] *= 0.5;
-        eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum / 
-	  (g_ewald*g_ewald*volume);
+        eatom[i] *= 0.5;
+        eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum /
+          (g_ewald*g_ewald*volume);
         eatom[i] *= qscale;
       }
     }
@@ -251,7 +251,7 @@ void PPPMGPU::compute(int eflag, int vflag)
     double energy_all;
     MPI_Allreduce(&energy,&energy_all,1,MPI_DOUBLE,MPI_SUM,world);
     energy = energy_all;
-   
+
     energy *= 0.5*volume;
     energy -= g_ewald*qsqsum/1.772453851 +
       MY_PI2*qsum*qsum / (g_ewald*g_ewald*volume);
@@ -271,14 +271,14 @@ void PPPMGPU::compute(int eflag, int vflag)
   if (slabflag) slabcorr();
 
   // convert atoms back from lamda to box coords
-  
+
   if (triclinic) domain->lamda2x(atom->nlocal);
 
   if (kspace_split) PPPM_GPU_API(forces)(atom->f);
 }
 
 /* ----------------------------------------------------------------------
-   allocate memory that depends on # of K-vectors and order 
+   allocate memory that depends on # of K-vectors and order
 ------------------------------------------------------------------------- */
 
 void PPPMGPU::allocate()
@@ -310,23 +310,23 @@ void PPPMGPU::allocate()
   int tmp;
 
   fft1 = new FFT3d(lmp,world,nx_pppm,ny_pppm,nz_pppm,
-		   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		   0,0,&tmp);
+                   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                   0,0,&tmp);
 
   fft2 = new FFT3d(lmp,world,nx_pppm,ny_pppm,nz_pppm,
-		   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		   nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
-		   0,0,&tmp);
+                   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                   nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
+                   0,0,&tmp);
 
   remap = new Remap(lmp,world,
-		    nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
-		    nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		    1,0,0,FFT_PRECISION);
+                    nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
+                    nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                    1,0,0,FFT_PRECISION);
 }
 
 /* ----------------------------------------------------------------------
-   deallocate memory that depends on # of K-vectors and order 
+   deallocate memory that depends on # of K-vectors and order
 ------------------------------------------------------------------------- */
 
 void PPPMGPU::deallocate()
@@ -358,7 +358,7 @@ void PPPMGPU::deallocate()
 
 
 /* ----------------------------------------------------------------------
-   ghost-swap to accumulate full density in brick decomposition 
+   ghost-swap to accumulate full density in brick decomposition
    remap density from 3d brick decomposition to FFT decomposition
 ------------------------------------------------------------------------- */
 
@@ -376,7 +376,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxhi_in+1; ix <= nxhi_out; ix++)
-	buf1[n++] = density_brick_gpu[iz][iy][ix];
+        buf1[n++] = density_brick_gpu[iz][iy][ix];
 
   if (comm->procneigh[0][1] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -390,7 +390,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxlo_in; ix < nxlo_in+nxlo_ghost; ix++)
-	density_brick_gpu[iz][iy][ix] += buf2[n++];
+        density_brick_gpu[iz][iy][ix] += buf2[n++];
 
   // pack my ghosts for -x processor
   // pass data to self or -x processor
@@ -400,7 +400,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxlo_out; ix < nxlo_in; ix++)
-	buf1[n++] = density_brick_gpu[iz][iy][ix];
+        buf1[n++] = density_brick_gpu[iz][iy][ix];
 
   if (comm->procneigh[0][0] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -414,7 +414,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxhi_in-nxhi_ghost+1; ix <= nxhi_in; ix++)
-	density_brick_gpu[iz][iy][ix] += buf2[n++];
+        density_brick_gpu[iz][iy][ix] += buf2[n++];
 
   // pack my ghosts for +y processor
   // pass data to self or +y processor
@@ -424,7 +424,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nyhi_in+1; iy <= nyhi_out; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	buf1[n++] = density_brick_gpu[iz][iy][ix];
+        buf1[n++] = density_brick_gpu[iz][iy][ix];
 
   if (comm->procneigh[1][1] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -438,7 +438,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_in; iy < nylo_in+nylo_ghost; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	density_brick_gpu[iz][iy][ix] += buf2[n++];
+        density_brick_gpu[iz][iy][ix] += buf2[n++];
 
   // pack my ghosts for -y processor
   // pass data to self or -y processor
@@ -448,7 +448,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy < nylo_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	buf1[n++] = density_brick_gpu[iz][iy][ix];
+        buf1[n++] = density_brick_gpu[iz][iy][ix];
 
   if (comm->procneigh[1][0] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -462,7 +462,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nyhi_in-nyhi_ghost+1; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	density_brick_gpu[iz][iy][ix] += buf2[n++];
+        density_brick_gpu[iz][iy][ix] += buf2[n++];
 
   // pack my ghosts for +z processor
   // pass data to self or +z processor
@@ -472,7 +472,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzhi_in+1; iz <= nzhi_out; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	buf1[n++] = density_brick_gpu[iz][iy][ix];
+        buf1[n++] = density_brick_gpu[iz][iy][ix];
 
   if (comm->procneigh[2][1] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -486,7 +486,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzlo_in; iz < nzlo_in+nzlo_ghost; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	density_brick_gpu[iz][iy][ix] += buf2[n++];
+        density_brick_gpu[iz][iy][ix] += buf2[n++];
 
   // pack my ghosts for -z processor
   // pass data to self or -z processor
@@ -496,7 +496,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzlo_out; iz < nzlo_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	buf1[n++] = density_brick_gpu[iz][iy][ix];
+        buf1[n++] = density_brick_gpu[iz][iy][ix];
 
   if (comm->procneigh[2][0] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -510,7 +510,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzhi_in-nzhi_ghost+1; iz <= nzhi_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	density_brick_gpu[iz][iy][ix] += buf2[n++];
+        density_brick_gpu[iz][iy][ix] += buf2[n++];
 
   // remap from 3d brick decomposition to FFT decomposition
   // copy grabs inner portion of density from 3d brick
@@ -521,7 +521,7 @@ void PPPMGPU::brick2fft()
   for (iz = nzlo_in; iz <= nzhi_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	density_fft[n++] = density_brick_gpu[iz][iy][ix];
+        density_fft[n++] = density_brick_gpu[iz][iy][ix];
 
   remap->perform(density_fft,density_fft,work1);
 }
@@ -546,9 +546,9 @@ void PPPMGPU::fillbrick()
   for (iz = nzhi_in-nzhi_ghost+1; iz <= nzhi_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	buf1[n++] = vd_brick[iz][iy][ix];
-	buf1[n++] = vd_brick[iz][iy][ix+1];
-	buf1[n++] = vd_brick[iz][iy][ix+2];
+        buf1[n++] = vd_brick[iz][iy][ix];
+        buf1[n++] = vd_brick[iz][iy][ix+1];
+        buf1[n++] = vd_brick[iz][iy][ix+2];
       }
 
   if (comm->procneigh[2][1] == me)
@@ -563,9 +563,9 @@ void PPPMGPU::fillbrick()
   for (iz = nzlo_out; iz < nzlo_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	vd_brick[iz][iy][ix] = buf2[n++];
-	vd_brick[iz][iy][ix+1] = buf2[n++];
-	vd_brick[iz][iy][ix+2] = buf2[n++];
+        vd_brick[iz][iy][ix] = buf2[n++];
+        vd_brick[iz][iy][ix+1] = buf2[n++];
+        vd_brick[iz][iy][ix+2] = buf2[n++];
       }
 
   // pack my real cells for -z processor
@@ -576,9 +576,9 @@ void PPPMGPU::fillbrick()
   for (iz = nzlo_in; iz < nzlo_in+nzlo_ghost; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	buf1[n++] = vd_brick[iz][iy][ix];
-	buf1[n++] = vd_brick[iz][iy][ix+1];
-	buf1[n++] = vd_brick[iz][iy][ix+2];
+        buf1[n++] = vd_brick[iz][iy][ix];
+        buf1[n++] = vd_brick[iz][iy][ix+1];
+        buf1[n++] = vd_brick[iz][iy][ix+2];
       }
 
   if (comm->procneigh[2][0] == me)
@@ -593,9 +593,9 @@ void PPPMGPU::fillbrick()
   for (iz = nzhi_in+1; iz <= nzhi_out; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	vd_brick[iz][iy][ix] = buf2[n++];
-	vd_brick[iz][iy][ix+1] = buf2[n++];
-	vd_brick[iz][iy][ix+2] = buf2[n++];
+        vd_brick[iz][iy][ix] = buf2[n++];
+        vd_brick[iz][iy][ix+1] = buf2[n++];
+        vd_brick[iz][iy][ix+2] = buf2[n++];
       }
 
   // pack my real cells for +y processor
@@ -606,9 +606,9 @@ void PPPMGPU::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nyhi_in-nyhi_ghost+1; iy <= nyhi_in; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	buf1[n++] = vd_brick[iz][iy][ix];
-	buf1[n++] = vd_brick[iz][iy][ix+1];
-	buf1[n++] = vd_brick[iz][iy][ix+2];
+        buf1[n++] = vd_brick[iz][iy][ix];
+        buf1[n++] = vd_brick[iz][iy][ix+1];
+        buf1[n++] = vd_brick[iz][iy][ix+2];
       }
 
   if (comm->procneigh[1][1] == me)
@@ -623,9 +623,9 @@ void PPPMGPU::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy < nylo_in; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	vd_brick[iz][iy][ix] = buf2[n++];
-	vd_brick[iz][iy][ix+1] = buf2[n++];
-	vd_brick[iz][iy][ix+2] = buf2[n++];
+        vd_brick[iz][iy][ix] = buf2[n++];
+        vd_brick[iz][iy][ix+1] = buf2[n++];
+        vd_brick[iz][iy][ix+2] = buf2[n++];
       }
 
   // pack my real cells for -y processor
@@ -636,9 +636,9 @@ void PPPMGPU::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_in; iy < nylo_in+nylo_ghost; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	buf1[n++] = vd_brick[iz][iy][ix];
-	buf1[n++] = vd_brick[iz][iy][ix+1];
-	buf1[n++] = vd_brick[iz][iy][ix+2];
+        buf1[n++] = vd_brick[iz][iy][ix];
+        buf1[n++] = vd_brick[iz][iy][ix+1];
+        buf1[n++] = vd_brick[iz][iy][ix+2];
       }
 
   if (comm->procneigh[1][0] == me)
@@ -653,9 +653,9 @@ void PPPMGPU::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nyhi_in+1; iy <= nyhi_out; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	vd_brick[iz][iy][ix] = buf2[n++];
-	vd_brick[iz][iy][ix+1] = buf2[n++];
-	vd_brick[iz][iy][ix+2] = buf2[n++];
+        vd_brick[iz][iy][ix] = buf2[n++];
+        vd_brick[iz][iy][ix+1] = buf2[n++];
+        vd_brick[iz][iy][ix+2] = buf2[n++];
       }
 
   // pack my real cells for +x processor
@@ -667,9 +667,9 @@ void PPPMGPU::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	buf1[n++] = vd_brick[iz][iy][ix];
-	buf1[n++] = vd_brick[iz][iy][ix+1];
-	buf1[n++] = vd_brick[iz][iy][ix+2];
+        buf1[n++] = vd_brick[iz][iy][ix];
+        buf1[n++] = vd_brick[iz][iy][ix+1];
+        buf1[n++] = vd_brick[iz][iy][ix+2];
       }
 
   if (comm->procneigh[0][1] == me)
@@ -686,9 +686,9 @@ void PPPMGPU::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	vd_brick[iz][iy][ix] = buf2[n++];
-	vd_brick[iz][iy][ix+1] = buf2[n++];
-	vd_brick[iz][iy][ix+2] = buf2[n++];
+        vd_brick[iz][iy][ix] = buf2[n++];
+        vd_brick[iz][iy][ix+1] = buf2[n++];
+        vd_brick[iz][iy][ix+2] = buf2[n++];
       }
 
   // pack my real cells for -x processor
@@ -701,9 +701,9 @@ void PPPMGPU::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	buf1[n++] = vd_brick[iz][iy][ix];
-	buf1[n++] = vd_brick[iz][iy][ix+1];
-	buf1[n++] = vd_brick[iz][iy][ix+2];
+        buf1[n++] = vd_brick[iz][iy][ix];
+        buf1[n++] = vd_brick[iz][iy][ix+1];
+        buf1[n++] = vd_brick[iz][iy][ix+2];
       }
 
   if (comm->procneigh[0][0] == me)
@@ -720,14 +720,14 @@ void PPPMGPU::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = x_lo; ix < x_hi; ix+=4) {
-	vd_brick[iz][iy][ix] = buf2[n++];
-	vd_brick[iz][iy][ix+1] = buf2[n++];
-	vd_brick[iz][iy][ix+2] = buf2[n++];
+        vd_brick[iz][iy][ix] = buf2[n++];
+        vd_brick[iz][iy][ix+1] = buf2[n++];
+        vd_brick[iz][iy][ix+2] = buf2[n++];
       }
 }
 
 /* ----------------------------------------------------------------------
-   FFT-based Poisson solver 
+   FFT-based Poisson solver
 ------------------------------------------------------------------------- */
 
 void PPPMGPU::poisson()
@@ -735,14 +735,14 @@ void PPPMGPU::poisson()
   int i,j,k,n;
   double eng;
 
-  // transform charge density (r -> k) 
+  // transform charge density (r -> k)
 
   n = 0;
   for (i = 0; i < nfft; i++) {
     work1[n++] = density_fft[i];
     work1[n++] = ZEROF;
   }
- 
+
   fft1->compute(work1,work1,1);
 
   // if requested, compute energy and virial contribution
@@ -754,17 +754,17 @@ void PPPMGPU::poisson()
     if (vflag_global) {
       n = 0;
       for (i = 0; i < nfft; i++) {
-	eng = s2 * greensfn[i] * (work1[n]*work1[n] + work1[n+1]*work1[n+1]);
-	for (j = 0; j < 6; j++) virial[j] += eng*vg[i][j];
-	if (eflag_global) energy += eng;
-	n += 2;
+        eng = s2 * greensfn[i] * (work1[n]*work1[n] + work1[n+1]*work1[n+1]);
+        for (j = 0; j < 6; j++) virial[j] += eng*vg[i][j];
+        if (eflag_global) energy += eng;
+        n += 2;
       }
     } else {
       n = 0;
       for (i = 0; i < nfft; i++) {
-	energy += 
-	  s2 * greensfn[i] * (work1[n]*work1[n] + work1[n+1]*work1[n+1]);
-	n += 2;
+        energy +=
+          s2 * greensfn[i] * (work1[n]*work1[n] + work1[n+1]*work1[n+1]);
+        n += 2;
       }
     }
   }
@@ -792,9 +792,9 @@ void PPPMGPU::poisson()
   for (k = nzlo_fft; k <= nzhi_fft; k++)
     for (j = nylo_fft; j <= nyhi_fft; j++)
       for (i = nxlo_fft; i <= nxhi_fft; i++) {
-	work2[n] = fkx[i]*work1[n+1];
-	work2[n+1] = -fkx[i]*work1[n];
-	n += 2;
+        work2[n] = fkx[i]*work1[n+1];
+        work2[n+1] = -fkx[i]*work1[n];
+        n += 2;
       }
 
   fft2->compute(work2,work2,-1);
@@ -804,8 +804,8 @@ void PPPMGPU::poisson()
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in * 4; i < x_hi; i+=4) {
-	vd_brick[k][j][i] = work2[n];
-	n += 2;
+        vd_brick[k][j][i] = work2[n];
+        n += 2;
       }
 
   // y direction gradient
@@ -814,9 +814,9 @@ void PPPMGPU::poisson()
   for (k = nzlo_fft; k <= nzhi_fft; k++)
     for (j = nylo_fft; j <= nyhi_fft; j++)
       for (i = nxlo_fft; i <= nxhi_fft; i++) {
-	work2[n] = fky[j]*work1[n+1];
-	work2[n+1] = -fky[j]*work1[n];
-	n += 2;
+        work2[n] = fky[j]*work1[n+1];
+        work2[n+1] = -fky[j]*work1[n];
+        n += 2;
       }
 
   fft2->compute(work2,work2,-1);
@@ -825,8 +825,8 @@ void PPPMGPU::poisson()
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in * 4 + 1; i < x_hi; i+=4) {
-	vd_brick[k][j][i] = work2[n];
-	n += 2;
+        vd_brick[k][j][i] = work2[n];
+        n += 2;
       }
 
   // z direction gradient
@@ -835,9 +835,9 @@ void PPPMGPU::poisson()
   for (k = nzlo_fft; k <= nzhi_fft; k++)
     for (j = nylo_fft; j <= nyhi_fft; j++)
       for (i = nxlo_fft; i <= nxhi_fft; i++) {
-	work2[n] = fkz[k]*work1[n+1];
-	work2[n+1] = -fkz[k]*work1[n];
-	n += 2;
+        work2[n] = fkz[k]*work1[n+1];
+        work2[n+1] = -fkz[k]*work1[n];
+        n += 2;
       }
 
   fft2->compute(work2,work2,-1);
@@ -846,8 +846,8 @@ void PPPMGPU::poisson()
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in * 4 + 2; i < x_hi; i+=4) {
-	vd_brick[k][j][i] = work2[n];
-	n += 2;
+        vd_brick[k][j][i] = work2[n];
+        n += 2;
       }
 }
 
@@ -856,8 +856,8 @@ void PPPMGPU::poisson()
 ------------------------------------------------------------------------- */
 
 FFT_SCALAR ***PPPMGPU::create_3d_offset(int n1lo, int n1hi, int n2lo, int n2hi,
-				     int n3lo, int n3hi, const char *name,
-				     FFT_SCALAR *data, int vec_length)
+                                     int n3lo, int n3hi, const char *name,
+                                     FFT_SCALAR *data, int vec_length)
 {
   int i,j;
   int n1 = n1hi - n1lo + 1;
@@ -888,7 +888,7 @@ FFT_SCALAR ***PPPMGPU::create_3d_offset(int n1lo, int n1hi, int n2lo, int n2hi,
 ------------------------------------------------------------------------- */
 
 void PPPMGPU::destroy_3d_offset(FFT_SCALAR ***array, int n1_offset,
-				 int n2_offset)
+                                 int n2_offset)
 {
   if (array == NULL) return;
   memory->sfree(&array[n1_offset][n2_offset]);
@@ -897,13 +897,13 @@ void PPPMGPU::destroy_3d_offset(FFT_SCALAR ***array, int n1_offset,
 
 
 /* ----------------------------------------------------------------------
-   memory usage of local arrays 
+   memory usage of local arrays
 ------------------------------------------------------------------------- */
 
 double PPPMGPU::memory_usage()
 {
   double bytes = nmax*3 * sizeof(double);
-  int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) * 
+  int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) *
     (nzhi_out-nzlo_out+1);
   bytes += 4 * nbrick * sizeof(FFT_SCALAR);
   bytes += 6 * nfft_both * sizeof(double);
@@ -933,11 +933,11 @@ void PPPMGPU::timing(int n, double &time3d, double &time1d) {
 }
 
 /* ----------------------------------------------------------------------
-   adjust PPPM coeffs, called initially and whenever volume has changed 
+   adjust PPPM coeffs, called initially and whenever volume has changed
 ------------------------------------------------------------------------- */
 
 void PPPMGPU::setup()
 {
   if (im_real_space) return;
   PPPM::setup();
-} 
+}
diff --git a/src/GPU/pppm_gpu.h b/src/GPU/pppm_gpu.h
index 8fb8a5f5d2..0acc5a0060 100644
--- a/src/GPU/pppm_gpu.h
+++ b/src/GPU/pppm_gpu.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,10 +45,10 @@ class PPPMGPU : public PPPM {
   virtual void fillbrick();
   virtual void poisson();
 
-  double poisson_time;  
+  double poisson_time;
 
   FFT_SCALAR ***create_3d_offset(int, int, int, int, int, int, const char *,
-				 FFT_SCALAR *, int);
+                                 FFT_SCALAR *, int);
   void destroy_3d_offset(FFT_SCALAR ***, int, int);
 };
 
diff --git a/src/GRANULAR/fix_freeze.cpp b/src/GRANULAR/fix_freeze.cpp
index 40672035e9..655edd844b 100644
--- a/src/GRANULAR/fix_freeze.cpp
+++ b/src/GRANULAR/fix_freeze.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GRANULAR/fix_freeze.h b/src/GRANULAR/fix_freeze.h
index 6783253211..f6667632dd 100644
--- a/src/GRANULAR/fix_freeze.h
+++ b/src/GRANULAR/fix_freeze.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp
index c775b16034..f42b0518d1 100644
--- a/src/GRANULAR/fix_pour.cpp
+++ b/src/GRANULAR/fix_pour.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -97,20 +97,20 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
       iarg += 2;
     } else if (strcmp(arg[iarg],"vel") == 0) {
       if (domain->dimension == 3) {
-	if (iarg+6 > narg) error->all(FLERR,"Illegal fix pour command");
-	vxlo = atof(arg[iarg+1]);
-	vxhi = atof(arg[iarg+2]);
-	vylo = atof(arg[iarg+3]);
-	vyhi = atof(arg[iarg+4]);
-	vz = atof(arg[iarg+5]);
-	iarg += 6;
+        if (iarg+6 > narg) error->all(FLERR,"Illegal fix pour command");
+        vxlo = atof(arg[iarg+1]);
+        vxhi = atof(arg[iarg+2]);
+        vylo = atof(arg[iarg+3]);
+        vyhi = atof(arg[iarg+4]);
+        vz = atof(arg[iarg+5]);
+        iarg += 6;
       } else {
-	if (iarg+4 > narg) error->all(FLERR,"Illegal fix pour command");
-	vxlo = atof(arg[iarg+1]);
-	vxhi = atof(arg[iarg+2]);
-	vy = atof(arg[iarg+3]);
-	vz = 0.0;
-	iarg += 4;
+        if (iarg+4 > narg) error->all(FLERR,"Illegal fix pour command");
+        vxlo = atof(arg[iarg+1]);
+        vxhi = atof(arg[iarg+2]);
+        vy = atof(arg[iarg+3]);
+        vz = 0.0;
+        iarg += 4;
       }
     } else error->all(FLERR,"Illegal fix pour command");
   }
@@ -131,9 +131,9 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
     yhi = ((RegBlock *) domain->regions[iregion])->yhi;
     zlo = ((RegBlock *) domain->regions[iregion])->zlo;
     zhi = ((RegBlock *) domain->regions[iregion])->zhi;
-    if (xlo < domain->boxlo[0] || xhi > domain->boxhi[0] || 
-	ylo < domain->boxlo[1] || yhi > domain->boxhi[1] || 
-	zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
+    if (xlo < domain->boxlo[0] || xhi > domain->boxhi[0] ||
+        ylo < domain->boxlo[1] || yhi > domain->boxhi[1] ||
+        zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
       error->all(FLERR,"Insertion region extends outside simulation box");
   } else if (strcmp(domain->regions[iregion]->style,"cylinder") == 0) {
     region_style = 2;
@@ -145,9 +145,9 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
     zhi = ((RegCylinder *) domain->regions[iregion])->hi;
     if (axis != 'z')
       error->all(FLERR,"Must use a z-axis cylinder with fix pour");
-    if (xc-rc < domain->boxlo[0] || xc+rc > domain->boxhi[0] || 
-	yc-rc < domain->boxlo[1] || yc+rc > domain->boxhi[1] || 
-	zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
+    if (xc-rc < domain->boxlo[0] || xc+rc > domain->boxhi[0] ||
+        yc-rc < domain->boxlo[1] || yc+rc > domain->boxhi[1] ||
+        zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
       error->all(FLERR,"Insertion region extends outside simulation box");
   } else error->all(FLERR,"Must use a block or cylinder region with fix pour");
 
@@ -173,7 +173,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
     if (strcmp(modify->fix[ifix]->style,"gravity") == 0) break;
     if (strcmp(modify->fix[ifix]->style,"gravity/omp") == 0) break;
   }
-  if (ifix == modify->nfix) 
+  if (ifix == modify->nfix)
     error->all(FLERR,"No fix gravity defined for fix pour");
   grav = - ((FixGravity *) modify->fix[ifix])->magnitude * force->ftm2v;
 
@@ -194,7 +194,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
     v_relative = vy - rate;
     delta = yhi - ylo;
   }
-  double t = 
+  double t =
     (-v_relative - sqrt(v_relative*v_relative - 2.0*grav*delta)) / grav;
   nfreq = static_cast<int> (t/update->dt + 0.5);
 
@@ -232,12 +232,12 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) :
   if (me == 0) {
     if (screen)
       fprintf(screen,
-	      "Particle insertion: %d every %d steps, %d by step %d\n",
-	      nper,nfreq,ninsert,nfinal);
+              "Particle insertion: %d every %d steps, %d by step %d\n",
+              nper,nfreq,ninsert,nfinal);
     if (logfile)
       fprintf(logfile,
-	      "Particle insertion: %d every %d steps, %d by step %d\n",
-	      nper,nfreq,ninsert,nfinal);
+              "Particle insertion: %d every %d steps, %d by step %d\n",
+              nper,nfreq,ninsert,nfinal);
   }
 }
 
@@ -274,7 +274,7 @@ void FixPour::init()
     if (strcmp(modify->fix[ifix]->style,"gravity") == 0) break;
     if (strcmp(modify->fix[ifix]->style,"gravity/omp") == 0) break;
   }
-  if (ifix == modify->nfix) 
+  if (ifix == modify->nfix)
     error->all(FLERR,"No fix gravity defined for fix pour");
 
   double xgrav = ((FixGravity *) modify->fix[ifix])->xgrav;
@@ -283,11 +283,11 @@ void FixPour::init()
 
   if (domain->dimension == 3) {
     if (fabs(xgrav) > EPSILON || fabs(ygrav) > EPSILON ||
-	fabs(zgrav+1.0) > EPSILON)
+        fabs(zgrav+1.0) > EPSILON)
       error->all(FLERR,"Gravity must point in -z to use with fix pour in 3d");
   } else {
     if (fabs(xgrav) > EPSILON || fabs(ygrav+1.0) > EPSILON ||
-	fabs(zgrav) > EPSILON)
+        fabs(zgrav) > EPSILON)
       error->all(FLERR,"Gravity must point in -y to use with fix pour in 2d");
   }
 
@@ -325,7 +325,7 @@ void FixPour::pre_exchange()
 
   // ncount = # of my atoms that overlap the insertion region
   // nprevious = total of ncount across all procs
-  
+
   int ncount = 0;
   for (i = 0; i < atom->nlocal; i++)
     if (overlap(i)) ncount++;
@@ -351,7 +351,7 @@ void FixPour::pre_exchange()
     displs[iproc] = displs[iproc-1] + recvcounts[iproc-1];
 
   // load up xmine array
-  
+
   double **x = atom->x;
   double *radius = atom->radius;
 
@@ -370,7 +370,7 @@ void FixPour::pre_exchange()
   double *ptr = NULL;
   if (ncount) ptr = xmine[0];
   MPI_Allgatherv(ptr,4*ncount,MPI_DOUBLE,
-		 xnear[0],recvcounts,displs,MPI_DOUBLE,world);
+                 xnear[0],recvcounts,displs,MPI_DOUBLE,world);
 
   // insert new atoms into xnear list, one by one
   // check against all nearby atoms and previously inserted ones
@@ -395,16 +395,16 @@ void FixPour::pre_exchange()
       attempt++;
       xyz_random(h,coord);
       for (i = 0; i < nnear; i++) {
-	delx = coord[0] - xnear[i][0];
-	dely = coord[1] - xnear[i][1];
-	delz = coord[2] - xnear[i][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-	radsum = radtmp + xnear[i][3];
-	if (rsq <= radsum*radsum) break;
+        delx = coord[0] - xnear[i][0];
+        dely = coord[1] - xnear[i][1];
+        delz = coord[2] - xnear[i][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+        radsum = radtmp + xnear[i][3];
+        if (rsq <= radsum*radsum) break;
       }
       if (i == nnear) {
-	success = 1;
-	break;
+        success = 1;
+        break;
       }
     }
     if (success) {
@@ -462,15 +462,15 @@ void FixPour::pre_exchange()
 
     flag = 0;
     if (coord[0] >= sublo[0] && coord[0] < subhi[0] &&
-	coord[1] >= sublo[1] && coord[1] < subhi[1] &&
-	coord[2] >= sublo[2] && coord[2] < subhi[2]) flag = 1;
+        coord[1] >= sublo[1] && coord[1] < subhi[1] &&
+        coord[2] >= sublo[2] && coord[2] < subhi[2]) flag = 1;
     else if (domain->dimension == 3 && coord[2] >= domain->boxhi[2] &&
-	     comm->myloc[2] == comm->procgrid[2]-1 &&
-	     coord[0] >= sublo[0] && coord[0] < subhi[0] &&
-	     coord[1] >= sublo[1] && coord[1] < subhi[1]) flag = 1;
+             comm->myloc[2] == comm->procgrid[2]-1 &&
+             coord[0] >= sublo[0] && coord[0] < subhi[0] &&
+             coord[1] >= sublo[1] && coord[1] < subhi[1]) flag = 1;
     else if (domain->dimension == 2 && coord[1] >= domain->boxhi[1] &&
-	     comm->myloc[1] == comm->procgrid[1]-1 &&
-	     coord[0] >= sublo[0] && coord[0] < subhi[0]) flag = 1;
+             comm->myloc[1] == comm->procgrid[1]-1 &&
+             coord[0] >= sublo[0] && coord[0] < subhi[0]) flag = 1;
 
     if (flag) {
       avec->create_atom(ntype,coord);
@@ -483,7 +483,7 @@ void FixPour::pre_exchange()
       atom->v[m][1] = vytmp;
       atom->v[m][2] = vztmp;
       for (j = 0; j < nfix; j++)
-	if (fix[j]->create_attribute) fix[j]->set_arrays(m);
+        if (fix[j]->create_attribute) fix[j]->set_arrays(m);
     }
   }
 
@@ -497,9 +497,9 @@ void FixPour::pre_exchange()
     if (atom->tag_enable) {
       atom->tag_extend();
       if (atom->map_style) {
-	atom->nghost = 0;
-	atom->map_init();
-	atom->map_set();
+        atom->nghost = 0;
+        atom->map_init();
+        atom->map_set();
       }
     }
   }
@@ -529,8 +529,8 @@ int FixPour::overlap(int i)
   if (domain->dimension == 3) {
     if (region_style == 1) {
       if (x[i][0] < xlo-delta || x[i][0] > xhi+delta ||
-	  x[i][1] < ylo-delta || x[i][1] > yhi+delta ||
-	  x[i][2] < lo_current-delta || x[i][2] > hi_current+delta) return 0;
+          x[i][1] < ylo-delta || x[i][1] > yhi+delta ||
+          x[i][2] < lo_current-delta || x[i][2] > hi_current+delta) return 0;
     } else {
       if (x[i][2] < lo_current-delta || x[i][2] > hi_current+delta) return 0;
       double delx = x[i][0] - xc;
@@ -541,7 +541,7 @@ int FixPour::overlap(int i)
     }
   } else {
       if (x[i][0] < xlo-delta || x[i][0] > xhi+delta ||
-	  x[i][1] < lo_current-delta || x[i][1] > hi_current+delta) return 0;
+          x[i][1] < lo_current-delta || x[i][1] > hi_current+delta) return 0;
   }
 
   return 1;
@@ -559,9 +559,9 @@ void FixPour::xyz_random(double h, double *coord)
     } else {
       double r1,r2;
       while (1) {
-	r1 = random->uniform() - 0.5;
-	r2 = random->uniform() - 0.5;
-	if (r1*r1 + r2*r2 < 0.25) break;
+        r1 = random->uniform() - 0.5;
+        r2 = random->uniform() - 0.5;
+        if (r1*r1 + r2*r2 < 0.25) break;
       }
       coord[0] = xc + 2.0*r1*rc;
       coord[1] = yc + 2.0*r2*rc;
diff --git a/src/GRANULAR/fix_pour.h b/src/GRANULAR/fix_pour.h
index 58575c6aed..322cb30b8a 100644
--- a/src/GRANULAR/fix_pour.h
+++ b/src/GRANULAR/fix_pour.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp
index 8b05036560..6557a7ebf1 100644
--- a/src/GRANULAR/fix_wall_gran.cpp
+++ b/src/GRANULAR/fix_wall_gran.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -71,7 +71,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
   int dampflag = atoi(arg[8]);
   if (dampflag == 0) gammat = 0.0;
 
-  if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || 
+  if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 ||
       xmu < 0.0 || xmu > 1.0 || dampflag < 0 || dampflag > 1)
     error->all(FLERR,"Illegal fix wall/gran command");
 
@@ -116,7 +116,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
     cylradius = atof(arg[iarg+1]);
     iarg += 2;
   }
-  
+
   // check for trailing keyword/values
 
   wiggle = 0;
@@ -154,7 +154,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) :
   if (wallstyle == ZCYLINDER && (domain->xperiodic || domain->yperiodic))
     error->all(FLERR,"Cannot use wall in periodic dimension");
 
-  if (wiggle && wshear) 
+  if (wiggle && wshear)
     error->all(FLERR,"Cannot wiggle and shear fix wall/gran");
   if (wiggle && wallstyle == ZCYLINDER && axis != 2)
     error->all(FLERR,"Invalid wiggle direction for fix wall/gran");
@@ -298,53 +298,53 @@ void FixWallGran::post_force(int vflag)
       dx = dy = dz = 0.0;
 
       if (wallstyle == XPLANE) {
-	del1 = x[i][0] - wlo;
-	del2 = whi - x[i][0];
-	if (del1 < del2) dx = del1;
-	else dx = -del2;
+        del1 = x[i][0] - wlo;
+        del2 = whi - x[i][0];
+        if (del1 < del2) dx = del1;
+        else dx = -del2;
       } else if (wallstyle == YPLANE) {
-	del1 = x[i][1] - wlo;
-	del2 = whi - x[i][1];
-	if (del1 < del2) dy = del1;
-	else dy = -del2;
+        del1 = x[i][1] - wlo;
+        del2 = whi - x[i][1];
+        if (del1 < del2) dy = del1;
+        else dy = -del2;
       } else if (wallstyle == ZPLANE) {
-	del1 = x[i][2] - wlo;
-	del2 = whi - x[i][2];
-	if (del1 < del2) dz = del1;
-	else dz = -del2;
+        del1 = x[i][2] - wlo;
+        del2 = whi - x[i][2];
+        if (del1 < del2) dz = del1;
+        else dz = -del2;
       } else if (wallstyle == ZCYLINDER) {
         delxy = sqrt(x[i][0]*x[i][0] + x[i][1]*x[i][1]);
-	delr = cylradius - delxy;
-	if (delr > radius[i]) dz = cylradius;
-	else {
-	  dx = -delr/delxy * x[i][0];
-	  dy = -delr/delxy * x[i][1];
-	  if (wshear && axis != 2) {
-	    vwall[0] = vshear * x[i][1]/delxy;
-	    vwall[1] = -vshear * x[i][0]/delxy;
-	    vwall[2] = 0.0;
-	  }
-	}
+        delr = cylradius - delxy;
+        if (delr > radius[i]) dz = cylradius;
+        else {
+          dx = -delr/delxy * x[i][0];
+          dy = -delr/delxy * x[i][1];
+          if (wshear && axis != 2) {
+            vwall[0] = vshear * x[i][1]/delxy;
+            vwall[1] = -vshear * x[i][0]/delxy;
+            vwall[2] = 0.0;
+          }
+        }
       }
 
       rsq = dx*dx + dy*dy + dz*dz;
 
       if (rsq > radius[i]*radius[i]) {
-	if (pairstyle != HOOKE) {
-	  shear[i][0] = 0.0;
-	  shear[i][1] = 0.0;
-	  shear[i][2] = 0.0;
-	}
+        if (pairstyle != HOOKE) {
+          shear[i][0] = 0.0;
+          shear[i][1] = 0.0;
+          shear[i][2] = 0.0;
+        }
       } else {
-	if (pairstyle == HOOKE)
-	  hooke(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
-		radius[i],rmass[i]);
-	else if (pairstyle == HOOKE_HISTORY)
-	  hooke_history(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
-			radius[i],rmass[i],shear[i]);
-	else if (pairstyle == HERTZ_HISTORY)
-	  hertz_history(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
-			radius[i],rmass[i],shear[i]);
+        if (pairstyle == HOOKE)
+          hooke(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
+                radius[i],rmass[i]);
+        else if (pairstyle == HOOKE_HISTORY)
+          hooke_history(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
+                        radius[i],rmass[i],shear[i]);
+        else if (pairstyle == HERTZ_HISTORY)
+          hertz_history(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
+                        radius[i],rmass[i],shear[i]);
       }
     }
   }
@@ -362,9 +362,9 @@ void FixWallGran::post_force_respa(int vflag, int ilevel, int iloop)
 /* ---------------------------------------------------------------------- */
 
 void FixWallGran::hooke(double rsq, double dx, double dy, double dz,
-			double *vwall, double *v,
-			double *f, double *omega, double *torque,
-			double radius, double mass)
+                        double *vwall, double *v,
+                        double *f, double *omega, double *torque,
+                        double radius, double mass)
 {
   double r,vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
   double wr1,wr2,wr3,meff,damp,ccel,vtr1,vtr2,vtr3,vrel;
@@ -447,9 +447,9 @@ void FixWallGran::hooke(double rsq, double dx, double dy, double dz,
 /* ---------------------------------------------------------------------- */
 
 void FixWallGran::hooke_history(double rsq, double dx, double dy, double dz,
-				double *vwall, double *v,
-				double *f, double *omega, double *torque,
-				double radius, double mass, double *shear)
+                                double *vwall, double *v,
+                                double *f, double *omega, double *torque,
+                                double radius, double mass, double *shear)
 {
   double r,vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
   double wr1,wr2,wr3,meff,damp,ccel,vtr1,vtr2,vtr3,vrel;
@@ -531,12 +531,12 @@ void FixWallGran::hooke_history(double rsq, double dx, double dy, double dz,
 
   if (fs > fn) {
     if (shrmag != 0.0) {
-      shear[0] = (fn/fs) * (shear[0] + meff*gammat*vtr1/kt) - 
-	meff*gammat*vtr1/kt;
+      shear[0] = (fn/fs) * (shear[0] + meff*gammat*vtr1/kt) -
+        meff*gammat*vtr1/kt;
       shear[1] = (fn/fs) * (shear[1] + meff*gammat*vtr2/kt) -
-	meff*gammat*vtr2/kt;
+        meff*gammat*vtr2/kt;
       shear[2] = (fn/fs) * (shear[2] + meff*gammat*vtr3/kt) -
-	meff*gammat*vtr3/kt;
+        meff*gammat*vtr3/kt;
       fs1 *= fn/fs ;
       fs2 *= fn/fs;
       fs3 *= fn/fs;
@@ -564,9 +564,9 @@ void FixWallGran::hooke_history(double rsq, double dx, double dy, double dz,
 /* ---------------------------------------------------------------------- */
 
 void FixWallGran::hertz_history(double rsq, double dx, double dy, double dz,
-				double *vwall, double *v,
-				double *f, double *omega, double *torque,
-				double radius, double mass, double *shear)
+                                double *vwall, double *v,
+                                double *f, double *omega, double *torque,
+                                double radius, double mass, double *shear)
 {
   double r,vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
   double wr1,wr2,wr3,meff,damp,ccel,vtr1,vtr2,vtr3,vrel;
@@ -650,12 +650,12 @@ void FixWallGran::hertz_history(double rsq, double dx, double dy, double dz,
 
   if (fs > fn) {
     if (shrmag != 0.0) {
-      shear[0] = (fn/fs) * (shear[0] + meff*gammat*vtr1/kt) - 
-	meff*gammat*vtr1/kt;
+      shear[0] = (fn/fs) * (shear[0] + meff*gammat*vtr1/kt) -
+        meff*gammat*vtr1/kt;
       shear[1] = (fn/fs) * (shear[1] + meff*gammat*vtr2/kt) -
-	meff*gammat*vtr2/kt;
+        meff*gammat*vtr2/kt;
       shear[2] = (fn/fs) * (shear[2] + meff*gammat*vtr3/kt) -
-	meff*gammat*vtr3/kt;
+        meff*gammat*vtr3/kt;
       fs1 *= fn/fs ;
       fs2 *= fn/fs;
       fs3 *= fn/fs;
@@ -681,7 +681,7 @@ void FixWallGran::hertz_history(double rsq, double dx, double dy, double dz,
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double FixWallGran::memory_usage()
@@ -693,7 +693,7 @@ double FixWallGran::memory_usage()
 }
 
 /* ----------------------------------------------------------------------
-   allocate local atom-based arrays 
+   allocate local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixWallGran::grow_arrays(int nmax)
@@ -702,7 +702,7 @@ void FixWallGran::grow_arrays(int nmax)
 }
 
 /* ----------------------------------------------------------------------
-   copy values within local atom-based arrays 
+   copy values within local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixWallGran::copy_arrays(int i, int j)
@@ -722,7 +722,7 @@ void FixWallGran::set_arrays(int i)
 }
 
 /* ----------------------------------------------------------------------
-   pack values in local atom-based arrays for exchange with another proc 
+   pack values in local atom-based arrays for exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixWallGran::pack_exchange(int i, double *buf)
@@ -734,7 +734,7 @@ int FixWallGran::pack_exchange(int i, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   unpack values into local atom-based arrays after exchange 
+   unpack values into local atom-based arrays after exchange
 ------------------------------------------------------------------------- */
 
 int FixWallGran::unpack_exchange(int nlocal, double *buf)
@@ -746,7 +746,7 @@ int FixWallGran::unpack_exchange(int nlocal, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   pack values in local atom-based arrays for restart file 
+   pack values in local atom-based arrays for restart file
 ------------------------------------------------------------------------- */
 
 int FixWallGran::pack_restart(int i, double *buf)
@@ -760,7 +760,7 @@ int FixWallGran::pack_restart(int i, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   unpack values from atom->extra array to restart the fix 
+   unpack values from atom->extra array to restart the fix
 ------------------------------------------------------------------------- */
 
 void FixWallGran::unpack_restart(int nlocal, int nth)
@@ -779,7 +779,7 @@ void FixWallGran::unpack_restart(int nlocal, int nth)
 }
 
 /* ----------------------------------------------------------------------
-   maxsize of any atom's restart data 
+   maxsize of any atom's restart data
 ------------------------------------------------------------------------- */
 
 int FixWallGran::maxsize_restart()
@@ -788,7 +788,7 @@ int FixWallGran::maxsize_restart()
 }
 
 /* ----------------------------------------------------------------------
-   size of atom nlocal's restart data 
+   size of atom nlocal's restart data
 ------------------------------------------------------------------------- */
 
 int FixWallGran::size_restart(int nlocal)
diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h
index e240f33ba0..4f29675057 100644
--- a/src/GRANULAR/fix_wall_gran.h
+++ b/src/GRANULAR/fix_wall_gran.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -61,13 +61,13 @@ class FixWallGran : public Fix {
   int shearupdate;
 
   void hooke(double, double, double, double, double *,
-	     double *, double *, double *, double *, double, double);
+             double *, double *, double *, double *, double, double);
   void hooke_history(double, double, double, double, double *,
-		     double *, double *, double *, double *, double, double,
-		     double *);
+                     double *, double *, double *, double *, double, double,
+                     double *);
   void hertz_history(double, double, double, double, double *,
-		     double *, double *, double *, double *, double, double,
-		     double *);
+                     double *, double *, double *, double *, double, double,
+                     double *);
 };
 
 }
diff --git a/src/GRANULAR/pair_gran_hertz_history.cpp b/src/GRANULAR/pair_gran_hertz_history.cpp
index 1afecdf94d..19d302a1fb 100644
--- a/src/GRANULAR/pair_gran_hertz_history.cpp
+++ b/src/GRANULAR/pair_gran_hertz_history.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -101,145 +101,145 @@ void PairGranHertzHistory::compute(int eflag, int vflag)
 
       if (rsq >= radsum*radsum) {
 
-	// unset non-touching neighbors
+        // unset non-touching neighbors
 
         touch[jj] = 0;
-	shear = &allshear[3*jj];
+        shear = &allshear[3*jj];
         shear[0] = 0.0;
         shear[1] = 0.0;
         shear[2] = 0.0;
 
       } else {
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	rsqinv = 1.0/rsq;
-
-	// relative translational velocity
-
-	vr1 = v[i][0] - v[j][0];
-	vr2 = v[i][1] - v[j][1];
-	vr3 = v[i][2] - v[j][2];
-
-	// normal component
-
-	vnnr = vr1*delx + vr2*dely + vr3*delz;
-	vn1 = delx*vnnr * rsqinv;
-	vn2 = dely*vnnr * rsqinv;
-	vn3 = delz*vnnr * rsqinv;
-
-	// tangential component
-
-	vt1 = vr1 - vn1;
-	vt2 = vr2 - vn2;
-	vt3 = vr3 - vn3;
-
-	// relative rotational velocity
-
-	wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
-	wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
-	wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
-
-	// normal force = Hertzian contact + normal velocity damping
-
-	if (rmass) {
-	  meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
-	  if (mask[i] & freeze_group_bit) meff = rmass[j];
-	  if (mask[j] & freeze_group_bit) meff = rmass[i];
-	} else {
-	  itype = type[i];
-	  jtype = type[j];
-	  meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
-	  if (mask[i] & freeze_group_bit) meff = mass[jtype];
-	  if (mask[j] & freeze_group_bit) meff = mass[itype];
-	}
-
-	damp = meff*gamman*vnnr*rsqinv;
-	ccel = kn*(radsum-r)*rinv - damp;
-	polyhertz = sqrt((radsum-r)*radi*radj / radsum);
-	ccel *= polyhertz;
-
-	// relative velocities
-
-	vtr1 = vt1 - (delz*wr2-dely*wr3);
-	vtr2 = vt2 - (delx*wr3-delz*wr1);
-	vtr3 = vt3 - (dely*wr1-delx*wr2);
-	vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
-	vrel = sqrt(vrel);
-
-	// shear history effects
-
-	touch[jj] = 1;
-	shear = &allshear[3*jj];
-	if (shearupdate) {
-	  shear[0] += vtr1*dt;
-	  shear[1] += vtr2*dt;
-	  shear[2] += vtr3*dt;
-	}
-        shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] + 
-		      shear[2]*shear[2]);
-
-	// rotate shear displacements
-
-	rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
-	rsht *= rsqinv;
-	if (shearupdate) {
-	  shear[0] -= rsht*delx;
-	  shear[1] -= rsht*dely;
-	  shear[2] -= rsht*delz;
-	}
-
-	// tangential forces = shear + tangential velocity damping
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        rsqinv = 1.0/rsq;
+
+        // relative translational velocity
+
+        vr1 = v[i][0] - v[j][0];
+        vr2 = v[i][1] - v[j][1];
+        vr3 = v[i][2] - v[j][2];
+
+        // normal component
+
+        vnnr = vr1*delx + vr2*dely + vr3*delz;
+        vn1 = delx*vnnr * rsqinv;
+        vn2 = dely*vnnr * rsqinv;
+        vn3 = delz*vnnr * rsqinv;
+
+        // tangential component
+
+        vt1 = vr1 - vn1;
+        vt2 = vr2 - vn2;
+        vt3 = vr3 - vn3;
+
+        // relative rotational velocity
+
+        wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
+        wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
+        wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
+
+        // normal force = Hertzian contact + normal velocity damping
+
+        if (rmass) {
+          meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
+          if (mask[i] & freeze_group_bit) meff = rmass[j];
+          if (mask[j] & freeze_group_bit) meff = rmass[i];
+        } else {
+          itype = type[i];
+          jtype = type[j];
+          meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
+          if (mask[i] & freeze_group_bit) meff = mass[jtype];
+          if (mask[j] & freeze_group_bit) meff = mass[itype];
+        }
+
+        damp = meff*gamman*vnnr*rsqinv;
+        ccel = kn*(radsum-r)*rinv - damp;
+        polyhertz = sqrt((radsum-r)*radi*radj / radsum);
+        ccel *= polyhertz;
+
+        // relative velocities
+
+        vtr1 = vt1 - (delz*wr2-dely*wr3);
+        vtr2 = vt2 - (delx*wr3-delz*wr1);
+        vtr3 = vt3 - (dely*wr1-delx*wr2);
+        vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
+        vrel = sqrt(vrel);
+
+        // shear history effects
+
+        touch[jj] = 1;
+        shear = &allshear[3*jj];
+        if (shearupdate) {
+          shear[0] += vtr1*dt;
+          shear[1] += vtr2*dt;
+          shear[2] += vtr3*dt;
+        }
+        shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] +
+                      shear[2]*shear[2]);
+
+        // rotate shear displacements
+
+        rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
+        rsht *= rsqinv;
+        if (shearupdate) {
+          shear[0] -= rsht*delx;
+          shear[1] -= rsht*dely;
+          shear[2] -= rsht*delz;
+        }
+
+        // tangential forces = shear + tangential velocity damping
 
         fs1 = -polyhertz * (kt*shear[0] + meff*gammat*vtr1);
         fs2 = -polyhertz * (kt*shear[1] + meff*gammat*vtr2);
         fs3 = -polyhertz * (kt*shear[2] + meff*gammat*vtr3);
 
-	// rescale frictional displacements and forces if needed
-
-	fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
-	fn = xmu * fabs(ccel*r);
-
-	if (fs > fn) {
-	  if (shrmag != 0.0) {
-	    shear[0] = (fn/fs) * (shear[0] + meff*gammat*vtr1/kt) -
-	      meff*gammat*vtr1/kt;
-	    shear[1] = (fn/fs) * (shear[1] + meff*gammat*vtr2/kt) -
-	      meff*gammat*vtr2/kt;
-	    shear[2] = (fn/fs) * (shear[2] + meff*gammat*vtr3/kt) -
-	      meff*gammat*vtr3/kt;
-	    fs1 *= fn/fs;
-	    fs2 *= fn/fs;
-	    fs3 *= fn/fs;
-	  } else fs1 = fs2 = fs3 = 0.0;
-	}
-
-	// forces & torques
-
-	fx = delx*ccel + fs1;
-	fy = dely*ccel + fs2;
-	fz = delz*ccel + fs3;
-	f[i][0] += fx;
-	f[i][1] += fy;
-	f[i][2] += fz;
-
-	tor1 = rinv * (dely*fs3 - delz*fs2);
-	tor2 = rinv * (delz*fs1 - delx*fs3);
-	tor3 = rinv * (delx*fs2 - dely*fs1);
-	torque[i][0] -= radi*tor1;
-	torque[i][1] -= radi*tor2;
-	torque[i][2] -= radi*tor3;
-
-	if (j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	  torque[j][0] -= radj*tor1;
-	  torque[j][1] -= radj*tor2;
-	  torque[j][2] -= radj*tor3;
-	}
-
-	if (evflag) ev_tally_xyz(i,j,nlocal,0,
-				 0.0,0.0,fx,fy,fz,delx,dely,delz);
+        // rescale frictional displacements and forces if needed
+
+        fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
+        fn = xmu * fabs(ccel*r);
+
+        if (fs > fn) {
+          if (shrmag != 0.0) {
+            shear[0] = (fn/fs) * (shear[0] + meff*gammat*vtr1/kt) -
+              meff*gammat*vtr1/kt;
+            shear[1] = (fn/fs) * (shear[1] + meff*gammat*vtr2/kt) -
+              meff*gammat*vtr2/kt;
+            shear[2] = (fn/fs) * (shear[2] + meff*gammat*vtr3/kt) -
+              meff*gammat*vtr3/kt;
+            fs1 *= fn/fs;
+            fs2 *= fn/fs;
+            fs3 *= fn/fs;
+          } else fs1 = fs2 = fs3 = 0.0;
+        }
+
+        // forces & torques
+
+        fx = delx*ccel + fs1;
+        fy = dely*ccel + fs2;
+        fz = delz*ccel + fs3;
+        f[i][0] += fx;
+        f[i][1] += fy;
+        f[i][2] += fz;
+
+        tor1 = rinv * (dely*fs3 - delz*fs2);
+        tor2 = rinv * (delz*fs1 - delx*fs3);
+        tor3 = rinv * (delx*fs2 - dely*fs1);
+        torque[i][0] -= radi*tor1;
+        torque[i][1] -= radi*tor2;
+        torque[i][2] -= radi*tor3;
+
+        if (j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+          torque[j][0] -= radj*tor1;
+          torque[j][1] -= radj*tor2;
+          torque[j][2] -= radj*tor3;
+        }
+
+        if (evflag) ev_tally_xyz(i,j,nlocal,0,
+                                 0.0,0.0,fx,fy,fz,delx,dely,delz);
       }
     }
   }
@@ -267,7 +267,7 @@ void PairGranHertzHistory::settings(int narg, char **arg)
   dampflag = force->inumeric(arg[5]);
   if (dampflag == 0) gammat = 0.0;
 
-  if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || 
+  if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 ||
       xmu < 0.0 || xmu > 1.0 || dampflag < 0 || dampflag > 1)
     error->all(FLERR,"Illegal pair_style command");
 
@@ -280,9 +280,9 @@ void PairGranHertzHistory::settings(int narg, char **arg)
 /* ---------------------------------------------------------------------- */
 
 double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
-				    double rsq,
-				    double factor_coul, double factor_lj,
-				    double &fforce)
+                                    double rsq,
+                                    double factor_coul, double factor_lj,
+                                    double &fforce)
 {
   double radi,radj,radsum;
   double r,rinv,rsqinv,delx,dely,delz;
@@ -314,7 +314,7 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
   vr3 = v[i][2] - v[j][2];
 
   // normal component
-  
+
   double **x = atom->x;
   delx = x[i][0] - x[j][0];
   dely = x[i][1] - x[j][1];
@@ -324,7 +324,7 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
   vn1 = delx*vnnr * rsqinv;
   vn2 = dely*vnnr * rsqinv;
   vn3 = delz*vnnr * rsqinv;
-  
+
   // tangential component
 
   vt1 = vr1 - vn1;
@@ -337,7 +337,7 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
   wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
   wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
   wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
-  
+
   // normal force = Hertzian contact + normal velocity damping
 
   double *rmass = atom->rmass;
@@ -353,7 +353,7 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
     if (mask[i] & freeze_group_bit) meff = mass[jtype];
     if (mask[j] & freeze_group_bit) meff = mass[itype];
   }
-  
+
   damp = meff*gamman*vnnr*rsqinv;
   ccel = kn*(radsum-r)*rinv - damp;
   polyhertz = sqrt((radsum-r)*radi*radj / radsum);
@@ -366,7 +366,7 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
   vtr3 = vt3 - (dely*wr1-delx*wr2);
   vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
   vrel = sqrt(vrel);
-  
+
   // shear history effects
   // neighprev = index of found neigh on previous call
   // search entire jnum list of neighbors of I for neighbor J
@@ -385,25 +385,25 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
   }
 
   double *shear = &allshear[3*neighprev];
-  shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] + 
-		shear[2]*shear[2]);
-  
+  shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] +
+                shear[2]*shear[2]);
+
   // rotate shear displacements
-  
+
   rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
   rsht *= rsqinv;
-  
+
   // tangential forces = shear + tangential velocity damping
-  
+
   fs1 = -polyhertz * (kt*shear[0] + meff*gammat*vtr1);
   fs2 = -polyhertz * (kt*shear[1] + meff*gammat*vtr2);
   fs3 = -polyhertz * (kt*shear[2] + meff*gammat*vtr3);
-  
+
   // rescale frictional displacements and forces if needed
-  
+
   fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
   fn = xmu * fabs(ccel*r);
-  
+
   if (fs > fn) {
     if (shrmag != 0.0) {
       fs1 *= fn/fs;
@@ -412,9 +412,9 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype,
       fs *= fn/fs;
     } else fs1 = fs2 = fs3 = fs = 0.0;
   }
-  
+
   // set all forces and return no energy
-  
+
   fforce = ccel;
   svector[0] = fs1;
   svector[1] = fs2;
diff --git a/src/GRANULAR/pair_gran_hertz_history.h b/src/GRANULAR/pair_gran_hertz_history.h
index 0cb762c4f9..b5eacb6430 100644
--- a/src/GRANULAR/pair_gran_hertz_history.h
+++ b/src/GRANULAR/pair_gran_hertz_history.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GRANULAR/pair_gran_hooke.cpp b/src/GRANULAR/pair_gran_hooke.cpp
index 4f2c00e270..befc20ce24 100644
--- a/src/GRANULAR/pair_gran_hooke.cpp
+++ b/src/GRANULAR/pair_gran_hooke.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -91,100 +91,100 @@ void PairGranHooke::compute(int eflag, int vflag)
       radsum = radi + radj;
 
       if (rsq < radsum*radsum) {
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	rsqinv = 1.0/rsq;
-
-	// relative translational velocity
-
-	vr1 = v[i][0] - v[j][0];
-	vr2 = v[i][1] - v[j][1];
-	vr3 = v[i][2] - v[j][2];
-
-	// normal component
-
-	vnnr = vr1*delx + vr2*dely + vr3*delz;
-	vn1 = delx*vnnr * rsqinv;
-	vn2 = dely*vnnr * rsqinv;
-	vn3 = delz*vnnr * rsqinv;
-
-	// tangential component
-
-	vt1 = vr1 - vn1;
-	vt2 = vr2 - vn2;
-	vt3 = vr3 - vn3;
-
-	// relative rotational velocity
-
-	wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
-	wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
-	wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
-
-	// normal forces = Hookian contact + normal velocity damping
-
-	if (rmass) {
-	  meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
-	  if (mask[i] & freeze_group_bit) meff = rmass[j];
-	  if (mask[j] & freeze_group_bit) meff = rmass[i];
-	} else {
-	  itype = type[i];
-	  jtype = type[j];
-	  meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
-	  if (mask[i] & freeze_group_bit) meff = mass[jtype];
-	  if (mask[j] & freeze_group_bit) meff = mass[itype];
-	}
-
-	damp = meff*gamman*vnnr*rsqinv;
-	ccel = kn*(radsum-r)*rinv - damp;
-
-	// relative velocities
-
-	vtr1 = vt1 - (delz*wr2-dely*wr3);
-	vtr2 = vt2 - (delx*wr3-delz*wr1);
-	vtr3 = vt3 - (dely*wr1-delx*wr2);
-	vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
-	vrel = sqrt(vrel);
-
-	// force normalization
-
-	fn = xmu * fabs(ccel*r);
-	fs = meff*gammat*vrel;
-	if (vrel != 0.0) ft = MIN(fn,fs) / vrel;
-	else ft = 0.0;
-
-	// tangential force due to tangential velocity damping
-
-	fs1 = -ft*vtr1;
-	fs2 = -ft*vtr2;
-	fs3 = -ft*vtr3;
-
-	// forces & torques
-
-	fx = delx*ccel + fs1;
-	fy = dely*ccel + fs2;
-	fz = delz*ccel + fs3;
-	f[i][0] += fx;
-	f[i][1] += fy;
-	f[i][2] += fz;
-
-	tor1 = rinv * (dely*fs3 - delz*fs2);
-	tor2 = rinv * (delz*fs1 - delx*fs3);
-	tor3 = rinv * (delx*fs2 - dely*fs1);
-	torque[i][0] -= radi*tor1;
-	torque[i][1] -= radi*tor2;
-	torque[i][2] -= radi*tor3;
-
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	  torque[j][0] -= radj*tor1;
-	  torque[j][1] -= radj*tor2;
-	  torque[j][2] -= radj*tor3;
-	}
-
-	if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
-				 0.0,0.0,fx,fy,fz,delx,dely,delz);
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        rsqinv = 1.0/rsq;
+
+        // relative translational velocity
+
+        vr1 = v[i][0] - v[j][0];
+        vr2 = v[i][1] - v[j][1];
+        vr3 = v[i][2] - v[j][2];
+
+        // normal component
+
+        vnnr = vr1*delx + vr2*dely + vr3*delz;
+        vn1 = delx*vnnr * rsqinv;
+        vn2 = dely*vnnr * rsqinv;
+        vn3 = delz*vnnr * rsqinv;
+
+        // tangential component
+
+        vt1 = vr1 - vn1;
+        vt2 = vr2 - vn2;
+        vt3 = vr3 - vn3;
+
+        // relative rotational velocity
+
+        wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
+        wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
+        wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
+
+        // normal forces = Hookian contact + normal velocity damping
+
+        if (rmass) {
+          meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
+          if (mask[i] & freeze_group_bit) meff = rmass[j];
+          if (mask[j] & freeze_group_bit) meff = rmass[i];
+        } else {
+          itype = type[i];
+          jtype = type[j];
+          meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
+          if (mask[i] & freeze_group_bit) meff = mass[jtype];
+          if (mask[j] & freeze_group_bit) meff = mass[itype];
+        }
+
+        damp = meff*gamman*vnnr*rsqinv;
+        ccel = kn*(radsum-r)*rinv - damp;
+
+        // relative velocities
+
+        vtr1 = vt1 - (delz*wr2-dely*wr3);
+        vtr2 = vt2 - (delx*wr3-delz*wr1);
+        vtr3 = vt3 - (dely*wr1-delx*wr2);
+        vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
+        vrel = sqrt(vrel);
+
+        // force normalization
+
+        fn = xmu * fabs(ccel*r);
+        fs = meff*gammat*vrel;
+        if (vrel != 0.0) ft = MIN(fn,fs) / vrel;
+        else ft = 0.0;
+
+        // tangential force due to tangential velocity damping
+
+        fs1 = -ft*vtr1;
+        fs2 = -ft*vtr2;
+        fs3 = -ft*vtr3;
+
+        // forces & torques
+
+        fx = delx*ccel + fs1;
+        fy = dely*ccel + fs2;
+        fz = delz*ccel + fs3;
+        f[i][0] += fx;
+        f[i][1] += fy;
+        f[i][2] += fz;
+
+        tor1 = rinv * (dely*fs3 - delz*fs2);
+        tor2 = rinv * (delz*fs1 - delx*fs3);
+        tor3 = rinv * (delx*fs2 - dely*fs1);
+        torque[i][0] -= radi*tor1;
+        torque[i][1] -= radi*tor2;
+        torque[i][2] -= radi*tor3;
+
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+          torque[j][0] -= radj*tor1;
+          torque[j][1] -= radj*tor2;
+          torque[j][2] -= radj*tor3;
+        }
+
+        if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
+                                 0.0,0.0,fx,fy,fz,delx,dely,delz);
       }
     }
   }
@@ -195,8 +195,8 @@ void PairGranHooke::compute(int eflag, int vflag)
 /* ---------------------------------------------------------------------- */
 
 double PairGranHooke::single(int i, int j, int itype, int jtype, double rsq,
-			     double factor_coul, double factor_lj,
-			     double &fforce)
+                             double factor_coul, double factor_lj,
+                             double &fforce)
 {
   double radi,radj,radsum,r,rinv,rsqinv;
   double delx,dely,delz;
@@ -228,7 +228,7 @@ double PairGranHooke::single(int i, int j, int itype, int jtype, double rsq,
   vr1 = v[i][0] - v[j][0];
   vr2 = v[i][1] - v[j][1];
   vr3 = v[i][2] - v[j][2];
-  
+
   // normal component
 
   double **x = atom->x;
@@ -287,15 +287,15 @@ double PairGranHooke::single(int i, int j, int itype, int jtype, double rsq,
   fs = meff*gammat*vrel;
   if (vrel != 0.0) ft = MIN(fn,fs) / vrel;
   else ft = 0.0;
-  
+
   // set all forces and return no energy
-  
+
   fforce = ccel;
   svector[0] = -ft*vtr1;
   svector[1] = -ft*vtr2;
   svector[2] = -ft*vtr3;
-  svector[3] = sqrt(svector[0]*svector[0] + 
-		    svector[1]*svector[1] + 
-		    svector[2]*svector[2]);
+  svector[3] = sqrt(svector[0]*svector[0] +
+                    svector[1]*svector[1] +
+                    svector[2]*svector[2]);
   return 0.0;
 }
diff --git a/src/GRANULAR/pair_gran_hooke.h b/src/GRANULAR/pair_gran_hooke.h
index 20c2c3c1bd..d8a63b9805 100644
--- a/src/GRANULAR/pair_gran_hooke.h
+++ b/src/GRANULAR/pair_gran_hooke.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp
index 7e8cbc22fc..268b196644 100644
--- a/src/GRANULAR/pair_gran_hooke_history.cpp
+++ b/src/GRANULAR/pair_gran_hooke_history.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -115,7 +115,7 @@ void PairGranHookeHistory::compute(int eflag, int vflag)
   firstneigh = list->firstneigh;
   firsttouch = listgranhistory->firstneigh;
   firstshear = listgranhistory->firstdouble;
- 
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -142,144 +142,144 @@ void PairGranHookeHistory::compute(int eflag, int vflag)
 
       if (rsq >= radsum*radsum) {
 
-	// unset non-touching neighbors
+        // unset non-touching neighbors
 
         touch[jj] = 0;
-	shear = &allshear[3*jj];
+        shear = &allshear[3*jj];
         shear[0] = 0.0;
         shear[1] = 0.0;
         shear[2] = 0.0;
 
       } else {
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	rsqinv = 1.0/rsq;
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        rsqinv = 1.0/rsq;
 
-	// relative translational velocity
+        // relative translational velocity
 
-	vr1 = v[i][0] - v[j][0];
-	vr2 = v[i][1] - v[j][1];
-	vr3 = v[i][2] - v[j][2];
+        vr1 = v[i][0] - v[j][0];
+        vr2 = v[i][1] - v[j][1];
+        vr3 = v[i][2] - v[j][2];
 
-	// normal component
+        // normal component
 
-	vnnr = vr1*delx + vr2*dely + vr3*delz;
-	vn1 = delx*vnnr * rsqinv;
-	vn2 = dely*vnnr * rsqinv;
-	vn3 = delz*vnnr * rsqinv;
+        vnnr = vr1*delx + vr2*dely + vr3*delz;
+        vn1 = delx*vnnr * rsqinv;
+        vn2 = dely*vnnr * rsqinv;
+        vn3 = delz*vnnr * rsqinv;
 
-	// tangential component
+        // tangential component
 
-	vt1 = vr1 - vn1;
-	vt2 = vr2 - vn2;
-	vt3 = vr3 - vn3;
+        vt1 = vr1 - vn1;
+        vt2 = vr2 - vn2;
+        vt3 = vr3 - vn3;
 
-	// relative rotational velocity
+        // relative rotational velocity
 
-	wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
-	wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
-	wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
+        wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
+        wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
+        wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
 
-	// normal forces = Hookian contact + normal velocity damping
+        // normal forces = Hookian contact + normal velocity damping
 
-	if (rmass) {
-	  meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
-	  if (mask[i] & freeze_group_bit) meff = rmass[j];
-	  if (mask[j] & freeze_group_bit) meff = rmass[i];
-	} else {
-	  itype = type[i];
-	  jtype = type[j];
-	  meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
-	  if (mask[i] & freeze_group_bit) meff = mass[jtype];
-	  if (mask[j] & freeze_group_bit) meff = mass[itype];
-	}
+        if (rmass) {
+          meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
+          if (mask[i] & freeze_group_bit) meff = rmass[j];
+          if (mask[j] & freeze_group_bit) meff = rmass[i];
+        } else {
+          itype = type[i];
+          jtype = type[j];
+          meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
+          if (mask[i] & freeze_group_bit) meff = mass[jtype];
+          if (mask[j] & freeze_group_bit) meff = mass[itype];
+        }
 
-	damp = meff*gamman*vnnr*rsqinv;
-	ccel = kn*(radsum-r)*rinv - damp;
+        damp = meff*gamman*vnnr*rsqinv;
+        ccel = kn*(radsum-r)*rinv - damp;
 
-	// relative velocities
+        // relative velocities
 
-	vtr1 = vt1 - (delz*wr2-dely*wr3);
-	vtr2 = vt2 - (delx*wr3-delz*wr1);
-	vtr3 = vt3 - (dely*wr1-delx*wr2);
-	vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
-	vrel = sqrt(vrel);
+        vtr1 = vt1 - (delz*wr2-dely*wr3);
+        vtr2 = vt2 - (delx*wr3-delz*wr1);
+        vtr3 = vt3 - (dely*wr1-delx*wr2);
+        vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
+        vrel = sqrt(vrel);
 
-	// shear history effects
+        // shear history effects
 
-	touch[jj] = 1;
-	shear = &allshear[3*jj];
+        touch[jj] = 1;
+        shear = &allshear[3*jj];
 
-	if (shearupdate) {
-	  shear[0] += vtr1*dt;
-	  shear[1] += vtr2*dt;
-	  shear[2] += vtr3*dt;
-	}
+        if (shearupdate) {
+          shear[0] += vtr1*dt;
+          shear[1] += vtr2*dt;
+          shear[2] += vtr3*dt;
+        }
         shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] +
-		      shear[2]*shear[2]);
-
-	// rotate shear displacements
-
-	rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
-	rsht *= rsqinv;
-	if (shearupdate) {
-	  shear[0] -= rsht*delx;
-	  shear[1] -= rsht*dely;
-	  shear[2] -= rsht*delz;
-	}
-
-	// tangential forces = shear + tangential velocity damping
-
-	fs1 = - (kt*shear[0] + meff*gammat*vtr1);
-	fs2 = - (kt*shear[1] + meff*gammat*vtr2);
-	fs3 = - (kt*shear[2] + meff*gammat*vtr3);
-
-	// rescale frictional displacements and forces if needed
-
-	fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
-	fn = xmu * fabs(ccel*r);
-
-	if (fs > fn) {
-	  if (shrmag != 0.0) {
-	    shear[0] = (fn/fs) * (shear[0] + meff*gammat*vtr1/kt) -
-	      meff*gammat*vtr1/kt;
-	    shear[1] = (fn/fs) * (shear[1] + meff*gammat*vtr2/kt) -
-	      meff*gammat*vtr2/kt;
-	    shear[2] = (fn/fs) * (shear[2] + meff*gammat*vtr3/kt) -
-	      meff*gammat*vtr3/kt;
-	    fs1 *= fn/fs;
-	    fs2 *= fn/fs;
-	    fs3 *= fn/fs;
-	  } else fs1 = fs2 = fs3 = 0.0;
-	}
-
-	// forces & torques
-
-	fx = delx*ccel + fs1;
-	fy = dely*ccel + fs2;
-	fz = delz*ccel + fs3;
-	f[i][0] += fx;
-	f[i][1] += fy;
-	f[i][2] += fz;
-
-	tor1 = rinv * (dely*fs3 - delz*fs2);
-	tor2 = rinv * (delz*fs1 - delx*fs3);
-	tor3 = rinv * (delx*fs2 - dely*fs1);
-	torque[i][0] -= radi*tor1;
-	torque[i][1] -= radi*tor2;
-	torque[i][2] -= radi*tor3;
-
-	if (j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	  torque[j][0] -= radj*tor1;
-	  torque[j][1] -= radj*tor2;
-	  torque[j][2] -= radj*tor3;
-	}
-
-	if (evflag) ev_tally_xyz(i,j,nlocal,0,
-				 0.0,0.0,fx,fy,fz,delx,dely,delz);
+                      shear[2]*shear[2]);
+
+        // rotate shear displacements
+
+        rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
+        rsht *= rsqinv;
+        if (shearupdate) {
+          shear[0] -= rsht*delx;
+          shear[1] -= rsht*dely;
+          shear[2] -= rsht*delz;
+        }
+
+        // tangential forces = shear + tangential velocity damping
+
+        fs1 = - (kt*shear[0] + meff*gammat*vtr1);
+        fs2 = - (kt*shear[1] + meff*gammat*vtr2);
+        fs3 = - (kt*shear[2] + meff*gammat*vtr3);
+
+        // rescale frictional displacements and forces if needed
+
+        fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
+        fn = xmu * fabs(ccel*r);
+
+        if (fs > fn) {
+          if (shrmag != 0.0) {
+            shear[0] = (fn/fs) * (shear[0] + meff*gammat*vtr1/kt) -
+              meff*gammat*vtr1/kt;
+            shear[1] = (fn/fs) * (shear[1] + meff*gammat*vtr2/kt) -
+              meff*gammat*vtr2/kt;
+            shear[2] = (fn/fs) * (shear[2] + meff*gammat*vtr3/kt) -
+              meff*gammat*vtr3/kt;
+            fs1 *= fn/fs;
+            fs2 *= fn/fs;
+            fs3 *= fn/fs;
+          } else fs1 = fs2 = fs3 = 0.0;
+        }
+
+        // forces & torques
+
+        fx = delx*ccel + fs1;
+        fy = dely*ccel + fs2;
+        fz = delz*ccel + fs3;
+        f[i][0] += fx;
+        f[i][1] += fy;
+        f[i][2] += fz;
+
+        tor1 = rinv * (dely*fs3 - delz*fs2);
+        tor2 = rinv * (delz*fs1 - delx*fs3);
+        tor3 = rinv * (delx*fs2 - dely*fs1);
+        torque[i][0] -= radi*tor1;
+        torque[i][1] -= radi*tor2;
+        torque[i][2] -= radi*tor3;
+
+        if (j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+          torque[j][0] -= radj*tor1;
+          torque[j][1] -= radj*tor2;
+          torque[j][2] -= radj*tor3;
+        }
+
+        if (evflag) ev_tally_xyz(i,j,nlocal,0,
+                                 0.0,0.0,fx,fy,fz,delx,dely,delz);
       }
     }
   }
@@ -329,7 +329,7 @@ void PairGranHookeHistory::settings(int narg, char **arg)
   dampflag = force->inumeric(arg[5]);
   if (dampflag == 0) gammat = 0.0;
 
-  if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || 
+  if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 ||
       xmu < 0.0 || xmu > 1.0 || dampflag < 0 || dampflag > 1)
     error->all(FLERR,"Illegal pair_style command");
 }
@@ -441,11 +441,11 @@ void PairGranHookeHistory::init_style()
       onerad_frozen[type[i]] = MAX(onerad_frozen[type[i]],radius[i]);
     else
       onerad_dynamic[type[i]] = MAX(onerad_dynamic[type[i]],radius[i]);
-  
+
   MPI_Allreduce(&onerad_dynamic[1],&maxrad_dynamic[1],atom->ntypes,
-		MPI_DOUBLE,MPI_MAX,world);
+                MPI_DOUBLE,MPI_MAX,world);
   MPI_Allreduce(&onerad_frozen[1],&maxrad_frozen[1],atom->ntypes,
-		MPI_DOUBLE,MPI_MAX,world);
+                MPI_DOUBLE,MPI_MAX,world);
 }
 
 /* ----------------------------------------------------------------------
@@ -554,9 +554,9 @@ void PairGranHookeHistory::reset_dt()
 /* ---------------------------------------------------------------------- */
 
 double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
-				    double rsq,
-				    double factor_coul, double factor_lj,
-				    double &fforce)
+                                    double rsq,
+                                    double factor_coul, double factor_lj,
+                                    double &fforce)
 {
   double radi,radj,radsum;
   double r,rinv,rsqinv,delx,dely,delz;
@@ -588,7 +588,7 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
   vr3 = v[i][2] - v[j][2];
 
   // normal component
-  
+
   double **x = atom->x;
   delx = x[i][0] - x[j][0];
   dely = x[i][1] - x[j][1];
@@ -598,7 +598,7 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
   vn1 = delx*vnnr * rsqinv;
   vn2 = dely*vnnr * rsqinv;
   vn3 = delz*vnnr * rsqinv;
-  
+
   // tangential component
 
   vt1 = vr1 - vn1;
@@ -611,7 +611,7 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
   wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
   wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
   wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
-  
+
   // normal force = Hertzian contact + normal velocity damping
 
   double *rmass = atom->rmass;
@@ -627,7 +627,7 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
     if (mask[i] & freeze_group_bit) meff = mass[jtype];
     if (mask[j] & freeze_group_bit) meff = mass[itype];
   }
-  
+
   damp = meff*gamman*vnnr*rsqinv;
   ccel = kn*(radsum-r)*rinv - damp;
 
@@ -638,7 +638,7 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
   vtr3 = vt3 - (dely*wr1-delx*wr2);
   vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
   vrel = sqrt(vrel);
-  
+
   // shear history effects
   // neighprev = index of found neigh on previous call
   // search entire jnum list of neighbors of I for neighbor J
@@ -657,25 +657,25 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
   }
 
   double *shear = &allshear[3*neighprev];
-  shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] + 
-		shear[2]*shear[2]);
-  
+  shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] +
+                shear[2]*shear[2]);
+
   // rotate shear displacements
-  
+
   rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
   rsht *= rsqinv;
-  
+
   // tangential forces = shear + tangential velocity damping
-  
+
   fs1 = - (kt*shear[0] + meff*gammat*vtr1);
   fs2 = - (kt*shear[1] + meff*gammat*vtr2);
   fs3 = - (kt*shear[2] + meff*gammat*vtr3);
-  
+
   // rescale frictional displacements and forces if needed
-  
+
   fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
   fn = xmu * fabs(ccel*r);
-  
+
   if (fs > fn) {
     if (shrmag != 0.0) {
       fs1 *= fn/fs;
@@ -684,9 +684,9 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype,
       fs *= fn/fs;
     } else fs1 = fs2 = fs3 = fs = 0.0;
   }
-  
+
   // set all forces and return no energy
-  
+
   fforce = ccel;
   svector[0] = fs1;
   svector[1] = fs2;
diff --git a/src/GRANULAR/pair_gran_hooke_history.h b/src/GRANULAR/pair_gran_hooke_history.h
index 593143205c..ec111a957d 100644
--- a/src/GRANULAR/pair_gran_hooke_history.h
+++ b/src/GRANULAR/pair_gran_hooke_history.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp
index 0712484025..e86caa9e11 100644
--- a/src/KIM/pair_kim.cpp
+++ b/src/KIM/pair_kim.cpp
@@ -5,14 +5,14 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Contributing authors: Valeriu Smirichinski, Ryan Elliott, 
+   Contributing authors: Valeriu Smirichinski, Ryan Elliott,
                          Ellad Tadmor (U Minn)
 ------------------------------------------------------------------------- */
 
@@ -24,7 +24,7 @@
 #include "atom.h"
 #include "comm.h"
 #include "force.h"
-#include "neighbor.h" 
+#include "neighbor.h"
 #include "neigh_list.h"
 #include "neigh_request.h"
 #include "update.h"
@@ -132,15 +132,15 @@ void PairKIM::compute(int eflag , int vflag)
 
   // set callback for virial tallying if necessary
 
-  int process_dEdr_flag = 0; 
+  int process_dEdr_flag = 0;
   if (process_dEdr_ind >= 0 && (vflag_atom || vflag_global))
     process_dEdr_flag = 1;
 
   pkim->setm_compute_by_index(&kimerr,12, particleEnergy_ind,
-				 eflag_atom,1,
-				 particleVirial_ind,vflag_atom,1,
-				 virialGlobal_ind,vflag_global,1,
-				 process_dEdr_ind,process_dEdr_flag,1);
+                                 eflag_atom,1,
+                                 particleVirial_ind,vflag_atom,1,
+                                 virialGlobal_ind,vflag_global,1,
+                                 process_dEdr_ind,process_dEdr_flag,1);
   kim_error(__LINE__,"setm_compute_by_index",kimerr);
 
   // KIM initialization
@@ -169,18 +169,18 @@ void PairKIM::compute(int eflag , int vflag)
       f[i][2] += fcopy[i][2];
     }
   }
-  
+
   // flip sign of virial
 
   if (vflag_global && !pkim->virial_need2add)
     for (int i = 0; i < 6; i++) virial[i] = -1.0*virial[i];
   if (vflag_atom && !pkim->particleVirial_need2add)
-    for (int i = 0; i < atom->nlocal; i++) 
+    for (int i = 0; i < atom->nlocal; i++)
       for (int j = 0; j < 6; j++) vatom[i][j] = -1.0*vatom[i][j];
 }
- 
+
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairKIM::allocate()
@@ -195,7 +195,7 @@ void PairKIM::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairKIM::settings(int narg, char **arg)
@@ -282,8 +282,8 @@ void PairKIM::coeff(int narg, char **arg)
   for (int i = 1; i <= n; i++)
     for (int j = i; j <= n; j++)
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	count++;
+        setflag[i][j] = 1;
+        count++;
       }
 
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
@@ -376,7 +376,7 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf)
   double *fp;
   if (hybrid) fp = &(fcopy[0][0]);
   else fp = &(atom->f[0][0]);
- 
+
   double *va=&(vatom[0][0]);
   m = 0;
   if (vflag_atom == 1) {
@@ -404,7 +404,7 @@ void PairKIM::unpack_reverse_comm(int n, int *list, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairKIM::memory_usage()
@@ -421,17 +421,17 @@ void PairKIM::kim_error(int ln, const char* msg, int errcode)
 {
   if (errcode == 1) return;
   KIM_API_model::report_error(ln,(char *) __FILE__,
-			      (char *) msg,errcode);
+                              (char *) msg,errcode);
   error->all(__FILE__,ln,"Internal KIM error");
 }
 
 /* ---------------------------------------------------------------------- */
 
 int PairKIM::get_neigh(void **kimmdl,int *mode,int *request,
-		       int *atom, int *numnei, int **nei1atom, double **pRij)
+                       int *atom, int *numnei, int **nei1atom, double **pRij)
 {
   double * x;
-   
+
   KIM_API_model *pkim = (KIM_API_model *) *kimmdl;
 
   // get neighObj from KIM API obj
@@ -439,11 +439,11 @@ int PairKIM::get_neigh(void **kimmdl,int *mode,int *request,
 
   int kimerr;
   PairKIM *self = (PairKIM *) pkim->get_test_buffer(&kimerr);
-  
+
   *pRij = &(self->Rij[0]);
-  
+
   NeighList * neiobj = (NeighList * ) (*pkim)[self->neighObject_ind].data;
-  
+
   int * pnAtoms = (int *)(*pkim)[self->numberOfParticles_ind].data;
   if(pkim->support_Rij) x = (double *)(*pkim)[self->coordinates_ind].data;
   int nAtoms = *pnAtoms;
@@ -460,39 +460,39 @@ int PairKIM::get_neigh(void **kimmdl,int *mode,int *request,
       return KIM_STATUS_NEIGH_ITER_INIT_OK; //succsesful restart
     } else if (*request==1) { //increment iterator
       if (self->pointsto > inum || inum <0){
-	self->error->one(FLERR,"KIM neighbor iterator exceeded range");
+        self->error->one(FLERR,"KIM neighbor iterator exceeded range");
       } else if (self->pointsto == inum) {
-	self->pointsto = 0;
-	*numnei = 0;
-	return KIM_STATUS_NEIGH_ITER_PAST_END; //reached end by iterator
+        self->pointsto = 0;
+        *numnei = 0;
+        return KIM_STATUS_NEIGH_ITER_PAST_END; //reached end by iterator
       } else {
-	*atom = ilist[self->pointsto];
-	*numnei = numneigh[*atom];
-
-	// strip off neighbor mask for molecular systems
-
-	if (self->molecular) {
-	  int n = *numnei;
-	  int *ptr = firstneigh[*atom];
-	  int *onebuf = self->onebuf;
-	  for (int i = 0; i < n; i++)
-	    onebuf[i] = *(ptr++) & NEIGHMASK;
-	  *nei1atom = onebuf;
-	} else *nei1atom = firstneigh[*atom];
-
-	self->pointsto++;
-	if (*numnei > KIM_API_MAX_NEIGHBORS) 
-	  return KIM_STATUS_NEIGH_TOO_MANY_NEIGHBORS;
-	if (pkim->support_Rij) {
-	  for (jj=0; jj < *numnei; jj++) {
-	    int i = *atom;
-	    j = (*nei1atom)[jj];
-	    self->Rij[jj*3 +0] = -x[i*3+0] + x[j*3+0];
-	    self->Rij[jj*3 +1] = -x[i*3+1] + x[j*3+1];
-	    self->Rij[jj*3 +2] = -x[i*3+2] + x[j*3+2];
-	  }
-	}
-	return KIM_STATUS_OK;//successful increment
+        *atom = ilist[self->pointsto];
+        *numnei = numneigh[*atom];
+
+        // strip off neighbor mask for molecular systems
+
+        if (self->molecular) {
+          int n = *numnei;
+          int *ptr = firstneigh[*atom];
+          int *onebuf = self->onebuf;
+          for (int i = 0; i < n; i++)
+            onebuf[i] = *(ptr++) & NEIGHMASK;
+          *nei1atom = onebuf;
+        } else *nei1atom = firstneigh[*atom];
+
+        self->pointsto++;
+        if (*numnei > KIM_API_MAX_NEIGHBORS)
+          return KIM_STATUS_NEIGH_TOO_MANY_NEIGHBORS;
+        if (pkim->support_Rij) {
+          for (jj=0; jj < *numnei; jj++) {
+            int i = *atom;
+            j = (*nei1atom)[jj];
+            self->Rij[jj*3 +0] = -x[i*3+0] + x[j*3+0];
+            self->Rij[jj*3 +1] = -x[i*3+1] + x[j*3+1];
+            self->Rij[jj*3 +2] = -x[i*3+2] + x[j*3+2];
+          }
+        }
+        return KIM_STATUS_OK;//successful increment
       }
     }
   }else if (*mode ==1){//locator mode
@@ -505,7 +505,7 @@ int PairKIM::get_neigh(void **kimmdl,int *mode,int *request,
     }
     *atom = *request;
     *numnei = numneigh[*atom];
-    
+
     // strip off neighbor mask for molecular systems
 
     if (self->molecular) {
@@ -513,19 +513,19 @@ int PairKIM::get_neigh(void **kimmdl,int *mode,int *request,
       int *ptr = firstneigh[*atom];
       int *onebuf = self->onebuf;
       for (int i = 0; i < n; i++)
-	onebuf[i] = *(ptr++) & NEIGHMASK;
+        onebuf[i] = *(ptr++) & NEIGHMASK;
       *nei1atom = onebuf;
     } else *nei1atom = firstneigh[*atom];
 
-    if (*numnei > KIM_API_MAX_NEIGHBORS) 
+    if (*numnei > KIM_API_MAX_NEIGHBORS)
       return KIM_STATUS_NEIGH_TOO_MANY_NEIGHBORS;
     if (pkim->support_Rij){
       for(int jj=0; jj < *numnei; jj++){
-	int i = *atom;
-	int j = (*nei1atom)[jj];
-	self->Rij[jj*3 +0]=-x[i*3+0] + x[j*3+0];
-	self->Rij[jj*3 +1]=-x[i*3+1] + x[j*3+1];
-	self->Rij[jj*3 +2]=-x[i*3+2] + x[j*3+2];   
+        int i = *atom;
+        int j = (*nei1atom)[jj];
+        self->Rij[jj*3 +0]=-x[i*3+0] + x[j*3+0];
+        self->Rij[jj*3 +1]=-x[i*3+1] + x[j*3+1];
+        self->Rij[jj*3 +2]=-x[i*3+2] + x[j*3+2];
       }
     }
     return KIM_STATUS_OK;//successful end
@@ -579,22 +579,22 @@ void PairKIM::kim_init()
 
   if (!(strcmp(update->unit_style,"metal")==0))
     this->kim_error(__LINE__,
-		    "LAMMPS unit_style must be metal to "
-		    "work with KIM models",-12);
-  
+                    "LAMMPS unit_style must be metal to "
+                    "work with KIM models",-12);
+
   // create temporary kim file
 
   test_descriptor_string = new char[80*60];
   for (int i=50;i<80*60;i++) test_descriptor_string[i]='\0';
-  
+
   // 1. write atomic header and atomic type spec
-  
+
   int i_s;
   sprintf(test_descriptor_string,
-	  "# This file is automatically generated from LAMMPS "
-	  "pair_style PairKIM command\n");
+          "# This file is automatically generated from LAMMPS "
+          "pair_style PairKIM command\n");
   i_s=strlen(test_descriptor_string);
-  
+
   sprintf(&test_descriptor_string[i_s],"TEST_NAME :=%s\n" ,testname);
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],"#Unit_Handling := flexible\n\n");
@@ -611,35 +611,35 @@ void PairKIM::kim_init()
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],"SUPPORTED_ATOM/PARTICLES_TYPES:\n");
   i_s=strlen(test_descriptor_string);
-  sprintf(&test_descriptor_string[i_s], 
-	  "# Simbol/name           Type            code\n");
+  sprintf(&test_descriptor_string[i_s],
+          "# Simbol/name           Type            code\n");
   int code=1;
   for (int i=0; i < nelements; i++){
     i_s=strlen(test_descriptor_string);
     sprintf(&test_descriptor_string[i_s],"%s\t\t\tspec\t\t%d\n",
-	    elements[i],code++);
+            elements[i],code++);
   }
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],"\n");
-  
+
   // 2. conventions
-  
+
   i_s=strlen(test_descriptor_string);
-  sprintf(&test_descriptor_string[i_s],				\
-	  "CONVENTIONS:\n# Name                  Type\n\n");
+  sprintf(&test_descriptor_string[i_s],                                \
+          "CONVENTIONS:\n# Name                  Type\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s], "ZeroBasedLists           flag\n\n");
   i_s=strlen(test_descriptor_string);
-  
+
   // can use iterator or locator neighbor mode, unless hybrid
-  
+
   int iterator_only = 0;
   if (force->pair_match("hybrid",0)) iterator_only = 1;
   if (iterator_only)
     sprintf(&test_descriptor_string[i_s],"Neigh_IterAccess         flag\n\n");
   else
     sprintf(&test_descriptor_string[i_s],"Neigh_BothAccess         flag\n\n");
-  
+
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],"NEIGH_PURE_H             flag\n\n");
   i_s=strlen(test_descriptor_string);
@@ -648,107 +648,107 @@ void PairKIM::kim_init()
   sprintf(&test_descriptor_string[i_s],"NEIGH_RVEC_F             flag\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],"CLUSTER                  flag\n\n");
-  
+
   // 3. input-output
-  
+
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],"MODEL_INPUT:\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "# Name                  Type         Unit       Shape\n\n");
+          "# Name                  Type         Unit       Shape\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "numberOfParticles           integer      none       []\n\n");
+          "numberOfParticles           integer      none       []\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "numberContributingParticles    integer      none    []\n\n");
-  
+          "numberContributingParticles    integer      none    []\n\n");
+
   if (support_atypes){
     i_s=strlen(test_descriptor_string);
     sprintf(&test_descriptor_string[i_s],
-	    "numberParticleTypes         integer      none []\n\n");
+            "numberParticleTypes         integer      none []\n\n");
     i_s=strlen(test_descriptor_string);
     sprintf(&test_descriptor_string[i_s],
-	    "particleTypes               integer      none [numberOfParticles]\n\n");
+            "particleTypes               integer      none [numberOfParticles]\n\n");
   }
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "coordinates             real*8       length     "
-	  "[numberOfParticles,3]\n\n");
+          "coordinates             real*8       length     "
+          "[numberOfParticles,3]\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "neighObject             pointer      none       []\n\n");
+          "neighObject             pointer      none       []\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "get_neigh          method       none       []\n\n");
+          "get_neigh          method       none       []\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s], "MODEL_OUPUT:\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "# Name                  Type         Unit       Shape\n\n");
+          "# Name                  Type         Unit       Shape\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "compute                 method       none       []\n\n");
+          "compute                 method       none       []\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "destroy                 method       none       []\n\n");
+          "destroy                 method       none       []\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "cutoff                  real*8       length     []\n\n");
+          "cutoff                  real*8       length     []\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "energy                  real*8       energy     []\n\n");
+          "energy                  real*8       energy     []\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "forces                  real*8       force      "
-	  "[numberOfParticles,3]\n\n");
+          "forces                  real*8       force      "
+          "[numberOfParticles,3]\n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "particleEnergy           real*8       energy    "
-	  "[numberOfParticles]\n\n");
+          "particleEnergy           real*8       energy    "
+          "[numberOfParticles]\n\n");
   //virial and virial per atom will be added here
   //  i_s=strlen(test_descriptor_string);
-  sprintf(&test_descriptor_string[i_s], 
-	  "virial          real*8       energy    [6] \n\n\0");
+  sprintf(&test_descriptor_string[i_s],
+          "virial          real*8       energy    [6] \n\n\0");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "process_dEdr        method       none   [] \n\n");
+          "process_dEdr        method       none   [] \n\n");
   i_s=strlen(test_descriptor_string);
   sprintf(&test_descriptor_string[i_s],
-	  "particleVirial         real*8       energy   "
-	  "[numberOfParticles,6] \n\n\0");
-  
+          "particleVirial         real*8       energy   "
+          "[numberOfParticles,6] \n\n\0");
+
   // kim file created now init and maptypes
 
   pkim = new KIM_API_model();
   if (!pkim->init_str_testname(test_descriptor_string,modelname))
     error->all(FLERR,"KIM initialization failed");
-  
+
   delete [] test_descriptor_string;
-    
+
   // get correct index of each variable in kim_api object
-  
+
   pkim->getm_index(&kimerr,33,
-			   "coordinates", &coordinates_ind,1,
-			   "cutoff",  &cutoff_ind,1,
-			   "particleEnergy",&particleEnergy_ind,1,
-			   "energy", &energy_ind,1,
-			   "forces",  &forces_ind,1,
-			   "neighObject", &neighObject_ind,1,
-			   "numberOfParticles",&numberOfParticles_ind,1,
-			   "get_neigh", &get_neigh_ind,1,
-			   "particleVirial", &particleVirial_ind,1,
-			   "virial", &virialGlobal_ind,1,
-			   "process_dEdr",&process_dEdr_ind,1 );
+                           "coordinates", &coordinates_ind,1,
+                           "cutoff",  &cutoff_ind,1,
+                           "particleEnergy",&particleEnergy_ind,1,
+                           "energy", &energy_ind,1,
+                           "forces",  &forces_ind,1,
+                           "neighObject", &neighObject_ind,1,
+                           "numberOfParticles",&numberOfParticles_ind,1,
+                           "get_neigh", &get_neigh_ind,1,
+                           "particleVirial", &particleVirial_ind,1,
+                           "virial", &virialGlobal_ind,1,
+                           "process_dEdr",&process_dEdr_ind,1 );
   this->kim_error(__LINE__,"getm_index",kimerr);
-  
+
   if(support_atypes){
     numberParticleTypes_ind = pkim->get_index((char *) "numberParticleTypes",&kimerr);
     this->kim_error(__LINE__,"numberParticleTypes",kimerr);
     particleTypes_ind = pkim->get_index((char *) "particleTypes",&kimerr);
     this->kim_error(__LINE__,"particleTypes",kimerr);
   }
-  
+
   set_statics();
 
   // setup mapping between LAMMPS and KIM atom types
@@ -762,7 +762,7 @@ void PairKIM::kim_init()
   }
 
   // check if Rij needed for get_neigh
-  
+
   char * NBC_method =(char *) pkim->get_NBC_method(&kimerr);
   this->kim_error(__LINE__,"NBC method not set",kimerr);
   support_Rij=false;
@@ -773,7 +773,7 @@ void PairKIM::kim_init()
 /* ---------------------------------------------------------------------- */
 
 void PairKIM::set_statics()
-{ 
+{
   if(support_atypes)
     pkim->set_data_by_index(numberParticleTypes_ind,1,(void *) &(atom->ntypes )) ;
   if ( process_dEdr_ind >= 0 )
@@ -781,19 +781,19 @@ void PairKIM::set_statics()
   localnall = (int) (atom->nghost + atom->nlocal);
   int kimerr;
   pkim->setm_data_by_index(&kimerr,20,
-			      energy_ind,1,  (void *)&(this->eng_vdwl),1,
-			      cutoff_ind,1,  (void *)&(this->cut_global),1,
-			      get_neigh_ind,1,(void *) &get_neigh,1,
-			      numberOfParticles_ind,1,  (void *) &localnall,1,
-			      virialGlobal_ind,1,(void *)&(virial[0]),1);
+                              energy_ind,1,  (void *)&(this->eng_vdwl),1,
+                              cutoff_ind,1,  (void *)&(this->cut_global),1,
+                              get_neigh_ind,1,(void *) &get_neigh,1,
+                              numberOfParticles_ind,1,  (void *) &localnall,1,
+                              virialGlobal_ind,1,(void *)&(virial[0]),1);
   this->kim_error(__LINE__,"setm_data_by_index",kimerr);
-  
+
   pkim->set_data((char *) "numberContributingParticles",1,(void *)&(atom->nlocal));
 
   pkim->set_test_buffer( (void *)this, &kimerr);
 
   this->kim_error(__LINE__,"set_test_buffer",kimerr);
-  
+
 }
 
 /* ---------------------------------------------------------------------- */
@@ -802,7 +802,7 @@ void PairKIM::set_volatiles()
 {
   localnall = (int) (atom->nghost + atom->nlocal);
   bigint nall = (bigint) localnall;
-    
+
   pkim->set_data_by_index(coordinates_ind,nall*3,(void *) &(atom->x[0][0]) );
   if (hybrid)
     pkim->set_data_by_index(forces_ind,nall*3,(void *) &(fcopy[0][0]) ) ;
@@ -810,16 +810,16 @@ void PairKIM::set_volatiles()
     pkim->set_data_by_index(forces_ind,nall*3,(void *) &(atom->f[0][0]) ) ;
   pkim->set_data_by_index(particleEnergy_ind,nall,  (void *)this->eatom) ;
   pkim->set_data_by_index(neighObject_ind,1,  (void *)this->list) ;
-  
+
   if (support_atypes)
     pkim->set_data_by_index(particleTypes_ind,nall,  (void *) kimtype) ;
-  
+
   if(vflag_atom != 1) {
     (*pkim)[particleVirial_ind].flag->calculate = 0;
   } else {
     (*pkim)[particleVirial_ind].flag->calculate = 1;
     pkim->set_data_by_index(particleVirial_ind,(intptr_t)nall,
-		       (void *)&vatom[0][0]) ;
+                       (void *)&vatom[0][0]) ;
   }
   if (vflag_global != 1) {
     (*pkim)[virialGlobal_ind].flag->calculate = 0;
@@ -838,8 +838,8 @@ void PairKIM::init2zero(KIM_API_model *pkim, int *kimerr)
   PairKIM *self = (PairKIM *) pkim->get_test_buffer(kimerr);
   if (*kimerr < 1)
     KIM_API_model::report_error(__LINE__,(char *) __FILE__,
-				(char *) "Self ptr to PairKIM is invalid",
-				*kimerr);
+                                (char *) "Self ptr to PairKIM is invalid",
+                                *kimerr);
 
   int p1_ind=-1;bool process_d1=false;
   self->process_dE.virialGlobal_flag = 0;
@@ -847,7 +847,7 @@ void PairKIM::init2zero(KIM_API_model *pkim, int *kimerr)
   int ierGlobal,ierPerAtom;
   self->process_dE.virialGlobal = (double *) pkim->get_data((char *) "virial",&ierGlobal);
   self->process_dE.particleVirial = (double *) pkim->get_data((char *) "particleVirial",
-					    &ierPerAtom);
+                                            &ierPerAtom);
   self->process_dE.numberOfParticles = (int *) pkim->get_data((char *) "numberOfParticles",kimerr);
   //halfNeighbors = !pkim->requiresFullNeighbors();
   p1_ind = pkim->get_index((char *) "process_dEdr");
@@ -861,7 +861,7 @@ void PairKIM::init2zero(KIM_API_model *pkim, int *kimerr)
       process_d1=true;
     }
   }
-  
+
   if (ierPerAtom == KIM_STATUS_OK && self->process_dE.particleVirial != NULL) {
     self->process_dE.particleVirial_flag = pkim->get_compute((char *) "particleVirial");
     if (self->process_dE.particleVirial_flag==1 && pkim->particleVirial_need2add) {
@@ -878,8 +878,8 @@ void PairKIM::init2zero(KIM_API_model *pkim, int *kimerr)
 /* ---------------------------------------------------------------------- */
 
 void PairKIM::process_dEdr(KIM_API_model **ppkim,
-			    double *de,double *r,double ** pdx,
-			    int *i,int *j,int *ier)
+                            double *de,double *r,double ** pdx,
+                            int *i,int *j,int *ier)
 {
   KIM_API_model *pkim = *ppkim;
   PairKIM *self = (PairKIM *) pkim->get_test_buffer(ier);
@@ -889,9 +889,9 @@ void PairKIM::process_dEdr(KIM_API_model **ppkim,
   double *dx = *pdx;
   //v=(*de)/((*r)*(*r))/3.0;
   //v=(*de)/((*r)*(*r));
-  
+
   v=-(*de)/(*r);
-  
+
   if (self->process_dE.virialGlobal_flag ==1 && pkim->virial_need2add) {
     vir[0] = v * dx[0] * dx[0];
     vir[1] = v * dx[1] * dx[1];
@@ -920,7 +920,7 @@ void PairKIM::process_dEdr(KIM_API_model **ppkim,
     self->process_dE.particleVirial[(*i)*6 + 3] += vir[3];
     self->process_dE.particleVirial[(*i)*6 + 4] += vir[4];
     self->process_dE.particleVirial[(*i)*6 + 5] += vir[5];
-    
+
     self->process_dE.particleVirial[(*j)*6 + 0] += vir[0];
     self->process_dE.particleVirial[(*j)*6 + 1] += vir[1];
     self->process_dE.particleVirial[(*j)*6 + 2] += vir[2];
@@ -928,6 +928,6 @@ void PairKIM::process_dEdr(KIM_API_model **ppkim,
     self->process_dE.particleVirial[(*j)*6 + 4] += vir[4];
     self->process_dE.particleVirial[(*j)*6 + 5] += vir[5];
   }
-  
+
   *ier = KIM_STATUS_OK;
 }
diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h
index 4c3b41022d..8f11d52604 100644
--- a/src/KIM/pair_kim.h
+++ b/src/KIM/pair_kim.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -78,7 +78,7 @@ class PairKIM : public Pair {
     bool halfNeighbors;
   };
   process_fij_4_pair_KIM process_dE;
-  
+
   bool support_atypes;
   bool support_Rij;
 
@@ -103,7 +103,7 @@ class PairKIM : public Pair {
 
   static int get_neigh(void **,int *, int *, int *, int *, int **, double **);
   static void process_dEdr(KIM_API_model **, double *, double *,
-			    double **, int *, int *, int *);
+                            double **, int *, int *, int *);
 };
 
 }
diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp
index 52a16826a1..8bdf47d5f5 100644
--- a/src/KSPACE/ewald.cpp
+++ b/src/KSPACE/ewald.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -61,7 +61,7 @@ Ewald::Ewald(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
 }
 
 /* ----------------------------------------------------------------------
-   free all memory 
+   free all memory
 ------------------------------------------------------------------------- */
 
 Ewald::~Ewald()
@@ -84,9 +84,9 @@ void Ewald::init()
 
   // error check
 
-  if (domain->triclinic) 
+  if (domain->triclinic)
     error->all(FLERR,"Cannot use Ewald with triclinic box");
-  if (domain->dimension == 2) 
+  if (domain->dimension == 2)
     error->all(FLERR,"Cannot use Ewald with 2d simulation");
 
   if (!atom->q_flag) error->all(FLERR,"Kspace style requires atom attribute q");
@@ -94,8 +94,8 @@ void Ewald::init()
   if (slabflag == 0 && domain->nonperiodic > 0)
     error->all(FLERR,"Cannot use nonperiodic boundaries with Ewald");
   if (slabflag == 1) {
-    if (domain->xperiodic != 1 || domain->yperiodic != 1 || 
-	domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
+    if (domain->xperiodic != 1 || domain->yperiodic != 1 ||
+        domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
       error->all(FLERR,"Incorrect boundaries with slab Ewald");
   }
 
@@ -132,10 +132,10 @@ void Ewald::init()
   }
 
   // set accuracy (force units) from accuracy_relative or accuracy_absolute
-  
+
   if (accuracy_absolute >= 0.0) accuracy = accuracy_absolute;
   else accuracy = accuracy_relative * two_charge_force;
-  
+
   // setup K-space resolution
 
   q2 = qsqsum * force->qqrd2e / force->dielectric;
@@ -149,7 +149,7 @@ void Ewald::init()
   double yprd = domain->yprd;
   double zprd = domain->zprd;
   double zprd_slab = zprd*slab_volfactor;
-  
+
   // make initial g_ewald estimate
   // based on desired accuracy and real space cutoff
   // fluid-occupied volume used to estimate real-space error
@@ -172,35 +172,35 @@ void Ewald::init()
   double lpry = rms(kymax,yprd,natoms,q2);
   double lprz = rms(kzmax,zprd_slab,natoms,q2);
   double lpr = sqrt(lprx*lprx + lpry*lpry + lprz*lprz) / sqrt(3.0);
-  double spr = 2.0*q2 * exp(-g_ewald*g_ewald*cutoff*cutoff) / 
+  double spr = 2.0*q2 * exp(-g_ewald*g_ewald*cutoff*cutoff) /
     sqrt(natoms*cutoff*xprd*yprd*zprd_slab);
-  
+
   // stats
 
   if (comm->me == 0) {
     if (screen) {
       fprintf(screen,"  G vector (1/distance) = %g\n",g_ewald);
       fprintf(screen,"  estimated absolute RMS force accuracy = %g\n",
-	      MAX(lpr,spr));
+              MAX(lpr,spr));
       fprintf(screen,"  estimated relative force accuracy = %g\n",
-	      MAX(lpr,spr)/two_charge_force);
+              MAX(lpr,spr)/two_charge_force);
       fprintf(screen,"  KSpace vectors: actual max1d max3d = %d %d %d\n",
-	      kcount,kmax,kmax3d);
+              kcount,kmax,kmax3d);
     }
     if (logfile) {
       fprintf(logfile,"  G vector (1/distnace) = %g\n",g_ewald);
       fprintf(logfile,"  estimated absolute RMS force accuracy = %g\n",
-	      MAX(lpr,spr));
+              MAX(lpr,spr));
       fprintf(logfile,"  estimated relative force accuracy = %g\n",
-	      MAX(lpr,spr)/two_charge_force);
+              MAX(lpr,spr)/two_charge_force);
       fprintf(logfile,"  KSpace vectors: actual max1d max3d = %d %d %d\n",
-	      kcount,kmax,kmax3d);
+              kcount,kmax,kmax3d);
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   adjust Ewald coeffs, called initially and whenever volume has changed 
+   adjust Ewald coeffs, called initially and whenever volume has changed
 ------------------------------------------------------------------------- */
 
 void Ewald::setup()
@@ -210,7 +210,7 @@ void Ewald::setup()
   double xprd = domain->xprd;
   double yprd = domain->yprd;
   double zprd = domain->zprd;
-  
+
   // adjustment of z dimension for 2d slab Ewald
   // 3d Ewald just uses zprd since slab_volfactor = 1.0
 
@@ -229,7 +229,7 @@ void Ewald::setup()
   kxmax = 1;
   kymax = 1;
   kzmax = 1;
-  
+
   err = rms(kxmax,xprd,natoms,q2);
   while (err > accuracy) {
     kxmax++;
@@ -246,7 +246,7 @@ void Ewald::setup()
   while (err > accuracy) {
     kzmax++;
     err = rms(kzmax,zprd_slab,natoms,q2);
-  } 
+  }
 
   int kmax_old = kmax;
   kmax = MAX(kxmax,kymax);
@@ -259,7 +259,7 @@ void Ewald::setup()
   gsqmx = MAX(gsqxmx,gsqymx);
   gsqmx = MAX(gsqmx,gsqzmx);
   gsqmx *= 1.00001;
-  
+
   // if size has grown, reallocate k-dependent and nlocal-dependent arrays
 
   if (kmax > kmax_old) {
@@ -288,15 +288,15 @@ void Ewald::setup()
 
 double Ewald::rms(int km, double prd, bigint natoms, double q2)
 {
-  double value = 2.0*q2*g_ewald/prd * 
-    sqrt(1.0/(MY_PI*km*natoms)) * 
+  double value = 2.0*q2*g_ewald/prd *
+    sqrt(1.0/(MY_PI*km*natoms)) *
     exp(-MY_PI*MY_PI*km*km/(g_ewald*g_ewald*prd*prd));
 
   return value;
 }
 
 /* ----------------------------------------------------------------------
-   compute the Ewald long-range force, energy, virial 
+   compute the Ewald long-range force, energy, virial
 ------------------------------------------------------------------------- */
 
 void Ewald::compute(int eflag, int vflag)
@@ -306,8 +306,8 @@ void Ewald::compute(int eflag, int vflag)
   // set energy/virial flags
 
   if (eflag || vflag) ev_setup(eflag,vflag);
-  else evflag = evflag_atom = eflag_global = vflag_global = 
-	 eflag_atom = vflag_atom = 0;
+  else evflag = evflag_atom = eflag_global = vflag_global =
+         eflag_atom = vflag_atom = 0;
 
   // extend size of per-atom arrays if necessary
 
@@ -362,11 +362,11 @@ void Ewald::compute(int eflag, int vflag)
       ek[i][2] += partial*eg[k][2];
 
       if (evflag_atom) {
-        partial_peratom = exprl*sfacrl_all[k] + expim*sfacim_all[k];		
-    	if (eflag_atom) eatom[i] += q[i]*ug[k]*partial_peratom;
+        partial_peratom = exprl*sfacrl_all[k] + expim*sfacim_all[k];
+            if (eflag_atom) eatom[i] += q[i]*ug[k]*partial_peratom;
         if (vflag_atom)
-	  for (j = 0; j < 6; j++)
-	    vatom[i][j] += ug[k]*vg[k][j]*partial_peratom;
+          for (j = 0; j < 6; j++)
+            vatom[i][j] += ug[k]*vg[k][j]*partial_peratom;
       }
     }
   }
@@ -380,13 +380,13 @@ void Ewald::compute(int eflag, int vflag)
     f[i][1] += qscale * q[i]*ek[i][1];
     f[i][2] += qscale * q[i]*ek[i][2];
   }
- 
+
   // global energy
 
   if (eflag_global) {
     for (k = 0; k < kcount; k++)
-      energy += ug[k] * (sfacrl_all[k]*sfacrl_all[k] + 
-			 sfacim_all[k]*sfacim_all[k]);
+      energy += ug[k] * (sfacrl_all[k]*sfacrl_all[k] +
+                         sfacim_all[k]*sfacim_all[k]);
     energy -= g_ewald*qsqsum/MY_PIS +
       MY_PI2*qsum*qsum / (g_ewald*g_ewald*volume);
     energy *= qscale;
@@ -409,15 +409,15 @@ void Ewald::compute(int eflag, int vflag)
   if (evflag_atom) {
     if (eflag_atom) {
       for (i = 0; i < nlocal; i++) {
-        eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum / 
-	  (g_ewald*g_ewald*volume);
+        eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum /
+          (g_ewald*g_ewald*volume);
         eatom[i] *= qscale;
       }
     }
-      
+
     if (vflag_atom)
       for (i = 0; i < nlocal; i++)
-	for (j = 0; j < 6; j++) vatom[i][j] *= q[i]*qscale;
+        for (j = 0; j < 6; j++) vatom[i][j] *= q[i]*qscale;
   }
 
   // 2d slab correction
@@ -447,14 +447,14 @@ void Ewald::eik_dot_r()
       cstr1 = 0.0;
       sstr1 = 0.0;
       for (i = 0; i < nlocal; i++) {
-	cs[0][ic][i] = 1.0;
-	sn[0][ic][i] = 0.0;
-	cs[1][ic][i] = cos(unitk[ic]*x[i][ic]);
-	sn[1][ic][i] = sin(unitk[ic]*x[i][ic]);
-	cs[-1][ic][i] = cs[1][ic][i];
-	sn[-1][ic][i] = -sn[1][ic][i];
-	cstr1 += q[i]*cs[1][ic][i];
-	sstr1 += q[i]*sn[1][ic][i];
+        cs[0][ic][i] = 1.0;
+        sn[0][ic][i] = 0.0;
+        cs[1][ic][i] = cos(unitk[ic]*x[i][ic]);
+        sn[1][ic][i] = sin(unitk[ic]*x[i][ic]);
+        cs[-1][ic][i] = cs[1][ic][i];
+        sn[-1][ic][i] = -sn[1][ic][i];
+        cstr1 += q[i]*cs[1][ic][i];
+        sstr1 += q[i]*sn[1][ic][i];
       }
       sfacrl[n] = cstr1;
       sfacim[n++] = sstr1;
@@ -465,20 +465,20 @@ void Ewald::eik_dot_r()
     for (ic = 0; ic < 3; ic++) {
       sqk = m*unitk[ic] * m*unitk[ic];
       if (sqk <= gsqmx) {
-	cstr1 = 0.0;
-	sstr1 = 0.0;
-	for (i = 0; i < nlocal; i++) {
-	  cs[m][ic][i] = cs[m-1][ic][i]*cs[1][ic][i] - 
-	    sn[m-1][ic][i]*sn[1][ic][i];
-	  sn[m][ic][i] = sn[m-1][ic][i]*cs[1][ic][i] + 
-	    cs[m-1][ic][i]*sn[1][ic][i];
-	  cs[-m][ic][i] = cs[m][ic][i];
-	  sn[-m][ic][i] = -sn[m][ic][i];
-	  cstr1 += q[i]*cs[m][ic][i];
-	  sstr1 += q[i]*sn[m][ic][i];
-	}
-	sfacrl[n] = cstr1;
-	sfacim[n++] = sstr1;
+        cstr1 = 0.0;
+        sstr1 = 0.0;
+        for (i = 0; i < nlocal; i++) {
+          cs[m][ic][i] = cs[m-1][ic][i]*cs[1][ic][i] -
+            sn[m-1][ic][i]*sn[1][ic][i];
+          sn[m][ic][i] = sn[m-1][ic][i]*cs[1][ic][i] +
+            cs[m-1][ic][i]*sn[1][ic][i];
+          cs[-m][ic][i] = cs[m][ic][i];
+          sn[-m][ic][i] = -sn[m][ic][i];
+          cstr1 += q[i]*cs[m][ic][i];
+          sstr1 += q[i]*sn[m][ic][i];
+        }
+        sfacrl[n] = cstr1;
+        sfacim[n++] = sstr1;
       }
     }
   }
@@ -489,20 +489,20 @@ void Ewald::eik_dot_r()
     for (l = 1; l <= kymax; l++) {
       sqk = (k*unitk[0] * k*unitk[0]) + (l*unitk[1] * l*unitk[1]);
       if (sqk <= gsqmx) {
-	cstr1 = 0.0;
-	sstr1 = 0.0;
-	cstr2 = 0.0;
-	sstr2 = 0.0;
-	for (i = 0; i < nlocal; i++) {
-	  cstr1 += q[i]*(cs[k][0][i]*cs[l][1][i] - sn[k][0][i]*sn[l][1][i]);
-	  sstr1 += q[i]*(sn[k][0][i]*cs[l][1][i] + cs[k][0][i]*sn[l][1][i]);
-	  cstr2 += q[i]*(cs[k][0][i]*cs[l][1][i] + sn[k][0][i]*sn[l][1][i]);
-	  sstr2 += q[i]*(sn[k][0][i]*cs[l][1][i] - cs[k][0][i]*sn[l][1][i]);
-	}
-	sfacrl[n] = cstr1;
-	sfacim[n++] = sstr1;
-	sfacrl[n] = cstr2;
-	sfacim[n++] = sstr2;
+        cstr1 = 0.0;
+        sstr1 = 0.0;
+        cstr2 = 0.0;
+        sstr2 = 0.0;
+        for (i = 0; i < nlocal; i++) {
+          cstr1 += q[i]*(cs[k][0][i]*cs[l][1][i] - sn[k][0][i]*sn[l][1][i]);
+          sstr1 += q[i]*(sn[k][0][i]*cs[l][1][i] + cs[k][0][i]*sn[l][1][i]);
+          cstr2 += q[i]*(cs[k][0][i]*cs[l][1][i] + sn[k][0][i]*sn[l][1][i]);
+          sstr2 += q[i]*(sn[k][0][i]*cs[l][1][i] - cs[k][0][i]*sn[l][1][i]);
+        }
+        sfacrl[n] = cstr1;
+        sfacim[n++] = sstr1;
+        sfacrl[n] = cstr2;
+        sfacim[n++] = sstr2;
       }
     }
   }
@@ -513,20 +513,20 @@ void Ewald::eik_dot_r()
     for (m = 1; m <= kzmax; m++) {
       sqk = (l*unitk[1] * l*unitk[1]) + (m*unitk[2] * m*unitk[2]);
       if (sqk <= gsqmx) {
-	cstr1 = 0.0;
-	sstr1 = 0.0;
-	cstr2 = 0.0;
-	sstr2 = 0.0;
-	for (i = 0; i < nlocal; i++) {
-	  cstr1 += q[i]*(cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i]);
-	  sstr1 += q[i]*(sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i]);
-	  cstr2 += q[i]*(cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i]);
-	  sstr2 += q[i]*(sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i]);
-	}
-	sfacrl[n] = cstr1;
-	sfacim[n++] = sstr1;
-	sfacrl[n] = cstr2;
-	sfacim[n++] = sstr2;
+        cstr1 = 0.0;
+        sstr1 = 0.0;
+        cstr2 = 0.0;
+        sstr2 = 0.0;
+        for (i = 0; i < nlocal; i++) {
+          cstr1 += q[i]*(cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i]);
+          sstr1 += q[i]*(sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i]);
+          cstr2 += q[i]*(cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i]);
+          sstr2 += q[i]*(sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i]);
+        }
+        sfacrl[n] = cstr1;
+        sfacim[n++] = sstr1;
+        sfacrl[n] = cstr2;
+        sfacim[n++] = sstr2;
       }
     }
   }
@@ -537,20 +537,20 @@ void Ewald::eik_dot_r()
     for (m = 1; m <= kzmax; m++) {
       sqk = (k*unitk[0] * k*unitk[0]) + (m*unitk[2] * m*unitk[2]);
       if (sqk <= gsqmx) {
-	cstr1 = 0.0;
-	sstr1 = 0.0;
-	cstr2 = 0.0;
-	sstr2 = 0.0;
-	for (i = 0; i < nlocal; i++) {
-	  cstr1 += q[i]*(cs[k][0][i]*cs[m][2][i] - sn[k][0][i]*sn[m][2][i]);
-	  sstr1 += q[i]*(sn[k][0][i]*cs[m][2][i] + cs[k][0][i]*sn[m][2][i]);
-	  cstr2 += q[i]*(cs[k][0][i]*cs[m][2][i] + sn[k][0][i]*sn[m][2][i]);
-	  sstr2 += q[i]*(sn[k][0][i]*cs[m][2][i] - cs[k][0][i]*sn[m][2][i]);
-	}
-	sfacrl[n] = cstr1;
-	sfacim[n++] = sstr1;
-	sfacrl[n] = cstr2;
-	sfacim[n++] = sstr2;
+        cstr1 = 0.0;
+        sstr1 = 0.0;
+        cstr2 = 0.0;
+        sstr2 = 0.0;
+        for (i = 0; i < nlocal; i++) {
+          cstr1 += q[i]*(cs[k][0][i]*cs[m][2][i] - sn[k][0][i]*sn[m][2][i]);
+          sstr1 += q[i]*(sn[k][0][i]*cs[m][2][i] + cs[k][0][i]*sn[m][2][i]);
+          cstr2 += q[i]*(cs[k][0][i]*cs[m][2][i] + sn[k][0][i]*sn[m][2][i]);
+          sstr2 += q[i]*(sn[k][0][i]*cs[m][2][i] - cs[k][0][i]*sn[m][2][i]);
+        }
+        sfacrl[n] = cstr1;
+        sfacim[n++] = sstr1;
+        sfacrl[n] = cstr2;
+        sfacim[n++] = sstr2;
       }
     }
   }
@@ -560,54 +560,54 @@ void Ewald::eik_dot_r()
   for (k = 1; k <= kxmax; k++) {
     for (l = 1; l <= kymax; l++) {
       for (m = 1; m <= kzmax; m++) {
-	sqk = (k*unitk[0] * k*unitk[0]) + (l*unitk[1] * l*unitk[1]) +
-	  (m*unitk[2] * m*unitk[2]);
-	if (sqk <= gsqmx) {
-	  cstr1 = 0.0;
-	  sstr1 = 0.0;
-	  cstr2 = 0.0;
-	  sstr2 = 0.0;
-	  cstr3 = 0.0;
-	  sstr3 = 0.0;
-	  cstr4 = 0.0;
-	  sstr4 = 0.0;
-	  for (i = 0; i < nlocal; i++) {
-	    clpm = cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i];
-	    slpm = sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i];
-	    cstr1 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
-	    sstr1 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
-	    
-	    clpm = cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i];
-	    slpm = -sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i];
-	    cstr2 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
-	    sstr2 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
-	    
-	    clpm = cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i];
-	    slpm = sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i];
-	    cstr3 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
-	    sstr3 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
-	    
-	    clpm = cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i];
-	    slpm = -sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i];
-	    cstr4 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
-	    sstr4 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
-	  }
-	  sfacrl[n] = cstr1;
-	  sfacim[n++] = sstr1;
-	  sfacrl[n] = cstr2;
-	  sfacim[n++] = sstr2;
-	  sfacrl[n] = cstr3;
-	  sfacim[n++] = sstr3;
-	  sfacrl[n] = cstr4;
-	  sfacim[n++] = sstr4;
-	}
+        sqk = (k*unitk[0] * k*unitk[0]) + (l*unitk[1] * l*unitk[1]) +
+          (m*unitk[2] * m*unitk[2]);
+        if (sqk <= gsqmx) {
+          cstr1 = 0.0;
+          sstr1 = 0.0;
+          cstr2 = 0.0;
+          sstr2 = 0.0;
+          cstr3 = 0.0;
+          sstr3 = 0.0;
+          cstr4 = 0.0;
+          sstr4 = 0.0;
+          for (i = 0; i < nlocal; i++) {
+            clpm = cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i];
+            slpm = sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i];
+            cstr1 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
+            sstr1 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
+
+            clpm = cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i];
+            slpm = -sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i];
+            cstr2 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
+            sstr2 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
+
+            clpm = cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i];
+            slpm = sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i];
+            cstr3 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
+            sstr3 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
+
+            clpm = cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i];
+            slpm = -sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i];
+            cstr4 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
+            sstr4 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
+          }
+          sfacrl[n] = cstr1;
+          sfacim[n++] = sstr1;
+          sfacrl[n] = cstr2;
+          sfacim[n++] = sstr2;
+          sfacrl[n] = cstr3;
+          sfacim[n++] = sstr3;
+          sfacrl[n] = cstr4;
+          sfacim[n++] = sstr4;
+        }
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   pre-compute coefficients for each Ewald K-vector 
+   pre-compute coefficients for each Ewald K-vector
 ------------------------------------------------------------------------- */
 
 void Ewald::coeffs()
@@ -685,36 +685,36 @@ void Ewald::coeffs()
     for (l = 1; l <= kymax; l++) {
       sqk = (unitk[0]*k) * (unitk[0]*k) + (unitk[1]*l) * (unitk[1]*l);
       if (sqk <= gsqmx) {
-	kxvecs[kcount] = k;
-	kyvecs[kcount] = l;
-	kzvecs[kcount] = 0;
-	ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
-	eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
-	eg[kcount][1] = 2.0*unitk[1]*l*ug[kcount];
-	eg[kcount][2] = 0.0;
-	vterm = -2.0*(1.0/sqk + 0.25*g_ewald_sq_inv);
-	vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
-	vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
-	vg[kcount][2] = 1.0;
-	vg[kcount][3] = vterm*unitk[0]*k*unitk[1]*l;
-	vg[kcount][4] = 0.0;
-	vg[kcount][5] = 0.0;
-	kcount++;
-
-	kxvecs[kcount] = k;
-	kyvecs[kcount] = -l;
-	kzvecs[kcount] = 0;
-	ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
-	eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
-	eg[kcount][1] = -2.0*unitk[1]*l*ug[kcount];
-	eg[kcount][2] = 0.0;
-	vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
-	vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
-	vg[kcount][2] = 1.0;
-	vg[kcount][3] = -vterm*unitk[0]*k*unitk[1]*l;
-	vg[kcount][4] = 0.0;
-	vg[kcount][5] = 0.0;
-	kcount++;;
+        kxvecs[kcount] = k;
+        kyvecs[kcount] = l;
+        kzvecs[kcount] = 0;
+        ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
+        eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
+        eg[kcount][1] = 2.0*unitk[1]*l*ug[kcount];
+        eg[kcount][2] = 0.0;
+        vterm = -2.0*(1.0/sqk + 0.25*g_ewald_sq_inv);
+        vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
+        vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
+        vg[kcount][2] = 1.0;
+        vg[kcount][3] = vterm*unitk[0]*k*unitk[1]*l;
+        vg[kcount][4] = 0.0;
+        vg[kcount][5] = 0.0;
+        kcount++;
+
+        kxvecs[kcount] = k;
+        kyvecs[kcount] = -l;
+        kzvecs[kcount] = 0;
+        ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
+        eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
+        eg[kcount][1] = -2.0*unitk[1]*l*ug[kcount];
+        eg[kcount][2] = 0.0;
+        vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
+        vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
+        vg[kcount][2] = 1.0;
+        vg[kcount][3] = -vterm*unitk[0]*k*unitk[1]*l;
+        vg[kcount][4] = 0.0;
+        vg[kcount][5] = 0.0;
+        kcount++;;
       }
     }
   }
@@ -725,36 +725,36 @@ void Ewald::coeffs()
     for (m = 1; m <= kzmax; m++) {
       sqk = (unitk[1]*l) * (unitk[1]*l) + (unitk[2]*m) * (unitk[2]*m);
       if (sqk <= gsqmx) {
-	kxvecs[kcount] = 0;
-	kyvecs[kcount] = l;
-	kzvecs[kcount] = m;
-	ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
-	eg[kcount][0] =  0.0;
-	eg[kcount][1] =  2.0*unitk[1]*l*ug[kcount];
-	eg[kcount][2] =  2.0*unitk[2]*m*ug[kcount];
-	vterm = -2.0*(1.0/sqk + 0.25*g_ewald_sq_inv);
-	vg[kcount][0] = 1.0;
-	vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
-	vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
-	vg[kcount][3] = 0.0;
-	vg[kcount][4] = 0.0;
-	vg[kcount][5] = vterm*unitk[1]*l*unitk[2]*m;
-	kcount++;
-
-	kxvecs[kcount] = 0;
-	kyvecs[kcount] = l;
-	kzvecs[kcount] = -m;
-	ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
-	eg[kcount][0] =  0.0;
-	eg[kcount][1] =  2.0*unitk[1]*l*ug[kcount];
-	eg[kcount][2] = -2.0*unitk[2]*m*ug[kcount];
-	vg[kcount][0] = 1.0;
-	vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
-	vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
-	vg[kcount][3] = 0.0;
-	vg[kcount][4] = 0.0;
-	vg[kcount][5] = -vterm*unitk[1]*l*unitk[2]*m;
-	kcount++;
+        kxvecs[kcount] = 0;
+        kyvecs[kcount] = l;
+        kzvecs[kcount] = m;
+        ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
+        eg[kcount][0] =  0.0;
+        eg[kcount][1] =  2.0*unitk[1]*l*ug[kcount];
+        eg[kcount][2] =  2.0*unitk[2]*m*ug[kcount];
+        vterm = -2.0*(1.0/sqk + 0.25*g_ewald_sq_inv);
+        vg[kcount][0] = 1.0;
+        vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
+        vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
+        vg[kcount][3] = 0.0;
+        vg[kcount][4] = 0.0;
+        vg[kcount][5] = vterm*unitk[1]*l*unitk[2]*m;
+        kcount++;
+
+        kxvecs[kcount] = 0;
+        kyvecs[kcount] = l;
+        kzvecs[kcount] = -m;
+        ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
+        eg[kcount][0] =  0.0;
+        eg[kcount][1] =  2.0*unitk[1]*l*ug[kcount];
+        eg[kcount][2] = -2.0*unitk[2]*m*ug[kcount];
+        vg[kcount][0] = 1.0;
+        vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
+        vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
+        vg[kcount][3] = 0.0;
+        vg[kcount][4] = 0.0;
+        vg[kcount][5] = -vterm*unitk[1]*l*unitk[2]*m;
+        kcount++;
       }
     }
   }
@@ -765,36 +765,36 @@ void Ewald::coeffs()
     for (m = 1; m <= kzmax; m++) {
       sqk = (unitk[0]*k) * (unitk[0]*k) + (unitk[2]*m) * (unitk[2]*m);
       if (sqk <= gsqmx) {
-	kxvecs[kcount] = k;
-	kyvecs[kcount] = 0;
-	kzvecs[kcount] = m;
-	ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
-	eg[kcount][0] =  2.0*unitk[0]*k*ug[kcount];
-	eg[kcount][1] =  0.0;
-	eg[kcount][2] =  2.0*unitk[2]*m*ug[kcount];
-	vterm = -2.0*(1.0/sqk + 0.25*g_ewald_sq_inv);
-	vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
-	vg[kcount][1] = 1.0;
-	vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
-	vg[kcount][3] = 0.0;
-	vg[kcount][4] = vterm*unitk[0]*k*unitk[2]*m;
-	vg[kcount][5] = 0.0;
-	kcount++;
-
-	kxvecs[kcount] = k;
-	kyvecs[kcount] = 0;
-	kzvecs[kcount] = -m;
-	ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
-	eg[kcount][0] =  2.0*unitk[0]*k*ug[kcount];
-	eg[kcount][1] =  0.0;
-	eg[kcount][2] = -2.0*unitk[2]*m*ug[kcount];
-	vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
-	vg[kcount][1] = 1.0;
-	vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
-	vg[kcount][3] = 0.0;
-	vg[kcount][4] = -vterm*unitk[0]*k*unitk[2]*m;
-	vg[kcount][5] = 0.0;
-	kcount++;
+        kxvecs[kcount] = k;
+        kyvecs[kcount] = 0;
+        kzvecs[kcount] = m;
+        ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
+        eg[kcount][0] =  2.0*unitk[0]*k*ug[kcount];
+        eg[kcount][1] =  0.0;
+        eg[kcount][2] =  2.0*unitk[2]*m*ug[kcount];
+        vterm = -2.0*(1.0/sqk + 0.25*g_ewald_sq_inv);
+        vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
+        vg[kcount][1] = 1.0;
+        vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
+        vg[kcount][3] = 0.0;
+        vg[kcount][4] = vterm*unitk[0]*k*unitk[2]*m;
+        vg[kcount][5] = 0.0;
+        kcount++;
+
+        kxvecs[kcount] = k;
+        kyvecs[kcount] = 0;
+        kzvecs[kcount] = -m;
+        ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
+        eg[kcount][0] =  2.0*unitk[0]*k*ug[kcount];
+        eg[kcount][1] =  0.0;
+        eg[kcount][2] = -2.0*unitk[2]*m*ug[kcount];
+        vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
+        vg[kcount][1] = 1.0;
+        vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
+        vg[kcount][3] = 0.0;
+        vg[kcount][4] = -vterm*unitk[0]*k*unitk[2]*m;
+        vg[kcount][5] = 0.0;
+        kcount++;
       }
     }
   }
@@ -804,77 +804,77 @@ void Ewald::coeffs()
   for (k = 1; k <= kxmax; k++) {
     for (l = 1; l <= kymax; l++) {
       for (m = 1; m <= kzmax; m++) {
-	sqk = (unitk[0]*k) * (unitk[0]*k) + (unitk[1]*l) * (unitk[1]*l) + 
-	  (unitk[2]*m) * (unitk[2]*m);
-	if (sqk <= gsqmx) {
-	  kxvecs[kcount] = k;
-	  kyvecs[kcount] = l;
-	  kzvecs[kcount] = m;
-	  ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
-	  eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
-	  eg[kcount][1] = 2.0*unitk[1]*l*ug[kcount];
-	  eg[kcount][2] = 2.0*unitk[2]*m*ug[kcount];
-	  vterm = -2.0*(1.0/sqk + 0.25*g_ewald_sq_inv);
-	  vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
-	  vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
-	  vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
-	  vg[kcount][3] = vterm*unitk[0]*k*unitk[1]*l;
-	  vg[kcount][4] = vterm*unitk[0]*k*unitk[2]*m;
-	  vg[kcount][5] = vterm*unitk[1]*l*unitk[2]*m;
-	  kcount++;
-
-	  kxvecs[kcount] = k;
-	  kyvecs[kcount] = -l;
-	  kzvecs[kcount] = m;
-	  ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
-	  eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
-	  eg[kcount][1] = -2.0*unitk[1]*l*ug[kcount];
-	  eg[kcount][2] = 2.0*unitk[2]*m*ug[kcount];
-	  vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
-	  vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
-	  vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
-	  vg[kcount][3] = -vterm*unitk[0]*k*unitk[1]*l;
-	  vg[kcount][4] = vterm*unitk[0]*k*unitk[2]*m;
-	  vg[kcount][5] = -vterm*unitk[1]*l*unitk[2]*m;
-	  kcount++;
-
-	  kxvecs[kcount] = k;
-	  kyvecs[kcount] = l;
-	  kzvecs[kcount] = -m;
-	  ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
-	  eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
-	  eg[kcount][1] = 2.0*unitk[1]*l*ug[kcount];
-	  eg[kcount][2] = -2.0*unitk[2]*m*ug[kcount];
-	  vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
-	  vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
-	  vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
-	  vg[kcount][3] = vterm*unitk[0]*k*unitk[1]*l;
-	  vg[kcount][4] = -vterm*unitk[0]*k*unitk[2]*m;
-	  vg[kcount][5] = -vterm*unitk[1]*l*unitk[2]*m;
-	  kcount++;
-
-	  kxvecs[kcount] = k;
-	  kyvecs[kcount] = -l;
-	  kzvecs[kcount] = -m;
-	  ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
-	  eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
-	  eg[kcount][1] = -2.0*unitk[1]*l*ug[kcount];
-	  eg[kcount][2] = -2.0*unitk[2]*m*ug[kcount];
-	  vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
-	  vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
-	  vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
-	  vg[kcount][3] = -vterm*unitk[0]*k*unitk[1]*l;
-	  vg[kcount][4] = -vterm*unitk[0]*k*unitk[2]*m;
-	  vg[kcount][5] = vterm*unitk[1]*l*unitk[2]*m;
-	  kcount++;
-	}
+        sqk = (unitk[0]*k) * (unitk[0]*k) + (unitk[1]*l) * (unitk[1]*l) +
+          (unitk[2]*m) * (unitk[2]*m);
+        if (sqk <= gsqmx) {
+          kxvecs[kcount] = k;
+          kyvecs[kcount] = l;
+          kzvecs[kcount] = m;
+          ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
+          eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
+          eg[kcount][1] = 2.0*unitk[1]*l*ug[kcount];
+          eg[kcount][2] = 2.0*unitk[2]*m*ug[kcount];
+          vterm = -2.0*(1.0/sqk + 0.25*g_ewald_sq_inv);
+          vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
+          vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
+          vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
+          vg[kcount][3] = vterm*unitk[0]*k*unitk[1]*l;
+          vg[kcount][4] = vterm*unitk[0]*k*unitk[2]*m;
+          vg[kcount][5] = vterm*unitk[1]*l*unitk[2]*m;
+          kcount++;
+
+          kxvecs[kcount] = k;
+          kyvecs[kcount] = -l;
+          kzvecs[kcount] = m;
+          ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
+          eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
+          eg[kcount][1] = -2.0*unitk[1]*l*ug[kcount];
+          eg[kcount][2] = 2.0*unitk[2]*m*ug[kcount];
+          vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
+          vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
+          vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
+          vg[kcount][3] = -vterm*unitk[0]*k*unitk[1]*l;
+          vg[kcount][4] = vterm*unitk[0]*k*unitk[2]*m;
+          vg[kcount][5] = -vterm*unitk[1]*l*unitk[2]*m;
+          kcount++;
+
+          kxvecs[kcount] = k;
+          kyvecs[kcount] = l;
+          kzvecs[kcount] = -m;
+          ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
+          eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
+          eg[kcount][1] = 2.0*unitk[1]*l*ug[kcount];
+          eg[kcount][2] = -2.0*unitk[2]*m*ug[kcount];
+          vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
+          vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
+          vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
+          vg[kcount][3] = vterm*unitk[0]*k*unitk[1]*l;
+          vg[kcount][4] = -vterm*unitk[0]*k*unitk[2]*m;
+          vg[kcount][5] = -vterm*unitk[1]*l*unitk[2]*m;
+          kcount++;
+
+          kxvecs[kcount] = k;
+          kyvecs[kcount] = -l;
+          kzvecs[kcount] = -m;
+          ug[kcount] = preu*exp(-0.25*sqk*g_ewald_sq_inv)/sqk;
+          eg[kcount][0] = 2.0*unitk[0]*k*ug[kcount];
+          eg[kcount][1] = -2.0*unitk[1]*l*ug[kcount];
+          eg[kcount][2] = -2.0*unitk[2]*m*ug[kcount];
+          vg[kcount][0] = 1.0 + vterm*(unitk[0]*k)*(unitk[0]*k);
+          vg[kcount][1] = 1.0 + vterm*(unitk[1]*l)*(unitk[1]*l);
+          vg[kcount][2] = 1.0 + vterm*(unitk[2]*m)*(unitk[2]*m);
+          vg[kcount][3] = -vterm*unitk[0]*k*unitk[1]*l;
+          vg[kcount][4] = -vterm*unitk[0]*k*unitk[2]*m;
+          vg[kcount][5] = vterm*unitk[1]*l*unitk[2]*m;
+          kcount++;
+        }
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   allocate memory that depends on # of K-vectors 
+   allocate memory that depends on # of K-vectors
 ------------------------------------------------------------------------- */
 
 void Ewald::allocate()
@@ -894,7 +894,7 @@ void Ewald::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   deallocate memory that depends on # of K-vectors 
+   deallocate memory that depends on # of K-vectors
 ------------------------------------------------------------------------- */
 
 void Ewald::deallocate()
@@ -902,7 +902,7 @@ void Ewald::deallocate()
   delete [] kxvecs;
   delete [] kyvecs;
   delete [] kzvecs;
-  
+
   delete [] ug;
   memory->destroy(eg);
   memory->destroy(vg);
@@ -915,51 +915,51 @@ void Ewald::deallocate()
 
 /* ----------------------------------------------------------------------
    Slab-geometry correction term to dampen inter-slab interactions between
-   periodically repeating slabs.  Yields good approximation to 2-D Ewald if 
-   adequate empty space is left between repeating slabs (J. Chem. Phys. 
-   111, 3155).  Slabs defined here to be parallel to the xy plane. 
+   periodically repeating slabs.  Yields good approximation to 2-D Ewald if
+   adequate empty space is left between repeating slabs (J. Chem. Phys.
+   111, 3155).  Slabs defined here to be parallel to the xy plane.
 ------------------------------------------------------------------------- */
 
 void Ewald::slabcorr()
 {
   // compute local contribution to global dipole moment
-  
+
   double *q = atom->q;
   double **x = atom->x;
   int nlocal = atom->nlocal;
 
   double dipole = 0.0;
   for (int i = 0; i < nlocal; i++) dipole += q[i]*x[i][2];
-  
+
   // sum local contributions to get global dipole moment
 
   double dipole_all;
   MPI_Allreduce(&dipole,&dipole_all,1,MPI_DOUBLE,MPI_SUM,world);
 
   // compute corrections
-  
+
   const double e_slabcorr = 2.0*MY_PI*dipole_all*dipole_all/volume;
   const double qscale = force->qqrd2e * scale;
-  
+
   if (eflag_global) energy += qscale * e_slabcorr;
-  
+
   // per-atom energy
-    
+
   if (eflag_atom) {
-    double efact = 2.0*MY_PI*dipole_all/volume; 
+    double efact = 2.0*MY_PI*dipole_all/volume;
     for (int i = 0; i < nlocal; i++) eatom[i] += qscale * q[i]*x[i][2]*efact;
   }
 
   // add on force corrections
 
-  double ffact = -4.0*MY_PI*dipole_all/volume; 
+  double ffact = -4.0*MY_PI*dipole_all/volume;
   double **f = atom->f;
 
   for (int i = 0; i < nlocal; i++) f[i][2] += qscale * q[i]*ffact;
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local arrays 
+   memory usage of local arrays
 ------------------------------------------------------------------------- */
 
 double Ewald::memory_usage()
@@ -982,76 +982,76 @@ double Ewald::memory_usage()
 
 void Ewald::compute_group_group(int groupbit_A, int groupbit_B, int BA_flag)
 {
-  if (slabflag) 
+  if (slabflag)
     error->all(FLERR,"Cannot (yet) use Kspace slab correction "
-	       "with compute group/group");  
-    
+               "with compute group/group");
+
   int i,k;
 
   if (!group_allocate_flag) {
     allocate_groups();
     group_allocate_flag = 1;
-  }    
-    
+  }
+
   e2group = 0; //energy
   f2group[0] = 0; //force in x-direction
   f2group[1] = 0; //force in y-direction
   f2group[2] = 0; //force in z-direction
-    
-  // partial and total structure factors for groups A and B    
-    
+
+  // partial and total structure factors for groups A and B
+
   for (k = 0; k < kcount; k++) {
-    
+
     // group A
-      
+
     sfacrl_A[k] = 0;
     sfacim_A[k] = 0;
     sfacrl_A_all[k] = 0;
     sfacim_A_all[k] = 0;
-      
-    // group B  
-      
+
+    // group B
+
     sfacrl_B[k] = 0;
     sfacim_B[k] = 0;
     sfacrl_B_all[k] = 0;
     sfacim_B_all[k] = 0;
   }
-    
+
   double *q = atom->q;
   int nlocal = atom->nlocal;
   int *mask = atom->mask;
-    
+
   int kx,ky,kz;
   double cypz,sypz,exprl,expim;
-     
+
   // partial structure factors for groups A and B on each processor
-    
+
   for (k = 0; k < kcount; k++) {
     kx = kxvecs[k];
     ky = kyvecs[k];
     kz = kzvecs[k];
-        
+
     for (i = 0; i < nlocal; i++) {
-        
+
       if ((mask[i] & groupbit_A) && (mask[i] & groupbit_B))
         if (BA_flag) continue;
-        
-      if ((mask[i] & groupbit_A) || (mask[i] & groupbit_B)) {  
-          
+
+      if ((mask[i] & groupbit_A) || (mask[i] & groupbit_B)) {
+
         cypz = cs[ky][1][i]*cs[kz][2][i] - sn[ky][1][i]*sn[kz][2][i];
         sypz = sn[ky][1][i]*cs[kz][2][i] + cs[ky][1][i]*sn[kz][2][i];
         exprl = cs[kx][0][i]*cypz - sn[kx][0][i]*sypz;
         expim = sn[kx][0][i]*cypz + cs[kx][0][i]*sypz;
-        
+
         // group A
-        
+
         if (mask[i] & groupbit_A) {
           sfacrl_A[k] += q[i]*exprl;
           sfacim_A[k] += q[i]*expim;
-        } 
-        
+        }
+
         // group B
-        
+
         if (mask[i] & groupbit_B) {
           sfacrl_B[k] += q[i]*exprl;
           sfacim_B[k] += q[i]*expim;
@@ -1059,39 +1059,39 @@ void Ewald::compute_group_group(int groupbit_A, int groupbit_B, int BA_flag)
       }
     }
   }
-    
-  // total structure factor by summing over procs    
-    
+
+  // total structure factor by summing over procs
+
   MPI_Allreduce(sfacrl_A,sfacrl_A_all,kcount,MPI_DOUBLE,MPI_SUM,world);
   MPI_Allreduce(sfacim_A,sfacim_A_all,kcount,MPI_DOUBLE,MPI_SUM,world);
-    
+
   MPI_Allreduce(sfacrl_B,sfacrl_B_all,kcount,MPI_DOUBLE,MPI_SUM,world);
   MPI_Allreduce(sfacim_B,sfacim_B_all,kcount,MPI_DOUBLE,MPI_SUM,world);
-    
-  const double qscale = force->qqrd2e * scale; 
+
+  const double qscale = force->qqrd2e * scale;
   double partial_group;
-    
+
   // total group A <--> group B energy
   // self and boundary correction terms are in compute_group_group.cpp
-    
+
   for (k = 0; k < kcount; k++) {
-    partial_group = sfacrl_A_all[k]*sfacrl_B_all[k] + 
+    partial_group = sfacrl_A_all[k]*sfacrl_B_all[k] +
       sfacim_A_all[k]*sfacim_B_all[k];
     e2group += ug[k]*partial_group;
-  } 
-  
+  }
+
   e2group *= qscale;
-    
+
   // total group A <--> group B force
-    
+
   for (k = 0; k < kcount; k++) {
-    partial_group = sfacim_A_all[k]*sfacrl_B_all[k] - 
+    partial_group = sfacim_A_all[k]*sfacrl_B_all[k] -
       sfacrl_A_all[k]*sfacim_B_all[k];
     f2group[0] += eg[k][0]*partial_group;
     f2group[1] += eg[k][1]*partial_group;
     f2group[2] += eg[k][2]*partial_group;
   }
-    
+
   f2group[0] *= qscale;
   f2group[1] *= qscale;
   f2group[2] *= qscale;
@@ -1102,16 +1102,16 @@ void Ewald::compute_group_group(int groupbit_A, int groupbit_B, int BA_flag)
 ------------------------------------------------------------------------- */
 
 void Ewald::allocate_groups()
-{   
+{
   // group A
-    
+
   sfacrl_A = new double[kmax3d];
   sfacim_A = new double[kmax3d];
   sfacrl_A_all = new double[kmax3d];
   sfacim_A_all = new double[kmax3d];
-    
+
   // group B
-    
+
   sfacrl_B = new double[kmax3d];
   sfacim_B = new double[kmax3d];
   sfacrl_B_all = new double[kmax3d];
@@ -1125,14 +1125,14 @@ void Ewald::allocate_groups()
 void Ewald::deallocate_groups()
 {
   // group A
-    
+
   delete [] sfacrl_A;
   delete [] sfacim_A;
   delete [] sfacrl_A_all;
   delete [] sfacim_A_all;
-    
+
   // group B
-    
+
   delete [] sfacrl_B;
   delete [] sfacim_B;
   delete [] sfacrl_B_all;
diff --git a/src/KSPACE/ewald.h b/src/KSPACE/ewald.h
index e8cbdecf15..fbeb812cb8 100644
--- a/src/KSPACE/ewald.h
+++ b/src/KSPACE/ewald.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/KSPACE/fft3d.cpp b/src/KSPACE/fft3d.cpp
index e3dbc63b1e..084c524f0b 100644
--- a/src/KSPACE/fft3d.cpp
+++ b/src/KSPACE/fft3d.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -14,8 +14,8 @@
 /* ----------------------------------------------------------------------
    Contributing authors: Jim Shepherd (GA Tech) added SGI SCSL support
                          Axel Kohlmeyer (Temple U) added support for
-			 FFTW3, KISSFFT, Dfti/MKL, and ACML.
-			 Phil Blood (PSC) added single precision FFT.
+                         FFTW3, KISSFFT, Dfti/MKL, and ACML.
+                         Phil Blood (PSC) added single precision FFT.
 ------------------------------------------------------------------------- */
 
 #include "mpi.h"
@@ -42,9 +42,9 @@
    my subsection must not overlap with any other proc's subsection,
      i.e. the union of all proc's input (or output) subsections must
      exactly tile the global Nfast x Nmid x Nslow data set
-   when called from C, all subsection indices are 
+   when called from C, all subsection indices are
      C-style from 0 to N-1 where N = Nfast or Nmid or Nslow
-   when called from F77, all subsection indices are 
+   when called from F77, all subsection indices are
      F77-style from 1 to N where N = Nfast or Nmid or Nslow
    a proc can own 0 elements on input or output
      by specifying hi index < lo index
@@ -53,7 +53,7 @@
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Perform 3d FFT 
+   Perform 3d FFT
 
    Arguments:
    in           starting address of input data on this proc
@@ -69,7 +69,7 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
   FFT_SCALAR norm, *out_ptr;
   FFT_DATA *data,*copy;
 
-  // system specific constants 
+  // system specific constants
 
 #if defined(FFT_SCSL)
   int isys = 0;
@@ -91,19 +91,19 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
 #endif
 
   // pre-remap to prepare for 1st FFTs if needed
-  // copy = loc for remap result 
+  // copy = loc for remap result
 
   if (plan->pre_plan) {
     if (plan->pre_target == 0) copy = out;
     else copy = plan->copy;
     remap_3d((FFT_SCALAR *) in, (FFT_SCALAR *) copy, (FFT_SCALAR *) plan->scratch,
-	     plan->pre_plan);
+             plan->pre_plan);
     data = copy;
   }
   else
     data = in;
 
-  // 1d FFTs along fast axis 
+  // 1d FFTs along fast axis
 
   total = plan->total1;
   length = plan->length1;
@@ -114,7 +114,7 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
 #elif defined(FFT_SCSL)
   for (offset = 0; offset < total; offset += length)
     FFT_1D(flag,length,scalef,&data[offset],&data[offset],plan->coeff1,
-	   plan->work1,&isys);
+           plan->work1,&isys);
 #elif defined(FFT_ACML)
   num=total/length;
   FFT_1D(&flag,&num,&length,data,plan->coeff1,&info);
@@ -136,7 +136,7 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
 #elif defined(FFT_T3E)
   for (offset = 0; offset < total; offset += length)
     FFT_1D(&flag,&length,&scalef,&data[offset],&data[offset],plan->coeff1,
-	   plan->work1,&isys);
+           plan->work1,&isys);
 #elif defined(FFT_FFTW2)
   if (flag == -1)
     fftw(plan->plan_fast_forward,total/length,data,1,length,NULL,0,0);
@@ -158,15 +158,15 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
 #endif
 
   // 1st mid-remap to prepare for 2nd FFTs
-  // copy = loc for remap result 
+  // copy = loc for remap result
 
   if (plan->mid1_target == 0) copy = out;
   else copy = plan->copy;
   remap_3d((FFT_SCALAR *) data, (FFT_SCALAR *) copy, (FFT_SCALAR *) plan->scratch,
-	   plan->mid1_plan);
+           plan->mid1_plan);
   data = copy;
 
-  // 1d FFTs along mid axis 
+  // 1d FFTs along mid axis
 
   total = plan->total2;
   length = plan->length2;
@@ -177,7 +177,7 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
 #elif defined(FFT_SCSL)
   for (offset = 0; offset < total; offset += length)
     FFT_1D(flag,length,scalef,&data[offset],&data[offset],plan->coeff2,
-	   plan->work2,&isys);
+           plan->work2,&isys);
 #elif defined(FFT_ACML)
   num=total/length;
   FFT_1D(&flag,&num,&length,data,plan->coeff2,&info);
@@ -199,7 +199,7 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
 #elif defined(FFT_T3E)
   for (offset = 0; offset < total; offset += length)
     FFT_1D(&flag,&length,&scalef,&data[offset],&data[offset],plan->coeff2,
-	   plan->work2,&isys);
+           plan->work2,&isys);
 #elif defined(FFT_FFTW2)
   if (flag == -1)
     fftw(plan->plan_mid_forward,total/length,data,1,length,NULL,0,0);
@@ -221,15 +221,15 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
 #endif
 
   // 2nd mid-remap to prepare for 3rd FFTs
-  // copy = loc for remap result 
+  // copy = loc for remap result
 
   if (plan->mid2_target == 0) copy = out;
   else copy = plan->copy;
   remap_3d((FFT_SCALAR *) data, (FFT_SCALAR *) copy, (FFT_SCALAR *) plan->scratch,
-	   plan->mid2_plan);
+           plan->mid2_plan);
   data = copy;
 
-  // 1d FFTs along slow axis 
+  // 1d FFTs along slow axis
 
   total = plan->total3;
   length = plan->length3;
@@ -240,7 +240,7 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
 #elif defined(FFT_SCSL)
   for (offset = 0; offset < total; offset += length)
     FFT_1D(flag,length,scalef,&data[offset],&data[offset],plan->coeff3,
-	   plan->work3,&isys);
+           plan->work3,&isys);
 #elif defined(FFT_ACML)
   num=total/length;
   FFT_1D(&flag,&num,&length,data,plan->coeff3,&info);
@@ -262,7 +262,7 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
 #elif defined(FFT_T3E)
   for (offset = 0; offset < total; offset += length)
     FFT_1D(&flag,&length,&scalef,&data[offset],&data[offset],plan->coeff3,
-	   plan->work3,&isys);
+           plan->work3,&isys);
 #elif defined(FFT_FFTW2)
   if (flag == -1)
     fftw(plan->plan_slow_forward,total/length,data,1,length,NULL,0,0);
@@ -284,13 +284,13 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
 #endif
 
   // post-remap to put data in output format if needed
-  // destination is always out 
+  // destination is always out
 
   if (plan->post_plan)
     remap_3d((FFT_SCALAR *) data, (FFT_SCALAR *) out, (FFT_SCALAR *) plan->scratch,
-	     plan->post_plan);
+             plan->post_plan);
 
-  // scaling if required 
+  // scaling if required
 #if !defined(FFT_T3E) && !defined(FFT_ACML)
   if (flag == 1 && plan->scaled) {
     norm = plan->norm;
@@ -330,7 +330,7 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
 }
 
 /* ----------------------------------------------------------------------
-   Create plan for performing a 3d FFT 
+   Create plan for performing a 3d FFT
 
    Arguments:
    comm                 MPI communicator for the P procs which own the data
@@ -344,8 +344,8 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan)
    scaled               0 = no scaling of result, 1 = scaling
    permute              permutation in storage order of indices on output
                           0 = no permutation
-			  1 = permute once = mid->fast, slow->mid, fast->slow
-			  2 = permute twice = slow->fast, fast->mid, mid->slow
+                          1 = permute once = mid->fast, slow->mid, fast->slow
+                          2 = permute twice = slow->fast, fast->mid, mid->slow
    nbuf                 returns size of internal storage buffers used by FFT
 ------------------------------------------------------------------------- */
 
@@ -367,7 +367,7 @@ struct fft_plan_3d *fft_3d_create_plan(
   int np1,np2,ip1,ip2;
   int list[50];
 
-  // system specific variables 
+  // system specific variables
 
 #ifdef FFT_SCSL
   FFT_DATA dummy_d[5];
@@ -384,25 +384,25 @@ struct fft_plan_3d *fft_3d_create_plan(
   double scalef;
 #endif
 
-  // query MPI info 
+  // query MPI info
 
   MPI_Comm_rank(comm,&me);
   MPI_Comm_size(comm,&nprocs);
 
-  // compute division of procs in 2 dimensions not on-processor 
+  // compute division of procs in 2 dimensions not on-processor
 
   bifactor(nprocs,&np1,&np2);
   ip1 = me % np1;
   ip2 = me/np1;
 
-  // allocate memory for plan data struct 
+  // allocate memory for plan data struct
 
   plan = (struct fft_plan_3d *) malloc(sizeof(struct fft_plan_3d));
   if (plan == NULL) return NULL;
 
   // remap from initial distribution to layout needed for 1st set of 1d FFTs
   // not needed if all procs own entire fast axis initially
-  // first indices = distribution after 1st set of FFTs 
+  // first indices = distribution after 1st set of FFTs
 
   if (in_ilo == 0 && in_ihi == nfast-1)
     flag = 0;
@@ -429,19 +429,19 @@ struct fft_plan_3d *fft_3d_create_plan(
     first_khi = (ip2+1)*nslow/np2 - 1;
     plan->pre_plan =
       remap_3d_create_plan(comm,in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
-			   first_ilo,first_ihi,first_jlo,first_jhi,
-			   first_klo,first_khi,2,0,0,FFT_PRECISION);
+                           first_ilo,first_ihi,first_jlo,first_jhi,
+                           first_klo,first_khi,2,0,0,FFT_PRECISION);
     if (plan->pre_plan == NULL) return NULL;
   }
 
-  // 1d FFTs along fast axis 
+  // 1d FFTs along fast axis
 
   plan->length1 = nfast;
   plan->total1 = nfast * (first_jhi-first_jlo+1) * (first_khi-first_klo+1);
 
   // remap from 1st to 2nd FFT
   // choose which axis is split over np1 vs np2 to minimize communication
-  // second indices = distribution after 2nd set of FFTs 
+  // second indices = distribution after 2nd set of FFTs
 
   second_ilo = ip1*nfast/np1;
   second_ihi = (ip1+1)*nfast/np1 - 1;
@@ -451,13 +451,13 @@ struct fft_plan_3d *fft_3d_create_plan(
   second_khi = (ip2+1)*nslow/np2 - 1;
   plan->mid1_plan =
       remap_3d_create_plan(comm,
-			   first_ilo,first_ihi,first_jlo,first_jhi,
-			   first_klo,first_khi,
-			   second_ilo,second_ihi,second_jlo,second_jhi,
-			   second_klo,second_khi,2,1,0,FFT_PRECISION);
+                           first_ilo,first_ihi,first_jlo,first_jhi,
+                           first_klo,first_khi,
+                           second_ilo,second_ihi,second_jlo,second_jhi,
+                           second_klo,second_khi,2,1,0,FFT_PRECISION);
   if (plan->mid1_plan == NULL) return NULL;
 
-  // 1d FFTs along mid axis 
+  // 1d FFTs along mid axis
 
   plan->length2 = nmid;
   plan->total2 = (second_ihi-second_ilo+1) * nmid * (second_khi-second_klo+1);
@@ -465,7 +465,7 @@ struct fft_plan_3d *fft_3d_create_plan(
   // remap from 2nd to 3rd FFT
   // if final distribution is permute=2 with all procs owning entire slow axis
   //   then this remapping goes directly to final distribution
-  //  third indices = distribution after 3rd set of FFTs 
+  //  third indices = distribution after 3rd set of FFTs
 
   if (permute == 2 && out_klo == 0 && out_khi == nslow-1)
     flag = 0;
@@ -490,22 +490,22 @@ struct fft_plan_3d *fft_3d_create_plan(
     third_klo = 0;
     third_khi = nslow - 1;
   }
-  
+
   plan->mid2_plan =
     remap_3d_create_plan(comm,
-			 second_jlo,second_jhi,second_klo,second_khi,
-			 second_ilo,second_ihi,
-			 third_jlo,third_jhi,third_klo,third_khi,
-			 third_ilo,third_ihi,2,1,0,FFT_PRECISION);
+                         second_jlo,second_jhi,second_klo,second_khi,
+                         second_ilo,second_ihi,
+                         third_jlo,third_jhi,third_klo,third_khi,
+                         third_ilo,third_ihi,2,1,0,FFT_PRECISION);
   if (plan->mid2_plan == NULL) return NULL;
 
-  // 1d FFTs along slow axis 
+  // 1d FFTs along slow axis
 
   plan->length3 = nslow;
   plan->total3 = (third_ihi-third_ilo+1) * (third_jhi-third_jlo+1) * nslow;
 
   // remap from 3rd FFT to final distribution
-  //  not needed if permute = 2 and third indices = out indices on all procs 
+  //  not needed if permute = 2 and third indices = out indices on all procs
 
   if (permute == 2 &&
       out_ilo == third_ilo && out_ihi == third_ihi &&
@@ -522,10 +522,10 @@ struct fft_plan_3d *fft_3d_create_plan(
   else {
     plan->post_plan =
       remap_3d_create_plan(comm,
-			   third_klo,third_khi,third_ilo,third_ihi,
-			   third_jlo,third_jhi,
-			   out_klo,out_khi,out_ilo,out_ihi,
-			   out_jlo,out_jhi,2,(permute+1)%3,0,FFT_PRECISION);
+                           third_klo,third_khi,third_ilo,third_ihi,
+                           third_jlo,third_jhi,
+                           out_klo,out_khi,out_ilo,out_ihi,
+                           out_jlo,out_jhi,2,(permute+1)%3,0,FFT_PRECISION);
     if (plan->post_plan == NULL) return NULL;
   }
 
@@ -536,14 +536,14 @@ struct fft_plan_3d *fft_3d_create_plan(
   // scratch_size = amount needed internally for remap scratch space
   // for each remap:
   //   out space used for result if big enough, else require copy buffer
-  //   accumulate largest required remap scratch space 
+  //   accumulate largest required remap scratch space
 
   out_size = (out_ihi-out_ilo+1) * (out_jhi-out_jlo+1) * (out_khi-out_klo+1);
-  first_size = (first_ihi-first_ilo+1) * (first_jhi-first_jlo+1) * 
+  first_size = (first_ihi-first_ilo+1) * (first_jhi-first_jlo+1) *
     (first_khi-first_klo+1);
-  second_size = (second_ihi-second_ilo+1) * (second_jhi-second_jlo+1) * 
+  second_size = (second_ihi-second_ilo+1) * (second_jhi-second_jlo+1) *
     (second_khi-second_klo+1);
-  third_size = (third_ihi-third_ilo+1) * (third_jhi-third_jlo+1) * 
+  third_size = (third_ihi-third_ilo+1) * (third_jhi-third_jlo+1) *
     (third_khi-third_klo+1);
 
   copy_size = 0;
@@ -596,8 +596,8 @@ struct fft_plan_3d *fft_3d_create_plan(
   }
   else plan->scratch = NULL;
 
-  // system specific pre-computation of 1d FFT coeffs 
-  // and scaling normalization 
+  // system specific pre-computation of 1d FFT coeffs
+  // and scaling normalization
 
 #if defined(FFT_SGI)
 
@@ -612,7 +612,7 @@ struct fft_plan_3d *fft_3d_create_plan(
   FFT_1D_INIT(nmid,plan->coeff2);
   FFT_1D_INIT(nslow,plan->coeff3);
 
-  if (scaled == 0) 
+  if (scaled == 0)
     plan->scaled = 0;
   else {
     plan->scaled = 1;
@@ -627,14 +627,14 @@ struct fft_plan_3d *fft_3d_create_plan(
   plan->coeff2 = (FFT_PREC *) malloc((2*nmid+30)*sizeof(FFT_PREC));
   plan->coeff3 = (FFT_PREC *) malloc((2*nslow+30)*sizeof(FFT_PREC));
 
-  if (plan->coeff1 == NULL || plan->coeff2 == NULL || 
+  if (plan->coeff1 == NULL || plan->coeff2 == NULL ||
       plan->coeff3 == NULL) return NULL;
 
   plan->work1 = (FFT_PREC *) malloc((2*nfast)*sizeof(FFT_PREC));
   plan->work2 = (FFT_PREC *) malloc((2*nmid)*sizeof(FFT_PREC));
   plan->work3 = (FFT_PREC *) malloc((2*nslow)*sizeof(FFT_PREC));
 
-  if (plan->work1 == NULL || plan->work2 == NULL || 
+  if (plan->work1 == NULL || plan->work2 == NULL ||
       plan->work3 == NULL) return NULL;
 
   isign = 0;
@@ -645,7 +645,7 @@ struct fft_plan_3d *fft_3d_create_plan(
   FFT_1D_INIT(isign,nmid,scalef,dummy_d,dummy_d,plan->coeff2,dummy_p,&isys);
   FFT_1D_INIT(isign,nslow,scalef,dummy_d,dummy_d,plan->coeff3,dummy_p,&isys);
 
-  if (scaled == 0) 
+  if (scaled == 0)
     plan->scaled = 0;
   else {
     plan->scaled = 1;
@@ -711,7 +711,7 @@ struct fft_plan_3d *fft_3d_create_plan(
   plan->coeff2 = (FFT_DATA *) malloc((3*nmid/2+1)*sizeof(FFT_DATA));
   plan->coeff3 = (FFT_DATA *) malloc((3*nslow/2+1)*sizeof(FFT_DATA));
 
-  if (plan->coeff1 == NULL || plan->coeff2 == NULL || 
+  if (plan->coeff1 == NULL || plan->coeff2 == NULL ||
       plan->coeff3 == NULL) return NULL;
 
   flag = 0;
@@ -776,14 +776,14 @@ struct fft_plan_3d *fft_3d_create_plan(
   plan->coeff2 = (double *) malloc((12*nmid)*sizeof(double));
   plan->coeff3 = (double *) malloc((12*nslow)*sizeof(double));
 
-  if (plan->coeff1 == NULL || plan->coeff2 == NULL || 
+  if (plan->coeff1 == NULL || plan->coeff2 == NULL ||
       plan->coeff3 == NULL) return NULL;
 
   plan->work1 = (double *) malloc((8*nfast)*sizeof(double));
   plan->work2 = (double *) malloc((8*nmid)*sizeof(double));
   plan->work3 = (double *) malloc((8*nslow)*sizeof(double));
 
-  if (plan->work1 == NULL || plan->work2 == NULL || 
+  if (plan->work1 == NULL || plan->work2 == NULL ||
       plan->work3 == NULL) return NULL;
 
   isign = 0;
@@ -794,7 +794,7 @@ struct fft_plan_3d *fft_3d_create_plan(
   FFT_1D_INIT(&isign,&nmid,&scalef,dummy,dummy,plan->coeff2,dummy,&isys);
   FFT_1D_INIT(&isign,&nslow,&scalef,dummy,dummy,plan->coeff3,dummy,&isys);
 
-  if (scaled == 0) 
+  if (scaled == 0)
     plan->scaled = 0;
   else {
     plan->scaled = 1;
@@ -805,9 +805,9 @@ struct fft_plan_3d *fft_3d_create_plan(
 
 #elif defined(FFT_FFTW2)
 
-  plan->plan_fast_forward = 
+  plan->plan_fast_forward =
     fftw_create_plan(nfast,FFTW_FORWARD,FFTW_ESTIMATE | FFTW_IN_PLACE);
-  plan->plan_fast_backward = 
+  plan->plan_fast_backward =
     fftw_create_plan(nfast,FFTW_BACKWARD,FFTW_ESTIMATE | FFTW_IN_PLACE);
 
   if (nmid == nfast) {
@@ -815,9 +815,9 @@ struct fft_plan_3d *fft_3d_create_plan(
     plan->plan_mid_backward = plan->plan_fast_backward;
   }
   else {
-    plan->plan_mid_forward = 
+    plan->plan_mid_forward =
       fftw_create_plan(nmid,FFTW_FORWARD,FFTW_ESTIMATE | FFTW_IN_PLACE);
-    plan->plan_mid_backward = 
+    plan->plan_mid_backward =
       fftw_create_plan(nmid,FFTW_BACKWARD,FFTW_ESTIMATE | FFTW_IN_PLACE);
   }
 
@@ -830,9 +830,9 @@ struct fft_plan_3d *fft_3d_create_plan(
     plan->plan_slow_backward = plan->plan_mid_backward;
   }
   else {
-    plan->plan_slow_forward = 
+    plan->plan_slow_forward =
       fftw_create_plan(nslow,FFTW_FORWARD,FFTW_ESTIMATE | FFTW_IN_PLACE);
-    plan->plan_slow_backward = 
+    plan->plan_slow_backward =
       fftw_create_plan(nslow,FFTW_BACKWARD,FFTW_ESTIMATE | FFTW_IN_PLACE);
   }
 
@@ -846,36 +846,36 @@ struct fft_plan_3d *fft_3d_create_plan(
   }
 
 #elif defined(FFT_FFTW3)
-  plan->plan_fast_forward = 
+  plan->plan_fast_forward =
     FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1,
-			    NULL,&nfast,1,plan->length1,
-			    NULL,&nfast,1,plan->length1,
-			    FFTW_FORWARD,FFTW_ESTIMATE);
-  plan->plan_fast_backward = 
+                            NULL,&nfast,1,plan->length1,
+                            NULL,&nfast,1,plan->length1,
+                            FFTW_FORWARD,FFTW_ESTIMATE);
+  plan->plan_fast_backward =
     FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1,
-			    NULL,&nfast,1,plan->length1,
-			    NULL,&nfast,1,plan->length1,
-			    FFTW_BACKWARD,FFTW_ESTIMATE);
-  plan->plan_mid_forward = 
+                            NULL,&nfast,1,plan->length1,
+                            NULL,&nfast,1,plan->length1,
+                            FFTW_BACKWARD,FFTW_ESTIMATE);
+  plan->plan_mid_forward =
     FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2,
-			    NULL,&nmid,1,plan->length2,
-			    NULL,&nmid,1,plan->length2,
-			    FFTW_FORWARD,FFTW_ESTIMATE);
-  plan->plan_mid_backward = 
+                            NULL,&nmid,1,plan->length2,
+                            NULL,&nmid,1,plan->length2,
+                            FFTW_FORWARD,FFTW_ESTIMATE);
+  plan->plan_mid_backward =
     FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2,
-			    NULL,&nmid,1,plan->length2,
-			    NULL,&nmid,1,plan->length2,
-			    FFTW_BACKWARD,FFTW_ESTIMATE);
-  plan->plan_slow_forward = 
+                            NULL,&nmid,1,plan->length2,
+                            NULL,&nmid,1,plan->length2,
+                            FFTW_BACKWARD,FFTW_ESTIMATE);
+  plan->plan_slow_forward =
     FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3,
-			    NULL,&nslow,1,plan->length3,
-			    NULL,&nslow,1,plan->length3,
-			    FFTW_FORWARD,FFTW_ESTIMATE);
-  plan->plan_slow_backward = 
+                            NULL,&nslow,1,plan->length3,
+                            NULL,&nslow,1,plan->length3,
+                            FFTW_FORWARD,FFTW_ESTIMATE);
+  plan->plan_slow_backward =
     FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3,
-			    NULL,&nslow,1,plan->length3,
-			    NULL,&nslow,1,plan->length3,
-			    FFTW_BACKWARD,FFTW_ESTIMATE);
+                            NULL,&nslow,1,plan->length3,
+                            NULL,&nslow,1,plan->length3,
+                            FFTW_BACKWARD,FFTW_ESTIMATE);
 
   if (scaled == 0)
     plan->scaled = 0;
@@ -926,7 +926,7 @@ struct fft_plan_3d *fft_3d_create_plan(
 }
 
 /* ----------------------------------------------------------------------
-   Destroy a 3d fft plan 
+   Destroy a 3d fft plan
 ------------------------------------------------------------------------- */
 
 void fft_3d_destroy_plan(struct fft_plan_3d *plan)
@@ -1052,7 +1052,7 @@ void factor(int n, int *num, int *list)
 }
 
 /* ----------------------------------------------------------------------
-   divide n into 2 factors of as equal size as possible 
+   divide n into 2 factors of as equal size as possible
 ------------------------------------------------------------------------- */
 
 void bifactor(int n, int *factor1, int *factor2)
@@ -1087,7 +1087,7 @@ void fft_1d_only(FFT_DATA *data, int nsize, int flag, struct fft_plan_3d *plan)
   int i,total,length,offset,num;
   FFT_SCALAR norm, *data_ptr;
 
-  // system specific constants 
+  // system specific constants
 
 #ifdef FFT_SCSL
   int isys = 0;
@@ -1139,13 +1139,13 @@ void fft_1d_only(FFT_DATA *data, int nsize, int flag, struct fft_plan_3d *plan)
 #elif defined(FFT_SCSL)
   for (offset = 0; offset < total1; offset += length1)
     FFT_1D(flag,length1,scalef,&data[offset],&data[offset],plan->coeff1,
-	   plan->work1,&isys);
+           plan->work1,&isys);
   for (offset = 0; offset < total2; offset += length2)
     FFT_1D(flag,length2,scalef,&data[offset],&data[offset],plan->coeff2,
-	   plan->work2,&isys);
+           plan->work2,&isys);
   for (offset = 0; offset < total3; offset += length3)
     FFT_1D(flag,length3,scalef,&data[offset],&data[offset],plan->coeff3,
-	   plan->work3,&isys);
+           plan->work3,&isys);
 #elif defined(FFT_ACML)
   int info=0;
   num=total1/length1;
@@ -1190,13 +1190,13 @@ void fft_1d_only(FFT_DATA *data, int nsize, int flag, struct fft_plan_3d *plan)
 #elif defined(FFT_T3E)
   for (offset = 0; offset < total1; offset += length1)
     FFT_1D(&flag,&length1,&scalef,&data[offset],&data[offset],plan->coeff1,
-	   plan->work1,&isys);
+           plan->work1,&isys);
   for (offset = 0; offset < total2; offset += length2)
     FFT_1D(&flag,&length2,&scalef,&data[offset],&data[offset],plan->coeff2,
-	   plan->work2,&isys);
+           plan->work2,&isys);
   for (offset = 0; offset < total3; offset += length3)
     FFT_1D(&flag,&length3,&scalef,&data[offset],&data[offset],plan->coeff3,
-	   plan->work3,&isys);
+           plan->work3,&isys);
 #elif defined(FFT_FFTW2)
   if (flag == -1) {
     fftw(plan->plan_fast_forward,total1/length1,data,1,0,NULL,0,0);
@@ -1242,7 +1242,7 @@ void fft_1d_only(FFT_DATA *data, int nsize, int flag, struct fft_plan_3d *plan)
   }
 #endif
 
-  // scaling if required 
+  // scaling if required
   // limit num to size of data
 
 #ifndef FFT_T3E
diff --git a/src/KSPACE/fft3d.h b/src/KSPACE/fft3d.h
index 6bef240371..506d98fc9e 100644
--- a/src/KSPACE/fft3d.h
+++ b/src/KSPACE/fft3d.h
@@ -5,16 +5,16 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
-// User-settable FFT precision 
+// User-settable FFT precision
 
-// FFT_PRECISION = 1 is single-precision complex (4-byte real, 4-byte imag) 
-// FFT_PRECISION = 2 is double-precision complex (8-byte real, 8-byte imag) 
+// FFT_PRECISION = 1 is single-precision complex (4-byte real, 4-byte imag)
+// FFT_PRECISION = 2 is double-precision complex (8-byte real, 8-byte imag)
 
 #ifdef FFT_SINGLE
 #define FFT_PRECISION 1
@@ -30,9 +30,9 @@ typedef double FFT_SCALAR;
 #define FFT_FFTW2
 #endif
 
-// ------------------------------------------------------------------------- 
+// -------------------------------------------------------------------------
 
-// Data types for single-precision complex 
+// Data types for single-precision complex
 
 #if FFT_PRECISION == 1
 
@@ -100,7 +100,7 @@ typedef complex single FFT_DATA;
 #define FFT_1D_INIT GGFFT
 extern "C" {
   void GGFFT(int *, int *, double *, FFT_DATA *, FFT_DATA *,
-	     double *, double *, int *);
+             double *, double *, int *);
 }
 
 #elif defined(FFT_FFTW2)
@@ -132,9 +132,9 @@ struct kiss_fft_state;
 typedef struct kiss_fft_state* kiss_fft_cfg;
 #endif
 
-// ------------------------------------------------------------------------- 
+// -------------------------------------------------------------------------
 
-// Data types for double-precision complex 
+// Data types for double-precision complex
 
 #elif FFT_PRECISION == 2
 
@@ -202,7 +202,7 @@ typedef complex double FFT_DATA;
 #define FFT_1D_INIT CCFFT
 extern "C" {
   void CCFFT(int *, int *, double *, FFT_DATA *, FFT_DATA *,
-	     double *, double *, int *);
+             double *, double *, int *);
 }
 
 #elif defined(FFT_FFTW2)
@@ -238,26 +238,26 @@ typedef struct kiss_fft_state* kiss_fft_cfg;
 #error "FFT_PRECISION needs to be either 1 (=single) or 2 (=double)"
 #endif
 
-// ------------------------------------------------------------------------- 
+// -------------------------------------------------------------------------
 
-// details of how to do a 3d FFT 
+// details of how to do a 3d FFT
 
 struct fft_plan_3d {
-  struct remap_plan_3d *pre_plan;       // remap from input -> 1st FFTs 
-  struct remap_plan_3d *mid1_plan;      // remap from 1st -> 2nd FFTs 
-  struct remap_plan_3d *mid2_plan;      // remap from 2nd -> 3rd FFTs 
-  struct remap_plan_3d *post_plan;      // remap from 3rd FFTs -> output 
-  FFT_DATA *copy;                   // memory for remap results (if needed) 
-  FFT_DATA *scratch;                // scratch space for remaps 
-  int total1,total2,total3;         // # of 1st,2nd,3rd FFTs (times length) 
-  int length1,length2,length3;      // length of 1st,2nd,3rd FFTs 
-  int pre_target;                   // where to put remap results 
+  struct remap_plan_3d *pre_plan;       // remap from input -> 1st FFTs
+  struct remap_plan_3d *mid1_plan;      // remap from 1st -> 2nd FFTs
+  struct remap_plan_3d *mid2_plan;      // remap from 2nd -> 3rd FFTs
+  struct remap_plan_3d *post_plan;      // remap from 3rd FFTs -> output
+  FFT_DATA *copy;                   // memory for remap results (if needed)
+  FFT_DATA *scratch;                // scratch space for remaps
+  int total1,total2,total3;         // # of 1st,2nd,3rd FFTs (times length)
+  int length1,length2,length3;      // length of 1st,2nd,3rd FFTs
+  int pre_target;                   // where to put remap results
   int mid1_target,mid2_target;
-  int scaled;                       // whether to scale FFT results 
-  int normnum;                      // # of values to rescale 
-  double norm;                      // normalization factor for rescaling 
+  int scaled;                       // whether to scale FFT results
+  int normnum;                      // # of values to rescale
+  double norm;                      // normalization factor for rescaling
 
-                                    // system specific 1d FFT info 
+                                    // system specific 1d FFT info
 #if defined(FFT_SGI)
   FFT_DATA *coeff1;
   FFT_DATA *coeff2;
@@ -312,7 +312,7 @@ struct fft_plan_3d {
 #endif
 };
 
-// function prototypes 
+// function prototypes
 
 void fft_3d(FFT_DATA *, FFT_DATA *, int, struct fft_plan_3d *);
 struct fft_plan_3d *fft_3d_create_plan(MPI_Comm, int, int, int,
diff --git a/src/KSPACE/fft3d_wrap.cpp b/src/KSPACE/fft3d_wrap.cpp
index ef1298de40..da8445e2b5 100644
--- a/src/KSPACE/fft3d_wrap.cpp
+++ b/src/KSPACE/fft3d_wrap.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -20,16 +20,16 @@ using namespace LAMMPS_NS;
 /* ---------------------------------------------------------------------- */
 
 FFT3d::FFT3d(LAMMPS *lmp, MPI_Comm comm, int nfast, int nmid, int nslow,
-	     int in_ilo, int in_ihi, int in_jlo, int in_jhi,
-	     int in_klo, int in_khi,
-	     int out_ilo, int out_ihi, int out_jlo, int out_jhi,
-	     int out_klo, int out_khi,
-	     int scaled, int permute, int *nbuf) : Pointers(lmp)
+             int in_ilo, int in_ihi, int in_jlo, int in_jhi,
+             int in_klo, int in_khi,
+             int out_ilo, int out_ihi, int out_jlo, int out_jhi,
+             int out_klo, int out_khi,
+             int scaled, int permute, int *nbuf) : Pointers(lmp)
 {
   plan = fft_3d_create_plan(comm,nfast,nmid,nslow,
-			    in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
-			    out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
-			    scaled,permute,nbuf);
+                            in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
+                            out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
+                            scaled,permute,nbuf);
   if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan");
 }
 
diff --git a/src/KSPACE/fft3d_wrap.h b/src/KSPACE/fft3d_wrap.h
index 6b73207be7..bf1cdca8e9 100644
--- a/src/KSPACE/fft3d_wrap.h
+++ b/src/KSPACE/fft3d_wrap.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -22,7 +22,7 @@ namespace LAMMPS_NS {
 class FFT3d : protected Pointers {
  public:
   FFT3d(class LAMMPS *, MPI_Comm,int,int,int,int,int,int,int,int,int,
-	int,int,int,int,int,int,int,int,int *);
+        int,int,int,int,int,int,int,int,int *);
   ~FFT3d();
   void compute(FFT_SCALAR *, FFT_SCALAR *, int);
   void timing1d(FFT_SCALAR *, int, int);
diff --git a/src/KSPACE/kissfft.h b/src/KSPACE/kissfft.h
index 426f30c304..ec6ef97fea 100644
--- a/src/KSPACE/kissfft.h
+++ b/src/KSPACE/kissfft.h
@@ -6,11 +6,11 @@
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
-/* 
+/*
    we use a stripped down KISS FFT as default FFT for LAMMPS
    this code is adapted from kiss_fft_v1_2_9
-   homepage: http://kissfft.sf.net/ 
-   
+   homepage: http://kissfft.sf.net/
+
    changes 2008-2011 by Axel Kohlmeyer <akohlmey@gmail.com>
 */
 #ifndef LMP_FFT_KISSFFT
@@ -23,7 +23,7 @@
 #if defined(_OPENMP)
 #include <omp.h>
 #endif
- 
+
 #ifndef M_PI
 #define M_PI 3.141592653589793238462643383279502884197169399375105820974944
 #endif
@@ -65,7 +65,7 @@
 #define KISS_FFT_MALLOC malloc
 #define KISS_FFT_FREE free
 #define MAXFACTORS 32
-/* e.g. an fft of length 128 has 4 factors 
+/* e.g. an fft of length 128 has 4 factors
  as far as kissfft is concerned: 4*4*4*2  */
 struct kiss_fft_state {
     int nfft;
@@ -76,18 +76,18 @@ struct kiss_fft_state {
 
 #ifdef KISS_FFT_USE_ALLOCA
 // define this to allow use of alloca instead of malloc for temporary buffers
-// Temporary buffers are used in two case: 
+// Temporary buffers are used in two case:
 // 1. FFT sizes that have "bad" factors. i.e. not 2,3 and 5
 // 2. "in-place" FFTs.  Notice the quotes, since kissfft does not really do an in-place transform.
 #include <alloca.h>
 #define  KISS_FFT_TMP_ALLOC(nbytes) alloca(nbytes)
-#define  KISS_FFT_TMP_FREE(ptr) 
+#define  KISS_FFT_TMP_FREE(ptr)
 #else
 #define  KISS_FFT_TMP_ALLOC(nbytes) KISS_FFT_MALLOC(nbytes)
 #define  KISS_FFT_TMP_FREE(ptr) KISS_FFT_FREE(ptr)
 #endif
 
-static kiss_fft_cfg kiss_fft_alloc(int,int,void *,size_t *); 
+static kiss_fft_cfg kiss_fft_alloc(int,int,void *,size_t *);
 static void kiss_fft(kiss_fft_cfg,const FFT_DATA *,FFT_DATA *);
 
 /*
@@ -115,28 +115,28 @@ static void kiss_fft(kiss_fft_cfg,const FFT_DATA *,FFT_DATA *);
 
 #define  C_ADD( res, a,b)\
     do { \
-	    CHECK_OVERFLOW_OP((a).re,+,(b).re)\
-	    CHECK_OVERFLOW_OP((a).im,+,(b).im)\
-	    (res).re=(a).re+(b).re;  (res).im=(a).im+(b).im; \
+            CHECK_OVERFLOW_OP((a).re,+,(b).re)\
+            CHECK_OVERFLOW_OP((a).im,+,(b).im)\
+            (res).re=(a).re+(b).re;  (res).im=(a).im+(b).im; \
     }while(0)
 #define  C_SUB( res, a,b)\
     do { \
-	    CHECK_OVERFLOW_OP((a).re,-,(b).re)\
-	    CHECK_OVERFLOW_OP((a).im,-,(b).im)\
-	    (res).re=(a).re-(b).re;  (res).im=(a).im-(b).im; \
+            CHECK_OVERFLOW_OP((a).re,-,(b).re)\
+            CHECK_OVERFLOW_OP((a).im,-,(b).im)\
+            (res).re=(a).re-(b).re;  (res).im=(a).im-(b).im; \
     }while(0)
 #define C_ADDTO( res , a)\
     do { \
-	    CHECK_OVERFLOW_OP((res).re,+,(a).re)\
-	    CHECK_OVERFLOW_OP((res).im,+,(a).im)\
-	    (res).re += (a).re;  (res).im += (a).im;\
+            CHECK_OVERFLOW_OP((res).re,+,(a).re)\
+            CHECK_OVERFLOW_OP((res).im,+,(a).im)\
+            (res).re += (a).re;  (res).im += (a).im;\
     }while(0)
 
 #define C_SUBFROM( res , a)\
     do {\
-	    CHECK_OVERFLOW_OP((res).re,-,(a).re)\
-	    CHECK_OVERFLOW_OP((res).im,-,(a).im)\
-	    (res).re -= (a).re;  (res).im -= (a).im; \
+            CHECK_OVERFLOW_OP((res).re,-,(a).re)\
+            CHECK_OVERFLOW_OP((res).im,-,(a).im)\
+            (res).re -= (a).re;  (res).im -= (a).im; \
     }while(0)
 
 
@@ -145,10 +145,10 @@ static void kiss_fft(kiss_fft_cfg,const FFT_DATA *,FFT_DATA *);
 #define HALF_OF(x) ((x)*.5)
 
 #define  kf_cexp(x,phase) \
-	do{ \
-		(x)->re = KISS_FFT_COS(phase);\
-		(x)->im = KISS_FFT_SIN(phase);\
-	}while(0)
+        do{ \
+                (x)->re = KISS_FFT_COS(phase);\
+                (x)->im = KISS_FFT_SIN(phase);\
+        }while(0)
 
 static void kf_bfly2(FFT_DATA *Fout, const size_t fstride,
                      const kiss_fft_cfg st, int m)
@@ -362,7 +362,7 @@ static void kf_work(FFT_DATA * Fout, const FFT_DATA *f,
         do {
             /* recursive call:
                DFT of size m*p performed by doing
-               p instances of smaller DFTs of size m, 
+               p instances of smaller DFTs of size m,
                each one takes a decimated version of the input */
             kf_work( Fout , f, fstride*p, in_stride, factors,st);
             f += fstride*in_stride;
@@ -374,15 +374,15 @@ static void kf_work(FFT_DATA * Fout, const FFT_DATA *f,
     /* recombine the p smaller DFTs */
     switch (p) {
       case 2: kf_bfly2(Fout,fstride,st,m); break;
-      case 3: kf_bfly3(Fout,fstride,st,m); break; 
+      case 3: kf_bfly3(Fout,fstride,st,m); break;
       case 4: kf_bfly4(Fout,fstride,st,m); break;
-      case 5: kf_bfly5(Fout,fstride,st,m); break; 
+      case 5: kf_bfly5(Fout,fstride,st,m); break;
       default: kf_bfly_generic(Fout,fstride,st,m,p); break;
     }
 }
 
 /*  facbuf is populated by p1,m1,p2,m2, ...
-    where 
+    where
     p[i] * m[i] = m[i-1]
     m0 = n                  */
 static void kf_factor(int n, int *facbuf)
@@ -391,7 +391,7 @@ static void kf_factor(int n, int *facbuf)
     double floor_sqrt;
     floor_sqrt = floor( sqrt((double)n) );
 
-    /* factor out the remaining powers of 4, powers of 2, 
+    /* factor out the remaining powers of 4, powers of 2,
        and then any other remaining primes */
     do {
         if (nf == MAXFACTORS) p = n; /* make certain that we don't run out of space */
@@ -445,7 +445,7 @@ static kiss_fft_cfg kiss_fft_alloc(int nfft, int inverse_fft, void *mem, size_t
     }
     return st;
 }
-   
+
 static void kiss_fft_stride(kiss_fft_cfg st, const FFT_DATA *fin, FFT_DATA *fout, int in_stride)
 {
     if (fin == fout) {
@@ -454,7 +454,7 @@ static void kiss_fft_stride(kiss_fft_cfg st, const FFT_DATA *fin, FFT_DATA *fout
         FFT_DATA * tmpbuf = (FFT_DATA*)KISS_FFT_TMP_ALLOC( sizeof(FFT_DATA)*st->nfft);
         kf_work(tmpbuf,fin,1,in_stride, st->factors,st);
         memcpy(fout,tmpbuf,sizeof(FFT_DATA)*st->nfft);
-	KISS_FFT_TMP_FREE(tmpbuf);
+        KISS_FFT_TMP_FREE(tmpbuf);
     }else{
         kf_work( fout, fin, 1,in_stride, st->factors,st );
     }
diff --git a/src/KSPACE/pair_born_coul_long.cpp b/src/KSPACE/pair_born_coul_long.cpp
index 88112d5496..3c5bdba226 100644
--- a/src/KSPACE/pair_born_coul_long.cpp
+++ b/src/KSPACE/pair_born_coul_long.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -97,7 +97,7 @@ void PairBornCoulLong::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -123,51 +123,51 @@ void PairBornCoulLong::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-
-	if (rsq < cut_coulsq) {
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
-	  forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
-	    + born3[itype][jtype]*r2inv*r6inv;
-	} else forceborn = 0.0;
-
-	fpair = (forcecoul + factor_lj*forceborn) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = prefactor*erfc;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv 
-	      + d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+
+        if (rsq < cut_coulsq) {
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
+          forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
+            + born3[itype][jtype]*r2inv*r6inv;
+        } else forceborn = 0.0;
+
+        fpair = (forcecoul + factor_lj*forceborn) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            ecoul = prefactor*erfc;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv
+              + d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -223,7 +223,7 @@ void PairBornCoulLong::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
+        if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
   }
 }
 
@@ -282,7 +282,7 @@ double PairBornCoulLong::init_one(int i, int j)
   born1[i][j] = a[i][j]/rho[i][j];
   born2[i][j] = 6.0*c[i][j];
   born3[i][j] = 8.0*d[i][j];
-     
+
   if (offset_flag) {
     double rexp = exp(-cut_lj[i][j]*rhoinv[i][j]);
     offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0) +
@@ -300,19 +300,19 @@ double PairBornCoulLong::init_one(int i, int j)
   born3[j][i] = born3[i][j];
   offset[j][i] = offset[i][j];
 
-  // compute I,J contribution to long-range tail correction 
-  // count total # of atoms of type I and J via Allreduce 
+  // compute I,J contribution to long-range tail correction
+  // count total # of atoms of type I and J via Allreduce
 
-  if (tail_flag) { 
-     int *type = atom->type; 
-     int nlocal = atom->nlocal; 
+  if (tail_flag) {
+     int *type = atom->type;
+     int nlocal = atom->nlocal;
 
-     double count[2],all[2]; 
-     count[0] = count[1] = 0.0; 
-     for (int k = 0; k < nlocal; k++) { 
-       if (type[k] == i) count[0] += 1.0; 
-       if (type[k] == j) count[1] += 1.0; 
-     } 
+     double count[2],all[2];
+     count[0] = count[1] = 0.0;
+     for (int k = 0; k < nlocal; k++) {
+       if (type[k] == i) count[0] += 1.0;
+       if (type[k] == j) count[1] += 1.0;
+     }
      MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
 
      double rho1 = rho[i][j];
@@ -322,15 +322,15 @@ double PairBornCoulLong::init_one(int i, int j)
      double rc2 = rc*rc;
      double rc3 = rc2*rc;
      double rc5 = rc3*rc2;
-     etail_ij = 2.0*MY_PI*all[0]*all[1] * 
-       (a[i][j]*exp((sigma[i][j]-rc)/rho1)*rho1* 
-	(rc2 + 2.0*rho1*rc + 2.0*rho2) - 
-	c[i][j]/(3.0*rc3) + d[i][j]/(5.0*rc5));
-     ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1] * 
-       (-a[i][j]*exp((sigma[i][j]-rc)/rho1) * 
-	(rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) + 
-	2.0*c[i][j]/rc3 - 8.0*d[i][j]/(5.0*rc5)); 
-   } 
+     etail_ij = 2.0*MY_PI*all[0]*all[1] *
+       (a[i][j]*exp((sigma[i][j]-rc)/rho1)*rho1*
+        (rc2 + 2.0*rho1*rc + 2.0*rho2) -
+        c[i][j]/(3.0*rc3) + d[i][j]/(5.0*rc5));
+     ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1] *
+       (-a[i][j]*exp((sigma[i][j]-rc)/rho1) *
+        (rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) +
+        2.0*c[i][j]/rc3 - 8.0*d[i][j]/(5.0*rc5));
+   }
 
   return cut;
 }
@@ -368,12 +368,12 @@ void PairBornCoulLong::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&a[i][j],sizeof(double),1,fp);
-	fwrite(&rho[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&c[i][j],sizeof(double),1,fp);
-	fwrite(&d[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj[i][j],sizeof(double),1,fp);
+        fwrite(&a[i][j],sizeof(double),1,fp);
+        fwrite(&rho[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&c[i][j],sizeof(double),1,fp);
+        fwrite(&d[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -395,20 +395,20 @@ void PairBornCoulLong::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&a[i][j],sizeof(double),1,fp);
-	  fread(&rho[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&c[i][j],sizeof(double),1,fp);
-	  fread(&d[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&d[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&a[i][j],sizeof(double),1,fp);
+          fread(&rho[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&c[i][j],sizeof(double),1,fp);
+          fread(&d[i][j],sizeof(double),1,fp);
+          fread(&cut_lj[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&d[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -446,9 +446,9 @@ void PairBornCoulLong::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairBornCoulLong::single(int i, int j, int itype, int jtype,
-				double rsq, 
-				double factor_coul, double factor_lj,
-				double &fforce)
+                                double rsq,
+                                double factor_coul, double factor_lj,
+                                double &fforce)
 {
   double r2inv,r6inv,r,rexp,grij,expm2,t,erfc,prefactor;
   double forcecoul,forceborn,phicoul,phiborn;
@@ -472,7 +472,7 @@ double PairBornCoulLong::single(int i, int j, int itype, int jtype,
       born3[itype][jtype]*r2inv*r6inv;
   } else forceborn = 0.0;
   fforce = (forcecoul + factor_lj*forceborn) * r2inv;
-  
+
   double eng = 0.0;
   if (rsq < cut_coulsq) {
     phicoul = prefactor*erfc;
diff --git a/src/KSPACE/pair_born_coul_long.h b/src/KSPACE/pair_born_coul_long.h
index 5debacd85d..5f06a43c97 100644
--- a/src/KSPACE/pair_born_coul_long.h
+++ b/src/KSPACE/pair_born_coul_long.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp
index f3fa4d50d8..393cfc1b9b 100644
--- a/src/KSPACE/pair_buck_coul_long.cpp
+++ b/src/KSPACE/pair_buck_coul_long.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -90,7 +90,7 @@ void PairBuckCoulLong::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -116,50 +116,50 @@ void PairBuckCoulLong::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-
-	if (rsq < cut_coulsq) {
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  rexp = exp(-r*rhoinv[itype][jtype]);
-	  forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
-	} else forcebuck = 0.0;
-
-	fpair = (forcecoul + factor_lj*forcebuck) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = prefactor*erfc;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+
+        if (rsq < cut_coulsq) {
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          rexp = exp(-r*rhoinv[itype][jtype]);
+          forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
+        } else forcebuck = 0.0;
+
+        fpair = (forcecoul + factor_lj*forcebuck) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            ecoul = prefactor*erfc;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -212,7 +212,7 @@ void PairBuckCoulLong::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
+        if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
   }
 }
 
@@ -266,7 +266,7 @@ double PairBuckCoulLong::init_one(int i, int j)
   rhoinv[i][j] = 1.0/rho[i][j];
   buck1[i][j] = a[i][j]/rho[i][j];
   buck2[i][j] = 6.0*c[i][j];
-     
+
   if (offset_flag) {
     double rexp = exp(-cut_lj[i][j]/rho[i][j]);
     offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0);
@@ -280,8 +280,8 @@ double PairBuckCoulLong::init_one(int i, int j)
   buck2[j][i] = buck2[i][j];
   offset[j][i] = offset[i][j];
 
-  // compute I,J contribution to long-range tail correction 
-  // count total # of atoms of type I and J via Allreduce 
+  // compute I,J contribution to long-range tail correction
+  // count total # of atoms of type I and J via Allreduce
 
   if (tail_flag) {
     int *type = atom->type;
@@ -302,13 +302,13 @@ double PairBuckCoulLong::init_one(int i, int j)
     double rc2 = rc*rc;
     double rc3 = rc2*rc;
     etail_ij = 2.0*MY_PI*all[0]*all[1]*
-      (a[i][j]*exp(-rc/rho1)*rho1*(rc2 + 2.0*rho1*rc + 2.0*rho2) - 
+      (a[i][j]*exp(-rc/rho1)*rho1*(rc2 + 2.0*rho1*rc + 2.0*rho2) -
        c[i][j]/(3.0*rc3));
     ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1]*
       (-a[i][j]*exp(-rc/rho1)*
        (rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) + 2.0*c[i][j]/rc3);
   }
-  
+
   return cut;
 }
 
@@ -345,10 +345,10 @@ void PairBuckCoulLong::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&a[i][j],sizeof(double),1,fp);
-	fwrite(&rho[i][j],sizeof(double),1,fp);
-	fwrite(&c[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj[i][j],sizeof(double),1,fp);
+        fwrite(&a[i][j],sizeof(double),1,fp);
+        fwrite(&rho[i][j],sizeof(double),1,fp);
+        fwrite(&c[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -370,16 +370,16 @@ void PairBuckCoulLong::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&a[i][j],sizeof(double),1,fp);
-	  fread(&rho[i][j],sizeof(double),1,fp);
-	  fread(&c[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&a[i][j],sizeof(double),1,fp);
+          fread(&rho[i][j],sizeof(double),1,fp);
+          fread(&c[i][j],sizeof(double),1,fp);
+          fread(&cut_lj[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -417,9 +417,9 @@ void PairBuckCoulLong::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairBuckCoulLong::single(int i, int j, int itype, int jtype,
-				double rsq, 
-				double factor_coul, double factor_lj,
-				double &fforce)
+                                double rsq,
+                                double factor_coul, double factor_lj,
+                                double &fforce)
 {
   double r2inv,r6inv,r,rexp,grij,expm2,t,erfc,prefactor;
   double forcecoul,forcebuck,phicoul,phibuck;
@@ -442,7 +442,7 @@ double PairBuckCoulLong::single(int i, int j, int itype, int jtype,
     forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
   } else forcebuck = 0.0;
   fforce = (forcecoul + factor_lj*forcebuck) * r2inv;
-  
+
   double eng = 0.0;
   if (rsq < cut_coulsq) {
     phicoul = prefactor*erfc;
diff --git a/src/KSPACE/pair_buck_coul_long.h b/src/KSPACE/pair_buck_coul_long.h
index 96de53c26b..17cd53056e 100644
--- a/src/KSPACE/pair_buck_coul_long.h
+++ b/src/KSPACE/pair_buck_coul_long.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/KSPACE/pair_coul_long.cpp b/src/KSPACE/pair_coul_long.cpp
index 0ec33fb711..a9267cf48a 100644
--- a/src/KSPACE/pair_coul_long.cpp
+++ b/src/KSPACE/pair_coul_long.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -91,7 +91,7 @@ void PairCoulLong::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -116,54 +116,54 @@ void PairCoulLong::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cut_coulsq) {
-	r2inv = 1.0/rsq;
-	if (!ncoultablebits || rsq <= tabinnersq) {
-	  r = sqrt(rsq);
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * scale[itype][jtype] * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else {
-	  union_int_float_t rsq_lookup;
-	  rsq_lookup.f = rsq;
-	  itable = rsq_lookup.i & ncoulmask;
-	  itable >>= ncoulshiftbits;
-	  fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	  table = ftable[itable] + fraction*dftable[itable];
-	  forcecoul = scale[itype][jtype] * qtmp*q[j] * table;
-	  if (factor_coul < 1.0) {
-	    table = ctable[itable] + fraction*dctable[itable];
-	    prefactor = scale[itype][jtype] * qtmp*q[j] * table;
-	    forcecoul -= (1.0-factor_coul)*prefactor;
-	  }
-	}
-
-	fpair = forcecoul * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (!ncoultablebits || rsq <= tabinnersq)
-	    ecoul = prefactor*erfc;
-	  else {
-	    table = etable[itable] + fraction*detable[itable];
-	    ecoul = scale[itype][jtype] * qtmp*q[j] * table;
-	  }
-	  if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     0.0,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        if (!ncoultablebits || rsq <= tabinnersq) {
+          r = sqrt(rsq);
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * scale[itype][jtype] * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else {
+          union_int_float_t rsq_lookup;
+          rsq_lookup.f = rsq;
+          itable = rsq_lookup.i & ncoulmask;
+          itable >>= ncoulshiftbits;
+          fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+          table = ftable[itable] + fraction*dftable[itable];
+          forcecoul = scale[itype][jtype] * qtmp*q[j] * table;
+          if (factor_coul < 1.0) {
+            table = ctable[itable] + fraction*dctable[itable];
+            prefactor = scale[itype][jtype] * qtmp*q[j] * table;
+            forcecoul -= (1.0-factor_coul)*prefactor;
+          }
+        }
+
+        fpair = forcecoul * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (!ncoultablebits || rsq <= tabinnersq)
+            ecoul = prefactor*erfc;
+          else {
+            table = etable[itable] + fraction*detable[itable];
+            ecoul = scale[itype][jtype] * qtmp*q[j] * table;
+          }
+          if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             0.0,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -250,7 +250,7 @@ void PairCoulLong::init_style()
 
   // insure use of KSpace long-range solver, set g_ewald
 
- if (force->kspace == NULL) 
+ if (force->kspace == NULL)
     error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
@@ -282,17 +282,17 @@ void PairCoulLong::init_tables()
 
   tabinnersq = tabinner*tabinner;
   init_bitmap(tabinner,cut_coul,ncoultablebits,
-	      masklo,maskhi,ncoulmask,ncoulshiftbits);
-  
+              masklo,maskhi,ncoulmask,ncoulshiftbits);
+
   int ntable = 1;
   for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
-  
+
   // linear lookup tables of length N = 2^ncoultablebits
   // stored value = value at lower edge of bin
   // d values = delta from lower edge to upper edge of bin
 
   if (ftable) free_tables();
-  
+
   memory->create(rtable,ntable,"pair:rtable");
   memory->create(ftable,ntable,"pair:ftable");
   memory->create(ctable,ntable,"pair:ctable");
@@ -316,7 +316,7 @@ void PairCoulLong::init_tables()
   int itablemin;
   minrsq_lookup.i = 0 << ncoulshiftbits;
   minrsq_lookup.i |= maskhi;
-    
+
   for (int i = 0; i < ntable; i++) {
     rsq_lookup.i = i << ncoulshiftbits;
     rsq_lookup.i |= masklo;
@@ -341,23 +341,23 @@ void PairCoulLong::init_tables()
       ptable[i] = qqrd2e/r;
       vtable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
-	if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-	  rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
-	  ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
-	  ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
-	} else {
-	  ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
-	  ctable[i] = qqrd2e/r;
-	}
+        if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
+          ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
+          ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
+        } else {
+          ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
+          ctable[i] = qqrd2e/r;
+        }
       }
     }
     minrsq_lookup.f = MIN(minrsq_lookup.f,rsq_lookup.f);
   }
 
   tabinnersq = minrsq_lookup.f;
-  
+
   int ntablem1 = ntable - 1;
-  
+
   for (int i = 0; i < ntablem1; i++) {
     drtable[i] = 1.0/(rtable[i+1] - rtable[i]);
     dftable[i] = ftable[i+1] - ftable[i];
@@ -371,10 +371,10 @@ void PairCoulLong::init_tables()
       dptable[i] = ptable[i+1] - ptable[i];
     }
   }
-  
-  // get the delta values for the last table entries 
+
+  // get the delta values for the last table entries
   // tables are connected periodically between 0 and ntablem1
-    
+
   drtable[ntablem1] = 1.0/(rtable[0] - rtable[ntablem1]);
   dftable[ntablem1] = ftable[0] - ftable[ntablem1];
   dctable[ntablem1] = ctable[0] - ctable[ntablem1];
@@ -384,23 +384,23 @@ void PairCoulLong::init_tables()
     dptable[ntablem1] = ptable[0] - ptable[ntablem1];
   }
 
-  // get the correct delta values at itablemax    
+  // get the correct delta values at itablemax
   // smallest r is in bin itablemin
   // largest r is in bin itablemax, which is itablemin-1,
   //   or ntablem1 if itablemin=0
   // deltas at itablemax only needed if corresponding rsq < cut*cut
-  // if so, compute deltas between rsq and cut*cut 
+  // if so, compute deltas between rsq and cut*cut
 
   double f_tmp,c_tmp,e_tmp,p_tmp,v_tmp;
   itablemin = minrsq_lookup.i & ncoulmask;
-  itablemin >>= ncoulshiftbits;  
-  int itablemax = itablemin - 1; 
-  if (itablemin == 0) itablemax = ntablem1;     
+  itablemin >>= ncoulshiftbits;
+  int itablemax = itablemin - 1;
+  if (itablemin == 0) itablemax = ntablem1;
   rsq_lookup.i = itablemax << ncoulshiftbits;
   rsq_lookup.i |= maskhi;
 
   if (rsq_lookup.f < cut_coulsq) {
-    rsq_lookup.f = cut_coulsq;  
+    rsq_lookup.f = cut_coulsq;
     r = sqrtf(rsq_lookup.f);
     grij = g_ewald * r;
     expm2 = exp(-grij*grij);
@@ -418,7 +418,7 @@ void PairCoulLong::init_tables()
       v_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
         if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
           f_tmp += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
           c_tmp = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
         } else {
@@ -428,14 +428,14 @@ void PairCoulLong::init_tables()
       }
     }
 
-    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);   
+    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);
     dftable[itablemax] = f_tmp - ftable[itablemax];
     dctable[itablemax] = c_tmp - ctable[itablemax];
     detable[itablemax] = e_tmp - etable[itablemax];
     if (cut_respa) {
       dvtable[itablemax] = v_tmp - vtable[itablemax];
       dptable[itablemax] = p_tmp - ptable[itablemax];
-    }   
+    }
   }
 }
 
@@ -509,9 +509,9 @@ void PairCoulLong::free_tables()
 /* ---------------------------------------------------------------------- */
 
 double PairCoulLong::single(int i, int j, int itype, int jtype,
-			    double rsq,
-			    double factor_coul, double factor_lj,
-			    double &fforce)
+                            double rsq,
+                            double factor_coul, double factor_lj,
+                            double &fforce)
 {
   double r2inv,r,grij,expm2,t,erfc,prefactor;
   double fraction,table,forcecoul,phicoul;
@@ -542,7 +542,7 @@ double PairCoulLong::single(int i, int j, int itype, int jtype,
     }
   }
   fforce = forcecoul * r2inv;
-  
+
   if (!ncoultablebits || rsq <= tabinnersq)
     phicoul = prefactor*erfc;
   else {
diff --git a/src/KSPACE/pair_coul_long.h b/src/KSPACE/pair_coul_long.h
index d67aea8141..ec7398f5a0 100644
--- a/src/KSPACE/pair_coul_long.h
+++ b/src/KSPACE/pair_coul_long.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp
index 8c92048d3d..6f5b589d71 100644
--- a/src/KSPACE/pair_lj_charmm_coul_long.cpp
+++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -108,7 +108,7 @@ void PairLJCharmmCoulLong::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -133,83 +133,83 @@ void PairLJCharmmCoulLong::compute(int eflag, int vflag)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_bothsq) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  jtype = type[j];
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  if (rsq > cut_lj_innersq) {
-	    switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	      (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	    switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	      (rsq-cut_lj_innersq) / denom_lj;
-	    philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	    forcelj = forcelj*switch1 + philj*switch2;
-	  }
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	      evdwl *= switch1;
-	    }
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq) {
+          r6inv = r2inv*r2inv*r2inv;
+          jtype = type[j];
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          if (rsq > cut_lj_innersq) {
+            switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+              (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+            switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+              (rsq-cut_lj_innersq) / denom_lj;
+            philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+            forcelj = forcelj*switch1 + philj*switch2;
+          }
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+              evdwl *= switch1;
+            }
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -244,7 +244,7 @@ void PairLJCharmmCoulLong::compute_inner()
 
   double cut_out_on = cut_respa[0];
   double cut_out_off = cut_respa[1];
-  
+
   double cut_out_diff = cut_out_off - cut_out_on;
   double cut_out_on_sq = cut_out_on*cut_out_on;
   double cut_out_off_sq = cut_out_off*cut_out_off;
@@ -277,15 +277,15 @@ void PairLJCharmmCoulLong::compute_inner()
         forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
         if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*forcecoul;
 
-	r6inv = r2inv*r2inv*r2inv;
-	jtype = type[j];
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        r6inv = r2inv*r2inv*r2inv;
+        jtype = type[j];
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
 
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
 
         if (rsq > cut_out_on_sq) {
-          rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	  fpair *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
+          rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+          fpair *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
         }
 
         f[i][0] += delx*fpair;
@@ -364,40 +364,40 @@ void PairLJCharmmCoulLong::compute_middle()
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_out_off_sq && rsq > cut_in_off_sq) {
-	r2inv = 1.0/rsq;
+        r2inv = 1.0/rsq;
         forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
         if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*forcecoul;
 
-	r6inv = r2inv*r2inv*r2inv;
-	jtype = type[j];
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	if (rsq > cut_lj_innersq) {
-	  switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	    (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	  switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	    (rsq-cut_lj_innersq) / denom_lj;
-	  philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	  forcelj = forcelj*switch1 + philj*switch2;
-	}
-
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+        r6inv = r2inv*r2inv*r2inv;
+        jtype = type[j];
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        if (rsq > cut_lj_innersq) {
+          switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+            (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+          switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+            (rsq-cut_lj_innersq) / denom_lj;
+          philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+          forcelj = forcelj*switch1 + philj*switch2;
+        }
+
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
         if (rsq < cut_in_on_sq) {
-	  rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
-	  fpair *= rsw*rsw*(3.0 - 2.0*rsw);
-	}
+          rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
+          fpair *= rsw*rsw*(3.0 - 2.0*rsw);
+        }
         if (rsq > cut_out_on_sq) {
-	  rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	  fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
-	}
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+          rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+          fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
+        }
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
       }
     }
   }
@@ -430,7 +430,7 @@ void PairLJCharmmCoulLong::compute_outer(int eflag, int vflag)
   double *special_lj = force->special_lj;
   int newton_pair = force->newton_pair;
   double qqrd2e = force->qqrd2e;
-  
+
   inum = listouter->inum;
   ilist = listouter->ilist;
   numneigh = listouter->numneigh;
@@ -460,154 +460,154 @@ void PairLJCharmmCoulLong::compute_outer(int eflag, int vflag)
       factor_lj = special_lj[sbmask(j)];
       factor_coul = special_coul[sbmask(j)];
       j &= NEIGHMASK;
-      
+
       delx = xtmp - x[j][0];
       dely = ytmp - x[j][1];
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq < cut_bothsq) {
-	r2inv = 1.0/rsq;
-	
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2 - 1.0);
-	    if (rsq > cut_in_off_sq) {
-	      if (rsq < cut_in_on_sq) {
-		rsw = (r - cut_in_off)/cut_in_diff; 
-		forcecoul += prefactor*rsw*rsw*(3.0 - 2.0*rsw);
-		if (factor_coul < 1.0)
-		  forcecoul -= 
-		    (1.0-factor_coul)*prefactor*rsw*rsw*(3.0 - 2.0*rsw);
-	      } else {
-		forcecoul += prefactor;
-		if (factor_coul < 1.0)
-		  forcecoul -= (1.0-factor_coul)*prefactor;
-	      }
-	    }
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	} else forcecoul = 0.0;
-	
-	if (rsq < cut_ljsq && rsq > cut_in_off_sq) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  if (rsq > cut_lj_innersq) {
-	    switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	      (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	    switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	      (rsq-cut_lj_innersq) / denom_lj;
-	    philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	    forcelj = forcelj*switch1 + philj*switch2;
-	  }
-	  if (rsq < cut_in_on_sq) {
-	    rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
-	    forcelj *= rsw*rsw*(3.0 - 2.0*rsw);
-	  }
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-	
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-	
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq) {
-	      ecoul = prefactor*erfc;
-	      if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	    } else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	      if (factor_coul < 1.0) {
-		table = ptable[itable] + fraction*dptable[itable];
-		prefactor = qtmp*q[j] * table;
-		ecoul -= (1.0-factor_coul)*prefactor;
-	      }
-	    }
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq) {
-	    r6inv = r2inv*r2inv*r2inv;
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	      evdwl *= switch1;
-	    }
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-	
-	if (vflag) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq) {
-	      forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	      if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	    } else {
-	      table = vtable[itable] + fraction*dvtable[itable];
-	      forcecoul = qtmp*q[j] * table;
-	      if (factor_coul < 1.0) {
-		table = ptable[itable] + fraction*dptable[itable];
-		prefactor = qtmp*q[j] * table;
-		forcecoul -= (1.0-factor_coul)*prefactor;
-	      }
-	    }
-	  } else forcecoul = 0.0;
-
-	  if (rsq <= cut_in_off_sq) {
-	    r6inv = r2inv*r2inv*r2inv;
-	    forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	      switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-		(rsq-cut_lj_innersq) / denom_lj;
-	      philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	      forcelj = forcelj*switch1 + philj*switch2;
-	    }
-	  } else if (rsq <= cut_in_on_sq) {
-	    forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	      switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-		(rsq-cut_lj_innersq) / denom_lj;
-	      philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	      forcelj = forcelj*switch1 + philj*switch2;
-	    }
-	  }
-	  
-	  fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2 - 1.0);
+            if (rsq > cut_in_off_sq) {
+              if (rsq < cut_in_on_sq) {
+                rsw = (r - cut_in_off)/cut_in_diff;
+                forcecoul += prefactor*rsw*rsw*(3.0 - 2.0*rsw);
+                if (factor_coul < 1.0)
+                  forcecoul -=
+                    (1.0-factor_coul)*prefactor*rsw*rsw*(3.0 - 2.0*rsw);
+              } else {
+                forcecoul += prefactor;
+                if (factor_coul < 1.0)
+                  forcecoul -= (1.0-factor_coul)*prefactor;
+              }
+            }
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq && rsq > cut_in_off_sq) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          if (rsq > cut_lj_innersq) {
+            switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+              (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+            switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+              (rsq-cut_lj_innersq) / denom_lj;
+            philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+            forcelj = forcelj*switch1 + philj*switch2;
+          }
+          if (rsq < cut_in_on_sq) {
+            rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
+            forcelj *= rsw*rsw*(3.0 - 2.0*rsw);
+          }
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq) {
+              ecoul = prefactor*erfc;
+              if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+            } else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+              if (factor_coul < 1.0) {
+                table = ptable[itable] + fraction*dptable[itable];
+                prefactor = qtmp*q[j] * table;
+                ecoul -= (1.0-factor_coul)*prefactor;
+              }
+            }
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq) {
+            r6inv = r2inv*r2inv*r2inv;
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+              evdwl *= switch1;
+            }
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (vflag) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq) {
+              forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+              if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+            } else {
+              table = vtable[itable] + fraction*dvtable[itable];
+              forcecoul = qtmp*q[j] * table;
+              if (factor_coul < 1.0) {
+                table = ptable[itable] + fraction*dptable[itable];
+                prefactor = qtmp*q[j] * table;
+                forcecoul -= (1.0-factor_coul)*prefactor;
+              }
+            }
+          } else forcecoul = 0.0;
+
+          if (rsq <= cut_in_off_sq) {
+            r6inv = r2inv*r2inv*r2inv;
+            forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+              switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+                (rsq-cut_lj_innersq) / denom_lj;
+              philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+              forcelj = forcelj*switch1 + philj*switch2;
+            }
+          } else if (rsq <= cut_in_on_sq) {
+            forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+              switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+                (rsq-cut_lj_innersq) / denom_lj;
+              philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+              forcelj = forcelj*switch1 + philj*switch2;
+            }
+          }
+
+          fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -743,7 +743,7 @@ void PairLJCharmmCoulLong::init_style()
 
   // require cut_lj_inner < cut_lj
 
-  if (cut_lj_inner >= cut_lj) 
+  if (cut_lj_inner >= cut_lj)
     error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
 
   cut_lj_innersq = cut_lj_inner * cut_lj_inner;
@@ -751,7 +751,7 @@ void PairLJCharmmCoulLong::init_style()
   cut_coulsq = cut_coul * cut_coul;
   cut_bothsq = MAX(cut_ljsq,cut_coulsq);
 
-  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) * 
+  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) *
     (cut_ljsq-cut_lj_innersq);
 
   // set & error check interior rRESPA cutoffs
@@ -770,7 +770,7 @@ void PairLJCharmmCoulLong::init_style()
   if (force->kspace == NULL)
     error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
-  
+
   // setup force tables
 
   if (ncoultablebits) init_tables();
@@ -797,10 +797,10 @@ double PairLJCharmmCoulLong::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     eps14[i][j] = mix_energy(eps14[i][i],eps14[j][j],
-			       sigma14[i][i],sigma14[j][j]);
+                               sigma14[i][i],sigma14[j][j]);
     sigma14[i][j] = mix_distance(sigma14[i][i],sigma14[j][j]);
   }
 
@@ -814,7 +814,7 @@ double PairLJCharmmCoulLong::init_one(int i, int j)
   lj14_2[i][j] = 24.0 * eps14[i][j] * pow(sigma14[i][j],6.0);
   lj14_3[i][j] = 4.0 * eps14[i][j] * pow(sigma14[i][j],12.0);
   lj14_4[i][j] = 4.0 * eps14[i][j] * pow(sigma14[i][j],6.0);
-     
+
   lj1[j][i] = lj1[i][j];
   lj2[j][i] = lj2[i][j];
   lj3[j][i] = lj3[i][j];
@@ -839,17 +839,17 @@ void PairLJCharmmCoulLong::init_tables()
 
   tabinnersq = tabinner*tabinner;
   init_bitmap(tabinner,cut_coul,ncoultablebits,
-	      masklo,maskhi,ncoulmask,ncoulshiftbits);
-  
+              masklo,maskhi,ncoulmask,ncoulshiftbits);
+
   int ntable = 1;
   for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
-  
+
   // linear lookup tables of length N = 2^ncoultablebits
   // stored value = value at lower edge of bin
   // d values = delta from lower edge to upper edge of bin
 
   if (ftable) free_tables();
-  
+
   memory->create(rtable,ntable,"pair:rtable");
   memory->create(ftable,ntable,"pair:ftable");
   memory->create(ctable,ntable,"pair:ctable");
@@ -873,7 +873,7 @@ void PairLJCharmmCoulLong::init_tables()
   int itablemin;
   minrsq_lookup.i = 0 << ncoulshiftbits;
   minrsq_lookup.i |= maskhi;
-    
+
   for (int i = 0; i < ntable; i++) {
     rsq_lookup.i = i << ncoulshiftbits;
     rsq_lookup.i |= masklo;
@@ -898,23 +898,23 @@ void PairLJCharmmCoulLong::init_tables()
       ptable[i] = qqrd2e/r;
       vtable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
-	if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-	  rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
-	  ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
-	  ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
-	} else {
-	  ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
-	  ctable[i] = qqrd2e/r;
-	}
+        if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
+          ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
+          ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
+        } else {
+          ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
+          ctable[i] = qqrd2e/r;
+        }
       }
     }
     minrsq_lookup.f = MIN(minrsq_lookup.f,rsq_lookup.f);
   }
 
   tabinnersq = minrsq_lookup.f;
-  
+
   int ntablem1 = ntable - 1;
-  
+
   for (int i = 0; i < ntablem1; i++) {
     drtable[i] = 1.0/(rtable[i+1] - rtable[i]);
     dftable[i] = ftable[i+1] - ftable[i];
@@ -928,10 +928,10 @@ void PairLJCharmmCoulLong::init_tables()
       dptable[i] = ptable[i+1] - ptable[i];
     }
   }
-  
-  // get the delta values for the last table entries 
+
+  // get the delta values for the last table entries
   // tables are connected periodically between 0 and ntablem1
-    
+
   drtable[ntablem1] = 1.0/(rtable[0] - rtable[ntablem1]);
   dftable[ntablem1] = ftable[0] - ftable[ntablem1];
   dctable[ntablem1] = ctable[0] - ctable[ntablem1];
@@ -941,23 +941,23 @@ void PairLJCharmmCoulLong::init_tables()
     dptable[ntablem1] = ptable[0] - ptable[ntablem1];
   }
 
-  // get the correct delta values at itablemax    
+  // get the correct delta values at itablemax
   // smallest r is in bin itablemin
   // largest r is in bin itablemax, which is itablemin-1,
   //   or ntablem1 if itablemin=0
   // deltas at itablemax only needed if corresponding rsq < cut*cut
-  // if so, compute deltas between rsq and cut*cut 
-	
+  // if so, compute deltas between rsq and cut*cut
+
   double f_tmp,c_tmp,e_tmp,p_tmp,v_tmp;
   itablemin = minrsq_lookup.i & ncoulmask;
-  itablemin >>= ncoulshiftbits;  
-  int itablemax = itablemin - 1; 
-  if (itablemin == 0) itablemax = ntablem1;     
+  itablemin >>= ncoulshiftbits;
+  int itablemax = itablemin - 1;
+  if (itablemin == 0) itablemax = ntablem1;
   rsq_lookup.i = itablemax << ncoulshiftbits;
   rsq_lookup.i |= maskhi;
 
   if (rsq_lookup.f < cut_coulsq) {
-    rsq_lookup.f = cut_coulsq;  
+    rsq_lookup.f = cut_coulsq;
     r = sqrtf(rsq_lookup.f);
     grij = g_ewald * r;
     expm2 = exp(-grij*grij);
@@ -975,7 +975,7 @@ void PairLJCharmmCoulLong::init_tables()
       v_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
         if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
           f_tmp += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
           c_tmp = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
         } else {
@@ -985,14 +985,14 @@ void PairLJCharmmCoulLong::init_tables()
       }
     }
 
-    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);   
+    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);
     dftable[itablemax] = f_tmp - ftable[itablemax];
     dctable[itablemax] = c_tmp - ctable[itablemax];
     detable[itablemax] = e_tmp - etable[itablemax];
     if (cut_respa) {
       dvtable[itablemax] = v_tmp - vtable[itablemax];
       dptable[itablemax] = p_tmp - ptable[itablemax];
-    }   
+    }
   }
 }
 
@@ -1009,10 +1009,10 @@ void PairLJCharmmCoulLong::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&eps14[i][j],sizeof(double),1,fp);
-	fwrite(&sigma14[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&eps14[i][j],sizeof(double),1,fp);
+        fwrite(&sigma14[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -1034,16 +1034,16 @@ void PairLJCharmmCoulLong::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&eps14[i][j],sizeof(double),1,fp);
-	  fread(&sigma14[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&eps14[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma14[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&eps14[i][j],sizeof(double),1,fp);
+          fread(&sigma14[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&eps14[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma14[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -1104,9 +1104,9 @@ void PairLJCharmmCoulLong::free_tables()
 /* ---------------------------------------------------------------------- */
 
 double PairLJCharmmCoulLong::single(int i, int j, int itype, int jtype,
-				    double rsq,
-				    double factor_coul, double factor_lj,
-				    double &fforce)
+                                    double rsq,
+                                    double factor_coul, double factor_lj,
+                                    double &fforce)
 {
   double r2inv,r6inv,r,grij,expm2,t,erfc,prefactor;
   double switch1,switch2,fraction,table,forcecoul,forcelj,phicoul,philj;
@@ -1132,9 +1132,9 @@ double PairLJCharmmCoulLong::single(int i, int j, int itype, int jtype,
       table = ftable[itable] + fraction*dftable[itable];
       forcecoul = atom->q[i]*atom->q[j] * table;
       if (factor_coul < 1.0) {
-	table = ctable[itable] + fraction*dctable[itable];
-	prefactor = atom->q[i]*atom->q[j] * table;
-	forcecoul -= (1.0-factor_coul)*prefactor;
+        table = ctable[itable] + fraction*dctable[itable];
+        prefactor = atom->q[i]*atom->q[j] * table;
+        forcecoul -= (1.0-factor_coul)*prefactor;
       }
     }
   } else forcecoul = 0.0;
@@ -1143,15 +1143,15 @@ double PairLJCharmmCoulLong::single(int i, int j, int itype, int jtype,
     forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
     if (rsq > cut_lj_innersq) {
       switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-      switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	(rsq-cut_lj_innersq) / denom_lj;
+        (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+      switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+        (rsq-cut_lj_innersq) / denom_lj;
       philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
       forcelj = forcelj*switch1 + philj*switch2;
     }
   } else forcelj = 0.0;
   fforce = (forcecoul + factor_lj*forcelj) * r2inv;
-  
+
   double eng = 0.0;
   if (rsq < cut_coulsq) {
     if (!ncoultablebits || rsq <= tabinnersq)
@@ -1168,7 +1168,7 @@ double PairLJCharmmCoulLong::single(int i, int j, int itype, int jtype,
     philj = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
     if (rsq > cut_lj_innersq) {
       switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+        (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
       philj *= switch1;
     }
     eng += factor_lj*philj;
diff --git a/src/KSPACE/pair_lj_charmm_coul_long.h b/src/KSPACE/pair_lj_charmm_coul_long.h
index 47cf005d76..76c022651c 100644
--- a/src/KSPACE/pair_lj_charmm_coul_long.h
+++ b/src/KSPACE/pair_lj_charmm_coul_long.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp
index 52284ed319..1ebc6d6824 100644
--- a/src/KSPACE/pair_lj_cut_coul_long.cpp
+++ b/src/KSPACE/pair_lj_cut_coul_long.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -105,7 +105,7 @@ void PairLJCutCoulLong::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
- 
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -131,70 +131,70 @@ void PairLJCutCoulLong::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -229,7 +229,7 @@ void PairLJCutCoulLong::compute_inner()
 
   double cut_out_on = cut_respa[0];
   double cut_out_off = cut_respa[1];
-  
+
   double cut_out_diff = cut_out_off - cut_out_on;
   double cut_out_on_sq = cut_out_on*cut_out_on;
   double cut_out_off_sq = cut_out_off*cut_out_off;
@@ -258,30 +258,30 @@ void PairLJCutCoulLong::compute_inner()
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_out_off_sq) {
-	r2inv = 1.0/rsq;
+        r2inv = 1.0/rsq;
         forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
         if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*forcecoul;
 
-	jtype = type[j];
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	} else forcelj = 0.0;
+        jtype = type[j];
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        } else forcelj = 0.0;
 
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
         if (rsq > cut_out_on_sq) {
-          rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	  fpair  *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
+          rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+          fpair  *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
         }
 
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
       }
     }
   }
@@ -348,34 +348,34 @@ void PairLJCutCoulLong::compute_middle()
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_out_off_sq && rsq > cut_in_off_sq) {
-	r2inv = 1.0/rsq;
+        r2inv = 1.0/rsq;
         forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
         if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*forcecoul;
 
-	jtype = type[j];
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	} else forcelj = 0.0;
+        jtype = type[j];
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        } else forcelj = 0.0;
 
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
         if (rsq < cut_in_on_sq) {
-	  rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
-	  fpair *= rsw*rsw*(3.0 - 2.0*rsw);
-	}
+          rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
+          fpair *= rsw*rsw*(3.0 - 2.0*rsw);
+        }
         if (rsq > cut_out_on_sq) {
-	  rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	  fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
-	}
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+          rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+          fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
+        }
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
       }
     }
   }
@@ -445,117 +445,117 @@ void PairLJCutCoulLong::compute_outer(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2 - 1.0);
-	    if (rsq > cut_in_off_sq) {
-	      if (rsq < cut_in_on_sq) {
-	        rsw = (r - cut_in_off)/cut_in_diff; 
-	        forcecoul += prefactor*rsw*rsw*(3.0 - 2.0*rsw);
-	        if (factor_coul < 1.0) 
-		  forcecoul -= 
-		    (1.0-factor_coul)*prefactor*rsw*rsw*(3.0 - 2.0*rsw);
-	      } else {
-	        forcecoul += prefactor;
-	        if (factor_coul < 1.0)
-		  forcecoul -= (1.0-factor_coul)*prefactor;
-	      }
-	    }
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype] && rsq > cut_in_off_sq) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  if (rsq < cut_in_on_sq) {
-	    rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
-	    forcelj *= rsw*rsw*(3.0 - 2.0*rsw);
-	  }
-	} else forcelj = 0.0;
-	
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq) {
-	      ecoul = prefactor*erfc;
-	      if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	    } else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	      if (factor_coul < 1.0) {
-		table = ptable[itable] + fraction*dptable[itable];
-		prefactor = qtmp*q[j] * table;
-		ecoul -= (1.0-factor_coul)*prefactor;
-	      }
-	    }
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    r6inv = r2inv*r2inv*r2inv;
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (vflag) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq) {
-	      forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	      if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	    } else {
-	      table = vtable[itable] + fraction*dvtable[itable];
-	      forcecoul = qtmp*q[j] * table;
-	      if (factor_coul < 1.0) {
-		table = ptable[itable] + fraction*dptable[itable];
-		prefactor = qtmp*q[j] * table;
-		forcecoul -= (1.0-factor_coul)*prefactor;
-	      }
-	    }
-	  } else forcecoul = 0.0;
-	  
-	  if (rsq <= cut_in_off_sq) {
-	    r6inv = r2inv*r2inv*r2inv;
-	    forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  } else if (rsq <= cut_in_on_sq)
-	    forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2 - 1.0);
+            if (rsq > cut_in_off_sq) {
+              if (rsq < cut_in_on_sq) {
+                rsw = (r - cut_in_off)/cut_in_diff;
+                forcecoul += prefactor*rsw*rsw*(3.0 - 2.0*rsw);
+                if (factor_coul < 1.0)
+                  forcecoul -=
+                    (1.0-factor_coul)*prefactor*rsw*rsw*(3.0 - 2.0*rsw);
+              } else {
+                forcecoul += prefactor;
+                if (factor_coul < 1.0)
+                  forcecoul -= (1.0-factor_coul)*prefactor;
+              }
+            }
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype] && rsq > cut_in_off_sq) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          if (rsq < cut_in_on_sq) {
+            rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
+            forcelj *= rsw*rsw*(3.0 - 2.0*rsw);
+          }
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq) {
+              ecoul = prefactor*erfc;
+              if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+            } else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+              if (factor_coul < 1.0) {
+                table = ptable[itable] + fraction*dptable[itable];
+                prefactor = qtmp*q[j] * table;
+                ecoul -= (1.0-factor_coul)*prefactor;
+              }
+            }
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            r6inv = r2inv*r2inv*r2inv;
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (vflag) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq) {
+              forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+              if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+            } else {
+              table = vtable[itable] + fraction*dvtable[itable];
+              forcecoul = qtmp*q[j] * table;
+              if (factor_coul < 1.0) {
+                table = ptable[itable] + fraction*dptable[itable];
+                prefactor = qtmp*q[j] * table;
+                forcecoul -= (1.0-factor_coul)*prefactor;
+              }
+            }
+          } else forcecoul = 0.0;
+
+          if (rsq <= cut_in_off_sq) {
+            r6inv = r2inv*r2inv*r2inv;
+            forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          } else if (rsq <= cut_in_on_sq)
+            forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
 
           fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-	}
+        }
 
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -606,7 +606,7 @@ void PairLJCutCoulLong::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
+        if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
   }
 }
 
@@ -616,7 +616,7 @@ void PairLJCutCoulLong::settings(int narg, char **arg)
 
 void PairLJCutCoulLong::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) 
+  if (narg < 4 || narg > 5)
     error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
@@ -730,7 +730,7 @@ double PairLJCutCoulLong::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut_lj[i][j] = mix_distance(cut_lj[i][i],cut_lj[j][j]);
   }
@@ -776,17 +776,17 @@ double PairLJCutCoulLong::init_one(int i, int j)
       if (type[k] == j) count[1] += 1.0;
     }
     MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
-        
+
     double sig2 = sigma[i][j]*sigma[i][j];
     double sig6 = sig2*sig2*sig2;
     double rc3 = cut_lj[i][j]*cut_lj[i][j]*cut_lj[i][j];
     double rc6 = rc3*rc3;
     double rc9 = rc3*rc6;
-    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
-      sig6 * (sig6 - 3.0*rc6) / (9.0*rc9); 
-    ptail_ij = 16.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
-      sig6 * (2.0*sig6 - 3.0*rc6) / (9.0*rc9); 
-  } 
+    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
+      sig6 * (sig6 - 3.0*rc6) / (9.0*rc9);
+    ptail_ij = 16.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
+      sig6 * (2.0*sig6 - 3.0*rc6) / (9.0*rc9);
+  }
 
   return cut;
 }
@@ -803,17 +803,17 @@ void PairLJCutCoulLong::init_tables()
 
   tabinnersq = tabinner*tabinner;
   init_bitmap(tabinner,cut_coul,ncoultablebits,
-	      masklo,maskhi,ncoulmask,ncoulshiftbits);
-  
+              masklo,maskhi,ncoulmask,ncoulshiftbits);
+
   int ntable = 1;
   for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
-  
+
   // linear lookup tables of length N = 2^ncoultablebits
   // stored value = value at lower edge of bin
   // d values = delta from lower edge to upper edge of bin
 
   if (ftable) free_tables();
-  
+
   memory->create(rtable,ntable,"pair:rtable");
   memory->create(ftable,ntable,"pair:ftable");
   memory->create(ctable,ntable,"pair:ctable");
@@ -837,7 +837,7 @@ void PairLJCutCoulLong::init_tables()
   int itablemin;
   minrsq_lookup.i = 0 << ncoulshiftbits;
   minrsq_lookup.i |= maskhi;
-    
+
   for (int i = 0; i < ntable; i++) {
     rsq_lookup.i = i << ncoulshiftbits;
     rsq_lookup.i |= masklo;
@@ -862,23 +862,23 @@ void PairLJCutCoulLong::init_tables()
       ptable[i] = qqrd2e/r;
       vtable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
-	if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-	  rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
-	  ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
-	  ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
-	} else {
-	  ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
-	  ctable[i] = qqrd2e/r;
-	}
+        if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
+          ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
+          ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
+        } else {
+          ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
+          ctable[i] = qqrd2e/r;
+        }
       }
     }
     minrsq_lookup.f = MIN(minrsq_lookup.f,rsq_lookup.f);
   }
 
   tabinnersq = minrsq_lookup.f;
-  
+
   int ntablem1 = ntable - 1;
-  
+
   for (int i = 0; i < ntablem1; i++) {
     drtable[i] = 1.0/(rtable[i+1] - rtable[i]);
     dftable[i] = ftable[i+1] - ftable[i];
@@ -892,10 +892,10 @@ void PairLJCutCoulLong::init_tables()
       dptable[i] = ptable[i+1] - ptable[i];
     }
   }
-  
-  // get the delta values for the last table entries 
+
+  // get the delta values for the last table entries
   // tables are connected periodically between 0 and ntablem1
-    
+
   drtable[ntablem1] = 1.0/(rtable[0] - rtable[ntablem1]);
   dftable[ntablem1] = ftable[0] - ftable[ntablem1];
   dctable[ntablem1] = ctable[0] - ctable[ntablem1];
@@ -905,23 +905,23 @@ void PairLJCutCoulLong::init_tables()
     dptable[ntablem1] = ptable[0] - ptable[ntablem1];
   }
 
-  // get the correct delta values at itablemax    
+  // get the correct delta values at itablemax
   // smallest r is in bin itablemin
   // largest r is in bin itablemax, which is itablemin-1,
   //   or ntablem1 if itablemin=0
   // deltas at itablemax only needed if corresponding rsq < cut*cut
-  // if so, compute deltas between rsq and cut*cut 
+  // if so, compute deltas between rsq and cut*cut
 
   double f_tmp,c_tmp,e_tmp,p_tmp,v_tmp;
   itablemin = minrsq_lookup.i & ncoulmask;
-  itablemin >>= ncoulshiftbits;  
-  int itablemax = itablemin - 1; 
-  if (itablemin == 0) itablemax = ntablem1;     
+  itablemin >>= ncoulshiftbits;
+  int itablemax = itablemin - 1;
+  if (itablemin == 0) itablemax = ntablem1;
   rsq_lookup.i = itablemax << ncoulshiftbits;
   rsq_lookup.i |= maskhi;
 
   if (rsq_lookup.f < cut_coulsq) {
-    rsq_lookup.f = cut_coulsq;  
+    rsq_lookup.f = cut_coulsq;
     r = sqrtf(rsq_lookup.f);
     grij = g_ewald * r;
     expm2 = exp(-grij*grij);
@@ -939,7 +939,7 @@ void PairLJCutCoulLong::init_tables()
       v_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
         if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
           f_tmp += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
           c_tmp = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
         } else {
@@ -949,14 +949,14 @@ void PairLJCutCoulLong::init_tables()
       }
     }
 
-    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);   
+    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);
     dftable[itablemax] = f_tmp - ftable[itablemax];
     dctable[itablemax] = c_tmp - ctable[itablemax];
     detable[itablemax] = e_tmp - etable[itablemax];
     if (cut_respa) {
       dvtable[itablemax] = v_tmp - vtable[itablemax];
       dptable[itablemax] = p_tmp - ptable[itablemax];
-    }   
+    }
   }
 }
 
@@ -973,9 +973,9 @@ void PairLJCutCoulLong::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -997,14 +997,14 @@ void PairLJCutCoulLong::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut_lj[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -1062,9 +1062,9 @@ void PairLJCutCoulLong::free_tables()
 /* ---------------------------------------------------------------------- */
 
 double PairLJCutCoulLong::single(int i, int j, int itype, int jtype,
-				 double rsq,
-				 double factor_coul, double factor_lj,
-				 double &fforce)
+                                 double rsq,
+                                 double factor_coul, double factor_lj,
+                                 double &fforce)
 {
   double r2inv,r6inv,r,grij,expm2,t,erfc,prefactor;
   double fraction,table,forcecoul,forcelj,phicoul,philj;
@@ -1090,9 +1090,9 @@ double PairLJCutCoulLong::single(int i, int j, int itype, int jtype,
       table = ftable[itable] + fraction*dftable[itable];
       forcecoul = atom->q[i]*atom->q[j] * table;
       if (factor_coul < 1.0) {
-	table = ctable[itable] + fraction*dctable[itable];
-	prefactor = atom->q[i]*atom->q[j] * table;
-	forcecoul -= (1.0-factor_coul)*prefactor;
+        table = ctable[itable] + fraction*dctable[itable];
+        prefactor = atom->q[i]*atom->q[j] * table;
+        forcecoul -= (1.0-factor_coul)*prefactor;
       }
     }
   } else forcecoul = 0.0;
diff --git a/src/KSPACE/pair_lj_cut_coul_long.h b/src/KSPACE/pair_lj_cut_coul_long.h
index 0e9c571424..fa8acedcda 100644
--- a/src/KSPACE/pair_lj_cut_coul_long.h
+++ b/src/KSPACE/pair_lj_cut_coul_long.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp b/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp
index bf9cc5c207..87a52444c3 100644
--- a/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp
+++ b/src/KSPACE/pair_lj_cut_coul_long_tip4p.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -47,7 +47,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-PairLJCutCoulLongTIP4P::PairLJCutCoulLongTIP4P(LAMMPS *lmp) : 
+PairLJCutCoulLongTIP4P::PairLJCutCoulLongTIP4P(LAMMPS *lmp) :
   PairLJCutCoulLong(lmp)
 {
   single_enable = 0;
@@ -96,7 +96,7 @@ void PairLJCutCoulLongTIP4P::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -128,26 +128,26 @@ void PairLJCutCoulLongTIP4P::compute(int eflag, int vflag)
       // LJ interaction based on true rsq
 
       if (rsq < cut_ljsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	forcelj *= factor_lj * r2inv;
-	
-	f[i][0] += delx*forcelj;
-	f[i][1] += dely*forcelj;
-	f[i][2] += delz*forcelj;
-	f[j][0] -= delx*forcelj;
-	f[j][1] -= dely*forcelj;
-	f[j][2] -= delz*forcelj;
-	
-	if (eflag) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	} else evdwl = 0.0;
-	
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,forcelj,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        forcelj *= factor_lj * r2inv;
+
+        f[i][0] += delx*forcelj;
+        f[i][1] += dely*forcelj;
+        f[i][2] += delz*forcelj;
+        f[j][0] -= delx*forcelj;
+        f[j][1] -= dely*forcelj;
+        f[j][2] -= delz*forcelj;
+
+        if (eflag) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        } else evdwl = 0.0;
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,forcelj,delx,dely,delz);
       }
 
       // adjust rsq and delxyz for off-site O charge(s) if necessary
@@ -155,214 +155,214 @@ void PairLJCutCoulLongTIP4P::compute(int eflag, int vflag)
 
       if (rsq < cut_coulsqplus) {
 
-	if (itype == typeO || jtype == typeO) { 
-	  if (jtype == typeO) {
-	    find_M(j,jH1,jH2,xjM);
-	    x2 = xjM;
-	  } else x2 = x[j];
-	  delx = x1[0] - x2[0];
-	  dely = x1[1] - x2[1];
-	  delz = x1[2] - x2[2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-	}
-
-	// Coulombic interaction based on modified rsq
-
-	if (rsq < cut_coulsq) {
-	  r2inv = 1 / rsq;
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) {
-	      forcecoul -= (1.0-factor_coul)*prefactor; 
-	    }
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	
-	  cforce = forcecoul * r2inv;
-
-	  // if i,j are not O atoms, force is applied directly
-	  // if i or j are O atoms, force is on fictitious atom & partitioned
-	  // force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
-	  // f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
-	  // preserves total force and torque on water molecule
-	  // virial = sum(r x F) where each water's atoms are near xi and xj
-	  // vlist stores 2,4,6 atoms whose forces contribute to virial
-	
-	  n = 0;
-	
-	  if (itype != typeO) {
-	    f[i][0] += delx * cforce;
-	    f[i][1] += dely * cforce;
-	    f[i][2] += delz * cforce;
-	  
-	    if (vflag) {
-	      v[0] = x[i][0] * delx * cforce;
-	      v[1] = x[i][1] * dely * cforce;
-	      v[2] = x[i][2] * delz * cforce;
-	      v[3] = x[i][0] * dely * cforce;
-	      v[4] = x[i][0] * delz * cforce;
-	      v[5] = x[i][1] * delz * cforce;
-	      vlist[n++] = i;
-	    }
-	  
-	  } else {
-
-	    fd[0] = delx*cforce;
-	    fd[1] = dely*cforce;
-	    fd[2] = delz*cforce;
-
-	    delxOM = x[i][0] - x1[0];
-	    delyOM = x[i][1] - x1[1];
-	    delzOM = x[i][2] - x1[2];
-
-	    ddotf = (delxOM * fd[0] + delyOM * fd[1] + delzOM * fd[2]) /
-	      (qdist*qdist);
-	  
-	    f1[0] = ddotf * delxOM;
-	    f1[1] = ddotf * delyOM;
-	    f1[2] = ddotf * delzOM;
-	  
-	    fO[0] = fd[0] - alpha * (fd[0] - f1[0]);
-	    fO[1] = fd[1] - alpha * (fd[1] - f1[1]);
-	    fO[2] = fd[2] - alpha * (fd[2] - f1[2]);
-	  
-	    fH[0] = 0.5 * alpha * (fd[0] - f1[0]);
-	    fH[1] = 0.5 * alpha * (fd[1] - f1[1]);
-	    fH[2] = 0.5 * alpha * (fd[2] - f1[2]);
-	  
-	    f[i][0] += fO[0];
-	    f[i][1] += fO[1];
-	    f[i][2] += fO[2];
-	  
-	    f[iH1][0] += fH[0];
-	    f[iH1][1] += fH[1];
-	    f[iH1][2] += fH[2];
-	  
-	    f[iH2][0] += fH[0];
-	    f[iH2][1] += fH[1];
-	    f[iH2][2] += fH[2];
-	  
-	    if (vflag) {
-	      domain->closest_image(x[i],x[iH1],xH1);
-	      domain->closest_image(x[i],x[iH2],xH2);
-	    
-	      v[0] = x[i][0]*fO[0] + xH1[0]*fH[0] + xH2[0]*fH[0];
-	      v[1] = x[i][1]*fO[1] + xH1[1]*fH[1] + xH2[1]*fH[1];
-	      v[2] = x[i][2]*fO[2] + xH1[2]*fH[2] + xH2[2]*fH[2];
-	      v[3] = x[i][0]*fO[1] + xH1[0]*fH[1] + xH2[0]*fH[1];
-	      v[4] = x[i][0]*fO[2] + xH1[0]*fH[2] + xH2[0]*fH[2];
-	      v[5] = x[i][1]*fO[2] + xH1[1]*fH[2] + xH2[1]*fH[2];
-	    
-	      vlist[n++] = i;
-	      vlist[n++] = iH1;
-	      vlist[n++] = iH2;
-	    }
-	  }
-	
-	  if (jtype != typeO) {
-	    f[j][0] -= delx * cforce;
-	    f[j][1] -= dely * cforce;
-	    f[j][2] -= delz * cforce;
-	  
-	    if (vflag) {
-	      v[0] -= x[j][0] * delx * cforce;
-	      v[1] -= x[j][1] * dely * cforce;
-	      v[2] -= x[j][2] * delz * cforce;
-	      v[3] -= x[j][0] * dely * cforce;
-	      v[4] -= x[j][0] * delz * cforce;
-	      v[5] -= x[j][1] * delz * cforce;
-	      vlist[n++] = j;
-	    }
-	  
-	  } else {
-	  
-	    fd[0] = -delx*cforce;
-	    fd[1] = -dely*cforce;
-	    fd[2] = -delz*cforce;
-	  
-	    delxOM = x[j][0] - x2[0];
-	    delyOM = x[j][1] - x2[1];
-	    delzOM = x[j][2] - x2[2];
-	  
-	    ddotf = (delxOM * fd[0] + delyOM * fd[1] + delzOM * fd[2]) /
-	      (qdist*qdist);
-	  
-	    f1[0] = ddotf * delxOM;
-	    f1[1] = ddotf * delyOM;
-	    f1[2] = ddotf * delzOM;
-	  
-	    fO[0] = fd[0] - alpha * (fd[0] - f1[0]);
-	    fO[1] = fd[1] - alpha * (fd[1] - f1[1]);
-	    fO[2] = fd[2] - alpha * (fd[2] - f1[2]);
-	  
-	    fH[0] = 0.5 * alpha * (fd[0] - f1[0]);
-	    fH[1] = 0.5 * alpha * (fd[1] - f1[1]);
-	    fH[2] = 0.5 * alpha * (fd[2] - f1[2]);
-	  
-	    f[j][0] += fO[0];
-	    f[j][1] += fO[1];
-	    f[j][2] += fO[2];
-	  
-	    f[jH1][0] += fH[0];
-	    f[jH1][1] += fH[1];
-	    f[jH1][2] += fH[2];
-	  
-	    f[jH2][0] += fH[0];
-	    f[jH2][1] += fH[1];
-	    f[jH2][2] += fH[2];
-	  
-	    if (vflag) {
-	      domain->closest_image(x[j],x[jH1],xH1);
-	      domain->closest_image(x[j],x[jH2],xH2);
-	    
-	      v[0] += x[j][0]*fO[0] + xH1[0]*fH[0] + xH2[0]*fH[0];
-	      v[1] += x[j][1]*fO[1] + xH1[1]*fH[1] + xH2[1]*fH[1];
-	      v[2] += x[j][2]*fO[2] + xH1[2]*fH[2] + xH2[2]*fH[2];
-	      v[3] += x[j][0]*fO[1] + xH1[0]*fH[1] + xH2[0]*fH[1];
-	      v[4] += x[j][0]*fO[2] + xH1[0]*fH[2] + xH2[0]*fH[2];
-	      v[5] += x[j][1]*fO[2] + xH1[1]*fH[2] + xH2[1]*fH[2];
-	    
-	      vlist[n++] = j;
-	      vlist[n++] = jH1;
-	      vlist[n++] = jH2;
-	    }
-	  }
-	
-	  if (eflag) {
-	    if (!ncoultablebits || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	
-	  if (evflag) ev_tally_list(n,vlist,ecoul,v);
-	}
+        if (itype == typeO || jtype == typeO) {
+          if (jtype == typeO) {
+            find_M(j,jH1,jH2,xjM);
+            x2 = xjM;
+          } else x2 = x[j];
+          delx = x1[0] - x2[0];
+          dely = x1[1] - x2[1];
+          delz = x1[2] - x2[2];
+          rsq = delx*delx + dely*dely + delz*delz;
+        }
+
+        // Coulombic interaction based on modified rsq
+
+        if (rsq < cut_coulsq) {
+          r2inv = 1 / rsq;
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) {
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+
+          cforce = forcecoul * r2inv;
+
+          // if i,j are not O atoms, force is applied directly
+          // if i or j are O atoms, force is on fictitious atom & partitioned
+          // force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
+          // f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
+          // preserves total force and torque on water molecule
+          // virial = sum(r x F) where each water's atoms are near xi and xj
+          // vlist stores 2,4,6 atoms whose forces contribute to virial
+
+          n = 0;
+
+          if (itype != typeO) {
+            f[i][0] += delx * cforce;
+            f[i][1] += dely * cforce;
+            f[i][2] += delz * cforce;
+
+            if (vflag) {
+              v[0] = x[i][0] * delx * cforce;
+              v[1] = x[i][1] * dely * cforce;
+              v[2] = x[i][2] * delz * cforce;
+              v[3] = x[i][0] * dely * cforce;
+              v[4] = x[i][0] * delz * cforce;
+              v[5] = x[i][1] * delz * cforce;
+              vlist[n++] = i;
+            }
+
+          } else {
+
+            fd[0] = delx*cforce;
+            fd[1] = dely*cforce;
+            fd[2] = delz*cforce;
+
+            delxOM = x[i][0] - x1[0];
+            delyOM = x[i][1] - x1[1];
+            delzOM = x[i][2] - x1[2];
+
+            ddotf = (delxOM * fd[0] + delyOM * fd[1] + delzOM * fd[2]) /
+              (qdist*qdist);
+
+            f1[0] = ddotf * delxOM;
+            f1[1] = ddotf * delyOM;
+            f1[2] = ddotf * delzOM;
+
+            fO[0] = fd[0] - alpha * (fd[0] - f1[0]);
+            fO[1] = fd[1] - alpha * (fd[1] - f1[1]);
+            fO[2] = fd[2] - alpha * (fd[2] - f1[2]);
+
+            fH[0] = 0.5 * alpha * (fd[0] - f1[0]);
+            fH[1] = 0.5 * alpha * (fd[1] - f1[1]);
+            fH[2] = 0.5 * alpha * (fd[2] - f1[2]);
+
+            f[i][0] += fO[0];
+            f[i][1] += fO[1];
+            f[i][2] += fO[2];
+
+            f[iH1][0] += fH[0];
+            f[iH1][1] += fH[1];
+            f[iH1][2] += fH[2];
+
+            f[iH2][0] += fH[0];
+            f[iH2][1] += fH[1];
+            f[iH2][2] += fH[2];
+
+            if (vflag) {
+              domain->closest_image(x[i],x[iH1],xH1);
+              domain->closest_image(x[i],x[iH2],xH2);
+
+              v[0] = x[i][0]*fO[0] + xH1[0]*fH[0] + xH2[0]*fH[0];
+              v[1] = x[i][1]*fO[1] + xH1[1]*fH[1] + xH2[1]*fH[1];
+              v[2] = x[i][2]*fO[2] + xH1[2]*fH[2] + xH2[2]*fH[2];
+              v[3] = x[i][0]*fO[1] + xH1[0]*fH[1] + xH2[0]*fH[1];
+              v[4] = x[i][0]*fO[2] + xH1[0]*fH[2] + xH2[0]*fH[2];
+              v[5] = x[i][1]*fO[2] + xH1[1]*fH[2] + xH2[1]*fH[2];
+
+              vlist[n++] = i;
+              vlist[n++] = iH1;
+              vlist[n++] = iH2;
+            }
+          }
+
+          if (jtype != typeO) {
+            f[j][0] -= delx * cforce;
+            f[j][1] -= dely * cforce;
+            f[j][2] -= delz * cforce;
+
+            if (vflag) {
+              v[0] -= x[j][0] * delx * cforce;
+              v[1] -= x[j][1] * dely * cforce;
+              v[2] -= x[j][2] * delz * cforce;
+              v[3] -= x[j][0] * dely * cforce;
+              v[4] -= x[j][0] * delz * cforce;
+              v[5] -= x[j][1] * delz * cforce;
+              vlist[n++] = j;
+            }
+
+          } else {
+
+            fd[0] = -delx*cforce;
+            fd[1] = -dely*cforce;
+            fd[2] = -delz*cforce;
+
+            delxOM = x[j][0] - x2[0];
+            delyOM = x[j][1] - x2[1];
+            delzOM = x[j][2] - x2[2];
+
+            ddotf = (delxOM * fd[0] + delyOM * fd[1] + delzOM * fd[2]) /
+              (qdist*qdist);
+
+            f1[0] = ddotf * delxOM;
+            f1[1] = ddotf * delyOM;
+            f1[2] = ddotf * delzOM;
+
+            fO[0] = fd[0] - alpha * (fd[0] - f1[0]);
+            fO[1] = fd[1] - alpha * (fd[1] - f1[1]);
+            fO[2] = fd[2] - alpha * (fd[2] - f1[2]);
+
+            fH[0] = 0.5 * alpha * (fd[0] - f1[0]);
+            fH[1] = 0.5 * alpha * (fd[1] - f1[1]);
+            fH[2] = 0.5 * alpha * (fd[2] - f1[2]);
+
+            f[j][0] += fO[0];
+            f[j][1] += fO[1];
+            f[j][2] += fO[2];
+
+            f[jH1][0] += fH[0];
+            f[jH1][1] += fH[1];
+            f[jH1][2] += fH[2];
+
+            f[jH2][0] += fH[0];
+            f[jH2][1] += fH[1];
+            f[jH2][2] += fH[2];
+
+            if (vflag) {
+              domain->closest_image(x[j],x[jH1],xH1);
+              domain->closest_image(x[j],x[jH2],xH2);
+
+              v[0] += x[j][0]*fO[0] + xH1[0]*fH[0] + xH2[0]*fH[0];
+              v[1] += x[j][1]*fO[1] + xH1[1]*fH[1] + xH2[1]*fH[1];
+              v[2] += x[j][2]*fO[2] + xH1[2]*fH[2] + xH2[2]*fH[2];
+              v[3] += x[j][0]*fO[1] + xH1[0]*fH[1] + xH2[0]*fH[1];
+              v[4] += x[j][0]*fO[2] + xH1[0]*fH[2] + xH2[0]*fH[2];
+              v[5] += x[j][1]*fO[2] + xH1[1]*fH[2] + xH2[1]*fH[2];
+
+              vlist[n++] = j;
+              vlist[n++] = jH1;
+              vlist[n++] = jH2;
+            }
+          }
+
+          if (eflag) {
+            if (!ncoultablebits || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (evflag) ev_tally_list(n,vlist,ecoul,v);
+        }
       }
     }
   }
 
-  //if (comm->me == 0 && update->ntimestep == update->laststep) 
+  //if (comm->me == 0 && update->ntimestep == update->laststep)
   //  printf("Count %ld %d\n",update->ntimestep,count);
 }
 
@@ -383,14 +383,14 @@ void PairLJCutCoulLongTIP4P::settings(int narg, char **arg)
   cut_lj_global = force->numeric(arg[5]);
   if (narg == 6) cut_coul = cut_lj_global;
   else cut_coul = force->numeric(arg[6]);
-  
+
   // reset cutoffs that have been explicitly set
 
   if (allocated) {
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
+        if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
   }
 }
 
@@ -404,12 +404,12 @@ void PairLJCutCoulLongTIP4P::init_style()
 
   if (atom->tag_enable == 0)
     error->all(FLERR,"Pair style lj/cut/coul/long/tip4p requires atom IDs");
-  if (!force->newton_pair) 
+  if (!force->newton_pair)
     error->all(FLERR,
-	       "Pair style lj/cut/coul/long/tip4p requires newton pair on");
+               "Pair style lj/cut/coul/long/tip4p requires newton pair on");
   if (!atom->q_flag)
     error->all(FLERR,
-	       "Pair style lj/cut/coul/long/tip4p requires atom attribute q");
+               "Pair style lj/cut/coul/long/tip4p requires atom attribute q");
   if ( (strcmp(force->kspace_style,"pppm/tip4p") != 0) &&
        (strcmp(force->kspace_style,"pppm/tip4p/omp") != 0) &&
        (strcmp(force->kspace_style,"pppm/tip4p/proxy") != 0) )
@@ -495,7 +495,7 @@ void PairLJCutCoulLongTIP4P::find_M(int i, int &iH1, int &iH2, double *xM)
   if (atom->type[iH1] != typeH || atom->type[iH2] != typeH)
     error->one(FLERR,"TIP4P hydrogen has incorrect atom type");
 
-  double **x = atom->x; 
+  double **x = atom->x;
 
   double delx1 = x[iH1][0] - x[i][0];
   double dely1 = x[iH1][1] - x[i][1];
diff --git a/src/KSPACE/pair_lj_cut_coul_long_tip4p.h b/src/KSPACE/pair_lj_cut_coul_long_tip4p.h
index 674f66361c..4d61be8d22 100644
--- a/src/KSPACE/pair_lj_cut_coul_long_tip4p.h
+++ b/src/KSPACE/pair_lj_cut_coul_long_tip4p.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp
index 8c70c87775..560389b1fa 100644
--- a/src/KSPACE/pppm.cpp
+++ b/src/KSPACE/pppm.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -97,7 +97,7 @@ PPPM::PPPM(LAMMPS *lmp, int narg, char **arg) : KSpace(lmp, narg, arg)
 }
 
 /* ----------------------------------------------------------------------
-   free all memory 
+   free all memory
 ------------------------------------------------------------------------- */
 
 PPPM::~PPPM()
@@ -110,7 +110,7 @@ PPPM::~PPPM()
 }
 
 /* ----------------------------------------------------------------------
-   called once before run 
+   called once before run
 ------------------------------------------------------------------------- */
 
 void PPPM::init()
@@ -125,15 +125,15 @@ void PPPM::init()
   if (domain->triclinic)
     error->all(FLERR,"Cannot (yet) use PPPM with triclinic box");
   if (domain->dimension == 2) error->all(FLERR,
-					 "Cannot use PPPM with 2d simulation");
+                                         "Cannot use PPPM with 2d simulation");
 
   if (!atom->q_flag) error->all(FLERR,"Kspace style requires atom attribute q");
 
   if (slabflag == 0 && domain->nonperiodic > 0)
     error->all(FLERR,"Cannot use nonperiodic boundaries with PPPM");
   if (slabflag == 1) {
-    if (domain->xperiodic != 1 || domain->yperiodic != 1 || 
-	domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
+    if (domain->xperiodic != 1 || domain->yperiodic != 1 ||
+        domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
       error->all(FLERR,"Incorrect boundaries with slab PPPM");
   }
 
@@ -187,11 +187,11 @@ void PPPM::init()
 
     if (force->angle == NULL || force->bond == NULL)
       error->all(FLERR,"Bond and angle potentials must be defined for TIP4P");
-    if (typeA < 1 || typeA > atom->nangletypes || 
-	force->angle->setflag[typeA] == 0)
+    if (typeA < 1 || typeA > atom->nangletypes ||
+        force->angle->setflag[typeA] == 0)
       error->all(FLERR,"Bad TIP4P angle type for PPPM/TIP4P");
-    if (typeB < 1 || typeB > atom->nbondtypes || 
-	force->bond->setflag[typeB] == 0)
+    if (typeB < 1 || typeB > atom->nbondtypes ||
+        force->bond->setflag[typeB] == 0)
       error->all(FLERR,"Bad TIP4P bond type for PPPM/TIP4P");
     double theta = force->angle->equilibrium_angle(typeA);
     double blen = force->bond->equilibrium_distance(typeB);
@@ -231,10 +231,10 @@ void PPPM::init()
   }
 
   // set accuracy (force units) from accuracy_relative or accuracy_absolute
-  
+
   if (accuracy_absolute >= 0.0) accuracy = accuracy_absolute;
   else accuracy = accuracy_relative * two_charge_force;
-  
+
   // setup FFT grid resolution and g_ewald
   // normally one iteration thru while loop is all that is required
   // if grid stencil extends beyond neighbor proc, reduce order and try again
@@ -244,7 +244,7 @@ void PPPM::init()
   while (order > 1) {
     if (iteration && me == 0)
       error->warning(FLERR,"Reducing PPPM order b/c stencil extends "
-		     "beyond neighbor processor");
+                     "beyond neighbor processor");
     iteration++;
 
     set_grid();
@@ -263,9 +263,9 @@ void PPPM::init()
     nylo_in = static_cast<int> (comm->ysplit[comm->myloc[1]] * ny_pppm);
     nyhi_in = static_cast<int> (comm->ysplit[comm->myloc[1]+1] * ny_pppm) - 1;
 
-    nzlo_in = static_cast<int> 
+    nzlo_in = static_cast<int>
       (comm->zsplit[comm->myloc[2]] * nz_pppm/slab_volfactor);
-    nzhi_in = static_cast<int> 
+    nzhi_in = static_cast<int>
       (comm->zsplit[comm->myloc[2]+1] * nz_pppm/slab_volfactor) - 1;
 
     // nlower,nupper = stencil size for mapping particles to PPPM grid
@@ -320,27 +320,27 @@ void PPPM::init()
       dist[1] = cuthalf/domain->prd[1];
       dist[2] = cuthalf/domain->prd[2];
     }
-    
+
     int nlo,nhi;
-    
-    nlo = static_cast<int> ((sublo[0]-dist[0]-boxlo[0]) * 
-			    nx_pppm/xprd + shift) - OFFSET;
-    nhi = static_cast<int> ((subhi[0]+dist[0]-boxlo[0]) * 
-			    nx_pppm/xprd + shift) - OFFSET;
+
+    nlo = static_cast<int> ((sublo[0]-dist[0]-boxlo[0]) *
+                            nx_pppm/xprd + shift) - OFFSET;
+    nhi = static_cast<int> ((subhi[0]+dist[0]-boxlo[0]) *
+                            nx_pppm/xprd + shift) - OFFSET;
     nxlo_out = nlo + nlower;
     nxhi_out = nhi + nupper;
 
-    nlo = static_cast<int> ((sublo[1]-dist[1]-boxlo[1]) * 
-			    ny_pppm/yprd + shift) - OFFSET;
-    nhi = static_cast<int> ((subhi[1]+dist[1]-boxlo[1]) * 
-			    ny_pppm/yprd + shift) - OFFSET;
+    nlo = static_cast<int> ((sublo[1]-dist[1]-boxlo[1]) *
+                            ny_pppm/yprd + shift) - OFFSET;
+    nhi = static_cast<int> ((subhi[1]+dist[1]-boxlo[1]) *
+                            ny_pppm/yprd + shift) - OFFSET;
     nylo_out = nlo + nlower;
     nyhi_out = nhi + nupper;
 
-    nlo = static_cast<int> ((sublo[2]-dist[2]-boxlo[2]) * 
-			    nz_pppm/zprd_slab + shift) - OFFSET;
-    nhi = static_cast<int> ((subhi[2]+dist[2]-boxlo[2]) * 
-			    nz_pppm/zprd_slab + shift) - OFFSET;
+    nlo = static_cast<int> ((sublo[2]-dist[2]-boxlo[2]) *
+                            nz_pppm/zprd_slab + shift) - OFFSET;
+    nhi = static_cast<int> ((subhi[2]+dist[2]-boxlo[2]) *
+                            nz_pppm/zprd_slab + shift) - OFFSET;
     nzlo_out = nlo + nlower;
     nzhi_out = nhi + nupper;
 
@@ -355,7 +355,7 @@ void PPPM::init()
       nzhi_in = nz_pppm - 1;
       nzhi_out = nz_pppm - 1;
     }
-  
+
     // nlo_ghost,nhi_ghost = # of planes I will recv from 6 directions
     //   that overlay domain I own
     // proc in that direction tells me via sendrecv()
@@ -367,43 +367,43 @@ void PPPM::init()
     nplanes = nxlo_in - nxlo_out;
     if (comm->procneigh[0][0] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[0][0],0,
-		   &nxhi_ghost,1,MPI_INT,comm->procneigh[0][1],0,
-		   world,&status);
+                   &nxhi_ghost,1,MPI_INT,comm->procneigh[0][1],0,
+                   world,&status);
     else nxhi_ghost = nplanes;
 
     nplanes = nxhi_out - nxhi_in;
     if (comm->procneigh[0][1] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[0][1],0,
-		   &nxlo_ghost,1,MPI_INT,comm->procneigh[0][0],
-		   0,world,&status);
+                   &nxlo_ghost,1,MPI_INT,comm->procneigh[0][0],
+                   0,world,&status);
     else nxlo_ghost = nplanes;
 
     nplanes = nylo_in - nylo_out;
     if (comm->procneigh[1][0] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[1][0],0,
-		   &nyhi_ghost,1,MPI_INT,comm->procneigh[1][1],0,
-		   world,&status);
+                   &nyhi_ghost,1,MPI_INT,comm->procneigh[1][1],0,
+                   world,&status);
     else nyhi_ghost = nplanes;
 
     nplanes = nyhi_out - nyhi_in;
     if (comm->procneigh[1][1] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[1][1],0,
-		   &nylo_ghost,1,MPI_INT,comm->procneigh[1][0],0,
-		   world,&status);
+                   &nylo_ghost,1,MPI_INT,comm->procneigh[1][0],0,
+                   world,&status);
     else nylo_ghost = nplanes;
 
     nplanes = nzlo_in - nzlo_out;
     if (comm->procneigh[2][0] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[2][0],0,
-		   &nzhi_ghost,1,MPI_INT,comm->procneigh[2][1],0,
-		   world,&status);
+                   &nzhi_ghost,1,MPI_INT,comm->procneigh[2][1],0,
+                   world,&status);
     else nzhi_ghost = nplanes;
 
     nplanes = nzhi_out - nzhi_in;
     if (comm->procneigh[2][1] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[2][1],0,
-		   &nzlo_ghost,1,MPI_INT,comm->procneigh[2][0],0,
-		   world,&status);
+                   &nzlo_ghost,1,MPI_INT,comm->procneigh[2][0],0,
+                   world,&status);
     else nzlo_ghost = nplanes;
 
     // test that ghost overlap is not bigger than my sub-domain
@@ -510,9 +510,9 @@ void PPPM::init()
 
   if (me == 0) {
     if (screen) fprintf(screen,"  brick FFT buffer size/proc = %d %d %d\n",
-			ngrid_max,nfft_both_max,nbuf_max);
+                        ngrid_max,nfft_both_max,nbuf_max);
     if (logfile) fprintf(logfile,"  brick FFT buffer size/proc = %d %d %d\n",
-			 ngrid_max,nfft_both_max,nbuf_max);
+                         ngrid_max,nfft_both_max,nbuf_max);
   }
 
   // allocate K-space dependent memory
@@ -528,7 +528,7 @@ void PPPM::init()
 }
 
 /* ----------------------------------------------------------------------
-   adjust PPPM coeffs, called initially and whenever volume has changed 
+   adjust PPPM coeffs, called initially and whenever volume has changed
 ------------------------------------------------------------------------- */
 
 void PPPM::setup()
@@ -548,7 +548,7 @@ void PPPM::setup()
   double zprd = prd[2];
   double zprd_slab = zprd*slab_volfactor;
   volume = xprd * yprd * zprd_slab;
-    
+
   delxinv = nx_pppm/xprd;
   delyinv = ny_pppm/yprd;
   delzinv = nz_pppm/zprd_slab;
@@ -586,24 +586,24 @@ void PPPM::setup()
   for (k = nzlo_fft; k <= nzhi_fft; k++) {
     for (j = nylo_fft; j <= nyhi_fft; j++) {
       for (i = nxlo_fft; i <= nxhi_fft; i++) {
-	sqk = fkx[i]*fkx[i] + fky[j]*fky[j] + fkz[k]*fkz[k];
-	if (sqk == 0.0) {
-	  vg[n][0] = 0.0;
-	  vg[n][1] = 0.0;
-	  vg[n][2] = 0.0;
-	  vg[n][3] = 0.0;
-	  vg[n][4] = 0.0;
-	  vg[n][5] = 0.0;
-	} else {
-	  vterm = -2.0 * (1.0/sqk + 0.25/(g_ewald*g_ewald));
-	  vg[n][0] = 1.0 + vterm*fkx[i]*fkx[i];
-	  vg[n][1] = 1.0 + vterm*fky[j]*fky[j];
-	  vg[n][2] = 1.0 + vterm*fkz[k]*fkz[k];
-	  vg[n][3] = vterm*fkx[i]*fky[j];
-	  vg[n][4] = vterm*fkx[i]*fkz[k];
-	  vg[n][5] = vterm*fky[j]*fkz[k];
-	}
-	n++;
+        sqk = fkx[i]*fkx[i] + fky[j]*fky[j] + fkz[k]*fkz[k];
+        if (sqk == 0.0) {
+          vg[n][0] = 0.0;
+          vg[n][1] = 0.0;
+          vg[n][2] = 0.0;
+          vg[n][3] = 0.0;
+          vg[n][4] = 0.0;
+          vg[n][5] = 0.0;
+        } else {
+          vterm = -2.0 * (1.0/sqk + 0.25/(g_ewald*g_ewald));
+          vg[n][0] = 1.0 + vterm*fkx[i]*fkx[i];
+          vg[n][1] = 1.0 + vterm*fky[j]*fky[j];
+          vg[n][2] = 1.0 + vterm*fkz[k]*fkz[k];
+          vg[n][3] = vterm*fkx[i]*fky[j];
+          vg[n][4] = vterm*fkx[i]*fkz[k];
+          vg[n][5] = vterm*fky[j]*fkz[k];
+        }
+        n++;
       }
     }
   }
@@ -616,12 +616,12 @@ void PPPM::setup()
   double sum1,dot1,dot2;
   double numerator,denominator;
 
-  int nbx = static_cast<int> ((g_ewald*xprd/(MY_PI*nx_pppm)) * 
-			      pow(-log(EPS_HOC),0.25));
-  int nby = static_cast<int> ((g_ewald*yprd/(MY_PI*ny_pppm)) * 
-			      pow(-log(EPS_HOC),0.25));
-  int nbz = static_cast<int> ((g_ewald*zprd_slab/(MY_PI*nz_pppm)) * 
-			      pow(-log(EPS_HOC),0.25));
+  int nbx = static_cast<int> ((g_ewald*xprd/(MY_PI*nx_pppm)) *
+                              pow(-log(EPS_HOC),0.25));
+  int nby = static_cast<int> ((g_ewald*yprd/(MY_PI*ny_pppm)) *
+                              pow(-log(EPS_HOC),0.25));
+  int nbz = static_cast<int> ((g_ewald*zprd_slab/(MY_PI*nz_pppm)) *
+                              pow(-log(EPS_HOC),0.25));
 
   double form = 1.0;
 
@@ -637,52 +637,52 @@ void PPPM::setup()
       sny2 = sny*sny;
 
       for (k = nxlo_fft; k <= nxhi_fft; k++) {
-	kper = k - nx_pppm*(2*k/nx_pppm);
-	snx = sin(0.5*unitkx*kper*xprd/nx_pppm);
-	snx2 = snx*snx;
-      
-	sqk = pow(unitkx*kper,2.0) + pow(unitky*lper,2.0) + 
-	  pow(unitkz*mper,2.0);
-
-	if (sqk != 0.0) {
-	  numerator = form*12.5663706/sqk;
-	  denominator = gf_denom(snx2,sny2,snz2);  
-	  sum1 = 0.0;
+        kper = k - nx_pppm*(2*k/nx_pppm);
+        snx = sin(0.5*unitkx*kper*xprd/nx_pppm);
+        snx2 = snx*snx;
+
+        sqk = pow(unitkx*kper,2.0) + pow(unitky*lper,2.0) +
+          pow(unitkz*mper,2.0);
+
+        if (sqk != 0.0) {
+          numerator = form*12.5663706/sqk;
+          denominator = gf_denom(snx2,sny2,snz2);
+          sum1 = 0.0;
           const double dorder = static_cast<double>(order);
-	  for (nx = -nbx; nx <= nbx; nx++) {
-	    qx = unitkx*(kper+nx_pppm*nx);
-	    sx = exp(-0.25*pow(qx/g_ewald,2.0));
-	    wx = 1.0;
-	    argx = 0.5*qx*xprd/nx_pppm;
-	    if (argx != 0.0) wx = pow(sin(argx)/argx,dorder);
-	    for (ny = -nby; ny <= nby; ny++) {
-	      qy = unitky*(lper+ny_pppm*ny);
-	      sy = exp(-0.25*pow(qy/g_ewald,2.0));
-	      wy = 1.0;
-	      argy = 0.5*qy*yprd/ny_pppm;
-	      if (argy != 0.0) wy = pow(sin(argy)/argy,dorder);
-	      for (nz = -nbz; nz <= nbz; nz++) {
-		qz = unitkz*(mper+nz_pppm*nz);
-		sz = exp(-0.25*pow(qz/g_ewald,2.0));
-		wz = 1.0;
-		argz = 0.5*qz*zprd_slab/nz_pppm;
-		if (argz != 0.0) wz = pow(sin(argz)/argz,dorder);
-
-		dot1 = unitkx*kper*qx + unitky*lper*qy + unitkz*mper*qz;
-		dot2 = qx*qx+qy*qy+qz*qz;
-		sum1 += (dot1/dot2) * sx*sy*sz * pow(wx*wy*wz,2.0);
-	      }
-	    }
-	  }
-	  greensfn[n++] = numerator*sum1/denominator;
-	} else greensfn[n++] = 0.0;
+          for (nx = -nbx; nx <= nbx; nx++) {
+            qx = unitkx*(kper+nx_pppm*nx);
+            sx = exp(-0.25*pow(qx/g_ewald,2.0));
+            wx = 1.0;
+            argx = 0.5*qx*xprd/nx_pppm;
+            if (argx != 0.0) wx = pow(sin(argx)/argx,dorder);
+            for (ny = -nby; ny <= nby; ny++) {
+              qy = unitky*(lper+ny_pppm*ny);
+              sy = exp(-0.25*pow(qy/g_ewald,2.0));
+              wy = 1.0;
+              argy = 0.5*qy*yprd/ny_pppm;
+              if (argy != 0.0) wy = pow(sin(argy)/argy,dorder);
+              for (nz = -nbz; nz <= nbz; nz++) {
+                qz = unitkz*(mper+nz_pppm*nz);
+                sz = exp(-0.25*pow(qz/g_ewald,2.0));
+                wz = 1.0;
+                argz = 0.5*qz*zprd_slab/nz_pppm;
+                if (argz != 0.0) wz = pow(sin(argz)/argz,dorder);
+
+                dot1 = unitkx*kper*qx + unitky*lper*qy + unitkz*mper*qz;
+                dot2 = qx*qx+qy*qy+qz*qz;
+                sum1 += (dot1/dot2) * sx*sy*sz * pow(wx*wy*wz,2.0);
+              }
+            }
+          }
+          greensfn[n++] = numerator*sum1/denominator;
+        } else greensfn[n++] = 0.0;
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   compute the PPPM long-range force, energy, virial 
+   compute the PPPM long-range force, energy, virial
 ------------------------------------------------------------------------- */
 
 void PPPM::compute(int eflag, int vflag)
@@ -693,8 +693,8 @@ void PPPM::compute(int eflag, int vflag)
   // invoke allocate_peratom() if needed for first time
 
   if (eflag || vflag) ev_setup(eflag,vflag);
-  else evflag = evflag_atom = eflag_global = vflag_global = 
-	 eflag_atom = vflag_atom = 0;
+  else evflag = evflag_atom = eflag_global = vflag_global =
+         eflag_atom = vflag_atom = 0;
 
   if (evflag_atom && !peratom_allocate_flag) {
     allocate_peratom();
@@ -702,7 +702,7 @@ void PPPM::compute(int eflag, int vflag)
   }
 
   // convert atoms from box to lamda coords
-  
+
   if (triclinic == 0) boxlo = domain->boxlo;
   else {
     boxlo = domain->boxlo_lamda;
@@ -761,7 +761,7 @@ void PPPM::compute(int eflag, int vflag)
     double energy_all;
     MPI_Allreduce(&energy,&energy_all,1,MPI_DOUBLE,MPI_SUM,world);
     energy = energy_all;
-   
+
     energy *= 0.5*volume;
     energy -= g_ewald*qsqsum/MY_PIS +
       MY_PI2*qsum*qsum / (g_ewald*g_ewald*volume);
@@ -785,9 +785,9 @@ void PPPM::compute(int eflag, int vflag)
 
     if (eflag_atom) {
       for (i = 0; i < nlocal; i++) {
-	eatom[i] *= 0.5;
-        eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum / 
-	  (g_ewald*g_ewald*volume);
+        eatom[i] *= 0.5;
+        eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum /
+          (g_ewald*g_ewald*volume);
         eatom[i] *= qscale;
       }
     }
@@ -803,24 +803,24 @@ void PPPM::compute(int eflag, int vflag)
   if (slabflag) slabcorr();
 
   // convert atoms back from lamda to box coords
-  
+
   if (triclinic) domain->lamda2x(atom->nlocal);
 }
 
 /* ----------------------------------------------------------------------
-   allocate memory that depends on # of K-vectors and order 
+   allocate memory that depends on # of K-vectors and order
 ------------------------------------------------------------------------- */
 
 void PPPM::allocate()
 {
   memory->create3d_offset(density_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:density_brick");
+                          nxlo_out,nxhi_out,"pppm:density_brick");
   memory->create3d_offset(vdx_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:vdx_brick");
+                          nxlo_out,nxhi_out,"pppm:vdx_brick");
   memory->create3d_offset(vdy_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:vdy_brick");
+                          nxlo_out,nxhi_out,"pppm:vdy_brick");
   memory->create3d_offset(vdz_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:vdz_brick");
+                          nxlo_out,nxhi_out,"pppm:vdz_brick");
 
   memory->create(density_fft,nfft_both,"pppm:density_fft");
   memory->create(greensfn,nfft_both,"pppm:greensfn");
@@ -849,49 +849,49 @@ void PPPM::allocate()
   int tmp;
 
   fft1 = new FFT3d(lmp,world,nx_pppm,ny_pppm,nz_pppm,
-		   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		   0,0,&tmp);
+                   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                   0,0,&tmp);
 
   fft2 = new FFT3d(lmp,world,nx_pppm,ny_pppm,nz_pppm,
-		   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		   nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
-		   0,0,&tmp);
+                   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                   nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
+                   0,0,&tmp);
 
   remap = new Remap(lmp,world,
-		    nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
-		    nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		    1,0,0,FFT_PRECISION);
+                    nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
+                    nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                    1,0,0,FFT_PRECISION);
 }
 
 /* ----------------------------------------------------------------------
-   allocate per-atom memory that depends on # of K-vectors and order 
+   allocate per-atom memory that depends on # of K-vectors and order
 ------------------------------------------------------------------------- */
 
 void PPPM::allocate_peratom()
-{  
+{
   memory->create3d_offset(u_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:u_brick");
-  
+                          nxlo_out,nxhi_out,"pppm:u_brick");
+
   memory->create3d_offset(v0_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:v0_brick");
+                          nxlo_out,nxhi_out,"pppm:v0_brick");
   memory->create3d_offset(v1_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:v1_brick");
+                          nxlo_out,nxhi_out,"pppm:v1_brick");
   memory->create3d_offset(v2_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:v2_brick");
+                          nxlo_out,nxhi_out,"pppm:v2_brick");
   memory->create3d_offset(v3_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:v3_brick");
+                          nxlo_out,nxhi_out,"pppm:v3_brick");
   memory->create3d_offset(v4_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:v4_brick");
+                          nxlo_out,nxhi_out,"pppm:v4_brick");
   memory->create3d_offset(v5_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:v5_brick");
+                          nxlo_out,nxhi_out,"pppm:v5_brick");
 
   memory->create(buf3,nbuf_peratom,"pppm:buf3");
   memory->create(buf4,nbuf_peratom,"pppm:buf4");
 }
 
 /* ----------------------------------------------------------------------
-   deallocate memory that depends on # of K-vectors and order 
+   deallocate memory that depends on # of K-vectors and order
 ------------------------------------------------------------------------- */
 
 void PPPM::deallocate()
@@ -924,13 +924,13 @@ void PPPM::deallocate()
 }
 
 /* ----------------------------------------------------------------------
-   deallocate per-atom memory that depends on # of K-vectors and order 
+   deallocate per-atom memory that depends on # of K-vectors and order
 ------------------------------------------------------------------------- */
 
 void PPPM::deallocate_peratom()
 {
   memory->destroy3d_offset(u_brick,nzlo_out,nylo_out,nxlo_out);
-    
+
   memory->destroy3d_offset(v0_brick,nzlo_out,nylo_out,nxlo_out);
   memory->destroy3d_offset(v1_brick,nzlo_out,nylo_out,nxlo_out);
   memory->destroy3d_offset(v2_brick,nzlo_out,nylo_out,nxlo_out);
@@ -939,11 +939,11 @@ void PPPM::deallocate_peratom()
   memory->destroy3d_offset(v5_brick,nzlo_out,nylo_out,nxlo_out);
 
   memory->destroy(buf3);
-  memory->destroy(buf4); 
+  memory->destroy(buf4);
 }
 
 /* ----------------------------------------------------------------------
-   set size of FFT grid (nx,ny,nz_pppm) and g_ewald 
+   set size of FFT grid (nx,ny,nz_pppm) and g_ewald
 ------------------------------------------------------------------------- */
 
 void PPPM::set_grid()
@@ -993,7 +993,7 @@ void PPPM::set_grid()
   double yprd = domain->yprd;
   double zprd = domain->zprd;
   double zprd_slab = zprd*slab_volfactor;
-  
+
   // make initial g_ewald estimate
   // based on desired accuracy and real space cutoff
   // fluid-occupied volume used to estimate real-space error
@@ -1007,7 +1007,7 @@ void PPPM::set_grid()
     if (g_ewald >= 1.0)
       error->all(FLERR,"KSpace accuracy too large to estimate G vector");
     g_ewald = sqrt(-log(g_ewald)) / cutoff;
-  } 
+  }
 
   // set optimal nx_pppm,ny_pppm,nz_pppm based on order and accuracy
   // nz_pppm uses extended zprd_slab instead of zprd
@@ -1016,7 +1016,7 @@ void PPPM::set_grid()
 
   if (!gridflag) {
     double err;
-    h_x = h_y = h_z = 1.0/g_ewald;  
+    h_x = h_y = h_z = 1.0/g_ewald;
 
     nx_pppm = static_cast<int> (xprd/h_x) + 1;
     ny_pppm = static_cast<int> (yprd/h_y) + 1;
@@ -1075,7 +1075,7 @@ void PPPM::set_grid()
     while (fabs(dgew) > SMALL && fmid != 0.0) {
       dgew *= 0.5;
       g_ewald = rtb + dgew;
-      fmid = diffpr(h_x,h_y,h_z,q2,acons);      
+      fmid = diffpr(h_x,h_y,h_z,q2,acons);
       if (fmid <= 0.0) rtb = g_ewald;
       ncount++;
       if (ncount > LARGE) error->all(FLERR,"Cannot compute PPPM G");
@@ -1088,7 +1088,7 @@ void PPPM::set_grid()
   double lpry = rms(h_y,yprd,natoms,q2,acons);
   double lprz = rms(h_z,zprd_slab,natoms,q2,acons);
   double lpr = sqrt(lprx*lprx + lpry*lpry + lprz*lprz) / sqrt(3.0);
-  double spr = 2.0*q2 * exp(-g_ewald*g_ewald*cutoff*cutoff) / 
+  double spr = 2.0*q2 * exp(-g_ewald*g_ewald*cutoff*cutoff) /
     sqrt(natoms*cutoff*xprd*yprd*zprd_slab);
 
   // free local memory
@@ -1108,9 +1108,9 @@ void PPPM::set_grid()
       fprintf(screen,"  grid = %d %d %d\n",nx_pppm,ny_pppm,nz_pppm);
       fprintf(screen,"  stencil order = %d\n",order);
       fprintf(screen,"  estimated absolute RMS force accuracy = %g\n",
-	      MAX(lpr,spr));
+              MAX(lpr,spr));
       fprintf(screen,"  estimated relative force accuracy = %g\n",
-	      MAX(lpr,spr)/two_charge_force);
+              MAX(lpr,spr)/two_charge_force);
       fprintf(screen,"  using %s precision FFTs\n",fft_prec);
     }
     if (logfile) {
@@ -1118,9 +1118,9 @@ void PPPM::set_grid()
       fprintf(logfile,"  grid = %d %d %d\n",nx_pppm,ny_pppm,nz_pppm);
       fprintf(logfile,"  stencil order = %d\n",order);
       fprintf(logfile,"  estimated absolute RMS force accuracy = %g\n",
-	      MAX(lpr,spr));
+              MAX(lpr,spr));
       fprintf(logfile,"  estimated relative force accuracy = %g\n",
-	      MAX(lpr,spr)/two_charge_force);
+              MAX(lpr,spr)/two_charge_force);
       fprintf(logfile,"  using %s precision FFTs\n",fft_prec);
     }
   }
@@ -1128,7 +1128,7 @@ void PPPM::set_grid()
 
 /* ----------------------------------------------------------------------
    check if all factors of n are in list of factors
-   return 1 if yes, 0 if no 
+   return 1 if yes, 0 if no
 ------------------------------------------------------------------------- */
 
 int PPPM::factorable(int n)
@@ -1138,8 +1138,8 @@ int PPPM::factorable(int n)
   while (n > 1) {
     for (i = 0; i < nfactors; i++) {
       if (n % factors[i] == 0) {
-	n /= factors[i];
-	break;
+        n /= factors[i];
+        break;
       }
     }
     if (i == nfactors) return 0;
@@ -1153,10 +1153,10 @@ int PPPM::factorable(int n)
 ------------------------------------------------------------------------- */
 
 double PPPM::rms(double h, double prd, bigint natoms,
-		 double q2, double **acons)
+                 double q2, double **acons)
 {
   double sum = 0.0;
-  for (int m = 0; m < order; m++) 
+  for (int m = 0; m < order; m++)
     sum += acons[order][m] * pow(h*g_ewald,2.0*m);
   double value = q2 * pow(h*g_ewald,(double)order) *
     sqrt(g_ewald*prd*sqrt(2.0*MY_PI)*sum/natoms) / (prd*prd);
@@ -1167,8 +1167,8 @@ double PPPM::rms(double h, double prd, bigint natoms,
    compute difference in real-space and KSpace RMS accuracy
 ------------------------------------------------------------------------- */
 
-double PPPM::diffpr(double h_x, double h_y, double h_z, double q2, 
-		    double **acons)
+double PPPM::diffpr(double h_x, double h_y, double h_z, double q2,
+                    double **acons)
 {
   double lprx,lpry,lprz,kspace_prec,real_prec;
   double xprd = domain->xprd;
@@ -1180,25 +1180,25 @@ double PPPM::diffpr(double h_x, double h_y, double h_z, double q2,
   lpry = rms(h_y,yprd,natoms,q2,acons);
   lprz = rms(h_z,zprd*slab_volfactor,natoms,q2,acons);
   kspace_prec = sqrt(lprx*lprx + lpry*lpry + lprz*lprz) / sqrt(3.0);
-  real_prec = 2.0*q2 * exp(-g_ewald*g_ewald*cutoff*cutoff) / 
+  real_prec = 2.0*q2 * exp(-g_ewald*g_ewald*cutoff*cutoff) /
    sqrt(static_cast<double>(natoms)*cutoff*xprd*yprd*zprd);
   double value = kspace_prec - real_prec;
   return value;
 }
 
 /* ----------------------------------------------------------------------
-   pre-compute Green's function denominator expansion coeffs, Gamma(2n) 
+   pre-compute Green's function denominator expansion coeffs, Gamma(2n)
 ------------------------------------------------------------------------- */
 
 void PPPM::compute_gf_denom()
 {
   int k,l,m;
-  
+
   for (l = 1; l < order; l++) gf_b[l] = 0.0;
   gf_b[0] = 1.0;
-  
+
   for (m = 1; m < order; m++) {
-    for (l = m; l > 0; l--) 
+    for (l = m; l > 0; l--)
       gf_b[l] = 4.0 * (gf_b[l]*(l-m)*(l-m-0.5)-gf_b[l-1]*(l-m-1)*(l-m-1));
     gf_b[0] = 4.0 * (gf_b[0]*(l-m)*(l-m-0.5));
   }
@@ -1210,7 +1210,7 @@ void PPPM::compute_gf_denom()
 }
 
 /* ----------------------------------------------------------------------
-   ghost-swap to accumulate full density in brick decomposition 
+   ghost-swap to accumulate full density in brick decomposition
    remap density from 3d brick decomposition to FFT decomposition
 ------------------------------------------------------------------------- */
 
@@ -1228,7 +1228,7 @@ void PPPM::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxhi_in+1; ix <= nxhi_out; ix++)
-	buf1[n++] = density_brick[iz][iy][ix];
+        buf1[n++] = density_brick[iz][iy][ix];
 
   if (comm->procneigh[0][1] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -1242,7 +1242,7 @@ void PPPM::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxlo_in; ix < nxlo_in+nxlo_ghost; ix++)
-	density_brick[iz][iy][ix] += buf2[n++];
+        density_brick[iz][iy][ix] += buf2[n++];
 
   // pack my ghosts for -x processor
   // pass data to self or -x processor
@@ -1252,7 +1252,7 @@ void PPPM::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxlo_out; ix < nxlo_in; ix++)
-	buf1[n++] = density_brick[iz][iy][ix];
+        buf1[n++] = density_brick[iz][iy][ix];
 
   if (comm->procneigh[0][0] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -1266,7 +1266,7 @@ void PPPM::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxhi_in-nxhi_ghost+1; ix <= nxhi_in; ix++)
-	density_brick[iz][iy][ix] += buf2[n++];
+        density_brick[iz][iy][ix] += buf2[n++];
 
   // pack my ghosts for +y processor
   // pass data to self or +y processor
@@ -1276,7 +1276,7 @@ void PPPM::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nyhi_in+1; iy <= nyhi_out; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	buf1[n++] = density_brick[iz][iy][ix];
+        buf1[n++] = density_brick[iz][iy][ix];
 
   if (comm->procneigh[1][1] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -1290,7 +1290,7 @@ void PPPM::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_in; iy < nylo_in+nylo_ghost; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	density_brick[iz][iy][ix] += buf2[n++];
+        density_brick[iz][iy][ix] += buf2[n++];
 
   // pack my ghosts for -y processor
   // pass data to self or -y processor
@@ -1300,7 +1300,7 @@ void PPPM::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy < nylo_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	buf1[n++] = density_brick[iz][iy][ix];
+        buf1[n++] = density_brick[iz][iy][ix];
 
   if (comm->procneigh[1][0] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -1314,7 +1314,7 @@ void PPPM::brick2fft()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nyhi_in-nyhi_ghost+1; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	density_brick[iz][iy][ix] += buf2[n++];
+        density_brick[iz][iy][ix] += buf2[n++];
 
   // pack my ghosts for +z processor
   // pass data to self or +z processor
@@ -1324,7 +1324,7 @@ void PPPM::brick2fft()
   for (iz = nzhi_in+1; iz <= nzhi_out; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	buf1[n++] = density_brick[iz][iy][ix];
+        buf1[n++] = density_brick[iz][iy][ix];
 
   if (comm->procneigh[2][1] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -1338,7 +1338,7 @@ void PPPM::brick2fft()
   for (iz = nzlo_in; iz < nzlo_in+nzlo_ghost; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	density_brick[iz][iy][ix] += buf2[n++];
+        density_brick[iz][iy][ix] += buf2[n++];
 
   // pack my ghosts for -z processor
   // pass data to self or -z processor
@@ -1348,7 +1348,7 @@ void PPPM::brick2fft()
   for (iz = nzlo_out; iz < nzlo_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	buf1[n++] = density_brick[iz][iy][ix];
+        buf1[n++] = density_brick[iz][iy][ix];
 
   if (comm->procneigh[2][0] == me)
     for (i = 0; i < n; i++) buf2[i] = buf1[i];
@@ -1362,7 +1362,7 @@ void PPPM::brick2fft()
   for (iz = nzhi_in-nzhi_ghost+1; iz <= nzhi_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	density_brick[iz][iy][ix] += buf2[n++];
+        density_brick[iz][iy][ix] += buf2[n++];
 
   // remap from 3d brick decomposition to FFT decomposition
   // copy grabs inner portion of density from 3d brick
@@ -1373,7 +1373,7 @@ void PPPM::brick2fft()
   for (iz = nzlo_in; iz <= nzhi_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++)
-	density_fft[n++] = density_brick[iz][iy][ix];
+        density_fft[n++] = density_brick[iz][iy][ix];
 
   remap->perform(density_fft,density_fft,work1);
 }
@@ -1396,9 +1396,9 @@ void PPPM::fillbrick()
   for (iz = nzhi_in-nzhi_ghost+1; iz <= nzhi_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	buf1[n++] = vdx_brick[iz][iy][ix];
-	buf1[n++] = vdy_brick[iz][iy][ix];
-	buf1[n++] = vdz_brick[iz][iy][ix];
+        buf1[n++] = vdx_brick[iz][iy][ix];
+        buf1[n++] = vdy_brick[iz][iy][ix];
+        buf1[n++] = vdz_brick[iz][iy][ix];
       }
 
   if (comm->procneigh[2][1] == me)
@@ -1413,9 +1413,9 @@ void PPPM::fillbrick()
   for (iz = nzlo_out; iz < nzlo_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	vdx_brick[iz][iy][ix] = buf2[n++];
-	vdy_brick[iz][iy][ix] = buf2[n++];
-	vdz_brick[iz][iy][ix] = buf2[n++];
+        vdx_brick[iz][iy][ix] = buf2[n++];
+        vdy_brick[iz][iy][ix] = buf2[n++];
+        vdz_brick[iz][iy][ix] = buf2[n++];
       }
 
   // pack my real cells for -z processor
@@ -1426,9 +1426,9 @@ void PPPM::fillbrick()
   for (iz = nzlo_in; iz < nzlo_in+nzlo_ghost; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	buf1[n++] = vdx_brick[iz][iy][ix];
-	buf1[n++] = vdy_brick[iz][iy][ix];
-	buf1[n++] = vdz_brick[iz][iy][ix];
+        buf1[n++] = vdx_brick[iz][iy][ix];
+        buf1[n++] = vdy_brick[iz][iy][ix];
+        buf1[n++] = vdz_brick[iz][iy][ix];
       }
 
   if (comm->procneigh[2][0] == me)
@@ -1443,9 +1443,9 @@ void PPPM::fillbrick()
   for (iz = nzhi_in+1; iz <= nzhi_out; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	vdx_brick[iz][iy][ix] = buf2[n++];
-	vdy_brick[iz][iy][ix] = buf2[n++];
-	vdz_brick[iz][iy][ix] = buf2[n++];
+        vdx_brick[iz][iy][ix] = buf2[n++];
+        vdy_brick[iz][iy][ix] = buf2[n++];
+        vdz_brick[iz][iy][ix] = buf2[n++];
       }
 
   // pack my real cells for +y processor
@@ -1456,9 +1456,9 @@ void PPPM::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nyhi_in-nyhi_ghost+1; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	buf1[n++] = vdx_brick[iz][iy][ix];
-	buf1[n++] = vdy_brick[iz][iy][ix];
-	buf1[n++] = vdz_brick[iz][iy][ix];
+        buf1[n++] = vdx_brick[iz][iy][ix];
+        buf1[n++] = vdy_brick[iz][iy][ix];
+        buf1[n++] = vdz_brick[iz][iy][ix];
       }
 
   if (comm->procneigh[1][1] == me)
@@ -1473,9 +1473,9 @@ void PPPM::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy < nylo_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	vdx_brick[iz][iy][ix] = buf2[n++];
-	vdy_brick[iz][iy][ix] = buf2[n++];
-	vdz_brick[iz][iy][ix] = buf2[n++];
+        vdx_brick[iz][iy][ix] = buf2[n++];
+        vdy_brick[iz][iy][ix] = buf2[n++];
+        vdz_brick[iz][iy][ix] = buf2[n++];
       }
 
   // pack my real cells for -y processor
@@ -1486,9 +1486,9 @@ void PPPM::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_in; iy < nylo_in+nylo_ghost; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	buf1[n++] = vdx_brick[iz][iy][ix];
-	buf1[n++] = vdy_brick[iz][iy][ix];
-	buf1[n++] = vdz_brick[iz][iy][ix];
+        buf1[n++] = vdx_brick[iz][iy][ix];
+        buf1[n++] = vdy_brick[iz][iy][ix];
+        buf1[n++] = vdz_brick[iz][iy][ix];
       }
 
   if (comm->procneigh[1][0] == me)
@@ -1503,9 +1503,9 @@ void PPPM::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nyhi_in+1; iy <= nyhi_out; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	vdx_brick[iz][iy][ix] = buf2[n++];
-	vdy_brick[iz][iy][ix] = buf2[n++];
-	vdz_brick[iz][iy][ix] = buf2[n++];
+        vdx_brick[iz][iy][ix] = buf2[n++];
+        vdy_brick[iz][iy][ix] = buf2[n++];
+        vdz_brick[iz][iy][ix] = buf2[n++];
       }
 
   // pack my real cells for +x processor
@@ -1516,9 +1516,9 @@ void PPPM::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxhi_in-nxhi_ghost+1; ix <= nxhi_in; ix++) {
-	buf1[n++] = vdx_brick[iz][iy][ix];
-	buf1[n++] = vdy_brick[iz][iy][ix];
-	buf1[n++] = vdz_brick[iz][iy][ix];
+        buf1[n++] = vdx_brick[iz][iy][ix];
+        buf1[n++] = vdy_brick[iz][iy][ix];
+        buf1[n++] = vdz_brick[iz][iy][ix];
       }
 
   if (comm->procneigh[0][1] == me)
@@ -1533,9 +1533,9 @@ void PPPM::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxlo_out; ix < nxlo_in; ix++) {
-	vdx_brick[iz][iy][ix] = buf2[n++];
-	vdy_brick[iz][iy][ix] = buf2[n++];
-	vdz_brick[iz][iy][ix] = buf2[n++];
+        vdx_brick[iz][iy][ix] = buf2[n++];
+        vdy_brick[iz][iy][ix] = buf2[n++];
+        vdz_brick[iz][iy][ix] = buf2[n++];
       }
 
   // pack my real cells for -x processor
@@ -1546,9 +1546,9 @@ void PPPM::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxlo_in; ix < nxlo_in+nxlo_ghost; ix++) {
-	buf1[n++] = vdx_brick[iz][iy][ix];
-	buf1[n++] = vdy_brick[iz][iy][ix];
-	buf1[n++] = vdz_brick[iz][iy][ix];
+        buf1[n++] = vdx_brick[iz][iy][ix];
+        buf1[n++] = vdy_brick[iz][iy][ix];
+        buf1[n++] = vdz_brick[iz][iy][ix];
       }
 
   if (comm->procneigh[0][0] == me)
@@ -1563,9 +1563,9 @@ void PPPM::fillbrick()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxhi_in+1; ix <= nxhi_out; ix++) {
-	vdx_brick[iz][iy][ix] = buf2[n++];
-	vdy_brick[iz][iy][ix] = buf2[n++];
-	vdz_brick[iz][iy][ix] = buf2[n++];
+        vdx_brick[iz][iy][ix] = buf2[n++];
+        vdy_brick[iz][iy][ix] = buf2[n++];
+        vdz_brick[iz][iy][ix] = buf2[n++];
       }
 }
 
@@ -1587,22 +1587,22 @@ void PPPM::fillbrick_peratom()
   for (iz = nzhi_in-nzhi_ghost+1; iz <= nzhi_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
-	if (vflag_atom) {
-	  buf3[n++] = v0_brick[iz][iy][ix];
-	  buf3[n++] = v1_brick[iz][iy][ix];
-	  buf3[n++] = v2_brick[iz][iy][ix];
-	  buf3[n++] = v3_brick[iz][iy][ix];
-	  buf3[n++] = v4_brick[iz][iy][ix];
-	  buf3[n++] = v5_brick[iz][iy][ix];
-	}
+        if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
+        if (vflag_atom) {
+          buf3[n++] = v0_brick[iz][iy][ix];
+          buf3[n++] = v1_brick[iz][iy][ix];
+          buf3[n++] = v2_brick[iz][iy][ix];
+          buf3[n++] = v3_brick[iz][iy][ix];
+          buf3[n++] = v4_brick[iz][iy][ix];
+          buf3[n++] = v5_brick[iz][iy][ix];
+        }
       }
 
   if (comm->procneigh[2][1] == me)
     for (i = 0; i < n; i++) buf4[i] = buf3[i];
   else {
     MPI_Irecv(buf4,nbuf_peratom,MPI_FFT_SCALAR,
-	      comm->procneigh[2][0],0,world,&request);
+              comm->procneigh[2][0],0,world,&request);
     MPI_Send(buf3,n,MPI_FFT_SCALAR,comm->procneigh[2][1],0,world);
     MPI_Wait(&request,&status);
   }
@@ -1611,15 +1611,15 @@ void PPPM::fillbrick_peratom()
   for (iz = nzlo_out; iz < nzlo_in; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
-	if (vflag_atom) {
-	  v0_brick[iz][iy][ix] = buf4[n++];
-	  v1_brick[iz][iy][ix] = buf4[n++];
-	  v2_brick[iz][iy][ix] = buf4[n++];
-	  v3_brick[iz][iy][ix] = buf4[n++];
-	  v4_brick[iz][iy][ix] = buf4[n++];
-	  v5_brick[iz][iy][ix] = buf4[n++];
-	}
+        if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
+        if (vflag_atom) {
+          v0_brick[iz][iy][ix] = buf4[n++];
+          v1_brick[iz][iy][ix] = buf4[n++];
+          v2_brick[iz][iy][ix] = buf4[n++];
+          v3_brick[iz][iy][ix] = buf4[n++];
+          v4_brick[iz][iy][ix] = buf4[n++];
+          v5_brick[iz][iy][ix] = buf4[n++];
+        }
       }
 
   // pack my real cells for -z processor
@@ -1630,22 +1630,22 @@ void PPPM::fillbrick_peratom()
   for (iz = nzlo_in; iz < nzlo_in+nzlo_ghost; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
-	if (vflag_atom) {
-	  buf3[n++] = v0_brick[iz][iy][ix];
-	  buf3[n++] = v1_brick[iz][iy][ix];
-	  buf3[n++] = v2_brick[iz][iy][ix];
-	  buf3[n++] = v3_brick[iz][iy][ix];
-	  buf3[n++] = v4_brick[iz][iy][ix];
-	  buf3[n++] = v5_brick[iz][iy][ix];
-	}
+        if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
+        if (vflag_atom) {
+          buf3[n++] = v0_brick[iz][iy][ix];
+          buf3[n++] = v1_brick[iz][iy][ix];
+          buf3[n++] = v2_brick[iz][iy][ix];
+          buf3[n++] = v3_brick[iz][iy][ix];
+          buf3[n++] = v4_brick[iz][iy][ix];
+          buf3[n++] = v5_brick[iz][iy][ix];
+        }
       }
 
   if (comm->procneigh[2][0] == me)
     for (i = 0; i < n; i++) buf4[i] = buf3[i];
   else {
     MPI_Irecv(buf4,nbuf_peratom,MPI_FFT_SCALAR,
-	      comm->procneigh[2][1],0,world,&request);
+              comm->procneigh[2][1],0,world,&request);
     MPI_Send(buf3,n,MPI_FFT_SCALAR,comm->procneigh[2][0],0,world);
     MPI_Wait(&request,&status);
   }
@@ -1654,15 +1654,15 @@ void PPPM::fillbrick_peratom()
   for (iz = nzhi_in+1; iz <= nzhi_out; iz++)
     for (iy = nylo_in; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
-	if (vflag_atom) {
-	  v0_brick[iz][iy][ix] = buf4[n++];
-	  v1_brick[iz][iy][ix] = buf4[n++];
-	  v2_brick[iz][iy][ix] = buf4[n++];
-	  v3_brick[iz][iy][ix] = buf4[n++];
-	  v4_brick[iz][iy][ix] = buf4[n++];
-	  v5_brick[iz][iy][ix] = buf4[n++];
-	}
+        if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
+        if (vflag_atom) {
+          v0_brick[iz][iy][ix] = buf4[n++];
+          v1_brick[iz][iy][ix] = buf4[n++];
+          v2_brick[iz][iy][ix] = buf4[n++];
+          v3_brick[iz][iy][ix] = buf4[n++];
+          v4_brick[iz][iy][ix] = buf4[n++];
+          v5_brick[iz][iy][ix] = buf4[n++];
+        }
       }
 
   // pack my real cells for +y processor
@@ -1673,22 +1673,22 @@ void PPPM::fillbrick_peratom()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nyhi_in-nyhi_ghost+1; iy <= nyhi_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
-	if (vflag_atom) {
-	  buf3[n++] = v0_brick[iz][iy][ix];
-	  buf3[n++] = v1_brick[iz][iy][ix];
-	  buf3[n++] = v2_brick[iz][iy][ix];
-	  buf3[n++] = v3_brick[iz][iy][ix];
-	  buf3[n++] = v4_brick[iz][iy][ix];
-	  buf3[n++] = v5_brick[iz][iy][ix];
-	}
+        if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
+        if (vflag_atom) {
+          buf3[n++] = v0_brick[iz][iy][ix];
+          buf3[n++] = v1_brick[iz][iy][ix];
+          buf3[n++] = v2_brick[iz][iy][ix];
+          buf3[n++] = v3_brick[iz][iy][ix];
+          buf3[n++] = v4_brick[iz][iy][ix];
+          buf3[n++] = v5_brick[iz][iy][ix];
+        }
       }
 
   if (comm->procneigh[1][1] == me)
     for (i = 0; i < n; i++) buf4[i] = buf3[i];
   else {
     MPI_Irecv(buf4,nbuf_peratom,MPI_FFT_SCALAR,
-	      comm->procneigh[1][0],0,world,&request);
+              comm->procneigh[1][0],0,world,&request);
     MPI_Send(buf3,n,MPI_FFT_SCALAR,comm->procneigh[1][1],0,world);
     MPI_Wait(&request,&status);
   }
@@ -1697,15 +1697,15 @@ void PPPM::fillbrick_peratom()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy < nylo_in; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
-	if (vflag_atom) {
-	  v0_brick[iz][iy][ix] = buf4[n++];
-	  v1_brick[iz][iy][ix] = buf4[n++];
-	  v2_brick[iz][iy][ix] = buf4[n++];
-	  v3_brick[iz][iy][ix] = buf4[n++];
-	  v4_brick[iz][iy][ix] = buf4[n++];
-	  v5_brick[iz][iy][ix] = buf4[n++];
-	}
+        if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
+        if (vflag_atom) {
+          v0_brick[iz][iy][ix] = buf4[n++];
+          v1_brick[iz][iy][ix] = buf4[n++];
+          v2_brick[iz][iy][ix] = buf4[n++];
+          v3_brick[iz][iy][ix] = buf4[n++];
+          v4_brick[iz][iy][ix] = buf4[n++];
+          v5_brick[iz][iy][ix] = buf4[n++];
+        }
       }
 
   // pack my real cells for -y processor
@@ -1716,22 +1716,22 @@ void PPPM::fillbrick_peratom()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_in; iy < nylo_in+nylo_ghost; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
-	if (vflag_atom) {
-	  buf3[n++] = v0_brick[iz][iy][ix];
-	  buf3[n++] = v1_brick[iz][iy][ix];
-	  buf3[n++] = v2_brick[iz][iy][ix];
-	  buf3[n++] = v3_brick[iz][iy][ix];
-	  buf3[n++] = v4_brick[iz][iy][ix];
-	  buf3[n++] = v5_brick[iz][iy][ix];
-	}
+        if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
+        if (vflag_atom) {
+          buf3[n++] = v0_brick[iz][iy][ix];
+          buf3[n++] = v1_brick[iz][iy][ix];
+          buf3[n++] = v2_brick[iz][iy][ix];
+          buf3[n++] = v3_brick[iz][iy][ix];
+          buf3[n++] = v4_brick[iz][iy][ix];
+          buf3[n++] = v5_brick[iz][iy][ix];
+        }
       }
 
   if (comm->procneigh[1][0] == me)
     for (i = 0; i < n; i++) buf4[i] = buf3[i];
   else {
     MPI_Irecv(buf4,nbuf_peratom,MPI_FFT_SCALAR,
-	      comm->procneigh[1][1],0,world,&request);
+              comm->procneigh[1][1],0,world,&request);
     MPI_Send(buf3,n,MPI_FFT_SCALAR,comm->procneigh[1][0],0,world);
     MPI_Wait(&request,&status);
   }
@@ -1740,15 +1740,15 @@ void PPPM::fillbrick_peratom()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nyhi_in+1; iy <= nyhi_out; iy++)
       for (ix = nxlo_in; ix <= nxhi_in; ix++) {
-	if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
-	if (vflag_atom) {
-	  v0_brick[iz][iy][ix] = buf4[n++];
-	  v1_brick[iz][iy][ix] = buf4[n++];
-	  v2_brick[iz][iy][ix] = buf4[n++];
-	  v3_brick[iz][iy][ix] = buf4[n++];
-	  v4_brick[iz][iy][ix] = buf4[n++];
-	  v5_brick[iz][iy][ix] = buf4[n++];
-	}
+        if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
+        if (vflag_atom) {
+          v0_brick[iz][iy][ix] = buf4[n++];
+          v1_brick[iz][iy][ix] = buf4[n++];
+          v2_brick[iz][iy][ix] = buf4[n++];
+          v3_brick[iz][iy][ix] = buf4[n++];
+          v4_brick[iz][iy][ix] = buf4[n++];
+          v5_brick[iz][iy][ix] = buf4[n++];
+        }
       }
 
   // pack my real cells for +x processor
@@ -1759,22 +1759,22 @@ void PPPM::fillbrick_peratom()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxhi_in-nxhi_ghost+1; ix <= nxhi_in; ix++) {
-	if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
-	if (vflag_atom) {
-	  buf3[n++] = v0_brick[iz][iy][ix];
-	  buf3[n++] = v1_brick[iz][iy][ix];
-	  buf3[n++] = v2_brick[iz][iy][ix];
-	  buf3[n++] = v3_brick[iz][iy][ix];
-	  buf3[n++] = v4_brick[iz][iy][ix];
-	  buf3[n++] = v5_brick[iz][iy][ix];
-	}
+        if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
+        if (vflag_atom) {
+          buf3[n++] = v0_brick[iz][iy][ix];
+          buf3[n++] = v1_brick[iz][iy][ix];
+          buf3[n++] = v2_brick[iz][iy][ix];
+          buf3[n++] = v3_brick[iz][iy][ix];
+          buf3[n++] = v4_brick[iz][iy][ix];
+          buf3[n++] = v5_brick[iz][iy][ix];
+        }
       }
 
   if (comm->procneigh[0][1] == me)
     for (i = 0; i < n; i++) buf4[i] = buf3[i];
   else {
     MPI_Irecv(buf4,nbuf_peratom,MPI_FFT_SCALAR,
-	      comm->procneigh[0][0],0,world,&request);
+              comm->procneigh[0][0],0,world,&request);
     MPI_Send(buf3,n,MPI_FFT_SCALAR,comm->procneigh[0][1],0,world);
     MPI_Wait(&request,&status);
   }
@@ -1783,15 +1783,15 @@ void PPPM::fillbrick_peratom()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxlo_out; ix < nxlo_in; ix++) {
-	if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
-	if (vflag_atom) {
-	  v0_brick[iz][iy][ix] = buf4[n++];
-	  v1_brick[iz][iy][ix] = buf4[n++];
-	  v2_brick[iz][iy][ix] = buf4[n++];
-	  v3_brick[iz][iy][ix] = buf4[n++];
-	  v4_brick[iz][iy][ix] = buf4[n++];
-	  v5_brick[iz][iy][ix] = buf4[n++];
-	}
+        if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
+        if (vflag_atom) {
+          v0_brick[iz][iy][ix] = buf4[n++];
+          v1_brick[iz][iy][ix] = buf4[n++];
+          v2_brick[iz][iy][ix] = buf4[n++];
+          v3_brick[iz][iy][ix] = buf4[n++];
+          v4_brick[iz][iy][ix] = buf4[n++];
+          v5_brick[iz][iy][ix] = buf4[n++];
+        }
       }
 
   // pack my real cells for -x processor
@@ -1802,22 +1802,22 @@ void PPPM::fillbrick_peratom()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxlo_in; ix < nxlo_in+nxlo_ghost; ix++) {
-	if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
-	if (vflag_atom) {
-	  buf3[n++] = v0_brick[iz][iy][ix];
-	  buf3[n++] = v1_brick[iz][iy][ix];
-	  buf3[n++] = v2_brick[iz][iy][ix];
-	  buf3[n++] = v3_brick[iz][iy][ix];
-	  buf3[n++] = v4_brick[iz][iy][ix];
-	  buf3[n++] = v5_brick[iz][iy][ix];
-	}
+        if (eflag_atom) buf3[n++] = u_brick[iz][iy][ix];
+        if (vflag_atom) {
+          buf3[n++] = v0_brick[iz][iy][ix];
+          buf3[n++] = v1_brick[iz][iy][ix];
+          buf3[n++] = v2_brick[iz][iy][ix];
+          buf3[n++] = v3_brick[iz][iy][ix];
+          buf3[n++] = v4_brick[iz][iy][ix];
+          buf3[n++] = v5_brick[iz][iy][ix];
+        }
       }
 
   if (comm->procneigh[0][0] == me)
     for (i = 0; i < n; i++) buf4[i] = buf3[i];
   else {
     MPI_Irecv(buf4,nbuf_peratom,MPI_FFT_SCALAR,
-	      comm->procneigh[0][1],0,world,&request);
+              comm->procneigh[0][1],0,world,&request);
     MPI_Send(buf3,n,MPI_FFT_SCALAR,comm->procneigh[0][0],0,world);
     MPI_Wait(&request,&status);
   }
@@ -1826,22 +1826,22 @@ void PPPM::fillbrick_peratom()
   for (iz = nzlo_out; iz <= nzhi_out; iz++)
     for (iy = nylo_out; iy <= nyhi_out; iy++)
       for (ix = nxhi_in+1; ix <= nxhi_out; ix++) {
-	if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
-	if (vflag_atom) {
-	  v0_brick[iz][iy][ix] = buf4[n++];
-	  v1_brick[iz][iy][ix] = buf4[n++];
-	  v2_brick[iz][iy][ix] = buf4[n++];
-	  v3_brick[iz][iy][ix] = buf4[n++];
-	  v4_brick[iz][iy][ix] = buf4[n++];
-	  v5_brick[iz][iy][ix] = buf4[n++];
-	}
+        if (eflag_atom) u_brick[iz][iy][ix] = buf4[n++];
+        if (vflag_atom) {
+          v0_brick[iz][iy][ix] = buf4[n++];
+          v1_brick[iz][iy][ix] = buf4[n++];
+          v2_brick[iz][iy][ix] = buf4[n++];
+          v3_brick[iz][iy][ix] = buf4[n++];
+          v4_brick[iz][iy][ix] = buf4[n++];
+          v5_brick[iz][iy][ix] = buf4[n++];
+        }
       }
 }
 
 /* ----------------------------------------------------------------------
    find center grid pt for each of my particles
    check that full stencil for the particle will fit in my 3d brick
-   store central grid pt indices in part2grid array 
+   store central grid pt indices in part2grid array
 ------------------------------------------------------------------------- */
 
 void PPPM::particle_map()
@@ -1853,7 +1853,7 @@ void PPPM::particle_map()
 
   int flag = 0;
   for (int i = 0; i < nlocal; i++) {
-    
+
     // (nx,ny,nz) = global coords of grid pt to "lower left" of charge
     // current particle coord can be outside global and local box
     // add/subtract OFFSET to avoid int(-0.75) = 0 when want it to be -1
@@ -1869,8 +1869,8 @@ void PPPM::particle_map()
     // check that entire stencil around nx,ny,nz will fit in my 3d brick
 
     if (nx+nlower < nxlo_out || nx+nupper > nxhi_out ||
-	ny+nlower < nylo_out || ny+nupper > nyhi_out ||
-	nz+nlower < nzlo_out || nz+nupper > nzhi_out)
+        ny+nlower < nylo_out || ny+nupper > nyhi_out ||
+        nz+nlower < nzlo_out || nz+nupper > nzhi_out)
       flag = 1;
   }
 
@@ -1881,7 +1881,7 @@ void PPPM::particle_map()
    create discretized "density" on section of global grid due to my particles
    density(x,y,z) = charge "density" at grid points of my 3d brick
    (nxlo:nxhi,nylo:nyhi,nzlo:nzhi) is extent of my brick (including ghosts)
-   in global grid 
+   in global grid
 ------------------------------------------------------------------------- */
 
 void PPPM::make_rho()
@@ -1892,7 +1892,7 @@ void PPPM::make_rho()
   // clear 3d density array
 
   memset(&(density_brick[nzlo_out][nylo_out][nxlo_out]),0,
-	 ngrid*sizeof(FFT_SCALAR));
+         ngrid*sizeof(FFT_SCALAR));
 
   // loop over my charges, add their contribution to nearby grid points
   // (nx,ny,nz) = global coords of grid pt to "lower left" of charge
@@ -1919,19 +1919,19 @@ void PPPM::make_rho()
       mz = n+nz;
       y0 = z0*rho1d[2][n];
       for (m = nlower; m <= nupper; m++) {
-	my = m+ny;
-	x0 = y0*rho1d[1][m];
-	for (l = nlower; l <= nupper; l++) {
-	  mx = l+nx;
-	  density_brick[mz][my][mx] += x0*rho1d[0][l];
-	}
+        my = m+ny;
+        x0 = y0*rho1d[1][m];
+        for (l = nlower; l <= nupper; l++) {
+          mx = l+nx;
+          density_brick[mz][my][mx] += x0*rho1d[0][l];
+        }
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   FFT-based Poisson solver 
+   FFT-based Poisson solver
 ------------------------------------------------------------------------- */
 
 void PPPM::poisson()
@@ -1939,14 +1939,14 @@ void PPPM::poisson()
   int i,j,k,n;
   double eng;
 
-  // transform charge density (r -> k) 
+  // transform charge density (r -> k)
 
   n = 0;
   for (i = 0; i < nfft; i++) {
     work1[n++] = density_fft[i];
     work1[n++] = ZEROF;
   }
- 
+
   fft1->compute(work1,work1,1);
 
   // global energy and virial contribution
@@ -1958,17 +1958,17 @@ void PPPM::poisson()
     if (vflag_global) {
       n = 0;
       for (i = 0; i < nfft; i++) {
-	eng = s2 * greensfn[i] * (work1[n]*work1[n] + work1[n+1]*work1[n+1]);
-	for (j = 0; j < 6; j++) virial[j] += eng*vg[i][j];
-	if (eflag_global) energy += eng;
-	n += 2;
+        eng = s2 * greensfn[i] * (work1[n]*work1[n] + work1[n+1]*work1[n+1]);
+        for (j = 0; j < 6; j++) virial[j] += eng*vg[i][j];
+        if (eflag_global) energy += eng;
+        n += 2;
       }
     } else {
       n = 0;
       for (i = 0; i < nfft; i++) {
-	energy += 
-	  s2 * greensfn[i] * (work1[n]*work1[n] + work1[n+1]*work1[n+1]);
-	n += 2;
+        energy +=
+          s2 * greensfn[i] * (work1[n]*work1[n] + work1[n+1]*work1[n+1]);
+        n += 2;
       }
     }
   }
@@ -1996,9 +1996,9 @@ void PPPM::poisson()
   for (k = nzlo_fft; k <= nzhi_fft; k++)
     for (j = nylo_fft; j <= nyhi_fft; j++)
       for (i = nxlo_fft; i <= nxhi_fft; i++) {
-	work2[n] = fkx[i]*work1[n+1];
-	work2[n+1] = -fkx[i]*work1[n];
-	n += 2;
+        work2[n] = fkx[i]*work1[n+1];
+        work2[n+1] = -fkx[i]*work1[n];
+        n += 2;
       }
 
   fft2->compute(work2,work2,-1);
@@ -2007,8 +2007,8 @@ void PPPM::poisson()
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in; i <= nxhi_in; i++) {
-	vdx_brick[k][j][i] = work2[n];
-	n += 2;
+        vdx_brick[k][j][i] = work2[n];
+        n += 2;
       }
 
   // y direction gradient
@@ -2017,9 +2017,9 @@ void PPPM::poisson()
   for (k = nzlo_fft; k <= nzhi_fft; k++)
     for (j = nylo_fft; j <= nyhi_fft; j++)
       for (i = nxlo_fft; i <= nxhi_fft; i++) {
-	work2[n] = fky[j]*work1[n+1];
-	work2[n+1] = -fky[j]*work1[n];
-	n += 2;
+        work2[n] = fky[j]*work1[n+1];
+        work2[n+1] = -fky[j]*work1[n];
+        n += 2;
       }
 
   fft2->compute(work2,work2,-1);
@@ -2028,8 +2028,8 @@ void PPPM::poisson()
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in; i <= nxhi_in; i++) {
-	vdy_brick[k][j][i] = work2[n];
-	n += 2;
+        vdy_brick[k][j][i] = work2[n];
+        n += 2;
       }
 
   // z direction gradient
@@ -2038,9 +2038,9 @@ void PPPM::poisson()
   for (k = nzlo_fft; k <= nzhi_fft; k++)
     for (j = nylo_fft; j <= nyhi_fft; j++)
       for (i = nxlo_fft; i <= nxhi_fft; i++) {
-	work2[n] = fkz[k]*work1[n+1];
-	work2[n+1] = -fkz[k]*work1[n];
-	n += 2;
+        work2[n] = fkz[k]*work1[n+1];
+        work2[n+1] = -fkz[k]*work1[n];
+        n += 2;
       }
 
   fft2->compute(work2,work2,-1);
@@ -2049,8 +2049,8 @@ void PPPM::poisson()
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in; i <= nxhi_in; i++) {
-	vdz_brick[k][j][i] = work2[n];
-	n += 2;
+        vdz_brick[k][j][i] = work2[n];
+        n += 2;
       }
 }
 
@@ -2063,7 +2063,7 @@ void PPPM::poisson_peratom()
   int i,j,k,n;
 
   // energy
-    
+
   if (eflag_atom) {
     n = 0;
     for (i = 0; i < nfft; i++) {
@@ -2071,127 +2071,127 @@ void PPPM::poisson_peratom()
       work2[n+1] = work1[n+1];
       n += 2;
     }
-    
-    fft2->compute(work2,work2,-1); 
-    
+
+    fft2->compute(work2,work2,-1);
+
     n = 0;
     for (k = nzlo_in; k <= nzhi_in; k++)
       for (j = nylo_in; j <= nyhi_in; j++)
         for (i = nxlo_in; i <= nxhi_in; i++) {
-	  u_brick[k][j][i] = work2[n];
-	  n += 2;
+          u_brick[k][j][i] = work2[n];
+          n += 2;
         }
   }
-   
+
   // 6 components of virial in v0 thru v5
 
   if (!vflag_atom) return;
-	 
+
   n = 0;
   for (i = 0; i < nfft; i++) {
     work2[n] = work1[n]*vg[i][0];
     work2[n+1] = work1[n+1]*vg[i][0];
     n += 2;
   }
-    
-  fft2->compute(work2,work2,-1); 
-    
+
+  fft2->compute(work2,work2,-1);
+
   n = 0;
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in; i <= nxhi_in; i++) {
-	v0_brick[k][j][i] = work2[n];
-	n += 2;
+        v0_brick[k][j][i] = work2[n];
+        n += 2;
       }
-  
+
   n = 0;
   for (i = 0; i < nfft; i++) {
     work2[n] = work1[n]*vg[i][1];
     work2[n+1] = work1[n+1]*vg[i][1];
     n += 2;
   }
-  
-  fft2->compute(work2,work2,-1); 
-  
+
+  fft2->compute(work2,work2,-1);
+
   n = 0;
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in; i <= nxhi_in; i++) {
-	v1_brick[k][j][i] = work2[n];
-	n += 2;
+        v1_brick[k][j][i] = work2[n];
+        n += 2;
       }
-  
+
   n = 0;
   for (i = 0; i < nfft; i++) {
     work2[n] = work1[n]*vg[i][2];
     work2[n+1] = work1[n+1]*vg[i][2];
     n += 2;
   }
-    
-  fft2->compute(work2,work2,-1); 
-  
+
+  fft2->compute(work2,work2,-1);
+
   n = 0;
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in; i <= nxhi_in; i++) {
-	v2_brick[k][j][i] = work2[n];
-	n += 2;
+        v2_brick[k][j][i] = work2[n];
+        n += 2;
       }
-  
+
   n = 0;
   for (i = 0; i < nfft; i++) {
     work2[n] = work1[n]*vg[i][3];
     work2[n+1] = work1[n+1]*vg[i][3];
     n += 2;
   }
-  
-  fft2->compute(work2,work2,-1); 
-  
+
+  fft2->compute(work2,work2,-1);
+
   n = 0;
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in; i <= nxhi_in; i++) {
-	v3_brick[k][j][i] = work2[n];
-	n += 2;
+        v3_brick[k][j][i] = work2[n];
+        n += 2;
       }
-   
+
   n = 0;
   for (i = 0; i < nfft; i++) {
     work2[n] = work1[n]*vg[i][4];
     work2[n+1] = work1[n+1]*vg[i][4];
     n += 2;
   }
-  
-  fft2->compute(work2,work2,-1); 
-  
+
+  fft2->compute(work2,work2,-1);
+
   n = 0;
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in; i <= nxhi_in; i++) {
-	v4_brick[k][j][i] = work2[n];
-	n += 2;
+        v4_brick[k][j][i] = work2[n];
+        n += 2;
       }
-  
+
   n = 0;
   for (i = 0; i < nfft; i++) {
     work2[n] = work1[n]*vg[i][5];
     work2[n+1] = work1[n+1]*vg[i][5];
     n += 2;
   }
-    
-  fft2->compute(work2,work2,-1); 
-    
+
+  fft2->compute(work2,work2,-1);
+
   n = 0;
   for (k = nzlo_in; k <= nzhi_in; k++)
     for (j = nylo_in; j <= nyhi_in; j++)
       for (i = nxlo_in; i <= nxhi_in; i++) {
-	v5_brick[k][j][i] = work2[n];
-	n += 2;
+        v5_brick[k][j][i] = work2[n];
+        n += 2;
       }
 }
 
 /* ----------------------------------------------------------------------
-   interpolate from grid to get electric field & force on my particles 
+   interpolate from grid to get electric field & force on my particles
 ------------------------------------------------------------------------- */
 
 void PPPM::fieldforce()
@@ -2227,15 +2227,15 @@ void PPPM::fieldforce()
       mz = n+nz;
       z0 = rho1d[2][n];
       for (m = nlower; m <= nupper; m++) {
-	my = m+ny;
-	y0 = z0*rho1d[1][m];
-	for (l = nlower; l <= nupper; l++) {
-	  mx = l+nx;
-	  x0 = y0*rho1d[0][l];
-	  ekx -= x0*vdx_brick[mz][my][mx];
-	  eky -= x0*vdy_brick[mz][my][mx];
-	  ekz -= x0*vdz_brick[mz][my][mx];
-	}
+        my = m+ny;
+        y0 = z0*rho1d[1][m];
+        for (l = nlower; l <= nupper; l++) {
+          mx = l+nx;
+          x0 = y0*rho1d[0][l];
+          ekx -= x0*vdx_brick[mz][my][mx];
+          eky -= x0*vdy_brick[mz][my][mx];
+          ekz -= x0*vdz_brick[mz][my][mx];
+        }
       }
     }
 
@@ -2284,21 +2284,21 @@ void PPPM::fieldforce_peratom()
       mz = n+nz;
       z0 = rho1d[2][n];
       for (m = nlower; m <= nupper; m++) {
-	my = m+ny;
-	y0 = z0*rho1d[1][m];
-	for (l = nlower; l <= nupper; l++) {
-	  mx = l+nx;
-	  x0 = y0*rho1d[0][l];
-	  if (eflag_atom) u += x0*u_brick[mz][my][mx];	
-	  if (vflag_atom) {
-	    v0 += x0*v0_brick[mz][my][mx];
-	    v1 += x0*v1_brick[mz][my][mx];
-	    v2 += x0*v2_brick[mz][my][mx];
-	    v3 += x0*v3_brick[mz][my][mx];
-	    v4 += x0*v4_brick[mz][my][mx];
-	    v5 += x0*v5_brick[mz][my][mx];
-	  }
-	}
+        my = m+ny;
+        y0 = z0*rho1d[1][m];
+        for (l = nlower; l <= nupper; l++) {
+          mx = l+nx;
+          x0 = y0*rho1d[0][l];
+          if (eflag_atom) u += x0*u_brick[mz][my][mx];
+          if (vflag_atom) {
+            v0 += x0*v0_brick[mz][my][mx];
+            v1 += x0*v1_brick[mz][my][mx];
+            v2 += x0*v2_brick[mz][my][mx];
+            v3 += x0*v3_brick[mz][my][mx];
+            v4 += x0*v4_brick[mz][my][mx];
+            v5 += x0*v5_brick[mz][my][mx];
+          }
+        }
       }
     }
 
@@ -2315,7 +2315,7 @@ void PPPM::fieldforce_peratom()
 }
 
 /* ----------------------------------------------------------------------
-   map nprocs to NX by NY grid as PX by PY procs - return optimal px,py 
+   map nprocs to NX by NY grid as PX by PY procs - return optimal px,py
 ------------------------------------------------------------------------- */
 
 void PPPM::procs2grid2d(int nprocs, int nx, int ny, int *px, int *py)
@@ -2339,13 +2339,13 @@ void PPPM::procs2grid2d(int nprocs, int nx, int ny, int *px, int *py)
       boxy = ny/ipy;
       if (ny % ipy) boxy++;
       surf = boxx + boxy;
-      if (surf < bestsurf || 
-	  (surf == bestsurf && boxx*boxy > bestboxx*bestboxy)) {
-	bestsurf = surf;
-	bestboxx = boxx;
-	bestboxy = boxy;
-	*px = ipx;
-	*py = ipy;
+      if (surf < bestsurf ||
+          (surf == bestsurf && boxx*boxy > bestboxx*bestboxy)) {
+        bestsurf = surf;
+        bestboxx = boxx;
+        bestboxy = boxy;
+        *px = ipx;
+        *py = ipy;
       }
     }
     ipx++;
@@ -2354,11 +2354,11 @@ void PPPM::procs2grid2d(int nprocs, int nx, int ny, int *px, int *py)
 
 /* ----------------------------------------------------------------------
    charge assignment into rho1d
-   dx,dy,dz = distance of particle from "lower left" grid point 
+   dx,dy,dz = distance of particle from "lower left" grid point
 ------------------------------------------------------------------------- */
 
 void PPPM::compute_rho1d(const FFT_SCALAR &dx, const FFT_SCALAR &dy,
-			 const FFT_SCALAR &dz)
+                         const FFT_SCALAR &dz)
 {
   int k,l;
   FFT_SCALAR r1,r2,r3;
@@ -2393,7 +2393,7 @@ void PPPM::compute_rho1d(const FFT_SCALAR &dx, const FFT_SCALAR &dy,
              |  0                       otherwise
               ---
   a coeffients are packed into the array rho_coeff to eliminate zeros
-  rho_coeff(l,((k+mod(n+1,2))/2) = a(l,k) 
+  rho_coeff(l,((k+mod(n+1,2))/2) = a(l,k)
 ------------------------------------------------------------------------- */
 
 void PPPM::compute_rho_coeff()
@@ -2404,22 +2404,22 @@ void PPPM::compute_rho_coeff()
   FFT_SCALAR **a;
   memory->create2d_offset(a,order,-order,order,"pppm:a");
 
-  for (k = -order; k <= order; k++) 
+  for (k = -order; k <= order; k++)
     for (l = 0; l < order; l++)
       a[l][k] = 0.0;
-        
+
   a[0][0] = 1.0;
   for (j = 1; j < order; j++) {
     for (k = -j; k <= j; k += 2) {
       s = 0.0;
       for (l = 0; l < j; l++) {
-	a[l+1][k] = (a[l][k+1]-a[l][k-1]) / (l+1);
+        a[l+1][k] = (a[l][k+1]-a[l][k-1]) / (l+1);
 #ifdef FFT_SINGLE
-	s += powf(0.5,(float) l+1) *
-	  (a[l][k-1] + powf(-1.0,(float) l) * a[l][k+1]) / (l+1);
+        s += powf(0.5,(float) l+1) *
+          (a[l][k-1] + powf(-1.0,(float) l) * a[l][k+1]) / (l+1);
 #else
-	s += pow(0.5,(double) l+1) * 
-	  (a[l][k-1] + pow(-1.0,(double) l) * a[l][k+1]) / (l+1);
+        s += pow(0.5,(double) l+1) *
+          (a[l][k-1] + pow(-1.0,(double) l) * a[l][k+1]) / (l+1);
 #endif
       }
       a[0][k] = s;
@@ -2438,9 +2438,9 @@ void PPPM::compute_rho_coeff()
 
 /* ----------------------------------------------------------------------
    Slab-geometry correction term to dampen inter-slab interactions between
-   periodically repeating slabs.  Yields good approximation to 2D Ewald if 
-   adequate empty space is left between repeating slabs (J. Chem. Phys. 
-   111, 3155).  Slabs defined here to be parallel to the xy plane. 
+   periodically repeating slabs.  Yields good approximation to 2D Ewald if
+   adequate empty space is left between repeating slabs (J. Chem. Phys.
+   111, 3155).  Slabs defined here to be parallel to the xy plane.
 ------------------------------------------------------------------------- */
 
 void PPPM::slabcorr()
@@ -2453,29 +2453,29 @@ void PPPM::slabcorr()
 
   double dipole = 0.0;
   for (int i = 0; i < nlocal; i++) dipole += q[i]*x[i][2];
-  
+
   // sum local contributions to get global dipole moment
 
   double dipole_all;
   MPI_Allreduce(&dipole,&dipole_all,1,MPI_DOUBLE,MPI_SUM,world);
 
   // compute corrections
-  
+
   const double e_slabcorr = 2.0*MY_PI*dipole_all*dipole_all/volume;
   const double qscale = force->qqrd2e * scale;
-  
+
   if (eflag_global) energy += qscale * e_slabcorr;
 
   // per-atom energy
-    
+
   if (eflag_atom) {
-    double efact = 2.0*MY_PI*dipole_all/volume; 
+    double efact = 2.0*MY_PI*dipole_all/volume;
     for (int i = 0; i < nlocal; i++) eatom[i] += qscale * q[i]*x[i][2]*efact;
   }
 
   // add on force corrections
 
-  double ffact = -4.0*MY_PI*dipole_all/volume; 
+  double ffact = -4.0*MY_PI*dipole_all/volume;
   double **f = atom->f;
 
   for (int i = 0; i < nlocal; i++) f[i][2] += qscale * q[i]*ffact;
@@ -2521,13 +2521,13 @@ void PPPM::timing(int n, double &time3d, double &time1d)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local arrays 
+   memory usage of local arrays
 ------------------------------------------------------------------------- */
 
 double PPPM::memory_usage()
 {
   double bytes = nmax*3 * sizeof(double);
-  int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) * 
+  int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) *
     (nzhi_out-nzlo_out+1);
   bytes += 4 * nbrick * sizeof(FFT_SCALAR);
   bytes += 6 * nfft_both * sizeof(double);
@@ -2558,101 +2558,101 @@ double PPPM::memory_usage()
 
 void PPPM::compute_group_group(int groupbit_A, int groupbit_B, int BA_flag)
 {
-  if (slabflag) 
+  if (slabflag)
     error->all(FLERR,"Cannot (yet) use K-space slab "
-	       "correction with compute group/group");      
-    
+               "correction with compute group/group");
+
   int i,j;
-    
+
   if (!group_allocate_flag) {
     allocate_groups();
     group_allocate_flag = 1;
-  }    
-    
+  }
+
   e2group = 0; //energy
   f2group[0] = 0; //force in x-direction
   f2group[1] = 0; //force in y-direction
   f2group[2] = 0; //force in z-direction
-    
+
   double *q = atom->q;
   int nlocal = atom->nlocal;
   int *mask = atom->mask;
-    
-	
+
+
   // map my particle charge onto my local 3d density grid
-    
+
   make_rho_groups(groupbit_A,groupbit_B,BA_flag);
-    
+
   // all procs communicate density values from their ghost cells
   //   to fully sum contribution in their 3d bricks
   // remap from 3d decomposition to FFT decomposition
-    
+
   // temporarily store and switch pointers so we can
-  //  use brick2fft() for groups A and B (without 
+  //  use brick2fft() for groups A and B (without
   //  writing an additional function)
-    
+
   FFT_SCALAR ***density_brick_real = density_brick;
-  FFT_SCALAR *density_fft_real = density_fft;   
-    
+  FFT_SCALAR *density_fft_real = density_fft;
+
   // group A
-    
-  density_brick = density_A_brick;  
+
+  density_brick = density_A_brick;
   density_fft = density_A_fft;
-    
+
   brick2fft();
-    
+
   // group B
-    
-  density_brick = density_B_brick;  
+
+  density_brick = density_B_brick;
   density_fft = density_B_fft;
-    
+
   brick2fft();
 
   // switch back pointers
-    
+
   density_brick = density_brick_real;
-  density_fft = density_fft_real; 
-   
+  density_fft = density_fft_real;
+
   // compute potential gradient on my FFT grid and
   //   portion of group-group energy/force on this proc's FFT grid
-    
+
   poisson_groups(BA_flag);
-         
+
   const double qscale = force->qqrd2e * scale;
-    
+
   // total group A <--> group B energy
   // self and boundary correction terms are in compute_group_group.cpp
-    
+
   double e2group_all;
   MPI_Allreduce(&e2group,&e2group_all,1,MPI_DOUBLE,MPI_SUM,world);
   e2group = e2group_all;
-  
+
   e2group *= qscale*0.5*volume;
-    
+
   // total group A <--> group B force
-      
+
   double f2group_all[3];
   MPI_Allreduce(f2group,f2group_all,3,MPI_DOUBLE,MPI_SUM,world);
-    
-  for (i = 0; i < 3; i++) f2group[i] = qscale*volume*f2group_all[i];   
+
+  for (i = 0; i < 3; i++) f2group[i] = qscale*volume*f2group_all[i];
 }
 
 /* ----------------------------------------------------------------------
- allocate group-group memory that depends on # of K-vectors and order 
+ allocate group-group memory that depends on # of K-vectors and order
  ------------------------------------------------------------------------- */
 
 void PPPM::allocate_groups()
-{  
+{
   memory->create3d_offset(density_A_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:density_A_brick");
+                          nxlo_out,nxhi_out,"pppm:density_A_brick");
   memory->create3d_offset(density_B_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:density_B_brick");
+                          nxlo_out,nxhi_out,"pppm:density_B_brick");
   memory->create(density_A_fft,nfft_both,"pppm:density_A_fft");
   memory->create(density_B_fft,nfft_both,"pppm:density_B_fft");
 }
 
 /* ----------------------------------------------------------------------
- deallocate group-group memory that depends on # of K-vectors and order 
+ deallocate group-group memory that depends on # of K-vectors and order
  ------------------------------------------------------------------------- */
 
 void PPPM::deallocate_groups()
@@ -2674,41 +2674,41 @@ void PPPM::make_rho_groups(int groupbit_A, int groupbit_B, int BA_flag)
 {
   int l,m,n,nx,ny,nz,mx,my,mz;
   FFT_SCALAR dx,dy,dz,x0,y0,z0;
-    
+
   // clear 3d density arrays
-    
+
   memset(&(density_A_brick[nzlo_out][nylo_out][nxlo_out]),0,
          ngrid*sizeof(FFT_SCALAR));
-    
+
   memset(&(density_B_brick[nzlo_out][nylo_out][nxlo_out]),0,
          ngrid*sizeof(FFT_SCALAR));
-    
+
   // loop over my charges, add their contribution to nearby grid points
   // (nx,ny,nz) = global coords of grid pt to "lower left" of charge
   // (dx,dy,dz) = distance to "lower left" grid pt
   // (mx,my,mz) = global coords of moving stencil pt
-    
+
   double *q = atom->q;
   double **x = atom->x;
   int nlocal = atom->nlocal;
   int *mask = atom->mask;
-    
+
   for (int i = 0; i < nlocal; i++) {
-      
+
     if ((mask[i] & groupbit_A) && (mask[i] & groupbit_B))
-      if (BA_flag) continue;  
-      
-    if ((mask[i] & groupbit_A) || (mask[i] & groupbit_B)) { 
-        
+      if (BA_flag) continue;
+
+    if ((mask[i] & groupbit_A) || (mask[i] & groupbit_B)) {
+
       nx = part2grid[i][0];
       ny = part2grid[i][1];
       nz = part2grid[i][2];
       dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
       dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
       dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
-        
+
       compute_rho1d(dx,dy,dz);
-        
+
       z0 = delvolinv * q[i];
       for (n = nlower; n <= nupper; n++) {
         mz = n+nz;
@@ -2718,14 +2718,14 @@ void PPPM::make_rho_groups(int groupbit_A, int groupbit_B, int BA_flag)
           x0 = y0*rho1d[1][m];
           for (l = nlower; l <= nupper; l++) {
             mx = l+nx;
-                    
+
             // group A
-                    
+
             if (mask[i] & groupbit_A)
               density_A_brick[mz][my][mx] += x0*rho1d[0][l];
-               
+
             // group B
-                
+
             if (mask[i] & groupbit_B)
               density_B_brick[mz][my][mx] += x0*rho1d[0][l];
           }
@@ -2743,66 +2743,66 @@ void PPPM::poisson_groups(int BA_flag)
 {
   int i,j,k,n;
   double eng;
-   
-  // reuse memory (already declared)  
-    
+
+  // reuse memory (already declared)
+
   FFT_SCALAR *work_A = work1;
   FFT_SCALAR *work_B = work2;
-    
-  // transform charge density (r -> k) 
-    
-  // group A  
-    
+
+  // transform charge density (r -> k)
+
+  // group A
+
   n = 0;
   for (i = 0; i < nfft; i++) {
     work_A[n++] = density_A_fft[i];
     work_A[n++] = ZEROF;
   }
-    
+
   fft1->compute(work_A,work_A,1);
 
-  // group B  
-    
+  // group B
+
   n = 0;
   for (i = 0; i < nfft; i++) {
     work_B[n++] = density_B_fft[i];
     work_B[n++] = ZEROF;
   }
-    
+
   fft1->compute(work_B,work_B,1);
-    
+
   // group-group energy and force contribution,
-  //  keep everything in reciprocal space so 
+  //  keep everything in reciprocal space so
   //  no inverse FFTs needed
-    
+
   double scaleinv = 1.0/(nx_pppm*ny_pppm*nz_pppm);
   double s2 = scaleinv*scaleinv;
-     
+
   // energy
-    
+
   n = 0;
   for (i = 0; i < nfft; i++) {
-    e2group += s2 * greensfn[i] * 
-      (work_A[n]*work_B[n] + work_A[n+1]*work_B[n+1]);     
+    e2group += s2 * greensfn[i] *
+      (work_A[n]*work_B[n] + work_A[n+1]*work_B[n+1]);
     n += 2;
   }
-    
+
   if (BA_flag) return;
-    
-    
-  // multiply by Green's function and s2 
+
+
+  // multiply by Green's function and s2
   //  (only for work_A so it is not squared below)
-    
+
   n = 0;
   for (i = 0; i < nfft; i++) {
     work_A[n++] *= s2 * greensfn[i];
     work_A[n++] *= s2 * greensfn[i];
-  }   
-    
+  }
+
   double partial_group;
-    
+
   // force, x direction
-    
+
   n = 0;
   for (k = nzlo_fft; k <= nzhi_fft; k++)
     for (j = nylo_fft; j <= nyhi_fft; j++)
@@ -2811,9 +2811,9 @@ void PPPM::poisson_groups(int BA_flag)
         f2group[0] += fkx[i] * partial_group;
         n += 2;
       }
-       
+
   // force, y direction
-    
+
   n = 0;
   for (k = nzlo_fft; k <= nzhi_fft; k++)
     for (j = nylo_fft; j <= nyhi_fft; j++)
@@ -2822,9 +2822,9 @@ void PPPM::poisson_groups(int BA_flag)
         f2group[1] += fky[j] * partial_group;
         n += 2;
       }
-      
+
   // force, z direction
-   
+
   n = 0;
   for (k = nzlo_fft; k <= nzhi_fft; k++)
     for (j = nylo_fft; j <= nyhi_fft; j++)
@@ -2832,5 +2832,5 @@ void PPPM::poisson_groups(int BA_flag)
         partial_group = work_A[n+1]*work_B[n] - work_A[n]*work_B[n+1];
         f2group[2] += fkz[k] * partial_group;
         n += 2;
-      } 
+      }
 }
diff --git a/src/KSPACE/pppm.h b/src/KSPACE/pppm.h
index 356cda7735..6a51d68238 100644
--- a/src/KSPACE/pppm.h
+++ b/src/KSPACE/pppm.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -121,8 +121,8 @@ class PPPM : public KSpace {
   virtual void fieldforce();
   virtual void fieldforce_peratom();
   void procs2grid2d(int,int,int,int *, int*);
-  void compute_rho1d(const FFT_SCALAR &, const FFT_SCALAR &, 
-		     const FFT_SCALAR &);
+  void compute_rho1d(const FFT_SCALAR &, const FFT_SCALAR &,
+                     const FFT_SCALAR &);
   void compute_rho_coeff();
   void slabcorr();
 
@@ -132,7 +132,7 @@ class PPPM : public KSpace {
   virtual void deallocate_groups();
   virtual void make_rho_groups(int, int, int);
   virtual void poisson_groups(int);
-  
+
 /* ----------------------------------------------------------------------
    denominator for Hockney-Eastwood Green's function
      of x,y,z = sin(kx*deltax/2), etc
@@ -142,11 +142,11 @@ class PPPM : public KSpace {
            j=-inf               l=0
 
           = -(z*z)**n /(2n-1)! * (d/dx)**(2n-1) cot(x)  at z = sin(x)
-   gf_b = denominator expansion coeffs 
+   gf_b = denominator expansion coeffs
 ------------------------------------------------------------------------- */
 
-  inline double gf_denom(const double &x, const double &y, 
-			 const double &z) const {
+  inline double gf_denom(const double &x, const double &y,
+                         const double &z) const {
     double sx,sy,sz;
     sz = sy = sx = 0.0;
     for (int l = order-1; l >= 0; l--) {
@@ -242,7 +242,7 @@ E: PPPM order has been reduced to 0
 
 LAMMPS has attempted to reduce the PPPM order to enable the simulation
 to run, but can reduce the order no further.  Try increasing the
-accuracy of PPPM by reducing the tolerance size, thus inducing a 
+accuracy of PPPM by reducing the tolerance size, thus inducing a
 larger PPPM grid.
 
 E: Cannot compute PPPM G
diff --git a/src/KSPACE/pppm_cg.cpp b/src/KSPACE/pppm_cg.cpp
index fa4ece88ed..f98584426b 100644
--- a/src/KSPACE/pppm_cg.cpp
+++ b/src/KSPACE/pppm_cg.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -44,7 +44,7 @@ using namespace MathConst;
 
 PPPMCG::PPPMCG(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
 {
-  if ((narg < 1) || (narg > 2)) 
+  if ((narg < 1) || (narg > 2))
     error->all(FLERR,"Illegal kspace_style pppm/cg command");
 
   if (narg == 2)
@@ -57,7 +57,7 @@ PPPMCG::PPPMCG(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, narg, arg)
 }
 
 /* ----------------------------------------------------------------------
-   free all memory 
+   free all memory
 ------------------------------------------------------------------------- */
 
 PPPMCG::~PPPMCG()
@@ -66,7 +66,7 @@ PPPMCG::~PPPMCG()
 }
 
 /* ----------------------------------------------------------------------
-   compute the PPPM long-range force, energy, virial 
+   compute the PPPM long-range force, energy, virial
 ------------------------------------------------------------------------- */
 
 void PPPMCG::compute(int eflag, int vflag)
@@ -77,8 +77,8 @@ void PPPMCG::compute(int eflag, int vflag)
   // invoke allocate_peratom() if needed for first time
 
   if (eflag || vflag) ev_setup(eflag,vflag);
-  else evflag = evflag_atom = eflag_global = vflag_global = 
-	 eflag_atom = vflag_atom = 0;
+  else evflag = evflag_atom = eflag_global = vflag_global =
+         eflag_atom = vflag_atom = 0;
 
   if (evflag_atom && !peratom_allocate_flag) {
     allocate_peratom();
@@ -86,7 +86,7 @@ void PPPMCG::compute(int eflag, int vflag)
   }
 
   // convert atoms from box to lamda coords
-  
+
   if (triclinic == 0) boxlo = domain->boxlo;
   else {
     boxlo = domain->boxlo_lamda;
@@ -117,7 +117,7 @@ void PPPMCG::compute(int eflag, int vflag)
     // get fraction of charged particles per domain
 
     if (atom->nlocal > 0)
-      charged_frac = static_cast<double>(num_charged) * 100.0 
+      charged_frac = static_cast<double>(num_charged) * 100.0
                    / static_cast<double>(atom->nlocal);
     else
       charged_frac = 0.0;
@@ -128,22 +128,22 @@ void PPPMCG::compute(int eflag, int vflag)
 
     charged_num = num_charged;
     MPI_Reduce(&charged_num,&charged_all,1,MPI_LMP_BIGINT,MPI_SUM,0,world);
-    charged_frac = static_cast<double>(charged_all) * 100.0 
+    charged_frac = static_cast<double>(charged_all) * 100.0
                    / static_cast<double>(atom->natoms);
 
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,
-		"  PPPM/cg optimization cutoff: %g\n"
-		"  Total charged atoms: %.1f%%\n"
-		"  Min/max charged atoms/proc: %.1f%% %.1f%%\n",
-		smallq,charged_frac,charged_fmin,charged_fmax);
+      if (screen)
+        fprintf(screen,
+                "  PPPM/cg optimization cutoff: %g\n"
+                "  Total charged atoms: %.1f%%\n"
+                "  Min/max charged atoms/proc: %.1f%% %.1f%%\n",
+                smallq,charged_frac,charged_fmin,charged_fmax);
       if (logfile)
-	fprintf(logfile,
-		"  PPPM/cg optimization cutoff: %g\n"
-		"  Total charged atoms: %.1f%%\n"
-		"  Min/max charged atoms/proc: %.1f%% %.1f%%\n",
-		smallq,charged_frac,charged_fmin,charged_fmax);
+        fprintf(logfile,
+                "  PPPM/cg optimization cutoff: %g\n"
+                "  Total charged atoms: %.1f%%\n"
+                "  Min/max charged atoms/proc: %.1f%% %.1f%%\n",
+                smallq,charged_frac,charged_fmin,charged_fmax);
     }
   }
 
@@ -198,7 +198,7 @@ void PPPMCG::compute(int eflag, int vflag)
     double energy_all;
     MPI_Allreduce(&energy,&energy_all,1,MPI_DOUBLE,MPI_SUM,world);
     energy = energy_all;
-   
+
     energy *= 0.5*volume;
     energy -= g_ewald*qsqsum/MY_PIS +
       MY_PI2*qsum*qsum / (g_ewald*g_ewald*volume);
@@ -223,9 +223,9 @@ void PPPMCG::compute(int eflag, int vflag)
     if (eflag_atom) {
       for (int j = 0; j < num_charged; j++) {
         int i = is_charged[j];
-	eatom[i] *= 0.5;
-        eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum / 
-	  (g_ewald*g_ewald*volume);
+        eatom[i] *= 0.5;
+        eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum /
+          (g_ewald*g_ewald*volume);
         eatom[i] *= qscale;
       }
     }
@@ -243,14 +243,14 @@ void PPPMCG::compute(int eflag, int vflag)
   if (slabflag) slabcorr();
 
   // convert atoms back from lamda to box coords
-  
+
   if (triclinic) domain->lamda2x(atom->nlocal);
 }
 
 /* ----------------------------------------------------------------------
    find center grid pt for each of my particles
    check that full stencil for the particle will fit in my 3d brick
-   store central grid pt indices in part2grid array 
+   store central grid pt indices in part2grid array
 ------------------------------------------------------------------------- */
 
 void PPPMCG::particle_map()
@@ -262,7 +262,7 @@ void PPPMCG::particle_map()
   int flag = 0;
   for (int j = 0; j < num_charged; j++) {
     int i = is_charged[j];
-    
+
     // (nx,ny,nz) = global coords of grid pt to "lower left" of charge
     // current particle coord can be outside global and local box
     // add/subtract OFFSET to avoid int(-0.75) = 0 when want it to be -1
@@ -278,8 +278,8 @@ void PPPMCG::particle_map()
     // check that entire stencil around nx,ny,nz will fit in my 3d brick
 
     if (nx+nlower < nxlo_out || nx+nupper > nxhi_out ||
-	ny+nlower < nylo_out || ny+nupper > nyhi_out ||
-	nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag = 1;
+        ny+nlower < nylo_out || ny+nupper > nyhi_out ||
+        nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag = 1;
   }
 
   if (flag) error->one(FLERR,"Out of range atoms - cannot compute PPPM");
@@ -289,7 +289,7 @@ void PPPMCG::particle_map()
    create discretized "density" on section of global grid due to my particles
    density(x,y,z) = charge "density" at grid points of my 3d brick
    (nxlo:nxhi,nylo:nyhi,nzlo:nzhi) is extent of my brick (including ghosts)
-   in global grid 
+   in global grid
 ------------------------------------------------------------------------- */
 
 void PPPMCG::make_rho()
@@ -327,19 +327,19 @@ void PPPMCG::make_rho()
       mz = n+nz;
       y0 = z0*rho1d[2][n];
       for (m = nlower; m <= nupper; m++) {
-	my = m+ny;
-	x0 = y0*rho1d[1][m];
-	for (l = nlower; l <= nupper; l++) {
-	  mx = l+nx;
-	  density_brick[mz][my][mx] += x0*rho1d[0][l];
-	}
+        my = m+ny;
+        x0 = y0*rho1d[1][m];
+        for (l = nlower; l <= nupper; l++) {
+          mx = l+nx;
+          density_brick[mz][my][mx] += x0*rho1d[0][l];
+        }
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   interpolate from grid to get electric field & force on my particles 
+   interpolate from grid to get electric field & force on my particles
 ------------------------------------------------------------------------- */
 
 void PPPMCG::fieldforce()
@@ -375,15 +375,15 @@ void PPPMCG::fieldforce()
       mz = n+nz;
       z0 = rho1d[2][n];
       for (m = nlower; m <= nupper; m++) {
-	my = m+ny;
-	y0 = z0*rho1d[1][m];
-	for (l = nlower; l <= nupper; l++) {
-	  mx = l+nx;
-	  x0 = y0*rho1d[0][l];
-	  ekx -= x0*vdx_brick[mz][my][mx];
-	  eky -= x0*vdy_brick[mz][my][mx];
-	  ekz -= x0*vdz_brick[mz][my][mx];
-	}
+        my = m+ny;
+        y0 = z0*rho1d[1][m];
+        for (l = nlower; l <= nupper; l++) {
+          mx = l+nx;
+          x0 = y0*rho1d[0][l];
+          ekx -= x0*vdx_brick[mz][my][mx];
+          eky -= x0*vdy_brick[mz][my][mx];
+          ekz -= x0*vdz_brick[mz][my][mx];
+        }
       }
     }
 
@@ -464,9 +464,9 @@ void PPPMCG::fieldforce_peratom()
 
 /* ----------------------------------------------------------------------
    Slab-geometry correction term to dampen inter-slab interactions between
-   periodically repeating slabs.  Yields good approximation to 2D Ewald if 
-   adequate empty space is left between repeating slabs (J. Chem. Phys. 
-   111, 3155).  Slabs defined here to be parallel to the xy plane. 
+   periodically repeating slabs.  Yields good approximation to 2D Ewald if
+   adequate empty space is left between repeating slabs (J. Chem. Phys.
+   111, 3155).  Slabs defined here to be parallel to the xy plane.
 ------------------------------------------------------------------------- */
 
 void PPPMCG::slabcorr()
@@ -488,10 +488,10 @@ void PPPMCG::slabcorr()
   MPI_Allreduce(&dipole,&dipole_all,1,MPI_DOUBLE,MPI_SUM,world);
 
   // compute corrections
-  
+
   const double e_slabcorr = 2.0*MY_PI*dipole_all*dipole_all/volume;
   const double qscale = force->qqrd2e * scale;
-  
+
   if (eflag_global) energy += qscale * e_slabcorr;
 
   //per-atom energy
@@ -506,7 +506,7 @@ void PPPMCG::slabcorr()
 
   // add on force corrections
 
-  const double ffact = -4.0*MY_PI*dipole_all/volume * qscale; 
+  const double ffact = -4.0*MY_PI*dipole_all/volume * qscale;
   double **f = atom->f;
 
   for (int j = 0; j < num_charged; j++) {
@@ -516,7 +516,7 @@ void PPPMCG::slabcorr()
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local arrays 
+   memory usage of local arrays
 ------------------------------------------------------------------------- */
 
 double PPPMCG::memory_usage()
diff --git a/src/KSPACE/pppm_cg.h b/src/KSPACE/pppm_cg.h
index 4c0c1baa27..4ab1918b37 100644
--- a/src/KSPACE/pppm_cg.h
+++ b/src/KSPACE/pppm_cg.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/KSPACE/pppm_tip4p.cpp b/src/KSPACE/pppm_tip4p.cpp
index bd6e880a3b..c9dabf94cd 100644
--- a/src/KSPACE/pppm_tip4p.cpp
+++ b/src/KSPACE/pppm_tip4p.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -55,7 +55,7 @@ void PPPMTIP4P::init()
 /* ----------------------------------------------------------------------
    find center grid pt for each of my particles
    check that full stencil for the particle will fit in my 3d brick
-   store central grid pt indices in part2grid array 
+   store central grid pt indices in part2grid array
 ------------------------------------------------------------------------- */
 
 void PPPMTIP4P::particle_map()
@@ -70,7 +70,7 @@ void PPPMTIP4P::particle_map()
   int flag = 0;
   for (int i = 0; i < nlocal; i++) {
     if (type[i] == typeO) {
-      find_M(i,iH1,iH2,xM);      
+      find_M(i,iH1,iH2,xM);
       xi = xM;
     } else xi = x[i];
 
@@ -89,8 +89,8 @@ void PPPMTIP4P::particle_map()
     // check that entire stencil around nx,ny,nz will fit in my 3d brick
 
     if (nx+nlower < nxlo_out || nx+nupper > nxhi_out ||
-	ny+nlower < nylo_out || ny+nupper > nyhi_out ||
-	nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag++;
+        ny+nlower < nylo_out || ny+nupper > nyhi_out ||
+        nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag++;
   }
 
   int flag_all;
@@ -102,7 +102,7 @@ void PPPMTIP4P::particle_map()
    create discretized "density" on section of global grid due to my particles
    density(x,y,z) = charge "density" at grid points of my 3d brick
    (nxlo:nxhi,nylo:nyhi,nzlo:nzhi) is extent of my brick (including ghosts)
-   in global grid 
+   in global grid
 ------------------------------------------------------------------------- */
 
 void PPPMTIP4P::make_rho()
@@ -121,14 +121,14 @@ void PPPMTIP4P::make_rho()
   // (dx,dy,dz) = distance to "lower left" grid pt
   // (mx,my,mz) = global coords of moving stencil pt
 
-  int *type = atom->type; 
+  int *type = atom->type;
   double *q = atom->q;
   double **x = atom->x;
   int nlocal = atom->nlocal;
 
   for (int i = 0; i < nlocal; i++) {
     if (type[i] == typeO) {
-      find_M(i,iH1,iH2,xM);      
+      find_M(i,iH1,iH2,xM);
       xi = xM;
     } else xi = x[i];
 
@@ -146,19 +146,19 @@ void PPPMTIP4P::make_rho()
       mz = n+nz;
       y0 = z0*rho1d[2][n];
       for (m = nlower; m <= nupper; m++) {
-	my = m+ny;
-	x0 = y0*rho1d[1][m];
-	for (l = nlower; l <= nupper; l++) {
-	  mx = l+nx;
-	  density_brick[mz][my][mx] += x0*rho1d[0][l];
-	}
+        my = m+ny;
+        x0 = y0*rho1d[1][m];
+        for (l = nlower; l <= nupper; l++) {
+          mx = l+nx;
+          density_brick[mz][my][mx] += x0*rho1d[0][l];
+        }
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   interpolate from grid to get electric field & force on my particles 
+   interpolate from grid to get electric field & force on my particles
 ------------------------------------------------------------------------- */
 
 void PPPMTIP4P::fieldforce()
@@ -187,7 +187,7 @@ void PPPMTIP4P::fieldforce()
 
   for (i = 0; i < nlocal; i++) {
     if (type[i] == typeO) {
-      find_M(i,iH1,iH2,xM);      
+      find_M(i,iH1,iH2,xM);
       xi = xM;
     } else xi = x[i];
 
@@ -205,15 +205,15 @@ void PPPMTIP4P::fieldforce()
       mz = n+nz;
       z0 = rho1d[2][n];
       for (m = nlower; m <= nupper; m++) {
-	my = m+ny;
-	y0 = z0*rho1d[1][m];
-	for (l = nlower; l <= nupper; l++) {
-	  mx = l+nx;
-	  x0 = y0*rho1d[0][l];
-	  ekx -= x0*vdx_brick[mz][my][mx];
-	  eky -= x0*vdy_brick[mz][my][mx];
-	  ekz -= x0*vdz_brick[mz][my][mx];
-	}
+        my = m+ny;
+        y0 = z0*rho1d[1][m];
+        for (l = nlower; l <= nupper; l++) {
+          mx = l+nx;
+          x0 = y0*rho1d[0][l];
+          ekx -= x0*vdx_brick[mz][my][mx];
+          eky -= x0*vdy_brick[mz][my][mx];
+          ekz -= x0*vdz_brick[mz][my][mx];
+        }
       }
     }
 
@@ -234,7 +234,7 @@ void PPPMTIP4P::fieldforce()
       rOMx = xM[0] - x[i][0];
       rOMy = xM[1] - x[i][1];
       rOMz = xM[2] - x[i][2];
-  
+
       ddotf = (rOMx * fx + rOMy * fy + rOMz * fz) / (qdist * qdist);
 
       f1x = ddotf * rOMx;
@@ -271,7 +271,7 @@ void PPPMTIP4P::find_M(int i, int &iH1, int &iH2, double *xM)
   if (atom->type[iH1] != typeH || atom->type[iH2] != typeH)
     error->one(FLERR,"TIP4P hydrogen has incorrect atom type");
 
-  double **x = atom->x; 
+  double **x = atom->x;
 
   double delx1 = x[iH1][0] - x[i][0];
   double dely1 = x[iH1][1] - x[i][1];
diff --git a/src/KSPACE/pppm_tip4p.h b/src/KSPACE/pppm_tip4p.h
index 8031b706b6..32d45f9229 100644
--- a/src/KSPACE/pppm_tip4p.h
+++ b/src/KSPACE/pppm_tip4p.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -36,7 +36,7 @@ class PPPMTIP4P : public PPPM {
   virtual void fieldforce();
 
  private:
-  void find_M(int, int &, int &, double *); 
+  void find_M(int, int &, int &, double *);
 };
 
 }
diff --git a/src/KSPACE/remap.cpp b/src/KSPACE/remap.cpp
index f702cf9e9e..a43bb2294d 100644
--- a/src/KSPACE/remap.cpp
+++ b/src/KSPACE/remap.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -32,9 +32,9 @@
    my subsection must not overlap with any other proc's subsection,
      i.e. the union of all proc's input (or output) subsections must
      exactly tile the global Nfast x Nmid x Nslow data set
-   when called from C, all subsection indices are 
+   when called from C, all subsection indices are
      C-style from 0 to N-1 where N = Nfast or Nmid or Nslow
-   when called from F77, all subsection indices are 
+   when called from F77, all subsection indices are
      F77-style from 1 to N where N = Nfast or Nmid or Nslow
    a proc can own 0 elements on input or output
      by specifying hi index < lo index
@@ -43,7 +43,7 @@
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Perform 3d remap 
+   Perform 3d remap
 
    Arguments:
    in           starting address of input data on this proc
@@ -51,16 +51,16 @@
                   will be placed (can be same as in)
    buf          extra memory required for remap
                 if memory=0 was used in call to remap_3d_create_plan
-		  then buf must be big enough to hold output result
-		  i.e. nqty * (out_ihi-out_ilo+1) * (out_jhi-out_jlo+1) * 
-		              (out_khi-out_klo+1)
-		if memory=1 was used in call to remap_3d_create_plan
-		  then buf is not used, can just be a dummy pointer
+                  then buf must be big enough to hold output result
+                  i.e. nqty * (out_ihi-out_ilo+1) * (out_jhi-out_jlo+1) *
+                              (out_khi-out_klo+1)
+                if memory=1 was used in call to remap_3d_create_plan
+                  then buf is not used, can just be a dummy pointer
    plan         plan returned by previous call to remap_3d_create_plan
 ------------------------------------------------------------------------- */
 
 void remap_3d(FFT_SCALAR *in, FFT_SCALAR *out, FFT_SCALAR *buf,
-	      struct remap_plan_3d *plan)
+              struct remap_plan_3d *plan)
 
 {
   MPI_Status status;
@@ -72,45 +72,45 @@ void remap_3d(FFT_SCALAR *in, FFT_SCALAR *out, FFT_SCALAR *buf,
   else
     scratch = plan->scratch;
 
-  // post all recvs into scratch space 
+  // post all recvs into scratch space
 
   for (irecv = 0; irecv < plan->nrecv; irecv++)
     MPI_Irecv(&scratch[plan->recv_bufloc[irecv]],plan->recv_size[irecv],
-	      MPI_FFT_SCALAR,plan->recv_proc[irecv],0,
-	      plan->comm,&plan->request[irecv]);
+              MPI_FFT_SCALAR,plan->recv_proc[irecv],0,
+              plan->comm,&plan->request[irecv]);
 
-  // send all messages to other procs 
+  // send all messages to other procs
 
   for (isend = 0; isend < plan->nsend; isend++) {
     plan->pack(&in[plan->send_offset[isend]],
-	       plan->sendbuf,&plan->packplan[isend]);
+               plan->sendbuf,&plan->packplan[isend]);
     MPI_Send(plan->sendbuf,plan->send_size[isend],MPI_FFT_SCALAR,
-	     plan->send_proc[isend],0,plan->comm);
-  }       
+             plan->send_proc[isend],0,plan->comm);
+  }
 
-  // copy in -> scratch -> out for self data 
+  // copy in -> scratch -> out for self data
 
   if (plan->self) {
     isend = plan->nsend;
     irecv = plan->nrecv;
     plan->pack(&in[plan->send_offset[isend]],
-	       &scratch[plan->recv_bufloc[irecv]],
-	       &plan->packplan[isend]);
+               &scratch[plan->recv_bufloc[irecv]],
+               &plan->packplan[isend]);
     plan->unpack(&scratch[plan->recv_bufloc[irecv]],
-		 &out[plan->recv_offset[irecv]],&plan->unpackplan[irecv]);
+                 &out[plan->recv_offset[irecv]],&plan->unpackplan[irecv]);
   }
 
-  // unpack all messages from scratch -> out 
+  // unpack all messages from scratch -> out
 
   for (i = 0; i < plan->nrecv; i++) {
     MPI_Waitany(plan->nrecv,plan->request,&irecv,&status);
     plan->unpack(&scratch[plan->recv_bufloc[irecv]],
-		 &out[plan->recv_offset[irecv]],&plan->unpackplan[irecv]);
+                 &out[plan->recv_offset[irecv]],&plan->unpackplan[irecv]);
   }
 }
 
 /* ----------------------------------------------------------------------
-   Create plan for performing a 3d remap 
+   Create plan for performing a 3d remap
 
    Arguments:
    comm                 MPI communicator for the P procs which own the data
@@ -123,14 +123,14 @@ void remap_3d(FFT_SCALAR *in, FFT_SCALAR *out, FFT_SCALAR *buf,
    nqty                 # of datums per element
    permute              permutation in storage order of indices on output
                           0 = no permutation
-			  1 = permute once = mid->fast, slow->mid, fast->slow
-			  2 = permute twice = slow->fast, fast->mid, mid->slow
+                          1 = permute once = mid->fast, slow->mid, fast->slow
+                          2 = permute twice = slow->fast, fast->mid, mid->slow
    memory               user provides buffer memory for remap or system does
                           0 = user provides memory
-			  1 = system provides memory
+                          1 = system provides memory
    precision            precision of data
                           1 = single precision (4 bytes per datum)
-			  2 = double precision (8 bytes per datum)
+                          2 = double precision (8 bytes per datum)
 ------------------------------------------------------------------------- */
 
 struct remap_plan_3d *remap_3d_create_plan(
@@ -147,17 +147,17 @@ struct remap_plan_3d *remap_3d_create_plan(
   struct extent_3d in,out,overlap;
   int i,iproc,nsend,nrecv,ibuf,size,me,nprocs;
 
-  // query MPI info 
+  // query MPI info
 
   MPI_Comm_rank(comm,&me);
   MPI_Comm_size(comm,&nprocs);
 
-  // allocate memory for plan data struct 
+  // allocate memory for plan data struct
 
   plan = (struct remap_plan_3d *) malloc(sizeof(struct remap_plan_3d));
   if (plan == NULL) return NULL;
 
-  // store parameters in local data structs 
+  // store parameters in local data structs
 
   in.ilo = in_ilo;
   in.ihi = in_ihi;
@@ -183,15 +183,15 @@ struct remap_plan_3d *remap_3d_create_plan(
   out.khi = out_khi;
   out.ksize = out.khi - out.klo + 1;
 
-  // combine output extents across all procs 
+  // combine output extents across all procs
 
   array = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d));
   if (array == NULL) return NULL;
 
   MPI_Allgather(&out,sizeof(struct extent_3d),MPI_BYTE,
-		array,sizeof(struct extent_3d),MPI_BYTE,comm);
+                array,sizeof(struct extent_3d),MPI_BYTE,comm);
 
-  // count send collides, including self 
+  // count send collides, including self
 
   nsend = 0;
   iproc = me;
@@ -201,7 +201,7 @@ struct remap_plan_3d *remap_3d_create_plan(
     nsend += remap_3d_collide(&in,&array[iproc],&overlap);
   }
 
-  // malloc space for send info 
+  // malloc space for send info
 
   if (nsend) {
     plan->pack = pack_3d;
@@ -209,14 +209,14 @@ struct remap_plan_3d *remap_3d_create_plan(
     plan->send_offset = (int *) malloc(nsend*sizeof(int));
     plan->send_size = (int *) malloc(nsend*sizeof(int));
     plan->send_proc = (int *) malloc(nsend*sizeof(int));
-    plan->packplan = (struct pack_plan_3d *) 
+    plan->packplan = (struct pack_plan_3d *)
       malloc(nsend*sizeof(struct pack_plan_3d));
 
-    if (plan->send_offset == NULL || plan->send_size == NULL || 
-	plan->send_proc == NULL || plan->packplan == NULL) return NULL;
+    if (plan->send_offset == NULL || plan->send_size == NULL ||
+        plan->send_proc == NULL || plan->packplan == NULL) return NULL;
   }
 
-  // store send info, with self as last entry 
+  // store send info, with self as last entry
 
   nsend = 0;
   iproc = me;
@@ -225,9 +225,9 @@ struct remap_plan_3d *remap_3d_create_plan(
     if (iproc == nprocs) iproc = 0;
     if (remap_3d_collide(&in,&array[iproc],&overlap)) {
       plan->send_proc[nsend] = iproc;
-      plan->send_offset[nsend] = nqty * 
-	((overlap.klo-in.klo)*in.jsize*in.isize + 
-	((overlap.jlo-in.jlo)*in.isize + overlap.ilo-in.ilo));
+      plan->send_offset[nsend] = nqty *
+        ((overlap.klo-in.klo)*in.jsize*in.isize +
+        ((overlap.jlo-in.jlo)*in.isize + overlap.ilo-in.ilo));
       plan->packplan[nsend].nfast = nqty*overlap.isize;
       plan->packplan[nsend].nmid = overlap.jsize;
       plan->packplan[nsend].nslow = overlap.ksize;
@@ -239,19 +239,19 @@ struct remap_plan_3d *remap_3d_create_plan(
     }
   }
 
-  // plan->nsend = # of sends not including self 
+  // plan->nsend = # of sends not including self
 
   if (nsend && plan->send_proc[nsend-1] == me)
     plan->nsend = nsend - 1;
   else
     plan->nsend = nsend;
 
-  // combine input extents across all procs 
+  // combine input extents across all procs
 
   MPI_Allgather(&in,sizeof(struct extent_3d),MPI_BYTE,
-		array,sizeof(struct extent_3d),MPI_BYTE,comm);
+                array,sizeof(struct extent_3d),MPI_BYTE,comm);
 
-  // count recv collides, including self 
+  // count recv collides, including self
 
   nrecv = 0;
   iproc = me;
@@ -260,27 +260,27 @@ struct remap_plan_3d *remap_3d_create_plan(
     if (iproc == nprocs) iproc = 0;
     nrecv += remap_3d_collide(&out,&array[iproc],&overlap);
   }
-  
-  // malloc space for recv info 
+
+  // malloc space for recv info
 
   if (nrecv) {
     if (permute == 0)
       plan->unpack = unpack_3d;
     else if (permute == 1) {
       if (nqty == 1)
-	plan->unpack = unpack_3d_permute1_1;
+        plan->unpack = unpack_3d_permute1_1;
       else if (nqty == 2)
-	plan->unpack = unpack_3d_permute1_2;
+        plan->unpack = unpack_3d_permute1_2;
       else
-	plan->unpack = unpack_3d_permute1_n;
+        plan->unpack = unpack_3d_permute1_n;
     }
     else if (permute == 2) {
       if (nqty == 1)
-	plan->unpack = unpack_3d_permute2_1;
+        plan->unpack = unpack_3d_permute2_1;
       else if (nqty == 2)
-	plan->unpack = unpack_3d_permute2_2;
+        plan->unpack = unpack_3d_permute2_2;
       else
-	plan->unpack = unpack_3d_permute2_n;
+        plan->unpack = unpack_3d_permute2_n;
     }
 
     plan->recv_offset = (int *) malloc(nrecv*sizeof(int));
@@ -288,15 +288,15 @@ struct remap_plan_3d *remap_3d_create_plan(
     plan->recv_proc = (int *) malloc(nrecv*sizeof(int));
     plan->recv_bufloc = (int *) malloc(nrecv*sizeof(int));
     plan->request = (MPI_Request *) malloc(nrecv*sizeof(MPI_Request));
-    plan->unpackplan = (struct pack_plan_3d *) 
+    plan->unpackplan = (struct pack_plan_3d *)
       malloc(nrecv*sizeof(struct pack_plan_3d));
 
-    if (plan->recv_offset == NULL || plan->recv_size == NULL || 
-	plan->recv_proc == NULL || plan->recv_bufloc == NULL ||
-	plan->request == NULL || plan->unpackplan == NULL) return NULL;
+    if (plan->recv_offset == NULL || plan->recv_size == NULL ||
+        plan->recv_proc == NULL || plan->recv_bufloc == NULL ||
+        plan->request == NULL || plan->unpackplan == NULL) return NULL;
   }
 
-  // store recv info, with self as last entry 
+  // store recv info, with self as last entry
 
   ibuf = 0;
   nrecv = 0;
@@ -310,37 +310,37 @@ struct remap_plan_3d *remap_3d_create_plan(
       plan->recv_bufloc[nrecv] = ibuf;
 
       if (permute == 0) {
-	plan->recv_offset[nrecv] = nqty *
-	  ((overlap.klo-out.klo)*out.jsize*out.isize +
-	   (overlap.jlo-out.jlo)*out.isize + (overlap.ilo-out.ilo));
-	plan->unpackplan[nrecv].nfast = nqty*overlap.isize;
-	plan->unpackplan[nrecv].nmid = overlap.jsize;
-	plan->unpackplan[nrecv].nslow = overlap.ksize;
-	plan->unpackplan[nrecv].nstride_line = nqty*out.isize;
-	plan->unpackplan[nrecv].nstride_plane = nqty*out.jsize*out.isize;
-	plan->unpackplan[nrecv].nqty = nqty;
+        plan->recv_offset[nrecv] = nqty *
+          ((overlap.klo-out.klo)*out.jsize*out.isize +
+           (overlap.jlo-out.jlo)*out.isize + (overlap.ilo-out.ilo));
+        plan->unpackplan[nrecv].nfast = nqty*overlap.isize;
+        plan->unpackplan[nrecv].nmid = overlap.jsize;
+        plan->unpackplan[nrecv].nslow = overlap.ksize;
+        plan->unpackplan[nrecv].nstride_line = nqty*out.isize;
+        plan->unpackplan[nrecv].nstride_plane = nqty*out.jsize*out.isize;
+        plan->unpackplan[nrecv].nqty = nqty;
       }
       else if (permute == 1) {
-	plan->recv_offset[nrecv] = nqty *
-	  ((overlap.ilo-out.ilo)*out.ksize*out.jsize +
-	   (overlap.klo-out.klo)*out.jsize + (overlap.jlo-out.jlo));
-	plan->unpackplan[nrecv].nfast = overlap.isize;
-	plan->unpackplan[nrecv].nmid = overlap.jsize;
-	plan->unpackplan[nrecv].nslow = overlap.ksize;
-	plan->unpackplan[nrecv].nstride_line = nqty*out.jsize;
-	plan->unpackplan[nrecv].nstride_plane = nqty*out.ksize*out.jsize;
-	plan->unpackplan[nrecv].nqty = nqty;
+        plan->recv_offset[nrecv] = nqty *
+          ((overlap.ilo-out.ilo)*out.ksize*out.jsize +
+           (overlap.klo-out.klo)*out.jsize + (overlap.jlo-out.jlo));
+        plan->unpackplan[nrecv].nfast = overlap.isize;
+        plan->unpackplan[nrecv].nmid = overlap.jsize;
+        plan->unpackplan[nrecv].nslow = overlap.ksize;
+        plan->unpackplan[nrecv].nstride_line = nqty*out.jsize;
+        plan->unpackplan[nrecv].nstride_plane = nqty*out.ksize*out.jsize;
+        plan->unpackplan[nrecv].nqty = nqty;
       }
       else {
-	plan->recv_offset[nrecv] = nqty *
-	  ((overlap.jlo-out.jlo)*out.isize*out.ksize +
-	   (overlap.ilo-out.ilo)*out.ksize + (overlap.klo-out.klo));
-	plan->unpackplan[nrecv].nfast = overlap.isize;
-	plan->unpackplan[nrecv].nmid = overlap.jsize;
-	plan->unpackplan[nrecv].nslow = overlap.ksize;
-	plan->unpackplan[nrecv].nstride_line = nqty*out.ksize;
-	plan->unpackplan[nrecv].nstride_plane = nqty*out.isize*out.ksize;
-	plan->unpackplan[nrecv].nqty = nqty;
+        plan->recv_offset[nrecv] = nqty *
+          ((overlap.jlo-out.jlo)*out.isize*out.ksize +
+           (overlap.ilo-out.ilo)*out.ksize + (overlap.klo-out.klo));
+        plan->unpackplan[nrecv].nfast = overlap.isize;
+        plan->unpackplan[nrecv].nmid = overlap.jsize;
+        plan->unpackplan[nrecv].nslow = overlap.ksize;
+        plan->unpackplan[nrecv].nstride_line = nqty*out.ksize;
+        plan->unpackplan[nrecv].nstride_plane = nqty*out.isize*out.ksize;
+        plan->unpackplan[nrecv].nqty = nqty;
       }
 
       plan->recv_size[nrecv] = nqty*overlap.isize*overlap.jsize*overlap.ksize;
@@ -349,14 +349,14 @@ struct remap_plan_3d *remap_3d_create_plan(
     }
   }
 
-  // plan->nrecv = # of recvs not including self 
+  // plan->nrecv = # of recvs not including self
 
   if (nrecv && plan->recv_proc[nrecv-1] == me)
     plan->nrecv = nrecv - 1;
   else
     plan->nrecv = nrecv;
 
-  // init remaining fields in remap plan 
+  // init remaining fields in remap plan
 
   plan->memory = memory;
 
@@ -365,11 +365,11 @@ struct remap_plan_3d *remap_3d_create_plan(
   else
     plan->self = 1;
 
-  // free locally malloced space 
+  // free locally malloced space
 
   free(array);
 
-  // find biggest send message (not including self) and malloc space for it 
+  // find biggest send message (not including self) and malloc space for it
 
   plan->sendbuf = NULL;
 
@@ -383,39 +383,39 @@ struct remap_plan_3d *remap_3d_create_plan(
   }
 
   // if requested, allocate internal scratch space for recvs,
-  // only need it if I will receive any data (including self) 
+  // only need it if I will receive any data (including self)
 
   plan->scratch = NULL;
 
   if (memory == 1) {
     if (nrecv > 0) {
       plan->scratch =
-	(FFT_SCALAR *) malloc(nqty*out.isize*out.jsize*out.ksize*sizeof(FFT_SCALAR));
+        (FFT_SCALAR *) malloc(nqty*out.isize*out.jsize*out.ksize*sizeof(FFT_SCALAR));
       if (plan->scratch == NULL) return NULL;
     }
   }
 
-  // create new MPI communicator for remap 
+  // create new MPI communicator for remap
 
   MPI_Comm_dup(comm,&plan->comm);
 
-  // return pointer to plan 
+  // return pointer to plan
 
   return plan;
 }
 
 /* ----------------------------------------------------------------------
-   Destroy a 3d remap plan 
+   Destroy a 3d remap plan
 ------------------------------------------------------------------------- */
 
 void remap_3d_destroy_plan(struct remap_plan_3d *plan)
 
 {
-  // free MPI communicator 
+  // free MPI communicator
 
   MPI_Comm_free(&plan->comm);
 
-  // free internal arrays 
+  // free internal arrays
 
   if (plan->nsend || plan->self) {
     free(plan->send_offset);
@@ -435,20 +435,20 @@ void remap_3d_destroy_plan(struct remap_plan_3d *plan)
     if (plan->scratch) free(plan->scratch);
   }
 
-  // free plan itself 
+  // free plan itself
 
   free(plan);
 }
 
 /* ----------------------------------------------------------------------
-   collide 2 sets of indices to determine overlap 
+   collide 2 sets of indices to determine overlap
    compare bounds of block1 with block2 to see if they overlap
    return 1 if they do and put bounds of overlapping section in overlap
-   return 0 if they do not overlap 
+   return 0 if they do not overlap
 ------------------------------------------------------------------------- */
 
 int remap_3d_collide(struct extent_3d *block1, struct extent_3d *block2,
-		     struct extent_3d *overlap)
+                     struct extent_3d *overlap)
 
 {
   overlap->ilo = MAX(block1->ilo,block2->ilo);
@@ -457,8 +457,8 @@ int remap_3d_collide(struct extent_3d *block1, struct extent_3d *block2,
   overlap->jhi = MIN(block1->jhi,block2->jhi);
   overlap->klo = MAX(block1->klo,block2->klo);
   overlap->khi = MIN(block1->khi,block2->khi);
-  
-  if (overlap->ilo > overlap->ihi || 
+
+  if (overlap->ilo > overlap->ihi ||
       overlap->jlo > overlap->jhi ||
       overlap->klo > overlap->khi) return 0;
 
diff --git a/src/KSPACE/remap.h b/src/KSPACE/remap.h
index 648b3a0d16..6175690686 100644
--- a/src/KSPACE/remap.h
+++ b/src/KSPACE/remap.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -21,33 +21,33 @@ typedef double FFT_SCALAR;
 #define MPI_FFT_SCALAR MPI_DOUBLE
 #endif
 
-// details of how to do a 3d remap 
+// details of how to do a 3d remap
 
 struct remap_plan_3d {
-  FFT_SCALAR *sendbuf;                  // buffer for MPI sends 
-  FFT_SCALAR *scratch;                  // scratch buffer for MPI recvs 
+  FFT_SCALAR *sendbuf;                  // buffer for MPI sends
+  FFT_SCALAR *scratch;                  // scratch buffer for MPI recvs
   void (*pack)(FFT_SCALAR *, FFT_SCALAR *, struct pack_plan_3d *);
-                                    // which pack function to use 
+                                    // which pack function to use
   void (*unpack)(FFT_SCALAR *, FFT_SCALAR *, struct pack_plan_3d *);
-                                    // which unpack function to use 
-  int *send_offset;                 // extraction loc for each send 
-  int *send_size;                   // size of each send message 
-  int *send_proc;                   // proc to send each message to 
-  struct pack_plan_3d *packplan;    // pack plan for each send message 
-  int *recv_offset;                 // insertion loc for each recv 
-  int *recv_size;                   // size of each recv message 
-  int *recv_proc;                   // proc to recv each message from 
-  int *recv_bufloc;                 // offset in scratch buf for each recv 
-  MPI_Request *request;             // MPI request for each posted recv 
-  struct pack_plan_3d *unpackplan;  // unpack plan for each recv message 
-  int nrecv;                        // # of recvs from other procs 
-  int nsend;                        // # of sends to other procs 
-  int self;                         // whether I send/recv with myself 
-  int memory;                       // user provides scratch space or not 
-  MPI_Comm comm;                    // group of procs performing remap 
+                                    // which unpack function to use
+  int *send_offset;                 // extraction loc for each send
+  int *send_size;                   // size of each send message
+  int *send_proc;                   // proc to send each message to
+  struct pack_plan_3d *packplan;    // pack plan for each send message
+  int *recv_offset;                 // insertion loc for each recv
+  int *recv_size;                   // size of each recv message
+  int *recv_proc;                   // proc to recv each message from
+  int *recv_bufloc;                 // offset in scratch buf for each recv
+  MPI_Request *request;             // MPI request for each posted recv
+  struct pack_plan_3d *unpackplan;  // unpack plan for each recv message
+  int nrecv;                        // # of recvs from other procs
+  int nsend;                        // # of sends to other procs
+  int self;                         // whether I send/recv with myself
+  int memory;                       // user provides scratch space or not
+  MPI_Comm comm;                    // group of procs performing remap
 };
 
-// collision between 2 regions 
+// collision between 2 regions
 
 struct extent_3d {
   int ilo,ihi,isize;
@@ -55,12 +55,12 @@ struct extent_3d {
   int klo,khi,ksize;
 };
 
-// function prototypes 
+// function prototypes
 
 void remap_3d(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *, struct remap_plan_3d *);
-struct remap_plan_3d *remap_3d_create_plan(MPI_Comm, 
-  int, int, int, int, int, int,	int, int, int, int, int, int,
+struct remap_plan_3d *remap_3d_create_plan(MPI_Comm,
+  int, int, int, int, int, int,        int, int, int, int, int, int,
   int, int, int, int);
 void remap_3d_destroy_plan(struct remap_plan_3d *);
-int remap_3d_collide(struct extent_3d *, 
-		     struct extent_3d *, struct extent_3d *);
+int remap_3d_collide(struct extent_3d *,
+                     struct extent_3d *, struct extent_3d *);
diff --git a/src/KSPACE/remap_wrap.cpp b/src/KSPACE/remap_wrap.cpp
index 679c2a8365..dc159cc8f8 100644
--- a/src/KSPACE/remap_wrap.cpp
+++ b/src/KSPACE/remap_wrap.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -20,16 +20,16 @@ using namespace LAMMPS_NS;
 /* ---------------------------------------------------------------------- */
 
 Remap::Remap(LAMMPS *lmp, MPI_Comm comm,
-	     int in_ilo, int in_ihi, int in_jlo, int in_jhi,
-	     int in_klo, int in_khi,
-	     int out_ilo, int out_ihi, int out_jlo, int out_jhi,
-	     int out_klo, int out_khi,
-	     int nqty, int permute, int memory, int precision) : Pointers(lmp)
+             int in_ilo, int in_ihi, int in_jlo, int in_jhi,
+             int in_klo, int in_khi,
+             int out_ilo, int out_ihi, int out_jlo, int out_jhi,
+             int out_klo, int out_khi,
+             int nqty, int permute, int memory, int precision) : Pointers(lmp)
 {
   plan = remap_3d_create_plan(comm,
-			      in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
-			      out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
-			      nqty,permute,memory,precision);
+                              in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
+                              out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
+                              nqty,permute,memory,precision);
   if (plan == NULL) error->one(FLERR,"Could not create 3d remap plan");
 }
 
diff --git a/src/KSPACE/remap_wrap.h b/src/KSPACE/remap_wrap.h
index 60ba810bd7..d9f817ed42 100644
--- a/src/KSPACE/remap_wrap.h
+++ b/src/KSPACE/remap_wrap.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -22,7 +22,7 @@ namespace LAMMPS_NS {
 class Remap : protected Pointers {
  public:
   Remap(class LAMMPS *, MPI_Comm,int,int,int,int,int,int,
-	int,int,int,int,int,int,int,int,int,int);
+        int,int,int,int,int,int,int,int,int,int);
   ~Remap();
   void perform(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR *);
 
diff --git a/src/MANYBODY/fix_qeq_comb.cpp b/src/MANYBODY/fix_qeq_comb.cpp
index f04a93bd1f..26d91e83aa 100644
--- a/src/MANYBODY/fix_qeq_comb.cpp
+++ b/src/MANYBODY/fix_qeq_comb.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,17 +60,17 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
     if (strcmp(arg[iarg],"file") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix qeq/comb command");
       if (me == 0) {
-	fp = fopen(arg[iarg+1],"w");
-	if (fp == NULL) {
-	  char str[128];
-	  sprintf(str,"Cannot open fix qeq/comb file %s",arg[iarg+1]);
-	  error->one(FLERR,str);
-	}
+        fp = fopen(arg[iarg+1],"w");
+        if (fp == NULL) {
+          char str[128];
+          sprintf(str,"Cannot open fix qeq/comb file %s",arg[iarg+1]);
+          error->one(FLERR,str);
+        }
       }
       iarg += 2;
     } else error->all(FLERR,"Illegal fix qeq/comb command");
   }
-  
+
   nmax = atom->nmax;
   memory->create(qf,nmax,"qeq:qf");
   memory->create(q1,nmax,"qeq:q1");
@@ -161,10 +161,10 @@ void FixQEQComb::post_force(int vflag)
     memory->create(q2,nmax,"qeq:q2");
     vector_atom = qf;
   }
-  
+
   // more loops for first-time charge equilibrium
 
-  iloop = 0; 
+  iloop = 0;
   if (firstflag) loopmax = 5000;
   else loopmax = 2000;
 
@@ -172,15 +172,15 @@ void FixQEQComb::post_force(int vflag)
 
   if (me == 0 && fp)
     fprintf(fp,"Charge equilibration on step " BIGINT_FORMAT "\n",
-	    update->ntimestep);
-  
+            update->ntimestep);
+
   heatpq = 0.05;
   qmass  = 0.000548580;
   dtq    = 0.0006;
   dtq2   = 0.5*dtq*dtq/qmass;
 
   double enegchk = 0.0;
-  double enegtot = 0.0; 
+  double enegtot = 0.0;
   double enegmax = 0.0;
 
   double *q = atom->q;
@@ -193,8 +193,8 @@ void FixQEQComb::post_force(int vflag)
   for (iloop = 0; iloop < loopmax; iloop ++ ) {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	q1[i] += qf[i]*dtq2 - heatpq*q1[i];
-	q[i]  += q1[i]; 
+        q1[i] += qf[i]*dtq2 - heatpq*q1[i];
+        q[i]  += q1[i];
       }
 
     enegtot = comb->yasu_char(qf,igroup);
@@ -203,35 +203,35 @@ void FixQEQComb::post_force(int vflag)
 
     for (i = 0; i < nlocal ; i++)
       if (mask[i] & groupbit) {
-	q2[i] = enegtot-qf[i];
-	enegmax = MAX(enegmax,fabs(q2[i]));
-	enegchk += fabs(q2[i]);
-	qf[i] = q2[i];
+        q2[i] = enegtot-qf[i];
+        enegmax = MAX(enegmax,fabs(q2[i]));
+        enegchk += fabs(q2[i]);
+        qf[i] = q2[i];
       }
 
     MPI_Allreduce(&enegchk,&enegchkall,1,MPI_DOUBLE,MPI_SUM,world);
     enegchk = enegchkall/ngroup;
     MPI_Allreduce(&enegmax,&enegmaxall,1,MPI_DOUBLE,MPI_MAX,world);
     enegmax = enegmaxall;
-  
+
     if (enegchk <= precision && enegmax <= 100.0*precision) break;
 
     if (me == 0 && fp)
       fprintf(fp,"  iteration: %d, enegtot %.6g, "
-	      "enegmax %.6g, fq deviation: %.6g\n",
-	      iloop,enegtot,enegmax,enegchk); 
-    
+              "enegmax %.6g, fq deviation: %.6g\n",
+              iloop,enegtot,enegmax,enegchk);
+
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	q1[i] += qf[i]*dtq2 - heatpq*q1[i]; 
-  } 
+        q1[i] += qf[i]*dtq2 - heatpq*q1[i];
+  }
 
   if (me == 0 && fp) {
     if (iloop == loopmax)
       fprintf(fp,"Charges did not converge in %d iterations\n",iloop);
     else
       fprintf(fp,"Charges converged in %d iterations to %.10f tolerance\n",
-	      iloop,enegchk);
+              iloop,enegchk);
   }
 }
 
diff --git a/src/MANYBODY/fix_qeq_comb.h b/src/MANYBODY/fix_qeq_comb.h
index df48bb98a3..7452fcfa0e 100644
--- a/src/MANYBODY/fix_qeq_comb.h
+++ b/src/MANYBODY/fix_qeq_comb.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MANYBODY/pair_adp.cpp b/src/MANYBODY/pair_adp.cpp
index 8ce9b57732..90d6eab223 100644
--- a/src/MANYBODY/pair_adp.cpp
+++ b/src/MANYBODY/pair_adp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -158,22 +158,22 @@ void PairADP::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // zero out density
 
   if (newton_pair) {
     m = nlocal + atom->nghost;
     for (i = 0; i < m; i++) {
-      rho[i] = 0.0; 
+      rho[i] = 0.0;
       mu[i][0] = 0.0; mu[i][1] = 0.0; mu[i][2] = 0.0;
-      lambda[i][0] = 0.0; lambda[i][1] = 0.0; lambda[i][2] = 0.0; 
+      lambda[i][0] = 0.0; lambda[i][1] = 0.0; lambda[i][2] = 0.0;
       lambda[i][3] = 0.0; lambda[i][4] = 0.0; lambda[i][5] = 0.0;
     }
   } else {
     for (i = 0; i < nlocal; i++) {
       rho[i] = 0.0;
       mu[i][0] = 0.0; mu[i][1] = 0.0; mu[i][2] = 0.0;
-      lambda[i][0] = 0.0; lambda[i][1] = 0.0; lambda[i][2] = 0.0; 
+      lambda[i][0] = 0.0; lambda[i][1] = 0.0; lambda[i][2] = 0.0;
       lambda[i][3] = 0.0; lambda[i][4] = 0.0; lambda[i][5] = 0.0;
     }
   }
@@ -199,21 +199,21 @@ void PairADP::compute(int eflag, int vflag)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cutforcesq) {
-	jtype = type[j];
-	p = sqrt(rsq)*rdr + 1.0;
-	m = static_cast<int> (p);
-	m = MIN(m,nr-1);
-	p -= m;
-	p = MIN(p,1.0);
-	coeff = rhor_spline[type2rhor[jtype][itype]][m];
-	rho[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        jtype = type[j];
+        p = sqrt(rsq)*rdr + 1.0;
+        m = static_cast<int> (p);
+        m = MIN(m,nr-1);
+        p -= m;
+        p = MIN(p,1.0);
+        coeff = rhor_spline[type2rhor[jtype][itype]][m];
+        rho[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
         coeff = u2r_spline[type2u2r[jtype][itype]][m];
-	u2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        u2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
         mu[i][0] += u2*delx;
         mu[i][1] += u2*dely;
         mu[i][2] += u2*delz;
         coeff = w2r_spline[type2w2r[jtype][itype]][m];
-	w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
         lambda[i][0] += w2*delx*delx;
         lambda[i][1] += w2*dely*dely;
         lambda[i][2] += w2*delz*delz;
@@ -221,24 +221,24 @@ void PairADP::compute(int eflag, int vflag)
         lambda[i][4] += w2*delx*delz;
         lambda[i][5] += w2*delx*dely;
 
-	if (newton_pair || j < nlocal) {
+        if (newton_pair || j < nlocal) {
           // verify sign difference for mu and lambda
-	  coeff = rhor_spline[type2rhor[itype][jtype]][m];
-	  rho[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+          coeff = rhor_spline[type2rhor[itype][jtype]][m];
+          rho[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
           coeff = u2r_spline[type2u2r[itype][jtype]][m];
           u2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
           mu[j][0] -= u2*delx;
           mu[j][1] -= u2*dely;
           mu[j][2] -= u2*delz;
           coeff = w2r_spline[type2w2r[itype][jtype]][m];
-	  w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+          w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
           lambda[j][0] += w2*delx*delx;
           lambda[j][1] += w2*dely*dely;
           lambda[j][2] += w2*delz*delz;
           lambda[j][3] += w2*dely*delz;
           lambda[j][4] += w2*delx*delz;
           lambda[j][5] += w2*delx*dely;
-	}
+        }
       }
     }
   }
@@ -263,11 +263,11 @@ void PairADP::compute(int eflag, int vflag)
       phi = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
       phi += 0.5*(mu[i][0]*mu[i][0]+mu[i][1]*mu[i][1]+mu[i][2]*mu[i][2]);
       phi += 0.5*(lambda[i][0]*lambda[i][0]+lambda[i][1]*
-		  lambda[i][1]+lambda[i][2]*lambda[i][2]);
+                  lambda[i][1]+lambda[i][2]*lambda[i][2]);
       phi += 1.0*(lambda[i][3]*lambda[i][3]+lambda[i][4]*
-		  lambda[i][4]+lambda[i][5]*lambda[i][5]);
+                  lambda[i][4]+lambda[i][5]*lambda[i][5]);
       phi -= 1.0/6.0*(lambda[i][0]+lambda[i][1]+lambda[i][2])*
-	(lambda[i][0]+lambda[i][1]+lambda[i][2]);
+        (lambda[i][0]+lambda[i][1]+lambda[i][2]);
       if (eflag_global) eng_vdwl += phi;
       if (eflag_atom) eatom[i] += phi;
     }
@@ -299,51 +299,51 @@ void PairADP::compute(int eflag, int vflag)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cutforcesq) {
-	jtype = type[j];
-	r = sqrt(rsq);
-	p = r*rdr + 1.0;
-	m = static_cast<int> (p);
-	m = MIN(m,nr-1);
-	p -= m;
-	p = MIN(p,1.0);
-
-	// rhoip = derivative of (density at atom j due to atom i)
-	// rhojp = derivative of (density at atom i due to atom j)
-	// phi = pair potential energy
-	// phip = phi'
-	// z2 = phi * r
-	// z2p = (phi * r)' = (phi' r) + phi
+        jtype = type[j];
+        r = sqrt(rsq);
+        p = r*rdr + 1.0;
+        m = static_cast<int> (p);
+        m = MIN(m,nr-1);
+        p -= m;
+        p = MIN(p,1.0);
+
+        // rhoip = derivative of (density at atom j due to atom i)
+        // rhojp = derivative of (density at atom i due to atom j)
+        // phi = pair potential energy
+        // phip = phi'
+        // z2 = phi * r
+        // z2p = (phi * r)' = (phi' r) + phi
         // u2 = u
         // u2p = u'
         // w2 = w
         // w2p = w'
-	// psip needs both fp[i] and fp[j] terms since r_ij appears in two
-	//   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
-	//   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
-
-	coeff = rhor_spline[type2rhor[itype][jtype]][m];
-	rhoip = (coeff[0]*p + coeff[1])*p + coeff[2];
-	coeff = rhor_spline[type2rhor[jtype][itype]][m];
-	rhojp = (coeff[0]*p + coeff[1])*p + coeff[2];
-	coeff = z2r_spline[type2z2r[itype][jtype]][m];
-	z2p = (coeff[0]*p + coeff[1])*p + coeff[2];
-	z2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        // psip needs both fp[i] and fp[j] terms since r_ij appears in two
+        //   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
+        //   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
+
+        coeff = rhor_spline[type2rhor[itype][jtype]][m];
+        rhoip = (coeff[0]*p + coeff[1])*p + coeff[2];
+        coeff = rhor_spline[type2rhor[jtype][itype]][m];
+        rhojp = (coeff[0]*p + coeff[1])*p + coeff[2];
+        coeff = z2r_spline[type2z2r[itype][jtype]][m];
+        z2p = (coeff[0]*p + coeff[1])*p + coeff[2];
+        z2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
         coeff = u2r_spline[type2u2r[itype][jtype]][m];
-	u2p = (coeff[0]*p + coeff[1])*p + coeff[2];
-	u2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        u2p = (coeff[0]*p + coeff[1])*p + coeff[2];
+        u2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
         coeff = w2r_spline[type2w2r[itype][jtype]][m];
-	w2p = (coeff[0]*p + coeff[1])*p + coeff[2];
-	w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        w2p = (coeff[0]*p + coeff[1])*p + coeff[2];
+        w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
 
-	recip = 1.0/r;
-	phi = z2*recip;
-	phip = z2p*recip - phi*recip;
-	psip = fp[i]*rhojp + fp[j]*rhoip + phip;
-	fpair = -psip*recip;
+        recip = 1.0/r;
+        phi = z2*recip;
+        phip = z2p*recip - phi*recip;
+        psip = fp[i]*rhojp + fp[j]*rhoip + phip;
+        fpair = -psip*recip;
 
         delmux = mu[i][0]-mu[j][0];
-	delmuy = mu[i][1]-mu[j][1];
-	delmuz = mu[i][2]-mu[j][2];
+        delmuy = mu[i][1]-mu[j][1];
+        delmuz = mu[i][2]-mu[j][2];
         trdelmu = delmux*delx+delmuy*dely+delmuz*delz;
         sumlamxx = lambda[i][0]+lambda[j][0];
         sumlamyy = lambda[i][1]+lambda[j][1];
@@ -352,37 +352,37 @@ void PairADP::compute(int eflag, int vflag)
         sumlamxz = lambda[i][4]+lambda[j][4];
         sumlamxy = lambda[i][5]+lambda[j][5];
         tradellam = sumlamxx*delx*delx+sumlamyy*dely*dely+
-	  sumlamzz*delz*delz+2.0*sumlamxy*delx*dely+
-	  2.0*sumlamxz*delx*delz+2.0*sumlamyz*dely*delz;
+          sumlamzz*delz*delz+2.0*sumlamxy*delx*dely+
+          2.0*sumlamxz*delx*delz+2.0*sumlamyz*dely*delz;
         nu = sumlamxx+sumlamyy+sumlamzz;
 
-        adpx = delmux*u2 + trdelmu*u2p*delx*recip + 
-	  2.0*w2*(sumlamxx*delx+sumlamxy*dely+sumlamxz*delz) + 
-	  w2p*delx*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*delx;
-        adpy = delmuy*u2 + trdelmu*u2p*dely*recip + 
-	  2.0*w2*(sumlamxy*delx+sumlamyy*dely+sumlamyz*delz) + 
-	  w2p*dely*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*dely;
-        adpz = delmuz*u2 + trdelmu*u2p*delz*recip + 
-	  2.0*w2*(sumlamxz*delx+sumlamyz*dely+sumlamzz*delz) + 
-	  w2p*delz*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*delz;
+        adpx = delmux*u2 + trdelmu*u2p*delx*recip +
+          2.0*w2*(sumlamxx*delx+sumlamxy*dely+sumlamxz*delz) +
+          w2p*delx*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*delx;
+        adpy = delmuy*u2 + trdelmu*u2p*dely*recip +
+          2.0*w2*(sumlamxy*delx+sumlamyy*dely+sumlamyz*delz) +
+          w2p*dely*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*dely;
+        adpz = delmuz*u2 + trdelmu*u2p*delz*recip +
+          2.0*w2*(sumlamxz*delx+sumlamyz*dely+sumlamzz*delz) +
+          w2p*delz*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*delz;
         adpx*=-1.0; adpy*=-1.0; adpz*=-1.0;
 
         fx = delx*fpair+adpx;
-	fy = dely*fpair+adpy;
-	fz = delz*fpair+adpz;
-   
-	f[i][0] += fx;
-	f[i][1] += fy;
-	f[i][2] += fz;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	}
-
-	if (eflag) evdwl = phi;
+        fy = dely*fpair+adpy;
+        fz = delz*fpair+adpz;
+
+        f[i][0] += fx;
+        f[i][1] += fy;
+        f[i][2] += fz;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+        }
+
+        if (eflag) evdwl = phi;
         if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,evdwl,0.0,
-				 fx,fy,fz,delx,dely,delz);
+                                 fx,fy,fz,delx,dely,delz);
       }
     }
   }
@@ -488,9 +488,9 @@ void PairADP::coeff(int narg, char **arg)
   for (i = 1; i <= n; i++) {
     for (j = i; j <= n; j++) {
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
-	count++;
+        setflag[i][j] = 1;
+        if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
+        count++;
       }
     }
   }
@@ -570,7 +570,7 @@ void PairADP::read_file(char *filename)
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
     error->all(FLERR,"Incorrect element names in ADP potential file");
-  
+
   char **words = new char*[file->nelements+1];
   nwords = 0;
   strtok(line," \t\n\r\f");
@@ -587,7 +587,7 @@ void PairADP::read_file(char *filename)
   if (me == 0) {
     fgets(line,MAXLINE,fp);
     sscanf(line,"%d %lg %d %lg %lg",
-	   &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
+           &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
   }
 
   MPI_Bcast(&file->nrho,1,MPI_INT,0,world);
@@ -600,11 +600,11 @@ void PairADP::read_file(char *filename)
   memory->create(file->frho,file->nelements,file->nrho+1,"pair:frho");
   memory->create(file->rhor,file->nelements,file->nr+1,"pair:rhor");
   memory->create(file->z2r,file->nelements,file->nelements,file->nr+1,
-		 "pair:z2r");
+                 "pair:z2r");
   memory->create(file->u2r,file->nelements,file->nelements,file->nr+1,
-		 "pair:u2r");
+                 "pair:u2r");
   memory->create(file->w2r,file->nelements,file->nelements,file->nr+1,
-		 "pair:w2r");
+                 "pair:w2r");
 
   int i,j,tmp;
   for (i = 0; i < file->nelements; i++) {
@@ -666,7 +666,7 @@ void PairADP::file2array()
 
   // allocate frho arrays
   // nfrho = # of setfl elements + 1 for zero array
-  
+
   nfrho = setfl->nelements + 1;
   memory->destroy(frho);
   memory->create(frho,nfrho,nrho+1,"pair:frho");
@@ -746,8 +746,8 @@ void PairADP::file2array()
       icol = map[j];
       if (irow == -1 || icol == -1) continue;
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
@@ -788,8 +788,8 @@ void PairADP::file2array()
       icol = map[j];
       if (irow == -1 || icol == -1) continue;
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
@@ -830,8 +830,8 @@ void PairADP::file2array()
       icol = map[j];
       if (irow == -1 || icol == -1) continue;
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
@@ -886,21 +886,21 @@ void PairADP::interpolate(int n, double delta, double *f, double **spline)
   spline[2][5] = 0.5 * (spline[3][6]-spline[1][6]);
   spline[n-1][5] = 0.5 * (spline[n][6]-spline[n-2][6]);
   spline[n][5] = spline[n][6] - spline[n-1][6];
-  
+
   for (int m = 3; m <= n-2; m++)
-    spline[m][5] = ((spline[m-2][6]-spline[m+2][6]) + 
-		    8.0*(spline[m+1][6]-spline[m-1][6])) / 12.0;
-  
+    spline[m][5] = ((spline[m-2][6]-spline[m+2][6]) +
+                    8.0*(spline[m+1][6]-spline[m-1][6])) / 12.0;
+
   for (int m = 1; m <= n-1; m++) {
-    spline[m][4] = 3.0*(spline[m+1][6]-spline[m][6]) - 
+    spline[m][4] = 3.0*(spline[m+1][6]-spline[m][6]) -
       2.0*spline[m][5] - spline[m+1][5];
-    spline[m][3] = spline[m][5] + spline[m+1][5] - 
+    spline[m][3] = spline[m][5] + spline[m+1][5] -
       2.0*(spline[m+1][6]-spline[m][6]);
   }
-  
+
   spline[n][4] = 0.0;
   spline[n][3] = 0.0;
-  
+
   for (int m = 1; m <= n; m++) {
     spline[m][2] = spline[m][5]/delta;
     spline[m][1] = 2.0*spline[m][4]/delta;
@@ -1019,7 +1019,7 @@ void PairADP::unpack_reverse_comm(int n, int *list, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairADP::memory_usage()
diff --git a/src/MANYBODY/pair_adp.h b/src/MANYBODY/pair_adp.h
index 6bd52e6d7d..1c15abe9c1 100644
--- a/src/MANYBODY/pair_adp.h
+++ b/src/MANYBODY/pair_adp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -39,7 +39,7 @@ class PairADP : public Pair {
   int pack_reverse_comm(int, int, double *);
   void unpack_reverse_comm(int, int *, double *);
   double memory_usage();
-  
+
  protected:
   int nmax;                   // allocated size of per-atom arrays
   double cutforcesq,cutmax;
@@ -58,7 +58,7 @@ class PairADP : public Pair {
   double **u2r, **w2r;
   int *type2frho,**type2rhor,**type2z2r;
   int **type2u2r,**type2w2r;
-  
+
   // potentials in spline form used for force computation
 
   double dr,rdr,drho,rdrho;
diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp
index 07d5d8bf90..a39d2484c4 100644
--- a/src/MANYBODY/pair_airebo.cpp
+++ b/src/MANYBODY/pair_airebo.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -96,7 +96,7 @@ void PairAIREBO::compute(int eflag, int vflag)
   FREBO(eflag,vflag);
   if (ljflag) FLJ(eflag,vflag);
   if (torflag) TORSION(eflag,vflag);
-  
+
   if (vflag_fdotr) virial_fdotr_compute();
 }
 
@@ -193,8 +193,8 @@ void PairAIREBO::coeff(int narg, char **arg)
   for (int i = 1; i <= n; i++)
     for (int j = i; j <= n; j++)
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	count++;
+        setflag[i][j] = 1;
+        count++;
       }
 
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
@@ -313,11 +313,11 @@ void PairAIREBO::REBO_neigh()
     memory->destroy(nH);
     memory->create(REBO_numneigh,maxlocal,"AIREBO:numneigh");
     REBO_firstneigh = (int **) memory->smalloc(maxlocal*sizeof(int *),
-					       "AIREBO:firstneigh");
+                                               "AIREBO:firstneigh");
     memory->create(nC,maxlocal,"AIREBO:nC");
     memory->create(nH,maxlocal,"AIREBO:nH");
   }
-  
+
   allnum = list->inum + list->gnum;
   ilist = list->ilist;
   numneigh = list->numneigh;
@@ -358,11 +358,11 @@ void PairAIREBO::REBO_neigh()
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < rcmaxsq[itype][jtype]) {
-	neighptr[n++] = j;
-	if (jtype == 0)
-	  nC[i] += Sp(sqrt(rsq),rcmin[itype][jtype],rcmax[itype][jtype],dS);
-	else
-	  nH[i] += Sp(sqrt(rsq),rcmin[itype][jtype],rcmax[itype][jtype],dS);
+        neighptr[n++] = j;
+        if (jtype == 0)
+          nC[i] += Sp(sqrt(rsq),rcmin[itype][jtype],rcmax[itype][jtype],dS);
+        else
+          nH[i] += Sp(sqrt(rsq),rcmin[itype][jtype],rcmax[itype][jtype],dS);
       }
     }
 
@@ -371,7 +371,7 @@ void PairAIREBO::REBO_neigh()
     npnt += n;
     if (npnt >= pgsize)
       error->one(FLERR,
-		 "Neighbor list overflow, boost neigh_modify one or page");
+                 "Neighbor list overflow, boost neigh_modify one or page");
   }
 }
 
@@ -416,13 +416,13 @@ void PairAIREBO::FREBO(int eflag, int vflag)
       jtag = tag[j];
 
       if (itag > jtag) {
-	if ((itag+jtag) % 2 == 0) continue;
+        if ((itag+jtag) % 2 == 0) continue;
       } else if (itag < jtag) {
-	if ((itag+jtag) % 2 == 1) continue;
+        if ((itag+jtag) % 2 == 1) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
-	if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
+        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
       }
 
       jtype = map[type[j]];
@@ -434,7 +434,7 @@ void PairAIREBO::FREBO(int eflag, int vflag)
       rij = sqrt(rsq);
       wij = Sp(rij,rcmin[itype][jtype],rcmax[itype][jtype],dwij);
       if (wij <= TOL) continue;
-      
+
       Qij = Q[itype][jtype];
       Aij = A[itype][jtype];
       alphaij = alpha[itype][jtype];
@@ -446,9 +446,9 @@ void PairAIREBO::FREBO(int eflag, int vflag)
 
       VA = dVA = 0.0;
       for (m = 0; m < 3; m++) {
-	term = -wij * BIJc[itype][jtype][m] * exp(-Beta[itype][jtype][m]*rij);
-	VA += term;
-	dVA += -Beta[itype][jtype][m] * term;
+        term = -wij * BIJc[itype][jtype][m] * exp(-Beta[itype][jtype][m]*rij);
+        VA += term;
+        dVA += -Beta[itype][jtype][m] * term;
       }
       dVA += VA/wij * dwij;
       del[0] = delx;
@@ -467,7 +467,7 @@ void PairAIREBO::FREBO(int eflag, int vflag)
 
       if (eflag) evdwl = VR + bij*VA;
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,0.0,fpair,delx,dely,delz);
+                           evdwl,0.0,fpair,delx,dely,delz);
     }
   }
 }
@@ -539,13 +539,13 @@ void PairAIREBO::FLJ(int eflag, int vflag)
       jtag = tag[j];
 
       if (itag > jtag) {
-	if ((itag+jtag) % 2 == 0) continue;
+        if ((itag+jtag) % 2 == 0) continue;
       } else if (itag < jtag) {
-	if ((itag+jtag) % 2 == 1) continue;
+        if ((itag+jtag) % 2 == 1) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
-	if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
+        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
       }
 
       jtype = map[type[j]];
@@ -561,139 +561,139 @@ void PairAIREBO::FLJ(int eflag, int vflag)
       // if outside of 2-path cutoff but inside 4-path cutoff,
       //   best = 0.0, test 3-,4-paths
       // if inside 2-path cutoff, best = wij, only test 3-,4-paths if best < 1
-	
+
       if (rijsq >= cutljsq[itype][jtype]) continue;
       rij = sqrt(rijsq);
       if (rij >= cut3rebo) {
-	best = 0.0;
-	testpath = 0;
+        best = 0.0;
+        testpath = 0;
       } else if (rij >= rcmax[itype][jtype]) {
-	best = 0.0;
-	testpath = 1;
+        best = 0.0;
+        testpath = 1;
       } else {
-	best = Sp(rij,rcmin[itype][jtype],rcmax[itype][jtype],dwij);
-	npath = 2;
-	if (best < 1.0) testpath = 1;
-	else testpath = 0;
+        best = Sp(rij,rcmin[itype][jtype],rcmax[itype][jtype],dwij);
+        npath = 2;
+        if (best < 1.0) testpath = 1;
+        else testpath = 0;
       }
 
       done = 0;
       if (testpath) {
 
-	// test all 3-body paths = I-K-J
-	// I-K interactions come from atom I's REBO neighbors
-	// if wik > current best, compute wkj
-	// if best = 1.0, done
-
-	REBO_neighs_i = REBO_firstneigh[i];
-	for (kk = 0; kk < REBO_numneigh[i] && done==0; kk++) {
-	  k = REBO_neighs_i[kk];
-	  if (k == j) continue;
-	  ktype = map[type[k]];
-
-	  delik[0] = x[i][0] - x[k][0];
-	  delik[1] = x[i][1] - x[k][1];
-	  delik[2] = x[i][2] - x[k][2];
-	  rsq = delik[0]*delik[0] + delik[1]*delik[1] + delik[2]*delik[2];
-	  if (rsq < rcmaxsq[itype][ktype]) {
-	    rik = sqrt(rsq);
-	    wik = Sp(rik,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-	  } else wik = 0.0;
-
-	  if (wik > best) {
-	    deljk[0] = x[j][0] - x[k][0];
-	    deljk[1] = x[j][1] - x[k][1];
-	    deljk[2] = x[j][2] - x[k][2];
-	    rsq = deljk[0]*deljk[0] + deljk[1]*deljk[1] + deljk[2]*deljk[2];
-	    if (rsq < rcmaxsq[ktype][jtype]) {
-	      rkj = sqrt(rsq);
-	      wkj = Sp(rkj,rcmin[ktype][jtype],rcmax[ktype][jtype],dwkj);
-	      if (wik*wkj > best) {
-		best = wik*wkj;
-		npath = 3;
- 		atomk = k;
-            	delikS[0] = delik[0];
-            	delikS[1] = delik[1];
-            	delikS[2] = delik[2];
-	    	rikS = rik;
-	    	wikS = wik;
-	    	dwikS = dwik;
-            	deljkS[0] = deljk[0];
-            	deljkS[1] = deljk[1];
-            	deljkS[2] = deljk[2];
-	    	rkjS = rkj;
-	    	wkjS = wkj;
-	    	dwkjS = dwkj;
-		if (best == 1.0) {
-		  done = 1; 
-		  break;
-		}
-	      }
-	    }
-
-	    // test all 4-body paths = I-K-M-J
-	    // K-M interactions come from atom K's REBO neighbors
-	    // if wik*wkm > current best, compute wmj
-	    // if best = 1.0, done
-
-	    REBO_neighs_k = REBO_firstneigh[k];
-	    for (mm = 0; mm < REBO_numneigh[k] && done==0; mm++) {
-	      m = REBO_neighs_k[mm];
-	      if (m == i || m == j) continue;
-	      mtype = map[type[m]];
-	      delkm[0] = x[k][0] - x[m][0];
-	      delkm[1] = x[k][1] - x[m][1];
-	      delkm[2] = x[k][2] - x[m][2];
-	      rsq = delkm[0]*delkm[0] + delkm[1]*delkm[1] + delkm[2]*delkm[2];
-	      if (rsq < rcmaxsq[ktype][mtype]) {
-		rkm = sqrt(rsq);
-		wkm = Sp(rkm,rcmin[ktype][mtype],rcmax[ktype][mtype],dwkm);
-	      } else wkm = 0.0;
-
-	      if (wik*wkm > best) {
-		deljm[0] = x[j][0] - x[m][0];
-		deljm[1] = x[j][1] - x[m][1];
-		deljm[2] = x[j][2] - x[m][2];
-		rsq = deljm[0]*deljm[0] + deljm[1]*deljm[1] +
-		  deljm[2]*deljm[2];
-		if (rsq < rcmaxsq[mtype][jtype]) {
-		  rmj = sqrt(rsq);
-		  wmj = Sp(rmj,rcmin[mtype][jtype],rcmax[mtype][jtype],dwmj);
-		  if (wik*wkm*wmj > best) {
-		    best = wik*wkm*wmj;
-		    npath = 4;
-		    atomk = k;
-		    delikS[0] = delik[0];
-	            delikS[1] = delik[1];
-        	    delikS[2] = delik[2];
-		    rikS = rik;
-		    wikS = wik;
-		    dwikS = dwik;
-		    atomm = m;
-	            delkmS[0] = delkm[0];
-        	    delkmS[1] = delkm[1];
-            	    delkmS[2] = delkm[2];
-		    rkmS = rkm;
-		    wkmS = wkm;
-		    dwkmS = dwkm;
-	            deljmS[0] = deljm[0];
-        	    deljmS[1] = deljm[1];
-           	    deljmS[2] = deljm[2];
-		    rmjS = rmj;
-		    wmjS = wmj;
-		    dwmjS = dwmj;
-		    if (best == 1.0) {
-		      done = 1;
-		      break;
-		    }
-		  }
-		}
-	      }
-	    }
-	  }
-	}
+        // test all 3-body paths = I-K-J
+        // I-K interactions come from atom I's REBO neighbors
+        // if wik > current best, compute wkj
+        // if best = 1.0, done
+
+        REBO_neighs_i = REBO_firstneigh[i];
+        for (kk = 0; kk < REBO_numneigh[i] && done==0; kk++) {
+          k = REBO_neighs_i[kk];
+          if (k == j) continue;
+          ktype = map[type[k]];
+
+          delik[0] = x[i][0] - x[k][0];
+          delik[1] = x[i][1] - x[k][1];
+          delik[2] = x[i][2] - x[k][2];
+          rsq = delik[0]*delik[0] + delik[1]*delik[1] + delik[2]*delik[2];
+          if (rsq < rcmaxsq[itype][ktype]) {
+            rik = sqrt(rsq);
+            wik = Sp(rik,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
+          } else wik = 0.0;
+
+          if (wik > best) {
+            deljk[0] = x[j][0] - x[k][0];
+            deljk[1] = x[j][1] - x[k][1];
+            deljk[2] = x[j][2] - x[k][2];
+            rsq = deljk[0]*deljk[0] + deljk[1]*deljk[1] + deljk[2]*deljk[2];
+            if (rsq < rcmaxsq[ktype][jtype]) {
+              rkj = sqrt(rsq);
+              wkj = Sp(rkj,rcmin[ktype][jtype],rcmax[ktype][jtype],dwkj);
+              if (wik*wkj > best) {
+                best = wik*wkj;
+                npath = 3;
+                 atomk = k;
+                    delikS[0] = delik[0];
+                    delikS[1] = delik[1];
+                    delikS[2] = delik[2];
+                    rikS = rik;
+                    wikS = wik;
+                    dwikS = dwik;
+                    deljkS[0] = deljk[0];
+                    deljkS[1] = deljk[1];
+                    deljkS[2] = deljk[2];
+                    rkjS = rkj;
+                    wkjS = wkj;
+                    dwkjS = dwkj;
+                if (best == 1.0) {
+                  done = 1;
+                  break;
+                }
+              }
+            }
+
+            // test all 4-body paths = I-K-M-J
+            // K-M interactions come from atom K's REBO neighbors
+            // if wik*wkm > current best, compute wmj
+            // if best = 1.0, done
+
+            REBO_neighs_k = REBO_firstneigh[k];
+            for (mm = 0; mm < REBO_numneigh[k] && done==0; mm++) {
+              m = REBO_neighs_k[mm];
+              if (m == i || m == j) continue;
+              mtype = map[type[m]];
+              delkm[0] = x[k][0] - x[m][0];
+              delkm[1] = x[k][1] - x[m][1];
+              delkm[2] = x[k][2] - x[m][2];
+              rsq = delkm[0]*delkm[0] + delkm[1]*delkm[1] + delkm[2]*delkm[2];
+              if (rsq < rcmaxsq[ktype][mtype]) {
+                rkm = sqrt(rsq);
+                wkm = Sp(rkm,rcmin[ktype][mtype],rcmax[ktype][mtype],dwkm);
+              } else wkm = 0.0;
+
+              if (wik*wkm > best) {
+                deljm[0] = x[j][0] - x[m][0];
+                deljm[1] = x[j][1] - x[m][1];
+                deljm[2] = x[j][2] - x[m][2];
+                rsq = deljm[0]*deljm[0] + deljm[1]*deljm[1] +
+                  deljm[2]*deljm[2];
+                if (rsq < rcmaxsq[mtype][jtype]) {
+                  rmj = sqrt(rsq);
+                  wmj = Sp(rmj,rcmin[mtype][jtype],rcmax[mtype][jtype],dwmj);
+                  if (wik*wkm*wmj > best) {
+                    best = wik*wkm*wmj;
+                    npath = 4;
+                    atomk = k;
+                    delikS[0] = delik[0];
+                    delikS[1] = delik[1];
+                    delikS[2] = delik[2];
+                    rikS = rik;
+                    wikS = wik;
+                    dwikS = dwik;
+                    atomm = m;
+                    delkmS[0] = delkm[0];
+                    delkmS[1] = delkm[1];
+                        delkmS[2] = delkm[2];
+                    rkmS = rkm;
+                    wkmS = wkm;
+                    dwkmS = dwkm;
+                    deljmS[0] = deljm[0];
+                    deljmS[1] = deljm[1];
+                       deljmS[2] = deljm[2];
+                    rmjS = rmj;
+                    wmjS = wmj;
+                    dwmjS = dwmj;
+                    if (best == 1.0) {
+                      done = 1;
+                      break;
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
       }
-		
+
       cij = 1.0 - best;
       if (cij == 0.0) continue;
 
@@ -702,24 +702,24 @@ void PairAIREBO::FLJ(int eflag, int vflag)
       sigwid = 0.84;
       sigcut = 3.0;
       sigmin = sigcut - sigwid;
- 
+
       rljmin = sigma[itype][jtype];
       rljmax = sigcut * rljmin;
       rljmin = sigmin * rljmin;
- 
+
       if (rij > rljmax) {
-	slw = 0.0;
-	dslw = 0.0;
+        slw = 0.0;
+        dslw = 0.0;
       } else if (rij > rljmin) {
-	drij = rij - rljmin;
-	swidth = rljmax - rljmin;
-	tee = drij / swidth;
-	tee2 = tee*tee;
-	slw = 1.0 - tee2 * (3.0 - 2.0 * tee);
-	dslw = 6.0 * tee * (1.0 - tee) / rij / swidth;
+        drij = rij - rljmin;
+        swidth = rljmax - rljmin;
+        tee = drij / swidth;
+        tee2 = tee*tee;
+        slw = 1.0 - tee2 * (3.0 - 2.0 * tee);
+        dslw = 6.0 * tee * (1.0 - tee) / rij / swidth;
       } else {
-	slw = 1.0;
-	dslw = 0.0;
+        slw = 1.0;
+        dslw = 0.0;
       }
 
       r2inv = 1.0/rijsq;
@@ -729,112 +729,112 @@ void PairAIREBO::FLJ(int eflag, int vflag)
       dvdw = -r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]) / rij;
 
       // VLJ now becomes vdw * slw, derivaties, etc.
-      
+
       VLJ = vdw * slw;
       dVLJ = dvdw * slw + vdw * dslw;
 
       Str = Sp2(rij,rcLJmin[itype][jtype],rcLJmax[itype][jtype],dStr);
       VA = Str*cij*VLJ;
       if (Str > 0.0) {
-	scale = rcmin[itype][jtype] / rij;
-	delscale[0] = scale * delij[0];
-	delscale[1] = scale * delij[1];
-	delscale[2] = scale * delij[2];
-	Stb = bondorderLJ(i,j,delscale,rcmin[itype][jtype],VA,
-			  delij,rij,f,vflag_atom);
+        scale = rcmin[itype][jtype] / rij;
+        delscale[0] = scale * delij[0];
+        delscale[1] = scale * delij[1];
+        delscale[2] = scale * delij[2];
+        Stb = bondorderLJ(i,j,delscale,rcmin[itype][jtype],VA,
+                          delij,rij,f,vflag_atom);
       } else Stb = 0.0;
 
       fpair = -(dStr * (Stb*cij*VLJ - cij*VLJ) +
-		dVLJ * (Str*Stb*cij + cij - Str*cij)) / rij;
-      
+                dVLJ * (Str*Stb*cij + cij - Str*cij)) / rij;
+
       f[i][0] += delij[0]*fpair;
       f[i][1] += delij[1]*fpair;
       f[i][2] += delij[2]*fpair;
       f[j][0] -= delij[0]*fpair;
       f[j][1] -= delij[1]*fpair;
       f[j][2] -= delij[2]*fpair;
-      
+
       if (eflag) evdwl = VA*Stb + (1.0-Str)*cij*VLJ;
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,0.0,fpair,delij[0],delij[1],delij[2]);
+                           evdwl,0.0,fpair,delij[0],delij[1],delij[2]);
 
       if (cij < 1.0) {
-	dC = Str*Stb*VLJ + (1.0-Str)*VLJ;
-	if (npath == 2) {
-	  fpair = dC*dwij / rij;
-	  f[atomi][0] += delij[0]*fpair;
-	  f[atomi][1] += delij[1]*fpair;
-	  f[atomi][2] += delij[2]*fpair;
-	  f[atomj][0] -= delij[0]*fpair;
-	  f[atomj][1] -= delij[1]*fpair;
-	  f[atomj][2] -= delij[2]*fpair;
-
-	  if (vflag_atom) v_tally2(atomi,atomj,fpair,delij);
-
-	} else if (npath == 3) {
-	  fpair1 = dC*dwikS*wkjS / rikS;
-	  fi[0] = delikS[0]*fpair1;
-	  fi[1] = delikS[1]*fpair1;
-	  fi[2] = delikS[2]*fpair1;
-	  fpair2 = dC*wikS*dwkjS / rkjS;
-	  fj[0] = deljkS[0]*fpair2;
-	  fj[1] = deljkS[1]*fpair2;
-	  fj[2] = deljkS[2]*fpair2;
-
-	  f[atomi][0] += fi[0];
-	  f[atomi][1] += fi[1];
-	  f[atomi][2] += fi[2];
-	  f[atomj][0] += fj[0];
-	  f[atomj][1] += fj[1];
-	  f[atomj][2] += fj[2];
-	  f[atomk][0] -= fi[0] + fj[0];
-	  f[atomk][1] -= fi[1] + fj[1];
-	  f[atomk][2] -= fi[2] + fj[2];
-
-	  if (vflag_atom) 
-	    v_tally3(atomi,atomj,atomk,fi,fj,delikS,deljkS);
-
-	} else {
-	  fpair1 = dC*dwikS*wkmS*wmjS / rikS;
-	  fi[0] = delikS[0]*fpair1;
-	  fi[1] = delikS[1]*fpair1;
-	  fi[2] = delikS[2]*fpair1;
-
-	  fpair2 = dC*wikS*dwkmS*wmjS / rkmS;
-	  fk[0] = delkmS[0]*fpair2 - fi[0];
-	  fk[1] = delkmS[1]*fpair2 - fi[1];
-	  fk[2] = delkmS[2]*fpair2 - fi[2];
-
-	  fpair3 = dC*wikS*wkmS*dwmjS / rmjS;
-	  fj[0] = deljmS[0]*fpair3;
-	  fj[1] = deljmS[1]*fpair3;
-	  fj[2] = deljmS[2]*fpair3;
-
-	  fm[0] = -delkmS[0]*fpair2 - fj[0];
-	  fm[1] = -delkmS[1]*fpair2 - fj[1];
-	  fm[2] = -delkmS[2]*fpair2 - fj[2];
-
-	  f[atomi][0] += fi[0];
-	  f[atomi][1] += fi[1];
-	  f[atomi][2] += fi[2];
-	  f[atomj][0] += fj[0];
-	  f[atomj][1] += fj[1];
-	  f[atomj][2] += fj[2];
-	  f[atomk][0] += fk[0];
-	  f[atomk][1] += fk[1];
-	  f[atomk][2] += fk[2];
-	  f[atomm][0] += fm[0];
-	  f[atomm][1] += fm[1];
-	  f[atomm][2] += fm[2];
-
-	  if (vflag_atom) {
-	    delimS[0] = delikS[0] + delkmS[0];
-	    delimS[1] = delikS[1] + delkmS[1];
-	    delimS[2] = delikS[2] + delkmS[2];
-	    v_tally4(atomi,atomj,atomk,atomm,fi,fj,fk,delimS,deljmS,delkmS);
-	  }
-	}
-      } 
+        dC = Str*Stb*VLJ + (1.0-Str)*VLJ;
+        if (npath == 2) {
+          fpair = dC*dwij / rij;
+          f[atomi][0] += delij[0]*fpair;
+          f[atomi][1] += delij[1]*fpair;
+          f[atomi][2] += delij[2]*fpair;
+          f[atomj][0] -= delij[0]*fpair;
+          f[atomj][1] -= delij[1]*fpair;
+          f[atomj][2] -= delij[2]*fpair;
+
+          if (vflag_atom) v_tally2(atomi,atomj,fpair,delij);
+
+        } else if (npath == 3) {
+          fpair1 = dC*dwikS*wkjS / rikS;
+          fi[0] = delikS[0]*fpair1;
+          fi[1] = delikS[1]*fpair1;
+          fi[2] = delikS[2]*fpair1;
+          fpair2 = dC*wikS*dwkjS / rkjS;
+          fj[0] = deljkS[0]*fpair2;
+          fj[1] = deljkS[1]*fpair2;
+          fj[2] = deljkS[2]*fpair2;
+
+          f[atomi][0] += fi[0];
+          f[atomi][1] += fi[1];
+          f[atomi][2] += fi[2];
+          f[atomj][0] += fj[0];
+          f[atomj][1] += fj[1];
+          f[atomj][2] += fj[2];
+          f[atomk][0] -= fi[0] + fj[0];
+          f[atomk][1] -= fi[1] + fj[1];
+          f[atomk][2] -= fi[2] + fj[2];
+
+          if (vflag_atom)
+            v_tally3(atomi,atomj,atomk,fi,fj,delikS,deljkS);
+
+        } else {
+          fpair1 = dC*dwikS*wkmS*wmjS / rikS;
+          fi[0] = delikS[0]*fpair1;
+          fi[1] = delikS[1]*fpair1;
+          fi[2] = delikS[2]*fpair1;
+
+          fpair2 = dC*wikS*dwkmS*wmjS / rkmS;
+          fk[0] = delkmS[0]*fpair2 - fi[0];
+          fk[1] = delkmS[1]*fpair2 - fi[1];
+          fk[2] = delkmS[2]*fpair2 - fi[2];
+
+          fpair3 = dC*wikS*wkmS*dwmjS / rmjS;
+          fj[0] = deljmS[0]*fpair3;
+          fj[1] = deljmS[1]*fpair3;
+          fj[2] = deljmS[2]*fpair3;
+
+          fm[0] = -delkmS[0]*fpair2 - fj[0];
+          fm[1] = -delkmS[1]*fpair2 - fj[1];
+          fm[2] = -delkmS[2]*fpair2 - fj[2];
+
+          f[atomi][0] += fi[0];
+          f[atomi][1] += fi[1];
+          f[atomi][2] += fi[2];
+          f[atomj][0] += fj[0];
+          f[atomj][1] += fj[1];
+          f[atomj][2] += fj[2];
+          f[atomk][0] += fk[0];
+          f[atomk][1] += fk[1];
+          f[atomk][2] += fk[2];
+          f[atomm][0] += fm[0];
+          f[atomm][1] += fm[1];
+          f[atomm][2] += fm[2];
+
+          if (vflag_atom) {
+            delimS[0] = delikS[0] + delkmS[0];
+            delimS[1] = delikS[1] + delkmS[1];
+            delimS[2] = delikS[2] + delkmS[2];
+            v_tally4(atomi,atomj,atomk,atomm,fi,fj,fk,delimS,deljmS,delkmS);
+          }
+        }
+      }
     }
   }
 }
@@ -890,13 +890,13 @@ void PairAIREBO::TORSION(int eflag, int vflag)
       jtag = tag[j];
 
       if (itag > jtag) {
-	if ((itag+jtag) % 2 == 0) continue;
+        if ((itag+jtag) % 2 == 0) continue;
       } else if (itag < jtag) {
-	if ((itag+jtag) % 2 == 1) continue;
+        if ((itag+jtag) % 2 == 1) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
-	if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
+        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
       }
 
       jtype = map[type[j]];
@@ -914,285 +914,285 @@ void PairAIREBO::TORSION(int eflag, int vflag)
       w23 = Sp(r23,rcmin[itype][jtype],rcmax[itype][jtype],dw23);
 
       for (kk = 0; kk < REBO_numneigh[i]; kk++) {
-	k = REBO_neighs_i[kk];
-	ktype = map[type[k]];
-	if (k == j) continue;
-	del21[0] = x[i][0]-x[k][0];
-	del21[1] = x[i][1]-x[k][1];
-	del21[2] = x[i][2]-x[k][2];
-	rsq = del21[0]*del21[0] + del21[1]*del21[1] + del21[2]*del21[2];
-	r21 = sqrt(rsq);
-	cos321 = - ((del21[0]*del32[0]) + (del21[1]*del32[1]) +
-		    (del21[2]*del32[2])) / (r21*r32);
-	cos321 = MIN(cos321,1.0);
-	cos321 = MAX(cos321,-1.0);
-	sin321 = sqrt(1.0 - cos321*cos321);
-	if (sin321 < TOL) continue;
-	
-	deljk[0] = del21[0]-del23[0];
-	deljk[1] = del21[1]-del23[1];
-	deljk[2] = del21[2]-del23[2];
-	rjk2 = deljk[0]*deljk[0] + deljk[1]*deljk[1] + deljk[2]*deljk[2];
-	rjk=sqrt(rjk2);
-	rik2 = r21*r21;
-	w21 = Sp(r21,rcmin[itype][ktype],rcmax[itype][ktype],dw21);
-
-	rij = r32;
-	rik = r21;
-	rij2 = r32*r32;
-	rik2 = r21*r21;
-	costmp = 0.5*(rij2+rik2-rjk2)/rij/rik;
-	tspjik = Sp2(costmp,thmin,thmax,dtsjik);
-	dtsjik = -dtsjik;
-
-	REBO_neighs_j = REBO_firstneigh[j];
-	for (ll = 0; ll < REBO_numneigh[j]; ll++) {
-	  l = REBO_neighs_j[ll];
-	  ltype = map[type[l]];
-	  if (l == i || l == k) continue;
-	  del34[0] = x[j][0]-x[l][0];
-	  del34[1] = x[j][1]-x[l][1];
-	  del34[2] = x[j][2]-x[l][2];
-	  rsq = del34[0]*del34[0] + del34[1]*del34[1] + del34[2]*del34[2];
-	  r34 = sqrt(rsq);
-	  cos234 = (del32[0]*del34[0] + del32[1]*del34[1] +
-		    del32[2]*del34[2]) / (r32*r34);
-	  cos234 = MIN(cos234,1.0);
-	  cos234 = MAX(cos234,-1.0);
-	  sin234 = sqrt(1.0 - cos234*cos234);
-	  if (sin234 < TOL) continue;
-	  w34 = Sp(r34,rcmin[jtype][ltype],rcmax[jtype][ltype],dw34);
-	  delil[0] = del23[0] + del34[0];
-	  delil[1] = del23[1] + del34[1];
-	  delil[2] = del23[2] + del34[2];
-	  ril2 = delil[0]*delil[0] + delil[1]*delil[1] + delil[2]*delil[2];
-	  ril=sqrt(ril2);
-	  rjl2 = r34*r34;
-
-	  rjl = r34;
-	  rjl2 = r34*r34;
-	  costmp = 0.5*(rij2+rjl2-ril2)/rij/rjl;
-	  tspijl = Sp2(costmp,thmin,thmax,dtsijl);
-	  dtsijl = -dtsijl; //need minus sign 
-	  cross321[0] = (del32[1]*del21[2])-(del32[2]*del21[1]);
-	  cross321[1] = (del32[2]*del21[0])-(del32[0]*del21[2]);
-	  cross321[2] = (del32[0]*del21[1])-(del32[1]*del21[0]);
-	  cross321mag = sqrt(cross321[0]*cross321[0]+
-			     cross321[1]*cross321[1]+
-			     cross321[2]*cross321[2]);
-	  cross234[0] = (del23[1]*del34[2])-(del23[2]*del34[1]);
-	  cross234[1] = (del23[2]*del34[0])-(del23[0]*del34[2]);
-	  cross234[2] = (del23[0]*del34[1])-(del23[1]*del34[0]);
-	  cross234mag = sqrt(cross234[0]*cross234[0]+
-			     cross234[1]*cross234[1]+
-			     cross234[2]*cross234[2]);
-	  cwnum = (cross321[0]*cross234[0]) +
-	    (cross321[1]*cross234[1])+(cross321[2]*cross234[2]);
-	  cwnom = r21*r34*r32*r32*sin321*sin234;
-	  cw = cwnum/cwnom;
-	  
-	  cw2 = (.5*(1.0-cw));
-	  ekijl = epsilonT[ktype][ltype];
-	  Ec = 256.0*ekijl/405.0;
-	  Vtors = (Ec*(pow(cw2,5.0)))-(ekijl/10.0);
-
-	  if (eflag) evdwl = Vtors*w21*w23*w34*(1.0-tspjik)*(1.0-tspijl);
-	  
-	  dndij[0] = (cross234[1]*del21[2])-(cross234[2]*del21[1]);
-	  dndij[1] = (cross234[2]*del21[0])-(cross234[0]*del21[2]);
-	  dndij[2] = (cross234[0]*del21[1])-(cross234[1]*del21[0]); 
-	  
-	  tmpvec[0] = (del34[1]*cross321[2])-(del34[2]*cross321[1]);
-	  tmpvec[1] = (del34[2]*cross321[0])-(del34[0]*cross321[2]);
-	  tmpvec[2] = (del34[0]*cross321[1])-(del34[1]*cross321[0]); 
-	  
-	  dndij[0] = dndij[0]+tmpvec[0];
-	  dndij[1] = dndij[1]+tmpvec[1];
-	  dndij[2] = dndij[2]+tmpvec[2];
-	  
-	  dndik[0] = (del23[1]*cross234[2])-(del23[2]*cross234[1]);
-	  dndik[1] = (del23[2]*cross234[0])-(del23[0]*cross234[2]);
-	  dndik[2] = (del23[0]*cross234[1])-(del23[1]*cross234[0]);
-	  
-	  dndjl[0] = (cross321[1]*del23[2])-(cross321[2]*del23[1]);
-	  dndjl[1] = (cross321[2]*del23[0])-(cross321[0]*del23[2]);
-	  dndjl[2] = (cross321[0]*del23[1])-(cross321[1]*del23[0]); 
-	  
-	  dcidij = ((r23*r23)-(r21*r21)+(rjk*rjk))/(2.0*r23*r23*r21);
-	  dcidik = ((r21*r21)-(r23*r23)+(rjk*rjk))/(2.0*r23*r21*r21);
-	  dcidjk = (-rjk)/(r23*r21);
-	  dcjdji = ((r23*r23)-(r34*r34)+(ril*ril))/(2.0*r23*r23*r34);
-	  dcjdjl = ((r34*r34)-(r23*r23)+(ril*ril))/(2.0*r23*r34*r34);
-	  dcjdil = (-ril)/(r23*r34);
-	  
-	  dsidij = (-cos321/sin321)*dcidij;
-	  dsidik = (-cos321/sin321)*dcidik;
-	  dsidjk = (-cos321/sin321)*dcidjk;
-	  
-	  dsjdji = (-cos234/sin234)*dcjdji;
-	  dsjdjl = (-cos234/sin234)*dcjdjl;
-	  dsjdil = (-cos234/sin234)*dcjdil;
-	  
-	  dxidij = (r21*sin321)+(r23*r21*dsidij);
-	  dxidik = (r23*sin321)+(r23*r21*dsidik);
-	  dxidjk = (r23*r21*dsidjk);
-	  
-	  dxjdji = (r34*sin234)+(r23*r34*dsjdji);
-	  dxjdjl = (r23*sin234)+(r23*r34*dsjdjl);
-	  dxjdil = (r23*r34*dsjdil);
-	  
-	  ddndij = (dxidij*cross234mag)+(cross321mag*dxjdji);
-	  ddndik = dxidik*cross234mag;
-	  ddndjk = dxidjk*cross234mag;
-	  ddndjl = cross321mag*dxjdjl;
-	  ddndil = cross321mag*dxjdil;
-	  dcwddn = -cwnum/(cwnom*cwnom);
-	  dcwdn = 1.0/cwnom;
-	  dvpdcw = (-1.0)*Ec*(-.5)*5.0*pow(cw2,4.0) * 
-	    w23*w21*w34*(1.0-tspjik)*(1.0-tspijl);
-
-	  Ftmp[0] = dvpdcw*((dcwdn*dndij[0])+(dcwddn*ddndij*del23[0]/r23));
-	  Ftmp[1] = dvpdcw*((dcwdn*dndij[1])+(dcwddn*ddndij*del23[1]/r23));
-	  Ftmp[2] = dvpdcw*((dcwdn*dndij[2])+(dcwddn*ddndij*del23[2]/r23));
-	  fi[0] = Ftmp[0];
-	  fi[1] = Ftmp[1];
-	  fi[2] = Ftmp[2];
-	  fj[0] = -Ftmp[0];
-	  fj[1] = -Ftmp[1];
-	  fj[2] = -Ftmp[2];
-	  
-	  Ftmp[0] = dvpdcw*((dcwdn*dndik[0])+(dcwddn*ddndik*del21[0]/r21));
-	  Ftmp[1] = dvpdcw*((dcwdn*dndik[1])+(dcwddn*ddndik*del21[1]/r21));
-	  Ftmp[2] = dvpdcw*((dcwdn*dndik[2])+(dcwddn*ddndik*del21[2]/r21));
-	  fi[0] += Ftmp[0];
-	  fi[1] += Ftmp[1];
-	  fi[2] += Ftmp[2];
-	  fk[0] = -Ftmp[0];
-	  fk[1] = -Ftmp[1];
-	  fk[2] = -Ftmp[2];
-	  
-	  Ftmp[0] = (dvpdcw*dcwddn*ddndjk*deljk[0])/rjk;
-	  Ftmp[1] = (dvpdcw*dcwddn*ddndjk*deljk[1])/rjk;
-	  Ftmp[2] = (dvpdcw*dcwddn*ddndjk*deljk[2])/rjk;
-	  fj[0] += Ftmp[0];
-	  fj[1] += Ftmp[1];
-	  fj[2] += Ftmp[2];
-	  fk[0] -= Ftmp[0];
-	  fk[1] -= Ftmp[1];
-	  fk[2] -= Ftmp[2];
-	  
-	  Ftmp[0] = dvpdcw*((dcwdn*dndjl[0])+(dcwddn*ddndjl*del34[0]/r34));
-	  Ftmp[1] = dvpdcw*((dcwdn*dndjl[1])+(dcwddn*ddndjl*del34[1]/r34));
-	  Ftmp[2] = dvpdcw*((dcwdn*dndjl[2])+(dcwddn*ddndjl*del34[2]/r34));
-	  fj[0] += Ftmp[0];
-	  fj[1] += Ftmp[1];
-	  fj[2] += Ftmp[2];
-	  fl[0] = -Ftmp[0];
-	  fl[1] = -Ftmp[1];
-	  fl[2] = -Ftmp[2];
-	  
-	  Ftmp[0] = (dvpdcw*dcwddn*ddndil*delil[0])/ril;
-	  Ftmp[1] = (dvpdcw*dcwddn*ddndil*delil[1])/ril;
-	  Ftmp[2] = (dvpdcw*dcwddn*ddndil*delil[2])/ril;
-	  fi[0] += Ftmp[0];
-	  fi[1] += Ftmp[1];
-	  fi[2] += Ftmp[2];
-	  fl[0] -= Ftmp[0];
-	  fl[1] -= Ftmp[1];
-	  fl[2] -= Ftmp[2];
-	  
-	  // coordination forces
-	  
-	  fpair = Vtors*dw21*w23*w34*(1.0-tspjik)*(1.0-tspijl) / r21;
-	  fi[0] -= del21[0]*fpair;
-	  fi[1] -= del21[1]*fpair;
-	  fi[2] -= del21[2]*fpair;
-	  fk[0] += del21[0]*fpair;
-	  fk[1] += del21[1]*fpair;
-	  fk[2] += del21[2]*fpair;
-	  
-	  fpair = Vtors*w21*dw23*w34*(1.0-tspjik)*(1.0-tspijl) / r23;
-	  fi[0] -= del23[0]*fpair;
-	  fi[1] -= del23[1]*fpair;
-	  fi[2] -= del23[2]*fpair;
-	  fj[0] += del23[0]*fpair;
-	  fj[1] += del23[1]*fpair;
-	  fj[2] += del23[2]*fpair;
-	  
-	  fpair = Vtors*w21*w23*dw34*(1.0-tspjik)*(1.0-tspijl) / r34;
-	  fj[0] -= del34[0]*fpair;
-	  fj[1] -= del34[1]*fpair;
-	  fj[2] -= del34[2]*fpair;
-	  fl[0] += del34[0]*fpair;
-	  fl[1] += del34[1]*fpair;
-	  fl[2] += del34[2]*fpair;
-
-	  // additional cut off function forces
-
-	  fcpc = -Vtors*w21*w23*w34*dtsjik*(1.0-tspijl);
-	  fpair = fcpc*dcidij/rij;
-	  fi[0] += fpair*del23[0];
-	  fi[1] += fpair*del23[1];
-	  fi[2] += fpair*del23[2];
-	  fj[0] -= fpair*del23[0];
-	  fj[1] -= fpair*del23[1];
-	  fj[2] -= fpair*del23[2];
-
-	  fpair = fcpc*dcidik/rik;
-	  fi[0] += fpair*del21[0];
-	  fi[1] += fpair*del21[1];
-	  fi[2] += fpair*del21[2];
-	  fk[0] -= fpair*del21[0];
-	  fk[1] -= fpair*del21[1];
-	  fk[2] -= fpair*del21[2];
-
-	  fpair = fcpc*dcidjk/rjk;
-	  fj[0] += fpair*deljk[0];
-	  fj[1] += fpair*deljk[1];
-	  fj[2] += fpair*deljk[2];
-	  fk[0] -= fpair*deljk[0];
-	  fk[1] -= fpair*deljk[1];
-	  fk[2] -= fpair*deljk[2];
-	  
-	  fcpc = -Vtors*w21*w23*w34*(1.0-tspjik)*dtsijl;
-	  fpair = fcpc*dcjdji/rij;
-	  fi[0] += fpair*del23[0];
-	  fi[1] += fpair*del23[1];
-	  fi[2] += fpair*del23[2];
-	  fj[0] -= fpair*del23[0];
-	  fj[1] -= fpair*del23[1];
-	  fj[2] -= fpair*del23[2];
-
-	  fpair = fcpc*dcjdjl/rjl;
-	  fj[0] += fpair*del34[0];
-	  fj[1] += fpair*del34[1];
-	  fj[2] += fpair*del34[2];
-	  fl[0] -= fpair*del34[0];
-	  fl[1] -= fpair*del34[1];
-	  fl[2] -= fpair*del34[2];
-
-	  fpair = fcpc*dcjdil/ril;
-	  fi[0] += fpair*delil[0];
-	  fi[1] += fpair*delil[1];
-	  fi[2] += fpair*delil[2];
-	  fl[0] -= fpair*delil[0];
-	  fl[1] -= fpair*delil[1];
-	  fl[2] -= fpair*delil[2];
-
-	  // sum per-atom forces into atom force array
-
-	  f[i][0] += fi[0]; f[i][1] += fi[1]; f[i][2] += fi[2];
-	  f[j][0] += fj[0]; f[j][1] += fj[1]; f[j][2] += fj[2];
-	  f[k][0] += fk[0]; f[k][1] += fk[1]; f[k][2] += fk[2];
-	  f[l][0] += fl[0]; f[l][1] += fl[1]; f[l][2] += fl[2];
-
-	  if (evflag) {
-	    delkl[0] = delil[0] - del21[0];
-	    delkl[1] = delil[1] - del21[1];
-	    delkl[2] = delil[2] - del21[2];
-	    ev_tally4(i,j,k,l,evdwl,fi,fj,fk,delil,del34,delkl);
-	  }
-	}
+        k = REBO_neighs_i[kk];
+        ktype = map[type[k]];
+        if (k == j) continue;
+        del21[0] = x[i][0]-x[k][0];
+        del21[1] = x[i][1]-x[k][1];
+        del21[2] = x[i][2]-x[k][2];
+        rsq = del21[0]*del21[0] + del21[1]*del21[1] + del21[2]*del21[2];
+        r21 = sqrt(rsq);
+        cos321 = - ((del21[0]*del32[0]) + (del21[1]*del32[1]) +
+                    (del21[2]*del32[2])) / (r21*r32);
+        cos321 = MIN(cos321,1.0);
+        cos321 = MAX(cos321,-1.0);
+        sin321 = sqrt(1.0 - cos321*cos321);
+        if (sin321 < TOL) continue;
+
+        deljk[0] = del21[0]-del23[0];
+        deljk[1] = del21[1]-del23[1];
+        deljk[2] = del21[2]-del23[2];
+        rjk2 = deljk[0]*deljk[0] + deljk[1]*deljk[1] + deljk[2]*deljk[2];
+        rjk=sqrt(rjk2);
+        rik2 = r21*r21;
+        w21 = Sp(r21,rcmin[itype][ktype],rcmax[itype][ktype],dw21);
+
+        rij = r32;
+        rik = r21;
+        rij2 = r32*r32;
+        rik2 = r21*r21;
+        costmp = 0.5*(rij2+rik2-rjk2)/rij/rik;
+        tspjik = Sp2(costmp,thmin,thmax,dtsjik);
+        dtsjik = -dtsjik;
+
+        REBO_neighs_j = REBO_firstneigh[j];
+        for (ll = 0; ll < REBO_numneigh[j]; ll++) {
+          l = REBO_neighs_j[ll];
+          ltype = map[type[l]];
+          if (l == i || l == k) continue;
+          del34[0] = x[j][0]-x[l][0];
+          del34[1] = x[j][1]-x[l][1];
+          del34[2] = x[j][2]-x[l][2];
+          rsq = del34[0]*del34[0] + del34[1]*del34[1] + del34[2]*del34[2];
+          r34 = sqrt(rsq);
+          cos234 = (del32[0]*del34[0] + del32[1]*del34[1] +
+                    del32[2]*del34[2]) / (r32*r34);
+          cos234 = MIN(cos234,1.0);
+          cos234 = MAX(cos234,-1.0);
+          sin234 = sqrt(1.0 - cos234*cos234);
+          if (sin234 < TOL) continue;
+          w34 = Sp(r34,rcmin[jtype][ltype],rcmax[jtype][ltype],dw34);
+          delil[0] = del23[0] + del34[0];
+          delil[1] = del23[1] + del34[1];
+          delil[2] = del23[2] + del34[2];
+          ril2 = delil[0]*delil[0] + delil[1]*delil[1] + delil[2]*delil[2];
+          ril=sqrt(ril2);
+          rjl2 = r34*r34;
+
+          rjl = r34;
+          rjl2 = r34*r34;
+          costmp = 0.5*(rij2+rjl2-ril2)/rij/rjl;
+          tspijl = Sp2(costmp,thmin,thmax,dtsijl);
+          dtsijl = -dtsijl; //need minus sign
+          cross321[0] = (del32[1]*del21[2])-(del32[2]*del21[1]);
+          cross321[1] = (del32[2]*del21[0])-(del32[0]*del21[2]);
+          cross321[2] = (del32[0]*del21[1])-(del32[1]*del21[0]);
+          cross321mag = sqrt(cross321[0]*cross321[0]+
+                             cross321[1]*cross321[1]+
+                             cross321[2]*cross321[2]);
+          cross234[0] = (del23[1]*del34[2])-(del23[2]*del34[1]);
+          cross234[1] = (del23[2]*del34[0])-(del23[0]*del34[2]);
+          cross234[2] = (del23[0]*del34[1])-(del23[1]*del34[0]);
+          cross234mag = sqrt(cross234[0]*cross234[0]+
+                             cross234[1]*cross234[1]+
+                             cross234[2]*cross234[2]);
+          cwnum = (cross321[0]*cross234[0]) +
+            (cross321[1]*cross234[1])+(cross321[2]*cross234[2]);
+          cwnom = r21*r34*r32*r32*sin321*sin234;
+          cw = cwnum/cwnom;
+
+          cw2 = (.5*(1.0-cw));
+          ekijl = epsilonT[ktype][ltype];
+          Ec = 256.0*ekijl/405.0;
+          Vtors = (Ec*(pow(cw2,5.0)))-(ekijl/10.0);
+
+          if (eflag) evdwl = Vtors*w21*w23*w34*(1.0-tspjik)*(1.0-tspijl);
+
+          dndij[0] = (cross234[1]*del21[2])-(cross234[2]*del21[1]);
+          dndij[1] = (cross234[2]*del21[0])-(cross234[0]*del21[2]);
+          dndij[2] = (cross234[0]*del21[1])-(cross234[1]*del21[0]);
+
+          tmpvec[0] = (del34[1]*cross321[2])-(del34[2]*cross321[1]);
+          tmpvec[1] = (del34[2]*cross321[0])-(del34[0]*cross321[2]);
+          tmpvec[2] = (del34[0]*cross321[1])-(del34[1]*cross321[0]);
+
+          dndij[0] = dndij[0]+tmpvec[0];
+          dndij[1] = dndij[1]+tmpvec[1];
+          dndij[2] = dndij[2]+tmpvec[2];
+
+          dndik[0] = (del23[1]*cross234[2])-(del23[2]*cross234[1]);
+          dndik[1] = (del23[2]*cross234[0])-(del23[0]*cross234[2]);
+          dndik[2] = (del23[0]*cross234[1])-(del23[1]*cross234[0]);
+
+          dndjl[0] = (cross321[1]*del23[2])-(cross321[2]*del23[1]);
+          dndjl[1] = (cross321[2]*del23[0])-(cross321[0]*del23[2]);
+          dndjl[2] = (cross321[0]*del23[1])-(cross321[1]*del23[0]);
+
+          dcidij = ((r23*r23)-(r21*r21)+(rjk*rjk))/(2.0*r23*r23*r21);
+          dcidik = ((r21*r21)-(r23*r23)+(rjk*rjk))/(2.0*r23*r21*r21);
+          dcidjk = (-rjk)/(r23*r21);
+          dcjdji = ((r23*r23)-(r34*r34)+(ril*ril))/(2.0*r23*r23*r34);
+          dcjdjl = ((r34*r34)-(r23*r23)+(ril*ril))/(2.0*r23*r34*r34);
+          dcjdil = (-ril)/(r23*r34);
+
+          dsidij = (-cos321/sin321)*dcidij;
+          dsidik = (-cos321/sin321)*dcidik;
+          dsidjk = (-cos321/sin321)*dcidjk;
+
+          dsjdji = (-cos234/sin234)*dcjdji;
+          dsjdjl = (-cos234/sin234)*dcjdjl;
+          dsjdil = (-cos234/sin234)*dcjdil;
+
+          dxidij = (r21*sin321)+(r23*r21*dsidij);
+          dxidik = (r23*sin321)+(r23*r21*dsidik);
+          dxidjk = (r23*r21*dsidjk);
+
+          dxjdji = (r34*sin234)+(r23*r34*dsjdji);
+          dxjdjl = (r23*sin234)+(r23*r34*dsjdjl);
+          dxjdil = (r23*r34*dsjdil);
+
+          ddndij = (dxidij*cross234mag)+(cross321mag*dxjdji);
+          ddndik = dxidik*cross234mag;
+          ddndjk = dxidjk*cross234mag;
+          ddndjl = cross321mag*dxjdjl;
+          ddndil = cross321mag*dxjdil;
+          dcwddn = -cwnum/(cwnom*cwnom);
+          dcwdn = 1.0/cwnom;
+          dvpdcw = (-1.0)*Ec*(-.5)*5.0*pow(cw2,4.0) *
+            w23*w21*w34*(1.0-tspjik)*(1.0-tspijl);
+
+          Ftmp[0] = dvpdcw*((dcwdn*dndij[0])+(dcwddn*ddndij*del23[0]/r23));
+          Ftmp[1] = dvpdcw*((dcwdn*dndij[1])+(dcwddn*ddndij*del23[1]/r23));
+          Ftmp[2] = dvpdcw*((dcwdn*dndij[2])+(dcwddn*ddndij*del23[2]/r23));
+          fi[0] = Ftmp[0];
+          fi[1] = Ftmp[1];
+          fi[2] = Ftmp[2];
+          fj[0] = -Ftmp[0];
+          fj[1] = -Ftmp[1];
+          fj[2] = -Ftmp[2];
+
+          Ftmp[0] = dvpdcw*((dcwdn*dndik[0])+(dcwddn*ddndik*del21[0]/r21));
+          Ftmp[1] = dvpdcw*((dcwdn*dndik[1])+(dcwddn*ddndik*del21[1]/r21));
+          Ftmp[2] = dvpdcw*((dcwdn*dndik[2])+(dcwddn*ddndik*del21[2]/r21));
+          fi[0] += Ftmp[0];
+          fi[1] += Ftmp[1];
+          fi[2] += Ftmp[2];
+          fk[0] = -Ftmp[0];
+          fk[1] = -Ftmp[1];
+          fk[2] = -Ftmp[2];
+
+          Ftmp[0] = (dvpdcw*dcwddn*ddndjk*deljk[0])/rjk;
+          Ftmp[1] = (dvpdcw*dcwddn*ddndjk*deljk[1])/rjk;
+          Ftmp[2] = (dvpdcw*dcwddn*ddndjk*deljk[2])/rjk;
+          fj[0] += Ftmp[0];
+          fj[1] += Ftmp[1];
+          fj[2] += Ftmp[2];
+          fk[0] -= Ftmp[0];
+          fk[1] -= Ftmp[1];
+          fk[2] -= Ftmp[2];
+
+          Ftmp[0] = dvpdcw*((dcwdn*dndjl[0])+(dcwddn*ddndjl*del34[0]/r34));
+          Ftmp[1] = dvpdcw*((dcwdn*dndjl[1])+(dcwddn*ddndjl*del34[1]/r34));
+          Ftmp[2] = dvpdcw*((dcwdn*dndjl[2])+(dcwddn*ddndjl*del34[2]/r34));
+          fj[0] += Ftmp[0];
+          fj[1] += Ftmp[1];
+          fj[2] += Ftmp[2];
+          fl[0] = -Ftmp[0];
+          fl[1] = -Ftmp[1];
+          fl[2] = -Ftmp[2];
+
+          Ftmp[0] = (dvpdcw*dcwddn*ddndil*delil[0])/ril;
+          Ftmp[1] = (dvpdcw*dcwddn*ddndil*delil[1])/ril;
+          Ftmp[2] = (dvpdcw*dcwddn*ddndil*delil[2])/ril;
+          fi[0] += Ftmp[0];
+          fi[1] += Ftmp[1];
+          fi[2] += Ftmp[2];
+          fl[0] -= Ftmp[0];
+          fl[1] -= Ftmp[1];
+          fl[2] -= Ftmp[2];
+
+          // coordination forces
+
+          fpair = Vtors*dw21*w23*w34*(1.0-tspjik)*(1.0-tspijl) / r21;
+          fi[0] -= del21[0]*fpair;
+          fi[1] -= del21[1]*fpair;
+          fi[2] -= del21[2]*fpair;
+          fk[0] += del21[0]*fpair;
+          fk[1] += del21[1]*fpair;
+          fk[2] += del21[2]*fpair;
+
+          fpair = Vtors*w21*dw23*w34*(1.0-tspjik)*(1.0-tspijl) / r23;
+          fi[0] -= del23[0]*fpair;
+          fi[1] -= del23[1]*fpair;
+          fi[2] -= del23[2]*fpair;
+          fj[0] += del23[0]*fpair;
+          fj[1] += del23[1]*fpair;
+          fj[2] += del23[2]*fpair;
+
+          fpair = Vtors*w21*w23*dw34*(1.0-tspjik)*(1.0-tspijl) / r34;
+          fj[0] -= del34[0]*fpair;
+          fj[1] -= del34[1]*fpair;
+          fj[2] -= del34[2]*fpair;
+          fl[0] += del34[0]*fpair;
+          fl[1] += del34[1]*fpair;
+          fl[2] += del34[2]*fpair;
+
+          // additional cut off function forces
+
+          fcpc = -Vtors*w21*w23*w34*dtsjik*(1.0-tspijl);
+          fpair = fcpc*dcidij/rij;
+          fi[0] += fpair*del23[0];
+          fi[1] += fpair*del23[1];
+          fi[2] += fpair*del23[2];
+          fj[0] -= fpair*del23[0];
+          fj[1] -= fpair*del23[1];
+          fj[2] -= fpair*del23[2];
+
+          fpair = fcpc*dcidik/rik;
+          fi[0] += fpair*del21[0];
+          fi[1] += fpair*del21[1];
+          fi[2] += fpair*del21[2];
+          fk[0] -= fpair*del21[0];
+          fk[1] -= fpair*del21[1];
+          fk[2] -= fpair*del21[2];
+
+          fpair = fcpc*dcidjk/rjk;
+          fj[0] += fpair*deljk[0];
+          fj[1] += fpair*deljk[1];
+          fj[2] += fpair*deljk[2];
+          fk[0] -= fpair*deljk[0];
+          fk[1] -= fpair*deljk[1];
+          fk[2] -= fpair*deljk[2];
+
+          fcpc = -Vtors*w21*w23*w34*(1.0-tspjik)*dtsijl;
+          fpair = fcpc*dcjdji/rij;
+          fi[0] += fpair*del23[0];
+          fi[1] += fpair*del23[1];
+          fi[2] += fpair*del23[2];
+          fj[0] -= fpair*del23[0];
+          fj[1] -= fpair*del23[1];
+          fj[2] -= fpair*del23[2];
+
+          fpair = fcpc*dcjdjl/rjl;
+          fj[0] += fpair*del34[0];
+          fj[1] += fpair*del34[1];
+          fj[2] += fpair*del34[2];
+          fl[0] -= fpair*del34[0];
+          fl[1] -= fpair*del34[1];
+          fl[2] -= fpair*del34[2];
+
+          fpair = fcpc*dcjdil/ril;
+          fi[0] += fpair*delil[0];
+          fi[1] += fpair*delil[1];
+          fi[2] += fpair*delil[2];
+          fl[0] -= fpair*delil[0];
+          fl[1] -= fpair*delil[1];
+          fl[2] -= fpair*delil[2];
+
+          // sum per-atom forces into atom force array
+
+          f[i][0] += fi[0]; f[i][1] += fi[1]; f[i][2] += fi[2];
+          f[j][0] += fj[0]; f[j][1] += fj[1]; f[j][2] += fj[2];
+          f[k][0] += fk[0]; f[k][1] += fk[1]; f[k][2] += fk[2];
+          f[l][0] += fl[0]; f[l][1] += fl[1]; f[l][2] += fl[2];
+
+          if (evflag) {
+            delkl[0] = delil[0] - del21[0];
+            delkl[1] = delil[1] - del21[1];
+            delkl[2] = delil[2] - del21[2];
+            ev_tally4(i,j,k,l,evdwl,fi,fj,fk,delil,del34,delkl);
+          }
+        }
       }
     }
   }
@@ -1203,8 +1203,8 @@ void PairAIREBO::TORSION(int eflag, int vflag)
 ------------------------------------------------------------------------- */
 
 double PairAIREBO::bondorder(int i, int j, double rij[3],
-			     double rijmag, double VA,
-			     double **f, int vflag_atom)
+                             double rijmag, double VA,
+                             double **f, int vflag_atom)
 {
   int atomi,atomj,k,n,l,atomk,atoml,atomn,atom1,atom2,atom3,atom4;
   int itype,jtype,ktype,ltype,ntype;
@@ -1236,7 +1236,7 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
 
   double **x = atom->x;
   int *type = atom->type;
-  
+
   atomi = i;
   atomj = j;
   itype = map[type[i]];
@@ -1255,7 +1255,7 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
   NconjtmpI = 0.0;
   NconjtmpJ = 0.0;
   Etmp = 0.0;
-  
+
   REBO_neighs = REBO_firstneigh[i];
   for (k = 0; k < REBO_numneigh[i]; k++) {
     atomk = REBO_neighs[k];
@@ -1265,20 +1265,20 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
       rik[1] = x[atomi][1]-x[atomk][1];
       rik[2] = x[atomi][2]-x[atomk][2];
       rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
-      lamdajik = 4.0*kronecker(itype,1) * 
-	((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
+      lamdajik = 4.0*kronecker(itype,1) *
+        ((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
       wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dS);
       Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
-	(wik*kronecker(itype,1));
-      cosjik = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) / 
-	(rijmag*rikmag);
+        (wik*kronecker(itype,1));
+      cosjik = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) /
+        (rijmag*rikmag);
       cosjik = MIN(cosjik,1.0);
       cosjik = MAX(cosjik,-1.0);
 
       // evaluate splines g and derivatives dg
 
       g = gSpline(cosjik,(NijC+NijH),itype,&dgdc,&dgdN);
-      Etmp = Etmp+(wik*g*exp(lamdajik)); 
+      Etmp = Etmp+(wik*g*exp(lamdajik));
       tmp3 = tmp3+(wik*dgdN*exp(lamdajik));
       NconjtmpI = NconjtmpI+(kronecker(ktype,0)*wik*Sp(Nki,Nmin,Nmax,dS));
     }
@@ -1288,7 +1288,7 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
   dN2[0] = 0.0;
   dN2[1] = 0.0;
   PijS = PijSpline(NijC,NijH,itype,jtype,dN2);
-  pij = pow(1.0+Etmp+PijS,-0.5); 
+  pij = pow(1.0+Etmp+PijS,-0.5);
   tmp = -0.5*pow(pij,3.0);
 
   // pij forces
@@ -1302,32 +1302,32 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
       rik[1] = x[atomi][1]-x[atomk][1];
       rik[2] = x[atomi][2]-x[atomk][2];
       rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
-      lamdajik = 4.0*kronecker(itype,1) * 
-	((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
+      lamdajik = 4.0*kronecker(itype,1) *
+        ((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
       wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-      cosjik = (rij[0]*rik[0] + rij[1]*rik[1] + rij[2]*rik[2]) / 
-	(rijmag*rikmag);
+      cosjik = (rij[0]*rik[0] + rij[1]*rik[1] + rij[2]*rik[2]) /
+        (rijmag*rikmag);
       cosjik = MIN(cosjik,1.0);
       cosjik = MAX(cosjik,-1.0);
 
-      dcosjikdri[0] = ((rij[0]+rik[0])/(rijmag*rikmag)) - 
-	(cosjik*((rij[0]/(rijmag*rijmag))+(rik[0]/(rikmag*rikmag))));
-      dcosjikdri[1] = ((rij[1]+rik[1])/(rijmag*rikmag)) - 
-	(cosjik*((rij[1]/(rijmag*rijmag))+(rik[1]/(rikmag*rikmag))));
-      dcosjikdri[2] = ((rij[2]+rik[2])/(rijmag*rikmag)) - 
-	(cosjik*((rij[2]/(rijmag*rijmag))+(rik[2]/(rikmag*rikmag))));
-      dcosjikdrk[0] = (-rij[0]/(rijmag*rikmag)) + 
-	(cosjik*(rik[0]/(rikmag*rikmag)));
-      dcosjikdrk[1] = (-rij[1]/(rijmag*rikmag)) + 
-	(cosjik*(rik[1]/(rikmag*rikmag)));
-      dcosjikdrk[2] = (-rij[2]/(rijmag*rikmag)) + 
-	(cosjik*(rik[2]/(rikmag*rikmag)));
-      dcosjikdrj[0] = (-rik[0]/(rijmag*rikmag)) + 
-	(cosjik*(rij[0]/(rijmag*rijmag)));
-      dcosjikdrj[1] = (-rik[1]/(rijmag*rikmag)) + 
-	(cosjik*(rij[1]/(rijmag*rijmag)));
-      dcosjikdrj[2] = (-rik[2]/(rijmag*rikmag)) + 
-	(cosjik*(rij[2]/(rijmag*rijmag)));
+      dcosjikdri[0] = ((rij[0]+rik[0])/(rijmag*rikmag)) -
+        (cosjik*((rij[0]/(rijmag*rijmag))+(rik[0]/(rikmag*rikmag))));
+      dcosjikdri[1] = ((rij[1]+rik[1])/(rijmag*rikmag)) -
+        (cosjik*((rij[1]/(rijmag*rijmag))+(rik[1]/(rikmag*rikmag))));
+      dcosjikdri[2] = ((rij[2]+rik[2])/(rijmag*rikmag)) -
+        (cosjik*((rij[2]/(rijmag*rijmag))+(rik[2]/(rikmag*rikmag))));
+      dcosjikdrk[0] = (-rij[0]/(rijmag*rikmag)) +
+        (cosjik*(rik[0]/(rikmag*rikmag)));
+      dcosjikdrk[1] = (-rij[1]/(rijmag*rikmag)) +
+        (cosjik*(rik[1]/(rikmag*rikmag)));
+      dcosjikdrk[2] = (-rij[2]/(rijmag*rikmag)) +
+        (cosjik*(rik[2]/(rikmag*rikmag)));
+      dcosjikdrj[0] = (-rik[0]/(rijmag*rikmag)) +
+        (cosjik*(rij[0]/(rijmag*rijmag)));
+      dcosjikdrj[1] = (-rik[1]/(rijmag*rikmag)) +
+        (cosjik*(rij[1]/(rijmag*rijmag)));
+      dcosjikdrj[2] = (-rik[2]/(rijmag*rikmag)) +
+        (cosjik*(rij[2]/(rijmag*rijmag)));
 
       g = gSpline(cosjik,(NijC+NijH),itype,&dgdc,&dgdN);
       tmp2 = VA*.5*(tmp*wik*dgdc*exp(lamdajik));
@@ -1382,16 +1382,16 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
       fi[2] -= tmp2*rik[2];
       fk[0] += tmp2*rik[0];
       fk[1] += tmp2*rik[1];
-      fk[2] += tmp2*rik[2]; 
+      fk[2] += tmp2*rik[2];
 
       f[atomi][0] += fi[0]; f[atomi][1] += fi[1]; f[atomi][2] += fi[2];
       f[atomj][0] += fj[0]; f[atomj][1] += fj[1]; f[atomj][2] += fj[2];
       f[atomk][0] += fk[0]; f[atomk][1] += fk[1]; f[atomk][2] += fk[2];
 
       if (vflag_atom) {
-	rji[0] = -rij[0]; rji[1] = -rij[1]; rji[2] = -rij[2];
-	rki[0] = -rik[0]; rki[1] = -rik[1]; rki[2] = -rik[2];
-	v_tally3(atomi,atomj,atomk,fj,fk,rji,rki);
+        rji[0] = -rij[0]; rji[1] = -rij[1]; rji[2] = -rij[2];
+        rki[0] = -rik[0]; rki[1] = -rik[1]; rki[2] = -rik[2];
+        v_tally3(atomi,atomj,atomk,fj,fk,rji,rki);
       }
     }
   }
@@ -1410,21 +1410,21 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
       rjl[1] = x[atomj][1]-x[atoml][1];
       rjl[2] = x[atomj][2]-x[atoml][2];
       rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
-      lamdaijl = 4.0*kronecker(jtype,1) * 
-	((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
+      lamdaijl = 4.0*kronecker(jtype,1) *
+        ((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
       wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dS);
-      Nlj = nC[atoml]-(wjl*kronecker(jtype,0)) + 
-	nH[atoml]-(wjl*kronecker(jtype,1));
-      cosijl = -1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2])) / 
-	(rijmag*rjlmag);
+      Nlj = nC[atoml]-(wjl*kronecker(jtype,0)) +
+        nH[atoml]-(wjl*kronecker(jtype,1));
+      cosijl = -1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2])) /
+        (rijmag*rjlmag);
       cosijl = MIN(cosijl,1.0);
       cosijl = MAX(cosijl,-1.0);
 
       // evaluate splines g and derivatives dg
 
       g = gSpline(cosijl,NjiC+NjiH,jtype,&dgdc,&dgdN);
-      Etmp = Etmp+(wjl*g*exp(lamdaijl)); 
-      tmp3 = tmp3+(wjl*dgdN*exp(lamdaijl)); 
+      Etmp = Etmp+(wjl*g*exp(lamdaijl));
+      tmp3 = tmp3+(wjl*dgdN*exp(lamdaijl));
       NconjtmpJ = NconjtmpJ+(kronecker(ltype,0)*wjl*Sp(Nlj,Nmin,Nmax,dS));
     }
   }
@@ -1432,7 +1432,7 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
   PjiS = 0.0;
   dN2[0] = 0.0;
   dN2[1] = 0.0;
-  PjiS = PijSpline(NjiC,NjiH,jtype,itype,dN2);  
+  PjiS = PijSpline(NjiC,NjiH,jtype,itype,dN2);
   pji = pow(1.0+Etmp+PjiS,-0.5);
   tmp = -0.5*pow(pji,3.0);
 
@@ -1445,26 +1445,26 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
       rjl[1] = x[atomj][1]-x[atoml][1];
       rjl[2] = x[atomj][2]-x[atoml][2];
       rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
-      lamdaijl = 4.0*kronecker(jtype,1) * 
-	((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
+      lamdaijl = 4.0*kronecker(jtype,1) *
+        ((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
       wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
-      cosijl = (-1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2]))) / 
-	(rijmag*rjlmag);
+      cosijl = (-1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2]))) /
+        (rijmag*rjlmag);
       cosijl = MIN(cosijl,1.0);
       cosijl = MAX(cosijl,-1.0);
 
-      dcosijldri[0] = (-rjl[0]/(rijmag*rjlmag)) - 
-	(cosijl*rij[0]/(rijmag*rijmag));
-      dcosijldri[1] = (-rjl[1]/(rijmag*rjlmag)) - 
-	(cosijl*rij[1]/(rijmag*rijmag));
-      dcosijldri[2] = (-rjl[2]/(rijmag*rjlmag)) - 
-	(cosijl*rij[2]/(rijmag*rijmag));
-      dcosijldrj[0] = ((-rij[0]+rjl[0])/(rijmag*rjlmag)) + 
-	(cosijl*((rij[0]/pow(rijmag,2.0))-(rjl[0]/(rjlmag*rjlmag))));
-      dcosijldrj[1] = ((-rij[1]+rjl[1])/(rijmag*rjlmag)) + 
-	(cosijl*((rij[1]/pow(rijmag,2.0))-(rjl[1]/(rjlmag*rjlmag))));
-      dcosijldrj[2] = ((-rij[2]+rjl[2])/(rijmag*rjlmag)) + 
-	(cosijl*((rij[2]/pow(rijmag,2.0))-(rjl[2]/(rjlmag*rjlmag))));
+      dcosijldri[0] = (-rjl[0]/(rijmag*rjlmag)) -
+        (cosijl*rij[0]/(rijmag*rijmag));
+      dcosijldri[1] = (-rjl[1]/(rijmag*rjlmag)) -
+        (cosijl*rij[1]/(rijmag*rijmag));
+      dcosijldri[2] = (-rjl[2]/(rijmag*rjlmag)) -
+        (cosijl*rij[2]/(rijmag*rijmag));
+      dcosijldrj[0] = ((-rij[0]+rjl[0])/(rijmag*rjlmag)) +
+        (cosijl*((rij[0]/pow(rijmag,2.0))-(rjl[0]/(rjlmag*rjlmag))));
+      dcosijldrj[1] = ((-rij[1]+rjl[1])/(rijmag*rjlmag)) +
+        (cosijl*((rij[1]/pow(rijmag,2.0))-(rjl[1]/(rjlmag*rjlmag))));
+      dcosijldrj[2] = ((-rij[2]+rjl[2])/(rijmag*rjlmag)) +
+        (cosijl*((rij[2]/pow(rijmag,2.0))-(rjl[2]/(rjlmag*rjlmag))));
       dcosijldrl[0] = (rij[0]/(rijmag*rjlmag))+(cosijl*rjl[0]/(rjlmag*rjlmag));
       dcosijldrl[1] = (rij[1]/(rijmag*rjlmag))+(cosijl*rjl[1]/(rjlmag*rjlmag));
       dcosijldrl[2] = (rij[2]/(rijmag*rjlmag))+(cosijl*rjl[2]/(rjlmag*rjlmag));
@@ -1473,15 +1473,15 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
 
       g = gSpline(cosijl,NjiC+NjiH,jtype,&dgdc,&dgdN);
       tmp2 = VA*.5*(tmp*wjl*dgdc*exp(lamdaijl));
-      fi[0] = -tmp2*dcosijldri[0]; 
-      fi[1] = -tmp2*dcosijldri[1]; 
-      fi[2] = -tmp2*dcosijldri[2]; 
-      fj[0] = -tmp2*dcosijldrj[0]; 
-      fj[1] = -tmp2*dcosijldrj[1]; 
-      fj[2] = -tmp2*dcosijldrj[2]; 
-      fl[0] = -tmp2*dcosijldrl[0]; 
-      fl[1] = -tmp2*dcosijldrl[1]; 
-      fl[2] = -tmp2*dcosijldrl[2]; 
+      fi[0] = -tmp2*dcosijldri[0];
+      fi[1] = -tmp2*dcosijldri[1];
+      fi[2] = -tmp2*dcosijldri[2];
+      fj[0] = -tmp2*dcosijldrj[0];
+      fj[1] = -tmp2*dcosijldrj[1];
+      fj[2] = -tmp2*dcosijldrj[2];
+      fl[0] = -tmp2*dcosijldrl[0];
+      fl[1] = -tmp2*dcosijldrl[1];
+      fl[2] = -tmp2*dcosijldrl[2];
 
       tmp2 = VA*.5*(tmp*wjl*g*exp(lamdaijl)*4.0*kronecker(jtype,1));
       fi[0] -= tmp2*(rij[0]/rijmag);
@@ -1495,7 +1495,7 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
       fl[2] -= tmp2*(rjl[2]/rjlmag);
 
       // coordination forces
-      
+
       // dwik forces
 
       tmp2 = VA*.5*(tmp*dwjl*g*exp(lamdaijl))/rjlmag;
@@ -1506,7 +1506,7 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
       fl[1] += tmp2*rjl[1];
       fl[2] += tmp2*rjl[2];
 
-      // PIJ forces 
+      // PIJ forces
 
       tmp2 = VA*.5*(tmp*dN2[ltype]*dwjl)/rjlmag;
       fj[0] -= tmp2*rjl[0];
@@ -1524,24 +1524,24 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
       fj[2] -= tmp2*rjl[2];
       fl[0] += tmp2*rjl[0];
       fl[1] += tmp2*rjl[1];
-      fl[2] += tmp2*rjl[2];  
+      fl[2] += tmp2*rjl[2];
 
       f[atomi][0] += fi[0]; f[atomi][1] += fi[1]; f[atomi][2] += fi[2];
       f[atomj][0] += fj[0]; f[atomj][1] += fj[1]; f[atomj][2] += fj[2];
       f[atoml][0] += fl[0]; f[atoml][1] += fl[1]; f[atoml][2] += fl[2];
 
       if (vflag_atom) {
-	rlj[0] = -rjl[0]; rlj[1] = -rjl[1]; rlj[2] = -rjl[2];
-	v_tally3(atomi,atomj,atoml,fi,fl,rij,rlj);
+        rlj[0] = -rjl[0]; rlj[1] = -rjl[1]; rlj[2] = -rjl[2];
+        v_tally3(atomi,atomj,atoml,fi,fl,rij,rlj);
       }
     }
-  }	
-  
+  }
+
   // evaluate Nij conj
 
   Nijconj = 1.0+(NconjtmpI*NconjtmpI)+(NconjtmpJ*NconjtmpJ);
   piRC = piRCSpline(NijC+NijH,NjiC+NjiH,Nijconj,itype,jtype,dN3);
-  
+
   // piRC forces
 
   REBO_neighs_i = REBO_firstneigh[i];
@@ -1554,57 +1554,57 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
       rik[2] = x[atomi][2]-x[atomk][2];
       rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
       wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-      Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] - 
-	(wik*kronecker(itype,1));
+      Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
+        (wik*kronecker(itype,1));
       SpN = Sp(Nki,Nmin,Nmax,dNki);
 
       tmp2 = VA*dN3[0]*dwik/rikmag;
-      f[atomi][0] -= tmp2*rik[0]; 
-      f[atomi][1] -= tmp2*rik[1]; 
-      f[atomi][2] -= tmp2*rik[2]; 
-      f[atomk][0] += tmp2*rik[0]; 
-      f[atomk][1] += tmp2*rik[1]; 
-      f[atomk][2] += tmp2*rik[2]; 
+      f[atomi][0] -= tmp2*rik[0];
+      f[atomi][1] -= tmp2*rik[1];
+      f[atomi][2] -= tmp2*rik[2];
+      f[atomk][0] += tmp2*rik[0];
+      f[atomk][1] += tmp2*rik[1];
+      f[atomk][2] += tmp2*rik[2];
 
       if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
 
       tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)/rikmag;
-      f[atomi][0] -= tmp2*rik[0]; 
-      f[atomi][1] -= tmp2*rik[1]; 
-      f[atomi][2] -= tmp2*rik[2]; 
-      f[atomk][0] += tmp2*rik[0]; 
-      f[atomk][1] += tmp2*rik[1]; 
+      f[atomi][0] -= tmp2*rik[0];
+      f[atomi][1] -= tmp2*rik[1];
+      f[atomi][2] -= tmp2*rik[2];
+      f[atomk][0] += tmp2*rik[0];
+      f[atomk][1] += tmp2*rik[1];
       f[atomk][2] += tmp2*rik[2];
 
       if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
 
       if (fabs(dNki) > TOL) {
-	REBO_neighs_k = REBO_firstneigh[atomk];
-	for (n = 0; n < REBO_numneigh[atomk]; n++) {
-	  atomn = REBO_neighs_k[n];
-	  if (atomn != atomi) {
-	    ntype = map[type[atomn]];
-	    rkn[0] = x[atomk][0]-x[atomn][0];
-	    rkn[1] = x[atomk][1]-x[atomn][1];
-	    rkn[2] = x[atomk][2]-x[atomn][2];
-	    rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
-	    Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
-
-	    tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)/rknmag;
-	    f[atomk][0] -= tmp2*rkn[0]; 
-	    f[atomk][1] -= tmp2*rkn[1]; 
-	    f[atomk][2] -= tmp2*rkn[2]; 
-	    f[atomn][0] += tmp2*rkn[0]; 
-	    f[atomn][1] += tmp2*rkn[1]; 
-	    f[atomn][2] += tmp2*rkn[2];
-
-	    if (vflag_atom) v_tally2(atomk,atomn,-tmp2,rkn);
-	  }
-	}
-      } 
+        REBO_neighs_k = REBO_firstneigh[atomk];
+        for (n = 0; n < REBO_numneigh[atomk]; n++) {
+          atomn = REBO_neighs_k[n];
+          if (atomn != atomi) {
+            ntype = map[type[atomn]];
+            rkn[0] = x[atomk][0]-x[atomn][0];
+            rkn[1] = x[atomk][1]-x[atomn][1];
+            rkn[2] = x[atomk][2]-x[atomn][2];
+            rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
+            Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
+
+            tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)/rknmag;
+            f[atomk][0] -= tmp2*rkn[0];
+            f[atomk][1] -= tmp2*rkn[1];
+            f[atomk][2] -= tmp2*rkn[2];
+            f[atomn][0] += tmp2*rkn[0];
+            f[atomn][1] += tmp2*rkn[1];
+            f[atomn][2] += tmp2*rkn[2];
+
+            if (vflag_atom) v_tally2(atomk,atomn,-tmp2,rkn);
+          }
+        }
+      }
     }
-  }  
-  
+  }
+
   // piRC forces
 
   REBO_neighs = REBO_firstneigh[atomj];
@@ -1617,57 +1617,57 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
       rjl[2] = x[atomj][2]-x[atoml][2];
       rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
       wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
-      Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] - 
-	(wjl*kronecker(jtype,1));
+      Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
+        (wjl*kronecker(jtype,1));
       SpN = Sp(Nlj,Nmin,Nmax,dNlj);
 
       tmp2 = VA*dN3[1]*dwjl/rjlmag;
-      f[atomj][0] -= tmp2*rjl[0]; 
-      f[atomj][1] -= tmp2*rjl[1]; 
+      f[atomj][0] -= tmp2*rjl[0];
+      f[atomj][1] -= tmp2*rjl[1];
       f[atomj][2] -= tmp2*rjl[2];
-      f[atoml][0] += tmp2*rjl[0]; 
-      f[atoml][1] += tmp2*rjl[1]; 
+      f[atoml][0] += tmp2*rjl[0];
+      f[atoml][1] += tmp2*rjl[1];
       f[atoml][2] += tmp2*rjl[2];
 
       if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
 
       tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)/rjlmag;
-      f[atomj][0] -= tmp2*rjl[0]; 
-      f[atomj][1] -= tmp2*rjl[1]; 
+      f[atomj][0] -= tmp2*rjl[0];
+      f[atomj][1] -= tmp2*rjl[1];
       f[atomj][2] -= tmp2*rjl[2];
-      f[atoml][0] += tmp2*rjl[0]; 
-      f[atoml][1] += tmp2*rjl[1]; 
+      f[atoml][0] += tmp2*rjl[0];
+      f[atoml][1] += tmp2*rjl[1];
       f[atoml][2] += tmp2*rjl[2];
 
       if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
 
       if (fabs(dNlj) > TOL) {
-	REBO_neighs_l = REBO_firstneigh[atoml];
-	for (n = 0; n < REBO_numneigh[atoml]; n++) {
-	  atomn = REBO_neighs_l[n];
-	  if (atomn != atomj) {
-	    ntype = map[type[atomn]];
-	    rln[0] = x[atoml][0]-x[atomn][0];
-	    rln[1] = x[atoml][1]-x[atomn][1];
-	    rln[2] = x[atoml][2]-x[atomn][2];
-	    rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
-	    Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
-
-	    tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)/rlnmag;
-	    f[atoml][0] -= tmp2*rln[0]; 
-	    f[atoml][1] -= tmp2*rln[1]; 
-	    f[atoml][2] -= tmp2*rln[2];
-	    f[atomn][0] += tmp2*rln[0]; 
-	    f[atomn][1] += tmp2*rln[1]; 
-	    f[atomn][2] += tmp2*rln[2];
-	    
-	    if (vflag_atom) v_tally2(atoml,atomn,-tmp2,rln);
-	  }
-	}
-      } 
+        REBO_neighs_l = REBO_firstneigh[atoml];
+        for (n = 0; n < REBO_numneigh[atoml]; n++) {
+          atomn = REBO_neighs_l[n];
+          if (atomn != atomj) {
+            ntype = map[type[atomn]];
+            rln[0] = x[atoml][0]-x[atomn][0];
+            rln[1] = x[atoml][1]-x[atomn][1];
+            rln[2] = x[atoml][2]-x[atomn][2];
+            rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
+            Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
+
+            tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)/rlnmag;
+            f[atoml][0] -= tmp2*rln[0];
+            f[atoml][1] -= tmp2*rln[1];
+            f[atoml][2] -= tmp2*rln[2];
+            f[atomn][0] += tmp2*rln[0];
+            f[atomn][1] += tmp2*rln[1];
+            f[atomn][2] += tmp2*rln[2];
+
+            if (vflag_atom) v_tally2(atoml,atomn,-tmp2,rln);
+          }
+        }
+      }
     }
-  }   
-  
+  }
+
   Tij = 0.0;
   dN3[0] = 0.0;
   dN3[1] = 0.0;
@@ -1693,260 +1693,260 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
       atom1 = atomk;
       ktype = map[type[atomk]];
       if (atomk != atomj) {
-	r21[0] = x[atom2][0]-x[atom1][0];
-	r21[1] = x[atom2][1]-x[atom1][1];
-	r21[2] = x[atom2][2]-x[atom1][2];
-	r21mag = sqrt(r21[0]*r21[0] + r21[1]*r21[1] + r21[2]*r21[2]);
-	cos321 = -1.0*((r21[0]*r32[0])+(r21[1]*r32[1])+(r21[2]*r32[2])) / 
-	  (r21mag*r32mag);
-	cos321 = MIN(cos321,1.0);
-	cos321 = MAX(cos321,-1.0);
-	Sp2(cos321,thmin,thmax,dcut321);
-	sin321 = sqrt(1.0 - cos321*cos321);
-	sink2i = 1.0/(sin321*sin321);
-	rik2i = 1.0/(r21mag*r21mag);
-	if (sin321 != 0.0) {
-	  rr = (r23mag*r23mag)-(r21mag*r21mag);
-	  rjk[0] = r21[0]-r23[0];
-	  rjk[1] = r21[1]-r23[1];
-	  rjk[2] = r21[2]-r23[2];
-	  rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
-	  rijrik = 2.0*r23mag*r21mag;
-	  rik2 = r21mag*r21mag;
-	  dctik = (-rr+rjk2)/(rijrik*rik2);
-	  dctij = (rr+rjk2)/(rijrik*r23mag*r23mag);
-	  dctjk = -2.0/rijrik;
-	  w21 = Sp(r21mag,rcmin[itype][ktype],rcmaxp[itype][ktype],dw21);
-	  rijmag = r32mag;
-	  rikmag = r21mag;
-	  rij2 = r32mag*r32mag;
-	  rik2 = r21mag*r21mag;
-	  costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
-	  tspjik = Sp2(costmp,thmin,thmax,dtsjik);
-	  dtsjik = -dtsjik;
-
-	  REBO_neighs_j = REBO_firstneigh[j];
-	  for (l = 0; l < REBO_numneigh[j]; l++) {
-	    atoml = REBO_neighs_j[l];
-	    atom4 = atoml;
-	    ltype = map[type[atoml]];
-	    if (!(atoml == atomi || atoml == atomk)) {
-	      r34[0] = x[atom3][0]-x[atom4][0];
-	      r34[1] = x[atom3][1]-x[atom4][1];
-	      r34[2] = x[atom3][2]-x[atom4][2];
-	      r34mag = sqrt((r34[0]*r34[0])+(r34[1]*r34[1])+(r34[2]*r34[2]));
-	      cos234 = (r32[0]*r34[0] + r32[1]*r34[1] + r32[2]*r34[2]) / 
-		(r32mag*r34mag);
-	      cos234 = MIN(cos234,1.0);
-	      cos234 = MAX(cos234,-1.0);
-	      sin234 = sqrt(1.0 - cos234*cos234);
-	      sinl2i = 1.0/(sin234*sin234);
-	      rjl2i = 1.0/(r34mag*r34mag);
-
-	      if (sin234 != 0.0) {
-		w34 = Sp(r34mag,rcmin[jtype][ltype],rcmaxp[jtype][ltype],dw34);
-		rr = (r23mag*r23mag)-(r34mag*r34mag);
-		ril[0] = r23[0]+r34[0];
-		ril[1] = r23[1]+r34[1];
-		ril[2] = r23[2]+r34[2];
-		ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
-		rijrjl = 2.0*r23mag*r34mag;
-		rjl2 = r34mag*r34mag;
-		dctjl = (-rr+ril2)/(rijrjl*rjl2);
-		dctji = (rr+ril2)/(rijrjl*r23mag*r23mag);
-		dctil = -2.0/rijrjl;
-		rjlmag = r34mag;
-		rjl2 = r34mag*r34mag;
-		costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
-		tspijl = Sp2(costmp,thmin,thmax,dtsijl);
-		dtsijl = -dtsijl;
-		prefactor = VA*Tij;
-
-		cross321[0] = (r32[1]*r21[2])-(r32[2]*r21[1]);
-		cross321[1] = (r32[2]*r21[0])-(r32[0]*r21[2]);
-		cross321[2] = (r32[0]*r21[1])-(r32[1]*r21[0]);
-		cross234[0] = (r23[1]*r34[2])-(r23[2]*r34[1]);
-		cross234[1] = (r23[2]*r34[0])-(r23[0]*r34[2]);
-		cross234[2] = (r23[0]*r34[1])-(r23[1]*r34[0]);
-
-		cwnum = (cross321[0]*cross234[0]) + 
-		  (cross321[1]*cross234[1]) + (cross321[2]*cross234[2]);
-		cwnom = r21mag*r34mag*r23mag*r23mag*sin321*sin234;
-		om1234 = cwnum/cwnom;
-		cw = om1234;
-		Etmp += ((1.0-pow(om1234,2.0))*w21*w34) * 
-		  (1.0-tspjik)*(1.0-tspijl);
-		
-		dt1dik = (rik2i)-(dctik*sink2i*cos321);
-		dt1djk = (-dctjk*sink2i*cos321);
-		dt1djl = (rjl2i)-(dctjl*sinl2i*cos234);
-		dt1dil = (-dctil*sinl2i*cos234);
-		dt1dij = (2.0/(r23mag*r23mag))-(dctij*sink2i*cos321) - 
-		  (dctji*sinl2i*cos234);
-		
-		dt2dik[0] = (-r23[2]*cross234[1])+(r23[1]*cross234[2]);
-		dt2dik[1] = (-r23[0]*cross234[2])+(r23[2]*cross234[0]);
-		dt2dik[2] = (-r23[1]*cross234[0])+(r23[0]*cross234[1]);
-		
-		dt2djl[0] = (-r23[1]*cross321[2])+(r23[2]*cross321[1]);
-		dt2djl[1] = (-r23[2]*cross321[0])+(r23[0]*cross321[2]);
-		dt2djl[2] = (-r23[0]*cross321[1])+(r23[1]*cross321[0]);
-		
-		dt2dij[0] = (r21[2]*cross234[1])-(r34[2]*cross321[1]) - 
-		  (r21[1]*cross234[2])+(r34[1]*cross321[2]);
-		dt2dij[1] = (r21[0]*cross234[2])-(r34[0]*cross321[2]) - 
-		  (r21[2]*cross234[0])+(r34[2]*cross321[0]);
-		dt2dij[2] = (r21[1]*cross234[0])-(r34[1]*cross321[0]) - 
-		  (r21[0]*cross234[1])+(r34[0]*cross321[1]);
-		
-		aa = (prefactor*2.0*cw/cwnom)*w21*w34 * 
-		  (1.0-tspjik)*(1.0-tspijl);
-		aaa1 = -prefactor*(1.0-pow(om1234,2.0)) * 
-		  (1.0-tspjik)*(1.0-tspijl);
-		aaa2 = aaa1*w21*w34;
-		at2 = aa*cwnum;
-		
-		fcijpc = (-dt1dij*at2)+(aaa2*dtsjik*dctij*(1.0-tspijl)) + 
-		  (aaa2*dtsijl*dctji*(1.0-tspjik));
-		fcikpc = (-dt1dik*at2)+(aaa2*dtsjik*dctik*(1.0-tspijl));
-		fcjlpc = (-dt1djl*at2)+(aaa2*dtsijl*dctjl*(1.0-tspjik));
-		fcjkpc = (-dt1djk*at2)+(aaa2*dtsjik*dctjk*(1.0-tspijl));
-		fcilpc = (-dt1dil*at2)+(aaa2*dtsijl*dctil*(1.0-tspjik));
-		
-		F23[0] = (fcijpc*r23[0])+(aa*dt2dij[0]);
-		F23[1] = (fcijpc*r23[1])+(aa*dt2dij[1]);
-		F23[2] = (fcijpc*r23[2])+(aa*dt2dij[2]);
-		
-		F12[0] = (fcikpc*r21[0])+(aa*dt2dik[0]);
-		F12[1] = (fcikpc*r21[1])+(aa*dt2dik[1]);
-		F12[2] = (fcikpc*r21[2])+(aa*dt2dik[2]);
-		
-		F34[0] = (fcjlpc*r34[0])+(aa*dt2djl[0]);
-		F34[1] = (fcjlpc*r34[1])+(aa*dt2djl[1]);
-		F34[2] = (fcjlpc*r34[2])+(aa*dt2djl[2]);
-		
-		F31[0] = (fcjkpc*rjk[0]);
-		F31[1] = (fcjkpc*rjk[1]);
-		F31[2] = (fcjkpc*rjk[2]);
-		
-		F24[0] = (fcilpc*ril[0]);
-		F24[1] = (fcilpc*ril[1]);
-		F24[2] = (fcilpc*ril[2]);
-		
-		f1[0] = -F12[0]-F31[0];
-		f1[1] = -F12[1]-F31[1];
-		f1[2] = -F12[2]-F31[2];
-		f2[0] = F23[0]+F12[0]+F24[0];
-		f2[1] = F23[1]+F12[1]+F24[1];
-		f2[2] = F23[2]+F12[2]+F24[2];
-		f3[0] = -F23[0]+F34[0]+F31[0];
-		f3[1] = -F23[1]+F34[1]+F31[1];
-		f3[2] = -F23[2]+F34[2]+F31[2];
-		f4[0] = -F34[0]-F24[0];
-		f4[1] = -F34[1]-F24[1];
-		f4[2] = -F34[2]-F24[2];
-		
-		// coordination forces
-
-		tmp2 = VA*Tij*((1.0-(om1234*om1234))) * 
-		  (1.0-tspjik)*(1.0-tspijl)*dw21*w34/r21mag;
-		f2[0] -= tmp2*r21[0];
-		f2[1] -= tmp2*r21[1];
-		f2[2] -= tmp2*r21[2];
-		f1[0] += tmp2*r21[0];
-		f1[1] += tmp2*r21[1];
-		f1[2] += tmp2*r21[2];
-		
-		tmp2 = VA*Tij*((1.0-(om1234*om1234))) * 
-		  (1.0-tspjik)*(1.0-tspijl)*w21*dw34/r34mag;
-		f3[0] -= tmp2*r34[0];
-		f3[1] -= tmp2*r34[1];
-		f3[2] -= tmp2*r34[2];
-		f4[0] += tmp2*r34[0];
-		f4[1] += tmp2*r34[1];
-		f4[2] += tmp2*r34[2];  
-
-		f[atom1][0] += f1[0]; f[atom1][1] += f1[1];
-		f[atom1][2] += f1[2];
-		f[atom2][0] += f2[0]; f[atom2][1] += f2[1];
-		f[atom2][2] += f2[2];
-		f[atom3][0] += f3[0]; f[atom3][1] += f3[1];
-		f[atom3][2] += f3[2];
-		f[atom4][0] += f4[0]; f[atom4][1] += f4[1];
-		f[atom4][2] += f4[2];
-		
-		if (vflag_atom) {
-		  r13[0] = -rjk[0]; r13[1] = -rjk[1]; r13[2] = -rjk[2];
-		  r43[0] = -r34[0]; r43[1] = -r34[1]; r43[2] = -r34[2];
-		  v_tally4(atom1,atom2,atom3,atom4,f1,f2,f4,r13,r23,r43);
-		}
-	      }
-	    }
-	  }
-	}
+        r21[0] = x[atom2][0]-x[atom1][0];
+        r21[1] = x[atom2][1]-x[atom1][1];
+        r21[2] = x[atom2][2]-x[atom1][2];
+        r21mag = sqrt(r21[0]*r21[0] + r21[1]*r21[1] + r21[2]*r21[2]);
+        cos321 = -1.0*((r21[0]*r32[0])+(r21[1]*r32[1])+(r21[2]*r32[2])) /
+          (r21mag*r32mag);
+        cos321 = MIN(cos321,1.0);
+        cos321 = MAX(cos321,-1.0);
+        Sp2(cos321,thmin,thmax,dcut321);
+        sin321 = sqrt(1.0 - cos321*cos321);
+        sink2i = 1.0/(sin321*sin321);
+        rik2i = 1.0/(r21mag*r21mag);
+        if (sin321 != 0.0) {
+          rr = (r23mag*r23mag)-(r21mag*r21mag);
+          rjk[0] = r21[0]-r23[0];
+          rjk[1] = r21[1]-r23[1];
+          rjk[2] = r21[2]-r23[2];
+          rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
+          rijrik = 2.0*r23mag*r21mag;
+          rik2 = r21mag*r21mag;
+          dctik = (-rr+rjk2)/(rijrik*rik2);
+          dctij = (rr+rjk2)/(rijrik*r23mag*r23mag);
+          dctjk = -2.0/rijrik;
+          w21 = Sp(r21mag,rcmin[itype][ktype],rcmaxp[itype][ktype],dw21);
+          rijmag = r32mag;
+          rikmag = r21mag;
+          rij2 = r32mag*r32mag;
+          rik2 = r21mag*r21mag;
+          costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
+          tspjik = Sp2(costmp,thmin,thmax,dtsjik);
+          dtsjik = -dtsjik;
+
+          REBO_neighs_j = REBO_firstneigh[j];
+          for (l = 0; l < REBO_numneigh[j]; l++) {
+            atoml = REBO_neighs_j[l];
+            atom4 = atoml;
+            ltype = map[type[atoml]];
+            if (!(atoml == atomi || atoml == atomk)) {
+              r34[0] = x[atom3][0]-x[atom4][0];
+              r34[1] = x[atom3][1]-x[atom4][1];
+              r34[2] = x[atom3][2]-x[atom4][2];
+              r34mag = sqrt((r34[0]*r34[0])+(r34[1]*r34[1])+(r34[2]*r34[2]));
+              cos234 = (r32[0]*r34[0] + r32[1]*r34[1] + r32[2]*r34[2]) /
+                (r32mag*r34mag);
+              cos234 = MIN(cos234,1.0);
+              cos234 = MAX(cos234,-1.0);
+              sin234 = sqrt(1.0 - cos234*cos234);
+              sinl2i = 1.0/(sin234*sin234);
+              rjl2i = 1.0/(r34mag*r34mag);
+
+              if (sin234 != 0.0) {
+                w34 = Sp(r34mag,rcmin[jtype][ltype],rcmaxp[jtype][ltype],dw34);
+                rr = (r23mag*r23mag)-(r34mag*r34mag);
+                ril[0] = r23[0]+r34[0];
+                ril[1] = r23[1]+r34[1];
+                ril[2] = r23[2]+r34[2];
+                ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
+                rijrjl = 2.0*r23mag*r34mag;
+                rjl2 = r34mag*r34mag;
+                dctjl = (-rr+ril2)/(rijrjl*rjl2);
+                dctji = (rr+ril2)/(rijrjl*r23mag*r23mag);
+                dctil = -2.0/rijrjl;
+                rjlmag = r34mag;
+                rjl2 = r34mag*r34mag;
+                costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
+                tspijl = Sp2(costmp,thmin,thmax,dtsijl);
+                dtsijl = -dtsijl;
+                prefactor = VA*Tij;
+
+                cross321[0] = (r32[1]*r21[2])-(r32[2]*r21[1]);
+                cross321[1] = (r32[2]*r21[0])-(r32[0]*r21[2]);
+                cross321[2] = (r32[0]*r21[1])-(r32[1]*r21[0]);
+                cross234[0] = (r23[1]*r34[2])-(r23[2]*r34[1]);
+                cross234[1] = (r23[2]*r34[0])-(r23[0]*r34[2]);
+                cross234[2] = (r23[0]*r34[1])-(r23[1]*r34[0]);
+
+                cwnum = (cross321[0]*cross234[0]) +
+                  (cross321[1]*cross234[1]) + (cross321[2]*cross234[2]);
+                cwnom = r21mag*r34mag*r23mag*r23mag*sin321*sin234;
+                om1234 = cwnum/cwnom;
+                cw = om1234;
+                Etmp += ((1.0-pow(om1234,2.0))*w21*w34) *
+                  (1.0-tspjik)*(1.0-tspijl);
+
+                dt1dik = (rik2i)-(dctik*sink2i*cos321);
+                dt1djk = (-dctjk*sink2i*cos321);
+                dt1djl = (rjl2i)-(dctjl*sinl2i*cos234);
+                dt1dil = (-dctil*sinl2i*cos234);
+                dt1dij = (2.0/(r23mag*r23mag))-(dctij*sink2i*cos321) -
+                  (dctji*sinl2i*cos234);
+
+                dt2dik[0] = (-r23[2]*cross234[1])+(r23[1]*cross234[2]);
+                dt2dik[1] = (-r23[0]*cross234[2])+(r23[2]*cross234[0]);
+                dt2dik[2] = (-r23[1]*cross234[0])+(r23[0]*cross234[1]);
+
+                dt2djl[0] = (-r23[1]*cross321[2])+(r23[2]*cross321[1]);
+                dt2djl[1] = (-r23[2]*cross321[0])+(r23[0]*cross321[2]);
+                dt2djl[2] = (-r23[0]*cross321[1])+(r23[1]*cross321[0]);
+
+                dt2dij[0] = (r21[2]*cross234[1])-(r34[2]*cross321[1]) -
+                  (r21[1]*cross234[2])+(r34[1]*cross321[2]);
+                dt2dij[1] = (r21[0]*cross234[2])-(r34[0]*cross321[2]) -
+                  (r21[2]*cross234[0])+(r34[2]*cross321[0]);
+                dt2dij[2] = (r21[1]*cross234[0])-(r34[1]*cross321[0]) -
+                  (r21[0]*cross234[1])+(r34[0]*cross321[1]);
+
+                aa = (prefactor*2.0*cw/cwnom)*w21*w34 *
+                  (1.0-tspjik)*(1.0-tspijl);
+                aaa1 = -prefactor*(1.0-pow(om1234,2.0)) *
+                  (1.0-tspjik)*(1.0-tspijl);
+                aaa2 = aaa1*w21*w34;
+                at2 = aa*cwnum;
+
+                fcijpc = (-dt1dij*at2)+(aaa2*dtsjik*dctij*(1.0-tspijl)) +
+                  (aaa2*dtsijl*dctji*(1.0-tspjik));
+                fcikpc = (-dt1dik*at2)+(aaa2*dtsjik*dctik*(1.0-tspijl));
+                fcjlpc = (-dt1djl*at2)+(aaa2*dtsijl*dctjl*(1.0-tspjik));
+                fcjkpc = (-dt1djk*at2)+(aaa2*dtsjik*dctjk*(1.0-tspijl));
+                fcilpc = (-dt1dil*at2)+(aaa2*dtsijl*dctil*(1.0-tspjik));
+
+                F23[0] = (fcijpc*r23[0])+(aa*dt2dij[0]);
+                F23[1] = (fcijpc*r23[1])+(aa*dt2dij[1]);
+                F23[2] = (fcijpc*r23[2])+(aa*dt2dij[2]);
+
+                F12[0] = (fcikpc*r21[0])+(aa*dt2dik[0]);
+                F12[1] = (fcikpc*r21[1])+(aa*dt2dik[1]);
+                F12[2] = (fcikpc*r21[2])+(aa*dt2dik[2]);
+
+                F34[0] = (fcjlpc*r34[0])+(aa*dt2djl[0]);
+                F34[1] = (fcjlpc*r34[1])+(aa*dt2djl[1]);
+                F34[2] = (fcjlpc*r34[2])+(aa*dt2djl[2]);
+
+                F31[0] = (fcjkpc*rjk[0]);
+                F31[1] = (fcjkpc*rjk[1]);
+                F31[2] = (fcjkpc*rjk[2]);
+
+                F24[0] = (fcilpc*ril[0]);
+                F24[1] = (fcilpc*ril[1]);
+                F24[2] = (fcilpc*ril[2]);
+
+                f1[0] = -F12[0]-F31[0];
+                f1[1] = -F12[1]-F31[1];
+                f1[2] = -F12[2]-F31[2];
+                f2[0] = F23[0]+F12[0]+F24[0];
+                f2[1] = F23[1]+F12[1]+F24[1];
+                f2[2] = F23[2]+F12[2]+F24[2];
+                f3[0] = -F23[0]+F34[0]+F31[0];
+                f3[1] = -F23[1]+F34[1]+F31[1];
+                f3[2] = -F23[2]+F34[2]+F31[2];
+                f4[0] = -F34[0]-F24[0];
+                f4[1] = -F34[1]-F24[1];
+                f4[2] = -F34[2]-F24[2];
+
+                // coordination forces
+
+                tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
+                  (1.0-tspjik)*(1.0-tspijl)*dw21*w34/r21mag;
+                f2[0] -= tmp2*r21[0];
+                f2[1] -= tmp2*r21[1];
+                f2[2] -= tmp2*r21[2];
+                f1[0] += tmp2*r21[0];
+                f1[1] += tmp2*r21[1];
+                f1[2] += tmp2*r21[2];
+
+                tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
+                  (1.0-tspjik)*(1.0-tspijl)*w21*dw34/r34mag;
+                f3[0] -= tmp2*r34[0];
+                f3[1] -= tmp2*r34[1];
+                f3[2] -= tmp2*r34[2];
+                f4[0] += tmp2*r34[0];
+                f4[1] += tmp2*r34[1];
+                f4[2] += tmp2*r34[2];
+
+                f[atom1][0] += f1[0]; f[atom1][1] += f1[1];
+                f[atom1][2] += f1[2];
+                f[atom2][0] += f2[0]; f[atom2][1] += f2[1];
+                f[atom2][2] += f2[2];
+                f[atom3][0] += f3[0]; f[atom3][1] += f3[1];
+                f[atom3][2] += f3[2];
+                f[atom4][0] += f4[0]; f[atom4][1] += f4[1];
+                f[atom4][2] += f4[2];
+
+                if (vflag_atom) {
+                  r13[0] = -rjk[0]; r13[1] = -rjk[1]; r13[2] = -rjk[2];
+                  r43[0] = -r34[0]; r43[1] = -r34[1]; r43[2] = -r34[2];
+                  v_tally4(atom1,atom2,atom3,atom4,f1,f2,f4,r13,r23,r43);
+                }
+              }
+            }
+          }
+        }
       }
     }
-    
+
     // Tij forces now that we have Etmp
 
     REBO_neighs = REBO_firstneigh[i];
     for (k = 0; k < REBO_numneigh[i]; k++) {
       atomk = REBO_neighs[k];
       if (atomk != atomj) {
-	ktype = map[type[atomk]];
-	rik[0] = x[atomi][0]-x[atomk][0];
-	rik[1] = x[atomi][1]-x[atomk][1];
-	rik[2] = x[atomi][2]-x[atomk][2];
-	rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
-	wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-	Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] - 
-	  (wik*kronecker(itype,1));
-	SpN = Sp(Nki,Nmin,Nmax,dNki);
-
-	tmp2 = VA*dN3[0]*dwik*Etmp/rikmag;
-	f[atomi][0] -= tmp2*rik[0]; 
-	f[atomi][1] -= tmp2*rik[1]; 
-	f[atomi][2] -= tmp2*rik[2]; 
-	f[atomk][0] += tmp2*rik[0]; 
-	f[atomk][1] += tmp2*rik[1]; 
-	f[atomk][2] += tmp2*rik[2]; 
-
-	if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
-
-	tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)*Etmp/rikmag;
-	f[atomi][0] -= tmp2*rik[0]; 
-	f[atomi][1] -= tmp2*rik[1]; 
-	f[atomi][2] -= tmp2*rik[2]; 
-	f[atomk][0] += tmp2*rik[0]; 
-	f[atomk][1] += tmp2*rik[1]; 
-	f[atomk][2] += tmp2*rik[2]; 
-
-	if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
-
-	if (fabs(dNki) > TOL) {
-	  REBO_neighs_k = REBO_firstneigh[atomk];
-	  for (n = 0; n < REBO_numneigh[atomk]; n++) {
-	    atomn = REBO_neighs_k[n];
-	    ntype = map[type[atomn]];
-	    if (atomn != atomi) {
-	      rkn[0] = x[atomk][0]-x[atomn][0];
-	      rkn[1] = x[atomk][1]-x[atomn][1];
-	      rkn[2] = x[atomk][2]-x[atomn][2];
-	      rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
-	      Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
-
-	      tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)*Etmp/rknmag;
-	      f[atomk][0] -= tmp2*rkn[0]; 
-	      f[atomk][1] -= tmp2*rkn[1]; 
-	      f[atomk][2] -= tmp2*rkn[2]; 
-	      f[atomn][0] += tmp2*rkn[0]; 
-	      f[atomn][1] += tmp2*rkn[1]; 
-	      f[atomn][2] += tmp2*rkn[2]; 
-
-	      if (vflag_atom) v_tally2(atomk,atomn,-tmp2,rkn);
-	    }
-	  }
-	}
+        ktype = map[type[atomk]];
+        rik[0] = x[atomi][0]-x[atomk][0];
+        rik[1] = x[atomi][1]-x[atomk][1];
+        rik[2] = x[atomi][2]-x[atomk][2];
+        rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
+        wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
+        Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
+          (wik*kronecker(itype,1));
+        SpN = Sp(Nki,Nmin,Nmax,dNki);
+
+        tmp2 = VA*dN3[0]*dwik*Etmp/rikmag;
+        f[atomi][0] -= tmp2*rik[0];
+        f[atomi][1] -= tmp2*rik[1];
+        f[atomi][2] -= tmp2*rik[2];
+        f[atomk][0] += tmp2*rik[0];
+        f[atomk][1] += tmp2*rik[1];
+        f[atomk][2] += tmp2*rik[2];
+
+        if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
+
+        tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)*Etmp/rikmag;
+        f[atomi][0] -= tmp2*rik[0];
+        f[atomi][1] -= tmp2*rik[1];
+        f[atomi][2] -= tmp2*rik[2];
+        f[atomk][0] += tmp2*rik[0];
+        f[atomk][1] += tmp2*rik[1];
+        f[atomk][2] += tmp2*rik[2];
+
+        if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
+
+        if (fabs(dNki) > TOL) {
+          REBO_neighs_k = REBO_firstneigh[atomk];
+          for (n = 0; n < REBO_numneigh[atomk]; n++) {
+            atomn = REBO_neighs_k[n];
+            ntype = map[type[atomn]];
+            if (atomn != atomi) {
+              rkn[0] = x[atomk][0]-x[atomn][0];
+              rkn[1] = x[atomk][1]-x[atomn][1];
+              rkn[2] = x[atomk][2]-x[atomn][2];
+              rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
+              Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
+
+              tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)*Etmp/rknmag;
+              f[atomk][0] -= tmp2*rkn[0];
+              f[atomk][1] -= tmp2*rkn[1];
+              f[atomk][2] -= tmp2*rkn[2];
+              f[atomn][0] += tmp2*rkn[0];
+              f[atomn][1] += tmp2*rkn[1];
+              f[atomn][2] += tmp2*rkn[2];
+
+              if (vflag_atom) v_tally2(atomk,atomn,-tmp2,rkn);
+            }
+          }
+        }
       }
     }
 
@@ -1956,60 +1956,60 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
     for (l = 0; l < REBO_numneigh[j]; l++) {
       atoml = REBO_neighs[l];
       if (atoml != atomi) {
-	ltype = map[type[atoml]];
-	rjl[0] = x[atomj][0]-x[atoml][0];
-	rjl[1] = x[atomj][1]-x[atoml][1];
-	rjl[2] = x[atomj][2]-x[atoml][2];
-	rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
-	wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
-	Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] - 
-	  (wjl*kronecker(jtype,1));
-	SpN = Sp(Nlj,Nmin,Nmax,dNlj);
-
-	tmp2 = VA*dN3[1]*dwjl*Etmp/rjlmag;
-	f[atomj][0] -= tmp2*rjl[0]; 
-	f[atomj][1] -= tmp2*rjl[1]; 
-	f[atomj][2] -= tmp2*rjl[2]; 
-	f[atoml][0] += tmp2*rjl[0]; 
-	f[atoml][1] += tmp2*rjl[1]; 
-	f[atoml][2] += tmp2*rjl[2]; 
-
-	if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
-
-	tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)*Etmp/rjlmag;
-	f[atomj][0] -= tmp2*rjl[0]; 
-	f[atomj][1] -= tmp2*rjl[1]; 
-	f[atomj][2] -= tmp2*rjl[2]; 
-	f[atoml][0] += tmp2*rjl[0]; 
-	f[atoml][1] += tmp2*rjl[1]; 
-	f[atoml][2] += tmp2*rjl[2]; 
-
-	if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
-
-	if (fabs(dNlj) > TOL) {
-	  REBO_neighs_l = REBO_firstneigh[atoml];
-	  for (n = 0; n < REBO_numneigh[atoml]; n++) {
-	    atomn = REBO_neighs_l[n];
-	    ntype = map[type[atomn]];
-	    if (atomn !=atomj) {
-	      rln[0] = x[atoml][0]-x[atomn][0];
-	      rln[1] = x[atoml][1]-x[atomn][1];
-	      rln[2] = x[atoml][2]-x[atomn][2];
-	      rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
-	      Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
-
-	      tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)*Etmp/rlnmag;
-	      f[atoml][0] -= tmp2*rln[0];
-	      f[atoml][1] -= tmp2*rln[1];
-	      f[atoml][2] -= tmp2*rln[2];
-	      f[atomn][0] += tmp2*rln[0];
-	      f[atomn][1] += tmp2*rln[1];
-	      f[atomn][2] += tmp2*rln[2];
-
-	      if (vflag_atom) v_tally2(atoml,atomn,-tmp2,rln);
-	    }
-	  }
-	}
+        ltype = map[type[atoml]];
+        rjl[0] = x[atomj][0]-x[atoml][0];
+        rjl[1] = x[atomj][1]-x[atoml][1];
+        rjl[2] = x[atomj][2]-x[atoml][2];
+        rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
+        wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
+        Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
+          (wjl*kronecker(jtype,1));
+        SpN = Sp(Nlj,Nmin,Nmax,dNlj);
+
+        tmp2 = VA*dN3[1]*dwjl*Etmp/rjlmag;
+        f[atomj][0] -= tmp2*rjl[0];
+        f[atomj][1] -= tmp2*rjl[1];
+        f[atomj][2] -= tmp2*rjl[2];
+        f[atoml][0] += tmp2*rjl[0];
+        f[atoml][1] += tmp2*rjl[1];
+        f[atoml][2] += tmp2*rjl[2];
+
+        if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
+
+        tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)*Etmp/rjlmag;
+        f[atomj][0] -= tmp2*rjl[0];
+        f[atomj][1] -= tmp2*rjl[1];
+        f[atomj][2] -= tmp2*rjl[2];
+        f[atoml][0] += tmp2*rjl[0];
+        f[atoml][1] += tmp2*rjl[1];
+        f[atoml][2] += tmp2*rjl[2];
+
+        if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
+
+        if (fabs(dNlj) > TOL) {
+          REBO_neighs_l = REBO_firstneigh[atoml];
+          for (n = 0; n < REBO_numneigh[atoml]; n++) {
+            atomn = REBO_neighs_l[n];
+            ntype = map[type[atomn]];
+            if (atomn !=atomj) {
+              rln[0] = x[atoml][0]-x[atomn][0];
+              rln[1] = x[atoml][1]-x[atomn][1];
+              rln[2] = x[atoml][2]-x[atomn][2];
+              rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
+              Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
+
+              tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)*Etmp/rlnmag;
+              f[atoml][0] -= tmp2*rln[0];
+              f[atoml][1] -= tmp2*rln[1];
+              f[atoml][2] -= tmp2*rln[2];
+              f[atomn][0] += tmp2*rln[0];
+              f[atomn][1] += tmp2*rln[1];
+              f[atomn][2] += tmp2*rln[2];
+
+              if (vflag_atom) v_tally2(atoml,atomn,-tmp2,rln);
+            }
+          }
+        }
       }
     }
   }
@@ -2023,8 +2023,8 @@ double PairAIREBO::bondorder(int i, int j, double rij[3],
 ------------------------------------------------------------------------- */
 
 double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
-			       double VA, double rij0[3], double rij0mag,
-			       double **f, int vflag_atom)
+                               double VA, double rij0[3], double rij0mag,
+                               double **f, int vflag_atom)
 {
   int k,n,l,atomk,atoml,atomn,atom1,atom2,atom3,atom4;
   int atomi,atomj,itype,jtype,ktype,ltype,ntype;
@@ -2052,7 +2052,7 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
   double rjk[3],ril[3],dt1dik,dt1djk,dt1djl,dt1dil,dt1dij;
   double dNlj;
   double PijS,PjiS;
-  double rij2,tspjik,dtsjik,tspijl,dtsijl,costmp; 
+  double rij2,tspjik,dtsjik,tspijl,dtsijl,costmp;
   int *REBO_neighs,*REBO_neighs_i,*REBO_neighs_j,*REBO_neighs_k,*REBO_neighs_l;
   double F12[3],F23[3],F34[3],F31[3],F24[3];
   double fi[3],fj[3],fk[3],fl[3],f1[3],f2[3],f3[3],f4[4];
@@ -2060,7 +2060,7 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
 
   double **x = atom->x;
   int *type = atom->type;
-  
+
   atomi = i;
   atomj = j;
   itype = map[type[atomi]];
@@ -2070,7 +2070,7 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
   NijH = nH[atomi]-(wij*kronecker(jtype,1));
   NjiC = nC[atomj]-(wij*kronecker(itype,0));
   NjiH = nH[atomj]-(wij*kronecker(itype,1));
-  
+
   bij = 0.0;
   tmp = 0.0;
   tmp2 = 0.0;
@@ -2092,13 +2092,13 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
       rik[1] = x[atomi][1]-x[atomk][1];
       rik[2] = x[atomi][2]-x[atomk][2];
       rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
-      lamdajik = 4.0*kronecker(itype,1) * 
-	((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));		
+      lamdajik = 4.0*kronecker(itype,1) *
+        ((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
       wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dS);
-      Nki = nC[atomk]-(wik*kronecker(itype,0)) + 
-	nH[atomk]-(wik*kronecker(itype,1));
-      cosjik = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) / 
-	(rijmag*rikmag);
+      Nki = nC[atomk]-(wik*kronecker(itype,0)) +
+        nH[atomk]-(wik*kronecker(itype,1));
+      cosjik = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) /
+        (rijmag*rikmag);
       cosjik = MIN(cosjik,1.0);
       cosjik = MAX(cosjik,-1.0);
 
@@ -2115,7 +2115,7 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
   dN2PIJ[0] = 0.0;
   dN2PIJ[1] = 0.0;
   PijS = PijSpline(NijC,NijH,itype,jtype,dN2PIJ);
-  pij = pow(1.0+Etmp+PijS,-0.5); 
+  pij = pow(1.0+Etmp+PijS,-0.5);
   tmppij = -.5*pow(pij,3.0);
   tmp3pij = tmp3;
   tmp = 0.0;
@@ -2132,13 +2132,13 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
       rjl[1] = x[atomj][1]-x[atoml][1];
       rjl[2] = x[atomj][2]-x[atoml][2];
       rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
-      lamdaijl = 4.0*kronecker(jtype,1) * 
-	((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
+      lamdaijl = 4.0*kronecker(jtype,1) *
+        ((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
       wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dS);
-      Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] - 
-	(wjl*kronecker(jtype,1));
-      cosijl = -1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2])) / 
-	(rijmag*rjlmag);
+      Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
+        (wjl*kronecker(jtype,1));
+      cosijl = -1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2])) /
+        (rijmag*rjlmag);
       cosijl = MIN(cosijl,1.0);
       cosijl = MAX(cosijl,-1.0);
 
@@ -2177,77 +2177,77 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
       atomk = REBO_neighs_i[k];
       ktype = map[type[atomk]];
       if (atomk != atomj) {
-	rik[0] = x[atomi][0]-x[atomk][0];
-	rik[1] = x[atomi][1]-x[atomk][1];
-	rik[2] = x[atomi][2]-x[atomk][2];
-	rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
-	cos321 = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) / 
-	  (rijmag*rikmag);
-	cos321 = MIN(cos321,1.0);
-	cos321 = MAX(cos321,-1.0);
-
-	rjk[0] = rik[0]-rij[0];
-	rjk[1] = rik[1]-rij[1];
-	rjk[2] = rik[2]-rij[2];
-	rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
-	rij2 = rijmag*rijmag;
-	rik2 = rikmag*rikmag;
-	costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
-	tspjik = Sp2(costmp,thmin,thmax,dtsjik);
-
-	if (sqrt(1.0 - cos321*cos321) > sqrt(TOL)) {
-	  wik = Sp(rikmag,rcmin[itype][ktype],rcmaxp[itype][ktype],dwik);
-	  REBO_neighs_j = REBO_firstneigh[j];
-	  for (l = 0; l < REBO_numneigh[j]; l++) {
-	    atoml = REBO_neighs_j[l];
-	    ltype = map[type[atoml]];
-	    if (!(atoml == atomi || atoml == atomk)) {
-	      rjl[0] = x[atomj][0]-x[atoml][0];
-	      rjl[1] = x[atomj][1]-x[atoml][1];
-	      rjl[2] = x[atomj][2]-x[atoml][2];
-	      rjlmag = sqrt(rjl[0]*rjl[0] + rjl[1]*rjl[1] + rjl[2]*rjl[2]);
-	      cos234 = -((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2])) / 
-		(rijmag*rjlmag);
-	      cos234 = MIN(cos234,1.0);
-	      cos234 = MAX(cos234,-1.0);
-
-	      ril[0] = rij[0]+rjl[0];
-	      ril[1] = rij[1]+rjl[1];
-	      ril[2] = rij[2]+rjl[2];
-	      ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
-	      rijrjl = 2.0*rijmag*rjlmag;
-	      rjl2 = rjlmag*rjlmag;
-	      costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
-	      tspijl = Sp2(costmp,thmin,thmax,dtsijl);
-
-	      if (sqrt(1.0 - cos234*cos234) > sqrt(TOL)) {
-		wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmaxp[jtype][ltype],dS);
-		crosskij[0] = (rij[1]*rik[2]-rij[2]*rik[1]);
-		crosskij[1] = (rij[2]*rik[0]-rij[0]*rik[2]);
-		crosskij[2] = (rij[0]*rik[1]-rij[1]*rik[0]);
-		crosskijmag = sqrt(crosskij[0]*crosskij[0] + 
-				   crosskij[1]*crosskij[1] + 
-				   crosskij[2]*crosskij[2]);
-		crossijl[0] = (rij[1]*rjl[2]-rij[2]*rjl[1]);
-		crossijl[1] = (rij[2]*rjl[0]-rij[0]*rjl[2]);
-		crossijl[2] = (rij[0]*rjl[1]-rij[1]*rjl[0]);
-		crossijlmag = sqrt(crossijl[0]*crossijl[0] + 
-				   crossijl[1]*crossijl[1] + 
-				   crossijl[2]*crossijl[2]);
-		omkijl = -1.0*(((crosskij[0]*crossijl[0]) + 
-				(crosskij[1]*crossijl[1]) + 
-				(crosskij[2]*crossijl[2])) / 
-			       (crosskijmag*crossijlmag));
-		Etmp += ((1.0-pow(omkijl,2.0))*wik*wjl) * 
-		  (1.0-tspjik)*(1.0-tspijl);
-	      }	
-	    }
-	  }
-	}
+        rik[0] = x[atomi][0]-x[atomk][0];
+        rik[1] = x[atomi][1]-x[atomk][1];
+        rik[2] = x[atomi][2]-x[atomk][2];
+        rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
+        cos321 = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) /
+          (rijmag*rikmag);
+        cos321 = MIN(cos321,1.0);
+        cos321 = MAX(cos321,-1.0);
+
+        rjk[0] = rik[0]-rij[0];
+        rjk[1] = rik[1]-rij[1];
+        rjk[2] = rik[2]-rij[2];
+        rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
+        rij2 = rijmag*rijmag;
+        rik2 = rikmag*rikmag;
+        costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
+        tspjik = Sp2(costmp,thmin,thmax,dtsjik);
+
+        if (sqrt(1.0 - cos321*cos321) > sqrt(TOL)) {
+          wik = Sp(rikmag,rcmin[itype][ktype],rcmaxp[itype][ktype],dwik);
+          REBO_neighs_j = REBO_firstneigh[j];
+          for (l = 0; l < REBO_numneigh[j]; l++) {
+            atoml = REBO_neighs_j[l];
+            ltype = map[type[atoml]];
+            if (!(atoml == atomi || atoml == atomk)) {
+              rjl[0] = x[atomj][0]-x[atoml][0];
+              rjl[1] = x[atomj][1]-x[atoml][1];
+              rjl[2] = x[atomj][2]-x[atoml][2];
+              rjlmag = sqrt(rjl[0]*rjl[0] + rjl[1]*rjl[1] + rjl[2]*rjl[2]);
+              cos234 = -((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2])) /
+                (rijmag*rjlmag);
+              cos234 = MIN(cos234,1.0);
+              cos234 = MAX(cos234,-1.0);
+
+              ril[0] = rij[0]+rjl[0];
+              ril[1] = rij[1]+rjl[1];
+              ril[2] = rij[2]+rjl[2];
+              ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
+              rijrjl = 2.0*rijmag*rjlmag;
+              rjl2 = rjlmag*rjlmag;
+              costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
+              tspijl = Sp2(costmp,thmin,thmax,dtsijl);
+
+              if (sqrt(1.0 - cos234*cos234) > sqrt(TOL)) {
+                wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmaxp[jtype][ltype],dS);
+                crosskij[0] = (rij[1]*rik[2]-rij[2]*rik[1]);
+                crosskij[1] = (rij[2]*rik[0]-rij[0]*rik[2]);
+                crosskij[2] = (rij[0]*rik[1]-rij[1]*rik[0]);
+                crosskijmag = sqrt(crosskij[0]*crosskij[0] +
+                                   crosskij[1]*crosskij[1] +
+                                   crosskij[2]*crosskij[2]);
+                crossijl[0] = (rij[1]*rjl[2]-rij[2]*rjl[1]);
+                crossijl[1] = (rij[2]*rjl[0]-rij[0]*rjl[2]);
+                crossijl[2] = (rij[0]*rjl[1]-rij[1]*rjl[0]);
+                crossijlmag = sqrt(crossijl[0]*crossijl[0] +
+                                   crossijl[1]*crossijl[1] +
+                                   crossijl[2]*crossijl[2]);
+                omkijl = -1.0*(((crosskij[0]*crossijl[0]) +
+                                (crosskij[1]*crossijl[1]) +
+                                (crosskij[2]*crossijl[2])) /
+                               (crosskijmag*crossijlmag));
+                Etmp += ((1.0-pow(omkijl,2.0))*wik*wjl) *
+                  (1.0-tspjik)*(1.0-tspijl);
+              }
+            }
+          }
+        }
       }
     }
   }
-  
+
   bij = (.5*(pij+pji))+piRC+(Tij*Etmp);
   Stb = Sp2(bij,bLJmin[itype][jtype],bLJmax[itype][jtype],dStb);
   VA = VA*dStb;
@@ -2264,103 +2264,103 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
     for (k = 0; k < REBO_numneigh[i]; k++) {
       atomk = REBO_neighs_i[k];
       if (atomk != atomj) {
-	lamdajik = 0.0; 
-	rik[0] = x[atomi][0]-x[atomk][0];
-	rik[1] = x[atomi][1]-x[atomk][1];
-	rik[2] = x[atomi][2]-x[atomk][2];
-	rikmag = sqrt(rik[0]*rik[0] + rik[1]*rik[1] + rik[2]*rik[2]);
-	lamdajik = 4.0*kronecker(itype,1) * 
-	  ((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
-	wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-	cosjik = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) / 
-	  (rijmag*rikmag);
-	cosjik = MIN(cosjik,1.0);
-	cosjik = MAX(cosjik,-1.0);
-
-	dcosjikdri[0] = ((rij[0]+rik[0])/(rijmag*rikmag)) - 
-	  (cosjik*((rij[0]/(rijmag*rijmag))+(rik[0]/(rikmag*rikmag))));
-	dcosjikdri[1] = ((rij[1]+rik[1])/(rijmag*rikmag)) - 
-	  (cosjik*((rij[1]/(rijmag*rijmag))+(rik[1]/(rikmag*rikmag))));
-	dcosjikdri[2] = ((rij[2]+rik[2])/(rijmag*rikmag)) - 
-	  (cosjik*((rij[2]/(rijmag*rijmag))+(rik[2]/(rikmag*rikmag))));
-	dcosjikdrk[0] = (-rij[0]/(rijmag*rikmag)) + 
-	  (cosjik*(rik[0]/(rikmag*rikmag)));
-	dcosjikdrk[1] = (-rij[1]/(rijmag*rikmag)) + 
-	  (cosjik*(rik[1]/(rikmag*rikmag)));
-	dcosjikdrk[2] = (-rij[2]/(rijmag*rikmag)) + 
-	  (cosjik*(rik[2]/(rikmag*rikmag)));
-	dcosjikdrj[0] = (-rik[0]/(rijmag*rikmag)) + 
-	  (cosjik*(rij[0]/(rijmag*rijmag)));
-	dcosjikdrj[1] = (-rik[1]/(rijmag*rikmag)) + 
-	  (cosjik*(rij[1]/(rijmag*rijmag)));
-	dcosjikdrj[2] = (-rik[2]/(rijmag*rikmag)) + 
-	  (cosjik*(rij[2]/(rijmag*rijmag)));
-
-	g = gSpline(cosjik,(NijC+NijH),itype,&dgdc,&dgdN);
-
-	tmp2 = VA*.5*(tmp*wik*dgdc*exp(lamdajik));
-	fj[0] = -tmp2*dcosjikdrj[0]; 
-	fj[1] = -tmp2*dcosjikdrj[1]; 
-	fj[2] = -tmp2*dcosjikdrj[2]; 
-	fi[0] = -tmp2*dcosjikdri[0]; 
-	fi[1] = -tmp2*dcosjikdri[1]; 
-	fi[2] = -tmp2*dcosjikdri[2]; 
-	fk[0] = -tmp2*dcosjikdrk[0]; 
-	fk[1] = -tmp2*dcosjikdrk[1]; 
-	fk[2] = -tmp2*dcosjikdrk[2]; 
-
-	tmp2 = VA*.5*(tmp*wik*g*exp(lamdajik)*4.0*kronecker(itype,1));
-	fj[0] -= tmp2*(-rij[0]/rijmag);
-	fj[1] -= tmp2*(-rij[1]/rijmag);
-	fj[2] -= tmp2*(-rij[2]/rijmag);
-	fi[0] -= tmp2*((-rik[0]/rikmag)+(rij[0]/rijmag));
-	fi[1] -= tmp2*((-rik[1]/rikmag)+(rij[1]/rijmag));
-	fi[2] -= tmp2*((-rik[2]/rikmag)+(rij[2]/rijmag));
-	fk[0] -= tmp2*(rik[0]/rikmag);
-	fk[1] -= tmp2*(rik[1]/rikmag);
-	fk[2] -= tmp2*(rik[2]/rikmag);
-
-	// coordination forces
-	
-	// dwik forces
-
-	tmp2 = VA*.5*(tmp*dwik*g*exp(lamdajik))/rikmag;
-	fi[0] -= tmp2*rik[0]; 
-	fi[1] -= tmp2*rik[1]; 
-	fi[2] -= tmp2*rik[2]; 
-	fk[0] += tmp2*rik[0]; 
-	fk[1] += tmp2*rik[1]; 
-	fk[2] += tmp2*rik[2]; 
-
-	// PIJ forces
-
-	tmp2 = VA*.5*(tmp*dN2[ktype]*dwik)/rikmag;
-	fi[0] -= tmp2*rik[0]; 
-	fi[1] -= tmp2*rik[1]; 
-	fi[2] -= tmp2*rik[2]; 
-	fk[0] += tmp2*rik[0]; 
-	fk[1] += tmp2*rik[1]; 
-	fk[2] += tmp2*rik[2]; 
-
-	// dgdN forces
-
-	tmp2 = VA*.5*(tmp*tmp3*dwik)/rikmag;
-	fi[0] -= tmp2*rik[0]; 
-	fi[1] -= tmp2*rik[1]; 
-	fi[2] -= tmp2*rik[2]; 
-	fk[0] += tmp2*rik[0]; 
-	fk[1] += tmp2*rik[1]; 
-	fk[2] += tmp2*rik[2];
-
-	f[atomi][0] += fi[0]; f[atomi][1] += fi[1]; f[atomi][2] += fi[2];
-	f[atomj][0] += fj[0]; f[atomj][1] += fj[1]; f[atomj][2] += fj[2];
-	f[atomk][0] += fk[0]; f[atomk][1] += fk[1]; f[atomk][2] += fk[2];
-	
-	if (vflag_atom) {
-	  rji[0] = -rij[0]; rji[1] = -rij[1]; rji[2] = -rij[2];
-	  rki[0] = -rik[0]; rki[1] = -rik[1]; rki[2] = -rik[2];
-	  v_tally3(atomi,atomj,atomk,fj,fk,rji,rki);
-	}
+        lamdajik = 0.0;
+        rik[0] = x[atomi][0]-x[atomk][0];
+        rik[1] = x[atomi][1]-x[atomk][1];
+        rik[2] = x[atomi][2]-x[atomk][2];
+        rikmag = sqrt(rik[0]*rik[0] + rik[1]*rik[1] + rik[2]*rik[2]);
+        lamdajik = 4.0*kronecker(itype,1) *
+          ((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
+        wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
+        cosjik = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) /
+          (rijmag*rikmag);
+        cosjik = MIN(cosjik,1.0);
+        cosjik = MAX(cosjik,-1.0);
+
+        dcosjikdri[0] = ((rij[0]+rik[0])/(rijmag*rikmag)) -
+          (cosjik*((rij[0]/(rijmag*rijmag))+(rik[0]/(rikmag*rikmag))));
+        dcosjikdri[1] = ((rij[1]+rik[1])/(rijmag*rikmag)) -
+          (cosjik*((rij[1]/(rijmag*rijmag))+(rik[1]/(rikmag*rikmag))));
+        dcosjikdri[2] = ((rij[2]+rik[2])/(rijmag*rikmag)) -
+          (cosjik*((rij[2]/(rijmag*rijmag))+(rik[2]/(rikmag*rikmag))));
+        dcosjikdrk[0] = (-rij[0]/(rijmag*rikmag)) +
+          (cosjik*(rik[0]/(rikmag*rikmag)));
+        dcosjikdrk[1] = (-rij[1]/(rijmag*rikmag)) +
+          (cosjik*(rik[1]/(rikmag*rikmag)));
+        dcosjikdrk[2] = (-rij[2]/(rijmag*rikmag)) +
+          (cosjik*(rik[2]/(rikmag*rikmag)));
+        dcosjikdrj[0] = (-rik[0]/(rijmag*rikmag)) +
+          (cosjik*(rij[0]/(rijmag*rijmag)));
+        dcosjikdrj[1] = (-rik[1]/(rijmag*rikmag)) +
+          (cosjik*(rij[1]/(rijmag*rijmag)));
+        dcosjikdrj[2] = (-rik[2]/(rijmag*rikmag)) +
+          (cosjik*(rij[2]/(rijmag*rijmag)));
+
+        g = gSpline(cosjik,(NijC+NijH),itype,&dgdc,&dgdN);
+
+        tmp2 = VA*.5*(tmp*wik*dgdc*exp(lamdajik));
+        fj[0] = -tmp2*dcosjikdrj[0];
+        fj[1] = -tmp2*dcosjikdrj[1];
+        fj[2] = -tmp2*dcosjikdrj[2];
+        fi[0] = -tmp2*dcosjikdri[0];
+        fi[1] = -tmp2*dcosjikdri[1];
+        fi[2] = -tmp2*dcosjikdri[2];
+        fk[0] = -tmp2*dcosjikdrk[0];
+        fk[1] = -tmp2*dcosjikdrk[1];
+        fk[2] = -tmp2*dcosjikdrk[2];
+
+        tmp2 = VA*.5*(tmp*wik*g*exp(lamdajik)*4.0*kronecker(itype,1));
+        fj[0] -= tmp2*(-rij[0]/rijmag);
+        fj[1] -= tmp2*(-rij[1]/rijmag);
+        fj[2] -= tmp2*(-rij[2]/rijmag);
+        fi[0] -= tmp2*((-rik[0]/rikmag)+(rij[0]/rijmag));
+        fi[1] -= tmp2*((-rik[1]/rikmag)+(rij[1]/rijmag));
+        fi[2] -= tmp2*((-rik[2]/rikmag)+(rij[2]/rijmag));
+        fk[0] -= tmp2*(rik[0]/rikmag);
+        fk[1] -= tmp2*(rik[1]/rikmag);
+        fk[2] -= tmp2*(rik[2]/rikmag);
+
+        // coordination forces
+
+        // dwik forces
+
+        tmp2 = VA*.5*(tmp*dwik*g*exp(lamdajik))/rikmag;
+        fi[0] -= tmp2*rik[0];
+        fi[1] -= tmp2*rik[1];
+        fi[2] -= tmp2*rik[2];
+        fk[0] += tmp2*rik[0];
+        fk[1] += tmp2*rik[1];
+        fk[2] += tmp2*rik[2];
+
+        // PIJ forces
+
+        tmp2 = VA*.5*(tmp*dN2[ktype]*dwik)/rikmag;
+        fi[0] -= tmp2*rik[0];
+        fi[1] -= tmp2*rik[1];
+        fi[2] -= tmp2*rik[2];
+        fk[0] += tmp2*rik[0];
+        fk[1] += tmp2*rik[1];
+        fk[2] += tmp2*rik[2];
+
+        // dgdN forces
+
+        tmp2 = VA*.5*(tmp*tmp3*dwik)/rikmag;
+        fi[0] -= tmp2*rik[0];
+        fi[1] -= tmp2*rik[1];
+        fi[2] -= tmp2*rik[2];
+        fk[0] += tmp2*rik[0];
+        fk[1] += tmp2*rik[1];
+        fk[2] += tmp2*rik[2];
+
+        f[atomi][0] += fi[0]; f[atomi][1] += fi[1]; f[atomi][2] += fi[2];
+        f[atomj][0] += fj[0]; f[atomj][1] += fj[1]; f[atomj][2] += fj[2];
+        f[atomk][0] += fk[0]; f[atomk][1] += fk[1]; f[atomk][2] += fk[2];
+
+        if (vflag_atom) {
+          rji[0] = -rij[0]; rji[1] = -rij[1]; rji[2] = -rij[2];
+          rki[0] = -rik[0]; rki[1] = -rik[1]; rki[2] = -rik[2];
+          v_tally3(atomi,atomj,atomk,fj,fk,rji,rki);
+        }
       }
     }
 
@@ -2372,105 +2372,105 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
     for (l = 0; l < REBO_numneigh[j]; l++) {
       atoml = REBO_neighs[l];
       if (atoml !=atomi) {
-	ltype = map[type[atoml]];
-	rjl[0] = x[atomj][0]-x[atoml][0];
-	rjl[1] = x[atomj][1]-x[atoml][1];
-	rjl[2] = x[atomj][2]-x[atoml][2];
-	rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
-	lamdaijl = 4.0*kronecker(jtype,1) * 
-	  ((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
-	wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
-	cosijl = (-1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2]))) / 
-	  (rijmag*rjlmag);
-	cosijl = MIN(cosijl,1.0);
-	cosijl = MAX(cosijl,-1.0);
-
-	dcosijldri[0] = (-rjl[0]/(rijmag*rjlmag)) - 
-	  (cosijl*rij[0]/(rijmag*rijmag));
-	dcosijldri[1] = (-rjl[1]/(rijmag*rjlmag)) - 
-	  (cosijl*rij[1]/(rijmag*rijmag));
-	dcosijldri[2] = (-rjl[2]/(rijmag*rjlmag)) - 
-	  (cosijl*rij[2]/(rijmag*rijmag));
-	dcosijldrj[0] = ((-rij[0]+rjl[0])/(rijmag*rjlmag)) + 
-	  (cosijl*((rij[0]/pow(rijmag,2.0))-(rjl[0]/(rjlmag*rjlmag))));
-	dcosijldrj[1] = ((-rij[1]+rjl[1])/(rijmag*rjlmag)) + 
-	  (cosijl*((rij[1]/pow(rijmag,2.0))-(rjl[1]/(rjlmag*rjlmag))));
-	dcosijldrj[2] = ((-rij[2]+rjl[2])/(rijmag*rjlmag)) + 
-	  (cosijl*((rij[2]/pow(rijmag,2.0))-(rjl[2]/(rjlmag*rjlmag))));
-	dcosijldrl[0] = (rij[0]/(rijmag*rjlmag)) + 
-	  (cosijl*rjl[0]/(rjlmag*rjlmag));
-	dcosijldrl[1] = (rij[1]/(rijmag*rjlmag)) + 
-	  (cosijl*rjl[1]/(rjlmag*rjlmag));
-	dcosijldrl[2] = (rij[2]/(rijmag*rjlmag)) + 
-	  (cosijl*rjl[2]/(rjlmag*rjlmag));
-
-	// evaluate splines g and derivatives dg
-
-	g = gSpline(cosijl,NjiC+NjiH,jtype,&dgdc,&dgdN);
-	tmp2 = VA*.5*(tmp*wjl*dgdc*exp(lamdaijl));
-	fi[0] = -tmp2*dcosijldri[0]; 
-	fi[1] = -tmp2*dcosijldri[1]; 
-	fi[2] = -tmp2*dcosijldri[2]; 
-	fj[0] = -tmp2*dcosijldrj[0]; 
-	fj[1] = -tmp2*dcosijldrj[1]; 
-	fj[2] = -tmp2*dcosijldrj[2]; 
-	fl[0] = -tmp2*dcosijldrl[0]; 
-	fl[1] = -tmp2*dcosijldrl[1]; 
-	fl[2] = -tmp2*dcosijldrl[2]; 
-
-	tmp2 = VA*.5*(tmp*wjl*g*exp(lamdaijl)*4.0*kronecker(jtype,1));
-	fi[0] -= tmp2*(rij[0]/rijmag);
-	fi[1] -= tmp2*(rij[1]/rijmag);
-	fi[2] -= tmp2*(rij[2]/rijmag);
-	fj[0] -= tmp2*((-rjl[0]/rjlmag)-(rij[0]/rijmag));
-	fj[1] -= tmp2*((-rjl[1]/rjlmag)-(rij[1]/rijmag));
-	fj[2] -= tmp2*((-rjl[2]/rjlmag)-(rij[2]/rijmag));
-	fl[0] -= tmp2*(rjl[0]/rjlmag);
-	fl[1] -= tmp2*(rjl[1]/rjlmag);
-	fl[2] -= tmp2*(rjl[2]/rjlmag); 
-
- 	// coordination forces
-	// dwik forces
-
-	tmp2 = VA*.5*(tmp*dwjl*g*exp(lamdaijl))/rjlmag;
-	fj[0] -= tmp2*rjl[0];
-	fj[1] -= tmp2*rjl[1];
-	fj[2] -= tmp2*rjl[2];
-	fl[0] += tmp2*rjl[0];
-	fl[1] += tmp2*rjl[1];
-	fl[2] += tmp2*rjl[2];
-
-	// PIJ forces
-
-	tmp2 = VA*.5*(tmp*dN2[ltype]*dwjl)/rjlmag;
-	fj[0] -= tmp2*rjl[0];
-	fj[1] -= tmp2*rjl[1];
-	fj[2] -= tmp2*rjl[2];
-	fl[0] += tmp2*rjl[0];
-	fl[1] += tmp2*rjl[1];
-	fl[2] += tmp2*rjl[2];
-
-	// dgdN forces
-
-	tmp2=VA*.5*(tmp*tmp3*dwjl)/rjlmag;
-	fj[0] -= tmp2*rjl[0];
-	fj[1] -= tmp2*rjl[1];
-	fj[2] -= tmp2*rjl[2];
-	fl[0] += tmp2*rjl[0];
-	fl[1] += tmp2*rjl[1];
-	fl[2] += tmp2*rjl[2];
-
-	f[atomi][0] += fi[0]; f[atomi][1] += fi[1]; f[atomi][2] += fi[2];
-	f[atomj][0] += fj[0]; f[atomj][1] += fj[1]; f[atomj][2] += fj[2];
-	f[atoml][0] += fl[0]; f[atoml][1] += fl[1]; f[atoml][2] += fl[2];
-	
-	if (vflag_atom) {
-	  rlj[0] = -rjl[0]; rlj[1] = -rjl[1]; rlj[2] = -rjl[2];
-	  v_tally3(atomi,atomj,atoml,fi,fl,rij,rlj);
-	}
+        ltype = map[type[atoml]];
+        rjl[0] = x[atomj][0]-x[atoml][0];
+        rjl[1] = x[atomj][1]-x[atoml][1];
+        rjl[2] = x[atomj][2]-x[atoml][2];
+        rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
+        lamdaijl = 4.0*kronecker(jtype,1) *
+          ((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
+        wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
+        cosijl = (-1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2]))) /
+          (rijmag*rjlmag);
+        cosijl = MIN(cosijl,1.0);
+        cosijl = MAX(cosijl,-1.0);
+
+        dcosijldri[0] = (-rjl[0]/(rijmag*rjlmag)) -
+          (cosijl*rij[0]/(rijmag*rijmag));
+        dcosijldri[1] = (-rjl[1]/(rijmag*rjlmag)) -
+          (cosijl*rij[1]/(rijmag*rijmag));
+        dcosijldri[2] = (-rjl[2]/(rijmag*rjlmag)) -
+          (cosijl*rij[2]/(rijmag*rijmag));
+        dcosijldrj[0] = ((-rij[0]+rjl[0])/(rijmag*rjlmag)) +
+          (cosijl*((rij[0]/pow(rijmag,2.0))-(rjl[0]/(rjlmag*rjlmag))));
+        dcosijldrj[1] = ((-rij[1]+rjl[1])/(rijmag*rjlmag)) +
+          (cosijl*((rij[1]/pow(rijmag,2.0))-(rjl[1]/(rjlmag*rjlmag))));
+        dcosijldrj[2] = ((-rij[2]+rjl[2])/(rijmag*rjlmag)) +
+          (cosijl*((rij[2]/pow(rijmag,2.0))-(rjl[2]/(rjlmag*rjlmag))));
+        dcosijldrl[0] = (rij[0]/(rijmag*rjlmag)) +
+          (cosijl*rjl[0]/(rjlmag*rjlmag));
+        dcosijldrl[1] = (rij[1]/(rijmag*rjlmag)) +
+          (cosijl*rjl[1]/(rjlmag*rjlmag));
+        dcosijldrl[2] = (rij[2]/(rijmag*rjlmag)) +
+          (cosijl*rjl[2]/(rjlmag*rjlmag));
+
+        // evaluate splines g and derivatives dg
+
+        g = gSpline(cosijl,NjiC+NjiH,jtype,&dgdc,&dgdN);
+        tmp2 = VA*.5*(tmp*wjl*dgdc*exp(lamdaijl));
+        fi[0] = -tmp2*dcosijldri[0];
+        fi[1] = -tmp2*dcosijldri[1];
+        fi[2] = -tmp2*dcosijldri[2];
+        fj[0] = -tmp2*dcosijldrj[0];
+        fj[1] = -tmp2*dcosijldrj[1];
+        fj[2] = -tmp2*dcosijldrj[2];
+        fl[0] = -tmp2*dcosijldrl[0];
+        fl[1] = -tmp2*dcosijldrl[1];
+        fl[2] = -tmp2*dcosijldrl[2];
+
+        tmp2 = VA*.5*(tmp*wjl*g*exp(lamdaijl)*4.0*kronecker(jtype,1));
+        fi[0] -= tmp2*(rij[0]/rijmag);
+        fi[1] -= tmp2*(rij[1]/rijmag);
+        fi[2] -= tmp2*(rij[2]/rijmag);
+        fj[0] -= tmp2*((-rjl[0]/rjlmag)-(rij[0]/rijmag));
+        fj[1] -= tmp2*((-rjl[1]/rjlmag)-(rij[1]/rijmag));
+        fj[2] -= tmp2*((-rjl[2]/rjlmag)-(rij[2]/rijmag));
+        fl[0] -= tmp2*(rjl[0]/rjlmag);
+        fl[1] -= tmp2*(rjl[1]/rjlmag);
+        fl[2] -= tmp2*(rjl[2]/rjlmag);
+
+         // coordination forces
+        // dwik forces
+
+        tmp2 = VA*.5*(tmp*dwjl*g*exp(lamdaijl))/rjlmag;
+        fj[0] -= tmp2*rjl[0];
+        fj[1] -= tmp2*rjl[1];
+        fj[2] -= tmp2*rjl[2];
+        fl[0] += tmp2*rjl[0];
+        fl[1] += tmp2*rjl[1];
+        fl[2] += tmp2*rjl[2];
+
+        // PIJ forces
+
+        tmp2 = VA*.5*(tmp*dN2[ltype]*dwjl)/rjlmag;
+        fj[0] -= tmp2*rjl[0];
+        fj[1] -= tmp2*rjl[1];
+        fj[2] -= tmp2*rjl[2];
+        fl[0] += tmp2*rjl[0];
+        fl[1] += tmp2*rjl[1];
+        fl[2] += tmp2*rjl[2];
+
+        // dgdN forces
+
+        tmp2=VA*.5*(tmp*tmp3*dwjl)/rjlmag;
+        fj[0] -= tmp2*rjl[0];
+        fj[1] -= tmp2*rjl[1];
+        fj[2] -= tmp2*rjl[2];
+        fl[0] += tmp2*rjl[0];
+        fl[1] += tmp2*rjl[1];
+        fl[2] += tmp2*rjl[2];
+
+        f[atomi][0] += fi[0]; f[atomi][1] += fi[1]; f[atomi][2] += fi[2];
+        f[atomj][0] += fj[0]; f[atomj][1] += fj[1]; f[atomj][2] += fj[2];
+        f[atoml][0] += fl[0]; f[atoml][1] += fl[1]; f[atoml][2] += fl[2];
+
+        if (vflag_atom) {
+          rlj[0] = -rjl[0]; rlj[1] = -rjl[1]; rlj[2] = -rjl[2];
+          v_tally3(atomi,atomj,atoml,fi,fl,rij,rlj);
+        }
       }
-    }	
-    
+    }
+
     // piRC forces
 
     dN3[0] = dN3piRC[0];
@@ -2481,60 +2481,60 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
     for (k = 0; k < REBO_numneigh[i]; k++) {
       atomk = REBO_neighs_i[k];
       if (atomk != atomj) {
-	ktype = map[type[atomk]];
-	rik[0] = x[atomi][0]-x[atomk][0];
-	rik[1] = x[atomi][1]-x[atomk][1];
-	rik[2] = x[atomi][2]-x[atomk][2];
-	rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
-	wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-	Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
-	  (wik*kronecker(itype,1));
-	SpN = Sp(Nki,Nmin,Nmax,dNki);
-
-	tmp2 = VA*dN3[0]*dwik/rikmag;
-	f[atomi][0] -= tmp2*rik[0]; 
-	f[atomi][1] -= tmp2*rik[1]; 
-	f[atomi][2] -= tmp2*rik[2]; 
-	f[atomk][0] += tmp2*rik[0]; 
-	f[atomk][1] += tmp2*rik[1]; 
-	f[atomk][2] += tmp2*rik[2]; 
-
-	if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
-
-	tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)/rikmag;
-	f[atomi][0] -= tmp2*rik[0]; 
-	f[atomi][1] -= tmp2*rik[1]; 
-	f[atomi][2] -= tmp2*rik[2]; 
-	f[atomk][0] += tmp2*rik[0]; 
-	f[atomk][1] += tmp2*rik[1]; 
-	f[atomk][2] += tmp2*rik[2];
-
-	if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
-
-	if (fabs(dNki) > TOL) {
-	  REBO_neighs_k = REBO_firstneigh[atomk];
-	  for (n = 0; n < REBO_numneigh[atomk]; n++) {
-	    atomn = REBO_neighs_k[n];
-	    if (atomn != atomi) {
-	      ntype = map[type[atomn]];
-	      rkn[0] = x[atomk][0]-x[atomn][0];
-	      rkn[1] = x[atomk][1]-x[atomn][1];
-	      rkn[2] = x[atomk][2]-x[atomn][2];
-	      rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
-	      Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
-
-	      tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)/rknmag;
-	      f[atomk][0] -= tmp2*rkn[0]; 
-	      f[atomk][1] -= tmp2*rkn[1]; 
-	      f[atomk][2] -= tmp2*rkn[2]; 
-	      f[atomn][0] += tmp2*rkn[0]; 
-	      f[atomn][1] += tmp2*rkn[1]; 
-	      f[atomn][2] += tmp2*rkn[2];
-
-	      if (vflag_atom) v_tally2(atomk,atomn,-tmp2,rkn);
-	    }
-	  }
-	}
+        ktype = map[type[atomk]];
+        rik[0] = x[atomi][0]-x[atomk][0];
+        rik[1] = x[atomi][1]-x[atomk][1];
+        rik[2] = x[atomi][2]-x[atomk][2];
+        rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
+        wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
+        Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
+          (wik*kronecker(itype,1));
+        SpN = Sp(Nki,Nmin,Nmax,dNki);
+
+        tmp2 = VA*dN3[0]*dwik/rikmag;
+        f[atomi][0] -= tmp2*rik[0];
+        f[atomi][1] -= tmp2*rik[1];
+        f[atomi][2] -= tmp2*rik[2];
+        f[atomk][0] += tmp2*rik[0];
+        f[atomk][1] += tmp2*rik[1];
+        f[atomk][2] += tmp2*rik[2];
+
+        if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
+
+        tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)/rikmag;
+        f[atomi][0] -= tmp2*rik[0];
+        f[atomi][1] -= tmp2*rik[1];
+        f[atomi][2] -= tmp2*rik[2];
+        f[atomk][0] += tmp2*rik[0];
+        f[atomk][1] += tmp2*rik[1];
+        f[atomk][2] += tmp2*rik[2];
+
+        if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
+
+        if (fabs(dNki) > TOL) {
+          REBO_neighs_k = REBO_firstneigh[atomk];
+          for (n = 0; n < REBO_numneigh[atomk]; n++) {
+            atomn = REBO_neighs_k[n];
+            if (atomn != atomi) {
+              ntype = map[type[atomn]];
+              rkn[0] = x[atomk][0]-x[atomn][0];
+              rkn[1] = x[atomk][1]-x[atomn][1];
+              rkn[2] = x[atomk][2]-x[atomn][2];
+              rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
+              Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
+
+              tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)/rknmag;
+              f[atomk][0] -= tmp2*rkn[0];
+              f[atomk][1] -= tmp2*rkn[1];
+              f[atomk][2] -= tmp2*rkn[2];
+              f[atomn][0] += tmp2*rkn[0];
+              f[atomn][1] += tmp2*rkn[1];
+              f[atomn][2] += tmp2*rkn[2];
+
+              if (vflag_atom) v_tally2(atomk,atomn,-tmp2,rkn);
+            }
+          }
+        }
       }
     }
 
@@ -2544,60 +2544,60 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
     for (l = 0; l < REBO_numneigh[j]; l++) {
       atoml = REBO_neighs[l];
       if (atoml != atomi) {
-	ltype = map[type[atoml]];
-	rjl[0] = x[atomj][0]-x[atoml][0];
-	rjl[1] = x[atomj][1]-x[atoml][1];
-	rjl[2] = x[atomj][2]-x[atoml][2];
-	rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
-	wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
-	Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] - 
-	  (wjl*kronecker(jtype,1));
-	SpN = Sp(Nlj,Nmin,Nmax,dNlj);
-
-	tmp2 = VA*dN3[1]*dwjl/rjlmag;
-	f[atomj][0] -= tmp2*rjl[0]; 
-	f[atomj][1] -= tmp2*rjl[1]; 
-	f[atomj][2] -= tmp2*rjl[2];
-	f[atoml][0] += tmp2*rjl[0]; 
-	f[atoml][1] += tmp2*rjl[1]; 
-	f[atoml][2] += tmp2*rjl[2];
-
-	if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
-
-	tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)/rjlmag;
-	f[atomj][0] -= tmp2*rjl[0]; 
-	f[atomj][1] -= tmp2*rjl[1]; 
-	f[atomj][2] -= tmp2*rjl[2];
-	f[atoml][0] += tmp2*rjl[0]; 
-	f[atoml][1] += tmp2*rjl[1]; 
-	f[atoml][2] += tmp2*rjl[2];
-
-	if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
-
-	if (fabs(dNlj) > TOL) {
-	  REBO_neighs_l = REBO_firstneigh[atoml];
-	  for (n = 0; n < REBO_numneigh[atoml]; n++) {
-	    atomn = REBO_neighs_l[n];
-	    if (atomn != atomj) {
-	      ntype = map[type[atomn]];
-	      rln[0] = x[atoml][0]-x[atomn][0];
-	      rln[1] = x[atoml][1]-x[atomn][1];
-	      rln[2] = x[atoml][2]-x[atomn][2];
-	      rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
-	      Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
-
-	      tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)/rlnmag;
-	      f[atoml][0] -= tmp2*rln[0]; 
-	      f[atoml][1] -= tmp2*rln[1]; 
-	      f[atoml][2] -= tmp2*rln[2];
-	      f[atomn][0] += tmp2*rln[0]; 
-	      f[atomn][1] += tmp2*rln[1]; 
-	      f[atomn][2] += tmp2*rln[2];
-
-	      if (vflag_atom) v_tally2(atoml,atomn,-tmp2,rln);
-	    }
-	  }
-	}
+        ltype = map[type[atoml]];
+        rjl[0] = x[atomj][0]-x[atoml][0];
+        rjl[1] = x[atomj][1]-x[atoml][1];
+        rjl[2] = x[atomj][2]-x[atoml][2];
+        rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
+        wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
+        Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
+          (wjl*kronecker(jtype,1));
+        SpN = Sp(Nlj,Nmin,Nmax,dNlj);
+
+        tmp2 = VA*dN3[1]*dwjl/rjlmag;
+        f[atomj][0] -= tmp2*rjl[0];
+        f[atomj][1] -= tmp2*rjl[1];
+        f[atomj][2] -= tmp2*rjl[2];
+        f[atoml][0] += tmp2*rjl[0];
+        f[atoml][1] += tmp2*rjl[1];
+        f[atoml][2] += tmp2*rjl[2];
+
+        if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
+
+        tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)/rjlmag;
+        f[atomj][0] -= tmp2*rjl[0];
+        f[atomj][1] -= tmp2*rjl[1];
+        f[atomj][2] -= tmp2*rjl[2];
+        f[atoml][0] += tmp2*rjl[0];
+        f[atoml][1] += tmp2*rjl[1];
+        f[atoml][2] += tmp2*rjl[2];
+
+        if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
+
+        if (fabs(dNlj) > TOL) {
+          REBO_neighs_l = REBO_firstneigh[atoml];
+          for (n = 0; n < REBO_numneigh[atoml]; n++) {
+            atomn = REBO_neighs_l[n];
+            if (atomn != atomj) {
+              ntype = map[type[atomn]];
+              rln[0] = x[atoml][0]-x[atomn][0];
+              rln[1] = x[atoml][1]-x[atomn][1];
+              rln[2] = x[atoml][2]-x[atomn][2];
+              rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
+              Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
+
+              tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)/rlnmag;
+              f[atoml][0] -= tmp2*rln[0];
+              f[atoml][1] -= tmp2*rln[1];
+              f[atoml][2] -= tmp2*rln[2];
+              f[atomn][0] += tmp2*rln[0];
+              f[atomn][1] += tmp2*rln[1];
+              f[atomn][2] += tmp2*rln[2];
+
+              if (vflag_atom) v_tally2(atoml,atomn,-tmp2,rln);
+            }
+          }
+        }
       }
     }
 
@@ -2618,329 +2618,329 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
 
       REBO_neighs_i = REBO_firstneigh[i];
       for (k = 0; k < REBO_numneigh[i]; k++) {
-	atomk = REBO_neighs_i[k];
-	atom1 = atomk;
-	ktype = map[type[atomk]];
-	if (atomk != atomj) {
-	  r21[0] = x[atom2][0]-x[atom1][0];
-	  r21[1] = x[atom2][1]-x[atom1][1];
-	  r21[2] = x[atom2][2]-x[atom1][2];
-	  r21mag = sqrt(r21[0]*r21[0] + r21[1]*r21[1] + r21[2]*r21[2]);
-	  cos321 = ((r21[0]*rij[0])+(r21[1]*rij[1])+(r21[2]*rij[2])) / 
-	    (r21mag*rijmag);
-	  cos321 = MIN(cos321,1.0);
-	  cos321 = MAX(cos321,-1.0);
-	  sin321 = sqrt(1.0 - cos321*cos321);
-	  sink2i = 1.0/(sin321*sin321);
-	  rik2i = 1.0/(r21mag*r21mag);
-
-	  if (sin321 != 0.0) { 
-	    rr = (rijmag*rijmag)-(r21mag*r21mag);
-	    rjk[0] = r21[0]-rij[0];
-	    rjk[1] = r21[1]-rij[1];
-	    rjk[2] = r21[2]-rij[2];
-	    rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
-	    rijrik = 2.0*rijmag*r21mag;
-	    rik2 = r21mag*r21mag;
-	    dctik = (-rr+rjk2)/(rijrik*rik2);
-	    dctij = (rr+rjk2)/(rijrik*rijmag*rijmag);
-	    dctjk = -2.0/rijrik;
-	    w21 = Sp(r21mag,rcmin[itype][ktype],rcmaxp[itype][ktype],dw21);
-	    rikmag = r21mag; 
-	    rij2 = r32mag*r32mag;
-	    rik2 = r21mag*r21mag;
-	    costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
-	    tspjik = Sp2(costmp,thmin,thmax,dtsjik);
-	    dtsjik = -dtsjik;
- 
-	    REBO_neighs_j = REBO_firstneigh[j];
-	    for (l = 0; l < REBO_numneigh[j]; l++) {
-	      atoml = REBO_neighs_j[l];
-	      atom4 = atoml;
-	      ltype = map[type[atoml]];
-	      if (!(atoml == atomi || atoml == atomk)) {
-		r34[0] = x[atom3][0]-x[atom4][0];
-		r34[1] = x[atom3][1]-x[atom4][1];
-		r34[2] = x[atom3][2]-x[atom4][2];
-		r34mag = sqrt(r34[0]*r34[0] + r34[1]*r34[1] + r34[2]*r34[2]);
-		cos234 = -1.0*((rij[0]*r34[0])+(rij[1]*r34[1]) + 
-			       (rij[2]*r34[2]))/(rijmag*r34mag);
-		cos234 = MIN(cos234,1.0);
-		cos234 = MAX(cos234,-1.0);
-		sin234 = sqrt(1.0 - cos234*cos234);
-		sinl2i = 1.0/(sin234*sin234);
-		rjl2i = 1.0/(r34mag*r34mag);
-
-		if (sin234 != 0.0) {
-		  w34 = Sp(r34mag,rcmin[jtype][ltype],
-			   rcmaxp[jtype][ltype],dw34);
-		  rr = (r23mag*r23mag)-(r34mag*r34mag);
-		  ril[0] = r23[0]+r34[0];
-		  ril[1] = r23[1]+r34[1];
-		  ril[2] = r23[2]+r34[2];
-		  ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
-		  rijrjl = 2.0*r23mag*r34mag;
-		  rjl2 = r34mag*r34mag;
-		  dctjl = (-rr+ril2)/(rijrjl*rjl2);
-		  dctji = (rr+ril2)/(rijrjl*r23mag*r23mag);
-		  dctil = -2.0/rijrjl;
-		  rjlmag = r34mag;
-		  rjl2 = r34mag*r34mag;
-		  costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
-		  tspijl = Sp2(costmp,thmin,thmax,dtsijl);
-		  dtsijl = -dtsijl; //need minus sign
-		  prefactor = VA*Tij;
-
-		  cross321[0] = (r32[1]*r21[2])-(r32[2]*r21[1]);
-		  cross321[1] = (r32[2]*r21[0])-(r32[0]*r21[2]);
-		  cross321[2] = (r32[0]*r21[1])-(r32[1]*r21[0]);
-		  cross234[0] = (r23[1]*r34[2])-(r23[2]*r34[1]);
-		  cross234[1] = (r23[2]*r34[0])-(r23[0]*r34[2]);
-		  cross234[2] = (r23[0]*r34[1])-(r23[1]*r34[0]);
-
-		  cwnum = (cross321[0]*cross234[0]) + 
-		    (cross321[1]*cross234[1])+(cross321[2]*cross234[2]);
-		  cwnom = r21mag*r34mag*r23mag*r23mag*sin321*sin234;
-		  om1234 = cwnum/cwnom;
-		  cw = om1234;
-		  Etmp += ((1.0-pow(om1234,2.0))*w21*w34) * 
-		    (1.0-tspjik)*(1.0-tspijl);
-		  
-		  dt1dik = (rik2i)-(dctik*sink2i*cos321);
-		  dt1djk = (-dctjk*sink2i*cos321);
-		  dt1djl = (rjl2i)-(dctjl*sinl2i*cos234);
-		  dt1dil = (-dctil*sinl2i*cos234);
-		  dt1dij = (2.0/(r23mag*r23mag)) - 
-		    (dctij*sink2i*cos321)-(dctji*sinl2i*cos234);
-		  
-		  dt2dik[0] = (-r23[2]*cross234[1])+(r23[1]*cross234[2]);
-		  dt2dik[1] = (-r23[0]*cross234[2])+(r23[2]*cross234[0]);
-		  dt2dik[2] = (-r23[1]*cross234[0])+(r23[0]*cross234[1]);
-		  
-		  dt2djl[0] = (-r23[1]*cross321[2])+(r23[2]*cross321[1]);
-		  dt2djl[1] = (-r23[2]*cross321[0])+(r23[0]*cross321[2]);
-		  dt2djl[2] = (-r23[0]*cross321[1])+(r23[1]*cross321[0]);
-		  
-		  dt2dij[0] = (r21[2]*cross234[1]) - 
-		    (r34[2]*cross321[1])-(r21[1]*cross234[2]) + 
-		    (r34[1]*cross321[2]);
-		  dt2dij[1] = (r21[0]*cross234[2]) - 
-		    (r34[0]*cross321[2])-(r21[2]*cross234[0]) + 
-		    (r34[2]*cross321[0]);
-		  dt2dij[2] = (r21[1]*cross234[0]) -
-		    (r34[1]*cross321[0])-(r21[0]*cross234[1]) + 
-		    (r34[0]*cross321[1]);
-		  
-		  aa = (prefactor*2.0*cw/cwnom)*w21*w34 * 
-		    (1.0-tspjik)*(1.0-tspijl);
-		  aaa1 = -prefactor*(1.0-pow(om1234,2.0)) * 
-		    (1.0-tspjik)*(1.0-tspijl);
-		  aaa2 = aaa1*w21*w34;
-		  at2 = aa*cwnum;
-		  
-		  fcijpc = (-dt1dij*at2)+(aaa2*dtsjik*dctij*(1.0-tspijl)) + 
-		    (aaa2*dtsijl*dctji*(1.0-tspjik));
-		  fcikpc = (-dt1dik*at2)+(aaa2*dtsjik*dctik*(1.0-tspijl));
-		  fcjlpc = (-dt1djl*at2)+(aaa2*dtsijl*dctjl*(1.0-tspjik));
-		  fcjkpc = (-dt1djk*at2)+(aaa2*dtsjik*dctjk*(1.0-tspijl));
-		  fcilpc = (-dt1dil*at2)+(aaa2*dtsijl*dctil*(1.0-tspjik));
-		  
-		  F23[0] = (fcijpc*r23[0])+(aa*dt2dij[0]);
-		  F23[1] = (fcijpc*r23[1])+(aa*dt2dij[1]);
-		  F23[2] = (fcijpc*r23[2])+(aa*dt2dij[2]);
-		  
-		  F12[0] = (fcikpc*r21[0])+(aa*dt2dik[0]);
-		  F12[1] = (fcikpc*r21[1])+(aa*dt2dik[1]);
-		  F12[2] = (fcikpc*r21[2])+(aa*dt2dik[2]);
-		  
-		  F34[0] = (fcjlpc*r34[0])+(aa*dt2djl[0]);
-		  F34[1] = (fcjlpc*r34[1])+(aa*dt2djl[1]);
-		  F34[2] = (fcjlpc*r34[2])+(aa*dt2djl[2]);
-		  
-		  F31[0] = (fcjkpc*rjk[0]);
-		  F31[1] = (fcjkpc*rjk[1]);
-		  F31[2] = (fcjkpc*rjk[2]);
-		  
-		  F24[0] = (fcilpc*ril[0]);
-		  F24[1] = (fcilpc*ril[1]);
-		  F24[2] = (fcilpc*ril[2]);
-		  
-		  f1[0] = -F12[0]-F31[0];
-		  f1[1] = -F12[1]-F31[1];
-		  f1[2] = -F12[2]-F31[2];
-		  f2[0] = F23[0]+F12[0]+F24[0];
-		  f2[1] = F23[1]+F12[1]+F24[1];
-		  f2[2] = F23[2]+F12[2]+F24[2];
-		  f3[0] = -F23[0]+F34[0]+F31[0];
-		  f3[1] = -F23[1]+F34[1]+F31[1];
-		  f3[2] = -F23[2]+F34[2]+F31[2];
-		  f4[0] = -F34[0]-F24[0];
-		  f4[1] = -F34[1]-F24[1];
-		  f4[2] = -F34[2]-F24[2];
-		  
-		  // coordination forces
-
-		  tmp2 = VA*Tij*((1.0-(om1234*om1234))) * 
-		    (1.0-tspjik)*(1.0-tspijl)*dw21*w34/r21mag;
-		  f2[0] -= tmp2*r21[0];
-		  f2[1] -= tmp2*r21[1];
-		  f2[2] -= tmp2*r21[2];
-		  f1[0] += tmp2*r21[0];
-		  f1[1] += tmp2*r21[1];
-		  f1[2] += tmp2*r21[2];
-		  
-		  tmp2 = VA*Tij*((1.0-(om1234*om1234))) * 
-		    (1.0-tspjik)*(1.0-tspijl)*w21*dw34/r34mag;
-		  f3[0] -= tmp2*r34[0];
-		  f3[1] -= tmp2*r34[1];
-		  f3[2] -= tmp2*r34[2];
-		  f4[0] += tmp2*r34[0];
-		  f4[1] += tmp2*r34[1];  
-		  f4[2] += tmp2*r34[2]; 
-
-		  f[atom1][0] += f1[0]; f[atom1][1] += f1[1];
-		  f[atom1][2] += f1[2];
-		  f[atom2][0] += f2[0]; f[atom2][1] += f2[1];
-		  f[atom2][2] += f2[2];
-		  f[atom3][0] += f3[0]; f[atom3][1] += f3[1];
-		  f[atom3][2] += f3[2];
-		  f[atom4][0] += f4[0]; f[atom4][1] += f4[1];
-		  f[atom4][2] += f4[2];
-		  
-		  if (vflag_atom) {
-		    r13[0] = -rjk[0]; r13[1] = -rjk[1]; r13[2] = -rjk[2];
-		    r43[0] = -r34[0]; r43[1] = -r34[1]; r43[2] = -r34[2];
-		    v_tally4(atom1,atom2,atom3,atom4,f1,f2,f4,r13,r23,r43);
-		  }
-		}
-	      }
-	    }
-	  }
-	}
+        atomk = REBO_neighs_i[k];
+        atom1 = atomk;
+        ktype = map[type[atomk]];
+        if (atomk != atomj) {
+          r21[0] = x[atom2][0]-x[atom1][0];
+          r21[1] = x[atom2][1]-x[atom1][1];
+          r21[2] = x[atom2][2]-x[atom1][2];
+          r21mag = sqrt(r21[0]*r21[0] + r21[1]*r21[1] + r21[2]*r21[2]);
+          cos321 = ((r21[0]*rij[0])+(r21[1]*rij[1])+(r21[2]*rij[2])) /
+            (r21mag*rijmag);
+          cos321 = MIN(cos321,1.0);
+          cos321 = MAX(cos321,-1.0);
+          sin321 = sqrt(1.0 - cos321*cos321);
+          sink2i = 1.0/(sin321*sin321);
+          rik2i = 1.0/(r21mag*r21mag);
+
+          if (sin321 != 0.0) {
+            rr = (rijmag*rijmag)-(r21mag*r21mag);
+            rjk[0] = r21[0]-rij[0];
+            rjk[1] = r21[1]-rij[1];
+            rjk[2] = r21[2]-rij[2];
+            rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
+            rijrik = 2.0*rijmag*r21mag;
+            rik2 = r21mag*r21mag;
+            dctik = (-rr+rjk2)/(rijrik*rik2);
+            dctij = (rr+rjk2)/(rijrik*rijmag*rijmag);
+            dctjk = -2.0/rijrik;
+            w21 = Sp(r21mag,rcmin[itype][ktype],rcmaxp[itype][ktype],dw21);
+            rikmag = r21mag;
+            rij2 = r32mag*r32mag;
+            rik2 = r21mag*r21mag;
+            costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
+            tspjik = Sp2(costmp,thmin,thmax,dtsjik);
+            dtsjik = -dtsjik;
+
+            REBO_neighs_j = REBO_firstneigh[j];
+            for (l = 0; l < REBO_numneigh[j]; l++) {
+              atoml = REBO_neighs_j[l];
+              atom4 = atoml;
+              ltype = map[type[atoml]];
+              if (!(atoml == atomi || atoml == atomk)) {
+                r34[0] = x[atom3][0]-x[atom4][0];
+                r34[1] = x[atom3][1]-x[atom4][1];
+                r34[2] = x[atom3][2]-x[atom4][2];
+                r34mag = sqrt(r34[0]*r34[0] + r34[1]*r34[1] + r34[2]*r34[2]);
+                cos234 = -1.0*((rij[0]*r34[0])+(rij[1]*r34[1]) +
+                               (rij[2]*r34[2]))/(rijmag*r34mag);
+                cos234 = MIN(cos234,1.0);
+                cos234 = MAX(cos234,-1.0);
+                sin234 = sqrt(1.0 - cos234*cos234);
+                sinl2i = 1.0/(sin234*sin234);
+                rjl2i = 1.0/(r34mag*r34mag);
+
+                if (sin234 != 0.0) {
+                  w34 = Sp(r34mag,rcmin[jtype][ltype],
+                           rcmaxp[jtype][ltype],dw34);
+                  rr = (r23mag*r23mag)-(r34mag*r34mag);
+                  ril[0] = r23[0]+r34[0];
+                  ril[1] = r23[1]+r34[1];
+                  ril[2] = r23[2]+r34[2];
+                  ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
+                  rijrjl = 2.0*r23mag*r34mag;
+                  rjl2 = r34mag*r34mag;
+                  dctjl = (-rr+ril2)/(rijrjl*rjl2);
+                  dctji = (rr+ril2)/(rijrjl*r23mag*r23mag);
+                  dctil = -2.0/rijrjl;
+                  rjlmag = r34mag;
+                  rjl2 = r34mag*r34mag;
+                  costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
+                  tspijl = Sp2(costmp,thmin,thmax,dtsijl);
+                  dtsijl = -dtsijl; //need minus sign
+                  prefactor = VA*Tij;
+
+                  cross321[0] = (r32[1]*r21[2])-(r32[2]*r21[1]);
+                  cross321[1] = (r32[2]*r21[0])-(r32[0]*r21[2]);
+                  cross321[2] = (r32[0]*r21[1])-(r32[1]*r21[0]);
+                  cross234[0] = (r23[1]*r34[2])-(r23[2]*r34[1]);
+                  cross234[1] = (r23[2]*r34[0])-(r23[0]*r34[2]);
+                  cross234[2] = (r23[0]*r34[1])-(r23[1]*r34[0]);
+
+                  cwnum = (cross321[0]*cross234[0]) +
+                    (cross321[1]*cross234[1])+(cross321[2]*cross234[2]);
+                  cwnom = r21mag*r34mag*r23mag*r23mag*sin321*sin234;
+                  om1234 = cwnum/cwnom;
+                  cw = om1234;
+                  Etmp += ((1.0-pow(om1234,2.0))*w21*w34) *
+                    (1.0-tspjik)*(1.0-tspijl);
+
+                  dt1dik = (rik2i)-(dctik*sink2i*cos321);
+                  dt1djk = (-dctjk*sink2i*cos321);
+                  dt1djl = (rjl2i)-(dctjl*sinl2i*cos234);
+                  dt1dil = (-dctil*sinl2i*cos234);
+                  dt1dij = (2.0/(r23mag*r23mag)) -
+                    (dctij*sink2i*cos321)-(dctji*sinl2i*cos234);
+
+                  dt2dik[0] = (-r23[2]*cross234[1])+(r23[1]*cross234[2]);
+                  dt2dik[1] = (-r23[0]*cross234[2])+(r23[2]*cross234[0]);
+                  dt2dik[2] = (-r23[1]*cross234[0])+(r23[0]*cross234[1]);
+
+                  dt2djl[0] = (-r23[1]*cross321[2])+(r23[2]*cross321[1]);
+                  dt2djl[1] = (-r23[2]*cross321[0])+(r23[0]*cross321[2]);
+                  dt2djl[2] = (-r23[0]*cross321[1])+(r23[1]*cross321[0]);
+
+                  dt2dij[0] = (r21[2]*cross234[1]) -
+                    (r34[2]*cross321[1])-(r21[1]*cross234[2]) +
+                    (r34[1]*cross321[2]);
+                  dt2dij[1] = (r21[0]*cross234[2]) -
+                    (r34[0]*cross321[2])-(r21[2]*cross234[0]) +
+                    (r34[2]*cross321[0]);
+                  dt2dij[2] = (r21[1]*cross234[0]) -
+                    (r34[1]*cross321[0])-(r21[0]*cross234[1]) +
+                    (r34[0]*cross321[1]);
+
+                  aa = (prefactor*2.0*cw/cwnom)*w21*w34 *
+                    (1.0-tspjik)*(1.0-tspijl);
+                  aaa1 = -prefactor*(1.0-pow(om1234,2.0)) *
+                    (1.0-tspjik)*(1.0-tspijl);
+                  aaa2 = aaa1*w21*w34;
+                  at2 = aa*cwnum;
+
+                  fcijpc = (-dt1dij*at2)+(aaa2*dtsjik*dctij*(1.0-tspijl)) +
+                    (aaa2*dtsijl*dctji*(1.0-tspjik));
+                  fcikpc = (-dt1dik*at2)+(aaa2*dtsjik*dctik*(1.0-tspijl));
+                  fcjlpc = (-dt1djl*at2)+(aaa2*dtsijl*dctjl*(1.0-tspjik));
+                  fcjkpc = (-dt1djk*at2)+(aaa2*dtsjik*dctjk*(1.0-tspijl));
+                  fcilpc = (-dt1dil*at2)+(aaa2*dtsijl*dctil*(1.0-tspjik));
+
+                  F23[0] = (fcijpc*r23[0])+(aa*dt2dij[0]);
+                  F23[1] = (fcijpc*r23[1])+(aa*dt2dij[1]);
+                  F23[2] = (fcijpc*r23[2])+(aa*dt2dij[2]);
+
+                  F12[0] = (fcikpc*r21[0])+(aa*dt2dik[0]);
+                  F12[1] = (fcikpc*r21[1])+(aa*dt2dik[1]);
+                  F12[2] = (fcikpc*r21[2])+(aa*dt2dik[2]);
+
+                  F34[0] = (fcjlpc*r34[0])+(aa*dt2djl[0]);
+                  F34[1] = (fcjlpc*r34[1])+(aa*dt2djl[1]);
+                  F34[2] = (fcjlpc*r34[2])+(aa*dt2djl[2]);
+
+                  F31[0] = (fcjkpc*rjk[0]);
+                  F31[1] = (fcjkpc*rjk[1]);
+                  F31[2] = (fcjkpc*rjk[2]);
+
+                  F24[0] = (fcilpc*ril[0]);
+                  F24[1] = (fcilpc*ril[1]);
+                  F24[2] = (fcilpc*ril[2]);
+
+                  f1[0] = -F12[0]-F31[0];
+                  f1[1] = -F12[1]-F31[1];
+                  f1[2] = -F12[2]-F31[2];
+                  f2[0] = F23[0]+F12[0]+F24[0];
+                  f2[1] = F23[1]+F12[1]+F24[1];
+                  f2[2] = F23[2]+F12[2]+F24[2];
+                  f3[0] = -F23[0]+F34[0]+F31[0];
+                  f3[1] = -F23[1]+F34[1]+F31[1];
+                  f3[2] = -F23[2]+F34[2]+F31[2];
+                  f4[0] = -F34[0]-F24[0];
+                  f4[1] = -F34[1]-F24[1];
+                  f4[2] = -F34[2]-F24[2];
+
+                  // coordination forces
+
+                  tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
+                    (1.0-tspjik)*(1.0-tspijl)*dw21*w34/r21mag;
+                  f2[0] -= tmp2*r21[0];
+                  f2[1] -= tmp2*r21[1];
+                  f2[2] -= tmp2*r21[2];
+                  f1[0] += tmp2*r21[0];
+                  f1[1] += tmp2*r21[1];
+                  f1[2] += tmp2*r21[2];
+
+                  tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
+                    (1.0-tspjik)*(1.0-tspijl)*w21*dw34/r34mag;
+                  f3[0] -= tmp2*r34[0];
+                  f3[1] -= tmp2*r34[1];
+                  f3[2] -= tmp2*r34[2];
+                  f4[0] += tmp2*r34[0];
+                  f4[1] += tmp2*r34[1];
+                  f4[2] += tmp2*r34[2];
+
+                  f[atom1][0] += f1[0]; f[atom1][1] += f1[1];
+                  f[atom1][2] += f1[2];
+                  f[atom2][0] += f2[0]; f[atom2][1] += f2[1];
+                  f[atom2][2] += f2[2];
+                  f[atom3][0] += f3[0]; f[atom3][1] += f3[1];
+                  f[atom3][2] += f3[2];
+                  f[atom4][0] += f4[0]; f[atom4][1] += f4[1];
+                  f[atom4][2] += f4[2];
+
+                  if (vflag_atom) {
+                    r13[0] = -rjk[0]; r13[1] = -rjk[1]; r13[2] = -rjk[2];
+                    r43[0] = -r34[0]; r43[1] = -r34[1]; r43[2] = -r34[2];
+                    v_tally4(atom1,atom2,atom3,atom4,f1,f2,f4,r13,r23,r43);
+                  }
+                }
+              }
+            }
+          }
+        }
       }
-      
+
       REBO_neighs = REBO_firstneigh[i];
       for (k = 0; k < REBO_numneigh[i]; k++) {
-	atomk = REBO_neighs[k];
-	if (atomk != atomj) {
-	  ktype = map[type[atomk]];
-	  rik[0] = x[atomi][0]-x[atomk][0];
-	  rik[1] = x[atomi][1]-x[atomk][1];
-	  rik[2] = x[atomi][2]-x[atomk][2];
-	  rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
-	  wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-	  Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] - 
-	    (wik*kronecker(itype,1));
-	  SpN = Sp(Nki,Nmin,Nmax,dNki);
-
-	  tmp2 = VA*dN3[0]*dwik*Etmp/rikmag;
-	  f[atomi][0] -= tmp2*rik[0]; 
-	  f[atomi][1] -= tmp2*rik[1]; 
-	  f[atomi][2] -= tmp2*rik[2]; 
-	  f[atomk][0] += tmp2*rik[0]; 
-	  f[atomk][1] += tmp2*rik[1]; 
-	  f[atomk][2] += tmp2*rik[2]; 
-
-	  if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
-
-	  tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)*Etmp/rikmag;
-	  f[atomi][0] -= tmp2*rik[0]; 
-	  f[atomi][1] -= tmp2*rik[1]; 
-	  f[atomi][2] -= tmp2*rik[2]; 
-	  f[atomk][0] += tmp2*rik[0]; 
-	  f[atomk][1] += tmp2*rik[1]; 
-	  f[atomk][2] += tmp2*rik[2]; 
-
-	  if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
-
-	  if (fabs(dNki) > TOL) {
-	    REBO_neighs_k = REBO_firstneigh[atomk];
-	    for (n = 0; n < REBO_numneigh[atomk]; n++) {
-	      atomn = REBO_neighs_k[n];
-	      ntype = map[type[atomn]];
-	      if (atomn !=atomi) {
-		rkn[0] = x[atomk][0]-x[atomn][0];
-		rkn[1] = x[atomk][1]-x[atomn][1];
-		rkn[2] = x[atomk][2]-x[atomn][2];
-		rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
-		Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
-
-		tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)*Etmp/rknmag;
-		f[atomk][0] -= tmp2*rkn[0]; 
-		f[atomk][1] -= tmp2*rkn[1]; 
-		f[atomk][2] -= tmp2*rkn[2]; 
-		f[atomn][0] += tmp2*rkn[0]; 
-		f[atomn][1] += tmp2*rkn[1]; 
-		f[atomn][2] += tmp2*rkn[2]; 
-
-		if (vflag_atom) v_tally2(atomk,atomn,-tmp2,rkn);
-	      }
-	    }
-	  }
-	}
+        atomk = REBO_neighs[k];
+        if (atomk != atomj) {
+          ktype = map[type[atomk]];
+          rik[0] = x[atomi][0]-x[atomk][0];
+          rik[1] = x[atomi][1]-x[atomk][1];
+          rik[2] = x[atomi][2]-x[atomk][2];
+          rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
+          wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
+          Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
+            (wik*kronecker(itype,1));
+          SpN = Sp(Nki,Nmin,Nmax,dNki);
+
+          tmp2 = VA*dN3[0]*dwik*Etmp/rikmag;
+          f[atomi][0] -= tmp2*rik[0];
+          f[atomi][1] -= tmp2*rik[1];
+          f[atomi][2] -= tmp2*rik[2];
+          f[atomk][0] += tmp2*rik[0];
+          f[atomk][1] += tmp2*rik[1];
+          f[atomk][2] += tmp2*rik[2];
+
+          if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
+
+          tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)*Etmp/rikmag;
+          f[atomi][0] -= tmp2*rik[0];
+          f[atomi][1] -= tmp2*rik[1];
+          f[atomi][2] -= tmp2*rik[2];
+          f[atomk][0] += tmp2*rik[0];
+          f[atomk][1] += tmp2*rik[1];
+          f[atomk][2] += tmp2*rik[2];
+
+          if (vflag_atom) v_tally2(atomi,atomk,-tmp2,rik);
+
+          if (fabs(dNki) > TOL) {
+            REBO_neighs_k = REBO_firstneigh[atomk];
+            for (n = 0; n < REBO_numneigh[atomk]; n++) {
+              atomn = REBO_neighs_k[n];
+              ntype = map[type[atomn]];
+              if (atomn !=atomi) {
+                rkn[0] = x[atomk][0]-x[atomn][0];
+                rkn[1] = x[atomk][1]-x[atomn][1];
+                rkn[2] = x[atomk][2]-x[atomn][2];
+                rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
+                Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
+
+                tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)*Etmp/rknmag;
+                f[atomk][0] -= tmp2*rkn[0];
+                f[atomk][1] -= tmp2*rkn[1];
+                f[atomk][2] -= tmp2*rkn[2];
+                f[atomn][0] += tmp2*rkn[0];
+                f[atomn][1] += tmp2*rkn[1];
+                f[atomn][2] += tmp2*rkn[2];
+
+                if (vflag_atom) v_tally2(atomk,atomn,-tmp2,rkn);
+              }
+            }
+          }
+        }
       }
 
       // Tij forces
 
       REBO_neighs = REBO_firstneigh[j];
       for (l = 0; l < REBO_numneigh[j]; l++) {
-	atoml = REBO_neighs[l];
-	if (atoml != atomi) {
-	  ltype = map[type[atoml]];
-	  rjl[0] = x[atomj][0]-x[atoml][0];
-	  rjl[1] = x[atomj][1]-x[atoml][1];
-	  rjl[2] = x[atomj][2]-x[atoml][2];
-	  rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
-	  wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
-	  Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] - 
-	    (wjl*kronecker(jtype,1));
-	  SpN = Sp(Nlj,Nmin,Nmax,dNlj);
-
-	  tmp2 = VA*dN3[1]*dwjl*Etmp/rjlmag;
-	  f[atomj][0] -= tmp2*rjl[0]; 
-	  f[atomj][1] -= tmp2*rjl[1]; 
-	  f[atomj][2] -= tmp2*rjl[2]; 
-	  f[atoml][0] += tmp2*rjl[0]; 
-	  f[atoml][1] += tmp2*rjl[1]; 
-	  f[atoml][2] += tmp2*rjl[2]; 
-
-	  if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
-
-	  tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)*Etmp/rjlmag;
-	  f[atomj][0] -= tmp2*rjl[0]; 
-	  f[atomj][1] -= tmp2*rjl[1]; 
-	  f[atomj][2] -= tmp2*rjl[2]; 
-	  f[atoml][0] += tmp2*rjl[0]; 
-	  f[atoml][1] += tmp2*rjl[1]; 
-	  f[atoml][2] += tmp2*rjl[2]; 
-
-	  if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
-
-	  if (fabs(dNlj) > TOL) {
-	    REBO_neighs_l = REBO_firstneigh[atoml];
-	    for (n = 0; n < REBO_numneigh[atoml]; n++) {
-	      atomn = REBO_neighs_l[n];
-	      ntype = map[type[atomn]];
-	      if (atomn != atomj) {
-		rln[0] = x[atoml][0]-x[atomn][0];
-		rln[1] = x[atoml][1]-x[atomn][1];
-		rln[2] = x[atoml][2]-x[atomn][2];
-		rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
-		Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
-
-		tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)*Etmp/rlnmag;
-		f[atoml][0] -= tmp2*rln[0];
-		f[atoml][1] -= tmp2*rln[1];
-		f[atoml][2] -= tmp2*rln[2];
-		f[atomn][0] += tmp2*rln[0];
-		f[atomn][1] += tmp2*rln[1];
-		f[atomn][2] += tmp2*rln[2];
-
-		if (vflag_atom) v_tally2(atoml,atomn,-tmp2,rln);
-	      }
-	    }
-	  }
-	}
+        atoml = REBO_neighs[l];
+        if (atoml != atomi) {
+          ltype = map[type[atoml]];
+          rjl[0] = x[atomj][0]-x[atoml][0];
+          rjl[1] = x[atomj][1]-x[atoml][1];
+          rjl[2] = x[atomj][2]-x[atoml][2];
+          rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
+          wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
+          Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
+            (wjl*kronecker(jtype,1));
+          SpN = Sp(Nlj,Nmin,Nmax,dNlj);
+
+          tmp2 = VA*dN3[1]*dwjl*Etmp/rjlmag;
+          f[atomj][0] -= tmp2*rjl[0];
+          f[atomj][1] -= tmp2*rjl[1];
+          f[atomj][2] -= tmp2*rjl[2];
+          f[atoml][0] += tmp2*rjl[0];
+          f[atoml][1] += tmp2*rjl[1];
+          f[atoml][2] += tmp2*rjl[2];
+
+          if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
+
+          tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)*Etmp/rjlmag;
+          f[atomj][0] -= tmp2*rjl[0];
+          f[atomj][1] -= tmp2*rjl[1];
+          f[atomj][2] -= tmp2*rjl[2];
+          f[atoml][0] += tmp2*rjl[0];
+          f[atoml][1] += tmp2*rjl[1];
+          f[atoml][2] += tmp2*rjl[2];
+
+          if (vflag_atom) v_tally2(atomj,atoml,-tmp2,rjl);
+
+          if (fabs(dNlj) > TOL) {
+            REBO_neighs_l = REBO_firstneigh[atoml];
+            for (n = 0; n < REBO_numneigh[atoml]; n++) {
+              atomn = REBO_neighs_l[n];
+              ntype = map[type[atomn]];
+              if (atomn != atomj) {
+                rln[0] = x[atoml][0]-x[atomn][0];
+                rln[1] = x[atoml][1]-x[atomn][1];
+                rln[2] = x[atoml][2]-x[atomn][2];
+                rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
+                Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
+
+                tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)*Etmp/rlnmag;
+                f[atoml][0] -= tmp2*rln[0];
+                f[atoml][1] -= tmp2*rln[1];
+                f[atoml][2] -= tmp2*rln[2];
+                f[atomn][0] += tmp2*rln[0];
+                f[atomn][1] += tmp2*rln[1];
+                f[atomn][2] += tmp2*rln[2];
+
+                if (vflag_atom) v_tally2(atoml,atomn,-tmp2,rln);
+              }
+            }
+          }
+        }
       }
     }
   }
@@ -2953,7 +2953,7 @@ double PairAIREBO::bondorderLJ(int i, int j, double rij[3], double rijmag,
 ------------------------------------------------------------------------- */
 
 double PairAIREBO::gSpline(double costh, double Nij, int typei,
-			   double *dgdc, double *dgdN)
+                           double *dgdc, double *dgdN)
 {
   double coeffs[6],dS,g1,g2,dg1,dg2,cut,g;
   int i,j;
@@ -2975,9 +2975,9 @@ double PairAIREBO::gSpline(double costh, double Nij, int typei,
     if (costh > gCdom[4]) costh = gCdom[4];
     if (Nij >= NCmax) {
       for (i = 0; i < 4; i++) {
-	if (costh >= gCdom[i] && costh <= gCdom[i+1]) {
-	  for (j = 0; j < 6; j++) coeffs[j] = gC2[i][j];
-	}
+        if (costh >= gCdom[i] && costh <= gCdom[i+1]) {
+          for (j = 0; j < 6; j++) coeffs[j] = gC2[i][j];
+        }
       }
       g2 = Sp5th(costh,coeffs,&dg2);
       g = g2;
@@ -2986,9 +2986,9 @@ double PairAIREBO::gSpline(double costh, double Nij, int typei,
     }
     if (Nij <= NCmin) {
       for (i = 0; i < 4; i++) {
-	if (costh >= gCdom[i] && costh <= gCdom[i+1]) {
-	  for (j = 0; j < 6; j++) coeffs[j] = gC1[i][j];
-	}
+        if (costh >= gCdom[i] && costh <= gCdom[i+1]) {
+          for (j = 0; j < 6; j++) coeffs[j] = gC1[i][j];
+        }
       }
       g1 = Sp5th(costh,coeffs,&dg1);
       g = g1;
@@ -2997,15 +2997,15 @@ double PairAIREBO::gSpline(double costh, double Nij, int typei,
     }
     if (Nij > NCmin && Nij < NCmax) {
       for (i = 0; i < 4; i++) {
-	if (costh >= gCdom[i] && costh <= gCdom[i+1]) {
-	  for (j = 0; j < 6; j++) coeffs[j] = gC1[i][j];
-	}
+        if (costh >= gCdom[i] && costh <= gCdom[i+1]) {
+          for (j = 0; j < 6; j++) coeffs[j] = gC1[i][j];
+        }
       }
       g1 = Sp5th(costh,coeffs,&dg1);
       for (i = 0; i < 4; i++) {
-	if (costh >= gCdom[i] && costh <= gCdom[i+1]) {
-	  for (j = 0; j < 6; j++) coeffs[j] = gC2[i][j];
-	}
+        if (costh >= gCdom[i] && costh <= gCdom[i+1]) {
+          for (j = 0; j < 6; j++) coeffs[j] = gC2[i][j];
+        }
       }
       g2 = Sp5th(costh,coeffs,&dg2);
       cut = Sp(Nij,NCmin,NCmax,dS);
@@ -3014,7 +3014,7 @@ double PairAIREBO::gSpline(double costh, double Nij, int typei,
       *dgdN = dS*(g1-g2);
     }
   }
-  
+
   // central atom is Hydrogen
 
   if (typei == 1) {
@@ -3022,7 +3022,7 @@ double PairAIREBO::gSpline(double costh, double Nij, int typei,
     if (costh > gHdom[3]) costh = gHdom[3];
     for (i = 0; i < 3; i++) {
       if (costh >= gHdom[i] && costh <= gHdom[i+1]) {
-	for (j = 0; j < 6; j++) coeffs[j] = gH[i][j];
+        for (j = 0; j < 6; j++) coeffs[j] = gH[i][j];
       }
     }
     g = Sp5th(costh,coeffs,&dg1);
@@ -3038,11 +3038,11 @@ double PairAIREBO::gSpline(double costh, double Nij, int typei,
 ------------------------------------------------------------------------- */
 
 double PairAIREBO::PijSpline(double NijC, double NijH, int typei, int typej,
-			     double dN2[2])
+                             double dN2[2])
 {
   int x,y,i,done;
   double Pij,coeffs[16];
-  
+
   for (i = 0; i < 16; i++) coeffs[i]=0.0;
 
   x = 0;
@@ -3074,13 +3074,13 @@ double PairAIREBO::PijSpline(double NijC, double NijH, int typei, int typej,
   }
 
   // if inputs are out of bounds set them back to a point in bounds
-  
+
    if (typei == 0 && typej == 1){
      if (NijC < pCHdom[0][0]) NijC=pCHdom[0][0];
      if (NijC > pCHdom[0][1]) NijC=pCHdom[0][1];
       if (NijH < pCHdom[1][0]) NijH=pCHdom[1][0];
       if (NijH > pCHdom[1][1]) NijH=pCHdom[1][1];
- 
+
     if (fabs(NijC-floor(NijC)) < TOL && fabs(NijH-floor(NijH)) < TOL) {
       Pij = PCHf[(int) NijC][(int) NijH];
       dN2[0] = PCHdfdx[(int) NijC][(int) NijH];
@@ -3094,7 +3094,7 @@ double PairAIREBO::PijSpline(double NijC, double NijH, int typei, int typej,
       Pij = Spbicubic(NijC,NijH,coeffs,dN2);
     }
   }
-  
+
   if (typei == 1 && typej == 0) {
     Pij = 0.0;
     dN2[0] = 0.0;
@@ -3115,7 +3115,7 @@ double PairAIREBO::PijSpline(double NijC, double NijH, int typei, int typej,
 ------------------------------------------------------------------------- */
 
 double PairAIREBO::piRCSpline(double Nij, double Nji, double Nijconj,
-			      int typei, int typej, double dN3[3])
+                              int typei, int typej, double dN3[3])
 {
   int x,y,z,i,done;
   double piRC,coeffs[64];
@@ -3137,8 +3137,8 @@ double PairAIREBO::piRCSpline(double Nij, double Nji, double Nijconj,
     if (Nijconj<piCCdom[2][0]) Nijconj=piCCdom[2][0];
     if (Nijconj>piCCdom[2][1]) Nijconj=piCCdom[2][1];
 
-    if (fabs(Nij-floor(Nij))<TOL && fabs(Nji-floor(Nji))<TOL && 
-	fabs(Nijconj-floor(Nijconj))<TOL) {
+    if (fabs(Nij-floor(Nij))<TOL && fabs(Nji-floor(Nji))<TOL &&
+        fabs(Nijconj-floor(Nijconj))<TOL) {
       piRC=piCCf[(int) Nij][(int) Nji][(int) Nijconj];
       dN3[0]=piCCdfdx[(int) Nij][(int) Nji][(int) Nijconj];
       dN3[1]=piCCdfdy[(int) Nij][(int) Nji][(int) Nijconj];
@@ -3148,27 +3148,27 @@ double PairAIREBO::piRCSpline(double Nij, double Nji, double Nijconj,
 
     if (done==0) {
       for (i=0; i<piCCdom[0][1]; i++)
-	if (Nij>=(double) i && Nij<=(double) i+1 || Nij==(double) i) x=i;
+        if (Nij>=(double) i && Nij<=(double) i+1 || Nij==(double) i) x=i;
       for (i=0; i<piCCdom[1][1]; i++)
-	if (Nji>=(double) i && Nji<=(double) i+1 || Nji==(double) i) y=i;
+        if (Nji>=(double) i && Nji<=(double) i+1 || Nji==(double) i) y=i;
       for (i=0; i<piCCdom[2][1]; i++)
-	if (Nijconj>=(double) i && Nijconj<=(double) i+1 || 
-	    Nijconj==(double) i) z=i;
+        if (Nijconj>=(double) i && Nijconj<=(double) i+1 ||
+            Nijconj==(double) i) z=i;
 
       for (i=0; i<64; i++) coeffs[i]=piCC[x][y][z][i];
       piRC=Sptricubic(Nij,Nji,Nijconj,coeffs,dN3);
     }
   }
-  
-  
+
+
   // CH interaction
 
   if (typei==0 && typej==1 || typei==1 && typej==0) {
     // if the inputs are out of bounds set them back to a point in bounds
 
-    if (Nij<piCHdom[0][0] || Nij>piCHdom[0][1] || 
-	Nji<piCHdom[1][0] || Nji>piCHdom[1][1] || 
-	Nijconj<piCHdom[2][0] || Nijconj>piCHdom[2][1]) {
+    if (Nij<piCHdom[0][0] || Nij>piCHdom[0][1] ||
+        Nji<piCHdom[1][0] || Nji>piCHdom[1][1] ||
+        Nijconj<piCHdom[2][0] || Nijconj>piCHdom[2][1]) {
       if (Nij<piCHdom[0][0]) Nij=piCHdom[0][0];
       if (Nij>piCHdom[0][1]) Nij=piCHdom[0][1];
       if (Nji<piCHdom[1][0]) Nji=piCHdom[1][0];
@@ -3177,8 +3177,8 @@ double PairAIREBO::piRCSpline(double Nij, double Nji, double Nijconj,
       if (Nijconj>piCHdom[2][1]) Nijconj=piCHdom[2][1];
     }
 
-    if (fabs(Nij-floor(Nij))<TOL && fabs(Nji-floor(Nji))<TOL && 
-	fabs(Nijconj-floor(Nijconj))<TOL) {
+    if (fabs(Nij-floor(Nij))<TOL && fabs(Nji-floor(Nji))<TOL &&
+        fabs(Nijconj-floor(Nijconj))<TOL) {
       piRC=piCHf[(int) Nij][(int) Nji][(int) Nijconj];
       dN3[0]=piCHdfdx[(int) Nij][(int) Nji][(int) Nijconj];
       dN3[1]=piCHdfdy[(int) Nij][(int) Nji][(int) Nijconj];
@@ -3188,40 +3188,40 @@ double PairAIREBO::piRCSpline(double Nij, double Nji, double Nijconj,
 
     if (done==0) {
       for (i=0; i<piCHdom[0][1]; i++)
-	if (Nij>=i && Nij<=i+1) x=i;
+        if (Nij>=i && Nij<=i+1) x=i;
       for (i=0; i<piCHdom[1][1]; i++)
-	if (Nji>=i && Nji<=i+1) y=i;
+        if (Nji>=i && Nji<=i+1) y=i;
       for (i=0; i<piCHdom[2][1]; i++)
-	if (Nijconj>=i && Nijconj<=i+1) z=i;
+        if (Nijconj>=i && Nijconj<=i+1) z=i;
 
       for (i=0; i<64; i++) coeffs[i]=piCH[x][y][z][i];
       piRC=Sptricubic(Nij,Nji,Nijconj,coeffs,dN3);
     }
   }
-  
+
   if (typei==1 && typej==1) {
-    if (Nij<piHHdom[0][0] || Nij>piHHdom[0][1] || 
-	Nji<piHHdom[1][0] || Nji>piHHdom[1][1] || 
-	Nijconj<piHHdom[2][0] || Nijconj>piHHdom[2][1]) {
+    if (Nij<piHHdom[0][0] || Nij>piHHdom[0][1] ||
+        Nji<piHHdom[1][0] || Nji>piHHdom[1][1] ||
+        Nijconj<piHHdom[2][0] || Nijconj>piHHdom[2][1]) {
       Nij=0.0;
       Nji=0.0;
       Nijconj=0.0;
     }
-    if (fabs(Nij-floor(Nij))<TOL && fabs(Nji-floor(Nji))<TOL && 
-	fabs(Nijconj-floor(Nijconj))<TOL) {
+    if (fabs(Nij-floor(Nij))<TOL && fabs(Nji-floor(Nji))<TOL &&
+        fabs(Nijconj-floor(Nijconj))<TOL) {
       piRC=piHHf[(int) Nij][(int) Nji][(int) Nijconj];
       dN3[0]=piHHdfdx[(int) Nij][(int) Nji][(int) Nijconj];
       dN3[1]=piHHdfdy[(int) Nij][(int) Nji][(int) Nijconj];
       dN3[2]=piHHdfdz[(int) Nij][(int) Nji][(int) Nijconj];
       done=1;
-    } 
+    }
     if (done==0) {
       for (i=0; i<piHHdom[0][1]; i++)
-	if (Nij>=i && Nij<=i+1) x=i;
+        if (Nij>=i && Nij<=i+1) x=i;
       for (i=0; i<piHHdom[1][1]; i++)
-	if (Nji>=i && Nji<=i+1) y=i;
+        if (Nji>=i && Nji<=i+1) y=i;
       for (i=0; i<piHHdom[2][1]; i++)
-	if (Nijconj>=i && Nijconj<=i+1) z=i;
+        if (Nijconj>=i && Nijconj<=i+1) z=i;
 
       for (i=0; i<64; i++) coeffs[i]=piHH[x][y][z][i];
       piRC=Sptricubic(Nij,Nji,Nijconj,coeffs,dN3);
@@ -3236,7 +3236,7 @@ double PairAIREBO::piRCSpline(double Nij, double Nji, double Nijconj,
 ------------------------------------------------------------------------- */
 
 double PairAIREBO::TijSpline(double Nij, double Nji,
-			     double Nijconj, double dN3[3])
+                             double Nijconj, double dN3[3])
 {
   int x,y,z,i,done;
   double Tijf,coeffs[64];
@@ -3258,7 +3258,7 @@ double PairAIREBO::TijSpline(double Nij, double Nji,
   if (Nijconj<Tijdom[2][0]) Nijconj=Tijdom[2][0];
   if (Nijconj>Tijdom[2][1]) Nijconj=Tijdom[2][1];
 
-  if (fabs(Nij-floor(Nij))<TOL && fabs(Nji-floor(Nji))<TOL && 
+  if (fabs(Nij-floor(Nij))<TOL && fabs(Nji-floor(Nji))<TOL &&
       fabs(Nijconj-floor(Nijconj))<TOL) {
     Tijf=Tf[(int) Nij][(int) Nji][(int) Nijconj];
     dN3[0]=Tdfdx[(int) Nij][(int) Nji][(int) Nijconj];
@@ -3268,11 +3268,11 @@ double PairAIREBO::TijSpline(double Nij, double Nji,
   }
 
   if (done==0) {
-    for (i=0; i<Tijdom[0][1]; i++) 
+    for (i=0; i<Tijdom[0][1]; i++)
       if (Nij>=i && Nij<=i+1) x=i;
     for (i=0; i<Tijdom[1][1]; i++)
       if (Nji>=i && Nji<=i+1) y=i;
-    for (i=0; i<Tijdom[2][1]; i++) 
+    for (i=0; i<Tijdom[2][1]; i++)
       if (Nijconj>=i && Nijconj<=i+1) z=i;
 
     for (i=0; i<64; i++) coeffs[i]=Tijc[x][y][z][i];
@@ -3291,7 +3291,7 @@ void PairAIREBO::add_pages(int howmany)
   int toppage = maxpage;
   maxpage += howmany*PGDELTA;
 
-  pages = (int **) 
+  pages = (int **)
     memory->srealloc(pages,maxpage*sizeof(int *),"AIREBO:pages");
   for (int i = toppage; i < maxpage; i++)
     memory->create(pages[i],pgsize,"AIREBO:pages[i]");
@@ -3305,9 +3305,9 @@ void PairAIREBO::read_file(char *filename)
 {
   int i,j,k,l,limit;
   char s[MAXLINE];
-  
+
   // REBO Parameters (AIREBO)
-  
+
   double rcmin_CC,rcmin_CH,rcmin_HH,rcmax_CC,rcmax_CH,
     rcmax_HH,rcmaxp_CC,rcmaxp_CH,rcmaxp_HH;
   double Q_CC,Q_CH,Q_HH,alpha_CC,alpha_CH,alpha_HH,A_CC,A_CH,A_HH;
@@ -3316,19 +3316,19 @@ void PairAIREBO::read_file(char *filename)
   double Beta_CC1,Beta_CC2,Beta_CC3,Beta_CH1,Beta_CH2,Beta_CH3,
     Beta_HH1,Beta_HH2,Beta_HH3;
   double rho_CC,rho_CH,rho_HH;
-  
+
   // LJ Parameters (AIREBO)
-  
+
   double rcLJmin_CC,rcLJmin_CH,rcLJmin_HH,rcLJmax_CC,rcLJmax_CH,
     rcLJmax_HH,bLJmin_CC;
   double bLJmin_CH,bLJmin_HH,bLJmax_CC,bLJmax_CH,bLJmax_HH,
     epsilon_CC,epsilon_CH,epsilon_HH;
   double sigma_CC,sigma_CH,sigma_HH,epsilonT_CCCC,epsilonT_CCCH,epsilonT_HCCH;
-  
+
   MPI_Comm_rank(world,&me);
-  
+
   // read file on proc 0
-  
+
   if (me == 0) {
     FILE *fp = fopen(filename,"r");
     if (fp == NULL) {
@@ -3343,9 +3343,9 @@ void PairAIREBO::read_file(char *filename)
       fgets(s,MAXLINE,fp);
       if (s[0] != '#') break;
     }
-    
+
     // read parameters
-    
+
     fgets(s,MAXLINE,fp);
     sscanf(s,"%lg",&rcmin_CC);
     fgets(s,MAXLINE,fp);
@@ -3434,9 +3434,9 @@ void PairAIREBO::read_file(char *filename)
     sscanf(s,"%lg",&rho_CH);
     fgets(s,MAXLINE,fp);
     sscanf(s,"%lg",&rho_HH);
-    
+
     // LJ parameters
-    
+
     fgets(s,MAXLINE,fp);
     sscanf(s,"%lg",&rcLJmin_CC);
     fgets(s,MAXLINE,fp);
@@ -3479,18 +3479,18 @@ void PairAIREBO::read_file(char *filename)
     sscanf(s,"%lg",&epsilonT_CCCH);
     fgets(s,MAXLINE,fp);
     sscanf(s,"%lg",&epsilonT_HCCH);
-    
+
     // gC spline
-    
+
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
-    
-    // number-1 = # of domains for the spline 	
-    
+
+    // number-1 = # of domains for the spline
+
     fgets(s,MAXLINE,fp);
     sscanf(s,"%d",&limit);
-    
+
     for (i = 0; i < limit; i++) {
       fgets(s,MAXLINE,fp);
       sscanf(s,"%lg",&gCdom[i]);
@@ -3498,253 +3498,253 @@ void PairAIREBO::read_file(char *filename)
     fgets(s,MAXLINE,fp);
     for (i = 0; i < limit-1; i++) {
       for (j = 0; j < 6; j++) {
-	fgets(s,MAXLINE,fp);
-	sscanf(s,"%lg",&gC1[i][j]);
+        fgets(s,MAXLINE,fp);
+        sscanf(s,"%lg",&gC1[i][j]);
       }
     }
     fgets(s,MAXLINE,fp);
     for (i = 0; i < limit-1; i++) {
       for (j = 0; j < 6; j++) {
-	fgets(s,MAXLINE,fp);
-	sscanf(s,"%lg",&gC2[i][j]);
+        fgets(s,MAXLINE,fp);
+        sscanf(s,"%lg",&gC2[i][j]);
       }
     }
-    
+
     // gH spline
-    
+
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
-    
+
     fgets(s,MAXLINE,fp);
-    sscanf(s,"%d",&limit);	
-    
+    sscanf(s,"%d",&limit);
+
     for (i = 0; i < limit; i++) {
       fgets(s,MAXLINE,fp);
       sscanf(s,"%lg",&gHdom[i]);
     }
-    
+
     fgets(s,MAXLINE,fp);
-    
+
     for (i = 0; i < limit-1; i++) {
       for (j = 0; j < 6; j++) {
-	fgets(s,MAXLINE,fp);
-	sscanf(s,"%lg",&gH[i][j]);
+        fgets(s,MAXLINE,fp);
+        sscanf(s,"%lg",&gH[i][j]);
       }
     }
-    
+
     // pCC spline
-    
+
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
-    
+
     fgets(s,MAXLINE,fp);
-    sscanf(s,"%d",&limit);	
-    
+    sscanf(s,"%d",&limit);
+
     for (i = 0; i < limit/2; i++) {
       for (j = 0; j < limit/2; j++) {
-	fgets(s,MAXLINE,fp);
-	sscanf(s,"%lg",&pCCdom[i][j]);
+        fgets(s,MAXLINE,fp);
+        sscanf(s,"%lg",&pCCdom[i][j]);
       }
     }
     fgets(s,MAXLINE,fp);
-    
+
     for (i = 0; i < (int) pCCdom[0][1]; i++) {
       for (j = 0; j < (int) pCCdom[1][1]; j++) {
-	for (k = 0; k < 16; k++) {
-	  fgets(s,MAXLINE,fp);
-	  sscanf(s,"%lg",&pCC[i][j][k]);
-	}
+        for (k = 0; k < 16; k++) {
+          fgets(s,MAXLINE,fp);
+          sscanf(s,"%lg",&pCC[i][j][k]);
+        }
       }
     }
-    
+
     // pCH spline
-    
+
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
-    sscanf(s,"%d",&limit);	
-    
+    sscanf(s,"%d",&limit);
+
     for (i = 0; i < limit/2; i++) {
       for (j = 0; j < limit/2; j++) {
-	fgets(s,MAXLINE,fp);
-	sscanf(s,"%lg",&pCHdom[i][j]);
+        fgets(s,MAXLINE,fp);
+        sscanf(s,"%lg",&pCHdom[i][j]);
       }
     }
     fgets(s,MAXLINE,fp);
-    
+
     for (i = 0; i < (int) pCHdom[0][1]; i++) {
       for (j = 0; j < (int) pCHdom[1][1]; j++) {
-	for (k = 0; k < 16; k++) {
-	  fgets(s,MAXLINE,fp);
-	  sscanf(s,"%lg",&pCH[i][j][k]);
-	}
+        for (k = 0; k < 16; k++) {
+          fgets(s,MAXLINE,fp);
+          sscanf(s,"%lg",&pCH[i][j][k]);
+        }
       }
     }
-    
+
     // piCC cpline
-    
+
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
-    
+
     fgets(s,MAXLINE,fp);
     sscanf(s,"%d",&limit);
-    
+
     for (i = 0; i < limit/2; i++) {
       for (j = 0; j < limit/3; j++) {
-	fgets(s,MAXLINE,fp);
-	sscanf(s,"%lg",&piCCdom[i][j]);
+        fgets(s,MAXLINE,fp);
+        sscanf(s,"%lg",&piCCdom[i][j]);
       }
     }
     fgets(s,MAXLINE,fp);
-    
+
     for (i = 0; i < (int) piCCdom[0][1]; i++) {
       for (j = 0; j < (int) piCCdom[1][1]; j++) {
-	for (k = 0; k < (int) piCCdom[2][1]; k++) {
-	  for (l = 0; l < 64; l = l+1) {
-	    fgets(s,MAXLINE,fp);
-	    sscanf(s,"%lg",&piCC[i][j][k][l]);
-	  }
-	}
+        for (k = 0; k < (int) piCCdom[2][1]; k++) {
+          for (l = 0; l < 64; l = l+1) {
+            fgets(s,MAXLINE,fp);
+            sscanf(s,"%lg",&piCC[i][j][k][l]);
+          }
+        }
       }
     }
-    
+
     // piCH spline
-    
+
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
-    
+
     fgets(s,MAXLINE,fp);
     sscanf(s,"%d",&limit);
-    
+
     for (i = 0; i < limit/2; i++) {
       for (j = 0; j < limit/3; j++) {
-	fgets(s,MAXLINE,fp);
-	sscanf(s,"%lg",&piCHdom[i][j]);
+        fgets(s,MAXLINE,fp);
+        sscanf(s,"%lg",&piCHdom[i][j]);
       }
     }
     fgets(s,MAXLINE,fp);
-    
+
     for (i = 0; i < (int) piCHdom[0][1]; i++) {
       for (j = 0; j < (int) piCHdom[1][1]; j++) {
-	for (k = 0; k < (int) piCHdom[2][1]; k++) {
-	  for (l = 0; l < 64; l = l+1) {
-	    fgets(s,MAXLINE,fp);
-	    sscanf(s,"%lg",&piCH[i][j][k][l]);
-	  }
-	}
+        for (k = 0; k < (int) piCHdom[2][1]; k++) {
+          for (l = 0; l < 64; l = l+1) {
+            fgets(s,MAXLINE,fp);
+            sscanf(s,"%lg",&piCH[i][j][k][l]);
+          }
+        }
       }
     }
-    
+
     // piHH spline
-    
+
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
-    
+
     fgets(s,MAXLINE,fp);
     sscanf(s,"%d",&limit);
-    
+
     for (i = 0; i < limit/2; i++) {
       for (j = 0; j < limit/3; j++) {
-	fgets(s,MAXLINE,fp);
-	sscanf(s,"%lg",&piHHdom[i][j]);
+        fgets(s,MAXLINE,fp);
+        sscanf(s,"%lg",&piHHdom[i][j]);
       }
     }
     fgets(s,MAXLINE,fp);
-    
+
     for (i = 0; i < (int) piHHdom[0][1]; i++) {
       for (j = 0; j < (int) piHHdom[1][1]; j++) {
-	for (k = 0; k < (int) piHHdom[2][1]; k++) {
-	  for (l = 0; l < 64; l = l+1) {
-	    fgets(s,MAXLINE,fp);
-	    sscanf(s,"%lg",&piHH[i][j][k][l]);
-	  }
-	}
+        for (k = 0; k < (int) piHHdom[2][1]; k++) {
+          for (l = 0; l < 64; l = l+1) {
+            fgets(s,MAXLINE,fp);
+            sscanf(s,"%lg",&piHH[i][j][k][l]);
+          }
+        }
       }
     }
-    
+
     // Tij spline
-    
+
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
     fgets(s,MAXLINE,fp);
-    
+
     fgets(s,MAXLINE,fp);
     sscanf(s,"%d",&limit);
-    
+
     for (i = 0; i < limit/2; i++) {
       for (j = 0; j < limit/3; j++) {
-	fgets(s,MAXLINE,fp);
-	sscanf(s,"%lg",&Tijdom[i][j]);
+        fgets(s,MAXLINE,fp);
+        sscanf(s,"%lg",&Tijdom[i][j]);
       }
     }
     fgets(s,MAXLINE,fp);
-    
+
     for (i = 0; i < (int) Tijdom[0][1]; i++) {
       for (j = 0; j < (int) Tijdom[1][1]; j++) {
-	for (k = 0; k < (int) Tijdom[2][1]; k++) {
-	  for (l = 0; l < 64; l = l+1) {
-	    fgets(s,MAXLINE,fp);
-	    sscanf(s,"%lg",&Tijc[i][j][k][l]);
-	  }
-	}
+        for (k = 0; k < (int) Tijdom[2][1]; k++) {
+          for (l = 0; l < 64; l = l+1) {
+            fgets(s,MAXLINE,fp);
+            sscanf(s,"%lg",&Tijc[i][j][k][l]);
+          }
+        }
       }
     }
-    
+
     fclose(fp);
   }
-  
+
   // store read-in values in arrays
-  
+
   if (me == 0) {
-    
+
     // REBO
-    
+
     rcmin[0][0] = rcmin_CC;
     rcmin[0][1] = rcmin_CH;
     rcmin[1][0] = rcmin[0][1];
     rcmin[1][1] = rcmin_HH;
-    
+
     rcmax[0][0] = rcmax_CC;
     rcmax[0][1] = rcmax_CH;
     rcmax[1][0] = rcmax[0][1];
     rcmax[1][1] = rcmax_HH;
-    
+
     rcmaxsq[0][0] = rcmax[0][0]*rcmax[0][0];
     rcmaxsq[1][0] = rcmax[1][0]*rcmax[1][0];
     rcmaxsq[0][1] = rcmax[0][1]*rcmax[0][1];
     rcmaxsq[1][1] = rcmax[1][1]*rcmax[1][1];
-    
+
     rcmaxp[0][0] = rcmaxp_CC;
     rcmaxp[0][1] = rcmaxp_CH;
     rcmaxp[1][0] = rcmaxp[0][1];
     rcmaxp[1][1] = rcmaxp_HH;
-    
+
     Q[0][0] = Q_CC;
     Q[0][1] = Q_CH;
     Q[1][0] = Q[0][1];
     Q[1][1] = Q_HH;
-    
+
     alpha[0][0] = alpha_CC;
     alpha[0][1] = alpha_CH;
     alpha[1][0] = alpha[0][1];
     alpha[1][1] = alpha_HH;
-    
+
     A[0][0] = A_CC;
     A[0][1] = A_CH;
     A[1][0] = A[0][1];
     A[1][1] = A_HH;
-    
+
     rho[0][0] = rho_CC;
     rho[0][1] = rho_CH;
     rho[1][0] = rho[0][1];
     rho[1][1] = rho_HH;
-    
+
     BIJc[0][0][0] = BIJc_CC1;
     BIJc[0][0][1] = BIJc_CC2;
     BIJc[0][0][2] = BIJc_CC3;
@@ -3757,7 +3757,7 @@ void PairAIREBO::read_file(char *filename)
     BIJc[1][1][0] = BIJc_HH1;
     BIJc[1][1][1] = BIJc_HH2;
     BIJc[1][1][2] = BIJc_HH3;
-    
+
     Beta[0][0][0] = Beta_CC1;
     Beta[0][0][1] = Beta_CC2;
     Beta[0][0][2] = Beta_CC3;
@@ -3770,19 +3770,19 @@ void PairAIREBO::read_file(char *filename)
     Beta[1][1][0] = Beta_HH1;
     Beta[1][1][1] = Beta_HH2;
     Beta[1][1][2] = Beta_HH3;
-    
+
     // LJ
-    
+
     rcLJmin[0][0] = rcLJmin_CC;
     rcLJmin[0][1] = rcLJmin_CH;
     rcLJmin[1][0] = rcLJmin[0][1];
     rcLJmin[1][1] = rcLJmin_HH;
-    
+
     rcLJmax[0][0] = rcLJmax_CC;
     rcLJmax[0][1] = rcLJmax_CH;
     rcLJmax[1][0] = rcLJmax[0][1];
     rcLJmax[1][1] = rcLJmax_HH;
-    
+
     rcLJmaxsq[0][0] = rcLJmax[0][0]*rcLJmax[0][0];
     rcLJmaxsq[1][0] = rcLJmax[1][0]*rcLJmax[1][0];
     rcLJmaxsq[0][1] = rcLJmax[0][1]*rcLJmax[0][1];
@@ -3792,89 +3792,89 @@ void PairAIREBO::read_file(char *filename)
     bLJmin[0][1] = bLJmin_CH;
     bLJmin[1][0] = bLJmin[0][1];
     bLJmin[1][1] = bLJmin_HH;
-    
+
     bLJmax[0][0] = bLJmax_CC;
     bLJmax[0][1] = bLJmax_CH;
     bLJmax[1][0] = bLJmax[0][1];
     bLJmax[1][1] = bLJmax_HH;
-    
+
     epsilon[0][0] = epsilon_CC;
     epsilon[0][1] = epsilon_CH;
     epsilon[1][0] = epsilon[0][1];
     epsilon[1][1] = epsilon_HH;
-    
+
     sigma[0][0] = sigma_CC;
     sigma[0][1] = sigma_CH;
     sigma[1][0] = sigma[0][1];
     sigma[1][1] = sigma_HH;
-    
+
     // torsional
 
     thmin = -1.0;
-    thmax = -0.995; 
+    thmax = -0.995;
     epsilonT[0][0] = epsilonT_CCCC;
     epsilonT[0][1] = epsilonT_CCCH;
     epsilonT[1][0] = epsilonT[0][1];
     epsilonT[1][1] = epsilonT_HCCH;
   }
-  
+
   // broadcast read-in and setup values
 
   MPI_Bcast(&thmin,1,MPI_DOUBLE,0,world);
   MPI_Bcast(&thmax,1,MPI_DOUBLE,0,world);
-  
+
   MPI_Bcast(&smin,1,MPI_DOUBLE,0,world);
   MPI_Bcast(&Nmin,1,MPI_DOUBLE,0,world);
   MPI_Bcast(&Nmax,1,MPI_DOUBLE,0,world);
   MPI_Bcast(&NCmin,1,MPI_DOUBLE,0,world);
   MPI_Bcast(&NCmax,1,MPI_DOUBLE,0,world);
-  
-  
+
+
   MPI_Bcast(&rcmin[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&rcmax[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&rcmaxsq[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&rcmaxp[0][0],4,MPI_DOUBLE,0,world);
-  
+
   MPI_Bcast(&Q[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&alpha[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&A[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&rho[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&BIJc[0][0][0],12,MPI_DOUBLE,0,world);
   MPI_Bcast(&Beta[0][0][0],12,MPI_DOUBLE,0,world);
-  
+
   MPI_Bcast(&rcLJmin[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&rcLJmax[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&rcLJmaxsq[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&rcLJmin[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&rcLJmin[0][0],4,MPI_DOUBLE,0,world);
-  
+
   MPI_Bcast(&rcLJmin[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&rcLJmax[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&bLJmin[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&bLJmax[0][0],4,MPI_DOUBLE,0,world);
-  
+
   MPI_Bcast(&epsilon[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&sigma[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&epsilonT[0][0],4,MPI_DOUBLE,0,world);
-  
+
   MPI_Bcast(&gCdom[0],5,MPI_DOUBLE,0,world);
   MPI_Bcast(&gC1[0][0],24,MPI_DOUBLE,0,world);
   MPI_Bcast(&gC2[0][0],24,MPI_DOUBLE,0,world);
   MPI_Bcast(&gHdom[0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&gH[0][0],18,MPI_DOUBLE,0,world);
-  
+
   MPI_Bcast(&pCCdom[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&pCHdom[0][0],4,MPI_DOUBLE,0,world);
   MPI_Bcast(&pCC[0][0][0],256,MPI_DOUBLE,0,world);
   MPI_Bcast(&pCH[0][0][0],256,MPI_DOUBLE,0,world);
-  
+
   MPI_Bcast(&piCCdom[0][0],6,MPI_DOUBLE,0,world);
   MPI_Bcast(&piCHdom[0][0],6,MPI_DOUBLE,0,world);
   MPI_Bcast(&piHHdom[0][0],6,MPI_DOUBLE,0,world);
   MPI_Bcast(&piCC[0][0][0][0],9216,MPI_DOUBLE,0,world);
   MPI_Bcast(&piCH[0][0][0][0],9216,MPI_DOUBLE,0,world);
   MPI_Bcast(&piHH[0][0][0][0],9216,MPI_DOUBLE,0,world);
-  
+
   MPI_Bcast(&Tijdom[0][0],6,MPI_DOUBLE,0,world);
   MPI_Bcast(&Tijc[0][0][0][0],9216,MPI_DOUBLE,0,world);
 }
@@ -3914,11 +3914,11 @@ double PairAIREBO::Sp5th(double x, double coeffs[6], double *df)
 ------------------------------------------------------------------------- */
 
 double PairAIREBO::Spbicubic(double x, double y,
-			     double coeffs[16], double df[2])
+                             double coeffs[16], double df[2])
 {
   double f,xn,yn,xn1,yn1,c;
   int i,j;
-  
+
   f = 0.0;
   df[0] = 0.0;
   df[1] = 0.0;
@@ -3930,7 +3930,7 @@ double PairAIREBO::Spbicubic(double x, double y,
       c = coeffs[i*4+j];
 
       f += c*xn*yn;
-      if (i > 0) df[0] += c * ((double) i) * xn1 * yn; 
+      if (i > 0) df[0] += c * ((double) i) * xn1 * yn;
       if (j > 0) df[1] += c * ((double) j) * xn * yn1;
 
       yn1 = yn;
@@ -3948,7 +3948,7 @@ double PairAIREBO::Spbicubic(double x, double y,
 ------------------------------------------------------------------------- */
 
 double PairAIREBO::Sptricubic(double x, double y, double z,
-			      double coeffs[64], double df[3])
+                              double coeffs[64], double df[3])
 {
   double f,ir,jr,kr,xn,yn,zn,xn1,yn1,zn1,c;
   int i,j,k;
@@ -3966,14 +3966,14 @@ double PairAIREBO::Sptricubic(double x, double y, double z,
       jr = (double) j;
       zn = 1.0;
       for (k = 0; k < 4; k++) {
-	kr = (double) k;
-	c = coeffs[16*i+4*j+k];
-	f += c*xn*yn*zn;
-	if (i > 0) df[0] += c * ir * xn1 * yn * zn;
-	if (j > 0) df[1] += c * jr * xn * yn1 * zn;
-	if (k > 0) df[2] += c * kr * xn * yn * zn1;
-	zn1 = zn;
-	zn *= z;
+        kr = (double) k;
+        c = coeffs[16*i+4*j+k];
+        f += c*xn*yn*zn;
+        if (i > 0) df[0] += c * ir * xn1 * yn * zn;
+        if (j > 0) df[1] += c * jr * xn * yn1 * zn;
+        if (k > 0) df[2] += c * kr * xn * yn * zn1;
+        zn1 = zn;
+        zn *= z;
       }
       yn1 = yn;
       yn *= y;
@@ -3992,7 +3992,7 @@ double PairAIREBO::Sptricubic(double x, double y, double z,
 void PairAIREBO::spline_init()
 {
   int i,j,k;
-  
+
   for (i = 0; i < 5; i++) {
     for (j = 0; j < 5; j++) {
       PCCf[i][j] = 0.0;
@@ -4003,7 +4003,7 @@ void PairAIREBO::spline_init()
       PCHdfdy[i][j] = 0.0;
     }
   }
-  
+
   PCCf[0][2] = -0.00050;
   PCCf[0][3] = 0.0161253646;
   PCCf[1][1] = -0.010960;
@@ -4020,26 +4020,26 @@ void PairAIREBO::spline_init()
   PCHf[2][0] = -0.122042146;
   PCHf[2][1] = -0.300529172;
   PCHf[3][0] = -0.307584705;
-  
+
   for (i = 0; i < 5; i++) {
     for (j = 0; j < 5; j++) {
       for (k = 0; k < 10; k++) {
-	piCCf[i][j][k] = 0.0;
-	piCCdfdx[i][j][k] = 0.0;
-	piCCdfdy[i][j][k] = 0.0;
-	piCCdfdz[i][j][k] = 0.0;
-	piCHf[i][j][k] = 0.0;
-	piCHdfdx[i][j][k] = 0.0;
-	piCHdfdy[i][j][k] = 0.0;
-	piCHdfdz[i][j][k] = 0.0;
-	piHHf[i][j][k] = 0.0;
-	piHHdfdx[i][j][k] = 0.0;
-	piHHdfdy[i][j][k] = 0.0;
-	piHHdfdz[i][j][k] = 0.0;
-	Tf[i][j][k] = 0.0;
-	Tdfdx[i][j][k] = 0.0;
-	Tdfdy[i][j][k] = 0.0;
-	Tdfdz[i][j][k] = 0.0;
+        piCCf[i][j][k] = 0.0;
+        piCCdfdx[i][j][k] = 0.0;
+        piCCdfdy[i][j][k] = 0.0;
+        piCCdfdz[i][j][k] = 0.0;
+        piCHf[i][j][k] = 0.0;
+        piCHdfdx[i][j][k] = 0.0;
+        piCHdfdy[i][j][k] = 0.0;
+        piCHdfdz[i][j][k] = 0.0;
+        piHHf[i][j][k] = 0.0;
+        piHHdfdx[i][j][k] = 0.0;
+        piHHdfdy[i][j][k] = 0.0;
+        piHHdfdz[i][j][k] = 0.0;
+        Tf[i][j][k] = 0.0;
+        Tdfdx[i][j][k] = 0.0;
+        Tdfdy[i][j][k] = 0.0;
+        Tdfdz[i][j][k] = 0.0;
       }
     }
   }
@@ -4188,7 +4188,7 @@ void PairAIREBO::spline_init()
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairAIREBO::memory_usage()
diff --git a/src/MANYBODY/pair_airebo.h b/src/MANYBODY/pair_airebo.h
index 9d3f69b258..7ff0a5a970 100644
--- a/src/MANYBODY/pair_airebo.h
+++ b/src/MANYBODY/pair_airebo.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -94,7 +94,7 @@ class PairAIREBO : public Pair {
 
   double bondorder(int, int, double *, double, double, double **, int);
   double bondorderLJ(int, int, double *, double, double,
-		     double *, double, double **, int);
+                     double *, double, double **, int);
 
   double gSpline(double, double, int, double *, double *);
   double PijSpline(double, double, int, int, double *);
diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp
index 004c96ce3f..f6170bdf6c 100644
--- a/src/MANYBODY/pair_comb.cpp
+++ b/src/MANYBODY/pair_comb.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -13,7 +13,7 @@
 
 /* ----------------------------------------------------------------------
    Contributing author: Tzu-Ray Shan (U Florida, present: tnshan@sandia.gov)
-   LAMMPS implementation of the Charge-optimized many-body (COMB) potential 
+   LAMMPS implementation of the Charge-optimized many-body (COMB) potential
    based on the HELL MD program (Prof Simon Phillpot, UF, sphil@mse.ufl.edu)
    and Aidan Thompson's Tersoff code in LAMMPS
 ------------------------------------------------------------------------- */
@@ -106,7 +106,7 @@ PairComb::~PairComb()
   memory->destroy(bbij);
   memory->destroy(sht_num);
   memory->destroy(sht_first);
-  
+
   if (allocated) {
     memory->destroy(setflag);
     memory->destroy(cutsq);
@@ -129,7 +129,7 @@ void PairComb::compute(int eflag, int vflag)
   int mr1,mr2,mr3;
   int rsc,inty;
   double elp_ij,filp[3],fjlp[3],fklp[3];
-  double iq,jq; 
+  double iq,jq;
   double yaself;
   double potal,fac11,fac11e;
   double vionij,fvionij,sr1,sr2,sr3,Eov,Fov;
@@ -145,7 +145,7 @@ void PairComb::compute(int eflag, int vflag)
 
   double **x = atom->x;
   double **f = atom->f;
-  double *q = atom->q; 
+  double *q = atom->q;
   int *tag = atom->tag;
   int *type = atom->type;
   int nlocal = atom->nlocal;
@@ -156,12 +156,12 @@ void PairComb::compute(int eflag, int vflag)
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
 
-  yaself = vionij = fvionij = Eov = Fov = 0.0; 
+  yaself = vionij = fvionij = Eov = Fov = 0.0;
 
   // self energy correction term: potal
 
   potal_calc(potal,fac11,fac11e);
- 
+
   // loop over full neighbor list of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -172,7 +172,7 @@ void PairComb::compute(int eflag, int vflag)
     ytmp = x[i][1];
     ztmp = x[i][2];
     iq = q[i];
-    NCo[i] = 0;  
+    NCo[i] = 0;
     nj = 0;
     iparam_i = elem2param[itype][itype][itype];
 
@@ -181,7 +181,7 @@ void PairComb::compute(int eflag, int vflag)
     yaself = self(&params[iparam_i],iq,potal);
 
     if (evflag) ev_tally(i,i,nlocal,0,yaself,0.0,0.0,0.0,0.0,0.0);
- 
+
     // two-body interactions (long and short repulsive)
 
     jlist = firstneigh[i];
@@ -202,9 +202,9 @@ void PairComb::compute(int eflag, int vflag)
         if (x[j][2] < x[i][2]) continue;
         if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
         if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
-      } 
+      }
 
-      // Qj calculates 2-body Coulombic 
+      // Qj calculates 2-body Coulombic
 
       jtype = map[type[j]];
       jq = q[j];
@@ -226,35 +226,35 @@ void PairComb::compute(int eflag, int vflag)
       tri_point(rsq, mr1, mr2, mr3, sr1, sr2, sr3, itype);
 
       // 1/r energy and forces
-      
+
       direct(inty,mr1,mr2,mr3,rsq,sr1,sr2,sr3,iq,jq,
-	     potal,fac11,fac11e,vionij,fvionij);
+             potal,fac11,fac11e,vionij,fvionij);
 
       // field correction to self energy
-      
+
       field(&params[iparam_ij],rsq,iq,jq,vionij,fvionij);
-      
+
       // polarization field
       // sums up long range forces
-      
+
       f[i][0] += delx*fvionij;
       f[i][1] += dely*fvionij;
       f[i][2] += delz*fvionij;
       f[j][0] -= delx*fvionij;
       f[j][1] -= dely*fvionij;
       f[j][2] -= delz*fvionij;
-      
-      if (evflag) 
-	ev_tally(i,j,nlocal,newton_pair,0.0,vionij,fvionij,delx,dely,delz);
-      
+
+      if (evflag)
+        ev_tally(i,j,nlocal,newton_pair,0.0,vionij,fvionij,delx,dely,delz);
+
       // short range q-independent
-      
+
       if (rsq > params[iparam_ij].cutsq) continue;
-      
+
       repulsive(&params[iparam_ij],rsq,fpair,eflag,evdwl,iq,jq);
-      
+
       // repulsion is pure two-body, sums up pair repulsive forces
-      
+
       f[i][0] += delx*fpair;
       f[i][1] += dely*fpair;
       f[i][2] += delz*fpair;
@@ -263,30 +263,30 @@ void PairComb::compute(int eflag, int vflag)
       f[j][2] -= delz*fpair;
 
       if (evflag)
-	ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
+        ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
     }
 
     // accumulate coordination number information
 
     if (cor_flag) {
       for (jj = 0; jj < sht_jnum; jj++) {
-	j = sht_jlist[jj];
-	jtype = map[type[j]];
-	iparam_ij = elem2param[itype][jtype][jtype];
-	
-	if(params[iparam_ij].hfocor > 0.0 ) {
-	  delr1[0] = x[j][0] - xtmp;
-	  delr1[1] = x[j][1] - ytmp;
-	  delr1[2] = x[j][2] - ztmp;
-	  rsq1 = vec3_dot(delr1,delr1);
-	  
-	  if (rsq1 > params[iparam_ij].cutsq) continue;
-	  NCo[i] += 1; 
-	}
+        j = sht_jlist[jj];
+        jtype = map[type[j]];
+        iparam_ij = elem2param[itype][jtype][jtype];
+
+        if(params[iparam_ij].hfocor > 0.0 ) {
+          delr1[0] = x[j][0] - xtmp;
+          delr1[1] = x[j][1] - ytmp;
+          delr1[2] = x[j][2] - ztmp;
+          rsq1 = vec3_dot(delr1,delr1);
+
+          if (rsq1 > params[iparam_ij].cutsq) continue;
+          NCo[i] += 1;
+        }
       }
     }
 
-    // three-body interactions 
+    // three-body interactions
     // half i-j loop
 
     for (jj = 0; jj < sht_jnum; jj++) {
@@ -309,38 +309,38 @@ void PairComb::compute(int eflag, int vflag)
 
       // accumulate bondorder zeta for each i-j interaction via loop over k
 
-      zeta_ij = 0.0; 
+      zeta_ij = 0.0;
       cuo_flag1 = 0; cuo_flag2 = 0;
 
       for (kk = 0; kk < sht_jnum; kk++) {
-	k = sht_jlist[kk];
-	if (j == k) continue;
-	ktype = map[type[k]];
-	iparam_ijk = elem2param[itype][jtype][ktype];
+        k = sht_jlist[kk];
+        if (j == k) continue;
+        ktype = map[type[k]];
+        iparam_ijk = elem2param[itype][jtype][ktype];
 
-	delr2[0] = x[k][0] - xtmp;
-	delr2[1] = x[k][1] - ytmp;
-	delr2[2] = x[k][2] - ztmp;
-	rsq2 = vec3_dot(delr2,delr2);
+        delr2[0] = x[k][0] - xtmp;
+        delr2[1] = x[k][1] - ytmp;
+        delr2[2] = x[k][2] - ztmp;
+        rsq2 = vec3_dot(delr2,delr2);
 
-	if (rsq2 > params[iparam_ijk].cutsq) continue;
+        if (rsq2 > params[iparam_ijk].cutsq) continue;
 
-	zeta_ij += zeta(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
+        zeta_ij += zeta(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
 
-	if (params[iparam_ijk].hfocor == -2.0) cuo_flag1 = 1;
-	if (params[iparam_ijk].hfocor == -1.0) cuo_flag2 = 1;
+        if (params[iparam_ijk].hfocor == -2.0) cuo_flag1 = 1;
+        if (params[iparam_ijk].hfocor == -1.0) cuo_flag2 = 1;
       }
 
       if (cuo_flag1 && cuo_flag2) cuo_flag = 1;
       else cuo_flag = 0;
 
       force_zeta(&params[iparam_ij],eflag,i,nj,rsq1,zeta_ij,
-		 iq,jq,fpair,prefactor,evdwl);
+                 iq,jq,fpair,prefactor,evdwl);
 
       // over-coordination correction for HfO2
 
       if (cor_flag && NCo[i] != 0)
-	Over_cor(&params[iparam_ij],rsq1,NCo[i],Eov, Fov);
+        Over_cor(&params[iparam_ij],rsq1,NCo[i],Eov, Fov);
       evdwl +=  Eov;
       fpair +=  Fov;
 
@@ -352,48 +352,48 @@ void PairComb::compute(int eflag, int vflag)
       f[j][2] -= delr1[2]*fpair;
 
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,0.0,-fpair,-delr1[0],-delr1[1],-delr1[2]);
+                           evdwl,0.0,-fpair,-delr1[0],-delr1[1],-delr1[2]);
 
       // attractive term via loop over k (3-body forces)
 
       for (kk = 0; kk < sht_jnum; kk++) {
-	k = sht_jlist[kk];
-	if (j == k) continue;
-	ktype = map[type[k]];
-	iparam_ijk = elem2param[itype][jtype][ktype];
+        k = sht_jlist[kk];
+        if (j == k) continue;
+        ktype = map[type[k]];
+        iparam_ijk = elem2param[itype][jtype][ktype];
 
-	delr2[0] = x[k][0] - xtmp;
-	delr2[1] = x[k][1] - ytmp;
-	delr2[2] = x[k][2] - ztmp;
-	rsq2 = vec3_dot(delr2,delr2);
-	if (rsq2 > params[iparam_ijk].cutsq) continue;
+        delr2[0] = x[k][0] - xtmp;
+        delr2[1] = x[k][1] - ytmp;
+        delr2[2] = x[k][2] - ztmp;
+        rsq2 = vec3_dot(delr2,delr2);
+        if (rsq2 > params[iparam_ijk].cutsq) continue;
 
-	for (rsc = 0; rsc < 3; rsc++)
-	  fi[rsc] = fj[rsc] = fk[rsc] = 0.0;
+        for (rsc = 0; rsc < 3; rsc++)
+          fi[rsc] = fj[rsc] = fk[rsc] = 0.0;
 
-	attractive(&params[iparam_ijk],prefactor,
-		   rsq1,rsq2,delr1,delr2,fi,fj,fk);
+        attractive(&params[iparam_ijk],prefactor,
+                   rsq1,rsq2,delr1,delr2,fi,fj,fk);
 
-	// 3-body LP and BB correction and forces
+        // 3-body LP and BB correction and forces
 
-	elp_ij = elp(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
-	flp(&params[iparam_ijk],rsq1,rsq2,delr1,delr2,filp,fjlp,fklp); 
+        elp_ij = elp(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
+        flp(&params[iparam_ijk],rsq1,rsq2,delr1,delr2,filp,fjlp,fklp);
 
-	for (rsc = 0; rsc < 3; rsc++) {
-	  fi[rsc] += filp[rsc];
-	  fj[rsc] += fjlp[rsc];
-	  fk[rsc] += fklp[rsc];
-	} 
+        for (rsc = 0; rsc < 3; rsc++) {
+          fi[rsc] += filp[rsc];
+          fj[rsc] += fjlp[rsc];
+          fk[rsc] += fklp[rsc];
+        }
 
-	for (rsc = 0; rsc < 3; rsc++) {
-	  f[i][rsc] += fi[rsc];
-	  f[j][rsc] += fj[rsc];
-	  f[k][rsc] += fk[rsc];
-	}
+        for (rsc = 0; rsc < 3; rsc++) {
+          f[i][rsc] += fi[rsc];
+          f[j][rsc] += fj[rsc];
+          f[k][rsc] += fk[rsc];
+        }
 
-        if (evflag) 
-	  ev_tally(i,j,nlocal,newton_pair,elp_ij,0.0,0.0,0.0,0.0,0.0);
-	if (vflag_atom) v_tally3(i,j,k,fj,fk,delr1,delr2);
+        if (evflag)
+          ev_tally(i,j,nlocal,newton_pair,elp_ij,0.0,0.0,0.0,0.0,0.0);
+        if (vflag_atom) v_tally3(i,j,k,fj,fk,delr1,delr2);
 
       }
     }
@@ -417,11 +417,11 @@ void PairComb::allocate()
  memory->create(cutsq,n+1,n+1,"pair:cutsq");
 
  map = new int[n+1];
- esm = new double[n]; 
+ esm = new double[n];
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairComb::settings(int narg, char **arg)
@@ -477,7 +477,7 @@ void PairComb::coeff(int narg, char **arg)
   }
 
   // read potential file and initialize potential parameters
-  
+
   read_file(arg[2]);
   setup();
 
@@ -486,7 +486,7 @@ void PairComb::coeff(int narg, char **arg)
   // generate streitz-mintmire direct 1/r energy look-up table
 
   if (comm->me == 0 && screen) fprintf(screen,"Pair COMB:\n");
-  if (comm->me == 0 && screen) 
+  if (comm->me == 0 && screen)
     fprintf(screen,"  generating Coulomb integral lookup table ...\n");
   sm_table();
 
@@ -507,8 +507,8 @@ void PairComb::coeff(int narg, char **arg)
   for (int i = 1; i <= n; i++)
     for (int j = i; j <= n; j++)
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	count++;
+        setflag[i][j] = 1;
+        count++;
       }
 
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
@@ -590,8 +590,8 @@ void PairComb::read_file(char *file)
     if (comm->me == 0) {
       ptr = fgets(line,MAXLINE,fp);
       if (ptr == NULL) {
-	eof = 1;
-	fclose(fp);
+        eof = 1;
+        fclose(fp);
       } else n = strlen(line) + 1;
     }
     MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -612,8 +612,8 @@ void PairComb::read_file(char *file)
       if (comm->me == 0) {
         ptr = fgets(&line[n],MAXLINE-n,fp);
         if (ptr == NULL) {
-	  eof = 1;
-	  fclose(fp);
+          eof = 1;
+          fclose(fp);
         } else n = strlen(line) + 1;
       }
       MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -652,7 +652,7 @@ void PairComb::read_file(char *file)
     if (nparams == maxparam) {
       maxparam += DELTA;
       params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
-					  "pair:params");
+                                          "pair:params");
     }
 
     params[nparams].ielement = ielement;
@@ -709,36 +709,36 @@ void PairComb::read_file(char *file)
 
     // parameter sanity checks
 
-    if (params[nparams].lam11 < 0.0 || params[nparams].lam12 < 0.0 || 
-        params[nparams].c < 0.0 || params[nparams].d < 0.0 || 
-	params[nparams].powern < 0.0 || params[nparams].beta < 0.0 || 
-	params[nparams].lam21 < 0.0 || params[nparams].lam22 < 0.0 || 
-	params[nparams].bigb1< 0.0 || params[nparams].bigb2< 0.0 || 
-	params[nparams].biga1< 0.0 || params[nparams].biga2< 0.0 || 
-	params[nparams].bigr < 0.0 || params[nparams].bigd < 0.0 ||
-	params[nparams].bigd > params[nparams].bigr ||
-	params[nparams].powerm - params[nparams].powermint != 0.0 ||
-	(params[nparams].powermint != 3 && params[nparams].powermint != 1) ||
-	params[nparams].plp1 < 0.0 || params[nparams].plp3 < 0.0 || 
-	params[nparams].plp6 < 0.0  ||
-	params[nparams].a123 > 360.0 || params[nparams].aconf < 0.0 ||
-	params[nparams].addrep < 0.0 || params[nparams].romigb < 0.0 ||
-	params[nparams].romigc < 0.0 || params[nparams].romigd < 0.0 ||
-	params[nparams].romiga < 0.0 || 
-	params[nparams].QL1 > 0.0 || params[nparams].QU1 < 0.0 || 
-	params[nparams].DL1 < 0.0 || params[nparams].DU1 > 0.0 ||
-	params[nparams].QL2 > 0.0 || params[nparams].QU2 < 0.0 || 
-	params[nparams].DL2 < 0.0 || params[nparams].DU2 > 0.0 ||
-	params[nparams].chi < 0.0 || 
-//	params[nparams].dj < 0.0 || params[nparams].dk < 0.0 || 
-//	params[nparams].dl < 0.0 || params[nparams].dm < 0.0 || 
-	params[nparams].esm1 < 0.0) 
+    if (params[nparams].lam11 < 0.0 || params[nparams].lam12 < 0.0 ||
+        params[nparams].c < 0.0 || params[nparams].d < 0.0 ||
+        params[nparams].powern < 0.0 || params[nparams].beta < 0.0 ||
+        params[nparams].lam21 < 0.0 || params[nparams].lam22 < 0.0 ||
+        params[nparams].bigb1< 0.0 || params[nparams].bigb2< 0.0 ||
+        params[nparams].biga1< 0.0 || params[nparams].biga2< 0.0 ||
+        params[nparams].bigr < 0.0 || params[nparams].bigd < 0.0 ||
+        params[nparams].bigd > params[nparams].bigr ||
+        params[nparams].powerm - params[nparams].powermint != 0.0 ||
+        (params[nparams].powermint != 3 && params[nparams].powermint != 1) ||
+        params[nparams].plp1 < 0.0 || params[nparams].plp3 < 0.0 ||
+        params[nparams].plp6 < 0.0  ||
+        params[nparams].a123 > 360.0 || params[nparams].aconf < 0.0 ||
+        params[nparams].addrep < 0.0 || params[nparams].romigb < 0.0 ||
+        params[nparams].romigc < 0.0 || params[nparams].romigd < 0.0 ||
+        params[nparams].romiga < 0.0 ||
+        params[nparams].QL1 > 0.0 || params[nparams].QU1 < 0.0 ||
+        params[nparams].DL1 < 0.0 || params[nparams].DU1 > 0.0 ||
+        params[nparams].QL2 > 0.0 || params[nparams].QU2 < 0.0 ||
+        params[nparams].DL2 < 0.0 || params[nparams].DU2 > 0.0 ||
+        params[nparams].chi < 0.0 ||
+//        params[nparams].dj < 0.0 || params[nparams].dk < 0.0 ||
+//        params[nparams].dl < 0.0 || params[nparams].dm < 0.0 ||
+        params[nparams].esm1 < 0.0)
       error->all(FLERR,"Illegal COMB parameter");
 
-    if (params[nparams].lam11 < params[nparams].lam21 || 
-        params[nparams].lam12 < params[nparams].lam22 || 
-	params[nparams].biga1< params[nparams].bigb1 ||
-	params[nparams].biga2< params[nparams].bigb2)
+    if (params[nparams].lam11 < params[nparams].lam21 ||
+        params[nparams].lam12 < params[nparams].lam22 ||
+        params[nparams].biga1< params[nparams].bigb1 ||
+        params[nparams].biga2< params[nparams].bigb2)
       error->all(FLERR,"Illegal COMB parameter");
 
     nparams++;
@@ -763,16 +763,16 @@ void PairComb::setup()
   for (i = 0; i < nelements; i++)
     for (j = 0; j < nelements; j++)
       for (k = 0; k < nelements; k++) {
-	n = -1;
-	for (m = 0; m < nparams; m++) {
-	  if (i == params[m].ielement && j == params[m].jelement && 
-	      k == params[m].kelement) {
-	    if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
-	    n = m;
-	  }
-	}
-	if (n < 0) error->all(FLERR,"Potential file is missing an entry");
-	elem2param[i][j][k] = n;
+        n = -1;
+        for (m = 0; m < nparams; m++) {
+          if (i == params[m].ielement && j == params[m].jelement &&
+              k == params[m].kelement) {
+            if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
+            n = m;
+          }
+        }
+        if (n < 0) error->all(FLERR,"Potential file is missing an entry");
+        elem2param[i][j][k] = n;
       }
 
   // compute parameter values derived from inputs
@@ -789,46 +789,46 @@ void PairComb::setup()
 
     params[m].Qo1 = (params[m].QU1+params[m].QL1)/2.0; // (A22)
     params[m].dQ1 = (params[m].QU1-params[m].QL1)/2.0; // (A21)
-    params[m].aB1 = 1.0 / 
+    params[m].aB1 = 1.0 /
       (1.0-pow(fabs(params[m].Qo1/params[m].dQ1),10.0)); // (A20)
     params[m].bB1 = pow(fabs(params[m].aB1),0.1)/params[m].dQ1; // (A19)
     params[m].nD1 = log(params[m].DU1/(params[m].DU1-params[m].DL1))/
-		    log(params[m].QU1/(params[m].QU1-params[m].QL1));
+                    log(params[m].QU1/(params[m].QU1-params[m].QL1));
     params[m].bD1 = (pow((params[m].DL1-params[m].DU1),(1.0/params[m].nD1)))/
-		    (params[m].QU1-params[m].QL1);
- 
+                    (params[m].QU1-params[m].QL1);
+
     params[m].Qo2 = (params[m].QU2+params[m].QL2)/2.0; // (A22)
     params[m].dQ2 = (params[m].QU2-params[m].QL2)/2.0; // (A21)
-    params[m].aB2 = 1.0 / 
+    params[m].aB2 = 1.0 /
       (1.0-pow(fabs(params[m].Qo2/params[m].dQ2),10.0)); // (A20)
     params[m].bB2 = pow(fabs(params[m].aB2),0.1)/params[m].dQ2; // (A19)
     params[m].nD2 = log(params[m].DU2/(params[m].DU2-params[m].DL2))/
-		    log(params[m].QU2/(params[m].QU2-params[m].QL2));
+                    log(params[m].QU2/(params[m].QU2-params[m].QL2));
     params[m].bD2 = (pow((params[m].DL2-params[m].DU2),(1.0/params[m].nD2)))/
-		    (params[m].QU2-params[m].QL2);
+                    (params[m].QU2-params[m].QL2);
 
     params[m].lcut = params[m].coulcut;
     params[m].lcutsq = params[m].lcut*params[m].lcut;
 
-    params[m].gamma = 1.0;	// for the change in pair_comb.h
+    params[m].gamma = 1.0;        // for the change in pair_comb.h
   }
 
   // set cutmax to max of all params
 
   cutmax = cutmin = 0.0;
-  cor_flag = 0; 
+  cor_flag = 0;
   for (m = 0; m < nparams; m++) {
     if (params[m].cut > cutmax) cutmax = params[m].cut;
     if (params[m].lcut > cutmax) cutmax = params[m].lcut;
     if (params[m].cutsq > cutmin) cutmin = params[m].cutsq+0.2;
     if (params[m].hfocor > 0.0001) cor_flag = 1;
   }
-}  
+}
 
 /* ---------------------------------------------------------------------- */
 
 void PairComb::repulsive(Param *param, double rsq, double &fforce,
-		    int eflag, double &eng, double iq, double jq)
+                    int eflag, double &eng, double iq, double jq)
 {
   double r,tmp_fc,tmp_fc_d,tmp_exp,Di,Dj;
   double bigA,Asi,Asj,vrcs,fvrcs,fforce_tmp;
@@ -865,7 +865,7 @@ void PairComb::repulsive(Param *param, double rsq, double &fforce,
   // additional repulsion for TiO2 and HfO2 (switch by cor_flag)
 
   vrcs = 0.0; fvrcs = 0.0;
-  if (romi > 0.0) { 
+  if (romi > 0.0) {
     if (!cor_flag) {
       vrcs = romi * pow((1.0-r/rrcs),2.0);
       fvrcs= romi * 2.0 * (r/rrcs-1.0)/rrcs; }
@@ -887,7 +887,7 @@ void PairComb::repulsive(Param *param, double rsq, double &fforce,
 /* ---------------------------------------------------------------------- */
 
 double PairComb::zeta(Param *param, double rsqij, double rsqik,
-			 double *delrij, double *delrik)
+                         double *delrij, double *delrik)
 {
   double rij,rik,costheta,arg,ex_delr;
 
@@ -907,49 +907,49 @@ double PairComb::zeta(Param *param, double rsqij, double rsqik,
 }
 
 /* ----------------------------------------------------------------------
-   Legendre polynomial bond angle correction to energy 
+   Legendre polynomial bond angle correction to energy
 ------------------------------------------------------------------------- */
 
 double PairComb::elp(Param *param, double rsqij, double rsqik,
-		     double *delrij, double *delrik)
+                     double *delrij, double *delrik)
 {
-  if (param->aconf > 1.0e-6 || param->plp1 > 1.0e-6 || 
+  if (param->aconf > 1.0e-6 || param->plp1 > 1.0e-6 ||
       param->plp3 > 1.0e-6 || param->plp6 > 1.0e-6) {
     double rij,rik,costheta,lp1,lp3,lp6;
     double rmu,rmu2,comtt,fck;
     double pplp1 = param->plp1, pplp3 = param->plp3, pplp6 = param->plp6;
     double c123 = cos(param->a123*MY_PI/180.0);
-    
+
     // cos(theta) of the i-j-k
     // cutoff function of rik
-    
+
     rij = sqrt(rsqij);
     rik = sqrt(rsqik);
     costheta = vec3_dot(delrij,delrik) / (rij*rik);
     fck = comb_fc(rik,param);
-    rmu = costheta; 
-    
+    rmu = costheta;
+
     // Legendre Polynomial functions
-    
+
     if (param->plp1 > 1.0e-6 || param->plp3 > 1.0e-6 || param->plp6 > 1.0e-6) {
       rmu2 = rmu*rmu;
       lp1 = rmu; lp3 = 0.5*(5.0*rmu2*rmu-3.0*rmu);
       lp6 = (231.0*rmu2*rmu2*rmu2-315.0*rmu2*rmu2+105.0*rmu2-5.0)/16.0;
       comtt = pplp1*lp1 + pplp3*lp3 + pplp6*lp6;
     } else comtt = 0.0;
-    
+
     // bond-bending terms
-    
+
     if (param->aconf>1e-4) {
       if (param->hfocor >= 0.0)
-	comtt += param->aconf *(rmu-c123)*(rmu-c123);
+        comtt += param->aconf *(rmu-c123)*(rmu-c123);
       else if (param->hfocor < 0.0)
-	comtt += param->aconf *(4.0-(rmu-c123)*(rmu-c123));
+        comtt += param->aconf *(4.0-(rmu-c123)*(rmu-c123));
     }
-    
+
     return 0.5 * fck * comtt;
   }
-  
+
   return 0.0;
 }
 
@@ -958,92 +958,92 @@ double PairComb::elp(Param *param, double rsqij, double rsqik,
 ------------------------------------------------------------------------- */
 
 void PairComb::flp(Param *param, double rsqij, double rsqik,
-		   double *delrij, double *delrik, double *drilp, 
-		   double *drjlp, double *drklp)
+                   double *delrij, double *delrik, double *drilp,
+                   double *drjlp, double *drklp)
 {
-  double ffj1,ffj2,ffk1,ffk2;		
+  double ffj1,ffj2,ffk1,ffk2;
   ffj1 = 0.0; ffj2 = 0.0; ffk1 = 0.0; ffk2 = 0.0;
 
-  if (param->aconf > 1.0e-4 || param->plp1 > 1.0e-6 || 
+  if (param->aconf > 1.0e-4 || param->plp1 > 1.0e-6 ||
       param->plp3 > 1.0e-6 || param->plp6 > 1.0e-6) {
     double rij,rik,costheta,lp1,lp1_d,lp3,lp3_d,lp6,lp6_d;
     double rmu,rmu2,comtt,comtt_d,com4k,com5,fcj,fck,fck_d;
-    
+
     double pplp1 = param->plp1;
     double pplp3 = param->plp3;
     double pplp6 = param->plp6;
     double c123 = cos(param->a123*MY_PI/180.0);
-    
+
     // fck_d = derivative of cutoff function
-    
+
     rij = sqrt(rsqij); rik = sqrt(rsqik);
-    costheta = vec3_dot(delrij,delrik) / (rij*rik);	
+    costheta = vec3_dot(delrij,delrik) / (rij*rik);
     fcj = comb_fc(rij,param);
     fck = comb_fc(rik,param);
     fck_d = comb_fc_d(rik,param);
-    rmu = costheta; 
-    
+    rmu = costheta;
+
     // Legendre Polynomial functions and derivatives
-    
+
     if (param->plp1 > 1.0e-6 || param->plp3 > 1.0e-6 || param->plp6 > 1.0e-6) {
-      rmu2 = rmu*rmu;	
+      rmu2 = rmu*rmu;
       lp1 = rmu; lp3 = (2.5*rmu2*rmu-1.5*rmu);
       lp6 = (231.0*rmu2*rmu2*rmu2-315.0*rmu2*rmu2+105.0*rmu2-5.0)/16.0;
       lp1_d = 1.0;lp3_d = (7.5*rmu2-1.5);
       lp6_d = (1386.0*rmu2*rmu2*rmu-1260.0*rmu2*rmu+210.0)/16.0;
-      comtt   = pplp1*lp1   + pplp3*lp3   + pplp6*lp6; 
+      comtt   = pplp1*lp1   + pplp3*lp3   + pplp6*lp6;
       comtt_d = pplp1*lp1_d + pplp3*lp3_d + pplp6*lp6_d;
     } else {
       comtt = 0.0;
       comtt_d = 0.0;
     }
-    
+
     // bond-bending terms derivatives
-    
+
     if (param->aconf > 1.0e-4) {
       if (param->hfocor >= 0.0) {
-	comtt += param->aconf *(rmu-c123)*(rmu-c123);
-	comtt_d += 2.0*param->aconf*(rmu-c123);
+        comtt += param->aconf *(rmu-c123)*(rmu-c123);
+        comtt_d += 2.0*param->aconf*(rmu-c123);
       } else if (param->hfocor < 0.0) {
-	comtt += param->aconf *(4.0-(rmu-c123)*(rmu-c123));
-	comtt_d += -2.0*param->aconf*(rmu-c123);
+        comtt += param->aconf *(4.0-(rmu-c123)*(rmu-c123));
+        comtt_d += -2.0*param->aconf*(rmu-c123);
       }
     }
-    
+
     com4k = fcj * fck_d * comtt;
     com5 = fcj * fck * comtt_d;
-    
-    ffj1 =-0.5*(com5/(rij*rik)); 
+
+    ffj1 =-0.5*(com5/(rij*rik));
     ffj2 = 0.5*(com5*rmu/rsqij);
     ffk1 = ffj1;
     ffk2 = 0.5*(-com4k/rik+com5*rmu/rsqik);
-    
+
   } else {
     ffj1 = 0.0; ffj2 = 0.0;
     ffk1 = 0.0; ffk2 = 0.0;
   }
-  
+
   // j-atom
-  
-  vec3_scale(ffj1,delrik,drjlp); 	    // (k,x[],y[]), y[]=k*x[]
+
+  vec3_scale(ffj1,delrik,drjlp);             // (k,x[],y[]), y[]=k*x[]
   vec3_scaleadd(ffj2,delrij,drjlp,drjlp);   // (k,x[],y[],z[]), z[]=k*x[]+y[]
-  
+
   // k-atom
-  
+
   vec3_scale(ffk1,delrij,drklp);
   vec3_scaleadd(ffk2,delrik,drklp,drklp);
-  
-  // i-atom 
-  
-  vec3_add(drjlp,drklp,drilp);		    // (x[],y[],z[]), z[]=x[]+y[]
+
+  // i-atom
+
+  vec3_add(drjlp,drklp,drilp);                    // (x[],y[],z[]), z[]=x[]+y[]
   vec3_scale(-1.0,drilp,drilp);
 }
 
 /* ---------------------------------------------------------------------- */
 
-void PairComb::force_zeta(Param *param, int eflag, int i, int j, double rsq, 
-		double zeta_ij, double iq, double jq, double &fforce, 
-		double &prefactor, double &eng)
+void PairComb::force_zeta(Param *param, int eflag, int i, int j, double rsq,
+                double zeta_ij, double iq, double jq, double &fforce,
+                double &prefactor, double &eng)
 {
   double r,fa,fa_d,bij;
 
@@ -1057,7 +1057,7 @@ void PairComb::force_zeta(Param *param, int eflag, int i, int j, double rsq,
   // force
   fforce = 0.5*bij*fa_d / r;
   prefactor = -0.5*fa * comb_bij_d(zeta_ij,param);
-  
+
   // eng = attractive energy
   if (eflag) eng = 0.5*bij*fa;
 }
@@ -1068,7 +1068,7 @@ double PairComb::comb_fc(double r, Param *param)
 {
   double comb_R = param->bigr;
   double comb_D = param->bigd;
-  
+
   if (r < comb_R-comb_D) return 1.0;
   if (r > comb_R+comb_D) return 0.0;
   return 0.5*(1.0 + cos(MY_PI*(r - comb_R)/comb_D));
@@ -1080,7 +1080,7 @@ double PairComb::comb_fc_d(double r, Param *param)
 {
   double comb_R = param->bigr;
   double comb_D = param->bigd;
-  
+
   if (r < comb_R-comb_D) return 0.0;
   if (r > comb_R+comb_D) return 0.0;
   return -(MY_PI2/comb_D) * sin(MY_PI*(r - comb_R)/comb_D);
@@ -1092,7 +1092,7 @@ double PairComb::comb_fc2(double r)
 {
   double comb_R = 1.89350;
   double comb_D = comb_R + 0.050;
-  
+
   if (r < comb_R) return 0.0;
   if (r > comb_D) return 1.0;
   return 0.5*(1.0 + cos(MY_PI*(r - comb_R)/(comb_D-comb_R)));
@@ -1104,7 +1104,7 @@ double PairComb::comb_fc2_d(double r)
 {
   double comb_R = 1.89350;
   double comb_D = comb_R + 0.050;
-  
+
   if (r < comb_R) return 0.0;
   if (r > comb_D) return 0.0;
   return -(MY_PI2/(comb_D-comb_R)) * sin(MY_PI*(r - comb_R)/(comb_D-comb_R));
@@ -1116,7 +1116,7 @@ double PairComb::comb_fc3(double r)
 {
   double comb_R = 2.51350;
   double comb_D = comb_R + 0.050;
-  
+
   if (r < comb_R) return 1.0;
   if (r > comb_D) return 0.0;
   return 0.5*(1.0 + cos(MY_PI*(r - comb_R)/(comb_D-comb_R)));
@@ -1128,7 +1128,7 @@ double PairComb::comb_fc3_d(double r)
 {
   double comb_R = 2.51350;
   double comb_D = comb_R + 0.050;
-  
+
   if (r < comb_R) return 0.0;
   if (r > comb_D) return 0.0;
   return -(MY_PI2/(comb_D-comb_R)) * sin(MY_PI*(r - comb_R)/(comb_D-comb_R));
@@ -1141,8 +1141,8 @@ double PairComb::self(Param *param, double qi, double selfpot)
  double self_tmp, cmin, cmax, qmin, qmax;
  double s1=param->chi, s2=param->dj, s3=param->dk, s4=param->dl, s5=param->dm;
 
- self_tmp = 0.0; 
- qmin = param->QL1*0.90; 
+ self_tmp = 0.0;
+ qmin = param->QL1*0.90;
  qmax = param->QU1*0.90;
  cmin = cmax = 1000.0;
 
@@ -1150,7 +1150,7 @@ double PairComb::self(Param *param, double qi, double selfpot)
 
  if (qi < qmin) self_tmp += cmin * pow((qi-qmin),4.0);
  if (qi > qmax) self_tmp += cmax * pow((qi-qmax),4.0);
- 
+
  return self_tmp;
 }
 
@@ -1170,11 +1170,11 @@ double PairComb::comb_fa(double r, Param *param, double iq, double jq)
        (param->aB1-fabs(pow(param->bB1*(qi-param->Qo1),10.0)));
   Bsj = param->bigb2 * exp(param->lam22*Dj)*
        (param->aB2-fabs(pow(param->bB2*(qj-param->Qo2),10.0)));
-  if (Bsi > 0.0 && Bsj > 0.0) bigB = sqrt(Bsi*Bsj)*param->romigb; 
+  if (Bsi > 0.0 && Bsj > 0.0) bigB = sqrt(Bsi*Bsj)*param->romigb;
   else bigB = 0.0;
 
   return -bigB * exp(-param->rlm2 * r) * comb_fc(r,param);
-}   
+}
 
 /* ---------------------------------------------------------------------- */
 
@@ -1220,13 +1220,13 @@ double PairComb::comb_bij_d(double zeta, Param *param)
   double tmp = param->beta * zeta;
   if (tmp > param->c1) return param->beta * -0.5*pow(tmp,-1.5);
   if (tmp > param->c2)
-    return param->beta * (-0.5*pow(tmp,-1.5) * 
-			  (1.0 - 0.5*(1.0 +  1.0/(2.0*param->powern)) * 
-			   pow(tmp,-param->powern)));
+    return param->beta * (-0.5*pow(tmp,-1.5) *
+                          (1.0 - 0.5*(1.0 +  1.0/(2.0*param->powern)) *
+                           pow(tmp,-param->powern)));
   if (tmp < param->c4) return 0.0;
   if (tmp < param->c3)
     return -0.5*param->beta * pow(tmp,param->powern-1.0);
-			  
+
   double tmp_n = pow(tmp,param->powern);
   return -0.5 * pow(1.0+tmp_n, -1.0-(1.0/(2.0*param->powern)))*tmp_n / zeta;
 }
@@ -1234,9 +1234,9 @@ double PairComb::comb_bij_d(double zeta, Param *param)
 /* ---------------------------------------------------------------------- */
 
 void PairComb::attractive(Param *param, double prefactor,
-			  double rsqij, double rsqik,
-			  double *delrij, double *delrik, 
-			  double *fi, double *fj, double *fk)
+                          double rsqij, double rsqik,
+                          double *delrij, double *delrik,
+                          double *fi, double *fj, double *fk)
 {
   double rij_hat[3],rik_hat[3];
   double rij,rijinv,rik,rikinv;
@@ -1244,7 +1244,7 @@ void PairComb::attractive(Param *param, double prefactor,
   rij = sqrt(rsqij);
   rijinv = 1.0/rij;
   vec3_scale(rijinv,delrij,rij_hat);
-  
+
   rik = sqrt(rsqik);
   rikinv = 1.0/rik;
   vec3_scale(rikinv,delrik,rik_hat);
@@ -1255,8 +1255,8 @@ void PairComb::attractive(Param *param, double prefactor,
 /* ---------------------------------------------------------------------- */
 
 void PairComb::comb_zetaterm_d(double prefactor, double *rij_hat, double rij,
-			       double *rik_hat, double rik, double *dri, 
-			       double *drj, double *drk, Param *param)
+                               double *rik_hat, double rik, double *dri,
+                               double *drj, double *drk, Param *param)
 {
   double gijk,gijk_d,ex_delr,ex_delr_d,fc,dfc,cos_theta,tmp;
   double dcosdri[3],dcosdrj[3],dcosdrk[3];
@@ -1273,12 +1273,12 @@ void PairComb::comb_zetaterm_d(double prefactor, double *rij_hat, double rij,
   if (param->powermint == 3)
     ex_delr_d = 3.0*pow(param->rlm2,3.0) * pow(rij-rik,2.0)*ex_delr; // com3
   else ex_delr_d = param->rlm2 * ex_delr; // com3
-  
+
   cos_theta = vec3_dot(rij_hat,rik_hat);
   gijk = comb_gijk(cos_theta,param);
   gijk_d = comb_gijk_d(cos_theta,param);
   costheta_d(rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk);
-  
+
   // compute the derivative wrt Ri
   // dri = -dfc*gijk*ex_delr*rik_hat;
   // dri += fc*gijk_d*ex_delr*dcosdri;
@@ -1314,8 +1314,8 @@ void PairComb::comb_zetaterm_d(double prefactor, double *rij_hat, double rij,
 /* ---------------------------------------------------------------------- */
 
 void PairComb::costheta_d(double *rij_hat, double rij,
-			     double *rik_hat, double rik,
-			     double *dri, double *drj, double *drk)
+                             double *rik_hat, double rik,
+                             double *dri, double *drj, double *drk)
 {
   // first element is devative wrt Ri, second wrt Rj, third wrt Rk
 
@@ -1342,17 +1342,17 @@ void PairComb::sm_table()
 
   int n = atom->ntypes;
   int nmax = atom->nmax;
-  
+
   dra  = 0.001;  // lookup table step size
-  drin = 0.1;    // starting distance of 1/r 
+  drin = 0.1;    // starting distance of 1/r
   rc = cutmax;
   alf = 0.20;
-  
+
   nntypes = int((n+1)*n/2); // interaction types
   ncoul = int((rc-drin)/dra)+1;
 
   // allocate arrays
-  
+
   memory->create(intype,n,n,"pair:intype");
   memory->create(fafb,ncoul,nntypes,"pair:fafb");
   memory->create(dfafb,ncoul,nntypes,"pair:dfafb");
@@ -1364,39 +1364,39 @@ void PairComb::sm_table()
   memory->create(bbij,nmax,MAXNEIGH,"pair:bbij");
   memory->create(sht_num,nmax,"pair:sht_num");
   sht_first = (int **) memory->smalloc(nmax*sizeof(int *),
-	    "pair:sht_first");
-  
+            "pair:sht_first");
+
   // set interaction number: 0-0=0, 1-1=1, 0-1=1-0=2
-  
+
   m = 0; k = n;
   for (i = 0; i < n; i++) {
     for (j = 0; j < n; j++) {
-      if (j == i) { 
-	intype[i][j] = m;
-	m += 1;
+      if (j == i) {
+        intype[i][j] = m;
+        m += 1;
       } else if (j != i && j > i) {
-	intype[i][j] = k;
-	k += 1;
+        intype[i][j] = k;
+        k += 1;
       } else if (j != i && j < i) {
-	intype[i][j] = intype[j][i];
+        intype[i][j] = intype[j][i];
       }
     }
   }
-  
+
   // default arrays to zero
-  
+
   for (i = 0; i < ncoul; i ++) {
     for (j = 0; j < nntypes; j ++) {
-      fafb[i][j] = 0.0; 
-      dfafb[i][j] = 0.0; 
-      ddfafb[i][j] = 0.0; 
-      phin[i][j] = 0.0; 
+      fafb[i][j] = 0.0;
+      dfafb[i][j] = 0.0;
+      ddfafb[i][j] = 0.0;
+      phin[i][j] = 0.0;
       dphin[i][j] = 0.0;
     }
   }
-  
+
   // direct 1/r energy with Slater 1S orbital overlap
-  
+
   for (i = 0; i < n; i++) {
     r = drin;
     itype = params[i].ielement;
@@ -1415,70 +1415,70 @@ void PairComb::sm_table()
       r = drin;
       if (j == i) {
         itype = params[i].ielement;
-	inty = intype[itype][itype];
+        inty = intype[itype][itype];
         iparam_i = elem2param[itype][itype][itype];
         z = params[iparam_i].esm1;
-	zrc = z * rc;
-	exp2ersh = exp(-2.0 * zrc);
-	fafash = -exp2ersh * (1.0 / rc + 
-			      z * (11.0/8.0 + 3.0/4.0*zrc + zrc*zrc/6.0));
-	dfafash = exp2ersh * (1.0/(rc*rc) + 2.0*z/rc +
-			      z*z*(2.0 + 7.0/6.0*zrc + zrc*zrc/3.0));
-	for (k = 0; k < ncoul; k ++) {
-	  zr = z * r;
-	  exp2er = exp(-2.0*zr);
-	  F1 = -exp2er * (1.0 / r + 
-			  z * (11.0/8.0 + 3.0/4.0*zr + zr*zr/6.0));
-	  dF1 = exp2er * (1.0/(r*r) + 2.0*z/r +
-			  z*z*(2.0 + 7.0/6.0*zr + zr*zr/3.0));
-	  ddF1 = -exp2er * (2.0/(r*r*r) + 4.0*z/(r*r) - 
-			    z*z*z/3.0*(17.0/2.0 + 5.0*zr + 2.0*zr*zr));
-	  fafb[k][inty] = F1-fafash-(r-rc)*dfafash;
-	  dfafb[k][inty] = (dF1 - dfafash);
-	  ddfafb[k][inty] = ddF1;
-	  r += dra; 
-	}
+        zrc = z * rc;
+        exp2ersh = exp(-2.0 * zrc);
+        fafash = -exp2ersh * (1.0 / rc +
+                              z * (11.0/8.0 + 3.0/4.0*zrc + zrc*zrc/6.0));
+        dfafash = exp2ersh * (1.0/(rc*rc) + 2.0*z/rc +
+                              z*z*(2.0 + 7.0/6.0*zrc + zrc*zrc/3.0));
+        for (k = 0; k < ncoul; k ++) {
+          zr = z * r;
+          exp2er = exp(-2.0*zr);
+          F1 = -exp2er * (1.0 / r +
+                          z * (11.0/8.0 + 3.0/4.0*zr + zr*zr/6.0));
+          dF1 = exp2er * (1.0/(r*r) + 2.0*z/r +
+                          z*z*(2.0 + 7.0/6.0*zr + zr*zr/3.0));
+          ddF1 = -exp2er * (2.0/(r*r*r) + 4.0*z/(r*r) -
+                            z*z*z/3.0*(17.0/2.0 + 5.0*zr + 2.0*zr*zr));
+          fafb[k][inty] = F1-fafash-(r-rc)*dfafash;
+          dfafb[k][inty] = (dF1 - dfafash);
+          ddfafb[k][inty] = ddF1;
+          r += dra;
+        }
       } else if (j != i) {
         itype = params[i].ielement;
         jtype = params[j].ielement;
-	inty = intype[itype][jtype];
+        inty = intype[itype][jtype];
         iparam_ij = elem2param[itype][jtype][jtype];
         ea = params[iparam_ij].esm1;
-	ea3 = ea*ea*ea;
-	iparam_ji = elem2param[jtype][itype][itype];
+        ea3 = ea*ea*ea;
+        iparam_ji = elem2param[jtype][itype][itype];
         eb = params[iparam_ji].esm1;
-	eb3 = eb*eb*eb;
-	E1 = ea*eb3*eb/((ea+eb)*(ea+eb)*(ea-eb)*(ea-eb));
-	E2 = eb*ea3*ea/((ea+eb)*(ea+eb)*(eb-ea)*(eb-ea));
-	E3 = (3.0*ea*ea*eb3*eb-eb3*eb3) / 
-	  ((ea+eb)*(ea+eb)*(ea+eb)*(ea-eb)*(ea-eb)*(ea-eb));
-	E4 = (3.0*eb*eb*ea3*ea-ea3*ea3) / 
-	  ((ea+eb)*(ea+eb)*(ea+eb)*(eb-ea)*(eb-ea)*(eb-ea));
-	exp2earsh = exp(-2.0*ea*rc);
-	exp2ebrsh = exp(-2.0*eb*rc);
-	fafbsh = -exp2earsh*(E1 + E3/rc)-exp2ebrsh*(E2 + E4/rc);
-	dfafbsh = 
-	  exp2earsh*(2.0*ea*(E1+E3/rc)+E3/(rc*rc)) +
-	  exp2ebrsh*(2.0*eb*(E2+E4/rc)+E4/(rc*rc));
-	for (k = 0; k < ncoul; k ++) {
-	  exp2ear = exp(-2.0*ea*r);
-	  exp2ebr = exp(-2.0*eb*r);
-	  fafb[k][inty] = 
-	    - exp2ear*(E1+E3/r) - exp2ebr*(E2+E4/r)
-	    - fafbsh - (r-rc) * dfafbsh;
-	  dfafb[k][inty] = (exp2ear*(2.0*ea*(E1+E3/r) + E3/(r*r))
-			    + exp2ebr*(2.0*eb*(E2+E4/r) + E4/(r*r))- dfafbsh);
-	  ddfafb[k][inty] = (- exp2ear*(E3/(r*r)*(1.0/r+2.0*ea/r+2.0/(r*r))
-					+ 2.0*ea*(E1+E3/r))-
-			     exp2ebr*(E4/(r*r)
-				      *(1.0/r+2.0*eb/r+2.0/(r*r)) + 
-				      2.0*eb*(E2+E4/r)));
-	  r += dra; 
-	}
-      } 
+        eb3 = eb*eb*eb;
+        E1 = ea*eb3*eb/((ea+eb)*(ea+eb)*(ea-eb)*(ea-eb));
+        E2 = eb*ea3*ea/((ea+eb)*(ea+eb)*(eb-ea)*(eb-ea));
+        E3 = (3.0*ea*ea*eb3*eb-eb3*eb3) /
+          ((ea+eb)*(ea+eb)*(ea+eb)*(ea-eb)*(ea-eb)*(ea-eb));
+        E4 = (3.0*eb*eb*ea3*ea-ea3*ea3) /
+          ((ea+eb)*(ea+eb)*(ea+eb)*(eb-ea)*(eb-ea)*(eb-ea));
+        exp2earsh = exp(-2.0*ea*rc);
+        exp2ebrsh = exp(-2.0*eb*rc);
+        fafbsh = -exp2earsh*(E1 + E3/rc)-exp2ebrsh*(E2 + E4/rc);
+        dfafbsh =
+          exp2earsh*(2.0*ea*(E1+E3/rc)+E3/(rc*rc)) +
+          exp2ebrsh*(2.0*eb*(E2+E4/rc)+E4/(rc*rc));
+        for (k = 0; k < ncoul; k ++) {
+          exp2ear = exp(-2.0*ea*r);
+          exp2ebr = exp(-2.0*eb*r);
+          fafb[k][inty] =
+            - exp2ear*(E1+E3/r) - exp2ebr*(E2+E4/r)
+            - fafbsh - (r-rc) * dfafbsh;
+          dfafb[k][inty] = (exp2ear*(2.0*ea*(E1+E3/r) + E3/(r*r))
+                            + exp2ebr*(2.0*eb*(E2+E4/r) + E4/(r*r))- dfafbsh);
+          ddfafb[k][inty] = (- exp2ear*(E3/(r*r)*(1.0/r+2.0*ea/r+2.0/(r*r))
+                                        + 2.0*ea*(E1+E3/r))-
+                             exp2ebr*(E4/(r*r)
+                                      *(1.0/r+2.0*eb/r+2.0/(r*r)) +
+                                      2.0*eb*(E2+E4/r)));
+          r += dra;
+        }
+      }
     }
   }
-  
+
   for (i = 0; i < 25000; i ++) {
     r = dra * i + drin;
     erpaw[i][0] = erfc(r*alf);
@@ -1492,25 +1492,25 @@ void PairComb::potal_calc(double &calc1, double &calc2, double &calc3)
 {
   double alf,rcoul,esucon;
   int m;
-  
+
   rcoul = 0.0;
   for (m = 0; m < nparams; m++)
     if (params[m].lcut > rcoul) rcoul = params[m].lcut;
-  
+
   alf = 0.20;
   esucon = force->qqr2e;
 
   calc2 = (erfc(rcoul*alf)/rcoul/rcoul+2.0*alf/MY_PIS*
-	   exp(-alf*alf*rcoul*rcoul)/rcoul)*esucon/rcoul;
+           exp(-alf*alf*rcoul*rcoul)/rcoul)*esucon/rcoul;
   calc3 = (erfc(rcoul*alf)/rcoul)*esucon;
   calc1 = -(alf/MY_PIS*esucon+calc3*0.5);
 }
 
 /* ---------------------------------------------------------------------- */
 
-void PairComb::tri_point(double rsq, int &mr1, int &mr2, 
-			 int &mr3, double &sr1, double &sr2, 
-			 double &sr3, int &itype)
+void PairComb::tri_point(double rsq, int &mr1, int &mr2,
+                         int &mr3, double &sr1, double &sr2,
+                         double &sr3, int &itype)
 {
  double r, rin, dr, dd, rr1, rridr, rridr2;
 
@@ -1538,10 +1538,10 @@ void PairComb::tri_point(double rsq, int &mr1, int &mr2,
 /* ---------------------------------------------------------------------- */
 
 void PairComb::direct(int inty, int mr1, int mr2, int mr3, double rsq,
-		      double sr1, double sr2, double sr3, 
-		      double iq, double jq, 
-		      double potal, double fac11, double fac11e, 
-		      double &pot_tmp, double &pot_d)
+                      double sr1, double sr2, double sr3,
+                      double iq, double jq,
+                      double potal, double fac11, double fac11e,
+                      double &pot_tmp, double &pot_d)
 {
  double r,erfcc,fafbn1,potij,sme2,esucon;
  double r3,erfcd,dfafbn1,smf2,dvdrr,alf,alfdpi;
@@ -1560,7 +1560,7 @@ void PairComb::direct(int inty, int mr1, int mr2, int mr3, double rsq,
  fafbn1= sr1*fafb[mr1][inty] + sr2*fafb[mr2][inty] + sr3*fafb[mr3][inty];
  potij = (erfcc/r * esucon - fac11e);
  sme2 = potij + fafbn1 * esucon;
- pot_tmp = 1.0 * iq * jq *sme2; 
+ pot_tmp = 1.0 * iq * jq *sme2;
 
  // 1/r force (wrt r)
 
@@ -1575,7 +1575,7 @@ void PairComb::direct(int inty, int mr1, int mr2, int mr3, double rsq,
 /* ---------------------------------------------------------------------- */
 
 void PairComb::field(Param *param, double rsq, double iq,double jq,
-		     double &vionij,double &fvionij)
+                     double &vionij,double &fvionij)
 {
  double r,r5,r6,rc,rc5,rc6,rf5,drf6,smpn,smpl,rfx1,rfx2;
  double cmi1,cmi2,cmj1,cmj2;
@@ -1583,12 +1583,12 @@ void PairComb::field(Param *param, double rsq, double iq,double jq,
  r = sqrt(rsq);
  r5 = r*r*r*r*r;
  r6 = r5 * r;
- rc = param->lcut; 
- rc5 = rc*rc*rc*rc*rc; 
+ rc = param->lcut;
+ rc5 = rc*rc*rc*rc*rc;
  rc6 = rc5 * rc;
- cmi1 = param->cmn1; 
+ cmi1 = param->cmn1;
  cmi2 = param->cmn2;
- cmj1 = param->cml1; 
+ cmj1 = param->cml1;
  cmj2 = param->cml2;
  rf5 = 1.0/r5 - 1.0/rc5 + 5.0*(r-rc)/rc6;
  drf6 = 5.0/rc6 - 5.0/r6;
@@ -1619,12 +1619,12 @@ double PairComb::yasu_char(double *qf_fix, int &igroup)
   double potal,fac11,fac11e,sr1,sr2,sr3;
   int mr1,mr2,mr3,inty,nj;
 
-  
+
   double **x = atom->x;
   double *q = atom->q;
   int *type = atom->type;
   int *tag = atom->tag;
-  
+
   int inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
@@ -1675,7 +1675,7 @@ double PairComb::yasu_char(double *qf_fix, int &igroup)
 
       for (jj = 0; jj < jnum; jj++) {
         j = jlist[jj];
-	j &= NEIGHMASK;
+        j &= NEIGHMASK;
         jtag = tag[j];
 
         if (itag > jtag) {
@@ -1686,7 +1686,7 @@ double PairComb::yasu_char(double *qf_fix, int &igroup)
           if (x[j][2] < x[i][2]) continue;
           if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
           if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
-        } 
+        }
 
         jtype = map[type[j]];
         jq = q[j];
@@ -1701,11 +1701,11 @@ double PairComb::yasu_char(double *qf_fix, int &igroup)
         // long range q-dependent
 
         if (rsq1 > params[iparam_ij].lcutsq) continue;
-      
+
         inty = intype[itype][jtype];
-      
+
         // polynomial three-point interpolation
-      
+
         tri_point(rsq1,mr1,mr2,mr3,sr1,sr2,sr3,itype);
 
         // 1/r charge forces
@@ -1714,17 +1714,17 @@ double PairComb::yasu_char(double *qf_fix, int &igroup)
         fqi += jq * fqij;  qf[j] += iq * fqij;
 
         // field correction to self energy and charge force
-      
+
         qfo_field(&params[iparam_ij],rsq1,iq,jq,fqij,fqjj);
         fqi += fqij;
         qf[j] += fqjj;
       }
-      
+
         // three-body interactions
-	
+
       for (jj = 0; jj < jnum; jj++) {
         j = jlist[jj];
-	j &= NEIGHMASK;
+        j &= NEIGHMASK;
         jtype = map[type[j]];
         jq = q[j];
 
@@ -1736,21 +1736,21 @@ double PairComb::yasu_char(double *qf_fix, int &igroup)
         iparam_ij = elem2param[itype][jtype][jtype];
 
         if (rsq1 > params[iparam_ij].cutsq) continue;
-	nj ++;
+        nj ++;
 
         // charge force in Aij and Bij
-      
+
         qfo_short(&params[iparam_ij],i,nj,rsq1,iq,jq,fqij,fqjj);
         fqi += fqij;  qf[j] += fqjj;
       }
       qf[i] += fqi;
     }
   }
-  
+
   comm->reverse_comm_pair(this);
-  
+
   // sum charge force on each node and return it
-  
+
   double eneg = 0.0;
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
@@ -1773,14 +1773,14 @@ double PairComb::qfo_self(Param *param, double qi, double selfpot)
  double s4 = param->dl;
  double s5 = param->dm;
 
- self_d = 0.0; 
- qmin = param->QL1*0.90; 
+ self_d = 0.0;
+ qmin = param->QL1*0.90;
  qmax = param->QU1*0.90;
  if (qmax > 4.50 ) qmax = -0.70;
  cmin = cmax = 1000.0;
- 
+
  self_d = s1+qi*(2.0*(s2+selfpot)+qi*(3.0*s3+qi*(4.0*s4+qi*qi*6.0*s5)));
- 
+
  if (qi < qmin) {
    // char str[128];
    // sprintf(str,"Pair COMB charge %.10f with force %.10f hit min barrier",
@@ -1791,7 +1791,7 @@ double PairComb::qfo_self(Param *param, double qi, double selfpot)
  if (qi > qmax) {
    // char str[128];
    // sprintf(str,"Pair COMB charge %.10f with force %.10f hit max barrier",
-   //	   qi,self_d);
+   //           qi,self_d);
    // error->warning(FLERR,str,0);
    self_d += 4.0 * cmax * pow((qi-qmax),3.0);
  }
@@ -1802,14 +1802,14 @@ double PairComb::qfo_self(Param *param, double qi, double selfpot)
 /* ---------------------------------------------------------------------- */
 
 void PairComb::qfo_direct(int inty, int mr1, int mr2, int mr3,
-			  double rsq, double sr1, double sr2, 
-			  double sr3, double fac11e, double &fqij)
+                          double rsq, double sr1, double sr2,
+                          double sr3, double fac11e, double &fqij)
 {
  double r, erfcc, fafbn1, vm, esucon;
 
  r = sqrt(rsq);
  esucon=force->qqr2e;
- 
+
  // 1/r force (wrt q)
 
  erfcc = sr1*erpaw[mr1][0]   + sr2*erpaw[mr2][0]   + sr3*erpaw[mr3][0];
@@ -1821,7 +1821,7 @@ 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 &fqij, double &fqjj)
 {
  double r,r5,r6,rc,rc5,rc6;
  double cmi1,cmi2,cmj1,cmj2,rf5;
@@ -1848,7 +1848,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 iq, double jq, double &fqij, double &fqjj)
 {
   double r,tmp_fc,tmp_fc_d,tmp_exp1,tmp_exp2;
   double bigA,Asi,Asj,vrcs;
@@ -1886,32 +1886,32 @@ void PairComb::qfo_short(Param *param, int i, int j, double rsq,
     else if (cor_flag) {
       rslp = ((arr1-r)/(arr1-arr2));
       rslp2 = rslp * rslp; rslp4 = rslp2 * rslp2;
-      vrcs = fc2j * fc3j * romi * ((50.0*rslp4-30.0*rslp2+4.50))/8.0; 
+      vrcs = fc2j * fc3j * romi * ((50.0*rslp4-30.0*rslp2+4.50))/8.0;
     }
   }
-  
+
   Di = param->DU1 + pow(fabs(param->bD1*(param->QU1-qi)),param->nD1);
   Dj = param->DU2 + pow(fabs(param->bD2*(param->QU2-qj)),param->nD2);
-  
+
   Asi = param->biga1 * exp(param->lam11*Di);
   Asj = param->biga2 * exp(param->lam12*Dj);
   Bsi = param->bigb1 * exp(param->lam21*Di)*
     (param->aB1-fabs(pow(param->bB1*(qi-param->Qo1),10.0)));
   Bsj = param->bigb2 * exp(param->lam22*Dj)*
     (param->aB2-fabs(pow(param->bB2*(qj-param->Qo2),10.0)));
-  
+
   QUchi = (param->QU1-qi)*param->bD1;
   QUchj = (param->QU2-qj)*param->bD2;
   QOchi = (qi-param->Qo1)*param->bB1;
   QOchj = (qj-param->Qo2)*param->bB2;
-  
+
   if (QUchi == 0.0) YYDiqp = 0.0;
-  else YYDiqp = -param->nD1 * QUchi * param->bD1 * 
-	 pow(fabs(QUchi),(param->nD1-2.0));
+  else YYDiqp = -param->nD1 * QUchi * param->bD1 *
+         pow(fabs(QUchi),(param->nD1-2.0));
 
   if (QUchj == 0.0) YYDjqp = 0.0;
-  else YYDjqp = -param->nD2 * QUchj * param->bD2 * 
-	 pow(fabs(QUchj),(param->nD2-2.0));
+  else YYDjqp = -param->nD2 * QUchj * param->bD2 *
+         pow(fabs(QUchj),(param->nD2-2.0));
 
   YYAsiqp = Asi * param->lam11 * YYDiqp;
   YYAsjqp = Asj * param->lam12 * YYDjqp;
@@ -1933,10 +1933,10 @@ void PairComb::qfo_short(Param *param, int i, int j, double rsq,
 
   if (Bsi > 0.0 && Bsj > 0.0) cbj = 1.0/(2.0*sqrt(Bsi*Bsj)) * romib ;
   else cbj = 0.0;
-  
+
   cfqr =  0.50 * tmp_fc * (1.0 + vrcs); // 0.5 b/c full atom loop
   cfqs = -0.50 * tmp_fc *  bij;
-  
+
   ca1 = Asj * caj * YYAsiqp;
   ca2 = Bsj * cbj * YYBsiqp;
   ca3 = Asi * caj * YYAsjqp;
@@ -1951,7 +1951,7 @@ void PairComb::qfo_short(Param *param, int i, int j, double rsq,
 /* ---------------------------------------------------------------------- */
 
 void PairComb::Over_cor(Param *param, double rsq1, int NCoi,
-			double &Eov, double &Fov)
+                        double &Eov, double &Fov)
 {
   double ECo,BCo,tmp_fc,tmp_fc_d;
   double r = sqrt(rsq1);
@@ -1962,12 +1962,12 @@ void PairComb::Over_cor(Param *param, double rsq1, int NCoi,
   Eov = 0.0; Fov = 0.0;
   ECo = param->hfocor;
   BCo = 0.1;
-  
+
   if (NCon >= 0.20) {
     Eov = tmp_fc * ECo * NCon/(1.0+exp(BCo*NCon));
     Fov = -(tmp_fc_d*Eov + tmp_fc*ECo/(1.0+exp(BCo*NCon)) -
-	    (tmp_fc*ECo*NCon*BCo*exp(BCo*NCon)) /
-	    ((1.0+exp(BCo*NCon))*(1.0+exp(BCo*NCon))));
+            (tmp_fc*ECo*NCon*BCo*exp(BCo*NCon)) /
+            ((1.0+exp(BCo*NCon))*(1.0+exp(BCo*NCon))));
     Fov /= r;
   }
 }
@@ -1984,46 +1984,46 @@ int PairComb::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
     buf[m++] = qf[j];
   }
   return 1;
-}   
-    
+}
+
 /* ---------------------------------------------------------------------- */
-    
+
 void PairComb::unpack_comm(int n, int first, double *buf)
-{   
+{
   int i,m,last;
-  
-  m = 0; 
+
+  m = 0;
   last = first + n ;
   for (i = first; i < last; i++) qf[i] = buf[m++];
-} 
+}
 
 /* ---------------------------------------------------------------------- */
 
 int PairComb::pack_reverse_comm(int n, int first, double *buf)
 {
   int i,m,last;
-  
+
   m = 0;
-  last = first + n; 
+  last = first + n;
   for (i = first; i < last; i++) buf[m++] = qf[i];
   return 1;
-}   
-    
+}
+
 /* ---------------------------------------------------------------------- */
-    
+
 void PairComb::unpack_reverse_comm(int n, int *list, double *buf)
-{   
+{
   int i,j,m;
 
-  m = 0; 
+  m = 0;
   for (i = 0; i < n; i++) {
     j = list[i];
     qf[j] += buf[m++];
   }
-} 
+}
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairComb::memory_usage()
@@ -2053,7 +2053,7 @@ void PairComb::Short_neigh()
     memory->sfree(sht_first);
     nmax = atom->nmax;
     sht_first = (int **) memory->smalloc(nmax*sizeof(int *),
-					 "pair:sht_first");
+                                         "pair:sht_first");
     memory->grow(sht_num,nmax,"pair:sht_num");
     memory->grow(NCo,nmax,"pair:NCo");
     memory->grow(bbij,nmax,MAXNEIGH,"pair:bbij");
@@ -2075,7 +2075,7 @@ void PairComb::Short_neigh()
       npage++;
       if (npage == maxpage) add_pages();
     }
- 
+
     nj = 0;
     neighptrj = &pages[npage][npntj];
 
@@ -2095,7 +2095,7 @@ void PairComb::Short_neigh()
       delrj[1] = ytmp - x[j][1];
       delrj[2] = ztmp - x[j][2];
       rsq = vec3_dot(delrj,delrj);
-      
+
       if (rsq > cutmin) continue;
       neighptrj[nj++] = j;
     }
diff --git a/src/MANYBODY/pair_comb.h b/src/MANYBODY/pair_comb.h
index 3e05ba9b9c..3a073d4588 100644
--- a/src/MANYBODY/pair_comb.h
+++ b/src/MANYBODY/pair_comb.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -57,7 +57,7 @@ class PairComb : public Pair {
     int ielement,jelement,kelement;
     int powermint;
   };
-  
+
   double cutmax;                // max cutoff for all elements
   int nelements;                // # of unique elements
   char **elements;              // names of unique elements
@@ -80,16 +80,16 @@ class PairComb : public Pair {
   void allocate();
   virtual void read_file(char *);
   void setup();
-  virtual void repulsive(Param *, double, double &, int, 
-			 double &, double, double);
+  virtual void repulsive(Param *, double, double &, int,
+                         double &, double, double);
   double zeta(Param *, double, double, double *, double *);
-  void force_zeta(Param *, int, int, int, double, double, double, double, 
-		  double &, double &, double &);
+  void force_zeta(Param *, int, int, int, double, double, double, double,
+                  double &, double &, double &);
   void attractive(Param *, double, double, double, double *, double *,
-		  double *, double *, double *);
+                  double *, double *, double *);
   double elp(Param *, double, double, double *, double *);
-  void flp(Param *, double, double, double *, double *, double *, 
-	   double *, double *);
+  void flp(Param *, double, double, double *, double *, double *,
+           double *, double *);
   double comb_fc(double, Param *);
   double comb_fc_d(double, Param *);
   double comb_fc2(double);
@@ -101,8 +101,8 @@ class PairComb : public Pair {
   double comb_bij(double, Param *);
   double comb_bij_d(double, Param *);
 
-  inline double comb_gijk(const double costheta, 
-			  const Param * const param) const {
+  inline double comb_gijk(const double costheta,
+                          const Param * const param) const {
     const double comb_c = param->c * param->c;
     const double comb_d = param->d * param->d;
     const double hcth = param->h - costheta;
@@ -110,8 +110,8 @@ class PairComb : public Pair {
     return param->gamma*(1.0 + comb_c/comb_d - comb_c / (comb_d + hcth*hcth));
   }
 
-  inline double comb_gijk_d(const double costheta, 
-			    const Param * const param) const {
+  inline double comb_gijk_d(const double costheta,
+                            const Param * const param) const {
     const double comb_c = param->c * param->c;
     const double comb_d = param->d * param->d;
     const double hcth = param->h - costheta;
@@ -121,22 +121,22 @@ class PairComb : public Pair {
   }
 
   void comb_zetaterm_d(double, double *, double, double *, double,
-			       double *, double *, double *, Param *);
+                               double *, double *, double *, Param *);
   void costheta_d(double *, double, double *, double,
-		  double *, double *, double *);
+                  double *, double *, double *);
   double self(Param *, double, double);
   void sm_table();
   void potal_calc(double &, double &, double &);
-  void tri_point(double, int &, int &, int &, double &, double &, 
-		 double &, int &);
+  void tri_point(double, int &, int &, int &, double &, double &,
+                 double &, int &);
   void direct(int,int,int,int,double,double,double,double,double,double,
-	double,double,double,double &,double &);
+        double,double,double,double &,double &);
   void field(Param *,double,double,double,double &,double &);
   double qfo_self(Param *, double, double);
   void qfo_short(Param *, int, int, double, double, double,
-		  double &, double &);
-  void qfo_direct (int, int, int, int, double, double, double, double, 
-	double, double &);
+                  double &, double &);
+  void qfo_direct (int, int, int, int, double, double, double, double,
+        double, double &);
   void qfo_field(Param *, double,double ,double ,double &, double &);
   void qsolve(double *);
   void Over_cor(Param *, double, int, double &, double &);
@@ -150,7 +150,7 @@ class PairComb : public Pair {
   void add_pages(int howmany=1);
   void Short_neigh();
   int maxpage, pgsize, oneatom, **pages;
-  int *sht_num, **sht_first;	// short-range neighbor list
+  int *sht_num, **sht_first;        // short-range neighbor list
   double cutmin;
 
   // vector functions, inline for efficiency
@@ -159,18 +159,18 @@ class PairComb : public Pair {
     return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
   }
 
-  inline void vec3_add(const double x[3], const double y[3], 
-		       double * const z) const {
+  inline void vec3_add(const double x[3], const double y[3],
+                       double * const z) const {
     z[0] = x[0]+y[0];  z[1] = x[1]+y[1];  z[2] = x[2]+y[2];
   }
 
   inline void vec3_scale(const double k, const double x[3],
-			 double y[3]) const {
+                         double y[3]) const {
     y[0] = k*x[0];  y[1] = k*x[1];  y[2] = k*x[2];
   }
 
-  inline void vec3_scaleadd(const double k, const double x[3], 
-			    const double y[3], double * const z) const {
+  inline void vec3_scaleadd(const double k, const double x[3],
+                            const double y[3], double * const z) const {
     z[0] = k*x[0]+y[0];
     z[1] = k*x[1]+y[1];
     z[2] = k*x[2]+y[2];
diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp
index 7ccb61c776..3f6972bc5e 100644
--- a/src/MANYBODY/pair_eam.cpp
+++ b/src/MANYBODY/pair_eam.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -154,7 +154,7 @@ void PairEAM::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // zero out density
 
   if (newton_pair) {
@@ -184,18 +184,18 @@ void PairEAM::compute(int eflag, int vflag)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cutforcesq) {
-	jtype = type[j];
-	p = sqrt(rsq)*rdr + 1.0;
-	m = static_cast<int> (p);
-	m = MIN(m,nr-1);
-	p -= m;
-	p = MIN(p,1.0);
-	coeff = rhor_spline[type2rhor[jtype][itype]][m];
-	rho[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
-	if (newton_pair || j < nlocal) {
-	  coeff = rhor_spline[type2rhor[itype][jtype]][m];
-	  rho[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
-	}
+        jtype = type[j];
+        p = sqrt(rsq)*rdr + 1.0;
+        m = static_cast<int> (p);
+        m = MIN(m,nr-1);
+        p -= m;
+        p = MIN(p,1.0);
+        coeff = rhor_spline[type2rhor[jtype][itype]][m];
+        rho[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        if (newton_pair || j < nlocal) {
+          coeff = rhor_spline[type2rhor[itype][jtype]][m];
+          rho[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        }
       }
     }
   }
@@ -250,50 +250,50 @@ void PairEAM::compute(int eflag, int vflag)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cutforcesq) {
-	jtype = type[j];
-	r = sqrt(rsq);
-	p = r*rdr + 1.0;
-	m = static_cast<int> (p);
-	m = MIN(m,nr-1);
-	p -= m;
-	p = MIN(p,1.0);
-
-	// rhoip = derivative of (density at atom j due to atom i)
-	// rhojp = derivative of (density at atom i due to atom j)
-	// phi = pair potential energy
-	// phip = phi'
-	// z2 = phi * r
-	// z2p = (phi * r)' = (phi' r) + phi
-	// psip needs both fp[i] and fp[j] terms since r_ij appears in two
-	//   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
-	//   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
-
-	coeff = rhor_spline[type2rhor[itype][jtype]][m];
-	rhoip = (coeff[0]*p + coeff[1])*p + coeff[2];
-	coeff = rhor_spline[type2rhor[jtype][itype]][m];
-	rhojp = (coeff[0]*p + coeff[1])*p + coeff[2];
-	coeff = z2r_spline[type2z2r[itype][jtype]][m];
-	z2p = (coeff[0]*p + coeff[1])*p + coeff[2];
-	z2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
-
-	recip = 1.0/r;
-	phi = z2*recip;
-	phip = z2p*recip - phi*recip;
-	psip = fp[i]*rhojp + fp[j]*rhoip + phip;
-	fpair = -psip*recip;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) evdwl = phi;
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        jtype = type[j];
+        r = sqrt(rsq);
+        p = r*rdr + 1.0;
+        m = static_cast<int> (p);
+        m = MIN(m,nr-1);
+        p -= m;
+        p = MIN(p,1.0);
+
+        // rhoip = derivative of (density at atom j due to atom i)
+        // rhojp = derivative of (density at atom i due to atom j)
+        // phi = pair potential energy
+        // phip = phi'
+        // z2 = phi * r
+        // z2p = (phi * r)' = (phi' r) + phi
+        // psip needs both fp[i] and fp[j] terms since r_ij appears in two
+        //   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
+        //   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
+
+        coeff = rhor_spline[type2rhor[itype][jtype]][m];
+        rhoip = (coeff[0]*p + coeff[1])*p + coeff[2];
+        coeff = rhor_spline[type2rhor[jtype][itype]][m];
+        rhojp = (coeff[0]*p + coeff[1])*p + coeff[2];
+        coeff = z2r_spline[type2z2r[itype][jtype]][m];
+        z2p = (coeff[0]*p + coeff[1])*p + coeff[2];
+        z2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+
+        recip = 1.0/r;
+        phi = z2*recip;
+        phip = z2p*recip - phi*recip;
+        psip = fp[i]*rhojp + fp[j]*rhoip + phip;
+        fpair = -psip*recip;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) evdwl = phi;
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -360,7 +360,7 @@ void PairEAM::coeff(int narg, char **arg)
 
   if (ifuncfl == nfuncfl) {
     nfuncfl++;
-    funcfl = (Funcfl *) 
+    funcfl = (Funcfl *)
       memory->srealloc(funcfl,nfuncfl*sizeof(Funcfl),"pair:funcfl");
     read_file(arg[2]);
     int n = strlen(arg[2]) + 1;
@@ -375,10 +375,10 @@ void PairEAM::coeff(int narg, char **arg)
   for (int i = ilo; i <= ihi; i++) {
     for (int j = MAX(jlo,i); j <= jhi; j++) {
       if (i == j) {
-	setflag[i][i] = 1;
-	map[i] = ifuncfl;
-	atom->set_mass(i,funcfl[ifuncfl].mass);
-	count++;
+        setflag[i][i] = 1;
+        map[i] = ifuncfl;
+        atom->set_mass(i,funcfl[ifuncfl].mass);
+        count++;
       }
     }
   }
@@ -450,7 +450,7 @@ void PairEAM::read_file(char *filename)
     sscanf(line,"%d %lg",&tmp,&file->mass);
     fgets(line,MAXLINE,fptr);
     sscanf(line,"%d %lg %d %lg %lg",
-	   &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
+           &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
   }
 
   MPI_Bcast(&file->mass,1,MPI_DOUBLE,0,world);
@@ -518,7 +518,7 @@ void PairEAM::file2array()
 
   // allocate frho arrays
   // nfrho = # of funcfl files + 1 for zero array
-  
+
   nfrho = nfuncfl + 1;
   memory->destroy(frho);
   memory->create(frho,nfrho,nrho+1,"pair:frho");
@@ -526,7 +526,7 @@ void PairEAM::file2array()
   // interpolate each file's frho to a single grid and cutoff
 
   double r,p,cof1,cof2,cof3,cof4;
-  
+
   n = 0;
   for (i = 0; i < nfuncfl; i++) {
     Funcfl *file = &funcfl[i];
@@ -542,8 +542,8 @@ void PairEAM::file2array()
       cof2 = 0.5*(p*p-1.0)*(p-2.0);
       cof3 = -0.5*p*(p+1.0)*(p-2.0);
       cof4 = sixth*p*(p*p-1.0);
-      frho[n][m] = cof1*file->frho[k-1] + cof2*file->frho[k] + 
-	cof3*file->frho[k+1] + cof4*file->frho[k+2];
+      frho[n][m] = cof1*file->frho[k-1] + cof2*file->frho[k] +
+        cof3*file->frho[k+1] + cof4*file->frho[k+2];
     }
     n++;
   }
@@ -590,7 +590,7 @@ void PairEAM::file2array()
       cof3 = -0.5*p*(p+1.0)*(p-2.0);
       cof4 = sixth*p*(p*p-1.0);
       rhor[n][m] = cof1*file->rhor[k-1] + cof2*file->rhor[k] +
-	cof3*file->rhor[k+1] + cof4*file->rhor[k+2];
+        cof3*file->rhor[k+1] + cof4*file->rhor[k+2];
     }
     n++;
   }
@@ -626,35 +626,35 @@ void PairEAM::file2array()
       Funcfl *jfile = &funcfl[j];
 
       for (m = 1; m <= nr; m++) {
-	r = (m-1)*dr;
-
-	p = r/ifile->dr + 1.0;
-	k = static_cast<int> (p);
-	k = MIN(k,ifile->nr-2);
-	k = MAX(k,2);
-	p -= k;
-	p = MIN(p,2.0);
-	cof1 = -sixth*p*(p-1.0)*(p-2.0);
-	cof2 = 0.5*(p*p-1.0)*(p-2.0);
-	cof3 = -0.5*p*(p+1.0)*(p-2.0);
-	cof4 = sixth*p*(p*p-1.0);
-	zri = cof1*ifile->zr[k-1] + cof2*ifile->zr[k] +
-	  cof3*ifile->zr[k+1] + cof4*ifile->zr[k+2];
-
-	p = r/jfile->dr + 1.0;
-	k = static_cast<int> (p);
-	k = MIN(k,jfile->nr-2);
-	k = MAX(k,2);
-	p -= k;
-	p = MIN(p,2.0);
-	cof1 = -sixth*p*(p-1.0)*(p-2.0);
-	cof2 = 0.5*(p*p-1.0)*(p-2.0);
-	cof3 = -0.5*p*(p+1.0)*(p-2.0);
-	cof4 = sixth*p*(p*p-1.0);
-	zrj = cof1*jfile->zr[k-1] + cof2*jfile->zr[k] +
-	  cof3*jfile->zr[k+1] + cof4*jfile->zr[k+2];
-
-	z2r[n][m] = 27.2*0.529 * zri*zrj;
+        r = (m-1)*dr;
+
+        p = r/ifile->dr + 1.0;
+        k = static_cast<int> (p);
+        k = MIN(k,ifile->nr-2);
+        k = MAX(k,2);
+        p -= k;
+        p = MIN(p,2.0);
+        cof1 = -sixth*p*(p-1.0)*(p-2.0);
+        cof2 = 0.5*(p*p-1.0)*(p-2.0);
+        cof3 = -0.5*p*(p+1.0)*(p-2.0);
+        cof4 = sixth*p*(p*p-1.0);
+        zri = cof1*ifile->zr[k-1] + cof2*ifile->zr[k] +
+          cof3*ifile->zr[k+1] + cof4*ifile->zr[k+2];
+
+        p = r/jfile->dr + 1.0;
+        k = static_cast<int> (p);
+        k = MIN(k,jfile->nr-2);
+        k = MAX(k,2);
+        p -= k;
+        p = MIN(p,2.0);
+        cof1 = -sixth*p*(p-1.0)*(p-2.0);
+        cof2 = 0.5*(p*p-1.0)*(p-2.0);
+        cof3 = -0.5*p*(p+1.0)*(p-2.0);
+        cof4 = sixth*p*(p*p-1.0);
+        zrj = cof1*jfile->zr[k-1] + cof2*jfile->zr[k] +
+          cof3*jfile->zr[k+1] + cof4*jfile->zr[k+2];
+
+        z2r[n][m] = 27.2*0.529 * zri*zrj;
       }
       n++;
     }
@@ -674,12 +674,12 @@ void PairEAM::file2array()
       irow = map[i];
       icol = map[j];
       if (irow == -1 || icol == -1) {
-	type2z2r[i][j] = 0;
-	continue;
+        type2z2r[i][j] = 0;
+        continue;
       }
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
@@ -724,21 +724,21 @@ void PairEAM::interpolate(int n, double delta, double *f, double **spline)
   spline[2][5] = 0.5 * (spline[3][6]-spline[1][6]);
   spline[n-1][5] = 0.5 * (spline[n][6]-spline[n-2][6]);
   spline[n][5] = spline[n][6] - spline[n-1][6];
-  
+
   for (int m = 3; m <= n-2; m++)
-    spline[m][5] = ((spline[m-2][6]-spline[m+2][6]) + 
-		    8.0*(spline[m+1][6]-spline[m-1][6])) / 12.0;
-  
+    spline[m][5] = ((spline[m-2][6]-spline[m+2][6]) +
+                    8.0*(spline[m+1][6]-spline[m-1][6])) / 12.0;
+
   for (int m = 1; m <= n-1; m++) {
-    spline[m][4] = 3.0*(spline[m+1][6]-spline[m][6]) - 
+    spline[m][4] = 3.0*(spline[m+1][6]-spline[m][6]) -
       2.0*spline[m][5] - spline[m+1][5];
-    spline[m][3] = spline[m][5] + spline[m+1][5] - 
+    spline[m][3] = spline[m][5] + spline[m+1][5] -
       2.0*(spline[m+1][6]-spline[m][6]);
   }
-  
+
   spline[n][4] = 0.0;
   spline[n][3] = 0.0;
-  
+
   for (int m = 1; m <= n; m++) {
     spline[m][2] = spline[m][5]/delta;
     spline[m][1] = 2.0*spline[m][4]/delta;
@@ -769,8 +769,8 @@ void PairEAM::grab(FILE *fptr, int n, double *list)
 /* ---------------------------------------------------------------------- */
 
 double PairEAM::single(int i, int j, int itype, int jtype,
-		       double rsq, double factor_coul, double factor_lj,
-		       double &fforce)
+                       double rsq, double factor_coul, double factor_lj,
+                       double &fforce)
 {
   int m;
   double r,p,rhoip,rhojp,z2,z2p,recip,phi,phip,psip;
@@ -782,7 +782,7 @@ double PairEAM::single(int i, int j, int itype, int jtype,
   m = MIN(m,nr-1);
   p -= m;
   p = MIN(p,1.0);
-  
+
   coeff = rhor_spline[type2rhor[itype][jtype]][m];
   rhoip = (coeff[0]*p + coeff[1])*p + coeff[2];
   coeff = rhor_spline[type2rhor[jtype][itype]][m];
@@ -851,7 +851,7 @@ void PairEAM::unpack_reverse_comm(int n, int *list, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairEAM::memory_usage()
diff --git a/src/MANYBODY/pair_eam.h b/src/MANYBODY/pair_eam.h
index 8c4bec4e03..e91e73b5d5 100644
--- a/src/MANYBODY/pair_eam.h
+++ b/src/MANYBODY/pair_eam.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MANYBODY/pair_eam_alloy.cpp b/src/MANYBODY/pair_eam_alloy.cpp
index 5b6cd72f51..0f926a8cb7 100644
--- a/src/MANYBODY/pair_eam_alloy.cpp
+++ b/src/MANYBODY/pair_eam_alloy.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -96,9 +96,9 @@ void PairEAMAlloy::coeff(int narg, char **arg)
   for (i = 1; i <= n; i++) {
     for (j = i; j <= n; j++) {
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
-	count++;
+        setflag[i][j] = 1;
+        if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
+        count++;
       }
     }
   }
@@ -147,7 +147,7 @@ void PairEAMAlloy::read_file(char *filename)
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
     error->all(FLERR,"Incorrect element names in EAM potential file");
-  
+
   char **words = new char*[file->nelements+1];
   nwords = 0;
   strtok(line," \t\n\r\f");
@@ -164,7 +164,7 @@ void PairEAMAlloy::read_file(char *filename)
   if (me == 0) {
     fgets(line,MAXLINE,fptr);
     sscanf(line,"%d %lg %d %lg %lg",
-	   &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
+           &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
   }
 
   MPI_Bcast(&file->nrho,1,MPI_INT,0,world);
@@ -177,7 +177,7 @@ void PairEAMAlloy::read_file(char *filename)
   memory->create(file->frho,file->nelements,file->nrho+1,"pair:frho");
   memory->create(file->rhor,file->nelements,file->nr+1,"pair:rhor");
   memory->create(file->z2r,file->nelements,file->nelements,file->nr+1,
-		 "pair:z2r");
+                 "pair:z2r");
 
   int i,j,tmp;
   for (i = 0; i < file->nelements; i++) {
@@ -226,7 +226,7 @@ void PairEAMAlloy::file2array()
 
   // allocate frho arrays
   // nfrho = # of setfl elements + 1 for zero array
-  
+
   nfrho = setfl->nelements + 1;
   memory->destroy(frho);
   memory->create(frho,nfrho,nrho+1,"pair:frho");
@@ -307,12 +307,12 @@ void PairEAMAlloy::file2array()
       irow = map[i];
       icol = map[j];
       if (irow == -1 || icol == -1) {
-	type2z2r[i][j] = 0;
-	continue;
+        type2z2r[i][j] = 0;
+        continue;
       }
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
diff --git a/src/MANYBODY/pair_eam_alloy.h b/src/MANYBODY/pair_eam_alloy.h
index 96abbf2efe..986f4bbb30 100644
--- a/src/MANYBODY/pair_eam_alloy.h
+++ b/src/MANYBODY/pair_eam_alloy.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MANYBODY/pair_eam_fs.cpp b/src/MANYBODY/pair_eam_fs.cpp
index 0ac0768b98..29f787b296 100644
--- a/src/MANYBODY/pair_eam_fs.cpp
+++ b/src/MANYBODY/pair_eam_fs.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -96,9 +96,9 @@ void PairEAMFS::coeff(int narg, char **arg)
   for (i = 1; i <= n; i++) {
     for (j = i; j <= n; j++) {
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	if (i == j) atom->set_mass(i,fs->mass[map[i]]);
-	count++;
+        setflag[i][j] = 1;
+        if (i == j) atom->set_mass(i,fs->mass[map[i]]);
+        count++;
       }
     }
   }
@@ -147,7 +147,7 @@ void PairEAMFS::read_file(char *filename)
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
     error->all(FLERR,"Incorrect element names in EAM potential file");
-  
+
   char **words = new char*[file->nelements+1];
   nwords = 0;
   strtok(line," \t\n\r\f");
@@ -164,7 +164,7 @@ void PairEAMFS::read_file(char *filename)
   if (me == 0) {
     fgets(line,MAXLINE,fptr);
     sscanf(line,"%d %lg %d %lg %lg",
-	   &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
+           &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
   }
 
   MPI_Bcast(&file->nrho,1,MPI_INT,0,world);
@@ -175,11 +175,11 @@ void PairEAMFS::read_file(char *filename)
 
   file->mass = new double[file->nelements];
   memory->create(file->frho,file->nelements,file->nrho+1,
-					      "pair:frho");
+                                              "pair:frho");
   memory->create(file->rhor,file->nelements,file->nelements,
-		 file->nr+1,"pair:rhor");
+                 file->nr+1,"pair:rhor");
   memory->create(file->z2r,file->nelements,file->nelements,
-		 file->nr+1,"pair:z2r");
+                 file->nr+1,"pair:z2r");
 
   int i,j,tmp;
   for (i = 0; i < file->nelements; i++) {
@@ -231,7 +231,7 @@ void PairEAMFS::file2array()
 
   // allocate frho arrays
   // nfrho = # of fs elements + 1 for zero array
-  
+
   nfrho = fs->nelements + 1;
   memory->destroy(frho);
   memory->create(frho,nfrho,nrho+1,"pair:frho");
@@ -316,12 +316,12 @@ void PairEAMFS::file2array()
       irow = map[i];
       icol = map[j];
       if (irow == -1 || icol == -1) {
-	type2z2r[i][j] = 0;
-	continue;
+        type2z2r[i][j] = 0;
+        continue;
       }
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
diff --git a/src/MANYBODY/pair_eam_fs.h b/src/MANYBODY/pair_eam_fs.h
index b482e843e3..08cc07200d 100644
--- a/src/MANYBODY/pair_eam_fs.h
+++ b/src/MANYBODY/pair_eam_fs.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp
index a86fa2557c..f4418a25d2 100644
--- a/src/MANYBODY/pair_eim.cpp
+++ b/src/MANYBODY/pair_eim.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -85,7 +85,7 @@ PairEIM::~PairEIM()
 
   for (int i = 0; i < nelements; i++) delete [] elements[i];
   delete [] elements;
-  
+
   deallocate_setfl();
 
   delete [] negativity;
@@ -134,7 +134,7 @@ void PairEIM::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // zero out density
 
   if (newton_pair) {
@@ -172,17 +172,17 @@ void PairEIM::compute(int eflag, int vflag)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cutforcesq[itype][jtype]) {
-	p = sqrt(rsq)*rdr + 1.0;
-	m = static_cast<int> (p);
-	m = MIN(m,nr-1);
-	p -= m;
-	p = MIN(p,1.0);
-	coeff = Fij_spline[type2Fij[itype][jtype]][m];
-	rho[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
-	if (newton_pair || j < nlocal) {
-	  coeff = Fij_spline[type2Fij[jtype][itype]][m];
-	  rho[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
-	}
+        p = sqrt(rsq)*rdr + 1.0;
+        m = static_cast<int> (p);
+        m = MIN(m,nr-1);
+        p -= m;
+        p = MIN(p,1.0);
+        coeff = Fij_spline[type2Fij[itype][jtype]][m];
+        rho[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        if (newton_pair || j < nlocal) {
+          coeff = Fij_spline[type2Fij[jtype][itype]][m];
+          rho[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        }
       }
     }
   }
@@ -201,17 +201,17 @@ void PairEIM::compute(int eflag, int vflag)
     itype = type[i];
     jlist = firstneigh[i];
     jnum = numneigh[i];
- 
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
       jtype = type[j];
- 
+
       delx = xtmp - x[j][0];
       dely = ytmp - x[j][1];
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
- 
+
       if (rsq < cutforcesq[itype][jtype]) {
         p = sqrt(rsq)*rdr + 1.0;
         m = static_cast<int> (p);
@@ -221,8 +221,8 @@ void PairEIM::compute(int eflag, int vflag)
         coeff = Gij_spline[type2Gij[itype][jtype]][m];
         fp[i] += rho[j]*(((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6]);
         if (newton_pair || j < nlocal) {
-          fp[j] += rho[i]*(((coeff[3]*p + coeff[4])*p + coeff[5])*p + 
-			   coeff[6]);
+          fp[j] += rho[i]*(((coeff[3]*p + coeff[4])*p + coeff[5])*p +
+                           coeff[6]);
         }
       }
     }
@@ -373,7 +373,7 @@ void PairEIM::coeff(int narg, char **arg)
   nelements = narg - 3 - atom->ntypes;
   if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients");
   elements = new char*[nelements];
-  
+
   for (i = 0; i < nelements; i++) {
     n = strlen(arg[i+2]) + 1;
     elements[i] = new char[n];
@@ -412,9 +412,9 @@ void PairEIM::coeff(int narg, char **arg)
   for (i = 1; i <= n; i++)
     for (j = i; j <= n; j++)
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
-	count++;
+        setflag[i][j] = 1;
+        if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
+        count++;
       }
 
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
@@ -497,7 +497,7 @@ void PairEIM::read_file(char *filename)
   for (int i = 0; i < nelements; i++) {
     if (me == 0)
       if (!grabsingle(fptr,i))
-	error->one(FLERR,"Could not grab element entry from EIM potential file");
+        error->one(FLERR,"Could not grab element entry from EIM potential file");
     MPI_Bcast(&setfl->ielement[i],1,MPI_INT,0,world);
     MPI_Bcast(&setfl->mass[i],1,MPI_DOUBLE,0,world);
     MPI_Bcast(&setfl->negativity[i],1,MPI_DOUBLE,0,world);
@@ -515,7 +515,7 @@ void PairEIM::read_file(char *filename)
       else ij = nelements*(j+1) - (j+1)*(j+2)/2 + i;
       if (me == 0)
         if (grabpair(fptr,i,j) == 0)
-	  error->one(FLERR,"Could not grab pair entry from EIM potential file");
+          error->one(FLERR,"Could not grab pair entry from EIM potential file");
       MPI_Bcast(&setfl->rcutphiA[ij],1,MPI_DOUBLE,0,world);
       MPI_Bcast(&setfl->rcutphiR[ij],1,MPI_DOUBLE,0,world);
       MPI_Bcast(&setfl->Eb[ij],1,MPI_DOUBLE,0,world);
@@ -556,21 +556,21 @@ void PairEIM::read_file(char *filename)
           ij = nelements*(i+1) - (i+1)*(i+2)/2 + j;
         }
         setfl->cuts[i][j] = setfl->rcutphiA[ij];
-        if (setfl->cuts[i][j] < setfl->rcutphiR[ij]) 
-	  setfl->cuts[i][j] = setfl->rcutphiR[ij];
-        if (setfl->cuts[i][j] < setfl->rcutq[ij]) 
-	  setfl->cuts[i][j] = setfl->rcutq[ij];
-        if (setfl->cuts[i][j] < setfl->rcutsigma[ij]) 
-	  setfl->cuts[i][j] = setfl->rcutsigma[ij];
+        if (setfl->cuts[i][j] < setfl->rcutphiR[ij])
+          setfl->cuts[i][j] = setfl->rcutphiR[ij];
+        if (setfl->cuts[i][j] < setfl->rcutq[ij])
+          setfl->cuts[i][j] = setfl->rcutq[ij];
+        if (setfl->cuts[i][j] < setfl->rcutsigma[ij])
+          setfl->cuts[i][j] = setfl->rcutsigma[ij];
       }
     }
   }
-  
+
   memory->create(setfl->Fij,nelements,nelements,setfl->nr+1,"pair:Fij");
   memory->create(setfl->Gij,nelements,nelements,setfl->nr+1,"pair:Gij");
   memory->create(setfl->phiij,nelements,nelements,setfl->nr+1,"pair:phiij");
 
-  for (int i = 0; i < nelements; i++)  
+  for (int i = 0; i < nelements; i++)
     for (int j = 0; j < nelements; j++) {
       for (int k = 0; k < setfl->nr; k++) {
         if (i > j) {
@@ -701,11 +701,11 @@ void PairEIM::file2array()
     }
 
   // add extra Fij of zeroes for non-EIM types to point to (pair hybrid)
- 
+
   for (m = 1; m <= nr; m++) Fij[nFij-1][m] = 0.0;
- 
+
   // type2Fij[i][j] = which Fij array (0 to nFij-1) each type pair maps to
-  // setfl of Fij arrays 
+  // setfl of Fij arrays
   // value = n = sum over rows of matrix until reach irow,icol
   // if atom type doesn't point to element (non-EIM atom in pair hybrid)
   // then map it to last Fij array of zeroes
@@ -793,7 +793,7 @@ void PairEIM::file2array()
 
   for (m = 1; m <= nr; m++) phiij[nphiij-1][m] = 0.0;
 
-  // type2phiij[i][j] = which phiij array (0 to nphiij-1) 
+  // type2phiij[i][j] = which phiij array (0 to nphiij-1)
   //                    each type pair maps to
   // setfl of phiij arrays only fill lower triangular Nelement matrix
   // value = n = sum over rows of lower-triangular matrix until reach irow,icol
@@ -847,8 +847,8 @@ void PairEIM::array2spline()
 
 /* ---------------------------------------------------------------------- */
 
-void PairEIM::interpolate(int n, double delta, double *f, 
-			  double **spline, double origin)
+void PairEIM::interpolate(int n, double delta, double *f,
+                          double **spline, double origin)
 {
   for (int m = 1; m <= n; m++) spline[m][6] = f[m];
 
@@ -856,21 +856,21 @@ void PairEIM::interpolate(int n, double delta, double *f,
   spline[2][5] = 0.5 * (spline[3][6]-spline[1][6]);
   spline[n-1][5] = 0.5 * (spline[n][6]-spline[n-2][6]);
   spline[n][5] = 0.0;
-  
+
   for (int m = 3; m <= n-2; m++)
-    spline[m][5] = ((spline[m-2][6]-spline[m+2][6]) + 
-		    8.0*(spline[m+1][6]-spline[m-1][6])) / 12.0;
-  
+    spline[m][5] = ((spline[m-2][6]-spline[m+2][6]) +
+                    8.0*(spline[m+1][6]-spline[m-1][6])) / 12.0;
+
   for (int m = 1; m <= n-1; m++) {
-    spline[m][4] = 3.0*(spline[m+1][6]-spline[m][6]) - 
+    spline[m][4] = 3.0*(spline[m+1][6]-spline[m][6]) -
       2.0*spline[m][5] - spline[m+1][5];
-    spline[m][3] = spline[m][5] + spline[m+1][5] - 
+    spline[m][3] = spline[m][5] + spline[m+1][5] -
       2.0*(spline[m+1][6]-spline[m][6]);
   }
-  
+
   spline[n][4] = 0.0;
   spline[n][3] = 0.0;
-  
+
   for (int m = 1; m <= n; m++) {
     spline[m][2] = spline[m][5]/delta;
     spline[m][1] = 2.0*spline[m][4]/delta;
@@ -992,7 +992,7 @@ double PairEIM::funccutoff(double rp, double rc, double r)
 {
   double rbig = setfl->rbig;
   double rsmall = setfl->rsmall;
-  
+
   double a = (rsmall-rbig)/(rc-rp)*(r-rp)+rbig;
   a = erfc(a);
   double b = erfc(rbig);
@@ -1013,9 +1013,9 @@ double PairEIM::funcphi(int i, int j, double r)
   else ij = nelements*(j+1) - (j+1)*(j+2)/2 + i;
   if (r < 0.2) r = 0.2;
   if (setfl->tp[ij] == 1) {
-    double a = setfl->Eb[ij]*setfl->alpha[ij] / 
+    double a = setfl->Eb[ij]*setfl->alpha[ij] /
       (setfl->beta[ij]-setfl->alpha[ij]);
-    double b = setfl->Eb[ij]*setfl->beta[ij] / 
+    double b = setfl->Eb[ij]*setfl->beta[ij] /
       (setfl->beta[ij]-setfl->alpha[ij]);
     if (r < setfl->rcutphiA[ij]) {
       value -= a*exp(-setfl->beta[ij]*(r/setfl->r0[ij]-1.0))*
@@ -1085,7 +1085,7 @@ double PairEIM::funccoul(int i, int j, double r)
 int PairEIM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
 {
   int i,j,m;
- 
+
   m = 0;
   if (rhofp == 1) {
     for (i = 0; i < n; i++) {
@@ -1107,7 +1107,7 @@ int PairEIM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
 void PairEIM::unpack_comm(int n, int first, double *buf)
 {
   int i,m,last;
- 
+
   m = 0;
   last = first + n;
   if (rhofp == 1) {
@@ -1148,7 +1148,7 @@ void PairEIM::unpack_reverse_comm(int n, int *list, double *buf)
       rho[j] += buf[m++];
     }
   }
-  if (rhofp == 2) { 
+  if (rhofp == 2) {
     for (i = 0; i < n; i++) {
       j = list[i];
       fp[j] += buf[m++];
@@ -1157,7 +1157,7 @@ void PairEIM::unpack_reverse_comm(int n, int *list, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairEIM::memory_usage()
diff --git a/src/MANYBODY/pair_eim.h b/src/MANYBODY/pair_eim.h
index f34cc6cc3f..687c61564b 100644
--- a/src/MANYBODY/pair_eim.h
+++ b/src/MANYBODY/pair_eim.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -71,7 +71,7 @@ class PairEIM : public Pair {
   int nFij,nGij,nphiij;
   double **Fij,**Gij,**phiij;
   int **type2Fij,**type2Gij,**type2phiij;
-  
+
   // potentials in spline form used for force computation
 
   double dr,rdr;
@@ -81,7 +81,7 @@ class PairEIM : public Pair {
   void allocate();
   void array2spline();
   void interpolate(int, double, double *, double **, double);
-  int grabglobal(FILE *); 
+  int grabglobal(FILE *);
   int grabsingle(FILE *, int);
   int grabpair(FILE *, int, int);
 
diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp
index 882cf1686d..97c1bfef0b 100644
--- a/src/MANYBODY/pair_lcbop.cpp
+++ b/src/MANYBODY/pair_lcbop.cpp
@@ -678,11 +678,11 @@ double PairLCBOP::bondorder(int i, int j, double rij[3],
         dNconj_dNij = 0;
         dNconj_dNji = 0;
         dNconj_dNel = 0;
-      } else {
+      } else {
         dNconj_dNij = (
             ( (Nji+1)*(Nij_el + Nji_el)-4)
             - Nconj*( (Nji+1)*(3-2*Nij) + Nji*(3-Nji) )
-          ) /den_Nconj;
+          ) /den_Nconj;
         dNconj_dNji = (
             ( (Nij+1)*(Nji_el + Nij_el)-4)
             - Nconj*( (Nij+1)*(3-2*Nji) + Nij*(3-Nij) )
diff --git a/src/MANYBODY/pair_rebo.cpp b/src/MANYBODY/pair_rebo.cpp
index efda8c2c9e..f2ca30df7f 100644
--- a/src/MANYBODY/pair_rebo.cpp
+++ b/src/MANYBODY/pair_rebo.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MANYBODY/pair_rebo.h b/src/MANYBODY/pair_rebo.h
index aefe145b26..75e9d80370 100644
--- a/src/MANYBODY/pair_rebo.h
+++ b/src/MANYBODY/pair_rebo.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp
index deae3cb26f..7af668d37f 100755
--- a/src/MANYBODY/pair_sw.cpp
+++ b/src/MANYBODY/pair_sw.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -118,13 +118,13 @@ void PairSW::compute(int eflag, int vflag)
       jtag = tag[j];
 
       if (itag > jtag) {
-	if ((itag+jtag) % 2 == 0) continue;
+        if ((itag+jtag) % 2 == 0) continue;
       } else if (itag < jtag) {
-	if ((itag+jtag) % 2 == 1) continue;
+        if ((itag+jtag) % 2 == 1) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
-	if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
+        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
       }
 
       jtype = map[type[j]];
@@ -147,7 +147,7 @@ void PairSW::compute(int eflag, int vflag)
       f[j][2] -= delz*fpair;
 
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,0.0,fpair,delx,dely,delz);
+                           evdwl,0.0,fpair,delx,dely,delz);
     }
 
     jnumm1 = jnum - 1;
@@ -164,32 +164,32 @@ void PairSW::compute(int eflag, int vflag)
       if (rsq1 > params[ijparam].cutsq) continue;
 
       for (kk = jj+1; kk < jnum; kk++) {
-	k = jlist[kk];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	delr2[0] = x[k][0] - xtmp;
-	delr2[1] = x[k][1] - ytmp;
-	delr2[2] = x[k][2] - ztmp;
-	rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
-	if (rsq2 > params[ikparam].cutsq) continue;
-
-	threebody(&params[ijparam],&params[ikparam],&params[ijkparam],
-		  rsq1,rsq2,delr1,delr2,fj,fk,eflag,evdwl);
-
-	f[i][0] -= fj[0] + fk[0];
-	f[i][1] -= fj[1] + fk[1];
-	f[i][2] -= fj[2] + fk[2];
-	f[j][0] += fj[0];
-	f[j][1] += fj[1];
-	f[j][2] += fj[2];
-	f[k][0] += fk[0];
-	f[k][1] += fk[1];
-	f[k][2] += fk[2];
-
-	if (evflag) ev_tally3(i,j,k,evdwl,0.0,fj,fk,delr1,delr2);
+        k = jlist[kk];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        delr2[0] = x[k][0] - xtmp;
+        delr2[1] = x[k][1] - ytmp;
+        delr2[2] = x[k][2] - ztmp;
+        rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
+        if (rsq2 > params[ikparam].cutsq) continue;
+
+        threebody(&params[ijparam],&params[ikparam],&params[ijkparam],
+                  rsq1,rsq2,delr1,delr2,fj,fk,eflag,evdwl);
+
+        f[i][0] -= fj[0] + fk[0];
+        f[i][1] -= fj[1] + fk[1];
+        f[i][2] -= fj[2] + fk[2];
+        f[j][0] += fj[0];
+        f[j][1] += fj[1];
+        f[j][2] += fj[2];
+        f[k][0] += fk[0];
+        f[k][1] += fk[1];
+        f[k][2] += fk[2];
+
+        if (evflag) ev_tally3(i,j,k,evdwl,0.0,fj,fk,delr1,delr2);
       }
     }
   }
@@ -211,7 +211,7 @@ void PairSW::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairSW::settings(int narg, char **arg)
@@ -267,7 +267,7 @@ void PairSW::coeff(int narg, char **arg)
   }
 
   // read potential file and initialize potential parameters
-  
+
   read_file(arg[2]);
   setup();
 
@@ -284,8 +284,8 @@ void PairSW::coeff(int narg, char **arg)
   for (int i = 1; i <= n; i++)
     for (int j = i; j <= n; j++)
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	count++;
+        setflag[i][j] = 1;
+        count++;
       }
 
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
@@ -355,8 +355,8 @@ void PairSW::read_file(char *file)
     if (comm->me == 0) {
       ptr = fgets(line,MAXLINE,fp);
       if (ptr == NULL) {
-	eof = 1;
-	fclose(fp);
+        eof = 1;
+        fclose(fp);
       } else n = strlen(line) + 1;
     }
     MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -377,8 +377,8 @@ void PairSW::read_file(char *file)
       if (comm->me == 0) {
         ptr = fgets(&line[n],MAXLINE-n,fp);
         if (ptr == NULL) {
-	  eof = 1;
-	  fclose(fp);
+          eof = 1;
+          fclose(fp);
         } else n = strlen(line) + 1;
       }
       MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -417,7 +417,7 @@ void PairSW::read_file(char *file)
     if (nparams == maxparam) {
       maxparam += DELTA;
       params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
-					  "pair:params");
+                                          "pair:params");
     }
 
     params[nparams].ielement = ielement;
@@ -435,11 +435,11 @@ void PairSW::read_file(char *file)
     params[nparams].powerq = atof(words[12]);
     params[nparams].tol = atof(words[13]);
 
-    if (params[nparams].epsilon < 0.0 || params[nparams].sigma < 0.0 || 
-	params[nparams].littlea < 0.0 || params[nparams].lambda < 0.0 ||
-	params[nparams].gamma < 0.0 || params[nparams].biga < 0.0 || 
-	params[nparams].bigb < 0.0 || params[nparams].powerp < 0.0 ||
-	params[nparams].powerq < 0.0 || params[nparams].tol < 0.0)
+    if (params[nparams].epsilon < 0.0 || params[nparams].sigma < 0.0 ||
+        params[nparams].littlea < 0.0 || params[nparams].lambda < 0.0 ||
+        params[nparams].gamma < 0.0 || params[nparams].biga < 0.0 ||
+        params[nparams].bigb < 0.0 || params[nparams].powerp < 0.0 ||
+        params[nparams].powerq < 0.0 || params[nparams].tol < 0.0)
       error->all(FLERR,"Illegal Stillinger-Weber parameter");
 
     nparams++;
@@ -465,16 +465,16 @@ void PairSW::setup()
   for (i = 0; i < nelements; i++)
     for (j = 0; j < nelements; j++)
       for (k = 0; k < nelements; k++) {
-	n = -1;
-	for (m = 0; m < nparams; m++) {
-	  if (i == params[m].ielement && j == params[m].jelement && 
-	      k == params[m].kelement) {
-	    if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
-	    n = m;
-	  }
-	}
-	if (n < 0) error->all(FLERR,"Potential file is missing an entry");
-	elem2param[i][j][k] = n;
+        n = -1;
+        for (m = 0; m < nparams; m++) {
+          if (i == params[m].ielement && j == params[m].jelement &&
+              k == params[m].kelement) {
+            if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
+            n = m;
+          }
+        }
+        if (n < 0) error->all(FLERR,"Potential file is missing an entry");
+        elem2param[i][j][k] = n;
       }
 
 
@@ -482,7 +482,7 @@ void PairSW::setup()
 
   // set cutsq using shortcut to reduce neighbor list for accelerated
   // calculations. cut must remain unchanged as it is a potential parameter
-  // (cut = a*sigma) 
+  // (cut = a*sigma)
 
   for (m = 0; m < nparams; m++) {
     params[m].cut = params[m].sigma*params[m].littlea;
@@ -493,24 +493,24 @@ void PairSW::setup()
       if (params[m].gamma < 1.0)
         rtmp = rtmp +
           params[m].gamma * params[m].sigma / log(params[m].tol);
-      else rtmp = rtmp +  
-	     params[m].sigma / log(params[m].tol);
+      else rtmp = rtmp +
+             params[m].sigma / log(params[m].tol);
     }
     params[m].cutsq = rtmp * rtmp;
 
     params[m].sigma_gamma = params[m].sigma*params[m].gamma;
     params[m].lambda_epsilon = params[m].lambda*params[m].epsilon;
     params[m].lambda_epsilon2 = 2.0*params[m].lambda*params[m].epsilon;
-    params[m].c1 = params[m].biga*params[m].epsilon * 
-      params[m].powerp*params[m].bigb * 
+    params[m].c1 = params[m].biga*params[m].epsilon *
+      params[m].powerp*params[m].bigb *
       pow(params[m].sigma,params[m].powerp);
-    params[m].c2 = params[m].biga*params[m].epsilon*params[m].powerq * 
+    params[m].c2 = params[m].biga*params[m].epsilon*params[m].powerq *
       pow(params[m].sigma,params[m].powerq);
-    params[m].c3 = params[m].biga*params[m].epsilon*params[m].bigb * 
+    params[m].c3 = params[m].biga*params[m].epsilon*params[m].bigb *
       pow(params[m].sigma,params[m].powerp+1.0);
-    params[m].c4 = params[m].biga*params[m].epsilon * 
+    params[m].c4 = params[m].biga*params[m].epsilon *
       pow(params[m].sigma,params[m].powerq+1.0);
-    params[m].c5 = params[m].biga*params[m].epsilon*params[m].bigb * 
+    params[m].c5 = params[m].biga*params[m].epsilon*params[m].bigb *
       pow(params[m].sigma,params[m].powerp);
     params[m].c6 = params[m].biga*params[m].epsilon *
       pow(params[m].sigma,params[m].powerq);
@@ -523,12 +523,12 @@ void PairSW::setup()
     rtmp = sqrt(params[m].cutsq);
     if (rtmp > cutmax) cutmax = rtmp;
   }
-}  
+}
 
 /* ---------------------------------------------------------------------- */
 
 void PairSW::twobody(Param *param, double rsq, double &fforce,
-		     int eflag, double &eng)
+                     int eflag, double &eng)
 {
   double r,rinvsq,rp,rq,rainv,rainvsq,expsrainv;
 
@@ -537,19 +537,19 @@ void PairSW::twobody(Param *param, double rsq, double &fforce,
   rp = pow(r,-param->powerp);
   rq = pow(r,-param->powerq);
   rainv = 1.0 / (r - param->cut);
-  rainvsq = rainv*rainv*r; 
+  rainvsq = rainv*rainv*r;
   expsrainv = exp(param->sigma * rainv);
   fforce = (param->c1*rp - param->c2*rq +
-	    (param->c3*rp -param->c4*rq) * rainvsq) * expsrainv * rinvsq;
+            (param->c3*rp -param->c4*rq) * rainvsq) * expsrainv * rinvsq;
   if (eflag) eng = (param->c5*rp - param->c6*rq) * expsrainv;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairSW::threebody(Param *paramij, Param *paramik, Param *paramijk,
-		       double rsq1, double rsq2,
-		       double *delr1, double *delr2,
-		       double *fj, double *fk, int eflag, double &eng)
+                       double rsq1, double rsq2,
+                       double *delr1, double *delr2,
+                       double *fj, double *fk, int eflag, double &eng)
 {
   double r1,rinvsq1,rainv1,gsrainv1,gsrainvsq1,expgsrainv1;
   double r2,rinvsq2,rainv2,gsrainv2,gsrainvsq2,expgsrainv2;
@@ -560,14 +560,14 @@ void PairSW::threebody(Param *paramij, Param *paramik, Param *paramijk,
   rinvsq1 = 1.0/rsq1;
   rainv1 = 1.0/(r1 - paramij->cut);
   gsrainv1 = paramij->sigma_gamma * rainv1;
-  gsrainvsq1 = gsrainv1*rainv1/r1; 
+  gsrainvsq1 = gsrainv1*rainv1/r1;
   expgsrainv1 = exp(gsrainv1);
 
   r2 = sqrt(rsq2);
   rinvsq2 = 1.0/rsq2;
   rainv2 = 1.0/(r2 - paramik->cut);
   gsrainv2 = paramik->sigma_gamma * rainv2;
-  gsrainvsq2 = gsrainv2*rainv2/r2; 
+  gsrainvsq2 = gsrainv2*rainv2/r2;
   expgsrainv2 = exp(gsrainv2);
 
   rinv12 = 1.0/(r1*r2);
@@ -587,11 +587,11 @@ void PairSW::threebody(Param *paramij, Param *paramik, Param *paramijk,
   facang12 = rinv12*facang;
   csfacang = cs*facang;
   csfac1 = rinvsq1*csfacang;
-  
+
   fj[0] = delr1[0]*(frad1+csfac1)-delr2[0]*facang12;
   fj[1] = delr1[1]*(frad1+csfac1)-delr2[1]*facang12;
   fj[2] = delr1[2]*(frad1+csfac1)-delr2[2]*facang12;
-  
+
   csfac2 = rinvsq2*csfacang;
 
   fk[0] = delr2[0]*(frad2+csfac2)-delr1[0]*facang12;
@@ -600,4 +600,3 @@ void PairSW::threebody(Param *paramij, Param *paramik, Param *paramijk,
 
   if (eflag) eng = facrad;
 }
-
diff --git a/src/MANYBODY/pair_sw.h b/src/MANYBODY/pair_sw.h
index 76b3d5528f..76db031dae 100755
--- a/src/MANYBODY/pair_sw.h
+++ b/src/MANYBODY/pair_sw.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -46,7 +46,7 @@ class PairSW : public Pair {
     double c1,c2,c3,c4,c5,c6;
     int ielement,jelement,kelement;
   };
-  
+
   double cutmax;                // max cutoff for all elements
   int nelements;                // # of unique elements
   char **elements;              // names of unique elements
@@ -61,7 +61,7 @@ class PairSW : public Pair {
   void setup();
   void twobody(Param *, double, double &, int, double &);
   void threebody(Param *, Param *, Param *, double, double, double *, double *,
-		 double *, double *, int, double &);
+                 double *, double *, int, double &);
 };
 
 }
diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp
index f284f12fd1..6c3c006b12 100755
--- a/src/MANYBODY/pair_tersoff.cpp
+++ b/src/MANYBODY/pair_tersoff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -120,13 +120,13 @@ void PairTersoff::compute(int eflag, int vflag)
       jtag = tag[j];
 
       if (itag > jtag) {
-	if ((itag+jtag) % 2 == 0) continue;
+        if ((itag+jtag) % 2 == 0) continue;
       } else if (itag < jtag) {
-	if ((itag+jtag) % 2 == 1) continue;
+        if ((itag+jtag) % 2 == 1) continue;
       } else {
-	if (x[j][2] < x[i][2]) continue;
-	if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
-	if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        if (x[j][2] < x[i][2]) continue;
+        if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
+        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
       }
 
       jtype = map[type[j]];
@@ -149,7 +149,7 @@ void PairTersoff::compute(int eflag, int vflag)
       f[j][2] -= delz*fpair;
 
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,0.0,fpair,delx,dely,delz);
+                           evdwl,0.0,fpair,delx,dely,delz);
     }
 
     // three-body interactions
@@ -172,19 +172,19 @@ void PairTersoff::compute(int eflag, int vflag)
       zeta_ij = 0.0;
 
       for (kk = 0; kk < jnum; kk++) {
-	if (jj == kk) continue;
-	k = jlist[kk];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	iparam_ijk = elem2param[itype][jtype][ktype];
-
-	delr2[0] = x[k][0] - xtmp;
-	delr2[1] = x[k][1] - ytmp;
-	delr2[2] = x[k][2] - ztmp;
-	rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
-	if (rsq2 > params[iparam_ijk].cutsq) continue;
-
-	zeta_ij += zeta(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
+        if (jj == kk) continue;
+        k = jlist[kk];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        iparam_ijk = elem2param[itype][jtype][ktype];
+
+        delr2[0] = x[k][0] - xtmp;
+        delr2[1] = x[k][1] - ytmp;
+        delr2[2] = x[k][2] - ztmp;
+        rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
+        if (rsq2 > params[iparam_ijk].cutsq) continue;
+
+        zeta_ij += zeta(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
       }
 
       // pairwise force due to zeta
@@ -199,37 +199,37 @@ void PairTersoff::compute(int eflag, int vflag)
       f[j][2] -= delr1[2]*fpair;
 
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,0.0,-fpair,-delr1[0],-delr1[1],-delr1[2]);
+                           evdwl,0.0,-fpair,-delr1[0],-delr1[1],-delr1[2]);
 
       // attractive term via loop over k
 
       for (kk = 0; kk < jnum; kk++) {
-	if (jj == kk) continue;
-	k = jlist[kk];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	iparam_ijk = elem2param[itype][jtype][ktype];
-
-	delr2[0] = x[k][0] - xtmp;
-	delr2[1] = x[k][1] - ytmp;
-	delr2[2] = x[k][2] - ztmp;
-	rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
-	if (rsq2 > params[iparam_ijk].cutsq) continue;
-
-	attractive(&params[iparam_ijk],prefactor,
-		   rsq1,rsq2,delr1,delr2,fi,fj,fk);
-
-	f[i][0] += fi[0];
-	f[i][1] += fi[1];
-	f[i][2] += fi[2];
-	f[j][0] += fj[0];
-	f[j][1] += fj[1];
-	f[j][2] += fj[2];
-	f[k][0] += fk[0];
-	f[k][1] += fk[1];
-	f[k][2] += fk[2];
-
-	if (vflag_atom) v_tally3(i,j,k,fj,fk,delr1,delr2);
+        if (jj == kk) continue;
+        k = jlist[kk];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        iparam_ijk = elem2param[itype][jtype][ktype];
+
+        delr2[0] = x[k][0] - xtmp;
+        delr2[1] = x[k][1] - ytmp;
+        delr2[2] = x[k][2] - ztmp;
+        rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
+        if (rsq2 > params[iparam_ijk].cutsq) continue;
+
+        attractive(&params[iparam_ijk],prefactor,
+                   rsq1,rsq2,delr1,delr2,fi,fj,fk);
+
+        f[i][0] += fi[0];
+        f[i][1] += fi[1];
+        f[i][2] += fi[2];
+        f[j][0] += fj[0];
+        f[j][1] += fj[1];
+        f[j][2] += fj[2];
+        f[k][0] += fk[0];
+        f[k][1] += fk[1];
+        f[k][2] += fk[2];
+
+        if (vflag_atom) v_tally3(i,j,k,fj,fk,delr1,delr2);
       }
     }
   }
@@ -251,7 +251,7 @@ void PairTersoff::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairTersoff::settings(int narg, char **arg)
@@ -307,7 +307,7 @@ void PairTersoff::coeff(int narg, char **arg)
   }
 
   // read potential file and initialize potential parameters
-  
+
   read_file(arg[2]);
   setup();
 
@@ -324,8 +324,8 @@ void PairTersoff::coeff(int narg, char **arg)
   for (int i = 1; i <= n; i++)
     for (int j = i; j <= n; j++)
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	count++;
+        setflag[i][j] = 1;
+        count++;
       }
 
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
@@ -394,8 +394,8 @@ void PairTersoff::read_file(char *file)
     if (comm->me == 0) {
       ptr = fgets(line,MAXLINE,fp);
       if (ptr == NULL) {
-	eof = 1;
-	fclose(fp);
+        eof = 1;
+        fclose(fp);
       } else n = strlen(line) + 1;
     }
     MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -416,8 +416,8 @@ void PairTersoff::read_file(char *file)
       if (comm->me == 0) {
         ptr = fgets(&line[n],MAXLINE-n,fp);
         if (ptr == NULL) {
-	  eof = 1;
-	  fclose(fp);
+          eof = 1;
+          fclose(fp);
         } else n = strlen(line) + 1;
       }
       MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -456,7 +456,7 @@ void PairTersoff::read_file(char *file)
     if (nparams == maxparam) {
       maxparam += DELTA;
       params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
-					  "pair:params");
+                                          "pair:params");
     }
 
     params[nparams].ielement = ielement;
@@ -481,15 +481,15 @@ void PairTersoff::read_file(char *file)
 
     params[nparams].powermint = int(params[nparams].powerm);
 
-    if (params[nparams].c < 0.0 || params[nparams].d < 0.0 || 
-	params[nparams].powern < 0.0 || params[nparams].beta < 0.0 || 
-	params[nparams].lam2 < 0.0 || params[nparams].bigb < 0.0 || 
-	params[nparams].bigr < 0.0 ||params[nparams].bigd < 0.0 ||
-	params[nparams].bigd > params[nparams].bigr ||
-	params[nparams].lam1 < 0.0 || params[nparams].biga < 0.0 ||
-	params[nparams].powerm - params[nparams].powermint != 0.0 ||
+    if (params[nparams].c < 0.0 || params[nparams].d < 0.0 ||
+        params[nparams].powern < 0.0 || params[nparams].beta < 0.0 ||
+        params[nparams].lam2 < 0.0 || params[nparams].bigb < 0.0 ||
+        params[nparams].bigr < 0.0 ||params[nparams].bigd < 0.0 ||
+        params[nparams].bigd > params[nparams].bigr ||
+        params[nparams].lam1 < 0.0 || params[nparams].biga < 0.0 ||
+        params[nparams].powerm - params[nparams].powermint != 0.0 ||
         (params[nparams].powermint != 3 && params[nparams].powermint != 1) ||
-	params[nparams].gamma < 0.0)
+        params[nparams].gamma < 0.0)
       error->all(FLERR,"Illegal Tersoff parameter");
 
     nparams++;
@@ -514,16 +514,16 @@ void PairTersoff::setup()
   for (i = 0; i < nelements; i++)
     for (j = 0; j < nelements; j++)
       for (k = 0; k < nelements; k++) {
-	n = -1;
-	for (m = 0; m < nparams; m++) {
-	  if (i == params[m].ielement && j == params[m].jelement && 
-	      k == params[m].kelement) {
-	    if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
-	    n = m;
-	  }
-	}
-	if (n < 0) error->all(FLERR,"Potential file is missing an entry");
-	elem2param[i][j][k] = n;
+        n = -1;
+        for (m = 0; m < nparams; m++) {
+          if (i == params[m].ielement && j == params[m].jelement &&
+              k == params[m].kelement) {
+            if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
+            n = m;
+          }
+        }
+        if (n < 0) error->all(FLERR,"Potential file is missing an entry");
+        elem2param[i][j][k] = n;
       }
 
 
@@ -544,12 +544,12 @@ void PairTersoff::setup()
   cutmax = 0.0;
   for (m = 0; m < nparams; m++)
     if (params[m].cut > cutmax) cutmax = params[m].cut;
-}  
+}
 
 /* ---------------------------------------------------------------------- */
 
 void PairTersoff::repulsive(Param *param, double rsq, double &fforce,
-			    int eflag, double &eng)
+                            int eflag, double &eng)
 {
   double r,tmp_fc,tmp_fc_d,tmp_exp;
 
@@ -564,14 +564,14 @@ void PairTersoff::repulsive(Param *param, double rsq, double &fforce,
 /* ---------------------------------------------------------------------- */
 
 double PairTersoff::zeta(Param *param, double rsqij, double rsqik,
-			 double *delrij, double *delrik)
+                         double *delrij, double *delrik)
 {
   double rij,rik,costheta,arg,ex_delr;
 
   rij = sqrt(rsqij);
   rik = sqrt(rsqik);
-  costheta = (delrij[0]*delrik[0] + delrij[1]*delrik[1] + 
-	      delrij[2]*delrik[2]) / (rij*rik);
+  costheta = (delrij[0]*delrik[0] + delrij[1]*delrik[1] +
+              delrij[2]*delrik[2]) / (rij*rik);
 
   if (param->powermint == 3) arg = pow(param->lam3 * (rij-rik),3.0);
   else arg = param->lam3 * (rij-rik);
@@ -579,15 +579,15 @@ double PairTersoff::zeta(Param *param, double rsqij, double rsqik,
   if (arg > 69.0776) ex_delr = 1.e30;
   else if (arg < -69.0776) ex_delr = 0.0;
   else ex_delr = exp(arg);
-  
+
   return ters_fc(rik,param) * ters_gijk(costheta,param) * ex_delr;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairTersoff::force_zeta(Param *param, double rsq, double zeta_ij,
-			     double &fforce, double &prefactor,
-			     int eflag, double &eng)
+                             double &fforce, double &prefactor,
+                             int eflag, double &eng)
 {
   double r,fa,fa_d,bij;
 
@@ -607,9 +607,9 @@ void PairTersoff::force_zeta(Param *param, double rsq, double zeta_ij,
 ------------------------------------------------------------------------- */
 
 void PairTersoff::attractive(Param *param, double prefactor,
-			     double rsqij, double rsqik,
-			     double *delrij, double *delrik,
-			     double *fi, double *fj, double *fk)
+                             double rsqij, double rsqik,
+                             double *delrij, double *delrik,
+                             double *fi, double *fj, double *fk)
 {
   double rij_hat[3],rik_hat[3];
   double rij,rijinv,rik,rikinv;
@@ -617,7 +617,7 @@ void PairTersoff::attractive(Param *param, double prefactor,
   rij = sqrt(rsqij);
   rijinv = 1.0/rij;
   vec3_scale(rijinv,delrij,rij_hat);
-  
+
   rik = sqrt(rsqik);
   rikinv = 1.0/rik;
   vec3_scale(rikinv,delrik,rik_hat);
@@ -631,7 +631,7 @@ double PairTersoff::ters_fc(double r, Param *param)
 {
   double ters_R = param->bigr;
   double ters_D = param->bigd;
-  
+
   if (r < ters_R-ters_D) return 1.0;
   if (r > ters_R+ters_D) return 0.0;
   return 0.5*(1.0 - sin(MY_PI2*(r - ters_R)/ters_D));
@@ -643,7 +643,7 @@ double PairTersoff::ters_fc_d(double r, Param *param)
 {
   double ters_R = param->bigr;
   double ters_D = param->bigd;
-  
+
   if (r < ters_R-ters_D) return 0.0;
   if (r > ters_R+ters_D) return 0.0;
   return -(MY_PI4/ters_D) * cos(MY_PI2*(r - ters_R)/ters_D);
@@ -655,7 +655,7 @@ double PairTersoff::ters_fa(double r, Param *param)
 {
   if (r > param->bigr + param->bigd) return 0.0;
   return -param->bigb * exp(-param->lam2 * r) * ters_fc(r,param);
-}   
+}
 
 /* ---------------------------------------------------------------------- */
 
@@ -687,13 +687,13 @@ double PairTersoff::ters_bij_d(double zeta, Param *param)
   double tmp = param->beta * zeta;
   if (tmp > param->c1) return param->beta * -0.5*pow(tmp,-1.5);
   if (tmp > param->c2)
-    return param->beta * (-0.5*pow(tmp,-1.5) * 
-			  (1.0 - 0.5*(1.0 +  1.0/(2.0*param->powern)) * 
-			   pow(tmp,-param->powern)));
+    return param->beta * (-0.5*pow(tmp,-1.5) *
+                          (1.0 - 0.5*(1.0 +  1.0/(2.0*param->powern)) *
+                           pow(tmp,-param->powern)));
   if (tmp < param->c4) return 0.0;
   if (tmp < param->c3)
     return -0.5*param->beta * pow(tmp,param->powern-1.0);
-			  
+
   double tmp_n = pow(tmp,param->powern);
   return -0.5 * pow(1.0+tmp_n, -1.0-(1.0/(2.0*param->powern)))*tmp_n / zeta;
 }
@@ -701,10 +701,10 @@ double PairTersoff::ters_bij_d(double zeta, Param *param)
 /* ---------------------------------------------------------------------- */
 
 void PairTersoff::ters_zetaterm_d(double prefactor,
-				  double *rij_hat, double rij,
-				  double *rik_hat, double rik,
-				  double *dri, double *drj, double *drk,
-				  Param *param)
+                                  double *rij_hat, double rij,
+                                  double *rik_hat, double rik,
+                                  double *dri, double *drj, double *drk,
+                                  Param *param)
 {
   double gijk,gijk_d,ex_delr,ex_delr_d,fc,dfc,cos_theta,tmp;
   double dcosdri[3],dcosdrj[3],dcosdrk[3];
@@ -760,8 +760,8 @@ void PairTersoff::ters_zetaterm_d(double prefactor,
 /* ---------------------------------------------------------------------- */
 
 void PairTersoff::costheta_d(double *rij_hat, double rij,
-			     double *rik_hat, double rik,
-			     double *dri, double *drj, double *drk)
+                             double *rik_hat, double rik,
+                             double *dri, double *drj, double *drk)
 {
   // first element is devative wrt Ri, second wrt Rj, third wrt Rk
 
diff --git a/src/MANYBODY/pair_tersoff.h b/src/MANYBODY/pair_tersoff.h
index b5902abba8..a2913b22f3 100755
--- a/src/MANYBODY/pair_tersoff.h
+++ b/src/MANYBODY/pair_tersoff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -48,7 +48,7 @@ class PairTersoff : public Pair {
     double Z_i,Z_j;
     double ZBLcut,ZBLexpscale;
   };
-  
+
   Param *params;                // parameter set for an I-J-K interaction
   char **elements;              // names of unique elements
   int ***elem2param;            // mapping from element triplets to parameters
@@ -63,10 +63,10 @@ class PairTersoff : public Pair {
   void setup();
   virtual void repulsive(Param *, double, double &, int, double &);
   double zeta(Param *, double, double, double *, double *);
-  virtual void force_zeta(Param *, double, double, double &, 
-			  double &, int, double &);
+  virtual void force_zeta(Param *, double, double, double &,
+                          double &, int, double &);
   void attractive(Param *, double, double, double, double *, double *,
-		  double *, double *, double *);
+                  double *, double *, double *);
 
   double ters_fc(double, Param *);
   double ters_fc_d(double, Param *);
@@ -76,14 +76,14 @@ class PairTersoff : public Pair {
   double ters_bij_d(double, Param *);
 
   void ters_zetaterm_d(double, double *, double, double *, double,
-			       double *, double *, double *, Param *);
+                               double *, double *, double *, Param *);
   void costheta_d(double *, double, double *, double,
-		  double *, double *, double *);
+                  double *, double *, double *);
 
   // inlined functions for efficiency
 
-  inline double ters_gijk(const double costheta, 
-			  const Param * const param) const {
+  inline double ters_gijk(const double costheta,
+                          const Param * const param) const {
     const double ters_c = param->c * param->c;
     const double ters_d = param->d * param->d;
     const double hcth = param->h - costheta;
@@ -91,8 +91,8 @@ class PairTersoff : public Pair {
     return param->gamma*(1.0 + ters_c/ters_d - ters_c / (ters_d + hcth*hcth));
   }
 
-  inline double ters_gijk_d(const double costheta, 
-			    const Param * const param) const {
+  inline double ters_gijk_d(const double costheta,
+                            const Param * const param) const {
     const double ters_c = param->c * param->c;
     const double ters_d = param->d * param->d;
     const double hcth = param->h - costheta;
@@ -105,18 +105,18 @@ class PairTersoff : public Pair {
     return x[0]*y[0] + x[1]*y[1] + x[2]*y[2];
   }
 
-  inline void vec3_add(const double x[3], const double y[3], 
-		       double * const z) const {
+  inline void vec3_add(const double x[3], const double y[3],
+                       double * const z) const {
     z[0] = x[0]+y[0];  z[1] = x[1]+y[1];  z[2] = x[2]+y[2];
   }
 
   inline void vec3_scale(const double k, const double x[3],
-			 double y[3]) const {
+                         double y[3]) const {
     y[0] = k*x[0];  y[1] = k*x[1];  y[2] = k*x[2];
   }
 
-  inline void vec3_scaleadd(const double k, const double x[3], 
-			    const double y[3], double * const z) const {
+  inline void vec3_scaleadd(const double k, const double x[3],
+                            const double y[3], double * const z) const {
     z[0] = k*x[0]+y[0];
     z[1] = k*x[1]+y[1];
     z[2] = k*x[2]+y[2];
diff --git a/src/MANYBODY/pair_tersoff_zbl.cpp b/src/MANYBODY/pair_tersoff_zbl.cpp
index d8e044e078..67633525e8 100644
--- a/src/MANYBODY/pair_tersoff_zbl.cpp
+++ b/src/MANYBODY/pair_tersoff_zbl.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -93,8 +93,8 @@ void PairTersoffZBL::read_file(char *file)
     if (comm->me == 0) {
       ptr = fgets(line,MAXLINE,fp);
       if (ptr == NULL) {
-	eof = 1;
-	fclose(fp);
+        eof = 1;
+        fclose(fp);
       } else n = strlen(line) + 1;
     }
     MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -115,8 +115,8 @@ void PairTersoffZBL::read_file(char *file)
       if (comm->me == 0) {
         ptr = fgets(&line[n],MAXLINE-n,fp);
         if (ptr == NULL) {
-	  eof = 1;
-	  fclose(fp);
+          eof = 1;
+          fclose(fp);
         } else n = strlen(line) + 1;
       }
       MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -155,7 +155,7 @@ void PairTersoffZBL::read_file(char *file)
     if (nparams == maxparam) {
       maxparam += DELTA;
       params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
-					  "pair:params");
+                                          "pair:params");
     }
 
     params[nparams].ielement = ielement;
@@ -185,18 +185,18 @@ void PairTersoffZBL::read_file(char *file)
     params[nparams].powermint = int(params[nparams].powerm);
 
     if (
-	params[nparams].lam3 < 0.0 || params[nparams].c < 0.0 || 
-	params[nparams].d < 0.0 || params[nparams].powern < 0.0 || 
-	params[nparams].beta < 0.0 || params[nparams].lam2 < 0.0 || 
-	params[nparams].bigb < 0.0 || params[nparams].bigr < 0.0 ||
-	params[nparams].bigd < 0.0 ||
-	params[nparams].bigd > params[nparams].bigr ||
-	params[nparams].lam3 < 0.0 || params[nparams].biga < 0.0 ||
-	params[nparams].powerm - params[nparams].powermint != 0.0 ||
+        params[nparams].lam3 < 0.0 || params[nparams].c < 0.0 ||
+        params[nparams].d < 0.0 || params[nparams].powern < 0.0 ||
+        params[nparams].beta < 0.0 || params[nparams].lam2 < 0.0 ||
+        params[nparams].bigb < 0.0 || params[nparams].bigr < 0.0 ||
+        params[nparams].bigd < 0.0 ||
+        params[nparams].bigd > params[nparams].bigr ||
+        params[nparams].lam3 < 0.0 || params[nparams].biga < 0.0 ||
+        params[nparams].powerm - params[nparams].powermint != 0.0 ||
         (params[nparams].powermint != 3 && params[nparams].powermint != 1) ||
-	params[nparams].gamma < 0.0 ||
-	params[nparams].Z_i < 1.0 || params[nparams].Z_j < 1.0 ||
-	params[nparams].ZBLcut < 0.0 || params[nparams].ZBLexpscale < 0.0)
+        params[nparams].gamma < 0.0 ||
+        params[nparams].Z_i < 1.0 || params[nparams].Z_j < 1.0 ||
+        params[nparams].ZBLcut < 0.0 || params[nparams].ZBLexpscale < 0.0)
       error->all(FLERR,"Illegal Tersoff parameter");
 
     nparams++;
@@ -208,7 +208,7 @@ void PairTersoffZBL::read_file(char *file)
 /* ---------------------------------------------------------------------- */
 
 void PairTersoffZBL::repulsive(Param *param, double rsq, double &fforce,
-			       int eflag, double &eng)
+                               int eflag, double &eng)
 {
   double r,tmp_fc,tmp_fc_d,tmp_exp;
 
@@ -220,29 +220,29 @@ void PairTersoffZBL::repulsive(Param *param, double rsq, double &fforce,
   tmp_exp = exp(-param->lam1 * r);
   double fforce_ters = param->biga * tmp_exp * (tmp_fc_d - tmp_fc*param->lam1);
   double eng_ters = tmp_fc * param->biga * tmp_exp;
-	
+
   // ZBL repulsive portion
 
   double esq = pow(global_e,2.0);
-  double a_ij = (0.8854*global_a_0) / 
+  double a_ij = (0.8854*global_a_0) /
     (pow(param->Z_i,0.23) + pow(param->Z_j,0.23));
   double premult = (param->Z_i * param->Z_j * esq)/(4.0*MY_PI*global_epsilon_0);
   double r_ov_a = r/a_ij;
-  double phi = 0.1818*exp(-3.2*r_ov_a) + 0.5099*exp(-0.9423*r_ov_a) + 
+  double phi = 0.1818*exp(-3.2*r_ov_a) + 0.5099*exp(-0.9423*r_ov_a) +
     0.2802*exp(-0.4029*r_ov_a) + 0.02817*exp(-0.2016*r_ov_a);
-  double dphi = (1.0/a_ij) * (-3.2*0.1818*exp(-3.2*r_ov_a) - 
-			      0.9423*0.5099*exp(-0.9423*r_ov_a) - 
-			      0.4029*0.2802*exp(-0.4029*r_ov_a) - 
-			      0.2016*0.02817*exp(-0.2016*r_ov_a));
+  double dphi = (1.0/a_ij) * (-3.2*0.1818*exp(-3.2*r_ov_a) -
+                              0.9423*0.5099*exp(-0.9423*r_ov_a) -
+                              0.4029*0.2802*exp(-0.4029*r_ov_a) -
+                              0.2016*0.02817*exp(-0.2016*r_ov_a));
   double fforce_ZBL = premult*-phi/rsq + premult*dphi/r;
   double eng_ZBL = premult*(1.0/r)*phi;
-  
+
   // combine two parts with smoothing by Fermi-like function
 
-  fforce = -(-F_fermi_d(r,param) * eng_ZBL + 
-	     (1.0 - F_fermi(r,param))*fforce_ZBL + 
-	     F_fermi_d(r,param)*eng_ters + F_fermi(r,param)*fforce_ters) / r;
-  
+  fforce = -(-F_fermi_d(r,param) * eng_ZBL +
+             (1.0 - F_fermi(r,param))*fforce_ZBL +
+             F_fermi_d(r,param)*eng_ters + F_fermi(r,param)*fforce_ters) / r;
+
   if (eflag)
     eng = (1.0 - F_fermi(r,param))*eng_ZBL + F_fermi(r,param)*eng_ters;
 }
@@ -252,9 +252,9 @@ void PairTersoffZBL::repulsive(Param *param, double rsq, double &fforce,
 double PairTersoffZBL::ters_fa(double r, Param *param)
 {
   if (r > param->bigr + param->bigd) return 0.0;
-  return -param->bigb * exp(-param->lam2 * r) * ters_fc(r,param) * 
+  return -param->bigb * exp(-param->lam2 * r) * ters_fc(r,param) *
     F_fermi(r,param);
-}   
+}
 
 /* ---------------------------------------------------------------------- */
 
@@ -262,8 +262,8 @@ double PairTersoffZBL::ters_fa_d(double r, Param *param)
 {
   if (r > param->bigr + param->bigd) return 0.0;
   return param->bigb * exp(-param->lam2 * r) *
-    (param->lam2 * ters_fc(r,param) * F_fermi(r,param) - 
-     ters_fc_d(r,param) * F_fermi(r,param) - ters_fc(r,param) * 
+    (param->lam2 * ters_fc(r,param) * F_fermi(r,param) -
+     ters_fc_d(r,param) * F_fermi(r,param) - ters_fc(r,param) *
      F_fermi_d(r,param));
 }
 
@@ -282,6 +282,6 @@ double PairTersoffZBL::F_fermi(double r, Param *param)
 
 double PairTersoffZBL::F_fermi_d(double r, Param *param)
 {
-  return param->ZBLexpscale*exp(-param->ZBLexpscale*(r-param->ZBLcut)) / 
+  return param->ZBLexpscale*exp(-param->ZBLexpscale*(r-param->ZBLcut)) /
     pow(1.0 + exp(-param->ZBLexpscale*(r-param->ZBLcut)),2.0);
 }
diff --git a/src/MANYBODY/pair_tersoff_zbl.h b/src/MANYBODY/pair_tersoff_zbl.h
index c464120983..01e296e92c 100755
--- a/src/MANYBODY/pair_tersoff_zbl.h
+++ b/src/MANYBODY/pair_tersoff_zbl.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -30,16 +30,16 @@ class PairTersoffZBL : public PairTersoff {
   ~PairTersoffZBL() {}
 
  private:
-  double global_a_0;		// Bohr radius for Coulomb repulsion
-  double global_epsilon_0;	// permittivity of vacuum for Coulomb repulsion
-  double global_e;		// proton charge (negative of electron charge)
+  double global_a_0;                // Bohr radius for Coulomb repulsion
+  double global_epsilon_0;        // permittivity of vacuum for Coulomb repulsion
+  double global_e;                // proton charge (negative of electron charge)
 
   void read_file(char *);
   void repulsive(Param *, double, double &, int, double &);
 
   double ters_fa(double, Param *);
   double ters_fa_d(double, Param *);
-	
+
   double F_fermi(double, Param *);
   double F_fermi_d(double, Param *);
 };
diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp
index a68c173d29..e24e733f66 100755
--- a/src/MC/fix_bond_break.cpp
+++ b/src/MC/fix_bond_break.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -70,7 +70,7 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) :
       fraction = atof(arg[iarg+1]);
       seed = atoi(arg[iarg+2]);
       if (fraction < 0.0 || fraction > 1.0)
-	error->all(FLERR,"Illegal fix bond/break command");
+        error->all(FLERR,"Illegal fix bond/break command");
       if (seed <= 0) error->all(FLERR,"Illegal fix bond/break command");
       iarg += 3;
     } else error->all(FLERR,"Illegal fix bond/break command");
@@ -140,9 +140,9 @@ void FixBondBreak::init()
   // warn if angles, dihedrals, impropers are being used
 
   if (force->angle || force->dihedral || force->improper) {
-    if (me == 0) 
+    if (me == 0)
       error->warning(FLERR,"Broken bonds will not alter angles, "
-		     "dihedrals, or impropers");
+                     "dihedrals, or impropers");
   }
 
   if (strstr(update->integrate_style,"respa"))
@@ -263,12 +263,12 @@ void FixBondBreak::post_integrate()
 
     for (m = 0; m < num_bond[i]; m++) {
       if (bond_atom[i][m] == partner[i]) {
-	for (k = m; k < num_bond[i]-1; k++) {
-	  bond_atom[i][k] = bond_atom[i][k+1];
-	  bond_type[i][k] = bond_type[i][k+1];
-	}
-	num_bond[i]--;
-	break;
+        for (k = m; k < num_bond[i]-1; k++) {
+          bond_atom[i][k] = bond_atom[i][k+1];
+          bond_type[i][k] = bond_type[i][k+1];
+        }
+        num_bond[i]--;
+        break;
       }
     }
 
@@ -284,7 +284,7 @@ void FixBondBreak::post_integrate()
     nspecial[i][0]--;
     nspecial[i][1]--;
     nspecial[i][2]--;
-    
+
     // count the broken bond once
 
     if (tag[i] < tag[j]) nbreak++;
@@ -311,7 +311,7 @@ void FixBondBreak::post_integrate_respa(int ilevel, int iloop)
 /* ---------------------------------------------------------------------- */
 
 int FixBondBreak::pack_comm(int n, int *list, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   int i,j,m;
 
@@ -378,7 +378,7 @@ double FixBondBreak::compute_vector(int n)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double FixBondBreak::memory_usage()
diff --git a/src/MC/fix_bond_break.h b/src/MC/fix_bond_break.h
index daac664fa4..a625e0ff80 100755
--- a/src/MC/fix_bond_break.h
+++ b/src/MC/fix_bond_break.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp
index 577d5a7f8e..7b62d3c813 100755
--- a/src/MC/fix_bond_create.cpp
+++ b/src/MC/fix_bond_create.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -58,7 +58,7 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) :
   double cutoff = atof(arg[6]);
   btype = atoi(arg[7]);
 
-  if (iatomtype < 1 || iatomtype > atom->ntypes || 
+  if (iatomtype < 1 || iatomtype > atom->ntypes ||
       jatomtype < 1 || jatomtype > atom->ntypes)
     error->all(FLERR,"Invalid atom type in fix bond/create command");
   if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/create command");
@@ -84,7 +84,7 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) :
       inewtype = atoi(arg[iarg+2]);
       if (imaxbond < 0) error->all(FLERR,"Illegal fix bond/create command");
       if (inewtype < 1 || inewtype > atom->ntypes)
-	error->all(FLERR,"Invalid atom type in fix bond/create command");
+        error->all(FLERR,"Invalid atom type in fix bond/create command");
       iarg += 3;
     } else if (strcmp(arg[iarg],"jparam") == 0) {
       if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command");
@@ -92,14 +92,14 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) :
       jnewtype = atoi(arg[iarg+2]);
       if (jmaxbond < 0) error->all(FLERR,"Illegal fix bond/create command");
       if (jnewtype < 1 || jnewtype > atom->ntypes)
-	error->all(FLERR,"Invalid atom type in fix bond/create command");
+        error->all(FLERR,"Invalid atom type in fix bond/create command");
       iarg += 3;
     } else if (strcmp(arg[iarg],"prob") == 0) {
       if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command");
       fraction = atof(arg[iarg+1]);
       seed = atoi(arg[iarg+2]);
       if (fraction < 0.0 || fraction > 1.0)
-	error->all(FLERR,"Illegal fix bond/create command");
+        error->all(FLERR,"Illegal fix bond/create command");
       if (seed <= 0) error->all(FLERR,"Illegal fix bond/create command");
       iarg += 3;
     } else error->all(FLERR,"Illegal fix bond/create command");
@@ -109,10 +109,10 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) :
 
   if (atom->molecular == 0)
     error->all(FLERR,"Cannot use fix bond/create with non-molecular systems");
-  if (iatomtype == jatomtype && 
+  if (iatomtype == jatomtype &&
       ((imaxbond != jmaxbond) || (inewtype != jnewtype)))
     error->all(FLERR,
-	       "Inconsistent iparam/jparam values in fix bond/create command");
+               "Inconsistent iparam/jparam values in fix bond/create command");
 
   // initialize Marsaglia RNG with processor-unique seed
 
@@ -177,9 +177,9 @@ void FixBondCreate::init()
 {
   // check cutoff for iatomtype,jatomtype
 
-  if (force->pair == NULL || cutsq > force->pair->cutsq[iatomtype][jatomtype]) 
+  if (force->pair == NULL || cutsq > force->pair->cutsq[iatomtype][jatomtype])
     error->all(FLERR,"Fix bond/create cutoff is longer than pairwise cutoff");
-  
+
   // require special bonds = 0,1,1
 
   if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
@@ -188,15 +188,15 @@ void FixBondCreate::init()
 
   if (atom->q_flag)
     if (force->special_coul[1] != 0.0 || force->special_coul[2] != 1.0 ||
-	force->special_coul[3] != 1.0)
+        force->special_coul[3] != 1.0)
       error->all(FLERR,"Fix bond/create requires special_bonds coul = 0,1,1");
 
   // warn if angles, dihedrals, impropers are being used
 
   if (force->angle || force->dihedral || force->improper) {
-    if (me == 0) 
+    if (me == 0)
       error->warning(FLERR,"Created bonds will not create angles, "
-		     "dihedrals, or impropers");
+                     "dihedrals, or impropers");
   }
 
   // need a half neighbor list, built when ever re-neighboring occurs
@@ -232,7 +232,7 @@ void FixBondCreate::setup(int vflag)
   // if newton bond is not set, just increment count on atom I
   // if newton bond is set, also increment count on atom J even if ghost
   // bondcount is long enough to tally ghost atom counts
-  
+
   int *num_bond = atom->num_bond;
   int **bond_type = atom->bond_type;
   int **bond_atom = atom->bond_atom;
@@ -247,13 +247,13 @@ void FixBondCreate::setup(int vflag)
     for (j = 0; j < num_bond[i]; j++) {
       if (bond_type[i][j] == btype) {
         bondcount[i]++;
-	if (newton_bond) {
-	  m = atom->map(bond_atom[i][j]);
-	  if (m < 0)
-	    error->one(FLERR,
-		       "Could not count initial bonds in fix bond/create");
-	  bondcount[m]++;
-	}
+        if (newton_bond) {
+          m = atom->map(bond_atom[i][j]);
+          if (m < 0)
+            error->one(FLERR,
+                       "Could not count initial bonds in fix bond/create");
+          bondcount[m]++;
+        }
       }
     }
 
@@ -325,7 +325,7 @@ void FixBondCreate::post_integrate()
     ztmp = x[i][2];
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
@@ -334,13 +334,13 @@ void FixBondCreate::post_integrate()
 
       possible = 0;
       if (itype == iatomtype && jtype == jatomtype) {
-	if ((imaxbond == 0 || bondcount[i] < imaxbond) &&
-	    (jmaxbond == 0 || bondcount[j] < jmaxbond))
-	  possible = 1;
+        if ((imaxbond == 0 || bondcount[i] < imaxbond) &&
+            (jmaxbond == 0 || bondcount[j] < jmaxbond))
+          possible = 1;
       } else if (itype == jatomtype && jtype == iatomtype) {
-	if ((jmaxbond == 0 || bondcount[i] < jmaxbond) &&
-	    (imaxbond == 0 || bondcount[j] < imaxbond))
-	  possible = 1;
+        if ((jmaxbond == 0 || bondcount[i] < jmaxbond) &&
+            (imaxbond == 0 || bondcount[j] < imaxbond))
+          possible = 1;
       }
       if (!possible) continue;
 
@@ -351,12 +351,12 @@ void FixBondCreate::post_integrate()
       if (rsq >= cutsq) continue;
 
       if (rsq < distsq[i]) {
-	partner[i] = tag[j];
-	distsq[i] = rsq;
+        partner[i] = tag[j];
+        distsq[i] = rsq;
       }
       if (rsq < distsq[j]) {
-	partner[j] = tag[i];
-	distsq[j] = rsq;
+        partner[j] = tag[i];
+        distsq[j] = rsq;
       }
     }
   }
@@ -375,7 +375,7 @@ void FixBondCreate::post_integrate()
     for (i = 0; i < nlocal; i++)
       if (partner[i]) probability[i] = random->uniform();
   }
- 
+
   commflag = 1;
   comm->forward_comm_fix(this);
 
@@ -411,7 +411,7 @@ void FixBondCreate::post_integrate()
 
     if (!newton_bond || tag[i] < tag[j]) {
       if (num_bond[i] == atom->bond_per_atom)
-	error->one(FLERR,"New bond exceeded bonds per atom in fix bond/create");
+        error->one(FLERR,"New bond exceeded bonds per atom in fix bond/create");
       bond_type[i][num_bond[i]] = btype;
       bond_atom[i][num_bond[i]] = tag[j];
       num_bond[i]++;
@@ -425,7 +425,7 @@ void FixBondCreate::post_integrate()
     n3 = nspecial[i][2];
     if (n3 == atom->maxspecial)
       error->one(FLERR,
-		 "New bond exceeded special list size in fix bond/create");
+                 "New bond exceeded special list size in fix bond/create");
     for (m = n3; m > n1; m--) slist[m+1] = slist[m];
     slist[n1] = tag[j];
     nspecial[i][0]++;
@@ -467,7 +467,7 @@ void FixBondCreate::post_integrate_respa(int ilevel, int iloop)
 /* ---------------------------------------------------------------------- */
 
 int FixBondCreate::pack_comm(int n, int *list, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   int i,j,m;
 
@@ -521,7 +521,7 @@ int FixBondCreate::pack_reverse_comm(int n, int first, double *buf)
   last = first + n;
 
   if (commflag == 0) {
-    for (i = first; i < last; i++) 
+    for (i = first; i < last; i++)
       buf[m++] = bondcount[i];
     return 1;
 
@@ -552,15 +552,15 @@ void FixBondCreate::unpack_reverse_comm(int n, int *list, double *buf)
     for (i = 0; i < n; i++) {
       j = list[i];
       if (buf[m] < distsq[j]) {
-	distsq[j] = buf[m++];
-	partner[j] = static_cast<int> (buf[m++]);
+        distsq[j] = buf[m++];
+        partner[j] = static_cast<int> (buf[m++]);
       } else m += 2;
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   allocate local atom-based arrays 
+   allocate local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixBondCreate::grow_arrays(int nmax)
@@ -569,7 +569,7 @@ void FixBondCreate::grow_arrays(int nmax)
 }
 
 /* ----------------------------------------------------------------------
-   copy values within local atom-based arrays 
+   copy values within local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixBondCreate::copy_arrays(int i, int j)
@@ -578,7 +578,7 @@ void FixBondCreate::copy_arrays(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   pack values in local atom-based arrays for exchange with another proc 
+   pack values in local atom-based arrays for exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixBondCreate::pack_exchange(int i, double *buf)
@@ -588,7 +588,7 @@ int FixBondCreate::pack_exchange(int i, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   unpack values in local atom-based arrays from exchange with another proc 
+   unpack values in local atom-based arrays from exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixBondCreate::unpack_exchange(int nlocal, double *buf)
@@ -606,7 +606,7 @@ double FixBondCreate::compute_vector(int n)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double FixBondCreate::memory_usage()
diff --git a/src/MC/fix_bond_create.h b/src/MC/fix_bond_create.h
index 08d229accb..9f2d904ec3 100755
--- a/src/MC/fix_bond_create.h
+++ b/src/MC/fix_bond_create.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -95,7 +95,7 @@ Self-explanatory.
 
 E: Inconsistent iparam/jparam values in fix bond/create command
 
-If itype and jtype are the same, then their maxbond and newtype 
+If itype and jtype are the same, then their maxbond and newtype
 settings must also be the same.
 
 E: Fix bond/create cutoff is longer than pairwise cutoff
diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp
index c02f3fcd3d..c5aee7f294 100644
--- a/src/MC/fix_bond_swap.cpp
+++ b/src/MC/fix_bond_swap.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -115,7 +115,7 @@ void FixBondSwap::init()
     error->all(FLERR,"Must use atom style with molecule IDs with fix bond/swap");
 
   int icompute = modify->find_compute(id_temp);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Temperature ID for fix bond/swap does not exist");
   temperature = modify->compute[icompute];
 
@@ -257,141 +257,141 @@ void FixBondSwap::pre_neighbor()
       // all 4 old and new bonds must have length < cutoff
 
       for (ibond = 0; ibond < num_bond[i]; ibond++) {
-	inext = atom->map(bond_atom[i][ibond]);
-	if (inext >= nlocal || inext < 0) continue;
-	ibondtype = bond_type[i][ibond];
-
-	for (jbond = 0; jbond < num_bond[j]; jbond++) {
-	  jnext = atom->map(bond_atom[j][jbond]);
-	  if (jnext >= nlocal || jnext < 0) continue;
-	  jbondtype = bond_type[j][jbond];
-
-	  if (molecule[inext] != molecule[jnext]) continue;
-	  if (inext == jnext || inext == j) continue;
-	  if (dist_rsq(i,inext) >= cutsq) continue;
-	  if (dist_rsq(j,jnext) >= cutsq) continue;
-	  if (dist_rsq(i,jnext) >= cutsq) continue;
-	  if (dist_rsq(j,inext) >= cutsq) continue;
-
-	  // if angles are enabled:
-	  // find other atoms i,inext,j,jnext are in angles with
-	  //   and angletypes: i/j angletype, i/j nextangletype
-	  // use num_angle for this, not special list, so also find angletypes
-	  // 4 atoms consecutively along 1st chain: iprev,i,inext,ilast
-	  // 4 atoms consecutively along 2nd chain: jprev,j,jnext,jlast
-	  // prev or last atom can be non-existent at end of chain
-	  //   set prev/last = -1 in this case
-	  // if newton bond = 0, then angles are stored by all 4 atoms
-	  //   so require that iprev,ilast,jprev,jlast be owned by this proc
-	  //   so all copies of angles can be updated if a swap takes place
-
-	  if (angleflag) {
-	    itag = tag[i];
-	    inexttag = tag[inext];
-	    jtag = tag[j];
-	    jnexttag = tag[jnext];
-
-	    iprev = -1;
-	    for (iangle = 0; iangle < num_angle[i]; iangle++) {
-	      i1 = angle_atom1[i][iangle];
-	      i2 = angle_atom2[i][iangle];
-	      i3 = angle_atom3[i][iangle];
-	      if (i2 == itag && i3 == inexttag) iprev = atom->map(i1);
-	      else if (i1 == inexttag && i2 == itag) iprev = atom->map(i3);
-	      if (iprev >= 0) {
-		iangletype = angle_type[i][iangle];
-		break;
-	      }
-	    }
-	    if (!newton_bond && iprev >= nlocal) continue;
-
-	    ilast = -1;
-	    for (iangle = 0; iangle < num_angle[inext]; iangle++) {
-	      i1 = angle_atom1[inext][iangle];
-	      i2 = angle_atom2[inext][iangle];
-	      i3 = angle_atom3[inext][iangle];
-	      if (i1 == itag && i2 == inexttag) ilast = atom->map(i3);
-	      else if (i2 == inexttag && i3 == itag) ilast = atom->map(i1);
-	      if (ilast >= 0) {
-		inextangletype = angle_type[inext][iangle];
-		break;
-	      }
-	    }
-	    if (!newton_bond && ilast >= nlocal) continue;
-
-	    jprev = -1;
-	    for (jangle = 0; jangle < num_angle[j]; jangle++) {
-	      j1 = angle_atom1[j][jangle];
-	      j2 = angle_atom2[j][jangle];
-	      j3 = angle_atom3[j][jangle];
-	      if (j2 == jtag && j3 == jnexttag) jprev = atom->map(j1);
-	      else if (j1 == jnexttag && j2 == jtag) jprev = atom->map(j3);
-	      if (jprev >= 0) {
-		jangletype = angle_type[j][jangle];
-		break;
-	      }
-	    }
-	    if (!newton_bond && jprev >= nlocal) continue;
-
-	    jlast = -1;
-	    for (jangle = 0; jangle < num_angle[jnext]; jangle++) {
-	      j1 = angle_atom1[jnext][jangle];
-	      j2 = angle_atom2[jnext][jangle];
-	      j3 = angle_atom3[jnext][jangle];
-	      if (j1 == jtag && j2 == jnexttag) jlast = atom->map(j3);
-	      else if (j2 == jnexttag && j3 == jtag) jlast = atom->map(j1);
-	      if (jlast >= 0) {
-		jnextangletype = angle_type[jnext][jangle];
-		break;
-	      }
-	    }
-	    if (!newton_bond && jlast >= nlocal) continue;
-	  }
-
-	  // valid foursome found between 2 chains:
-	  //   chains = iprev-i-inext-ilast and jprev-j-jnext-jlast
-	  //   prev or last values are -1 if do not exist due to end of chain
-	  //   OK to call angle_eng with -1 atom, since just return 0.0
-	  // current energy of foursome =
-	  //   E_nb(i,j) + E_nb(i,jnext) + E_nb(inext,j) + E_nb(inext,jnext) +
-	  //   E_bond(i,inext) + E_bond(j,jnext) + 
-	  //   E_angle(iprev,i,inext) + E_angle(i,inext,ilast) +
-	  //   E_angle(jprev,j,jnext) + E_angle(j,jnext,jlast)
-	  // new energy of foursome with swapped bonds =
-	  //   E_nb(i,j) + E_nb(i,inext) + E_nb(j,jnext) + E_nb(inext,jnext) +
-	  //   E_bond(i,jnext) + E_bond(j,inext) + 
-	  //   E_angle(iprev,i,jnext) + E_angle(i,jnext,jlast) +
-	  //   E_angle(jprev,j,inext) + E_angle(j,inext,ilast)
-	  // energy delta = add/subtract differing terms between 2 formulas
-
-	  foursome++;
-
-	  delta = pair_eng(i,inext) + pair_eng(j,jnext) -
-	    pair_eng(i,jnext) - pair_eng(inext,j);
-	  delta += bond_eng(ibondtype,i,jnext) + bond_eng(jbondtype,j,inext) -
-	    bond_eng(ibondtype,i,inext) - bond_eng(jbondtype,j,jnext);
-	  if (angleflag)
-	    delta += angle_eng(iangletype,iprev,i,jnext) + 
-	      angle_eng(jnextangletype,i,jnext,jlast) +
-	      angle_eng(jangletype,jprev,j,inext) +
-	      angle_eng(inextangletype,j,inext,ilast) -
-	      angle_eng(iangletype,iprev,i,inext) - 
-	      angle_eng(inextangletype,i,inext,ilast) -
-	      angle_eng(jangletype,jprev,j,jnext) -
-	      angle_eng(jnextangletype,j,jnext,jlast);
-
-	  // if delta <= 0, accept swap
-	  // if delta > 0, compute Boltzmann factor with current temperature
-	  //   only accept if greater than random value
-	  // whether accept or not, exit test loop
-
-	  if (delta < 0.0) accept = 1;
-	  else {
-	    factor = exp(-delta/force->boltz/t_current);
-	    if (random->uniform() < factor) accept = 1;
-	  }
-	  goto done;
-	}
+        inext = atom->map(bond_atom[i][ibond]);
+        if (inext >= nlocal || inext < 0) continue;
+        ibondtype = bond_type[i][ibond];
+
+        for (jbond = 0; jbond < num_bond[j]; jbond++) {
+          jnext = atom->map(bond_atom[j][jbond]);
+          if (jnext >= nlocal || jnext < 0) continue;
+          jbondtype = bond_type[j][jbond];
+
+          if (molecule[inext] != molecule[jnext]) continue;
+          if (inext == jnext || inext == j) continue;
+          if (dist_rsq(i,inext) >= cutsq) continue;
+          if (dist_rsq(j,jnext) >= cutsq) continue;
+          if (dist_rsq(i,jnext) >= cutsq) continue;
+          if (dist_rsq(j,inext) >= cutsq) continue;
+
+          // if angles are enabled:
+          // find other atoms i,inext,j,jnext are in angles with
+          //   and angletypes: i/j angletype, i/j nextangletype
+          // use num_angle for this, not special list, so also find angletypes
+          // 4 atoms consecutively along 1st chain: iprev,i,inext,ilast
+          // 4 atoms consecutively along 2nd chain: jprev,j,jnext,jlast
+          // prev or last atom can be non-existent at end of chain
+          //   set prev/last = -1 in this case
+          // if newton bond = 0, then angles are stored by all 4 atoms
+          //   so require that iprev,ilast,jprev,jlast be owned by this proc
+          //   so all copies of angles can be updated if a swap takes place
+
+          if (angleflag) {
+            itag = tag[i];
+            inexttag = tag[inext];
+            jtag = tag[j];
+            jnexttag = tag[jnext];
+
+            iprev = -1;
+            for (iangle = 0; iangle < num_angle[i]; iangle++) {
+              i1 = angle_atom1[i][iangle];
+              i2 = angle_atom2[i][iangle];
+              i3 = angle_atom3[i][iangle];
+              if (i2 == itag && i3 == inexttag) iprev = atom->map(i1);
+              else if (i1 == inexttag && i2 == itag) iprev = atom->map(i3);
+              if (iprev >= 0) {
+                iangletype = angle_type[i][iangle];
+                break;
+              }
+            }
+            if (!newton_bond && iprev >= nlocal) continue;
+
+            ilast = -1;
+            for (iangle = 0; iangle < num_angle[inext]; iangle++) {
+              i1 = angle_atom1[inext][iangle];
+              i2 = angle_atom2[inext][iangle];
+              i3 = angle_atom3[inext][iangle];
+              if (i1 == itag && i2 == inexttag) ilast = atom->map(i3);
+              else if (i2 == inexttag && i3 == itag) ilast = atom->map(i1);
+              if (ilast >= 0) {
+                inextangletype = angle_type[inext][iangle];
+                break;
+              }
+            }
+            if (!newton_bond && ilast >= nlocal) continue;
+
+            jprev = -1;
+            for (jangle = 0; jangle < num_angle[j]; jangle++) {
+              j1 = angle_atom1[j][jangle];
+              j2 = angle_atom2[j][jangle];
+              j3 = angle_atom3[j][jangle];
+              if (j2 == jtag && j3 == jnexttag) jprev = atom->map(j1);
+              else if (j1 == jnexttag && j2 == jtag) jprev = atom->map(j3);
+              if (jprev >= 0) {
+                jangletype = angle_type[j][jangle];
+                break;
+              }
+            }
+            if (!newton_bond && jprev >= nlocal) continue;
+
+            jlast = -1;
+            for (jangle = 0; jangle < num_angle[jnext]; jangle++) {
+              j1 = angle_atom1[jnext][jangle];
+              j2 = angle_atom2[jnext][jangle];
+              j3 = angle_atom3[jnext][jangle];
+              if (j1 == jtag && j2 == jnexttag) jlast = atom->map(j3);
+              else if (j2 == jnexttag && j3 == jtag) jlast = atom->map(j1);
+              if (jlast >= 0) {
+                jnextangletype = angle_type[jnext][jangle];
+                break;
+              }
+            }
+            if (!newton_bond && jlast >= nlocal) continue;
+          }
+
+          // valid foursome found between 2 chains:
+          //   chains = iprev-i-inext-ilast and jprev-j-jnext-jlast
+          //   prev or last values are -1 if do not exist due to end of chain
+          //   OK to call angle_eng with -1 atom, since just return 0.0
+          // current energy of foursome =
+          //   E_nb(i,j) + E_nb(i,jnext) + E_nb(inext,j) + E_nb(inext,jnext) +
+          //   E_bond(i,inext) + E_bond(j,jnext) +
+          //   E_angle(iprev,i,inext) + E_angle(i,inext,ilast) +
+          //   E_angle(jprev,j,jnext) + E_angle(j,jnext,jlast)
+          // new energy of foursome with swapped bonds =
+          //   E_nb(i,j) + E_nb(i,inext) + E_nb(j,jnext) + E_nb(inext,jnext) +
+          //   E_bond(i,jnext) + E_bond(j,inext) +
+          //   E_angle(iprev,i,jnext) + E_angle(i,jnext,jlast) +
+          //   E_angle(jprev,j,inext) + E_angle(j,inext,ilast)
+          // energy delta = add/subtract differing terms between 2 formulas
+
+          foursome++;
+
+          delta = pair_eng(i,inext) + pair_eng(j,jnext) -
+            pair_eng(i,jnext) - pair_eng(inext,j);
+          delta += bond_eng(ibondtype,i,jnext) + bond_eng(jbondtype,j,inext) -
+            bond_eng(ibondtype,i,inext) - bond_eng(jbondtype,j,jnext);
+          if (angleflag)
+            delta += angle_eng(iangletype,iprev,i,jnext) +
+              angle_eng(jnextangletype,i,jnext,jlast) +
+              angle_eng(jangletype,jprev,j,inext) +
+              angle_eng(inextangletype,j,inext,ilast) -
+              angle_eng(iangletype,iprev,i,inext) -
+              angle_eng(inextangletype,i,inext,ilast) -
+              angle_eng(jangletype,jprev,j,jnext) -
+              angle_eng(jnextangletype,j,jnext,jlast);
+
+          // if delta <= 0, accept swap
+          // if delta > 0, compute Boltzmann factor with current temperature
+          //   only accept if greater than random value
+          // whether accept or not, exit test loop
+
+          if (delta < 0.0) accept = 1;
+          else {
+            factor = exp(-delta/force->boltz/t_current);
+            if (random->uniform() < factor) accept = 1;
+          }
+          goto done;
+        }
       }
     }
   }
@@ -399,7 +399,7 @@ void FixBondSwap::pre_neighbor()
  done:
   if (!accept) return;
   naccept++;
-  
+
   // change bond partners of affected atoms
   // on atom i: bond i-inext changes to i-jnext
   // on atom j: bond j-jnext changes to j-inext
@@ -533,7 +533,7 @@ void FixBondSwap::pre_neighbor()
       angle_atom3[jnext][jangle] = iprevtag;
     } else if (j1 == jtag && j2 == jnexttag && j3 == jlasttag)
       angle_atom1[jnext][jangle] = itag;
-    else if (j1 == jlasttag && j2 == jnexttag && j3 == jtag) 
+    else if (j1 == jlasttag && j2 == jnexttag && j3 == jtag)
       angle_atom3[jnext][jangle] = itag;
   }
 
@@ -551,7 +551,7 @@ void FixBondSwap::pre_neighbor()
     i1 = angle_atom1[iprev][iangle];
     i2 = angle_atom2[iprev][iangle];
     i3 = angle_atom3[iprev][iangle];
-              
+
     if (i1 == iprevtag && i2 == itag && i3 == inexttag)
       angle_atom3[iprev][iangle] = jnexttag;
     else if (i1 == inexttag && i2 == itag && i3 == iprevtag)
@@ -562,7 +562,7 @@ void FixBondSwap::pre_neighbor()
     j1 = angle_atom1[jprev][jangle];
     j2 = angle_atom2[jprev][jangle];
     j3 = angle_atom3[jprev][jangle];
-    
+
     if (j1 == jprevtag && j2 == jtag && j3 == jnexttag)
       angle_atom3[jprev][jangle] = inexttag;
     else if (j1 == jnexttag && j2 == jtag && j3 == jprevtag)
@@ -573,7 +573,7 @@ void FixBondSwap::pre_neighbor()
     i1 = angle_atom1[ilast][iangle];
     i2 = angle_atom2[ilast][iangle];
     i3 = angle_atom3[ilast][iangle];
-    
+
     if (i1 == itag && i2 == inexttag && i3 == ilasttag)
       angle_atom1[ilast][iangle] = jtag;
     else if (i1 == ilasttag && i2 == inexttag && i3 == itag)
@@ -584,7 +584,7 @@ void FixBondSwap::pre_neighbor()
     j1 = angle_atom1[jlast][jangle];
     j2 = angle_atom2[jlast][jangle];
     j3 = angle_atom3[jlast][jangle];
-    
+
     if (j1 == jtag && j2 == jnexttag && j3 == jlasttag)
       angle_atom1[jlast][jangle] = itag;
     else if (j1 == jlasttag && j2 == jnexttag && j3 == jtag)
diff --git a/src/MC/fix_bond_swap.h b/src/MC/fix_bond_swap.h
index ce549c4849..2804a5f9e9 100644
--- a/src/MC/fix_bond_swap.h
+++ b/src/MC/fix_bond_swap.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -46,7 +46,7 @@ class FixBondSwap : public Fix {
   char *id_temp;
   int *type;
   double **x;
-  
+
   class NeighList *list;
   class Compute *temperature;
   class RanMars *random;
diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp
index 6a699a0652..dd314d772d 100644
--- a/src/MC/fix_gcmc.cpp
+++ b/src/MC/fix_gcmc.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -53,7 +53,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) :
   time_depend = 1;
 
   // required args
-  
+
   nevery = atoi(arg[3]);
   nexchanges = atoi(arg[4]);
   nmcmoves = atoi(arg[5]);
@@ -63,22 +63,22 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) :
   chemical_potential = atof(arg[9]);
   displace = atof(arg[10]);
 
-  if (ntype <= 0 || ntype > atom->ntypes) 
+  if (ntype <= 0 || ntype > atom->ntypes)
     error->all(FLERR,"Invalid atom type in fix GCMC command");
   if (nexchanges < 0) error->all(FLERR,"Illegal fix GCMC command");
   if (nmcmoves < 0) error->all(FLERR,"Illegal fix GCMC command");
   if (seed <= 0) error->all(FLERR,"Illegal fix GCMC command");
-  if (reservoir_temperature < 0.0) 
-    error->all(FLERR,"Illegal fix GCMC command");  
-  if (displace < 0.0) error->all(FLERR,"Illegal fix GCMC command"); 
+  if (reservoir_temperature < 0.0)
+    error->all(FLERR,"Illegal fix GCMC command");
+  if (displace < 0.0) error->all(FLERR,"Illegal fix GCMC command");
 
   // compute beta, lambda, sigma, and the zz factor
-  
+
   beta = 1.0/(force->boltz*reservoir_temperature);
   double gas_mass = atom->mass[ntype];
   double lambda = sqrt(force->hplanck*force->hplanck/
-		       (2.0*MY_PI*gas_mass*force->mvv2e*
-			force->boltz*reservoir_temperature));
+                       (2.0*MY_PI*gas_mass*force->mvv2e*
+                        force->boltz*reservoir_temperature));
   sigma = sqrt(force->boltz*reservoir_temperature/gas_mass/force->mvv2e);
   zz = exp(beta*chemical_potential)/(pow(lambda,3.0));
 
@@ -97,23 +97,23 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) :
   // random number generator, not the same for all procs
 
   random_unequal = new RanPark(lmp,seed);
-  
+
   // compute the number of MC cycles that occur nevery timesteps
-  
+
   ncycles = nexchanges + nmcmoves;
-  
+
   // set up reneighboring
 
   force_reneighbor = 1;
   next_reneighbor = update->ntimestep + 1;
 
   // zero out counters
-  
-  nmove_attempts = 0.0;   
-  nmove_successes = 0.0;  
-  ndel_attempts = 0.0;    
-  ndel_successes = 0.0;   
-  ninsert_attempts = 0.0; 
+
+  nmove_attempts = 0.0;
+  nmove_successes = 0.0;
+  ndel_attempts = 0.0;
+  ndel_successes = 0.0;
+  ninsert_attempts = 0.0;
   ninsert_successes = 0.0;
 
   nmax = 0;
@@ -146,7 +146,7 @@ void FixGCMC::init()
   // deleting such an atom would not leave firstgroup atoms first
 
   int *type = atom->type;
-  
+
   if (atom->firstgroup >= 0) {
     int *mask = atom->mask;
     int nlocal = atom->nlocal;
@@ -177,17 +177,17 @@ void FixGCMC::init()
     MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
     if (flagall && comm->me == 0)
       error->warning(FLERR,
-		     "Fix GCMC may delete atom with non-zero molecule ID");
+                     "Fix GCMC may delete atom with non-zero molecule ID");
   }
 
   if (molflag && atom->molecule_flag == 0)
       error->all(FLERR,
-		 "Fix GCMC molecule command requires atom attribute molecule");
-      
-  if (molflag != 0) 
-    error->all(FLERR,"Fix GCMC molecule feature does not yet work"); 
-  
-  if (force->pair->single_enable == 0) 
+                 "Fix GCMC molecule command requires atom attribute molecule");
+
+  if (molflag != 0)
+    error->all(FLERR,"Fix GCMC molecule feature does not yet work");
+
+  if (force->pair->single_enable == 0)
     error->all(FLERR,"Fix GCMC incompatible with given pair_style");
 }
 
@@ -200,7 +200,7 @@ void FixGCMC::init()
 void FixGCMC::pre_exchange()
 {
   // just return if should not be called on this timestep
-  
+
   if (next_reneighbor != update->ntimestep) return;
 
   if (domain->triclinic == 0) {
@@ -221,34 +221,34 @@ void FixGCMC::pre_exchange()
     zhi = domain->boxhi_bound[2];
     sublo = domain->sublo_lamda;
     subhi = domain->subhi_lamda;
-  } 
-  
+  }
+
   volume = domain->xprd * domain->yprd * domain->zprd;
-  
+
   // grow local_gas_list array if necessary
 
   if (atom->nlocal > nmax) {
     memory->sfree(local_gas_list);
     nmax = atom->nmax;
     local_gas_list = (int *) memory->smalloc(nmax*sizeof(int),
-					     "GCMC:local_gas_list");
+                                             "GCMC:local_gas_list");
   }
-  
+
   int *type = atom->type;
   ngas_local = 0;
   for (int i = 0; i < atom->nlocal; i++)
     if (type[i] == ntype)
       local_gas_list[ngas_local++] = i;
-                                           
+
   MPI_Allreduce(&ngas_local,&ngas,1,MPI_INT,MPI_SUM,world);
   MPI_Scan(&ngas_local,&ngas_before,1,MPI_INT,MPI_SUM,world);
   ngas_before -= ngas_local;
-      
+
   // perform ncycles MC cycles
-  
+
   for (int i = 0; i < ncycles; i++) {
-    int random_int_fraction = 
-      static_cast<int>(random_equal->uniform()*ncycles) + 1;	
+    int random_int_fraction =
+      static_cast<int>(random_equal->uniform()*ncycles) + 1;
     if (random_int_fraction <= nmcmoves) {
       attempt_move();
     } else {
@@ -256,26 +256,26 @@ void FixGCMC::pre_exchange()
       else attempt_insertion();
     }
   }
-  
+
   next_reneighbor = update->ntimestep + nevery;
-} 
+}
 
 /* ----------------------------------------------------------------------
    choose particle randomly across all procs and attempt displacement
 ------------------------------------------------------------------------- */
 
 void FixGCMC::attempt_move()
-{  
+{
   int i,iwhichglobal,iwhichlocal;
   double rx,ry,rz;
   double coord[3];
   double **x = atom->x;
 
   nmove_attempts += 1.0;
-  
+
   int success = 0;
   iwhichglobal = static_cast<int> (ngas*random_equal->uniform());
-  if ((iwhichglobal >= ngas_before) && 
+  if ((iwhichglobal >= ngas_before) &&
       (iwhichglobal < ngas_before + ngas_local)) {
     iwhichlocal = iwhichglobal - ngas_before;
     i = local_gas_list[iwhichlocal];
@@ -293,19 +293,19 @@ void FixGCMC::attempt_move()
     coord[2] = x[i][2] + displace*rz;
     double energy_after = energy(i,coord);
     if (random_unequal->uniform() < exp(-beta*(energy_after - energy_before))) {
-      x[i][0] = coord[0]; 
-      x[i][1] = coord[1]; 
+      x[i][0] = coord[0];
+      x[i][1] = coord[1];
       x[i][2] = coord[2];
       success = 1;
     }
-  } 
-  
+  }
+
   int success_all = 0;
   MPI_Allreduce(&success,&success_all,1,MPI_INT,MPI_MAX,world);
-  
+
   if (success_all) {
-    nmove_successes += 1.0;  
-    comm->borders(); 
+    nmove_successes += 1.0;
+    comm->borders();
   }
 }
 
@@ -314,7 +314,7 @@ void FixGCMC::attempt_move()
 ------------------------------------------------------------------------- */
 
 void FixGCMC::attempt_deletion()
-{ 
+{
   ndel_attempts += 1.0;
 
   if (ngas == 0) return;
@@ -325,32 +325,32 @@ void FixGCMC::attempt_deletion()
   // choose particle randomly across all procs and delete it
   // keep ngas, ngas_local, ngas_before, and local_gas_list current
   // after each deletion
-  
+
   int success = 0;
   iwhichglobal = static_cast<int> (ngas*random_equal->uniform());
-  if ((iwhichglobal >= ngas_before) && 
+  if ((iwhichglobal >= ngas_before) &&
       (iwhichglobal < ngas_before + ngas_local)) {
     iwhichlocal = iwhichglobal - ngas_before;
     i = local_gas_list[iwhichlocal];
-    double deletion_energy = energy(i,atom->x[i]);      
-    if (random_unequal->uniform() < 
-	ngas*exp(beta*deletion_energy)/(zz*volume)) {
+    double deletion_energy = energy(i,atom->x[i]);
+    if (random_unequal->uniform() <
+        ngas*exp(beta*deletion_energy)/(zz*volume)) {
       avec->copy(atom->nlocal-1,i,1);
       atom->nlocal--;
       local_gas_list[iwhichlocal] = local_gas_list[ngas_local-1];
       ngas_local--;
-      success = 1; 
+      success = 1;
     }
   }
- 
+
   int success_all = 0;
   MPI_Allreduce(&success,&success_all,1,MPI_INT,MPI_MAX,world);
-  
+
   if (success_all) {
     ngas--;
     ndel_successes += 1.0;
     atom->natoms--;
-    if (iwhichglobal < ngas_before) ngas_before--;      
+    if (iwhichglobal < ngas_before) ngas_before--;
     comm->borders();
     if (atom->tag_enable) {
       atom->tag_extend();
@@ -367,13 +367,13 @@ void FixGCMC::attempt_deletion()
 ------------------------------------------------------------------------- */
 
 void FixGCMC::attempt_insertion()
-{  
+{
   int flag,success;
   double coord[3],lamda[3];
-  double *newcoord; 
-  
+  double *newcoord;
+
   ninsert_attempts += 1.0;
-  
+
   // choose random position for new atom within box
 
   coord[0] = xlo + random_equal->uniform() * (xhi-xlo);
@@ -384,7 +384,7 @@ void FixGCMC::attempt_insertion()
   // if so, add to my list via create_atom()
   // initialize info about the atoms
   // set group mask to "all" plus fix group
-  
+
   if (domain->triclinic) {
     domain->x2lamda(coord,lamda);
     newcoord = lamda;
@@ -394,21 +394,21 @@ void FixGCMC::attempt_insertion()
   if (newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] &&
     newcoord[1] >= sublo[1] && newcoord[1] < subhi[1] &&
     newcoord[2] >= sublo[2] && newcoord[2] < subhi[2]) flag = 1;
-    
+
   success = 0;
   if (flag) {
     int nall = atom->nlocal + atom->nghost;
     double insertion_energy = energy(nall,coord);
-    if (random_unequal->uniform() < 
-	zz*volume*exp(-beta*insertion_energy)/(ngas+1)) {
-      atom->avec->create_atom(ntype,coord);    
+    if (random_unequal->uniform() <
+        zz*volume*exp(-beta*insertion_energy)/(ngas+1)) {
+      atom->avec->create_atom(ntype,coord);
       int m = atom->nlocal - 1;
       atom->type[m] = ntype;
       atom->mask[m] = 1 | groupbit;
       atom->v[m][0] = random_unequal->gaussian()*sigma;
       atom->v[m][1] = random_unequal->gaussian()*sigma;
       atom->v[m][2] = random_unequal->gaussian()*sigma;
-      
+
       int nfix = modify->nfix;
       Fix **fix = modify->fix;
       for (int j = 0; j < nfix; j++)
@@ -416,20 +416,20 @@ void FixGCMC::attempt_insertion()
 
       if (atom->nlocal > nmax) {
         nmax = atom->nmax;
-        local_gas_list = (int *) 
-	  memory->srealloc(local_gas_list,nmax*sizeof(int),
-			   "GCMC:local_gas_list");
+        local_gas_list = (int *)
+          memory->srealloc(local_gas_list,nmax*sizeof(int),
+                           "GCMC:local_gas_list");
       }
-      
+
       local_gas_list[ngas_local] = atom->nlocal;
-      ngas_local++; 
-      success = 1; 
+      ngas_local++;
+      success = 1;
     }
   }
-  
+
   int success_all = 0;
   MPI_Allreduce(&success,&success_all,1,MPI_INT,MPI_MAX,world);
-  
+
   if (success_all) {
     ngas++;
     ninsert_successes += 1.0;
@@ -443,15 +443,15 @@ void FixGCMC::attempt_insertion()
         atom->map_init();
         atom->map_set();
       }
-    }   
-  } 
+    }
+  }
 }
 
 /* ----------------------------------------------------------------------
    compute particle's interaction energy with the rest of the system
 ------------------------------------------------------------------------- */
 
-double FixGCMC::energy(int i, double *coord) 
+double FixGCMC::energy(int i, double *coord)
 {
   double delx,dely,delz,rsq;
 
@@ -464,7 +464,7 @@ double FixGCMC::energy(int i, double *coord)
   double fpair = 0.0;
   double factor_coul = 1.0;
   double factor_lj = 1.0;
-  
+
   double total_energy = 0.0;
   for (int j = 0; j < nall; j++) {
 
@@ -477,15 +477,15 @@ double FixGCMC::energy(int i, double *coord)
     int jtype = type[j];
 
     if (rsq < cutsq[ntype][jtype])
-      total_energy += 
-	pair->single(i,j,ntype,jtype,rsq,factor_coul,factor_lj,fpair);
+      total_energy +=
+        pair->single(i,j,ntype,jtype,rsq,factor_coul,factor_lj,fpair);
   }
 
   return total_energy;
 }
 
 /* ----------------------------------------------------------------------
-   parse optional parameters at end of input line 
+   parse optional parameters at end of input line
 ------------------------------------------------------------------------- */
 
 void FixGCMC::options(int narg, char **arg)
@@ -530,7 +530,7 @@ double FixGCMC::memory_usage()
 }
 
 /* ----------------------------------------------------------------------
-   pack entire state of Fix into one write 
+   pack entire state of Fix into one write
 ------------------------------------------------------------------------- */
 
 void FixGCMC::write_restart(FILE *fp)
@@ -549,7 +549,7 @@ void FixGCMC::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix  
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixGCMC::restart(char *buf)
@@ -559,9 +559,9 @@ void FixGCMC::restart(char *buf)
 
   seed = static_cast<int> (list[n++]);
   random_equal->reset(seed);
-  
+
   seed = static_cast<int> (list[n++]);
   random_unequal->reset(seed);
-  
+
   next_reneighbor = static_cast<int> (list[n++]);
 }
diff --git a/src/MC/fix_gcmc.h b/src/MC/fix_gcmc.h
index b19286bfa6..9c2b322723 100644
--- a/src/MC/fix_gcmc.h
+++ b/src/MC/fix_gcmc.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -44,18 +44,18 @@ class FixGCMC : public Fix {
  private:
   int ntype,nevery,seed;
   int ncycles,nexchanges,nmcmoves;
-  int ngas;           // # of gas molecules (or atoms) on all procs 
-  int ngas_local;     // # of gas molecules (or atoms) on this proc 
+  int ngas;           // # of gas molecules (or atoms) on all procs
+  int ngas_local;     // # of gas molecules (or atoms) on this proc
   int ngas_before;    // # of gas molecules (or atoms) on procs < this proc
   int molflag;        // 0 = atomic, 1 = molecular system
 
-  double nmove_attempts;   
-  double nmove_successes;  
-  double ndel_attempts;    
-  double ndel_successes;   
-  double ninsert_attempts; 
+  double nmove_attempts;
+  double nmove_successes;
+  double ndel_attempts;
+  double ndel_successes;
+  double ninsert_attempts;
   double ninsert_successes;
-  
+
   int nmax;
   double reservoir_temperature;
   double chemical_potential;
@@ -63,10 +63,10 @@ class FixGCMC : public Fix {
   double beta,zz,sigma,volume;
   double xlo,xhi,ylo,yhi,zlo,zhi;
   double *sublo,*subhi;
-  int *local_gas_list;                           
+  int *local_gas_list;
   double **cutsq;
   class Pair *pair;
- 
+
   class RanPark *random_equal;
   class RanPark *random_unequal;
 
diff --git a/src/MC/pair_dsmc.cpp b/src/MC/pair_dsmc.cpp
index 39a0f50133..b54075453b 100644
--- a/src/MC/pair_dsmc.cpp
+++ b/src/MC/pair_dsmc.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -68,7 +68,7 @@ PairDSMC::~PairDSMC()
 void PairDSMC::compute(int eflag, int vflag)
 {
   double **x = atom->x;
-  double *mass = atom->mass; 
+  double *mass = atom->mass;
   int *type = atom->type;
   int nlocal = atom->nlocal;
 
@@ -111,7 +111,7 @@ void PairDSMC::compute(int eflag, int vflag)
       if (number_of_A > max_particle_list) {
         max_particle_list = number_of_A;
         memory->grow(particle_list,atom->ntypes+1,max_particle_list,
-		     "pair:particle_list");
+                     "pair:particle_list");
       }
 
       int m = first[itype][icell];
@@ -128,7 +128,7 @@ void PairDSMC::compute(int eflag, int vflag)
       for (jtype = itype; jtype <= atom->ntypes; ++jtype) {
         jmass = mass[jtype];
         number_of_B = number[jtype][icell];
-    
+
         reduced_mass = imass*jmass/(imass + jmass);
         total_mass = imass + jmass;
         jmass_tmass = jmass/total_mass;
@@ -136,27 +136,27 @@ void PairDSMC::compute(int eflag, int vflag)
 
         // if necessary, recompute V_sigma_max values
 
-        if (recompute_vsigmamax_stride && 
-	    (update->ntimestep % recompute_vsigmamax_stride == 0)) 
+        if (recompute_vsigmamax_stride &&
+            (update->ntimestep % recompute_vsigmamax_stride == 0))
           recompute_V_sigma_max(icell);
 
         // # of collisions to perform for itype-jtype pairs
 
         double &Vs_max = V_sigma_max[itype][jtype];
-        double num_of_collisions_double = number_of_A * number_of_B * 
-	  weighting * Vs_max * update->dt / vol;
+        double num_of_collisions_double = number_of_A * number_of_B *
+          weighting * Vs_max * update->dt / vol;
 
-        if ((itype == jtype) and number_of_B) 
-	  num_of_collisions_double *= 
-	    0.5 * double(number_of_B - 1) / double(number_of_B);
+        if ((itype == jtype) and number_of_B)
+          num_of_collisions_double *=
+            0.5 * double(number_of_B - 1) / double(number_of_B);
 
-        int num_of_collisions = 
-	  convert_double_to_equivalent_int(num_of_collisions_double);
+        int num_of_collisions =
+          convert_double_to_equivalent_int(num_of_collisions_double);
 
-        if (num_of_collisions > number_of_A) 
-	  error->warning(FLERR,"Pair dsmc: num_of_collisions > number_of_A",0);
-        if (num_of_collisions > number_of_B) 
-	  error->warning(FLERR,"Pair dsmc: num_of_collisions > number_of_B",0);
+        if (num_of_collisions > number_of_A)
+          error->warning(FLERR,"Pair dsmc: num_of_collisions > number_of_A",0);
+        if (num_of_collisions > number_of_B)
+          error->warning(FLERR,"Pair dsmc: num_of_collisions > number_of_B",0);
 
         // perform collisions on pairs of particles in icell
 
@@ -230,7 +230,7 @@ void PairDSMC::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -272,22 +272,22 @@ void PairDSMC::coeff(int narg, char **arg)
 void PairDSMC::init_style()
 {
   ncellsx = ncellsy = ncellsz = 1;
-  while (((domain->boxhi[0] - domain->boxlo[0])/ncellsx) > max_cell_size) 
+  while (((domain->boxhi[0] - domain->boxlo[0])/ncellsx) > max_cell_size)
     ncellsx++;
-  while (((domain->boxhi[1] - domain->boxlo[1])/ncellsy) > max_cell_size) 
+  while (((domain->boxhi[1] - domain->boxlo[1])/ncellsy) > max_cell_size)
     ncellsy++;
-  while (((domain->boxhi[2] - domain->boxlo[2])/ncellsz) > max_cell_size) 
+  while (((domain->boxhi[2] - domain->boxlo[2])/ncellsz) > max_cell_size)
     ncellsz++;
 
   cellx = (domain->boxhi[0] - domain->boxlo[0])/ncellsx;
   celly = (domain->boxhi[1] - domain->boxlo[1])/ncellsy;
   cellz = (domain->boxhi[2] - domain->boxlo[2])/ncellsz;
-  
+
   if (comm->me == 0) {
     if (screen) fprintf(screen,"DSMC cell size = %g x %g x %g\n",
-			cellx,celly,cellz);
+                        cellx,celly,cellz);
     if (logfile) fprintf(logfile,"DSMC cell size = %g x %g x %g\n",
-			 cellx,celly,cellz);
+                         cellx,celly,cellz);
   }
 
   total_ncells = ncellsx*ncellsy*ncellsz;
@@ -327,7 +327,7 @@ void PairDSMC::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
         fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
@@ -349,12 +349,12 @@ void PairDSMC::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
+        if (me == 0) {
           fread(&sigma[i][j],sizeof(double),1,fp);
           fread(&cut[i][j],sizeof(double),1,fp);
         }
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -400,7 +400,7 @@ void PairDSMC::read_restart_settings(FILE *fp)
 }
 
 /*-------------------------------------------------------------------------
-  rezero and recompute the V_sigma_max values this timestep for use during 
+  rezero and recompute the V_sigma_max values this timestep for use during
   the next nrezero timesteps
 -------------------------------------------------------------------------*/
 
@@ -412,9 +412,9 @@ void PairDSMC::recompute_V_sigma_max(int icell)
   if (number_of_A && number_of_B) {
     for (k = 0; k < vsigmamax_samples; k++) {
       i = particle_list[itype]
-	[static_cast<int>(random->uniform()*number_of_A)];
+        [static_cast<int>(random->uniform()*number_of_A)];
       j = particle_list[jtype]
-	[static_cast<int>(random->uniform()*number_of_B)];
+        [static_cast<int>(random->uniform()*number_of_B)];
       if (i == j) continue;
       Vsigma_max = MAX(Vsigma_max,V_sigma(i,j));
     }
@@ -444,9 +444,9 @@ double PairDSMC::V_sigma(int i, int j)
   // (omega - 0.5) = 0.17
   // 1/GAMMA(2.5 - omega) = 1.06418029298371
 
-  if (relative_velocity_sq != 0.0) 
+  if (relative_velocity_sq != 0.0)
     pair_sigma = sigma[itype][jtype]*
-      pow(kT_ref/(0.5*reduced_mass*relative_velocity_sq),0.17) * 
+      pow(kT_ref/(0.5*reduced_mass*relative_velocity_sq),0.17) *
       1.06418029298371;
   else
     pair_sigma = 0.0;
@@ -498,15 +498,15 @@ void PairDSMC::scatter_random(int i, int j, int icell)
     vj[1] = vcm[1] - delv[1]*imass_tmass;
     vj[2] = vcm[2] - delv[2]*imass_tmass;
   }
- 
+
   total_number_of_collisions++;
 }
 
-/* ----------------------------------------------------------------------  
-   This method converts the double supplied by the calling function into 
-   an int, which is returned. By adding a random number between 0 and 1 
-   to the double before converting it to an int, we ensure that, 
-   statistically, we round down with probability identical to the 
+/* ----------------------------------------------------------------------
+   This method converts the double supplied by the calling function into
+   an int, which is returned. By adding a random number between 0 and 1
+   to the double before converting it to an int, we ensure that,
+   statistically, we round down with probability identical to the
    remainder and up the rest of the time. So even though we're using an
    integer, we're statistically matching the exact expression represented
    by the double.
diff --git a/src/MC/pair_dsmc.h b/src/MC/pair_dsmc.h
index 66c2f767dc..ee1139130b 100644
--- a/src/MC/pair_dsmc.h
+++ b/src/MC/pair_dsmc.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -97,9 +97,9 @@ class PairDSMC : public Pair {
     v3[1] = v2[1] - v1[1];
     v3[2] = v2[2] - v1[2];
   }
-  
+
   inline double dot3d(const double *v1, const double *v2) {
-    return( v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2] ); 
+    return( v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2] );
   }
 };
 
diff --git a/src/MEAM/pair_meam.cpp b/src/MEAM/pair_meam.cpp
index 4afb5e1d0f..4a3b15898c 100644
--- a/src/MEAM/pair_meam.cpp
+++ b/src/MEAM/pair_meam.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,10 +37,10 @@ using namespace LAMMPS_NS;
 enum{FCC,BCC,HCP,DIM,DIAMOND,B1,C11,L12,B2};
 int nkeywords = 21;
 const char *keywords[] = {"Ec","alpha","rho0","delta","lattce",
-			  "attrac","repuls","nn2","Cmin","Cmax","rc","delr",
-			  "augt1","gsmooth_factor","re","ialloy",
-			  "mixture_ref_t","erose_form","zbl",
-			  "emb_lin_neg","bkgd_dyn"};
+                          "attrac","repuls","nn2","Cmin","Cmax","rc","delr",
+                          "augt1","gsmooth_factor","re","ialloy",
+                          "mixture_ref_t","erose_form","zbl",
+                          "emb_lin_neg","bkgd_dyn"};
 
 /* ---------------------------------------------------------------------- */
 
@@ -99,7 +99,7 @@ PairMEAM::~PairMEAM()
   memory->destroy(scrfcn);
   memory->destroy(dscrfcn);
   memory->destroy(fcpair);
-  
+
   for (int i = 0; i < nelements; i++) delete [] elements[i];
   delete [] elements;
   delete [] mass;
@@ -124,7 +124,7 @@ void PairMEAM::compute(int eflag, int vflag)
   evdwl = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = eflag_global = vflag_global =
-	 eflag_atom = vflag_atom = 0;
+         eflag_atom = vflag_atom = 0;
 
   // grow local arrays if necessary
 
@@ -237,11 +237,11 @@ void PairMEAM::compute(int eflag, int vflag)
     i = ilist_half[ii];
     ifort = i+1;
     meam_dens_init_(&ifort,&nmax,&ntype,type,fmap,&x[0][0],
-		    &numneigh_half[i],firstneigh_half[i],
-		    &numneigh_full[i],firstneigh_full[i],
-		    &scrfcn[offset],&dscrfcn[offset],&fcpair[offset],
-		    rho0,&arho1[0][0],&arho2[0][0],arho2b,
-		    &arho3[0][0],&arho3b[0][0],&t_ave[0][0],&tsq_ave[0][0],
+                    &numneigh_half[i],firstneigh_half[i],
+                    &numneigh_full[i],firstneigh_full[i],
+                    &scrfcn[offset],&dscrfcn[offset],&fcpair[offset],
+                    rho0,&arho1[0][0],&arho2[0][0],arho2b,
+                    &arho3[0][0],&arho3b[0][0],&t_ave[0][0],&tsq_ave[0][0],
                     &errorflag);
     if (errorflag) {
       char str[128];
@@ -254,10 +254,10 @@ void PairMEAM::compute(int eflag, int vflag)
   comm->reverse_comm_pair(this);
 
   meam_dens_final_(&nlocal,&nmax,&eflag_either,&eflag_global,&eflag_atom,
-		   &eng_vdwl,eatom,&ntype,type,fmap,
-		   &arho1[0][0],&arho2[0][0],arho2b,&arho3[0][0],
-		   &arho3b[0][0],&t_ave[0][0],&tsq_ave[0][0],gamma,dgamma1,
-		   dgamma2,dgamma3,rho,rho0,rho1,rho2,rho3,frhop,&errorflag);
+                   &eng_vdwl,eatom,&ntype,type,fmap,
+                   &arho1[0][0],&arho2[0][0],arho2b,&arho3[0][0],
+                   &arho3b[0][0],&t_ave[0][0],&tsq_ave[0][0],gamma,dgamma1,
+                   dgamma2,dgamma3,rho,rho0,rho1,rho2,rho3,frhop,&errorflag);
   if (errorflag) {
     char str[128];
     sprintf(str,"MEAM library error %d",errorflag);
@@ -279,13 +279,13 @@ void PairMEAM::compute(int eflag, int vflag)
     i = ilist_half[ii];
     ifort = i+1;
     meam_force_(&ifort,&nmax,&eflag_either,&eflag_global,&eflag_atom,
-		&vflag_atom,&eng_vdwl,eatom,&ntype,type,fmap,&x[0][0],
-		&numneigh_half[i],firstneigh_half[i],
-		&numneigh_full[i],firstneigh_full[i],
-		&scrfcn[offset],&dscrfcn[offset],&fcpair[offset],
-		dgamma1,dgamma2,dgamma3,rho0,rho1,rho2,rho3,frhop,
-		&arho1[0][0],&arho2[0][0],arho2b,&arho3[0][0],&arho3b[0][0],
-		&t_ave[0][0],&tsq_ave[0][0],&f[0][0],vptr,&errorflag);
+                &vflag_atom,&eng_vdwl,eatom,&ntype,type,fmap,&x[0][0],
+                &numneigh_half[i],firstneigh_half[i],
+                &numneigh_full[i],firstneigh_full[i],
+                &scrfcn[offset],&dscrfcn[offset],&fcpair[offset],
+                dgamma1,dgamma2,dgamma3,rho0,rho1,rho2,rho3,frhop,
+                &arho1[0][0],&arho2[0][0],arho2b,&arho3[0][0],&arho3b[0][0],
+                &t_ave[0][0],&tsq_ave[0][0],&f[0][0],vptr,&errorflag);
     if (errorflag) {
       char str[128];
       sprintf(str,"MEAM library error %d",errorflag);
@@ -317,7 +317,7 @@ void PairMEAM::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairMEAM::settings(int narg, char **arg)
@@ -355,7 +355,7 @@ void PairMEAM::coeff(int narg, char **arg)
   if (nelements < 1) error->all(FLERR,"Incorrect args for pair coefficients");
   elements = new char*[nelements];
   mass = new double[nelements];
-  
+
   for (i = 0; i < nelements; i++) {
     n = strlen(arg[i+3]) + 1;
     elements[i] = new char[n];
@@ -368,7 +368,7 @@ void PairMEAM::coeff(int narg, char **arg)
 
   read_files(arg[2],arg[2+nelements+1]);
   meam_setup_done_(&cutmax);
-  
+
   // read args that map atom types to MEAM elements
   // map[i] = which element the Ith atom type is, -1 if not mapped
 
@@ -395,9 +395,9 @@ void PairMEAM::coeff(int narg, char **arg)
   for (int i = 1; i <= n; i++)
     for (int j = i; j <= n; j++)
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	if (i == j) atom->set_mass(i,mass[map[i]]);
-	count++;
+        setflag[i][j] = 1;
+        if (i == j) atom->set_mass(i,mass[map[i]]);
+        count++;
       }
 
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
@@ -508,8 +508,8 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
     if (comm->me == 0) {
       ptr = fgets(line,MAXLINE,fp);
       if (ptr == NULL) {
-	eof = 1;
-	fclose(fp);
+        eof = 1;
+        fclose(fp);
       } else n = strlen(line) + 1;
     }
     MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -530,8 +530,8 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
       if (comm->me == 0) {
         ptr = fgets(&line[n],MAXLINE-n,fp);
         if (ptr == NULL) {
-	  eof = 1;
-	  fclose(fp);
+          eof = 1;
+          fclose(fp);
         } else n = strlen(line) + 1;
       }
       MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -603,7 +603,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
   // pass element parameters to MEAM package
 
   meam_setup_global_(&nelements,lat,z,ielement,atwt,alpha,b0,b1,b2,b3,
-  		     alat,esub,asub,t0,t1,t2,t3,rozero,ibar);
+                       alat,esub,asub,t0,t1,t2,t3,rozero,ibar);
 
   // set element masses
 
@@ -664,8 +664,8 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
     if (comm->me == 0) {
       ptr = fgets(line,MAXLINE,fp);
       if (ptr == NULL) {
-	eof = 1;
-	fclose(fp);
+        eof = 1;
+        fclose(fp);
       } else n = strlen(line) + 1;
     }
     MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -683,8 +683,8 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
 
     nparams = 0;
     params[nparams++] = strtok(line,"=(), '\t\n\r\f");
-    while (nparams < maxparams && 
-	   (params[nparams++] = strtok(NULL,"=(), '\t\n\r\f")))
+    while (nparams < maxparams &&
+           (params[nparams++] = strtok(NULL,"=(), '\t\n\r\f")))
       continue;
     nparams--;
 
@@ -693,7 +693,7 @@ void PairMEAM::read_files(char *globalfile, char *userfile)
     if (which == nkeywords) {
       char str[128];
       sprintf(str,"Keyword %s in MEAM parameter file not recognized",
-	      params[0]);
+              params[0]);
       error->all(FLERR,str);
     }
     nindex = nparams - 2;
@@ -881,7 +881,7 @@ void PairMEAM::unpack_reverse_comm(int n, int *list, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairMEAM::memory_usage()
@@ -899,8 +899,8 @@ double PairMEAM::memory_usage()
    done once per reneighbor so that neigh_f2c and neigh_c2f don't see them
 ------------------------------------------------------------------------- */
 
-void PairMEAM::neigh_strip(int inum, int *ilist, 
-			   int *numneigh, int **firstneigh)
+void PairMEAM::neigh_strip(int inum, int *ilist,
+                           int *numneigh, int **firstneigh)
 {
   int i,j,ii,jnum;
   int *jlist;
diff --git a/src/MEAM/pair_meam.h b/src/MEAM/pair_meam.h
index 7c99150d46..9d73ee0489 100644
--- a/src/MEAM/pair_meam.h
+++ b/src/MEAM/pair_meam.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -22,33 +22,33 @@ PairStyle(meam,PairMEAM)
 
 extern "C" {
   void meam_setup_global_(int *, int *, double *, int *, double *, double *,
-			 double *, double *, double *, double *, double *,
-			 double *, double *, double *, double *, double *,
-			 double *, double *, int *);
+                         double *, double *, double *, double *, double *,
+                         double *, double *, double *, double *, double *,
+                         double *, double *, int *);
   void meam_setup_param_(int *, double *, int *, int *, int *);
   void meam_setup_done_(double *);
 
   void meam_dens_init_(int *, int *, int *, int *, int *,
-		       double *, int *, int *, int *, int *,
-		       double *, double *, double *, double *,
-		       double *, double *,
-		       double *, double *, double *, double *, double *,
+                       double *, int *, int *, int *, int *,
+                       double *, double *, double *, double *,
+                       double *, double *,
+                       double *, double *, double *, double *, double *,
                        int *);
-  
+
   void meam_dens_final_(int *, int *, int *, int *, int *, double *, double *,
-			int *, int *, int *,
-			double *, double *, double *, double *, 
-			double *, double *, double *,
-			double *, double *, double *, double *, 
-			double *, double *, 
-			double *, double *, double *, double *, int *);
- 
+                        int *, int *, int *,
+                        double *, double *, double *, double *,
+                        double *, double *, double *,
+                        double *, double *, double *, double *,
+                        double *, double *,
+                        double *, double *, double *, double *, int *);
+
   void meam_force_(int *, int *, int *, int *, int *, int *,
-		   double *, double *, int *, int *, int *, 
-		   double *, int *, int *, int *, int *, double *, double *,
-		   double *, double *, double *, double *, double *, double *,
-		   double *, double *, double *, double *, double *, double *,
-		   double *, double *, double *, double *, double *, double *, int *);
+                   double *, double *, int *, int *, int *,
+                   double *, int *, int *, int *, int *, double *, double *,
+                   double *, double *, double *, double *, double *, double *,
+                   double *, double *, double *, double *, double *, double *,
+                   double *, double *, double *, double *, double *, double *, int *);
 
   void meam_cleanup_();
 }
diff --git a/src/MOLECULE/angle_charmm.cpp b/src/MOLECULE/angle_charmm.cpp
index 0361209e66..8d086838fd 100644
--- a/src/MOLECULE/angle_charmm.cpp
+++ b/src/MOLECULE/angle_charmm.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -121,10 +121,10 @@ void AngleCharmm::compute(int eflag, int vflag)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
@@ -170,7 +170,7 @@ void AngleCharmm::compute(int eflag, int vflag)
     }
 
     if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
   }
 }
 
@@ -241,7 +241,7 @@ void AngleCharmm::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void AngleCharmm::read_restart(FILE *fp)
@@ -273,7 +273,7 @@ double AngleCharmm::single(int type, int i1, int i2, int i3)
   double delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
   double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
-  
+
   double delx2 = x[i3][0] - x[i2][0];
   double dely2 = x[i3][1] - x[i2][1];
   double delz2 = x[i3][2] - x[i2][2];
diff --git a/src/MOLECULE/angle_charmm.h b/src/MOLECULE/angle_charmm.h
index 51a4554fe7..b55e7eb9f8 100644
--- a/src/MOLECULE/angle_charmm.h
+++ b/src/MOLECULE/angle_charmm.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/angle_cosine.cpp b/src/MOLECULE/angle_cosine.cpp
index dc82378083..d6bd3965d7 100644
--- a/src/MOLECULE/angle_cosine.cpp
+++ b/src/MOLECULE/angle_cosine.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -103,7 +103,7 @@ void AngleCosine::compute(int eflag, int vflag)
     a11 = a*c / rsq1;
     a12 = -a / (r1*r2);
     a22 = a*c / rsq2;
-        
+
     f1[0] = a11*delx1 + a12*delx2;
     f1[1] = a11*dely1 + a12*dely2;
     f1[2] = a11*delz1 + a12*delz2;
@@ -132,7 +132,7 @@ void AngleCosine::compute(int eflag, int vflag)
     }
 
     if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
   }
 }
 
@@ -180,7 +180,7 @@ double AngleCosine::equilibrium_angle(int i)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void AngleCosine::write_restart(FILE *fp)
@@ -189,7 +189,7 @@ void AngleCosine::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void AngleCosine::read_restart(FILE *fp)
@@ -213,7 +213,7 @@ double AngleCosine::single(int type, int i1, int i2, int i3)
   double delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
   double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
-  
+
   double delx2 = x[i3][0] - x[i2][0];
   double dely2 = x[i3][1] - x[i2][1];
   double delz2 = x[i3][2] - x[i2][2];
diff --git a/src/MOLECULE/angle_cosine.h b/src/MOLECULE/angle_cosine.h
index 064bd43bd5..903794c8b4 100644
--- a/src/MOLECULE/angle_cosine.h
+++ b/src/MOLECULE/angle_cosine.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/angle_cosine_delta.cpp b/src/MOLECULE/angle_cosine_delta.cpp
index 3697bb87c7..b7cceb6186 100644
--- a/src/MOLECULE/angle_cosine_delta.cpp
+++ b/src/MOLECULE/angle_cosine_delta.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -84,21 +84,21 @@ void AngleCosineDelta::compute(int eflag, int vflag)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-      
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     theta = acos(c);
- 
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
-   
+
     cot = c/s;
- 
+
     // force & energy
-	
-    dtheta = theta - theta0[type]; 
+
+    dtheta = theta - theta0[type];
     dcostheta = cos(dtheta);
     tk = k[type] * (1.0-dcostheta);
 
@@ -107,15 +107,15 @@ void AngleCosineDelta::compute(int eflag, int vflag)
     a = -k[type];
 
     // expand dtheta for cos and sin contribution to force
-    
+
     a11 = a*c / rsq1;
     a12 = -a / (r1*r2);
     a22 = a*c / rsq2;
-    
+
     b11 = -a*c*cot / rsq1;
     b12 = a*cot / (r1*r2);
     b22 = -a*c*cot / rsq2;
-        
+
     c0 = cos(theta0[type]);
     s0 = sin(theta0[type]);
 
@@ -147,7 +147,7 @@ void AngleCosineDelta::compute(int eflag, int vflag)
     }
 
     if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
   }
 }
 
@@ -162,7 +162,7 @@ double AngleCosineDelta::single(int type, int i1, int i2, int i3)
   double delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
   double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
-  
+
   double delx2 = x[i3][0] - x[i2][0];
   double dely2 = x[i3][1] - x[i2][1];
   double delz2 = x[i3][2] - x[i2][2];
diff --git a/src/MOLECULE/angle_cosine_delta.h b/src/MOLECULE/angle_cosine_delta.h
index 08dede2baf..305e3ea673 100644
--- a/src/MOLECULE/angle_cosine_delta.h
+++ b/src/MOLECULE/angle_cosine_delta.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/angle_cosine_periodic.cpp b/src/MOLECULE/angle_cosine_periodic.cpp
index f3b4290613..7c676d309b 100644
--- a/src/MOLECULE/angle_cosine_periodic.cpp
+++ b/src/MOLECULE/angle_cosine_periodic.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -116,7 +116,7 @@ void AngleCosinePeriodic::compute(int eflag, int vflag)
     tn = 1.0;
     tn_1 = 1.0;
     tn_2 = 0.0;
-    un = 1.0; 
+    un = 1.0;
     un_1 = 2.0;
     un_2 = 0.0;
 
@@ -147,7 +147,7 @@ void AngleCosinePeriodic::compute(int eflag, int vflag)
     a11 = a*c / rsq1;
     a12 = -a / (r1*r2);
     a22 = a*c / rsq2;
-        
+
     f1[0] = a11*delx1 + a12*delx2;
     f1[1] = a11*dely1 + a12*dely2;
     f1[2] = a11*delz1 + a12*delz2;
@@ -176,7 +176,7 @@ void AngleCosinePeriodic::compute(int eflag, int vflag)
     }
 
     if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
   }
 }
 
@@ -232,7 +232,7 @@ double AngleCosinePeriodic::equilibrium_angle(int i)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void AngleCosinePeriodic::write_restart(FILE *fp)
@@ -243,7 +243,7 @@ void AngleCosinePeriodic::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void AngleCosinePeriodic::read_restart(FILE *fp)
@@ -273,7 +273,7 @@ double AngleCosinePeriodic::single(int type, int i1, int i2, int i3)
   double delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
   double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
-  
+
   double delx2 = x[i3][0] - x[i2][0];
   double dely2 = x[i3][1] - x[i2][1];
   double delz2 = x[i3][2] - x[i2][2];
diff --git a/src/MOLECULE/angle_cosine_periodic.h b/src/MOLECULE/angle_cosine_periodic.h
index 5c0aeb1195..0b9ce09385 100644
--- a/src/MOLECULE/angle_cosine_periodic.h
+++ b/src/MOLECULE/angle_cosine_periodic.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,7 +37,7 @@ class AngleCosinePeriodic : public Angle {
   double single(int, int, int, int);
 
  protected:
-  double *k; 
+  double *k;
   int *multiplicity,*b;
 
   void allocate();
diff --git a/src/MOLECULE/angle_cosine_squared.cpp b/src/MOLECULE/angle_cosine_squared.cpp
index 95c1a3b922..f9275589e8 100644
--- a/src/MOLECULE/angle_cosine_squared.cpp
+++ b/src/MOLECULE/angle_cosine_squared.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -98,12 +98,12 @@ void AngleCosineSquared::compute(int eflag, int vflag)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     // force & energy
-	
+
     dcostheta = c - cos(theta0[type]);
     tk = k[type] * dcostheta;
 
@@ -142,7 +142,7 @@ void AngleCosineSquared::compute(int eflag, int vflag)
     }
 
     if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
   }
 }
 
@@ -206,7 +206,7 @@ void AngleCosineSquared::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void AngleCosineSquared::read_restart(FILE *fp)
@@ -234,7 +234,7 @@ double AngleCosineSquared::single(int type, int i1, int i2, int i3)
   double delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
   double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
-  
+
   double delx2 = x[i3][0] - x[i2][0];
   double dely2 = x[i3][1] - x[i2][1];
   double delz2 = x[i3][2] - x[i2][2];
@@ -245,7 +245,7 @@ double AngleCosineSquared::single(int type, int i1, int i2, int i3)
   c /= r1*r2;
   if (c > 1.0) c = 1.0;
   if (c < -1.0) c = -1.0;
-  
+
   double dcostheta = c - cos(theta0[type]);
   double tk = k[type] * dcostheta;
   return tk*dcostheta;
diff --git a/src/MOLECULE/angle_cosine_squared.h b/src/MOLECULE/angle_cosine_squared.h
index e3d1f52da4..3b8b3114ef 100644
--- a/src/MOLECULE/angle_cosine_squared.h
+++ b/src/MOLECULE/angle_cosine_squared.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/angle_harmonic.cpp b/src/MOLECULE/angle_harmonic.cpp
index 8a462abaed..a1d36aca6e 100644
--- a/src/MOLECULE/angle_harmonic.cpp
+++ b/src/MOLECULE/angle_harmonic.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -94,10 +94,10 @@ void AngleHarmonic::compute(int eflag, int vflag)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
@@ -142,7 +142,7 @@ void AngleHarmonic::compute(int eflag, int vflag)
     }
 
     if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
   }
 }
 
@@ -206,7 +206,7 @@ void AngleHarmonic::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void AngleHarmonic::read_restart(FILE *fp)
@@ -234,7 +234,7 @@ double AngleHarmonic::single(int type, int i1, int i2, int i3)
   double delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
   double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
-  
+
   double delx2 = x[i3][0] - x[i2][0];
   double dely2 = x[i3][1] - x[i2][1];
   double delz2 = x[i3][2] - x[i2][2];
diff --git a/src/MOLECULE/angle_harmonic.h b/src/MOLECULE/angle_harmonic.h
index 84d219ee1f..bc9cb7fdb2 100644
--- a/src/MOLECULE/angle_harmonic.h
+++ b/src/MOLECULE/angle_harmonic.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/angle_hybrid.cpp b/src/MOLECULE/angle_hybrid.cpp
index 6cd641e73b..f492a4e0de 100644
--- a/src/MOLECULE/angle_hybrid.cpp
+++ b/src/MOLECULE/angle_hybrid.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -80,9 +80,9 @@ void AngleHybrid::compute(int eflag, int vflag)
     }
     for (m = 0; m < nstyles; m++) {
       if (nanglelist[m] > maxangle[m]) {
-	memory->destroy(anglelist[m]);
-	maxangle[m] = nanglelist[m] + EXTRA;
-	memory->create(anglelist[m],maxangle[m],4,"angle_hybrid:anglelist");
+        memory->destroy(anglelist[m]);
+        maxangle[m] = nanglelist[m] + EXTRA;
+        memory->create(anglelist[m],maxangle[m],4,"angle_hybrid:anglelist");
       }
       nanglelist[m] = 0;
     }
@@ -97,7 +97,7 @@ void AngleHybrid::compute(int eflag, int vflag)
       nanglelist[m]++;
     }
   }
-  
+
   // call each sub-style's compute function
   // set neighbor->anglelist to sub-style anglelist before call
   // accumulate sub-style global/peratom energy/virial in hybrid
@@ -125,8 +125,8 @@ void AngleHybrid::compute(int eflag, int vflag)
       if (force->newton_bond) n += atom->nghost;
       double **vatom_substyle = styles[m]->vatom;
       for (i = 0; i < n; i++)
-	for (j = 0; j < 6; j++)
-	  vatom[i][j] += vatom_substyle[i][j];
+        for (j = 0; j < 6; j++)
+          vatom[i][j] += vatom_substyle[i][j];
     }
   }
 
@@ -213,11 +213,11 @@ void AngleHybrid::settings(int narg, char **arg)
 
   while (i < narg) {
     for (m = 0; m < nstyles; m++)
-      if (strcmp(arg[i],keywords[m]) == 0) 
-	error->all(FLERR,"Angle style hybrid cannot use same pair style twice");
-    if (strcmp(arg[i],"hybrid") == 0) 
+      if (strcmp(arg[i],keywords[m]) == 0)
+        error->all(FLERR,"Angle style hybrid cannot use same pair style twice");
+    if (strcmp(arg[i],"hybrid") == 0)
       error->all(FLERR,"Angle style hybrid cannot have hybrid as an argument");
-    if (strcmp(arg[i],"none") == 0) 
+    if (strcmp(arg[i],"none") == 0)
       error->all(FLERR,"Angle style hybrid cannot have none as an argument");
     styles[nstyles] = force->new_angle(arg[i],lmp->suffix,dummy);
     keywords[nstyles] = new char[strlen(arg[i])+1];
@@ -293,7 +293,7 @@ void AngleHybrid::init_style()
 }
 
 /* ----------------------------------------------------------------------
-   return an equilbrium angle length 
+   return an equilbrium angle length
 ------------------------------------------------------------------------- */
 
 double AngleHybrid::equilibrium_angle(int i)
@@ -332,7 +332,7 @@ void AngleHybrid::read_restart(FILE *fp)
   keywords = new char*[nstyles];
 
   allocate();
-  
+
   int n,dummy;
   for (int m = 0; m < nstyles; m++) {
     if (me == 0) fread(&n,sizeof(int),1,fp);
@@ -361,7 +361,7 @@ double AngleHybrid::memory_usage()
   double bytes = maxeatom * sizeof(double);
   bytes += maxvatom*6 * sizeof(double);
   for (int m = 0; m < nstyles; m++) bytes += maxangle[m]*4 * sizeof(int);
-  for (int m = 0; m < nstyles; m++) 
+  for (int m = 0; m < nstyles; m++)
     if (styles[m]) bytes += styles[m]->memory_usage();
   return bytes;
 }
diff --git a/src/MOLECULE/angle_hybrid.h b/src/MOLECULE/angle_hybrid.h
index 8f00c7adaf..7fd7d7af2e 100644
--- a/src/MOLECULE/angle_hybrid.h
+++ b/src/MOLECULE/angle_hybrid.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -49,7 +49,7 @@ class AngleHybrid : public Angle {
   int *nanglelist;              // # of angles in sub-style anglelists
   int *maxangle;                // max # of angles sub-style lists can store
   int ***anglelist;             // anglelist for each sub-style
-  
+
   void allocate();
 };
 
diff --git a/src/MOLECULE/angle_table.cpp b/src/MOLECULE/angle_table.cpp
index 8a8841f782..a5d16910d1 100644
--- a/src/MOLECULE/angle_table.cpp
+++ b/src/MOLECULE/angle_table.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -39,7 +39,7 @@ enum{LINEAR,SPLINE};
 
 /* ---------------------------------------------------------------------- */
 
-AngleTable::AngleTable(LAMMPS *lmp) : Angle(lmp) 
+AngleTable::AngleTable(LAMMPS *lmp) : Angle(lmp)
 {
   ntables = 0;
   tables = NULL;
@@ -51,7 +51,7 @@ AngleTable::~AngleTable()
 {
   for (int m = 0; m < ntables; m++) free_table(&tables[m]);
   memory->sfree(tables);
-  
+
   if (allocated) {
     memory->destroy(setflag);
     memory->destroy(theta0);
@@ -110,10 +110,10 @@ void AngleTable::compute(int eflag, int vflag)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-             
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
@@ -122,10 +122,10 @@ void AngleTable::compute(int eflag, int vflag)
 
     theta = acos(c);
     uf_lookup(type,theta,u,mdu);
-    
+
     if (eflag) eangle = u;
 
-    a = mdu * s;               
+    a = mdu * s;
     a11 = a*c / rsq1;
     a12 = -a / (r1*r2);
     a22 = a*c / rsq2;
@@ -158,7 +158,7 @@ void AngleTable::compute(int eflag, int vflag)
     }
 
     if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
   }
 }
 
@@ -177,7 +177,7 @@ void AngleTable::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void AngleTable::settings(int narg, char **arg)
@@ -217,10 +217,10 @@ void AngleTable::coeff(int narg, char **arg)
 
   int ilo,ihi;
   force->bounds(arg[0],atom->nangletypes,ilo,ihi);
-  
+
   int me;
   MPI_Comm_rank(world,&me);
-  tables = (Table *) 
+  tables = (Table *)
     memory->srealloc(tables,(ntables+1)*sizeof(Table),"angle:tables");
   Table *tb = &tables[ntables];
   null_table(tb);
@@ -236,12 +236,12 @@ void AngleTable::coeff(int narg, char **arg)
   ahi = tb->afile[tb->ninput-1];
   if (fabs(alo-0.0) > TINY || fabs(ahi-180.0) > TINY)
     error->all(FLERR,"Angle table must range from 0 to 180 degrees");
-    
+
   // convert theta from degrees to radians
 
   for (int i = 0; i < tb->ninput; i++){
     tb->afile[i] *= MY_PI/180.0;
-    tb->ffile[i] *= 180.0/MY_PI; 
+    tb->ffile[i] *= 180.0/MY_PI;
   }
 
   // spline read-in and compute a,e,f vectors within table
@@ -310,7 +310,7 @@ double AngleTable::single(int type, int i1, int i2, int i3)
   double delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
   double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
-  
+
   double delx2 = x[i3][0] - x[i2][0];
   double dely2 = x[i3][1] - x[i2][1];
   double delz2 = x[i3][2] - x[i2][2];
@@ -347,7 +347,7 @@ void AngleTable::free_table(Table *tb)
   memory->destroy(tb->ffile);
   memory->destroy(tb->e2file);
   memory->destroy(tb->f2file);
-  
+
   memory->destroy(tb->ang);
   memory->destroy(tb->e);
   memory->destroy(tb->de);
@@ -426,7 +426,7 @@ void AngleTable::spline_table(Table *tb)
 
   if (tb->fpflag == 0) {
     tb->fplo = (tb->ffile[1] - tb->ffile[0]) / (tb->afile[1] - tb->afile[0]);
-    tb->fphi = (tb->ffile[tb->ninput-1] - tb->ffile[tb->ninput-2]) / 
+    tb->fphi = (tb->ffile[tb->ninput-1] - tb->ffile[tb->ninput-2]) /
       (tb->afile[tb->ninput-1] - tb->afile[tb->ninput-2]);
   }
 
@@ -447,7 +447,7 @@ void AngleTable::compute_table(Table *tb)
   tb->delta = MY_PI / tlm1;
   tb->invdelta = 1.0/tb->delta;
   tb->deltasq6 = tb->delta*tb->delta / 6.0;
-  
+
   // N-1 evenly spaced bins in angle from 0 to PI
   // ang,e,f = value at lower edge of bin
   // de,df values = delta values of e,f
@@ -465,18 +465,18 @@ void AngleTable::compute_table(Table *tb)
   for (int i = 0; i < tablength; i++) {
     a = i*tb->delta;
     tb->ang[i] = a;
-	  tb->e[i] = splint(tb->afile,tb->efile,tb->e2file,tb->ninput,a);
-	  tb->f[i] = splint(tb->afile,tb->ffile,tb->f2file,tb->ninput,a);
+          tb->e[i] = splint(tb->afile,tb->efile,tb->e2file,tb->ninput,a);
+          tb->f[i] = splint(tb->afile,tb->ffile,tb->f2file,tb->ninput,a);
   }
-        
+
   for (int i = 0; i < tlm1; i++) {
     tb->de[i] = tb->e[i+1] - tb->e[i];
     tb->df[i] = tb->f[i+1] - tb->f[i];
   }
-     
+
   double ep0 = - tb->f[0];
   double epn = - tb->f[tlm1];
-  spline(tb->ang,tb->e,tablength,ep0,epn,tb->e2);  
+  spline(tb->ang,tb->e,tablength,ep0,epn,tb->e2);
   spline(tb->ang,tb->f,tablength,tb->fplo,tb->fphi,tb->f2);
 }
 
@@ -490,8 +490,8 @@ void AngleTable::param_extract(Table *tb, char *line)
 {
   tb->ninput = 0;
   tb->fpflag = 0;
-  tb->theta0 = 180.0; 
-  
+  tb->theta0 = 180.0;
+
   char *word = strtok(line," \t\n\r\f");
   while (word) {
     if (strcmp(word,"N") == 0) {
@@ -552,7 +552,7 @@ void AngleTable::bcast_table(Table *tb)
 ------------------------------------------------------------------------- */
 
 void AngleTable::spline(double *x, double *y, int n,
-		       double yp1, double ypn, double *y2)
+                       double yp1, double ypn, double *y2)
 {
   int i,k;
   double p,qn,sig,un;
@@ -598,7 +598,7 @@ double AngleTable::splint(double *xa, double *ya, double *y2a, int n, double x)
   h = xa[khi]-xa[klo];
   a = (xa[khi]-x) / h;
   b = (x-xa[klo]) / h;
-  y = a*ya[klo] + b*ya[khi] + 
+  y = a*ya[klo] + b*ya[khi] +
     ((a*a*a-a)*y2a[klo] + (b*b*b-b)*y2a[khi]) * (h*h)/6.0;
   return y;
 }
@@ -613,7 +613,7 @@ void AngleTable::uf_lookup(int type, double x, double &u, double &f)
   double fraction,a,b;
 
   Table *tb = &tables[tabindex[type]];
-  
+
   if (tabstyle == LINEAR) {
     itable = static_cast<int> ( x * tb->invdelta);
     fraction = (x - tb->ang[itable]) * tb->invdelta;
@@ -622,16 +622,16 @@ void AngleTable::uf_lookup(int type, double x, double &u, double &f)
   } else if (tabstyle == SPLINE) {
     itable = static_cast<int> ( x * tb->invdelta);
     fraction = (x - tb->ang[itable]) * tb->invdelta;
-    
+
     b = (x - tb->ang[itable]) * tb->invdelta;
     a = 1.0 - b;
-    u = a * tb->e[itable] + b * tb->e[itable+1] + 
-      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * 
+    u = a * tb->e[itable] + b * tb->e[itable+1] +
+      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) *
       tb->deltasq6;
-    f = a * tb->f[itable] + b * tb->f[itable+1] + 
-      ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) * 
+    f = a * tb->f[itable] + b * tb->f[itable+1] +
+      ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) *
       tb->deltasq6;
-  } 
+  }
 }
 
 /* ----------------------------------------------------------------------
@@ -644,7 +644,7 @@ void AngleTable::u_lookup(int type, double x, double &u)
   double fraction,a,b;
 
   Table *tb = &tables[tabindex[type]];
-  
+
   if (tabstyle == LINEAR) {
     itable = static_cast<int> ( x * tb->invdelta);
     fraction = (x - tb->ang[itable]) * tb->invdelta;
@@ -652,11 +652,11 @@ void AngleTable::u_lookup(int type, double x, double &u)
   } else if (tabstyle == SPLINE) {
     itable = static_cast<int> ( x * tb->invdelta);
     fraction = (x - tb->ang[itable]) * tb->invdelta;
-    
+
     b = (x - tb->ang[itable]) * tb->invdelta;
     a = 1.0 - b;
-    u = a * tb->e[itable] + b * tb->e[itable+1] + 
-      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * 
+    u = a * tb->e[itable] + b * tb->e[itable+1] +
+      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) *
       tb->deltasq6;
-  } 
+  }
 }
diff --git a/src/MOLECULE/angle_table.h b/src/MOLECULE/angle_table.h
index fe3df9cae8..2cfc3d3eea 100644
--- a/src/MOLECULE/angle_table.h
+++ b/src/MOLECULE/angle_table.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -53,7 +53,7 @@ class AngleTable : public Angle {
   int ntables;
   Table *tables;
   int *tabindex;
-  
+
   void allocate();
   void null_table(Table *);
   void free_table(Table *);
diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp
index c1c0c19be3..ceda777518 100644
--- a/src/MOLECULE/atom_vec_angle.cpp
+++ b/src/MOLECULE/atom_vec_angle.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -49,7 +49,7 @@ AtomVecAngle::AtomVecAngle(LAMMPS *lmp, int narg, char **arg) :
 /* ----------------------------------------------------------------------
    grow atom arrays
    n = 0 grows arrays by DELTA
-   n > 0 allocates arrays to size n 
+   n > 0 allocates arrays to size n
 ------------------------------------------------------------------------- */
 
 void AtomVecAngle::grow(int n)
@@ -69,28 +69,28 @@ void AtomVecAngle::grow(int n)
   f = memory->grow(atom->f,nmax*comm->nthreads,3,"atom:f");
 
   molecule = memory->grow(atom->molecule,nmax,"atom:molecule");
-  
+
   nspecial = memory->grow(atom->nspecial,nmax,3,"atom:nspecial");
   special = memory->grow(atom->special,nmax,atom->maxspecial,"atom:special");
 
   num_bond = memory->grow(atom->num_bond,nmax,"atom:num_bond");
   bond_type = memory->grow(atom->bond_type,nmax,atom->bond_per_atom,
-			   "atom:bond_type");
+                           "atom:bond_type");
   bond_atom = memory->grow(atom->bond_atom,nmax,atom->bond_per_atom,
-			   "atom:bond_atom");
+                           "atom:bond_atom");
 
   num_angle = memory->grow(atom->num_angle,nmax,"atom:num_angle");
   angle_type = memory->grow(atom->angle_type,nmax,atom->angle_per_atom,
-			    "atom:angle_type");
+                            "atom:angle_type");
   angle_atom1 = memory->grow(atom->angle_atom1,nmax,atom->angle_per_atom,
-			     "atom:angle_atom1");
+                             "atom:angle_atom1");
   angle_atom2 = memory->grow(atom->angle_atom2,nmax,atom->angle_per_atom,
-			     "atom:angle_atom2");
+                             "atom:angle_atom2");
   angle_atom3 = memory->grow(atom->angle_atom3,nmax,atom->angle_per_atom,
-			     "atom:angle_atom3");
+                             "atom:angle_atom3");
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
 }
 
@@ -153,14 +153,14 @@ void AtomVecAngle::copy(int i, int j, int delflag)
   for (k = 0; k < nspecial[j][2]; k++) special[j][k] = special[i][k];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecAngle::pack_comm(int n, int *list, double *buf,
-			    int pbc_flag, int *pbc)
+                            int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -196,7 +196,7 @@ int AtomVecAngle::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecAngle::pack_comm_vel(int n, int *list, double *buf,
-				int pbc_flag, int *pbc)
+                                int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -224,32 +224,32 @@ int AtomVecAngle::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -323,7 +323,7 @@ void AtomVecAngle::unpack_reverse(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecAngle::pack_border(int n, int *list, double *buf,
-			      int pbc_flag, int *pbc)
+                              int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -367,7 +367,7 @@ int AtomVecAngle::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecAngle::pack_border_vel(int n, int *list, double *buf,
-				  int pbc_flag, int *pbc)
+                                  int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -399,40 +399,40 @@ int AtomVecAngle::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = molecule[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = molecule[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = molecule[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = molecule[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -511,7 +511,7 @@ int AtomVecAngle::unpack_border_hybrid(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 int AtomVecAngle::pack_exchange(int i, double *buf)
@@ -552,7 +552,7 @@ int AtomVecAngle::pack_exchange(int i, double *buf)
   for (k = 0; k < nspecial[i][2]; k++) buf[m++] = special[i][k];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -603,9 +603,9 @@ int AtomVecAngle::unpack_exchange(double *buf)
     special[nlocal][k] = static_cast<int> (buf[m++]);
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -626,9 +626,9 @@ int AtomVecAngle::size_restart()
     n += 14 + 2*num_bond[i] + 4*num_angle[i];
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -636,7 +636,7 @@ int AtomVecAngle::size_restart()
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecAngle::pack_restart(int i, double *buf)
@@ -656,7 +656,7 @@ int AtomVecAngle::pack_restart(int i, double *buf)
   buf[m++] = v[i][2];
 
   buf[m++] = molecule[i];
- 
+
   buf[m++] = num_bond[i];
   for (k = 0; k < num_bond[i]; k++) {
     buf[m++] = MAX(bond_type[i][k],-bond_type[i][k]);
@@ -672,7 +672,7 @@ int AtomVecAngle::pack_restart(int i, double *buf)
   }
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
 
   buf[0] = m;
@@ -707,7 +707,7 @@ int AtomVecAngle::unpack_restart(double *buf)
   v[nlocal][2] = buf[m++];
 
   molecule[nlocal] = static_cast<int> (buf[m++]);
-    
+
   num_bond[nlocal] = static_cast<int> (buf[m++]);
   for (k = 0; k < num_bond[nlocal]; k++) {
     bond_type[nlocal][k] = static_cast<int> (buf[m++]);
@@ -813,7 +813,7 @@ int AtomVecAngle::data_atom_hybrid(int nlocal, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecAngle::memory_usage()
@@ -830,23 +830,23 @@ bigint AtomVecAngle::memory_usage()
 
   if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
   if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
-  if (atom->memcheck("special")) 
+  if (atom->memcheck("special"))
     bytes += memory->usage(special,nmax,atom->maxspecial);
 
   if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
-  if (atom->memcheck("bond_type")) 
+  if (atom->memcheck("bond_type"))
     bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
-  if (atom->memcheck("bond_atom")) 
+  if (atom->memcheck("bond_atom"))
     bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
 
   if (atom->memcheck("num_angle")) bytes += memory->usage(num_angle,nmax);
-  if (atom->memcheck("angle_type")) 
+  if (atom->memcheck("angle_type"))
     bytes += memory->usage(angle_type,nmax,atom->angle_per_atom);
-  if (atom->memcheck("angle_atom1")) 
+  if (atom->memcheck("angle_atom1"))
     bytes += memory->usage(angle_atom1,nmax,atom->angle_per_atom);
-  if (atom->memcheck("angle_atom2")) 
+  if (atom->memcheck("angle_atom2"))
     bytes += memory->usage(angle_atom2,nmax,atom->angle_per_atom);
-  if (atom->memcheck("angle_atom3")) 
+  if (atom->memcheck("angle_atom3"))
     bytes += memory->usage(angle_atom3,nmax,atom->angle_per_atom);
 
   return bytes;
diff --git a/src/MOLECULE/atom_vec_angle.h b/src/MOLECULE/atom_vec_angle.h
index e340c3296c..56a6e35978 100644
--- a/src/MOLECULE/atom_vec_angle.h
+++ b/src/MOLECULE/atom_vec_angle.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp
index 8fd65ab1e8..ee4aabb6f6 100644
--- a/src/MOLECULE/atom_vec_bond.cpp
+++ b/src/MOLECULE/atom_vec_bond.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -49,7 +49,7 @@ AtomVecBond::AtomVecBond(LAMMPS *lmp, int narg, char **arg) :
 /* ----------------------------------------------------------------------
    grow atom arrays
    n = 0 grows arrays by DELTA
-   n > 0 allocates arrays to size n 
+   n > 0 allocates arrays to size n
 ------------------------------------------------------------------------- */
 
 void AtomVecBond::grow(int n)
@@ -75,12 +75,12 @@ void AtomVecBond::grow(int n)
 
   num_bond = memory->grow(atom->num_bond,nmax,"atom:num_bond");
   bond_type = memory->grow(atom->bond_type,nmax,atom->bond_per_atom,
-			   "atom:bond_type");
+                           "atom:bond_type");
   bond_atom = memory->grow(atom->bond_atom,nmax,atom->bond_per_atom,
-			   "atom:bond_atom");
-  
+                           "atom:bond_atom");
+
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
 }
 
@@ -132,14 +132,14 @@ void AtomVecBond::copy(int i, int j, int delflag)
   for (k = 0; k < nspecial[j][2]; k++) special[j][k] = special[i][k];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecBond::pack_comm(int n, int *list, double *buf,
-			   int pbc_flag, int *pbc)
+                           int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -175,7 +175,7 @@ int AtomVecBond::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecBond::pack_comm_vel(int n, int *list, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -203,32 +203,32 @@ int AtomVecBond::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -302,7 +302,7 @@ void AtomVecBond::unpack_reverse(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecBond::pack_border(int n, int *list, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -346,7 +346,7 @@ int AtomVecBond::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecBond::pack_border_vel(int n, int *list, double *buf,
-				 int pbc_flag, int *pbc)
+                                 int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -378,40 +378,40 @@ int AtomVecBond::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = molecule[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = molecule[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = molecule[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = molecule[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -490,7 +490,7 @@ int AtomVecBond::unpack_border_hybrid(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 int AtomVecBond::pack_exchange(int i, double *buf)
@@ -523,7 +523,7 @@ int AtomVecBond::pack_exchange(int i, double *buf)
   for (k = 0; k < nspecial[i][2]; k++) buf[m++] = special[i][k];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -566,9 +566,9 @@ int AtomVecBond::unpack_exchange(double *buf)
     special[nlocal][k] = static_cast<int> (buf[m++]);
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -589,9 +589,9 @@ int AtomVecBond::size_restart()
     n += 13 + 2*num_bond[i];
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -599,7 +599,7 @@ int AtomVecBond::size_restart()
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecBond::pack_restart(int i, double *buf)
@@ -627,7 +627,7 @@ int AtomVecBond::pack_restart(int i, double *buf)
   }
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
 
   buf[0] = m;
@@ -662,7 +662,7 @@ int AtomVecBond::unpack_restart(double *buf)
   v[nlocal][2] = buf[m++];
 
   molecule[nlocal] = static_cast<int> (buf[m++]);
-    
+
   num_bond[nlocal] = static_cast<int> (buf[m++]);
   for (k = 0; k < num_bond[nlocal]; k++) {
     bond_type[nlocal][k] = static_cast<int> (buf[m++]);
@@ -757,7 +757,7 @@ int AtomVecBond::data_atom_hybrid(int nlocal, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecBond::memory_usage()
@@ -774,13 +774,13 @@ bigint AtomVecBond::memory_usage()
 
   if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
   if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
-  if (atom->memcheck("special")) 
+  if (atom->memcheck("special"))
     bytes += memory->usage(special,nmax,atom->maxspecial);
 
   if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
-  if (atom->memcheck("bond_type")) 
+  if (atom->memcheck("bond_type"))
     bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
-  if (atom->memcheck("bond_atom")) 
+  if (atom->memcheck("bond_atom"))
     bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
 
   return bytes;
diff --git a/src/MOLECULE/atom_vec_bond.h b/src/MOLECULE/atom_vec_bond.h
index 0da71d3b21..19b301441c 100644
--- a/src/MOLECULE/atom_vec_bond.h
+++ b/src/MOLECULE/atom_vec_bond.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp
index 793237b447..0a8a3785de 100644
--- a/src/MOLECULE/atom_vec_full.cpp
+++ b/src/MOLECULE/atom_vec_full.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-AtomVecFull::AtomVecFull(LAMMPS *lmp, int narg, char **arg) : 
+AtomVecFull::AtomVecFull(LAMMPS *lmp, int narg, char **arg) :
   AtomVec(lmp, narg, arg)
 {
   molecular = 1;
@@ -49,7 +49,7 @@ AtomVecFull::AtomVecFull(LAMMPS *lmp, int narg, char **arg) :
 /* ----------------------------------------------------------------------
    grow atom arrays
    n = 0 grows arrays by DELTA
-   n > 0 allocates arrays to size n 
+   n > 0 allocates arrays to size n
 ------------------------------------------------------------------------- */
 
 void AtomVecFull::grow(int n)
@@ -73,58 +73,58 @@ void AtomVecFull::grow(int n)
 
   nspecial = memory->grow(atom->nspecial,nmax,3,"atom:nspecial");
   special = memory->grow(atom->special,nmax,atom->maxspecial,"atom:special");
-  
+
   num_bond = memory->grow(atom->num_bond,nmax,"atom:num_bond");
   bond_type = memory->grow(atom->bond_type,nmax,atom->bond_per_atom,
-			   "atom:bond_type");
+                           "atom:bond_type");
   bond_atom = memory->grow(atom->bond_atom,nmax,atom->bond_per_atom,
-			   "atom:bond_atom");
+                           "atom:bond_atom");
 
   num_angle = memory->grow(atom->num_angle,nmax,"atom:num_angle");
   angle_type = memory->grow(atom->angle_type,nmax,atom->angle_per_atom,
-			    "atom:angle_type");
+                            "atom:angle_type");
   angle_atom1 = memory->grow(atom->angle_atom1,nmax,atom->angle_per_atom,
-			     "atom:angle_atom1");
+                             "atom:angle_atom1");
   angle_atom2 = memory->grow(atom->angle_atom2,nmax,atom->angle_per_atom,
-			     "atom:angle_atom2");
+                             "atom:angle_atom2");
   angle_atom3 = memory->grow(atom->angle_atom3,nmax,atom->angle_per_atom,
-			     "atom:angle_atom3");
-  
+                             "atom:angle_atom3");
+
   num_dihedral = memory->grow(atom->num_dihedral,nmax,"atom:num_dihedral");
   dihedral_type = memory->grow(atom->dihedral_type,nmax,
-			       atom->dihedral_per_atom,"atom:dihedral_type");
-  dihedral_atom1 = 
+                               atom->dihedral_per_atom,"atom:dihedral_type");
+  dihedral_atom1 =
     memory->grow(atom->dihedral_atom1,nmax,atom->dihedral_per_atom,
-		 "atom:dihedral_atom1");
-  dihedral_atom2 = 
+                 "atom:dihedral_atom1");
+  dihedral_atom2 =
     memory->grow(atom->dihedral_atom2,nmax,atom->dihedral_per_atom,
-		 "atom:dihedral_atom2");
-  dihedral_atom3 = 
+                 "atom:dihedral_atom2");
+  dihedral_atom3 =
     memory->grow(atom->dihedral_atom3,nmax,atom->dihedral_per_atom,
-		 "atom:dihedral_atom3");
-  dihedral_atom4 = 
+                 "atom:dihedral_atom3");
+  dihedral_atom4 =
     memory->grow(atom->dihedral_atom4,nmax,atom->dihedral_per_atom,
-		 "atom:dihedral_atom4");
+                 "atom:dihedral_atom4");
 
   num_improper = memory->grow(atom->num_improper,nmax,"atom:num_improper");
-  improper_type = 
+  improper_type =
     memory->grow(atom->improper_type,nmax,atom->improper_per_atom,
-		 "atom:improper_type");
-  improper_atom1 = 
+                 "atom:improper_type");
+  improper_atom1 =
     memory->grow(atom->improper_atom1,nmax,atom->improper_per_atom,
-		 "atom:improper_atom1");
-  improper_atom2 = 
+                 "atom:improper_atom1");
+  improper_atom2 =
     memory->grow(atom->improper_atom2,nmax,atom->improper_per_atom,
-		 "atom:improper_atom2");
-  improper_atom3 = 
+                 "atom:improper_atom2");
+  improper_atom3 =
     memory->grow(atom->improper_atom3,nmax,atom->improper_per_atom,
-		 "atom:improper_atom3");
-  improper_atom4 = 
+                 "atom:improper_atom3");
+  improper_atom4 =
     memory->grow(atom->improper_atom4,nmax,atom->improper_per_atom,
-		 "atom:improper_atom4");
+                 "atom:improper_atom4");
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
 }
 
@@ -212,14 +212,14 @@ void AtomVecFull::copy(int i, int j, int delflag)
   for (k = 0; k < nspecial[j][2]; k++) special[j][k] = special[i][k];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecFull::pack_comm(int n, int *list, double *buf,
-			   int pbc_flag, int *pbc)
+                           int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -255,7 +255,7 @@ int AtomVecFull::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecFull::pack_comm_vel(int n, int *list, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -283,32 +283,32 @@ int AtomVecFull::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -382,7 +382,7 @@ void AtomVecFull::unpack_reverse(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecFull::pack_border(int n, int *list, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -428,7 +428,7 @@ int AtomVecFull::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecFull::pack_border_vel(int n, int *list, double *buf,
-				 int pbc_flag, int *pbc)
+                                 int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -461,42 +461,42 @@ int AtomVecFull::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = q[j];
-	buf[m++] = molecule[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = q[j];
+        buf[m++] = molecule[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = q[j];
-	buf[m++] = molecule[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = q[j];
+        buf[m++] = molecule[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -580,7 +580,7 @@ int AtomVecFull::unpack_border_hybrid(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 int AtomVecFull::pack_exchange(int i, double *buf)
@@ -640,7 +640,7 @@ int AtomVecFull::pack_exchange(int i, double *buf)
   for (k = 0; k < nspecial[i][2]; k++) buf[m++] = special[i][k];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -710,9 +710,9 @@ int AtomVecFull::unpack_exchange(double *buf)
     special[nlocal][k] = static_cast<int> (buf[m++]);
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -734,9 +734,9 @@ int AtomVecFull::size_restart()
       5*num_dihedral[i] + 5*num_improper[i];
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -744,7 +744,7 @@ int AtomVecFull::size_restart()
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecFull::pack_restart(int i, double *buf)
@@ -765,13 +765,13 @@ int AtomVecFull::pack_restart(int i, double *buf)
 
   buf[m++] = q[i];
   buf[m++] = molecule[i];
- 
+
   buf[m++] = num_bond[i];
   for (k = 0; k < num_bond[i]; k++) {
     buf[m++] = MAX(bond_type[i][k],-bond_type[i][k]);
     buf[m++] = bond_atom[i][k];
   }
-  
+
   buf[m++] = num_angle[i];
   for (k = 0; k < num_angle[i]; k++) {
     buf[m++] = MAX(angle_type[i][k],-angle_type[i][k]);
@@ -799,7 +799,7 @@ int AtomVecFull::pack_restart(int i, double *buf)
   }
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
 
   buf[0] = m;
@@ -835,7 +835,7 @@ int AtomVecFull::unpack_restart(double *buf)
 
   q[nlocal] = buf[m++];
   molecule[nlocal] = static_cast<int> (buf[m++]);
-    
+
   num_bond[nlocal] = static_cast<int> (buf[m++]);
   for (k = 0; k < num_bond[nlocal]; k++) {
     bond_type[nlocal][k] = static_cast<int> (buf[m++]);
@@ -969,7 +969,7 @@ int AtomVecFull::data_atom_hybrid(int nlocal, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecFull::memory_usage()
@@ -987,47 +987,47 @@ bigint AtomVecFull::memory_usage()
   if (atom->memcheck("q")) bytes += memory->usage(q,nmax);
   if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
   if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
-  if (atom->memcheck("special")) 
+  if (atom->memcheck("special"))
     bytes += memory->usage(special,nmax,atom->maxspecial);
 
   if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
-  if (atom->memcheck("bond_type")) 
+  if (atom->memcheck("bond_type"))
     bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
-  if (atom->memcheck("bond_atom")) 
+  if (atom->memcheck("bond_atom"))
     bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
 
   if (atom->memcheck("num_angle")) bytes += memory->usage(num_angle,nmax);
-  if (atom->memcheck("angle_type")) 
+  if (atom->memcheck("angle_type"))
     bytes += memory->usage(angle_type,nmax,atom->angle_per_atom);
-  if (atom->memcheck("angle_atom1")) 
+  if (atom->memcheck("angle_atom1"))
     bytes += memory->usage(angle_atom1,nmax,atom->angle_per_atom);
-  if (atom->memcheck("angle_atom2")) 
+  if (atom->memcheck("angle_atom2"))
     bytes += memory->usage(angle_atom2,nmax,atom->angle_per_atom);
-  if (atom->memcheck("angle_atom3")) 
+  if (atom->memcheck("angle_atom3"))
     bytes += memory->usage(angle_atom3,nmax,atom->angle_per_atom);
 
   if (atom->memcheck("num_dihedral")) bytes += memory->usage(num_dihedral,nmax);
-  if (atom->memcheck("dihedral_type")) 
+  if (atom->memcheck("dihedral_type"))
     bytes += memory->usage(dihedral_type,nmax,atom->dihedral_per_atom);
-  if (atom->memcheck("dihedral_atom1")) 
+  if (atom->memcheck("dihedral_atom1"))
     bytes += memory->usage(dihedral_atom1,nmax,atom->dihedral_per_atom);
-  if (atom->memcheck("dihedral_atom2")) 
+  if (atom->memcheck("dihedral_atom2"))
     bytes += memory->usage(dihedral_atom2,nmax,atom->dihedral_per_atom);
-  if (atom->memcheck("dihedral_atom3")) 
+  if (atom->memcheck("dihedral_atom3"))
     bytes += memory->usage(dihedral_atom3,nmax,atom->dihedral_per_atom);
-  if (atom->memcheck("dihedral_atom4")) 
+  if (atom->memcheck("dihedral_atom4"))
     bytes += memory->usage(dihedral_atom4,nmax,atom->dihedral_per_atom);
 
   if (atom->memcheck("num_improper")) bytes += memory->usage(num_improper,nmax);
-  if (atom->memcheck("improper_type")) 
+  if (atom->memcheck("improper_type"))
     bytes += memory->usage(improper_type,nmax,atom->improper_per_atom);
-  if (atom->memcheck("improper_atom1")) 
+  if (atom->memcheck("improper_atom1"))
     bytes += memory->usage(improper_atom1,nmax,atom->improper_per_atom);
-  if (atom->memcheck("improper_atom2")) 
+  if (atom->memcheck("improper_atom2"))
     bytes += memory->usage(improper_atom2,nmax,atom->improper_per_atom);
-  if (atom->memcheck("improper_atom3")) 
+  if (atom->memcheck("improper_atom3"))
     bytes += memory->usage(improper_atom3,nmax,atom->improper_per_atom);
-  if (atom->memcheck("improper_atom4")) 
+  if (atom->memcheck("improper_atom4"))
     bytes += memory->usage(improper_atom4,nmax,atom->improper_per_atom);
 
   return bytes;
diff --git a/src/MOLECULE/atom_vec_full.h b/src/MOLECULE/atom_vec_full.h
index c188c14265..f21c736acf 100644
--- a/src/MOLECULE/atom_vec_full.h
+++ b/src/MOLECULE/atom_vec_full.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp
index b29dc14374..c2d2ca9fc5 100644
--- a/src/MOLECULE/atom_vec_molecular.cpp
+++ b/src/MOLECULE/atom_vec_molecular.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-AtomVecMolecular::AtomVecMolecular(LAMMPS *lmp, int narg, char **arg) : 
+AtomVecMolecular::AtomVecMolecular(LAMMPS *lmp, int narg, char **arg) :
   AtomVec(lmp, narg, arg)
 {
   molecular = 1;
@@ -49,7 +49,7 @@ AtomVecMolecular::AtomVecMolecular(LAMMPS *lmp, int narg, char **arg) :
 /* ----------------------------------------------------------------------
    grow atom arrays
    n = 0 grows arrays by DELTA
-   n > 0 allocates arrays to size n 
+   n > 0 allocates arrays to size n
 ------------------------------------------------------------------------- */
 
 void AtomVecMolecular::grow(int n)
@@ -72,58 +72,58 @@ void AtomVecMolecular::grow(int n)
 
   nspecial = memory->grow(atom->nspecial,nmax,3,"atom:nspecial");
   special = memory->grow(atom->special,nmax,atom->maxspecial,"atom:special");
-  
+
   num_bond = memory->grow(atom->num_bond,nmax,"atom:num_bond");
   bond_type = memory->grow(atom->bond_type,nmax,atom->bond_per_atom,
-			   "atom:bond_type");
+                           "atom:bond_type");
   bond_atom = memory->grow(atom->bond_atom,nmax,atom->bond_per_atom,
-			   "atom:bond_atom");
+                           "atom:bond_atom");
 
   num_angle = memory->grow(atom->num_angle,nmax,"atom:num_angle");
   angle_type = memory->grow(atom->angle_type,nmax,atom->angle_per_atom,
-			    "atom:angle_type");
+                            "atom:angle_type");
   angle_atom1 = memory->grow(atom->angle_atom1,nmax,atom->angle_per_atom,
-			     "atom:angle_atom1");
+                             "atom:angle_atom1");
   angle_atom2 = memory->grow(atom->angle_atom2,nmax,atom->angle_per_atom,
-			     "atom:angle_atom2");
+                             "atom:angle_atom2");
   angle_atom3 = memory->grow(atom->angle_atom3,nmax,atom->angle_per_atom,
-			     "atom:angle_atom3");
+                             "atom:angle_atom3");
 
   num_dihedral = memory->grow(atom->num_dihedral,nmax,"atom:num_dihedral");
   dihedral_type = memory->grow(atom->dihedral_type,nmax,
-			       atom->dihedral_per_atom,"atom:dihedral_type");
-  dihedral_atom1 = 
+                               atom->dihedral_per_atom,"atom:dihedral_type");
+  dihedral_atom1 =
     memory->grow(atom->dihedral_atom1,nmax,atom->dihedral_per_atom,
-		 "atom:dihedral_atom1");
-  dihedral_atom2 = 
+                 "atom:dihedral_atom1");
+  dihedral_atom2 =
     memory->grow(atom->dihedral_atom2,nmax,atom->dihedral_per_atom,
-		 "atom:dihedral_atom2");
-  dihedral_atom3 = 
+                 "atom:dihedral_atom2");
+  dihedral_atom3 =
     memory->grow(atom->dihedral_atom3,nmax,atom->dihedral_per_atom,
-		 "atom:dihedral_atom3");
-  dihedral_atom4 = 
+                 "atom:dihedral_atom3");
+  dihedral_atom4 =
     memory->grow(atom->dihedral_atom4,nmax,atom->dihedral_per_atom,
-		 "atom:dihedral_atom4");
+                 "atom:dihedral_atom4");
 
   num_improper = memory->grow(atom->num_improper,nmax,"atom:num_improper");
-  improper_type = 
+  improper_type =
     memory->grow(atom->improper_type,nmax,atom->improper_per_atom,
-		 "atom:improper_type");
-  improper_atom1 = 
+                 "atom:improper_type");
+  improper_atom1 =
     memory->grow(atom->improper_atom1,nmax,atom->improper_per_atom,
-		 "atom:improper_atom1");
-  improper_atom2 = 
+                 "atom:improper_atom1");
+  improper_atom2 =
     memory->grow(atom->improper_atom2,nmax,atom->improper_per_atom,
-		 "atom:improper_atom2");
-  improper_atom3 = 
+                 "atom:improper_atom2");
+  improper_atom3 =
     memory->grow(atom->improper_atom3,nmax,atom->improper_per_atom,
-		 "atom:improper_atom3");
-  improper_atom4 = 
+                 "atom:improper_atom3");
+  improper_atom4 =
     memory->grow(atom->improper_atom4,nmax,atom->improper_per_atom,
-		 "atom:improper_atom4");
+                 "atom:improper_atom4");
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
 }
 
@@ -210,14 +210,14 @@ void AtomVecMolecular::copy(int i, int j, int delflag)
   for (k = 0; k < nspecial[j][2]; k++) special[j][k] = special[i][k];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
 }
 
 /* ---------------------------------------------------------------------- */
 
-int AtomVecMolecular::pack_comm(int n, int *list, double *buf, 
-				int pbc_flag, int *pbc)
+int AtomVecMolecular::pack_comm(int n, int *list, double *buf,
+                                int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -252,8 +252,8 @@ int AtomVecMolecular::pack_comm(int n, int *list, double *buf,
 
 /* ---------------------------------------------------------------------- */
 
-int AtomVecMolecular::pack_comm_vel(int n, int *list, double *buf, 
-				    int pbc_flag, int *pbc)
+int AtomVecMolecular::pack_comm_vel(int n, int *list, double *buf,
+                                    int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -281,32 +281,32 @@ int AtomVecMolecular::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -380,7 +380,7 @@ void AtomVecMolecular::unpack_reverse(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMolecular::pack_border(int n, int *list, double *buf,
-				  int pbc_flag, int *pbc)
+                                  int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -424,7 +424,7 @@ int AtomVecMolecular::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMolecular::pack_border_vel(int n, int *list, double *buf,
-				      int pbc_flag, int *pbc)
+                                      int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -456,40 +456,40 @@ int AtomVecMolecular::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = molecule[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = molecule[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = molecule[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = molecule[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -568,7 +568,7 @@ int AtomVecMolecular::unpack_border_hybrid(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 int AtomVecMolecular::pack_exchange(int i, double *buf)
@@ -627,7 +627,7 @@ int AtomVecMolecular::pack_exchange(int i, double *buf)
   for (k = 0; k < nspecial[i][2]; k++) buf[m++] = special[i][k];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -696,9 +696,9 @@ int AtomVecMolecular::unpack_exchange(double *buf)
     special[nlocal][k] = static_cast<int> (buf[m++]);
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -720,9 +720,9 @@ int AtomVecMolecular::size_restart()
       5*num_dihedral[i] + 5*num_improper[i];
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -730,7 +730,7 @@ int AtomVecMolecular::size_restart()
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecMolecular::pack_restart(int i, double *buf)
@@ -750,13 +750,13 @@ int AtomVecMolecular::pack_restart(int i, double *buf)
   buf[m++] = v[i][2];
 
   buf[m++] = molecule[i];
- 
+
   buf[m++] = num_bond[i];
   for (k = 0; k < num_bond[i]; k++) {
     buf[m++] = MAX(bond_type[i][k],-bond_type[i][k]);
     buf[m++] = bond_atom[i][k];
   }
-  
+
   buf[m++] = num_angle[i];
   for (k = 0; k < num_angle[i]; k++) {
     buf[m++] = MAX(angle_type[i][k],-angle_type[i][k]);
@@ -784,7 +784,7 @@ int AtomVecMolecular::pack_restart(int i, double *buf)
   }
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
 
   buf[0] = m;
@@ -819,7 +819,7 @@ int AtomVecMolecular::unpack_restart(double *buf)
   v[nlocal][2] = buf[m++];
 
   molecule[nlocal] = static_cast<int> (buf[m++]);
-    
+
   num_bond[nlocal] = static_cast<int> (buf[m++]);
   for (k = 0; k < num_bond[nlocal]; k++) {
     bond_type[nlocal][k] = static_cast<int> (buf[m++]);
@@ -949,7 +949,7 @@ int AtomVecMolecular::data_atom_hybrid(int nlocal, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecMolecular::memory_usage()
@@ -966,47 +966,47 @@ bigint AtomVecMolecular::memory_usage()
 
   if (atom->memcheck("molecule")) bytes += memory->usage(molecule,nmax);
   if (atom->memcheck("nspecial")) bytes += memory->usage(nspecial,nmax,3);
-  if (atom->memcheck("special")) 
+  if (atom->memcheck("special"))
     bytes += memory->usage(special,nmax,atom->maxspecial);
 
   if (atom->memcheck("num_bond")) bytes += memory->usage(num_bond,nmax);
-  if (atom->memcheck("bond_type")) 
+  if (atom->memcheck("bond_type"))
     bytes += memory->usage(bond_type,nmax,atom->bond_per_atom);
-  if (atom->memcheck("bond_atom")) 
+  if (atom->memcheck("bond_atom"))
     bytes += memory->usage(bond_atom,nmax,atom->bond_per_atom);
 
   if (atom->memcheck("num_angle")) bytes += memory->usage(num_angle,nmax);
-  if (atom->memcheck("angle_type")) 
+  if (atom->memcheck("angle_type"))
     bytes += memory->usage(angle_type,nmax,atom->angle_per_atom);
-  if (atom->memcheck("angle_atom1")) 
+  if (atom->memcheck("angle_atom1"))
     bytes += memory->usage(angle_atom1,nmax,atom->angle_per_atom);
-  if (atom->memcheck("angle_atom2")) 
+  if (atom->memcheck("angle_atom2"))
     bytes += memory->usage(angle_atom2,nmax,atom->angle_per_atom);
-  if (atom->memcheck("angle_atom3")) 
+  if (atom->memcheck("angle_atom3"))
     bytes += memory->usage(angle_atom3,nmax,atom->angle_per_atom);
 
   if (atom->memcheck("num_dihedral")) bytes += memory->usage(num_dihedral,nmax);
-  if (atom->memcheck("dihedral_type")) 
+  if (atom->memcheck("dihedral_type"))
     bytes += memory->usage(dihedral_type,nmax,atom->dihedral_per_atom);
-  if (atom->memcheck("dihedral_atom1")) 
+  if (atom->memcheck("dihedral_atom1"))
     bytes += memory->usage(dihedral_atom1,nmax,atom->dihedral_per_atom);
-  if (atom->memcheck("dihedral_atom2")) 
+  if (atom->memcheck("dihedral_atom2"))
     bytes += memory->usage(dihedral_atom2,nmax,atom->dihedral_per_atom);
-  if (atom->memcheck("dihedral_atom3")) 
+  if (atom->memcheck("dihedral_atom3"))
     bytes += memory->usage(dihedral_atom3,nmax,atom->dihedral_per_atom);
-  if (atom->memcheck("dihedral_atom4")) 
+  if (atom->memcheck("dihedral_atom4"))
     bytes += memory->usage(dihedral_atom4,nmax,atom->dihedral_per_atom);
 
   if (atom->memcheck("num_improper")) bytes += memory->usage(num_improper,nmax);
-  if (atom->memcheck("improper_type")) 
+  if (atom->memcheck("improper_type"))
     bytes += memory->usage(improper_type,nmax,atom->improper_per_atom);
-  if (atom->memcheck("improper_atom1")) 
+  if (atom->memcheck("improper_atom1"))
     bytes += memory->usage(improper_atom1,nmax,atom->improper_per_atom);
-  if (atom->memcheck("improper_atom2")) 
+  if (atom->memcheck("improper_atom2"))
     bytes += memory->usage(improper_atom2,nmax,atom->improper_per_atom);
-  if (atom->memcheck("improper_atom3")) 
+  if (atom->memcheck("improper_atom3"))
     bytes += memory->usage(improper_atom3,nmax,atom->improper_per_atom);
-  if (atom->memcheck("improper_atom4")) 
+  if (atom->memcheck("improper_atom4"))
     bytes += memory->usage(improper_atom4,nmax,atom->improper_per_atom);
 
   return bytes;
diff --git a/src/MOLECULE/atom_vec_molecular.h b/src/MOLECULE/atom_vec_molecular.h
index 66c1ddb1ae..046d9cc0a7 100644
--- a/src/MOLECULE/atom_vec_molecular.h
+++ b/src/MOLECULE/atom_vec_molecular.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp
index bc94ef9b27..27880ee1e3 100644
--- a/src/MOLECULE/bond_fene.cpp
+++ b/src/MOLECULE/bond_fene.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -87,7 +87,7 @@ void BondFENE::compute(int eflag, int vflag)
     if (rlogarg < 0.1) {
       char str[128];
       sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
-	      update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
+              update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
       error->warning(FLERR,str,0);
       if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
       rlogarg = 0.1;
@@ -108,7 +108,7 @@ void BondFENE::compute(int eflag, int vflag)
     if (eflag) {
       ebond = -0.5 * k[type]*r0sq*log(rlogarg);
       if (rsq < TWO_1_3*sigma[type]*sigma[type])
-	ebond += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
+        ebond += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
     }
 
     // apply force to each of 2 atoms
@@ -244,7 +244,7 @@ double BondFENE::single(int type, double rsq, int i, int j)
   if (rlogarg < 0.1) {
     char str[128];
     sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %g",
-	    update->ntimestep,sqrt(rsq));
+            update->ntimestep,sqrt(rsq));
     error->warning(FLERR,str,0);
     if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
     rlogarg = 0.1;
diff --git a/src/MOLECULE/bond_fene.h b/src/MOLECULE/bond_fene.h
index e90c61c037..55216b05ad 100644
--- a/src/MOLECULE/bond_fene.h
+++ b/src/MOLECULE/bond_fene.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/bond_fene_expand.cpp b/src/MOLECULE/bond_fene_expand.cpp
index eb0b9cf0c7..6b80478e51 100644
--- a/src/MOLECULE/bond_fene_expand.cpp
+++ b/src/MOLECULE/bond_fene_expand.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -92,7 +92,7 @@ void BondFENEExpand::compute(int eflag, int vflag)
     if (rlogarg < 0.1) {
       char str[128];
       sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
-	      update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
+              update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
       error->warning(FLERR,str,0);
       if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
       rlogarg = 0.1;
@@ -113,7 +113,7 @@ void BondFENEExpand::compute(int eflag, int vflag)
     if (eflag) {
       ebond = -0.5 * k[type]*r0sq*log(rlogarg);
       if (rshiftsq < TWO_1_3*sigma[type]*sigma[type])
-	ebond += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
+        ebond += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
     }
 
     // apply force to each of 2 atoms
@@ -258,7 +258,7 @@ double BondFENEExpand::single(int type, double rsq, int i, int j)
   if (rlogarg < 0.1) {
     char str[128];
     sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %g",
-	    update->ntimestep,sqrt(rsq));
+            update->ntimestep,sqrt(rsq));
     error->warning(FLERR,str,0);
     if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
     rlogarg = 0.1;
diff --git a/src/MOLECULE/bond_fene_expand.h b/src/MOLECULE/bond_fene_expand.h
index 449c32b308..1d8e3a3ede 100644
--- a/src/MOLECULE/bond_fene_expand.h
+++ b/src/MOLECULE/bond_fene_expand.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/bond_harmonic.cpp b/src/MOLECULE/bond_harmonic.cpp
index 63af84bf98..ab67e8bec6 100644
--- a/src/MOLECULE/bond_harmonic.cpp
+++ b/src/MOLECULE/bond_harmonic.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -139,7 +139,7 @@ void BondHarmonic::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   return an equilbrium bond length 
+   return an equilbrium bond length
 ------------------------------------------------------------------------- */
 
 double BondHarmonic::equilibrium_distance(int i)
@@ -148,7 +148,7 @@ double BondHarmonic::equilibrium_distance(int i)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void BondHarmonic::write_restart(FILE *fp)
@@ -158,7 +158,7 @@ void BondHarmonic::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void BondHarmonic::read_restart(FILE *fp)
diff --git a/src/MOLECULE/bond_harmonic.h b/src/MOLECULE/bond_harmonic.h
index 7594fe2251..90bc0e1fb7 100644
--- a/src/MOLECULE/bond_harmonic.h
+++ b/src/MOLECULE/bond_harmonic.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/bond_morse.cpp b/src/MOLECULE/bond_morse.cpp
index 135c6f8df5..070c301136 100644
--- a/src/MOLECULE/bond_morse.cpp
+++ b/src/MOLECULE/bond_morse.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -146,7 +146,7 @@ void BondMorse::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   return an equilbrium bond length 
+   return an equilbrium bond length
 ------------------------------------------------------------------------- */
 
 double BondMorse::equilibrium_distance(int i)
diff --git a/src/MOLECULE/bond_morse.h b/src/MOLECULE/bond_morse.h
index e5bcdbe8f2..87303e4bc7 100644
--- a/src/MOLECULE/bond_morse.h
+++ b/src/MOLECULE/bond_morse.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/bond_nonlinear.cpp b/src/MOLECULE/bond_nonlinear.cpp
index 1a31b4c4b1..5bc12e650d 100644
--- a/src/MOLECULE/bond_nonlinear.cpp
+++ b/src/MOLECULE/bond_nonlinear.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/bond_nonlinear.h b/src/MOLECULE/bond_nonlinear.h
index c3051af18b..02efaa969f 100644
--- a/src/MOLECULE/bond_nonlinear.h
+++ b/src/MOLECULE/bond_nonlinear.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp
index c8fc882d57..8b5264bacd 100755
--- a/src/MOLECULE/bond_quartic.cpp
+++ b/src/MOLECULE/bond_quartic.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -102,12 +102,12 @@ void BondQuartic::compute(int eflag, int vflag)
     if (rsq > rc[type]*rc[type]) {
       bondlist[n][2] = 0;
       for (m = 0; m < atom->num_bond[i1]; m++)
-	if (atom->bond_atom[i1][m] == atom->tag[i2])
-	  atom->bond_type[i1][m] = 0;
+        if (atom->bond_atom[i1][m] == atom->tag[i2])
+          atom->bond_type[i1][m] = 0;
       if (i2 < atom->nlocal)
-	for (m = 0; m < atom->num_bond[i2]; m++)
-	  if (atom->bond_atom[i2][m] == atom->tag[i1])
-	    atom->bond_type[i2][m] = 0;
+        for (m = 0; m < atom->num_bond[i2]; m++)
+          if (atom->bond_atom[i2][m] == atom->tag[i1])
+            atom->bond_type[i2][m] = 0;
       continue;
     }
 
@@ -121,7 +121,7 @@ void BondQuartic::compute(int eflag, int vflag)
     ra = dr - b1[type];
     rb = dr - b2[type];
     fbond = -k[type]/r * (r2*(ra+rb) + 2.0*dr*ra*rb);
-    
+
     if (rsq < TWO_1_3) {
       sr2 = 1.0/rsq;
       sr6 = sr2*sr2*sr2;
@@ -161,18 +161,18 @@ void BondQuartic::compute(int eflag, int vflag)
       fpair = -fpair;
 
       if (newton_bond || i1 < nlocal) {
-	f[i1][0] += delx*fpair;
-	f[i1][1] += dely*fpair;
-	f[i1][2] += delz*fpair;
+        f[i1][0] += delx*fpair;
+        f[i1][1] += dely*fpair;
+        f[i1][2] += delz*fpair;
       }
       if (newton_bond || i2 < nlocal) {
-	f[i2][0] -= delx*fpair;
-	f[i2][1] -= dely*fpair;
-	f[i2][2] -= delz*fpair;
+        f[i2][0] -= delx*fpair;
+        f[i2][1] -= dely*fpair;
+        f[i2][2] -= delz*fpair;
       }
 
       if (evflag) force->pair->ev_tally(i1,i2,nlocal,newton_bond,
-					evdwl,0.0,fpair,delx,dely,delz);
+                                        evdwl,0.0,fpair,delx,dely,delz);
     }
   }
 }
@@ -249,7 +249,7 @@ void BondQuartic::init_style()
 }
 
 /* ----------------------------------------------------------------------
-   return an equilbrium bond length 
+   return an equilbrium bond length
 ------------------------------------------------------------------------- */
 
 double BondQuartic::equilibrium_distance(int i)
@@ -258,7 +258,7 @@ double BondQuartic::equilibrium_distance(int i)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void BondQuartic::write_restart(FILE *fp)
@@ -271,7 +271,7 @@ void BondQuartic::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void BondQuartic::read_restart(FILE *fp)
@@ -309,7 +309,7 @@ double BondQuartic::single(int type, double rsq, int i, int j)
 
   int itype = atom->type[i];
   int jtype = atom->type[j];
-  
+
   if (rsq < force->pair->cutsq[itype][jtype]) {
     double tmp;
     eng = -force->pair->single(i,j,itype,jtype,rsq,1.0,1.0,tmp);
diff --git a/src/MOLECULE/bond_quartic.h b/src/MOLECULE/bond_quartic.h
index 528e76e09d..4fb144c655 100644
--- a/src/MOLECULE/bond_quartic.h
+++ b/src/MOLECULE/bond_quartic.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/bond_table.cpp b/src/MOLECULE/bond_table.cpp
index a47c3db75a..19b3f66402 100644
--- a/src/MOLECULE/bond_table.cpp
+++ b/src/MOLECULE/bond_table.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,7 +35,7 @@ enum{LINEAR,SPLINE};
 
 /* ---------------------------------------------------------------------- */
 
-BondTable::BondTable(LAMMPS *lmp) : Bond(lmp) 
+BondTable::BondTable(LAMMPS *lmp) : Bond(lmp)
 {
   ntables = 0;
   tables = NULL;
@@ -127,7 +127,7 @@ void BondTable::allocate()
 
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void BondTable::settings(int narg, char **arg)
@@ -167,10 +167,10 @@ void BondTable::coeff(int narg, char **arg)
 
   int ilo,ihi;
   force->bounds(arg[0],atom->nbondtypes,ilo,ihi);
-  
+
   int me;
   MPI_Comm_rank(world,&me);
-  tables = (Table *) 
+  tables = (Table *)
     memory->srealloc(tables,(ntables+1)*sizeof(Table),"bond:tables");
   Table *tb = &tables[ntables];
   null_table(tb);
@@ -269,7 +269,7 @@ void BondTable::free_table(Table *tb)
   memory->destroy(tb->ffile);
   memory->destroy(tb->e2file);
   memory->destroy(tb->f2file);
-  
+
   memory->destroy(tb->r);
   memory->destroy(tb->e);
   memory->destroy(tb->de);
@@ -348,7 +348,7 @@ void BondTable::spline_table(Table *tb)
 
   if (tb->fpflag == 0) {
     tb->fplo = (tb->ffile[1] - tb->ffile[0]) / (tb->rfile[1] - tb->rfile[0]);
-    tb->fphi = (tb->ffile[tb->ninput-1] - tb->ffile[tb->ninput-2]) / 
+    tb->fphi = (tb->ffile[tb->ninput-1] - tb->ffile[tb->ninput-2]) /
       (tb->rfile[tb->ninput-1] - tb->rfile[tb->ninput-2]);
   }
 
@@ -370,7 +370,7 @@ void BondTable::compute_table(Table *tb)
   tb->delta = (tb->hi - tb->lo)/ tlm1;
   tb->invdelta = 1.0/tb->delta;
   tb->deltasq6 = tb->delta*tb->delta / 6.0;
-  
+
   // N-1 evenly spaced bins in r from min to max
   // r,e,f = value at lower edge of bin
   // de,df values = delta values of e,f
@@ -391,15 +391,15 @@ void BondTable::compute_table(Table *tb)
     tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,a);
     tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,a);
   }
-        
+
   for (int i = 0; i < tlm1; i++) {
     tb->de[i] = tb->e[i+1] - tb->e[i];
     tb->df[i] = tb->f[i+1] - tb->f[i];
   }
-     
+
   double ep0 = - tb->f[0];
   double epn = - tb->f[tlm1];
-  spline(tb->r,tb->e,tablength,ep0,epn,tb->e2);  
+  spline(tb->r,tb->e,tablength,ep0,epn,tb->e2);
   spline(tb->r,tb->f,tablength,tb->fplo,tb->fphi,tb->f2);
 }
 
@@ -414,7 +414,7 @@ void BondTable::param_extract(Table *tb, char *line)
   tb->ninput = 0;
   tb->fpflag = 0;
   tb->r0 = 0.0;
-  
+
   char *word = strtok(line," \t\n\r\f");
   while (word) {
     if (strcmp(word,"N") == 0) {
@@ -474,7 +474,7 @@ void BondTable::bcast_table(Table *tb)
 ------------------------------------------------------------------------- */
 
 void BondTable::spline(double *x, double *y, int n,
-		       double yp1, double ypn, double *y2)
+                       double yp1, double ypn, double *y2)
 {
   int i,k;
   double p,qn,sig,un;
@@ -520,7 +520,7 @@ double BondTable::splint(double *xa, double *ya, double *y2a, int n, double x)
   h = xa[khi]-xa[klo];
   a = (xa[khi]-x) / h;
   b = (x-xa[klo]) / h;
-  y = a*ya[klo] + b*ya[khi] + 
+  y = a*ya[klo] + b*ya[khi] +
     ((a*a*a-a)*y2a[klo] + (b*b*b-b)*y2a[khi]) * (h*h)/6.0;
   return y;
 }
@@ -547,16 +547,16 @@ void BondTable::uf_lookup(int type, double x, double &u, double &f)
   } else if (tabstyle == SPLINE) {
     itable = static_cast<int> ((x - tb->lo) * tb->invdelta);
     fraction = (x - tb->r[itable]) * tb->invdelta;
-    
+
     b = (x - tb->r[itable]) * tb->invdelta;
     a = 1.0 - b;
-    u = a * tb->e[itable] + b * tb->e[itable+1] + 
-      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * 
+    u = a * tb->e[itable] + b * tb->e[itable+1] +
+      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) *
       tb->deltasq6;
-    f = a * tb->f[itable] + b * tb->f[itable+1] + 
-      ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) * 
+    f = a * tb->f[itable] + b * tb->f[itable+1] +
+      ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) *
       tb->deltasq6;
-  } 
+  }
 }
 
 /* ----------------------------------------------------------------------
@@ -572,7 +572,7 @@ void BondTable::u_lookup(int type, double x, double &u)
   Table *tb = &tables[tabindex[type]];
   x = MAX(x,tb->lo);
   x = MIN(x,tb->hi);
-  
+
   if (tabstyle == LINEAR) {
     itable = static_cast<int> ((x - tb->lo) * tb->invdelta);
     fraction = (x - tb->r[itable]) * tb->invdelta;
@@ -580,11 +580,11 @@ void BondTable::u_lookup(int type, double x, double &u)
   } else if (tabstyle == SPLINE) {
     itable = static_cast<int> ((x - tb->lo) * tb->invdelta);
     fraction = (x - tb->r[itable]) * tb->invdelta;
-    
+
     b = (x - tb->r[itable]) * tb->invdelta;
     a = 1.0 - b;
-    u = a * tb->e[itable] + b * tb->e[itable+1] + 
-      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * 
+    u = a * tb->e[itable] + b * tb->e[itable+1] +
+      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) *
       tb->deltasq6;
-  } 
+  }
 }
diff --git a/src/MOLECULE/bond_table.h b/src/MOLECULE/bond_table.h
index 31c335cb42..3a6f75d89b 100644
--- a/src/MOLECULE/bond_table.h
+++ b/src/MOLECULE/bond_table.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ class BondTable : public Bond {
   int ntables;
   Table *tables;
   int *tabindex;
-  
+
   void allocate();
   void null_table(Table *);
   void free_table(Table *);
diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp
index 6e4c8745a3..644655f589 100644
--- a/src/MOLECULE/dihedral_charmm.cpp
+++ b/src/MOLECULE/dihedral_charmm.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,7 +64,7 @@ void DihedralCharmm::compute(int eflag, int vflag)
   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 dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;  
+  double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;
   double c,s,p,sx2,sy2,sz2;
   int itype,jtype;
   double delx,dely,delz,rsq,r2inv,r6inv;
@@ -121,7 +121,7 @@ void DihedralCharmm::compute(int eflag, int vflag)
     vb3y = x[i4][1] - x[i3][1];
     vb3z = x[i4][2] - x[i3][2];
     domain->minimum_image(vb3x,vb3y,vb3z);
-    
+
     ax = vb1y*vb2zm - vb1z*vb2ym;
     ay = vb1z*vb2xm - vb1x*vb2zm;
     az = vb1x*vb2ym - vb1y*vb2xm;
@@ -133,7 +133,7 @@ void DihedralCharmm::compute(int eflag, int vflag)
     rbsq = bx*bx + by*by + bz*bz;
     rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
     rg = sqrt(rgsq);
-    
+
     rginv = ra2inv = rb2inv = 0.0;
     if (rg > 0) rginv = 1.0/rg;
     if (rasq > 0) ra2inv = 1.0/rasq;
@@ -149,29 +149,29 @@ void DihedralCharmm::compute(int eflag, int vflag)
       int me;
       MPI_Comm_rank(world,&me);
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
-		me,update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+                me,update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-         
+
     m = multiplicity[type];
     p = 1.0;
     ddf1 = df1 = 0.0;
-    
+
     for (i = 0; i < m; i++) {
       ddf1 = p*c - df1*s;
       df1 = p*s + df1*c;
@@ -182,21 +182,21 @@ void DihedralCharmm::compute(int eflag, int vflag)
     df1 = df1*cos_shift[type] - ddf1*sin_shift[type];
     df1 *= -m;
     p += 1.0;
- 
+
     if (m == 0) {
       p = 1.0 + cos_shift[type];
       df1 = 0.0;
     }
 
-    if (eflag) edihedral = k[type] * p; 
-       
+    if (eflag) edihedral = k[type] * p;
+
     fg = vb1x*vb2xm + vb1y*vb2ym + vb1z*vb2zm;
     hg = vb3x*vb2xm + vb3y*vb2ym + vb3z*vb2zm;
     fga = fg*ra2inv*rginv;
     hgb = hg*rb2inv*rginv;
     gaa = -ra2inv*rg;
     gbb = rb2inv*rg;
-    
+
     dtfx = gaa*ax;
     dtfy = gaa*ay;
     dtfz = gaa*az;
@@ -206,9 +206,9 @@ void DihedralCharmm::compute(int eflag, int vflag)
     dthx = gbb*bx;
     dthy = gbb*by;
     dthz = gbb*bz;
-    
+
     df = -k[type] * df1;
- 
+
     sx2 = df*dtgx;
     sy2 = df*dtgy;
     sz2 = df*dtgz;
@@ -257,7 +257,7 @@ void DihedralCharmm::compute(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,f1,f3,f4,
-	       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+               vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
 
     // 1-4 LJ and Coulomb interactions
     // tally energy/virial in pair, using newton_bond as newton flag
@@ -280,24 +280,24 @@ void DihedralCharmm::compute(int eflag, int vflag)
       fpair = weight[type] * (forcelj+forcecoul)*r2inv;
 
       if (eflag) {
-	ecoul = weight[type] * forcecoul;
-	evdwl = r6inv * (lj14_3[itype][jtype]*r6inv - lj14_4[itype][jtype]);
-	evdwl *= weight[type];
+        ecoul = weight[type] * forcecoul;
+        evdwl = r6inv * (lj14_3[itype][jtype]*r6inv - lj14_4[itype][jtype]);
+        evdwl *= weight[type];
       }
 
       if (newton_bond || i1 < nlocal) {
-	f[i1][0] += delx*fpair;
-	f[i1][1] += dely*fpair;
-	f[i1][2] += delz*fpair;
+        f[i1][0] += delx*fpair;
+        f[i1][1] += dely*fpair;
+        f[i1][2] += delz*fpair;
       }
       if (newton_bond || i4 < nlocal) {
-	f[i4][0] -= delx*fpair;
-	f[i4][1] -= dely*fpair;
-	f[i4][2] -= delz*fpair;
+        f[i4][0] -= delx*fpair;
+        f[i4][1] -= dely*fpair;
+        f[i4][2] -= delz*fpair;
       }
 
       if (evflag) force->pair->ev_tally(i1,i4,nlocal,newton_bond,
-					evdwl,ecoul,fpair,delx,dely,delz);
+                                        evdwl,ecoul,fpair,delx,dely,delz);
     }
   }
 }
@@ -331,11 +331,11 @@ void DihedralCharmm::coeff(int narg, char **arg)
 
   int ilo,ihi;
   force->bounds(arg[0],atom->ndihedraltypes,ilo,ihi);
-  
+
   // require integer values of shift for backwards compatibility
   // arbitrary phase angle shift could be allowed, but would break
   //   backwards compatibility and is probably not needed
-  
+
   double k_one = force->numeric(arg[1]);
   int multiplicity_one = force->inumeric(arg[2]);
   int shift_one = force->inumeric(arg[3]);
@@ -343,7 +343,7 @@ void DihedralCharmm::coeff(int narg, char **arg)
 
   if (multiplicity_one < 0)
     error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients");
-  if (weight_one < 0.0 || weight_one > 1.0) 
+  if (weight_one < 0.0 || weight_one > 1.0)
     error->all(FLERR,"Incorrect weight arg for dihedral coefficients");
 
   int count = 0;
@@ -362,7 +362,7 @@ void DihedralCharmm::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   error check and initialize all values needed for force computation 
+   error check and initialize all values needed for force computation
 ------------------------------------------------------------------------- */
 
 void DihedralCharmm::init_style()
@@ -390,7 +390,7 @@ void DihedralCharmm::init_style()
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void DihedralCharmm::write_restart(FILE *fp)
@@ -402,7 +402,7 @@ void DihedralCharmm::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void DihedralCharmm::read_restart(FILE *fp)
diff --git a/src/MOLECULE/dihedral_charmm.h b/src/MOLECULE/dihedral_charmm.h
index be0e7c5847..591de5f5a8 100644
--- a/src/MOLECULE/dihedral_charmm.h
+++ b/src/MOLECULE/dihedral_charmm.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/dihedral_harmonic.cpp b/src/MOLECULE/dihedral_harmonic.cpp
index 43d4333dd8..a951f3816b 100644
--- a/src/MOLECULE/dihedral_harmonic.cpp
+++ b/src/MOLECULE/dihedral_harmonic.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -61,7 +61,7 @@ void DihedralHarmonic::compute(int eflag, int vflag)
   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 dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;  
+  double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;
   double c,s,p,sx2,sy2,sz2;
 
   edihedral = 0.0;
@@ -107,7 +107,7 @@ void DihedralHarmonic::compute(int eflag, int vflag)
     vb3y = x[i4][1] - x[i3][1];
     vb3z = x[i4][2] - x[i3][2];
     domain->minimum_image(vb3x,vb3y,vb3z);
-    
+
     // c,s calculation
 
     ax = vb1y*vb2zm - vb1z*vb2ym;
@@ -121,7 +121,7 @@ void DihedralHarmonic::compute(int eflag, int vflag)
     rbsq = bx*bx + by*by + bz*bz;
     rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
     rg = sqrt(rgsq);
-    
+
     rginv = ra2inv = rb2inv = 0.0;
     if (rg > 0) rginv = 1.0/rg;
     if (rasq > 0) ra2inv = 1.0/rasq;
@@ -137,29 +137,29 @@ void DihedralHarmonic::compute(int eflag, int vflag)
       int me;
       MPI_Comm_rank(world,&me);
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
-		me,update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+                me,update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-         
+
     m = multiplicity[type];
     p = 1.0;
     ddf1 = df1 = 0.0;
-    
+
     for (i = 0; i < m; i++) {
       ddf1 = p*c - df1*s;
       df1 = p*s + df1*c;
@@ -170,21 +170,21 @@ void DihedralHarmonic::compute(int eflag, int vflag)
     df1 = df1*cos_shift[type] - ddf1*sin_shift[type];
     df1 *= -m;
     p += 1.0;
- 
+
     if (m == 0) {
       p = 1.0 + cos_shift[type];
       df1 = 0.0;
     }
 
-    if (eflag) edihedral = k[type] * p; 
-       
+    if (eflag) edihedral = k[type] * p;
+
     fg = vb1x*vb2xm + vb1y*vb2ym + vb1z*vb2zm;
     hg = vb3x*vb2xm + vb3y*vb2ym + vb3z*vb2zm;
     fga = fg*ra2inv*rginv;
     hgb = hg*rb2inv*rginv;
     gaa = -ra2inv*rg;
     gbb = rb2inv*rg;
-    
+
     dtfx = gaa*ax;
     dtfy = gaa*ay;
     dtfz = gaa*az;
@@ -194,9 +194,9 @@ void DihedralHarmonic::compute(int eflag, int vflag)
     dthx = gbb*bx;
     dthy = gbb*by;
     dthz = gbb*bz;
-    
+
     df = -k[type] * df1;
-    
+
     sx2 = df*dtgx;
     sy2 = df*dtgy;
     sz2 = df*dtgz;
@@ -216,7 +216,7 @@ void DihedralHarmonic::compute(int eflag, int vflag)
     f3[0] = -sx2 - f4[0];
     f3[1] = -sy2 - f4[1];
     f3[2] = -sz2 - f4[2];
-    
+
     // apply force to each of 4 atoms
 
     if (newton_bond || i1 < nlocal) {
@@ -245,7 +245,7 @@ void DihedralHarmonic::compute(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,f1,f3,f4,
-	       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+               vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
   }
 }
 
@@ -285,12 +285,12 @@ void DihedralHarmonic::coeff(int narg, char **arg)
   // require sign = +/- 1 for backwards compatibility
   // arbitrary phase angle shift could be allowed, but would break
   //   backwards compatibility and is probably not needed
-  
+
   if (sign_one != -1 && sign_one != 1)
     error->all(FLERR,"Incorrect sign arg for dihedral coefficients");
   if (multiplicity_one < 0)
     error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients");
-                       
+
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
     k[i] = k_one;
@@ -311,7 +311,7 @@ void DihedralHarmonic::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void DihedralHarmonic::write_restart(FILE *fp)
@@ -322,7 +322,7 @@ void DihedralHarmonic::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void DihedralHarmonic::read_restart(FILE *fp)
@@ -337,7 +337,7 @@ void DihedralHarmonic::read_restart(FILE *fp)
   MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
   MPI_Bcast(&sign[1],atom->ndihedraltypes,MPI_INT,0,world);
   MPI_Bcast(&multiplicity[1],atom->ndihedraltypes,MPI_INT,0,world);
- 
+
   for (int i = 1; i <= atom->ndihedraltypes; i++) {
     setflag[i] = 1;
     if (sign[i] == 1) {
@@ -345,7 +345,7 @@ void DihedralHarmonic::read_restart(FILE *fp)
       sin_shift[i] = 0;
     } else {
       cos_shift[i] = -1;
-      sin_shift[i] = 0;	    
+      sin_shift[i] = 0;
     }
   }
 }
diff --git a/src/MOLECULE/dihedral_harmonic.h b/src/MOLECULE/dihedral_harmonic.h
index 5eafdb61f3..195bd1b357 100644
--- a/src/MOLECULE/dihedral_harmonic.h
+++ b/src/MOLECULE/dihedral_harmonic.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/dihedral_helix.cpp b/src/MOLECULE/dihedral_helix.cpp
index 8079de6f06..c9da759d21 100644
--- a/src/MOLECULE/dihedral_helix.cpp
+++ b/src/MOLECULE/dihedral_helix.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -112,18 +112,18 @@ void DihedralHelix::compute(int eflag, int vflag)
     domain->minimum_image(vb3x,vb3y,vb3z);
 
     // c0 calculation
-        
+
     sb1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
     sb2 = 1.0 / (vb2x*vb2x + vb2y*vb2y + vb2z*vb2z);
     sb3 = 1.0 / (vb3x*vb3x + vb3y*vb3y + vb3z*vb3z);
-        
+
     rb1 = sqrt(sb1);
     rb3 = sqrt(sb3);
-        
+
     c0 = (vb1x*vb3x + vb1y*vb3y + vb1z*vb3z) * rb1*rb3;
 
     // 1st and 2nd angle
-        
+
     b1mag2 = vb1x*vb1x + vb1y*vb1y + vb1z*vb1z;
     b1mag = sqrt(b1mag2);
     b2mag2 = vb2x*vb2x + vb2y*vb2y + vb2z*vb2z;
@@ -161,29 +161,29 @@ void DihedralHelix::compute(int eflag, int vflag)
     cz = vb1x*vb2y - vb1y*vb2x;
     cmag = sqrt(cx*cx + cy*cy + cz*cz);
     dx = (cx*vb3x + cy*vb3y + cz*vb3z)/cmag/b3mag;
-    
+
     // error check
 
     if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) {
       int me;
       MPI_Comm_rank(world,&me);
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
-		me,update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+                me,update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
 
@@ -258,7 +258,7 @@ void DihedralHelix::compute(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,f1,f3,f4,
-	       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+               vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
   }
 }
 
@@ -306,7 +306,7 @@ void DihedralHelix::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void DihedralHelix::write_restart(FILE *fp)
@@ -317,7 +317,7 @@ void DihedralHelix::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void DihedralHelix::read_restart(FILE *fp)
diff --git a/src/MOLECULE/dihedral_helix.h b/src/MOLECULE/dihedral_helix.h
index f28b9db28e..1e34ff4712 100644
--- a/src/MOLECULE/dihedral_helix.h
+++ b/src/MOLECULE/dihedral_helix.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/dihedral_hybrid.cpp b/src/MOLECULE/dihedral_hybrid.cpp
index 131762be28..e66cf7e328 100644
--- a/src/MOLECULE/dihedral_hybrid.cpp
+++ b/src/MOLECULE/dihedral_hybrid.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -79,10 +79,10 @@ void DihedralHybrid::compute(int eflag, int vflag)
     }
     for (m = 0; m < nstyles; m++) {
       if (ndihedrallist[m] > maxdihedral[m]) {
-	memory->destroy(dihedrallist[m]);
-	maxdihedral[m] = ndihedrallist[m] + EXTRA;
-	memory->create(dihedrallist[m],maxdihedral[m],5,
-		       "dihedral_hybrid:dihedrallist");
+        memory->destroy(dihedrallist[m]);
+        maxdihedral[m] = ndihedrallist[m] + EXTRA;
+        memory->create(dihedrallist[m],maxdihedral[m],5,
+                       "dihedral_hybrid:dihedrallist");
       }
       ndihedrallist[m] = 0;
     }
@@ -98,7 +98,7 @@ void DihedralHybrid::compute(int eflag, int vflag)
       ndihedrallist[m]++;
     }
   }
-  
+
   // call each sub-style's compute function
   // set neighbor->dihedrallist to sub-style dihedrallist before call
   // accumulate sub-style global/peratom energy/virial in hybrid
@@ -126,8 +126,8 @@ void DihedralHybrid::compute(int eflag, int vflag)
       if (force->newton_bond) n += atom->nghost;
       double **vatom_substyle = styles[m]->vatom;
       for (i = 0; i < n; i++)
-	for (j = 0; j < 6; j++)
-	  vatom[i][j] += vatom_substyle[i][j];
+        for (j = 0; j < 6; j++)
+          vatom[i][j] += vatom_substyle[i][j];
     }
   }
 
@@ -169,13 +169,13 @@ void DihedralHybrid::settings(int narg, char **arg)
 
   for (int m = 0; m < nstyles; m++) {
     for (int i = 0; i < m; i++)
-      if (strcmp(arg[m],arg[i]) == 0) 
-	error->all(FLERR,"Dihedral style hybrid cannot use "
-		   "same dihedral style twice");
-    if (strcmp(arg[m],"hybrid") == 0) 
+      if (strcmp(arg[m],arg[i]) == 0)
+        error->all(FLERR,"Dihedral style hybrid cannot use "
+                   "same dihedral style twice");
+    if (strcmp(arg[m],"hybrid") == 0)
       error->all(FLERR,
-		 "Dihedral style hybrid cannot have hybrid as an argument");
-    if (strcmp(arg[m],"none") == 0) 
+                 "Dihedral style hybrid cannot have hybrid as an argument");
+    if (strcmp(arg[m],"none") == 0)
       error->all(FLERR,"Dihedral style hybrid cannot have none as an argument");
     styles[m] = force->new_dihedral(arg[m],lmp->suffix,dummy);
     keywords[m] = new char[strlen(arg[m])+1];
@@ -292,7 +292,7 @@ double DihedralHybrid::memory_usage()
   double bytes = maxeatom * sizeof(double);
   bytes += maxvatom*6 * sizeof(double);
   for (int m = 0; m < nstyles; m++) bytes += maxdihedral[m]*5 * sizeof(int);
-  for (int m = 0; m < nstyles; m++) 
+  for (int m = 0; m < nstyles; m++)
     if (styles[m]) bytes += styles[m]->memory_usage();
   return bytes;
 }
diff --git a/src/MOLECULE/dihedral_hybrid.h b/src/MOLECULE/dihedral_hybrid.h
index bee1e58b20..c847dd2e9c 100644
--- a/src/MOLECULE/dihedral_hybrid.h
+++ b/src/MOLECULE/dihedral_hybrid.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -47,7 +47,7 @@ class DihedralHybrid : public Dihedral {
   int *ndihedrallist;           // # of dihedrals in sub-style dihedrallists
   int *maxdihedral;             // max # of dihedrals sub-style lists can store
   int ***dihedrallist;          // dihedrallist for each sub-style
-  
+
   void allocate();
 };
 
diff --git a/src/MOLECULE/dihedral_multi_harmonic.cpp b/src/MOLECULE/dihedral_multi_harmonic.cpp
index f44a9dccf3..cff19447f7 100644
--- a/src/MOLECULE/dihedral_multi_harmonic.cpp
+++ b/src/MOLECULE/dihedral_multi_harmonic.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -108,18 +108,18 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
     domain->minimum_image(vb3x,vb3y,vb3z);
 
     // c0 calculation
-        
+
     sb1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
     sb2 = 1.0 / (vb2x*vb2x + vb2y*vb2y + vb2z*vb2z);
     sb3 = 1.0 / (vb3x*vb3x + vb3y*vb3y + vb3z*vb3z);
-        
+
     rb1 = sqrt(sb1);
     rb3 = sqrt(sb3);
-        
+
     c0 = (vb1x*vb3x + vb1y*vb3y + vb1z*vb3z) * rb1*rb3;
 
     // 1st and 2nd angle
-        
+
     b1mag2 = vb1x*vb1x + vb1y*vb1y + vb1z*vb1z;
     b1mag = sqrt(b1mag2);
     b2mag2 = vb2x*vb2x + vb2y*vb2y + vb2z*vb2z;
@@ -158,22 +158,22 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
       int me;
       MPI_Comm_rank(world,&me);
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
-		me,update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+                me,update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
 
@@ -244,7 +244,7 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,f1,f3,f4,
-	       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+               vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
   }
 }
 
@@ -298,7 +298,7 @@ void DihedralMultiHarmonic::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void DihedralMultiHarmonic::write_restart(FILE *fp)
@@ -311,7 +311,7 @@ void DihedralMultiHarmonic::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void DihedralMultiHarmonic::read_restart(FILE *fp)
diff --git a/src/MOLECULE/dihedral_multi_harmonic.h b/src/MOLECULE/dihedral_multi_harmonic.h
index a768cb6d62..c833168139 100644
--- a/src/MOLECULE/dihedral_multi_harmonic.h
+++ b/src/MOLECULE/dihedral_multi_harmonic.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/dihedral_opls.cpp b/src/MOLECULE/dihedral_opls.cpp
index e60585deab..676434a061 100644
--- a/src/MOLECULE/dihedral_opls.cpp
+++ b/src/MOLECULE/dihedral_opls.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -164,22 +164,22 @@ void DihedralOPLS::compute(int eflag, int vflag)
       int me;
       MPI_Comm_rank(world,&me);
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
-		me,update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+                me,update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
 
@@ -195,10 +195,10 @@ void DihedralOPLS::compute(int eflag, int vflag)
 
     p = k1[type]*(1.0 + c) + k2[type]*(1.0 - cos(2.0*phi)) +
       k3[type]*(1.0 + cos(3.0*phi)) + k4[type]*(1.0 - cos(4.0*phi)) ;
-    pd = k1[type] - 2.0*k2[type]*sin(2.0*phi)*siinv + 
+    pd = k1[type] - 2.0*k2[type]*sin(2.0*phi)*siinv +
       3.0*k3[type]*sin(3.0*phi)*siinv - 4.0*k4[type]*sin(4.0*phi)*siinv;
 
-    if (eflag) edihedral = p; 
+    if (eflag) edihedral = p;
 
     a = pd;
     c = c * a;
@@ -258,7 +258,7 @@ void DihedralOPLS::compute(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,f1,f3,f4,
-	       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+               vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
   }
 }
 
@@ -311,7 +311,7 @@ void DihedralOPLS::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void DihedralOPLS::write_restart(FILE *fp)
@@ -323,7 +323,7 @@ void DihedralOPLS::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void DihedralOPLS::read_restart(FILE *fp)
@@ -340,6 +340,6 @@ void DihedralOPLS::read_restart(FILE *fp)
   MPI_Bcast(&k2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
   MPI_Bcast(&k3[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
   MPI_Bcast(&k4[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
- 
+
   for (int i = 1; i <= atom->ndihedraltypes; i++) setflag[i] = 1;
 }
diff --git a/src/MOLECULE/dihedral_opls.h b/src/MOLECULE/dihedral_opls.h
index e2c0d6b2c4..500a5927a1 100644
--- a/src/MOLECULE/dihedral_opls.h
+++ b/src/MOLECULE/dihedral_opls.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/improper_cvff.cpp b/src/MOLECULE/improper_cvff.cpp
index 401bcad85a..a75d6c077d 100644
--- a/src/MOLECULE/improper_cvff.cpp
+++ b/src/MOLECULE/improper_cvff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -103,18 +103,18 @@ void ImproperCvff::compute(int eflag, int vflag)
     domain->minimum_image(vb3x,vb3y,vb3z);
 
     // c0 calculation
-        
+
     sb1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
     sb2 = 1.0 / (vb2x*vb2x + vb2y*vb2y + vb2z*vb2z);
     sb3 = 1.0 / (vb3x*vb3x + vb3y*vb3y + vb3z*vb3z);
-        
+
     rb1 = sqrt(sb1);
     rb3 = sqrt(sb3);
-        
+
     c0 = (vb1x*vb3x + vb1y*vb3y + vb1z*vb3z) * rb1*rb3;
 
     // 1st and 2nd angle
-        
+
     b1mag2 = vb1x*vb1x + vb1y*vb1y + vb1z*vb1z;
     b1mag = sqrt(b1mag2);
     b2mag2 = vb2x*vb2x + vb2y*vb2y + vb2z*vb2z;
@@ -151,23 +151,23 @@ void ImproperCvff::compute(int eflag, int vflag)
       int me;
       MPI_Comm_rank(world,&me);
       if (screen) {
-	char str[128];
-	sprintf(str,
-		"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
-		me,update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,
+                "Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
+                me,update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
 
@@ -175,7 +175,7 @@ void ImproperCvff::compute(int eflag, int vflag)
     // p = 1 + cos(n*phi) for d = 1
     // p = 1 - cos(n*phi) for d = -1
     // pd = dp/dc / 2
-        
+
     m = multiplicity[type];
 
     if (m == 2) {
@@ -204,7 +204,7 @@ void ImproperCvff::compute(int eflag, int vflag)
       p = 2.0;
       pd = 0.0;
     }
-    
+
     if (sign[type] == -1) {
       p = 2.0 - p;
       pd = -pd;
@@ -270,7 +270,7 @@ void ImproperCvff::compute(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,eimproper,f1,f3,f4,
-	       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+               vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
   }
 }
 
@@ -318,7 +318,7 @@ void ImproperCvff::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void ImproperCvff::write_restart(FILE *fp)
@@ -329,7 +329,7 @@ void ImproperCvff::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void ImproperCvff::read_restart(FILE *fp)
diff --git a/src/MOLECULE/improper_cvff.h b/src/MOLECULE/improper_cvff.h
index 5f8755b30c..f6d6c36d1c 100644
--- a/src/MOLECULE/improper_cvff.h
+++ b/src/MOLECULE/improper_cvff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/improper_harmonic.cpp b/src/MOLECULE/improper_harmonic.cpp
index 87d94079bd..dae70277c9 100644
--- a/src/MOLECULE/improper_harmonic.cpp
+++ b/src/MOLECULE/improper_harmonic.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -96,13 +96,13 @@ void ImproperHarmonic::compute(int eflag, int vflag)
     ss1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
     ss2 = 1.0 / (vb2x*vb2x + vb2y*vb2y + vb2z*vb2z);
     ss3 = 1.0 / (vb3x*vb3x + vb3y*vb3y + vb3z*vb3z);
-        
+
     r1 = sqrt(ss1);
     r2 = sqrt(ss2);
     r3 = sqrt(ss3);
-        
+
     // sin and cos of angle
-        
+
     c0 = (vb1x * vb3x + vb1y * vb3y + vb1z * vb3z) * r1 * r3;
     c1 = (vb1x * vb2x + vb1y * vb2y + vb1z * vb2z) * r1 * r2;
     c2 = -(vb3x * vb2x + vb3y * vb2y + vb3z * vb2z) * r3 * r2;
@@ -124,23 +124,23 @@ void ImproperHarmonic::compute(int eflag, int vflag)
       int me;
       MPI_Comm_rank(world,&me);
       if (screen) {
-	char str[128];
-	sprintf(str,
-		"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
-		me,update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,
+                "Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
+                me,update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
 
@@ -212,7 +212,7 @@ void ImproperHarmonic::compute(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,eimproper,f1,f3,f4,
-	       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+               vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
   }
 }
 
@@ -259,7 +259,7 @@ void ImproperHarmonic::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void ImproperHarmonic::write_restart(FILE *fp)
@@ -269,7 +269,7 @@ void ImproperHarmonic::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void ImproperHarmonic::read_restart(FILE *fp)
diff --git a/src/MOLECULE/improper_harmonic.h b/src/MOLECULE/improper_harmonic.h
index f75df37dc5..621582edff 100644
--- a/src/MOLECULE/improper_harmonic.h
+++ b/src/MOLECULE/improper_harmonic.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/improper_hybrid.cpp b/src/MOLECULE/improper_hybrid.cpp
index 898b3cd350..e89e644ced 100644
--- a/src/MOLECULE/improper_hybrid.cpp
+++ b/src/MOLECULE/improper_hybrid.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -79,10 +79,10 @@ void ImproperHybrid::compute(int eflag, int vflag)
     }
     for (m = 0; m < nstyles; m++) {
       if (nimproperlist[m] > maximproper[m]) {
-	memory->destroy(improperlist[m]);
-	maximproper[m] = nimproperlist[m] + EXTRA;
-	memory->create(improperlist[m],maximproper[m],5,
-		       "improper_hybrid:improperlist");
+        memory->destroy(improperlist[m]);
+        maximproper[m] = nimproperlist[m] + EXTRA;
+        memory->create(improperlist[m],maximproper[m],5,
+                       "improper_hybrid:improperlist");
       }
       nimproperlist[m] = 0;
     }
@@ -98,7 +98,7 @@ void ImproperHybrid::compute(int eflag, int vflag)
       nimproperlist[m]++;
     }
   }
-  
+
   // call each sub-style's compute function
   // set neighbor->improperlist to sub-style improperlist before call
   // accumulate sub-style global/peratom energy/virial in hybrid
@@ -126,8 +126,8 @@ void ImproperHybrid::compute(int eflag, int vflag)
       if (force->newton_bond) n += atom->nghost;
       double **vatom_substyle = styles[m]->vatom;
       for (i = 0; i < n; i++)
-	for (j = 0; j < 6; j++)
-	  vatom[i][j] += vatom_substyle[i][j];
+        for (j = 0; j < 6; j++)
+          vatom[i][j] += vatom_substyle[i][j];
     }
   }
 
@@ -169,13 +169,13 @@ void ImproperHybrid::settings(int narg, char **arg)
 
   for (int m = 0; m < nstyles; m++) {
     for (int i = 0; i < m; i++)
-      if (strcmp(arg[m],arg[i]) == 0) 
-	error->all(FLERR,
-		   "Improper style hybrid cannot use same improper style twice");
-    if (strcmp(arg[m],"hybrid") == 0) 
+      if (strcmp(arg[m],arg[i]) == 0)
+        error->all(FLERR,
+                   "Improper style hybrid cannot use same improper style twice");
+    if (strcmp(arg[m],"hybrid") == 0)
       error->all(FLERR,
-		 "Improper style hybrid cannot have hybrid as an argument");
-    if (strcmp(arg[m],"none") == 0) 
+                 "Improper style hybrid cannot have hybrid as an argument");
+    if (strcmp(arg[m],"none") == 0)
       error->all(FLERR,"Improper style hybrid cannot have none as an argument");
     styles[m] = force->new_improper(arg[m],lmp->suffix,dummy);
     keywords[m] = new char[strlen(arg[m])+1];
@@ -259,7 +259,7 @@ void ImproperHybrid::read_restart(FILE *fp)
   keywords = new char*[nstyles];
 
   allocate();
-  
+
   int n,dummy;
   for (int m = 0; m < nstyles; m++) {
     if (me == 0) fread(&n,sizeof(int),1,fp);
@@ -280,7 +280,7 @@ double ImproperHybrid::memory_usage()
   double bytes = maxeatom * sizeof(double);
   bytes += maxvatom*6 * sizeof(double);
   for (int m = 0; m < nstyles; m++) bytes += maximproper[m]*5 * sizeof(int);
-  for (int m = 0; m < nstyles; m++) 
+  for (int m = 0; m < nstyles; m++)
     if (styles[m]) bytes += styles[m]->memory_usage();
   return bytes;
 }
diff --git a/src/MOLECULE/improper_hybrid.h b/src/MOLECULE/improper_hybrid.h
index 6a542811bf..a54eb6fe5c 100644
--- a/src/MOLECULE/improper_hybrid.h
+++ b/src/MOLECULE/improper_hybrid.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -46,7 +46,7 @@ class ImproperHybrid : public Improper {
   int *nimproperlist;           // # of impropers in sub-style improperlists
   int *maximproper;             // max # of impropers sub-style lists can store
   int ***improperlist;          // improperlist for each sub-style
-  
+
   void allocate();
 };
 
diff --git a/src/MOLECULE/improper_umbrella.cpp b/src/MOLECULE/improper_umbrella.cpp
index 5858e48556..61055a9598 100644
--- a/src/MOLECULE/improper_umbrella.cpp
+++ b/src/MOLECULE/improper_umbrella.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -130,23 +130,23 @@ void ImproperUmbrella::compute(int eflag, int vflag)
       int me;
       MPI_Comm_rank(world,&me);
       if (screen) {
-	char str[128];
-	sprintf(str,
-		"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
-		me,update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,
+                "Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
+                me,update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) s = 1.0;
     if (c < -1.0) s = -1.0;
 
@@ -154,15 +154,15 @@ void ImproperUmbrella::compute(int eflag, int vflag)
     if (s < SMALL) s = SMALL;
     cotphi = c/s;
 
-    projhfg = (vb3x*vb1x+vb3y*vb1y+vb3z*vb1z) / 
-      sqrt(vb1x*vb1x+vb1y*vb1y+vb1z*vb1z); 
-    projhfg += (vb3x*vb2x+vb3y*vb2y+vb3z*vb2z) / 
+    projhfg = (vb3x*vb1x+vb3y*vb1y+vb3z*vb1z) /
+      sqrt(vb1x*vb1x+vb1y*vb1y+vb1z*vb1z);
+    projhfg += (vb3x*vb2x+vb3y*vb2y+vb3z*vb2z) /
       sqrt(vb2x*vb2x+vb2y*vb2y+vb2z*vb2z);
     if (projhfg > 0.0) {
       s *= -1.0;
       cotphi *= -1.0;
     }
-	
+
     //  force and energy
     // if w0 = 0: E = k * (1 - cos w)
     // if w0 != 0: E = 0.5 * C (cos w - cos w0)^2, C = k/(sin(w0)^2
@@ -232,7 +232,7 @@ void ImproperUmbrella::compute(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,eimproper,f1,f3,f4,
-	       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+               vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
   }
 }
 
@@ -282,7 +282,7 @@ void ImproperUmbrella::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void ImproperUmbrella::write_restart(FILE *fp)
@@ -293,7 +293,7 @@ void ImproperUmbrella::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void ImproperUmbrella::read_restart(FILE *fp)
diff --git a/src/MOLECULE/improper_umbrella.h b/src/MOLECULE/improper_umbrella.h
index fd3d47127f..3d005aa105 100644
--- a/src/MOLECULE/improper_umbrella.h
+++ b/src/MOLECULE/improper_umbrella.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp
index 77302e6694..c5fd2b0269 100644
--- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp
+++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -39,7 +39,7 @@ using namespace MathConst;
 
 /* ---------------------------------------------------------------------- */
 
-PairHbondDreidingLJ::PairHbondDreidingLJ(LAMMPS *lmp) : Pair(lmp) 
+PairHbondDreidingLJ::PairHbondDreidingLJ(LAMMPS *lmp) : Pair(lmp)
 {
   // hbond cannot compute virial as F dot r
   // due to using map() to find bonded H atoms which are not near donor atom
@@ -88,19 +88,19 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
   evdwl = ehbond = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   double **x = atom->x;
   double **f = atom->f;
   int **special = atom->special;
   int *type = atom->type;
   int **nspecial = atom->nspecial;
   double *special_lj = force->special_lj;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // ii = loop over donors
   // jj = loop over acceptors
   // kk = loop over hydrogens bonded to donor
@@ -115,7 +115,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
     knum = nspecial[i][0];
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       factor_hb = special_lj[sbmask(j)];
@@ -130,110 +130,110 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
       rsq = delx*delx + dely*dely + delz*delz;
 
       for (kk = 0; kk < knum; kk++) {
-	k = atom->map(klist[kk]);
-	if (k < 0) continue;
-	ktype = type[k];
-	m = type2param[itype][jtype][ktype];
-	if (m < 0) continue;
-	pm = &params[m];
-
-	if (rsq < pm->cut_outersq) {
-	  delr1[0] = x[i][0] - x[k][0];
-	  delr1[1] = x[i][1] - x[k][1];
-	  delr1[2] = x[i][2] - x[k][2];
-	  domain->minimum_image(delr1);
-	  rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
-	  r1 = sqrt(rsq1);
-	  
-	  delr2[0] = x[j][0] - x[k][0];
-	  delr2[1] = x[j][1] - x[k][1];
-	  delr2[2] = x[j][2] - x[k][2];
-	  domain->minimum_image(delr2);
-	  rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
-	  r2 = sqrt(rsq2);
-	  
-	  // angle (cos and sin)
-	  
-	  c = delr1[0]*delr2[0] + delr1[1]*delr2[1] + delr1[2]*delr2[2];
-	  c /= r1*r2;
-	  if (c > 1.0) c = 1.0;
-	  if (c < -1.0) c = -1.0;
-	  ac = acos(c);
-
-	  if (ac > pm->cut_angle && ac < (2.0*MY_PI - pm->cut_angle)) {
-	    s = sqrt(1.0 - c*c);
-	    if (s < SMALL) s = SMALL;
-
-	    // LJ-specific kernel
-
-	    r2inv = 1.0/rsq;
-	    r10inv = r2inv*r2inv*r2inv*r2inv*r2inv;
-	    force_kernel = r10inv*(pm->lj1*r2inv - pm->lj2)*r2inv * 
-	      pow(c,(double)pm->ap);
-	    force_angle = pm->ap * r10inv*(pm->lj3*r2inv - pm->lj4) * 
-	      pow(c,(double)pm->ap-1.0)*s;
-
-	    eng_lj = r10inv*(pm->lj3*r2inv - pm->lj4);
-	    if (rsq > pm->cut_innersq) {
-	      switch1 = (pm->cut_outersq-rsq) * (pm->cut_outersq-rsq) * 
-			(pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
-			pm->denom_vdw;
-	      switch2 = 12.0*rsq * (pm->cut_outersq-rsq) *
-			(rsq-pm->cut_innersq) / pm->denom_vdw;
-	      force_kernel = force_kernel*switch1 + eng_lj*switch2;
-	      eng_lj *= switch1;
-	    }
-
-	    if (eflag) {
-	      evdwl = eng_lj * pow(c,(double)pm->ap);
-	      evdwl *= factor_hb;
-	      ehbond += evdwl;
-	    }
-
-	    a = factor_hb*force_angle/s;
-	    b = factor_hb*force_kernel;
-	    
-	    a11 = a*c / rsq1;
-	    a12 = -a / (r1*r2);
-	    a22 = a*c / rsq2;
-	    
-	    vx1 = a11*delr1[0] + a12*delr2[0];
-	    vx2 = a22*delr2[0] + a12*delr1[0];
-	    vy1 = a11*delr1[1] + a12*delr2[1];
-	    vy2 = a22*delr2[1] + a12*delr1[1];
-	    vz1 = a11*delr1[2] + a12*delr2[2];
-	    vz2 = a22*delr2[2] + a12*delr1[2];
-	    
-	    fi[0] = vx1 + b*delx;
-	    fi[1] = vy1 + b*dely;
-	    fi[2] = vz1 + b*delz;
-	    fj[0] = vx2 - b*delx;
-	    fj[1] = vy2 - b*dely;
-	    fj[2] = vz2 - b*delz;
-
-	    f[i][0] += fi[0];
-	    f[i][1] += fi[1];
-	    f[i][2] += fi[2];
-
-	    f[j][0] += fj[0];
-	    f[j][1] += fj[1];
-	    f[j][2] += fj[2];
-	    
-	    f[k][0] -= vx1 + vx2;
-	    f[k][1] -= vy1 + vy2;
-	    f[k][2] -= vz1 + vz2;
-
-	    // KIJ instead of IJK b/c delr1/delr2 are both with respect to k
-
-	    if (evflag) ev_tally3(k,i,j,evdwl,0.0,fi,fj,delr1,delr2);
-
-	    hbcount++;
-	  }
+        k = atom->map(klist[kk]);
+        if (k < 0) continue;
+        ktype = type[k];
+        m = type2param[itype][jtype][ktype];
+        if (m < 0) continue;
+        pm = &params[m];
+
+        if (rsq < pm->cut_outersq) {
+          delr1[0] = x[i][0] - x[k][0];
+          delr1[1] = x[i][1] - x[k][1];
+          delr1[2] = x[i][2] - x[k][2];
+          domain->minimum_image(delr1);
+          rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
+          r1 = sqrt(rsq1);
+
+          delr2[0] = x[j][0] - x[k][0];
+          delr2[1] = x[j][1] - x[k][1];
+          delr2[2] = x[j][2] - x[k][2];
+          domain->minimum_image(delr2);
+          rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
+          r2 = sqrt(rsq2);
+
+          // angle (cos and sin)
+
+          c = delr1[0]*delr2[0] + delr1[1]*delr2[1] + delr1[2]*delr2[2];
+          c /= r1*r2;
+          if (c > 1.0) c = 1.0;
+          if (c < -1.0) c = -1.0;
+          ac = acos(c);
+
+          if (ac > pm->cut_angle && ac < (2.0*MY_PI - pm->cut_angle)) {
+            s = sqrt(1.0 - c*c);
+            if (s < SMALL) s = SMALL;
+
+            // LJ-specific kernel
+
+            r2inv = 1.0/rsq;
+            r10inv = r2inv*r2inv*r2inv*r2inv*r2inv;
+            force_kernel = r10inv*(pm->lj1*r2inv - pm->lj2)*r2inv *
+              pow(c,(double)pm->ap);
+            force_angle = pm->ap * r10inv*(pm->lj3*r2inv - pm->lj4) *
+              pow(c,(double)pm->ap-1.0)*s;
+
+            eng_lj = r10inv*(pm->lj3*r2inv - pm->lj4);
+            if (rsq > pm->cut_innersq) {
+              switch1 = (pm->cut_outersq-rsq) * (pm->cut_outersq-rsq) *
+                        (pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
+                        pm->denom_vdw;
+              switch2 = 12.0*rsq * (pm->cut_outersq-rsq) *
+                        (rsq-pm->cut_innersq) / pm->denom_vdw;
+              force_kernel = force_kernel*switch1 + eng_lj*switch2;
+              eng_lj *= switch1;
+            }
+
+            if (eflag) {
+              evdwl = eng_lj * pow(c,(double)pm->ap);
+              evdwl *= factor_hb;
+              ehbond += evdwl;
+            }
+
+            a = factor_hb*force_angle/s;
+            b = factor_hb*force_kernel;
+
+            a11 = a*c / rsq1;
+            a12 = -a / (r1*r2);
+            a22 = a*c / rsq2;
+
+            vx1 = a11*delr1[0] + a12*delr2[0];
+            vx2 = a22*delr2[0] + a12*delr1[0];
+            vy1 = a11*delr1[1] + a12*delr2[1];
+            vy2 = a22*delr2[1] + a12*delr1[1];
+            vz1 = a11*delr1[2] + a12*delr2[2];
+            vz2 = a22*delr2[2] + a12*delr1[2];
+
+            fi[0] = vx1 + b*delx;
+            fi[1] = vy1 + b*dely;
+            fi[2] = vz1 + b*delz;
+            fj[0] = vx2 - b*delx;
+            fj[1] = vy2 - b*dely;
+            fj[2] = vz2 - b*delz;
+
+            f[i][0] += fi[0];
+            f[i][1] += fi[1];
+            f[i][2] += fi[2];
+
+            f[j][0] += fj[0];
+            f[j][1] += fj[1];
+            f[j][2] += fj[2];
+
+            f[k][0] -= vx1 + vx2;
+            f[k][1] -= vy1 + vy2;
+            f[k][2] -= vz1 + vz2;
+
+            // KIJ instead of IJK b/c delr1/delr2 are both with respect to k
+
+            if (evflag) ev_tally3(k,i,j,evdwl,0.0,fi,fj,delr1,delr2);
+
+            hbcount++;
+          }
         }
       }
     }
   }
-  
+
   if (eflag_global) {
     pvector[0] = hbcount;
     pvector[1] = ehbond;
@@ -241,7 +241,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairHbondDreidingLJ::allocate()
@@ -257,27 +257,27 @@ void PairHbondDreidingLJ::allocate()
       setflag[i][j] = 1;
 
   memory->create(cutsq,n+1,n+1,"pair:cutsq");
-  
+
   donor = new int[n+1];
   acceptor = new int[n+1];
   memory->create(type2param,n+1,n+1,n+1,"pair:type2param");
 
   int i,j,k;
   for (i = 1; i <= n; i++)
-    for (j = 1; j <= n; j++) 
+    for (j = 1; j <= n; j++)
       for (k = 1; k <= n; k++)
         type2param[i][j][k] = -1;
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairHbondDreidingLJ::settings(int narg, char **arg)
 {
   if (narg != 4) error->all(FLERR,"Illegal pair_style command");
-  
-  ap_global = force->inumeric(arg[0]);  
+
+  ap_global = force->inumeric(arg[0]);
   cut_inner_global = force->numeric(arg[1]);
   cut_outer_global = force->numeric(arg[2]);
   cut_angle_global = force->numeric(arg[3]) * MY_PI/180.0;
@@ -292,12 +292,12 @@ void PairHbondDreidingLJ::coeff(int narg, char **arg)
   if (narg < 6 || narg > 9)
     error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
-  
+
   int ilo,ihi,jlo,jhi,klo,khi;
   force->bounds(arg[0],atom->ntypes,ilo,ihi);
   force->bounds(arg[1],atom->ntypes,jlo,jhi);
   force->bounds(arg[2],atom->ntypes,klo,khi);
-  
+
   int donor_flag;
   if (strcmp(arg[3],"i") == 0) donor_flag = 0;
   else if (strcmp(arg[3],"j") == 0) donor_flag = 1;
@@ -305,7 +305,7 @@ void PairHbondDreidingLJ::coeff(int narg, char **arg)
 
   double epsilon_one = force->numeric(arg[4]);
   double sigma_one = force->numeric(arg[5]);
-  
+
   int ap_one = ap_global;
   if (narg > 6) ap_one = force->inumeric(arg[6]);
   double cut_inner_one = cut_inner_global;
@@ -323,7 +323,7 @@ void PairHbondDreidingLJ::coeff(int narg, char **arg)
   if (nparams == maxparam) {
     maxparam += CHUNK;
     params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
-					"pair:params");
+                                        "pair:params");
   }
 
   params[nparams].epsilon = epsilon_one;
@@ -334,10 +334,10 @@ void PairHbondDreidingLJ::coeff(int narg, char **arg)
   params[nparams].cut_innersq = cut_inner_one*cut_inner_one;
   params[nparams].cut_outersq = cut_outer_one*cut_outer_one;
   params[nparams].cut_angle = cut_angle_one;
-  params[nparams].denom_vdw = 
+  params[nparams].denom_vdw =
     (params[nparams].cut_outersq-params[nparams].cut_innersq) *
     (params[nparams].cut_outersq-params[nparams].cut_innersq) *
-    (params[nparams].cut_outersq-params[nparams].cut_innersq);	
+    (params[nparams].cut_outersq-params[nparams].cut_innersq);
 
   // flag type2param with either i,j = D,A or j,i = D,A
 
@@ -345,9 +345,9 @@ void PairHbondDreidingLJ::coeff(int narg, char **arg)
   for (int i = ilo; i <= ihi; i++)
     for (int j = MAX(jlo,i); j <= jhi; j++)
       for (int k = klo; k <= khi; k++) {
-	if (donor_flag == 0) type2param[i][j][k] = nparams;
-	else type2param[j][i][k] = nparams;
-	count++;
+        if (donor_flag == 0) type2param[i][j][k] = nparams;
+        else type2param[j][i][k] = nparams;
+        count++;
       }
   nparams++;
 
@@ -369,9 +369,9 @@ void PairHbondDreidingLJ::init_style()
     error->all(FLERR,"Pair style hbond/dreiding requires molecular system");
   if (atom->tag_enable == 0)
     error->all(FLERR,"Pair style hbond/dreiding requires atom IDs");
-  if (atom->map_style == 0) 
+  if (atom->map_style == 0)
     error->all(FLERR,"Pair style hbond/dreiding requires an atom map, "
-	       "see atom_modify");
+               "see atom_modify");
   if (force->newton_pair == 0)
     error->all(FLERR,"Pair style hbond/dreiding requires newton pair on");
 
@@ -383,11 +383,11 @@ void PairHbondDreidingLJ::init_style()
   for (int i = 1; i <= n; i++)
     for (int j = 1; j <= n; j++)
       for (int k = 1; k <= n; k++)
-	if (type2param[i][j][k] >= 0) {
-	  anyflag = 1;
-	  donor[i] = 1;
-	  acceptor[j] = 1;
-	}
+        if (type2param[i][j][k] >= 0) {
+          anyflag = 1;
+          donor[i] = 1;
+          acceptor[j] = 1;
+        }
 
   if (!anyflag) error->all(FLERR,"No pair hbond/dreiding coefficients set");
 
@@ -399,21 +399,21 @@ void PairHbondDreidingLJ::init_style()
     params[m].lj2 = 60.0*params[m].epsilon*pow(params[m].sigma,10.0);
     params[m].lj3 = 5.0*params[m].epsilon*pow(params[m].sigma,12.0);
     params[m].lj4 = 6.0*params[m].epsilon*pow(params[m].sigma,10.0);
-    
+
     /*
     if (offset_flag) {
       double ratio = params[m].sigma / params[m].cut_outer;
-      params[m].offset = params[m].epsilon * 
-	((2.0*pow(ratio,9.0)) - (3.0*pow(ratio,6.0)));
+      params[m].offset = params[m].epsilon *
+        ((2.0*pow(ratio,9.0)) - (3.0*pow(ratio,6.0)));
     } else params[m].offset = 0.0;
     */
   }
-  
+
   // full neighbor list request
 
   int irequest = neighbor->request(this);
   neighbor->requests[irequest]->half = 0;
-  neighbor->requests[irequest]->full = 1; 
+  neighbor->requests[irequest]->full = 1;
 }
 
 /* ----------------------------------------------------------------------
@@ -460,7 +460,7 @@ double PairHbondDreidingLJ::single(int i, int j, int itype, int jtype,
 
   eng = 0.0;
   fforce = 0;
-  
+
   // sanity check
 
   if (!donor[itype]) return 0.0;
@@ -468,7 +468,7 @@ double PairHbondDreidingLJ::single(int i, int j, int itype, int jtype,
 
   klist = special[i];
   knum = nspecial[i][0];
-    
+
   factor_hb = special_lj[sbmask(j)];
 
   for (kk = 0; kk < knum; kk++) {
@@ -485,16 +485,16 @@ double PairHbondDreidingLJ::single(int i, int j, int itype, int jtype,
     domain->minimum_image(delr1);
     rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
     r1 = sqrt(rsq1);
-	  
+
     delr2[0] = x[j][0] - x[k][0];
     delr2[1] = x[j][1] - x[k][1];
     delr2[2] = x[j][2] - x[k][2];
     domain->minimum_image(delr2);
     rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
     r2 = sqrt(rsq2);
-	  
+
     // angle (cos and sin)
-	  
+
     c = delr1[0]*delr2[0] + delr1[1]*delr2[1] + delr1[2]*delr2[2];
     c /= r1*r2;
     if (c > 1.0) c = 1.0;
@@ -509,20 +509,20 @@ double PairHbondDreidingLJ::single(int i, int j, int itype, int jtype,
 
     r2inv = 1.0/rsq;
     r10inv = r2inv*r2inv*r2inv*r2inv*r2inv;
-    force_kernel = r10inv*(pm->lj1*r2inv - pm->lj2)*r2inv * 
+    force_kernel = r10inv*(pm->lj1*r2inv - pm->lj2)*r2inv *
       pow(c,(double)pm->ap);
-    force_angle = pm->ap * r10inv*(pm->lj3*r2inv - pm->lj4) * 
+    force_angle = pm->ap * r10inv*(pm->lj3*r2inv - pm->lj4) *
       pow(c,(double)pm->ap-1.0)*s;
 
     // only lj part for now
 
-    eng_lj = r10inv*(pm->lj3*r2inv - pm->lj4); 
+    eng_lj = r10inv*(pm->lj3*r2inv - pm->lj4);
     if (rsq > pm->cut_innersq) {
-      switch1 = (pm->cut_outersq-rsq) * (pm->cut_outersq-rsq) * 
-		(pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
-		pm->denom_vdw;
+      switch1 = (pm->cut_outersq-rsq) * (pm->cut_outersq-rsq) *
+                (pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
+                pm->denom_vdw;
       switch2 = 12.0*rsq * (pm->cut_outersq-rsq) *
-		(rsq-pm->cut_innersq) / pm->denom_vdw;
+                (rsq-pm->cut_innersq) / pm->denom_vdw;
       force_kernel = force_kernel*switch1 + eng_lj*switch2;
       eng_lj *= switch1;
     }
diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.h b/src/MOLECULE/pair_hbond_dreiding_lj.h
index 942a5bfa47..588ec8ab74 100644
--- a/src/MOLECULE/pair_hbond_dreiding_lj.h
+++ b/src/MOLECULE/pair_hbond_dreiding_lj.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.cpp b/src/MOLECULE/pair_hbond_dreiding_morse.cpp
index 185dbc84e0..044946bd13 100644
--- a/src/MOLECULE/pair_hbond_dreiding_morse.cpp
+++ b/src/MOLECULE/pair_hbond_dreiding_morse.cpp
@@ -5,9 +5,9 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
    ------------------------------------------------------------------------- */
 
@@ -39,7 +39,7 @@ using namespace MathConst;
 
 /* ---------------------------------------------------------------------- */
 
-PairHbondDreidingMorse::PairHbondDreidingMorse(LAMMPS *lmp) : 
+PairHbondDreidingMorse::PairHbondDreidingMorse(LAMMPS *lmp) :
   PairHbondDreidingLJ(lmp) {}
 
 /* ---------------------------------------------------------------------- */
@@ -58,19 +58,19 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
   evdwl = ehbond = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   double **x = atom->x;
   double **f = atom->f;
   int **special = atom->special;
   int *type = atom->type;
   int **nspecial = atom->nspecial;
   double *special_lj = force->special_lj;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // ii = loop over donors
   // jj = loop over acceptors
   // kk = loop over hydrogens bonded to donor
@@ -85,7 +85,7 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
     knum = nspecial[i][0];
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       factor_hb = special_lj[sbmask(j)];
@@ -98,106 +98,106 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
       dely = x[i][1] - x[j][1];
       delz = x[i][2] - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
-	
+
       for (kk = 0; kk < knum; kk++) {
-	k = atom->map(klist[kk]);
-	if (k < 0) continue;
-	ktype = type[k];
-	m = type2param[itype][jtype][ktype];
-	if (m < 0) continue;
-	pm = &params[m];
-
-	if (rsq < pm->cut_outersq) {
-	  delr1[0] = x[i][0] - x[k][0];
-	  delr1[1] = x[i][1] - x[k][1];
-	  delr1[2] = x[i][2] - x[k][2];
-	  domain->minimum_image(delr1);
-	  rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
-	  r1 = sqrt(rsq1);
-	  
-	  delr2[0] = x[j][0] - x[k][0];
-	  delr2[1] = x[j][1] - x[k][1];
-	  delr2[2] = x[j][2] - x[k][2];
-	  domain->minimum_image(delr2);
-	  rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
-	  r2 = sqrt(rsq2);
-	  
-	  // angle (cos and sin)
-	  
-	  c = delr1[0]*delr2[0] + delr1[1]*delr2[1] + delr1[2]*delr2[2];
-	  c /= r1*r2;
-	  if (c > 1.0) c = 1.0;
-	  if (c < -1.0) c = -1.0;
-	  ac = acos(c);
-
-	  if (ac > pm->cut_angle && ac < (2.0*MY_PI - pm->cut_angle)) {
-	    s = sqrt(1.0 - c*c);
-	    if (s < SMALL) s = SMALL;
-
-	    // Morse-specific kernel
-
-	    r = sqrt(rsq);
-	    dr = r - pm->r0;
-	    dexp = exp(-pm->alpha * dr);
-	    force_kernel = pm->morse1*(dexp*dexp - dexp)/r * pow(c,(double)pm->ap);
-	    force_angle = pm->ap * eng_morse * pow(c,pm->ap-1.0)*s;
-
-	    eng_morse = pm->d0 * (dexp*dexp - 2.0*dexp);
-	    if (rsq > pm->cut_innersq) {
-	      switch1 = (pm->cut_outersq-rsq) * (pm->cut_outersq-rsq) *
-			(pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
-			pm->denom_vdw;
-	      switch2 = 12.0*rsq * (pm->cut_outersq-rsq) *
-			(rsq-pm->cut_innersq) / pm->denom_vdw;
-	      force_kernel = force_kernel*switch1 + eng_morse*switch2;
-	      eng_morse *= switch1;
-	    }
-   
-	    if (eflag) {
-	      evdwl = eng_morse * pow(c,(double)params[m].ap);
-	      evdwl *= factor_hb;
-	      ehbond += evdwl;
-	    }
-
-	    a = factor_hb*force_angle/s;
-	    b = factor_hb*force_kernel;
-	    
-	    a11 = a*c / rsq1;
-	    a12 = -a / (r1*r2);
-	    a22 = a*c / rsq2;
-	    
-	    vx1 = a11*delr1[0] + a12*delr2[0];
-	    vx2 = a22*delr2[0] + a12*delr1[0];
-	    vy1 = a11*delr1[1] + a12*delr2[1];
-	    vy2 = a22*delr2[1] + a12*delr1[1];
-	    vz1 = a11*delr1[2] + a12*delr2[2];
-	    vz2 = a22*delr2[2] + a12*delr1[2];
-	    
-	    fi[0] = vx1 + b*delx;
-	    fi[1] = vy1 + b*dely;
-	    fi[2] = vz1 + b*delz;
-	    fj[0] = vx2 - b*delx;
-	    fj[1] = vy2 - b*dely;
-	    fj[2] = vz2 - b*delz;
-
-	    f[i][0] += fi[0];
-	    f[i][1] += fi[1];
-	    f[i][2] += fi[2];
-
-	    f[j][0] += fj[0];
-	    f[j][1] += fj[1];
-	    f[j][2] += fj[2];
-	    
-	    f[k][0] -= vx1 + vx2;
-	    f[k][1] -= vy1 + vy2;
-	    f[k][2] -= vz1 + vz2;
-
-	    // KIJ instead of IJK b/c delr1/delr2 are both with respect to k
-
-	    if (evflag) ev_tally3(k,i,j,evdwl,0.0,fi,fj,delr1,delr2);
-
-	    hbcount++;
-	  }
+        k = atom->map(klist[kk]);
+        if (k < 0) continue;
+        ktype = type[k];
+        m = type2param[itype][jtype][ktype];
+        if (m < 0) continue;
+        pm = &params[m];
+
+        if (rsq < pm->cut_outersq) {
+          delr1[0] = x[i][0] - x[k][0];
+          delr1[1] = x[i][1] - x[k][1];
+          delr1[2] = x[i][2] - x[k][2];
+          domain->minimum_image(delr1);
+          rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
+          r1 = sqrt(rsq1);
+
+          delr2[0] = x[j][0] - x[k][0];
+          delr2[1] = x[j][1] - x[k][1];
+          delr2[2] = x[j][2] - x[k][2];
+          domain->minimum_image(delr2);
+          rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
+          r2 = sqrt(rsq2);
+
+          // angle (cos and sin)
+
+          c = delr1[0]*delr2[0] + delr1[1]*delr2[1] + delr1[2]*delr2[2];
+          c /= r1*r2;
+          if (c > 1.0) c = 1.0;
+          if (c < -1.0) c = -1.0;
+          ac = acos(c);
+
+          if (ac > pm->cut_angle && ac < (2.0*MY_PI - pm->cut_angle)) {
+            s = sqrt(1.0 - c*c);
+            if (s < SMALL) s = SMALL;
+
+            // Morse-specific kernel
+
+            r = sqrt(rsq);
+            dr = r - pm->r0;
+            dexp = exp(-pm->alpha * dr);
+            force_kernel = pm->morse1*(dexp*dexp - dexp)/r * pow(c,(double)pm->ap);
+            force_angle = pm->ap * eng_morse * pow(c,pm->ap-1.0)*s;
+
+            eng_morse = pm->d0 * (dexp*dexp - 2.0*dexp);
+            if (rsq > pm->cut_innersq) {
+              switch1 = (pm->cut_outersq-rsq) * (pm->cut_outersq-rsq) *
+                        (pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
+                        pm->denom_vdw;
+              switch2 = 12.0*rsq * (pm->cut_outersq-rsq) *
+                        (rsq-pm->cut_innersq) / pm->denom_vdw;
+              force_kernel = force_kernel*switch1 + eng_morse*switch2;
+              eng_morse *= switch1;
+            }
+
+            if (eflag) {
+              evdwl = eng_morse * pow(c,(double)params[m].ap);
+              evdwl *= factor_hb;
+              ehbond += evdwl;
+            }
+
+            a = factor_hb*force_angle/s;
+            b = factor_hb*force_kernel;
+
+            a11 = a*c / rsq1;
+            a12 = -a / (r1*r2);
+            a22 = a*c / rsq2;
+
+            vx1 = a11*delr1[0] + a12*delr2[0];
+            vx2 = a22*delr2[0] + a12*delr1[0];
+            vy1 = a11*delr1[1] + a12*delr2[1];
+            vy2 = a22*delr2[1] + a12*delr1[1];
+            vz1 = a11*delr1[2] + a12*delr2[2];
+            vz2 = a22*delr2[2] + a12*delr1[2];
+
+            fi[0] = vx1 + b*delx;
+            fi[1] = vy1 + b*dely;
+            fi[2] = vz1 + b*delz;
+            fj[0] = vx2 - b*delx;
+            fj[1] = vy2 - b*dely;
+            fj[2] = vz2 - b*delz;
+
+            f[i][0] += fi[0];
+            f[i][1] += fi[1];
+            f[i][2] += fi[2];
+
+            f[j][0] += fj[0];
+            f[j][1] += fj[1];
+            f[j][2] += fj[2];
+
+            f[k][0] -= vx1 + vx2;
+            f[k][1] -= vy1 + vy2;
+            f[k][2] -= vz1 + vz2;
+
+            // KIJ instead of IJK b/c delr1/delr2 are both with respect to k
+
+            if (evflag) ev_tally3(k,i,j,evdwl,0.0,fi,fj,delr1,delr2);
+
+            hbcount++;
+          }
         }
       }
     }
@@ -223,7 +223,7 @@ void PairHbondDreidingMorse::coeff(int narg, char **arg)
   force->bounds(arg[0],atom->ntypes,ilo,ihi);
   force->bounds(arg[1],atom->ntypes,jlo,jhi);
   force->bounds(arg[2],atom->ntypes,klo,khi);
-  
+
   int donor_flag;
   if (strcmp(arg[3],"i") == 0) donor_flag = 0;
   else if (strcmp(arg[3],"j") == 0) donor_flag = 1;
@@ -251,7 +251,7 @@ void PairHbondDreidingMorse::coeff(int narg, char **arg)
   if (nparams == maxparam) {
     maxparam += CHUNK;
     params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
-					"pair:params");
+                                        "pair:params");
   }
 
   params[nparams].d0 = d0_one;
@@ -263,20 +263,20 @@ void PairHbondDreidingMorse::coeff(int narg, char **arg)
   params[nparams].cut_innersq = cut_inner_one*cut_inner_one;
   params[nparams].cut_outersq = cut_outer_one*cut_outer_one;
   params[nparams].cut_angle = cut_angle_one;
-  params[nparams].denom_vdw = 
+  params[nparams].denom_vdw =
     (params[nparams].cut_outersq-params[nparams].cut_innersq) *
     (params[nparams].cut_outersq-params[nparams].cut_innersq) *
     (params[nparams].cut_outersq-params[nparams].cut_innersq);
-  
+
   // flag type2param with either i,j = D,A or j,i = D,A
 
   int count = 0;
   for (int i = ilo; i <= ihi; i++)
     for (int j = MAX(jlo,i); j <= jhi; j++)
       for (int k = klo; k <= khi; k++) {
-	if (donor_flag == 0) type2param[i][j][k] = nparams;
-	else type2param[j][i][k] = nparams;
-	count++;
+        if (donor_flag == 0) type2param[i][j][k] = nparams;
+        else type2param[j][i][k] = nparams;
+        count++;
       }
   nparams++;
 
@@ -298,9 +298,9 @@ void PairHbondDreidingMorse::init_style()
     error->all(FLERR,"Pair style hbond/dreiding requires molecular system");
   if (atom->tag_enable == 0)
     error->all(FLERR,"Pair style hbond/dreiding requires atom IDs");
-  if (atom->map_style == 0) 
+  if (atom->map_style == 0)
     error->all(FLERR,"Pair style hbond/dreiding requires an atom map, "
-	       "see atom_modify");
+               "see atom_modify");
   if (force->newton_pair == 0)
     error->all(FLERR,"Pair style hbond/dreiding requires newton pair on");
 
@@ -312,11 +312,11 @@ void PairHbondDreidingMorse::init_style()
   for (int i = 1; i <= n; i++)
     for (int j = 1; j <= n; j++)
       for (int k = 1; k <= n; k++)
-	if (type2param[i][j][k] >= 0) {
-	  anyflag = 1;
-	  donor[i] = 1;
-	  acceptor[j] = 1;
-	}
+        if (type2param[i][j][k] >= 0) {
+          anyflag = 1;
+          donor[i] = 1;
+          acceptor[j] = 1;
+        }
 
   if (!anyflag) error->all(FLERR,"No pair hbond/dreiding coefficients set");
 
@@ -329,8 +329,8 @@ void PairHbondDreidingMorse::init_style()
     /*
     if (offset_flag) {
       double alpha_dr = -params[m].alpha * (params[m].cut - params[m].r0);
-      params[m].offset = params[m].d0 * 
-	((exp(2.0*alpha_dr)) - (2.0*exp(alpha_dr)));
+      params[m].offset = params[m].d0 *
+        ((exp(2.0*alpha_dr)) - (2.0*exp(alpha_dr)));
     } else params[m].offset = 0.0;
     */
   }
@@ -339,7 +339,7 @@ void PairHbondDreidingMorse::init_style()
 
   int irequest = neighbor->request(this);
   neighbor->requests[irequest]->half = 0;
-  neighbor->requests[irequest]->full = 1; 
+  neighbor->requests[irequest]->full = 1;
 }
 
 /* ---------------------------------------------------------------------- */
@@ -421,18 +421,17 @@ double PairHbondDreidingMorse::single(int i, int j, int itype, int jtype,
     eng_morse = pm->d0 * (dexp*dexp - 2.0*dexp);
     if (rsq > pm->cut_innersq) {
       switch1 = (pm->cut_outersq-rsq) * (pm->cut_outersq-rsq) *
-		(pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
-		pm->denom_vdw;
+                (pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
+                pm->denom_vdw;
       switch2 = 12.0*rsq * (pm->cut_outersq-rsq) *
-		(rsq-pm->cut_innersq) / pm->denom_vdw;
+                (rsq-pm->cut_innersq) / pm->denom_vdw;
       force_kernel = force_kernel*switch1 + eng_morse*switch2;
       eng_morse *= switch1;
     }
-   
+
     eng += eng_morse * pow(c,(double)params[m].ap)* factor_hb;
     fforce += force_kernel*pow(c,(double)pm->ap) + eng_morse*force_angle;
   }
 
   return eng;
 }
-
diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.h b/src/MOLECULE/pair_hbond_dreiding_morse.h
index a9cd5037be..fcd96aebc6 100644
--- a/src/MOLECULE/pair_hbond_dreiding_morse.h
+++ b/src/MOLECULE/pair_hbond_dreiding_morse.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
index 9f04882a1b..60d00fb560 100644
--- a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
+++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -114,68 +114,68 @@ void PairLJCharmmCoulCharmm::compute(int eflag, int vflag)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_bothsq) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
-	  if (rsq > cut_coul_innersq) {
-	    switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-	      (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / denom_coul;
-	    switch2 = 12.0*rsq * (cut_coulsq-rsq) * 
-	      (rsq-cut_coul_innersq) / denom_coul;
-	    forcecoul *= switch1 + switch2;
-	  }
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  jtype = type[j];
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  if (rsq > cut_lj_innersq) {
-	    switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	      (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	    switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	      (rsq-cut_lj_innersq) / denom_lj;
-	    philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	    forcelj = forcelj*switch1 + philj*switch2;
-	  }
-	} else forcelj = 0.0;
-
-	fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
-	    if (rsq > cut_coul_innersq) {
-	      switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-		(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / 
-		denom_coul;
-	      ecoul *= switch1;
-	    }
-	    ecoul *= factor_coul;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	      evdwl *= switch1;
-	    }
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
+          if (rsq > cut_coul_innersq) {
+            switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
+              (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / denom_coul;
+            switch2 = 12.0*rsq * (cut_coulsq-rsq) *
+              (rsq-cut_coul_innersq) / denom_coul;
+            forcecoul *= switch1 + switch2;
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq) {
+          r6inv = r2inv*r2inv*r2inv;
+          jtype = type[j];
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          if (rsq > cut_lj_innersq) {
+            switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+              (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+            switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+              (rsq-cut_lj_innersq) / denom_lj;
+            philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+            forcelj = forcelj*switch1 + philj*switch2;
+          }
+        } else forcelj = 0.0;
+
+        fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            ecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
+            if (rsq > cut_coul_innersq) {
+              switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
+                (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) /
+                denom_coul;
+              ecoul *= switch1;
+            }
+            ecoul *= factor_coul;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+              evdwl *= switch1;
+            }
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -221,7 +221,7 @@ void PairLJCharmmCoulCharmm::allocate()
 
 void PairLJCharmmCoulCharmm::settings(int narg, char **arg)
 {
-  if (narg != 2 && narg != 4) 
+  if (narg != 2 && narg != 4)
     error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_inner = force->numeric(arg[0]);
@@ -241,7 +241,7 @@ void PairLJCharmmCoulCharmm::settings(int narg, char **arg)
 
 void PairLJCharmmCoulCharmm::coeff(int narg, char **arg)
 {
-  if (narg != 4 && narg != 6) 
+  if (narg != 4 && narg != 6)
     error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
@@ -281,7 +281,7 @@ void PairLJCharmmCoulCharmm::init_style()
 {
   if (!atom->q_flag)
     error->all(FLERR,
-	       "Pair style lj/charmm/coul/charmm requires atom attribute q");
+               "Pair style lj/charmm/coul/charmm requires atom attribute q");
 
   neighbor->request(this);
 
@@ -296,9 +296,9 @@ void PairLJCharmmCoulCharmm::init_style()
   cut_coulsq = cut_coul * cut_coul;
   cut_bothsq = MAX(cut_ljsq,cut_coulsq);
 
-  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) * 
+  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) *
     (cut_ljsq-cut_lj_innersq);
-  denom_coul = (cut_coulsq-cut_coul_innersq) * (cut_coulsq-cut_coul_innersq) * 
+  denom_coul = (cut_coulsq-cut_coul_innersq) * (cut_coulsq-cut_coul_innersq) *
     (cut_coulsq-cut_coul_innersq);
 }
 
@@ -310,10 +310,10 @@ double PairLJCharmmCoulCharmm::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     eps14[i][j] = mix_energy(eps14[i][i],eps14[j][j],
-			       sigma14[i][i],sigma14[j][j]);
+                               sigma14[i][i],sigma14[j][j]);
     sigma14[i][j] = mix_distance(sigma14[i][i],sigma14[j][j]);
   }
 
@@ -327,7 +327,7 @@ double PairLJCharmmCoulCharmm::init_one(int i, int j)
   lj14_2[i][j] = 24.0 * eps14[i][j] * pow(sigma14[i][j],6.0);
   lj14_3[i][j] = 4.0 * eps14[i][j] * pow(sigma14[i][j],12.0);
   lj14_4[i][j] = 4.0 * eps14[i][j] * pow(sigma14[i][j],6.0);
-     
+
   lj1[j][i] = lj1[i][j];
   lj2[j][i] = lj2[i][j];
   lj3[j][i] = lj3[i][j];
@@ -353,10 +353,10 @@ void PairLJCharmmCoulCharmm::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&eps14[i][j],sizeof(double),1,fp);
-	fwrite(&sigma14[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&eps14[i][j],sizeof(double),1,fp);
+        fwrite(&sigma14[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -378,16 +378,16 @@ void PairLJCharmmCoulCharmm::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&eps14[i][j],sizeof(double),1,fp);
-	  fread(&sigma14[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&eps14[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma14[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&eps14[i][j],sizeof(double),1,fp);
+          fread(&sigma14[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&eps14[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma14[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -431,9 +431,9 @@ void PairLJCharmmCoulCharmm::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJCharmmCoulCharmm::single(int i, int j, int itype, int jtype,
-				      double rsq,
-				      double factor_coul, double factor_lj,
-				      double &fforce)
+                                      double rsq,
+                                      double factor_coul, double factor_lj,
+                                      double &fforce)
 {
   double r2inv,r6inv,forcecoul,forcelj,phicoul,philj;
   double switch1,switch2;
@@ -443,9 +443,9 @@ double PairLJCharmmCoulCharmm::single(int i, int j, int itype, int jtype,
     forcecoul = force->qqrd2e * atom->q[i]*atom->q[j]*sqrt(r2inv);
     if (rsq > cut_coul_innersq) {
       switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-	(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / denom_coul;
-      switch2 = 12.0*rsq * (cut_coulsq-rsq) * 
-	(rsq-cut_coul_innersq) / denom_coul;
+        (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / denom_coul;
+      switch2 = 12.0*rsq * (cut_coulsq-rsq) *
+        (rsq-cut_coul_innersq) / denom_coul;
       forcecoul *= switch1 + switch2;
     }
   } else forcecoul = 0.0;
@@ -455,9 +455,9 @@ double PairLJCharmmCoulCharmm::single(int i, int j, int itype, int jtype,
     forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
     if (rsq > cut_lj_innersq) {
       switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-      switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	(rsq-cut_lj_innersq) / denom_lj;
+        (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+      switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+        (rsq-cut_lj_innersq) / denom_lj;
       philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
       forcelj = forcelj*switch1 + philj*switch2;
     }
@@ -470,8 +470,8 @@ double PairLJCharmmCoulCharmm::single(int i, int j, int itype, int jtype,
     phicoul = force->qqrd2e * atom->q[i]*atom->q[j]*sqrt(r2inv);
     if (rsq > cut_coul_innersq) {
       switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-	(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / 
-	denom_coul;
+        (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) /
+        denom_coul;
       phicoul *= switch1;
     }
     eng += factor_coul*phicoul;
@@ -480,7 +480,7 @@ double PairLJCharmmCoulCharmm::single(int i, int j, int itype, int jtype,
     philj = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
     if (rsq > cut_lj_innersq) {
       switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+        (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
       philj *= switch1;
     }
     eng += factor_lj*philj;
diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.h b/src/MOLECULE/pair_lj_charmm_coul_charmm.h
index 03e453d9ee..9723d84bc9 100644
--- a/src/MOLECULE/pair_lj_charmm_coul_charmm.h
+++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.cpp
index 785e62fd03..2cb524a241 100644
--- a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.cpp
+++ b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -56,7 +56,7 @@ void PairLJCharmmCoulCharmmImplicit::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -81,68 +81,68 @@ void PairLJCharmmCoulCharmmImplicit::compute(int eflag, int vflag)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_bothsq) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  forcecoul = 2.0 * qqrd2e * qtmp*q[j]*r2inv;
-	  if (rsq > cut_coul_innersq) {
-	    switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-	      (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / denom_coul;
-	    switch2 = 12.0*rsq * (cut_coulsq-rsq) * 
-	      (rsq-cut_coul_innersq) / denom_coul;
-	    forcecoul *= switch1 + switch2;
-	  }
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  jtype = type[j];
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  if (rsq > cut_lj_innersq) {
-	    switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	      (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	    switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	      (rsq-cut_lj_innersq) / denom_lj;
-	    philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	    forcelj = forcelj*switch1 + philj*switch2;
-	  }
-	} else forcelj = 0.0;
-
-	fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = qqrd2e * qtmp*q[j]*r2inv;
-	    if (rsq > cut_coul_innersq) {
-	      switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-		(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / 
-		denom_coul;
-	      ecoul *= switch1;
-	    }
-	    ecoul *= factor_coul;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	      evdwl *= switch1;
-	    }
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          forcecoul = 2.0 * qqrd2e * qtmp*q[j]*r2inv;
+          if (rsq > cut_coul_innersq) {
+            switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
+              (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / denom_coul;
+            switch2 = 12.0*rsq * (cut_coulsq-rsq) *
+              (rsq-cut_coul_innersq) / denom_coul;
+            forcecoul *= switch1 + switch2;
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq) {
+          r6inv = r2inv*r2inv*r2inv;
+          jtype = type[j];
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          if (rsq > cut_lj_innersq) {
+            switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+              (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+            switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+              (rsq-cut_lj_innersq) / denom_lj;
+            philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+            forcelj = forcelj*switch1 + philj*switch2;
+          }
+        } else forcelj = 0.0;
+
+        fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            ecoul = qqrd2e * qtmp*q[j]*r2inv;
+            if (rsq > cut_coul_innersq) {
+              switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
+                (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) /
+                denom_coul;
+              ecoul *= switch1;
+            }
+            ecoul *= factor_coul;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+              evdwl *= switch1;
+            }
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -153,11 +153,11 @@ void PairLJCharmmCoulCharmmImplicit::compute(int eflag, int vflag)
 /* ---------------------------------------------------------------------- */
 
 double PairLJCharmmCoulCharmmImplicit::single(int i, int j,
-					      int itype, int jtype,
-					      double rsq,
-					      double factor_coul,
-					      double factor_lj,
-					      double &fforce)
+                                              int itype, int jtype,
+                                              double rsq,
+                                              double factor_coul,
+                                              double factor_lj,
+                                              double &fforce)
 {
   double r2inv,r6inv,switch1,switch2,forcecoul,forcelj,phicoul,philj;
 
@@ -166,9 +166,9 @@ double PairLJCharmmCoulCharmmImplicit::single(int i, int j,
     forcecoul = 2.0 * force->qqrd2e * atom->q[i]*atom->q[j]*r2inv;
     if (rsq > cut_coul_innersq) {
       switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-	(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / denom_coul;
-      switch2 = 12.0*rsq * (cut_coulsq-rsq) * 
-	(rsq-cut_coul_innersq) / denom_coul;
+        (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / denom_coul;
+      switch2 = 12.0*rsq * (cut_coulsq-rsq) *
+        (rsq-cut_coul_innersq) / denom_coul;
       forcecoul *= switch1 + switch2;
     }
   } else forcecoul = 0.0;
@@ -177,9 +177,9 @@ double PairLJCharmmCoulCharmmImplicit::single(int i, int j,
     forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
     if (rsq > cut_lj_innersq) {
       switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-      switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	(rsq-cut_lj_innersq) / denom_lj;
+        (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+      switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+        (rsq-cut_lj_innersq) / denom_lj;
       philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
       forcelj = forcelj*switch1 + philj*switch2;
     }
@@ -191,8 +191,8 @@ double PairLJCharmmCoulCharmmImplicit::single(int i, int j,
     phicoul = force->qqrd2e * atom->q[i]*atom->q[j]*r2inv;
     if (rsq > cut_coul_innersq) {
       switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-	(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) / 
-	denom_coul;
+        (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) /
+        denom_coul;
       phicoul *= switch1;
     }
     eng += factor_coul*phicoul;
@@ -201,7 +201,7 @@ double PairLJCharmmCoulCharmmImplicit::single(int i, int j,
     philj = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
     if (rsq > cut_lj_innersq) {
       switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+        (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
       philj *= switch1;
     }
     eng += factor_lj*philj;
diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h
index c5882a7495..747f2caa6d 100644
--- a/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h
+++ b/src/MOLECULE/pair_lj_charmm_coul_charmm_implicit.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/OPT/pair_eam_alloy_opt.cpp b/src/OPT/pair_eam_alloy_opt.cpp
index 0deaf8b430..1e13fc1fa3 100644
--- a/src/OPT/pair_eam_alloy_opt.cpp
+++ b/src/OPT/pair_eam_alloy_opt.cpp
@@ -5,14 +5,14 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Contributing authors:  
+   Contributing authors:
      James Fischer, High Performance Technologies, Inc.
      Charles Cornwell, High Performance Technologies, Inc.
      David Richie, Stone Ridge Technology
diff --git a/src/OPT/pair_eam_alloy_opt.h b/src/OPT/pair_eam_alloy_opt.h
index 5435f00fa4..04afac8c65 100644
--- a/src/OPT/pair_eam_alloy_opt.h
+++ b/src/OPT/pair_eam_alloy_opt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/OPT/pair_eam_fs_opt.cpp b/src/OPT/pair_eam_fs_opt.cpp
index a097eec2b6..7b30532f4f 100644
--- a/src/OPT/pair_eam_fs_opt.cpp
+++ b/src/OPT/pair_eam_fs_opt.cpp
@@ -5,14 +5,14 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Contributing authors:  
+   Contributing authors:
      James Fischer, High Performance Technologies, Inc.
      Charles Cornwell, High Performance Technologies, Inc.
      David Richie, Stone Ridge Technology
diff --git a/src/OPT/pair_eam_fs_opt.h b/src/OPT/pair_eam_fs_opt.h
index b5bfdad4bf..64da344ec8 100644
--- a/src/OPT/pair_eam_fs_opt.h
+++ b/src/OPT/pair_eam_fs_opt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/OPT/pair_eam_opt.cpp b/src/OPT/pair_eam_opt.cpp
index 616234b69b..c0cb4165ec 100644
--- a/src/OPT/pair_eam_opt.cpp
+++ b/src/OPT/pair_eam_opt.cpp
@@ -5,14 +5,14 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Contributing authors:  
+   Contributing authors:
      James Fischer, High Performance Technologies, Inc.
      Charles Cornwell, High Performance Technologies, Inc.
      David Richie, Stone Ridge Technology
@@ -61,30 +61,30 @@ template < int EVFLAG, int EFLAG, int NEWTON_PAIR >
 void PairEAMOpt::eval()
 {
   typedef struct { double x,y,z; } vec3_t;
-  
+
   typedef struct {
     double rhor0i,rhor1i,rhor2i,rhor3i;
     double rhor0j,rhor1j,rhor2j,rhor3j;
   } fast_alpha_t;
-  
+
   typedef struct {
     double frho0,frho1,frho2,frho3,frho4,frho5,frho6;
     double _pad[1];
   } fast_beta_t;
-  
+
   typedef struct {
     double rhor4i,rhor5i,rhor6i;
     double rhor4j,rhor5j,rhor6j;
     double z2r0,z2r1,z2r2,z2r3,z2r4,z2r5,z2r6;
     double _pad[3];
   } fast_gamma_t;
-  
+
   int i,j,ii,jj,inum,jnum,itype,jtype;
   double evdwl = 0.0;
   double* __restrict__ coeff;
 
   // grow energy array if necessary
-  
+
   if (atom->nmax > nmax) {
     memory->sfree(rho);
     memory->sfree(fp);
@@ -92,96 +92,96 @@ void PairEAMOpt::eval()
     rho = (double *) memory->smalloc(nmax*sizeof(double),"pair:rho");
     fp = (double *) memory->smalloc(nmax*sizeof(double),"pair:fp");
   }
-  
+
   double** __restrict__ x = atom->x;
   double** __restrict__ f = atom->f;
   int* __restrict__ type = atom->type;
   int nlocal = atom->nlocal;
-  
+
   vec3_t* __restrict__ xx = (vec3_t*)x[0];
   vec3_t* __restrict__ ff = (vec3_t*)f[0];
-  
+
   double tmp_cutforcesq = cutforcesq;
   double tmp_rdr = rdr;
   int nr2 = nr-2;
   int nr1 = nr-1;
-  
+
   inum = list->inum;
   int* __restrict__ ilist = list->ilist;
   int** __restrict__ firstneigh = list->firstneigh;
   int* __restrict__ numneigh = list->numneigh;
-  
+
   int ntypes = atom->ntypes;
   int ntypes2 = ntypes*ntypes;
-  
-  fast_alpha_t* __restrict__ fast_alpha = 
+
+  fast_alpha_t* __restrict__ fast_alpha =
     (fast_alpha_t*) malloc(ntypes2*(nr+1)*sizeof(fast_alpha_t));
   for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) {
     fast_alpha_t* __restrict__ tab = &fast_alpha[i*ntypes*nr+j*nr];
     if (type2rhor[i+1][j+1] >= 0) {
       for(int m = 1; m <= nr; m++) {
-	tab[m].rhor0i =  rhor_spline[type2rhor[i+1][j+1]][m][6];
-	tab[m].rhor1i =  rhor_spline[type2rhor[i+1][j+1]][m][5];
-	tab[m].rhor2i =  rhor_spline[type2rhor[i+1][j+1]][m][4];
-	tab[m].rhor3i =  rhor_spline[type2rhor[i+1][j+1]][m][3];
+        tab[m].rhor0i =  rhor_spline[type2rhor[i+1][j+1]][m][6];
+        tab[m].rhor1i =  rhor_spline[type2rhor[i+1][j+1]][m][5];
+        tab[m].rhor2i =  rhor_spline[type2rhor[i+1][j+1]][m][4];
+        tab[m].rhor3i =  rhor_spline[type2rhor[i+1][j+1]][m][3];
       }
     }
     if (type2rhor[j+1][i+1] >= 0) {
       for(int m = 1; m <= nr; m++) {
-	tab[m].rhor0j =  rhor_spline[type2rhor[j+1][i+1]][m][6];
-	tab[m].rhor1j =  rhor_spline[type2rhor[j+1][i+1]][m][5];
-	tab[m].rhor2j =  rhor_spline[type2rhor[j+1][i+1]][m][4];
-	tab[m].rhor3j =  rhor_spline[type2rhor[j+1][i+1]][m][3];
+        tab[m].rhor0j =  rhor_spline[type2rhor[j+1][i+1]][m][6];
+        tab[m].rhor1j =  rhor_spline[type2rhor[j+1][i+1]][m][5];
+        tab[m].rhor2j =  rhor_spline[type2rhor[j+1][i+1]][m][4];
+        tab[m].rhor3j =  rhor_spline[type2rhor[j+1][i+1]][m][3];
       }
     }
   }
   fast_alpha_t* __restrict__ tabeight = fast_alpha;
-  
-  fast_gamma_t* __restrict__ fast_gamma = 
+
+  fast_gamma_t* __restrict__ fast_gamma =
     (fast_gamma_t*) malloc(ntypes2*(nr+1)*sizeof(fast_gamma_t));
   for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) {
     fast_gamma_t* __restrict__ tab = &fast_gamma[i*ntypes*nr+j*nr];
     if (type2rhor[i+1][j+1] >= 0) {
       for(int m = 1; m <= nr; m++) {
-	tab[m].rhor4i =  rhor_spline[type2rhor[i+1][j+1]][m][2];
-	tab[m].rhor5i =  rhor_spline[type2rhor[i+1][j+1]][m][1];
-	tab[m].rhor6i =  rhor_spline[type2rhor[i+1][j+1]][m][0];
+        tab[m].rhor4i =  rhor_spline[type2rhor[i+1][j+1]][m][2];
+        tab[m].rhor5i =  rhor_spline[type2rhor[i+1][j+1]][m][1];
+        tab[m].rhor6i =  rhor_spline[type2rhor[i+1][j+1]][m][0];
       }
     }
     if (type2rhor[j+1][i+1] >= 0) {
       for(int m = 1; m <= nr; m++) {
-	tab[m].rhor4j =  rhor_spline[type2rhor[j+1][i+1]][m][2];
-	tab[m].rhor5j =  rhor_spline[type2rhor[j+1][i+1]][m][1];
-	tab[m].rhor6j =  rhor_spline[type2rhor[j+1][i+1]][m][0];
-	tab[m].z2r6 =  z2r_spline[type2z2r[i+1][j+1]][m][0];
+        tab[m].rhor4j =  rhor_spline[type2rhor[j+1][i+1]][m][2];
+        tab[m].rhor5j =  rhor_spline[type2rhor[j+1][i+1]][m][1];
+        tab[m].rhor6j =  rhor_spline[type2rhor[j+1][i+1]][m][0];
+        tab[m].z2r6 =  z2r_spline[type2z2r[i+1][j+1]][m][0];
       }
     }
     if (type2z2r[i+1][j+1] >= 0) {
       for(int m = 1; m <= nr; m++) {
-	tab[m].z2r0 =  z2r_spline[type2z2r[i+1][j+1]][m][6];
-	tab[m].z2r1 =  z2r_spline[type2z2r[i+1][j+1]][m][5];
-	tab[m].z2r2 =  z2r_spline[type2z2r[i+1][j+1]][m][4];
-	tab[m].z2r3 =  z2r_spline[type2z2r[i+1][j+1]][m][3];
-	tab[m].z2r4 =  z2r_spline[type2z2r[i+1][j+1]][m][2];
-	tab[m].z2r5 =  z2r_spline[type2z2r[i+1][j+1]][m][1];
-	tab[m].z2r6 =  z2r_spline[type2z2r[i+1][j+1]][m][0];
+        tab[m].z2r0 =  z2r_spline[type2z2r[i+1][j+1]][m][6];
+        tab[m].z2r1 =  z2r_spline[type2z2r[i+1][j+1]][m][5];
+        tab[m].z2r2 =  z2r_spline[type2z2r[i+1][j+1]][m][4];
+        tab[m].z2r3 =  z2r_spline[type2z2r[i+1][j+1]][m][3];
+        tab[m].z2r4 =  z2r_spline[type2z2r[i+1][j+1]][m][2];
+        tab[m].z2r5 =  z2r_spline[type2z2r[i+1][j+1]][m][1];
+        tab[m].z2r6 =  z2r_spline[type2z2r[i+1][j+1]][m][0];
       }
     }
   }
   fast_gamma_t* __restrict__ tabss = fast_gamma;
-  
+
   // zero out density
-  
+
   if (NEWTON_PAIR) {
     int m = nlocal + atom->nghost;
     for (i = 0; i < m; i++) rho[i] = 0.0;
   } else for (i = 0; i < nlocal; i++) rho[i] = 0.0;
-  
+
   // rho = density at each atom
   // loop over neighbors of my atoms
-  
+
   // loop over neighbors of my atoms
-  
+
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
     double xtmp = xx[i].x;
@@ -190,7 +190,7 @@ void PairEAMOpt::eval()
     itype = type[i] - 1;
     int* __restrict__ jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     double tmprho = rho[i];
     fast_alpha_t* __restrict__ tabeighti = &tabeight[itype*ntypes*nr];
 
@@ -202,38 +202,38 @@ void PairEAMOpt::eval()
       double dely = ytmp - xx[j].y;
       double delz = ztmp - xx[j].z;
       double rsq = delx*delx + dely*dely + delz*delz;
-      
+
       if (rsq < tmp_cutforcesq) {
-	jtype = type[j] - 1;
-	
-	double p = sqrt(rsq)*tmp_rdr;
-	if ( (int)p <= nr2 ) {
-	  int m = (int)p + 1;
-	  p -= (double)((int)p);
-	  fast_alpha_t& a = tabeighti[jtype*nr+m];
-	  tmprho += ((a.rhor3j*p+a.rhor2j)*p+a.rhor1j)*p+a.rhor0j;
-	  if (NEWTON_PAIR || j < nlocal) {
-	    rho[j] += ((a.rhor3i*p+a.rhor2i)*p+a.rhor1i)*p+a.rhor0i;
-	  }
-	} else {
-	  fast_alpha_t& a = tabeighti[jtype*nr+nr1];
-	  tmprho += a.rhor3j+a.rhor2j+a.rhor1j+a.rhor0j;
-	  if (NEWTON_PAIR || j < nlocal) {
-	    rho[j] += a.rhor3i+a.rhor2i+a.rhor1i+a.rhor0i;
-	  }
-	}
+        jtype = type[j] - 1;
+
+        double p = sqrt(rsq)*tmp_rdr;
+        if ( (int)p <= nr2 ) {
+          int m = (int)p + 1;
+          p -= (double)((int)p);
+          fast_alpha_t& a = tabeighti[jtype*nr+m];
+          tmprho += ((a.rhor3j*p+a.rhor2j)*p+a.rhor1j)*p+a.rhor0j;
+          if (NEWTON_PAIR || j < nlocal) {
+            rho[j] += ((a.rhor3i*p+a.rhor2i)*p+a.rhor1i)*p+a.rhor0i;
+          }
+        } else {
+          fast_alpha_t& a = tabeighti[jtype*nr+nr1];
+          tmprho += a.rhor3j+a.rhor2j+a.rhor1j+a.rhor0j;
+          if (NEWTON_PAIR || j < nlocal) {
+            rho[j] += a.rhor3i+a.rhor2i+a.rhor1i+a.rhor0i;
+          }
+        }
       }
     }
     rho[i] = tmprho;
   }
-  
+
   // communicate and sum densities
-  
+
   if (NEWTON_PAIR) comm->reverse_comm_pair(this);
-  
+
   // fp = derivative of embedding energy at each atom
   // phi = embedding energy at each atom
-  
+
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
     double p = rho[i]*rdrho;
@@ -248,11 +248,11 @@ void PairEAMOpt::eval()
       if (eflag_atom) eatom[i] += phi;
     }
   }
-  
+
   // communicate derivative of embedding function
-  
+
   comm->forward_comm_pair(this);
-  
+
   // compute forces on each atom
   // loop over neighbors of my atoms
 
@@ -264,11 +264,11 @@ void PairEAMOpt::eval()
     int itype1 = type[i] - 1;
     int* __restrict__ jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     double tmpfx = 0.0;
     double tmpfy = 0.0;
     double tmpfz = 0.0;
-    
+
     fast_gamma_t* __restrict__ tabssi = &tabss[itype1*ntypes*nr];
 
     for (jj = 0; jj < jnum; jj++) {
@@ -279,60 +279,60 @@ void PairEAMOpt::eval()
       double dely = ytmp - xx[j].y;
       double delz = ztmp - xx[j].z;
       double rsq = delx*delx + dely*dely + delz*delz;
-      
+
       if (rsq < tmp_cutforcesq) {
-	jtype = type[j] - 1;
-	double r = sqrt(rsq);
-	double rhoip,rhojp,z2,z2p;
-	double p = r*tmp_rdr;
-	if ( (int)p <= nr2 ) {
-	  int m = (int) p + 1;
-	  p -= (double)((int) p);
-	  
-	  fast_gamma_t& a = tabssi[jtype*nr+m];
-	  rhoip = (a.rhor6i*p + a.rhor5i)*p + a.rhor4i;
-	  rhojp = (a.rhor6j*p + a.rhor5j)*p + a.rhor4j;
-	  z2 = ((a.z2r3*p + a.z2r2)*p + a.z2r1)*p + a.z2r0;
-	  z2p = (a.z2r6*p + a.z2r5)*p + a.z2r4;
-	  
-	} else {
-	  
-	  fast_gamma_t& a = tabssi[jtype*nr+nr1];
-	  rhoip = a.rhor6i + a.rhor5i + a.rhor4i;
-	  rhojp = a.rhor6j + a.rhor5j + a.rhor4j;
-	  z2 = a.z2r3 + a.z2r2 + a.z2r1 + a.z2r0;
-	  z2p = a.z2r6 + a.z2r5 + a.z2r4;
-	}
-	
-	// rhoip = derivative of (density at atom j due to atom i)
-	// rhojp = derivative of (density at atom i due to atom j)
-	// phi = pair potential energy
-	// phip = phi'
-	// z2 = phi * r
-	// z2p = (phi * r)' = (phi' r) + phi
-	// psip needs both fp[i] and fp[j] terms since r_ij appears in two
-	//   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
-	//   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
-	
-	double recip = 1.0/r;
-	double phi = z2*recip;
-	double phip = z2p*recip - phi*recip;
-	double psip = fp[i]*rhojp + fp[j]*rhoip + phip;
-	double fpair = -psip*recip;
-	
-	tmpfx += delx*fpair;
-	tmpfy += dely*fpair;
-	tmpfz += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  ff[j].x -= delx*fpair;
-	  ff[j].y -= dely*fpair;
-	  ff[j].z -= delz*fpair;
-	}
-	
-	if (EFLAG) evdwl = phi;
-	
-	if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        jtype = type[j] - 1;
+        double r = sqrt(rsq);
+        double rhoip,rhojp,z2,z2p;
+        double p = r*tmp_rdr;
+        if ( (int)p <= nr2 ) {
+          int m = (int) p + 1;
+          p -= (double)((int) p);
+
+          fast_gamma_t& a = tabssi[jtype*nr+m];
+          rhoip = (a.rhor6i*p + a.rhor5i)*p + a.rhor4i;
+          rhojp = (a.rhor6j*p + a.rhor5j)*p + a.rhor4j;
+          z2 = ((a.z2r3*p + a.z2r2)*p + a.z2r1)*p + a.z2r0;
+          z2p = (a.z2r6*p + a.z2r5)*p + a.z2r4;
+
+        } else {
+
+          fast_gamma_t& a = tabssi[jtype*nr+nr1];
+          rhoip = a.rhor6i + a.rhor5i + a.rhor4i;
+          rhojp = a.rhor6j + a.rhor5j + a.rhor4j;
+          z2 = a.z2r3 + a.z2r2 + a.z2r1 + a.z2r0;
+          z2p = a.z2r6 + a.z2r5 + a.z2r4;
+        }
+
+        // rhoip = derivative of (density at atom j due to atom i)
+        // rhojp = derivative of (density at atom i due to atom j)
+        // phi = pair potential energy
+        // phip = phi'
+        // z2 = phi * r
+        // z2p = (phi * r)' = (phi' r) + phi
+        // psip needs both fp[i] and fp[j] terms since r_ij appears in two
+        //   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
+        //   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
+
+        double recip = 1.0/r;
+        double phi = z2*recip;
+        double phip = z2p*recip - phi*recip;
+        double psip = fp[i]*rhojp + fp[j]*rhoip + phip;
+        double fpair = -psip*recip;
+
+        tmpfx += delx*fpair;
+        tmpfy += dely*fpair;
+        tmpfz += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          ff[j].x -= delx*fpair;
+          ff[j].y -= dely*fpair;
+          ff[j].z -= delz*fpair;
+        }
+
+        if (EFLAG) evdwl = phi;
+
+        if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
 
@@ -340,9 +340,9 @@ void PairEAMOpt::eval()
     ff[i].y += tmpfy;
     ff[i].z += tmpfz;
   }
-  
+
   free(fast_alpha); fast_alpha = 0;
   free(fast_gamma); fast_gamma = 0;
-  
+
   if (vflag_fdotr) virial_fdotr_compute();
 }
diff --git a/src/OPT/pair_eam_opt.h b/src/OPT/pair_eam_opt.h
index afc7764da9..e174dae647 100644
--- a/src/OPT/pair_eam_opt.h
+++ b/src/OPT/pair_eam_opt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/OPT/pair_lj_charmm_coul_long_opt.cpp b/src/OPT/pair_lj_charmm_coul_long_opt.cpp
index 49519d4761..5979141e3c 100644
--- a/src/OPT/pair_lj_charmm_coul_long_opt.cpp
+++ b/src/OPT/pair_lj_charmm_coul_long_opt.cpp
@@ -5,14 +5,14 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Contributing authors:  
+   Contributing authors:
      James Fischer, High Performance Technologies, Inc.
      David Richie, Stone Ridge Technology
      Vincent Natoli, Stone Ridge Technology
@@ -67,23 +67,23 @@ template < int EVFLAG, int EFLAG, int NEWTON_PAIR >
 void PairLJCharmmCoulLongOpt::eval()
 {
   typedef struct { double x,y,z; } vec3_t;
-  
+
   typedef struct {
     double cutsq,lj1,lj2,lj3,lj4,offset;
     double _pad[2];
   } fast_alpha_t;
-  
+
   int i,j,ii,jj,inum,jnum,itype,jtype,itable,sbindex;
   double fraction,table;
   double r,r2inv,r6inv,forcecoul,forcelj,factor_coul,factor_lj;
   double grij,expm2,prefactor,t,erfc;
   double philj,switch1,switch2;
- 
-  double rsq; 
-  
+
+  double rsq;
+
   double evdwl = 0.0;
   double ecoul = 0.0;
-  
+
   double** __restrict__ x = atom->x;
   double** __restrict__ f = atom->f;
   double* __restrict__ q = atom->q;
@@ -97,17 +97,17 @@ void PairLJCharmmCoulLongOpt::eval()
   int* __restrict__ ilist = list->ilist;
   int** __restrict__ firstneigh = list->firstneigh;
   int* __restrict__ numneigh = list->numneigh;
-  
+
   vec3_t* __restrict__ xx = (vec3_t*)x[0];
   vec3_t* __restrict__ ff = (vec3_t*)f[0];
-  
+
   int ntypes = atom->ntypes;
   int ntypes2 = ntypes*ntypes;
-  
+
   double tmp_coef1 = 1.0/denom_lj;
   double tmp_coef2 = cut_ljsq - 3.0*cut_lj_innersq;
-  
-  fast_alpha_t* __restrict__ fast_alpha = 
+
+  fast_alpha_t* __restrict__ fast_alpha =
     (fast_alpha_t*)malloc(ntypes2*sizeof(fast_alpha_t));
   for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) {
     fast_alpha_t& a = fast_alpha[i*ntypes+j];
@@ -118,9 +118,9 @@ void PairLJCharmmCoulLongOpt::eval()
     a.lj4 = lj4[i+1][j+1];
   }
   fast_alpha_t* __restrict__ tabsix = fast_alpha;
-  
+
   // loop over neighbors of my atoms
-  
+
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
     double qtmp = q[i];
@@ -130,11 +130,11 @@ void PairLJCharmmCoulLongOpt::eval()
     itype = type[i] - 1;
     int* __restrict__ jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     double tmpfx = 0.0;
     double tmpfy = 0.0;
     double tmpfz = 0.0;
-    
+
     fast_alpha_t* __restrict__ tabsixi = (fast_alpha_t*) &tabsix[itype*ntypes];
 
     for (jj = 0; jj < jnum; jj++) {
@@ -142,189 +142,189 @@ void PairLJCharmmCoulLongOpt::eval()
       sbindex = sbmask(j);
 
       if (sbindex == 0) {
-	double delx = xtmp - xx[j].x;
-	double dely = ytmp - xx[j].y;
-	double delz = ztmp - xx[j].z;
-	rsq = delx*delx + dely*dely + delz*delz;
-	double tmp_coef3 = qtmp*q[j];
-	
-	if (rsq < cut_bothsq) {
-	  r2inv = 1.0/rsq;
-	  
-	  forcecoul = 0.0;
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq) {
-	      r = sqrt(rsq);
-	      grij = g_ewald * r;
-	      expm2 = exp(-grij*grij);
-	      t = 1.0 / (1.0 + EWALD_P*grij);
-	      erfc = t * 
-		(EWALD_A1+t*(EWALD_A2+t*(EWALD_A3+t*(EWALD_A4+t*EWALD_A5)))) * 
-		expm2;
-	      prefactor = qqrd2e * tmp_coef3/r;
-	      forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    } else {
-	      union_int_float_t rsq_lookup;
-	      rsq_lookup.f = rsq;
-	      itable = rsq_lookup.i & ncoulmask;
-	      itable >>= ncoulshiftbits;
-	      fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	      table = ftable[itable] + fraction*dftable[itable];
-	      forcecoul = tmp_coef3 * table;
-	    }
-	  }  
-	  
-	  forcelj = 0.0;
-	  if (rsq < cut_ljsq) {
-	    r6inv = r2inv*r2inv*r2inv;
-	    jtype = type[j] - 1;
-	    fast_alpha_t& a = tabsixi[jtype];
-	    forcelj = r6inv * (a.lj1*r6inv - a.lj2);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(tmp_coef2 + 2.0*rsq) * tmp_coef1;
-	      switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-		(rsq-cut_lj_innersq) * tmp_coef1;
-	      philj = r6inv * (a.lj3*r6inv - a.lj4);
-	      forcelj = forcelj*switch1 + philj*switch2;
-	    }
-	  } 
-	  
-	  double fpair = (forcecoul + forcelj) * r2inv;
-	  
-	  tmpfx += delx*fpair;
-	  tmpfy += dely*fpair;
-	  tmpfz += delz*fpair;
-	  if (NEWTON_PAIR || j < nlocal) {
-	    ff[j].x -= delx*fpair;
-	    ff[j].y -= dely*fpair;
-	    ff[j].z -= delz*fpair;
-	  }
-	  
-	  if (EFLAG) {
-	    if (rsq < cut_coulsq) {
-	      if (!ncoultablebits || rsq <= tabinnersq)
-		ecoul = prefactor*erfc;
-	      else {
-		table = etable[itable] + fraction*detable[itable];
-		ecoul = tmp_coef3 * table;
-	      }
-	    } else ecoul = 0.0;
-
-	    if (rsq < cut_ljsq) {
-	      fast_alpha_t& a = tabsixi[jtype];
-	      evdwl = r6inv*(a.lj3*r6inv-a.lj4);
-	      if (rsq > cut_lj_innersq) {
-		switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		  (tmp_coef2 + 2.0*rsq) * tmp_coef1;
-		evdwl *= switch1;
-	      }
-	    } else evdwl = 0.0;
-	  }
-
-	  if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
-			       evdwl,ecoul,fpair,delx,dely,delz);
-	}
+        double delx = xtmp - xx[j].x;
+        double dely = ytmp - xx[j].y;
+        double delz = ztmp - xx[j].z;
+        rsq = delx*delx + dely*dely + delz*delz;
+        double tmp_coef3 = qtmp*q[j];
+
+        if (rsq < cut_bothsq) {
+          r2inv = 1.0/rsq;
+
+          forcecoul = 0.0;
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq) {
+              r = sqrt(rsq);
+              grij = g_ewald * r;
+              expm2 = exp(-grij*grij);
+              t = 1.0 / (1.0 + EWALD_P*grij);
+              erfc = t *
+                (EWALD_A1+t*(EWALD_A2+t*(EWALD_A3+t*(EWALD_A4+t*EWALD_A5)))) *
+                expm2;
+              prefactor = qqrd2e * tmp_coef3/r;
+              forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            } else {
+              union_int_float_t rsq_lookup;
+              rsq_lookup.f = rsq;
+              itable = rsq_lookup.i & ncoulmask;
+              itable >>= ncoulshiftbits;
+              fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+              table = ftable[itable] + fraction*dftable[itable];
+              forcecoul = tmp_coef3 * table;
+            }
+          }
+
+          forcelj = 0.0;
+          if (rsq < cut_ljsq) {
+            r6inv = r2inv*r2inv*r2inv;
+            jtype = type[j] - 1;
+            fast_alpha_t& a = tabsixi[jtype];
+            forcelj = r6inv * (a.lj1*r6inv - a.lj2);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (tmp_coef2 + 2.0*rsq) * tmp_coef1;
+              switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+                (rsq-cut_lj_innersq) * tmp_coef1;
+              philj = r6inv * (a.lj3*r6inv - a.lj4);
+              forcelj = forcelj*switch1 + philj*switch2;
+            }
+          }
+
+          double fpair = (forcecoul + forcelj) * r2inv;
+
+          tmpfx += delx*fpair;
+          tmpfy += dely*fpair;
+          tmpfz += delz*fpair;
+          if (NEWTON_PAIR || j < nlocal) {
+            ff[j].x -= delx*fpair;
+            ff[j].y -= dely*fpair;
+            ff[j].z -= delz*fpair;
+          }
+
+          if (EFLAG) {
+            if (rsq < cut_coulsq) {
+              if (!ncoultablebits || rsq <= tabinnersq)
+                ecoul = prefactor*erfc;
+              else {
+                table = etable[itable] + fraction*detable[itable];
+                ecoul = tmp_coef3 * table;
+              }
+            } else ecoul = 0.0;
+
+            if (rsq < cut_ljsq) {
+              fast_alpha_t& a = tabsixi[jtype];
+              evdwl = r6inv*(a.lj3*r6inv-a.lj4);
+              if (rsq > cut_lj_innersq) {
+                switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                  (tmp_coef2 + 2.0*rsq) * tmp_coef1;
+                evdwl *= switch1;
+              }
+            } else evdwl = 0.0;
+          }
+
+          if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
+                               evdwl,ecoul,fpair,delx,dely,delz);
+        }
 
       } else {
-	factor_lj = special_lj[sbindex];
-	factor_coul = special_coul[sbindex];
-	j &= NEIGHMASK;
-
-	double delx = xtmp - xx[j].x;
-	double dely = ytmp - xx[j].y;
-	double delz = ztmp - xx[j].z;
-	rsq = delx*delx + dely*dely + delz*delz;
-	double tmp_coef3 = qtmp*q[j];
-	
-	if (rsq < cut_bothsq) {
-	  r2inv = 1.0/rsq;
-	  
-	  forcecoul = 0.0;
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq) {
-	      r = sqrt(rsq);
-	      grij = g_ewald * r;
-	      expm2 = exp(-grij*grij);
-	      t = 1.0 / (1.0 + EWALD_P*grij);
-	      erfc = t * 
-		(EWALD_A1+t*(EWALD_A2+t*(EWALD_A3+t*(EWALD_A4+t*EWALD_A5)))) * 
-		expm2;
-	      prefactor = qqrd2e * tmp_coef3/r;
-	      forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	      if (factor_coul < 1.0) {
-		forcecoul -= (1.0-factor_coul)*prefactor;
-	      }
-	    } else {
-	      union_int_float_t rsq_lookup;
-	      rsq_lookup.f = rsq;
-	      itable = rsq_lookup.i & ncoulmask;
-	      itable >>= ncoulshiftbits;
-	      fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	      table = ftable[itable] + fraction*dftable[itable];
-	      forcecoul = tmp_coef3 * table;
-	      if (factor_coul < 1.0) {
-		table = ctable[itable] + fraction*dctable[itable];
-		prefactor = tmp_coef3 * table;
-		forcecoul -= (1.0-factor_coul)*prefactor;
-	      }
-	    }
-	  }  
-	  
-	  forcelj = 0.0;
-	  if (rsq < cut_ljsq) {
-	    r6inv = r2inv*r2inv*r2inv;
-	    jtype = type[j] - 1;
-	    fast_alpha_t& a = tabsixi[jtype];
-	    forcelj = r6inv * (a.lj1*r6inv - a.lj2);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(tmp_coef2 + 2.0*rsq) * tmp_coef1;
-	      switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-		(rsq-cut_lj_innersq) * tmp_coef1;
-	      fast_alpha_t& a = tabsixi[jtype];
-	      philj = r6inv * (a.lj3*r6inv - a.lj4);
-	      forcelj = forcelj*switch1 + philj*switch2;
-	    }
-	  }  
-	  
-	  double fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-	  
-	  tmpfx += delx*fpair;
-	  tmpfy += dely*fpair;
-	  tmpfz += delz*fpair;
-	  if (NEWTON_PAIR || j < nlocal) {
-	    ff[j].x -= delx*fpair;
-	    ff[j].y -= dely*fpair;
-	    ff[j].z -= delz*fpair;
-	  }
-	  
-	  if (EFLAG) {
-	    if (rsq < cut_coulsq) {
-	      if (!ncoultablebits || rsq <= tabinnersq)
-		ecoul = prefactor*erfc;
-	      else {
-		table = etable[itable] + fraction*detable[itable];
-		ecoul = tmp_coef3 * table;
-	      }
-	      if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	    } else ecoul = 0.0;
-
-	    if (rsq < cut_ljsq) {
-	      fast_alpha_t& a = tabsixi[jtype];
-	      evdwl = r6inv*(a.lj3*r6inv-a.lj4);
-	      if (rsq > cut_lj_innersq) {
-		switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		  (tmp_coef2 + 2.0*rsq) * tmp_coef1;
-		evdwl *= switch1;
-	      }
-	      evdwl *= factor_lj;
-	    } else evdwl = 0.0;
-	  }
-	  
-	  if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
-			       evdwl,ecoul,fpair,delx,dely,delz);
-	}
+        factor_lj = special_lj[sbindex];
+        factor_coul = special_coul[sbindex];
+        j &= NEIGHMASK;
+
+        double delx = xtmp - xx[j].x;
+        double dely = ytmp - xx[j].y;
+        double delz = ztmp - xx[j].z;
+        rsq = delx*delx + dely*dely + delz*delz;
+        double tmp_coef3 = qtmp*q[j];
+
+        if (rsq < cut_bothsq) {
+          r2inv = 1.0/rsq;
+
+          forcecoul = 0.0;
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq) {
+              r = sqrt(rsq);
+              grij = g_ewald * r;
+              expm2 = exp(-grij*grij);
+              t = 1.0 / (1.0 + EWALD_P*grij);
+              erfc = t *
+                (EWALD_A1+t*(EWALD_A2+t*(EWALD_A3+t*(EWALD_A4+t*EWALD_A5)))) *
+                expm2;
+              prefactor = qqrd2e * tmp_coef3/r;
+              forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+              if (factor_coul < 1.0) {
+                forcecoul -= (1.0-factor_coul)*prefactor;
+              }
+            } else {
+              union_int_float_t rsq_lookup;
+              rsq_lookup.f = rsq;
+              itable = rsq_lookup.i & ncoulmask;
+              itable >>= ncoulshiftbits;
+              fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+              table = ftable[itable] + fraction*dftable[itable];
+              forcecoul = tmp_coef3 * table;
+              if (factor_coul < 1.0) {
+                table = ctable[itable] + fraction*dctable[itable];
+                prefactor = tmp_coef3 * table;
+                forcecoul -= (1.0-factor_coul)*prefactor;
+              }
+            }
+          }
+
+          forcelj = 0.0;
+          if (rsq < cut_ljsq) {
+            r6inv = r2inv*r2inv*r2inv;
+            jtype = type[j] - 1;
+            fast_alpha_t& a = tabsixi[jtype];
+            forcelj = r6inv * (a.lj1*r6inv - a.lj2);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (tmp_coef2 + 2.0*rsq) * tmp_coef1;
+              switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+                (rsq-cut_lj_innersq) * tmp_coef1;
+              fast_alpha_t& a = tabsixi[jtype];
+              philj = r6inv * (a.lj3*r6inv - a.lj4);
+              forcelj = forcelj*switch1 + philj*switch2;
+            }
+          }
+
+          double fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+
+          tmpfx += delx*fpair;
+          tmpfy += dely*fpair;
+          tmpfz += delz*fpair;
+          if (NEWTON_PAIR || j < nlocal) {
+            ff[j].x -= delx*fpair;
+            ff[j].y -= dely*fpair;
+            ff[j].z -= delz*fpair;
+          }
+
+          if (EFLAG) {
+            if (rsq < cut_coulsq) {
+              if (!ncoultablebits || rsq <= tabinnersq)
+                ecoul = prefactor*erfc;
+              else {
+                table = etable[itable] + fraction*detable[itable];
+                ecoul = tmp_coef3 * table;
+              }
+              if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+            } else ecoul = 0.0;
+
+            if (rsq < cut_ljsq) {
+              fast_alpha_t& a = tabsixi[jtype];
+              evdwl = r6inv*(a.lj3*r6inv-a.lj4);
+              if (rsq > cut_lj_innersq) {
+                switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                  (tmp_coef2 + 2.0*rsq) * tmp_coef1;
+                evdwl *= switch1;
+              }
+              evdwl *= factor_lj;
+            } else evdwl = 0.0;
+          }
+
+          if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
+                               evdwl,ecoul,fpair,delx,dely,delz);
+        }
       }
     }
 
@@ -337,4 +337,3 @@ void PairLJCharmmCoulLongOpt::eval()
 
   if (vflag_fdotr) virial_fdotr_compute();
 }
-
diff --git a/src/OPT/pair_lj_charmm_coul_long_opt.h b/src/OPT/pair_lj_charmm_coul_long_opt.h
index e2cc1af8ed..2e6b30e576 100644
--- a/src/OPT/pair_lj_charmm_coul_long_opt.h
+++ b/src/OPT/pair_lj_charmm_coul_long_opt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -32,7 +32,7 @@ class PairLJCharmmCoulLongOpt : public PairLJCharmmCoulLong {
  private:
   template < int EVFLAG, int EFLAG, int NEWTON_PAIR > void eval();
 };
- 
+
 }
 
 #endif
diff --git a/src/OPT/pair_lj_cut_coul_long_opt.cpp b/src/OPT/pair_lj_cut_coul_long_opt.cpp
index da09305270..2ff5fc7bd6 100644
--- a/src/OPT/pair_lj_cut_coul_long_opt.cpp
+++ b/src/OPT/pair_lj_cut_coul_long_opt.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -99,7 +99,7 @@ void PairLJCutCoulLongOpt::eval()
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
- 
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -126,70 +126,70 @@ void PairLJCutCoulLongOpt::eval()
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  if (!CTABLE || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + factor_lj*forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    if (!CTABLE || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          if (!CTABLE || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + factor_lj*forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            if (!CTABLE || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/OPT/pair_lj_cut_coul_long_opt.h b/src/OPT/pair_lj_cut_coul_long_opt.h
index 4c19ee9b5d..5afd3ffc77 100644
--- a/src/OPT/pair_lj_cut_coul_long_opt.h
+++ b/src/OPT/pair_lj_cut_coul_long_opt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -30,7 +30,7 @@ class PairLJCutCoulLongOpt : public PairLJCutCoulLong {
   virtual void compute(int, int);
 
  protected:
-  template <const int EVFLAG, const int EFLAG, 
+  template <const int EVFLAG, const int EFLAG,
             const int NEWTON_PAIR, const int CTABLE >
   void eval();
 };
diff --git a/src/OPT/pair_lj_cut_coul_long_tip4p_opt.cpp b/src/OPT/pair_lj_cut_coul_long_tip4p_opt.cpp
index 4cb1e11bff..35388811be 100644
--- a/src/OPT/pair_lj_cut_coul_long_tip4p_opt.cpp
+++ b/src/OPT/pair_lj_cut_coul_long_tip4p_opt.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -101,21 +101,21 @@ void PairLJCutCoulLongTIP4POpt::compute(int eflag, int vflag)
   if (!ncoultablebits) {
     if (evflag) {
       if (eflag) {
-	if (vflag) return eval<1,1,1,1>();
-	else return eval<1,1,1,0>();
+        if (vflag) return eval<1,1,1,1>();
+        else return eval<1,1,1,0>();
       } else {
-	if (vflag) return eval<1,1,0,1>();
-	else return eval<1,1,0,0>();
+        if (vflag) return eval<1,1,0,1>();
+        else return eval<1,1,0,0>();
       }
     } else return eval<1,0,0,0>();
   } else {
     if (evflag) {
       if (eflag) {
-	if (vflag) return eval<0,1,1,1>();
-	else return eval<0,1,1,0>();
+        if (vflag) return eval<0,1,1,1>();
+        else return eval<0,1,1,0>();
       } else {
-	if (vflag) return eval<0,1,0,1>();
-	else return eval<0,1,0,0>();
+        if (vflag) return eval<0,1,0,1>();
+        else return eval<0,1,0,0>();
       }
     } else return eval<0,0,0,0>();
   }
@@ -123,8 +123,8 @@ void PairLJCutCoulLongTIP4POpt::compute(int eflag, int vflag)
 
 /* ---------------------------------------------------------------------- */
 
-template < const int CTABLE, const int EVFLAG, 
-	   const int EFLAG, const int VFLAG>
+template < const int CTABLE, const int EVFLAG,
+           const int EFLAG, const int VFLAG>
 void PairLJCutCoulLongTIP4POpt::eval()
 {
   int i,j,ii,jj,inum,jnum,itype,jtype,itable;
@@ -159,7 +159,7 @@ void PairLJCutCoulLongTIP4POpt::eval()
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -192,26 +192,26 @@ void PairLJCutCoulLongTIP4POpt::eval()
       // LJ interaction based on true rsq
 
       if (rsq < cut_ljsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	forcelj *= factor_lj * r2inv;
-
-	fxtmp += delx*forcelj;
-	fytmp += dely*forcelj;
-	fztmp += delz*forcelj;
-	f[j][0] -= delx*forcelj;
-	f[j][1] -= dely*forcelj;
-	f[j][2] -= delz*forcelj;
-
-	if (EFLAG) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	} else evdwl = 0.0;
-
-	if (EVFLAG) ev_tally(i,j,nlocal,/* newton_pair = */ 1,
-			     evdwl,0.0,forcelj,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        forcelj *= factor_lj * r2inv;
+
+        fxtmp += delx*forcelj;
+        fytmp += dely*forcelj;
+        fztmp += delz*forcelj;
+        f[j][0] -= delx*forcelj;
+        f[j][1] -= dely*forcelj;
+        f[j][2] -= delz*forcelj;
+
+        if (EFLAG) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        } else evdwl = 0.0;
+
+        if (EVFLAG) ev_tally(i,j,nlocal,/* newton_pair = */ 1,
+                             evdwl,0.0,forcelj,delx,dely,delz);
       }
 
       // adjust rsq and delxyz for off-site O charge(s),
@@ -219,210 +219,210 @@ void PairLJCutCoulLongTIP4POpt::eval()
 
       if (rsq < cut_coulsqplus) {
 
-	if (itype == typeO || jtype == typeO) {
-	  x2 = mpos[j];
-	  jH1 = h1idx[j];
-	  jH2 = h2idx[j];
-	  if (jtype == typeO && ( jH1 < 0 || jH2 < 0))
-	    error->one(FLERR,"TIP4P hydrogen is missing");
-	  delx = x1[0] - x2[0];
-	  dely = x1[1] - x2[1];
-	  delz = x1[2] - x2[2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-	}
-      
-	// Coulombic interaction based on modified rsq
-
-	if (rsq < cut_coulsq) {
-	  r2inv = 1 / rsq;
-	  if (CTABLE || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) {
-	      forcecoul -= (1.0-factor_coul)*prefactor; 
-	    }
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-
-	  cforce = forcecoul * r2inv;
-
-	  // if i,j are not O atoms, force is applied directly
-	  // if i or j are O atoms, force is on fictitious atom & partitioned
-	  // force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
-	  // f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
-	  // preserves total force and torque on water molecule
-	  // virial = sum(r x F) where each water's atoms are near xi and xj
-	  // vlist stores 2,4,6 atoms whose forces contribute to virial
-
-	  n = 0;
-
-	  if (itype != typeO) {
-	    fxtmp += delx * cforce;
-	    fytmp += dely * cforce;
-	    fztmp += delz * cforce;
-
-	    if (VFLAG) {
-	      v[0] = x[i][0] * delx * cforce;
-	      v[1] = x[i][1] * dely * cforce;
-	      v[2] = x[i][2] * delz * cforce;
-	      v[3] = x[i][0] * dely * cforce;
-	      v[4] = x[i][0] * delz * cforce;
-	      v[5] = x[i][1] * delz * cforce;
-	      vlist[n++] = i;
-	    }
-
-	  } else {
-
-	    fdx = delx*cforce;
-	    fdy = dely*cforce;
-	    fdz = delz*cforce;
-
-	    delxOM = x[i][0] - x1[0];
-	    delyOM = x[i][1] - x1[1];
-	    delzOM = x[i][2] - x1[2];
-
-	    ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
-	      (qdist*qdist);
-
-	    f1x = alpha * (fdx - ddotf * delxOM);
-	    f1y = alpha * (fdy - ddotf * delyOM);
-	    f1z = alpha * (fdz - ddotf * delzOM);
-
-	    fOx = fdx - f1x;
-	    fOy = fdy - f1y;
-	    fOz = fdz - f1z;
-
-	    fHx = 0.5 * f1x;
-	    fHy = 0.5 * f1y;
-	    fHz = 0.5 * f1z;
-
-	    fxtmp += fOx;
-	    fytmp += fOy;
-	    fztmp += fOz;
-
-	    f[iH1][0] += fHx;
-	    f[iH1][1] += fHy;
-	    f[iH1][2] += fHz;
-
-	    f[iH2][0] += fHx;
-	    f[iH2][1] += fHy;
-	    f[iH2][2] += fHz;
-
-	    if (VFLAG) {
-	      domain->closest_image(x[i],x[iH1],xH1);
-	      domain->closest_image(x[i],x[iH2],xH2);
-
-	      v[0] = x[i][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
-	      v[1] = x[i][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
-	      v[2] = x[i][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
-	      v[3] = x[i][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
-	      v[4] = x[i][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
-	      v[5] = x[i][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
-
-	      vlist[n++] = i;
-	      vlist[n++] = iH1;
-	      vlist[n++] = iH2;
-	    }
-	  }
-
-	  if (jtype != typeO) {
-	    f[j][0] -= delx * cforce;
-	    f[j][1] -= dely * cforce;
-	    f[j][2] -= delz * cforce;
-
-	    if (VFLAG) {
-	      v[0] -= x[j][0] * delx * cforce;
-	      v[1] -= x[j][1] * dely * cforce;
-	      v[2] -= x[j][2] * delz * cforce;
-	      v[3] -= x[j][0] * dely * cforce;
-	      v[4] -= x[j][0] * delz * cforce;
-	      v[5] -= x[j][1] * delz * cforce;
-	      vlist[n++] = j;
-	    }
-
-	  } else {
-
-	    fdx = -delx*cforce;
-	    fdy = -dely*cforce;
-	    fdz = -delz*cforce;
-
-	    delxOM = x[j][0] - x2[0];
-	    delyOM = x[j][1] - x2[1];
-	    delzOM = x[j][2] - x2[2];
-
-	    ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
-	      (qdist*qdist);
-
-	    f1x = alpha * (fdx - ddotf * delxOM);
-	    f1y = alpha * (fdy - ddotf * delyOM);
-	    f1z = alpha * (fdz - ddotf * delzOM);
-
-	    fOx = fdx - f1x;
-	    fOy = fdy - f1y;
-	    fOz = fdz - f1z;
-
-	    fHx = 0.5 * f1x;
-	    fHy = 0.5 * f1y;
-	    fHz = 0.5 * f1z;
-
-	    f[j][0] += fOx;
-	    f[j][1] += fOy;
-	    f[j][2] += fOz;
-
-	    f[jH1][0] += fHx;
-	    f[jH1][1] += fHy;
-	    f[jH1][2] += fHz;
-
-	    f[jH2][0] += fHx;
-	    f[jH2][1] += fHy;
-	    f[jH2][2] += fHz;
-
-	    if (VFLAG) {
-	      domain->closest_image(x[j],x[jH1],xH1);
-	      domain->closest_image(x[j],x[jH2],xH2);
-
-	      v[0] += x[j][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
-	      v[1] += x[j][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
-	      v[2] += x[j][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
-	      v[3] += x[j][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
-	      v[4] += x[j][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
-	      v[5] += x[j][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
-
-	      vlist[n++] = j;
-	      vlist[n++] = jH1;
-	      vlist[n++] = jH2;
-	    }
-	  }
-
-	  if (EFLAG) {
-	    if (CTABLE || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (EVFLAG) ev_tally_list(n,vlist,ecoul,v);
-	}
+        if (itype == typeO || jtype == typeO) {
+          x2 = mpos[j];
+          jH1 = h1idx[j];
+          jH2 = h2idx[j];
+          if (jtype == typeO && ( jH1 < 0 || jH2 < 0))
+            error->one(FLERR,"TIP4P hydrogen is missing");
+          delx = x1[0] - x2[0];
+          dely = x1[1] - x2[1];
+          delz = x1[2] - x2[2];
+          rsq = delx*delx + dely*dely + delz*delz;
+        }
+
+        // Coulombic interaction based on modified rsq
+
+        if (rsq < cut_coulsq) {
+          r2inv = 1 / rsq;
+          if (CTABLE || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) {
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+
+          cforce = forcecoul * r2inv;
+
+          // if i,j are not O atoms, force is applied directly
+          // if i or j are O atoms, force is on fictitious atom & partitioned
+          // force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
+          // f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
+          // preserves total force and torque on water molecule
+          // virial = sum(r x F) where each water's atoms are near xi and xj
+          // vlist stores 2,4,6 atoms whose forces contribute to virial
+
+          n = 0;
+
+          if (itype != typeO) {
+            fxtmp += delx * cforce;
+            fytmp += dely * cforce;
+            fztmp += delz * cforce;
+
+            if (VFLAG) {
+              v[0] = x[i][0] * delx * cforce;
+              v[1] = x[i][1] * dely * cforce;
+              v[2] = x[i][2] * delz * cforce;
+              v[3] = x[i][0] * dely * cforce;
+              v[4] = x[i][0] * delz * cforce;
+              v[5] = x[i][1] * delz * cforce;
+              vlist[n++] = i;
+            }
+
+          } else {
+
+            fdx = delx*cforce;
+            fdy = dely*cforce;
+            fdz = delz*cforce;
+
+            delxOM = x[i][0] - x1[0];
+            delyOM = x[i][1] - x1[1];
+            delzOM = x[i][2] - x1[2];
+
+            ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
+              (qdist*qdist);
+
+            f1x = alpha * (fdx - ddotf * delxOM);
+            f1y = alpha * (fdy - ddotf * delyOM);
+            f1z = alpha * (fdz - ddotf * delzOM);
+
+            fOx = fdx - f1x;
+            fOy = fdy - f1y;
+            fOz = fdz - f1z;
+
+            fHx = 0.5 * f1x;
+            fHy = 0.5 * f1y;
+            fHz = 0.5 * f1z;
+
+            fxtmp += fOx;
+            fytmp += fOy;
+            fztmp += fOz;
+
+            f[iH1][0] += fHx;
+            f[iH1][1] += fHy;
+            f[iH1][2] += fHz;
+
+            f[iH2][0] += fHx;
+            f[iH2][1] += fHy;
+            f[iH2][2] += fHz;
+
+            if (VFLAG) {
+              domain->closest_image(x[i],x[iH1],xH1);
+              domain->closest_image(x[i],x[iH2],xH2);
+
+              v[0] = x[i][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
+              v[1] = x[i][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
+              v[2] = x[i][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
+              v[3] = x[i][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
+              v[4] = x[i][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
+              v[5] = x[i][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
+
+              vlist[n++] = i;
+              vlist[n++] = iH1;
+              vlist[n++] = iH2;
+            }
+          }
+
+          if (jtype != typeO) {
+            f[j][0] -= delx * cforce;
+            f[j][1] -= dely * cforce;
+            f[j][2] -= delz * cforce;
+
+            if (VFLAG) {
+              v[0] -= x[j][0] * delx * cforce;
+              v[1] -= x[j][1] * dely * cforce;
+              v[2] -= x[j][2] * delz * cforce;
+              v[3] -= x[j][0] * dely * cforce;
+              v[4] -= x[j][0] * delz * cforce;
+              v[5] -= x[j][1] * delz * cforce;
+              vlist[n++] = j;
+            }
+
+          } else {
+
+            fdx = -delx*cforce;
+            fdy = -dely*cforce;
+            fdz = -delz*cforce;
+
+            delxOM = x[j][0] - x2[0];
+            delyOM = x[j][1] - x2[1];
+            delzOM = x[j][2] - x2[2];
+
+            ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
+              (qdist*qdist);
+
+            f1x = alpha * (fdx - ddotf * delxOM);
+            f1y = alpha * (fdy - ddotf * delyOM);
+            f1z = alpha * (fdz - ddotf * delzOM);
+
+            fOx = fdx - f1x;
+            fOy = fdy - f1y;
+            fOz = fdz - f1z;
+
+            fHx = 0.5 * f1x;
+            fHy = 0.5 * f1y;
+            fHz = 0.5 * f1z;
+
+            f[j][0] += fOx;
+            f[j][1] += fOy;
+            f[j][2] += fOz;
+
+            f[jH1][0] += fHx;
+            f[jH1][1] += fHy;
+            f[jH1][2] += fHz;
+
+            f[jH2][0] += fHx;
+            f[jH2][1] += fHy;
+            f[jH2][2] += fHz;
+
+            if (VFLAG) {
+              domain->closest_image(x[j],x[jH1],xH1);
+              domain->closest_image(x[j],x[jH2],xH2);
+
+              v[0] += x[j][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
+              v[1] += x[j][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
+              v[2] += x[j][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
+              v[3] += x[j][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
+              v[4] += x[j][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
+              v[5] += x[j][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
+
+              vlist[n++] = j;
+              vlist[n++] = jH1;
+              vlist[n++] = jH2;
+            }
+          }
+
+          if (EFLAG) {
+            if (CTABLE || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (EVFLAG) ev_tally_list(n,vlist,ecoul,v);
+        }
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/OPT/pair_lj_cut_coul_long_tip4p_opt.h b/src/OPT/pair_lj_cut_coul_long_tip4p_opt.h
index 4f77ca7c02..45c5e0c147 100644
--- a/src/OPT/pair_lj_cut_coul_long_tip4p_opt.h
+++ b/src/OPT/pair_lj_cut_coul_long_tip4p_opt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/OPT/pair_lj_cut_opt.cpp b/src/OPT/pair_lj_cut_opt.cpp
index 8f855da566..a3d90eae50 100644
--- a/src/OPT/pair_lj_cut_opt.cpp
+++ b/src/OPT/pair_lj_cut_opt.cpp
@@ -5,14 +5,14 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Contributing authors:  
+   Contributing authors:
      James Fischer, High Performance Technologies, Inc.
      David Richie, Stone Ridge Technology
      Vincent Natoli, Stone Ridge Technology
@@ -57,16 +57,16 @@ template < int EVFLAG, int EFLAG, int NEWTON_PAIR >
 void PairLJCutOpt::eval()
 {
   typedef struct { double x,y,z; } vec3_t;
-  
+
   typedef struct {
     double cutsq,lj1,lj2,lj3,lj4,offset;
     double _pad[2];
   } fast_alpha_t;
-  
+
   int i,j,ii,jj,inum,jnum,itype,jtype,sbindex;
   double factor_lj;
   double evdwl = 0.0;
-  
+
   double** __restrict__ x = atom->x;
   double** __restrict__ f = atom->f;
   int* __restrict__ type = atom->type;
@@ -77,14 +77,14 @@ void PairLJCutOpt::eval()
   int* __restrict__ ilist = list->ilist;
   int** __restrict__ firstneigh = list->firstneigh;
   int* __restrict__ numneigh = list->numneigh;
-  
+
   vec3_t* __restrict__ xx = (vec3_t*)x[0];
   vec3_t* __restrict__ ff = (vec3_t*)f[0];
-  
+
   int ntypes = atom->ntypes;
   int ntypes2 = ntypes*ntypes;
-  
-  fast_alpha_t* __restrict__ fast_alpha = 
+
+  fast_alpha_t* __restrict__ fast_alpha =
     (fast_alpha_t*) malloc(ntypes2*sizeof(fast_alpha_t));
   for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) {
     fast_alpha_t& a = fast_alpha[i*ntypes+j];
@@ -96,9 +96,9 @@ void PairLJCutOpt::eval()
     a.offset = offset[i+1][j+1];
   }
   fast_alpha_t* __restrict__ tabsix = fast_alpha;
-  
+
   // loop over neighbors of my atoms
-  
+
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
     double xtmp = xx[i].x;
@@ -107,86 +107,86 @@ void PairLJCutOpt::eval()
     itype = type[i] - 1;
     int* __restrict__ jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     double tmpfx = 0.0;
     double tmpfy = 0.0;
     double tmpfz = 0.0;
-    
+
     fast_alpha_t* __restrict__ tabsixi = (fast_alpha_t*)&tabsix[itype*ntypes];
-    
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       sbindex = sbmask(j);
 
       if (sbindex == 0) {
-	double delx = xtmp - xx[j].x;
-	double dely = ytmp - xx[j].y;
-	double delz = ztmp - xx[j].z;
-	double rsq = delx*delx + dely*dely + delz*delz;
-	
-	jtype = type[j] - 1;
-	
-	fast_alpha_t& a = tabsixi[jtype];
-	
-	if (rsq < a.cutsq) {
-	  double r2inv = 1.0/rsq;
-	  double r6inv = r2inv*r2inv*r2inv;
-	  double forcelj = r6inv * (a.lj1*r6inv - a.lj2);
-	  double fpair = forcelj*r2inv;
-	  
-	  tmpfx += delx*fpair;
-	  tmpfy += dely*fpair;
-	  tmpfz += delz*fpair;
-	  if (NEWTON_PAIR || j < nlocal) {
-	    ff[j].x -= delx*fpair;
-	    ff[j].y -= dely*fpair;
-	    ff[j].z -= delz*fpair;
-	  }
-
-	  if (EFLAG) evdwl = r6inv*(a.lj3*r6inv-a.lj4) - a.offset;
-
-	  if (EVFLAG)
-	    ev_tally(i,j,nlocal,NEWTON_PAIR,
-		     evdwl,0.0,fpair,delx,dely,delz);
-	}
+        double delx = xtmp - xx[j].x;
+        double dely = ytmp - xx[j].y;
+        double delz = ztmp - xx[j].z;
+        double rsq = delx*delx + dely*dely + delz*delz;
+
+        jtype = type[j] - 1;
+
+        fast_alpha_t& a = tabsixi[jtype];
+
+        if (rsq < a.cutsq) {
+          double r2inv = 1.0/rsq;
+          double r6inv = r2inv*r2inv*r2inv;
+          double forcelj = r6inv * (a.lj1*r6inv - a.lj2);
+          double fpair = forcelj*r2inv;
+
+          tmpfx += delx*fpair;
+          tmpfy += dely*fpair;
+          tmpfz += delz*fpair;
+          if (NEWTON_PAIR || j < nlocal) {
+            ff[j].x -= delx*fpair;
+            ff[j].y -= dely*fpair;
+            ff[j].z -= delz*fpair;
+          }
+
+          if (EFLAG) evdwl = r6inv*(a.lj3*r6inv-a.lj4) - a.offset;
+
+          if (EVFLAG)
+            ev_tally(i,j,nlocal,NEWTON_PAIR,
+                     evdwl,0.0,fpair,delx,dely,delz);
+        }
 
       } else {
-	factor_lj = special_lj[sbindex];
-	j &= NEIGHMASK;
-
-	double delx = xtmp - xx[j].x;
-	double dely = ytmp - xx[j].y;
-	double delz = ztmp - xx[j].z;
-	double rsq = delx*delx + dely*dely + delz*delz;
-	
-	int jtype1 = type[j];
-	jtype = jtype1 - 1;
-	
-	fast_alpha_t& a = tabsixi[jtype];
-	if (rsq < a.cutsq) {
-	  double r2inv = 1.0/rsq;
-	  double r6inv = r2inv*r2inv*r2inv;
-	  fast_alpha_t& a = tabsixi[jtype];
-	  double forcelj = r6inv * (a.lj1*r6inv - a.lj2);
-	  double fpair = factor_lj*forcelj*r2inv;
-	  
-	  tmpfx += delx*fpair;
-	  tmpfy += dely*fpair;
-	  tmpfz += delz*fpair;
-	  if (NEWTON_PAIR || j < nlocal) {
-	    ff[j].x -= delx*fpair;
-	    ff[j].y -= dely*fpair;
-	    ff[j].z -= delz*fpair;
-	  }
-
-	  if (EFLAG) {
-	    evdwl = r6inv*(a.lj3*r6inv-a.lj4) - a.offset;
-	    evdwl *= factor_lj;
-	  }
-	  
-	  if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
-			       evdwl,0.0,fpair,delx,dely,delz);
-	}
+        factor_lj = special_lj[sbindex];
+        j &= NEIGHMASK;
+
+        double delx = xtmp - xx[j].x;
+        double dely = ytmp - xx[j].y;
+        double delz = ztmp - xx[j].z;
+        double rsq = delx*delx + dely*dely + delz*delz;
+
+        int jtype1 = type[j];
+        jtype = jtype1 - 1;
+
+        fast_alpha_t& a = tabsixi[jtype];
+        if (rsq < a.cutsq) {
+          double r2inv = 1.0/rsq;
+          double r6inv = r2inv*r2inv*r2inv;
+          fast_alpha_t& a = tabsixi[jtype];
+          double forcelj = r6inv * (a.lj1*r6inv - a.lj2);
+          double fpair = factor_lj*forcelj*r2inv;
+
+          tmpfx += delx*fpair;
+          tmpfy += dely*fpair;
+          tmpfz += delz*fpair;
+          if (NEWTON_PAIR || j < nlocal) {
+            ff[j].x -= delx*fpair;
+            ff[j].y -= dely*fpair;
+            ff[j].z -= delz*fpair;
+          }
+
+          if (EFLAG) {
+            evdwl = r6inv*(a.lj3*r6inv-a.lj4) - a.offset;
+            evdwl *= factor_lj;
+          }
+
+          if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
+                               evdwl,0.0,fpair,delx,dely,delz);
+        }
       }
     }
 
@@ -196,6 +196,6 @@ void PairLJCutOpt::eval()
   }
 
   free(fast_alpha); fast_alpha = 0;
-  
+
   if (vflag_fdotr) virial_fdotr_compute();
 }
diff --git a/src/OPT/pair_lj_cut_opt.h b/src/OPT/pair_lj_cut_opt.h
index 0bdd004811..0b01d169f8 100644
--- a/src/OPT/pair_lj_cut_opt.h
+++ b/src/OPT/pair_lj_cut_opt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/OPT/pair_morse_opt.cpp b/src/OPT/pair_morse_opt.cpp
index 5a9bfe7bed..c27dd053ff 100644
--- a/src/OPT/pair_morse_opt.cpp
+++ b/src/OPT/pair_morse_opt.cpp
@@ -5,14 +5,14 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Contributing authors:  
+   Contributing authors:
      James Fischer, High Performance Technologies, Inc.
      David Richie, Stone Ridge Technology
      Vincent Natoli, Stone Ridge Technology
@@ -58,34 +58,34 @@ template < int EVFLAG, int EFLAG, int NEWTON_PAIR >
 void PairMorseOpt::eval()
 {
   typedef struct { double x,y,z; } vec3_t;
-  
+
   typedef struct {
     double cutsq,r0,alpha,morse1,d0,offset;
     double _pad[2];
   } fast_alpha_t;
-  
+
   int i,j,ii,jj,inum,jnum,itype,jtype,sbindex;
   double factor_lj;
   double evdwl = 0.0;
-  
+
   double** __restrict__ x = atom->x;
   double** __restrict__ f = atom->f;
   int* __restrict__ type = atom->type;
   int nlocal = atom->nlocal;
   double* __restrict__ special_lj = force->special_lj;
-  
+
   inum = list->inum;
   int* __restrict__ ilist = list->ilist;
   int** __restrict__ firstneigh = list->firstneigh;
   int* __restrict__ numneigh = list->numneigh;
-  
+
   vec3_t* __restrict__ xx = (vec3_t*)x[0];
   vec3_t* __restrict__ ff = (vec3_t*)f[0];
-  
+
   int ntypes = atom->ntypes;
   int ntypes2 = ntypes*ntypes;
-  
-  fast_alpha_t* __restrict__ fast_alpha = 
+
+  fast_alpha_t* __restrict__ fast_alpha =
     (fast_alpha_t*) malloc(ntypes2*sizeof(fast_alpha_t));
   for (i = 0; i < ntypes; i++) for (j = 0; j < ntypes; j++) {
     fast_alpha_t& a = fast_alpha[i*ntypes+j];
@@ -97,9 +97,9 @@ void PairMorseOpt::eval()
     a.offset = offset[i+1][j+1];
   }
   fast_alpha_t* __restrict__ tabsix = fast_alpha;
-  
+
   // loop over neighbors of my atoms
-  
+
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
     double xtmp = xx[i].x;
@@ -108,82 +108,82 @@ void PairMorseOpt::eval()
     itype = type[i] - 1;
     int* __restrict__ jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     double tmpfx = 0.0;
     double tmpfy = 0.0;
     double tmpfz = 0.0;
-    
+
     fast_alpha_t* __restrict__ tabsixi = (fast_alpha_t*)&tabsix[itype*ntypes];
-   
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       sbindex = sbmask(j);
 
       if (sbindex == 0) {
-	double delx = xtmp - xx[j].x;
-	double dely = ytmp - xx[j].y;
-	double delz = ztmp - xx[j].z;
-	double rsq = delx*delx + dely*dely + delz*delz;
-	
-	jtype = type[j] - 1;
-	
-	fast_alpha_t& a = tabsixi[jtype];
-	if (rsq < a.cutsq) {
-	  double r = sqrt(rsq);
-	  double dr = r - a.r0;
-	  double dexp = exp(-a.alpha * dr);
-	  double fpair = a.morse1 * (dexp*dexp - dexp) / r;
-
-	  tmpfx += delx*fpair;
-	  tmpfy += dely*fpair;
-	  tmpfz += delz*fpair;
-	  if (NEWTON_PAIR || j < nlocal) {
-	    ff[j].x -= delx*fpair;
-	    ff[j].y -= dely*fpair;
-	    ff[j].z -= delz*fpair;
-	  }
-
-	  if (EFLAG) evdwl = a.d0 * (dexp*dexp - 2.0*dexp) - a.offset;
-
-	  if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
-			       evdwl,0.0,fpair,delx,dely,delz);
-	}
+        double delx = xtmp - xx[j].x;
+        double dely = ytmp - xx[j].y;
+        double delz = ztmp - xx[j].z;
+        double rsq = delx*delx + dely*dely + delz*delz;
+
+        jtype = type[j] - 1;
+
+        fast_alpha_t& a = tabsixi[jtype];
+        if (rsq < a.cutsq) {
+          double r = sqrt(rsq);
+          double dr = r - a.r0;
+          double dexp = exp(-a.alpha * dr);
+          double fpair = a.morse1 * (dexp*dexp - dexp) / r;
+
+          tmpfx += delx*fpair;
+          tmpfy += dely*fpair;
+          tmpfz += delz*fpair;
+          if (NEWTON_PAIR || j < nlocal) {
+            ff[j].x -= delx*fpair;
+            ff[j].y -= dely*fpair;
+            ff[j].z -= delz*fpair;
+          }
+
+          if (EFLAG) evdwl = a.d0 * (dexp*dexp - 2.0*dexp) - a.offset;
+
+          if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
+                               evdwl,0.0,fpair,delx,dely,delz);
+        }
 
       } else {
-	factor_lj = special_lj[sbindex];
-	j &= NEIGHMASK;
-	
-	double delx = xtmp - xx[j].x;
-	double dely = ytmp - xx[j].y;
-	double delz = ztmp - xx[j].z;
-	double rsq = delx*delx + dely*dely + delz*delz;
-	
-	jtype = type[j] - 1;
-	
-	fast_alpha_t& a = tabsixi[jtype];
-	if (rsq < a.cutsq) {
-	  double r = sqrt(rsq);
-	  double dr = r - a.r0;
-	  double dexp = exp(-a.alpha * dr);
-	  double fpair = factor_lj * a.morse1 * (dexp*dexp - dexp) / r;
-
-	  tmpfx += delx*fpair;
-	  tmpfy += dely*fpair;
-	  tmpfz += delz*fpair;
-	  if (NEWTON_PAIR || j < nlocal) {
-	    ff[j].x -= delx*fpair;
-	    ff[j].y -= dely*fpair;
-	    ff[j].z -= delz*fpair;
-	  }
-
-	  if (EFLAG) {
-	    evdwl = a.d0 * (dexp*dexp - 2.0*dexp) - a.offset;
-	    evdwl *= factor_lj;
-	  }
-	  
-	  if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
-			       evdwl,0.0,fpair,delx,dely,delz);
-	}
+        factor_lj = special_lj[sbindex];
+        j &= NEIGHMASK;
+
+        double delx = xtmp - xx[j].x;
+        double dely = ytmp - xx[j].y;
+        double delz = ztmp - xx[j].z;
+        double rsq = delx*delx + dely*dely + delz*delz;
+
+        jtype = type[j] - 1;
+
+        fast_alpha_t& a = tabsixi[jtype];
+        if (rsq < a.cutsq) {
+          double r = sqrt(rsq);
+          double dr = r - a.r0;
+          double dexp = exp(-a.alpha * dr);
+          double fpair = factor_lj * a.morse1 * (dexp*dexp - dexp) / r;
+
+          tmpfx += delx*fpair;
+          tmpfy += dely*fpair;
+          tmpfz += delz*fpair;
+          if (NEWTON_PAIR || j < nlocal) {
+            ff[j].x -= delx*fpair;
+            ff[j].y -= dely*fpair;
+            ff[j].z -= delz*fpair;
+          }
+
+          if (EFLAG) {
+            evdwl = a.d0 * (dexp*dexp - 2.0*dexp) - a.offset;
+            evdwl *= factor_lj;
+          }
+
+          if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
+                               evdwl,0.0,fpair,delx,dely,delz);
+        }
       }
     }
 
diff --git a/src/OPT/pair_morse_opt.h b/src/OPT/pair_morse_opt.h
index 0e80ac4d74..535430015e 100644
--- a/src/OPT/pair_morse_opt.h
+++ b/src/OPT/pair_morse_opt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp
index cbd95e966a..586823e71d 100644
--- a/src/PERI/atom_vec_peri.cpp
+++ b/src/PERI/atom_vec_peri.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -32,8 +32,8 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-AtomVecPeri::AtomVecPeri(LAMMPS *lmp, int narg, char **arg) : 
-  AtomVec(lmp, narg, arg) 
+AtomVecPeri::AtomVecPeri(LAMMPS *lmp, int narg, char **arg) :
+  AtomVec(lmp, narg, arg)
 {
   molecular = 0;
 
@@ -56,7 +56,7 @@ AtomVecPeri::AtomVecPeri(LAMMPS *lmp, int narg, char **arg) :
    n = 0 grows arrays by DELTA
    n > 0 allocates arrays to size n
 ------------------------------------------------------------------------- */
- 
+
 void AtomVecPeri::grow(int n)
 {
   if (n == 0) nmax += DELTA;
@@ -77,7 +77,7 @@ void AtomVecPeri::grow(int n)
   rmass = memory->grow(atom->rmass,nmax,"atom:rmass");
   s0 = memory->grow(atom->s0,nmax,"atom:s0");
   x0 = memory->grow(atom->x0,nmax,3,"atom:x0");
- 
+
   if (atom->nextra_grow)
     for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
@@ -121,7 +121,7 @@ void AtomVecPeri::copy(int i, int j, int delflag)
   x0[j][2] = x0[i][2];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
 }
 
@@ -167,7 +167,7 @@ int AtomVecPeri::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecPeri::pack_comm_vel(int n, int *list, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 
 {
   int i,j,m;
@@ -197,34 +197,34 @@ int AtomVecPeri::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = s0[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = s0[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = s0[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = s0[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -379,7 +379,7 @@ int AtomVecPeri::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecPeri::pack_border_vel(int n, int *list, double *buf,
-				 int pbc_flag, int *pbc)
+                                 int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -415,48 +415,48 @@ int AtomVecPeri::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = vfrac[j];
-	buf[m++] = s0[j];
-	buf[m++] = x0[j][0];
-	buf[m++] = x0[j][1];
-	buf[m++] = x0[j][2];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = vfrac[j];
+        buf[m++] = s0[j];
+        buf[m++] = x0[j][0];
+        buf[m++] = x0[j][1];
+        buf[m++] = x0[j][2];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = vfrac[j];
-	buf[m++] = s0[j];
-	buf[m++] = x0[j][0];
-	buf[m++] = x0[j][1];
-	buf[m++] = x0[j][2];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = vfrac[j];
+        buf[m++] = s0[j];
+        buf[m++] = x0[j][0];
+        buf[m++] = x0[j][1];
+        buf[m++] = x0[j][2];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -533,7 +533,7 @@ void AtomVecPeri::unpack_border_vel(int n, int first, double *buf)
 }
 
 /* ---------------------------------------------------------------------- */
- 
+
 int AtomVecPeri::unpack_border_hybrid(int n, int first, double *buf)
 {
   int i,m,last;
@@ -577,7 +577,7 @@ int AtomVecPeri::pack_exchange(int i, double *buf)
   buf[m++] = x0[i][2];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -611,9 +611,9 @@ int AtomVecPeri::unpack_exchange(double *buf)
   x0[nlocal][2] = buf[m++];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -624,19 +624,19 @@ int AtomVecPeri::unpack_exchange(double *buf)
    size of restart data for all atoms owned by this proc
    include extra data stored by fixes
 ------------------------------------------------------------------------- */
- 
+
 int AtomVecPeri::size_restart()
 {
   int i;
- 
+
   int nlocal = atom->nlocal;
   int n = 17 * nlocal;
- 
+
   if (atom->nextra_restart)
     for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
         n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
- 
+
   return n;
 }
 
@@ -645,7 +645,7 @@ int AtomVecPeri::size_restart()
    xyz must be 1st 3 values, so that read_restart can test on them
    molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
- 
+
 int AtomVecPeri::pack_restart(int i, double *buf)
 {
   int m = 1;
@@ -659,18 +659,18 @@ int AtomVecPeri::pack_restart(int i, double *buf)
   buf[m++] = v[i][0];
   buf[m++] = v[i][1];
   buf[m++] = v[i][2];
- 
+
   buf[m++] = vfrac[i];
   buf[m++] = rmass[i];
   buf[m++] = s0[i];
   buf[m++] = x0[i][0];
   buf[m++] = x0[i][1];
   buf[m++] = x0[i][2];
- 
+
   if (atom->nextra_restart)
     for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
- 
+
   buf[0] = m;
   return m;
 }
@@ -678,7 +678,7 @@ int AtomVecPeri::pack_restart(int i, double *buf)
 /* ----------------------------------------------------------------------
    unpack data for one atom from restart file including extra quantities
 ------------------------------------------------------------------------- */
- 
+
 int AtomVecPeri::unpack_restart(double *buf)
 {
   int nlocal = atom->nlocal;
@@ -687,7 +687,7 @@ int AtomVecPeri::unpack_restart(double *buf)
     if (atom->nextra_store)
       memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
   }
- 
+
   int m = 1;
   x[nlocal][0] = buf[m++];
   x[nlocal][1] = buf[m++];
@@ -699,20 +699,20 @@ int AtomVecPeri::unpack_restart(double *buf)
   v[nlocal][0] = buf[m++];
   v[nlocal][1] = buf[m++];
   v[nlocal][2] = buf[m++];
- 
+
   vfrac[nlocal] = buf[m++];
   rmass[nlocal] = buf[m++];
   s0[nlocal] = buf[m++];
   x0[nlocal][0] = buf[m++];
   x0[nlocal][1] = buf[m++];
   x0[nlocal][2] = buf[m++];
- 
+
   double **extra = atom->extra;
   if (atom->nextra_store) {
     int size = static_cast<int> (buf[0]) - m;
     for (int i = 0; i < size; i++) extra[nlocal][i] = buf[m++];
   }
- 
+
   atom->nlocal++;
   return m;
 }
@@ -721,12 +721,12 @@ int AtomVecPeri::unpack_restart(double *buf)
    create one atom of itype at coord
    set other values to defaults
 ------------------------------------------------------------------------- */
- 
+
 void AtomVecPeri::create_atom(int itype, double *coord)
 {
   int nlocal = atom->nlocal;
   if (nlocal == nmax) grow(0);
- 
+
   tag[nlocal] = 0;
   type[nlocal] = itype;
   x[nlocal][0] = coord[0];
@@ -737,14 +737,14 @@ void AtomVecPeri::create_atom(int itype, double *coord)
   v[nlocal][0] = 0.0;
   v[nlocal][1] = 0.0;
   v[nlocal][2] = 0.0;
- 
+
   vfrac[nlocal] = 1.0;
   rmass[nlocal] = 1.0;
   s0[nlocal] = DBL_MAX;
   x0[nlocal][0] = coord[0];
   x0[nlocal][1] = coord[1];
   x0[nlocal][2] = coord[2];
- 
+
   atom->nlocal++;
 }
 
@@ -752,7 +752,7 @@ void AtomVecPeri::create_atom(int itype, double *coord)
    unpack one line from Atoms section of data file
    initialize other atom quantities
 ------------------------------------------------------------------------- */
- 
+
 void AtomVecPeri::data_atom(double *coord, int imagetmp, char **values)
 {
   int nlocal = atom->nlocal;
@@ -761,7 +761,7 @@ void AtomVecPeri::data_atom(double *coord, int imagetmp, char **values)
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
     error->one(FLERR,"Invalid atom ID in Atoms section of data file");
- 
+
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
     error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -775,7 +775,7 @@ void AtomVecPeri::data_atom(double *coord, int imagetmp, char **values)
   x[nlocal][2] = coord[2];
 
   image[nlocal] = imagetmp;
- 
+
   mask[nlocal] = 1;
   v[nlocal][0] = 0.0;
   v[nlocal][1] = 0.0;
@@ -785,16 +785,16 @@ void AtomVecPeri::data_atom(double *coord, int imagetmp, char **values)
   x0[nlocal][0] = coord[0];
   x0[nlocal][1] = coord[1];
   x0[nlocal][2] = coord[2];
- 
+
   atom->nlocal++;
 }
- 
+
 
 /* ----------------------------------------------------------------------
    unpack hybrid quantities from one line in Atoms section of data file
    initialize other atom quantities for this sub-style
 ------------------------------------------------------------------------- */
- 
+
 int AtomVecPeri::data_atom_hybrid(int nlocal, char **values)
 {
   vfrac[nlocal] = atof(values[0]);
@@ -805,14 +805,14 @@ int AtomVecPeri::data_atom_hybrid(int nlocal, char **values)
   x0[nlocal][0] = x[nlocal][0];
   x0[nlocal][1] = x[nlocal][1];
   x0[nlocal][2] = x[nlocal][2];
- 
+
   return 2;
 }
 
 /* ----------------------------------------------------------------------
    return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
- 
+
 bigint AtomVecPeri::memory_usage()
 {
   bigint bytes = 0;
@@ -829,6 +829,6 @@ bigint AtomVecPeri::memory_usage()
   if (atom->memcheck("rmass")) bytes += memory->usage(rmass,nmax);
   if (atom->memcheck("s0")) bytes += memory->usage(s0,nmax);
   if (atom->memcheck("x0")) bytes += memory->usage(x0,nmax,3);
- 
+
   return bytes;
 }
diff --git a/src/PERI/atom_vec_peri.h b/src/PERI/atom_vec_peri.h
index 6b5c59511a..b7479414de 100755
--- a/src/PERI/atom_vec_peri.h
+++ b/src/PERI/atom_vec_peri.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/PERI/compute_damage_atom.cpp b/src/PERI/compute_damage_atom.cpp
index 92407985c8..bd8228faf5 100644
--- a/src/PERI/compute_damage_atom.cpp
+++ b/src/PERI/compute_damage_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -110,8 +110,8 @@ void ComputeDamageAtom::compute_peratom()
         j = atom->map(partner[i][jj]);
         if (j < 0) continue;
 
-        damage_temp += vfrac[j];       
-      }  
+        damage_temp += vfrac[j];
+      }
     }
     else damage_temp = vinter[i];
 
diff --git a/src/PERI/compute_damage_atom.h b/src/PERI/compute_damage_atom.h
index a09272faf4..cafff63798 100644
--- a/src/PERI/compute_damage_atom.h
+++ b/src/PERI/compute_damage_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp
index 5a504b7330..12e7a2b47b 100644
--- a/src/PERI/fix_peri_neigh.cpp
+++ b/src/PERI/fix_peri_neigh.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,7 +37,7 @@ using namespace FixConst;
 
 /* ---------------------------------------------------------------------- */
 
-FixPeriNeigh::FixPeriNeigh(LAMMPS *lmp,int narg, char **arg) : 
+FixPeriNeigh::FixPeriNeigh(LAMMPS *lmp,int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
   restart_global = 1;
@@ -106,25 +106,25 @@ void FixPeriNeigh::init()
   int irequest = neighbor->request((void *) this);
   neighbor->requests[irequest]->pair = 0;
   neighbor->requests[irequest]->fix  = 1;
-  neighbor->requests[irequest]->half = 0; 
+  neighbor->requests[irequest]->half = 0;
   neighbor->requests[irequest]->full = 1;
   neighbor->requests[irequest]->occasional = 1;
 }
 
 /* ---------------------------------------------------------------------- */
- 
+
 void FixPeriNeigh::init_list(int id, NeighList *ptr)
 {
   list = ptr;
 }
 
-/* ---------------------------------------------------------------------- 
-   For minimization: setup as with dynamics 
+/* ----------------------------------------------------------------------
+   For minimization: setup as with dynamics
 ------------------------------------------------------------------------- */
 
 void FixPeriNeigh::min_setup(int vflag)
 {
-  setup(vflag); 
+  setup(vflag);
 }
 
 /* ----------------------------------------------------------------------
@@ -241,7 +241,7 @@ void FixPeriNeigh::setup(int vflag)
   }
 
   // sanity check: does any atom appear twice in any neigborlist?
-  // should only be possible if using pbc and domain < 2*delta 
+  // should only be possible if using pbc and domain < 2*delta
 
   if (domain->xperiodic || domain->yperiodic || domain->zperiodic) {
     for (i = 0; i < nlocal; i++) {
@@ -249,8 +249,8 @@ void FixPeriNeigh::setup(int vflag)
       for (jj = 0; jj < jnum; jj++) {
         for (int kk = jj+1; kk < jnum; kk++) {
           if (partner[i][jj] == partner[i][kk])
-	    error->one(FLERR,"Duplicate particle in PeriDynamic bond - "
-		       "simulation box is too small");
+            error->one(FLERR,"Duplicate particle in PeriDynamic bond - "
+                       "simulation box is too small");
         }
       }
     }
@@ -304,8 +304,8 @@ void FixPeriNeigh::setup(int vflag)
       if (pairpmb != NULL) // define influence function to be 1.0
         wvolume[i] += 1.0 * rsq0 * vfrac[j] * vfrac_scale;
       else if (pairlps != NULL) // call the PairPeriLPS influence function
-        wvolume[i] += pairlps->influence_function(delx0,dely0,delz0) * 
-	  rsq0 * vfrac[j] * vfrac_scale;
+        wvolume[i] += pairlps->influence_function(delx0,dely0,delz0) *
+          rsq0 * vfrac[j] * vfrac_scale;
 
     }
   }
diff --git a/src/PERI/fix_peri_neigh.h b/src/PERI/fix_peri_neigh.h
index 19fda12d6a..e5715aa0a6 100644
--- a/src/PERI/fix_peri_neigh.h
+++ b/src/PERI/fix_peri_neigh.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/PERI/pair_peri_lps.cpp b/src/PERI/pair_peri_lps.cpp
index 10002f8d45..70d3530c6b 100644
--- a/src/PERI/pair_peri_lps.cpp
+++ b/src/PERI/pair_peri_lps.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -18,7 +18,7 @@
 #include "math.h"
 #include "stdlib.h"
 #include "string.h"
-#include "pair_peri_lps.h"  			
+#include "pair_peri_lps.h"
 #include "atom.h"
 #include "domain.h"
 #include "lattice.h"
@@ -32,13 +32,13 @@
 #include "neigh_list.h"
 #include "memory.h"
 #include "error.h"
-#include "update.h"                       
+#include "update.h"
 
 using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-PairPeriLPS::PairPeriLPS(LAMMPS *lmp) : Pair(lmp)			
+PairPeriLPS::PairPeriLPS(LAMMPS *lmp) : Pair(lmp)
 {
   for (int i = 0; i < 6; i++) virial[i] = 0.0;
   no_virial_fdotr_compute = 1;
@@ -47,11 +47,11 @@ PairPeriLPS::PairPeriLPS(LAMMPS *lmp) : Pair(lmp)
 
   nmax = 0;
   s0_new = NULL;
-  theta = NULL;				
+  theta = NULL;
 
-  bulkmodulus = NULL;			
-  shearmodulus = NULL;			
-  s00 = alpha = NULL;                    
+  bulkmodulus = NULL;
+  shearmodulus = NULL;
+  s00 = alpha = NULL;
   cut = NULL;
 
   // set comm size needed by this Pair
@@ -62,33 +62,33 @@ PairPeriLPS::PairPeriLPS(LAMMPS *lmp) : Pair(lmp)
 
 /* ---------------------------------------------------------------------- */
 
-PairPeriLPS::~PairPeriLPS()						
+PairPeriLPS::~PairPeriLPS()
 {
   if (ifix_peri >= 0) modify->delete_fix("PERI_NEIGH");
 
   if (allocated) {
     memory->destroy(setflag);
     memory->destroy(cutsq);
-    memory->destroy(bulkmodulus);		
-    memory->destroy(shearmodulus); 		
-    memory->destroy(s00); 		
-    memory->destroy(alpha); 		
+    memory->destroy(bulkmodulus);
+    memory->destroy(shearmodulus);
+    memory->destroy(s00);
+    memory->destroy(alpha);
     memory->destroy(cut);
-    memory->destroy(theta);					
-    memory->destroy(s0_new);					
+    memory->destroy(theta);
+    memory->destroy(s0_new);
   }
 }
 
 /* ---------------------------------------------------------------------- */
 
-void PairPeriLPS::compute(int eflag, int vflag)				
+void PairPeriLPS::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,rk,evdwl,fpair,fbond;
   int *ilist,*jlist,*numneigh,**firstneigh;
-  double d_ij,delta,stretch;                            
+  double d_ij,delta,stretch;
 
   evdwl = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
@@ -142,7 +142,7 @@ void PairPeriLPS::compute(int eflag, int vflag)
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
- 
+
       delx = xtmp - x[j][0];
       dely = ytmp - x[j][1];
       delz = ztmp - x[j][2];
@@ -154,7 +154,7 @@ void PairPeriLPS::compute(int eflag, int vflag)
       if (periodic) domain->minimum_image(delx0,dely0,delz0);
       rsq0 = delx0*delx0 + dely0*dely0 + delz0*delz0;
       jtype = type[j];
- 
+
       r = sqrt(rsq);
 
       // short-range interaction distance based on initial particle position
@@ -170,10 +170,10 @@ void PairPeriLPS::compute(int eflag, int vflag)
         dr = r - d_ij;
 
         // kshort based upon short-range force constant
-	// of the bond-based theory used in PMB model
+        // of the bond-based theory used in PMB model
 
         double kshort = (15.0 * 18.0 * bulkmodulus[itype][itype]) /
-	  (3.141592653589793 * cutsq[itype][jtype] * cutsq[itype][jtype]);
+          (3.141592653589793 * cutsq[itype][jtype] * cutsq[itype][jtype]);
         rk = (kshort * vfrac[j]) * (dr / cut[itype][jtype]);
 
         if (r > 0.0) fpair = -(rk/r);
@@ -189,8 +189,8 @@ void PairPeriLPS::compute(int eflag, int vflag)
         }
 
         if (eflag) evdwl = 0.5*rk*dr;
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,
-			     fpair*vfrac[i],delx,dely,delz);
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,
+                             fpair*vfrac[i],delx,dely,delz);
       }
     }
   }
@@ -198,17 +198,17 @@ void PairPeriLPS::compute(int eflag, int vflag)
   // grow bond forces array if necessary
 
   if (atom->nmax > nmax) {
-    memory->destroy(s0_new);				
-    memory->destroy(theta);				
+    memory->destroy(s0_new);
+    memory->destroy(theta);
     nmax = atom->nmax;
     memory->create(s0_new,nmax,"pair:s0_new");
     memory->create(theta,nmax,"pair:theta");
   }
 
-  // Compute the dilatation on each particle				
-  compute_dilatation();						
+  // Compute the dilatation on each particle
+  compute_dilatation();
 
-  // communicate dilatation (theta) of each particle	
+  // communicate dilatation (theta) of each particle
   comm->forward_comm_pair(this);
   // communicate wighted volume (wvolume) upon every reneighbor
   if (neighbor->ago == 0)
@@ -216,12 +216,12 @@ void PairPeriLPS::compute(int eflag, int vflag)
 
   // Volume-dependent part of the energy
   if (eflag) {
-    for (i = 0; i < nlocal; i++) {   
+    for (i = 0; i < nlocal; i++) {
       itype = type[i];
       if (eflag_global)
-	eng_vdwl += 0.5 * bulkmodulus[itype][itype] * (theta[i] * theta[i]);
+        eng_vdwl += 0.5 * bulkmodulus[itype][itype] * (theta[i] * theta[i]);
       if (eflag_atom)
-	eatom[i] += 0.5 * bulkmodulus[itype][itype] * (theta[i] * theta[i]);
+        eatom[i] += 0.5 * bulkmodulus[itype][itype] * (theta[i] * theta[i]);
     }
   }
 
@@ -237,9 +237,9 @@ void PairPeriLPS::compute(int eflag, int vflag)
     xtmp = x[i][0];
     ytmp = x[i][1];
     ztmp = x[i][2];
-    xtmp0 = x0[i][0];			
-    ytmp0 = x0[i][1];		
-    ztmp0 = x0[i][2];			
+    xtmp0 = x0[i][0];
+    ytmp0 = x0[i][1];
+    ztmp0 = x0[i][2];
     itype = type[i];
     jnum = npartner[i];
     first = true;
@@ -262,10 +262,10 @@ void PairPeriLPS::compute(int eflag, int vflag)
       delz = ztmp - x[j][2];
       if (periodic) domain->minimum_image(delx,dely,delz);
       rsq = delx*delx + dely*dely + delz*delz;
-      delx0 = xtmp0 - x0[j][0];						
-      dely0 = ytmp0 - x0[j][1];						
-      delz0 = ztmp0 - x0[j][2];						
-      if (periodic) domain->minimum_image(delx0,dely0,delz0);   
+      delx0 = xtmp0 - x0[j][0];
+      dely0 = ytmp0 - x0[j][1];
+      delz0 = ztmp0 - x0[j][2];
+      if (periodic) domain->minimum_image(delx0,dely0,delz0);
       jtype = type[j];
       delta = cut[itype][jtype];
       r = sqrt(rsq);
@@ -278,18 +278,18 @@ void PairPeriLPS::compute(int eflag, int vflag)
       // scale vfrac[j] if particle j near the horizon
 
       if ((fabs(r0[i][jj] - delta)) <= half_lc)
-        vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) + 
-	  (1.0 + ((delta - half_lc)/(2*half_lc) ) );
+        vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) +
+          (1.0 + ((delta - half_lc)/(2*half_lc) ) );
       else vfrac_scale = 1.0;
 
       omega_plus  = influence_function(-1.0*delx0,-1.0*dely0,-1.0*delz0);
       omega_minus = influence_function(delx0,dely0,delz0);
-      rk = ( (3.0 * bulkmodulus[itype][itype]) - 
-	     (5.0 * shearmodulus[itype][itype]) ) * vfrac[j] * vfrac_scale * 
-	( (omega_plus * theta[i] / wvolume[i]) + 
-	  ( omega_minus * theta[j] / wvolume[j] ) ) * r0[i][jj]; 
+      rk = ( (3.0 * bulkmodulus[itype][itype]) -
+             (5.0 * shearmodulus[itype][itype]) ) * vfrac[j] * vfrac_scale *
+        ( (omega_plus * theta[i] / wvolume[i]) +
+          ( omega_minus * theta[j] / wvolume[j] ) ) * r0[i][jj];
       rk +=  15.0 * ( shearmodulus[itype][itype] * vfrac[j] * vfrac_scale ) *
-	( (omega_plus / wvolume[i]) + (omega_minus / wvolume[j]) ) * dr; 
+        ( (omega_plus / wvolume[i]) + (omega_minus / wvolume[j]) ) * dr;
 
       if (r > 0.0) fbond = -(rk/r);
       else fbond = 0.0;
@@ -298,14 +298,14 @@ void PairPeriLPS::compute(int eflag, int vflag)
       f[i][1] += dely*fbond;
       f[i][2] += delz*fbond;
 
-      // since I-J is double counted, set newton off & use 1/2 factor and I,I 
+      // since I-J is double counted, set newton off & use 1/2 factor and I,I
 
       double deviatoric_extension = dr - (theta[i]* r0[i][jj] / 3.0);
-      if (eflag) evdwl = 0.5 * 15 * (shearmodulus[itype][itype]/wvolume[i]) * 
-		   omega_plus*(deviatoric_extension * deviatoric_extension) *
-		   vfrac[j] * vfrac_scale;
+      if (eflag) evdwl = 0.5 * 15 * (shearmodulus[itype][itype]/wvolume[i]) *
+                   omega_plus*(deviatoric_extension * deviatoric_extension) *
+                   vfrac[j] * vfrac_scale;
       if (evflag) ev_tally(i,i,nlocal,0,0.5*evdwl,0.0,
-			   0.5*fbond*vfrac[i],delx,dely,delz);
+                           0.5*fbond*vfrac[i],delx,dely,delz);
 
       // find stretch in bond I-J and break if necessary
       // use s0 from previous timestep
@@ -318,8 +318,8 @@ void PairPeriLPS::compute(int eflag, int vflag)
       if (first)
          s0_new[i] = s00[itype][jtype] - (alpha[itype][jtype] * stretch);
       else
-         s0_new[i] = MAX(s0_new[i],s00[itype][jtype] - 
-			 (alpha[itype][jtype] * stretch));
+         s0_new[i] = MAX(s0_new[i],s00[itype][jtype] -
+                         (alpha[itype][jtype] * stretch));
 
       first = false;
     }
@@ -334,7 +334,7 @@ void PairPeriLPS::compute(int eflag, int vflag)
    allocate all arrays
 ------------------------------------------------------------------------- */
 
-void PairPeriLPS::allocate()					
+void PairPeriLPS::allocate()
 {
   allocated = 1;
   int n = atom->ntypes;
@@ -347,8 +347,8 @@ void PairPeriLPS::allocate()
   memory->create(cutsq,n+1,n+1,"pair:cutsq");
   memory->create(bulkmodulus,n+1,n+1,"pair:bulkmodulus");
   memory->create(shearmodulus,n+1,n+1,"pair:shearmodulus");
-  memory->create(s00,n+1,n+1,"pair:s00");		
-  memory->create(alpha,n+1,n+1,"pair:alpha");		
+  memory->create(s00,n+1,n+1,"pair:s00");
+  memory->create(alpha,n+1,n+1,"pair:alpha");
   memory->create(cut,n+1,n+1,"pair:cut");
 }
 
@@ -356,7 +356,7 @@ void PairPeriLPS::allocate()
    global settings
 ------------------------------------------------------------------------- */
 
-void PairPeriLPS::settings(int narg, char **arg)		
+void PairPeriLPS::settings(int narg, char **arg)
 {
   if (narg) error->all(FLERR,"Illegal pair_style command");
 }
@@ -365,9 +365,9 @@ void PairPeriLPS::settings(int narg, char **arg)
    set coeffs for one or more type pairs
 ------------------------------------------------------------------------- */
 
-void PairPeriLPS::coeff(int narg, char **arg)			
+void PairPeriLPS::coeff(int narg, char **arg)
 {
-  if (narg != 7) error->all(FLERR,"Incorrect args for pair coefficients"); 	
+  if (narg != 7) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
   int ilo,ihi,jlo,jhi;
@@ -383,8 +383,8 @@ void PairPeriLPS::coeff(int narg, char **arg)
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
     for (int j = MAX(jlo,i); j <= jhi; j++) {
-      bulkmodulus[i][j] = bulkmodulus_one;		
-      shearmodulus[i][j] = shearmodulus_one;		
+      bulkmodulus[i][j] = bulkmodulus_one;
+      shearmodulus[i][j] = shearmodulus_one;
       cut[i][j] = cut_one;
       s00[i][j] = s00_one;
       alpha[i][j] = alpha_one;
@@ -400,7 +400,7 @@ void PairPeriLPS::coeff(int narg, char **arg)
    init for one type pair i,j and corresponding j,i
 ------------------------------------------------------------------------- */
 
-double PairPeriLPS::init_one(int i, int j)			
+double PairPeriLPS::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
@@ -417,18 +417,18 @@ double PairPeriLPS::init_one(int i, int j)
    init specific to this pair style
 ------------------------------------------------------------------------- */
 
-void PairPeriLPS::init_style() 				
+void PairPeriLPS::init_style()
 {
   // error checks
 
   if (!atom->peri_flag)  error->all(FLERR,"Pair style peri requires atom style peri");
-  if (atom->map_style == 0) 
+  if (atom->map_style == 0)
     error->all(FLERR,"Pair peri requires an atom map, see atom_modify");
 
   if (domain->lattice == NULL)
     error->all(FLERR,"Pair peri requires a lattice be defined");
-  if (domain->lattice->xlattice != domain->lattice->ylattice || 
-      domain->lattice->xlattice != domain->lattice->zlattice || 
+  if (domain->lattice->xlattice != domain->lattice->ylattice ||
+      domain->lattice->xlattice != domain->lattice->zlattice ||
       domain->lattice->ylattice != domain->lattice->zlattice)
     error->all(FLERR,"Pair peri lattice is not identical in x, y, and z");
 
@@ -457,18 +457,18 @@ void PairPeriLPS::init_style()
   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
-void PairPeriLPS::write_restart(FILE *fp)		
+void PairPeriLPS::write_restart(FILE *fp)
 {
   int i,j;
   for (i = 1; i <= atom->ntypes; i++)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&bulkmodulus[i][j],sizeof(double),1,fp); 	
-	fwrite(&shearmodulus[i][j],sizeof(double),1,fp);	
-	fwrite(&s00[i][j],sizeof(double),1,fp);	
-	fwrite(&alpha[i][j],sizeof(double),1,fp);	
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&bulkmodulus[i][j],sizeof(double),1,fp);
+        fwrite(&shearmodulus[i][j],sizeof(double),1,fp);
+        fwrite(&s00[i][j],sizeof(double),1,fp);
+        fwrite(&alpha[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -477,7 +477,7 @@ void PairPeriLPS::write_restart(FILE *fp)
   proc 0 reads from restart file, bcasts
 ------------------------------------------------------------------------- */
 
-void PairPeriLPS::read_restart(FILE *fp)		
+void PairPeriLPS::read_restart(FILE *fp)
 {
   allocate();
 
@@ -488,18 +488,18 @@ void PairPeriLPS::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&bulkmodulus[i][j],sizeof(double),1,fp);		
-	  fread(&shearmodulus[i][j],sizeof(double),1,fp);		
-	  fread(&s00[i][j],sizeof(double),1,fp);                        
-	  fread(&alpha[i][j],sizeof(double),1,fp);                        
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&bulkmodulus[i][j],1,MPI_DOUBLE,0,world);		
-	MPI_Bcast(&shearmodulus[i][j],1,MPI_DOUBLE,0,world);		
-	MPI_Bcast(&s00[i][j],1,MPI_DOUBLE,0,world);                      
-	MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world);                      
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&bulkmodulus[i][j],sizeof(double),1,fp);
+          fread(&shearmodulus[i][j],sizeof(double),1,fp);
+          fread(&s00[i][j],sizeof(double),1,fp);
+          fread(&alpha[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&bulkmodulus[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&shearmodulus[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&s00[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -507,8 +507,8 @@ void PairPeriLPS::read_restart(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairPeriLPS::single(int i, int j, int itype, int jtype,
-			   double rsq, double factor_coul, double factor_lj,
-			   double &fforce)
+                           double rsq, double factor_coul, double factor_lj,
+                           double &fforce)
 {
   double delx0,dely0,delz0,rsq0;
   double d_ij,r,dr,rk,vfrac_scale;
@@ -523,8 +523,8 @@ double PairPeriLPS::single(int i, int j, int itype, int jtype,
   double lc = domain->lattice->xlattice;
   double half_lc = 0.5*lc;
 
-  double kshort;				
- 
+  double kshort;
+
   delx0 = x0[i][0] - x0[j][0];
   dely0 = x0[i][1] - x0[j][1];
   delz0 = x0[i][2] - x0[j][2];
@@ -545,17 +545,17 @@ double PairPeriLPS::single(int i, int j, int itype, int jtype,
              ( 3.141592653589793 * cutsq[itype][jtype] * cutsq[itype][jtype]);
     rk = ( kshort * vfrac[j]) * (dr / sqrt(cutsq[itype][jtype]));
     if (r > 0.0) fforce += -(rk/r);
-    energy += 0.5*rk*dr;	
+    energy += 0.5*rk*dr;
   }
- 
+
    if (atom->nmax > nmax) {
     memory->destroy(theta);
     nmax = atom->nmax;
     memory->create(theta,nmax,"pair:theta");
   }
 
-  // Compute the dilatation on each particle			
-  compute_dilatation();					
+  // Compute the dilatation on each particle
+  compute_dilatation();
 
   // communicate dilatation (theta) of each particle
   comm->forward_comm_pair(this);
@@ -563,7 +563,7 @@ double PairPeriLPS::single(int i, int j, int itype, int jtype,
   if (neighbor->ago == 0)
     comm->forward_comm_fix(modify->fix[ifix_peri]);
 
-  double omega_plus, omega_minus;               
+  double omega_plus, omega_minus;
 
   int jnum = npartner[i];
   for (int jj = 0; jj < jnum; jj++) {
@@ -576,23 +576,23 @@ double PairPeriLPS::single(int i, int j, int itype, int jtype,
       // scale vfrac[j] if particle j near the horizon
 
       if ( (fabs(r0[i][jj] - sqrt(cutsq[itype][jtype]))) <= half_lc)
-	vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) + 
-	  (1.0 + ((sqrt(cutsq[itype][jtype]) - half_lc)/(2*half_lc)));
+        vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) +
+          (1.0 + ((sqrt(cutsq[itype][jtype]) - half_lc)/(2*half_lc)));
       else vfrac_scale = 1.0;
 
       omega_plus  = influence_function(-1.0*delx0,-1.0*dely0,-1.0*delz0);
-      omega_minus = influence_function(delx0,dely0,delz0);	
+      omega_minus = influence_function(delx0,dely0,delz0);
       rk = (3.0* bulkmodulus[itype][itype] -5.0 * shearmodulus[itype][itype]) *
-	vfrac[j] * vfrac_scale  * ( (omega_plus * theta[i] / wvolume[i]) + 
-				    (omega_minus * theta[j] / wvolume[j])) * 
-	r0[i][jj];
-      rk +=  15.0 * ( shearmodulus[itype][itype] * vfrac[j] * vfrac_scale ) * 
-	( (omega_plus / wvolume[i]) + (omega_minus / wvolume[j]) ) * dr; 
+        vfrac[j] * vfrac_scale  * ( (omega_plus * theta[i] / wvolume[i]) +
+                                    (omega_minus * theta[j] / wvolume[j])) *
+        r0[i][jj];
+      rk +=  15.0 * ( shearmodulus[itype][itype] * vfrac[j] * vfrac_scale ) *
+        ( (omega_plus / wvolume[i]) + (omega_minus / wvolume[j]) ) * dr;
 
       if (r > 0.0) fforce += -(rk/r);
-        energy += 0.5 * 15 * (shearmodulus[itype][itype]/wvolume[i]) * 
-	  omega_plus * (  dr - theta[i]* r0[i][jj] / 3.0 ) * 
-	  (  dr - theta[i]* r0[i][jj] / 3.0 ) * vfrac[j] * vfrac_scale;
+        energy += 0.5 * 15 * (shearmodulus[itype][itype]/wvolume[i]) *
+          omega_plus * (  dr - theta[i]* r0[i][jj] / 3.0 ) *
+          (  dr - theta[i]* r0[i][jj] / 3.0 ) * vfrac[j] * vfrac_scale;
 
      }
   }
@@ -601,7 +601,7 @@ double PairPeriLPS::single(int i, int j, int itype, int jtype,
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairPeriLPS::memory_usage()
@@ -641,7 +641,7 @@ void PairPeriLPS::compute_dilatation()
   int nlocal = atom->nlocal;
   double *vfrac = atom->vfrac;
   double vfrac_scale = 1.0;
-  
+
   double lc = domain->lattice->xlattice;
   double half_lc = 0.5*lc;
 
@@ -702,12 +702,12 @@ void PairPeriLPS::compute_dilatation()
       else vfrac_scale = 1.0;
 
       theta[i] += influence_function(delx0, dely0, delz0) * r0[i][jj] * dr *
-	vfrac[j] * vfrac_scale;
+        vfrac[j] * vfrac_scale;
 
     }
 
     // if wvolume[i] is zero, then particle i has no bonds
-    // therefore, the dilatation is set to 
+    // therefore, the dilatation is set to
 
     if (wvolume[i] != 0.0) theta[i] = (3.0/wvolume[i]) * theta[i];
     else theta[i] = 0;
@@ -717,13 +717,13 @@ void PairPeriLPS::compute_dilatation()
 /* ----------------------------------------------------------------------
    communication routines
    ---------------------------------------------------------------------- */
- 
+
 int PairPeriLPS::pack_comm(int n, int *list, double *buf,
-			   int pbc_flag, int *pbc)
+                           int pbc_flag, int *pbc)
 {
 
   int i,j,m;
- 
+
   m = 0;
   for (i = 0; i < n; i++) {
     j = list[i];
@@ -731,18 +731,16 @@ int PairPeriLPS::pack_comm(int n, int *list, double *buf,
   }
   return 1;
 }
- 
+
 /* ---------------------------------------------------------------------- */
- 
+
 void PairPeriLPS::unpack_comm(int n, int first, double *buf)
 {
   int i,m,last;
- 
+
   m = 0;
   last = first + n;
   for (i = first; i < last; i++) {
     theta[i] = buf[m++];
   }
 }
-
-
diff --git a/src/PERI/pair_peri_lps.h b/src/PERI/pair_peri_lps.h
index aa2ab23c3b..e6cfee15f5 100644
--- a/src/PERI/pair_peri_lps.h
+++ b/src/PERI/pair_peri_lps.h
@@ -5,31 +5,31 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
-#ifdef PAIR_CLASS                    
+#ifdef PAIR_CLASS
 
-PairStyle(peri/lps,PairPeriLPS)      
+PairStyle(peri/lps,PairPeriLPS)
 
-#else                                 
+#else
 
-#ifndef LMP_PAIR_PERI_LPS_H          
-#define LMP_PAIR_PERI_LPS_H          
+#ifndef LMP_PAIR_PERI_LPS_H
+#define LMP_PAIR_PERI_LPS_H
 
 #include "pair.h"
 
 namespace LAMMPS_NS {
 
-class PairPeriLPS : public Pair {    
+class PairPeriLPS : public Pair {
  public:
-  PairPeriLPS(class LAMMPS *);       
-  virtual ~PairPeriLPS();                                   
-  int pack_comm(int, int *, double *, int, int *);  
-  void unpack_comm(int, int, double *);             
+  PairPeriLPS(class LAMMPS *);
+  virtual ~PairPeriLPS();
+  int pack_comm(int, int *, double *, int, int *);
+  void unpack_comm(int, int, double *);
 
   virtual void compute(int, int);
   void settings(int, char **);
@@ -43,17 +43,17 @@ class PairPeriLPS : public Pair {
   double single(int, int, int, int, double, double, double, double &);
   double memory_usage();
   double influence_function(double, double, double);
-  void compute_dilatation();   
+  void compute_dilatation();
 
  protected:
   int ifix_peri;
-  double **bulkmodulus;                
-  double **shearmodulus;               
-  double **s00, **alpha;                  
+  double **bulkmodulus;
+  double **shearmodulus;
+  double **s00, **alpha;
   double **cut;
- 
-  double *s0_new;                  
-  double *theta;                      
+
+  double *s0_new;
+  double *theta;
   int nmax;
 
   void allocate();
diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp
index 2d0ae40725..a4623f2517 100644
--- a/src/PERI/pair_peri_pmb.cpp
+++ b/src/PERI/pair_peri_pmb.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -134,7 +134,7 @@ void PairPeriPMB::compute(int eflag, int vflag)
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
- 
+
       delx = xtmp - x[j][0];
       dely = ytmp - x[j][1];
       delz = ztmp - x[j][2];
@@ -145,7 +145,7 @@ void PairPeriPMB::compute(int eflag, int vflag)
       if (periodic) domain->minimum_image(delx0,dely0,delz0);
       rsq0 = delx0*delx0 + dely0*dely0 + delz0*delz0;
       jtype = type[j];
- 
+
       r = sqrt(rsq);
 
       // short-range interaction distance based on initial particle position
@@ -160,8 +160,8 @@ void PairPeriPMB::compute(int eflag, int vflag)
       if (r < d_ij) {
         dr = r - d_ij;
 
-        rk = (15.0 * kspring[itype][jtype] * vfrac[j]) * 
-	  (dr / cut[itype][jtype]);
+        rk = (15.0 * kspring[itype][jtype] * vfrac[j]) *
+          (dr / cut[itype][jtype]);
         if (r > 0.0) fpair = -(rk/r);
         else fpair = 0.0;
 
@@ -175,7 +175,7 @@ void PairPeriPMB::compute(int eflag, int vflag)
         }
 
         if (eflag) evdwl = 0.5*rk*dr;
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair*vfrac[i],delx,dely,delz);
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair*vfrac[i],delx,dely,delz);
       }
     }
   }
@@ -234,8 +234,8 @@ void PairPeriPMB::compute(int eflag, int vflag)
       // scale vfrac[j] if particle j near the horizon
 
       if ((fabs(r0[i][jj] - delta)) <= half_lc)
-        vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) + 
-	  (1.0 + ((delta - half_lc)/(2*half_lc) ) );
+        vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) +
+          (1.0 + ((delta - half_lc)/(2*half_lc) ) );
       else vfrac_scale = 1.0;
 
       stretch = dr / r0[i][jj];
@@ -247,7 +247,7 @@ void PairPeriPMB::compute(int eflag, int vflag)
       f[i][1] += dely*fbond;
       f[i][2] += delz*fbond;
 
-      // since I-J is double counted, set newton off & use 1/2 factor and I,I 
+      // since I-J is double counted, set newton off & use 1/2 factor and I,I
 
       if (eflag) evdwl = 0.5*rk*dr;
       if (evflag) ev_tally(i,i,nlocal,0,0.5*evdwl,0.0,0.5*fbond*vfrac[i],delx,dely,delz);
@@ -268,7 +268,7 @@ void PairPeriPMB::compute(int eflag, int vflag)
   }
 
   // store new s0
-  for (i = 0; i < nlocal; i++) s0[i] = s0_new[i]; 
+  for (i = 0; i < nlocal; i++) s0[i] = s0_new[i];
 }
 
 /* ----------------------------------------------------------------------
@@ -359,13 +359,13 @@ void PairPeriPMB::init_style()
   // error checks
 
   if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri");
-  if (atom->map_style == 0) 
+  if (atom->map_style == 0)
     error->all(FLERR,"Pair peri requires an atom map, see atom_modify");
 
   if (domain->lattice == NULL)
     error->all(FLERR,"Pair peri requires a lattice be defined");
-  if (domain->lattice->xlattice != domain->lattice->ylattice || 
-      domain->lattice->xlattice != domain->lattice->zlattice || 
+  if (domain->lattice->xlattice != domain->lattice->ylattice ||
+      domain->lattice->xlattice != domain->lattice->zlattice ||
       domain->lattice->ylattice != domain->lattice->zlattice)
     error->all(FLERR,"Pair peri lattice is not identical in x, y, and z");
 
@@ -401,10 +401,10 @@ void PairPeriPMB::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&kspring[i][j],sizeof(double),1,fp);
-	fwrite(&s00[i][j],sizeof(double),1,fp);
-	fwrite(&alpha[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&kspring[i][j],sizeof(double),1,fp);
+        fwrite(&s00[i][j],sizeof(double),1,fp);
+        fwrite(&alpha[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -424,16 +424,16 @@ void PairPeriPMB::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&kspring[i][j],sizeof(double),1,fp);
-	  fread(&s00[i][j],sizeof(double),1,fp);
-	  fread(&alpha[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&kspring[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&s00[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&kspring[i][j],sizeof(double),1,fp);
+          fread(&s00[i][j],sizeof(double),1,fp);
+          fread(&alpha[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&kspring[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&s00[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -441,8 +441,8 @@ void PairPeriPMB::read_restart(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairPeriPMB::single(int i, int j, int itype, int jtype, double rsq,
-			   double factor_coul, double factor_lj,
-			   double &fforce)
+                           double factor_coul, double factor_lj,
+                           double &fforce)
 {
   double delx0,dely0,delz0,rsq0;
   double d_ij,r,dr,rk,vfrac_scale;
@@ -471,12 +471,12 @@ double PairPeriPMB::single(int i, int j, int itype, int jtype, double rsq,
 
   if (r < d_ij) {
     dr = r - d_ij;
-    rk = (15.0 * kspring[itype][jtype] * vfrac[j]) * 
+    rk = (15.0 * kspring[itype][jtype] * vfrac[j]) *
       (dr / sqrt(cutsq[itype][jtype]));
     if (r > 0.0) fforce += -(rk/r);
     energy += 0.5*rk*dr;
   }
-  
+
   int jnum = npartner[i];
   for (int jj = 0; jj < jnum; jj++) {
     if (partner[i][jj] == 0) continue;
@@ -485,11 +485,11 @@ double PairPeriPMB::single(int i, int j, int itype, int jtype, double rsq,
       dr = r - r0[i][jj];
       if (fabs(dr) < 2.2204e-016) dr = 0.0;
       if ( (fabs(r0[i][jj] - sqrt(cutsq[itype][jtype]))) <= half_lc)
-	vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) + 
-	  (1.0 + ((sqrt(cutsq[itype][jtype]) - half_lc)/(2*half_lc)));
+        vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) +
+          (1.0 + ((sqrt(cutsq[itype][jtype]) - half_lc)/(2*half_lc)));
       else vfrac_scale = 1.0;
-      rk = (kspring[itype][jtype] * vfrac[j] * vfrac_scale) * 
-	(dr / r0[i][jj]);
+      rk = (kspring[itype][jtype] * vfrac[j] * vfrac_scale) *
+        (dr / r0[i][jj]);
       if (r > 0.0) fforce += -(rk/r);
       energy += 0.5*rk*dr;
     }
@@ -499,7 +499,7 @@ double PairPeriPMB::single(int i, int j, int itype, int jtype, double rsq,
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairPeriPMB::memory_usage()
diff --git a/src/PERI/pair_peri_pmb.h b/src/PERI/pair_peri_pmb.h
index 3a53351070..81e78bb368 100644
--- a/src/PERI/pair_peri_pmb.h
+++ b/src/PERI/pair_peri_pmb.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,7 +45,7 @@ class PairPeriPMB : public Pair {
   double **kspring;
   double **s00, **alpha;
   double **cut;
- 
+
   double *s0_new;
   int nmax;
 
diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp
index c718f72c05..73330823df 100644
--- a/src/POEMS/fix_poems.cpp
+++ b/src/POEMS/fix_poems.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -100,23 +100,23 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) :
     int *igroups = new int[nbody];
     for (ibody = 0; ibody < nbody; ibody++) {
       igroups[ibody] = group->find(arg[ibody+4]);
-      if (igroups[ibody] == -1) 
-	error->all(FLERR,"Could not find fix poems group ID");
+      if (igroups[ibody] == -1)
+        error->all(FLERR,"Could not find fix poems group ID");
     }
 
     int *mask = atom->mask;
 
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit)
-	for (ibody = 0; ibody < nbody; ibody++)
-	  if (mask[i] & group->bitmask[igroups[ibody]]) {
-	    if (natom2body[i] < MAXBODY) atom2body[i][natom2body[i]] = ibody;
-	    natom2body[i]++;
-	  }
+        for (ibody = 0; ibody < nbody; ibody++)
+          if (mask[i] & group->bitmask[igroups[ibody]]) {
+            if (natom2body[i] < MAXBODY) atom2body[i][natom2body[i]] = ibody;
+            natom2body[i]++;
+          }
     }
 
     delete [] igroups;
-    
+
   // file = read bodies from file
   // file read doesn't pay attention to fix group,
   //   so after read, reset natom2body = 0 if atom is not in fix group
@@ -169,11 +169,11 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) :
     for (i = 0; i < nlocal; i++) {
       natom2body[i] = 0;
       if (mask[i] & groupbit) {
-	natom2body[i] = 1;
-	atom2body[i][0] = nall[molecule[i]];
+        natom2body[i] = 1;
+        atom2body[i][0] = nall[molecule[i]];
       }
     }
-  
+
     delete [] ncount;
     delete [] nall;
 
@@ -208,11 +208,11 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) :
 
   memory->create(sum,nbody,6,"poems:sum");
   memory->create(all,nbody,6,"poems:all");
-  
+
   // nrigid[n] = # of atoms in Nth rigid body
   // double count joint atoms as being in multiple bodies
   // error if one or zero atoms
-  
+
   int *ncount = new int[nbody];
   for (ibody = 0; ibody < nbody; ibody++) ncount[ibody] = 0;
 
@@ -224,12 +224,12 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) :
   delete [] ncount;
 
   for (ibody = 0; ibody < nbody; ibody++)
-    if (nrigid[ibody] <= 1) error->all(FLERR,"One or zero atoms in rigid body"); 
+    if (nrigid[ibody] <= 1) error->all(FLERR,"One or zero atoms in rigid body");
 
   // build list of joint connections and check for cycles and trees
 
   jointbuild();
-  
+
   // delete temporary atom map
 
   if (mapflag) {
@@ -237,23 +237,23 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) :
     atom->map_style = 0;
   }
 
-  // create POEMS instance 
-  
+  // create POEMS instance
+
   poems = new Workspace;
-  
+
   // print statistics
 
   int nsum = 0;
   for (ibody = 0; ibody < nbody; ibody++) nsum += nrigid[ibody];
   nsum -= njoint;
-  
+
   if (me == 0) {
     if (screen)
       fprintf(screen,"%d clusters, %d bodies, %d joints, %d atoms\n",
-	      ncluster,nbody,njoint,nsum);
+              ncluster,nbody,njoint,nsum);
     if (logfile)
       fprintf(logfile,"%d clusters, %d bodies, %d joints, %d atoms\n",
-	      ncluster,nbody,njoint,nsum);
+              ncluster,nbody,njoint,nsum);
   }
 }
 
@@ -314,7 +314,7 @@ int FixPOEMS::setmask()
   mask |= POST_FORCE;
   mask |= INITIAL_INTEGRATE_RESPA;
   mask |= FINAL_INTEGRATE_RESPA;
-  mask |= POST_FORCE_RESPA;  
+  mask |= POST_FORCE_RESPA;
   return mask;
 }
 
@@ -340,13 +340,13 @@ void FixPOEMS::init()
   if (i < modify->nfix) {
     for (int j = i; j < modify->nfix; j++)
       if (strcmp(modify->fix[j]->style,"poems") == 0)
-	error->all(FLERR,"POEMS fix must come before NPT/NPH fix");
+        error->all(FLERR,"POEMS fix must come before NPT/NPH fix");
   }
 
   // timestep info
 
-  dtv = update->dt;  
-  dtf = 0.5 * update->dt * force->ftm2v;  
+  dtv = update->dt;
+  dtf = 0.5 * update->dt * force->ftm2v;
   dthalf = 0.5 * update->dt;
 
   // rRESPA info
@@ -382,13 +382,13 @@ void FixPOEMS::init()
       xbox = (image[i] & 1023) - 512;
       ybox = (image[i] >> 10 & 1023) - 512;
       zbox = (image[i] >> 20) - 512;
-      massone = mass[type[i]];		
+      massone = mass[type[i]];
       sum[ibody][0] += (x[i][0] + xbox*xprd) * massone;
       sum[ibody][1] += (x[i][1] + ybox*yprd) * massone;
       sum[ibody][2] += (x[i][2] + zbox*zprd) * massone;
       sum[ibody][3] += massone;
       sum[ibody][4] += massone *
-	(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
+        (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
     }
   }
 
@@ -423,7 +423,7 @@ void FixPOEMS::init()
       dy = x[i][1] + ybox*yprd - xcm[ibody][1];
       dz = x[i][2] + zbox*zprd - xcm[ibody][2];
       massone = mass[type[i]];
-      
+
       sum[ibody][0] += massone * (dy*dy + dz*dz);
       sum[ibody][1] += massone * (dx*dx + dz*dz);
       sum[ibody][2] += massone * (dx*dx + dy*dy);
@@ -452,46 +452,46 @@ void FixPOEMS::init()
     tensor[0][1] = tensor[1][0] = all[ibody][3];
     tensor[1][2] = tensor[2][1] = all[ibody][4];
     tensor[0][2] = tensor[2][0] = all[ibody][5];
-  
+
     ierror = jacobi(tensor,inertia[ibody],evectors);
     if (ierror) error->all(FLERR,"Insufficient Jacobi rotations for POEMS body");
 
     ex_space[ibody][0] = evectors[0][0];
     ex_space[ibody][1] = evectors[1][0];
     ex_space[ibody][2] = evectors[2][0];
-    
+
     ey_space[ibody][0] = evectors[0][1];
     ey_space[ibody][1] = evectors[1][1];
     ey_space[ibody][2] = evectors[2][1];
-    
+
     ez_space[ibody][0] = evectors[0][2];
     ez_space[ibody][1] = evectors[1][2];
     ez_space[ibody][2] = evectors[2][2];
-    
+
     // if any principal moment < scaled EPSILON, error
     // this is b/c POEMS cannot yet handle degenerate bodies
-  
+
     double max;
     max = MAX(inertia[ibody][0],inertia[ibody][1]);
     max = MAX(max,inertia[ibody][2]);
-  
+
     if (inertia[ibody][0] < EPSILON*max ||
-	inertia[ibody][1] < EPSILON*max ||
-	inertia[ibody][2] < EPSILON*max)
+        inertia[ibody][1] < EPSILON*max ||
+        inertia[ibody][2] < EPSILON*max)
       error->all(FLERR,"Rigid body has degenerate moment of inertia");
 
     // enforce 3 evectors as a right-handed coordinate system
     // flip 3rd evector if needed
-  
+
     ez0 = ex_space[ibody][1]*ey_space[ibody][2] -
       ex_space[ibody][2]*ey_space[ibody][1];
     ez1 = ex_space[ibody][2]*ey_space[ibody][0] -
       ex_space[ibody][0]*ey_space[ibody][2];
     ez2 = ex_space[ibody][0]*ey_space[ibody][1] -
       ex_space[ibody][1]*ey_space[ibody][0];
-  
-    if (ez0*ez_space[ibody][0] + ez1*ez_space[ibody][1] + 
-	ez2*ez_space[ibody][2] < 0.0) {
+
+    if (ez0*ez_space[ibody][0] + ez1*ez_space[ibody][1] +
+        ez2*ez_space[ibody][2] < 0.0) {
       ez_space[ibody][0] = -ez_space[ibody][0];
       ez_space[ibody][1] = -ez_space[ibody][1];
       ez_space[ibody][2] = -ez_space[ibody][2];
@@ -499,7 +499,7 @@ void FixPOEMS::init()
   }
 
   // free temporary memory
-  
+
   memory->destroy(tensor);
   memory->destroy(evectors);
 
@@ -517,15 +517,15 @@ void FixPOEMS::init()
       dx = x[i][0] + xbox*xprd - xcm[ibody][0];
       dy = x[i][1] + ybox*yprd - xcm[ibody][1];
       dz = x[i][2] + zbox*zprd - xcm[ibody][2];
-      
+
       displace[i][0] = dx*ex_space[ibody][0] + dy*ex_space[ibody][1] +
-	dz*ex_space[ibody][2];
+        dz*ex_space[ibody][2];
       displace[i][1] = dx*ey_space[ibody][0] + dy*ey_space[ibody][1] +
-	dz*ey_space[ibody][2];
+        dz*ey_space[ibody][2];
       displace[i][2] = dx*ez_space[ibody][0] + dy*ez_space[ibody][1] +
-	dz*ez_space[ibody][2];
+        dz*ez_space[ibody][2];
     } else displace[i][0] = displace[i][1] = displace[i][2] = 0.0;
-  }  
+  }
 
   // test for valid principal moments & axes
   // recompute moments of inertia around new axes
@@ -552,12 +552,12 @@ void FixPOEMS::init()
       dz = x[i][2] + zbox*zprd - xcm[ibody][2];
       massone = mass[type[i]];
 
-      ddx = dx*ex_space[ibody][0] + dy*ex_space[ibody][1] + 
-	dz*ex_space[ibody][2];
+      ddx = dx*ex_space[ibody][0] + dy*ex_space[ibody][1] +
+        dz*ex_space[ibody][2];
       ddy = dx*ey_space[ibody][0] + dy*ey_space[ibody][1] +
-	dz*ey_space[ibody][2];
+        dz*ey_space[ibody][2];
       ddz = dx*ez_space[ibody][0] + dy*ez_space[ibody][1] +
-	dz*ez_space[ibody][2];
+        dz*ez_space[ibody][2];
 
       sum[ibody][0] += massone * (ddy*ddy + ddz*ddz);
       sum[ibody][1] += massone * (ddx*ddx + ddz*ddz);
@@ -567,17 +567,17 @@ void FixPOEMS::init()
       sum[ibody][5] -= massone * ddx*ddz;
     }
   }
-  
+
   MPI_Allreduce(sum[0],all[0],6*nbody,MPI_DOUBLE,MPI_SUM,world);
-  
+
   for (ibody = 0; ibody < nbody; ibody++) {
-    if (fabs(all[ibody][0]-inertia[ibody][0]) > TOLERANCE || 
-	fabs(all[ibody][1]-inertia[ibody][1]) > TOLERANCE ||
-	fabs(all[ibody][2]-inertia[ibody][2]) > TOLERANCE)
+    if (fabs(all[ibody][0]-inertia[ibody][0]) > TOLERANCE ||
+        fabs(all[ibody][1]-inertia[ibody][1]) > TOLERANCE ||
+        fabs(all[ibody][2]-inertia[ibody][2]) > TOLERANCE)
       error->all(FLERR,"Bad principal moments");
-    if (fabs(all[ibody][3]) > TOLERANCE || 
-	fabs(all[ibody][4]) > TOLERANCE ||
-	fabs(all[ibody][5]) > TOLERANCE)
+    if (fabs(all[ibody][3]) > TOLERANCE ||
+        fabs(all[ibody][4]) > TOLERANCE ||
+        fabs(all[ibody][5]) > TOLERANCE)
       error->all(FLERR,"Bad principal moments");
   }
 }
@@ -629,7 +629,7 @@ void FixPOEMS::setup(int vflag)
       sum[ibody][2] += v[i][2] * massone;
       sum[ibody][3] += dy * massone*v[i][2] - dz * massone*v[i][1];
       sum[ibody][4] += dz * massone*v[i][0] - dx * massone*v[i][2];
-      sum[ibody][5] += dx * massone*v[i][1] - dy * massone*v[i][0]; 
+      sum[ibody][5] += dx * massone*v[i][1] - dy * massone*v[i][0];
     }
   }
 
@@ -641,7 +641,7 @@ void FixPOEMS::setup(int vflag)
     vcm[ibody][2] = all[ibody][2]/masstotal[ibody];
     angmom[ibody][0] = all[ibody][3];
     angmom[ibody][1] = all[ibody][4];
-    angmom[ibody][2] = all[ibody][5];  
+    angmom[ibody][2] = all[ibody][5];
   }
 
   // virial setup before call to set_v
@@ -653,7 +653,7 @@ void FixPOEMS::setup(int vflag)
 
   for (ibody = 0; ibody < nbody; ibody++)
     omega_from_mq(angmom[ibody],ex_space[ibody],ey_space[ibody],
-		  ez_space[ibody],inertia[ibody],omega[ibody]);
+                  ez_space[ibody],inertia[ibody],omega[ibody]);
   set_v();
 
   // guestimate virial as 2x the set_v contribution
@@ -663,7 +663,7 @@ void FixPOEMS::setup(int vflag)
   if (vflag_atom) {
     for (i = 0; i < nlocal; i++)
       for (n = 0; n < 6; n++)
-	vatom[i][n] *= 2.0;
+        vatom[i][n] *= 2.0;
   }
 
   // use post_force() to compute initial fcm & torque
@@ -673,9 +673,9 @@ void FixPOEMS::setup(int vflag)
   // setup for POEMS
 
   poems->MakeSystem(nbody,masstotal,inertia,xcm,vcm,omega,
-		    ex_space,ey_space,ez_space,
-		    njoint,jointbody,xjoint,nfree,freelist,
-		    dthalf,dtv,force->ftm2v,total_ke);
+                    ex_space,ey_space,ez_space,
+                    njoint,jointbody,xjoint,nfree,freelist,
+                    dthalf,dtv,force->ftm2v,total_ke);
 }
 
 /* ----------------------------------------------------------------------
@@ -695,7 +695,7 @@ void FixPOEMS::initial_integrate(int vflag)
   else evflag = 0;
 
   // set coords and velocities of atoms in rigid bodies
-  
+
   set_xv();
 }
 
@@ -714,14 +714,14 @@ void FixPOEMS::post_force(int vflag)
   double **x = atom->x;
   double **f = atom->f;
   int nlocal = atom->nlocal;
-  
+
   double xprd = domain->xprd;
   double yprd = domain->yprd;
   double zprd = domain->zprd;
-  
+
   for (ibody = 0; ibody < nbody; ibody++)
     for (i = 0; i < 6; i++) sum[ibody][i] = 0.0;
-  
+
   for (i = 0; i < nlocal; i++) {
     if (natom2body[i]) {
       ibody = atom2body[i][0];
@@ -729,20 +729,20 @@ void FixPOEMS::post_force(int vflag)
       sum[ibody][0] += f[i][0];
       sum[ibody][1] += f[i][1];
       sum[ibody][2] += f[i][2];
-      
+
       xbox = (image[i] & 1023) - 512;
       ybox = (image[i] >> 10 & 1023) - 512;
       zbox = (image[i] >> 20) - 512;
       dx = x[i][0] + xbox*xprd - xcm[ibody][0];
       dy = x[i][1] + ybox*yprd - xcm[ibody][1];
       dz = x[i][2] + zbox*zprd - xcm[ibody][2];
-    
+
       sum[ibody][3] += dy*f[i][2] - dz*f[i][1];
       sum[ibody][4] += dz*f[i][0] - dx*f[i][2];
       sum[ibody][5] += dx*f[i][1] - dy*f[i][0];
     }
   }
-  
+
   MPI_Allreduce(sum[0],all[0],6*nbody,MPI_DOUBLE,MPI_SUM,world);
 
   for (ibody = 0; ibody < nbody; ibody++) {
@@ -763,7 +763,7 @@ void FixPOEMS::post_force(int vflag)
 void FixPOEMS::final_integrate()
 {
   // perform POEMS integration
-  
+
   poems->LobattoTwo(vcm,omega,torque,fcm);
 
   // set velocities of atoms in rigid bodies
@@ -805,18 +805,18 @@ void FixPOEMS::final_integrate_respa(int ilevel, int iloop)
      and after fix_deform::pre_exchange() may have flipped box
    if don't do this, then atoms of a body which drifts far away
      from a triclinic box will be remapped back into box
-     with huge displacements when the box tilt changes via set_x() 
+     with huge displacements when the box tilt changes via set_x()
    NOTE: cannot do this by changing xcm of each body in cluster
          or even 1st body in cluster
-	 b/c POEMS library does not see xcm but only sets xcm
-	 so remap needs to be coordinated with POEMS library
-	 thus this routine does nothing for now
+         b/c POEMS library does not see xcm but only sets xcm
+         so remap needs to be coordinated with POEMS library
+         thus this routine does nothing for now
 ------------------------------------------------------------------------- */
 
 void FixPOEMS::pre_neighbor() {}
 
 /* ----------------------------------------------------------------------
-   count # of degrees-of-freedom removed by fix_poems for atoms in igroup 
+   count # of degrees-of-freedom removed by fix_poems for atoms in igroup
 ------------------------------------------------------------------------- */
 
 int FixPOEMS::dof(int igroup)
@@ -868,9 +868,9 @@ int FixPOEMS::dof(int igroup)
    flag = 0/1 means map from box to lamda coords or vice versa
    NOTE: cannot do this by changing xcm of each body in cluster
          or even 1st body in cluster
-	 b/c POEMS library does not see xcm but only sets xcm
-	 so deform needs to be coordinated with POEMS library
-	 thus this routine does nothing for now
+         b/c POEMS library does not see xcm but only sets xcm
+         so deform needs to be coordinated with POEMS library
+         thus this routine does nothing for now
 ------------------------------------------------------------------------- */
 
 void FixPOEMS::deform(int flag) {}
@@ -1006,10 +1006,10 @@ void FixPOEMS::jointbuild()
   if (njoint) {
     if (mjoint)
       MPI_Allgatherv(mylist[0],3*mjoint,MPI_INT,jlist[0],
-		     recvcounts,displs,MPI_INT,world);
+                     recvcounts,displs,MPI_INT,world);
     else
       MPI_Allgatherv(NULL,3*mjoint,MPI_INT,jlist[0],
-		     recvcounts,displs,MPI_INT,world);
+                     recvcounts,displs,MPI_INT,world);
   }
 
   delete [] recvcounts;
@@ -1065,8 +1065,8 @@ void FixPOEMS::jointbuild()
       myjoint[i][2] = x[j][2];
     } else myjoint[i][0] = myjoint[i][1] = myjoint[i][2] = 0.0;
   }
-  
-  if (njoint)  
+
+  if (njoint)
     MPI_Allreduce(myjoint[0],xjoint[0],3*njoint,MPI_DOUBLE,MPI_SUM,world);
 
   // compute freelist of nfree single unconnected bodies
@@ -1116,17 +1116,17 @@ void FixPOEMS::sortlist(int n, int **list)
       v2 = list[i-1][2];
       j = i;
       flag = 0;
-      if (list[j-inc-1][0] > v0 || 
-	  (list[j-inc-1][0] == v0 && list[j-inc-1][1] > v1)) flag = 1;
+      if (list[j-inc-1][0] > v0 ||
+          (list[j-inc-1][0] == v0 && list[j-inc-1][1] > v1)) flag = 1;
       while (flag) {
-	list[j-1][0] = list[j-inc-1][0];
-	list[j-1][1] = list[j-inc-1][1];
-	list[j-1][2] = list[j-inc-1][2];
-	j -= inc;
-	if (j <= inc) break;
-	flag = 0;
-	if (list[j-inc-1][0] > v0 || 
-	    (list[j-inc-1][0] == v0 && list[j-inc-1][1] > v1)) flag = 1;
+        list[j-1][0] = list[j-inc-1][0];
+        list[j-1][1] = list[j-inc-1][1];
+        list[j-1][2] = list[j-inc-1][2];
+        j -= inc;
+        if (j <= inc) break;
+        flag = 0;
+        if (list[j-inc-1][0] > v0 ||
+            (list[j-inc-1][0] == v0 && list[j-inc-1][1] > v1)) flag = 1;
       }
       list[j-1][0] = v0;
       list[j-1][1] = v1;
@@ -1156,7 +1156,7 @@ int FixPOEMS::loopcheck(int nvert, int nedge, int **elist)
 
   int emax = 0;
   for (i = 0; i < nvert; i++) emax = MAX(emax,ecount[i]);
-  
+
   int **elistfull;
   memory->create(elistfull,nvert,emax,"poems:elistfull");
   for (i = 0; i < nvert; i++) ecount[i] = 0;
@@ -1197,12 +1197,12 @@ int FixPOEMS::loopcheck(int nvert, int nedge, int **elist)
     while (nstack) {
       i = stack[--nstack];
       for (k = 0; k < ecount[i]; k++) {
-	j = elistfull[i][k];
-	if (j == parent[i]) continue;
-	if (mark[j]) return 1;
-	stack[nstack++] = j;
-	mark[j] = 1;
-	parent[j] = i;
+        j = elistfull[i][k];
+        if (j == parent[i]) continue;
+        if (mark[j]) return 1;
+        stack[nstack++] = j;
+        mark[j] = 1;
+        parent[j] = i;
       }
     }
     ncluster++;
@@ -1229,7 +1229,7 @@ int FixPOEMS::jacobi(double **matrix, double *evalues, double **evectors)
 {
   int i,j,k;
   double tresh,theta,tau,t,sm,s,h,g,c,b[3],z[3];
-  
+
   for (i = 0; i < 3; i++) {
     for (j = 0; j < 3; j++) evectors[i][j] = 0.0;
     evectors[i][i] = 1.0;
@@ -1238,48 +1238,48 @@ int FixPOEMS::jacobi(double **matrix, double *evalues, double **evectors)
     b[i] = evalues[i] = matrix[i][i];
     z[i] = 0.0;
   }
-  
+
   for (int iter = 1; iter <= MAXJACOBI; iter++) {
     sm = 0.0;
     for (i = 0; i < 2; i++)
       for (j = i+1; j < 3; j++)
-	sm += fabs(matrix[i][j]);
+        sm += fabs(matrix[i][j]);
     if (sm == 0.0) return 0;
-    
+
     if (iter < 4) tresh = 0.2*sm/(3*3);
     else tresh = 0.0;
-    
+
     for (i = 0; i < 2; i++) {
       for (j = i+1; j < 3; j++) {
-	g = 100.0*fabs(matrix[i][j]);
-	if (iter > 4 && fabs(evalues[i])+g == fabs(evalues[i])
-	    && fabs(evalues[j])+g == fabs(evalues[j]))
-	  matrix[i][j] = 0.0;
-	else if (fabs(matrix[i][j]) > tresh) {
-	  h = evalues[j]-evalues[i];
-	  if (fabs(h)+g == fabs(h)) t = (matrix[i][j])/h;
-	  else {
-	    theta = 0.5*h/(matrix[i][j]);
-	    t = 1.0/(fabs(theta)+sqrt(1.0+theta*theta));
-	    if (theta < 0.0) t = -t;
-	  }
-	  c = 1.0/sqrt(1.0+t*t);
-	  s = t*c;
-	  tau = s/(1.0+c);
-	  h = t*matrix[i][j];
-	  z[i] -= h;
-	  z[j] += h;
-	  evalues[i] -= h;
-	  evalues[j] += h;
-	  matrix[i][j] = 0.0;
-	  for (k = 0; k < i; k++) rotate(matrix,k,i,k,j,s,tau);
-	  for (k = i+1; k < j; k++) rotate(matrix,i,k,k,j,s,tau);
-	  for (k = j+1; k < 3; k++) rotate(matrix,i,k,j,k,s,tau);
-	  for (k = 0; k < 3; k++) rotate(evectors,k,i,k,j,s,tau);
-	}
+        g = 100.0*fabs(matrix[i][j]);
+        if (iter > 4 && fabs(evalues[i])+g == fabs(evalues[i])
+            && fabs(evalues[j])+g == fabs(evalues[j]))
+          matrix[i][j] = 0.0;
+        else if (fabs(matrix[i][j]) > tresh) {
+          h = evalues[j]-evalues[i];
+          if (fabs(h)+g == fabs(h)) t = (matrix[i][j])/h;
+          else {
+            theta = 0.5*h/(matrix[i][j]);
+            t = 1.0/(fabs(theta)+sqrt(1.0+theta*theta));
+            if (theta < 0.0) t = -t;
+          }
+          c = 1.0/sqrt(1.0+t*t);
+          s = t*c;
+          tau = s/(1.0+c);
+          h = t*matrix[i][j];
+          z[i] -= h;
+          z[j] += h;
+          evalues[i] -= h;
+          evalues[j] += h;
+          matrix[i][j] = 0.0;
+          for (k = 0; k < i; k++) rotate(matrix,k,i,k,j,s,tau);
+          for (k = i+1; k < j; k++) rotate(matrix,i,k,k,j,s,tau);
+          for (k = j+1; k < 3; k++) rotate(matrix,i,k,j,k,s,tau);
+          for (k = 0; k < 3; k++) rotate(evectors,k,i,k,j,s,tau);
+        }
       }
     }
-    
+
     for (i = 0; i < 3; i++) {
       evalues[i] = b[i] += z[i];
       z[i] = 0.0;
@@ -1293,7 +1293,7 @@ int FixPOEMS::jacobi(double **matrix, double *evalues, double **evectors)
 ------------------------------------------------------------------------- */
 
 void FixPOEMS::rotate(double **matrix, int i, int j, int k, int l,
-		      double s, double tau)
+                      double s, double tau)
 {
   double g = matrix[i][j];
   double h = matrix[k][l];
@@ -1312,7 +1312,7 @@ void FixPOEMS::rotate(double **matrix, int i, int j, int k, int l,
 ------------------------------------------------------------------------- */
 
 void FixPOEMS::omega_from_mq(double *m, double *ex, double *ey, double *ez,
-			     double *inertia, double *w)
+                             double *inertia, double *w)
 {
   double wbody[3];
 
@@ -1345,14 +1345,14 @@ void FixPOEMS::set_xv()
   double **x = atom->x;
   double **v = atom->v;
   double **f = atom->f;
-  double *mass = atom->mass; 
+  double *mass = atom->mass;
   int *type = atom->type;
   int nlocal = atom->nlocal;
-  
+
   double xprd = domain->xprd;
   double yprd = domain->yprd;
   double zprd = domain->zprd;
-  
+
   // set x and v of each atom
   // only set joint atoms for 1st rigid body they belong to
 
@@ -1380,13 +1380,13 @@ void FixPOEMS::set_xv()
     // v = vcm + omega around center-of-mass
 
     x[i][0] = ex_space[ibody][0]*displace[i][0] +
-      ey_space[ibody][0]*displace[i][1] + 
+      ey_space[ibody][0]*displace[i][1] +
       ez_space[ibody][0]*displace[i][2];
     x[i][1] = ex_space[ibody][1]*displace[i][0] +
-      ey_space[ibody][1]*displace[i][1] + 
+      ey_space[ibody][1]*displace[i][1] +
       ez_space[ibody][1]*displace[i][2];
     x[i][2] = ex_space[ibody][2]*displace[i][0] +
-      ey_space[ibody][2]*displace[i][1] + 
+      ey_space[ibody][2]*displace[i][1] +
       ez_space[ibody][2]*displace[i][2];
 
     v[i][0] = omega[ibody][1]*x[i][2] - omega[ibody][2]*x[i][1] +
@@ -1395,7 +1395,7 @@ void FixPOEMS::set_xv()
       vcm[ibody][1];
     v[i][2] = omega[ibody][0]*x[i][1] - omega[ibody][1]*x[i][0] +
       vcm[ibody][2];
-    
+
     // add center of mass to displacement
     // map back into periodic box via xbox,ybox,zbox
 
@@ -1413,7 +1413,7 @@ void FixPOEMS::set_xv()
       massone = mass[type[i]];
       fc0 = massone*(v[i][0] - v0)/dtf - f[i][0];
       fc1 = massone*(v[i][1] - v1)/dtf - f[i][1];
-      fc2 = massone*(v[i][2] - v2)/dtf - f[i][2]; 
+      fc2 = massone*(v[i][2] - v2)/dtf - f[i][2];
 
       vr[0] = 0.5*fc0*x0;
       vr[1] = 0.5*fc1*x1;
@@ -1440,7 +1440,7 @@ void FixPOEMS::set_v()
   double x0,x1,x2,v0,v1,v2,fc0,fc1,fc2,massone;
   double vr[6];
 
-  double *mass = atom->mass; 
+  double *mass = atom->mass;
   double **f = atom->f;
   double **x = atom->x;
   double **v = atom->v;
@@ -1460,13 +1460,13 @@ void FixPOEMS::set_v()
     ibody = atom2body[i][0];
 
     dx = ex_space[ibody][0]*displace[i][0] +
-      ey_space[ibody][0]*displace[i][1] + 
+      ey_space[ibody][0]*displace[i][1] +
       ez_space[ibody][0]*displace[i][2];
     dy = ex_space[ibody][1]*displace[i][0] +
-      ey_space[ibody][1]*displace[i][1] + 
+      ey_space[ibody][1]*displace[i][1] +
       ez_space[ibody][1]*displace[i][2];
     dz = ex_space[ibody][2]*displace[i][0] +
-      ey_space[ibody][2]*displace[i][1] + 
+      ey_space[ibody][2]*displace[i][1] +
       ez_space[ibody][2]*displace[i][2];
 
     // save old velocities for virial
@@ -1491,7 +1491,7 @@ void FixPOEMS::set_v()
       massone = mass[type[i]];
       fc0 = massone*(v[i][0] - v0)/dtf - f[i][0];
       fc1 = massone*(v[i][1] - v1)/dtf - f[i][1];
-      fc2 = massone*(v[i][2] - v2)/dtf - f[i][2]; 
+      fc2 = massone*(v[i][2] - v2)/dtf - f[i][2];
 
       xbox = (image[i] & 1023) - 512;
       ybox = (image[i] >> 10 & 1023) - 512;
@@ -1514,7 +1514,7 @@ void FixPOEMS::set_v()
 }
 
 /* ----------------------------------------------------------------------
-   allocate local atom-based arrays 
+   allocate local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixPOEMS::grow_arrays(int nmax)
@@ -1525,7 +1525,7 @@ void FixPOEMS::grow_arrays(int nmax)
 }
 
 /* ----------------------------------------------------------------------
-   copy values within local atom-based arrays 
+   copy values within local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixPOEMS::copy_arrays(int i, int j)
@@ -1538,7 +1538,7 @@ void FixPOEMS::copy_arrays(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double FixPOEMS::memory_usage()
@@ -1551,14 +1551,14 @@ double FixPOEMS::memory_usage()
 }
 
 /* ----------------------------------------------------------------------
-   pack values in local atom-based arrays for exchange with another proc 
+   pack values in local atom-based arrays for exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixPOEMS::pack_exchange(int i, double *buf)
 {
   int m = 0;
   buf[m++] = static_cast<double> (natom2body[i]);
-  for (int j = 0; j < natom2body[i]; j++) 
+  for (int j = 0; j < natom2body[i]; j++)
     buf[m++] = static_cast<double> (atom2body[i][j]);
   buf[m++] = displace[i][0];
   buf[m++] = displace[i][1];
@@ -1567,7 +1567,7 @@ int FixPOEMS::pack_exchange(int i, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   unpack values in local atom-based arrays from exchange with another proc 
+   unpack values in local atom-based arrays from exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixPOEMS::unpack_exchange(int nlocal, double *buf)
@@ -1586,7 +1586,7 @@ int FixPOEMS::unpack_exchange(int nlocal, double *buf)
 
 void FixPOEMS::reset_dt()
 {
-  dtv = update->dt;  
-  dtf = 0.5 * update->dt * force->ftm2v;  
+  dtv = update->dt;
+  dtf = 0.5 * update->dt * force->ftm2v;
   dthalf = 0.5 * update->dt;
 }
diff --git a/src/POEMS/fix_poems.h b/src/POEMS/fix_poems.h
index 7bb2ab22af..f1606ab7a7 100644
--- a/src/POEMS/fix_poems.h
+++ b/src/POEMS/fix_poems.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -62,7 +62,7 @@ class FixPOEMS : public Fix  {
   int *natom2body;         // # of bodies each atom is part of
   int **atom2body;         // list of bodies each atom is part of
   double **displace;       // atom displace in body coords for 1st body it's in
-  
+
   // rigid body properties
   // only nrigid double counts joint atoms as being in multiple bodies
   // other quantities only count a joint atom as being in 1st body
@@ -104,7 +104,7 @@ class FixPOEMS : public Fix  {
   int jacobi(double **, double *, double **);
   void rotate(double **, int, int, int, int, double, double);
   void omega_from_mq(double *, double *, double *, double *,
-		     double *, double *);
+                     double *, double *);
   void set_v();
   void set_xv();
 };
diff --git a/src/REAX/fix_reax_bonds.cpp b/src/REAX/fix_reax_bonds.cpp
index fea4fa67d1..1044a4f834 100644
--- a/src/REAX/fix_reax_bonds.cpp
+++ b/src/REAX/fix_reax_bonds.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -99,7 +99,7 @@ void FixReaxBonds::end_of_step()
 
 /* ---------------------------------------------------------------------- */
 
-void FixReaxBonds::OutputReaxBonds(bigint ntimestep, FILE *fp) 
+void FixReaxBonds::OutputReaxBonds(bigint ntimestep, FILE *fp)
 {
   int nparticles,nparticles_tot,nbuf,nbuf_local,most,j;
   int ii,jn,mbond,numbonds,nsbmax,nsbmax_most;
@@ -111,36 +111,36 @@ void FixReaxBonds::OutputReaxBonds(bigint ntimestep, FILE *fp)
   MPI_Status istatus;
 
   MPI_Comm_size(world,&nprocs);
- 
+
   nparticles = atom->nlocal;
   nparticles_tot = static_cast<int> (atom->natoms);
- 
+
   jn = ReaxParams::nat;
   mbond = ReaxParams::mbond;
   FORTRAN(getnsbmax,GETNSBMAX)(&nsbmax);
   FORTRAN(getcutof3,GETCUTOF3)(&cutof3);
   MPI_Allreduce(&nparticles,&most,1,MPI_INT,MPI_MAX,world);
   MPI_Allreduce(&nsbmax,&nsbmax_most,1,MPI_INT,MPI_MAX,world);
- 
+
   if (me == 0) {
     fprintf(fp,"# Timestep " BIGINT_FORMAT " \n",ntimestep);
     fprintf(fp,"# \n");
     fprintf(fp,"# Number of particles %d \n",nparticles_tot);
     fprintf(fp,"# \n");
     fprintf(fp,"# Max number of bonds per atom %d with "
-	    "coarse bond order cutoff %5.3f \n",
-	    nsbmax_most,cutof3);
+            "coarse bond order cutoff %5.3f \n",
+            nsbmax_most,cutof3);
     fprintf(fp,"# Particle connection table and bond orders \n");
     fprintf(fp,"# id type nb id_1...id_nb mol bo_1...bo_nb abo nlp q \n");
   }
- 
+
   // allocate a temporary buffer for the snapshot info
   // big enough for largest number of atoms on any one proc
   // nbuf_local = size of local buffer for table of atom bonds
- 
+
   nbuf = 1+(2*nsbmax_most+7)*most;
   memory->create(buf,nbuf,"reax/bonds:buf");
- 
+
   j = 0;
   buf[j++] = nparticles;
   for (int iparticle=0;iparticle<nparticles;iparticle++) {
@@ -155,9 +155,9 @@ void FixReaxBonds::OutputReaxBonds(bigint ntimestep, FILE *fp)
     for (k=0;k<numbonds;k++) {
       ii = FORTRAN(cbknubon2,CBKNUBON2).nubon1[iparticle+jn*k];
       if (FORTRAN(cbkbo,CBKBO).bo[ii-1] > cutof3) {
-	kk++;
-	jj = FORTRAN(cbkia,CBKIA).iag[iparticle+jn*(k+2)];
-	buf[j++] = FORTRAN(cbkc,CBKC).itag[jj-1];
+        kk++;
+        jj = FORTRAN(cbkia,CBKIA).iag[iparticle+jn*(k+2)];
+        buf[j++] = FORTRAN(cbkc,CBKC).itag[jj-1];
       }
     }
     buf[jbufknum] = kk; //no.bonds
@@ -169,8 +169,8 @@ void FixReaxBonds::OutputReaxBonds(bigint ntimestep, FILE *fp)
     for (k=0;k<numbonds;k++) {
       ii = FORTRAN(cbknubon2,CBKNUBON2).nubon1[iparticle+jn*k];
       if (FORTRAN(cbkbo,CBKBO).bo[ii-1] > cutof3) {
-	kk++;
-	buf[j++] = FORTRAN(cbkbo,CBKBO).bo[ii-1];
+        kk++;
+        buf[j++] = FORTRAN(cbkbo,CBKBO).bo[ii-1];
       }
     }
 
@@ -181,54 +181,54 @@ void FixReaxBonds::OutputReaxBonds(bigint ntimestep, FILE *fp)
     buf[j++] = atom->q[iparticle];
   }
   nbuf_local = j-1;
- 
+
   // node 0 pings each node, receives their buffer, writes to file
   // all other nodes wait for ping, send buffer to node 0
- 
+
   if (me == 0) {
     for (int inode = 0; inode<nprocs; inode++) {
       j = 0;
       if (inode == 0) {
-	nlocal_tmp = nparticles;
-	j++;
+        nlocal_tmp = nparticles;
+        j++;
       } else {
-	MPI_Irecv(&buf[0],nbuf,MPI_DOUBLE,inode,0,world,&irequest);
+        MPI_Irecv(&buf[0],nbuf,MPI_DOUBLE,inode,0,world,&irequest);
         MPI_Send(&itmp,0,MPI_INT,inode,0,world);
         MPI_Wait(&irequest,&istatus);
-	nlocal_tmp = nint(buf[j++]);
+        nlocal_tmp = nint(buf[j++]);
       }
- 
+
       for (int iparticle=0;iparticle<nlocal_tmp;iparticle++) {
 
-	// print atom tag, atom type, no.bonds
+        // print atom tag, atom type, no.bonds
 
-	numbonds = nint(buf[j+2]);
-	fprintf(fp," %d %d %d",nint(buf[j]),nint(buf[j+1]),numbonds);
-	j += 3;
-	if (numbonds > nsbmax_most) {
-	  char str[128];
-	  sprintf(str,"Fix reax/bonds numbonds > nsbmax_most");
-	  error->one(FLERR,str);
-	}
+        numbonds = nint(buf[j+2]);
+        fprintf(fp," %d %d %d",nint(buf[j]),nint(buf[j+1]),numbonds);
+        j += 3;
+        if (numbonds > nsbmax_most) {
+          char str[128];
+          sprintf(str,"Fix reax/bonds numbonds > nsbmax_most");
+          error->one(FLERR,str);
+        }
 
-	// print connection table
+        // print connection table
 
-	for (k=0;k<numbonds;k++)
-	  fprintf(fp," %d",nint(buf[j++]));
+        for (k=0;k<numbonds;k++)
+          fprintf(fp," %d",nint(buf[j++]));
 
-	// print molecule id
+        // print molecule id
 
-	fprintf(fp," %d",nint(buf[j++]));
+        fprintf(fp," %d",nint(buf[j++]));
 
-	// print bond orders
+        // print bond orders
 
-	for (k=0;k<numbonds;k++)
-	  fprintf(fp,"%14.3f",buf[j++]);
+        for (k=0;k<numbonds;k++)
+          fprintf(fp,"%14.3f",buf[j++]);
 
-	// print sum of bond orders, no. of lone pairs, charge
+        // print sum of bond orders, no. of lone pairs, charge
 
-	fprintf(fp,"%14.3f%14.3f%14.3f\n",buf[j],buf[j+1],buf[j+2]);
-	j+=3;
+        fprintf(fp,"%14.3f%14.3f%14.3f\n",buf[j],buf[j+1],buf[j+2]);
+        j+=3;
       }
     }
 
diff --git a/src/REAX/fix_reax_bonds.h b/src/REAX/fix_reax_bonds.h
index dadf0a7db0..3206f8b9f3 100644
--- a/src/REAX/fix_reax_bonds.h
+++ b/src/REAX/fix_reax_bonds.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/REAX/pair_reax.cpp b/src/REAX/pair_reax.cpp
index 30f787d8d0..9d2a4e4416 100644
--- a/src/REAX/pair_reax.cpp
+++ b/src/REAX/pair_reax.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -49,7 +49,7 @@ PairREAX::PairREAX(LAMMPS *lmp) : Pair(lmp)
   restartinfo = 0;
   one_coeff = 1;
   no_virial_fdotr_compute = 1;
-  
+
   nextra = 14;
   pvector = new double[nextra];
 
@@ -155,7 +155,7 @@ void PairREAX::compute(int eflag, int vflag)
   }
 
   // calculate the atomic charge distribution
- 
+
   compute_charge(energy_charge_equilibration);
 
   // transfer LAMMPS positions and neighbor lists to REAX
@@ -203,14 +203,14 @@ void PairREAX::compute(int eflag, int vflag)
 
     ecoul += FORTRAN(cbkenergies, CBKENERGIES).ep;
     ecoul += energy_charge_equilibration;
-    
+
     eng_vdwl += evdwl;
     eng_coul += ecoul;
 
     // Store the different parts of the energy
     // in a list for output by compute pair command
 
-    pvector[0] = FORTRAN(cbkenergies, CBKENERGIES).eb;   
+    pvector[0] = FORTRAN(cbkenergies, CBKENERGIES).eb;
     pvector[1] = FORTRAN(cbkenergies, CBKENERGIES).ea;
     pvector[2] = FORTRAN(cbkenergies, CBKENERGIES).elp;
     pvector[3] = FORTRAN(cbkenergies, CBKENERGIES).emol;
@@ -223,8 +223,8 @@ void PairREAX::compute(int eflag, int vflag)
     pvector[10] = FORTRAN(cbkenergies, CBKENERGIES).ew;
     pvector[11] = FORTRAN(cbkenergies, CBKENERGIES).ep;
     pvector[12] = FORTRAN(cbkenergies, CBKENERGIES).efi;
-    pvector[13] = energy_charge_equilibration;    
-  
+    pvector[13] = energy_charge_equilibration;
+
   }
 
   if (eflag_atom) {
@@ -334,7 +334,7 @@ void PairREAX::write_reax_vlist()
     itag = tag[i];
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
@@ -343,50 +343,50 @@ void PairREAX::write_reax_vlist()
       yjtmp = x[j][1];
       zjtmp = x[j][2];
       jtag = tag[j];
-      
+
       delx = xitmp - xjtmp;
       dely = yitmp - yjtmp;
       delz = zitmp - zjtmp;
-      
+
       delr2 = delx*delx+dely*dely+delz*delz;
-      
+
       if (delr2 <= rcutvsq) {
-	if (i < j) {
-	  iii = i+1;
-	  jjj = j+1;
-	} else {
-	  iii = j+1;
-	  jjj = i+1;
-	}
-	if (nvpair >= nvpairmax) 
-	  error->one(FLERR,"Reax_defs.h setting for NNEIGHMAXDEF is too small");
-	
-	FORTRAN(cbkpairs, CBKPAIRS).nvl1[nvpair] = iii;
-	FORTRAN(cbkpairs, CBKPAIRS).nvl2[nvpair] = jjj;
-	FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 0;
-	
-	if (delr2 <= rcutbsq) {
-	  FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 1;
-	  nbond++;
-	}
-	
-	FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 0;
-	
-	if (j < nlocal)
-	  FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1;
-	else if (itag < jtag)
-	  FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1;
-	else if (itag == jtag) {
-	  if (delz > SMALL)
-	    FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1;
-	  else if (fabs(delz) < SMALL) {
-	    if (dely > SMALL)
-	      FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1;
-	    else if (fabs(dely) < SMALL && delx > SMALL)
-	      FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1;
-	  }
-	}
-	nvpair++;
+        if (i < j) {
+          iii = i+1;
+          jjj = j+1;
+        } else {
+          iii = j+1;
+          jjj = i+1;
+        }
+        if (nvpair >= nvpairmax)
+          error->one(FLERR,"Reax_defs.h setting for NNEIGHMAXDEF is too small");
+
+        FORTRAN(cbkpairs, CBKPAIRS).nvl1[nvpair] = iii;
+        FORTRAN(cbkpairs, CBKPAIRS).nvl2[nvpair] = jjj;
+        FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 0;
+
+        if (delr2 <= rcutbsq) {
+          FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 1;
+          nbond++;
+        }
+
+        FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 0;
+
+        if (j < nlocal)
+          FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1;
+        else if (itag < jtag)
+          FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1;
+        else if (itag == jtag) {
+          if (delz > SMALL)
+            FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1;
+          else if (fabs(delz) < SMALL) {
+            if (dely > SMALL)
+              FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1;
+            else if (fabs(dely) < SMALL && delx > SMALL)
+              FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 1;
+          }
+        }
+        nvpair++;
       }
     }
   }
@@ -404,33 +404,33 @@ void PairREAX::write_reax_vlist()
       yjtmp = x[j][1];
       zjtmp = x[j][2];
       jtag = tag[j];
-      
+
       delx = xitmp - xjtmp;
       dely = yitmp - yjtmp;
       delz = zitmp - zjtmp;
-      
+
       delr2 = delx*delx+dely*dely+delz*delz;
-      
+
       // don't need to check the double count since i < j in the ghost region
 
       if (delr2 <= rcutvsq) {
-	iii = i+1;
-	jjj = j+1;
-	      
-	if (nvpair >= nvpairmax) 
-	  error->one(FLERR,"Reax_defs.h setting for NNEIGHMAXDEF is too small");
-	
-	FORTRAN(cbkpairs, CBKPAIRS).nvl1[nvpair] = iii;
-	FORTRAN(cbkpairs, CBKPAIRS).nvl2[nvpair] = jjj;
-	FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 0;
-
-	if (delr2 <= rcutbsq) {
-	  FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 1;
-	  nbond++;
-	}
-	
-	FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 0;
-	nvpair++;
+        iii = i+1;
+        jjj = j+1;
+
+        if (nvpair >= nvpairmax)
+          error->one(FLERR,"Reax_defs.h setting for NNEIGHMAXDEF is too small");
+
+        FORTRAN(cbkpairs, CBKPAIRS).nvl1[nvpair] = iii;
+        FORTRAN(cbkpairs, CBKPAIRS).nvl2[nvpair] = jjj;
+        FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 0;
+
+        if (delr2 <= rcutbsq) {
+          FORTRAN(cbknvlbo, CBKNVLBO).nvlbo[nvpair] = 1;
+          nbond++;
+        }
+
+        FORTRAN(cbknvlown, CBKNVLOWN).nvlown[nvpair] = 0;
+        nvpair++;
       }
     }
   }
@@ -438,7 +438,7 @@ void PairREAX::write_reax_vlist()
   FORTRAN(cbkpairs, CBKPAIRS).nvpair = nvpair;
   FORTRAN(cbkpairs, CBKPAIRS).nvlself = nvlself;
 }
-					      
+
 /* ---------------------------------------------------------------------- */
 
 void PairREAX::read_reax_forces()
@@ -478,23 +478,23 @@ void PairREAX::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairREAX::settings(int narg, char **arg)
 {
   if (narg != 0 && narg !=4) error->all(FLERR,"Illegal pair_style command");
-  
+
   if (narg == 4) {
     hbcut = force->numeric(arg[0]);
     ihbnew = static_cast<int> (force->numeric(arg[1]));
     itripstaball = static_cast<int> (force->numeric(arg[2]));
     precision = force->numeric(arg[3]);
 
-    if (hbcut <= 0.0 || 
-	(ihbnew != 0 && ihbnew != 1) || 
-	(itripstaball != 0 && itripstaball != 1) || 
-	precision <= 0.0)
+    if (hbcut <= 0.0 ||
+        (ihbnew != 0 && ihbnew != 1) ||
+        (itripstaball != 0 && itripstaball != 1) ||
+        precision <= 0.0)
       error->all(FLERR,"Illegal pair_style command");
   }
 }
@@ -517,7 +517,7 @@ void PairREAX::coeff(int narg, char **arg)
 
   // insure filename is ffield.reax
 
-  if (strcmp(arg[2],"ffield.reax") != 0) 
+  if (strcmp(arg[2],"ffield.reax") != 0)
     error->all(FLERR,"Incorrect args for pair coefficients");
 
   // read args that map atom types to elements in potential file
@@ -576,7 +576,7 @@ void PairREAX::init_style()
   // initial setup for cutoff radius of VLIST and BLIST in ReaxFF
 
   double vlbora;
-  
+
   FORTRAN(getswb, GETSWB)(&swb);
   cutmax=MAX(swb, hbcut);
   rcutvsq=cutmax*cutmax;
@@ -669,7 +669,7 @@ int PairREAX::pack_reverse_comm(int n, int first, double *buf)
 
   m = 0;
   last = first + n;
-  for (i = first; i < last; i++) 
+  for (i = first; i < last; i++)
     buf[m++] = wcg[i];
 
   return 1;
@@ -704,7 +704,7 @@ void PairREAX::taper_setup()
   swa3=swa2*swa;
   swb2=swb*swb;
   swb3=swb2*swb;
- 
+
   swc7=  20.0e0/d7;
   swc6= -70.0e0*(swa+swb)/d7;
   swc5=  84.0e0*(swa2+3.0e0*swa*swb+swb2)/d7;
@@ -713,7 +713,7 @@ void PairREAX::taper_setup()
   swc2=-210.0e0*(swa3*swb2+swa2*swb3)/d7;
   swc1= 140.0e0*swa3*swb3/d7;
   swc0=(-35.0e0*swa3*swb2*swb2+21.0e0*swa2*swb3*swb2+
-	7.0e0*swa*swb3*swb3+swb3*swb3*swb)/d7;
+        7.0e0*swa*swb3*swb3+swb3*swb3*swb)/d7;
 }
 
 /* ---------------------------------------------------------------------- */
@@ -792,16 +792,16 @@ void PairREAX::compute_charge(double &energy_charge_equilibration)
     itag = tag[i];
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     arow_ptr[i] = nmatentries;
     aval[nmatentries] = 2.0*param_list[itype].params[1];
     acol_ind[nmatentries] = i;
     nmatentries++;
-    
+
     aval[nmatentries] = 1.0;
     acol_ind[nmatentries] = nlocal + nghost;
-    nmatentries++;   
-    
+    nmatentries++;
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
@@ -811,39 +811,39 @@ void PairREAX::compute_charge(double &energy_charge_equilibration)
       zjtmp = x[j][2];
       jtype = type[j];
       jtag = tag[j];
-      
+
       delx = xitmp - xjtmp;
       dely = yitmp - yjtmp;
       delz = zitmp - zjtmp;
-      
+
       delr2 = delx*delx+dely*dely+delz*delz;
-      
+
       // avoid counting local-ghost pair twice since
       // ReaxFF uses half neigh list with newton off
 
       if (j >= nlocal) {
-	if (itag > jtag) {
-	  if ((itag+jtag) % 2 == 0) continue;
-	} else if (itag < jtag) {
-	  if ((itag+jtag) % 2 == 1) continue;
-	} else {
-	  if (zjtmp < zitmp) continue;
-	  if (zjtmp == zitmp && yjtmp < yitmp) continue;
-	  if (zjtmp == zitmp && yjtmp == yitmp && xjtmp < xitmp) continue;
-	}
+        if (itag > jtag) {
+          if ((itag+jtag) % 2 == 0) continue;
+        } else if (itag < jtag) {
+          if ((itag+jtag) % 2 == 1) continue;
+        } else {
+          if (zjtmp < zitmp) continue;
+          if (zjtmp == zitmp && yjtmp < yitmp) continue;
+          if (zjtmp == zitmp && yjtmp == yitmp && xjtmp < xitmp) continue;
+        }
       }
 
       // rcutvsq = cutmax*cutmax, in ReaxFF
 
       if (delr2 <= rcutvsq) {
-	gamt = sqrt(param_list[itype].params[2]*param_list[jtype].params[2]);
-	delr_norm = sqrt(delr2);
-	sw = taper_E(delr_norm, delr2);	
-	hulp1=(delr_norm*delr2+(1.0/(gamt*gamt*gamt)));
-	hulp2=sw*14.40/cbrt(hulp1);
-	aval[nmatentries] = hulp2;
-	acol_ind[nmatentries] = j;
-	nmatentries++;
+        gamt = sqrt(param_list[itype].params[2]*param_list[jtype].params[2]);
+        delr_norm = sqrt(delr2);
+        sw = taper_E(delr_norm, delr2);
+        hulp1=(delr_norm*delr2+(1.0/(gamt*gamt*gamt)));
+        hulp2=sw*14.40/cbrt(hulp1);
+        aval[nmatentries] = hulp2;
+        acol_ind[nmatentries] = j;
+        nmatentries++;
       }
     }
   }
@@ -857,7 +857,7 @@ void PairREAX::compute_charge(double &energy_charge_equilibration)
   arow_ptr[nlocal+nghost] = nmatentries;
 
   // add rhs matentries to linear system
- 
+
   for (ii =0; ii<inum; ii++) {
     i = ilist[ii];
     itype = type[i];
@@ -907,7 +907,7 @@ void PairREAX::compute_charge(double &energy_charge_equilibration)
     //       if want other units would have to change params[] in file
 
     qi = 23.02 * (param_list[itype].params[0]*ch[i]+
-		  param_list[itype].params[1]*ch[i]*ch[i]);
+                  param_list[itype].params[1]*ch[i]*ch[i]);
     energy_charge_equilibration += qi;
     if (eflag_atom) eatom[i] += qi;
   }
@@ -921,8 +921,8 @@ void PairREAX::compute_charge(double &energy_charge_equilibration)
 /* ---------------------------------------------------------------------- */
 
 void PairREAX::charge_reax(const int & nlocal, const int & nghost,
-			   double ch[], double aval[], int acol_ind[],
-			   int arow_ptr[], double elcvec[])
+                           double ch[], double aval[], int acol_ind[],
+                           int arow_ptr[], double elcvec[])
 {
   cg_solve(nlocal,nghost,aval,acol_ind,arow_ptr,ch,elcvec);
 }
@@ -931,9 +931,9 @@ void PairREAX::charge_reax(const int & nlocal, const int & nghost,
    CG solver for linear systems
 ------------------------------------------------------------------------- */
 
-void PairREAX::cg_solve(const int & nlocal, const int & nghost, 
-			double aval[], int acol_ind[], int arow_ptr[],
-			double x[], double b[])
+void PairREAX::cg_solve(const int & nlocal, const int & nghost,
+                        double aval[], int acol_ind[], int arow_ptr[],
+                        double x[], double b[])
 {
   double one, zero, rho, rho_old, alpha, beta, gamma;
   int iter, maxiter;
@@ -945,7 +945,7 @@ void PairREAX::cg_solve(const int & nlocal, const int & nghost,
   // accumulated (full) vectors: x, w, p
   // r = b-A.x
   // w = r            (ReverseComm + Comm)
-  
+
   double *r = rcg;
   double *w = wcg;
   double *p = pcg;
@@ -959,22 +959,22 @@ void PairREAX::cg_solve(const int & nlocal, const int & nghost,
   maxiter = 100;
 
   for (int i = 0; i < n; i++) w[i] = 0;
-  
+
   // construct r = b-Ax
 
   sparse_product(n, nlocal, nghost, aval, acol_ind, arow_ptr, x, r);
-  
+
   // not using BLAS library
 
   for (int i=0; i<n; i++) {
     r[i] = b[i] - r[i];
     w[i] = r[i];
   }
-  
+
   packflag = 1;
   comm->reverse_comm_pair(this);
   comm->forward_comm_pair(this);
-  
+
   MPI_Allreduce(&w[n-1], &sumtmp, 1, MPI_DOUBLE, MPI_SUM, world);
   w[n-1] = sumtmp;
   rho_old = one;
@@ -995,7 +995,7 @@ void PairREAX::cg_solve(const int & nlocal, const int & nghost,
     }
 
     sparse_product(n, nlocal, nghost, aval, acol_ind, arow_ptr, p, q);
-    
+
     gamma = 0.0;
     for (int i=0; i<n; i++) gamma += p[i]*q[i];
     MPI_Allreduce(&gamma, &sumtmp, 1, MPI_DOUBLE, MPI_SUM, world);
@@ -1008,7 +1008,7 @@ void PairREAX::cg_solve(const int & nlocal, const int & nghost,
       r[i] -= alpha*q[i];
       w[i] = r[i];
     }
-      
+
     comm->reverse_comm_pair(this);
     comm->forward_comm_pair(this);
 
@@ -1025,9 +1025,9 @@ void PairREAX::cg_solve(const int & nlocal, const int & nghost,
 ------------------------------------------------------------------------- */
 
 void PairREAX::sparse_product(const int &n, const int &nlocal,
-			      const int &nghost,
-			      double aval[], int acol_ind[], int arow_ptr[],
-			      double *x, double *r)
+                              const int &nghost,
+                              double aval[], int acol_ind[], int arow_ptr[],
+                              double *x, double *r)
 {
   int i,j,jj;
 
@@ -1041,7 +1041,7 @@ void PairREAX::sparse_product(const int &n, const int &nlocal,
       r[jj] += aval[j]*x[i];
     }
   }
-  
+
   for (i=nlocal; i<nlocal+nghost; i++)
     for (j=arow_ptr[i]; j<arow_ptr[i+1]; j++) {
       jj = acol_ind[j];
@@ -1051,7 +1051,7 @@ void PairREAX::sparse_product(const int &n, const int &nlocal,
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairREAX::memory_usage()
diff --git a/src/REAX/pair_reax.h b/src/REAX/pair_reax.h
index f9f87dd003..4062dc7e11 100644
--- a/src/REAX/pair_reax.h
+++ b/src/REAX/pair_reax.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -40,10 +40,10 @@ class PairREAX : public Pair {
   void unpack_comm(int, int, double *);
   int pack_reverse_comm(int, int, double *);
   void unpack_reverse_comm(int, int *, double *);
-  
+
  private:
   double cutmax;
-  double rcutvsq,rcutbsq; 
+  double rcutvsq,rcutbsq;
   int iprune,ihb,ihbnew,itripstaball;
   double hbcut,swb;
   double swa;
@@ -83,11 +83,11 @@ class PairREAX : public Pair {
 
   void compute_charge(double &);
   void sparse_product(const int &, const int &, const int &, double[],
-		      int[], int[], double[], double[]);
-  void cg_solve(const int &, const int &, double[], int[], 
-		       int[], double[], double[]);
+                      int[], int[], double[], double[]);
+  void cg_solve(const int &, const int &, double[], int[],
+                       int[], double[], double[]);
   void charge_reax(const int &, const int &, double[],
-		   double[], int[], int[], double[]);
+                   double[], int[], int[], double[]);
 };
 
 }
diff --git a/src/REAX/pair_reax_fortran.h b/src/REAX/pair_reax_fortran.h
index 057ff7c1e1..50246b7ee7 100644
--- a/src/REAX/pair_reax_fortran.h
+++ b/src/REAX/pair_reax_fortran.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -19,12 +19,12 @@
 // corresponding macro at compile time using -D e.g. -D_IBM
 
 // CONS(a,b) should return ab, the concatenation of its arguments.
-// If compiler is using strict ISO C standards, the ## works. 
+// If compiler is using strict ISO C standards, the ## works.
 // Otherwise try the old /**/ trick and test.
-// If that fails, you will need to figure out 
+// If that fails, you will need to figure out
 // a definition for the FORTRAN macro that works on your machine.
 
-#if  __STDC__ 
+#if  __STDC__
 #define CONS(a,b) a##b
 #elif defined(_IBM)
 #define CONS(a,b) a##b
@@ -56,11 +56,11 @@ static int my_applesoroanges = CONS(my_apples,_my_oranges);
 
 class ReaxParams {
  public:
-  enum {nneighmax=NNEIGHMAXDEF, 
-	nat=NATDEF, 
-	nattot=NATTOTDEF, 
+  enum {nneighmax=NNEIGHMAXDEF,
+        nat=NATDEF,
+        nattot=NATTOTDEF,
         nsort=NSORTDEF,
-	mbond=MBONDDEF, 
+        mbond=MBONDDEF,
         nbomax=NBOMAXDEF,
   };
 };
@@ -96,7 +96,7 @@ extern "C" struct {
 
 extern "C" struct {
   double atomvirial[6*ReaxParams::nat];
-  double virial[6]; 
+  double virial[6];
   int Lvirial;
   int Latomvirial;
 } FORTRAN(cbkvirial,CBKVIRIAL);
@@ -160,15 +160,15 @@ extern "C" struct {
 } FORTRAN(cbkenergies,CBKENERGIES);
 
 extern "C" struct {
-  double tset; 
-  double dseed; 
-  double tempmd; 
-  double ts2; 
-  double ts22; 
-  int nmolo; 
-  int nmolo5; 
-  int nbon; 
-  int na; 
+  double tset;
+  double dseed;
+  double tempmd;
+  double ts2;
+  double ts22;
+  int nmolo;
+  int nmolo5;
+  int nbon;
+  int na;
   int namov;
   int na_local;
 } FORTRAN(rsmall,RSMALL);
@@ -208,4 +208,3 @@ extern "C" void FORTRAN(mdsav,MDSAV)(int*);
 extern "C" void FORTRAN(getnsbmax,GETNSBMAX)(int*);
 extern "C" void FORTRAN(getnsbma2,GETNSBMA2)(int*);
 extern "C" void FORTRAN(getcutof3,GETCUTOF3)(double*);
-
diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp
index fb2e13298d..8cfe64461d 100644
--- a/src/REPLICA/compute_event_displace.cpp
+++ b/src/REPLICA/compute_event_displace.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -43,7 +43,7 @@ ComputeEventDisplace::ComputeEventDisplace(LAMMPS *lmp, int narg, char **arg) :
   extscalar = 0;
 
   double displace_dist = atof(arg[3]);
-  if (displace_dist <= 0.0) 
+  if (displace_dist <= 0.0)
     error->all(FLERR,"Distance must be > 0 for compute event/displace");
   displace_distsq = displace_dist * displace_dist;
 
@@ -70,11 +70,11 @@ void ComputeEventDisplace::init()
   if (id_event != NULL) {
     int ifix = modify->find_fix(id_event);
     if (ifix < 0) error->all(FLERR,
-			     "Could not find compute event/displace fix ID");
+                             "Could not find compute event/displace fix ID");
     fix_event = (FixEvent*) modify->fix[ifix];
-    
+
     if (strcmp(fix_event->style,"EVENT/PRD") != 0 &&
-	strcmp(fix_event->style,"EVENT/TAD") != 0)
+        strcmp(fix_event->style,"EVENT/TAD") != 0)
       error->all(FLERR,"Compute event/displace has invalid fix event assigned");
   }
 
@@ -109,12 +109,12 @@ double ComputeEventDisplace::compute_scalar()
   if (triclinic == 0) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	dx = x[i][0] + xbox*xprd - xevent[i][0];
-	dy = x[i][1] + ybox*yprd - xevent[i][1];
-	dz = x[i][2] + zbox*zprd - xevent[i][2];
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        dx = x[i][0] + xbox*xprd - xevent[i][0];
+        dy = x[i][1] + ybox*yprd - xevent[i][1];
+        dz = x[i][2] + zbox*zprd - xevent[i][2];
         rsq = dx*dx + dy*dy + dz*dz;
         if (rsq >= displace_distsq) {
           event = 1.0;
@@ -124,12 +124,12 @@ double ComputeEventDisplace::compute_scalar()
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	dx = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - xevent[i][0];
-	dy = x[i][1] + h[1]*ybox + h[3]*zbox - xevent[i][1];
-	dz = x[i][2] + h[2]*zbox - xevent[i][2];
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        dx = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - xevent[i][0];
+        dy = x[i][1] + h[1]*ybox + h[3]*zbox - xevent[i][1];
+        dz = x[i][2] + h[2]*zbox - xevent[i][2];
         rsq = dx*dx + dy*dy + dz*dz;
         if (rsq >= displace_distsq) {
           event = 1.0;
diff --git a/src/REPLICA/compute_event_displace.h b/src/REPLICA/compute_event_displace.h
index 87135d2be4..3d3fb23c49 100644
--- a/src/REPLICA/compute_event_displace.h
+++ b/src/REPLICA/compute_event_displace.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/REPLICA/fix_event.cpp b/src/REPLICA/fix_event.cpp
index 700b9e3341..4f59530573 100644
--- a/src/REPLICA/fix_event.cpp
+++ b/src/REPLICA/fix_event.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -55,7 +55,7 @@ FixEvent::FixEvent(LAMMPS *lmp, int narg, char **arg) :
 FixEvent::~FixEvent()
 {
   // unregister callbacks to this fix from Atom class
- 
+
   atom->delete_callback(id,0);
 
   // delete locally stored array
@@ -84,7 +84,7 @@ void FixEvent::store_event()
   int *image = atom->image;
   int nlocal = atom->nlocal;
 
-  for (int i = 0; i < nlocal; i++) 
+  for (int i = 0; i < nlocal; i++)
     domain->unmap(x[i],image[i],xevent[i]);
 
 }
@@ -248,7 +248,7 @@ int FixEvent::unpack_exchange(int nlocal, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   pack entire state of Fix into one write 
+   pack entire state of Fix into one write
 ------------------------------------------------------------------------- */
 
 void FixEvent::write_restart(FILE *fp)
@@ -256,7 +256,7 @@ void FixEvent::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix 
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixEvent::restart(char *buf)
diff --git a/src/REPLICA/fix_event.h b/src/REPLICA/fix_event.h
index 6f8db48788..5f70ff9dca 100644
--- a/src/REPLICA/fix_event.h
+++ b/src/REPLICA/fix_event.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/REPLICA/fix_event_prd.cpp b/src/REPLICA/fix_event_prd.cpp
index cc8192a0af..338c6a2f76 100644
--- a/src/REPLICA/fix_event_prd.cpp
+++ b/src/REPLICA/fix_event_prd.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,7 +60,7 @@ void FixEventPRD::store_event_prd(bigint ntimestep, int delta_clock)
 }
 
 /* ----------------------------------------------------------------------
-   pack entire state of Fix into one write 
+   pack entire state of Fix into one write
 ------------------------------------------------------------------------- */
 
 void FixEventPRD::write_restart(FILE *fp)
@@ -82,7 +82,7 @@ void FixEventPRD::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix 
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixEventPRD::restart(char *buf)
@@ -97,5 +97,3 @@ void FixEventPRD::restart(char *buf)
   correlated_event = static_cast<int> (list[n++]);
   ncoincident = static_cast<int> (list[n++]);
 }
-
-
diff --git a/src/REPLICA/fix_event_prd.h b/src/REPLICA/fix_event_prd.h
index 11dcbb361e..8cf7ef7846 100644
--- a/src/REPLICA/fix_event_prd.h
+++ b/src/REPLICA/fix_event_prd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/REPLICA/fix_event_tad.cpp b/src/REPLICA/fix_event_tad.cpp
index 197a0904d1..aed1d75437 100644
--- a/src/REPLICA/fix_event_tad.cpp
+++ b/src/REPLICA/fix_event_tad.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -58,7 +58,7 @@ void FixEventTAD::store_event_tad(bigint ntimestep)
 }
 
 /* ----------------------------------------------------------------------
-   pack entire state of Fix into one write 
+   pack entire state of Fix into one write
 ------------------------------------------------------------------------- */
 
 void FixEventTAD::write_restart(FILE *fp)
@@ -78,7 +78,7 @@ void FixEventTAD::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix 
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixEventTAD::restart(char *buf)
@@ -91,5 +91,3 @@ void FixEventTAD::restart(char *buf)
   tlo = list[n++];
   ebarrier = list[n++];
 }
-
-
diff --git a/src/REPLICA/fix_event_tad.h b/src/REPLICA/fix_event_tad.h
index e754504771..91e2045ecc 100644
--- a/src/REPLICA/fix_event_tad.h
+++ b/src/REPLICA/fix_event_tad.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -28,7 +28,7 @@ class FixEventTAD : public FixEvent {
  public:
   int event_number;      // event counter
   bigint event_timestep; // timestep of last event
-  double tlo;            // event time at low temperature 
+  double tlo;            // event time at low temperature
   double ebarrier;       // energy barrier for this event
 
   FixEventTAD(class LAMMPS *, int, char **);
diff --git a/src/REPLICA/fix_neb.cpp b/src/REPLICA/fix_neb.cpp
index 73116fac25..6aabea3ebc 100644
--- a/src/REPLICA/fix_neb.cpp
+++ b/src/REPLICA/fix_neb.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -142,7 +142,7 @@ void FixNEB::min_post_force(int vflag)
 
   if (ireplica < nreplica-1) MPI_Send(&veng,1,MPI_DOUBLE,procnext,0,uworld);
   if (ireplica > 0) MPI_Recv(&vprev,1,MPI_DOUBLE,procprev,0,uworld,&status);
-  
+
   if (ireplica > 0) MPI_Send(&veng,1,MPI_DOUBLE,procprev,0,uworld);
   if (ireplica < nreplica-1)
     MPI_Recv(&vnext,1,MPI_DOUBLE,procnext,0,uworld,&status);
@@ -199,41 +199,41 @@ void FixNEB::min_post_force(int vflag)
   if (vnext > veng && veng > vprev) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	tangent[i][0] = xnext[i][0] - x[i][0];
-	tangent[i][1] = xnext[i][1] - x[i][1];
-	tangent[i][2] = xnext[i][2] - x[i][2];
-	domain->minimum_image(tangent[i]);
+        tangent[i][0] = xnext[i][0] - x[i][0];
+        tangent[i][1] = xnext[i][1] - x[i][1];
+        tangent[i][2] = xnext[i][2] - x[i][2];
+        domain->minimum_image(tangent[i]);
       }
   } else if (vnext < veng && veng < vprev) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	tangent[i][0] = x[i][0] - xprev[i][0];
-	tangent[i][1] = x[i][1] - xprev[i][1];
-	tangent[i][2] = x[i][2] - xprev[i][2];
-	domain->minimum_image(tangent[i]);
+        tangent[i][0] = x[i][0] - xprev[i][0];
+        tangent[i][1] = x[i][1] - xprev[i][1];
+        tangent[i][2] = x[i][2] - xprev[i][2];
+        domain->minimum_image(tangent[i]);
       }
   } else {
     vmax = MAX(fabs(vnext-veng),fabs(vprev-veng));
     vmin = MIN(fabs(vnext-veng),fabs(vprev-veng));
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	delta1[0] = xnext[i][0] - x[i][0];
-	delta1[1] = xnext[i][1] - x[i][1];
-	delta1[2] = xnext[i][2] - x[i][2];
-	domain->minimum_image(delta1);
-	delta2[0] = x[i][0] - xprev[i][0];
-	delta2[1] = x[i][1] - xprev[i][1];
-	delta2[2] = x[i][2] - xprev[i][2];
-	domain->minimum_image(delta2);
-	if (vnext > vprev) {
-	  tangent[i][0] = vmax*delta1[0] + vmin*delta2[0];
-	  tangent[i][1] = vmax*delta1[1] + vmin*delta2[1];
-	  tangent[i][2] = vmax*delta1[2] + vmin*delta2[2];
-	} else {
-	  tangent[i][0] = vmin*delta1[0] + vmax*delta2[0];
-	  tangent[i][1] = vmin*delta1[1] + vmax*delta2[1];
-	  tangent[i][2] = vmin*delta1[2] + vmax*delta2[2];
-	}
+        delta1[0] = xnext[i][0] - x[i][0];
+        delta1[1] = xnext[i][1] - x[i][1];
+        delta1[2] = xnext[i][2] - x[i][2];
+        domain->minimum_image(delta1);
+        delta2[0] = x[i][0] - xprev[i][0];
+        delta2[1] = x[i][1] - xprev[i][1];
+        delta2[2] = x[i][2] - xprev[i][2];
+        domain->minimum_image(delta2);
+        if (vnext > vprev) {
+          tangent[i][0] = vmax*delta1[0] + vmin*delta2[0];
+          tangent[i][1] = vmax*delta1[1] + vmin*delta2[1];
+          tangent[i][2] = vmax*delta1[2] + vmin*delta2[2];
+        } else {
+          tangent[i][0] = vmin*delta1[0] + vmax*delta2[0];
+          tangent[i][1] = vmin*delta1[1] + vmax*delta2[1];
+          tangent[i][2] = vmin*delta1[2] + vmax*delta2[2];
+        }
       }
   }
 
@@ -245,9 +245,9 @@ void FixNEB::min_post_force(int vflag)
 
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
-      tlen += tangent[i][0]*tangent[i][0] + tangent[i][1]*tangent[i][1] + 
-	tangent[i][2]*tangent[i][2];
-      
+      tlen += tangent[i][0]*tangent[i][0] + tangent[i][1]*tangent[i][1] +
+        tangent[i][2]*tangent[i][2];
+
       delx = x[i][0] - xprev[i][0];
       dely = x[i][1] - xprev[i][1];
       delz = x[i][2] - xprev[i][2];
@@ -271,9 +271,9 @@ void FixNEB::min_post_force(int vflag)
     double tleninv = 1.0/tlen;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	tangent[i][0] *= tleninv;
-	tangent[i][1] *= tleninv;
-	tangent[i][2] *= tleninv;
+        tangent[i][0] *= tleninv;
+        tangent[i][1] *= tleninv;
+        tangent[i][2] *= tleninv;
       }
   }
 
@@ -292,8 +292,8 @@ void FixNEB::min_post_force(int vflag)
   double dot = 0.0;
   for (int i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit)
-      dot += f[i][0]*tangent[i][0] + f[i][1]*tangent[i][1] + 
-	f[i][2]*tangent[i][2];
+      dot += f[i][0]*tangent[i][0] + f[i][1]*tangent[i][1] +
+        f[i][2]*tangent[i][2];
   }
 
   double prefactor;
diff --git a/src/REPLICA/fix_neb.h b/src/REPLICA/fix_neb.h
index 140ad60694..b4e72a5a9f 100644
--- a/src/REPLICA/fix_neb.h
+++ b/src/REPLICA/fix_neb.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp
index b700ffde9b..86922826d3 100644
--- a/src/REPLICA/neb.cpp
+++ b/src/REPLICA/neb.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -46,8 +46,8 @@ NEB::NEB(LAMMPS *lmp) : Pointers(lmp) {}
 ------------------------------------------------------------------------- */
 
 NEB::NEB(LAMMPS *lmp, double etol_in, double ftol_in, int n1steps_in,
-	 int n2steps_in, int nevery_in, double *buf_init, double *buf_final) 
-  : Pointers(lmp) 
+         int n2steps_in, int nevery_in, double *buf_init, double *buf_final)
+  : Pointers(lmp)
 {
   double delx,dely,delz;
 
@@ -100,11 +100,11 @@ NEB::~NEB()
 
 void NEB::command(int narg, char **arg)
 {
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"NEB command before simulation box is defined");
 
   if (narg != 6) error->universe_all(FLERR,"Illegal NEB command");
-  
+
   etol = atof(arg[0]);
   ftol = atof(arg[1]);
   n1steps = atoi(arg[2]);
@@ -135,7 +135,7 @@ void NEB::command(int narg, char **arg)
     error->all(FLERR,"Can only use NEB with 1-processor replicas");
   if (atom->sortfreq > 0)
     error->all(FLERR,"Cannot use NEB with atom_modify sort enabled");
-  if (atom->map_style == 0) 
+  if (atom->map_style == 0)
     error->all(FLERR,"Cannot use NEB unless atom map exists");
 
   // read in file of final state atom coords and reset my coords
@@ -186,7 +186,7 @@ void NEB::run()
 
   if (me_universe == 0 && universe->uscreen)
     fprintf(universe->uscreen,"Setting up regular NEB ...\n");
-  
+
   update->beginstep = update->firststep = update->ntimestep;
   update->endstep = update->laststep = update->firststep + n1steps;
   update->nsteps = n1steps;
@@ -195,21 +195,21 @@ void NEB::run()
     error->all(FLERR,"Too many timesteps for NEB");
 
   update->minimize->setup();
-  
+
   if (me_universe == 0) {
     if (universe->uscreen)
       fprintf(universe->uscreen,"Step MaxReplicaForce MaxAtomForce "
-	      "GradV0 GradV1 GradVc "
-	      "EBF EBR RDT "
-	      "RD1 PE1 RD2 PE2 ... RDN PEN\n");
+              "GradV0 GradV1 GradVc "
+              "EBF EBR RDT "
+              "RD1 PE1 RD2 PE2 ... RDN PEN\n");
     if (universe->ulogfile)
       fprintf(universe->ulogfile,"Step MaxReplicaForce MaxAtomForce "
-	      "GradV0 GradV1 GradVc "
-	      "EBF EBR RDT "
-	      "RD1 PE1 RD2 PE2 ... RDN PEN\n");
+              "GradV0 GradV1 GradVc "
+              "EBF EBR RDT "
+              "RD1 PE1 RD2 PE2 ... RDN PEN\n");
   }
   print_status();
-  
+
   // perform regular NEB for n1steps or until replicas converge
   // retrieve PE values from fix NEB and print every nevery iterations
   // break induced if converged
@@ -217,13 +217,13 @@ void NEB::run()
 
   timer->init();
   timer->barrier_start(TIME_LOOP);
-  
+
   while (update->minimize->niter < n1steps) {
     update->minimize->run(nevery);
     print_status();
     if (update->minimize->stop_condition) break;
   }
-	
+
   timer->barrier_stop(TIME_LOOP);
 
   update->minimize->cleanup();
@@ -254,7 +254,7 @@ void NEB::run()
     if (universe->ulogfile)
       fprintf(universe->ulogfile,"Climbing replica = %d\n",top+1);
   }
-  
+
   update->beginstep = update->firststep = update->ntimestep;
   update->endstep = update->laststep = update->firststep + n2steps;
   update->nsteps = n2steps;
@@ -269,22 +269,22 @@ void NEB::run()
   if (me_universe == 0) {
     if (universe->uscreen)
       fprintf(universe->uscreen,"Step MaxReplicaForce MaxAtomForce "
-	      "GradV0 GradV1 GradVc "
-	      "EBF EBR RDT "
-	      "RD1 PE1 RD2 PE2 ... RDN PEN\n");
+              "GradV0 GradV1 GradVc "
+              "EBF EBR RDT "
+              "RD1 PE1 RD2 PE2 ... RDN PEN\n");
     if (universe->ulogfile)
       fprintf(universe->ulogfile,"Step MaxReplicaForce MaxAtomForce "
-	      "GradV0 GradV1 GradVc "
-	      "EBF EBR RDT "
-	      "RD1 PE1 RD2 PE2 ... RDN PEN\n");
+              "GradV0 GradV1 GradVc "
+              "EBF EBR RDT "
+              "RD1 PE1 RD2 PE2 ... RDN PEN\n");
   }
   print_status();
-  
+
   // perform climbing NEB for n2steps or until replicas converge
   // retrieve PE values from fix NEB and print every nevery iterations
   // break induced if converged
   // damped dynamic min styles insure all replicas converge together
-  
+
   timer->init();
   timer->barrier_start(TIME_LOOP);
 
@@ -293,7 +293,7 @@ void NEB::run()
     print_status();
     if (update->minimize->stop_condition) break;
   }
-	
+
   timer->barrier_stop(TIME_LOOP);
 
   update->minimize->cleanup();
@@ -337,9 +337,9 @@ void NEB::readfile(char *file)
     if (me_universe == 0) {
       m = 0;
       for (nlines = 0; nlines < CHUNK; nlines++) {
-	ptr = fgets(&buffer[m],MAXLINE,fp);
-	if (ptr == NULL) break;
-	m += strlen(&buffer[m]);
+        ptr = fgets(&buffer[m],MAXLINE,fp);
+        if (ptr == NULL) break;
+        m += strlen(&buffer[m]);
       }
       if (ptr == NULL) eof = 1;
       buffer[m++] = '\n';
@@ -356,8 +356,8 @@ void NEB::readfile(char *file)
       *next = '\0';
 
       if (firstline) {
-	if (atom->count_words(bufptr) == 4) firstline = 0;
-	else error->all(FLERR,"Incorrect format in NEB coordinate file");
+        if (atom->count_words(bufptr) == 4) firstline = 0;
+        else error->all(FLERR,"Incorrect format in NEB coordinate file");
       }
 
       sscanf(bufptr,"%d %lg %lg %lg",&tag,&xx,&yy,&zz);
@@ -372,14 +372,14 @@ void NEB::readfile(char *file)
 
       m = atom->map(tag);
       if (m >= 0 && m < nlocal) {
-	delx = xx - x[m][0];
-	dely = yy - x[m][1];
-	delz = zz - x[m][2];
-	domain->minimum_image(delx,dely,delz);
-	x[m][0] += fraction*delx;
-	x[m][1] += fraction*dely;
-	x[m][2] += fraction*delz;
-	ncount++;
+        delx = xx - x[m][0];
+        dely = yy - x[m][1];
+        delz = zz - x[m][2];
+        domain->minimum_image(delx,dely,delz);
+        x[m][0] += fraction*delx;
+        x[m][1] += fraction*dely;
+        x[m][2] += fraction*delz;
+        ncount++;
       }
 
       bufptr = next + 1;
@@ -476,8 +476,8 @@ void NEB::print_status()
     int top = 0;
     for (int m = 1; m < nreplica; m++)
       if (vmax < all[m][0]) {
-	vmax = all[m][0];
-	top = m;
+        vmax = all[m][0];
+        top = m;
       }
     irep = top;
     gradvnormc = all[irep][3];
@@ -488,22 +488,22 @@ void NEB::print_status()
   if (me_universe == 0) {
     if (universe->uscreen) {
       fprintf(universe->uscreen,BIGINT_FORMAT " %12.8g %12.8g ",
-	      update->ntimestep,fmaxreplica,fmaxatom);
+              update->ntimestep,fmaxreplica,fmaxatom);
       fprintf(universe->uscreen,"%12.8g %12.8g %12.8g ",
-	      gradvnorm0,gradvnorm1,gradvnormc);
+              gradvnorm0,gradvnorm1,gradvnormc);
       fprintf(universe->uscreen,"%12.8g %12.8g %12.8g ",ebf,ebr,endpt);
-      for (int i = 0; i < nreplica; i++) 
-	fprintf(universe->uscreen,"%12.8g %12.8g ",rdist[i],all[i][0]);
+      for (int i = 0; i < nreplica; i++)
+        fprintf(universe->uscreen,"%12.8g %12.8g ",rdist[i],all[i][0]);
       fprintf(universe->uscreen,"\n");
     }
     if (universe->ulogfile) {
       fprintf(universe->ulogfile,BIGINT_FORMAT " %12.8g %12.8g ",
-	      update->ntimestep,fmaxreplica,fmaxatom);
+              update->ntimestep,fmaxreplica,fmaxatom);
       fprintf(universe->ulogfile,"%12.8g %12.8g %12.8g ",
-	      gradvnorm0,gradvnorm1,gradvnormc);
+              gradvnorm0,gradvnorm1,gradvnormc);
       fprintf(universe->ulogfile,"%12.8g %12.8g %12.8g ",ebf,ebr,endpt);
       for (int i = 0; i < nreplica; i++)
-	fprintf(universe->ulogfile,"%12.8g %12.8g ",rdist[i],all[i][0]);
+        fprintf(universe->ulogfile,"%12.8g %12.8g ",rdist[i],all[i][0]);
       fprintf(universe->ulogfile,"\n");
       fflush(universe->ulogfile);
     }
diff --git a/src/REPLICA/neb.h b/src/REPLICA/neb.h
index 02eac60495..1e1b47cc6a 100644
--- a/src/REPLICA/neb.h
+++ b/src/REPLICA/neb.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -101,7 +101,7 @@ Use a different minimization style.
 
 E: Too many timesteps for NEB
 
-You must use a number of timesteps that fit in a 32-bit integer 
+You must use a number of timesteps that fit in a 32-bit integer
 for NEB.
 
 E: Too many timesteps
diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp
index 24cd52f9e9..17e83a9090 100644
--- a/src/REPLICA/prd.cpp
+++ b/src/REPLICA/prd.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,7 +35,7 @@
 #include "compute.h"
 #include "fix.h"
 #include "fix_event_prd.h"
-#include "force.h"  
+#include "force.h"
 #include "pair.h"
 #include "random_park.h"
 #include "random_mars.h"
@@ -62,13 +62,13 @@ void PRD::command(int narg, char **arg)
 
   // error checks
 
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"PRD command before simulation box is defined");
-  if (universe->nworlds != universe->nprocs && 
-      atom->map_style == 0) 
+  if (universe->nworlds != universe->nprocs &&
+      atom->map_style == 0)
     error->all(FLERR,"Cannot use PRD with multi-processor replicas "
-	       "unless atom map exists");
-  if (universe->nworlds == 1 && comm->me == 0) 
+               "unless atom map exists");
+  if (universe->nworlds == 1 && comm->me == 0)
     error->warning(FLERR,"Running PRD with only one replica");
 
   if (narg < 7) error->universe_all(FLERR,"Illegal prd command");
@@ -82,13 +82,13 @@ void PRD::command(int narg, char **arg)
   char *id_compute = new char[strlen(arg[5])+1];
   strcpy(id_compute,arg[5]);
   int seed = atoi(arg[6]);
-  
+
   options(narg-7,&arg[7]);
 
   // total # of timesteps must be multiple of t_event
 
   if (t_event <= 0) error->universe_all(FLERR,"Invalid t_event in prd command");
-  if (nsteps % t_event) 
+  if (nsteps % t_event)
     error->universe_all(FLERR,"PRD nsteps must be multiple of t_event");
   if (t_corr % t_event)
     error->universe_all(FLERR,"PRD t_corr must be multiple of t_event");
@@ -137,7 +137,7 @@ void PRD::command(int narg, char **arg)
   random_dephase = new RanMars(lmp,seed+iworld);
 
   // create ComputeTemp class to monitor temperature
-  
+
   char **args = new char*[3];
   args[0] = (char *) "prd_temp";
   args[1] = (char *) "all";
@@ -195,7 +195,7 @@ void PRD::command(int narg, char **arg)
   neigh_dist_check = neighbor->dist_check;
 
   if (neigh_every != 1 || neigh_delay != 0 || neigh_dist_check != 1) {
-    if (me == 0) 
+    if (me == 0)
       error->warning(FLERR,"Resetting reneighboring criteria during PRD");
   }
 
@@ -238,16 +238,16 @@ void PRD::command(int narg, char **arg)
 
   // perform PRD simulation
 
-  if (me_universe == 0 && universe->uscreen) 
+  if (me_universe == 0 && universe->uscreen)
     fprintf(universe->uscreen,"Setting up PRD ...\n");
 
   if (me_universe == 0) {
-    if (universe->uscreen) 
+    if (universe->uscreen)
       fprintf(universe->uscreen,"Step CPU Clock Event "
-	      "Correlated Coincident Replica\n");
-    if (universe->ulogfile) 
+              "Correlated Coincident Replica\n");
+    if (universe->ulogfile)
       fprintf(universe->ulogfile,"Step CPU Clock Event "
-	      "Correlated Coincident Replica\n");
+              "Correlated Coincident Replica\n");
   }
 
   // store hot state and quenched event for replica 0
@@ -312,14 +312,14 @@ void PRD::command(int narg, char **arg)
 
     share_event(ireplica,1);
     log_event();
-    
+
     int restart_flag = 0;
     if (output->restart_flag && universe->iworld == 0) {
-      if (output->restart_every_single && 
-	  fix_event->event_number % output->restart_every_single == 0)
+      if (output->restart_every_single &&
+          fix_event->event_number % output->restart_every_single == 0)
         restart_flag = 1;
-      if (output->restart_every_double && 
-	  fix_event->event_number % output->restart_every_double == 0)
+      if (output->restart_every_double &&
+          fix_event->event_number % output->restart_every_double == 0)
         restart_flag = 1;
     }
 
@@ -342,7 +342,7 @@ void PRD::command(int narg, char **arg)
         corr_endstep = update->ntimestep + t_corr;
       } else fix_event->restore_state();
     }
-    
+
     // full init/setup since are starting all replicas after event
     // event replica bcasts temp to all replicas if temp_dephase is not set
 
@@ -355,14 +355,14 @@ void PRD::command(int narg, char **arg)
     if (t_corr > 0) replicate(ireplica);
     if (temp_flag == 0) {
       if (ireplica == universe->iworld)
-	temp_dephase = temperature->compute_scalar();
+        temp_dephase = temperature->compute_scalar();
       MPI_Bcast(&temp_dephase,1,MPI_DOUBLE,universe->root_proc[ireplica],
-        	      universe->uworld);
+                      universe->uworld);
     }
 
     timer->barrier_stop(TIME_LOOP);
     time_comm += timer->array[TIME_LOOP];
-    
+
     // write restart file of hot coords
 
     if (restart_flag) {
@@ -388,20 +388,20 @@ void PRD::command(int narg, char **arg)
   neighbor->ndanger = ndanger;
 
   if (me_universe == 0) {
-    if (universe->uscreen) 
+    if (universe->uscreen)
       fprintf(universe->uscreen,
-	      "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT 
-	      " atoms\n",
-	      timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
-    if (universe->ulogfile) 
+              "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
+              " atoms\n",
+              timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
+    if (universe->ulogfile)
       fprintf(universe->ulogfile,
-	      "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT 
-	      " atoms\n",
+              "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
+              " atoms\n",
               timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
   }
-  
+
   finish->end(2);
-  
+
   update->whichflag = 0;
   update->firststep = update->laststep = 0;
   update->beginstep = update->endstep = 0;
@@ -419,7 +419,7 @@ void PRD::command(int narg, char **arg)
   memory->destroy(tagall);
   memory->destroy(xall);
   memory->destroy(imageall);
-  
+
   delete [] id_compute;
   MPI_Comm_free(&comm_replica);
   delete random_select;
@@ -503,7 +503,7 @@ void PRD::quench()
   bigint ntimestep_hold = update->ntimestep;
   bigint endstep_hold = update->endstep;
 
-  // need to change whichflag so that minimize->setup() calling 
+  // need to change whichflag so that minimize->setup() calling
   // modify->setup() will call fix->min_setup()
 
   update->whichflag = 2;
@@ -546,7 +546,7 @@ void PRD::quench()
 
 /* ----------------------------------------------------------------------
    check for an event in any replica
-   if replica_num is non-negative only check for event on replica_num 
+   if replica_num is non-negative only check for event on replica_num
    if multiple events, choose one at random
    return -1 if no event
    else return ireplica = world in which event occured
@@ -559,19 +559,19 @@ int PRD::check_event(int replica_num)
   worldflag = 0;
   if (compute_event->compute_scalar() > 0.0) worldflag = 1;
   if (replica_num >= 0 && replica_num != universe->iworld) worldflag = 0;
-  
+
   timer->barrier_start(TIME_LOOP);
   if (me == 0) MPI_Allreduce(&worldflag,&universeflag,1,
-		             MPI_INT,MPI_SUM,comm_replica);
+                             MPI_INT,MPI_SUM,comm_replica);
   MPI_Bcast(&universeflag,1,MPI_INT,0,world);
-  ncoincident = universeflag;  
+  ncoincident = universeflag;
   if (!universeflag) ireplica = -1;
   else {
     if (universeflag > 1) {
-      int iwhich = static_cast<int> 
-	(universeflag*random_select->uniform()) + 1;
+      int iwhich = static_cast<int>
+        (universeflag*random_select->uniform()) + 1;
       if (me == 0) MPI_Scan(&worldflag,&scanflag,1,
-			    MPI_INT,MPI_SUM,comm_replica);
+                            MPI_INT,MPI_SUM,comm_replica);
       MPI_Bcast(&scanflag,1,MPI_INT,0,world);
       if (scanflag != iwhich) worldflag = 0;
     }
@@ -579,7 +579,7 @@ int PRD::check_event(int replica_num)
     if (worldflag) replicaflag = universe->iworld;
     else replicaflag = 0;
     if (me == 0) MPI_Allreduce(&replicaflag,&ireplica,1,
-  			     MPI_INT,MPI_SUM,comm_replica);
+                               MPI_INT,MPI_SUM,comm_replica);
     MPI_Bcast(&ireplica,1,MPI_INT,0,world);
   }
   timer->barrier_stop(TIME_LOOP);
@@ -606,7 +606,7 @@ void PRD::share_event(int ireplica, int flag)
   replicate(ireplica);
   timer->barrier_stop(TIME_LOOP);
   time_comm += timer->array[TIME_LOOP];
-  
+
   // adjust time for last correlated event check (not on first event)
 
   int corr_adjust = t_corr;
@@ -623,7 +623,7 @@ void PRD::share_event(int ireplica, int flag)
 
   // don't change the clock or timestep if this is a restart
 
-  if (flag == 0 && fix_event->event_number != 0) 
+  if (flag == 0 && fix_event->event_number != 0)
     fix_event->store_event_prd(fix_event->event_timestep,0);
   else {
     fix_event->store_event_prd(update->ntimestep,delta);
@@ -631,7 +631,7 @@ void PRD::share_event(int ireplica, int flag)
     fix_event->correlated_event = 0;
     if (flag == 2) fix_event->correlated_event = 1;
     fix_event->ncoincident = ncoincident;
-  } 
+  }
   if (flag == 0) fix_event->event_number--;
 
   // dump snapshot of quenched coords
@@ -667,21 +667,21 @@ void PRD::log_event()
   if (universe->me == 0) {
     if (universe->uscreen)
       fprintf(universe->uscreen,
-	      BIGINT_FORMAT " %.3f %d %d %d %d %d\n",
+              BIGINT_FORMAT " %.3f %d %d %d %d %d\n",
               fix_event->event_timestep,
-	      timer->elapsed(TIME_LOOP),
-	      fix_event->clock,
+              timer->elapsed(TIME_LOOP),
+              fix_event->clock,
               fix_event->event_number,fix_event->correlated_event,
-	      fix_event->ncoincident,
+              fix_event->ncoincident,
               fix_event->replica_number);
     if (universe->ulogfile)
       fprintf(universe->ulogfile,
-	      BIGINT_FORMAT " %.3f %d %d %d %d %d\n",
+              BIGINT_FORMAT " %.3f %d %d %d %d %d\n",
               fix_event->event_timestep,
-	      timer->elapsed(TIME_LOOP),
-	      fix_event->clock,
+              timer->elapsed(TIME_LOOP),
+              fix_event->clock,
               fix_event->event_number,fix_event->correlated_event,
-	      fix_event->ncoincident,
+              fix_event->ncoincident,
               fix_event->replica_number);
   }
 }
@@ -726,12 +726,12 @@ void PRD::replicate(int ireplica)
       MPI_Gatherv(atom->tag,atom->nlocal,MPI_INT,
                   tagall,counts,displacements,MPI_INT,0,world);
       MPI_Gatherv(atom->image,atom->nlocal,MPI_INT,
-      	          imageall,counts,displacements,MPI_INT,0,world);
+                        imageall,counts,displacements,MPI_INT,0,world);
       for (i = 0; i < nprocs; i++) counts[i] *= 3;
       for (i = 0; i < nprocs-1; i++)
         displacements[i+1] = displacements[i] + counts[i];
       MPI_Gatherv(atom->x[0],3*atom->nlocal,MPI_DOUBLE,
-      	          xall[0],counts,displacements,MPI_DOUBLE,0,world);
+                        xall[0],counts,displacements,MPI_DOUBLE,0,world);
     }
 
     if (me == 0) {
@@ -762,7 +762,7 @@ void PRD::replicate(int ireplica)
 }
 
 /* ----------------------------------------------------------------------
-   parse optional parameters at end of PRD input line 
+   parse optional parameters at end of PRD input line
 ------------------------------------------------------------------------- */
 
 void PRD::options(int narg, char **arg)
@@ -770,7 +770,7 @@ void PRD::options(int narg, char **arg)
   if (narg < 0) error->all(FLERR,"Illegal prd command");
 
   // set defaults
-  
+
   etol = 0.1;
   ftol = 0.1;
   maxiter = 40;
diff --git a/src/REPLICA/prd.h b/src/REPLICA/prd.h
index 0e5b4db5ca..45192480b3 100644
--- a/src/REPLICA/prd.h
+++ b/src/REPLICA/prd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,7 +50,7 @@ class PRD : protected Pointers {
   double **xall;
 
   int ncoincident;
-  
+
   class RanPark *random_select;
   class RanMars *random_dephase;
   class Compute *compute_event;
@@ -137,7 +137,7 @@ which is enabled by default, via the atom_modify command.
 
 E: Too many iterations
 
-You must use a number of iterations that fit in a 32-bit integer 
+You must use a number of iterations that fit in a 32-bit integer
 for minimization.
 
 */
diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp
index 6fb3a6cf85..9102bac1a0 100644
--- a/src/REPLICA/tad.cpp
+++ b/src/REPLICA/tad.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,7 +37,7 @@
 #include "fix.h"
 #include "fix_event_tad.h"
 #include "fix_store_state.h"
-#include "force.h"  
+#include "force.h"
 #include "pair.h"
 #include "random_park.h"
 #include "random_mars.h"
@@ -79,15 +79,15 @@ void TAD::command(int narg, char **arg)
 
   // error checks
 
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"Tad command before simulation box is defined");
-  if (universe->nworlds == 1) 
+  if (universe->nworlds == 1)
     error->all(FLERR,"Cannot use TAD with a single replica for NEB");
   if (universe->nworlds != universe->nprocs)
     error->all(FLERR,"Can only use TAD with 1-processor replicas for NEB");
   if (atom->sortfreq > 0)
     error->all(FLERR,"Cannot use TAD with atom_modify sort enabled for NEB");
-  if (atom->map_style == 0) 
+  if (atom->map_style == 0)
     error->all(FLERR,"Cannot use TAD unless atom map exists for NEB");
 
   if (narg < 7) error->universe_all(FLERR,"Illegal tad command");
@@ -98,22 +98,22 @@ void TAD::command(int narg, char **arg)
   temphi = atof(arg[3]);
   delta_conf = atof(arg[4]);
   tmax = atof(arg[5]);
-  
+
   char *id_compute = new char[strlen(arg[6])+1];
   strcpy(id_compute,arg[6]);
-  
+
   options(narg-7,&arg[7]);
 
   // total # of timesteps must be multiple of t_event
 
   if (t_event <= 0) error->universe_all(FLERR,"Invalid t_event in tad command");
-  if (nsteps % t_event) 
+  if (nsteps % t_event)
     error->universe_all(FLERR,"TAD nsteps must be multiple of t_event");
 
-  if (delta_conf <= 0.0 || delta_conf >= 1.0) 
+  if (delta_conf <= 0.0 || delta_conf >= 1.0)
     error->universe_all(FLERR,"Invalid delta_conf in tad command");
 
-  if (tmax <= 0.0) 
+  if (tmax <= 0.0)
     error->universe_all(FLERR,"Invalid tmax in tad command");
 
   // deltconf = (ln(1/delta))/freq_min (timestep units)
@@ -129,7 +129,7 @@ void TAD::command(int narg, char **arg)
   MPI_Comm_size(world,&nprocs);
 
   delta_beta = (1.0/templo - 1.0/temphi) / force->boltz;
-  ratio_beta = templo/temphi; 
+  ratio_beta = templo/temphi;
 
   // create FixEventTAD object to store last event
 
@@ -182,7 +182,7 @@ void TAD::command(int narg, char **arg)
   neigh_dist_check = neighbor->dist_check;
 
   if (neigh_every != 1 || neigh_delay != 0 || neigh_dist_check != 1) {
-    if (me_universe == 0) 
+    if (me_universe == 0)
       error->warning(FLERR,"Resetting reneighboring criteria during TAD");
   }
 
@@ -222,25 +222,25 @@ void TAD::command(int narg, char **arg)
 
   // perform TAD simulation
 
-  if (me_universe == 0 && universe->uscreen) 
+  if (me_universe == 0 && universe->uscreen)
     fprintf(universe->uscreen,"Setting up TAD ...\n");
 
   if (me_universe == 0) {
-    if (universe->uscreen) 
+    if (universe->uscreen)
       fprintf(universe->uscreen,
-	      "Step CPU N M Status Barrier Margin t_lo delt_lo\n"
-	      );
-    if (universe->ulogfile) 
+              "Step CPU N M Status Barrier Margin t_lo delt_lo\n"
+              );
+    if (universe->ulogfile)
       fprintf(universe->ulogfile,
-	      "Step CPU N M Status Barrier Margin t_lo delt_lo\n"
-	      );
+              "Step CPU N M Status Barrier Margin t_lo delt_lo\n"
+              );
   }
 
   ulogfile_lammps = universe->ulogfile;
   uscreen_lammps = universe->uscreen;
   ulogfile_neb = NULL;
   uscreen_neb = NULL;
-  if (me_universe == 0 && neb_logfilename) 
+  if (me_universe == 0 && neb_logfilename)
     ulogfile_neb = fopen(neb_logfilename,"w");
 
   // store hot state and quenched event, only on replica 0
@@ -262,86 +262,86 @@ void TAD::command(int narg, char **arg)
   fix_event->restore_state();
 
   // do full init/setup
-  
+
   update->whichflag = 1;
   lmp->init();
   update->integrate->setup();
   //   }
-    
+
   // main loop: look for events until out of time
   // (1) dynamics, store state, quench, check event, restore state
   // (2) if event, perform NEB, record in fix_event_list
-  // (3) if confident, pick earliest event 
+  // (3) if confident, pick earliest event
 
   nbuild = ndanger = 0;
   time_neb = time_dynamics = time_quench = time_comm = time_output = 0.0;
 
   timer->barrier_start(TIME_LOOP);
   time_start = timer->array[TIME_LOOP];
-  
+
   int confident_flag, event_flag;
 
   if (universe->iworld == 0) {
     while (update->ntimestep < update->endstep) {
 
       // initialize list of possible events
-      
+
       initialize_event_list();
       confident_flag = 0;
 
       while (update->ntimestep < update->endstep) {
-	event_flag = 0;
-	while (update->ntimestep < update->endstep) {
+        event_flag = 0;
+        while (update->ntimestep < update->endstep) {
 
-	  dynamics();
+          dynamics();
 
 
-	  fix_event->store_state();
+          fix_event->store_state();
 
 
-	  quench();
+          quench();
 
 
-	  event_flag = check_event();
-	  MPI_Bcast(&event_flag,1,MPI_INT,0,universe->uworld);
+          event_flag = check_event();
+          MPI_Bcast(&event_flag,1,MPI_INT,0,universe->uworld);
 
-	  if (event_flag) break;
+          if (event_flag) break;
 
-	  // restore hot state
+          // restore hot state
 
-	  fix_event->restore_state();
+          fix_event->restore_state();
 
-	  // store hot state in revert
+          // store hot state in revert
 
-	  fix_revert->end_of_step();
-	}
-	if (!event_flag) break;
+          fix_revert->end_of_step();
+        }
+        if (!event_flag) break;
 
-	add_event();
+        add_event();
 
-	perform_neb(n_event_list-1);
-	compute_tlo(n_event_list-1);
-	confident_flag = check_confidence();
-	MPI_Bcast(&confident_flag,1,MPI_INT,0,universe->uworld);
-	if (confident_flag) break;
-	if (universe->iworld == 0) revert();
+        perform_neb(n_event_list-1);
+        compute_tlo(n_event_list-1);
+        confident_flag = check_confidence();
+        MPI_Bcast(&confident_flag,1,MPI_INT,0,universe->uworld);
+        if (confident_flag) break;
+        if (universe->iworld == 0) revert();
       }
       if (!confident_flag) break;
-    
+
       perform_event(event_first);
 
-      // need to sync timestep with TAD 
+      // need to sync timestep with TAD
 
       MPI_Bcast(&(update->ntimestep),1,MPI_INT,0,universe->uworld);
-    
+
       int restart_flag = 0;
       if (output->restart_flag && universe->iworld == 0) {
-	if (output->restart_every_single && 
-	    fix_event->event_number % output->restart_every_single == 0)
-	  restart_flag = 1;
-	if (output->restart_every_double && 
-	    fix_event->event_number % output->restart_every_double == 0)
-	  restart_flag = 1;
+        if (output->restart_every_single &&
+            fix_event->event_number % output->restart_every_single == 0)
+          restart_flag = 1;
+        if (output->restart_every_double &&
+            fix_event->event_number % output->restart_every_double == 0)
+          restart_flag = 1;
       }
 
       // full init/setup since are starting after event
@@ -353,10 +353,10 @@ void TAD::command(int narg, char **arg)
     // write restart file of hot coords
 
       if (restart_flag) {
-	timer->barrier_start(TIME_LOOP);
-	output->write_restart(update->ntimestep);
-	timer->barrier_stop(TIME_LOOP);
-	time_output += timer->array[TIME_LOOP];
+        timer->barrier_start(TIME_LOOP);
+        output->write_restart(update->ntimestep);
+        timer->barrier_stop(TIME_LOOP);
+        time_output += timer->array[TIME_LOOP];
       }
     }
 
@@ -365,21 +365,21 @@ void TAD::command(int narg, char **arg)
     while (update->ntimestep < update->endstep) {
       confident_flag = 0;
       while (update->ntimestep < update->endstep) {
-	event_flag = 0;
-	while (update->ntimestep < update->endstep) {
-	  update->ntimestep += t_event;
-	  MPI_Bcast(&event_flag,1,MPI_INT,0,universe->uworld);
-
-	  if (event_flag) break;
-	}
-	if (!event_flag) break;
-	perform_neb(-1);
-	MPI_Bcast(&confident_flag,1,MPI_INT,0,universe->uworld);
-	if (confident_flag) break;
+        event_flag = 0;
+        while (update->ntimestep < update->endstep) {
+          update->ntimestep += t_event;
+          MPI_Bcast(&event_flag,1,MPI_INT,0,universe->uworld);
+
+          if (event_flag) break;
+        }
+        if (!event_flag) break;
+        perform_neb(-1);
+        MPI_Bcast(&confident_flag,1,MPI_INT,0,universe->uworld);
+        if (confident_flag) break;
       }
       if (!confident_flag) break;
-    
-      // need to sync timestep with TAD 
+
+      // need to sync timestep with TAD
 
       MPI_Bcast(&(update->ntimestep),1,MPI_INT,0,universe->uworld);
     }
@@ -400,22 +400,22 @@ void TAD::command(int narg, char **arg)
   neighbor->ndanger = ndanger;
 
   if (me_universe == 0) {
-    if (universe->uscreen) 
+    if (universe->uscreen)
       fprintf(universe->uscreen,
-	      "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT 
-	      " atoms\n",
-	      timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
-    if (universe->ulogfile) 
+              "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
+              " atoms\n",
+              timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
+    if (universe->ulogfile)
       fprintf(universe->ulogfile,
-	      "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT 
-	      " atoms\n",
+              "Loop time of %g on %d procs for %d steps with " BIGINT_FORMAT
+              " atoms\n",
               timer->array[TIME_LOOP],nprocs_universe,nsteps,atom->natoms);
   }
 
   if (me_universe == 0) fclose(ulogfile_neb);
-  
+
   finish->end(3);
-  
+
   update->whichflag = 0;
   update->firststep = update->laststep = 0;
   update->beginstep = update->endstep = 0;
@@ -427,7 +427,7 @@ void TAD::command(int narg, char **arg)
   neighbor->delay = neigh_delay;
   neighbor->dist_check = neigh_dist_check;
 
-  
+
   delete [] id_compute;
   delete finish;
   modify->delete_fix("tad_event");
@@ -473,7 +473,7 @@ void TAD::quench()
   bigint ntimestep_hold = update->ntimestep;
   bigint endstep_hold = update->endstep;
 
-  // need to change whichflag so that minimize->setup() calling 
+  // need to change whichflag so that minimize->setup() calling
   // modify->setup() will call fix->min_setup()
 
   update->whichflag = 2;
@@ -541,28 +541,28 @@ void TAD::log_event(int ievent)
     double tfrac = 0.0;
     if (universe->uscreen)
       fprintf(universe->uscreen,
-	      BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
-	      fix_event->event_timestep,
-	      timer->elapsed(TIME_LOOP),
-	      fix_event->event_number,ievent,
-	      "E ",
-	      fix_event->ebarrier,tfrac,
-	      fix_event->tlo,deltfirst);
+              BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
+              fix_event->event_timestep,
+              timer->elapsed(TIME_LOOP),
+              fix_event->event_number,ievent,
+              "E ",
+              fix_event->ebarrier,tfrac,
+              fix_event->tlo,deltfirst);
     if (universe->ulogfile)
       fprintf(universe->ulogfile,
-	      BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
-	      fix_event->event_timestep,
-	      timer->elapsed(TIME_LOOP),
-	      fix_event->event_number,ievent,
-	      "E ",
-	      fix_event->ebarrier,tfrac,
-	      fix_event->tlo,deltfirst);
+              BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
+              fix_event->event_timestep,
+              timer->elapsed(TIME_LOOP),
+              fix_event->event_number,ievent,
+              "E ",
+              fix_event->ebarrier,tfrac,
+              fix_event->tlo,deltfirst);
   }
 
   // dump snapshot of quenched coords
   // must reneighbor and compute forces before dumping
   // addstep_compute_all insures eng/virial are calculated if needed
-  
+
   if (output->ndump && universe->iworld == 0) {
     timer->barrier_start(TIME_LOOP);
     modify->addstep_compute_all(update->ntimestep);
@@ -575,7 +575,7 @@ void TAD::log_event(int ievent)
 }
 
 /* ----------------------------------------------------------------------
-   parse optional parameters at end of TAD input line 
+   parse optional parameters at end of TAD input line
 ------------------------------------------------------------------------- */
 
 void TAD::options(int narg, char **arg)
@@ -583,7 +583,7 @@ void TAD::options(int narg, char **arg)
   if (narg < 0) error->all(FLERR,"Illegal tad command");
 
   // set defaults
-  
+
   etol = 0.1;
   ftol = 0.1;
   maxiter = 40;
@@ -609,9 +609,9 @@ void TAD::options(int narg, char **arg)
       ftol = atof(arg[iarg+2]);
       maxiter = atoi(arg[iarg+3]);
       maxeval = atoi(arg[iarg+4]);
-      if (maxiter < 0 || maxeval < 0 || 
-	  etol < 0.0 || ftol < 0.0 ) 
-	error->all(FLERR,"Illegal tad command");
+      if (maxiter < 0 || maxeval < 0 ||
+          etol < 0.0 || ftol < 0.0 )
+        error->all(FLERR,"Illegal tad command");
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"neb") == 0) {
@@ -621,11 +621,11 @@ void TAD::options(int narg, char **arg)
       n1steps_neb = atoi(arg[iarg+3]);
       n2steps_neb = atoi(arg[iarg+4]);
       nevery_neb = atoi(arg[iarg+5]);
-      if (etol_neb < 0.0 || ftol_neb < 0.0 || 
-	  n1steps_neb < 0 || n2steps_neb < 0 ||
-	  nevery_neb < 0) error->all(FLERR,"Illegal tad command");
+      if (etol_neb < 0.0 || ftol_neb < 0.0 ||
+          n1steps_neb < 0 || n2steps_neb < 0 ||
+          nevery_neb < 0) error->all(FLERR,"Illegal tad command");
       iarg += 6;
-      
+
     } else if (strcmp(arg[iarg],"min_style") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal tad command");
       int n = strlen(arg[iarg+1]) + 1;
@@ -647,9 +647,9 @@ void TAD::options(int narg, char **arg)
       if (iarg+2 > narg) error->all(FLERR,"Illegal tad command");
       if (strcmp(arg[iarg+1],"none") == 0) neb_logfilename = NULL;
       else {
-	int n = strlen(arg[iarg+1]) + 1;
-	neb_logfilename = new char[n];
-	strcpy(neb_logfilename,arg[iarg+1]);
+        int n = strlen(arg[iarg+1]) + 1;
+        neb_logfilename = new char[n];
+        strcpy(neb_logfilename,arg[iarg+1]);
       }
       iarg += 2;
     } else error->all(FLERR,"Illegal tad command");
@@ -677,18 +677,18 @@ void TAD::perform_neb(int ievent)
 
     int ii = 0;
     for (int i = 0; i < nlocal; i++) {
-      buf_final[ii++] = x[i][0]; 
-      buf_final[ii++] = x[i][1]; 
-      buf_final[ii++] = x[i][2]; 
+      buf_final[ii++] = x[i][0];
+      buf_final[ii++] = x[i][1];
+      buf_final[ii++] = x[i][2];
     }
   }
 
   MPI_Bcast(buf_final,3*nlocal,MPI_DOUBLE,universe->root_proc[0],
-	    universe->uworld);
+            universe->uworld);
 
   double *buf_init;
   memory->create(buf_init,3*nlocal,"tad:bufinit");
-    
+
   // set system to quenched state of fix_event
 
   if (universe->iworld == 0) {
@@ -697,14 +697,14 @@ void TAD::perform_neb(int ievent)
 
     int ii = 0;
     for (int i = 0; i < nlocal; i++) {
-      buf_init[ii++] = x[i][0]; 
-      buf_init[ii++] = x[i][1]; 
-      buf_init[ii++] = x[i][2]; 
+      buf_init[ii++] = x[i][0];
+      buf_init[ii++] = x[i][1];
+      buf_init[ii++] = x[i][2];
     }
   }
 
   MPI_Bcast(buf_init,3*nlocal,MPI_DOUBLE,universe->root_proc[0],
-	    universe->uworld);
+            universe->uworld);
 
   // create FixNEB object to support NEB
 
@@ -714,7 +714,7 @@ void TAD::perform_neb(int ievent)
   args[1] = (char *) "all";
   args[2] = (char *) "neb";
   char str[128];
-  args[3] = str; 
+  args[3] = str;
   double kspring = 1.0;
   sprintf(args[3],"%f",kspring);
   modify->add_fix(narg2,args);
@@ -733,8 +733,8 @@ void TAD::perform_neb(int ievent)
 
   // create NEB object
 
-  neb = new NEB(lmp,etol_neb,ftol_neb,n1steps_neb, 
-		n2steps_neb,nevery_neb,buf_init,buf_final);
+  neb = new NEB(lmp,etol_neb,ftol_neb,n1steps_neb,
+                n2steps_neb,nevery_neb,buf_init,buf_final);
 
   // free up temporary arrays
 
@@ -796,7 +796,7 @@ void TAD::perform_neb(int ievent)
 
   delete [] args;
 
-  // clean up 
+  // clean up
 
   modify->delete_fix("neb");
   delete neb;
@@ -902,7 +902,7 @@ void TAD::add_event()
   args[2] = (char *) "EVENT/TAD";
   modify->add_fix(narg,args);
 
-  if (n_event_list == nmax_event_list) 
+  if (n_event_list == nmax_event_list)
     grow_event_list(nmax_event_list+nmin_event_list);
   n_event_list += 1;
   int ievent = n_event_list-1;
@@ -932,7 +932,7 @@ void TAD::compute_tlo(int ievent)
   double deltlo,delthi,ebarrier;
 
   ebarrier = fix_event_list[ievent]->ebarrier;
-  delthi = fix_event_list[ievent]->event_timestep 
+  delthi = fix_event_list[ievent]->event_timestep
     - fix_event->event_timestep;
   deltlo = delthi*exp(ebarrier*delta_beta);
   fix_event_list[ievent]->tlo = fix_event->tlo + deltlo;
@@ -952,29 +952,29 @@ void TAD::compute_tlo(int ievent)
   }
 
   // first-replica output about each event
-  
+
   timer->array[TIME_LOOP] = time_start;
   if (universe->me == 0) {
     double tfrac = 0.0;
     if (ievent > 0) tfrac = delthi/deltstop;
 
-    if (universe->uscreen) 
+    if (universe->uscreen)
       fprintf(universe->uscreen,
-	      BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
-	      fix_event_list[ievent]->event_timestep,
-	      timer->elapsed(TIME_LOOP),
-	      fix_event->event_number,
-	      ievent,statstr,ebarrier,tfrac,
-	      fix_event->tlo,deltlo);
-
-    if (universe->ulogfile) 
+              BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
+              fix_event_list[ievent]->event_timestep,
+              timer->elapsed(TIME_LOOP),
+              fix_event->event_number,
+              ievent,statstr,ebarrier,tfrac,
+              fix_event->tlo,deltlo);
+
+    if (universe->ulogfile)
       fprintf(universe->ulogfile,
-	      BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
-	      fix_event_list[ievent]->event_timestep,
-	      timer->elapsed(TIME_LOOP),
-	      fix_event->event_number,
-	      ievent,statstr,ebarrier,tfrac,
-	      fix_event->tlo,deltlo);
+              BIGINT_FORMAT " %.3f %d %d %s %.3f %.3f %.3f %.3f\n",
+              fix_event_list[ievent]->event_timestep,
+              timer->elapsed(TIME_LOOP),
+              fix_event->event_number,
+              ievent,statstr,ebarrier,tfrac,
+              fix_event->tlo,deltlo);
   }
 
 }
@@ -1014,8 +1014,7 @@ void TAD::perform_event(int ievent)
 
 void TAD::grow_event_list(int nmax) {
   if (nmax_event_list > nmax) return;
-  fix_event_list = (FixEventTAD **) 
+  fix_event_list = (FixEventTAD **)
     memory->srealloc(fix_event_list,nmax*sizeof(FixEventTAD *),"tad:eventlist");
   nmax_event_list = nmax;
 }
-
diff --git a/src/REPLICA/tad.h b/src/REPLICA/tad.h
index e5f1c38be8..8b370f1e94 100644
--- a/src/REPLICA/tad.h
+++ b/src/REPLICA/tad.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -148,7 +148,7 @@ The cummulative timesteps must fit in a 64-bit integer.
 
 E: Too many iterations
 
-You must use a number of iterations that fit in a 32-bit integer 
+You must use a number of iterations that fit in a 32-bit integer
 for minimization.
 
 */
diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp
index 32261989cb..f0e0a93190 100644
--- a/src/REPLICA/temper.cpp
+++ b/src/REPLICA/temper.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -63,11 +63,11 @@ Temper::~Temper()
 
 void Temper::command(int narg, char **arg)
 {
-  if (universe->nworlds == 1) 
+  if (universe->nworlds == 1)
     error->all(FLERR,"Must have more than one processor partition to temper");
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"Temper command before simulation box is defined");
-  if (narg != 6 && narg != 7) 
+  if (narg != 6 && narg != 7)
     error->universe_all(FLERR,"Illegal temper command");
 
   int nsteps = atoi(arg[0]);
@@ -76,7 +76,7 @@ void Temper::command(int narg, char **arg)
 
   for (whichfix = 0; whichfix < modify->nfix; whichfix++)
     if (strcmp(arg[3],modify->fix[whichfix]->id) == 0) break;
-  if (whichfix == modify->nfix) 
+  if (whichfix == modify->nfix)
     error->universe_all(FLERR,"Tempering fix ID is not defined");
 
   seed_swap = atoi(arg[4]);
@@ -87,10 +87,10 @@ void Temper::command(int narg, char **arg)
 
   // swap frequency must evenly divide total # of timesteps
 
-  if (nevery == 0) 
+  if (nevery == 0)
     error->universe_all(FLERR,"Invalid frequency in temper command");
   nswaps = nsteps/nevery;
-  if (nswaps*nevery != nsteps) 
+  if (nswaps*nevery != nsteps)
     error->universe_all(FLERR,"Non integer # of swaps in temper command");
 
   // fix style must be appropriate for temperature control
@@ -146,7 +146,7 @@ void Temper::command(int narg, char **arg)
   // world2root[i] = global proc that is root proc of world i
 
   world2root = new int[nworlds];
-  if (me == 0) 
+  if (me == 0)
     MPI_Allgather(&me_universe,1,MPI_INT,world2root,1,MPI_INT,roots);
   MPI_Bcast(world2root,nworlds,MPI_INT,0,world);
 
@@ -183,7 +183,7 @@ void Temper::command(int narg, char **arg)
   double pe,pe_partner,boltz_factor,new_temp;
   MPI_Status status;
 
-  if (me_universe == 0 && universe->uscreen) 
+  if (me_universe == 0 && universe->uscreen)
     fprintf(universe->uscreen,"Setting up tempering ...\n");
 
   update->integrate->setup();
@@ -192,13 +192,13 @@ void Temper::command(int narg, char **arg)
     if (universe->uscreen) {
       fprintf(universe->uscreen,"Step");
       for (int i = 0; i < nworlds; i++)
-	fprintf(universe->uscreen," T%d",i);
+        fprintf(universe->uscreen," T%d",i);
       fprintf(universe->uscreen,"\n");
     }
     if (universe->ulogfile) {
       fprintf(universe->ulogfile,"Step");
       for (int i = 0; i < nworlds; i++)
-	fprintf(universe->ulogfile," T%d",i);
+        fprintf(universe->ulogfile," T%d",i);
       fprintf(universe->ulogfile,"\n");
     }
     print_status();
@@ -208,11 +208,11 @@ void Temper::command(int narg, char **arg)
   timer->barrier_start(TIME_LOOP);
 
   for (int iswap = 0; iswap < nswaps; iswap++) {
-	
+
     // run for nevery timesteps
 
     update->integrate->run(nevery);
-	
+
     // compute PE
     // notify compute it will be called at next swap
 
@@ -251,29 +251,29 @@ void Temper::command(int narg, char **arg)
 
     swap = 0;
     if (partner != -1) {
-      if (me_universe > partner) 
-	MPI_Send(&pe,1,MPI_DOUBLE,partner,0,universe->uworld);
+      if (me_universe > partner)
+        MPI_Send(&pe,1,MPI_DOUBLE,partner,0,universe->uworld);
       else
-	MPI_Recv(&pe_partner,1,MPI_DOUBLE,partner,0,universe->uworld,&status);
+        MPI_Recv(&pe_partner,1,MPI_DOUBLE,partner,0,universe->uworld,&status);
 
       if (me_universe < partner) {
-	boltz_factor = (pe - pe_partner) * 
-	  (1.0/(boltz*set_temp[my_set_temp]) - 
-	   1.0/(boltz*set_temp[partner_set_temp]));
-	if (boltz_factor >= 0.0) swap = 1;
-	else if (ranboltz->uniform() < exp(boltz_factor)) swap = 1;
+        boltz_factor = (pe - pe_partner) *
+          (1.0/(boltz*set_temp[my_set_temp]) -
+           1.0/(boltz*set_temp[partner_set_temp]));
+        if (boltz_factor >= 0.0) swap = 1;
+        else if (ranboltz->uniform() < exp(boltz_factor)) swap = 1;
       }
 
-      if (me_universe < partner) 
-	MPI_Send(&swap,1,MPI_INT,partner,0,universe->uworld);
+      if (me_universe < partner)
+        MPI_Send(&swap,1,MPI_INT,partner,0,universe->uworld);
       else
-	MPI_Recv(&swap,1,MPI_INT,partner,0,universe->uworld,&status);
+        MPI_Recv(&swap,1,MPI_INT,partner,0,universe->uworld,&status);
 
 #ifdef TEMPER_DEBUG
       if (me_universe < partner)
-	printf("SWAP %d & %d: yes = %d,Ts = %d %d, PEs = %g %g, Bz = %g %g\n",
-	       me_universe,partner,swap,my_set_temp,partner_set_temp,
-	       pe,pe_partner,boltz_factor,exp(boltz_factor));
+        printf("SWAP %d & %d: yes = %d,Ts = %d %d, PEs = %g %g, Bz = %g %g\n",
+               me_universe,partner,swap,my_set_temp,partner_set_temp,
+               pe,pe_partner,boltz_factor,exp(boltz_factor));
 #endif
 
     }
@@ -285,7 +285,7 @@ void Temper::command(int narg, char **arg)
     // rescale kinetic energy via velocities if move is accepted
 
     if (swap) scale_velocities(partner_set_temp,my_set_temp);
-	
+
     // if my world swapped, all procs in world reset temp target of Fix
 
     if (swap) {
@@ -348,7 +348,7 @@ void Temper::print_status()
 {
   if (universe->uscreen) {
     fprintf(universe->uscreen,BIGINT_FORMAT,update->ntimestep);
-    for (int i = 0; i < nworlds; i++) 
+    for (int i = 0; i < nworlds; i++)
       fprintf(universe->uscreen," %d",world2temp[i]);
     fprintf(universe->uscreen,"\n");
   }
diff --git a/src/REPLICA/temper.h b/src/REPLICA/temper.h
index e61ee6711c..bde985d344 100644
--- a/src/REPLICA/temper.h
+++ b/src/REPLICA/temper.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/REPLICA/verlet_split.cpp b/src/REPLICA/verlet_split.cpp
index 4272cc2474..c8754ac681 100644
--- a/src/REPLICA/verlet_split.cpp
+++ b/src/REPLICA/verlet_split.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -46,11 +46,11 @@ VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) :
 {
   // error checks on partitions
 
-  if (universe->nworlds != 2) 
+  if (universe->nworlds != 2)
     error->universe_all(FLERR,"Verlet/split requires 2 partitions");
   if (universe->procs_per_world[0] % universe->procs_per_world[1])
     error->universe_all(FLERR,"Verlet/split requires Rspace partition "
-			"size be multiple of Kspace partition size");
+                        "size be multiple of Kspace partition size");
 
   // master = 1 for Rspace procs, 0 for Kspace procs
 
@@ -72,18 +72,18 @@ VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) :
 
   int ***kspace_grid2proc;
   memory->create(kspace_grid2proc,kspace_procgrid[0],
-		 kspace_procgrid[1],kspace_procgrid[2],
-		 "verlet/split:kspace_grid2proc");
+                 kspace_procgrid[1],kspace_procgrid[2],
+                 "verlet/split:kspace_grid2proc");
 
   if (universe->me == universe->root_proc[1]) {
     for (int i = 0; i < comm->procgrid[0]; i++)
       for (int j = 0; j < comm->procgrid[1]; j++)
-	for (int k = 0; k < comm->procgrid[2]; k++)
-	  kspace_grid2proc[i][j][k] = comm->grid2proc[i][j][k];
+        for (int k = 0; k < comm->procgrid[2]; k++)
+          kspace_grid2proc[i][j][k] = comm->grid2proc[i][j][k];
   }
   MPI_Bcast(&kspace_grid2proc[0][0][0],
-	    kspace_procgrid[0]*kspace_procgrid[1]*kspace_procgrid[2],MPI_INT,
-	    universe->root_proc[1],universe->uworld);
+            kspace_procgrid[0]*kspace_procgrid[1]*kspace_procgrid[2],MPI_INT,
+            universe->root_proc[1],universe->uworld);
 
   // Rspace partition must be multiple of Kspace partition in each dim
   // so atoms of one Kspace proc coincide with atoms of several Rspace procs
@@ -95,8 +95,8 @@ VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) :
     if (comm->procgrid[2] % kspace_procgrid[2]) flag = 1;
     if (flag)
       error->one(FLERR,
-		 "Verlet/split requires Rspace partition layout be "
-		 "multiple of Kspace partition layout in each dim");
+                 "Verlet/split requires Rspace partition layout be "
+                 "multiple of Kspace partition layout in each dim");
   }
 
   // block = 1 Kspace proc with set of Rspace procs it overlays
@@ -133,45 +133,45 @@ VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) :
   if (universe->me == 0) {
     if (universe->uscreen) {
       fprintf(universe->uscreen,
-	      "Per-block Rspace/Kspace proc IDs (original proc IDs):\n");
+              "Per-block Rspace/Kspace proc IDs (original proc IDs):\n");
       int m = 0;
       for (int i = 0; i < universe->nprocs/(ratio+1); i++) {
-	fprintf(universe->uscreen,"  block %d:",i);
-	int kspace_proc = bmapall[m];
-	for (int j = 1; j <= ratio; j++)
-	  fprintf(universe->uscreen," %d",bmapall[m+j]);
-	fprintf(universe->uscreen," %d",kspace_proc);
-	kspace_proc = bmapall[m];
-	for (int j = 1; j <= ratio; j++) {
-	  if (j == 1) fprintf(universe->uscreen," (");
-	  else fprintf(universe->uscreen," ");
-	  fprintf(universe->uscreen,"%d",
-		  universe->uni2orig[bmapall[m+j]]);
-	}
-	fprintf(universe->uscreen," %d)\n",universe->uni2orig[kspace_proc]);
-	m += ratio + 1;
+        fprintf(universe->uscreen,"  block %d:",i);
+        int kspace_proc = bmapall[m];
+        for (int j = 1; j <= ratio; j++)
+          fprintf(universe->uscreen," %d",bmapall[m+j]);
+        fprintf(universe->uscreen," %d",kspace_proc);
+        kspace_proc = bmapall[m];
+        for (int j = 1; j <= ratio; j++) {
+          if (j == 1) fprintf(universe->uscreen," (");
+          else fprintf(universe->uscreen," ");
+          fprintf(universe->uscreen,"%d",
+                  universe->uni2orig[bmapall[m+j]]);
+        }
+        fprintf(universe->uscreen," %d)\n",universe->uni2orig[kspace_proc]);
+        m += ratio + 1;
       }
     }
     if (universe->ulogfile) {
       fprintf(universe->ulogfile,
-	      "Per-block Rspace/Kspace proc IDs (original proc IDs):\n");
+              "Per-block Rspace/Kspace proc IDs (original proc IDs):\n");
       int m = 0;
       for (int i = 0; i < universe->nprocs/(ratio+1); i++) {
-	fprintf(universe->ulogfile,"  block %d:",i);
-	int kspace_proc = bmapall[m];
-	for (int j = 1; j <= ratio; j++)
-	  fprintf(universe->ulogfile," %d",bmapall[m+j]);
-
-	fprintf(universe->ulogfile," %d",kspace_proc);
-	kspace_proc = bmapall[m];
-	for (int j = 1; j <= ratio; j++) {
-	  if (j == 1) fprintf(universe->ulogfile," (");
-	  else fprintf(universe->ulogfile," ");
-	  fprintf(universe->ulogfile,"%d",
-		  universe->uni2orig[bmapall[m+j]]);
-	}
-	fprintf(universe->ulogfile," %d)\n",universe->uni2orig[kspace_proc]);
-	m += ratio + 1;
+        fprintf(universe->ulogfile,"  block %d:",i);
+        int kspace_proc = bmapall[m];
+        for (int j = 1; j <= ratio; j++)
+          fprintf(universe->ulogfile," %d",bmapall[m+j]);
+
+        fprintf(universe->ulogfile," %d",kspace_proc);
+        kspace_proc = bmapall[m];
+        for (int j = 1; j <= ratio; j++) {
+          if (j == 1) fprintf(universe->ulogfile," (");
+          else fprintf(universe->ulogfile," ");
+          fprintf(universe->ulogfile,"%d",
+                  universe->uni2orig[bmapall[m+j]]);
+        }
+        fprintf(universe->ulogfile," %d)\n",universe->uni2orig[kspace_proc]);
+        m += ratio + 1;
       }
     }
   }
@@ -213,7 +213,7 @@ VerletSplit::~VerletSplit()
 
 void VerletSplit::init()
 {
-  if (!force->kspace && comm->me == 0) 
+  if (!force->kspace && comm->me == 0)
     error->warning(FLERR,"No Kspace calculation with verlet/split");
 
   if (force->kspace_match("tip4p",0)) tip4p_flag = 1;
@@ -290,7 +290,7 @@ void VerletSplit::run(int n)
     ev_set(ntimestep);
 
     // initial time integration
- 
+
     if (master) {
       modify->initial_integrate(vflag);
       if (n_post_integrate) modify->post_integrate();
@@ -303,36 +303,36 @@ void VerletSplit::run(int n)
 
     if (master) {
       if (nflag == 0) {
-	timer->stamp();
-	comm->forward_comm();
-	timer->stamp(TIME_COMM);
+        timer->stamp();
+        comm->forward_comm();
+        timer->stamp(TIME_COMM);
       } else {
-	if (n_pre_exchange) modify->pre_exchange();
-	if (triclinic) domain->x2lamda(atom->nlocal);
-	domain->pbc();
-	if (domain->box_change) {
-	  domain->reset_box();
-	  comm->setup();
-	  if (neighbor->style) neighbor->setup_bins();
-	}
-	timer->stamp();
-	comm->exchange();
-	if (sortflag && ntimestep >= atom->nextsort) atom->sort();
-	comm->borders();
-	if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
-	timer->stamp(TIME_COMM);
-	if (n_pre_neighbor) modify->pre_neighbor();
-	neighbor->build();
-	timer->stamp(TIME_NEIGHBOR);
+        if (n_pre_exchange) modify->pre_exchange();
+        if (triclinic) domain->x2lamda(atom->nlocal);
+        domain->pbc();
+        if (domain->box_change) {
+          domain->reset_box();
+          comm->setup();
+          if (neighbor->style) neighbor->setup_bins();
+        }
+        timer->stamp();
+        comm->exchange();
+        if (sortflag && ntimestep >= atom->nextsort) atom->sort();
+        comm->borders();
+        if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
+        timer->stamp(TIME_COMM);
+        if (n_pre_neighbor) modify->pre_neighbor();
+        neighbor->build();
+        timer->stamp(TIME_NEIGHBOR);
       }
     }
-    
+
     // if reneighboring occurred, re-setup Rspace <-> Kspace comm params
     // comm Rspace atom coords to Kspace procs
 
     if (nflag) rk_setup();
     r2k_comm();
-  
+
     // force computations
 
     force_clear();
@@ -345,7 +345,7 @@ void VerletSplit::run(int n)
         force->pair->compute(eflag,vflag);
         timer->stamp(TIME_PAIR);
       }
-      
+
       if (atom->molecular) {
         if (force->bond) force->bond->compute(eflag,vflag);
         if (force->angle) force->angle->compute(eflag,vflag);
@@ -355,8 +355,8 @@ void VerletSplit::run(int n)
       }
 
       if (force->newton) {
-	comm->reverse_comm();
-	timer->stamp(TIME_COMM);
+        comm->reverse_comm();
+        timer->stamp(TIME_COMM);
       }
 
     } else {
@@ -369,8 +369,8 @@ void VerletSplit::run(int n)
       // TIP4P PPPM puts forces on ghost atoms, so must reverse_comm()
 
       if (tip4p_flag && force->newton) {
-	comm->reverse_comm();
-	timer->stamp(TIME_COMM);
+        comm->reverse_comm();
+        timer->stamp(TIME_COMM);
       }
     }
 
@@ -387,9 +387,9 @@ void VerletSplit::run(int n)
       if (n_end_of_step) modify->end_of_step();
 
       if (ntimestep == output->next) {
-	timer->stamp();
-	output->write(ntimestep);
-	timer->stamp(TIME_OUTPUT);
+        timer->stamp();
+        output->write(ntimestep);
+        timer->stamp(TIME_OUTPUT);
       }
     }
   }
@@ -424,7 +424,7 @@ void VerletSplit::rk_setup()
   // set Kspace nlocal to sum of Rspace nlocals
   // insure Kspace atom arrays are large enough
 
-  if (!master) { 
+  if (!master) {
     qsize[0] = qdisp[0] = xsize[0] = xdisp[0] = 0;
     for (int i = 1; i <= ratio; i++) {
       qdisp[i] = qdisp[i-1]+qsize[i-1];
@@ -436,7 +436,7 @@ void VerletSplit::rk_setup()
     while (atom->nmax <= atom->nlocal) atom->avec->grow(0);
     atom->nghost = 0;
   }
-  
+
   // one-time gather of Rspace atom charges to Kspace proc
 
   MPI_Gatherv(atom->q,n,MPI_DOUBLE,atom->q,qsize,qdisp,MPI_DOUBLE,0,block);
@@ -477,7 +477,7 @@ void VerletSplit::r2k_comm()
   int n = 0;
   if (master) n = atom->nlocal;
   MPI_Gatherv(atom->x[0],n*3,MPI_DOUBLE,atom->x[0],xsize,xdisp,
-	      MPI_DOUBLE,0,block);
+              MPI_DOUBLE,0,block);
 
   // send eflag,vflag from Rspace to Kspace
 
@@ -527,8 +527,8 @@ void VerletSplit::k2r_comm()
   int n = 0;
   if (master) n = atom->nlocal;
   MPI_Scatterv(atom->f[0],xsize,xdisp,MPI_DOUBLE,
-	       f_kspace[0],n*3,MPI_DOUBLE,0,block);
-  
+               f_kspace[0],n*3,MPI_DOUBLE,0,block);
+
   if (master) {
     double **f = atom->f;
     int nlocal = atom->nlocal;
diff --git a/src/REPLICA/verlet_split.h b/src/REPLICA/verlet_split.h
index 2819bac619..f109d47722 100644
--- a/src/REPLICA/verlet_split.h
+++ b/src/REPLICA/verlet_split.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -44,7 +44,7 @@ class VerletSplit : public Verlet {
 
   double **f_kspace;                 // copy of Kspace forces on Rspace procs
   int maxatom;
-  
+
   void rk_setup();
   void r2k_comm();
   void k2r_comm();
diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp
index 63d68ddaf4..66580c6bfa 100644
--- a/src/SHOCK/fix_append_atoms.cpp
+++ b/src/SHOCK/fix_append_atoms.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -67,37 +67,37 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
       error->all(FLERR,"Only zhi currently implemented for fix append/atoms");
       xloflag = 1;
       iarg++;
-      if (domain->boundary[0][0] != 3) 
-	error->all(FLERR,"Append boundary must be shrink/minimum");
+      if (domain->boundary[0][0] != 3)
+        error->all(FLERR,"Append boundary must be shrink/minimum");
     } else if (strcmp(arg[iarg],"xhi") == 0) {
       error->all(FLERR,"Only zhi currently implemented for fix append/atoms");
       xhiflag = 1;
       iarg++;
-      if (domain->boundary[0][1] != 3) 
-	error->all(FLERR,"Append boundary must be shrink/minimum");
+      if (domain->boundary[0][1] != 3)
+        error->all(FLERR,"Append boundary must be shrink/minimum");
     } else if (strcmp(arg[iarg],"ylo") == 0) {
       error->all(FLERR,"Only zhi currently implemented for fix append/atoms");
       yloflag = 1;
       iarg++;
-      if (domain->boundary[1][0] != 3) 
-	error->all(FLERR,"Append boundary must be shrink/minimum");
+      if (domain->boundary[1][0] != 3)
+        error->all(FLERR,"Append boundary must be shrink/minimum");
     } else if (strcmp(arg[iarg],"yhi") == 0) {
       error->all(FLERR,"Only zhi currently implemented for fix append/atoms");
       yhiflag = 1;
       iarg++;
-      if (domain->boundary[1][1] != 3) 
-	error->all(FLERR,"Append boundary must be shrink/minimum");
+      if (domain->boundary[1][1] != 3)
+        error->all(FLERR,"Append boundary must be shrink/minimum");
     } else if (strcmp(arg[iarg],"zlo") == 0) {
       error->all(FLERR,"Only zhi currently implemented for fix append/atoms");
       zloflag = 1;
       iarg++;
-      if (domain->boundary[2][0] != 3) 
-	error->all(FLERR,"Append boundary must be shrink/minimum");
+      if (domain->boundary[2][0] != 3)
+        error->all(FLERR,"Append boundary must be shrink/minimum");
     } else if (strcmp(arg[iarg],"zhi") == 0) {
       zhiflag = 1;
       iarg++;
-      if (domain->boundary[2][1] != 3) 
-	error->all(FLERR,"Append boundary must be shrink/minimum");
+      if (domain->boundary[2][1] != 3)
+        error->all(FLERR,"Append boundary must be shrink/minimum");
     } else if (strcmp(arg[iarg],"freq") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix append/atoms command");
       freq = atoi(arg[iarg+1]);
@@ -105,8 +105,8 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"spatial") == 0) {
       if (iarg+3 > narg) error->all(FLERR,"Illegal fix append/atoms command");
       if (strcmp(arg[iarg+1],"f_") == 0)
-	error->all(FLERR,
-		   "Bad fix ID in fix append/atoms command");
+        error->all(FLERR,
+                   "Bad fix ID in fix append/atoms command");
       spatflag = 1;
       int n = strlen(arg[iarg+1]);
       spatlead = atof(arg[iarg+2]);
@@ -162,7 +162,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) :
   if ((zloflag || zhiflag) && domain->zperiodic)
     error->all(FLERR,"Cannot use append/atoms in periodic dimension");
 
-  if (domain->triclinic == 1) 
+  if (domain->triclinic == 1)
     error->all(FLERR,"Cannot append atoms to a triclinic box");
 
   // setup scaling
@@ -223,7 +223,7 @@ void FixAppendAtoms::initial_integrate(int vflag)
 
 void FixAppendAtoms::setup(int vflag)
 {
-  /*** CALL TO CREATE GROUP?  SEE POST_FORCE ***/ 
+  /*** CALL TO CREATE GROUP?  SEE POST_FORCE ***/
   post_force(vflag);
 }
 
@@ -236,16 +236,16 @@ int FixAppendAtoms::get_spatial()
     int ifix = modify->find_fix(spatialid);
     if (ifix < 0)
       error->all(FLERR,"Fix ID for fix ave/spatial does not exist");
-    Fix *fix = modify->fix[ifix];  
+    Fix *fix = modify->fix[ifix];
 
-    int failed = 0; 
-    int count = 0; 
+    int failed = 0;
+    int count = 0;
     while (failed < 2) {
       double tmp = fix->compute_vector(2*count);
       if (tmp == 0.0) failed++;
       else failed = 0;
       count++;
-    } 
+    }
     double *pos = new double[count-2];
     double *val = new double[count-2];
     for (int loop=0; loop < count-2; loop++) {
@@ -255,7 +255,7 @@ int FixAppendAtoms::get_spatial()
 
     // always ignore the first and last
 
-    double binsize = 2.0; 
+    double binsize = 2.0;
     double min_energy=0.0;
     double max_energy=0.0;
     int header = static_cast<int> (size / binsize);
@@ -288,22 +288,22 @@ int FixAppendAtoms::get_spatial()
         front_found2=1;
       }
     }
-    if      (front_found1 + front_found2 == 0) shockfront_loc = 0.0; 
-    else if (front_found1 + front_found2 == 1) 
+    if      (front_found1 + front_found2 == 0) shockfront_loc = 0.0;
+    else if (front_found1 + front_found2 == 1)
       shockfront_loc = shockfront_max + shockfront_min;
-    else if (front_found1 == 1 && front_found2 == 1 && 
-	     shockfront_max-shockfront_min > spatlead/2.0) 
+    else if (front_found1 == 1 && front_found2 == 1 &&
+             shockfront_max-shockfront_min > spatlead/2.0)
       shockfront_loc = shockfront_max;
     else shockfront_loc = (shockfront_max + shockfront_min) / 2.0;
-    if (comm->me == 0) 
-      printf("SHOCK: %g %g %g %g %g\n", shockfront_loc, shockfront_min, 
-	     shockfront_max, domain->boxlo[2], domain->boxhi[2]);
+    if (comm->me == 0)
+      printf("SHOCK: %g %g %g %g %g\n", shockfront_loc, shockfront_min,
+             shockfront_max, domain->boxlo[2], domain->boxhi[2]);
 
     if (domain->boxhi[2] - shockfront_loc < spatlead) advance = 1;
 
     delete [] pos,val;
   }
-  
+
   advance_sum = 0;
   MPI_Allreduce(&advance,&advance_sum,1,MPI_INT,MPI_SUM,world);
 
@@ -394,12 +394,12 @@ void FixAppendAtoms::pre_exchange()
   int addnode = 0;
 
   if (ntimestep % freq == 0) {
-    if (spatflag==1) if (get_spatial()==0) return; 
+    if (spatflag==1) if (get_spatial()==0) return;
     if (comm->myloc[2] == comm->procgrid[2]-1) {
       if (domain->lattice) {
-	nbasis = domain->lattice->nbasis;
-	basistype = new int[nbasis];
-	for (int i = 0; i < nbasis; i++) basistype[i] = 1;
+        nbasis = domain->lattice->nbasis;
+        basistype = new int[nbasis];
+        for (int i = 0; i < nbasis; i++) basistype[i] = 1;
       } else error->all(FLERR,"Must define lattice to append/atoms");
 
       double bboxlo[3],bboxhi[3];
@@ -413,21 +413,21 @@ void FixAppendAtoms::pre_exchange()
       xmax = ymax = zmax = -BIG;
 
       domain->lattice->bbox(1,bboxlo[0],bboxlo[1],bboxlo[2],
-			    xmin,ymin,zmin,xmax,ymax,zmax);
+                            xmin,ymin,zmin,xmax,ymax,zmax);
       domain->lattice->bbox(1,bboxhi[0],bboxlo[1],bboxlo[2],
-			    xmin,ymin,zmin,xmax,ymax,zmax);
+                            xmin,ymin,zmin,xmax,ymax,zmax);
       domain->lattice->bbox(1,bboxlo[0],bboxhi[1],bboxlo[2],
-			    xmin,ymin,zmin,xmax,ymax,zmax);
+                            xmin,ymin,zmin,xmax,ymax,zmax);
       domain->lattice->bbox(1,bboxhi[0],bboxhi[1],bboxlo[2],
-			    xmin,ymin,zmin,xmax,ymax,zmax);
+                            xmin,ymin,zmin,xmax,ymax,zmax);
       domain->lattice->bbox(1,bboxlo[0],bboxlo[1],bboxhi[2],
-			    xmin,ymin,zmin,xmax,ymax,zmax);
+                            xmin,ymin,zmin,xmax,ymax,zmax);
       domain->lattice->bbox(1,bboxhi[0],bboxlo[1],bboxhi[2],
-			    xmin,ymin,zmin,xmax,ymax,zmax);
+                            xmin,ymin,zmin,xmax,ymax,zmax);
       domain->lattice->bbox(1,bboxlo[0],bboxhi[1],bboxhi[2],
-			    xmin,ymin,zmin,xmax,ymax,zmax);
+                            xmin,ymin,zmin,xmax,ymax,zmax);
       domain->lattice->bbox(1,bboxhi[0],bboxhi[1],bboxhi[2],
-			    xmin,ymin,zmin,xmax,ymax,zmax);
+                            xmin,ymin,zmin,xmax,ymax,zmax);
 
       int ilo,ihi,jlo,jhi,klo,khi;
       ilo = static_cast<int> (xmin);
@@ -449,36 +449,36 @@ void FixAppendAtoms::pre_exchange()
 
       int i,j,k,m;
       for (k = klo; k <= khi; k++) {
-	for (j = jlo; j <= jhi; j++) {
-	  for (i = ilo; i <= ihi; i++) {
-	    for (m = 0; m < nbasis; m++) {
-	      x[0] = i + basis[m][0];
-	      x[1] = j + basis[m][1];
-	      x[2] = k + basis[m][2];
-
-	      int flag = 0;
-	      // convert from lattice coords to box coords
-	      domain->lattice->lattice2box(x[0],x[1],x[2]);
-
-	      if (x[0] >= sublo[0] && x[0] < subhi[0] &&
-		  x[1] >= sublo[1] && x[1] < subhi[1] &&
-		  x[2] >= subhi[2] && x[2] < subhi[2]+size) flag = 1;
-	      else if (domain->dimension == 2 && x[1] >= domain->boxhi[1] &&
-		       comm->myloc[1] == comm->procgrid[1]-1 &&
-		       x[0] >= sublo[0] && x[0] < subhi[0]) flag = 1;
-
-	      if (flag) {
-		if (ranflag) {
-		  x[0] += ranx * 2.0*(randomx->uniform()-0.5);
-		  x[1] += rany * 2.0*(randomx->uniform()-0.5);
-		  x[2] += ranz * 2.0*(randomx->uniform()-0.5);
-		}
+        for (j = jlo; j <= jhi; j++) {
+          for (i = ilo; i <= ihi; i++) {
+            for (m = 0; m < nbasis; m++) {
+              x[0] = i + basis[m][0];
+              x[1] = j + basis[m][1];
+              x[2] = k + basis[m][2];
+
+              int flag = 0;
+              // convert from lattice coords to box coords
+              domain->lattice->lattice2box(x[0],x[1],x[2]);
+
+              if (x[0] >= sublo[0] && x[0] < subhi[0] &&
+                  x[1] >= sublo[1] && x[1] < subhi[1] &&
+                  x[2] >= subhi[2] && x[2] < subhi[2]+size) flag = 1;
+              else if (domain->dimension == 2 && x[1] >= domain->boxhi[1] &&
+                       comm->myloc[1] == comm->procgrid[1]-1 &&
+                       x[0] >= sublo[0] && x[0] < subhi[0]) flag = 1;
+
+              if (flag) {
+                if (ranflag) {
+                  x[0] += ranx * 2.0*(randomx->uniform()-0.5);
+                  x[1] += rany * 2.0*(randomx->uniform()-0.5);
+                  x[2] += ranz * 2.0*(randomx->uniform()-0.5);
+                }
                 addnode++;
-		atom->avec->create_atom(basistype[m],x);
-	      }
-	    }
-	  }
-	}
+                atom->avec->create_atom(basistype[m],x);
+              }
+            }
+          }
+        }
       }
     }
     int addtotal = 0;
@@ -488,13 +488,13 @@ void FixAppendAtoms::pre_exchange()
     if (addtotal) {
       domain->reset_box();
       if (atom->tag_enable) {
-	atom->tag_extend();
-	atom->natoms += addtotal;
-	if (atom->map_style) {
-	  atom->nghost = 0;
-	  atom->map_init();
-	  atom->map_set();
-	}
+        atom->tag_extend();
+        atom->natoms += addtotal;
+        if (atom->map_style) {
+          atom->nghost = 0;
+          atom->map_init();
+          atom->map_set();
+        }
       }
     }
   }
diff --git a/src/SHOCK/fix_append_atoms.h b/src/SHOCK/fix_append_atoms.h
index 6d8801be01..d22abbfcb3 100644
--- a/src/SHOCK/fix_append_atoms.h
+++ b/src/SHOCK/fix_append_atoms.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -70,7 +70,7 @@ Self-explanatory.
 E: Append boundary must be shrink/minimum
 
 The boundary style of the face where atoms are added
-must be of type m (shrink/minimum). 
+must be of type m (shrink/minimum).
 
 E: Bad fix ID in fix append/atoms command
 
diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp
index 04d207880d..3ee57d060f 100644
--- a/src/SHOCK/fix_msst.cpp
+++ b/src/SHOCK/fix_msst.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -18,7 +18,7 @@
 ------------------------------------------------------------------------- */
 
 #include "string.h"
-#include "stdlib.h" 
+#include "stdlib.h"
 #include "math.h"
 #include "fix_msst.h"
 #include "atom.h"
@@ -68,7 +68,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
   p0_set = 0;
   v0_set = 0;
   e0_set = 0;
-  tscale = 0.01; 
+  tscale = 0.01;
 
   if ( strcmp(arg[3],"x") == 0 )
     direction = 0;
@@ -80,7 +80,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
     error->all(FLERR,"Illegal fix msst command");
   }
 
-  velocity = atof(arg[4]);   
+  velocity = atof(arg[4]);
   if ( velocity < 0 )
     error->all(FLERR,"Illegal fix msst command");
 
@@ -106,7 +106,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
     } else if ( strcmp(arg[iarg],"tscale") == 0 ) {
       tscale = atof(arg[iarg+1]);
       if (tscale < 0.0 || tscale > 1.0)
-	error->all(FLERR,"Fix msst tscale must satisfy 0 <= tscale < 1");
+        error->all(FLERR,"Fix msst tscale must satisfy 0 <= tscale < 1");
       iarg++;
     } else error->all(FLERR,"Illegal fix msst command");
   }
@@ -118,21 +118,21 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
       else if (direction == 1) fprintf(screen,"  Shock in y direction\n");
       else if (direction == 2) fprintf(screen,"  Shock in z direction\n");
       fprintf(screen,"  Cell mass-like parameter qmass "
-	      "(units of mass^2/length^4) = %12.5e\n", qmass);
+              "(units of mass^2/length^4) = %12.5e\n", qmass);
       fprintf(screen,"  Shock velocity = %12.5e\n", velocity);
       fprintf(screen,"  Artificial viscosity "
-	      "(units of mass/length/time) = %12.5e\n", mu);
-      
+              "(units of mass/length/time) = %12.5e\n", mu);
+
       if (p0_set)
-	fprintf(screen,"  Initial pressure specified to be %12.5e\n", p0);
+        fprintf(screen,"  Initial pressure specified to be %12.5e\n", p0);
       else fprintf(screen,"  Initial pressure calculated on first step\n");
-      
+
       if (v0_set)
-	fprintf(screen,"  Initial volume specified to be %12.5e\n", v0);
+        fprintf(screen,"  Initial volume specified to be %12.5e\n", v0);
       else fprintf(screen,"  Initial volume calculated on first step\n");
-      
-      if (e0_set) 
-	fprintf(screen,"  Initial energy specified to be %12.5e\n", e0);
+
+      if (e0_set)
+        fprintf(screen,"  Initial energy specified to be %12.5e\n", e0);
       else fprintf(screen,"  Initial energy calculated on first step\n");
     }
     if (logfile) {
@@ -141,21 +141,21 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
       else if (direction == 1) fprintf(logfile,"  Shock in y direction\n");
       else if (direction == 2) fprintf(logfile,"  Shock in z direction\n");
       fprintf(logfile,"  Cell mass-like parameter qmass "
-	      "(units of mass^2/length^4) = %12.5e\n", qmass);
+              "(units of mass^2/length^4) = %12.5e\n", qmass);
       fprintf(logfile,"  Shock velocity = %12.5e\n", velocity);
       fprintf(logfile,"  Artificial viscosity "
-	      "(units of mass/length/time) = %12.5e\n", mu);
-      
-      if (p0_set) 
-	fprintf(logfile,"  Initial pressure specified to be %12.5e\n", p0);
+              "(units of mass/length/time) = %12.5e\n", mu);
+
+      if (p0_set)
+        fprintf(logfile,"  Initial pressure specified to be %12.5e\n", p0);
       else fprintf(logfile,"  Initial pressure calculated on first step\n");
-      
-      if (v0_set) 
-	fprintf(logfile,"  Initial volume specified to be %12.5e\n", v0);
+
+      if (v0_set)
+        fprintf(logfile,"  Initial volume specified to be %12.5e\n", v0);
       else fprintf(logfile,"  Initial volume calculated on first step\n");
-      
-      if (e0_set) 
-	fprintf(logfile,"  Initial energy specified to be %12.5e\n", e0);
+
+      if (e0_set)
+        fprintf(logfile,"  Initial energy specified to be %12.5e\n", e0);
       else fprintf(logfile,"  Initial energy calculated on first step\n");
     }
   }
@@ -217,7 +217,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) :
 
   // initialize the time derivative of the volume.
   omega[0] = omega[1] = omega[2] = 0.0;
-  
+
   nrigid = 0;
   rfix = NULL;
 
@@ -313,19 +313,19 @@ void FixMSST::init()
 
   for (int i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"rigid") == 0 ||
-	strcmp(modify->fix[i]->style,"poems") == 0) nrigid++;
+        strcmp(modify->fix[i]->style,"poems") == 0) nrigid++;
   if (nrigid) {
     rfix = new int[nrigid];
     nrigid = 0;
     for (int i = 0; i < modify->nfix; i++)
       if (strcmp(modify->fix[i]->style,"rigid") == 0 ||
-	  strcmp(modify->fix[i]->style,"poems") == 0) rfix[nrigid++] = i;
+          strcmp(modify->fix[i]->style,"poems") == 0) rfix[nrigid++] = i;
   }
 
 }
 
 /* ----------------------------------------------------------------------
-   compute T,P before integrator starts 
+   compute T,P before integrator starts
 ------------------------------------------------------------------------- */
 
 void FixMSST::setup(int vflag)
@@ -344,7 +344,7 @@ void FixMSST::setup(int vflag)
       if ( screen ) fprintf(screen,"Fix MSST v0 = %12.5e\n", v0);
       if ( logfile ) fprintf(logfile,"Fix MSST v0 = %12.5e\n", v0);
     }
-  } 
+  }
 
   if ( p0_set == 0 ) {
     p0 = p_current[direction];
@@ -370,10 +370,10 @@ void FixMSST::setup(int vflag)
   temperature->compute_vector();
   double *ke_tensor = temperature->vector;
   double ke_temp = ke_tensor[0]+ke_tensor[1]+ke_tensor[2];
-  if (ke_temp > 0.0 && tscale > 0.0 ) { 
+  if (ke_temp > 0.0 && tscale > 0.0 ) {
 
     // transfer energy from atom velocities to cell volume motion
-    // to bias initial compression 
+    // to bias initial compression
 
     double **v = atom->v;
     int *mask = atom->mask;
@@ -386,22 +386,22 @@ void FixMSST::setup(int vflag)
 
     if ( comm->me == 0 && tscale != 1.0) {
       if ( screen )
-	fprintf(screen,"Fix MSST initial strain rate of %12.5e established "
-		"by reducing temperature by factor of %12.5e\n",
-		fac2,tscale);
+        fprintf(screen,"Fix MSST initial strain rate of %12.5e established "
+                "by reducing temperature by factor of %12.5e\n",
+                fac2,tscale);
       if ( logfile )
-	fprintf(logfile,"Fix MSST initial strain rate of %12.5e established "
-		"by reducing temperature by factor of %12.5e\n",
-		fac2,tscale);
+        fprintf(logfile,"Fix MSST initial strain rate of %12.5e established "
+                "by reducing temperature by factor of %12.5e\n",
+                fac2,tscale);
     }
     for (int i = 0; i < atom->nlocal; i++) {
       if (mask[i] & groupbit) {
         for (int k = 0; k < 3; k++ ) {
           v[i][k]*=sqrt_initial_temperature_scaling;
-	}
+        }
       }
     }
-  } 
+  }
 
   // trigger virial computation on next timestep
 
@@ -409,7 +409,7 @@ void FixMSST::setup(int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   1st half of Verlet update 
+   1st half of Verlet update
 ------------------------------------------------------------------------- */
 
 void FixMSST::initial_integrate(int vflag)
@@ -417,7 +417,7 @@ void FixMSST::initial_integrate(int vflag)
   int sd;
   double p_msst;                // MSST driving pressure.
   int i, k;
-  double vol;                   
+  double vol;
   int nlocal = atom->nlocal;
   int *mask = atom->mask;
   double **v = atom->v;
@@ -438,12 +438,12 @@ void FixMSST::initial_integrate(int vflag)
   couple();
   vol = compute_vol();
 
-  // propagate the time derivative of 
+  // propagate the time derivative of
   // the volume 1/2 step at fixed vol, r, rdot.
 
   p_msst = nktv2p * mvv2e * velocity * velocity * total_mass *
     ( v0 - vol)/( v0 * v0);
-  double A = total_mass * ( p_current[sd] - p0 - p_msst ) / 
+  double A = total_mass * ( p_current[sd] - p0 - p_msst ) /
     (qmass * nktv2p * mvv2e);
   double B = total_mass * mu / ( qmass * vol );
 
@@ -456,34 +456,34 @@ void FixMSST::initial_integrate(int vflag)
   // use taylor expansion to avoid singularity at B == 0.
 
   if ( B * dthalf > 1.0e-06 ) {
-    omega[sd] = ( omega[sd] + A * ( exp(B * dthalf) - 1.0 ) / B ) 
+    omega[sd] = ( omega[sd] + A * ( exp(B * dthalf) - 1.0 ) / B )
       * exp(-B * dthalf);
   } else {
     omega[sd] = omega[sd] + (A - B * omega[sd]) * dthalf +
       0.5 * (B * B * omega[sd] - A * B ) * dthalf * dthalf;
   }
-		  
-  // propagate velocity sum 1/2 step by 
+
+  // propagate velocity sum 1/2 step by
   // temporarily propagating the velocities.
 
   velocity_sum = compute_vsum();
   for (i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
       for ( k = 0; k < 3; k++ ) {
-	double C = f[i][k] * force->ftm2v / mass[type[i]];
-	double D = mu * omega[sd] * omega[sd] / 
-	  (velocity_sum * mass[type[i]] * vol );
-	old_velocity[i][k] = v[i][k];
-	if ( k == direction ) {
-	  D = D - 2.0 * omega[sd] / vol;
-	}
-	if ( fabs(dthalf * D) > 1.0e-06 ) {
-	  double expd = exp(D * dthalf);
-	  v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
-	} else {
-	  v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
-	    0.5 * (D * D * v[i][k] + C * D ) * dthalf * dthalf;
-	}
+        double C = f[i][k] * force->ftm2v / mass[type[i]];
+        double D = mu * omega[sd] * omega[sd] /
+          (velocity_sum * mass[type[i]] * vol );
+        old_velocity[i][k] = v[i][k];
+        if ( k == direction ) {
+          D = D - 2.0 * omega[sd] / vol;
+        }
+        if ( fabs(dthalf * D) > 1.0e-06 ) {
+          double expd = exp(D * dthalf);
+          v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
+        } else {
+          v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
+            0.5 * (D * D * v[i][k] + C * D ) * dthalf * dthalf;
+        }
       }
     }
   }
@@ -494,7 +494,7 @@ void FixMSST::initial_integrate(int vflag)
   for (i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
       for ( k = 0; k < 3; k++ ) {
-	v[i][k] = old_velocity[i][k];
+        v[i][k] = old_velocity[i][k];
       }
     }
   }
@@ -504,23 +504,23 @@ void FixMSST::initial_integrate(int vflag)
   for (i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
       for ( k = 0; k < 3; k++ ) {
-	double C = f[i][k] * force->ftm2v / mass[type[i]];
-	double D = mu * omega[sd] * omega[sd] / 
-	  (velocity_sum * mass[type[i]] * vol );
-	if ( k == direction ) {
-	  D = D - 2.0 * omega[sd] / vol;
-	}
-	if ( fabs(dthalf * D) > 1.0e-06 ) {
-	  double expd = exp(D * dthalf);
-	  v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
-	} else {
-	  v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
-	    0.5 * (D * D * v[i][k] + C * D ) * dthalf * dthalf;
-	}
+        double C = f[i][k] * force->ftm2v / mass[type[i]];
+        double D = mu * omega[sd] * omega[sd] /
+          (velocity_sum * mass[type[i]] * vol );
+        if ( k == direction ) {
+          D = D - 2.0 * omega[sd] / vol;
+        }
+        if ( fabs(dthalf * D) > 1.0e-06 ) {
+          double expd = exp(D * dthalf);
+          v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
+        } else {
+          v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
+            0.5 * (D * D * v[i][k] + C * D ) * dthalf * dthalf;
+        }
       }
     }
   }
-  
+
   // propagate the volume 1/2 step.
 
   double vol1 = vol + omega[sd] * dthalf;
@@ -539,7 +539,7 @@ void FixMSST::initial_integrate(int vflag)
       x[i][2] += dtv * v[i][2];
     }
   }
-  
+
   // propagate the volume 1/2 step.
 
   double vol2 = vol1 + omega[sd] * dthalf;
@@ -553,7 +553,7 @@ void FixMSST::initial_integrate(int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   2nd half of Verlet update 
+   2nd half of Verlet update
 ------------------------------------------------------------------------- */
 
 void FixMSST::final_integrate()
@@ -577,19 +577,19 @@ void FixMSST::final_integrate()
   for (i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
       for ( int k = 0; k < 3; k++ ) {
-	double C = f[i][k] * force->ftm2v / mass[type[i]];
-	double D = mu * omega[sd] * omega[sd] / 
-	  (velocity_sum * mass[type[i]] * vol );
-	if ( k == direction ) {
-	  D = D - 2.0 * omega[sd] / vol;
-	}
-	if ( fabs(dthalf * D) > 1.0e-06 ) {
-	  double expd = exp(D * dthalf);
-	  v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
-	} else {
-	  v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
-	    0.5 * (D * D * v[i][k] + C * D ) * dthalf * dthalf;
-	}
+        double C = f[i][k] * force->ftm2v / mass[type[i]];
+        double D = mu * omega[sd] * omega[sd] /
+          (velocity_sum * mass[type[i]] * vol );
+        if ( k == direction ) {
+          D = D - 2.0 * omega[sd] / vol;
+        }
+        if ( fabs(dthalf * D) > 1.0e-06 ) {
+          double expd = exp(D * dthalf);
+          v[i][k] = expd * ( C + D * v[i][k] - C / expd ) / D;
+        } else {
+          v[i][k] = v[i][k] + ( C + D * v[i][k] ) * dthalf +
+            0.5 * (D * D * v[i][k] + C * D ) * dthalf * dthalf;
+        }
       }
     }
   }
@@ -607,7 +607,7 @@ void FixMSST::final_integrate()
 
   p_msst = nktv2p * mvv2e * velocity * velocity * total_mass *
     ( v0 - vol )/( v0 * v0 );
-  double A = total_mass * ( p_current[sd] - p0 - p_msst ) / 
+  double A = total_mass * ( p_current[sd] - p0 - p_msst ) /
     ( qmass * nktv2p * mvv2e );
   double B = total_mass * mu  / ( qmass * vol );
 
@@ -620,12 +620,12 @@ void FixMSST::final_integrate()
   // use taylor expansion to avoid singularity at B == 0.
 
   if ( B * dthalf > 1.0e-06 ) {
-    omega[sd] = ( omega[sd] + A * 
-		  ( exp(B * dthalf) - 1.0 ) / B ) * exp(-B * dthalf);
+    omega[sd] = ( omega[sd] + A *
+                  ( exp(B * dthalf) - 1.0 ) / B ) * exp(-B * dthalf);
   } else {
     omega[sd] = omega[sd] + (A - B * omega[sd]) * dthalf +
       0.5 * (B * B * omega[sd] - A * B ) * dthalf * dthalf;
-  }  
+  }
 
   // calculate Lagrangian position of computational cell
 
@@ -694,13 +694,13 @@ void FixMSST::remap(int flag)
       modify->fix[rfix[i]]->deform(1);
 
   for (i = 0; i < n; i++) {
-    v[i][direction] = v[i][direction] * 
+    v[i][direction] = v[i][direction] *
       dilation[direction];
   }
 }
 
 /* ----------------------------------------------------------------------
-   pack entire state of Fix into one write 
+   pack entire state of Fix into one write
 ------------------------------------------------------------------------- */
 
 void FixMSST::write_restart(FILE *fp)
@@ -719,7 +719,7 @@ void FixMSST::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix 
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixMSST::restart(char *buf)
@@ -800,7 +800,7 @@ double FixMSST::compute_scalar()
 
   i = direction;
   energy = qmass * omega[i] * omega[i] / (2.0 * total_mass) * mvv2e;
-  energy -= 0.5 * total_mass * velocity * velocity * 
+  energy -= 0.5 * total_mass * velocity * velocity *
     (1.0 - volume/ v0) *
     (1.0 - volume/ v0) * mvv2e;
   energy -= p0 * ( v0 - volume ) / nktv2p;
@@ -809,7 +809,7 @@ double FixMSST::compute_scalar()
 }
 
 /* ----------------------------------------------------------------------
-   return a single element from the following vector, 
+   return a single element from the following vector,
    [dhug,dray,lgr_vel,lgr_pos]
 ------------------------------------------------------------------------- */
 
@@ -828,7 +828,7 @@ double FixMSST::compute_vector(int n)
 }
 
 /* ----------------------------------------------------------------------
-   Computes the deviation of the current point 
+   Computes the deviation of the current point
    from the Hugoniot in Kelvin for the MSST.
 ------------------------------------------------------------------------- */
 
@@ -836,24 +836,24 @@ double FixMSST::compute_hugoniot()
 {
   double v, e, p;
   double dhugo;
-  
+
   e = compute_etotal();
-  
+
   temperature->compute_vector();
   pressure->compute_vector();
   p = pressure->vector[direction];
-  
+
   v = compute_vol();
-  
-  dhugo = (0.5 * (p + p0 ) * ( v0 - v)) / 
+
+  dhugo = (0.5 * (p + p0 ) * ( v0 - v)) /
     force->nktv2p + e0 - e;
   dhugo /= temperature->dof * force->boltz;
-  
+
   return dhugo;
 }
 
 /* ----------------------------------------------------------------------
-   Computes the deviation of the current point from the Rayleigh 
+   Computes the deviation of the current point from the Rayleigh
    in pressure units for the MSST.
 ------------------------------------------------------------------------- */
 
@@ -876,7 +876,7 @@ double FixMSST::compute_rayleigh()
 }
 
 /* ----------------------------------------------------------------------
-   Computes the speed of the MSST computational cell in the 
+   Computes the speed of the MSST computational cell in the
    unshocked material rest-frame
 ------------------------------------------------------------------------- */
 
@@ -887,7 +887,7 @@ double FixMSST::compute_lagrangian_speed()
 }
 
 /* ----------------------------------------------------------------------
-   Computes the distance behind the 
+   Computes the distance behind the
    shock front of the MSST computational cell.
 ------------------------------------------------------------------------- */
 
@@ -958,4 +958,3 @@ double FixMSST::compute_vsum()
   MPI_Allreduce(&t,&vsum,1,MPI_DOUBLE,MPI_SUM,world);
   return vsum;
 }
-
diff --git a/src/SHOCK/fix_msst.h b/src/SHOCK/fix_msst.h
index 26ce3b1c9f..13eed1828e 100644
--- a/src/SHOCK/fix_msst.h
+++ b/src/SHOCK/fix_msst.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -52,9 +52,9 @@ class FixMSST : public Fix {
   double p_current[3],dilation[3];
   double qmass;                    // Effective cell mass.
   double mu;                       // Effective cell viscosity.
-  double tscale;                   // Converts thermal energy to compressive 
+  double tscale;                   // Converts thermal energy to compressive
                                    // strain ke at simulation start
-  
+
   double velocity_sum;             // Sum of the velocities squared.
 
   double **old_velocity;           // Saved velocities.
@@ -66,7 +66,7 @@ class FixMSST : public Fix {
   char *id_temp,*id_press;         // Strings with identifiers of
   char *id_pe;                     // created computes.
 
-  class Compute *temperature;      // Computes created to evaluate 
+  class Compute *temperature;      // Computes created to evaluate
   class Compute *pressure;         // thermodynamic quantities.
   class Compute *pe;
   int tflag,pflag,vsflag,peflag;   // Flags to keep track of computes that
@@ -78,15 +78,15 @@ class FixMSST : public Fix {
   double v0;                       // Initial volume
   double p0;                       // Initial pressure
   double velocity;                 // Velocity of the shock.
-  double lagrangian_position;      // Lagrangian location of computational cell  
+  double lagrangian_position;      // Lagrangian location of computational cell
   int direction;                   // Direction of shock
   int p0_set;                      // Is pressure set.
   int v0_set;                      // Is volume set.
   int e0_set;                      // Is energy set.
-    
+
   int atoms_allocated;             // The number of allocated atoms in old_velocity.
 
-  // functions 
+  // functions
 
   void couple();
   void remap(int);
diff --git a/src/SHOCK/fix_nphug.cpp b/src/SHOCK/fix_nphug.cpp
index ed3c8f74e2..48b33db4e6 100644
--- a/src/SHOCK/fix_nphug.cpp
+++ b/src/SHOCK/fix_nphug.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -59,7 +59,7 @@ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) :
   // check pressure settings
 
   if (p_start[0] != p_stop[0] ||
-      p_start[1] != p_stop[1] ||  
+      p_start[1] != p_stop[1] ||
       p_start[2] != p_stop[2])
     error->all(FLERR,"Pstart and Pstop must have the same value");
 
@@ -78,22 +78,22 @@ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) :
 
     // anisotropic hydrostatic compression
 
-    if (p_start[0] == p_start[1] &&  
-	p_start[0] == p_start[2] )
+    if (p_start[0] == p_start[1] &&
+        p_start[0] == p_start[2] )
       uniaxial = 0;
 
     // uniaxial compression
 
-    else if (p_flag[0] == 1 && p_flag[1] == 0 
-	&& p_flag[2] == 0) {
+    else if (p_flag[0] == 1 && p_flag[1] == 0
+        && p_flag[2] == 0) {
       uniaxial = 1;
       idir = 0;
-    } else if (p_flag[0] == 0 && p_flag[1] == 1 
-	   && p_flag[2] == 0) {
+    } else if (p_flag[0] == 0 && p_flag[1] == 1
+           && p_flag[2] == 0) {
       uniaxial = 1;
       idir = 1;
-    } else if (p_flag[0] == 0 && p_flag[1] == 0 
-	       && p_flag[2] == 1) {
+    } else if (p_flag[0] == 0 && p_flag[1] == 0
+               && p_flag[2] == 1) {
       uniaxial = 1;
       idir = 2;
 
@@ -103,11 +103,11 @@ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) :
 
   } else if (pstyle == TRICLINIC) {
 
-    if (p_start[0] == p_start[1] &&  
-	p_start[0] == p_start[2] &&
-	p_start[3] == 0.0 &&  
-	p_start[4] == 0.0 &&  
-	p_start[5] == 0.0 )
+    if (p_start[0] == p_start[1] &&
+        p_start[0] == p_start[2] &&
+        p_start[3] == 0.0 &&
+        p_start[4] == 0.0 &&
+        p_start[5] == 0.0 )
       uniaxial = 0;
 
     else error->all(FLERR,"For triclinic deformation, specified target stress must be hydrostatic");
@@ -127,7 +127,7 @@ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = (char *) "all";
@@ -145,7 +145,7 @@ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) :
   id_press = new char[n];
   strcpy(id_press,id);
   strcat(id_press,"_press");
-  
+
   newarg = new char*[4];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";
@@ -195,14 +195,14 @@ void FixNPHug::init()
   // set pe ptr
 
   int icompute = modify->find_compute(id_pe);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Potential energy ID for fix nvt/nph/npt does not exist");
   pe = modify->compute[icompute];
 }
 
 
 /* ----------------------------------------------------------------------
-   compute initial state before integrator starts 
+   compute initial state before integrator starts
 ------------------------------------------------------------------------- */
 
 void FixNPHug::setup(int vflag)
@@ -212,7 +212,7 @@ void FixNPHug::setup(int vflag)
   if ( v0_set == 0 ) {
     v0 = compute_vol();
     v0_set = 1;
-  } 
+  }
 
   if ( p0_set == 0 ) {
     p0_set = 1;
@@ -270,7 +270,7 @@ double FixNPHug::compute_vol()
 }
 
 /* ----------------------------------------------------------------------
-   Computes the deviation of the current point 
+   Computes the deviation of the current point
    from the Hugoniot in temperature units.
 ------------------------------------------------------------------------- */
 
@@ -278,21 +278,21 @@ double FixNPHug::compute_hugoniot()
 {
   double v,e,p;
   double dhugo;
-  
+
   e = compute_etotal();
-  
+
   temperature->compute_vector();
 
 
   if (uniaxial == 1) {
     pressure->compute_vector();
     p = pressure->vector[idir];
-  } else 
+  } else
     p = pressure->compute_scalar();
-  
+
   v = compute_vol();
-  
-  dhugo = (0.5 * (p + p0 ) * ( v0 - v)) / 
+
+  dhugo = (0.5 * (p + p0 ) * ( v0 - v)) /
     force->nktv2p + e0 - e;
 
   dhugo /= tdof * boltz;
@@ -308,24 +308,24 @@ double FixNPHug::compute_us()
 {
   double v,p;
   double eps,us;
-  
+
   temperature->compute_vector();
 
   if (uniaxial == 1) {
     pressure->compute_vector();
     p = pressure->vector[idir];
-  } else 
+  } else
     p = pressure->compute_scalar();
-  
+
   v = compute_vol();
-  
+
   // Us^2 = (p-p0)/(rho0*eps)
 
   eps = 1.0 - v/v0;
   if (eps < 1.0e-10) us = 0.0;
-  else if (p < p0) us = 0.0; 
+  else if (p < p0) us = 0.0;
   else us = sqrt((p-p0)/(rho0*eps));
-  
+
   return us;
 }
 
@@ -337,7 +337,7 @@ double FixNPHug::compute_up()
 {
   double v;
   double eps,us,up;
-  
+
   v = compute_vol();
   us = compute_us();
 
@@ -380,7 +380,7 @@ double FixNPHug::compute_vector(int n)
 }
 
 /* ----------------------------------------------------------------------
-   pack restart data 
+   pack restart data
 ------------------------------------------------------------------------- */
 
 int FixNPHug::pack_restart_data(double *list)
@@ -414,7 +414,7 @@ int FixNPHug::size_restart_global()
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix 
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixNPHug::restart(char *buf)
diff --git a/src/SHOCK/fix_nphug.h b/src/SHOCK/fix_nphug.h
index 082a305393..3cdd6ec508 100644
--- a/src/SHOCK/fix_nphug.h
+++ b/src/SHOCK/fix_nphug.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -33,7 +33,7 @@ class FixNPHug : public FixNH {
   int modify_param(int, char **);
   int pack_restart_data(double *); // pack restart data
   void restart(char *);
- 
+
  private:
   class Compute *pe;               // PE compute pointer
 
diff --git a/src/SHOCK/fix_wall_piston.cpp b/src/SHOCK/fix_wall_piston.cpp
index 7f45e61220..18d097d97b 100644
--- a/src/SHOCK/fix_wall_piston.cpp
+++ b/src/SHOCK/fix_wall_piston.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -63,8 +63,8 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) :
     else if (strcmp(arg[iarg],"zlo") == 0) {
       zloflag = 1;
       iarg++;
-      if (domain->boundary[2][0] != 2) 
-	error->all(FLERR,"Must shrink-wrap piston boundary");
+      if (domain->boundary[2][0] != 2)
+        error->all(FLERR,"Must shrink-wrap piston boundary");
     } else if (strcmp(arg[iarg],"xhi") == 0)
       error->all(FLERR,"Fix wall/piston command only available at zlo");
     else if (strcmp(arg[iarg],"yhi") == 0)
@@ -129,7 +129,7 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) :
     } else error->all(FLERR,"Illegal fix wall/piston command");
   }
 
-  if (vx < 0.0 || vy < 0.0 || vz < 0.0) 
+  if (vx < 0.0 || vy < 0.0 || vz < 0.0)
     error->all(FLERR,"Illegal fix wall/piston velocity");
   if ((xloflag || xhiflag) && domain->xperiodic)
     error->all(FLERR,"Cannot use wall in periodic dimension");
@@ -159,7 +159,7 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) :
   z0 *= zscale;
   roughdist *= zscale;
 
-  if (rampflag || rampNL1flag || rampNL2flag || rampNL3flag || 
+  if (rampflag || rampNL1flag || rampNL2flag || rampNL3flag ||
       rampNL4flag || rampNL5flag) {
     maxvx = vx;
     maxvy = vy;
@@ -217,12 +217,12 @@ void FixWallPiston::post_integrate()
     angfreq = MY_2PI / (0.5 * tott);
 
     if (zloflag) {
-      zlo = z0 + paccelz * (0.5*tt + 1.0/(angfreq*angfreq) - 
-			    1.0/(angfreq*angfreq)*cos(angfreq*t));
+      zlo = z0 + paccelz * (0.5*tt + 1.0/(angfreq*angfreq) -
+                            1.0/(angfreq*angfreq)*cos(angfreq*t));
       vz =  paccelz * (t + 1.0/angfreq*sin(angfreq*t));
     }
     else error->all(FLERR,
-		    "NL ramp in wall/piston only implemented in zlo for now");
+                    "NL ramp in wall/piston only implemented in zlo for now");
   }
   else if (rampNL2flag) {
     paccelz = maxvz / tott;
@@ -230,13 +230,13 @@ void FixWallPiston::post_integrate()
 
     if (zloflag) {
       zlo = z0 + paccelz * (0.5*tt + 4.0/(3.0*angfreq*angfreq)*
-			    (1.0-cos(angfreq*t)) + 
-			    1.0/(6.0*angfreq*angfreq)*(1.0-cos(2.0*angfreq*t)));
-      vz =  paccelz * (t + 4.0/(3.0*angfreq)*sin(angfreq*t) + 
-		       1.0/(3.0*angfreq)*sin(2.0*angfreq*t));
+                            (1.0-cos(angfreq*t)) +
+                            1.0/(6.0*angfreq*angfreq)*(1.0-cos(2.0*angfreq*t)));
+      vz =  paccelz * (t + 4.0/(3.0*angfreq)*sin(angfreq*t) +
+                       1.0/(3.0*angfreq)*sin(2.0*angfreq*t));
     }
     else error->all(FLERR,
-		    "NL ramp in wall/piston only implemented in zlo for now");
+                    "NL ramp in wall/piston only implemented in zlo for now");
   }
   else if (rampNL3flag) {
     paccelz = maxvz / tott;
@@ -246,7 +246,7 @@ void FixWallPiston::post_integrate()
       vz =  paccelz * tott * (t1p5 );
     }
     else error->all(FLERR,
-		    "NL ramp in wall/piston only implemented in zlo for now");
+                    "NL ramp in wall/piston only implemented in zlo for now");
   }
   else if (rampNL4flag) {
     paccelz = maxvz / tott;
@@ -256,7 +256,7 @@ void FixWallPiston::post_integrate()
       vz =  paccelz / tott * (tt);
     }
     else error->all(FLERR,
-		    "NL ramp in wall/piston only implemented in zlo for now");
+                    "NL ramp in wall/piston only implemented in zlo for now");
   }
   else if (rampNL5flag) {
     paccelz = maxvz / tott;
@@ -266,7 +266,7 @@ void FixWallPiston::post_integrate()
       vz =  paccelz / tott / tott * (ttt);
     }
     else error->all(FLERR,
-		    "NL ramp in wall/piston only implemented in zlo for now");
+                    "NL ramp in wall/piston only implemented in zlo for now");
   }
   else {
     if (zloflag) { zlo = z0 + vz * t; }
@@ -275,13 +275,13 @@ void FixWallPiston::post_integrate()
   if (update->ntimestep % 1000 == 0)
     if (comm->me == 0) {
       if (screen)
-	fprintf(screen,"SHOCK: step " BIGINT_FORMAT
-		" t %g zpos %g vz %g az %g zlo %g\n", 
-		update->ntimestep, t, zlo, vz, paccelz, domain->boxlo[2]);
+        fprintf(screen,"SHOCK: step " BIGINT_FORMAT
+                " t %g zpos %g vz %g az %g zlo %g\n",
+                update->ntimestep, t, zlo, vz, paccelz, domain->boxlo[2]);
       if (logfile)
-	fprintf(logfile,"SHOCK: step " BIGINT_FORMAT
-		" t %g zpos %g vz %g az %g zlo %g\n", 
-		update->ntimestep, t, zlo, vz, paccelz, domain->boxlo[2]);
+        fprintf(logfile,"SHOCK: step " BIGINT_FORMAT
+                " t %g zpos %g vz %g az %g zlo %g\n",
+                update->ntimestep, t, zlo, vz, paccelz, domain->boxlo[2]);
     }
 
   // VIRIAL PRESSURE CONTRIBUTION?
@@ -291,22 +291,22 @@ void FixWallPiston::post_integrate()
       roughoff = 0.0;
       if (roughflag) {
         roughoff += roughdist*fabs((x[i][0] - domain->boxlo[0])/
-				   (domain->boxhi[0]-domain->boxlo[0])-0.5);
+                                   (domain->boxhi[0]-domain->boxlo[0])-0.5);
         roughoff += roughdist*fabs((x[i][1] - domain->boxlo[1])/
-				   (domain->boxhi[1]-domain->boxlo[1])-0.5);
+                                   (domain->boxhi[1]-domain->boxlo[1])-0.5);
       }
       if (zloflag && x[i][2] < zlo - roughoff) {
-	x[i][2] = 2.0 * (zlo - roughoff) - x[i][2];
-	v[i][2] = 2.0 * vz - v[i][2];
+        x[i][2] = 2.0 * (zlo - roughoff) - x[i][2];
+        v[i][2] = 2.0 * vz - v[i][2];
       }
     }
   }
   double **f = atom->f;
   int  *type = atom->type;
-    
+
   double gamma1,gamma2;
   double tsqrt = sqrt(t_target);
-  
+
   if (atom->mass) {
     if (tempflag) {
       for (int i = 1; i <= atom->ntypes; i++) {
diff --git a/src/SHOCK/fix_wall_piston.h b/src/SHOCK/fix_wall_piston.h
index 2ebd9ab8f3..15e4d9c0ef 100644
--- a/src/SHOCK/fix_wall_piston.h
+++ b/src/SHOCK/fix_wall_piston.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp
index 7cbb604a49..5484ab3fbc 100644
--- a/src/SRD/fix_srd.cpp
+++ b/src/SRD/fix_srd.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
  ------------------------------------------------------------------------- */
 
@@ -174,7 +174,7 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   // error check
 
   if (nevery <= 0) error->all(FLERR,"Illegal fix srd command");
-  if (bigexist && biggroup < 0) 
+  if (bigexist && biggroup < 0)
     error->all(FLERR,"Could not find fix srd group ID");
   if (gridsrd <= 0.0) error->all(FLERR,"Illegal fix srd command");
   if (temperature_srd <= 0.0) error->all(FLERR,"Illegal fix srd command");
@@ -183,9 +183,9 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   if (maxbounceallow < 0) error->all(FLERR,"Illegal fix srd command");
   if (lamdaflag && lamda <= 0.0) error->all(FLERR,"Illegal fix srd command");
   if (gridsearch <= 0.0) error->all(FLERR,"Illegal fix srd command");
-  if (cubictol < 0.0 || cubictol > 1.0) 
+  if (cubictol < 0.0 || cubictol > 1.0)
     error->all(FLERR,"Illegal fix srd command");
-  if ((shiftuser == SHIFT_YES || shiftuser == SHIFT_POSSIBLE) && 
+  if ((shiftuser == SHIFT_YES || shiftuser == SHIFT_POSSIBLE) &&
       shiftseed <= 0) error->all(FLERR,"Illegal fix srd command");
 
   // initialize Marsaglia RNG with processor-unique seed
@@ -219,8 +219,8 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   shifts[0].maxbinsq = shifts[1].maxbinsq = 0;
   for (int ishift = 0; ishift < 2; ishift++)
     for (int iswap = 0; iswap < 6; iswap++)
-      shifts[ishift].bcomm[iswap].sendlist = 
-	shifts[ishift].bcomm[iswap].recvlist = NULL;
+      shifts[ishift].bcomm[iswap].sendlist =
+        shifts[ishift].bcomm[iswap].recvlist = NULL;
 
   maxbin2 = 0;
   nbinbig = NULL;
@@ -299,7 +299,7 @@ void FixSRD::init()
 {
   // error checks
 
-  if (force->newton_pair == 0) 
+  if (force->newton_pair == 0)
     error->all(FLERR,"Fix srd requires newton pair on");
   if (bigexist && comm->ghost_velocity == 0)
     error->all(FLERR,"Fix srd requires ghost atoms store velocity");
@@ -330,8 +330,8 @@ void FixSRD::init()
       fwall = wallfix->fwall;
       walltrigger = 0.5 * neighbor->skin;
       if (wallfix->overlap && overlap == 0 && me == 0)
-	error->warning(FLERR,
-		       "Fix SRD walls overlap but fix srd overlap not set");
+        error->warning(FLERR,
+                       "Fix SRD walls overlap but fix srd overlap not set");
     }
   }
 
@@ -344,17 +344,17 @@ void FixSRD::init()
       if (modify->fix[i]->box_change_size) change_size = 1;
       if (modify->fix[i]->box_change_shape) change_shape = 1;
       if (strcmp(modify->fix[i]->style,"deform") == 0) {
-	deformflag = 1;
-	FixDeform *deform = (FixDeform *) modify->fix[i];
-	if (deform->box_change_shape && deform->remapflag != V_REMAP)
-	  error->all(FLERR,"Using fix srd with inconsistent "
-		     "fix deform remap option");
+        deformflag = 1;
+        FixDeform *deform = (FixDeform *) modify->fix[i];
+        if (deform->box_change_shape && deform->remapflag != V_REMAP)
+          error->all(FLERR,"Using fix srd with inconsistent "
+                     "fix deform remap option");
       }
     }
 
   if (deformflag && tstat == 0 && me == 0)
     error->warning(FLERR,
-		   "Using fix srd with box deformation but no SRD thermostat");
+                   "Using fix srd with box deformation but no SRD thermostat");
 
   // parameterize based on current box volume
 
@@ -374,8 +374,8 @@ void FixSRD::init()
     if (mask[i] & groupbit) {
       vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
       if (vsq > vmaxsq) {
-	nrescale++;
-	MathExtra::scale3(vmax/sqrt(vsq),v[i]);
+        nrescale++;
+        MathExtra::scale3(vmax/sqrt(vsq),v[i]);
       }
     }
 
@@ -409,7 +409,7 @@ void FixSRD::setup(int vflag)
 
   if (dist_srd_reneigh < nevery*dt_big*vmax && me == 0)
     error->warning(FLERR,
-		   "Fix srd SRD moves may trigger frequent reneighboring");
+                   "Fix srd SRD moves may trigger frequent reneighboring");
 
   // setup search bins and search stencil based on these distances
 
@@ -455,11 +455,11 @@ void FixSRD::pre_neighbor()
     if (bigexist) {
       if (biggroup == atom->firstgroup) nbig = atom->nfirst + atom->nghost;
       else {
-	int *mask = atom->mask;
-	int nlocal = atom->nlocal;
-	nbig = atom->nghost;
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & biggroupbit) nbig++;
+        int *mask = atom->mask;
+        int nlocal = atom->nlocal;
+        nbig = atom->nghost;
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & biggroupbit) nbig++;
       }
     } else nbig = 0;
 
@@ -478,17 +478,17 @@ void FixSRD::pre_neighbor()
       if (biggroup == atom->firstgroup) nlocal = atom->nfirst;
       nbig = 0;
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & biggroupbit) biglist[nbig++].index = i;
+        if (mask[i] & biggroupbit) biglist[nbig++].index = i;
       int nall = atom->nlocal + atom->nghost;
       for (i = atom->nlocal; i < nall; i++)
-	if (mask[i] & biggroupbit) biglist[nbig++].index = i;
+        if (mask[i] & biggroupbit) biglist[nbig++].index = i;
       big_static();
     }
 
     if (wallexist) {
       for (m = 0; m < nwall; m++) {
-	biglist[nbig+m].index = m;
-	biglist[nbig+m].type = WALL;
+        biglist[nbig+m].index = m;
+        biglist[nbig+m].type = WALL;
       }
       wallfix->wall_params(1);
     }
@@ -525,38 +525,38 @@ void FixSRD::pre_neighbor()
     i = nbig = 0;
     while (i < nall) {
       if (mask[i] & biggroupbit) {
-	ix = static_cast<int> ((x[i][0]-xblo2)*bininv2x);
-	iy = static_cast<int> ((x[i][1]-yblo2)*bininv2y);
-	iz = static_cast<int> ((x[i][2]-zblo2)*bininv2z);
-	ibin = iz*nbin2y*nbin2x + iy*nbin2x + ix;
-
-	if (ix < 0 || ix >= nbin2x || iy < 0 || iy >= nbin2y || 
-	    iz < 0 || iz >= nbin2z)
-	  error->one(FLERR,"Fix SRD: bad search bin assignment");
-      
-	cutbinsq = biglist[nbig].cutbinsq;
-	for (j = 0; j < nstencil; j++) {
-	  jx = ix + stencil[j][0];
-	  jy = iy + stencil[j][1];
-	  jz = iz + stencil[j][2];
-	  
-	  if (jx < 0 || jx >= nbin2x || jy < 0 || jy >= nbin2y || 
-	      jz < 0 || jz >= nbin2z) {
-	    printf("Big particle %d %d %g %g %g\n",
-		   atom->tag[i],i,x[i][0],x[i][1],x[i][2]);
-	    printf("Bin indices: %d %d %d, %d %d %d, %d %d %d\n",
-		   ix,iy,iz,jx,jy,jz,nbin2x,nbin2y,nbin2z);
-	    error->one(FLERR,"Fix SRD: bad stencil bin for big particle");
-	  }
-	  rsq = point_bin_distance(x[i],jx,jy,jz);
-	  if (rsq < cutbinsq) {
-	    jbin = ibin + stencil[j][3];
-	    if (nbinbig[jbin] == ATOMPERBIN)
-	      error->one(FLERR,"Fix SRD: too many big particles in bin");
-	    binbig[jbin][nbinbig[jbin]++] = nbig;
-	  }
-	}
-	nbig++;
+        ix = static_cast<int> ((x[i][0]-xblo2)*bininv2x);
+        iy = static_cast<int> ((x[i][1]-yblo2)*bininv2y);
+        iz = static_cast<int> ((x[i][2]-zblo2)*bininv2z);
+        ibin = iz*nbin2y*nbin2x + iy*nbin2x + ix;
+
+        if (ix < 0 || ix >= nbin2x || iy < 0 || iy >= nbin2y ||
+            iz < 0 || iz >= nbin2z)
+          error->one(FLERR,"Fix SRD: bad search bin assignment");
+
+        cutbinsq = biglist[nbig].cutbinsq;
+        for (j = 0; j < nstencil; j++) {
+          jx = ix + stencil[j][0];
+          jy = iy + stencil[j][1];
+          jz = iz + stencil[j][2];
+
+          if (jx < 0 || jx >= nbin2x || jy < 0 || jy >= nbin2y ||
+              jz < 0 || jz >= nbin2z) {
+            printf("Big particle %d %d %g %g %g\n",
+                   atom->tag[i],i,x[i][0],x[i][1],x[i][2]);
+            printf("Bin indices: %d %d %d, %d %d %d, %d %d %d\n",
+                   ix,iy,iz,jx,jy,jz,nbin2x,nbin2y,nbin2z);
+            error->one(FLERR,"Fix SRD: bad stencil bin for big particle");
+          }
+          rsq = point_bin_distance(x[i],jx,jy,jz);
+          if (rsq < cutbinsq) {
+            jbin = ibin + stencil[j][3];
+            if (nbinbig[jbin] == ATOMPERBIN)
+              error->one(FLERR,"Fix SRD: too many big particles in bin");
+            binbig[jbin][nbinbig[jbin]++] = nbig;
+          }
+        }
+        nbig++;
       }
 
       i++;
@@ -578,73 +578,73 @@ void FixSRD::pre_neighbor()
       int side = wallwhich[m] % 2;
 
       if (dim == 0) {
-	if (side == 0) {
-	  hi = static_cast<int> ((xwall[m]+delta-xblo2)*bininv2x);
-	  if (hi < 0) continue;
-	  if (hi >= nbin2x) error->all(FLERR,
-				       "Fix SRD: bad search bin assignment");
-	  lo = 0;
-	} else {
-	  lo = static_cast<int> ((xwall[m]-delta-xblo2)*bininv2x);
-	  if (lo >= nbin2x) continue;
-	  if (lo < 0) error->all(FLERR,"Fix SRD: bad search bin assignment");
-	  hi = nbin2x-1;
-	}
-
-	for (ix = lo; ix <= hi; ix++)
-	  for (iy = 0; iy < nbin2y; iy++)
-	    for (iz = 0; iz < nbin2z; iz++) {
-	      ibin = iz*nbin2y*nbin2x + iy*nbin2x + ix;
-	      if (nbinbig[ibin] == ATOMPERBIN)
-		error->all(FLERR,"Fix SRD: too many walls in bin");
-	      binbig[ibin][nbinbig[ibin]++] = nbig+m;
-	    }
+        if (side == 0) {
+          hi = static_cast<int> ((xwall[m]+delta-xblo2)*bininv2x);
+          if (hi < 0) continue;
+          if (hi >= nbin2x) error->all(FLERR,
+                                       "Fix SRD: bad search bin assignment");
+          lo = 0;
+        } else {
+          lo = static_cast<int> ((xwall[m]-delta-xblo2)*bininv2x);
+          if (lo >= nbin2x) continue;
+          if (lo < 0) error->all(FLERR,"Fix SRD: bad search bin assignment");
+          hi = nbin2x-1;
+        }
+
+        for (ix = lo; ix <= hi; ix++)
+          for (iy = 0; iy < nbin2y; iy++)
+            for (iz = 0; iz < nbin2z; iz++) {
+              ibin = iz*nbin2y*nbin2x + iy*nbin2x + ix;
+              if (nbinbig[ibin] == ATOMPERBIN)
+                error->all(FLERR,"Fix SRD: too many walls in bin");
+              binbig[ibin][nbinbig[ibin]++] = nbig+m;
+            }
 
       } else if (dim == 1) {
-	if (side == 0) {
-	  hi = static_cast<int> ((xwall[m]+delta-yblo2)*bininv2y);
-	  if (hi < 0) continue;
-	  if (hi >= nbin2y) error->all(FLERR,
-				       "Fix SRD: bad search bin assignment");
-	  lo = 0;
-	} else {
-	  lo = static_cast<int> ((xwall[m]-delta-yblo2)*bininv2y);
-	  if (lo >= nbin2y) continue;
-	  if (lo < 0) error->all(FLERR,"Fix SRD: bad search bin assignment");
-	  hi = nbin2y-1;
-	}
-
-	for (iy = lo; iy <= hi; iy++)
-	  for (ix = 0; ix < nbin2x; ix++)
-	    for (iz = 0; iz < nbin2z; iz++) {
-	      ibin = iz*nbin2y*nbin2x + iy*nbin2x + ix;
-	      if (nbinbig[ibin] == ATOMPERBIN)
-		error->all(FLERR,"Fix SRD: too many walls in bin");
-	      binbig[ibin][nbinbig[ibin]++] = nbig+m;
-	    }
+        if (side == 0) {
+          hi = static_cast<int> ((xwall[m]+delta-yblo2)*bininv2y);
+          if (hi < 0) continue;
+          if (hi >= nbin2y) error->all(FLERR,
+                                       "Fix SRD: bad search bin assignment");
+          lo = 0;
+        } else {
+          lo = static_cast<int> ((xwall[m]-delta-yblo2)*bininv2y);
+          if (lo >= nbin2y) continue;
+          if (lo < 0) error->all(FLERR,"Fix SRD: bad search bin assignment");
+          hi = nbin2y-1;
+        }
+
+        for (iy = lo; iy <= hi; iy++)
+          for (ix = 0; ix < nbin2x; ix++)
+            for (iz = 0; iz < nbin2z; iz++) {
+              ibin = iz*nbin2y*nbin2x + iy*nbin2x + ix;
+              if (nbinbig[ibin] == ATOMPERBIN)
+                error->all(FLERR,"Fix SRD: too many walls in bin");
+              binbig[ibin][nbinbig[ibin]++] = nbig+m;
+            }
 
       } else if (dim == 2) {
-	if (side == 0) {
-	  hi = static_cast<int> ((xwall[m]+delta-zblo2)*bininv2z);
-	  if (hi < 0) continue;
-	  if (hi >= nbin2z) error->all(FLERR,
-				       "Fix SRD: bad search bin assignment");
-	  lo = 0;
-	} else {
-	  lo = static_cast<int> ((xwall[m]-delta-zblo2)*bininv2z);
-	  if (lo >= nbin2z) continue;
-	  if (lo < 0) error->all(FLERR,"Fix SRD: bad search bin assignment");
-	  hi = nbin2z-1;
-	}
-
-	for (iz = lo; iz < hi; iz++)
-	  for (ix = 0; ix < nbin2x; ix++)
-	    for (iy = 0; iy < nbin2y; iy++) {
-	      ibin = iz*nbin2y*nbin2x + iy*nbin2x + ix;
-	      if (nbinbig[ibin] == ATOMPERBIN)
-		error->all(FLERR,"Fix SRD: too many walls in bin");
-	      binbig[ibin][nbinbig[ibin]++] = nbig+m;
-	    }
+        if (side == 0) {
+          hi = static_cast<int> ((xwall[m]+delta-zblo2)*bininv2z);
+          if (hi < 0) continue;
+          if (hi >= nbin2z) error->all(FLERR,
+                                       "Fix SRD: bad search bin assignment");
+          lo = 0;
+        } else {
+          lo = static_cast<int> ((xwall[m]-delta-zblo2)*bininv2z);
+          if (lo >= nbin2z) continue;
+          if (lo < 0) error->all(FLERR,"Fix SRD: bad search bin assignment");
+          hi = nbin2z-1;
+        }
+
+        for (iz = lo; iz < hi; iz++)
+          for (ix = 0; ix < nbin2x; ix++)
+            for (iy = 0; iy < nbin2y; iy++) {
+              ibin = iz*nbin2y*nbin2x + iy*nbin2x + ix;
+              if (nbinbig[ibin] == ATOMPERBIN)
+                error->all(FLERR,"Fix SRD: too many walls in bin");
+              binbig[ibin][nbinbig[ibin]++] = nbig+m;
+            }
       }
     }
   }
@@ -700,35 +700,35 @@ void FixSRD::post_force(int vflag)
   if (bigexist || wallexist) {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	x[i][0] += dt_big*v[i][0];
-	x[i][1] += dt_big*v[i][1];
-	x[i][2] += dt_big*v[i][2];
-	
-	ix = static_cast<int> ((x[i][0]-xblo2)*bininv2x);
-	iy = static_cast<int> ((x[i][1]-yblo2)*bininv2y);
-	iz = static_cast<int> ((x[i][2]-zblo2)*bininv2z);
-	binsrd[i] = iz*nbin2y*nbin2x + iy*nbin2x + ix;
-	
-	if (ix < 0 || ix >= nbin2x || iy < 0 || iy >= nbin2y || 
-	    iz < 0 || iz >= nbin2z) {
-	  if (screen) {
-	    fprintf(screen,"SRD particle %d on step " BIGINT_FORMAT "\n",
-		    atom->tag[i],update->ntimestep);
-	    fprintf(screen,"v = %g %g %g\n",v[i][0],v[i][1],v[i][2]);
-	    fprintf(screen,"x = %g %g %g\n",x[i][0],x[i][1],x[i][2]);
-	    fprintf(screen,"ix,iy,iz nx,ny,nz = %d %d %d %d %d %d\n",
-		    ix,iy,iz,nbin2x,nbin2y,nbin2z);
-	  }
-	  error->one(FLERR,"Fix SRD: bad bin assignment for SRD advection");
-	}
+        x[i][0] += dt_big*v[i][0];
+        x[i][1] += dt_big*v[i][1];
+        x[i][2] += dt_big*v[i][2];
+
+        ix = static_cast<int> ((x[i][0]-xblo2)*bininv2x);
+        iy = static_cast<int> ((x[i][1]-yblo2)*bininv2y);
+        iz = static_cast<int> ((x[i][2]-zblo2)*bininv2z);
+        binsrd[i] = iz*nbin2y*nbin2x + iy*nbin2x + ix;
+
+        if (ix < 0 || ix >= nbin2x || iy < 0 || iy >= nbin2y ||
+            iz < 0 || iz >= nbin2z) {
+          if (screen) {
+            fprintf(screen,"SRD particle %d on step " BIGINT_FORMAT "\n",
+                    atom->tag[i],update->ntimestep);
+            fprintf(screen,"v = %g %g %g\n",v[i][0],v[i][1],v[i][2]);
+            fprintf(screen,"x = %g %g %g\n",x[i][0],x[i][1],x[i][2]);
+            fprintf(screen,"ix,iy,iz nx,ny,nz = %d %d %d %d %d %d\n",
+                    ix,iy,iz,nbin2x,nbin2y,nbin2z);
+          }
+          error->one(FLERR,"Fix SRD: bad bin assignment for SRD advection");
+        }
       }
 
   } else {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	x[i][0] += dt_big*v[i][0];
-	x[i][1] += dt_big*v[i][1];
-	x[i][2] += dt_big*v[i][2];
+        x[i][0] += dt_big*v[i][0];
+        x[i][1] += dt_big*v[i][1];
+        x[i][2] += dt_big*v[i][2];
       }
   }
 
@@ -758,8 +758,8 @@ void FixSRD::post_force(int vflag)
   for (i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       if (x[i][0] < srdlo_reneigh[0] || x[i][0] > srdhi_reneigh[0] ||
-	  x[i][1] < srdlo_reneigh[1] || x[i][1] > srdhi_reneigh[1] ||
-	  x[i][2] < srdlo_reneigh[2] || x[i][2] > srdhi_reneigh[2]) flag = 1;
+          x[i][1] < srdlo_reneigh[1] || x[i][1] > srdhi_reneigh[1] ||
+          x[i][2] < srdlo_reneigh[2] || x[i][2] > srdhi_reneigh[2]) flag = 1;
     }
   if (triclinic) domain->lamda2x(nlocal);
 
@@ -776,7 +776,7 @@ void FixSRD::post_force(int vflag)
   if (wallexist) {
     for (m = 0; m < nwall; m++)
       if (fabs(xwall[m]-xwallhold[m]) > walltrigger)
-	next_reneighbor = update->ntimestep + 1;
+        next_reneighbor = update->ntimestep + 1;
   }
 
   // if next timestep is SRD timestep, trigger reneigh
@@ -928,17 +928,17 @@ void FixSRD::reset_velocities()
     vsq = 0.0;
     for (j = binhead[i]; j >= 0; j = binnext[j]) {
       if (axis == 0) {
-	u[0] = v[j][0]-vave[0];
-	u[1] = sign ? v[j][2]-vave[2] : vave[2]-v[j][2];
-	u[2] = sign ? vave[1]-v[j][1] : v[j][1]-vave[1];
+        u[0] = v[j][0]-vave[0];
+        u[1] = sign ? v[j][2]-vave[2] : vave[2]-v[j][2];
+        u[2] = sign ? vave[1]-v[j][1] : v[j][1]-vave[1];
       } else if (axis == 1) {
-	u[1] = v[j][1]-vave[1];
-	u[0] = sign ? v[j][2]-vave[2] : vave[2]-v[j][2];
-	u[2] = sign ? vave[0]-v[j][0] : v[j][0]-vave[0];
+        u[1] = v[j][1]-vave[1];
+        u[0] = sign ? v[j][2]-vave[2] : vave[2]-v[j][2];
+        u[2] = sign ? vave[0]-v[j][0] : v[j][0]-vave[0];
       } else {
-	u[2] = v[j][2]-vave[2];
-	u[1] = sign ? v[j][0]-vave[0] : vave[0]-v[j][0];
-	u[0] = sign ? vave[1]-v[j][1] : v[j][1]-vave[1];
+        u[2] = v[j][2]-vave[2];
+        u[1] = sign ? v[j][0]-vave[0] : vave[0]-v[j][0];
+        u[0] = sign ? vave[1]-v[j][1] : v[j][1]-vave[1];
       }
       vsq += u[0]*u[0] + u[1]*u[1] + u[2]*u[2];
       v[j][0] = u[0] + vave[0];
@@ -948,15 +948,15 @@ void FixSRD::reset_velocities()
 
     if (tstat && n > 1) {
       if (deformflag) {
-	xlamda = vbin[i].xctr;
-	vstream[0] = h_rate[0]*xlamda[0] + h_rate[5]*xlamda[1] + 
-	  h_rate[4]*xlamda[2] + h_ratelo[0];
-	vstream[1] = h_rate[1]*xlamda[1] + h_rate[3]*xlamda[2] + h_ratelo[1];
-	vstream[2] = h_rate[2]*xlamda[2] + h_ratelo[2];
+        xlamda = vbin[i].xctr;
+        vstream[0] = h_rate[0]*xlamda[0] + h_rate[5]*xlamda[1] +
+          h_rate[4]*xlamda[2] + h_ratelo[0];
+        vstream[1] = h_rate[1]*xlamda[1] + h_rate[3]*xlamda[2] + h_ratelo[1];
+        vstream[2] = h_rate[2]*xlamda[2] + h_ratelo[2];
       } else {
-	vstream[0] = vave[0];
-	vstream[1] = vave[1];
-	vstream[2] = vave[2];
+        vstream[0] = vave[0];
+        vstream[1] = vave[1];
+        vstream[2] = vave[2];
       }
 
       // tbin = thermal temperature of particles in bin
@@ -967,13 +967,13 @@ void FixSRD::reset_velocities()
 
       vsq = 0.0;
       for (j = binhead[i]; j >= 0; j = binnext[j]) {
-	u[0] = (v[j][0] - vave[0]) * scale;
-	u[1] = (v[j][1] - vave[1]) * scale;
-	u[2] = (v[j][2] - vave[2]) * scale;
-	vsq += u[0]*u[0] + u[1]*u[1] + u[2]*u[2];
-	v[j][0] = u[0] + vstream[0];
-	v[j][1] = u[1] + vstream[1];
-	v[j][2] = u[2] + vstream[2];
+        u[0] = (v[j][0] - vave[0]) * scale;
+        u[1] = (v[j][1] - vave[1]) * scale;
+        u[2] = (v[j][2] - vave[2]) * scale;
+        vsq += u[0]*u[0] + u[1]*u[1] + u[2]*u[2];
+        v[j][0] = u[0] + vstream[0];
+        v[j][1] = u[1] + vstream[1];
+        v[j][2] = u[2] + vstream[2];
       }
     }
 
@@ -986,14 +986,14 @@ void FixSRD::reset_velocities()
 
   srd_bin_temp *= tfactor;
 
-  // rescale any too-large velocities 
+  // rescale any too-large velocities
 
   for (i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
       if (vsq > vmaxsq) {
-	nrescale++;
-	MathExtra::scale3(vmax/sqrt(vsq),v[i]);
+        nrescale++;
+        MathExtra::scale3(vmax/sqrt(vsq),v[i]);
       }
     }
 }
@@ -1007,7 +1007,7 @@ void FixSRD::vbin_comm(int ishift)
   BinComm *bcomm1,*bcomm2;
   MPI_Request request1,request2;
   MPI_Status status;
-  
+
   // send/recv bins in both directions in each dimension
   // don't send if nsend = 0
   //   due to static bins aliging with proc boundary
@@ -1017,7 +1017,7 @@ void FixSRD::vbin_comm(int ishift)
   // don't recv if nrecv = 0
   // copy from self if recvproc = me
   // MPI recv from another proc if recvproc != me
-  
+
   BinAve *vbin = shifts[ishift].vbin;
   int *procgrid = comm->procgrid;
 
@@ -1025,41 +1025,41 @@ void FixSRD::vbin_comm(int ishift)
   for (int idim = 0; idim < dimension; idim++) {
     bcomm1 = &shifts[ishift].bcomm[iswap++];
     bcomm2 = &shifts[ishift].bcomm[iswap++];
-    
+
     if (procgrid[idim] == 1) {
       if (bcomm1->nsend)
-	vbin_pack(vbin,bcomm1->nsend,bcomm1->sendlist,sbuf1);
+        vbin_pack(vbin,bcomm1->nsend,bcomm1->sendlist,sbuf1);
       if (bcomm2->nsend)
-	vbin_pack(vbin,bcomm2->nsend,bcomm2->sendlist,sbuf2);
+        vbin_pack(vbin,bcomm2->nsend,bcomm2->sendlist,sbuf2);
       if (bcomm1->nrecv)
-	vbin_unpack(sbuf1,vbin,bcomm1->nrecv,bcomm1->recvlist);
+        vbin_unpack(sbuf1,vbin,bcomm1->nrecv,bcomm1->recvlist);
       if (bcomm2->nrecv)
-	vbin_unpack(sbuf2,vbin,bcomm2->nrecv,bcomm2->recvlist);
+        vbin_unpack(sbuf2,vbin,bcomm2->nrecv,bcomm2->recvlist);
 
     } else {
       if (bcomm1->nrecv)
-	MPI_Irecv(rbuf1,bcomm1->nrecv*VBINSIZE,MPI_DOUBLE,bcomm1->recvproc,0,
-		  world,&request1);
+        MPI_Irecv(rbuf1,bcomm1->nrecv*VBINSIZE,MPI_DOUBLE,bcomm1->recvproc,0,
+                  world,&request1);
       if (bcomm2->nrecv)
-	MPI_Irecv(rbuf2,bcomm2->nrecv*VBINSIZE,MPI_DOUBLE,bcomm2->recvproc,0,
-		  world,&request2);
+        MPI_Irecv(rbuf2,bcomm2->nrecv*VBINSIZE,MPI_DOUBLE,bcomm2->recvproc,0,
+                  world,&request2);
       if (bcomm1->nsend) {
-	vbin_pack(vbin,bcomm1->nsend,bcomm1->sendlist,sbuf1);
-	MPI_Send(sbuf1,bcomm1->nsend*VBINSIZE,MPI_DOUBLE,
-		 bcomm1->sendproc,0,world);
+        vbin_pack(vbin,bcomm1->nsend,bcomm1->sendlist,sbuf1);
+        MPI_Send(sbuf1,bcomm1->nsend*VBINSIZE,MPI_DOUBLE,
+                 bcomm1->sendproc,0,world);
       }
       if (bcomm2->nsend) {
-	vbin_pack(vbin,bcomm2->nsend,bcomm2->sendlist,sbuf2);
-	MPI_Send(sbuf2,bcomm2->nsend*VBINSIZE,MPI_DOUBLE,
-		 bcomm2->sendproc,0,world);
+        vbin_pack(vbin,bcomm2->nsend,bcomm2->sendlist,sbuf2);
+        MPI_Send(sbuf2,bcomm2->nsend*VBINSIZE,MPI_DOUBLE,
+                 bcomm2->sendproc,0,world);
       }
       if (bcomm1->nrecv) {
-	MPI_Wait(&request1,&status);
-	vbin_unpack(rbuf1,vbin,bcomm1->nrecv,bcomm1->recvlist);
+        MPI_Wait(&request1,&status);
+        vbin_unpack(rbuf1,vbin,bcomm1->nrecv,bcomm1->recvlist);
       }
       if (bcomm2->nrecv) {
-	MPI_Wait(&request2,&status);
-	vbin_unpack(rbuf2,vbin,bcomm2->nrecv,bcomm2->recvlist);
+        MPI_Wait(&request2,&status);
+        vbin_unpack(rbuf2,vbin,bcomm2->nrecv,bcomm2->recvlist);
       }
     }
   }
@@ -1146,102 +1146,102 @@ void FixSRD::collisions_single()
 
       collide_flag = 0;
       for (m = 0; m < nbig; m++) {
-	k = binbig[ibin][m];
-	big = &biglist[k];
-	j = big->index;
-	type = big->type;
-
-	if (type == SPHERE) inside = inside_sphere(x[i],x[j],big);
-	else if (type == ELLIPSOID) inside = inside_ellipsoid(x[i],x[j],big);
-	else inside = inside_wall(x[i],j);
-
-	if (inside) {
-	  if (exactflag) {
-	    if (type == SPHERE)
-	      t_remain = collision_sphere_exact(x[i],x[j],v[i],v[j],big,
-						xscoll,xbcoll,norm);
-	    else if (type == ELLIPSOID)
-	      t_remain = collision_ellipsoid_exact(x[i],x[j],v[i],v[j],big,
-						   xscoll,xbcoll,norm);
-	    else 
-	      t_remain = collision_wall_exact(x[i],j,v[i],xscoll,xbcoll,norm);
-
-	  } else {
-	    t_remain = 0.5*dt;
-	    if (type == SPHERE)
-	      collision_sphere_inexact(x[i],x[j],big,xscoll,xbcoll,norm);
-	    else if (type == ELLIPSOID)
-	      collision_ellipsoid_inexact(x[i],x[j],big,xscoll,xbcoll,norm);
-	    else
-	      collision_wall_inexact(x[i],j,xscoll,xbcoll,norm);
-	  }
+        k = binbig[ibin][m];
+        big = &biglist[k];
+        j = big->index;
+        type = big->type;
+
+        if (type == SPHERE) inside = inside_sphere(x[i],x[j],big);
+        else if (type == ELLIPSOID) inside = inside_ellipsoid(x[i],x[j],big);
+        else inside = inside_wall(x[i],j);
+
+        if (inside) {
+          if (exactflag) {
+            if (type == SPHERE)
+              t_remain = collision_sphere_exact(x[i],x[j],v[i],v[j],big,
+                                                xscoll,xbcoll,norm);
+            else if (type == ELLIPSOID)
+              t_remain = collision_ellipsoid_exact(x[i],x[j],v[i],v[j],big,
+                                                   xscoll,xbcoll,norm);
+            else
+              t_remain = collision_wall_exact(x[i],j,v[i],xscoll,xbcoll,norm);
+
+          } else {
+            t_remain = 0.5*dt;
+            if (type == SPHERE)
+              collision_sphere_inexact(x[i],x[j],big,xscoll,xbcoll,norm);
+            else if (type == ELLIPSOID)
+              collision_ellipsoid_inexact(x[i],x[j],big,xscoll,xbcoll,norm);
+            else
+              collision_wall_inexact(x[i],j,xscoll,xbcoll,norm);
+          }
 
 #ifdef SRD_DEBUG
-	  if (update->ntimestep == SRD_DEBUG_TIMESTEP &&
-	      atom->tag[i] == SRD_DEBUG_ATOMID)
-	    print_collision(i,j,ibounce,t_remain,dt,xscoll,xbcoll,norm,type);
+          if (update->ntimestep == SRD_DEBUG_TIMESTEP &&
+              atom->tag[i] == SRD_DEBUG_ATOMID)
+            print_collision(i,j,ibounce,t_remain,dt,xscoll,xbcoll,norm,type);
 #endif
 
-	  if (t_remain > dt) {
-	    ninside++;
-	    if (insideflag == INSIDE_ERROR || insideflag == INSIDE_WARN) {
-	      char str[128];
-	      if (type != WALL)
-		sprintf(str,
-			"SRD particle %d started "
-			"inside big particle %d on step " BIGINT_FORMAT 
-			" bounce %d",
-			atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
-	      else
-		sprintf(str,
-			"SRD particle %d started "
-			"inside big particle %d on step " BIGINT_FORMAT 
-			" bounce %d",
-			atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
-	      if (insideflag == INSIDE_ERROR) error->one(FLERR,str);
-	      error->warning(FLERR,str);
-	    }
-	    break;
-	  }
-
-	  if (collidestyle == SLIP) {
-	    if (type != WALL) slip(v[i],v[j],x[j],big,xscoll,norm,vsnew);
-	    else slip_wall(v[i],j,norm,vsnew);
-	  } else {
-	    if (type != WALL) noslip(v[i],v[j],x[j],big,-1, xscoll,norm,vsnew);
-	    else noslip(v[i],NULL,x[j],big,j,xscoll,norm,vsnew);
-	  }
-
-	  if (dimension == 2) vsnew[2] = 0.0;
-
-	  // check on rescaling of vsnew
-
-	  double vsq = vsnew[0]*vsnew[0] + vsnew[1]*vsnew[1] + 
-	    vsnew[2]*vsnew[2];
-	  if (vsq > vmaxsq) {
-	    nrescale++;
-	    MathExtra::scale3(vmax/sqrt(vsq),vsnew);
-	  }
-
-	  // update BIG particle and WALL and SRD
-	  // BIG particle is not torqued if sphere and SLIP collision
-
-	  if (collidestyle == SLIP && type == SPHERE)
-	    force_torque(v[i],vsnew,xscoll,xbcoll,f[j],NULL);
-	  else if (type != WALL)
-	    force_torque(v[i],vsnew,xscoll,xbcoll,f[j],torque[j]);
-	  else if (type == WALL)
-	    force_wall(v[i],vsnew,j);
-
-	  ibin = binsrd[i] = update_srd(i,t_remain,xscoll,vsnew,x[i],v[i]);
-
-	  if (ibounce == 0) ncollide++;
-	  ibounce++;
-	  if (ibounce < maxbounceallow || maxbounceallow == 0)
-	    collide_flag = 1;
-	  dt = t_remain;
-	  break;
-	}
+          if (t_remain > dt) {
+            ninside++;
+            if (insideflag == INSIDE_ERROR || insideflag == INSIDE_WARN) {
+              char str[128];
+              if (type != WALL)
+                sprintf(str,
+                        "SRD particle %d started "
+                        "inside big particle %d on step " BIGINT_FORMAT
+                        " bounce %d",
+                        atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
+              else
+                sprintf(str,
+                        "SRD particle %d started "
+                        "inside big particle %d on step " BIGINT_FORMAT
+                        " bounce %d",
+                        atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
+              if (insideflag == INSIDE_ERROR) error->one(FLERR,str);
+              error->warning(FLERR,str);
+            }
+            break;
+          }
+
+          if (collidestyle == SLIP) {
+            if (type != WALL) slip(v[i],v[j],x[j],big,xscoll,norm,vsnew);
+            else slip_wall(v[i],j,norm,vsnew);
+          } else {
+            if (type != WALL) noslip(v[i],v[j],x[j],big,-1, xscoll,norm,vsnew);
+            else noslip(v[i],NULL,x[j],big,j,xscoll,norm,vsnew);
+          }
+
+          if (dimension == 2) vsnew[2] = 0.0;
+
+          // check on rescaling of vsnew
+
+          double vsq = vsnew[0]*vsnew[0] + vsnew[1]*vsnew[1] +
+            vsnew[2]*vsnew[2];
+          if (vsq > vmaxsq) {
+            nrescale++;
+            MathExtra::scale3(vmax/sqrt(vsq),vsnew);
+          }
+
+          // update BIG particle and WALL and SRD
+          // BIG particle is not torqued if sphere and SLIP collision
+
+          if (collidestyle == SLIP && type == SPHERE)
+            force_torque(v[i],vsnew,xscoll,xbcoll,f[j],NULL);
+          else if (type != WALL)
+            force_torque(v[i],vsnew,xscoll,xbcoll,f[j],torque[j]);
+          else if (type == WALL)
+            force_wall(v[i],vsnew,j);
+
+          ibin = binsrd[i] = update_srd(i,t_remain,xscoll,vsnew,x[i],v[i]);
+
+          if (ibounce == 0) ncollide++;
+          ibounce++;
+          if (ibounce < maxbounceallow || maxbounceallow == 0)
+            collide_flag = 1;
+          dt = t_remain;
+          break;
+        }
       }
     }
 
@@ -1298,76 +1298,76 @@ void FixSRD::collisions_multi()
 
       t_first = 0.0;
       for (m = 0; m < nbig; m++) {
-	k = binbig[ibin][m];
-	big = &biglist[k];
-	j = big->index;
-	if (j == jlast) continue;
-	type = big->type;
-
-	if (type == SPHERE)
-	  inside = inside_sphere(x[i],x[j],big);
-	else if (type == ELLIPSOID)
-	  inside = inside_ellipsoid(x[i],x[j],big);
-	else if (type == LINE)
-	  inside = inside_line(x[i],x[j],v[i],v[j],big,dt);
-	else if (type == TRIANGLE) 
-	  inside = inside_tri(x[i],x[j],v[i],v[j],big,dt);
-	else
-	  inside = inside_wall(x[i],j);
-
-	if (inside) {
-	  if (type == SPHERE)
-	    t_remain = collision_sphere_exact(x[i],x[j],v[i],v[j],big,
-					      xscoll,xbcoll,norm);
-	  else if (type == ELLIPSOID)
-	    t_remain = collision_ellipsoid_exact(x[i],x[j],v[i],v[j],big,
-						 xscoll,xbcoll,norm);
-	  else if (type == LINE)
-	    t_remain = collision_line_exact(x[i],x[j],v[i],v[j],big,dt,
-					    xscoll,xbcoll,norm);
-	  else if (type == TRIANGLE)
-	    t_remain = collision_tri_exact(x[i],x[j],v[i],v[j],big,dt,
-					   xscoll,xbcoll,norm);
-	  else 
-	    t_remain = collision_wall_exact(x[i],j,v[i],xscoll,xbcoll,norm);
+        k = binbig[ibin][m];
+        big = &biglist[k];
+        j = big->index;
+        if (j == jlast) continue;
+        type = big->type;
+
+        if (type == SPHERE)
+          inside = inside_sphere(x[i],x[j],big);
+        else if (type == ELLIPSOID)
+          inside = inside_ellipsoid(x[i],x[j],big);
+        else if (type == LINE)
+          inside = inside_line(x[i],x[j],v[i],v[j],big,dt);
+        else if (type == TRIANGLE)
+          inside = inside_tri(x[i],x[j],v[i],v[j],big,dt);
+        else
+          inside = inside_wall(x[i],j);
+
+        if (inside) {
+          if (type == SPHERE)
+            t_remain = collision_sphere_exact(x[i],x[j],v[i],v[j],big,
+                                              xscoll,xbcoll,norm);
+          else if (type == ELLIPSOID)
+            t_remain = collision_ellipsoid_exact(x[i],x[j],v[i],v[j],big,
+                                                 xscoll,xbcoll,norm);
+          else if (type == LINE)
+            t_remain = collision_line_exact(x[i],x[j],v[i],v[j],big,dt,
+                                            xscoll,xbcoll,norm);
+          else if (type == TRIANGLE)
+            t_remain = collision_tri_exact(x[i],x[j],v[i],v[j],big,dt,
+                                           xscoll,xbcoll,norm);
+          else
+            t_remain = collision_wall_exact(x[i],j,v[i],xscoll,xbcoll,norm);
 
 #ifdef SRD_DEBUG
-	  if (update->ntimestep == SRD_DEBUG_TIMESTEP &&
-	      atom->tag[i] == SRD_DEBUG_ATOMID)
-	    print_collision(i,j,ibounce,t_remain,dt,xscoll,xbcoll,norm,type);
+          if (update->ntimestep == SRD_DEBUG_TIMESTEP &&
+              atom->tag[i] == SRD_DEBUG_ATOMID)
+            print_collision(i,j,ibounce,t_remain,dt,xscoll,xbcoll,norm,type);
 #endif
 
-	  if (t_remain > dt || t_remain < 0.0) {
-	    ninside++;
-	    if (insideflag == INSIDE_ERROR || insideflag == INSIDE_WARN) {
-	      char str[128];
-	      sprintf(str,
-		      "SRD particle %d started "
-		      "inside big particle %d on step " BIGINT_FORMAT 
-		      " bounce %d",
-		      atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
-	      if (insideflag == INSIDE_ERROR) error->one(FLERR,str);
-	      error->warning(FLERR,str);
-	    }
-	    t_first = 0.0;
-	    break;
-	  }
-
-	  if (t_remain > t_first) {
-	    t_first = t_remain;
-	    jfirst = j;
-	    typefirst = type;
-	    xscollfirst[0] = xscoll[0];
-	    xscollfirst[1] = xscoll[1];
-	    xscollfirst[2] = xscoll[2];
-	    xbcollfirst[0] = xbcoll[0];
-	    xbcollfirst[1] = xbcoll[1];
-	    xbcollfirst[2] = xbcoll[2];
-	    normfirst[0] = norm[0];
-	    normfirst[1] = norm[1];
-	    normfirst[2] = norm[2];
-	  }
-	}
+          if (t_remain > dt || t_remain < 0.0) {
+            ninside++;
+            if (insideflag == INSIDE_ERROR || insideflag == INSIDE_WARN) {
+              char str[128];
+              sprintf(str,
+                      "SRD particle %d started "
+                      "inside big particle %d on step " BIGINT_FORMAT
+                      " bounce %d",
+                      atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
+              if (insideflag == INSIDE_ERROR) error->one(FLERR,str);
+              error->warning(FLERR,str);
+            }
+            t_first = 0.0;
+            break;
+          }
+
+          if (t_remain > t_first) {
+            t_first = t_remain;
+            jfirst = j;
+            typefirst = type;
+            xscollfirst[0] = xscoll[0];
+            xscollfirst[1] = xscoll[1];
+            xscollfirst[2] = xscoll[2];
+            xbcollfirst[0] = xbcoll[0];
+            xbcollfirst[1] = xbcoll[1];
+            xbcollfirst[2] = xbcoll[2];
+            normfirst[0] = norm[0];
+            normfirst[1] = norm[1];
+            normfirst[2] = norm[2];
+          }
+        }
       }
 
       if (t_first == 0.0) break;
@@ -1384,11 +1384,11 @@ void FixSRD::collisions_multi()
       norm[2] = normfirst[2];
 
       if (collidestyle == SLIP) {
-	if (type != WALL) slip(v[i],v[j],x[j],big,xscoll,norm,vsnew);
-	else slip_wall(v[i],j,norm,vsnew);
+        if (type != WALL) slip(v[i],v[j],x[j],big,xscoll,norm,vsnew);
+        else slip_wall(v[i],j,norm,vsnew);
       } else {
-	if (type != WALL) noslip(v[i],v[j],x[j],big,-1,xscoll,norm,vsnew);
-	else noslip(v[i],NULL,x[j],big,j,xscoll,norm,vsnew);
+        if (type != WALL) noslip(v[i],v[j],x[j],big,-1,xscoll,norm,vsnew);
+        else noslip(v[i],NULL,x[j],big,j,xscoll,norm,vsnew);
       }
 
       if (dimension == 2) vsnew[2] = 0.0;
@@ -1397,19 +1397,19 @@ void FixSRD::collisions_multi()
 
       double vsq = vsnew[0]*vsnew[0] + vsnew[1]*vsnew[1] + vsnew[2]*vsnew[2];
       if (vsq > vmaxsq) {
-	nrescale++;
-	MathExtra::scale3(vmax/sqrt(vsq),vsnew);
+        nrescale++;
+        MathExtra::scale3(vmax/sqrt(vsq),vsnew);
       }
 
       // update BIG particle and WALL and SRD
       // BIG particle is not torqued if sphere and SLIP collision
 
       if (collidestyle == SLIP && type == SPHERE)
-	force_torque(v[i],vsnew,xscoll,xbcoll,f[j],NULL);
+        force_torque(v[i],vsnew,xscoll,xbcoll,f[j],NULL);
       else if (type != WALL)
-	force_torque(v[i],vsnew,xscoll,xbcoll,f[j],torque[j]);
+        force_torque(v[i],vsnew,xscoll,xbcoll,f[j],torque[j]);
       else if (type == WALL)
-	force_wall(v[i],vsnew,j);
+        force_wall(v[i],vsnew,j);
 
       ibin = binsrd[i] = update_srd(i,t_first,xscoll,vsnew,x[i],v[i]);
 
@@ -1481,7 +1481,7 @@ int FixSRD::inside_ellipsoid(double *xs, double *xb, Big *big)
 ------------------------------------------------------------------------- */
 
 int FixSRD::inside_line(double *xs, double *xb, double *vs, double *vb,
-			Big *big, double dt_step)
+                        Big *big, double dt_step)
 {
   double pmc0[2],pmc1[2],n0[2],n1[2];
   double n1_n0[2],pmc1_pmc0[2];
@@ -1535,10 +1535,10 @@ int FixSRD::inside_line(double *xs, double *xb, double *vs, double *vb,
   pmc1_pmc0[0] = pmc1[0]-pmc0[0]; pmc1_pmc0[1] = pmc1[1]-pmc0[1];
 
   double a = pmc1_pmc0[0]*n1_n0[0] + pmc1_pmc0[1]*n1_n0[1];
-  double b = pmc1_pmc0[0]*n0[0] + pmc1_pmc0[1]*n0[1] + 
+  double b = pmc1_pmc0[0]*n0[0] + pmc1_pmc0[1]*n0[1] +
   n1_n0[0]*pmc0[0] + n1_n0[1]*pmc0[1];
   double c = pmc0[0]*n0[0] + pmc0[1]*n0[1];
-  
+
   if (a == 0.0) {
     double dot0 = pmc0[0]*n0[0] + pmc0[1]*n0[1];
     double dot1 = pmc1[0]*n0[0] + pmc1[1]*n0[1];
@@ -1553,11 +1553,11 @@ int FixSRD::inside_line(double *xs, double *xb, double *vs, double *vb,
     double root2 = (-b - term) / (2.0*a);
 
     //printf("ABC vecs: %g %g: %g %g\n",
-    //	   pmc1_pmc0[0],pmc1_pmc0[1],n1_n0[0],n1_n0[1]);
+    //           pmc1_pmc0[0],pmc1_pmc0[1],n1_n0[0],n1_n0[1]);
     //printf("ABC vecs: %g %g: %g %g: %g %g %g\n",
-    //	   n0[0],n0[1],n1[0],n1[1],theta0,theta1,big->omega[2]);
+    //           n0[0],n0[1],n1[0],n1[1],theta0,theta1,big->omega[2]);
     //printf("ABC root: %g %g %g: %g %g %g\n",a,b,c,root1,root2,tfraction);
-    
+
     if (0.0 <= root1 && root1 <= 1.0) tfraction = root1;
     else if (0.0 <= root2 && root2 <= 1.0) tfraction = root2;
     else error->one(FLERR,"Bad quadratic solve for particle/line collision");
@@ -1597,7 +1597,7 @@ int FixSRD::inside_line(double *xs, double *xb, double *vs, double *vb,
 ------------------------------------------------------------------------- */
 
 int FixSRD::inside_tri(double *xs, double *xb, double *vs, double *vb,
-		       Big *big, double dt_step)
+                       Big *big, double dt_step)
 {
   double pmc0[3],pmc1[3],n0[3];
   double n1_n0[3],pmc1_pmc0[3];
@@ -1643,7 +1643,7 @@ int FixSRD::inside_tri(double *xs, double *xb, double *vs, double *vb,
   pmc1_pmc0[0] = pmc1[0]-pmc0[0];
   pmc1_pmc0[1] = pmc1[1]-pmc0[1];
   pmc1_pmc0[2] = pmc1[2]-pmc0[2];
-  
+
   double a = MathExtra::dot3(pmc1_pmc0,n1_n0);
   double b = MathExtra::dot3(pmc1_pmc0,n0) + MathExtra::dot3(n1_n0,pmc0);
   double c = MathExtra::dot3(pmc0,n0);
@@ -1761,9 +1761,9 @@ int FixSRD::inside_wall(double *xs, int iwall)
 ------------------------------------------------------------------------- */
 
 double FixSRD::collision_sphere_exact(double *xs, double *xb,
-				      double *vs, double *vb, Big *big,
-				      double *xscoll, double *xbcoll,
-				      double *norm)
+                                      double *vs, double *vb, Big *big,
+                                      double *xscoll, double *xbcoll,
+                                      double *norm)
 {
   double vs_dot_vs,vb_dot_vb,vs_dot_vb;
   double vs_dot_xb,vb_dot_xs,vs_dot_xs,vb_dot_xb;
@@ -1818,9 +1818,9 @@ double FixSRD::collision_sphere_exact(double *xs, double *xb,
 ------------------------------------------------------------------------- */
 
 void FixSRD::collision_sphere_inexact(double *xs, double *xb,
-				      Big *big,
-				      double *xscoll, double *xbcoll,
-				      double *norm)
+                                      Big *big,
+                                      double *xscoll, double *xbcoll,
+                                      double *norm)
 {
   double scale;
 
@@ -1851,9 +1851,9 @@ void FixSRD::collision_sphere_inexact(double *xs, double *xb,
 ------------------------------------------------------------------------- */
 
 double FixSRD::collision_ellipsoid_exact(double *xs, double *xb,
-					 double *vs, double *vb, Big *big,
-					 double *xscoll, double *xbcoll,
-					 double *norm)
+                                         double *vs, double *vb, Big *big,
+                                         double *xscoll, double *xbcoll,
+                                         double *norm)
 {
   double vs_vb[3],xs_xb[3],omega_ex[3],omega_ey[3],omega_ez[3];
   double excoll[3],eycoll[3],ezcoll[3],delta[3],xbody[3],nbody[3];
@@ -1888,10 +1888,10 @@ double FixSRD::collision_ellipsoid_exact(double *xs, double *xb,
   cz = xs_xb[0]*ez[0] + xs_xb[1]*ez[1] + xs_xb[2]*ez[2];
 
   a = (bx*bx + 2.0*ax*cx)*big->aradsqinv +
-    (by*by + 2.0*ay*cy)*big->bradsqinv + 
+    (by*by + 2.0*ay*cy)*big->bradsqinv +
     (bz*bz + 2.0*az*cz)*big->cradsqinv;
   b = 2.0 * (bx*cx*big->aradsqinv + by*cy*big->bradsqinv +
-	     bz*cz*big->cradsqinv);
+             bz*cz*big->cradsqinv);
   c = cx*cx*big->aradsqinv + cy*cy*big->bradsqinv +
     cz*cz*big->cradsqinv - 1.0;
 
@@ -1946,9 +1946,9 @@ double FixSRD::collision_ellipsoid_exact(double *xs, double *xb,
 ------------------------------------------------------------------------- */
 
 void FixSRD::collision_ellipsoid_inexact(double *xs, double *xb,
-					 Big *big,
-					 double *xscoll, double *xbcoll,
-					 double *norm)
+                                         Big *big,
+                                         double *xscoll, double *xbcoll,
+                                         double *norm)
 {
   double xs_xb[3],delta[3],xbody[3],nbody[3];
 
@@ -1962,7 +1962,7 @@ void FixSRD::collision_ellipsoid_inexact(double *xs, double *xb,
   double z = MathExtra::dot3(xs_xb,ez);
 
   double scale = 1.0/sqrt(x*x*big->aradsqinv + y*y*big->bradsqinv +
-			  z*z*big->cradsqinv);
+                          z*z*big->cradsqinv);
   x *= scale;
   y *= scale;
   z *= scale;
@@ -2001,10 +2001,10 @@ void FixSRD::collision_ellipsoid_inexact(double *xs, double *xb,
 ------------------------------------------------------------------------- */
 
 double FixSRD::collision_line_exact(double *xs, double *xb,
-				    double *vs, double *vb, Big *big,
-				    double dt_step,
-				    double *xscoll, double *xbcoll,
-				    double *norm)
+                                    double *vs, double *vb, Big *big,
+                                    double dt_step,
+                                    double *xscoll, double *xbcoll,
+                                    double *norm)
 {
   xscoll[0] = xsc[0];
   xscoll[1] = xsc[1];
@@ -2030,10 +2030,10 @@ double FixSRD::collision_line_exact(double *xs, double *xb,
 ------------------------------------------------------------------------- */
 
 double FixSRD::collision_tri_exact(double *xs, double *xb,
-				   double *vs, double *vb, Big *big,
-				   double dt_step,
-				   double *xscoll, double *xbcoll,
-				   double *norm)
+                                   double *vs, double *vb, Big *big,
+                                   double dt_step,
+                                   double *xscoll, double *xbcoll,
+                                   double *norm)
 {
   xscoll[0] = xsc[0];
   xscoll[1] = xsc[1];
@@ -2059,8 +2059,8 @@ double FixSRD::collision_tri_exact(double *xs, double *xb,
 ------------------------------------------------------------------------- */
 
 double FixSRD::collision_wall_exact(double *xs, int iwall, double *vs,
-				     double *xscoll, double *xbcoll,
-				     double *norm)
+                                     double *xscoll, double *xbcoll,
+                                     double *norm)
 {
   int dim = wallwhich[iwall] / 2;
 
@@ -2089,8 +2089,8 @@ double FixSRD::collision_wall_exact(double *xs, int iwall, double *vs,
    norm = surface normal of collision pt at time of collision
 ------------------------------------------------------------------------- */
 
-void FixSRD::collision_wall_inexact(double *xs, int iwall, double *xscoll, 
-				     double *xbcoll, double *norm)
+void FixSRD::collision_wall_inexact(double *xs, int iwall, double *xscoll,
+                                     double *xbcoll, double *norm)
 {
   int dim = wallwhich[iwall] / 2;
 
@@ -2120,7 +2120,7 @@ void FixSRD::collision_wall_inexact(double *xs, int iwall, double *xscoll,
 ------------------------------------------------------------------------- */
 
 void FixSRD::slip(double *vs, double *vb, double *xb, Big *big,
-		  double *xsurf, double *norm, double *vsnew)
+                  double *xsurf, double *norm, double *vsnew)
 {
   double r1,r2,vnmag,vs_dot_n,vsurf_dot_n;
   double tangent[3],vsurf[3];
@@ -2173,7 +2173,7 @@ void FixSRD::slip_wall(double *vs, int iwall, double *norm, double *vsnew)
   tangent1[1] = vs[1] - vs_dot_n*norm[1];
   tangent1[2] = vs[2] - vs_dot_n*norm[2];
   scale = 1.0/sqrt(tangent1[0]*tangent1[0] + tangent1[1]*tangent1[1] +
-		   tangent1[2]*tangent1[2]);
+                   tangent1[2]*tangent1[2]);
   tangent1[0] *= scale;
   tangent1[1] *= scale;
   tangent1[2] *= scale;
@@ -2213,7 +2213,7 @@ void FixSRD::slip_wall(double *vs, int iwall, double *norm, double *vsnew)
 ------------------------------------------------------------------------- */
 
 void FixSRD::noslip(double *vs, double *vb, double *xb, Big *big, int iwall,
-		    double *xsurf, double *norm, double *vsnew)
+                    double *xsurf, double *norm, double *vsnew)
 {
   double vs_dot_n,scale,r1,r2,vnmag,vtmag1,vtmag2;
   double tangent1[3],tangent2[3];
@@ -2224,7 +2224,7 @@ void FixSRD::noslip(double *vs, double *vb, double *xb, Big *big, int iwall,
   tangent1[1] = vs[1] - vs_dot_n*norm[1];
   tangent1[2] = vs[2] - vs_dot_n*norm[2];
   scale = 1.0/sqrt(tangent1[0]*tangent1[0] + tangent1[1]*tangent1[1] +
-		   tangent1[2]*tangent1[2]);
+                   tangent1[2]*tangent1[2]);
   tangent1[0] *= scale;
   tangent1[1] *= scale;
   tangent1[2] *= scale;
@@ -2269,8 +2269,8 @@ void FixSRD::noslip(double *vs, double *vb, double *xb, Big *big, int iwall,
 ------------------------------------------------------------------------- */
 
 void FixSRD::force_torque(double *vsold, double *vsnew,
-			  double *xs, double *xb,
-			  double *fb, double *tb)
+                          double *xs, double *xb,
+                          double *fb, double *tb)
 {
   double dpdt[3],xs_xb[3];
 
@@ -2322,7 +2322,7 @@ void FixSRD::force_wall(double *vsold, double *vsnew, int iwall)
 ------------------------------------------------------------------------- */
 
 int FixSRD::update_srd(int i, double dt, double *xscoll, double *vsnew,
-		       double *xs, double *vs)
+                       double *xs, double *vs)
 {
   int ix,iy,iz;
 
@@ -2336,13 +2336,13 @@ int FixSRD::update_srd(int i, double dt, double *xscoll, double *vsnew,
 
   if (triclinic) domain->x2lamda(xs,xs);
 
-  if (xs[0] < srdlo[0] || xs[0] > srdhi[0] || 
-      xs[1] < srdlo[1] || xs[1] > srdhi[1] || 
+  if (xs[0] < srdlo[0] || xs[0] > srdhi[0] ||
+      xs[1] < srdlo[1] || xs[1] > srdhi[1] ||
       xs[2] < srdlo[2] || xs[2] > srdhi[2]) {
     if (screen) {
       error->warning(FLERR,"Fix srd particle moved outside valid domain");
       fprintf(screen,"  particle %d on proc %d at timestep " BIGINT_FORMAT,
-	      atom->tag[i],me,update->ntimestep);
+              atom->tag[i],me,update->ntimestep);
       fprintf(screen,"  xnew %g %g %g\n",xs[0],xs[1],xs[2]);
       fprintf(screen,"  srdlo/hi x %g %g\n",srdlo[0],srdhi[0]);
       fprintf(screen,"  srdlo/hi y %g %g\n",srdlo[1],srdhi[1]);
@@ -2395,33 +2395,33 @@ void FixSRD::parameterize()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & biggroupbit) {
       if (radius && radius[i] > 0.0) {
-	maxbigdiam = MAX(maxbigdiam,2.0*radius[i]);
-	minbigdiam = MIN(minbigdiam,2.0*radius[i]);
+        maxbigdiam = MAX(maxbigdiam,2.0*radius[i]);
+        minbigdiam = MIN(minbigdiam,2.0*radius[i]);
       } else if (ellipsoid && ellipsoid[i] >= 0) {
-	any_ellipsoids = 1;
-	double *shape = ebonus[ellipsoid[i]].shape;
-	maxbigdiam = MAX(maxbigdiam,2.0*shape[0]);
-	maxbigdiam = MAX(maxbigdiam,2.0*shape[1]);
-	maxbigdiam = MAX(maxbigdiam,2.0*shape[2]);
-	minbigdiam = MIN(minbigdiam,2.0*shape[0]);
-	minbigdiam = MIN(minbigdiam,2.0*shape[1]);
-	minbigdiam = MIN(minbigdiam,2.0*shape[2]);
+        any_ellipsoids = 1;
+        double *shape = ebonus[ellipsoid[i]].shape;
+        maxbigdiam = MAX(maxbigdiam,2.0*shape[0]);
+        maxbigdiam = MAX(maxbigdiam,2.0*shape[1]);
+        maxbigdiam = MAX(maxbigdiam,2.0*shape[2]);
+        minbigdiam = MIN(minbigdiam,2.0*shape[0]);
+        minbigdiam = MIN(minbigdiam,2.0*shape[1]);
+        minbigdiam = MIN(minbigdiam,2.0*shape[2]);
       } else if (line && line[i] >= 0) {
-	any_lines = 1;
-	double length = lbonus[line[i]].length;
-	maxbigdiam = MAX(maxbigdiam,length);
-	minbigdiam = MIN(minbigdiam,length);
+        any_lines = 1;
+        double length = lbonus[line[i]].length;
+        maxbigdiam = MAX(maxbigdiam,length);
+        minbigdiam = MIN(minbigdiam,length);
       } else if (tri && tri[i] >= 0) {
-	any_tris = 1;
-	double length1 = MathExtra::len3(tbonus[tri[i]].c1);
-	double length2 = MathExtra::len3(tbonus[tri[i]].c2);
-	double length3 = MathExtra::len3(tbonus[tri[i]].c3);
-	double length = MAX(length1,length2);
-	length = MAX(length,length3);
-	maxbigdiam = MAX(maxbigdiam,length);
-	minbigdiam = MIN(minbigdiam,length);
-      } else 
-	error->one(FLERR,"Big particle in fix srd cannot be point particle");
+        any_tris = 1;
+        double length1 = MathExtra::len3(tbonus[tri[i]].c1);
+        double length2 = MathExtra::len3(tbonus[tri[i]].c2);
+        double length3 = MathExtra::len3(tbonus[tri[i]].c3);
+        double length = MAX(length1,length2);
+        length = MAX(length,length3);
+        maxbigdiam = MAX(maxbigdiam,length);
+        minbigdiam = MIN(minbigdiam,length);
+      } else
+        error->one(FLERR,"Big particle in fix srd cannot be point particle");
     }
 
   double tmp = maxbigdiam;
@@ -2462,17 +2462,17 @@ void FixSRD::parameterize()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       if (rmass) {
-	if (mass_srd == 0.0) mass_srd = rmass[i];
-	else if (rmass[i] != mass_srd) flag = 1;
+        if (mass_srd == 0.0) mass_srd = rmass[i];
+        else if (rmass[i] != mass_srd) flag = 1;
       } else {
-	if (mass_srd == 0.0) mass_srd = mass[type[i]];
-	else if (mass[type[i]] != mass_srd) flag = 1;
+        if (mass_srd == 0.0) mass_srd = mass[type[i]];
+        else if (mass[type[i]] != mass_srd) flag = 1;
       }
     }
 
   int flagall;
   MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_MAX,world);
-  if (flagall) 
+  if (flagall)
     error->all(FLERR,"Fix srd requires SRD particles all have same mass");
 
   // set temperature and lamda of SRD particles from each other
@@ -2481,7 +2481,7 @@ void FixSRD::parameterize()
   if (lamdaflag == 0)
     lamda = dt_srd * sqrt(force->boltz*temperature_srd/mass_srd/force->mvv2e);
   else
-    temperature_srd = force->mvv2e * 
+    temperature_srd = force->mvv2e *
       (lamda/dt_srd)*(lamda/dt_srd) * mass_srd/force->boltz;
 
   // vmax = maximum velocity of an SRD particle
@@ -2503,37 +2503,37 @@ void FixSRD::parameterize()
   if (dimension == 3) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & biggroupbit) {
-	if (radius && radius[i] > 0.0) {
-	  double r = radfactor * radius[i];
-	  volbig += 4.0/3.0*MY_PI * r*r*r;;
-	} else if (ellipsoid && ellipsoid[i] >= 0) {
-	  double *shape = ebonus[ellipsoid[i]].shape;
-	  volbig += 4.0/3.0*MY_PI * shape[0]*shape[1]*shape[2] *
-	    radfactor*radfactor*radfactor;
-	} else if (tri && tri[i] >= 0) {
-	  double *c1 = tbonus[tri[i]].c1;
-	  double *c2 = tbonus[tri[i]].c2;
-	  double *c3 = tbonus[tri[i]].c3;
-	  double c2mc1[3],c3mc1[3],cross[3];
-	  MathExtra::sub3(c2,c1,c2mc1);
-	  MathExtra::sub3(c3,c1,c3mc1);
-	  MathExtra::cross3(c2mc1,c3mc1,cross);
-	  volbig += 0.5 * MathExtra::len3(cross);
-	}
+        if (radius && radius[i] > 0.0) {
+          double r = radfactor * radius[i];
+          volbig += 4.0/3.0*MY_PI * r*r*r;;
+        } else if (ellipsoid && ellipsoid[i] >= 0) {
+          double *shape = ebonus[ellipsoid[i]].shape;
+          volbig += 4.0/3.0*MY_PI * shape[0]*shape[1]*shape[2] *
+            radfactor*radfactor*radfactor;
+        } else if (tri && tri[i] >= 0) {
+          double *c1 = tbonus[tri[i]].c1;
+          double *c2 = tbonus[tri[i]].c2;
+          double *c3 = tbonus[tri[i]].c3;
+          double c2mc1[3],c3mc1[3],cross[3];
+          MathExtra::sub3(c2,c1,c2mc1);
+          MathExtra::sub3(c3,c1,c3mc1);
+          MathExtra::cross3(c2mc1,c3mc1,cross);
+          volbig += 0.5 * MathExtra::len3(cross);
+        }
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & biggroupbit) {
-	if (radius && radius[i] > 0.0) {
-	  double r = radfactor * radius[i];
-	  volbig += MY_PI * r*r;
-	} else if (ellipsoid && ellipsoid[i] >= 0) {
-	  double *shape = ebonus[ellipsoid[i]].shape;
-	  volbig += MY_PI * shape[0]*shape[1] * radfactor*radfactor;
-	} else if (line && line[i] >= 0) {
-	  double length = lbonus[line[i]].length;
-	  volbig += length * WIDTH;
-	}
+        if (radius && radius[i] > 0.0) {
+          double r = radfactor * radius[i];
+          volbig += MY_PI * r*r;
+        } else if (ellipsoid && ellipsoid[i] >= 0) {
+          double *shape = ebonus[ellipsoid[i]].shape;
+          volbig += MY_PI * shape[0]*shape[1] * radfactor*radfactor;
+        } else if (line && line[i] >= 0) {
+          double length = lbonus[line[i]].length;
+          volbig += length * WIDTH;
+        }
       }
   }
 
@@ -2566,7 +2566,7 @@ void FixSRD::parameterize()
   double volsrd,density_srd;
   if (dimension == 3) {
     volsrd = (domain->xprd * domain->yprd * domain->zprd) - volbig;
-    density_srd = nsrd * mass_srd / 
+    density_srd = nsrd * mass_srd /
       (domain->xprd*domain->yprd*domain->zprd - volbig);
   } else {
     volsrd = (domain->xprd * domain->yprd) - volbig;
@@ -2606,15 +2606,15 @@ void FixSRD::parameterize()
 
   double viscosity;
   if (dimension == 3)
-    viscosity = gridsrd*gridsrd/(18.0*dt_srd) * 
-      (1.0-(1.0-exp(-srd_per_cell))/srd_per_cell) + 
+    viscosity = gridsrd*gridsrd/(18.0*dt_srd) *
+      (1.0-(1.0-exp(-srd_per_cell))/srd_per_cell) +
       (force->boltz*temperature_srd*dt_srd/(4.0*mass_srd*force->mvv2e)) *
       ((srd_per_cell+2.0)/(srd_per_cell-1.0));
   else
-    viscosity = 
+    viscosity =
       (force->boltz*temperature_srd*dt_srd/(2.0*mass_srd*force->mvv2e)) *
       (srd_per_cell/(srd_per_cell-1.0 + exp(-srd_per_cell)) - 1.0) +
-      (gridsrd*gridsrd)/(12.0*dt_srd) * 
+      (gridsrd*gridsrd)/(12.0*dt_srd) *
       ((srd_per_cell-1.0 + exp(-srd_per_cell))/srd_per_cell);
   viscosity *= force->xxt2kmu;
 
@@ -2624,16 +2624,16 @@ void FixSRD::parameterize()
     if (screen) {
       fprintf(screen,"SRD info:\n");
       fprintf(screen,
-	      "  SRD/big particles = " BIGINT_FORMAT " " BIGINT_FORMAT "\n",
-	      nsrd,mbig);
+              "  SRD/big particles = " BIGINT_FORMAT " " BIGINT_FORMAT "\n",
+              nsrd,mbig);
       fprintf(screen,"  big particle diameter max/min = %g %g\n",
-	      maxbigdiam,minbigdiam);
+              maxbigdiam,minbigdiam);
       fprintf(screen,"  SRD temperature & lamda = %g %g\n",
-	      temperature_srd,lamda);
+              temperature_srd,lamda);
       fprintf(screen,"  SRD max distance & max velocity = %g %g\n",dmax,vmax);
       fprintf(screen,"  SRD grid counts: %d %d %d\n",nbin1x,nbin1y,nbin1z);
       fprintf(screen,"  SRD grid size: request, actual (xyz) = %g, %g %g %g\n",
-	      gridsrd,binsize3x,binsize3y,binsize3z);
+              gridsrd,binsize3x,binsize3y,binsize3z);
       fprintf(screen,"  SRD per actual grid cell = %g\n",srd_per_cell);
       fprintf(screen,"  SRD viscosity = %g\n",viscosity);
       fprintf(screen,"  big/SRD mass density ratio = %g\n",mdratio);
@@ -2641,16 +2641,16 @@ void FixSRD::parameterize()
     if (logfile) {
       fprintf(logfile,"SRD info:\n");
       fprintf(logfile,
-	      "  SRD/big particles = " BIGINT_FORMAT " " BIGINT_FORMAT "\n",
-	      nsrd,mbig);
+              "  SRD/big particles = " BIGINT_FORMAT " " BIGINT_FORMAT "\n",
+              nsrd,mbig);
       fprintf(logfile,"  big particle diameter max/min = %g %g\n",
-	      maxbigdiam,minbigdiam);
+              maxbigdiam,minbigdiam);
       fprintf(logfile,"  SRD temperature & lamda = %g %g\n",
-	      temperature_srd,lamda);
+              temperature_srd,lamda);
       fprintf(logfile,"  SRD max distance & max velocity = %g %g\n",dmax,vmax);
       fprintf(logfile,"  SRD grid counts: %d %d %d\n",nbin1x,nbin1y,nbin1z);
       fprintf(logfile,"  SRD grid size: request, actual (xyz) = %g, %g %g %g\n",
-	      gridsrd,binsize3x,binsize3y,binsize3z);
+              gridsrd,binsize3x,binsize3y,binsize3z);
       fprintf(logfile,"  SRD per actual grid cell = %g\n",srd_per_cell);
       fprintf(logfile,"  SRD viscosity = %g\n",viscosity);
       fprintf(logfile,"  big/SRD mass density ratio = %g\n",mdratio);
@@ -2659,8 +2659,8 @@ void FixSRD::parameterize()
 
   // error if less than 1 SRD bin per processor in some dim
 
-  if (nbin1x < comm->procgrid[0] || nbin1y < comm->procgrid[1] || 
-      nbin1z < comm->procgrid[2]) 
+  if (nbin1x < comm->procgrid[0] || nbin1y < comm->procgrid[1] ||
+      nbin1z < comm->procgrid[2])
     error->all(FLERR,"Fewer SRD bins than processors in some dimension");
 
   // check if SRD bins are within tolerance for shape and size
@@ -2670,7 +2670,7 @@ void FixSRD::parameterize()
       binsize3x/binsize3y > 1.0+cubictol) tolflag = 1;
   if (dimension == 3) {
     if (binsize3z/binsize3x > 1.0+cubictol ||
-	binsize3x/binsize3z > 1.0+cubictol) tolflag = 1;
+        binsize3x/binsize3z > 1.0+cubictol) tolflag = 1;
   }
 
   if (tolflag) {
@@ -2695,7 +2695,7 @@ void FixSRD::parameterize()
       error->all(FLERR,"SRD bin size for fix srd differs from user request");
     if (me == 0)
       error->warning(FLERR,
-		     "SRD bin size for fix srd differs from user request");
+                     "SRD bin size for fix srd differs from user request");
   }
 
   // error if lamda < 0.6 of SRD grid size and no shifting allowed
@@ -2709,7 +2709,7 @@ void FixSRD::parameterize()
     error->all(FLERR,"Fix srd lamda must be >= 0.6 of SRD grid size");
   else if (lamda < 0.6*maxgridsrd && shiftuser == SHIFT_POSSIBLE) {
     shiftflag = 1;
-    if (me == 0) 
+    if (me == 0)
       error->warning(FLERR,"SRD bin shifting turned on due to small lamda");
   } else if (shiftuser == SHIFT_YES) shiftflag = 1;
 
@@ -2858,8 +2858,8 @@ void FixSRD::big_dynamic()
       inertiaone[1] = EINERTIA*rmass[i] * (shape[0]*shape[0]+shape[2]*shape[2]);
       inertiaone[2] = EINERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]);
       MathExtra::angmom_to_omega(angmom[i],
-				 biglist[k].ex,biglist[k].ey,biglist[k].ez,
-				 inertiaone,biglist[k].omega);
+                                 biglist[k].ex,biglist[k].ey,biglist[k].ez,
+                                 inertiaone,biglist[k].omega);
 
     // line
     // set omega from atom->omega directly
@@ -2880,10 +2880,10 @@ void FixSRD::big_dynamic()
       MathExtra::q_to_exyz(quat,biglist[k].ex,biglist[k].ey,biglist[k].ez);
       inertia = tbonus[tri[i]].inertia;
       MathExtra::angmom_to_omega(angmom[i],
-				 biglist[k].ex,biglist[k].ey,biglist[k].ez,
-				 inertia,biglist[k].omega);
+                                 biglist[k].ex,biglist[k].ey,biglist[k].ez,
+                                 inertia,biglist[k].omega);
       MathExtra::matvec(biglist[k].ex,biglist[k].ey,biglist[k].ez,
-		        biglist[k].normbody,biglist[k].norm);
+                        biglist[k].normbody,biglist[k].norm);
       MathExtra::norm3(biglist[k].norm);
     }
   }
@@ -2926,7 +2926,7 @@ void FixSRD::setup_bounds()
   //   dist_ghost = 0.0, since not used
   // if no big particles or walls:
   //   dist_ghost and dist_srd = 0.0, since not used since no search bins
-  //   dist_srd_reneigh = subsize - onemove = 
+  //   dist_srd_reneigh = subsize - onemove =
   //     max distance to move without being lost during comm->exchange()
   //   subsize = perp distance between sub-domain faces (orthog or triclinic)
 
@@ -2947,13 +2947,13 @@ void FixSRD::setup_bounds()
     if (triclinic == 0) {
       subsize = domain->prd[0]/comm->procgrid[0];
       subsize = MIN(subsize,domain->prd[1]/comm->procgrid[1]);
-      if (dimension == 3) 
-	subsize = MIN(subsize,domain->prd[2]/comm->procgrid[2]);
+      if (dimension == 3)
+        subsize = MIN(subsize,domain->prd[2]/comm->procgrid[2]);
     } else {
       subsize = 1.0/comm->procgrid[0]/length0;
       subsize = MIN(subsize,1.0/comm->procgrid[1]/length1);
-      if (dimension == 3) 
-	subsize = MIN(subsize,1.0/comm->procgrid[2]/length2);
+      if (dimension == 3)
+        subsize = MIN(subsize,1.0/comm->procgrid[2]/length2);
     }
     dist_srd_reneigh = subsize - onemove;
   }
@@ -3135,12 +3135,12 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
   double *corner = shifts[ishift].corner;
   int *procgrid = comm->procgrid;
   int *myloc = comm->myloc;
-  
+
   binlo[0] = static_cast<int> ((sublo[0]-corner[0])*bininv1x);
   binlo[1] = static_cast<int> ((sublo[1]-corner[1])*bininv1y);
   binlo[2] = static_cast<int> ((sublo[2]-corner[2])*bininv1z);
   if (dimension == 2) shifts[ishift].binlo[2] = 0;
-  
+
   binhi[0] = static_cast<int> ((subhi[0]-corner[0])*bininv1x);
   binhi[1] = static_cast<int> ((subhi[1]-corner[1])*bininv1y);
   binhi[2] = static_cast<int> ((subhi[2]-corner[2])*bininv1z);
@@ -3153,7 +3153,7 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
       binlo[1] = myloc[1]*nbin1y/procgrid[1];
     if (myloc[2]*nbin1z % procgrid[2] == 0)
       binlo[2] = myloc[2]*nbin1z/procgrid[2];
-    
+
     if ((myloc[0]+1)*nbin1x % procgrid[0] == 0)
       binhi[0] = (myloc[0]+1)*nbin1x/procgrid[0] - 1;
     if ((myloc[1]+1)*nbin1y % procgrid[1] == 0)
@@ -3161,25 +3161,25 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
     if ((myloc[2]+1)*nbin1z % procgrid[2] == 0)
       binhi[2] = (myloc[2]+1)*nbin1z/procgrid[2] - 1;
   }
-  
+
   int nbinx = binhi[0] - binlo[0] + 1;
   int nbiny = binhi[1] - binlo[1] + 1;
   int nbinz = binhi[2] - binlo[2] + 1;
 
   // allow for one extra bin if shifting will occur
-  
+
   if (ishift == 1 && dynamic == 0) {
     nbinx++;
     nbiny++;
     if (dimension == 3) nbinz++;
   }
-  
+
   int nbins = nbinx*nbiny*nbinz;
   int nbinxy = nbinx*nbiny;
   int nbinsq = nbinx*nbiny;
   nbinsq = MAX(nbiny*nbinz,nbinsq);
   nbinsq = MAX(nbinx*nbinz,nbinsq);
-  
+
   shifts[ishift].nbins = nbins;
   shifts[ishift].nbinx = nbinx;
   shifts[ishift].nbiny = nbiny;
@@ -3194,7 +3194,7 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
   // bcomm neighbors
   // first = send in lo direction, recv from hi direction
   // second = send in hi direction, recv from lo direction
-  
+
   if (dynamic == 0) {
     shifts[ishift].bcomm[0].sendproc = comm->procneigh[0][0];
     shifts[ishift].bcomm[0].recvproc = comm->procneigh[0][1];
@@ -3209,15 +3209,15 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
     shifts[ishift].bcomm[5].sendproc = comm->procneigh[2][1];
     shifts[ishift].bcomm[5].recvproc = comm->procneigh[2][0];
   }
-  
+
   // set nsend,nrecv and sendlist,recvlist for each swap in x,y,z
   // set nsend,nrecv = 0 if static bins align with proc boundary
   //   or to prevent dynamic bin swapping across non-periodic global boundary
   // allocate sendlist,recvlist only for dynamic = 0
-  
+
   first = &shifts[ishift].bcomm[0];
   second = &shifts[ishift].bcomm[1];
-  
+
   first->nsend = first->nrecv = second->nsend = second->nrecv = nbiny*nbinz;
   if (ishift == 0) {
     if (myloc[0]*nbin1x % procgrid[0] == 0)
@@ -3244,7 +3244,7 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
 
   m = 0;
   i = 0;
-  for (j = 0; j < nbiny; j++) 
+  for (j = 0; j < nbiny; j++)
     for (k = 0; k < nbinz; k++) {
       id = k*nbinxy + j*nbinx + i;
       first->sendlist[m] = second->recvlist[m] = id;
@@ -3252,16 +3252,16 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
     }
   m = 0;
   i = nbinx-1;
-  for (j = 0; j < nbiny; j++) 
+  for (j = 0; j < nbiny; j++)
     for (k = 0; k < nbinz; k++) {
       id = k*nbinxy + j*nbinx + i;
       second->sendlist[m] = first->recvlist[m] = id;
       m++;
     }
-  
+
   first = &shifts[ishift].bcomm[2];
   second = &shifts[ishift].bcomm[3];
-  
+
   first->nsend = first->nrecv = second->nsend = second->nrecv = nbinx*nbinz;
   if (ishift == 0) {
     if (myloc[1]*nbin1y % procgrid[1] == 0)
@@ -3274,7 +3274,7 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
       if (myloc[1] == procgrid[1]-1) second->nsend = first->nrecv = 0;
     }
   }
-  
+
   if (reallocflag) {
     memory->destroy(first->sendlist);
     memory->destroy(first->recvlist);
@@ -3285,10 +3285,10 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
     memory->create(second->sendlist,nbinsq,"fix/srd:sendlist");
     memory->create(second->recvlist,nbinsq,"fix/srd:sendlist");
   }
-  
+
   m = 0;
   j = 0;
-  for (i = 0; i < nbinx; i++) 
+  for (i = 0; i < nbinx; i++)
     for (k = 0; k < nbinz; k++) {
       id = k*nbinxy + j*nbinx + i;
       first->sendlist[m] = second->recvlist[m] = id;
@@ -3296,30 +3296,30 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
     }
   m = 0;
   j = nbiny-1;
-  for (i = 0; i < nbinx; i++) 
+  for (i = 0; i < nbinx; i++)
     for (k = 0; k < nbinz; k++) {
       id = k*nbinxy + j*nbinx + i;
       second->sendlist[m] = first->recvlist[m] = id;
       m++;
     }
-  
+
   if (dimension == 3) {
     first = &shifts[ishift].bcomm[4];
     second = &shifts[ishift].bcomm[5];
-    
+
     first->nsend = first->nrecv = second->nsend = second->nrecv = nbinx*nbiny;
     if (ishift == 0) {
       if (myloc[2]*nbin1z % procgrid[2] == 0)
-	first->nsend = second->nrecv = 0;
+        first->nsend = second->nrecv = 0;
       if ((myloc[2]+1)*nbin1z % procgrid[2] == 0)
-	second->nsend = first->nrecv = 0;
+        second->nsend = first->nrecv = 0;
     } else {
       if (domain->zperiodic == 0) {
-	if (myloc[2] == 0) first->nsend = second->nrecv = 0;
-	if (myloc[2] == procgrid[2]-1) second->nsend = first->nrecv = 0;
+        if (myloc[2] == 0) first->nsend = second->nrecv = 0;
+        if (myloc[2] == procgrid[2]-1) second->nsend = first->nrecv = 0;
       }
     }
-    
+
     if (reallocflag) {
       memory->destroy(first->sendlist);
       memory->destroy(first->recvlist);
@@ -3330,39 +3330,39 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
       memory->create(second->sendlist,nbinx*nbiny,"fix/srd:sendlist");
       memory->create(second->recvlist,nbinx*nbiny,"fix/srd:sendlist");
     }
-    
+
     m = 0;
     k = 0;
-    for (i = 0; i < nbinx; i++) 
+    for (i = 0; i < nbinx; i++)
       for (j = 0; j < nbiny; j++) {
-	id = k*nbinxy + j*nbinx + i;
-	first->sendlist[m] = second->recvlist[m] = id;
-	m++;
+        id = k*nbinxy + j*nbinx + i;
+        first->sendlist[m] = second->recvlist[m] = id;
+        m++;
       }
     m = 0;
     k = nbinz-1;
-    for (i = 0; i < nbinx; i++) 
+    for (i = 0; i < nbinx; i++)
       for (j = 0; j < nbiny; j++) {
-	id = k*nbinxy + j*nbinx + i;
-	second->sendlist[m] = first->recvlist[m] = id;
-	m++;
+        id = k*nbinxy + j*nbinx + i;
+        second->sendlist[m] = first->recvlist[m] = id;
+        m++;
       }
   }
-  
+
   // allocate vbins, only for dynamic = 0
-  
+
   if (dynamic == 0 && nbins > shifts[ishift].maxvbin) {
     memory->destroy(shifts[ishift].vbin);
     shifts[ishift].maxvbin = nbins;
-    shifts[ishift].vbin = (BinAve *) 
+    shifts[ishift].vbin = (BinAve *)
       memory->smalloc(nbins*sizeof(BinAve),"fix/srd:vbin");
   }
-  
+
   // for vbins I own, set owner = 1
   // if bin never sent to anyone, I own it
   // if bin sent to lower numbered proc, I do not own it
   // if bin sent to self, I do not own it on even swap (avoids double counting)
-  
+
   vbin = shifts[ishift].vbin;
   for (i = 0; i < nbins; i++) vbin[i].owner = 1;
   for (int iswap = 0; iswap < 2*dimension; iswap++) {
@@ -3380,12 +3380,12 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
     m = 0;
     for (k = 0; k < nbinz; k++)
       for (j = 0; j < nbiny; j++)
-	for (i = 0; i < nbinx; i++) {
-	  vbin[m].xctr[0] = corner[0] + (i+binlo[0]+0.5)/nbin1x;
-	  vbin[m].xctr[1] = corner[1] + (j+binlo[1]+0.5)/nbin1y;
-	  vbin[m].xctr[2] = corner[2] + (k+binlo[2]+0.5)/nbin1z;
-	  m++;
-	}
+        for (i = 0; i < nbinx; i++) {
+          vbin[m].xctr[0] = corner[0] + (i+binlo[0]+0.5)/nbin1x;
+          vbin[m].xctr[1] = corner[1] + (j+binlo[1]+0.5)/nbin1y;
+          vbin[m].xctr[2] = corner[2] + (k+binlo[2]+0.5)/nbin1z;
+          m++;
+        }
   }
 }
 
@@ -3403,7 +3403,7 @@ void FixSRD::setup_velocity_shift(int ishift, int dynamic)
 
 void FixSRD::setup_search_bins()
 {
-  // subboxlo/hi = real space bbox which 
+  // subboxlo/hi = real space bbox which
   //   owned/ghost big particles or walls can be in
   // start with bounding box for my sub-domain, add dist_ghost
   // for triclinic, need to:
@@ -3525,13 +3525,13 @@ void FixSRD::setup_search_stencil()
   for (int k = -nz; k <= nz; k++)
     for (int j = -ny; j <= ny; j++)
       for (int i = -nx; i <= nx; i++)
-	if (bin_bin_distance(i,j,k) < radsq) {
-	  stencil[nstencil][0] = i;
-	  stencil[nstencil][1] = j;
-	  stencil[nstencil][2] = k;
-	  stencil[nstencil][3] = k*nbin2y*nbin2x + j*nbin2x + i;
-	  nstencil++;
-	}
+        if (bin_bin_distance(i,j,k) < radsq) {
+          stencil[nstencil][0] = i;
+          stencil[nstencil][1] = j;
+          stencil[nstencil][2] = k;
+          stencil[nstencil][3] = k*nbin2y*nbin2x + j*nbin2x + i;
+          nstencil++;
+        }
 }
 
 /* ----------------------------------------------------------------------
@@ -3713,10 +3713,10 @@ void FixSRD::velocity_stats(int groupnum)
   if (me == 0) {
     if (screen)
       fprintf(screen,"  ave/max %s velocity = %g %g\n",
-	      group->names[groupnum],vave,vmax);
+              group->names[groupnum],vave,vmax);
     if (logfile)
       fprintf(logfile,"  ave/max %s velocity = %g %g\n",
-	      group->names[groupnum],vave,vmax);
+              group->names[groupnum],vave,vmax);
   }
 }
 
@@ -3743,7 +3743,7 @@ double FixSRD::newton_raphson(double t1, double t2)
   double temp;
   for (int i = 0; i < MAXITER; i++) {
     if ((((t-thi)*df - f)*((t-tlo)*df - f) > 0.0) ||
-	(fabs(2.0*f) > fabs(dtold*df))) {
+        (fabs(2.0*f) > fabs(dtold*df))) {
       dtold = dt;
       dt = 0.5 * (thi-tlo);
       t = tlo + dt;
@@ -3780,7 +3780,7 @@ void FixSRD::lineside(double t, double &f, double &df)
   double sinT = sin(theta);
 
   f = (p[1]-c[1]) * cosT - (p[0]-c[0]) * sinT;
-  df = ((xs1[1]-xs0[1]) - (xb1[1]-xb0[1]))*cosT - (p[1]-c[1])*sinT*dtheta - 
+  df = ((xs1[1]-xs0[1]) - (xb1[1]-xb0[1]))*cosT - (p[1]-c[1])*sinT*dtheta -
     ((xs1[0]-xs0[0]) - (xb1[0]-xb0[0]))*sinT - (p[0]-c[0])*cosT*dtheta;
 }
 
@@ -3800,7 +3800,7 @@ void FixSRD::triside(double t, double &f, double &df)
   double sinT = sin(theta);
 
   f = (p[1]-c[1]) * cosT - (p[0]-c[0]) * sinT;
-  df = ((xs1[1]-xs0[1]) - (xb1[1]-xb0[1]))*cosT - (p[1]-c[1])*sinT*dtheta - 
+  df = ((xs1[1]-xs0[1]) - (xb1[1]-xb0[1]))*cosT - (p[1]-c[1])*sinT*dtheta -
     ((xs1[0]-xs0[0]) - (xb1[0]-xb0[0]))*sinT - (p[0]-c[0])*cosT*dtheta;
 }
 
@@ -3834,9 +3834,9 @@ double FixSRD::distance(int i, int j)
 /* ---------------------------------------------------------------------- */
 
 void FixSRD::print_collision(int i, int j, int ibounce,
-			      double t_remain, double dt,
-			      double *xscoll, double *xbcoll, double *norm,
-			      int type)
+                              double t_remain, double dt,
+                              double *xscoll, double *xbcoll, double *norm,
+                              int type)
 {
   double xsstart[3],xbstart[3];
   double **x = atom->x;
@@ -3848,7 +3848,7 @@ void FixSRD::print_collision(int i, int j, int ibounce,
     printf("  local indices: %d %d\n",i,j);
     printf("  timestep = %g\n",dt);
     printf("  time remaining post-collision = %g\n",t_remain);
-    
+
     xsstart[0] = x[i][0] - dt*v[i][0];
     xsstart[1] = x[i][1] - dt*v[i][1];
     xsstart[2] = x[i][2] - dt*v[i][2];
@@ -3857,30 +3857,30 @@ void FixSRD::print_collision(int i, int j, int ibounce,
     xbstart[2] = x[j][2] - dt*v[j][2];
 
     printf("  SRD start position = %g %g %g\n",
-	   xsstart[0],xsstart[1],xsstart[2]);
+           xsstart[0],xsstart[1],xsstart[2]);
     printf("  BIG start position = %g %g %g\n",
-	   xbstart[0],xbstart[1],xbstart[2]);
+           xbstart[0],xbstart[1],xbstart[2]);
     printf("  SRD coll  position = %g %g %g\n",
-	   xscoll[0],xscoll[1],xscoll[2]);
+           xscoll[0],xscoll[1],xscoll[2]);
     printf("  BIG coll  position = %g %g %g\n",
-	   xbcoll[0],xbcoll[1],xbcoll[2]);
+           xbcoll[0],xbcoll[1],xbcoll[2]);
     printf("  SRD end   position = %g %g %g\n",x[i][0],x[i][1],x[i][2]);
     printf("  BIG end   position = %g %g %g\n",x[j][0],x[j][1],x[j][2]);
 
     printf("  SRD vel = %g %g %g\n",v[i][0],v[i][1],v[i][2]);
     printf("  BIG vel = %g %g %g\n",v[j][0],v[j][1],v[j][2]);
     printf("  surf norm = %g %g %g\n",norm[0],norm[1],norm[2]);
-    
+
     double rstart = sqrt((xsstart[0]-xbstart[0])*(xsstart[0]-xbstart[0]) +
-			 (xsstart[1]-xbstart[1])*(xsstart[1]-xbstart[1]) +
-			 (xsstart[2]-xbstart[2])*(xsstart[2]-xbstart[2]));
+                         (xsstart[1]-xbstart[1])*(xsstart[1]-xbstart[1]) +
+                         (xsstart[2]-xbstart[2])*(xsstart[2]-xbstart[2]));
     double rcoll = sqrt((xscoll[0]-xbcoll[0])*(xscoll[0]-xbcoll[0]) +
-			(xscoll[1]-xbcoll[1])*(xscoll[1]-xbcoll[1]) +
-			(xscoll[2]-xbcoll[2])*(xscoll[2]-xbcoll[2]));
+                        (xscoll[1]-xbcoll[1])*(xscoll[1]-xbcoll[1]) +
+                        (xscoll[2]-xbcoll[2])*(xscoll[2]-xbcoll[2]));
     double rend = sqrt((x[i][0]-x[j][0])*(x[i][0]-x[j][0]) +
-		       (x[i][1]-x[j][1])*(x[i][1]-x[j][1]) +
-		       (x[i][2]-x[j][2])*(x[i][2]-x[j][2]));
-    
+                       (x[i][1]-x[j][1])*(x[i][1]-x[j][1]) +
+                       (x[i][2]-x[j][2])*(x[i][2]-x[j][2]));
+
     printf("  separation at start = %g\n",rstart);
     printf("  separation at coll  = %g\n",rcoll);
     printf("  separation at end   = %g\n",rend);
@@ -3893,7 +3893,7 @@ void FixSRD::print_collision(int i, int j, int ibounce,
     printf("  local indices: %d %d\n",i,j);
     printf("  timestep = %g\n",dt);
     printf("  time remaining post-collision = %g\n",t_remain);
-    
+
     xsstart[0] = x[i][0] - dt*v[i][0];
     xsstart[1] = x[i][1] - dt*v[i][1];
     xsstart[2] = x[i][2] - dt*v[i][2];
@@ -3901,10 +3901,10 @@ void FixSRD::print_collision(int i, int j, int ibounce,
     xbstart[dim] = xwall[j] - dt*vwall[j];
 
     printf("  SRD start position = %g %g %g\n",
-	   xsstart[0],xsstart[1],xsstart[2]);
+           xsstart[0],xsstart[1],xsstart[2]);
     printf("  WALL start position = %g\n",xbstart[dim]);
     printf("  SRD coll  position = %g %g %g\n",
-	   xscoll[0],xscoll[1],xscoll[2]);
+           xscoll[0],xscoll[1],xscoll[2]);
     printf("  WALL coll position = %g\n",xbcoll[dim]);
     printf("  SRD end   position = %g %g %g\n",x[i][0],x[i][1],x[i][2]);
     printf("  WALL end  position = %g\n",xwall[j]);
@@ -3912,11 +3912,11 @@ void FixSRD::print_collision(int i, int j, int ibounce,
     printf("  SRD vel = %g %g %g\n",v[i][0],v[i][1],v[i][2]);
     printf("  WALL vel = %g\n",vwall[j]);
     printf("  surf norm = %g %g %g\n",norm[0],norm[1],norm[2]);
-    
+
     double rstart = xsstart[dim]-xbstart[dim];
     double rcoll = xscoll[dim]-xbcoll[dim];
     double rend = x[dim][0]-xwall[j];
-    
+
     printf("  separation at start = %g\n",rstart);
     printf("  separation at coll  = %g\n",rcoll);
     printf("  separation at end   = %g\n",rend);
diff --git a/src/SRD/fix_srd.h b/src/SRD/fix_srd.h
index 4d72e1bade..3bb2cdda7b 100644
--- a/src/SRD/fix_srd.h
+++ b/src/SRD/fix_srd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -46,7 +46,7 @@ class FixSRD : public Fix {
   int cubicflag,shiftuser,shiftseed,shiftflag,tstat;
   double gridsrd,gridsearch,lamda,radfactor,cubictol;
   int triclinic,change_size,change_shape,deformflag;
-  
+
   double dt_big,dt_srd;
   double mass_big,mass_srd;
   double temperature_srd;
@@ -198,29 +198,29 @@ class FixSRD : public Fix {
   int inside_wall(double *, int);
 
   double collision_sphere_exact(double *, double *, double *, double *,
-				Big *, double *, double *, double *);
+                                Big *, double *, double *, double *);
   void collision_sphere_inexact(double *, double *,
-				Big *, double *, double *, double *);
+                                Big *, double *, double *, double *);
   double collision_ellipsoid_exact(double *, double *, double *, double *,
-				   Big *, double *, double *, double *);
+                                   Big *, double *, double *, double *);
   void collision_ellipsoid_inexact(double *, double *,
-				   Big *, double *, double *, double *);
+                                   Big *, double *, double *, double *);
   double collision_line_exact(double *, double *, double *, double *,
-			      Big *, double, double *, double *, double *);
+                              Big *, double, double *, double *, double *);
   double collision_tri_exact(double *, double *, double *, double *,
-			     Big *, double, double *, double *, double *);
+                             Big *, double, double *, double *, double *);
   double collision_wall_exact(double *, int, double *,
-			      double *, double *, double *);
+                              double *, double *, double *);
   void collision_wall_inexact(double *, int, double *, double *, double *);
 
   void slip(double *, double *, double *, Big *,
-	    double *, double *,  double *);
+            double *, double *,  double *);
   void slip_wall(double *, int, double *, double *);
   void noslip(double *, double *, double *, Big *, int,
-	      double *, double *,  double *);
+              double *, double *,  double *);
 
   void force_torque(double *, double *, double *,
-		    double *, double *,  double *);
+                    double *, double *,  double *);
   void force_wall(double *, double *, int);
 
   int update_srd(int, double, double *, double *, double *, double *);
@@ -244,7 +244,7 @@ class FixSRD : public Fix {
 
   double distance(int, int);
   void print_collision(int, int, int, double, double,
-		       double *, double *, double *, int);
+                       double *, double *, double *, int);
 };
 
 }
diff --git a/src/SRD/fix_wall_srd.cpp b/src/SRD/fix_wall_srd.cpp
index a951e13c92..cd3b8df437 100644
--- a/src/SRD/fix_wall_srd.cpp
+++ b/src/SRD/fix_wall_srd.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -47,8 +47,8 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 3;
   while (iarg < narg) {
     if ((strcmp(arg[iarg],"xlo") == 0) || (strcmp(arg[iarg],"xhi") == 0) ||
-	(strcmp(arg[iarg],"ylo") == 0) || (strcmp(arg[iarg],"yhi") == 0) ||
-	(strcmp(arg[iarg],"zlo") == 0) || (strcmp(arg[iarg],"zhi") == 0)) {
+        (strcmp(arg[iarg],"ylo") == 0) || (strcmp(arg[iarg],"yhi") == 0) ||
+        (strcmp(arg[iarg],"zlo") == 0) || (strcmp(arg[iarg],"zhi") == 0)) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall/srd command");
 
       int newwall;
@@ -60,24 +60,24 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) :
       else if (strcmp(arg[iarg],"zhi") == 0) newwall = ZHI;
 
       for (int m = 0; m < nwall; m++)
-	if (newwall == wallwhich[m])
-	  error->all(FLERR,"Wall defined twice in fix wall/srd command");
+        if (newwall == wallwhich[m])
+          error->all(FLERR,"Wall defined twice in fix wall/srd command");
 
       wallwhich[nwall] = newwall;
       if (strcmp(arg[iarg+1],"EDGE") == 0) {
-	wallstyle[nwall] = EDGE;
-	int dim = wallwhich[nwall] / 2;
-	int side = wallwhich[nwall] % 2;
-	if (side == 0) coord0[nwall] = domain->boxlo[dim];
-	else coord0[nwall] = domain->boxhi[dim];
+        wallstyle[nwall] = EDGE;
+        int dim = wallwhich[nwall] / 2;
+        int side = wallwhich[nwall] % 2;
+        if (side == 0) coord0[nwall] = domain->boxlo[dim];
+        else coord0[nwall] = domain->boxhi[dim];
       } else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	wallstyle[nwall] = VARIABLE;
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	varstr[nwall] = new char[n];
-	strcpy(varstr[nwall],&arg[iarg+1][2]);
+        wallstyle[nwall] = VARIABLE;
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        varstr[nwall] = new char[n];
+        strcpy(varstr[nwall],&arg[iarg+1][2]);
       } else {
-	wallstyle[nwall] = CONSTANT;
-	coord0[nwall] = atof(arg[iarg+1]);
+        wallstyle[nwall] = CONSTANT;
+        coord0[nwall] = atof(arg[iarg+1]);
       }
 
       nwall++;
@@ -213,7 +213,7 @@ double FixWallSRD::compute_array(int i, int j)
 
   if (force_flag == 0) {
     MPI_Allreduce(&fwall[0][0],&fwall_all[0][0],3*nwall,
-		  MPI_DOUBLE,MPI_SUM,world);
+                  MPI_DOUBLE,MPI_SUM,world);
     force_flag = 1;
   }
   return fwall_all[i][j];
@@ -245,7 +245,7 @@ void FixWallSRD::wall_params(int flag)
       xwalllast[m] = xwall[m];
       xwall[m] = xnew;
       vwall[m] = (xwall[m] - xwalllast[m]) / dt;
-    } 
+    }
 
     fwall[m][0] = fwall[m][1] = fwall[m][2] = 0.0;
   }
diff --git a/src/SRD/fix_wall_srd.h b/src/SRD/fix_wall_srd.h
index d3d1eb68c9..99265ad2c8 100644
--- a/src/SRD/fix_wall_srd.h
+++ b/src/SRD/fix_wall_srd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -48,7 +48,7 @@ class FixWallSRD : public Fix {
   double dt;
   double xwalllast[6];
   bigint laststep;
-  
+
   double **fwall_all;
   int force_flag;
 };
diff --git a/src/STUBS/mpi.h b/src/STUBS/mpi.h
index e3db304874..75a4cd7aac 100644
--- a/src/STUBS/mpi.h
+++ b/src/STUBS/mpi.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -87,12 +87,12 @@ int MPI_Irecv(void *buf, int count, MPI_Datatype datatype,
               int source, int tag, MPI_Comm comm, MPI_Request *request);
 int MPI_Wait(MPI_Request *request, MPI_Status *status);
 int MPI_Waitall(int n, MPI_Request *request, MPI_Status *status);
-int MPI_Waitany(int count, MPI_Request *request, int *index, 
+int MPI_Waitany(int count, MPI_Request *request, int *index,
                 MPI_Status *status);
 int MPI_Sendrecv(void *sbuf, int scount, MPI_Datatype sdatatype,
-		  int dest, int stag, void *rbuf, int rcount,
-		  MPI_Datatype rdatatype, int source, int rtag,
-		  MPI_Comm comm, MPI_Status *status);
+                  int dest, int stag, void *rbuf, int rcount,
+                  MPI_Datatype rdatatype, int source, int rtag,
+                  MPI_Comm comm, MPI_Status *status);
 int MPI_Get_count(MPI_Status *status, MPI_Datatype datatype, int *count);
 
 int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *comm_out);
@@ -113,7 +113,7 @@ int MPI_Bcast(void *buf, int count, MPI_Datatype datatype,
 int MPI_Allreduce(void *sendbuf, void *recvbuf, int count,
                   MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
 int MPI_Reduce(void *sendbuf, void *recvbuf, int count,
-		   MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
+                   MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
 int MPI_Scan(void *sendbuf, void *recvbuf, int count,
              MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
 int MPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
@@ -128,11 +128,11 @@ int MPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
                void *recvbuf, int recvcount, MPI_Datatype recvtype,
                int root, MPI_Comm comm);
 int MPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
-		void *recvbuf, int *recvcounts, int *displs,
-		MPI_Datatype recvtype, int root, MPI_Comm comm);
+                void *recvbuf, int *recvcounts, int *displs,
+                MPI_Datatype recvtype, int root, MPI_Comm comm);
 int MPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
-		 MPI_Datatype sendtype, void *recvbuf, int recvcount,
-		 MPI_Datatype recvtype, int root, MPI_Comm comm);
+                 MPI_Datatype sendtype, void *recvbuf, int recvcount,
+                 MPI_Datatype recvtype, int root, MPI_Comm comm);
 
 #ifdef __cplusplus
 }
diff --git a/src/USER-ATC/fix_atc.cpp b/src/USER-ATC/fix_atc.cpp
index 62e4979216..2aaf89ace6 100644
--- a/src/USER-ATC/fix_atc.cpp
+++ b/src/USER-ATC/fix_atc.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -33,7 +33,7 @@
 #include "comm.h"
 #include "error.h"
 
-using namespace LAMMPS_NS; 
+using namespace LAMMPS_NS;
 using namespace FixConst;
 
 // main page of doxygen documentation
@@ -53,7 +53,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   // Set LAMMPS pointer on LammpsInterface
   ATC::LammpsInterface::instance()->set_lammps(lmp);
 
-  /*! \page man_fix_atc fix atc command 
+  /*! \page man_fix_atc fix atc command
     \section syntax
     fix AtC transfer <type> <parameter_file>
     - type\n
@@ -71,10 +71,10 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
     fix do Verlet integration and the Hardy/post-processing does not.
     After instantiating this fix, several other fix_modify commands will be
     needed to set up the problem, e.g. define the finite element mesh and
-    prescribe initial and boundary conditions. 
+    prescribe initial and boundary conditions.
 
     The following coupling example is typical, but non-exhaustive:\n
- 
+
 <TT>
      # ... commands to create and initialize the MD system \n
 
@@ -122,7 +122,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
      run             1000 \n
 </TT>
 
-    Note coupling and post-processing can be combined in the same simulations 
+    Note coupling and post-processing can be combined in the same simulations
     using separate fixes.
     \n
     For detailed exposition of the theory and algorithms please see:\n
@@ -131,21 +131,21 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       Special Issue of Computer Methods and Applied Mechanics (2008) 197:3351.
     - Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE; Klein, PA; Bammann, DJ,
       <VAR> Calculation of stress in atomistic simulation </VAR>
-      Special Issue of Modelling and Simulation in Materials Science and 
+      Special Issue of Modelling and Simulation in Materials Science and
       Engineering (2004), 12:S319
 
     Please refer to the standard
-    finite element (FE) texts, e.g. T.J.R Hughes <VAR> The finite element 
+    finite element (FE) texts, e.g. T.J.R Hughes <VAR> The finite element
     method </VAR>, Dover 2003, for the basics of FE simulation.
 
     \section restrictions
-    Thermal and two_temperature (coupling) types use a Verlet time-integration 
+    Thermal and two_temperature (coupling) types use a Verlet time-integration
     algorithm.
-    The hardy type does not contain its own time-integrator and must be used 
+    The hardy type does not contain its own time-integrator and must be used
     with a separate fix that does contain one, e.g. nve, nvt, etc.
 
-    Currently, 
-    - the coupling is restricted to thermal physics 
+    Currently,
+    - the coupling is restricted to thermal physics
     - the FE computations are done in serial on each processor.
 
     \section related
@@ -197,7 +197,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
     - \ref man_atom_element_map
     - \ref man_neighbor_reset_frequency
 
-    Note: a set of example input files with the attendant material files are 
+    Note: a set of example input files with the attendant material files are
     included with this package
     \section default
     none
@@ -212,34 +212,34 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 
   // Postprocessing
   try {
-    if (strcmp(arg[3],"hardy")==0) 
+    if (strcmp(arg[3],"hardy")==0)
     {
       if (narg < 5) {
         if (me==0) printf("Constructing ATC transfer (hardy)\n");
         atcTransfer_ = new ATC::ATC_TransferHardy(groupName);
-      } 
-      else { 
+      }
+      else {
         if (me==0) printf("Constructing ATC transfer (hardy) with parameter file %s\n",arg[4]);
         std::string matParamFile = arg[4];
         atcTransfer_ = new ATC::ATC_TransferHardy(groupName,matParamFile);
       }
     }
     // PhysicsTypes
-    else if (strcmp(arg[3],"thermal")==0) 
+    else if (strcmp(arg[3],"thermal")==0)
     {
       std::string matParamFile = arg[4];
       if (me==0) printf("Constructing ATC transfer (thermal) with parameter file %s\n",arg[4]);
       atcTransfer_ = new ATC::ATC_TransferThermal(groupName,matParamFile);
       lmp->atom->add_callback(0); // NOTE what is this?
     }
-    else if (strcmp(arg[3],"two_temperature")==0) 
+    else if (strcmp(arg[3],"two_temperature")==0)
     {
       std::string matParamFile = arg[4];
       if (me==0) printf("Constructing ATC transfer (two_temperature) with parameter file %s\n",arg[4]);
       atcTransfer_ = new ATC::ATC_TransferThermal(groupName,matParamFile,
                          ATC::TWO_TEMPERATURE);
     }
-    else 
+    else
     {
       lmp->error->all(FLERR,"Unknown physics type in ATC");
     }
@@ -293,7 +293,7 @@ int FixATC::setmask()
 
 int FixATC::modify_param(int narg, char** arg)
 {
-  bool match; 
+  bool match;
 
   // pass on to transfer layer
   try {
@@ -406,15 +406,15 @@ void FixATC::unpack_restart(int nlocal, int nth){
 /* ----------------------------------------------------------------------
    maxsize of any atom's restart data
    ------------------------------------------------------------------------- */
- 
+
 int FixATC::maxsize_restart(){
   return 0;
 }
- 
+
 /* ----------------------------------------------------------------------
    size of atom nlocal's restart data
    ------------------------------------------------------------------------- */
- 
+
 int FixATC::size_restart(int nlocal){
   return 0;
 }
diff --git a/src/USER-ATC/fix_atc.h b/src/USER-ATC/fix_atc.h
index de9f1539ef..879b465bd3 100644
--- a/src/USER-ATC/fix_atc.h
+++ b/src/USER-ATC/fix_atc.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -34,12 +34,12 @@ namespace LAMMPS_NS {
   class  NeighList;
 
   class FixATC : public Fix {
-  public: 
+  public:
     /** constructor & destructor */
     FixATC(class LAMMPS *, int, char **);
     ~FixATC();
 
-    /** calls ATC_Transfer */ 
+    /** calls ATC_Transfer */
     void init();
     void init_list(int id, NeighList *ptr) {
       ATC::LammpsInterface::instance()->init_list(id,ptr);
@@ -63,7 +63,7 @@ namespace LAMMPS_NS {
     void copy_arrays(int, int);
     int pack_exchange(int, double *);
     int unpack_exchange(int, double *);
-    int pack_comm(int , int *, double *, int, int *);  
+    int pack_comm(int , int *, double *, int, int *);
     void unpack_comm(int, int, double *);
 
     /** modify atc parameters (parser) */
diff --git a/src/USER-AWPMD/atom_vec_wavepacket.cpp b/src/USER-AWPMD/atom_vec_wavepacket.cpp
index 16cda89c52..52aa2c1822 100644
--- a/src/USER-AWPMD/atom_vec_wavepacket.cpp
+++ b/src/USER-AWPMD/atom_vec_wavepacket.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -38,21 +38,21 @@ AtomVecWavepacket::AtomVecWavepacket(LAMMPS *lmp, int narg, char **arg) :
   AtomVec(lmp, narg, arg)
 {
   comm_x_only = comm_f_only = 0;
-  
+
   mass_type = 1;
   molecular = 0;
-  
+
   size_forward = 4; // coords[3]+radius[1]
-  size_reverse = 10; // force[3]+erforce[1]+ervelforce[1]+vforce[3]+csforce[2]	
-  size_border = 10; // coords[3]+tag[1]+type[1]+mask[1]+q[1]+spin[1]+eradius[1]+etag[1]	
-  size_velocity = 6; // +velocities[3]+ ervel[1]+cs[2] 
+  size_reverse = 10; // force[3]+erforce[1]+ervelforce[1]+vforce[3]+csforce[2]
+  size_border = 10; // coords[3]+tag[1]+type[1]+mask[1]+q[1]+spin[1]+eradius[1]+etag[1]
+  size_velocity = 6; // +velocities[3]+ ervel[1]+cs[2]
   size_data_atom = 11; // for input file: 1-tag 2-type 3-q 4-spin 5-eradius 6-etag 7-cs_re 8-cs_im 9-x 10-y 11-z
   size_data_vel = 5; // for input file: vx vy vz ervel <??>
   xcol_data = 9; // starting column for x data
-  
-  atom->wavepacket_flag = 1;  
+
+  atom->wavepacket_flag = 1;
   atom->electron_flag = 1; // compatible with eff
-  atom->q_flag = atom->spin_flag = atom->eradius_flag = 
+  atom->q_flag = atom->spin_flag = atom->eradius_flag =
     atom->ervel_flag = atom->erforce_flag = 1;
 
   atom->cs_flag = atom->csforce_flag = atom->vforce_flag = atom->ervelforce_flag = atom->etag_flag = 1;
@@ -63,7 +63,7 @@ AtomVecWavepacket::AtomVecWavepacket(LAMMPS *lmp, int narg, char **arg) :
 /* ----------------------------------------------------------------------
    grow atom-electron arrays
    n = 0 grows arrays by DELTA
-   n > 0 allocates arrays to size n 
+   n > 0 allocates arrays to size n
 ------------------------------------------------------------------------- */
 
 void AtomVecWavepacket::grow(int n)
@@ -71,7 +71,7 @@ void AtomVecWavepacket::grow(int n)
   if (n == 0) nmax += DELTA;
   else nmax = n;
   atom->nmax = nmax;
-  
+
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
   mask = memory->grow(atom->mask,nmax,"atom:mask");
@@ -90,10 +90,10 @@ void AtomVecWavepacket::grow(int n)
   csforce = memory->grow(atom->csforce,2*nmax,"atom:csforce");
   vforce = memory->grow(atom->vforce,3*nmax,"atom:vforce");
   ervelforce = memory->grow(atom->ervelforce,nmax,"atom:ervelforce");
-  etag = memory->grow(atom->etag,nmax,"atom:etag");  
- 
+  etag = memory->grow(atom->etag,nmax,"atom:etag");
+
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
 }
 
@@ -113,7 +113,7 @@ void AtomVecWavepacket::grow_reset()
   csforce = atom->csforce;
   vforce = atom->vforce;
   ervelforce = atom->ervelforce;
-  etag = atom->etag;  
+  etag = atom->etag;
 
 }
 
@@ -133,19 +133,19 @@ void AtomVecWavepacket::copy(int i, int j, int delflag)
   v[j][0] = v[i][0];
   v[j][1] = v[i][1];
   v[j][2] = v[i][2];
-  
+
   q[j] = q[i];
   spin[j] = spin[i];
   eradius[j] = eradius[i];
   ervel[j] = ervel[i];
-  
+
   cs[2*j] = cs[2*i];
-  cs[2*j+1] = cs[2*i+1]; 
-  etag[j] = etag[i];  
+  cs[2*j+1] = cs[2*i+1];
+  etag[j] = etag[i];
 
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
 }
 
@@ -153,7 +153,7 @@ void AtomVecWavepacket::copy(int i, int j, int delflag)
 // this will be used as partial pack for unsplit Hartree packets (v, ervel not regarded as separate variables)
 
 int AtomVecWavepacket::pack_comm(int n, int *list, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -192,7 +192,7 @@ int AtomVecWavepacket::pack_comm(int n, int *list, double *buf,
 // this is a complete pack of all 'position' variables of AWPMD
 
 int AtomVecWavepacket::pack_comm_vel(int n, int *list, double *buf,
-				   int pbc_flag, int *pbc)
+                                   int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -225,14 +225,14 @@ int AtomVecWavepacket::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = eradius[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = eradius[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
 
         buf[m++] = ervel[j];
         buf[m++] = cs[2*j];
@@ -243,20 +243,20 @@ int AtomVecWavepacket::pack_comm_vel(int n, int *list, double *buf,
       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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = eradius[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = eradius[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
         buf[m++] = ervel[j];
         buf[m++] = cs[2*j];
         buf[m++] = cs[2*j+1];
@@ -288,7 +288,7 @@ int AtomVecWavepacket::pack_comm_hybrid(int n, int *list, double *buf)
 void AtomVecWavepacket::unpack_comm(int n, int first, double *buf)
 {
   int i,m,last;
-  
+
   m = 0;
   last = first + n;
   for (i = first; i < last; i++) {
@@ -304,7 +304,7 @@ void AtomVecWavepacket::unpack_comm(int n, int first, double *buf)
 void AtomVecWavepacket::unpack_comm_vel(int n, int first, double *buf)
 {
   int i,m,last;
-  
+
   m = 0;
   last = first + n;
   for (i = first; i < last; i++) {
@@ -317,7 +317,7 @@ void AtomVecWavepacket::unpack_comm_vel(int n, int first, double *buf)
     v[i][2] = buf[m++];
 
     ervel[i] = buf[m++];
-    cs[2*i] =  buf[m++]; 
+    cs[2*i] =  buf[m++];
     cs[2*i+1] = buf[m++];
   }
 }
@@ -333,7 +333,7 @@ int AtomVecWavepacket::unpack_comm_hybrid(int n, int first, double *buf)
   for (i = first; i < last; i++){
     eradius[i] = buf[m++];
     ervel[i] = buf[m++];
-    cs[2*i] =  buf[m++]; 
+    cs[2*i] =  buf[m++];
     cs[2*i+1] = buf[m++];
   }
   return m;
@@ -344,7 +344,7 @@ int AtomVecWavepacket::unpack_comm_hybrid(int n, int first, double *buf)
 int AtomVecWavepacket::pack_reverse(int n, int first, double *buf)
 {
   int i,m,last;
-  
+
   m = 0;
   last = first + n;
   for (i = first; i < last; i++) { //10
@@ -352,7 +352,7 @@ int AtomVecWavepacket::pack_reverse(int n, int first, double *buf)
     buf[m++] = f[i][1];
     buf[m++] = f[i][2];
     buf[m++] = erforce[i];
-    
+
     buf[m++] = ervelforce[i];
     buf[m++] = vforce[3*i];
     buf[m++] = vforce[3*i+1];
@@ -373,7 +373,7 @@ int AtomVecWavepacket::pack_reverse_hybrid(int n, int first, double *buf)
   last = first + n;
   for (i = first; i < last; i++){
     buf[m++] = erforce[i];
-    
+
     buf[m++] = ervelforce[i];
     buf[m++] = vforce[3*i];
     buf[m++] = vforce[3*i+1];
@@ -389,7 +389,7 @@ int AtomVecWavepacket::pack_reverse_hybrid(int n, int first, double *buf)
 void AtomVecWavepacket::unpack_reverse(int n, int *list, double *buf)
 {
   int i,j,m;
-  
+
   m = 0;
   for (i = 0; i < n; i++) {
     j = list[i];
@@ -431,7 +431,7 @@ int AtomVecWavepacket::unpack_reverse_hybrid(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 // will be used for Hartree unsplit version (the etag is added however)
 int AtomVecWavepacket::pack_border(int n, int *list, double *buf,
-				 int pbc_flag, int *pbc)
+                                 int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -481,7 +481,7 @@ int AtomVecWavepacket::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecWavepacket::pack_border_vel(int n, int *list, double *buf,
-				     int pbc_flag, int *pbc)
+                                     int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -522,23 +522,23 @@ int AtomVecWavepacket::pack_border_vel(int n, int *list, double *buf,
     }
     if (domain->triclinic == 0) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = q[j];
-	buf[m++] = spin[j];
-	buf[m++] = eradius[j];
-	buf[m++] = etag[j];
-        
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = q[j];
+        buf[m++] = spin[j];
+        buf[m++] = eradius[j];
+        buf[m++] = etag[j];
+
         buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+
 
-        
         buf[m++] = ervel[j];
         buf[m++] = cs[2*j];
         buf[m++] = cs[2*j+1];
@@ -548,27 +548,27 @@ int AtomVecWavepacket::pack_border_vel(int n, int *list, double *buf,
       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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = q[j];
-	buf[m++] = spin[j];
-	buf[m++] = eradius[j];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = q[j];
+        buf[m++] = spin[j];
+        buf[m++] = eradius[j];
         buf[m++] = etag[j];
 
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
 
         buf[m++] = ervel[j];
         buf[m++] = cs[2*j];
@@ -605,7 +605,7 @@ int AtomVecWavepacket::pack_border_hybrid(int n, int *list, double *buf)
 void AtomVecWavepacket::unpack_border(int n, int first, double *buf)
 {
   int i,m,last;
-  
+
   m = 0;
   last = first + n;
   for (i = first; i < last; i++) {
@@ -615,7 +615,7 @@ void AtomVecWavepacket::unpack_border(int n, int first, double *buf)
     x[i][2] = buf[m++];
     tag[i] = static_cast<int> (buf[m++]);
     type[i] = static_cast<int> (buf[m++]);
-    mask[i] = static_cast<int> (buf[m++]);		
+    mask[i] = static_cast<int> (buf[m++]);
     q[i] = buf[m++];
     spin[i] = static_cast<int> (buf[m++]);
     eradius[i] = buf[m++];
@@ -628,7 +628,7 @@ void AtomVecWavepacket::unpack_border(int n, int first, double *buf)
 void AtomVecWavepacket::unpack_border_vel(int n, int first, double *buf)
 {
   int i,m,last;
-  
+
   m = 0;
   last = first + n;
   for (i = first; i < last; i++) {
@@ -648,7 +648,7 @@ void AtomVecWavepacket::unpack_border_vel(int n, int first, double *buf)
     v[i][1] = buf[m++];
     v[i][2] = buf[m++];
 
-    
+
     ervel[i] = buf[m++];
     cs[2*i] = buf[m++];
     cs[2*i+1] = buf[m++];
@@ -678,7 +678,7 @@ int AtomVecWavepacket::unpack_border_hybrid(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 int AtomVecWavepacket::pack_exchange(int i, double *buf)
@@ -693,7 +693,7 @@ int AtomVecWavepacket::pack_exchange(int i, double *buf)
   buf[m++] = tag[i];
   buf[m++] = type[i];
   buf[m++] = mask[i];
-  buf[m++] = image[i];	
+  buf[m++] = image[i];
   buf[m++] = q[i];
   buf[m++] = spin[i];
   buf[m++] = eradius[i];
@@ -702,11 +702,11 @@ int AtomVecWavepacket::pack_exchange(int i, double *buf)
   buf[m++] = etag[i];
   buf[m++] = cs[2*i];
   buf[m++] = cs[2*i+1];
-  
+
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
-  
+
   buf[0] = m;
   return m;
 }
@@ -717,7 +717,7 @@ int AtomVecWavepacket::unpack_exchange(double *buf)
 {
   int nlocal = atom->nlocal;
   if (nlocal == nmax) grow(0);
-  
+
   int m = 1;
   x[nlocal][0] = buf[m++];
   x[nlocal][1] = buf[m++];
@@ -728,7 +728,7 @@ int AtomVecWavepacket::unpack_exchange(double *buf)
   tag[nlocal] = static_cast<int> (buf[m++]);
   type[nlocal] = static_cast<int> (buf[m++]);
   mask[nlocal] = static_cast<int> (buf[m++]);
-  image[nlocal] = static_cast<int> (buf[m++]);	
+  image[nlocal] = static_cast<int> (buf[m++]);
   q[nlocal] = buf[m++];
   spin[nlocal] = static_cast<int> (buf[m++]);
   eradius[nlocal] = buf[m++];
@@ -737,12 +737,12 @@ int AtomVecWavepacket::unpack_exchange(double *buf)
   etag[nlocal] = buf[m++];
   cs[2*nlocal] = buf[m++];
   cs[2*nlocal+1] = buf[m++];
-  
+
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
-  
+        unpack_exchange(nlocal,&buf[m]);
+
   atom->nlocal++;
   return m;
 }
@@ -755,22 +755,22 @@ int AtomVecWavepacket::unpack_exchange(double *buf)
 int AtomVecWavepacket::size_restart()
 {
   int i;
-  
+
   int nlocal = atom->nlocal;
-  int n = 18 * nlocal;	// Associated with pack_restart
-  
+  int n = 18 * nlocal;        // Associated with pack_restart
+
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
-  
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+
   return n;
 }
 
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecWavepacket::pack_restart(int i, double *buf)
@@ -786,7 +786,7 @@ int AtomVecWavepacket::pack_restart(int i, double *buf)
   buf[m++] = v[i][0];
   buf[m++] = v[i][1];
   buf[m++] = v[i][2];
-  
+
   buf[m++] = q[i];
   buf[m++] = spin[i];
   buf[m++] = eradius[i];
@@ -795,11 +795,11 @@ int AtomVecWavepacket::pack_restart(int i, double *buf)
   buf[m++] = etag[i];
   buf[m++] = cs[2*i];
   buf[m++] = cs[2*i+1];
-  
+
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
-  
+
   buf[0] = m;
   return m;
 }
@@ -816,7 +816,7 @@ int AtomVecWavepacket::unpack_restart(double *buf)
     if (atom->nextra_store)
       memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
   }
-  
+
   int m = 1;
   x[nlocal][0] = buf[m++];
   x[nlocal][1] = buf[m++];
@@ -828,7 +828,7 @@ int AtomVecWavepacket::unpack_restart(double *buf)
   v[nlocal][0] = buf[m++];
   v[nlocal][1] = buf[m++];
   v[nlocal][2] = buf[m++];
-  
+
   q[nlocal] = buf[m++];
   spin[nlocal] = static_cast<int> (buf[m++]);
   eradius[nlocal] = buf[m++];
@@ -837,13 +837,13 @@ int AtomVecWavepacket::unpack_restart(double *buf)
   etag[nlocal] = buf[m++];
   cs[2*nlocal] = buf[m++];
   cs[2*nlocal+1] = buf[m++];
-  
+
   double **extra = atom->extra;
   if (atom->nextra_store) {
     int size = static_cast<int> (buf[0]) - m;
     for (int i = 0; i < size; i++) extra[nlocal][i] = buf[m++];
   }
-  
+
   atom->nlocal++;
   return m;
 }
@@ -858,7 +858,7 @@ void AtomVecWavepacket::create_atom(int itype, double *coord)
 {
   int nlocal = atom->nlocal;
   if (nlocal == nmax) grow(0);
-  
+
   tag[nlocal] = 0;
   type[nlocal] = itype;
   x[nlocal][0] = coord[0];
@@ -869,12 +869,12 @@ void AtomVecWavepacket::create_atom(int itype, double *coord)
   v[nlocal][0] = 0.0;
   v[nlocal][1] = 0.0;
   v[nlocal][2] = 0.0;
-  
+
   q[nlocal] = 1.;
   spin[nlocal] = 0.;
-  eradius[nlocal] = 0.0;	
-  ervel[nlocal] = 0.0; 
-  
+  eradius[nlocal] = 0.0;
+  ervel[nlocal] = 0.0;
+
   etag[nlocal]= 0.;
   cs[2*nlocal] = 0.;
   cs[2*nlocal+1] = 0.;
@@ -891,41 +891,41 @@ void AtomVecWavepacket::create_atom(int itype, double *coord)
 void AtomVecWavepacket::data_atom(double *coord, int imagetmp, char **values)
 {
   int nlocal = atom->nlocal;
-  
+
   if (nlocal == nmax) grow(0);
-  
+
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
     error->one(FLERR,"Invalid atom ID in Atoms section of data file (ID tag must be >0)");
-  
+
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
     error->one(FLERR,"Invalid atom type in Atoms section of data file");
-  
+
   q[nlocal] = atof(values[2]);
   spin[nlocal] = atoi(values[3]);
   eradius[nlocal] = atof(values[4]);
   if (eradius[nlocal] < 0.0)
     error->one(FLERR,"Invalid eradius in Atoms section of data file");
-  
+
 
   etag[nlocal] = atoi(values[5]);
   cs[2*nlocal] = atoi(values[6]);
   cs[2*nlocal+1] = atof(values[7]);
-  
-  
+
+
   x[nlocal][0] = coord[0];
   x[nlocal][1] = coord[1];
   x[nlocal][2] = coord[2];
-  
+
   image[nlocal] = imagetmp;
-  
+
   mask[nlocal] = 1;
   v[nlocal][0] = 0.0;
   v[nlocal][1] = 0.0;
   v[nlocal][2] = 0.0;
   ervel[nlocal] = 0.0;
-  
+
   atom->nlocal++;
 }
 
@@ -941,17 +941,17 @@ int AtomVecWavepacket::data_atom_hybrid(int nlocal, char **values)
   eradius[nlocal] = atof(values[2]);
   if (eradius[nlocal] < 0.0)
     error->one(FLERR,"Invalid eradius in Atoms section of data file");
-  
+
   etag[nlocal] = atoi(values[3]);
   cs[2*nlocal] = atoi(values[4]);
   cs[2*nlocal+1] = atof(values[5]);
-  
-  
+
+
   v[nlocal][0] = 0.0;
   v[nlocal][1] = 0.0;
   v[nlocal][2] = 0.0;
   ervel[nlocal] = 0.0;
-  
+
   return 3;
 }
 
@@ -978,13 +978,13 @@ int AtomVecWavepacket::data_vel_hybrid(int m, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecWavepacket::memory_usage()
 {
   bigint bytes = 0;
-  
+
   if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
   if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
   if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
@@ -992,7 +992,7 @@ bigint AtomVecWavepacket::memory_usage()
   if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
   if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
   if (atom->memcheck("f")) bytes += memory->usage(f,nmax*comm->nthreads,3);
-  
+
   if (atom->memcheck("q")) bytes += memory->usage(q,nmax);
   if (atom->memcheck("spin")) bytes += memory->usage(spin,nmax);
   if (atom->memcheck("eradius")) bytes += memory->usage(eradius,nmax);
@@ -1004,6 +1004,6 @@ bigint AtomVecWavepacket::memory_usage()
   if (atom->memcheck("csforce")) bytes += memory->usage(csforce,2*nmax);
   if (atom->memcheck("vforce")) bytes += memory->usage(vforce,3*nmax);
   if (atom->memcheck("etag")) bytes += memory->usage(etag,nmax);
-  
+
   return bytes;
 }
diff --git a/src/USER-AWPMD/atom_vec_wavepacket.h b/src/USER-AWPMD/atom_vec_wavepacket.h
index 4515dcf0fb..f98caca33c 100644
--- a/src/USER-AWPMD/atom_vec_wavepacket.h
+++ b/src/USER-AWPMD/atom_vec_wavepacket.h
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -28,7 +28,7 @@ AtomStyle(wavepacket,AtomVecWavepacket)
 #include "atom_vec.h"
 
 namespace LAMMPS_NS {
-  
+
 class AtomVecWavepacket : public AtomVec {
 public:
   AtomVecWavepacket(class LAMMPS *, int, char **);
@@ -63,11 +63,11 @@ public:
   void data_vel(int, char **);
   int data_vel_hybrid(int, char **);
   bigint memory_usage();
-  
+
 private:
   int *tag,*type,*mask,*image;
   double **x,**v,**f;
-  
+
   ///\en spin: -1 or 1 for electron, 0 for ion (compatible with eff)
   int *spin;
   ///\en charge: must be specified in the corresponding units (-1 for electron in real units, eff compatible)
@@ -91,7 +91,7 @@ private:
    ///\en (generalized) force on radius velocity, size is N
   double *ervelforce;
 };
- 
+
 }
 
 #endif
diff --git a/src/USER-AWPMD/fix_nve_awpmd.cpp b/src/USER-AWPMD/fix_nve_awpmd.cpp
index 8fbf2fa8a5..377d42b37e 100644
--- a/src/USER-AWPMD/fix_nve_awpmd.cpp
+++ b/src/USER-AWPMD/fix_nve_awpmd.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -36,9 +36,9 @@ using namespace FixConst;
 FixNVEAwpmd::FixNVEAwpmd(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (!atom->wavepacket_flag) 
+  if (!atom->wavepacket_flag)
     error->all(FLERR,"Fix nve/awpmd requires atom style wavepacket");
-  //if (!atom->mass_type != 1) 
+  //if (!atom->mass_type != 1)
    // error->all(FLERR,"Fix nve/awpmd requires per type mass");
 
   time_integrate = 1;
@@ -47,7 +47,7 @@ FixNVEAwpmd::FixNVEAwpmd(LAMMPS *lmp, int narg, char **arg) :
 /* ---------------------------------------------------------------------- */
 
 int FixNVEAwpmd::setmask()
-{   
+{
   int mask = 0;
   mask |= INITIAL_INTEGRATE;
   mask |= FINAL_INTEGRATE;
@@ -76,7 +76,7 @@ void FixNVEAwpmd::init()
 
 void FixNVEAwpmd::initial_integrate(int vflag)
 {
- 
+
 
   // update v,vr and x,radius of atoms in group
 
@@ -90,8 +90,8 @@ void FixNVEAwpmd::initial_integrate(int vflag)
   double *ervelforce=atom->ervelforce;
   double *cs=atom->cs;
   double *csforce=atom->csforce;
-  
-  
+
+
   double *mass = atom->mass;
   int *spin = atom->spin;
   int *type = atom->type;
@@ -100,7 +100,7 @@ void FixNVEAwpmd::initial_integrate(int vflag)
   if (igroup == atom->firstgroup) nlocal = atom->nfirst;
 
   // x + dt * [v + 0.5 * dt * (f / m)];
-  
+
   // simple Euler update
   for (int i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
@@ -150,4 +150,3 @@ void FixNVEAwpmd::reset_dt()
   dtv = update->dt;
   dtf = 0.5 * update->dt * force->ftm2v;
 }
-
diff --git a/src/USER-AWPMD/fix_nve_awpmd.h b/src/USER-AWPMD/fix_nve_awpmd.h
index 9bc6d3ebb8..364196c1f8 100644
--- a/src/USER-AWPMD/fix_nve_awpmd.h
+++ b/src/USER-AWPMD/fix_nve_awpmd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp
index 4644f1a2ce..da7825398e 100644
--- a/src/USER-AWPMD/pair_awpmd_cut.cpp
+++ b/src/USER-AWPMD/pair_awpmd_cut.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -92,7 +92,7 @@ struct cmp_x{
       d=xx[left.second][2]-xx[right.second][2];
       if(d<-tol)
         return true;
-      else 
+      else
         return false;
     }
     else
@@ -104,13 +104,13 @@ struct cmp_x{
 
 void PairAWPMDCut::compute(int eflag, int vflag)
 {
-  
+
   // pvector = [KE, Pauli, ecoul, radial_restraint]
   for (int i=0; i<4; i++) pvector[i] = 0.0;
 
-  if (eflag || vflag) 
+  if (eflag || vflag)
     ev_setup(eflag,vflag);
-  else 
+  else
     evflag = vflag_fdotr = 0; //??
 
   double **x = atom->x;
@@ -118,7 +118,7 @@ void PairAWPMDCut::compute(int eflag, int vflag)
   double *q = atom->q;
   double *erforce = atom->erforce;
   double *eradius = atom->eradius;
-  int *spin = atom->spin;	
+  int *spin = atom->spin;
   int *type = atom->type;
   int *etag = atom->etag;
   double **v = atom->v;
@@ -135,15 +135,15 @@ void PairAWPMDCut::compute(int eflag, int vflag)
   int *numneigh = list->numneigh;
   int **firstneigh = list->firstneigh;
 
- 
-  
+
+
 
   // width pbc
   if(width_pbc<0)
     wpmd->Lextra=2*half_box_length;
-  else 
+  else
     wpmd->Lextra=width_pbc;
-  
+
   wpmd->newton_pair=newton_pair;
 
 
@@ -151,7 +151,7 @@ void PairAWPMDCut::compute(int eflag, int vflag)
 # if 1
   // mapping of the LAMMPS numbers to the AWPMC numbers
   vector<int> gmap(ntot,-1);
-  
+
   for (int ii = 0; ii < inum; ii++) {
     int i = ilist[ii];
     // local particles are all there
@@ -168,19 +168,19 @@ void PairAWPMDCut::compute(int eflag, int vflag)
         int jtype = type[j];
         double rsq=(ri-rj).norm2();
         if (rsq < cutsq[itype][jtype])
-          gmap[j]=0; //bingo, this ghost is really needed         
-        
+          gmap[j]=0; //bingo, this ghost is really needed
+
       }
     }
   }
-	
-# else  // old mapping 
+
+# else  // old mapping
   // mapping of the LAMMPS numbers to the AWPMC numbers
   vector<int> gmap(ntot,-1);
   // map for filtering the clones out: [tag,image] -> id
   typedef  map< pair<int,int>, int, cmp_x >  map_t;
   cmp_x cmp(x);
-  map_t idmap(cmp); 
+  map_t idmap(cmp);
   for (int ii = 0; ii < inum; ii++) {
     int i = ilist[ii];
     // local particles are all there
@@ -205,7 +205,7 @@ void PairAWPMDCut::compute(int eflag, int vflag)
           gmap[j]=-1; // filter out
         continue;
       }
-      
+
       bool j_local= j<nlocal ? true : false;
       if((i_local && !j_local) || (j_local && !i_local)){ // some of them is a ghost
         Vector_3 rj=Vector_3(x[j][0],x[j][1],x[j][2]);
@@ -217,7 +217,7 @@ void PairAWPMDCut::compute(int eflag, int vflag)
             break; // don't need to continue j loop
           }
           else
-            gmap[j]=0; //bingo, this ghost is really needed         
+            gmap[j]=0; //bingo, this ghost is really needed
         }
       }
     }
@@ -231,11 +231,11 @@ void PairAWPMDCut::compute(int eflag, int vflag)
   for (int i = 0; i < ntot; i++) {
     //int i = ilist[ii];
     if(gmap[i]<0) // this particle was filtered out
-      continue; 
+      continue;
     if(spin[i]==0)  // this is an ion
       gmap[i]=wpmd->add_ion(q[i], Vector_3(x[i][0],x[i][1],x[i][2]),i<nlocal ? atom->tag[i] : -atom->tag[i]);
     else if(spin[i]==1 || spin[i]==-1){ // electron, sort them according to the tag
-      etmap[etag[i]].push_back(i);   
+      etmap[etag[i]].push_back(i);
     }
     else
       error->all(FLERR,fmt("Invalid spin value (%d) for particle %d !",spin[i],i));
@@ -245,7 +245,7 @@ void PairAWPMDCut::compute(int eflag, int vflag)
   if(wpmd->ni)
     fi= new Vector_3[wpmd->ni];
 
-  // adding electrons 
+  // adding electrons
   for(map<int,vector<int> >::iterator it=etmap.begin(); it!= etmap.end(); ++it){
     vector<int> &el=it->second;
     if(!el.size()) // should not happen
@@ -276,7 +276,7 @@ void PairAWPMDCut::compute(int eflag, int vflag)
   for (int ii = 0; ii < inum; ii++) {
     int i = ilist[ii];
     if(gmap[i]<0) // this particle was filtered out
-      continue; 
+      continue;
     if(spin[i]==0){  // this is an ion, copying forces
       int ion=gmap[i];
       f[i][0]=fi[ion][0];
@@ -286,8 +286,8 @@ void PairAWPMDCut::compute(int eflag, int vflag)
     else { // electron
       int iel=gmap[i];
       int s=spin[i] >0 ? 0 : 1;
-      wpmd->get_wp_force(s,iel,(Vector_3 *)f[i],(Vector_3 *)(atom->vforce+3*i),atom->erforce+i,atom->ervelforce+i,(Vector_2 *)(atom->csforce+2*i));  
-    }  
+      wpmd->get_wp_force(s,iel,(Vector_3 *)f[i],(Vector_3 *)(atom->vforce+3*i),atom->erforce+i,atom->ervelforce+i,(Vector_2 *)(atom->csforce+2*i));
+    }
   }
 
   if(fi)
@@ -295,7 +295,7 @@ void PairAWPMDCut::compute(int eflag, int vflag)
 
   // update LAMMPS energy
   if (eflag_either) {
-    if (eflag_global){ 
+    if (eflag_global){
       eng_coul+= wpmd->get_energy();
       // pvector = [KE, Pauli, ecoul, radial_restraint]
       pvector[0] = wpmd->Ee[0]+wpmd->Ee[1];
@@ -303,12 +303,12 @@ void PairAWPMDCut::compute(int eflag, int vflag)
       pvector[1] = pvector[0] + pvector[2] - wpmd->Edk - wpmd->Edc - wpmd->Eii;  // All except diagonal terms
       pvector[3] = wpmd->Ew;
     }
-    
+
     if (eflag_atom) {
       // transfer per-atom energies here
       for (int i = 0; i < ntot; i++) {
         if(gmap[i]<0) // this particle was filtered out
-          continue; 
+          continue;
         if(spin[i]==0){
           eatom[i]=wpmd->Eiep[gmap[i]]+wpmd->Eiip[gmap[i]];
         }
@@ -321,10 +321,10 @@ void PairAWPMDCut::compute(int eflag, int vflag)
   }
   if (vflag_fdotr) {
     virial_fdotr_compute();
-    if (flexible_pressure_flag) 
+    if (flexible_pressure_flag)
        virial_eradius_compute();
   }
-}	
+}
 
 /* ----------------------------------------------------------------------
    electron width-specific contribution to global virial
@@ -338,7 +338,7 @@ void PairAWPMDCut::virial_eradius_compute()
   int *spin = atom->spin;
 
   // sum over force on all particles including ghosts
-  
+
   if (neighbor->includegroup == 0) {
     int nall = atom->nlocal + atom->nghost;
     for (int i = 0; i < nall; i++) {
@@ -349,10 +349,10 @@ void PairAWPMDCut::virial_eradius_compute()
         virial[2] += e_virial;
       }
     }
-    
+
   // neighbor includegroup flag is set
   // sum over force on initial nfirst particles and ghosts
-    
+
   } else {
     int nall = atom->nfirst;
     for (int i = 0; i < nall; i++) {
@@ -363,7 +363,7 @@ void PairAWPMDCut::virial_eradius_compute()
         virial[2] += e_virial;
       }
     }
-    
+
     nall = atom->nlocal + atom->nghost;
     for (int i = atom->nlocal; i < nall; i++) {
       if (spin[i]) {
@@ -386,12 +386,12 @@ void PairAWPMDCut::allocate()
 {
   allocated = 1;
   int n = atom->ntypes;
-  
+
   memory->create(setflag,n+1,n+1,"pair:setflag");
   for (int i = 1; i <= n; i++)
     for (int j = i; j <= n; j++)
       setflag[i][j] = 0;
-  
+
   memory->create(cutsq,n+1,n+1,"pair:cutsq");
   memory->create(cut,n+1,n+1,"pair:cut");
 }
@@ -407,11 +407,11 @@ void PairAWPMDCut::allocate()
 // [flex_press]  -- set flexible pressure flag
 // -1 for length means default setting (L/2 for cutoff and L for width PBC)
 
-void PairAWPMDCut::settings(int narg, char **arg){ 
+void PairAWPMDCut::settings(int narg, char **arg){
   if (narg < 1) error->all(FLERR,"Illegal pair_style command");
 
   cut_global = force->numeric(arg[0]);
-  
+
   ermscale=1.;
   width_pbc=0.;
 
@@ -465,7 +465,7 @@ void PairAWPMDCut::settings(int narg, char **arg){
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }*/
 }
 
@@ -476,8 +476,8 @@ void PairAWPMDCut::settings(int narg, char **arg){
 void PairAWPMDCut::coeff(int narg, char **arg)
 {
   if (narg < 2 || narg > 3) error->all(FLERR,"Incorrect args for pair coefficients");
-  
-  /*if(domain->xperiodic == 1 || domain->yperiodic == 1 || 
+
+  /*if(domain->xperiodic == 1 || domain->yperiodic == 1 ||
     domain->zperiodic == 1) {*/
   double delx = domain->boxhi[0]-domain->boxlo[0];
   double dely = domain->boxhi[1]-domain->boxlo[1];
@@ -487,22 +487,22 @@ void PairAWPMDCut::coeff(int narg, char **arg)
   if(cut_global<0)
     cut_global=half_box_length;
 
-  if (!allocated) 
+  if (!allocated)
     allocate();
   else{
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
-  
+
   int ilo,ihi,jlo,jhi;
   force->bounds(arg[0],atom->ntypes,ilo,ihi);
   force->bounds(arg[1],atom->ntypes,jlo,jhi);
-  
+
   double cut_one = cut_global;
   if (narg == 3) cut_one = atof(arg[2]);
-  
+
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
     for (int j = MAX(jlo,i); j <= jhi; j++) {
@@ -511,7 +511,7 @@ void PairAWPMDCut::coeff(int narg, char **arg)
       count++;
     }
   }
-  
+
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
@@ -523,10 +523,10 @@ void PairAWPMDCut::init_style()
 {
   // error and warning checks
 
-  if (!atom->q_flag || !atom->spin_flag || 
+  if (!atom->q_flag || !atom->spin_flag ||
       !atom->eradius_flag || !atom->erforce_flag )  // TO DO: adjust this to match approximation used
     error->all(FLERR,"Pair awpmd/cut requires atom attributes "
-	       "q, spin, eradius, erforce");
+               "q, spin, eradius, erforce");
 
   /*
   if(vflag_atom){ // can't compute virial per atom
@@ -536,32 +536,32 @@ void PairAWPMDCut::init_style()
 
   // add hook to minimizer for eradius and erforce
 
-  if (update->whichflag == 2) 
+  if (update->whichflag == 2)
     int ignore = update->minimize->request(this,1,0.01);
 
   // make sure to use the appropriate timestep when using real units
 
-  /*if (update->whichflag == 1) { 
+  /*if (update->whichflag == 1) {
     if (force->qqr2e == 332.06371 && update->dt == 1.0)
       error->all(FLERR,"You must lower the default real units timestep for pEFF ");
   }*/
 
   // need a half neigh list and optionally a granular history neigh list
- 
+
   //int irequest = neighbor->request(this);
 
   //if (atom->tag_enable == 0)
   //  error->all(FLERR,"Pair style reax requires atom IDs");
-  
+
   //if (force->newton_pair == 0)
     //error->all(FLERR,"Pair style awpmd requires newton pair on");
-  
+
   //if (strcmp(update->unit_style,"real") != 0 && comm->me == 0)
     //error->warning(FLERR,"Not using real units with pair reax");
 
   int irequest = neighbor->request(this);
   neighbor->requests[irequest]->newton = 2;
-  
+
   if(force->e_mass==0. || force->hhmrr2e==0. || force->mvh2r==0.)
     error->all(FLERR,"Pair style awpmd requires e_mass and conversions hhmrr2e, mvh2r to be properly set for unit system");
 
@@ -581,7 +581,7 @@ double PairAWPMDCut::init_one(int i, int j)
 {
   if (setflag[i][j] == 0)
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
-  
+
   return cut[i][j];
 }
 
@@ -592,7 +592,7 @@ double PairAWPMDCut::init_one(int i, int j)
 void PairAWPMDCut::write_restart(FILE *fp)
 {
   write_restart_settings(fp);
-  
+
   int i,j;
   for (i = 1; i <= atom->ntypes; i++)
     for (j = i; j <= atom->ntypes; j++) {
@@ -609,7 +609,7 @@ void PairAWPMDCut::read_restart(FILE *fp)
 {
   read_restart_settings(fp);
   allocate();
-  
+
   int i,j;
   int me = comm->me;
   for (i = 1; i <= atom->ntypes; i++)
@@ -617,8 +617,8 @@ void PairAWPMDCut::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) fread(&cut[i][j],sizeof(double),1,fp);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) fread(&cut[i][j],sizeof(double),1,fp);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -724,7 +724,7 @@ void PairAWPMDCut::min_x_set(int ignore)
   double **v=atom->v;
   double *ervel=atom->ervel;
   double *cs=atom->cs;
-  
+
   int *spin = atom->spin;
   int nlocal = atom->nlocal;
 
@@ -741,7 +741,7 @@ void PairAWPMDCut::min_x_set(int ignore)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairAWPMDCut::memory_usage()
diff --git a/src/USER-AWPMD/pair_awpmd_cut.h b/src/USER-AWPMD/pair_awpmd_cut.h
index b1511d449a..96a2b16fa1 100644
--- a/src/USER-AWPMD/pair_awpmd_cut.h
+++ b/src/USER-AWPMD/pair_awpmd_cut.h
@@ -2,12 +2,12 @@
  LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
  http://lammps.sandia.gov, Sandia National Laboratories
  Steve Plimpton, sjplimp@sandia.gov
- 
+
  Copyright (2003) Sandia Corporation.  Under the terms of Contract
  DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
- certain rights in this software.  This software is distributed under 
+ certain rights in this software.  This software is distributed under
  the GNU General Public License.
- 
+
  See the README file in the top-level LAMMPS directory.
  ------------------------------------------------------------------------- */
 /* ----------------------------------------------------------------------
@@ -47,34 +47,34 @@ class PairAWPMDCut : public Pair {
   void read_restart(FILE *);
   virtual void write_restart_settings(FILE *);
   virtual void read_restart_settings(FILE *);
-  
+
   void min_xf_pointers(int, double **, double **);
   void min_xf_get(int);
   void min_x_set(int);
   double memory_usage();
 
  private:
-  
+
 
   int flexible_pressure_flag;
   double cut_global;
   double **cut;
-  
-  
+
+
   int nmax; // number of additional variables for minimizer
   double *min_var,*min_varforce; // additional variables for minimizer
 
   void allocate();
 
   void virial_eradius_compute();
-  
+
 
   AWPMD_split *wpmd; // solver oblect
   double ermscale; // scale of width mass for motion
   double width_pbc; // setting for width pbc
   double half_box_length; // calculated by coeff function
 };
- 
+
 }
 
 #endif
diff --git a/src/USER-CG-CMM/angle_cg_cmm.cpp b/src/USER-CG-CMM/angle_cg_cmm.cpp
index 070d65c5b8..f147a87237 100644
--- a/src/USER-CG-CMM/angle_cg_cmm.cpp
+++ b/src/USER-CG-CMM/angle_cg_cmm.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ AngleCGCMM::~AngleCGCMM()
 
 /* ---------------------------------------------------------------------- */
 
-void AngleCGCMM::ev_tally_lj13(int i, int j, int nlocal, int newton_bond, 
+void AngleCGCMM::ev_tally_lj13(int i, int j, int nlocal, int newton_bond,
                                double evdwl, double fpair,
                                double delx, double dely, double delz)
 {
@@ -76,7 +76,7 @@ void AngleCGCMM::ev_tally_lj13(int i, int j, int nlocal, int newton_bond,
       if (newton_bond || j < nlocal) eatom[i] += 0.5*evdwl;
     }
   }
-  
+
   if (vflag_either) {
     v[0] = delx*delx*fpair;
     v[1] = dely*dely*fpair;
@@ -185,15 +185,15 @@ void AngleCGCMM::compute(int eflag, int vflag)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
 
-    // 1-3 LJ interaction. 
+    // 1-3 LJ interaction.
     // we only want to use the repulsive part,
     // so this has to be done here and not in the
     // general non-bonded code.
@@ -206,20 +206,20 @@ void AngleCGCMM::compute(int eflag, int vflag)
 
     f13=0.0;
     e13=0.0;
-    
+
     if (r3 < rcut[type]) {
       const int cgt = cg_type[type];
       const double cgpow1 = cg_pow1[cgt];
       const double cgpow2 = cg_pow2[cgt];
       const double cgpref = cg_prefact[cgt];
-        
+
       const double ratio = sigma[type]/r3;
       const double eps = epsilon[type];
 
-      f13 = cgpref*eps / rsq3 * (cgpow1*pow(ratio,cgpow1) 
+      f13 = cgpref*eps / rsq3 * (cgpow1*pow(ratio,cgpow1)
                                   - cgpow2*pow(ratio,cgpow2));
 
-      if (eflag) e13 = eps + cgpref*eps * (pow(ratio,cgpow1) 
+      if (eflag) e13 = eps + cgpref*eps * (pow(ratio,cgpow1)
                                           - pow(ratio,cgpow2));
 
     }
@@ -264,7 +264,7 @@ void AngleCGCMM::compute(int eflag, int vflag)
     }
 
     if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
 
     if (evflag) ev_tally_lj13(i1,i3,nlocal,newton_bond,
                          e13,f13,delx3,dely3,delz3);
@@ -310,7 +310,7 @@ void AngleCGCMM::coeff(int narg, char **arg)
 
   int cg_type_one=find_cg_type(arg[3]);
   if (cg_type_one == CG_NOT_SET) error->all(FLERR,"Error reading CG type flag.");
-  
+
   double epsilon_one = atof(arg[4]);
   double sigma_one = atof(arg[5]);
 
@@ -328,7 +328,7 @@ void AngleCGCMM::coeff(int narg, char **arg)
     theta0[i] = theta0_one/180.0 * MY_PI;
     epsilon[i] = epsilon_one;
     sigma[i] = sigma_one;
-    rcut[i] = rcut_one; 
+    rcut[i] = rcut_one;
     cg_type[i] = cg_type_one;
     setflag[i] = 1;
     count++;
@@ -359,7 +359,7 @@ void AngleCGCMM::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void AngleCGCMM::read_restart(FILE *fp)
@@ -395,7 +395,7 @@ double AngleCGCMM::single(int type, int i1, int i2, int i3)
   double delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
   double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
-  
+
   double delx2 = x[i3][0] - x[i2][0];
   double dely2 = x[i3][1] - x[i2][1];
   double delz2 = x[i3][2] - x[i2][2];
@@ -407,7 +407,7 @@ double AngleCGCMM::single(int type, int i1, int i2, int i3)
   if (c > 1.0) c = 1.0;
   if (c < -1.0) c = -1.0;
 
-  // 1-3 LJ interaction. 
+  // 1-3 LJ interaction.
   double delx3 = x[i1][0] - x[i3][0];
   double dely3 = x[i1][1] - x[i3][1];
   double delz3 = x[i1][2] - x[i3][2];
@@ -416,17 +416,17 @@ double AngleCGCMM::single(int type, int i1, int i2, int i3)
   const double r3 = sqrt(delx3*delx3 + dely3*dely3 + delz3*delz3);
 
   double e13=0.0;
-    
+
   if (r3 < rcut[type]) {
     const int cgt = cg_type[type];
     const double cgpow1 = cg_pow1[cgt];
     const double cgpow2 = cg_pow2[cgt];
     const double cgpref = cg_prefact[cgt];
-        
+
     const double ratio = sigma[type]/r3;
     const double eps = epsilon[type];
 
-    e13 = eps + cgpref*eps * (pow(ratio,cgpow1) 
+    e13 = eps + cgpref*eps * (pow(ratio,cgpow1)
                               - pow(ratio,cgpow2));
   }
 
diff --git a/src/USER-CG-CMM/angle_cg_cmm.h b/src/USER-CG-CMM/angle_cg_cmm.h
index 5060415842..fa467ab0d7 100644
--- a/src/USER-CG-CMM/angle_cg_cmm.h
+++ b/src/USER-CG-CMM/angle_cg_cmm.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,9 +38,9 @@ class AngleCGCMM : public Angle, public CGCMMParms {
   double single(int, int, int, int);
 
  protected:
-  void ev_tally_lj13(int, int, int, int, double, double, 
+  void ev_tally_lj13(int, int, int, int, double, double,
                      double, double, double);
-  
+
  private:
   double *k,*theta0;
   int *cg_type;
diff --git a/src/USER-CG-CMM/angle_sdk.cpp b/src/USER-CG-CMM/angle_sdk.cpp
index bc6deef88c..35c4416af1 100644
--- a/src/USER-CG-CMM/angle_sdk.cpp
+++ b/src/USER-CG-CMM/angle_sdk.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -107,15 +107,15 @@ void AngleSDK::compute(int eflag, int vflag)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
 
-    // 1-3 LJ interaction. 
+    // 1-3 LJ interaction.
     // we only want to use the repulsive part,
     // and it can be scaled (or off).
     // so this has to be done here and not in the
@@ -124,7 +124,7 @@ void AngleSDK::compute(int eflag, int vflag)
     f13 = e13 = delx3 = dely3 = delz3 = 0.0;
 
     if (repflag) {
-      
+
       delx3 = x[i1][0] - x[i3][0];
       dely3 = x[i1][1] - x[i3][1];
       delz3 = x[i1][2] - x[i3][2];
@@ -133,38 +133,38 @@ void AngleSDK::compute(int eflag, int vflag)
 
       const int type1 = atom->type[i1];
       const int type3 = atom->type[i3];
-      
+
       f13=0.0;
       e13=0.0;
-    
+
       if (rsq3 < rminsq[type1][type3]) {
-	const int ljt = lj_type[type1][type3];
-	const double r2inv = 1.0/rsq3;
+        const int ljt = lj_type[type1][type3];
+        const double r2inv = 1.0/rsq3;
+
+        if (ljt == LJ12_4) {
+          const double r4inv=r2inv*r2inv;
 
-	if (ljt == LJ12_4) {
-	  const double r4inv=r2inv*r2inv;
+          f13 = r4inv*(lj1[type1][type3]*r4inv*r4inv - lj2[type1][type3]);
+          if (eflag) e13 = r4inv*(lj3[type1][type3]*r4inv*r4inv - lj4[type1][type3]);
 
-	  f13 = r4inv*(lj1[type1][type3]*r4inv*r4inv - lj2[type1][type3]);
-	  if (eflag) e13 = r4inv*(lj3[type1][type3]*r4inv*r4inv - lj4[type1][type3]);
-	  
-	} else if (ljt == LJ9_6) {
-	  const double r3inv = r2inv*sqrt(r2inv);
-	  const double r6inv = r3inv*r3inv;
+        } else if (ljt == LJ9_6) {
+          const double r3inv = r2inv*sqrt(r2inv);
+          const double r6inv = r3inv*r3inv;
 
-	  f13 = r6inv*(lj1[type1][type3]*r3inv - lj2[type1][type3]);
-	  if (eflag) e13 = r6inv*(lj3[type1][type3]*r3inv - lj4[type1][type3]);
+          f13 = r6inv*(lj1[type1][type3]*r3inv - lj2[type1][type3]);
+          if (eflag) e13 = r6inv*(lj3[type1][type3]*r3inv - lj4[type1][type3]);
 
-	} else if (ljt == LJ12_6) {
-	  const double r6inv = r2inv*r2inv*r2inv;
+        } else if (ljt == LJ12_6) {
+          const double r6inv = r2inv*r2inv*r2inv;
 
-	  f13 = r6inv*(lj1[type1][type3]*r6inv - lj2[type1][type3]);
-	  if (eflag) e13 = r6inv*(lj3[type1][type3]*r6inv - lj4[type1][type3]);
-	}
+          f13 = r6inv*(lj1[type1][type3]*r6inv - lj2[type1][type3]);
+          if (eflag) e13 = r6inv*(lj3[type1][type3]*r6inv - lj4[type1][type3]);
+        }
 
-	// make sure energy is 0.0 at the cutoff.
-	if (eflag) e13 -= emin[type1][type3];
+        // make sure energy is 0.0 at the cutoff.
+        if (eflag) e13 -= emin[type1][type3];
 
-	f13 *= r2inv;
+        f13 *= r2inv;
       }
     }
 
@@ -209,9 +209,9 @@ void AngleSDK::compute(int eflag, int vflag)
 
     if (evflag) {
       ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
       if (repflag)
-	ev_tally13(i1,i3,nlocal,newton_bond,e13,f13,delx3,dely3,delz3);
+        ev_tally13(i1,i3,nlocal,newton_bond,e13,f13,delx3,dely3,delz3);
     }
   }
 }
@@ -252,7 +252,7 @@ void AngleSDK::coeff(int narg, char **arg)
   // backward compatibility with old cg/cmm style input:
   // this had <lj_type> <epsilon> <sigma>
   // if epsilon is set to 0.0 we accept it as repscale 0.0
-  // otherwise assume repscale 1.0, since we were using 
+  // otherwise assume repscale 1.0, since we were using
   // epsilon to turn repulsion on or off.
   if (narg == 6) {
     repscale_one = force->numeric(arg[4]);
@@ -276,7 +276,7 @@ void AngleSDK::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   error check and initialize all values needed for force computation 
+   error check and initialize all values needed for force computation
 ------------------------------------------------------------------------- */
 
 void AngleSDK::init_style()
@@ -327,7 +327,7 @@ void AngleSDK::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void AngleSDK::read_restart(FILE *fp)
@@ -348,9 +348,9 @@ void AngleSDK::read_restart(FILE *fp)
 
 /* ---------------------------------------------------------------------- */
 
-void AngleSDK::ev_tally13(int i, int j, int nlocal, int newton_bond, 
-			  double evdwl, double fpair,
-			  double delx, double dely, double delz)
+void AngleSDK::ev_tally13(int i, int j, int nlocal, int newton_bond,
+                          double evdwl, double fpair,
+                          double delx, double dely, double delz)
 {
   double v[6];
 
@@ -370,7 +370,7 @@ void AngleSDK::ev_tally13(int i, int j, int nlocal, int newton_bond,
       if (newton_bond || j < nlocal) eatom[i] += 0.5*evdwl;
     }
   }
-  
+
   if (vflag_either) {
     v[0] = delx*delx*fpair;
     v[1] = dely*dely*fpair;
@@ -439,7 +439,7 @@ double AngleSDK::single(int type, int i1, int i2, int i3)
   double delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
   double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
-  
+
   double delx2 = x[i3][0] - x[i2][0];
   double dely2 = x[i3][1] - x[i2][1];
   double delz2 = x[i3][2] - x[i2][2];
@@ -454,7 +454,7 @@ double AngleSDK::single(int type, int i1, int i2, int i3)
   double e13=0.0;
   if (repflag) {
 
-    // 1-3 LJ interaction. 
+    // 1-3 LJ interaction.
     double delx3 = x[i1][0] - x[i3][0];
     double dely3 = x[i1][1] - x[i3][1];
     double delz3 = x[i1][2] - x[i3][2];
@@ -462,28 +462,28 @@ double AngleSDK::single(int type, int i1, int i2, int i3)
 
     const int type1 = atom->type[i1];
     const int type3 = atom->type[i3];
-      
+
     const double rsq3 = delx3*delx3 + dely3*dely3 + delz3*delz3;
-  
+
     if (rsq3 < rminsq[type1][type3]) {
       const int ljt = lj_type[type1][type3];
       const double r2inv = 1.0/rsq3;
 
       if (ljt == LJ12_4) {
-	const double r4inv=r2inv*r2inv;
+        const double r4inv=r2inv*r2inv;
+
+        e13 = r4inv*(lj3[type1][type3]*r4inv*r4inv - lj4[type1][type3]);
 
-	e13 = r4inv*(lj3[type1][type3]*r4inv*r4inv - lj4[type1][type3]);
-	  
       } else if (ljt == LJ9_6) {
-	const double r3inv = r2inv*sqrt(r2inv);
-	const double r6inv = r3inv*r3inv;
+        const double r3inv = r2inv*sqrt(r2inv);
+        const double r6inv = r3inv*r3inv;
 
-	e13 = r6inv*(lj3[type1][type3]*r3inv - lj4[type1][type3]);
+        e13 = r6inv*(lj3[type1][type3]*r3inv - lj4[type1][type3]);
 
       } else if (ljt == LJ12_6) {
-	const double r6inv = r2inv*r2inv*r2inv;
+        const double r6inv = r2inv*r2inv*r2inv;
 
-	e13 = r6inv*(lj3[type1][type3]*r6inv - lj4[type1][type3]);
+        e13 = r6inv*(lj3[type1][type3]*r6inv - lj4[type1][type3]);
       }
 
       // make sure energy is 0.0 at the cutoff.
diff --git a/src/USER-CG-CMM/angle_sdk.h b/src/USER-CG-CMM/angle_sdk.h
index 91da40abeb..8dd7d73705 100644
--- a/src/USER-CG-CMM/angle_sdk.h
+++ b/src/USER-CG-CMM/angle_sdk.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,9 +50,9 @@ class AngleSDK : public Angle {
 
   int repflag; // 1 if we have to handle 1-3 repulsion
 
-  void ev_tally13(int, int, int, int, double, double, 
-		  double, double, double);
-  
+  void ev_tally13(int, int, int, int, double, double,
+                  double, double, double);
+
   void allocate();
 };
 
diff --git a/src/USER-CG-CMM/cg_cmm_parms.cpp b/src/USER-CG-CMM/cg_cmm_parms.cpp
index 4483c550c8..57decc68ec 100644
--- a/src/USER-CG-CMM/cg_cmm_parms.cpp
+++ b/src/USER-CG-CMM/cg_cmm_parms.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CG-CMM/cg_cmm_parms.h b/src/USER-CG-CMM/cg_cmm_parms.h
index f696759d7a..f14f8f797c 100644
--- a/src/USER-CG-CMM/cg_cmm_parms.h
+++ b/src/USER-CG-CMM/cg_cmm_parms.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CG-CMM/lj_sdk_common.h b/src/USER-CG-CMM/lj_sdk_common.h
index 9b151b8a35..ddf14eb01f 100644
--- a/src/USER-CG-CMM/lj_sdk_common.h
+++ b/src/USER-CG-CMM/lj_sdk_common.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -21,14 +21,14 @@
 
 #include "string.h"
 
-namespace LAMMPS_NS { 
+namespace LAMMPS_NS {
 namespace LJSDKParms {
 
   // LJ type flags. list of supported LJ exponent combinations
   enum {LJ_NOT_SET=0, LJ9_6, LJ12_4, LJ12_6, NUM_LJ_TYPES};
 
   static int find_lj_type(const char *label,
-			  const char * const * const list) {
+                          const char * const * const list) {
     for (int i=0; i < NUM_LJ_TYPES; ++i)
       if (strcmp(label,list[i]) == 0) return i;
 
@@ -41,4 +41,3 @@ namespace LJSDKParms {
   static const double lj_pow2[]    = {0.0, 6.00,  4.0,              6.0};
 }}
 #endif
-
diff --git a/src/USER-CG-CMM/pair_cg_cmm.cpp b/src/USER-CG-CMM/pair_cg_cmm.cpp
index 3ff948d1a1..03c792c3c3 100644
--- a/src/USER-CG-CMM/pair_cg_cmm.cpp
+++ b/src/USER-CG-CMM/pair_cg_cmm.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -19,7 +19,7 @@
 #include "pair_cg_cmm.h"
 
 using namespace LAMMPS_NS;
- 
+
 /* ---------------------------------------------------------------------- */
 
 PairCGCMM::PairCGCMM(LAMMPS *lmp) : PairCMMCommon(lmp)
@@ -39,9 +39,9 @@ PairCGCMM::~PairCGCMM()
 
 /* ---------------------------------------------------------------------- *
  * the real compute work is done in the PairCMMCommon::eval_XXX<>() templates
- * in the common PairCG class. Through using templates we can have one 
- * implementation for all CG varieties _and_ gain speed through having 
- * the compiler optimize away conditionals within the innerloops that 
+ * in the common PairCG class. Through using templates we can have one
+ * implementation for all CG varieties _and_ gain speed through having
+ * the compiler optimize away conditionals within the innerloops that
  * can be predetermined outside the loop through instantiation of the
  * different combination of template flags.
  * ---------------------------------------------------------------------- */
@@ -150,7 +150,7 @@ void PairCGCMM::compute_outer(int eflag, int vflag)
 
 /* ---------------------------------------------------------------------- */
 
-void PairCGCMM::write_restart(FILE *fp) 
+void PairCGCMM::write_restart(FILE *fp)
 {
   write_restart_settings(fp);
   PairCMMCommon::write_restart(fp);
@@ -168,7 +168,7 @@ void PairCGCMM::read_restart(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairCGCMM::single(int i, int j, int itype, int jtype, double rsq,
-		       double factor_coul, double factor_lj, double &fforce)
+                       double factor_coul, double factor_lj, double &fforce)
 {
   return eval_single(CG_COUL_NONE,i,j,itype,jtype,rsq,factor_coul,factor_lj,fforce);
 }
diff --git a/src/USER-CG-CMM/pair_cg_cmm.h b/src/USER-CG-CMM/pair_cg_cmm.h
index 74eee884e3..fe24321587 100644
--- a/src/USER-CG-CMM/pair_cg_cmm.h
+++ b/src/USER-CG-CMM/pair_cg_cmm.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp b/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp
index 10cee8919b..211a070501 100644
--- a/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp
+++ b/src/USER-CG-CMM/pair_cg_cmm_coul_cut.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -92,9 +92,9 @@ double PairCGCMMCoulCut::init_one(int i, int j)
 
 /* ---------------------------------------------------------------------- *
  * the real compute work is done in the PairCMMCommon::eval_XXX<>() templates
- * in the common PairCG class. Through using templates we can have one 
- * implementation for all CG varieties _and_ gain speed through having 
- * the compiler optimize away conditionals within the innerloops that 
+ * in the common PairCG class. Through using templates we can have one
+ * implementation for all CG varieties _and_ gain speed through having
+ * the compiler optimize away conditionals within the innerloops that
  * can be predetermined outside the loop through instantiation of the
  * different combination of template flags.
  * ---------------------------------------------------------------------- */
@@ -203,7 +203,7 @@ void PairCGCMMCoulCut::compute_outer(int eflag, int vflag)
 
 /* ---------------------------------------------------------------------- */
 
-void PairCGCMMCoulCut::write_restart(FILE *fp) 
+void PairCGCMMCoulCut::write_restart(FILE *fp)
 {
   write_restart_settings(fp);
   PairCMMCommon::write_restart(fp);
@@ -223,19 +223,19 @@ void PairCGCMMCoulCut::read_restart(FILE *fp)
 double PairCGCMMCoulCut::memory_usage()
 {
   double bytes=PairCMMCommon::memory_usage();
-  
+
   int n = atom->ntypes;
 
   // cut_coul/cut_coulsq/cut_lj/cut_ljsq;
-  bytes += (n+1)*(n+1)*sizeof(double)*4; 
-  
+  bytes += (n+1)*(n+1)*sizeof(double)*4;
+
   return bytes;
 }
 
 /* ---------------------------------------------------------------------- */
 
 double PairCGCMMCoulCut::single(int i, int j, int itype, int jtype, double rsq,
-		       double factor_coul, double factor_lj, double &fforce)
+                       double factor_coul, double factor_lj, double &fforce)
 {
   return eval_single(CG_COUL_CUT,i,j,itype,jtype,rsq,factor_coul,factor_lj,fforce);
 }
diff --git a/src/USER-CG-CMM/pair_cg_cmm_coul_cut.h b/src/USER-CG-CMM/pair_cg_cmm_coul_cut.h
index 2732fa4d52..418ee2674f 100644
--- a/src/USER-CG-CMM/pair_cg_cmm_coul_cut.h
+++ b/src/USER-CG-CMM/pair_cg_cmm_coul_cut.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp b/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp
index 89eda915f1..a13f316ac0 100644
--- a/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp
+++ b/src/USER-CG-CMM/pair_cg_cmm_coul_long.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -90,7 +90,7 @@ void PairCGCMMCoulLong::init_style()
 {
   if (!atom->q_flag)
     error->all(FLERR,"Pair style cg/cut/coul/long requires atom attribute q");
-  
+
   PairCMMCommon::init_style();
 
   // set rRESPA cutoffs
@@ -102,7 +102,7 @@ void PairCGCMMCoulLong::init_style()
 
   // ensure use of KSpace long-range solver, set g_ewald
 
-  if (force->kspace == NULL) 
+  if (force->kspace == NULL)
     error->all(FLERR,"Pair style is incompatible with KSpace style");
   g_ewald = force->kspace->g_ewald;
 
@@ -136,16 +136,16 @@ void PairCGCMMCoulLong::init_tables()
   tabinnersq = tabinner*tabinner;
   init_bitmap(tabinner,cut_coul_global,ncoultablebits,
               masklo,maskhi,ncoulmask,ncoulshiftbits);
-  
+
   int ntable = 1;
   for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
-  
+
   // linear lookup tables of length N = 2^ncoultablebits
   // stored value = value at lower edge of bin
   // d values = delta from lower edge to upper edge of bin
 
   if (ftable) free_tables();
-  
+
   memory->create(rtable,ntable,"pair:rtable");
   memory->create(ftable,ntable,"pair:ftable");
   memory->create(ctable,ntable,"pair:ctable");
@@ -194,7 +194,7 @@ void PairCGCMMCoulLong::init_tables()
       vtable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
         if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
           ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
           ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
         } else {
@@ -206,9 +206,9 @@ void PairCGCMMCoulLong::init_tables()
     minrsq_lookup.f = MIN(minrsq_lookup.f,rsq_lookup.f);
   }
   tabinnersq = minrsq_lookup.f;
-  
+
   int ntablem1 = ntable - 1;
-  
+
   for (int i = 0; i < ntablem1; i++) {
     drtable[i] = 1.0/(rtable[i+1] - rtable[i]);
     dftable[i] = ftable[i+1] - ftable[i];
@@ -222,10 +222,10 @@ void PairCGCMMCoulLong::init_tables()
       dptable[i] = ptable[i+1] - ptable[i];
     }
   }
-  
-  // get the delta values for the last table entries 
+
+  // get the delta values for the last table entries
   // tables are connected periodically between 0 and ntablem1
-    
+
   drtable[ntablem1] = 1.0/(rtable[0] - rtable[ntablem1]);
   dftable[ntablem1] = ftable[0] - ftable[ntablem1];
   dctable[ntablem1] = ctable[0] - ctable[ntablem1];
@@ -235,22 +235,22 @@ void PairCGCMMCoulLong::init_tables()
     dptable[ntablem1] = ptable[0] - ptable[ntablem1];
   }
 
-  // get the correct delta values at itablemax    
+  // get the correct delta values at itablemax
   // smallest r is in bin itablemin
   // largest r is in bin itablemax, which is itablemin-1,
   //   or ntablem1 if itablemin=0
   // deltas at itablemax only needed if corresponding rsq < cut*cut
-  // if so, compute deltas between rsq and cut*cut 
-        
+  // if so, compute deltas between rsq and cut*cut
+
   double f_tmp,c_tmp,e_tmp,p_tmp,v_tmp;
   itablemin = minrsq_lookup.i & ncoulmask;
-  itablemin >>= ncoulshiftbits;  
-  int itablemax = itablemin - 1; 
-  if (itablemin == 0) itablemax = ntablem1;     
+  itablemin >>= ncoulshiftbits;
+  int itablemax = itablemin - 1;
+  if (itablemin == 0) itablemax = ntablem1;
   rsq_lookup.i = itablemax << ncoulshiftbits;
   rsq_lookup.i |= maskhi;
   if (rsq_lookup.f < cut_coulsq_global) {
-    rsq_lookup.f = cut_coulsq_global;  
+    rsq_lookup.f = cut_coulsq_global;
     r = sqrtf(rsq_lookup.f);
     grij = g_ewald * r;
     expm2 = exp(-grij*grij);
@@ -268,7 +268,7 @@ void PairCGCMMCoulLong::init_tables()
       v_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
         if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
           f_tmp += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
           c_tmp = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
         } else {
@@ -278,25 +278,25 @@ void PairCGCMMCoulLong::init_tables()
       }
     }
 
-    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);   
+    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);
     dftable[itablemax] = f_tmp - ftable[itablemax];
     dctable[itablemax] = c_tmp - ctable[itablemax];
     detable[itablemax] = e_tmp - etable[itablemax];
     if (cut_respa) {
       dvtable[itablemax] = v_tmp - vtable[itablemax];
       dptable[itablemax] = p_tmp - ptable[itablemax];
-    }   
+    }
   }
-  
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 /* ---------------------------------------------------------------------- *
  * the real compute work is done in the PairCMMCommon::eval_XXX<>() templates
- * in the common PairCG class. Through using templates we can have one 
- * implementation for all CG varieties _and_ gain speed through having 
- * the compiler optimize away conditionals within the innerloops that 
+ * in the common PairCG class. Through using templates we can have one
+ * implementation for all CG varieties _and_ gain speed through having
+ * the compiler optimize away conditionals within the innerloops that
  * can be predetermined outside the loop through instantiation of the
  * different combination of template flags.
  * ---------------------------------------------------------------------- */
@@ -405,7 +405,7 @@ void PairCGCMMCoulLong::compute_outer(int eflag, int vflag)
 
 /* ---------------------------------------------------------------------- */
 
-void PairCGCMMCoulLong::write_restart(FILE *fp) 
+void PairCGCMMCoulLong::write_restart(FILE *fp)
 {
   write_restart_settings(fp);
   PairCMMCommon::write_restart(fp);
@@ -425,18 +425,18 @@ void PairCGCMMCoulLong::read_restart(FILE *fp)
 double PairCGCMMCoulLong::memory_usage()
 {
   double bytes=PairCMMCommon::memory_usage();
-  
+
   int n = atom->ntypes;
 
   // cut_coul/cut_coulsq/cut_ljsq
-  bytes += (n+1)*(n+1)*sizeof(double)*4; 
-  
+  bytes += (n+1)*(n+1)*sizeof(double)*4;
+
   return bytes;
 }
 
 /* ---------------------------------------------------------------------- */
 
-double PairCGCMMCoulLong::single(int i, int j, int itype, int jtype, double rsq, 
+double PairCGCMMCoulLong::single(int i, int j, int itype, int jtype, double rsq,
                                  double factor_coul, double factor_lj, double &fforce)
 {
   return eval_single(CG_COUL_LONG,i,j,itype,jtype,rsq,factor_coul,factor_lj,fforce);
diff --git a/src/USER-CG-CMM/pair_cg_cmm_coul_long.h b/src/USER-CG-CMM/pair_cg_cmm_coul_long.h
index ce1fa044bc..cf05f38945 100644
--- a/src/USER-CG-CMM/pair_cg_cmm_coul_long.h
+++ b/src/USER-CG-CMM/pair_cg_cmm_coul_long.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CG-CMM/pair_cmm_common.cpp b/src/USER-CG-CMM/pair_cmm_common.cpp
index 4e1606d587..f5f5f5799e 100644
--- a/src/USER-CG-CMM/pair_cmm_common.cpp
+++ b/src/USER-CG-CMM/pair_cmm_common.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ PairCMMCommon::PairCMMCommon(class LAMMPS *lmp) : Pair(lmp)
   allocated_coul = 0;
   kappa = 0.0;
   respa_enable = 0;
-  single_enable = 0; 
+  single_enable = 0;
 }
 
 /* ---------------------------------------------------------------------- *
@@ -73,7 +73,7 @@ void PairCMMCommon::allocate()
 {
   allocated = 1;
   int n = atom->ntypes;
-  
+
   memory->create(setflag,n+1,n+1,"paircg:setflag");
   memory->create(cg_type,n+1,n+1,"paircg:cg_type");
   for (int i = 1; i <= n; i++) {
@@ -87,7 +87,7 @@ void PairCMMCommon::allocate()
   memory->create(cutsq,n+1,n+1,"paircg:cutsq");
   memory->create(epsilon,n+1,n+1,"paircg:epsilon");
   memory->create(sigma,n+1,n+1,"paircg:sigma");
-  memory->create(offset,n+1,n+1,"paircg:offset"); 
+  memory->create(offset,n+1,n+1,"paircg:offset");
 
   memory->create(lj1,n+1,n+1,"paircg:lj1");
   memory->create(lj2,n+1,n+1,"paircg:lj2");
@@ -96,7 +96,7 @@ void PairCMMCommon::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 // arguments to the pair_style command (global version)
@@ -109,7 +109,7 @@ void PairCMMCommon::settings(int narg, char **arg)
   if (narg == 1) cut_coul_global = cut_lj_global;
   else cut_coul_global = force->numeric(arg[1]);
   cut_coulsq_global = cut_coul_global*cut_coul_global;
-  
+
   // exponential coulomb screening (optional)
   if (narg == 3) kappa = force->numeric(arg[2]);
   if (fabs(kappa) < SMALL) kappa=0.0;
@@ -147,7 +147,7 @@ void PairCMMCommon::coeff(int narg, char **arg)
 
   int cg_type_one=find_cg_type(arg[2]);
   if (cg_type_one == CG_NOT_SET) error->all(FLERR,"Error reading CG type flag.");
-  
+
   double epsilon_one = force->numeric(arg[3]);
   double sigma_one = force->numeric(arg[4]);
 
@@ -248,7 +248,7 @@ double PairCMMCommon::init_one(int i, int j)
 
   if (cgt == CG_NOT_SET)
     error->all(FLERR,"unrecognized LJ parameter flag");
-  
+
   lj1[i][j] = cg_prefact[cgt] * cg_pow1[cgt] * epsilon[i][j] * pow(sigma[i][j],cg_pow1[cgt]);
   lj2[i][j] = cg_prefact[cgt] * cg_pow2[cgt] * epsilon[i][j] * pow(sigma[i][j],cg_pow2[cgt]);
   lj3[i][j] = cg_prefact[cgt] * epsilon[i][j] * pow(sigma[i][j],cg_pow1[cgt]);
@@ -270,7 +270,7 @@ double PairCMMCommon::init_one(int i, int j)
       offset[i][j] = cg_prefact[cgt] * epsilon[i][j] * (pow(ratio,cg_pow1[cgt]) - pow(ratio,cg_pow2[cgt]));
     } else offset[i][j] = 0.0;
   }
-  
+
   // make sure data is stored symmetrically
   lj1[j][i] = lj1[i][j];
   lj2[j][i] = lj2[i][j];
@@ -279,7 +279,7 @@ double PairCMMCommon::init_one(int i, int j)
   offset[j][i] = offset[i][j];
   cg_type[j][i] = cg_type[i][j];
   cut[j][i] = mycut;
-  
+
   if (allocated_coul) {
     cut_lj[j][i]=cut_lj[i][j];
     cut_ljsq[j][i]=cut_ljsq[i][j];
@@ -303,24 +303,24 @@ double PairCMMCommon::init_one(int i, int j)
       if (type[k] == j) count[1] += 1.0;
     }
     MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
-        
+
     double sig2 = sigma[i][j]*sigma[i][j];
     double sig6 = sig2*sig2*sig2;
     double rc3 = cut[i][j]*cut[i][j]*cut[i][j];
     double rc6 = rc3*rc3;
     double rc9 = rc3*rc6;
-    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
-      sig6 * (sig6 - 3.0*rc6) / (9.0*rc9); 
-    ptail_ij = 16.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
-      sig6 * (2.0*sig6 - 3.0*rc6) / (9.0*rc9); 
+    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
+      sig6 * (sig6 - 3.0*rc6) / (9.0*rc9);
+    ptail_ij = 16.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
+      sig6 * (2.0*sig6 - 3.0*rc6) / (9.0*rc9);
 #endif
-  } 
+  }
 
   return mycut;
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairCMMCommon::write_restart(FILE *fp)
@@ -419,41 +419,41 @@ void PairCMMCommon::read_restart_settings(FILE *fp)
 double PairCMMCommon::memory_usage()
 {
   double bytes=Pair::memory_usage();
-  
+
   int n = atom->ntypes;
 
   // setflag/cg_type
-  bytes += (n+1)*(n+1)*sizeof(int)*2; 
+  bytes += (n+1)*(n+1)*sizeof(int)*2;
   // cut/cutsq/epsilon/sigma/offset/lj1/lj2/lj3/lj4
-  bytes += (n+1)*(n+1)*sizeof(double)*9; 
-  
+  bytes += (n+1)*(n+1)*sizeof(double)*9;
+
   return bytes;
 }
 
 /* ------------------------------------------------------------------------ */
 
-double PairCMMCommon::eval_single(int coul_type, int i, int j, int itype, int jtype, 
-                           double rsq, double factor_coul, double factor_lj, 
+double PairCMMCommon::eval_single(int coul_type, int i, int j, int itype, int jtype,
+                           double rsq, double factor_coul, double factor_lj,
                            double &fforce)
 {
   double lj_force, lj_erg, coul_force, coul_erg;
   lj_force=lj_erg=coul_force=coul_erg=0.0;
 
   if (rsq < cut_ljsq[itype][jtype]) {
-      
+
     const int cgt = cg_type[itype][jtype];
     const double cgpow1 = cg_pow1[cgt];
     const double cgpow2 = cg_pow2[cgt];
     const double cgpref = cg_prefact[cgt];
-        
+
     const double ratio = sigma[itype][jtype]/sqrt(rsq);
     const double eps = epsilon[itype][jtype];
 
-    lj_force = cgpref*eps * (cgpow1*pow(ratio,cgpow1) 
+    lj_force = cgpref*eps * (cgpow1*pow(ratio,cgpow1)
                             - cgpow2*pow(ratio,cgpow2))/rsq;
     lj_erg = cgpref*eps * (pow(ratio,cgpow1) - pow(ratio,cgpow2));
   }
-  
+
   if (rsq < cut_coul[itype][jtype]) {
     if(coul_type == CG_COUL_LONG) {
       error->all(FLERR,"single energy computation with long-range coulomb not supported by CG potentials.");
diff --git a/src/USER-CG-CMM/pair_cmm_common.h b/src/USER-CG-CMM/pair_cmm_common.h
index 1b4fe1eb44..9b5f3fbb2c 100644
--- a/src/USER-CG-CMM/pair_cmm_common.h
+++ b/src/USER-CG-CMM/pair_cmm_common.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -67,7 +67,7 @@ namespace LAMMPS_NS {
 
     // coarse grain flags
     int **cg_type;
-    
+
     // lennard jones parameters
     double cut_lj_global, **cut, **cut_lj, **cut_ljsq;
     double **epsilon, **sigma;
@@ -83,7 +83,7 @@ namespace LAMMPS_NS {
     double *rtable,*drtable,*ftable,*dftable,*ctable,*dctable;
     double *etable,*detable,*ptable,*dptable,*vtable,*dvtable;
     int ncoulshiftbits,ncoulmask;
-    
+
     // r-RESPA parameters
     double *cut_respa;
 
@@ -97,19 +97,19 @@ namespace LAMMPS_NS {
 
     protected:
     // general optimizeable real space loops
-    template < const int EVFLAG, const int EFLAG, 
-      const int NEWTON_PAIR, const int COUL_TYPE > 
+    template < const int EVFLAG, const int EFLAG,
+      const int NEWTON_PAIR, const int COUL_TYPE >
       void eval_verlet();
-    template < const int NEWTON_PAIR, const int COUL_TYPE > 
+    template < const int NEWTON_PAIR, const int COUL_TYPE >
       void eval_inner();
-    template < const int NEWTON_PAIR, const int COUL_TYPE > 
+    template < const int NEWTON_PAIR, const int COUL_TYPE >
       void eval_middle();
-    template < const int EVFLAG, const int EFLAG, const int VFLAG, 
-      const int NEWTON_PAIR, const int COUL_TYPE > 
+    template < const int EVFLAG, const int EFLAG, const int VFLAG,
+      const int NEWTON_PAIR, const int COUL_TYPE >
       void eval_outer();
 
     // this one is not performance critical... no template needed.
-    double eval_single(int, int, int, int, int, 
+    double eval_single(int, int, int, int, int,
                      double, double, double, double &);
   };
 
@@ -173,11 +173,11 @@ namespace LAMMPS_NS {
       ;                                                                 \
     }                                                                   \
   }                                                                     \
-  
 
-  
-  template < const int EVFLAG, const int EFLAG, 
-    const int NEWTON_PAIR, const int COUL_TYPE > 
+
+
+  template < const int EVFLAG, const int EFLAG,
+    const int NEWTON_PAIR, const int COUL_TYPE >
     void PairCMMCommon::eval_verlet()
   {
     double ** const x = atom->x;
@@ -194,7 +194,7 @@ namespace LAMMPS_NS {
     const int * const ilist = list->ilist;
     const int * const numneigh = list->numneigh;
     int * const * const firstneigh = list->firstneigh;
-  
+
     // loop over neighbors of my atoms
 
     int ii,jj;
@@ -211,9 +211,9 @@ namespace LAMMPS_NS {
 
       for (jj = 0; jj < jnum; jj++) {
         int j2 = jlist[jj];
-	factor_lj = special_lj[sbmask(j2)];
-	factor_coul = special_coul[sbmask(j2)];
-	const int j = j2 & NEIGHMASK;
+        factor_lj = special_lj[sbmask(j2)];
+        factor_coul = special_coul[sbmask(j2)];
+        const int j = j2 & NEIGHMASK;
 
         const double delx = xtmp - x[j][0];
         const double dely = ytmp - x[j][1];
@@ -235,7 +235,7 @@ namespace LAMMPS_NS {
           } else {
             double forcelj  = 0.0;
             double forcecoul = 0.0;
-            
+
             if (rsq < cut_ljsq[itype][jtype]) {
               CG_LJ_INNER(EFLAG,forcelj);
             }
@@ -247,7 +247,7 @@ namespace LAMMPS_NS {
                 double qscreen=exp(-kappa*r);
                 forcecoul = factor_coul * qqrd2e
                   * qtmp * q[j] * qscreen * (kappa + 1.0/r);
-                if (EFLAG) ecoul=factor_coul*qqrd2e 
+                if (EFLAG) ecoul=factor_coul*qqrd2e
                   * qtmp*q[j] * qscreen / r;
               }
             }
@@ -256,7 +256,7 @@ namespace LAMMPS_NS {
               if (rsq < cut_coulsq_global) {
                 if (!ncoultablebits || rsq <= tabinnersq) {
                   const double r = sqrt(rsq);
-                  
+
                   const double grij = g_ewald * r;
                   const double expm2 = exp(-grij*grij);
                   const double t = 1.0 / (1.0 + EWALD_P*grij);
@@ -309,7 +309,7 @@ namespace LAMMPS_NS {
 
 /* ---------------------------------------------------------------------- */
 
-  template < const int NEWTON_PAIR, const int COUL_TYPE > 
+  template < const int NEWTON_PAIR, const int COUL_TYPE >
     void PairCMMCommon::eval_inner()
   {
     double ** const x = atom->x;
@@ -326,14 +326,14 @@ namespace LAMMPS_NS {
     const int * const ilist = listinner->ilist;
     const int * const numneigh = listinner->numneigh;
     int * const * const firstneigh = listinner->firstneigh;
-  
+
     const double cut_out_on = cut_respa[0];
     const double cut_out_off = cut_respa[1];
-  
+
     const double cut_out_diff = cut_out_off - cut_out_on;
     const double cut_out_on_sq = cut_out_on*cut_out_on;
     const double cut_out_off_sq = cut_out_off*cut_out_off;
-  
+
     // loop over neighbors of my atoms
 
     int ii,jj;
@@ -349,9 +349,9 @@ namespace LAMMPS_NS {
 
       for (jj = 0; jj < jnum; jj++) {
         int j2 = jlist[jj];
-	factor_lj = special_lj[sbmask(j2)];
-	factor_coul = special_coul[sbmask(j2)];
-	const int j = j2 & NEIGHMASK;
+        factor_lj = special_lj[sbmask(j2)];
+        factor_coul = special_coul[sbmask(j2)];
+        const int j = j2 & NEIGHMASK;
 
         const double delx = xtmp - x[j][0];
         const double dely = ytmp - x[j][1];
@@ -371,7 +371,7 @@ namespace LAMMPS_NS {
             CG_LJ_INNER(0,fpair);
             fpair *= r2inv;
             if (rsq > cut_out_on_sq) {
-              const double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
+              const double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
               fpair *= 1.0 - rsw*rsw*(3.0 - 2.0*rsw);
             }
           } else {
@@ -387,7 +387,7 @@ namespace LAMMPS_NS {
 
             fpair = (forcecoul + forcelj) * r2inv;
             if (rsq > cut_out_on_sq) {
-              const double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
+              const double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
               fpair *= 1.0 - rsw*rsw*(3.0 - 2.0*rsw);
             }
           }
@@ -407,7 +407,7 @@ namespace LAMMPS_NS {
 
 /* ---------------------------------------------------------------------- */
 
-  template < const int NEWTON_PAIR, const int COUL_TYPE > 
+  template < const int NEWTON_PAIR, const int COUL_TYPE >
     void PairCMMCommon::eval_middle()
   {
     double ** const x = atom->x;
@@ -424,7 +424,7 @@ namespace LAMMPS_NS {
     const int * const ilist = listmiddle->ilist;
     const int * const numneigh = listmiddle->numneigh;
     int * const * const firstneigh = listmiddle->firstneigh;
-  
+
     const double cut_in_off = cut_respa[0];
     const double cut_in_on = cut_respa[1];
     const double cut_out_on = cut_respa[2];
@@ -436,7 +436,7 @@ namespace LAMMPS_NS {
     const double cut_in_on_sq = cut_in_on*cut_in_on;
     const double cut_out_on_sq = cut_out_on*cut_out_on;
     const double cut_out_off_sq = cut_out_off*cut_out_off;
-  
+
     // loop over neighbors of my atoms
 
     int ii,jj;
@@ -452,9 +452,9 @@ namespace LAMMPS_NS {
 
       for (jj = 0; jj < jnum; jj++) {
         int j2 = jlist[jj];
-	factor_lj = special_lj[sbmask(j2)];
-	factor_coul = special_coul[sbmask(j2)];
-	const int j = j2 & NEIGHMASK;
+        factor_lj = special_lj[sbmask(j2)];
+        factor_coul = special_coul[sbmask(j2)];
+        const int j = j2 & NEIGHMASK;
 
         const double delx = xtmp - x[j][0];
         const double dely = ytmp - x[j][1];
@@ -474,11 +474,11 @@ namespace LAMMPS_NS {
             CG_LJ_INNER(0,fpair);
             fpair *= r2inv;
             if (rsq < cut_in_on_sq) {
-              const double rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
+              const double rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
               fpair *= rsw*rsw*(3.0 - 2.0*rsw);
             }
             if (rsq > cut_out_on_sq) {
-              const double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
+              const double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
               fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
             }
           } else {
@@ -494,11 +494,11 @@ namespace LAMMPS_NS {
 
             fpair = (forcecoul + forcelj) * r2inv;
             if (rsq < cut_in_on_sq) {
-              const double rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
+              const double rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
               fpair *= rsw*rsw*(3.0 - 2.0*rsw);
             }
             if (rsq > cut_out_on_sq) {
-              const double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
+              const double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
               fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
             }
           }
@@ -519,7 +519,7 @@ namespace LAMMPS_NS {
 /* ---------------------------------------------------------------------- */
 
   template < const int EVFLAG, const int EFLAG, const int VFLAG,
-    const int NEWTON_PAIR, const int COUL_TYPE > 
+    const int NEWTON_PAIR, const int COUL_TYPE >
     void PairCMMCommon::eval_outer()
   {
     double ** const x = atom->x;
@@ -536,7 +536,7 @@ namespace LAMMPS_NS {
     const int * const ilist = listouter->ilist;
     const int * const numneigh = listouter->numneigh;
     int * const * const firstneigh = listouter->firstneigh;
-  
+
     const double cut_in_off = cut_respa[2];
     const double cut_in_on = cut_respa[3];
 
@@ -559,9 +559,9 @@ namespace LAMMPS_NS {
 
       for (jj = 0; jj < jnum; jj++) {
         int j2 = jlist[jj];
-	factor_lj = special_lj[sbmask(j2)];
-	factor_coul = special_coul[sbmask(j2)];
-	const int j = j2 & NEIGHMASK;
+        factor_lj = special_lj[sbmask(j2)];
+        factor_coul = special_coul[sbmask(j2)];
+        const int j = j2 & NEIGHMASK;
 
         const double delx = xtmp - x[j][0];
         const double dely = ytmp - x[j][1];
@@ -579,7 +579,7 @@ namespace LAMMPS_NS {
         if (rsq < cutsq[itype][jtype]) {
           if (COUL_TYPE == CG_COUL_NONE) {
             double forcelj=0.0;
-            
+
             if (rsq > cut_in_off_sq) {
               CG_LJ_INNER(0,forcelj);
               fpair = forcelj*r2inv;
@@ -599,7 +599,7 @@ namespace LAMMPS_NS {
             }
 
             CG_LJ_ENERGY(EFLAG);
-              
+
             if (VFLAG) {
               if (rsq <= cut_in_off_sq) {
                 CG_LJ_INNER(0,fpair);
@@ -608,13 +608,13 @@ namespace LAMMPS_NS {
                 fpair = forcelj*r2inv;
               }
             }
-            
+
             if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
                                  evdwl,ecoul,fpair,delx,dely,delz);
           } else {
             double forcelj  = 0.0;
             double forcecoul = 0.0;
-            
+
             if (rsq < cut_ljsq[itype][jtype]) {
               CG_LJ_INNER(EFLAG,forcelj);
             }
@@ -626,7 +626,7 @@ namespace LAMMPS_NS {
                 double qscreen=exp(-kappa*r);
                 forcecoul = factor_coul * qqrd2e
                   * qtmp * q[j] * qscreen * (kappa + 1.0/r);
-                if (EFLAG) ecoul=factor_coul*qqrd2e 
+                if (EFLAG) ecoul=factor_coul*qqrd2e
                   * qtmp*q[j] * qscreen / r;
               }
             }
@@ -635,7 +635,7 @@ namespace LAMMPS_NS {
               if (rsq < cut_coulsq_global) {
                 if (!ncoultablebits || rsq <= tabinnersq) {
                   const double r = sqrt(rsq);
-                  
+
                   const double grij = g_ewald * r;
                   const double expm2 = exp(-grij*grij);
                   const double t = 1.0 / (1.0 + EWALD_P*grij);
diff --git a/src/USER-CG-CMM/pair_lj_sdk.cpp b/src/USER-CG-CMM/pair_lj_sdk.cpp
index 9dac84d313..681260993f 100644
--- a/src/USER-CG-CMM/pair_lj_sdk.cpp
+++ b/src/USER-CG-CMM/pair_lj_sdk.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -68,7 +68,7 @@ PairLJSDK::~PairLJSDK()
     memory->destroy(rminsq);
     memory->destroy(emin);
 
-    allocated = 0;   
+    allocated = 0;
   }
 }
 
@@ -94,7 +94,7 @@ void PairLJSDK::compute(int eflag, int vflag)
   }
 
   if (vflag_fdotr) virial_fdotr_compute();
-} 
+}
 
 /* ---------------------------------------------------------------------- */
 
@@ -145,50 +145,50 @@ void PairLJSDK::eval()
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	const int ljt = lj_type[itype][jtype];
-
-	if (ljt == LJ12_4) {
-	  const double r4inv=r2inv*r2inv;
-	  forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
-			   - lj2[itype][jtype]);
-
-	  if (EFLAG)
-	    evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
-			   - lj4[itype][jtype]) - offset[itype][jtype];
-	  
-	} else if (ljt == LJ9_6) {
-	  const double r3inv = r2inv*sqrt(r2inv);
-	  const double r6inv = r3inv*r3inv;
-	  forcelj = r6inv*(lj1[itype][jtype]*r3inv
-			   - lj2[itype][jtype]);
-	  if (EFLAG)
-	    evdwl = r6inv*(lj3[itype][jtype]*r3inv
-			   - lj4[itype][jtype]) - offset[itype][jtype];
-
-	} else if (ljt == LJ12_6) {
-	  const double r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv*(lj1[itype][jtype]*r6inv
-			  - lj2[itype][jtype]);
-	  if (EFLAG)
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv
-			   - lj4[itype][jtype]) - offset[itype][jtype];
-	} else continue;
-
-	fpair = factor_lj*forcelj*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) evdwl *= factor_lj;
-	if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        const int ljt = lj_type[itype][jtype];
+
+        if (ljt == LJ12_4) {
+          const double r4inv=r2inv*r2inv;
+          forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
+                           - lj2[itype][jtype]);
+
+          if (EFLAG)
+            evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
+                           - lj4[itype][jtype]) - offset[itype][jtype];
+
+        } else if (ljt == LJ9_6) {
+          const double r3inv = r2inv*sqrt(r2inv);
+          const double r6inv = r3inv*r3inv;
+          forcelj = r6inv*(lj1[itype][jtype]*r3inv
+                           - lj2[itype][jtype]);
+          if (EFLAG)
+            evdwl = r6inv*(lj3[itype][jtype]*r3inv
+                           - lj4[itype][jtype]) - offset[itype][jtype];
+
+        } else if (ljt == LJ12_6) {
+          const double r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv*(lj1[itype][jtype]*r6inv
+                          - lj2[itype][jtype]);
+          if (EFLAG)
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv
+                           - lj4[itype][jtype]) - offset[itype][jtype];
+        } else continue;
+
+        fpair = factor_lj*forcelj*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) evdwl *= factor_lj;
+        if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
     f[i][0] += fxtmp;
@@ -248,7 +248,7 @@ void PairLJSDK::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -298,13 +298,13 @@ double PairLJSDK::init_one(int i, int j)
 {
   if (setflag[i][j] == 0)
     error->all(FLERR,"No mixing support for lj/sdk. "
-	       "Coefficients for all pairs need to be set explicitly.");
+               "Coefficients for all pairs need to be set explicitly.");
 
   const int ljt = lj_type[i][j];
 
   if (ljt == LJ_NOT_SET)
     error->all(FLERR,"unrecognized LJ parameter flag");
-  
+
   lj1[i][j] = lj_prefact[ljt] * lj_pow1[ljt] * epsilon[i][j] * pow(sigma[i][j],lj_pow1[ljt]);
   lj2[i][j] = lj_prefact[ljt] * lj_pow2[ljt] * epsilon[i][j] * pow(sigma[i][j],lj_pow2[ljt]);
   lj3[i][j] = lj_prefact[ljt] * epsilon[i][j] * pow(sigma[i][j],lj_pow1[ljt]);
@@ -329,12 +329,12 @@ double PairLJSDK::init_one(int i, int j)
   const double eps = epsilon[i][j];
   const double sig = sigma[i][j];
   const double rmin = sig*exp(1.0/(lj_pow1[ljt]-lj_pow2[ljt])
-			      *log(lj_pow1[ljt]/lj_pow2[ljt]) );
+                              *log(lj_pow1[ljt]/lj_pow2[ljt]) );
   rminsq[j][i] = rminsq[i][j] = rmin*rmin;
 
   const double ratio = sig/rmin;
   const double emin_one = lj_prefact[ljt] * eps * (pow(ratio,lj_pow1[ljt])
-						   - pow(ratio,lj_pow2[ljt]));
+                                                   - pow(ratio,lj_pow2[ljt]));
   emin[j][i] = emin[i][j] = emin_one;
 
   // compute I,J contribution to long-range tail correction
@@ -347,7 +347,7 @@ double PairLJSDK::init_one(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairLJSDK::write_restart(FILE *fp)
@@ -360,9 +360,9 @@ void PairLJSDK::write_restart(FILE *fp)
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
         fwrite(&lj_type[i][j],sizeof(int),1,fp);
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -383,16 +383,16 @@ void PairLJSDK::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&lj_type[i][j],sizeof(int),1,fp);
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&lj_type[i][j],1,MPI_INT,0,world);
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&lj_type[i][j],sizeof(int),1,fp);
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&lj_type[i][j],1,MPI_INT,0,world);
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -428,23 +428,23 @@ void PairLJSDK::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJSDK::single(int, int, int itype, int jtype, double rsq,
-			 double, double factor_lj, double &fforce)
+                         double, double factor_lj, double &fforce)
 {
 
   if (rsq < cutsq[itype][jtype]) {
-      
+
     const int ljt = lj_type[itype][jtype];
     const double ljpow1 = lj_pow1[ljt];
     const double ljpow2 = lj_pow2[ljt];
     const double ljpref = lj_prefact[ljt];
-        
+
     const double ratio = sigma[itype][jtype]/sqrt(rsq);
     const double eps = epsilon[itype][jtype];
 
-    fforce = factor_lj * ljpref*eps * (ljpow1*pow(ratio,ljpow1) 
-			  - ljpow2*pow(ratio,ljpow2))/rsq;
+    fforce = factor_lj * ljpref*eps * (ljpow1*pow(ratio,ljpow1)
+                          - ljpow2*pow(ratio,ljpow2))/rsq;
     return factor_lj * (ljpref*eps * (pow(ratio,ljpow1) - pow(ratio,ljpow2))
-			- offset[itype][jtype]);
+                        - offset[itype][jtype]);
 
   } else fforce=0.0;
 
@@ -476,9 +476,9 @@ double PairLJSDK::memory_usage()
   int n = atom->ntypes;
 
   // setflag/lj_type
-  bytes += 2 * (n+1)*(n+1)*sizeof(int); 
+  bytes += 2 * (n+1)*(n+1)*sizeof(int);
   // cut/cutsq/epsilon/sigma/offset/lj1/lj2/lj3/lj4/rminsq/emin
-  bytes += 11 * (n+1)*(n+1)*sizeof(double); 
+  bytes += 11 * (n+1)*(n+1)*sizeof(double);
 
   return bytes;
 }
diff --git a/src/USER-CG-CMM/pair_lj_sdk.h b/src/USER-CG-CMM/pair_lj_sdk.h
index 9953b4aede..fd764c6e83 100644
--- a/src/USER-CG-CMM/pair_lj_sdk.h
+++ b/src/USER-CG-CMM/pair_lj_sdk.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -29,7 +29,7 @@ PairStyle(cg/cmm,PairLJSDK)
 
 namespace LAMMPS_NS {
 class LAMMPS;
-  
+
 class PairLJSDK : public Pair {
  public:
   PairLJSDK(LAMMPS *);
@@ -54,7 +54,7 @@ class PairLJSDK : public Pair {
   double **lj1,**lj2,**lj3,**lj4,**offset;
 
   // cutoff and offset for minimum of LJ potential
-  // to be used in SDK angle potential, which 
+  // to be used in SDK angle potential, which
   // uses only the repulsive part of the potential
 
   double **rminsq, **emin;
diff --git a/src/USER-CG-CMM/pair_lj_sdk_coul_long.cpp b/src/USER-CG-CMM/pair_lj_sdk_coul_long.cpp
index 2b86f87ec2..8d57401245 100644
--- a/src/USER-CG-CMM/pair_lj_sdk_coul_long.cpp
+++ b/src/USER-CG-CMM/pair_lj_sdk_coul_long.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -78,7 +78,7 @@ PairLJSDKCoulLong::~PairLJSDKCoulLong()
     memory->destroy(rminsq);
     memory->destroy(emin);
 
-    allocated = 0;   
+    allocated = 0;
   }
   if (ftable) free_tables();
 }
@@ -105,7 +105,7 @@ void PairLJSDKCoulLong::compute(int eflag, int vflag)
   }
 
   if (vflag_fdotr) virial_fdotr_compute();
-} 
+}
 
 /* ---------------------------------------------------------------------- */
 
@@ -163,86 +163,86 @@ void PairLJSDKCoulLong::eval()
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	const int ljt = lj_type[itype][jtype];
-
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (EFLAG) ecoul = prefactor*erfc;
-	    if (factor_coul < 1.0) {
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	      if (EFLAG) ecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (EFLAG) ecoul = qtmp*q[j] * (etable[itable] + fraction*detable[itable]);
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	      if (EFLAG) ecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	}
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-
-	  if (ljt == LJ12_4) {
-	    const double r4inv=r2inv*r2inv;
-	    forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
-			     - lj2[itype][jtype]);
-
-	    if (EFLAG)
-	      evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
-			     - lj4[itype][jtype]) - offset[itype][jtype];
-
-	  } else if (ljt == LJ9_6) {
-	    const double r3inv = r2inv*sqrt(r2inv);
-	    const double r6inv = r3inv*r3inv;
-	    forcelj = r6inv*(lj1[itype][jtype]*r3inv
-			     - lj2[itype][jtype]);
-	    if (EFLAG)
-	      evdwl = r6inv*(lj3[itype][jtype]*r3inv
-			     - lj4[itype][jtype]) - offset[itype][jtype];
-
-	  } else if (ljt == LJ12_6) {
-	    const double r6inv = r2inv*r2inv*r2inv;
-	    forcelj = r6inv*(lj1[itype][jtype]*r6inv
-			     - lj2[itype][jtype]);
-	    if (EFLAG)
-	      evdwl = r6inv*(lj3[itype][jtype]*r6inv
-			     - lj4[itype][jtype]) - offset[itype][jtype];
-	  }
-	  forcelj *= factor_lj;
-	  if (EFLAG) evdwl *= factor_lj;
-	}
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        const int ljt = lj_type[itype][jtype];
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (EFLAG) ecoul = prefactor*erfc;
+            if (factor_coul < 1.0) {
+              forcecoul -= (1.0-factor_coul)*prefactor;
+              if (EFLAG) ecoul -= (1.0-factor_coul)*prefactor;
+            }
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (EFLAG) ecoul = qtmp*q[j] * (etable[itable] + fraction*detable[itable]);
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+              if (EFLAG) ecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+        }
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+
+          if (ljt == LJ12_4) {
+            const double r4inv=r2inv*r2inv;
+            forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
+                             - lj2[itype][jtype]);
+
+            if (EFLAG)
+              evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
+                             - lj4[itype][jtype]) - offset[itype][jtype];
+
+          } else if (ljt == LJ9_6) {
+            const double r3inv = r2inv*sqrt(r2inv);
+            const double r6inv = r3inv*r3inv;
+            forcelj = r6inv*(lj1[itype][jtype]*r3inv
+                             - lj2[itype][jtype]);
+            if (EFLAG)
+              evdwl = r6inv*(lj3[itype][jtype]*r3inv
+                             - lj4[itype][jtype]) - offset[itype][jtype];
+
+          } else if (ljt == LJ12_6) {
+            const double r6inv = r2inv*r2inv*r2inv;
+            forcelj = r6inv*(lj1[itype][jtype]*r6inv
+                             - lj2[itype][jtype]);
+            if (EFLAG)
+              evdwl = r6inv*(lj3[itype][jtype]*r6inv
+                             - lj4[itype][jtype]) - offset[itype][jtype];
+          }
+          forcelj *= factor_lj;
+          if (EFLAG) evdwl *= factor_lj;
+        }
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EVFLAG) ev_tally(i,j,nlocal,NEWTON_PAIR,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
     f[i][0] += fxtmp;
@@ -306,7 +306,7 @@ void PairLJSDKCoulLong::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
+        if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
   }
 }
 
@@ -380,7 +380,7 @@ double PairLJSDKCoulLong::init_one(int i, int j)
 {
   if (setflag[i][j] == 0)
     error->all(FLERR,"No mixing support for lj/sdk/coul/long. "
-	       "Coefficients for all pairs need to be set explicitly.");
+               "Coefficients for all pairs need to be set explicitly.");
 
   const int ljt = lj_type[i][j];
 
@@ -414,12 +414,12 @@ double PairLJSDKCoulLong::init_one(int i, int j)
   const double eps = epsilon[i][j];
   const double sig = sigma[i][j];
   const double rmin = sig*exp(1.0/(lj_pow1[ljt]-lj_pow2[ljt])
-			      *log(lj_pow1[ljt]/lj_pow2[ljt]) );
+                              *log(lj_pow1[ljt]/lj_pow2[ljt]) );
   rminsq[j][i] = rminsq[i][j] = rmin*rmin;
 
   const double ratio = sig/rmin;
   const double emin_one = lj_prefact[ljt] * eps * (pow(ratio,lj_pow1[ljt])
-						   - pow(ratio,lj_pow2[ljt]));
+                                                   - pow(ratio,lj_pow2[ljt]));
   emin[j][i] = emin[i][j] = emin_one;
 
   // compute I,J contribution to long-range tail correction
@@ -443,17 +443,17 @@ void PairLJSDKCoulLong::init_tables()
 
   tabinnersq = tabinner*tabinner;
   init_bitmap(tabinner,cut_coul,ncoultablebits,
-	      masklo,maskhi,ncoulmask,ncoulshiftbits);
-  
+              masklo,maskhi,ncoulmask,ncoulshiftbits);
+
   int ntable = 1;
   for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
-  
+
   // linear lookup tables of length N = 2^ncoultablebits
   // stored value = value at lower edge of bin
   // d values = delta from lower edge to upper edge of bin
 
   if (ftable) free_tables();
-  
+
   memory->create(rtable,ntable,"pair:rtable");
   memory->create(ftable,ntable,"pair:ftable");
   memory->create(ctable,ntable,"pair:ctable");
@@ -468,7 +468,7 @@ void PairLJSDKCoulLong::init_tables()
   int itablemin;
   minrsq_lookup.i = 0 << ncoulshiftbits;
   minrsq_lookup.i |= maskhi;
-    
+
   for (int i = 0; i < ntable; i++) {
     rsq_lookup.i = i << ncoulshiftbits;
     rsq_lookup.i |= masklo;
@@ -489,9 +489,9 @@ void PairLJSDKCoulLong::init_tables()
   }
 
   tabinnersq = minrsq_lookup.f;
-  
+
   int ntablem1 = ntable - 1;
-  
+
   for (int i = 0; i < ntablem1; i++) {
     drtable[i] = 1.0/(rtable[i+1] - rtable[i]);
     dftable[i] = ftable[i+1] - ftable[i];
@@ -499,31 +499,31 @@ void PairLJSDKCoulLong::init_tables()
     detable[i] = etable[i+1] - etable[i];
   }
 
-  // get the delta values for the last table entries 
+  // get the delta values for the last table entries
   // tables are connected periodically between 0 and ntablem1
-    
+
   drtable[ntablem1] = 1.0/(rtable[0] - rtable[ntablem1]);
   dftable[ntablem1] = ftable[0] - ftable[ntablem1];
   dctable[ntablem1] = ctable[0] - ctable[ntablem1];
   detable[ntablem1] = etable[0] - etable[ntablem1];
 
-  // get the correct delta values at itablemax    
+  // get the correct delta values at itablemax
   // smallest r is in bin itablemin
   // largest r is in bin itablemax, which is itablemin-1,
   //   or ntablem1 if itablemin=0
   // deltas at itablemax only needed if corresponding rsq < cut*cut
-  // if so, compute deltas between rsq and cut*cut 
+  // if so, compute deltas between rsq and cut*cut
 
   double f_tmp,c_tmp,e_tmp;
   itablemin = minrsq_lookup.i & ncoulmask;
-  itablemin >>= ncoulshiftbits;  
-  int itablemax = itablemin - 1; 
-  if (itablemin == 0) itablemax = ntablem1;     
+  itablemin >>= ncoulshiftbits;
+  int itablemax = itablemin - 1;
+  if (itablemin == 0) itablemax = ntablem1;
   rsq_lookup.i = itablemax << ncoulshiftbits;
   rsq_lookup.i |= maskhi;
 
   if (rsq_lookup.f < cut_coulsq) {
-    rsq_lookup.f = cut_coulsq;  
+    rsq_lookup.f = cut_coulsq;
     r = sqrtf(rsq_lookup.f);
     grij = g_ewald * r;
     expm2 = exp(-grij*grij);
@@ -533,7 +533,7 @@ void PairLJSDKCoulLong::init_tables()
     c_tmp = qqrd2e/r;
     e_tmp = qqrd2e/r * derfc;
 
-    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);   
+    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);
     dftable[itablemax] = f_tmp - ftable[itablemax];
     dctable[itablemax] = c_tmp - ctable[itablemax];
     detable[itablemax] = e_tmp - etable[itablemax];
@@ -554,9 +554,9 @@ void PairLJSDKCoulLong::write_restart(FILE *fp)
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
         fwrite(&lj_type[i][j],sizeof(int),1,fp);
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -577,16 +577,16 @@ void PairLJSDKCoulLong::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&lj_type[i][j],sizeof(int),1,fp);
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&lj_type[i][j],1,MPI_INT,0,world);
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&lj_type[i][j],sizeof(int),1,fp);
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut_lj[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&lj_type[i][j],1,MPI_INT,0,world);
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -640,9 +640,9 @@ void PairLJSDKCoulLong::free_tables()
 /* ---------------------------------------------------------------------- */
 
 double PairLJSDKCoulLong::single(int i, int j, int itype, int jtype,
-				 double rsq,
-				 double factor_coul, double factor_lj,
-				 double &fforce)
+                                 double rsq,
+                                 double factor_coul, double factor_lj,
+                                 double &fforce)
 {
   double r2inv,r,grij,expm2,t,erfc,prefactor;
   double fraction,table,forcecoul,forcelj,phicoul,philj;
@@ -662,8 +662,8 @@ double PairLJSDKCoulLong::single(int i, int j, int itype, int jtype,
       forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
       phicoul = prefactor*erfc;
       if (factor_coul < 1.0) {
-	forcecoul -= (1.0-factor_coul)*prefactor;
-	phicoul -= (1.0-factor_coul)*prefactor;
+        forcecoul -= (1.0-factor_coul)*prefactor;
+        phicoul -= (1.0-factor_coul)*prefactor;
       }
     } else {
       union_int_float_t rsq_lookup_single;
@@ -676,10 +676,10 @@ double PairLJSDKCoulLong::single(int i, int j, int itype, int jtype,
       table = etable[itable] + fraction*detable[itable];
       phicoul = atom->q[i]*atom->q[j] * table;
       if (factor_coul < 1.0) {
-	table = ctable[itable] + fraction*dctable[itable];
-	prefactor = atom->q[i]*atom->q[j] * table;
-	forcecoul -= (1.0-factor_coul)*prefactor;
-	phicoul -= (1.0-factor_coul)*prefactor;
+        table = ctable[itable] + fraction*dctable[itable];
+        prefactor = atom->q[i]*atom->q[j] * table;
+        forcecoul -= (1.0-factor_coul)*prefactor;
+        phicoul -= (1.0-factor_coul)*prefactor;
       }
     }
   }
@@ -689,14 +689,14 @@ double PairLJSDKCoulLong::single(int i, int j, int itype, int jtype,
     const double ljpow1 = lj_pow1[ljt];
     const double ljpow2 = lj_pow2[ljt];
     const double ljpref = lj_prefact[ljt];
-        
+
     const double ratio = sigma[itype][jtype]/sqrt(rsq);
     const double eps = epsilon[itype][jtype];
 
-    forcelj = factor_lj * ljpref*eps * (ljpow1*pow(ratio,ljpow1) 
-			  - ljpow2*pow(ratio,ljpow2))/rsq;
+    forcelj = factor_lj * ljpref*eps * (ljpow1*pow(ratio,ljpow1)
+                          - ljpow2*pow(ratio,ljpow2))/rsq;
     philj = factor_lj * (ljpref*eps * (pow(ratio,ljpow1) - pow(ratio,ljpow2))
-			 - offset[itype][jtype]);
+                         - offset[itype][jtype]);
   }
 
   fforce = (forcecoul + forcelj) * r2inv;
@@ -718,7 +718,7 @@ void *PairLJSDKCoulLong::extract(const char *str, int &dim)
   if (strcmp(str,"lj4") == 0) return (void *) lj4;
   if (strcmp(str,"rminsq") == 0) return (void *) rminsq;
   if (strcmp(str,"emin") == 0) return (void *) emin;
-  
+
   dim = 0;
   if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul;
   return NULL;
@@ -732,7 +732,7 @@ double PairLJSDKCoulLong::memory_usage()
   int n = atom->ntypes;
 
   // setflag/lj_type
-  bytes += 2 * (n+1)*(n+1)*sizeof(int); 
+  bytes += 2 * (n+1)*(n+1)*sizeof(int);
   // lj_cut/lj_cutsq/epsilon/sigma/offset/lj1/lj2/lj3/lj4/rminsq/emin
   bytes += 11 * (n+1)*(n+1)*sizeof(double);
 
diff --git a/src/USER-CG-CMM/pair_lj_sdk_coul_long.h b/src/USER-CG-CMM/pair_lj_sdk_coul_long.h
index 61043ad2b0..c929712ec1 100644
--- a/src/USER-CG-CMM/pair_lj_sdk_coul_long.h
+++ b/src/USER-CG-CMM/pair_lj_sdk_coul_long.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ class PairLJSDKCoulLong : public Pair {
   int **lj_type;
 
   // cutoff and offset for minimum of LJ potential
-  // to be used in SDK angle potential, which 
+  // to be used in SDK angle potential, which
   // uses only the repulsive part of the potential
 
   double **rminsq, **emin;
diff --git a/src/USER-COLVARS/colvarproxy_lammps.cpp b/src/USER-COLVARS/colvarproxy_lammps.cpp
index e7b256d0e7..f5a0a5df68 100644
--- a/src/USER-COLVARS/colvarproxy_lammps.cpp
+++ b/src/USER-COLVARS/colvarproxy_lammps.cpp
@@ -47,7 +47,7 @@ static void my_backup_file(const char *filename, const char *extension)
       char *sys_err_msg = strerror(errno);
       if ( !sys_err_msg ) sys_err_msg = (char *) "(unknown error)";
       fprintf(stderr,"Error renaming file %s to %s: %s\n",
-	      filename, backup, sys_err_msg);
+              filename, backup, sys_err_msg);
     }
     delete [] backup;
   }
@@ -56,12 +56,12 @@ static void my_backup_file(const char *filename, const char *extension)
 ////////////////////////////////////////////////////////////////////////
 
 colvarproxy_lammps::colvarproxy_lammps(LAMMPS_NS::LAMMPS *lmp,
-				       const char *conf_file,
-				       const char *inp_name,
-				       const char *out_name,
-				       const int seed,
-				       const double temp,
-				       const int *typemap) 
+                                       const char *conf_file,
+                                       const char *inp_name,
+                                       const char *out_name,
+                                       const int seed,
+                                       const double temp,
+                                       const int *typemap)
   : _lmp(lmp), _typemap(typemap)
 {
   if (cvm::debug())
@@ -127,7 +127,7 @@ colvarproxy_lammps::~colvarproxy_lammps()
   }
 }
 
-// trigger colvars computation 
+// trigger colvars computation
 double colvarproxy_lammps::compute()
 {
   if (first_timestep) {
@@ -145,8 +145,8 @@ double colvarproxy_lammps::compute()
 
   if (cvm::debug()) {
     cvm::log(cvm::line_marker+
-	     "colvarproxy_lammps, step no. "+cvm::to_str(colvars->it)+"\n"+
-	     "Updating internal data.\n");
+             "colvarproxy_lammps, step no. "+cvm::to_str(colvars->it)+"\n"+
+             "Updating internal data.\n");
   }
 
   // call the collective variable module
@@ -155,9 +155,9 @@ double colvarproxy_lammps::compute()
 #if 0
   for (int i=0; i < colvars_atoms.size(); ++i) {
     fprintf(stderr,"CV: atom %d/%d/%d pos: %g %g %g  for: %g %g %g\n",
-	    colvars_atoms[i], colvars_atoms_ncopies[i],
-	    positions[i].type, positions[i].x, positions[i].y, positions[i].z,
-	    applied_forces[i].x, applied_forces[i].y, applied_forces[i].z);
+            colvars_atoms[i], colvars_atoms_ncopies[i],
+            positions[i].type, positions[i].x, positions[i].y, positions[i].z,
+            applied_forces[i].x, applied_forces[i].y, applied_forces[i].z);
   }
 #endif
 
@@ -165,7 +165,7 @@ double colvarproxy_lammps::compute()
 }
 
 cvm::rvector colvarproxy_lammps::position_distance(cvm::atom_pos const &pos1,
-						   cvm::atom_pos const &pos2)
+                                                   cvm::atom_pos const &pos2)
 {
   double xtmp = pos2.x - pos1.x;
   double ytmp = pos2.y - pos1.y;
@@ -175,7 +175,7 @@ cvm::rvector colvarproxy_lammps::position_distance(cvm::atom_pos const &pos1,
 }
 
 cvm::real colvarproxy_lammps::position_dist2(cvm::atom_pos const &pos1,
-					     cvm::atom_pos const &pos2)
+                                             cvm::atom_pos const &pos2)
 {
   double xtmp = pos2.x - pos1.x;
   double ytmp = pos2.y - pos1.y;
@@ -186,7 +186,7 @@ cvm::real colvarproxy_lammps::position_dist2(cvm::atom_pos const &pos1,
 
 
 inline void colvarproxy_lammps::select_closest_image(cvm::atom_pos &pos,
-						     cvm::atom_pos const &ref)
+                                                     cvm::atom_pos const &ref)
 {
   double xtmp = pos.x - ref.x;
   double ytmp = pos.y - ref.y;
@@ -214,10 +214,10 @@ void colvarproxy_lammps::fatal_error(std::string const &message)
   log(message);
   if (!cvm::debug())
     log("If this error message is unclear, try recompiling the "
-	 "colvars library and LAMMPS with -DCOLVARS_DEBUG.\n");
+         "colvars library and LAMMPS with -DCOLVARS_DEBUG.\n");
 
   _lmp->error->one(FLERR,
-		   "Fatal error in the collective variables module.\n");
+                   "Fatal error in the collective variables module.\n");
 }
 
 void colvarproxy_lammps::exit(std::string const &message)
@@ -256,7 +256,7 @@ e_pdb_field pdb_field_str2enum(std::string const &pdb_field_str)
       colvarparse::to_lower_cppstr("X")) {
     pdb_field = e_pdb_x;
   }
-  
+
   if (colvarparse::to_lower_cppstr(pdb_field_str) ==
       colvarparse::to_lower_cppstr("Y")) {
     pdb_field = e_pdb_y;
@@ -283,7 +283,7 @@ void colvarproxy_lammps::load_coords(char const *pdb_filename,
 {
 
   cvm::fatal_error("Reading collective variable coordinates "
-		    "from a PDB file is currently not supported.\n");
+                    "from a PDB file is currently not supported.\n");
 }
 
 void colvarproxy_lammps::load_atoms(char const *pdb_filename,
@@ -292,7 +292,7 @@ void colvarproxy_lammps::load_atoms(char const *pdb_filename,
                                    double const pdb_field_value)
 {
   cvm::fatal_error("Selecting collective variable atoms "
-		    "from a PDB file is currently not supported.\n");
+                    "from a PDB file is currently not supported.\n");
 }
 
 void colvarproxy_lammps::backup_file(char const *filename)
@@ -339,11 +339,11 @@ cvm::atom::atom(const int &id)
 
   if (cvm::debug())
     cvm::log("Adding atom "+cvm::to_str(id)+
-	     " for collective variables calculation.\n");
+             " for collective variables calculation.\n");
 
   if (id < 0)
     cvm::fatal_error("Error: invalid atom ID specified, "+
-		     cvm::to_str(id)+"\n");
+                     cvm::to_str(id)+"\n");
 
   int idx = ((colvarproxy_lammps *) cvm::proxy)->init_lammps_atom(id,this);
   if (idx < 0)
@@ -352,7 +352,7 @@ cvm::atom::atom(const int &id)
   this->index = idx;
   if (cvm::debug())
     cvm::log("The index of this atom in the colvarproxy_lammps arrays is "+
-	     cvm::to_str(this->index)+".\n");
+             cvm::to_str(this->index)+".\n");
 
   this->reset_data();
 }
@@ -362,11 +362,11 @@ cvm::atom::atom(const int &id)
 /// "MAIN" (the segment id assigned by NAMD's AMBER topology parser),
 /// and is therefore optional when an AMBER topology is used
 cvm::atom::atom(cvm::residue_id const &residue,
-		std::string const     &atom_name,
-		std::string const     &segment_id)
+                std::string const     &atom_name,
+                std::string const     &segment_id)
 {
   cvm::fatal_error("Creating collective variable atoms "
-		   "from a PDB file is currently not supported.\n");
+                   "from a PDB file is currently not supported.\n");
 }
 
 
@@ -383,7 +383,7 @@ cvm::atom::atom(cvm::atom const &a)
 }
 
 
-cvm::atom::~atom() 
+cvm::atom::~atom()
 {
   colvarproxy_lammps *cp = (colvarproxy_lammps *) cvm::proxy;
   if (cp->colvars_atoms_ncopies[this->index] > 0)
@@ -422,4 +422,3 @@ void cvm::atom::apply_force(cvm::rvector const &new_force)
   cp->applied_forces[this->index].y = new_force.y;
   cp->applied_forces[this->index].z = new_force.z;
 }
-
diff --git a/src/USER-COLVARS/colvarproxy_lammps.h b/src/USER-COLVARS/colvarproxy_lammps.h
index 8786f07482..7d2f3b7fe5 100644
--- a/src/USER-COLVARS/colvarproxy_lammps.h
+++ b/src/USER-COLVARS/colvarproxy_lammps.h
@@ -15,19 +15,19 @@
 #include <iostream>
 
 /* struct for packed data communication of coordinates and forces. */
-struct commdata { 
-  int tag,type; 
-  double x,y,z; 
+struct commdata {
+  int tag,type;
+  double x,y,z;
 };
 
 inline std::ostream & operator<< (std::ostream &out, const commdata &cd)
 {
-  out << " (" << cd.tag << "/" << cd.type << ": " 
+  out << " (" << cd.tag << "/" << cd.type << ": "
       << cd.x << ", " << cd.y << ", " << cd.z << ") ";
   return out;
 };
 
-/// \brief Communication between colvars and LAMMPS 
+/// \brief Communication between colvars and LAMMPS
 /// (implementation of \link colvarproxy \endlink)
 class colvarproxy_lammps : public colvarproxy {
 
@@ -64,7 +64,7 @@ class colvarproxy_lammps : public colvarproxy {
  public:
   friend class cvm::atom;
   colvarproxy_lammps (LAMMPS_NS::LAMMPS *lmp, const char *, const char *,
-		      const char *, const int, const double, const int *);
+                      const char *, const int, const double, const int *);
   virtual ~colvarproxy_lammps();
 
  // disable default and copy constructor
diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp
index 2ef1893b90..2f8ca857cb 100644
--- a/src/USER-COLVARS/fix_colvars.cpp
+++ b/src/USER-COLVARS/fix_colvars.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -78,7 +78,7 @@ static int inthash(const inthash_t *tptr, int key) {
   hashvalue = (((key*1103515249)>>tptr->downshift) & tptr->mask);
   if (hashvalue < 0) {
     hashvalue = 0;
-  }    
+  }
 
   return hashvalue;
 }
@@ -205,7 +205,7 @@ int inthash_insert(inthash_t *tptr, int key, int data) {
 
 /*
  * inthash_destroy() - Delete the entire table, and all remaining entries.
- * 
+ *
  */
 void inthash_destroy(inthash_t *tptr) {
   inthash_node_t *node, *last;
@@ -213,12 +213,12 @@ void inthash_destroy(inthash_t *tptr) {
 
   for (i=0; i<tptr->size; i++) {
     node = tptr->bucket[i];
-    while (node != NULL) { 
-      last = node;   
+    while (node != NULL) {
+      last = node;
       node = node->next;
       free(last);
     }
-  }     
+  }
 
   /* free the entire array of buckets */
   if (tptr->bucket != NULL) {
@@ -274,7 +274,7 @@ using namespace FixConst;
 int FixColvars::instances=0;
 
 /***************************************************************
- create class and parse arguments in LAMMPS script. Syntax: 
+ create class and parse arguments in LAMMPS script. Syntax:
 
  fix ID group-ID colvars <config_file> [optional flags...]
 
@@ -310,7 +310,7 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) :
   extscalar = 1;
 
   me = comm->me;
-  
+
   conf_file = strdup(arg[3]);
   rng_seed = 1966;
 
@@ -457,7 +457,7 @@ void FixColvars::init()
       MPI_Get_count(&status, MPI_INT, &ndata);
 
       for (int k=0; k<ndata; k+=2)
-	typemap[type_buf[k]] = type_buf[k+1];
+        typemap[type_buf[k]] = type_buf[k+1];
     }
   } else { // me != 0
 
@@ -480,25 +480,25 @@ void FixColvars::init()
 
     if (inp_name) {
       if (strcmp(inp_name,"NULL") == 0) {
-	memory->sfree(inp_name);
-	inp_name = NULL;
+        memory->sfree(inp_name);
+        inp_name = NULL;
       }
     }
 
     double t_target = 0.0;
     if (tmp_name) {
       if (strcmp(tmp_name,"NULL") == 0)
-	tstat_id = -1;
+        tstat_id = -1;
       else {
-	tstat_id = modify->find_fix(tmp_name);
-	if (tstat_id < 0) error->one(FLERR,"Could not find tstat fix ID");
-	double *tt = (double*)modify->fix[tstat_id]->extract("t_target",tmp);
-	if (tt) t_target = *tt;
+        tstat_id = modify->find_fix(tmp_name);
+        if (tstat_id < 0) error->one(FLERR,"Could not find tstat fix ID");
+        double *tt = (double*)modify->fix[tstat_id]->extract("t_target",tmp);
+        if (tt) t_target = *tt;
       }
     }
 
     proxy = new colvarproxy_lammps(lmp,conf_file,inp_name,out_name,
-				   rng_seed,t_target,typemap);
+                                   rng_seed,t_target,typemap);
     coords = proxy->get_coords();
     forces = proxy->get_forces();
     oforce = proxy->get_oforce();
@@ -549,12 +549,12 @@ void FixColvars::init()
     for (i=0; i<num_coords; ++i) {
       const int k = atom->map(taglist[i]);
       if ((k >= 0) && (k < nlocal)) {
-	of[i].tag  = cd[i].tag  = tag[k];
-	of[i].type = cd[i].type = type[k];
-	cd[i].x = x[k][0];
-	cd[i].y = x[k][1];
-	cd[i].z = x[k][2];
-	of[i].x = of[i].y = of[i].z = 0.0;
+        of[i].tag  = cd[i].tag  = tag[k];
+        of[i].type = cd[i].type = type[k];
+        cd[i].x = x[k][0];
+        cd[i].y = x[k][1];
+        cd[i].z = x[k][2];
+        of[i].x = of[i].y = of[i].z = 0.0;
       }
     }
 
@@ -569,15 +569,15 @@ void FixColvars::init()
       ndata /= size_one;
 
       for (int k=0; k<ndata; ++k) {
-	const int j = inthash_lookup(idmap, comm_buf[k].tag);
-	if (j != HASH_FAIL) {
-	  of[j].tag  = cd[j].tag  = comm_buf[k].tag;
-	  of[j].type = cd[j].type = comm_buf[k].type;
-	  cd[j].x = comm_buf[k].x;
-	  cd[j].y = comm_buf[k].y;
-	  cd[j].z = comm_buf[k].z;
-	  of[j].x = of[j].y = of[j].z = 0.0;
-	}
+        const int j = inthash_lookup(idmap, comm_buf[k].tag);
+        if (j != HASH_FAIL) {
+          of[j].tag  = cd[j].tag  = comm_buf[k].tag;
+          of[j].type = cd[j].type = comm_buf[k].type;
+          cd[j].x = comm_buf[k].x;
+          cd[j].y = comm_buf[k].y;
+          cd[j].z = comm_buf[k].z;
+          of[j].x = of[j].y = of[j].z = 0.0;
+        }
       }
     }
   } else { // me != 0
@@ -588,12 +588,12 @@ void FixColvars::init()
     for (i=0; i<num_coords; ++i) {
       const int k = atom->map(taglist[i]);
       if ((k >= 0) && (k < nlocal)) {
-	comm_buf[nme].tag  = tag[k];
-	comm_buf[nme].type = type[k];
-	comm_buf[nme].x    = x[k][0];
-	comm_buf[nme].y    = x[k][1];
-	comm_buf[nme].z    = x[k][2];
-	++nme;
+        comm_buf[nme].tag  = tag[k];
+        comm_buf[nme].type = type[k];
+        comm_buf[nme].x    = x[k][0];
+        comm_buf[nme].y    = x[k][1];
+        comm_buf[nme].z    = x[k][2];
+        ++nme;
       }
     }
     /* blocking receive to wait until it is our turn to send data. */
@@ -633,10 +633,10 @@ void FixColvars::post_force(int vflag)
       // get thermostat target temperature from corresponding fix,
       // if the fix supports extraction.
       double *tt = (double *) modify->fix[tstat_id]->extract("t_target",tmp);
-      if (tt) 
-	proxy->set_temperature(*tt);
-      else 
-	proxy->set_temperature(0.0);
+      if (tt)
+        proxy->set_temperature(*tt);
+      else
+        proxy->set_temperature(0.0);
     }
   }
 
@@ -671,9 +671,9 @@ void FixColvars::post_force(int vflag)
     for (i=0; i<num_coords; ++i) {
       const int k = atom->map(taglist[i]);
       if ((k >= 0) && (k < nlocal)) {
-	cd[i].x = x[k][0];
-	cd[i].y = x[k][1];
-	cd[i].z = x[k][2];
+        cd[i].x = x[k][0];
+        cd[i].y = x[k][1];
+        cd[i].z = x[k][2];
       }
     }
 
@@ -687,12 +687,12 @@ void FixColvars::post_force(int vflag)
       ndata /= size_one;
 
       for (int k=0; k<ndata; ++k) {
-	const int j = inthash_lookup(idmap, comm_buf[k].tag);
-	if (j != HASH_FAIL) {
-	  cd[j].x = comm_buf[k].x;
-	  cd[j].y = comm_buf[k].y;
-	  cd[j].z = comm_buf[k].z;
-	}
+        const int j = inthash_lookup(idmap, comm_buf[k].tag);
+        if (j != HASH_FAIL) {
+          cd[j].x = comm_buf[k].x;
+          cd[j].y = comm_buf[k].y;
+          cd[j].z = comm_buf[k].z;
+        }
       }
     }
 
@@ -702,11 +702,11 @@ void FixColvars::post_force(int vflag)
     for (i=0; i<num_coords; ++i) {
       const int k = atom->map(taglist[i]);
       if ((k >= 0) && (k < nlocal)) {
-	comm_buf[nme].tag = tag[k];
-	comm_buf[nme].x = x[k][0];
-	comm_buf[nme].y = x[k][1];
-	comm_buf[nme].z = x[k][2];
-	++nme;
+        comm_buf[nme].tag = tag[k];
+        comm_buf[nme].x = x[k][0];
+        comm_buf[nme].y = x[k][1];
+        comm_buf[nme].z = x[k][2];
+        ++nme;
       }
     }
     /* blocking receive to wait until it is our turn to send data. */
@@ -724,7 +724,7 @@ void FixColvars::post_force(int vflag)
 
   // broadcast store_forces flag and energy data to all processors
   MPI_Bcast(&energy, 1, MPI_DOUBLE, 0, world);
-  MPI_Bcast(&store_forces, 1, MPI_INT, 0, world);  
+  MPI_Bcast(&store_forces, 1, MPI_INT, 0, world);
 
   // broadcast and apply biasing forces
 
@@ -738,7 +738,7 @@ void FixColvars::post_force(int vflag)
     }
   }
   MPI_Bcast(force_buf, 3*num_coords, MPI_DOUBLE, 0, world);
-  
+
   for (int i=0; i < num_coords; ++i) {
     const int k = atom->map(taglist[i]);
     if ((k >= 0) && (k < nlocal)) {
@@ -767,7 +767,7 @@ void FixColvars::post_force_respa(int vflag, int ilevel, int iloop)
 void FixColvars::end_of_step()
 {
   if (store_forces) {
-    
+
     const int * const tag = atom->tag;
     double * const * const f = atom->f;
     const int nlocal = atom->nlocal;
@@ -777,7 +777,7 @@ void FixColvars::end_of_step()
     for (i=0; i < num_coords; ++i) {
       const int k = atom->map(taglist[i]);
       if ((k >= 0) && (k < nlocal))
-	++nme;
+        ++nme;
     }
 
     MPI_Allreduce(&nme,&nmax_new,1,MPI_INT,MPI_MAX,world);
@@ -789,56 +789,56 @@ void FixColvars::end_of_step()
     MPI_Status status;
     MPI_Request request;
     int tmp, ndata;
-  
+
     if (me == 0) {
 
       // store old force data
       std::vector<struct commdata> &of = *oforce;
 
       for (i=0; i<num_coords; ++i) {
-	const int k = atom->map(taglist[i]);
-	if ((k >= 0) && (k < nlocal)) {
-      
-	  const int j = inthash_lookup(idmap, tag[k]);
-	  if (j != HASH_FAIL) {
-	    of[j].x = f[k][0];
-	    of[j].y = f[k][1];
-	    of[j].z = f[k][2];
-	  }
-	}
+        const int k = atom->map(taglist[i]);
+        if ((k >= 0) && (k < nlocal)) {
+
+          const int j = inthash_lookup(idmap, tag[k]);
+          if (j != HASH_FAIL) {
+            of[j].x = f[k][0];
+            of[j].y = f[k][1];
+            of[j].z = f[k][2];
+          }
+        }
       }
 
       /* loop over procs to receive remote data */
       for (i=1; i < comm->nprocs; ++i) {
-	int maxbuf = nmax*size_one;
-	MPI_Irecv(comm_buf, maxbuf, MPI_BYTE, i, 0, world, &request);
-	MPI_Send(&tmp, 0, MPI_INT, i, 0, world);
-	MPI_Wait(&request, &status);
-	MPI_Get_count(&status, MPI_BYTE, &ndata);
-	ndata /= size_one;
-
-	for (int k=0; k<ndata; ++k) {
-	  const int j = inthash_lookup(idmap, comm_buf[k].tag);
-	  if (j != HASH_FAIL) {
-	    of[j].x = comm_buf[k].x;
-	    of[j].y = comm_buf[k].y;
-	    of[j].z = comm_buf[k].z;
-	  }
-	}
+        int maxbuf = nmax*size_one;
+        MPI_Irecv(comm_buf, maxbuf, MPI_BYTE, i, 0, world, &request);
+        MPI_Send(&tmp, 0, MPI_INT, i, 0, world);
+        MPI_Wait(&request, &status);
+        MPI_Get_count(&status, MPI_BYTE, &ndata);
+        ndata /= size_one;
+
+        for (int k=0; k<ndata; ++k) {
+          const int j = inthash_lookup(idmap, comm_buf[k].tag);
+          if (j != HASH_FAIL) {
+            of[j].x = comm_buf[k].x;
+            of[j].y = comm_buf[k].y;
+            of[j].z = comm_buf[k].z;
+          }
+        }
       }
 
     } else { // me != 0
       /* copy total force data into communication buffer */
       nme = 0;
       for (i=0; i<num_coords; ++i) {
-	const int k = atom->map(taglist[i]);
-	if ((k >= 0) && (k < nlocal)) {
-	  comm_buf[nme].tag  = tag[k];
-	  comm_buf[nme].x    = f[k][0];
-	  comm_buf[nme].y    = f[k][1];
-	  comm_buf[nme].z    = f[k][2];
-	  ++nme;
-	}
+        const int k = atom->map(taglist[i]);
+        if ((k >= 0) && (k < nlocal)) {
+          comm_buf[nme].tag  = tag[k];
+          comm_buf[nme].x    = f[k][0];
+          comm_buf[nme].y    = f[k][1];
+          comm_buf[nme].z    = f[k][2];
+          ++nme;
+        }
       }
       /* blocking receive to wait until it is our turn to send data. */
       MPI_Recv(&tmp, 0, MPI_INT, 0, 0, world, &status);
diff --git a/src/USER-COLVARS/fix_colvars.h b/src/USER-COLVARS/fix_colvars.h
index fda88391f0..de144edc58 100644
--- a/src/USER-COLVARS/fix_colvars.h
+++ b/src/USER-COLVARS/fix_colvars.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -42,8 +42,8 @@ class FixColvars : public Fix {
   virtual int setmask();
   virtual void init();
   virtual void setup(int);
-  virtual void min_post_force(int); 
-  virtual void post_force(int); 
+  virtual void min_post_force(int);
+  virtual void post_force(int);
   virtual void post_force_respa(int, int, int);
   virtual void post_run();
   virtual void end_of_step();
@@ -59,7 +59,7 @@ class FixColvars : public Fix {
   char *inp_name;      // name/prefix of colvars restart file
   char *out_name;      // prefix string for all output files
   char *tmp_name;      // name of thermostat fix.
-  int   rng_seed;      // seed to initialize random number generator 
+  int   rng_seed;      // seed to initialize random number generator
   int   tstat_id;      // id of the thermostat fix
   double energy;       // biasing energy of the fix
 
@@ -69,7 +69,7 @@ class FixColvars : public Fix {
   std::vector<struct commdata> *coords; // coordinates of colvar atoms
   std::vector<struct commdata> *forces; // received forces of colvar atoms
   std::vector<struct commdata> *oforce; // old total forces of colvar atoms
-  
+
   int   nmax;          // size of atom communication buffer.
   int   size_one;      // bytes per atom in communication buffer.
   struct commdata *comm_buf; // communication buffer
@@ -79,7 +79,7 @@ class FixColvars : public Fix {
   int  *rev_idmap;     // list of the hash keys for reverse mapping.
 
   int nlevels_respa;   // flag to determine respa levels.
-  int store_forces;    // flag to determine whether to store total forces 
+  int store_forces;    // flag to determine whether to store total forces
   static  int instances; // count fix instances, since colvars currently
                          // only supports one instance at a time
 };
diff --git a/src/USER-CUDA/atom_vec_angle_cuda.cpp b/src/USER-CUDA/atom_vec_angle_cuda.cpp
index 08ba9761ed..f7795a3148 100644
--- a/src/USER-CUDA/atom_vec_angle_cuda.cpp
+++ b/src/USER-CUDA/atom_vec_angle_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,8 +64,8 @@ AtomVecAngleCuda::AtomVecAngleCuda(LAMMPS *lmp, int narg, char **arg) :
   AtomVecAngle(lmp, narg, arg)
 {
    cuda = lmp->cuda;
-   if(cuda == NULL) 
-	error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS.."); 
+   if(cuda == NULL)
+        error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
    maxsend=0;
    cudable=true;
@@ -100,13 +100,13 @@ void AtomVecAngleCuda::grow_send(int n,double** buf_send,int flag)  //need to be
       if(*buf_send) CudaWrapper_FreePinnedHostData((void*) (*buf_send));
       *buf_send = (double*) CudaWrapper_AllocPinnedHostData((*maxsend+BUFEXTRA)*sizeof(double),false);
       memcpy(*buf_send,tmp,old_maxsend*sizeof(double));
-      delete [] tmp;	        	
+      delete [] tmp;
     }
     else
     {
-     *buf_send = (double *) 
+     *buf_send = (double *)
       memory->srealloc(*buf_send,(*maxsend+BUFEXTRA)*sizeof(double),
-		       "comm:buf_send");
+                       "comm:buf_send");
     }
   }
   else {
@@ -119,7 +119,7 @@ void AtomVecAngleCuda::grow_send(int n,double** buf_send,int flag)  //need to be
     {
       memory->sfree(*buf_send);
       *buf_send = (double *) memory->smalloc((*maxsend+BUFEXTRA)*sizeof(double),
-					  "comm:buf_send");
+                                          "comm:buf_send");
     }
   }
 }
@@ -141,27 +141,27 @@ void AtomVecAngleCuda::grow_both(int n)
 }
 
 int AtomVecAngleCuda::pack_comm(int n, int* iswap, double *buf,
-			     int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
+                             int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecAngle::pack_comm(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_CommCuda_PackComm(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	if((sizeof(X_FLOAT)!=sizeof(double)) && m)
-	  m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
-	return m;
+          return AtomVecAngle::pack_comm(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_CommCuda_PackComm(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+        if((sizeof(X_FLOAT)!=sizeof(double)) && m)
+          m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
+        return m;
 }
 
 int AtomVecAngleCuda::pack_comm_vel(int n, int* iswap, double *buf,
-			     int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
+                             int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecAngle::pack_comm_vel(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_CommCuda_PackCommVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	if((sizeof(X_FLOAT)!=sizeof(double)) && m)
-	  m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
-	return m;
+          return AtomVecAngle::pack_comm_vel(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_CommCuda_PackCommVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+        if((sizeof(X_FLOAT)!=sizeof(double)) && m)
+          m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
@@ -169,7 +169,7 @@ int AtomVecAngleCuda::pack_comm_vel(int n, int* iswap, double *buf,
 void AtomVecAngleCuda::unpack_comm(int n, int first, double *buf) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecAngle::unpack_comm(n,first,buf); return;}
+           {AtomVecAngle::unpack_comm(n,first,buf); return;}
 
   Cuda_CommCuda_UnpackComm(&cuda->shared_data,n,first,(void*)buf);
 }
@@ -177,7 +177,7 @@ void AtomVecAngleCuda::unpack_comm(int n, int first, double *buf) //usually this
 void AtomVecAngleCuda::unpack_comm_vel(int n, int first, double *buf) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecAngle::unpack_comm_vel(n,first,buf); return;}
+           {AtomVecAngle::unpack_comm_vel(n,first,buf); return;}
 
   Cuda_CommCuda_UnpackCommVel(&cuda->shared_data,n,first,(void*)buf);
 }
@@ -187,7 +187,7 @@ void AtomVecAngleCuda::unpack_comm_vel(int n, int first, double *buf) //usually
 int AtomVecAngleCuda::pack_reverse(int n, int first, double *buf) //usually this should not be called since comm->communicate handles the communication if only forces are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecAngle::pack_reverse(n,first,buf);
+          return AtomVecAngle::pack_reverse(n,first,buf);
 
   int i,m,last;
   cuda->cu_f->download();
@@ -207,7 +207,7 @@ int AtomVecAngleCuda::pack_reverse(int n, int first, double *buf) //usually this
 void AtomVecAngleCuda::unpack_reverse(int n, int *list, double *buf)//usually this should not be called since comm->communicate handles the communication if only forces are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	{AtomVecAngle::unpack_reverse(n,list,buf); return;}
+          {AtomVecAngle::unpack_reverse(n,list,buf); return;}
 
   int i,j,m;
 
@@ -225,23 +225,23 @@ void AtomVecAngleCuda::unpack_reverse(int n, int *list, double *buf)//usually th
 /* ---------------------------------------------------------------------- */
 
 int AtomVecAngleCuda::pack_border(int n, int *iswap, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
  if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecAngle::pack_border(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_AtomVecAngleCuda_PackBorder(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+          return AtomVecAngle::pack_border(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_AtomVecAngleCuda_PackBorder(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
   return m;
 }
 
 int AtomVecAngleCuda::pack_border_vel(int n, int *iswap, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
  if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecAngle::pack_border_vel(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_AtomVecAngleCuda_PackBorderVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	
+          return AtomVecAngle::pack_border_vel(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_AtomVecAngleCuda_PackBorderVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+
   return m;
 }
 
@@ -250,10 +250,10 @@ int AtomVecAngleCuda::pack_border_vel(int n, int *iswap, double *buf,
 void AtomVecAngleCuda::unpack_border(int n, int first, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecAngle::unpack_border(n,first,buf); return;}
+           {AtomVecAngle::unpack_border(n,first,buf); return;}
   while(atom->nghost+atom->nlocal+n>=cuda->shared_data.atom.nmax) //ensure there is enough space on device to unpack data
   {
-  	grow_both(0);
+          grow_both(0);
   }
   int flag=Cuda_AtomVecAngleCuda_UnpackBorder(&cuda->shared_data,n,first,(void*)buf);
   if(flag) {printf(" # CUDA: Error: Failed to unpack Border atoms (This might be a bug).\n");}
@@ -262,10 +262,10 @@ void AtomVecAngleCuda::unpack_border(int n, int first, double *buf)
 void AtomVecAngleCuda::unpack_border_vel(int n, int first, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecAngle::unpack_border_vel(n,first,buf); return;}
+           {AtomVecAngle::unpack_border_vel(n,first,buf); return;}
   while(atom->nghost+atom->nlocal+n>=cuda->shared_data.atom.nmax) //ensure there is enough space on device to unpack data
   {
-  	grow_both(0);
+          grow_both(0);
   }
   int flag=Cuda_AtomVecAngleCuda_UnpackBorderVel(&cuda->shared_data,n,first,(void*)buf);
   if(flag) {printf(" # CUDA: Error: Failed to unpack Border atoms (This might be a bug).\n");}
@@ -273,67 +273,67 @@ void AtomVecAngleCuda::unpack_border_vel(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 
 int AtomVecAngleCuda::pack_exchange(int dim, double *buf)
 {
   if(cuda->oncpu)
-  	return AtomVecAngle::pack_exchange(dim,buf);
+          return AtomVecAngle::pack_exchange(dim,buf);
 
   if(not cuda_init_done||domain->box_change)
   {
-  	Cuda_AtomVecAngleCuda_Init(&cuda->shared_data);
-  	cuda_init_done=true;
+          Cuda_AtomVecAngleCuda_Init(&cuda->shared_data);
+          cuda_init_done=true;
   }
   double** buf_pointer=(double**) buf;
   if(*maxsend<atom->nghost || *buf_pointer==NULL)
   {
-  	grow_send(atom->nghost>*maxsend?atom->nghost:*maxsend,buf_pointer,0);
-  	*maxsend=atom->nghost>*maxsend?atom->nghost:*maxsend;
+          grow_send(atom->nghost>*maxsend?atom->nghost:*maxsend,buf_pointer,0);
+          *maxsend=atom->nghost>*maxsend?atom->nghost:*maxsend;
   }
-  
+
   if(max_nsend==0) grow_copylist(200);
 
   int nsend_atoms = Cuda_AtomVecAngleCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
-  
+
   if(nsend_atoms>max_nsend) grow_copylist(nsend_atoms+100);
-  if(nsend_atoms*NCUDAEXCHANGE>*maxsend) 
+  if(nsend_atoms*NCUDAEXCHANGE>*maxsend)
   {
-  	grow_send((int) (nsend_atoms+100)*NCUDAEXCHANGE,buf_pointer,0);
-  	Cuda_AtomVecAngleCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
+          grow_send((int) (nsend_atoms+100)*NCUDAEXCHANGE,buf_pointer,0);
+          Cuda_AtomVecAngleCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
   }
 
   int nlocal=atom->nlocal-nsend_atoms;
-  
+
   for(int i=0;i<nsend_atoms;i++) copylist2[i]=1;
   for(int j=1;j<nsend_atoms+1;j++)
   {
-  	int i = static_cast <int> ((*buf_pointer)[j]);
-  	if(i>=nlocal) copylist2[i-nlocal]=-1;
+          int i = static_cast <int> ((*buf_pointer)[j]);
+          if(i>=nlocal) copylist2[i-nlocal]=-1;
   }
-  
+
   int actpos=0;
   for(int j=1;j<nsend_atoms+1;j++)
   {
-  	int i = static_cast <int> ((*buf_pointer)[j]);
-  	if(i<nlocal) 
-  	{
-  	  while(copylist2[actpos]==-1) actpos++;
-    	  copylist[j-1]=nlocal+actpos;
-  	  actpos++;
-  	}
+          int i = static_cast <int> ((*buf_pointer)[j]);
+          if(i<nlocal)
+          {
+            while(copylist2[actpos]==-1) actpos++;
+              copylist[j-1]=nlocal+actpos;
+            actpos++;
+          }
   }
   cu_copylist->upload();
-  
+
   cuda->shared_data.atom.nlocal=nlocal;
-  
+
   int m = Cuda_AtomVecAngleCuda_PackExchange(&cuda->shared_data,nsend_atoms,*buf_pointer,cu_copylist->dev_data());
-  
+
   timespec time1,time2;
   clock_gettime(CLOCK_REALTIME,&time1);
- 
+
   double* buf_p=*buf_pointer;
   for(int j=0;j<nsend_atoms;j++)
   {
@@ -364,23 +364,23 @@ int AtomVecAngleCuda::pack_exchange(int dim, double *buf)
     for (k = 0; k < nspecial[i][2]; k++) buf_p[m++] = special[i][k];
     nextra+=nspecial[i][2]+3;
     if(m>*maxsend) {grow_send(m,buf_pointer,1); buf_p=*buf_pointer;}
-  
+
     if (atom->nextra_grow)
-      for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+      for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       {
         int dm= modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf_p[m]);
         m+=dm;
-  		nextra+=dm;
+                  nextra+=dm;
         if(i<nlocal)modify->fix[atom->extra_grow[iextra]]->copy_arrays(copylist[j],i);
-    	if(m>*maxsend) {grow_send(m,buf_pointer,1); buf_p=*buf_pointer;}
+            if(m>*maxsend) {grow_send(m,buf_pointer,1); buf_p=*buf_pointer;}
       }
 
-    if(i<nlocal)AtomVecAngle::copy(copylist[j],i,1);  
+    if(i<nlocal)AtomVecAngle::copy(copylist[j],i,1);
     (*buf_pointer)[j+1] = nextra;
   }
-	  
-	  clock_gettime(CLOCK_REALTIME,&time2);
-	  cuda->shared_data.cuda_timings.comm_exchange_cpu_pack+=
+
+          clock_gettime(CLOCK_REALTIME,&time2);
+          cuda->shared_data.cuda_timings.comm_exchange_cpu_pack+=
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000;
 
   (*buf_pointer)[0] = nsend_atoms;
@@ -397,11 +397,11 @@ int AtomVecAngleCuda::unpack_exchange(double *buf)
 {
 // printf("Begin UnPack Exchange\n");
   if(cuda->oncpu)
-  	return AtomVecAngle::unpack_exchange(buf);
-  
+          return AtomVecAngle::unpack_exchange(buf);
+
   double *sublo,*subhi;
   int dim=cuda->shared_data.exchange_dim;
-  if(domain->box_change) 
+  if(domain->box_change)
   Cuda_AtomVecAngleCuda_Init(&cuda->shared_data);
   if (domain->triclinic == 0) {
     sublo = domain->sublo;
@@ -417,7 +417,7 @@ int AtomVecAngleCuda::unpack_exchange(double *buf)
   int nlocal = atom->nlocal;
   int nsend_atoms=static_cast<int> (buf[0]);
   if(nsend_atoms>max_nsend) grow_copylist(nsend_atoms+100);
- 
+
   if (nlocal+nsend_atoms+atom->nghost>=atom->nmax) grow_both(nlocal+nsend_atoms*2+atom->nghost); //ensure there is enough space on device to unpack data
   int naccept = Cuda_AtomVecAngleCuda_UnpackExchange(&cuda->shared_data,nsend_atoms,buf,cu_copylist->dev_data());
   cu_copylist->download();
@@ -431,40 +431,40 @@ int AtomVecAngleCuda::unpack_exchange(double *buf)
   {
     if(copylist[j]>-1)
     {
- 	  int k;
-	  int i=copylist[j];
+           int k;
+          int i=copylist[j];
       num_bond[i] = static_cast<int> (buf[m++]);
       for (k = 0; k < num_bond[i]; k++) {
-    	bond_type[i][k] = static_cast<int> (buf[m++]);
-    	bond_atom[i][k] = static_cast<int> (buf[m++]);
-  	  }
-
-  	  num_angle[i] = static_cast<int> (buf[m++]);
-  	  for (k = 0; k < num_angle[i]; k++) {
-    	angle_type[i][k] = static_cast<int> (buf[m++]);
-    	angle_atom1[i][k] = static_cast<int> (buf[m++]);
-    	angle_atom2[i][k] = static_cast<int> (buf[m++]);
-    	angle_atom3[i][k] = static_cast<int> (buf[m++]);
-  	  }
-
-  	  nspecial[i][0] = static_cast<int> (buf[m++]);
-  	  nspecial[i][1] = static_cast<int> (buf[m++]);
-  	  nspecial[i][2] = static_cast<int> (buf[m++]);
-  	  for (k = 0; k < nspecial[i][2]; k++)
-    	special[i][k] = static_cast<int> (buf[m++]);
-    	
-  	  if (atom->nextra_grow)
-        for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
-      				m += modify->fix[atom->extra_grow[iextra]]->
-					unpack_exchange(i,&buf[m]);
-    	
+            bond_type[i][k] = static_cast<int> (buf[m++]);
+            bond_atom[i][k] = static_cast<int> (buf[m++]);
+            }
+
+            num_angle[i] = static_cast<int> (buf[m++]);
+            for (k = 0; k < num_angle[i]; k++) {
+            angle_type[i][k] = static_cast<int> (buf[m++]);
+            angle_atom1[i][k] = static_cast<int> (buf[m++]);
+            angle_atom2[i][k] = static_cast<int> (buf[m++]);
+            angle_atom3[i][k] = static_cast<int> (buf[m++]);
+            }
+
+            nspecial[i][0] = static_cast<int> (buf[m++]);
+            nspecial[i][1] = static_cast<int> (buf[m++]);
+            nspecial[i][2] = static_cast<int> (buf[m++]);
+            for (k = 0; k < nspecial[i][2]; k++)
+            special[i][k] = static_cast<int> (buf[m++]);
+
+            if (atom->nextra_grow)
+        for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
+                                      m += modify->fix[atom->extra_grow[iextra]]->
+                                        unpack_exchange(i,&buf[m]);
+
     }
-    else 
+    else
     m+=static_cast <int> (buf[j+1]);
   }
-	  
-	  clock_gettime(CLOCK_REALTIME,&time2);
-	  cuda->shared_data.cuda_timings.comm_exchange_cpu_pack+=
+
+          clock_gettime(CLOCK_REALTIME,&time2);
+          cuda->shared_data.cuda_timings.comm_exchange_cpu_pack+=
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000;
 
   cuda->shared_data.atom.nlocal=nlocal;
@@ -475,6 +475,3 @@ int AtomVecAngleCuda::unpack_exchange(double *buf)
   }
   return mfirst;
 }
-
-
-
diff --git a/src/USER-CUDA/atom_vec_angle_cuda.h b/src/USER-CUDA/atom_vec_angle_cuda.h
index 0687058aca..1c2956e837 100644
--- a/src/USER-CUDA/atom_vec_angle_cuda.h
+++ b/src/USER-CUDA/atom_vec_angle_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/atom_vec_atomic_cuda.cpp b/src/USER-CUDA/atom_vec_atomic_cuda.cpp
index f6b2d76b85..51ce230b8c 100644
--- a/src/USER-CUDA/atom_vec_atomic_cuda.cpp
+++ b/src/USER-CUDA/atom_vec_atomic_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -100,13 +100,13 @@ void AtomVecAtomicCuda::grow_send(int n,double** buf_send,int flag)
       if(*buf_send) CudaWrapper_FreePinnedHostData((void*) (*buf_send));
       *buf_send = (double*) CudaWrapper_AllocPinnedHostData((*maxsend+BUFEXTRA)*sizeof(double),false);
       memcpy(*buf_send,tmp,old_maxsend*sizeof(double));
-      delete [] tmp;	        	
+      delete [] tmp;
     }
     else
     {
-     *buf_send = (double *) 
+     *buf_send = (double *)
       memory->srealloc(*buf_send,(*maxsend+BUFEXTRA)*sizeof(double),
-		       "comm:buf_send");
+                       "comm:buf_send");
     }
   }
   else {
@@ -119,7 +119,7 @@ void AtomVecAtomicCuda::grow_send(int n,double** buf_send,int flag)
     {
       memory->sfree(*buf_send);
       *buf_send = (double *) memory->smalloc((*maxsend+BUFEXTRA)*sizeof(double),
-					  "comm:buf_send");
+                                          "comm:buf_send");
     }
   }
 }
@@ -127,7 +127,7 @@ void AtomVecAtomicCuda::grow_send(int n,double** buf_send,int flag)
 void AtomVecAtomicCuda::grow_both(int n)
 {
   if(cuda->finished_setup)
-  cuda->downloadAll();	
+  cuda->downloadAll();
   AtomVecAtomic::grow(n);
   if(cuda->finished_setup)
   {
@@ -137,34 +137,34 @@ void AtomVecAtomicCuda::grow_both(int n)
 }
 
 int AtomVecAtomicCuda::pack_comm(int n, int* iswap, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecAtomic::pack_comm(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_CommCuda_PackComm(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	if((sizeof(X_FLOAT)!=sizeof(double)) && m)
-	  m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
-	return m;
+          return AtomVecAtomic::pack_comm(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_CommCuda_PackComm(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+        if((sizeof(X_FLOAT)!=sizeof(double)) && m)
+          m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
+        return m;
 }
 
 int AtomVecAtomicCuda::pack_comm_vel(int n, int* iswap, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecAtomic::pack_comm_vel(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_CommCuda_PackCommVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	if((sizeof(X_FLOAT)!=sizeof(double)) && m)
-	  m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
-	return m;
+          return AtomVecAtomic::pack_comm_vel(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_CommCuda_PackCommVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+        if((sizeof(X_FLOAT)!=sizeof(double)) && m)
+          m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
+        return m;
 }
 /* ---------------------------------------------------------------------- */
 
 void AtomVecAtomicCuda::unpack_comm(int n, int first, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecAtomic::unpack_comm(n,first,buf); return;}
+           {AtomVecAtomic::unpack_comm(n,first,buf); return;}
 
   Cuda_CommCuda_UnpackComm(&cuda->shared_data,n,first,(void*)buf);
 }
@@ -172,7 +172,7 @@ void AtomVecAtomicCuda::unpack_comm(int n, int first, double *buf)
 void AtomVecAtomicCuda::unpack_comm_vel(int n, int first, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecAtomic::unpack_comm_vel(n,first,buf); return;}
+           {AtomVecAtomic::unpack_comm_vel(n,first,buf); return;}
 
   Cuda_CommCuda_UnpackCommVel(&cuda->shared_data,n,first,(void*)buf);
 }
@@ -181,7 +181,7 @@ void AtomVecAtomicCuda::unpack_comm_vel(int n, int first, double *buf)
 int AtomVecAtomicCuda::pack_reverse(int n, int first, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecAtomic::pack_reverse(n,first,buf);
+          return AtomVecAtomic::pack_reverse(n,first,buf);
 
   int i,m,last;
 
@@ -200,7 +200,7 @@ int AtomVecAtomicCuda::pack_reverse(int n, int first, double *buf)
 void AtomVecAtomicCuda::unpack_reverse(int n, int *list, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	{AtomVecAtomic::unpack_reverse(n,list,buf); return;}
+          {AtomVecAtomic::unpack_reverse(n,list,buf); return;}
 
   int i,j,m;
 
@@ -216,22 +216,22 @@ void AtomVecAtomicCuda::unpack_reverse(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecAtomicCuda::pack_border(int n, int *iswap, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecAtomic::pack_border(n,iswap,buf,pbc_flag,pbc);
-  
+          return AtomVecAtomic::pack_border(n,iswap,buf,pbc_flag,pbc);
+
   int m = Cuda_AtomVecAtomicCuda_PackBorder(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
 
   return m;
 }
 
 int AtomVecAtomicCuda::pack_border_vel(int n, int *iswap, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecAtomic::pack_border_vel(n,iswap,buf,pbc_flag,pbc);
-  
+          return AtomVecAtomic::pack_border_vel(n,iswap,buf,pbc_flag,pbc);
+
   int m = Cuda_AtomVecAtomicCuda_PackBorderVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
 
   return m;
@@ -241,10 +241,10 @@ int AtomVecAtomicCuda::pack_border_vel(int n, int *iswap, double *buf,
 void AtomVecAtomicCuda::unpack_border(int n, int first, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecAtomic::unpack_border(n,first,buf); return;}
-  while(atom->nghost+atom->nlocal+n>=cuda->shared_data.atom.nmax) 
+           {AtomVecAtomic::unpack_border(n,first,buf); return;}
+  while(atom->nghost+atom->nlocal+n>=cuda->shared_data.atom.nmax)
   {
-  	grow_both(0);
+          grow_both(0);
   }
   int flag=Cuda_AtomVecAtomicCuda_UnpackBorder(&cuda->shared_data,n,first,(void*)buf);
   if(flag) {printf(" # CUDA: Error: Failed to unpack Border atoms (This might be a bug).\n");}
@@ -254,72 +254,72 @@ void AtomVecAtomicCuda::unpack_border(int n, int first, double *buf)
 void AtomVecAtomicCuda::unpack_border_vel(int n, int first, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecAtomic::unpack_border_vel(n,first,buf); return;}
-  while(atom->nghost+atom->nlocal+n>=cuda->shared_data.atom.nmax) 
+           {AtomVecAtomic::unpack_border_vel(n,first,buf); return;}
+  while(atom->nghost+atom->nlocal+n>=cuda->shared_data.atom.nmax)
   {
-  	grow_both(0);
+          grow_both(0);
   }
   int flag=Cuda_AtomVecAtomicCuda_UnpackBorderVel(&cuda->shared_data,n,first,(void*)buf);
   if(flag) {printf(" # CUDA: Error: Failed to unpack Border atoms (This might be a bug).\n");}
 }
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 
 int AtomVecAtomicCuda::pack_exchange(int dim, double *buf)
 {
   if(cuda->oncpu)
-  	return AtomVecAtomic::pack_exchange(dim,buf);
+          return AtomVecAtomic::pack_exchange(dim,buf);
 
   if(not cuda_init_done||domain->box_change)
   {
-  	Cuda_AtomVecAtomicCuda_Init(&cuda->shared_data);
-  	cuda_init_done=true;
+          Cuda_AtomVecAtomicCuda_Init(&cuda->shared_data);
+          cuda_init_done=true;
   }
   double** buf_pointer=(double**) buf;
   if(*maxsend<atom->nghost || *buf_pointer==NULL)
   {
-  	grow_send(atom->nghost>*maxsend?atom->nghost:*maxsend,buf_pointer,0);
-  	*maxsend=atom->nghost>*maxsend?atom->nghost:*maxsend;
+          grow_send(atom->nghost>*maxsend?atom->nghost:*maxsend,buf_pointer,0);
+          *maxsend=atom->nghost>*maxsend?atom->nghost:*maxsend;
   }
-  
+
   if(max_nsend==0) grow_copylist(200);
 
   int nsend_atoms = Cuda_AtomVecAtomicCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
-  
+
   if(nsend_atoms>max_nsend) {grow_copylist(nsend_atoms+100);}
-  if(nsend_atoms*NCUDAEXCHANGE>*maxsend) 
+  if(nsend_atoms*NCUDAEXCHANGE>*maxsend)
   {
-  	grow_send((int) (nsend_atoms+100)*NCUDAEXCHANGE,buf_pointer,0);
-   	Cuda_AtomVecAtomicCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
+          grow_send((int) (nsend_atoms+100)*NCUDAEXCHANGE,buf_pointer,0);
+           Cuda_AtomVecAtomicCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
   }
-  
+
   int nlocal=atom->nlocal-nsend_atoms;
-  
+
   for(int i=0;i<nsend_atoms;i++) copylist2[i]=1;
   for(int j=1;j<nsend_atoms+1;j++)
   {
-  	int i = static_cast <int> ((*buf_pointer)[j]);
-  	if(i>=nlocal) copylist2[i-nlocal]=-1;
+          int i = static_cast <int> ((*buf_pointer)[j]);
+          if(i>=nlocal) copylist2[i-nlocal]=-1;
   }
-  
+
   int actpos=0;
   for(int j=1;j<nsend_atoms+1;j++)
   {
-  	int i = static_cast <int> ((*buf_pointer)[j]);
-  	if(i<nlocal) 
-  	{
-  	  while(copylist2[actpos]==-1) actpos++;
-    	  copylist[j-1]=nlocal+actpos;
-  	  actpos++;
-  	}
+          int i = static_cast <int> ((*buf_pointer)[j]);
+          if(i<nlocal)
+          {
+            while(copylist2[actpos]==-1) actpos++;
+              copylist[j-1]=nlocal+actpos;
+            actpos++;
+          }
   }
   cu_copylist->upload();
-  
+
   cuda->shared_data.atom.nlocal=nlocal;
-  
+
   int m = Cuda_AtomVecAtomicCuda_PackExchange(&cuda->shared_data,nsend_atoms,*buf_pointer,cu_copylist->dev_data());
   if (atom->nextra_grow)
   for(int j=0;j<nsend_atoms;j++)
@@ -327,15 +327,15 @@ int AtomVecAtomicCuda::pack_exchange(int dim, double *buf)
       int i=static_cast <int> ((*buf_pointer)[j+1]);
       int nextra=0;
       for (int iextra = 0; iextra < atom->nextra_grow; iextra++) {
-      	
+
         int dm = modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&((*buf_pointer)[m]));
         m+=dm;
-  		nextra+=dm;
+                  nextra+=dm;
         if(i<nlocal)modify->fix[atom->extra_grow[iextra]]->copy_arrays(copylist[j],i);
         if(m>*maxsend)  grow_send(m,buf_pointer,1);
       }
       (*buf_pointer)[j+1] = nextra;
-      
+
   }
 
   (*buf_pointer)[0] = nsend_atoms;
@@ -352,12 +352,12 @@ int AtomVecAtomicCuda::unpack_exchange(double *buf)
 {
   //printf("Unpack Begin\n");
   if(cuda->oncpu)
-  	return AtomVecAtomic::unpack_exchange(buf);
+          return AtomVecAtomic::unpack_exchange(buf);
 
   double *sublo,*subhi;
 
   int dim=cuda->shared_data.exchange_dim;
-  if(domain->box_change) 
+  if(domain->box_change)
   Cuda_AtomVecAtomicCuda_Init(&cuda->shared_data);
   if (domain->triclinic == 0) {
     sublo = domain->sublo;
@@ -371,10 +371,10 @@ int AtomVecAtomicCuda::unpack_exchange(double *buf)
   for(int pi=0;pi<(comm->procgrid[dim]>2?2:1);pi++)
   {
   int nlocal = atom->nlocal;
-  
+
   int nsend_atoms=static_cast<int> (buf[0]);
   if(nsend_atoms>max_nsend) grow_copylist(nsend_atoms+100);
- 
+
   if (nlocal+nsend_atoms+atom->nghost>=atom->nmax) grow_both(nlocal+nsend_atoms*2+atom->nghost);
   int naccept = Cuda_AtomVecAtomicCuda_UnpackExchange(&cuda->shared_data,nsend_atoms,buf,cu_copylist->dev_data());
   cu_copylist->download();
@@ -385,9 +385,9 @@ int AtomVecAtomicCuda::unpack_exchange(double *buf)
   {
     if(copylist[j]>-1)
     {
-    		for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
-      				m += modify->fix[atom->extra_grow[iextra]]->
-					unpack_exchange(copylist[j],&buf[m]);
+                    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
+                                      m += modify->fix[atom->extra_grow[iextra]]->
+                                        unpack_exchange(copylist[j],&buf[m]);
     }
     else
     {
@@ -403,6 +403,3 @@ int AtomVecAtomicCuda::unpack_exchange(double *buf)
   }
   return mfirst;
 }
-
-
-
diff --git a/src/USER-CUDA/atom_vec_atomic_cuda.h b/src/USER-CUDA/atom_vec_atomic_cuda.h
index da6dfb4d3a..17b803d8ad 100644
--- a/src/USER-CUDA/atom_vec_atomic_cuda.h
+++ b/src/USER-CUDA/atom_vec_atomic_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CUDA/atom_vec_charge_cuda.cpp b/src/USER-CUDA/atom_vec_charge_cuda.cpp
index a15836c45b..991038debb 100644
--- a/src/USER-CUDA/atom_vec_charge_cuda.cpp
+++ b/src/USER-CUDA/atom_vec_charge_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -99,13 +99,13 @@ void AtomVecChargeCuda::grow_send(int n,double** buf_send,int flag)  //need to b
       if(*buf_send) CudaWrapper_FreePinnedHostData((void*) (*buf_send));
       *buf_send = (double*) CudaWrapper_AllocPinnedHostData((*maxsend+BUFEXTRA)*sizeof(double),false);
       memcpy(*buf_send,tmp,old_maxsend*sizeof(double));
-      delete [] tmp;	        	
+      delete [] tmp;
     }
     else
     {
-     *buf_send = (double *) 
+     *buf_send = (double *)
       memory->srealloc(*buf_send,(*maxsend+BUFEXTRA)*sizeof(double),
-		       "comm:buf_send");
+                       "comm:buf_send");
     }
   }
   else {
@@ -118,7 +118,7 @@ void AtomVecChargeCuda::grow_send(int n,double** buf_send,int flag)  //need to b
     {
       memory->sfree(*buf_send);
       *buf_send = (double *) memory->smalloc((*maxsend+BUFEXTRA)*sizeof(double),
-					  "comm:buf_send");
+                                          "comm:buf_send");
     }
   }
 }
@@ -126,7 +126,7 @@ void AtomVecChargeCuda::grow_send(int n,double** buf_send,int flag)  //need to b
 void AtomVecChargeCuda::grow_both(int n)
 {
   if(cuda->finished_setup)
-  cuda->downloadAll();	
+  cuda->downloadAll();
   AtomVecCharge::grow(n);
   if(cuda->finished_setup)
   {
@@ -136,27 +136,27 @@ void AtomVecChargeCuda::grow_both(int n)
 }
 
 int AtomVecChargeCuda::pack_comm(int n, int* iswap, double *buf,
-			     int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
+                             int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecCharge::pack_comm(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_CommCuda_PackComm(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	if((sizeof(X_FLOAT)!=sizeof(double)) && m)
-	  m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
-	return m;
+          return AtomVecCharge::pack_comm(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_CommCuda_PackComm(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+        if((sizeof(X_FLOAT)!=sizeof(double)) && m)
+          m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
+        return m;
 }
 
 int AtomVecChargeCuda::pack_comm_vel(int n, int* iswap, double *buf,
-			     int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
+                             int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecCharge::pack_comm_vel(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_CommCuda_PackCommVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	if((sizeof(X_FLOAT)!=sizeof(double)) && m)
-	  m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
-	return m;
+          return AtomVecCharge::pack_comm_vel(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_CommCuda_PackCommVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+        if((sizeof(X_FLOAT)!=sizeof(double)) && m)
+          m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
@@ -164,7 +164,7 @@ int AtomVecChargeCuda::pack_comm_vel(int n, int* iswap, double *buf,
 void AtomVecChargeCuda::unpack_comm(int n, int first, double *buf) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecCharge::unpack_comm(n,first,buf); return;}
+           {AtomVecCharge::unpack_comm(n,first,buf); return;}
 
   Cuda_CommCuda_UnpackComm(&cuda->shared_data,n,first,(void*)buf);
 }
@@ -172,7 +172,7 @@ void AtomVecChargeCuda::unpack_comm(int n, int first, double *buf) //usually thi
 void AtomVecChargeCuda::unpack_comm_vel(int n, int first, double *buf) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecCharge::unpack_comm_vel(n,first,buf); return;}
+           {AtomVecCharge::unpack_comm_vel(n,first,buf); return;}
 
   Cuda_CommCuda_UnpackCommVel(&cuda->shared_data,n,first,(void*)buf);
 }
@@ -182,7 +182,7 @@ void AtomVecChargeCuda::unpack_comm_vel(int n, int first, double *buf) //usually
 int AtomVecChargeCuda::pack_reverse(int n, int first, double *buf) //usually this should not be called since comm->communicate handles the communication if only forces are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecCharge::pack_reverse(n,first,buf);
+          return AtomVecCharge::pack_reverse(n,first,buf);
 
   int i,m,last;
   cuda->cu_f->download();
@@ -202,7 +202,7 @@ int AtomVecChargeCuda::pack_reverse(int n, int first, double *buf) //usually thi
 void AtomVecChargeCuda::unpack_reverse(int n, int *list, double *buf)//usually this should not be called since comm->communicate handles the communication if only forces are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	{AtomVecCharge::unpack_reverse(n,list,buf); return;}
+          {AtomVecCharge::unpack_reverse(n,list,buf); return;}
 
   int i,j,m;
 
@@ -220,24 +220,24 @@ void AtomVecChargeCuda::unpack_reverse(int n, int *list, double *buf)//usually t
 /* ---------------------------------------------------------------------- */
 
 int AtomVecChargeCuda::pack_border(int n, int *iswap, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
  if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecCharge::pack_border(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_AtomVecChargeCuda_PackBorder(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	
+          return AtomVecCharge::pack_border(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_AtomVecChargeCuda_PackBorder(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+
   return m;
 }
 
 int AtomVecChargeCuda::pack_border_vel(int n, int *iswap, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
  if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecCharge::pack_border_vel(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_AtomVecChargeCuda_PackBorderVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	
+          return AtomVecCharge::pack_border_vel(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_AtomVecChargeCuda_PackBorderVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+
   return m;
 }
 
@@ -246,10 +246,10 @@ int AtomVecChargeCuda::pack_border_vel(int n, int *iswap, double *buf,
 void AtomVecChargeCuda::unpack_border(int n, int first, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecCharge::unpack_border(n,first,buf); return;}
+           {AtomVecCharge::unpack_border(n,first,buf); return;}
   while(atom->nghost+atom->nlocal+n>=cuda->shared_data.atom.nmax) //ensure there is enough space on device to unpack data
   {
-  	grow_both(0);
+          grow_both(0);
   }
   int flag=Cuda_AtomVecChargeCuda_UnpackBorder(&cuda->shared_data,n,first,(void*)buf);
   if(flag) {printf(" # CUDA: Error: Failed to unpack Border atoms (This might be a bug).\n");}
@@ -258,10 +258,10 @@ void AtomVecChargeCuda::unpack_border(int n, int first, double *buf)
 void AtomVecChargeCuda::unpack_border_vel(int n, int first, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecCharge::unpack_border_vel(n,first,buf); return;}
+           {AtomVecCharge::unpack_border_vel(n,first,buf); return;}
   while(atom->nghost+atom->nlocal+n>=cuda->shared_data.atom.nmax) //ensure there is enough space on device to unpack data
   {
-  	grow_both(0);
+          grow_both(0);
   }
   int flag=Cuda_AtomVecChargeCuda_UnpackBorderVel(&cuda->shared_data,n,first,(void*)buf);
   if(flag) {printf(" # CUDA: Error: Failed to unpack Border atoms (This might be a bug).\n");}
@@ -269,74 +269,74 @@ void AtomVecChargeCuda::unpack_border_vel(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 
 int AtomVecChargeCuda::pack_exchange(int dim, double *buf)
 {
   if(cuda->oncpu)
-  	return AtomVecCharge::pack_exchange(dim,buf);
+          return AtomVecCharge::pack_exchange(dim,buf);
 
   if(not cuda_init_done||domain->box_change)
   {
-  	Cuda_AtomVecChargeCuda_Init(&cuda->shared_data);
-  	cuda_init_done=true;
+          Cuda_AtomVecChargeCuda_Init(&cuda->shared_data);
+          cuda_init_done=true;
   }
   double** buf_pointer=(double**) buf;
   if(*maxsend<atom->nghost || *buf_pointer==NULL)
   {
-  	grow_send(atom->nghost>*maxsend?atom->nghost:*maxsend,buf_pointer,0);
-  	*maxsend=atom->nghost>*maxsend?atom->nghost:*maxsend;
+          grow_send(atom->nghost>*maxsend?atom->nghost:*maxsend,buf_pointer,0);
+          *maxsend=atom->nghost>*maxsend?atom->nghost:*maxsend;
   }
-  
+
   if(max_nsend==0) grow_copylist(200);
 
   int nsend_atoms = Cuda_AtomVecChargeCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
-  
+
   if(nsend_atoms>max_nsend) grow_copylist(nsend_atoms+100);
-  if(nsend_atoms*NCUDAEXCHANGE>*maxsend) 
+  if(nsend_atoms*NCUDAEXCHANGE>*maxsend)
   {
-  	grow_send((int) (nsend_atoms+100)*NCUDAEXCHANGE,buf_pointer,0);
-  	Cuda_AtomVecChargeCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
+          grow_send((int) (nsend_atoms+100)*NCUDAEXCHANGE,buf_pointer,0);
+          Cuda_AtomVecChargeCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
   }
-  
+
   int nlocal=atom->nlocal-nsend_atoms;
-  
+
   for(int i=0;i<nsend_atoms;i++) copylist2[i]=1;
   for(int j=1;j<nsend_atoms+1;j++)
   {
-  	int i = static_cast <int> ((*buf_pointer)[j]);
-  	if(i>=nlocal) copylist2[i-nlocal]=-1;
+          int i = static_cast <int> ((*buf_pointer)[j]);
+          if(i>=nlocal) copylist2[i-nlocal]=-1;
   }
-  
+
   int actpos=0;
   for(int j=1;j<nsend_atoms+1;j++)
   {
-  	int i = static_cast <int> ((*buf_pointer)[j]);
-  	if(i<nlocal) 
-  	{
-  	  while(copylist2[actpos]==-1) actpos++;
-    	  copylist[j-1]=nlocal+actpos;
-  	  actpos++;
-  	}
+          int i = static_cast <int> ((*buf_pointer)[j]);
+          if(i<nlocal)
+          {
+            while(copylist2[actpos]==-1) actpos++;
+              copylist[j-1]=nlocal+actpos;
+            actpos++;
+          }
   }
   cu_copylist->upload();
-    
+
   cuda->shared_data.atom.nlocal=nlocal;
-  
+
   int m = Cuda_AtomVecChargeCuda_PackExchange(&cuda->shared_data,nsend_atoms,*buf_pointer,cu_copylist->dev_data());
-  
+
   if (atom->nextra_grow)
   for(int j=0;j<nsend_atoms;j++)
   {
       int i=static_cast <int> ((*buf_pointer)[j+1]);
       int nextra=0;
       for (int iextra = 0; iextra < atom->nextra_grow; iextra++) {
-      	
+
         int dm = modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&((*buf_pointer)[m]));
         m+=dm;
-  		nextra+=dm;
+                  nextra+=dm;
         if(i<nlocal)modify->fix[atom->extra_grow[iextra]]->copy_arrays(copylist[j],i);
         if(m>*maxsend)  grow_send(m,buf_pointer,1);
       }
@@ -356,11 +356,11 @@ int AtomVecChargeCuda::pack_exchange(int dim, double *buf)
 int AtomVecChargeCuda::unpack_exchange(double *buf)
 {
   if(cuda->oncpu)
-  	return AtomVecCharge::unpack_exchange(buf);
+          return AtomVecCharge::unpack_exchange(buf);
   double *sublo,*subhi;
 
   int dim=cuda->shared_data.exchange_dim;
-  if(domain->box_change) 
+  if(domain->box_change)
   Cuda_AtomVecChargeCuda_Init(&cuda->shared_data);
   if (domain->triclinic == 0) {
     sublo = domain->sublo;
@@ -376,7 +376,7 @@ int AtomVecChargeCuda::unpack_exchange(double *buf)
   int nlocal = atom->nlocal;
   int nsend_atoms=static_cast<int> (buf[0]);
   if(nsend_atoms>max_nsend) grow_copylist(nsend_atoms+100);
- 
+
   if (nlocal+nsend_atoms+atom->nghost>=atom->nmax) grow_both(nlocal+nsend_atoms*2+atom->nghost);
   int naccept = Cuda_AtomVecChargeCuda_UnpackExchange(&cuda->shared_data,nsend_atoms,buf,cu_copylist->dev_data());
   cu_copylist->download();
@@ -387,9 +387,9 @@ int AtomVecChargeCuda::unpack_exchange(double *buf)
   {
     if(copylist[j]>-1)
     {
-    		for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
-      				m += modify->fix[atom->extra_grow[iextra]]->
-					unpack_exchange(copylist[j],&buf[m]);
+                    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
+                                      m += modify->fix[atom->extra_grow[iextra]]->
+                                        unpack_exchange(copylist[j],&buf[m]);
     }
     else
     m+=static_cast <int> (buf[j+1]);
@@ -402,6 +402,3 @@ int AtomVecChargeCuda::unpack_exchange(double *buf)
   }
   return mfirst;
 }
-
-
-
diff --git a/src/USER-CUDA/atom_vec_charge_cuda.h b/src/USER-CUDA/atom_vec_charge_cuda.h
index 924dd55c85..ba7b57e75f 100644
--- a/src/USER-CUDA/atom_vec_charge_cuda.h
+++ b/src/USER-CUDA/atom_vec_charge_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/atom_vec_full_cuda.cpp b/src/USER-CUDA/atom_vec_full_cuda.cpp
index 9816a7c5c9..ce56c719cc 100644
--- a/src/USER-CUDA/atom_vec_full_cuda.cpp
+++ b/src/USER-CUDA/atom_vec_full_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -100,13 +100,13 @@ void AtomVecFullCuda::grow_send(int n,double** buf_send,int flag)  //need to be
       if(*buf_send) CudaWrapper_FreePinnedHostData((void*) (*buf_send));
       *buf_send = (double*) CudaWrapper_AllocPinnedHostData((*maxsend+BUFEXTRA)*sizeof(double),false);
       memcpy(*buf_send,tmp,old_maxsend*sizeof(double));
-      delete [] tmp;	        	
+      delete [] tmp;
     }
     else
     {
-     *buf_send = (double *) 
+     *buf_send = (double *)
       memory->srealloc(*buf_send,(*maxsend+BUFEXTRA)*sizeof(double),
-		       "comm:buf_send");
+                       "comm:buf_send");
     }
   }
   else {
@@ -119,7 +119,7 @@ void AtomVecFullCuda::grow_send(int n,double** buf_send,int flag)  //need to be
     {
       memory->sfree(*buf_send);
       *buf_send = (double *) memory->smalloc((*maxsend+BUFEXTRA)*sizeof(double),
-					  "comm:buf_send");
+                                          "comm:buf_send");
     }
   }
 }
@@ -141,27 +141,27 @@ void AtomVecFullCuda::grow_both(int n)
 }
 
 int AtomVecFullCuda::pack_comm(int n, int* iswap, double *buf,
-			     int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
+                             int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecFull::pack_comm(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_CommCuda_PackComm(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	if((sizeof(X_FLOAT)!=sizeof(double)) && m)
-	  m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
-	return m;
+          return AtomVecFull::pack_comm(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_CommCuda_PackComm(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+        if((sizeof(X_FLOAT)!=sizeof(double)) && m)
+          m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
+        return m;
 }
 
 int AtomVecFullCuda::pack_comm_vel(int n, int* iswap, double *buf,
-			     int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
+                             int pbc_flag, int *pbc) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecFull::pack_comm_vel(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_CommCuda_PackCommVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	if((sizeof(X_FLOAT)!=sizeof(double)) && m)
-	  m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
-	return m;
+          return AtomVecFull::pack_comm_vel(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_CommCuda_PackCommVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+        if((sizeof(X_FLOAT)!=sizeof(double)) && m)
+          m=(m+1)*sizeof(X_FLOAT)/sizeof(double);
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
@@ -169,7 +169,7 @@ int AtomVecFullCuda::pack_comm_vel(int n, int* iswap, double *buf,
 void AtomVecFullCuda::unpack_comm(int n, int first, double *buf) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecFull::unpack_comm(n,first,buf); return;}
+           {AtomVecFull::unpack_comm(n,first,buf); return;}
 
   Cuda_CommCuda_UnpackComm(&cuda->shared_data,n,first,(void*)buf);
 }
@@ -177,7 +177,7 @@ void AtomVecFullCuda::unpack_comm(int n, int first, double *buf) //usually this
 void AtomVecFullCuda::unpack_comm_vel(int n, int first, double *buf) //usually this should not be called since comm->communicate handles the communication if only positions are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecFull::unpack_comm_vel(n,first,buf); return;}
+           {AtomVecFull::unpack_comm_vel(n,first,buf); return;}
 
   Cuda_CommCuda_UnpackCommVel(&cuda->shared_data,n,first,(void*)buf);
 }
@@ -187,7 +187,7 @@ void AtomVecFullCuda::unpack_comm_vel(int n, int first, double *buf) //usually t
 int AtomVecFullCuda::pack_reverse(int n, int first, double *buf) //usually this should not be called since comm->communicate handles the communication if only forces are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecFull::pack_reverse(n,first,buf);
+          return AtomVecFull::pack_reverse(n,first,buf);
 
   int i,m,last;
   cuda->cu_f->download();
@@ -207,7 +207,7 @@ int AtomVecFullCuda::pack_reverse(int n, int first, double *buf) //usually this
 void AtomVecFullCuda::unpack_reverse(int n, int *list, double *buf)//usually this should not be called since comm->communicate handles the communication if only forces are exchanged
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	{AtomVecFull::unpack_reverse(n,list,buf); return;}
+          {AtomVecFull::unpack_reverse(n,list,buf); return;}
 
   int i,j,m;
 
@@ -225,23 +225,23 @@ void AtomVecFullCuda::unpack_reverse(int n, int *list, double *buf)//usually thi
 /* ---------------------------------------------------------------------- */
 
 int AtomVecFullCuda::pack_border(int n, int *iswap, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
  if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecFull::pack_border(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_AtomVecFullCuda_PackBorder(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+          return AtomVecFull::pack_border(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_AtomVecFullCuda_PackBorder(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
   return m;
 }
 
 int AtomVecFullCuda::pack_border_vel(int n, int *iswap, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
  if(not cuda->finished_setup || cuda->oncpu)
-  	return AtomVecFull::pack_border_vel(n,iswap,buf,pbc_flag,pbc);
-  	
-	int m = Cuda_AtomVecFullCuda_PackBorderVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
-	
+          return AtomVecFull::pack_border_vel(n,iswap,buf,pbc_flag,pbc);
+
+        int m = Cuda_AtomVecFullCuda_PackBorderVel(&cuda->shared_data,n,*iswap,(void*) buf,pbc,pbc_flag);
+
   return m;
 }
 
@@ -250,10 +250,10 @@ int AtomVecFullCuda::pack_border_vel(int n, int *iswap, double *buf,
 void AtomVecFullCuda::unpack_border(int n, int first, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecFull::unpack_border(n,first,buf); return;}
+           {AtomVecFull::unpack_border(n,first,buf); return;}
   while(atom->nghost+atom->nlocal+n>=cuda->shared_data.atom.nmax) //ensure there is enough space on device to unpack data
   {
-  	grow_both(0);
+          grow_both(0);
   }
   int flag=Cuda_AtomVecFullCuda_UnpackBorder(&cuda->shared_data,n,first,(void*)buf);
   if(flag) {printf(" # CUDA: Error: Failed to unpack Border atoms (This might be a bug).\n");}
@@ -262,10 +262,10 @@ void AtomVecFullCuda::unpack_border(int n, int first, double *buf)
 void AtomVecFullCuda::unpack_border_vel(int n, int first, double *buf)
 {
   if(not cuda->finished_setup || cuda->oncpu)
-  	 {AtomVecFull::unpack_border_vel(n,first,buf); return;}
+           {AtomVecFull::unpack_border_vel(n,first,buf); return;}
   while(atom->nghost+atom->nlocal+n>=cuda->shared_data.atom.nmax) //ensure there is enough space on device to unpack data
   {
-  	grow_both(0);
+          grow_both(0);
   }
   int flag=Cuda_AtomVecFullCuda_UnpackBorderVel(&cuda->shared_data,n,first,(void*)buf);
   if(flag) {printf(" # CUDA: Error: Failed to unpack Border atoms (This might be a bug).\n");}
@@ -273,67 +273,67 @@ void AtomVecFullCuda::unpack_border_vel(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 
 int AtomVecFullCuda::pack_exchange(int dim, double *buf)
 {
   if(cuda->oncpu)
-  	return AtomVecFull::pack_exchange(dim,buf);
+          return AtomVecFull::pack_exchange(dim,buf);
 
   if(not cuda_init_done||domain->box_change)
   {
-  	Cuda_AtomVecFullCuda_Init(&cuda->shared_data);
-  	cuda_init_done=true;
+          Cuda_AtomVecFullCuda_Init(&cuda->shared_data);
+          cuda_init_done=true;
   }
   double** buf_pointer=(double**) buf;
   if(*maxsend<atom->nghost || *buf_pointer==NULL)
   {
-  	grow_send(atom->nghost>*maxsend?atom->nghost:*maxsend,buf_pointer,0);
-  	*maxsend=atom->nghost>*maxsend?atom->nghost:*maxsend;
+          grow_send(atom->nghost>*maxsend?atom->nghost:*maxsend,buf_pointer,0);
+          *maxsend=atom->nghost>*maxsend?atom->nghost:*maxsend;
   }
-  
+
   if(max_nsend==0) grow_copylist(200);
 
   int nsend_atoms = Cuda_AtomVecFullCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
-  
+
   if(nsend_atoms>max_nsend) grow_copylist(nsend_atoms+100);
-  if(nsend_atoms*NCUDAEXCHANGE>*maxsend) 
+  if(nsend_atoms*NCUDAEXCHANGE>*maxsend)
   {
-  	grow_send((int) (nsend_atoms+100)*NCUDAEXCHANGE,buf_pointer,0);
-  	Cuda_AtomVecFullCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
+          grow_send((int) (nsend_atoms+100)*NCUDAEXCHANGE,buf_pointer,0);
+          Cuda_AtomVecFullCuda_PackExchangeList(&cuda->shared_data,*maxsend,dim,*buf_pointer);
   }
 
   int nlocal=atom->nlocal-nsend_atoms;
-  
+
   for(int i=0;i<nsend_atoms;i++) copylist2[i]=1;
   for(int j=1;j<nsend_atoms+1;j++)
   {
-  	int i = static_cast <int> ((*buf_pointer)[j]);
-  	if(i>=nlocal) copylist2[i-nlocal]=-1;
+          int i = static_cast <int> ((*buf_pointer)[j]);
+          if(i>=nlocal) copylist2[i-nlocal]=-1;
   }
-  
+
   int actpos=0;
   for(int j=1;j<nsend_atoms+1;j++)
   {
-  	int i = static_cast <int> ((*buf_pointer)[j]);
-  	if(i<nlocal) 
-  	{
-  	  while(copylist2[actpos]==-1) actpos++;
-    	  copylist[j-1]=nlocal+actpos;
-  	  actpos++;
-  	}
+          int i = static_cast <int> ((*buf_pointer)[j]);
+          if(i<nlocal)
+          {
+            while(copylist2[actpos]==-1) actpos++;
+              copylist[j-1]=nlocal+actpos;
+            actpos++;
+          }
   }
   cu_copylist->upload();
-  
+
   cuda->shared_data.atom.nlocal=nlocal;
-  
+
   int m = Cuda_AtomVecFullCuda_PackExchange(&cuda->shared_data,nsend_atoms,*buf_pointer,cu_copylist->dev_data());
-  
+
   timespec time1,time2;
   clock_gettime(CLOCK_REALTIME,&time1);
- 
+
   double* buf_p=*buf_pointer;
   for(int j=0;j<nsend_atoms;j++)
   {
@@ -347,7 +347,7 @@ int AtomVecFullCuda::pack_exchange(int dim, double *buf)
     }
     nextra+=2*num_bond[i]+1;
     if(m>*maxsend) {grow_send(m,buf_pointer,1); buf_p=*buf_pointer;}
-    
+
     buf_p[m++] = num_angle[i];
     for (k = 0; k < num_angle[i]; k++) {
       buf_p[m++] = angle_type[i][k];
@@ -386,23 +386,23 @@ int AtomVecFullCuda::pack_exchange(int dim, double *buf)
     for (k = 0; k < nspecial[i][2]; k++) buf_p[m++] = special[i][k];
     nextra+=nspecial[i][2]+3;
     if(m>*maxsend) {grow_send(m,buf_pointer,1); buf_p=*buf_pointer;}
-  
+
     if (atom->nextra_grow)
-      for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+      for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       {
         int dm= modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf_p[m]);
         m+=dm;
-  		nextra+=dm;
+                  nextra+=dm;
         if(i<nlocal)modify->fix[atom->extra_grow[iextra]]->copy_arrays(copylist[j],i);
         if(m>*maxsend) {grow_send(m,buf_pointer,1); buf_p=*buf_pointer;}
       }
 
-    if(i<nlocal)AtomVecFull::copy(copylist[j],i,1);  
+    if(i<nlocal)AtomVecFull::copy(copylist[j],i,1);
     (*buf_pointer)[j+1] = nextra;
   }
-	  
-	  clock_gettime(CLOCK_REALTIME,&time2);
-	  cuda->shared_data.cuda_timings.comm_exchange_cpu_pack+=
+
+          clock_gettime(CLOCK_REALTIME,&time2);
+          cuda->shared_data.cuda_timings.comm_exchange_cpu_pack+=
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000;
 
   (*buf_pointer)[0] = nsend_atoms;
@@ -419,11 +419,11 @@ int AtomVecFullCuda::unpack_exchange(double *buf)
 {
 // printf("Begin UnPack Exchange\n");
   if(cuda->oncpu)
-  	return AtomVecFull::unpack_exchange(buf);
-  
+          return AtomVecFull::unpack_exchange(buf);
+
   double *sublo,*subhi;
   int dim=cuda->shared_data.exchange_dim;
-  if(domain->box_change) 
+  if(domain->box_change)
   Cuda_AtomVecFullCuda_Init(&cuda->shared_data);
   if (domain->triclinic == 0) {
     sublo = domain->sublo;
@@ -439,7 +439,7 @@ int AtomVecFullCuda::unpack_exchange(double *buf)
   int nlocal = atom->nlocal;
   int nsend_atoms=static_cast<int> (buf[0]);
   if(nsend_atoms>max_nsend) grow_copylist(nsend_atoms+100);
- 
+
   if (nlocal+nsend_atoms+atom->nghost>=atom->nmax) grow_both(nlocal+nsend_atoms*2+atom->nghost); //ensure there is enough space on device to unpack data
   int naccept = Cuda_AtomVecFullCuda_UnpackExchange(&cuda->shared_data,nsend_atoms,buf,cu_copylist->dev_data());
   cu_copylist->download();
@@ -453,58 +453,58 @@ int AtomVecFullCuda::unpack_exchange(double *buf)
   {
     if(copylist[j]>-1)
     {
- 	  int k;
-	  int i=copylist[j];
+           int k;
+          int i=copylist[j];
       num_bond[i] = static_cast<int> (buf[m++]);
       for (k = 0; k < num_bond[i]; k++) {
-    	bond_type[i][k] = static_cast<int> (buf[m++]);
-    	bond_atom[i][k] = static_cast<int> (buf[m++]);
-  	  }
-
-  	  num_angle[i] = static_cast<int> (buf[m++]);
-  	  for (k = 0; k < num_angle[i]; k++) {
-    	angle_type[i][k] = static_cast<int> (buf[m++]);
-    	angle_atom1[i][k] = static_cast<int> (buf[m++]);
-    	angle_atom2[i][k] = static_cast<int> (buf[m++]);
-    	angle_atom3[i][k] = static_cast<int> (buf[m++]);
-  	  }
-
-  	  num_dihedral[i] = static_cast<int> (buf[m++]);
-  	  for (k = 0; k < num_dihedral[i]; k++) {
-    	dihedral_type[i][k] = static_cast<int> (buf[m++]);
-    	dihedral_atom1[i][k] = static_cast<int> (buf[m++]);
-    	dihedral_atom2[i][k] = static_cast<int> (buf[m++]);
-    	dihedral_atom3[i][k] = static_cast<int> (buf[m++]);
-    	dihedral_atom4[i][k] = static_cast<int> (buf[m++]);
-  	  }
-
-  	  num_improper[i] = static_cast<int> (buf[m++]);
-  	  for (k = 0; k < num_improper[i]; k++) {
-    	improper_type[i][k] = static_cast<int> (buf[m++]);
-    	improper_atom1[i][k] = static_cast<int> (buf[m++]);
-    	improper_atom2[i][k] = static_cast<int> (buf[m++]);
-    	improper_atom3[i][k] = static_cast<int> (buf[m++]);
-    	improper_atom4[i][k] = static_cast<int> (buf[m++]);
-  	  }
-
-  	  nspecial[i][0] = static_cast<int> (buf[m++]);
-  	  nspecial[i][1] = static_cast<int> (buf[m++]);
-  	  nspecial[i][2] = static_cast<int> (buf[m++]);
-  	  for (k = 0; k < nspecial[i][2]; k++)
-    	special[i][k] = static_cast<int> (buf[m++]);
-    	
-  	  if (atom->nextra_grow)
-        for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
-      				m += modify->fix[atom->extra_grow[iextra]]->
-					unpack_exchange(i,&buf[m]);
-    	
+            bond_type[i][k] = static_cast<int> (buf[m++]);
+            bond_atom[i][k] = static_cast<int> (buf[m++]);
+            }
+
+            num_angle[i] = static_cast<int> (buf[m++]);
+            for (k = 0; k < num_angle[i]; k++) {
+            angle_type[i][k] = static_cast<int> (buf[m++]);
+            angle_atom1[i][k] = static_cast<int> (buf[m++]);
+            angle_atom2[i][k] = static_cast<int> (buf[m++]);
+            angle_atom3[i][k] = static_cast<int> (buf[m++]);
+            }
+
+            num_dihedral[i] = static_cast<int> (buf[m++]);
+            for (k = 0; k < num_dihedral[i]; k++) {
+            dihedral_type[i][k] = static_cast<int> (buf[m++]);
+            dihedral_atom1[i][k] = static_cast<int> (buf[m++]);
+            dihedral_atom2[i][k] = static_cast<int> (buf[m++]);
+            dihedral_atom3[i][k] = static_cast<int> (buf[m++]);
+            dihedral_atom4[i][k] = static_cast<int> (buf[m++]);
+            }
+
+            num_improper[i] = static_cast<int> (buf[m++]);
+            for (k = 0; k < num_improper[i]; k++) {
+            improper_type[i][k] = static_cast<int> (buf[m++]);
+            improper_atom1[i][k] = static_cast<int> (buf[m++]);
+            improper_atom2[i][k] = static_cast<int> (buf[m++]);
+            improper_atom3[i][k] = static_cast<int> (buf[m++]);
+            improper_atom4[i][k] = static_cast<int> (buf[m++]);
+            }
+
+            nspecial[i][0] = static_cast<int> (buf[m++]);
+            nspecial[i][1] = static_cast<int> (buf[m++]);
+            nspecial[i][2] = static_cast<int> (buf[m++]);
+            for (k = 0; k < nspecial[i][2]; k++)
+            special[i][k] = static_cast<int> (buf[m++]);
+
+            if (atom->nextra_grow)
+        for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
+                                      m += modify->fix[atom->extra_grow[iextra]]->
+                                        unpack_exchange(i,&buf[m]);
+
     }
-    else 
+    else
     m+=static_cast <int> (buf[j+1]);
   }
-	  
-	  clock_gettime(CLOCK_REALTIME,&time2);
-	  cuda->shared_data.cuda_timings.comm_exchange_cpu_pack+=
+
+          clock_gettime(CLOCK_REALTIME,&time2);
+          cuda->shared_data.cuda_timings.comm_exchange_cpu_pack+=
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000;
 
   cuda->shared_data.atom.nlocal=nlocal;
@@ -515,6 +515,3 @@ int AtomVecFullCuda::unpack_exchange(double *buf)
   }
   return mfirst;
 }
-
-
-
diff --git a/src/USER-CUDA/atom_vec_full_cuda.h b/src/USER-CUDA/atom_vec_full_cuda.h
index f16fd7703d..5ce96a203c 100644
--- a/src/USER-CUDA/atom_vec_full_cuda.h
+++ b/src/USER-CUDA/atom_vec_full_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/comm_cuda.cpp b/src/USER-CUDA/comm_cuda.cpp
index 4e9b9e6cad..0c2e8e8ff0 100644
--- a/src/USER-CUDA/comm_cuda.cpp
+++ b/src/USER-CUDA/comm_cuda.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -49,10 +49,10 @@ using namespace LAMMPS_NS;
 enum{SINGLE,MULTI};
 
 /* ----------------------------------------------------------------------
-   setup MPI and allocate buffer space 
+   setup MPI and allocate buffer space
 ------------------------------------------------------------------------- */
 
-CommCuda::CommCuda(LAMMPS *lmp):Comm(lmp) 
+CommCuda::CommCuda(LAMMPS *lmp):Comm(lmp)
 {
   cuda = lmp->cuda;
    if(cuda == NULL)
@@ -123,11 +123,11 @@ void CommCuda::init()
   delete cu_slabhi;
   cu_slabhi = new cCudaData<double, X_FLOAT,x>(slabhi,cuda->shared_data.comm.maxswap);
   cu_slabhi->upload();
-  
+
   cuda->shared_data.comm.pbc.dev_data=cu_pbc->dev_data();
   cuda->shared_data.comm.slablo.dev_data=cu_slablo->dev_data();
   cuda->shared_data.comm.slabhi.dev_data=cu_slabhi->dev_data();
- 
+
   Comm::init();
 }
 
@@ -142,17 +142,17 @@ void CommCuda::setup()
 {
   if(cuda->shared_data.pair.neighall) cutghostuser = MAX(2.0*neighbor->cutneighmax,cutghostuser);
   Comm::setup();
-   
+
   //upload changed geometry to device
     if(style == SINGLE)
     {
-    	if(cu_slablo) cu_slablo->upload();
-    	if(cu_slabhi) cu_slabhi->upload();
+            if(cu_slablo) cu_slablo->upload();
+            if(cu_slabhi) cu_slabhi->upload();
     }
-	else
+        else
     {
-    	if(cu_multilo) cu_multilo->upload();
-    	if(cu_multihi) cu_multihi->upload();
+            if(cu_multilo) cu_multilo->upload();
+            if(cu_multihi) cu_multihi->upload();
     }
 }
 
@@ -176,7 +176,7 @@ void CommCuda::forward_comm_cuda()
   static double kerneltime=0.0;
   static double copytime=0.0;
   timespec time1,time2,time3;
-  
+
   int n;
   MPI_Request request;
   MPI_Status status;
@@ -190,112 +190,112 @@ void CommCuda::forward_comm_cuda()
   cuda->shared_data.domain.prd[1]=domain->prd[1];
   cuda->shared_data.domain.prd[2]=domain->prd[2];
   cuda->shared_data.domain.triclinic=domain->triclinic;
-  if(not comm_x_only && not avec->cudable) 
+  if(not comm_x_only && not avec->cudable)
   {
-  	cuda->downloadAll(); 
+          cuda->downloadAll();
     Comm::forward_comm();
     cuda->uploadAll();
     return;
-  } 
-  
+  }
+
   // exchange data with another proc
   // if other proc is self, just copy
   // if comm_x_only set, exchange or copy directly to x, don't unpack
 
   for (int iswap = 0; iswap < nswap; iswap++) {
-    if (sendproc[iswap] != me) 
-    {   
-      if (comm_x_only) 
+    if (sendproc[iswap] != me)
+    {
+      if (comm_x_only)
       {
 
         int size_forward_recv_now=0;
-        
+
         if((sizeof(X_FLOAT)!=sizeof(double)) && size_forward_recv[iswap]) //some complicated way to safe some transfer size if single precision is used
           size_forward_recv_now=(size_forward_recv[iswap]+1)*sizeof(X_FLOAT)/sizeof(double);
         else
           size_forward_recv_now=size_forward_recv[iswap];
 clock_gettime(CLOCK_REALTIME,&time1);
-        
+
         MPI_Irecv(buf_recv,size_forward_recv_now,MPI_DOUBLE,
                  recvproc[iswap],0,world,&request);
         n = Cuda_CommCuda_PackComm(&cuda->shared_data,sendnum[iswap],iswap,(void*) buf_send,pbc[iswap],pbc_flag[iswap]);
-		
+
 clock_gettime(CLOCK_REALTIME,&time2);
-		
+
         if((sizeof(X_FLOAT)!=sizeof(double)) && n) //some complicated way to safe some transfer size if single precision is used
           n=(n+1)*sizeof(X_FLOAT)/sizeof(double);
 
-		//printf("RecvSize: %i SendSize: %i\n",size_forward_recv_now,n);
-	    MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	    MPI_Wait(&request,&status);
-       
+                //printf("RecvSize: %i SendSize: %i\n",size_forward_recv_now,n);
+            MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+            MPI_Wait(&request,&status);
+
 clock_gettime(CLOCK_REALTIME,&time3);
 cuda->shared_data.cuda_timings.comm_forward_mpi_upper+=
       time3.tv_sec-time1.tv_sec+1.0*(time3.tv_nsec-time1.tv_nsec)/1000000000;
 cuda->shared_data.cuda_timings.comm_forward_mpi_lower+=
       time3.tv_sec-time2.tv_sec+1.0*(time3.tv_nsec-time2.tv_nsec)/1000000000;
- 
+
         Cuda_CommCuda_UnpackComm(&cuda->shared_data,recvnum[iswap],firstrecv[iswap],(void*)buf_recv,iswap); //Unpack for cpu exchange happens implicitely since buf==x[firstrecv]
- 	
-      } 
-      else if (ghost_velocity) 
+
+      }
+      else if (ghost_velocity)
       {
-	    MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
-		  recvproc[iswap],0,world,&request);
-        
+            MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
+                  recvproc[iswap],0,world,&request);
+
         if(avec->cudable)
           n = avec->pack_comm_vel(sendnum[iswap],&iswap,
                            buf_send,pbc_flag[iswap],pbc[iswap]);
         else
-	      n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
-				buf_send,pbc_flag[iswap],pbc[iswap]);
-	    
-	    MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	    MPI_Wait(&request,&status);
-	    avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_recv);
-      } 
-      else 
+              n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
+                                buf_send,pbc_flag[iswap],pbc[iswap]);
+
+            MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+            MPI_Wait(&request,&status);
+            avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_recv);
+      }
+      else
       {
-	    MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
-		  recvproc[iswap],0,world,&request);
-        
+            MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
+                  recvproc[iswap],0,world,&request);
+
         if(avec->cudable)
           n = avec->pack_comm(sendnum[iswap],&iswap,
                            buf_send,pbc_flag[iswap],pbc[iswap]);
         else
-	      n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
-			    buf_send,pbc_flag[iswap],pbc[iswap]);
-	
-	    MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	    MPI_Wait(&request,&status);
-	    avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv);
+              n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
+                            buf_send,pbc_flag[iswap],pbc[iswap]);
+
+            MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+            MPI_Wait(&request,&status);
+            avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv);
       }
 
     }
     else  //sendproc == me
     {
       cuda->self_comm=1;
-      if (comm_x_only) 
-      {     	
-	    if (sendnum[iswap])
-		{
+      if (comm_x_only)
+      {
+            if (sendnum[iswap])
+                {
           n = Cuda_CommCuda_PackComm_Self(&cuda->shared_data,sendnum[iswap],iswap,firstrecv[iswap],pbc[iswap],pbc_flag[iswap]);
           if(n<0) error->all(FLERR," # CUDA ERRROR on PackComm_Self");
           if((sizeof(X_FLOAT)!=sizeof(double)) && n)
             n=(n+1)*sizeof(X_FLOAT)/sizeof(double);
-		}
-      } 
-      else if (ghost_velocity) 
+                }
+      }
+      else if (ghost_velocity)
       {
-		n = avec->pack_comm_vel(sendnum[iswap],&iswap,
-				(double*) firstrecv,pbc_flag[iswap],pbc[iswap]);
-	    //avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],(double*) firstrecv);
-      } 
-      else 
+                n = avec->pack_comm_vel(sendnum[iswap],&iswap,
+                                (double*) firstrecv,pbc_flag[iswap],pbc[iswap]);
+            //avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],(double*) firstrecv);
+      }
+      else
       {
-		n = avec->pack_comm(sendnum[iswap],&iswap,
-			    (double*) firstrecv,pbc_flag[iswap],pbc[iswap]);
-		//avec->unpack_comm(recvnum[iswap],firstrecv[iswap],(double*) firstrecv);
+                n = avec->pack_comm(sendnum[iswap],&iswap,
+                            (double*) firstrecv,pbc_flag[iswap],pbc[iswap]);
+                //avec->unpack_comm(recvnum[iswap],firstrecv[iswap],(double*) firstrecv);
       }
       cuda->self_comm=0;
     }
@@ -304,9 +304,9 @@ cuda->shared_data.cuda_timings.comm_forward_mpi_lower+=
 
 void CommCuda::forward_comm_pack_cuda()
 {
-	static int count=0;
-	static double kerneltime=0.0;
-	static double copytime=0.0;
+        static int count=0;
+        static double kerneltime=0.0;
+        static double copytime=0.0;
     timespec time1,time2,time3;
   int n;  // initialize comm buffers & exchange memory
 
@@ -322,94 +322,94 @@ void CommCuda::forward_comm_pack_cuda()
   cuda->shared_data.domain.prd[1]=domain->prd[1];
   cuda->shared_data.domain.prd[2]=domain->prd[2];
   cuda->shared_data.domain.triclinic=domain->triclinic;
-  if(not comm_x_only && not avec->cudable) cuda->downloadAll();  //if not comm_x_only the communication routine of the atom_vec style class is used 
+  if(not comm_x_only && not avec->cudable) cuda->downloadAll();  //if not comm_x_only the communication routine of the atom_vec style class is used
 
   // exchange data with another proc
   // if other proc is self, just copy
   // if comm_x_only set, exchange or copy directly to x, don't unpack
 
   for (int iswap = 0; iswap < nswap; iswap++) {
-    if (sendproc[iswap] != me) 
-    {   
-      if (comm_x_only) 
+    if (sendproc[iswap] != me)
+    {
+      if (comm_x_only)
       {
 
-		
+
 clock_gettime(CLOCK_REALTIME,&time1);
-        
+
       //  n = Cuda_CommCuda_PackComm(&cuda->shared_data,sendnum[iswap],iswap,(void*) cuda->shared_data.comm.buf_send[iswap],pbc[iswap],pbc_flag[iswap]);
-		  n = Cuda_CommCuda_PackComm(&cuda->shared_data,sendnum[iswap],iswap,(void*)buf_send,pbc[iswap],pbc_flag[iswap]);
-		
+                  n = Cuda_CommCuda_PackComm(&cuda->shared_data,sendnum[iswap],iswap,(void*)buf_send,pbc[iswap],pbc_flag[iswap]);
+
 clock_gettime(CLOCK_REALTIME,&time2);
-		
+
         if((sizeof(X_FLOAT)!=sizeof(double)) && n) //some complicated way to safe some transfer size if single precision is used
           n=(n+1)*sizeof(X_FLOAT)/sizeof(double);
-		cuda->shared_data.comm.send_size[iswap]=n;
-      } 
-      else if (ghost_velocity) 
+                cuda->shared_data.comm.send_size[iswap]=n;
+      }
+      else if (ghost_velocity)
       {
 clock_gettime(CLOCK_REALTIME,&time1);
 
        // n = Cuda_CommCuda_PackComm_Vel(&cuda->shared_data,sendnum[iswap],iswap,(void*) &buf_send[iswap*maxsend],pbc[iswap],pbc_flag[iswap]);
-		
+
 clock_gettime(CLOCK_REALTIME,&time2);
-		
+
         if((sizeof(X_FLOAT)!=sizeof(double)) && n) //some complicated way to safe some transfer size if single precision is used
           n=(n+1)*sizeof(X_FLOAT)/sizeof(double);
-		cuda->shared_data.comm.send_size[iswap]=n;
-       } 
-      else 
+                cuda->shared_data.comm.send_size[iswap]=n;
+       }
+      else
       {
-	    MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
-		  recvproc[iswap],0,world,&request);
-        
+            MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
+                  recvproc[iswap],0,world,&request);
+
         if(avec->cudable)
           n = avec->pack_comm(sendnum[iswap],&iswap,
                            cuda->shared_data.comm.buf_send[iswap],pbc_flag[iswap],pbc[iswap]);
         else
-	      n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
-			    cuda->shared_data.comm.buf_send[iswap],pbc_flag[iswap],pbc[iswap]);
-	
-	    MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	    MPI_Wait(&request,&status);
-	    avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv);
+              n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
+                            cuda->shared_data.comm.buf_send[iswap],pbc_flag[iswap],pbc[iswap]);
+
+            MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+            MPI_Wait(&request,&status);
+            avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv);
       }
 
     }
     else  //sendproc == me
     {
-      if (comm_x_only) 
-      {     	
-	    if (sendnum[iswap])
-		{
+      if (comm_x_only)
+      {
+            if (sendnum[iswap])
+                {
           n = Cuda_CommCuda_PackComm_Self(&cuda->shared_data,sendnum[iswap],iswap,firstrecv[iswap],pbc[iswap],pbc_flag[iswap]);
           if(n<0) error->all(FLERR," # CUDA ERRROR on PackComm_Self");
           if((sizeof(X_FLOAT)!=sizeof(double)) && n)
             n=(n+1)*sizeof(X_FLOAT)/sizeof(double);
-		}
-      } 
-      else if (ghost_velocity) 
+                }
+      }
+      else if (ghost_velocity)
       {
-		n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
-				buf_send,pbc_flag[iswap],pbc[iswap]);
-	    avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_send);
-      } 
-      else 
+                n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
+                                buf_send,pbc_flag[iswap],pbc[iswap]);
+            avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_send);
+      }
+      else
       {
-		n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
-			    buf_send,pbc_flag[iswap],pbc[iswap]);
-		avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_send);
+                n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
+                            buf_send,pbc_flag[iswap],pbc[iswap]);
+                avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_send);
       }
     }
   }
-  if(not comm_x_only && not avec->cudable) cuda->uploadAll(); 
+  if(not comm_x_only && not avec->cudable) cuda->uploadAll();
 }
 
 void CommCuda::forward_comm_transfer_cuda()
 {
-	static int count=0;
-	static double kerneltime=0.0;
-	static double copytime=0.0;
+        static int count=0;
+        static double kerneltime=0.0;
+        static double copytime=0.0;
     timespec time1,time2,time3;
   int n;
   MPI_Request request;
@@ -423,51 +423,51 @@ void CommCuda::forward_comm_transfer_cuda()
   cuda->shared_data.domain.prd[1]=domain->prd[1];
   cuda->shared_data.domain.prd[2]=domain->prd[2];
   cuda->shared_data.domain.triclinic=domain->triclinic;
-  if(not comm_x_only && not avec->cudable) cuda->downloadAll();  //if not comm_x_only the communication routine of the atom_vec style class is used 
+  if(not comm_x_only && not avec->cudable) cuda->downloadAll();  //if not comm_x_only the communication routine of the atom_vec style class is used
 //printf("A\n");
   // exchange data with another proc
   // if other proc is self, just copy
   // if comm_x_only set, exchange or copy directly to x, don't unpack
 
   for (int iswap = 0; iswap < nswap; iswap++) {
-    if (sendproc[iswap] != me) 
-    {   
-      if (comm_x_only) 
+    if (sendproc[iswap] != me)
+    {
+      if (comm_x_only)
       {
 
         int size_forward_recv_now=0;
-        
+
         if((sizeof(X_FLOAT)!=sizeof(double)) && size_forward_recv[iswap]) //some complicated way to safe some transfer size if single precision is used
           size_forward_recv_now=(size_forward_recv[iswap]+1)*sizeof(X_FLOAT)/sizeof(double);
         else
           size_forward_recv_now=size_forward_recv[iswap];
-		
+
         //printf("A: %i \n",size_forward_recv_now/1024*4);
         //MPI_Irecv(cuda->shared_data.comm.buf_recv[iswap],size_forward_recv_now,MPI_DOUBLE,
         //         recvproc[iswap],0,world,&request);
         MPI_Irecv(buf_recv,size_forward_recv_now,MPI_DOUBLE,
                  recvproc[iswap],0,world,&request);
-		//printf("%p %p %i\n",buf_send, cuda->shared_data.comm.buf_send_dev[iswap], cuda->shared_data.comm.send_size[iswap]*sizeof(double));
+                //printf("%p %p %i\n",buf_send, cuda->shared_data.comm.buf_send_dev[iswap], cuda->shared_data.comm.send_size[iswap]*sizeof(double));
         //memcpy(buf_send,cuda->shared_data.comm.buf_send[iswap],cuda->shared_data.comm.send_size[iswap]*sizeof(double));
-	//	CudaWrapper_SyncStream(1);
+        //        CudaWrapper_SyncStream(1);
         //printf("B: %i \n",cuda->shared_data.comm.send_size[iswap]/1024*4);
-		CudaWrapper_DownloadCudaDataAsync((void*) buf_send, cuda->shared_data.comm.buf_send_dev[iswap], cuda->shared_data.comm.send_size[iswap]*sizeof(double),2);
-	    //MPI_Send(cuda->shared_data.comm.buf_send[iswap],cuda->shared_data.comm.send_size[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
+                CudaWrapper_DownloadCudaDataAsync((void*) buf_send, cuda->shared_data.comm.buf_send_dev[iswap], cuda->shared_data.comm.send_size[iswap]*sizeof(double),2);
+            //MPI_Send(cuda->shared_data.comm.buf_send[iswap],cuda->shared_data.comm.send_size[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
 clock_gettime(CLOCK_REALTIME,&time1);
         CudaWrapper_SyncStream(2);
         //printf("C: %i \n",cuda->shared_data.comm.send_size[iswap]/1024*4);
 clock_gettime(CLOCK_REALTIME,&time2);
 cuda->shared_data.cuda_timings.comm_forward_download+=
       time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000;
-	    MPI_Send(buf_send,cuda->shared_data.comm.send_size[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
-	    MPI_Wait(&request,&status);
+            MPI_Send(buf_send,cuda->shared_data.comm.send_size[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
+            MPI_Wait(&request,&status);
         //printf("D: %i \n",cuda->shared_data.comm.send_size[iswap]/1024*4);
-		CudaWrapper_UploadCudaDataAsync((void*) buf_recv,cuda->shared_data.comm.buf_recv_dev[iswap], size_forward_recv_now*sizeof(double),2);
+                CudaWrapper_UploadCudaDataAsync((void*) buf_recv,cuda->shared_data.comm.buf_recv_dev[iswap], size_forward_recv_now*sizeof(double),2);
 clock_gettime(CLOCK_REALTIME,&time1);
         CudaWrapper_SyncStream(2);
         //printf("E: %i \n",cuda->shared_data.comm.send_size[iswap]/1024*4);
         //memcpy(cuda->shared_data.comm.buf_recv[iswap],buf_recv,size_forward_recv_now*sizeof(double));
- 		//printf("RecvSize: %i SendSize: %i\n",size_forward_recv_now*sizeof(double),cuda->shared_data.comm.send_size[iswap]*sizeof(double));      
+                 //printf("RecvSize: %i SendSize: %i\n",size_forward_recv_now*sizeof(double),cuda->shared_data.comm.send_size[iswap]*sizeof(double));
 clock_gettime(CLOCK_REALTIME,&time3);
 cuda->shared_data.cuda_timings.comm_forward_upload+=
       time3.tv_sec-time1.tv_sec+1.0*(time3.tv_nsec-time1.tv_nsec)/1000000000;
@@ -476,78 +476,78 @@ cuda->shared_data.cuda_timings.comm_forward_mpi_lower+=
 clock_gettime(CLOCK_REALTIME,&time3);
 cuda->shared_data.cuda_timings.comm_forward_mpi_upper+=
       time3.tv_sec-time1.tv_sec+1.0*(time3.tv_nsec-time1.tv_nsec)/1000000000;
-      } 
-      else if (ghost_velocity) 
+      }
+      else if (ghost_velocity)
       {
  /*       int size_forward_recv_now=0;
-        
+
         if((sizeof(X_FLOAT)!=sizeof(double)) && size_forward_recv[iswap]) //some complicated way to safe some transfer size if single precision is used
           size_forward_recv_now=(size_forward_recv[iswap]+1)*sizeof(X_FLOAT)/sizeof(double);
         else
           size_forward_recv_now=size_forward_recv[iswap];
-		
+
 clock_gettime(CLOCK_REALTIME,&time1);
-        
+
         MPI_Irecv(cuda->shared_data.comm.buf_recv[iswap],size_forward_recv_now,MPI_DOUBLE,
                  recvproc[iswap],0,world,&request);
-		
+
 clock_gettime(CLOCK_REALTIME,&time2);
-		
-	    MPI_Send(cuda->shared_data.comm.buf_send[iswap],cuda->shared_data.comm.send_size[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
-	    MPI_Wait(&request,&status);
-       
+
+            MPI_Send(cuda->shared_data.comm.buf_send[iswap],cuda->shared_data.comm.send_size[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
+            MPI_Wait(&request,&status);
+
 clock_gettime(CLOCK_REALTIME,&time3);
 cuda->shared_data.cuda_timings.comm_forward_mpi_upper+=
       time3.tv_sec-time1.tv_sec+1.0*(time3.tv_nsec-time1.tv_nsec)/1000000000;
 cuda->shared_data.cuda_timings.comm_forward_mpi_lower+=
       time3.tv_sec-time2.tv_sec+1.0*(time3.tv_nsec-time2.tv_nsec)/1000000000;*/
- 
-       } 
-      else 
+
+       }
+      else
       {
-	    MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
-		  recvproc[iswap],0,world,&request);
-        
+            MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
+                  recvproc[iswap],0,world,&request);
+
         if(avec->cudable)
           n = avec->pack_comm(sendnum[iswap],&iswap,
                            buf_send,pbc_flag[iswap],pbc[iswap]);
         else
-	      n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
-			    buf_send,pbc_flag[iswap],pbc[iswap]);
-	
-	    MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	    MPI_Wait(&request,&status);
-	    avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv);
+              n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
+                            buf_send,pbc_flag[iswap],pbc[iswap]);
+
+            MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+            MPI_Wait(&request,&status);
+            avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv);
       }
 
     }
     else  //sendproc == me
     {
-      if (comm_x_only) 
-      {     	
-	    if (sendnum[iswap])
-		{
-		}
-      } 
-      else if (ghost_velocity) 
+      if (comm_x_only)
       {
-      } 
-      else 
+            if (sendnum[iswap])
+                {
+                }
+      }
+      else if (ghost_velocity)
       {
-		n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
-			    buf_send,pbc_flag[iswap],pbc[iswap]);
-		avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_send);
+      }
+      else
+      {
+                n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
+                            buf_send,pbc_flag[iswap],pbc[iswap]);
+                avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_send);
       }
     }
   }
-  if(not comm_x_only && not avec->cudable) cuda->uploadAll(); 
+  if(not comm_x_only && not avec->cudable) cuda->uploadAll();
 }
 
 void CommCuda::forward_comm_unpack_cuda()
 {
-	static int count=0;
-	static double kerneltime=0.0;
-	static double copytime=0.0;
+        static int count=0;
+        static double kerneltime=0.0;
+        static double copytime=0.0;
     timespec time1,time2,time3;
   int n;
   MPI_Request request;
@@ -562,73 +562,73 @@ void CommCuda::forward_comm_unpack_cuda()
   cuda->shared_data.domain.prd[1]=domain->prd[1];
   cuda->shared_data.domain.prd[2]=domain->prd[2];
   cuda->shared_data.domain.triclinic=domain->triclinic;
-  if(not comm_x_only && not avec->cudable) cuda->downloadAll();  //if not comm_x_only the communication routine of the atom_vec style class is used 
+  if(not comm_x_only && not avec->cudable) cuda->downloadAll();  //if not comm_x_only the communication routine of the atom_vec style class is used
 
   // exchange data with another proc
   // if other proc is self, just copy
   // if comm_x_only set, exchange or copy directly to x, don't unpack
 
   for (int iswap = 0; iswap < nswap; iswap++) {
-    if (sendproc[iswap] != me) 
-    {   
-      if (comm_x_only) 
-      {   
- 
+    if (sendproc[iswap] != me)
+    {
+      if (comm_x_only)
+      {
+
         //Cuda_CommCuda_UnpackComm(&cuda->shared_data,recvnum[iswap],firstrecv[iswap],cuda->shared_data.comm.buf_recv[iswap],iswap); //Unpack for cpu exchange happens implicitely since buf==x[firstrecv]
         Cuda_CommCuda_UnpackComm(&cuda->shared_data,recvnum[iswap],firstrecv[iswap],buf_recv,iswap); //Unpack for cpu exchange happens implicitely since buf==x[firstrecv]
- 	
-      } 
-      else if (ghost_velocity) 
-      { 
+
+      }
+      else if (ghost_velocity)
+      {
         //Cuda_CommCuda_UnpackComm_Vel(&cuda->shared_data,recvnum[iswap],firstrecv[iswap],(void*)&buf_recv[iswap*maxrecv]); //Unpack for cpu exchange happens implicitely since buf==x[firstrecv]
-      } 
-      else 
+      }
+      else
       {
-	    MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
-		  recvproc[iswap],0,world,&request);
-        
+            MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
+                  recvproc[iswap],0,world,&request);
+
         if(avec->cudable)
           n = avec->pack_comm(sendnum[iswap],&iswap,
                            buf_send,pbc_flag[iswap],pbc[iswap]);
         else
-	      n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
-			    buf_send,pbc_flag[iswap],pbc[iswap]);
-	
-	    MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	    MPI_Wait(&request,&status);
-	    avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv);
+              n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
+                            buf_send,pbc_flag[iswap],pbc[iswap]);
+
+            MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+            MPI_Wait(&request,&status);
+            avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv);
       }
 
     }
     else  //sendproc == me
     {
-      if (comm_x_only) 
-      {     	
-	    if (sendnum[iswap])
-		{
-		}
-      } 
-      else if (ghost_velocity) 
+      if (comm_x_only)
       {
-      } 
-      else 
+            if (sendnum[iswap])
+                {
+                }
+      }
+      else if (ghost_velocity)
       {
-		n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
-			    buf_send,pbc_flag[iswap],pbc[iswap]);
-		avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_send);
+      }
+      else
+      {
+                n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
+                            buf_send,pbc_flag[iswap],pbc[iswap]);
+                avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_send);
       }
     }
   }
-  if(not comm_x_only && not avec->cudable) cuda->uploadAll(); 
+  if(not comm_x_only && not avec->cudable) cuda->uploadAll();
 }
 
 void CommCuda::forward_comm_pair(Pair *pair)
 {
   if(not cuda->shared_data.pair.cudable_force)
   {
-  	return Comm::forward_comm_pair(pair);
+          return Comm::forward_comm_pair(pair);
   }
-  
+
   int iswap,n;
   double *buf;
   MPI_Request request;
@@ -639,18 +639,18 @@ void CommCuda::forward_comm_pair(Pair *pair)
     // pack buffer
 
     n = pair->pack_comm(sendnum[iswap],&iswap,
-			buf_send,pbc_flag[iswap],pbc[iswap]);
-	int nrecv = recvnum[iswap]*n;
-	if(nrecv<0) nrecv=-(nrecv+1)/2;
-	int nsend = sendnum[iswap]*n;
-	if(nsend<0) nsend=-(nsend+1)/2;
-	
+                        buf_send,pbc_flag[iswap],pbc[iswap]);
+        int nrecv = recvnum[iswap]*n;
+        if(nrecv<0) nrecv=-(nrecv+1)/2;
+        int nsend = sendnum[iswap]*n;
+        if(nsend<0) nsend=-(nsend+1)/2;
+
     // exchange with another proc
     // if self, set recv buffer to send buffer
 
     if (sendproc[iswap] != me) {
       MPI_Irecv(buf_recv,nrecv,MPI_DOUBLE,recvproc[iswap],0,
-		world,&request);
+                world,&request);
       MPI_Send(buf_send,nsend,MPI_DOUBLE,sendproc[iswap],0,world);
       MPI_Wait(&request,&status);
       buf = buf_recv;
@@ -663,10 +663,10 @@ void CommCuda::forward_comm_pair(Pair *pair)
 }
 
 /* ----------------------------------------------------------------------
-   reverse communication of forces on atoms every timestep 
+   reverse communication of forces on atoms every timestep
    other per-atom attributes may also be sent via pack/unpack routines
 ------------------------------------------------------------------------- */
-      
+
 void CommCuda::reverse_comm()
 {
   int n;
@@ -687,10 +687,10 @@ void CommCuda::reverse_comm()
       if (comm_f_only) {
 
     int size_recv_now=size_reverse_recv[iswap];
-	if((sizeof(F_FLOAT)!=sizeof(double))&& size_reverse_recv[iswap])
-	  size_recv_now=(size_recv_now+1)*sizeof(F_FLOAT)/sizeof(double);
-	MPI_Irecv(buf_recv,size_recv_now,MPI_DOUBLE,
-		  sendproc[iswap],0,world,&request);
+        if((sizeof(F_FLOAT)!=sizeof(double))&& size_reverse_recv[iswap])
+          size_recv_now=(size_recv_now+1)*sizeof(F_FLOAT)/sizeof(double);
+        MPI_Irecv(buf_recv,size_recv_now,MPI_DOUBLE,
+                  sendproc[iswap],0,world,&request);
 
     buf=buf_send;
     if (size_reverse_send[iswap])
@@ -699,30 +699,30 @@ void CommCuda::reverse_comm()
     }
     else buf=NULL;
     int size_reverse_send_now=size_reverse_send[iswap];
-	if((sizeof(F_FLOAT)!=sizeof(double))&& size_reverse_send[iswap])
-	  size_reverse_send_now=(size_reverse_send_now+1)*sizeof(F_FLOAT)/sizeof(double);
-	MPI_Send(buf,size_reverse_send_now,MPI_DOUBLE,
-		 recvproc[iswap],0,world);
-	MPI_Wait(&request,&status);
-	Cuda_CommCuda_UnpackReverse(&cuda->shared_data,sendnum[iswap],iswap,buf_recv);
+        if((sizeof(F_FLOAT)!=sizeof(double))&& size_reverse_send[iswap])
+          size_reverse_send_now=(size_reverse_send_now+1)*sizeof(F_FLOAT)/sizeof(double);
+        MPI_Send(buf,size_reverse_send_now,MPI_DOUBLE,
+                 recvproc[iswap],0,world);
+        MPI_Wait(&request,&status);
+        Cuda_CommCuda_UnpackReverse(&cuda->shared_data,sendnum[iswap],iswap,buf_recv);
 
       } else {
-	MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE,
-		  sendproc[iswap],0,world,&request);
-	n = avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send);
-	MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world);
-	MPI_Wait(&request,&status);
+        MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE,
+                  sendproc[iswap],0,world,&request);
+        n = avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send);
+        MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world);
+        MPI_Wait(&request,&status);
 
       avec->unpack_reverse(sendnum[iswap],sendlist[iswap],buf_recv);
       }
 
     } else {
       if (comm_f_only) {
-	if (sendnum[iswap])
-      	Cuda_CommCuda_UnpackReverse_Self(&cuda->shared_data,sendnum[iswap],iswap,firstrecv[iswap]);
+        if (sendnum[iswap])
+              Cuda_CommCuda_UnpackReverse_Self(&cuda->shared_data,sendnum[iswap],iswap,firstrecv[iswap]);
       } else {
-	n = avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send);
-	avec->unpack_reverse(sendnum[iswap],sendlist[iswap],buf_send);
+        n = avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send);
+        avec->unpack_reverse(sendnum[iswap],sendlist[iswap],buf_send);
       }
     }
   }
@@ -743,12 +743,12 @@ void CommCuda::reverse_comm()
 void CommCuda::exchange()
 {
   AtomVec *avec = atom->avec;
-	
+
   if(not cuda->oncpu && avec->cudable)
-    	return exchange_cuda();
+            return exchange_cuda();
+
+  if(not cuda->oncpu) cuda->downloadAll();
 
-  if(not cuda->oncpu) cuda->downloadAll();  
-  
   Comm::exchange();
 }
 
@@ -765,11 +765,11 @@ void CommCuda::exchange_cuda()
     timespec time1,time2,time3;
 
   // clear global->local map for owned and ghost atoms
-  // b/c atoms migrate to new procs in exchange() and 
+  // b/c atoms migrate to new procs in exchange() and
   // new ghosts are created in borders()
   // map_set() is done at end of borders()
 
-  
+
   if(map_style) cuda->cu_tag->download();
 
   if (map_style) atom->map_clear();
@@ -785,13 +785,13 @@ void CommCuda::exchange_cuda()
   }
 
   // loop over dimensions
-	
+
   for (int dim = 0; dim < 3; dim++) {
     // fill buffer with atoms leaving my box, using < and >=
     // when atom is deleted, fill it in with last atom
 
-  	cuda->shared_data.exchange_dim=dim;
-    
+          cuda->shared_data.exchange_dim=dim;
+
     nlocal = atom->nlocal;
     avec->maxsend=&maxsend;
     nsend=avec->pack_exchange(dim,(double*) &buf_send);
@@ -806,39 +806,39 @@ void CommCuda::exchange_cuda()
     // if more than 2 procs in dimension, send/recv to both neighbors
 
  clock_gettime(CLOCK_REALTIME,&time1);
- 
+
     if (procgrid[dim] == 1) {
       nrecv = nsend;
       buf = buf_send;
 
     } else {
       MPI_Sendrecv(&nsend,1,MPI_INT,procneigh[dim][0],0,
-		   &nrecv1,1,MPI_INT,procneigh[dim][1],0,world,&status);
+                   &nrecv1,1,MPI_INT,procneigh[dim][1],0,world,&status);
       nrecv = nrecv1;
       if (procgrid[dim] > 2) {
-	MPI_Sendrecv(&nsend,1,MPI_INT,procneigh[dim][1],0,
-		     &nrecv2,1,MPI_INT,procneigh[dim][0],0,world,&status);
-	nrecv += nrecv2;
+        MPI_Sendrecv(&nsend,1,MPI_INT,procneigh[dim][1],0,
+                     &nrecv2,1,MPI_INT,procneigh[dim][0],0,world,&status);
+        nrecv += nrecv2;
       }
       if (nrecv+1 > maxrecv) grow_recv(nrecv+1);
-      
+
       MPI_Irecv(buf_recv,nrecv1,MPI_DOUBLE,procneigh[dim][1],0,
-		world,&request);
+                world,&request);
       MPI_Send(buf_send,nsend,MPI_DOUBLE,procneigh[dim][0],0,world);
       MPI_Wait(&request,&status);
-      
+
       if (procgrid[dim] > 2) {
-	MPI_Irecv(&buf_recv[nrecv1],nrecv2,MPI_DOUBLE,procneigh[dim][0],0,
-		  world,&request);
-	MPI_Send(buf_send,nsend,MPI_DOUBLE,procneigh[dim][1],0,world);
-	MPI_Wait(&request,&status);
+        MPI_Irecv(&buf_recv[nrecv1],nrecv2,MPI_DOUBLE,procneigh[dim][0],0,
+                  world,&request);
+        MPI_Send(buf_send,nsend,MPI_DOUBLE,procneigh[dim][1],0,world);
+        MPI_Wait(&request,&status);
 
-    	if((nrecv1==0)||(nrecv2==0)) buf_recv[nrecv]=0;
+            if((nrecv1==0)||(nrecv2==0)) buf_recv[nrecv]=0;
       }
-      
+
       buf = buf_recv;
     }
-	//printf("nsend: %i nrecv: %i\n",nsend,nrecv);
+        //printf("nsend: %i nrecv: %i\n",nsend,nrecv);
     // check incoming atoms to see if they are in my box
     // if so, add to my list
 clock_gettime(CLOCK_REALTIME,&time2);
@@ -856,7 +856,7 @@ cuda->shared_data.cuda_timings.comm_exchange_mpi+=
 
   if(atom->firstgroupname) atom->first_reorder();
 
-  if(atom->firstgroupname) cuda->uploadAll(); 
+  if(atom->firstgroupname) cuda->uploadAll();
 }
 
 /* ----------------------------------------------------------------------
@@ -875,19 +875,19 @@ void CommCuda::borders()
   AtomVec *avec = atom->avec;
   if(not cuda->oncpu && avec->cudable)
   {
-  	if(cuda->shared_data.overlap_comm&&cuda->finished_setup)
-   	  borders_cuda_overlap_forward_comm();
-   	else
-   	  borders_cuda();
-   	  
-   	return;
+          if(cuda->shared_data.overlap_comm&&cuda->finished_setup)
+             borders_cuda_overlap_forward_comm();
+           else
+             borders_cuda();
+
+           return;
   }
 
   Comm::borders();
- 
+
   cuda->setSystemParams();
   if(cuda->finished_setup) {cuda->checkResize(); cuda->uploadAll();}
-  cuda->shared_data.atom.nghost=atom->nghost;  
+  cuda->shared_data.atom.nghost=atom->nghost;
   cu_sendlist->upload();
 }
 
@@ -912,7 +912,7 @@ void CommCuda::borders_cuda()
 
   iswap = 0;
   smax = rmax = 0;
-  
+
   cuda->shared_data.comm.nsend=0;
   for (dim = 0; dim < 3; dim++) {
     nlast = 0;
@@ -927,16 +927,16 @@ void CommCuda::borders_cuda()
 
       x = atom->x;
       if (style == SINGLE) {
-	lo = slablo[iswap];
-	hi = slabhi[iswap];
+        lo = slablo[iswap];
+        hi = slabhi[iswap];
       } else {
-	type = atom->type;
-	mlo = multilo[iswap];
-	mhi = multihi[iswap];
+        type = atom->type;
+        mlo = multilo[iswap];
+        mhi = multihi[iswap];
       }
       if (ineed % 2 == 0) {
-	nfirst = nlast;
-	nlast = atom->nlocal + atom->nghost;
+        nfirst = nlast;
+        nlast = atom->nlocal + atom->nghost;
       }
 
       nsend = 0;
@@ -948,13 +948,13 @@ void CommCuda::borders_cuda()
      do
      {
        if(nsend>=maxsendlist[iswap]) grow_list(iswap,static_cast <int> (nsend*1.05));
-   	    nsend=Cuda_CommCuda_BuildSendlist(&cuda->shared_data,bordergroup,ineed,style==SINGLE?1:0,atom->nfirst,nfirst,nlast,dim,iswap);
+               nsend=Cuda_CommCuda_BuildSendlist(&cuda->shared_data,bordergroup,ineed,style==SINGLE?1:0,atom->nfirst,nfirst,nlast,dim,iswap);
      }while(nsend>=maxsendlist[iswap]);
       // pack up list of border atoms
 
       if (nsend*size_border > maxsend)
-	grow_send(nsend*size_border,0);
-  
+        grow_send(nsend*size_border,0);
+
       if (ghost_velocity)
         n = avec->pack_border_vel(nsend,&iswap,buf_send,
                            pbc_flag[iswap],pbc[iswap]);
@@ -968,18 +968,18 @@ void CommCuda::borders_cuda()
 
 clock_gettime(CLOCK_REALTIME,&time1);
       if (sendproc[iswap] != me) {
-	MPI_Sendrecv(&nsend,1,MPI_INT,sendproc[iswap],0,
-		     &nrecv,1,MPI_INT,recvproc[iswap],0,world,&status);
-	if (nrecv*size_border > maxrecv) 
-	  grow_recv(nrecv*size_border);
-	MPI_Irecv(buf_recv,nrecv*size_border,MPI_DOUBLE,
-		  recvproc[iswap],0,world,&request);
-	MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	MPI_Wait(&request,&status);
-	buf = buf_recv;
+        MPI_Sendrecv(&nsend,1,MPI_INT,sendproc[iswap],0,
+                     &nrecv,1,MPI_INT,recvproc[iswap],0,world,&status);
+        if (nrecv*size_border > maxrecv)
+          grow_recv(nrecv*size_border);
+        MPI_Irecv(buf_recv,nrecv*size_border,MPI_DOUBLE,
+                  recvproc[iswap],0,world,&request);
+        MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+        MPI_Wait(&request,&status);
+        buf = buf_recv;
       } else {
-	nrecv = nsend;
-	buf = buf_send;
+        nrecv = nsend;
+        buf = buf_send;
       }
 
 clock_gettime(CLOCK_REALTIME,&time2);
@@ -989,9 +989,9 @@ cuda->shared_data.cuda_timings.comm_border_mpi+=
       // unpack buffer
 
       if (ghost_velocity)
-	avec->unpack_border_vel(nrecv,atom->nlocal+atom->nghost,buf);
+        avec->unpack_border_vel(nrecv,atom->nlocal+atom->nghost,buf);
       else
-	avec->unpack_border(nrecv,atom->nlocal+atom->nghost,buf);
+        avec->unpack_border(nrecv,atom->nlocal+atom->nghost,buf);
 
       // set all pointers & counters
 
@@ -1016,14 +1016,14 @@ cuda->shared_data.cuda_timings.comm_border_mpi+=
   if (max > maxrecv) grow_recv(max);
 
   // reset global->local map
-  if(map_style) 
+  if(map_style)
   {
-  	cuda->cu_tag->download();
- 	atom->map_set();
+          cuda->cu_tag->download();
+         atom->map_set();
   }
-  
+
   cuda->setSystemParams();
-  cuda->shared_data.atom.nghost+=n;  
+  cuda->shared_data.atom.nghost+=n;
 }
 
 void CommCuda::borders_cuda_overlap_forward_comm()
@@ -1047,7 +1047,7 @@ void CommCuda::borders_cuda_overlap_forward_comm()
 
   iswap = 0;
   smax = rmax = 0;
-  
+
   cuda->shared_data.comm.nsend=0;
   for (dim = 0; dim < 3; dim++) {
     nlast = 0;
@@ -1062,16 +1062,16 @@ void CommCuda::borders_cuda_overlap_forward_comm()
 
       x = atom->x;
       if (style == SINGLE) {
-	lo = slablo[iswap];
-	hi = slabhi[iswap];
+        lo = slablo[iswap];
+        hi = slabhi[iswap];
       } else {
-	type = atom->type;
-	mlo = multilo[iswap];
-	mhi = multihi[iswap];
+        type = atom->type;
+        mlo = multilo[iswap];
+        mhi = multihi[iswap];
       }
       if (ineed % 2 == 0) {
-	nfirst = nlast;
-	nlast = atom->nlocal + atom->nghost;
+        nfirst = nlast;
+        nlast = atom->nlocal + atom->nghost;
       }
 
       nsend = 0;
@@ -1083,14 +1083,14 @@ void CommCuda::borders_cuda_overlap_forward_comm()
      do
      {
        if(nsend>=maxsendlist[iswap]) grow_list(iswap,static_cast <int> (nsend*1.05));
-   	    nsend=Cuda_CommCuda_BuildSendlist(&cuda->shared_data,bordergroup,ineed,style==SINGLE?1:0,atom->nfirst,nfirst,nlast,dim,iswap);
+               nsend=Cuda_CommCuda_BuildSendlist(&cuda->shared_data,bordergroup,ineed,style==SINGLE?1:0,atom->nfirst,nfirst,nlast,dim,iswap);
      }while(nsend>=maxsendlist[iswap]);
-	 cuda->shared_data.comm.nsend_swap[iswap]=nsend;
-	  // pack up list of border atoms
+         cuda->shared_data.comm.nsend_swap[iswap]=nsend;
+          // pack up list of border atoms
 
       if (nsend*size_border > maxsend)
-	grow_send(nsend*size_border,0);
-  
+        grow_send(nsend*size_border,0);
+
       if (ghost_velocity)
         n = avec->pack_border_vel(nsend,&iswap,buf_send,
                            pbc_flag[iswap],pbc[iswap]);
@@ -1104,18 +1104,18 @@ void CommCuda::borders_cuda_overlap_forward_comm()
 
 clock_gettime(CLOCK_REALTIME,&time1);
       if (sendproc[iswap] != me) {
-	MPI_Sendrecv(&nsend,1,MPI_INT,sendproc[iswap],0,
-		     &nrecv,1,MPI_INT,recvproc[iswap],0,world,&status);
-	if (nrecv*size_border > maxrecv) 
-	  grow_recv(nrecv*size_border);
-	MPI_Irecv(buf_recv,nrecv*size_border,MPI_DOUBLE,
-		  recvproc[iswap],0,world,&request);
-	MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	MPI_Wait(&request,&status);
-	buf = buf_recv;
+        MPI_Sendrecv(&nsend,1,MPI_INT,sendproc[iswap],0,
+                     &nrecv,1,MPI_INT,recvproc[iswap],0,world,&status);
+        if (nrecv*size_border > maxrecv)
+          grow_recv(nrecv*size_border);
+        MPI_Irecv(buf_recv,nrecv*size_border,MPI_DOUBLE,
+                  recvproc[iswap],0,world,&request);
+        MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+        MPI_Wait(&request,&status);
+        buf = buf_recv;
       } else {
-	nrecv = nsend;
-	buf = buf_send;
+        nrecv = nsend;
+        buf = buf_send;
       }
 
 clock_gettime(CLOCK_REALTIME,&time2);
@@ -1125,9 +1125,9 @@ cuda->shared_data.cuda_timings.comm_border_mpi+=
       // unpack buffer
 
       if (ghost_velocity)
-	avec->unpack_border_vel(nrecv,atom->nlocal+atom->nghost,buf);
+        avec->unpack_border_vel(nrecv,atom->nlocal+atom->nghost,buf);
       else
-	avec->unpack_border(nrecv,atom->nlocal+atom->nghost,buf);
+        avec->unpack_border(nrecv,atom->nlocal+atom->nghost,buf);
 
       // set all pointers & counters
 
@@ -1152,14 +1152,14 @@ cuda->shared_data.cuda_timings.comm_border_mpi+=
   if (max > maxrecv) grow_recv(max);
 
   // reset global->local map
-  if(map_style) 
+  if(map_style)
   {
-  	cuda->cu_tag->download();
- 	atom->map_set();
+          cuda->cu_tag->download();
+         atom->map_set();
   }
-  
+
   cuda->setSystemParams();
-  cuda->shared_data.atom.nghost+=n;  
+  cuda->shared_data.atom.nghost+=n;
 }
 
 
@@ -1176,27 +1176,27 @@ void CommCuda::forward_comm_fix(Fix *fix)
     // pack buffer
     if(fix->cudable_comm&&cuda->finished_setup)
     {
-    	int swap=iswap;
+            int swap=iswap;
         if(sendproc[iswap] == me) {swap=-iswap-1; buf=(double*)&(firstrecv[iswap]);}
         else buf=buf_send;
-        
+
         n = fix->pack_comm(sendnum[iswap],&swap,
                         buf,pbc_flag[iswap],pbc[iswap]);
-        if(sendproc[iswap] == me) 
+        if(sendproc[iswap] == me)
         {
-        	continue;
+                continue;
         }
     }
     else
     n = fix->pack_comm(sendnum[iswap],sendlist[iswap],
-		       buf_send,pbc_flag[iswap],pbc[iswap]);
+                       buf_send,pbc_flag[iswap],pbc[iswap]);
 
      // exchange with another proc
     // if self, set recv buffer to send buffer
 
     if (sendproc[iswap] != me) {
       MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
-		world,&request);
+                world,&request);
       MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
       MPI_Wait(&request,&status);
       buf = buf_recv;
@@ -1221,13 +1221,13 @@ void CommCuda::grow_send(int n, int flag)
       if(buf_send) CudaWrapper_FreePinnedHostData((void*) (buf_send));
       buf_send = (double*) CudaWrapper_AllocPinnedHostData((maxsend+BUFEXTRA)*sizeof(double),false);
       memcpy(buf_send,tmp,oldmaxsend*sizeof(double));
-      delete [] tmp;	        	
+      delete [] tmp;
     }
     else
     {
-    buf_send = (double *) 
+    buf_send = (double *)
       memory->srealloc(buf_send,(maxsend+BUFEXTRA)*sizeof(double),
-		       "comm:buf_send");printf("srealloc\n"); 
+                       "comm:buf_send");printf("srealloc\n");
     }
   }
   else {
@@ -1240,7 +1240,7 @@ void CommCuda::grow_send(int n, int flag)
     {
       memory->sfree(buf_send);
       buf_send = (double *) memory->smalloc((maxsend+BUFEXTRA)*sizeof(double),
-					  "comm:buf_send");
+                                          "comm:buf_send");
     }
     for(int i=0;i<maxswap;i++)
     {
@@ -1250,7 +1250,7 @@ void CommCuda::grow_send(int n, int flag)
   }
 }
 /* ----------------------------------------------------------------------
-   free/malloc the size of the recv buffer as needed with BUFFACTOR 
+   free/malloc the size of the recv buffer as needed with BUFFACTOR
 ------------------------------------------------------------------------- */
 
 
@@ -1267,7 +1267,7 @@ void CommCuda::grow_recv(int n)
   {
     memory->sfree(buf_recv);
     buf_recv = (double *) memory->smalloc(maxrecv*sizeof(double),
-					"comm:buf_recv");
+                                        "comm:buf_recv");
   }
   for(int i=0;i<maxswap;i++)
   {
@@ -1277,33 +1277,33 @@ void CommCuda::grow_recv(int n)
 }
 
 /* ----------------------------------------------------------------------
-   realloc the size of the iswap sendlist as needed with BUFFACTOR 
+   realloc the size of the iswap sendlist as needed with BUFFACTOR
 ------------------------------------------------------------------------- */
 
 void CommCuda::grow_list(int iswap, int n)
 {
-  
+
   MYDBG(printf(" # CUDA CommCuda::grow_list\n");)
   if(cuda->finished_setup&&cu_sendlist) cu_sendlist->download();
   if(!cu_sendlist||n*BUFFACTOR>cu_sendlist->get_dim()[1]||n*BUFFACTOR>maxsendlist[iswap])
   {
-  	for(int i=0;i<maxswap;i++)
-  	{
-  	  maxsendlist[i] = static_cast<int> (BUFFACTOR * n);
-  	  sendlist[i] = (int *) 
-    		memory->srealloc(sendlist[i],maxsendlist[i]*sizeof(int),
-		     		"comm:sendlist[iswap]");
-  	}
-  	delete cu_sendlist;
-  	cu_sendlist=new cCudaData<int, int, xy> ((int*)sendlist,maxswap,maxsendlist[iswap]);
-  	cuda->shared_data.comm.sendlist.dev_data=cu_sendlist->dev_data();
+          for(int i=0;i<maxswap;i++)
+          {
+            maxsendlist[i] = static_cast<int> (BUFFACTOR * n);
+            sendlist[i] = (int *)
+                    memory->srealloc(sendlist[i],maxsendlist[i]*sizeof(int),
+                                     "comm:sendlist[iswap]");
+          }
+          delete cu_sendlist;
+          cu_sendlist=new cCudaData<int, int, xy> ((int*)sendlist,maxswap,maxsendlist[iswap]);
+          cuda->shared_data.comm.sendlist.dev_data=cu_sendlist->dev_data();
     cuda->shared_data.comm.maxlistlength=maxsendlist[iswap];
     cu_sendlist->upload();
   }
  }
 
 /* ----------------------------------------------------------------------
-   realloc the buffers needed for swaps 
+   realloc the buffers needed for swaps
 ------------------------------------------------------------------------- */
 
 void CommCuda::grow_swap(int n)
@@ -1313,22 +1313,22 @@ void CommCuda::grow_swap(int n)
   if(n>cu_sendlist->get_dim()[0])
   {
    MYDBG(printf(" # CUDA CommCuda::grow_swap\n");)
-    
-  	delete cu_sendlist;
-  	cu_sendlist=new cCudaData<int, int, xy> ((int*)sendlist,n,BUFMIN);
-  	cuda->shared_data.comm.sendlist.dev_data=cu_sendlist->dev_data();
+
+          delete cu_sendlist;
+          cu_sendlist=new cCudaData<int, int, xy> ((int*)sendlist,n,BUFMIN);
+          cuda->shared_data.comm.sendlist.dev_data=cu_sendlist->dev_data();
     cuda->shared_data.comm.maxlistlength=BUFMIN;
     cuda->shared_data.comm.maxswap=n;
     cuda->shared_data.comm.nsend_swap=new int[n];
     cuda->shared_data.comm.send_size=new int[n];
-    cuda->shared_data.comm.recv_size=new int[n]; 
+    cuda->shared_data.comm.recv_size=new int[n];
   }
   for(int i=0;i<oldmaxswap;i++)
   {
     if(cuda->shared_data.comm.buf_recv_dev[i]) CudaWrapper_FreeCudaData(cuda->shared_data.comm.buf_recv_dev[i],maxrecv*sizeof(double));
     if(cuda->shared_data.comm.buf_send_dev[i]) CudaWrapper_FreeCudaData(cuda->shared_data.comm.buf_send_dev[i],maxsend*sizeof(double));
     cuda->shared_data.comm.buf_recv_dev[i]=NULL;
-    cuda->shared_data.comm.buf_send_dev[i]=NULL;    
+    cuda->shared_data.comm.buf_send_dev[i]=NULL;
   }
   cuda->shared_data.comm.buf_send= new double*[n];
   cuda->shared_data.comm.buf_recv= new double*[n];
@@ -1337,9 +1337,9 @@ void CommCuda::grow_swap(int n)
   for(int i=0;i<n;i++)
   {
     cuda->shared_data.comm.buf_recv[i]=NULL;
-    cuda->shared_data.comm.buf_send[i]=NULL;      	
+    cuda->shared_data.comm.buf_send[i]=NULL;
     cuda->shared_data.comm.buf_recv_dev[i]=NULL;
-    cuda->shared_data.comm.buf_send_dev[i]=NULL;      	
+    cuda->shared_data.comm.buf_send_dev[i]=NULL;
   }
   grow_send(maxsend,0);
   grow_recv(maxrecv);
@@ -1348,28 +1348,28 @@ void CommCuda::grow_swap(int n)
 }
 
 /* ----------------------------------------------------------------------
-   allocation of swap info 
+   allocation of swap info
 ------------------------------------------------------------------------- */
 
 void CommCuda::allocate_swap(int n)
 {
    Comm::allocate_swap(n);
-   
-  	delete cu_pbc;
-  	delete cu_slablo;
-  	delete cu_slabhi;
-  
+
+          delete cu_pbc;
+          delete cu_slablo;
+          delete cu_slabhi;
+
     cuda->shared_data.comm.maxswap=n;
-  	if(cu_sendlist)
-  	{
-  	  cu_pbc=new cCudaData<int, int, xy> ((int*)pbc,n,6);
-  	  cu_slablo = new cCudaData<double, X_FLOAT,x>(slablo,n);
-  	  cu_slabhi = new cCudaData<double, X_FLOAT,x>(slabhi,n);
-  	
-  	  cuda->shared_data.comm.pbc.dev_data=cu_pbc->dev_data();
-  	  cuda->shared_data.comm.slablo.dev_data=cu_slablo->dev_data();
-  	  cuda->shared_data.comm.slabhi.dev_data=cu_slabhi->dev_data();
-  	}
+          if(cu_sendlist)
+          {
+            cu_pbc=new cCudaData<int, int, xy> ((int*)pbc,n,6);
+            cu_slablo = new cCudaData<double, X_FLOAT,x>(slablo,n);
+            cu_slabhi = new cCudaData<double, X_FLOAT,x>(slabhi,n);
+
+            cuda->shared_data.comm.pbc.dev_data=cu_pbc->dev_data();
+            cuda->shared_data.comm.slablo.dev_data=cu_slablo->dev_data();
+            cuda->shared_data.comm.slabhi.dev_data=cu_slabhi->dev_data();
+          }
     cuda->shared_data.comm.nsend_swap=new int[n];
     cuda->shared_data.comm.send_size=new int[n];
     cuda->shared_data.comm.recv_size=new int[n];
@@ -1390,17 +1390,17 @@ void CommCuda::allocate_multi(int n)
 {
   Comm::allocate_multi(n);
 
-  	delete cu_multilo;
-  	delete cu_multihi;
-  	cu_multilo = new cCudaData<double, X_FLOAT,xy>(slablo,n,atom->ntypes+1);
-  	cu_multihi = new cCudaData<double, X_FLOAT,xy>(slabhi,n,atom->ntypes+1);
-  	
-  	cuda->shared_data.comm.multilo.dev_data=cu_multilo->dev_data();
-  	cuda->shared_data.comm.multihi.dev_data=cu_multihi->dev_data();
+          delete cu_multilo;
+          delete cu_multihi;
+          cu_multilo = new cCudaData<double, X_FLOAT,xy>(slablo,n,atom->ntypes+1);
+          cu_multihi = new cCudaData<double, X_FLOAT,xy>(slabhi,n,atom->ntypes+1);
+
+          cuda->shared_data.comm.multilo.dev_data=cu_multilo->dev_data();
+          cuda->shared_data.comm.multihi.dev_data=cu_multihi->dev_data();
 }
 
 /* ----------------------------------------------------------------------
-   free memory for swaps 
+   free memory for swaps
 ------------------------------------------------------------------------- */
 
 void CommCuda::free_swap()
@@ -1417,7 +1417,7 @@ void CommCuda::free_swap()
     if(cuda->shared_data.comm.buf_recv_dev[i]) CudaWrapper_FreeCudaData(cuda->shared_data.comm.buf_recv_dev[i],maxrecv*sizeof(double));
     if(cuda->shared_data.comm.buf_send_dev[i]) CudaWrapper_FreeCudaData(cuda->shared_data.comm.buf_send_dev[i],maxsend*sizeof(double));
   }
-  
+
 
 }
 
@@ -1431,4 +1431,3 @@ void CommCuda::free_multi()
   delete cu_multilo; cu_multilo = NULL;
   delete cu_multihi; cu_multihi = NULL;
 }
-
diff --git a/src/USER-CUDA/comm_cuda.h b/src/USER-CUDA/comm_cuda.h
index 933d7364c1..125441af1b 100644
--- a/src/USER-CUDA/comm_cuda.h
+++ b/src/USER-CUDA/comm_cuda.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -33,7 +33,7 @@ public:
   virtual void forward_comm_pack_cuda();
   virtual void forward_comm_transfer_cuda();
   virtual void forward_comm_unpack_cuda();
-  virtual void forward_comm_pair(Pair *pair);    
+  virtual void forward_comm_pair(Pair *pair);
   virtual void reverse_comm();              // reverse communication of forces
   virtual void exchange();                  // move atoms to new procs
   virtual void exchange_cuda();                  // move atoms to new procs
@@ -43,7 +43,7 @@ public:
   virtual void forward_comm_fix(class Fix *);          // forward comm from a Fix
 
 
-  
+
 
  protected:
   class Cuda *cuda;
@@ -52,7 +52,7 @@ public:
   cCudaData<double, X_FLOAT, x>* cu_slabhi;
   cCudaData<double, X_FLOAT, xy>* cu_multilo;
   cCudaData<double, X_FLOAT, xy>* cu_multihi;
-  
+
   cCudaData<int, int, xy>* cu_sendlist;
   virtual void grow_send(int,int);          // reallocate send buffer
   virtual void grow_recv(int);              // free/allocate recv buffer
diff --git a/src/USER-CUDA/compute_pe_cuda.cpp b/src/USER-CUDA/compute_pe_cuda.cpp
index 0d93aea249..57685e52f3 100644
--- a/src/USER-CUDA/compute_pe_cuda.cpp
+++ b/src/USER-CUDA/compute_pe_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputePECuda::ComputePECuda(LAMMPS *lmp, int narg, char **arg) : 
+ComputePECuda::ComputePECuda(LAMMPS *lmp, int narg, char **arg) :
   ComputePE(lmp, narg, arg)
 {
   cudable = 1;
diff --git a/src/USER-CUDA/compute_pe_cuda.h b/src/USER-CUDA/compute_pe_cuda.h
index 71444f671c..11bb163685 100644
--- a/src/USER-CUDA/compute_pe_cuda.h
+++ b/src/USER-CUDA/compute_pe_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CUDA/compute_pressure_cuda.cpp b/src/USER-CUDA/compute_pressure_cuda.cpp
index 27de7e5850..339374308e 100644
--- a/src/USER-CUDA/compute_pressure_cuda.cpp
+++ b/src/USER-CUDA/compute_pressure_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -66,7 +66,7 @@ ComputePressureCuda::ComputePressureCuda(LAMMPS *lmp, int narg, char **arg) :
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
   cudable = 1;
-  
+
   // store temperature ID used by pressure computation
   // insure it is valid for temperature computation
 
@@ -81,7 +81,7 @@ ComputePressureCuda::ComputePressureCuda(LAMMPS *lmp, int narg, char **arg) :
     error->warning(FLERR,"Compute pressure/cuda temperature ID is not cudable! Try a temp/cuda style.");
     cudable = 0;
   }
-  
+
 }
 
 double ComputePressureCuda::compute_scalar()
diff --git a/src/USER-CUDA/compute_pressure_cuda.h b/src/USER-CUDA/compute_pressure_cuda.h
index d99f4a5cca..f08fbde973 100644
--- a/src/USER-CUDA/compute_pressure_cuda.h
+++ b/src/USER-CUDA/compute_pressure_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CUDA/compute_temp_cuda.cpp b/src/USER-CUDA/compute_temp_cuda.cpp
index 0b560f5366..4830add272 100644
--- a/src/USER-CUDA/compute_temp_cuda.cpp
+++ b/src/USER-CUDA/compute_temp_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTempCuda::ComputeTempCuda(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTempCuda::ComputeTempCuda(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   cuda = lmp->cuda;
@@ -73,7 +73,7 @@ ComputeTempCuda::ComputeTempCuda(LAMMPS *lmp, int narg, char **arg) :
   cu_t_vector = 0;
   cu_t_scalar = 0;
   cudable=true;
-  
+
 }
 
 /* ---------------------------------------------------------------------- */
@@ -112,8 +112,8 @@ double ComputeTempCuda::compute_scalar()
 {
   if(cuda->begin_setup)
   {
-  	if(not cu_t_vector) cu_t_vector = new cCudaData<double, ENERGY_FLOAT, x> (t_vector,6);    
-  	if(not cu_t_scalar) cu_t_scalar = new cCudaData<double, ENERGY_FLOAT, x> (&t_scalar,1);    
+          if(not cu_t_vector) cu_t_vector = new cCudaData<double, ENERGY_FLOAT, x> (t_vector,6);
+          if(not cu_t_scalar) cu_t_scalar = new cCudaData<double, ENERGY_FLOAT, x> (&t_scalar,1);
     invoked_scalar = update->ntimestep;
     Cuda_ComputeTempCuda_Scalar(&cuda->shared_data,groupbit,(ENERGY_FLOAT*) cu_t_scalar->dev_data());
     cu_t_scalar->download();
@@ -134,31 +134,31 @@ double ComputeTempCuda::compute_scalar()
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * rmass[i];
+        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * rmass[i];
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * 
-	  mass[type[i]];
+        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
+          mass[type[i]];
   }
   t_scalar=t;
   }
-  
+
   MPI_Allreduce(&t_scalar,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
   if (dynamic) dof_compute();
   scalar *= tfactor;
-  if(scalar>1e15) 
+  if(scalar>1e15)
   {
-  	cuda->cu_v->download();
-  	cuda->cu_x->download();
-  	cuda->cu_type->download();
+          cuda->cu_v->download();
+          cuda->cu_x->download();
+          cuda->cu_type->download();
     double **v = atom->v;
     double **x = atom->x;
-    printf("Out of v-range atoms:  \n"); 
-  	for(int i=0;i<atom->nlocal;i++) 
-  	if((v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2])>1e5) 
-  	printf("%i %i // %lf %lf %lf // %lf %lf %lf\n",atom->tag[i],atom->type[i],x[i][0], x[i][1], x[i][2],v[i][0], v[i][1], v[i][2]);
-  	error->all(FLERR,"Temperature out of range. Simulations will be abortet.\n");
+    printf("Out of v-range atoms:  \n");
+          for(int i=0;i<atom->nlocal;i++)
+          if((v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2])>1e5)
+          printf("%i %i // %lf %lf %lf // %lf %lf %lf\n",atom->tag[i],atom->type[i],x[i][0], x[i][1], x[i][2],v[i][0], v[i][1], v[i][2]);
+          error->all(FLERR,"Temperature out of range. Simulations will be abortet.\n");
   }
   return scalar;
 }
@@ -170,8 +170,8 @@ void ComputeTempCuda::compute_vector()
   int i;
   if(cuda->begin_setup)
   {
-  if(not cu_t_vector) cu_t_vector = new cCudaData<double, ENERGY_FLOAT, x> (t_vector,6);    
-  if(not cu_t_scalar) cu_t_scalar = new cCudaData<double, ENERGY_FLOAT, x> (&t_scalar,1);    
+  if(not cu_t_vector) cu_t_vector = new cCudaData<double, ENERGY_FLOAT, x> (t_vector,6);
+  if(not cu_t_scalar) cu_t_scalar = new cCudaData<double, ENERGY_FLOAT, x> (&t_scalar,1);
 
   invoked_vector = update->ntimestep;
 
@@ -180,7 +180,7 @@ void ComputeTempCuda::compute_vector()
   }
   else
   {
- 
+
   invoked_vector = update->ntimestep;
 
   double **v = atom->v;
@@ -204,7 +204,7 @@ void ComputeTempCuda::compute_vector()
       t[4] += massone * v[i][0]*v[i][2];
       t[5] += massone * v[i][1]*v[i][2];
     }
-  
+
   for (i = 0; i < 6; i++) t_vector[i]=t[i];
   }
   MPI_Allreduce(t_vector,vector,6,MPI_DOUBLE,MPI_SUM,world);
diff --git a/src/USER-CUDA/compute_temp_cuda.h b/src/USER-CUDA/compute_temp_cuda.h
index 35ae0bbf3f..df7559d048 100644
--- a/src/USER-CUDA/compute_temp_cuda.h
+++ b/src/USER-CUDA/compute_temp_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,9 +64,9 @@ class ComputeTempCuda : public Compute {
   void dof_compute();
   double t_vector[6];
   double t_scalar;
-  cCudaData<double     , ENERGY_FLOAT   		, x>* cu_t_scalar;	
-  cCudaData<double     , ENERGY_FLOAT   		, x>* cu_t_vector;	
-  
+  cCudaData<double     , ENERGY_FLOAT                   , x>* cu_t_scalar;
+  cCudaData<double     , ENERGY_FLOAT                   , x>* cu_t_vector;
+
 };
 
 }
diff --git a/src/USER-CUDA/compute_temp_partial_cuda.cpp b/src/USER-CUDA/compute_temp_partial_cuda.cpp
index e39484c835..c3ac1b4d89 100644
--- a/src/USER-CUDA/compute_temp_partial_cuda.cpp
+++ b/src/USER-CUDA/compute_temp_partial_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -55,7 +55,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTempPartialCuda::ComputeTempPartialCuda(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTempPartialCuda::ComputeTempPartialCuda(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   cuda = lmp->cuda;
@@ -70,7 +70,7 @@ ComputeTempPartialCuda::ComputeTempPartialCuda(LAMMPS *lmp, int narg, char **arg
   extvector = 1;
   tempflag = 1;
   tempbias = 1;
-  
+
   xflag = atoi(arg[3]);
   yflag = atoi(arg[4]);
   zflag = atoi(arg[5]);
@@ -85,7 +85,7 @@ ComputeTempPartialCuda::ComputeTempPartialCuda(LAMMPS *lmp, int narg, char **arg
   cu_t_scalar = 0;
   cu_vbiasall=NULL;
   cudable=true;
-  
+
 }
 
 /* ---------------------------------------------------------------------- */
@@ -135,8 +135,8 @@ double ComputeTempPartialCuda::compute_scalar()
 {
   if(cuda->begin_setup)
   {
-  	if(not cu_t_vector) cu_t_vector = new cCudaData<double, ENERGY_FLOAT, x> (t_vector,6);    
-  	if(not cu_t_scalar) cu_t_scalar = new cCudaData<double, ENERGY_FLOAT, x> (&t_scalar,1);    
+          if(not cu_t_vector) cu_t_vector = new cCudaData<double, ENERGY_FLOAT, x> (t_vector,6);
+          if(not cu_t_scalar) cu_t_scalar = new cCudaData<double, ENERGY_FLOAT, x> (&t_scalar,1);
     invoked_scalar = update->ntimestep;
     Cuda_ComputeTempPartialCuda_Scalar(&cuda->shared_data,groupbit,(ENERGY_FLOAT*) cu_t_scalar->dev_data(),xflag,yflag,zflag);
     cu_t_scalar->download();
@@ -157,31 +157,31 @@ double ComputeTempPartialCuda::compute_scalar()
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	t += (xflag*v[i][0]*v[i][0] + yflag*v[i][1]*v[i][1] + zflag*v[i][2]*v[i][2]) * rmass[i];
+        t += (xflag*v[i][0]*v[i][0] + yflag*v[i][1]*v[i][1] + zflag*v[i][2]*v[i][2]) * rmass[i];
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	t += (xflag*v[i][0]*v[i][0] + yflag*v[i][1]*v[i][1] + zflag*v[i][2]*v[i][2]) * 
-	  mass[type[i]];
+        t += (xflag*v[i][0]*v[i][0] + yflag*v[i][1]*v[i][1] + zflag*v[i][2]*v[i][2]) *
+          mass[type[i]];
   }
   t_scalar=t;
   }
-  
+
   MPI_Allreduce(&t_scalar,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
   if (dynamic) dof_compute();
   scalar *= tfactor;
-  if(scalar>1e15) 
+  if(scalar>1e15)
   {
-  	cuda->cu_v->download();
-  	cuda->cu_x->download();
-  	cuda->cu_type->download();
+          cuda->cu_v->download();
+          cuda->cu_x->download();
+          cuda->cu_type->download();
     double **v = atom->v;
     double **x = atom->x;
-    printf("Out of v-range atoms:  \n"); 
-  	for(int i=0;i<atom->nlocal;i++) 
-  	if((v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2])>1e5) 
-  	printf("%i %i // %lf %lf %lf // %lf %lf %lf\n",atom->tag[i],atom->type[i],x[i][0], x[i][1], x[i][2],v[i][0], v[i][1], v[i][2]);
-  	error->all(FLERR,"Temperature out of range. Simulations will be abortet.\n");
+    printf("Out of v-range atoms:  \n");
+          for(int i=0;i<atom->nlocal;i++)
+          if((v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2])>1e5)
+          printf("%i %i // %lf %lf %lf // %lf %lf %lf\n",atom->tag[i],atom->type[i],x[i][0], x[i][1], x[i][2],v[i][0], v[i][1], v[i][2]);
+          error->all(FLERR,"Temperature out of range. Simulations will be abortet.\n");
   }
   return scalar;
 }
@@ -193,8 +193,8 @@ void ComputeTempPartialCuda::compute_vector()
   int i;
   if(cuda->begin_setup)
   {
-  if(not cu_t_vector) cu_t_vector = new cCudaData<double, ENERGY_FLOAT, x> (t_vector,6);    
-  if(not cu_t_scalar) cu_t_scalar = new cCudaData<double, ENERGY_FLOAT, x> (&t_scalar,1);    
+  if(not cu_t_vector) cu_t_vector = new cCudaData<double, ENERGY_FLOAT, x> (t_vector,6);
+  if(not cu_t_scalar) cu_t_scalar = new cCudaData<double, ENERGY_FLOAT, x> (&t_scalar,1);
 
   invoked_vector = update->ntimestep;
 
@@ -203,7 +203,7 @@ void ComputeTempPartialCuda::compute_vector()
   }
   else
   {
- 
+
   invoked_vector = update->ntimestep;
 
   double **v = atom->v;
@@ -227,7 +227,7 @@ void ComputeTempPartialCuda::compute_vector()
       t[4] += massone * xflag*zflag*v[i][0]*v[i][2];
       t[5] += massone * yflag*zflag*v[i][1]*v[i][2];
     }
-  
+
   for (i = 0; i < 6; i++) t_vector[i]=t[i];
   }
   MPI_Allreduce(t_vector,vector,6,MPI_DOUBLE,MPI_SUM,world);
@@ -268,34 +268,34 @@ void ComputeTempPartialCuda::remove_bias_all()
     memory->destroy(vbiasall);
     maxbias = atom->nmax;
     memory->create(vbiasall,maxbias,3,"temp/partial:vbiasall");
-	delete cu_vbiasall;
-	cu_vbiasall = new cCudaData<double, V_FLOAT, yx> ((double*)vbiasall, atom->nmax, 3);
+        delete cu_vbiasall;
+        cu_vbiasall = new cCudaData<double, V_FLOAT, yx> ((double*)vbiasall, atom->nmax, 3);
   }
   if(cuda->begin_setup)
   {
-  		Cuda_ComputeTempPartialCuda_RemoveBiasAll(&cuda->shared_data,groupbit,xflag,yflag,zflag,cu_vbiasall->dev_data());
+                  Cuda_ComputeTempPartialCuda_RemoveBiasAll(&cuda->shared_data,groupbit,xflag,yflag,zflag,cu_vbiasall->dev_data());
   }
   else
   {
   if (!xflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	vbiasall[i][0] = v[i][0];
-	v[i][0] = 0.0;
+        vbiasall[i][0] = v[i][0];
+        v[i][0] = 0.0;
       }
   }
   if (!yflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	vbiasall[i][1] = v[i][1];
-	v[i][1] = 0.0;
+        vbiasall[i][1] = v[i][1];
+        v[i][1] = 0.0;
       }
   }
   if (!zflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	vbiasall[i][2] = v[i][2];
-	v[i][2] = 0.0;
+        vbiasall[i][2] = v[i][2];
+        v[i][2] = 0.0;
       }
   }
   }
@@ -325,7 +325,7 @@ void ComputeTempPartialCuda::restore_bias_all()
   int nlocal = atom->nlocal;
   if(cuda->begin_setup)
   {
-  		Cuda_ComputeTempPartialCuda_RestoreBiasAll(&cuda->shared_data,groupbit,xflag,yflag,zflag,cu_vbiasall->dev_data());
+                  Cuda_ComputeTempPartialCuda_RestoreBiasAll(&cuda->shared_data,groupbit,xflag,yflag,zflag,cu_vbiasall->dev_data());
   }
   else
   {
@@ -333,17 +333,17 @@ void ComputeTempPartialCuda::restore_bias_all()
   if (!xflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	v[i][0] += vbiasall[i][0];
+        v[i][0] += vbiasall[i][0];
   }
   if (!yflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	v[i][1] += vbiasall[i][1];
+        v[i][1] += vbiasall[i][1];
   }
   if (!zflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	v[i][2] += vbiasall[i][2];
+        v[i][2] += vbiasall[i][2];
   }
   }
 }
diff --git a/src/USER-CUDA/compute_temp_partial_cuda.h b/src/USER-CUDA/compute_temp_partial_cuda.h
index 4412adc88a..f7d34b8ce9 100644
--- a/src/USER-CUDA/compute_temp_partial_cuda.h
+++ b/src/USER-CUDA/compute_temp_partial_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -72,8 +72,8 @@ class ComputeTempPartialCuda : public Compute {
   void dof_compute();
   double t_vector[6];
   double t_scalar;
-  cCudaData<double     , ENERGY_FLOAT   		, x>* cu_t_scalar;	
-  cCudaData<double     , ENERGY_FLOAT   		, x>* cu_t_vector;	
+  cCudaData<double     , ENERGY_FLOAT                   , x>* cu_t_scalar;
+  cCudaData<double     , ENERGY_FLOAT                   , x>* cu_t_vector;
   cCudaData<double, V_FLOAT, yx>* cu_vbiasall;
 };
 
diff --git a/src/USER-CUDA/cuda.cpp b/src/USER-CUDA/cuda.cpp
index 50c896fbba..723f5f8f08 100644
--- a/src/USER-CUDA/cuda.cpp
+++ b/src/USER-CUDA/cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -50,362 +50,362 @@ using namespace LAMMPS_NS;
 
 Cuda::Cuda(LAMMPS *lmp) : Pointers(lmp)
 {
-	cuda_exists=true;
-	lmp->cuda=this;
-	if(universe->me==0)
-	printf("# Using LAMMPS_CUDA \n");
-	shared_data.me=universe->me;
-	device_set=false;
-	
-	Cuda_Cuda_GetCompileSettings(&shared_data);
-	
-	if(shared_data.compile_settings.prec_glob!=sizeof(CUDA_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: Global Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_glob, sizeof(CUDA_FLOAT)/4);
-	if(shared_data.compile_settings.prec_x!=sizeof(X_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: X Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_x, sizeof(X_FLOAT)/4);
-	if(shared_data.compile_settings.prec_v!=sizeof(V_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: V Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_v, sizeof(V_FLOAT)/4);
-	if(shared_data.compile_settings.prec_f!=sizeof(F_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: F Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_f, sizeof(F_FLOAT)/4);
-	if(shared_data.compile_settings.prec_pppm!=sizeof(PPPM_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: PPPM Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_pppm, sizeof(PPPM_FLOAT)/4);
-	if(shared_data.compile_settings.prec_fft!=sizeof(FFT_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: FFT Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_fft, sizeof(FFT_FLOAT)/4);
+        cuda_exists=true;
+        lmp->cuda=this;
+        if(universe->me==0)
+        printf("# Using LAMMPS_CUDA \n");
+        shared_data.me=universe->me;
+        device_set=false;
+
+        Cuda_Cuda_GetCompileSettings(&shared_data);
+
+        if(shared_data.compile_settings.prec_glob!=sizeof(CUDA_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: Global Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_glob, sizeof(CUDA_FLOAT)/4);
+        if(shared_data.compile_settings.prec_x!=sizeof(X_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: X Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_x, sizeof(X_FLOAT)/4);
+        if(shared_data.compile_settings.prec_v!=sizeof(V_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: V Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_v, sizeof(V_FLOAT)/4);
+        if(shared_data.compile_settings.prec_f!=sizeof(F_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: F Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_f, sizeof(F_FLOAT)/4);
+        if(shared_data.compile_settings.prec_pppm!=sizeof(PPPM_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: PPPM Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_pppm, sizeof(PPPM_FLOAT)/4);
+        if(shared_data.compile_settings.prec_fft!=sizeof(FFT_FLOAT)/4) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: FFT Precision: cuda %i cpp %i\n\n",shared_data.compile_settings.prec_fft, sizeof(FFT_FLOAT)/4);
     #ifdef FFT_CUFFT
       if(shared_data.compile_settings.cufft!=1) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: cufft: cuda %i cpp %i\n\n",shared_data.compile_settings.cufft, 1);
-    #else	
+    #else
       if(shared_data.compile_settings.cufft!=0) printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: cufft: cuda %i cpp %i\n\n",shared_data.compile_settings.cufft, 0);
     #endif
-    
+
     if(shared_data.compile_settings.arch!=CUDA_ARCH)  printf("\n\n # CUDA WARNING: Compile Settings of cuda and cpp code differ! \n # CUDA WARNING: arch: cuda %i cpp %i\n\n",shared_data.compile_settings.cufft, CUDA_ARCH);
-	
-	cu_x          = 0;
-	cu_v          = 0;
-	cu_f          = 0;
-	cu_tag        = 0;
-	cu_type       = 0;
-	cu_mask       = 0;
-	cu_image      = 0;
-	cu_xhold      = 0;
-	cu_q          = 0;
-	cu_rmass      = 0;
-	cu_mass       = 0;
-	cu_virial     = 0;
-	cu_eatom      = 0;
-	cu_vatom      = 0;
-	cu_radius	  = 0;
-	cu_density	  = 0;
-	cu_omega	  = 0;
-	cu_torque	  = 0;
-	
-	cu_special 	  = 0;
-	cu_nspecial   = 0;
-	
-	cu_molecule   = 0;
-	
-	cu_x_type 	  = 0;
-	x_type		  = 0;
-	cu_v_radius	  = 0;
-	v_radius	  = 0;
-	cu_omega_rmass	  = 0;
-	omega_rmass	  = 0;
-	
-	binned_id = 0;
-	cu_binned_id  = 0;
-	binned_idnew = 0;
-	cu_binned_idnew = 0;
-	
-	cu_map_array = 0;
-	
-	copy_buffer=0;
-	copy_buffersize=0;
-	
-	neighbor_decide_by_integrator=0;
-	pinned=true;
-	
-	debugdata=0;
-	new int[2*CUDA_MAX_DEBUG_SIZE];
-	
-	finished_setup = false;
-	begin_setup = false;
-	finished_run = false;
-
-	setSharedDataZero();
-	
-	uploadtime=0;
-	downloadtime=0;
-	dotiming=false;
+
+        cu_x          = 0;
+        cu_v          = 0;
+        cu_f          = 0;
+        cu_tag        = 0;
+        cu_type       = 0;
+        cu_mask       = 0;
+        cu_image      = 0;
+        cu_xhold      = 0;
+        cu_q          = 0;
+        cu_rmass      = 0;
+        cu_mass       = 0;
+        cu_virial     = 0;
+        cu_eatom      = 0;
+        cu_vatom      = 0;
+        cu_radius          = 0;
+        cu_density          = 0;
+        cu_omega          = 0;
+        cu_torque          = 0;
+
+        cu_special           = 0;
+        cu_nspecial   = 0;
+
+        cu_molecule   = 0;
+
+        cu_x_type           = 0;
+        x_type                  = 0;
+        cu_v_radius          = 0;
+        v_radius          = 0;
+        cu_omega_rmass          = 0;
+        omega_rmass          = 0;
+
+        binned_id = 0;
+        cu_binned_id  = 0;
+        binned_idnew = 0;
+        cu_binned_idnew = 0;
+
+        cu_map_array = 0;
+
+        copy_buffer=0;
+        copy_buffersize=0;
+
+        neighbor_decide_by_integrator=0;
+        pinned=true;
+
+        debugdata=0;
+        new int[2*CUDA_MAX_DEBUG_SIZE];
+
+        finished_setup = false;
+        begin_setup = false;
+        finished_run = false;
+
+        setSharedDataZero();
+
+        uploadtime=0;
+        downloadtime=0;
+        dotiming=false;
 
   dotestatom = false;
   testatom = 0;
-	oncpu = true;
+        oncpu = true;
 
   self_comm = 0;
-	MYDBG( printf("# CUDA: Cuda::Cuda Done...\n");)
-	//cCudaData<double, float, yx >  
+        MYDBG( printf("# CUDA: Cuda::Cuda Done...\n");)
+        //cCudaData<double, float, yx >
 }
 
 Cuda::~Cuda()
 {
-	
-	print_timings();
-	
-	if(universe->me==0) printf("# CUDA: Free memory...\n");
-	
-	delete cu_q;
-	delete cu_x;
-	delete cu_v;
-	delete cu_f;
-	delete cu_tag;
-	delete cu_type;
-	delete cu_mask;
-	delete cu_image;
-	delete cu_xhold;
-	delete cu_mass;
-	delete cu_rmass;
-	delete cu_virial;
-	delete cu_eng_vdwl;
-	delete cu_eng_coul;
-	delete cu_eatom;
-	delete cu_vatom;
-	delete cu_radius;
-	delete cu_density;
-	delete cu_omega;
-	delete cu_torque;
-	delete cu_molecule;
-	
-	delete cu_x_type;
-	delete [] x_type;
-	delete cu_v_radius;
-	delete [] v_radius;
-	delete cu_omega_rmass;
-	delete [] omega_rmass;
-	
-	delete cu_map_array;
-	
-	std::map<NeighList*, CudaNeighList*>::iterator p = neigh_lists.begin();
-	while(p != neigh_lists.end())
-	{
-		delete p->second;
-		++p;
-	}
+
+        print_timings();
+
+        if(universe->me==0) printf("# CUDA: Free memory...\n");
+
+        delete cu_q;
+        delete cu_x;
+        delete cu_v;
+        delete cu_f;
+        delete cu_tag;
+        delete cu_type;
+        delete cu_mask;
+        delete cu_image;
+        delete cu_xhold;
+        delete cu_mass;
+        delete cu_rmass;
+        delete cu_virial;
+        delete cu_eng_vdwl;
+        delete cu_eng_coul;
+        delete cu_eatom;
+        delete cu_vatom;
+        delete cu_radius;
+        delete cu_density;
+        delete cu_omega;
+        delete cu_torque;
+        delete cu_molecule;
+
+        delete cu_x_type;
+        delete [] x_type;
+        delete cu_v_radius;
+        delete [] v_radius;
+        delete cu_omega_rmass;
+        delete [] omega_rmass;
+
+        delete cu_map_array;
+
+        std::map<NeighList*, CudaNeighList*>::iterator p = neigh_lists.begin();
+        while(p != neigh_lists.end())
+        {
+                delete p->second;
+                ++p;
+        }
 }
 
 void Cuda::accelerator(int narg, char** arg)
 {
-	if(device_set) return;
-	if(universe->me==0)
-	printf("# CUDA: Activate GPU \n");
-	
-	int* devicelist=NULL;
-	int pppn=2;
+        if(device_set) return;
+        if(universe->me==0)
+        printf("# CUDA: Activate GPU \n");
+
+        int* devicelist=NULL;
+        int pppn=2;
     for(int i=0;i<narg;i++)
-	{
-	  if(strcmp(arg[i],"gpu/node")==0) 
-	  {
-	    if(++i==narg) 
-	      error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number after 'gpu/node' option."); 
-	    pppn=atoi(arg[i]);
-	  } 
-
-	  if(strcmp(arg[i],"gpu/node/special")==0) 
-	  {
-	    if(++i==narg) 
-	      error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting number of GPUs to be used per node after keyword 'gpu/node/special'."); 
-	    pppn=atoi(arg[i]);
-	    if(pppn<1) error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting number of GPUs to be used per node after keyword 'gpu/node special'."); 
-	    if(i+pppn==narg) 
-	      error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting list of device ids after keyword 'gpu/node special'."); 
-	    devicelist=new int[pppn];
-	    for(int k=0;k<pppn;k++)
-	      {i++;devicelist[k]=atoi(arg[i]);}
-	  }
-
-	  if(strcmp(arg[i],"pinned")==0) 
-	  {
-	  	if(++i==narg) 
-	  	  error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number after 'pinned' option."); 
-	    pinned=atoi(arg[i])==0?false:true;
+        {
+          if(strcmp(arg[i],"gpu/node")==0)
+          {
+            if(++i==narg)
+              error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number after 'gpu/node' option.");
+            pppn=atoi(arg[i]);
+          }
+
+          if(strcmp(arg[i],"gpu/node/special")==0)
+          {
+            if(++i==narg)
+              error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting number of GPUs to be used per node after keyword 'gpu/node/special'.");
+            pppn=atoi(arg[i]);
+            if(pppn<1) error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting number of GPUs to be used per node after keyword 'gpu/node special'.");
+            if(i+pppn==narg)
+              error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting list of device ids after keyword 'gpu/node special'.");
+            devicelist=new int[pppn];
+            for(int k=0;k<pppn;k++)
+              {i++;devicelist[k]=atoi(arg[i]);}
+          }
+
+          if(strcmp(arg[i],"pinned")==0)
+          {
+                  if(++i==narg)
+                    error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number after 'pinned' option.");
+            pinned=atoi(arg[i])==0?false:true;
             if((pinned==false)&&(universe->me==0)) printf(" #CUDA: Pinned memory is not used for communication\n");
-	  }
-
-	  if(strcmp(arg[i],"timing")==0) 
-	  {
-	  	dotiming=true;
-	  }
-
-	  if(strcmp(arg[i],"suffix")==0) 
-	  {
-	  	if(++i==narg) 
-	  	  error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a string after 'suffix' option."); 
-	  	strcpy(lmp->suffix,arg[i]);
-	  }
-
-	  if(strcmp(arg[i],"overlap_comm")==0) 
-	  {
-	  	shared_data.overlap_comm=1;
-	  }
-
-	  if(strcmp(arg[i],"test")==0) 
-	  {
-	  	if(++i==narg) 
-	  	  error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number after 'test' option."); 
-	    testatom=atof(arg[i]);
-	    dotestatom=true;
-	  }
-
-	  if(strcmp(arg[i],"override/bpa")==0) 
-	  {
-	  	if(++i==narg) 
-	  	  error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number after 'override/bpa' option."); 
-	      shared_data.pair.override_block_per_atom = atoi(arg[i]);
-	  }
-	}
-
-	CudaWrapper_Init(0, (char**)0,universe->me,pppn,devicelist);
-	//if(shared_data.overlap_comm)
-	  	CudaWrapper_AddStreams(3);
-	cu_x          = 0;
-	cu_v          = 0;
-	cu_f          = 0;
-	cu_tag        = 0;
-	cu_type       = 0;
-	cu_mask       = 0;
-	cu_image      = 0;
-	cu_xhold      = 0;
-	cu_q          = 0;
-	cu_rmass      = 0;
-	cu_mass       = 0;
-	cu_virial     = 0;
-	cu_eatom      = 0;
-	cu_vatom      = 0;
-	cu_radius	    = 0;
-	cu_density	  = 0;
-	cu_omega	    = 0;
-	cu_torque	    = 0;
-	
-	cu_special 	  = 0;
-	cu_nspecial   = 0;
-	
-	cu_molecule   = 0;
-	
-	cu_x_type 	  = 0;
-	cu_v_radius	  = 0;
-	cu_omega_rmass	  = 0;
-	
-	cu_binned_id  = 0;
-	cu_binned_idnew = 0;
-	device_set=true;
-	allocate();
-	delete devicelist;
+          }
+
+          if(strcmp(arg[i],"timing")==0)
+          {
+                  dotiming=true;
+          }
+
+          if(strcmp(arg[i],"suffix")==0)
+          {
+                  if(++i==narg)
+                    error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a string after 'suffix' option.");
+                  strcpy(lmp->suffix,arg[i]);
+          }
+
+          if(strcmp(arg[i],"overlap_comm")==0)
+          {
+                  shared_data.overlap_comm=1;
+          }
+
+          if(strcmp(arg[i],"test")==0)
+          {
+                  if(++i==narg)
+                    error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number after 'test' option.");
+            testatom=atof(arg[i]);
+            dotestatom=true;
+          }
+
+          if(strcmp(arg[i],"override/bpa")==0)
+          {
+                  if(++i==narg)
+                    error->all(FLERR,"Invalid Options for 'accelerator' command. Expecting a number after 'override/bpa' option.");
+              shared_data.pair.override_block_per_atom = atoi(arg[i]);
+          }
+        }
+
+        CudaWrapper_Init(0, (char**)0,universe->me,pppn,devicelist);
+        //if(shared_data.overlap_comm)
+                  CudaWrapper_AddStreams(3);
+        cu_x          = 0;
+        cu_v          = 0;
+        cu_f          = 0;
+        cu_tag        = 0;
+        cu_type       = 0;
+        cu_mask       = 0;
+        cu_image      = 0;
+        cu_xhold      = 0;
+        cu_q          = 0;
+        cu_rmass      = 0;
+        cu_mass       = 0;
+        cu_virial     = 0;
+        cu_eatom      = 0;
+        cu_vatom      = 0;
+        cu_radius            = 0;
+        cu_density          = 0;
+        cu_omega            = 0;
+        cu_torque            = 0;
+
+        cu_special           = 0;
+        cu_nspecial   = 0;
+
+        cu_molecule   = 0;
+
+        cu_x_type           = 0;
+        cu_v_radius          = 0;
+        cu_omega_rmass          = 0;
+
+        cu_binned_id  = 0;
+        cu_binned_idnew = 0;
+        device_set=true;
+        allocate();
+        delete devicelist;
 }
 
 void Cuda::setSharedDataZero()
 {
-	MYDBG(printf("# CUDA: Cuda::setSharedDataZero ...\n");)
-	shared_data.atom.nlocal = 0;
-	shared_data.atom.nghost = 0;
-	shared_data.atom.nall = 0;
-	shared_data.atom.nmax = 0;
-	shared_data.atom.ntypes = 0;
-	shared_data.atom.q_flag = 0;
-	shared_data.atom.need_eatom = 0;
-	shared_data.atom.need_vatom = 0;
+        MYDBG(printf("# CUDA: Cuda::setSharedDataZero ...\n");)
+        shared_data.atom.nlocal = 0;
+        shared_data.atom.nghost = 0;
+        shared_data.atom.nall = 0;
+        shared_data.atom.nmax = 0;
+        shared_data.atom.ntypes = 0;
+        shared_data.atom.q_flag = 0;
+        shared_data.atom.need_eatom = 0;
+        shared_data.atom.need_vatom = 0;
   shared_data.atom.update_nmax = 1;
   shared_data.atom.update_nlocal = 1;
   shared_data.atom.update_neigh = 1;
-	
+
   shared_data.pair.cudable_force = 0;
-	shared_data.pair.collect_forces_later = 0;
-	shared_data.pair.use_block_per_atom = 0;
-	shared_data.pair.override_block_per_atom = -1;
-	shared_data.pair.cut = 0;
-	shared_data.pair.cutsq = 0;
-	shared_data.pair.cut_inner = 0;
-	shared_data.pair.cut_coul = 0;
-	shared_data.pair.special_lj = 0;
-	shared_data.pair.special_coul = 0;
-	
-	shared_data.pair.neighall = false;
-	
-	shared_data.pppm.cudable_force = 0;
-	
-	shared_data.buffersize = 0;
-	shared_data.buffer_new = 1;
-	shared_data.buffer = NULL;
-	
-	shared_data.comm.comm_phase=0;
-	shared_data.overlap_comm=0;
-
-	shared_data.comm.buffer = NULL;
-	shared_data.comm.buffer_size=0;
-	shared_data.comm.overlap_split_ratio=0;
+        shared_data.pair.collect_forces_later = 0;
+        shared_data.pair.use_block_per_atom = 0;
+        shared_data.pair.override_block_per_atom = -1;
+        shared_data.pair.cut = 0;
+        shared_data.pair.cutsq = 0;
+        shared_data.pair.cut_inner = 0;
+        shared_data.pair.cut_coul = 0;
+        shared_data.pair.special_lj = 0;
+        shared_data.pair.special_coul = 0;
+
+        shared_data.pair.neighall = false;
+
+        shared_data.pppm.cudable_force = 0;
+
+        shared_data.buffersize = 0;
+        shared_data.buffer_new = 1;
+        shared_data.buffer = NULL;
+
+        shared_data.comm.comm_phase=0;
+        shared_data.overlap_comm=0;
+
+        shared_data.comm.buffer = NULL;
+        shared_data.comm.buffer_size=0;
+        shared_data.comm.overlap_split_ratio=0;
    // setTimingsZero();
 }
 
 void Cuda::allocate()
 {
-	accelerator(0,NULL);
-	MYDBG(printf("# CUDA: Cuda::allocate ...\n");)
-	if(not cu_virial)
-	{
-	  cu_virial    = new cCudaData<double, ENERGY_FLOAT, x > (NULL, & shared_data.pair.virial , 6);
-	  cu_eng_vdwl  = new cCudaData<double, ENERGY_FLOAT, x > (NULL, & shared_data.pair.eng_vdwl ,1);
-	  cu_eng_coul  = new cCudaData<double, ENERGY_FLOAT, x > (NULL, & shared_data.pair.eng_coul ,1);
-	  cu_extent 	 = new cCudaData<double, double, x> (extent, 6);
-	  shared_data.flag = CudaWrapper_AllocCudaData(sizeof(int));
-	  int size=2*CUDA_MAX_DEBUG_SIZE;
-	  debugdata = new int[size];
-	  cu_debugdata    = new cCudaData<int, int, x > (debugdata , size);
-	  shared_data.debugdata=cu_debugdata->dev_data();
-	}
-	checkResize();
-	setSystemParams();
-	MYDBG(printf("# CUDA: Cuda::allocate done...\n");)
+        accelerator(0,NULL);
+        MYDBG(printf("# CUDA: Cuda::allocate ...\n");)
+        if(not cu_virial)
+        {
+          cu_virial    = new cCudaData<double, ENERGY_FLOAT, x > (NULL, & shared_data.pair.virial , 6);
+          cu_eng_vdwl  = new cCudaData<double, ENERGY_FLOAT, x > (NULL, & shared_data.pair.eng_vdwl ,1);
+          cu_eng_coul  = new cCudaData<double, ENERGY_FLOAT, x > (NULL, & shared_data.pair.eng_coul ,1);
+          cu_extent          = new cCudaData<double, double, x> (extent, 6);
+          shared_data.flag = CudaWrapper_AllocCudaData(sizeof(int));
+          int size=2*CUDA_MAX_DEBUG_SIZE;
+          debugdata = new int[size];
+          cu_debugdata    = new cCudaData<int, int, x > (debugdata , size);
+          shared_data.debugdata=cu_debugdata->dev_data();
+        }
+        checkResize();
+        setSystemParams();
+        MYDBG(printf("# CUDA: Cuda::allocate done...\n");)
 }
 
 void Cuda::setSystemParams()
 {
     MYDBG(printf("# CUDA: Cuda::setSystemParams ...\n");)
-	shared_data.atom.nlocal = atom->nlocal;
-	shared_data.atom.nghost = atom->nghost;
-	shared_data.atom.nall = atom->nlocal + atom->nghost;
-	shared_data.atom.ntypes = atom->ntypes;
-	shared_data.atom.q_flag = atom->q_flag;
-	shared_data.atom.rmass_flag = atom->rmass_flag;
+        shared_data.atom.nlocal = atom->nlocal;
+        shared_data.atom.nghost = atom->nghost;
+        shared_data.atom.nall = atom->nlocal + atom->nghost;
+        shared_data.atom.ntypes = atom->ntypes;
+        shared_data.atom.q_flag = atom->q_flag;
+        shared_data.atom.rmass_flag = atom->rmass_flag;
     MYDBG(printf("# CUDA: Cuda::setSystemParams done ...\n");)
 }
 
 void Cuda::setDomainParams()
 {
     MYDBG(printf("# CUDA: Cuda::setDomainParams ...\n");)
- 	cuda_shared_domain* cu_domain = &shared_data.domain;
- 
+         cuda_shared_domain* cu_domain = &shared_data.domain;
+
     cu_domain->triclinic = domain->triclinic;
-	for(short i=0; i<3; ++i)
-	{
-		cu_domain->periodicity[i] = domain->periodicity[i];
-		cu_domain->sublo[i] = domain->sublo[i];
-		cu_domain->subhi[i] = domain->subhi[i];
-		cu_domain->boxlo[i] = domain->boxlo[i];
-		cu_domain->boxhi[i] = domain->boxhi[i];
-		cu_domain->prd[i] = domain->prd[i];
-	}
-	if(domain->triclinic)
+        for(short i=0; i<3; ++i)
+        {
+                cu_domain->periodicity[i] = domain->periodicity[i];
+                cu_domain->sublo[i] = domain->sublo[i];
+                cu_domain->subhi[i] = domain->subhi[i];
+                cu_domain->boxlo[i] = domain->boxlo[i];
+                cu_domain->boxhi[i] = domain->boxhi[i];
+                cu_domain->prd[i] = domain->prd[i];
+        }
+        if(domain->triclinic)
     {
-	  for(short i=0; i<3; ++i)
-	  {
-	    cu_domain->boxlo_lamda[i] = domain->boxlo_lamda[i];
-	    cu_domain->boxhi_lamda[i] = domain->boxhi_lamda[i];
-	    cu_domain->prd_lamda[i] = domain->prd_lamda[i];
-	  }
-	  cu_domain->xy = domain->xy;
-	  cu_domain->xz = domain->xz;
-	  cu_domain->yz = domain->yz;
-	}
-
-    for(int i=0;i<6;i++) 
-	{
-	  cu_domain->h[i]=domain->h[i];
-	  cu_domain->h_inv[i]=domain->h_inv[i];
-	  cu_domain->h_rate[i]=domain->h_rate[i];
-	}
-	
-	cu_domain->update=2;
+          for(short i=0; i<3; ++i)
+          {
+            cu_domain->boxlo_lamda[i] = domain->boxlo_lamda[i];
+            cu_domain->boxhi_lamda[i] = domain->boxhi_lamda[i];
+            cu_domain->prd_lamda[i] = domain->prd_lamda[i];
+          }
+          cu_domain->xy = domain->xy;
+          cu_domain->xz = domain->xz;
+          cu_domain->yz = domain->yz;
+        }
+
+    for(int i=0;i<6;i++)
+        {
+          cu_domain->h[i]=domain->h[i];
+          cu_domain->h_inv[i]=domain->h_inv[i];
+          cu_domain->h_rate[i]=domain->h_rate[i];
+        }
+
+        cu_domain->update=2;
     MYDBG(printf("# CUDA: Cuda::setDomainParams done ...\n");)
 }
 
@@ -413,283 +413,283 @@ void Cuda::checkResize()
 {
     MYDBG(printf("# CUDA: Cuda::checkResize ...\n");)
     accelerator(0,NULL);
-	cuda_shared_atom* cu_atom = & shared_data.atom;
-	cuda_shared_pair* cu_pair = & shared_data.pair;
-	cu_atom->q_flag      = atom->q_flag;
-	cu_atom->rmass_flag  = atom->rmass ? 1 : 0;
-	cu_atom->nall = atom->nlocal + atom->nghost;
-	cu_atom->nlocal      = atom->nlocal;
-	cu_atom->nghost      = atom->nghost;
-	
-	// do we have more atoms to upload than currently allocated memory on device? (also true if nothing yet allocated)
-	if(atom->nmax > cu_atom->nmax || cu_tag == NULL)
-	{
-		delete cu_x;               cu_x         = new cCudaData<double, X_FLOAT, yx> ((double*)atom->x , & cu_atom->x        , atom->nmax, 3,0,true); //cu_x->set_buffer(&(shared_data.buffer),&(shared_data.buffersize),true);
-		delete cu_v;               cu_v         = new cCudaData<double, V_FLOAT, yx> ((double*)atom->v, & cu_atom->v         , atom->nmax, 3);
-		delete cu_f;               cu_f         = new cCudaData<double, F_FLOAT, yx> ((double*)atom->f, & cu_atom->f         , atom->nmax, 3,0,true);
-		delete cu_tag;             cu_tag       = new cCudaData<int   , int    , x > (atom->tag       , & cu_atom->tag       , atom->nmax   );
-		delete cu_type;            cu_type      = new cCudaData<int   , int    , x > (atom->type      , & cu_atom->type      , atom->nmax   );
-		delete cu_mask;            cu_mask      = new cCudaData<int   , int    , x > (atom->mask      , & cu_atom->mask      , atom->nmax   );
-		delete cu_image;           cu_image     = new cCudaData<int   , int    , x > (atom->image     , & cu_atom->image     , atom->nmax   );
-
-		if(atom->rmass)
-			{delete cu_rmass;      cu_rmass     = new cCudaData<double, V_FLOAT, x > (atom->rmass     , & cu_atom->rmass     , atom->nmax  );}
-
-		if(cu_atom->q_flag)
-			{delete cu_q;          cu_q         = new cCudaData<double, F_FLOAT, x > ((double*)atom->q, & cu_atom->q         , atom->nmax  );}// cu_q->set_buffer(&(copy_buffer),&(copy_buffersize),true);}
-
-		if(atom->radius)
-		{
-			delete cu_radius;     cu_radius    = new cCudaData<double, X_FLOAT, x > (atom->radius    , & cu_atom->radius     , atom->nmax  );
-		    delete cu_v_radius;   cu_v_radius  = new cCudaData<V_FLOAT, V_FLOAT, x> (v_radius , & cu_atom->v_radius      , atom->nmax*4);
-		    delete cu_omega_rmass;   cu_omega_rmass  = new cCudaData<V_FLOAT, V_FLOAT, x> (omega_rmass , & cu_atom->omega_rmass      , atom->nmax*4);
-		}
-
-		if(atom->omega)
-			{delete cu_omega;      cu_omega     = new cCudaData<double, V_FLOAT, yx > (((double*) atom->omega)    , & cu_atom->omega     , atom->nmax,3  );}
-
-		if(atom->torque)
-			{delete cu_torque;     cu_torque    = new cCudaData<double, F_FLOAT, yx > (((double*) atom->torque)   , & cu_atom->torque     , atom->nmax,3  );}
-
-		if(atom->special)
-			{delete cu_special;     cu_special    = new cCudaData<int, int, yx > (((int*) &(atom->special[0][0]))   , & cu_atom->special     , atom->nmax,atom->maxspecial  ); shared_data.atom.maxspecial=atom->maxspecial;}
-		if(atom->nspecial)
-			{delete cu_nspecial;     cu_nspecial    = new cCudaData<int, int, yx > (((int*) atom->nspecial)  , & cu_atom->nspecial     , atom->nmax,3  );}
-		if(atom->molecule)
-			{delete cu_molecule;     cu_molecule    = new cCudaData<int, int, x > (((int*) atom->molecule)  , & cu_atom->molecule     , atom->nmax  );}
-		shared_data.atom.special_flag = neighbor->special_flag;
-		shared_data.atom.molecular = atom->molecular;
-		   
+        cuda_shared_atom* cu_atom = & shared_data.atom;
+        cuda_shared_pair* cu_pair = & shared_data.pair;
+        cu_atom->q_flag      = atom->q_flag;
+        cu_atom->rmass_flag  = atom->rmass ? 1 : 0;
+        cu_atom->nall = atom->nlocal + atom->nghost;
+        cu_atom->nlocal      = atom->nlocal;
+        cu_atom->nghost      = atom->nghost;
+
+        // do we have more atoms to upload than currently allocated memory on device? (also true if nothing yet allocated)
+        if(atom->nmax > cu_atom->nmax || cu_tag == NULL)
+        {
+                delete cu_x;               cu_x         = new cCudaData<double, X_FLOAT, yx> ((double*)atom->x , & cu_atom->x        , atom->nmax, 3,0,true); //cu_x->set_buffer(&(shared_data.buffer),&(shared_data.buffersize),true);
+                delete cu_v;               cu_v         = new cCudaData<double, V_FLOAT, yx> ((double*)atom->v, & cu_atom->v         , atom->nmax, 3);
+                delete cu_f;               cu_f         = new cCudaData<double, F_FLOAT, yx> ((double*)atom->f, & cu_atom->f         , atom->nmax, 3,0,true);
+                delete cu_tag;             cu_tag       = new cCudaData<int   , int    , x > (atom->tag       , & cu_atom->tag       , atom->nmax   );
+                delete cu_type;            cu_type      = new cCudaData<int   , int    , x > (atom->type      , & cu_atom->type      , atom->nmax   );
+                delete cu_mask;            cu_mask      = new cCudaData<int   , int    , x > (atom->mask      , & cu_atom->mask      , atom->nmax   );
+                delete cu_image;           cu_image     = new cCudaData<int   , int    , x > (atom->image     , & cu_atom->image     , atom->nmax   );
+
+                if(atom->rmass)
+                        {delete cu_rmass;      cu_rmass     = new cCudaData<double, V_FLOAT, x > (atom->rmass     , & cu_atom->rmass     , atom->nmax  );}
+
+                if(cu_atom->q_flag)
+                        {delete cu_q;          cu_q         = new cCudaData<double, F_FLOAT, x > ((double*)atom->q, & cu_atom->q         , atom->nmax  );}// cu_q->set_buffer(&(copy_buffer),&(copy_buffersize),true);}
+
+                if(atom->radius)
+                {
+                        delete cu_radius;     cu_radius    = new cCudaData<double, X_FLOAT, x > (atom->radius    , & cu_atom->radius     , atom->nmax  );
+                    delete cu_v_radius;   cu_v_radius  = new cCudaData<V_FLOAT, V_FLOAT, x> (v_radius , & cu_atom->v_radius      , atom->nmax*4);
+                    delete cu_omega_rmass;   cu_omega_rmass  = new cCudaData<V_FLOAT, V_FLOAT, x> (omega_rmass , & cu_atom->omega_rmass      , atom->nmax*4);
+                }
+
+                if(atom->omega)
+                        {delete cu_omega;      cu_omega     = new cCudaData<double, V_FLOAT, yx > (((double*) atom->omega)    , & cu_atom->omega     , atom->nmax,3  );}
+
+                if(atom->torque)
+                        {delete cu_torque;     cu_torque    = new cCudaData<double, F_FLOAT, yx > (((double*) atom->torque)   , & cu_atom->torque     , atom->nmax,3  );}
+
+                if(atom->special)
+                        {delete cu_special;     cu_special    = new cCudaData<int, int, yx > (((int*) &(atom->special[0][0]))   , & cu_atom->special     , atom->nmax,atom->maxspecial  ); shared_data.atom.maxspecial=atom->maxspecial;}
+                if(atom->nspecial)
+                        {delete cu_nspecial;     cu_nspecial    = new cCudaData<int, int, yx > (((int*) atom->nspecial)  , & cu_atom->nspecial     , atom->nmax,3  );}
+                if(atom->molecule)
+                        {delete cu_molecule;     cu_molecule    = new cCudaData<int, int, x > (((int*) atom->molecule)  , & cu_atom->molecule     , atom->nmax  );}
+                shared_data.atom.special_flag = neighbor->special_flag;
+                shared_data.atom.molecular = atom->molecular;
+
     cu_atom->update_nmax = 2;
     cu_atom->nmax        = atom->nmax;
-	    
-		delete cu_x_type;           cu_x_type   = new cCudaData<X_FLOAT, X_FLOAT, x> (x_type , & cu_atom->x_type      , atom->nmax*4);
-	}
-
-	if(((cu_xhold==NULL)||(cu_xhold->get_dim()[0]<neighbor->maxhold))&&neighbor->xhold)
-	{
-		delete cu_xhold;           cu_xhold     = new cCudaData<double, X_FLOAT, yx> ((double*)neighbor->xhold, & cu_atom->xhold         , neighbor->maxhold, 3);
-		shared_data.atom.maxhold=neighbor->maxhold;
-	}
-	
-	if(atom->mass && !cu_mass) 
-	{cu_mass      = new cCudaData<double, V_FLOAT, x > (atom->mass      , & cu_atom->mass      , atom->ntypes+1);}
-	cu_atom->mass_host   = atom->mass;
-	
-	if(atom->map_style==1)
-	{
-	  if((cu_map_array==NULL))
-	  {
-	  	cu_map_array   = new cCudaData<int, int, x > (atom->get_map_array()   , & cu_atom->map_array     , atom->get_map_size()  );
-	  }
-	  else
-	  if(cu_map_array->dev_size()/sizeof(int)<atom->get_map_size())
-	  {
-	    delete cu_map_array;
+
+                delete cu_x_type;           cu_x_type   = new cCudaData<X_FLOAT, X_FLOAT, x> (x_type , & cu_atom->x_type      , atom->nmax*4);
+        }
+
+        if(((cu_xhold==NULL)||(cu_xhold->get_dim()[0]<neighbor->maxhold))&&neighbor->xhold)
+        {
+                delete cu_xhold;           cu_xhold     = new cCudaData<double, X_FLOAT, yx> ((double*)neighbor->xhold, & cu_atom->xhold         , neighbor->maxhold, 3);
+                shared_data.atom.maxhold=neighbor->maxhold;
+        }
+
+        if(atom->mass && !cu_mass)
+        {cu_mass      = new cCudaData<double, V_FLOAT, x > (atom->mass      , & cu_atom->mass      , atom->ntypes+1);}
+        cu_atom->mass_host   = atom->mass;
+
+        if(atom->map_style==1)
+        {
+          if((cu_map_array==NULL))
+          {
+                  cu_map_array   = new cCudaData<int, int, x > (atom->get_map_array()   , & cu_atom->map_array     , atom->get_map_size()  );
+          }
+          else
+          if(cu_map_array->dev_size()/sizeof(int)<atom->get_map_size())
+          {
+            delete cu_map_array;
       cu_map_array   = new cCudaData<int, int, x > (atom->get_map_array()   , & cu_atom->map_array     , atom->get_map_size()  );
-	  }
-	}
-	
-	
-	// if any of the host pointers have changed (e.g. re-allocated somewhere else), set to correct pointer
-	if(cu_x   ->get_host_data() != atom->x)    cu_x   ->set_host_data((double*) (atom->x));
-	if(cu_v   ->get_host_data() != atom->v)    cu_v   ->set_host_data((double*) (atom->v));
-	if(cu_f   ->get_host_data() != atom->f)    cu_f   ->set_host_data((double*) (atom->f));
-	if(cu_tag ->get_host_data() != atom->tag)  cu_tag ->set_host_data(atom->tag);
-	if(cu_type->get_host_data() != atom->type) cu_type->set_host_data(atom->type);
-	if(cu_mask->get_host_data() != atom->mask) cu_mask->set_host_data(atom->mask);
-	if(cu_image->get_host_data() != atom->image) cu_mask->set_host_data(atom->image);
-	
-	if(cu_xhold)
-	if(cu_xhold->get_host_data()!= neighbor->xhold) cu_xhold->set_host_data((double*)(neighbor->xhold));
-	
-	if(atom->rmass)
-	if(cu_rmass->get_host_data() != atom->rmass) cu_rmass->set_host_data((double*) (atom->rmass));
-
-	if(cu_atom->q_flag)
-	if(cu_q->get_host_data() != atom->q) cu_q->set_host_data((double*) (atom->q));
-	
-	if(atom->radius)
-	if(cu_radius->get_host_data() != atom->radius) cu_radius->set_host_data((double*) (atom->radius));
-
-	if(atom->omega)
-	if(cu_omega->get_host_data() != atom->omega) cu_omega->set_host_data((double*) (atom->omega));
-
-	if(atom->torque)
-	if(cu_torque->get_host_data() != atom->torque) cu_torque->set_host_data((double*) (atom->torque));
-
-	if(atom->special)
-	if(cu_special->get_host_data() != atom->special)
-			{delete cu_special;     cu_special    = new cCudaData<int, int, yx > (((int*) atom->special)   , & cu_atom->special     , atom->nmax,atom->maxspecial  ); shared_data.atom.maxspecial=atom->maxspecial;}
-	
-	if(atom->nspecial)
-	if(cu_nspecial->get_host_data() != atom->nspecial) cu_nspecial->set_host_data((int*) (atom->nspecial));
-
-	if(atom->molecule)
-	if(cu_molecule->get_host_data() != atom->molecule) cu_molecule->set_host_data((int*) (atom->molecule));
-
-	if(force)
-	if(cu_virial   ->get_host_data() != force->pair->virial)    cu_virial   ->set_host_data(force->pair->virial);
-	if(force)
-	if(cu_eng_vdwl ->get_host_data() != &force->pair->eng_vdwl)    cu_eng_vdwl  ->set_host_data(&force->pair->eng_vdwl);
-	if(force)
-	if(cu_eng_coul ->get_host_data() != &force->pair->eng_coul)    cu_eng_coul   ->set_host_data(&force->pair->eng_coul);
-
- 	cu_atom->update_nlocal = 2;
-	MYDBG(printf("# CUDA: Cuda::checkResize done...\n");)
+          }
+        }
+
+
+        // if any of the host pointers have changed (e.g. re-allocated somewhere else), set to correct pointer
+        if(cu_x   ->get_host_data() != atom->x)    cu_x   ->set_host_data((double*) (atom->x));
+        if(cu_v   ->get_host_data() != atom->v)    cu_v   ->set_host_data((double*) (atom->v));
+        if(cu_f   ->get_host_data() != atom->f)    cu_f   ->set_host_data((double*) (atom->f));
+        if(cu_tag ->get_host_data() != atom->tag)  cu_tag ->set_host_data(atom->tag);
+        if(cu_type->get_host_data() != atom->type) cu_type->set_host_data(atom->type);
+        if(cu_mask->get_host_data() != atom->mask) cu_mask->set_host_data(atom->mask);
+        if(cu_image->get_host_data() != atom->image) cu_mask->set_host_data(atom->image);
+
+        if(cu_xhold)
+        if(cu_xhold->get_host_data()!= neighbor->xhold) cu_xhold->set_host_data((double*)(neighbor->xhold));
+
+        if(atom->rmass)
+        if(cu_rmass->get_host_data() != atom->rmass) cu_rmass->set_host_data((double*) (atom->rmass));
+
+        if(cu_atom->q_flag)
+        if(cu_q->get_host_data() != atom->q) cu_q->set_host_data((double*) (atom->q));
+
+        if(atom->radius)
+        if(cu_radius->get_host_data() != atom->radius) cu_radius->set_host_data((double*) (atom->radius));
+
+        if(atom->omega)
+        if(cu_omega->get_host_data() != atom->omega) cu_omega->set_host_data((double*) (atom->omega));
+
+        if(atom->torque)
+        if(cu_torque->get_host_data() != atom->torque) cu_torque->set_host_data((double*) (atom->torque));
+
+        if(atom->special)
+        if(cu_special->get_host_data() != atom->special)
+                        {delete cu_special;     cu_special    = new cCudaData<int, int, yx > (((int*) atom->special)   , & cu_atom->special     , atom->nmax,atom->maxspecial  ); shared_data.atom.maxspecial=atom->maxspecial;}
+
+        if(atom->nspecial)
+        if(cu_nspecial->get_host_data() != atom->nspecial) cu_nspecial->set_host_data((int*) (atom->nspecial));
+
+        if(atom->molecule)
+        if(cu_molecule->get_host_data() != atom->molecule) cu_molecule->set_host_data((int*) (atom->molecule));
+
+        if(force)
+        if(cu_virial   ->get_host_data() != force->pair->virial)    cu_virial   ->set_host_data(force->pair->virial);
+        if(force)
+        if(cu_eng_vdwl ->get_host_data() != &force->pair->eng_vdwl)    cu_eng_vdwl  ->set_host_data(&force->pair->eng_vdwl);
+        if(force)
+        if(cu_eng_coul ->get_host_data() != &force->pair->eng_coul)    cu_eng_coul   ->set_host_data(&force->pair->eng_coul);
+
+         cu_atom->update_nlocal = 2;
+        MYDBG(printf("# CUDA: Cuda::checkResize done...\n");)
 }
 
 void Cuda::evsetup_eatom_vatom(int eflag_atom,int vflag_atom)
 {
     if(eflag_atom)
     {
-    	if(not cu_eatom) 
-    		cu_eatom         = new cCudaData<double, ENERGY_FLOAT, x > (force->pair->eatom, & (shared_data.atom.eatom)         , atom->nmax  );// cu_eatom->set_buffer(&(copy_buffer),&(copy_buffersize),true);}
-    	if(cu_eatom->get_dim()[0]!=atom->nmax)
-    	{
-    	  //delete cu_eatom;
+            if(not cu_eatom)
+                    cu_eatom         = new cCudaData<double, ENERGY_FLOAT, x > (force->pair->eatom, & (shared_data.atom.eatom)         , atom->nmax  );// cu_eatom->set_buffer(&(copy_buffer),&(copy_buffersize),true);}
+            if(cu_eatom->get_dim()[0]!=atom->nmax)
+            {
+              //delete cu_eatom;
         //cu_eatom         = new cCudaData<double, ENERGY_FLOAT, x > (force->pair->eatom, & (shared_data.atom.eatom)         , atom->nmax  );// cu_eatom->set_buffer(&(copy_buffer),&(copy_buffersize),true);}
-    	  shared_data.atom.update_nmax=2;
-    	}
+              shared_data.atom.update_nmax=2;
+            }
 
-    	cu_eatom->set_host_data(force->pair->eatom); 
-		  cu_eatom->memset_device(0);
+            cu_eatom->set_host_data(force->pair->eatom);
+                  cu_eatom->memset_device(0);
     }
     if(vflag_atom)
-    {	
-    	if(not cu_vatom) 
-    		cu_vatom         = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)force->pair->vatom, & (shared_data.atom.vatom)         , atom->nmax ,6 );// cu_vatom->set_buffer(&(copy_buffer),&(copy_buffersize),true);}
+    {
+            if(not cu_vatom)
+                    cu_vatom         = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)force->pair->vatom, & (shared_data.atom.vatom)         , atom->nmax ,6 );// cu_vatom->set_buffer(&(copy_buffer),&(copy_buffersize),true);}
       if(cu_vatom->get_dim()[0]!=atom->nmax)
       {
         //delete cu_vatom;
         //cu_vatom         = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)force->pair->vatom, & (shared_data.atom.vatom)         , atom->nmax ,6 );// cu_vatom->set_buffer(&(copy_buffer),&(copy_buffersize),true);}
         shared_data.atom.update_nmax=2;
       }
-    	cu_vatom->set_host_data((double*)force->pair->vatom); 
-		  cu_vatom->memset_device(0);
+            cu_vatom->set_host_data((double*)force->pair->vatom);
+                  cu_vatom->memset_device(0);
     }
 }
 
 void Cuda::uploadAll()
 {
-	MYDBG(printf("# CUDA: Cuda::uploadAll() ... start\n");)
-	timespec starttime;
-	timespec endtime;
-
-	if(atom->nmax!=shared_data.atom.nmax) checkResize();
-	clock_gettime(CLOCK_REALTIME,&starttime);
-	cu_x   ->upload();
-	cu_v   ->upload();
-	cu_f   ->upload();
-	cu_tag ->upload();
-	cu_type->upload();
-	cu_mask->upload();
-	cu_image->upload();
-	if(shared_data.atom.q_flag) cu_q    ->upload();
-	
-	if(atom->rmass)             cu_rmass->upload();
-
-	if(atom->radius)            cu_radius->upload();
-	if(atom->omega)             cu_omega->upload();
-	if(atom->torque)            cu_torque->upload();
-	if(atom->special)           cu_special->upload();
-	if(atom->nspecial)          cu_nspecial->upload();
-	if(atom->molecule)          cu_molecule->upload();
-	if(cu_eatom) cu_eatom->upload();
-	if(cu_vatom) cu_vatom->upload();
-
-	clock_gettime(CLOCK_REALTIME,&endtime);
-	uploadtime+=(endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000);
-	CUDA_IF_BINNING(Cuda_PreBinning(& shared_data);)
-	CUDA_IF_BINNING(Cuda_Binning   (& shared_data);)
-	
-	shared_data.atom.triggerneighsq=neighbor->triggersq;
-	MYDBG(printf("# CUDA: Cuda::uploadAll() ... end\n");)
+        MYDBG(printf("# CUDA: Cuda::uploadAll() ... start\n");)
+        timespec starttime;
+        timespec endtime;
+
+        if(atom->nmax!=shared_data.atom.nmax) checkResize();
+        clock_gettime(CLOCK_REALTIME,&starttime);
+        cu_x   ->upload();
+        cu_v   ->upload();
+        cu_f   ->upload();
+        cu_tag ->upload();
+        cu_type->upload();
+        cu_mask->upload();
+        cu_image->upload();
+        if(shared_data.atom.q_flag) cu_q    ->upload();
+
+        if(atom->rmass)             cu_rmass->upload();
+
+        if(atom->radius)            cu_radius->upload();
+        if(atom->omega)             cu_omega->upload();
+        if(atom->torque)            cu_torque->upload();
+        if(atom->special)           cu_special->upload();
+        if(atom->nspecial)          cu_nspecial->upload();
+        if(atom->molecule)          cu_molecule->upload();
+        if(cu_eatom) cu_eatom->upload();
+        if(cu_vatom) cu_vatom->upload();
+
+        clock_gettime(CLOCK_REALTIME,&endtime);
+        uploadtime+=(endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000);
+        CUDA_IF_BINNING(Cuda_PreBinning(& shared_data);)
+        CUDA_IF_BINNING(Cuda_Binning   (& shared_data);)
+
+        shared_data.atom.triggerneighsq=neighbor->triggersq;
+        MYDBG(printf("# CUDA: Cuda::uploadAll() ... end\n");)
 }
 
 void Cuda::downloadAll()
 {
-	MYDBG(printf("# CUDA: Cuda::downloadAll() ... start\n");)
-	timespec starttime;
-	timespec endtime;
-
-	if(atom->nmax!=shared_data.atom.nmax) checkResize();
-
-	CUDA_IF_BINNING( Cuda_ReverseBinning(& shared_data); )
-	clock_gettime(CLOCK_REALTIME,&starttime);
-	cu_x   ->download();
-	cu_v   ->download();
-	cu_f   ->download();
-	cu_type->download();
-	cu_tag ->download();
-	cu_mask->download();
-	cu_image->download();
-
-	//if(shared_data.atom.need_eatom) cu_eatom->download();
-	//if(shared_data.atom.need_vatom) cu_vatom->download();
-
-	if(shared_data.atom.q_flag) cu_q    ->download();
-	if(atom->rmass)             cu_rmass->download();
-	
-	if(atom->radius)            cu_radius->download();
-	if(atom->omega)             cu_omega->download();
-	if(atom->torque)            cu_torque->download();
-	if(atom->special)           cu_special->download();
-	if(atom->nspecial)          cu_nspecial->download();
-	if(atom->molecule)          cu_molecule->download();
-	if(cu_eatom) cu_eatom->download();
-	if(cu_vatom) cu_vatom->download();
-	
-	clock_gettime(CLOCK_REALTIME,&endtime);
-	downloadtime+=(endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000);
-	MYDBG(printf("# CUDA: Cuda::downloadAll() ... end\n");)
+        MYDBG(printf("# CUDA: Cuda::downloadAll() ... start\n");)
+        timespec starttime;
+        timespec endtime;
+
+        if(atom->nmax!=shared_data.atom.nmax) checkResize();
+
+        CUDA_IF_BINNING( Cuda_ReverseBinning(& shared_data); )
+        clock_gettime(CLOCK_REALTIME,&starttime);
+        cu_x   ->download();
+        cu_v   ->download();
+        cu_f   ->download();
+        cu_type->download();
+        cu_tag ->download();
+        cu_mask->download();
+        cu_image->download();
+
+        //if(shared_data.atom.need_eatom) cu_eatom->download();
+        //if(shared_data.atom.need_vatom) cu_vatom->download();
+
+        if(shared_data.atom.q_flag) cu_q    ->download();
+        if(atom->rmass)             cu_rmass->download();
+
+        if(atom->radius)            cu_radius->download();
+        if(atom->omega)             cu_omega->download();
+        if(atom->torque)            cu_torque->download();
+        if(atom->special)           cu_special->download();
+        if(atom->nspecial)          cu_nspecial->download();
+        if(atom->molecule)          cu_molecule->download();
+        if(cu_eatom) cu_eatom->download();
+        if(cu_vatom) cu_vatom->download();
+
+        clock_gettime(CLOCK_REALTIME,&endtime);
+        downloadtime+=(endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000);
+        MYDBG(printf("# CUDA: Cuda::downloadAll() ... end\n");)
 }
 
 void Cuda::downloadX()
 {
-	Cuda_Pair_RevertXType(& this->shared_data);
-	cu_x->download();
+        Cuda_Pair_RevertXType(& this->shared_data);
+        cu_x->download();
 }
 
 CudaNeighList* Cuda::registerNeighborList(class NeighList* neigh_list)
 {
-	MYDBG(printf("# CUDA: Cuda::registerNeighborList() ... start a\n");)
-	std::map<NeighList*, CudaNeighList*>::iterator p = neigh_lists.find(neigh_list);
-
-	if(p != neigh_lists.end()) return p->second;
-	else
-	{
-		CudaNeighList* neigh_list_cuda = new CudaNeighList(lmp, neigh_list);
-		neigh_lists.insert(std::pair<NeighList*, CudaNeighList*>(neigh_list, neigh_list_cuda));
-		return neigh_list_cuda;
-	}
-	MYDBG(printf("# CUDA: Cuda::registerNeighborList() ... end b\n");)
+        MYDBG(printf("# CUDA: Cuda::registerNeighborList() ... start a\n");)
+        std::map<NeighList*, CudaNeighList*>::iterator p = neigh_lists.find(neigh_list);
+
+        if(p != neigh_lists.end()) return p->second;
+        else
+        {
+                CudaNeighList* neigh_list_cuda = new CudaNeighList(lmp, neigh_list);
+                neigh_lists.insert(std::pair<NeighList*, CudaNeighList*>(neigh_list, neigh_list_cuda));
+                return neigh_list_cuda;
+        }
+        MYDBG(printf("# CUDA: Cuda::registerNeighborList() ... end b\n");)
 }
 
 void Cuda::uploadAllNeighborLists()
 {
-	MYDBG(printf("# CUDA: Cuda::uploadAllNeighborList() ... start\n");)
-	std::map<NeighList*, CudaNeighList*>::iterator p = neigh_lists.begin();
-	while(p != neigh_lists.end())
-	{
-		p->second->nl_upload();
-		if(not (p->second->neigh_list->cuda_list->build_cuda))
-		for(int i=0;i<atom->nlocal;i++)
-		p->second->sneighlist.maxneighbors=MAX(p->second->neigh_list->numneigh[i],p->second->sneighlist.maxneighbors) ;
-		++p;
-	}
-	MYDBG(printf("# CUDA: Cuda::uploadAllNeighborList() ... done\n");)
+        MYDBG(printf("# CUDA: Cuda::uploadAllNeighborList() ... start\n");)
+        std::map<NeighList*, CudaNeighList*>::iterator p = neigh_lists.begin();
+        while(p != neigh_lists.end())
+        {
+                p->second->nl_upload();
+                if(not (p->second->neigh_list->cuda_list->build_cuda))
+                for(int i=0;i<atom->nlocal;i++)
+                p->second->sneighlist.maxneighbors=MAX(p->second->neigh_list->numneigh[i],p->second->sneighlist.maxneighbors) ;
+                ++p;
+        }
+        MYDBG(printf("# CUDA: Cuda::uploadAllNeighborList() ... done\n");)
 }
 
 void Cuda::downloadAllNeighborLists()
 {
-	MYDBG(printf("# CUDA: Cuda::downloadAllNeighborList() ... start\n");)
-	std::map<NeighList*, CudaNeighList*>::iterator p = neigh_lists.begin();
-	while(p != neigh_lists.end())
-	{
-		p->second->nl_download();
-		++p;
-	}
+        MYDBG(printf("# CUDA: Cuda::downloadAllNeighborList() ... start\n");)
+        std::map<NeighList*, CudaNeighList*>::iterator p = neigh_lists.begin();
+        while(p != neigh_lists.end())
+        {
+                p->second->nl_download();
+                ++p;
+        }
 }
 
 void Cuda::update_xhold(int &maxhold,double* xhold)
@@ -697,142 +697,142 @@ void Cuda::update_xhold(int &maxhold,double* xhold)
      if(this->shared_data.atom.maxhold<atom->nmax)
      {
         maxhold = atom->nmax;
-		delete this->cu_xhold;           this->cu_xhold     = new cCudaData<double, X_FLOAT, yx> ((double*)xhold, & this->shared_data.atom.xhold         , maxhold, 3);
+                delete this->cu_xhold;           this->cu_xhold     = new cCudaData<double, X_FLOAT, yx> ((double*)xhold, & this->shared_data.atom.xhold         , maxhold, 3);
      }
      this->shared_data.atom.maxhold=maxhold;
- 	 CudaWrapper_CopyData(this->cu_xhold->dev_data(),this->cu_x->dev_data(),3*atom->nmax*sizeof(X_FLOAT));
+          CudaWrapper_CopyData(this->cu_xhold->dev_data(),this->cu_x->dev_data(),3*atom->nmax*sizeof(X_FLOAT));
 }
 
 void Cuda::setTimingsZero()
 {
-	shared_data.cuda_timings.test1=0;
-	shared_data.cuda_timings.test2=0;
-	
-	//communication
-	shared_data.cuda_timings.comm_forward_total = 0;
-	shared_data.cuda_timings.comm_forward_mpi_upper = 0;
-	shared_data.cuda_timings.comm_forward_mpi_lower = 0;
-	shared_data.cuda_timings.comm_forward_kernel_pack = 0;
-	shared_data.cuda_timings.comm_forward_kernel_unpack = 0;
-	shared_data.cuda_timings.comm_forward_upload = 0;
-	shared_data.cuda_timings.comm_forward_download = 0;
-
-	shared_data.cuda_timings.comm_exchange_total = 0;
-	shared_data.cuda_timings.comm_exchange_mpi = 0;
-	shared_data.cuda_timings.comm_exchange_kernel_pack = 0;
-	shared_data.cuda_timings.comm_exchange_kernel_unpack = 0;
-	shared_data.cuda_timings.comm_exchange_kernel_fill = 0;
-	shared_data.cuda_timings.comm_exchange_cpu_pack= 0;
-	shared_data.cuda_timings.comm_exchange_upload = 0;
-	shared_data.cuda_timings.comm_exchange_download = 0;
-
-	shared_data.cuda_timings.comm_border_total = 0;
-	shared_data.cuda_timings.comm_border_mpi = 0;
-	shared_data.cuda_timings.comm_border_kernel_pack = 0;
-	shared_data.cuda_timings.comm_border_kernel_unpack = 0;
-	shared_data.cuda_timings.comm_border_kernel_buildlist = 0;
-	shared_data.cuda_timings.comm_border_kernel_self = 0;
-	shared_data.cuda_timings.comm_border_upload = 0;
-	shared_data.cuda_timings.comm_border_download = 0;
-	
-	//pair forces
-	shared_data.cuda_timings.pair_xtype_conversion = 0;
-	shared_data.cuda_timings.pair_kernel = 0;
-	shared_data.cuda_timings.pair_virial = 0;
-	shared_data.cuda_timings.pair_force_collection = 0;
-	
-	//neighbor
-	shared_data.cuda_timings.neigh_bin = 0;
-	shared_data.cuda_timings.neigh_build = 0;
-	shared_data.cuda_timings.neigh_special = 0;
-	
-	//PPPM
- 	shared_data.cuda_timings.pppm_particle_map = 0;
+        shared_data.cuda_timings.test1=0;
+        shared_data.cuda_timings.test2=0;
+
+        //communication
+        shared_data.cuda_timings.comm_forward_total = 0;
+        shared_data.cuda_timings.comm_forward_mpi_upper = 0;
+        shared_data.cuda_timings.comm_forward_mpi_lower = 0;
+        shared_data.cuda_timings.comm_forward_kernel_pack = 0;
+        shared_data.cuda_timings.comm_forward_kernel_unpack = 0;
+        shared_data.cuda_timings.comm_forward_upload = 0;
+        shared_data.cuda_timings.comm_forward_download = 0;
+
+        shared_data.cuda_timings.comm_exchange_total = 0;
+        shared_data.cuda_timings.comm_exchange_mpi = 0;
+        shared_data.cuda_timings.comm_exchange_kernel_pack = 0;
+        shared_data.cuda_timings.comm_exchange_kernel_unpack = 0;
+        shared_data.cuda_timings.comm_exchange_kernel_fill = 0;
+        shared_data.cuda_timings.comm_exchange_cpu_pack= 0;
+        shared_data.cuda_timings.comm_exchange_upload = 0;
+        shared_data.cuda_timings.comm_exchange_download = 0;
+
+        shared_data.cuda_timings.comm_border_total = 0;
+        shared_data.cuda_timings.comm_border_mpi = 0;
+        shared_data.cuda_timings.comm_border_kernel_pack = 0;
+        shared_data.cuda_timings.comm_border_kernel_unpack = 0;
+        shared_data.cuda_timings.comm_border_kernel_buildlist = 0;
+        shared_data.cuda_timings.comm_border_kernel_self = 0;
+        shared_data.cuda_timings.comm_border_upload = 0;
+        shared_data.cuda_timings.comm_border_download = 0;
+
+        //pair forces
+        shared_data.cuda_timings.pair_xtype_conversion = 0;
+        shared_data.cuda_timings.pair_kernel = 0;
+        shared_data.cuda_timings.pair_virial = 0;
+        shared_data.cuda_timings.pair_force_collection = 0;
+
+        //neighbor
+        shared_data.cuda_timings.neigh_bin = 0;
+        shared_data.cuda_timings.neigh_build = 0;
+        shared_data.cuda_timings.neigh_special = 0;
+
+        //PPPM
+         shared_data.cuda_timings.pppm_particle_map = 0;
   shared_data.cuda_timings.pppm_make_rho = 0;
   shared_data.cuda_timings.pppm_brick2fft = 0;
   shared_data.cuda_timings.pppm_poisson = 0;
   shared_data.cuda_timings.pppm_fillbrick = 0;
   shared_data.cuda_timings.pppm_fieldforce = 0;
   shared_data.cuda_timings.pppm_compute = 0;
-	
-	CudaWrapper_CheckUploadTime(true);
-	CudaWrapper_CheckDownloadTime(true);
-	CudaWrapper_CheckCPUBufUploadTime(true);
-	CudaWrapper_CheckCPUBufDownloadTime(true);	
+
+        CudaWrapper_CheckUploadTime(true);
+        CudaWrapper_CheckDownloadTime(true);
+        CudaWrapper_CheckCPUBufUploadTime(true);
+        CudaWrapper_CheckCPUBufDownloadTime(true);
 }
 
 void Cuda::print_timings()
 {
-	if(universe->me!=0) return;
-	if(not dotiming) return;
-	printf("\n # CUDA: Special timings\n\n");
-	printf("\n Transfer Times\n");
-	printf(" PCIe Upload:  \t %lf s\n",CudaWrapper_CheckUploadTime());
-	printf(" PCIe Download:\t %lf s\n",CudaWrapper_CheckDownloadTime());
-	printf(" CPU Tempbbuf Upload:   \t %lf \n",CudaWrapper_CheckCPUBufUploadTime());
-	printf(" CPU Tempbbuf Download: \t %lf \n",CudaWrapper_CheckCPUBufDownloadTime());
-	
-	printf("\n Communication \n");
-    
-	printf(" Forward Total           \t %lf \n",shared_data.cuda_timings.comm_forward_total);
-	printf(" Forward MPI Upper Bound \t %lf \n",shared_data.cuda_timings.comm_forward_mpi_upper);
-	printf(" Forward MPI Lower Bound \t %lf \n",shared_data.cuda_timings.comm_forward_mpi_lower);
-	printf(" Forward Kernel Pack     \t %lf \n",shared_data.cuda_timings.comm_forward_kernel_pack);
-	printf(" Forward Kernel Unpack   \t %lf \n",shared_data.cuda_timings.comm_forward_kernel_unpack);
-	printf(" Forward Kernel Self     \t %lf \n",shared_data.cuda_timings.comm_forward_kernel_self);
-	printf(" Forward Upload          \t %lf \n",shared_data.cuda_timings.comm_forward_upload);
-	printf(" Forward Download        \t %lf \n",shared_data.cuda_timings.comm_forward_download);
-	printf(" Forward Overlap Split Ratio\t %lf \n",shared_data.comm.overlap_split_ratio);
-	printf("\n");
-
-	printf(" Exchange Total          \t %lf \n",shared_data.cuda_timings.comm_exchange_total);
-	printf(" Exchange MPI            \t %lf \n",shared_data.cuda_timings.comm_exchange_mpi);
-	printf(" Exchange Kernel Pack    \t %lf \n",shared_data.cuda_timings.comm_exchange_kernel_pack);
-	printf(" Exchange Kernel Unpack  \t %lf \n",shared_data.cuda_timings.comm_exchange_kernel_unpack);
+        if(universe->me!=0) return;
+        if(not dotiming) return;
+        printf("\n # CUDA: Special timings\n\n");
+        printf("\n Transfer Times\n");
+        printf(" PCIe Upload:  \t %lf s\n",CudaWrapper_CheckUploadTime());
+        printf(" PCIe Download:\t %lf s\n",CudaWrapper_CheckDownloadTime());
+        printf(" CPU Tempbbuf Upload:   \t %lf \n",CudaWrapper_CheckCPUBufUploadTime());
+        printf(" CPU Tempbbuf Download: \t %lf \n",CudaWrapper_CheckCPUBufDownloadTime());
+
+        printf("\n Communication \n");
+
+        printf(" Forward Total           \t %lf \n",shared_data.cuda_timings.comm_forward_total);
+        printf(" Forward MPI Upper Bound \t %lf \n",shared_data.cuda_timings.comm_forward_mpi_upper);
+        printf(" Forward MPI Lower Bound \t %lf \n",shared_data.cuda_timings.comm_forward_mpi_lower);
+        printf(" Forward Kernel Pack     \t %lf \n",shared_data.cuda_timings.comm_forward_kernel_pack);
+        printf(" Forward Kernel Unpack   \t %lf \n",shared_data.cuda_timings.comm_forward_kernel_unpack);
+        printf(" Forward Kernel Self     \t %lf \n",shared_data.cuda_timings.comm_forward_kernel_self);
+        printf(" Forward Upload          \t %lf \n",shared_data.cuda_timings.comm_forward_upload);
+        printf(" Forward Download        \t %lf \n",shared_data.cuda_timings.comm_forward_download);
+        printf(" Forward Overlap Split Ratio\t %lf \n",shared_data.comm.overlap_split_ratio);
+        printf("\n");
+
+        printf(" Exchange Total          \t %lf \n",shared_data.cuda_timings.comm_exchange_total);
+        printf(" Exchange MPI            \t %lf \n",shared_data.cuda_timings.comm_exchange_mpi);
+        printf(" Exchange Kernel Pack    \t %lf \n",shared_data.cuda_timings.comm_exchange_kernel_pack);
+        printf(" Exchange Kernel Unpack  \t %lf \n",shared_data.cuda_timings.comm_exchange_kernel_unpack);
   printf(" Exchange Kernel Fill    \t %lf \n",shared_data.cuda_timings.comm_exchange_kernel_fill);
-  printf(" Exchange CPU Pack	     \t %lf \n",shared_data.cuda_timings.comm_exchange_cpu_pack);
-	printf(" Exchange Upload         \t %lf \n",shared_data.cuda_timings.comm_exchange_upload);
-	printf(" Exchange Download       \t %lf \n",shared_data.cuda_timings.comm_exchange_download);
-	printf("\n");
-
-	printf(" Border Total            \t %lf \n",shared_data.cuda_timings.comm_border_total);
-	printf(" Border MPI              \t %lf \n",shared_data.cuda_timings.comm_border_mpi);
-	printf(" Border Kernel Pack      \t %lf \n",shared_data.cuda_timings.comm_border_kernel_pack);
-	printf(" Border Kernel Unpack    \t %lf \n",shared_data.cuda_timings.comm_border_kernel_unpack);
-	printf(" Border Kernel Self      \t %lf \n",shared_data.cuda_timings.comm_border_kernel_self);
-	printf(" Border Kernel BuildList \t %lf \n",shared_data.cuda_timings.comm_border_kernel_buildlist);
-	printf(" Border Upload           \t %lf \n",shared_data.cuda_timings.comm_border_upload);
-	printf(" Border Download 	     \t %lf \n",shared_data.cuda_timings.comm_border_download);
-	printf("\n");
-	
-	//pair forces
-	printf(" Pair XType Conversion   \t %lf \n",shared_data.cuda_timings.pair_xtype_conversion );
-	printf(" Pair Kernel             \t %lf \n",shared_data.cuda_timings.pair_kernel );
-	printf(" Pair Virial             \t %lf \n",shared_data.cuda_timings.pair_virial );
-	printf(" Pair Force Collection   \t %lf \n",shared_data.cuda_timings.pair_force_collection );
-	printf("\n");
-	
-	//neighbor
-	printf(" Neighbor Binning        \t %lf \n",shared_data.cuda_timings.neigh_bin );
-	printf(" Neighbor Build          \t %lf \n",shared_data.cuda_timings.neigh_build );
-	printf(" Neighbor Special        \t %lf \n",shared_data.cuda_timings.neigh_special );	
-	printf("\n");
-	
-	//pppm
-	if(force->kspace)
-	{
-	printf(" PPPM Total              \t %lf \n",shared_data.cuda_timings.pppm_compute );
-	printf(" PPPM Particle Map       \t %lf \n",shared_data.cuda_timings.pppm_particle_map );
-	printf(" PPPM Make Rho           \t %lf \n",shared_data.cuda_timings.pppm_make_rho );
-	printf(" PPPM Brick2fft          \t %lf \n",shared_data.cuda_timings.pppm_brick2fft );
-	printf(" PPPM Poisson            \t %lf \n",shared_data.cuda_timings.pppm_poisson );
-	printf(" PPPM Fillbrick          \t %lf \n",shared_data.cuda_timings.pppm_fillbrick );
-	printf(" PPPM Fieldforce         \t %lf \n",shared_data.cuda_timings.pppm_fieldforce );
-	printf("\n");
-	}	
-
-	printf(" Debug Test 1            \t %lf \n",shared_data.cuda_timings.test1);
-	printf(" Debug Test 2            \t %lf \n",shared_data.cuda_timings.test2);
-	
-	printf("\n");
+  printf(" Exchange CPU Pack             \t %lf \n",shared_data.cuda_timings.comm_exchange_cpu_pack);
+        printf(" Exchange Upload         \t %lf \n",shared_data.cuda_timings.comm_exchange_upload);
+        printf(" Exchange Download       \t %lf \n",shared_data.cuda_timings.comm_exchange_download);
+        printf("\n");
+
+        printf(" Border Total            \t %lf \n",shared_data.cuda_timings.comm_border_total);
+        printf(" Border MPI              \t %lf \n",shared_data.cuda_timings.comm_border_mpi);
+        printf(" Border Kernel Pack      \t %lf \n",shared_data.cuda_timings.comm_border_kernel_pack);
+        printf(" Border Kernel Unpack    \t %lf \n",shared_data.cuda_timings.comm_border_kernel_unpack);
+        printf(" Border Kernel Self      \t %lf \n",shared_data.cuda_timings.comm_border_kernel_self);
+        printf(" Border Kernel BuildList \t %lf \n",shared_data.cuda_timings.comm_border_kernel_buildlist);
+        printf(" Border Upload           \t %lf \n",shared_data.cuda_timings.comm_border_upload);
+        printf(" Border Download              \t %lf \n",shared_data.cuda_timings.comm_border_download);
+        printf("\n");
+
+        //pair forces
+        printf(" Pair XType Conversion   \t %lf \n",shared_data.cuda_timings.pair_xtype_conversion );
+        printf(" Pair Kernel             \t %lf \n",shared_data.cuda_timings.pair_kernel );
+        printf(" Pair Virial             \t %lf \n",shared_data.cuda_timings.pair_virial );
+        printf(" Pair Force Collection   \t %lf \n",shared_data.cuda_timings.pair_force_collection );
+        printf("\n");
+
+        //neighbor
+        printf(" Neighbor Binning        \t %lf \n",shared_data.cuda_timings.neigh_bin );
+        printf(" Neighbor Build          \t %lf \n",shared_data.cuda_timings.neigh_build );
+        printf(" Neighbor Special        \t %lf \n",shared_data.cuda_timings.neigh_special );
+        printf("\n");
+
+        //pppm
+        if(force->kspace)
+        {
+        printf(" PPPM Total              \t %lf \n",shared_data.cuda_timings.pppm_compute );
+        printf(" PPPM Particle Map       \t %lf \n",shared_data.cuda_timings.pppm_particle_map );
+        printf(" PPPM Make Rho           \t %lf \n",shared_data.cuda_timings.pppm_make_rho );
+        printf(" PPPM Brick2fft          \t %lf \n",shared_data.cuda_timings.pppm_brick2fft );
+        printf(" PPPM Poisson            \t %lf \n",shared_data.cuda_timings.pppm_poisson );
+        printf(" PPPM Fillbrick          \t %lf \n",shared_data.cuda_timings.pppm_fillbrick );
+        printf(" PPPM Fieldforce         \t %lf \n",shared_data.cuda_timings.pppm_fieldforce );
+        printf("\n");
+        }
+
+        printf(" Debug Test 1            \t %lf \n",shared_data.cuda_timings.test1);
+        printf(" Debug Test 2            \t %lf \n",shared_data.cuda_timings.test2);
+
+        printf("\n");
 }
diff --git a/src/USER-CUDA/cuda.h b/src/USER-CUDA/cuda.h
index 21d47610fb..2494796da2 100644
--- a/src/USER-CUDA/cuda.h
+++ b/src/USER-CUDA/cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -33,121 +33,121 @@
 #ifdef _DEBUG
 #define MYDBG(a) a
 #else
-#define MYDBG(a) 
+#define MYDBG(a)
 #endif
 
 namespace LAMMPS_NS
 {
-	class Cuda : protected Pointers
-	{
-		public:
-		Cuda(class LAMMPS *);
-		~Cuda();
-		//static void setDevice(class LAMMPS*);
-		void allocate();
-
-		void accelerator(int, char **);
-
-		void setSharedDataZero();
-		void setSystemParams();
-		
-		void setDomainParams();
-		
-		void checkResize();
-		void evsetup_eatom_vatom(int eflag_atom,int vflag_atom);
-		void uploadAll();
-		void downloadAll();
-		void downloadX();
-		
-		class CudaNeighList* registerNeighborList(class NeighList* neigh_list);
-		void uploadAllNeighborLists();
-		void downloadAllNeighborLists();
-		void set_neighinit(int dist_check, double triggerneighsq)
-		{
-    	  shared_data.atom.dist_check=dist_check;  
-    	  shared_data.atom.triggerneighsq = triggerneighsq;	  	
-		}
-		bool decide_by_integrator()
-		{
-		 return neighbor_decide_by_integrator  && cu_xhold && finished_setup;
-	    }
-	    void update_xhold(int &maxhold,double* xhold);
-	    
-		void setTimingsZero();
-		void print_timings();
-		
-		void cu_x_download() {cu_x->download();}
-		bool device_set;
-		bool dotiming;
-		bool dotestatom;
-		int testatom;
-		
-		double uploadtime,downloadtime;
-		bool finished_setup,begin_setup;
-		bool oncpu;
-		bool finished_run;
-		
-		int self_comm;
-
-		int cuda_exists;
-
-		double extent[6];
-		int* debugdata;
-		// data shared between host code and device code
-		// (number of atoms, device pointers for up- & download)
-		cuda_shared_data shared_data;
-		
-		cCudaData<double  , F_FLOAT , x >* cu_q;
-		cCudaData<double  , F_FLOAT , yx>* cu_f;
-		cCudaData<double  , V_FLOAT , x >* cu_mass;
-		cCudaData<double  , V_FLOAT , x >* cu_rmass;
-		cCudaData<double  , V_FLOAT , yx>* cu_v;
-		cCudaData<double  , X_FLOAT , yx>* cu_x;
-		cCudaData<double  , X_FLOAT , yx>* cu_xhold;
-		cCudaData<int     , int     , x >* cu_mask;
-		cCudaData<int     , int     , x >* cu_tag;
-		cCudaData<int     , int     , x >* cu_type;
-		cCudaData<int     , int     , x >* cu_image;
-		cCudaData<double  , ENERGY_FLOAT, x >* cu_eatom;
-		cCudaData<double  , ENERGY_FLOAT, yx>* cu_vatom;
-		cCudaData<double  , ENERGY_FLOAT, x >* cu_virial;
-		cCudaData<double  , ENERGY_FLOAT, x >* cu_eng_vdwl;
-		cCudaData<double  , ENERGY_FLOAT, x >* cu_eng_coul;
-		cCudaData<double  , double  , x >* cu_extent;
-		int* binned_id;
-		cCudaData<int 	  , int	    , xx >* cu_binned_id;
-		int* binned_idnew;
-		cCudaData<int 	  , int	    , xx >* cu_binned_idnew;
-		cCudaData<int 	  , int	    , x >* cu_debugdata;
-		cCudaData<double  , X_FLOAT , x>* cu_radius;
-		cCudaData<double  , F_FLOAT , x>* cu_density;
-		cCudaData<double  , V_FLOAT , yx>* cu_omega;
-		cCudaData<double  , F_FLOAT , yx>* cu_torque;
-		cCudaData<int 	  , int	    , yx >* cu_special;
-		cCudaData<int 	  , int	    , yx >* cu_nspecial;
-		cCudaData<int     , int     , x >* cu_molecule;
-
-		
-		cCudaData<X_FLOAT  , X_FLOAT , x>* cu_x_type;
-		X_FLOAT* x_type;
-
-		cCudaData<V_FLOAT  , V_FLOAT , x>* cu_v_radius;
-		V_FLOAT* v_radius;
-
-		cCudaData<V_FLOAT  , V_FLOAT , x>* cu_omega_rmass;
-		V_FLOAT* omega_rmass;
-
-		cCudaData<int     , int     , x >* cu_map_array;
-		int neighbor_decide_by_integrator;
+        class Cuda : protected Pointers
+        {
+                public:
+                Cuda(class LAMMPS *);
+                ~Cuda();
+                //static void setDevice(class LAMMPS*);
+                void allocate();
+
+                void accelerator(int, char **);
+
+                void setSharedDataZero();
+                void setSystemParams();
+
+                void setDomainParams();
+
+                void checkResize();
+                void evsetup_eatom_vatom(int eflag_atom,int vflag_atom);
+                void uploadAll();
+                void downloadAll();
+                void downloadX();
+
+                class CudaNeighList* registerNeighborList(class NeighList* neigh_list);
+                void uploadAllNeighborLists();
+                void downloadAllNeighborLists();
+                void set_neighinit(int dist_check, double triggerneighsq)
+                {
+              shared_data.atom.dist_check=dist_check;
+              shared_data.atom.triggerneighsq = triggerneighsq;
+                }
+                bool decide_by_integrator()
+                {
+                 return neighbor_decide_by_integrator  && cu_xhold && finished_setup;
+            }
+            void update_xhold(int &maxhold,double* xhold);
+
+                void setTimingsZero();
+                void print_timings();
+
+                void cu_x_download() {cu_x->download();}
+                bool device_set;
+                bool dotiming;
+                bool dotestatom;
+                int testatom;
+
+                double uploadtime,downloadtime;
+                bool finished_setup,begin_setup;
+                bool oncpu;
+                bool finished_run;
+
+                int self_comm;
+
+                int cuda_exists;
+
+                double extent[6];
+                int* debugdata;
+                // data shared between host code and device code
+                // (number of atoms, device pointers for up- & download)
+                cuda_shared_data shared_data;
+
+                cCudaData<double  , F_FLOAT , x >* cu_q;
+                cCudaData<double  , F_FLOAT , yx>* cu_f;
+                cCudaData<double  , V_FLOAT , x >* cu_mass;
+                cCudaData<double  , V_FLOAT , x >* cu_rmass;
+                cCudaData<double  , V_FLOAT , yx>* cu_v;
+                cCudaData<double  , X_FLOAT , yx>* cu_x;
+                cCudaData<double  , X_FLOAT , yx>* cu_xhold;
+                cCudaData<int     , int     , x >* cu_mask;
+                cCudaData<int     , int     , x >* cu_tag;
+                cCudaData<int     , int     , x >* cu_type;
+                cCudaData<int     , int     , x >* cu_image;
+                cCudaData<double  , ENERGY_FLOAT, x >* cu_eatom;
+                cCudaData<double  , ENERGY_FLOAT, yx>* cu_vatom;
+                cCudaData<double  , ENERGY_FLOAT, x >* cu_virial;
+                cCudaData<double  , ENERGY_FLOAT, x >* cu_eng_vdwl;
+                cCudaData<double  , ENERGY_FLOAT, x >* cu_eng_coul;
+                cCudaData<double  , double  , x >* cu_extent;
+                int* binned_id;
+                cCudaData<int           , int            , xx >* cu_binned_id;
+                int* binned_idnew;
+                cCudaData<int           , int            , xx >* cu_binned_idnew;
+                cCudaData<int           , int            , x >* cu_debugdata;
+                cCudaData<double  , X_FLOAT , x>* cu_radius;
+                cCudaData<double  , F_FLOAT , x>* cu_density;
+                cCudaData<double  , V_FLOAT , yx>* cu_omega;
+                cCudaData<double  , F_FLOAT , yx>* cu_torque;
+                cCudaData<int           , int            , yx >* cu_special;
+                cCudaData<int           , int            , yx >* cu_nspecial;
+                cCudaData<int     , int     , x >* cu_molecule;
+
+
+                cCudaData<X_FLOAT  , X_FLOAT , x>* cu_x_type;
+                X_FLOAT* x_type;
+
+                cCudaData<V_FLOAT  , V_FLOAT , x>* cu_v_radius;
+                V_FLOAT* v_radius;
+
+                cCudaData<V_FLOAT  , V_FLOAT , x>* cu_omega_rmass;
+                V_FLOAT* omega_rmass;
+
+                cCudaData<int     , int     , x >* cu_map_array;
+                int neighbor_decide_by_integrator;
 
         bool pinned;
-        
-		void* copy_buffer;
-		int copy_buffersize;
 
-		private:
-		std::map<class NeighList*, class CudaNeighList*> neigh_lists;
-	};
+                void* copy_buffer;
+                int copy_buffersize;
+
+                private:
+                std::map<class NeighList*, class CudaNeighList*> neigh_lists;
+        };
 }
 
 #endif // CUDA_H
diff --git a/src/USER-CUDA/cuda_data.h b/src/USER-CUDA/cuda_data.h
index 6311598332..ed8a9ff7aa 100644
--- a/src/USER-CUDA/cuda_data.h
+++ b/src/USER-CUDA/cuda_data.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -37,46 +37,46 @@ enum copy_mode {x, xx, xy, yx, xyz, xzy}; // yxz, yzx, zxy, zyx not yet implemen
 template <typename host_type, typename dev_type, copy_mode mode>
 class cCudaData
 {
-	protected:
-	void** buffer;
-	int* buf_size;
-	host_type* host_data;
-	dev_array* dev_data_array;
-	dev_type* temp_data;
-	unsigned nbytes;
-	bool owns_dev_array;
-	bool current_data_on_device; //this is not yet working as intended and therefore deactivated
-	bool current_data_on_host;
-	bool is_continues;
-	bool pinned;
-	
-	public:
-	cCudaData(host_type* host_data, dev_array* dev_data_array, unsigned dim_x, unsigned dim_y=0, unsigned dim_z=0, bool is_pinned=false);
-	cCudaData(host_type* host_data, unsigned dim_x, unsigned dim_y=0, unsigned dim_z=0, bool is_pinned=false);
-	~cCudaData();
-	void* dev_data() {if(dev_data_array!=NULL) return dev_data_array->dev_data; else return NULL;};
-	void set_dev_data(void* adev_data) {dev_data_array->dev_data=adev_data;};
-	void set_dev_array(dev_array* adev_array) {dev_data_array=adev_array;};
-	void set_host_data(host_type* host_data);
-	void* get_host_data() { return host_data;};
-	void set_buffer(void** buffer,int* buf_size,bool ais_continues);
-	unsigned int* get_dim() {return dev_data_array->dim;};
-	// if you want to upload data to the gpu, which will not change there, then set will_be_changed=false
-	// if you want to upload data to the gpu and update it there, then set will_be_changed=true (default)
-	void upload(bool will_be_changed=true);
-	void uploadAsync(int stream, bool will_be_changed=true ); 
-	// if you want to download data just to have a look at it, then set will_be_changed=false
-	// if you are going to modify the downloaded data, then set will_be_changed=true (default)
-	void download(bool will_be_changed=true);
-	void downloadAsync(int stream); 
-	void memset_device(int value);
-	void device_data_has_changed() {current_data_on_device=false;}
-	void host_data_has_changed() {current_data_on_host=false;}
-	int dev_size() {
-		int size = dev_data_array->dim[0]*sizeof(dev_type);
-		if(dev_data_array->dim[1]) size*=dev_data_array->dim[1];
-		if(dev_data_array->dim[2]) size*=dev_data_array->dim[2];
-		return size;}
+        protected:
+        void** buffer;
+        int* buf_size;
+        host_type* host_data;
+        dev_array* dev_data_array;
+        dev_type* temp_data;
+        unsigned nbytes;
+        bool owns_dev_array;
+        bool current_data_on_device; //this is not yet working as intended and therefore deactivated
+        bool current_data_on_host;
+        bool is_continues;
+        bool pinned;
+
+        public:
+        cCudaData(host_type* host_data, dev_array* dev_data_array, unsigned dim_x, unsigned dim_y=0, unsigned dim_z=0, bool is_pinned=false);
+        cCudaData(host_type* host_data, unsigned dim_x, unsigned dim_y=0, unsigned dim_z=0, bool is_pinned=false);
+        ~cCudaData();
+        void* dev_data() {if(dev_data_array!=NULL) return dev_data_array->dev_data; else return NULL;};
+        void set_dev_data(void* adev_data) {dev_data_array->dev_data=adev_data;};
+        void set_dev_array(dev_array* adev_array) {dev_data_array=adev_array;};
+        void set_host_data(host_type* host_data);
+        void* get_host_data() { return host_data;};
+        void set_buffer(void** buffer,int* buf_size,bool ais_continues);
+        unsigned int* get_dim() {return dev_data_array->dim;};
+        // if you want to upload data to the gpu, which will not change there, then set will_be_changed=false
+        // if you want to upload data to the gpu and update it there, then set will_be_changed=true (default)
+        void upload(bool will_be_changed=true);
+        void uploadAsync(int stream, bool will_be_changed=true );
+        // if you want to download data just to have a look at it, then set will_be_changed=false
+        // if you are going to modify the downloaded data, then set will_be_changed=true (default)
+        void download(bool will_be_changed=true);
+        void downloadAsync(int stream);
+        void memset_device(int value);
+        void device_data_has_changed() {current_data_on_device=false;}
+        void host_data_has_changed() {current_data_on_host=false;}
+        int dev_size() {
+                int size = dev_data_array->dim[0]*sizeof(dev_type);
+                if(dev_data_array->dim[1]) size*=dev_data_array->dim[1];
+                if(dev_data_array->dim[2]) size*=dev_data_array->dim[2];
+                return size;}
 };
 
 
@@ -84,685 +84,685 @@ template <typename host_type, typename dev_type, copy_mode mode>
 cCudaData<host_type, dev_type, mode>
 ::cCudaData(host_type* host_data, dev_array* dev_data_array, unsigned dim_x, unsigned dim_y, unsigned dim_z, bool is_pinned)
 {
-	pinned=is_pinned;
-	owns_dev_array = false;
-	current_data_on_device = false;
-	current_data_on_host = false;
-	is_continues = false;
-	this->host_data = host_data;
-	this->dev_data_array = dev_data_array;
-	unsigned ndev;
-	if((mode == x)||(mode==xx))
-	{
-		ndev = dim_x;
-		dev_data_array->dim[0] = dim_x;
-		dev_data_array->dim[1] = 0;
-		dev_data_array->dim[2] = 0;
-	}
-	else if(mode == xy || mode == yx )
-	{
-		ndev = dim_x * dim_y;
-		dev_data_array->dim[0] = dim_x;
-		dev_data_array->dim[1] = dim_y;
-		dev_data_array->dim[2] = 0;
-	}
-	else
-	{
-		ndev = dim_x * dim_y * dim_z;
-		dev_data_array->dim[0] = dim_x;
-		dev_data_array->dim[1] = dim_y;
-		dev_data_array->dim[2] = dim_z;
-	}
-	nbytes = ndev * sizeof(dev_type);
-	if(nbytes<=0)
-	{
-		host_data=NULL;
-		temp_data=NULL;
-		dev_data_array->dev_data=NULL;
-		return;
-	}
-	
-	dev_data_array->dev_data = CudaWrapper_AllocCudaData(nbytes);
-	if(((mode!=x)&&(mode!=xx)) || typeid(host_type) != typeid(dev_type))
-	{
-		if(not pinned)
-		temp_data = new dev_type[ndev];
-		else
-		{
-			temp_data = (dev_type*) CudaWrapper_AllocPinnedHostData(ndev*sizeof(dev_type));
-		}
-	}
+        pinned=is_pinned;
+        owns_dev_array = false;
+        current_data_on_device = false;
+        current_data_on_host = false;
+        is_continues = false;
+        this->host_data = host_data;
+        this->dev_data_array = dev_data_array;
+        unsigned ndev;
+        if((mode == x)||(mode==xx))
+        {
+                ndev = dim_x;
+                dev_data_array->dim[0] = dim_x;
+                dev_data_array->dim[1] = 0;
+                dev_data_array->dim[2] = 0;
+        }
+        else if(mode == xy || mode == yx )
+        {
+                ndev = dim_x * dim_y;
+                dev_data_array->dim[0] = dim_x;
+                dev_data_array->dim[1] = dim_y;
+                dev_data_array->dim[2] = 0;
+        }
+        else
+        {
+                ndev = dim_x * dim_y * dim_z;
+                dev_data_array->dim[0] = dim_x;
+                dev_data_array->dim[1] = dim_y;
+                dev_data_array->dim[2] = dim_z;
+        }
+        nbytes = ndev * sizeof(dev_type);
+        if(nbytes<=0)
+        {
+                host_data=NULL;
+                temp_data=NULL;
+                dev_data_array->dev_data=NULL;
+                return;
+        }
+
+        dev_data_array->dev_data = CudaWrapper_AllocCudaData(nbytes);
+        if(((mode!=x)&&(mode!=xx)) || typeid(host_type) != typeid(dev_type))
+        {
+                if(not pinned)
+                temp_data = new dev_type[ndev];
+                else
+                {
+                        temp_data = (dev_type*) CudaWrapper_AllocPinnedHostData(ndev*sizeof(dev_type));
+                }
+        }
 }
 
 template <typename host_type, typename dev_type, copy_mode mode>
 cCudaData<host_type, dev_type, mode>
 ::cCudaData(host_type* host_data, unsigned dim_x, unsigned dim_y, unsigned dim_z, bool is_pinned)
 {
-	pinned=is_pinned;
-	this->dev_data_array = new dev_array;
-	this->owns_dev_array = true;
-	current_data_on_device = false;
-	current_data_on_host = false;
-	is_continues = false;
-	this->host_data = host_data;
-	unsigned ndev;
-	if((mode == x)||(mode==xx))
-	{
-		ndev = dim_x;
-		dev_data_array->dim[0] = dim_x;
-		dev_data_array->dim[1] = 0;
-		dev_data_array->dim[2] = 0;
-	}
-	else if(mode == xy || mode == yx )
-	{
-		ndev = dim_x * dim_y;
-		dev_data_array->dim[0] = dim_x;
-		dev_data_array->dim[1] = dim_y;
-		dev_data_array->dim[2] = 0;
-	}
-	else
-	{
-		ndev = dim_x * dim_y * dim_z;
-		dev_data_array->dim[0] = dim_x;
-		dev_data_array->dim[1] = dim_y;
-		dev_data_array->dim[2] = dim_z;
-	}
-	nbytes = ndev * sizeof(dev_type);
-	if(nbytes<=0)
-	{
-		host_data=NULL;
-		temp_data=NULL;
-		dev_data_array->dev_data=NULL;
-		return;
-	}
-	
-	dev_data_array->dev_data = CudaWrapper_AllocCudaData(nbytes);
-	if(((mode!=x)&&(mode!=xx)) || (typeid(host_type) != typeid(dev_type)))
-	{
-		if(not pinned)
-		temp_data = new dev_type[ndev];
-		else
-		{
-			temp_data = (dev_type*) CudaWrapper_AllocPinnedHostData(ndev*sizeof(dev_type));
-		}
-	}
+        pinned=is_pinned;
+        this->dev_data_array = new dev_array;
+        this->owns_dev_array = true;
+        current_data_on_device = false;
+        current_data_on_host = false;
+        is_continues = false;
+        this->host_data = host_data;
+        unsigned ndev;
+        if((mode == x)||(mode==xx))
+        {
+                ndev = dim_x;
+                dev_data_array->dim[0] = dim_x;
+                dev_data_array->dim[1] = 0;
+                dev_data_array->dim[2] = 0;
+        }
+        else if(mode == xy || mode == yx )
+        {
+                ndev = dim_x * dim_y;
+                dev_data_array->dim[0] = dim_x;
+                dev_data_array->dim[1] = dim_y;
+                dev_data_array->dim[2] = 0;
+        }
+        else
+        {
+                ndev = dim_x * dim_y * dim_z;
+                dev_data_array->dim[0] = dim_x;
+                dev_data_array->dim[1] = dim_y;
+                dev_data_array->dim[2] = dim_z;
+        }
+        nbytes = ndev * sizeof(dev_type);
+        if(nbytes<=0)
+        {
+                host_data=NULL;
+                temp_data=NULL;
+                dev_data_array->dev_data=NULL;
+                return;
+        }
+
+        dev_data_array->dev_data = CudaWrapper_AllocCudaData(nbytes);
+        if(((mode!=x)&&(mode!=xx)) || (typeid(host_type) != typeid(dev_type)))
+        {
+                if(not pinned)
+                temp_data = new dev_type[ndev];
+                else
+                {
+                        temp_data = (dev_type*) CudaWrapper_AllocPinnedHostData(ndev*sizeof(dev_type));
+                }
+        }
 }
 
 template <typename host_type, typename dev_type, copy_mode mode>
 cCudaData<host_type, dev_type, mode>
 ::~cCudaData()
 {
-	if(((mode!=x)&&(mode!=xx)) || typeid(host_type) != typeid(dev_type))
-	{
-		if(not pinned)
-		delete [] temp_data;
-		else
-		{
-			CudaWrapper_FreePinnedHostData((void*)temp_data);
-		}
-	}
-	if((dev_data_array->dev_data)&&(nbytes>0))
-	CudaWrapper_FreeCudaData(dev_data_array->dev_data,nbytes);
-	if(owns_dev_array) delete dev_data_array;
+        if(((mode!=x)&&(mode!=xx)) || typeid(host_type) != typeid(dev_type))
+        {
+                if(not pinned)
+                delete [] temp_data;
+                else
+                {
+                        CudaWrapper_FreePinnedHostData((void*)temp_data);
+                }
+        }
+        if((dev_data_array->dev_data)&&(nbytes>0))
+        CudaWrapper_FreeCudaData(dev_data_array->dev_data,nbytes);
+        if(owns_dev_array) delete dev_data_array;
 }
 
 template <typename host_type, typename dev_type, copy_mode mode>
 void cCudaData<host_type, dev_type, mode>
 ::set_host_data(host_type* host_data)
 {
-	this->host_data = host_data;
+        this->host_data = host_data;
 }
 
 template <typename host_type, typename dev_type, copy_mode mode>
 void cCudaData<host_type, dev_type, mode>
 ::upload(bool will_be_changed)
 {
-	// if current data is already up, do not re-upload it
-//	if(current_data_on_device) return;
+        // if current data is already up, do not re-upload it
+//        if(current_data_on_device) return;
     if(buffer&&is_continues)
     {
-   	printf("Actual Buffer: %p %i\n",*buffer,*buf_size);
-    	if(typeid(host_type)==typeid(double))
-    	{
-    	  if(typeid(dev_type)==typeid(double))
-    	  {
-    	  	CudaData_Upload_DoubleDouble((void*) host_data,dev_data_array->dev_data,
-    	  										dev_data_array->dim,mode,*buffer);
-			current_data_on_device = true;
-			if(will_be_changed) current_data_on_host = false;
-			return;
-    	  }
-    	  else if(typeid(dev_type)==typeid(float))
-    	  {
-    	  	CudaData_Upload_DoubleFloat((void*) host_data,dev_data_array->dev_data,
-    	  										dev_data_array->dim,mode,*buffer);
-			current_data_on_device = true;
-			if(will_be_changed) current_data_on_host = false;
-			return;
-    	  }
-    	}
-    	else if(typeid(host_type)==typeid(float))
-    	{
-    	  if(typeid(dev_type)==typeid(double))
-    	  {
-    	  	CudaData_Upload_FloatDouble((void*) host_data,dev_data_array->dev_data,
-    	  										dev_data_array->dim,mode,*buffer);
-			current_data_on_device = true;
-			if(will_be_changed) current_data_on_host = false;
-			return;
-    	  }
-    	  else if(typeid(dev_type)==typeid(float))
-    	  {
-    	  	CudaData_Upload_FloatFloat((void*) host_data,dev_data_array->dev_data,
-    	  										dev_data_array->dim,mode,*buffer);
-			current_data_on_device = true;
-			if(will_be_changed) current_data_on_host = false;
-			return;
-    	  }
-    	}
-    	else if(typeid(host_type)==typeid(int))
-    	{
-    	  if(typeid(dev_type)==typeid(int))
-    	  {
-    	  	CudaData_Upload_IntInt((void*) host_data,dev_data_array->dev_data,
-    	  										dev_data_array->dim,mode,*buffer);
-			current_data_on_device = true;
-			if(will_be_changed) current_data_on_host = false;
-			return;
-    	  }
-    	}
+           printf("Actual Buffer: %p %i\n",*buffer,*buf_size);
+            if(typeid(host_type)==typeid(double))
+            {
+              if(typeid(dev_type)==typeid(double))
+              {
+                      CudaData_Upload_DoubleDouble((void*) host_data,dev_data_array->dev_data,
+                                                                                              dev_data_array->dim,mode,*buffer);
+                        current_data_on_device = true;
+                        if(will_be_changed) current_data_on_host = false;
+                        return;
+              }
+              else if(typeid(dev_type)==typeid(float))
+              {
+                      CudaData_Upload_DoubleFloat((void*) host_data,dev_data_array->dev_data,
+                                                                                              dev_data_array->dim,mode,*buffer);
+                        current_data_on_device = true;
+                        if(will_be_changed) current_data_on_host = false;
+                        return;
+              }
+            }
+            else if(typeid(host_type)==typeid(float))
+            {
+              if(typeid(dev_type)==typeid(double))
+              {
+                      CudaData_Upload_FloatDouble((void*) host_data,dev_data_array->dev_data,
+                                                                                              dev_data_array->dim,mode,*buffer);
+                        current_data_on_device = true;
+                        if(will_be_changed) current_data_on_host = false;
+                        return;
+              }
+              else if(typeid(dev_type)==typeid(float))
+              {
+                      CudaData_Upload_FloatFloat((void*) host_data,dev_data_array->dev_data,
+                                                                                              dev_data_array->dim,mode,*buffer);
+                        current_data_on_device = true;
+                        if(will_be_changed) current_data_on_host = false;
+                        return;
+              }
+            }
+            else if(typeid(host_type)==typeid(int))
+            {
+              if(typeid(dev_type)==typeid(int))
+              {
+                      CudaData_Upload_IntInt((void*) host_data,dev_data_array->dev_data,
+                                                                                              dev_data_array->dim,mode,*buffer);
+                        current_data_on_device = true;
+                        if(will_be_changed) current_data_on_host = false;
+                        return;
+              }
+            }
     }
-	switch(mode)
-	{
-		case x:
-		{
-			if(typeid(host_type) == typeid(dev_type))
-				CudaWrapper_UploadCudaData(host_data, dev_data_array->dev_data, nbytes);
-			else
-			{
+        switch(mode)
+        {
+                case x:
+                {
+                        if(typeid(host_type) == typeid(dev_type))
+                                CudaWrapper_UploadCudaData(host_data, dev_data_array->dev_data, nbytes);
+                        else
+                        {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			  for(unsigned i=0; i<dev_data_array->dim[0]; ++i) temp_data[i] = static_cast<dev_type>(host_data[i]);
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                          for(unsigned i=0; i<dev_data_array->dim[0]; ++i) temp_data[i] = static_cast<dev_type>(host_data[i]);
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			  CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
-			}
-			break;
-		}
-		
-		case xx:
-		{
-			if(typeid(host_type) == typeid(dev_type))
-				CudaWrapper_UploadCudaData(host_data, dev_data_array->dev_data, nbytes);
-			else
-			{
+                          CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+                        }
+                        break;
+                }
+
+                case xx:
+                {
+                        if(typeid(host_type) == typeid(dev_type))
+                                CudaWrapper_UploadCudaData(host_data, dev_data_array->dev_data, nbytes);
+                        else
+                        {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-				for(unsigned i=0; i<dev_data_array->dim[0]; ++i) temp_data[i] = static_cast<dev_type>(host_data[i]);
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                                for(unsigned i=0; i<dev_data_array->dim[0]; ++i) temp_data[i] = static_cast<dev_type>(host_data[i]);
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-				CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
-			}
-			break;
-		}
+                                CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+                        }
+                        break;
+                }
 
-		case xy:
-		{
+                case xy:
+                {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-			{
-				dev_type* temp = &temp_data[i * dev_data_array->dim[1]];
-				for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-				{
-					temp[j] = static_cast<dev_type>((reinterpret_cast<host_type**>(host_data))[i][j]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                        for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                        {
+                                dev_type* temp = &temp_data[i * dev_data_array->dim[1]];
+                                for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                                {
+                                        temp[j] = static_cast<dev_type>((reinterpret_cast<host_type**>(host_data))[i][j]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
-			break;
-		}
-		
-		case yx:
-		{
+                        CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+                        break;
+                }
+
+                case yx:
+                {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-			{
-				dev_type* temp = &temp_data[j*dev_data_array->dim[0]];
-				for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-				{
-					temp[i] = static_cast<dev_type>(reinterpret_cast<host_type**>(host_data)[i][j]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                        for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                        {
+                                dev_type* temp = &temp_data[j*dev_data_array->dim[0]];
+                                for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                                {
+                                        temp[i] = static_cast<dev_type>(reinterpret_cast<host_type**>(host_data)[i][j]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
-			break;
-		}	
-		case xyz:
-		{
+                        CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+                        break;
+                }
+                case xyz:
+                {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-			for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-			{
-				dev_type* temp = &temp_data[(i*dev_data_array->dim[1]+j)*dev_data_array->dim[2]];
-				for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
-				{
-					temp[k] = static_cast<dev_type>(reinterpret_cast<host_type***>(host_data)[i][j][k]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                        for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                        for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                        {
+                                dev_type* temp = &temp_data[(i*dev_data_array->dim[1]+j)*dev_data_array->dim[2]];
+                                for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
+                                {
+                                        temp[k] = static_cast<dev_type>(reinterpret_cast<host_type***>(host_data)[i][j][k]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
-			break;
-		}	
+                        CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+                        break;
+                }
 
-		case xzy:
-		{
+                case xzy:
+                {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-			for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
-			{
-				dev_type* temp = &temp_data[(i*dev_data_array->dim[2]+k)*dev_data_array->dim[1]];
-				for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-				{
-					temp[j] = static_cast<dev_type>(reinterpret_cast<host_type***>(host_data)[i][j][k]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                        for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                        for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
+                        {
+                                dev_type* temp = &temp_data[(i*dev_data_array->dim[2]+k)*dev_data_array->dim[1]];
+                                for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                                {
+                                        temp[j] = static_cast<dev_type>(reinterpret_cast<host_type***>(host_data)[i][j][k]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
-			break;
-		}	
-	}
-	// we have uploaded the data to the device, i.e.:
-	current_data_on_device = true;
-	// the data is going to change on the device, making the host data out-dated
-	if(will_be_changed) current_data_on_host = false;
+                        CudaWrapper_UploadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+                        break;
+                }
+        }
+        // we have uploaded the data to the device, i.e.:
+        current_data_on_device = true;
+        // the data is going to change on the device, making the host data out-dated
+        if(will_be_changed) current_data_on_host = false;
 }
 
 template <typename host_type, typename dev_type, copy_mode mode>
 void cCudaData<host_type, dev_type, mode>
 ::uploadAsync(int stream,bool will_be_changed)
 {
-	// if current data is already up, do not re-upload it
-//	if(current_data_on_device) return;
+        // if current data is already up, do not re-upload it
+//        if(current_data_on_device) return;
     if(buffer&&is_continues)
     {
-   	printf("Actual Buffer: %p %i\n",*buffer,*buf_size);
-    	if(typeid(host_type)==typeid(double))
-    	{
-    	  if(typeid(dev_type)==typeid(double))
-    	  {
-    	  	CudaData_Upload_DoubleDouble((void*) host_data,dev_data_array->dev_data,
-    	  										dev_data_array->dim,mode,*buffer);
-			current_data_on_device = true;
-			if(will_be_changed) current_data_on_host = false;
-			return;
-    	  }
-    	  else if(typeid(dev_type)==typeid(float))
-    	  {
-    	  	CudaData_Upload_DoubleFloat((void*) host_data,dev_data_array->dev_data,
-    	  										dev_data_array->dim,mode,*buffer);
-			current_data_on_device = true;
-			if(will_be_changed) current_data_on_host = false;
-			return;
-    	  }
-    	}
-    	else if(typeid(host_type)==typeid(float))
-    	{
-    	  if(typeid(dev_type)==typeid(double))
-    	  {
-    	  	CudaData_Upload_FloatDouble((void*) host_data,dev_data_array->dev_data,
-    	  										dev_data_array->dim,mode,*buffer);
-			current_data_on_device = true;
-			if(will_be_changed) current_data_on_host = false;
-			return;
-    	  }
-    	  else if(typeid(dev_type)==typeid(float))
-    	  {
-    	  	CudaData_Upload_FloatFloat((void*) host_data,dev_data_array->dev_data,
-    	  										dev_data_array->dim,mode,*buffer);
-			current_data_on_device = true;
-			if(will_be_changed) current_data_on_host = false;
-			return;
-    	  }
-    	}
-    	else if(typeid(host_type)==typeid(int))
-    	{
-    	  if(typeid(dev_type)==typeid(int))
-    	  {
-    	  	CudaData_Upload_IntInt((void*) host_data,dev_data_array->dev_data,
-    	  										dev_data_array->dim,mode,*buffer);
-			current_data_on_device = true;
-			if(will_be_changed) current_data_on_host = false;
-			return;
-    	  }
-    	}
+           printf("Actual Buffer: %p %i\n",*buffer,*buf_size);
+            if(typeid(host_type)==typeid(double))
+            {
+              if(typeid(dev_type)==typeid(double))
+              {
+                      CudaData_Upload_DoubleDouble((void*) host_data,dev_data_array->dev_data,
+                                                                                              dev_data_array->dim,mode,*buffer);
+                        current_data_on_device = true;
+                        if(will_be_changed) current_data_on_host = false;
+                        return;
+              }
+              else if(typeid(dev_type)==typeid(float))
+              {
+                      CudaData_Upload_DoubleFloat((void*) host_data,dev_data_array->dev_data,
+                                                                                              dev_data_array->dim,mode,*buffer);
+                        current_data_on_device = true;
+                        if(will_be_changed) current_data_on_host = false;
+                        return;
+              }
+            }
+            else if(typeid(host_type)==typeid(float))
+            {
+              if(typeid(dev_type)==typeid(double))
+              {
+                      CudaData_Upload_FloatDouble((void*) host_data,dev_data_array->dev_data,
+                                                                                              dev_data_array->dim,mode,*buffer);
+                        current_data_on_device = true;
+                        if(will_be_changed) current_data_on_host = false;
+                        return;
+              }
+              else if(typeid(dev_type)==typeid(float))
+              {
+                      CudaData_Upload_FloatFloat((void*) host_data,dev_data_array->dev_data,
+                                                                                              dev_data_array->dim,mode,*buffer);
+                        current_data_on_device = true;
+                        if(will_be_changed) current_data_on_host = false;
+                        return;
+              }
+            }
+            else if(typeid(host_type)==typeid(int))
+            {
+              if(typeid(dev_type)==typeid(int))
+              {
+                      CudaData_Upload_IntInt((void*) host_data,dev_data_array->dev_data,
+                                                                                              dev_data_array->dim,mode,*buffer);
+                        current_data_on_device = true;
+                        if(will_be_changed) current_data_on_host = false;
+                        return;
+              }
+            }
     }
-	switch(mode)
-	{
-		case x:
-		{
-			if(typeid(host_type) == typeid(dev_type))
-				CudaWrapper_UploadCudaDataAsync(host_data, dev_data_array->dev_data, nbytes,stream);
-			else
-			{
+        switch(mode)
+        {
+                case x:
+                {
+                        if(typeid(host_type) == typeid(dev_type))
+                                CudaWrapper_UploadCudaDataAsync(host_data, dev_data_array->dev_data, nbytes,stream);
+                        else
+                        {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			  for(unsigned i=0; i<dev_data_array->dim[0]; ++i) temp_data[i] = static_cast<dev_type>(host_data[i]);
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                          for(unsigned i=0; i<dev_data_array->dim[0]; ++i) temp_data[i] = static_cast<dev_type>(host_data[i]);
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			  CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
-			}
-			break;
-		}
-		
-		case xx:
-		{
-			if(typeid(host_type) == typeid(dev_type))
-				CudaWrapper_UploadCudaDataAsync(host_data, dev_data_array->dev_data, nbytes,stream);
-			else
-			{
+                          CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
+                        }
+                        break;
+                }
+
+                case xx:
+                {
+                        if(typeid(host_type) == typeid(dev_type))
+                                CudaWrapper_UploadCudaDataAsync(host_data, dev_data_array->dev_data, nbytes,stream);
+                        else
+                        {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-				for(unsigned i=0; i<dev_data_array->dim[0]; ++i) temp_data[i] = static_cast<dev_type>(host_data[i]);
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                                for(unsigned i=0; i<dev_data_array->dim[0]; ++i) temp_data[i] = static_cast<dev_type>(host_data[i]);
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-				CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
-			}
-			break;
-		}
+                                CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
+                        }
+                        break;
+                }
 
-		case xy:
-		{
+                case xy:
+                {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-			{
-				dev_type* temp = &temp_data[i * dev_data_array->dim[1]];
-				for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-				{
-					temp[j] = static_cast<dev_type>((reinterpret_cast<host_type**>(host_data))[i][j]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                        for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                        {
+                                dev_type* temp = &temp_data[i * dev_data_array->dim[1]];
+                                for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                                {
+                                        temp[j] = static_cast<dev_type>((reinterpret_cast<host_type**>(host_data))[i][j]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
-			break;
-		}
-		
-		case yx:
-		{
+                        CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
+                        break;
+                }
+
+                case yx:
+                {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-			{
-				dev_type* temp = &temp_data[j*dev_data_array->dim[0]];
-				for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-				{
-					temp[i] = static_cast<dev_type>(reinterpret_cast<host_type**>(host_data)[i][j]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                        for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                        {
+                                dev_type* temp = &temp_data[j*dev_data_array->dim[0]];
+                                for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                                {
+                                        temp[i] = static_cast<dev_type>(reinterpret_cast<host_type**>(host_data)[i][j]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
-			break;
-		}	
-		case xyz:
-		{
+                        CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
+                        break;
+                }
+                case xyz:
+                {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-			for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-			{
-				dev_type* temp = &temp_data[(i*dev_data_array->dim[1]+j)*dev_data_array->dim[2]];
-				for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
-				{
-					temp[k] = static_cast<dev_type>(reinterpret_cast<host_type***>(host_data)[i][j][k]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                        for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                        for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                        {
+                                dev_type* temp = &temp_data[(i*dev_data_array->dim[1]+j)*dev_data_array->dim[2]];
+                                for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
+                                {
+                                        temp[k] = static_cast<dev_type>(reinterpret_cast<host_type***>(host_data)[i][j][k]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
-			break;
-		}	
+                        CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
+                        break;
+                }
 
-		case xzy:
-		{
+                case xzy:
+                {
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-			for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
-			{
-				dev_type* temp = &temp_data[(i*dev_data_array->dim[2]+k)*dev_data_array->dim[1]];
-				for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-				{
-					temp[j] = static_cast<dev_type>(reinterpret_cast<host_type***>(host_data)[i][j][k]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufUploadTime(
+                        for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                        for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
+                        {
+                                dev_type* temp = &temp_data[(i*dev_data_array->dim[2]+k)*dev_data_array->dim[1]];
+                                for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                                {
+                                        temp[j] = static_cast<dev_type>(reinterpret_cast<host_type***>(host_data)[i][j][k]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufUploadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
-			break;
-		}	
-	}
-	// we have uploaded the data to the device, i.e.:
-	current_data_on_device = true;
-	// the data is going to change on the device, making the host data out-dated
-	if(will_be_changed) current_data_on_host = false;
+                        CudaWrapper_UploadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes,stream);
+                        break;
+                }
+        }
+        // we have uploaded the data to the device, i.e.:
+        current_data_on_device = true;
+        // the data is going to change on the device, making the host data out-dated
+        if(will_be_changed) current_data_on_host = false;
 }
 
 template <typename host_type, typename dev_type, copy_mode mode>
 void cCudaData<host_type, dev_type, mode>
 ::download(bool will_be_changed)
 {
-	// if current data is already down, do not re-download it
-//	if(current_data_on_host) return;
-	switch(mode)
-	{
-		case x:
-		{
-			if(typeid(host_type) == typeid(dev_type))
-				CudaWrapper_DownloadCudaData(host_data, dev_data_array->dev_data, nbytes);
-			else
-			{
-				CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+        // if current data is already down, do not re-download it
+//        if(current_data_on_host) return;
+        switch(mode)
+        {
+                case x:
+                {
+                        if(typeid(host_type) == typeid(dev_type))
+                                CudaWrapper_DownloadCudaData(host_data, dev_data_array->dev_data, nbytes);
+                        else
+                        {
+                                CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-				for(unsigned i=0; i<dev_data_array->dim[0]; ++i) host_data[i] = static_cast<host_type>(temp_data[i]);
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufDownloadTime(
+                                for(unsigned i=0; i<dev_data_array->dim[0]; ++i) host_data[i] = static_cast<host_type>(temp_data[i]);
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufDownloadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			}
-			break;
-		}
-		
-		case xx:
-		{
-			if(typeid(host_type) == typeid(dev_type))
-				CudaWrapper_DownloadCudaData(host_data, dev_data_array->dev_data, nbytes);
-			else
-			{
-				CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+                        }
+                        break;
+                }
+
+                case xx:
+                {
+                        if(typeid(host_type) == typeid(dev_type))
+                                CudaWrapper_DownloadCudaData(host_data, dev_data_array->dev_data, nbytes);
+                        else
+                        {
+                                CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-				for(unsigned i=0; i<dev_data_array->dim[0]; ++i) host_data[i] = static_cast<host_type>(temp_data[i]);
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufDownloadTime(
+                                for(unsigned i=0; i<dev_data_array->dim[0]; ++i) host_data[i] = static_cast<host_type>(temp_data[i]);
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufDownloadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			}
-			break;
-		}
-		
-		case xy:
-		{
-			CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+                        }
+                        break;
+                }
+
+                case xy:
+                {
+                        CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-			{
-				dev_type* temp = &temp_data[i * dev_data_array->dim[1]];
-				for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-				{
-					reinterpret_cast<host_type**>(host_data)[i][j] = static_cast<host_type>(temp[j]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufDownloadTime(
+                        for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                        {
+                                dev_type* temp = &temp_data[i * dev_data_array->dim[1]];
+                                for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                                {
+                                        reinterpret_cast<host_type**>(host_data)[i][j] = static_cast<host_type>(temp[j]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufDownloadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			break;
-		}
-		
-		case yx:
-		{
-			CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+                        break;
+                }
+
+                case yx:
+                {
+                        CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-			{
-				dev_type* temp = &temp_data[j*dev_data_array->dim[0]];
-				for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-				{
-					reinterpret_cast<host_type**>(host_data)[i][j] = static_cast<host_type>(temp[i]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufDownloadTime(
+                        for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                        {
+                                dev_type* temp = &temp_data[j*dev_data_array->dim[0]];
+                                for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                                {
+                                        reinterpret_cast<host_type**>(host_data)[i][j] = static_cast<host_type>(temp[i]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufDownloadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			break;
-		}
+                        break;
+                }
 
-		case xyz:
-		{
-			CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+                case xyz:
+                {
+                        CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-			for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-			{
-				dev_type* temp = &temp_data[(i * dev_data_array->dim[1]+j)*dev_data_array->dim[2]];
-				for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
-				{
-					reinterpret_cast<host_type***>(host_data)[i][j][k] = static_cast<host_type>(temp[k]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufDownloadTime(
+                        for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                        for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                        {
+                                dev_type* temp = &temp_data[(i * dev_data_array->dim[1]+j)*dev_data_array->dim[2]];
+                                for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
+                                {
+                                        reinterpret_cast<host_type***>(host_data)[i][j][k] = static_cast<host_type>(temp[k]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufDownloadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			break;
-		}
+                        break;
+                }
 
-		case xzy:
-		{
-			CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
+                case xzy:
+                {
+                        CudaWrapper_DownloadCudaData(temp_data, dev_data_array->dev_data, nbytes);
     timespec time1,time2;
     clock_gettime(CLOCK_REALTIME,&time1);
-			for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-			for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
-			{
-				dev_type* temp = &temp_data[(i * dev_data_array->dim[2]+k)*dev_data_array->dim[1]];
-				for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-				{
-					reinterpret_cast<host_type***>(host_data)[i][j][k] = static_cast<host_type>(temp[j]);
-				}
-			}
-	clock_gettime(CLOCK_REALTIME,&time2);
-	CudaWrapper_AddCPUBufDownloadTime(
+                        for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                        for(unsigned k=0; k<dev_data_array->dim[2]; ++k)
+                        {
+                                dev_type* temp = &temp_data[(i * dev_data_array->dim[2]+k)*dev_data_array->dim[1]];
+                                for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                                {
+                                        reinterpret_cast<host_type***>(host_data)[i][j][k] = static_cast<host_type>(temp[j]);
+                                }
+                        }
+        clock_gettime(CLOCK_REALTIME,&time2);
+        CudaWrapper_AddCPUBufDownloadTime(
         time2.tv_sec-time1.tv_sec+1.0*(time2.tv_nsec-time1.tv_nsec)/1000000000);
-			break;
-		}
-	}
-	// we have downloaded the data to the host, i.e.:
-	current_data_on_host = true;
-	// the data is going to change on the host, making the device data out-dated
-	if(will_be_changed) current_data_on_device = false;
+                        break;
+                }
+        }
+        // we have downloaded the data to the host, i.e.:
+        current_data_on_host = true;
+        // the data is going to change on the host, making the device data out-dated
+        if(will_be_changed) current_data_on_device = false;
 }
 
 template <typename host_type, typename dev_type, copy_mode mode>
 void cCudaData<host_type, dev_type, mode>
 ::downloadAsync(int stream)
 {
-	switch(mode)
-	{
-		case x:
-		{
-			if(typeid(host_type) == typeid(dev_type))
-			{
-				CudaWrapper_DownloadCudaDataAsync(host_data, dev_data_array->dev_data, nbytes, stream);
-				CudaWrapper_SyncStream(stream);
-			}		
-			else
-			{
-				CudaWrapper_DownloadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes, stream);
-				CudaWrapper_SyncStream(stream);
-				for(unsigned i=0; i<dev_data_array->dim[0]; ++i) host_data[i] = static_cast<host_type>(temp_data[i]);
-			}
-			break;
-		}
-		
-		case xx:
-		{
-			if(typeid(host_type) == typeid(dev_type))
-			{
-				CudaWrapper_DownloadCudaDataAsync(host_data, dev_data_array->dev_data, nbytes, stream);
-			    CudaWrapper_SyncStream(stream);
-			}
-			else
-			{
-				CudaWrapper_DownloadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes, stream);
- 			    CudaWrapper_SyncStream(stream);
-				for(unsigned i=0; i<dev_data_array->dim[0]; ++i) host_data[i] = static_cast<host_type>(temp_data[i]);
-			}
-			break;
-		}
-
-		case xy:
-		{
-			CudaWrapper_DownloadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes, stream);
-			CudaWrapper_SyncStream(stream);
-			for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-			{
-				dev_type* temp = &temp_data[i * dev_data_array->dim[1]];
-				for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-				{
-					reinterpret_cast<host_type**>(host_data)[i][j] = static_cast<host_type>(temp[j]);
-				}
-			}
-			break;
-		}
-		
-		case yx:
-		{
-			CudaWrapper_DownloadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes, stream);
-			CudaWrapper_SyncStream(stream);
-			for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
-			{
-				dev_type* temp = &temp_data[j*dev_data_array->dim[0]];
-				for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
-				{
-					reinterpret_cast<host_type**>(host_data)[i][j] = static_cast<host_type>(temp[i]);
-				}
-			}
-			break;
-		}
-	}
+        switch(mode)
+        {
+                case x:
+                {
+                        if(typeid(host_type) == typeid(dev_type))
+                        {
+                                CudaWrapper_DownloadCudaDataAsync(host_data, dev_data_array->dev_data, nbytes, stream);
+                                CudaWrapper_SyncStream(stream);
+                        }
+                        else
+                        {
+                                CudaWrapper_DownloadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes, stream);
+                                CudaWrapper_SyncStream(stream);
+                                for(unsigned i=0; i<dev_data_array->dim[0]; ++i) host_data[i] = static_cast<host_type>(temp_data[i]);
+                        }
+                        break;
+                }
+
+                case xx:
+                {
+                        if(typeid(host_type) == typeid(dev_type))
+                        {
+                                CudaWrapper_DownloadCudaDataAsync(host_data, dev_data_array->dev_data, nbytes, stream);
+                            CudaWrapper_SyncStream(stream);
+                        }
+                        else
+                        {
+                                CudaWrapper_DownloadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes, stream);
+                             CudaWrapper_SyncStream(stream);
+                                for(unsigned i=0; i<dev_data_array->dim[0]; ++i) host_data[i] = static_cast<host_type>(temp_data[i]);
+                        }
+                        break;
+                }
+
+                case xy:
+                {
+                        CudaWrapper_DownloadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes, stream);
+                        CudaWrapper_SyncStream(stream);
+                        for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                        {
+                                dev_type* temp = &temp_data[i * dev_data_array->dim[1]];
+                                for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                                {
+                                        reinterpret_cast<host_type**>(host_data)[i][j] = static_cast<host_type>(temp[j]);
+                                }
+                        }
+                        break;
+                }
+
+                case yx:
+                {
+                        CudaWrapper_DownloadCudaDataAsync(temp_data, dev_data_array->dev_data, nbytes, stream);
+                        CudaWrapper_SyncStream(stream);
+                        for(unsigned j=0; j<dev_data_array->dim[1]; ++j)
+                        {
+                                dev_type* temp = &temp_data[j*dev_data_array->dim[0]];
+                                for(unsigned i=0; i<dev_data_array->dim[0]; ++i)
+                                {
+                                        reinterpret_cast<host_type**>(host_data)[i][j] = static_cast<host_type>(temp[i]);
+                                }
+                        }
+                        break;
+                }
+        }
 }
 
 
@@ -783,13 +783,13 @@ void cCudaData<host_type, dev_type, mode>
    if(buffer!=NULL)
    if(not((typeid(host_type) == typeid(dev_type))&&(mode == x || mode == xx)))
    {
-   	printf("Allocate Buffer: %p %i\n",*buffer,*buf_size);
-   	 if(((*buffer)!=NULL)&&(*buf_size<nbytes_buf))
-   	 CudaWrapper_FreeCudaData(*buffer,*buf_size);
-   	 if(*buf_size<nbytes_buf)
-   	 {*buffer=CudaWrapper_AllocCudaData(nbytes_buf);*buf_size=nbytes_buf;}
-   	printf("Allocate Buffer2: %p %i\n",*buffer,*buf_size);
-   	 
+           printf("Allocate Buffer: %p %i\n",*buffer,*buf_size);
+            if(((*buffer)!=NULL)&&(*buf_size<nbytes_buf))
+            CudaWrapper_FreeCudaData(*buffer,*buf_size);
+            if(*buf_size<nbytes_buf)
+            {*buffer=CudaWrapper_AllocCudaData(nbytes_buf);*buf_size=nbytes_buf;}
+           printf("Allocate Buffer2: %p %i\n",*buffer,*buf_size);
+
    }
    is_continues=ais_continues;
 }
diff --git a/src/USER-CUDA/cuda_modify_flags.h b/src/USER-CUDA/cuda_modify_flags.h
index 8863fe60d4..e683456d27 100644
--- a/src/USER-CUDA/cuda_modify_flags.h
+++ b/src/USER-CUDA/cuda_modify_flags.h
@@ -1,22 +1,22 @@
 /* -*- c++ -*- ----------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/cuda_neigh_list.cpp b/src/USER-CUDA/cuda_neigh_list.cpp
index 01f8e0c6a8..c34fb22ed4 100644
--- a/src/USER-CUDA/cuda_neigh_list.cpp
+++ b/src/USER-CUDA/cuda_neigh_list.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -39,147 +39,146 @@ CudaNeighList::CudaNeighList(LAMMPS *lmp, class NeighList* neigh_list) : Pointer
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	MYDBG(printf("# CUDA: CudaNeighList::cudaNeighList() ... start\n");)
-	this->neigh_list = neigh_list;
-	neigh_list->cuda_list=this;
-	sneighlist.maxlocal = neigh_list->get_maxlocal();
-	sneighlist.maxneighbors = 32;
-	sneighlist.maxcut = 0.0;
-	sneighlist.cutneighsq = NULL;
-	cu_neighbors = NULL;
-	cu_neighbors_border = NULL;
-	cu_neighbors_inner = NULL;
-	cu_numneigh_border = NULL;
-	cu_numneigh_inner = NULL;
-	cu_numneigh = NULL;
-	cu_ilist = NULL;
-	cu_ilist_border = NULL;
-	cu_inum_border = NULL;
-	inum_border = 0;
-	neighbors = NULL;
-	neighbors_inner = NULL;
-	neighbors_border = NULL;
-	numneigh_border = NULL;
-	numneigh_inner = NULL;
-	ilist_border = NULL;
-
-	build_cuda = false;
-	sneighlist.binned_id=NULL;
-	sneighlist.bin_dim=new int[3];
-	sneighlist.bin_dim[0]=0;
-	sneighlist.bin_dim[1]=0;
-	sneighlist.bin_dim[2]=0;
-	
-	cu_ex_type = NULL;
-	cu_ex1_bit = NULL;
-	cu_ex2_bit = NULL;
-	cu_ex_mol_bit = NULL;
-	sneighlist.nex_type=0;
-	sneighlist.nex_group=0;
-	sneighlist.nex_mol=0;
-	
-	sneighlist.bin_nmax=0;
-	sneighlist.bin_extraspace=0.05;
-	MYDBG(printf("# CUDA: CudaNeighList::cudaNeighList() ... end\n");)
-	
+        MYDBG(printf("# CUDA: CudaNeighList::cudaNeighList() ... start\n");)
+        this->neigh_list = neigh_list;
+        neigh_list->cuda_list=this;
+        sneighlist.maxlocal = neigh_list->get_maxlocal();
+        sneighlist.maxneighbors = 32;
+        sneighlist.maxcut = 0.0;
+        sneighlist.cutneighsq = NULL;
+        cu_neighbors = NULL;
+        cu_neighbors_border = NULL;
+        cu_neighbors_inner = NULL;
+        cu_numneigh_border = NULL;
+        cu_numneigh_inner = NULL;
+        cu_numneigh = NULL;
+        cu_ilist = NULL;
+        cu_ilist_border = NULL;
+        cu_inum_border = NULL;
+        inum_border = 0;
+        neighbors = NULL;
+        neighbors_inner = NULL;
+        neighbors_border = NULL;
+        numneigh_border = NULL;
+        numneigh_inner = NULL;
+        ilist_border = NULL;
+
+        build_cuda = false;
+        sneighlist.binned_id=NULL;
+        sneighlist.bin_dim=new int[3];
+        sneighlist.bin_dim[0]=0;
+        sneighlist.bin_dim[1]=0;
+        sneighlist.bin_dim[2]=0;
+
+        cu_ex_type = NULL;
+        cu_ex1_bit = NULL;
+        cu_ex2_bit = NULL;
+        cu_ex_mol_bit = NULL;
+        sneighlist.nex_type=0;
+        sneighlist.nex_group=0;
+        sneighlist.nex_mol=0;
+
+        sneighlist.bin_nmax=0;
+        sneighlist.bin_extraspace=0.05;
+        MYDBG(printf("# CUDA: CudaNeighList::cudaNeighList() ... end\n");)
+
 }
 
 CudaNeighList::~CudaNeighList()
 {
-	dev_free();
+        dev_free();
 }
 
 void CudaNeighList::dev_alloc()
-{ 
-	MYDBG( printf("# CUDA: CudaNeighList::dev_alloc() ... start\n"); )
-	cu_ilist         = new cCudaData<int , int , x> (neigh_list->ilist   , & sneighlist.ilist     , sneighlist.maxlocal );
-	cu_numneigh      = new cCudaData<int , int , x> (neigh_list->numneigh, & sneighlist.numneigh  , sneighlist.maxlocal );
-	neighbors = new int[atom->nmax*sneighlist.maxneighbors];
-	cu_neighbors= new cCudaData<int, int, x> (neighbors			 		 , & sneighlist.neighbors, atom->nmax*sneighlist.maxneighbors );
-
-	if(cuda->shared_data.overlap_comm)
-	{
-	ilist_border  = new int[sneighlist.maxlocal];
-	numneigh_border	= new int[sneighlist.maxlocal];
-	numneigh_inner	= new int[sneighlist.maxlocal];
-	cu_inum_border  = new cCudaData<int , int , x> (&inum_border		 , & sneighlist.inum_border      , 1 );
-	cu_ilist_border  = new cCudaData<int , int , x> (ilist_border		 , & sneighlist.ilist_border     , sneighlist.maxlocal );
-	cu_numneigh_border	= new cCudaData<int , int , x> (numneigh_border  , & sneighlist.numneigh_border  , sneighlist.maxlocal );
-	cu_numneigh_inner 	= new cCudaData<int , int , x> (numneigh_inner   , & sneighlist.numneigh_inner   , sneighlist.maxlocal );
-	neighbors_border = new int[sneighlist.maxlocal*sneighlist.maxneighbors];
-	cu_neighbors_border= new cCudaData<int, int, x> (neighbors_border	 , & sneighlist.neighbors_border, sneighlist.maxlocal*sneighlist.maxneighbors );
-	neighbors_inner = new int[sneighlist.maxlocal*sneighlist.maxneighbors];
-	cu_neighbors_inner = new cCudaData<int, int, x> (neighbors_inner	 , & sneighlist.neighbors_inner , sneighlist.maxlocal*sneighlist.maxneighbors );
-	}
-	cuda->shared_data.atom.update_neigh=2;
-	MYDBG( printf("# CUDA: CudaNeighList::dev_alloc() ... end\n"); )
+{
+        MYDBG( printf("# CUDA: CudaNeighList::dev_alloc() ... start\n"); )
+        cu_ilist         = new cCudaData<int , int , x> (neigh_list->ilist   , & sneighlist.ilist     , sneighlist.maxlocal );
+        cu_numneigh      = new cCudaData<int , int , x> (neigh_list->numneigh, & sneighlist.numneigh  , sneighlist.maxlocal );
+        neighbors = new int[atom->nmax*sneighlist.maxneighbors];
+        cu_neighbors= new cCudaData<int, int, x> (neighbors                                          , & sneighlist.neighbors, atom->nmax*sneighlist.maxneighbors );
+
+        if(cuda->shared_data.overlap_comm)
+        {
+        ilist_border  = new int[sneighlist.maxlocal];
+        numneigh_border        = new int[sneighlist.maxlocal];
+        numneigh_inner        = new int[sneighlist.maxlocal];
+        cu_inum_border  = new cCudaData<int , int , x> (&inum_border                 , & sneighlist.inum_border      , 1 );
+        cu_ilist_border  = new cCudaData<int , int , x> (ilist_border                 , & sneighlist.ilist_border     , sneighlist.maxlocal );
+        cu_numneigh_border        = new cCudaData<int , int , x> (numneigh_border  , & sneighlist.numneigh_border  , sneighlist.maxlocal );
+        cu_numneigh_inner         = new cCudaData<int , int , x> (numneigh_inner   , & sneighlist.numneigh_inner   , sneighlist.maxlocal );
+        neighbors_border = new int[sneighlist.maxlocal*sneighlist.maxneighbors];
+        cu_neighbors_border= new cCudaData<int, int, x> (neighbors_border         , & sneighlist.neighbors_border, sneighlist.maxlocal*sneighlist.maxneighbors );
+        neighbors_inner = new int[sneighlist.maxlocal*sneighlist.maxneighbors];
+        cu_neighbors_inner = new cCudaData<int, int, x> (neighbors_inner         , & sneighlist.neighbors_inner , sneighlist.maxlocal*sneighlist.maxneighbors );
+        }
+        cuda->shared_data.atom.update_neigh=2;
+        MYDBG( printf("# CUDA: CudaNeighList::dev_alloc() ... end\n"); )
 }
 
 void CudaNeighList::dev_free()
 {
-	MYDBG( printf("# CUDA: CudaNeighList::dev_free() ... start\n"); )
-	delete cu_numneigh;
-	delete cu_ilist;
-	delete [] neighbors;
-	delete cu_neighbors;
-
-	if(cuda->shared_data.overlap_comm)
-	{
-	delete [] ilist_border;
-	delete [] numneigh_border;
-	delete [] numneigh_inner;
-	delete [] neighbors_border;
-	delete [] neighbors_inner;
-	delete cu_inum_border;
-	delete cu_neighbors_border;
-	delete cu_neighbors_inner;
-	delete cu_numneigh_border;
-	delete cu_numneigh_inner;
-	delete cu_ilist_border;
-	}
-	MYDBG( printf("# CUDA: CudaNeighList::dev_free() ... end\n"); )
+        MYDBG( printf("# CUDA: CudaNeighList::dev_free() ... start\n"); )
+        delete cu_numneigh;
+        delete cu_ilist;
+        delete [] neighbors;
+        delete cu_neighbors;
+
+        if(cuda->shared_data.overlap_comm)
+        {
+        delete [] ilist_border;
+        delete [] numneigh_border;
+        delete [] numneigh_inner;
+        delete [] neighbors_border;
+        delete [] neighbors_inner;
+        delete cu_inum_border;
+        delete cu_neighbors_border;
+        delete cu_neighbors_inner;
+        delete cu_numneigh_border;
+        delete cu_numneigh_inner;
+        delete cu_ilist_border;
+        }
+        MYDBG( printf("# CUDA: CudaNeighList::dev_free() ... end\n"); )
 }
 
 void CudaNeighList::grow_device()
 {
-	MYDBG(printf("# CUDA: CudaNeighList::grow_device() ... start\n");)
-	// if host has allocated more memory for atom arrays than device has, then allocate more memory on device
-	int new_maxlocal = neigh_list->get_maxlocal();
-	if(sneighlist.maxlocal < new_maxlocal)
-	{
-		sneighlist.maxlocal = new_maxlocal;
-		dev_free();
-		dev_alloc();
-	}
-
-	if(!cu_ilist || !cu_numneigh) dev_alloc();
-
-	// check, if hosts data has been allocated somewhere else
-	if(cu_ilist   ->get_host_data() != neigh_list->ilist)    cu_ilist   ->set_host_data(neigh_list->ilist);
-	if(cu_numneigh->get_host_data() != neigh_list->numneigh) cu_numneigh->set_host_data(neigh_list->numneigh);
-		
-	MYDBG(printf("# CUDA: CudaNeighList::grow_device() ... end\n");)
+        MYDBG(printf("# CUDA: CudaNeighList::grow_device() ... start\n");)
+        // if host has allocated more memory for atom arrays than device has, then allocate more memory on device
+        int new_maxlocal = neigh_list->get_maxlocal();
+        if(sneighlist.maxlocal < new_maxlocal)
+        {
+                sneighlist.maxlocal = new_maxlocal;
+                dev_free();
+                dev_alloc();
+        }
+
+        if(!cu_ilist || !cu_numneigh) dev_alloc();
+
+        // check, if hosts data has been allocated somewhere else
+        if(cu_ilist   ->get_host_data() != neigh_list->ilist)    cu_ilist   ->set_host_data(neigh_list->ilist);
+        if(cu_numneigh->get_host_data() != neigh_list->numneigh) cu_numneigh->set_host_data(neigh_list->numneigh);
+
+        MYDBG(printf("# CUDA: CudaNeighList::grow_device() ... end\n");)
 }
 
 
 void CudaNeighList::nl_upload(bool will_be_changed)
 {
-	//return;
-	MYDBG(printf("# CUDA: CudaNeighList::nl_upload() ... start\n");)
-	if(cu_ilist)
-	cu_ilist->upload();
-	if(cu_numneigh)
-	cu_numneigh->upload();
-	MYDBG(printf("# CUDA: CudaNeighList::nl_upload() ... end\n");)
+        //return;
+        MYDBG(printf("# CUDA: CudaNeighList::nl_upload() ... start\n");)
+        if(cu_ilist)
+        cu_ilist->upload();
+        if(cu_numneigh)
+        cu_numneigh->upload();
+        MYDBG(printf("# CUDA: CudaNeighList::nl_upload() ... end\n");)
 }
 
 void CudaNeighList::nl_download(bool will_be_changed)
 {
-	MYDBG(printf("# CUDA: CudaNeighList::nl_download() ... start\n");)
-	if(cu_ilist)
-	cu_ilist->download();
-	if(cu_numneigh)
-	cu_numneigh->download();
-	MYDBG(printf("# CUDA: CudaNeighList::nl_download() ... end\n");)
+        MYDBG(printf("# CUDA: CudaNeighList::nl_download() ... start\n");)
+        if(cu_ilist)
+        cu_ilist->download();
+        if(cu_numneigh)
+        cu_numneigh->download();
+        MYDBG(printf("# CUDA: CudaNeighList::nl_download() ... end\n");)
 }
-
diff --git a/src/USER-CUDA/cuda_neigh_list.h b/src/USER-CUDA/cuda_neigh_list.h
index 97e75b9390..8a8963dbbd 100644
--- a/src/USER-CUDA/cuda_neigh_list.h
+++ b/src/USER-CUDA/cuda_neigh_list.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -33,46 +33,46 @@ namespace LAMMPS_NS
 
 class CudaNeighList : protected Pointers
 {
-	public:
-		cCudaData<int , int , x>*  cu_ilist;
-		cCudaData<int , int , x>*  cu_numneigh;
-		cCudaData<int , int , x>*  cu_inum_border;
-		cCudaData<int , int , x>*  cu_ilist_border;
-		cCudaData<int , int , x>*  cu_numneigh_border;
-		cCudaData<int , int , x>*  cu_numneigh_inner;
-		cCudaData<int , int , x>*  cu_neighbors;
-		cCudaData<int , int , x>*  cu_neighbors_border;
-		cCudaData<int , int , x>*  cu_neighbors_inner;
-		cCudaData<int , int , x>*  cu_ex_type;
-		cCudaData<int , int , x>*  cu_ex1_bit;
-		cCudaData<int , int , x>*  cu_ex2_bit;
-		cCudaData<int , int , x>*  cu_ex_mol_bit;
-		
-		
-		cuda_shared_neighlist sneighlist;
-		
-		int* neighbors;
-		int* neighbors_inner;
-		int* neighbors_border;
-		int inum_border;
-		int* ilist_border;
-		int* numneigh_border;
-		int* numneigh_inner;
-		int nex_type;
-		int nex_group;
-		int nex_mol;
-		
-		bool build_cuda;
-		
-		CudaNeighList(class LAMMPS *, class NeighList* neigh_list);
-		~CudaNeighList();
-		void grow_device(); // will grow pages memory on device, keeping old pages. will grow lists memory on device, deleting old lists
-		void nl_upload(bool will_be_changed=true);
-		void nl_download(bool will_be_changed=true);
-		NeighList* neigh_list;
-			
-		void dev_alloc();
-		void dev_free();
+        public:
+                cCudaData<int , int , x>*  cu_ilist;
+                cCudaData<int , int , x>*  cu_numneigh;
+                cCudaData<int , int , x>*  cu_inum_border;
+                cCudaData<int , int , x>*  cu_ilist_border;
+                cCudaData<int , int , x>*  cu_numneigh_border;
+                cCudaData<int , int , x>*  cu_numneigh_inner;
+                cCudaData<int , int , x>*  cu_neighbors;
+                cCudaData<int , int , x>*  cu_neighbors_border;
+                cCudaData<int , int , x>*  cu_neighbors_inner;
+                cCudaData<int , int , x>*  cu_ex_type;
+                cCudaData<int , int , x>*  cu_ex1_bit;
+                cCudaData<int , int , x>*  cu_ex2_bit;
+                cCudaData<int , int , x>*  cu_ex_mol_bit;
+
+
+                cuda_shared_neighlist sneighlist;
+
+                int* neighbors;
+                int* neighbors_inner;
+                int* neighbors_border;
+                int inum_border;
+                int* ilist_border;
+                int* numneigh_border;
+                int* numneigh_inner;
+                int nex_type;
+                int nex_group;
+                int nex_mol;
+
+                bool build_cuda;
+
+                CudaNeighList(class LAMMPS *, class NeighList* neigh_list);
+                ~CudaNeighList();
+                void grow_device(); // will grow pages memory on device, keeping old pages. will grow lists memory on device, deleting old lists
+                void nl_upload(bool will_be_changed=true);
+                void nl_download(bool will_be_changed=true);
+                NeighList* neigh_list;
+
+                void dev_alloc();
+                void dev_free();
 
  private:
   class Cuda *cuda;
diff --git a/src/USER-CUDA/domain_cuda.cpp b/src/USER-CUDA/domain_cuda.cpp
index b241b16a29..eb5a242457 100644
--- a/src/USER-CUDA/domain_cuda.cpp
+++ b/src/USER-CUDA/domain_cuda.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -46,7 +46,7 @@ using namespace LAMMPS_NS;
 enum{NO_REMAP,X_REMAP,V_REMAP};                   // same as fix_deform.cpp
 
 /* ----------------------------------------------------------------------
-   default is periodic 
+   default is periodic
 ------------------------------------------------------------------------- */
 
 DomainCuda::DomainCuda(LAMMPS *lmp) : Domain(lmp)
@@ -229,11 +229,11 @@ void DomainCuda::pbc()
 {
   if(cuda->finished_setup&&(!cuda->oncpu))
   {
-  	cuda->setDomainParams();
+          cuda->setDomainParams();
     Cuda_Domain_PBC(&cuda->shared_data, deform_vremap, deform_groupbit,cuda->extent);
     return;
   }
-  
+
   Domain::pbc();
 }
 
@@ -266,6 +266,6 @@ void DomainCuda::x2lamda(int n)
     Cuda_Domain_x2lamda(&cuda->shared_data,n);
     return;
   }
- 
+
   Domain::x2lamda(n);
 }
diff --git a/src/USER-CUDA/domain_cuda.h b/src/USER-CUDA/domain_cuda.h
index 1ff4f75946..7d0186ee79 100644
--- a/src/USER-CUDA/domain_cuda.h
+++ b/src/USER-CUDA/domain_cuda.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -28,7 +28,7 @@ class DomainCuda : public Domain {
   void set_local_box();
   void reset_box();
   void pbc();
- 
+
   void lamda2x(int);
   void x2lamda(int);
 
diff --git a/src/USER-CUDA/fft3d_cuda.cpp b/src/USER-CUDA/fft3d_cuda.cpp
index c6882f4597..c09654d977 100644
--- a/src/USER-CUDA/fft3d_cuda.cpp
+++ b/src/USER-CUDA/fft3d_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -63,9 +63,9 @@
    my subsection must not overlap with any other proc's subsection,
      i.e. the union of all proc's input (or output) subsections must
      exactly tile the global Nfast x Nmid x Nslow data set
-   when called from C, all subsection indices are 
+   when called from C, all subsection indices are
      C-style from 0 to N-1 where N = Nfast or Nmid or Nslow
-   when called from F77, all subsection indices are 
+   when called from F77, all subsection indices are
      F77-style from 1 to N where N = Nfast or Nmid or Nslow
    a proc can own 0 elements on input or output
      by specifying hi index < lo index
@@ -74,7 +74,7 @@
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Perform 3d FFT 
+   Perform 3d FFT
 
    Arguments:
    in           starting address of input data on this proc
@@ -90,15 +90,15 @@ void fft_3d_cuda(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan
   plan->iterate++;
   timespec starttime,starttime2;
   timespec endtime,endtime2;
-	
+
   int i,total,length,offset,num;
   double norm;
   FFT_DATA *data,*copy;
-  // system specific constants 
+  // system specific constants
 
 
   // pre-remap to prepare for 1st FFTs if needed
-  // copy = loc for remap result 
+  // copy = loc for remap result
   int nprocs=plan->nprocs;
 if(nprocs>1)
 {
@@ -116,8 +116,8 @@ if(nprocs>1)
   cufftResult retvalc;
   if(plan->init)
   {
-	if(nprocs>1)
-	{
+        if(nprocs>1)
+        {
       if(sizeof(FFT_FLOAT)==sizeof(double))cudaMemcpy((void*) (plan->cudata2), (void*) data, plan->cudatasize/2,cudaMemcpyHostToDevice);
       if(sizeof(FFT_FLOAT)==sizeof(float)) cudaMemcpy((void*) (plan->cudata2), (void*) data, plan->cudatasize,cudaMemcpyHostToDevice);
       initfftdata((double*)plan->cudata2,(FFT_FLOAT*)plan->cudata,plan->nfast,plan->nmid,plan->nslow);
@@ -137,7 +137,7 @@ if(nprocs>1)
 #endif
 }
 /* ----------------------------------------------------------------------
-   Create plan for performing a 3d FFT 
+   Create plan for performing a 3d FFT
 
    Arguments:
    comm                 MPI communicator for the P procs which own the data
@@ -151,8 +151,8 @@ if(nprocs>1)
    scaled               0 = no scaling of result, 1 = scaling
    permute              permutation in storage order of indices on output
                           0 = no permutation
-			  1 = permute once = mid->fast, slow->mid, fast->slow
-			  2 = permute twice = slow->fast, fast->mid, mid->slow
+                          1 = permute once = mid->fast, slow->mid, fast->slow
+                          2 = permute twice = slow->fast, fast->mid, mid->slow
    nbuf                 returns size of internal storage buffers used by FFT
 ------------------------------------------------------------------------- */
 
@@ -175,9 +175,9 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
   int np1,np2,ip1,ip2;
   int list[50];
 
-  // system specific variables 
+  // system specific variables
 
-  // query MPI info 
+  // query MPI info
 
   MPI_Comm_rank(comm,&me);
   MPI_Comm_size(comm,&nprocs);
@@ -185,7 +185,7 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
 #ifndef FFT_CUFFT
     error->all(FLERR,"ERROR: Trying to use cuda fft without FFT_CUFFT set. Recompile with make option 'cufft=1'.");
 #endif
-  // compute division of procs in 2 dimensions not on-processor 
+  // compute division of procs in 2 dimensions not on-processor
   bifactor_cuda(nprocs,&np1,&np2);
   ip1 = me % np1;
   ip2 = me/np1;
@@ -196,13 +196,13 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
   int ip2out = ip2;
   int np1out = np1;
   int np2out = np2;
-  
+
   ip1 = 0;
   ip2 = 0;
   np1 = 1;
   np2 = 1;
 
-  // allocate memory for plan data struct 
+  // allocate memory for plan data struct
 
   plan = (struct fft_plan_3d *) malloc(sizeof(struct fft_plan_3d));
   if (plan == NULL) return NULL;
@@ -210,7 +210,7 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
 
   // remap from initial distribution to layout needed for 1st set of 1d FFTs
   // not needed if all procs own entire fast axis initially
-  // first indices = distribution after 1st set of FFTs 
+  // first indices = distribution after 1st set of FFTs
 
   if (in_ilo == 0 && in_ihi == nfast-1)
     flag = 0;
@@ -241,20 +241,20 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
     if(plan->init) members=1;
     plan->pre_plan =
       remap_3d_create_plan(comm,in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
-			   first_ilo,first_ihi,first_jlo,first_jhi,
-			   first_klo,first_khi,
-			   members,0,0,2);
+                           first_ilo,first_ihi,first_jlo,first_jhi,
+                           first_klo,first_khi,
+                           members,0,0,2);
     if (plan->pre_plan == NULL) return NULL;
   }
 
-  // 1d FFTs along fast axis 
+  // 1d FFTs along fast axis
 
   plan->length1 = nfast;
   plan->total1 = nfast * nmid * nslow;
 
   // remap from 1st to 2nd FFT
   // choose which axis is split over np1 vs np2 to minimize communication
-  // second indices = distribution after 2nd set of FFTs 
+  // second indices = distribution after 2nd set of FFTs
 
   second_ilo = ip1*nfast/np1;
   second_ihi = (ip1+1)*nfast/np1 - 1;
@@ -264,14 +264,14 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
   second_khi = (ip2+1)*nslow/np2 - 1;
   plan->mid1_plan =
       remap_3d_create_plan(comm,
-			   first_ilo,first_ihi,first_jlo,first_jhi,
-			   first_klo,first_khi,
-			   second_ilo,second_ihi,second_jlo,second_jhi,
-			   second_klo,second_khi,
-			   2,1,0,2);
+                           first_ilo,first_ihi,first_jlo,first_jhi,
+                           first_klo,first_khi,
+                           second_ilo,second_ihi,second_jlo,second_jhi,
+                           second_klo,second_khi,
+                           2,1,0,2);
   if (plan->mid1_plan == NULL) return NULL;
 
-  // 1d FFTs along mid axis 
+  // 1d FFTs along mid axis
 
   plan->length2 = nmid;
   plan->total2 = nfast * nmid * nslow;
@@ -279,7 +279,7 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
   // remap from 2nd to 3rd FFT
   // if final distribution is permute=2 with all procs owning entire slow axis
   //   then this remapping goes directly to final distribution
-  //  third indices = distribution after 3rd set of FFTs 
+  //  third indices = distribution after 3rd set of FFTs
 
   flag=1;
 
@@ -301,23 +301,23 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
     third_klo = 0;
     third_khi = nslow - 1;
   }
-  
+
   plan->mid2_plan =
     remap_3d_create_plan(comm,
-			 second_jlo,second_jhi,second_klo,second_khi,
-			 second_ilo,second_ihi,
-			 third_jlo,third_jhi,third_klo,third_khi,
-			 third_ilo,third_ihi,
-			 2,1,0,2);
+                         second_jlo,second_jhi,second_klo,second_khi,
+                         second_ilo,second_ihi,
+                         third_jlo,third_jhi,third_klo,third_khi,
+                         third_ilo,third_ihi,
+                         2,1,0,2);
   if (plan->mid2_plan == NULL) return NULL;
 
-  // 1d FFTs along slow axis 
+  // 1d FFTs along slow axis
 
   plan->length3 = nslow;
   plan->total3 = nfast * nmid * nslow;
 
   // remap from 3rd FFT to final distribution
-  //  not needed if permute = 2 and third indices = out indices on all procs 
+  //  not needed if permute = 2 and third indices = out indices on all procs
 
   flag=1;
 
@@ -328,11 +328,11 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
   else {
     plan->post_plan =
       remap_3d_create_plan(comm,
-			   third_klo,third_khi,third_ilo,third_ihi,
-			   third_jlo,third_jhi,
-			   out_klo,out_khi,out_ilo,out_ihi,
-			   out_jlo,out_jhi,
-			   2,(permute+1)%3,0,2);
+                           third_klo,third_khi,third_ilo,third_ihi,
+                           third_jlo,third_jhi,
+                           out_klo,out_khi,out_ilo,out_ihi,
+                           out_jlo,out_jhi,
+                           2,(permute+1)%3,0,2);
     if (plan->post_plan == NULL) return NULL;
   }
 
@@ -343,14 +343,14 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
   // scratch_size = amount needed internally for remap scratch space
   // for each remap:
   //   out space used for result if big enough, else require copy buffer
-  //   accumulate largest required remap scratch space 
+  //   accumulate largest required remap scratch space
 
   out_size = (out_ihi-out_ilo+1) * (out_jhi-out_jlo+1) * (out_khi-out_klo+1);
-  first_size = (first_ihi-first_ilo+1) * (first_jhi-first_jlo+1) * 
+  first_size = (first_ihi-first_ilo+1) * (first_jhi-first_jlo+1) *
     (first_khi-first_klo+1);
-  second_size = (second_ihi-second_ilo+1) * (second_jhi-second_jlo+1) * 
+  second_size = (second_ihi-second_ilo+1) * (second_jhi-second_jlo+1) *
     (second_khi-second_klo+1);
-  third_size = (third_ihi-third_ilo+1) * (third_jhi-third_jlo+1) * 
+  third_size = (third_ihi-third_ilo+1) * (third_jhi-third_jlo+1) *
     (third_khi-third_klo+1);
 
   plan->ihi_out=out_ihi;
@@ -410,15 +410,15 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
   }
   else plan->scratch = NULL;
 
-  // system specific pre-computation of 1d FFT coeffs 
-  // and scaling normalization 
+  // system specific pre-computation of 1d FFT coeffs
+  // and scaling normalization
 
   cufftResult retvalc;
   int nfft = (in_ihi-in_ilo+1) * (in_jhi-in_jlo+1) *
     (in_khi-in_klo+1);
   int nfft_brick = (out_ihi-out_ilo+1) * (out_jhi-out_jlo+1) *
     (out_khi-out_klo+1);
-    
+
   int nfft_both = MAX(nfft,nfft_brick);
   nfft_both=nfast*nmid*nslow;
 
@@ -458,7 +458,7 @@ struct fft_plan_3d *fft_3d_create_plan_cuda(
 }
 
 /* ----------------------------------------------------------------------
-   Destroy a 3d fft plan 
+   Destroy a 3d fft plan
 ------------------------------------------------------------------------- */
 
 void fft_3d_destroy_plan_cuda(struct fft_plan_3d *plan)
@@ -528,7 +528,7 @@ void factor_cuda(int n, int *num, int *list)
 }
 
 /* ----------------------------------------------------------------------
-   divide n into 2 factors of as equal size as possible 
+   divide n into 2 factors of as equal size as possible
 ------------------------------------------------------------------------- */
 
 void bifactor_cuda(int n, int *factor1, int *factor2)
@@ -564,7 +564,7 @@ void fft_1d_only_cuda(FFT_DATA *data, int nsize, int flag, struct fft_plan_3d *p
   int i,total,length,offset,num;
   double norm;
 
-  // system specific constants 
+  // system specific constants
 
 
 
@@ -602,7 +602,7 @@ void fft_1d_only_cuda(FFT_DATA *data, int nsize, int flag, struct fft_plan_3d *p
   }
   cudaMemcpy((void*) data, (void**) &(plan->cudata), plan->cudatasize,cudaMemcpyDeviceToHost);
 
-  // scaling if required 
+  // scaling if required
   // limit num to size of data
 
 #endif
diff --git a/src/USER-CUDA/fft3d_cuda.h b/src/USER-CUDA/fft3d_cuda.h
index 648d7d6584..5ec3871bbb 100644
--- a/src/USER-CUDA/fft3d_cuda.h
+++ b/src/USER-CUDA/fft3d_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,22 +28,22 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
-// User-settable FFT precision 
+// User-settable FFT precision
 
-// FFT_PRECISION = 1 is single-precision complex (4-byte real, 4-byte imag) 
-// FFT_PRECISION = 2 is double-precision complex (8-byte real, 8-byte imag) 
+// FFT_PRECISION = 1 is single-precision complex (4-byte real, 4-byte imag)
+// FFT_PRECISION = 2 is double-precision complex (8-byte real, 8-byte imag)
 #include "cuda_precision.h"
 //#define FFT_PRECISION 2
 
-// ------------------------------------------------------------------------- 
+// -------------------------------------------------------------------------
 
-// Data types for single-precision complex 
+// Data types for single-precision complex
 
 #if FFT_PRECISION_CU == 1
 
@@ -69,9 +69,9 @@ typedef struct {
 
 #endif
 
-// ------------------------------------------------------------------------- 
+// -------------------------------------------------------------------------
 
-// Data types for double-precision complex 
+// Data types for double-precision complex
 
 #if FFT_PRECISION_CU == 2
 
@@ -93,29 +93,29 @@ typedef struct {
 
 #endif
 
-// ------------------------------------------------------------------------- 
+// -------------------------------------------------------------------------
 
-// details of how to do a 3d FFT 
+// details of how to do a 3d FFT
 
 struct fft_plan_3d {
-  struct remap_plan_3d *pre_plan;       // remap from input -> 1st FFTs 
-  struct remap_plan_3d *mid1_plan;      // remap from 1st -> 2nd FFTs 
-  struct remap_plan_3d *mid2_plan;      // remap from 2nd -> 3rd FFTs 
-  struct remap_plan_3d *post_plan;      // remap from 3rd FFTs -> output 
-  FFT_DATA *copy;                   // memory for remap results (if needed) 
-  FFT_DATA *scratch;                // scratch space for remaps 
-  int total1,total2,total3;         // # of 1st,2nd,3rd FFTs (times length) 
-  int length1,length2,length3;      // length of 1st,2nd,3rd FFTs 
-  int pre_target;                   // where to put remap results 
+  struct remap_plan_3d *pre_plan;       // remap from input -> 1st FFTs
+  struct remap_plan_3d *mid1_plan;      // remap from 1st -> 2nd FFTs
+  struct remap_plan_3d *mid2_plan;      // remap from 2nd -> 3rd FFTs
+  struct remap_plan_3d *post_plan;      // remap from 3rd FFTs -> output
+  FFT_DATA *copy;                   // memory for remap results (if needed)
+  FFT_DATA *scratch;                // scratch space for remaps
+  int total1,total2,total3;         // # of 1st,2nd,3rd FFTs (times length)
+  int length1,length2,length3;      // length of 1st,2nd,3rd FFTs
+  int pre_target;                   // where to put remap results
   int mid1_target,mid2_target;
-  int scaled;                       // whether to scale FFT results 
-  int normnum;                      // # of values to rescale 
-  double norm;                      // normalization factor for rescaling 
+  int scaled;                       // whether to scale FFT results
+  int normnum;                      // # of values to rescale
+  double norm;                      // normalization factor for rescaling
 
   double coretime;
   double ffttime;
   int iterate;
-                                    // system specific 1d FFT info 
+                                    // system specific 1d FFT info
 
 #ifdef FFT_CUFFT
   //CUdeviceptr cudata;
@@ -135,7 +135,7 @@ struct fft_plan_3d {
   int init;
 };
 
-// function prototypes 
+// function prototypes
 
 void fft_3d_destroy_plan_cuda(struct fft_plan_3d *);
 void factor_cuda(int, int *, int *);
diff --git a/src/USER-CUDA/fft3d_wrap_cuda.cpp b/src/USER-CUDA/fft3d_wrap_cuda.cpp
index eab2f82e79..0599240662 100644
--- a/src/USER-CUDA/fft3d_wrap_cuda.cpp
+++ b/src/USER-CUDA/fft3d_wrap_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -43,23 +43,23 @@ using namespace LAMMPS_NS;
 /* ---------------------------------------------------------------------- */
 
 FFT3dCuda::FFT3dCuda(LAMMPS *lmp, MPI_Comm comm, int nfast, int nmid, int nslow,
-	     int in_ilo, int in_ihi, int in_jlo, int in_jhi,
-	     int in_klo, int in_khi,
-	     int out_ilo, int out_ihi, int out_jlo, int out_jhi,
-	     int out_klo, int out_khi,
-	     int scaled, int permute, int *nbuf,bool init) : Pointers(lmp)
+             int in_ilo, int in_ihi, int in_jlo, int in_jhi,
+             int in_klo, int in_khi,
+             int out_ilo, int out_ihi, int out_jlo, int out_jhi,
+             int out_klo, int out_khi,
+             int scaled, int permute, int *nbuf,bool init) : Pointers(lmp)
 {
 #ifdef FFT_CUFFT
   plan = fft_3d_create_plan_cuda(comm,nfast,nmid,nslow,
-			    in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
-			    out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
-			    scaled,permute,nbuf,init);
+                            in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
+                            out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
+                            scaled,permute,nbuf,init);
 #endif
 #ifndef FFT_CUFFT
   plan = fft_3d_create_plan(comm,nfast,nmid,nslow,
-			    in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
-			    out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
-			    scaled,permute,nbuf);
+                            in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi,
+                            out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi,
+                            scaled,permute,nbuf);
 #endif
   if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan");
 }
@@ -102,10 +102,10 @@ void FFT3dCuda::timing1d(double *in, int nsize, int flag)
 
 #ifdef FFT_CUFFT
 void FFT3dCuda::set_cudata(void* cudata,void* cudata2)
-{ 
-  
+{
+
   plan->cudata=(cufftData*) cudata;
   plan->cudata2=(cufftData*) cudata2;
-  
+
 }
 #endif
diff --git a/src/USER-CUDA/fft3d_wrap_cuda.h b/src/USER-CUDA/fft3d_wrap_cuda.h
index 911057cbec..1d3680facd 100644
--- a/src/USER-CUDA/fft3d_wrap_cuda.h
+++ b/src/USER-CUDA/fft3d_wrap_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -51,7 +51,7 @@ namespace LAMMPS_NS {
 class FFT3dCuda : protected Pointers {
  public:
   FFT3dCuda(class LAMMPS *, MPI_Comm,int,int,int,int,int,int,int,int,int,
-	int,int,int,int,int,int,int,int,int *,bool);
+        int,int,int,int,int,int,int,int,int *,bool);
   ~FFT3dCuda();
   void compute(double *, double *, int);
   void timing1d(double *, int, int);
diff --git a/src/USER-CUDA/fix_addforce_cuda.cpp b/src/USER-CUDA/fix_addforce_cuda.cpp
index 4b8d3fc03e..03519b80a9 100644
--- a/src/USER-CUDA/fix_addforce_cuda.cpp
+++ b/src/USER-CUDA/fix_addforce_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -75,9 +75,9 @@ FixAddForceCuda::FixAddForceCuda(LAMMPS *lmp, int narg, char **arg) :
       iarg += 2;
     } else error->all(FLERR,"Illegal fix addforce/cuda command");
   }
-  
+
   if(iregion!=-1) error->all(FLERR,"Error: fix addforce/cuda does not currently support 'region' option");
-  
+
   force_flag = 0;
   foriginal[0] = foriginal[1] = foriginal[2] = foriginal[3] = 0.0;
   cu_foriginal = NULL;
@@ -100,7 +100,7 @@ int FixAddForceCuda::setmask()
 void FixAddForceCuda::init()
 {
   if(not cu_foriginal)
-  cu_foriginal = new cCudaData<double, F_FLOAT, x> (foriginal,4);    
+  cu_foriginal = new cCudaData<double, F_FLOAT, x> (foriginal,4);
   if (strstr(update->integrate_style,"respa"))
     nlevels_respa = ((Respa *) update->integrate)->nlevels;
 }
@@ -110,14 +110,14 @@ void FixAddForceCuda::init()
 void FixAddForceCuda::setup(int vflag)
 {
   MYDBG( printf("# CUDA: FixAddForceCuda::setup\n"); )
-	
+
   if (strstr(update->integrate_style,"verlet"))
   {
     Cuda_FixAddForceCuda_Init(&cuda->shared_data);
     cuda->cu_f->upload();
     post_force(vflag);
     cuda->cu_f->download();
-    
+
   }
   else {
     ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1);
diff --git a/src/USER-CUDA/fix_addforce_cuda.h b/src/USER-CUDA/fix_addforce_cuda.h
index 38efa0528d..1bf3251f46 100644
--- a/src/USER-CUDA/fix_addforce_cuda.h
+++ b/src/USER-CUDA/fix_addforce_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -53,7 +53,7 @@ class FixAddForceCuda : public Fix {
   int iregion;
   double xvalue,yvalue,zvalue;
   double foriginal[4],foriginal_all[4];
-  cCudaData<double     , F_FLOAT   		, x>* cu_foriginal;	
+  cCudaData<double     , F_FLOAT                   , x>* cu_foriginal;
   int force_flag;
   int nlevels_respa;
 };
diff --git a/src/USER-CUDA/fix_aveforce_cuda.cpp b/src/USER-CUDA/fix_aveforce_cuda.cpp
index c2fcaa98f2..ed2ca925a6 100644
--- a/src/USER-CUDA/fix_aveforce_cuda.cpp
+++ b/src/USER-CUDA/fix_aveforce_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -77,13 +77,13 @@ FixAveForceCuda::FixAveForceCuda(LAMMPS *lmp, int narg, char **arg) :
     } else error->all(FLERR,"Illegal fix aveforce command");
 
   }
-  
+
   if(iregion!=-1) error->all(FLERR,"Error: fix aveforce/cuda does not currently support 'region' option");
 
   foriginal_all[0] = foriginal_all[1] = foriginal_all[2] = foriginal_all[3] = 0.0;
   foriginal[0] = foriginal[1] = foriginal[2] = foriginal[3] = 0.0;
   cu_foriginal = NULL;
-  
+
 }
 
 /* ---------------------------------------------------------------------- */
@@ -102,7 +102,7 @@ int FixAveForceCuda::setmask()
 void FixAveForceCuda::init()
 {
   if(not cu_foriginal)
-  cu_foriginal = new cCudaData<double, F_FLOAT, x> (foriginal,4);    
+  cu_foriginal = new cCudaData<double, F_FLOAT, x> (foriginal,4);
   if (strstr(update->integrate_style,"respa"))
     nlevels_respa = ((Respa *) update->integrate)->nlevels;
 
@@ -122,7 +122,7 @@ void FixAveForceCuda::setup(int vflag)
     cuda->cu_f->upload();
     post_force(vflag);
     cuda->cu_f->download();
-    
+
   }
   else
   {
@@ -189,11 +189,11 @@ void FixAveForceCuda::post_force_respa(int vflag, int ilevel, int iloop)
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	foriginal[0] += f[i][0];
-	foriginal[1] += f[i][1];
-	foriginal[2] += f[i][2];
-	foriginal[3] += 1;
-	
+        foriginal[0] += f[i][0];
+        foriginal[1] += f[i][1];
+        foriginal[2] += f[i][2];
+        foriginal[3] += 1;
+
       }
 
     MPI_Allreduce(foriginal,foriginal_all,4,MPI_DOUBLE,MPI_SUM,world);
@@ -206,9 +206,9 @@ void FixAveForceCuda::post_force_respa(int vflag, int ilevel, int iloop)
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (xflag) f[i][0] = fave[0];
-	if (yflag) f[i][1] = fave[1];
-	if (zflag) f[i][2] = fave[2];
+        if (xflag) f[i][0] = fave[0];
+        if (yflag) f[i][1] = fave[1];
+        if (zflag) f[i][2] = fave[2];
       }
     cuda->cu_f->upload();
   }
diff --git a/src/USER-CUDA/fix_aveforce_cuda.h b/src/USER-CUDA/fix_aveforce_cuda.h
index 987ee9d996..418210e472 100644
--- a/src/USER-CUDA/fix_aveforce_cuda.h
+++ b/src/USER-CUDA/fix_aveforce_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -54,7 +54,7 @@ class FixAveForceCuda : public Fix {
   double xvalue,yvalue,zvalue;
   double foriginal_all[4];
   double foriginal[4];
-  cCudaData<double     , F_FLOAT   		, x>* cu_foriginal;	
+  cCudaData<double     , F_FLOAT                   , x>* cu_foriginal;
   int nlevels_respa;
 };
 
diff --git a/src/USER-CUDA/fix_enforce2d_cuda.cpp b/src/USER-CUDA/fix_enforce2d_cuda.cpp
index 3cf64a2f3c..8e482c1478 100644
--- a/src/USER-CUDA/fix_enforce2d_cuda.cpp
+++ b/src/USER-CUDA/fix_enforce2d_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -78,13 +78,13 @@ void FixEnforce2DCuda::init()
 {
   if (domain->dimension == 3)
     error->all(FLERR,"Cannot use fix enforce2d/cuda with 3d simulation");
-  if (atom->omega_flag) 
+  if (atom->omega_flag)
     error->warning(FLERR,"Enforce2d/cuda does not support omega_flag on gpu yet. Will be handled on cpu.");
-  	
+
   if (atom->angmom_flag)
     error->warning(FLERR,"Enforce2d/cuda does not support angmom_flag (angular momentum) on gpu yet. Will be handled on cpu.");
 
-  if (atom->torque_flag) 
+  if (atom->torque_flag)
     error->warning(FLERR,"Enforce2d/cuda does not support torque_flag on gpu yet. Will be handled on cpu.");
 }
 
@@ -127,13 +127,13 @@ void FixEnforce2DCuda::post_force(int vflag)
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
   if (igroup == atom->firstgroup) nlocal = atom->nfirst;
-  
+
   if (atom->omega_flag) {
     double **omega = atom->omega;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	omega[i][0] = 0.0;
-	omega[i][1] = 0.0;
+        omega[i][0] = 0.0;
+        omega[i][1] = 0.0;
       }
   }
 
@@ -141,8 +141,8 @@ void FixEnforce2DCuda::post_force(int vflag)
     double **angmom = atom->angmom;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	angmom[i][0] = 0.0;
-	angmom[i][1] = 0.0;
+        angmom[i][0] = 0.0;
+        angmom[i][1] = 0.0;
       }
   }
 
@@ -150,10 +150,10 @@ void FixEnforce2DCuda::post_force(int vflag)
     double **torque = atom->torque;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	torque[i][0] = 0.0;
-	torque[i][1] = 0.0;
+        torque[i][0] = 0.0;
+        torque[i][1] = 0.0;
       }
-  }  
+  }
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/fix_enforce2d_cuda.h b/src/USER-CUDA/fix_enforce2d_cuda.h
index 2abb1ffa18..c8b01e6bed 100644
--- a/src/USER-CUDA/fix_enforce2d_cuda.h
+++ b/src/USER-CUDA/fix_enforce2d_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/fix_freeze_cuda.cpp b/src/USER-CUDA/fix_freeze_cuda.cpp
index 818d1be560..c9f9b4366d 100644
--- a/src/USER-CUDA/fix_freeze_cuda.cpp
+++ b/src/USER-CUDA/fix_freeze_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -79,7 +79,7 @@ int FixFreezeCuda::setmask()
 void FixFreezeCuda::init()
 {
   if(not cu_foriginal)
-  cu_foriginal = new cCudaData<double, F_FLOAT, x> (foriginal,3);    
+  cu_foriginal = new cCudaData<double, F_FLOAT, x> (foriginal,3);
   int count = 0;
   for (int i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"freeze") == 0) count++;
@@ -91,14 +91,14 @@ void FixFreezeCuda::init()
 void FixFreezeCuda::setup(int vflag)
 {
   MYDBG( printf("# CUDA: FixFreezeCuda::setup\n"); )
-	
+
   if (strstr(update->integrate_style,"verlet"))
   {
     Cuda_FixFreezeCuda_Init(&cuda->shared_data);
     cuda->cu_f->upload();
     post_force(vflag);
     cuda->cu_f->download();
-    
+
   }
 
   MYDBG( printf("# CUDA: FixFreezeCuda::setup done\n"); )
diff --git a/src/USER-CUDA/fix_freeze_cuda.h b/src/USER-CUDA/fix_freeze_cuda.h
index 019301096c..7808a59d62 100644
--- a/src/USER-CUDA/fix_freeze_cuda.h
+++ b/src/USER-CUDA/fix_freeze_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -47,7 +47,7 @@ class FixFreezeCuda : public Fix {
  private:
   class Cuda *cuda;
   double foriginal[3],foriginal_all[3];
-  cCudaData<double     , F_FLOAT   		, x>* cu_foriginal;	
+  cCudaData<double     , F_FLOAT                   , x>* cu_foriginal;
   int force_flag;
 };
 
diff --git a/src/USER-CUDA/fix_gravity_cuda.cpp b/src/USER-CUDA/fix_gravity_cuda.cpp
index 6c61c13e78..549f95edbf 100644
--- a/src/USER-CUDA/fix_gravity_cuda.cpp
+++ b/src/USER-CUDA/fix_gravity_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -134,14 +134,14 @@ void FixGravityCuda::init()
 void FixGravityCuda::setup(int vflag)
 {
   MYDBG( printf("# CUDA: FixGravityCuda::setup\n"); )
-	
+
   if (strstr(update->integrate_style,"verlet"))
   {
     Cuda_FixGravityCuda_Init(&cuda->shared_data);
     cuda->cu_f->upload();
     post_force(vflag);
     cuda->cu_f->download();
-    
+
   }
   else {
   }
@@ -156,16 +156,16 @@ void FixGravityCuda::post_force(int vflag)
 
   if (style == GRADIENT) {
     if (domain->dimension == 3) {
-      double phi_current = degree2rad * 
-	(phi + (update->ntimestep - time_origin)*dt*phigrad*360.0);
-      double theta_current = degree2rad * 
-	(theta + (update->ntimestep - time_origin)*dt*thetagrad*360.0);
+      double phi_current = degree2rad *
+        (phi + (update->ntimestep - time_origin)*dt*phigrad*360.0);
+      double theta_current = degree2rad *
+        (theta + (update->ntimestep - time_origin)*dt*thetagrad*360.0);
       xgrav = sin(theta_current) * cos(phi_current);
       ygrav = sin(theta_current) * sin(phi_current);
       zgrav = cos(theta_current);
     } else {
-      double theta_current = degree2rad * 
-	(theta + (update->ntimestep - time_origin)*dt*thetagrad*360.0);
+      double theta_current = degree2rad *
+        (theta + (update->ntimestep - time_origin)*dt*thetagrad*360.0);
       xgrav = sin(theta_current);
       ygrav = cos(theta_current);
     }
@@ -177,5 +177,3 @@ void FixGravityCuda::post_force(int vflag)
   MYDBG( printf("# CUDA: FixGravityCuda::postforce start\n"); )
   Cuda_FixGravityCuda_PostForce(&cuda->shared_data, groupbit, xacc,yacc,zacc);
 }
-
-
diff --git a/src/USER-CUDA/fix_gravity_cuda.h b/src/USER-CUDA/fix_gravity_cuda.h
index f4aef37790..23d0b2102e 100644
--- a/src/USER-CUDA/fix_gravity_cuda.h
+++ b/src/USER-CUDA/fix_gravity_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/fix_nh_cuda.cpp b/src/USER-CUDA/fix_nh_cuda.cpp
index 439a921568..6a426dd50c 100644
--- a/src/USER-CUDA/fix_nh_cuda.cpp
+++ b/src/USER-CUDA/fix_nh_cuda.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,7 +45,7 @@ enum{NONE,XYZ,XY,YZ,XZ};
 enum{ISO,ANISO,TRICLINIC};
 
 /* ----------------------------------------------------------------------
-   NVT,NPH,NPT integrators for improved Nose-Hoover equations of motion 
+   NVT,NPH,NPT integrators for improved Nose-Hoover equations of motion
  ---------------------------------------------------------------------- */
 
 FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
@@ -76,7 +76,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   deviatoric_flag = 0;
   nreset_h0 = 0;
 
-  // Used by FixNVTSllod to preserve non-default value  
+  // Used by FixNVTSllod to preserve non-default value
 
   mtchain_default_flag = 1;
 
@@ -103,7 +103,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       t_stop = atof(arg[iarg+2]);
       t_period = atof(arg[iarg+3]);
       if (t_start < 0.0 || t_stop <= 0.0)
-	error->all(FLERR,"Target T for fix nvt/npt/nph cannot be 0.0");
+        error->all(FLERR,"Target T for fix nvt/npt/nph cannot be 0.0");
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"iso") == 0) {
@@ -114,10 +114,10 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
       p_flag[0] = p_flag[1] = p_flag[2] = 1;
       if (dimension == 2) {
-	p_start[2] = p_stop[2] = p_period[2] = 0.0;
-	p_flag[2] = 0;
+        p_start[2] = p_stop[2] = p_period[2] = 0.0;
+        p_flag[2] = 0;
       }
-      iarg += 4; 
+      iarg += 4;
     } else if (strcmp(arg[iarg],"aniso") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       pcouple = NONE;
@@ -126,8 +126,8 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
       p_flag[0] = p_flag[1] = p_flag[2] = 1;
       if (dimension == 2) {
-	p_start[2] = p_stop[2] = p_period[2] = 0.0;
-	p_flag[2] = 0;
+        p_start[2] = p_stop[2] = p_period[2] = 0.0;
+        p_flag[2] = 0;
       }
       iarg += 4;
     } else if (strcmp(arg[iarg],"tri") == 0) {
@@ -142,12 +142,12 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[3] = p_period[4] = p_period[5] = atof(arg[iarg+3]);
       p_flag[3] = p_flag[4] = p_flag[5] = 1;
       if (dimension == 2) {
-	p_start[2] = p_stop[2] = p_period[2] = 0.0;
-	p_flag[2] = 0;
-	p_start[3] = p_stop[3] = p_period[3] = 0.0;
-	p_flag[3] = 0;
-	p_start[4] = p_stop[4] = p_period[4] = 0.0;
-	p_flag[4] = 0;
+        p_start[2] = p_stop[2] = p_period[2] = 0.0;
+        p_flag[2] = 0;
+        p_start[3] = p_stop[3] = p_period[3] = 0.0;
+        p_flag[3] = 0;
+        p_start[4] = p_stop[4] = p_period[4] = 0.0;
+        p_flag[4] = 0;
       }
       iarg += 4;
 
@@ -158,7 +158,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[0] = atof(arg[iarg+3]);
       p_flag[0] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
     } else if (strcmp(arg[iarg],"y") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[1] = atof(arg[iarg+1]);
@@ -166,7 +166,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[1] = atof(arg[iarg+3]);
       p_flag[1] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
     } else if (strcmp(arg[iarg],"z") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[2] = atof(arg[iarg+1]);
@@ -174,9 +174,9 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[2] = atof(arg[iarg+3]);
       p_flag[2] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
       if (dimension == 2)
-	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
+        error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
 
     } else if (strcmp(arg[iarg],"yz") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
@@ -185,9 +185,9 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[3] = atof(arg[iarg+3]);
       p_flag[3] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
       if (dimension == 2)
-	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
+        error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xz") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[4] = atof(arg[iarg+1]);
@@ -195,9 +195,9 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[4] = atof(arg[iarg+3]);
       p_flag[4] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
       if (dimension == 2)
-	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
+        error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xy") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[5] = atof(arg[iarg+1]);
@@ -205,7 +205,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[5] = atof(arg[iarg+3]);
       p_flag[5] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
 
     } else if (strcmp(arg[iarg],"couple") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
@@ -293,38 +293,38 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   if (p_flag[5] && domain->yperiodic == 0)
     error->all(FLERR,"Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
 
-  if (!domain->triclinic && (p_flag[3] || p_flag[4] || p_flag[5])) 
+  if (!domain->triclinic && (p_flag[3] || p_flag[4] || p_flag[5]))
     error->all(FLERR,"Can not specify Pxy/Pxz/Pyz in "
-	       "fix nvt/npt/nph with non-triclinic box");
+               "fix nvt/npt/nph with non-triclinic box");
 
   if (pcouple == XYZ && dimension == 3 &&
-      (p_start[0] != p_start[1] || p_start[0] != p_start[2] || 
-       p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] || 
+      (p_start[0] != p_start[1] || p_start[0] != p_start[2] ||
+       p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] ||
        p_period[0] != p_period[1] || p_period[0] != p_period[2]))
     error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
   if (pcouple == XYZ && dimension == 2 &&
-      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
+      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] ||
        p_period[0] != p_period[1]))
     error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
-  if (pcouple == XY && 
-      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
+  if (pcouple == XY &&
+      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] ||
        p_period[0] != p_period[1]))
     error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
-  if (pcouple == YZ && 
+  if (pcouple == YZ &&
       (p_start[1] != p_start[2] || p_stop[1] != p_stop[2] ||
        p_period[1] != p_period[2]))
     error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
-  if (pcouple == XZ && 
+  if (pcouple == XZ &&
       (p_start[0] != p_start[2] || p_stop[0] != p_stop[2] ||
        p_period[0] != p_period[2]))
     error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
 
-  if ((tstat_flag && t_period <= 0.0) || 
-      (p_flag[0] && p_period[0] <= 0.0) || 
-      (p_flag[1] && p_period[1] <= 0.0) || 
+  if ((tstat_flag && t_period <= 0.0) ||
+      (p_flag[0] && p_period[0] <= 0.0) ||
+      (p_flag[1] && p_period[1] <= 0.0) ||
       (p_flag[2] && p_period[2] <= 0.0) ||
-      (p_flag[3] && p_period[3] <= 0.0) || 
-      (p_flag[4] && p_period[4] <= 0.0) || 
+      (p_flag[3] && p_period[3] <= 0.0) ||
+      (p_flag[4] && p_period[4] <= 0.0) ||
       (p_flag[5] && p_period[5] <= 0.0))
     error->all(FLERR,"Fix nvt/npt/nph damping parameters must be > 0.0");
 
@@ -393,7 +393,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
     if (pstyle == ISO) size_vector += 2*2*1;
     else if (pstyle == ANISO) size_vector += 2*2*3;
     else if (pstyle == TRICLINIC) size_vector += 2*2*6;
-    
+
     if (mpchain) {
       int ich;
       etap = new double[mpchain];
@@ -404,8 +404,8 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       etap_dot[mpchain] = 0.0;
       etap_dotdot = new double[mpchain];
       for (ich = 0; ich < mpchain; ich++) {
-	etap[ich] = etap_dot[ich] = 
-	  etap_dotdot[ich] = 0.0;
+        etap[ich] = etap_dot[ich] =
+          etap_dotdot[ich] = 0.0;
       }
       etap_mass = new double[mpchain];
       size_vector += 2*2*mpchain;
@@ -422,9 +422,9 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 
   vol0 = t0 = 0.0;
 }
-  
+
 /* ---------------------------------------------------------------------- */
-  
+
 FixNHCuda::~FixNHCuda()
 {
   delete [] rfix;
@@ -475,18 +475,18 @@ void FixNHCuda::init()
   if (pstat_flag)
     for (int i = 0; i < modify->nfix; i++)
       if (strcmp(modify->fix[i]->style,"deform") == 0) {
-	int *dimflag = ((FixDeform *) modify->fix[i])->dimflag;
-	if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || 
-	    (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || 
-	    (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
-	  error->all(FLERR,"Cannot use fix npt and fix deform on "
-		     "same component of stress tensor");
+        int *dimflag = ((FixDeform *) modify->fix[i])->dimflag;
+        if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
+            (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) ||
+            (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
+          error->all(FLERR,"Cannot use fix npt and fix deform on "
+                     "same component of stress tensor");
       }
 
   // set temperature and pressure ptrs
 
   int icompute = modify->find_compute(id_temp);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Temperature ID for fix nvt/nph/npt does not exist");
   temperature = modify->compute[icompute];
 
@@ -524,7 +524,7 @@ void FixNHCuda::init()
     tdrag_factor = 1.0 - (update->dt * t_freq * drag / nc_tchain);
 
   // tally the number of dimensions that are barostatted
-  // also compute the initial volume and reference cell  
+  // also compute the initial volume and reference cell
   // set initial volume and reference cell, if not already done
 
   if (pstat_flag) {
@@ -571,11 +571,11 @@ void FixNHCuda::init()
   triggerneighsq= cuda->shared_data.atom.triggerneighsq;
   cuda->neighbor_decide_by_integrator=1;
   Cuda_FixNHCuda_Init(&cuda->shared_data,dtv,dtf);
-  
+
 }
 
 /* ----------------------------------------------------------------------
-   compute T,P before integrator starts 
+   compute T,P before integrator starts
 ------------------------------------------------------------------------- */
 
 void FixNHCuda::setup(int vflag)
@@ -588,7 +588,7 @@ void FixNHCuda::setup(int vflag)
 
   // t_target is used by compute_scalar(), even for NPH
 
-  if (tstat_flag) t_target = t_start;                      
+  if (tstat_flag) t_target = t_start;
   else if (pstat_flag) {
 
     // t0 = initial value for piston mass and energy conservation
@@ -600,8 +600,8 @@ void FixNHCuda::setup(int vflag)
     if (t0 == 0.0) {
       t0 = temperature->compute_scalar();
       if (t0 == 0.0) {
-	if (strcmp(update->unit_style,"lj") == 0) t0 = 1.0;
-	else t0 = 300.0;
+        if (strcmp(update->unit_style,"lj") == 0) t0 = 1.0;
+        else t0 = 300.0;
       }
     }
     t_target = t0;
@@ -625,7 +625,7 @@ void FixNHCuda::setup(int vflag)
       eta_mass[ich] = boltz * t_target / (t_freq*t_freq);
     for (int ich = 1; ich < mtchain; ich++) {
       eta_dotdot[ich] = (eta_mass[ich-1]*eta_dot[ich-1]*eta_dot[ich-1] -
-			 boltz*t_target) / eta_mass[ich];
+                         boltz*t_target) / eta_mass[ich];
     }
   }
 
@@ -635,11 +635,11 @@ void FixNHCuda::setup(int vflag)
 
     for (int i = 0; i < 3; i++)
       if (p_flag[i])
-	omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
+        omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
 
     if (pstyle == TRICLINIC) {
       for (int i = 3; i < 6; i++)
-	if (p_flag[i]) omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
+        if (p_flag[i]) omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
     }
 
   // initial forces on barostat thermostat variables
@@ -647,11 +647,11 @@ void FixNHCuda::setup(int vflag)
     if (mpchain) {
       etap_mass[0] = boltz * t_target / (p_freq_max*p_freq_max);
       for (int ich = 1; ich < mpchain; ich++)
-	etap_mass[ich] = boltz * t_target / (p_freq_max*p_freq_max);
+        etap_mass[ich] = boltz * t_target / (p_freq_max*p_freq_max);
       for (int ich = 1; ich < mpchain; ich++)
-	etap_dotdot[ich] = 
-	  (etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] -
-	   boltz*t_target) / etap_mass[ich];
+        etap_dotdot[ich] =
+          (etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] -
+           boltz*t_target) / etap_mass[ich];
     }
 
     // compute appropriately coupled elements of mvv_current
@@ -661,17 +661,17 @@ void FixNHCuda::setup(int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   1st half of Verlet update 
+   1st half of Verlet update
 ------------------------------------------------------------------------- */
 
 void FixNHCuda::initial_integrate(int vflag)
 {
   if(!temperature->cudable) cuda->downloadAll();
 
-  if(triggerneighsq!=cuda->shared_data.atom.triggerneighsq) 
+  if(triggerneighsq!=cuda->shared_data.atom.triggerneighsq)
   {
-	triggerneighsq= cuda->shared_data.atom.triggerneighsq;
-	Cuda_FixNHCuda_Init(&cuda->shared_data,dtv,dtf);
+        triggerneighsq= cuda->shared_data.atom.triggerneighsq;
+        Cuda_FixNHCuda_Init(&cuda->shared_data,dtv,dtf);
   }
 
   // update eta_press_dot
@@ -713,8 +713,8 @@ void FixNHCuda::initial_integrate(int vflag)
       compute_press_target();
       nh_omega_dot();
       factor[0] = exp(-dt4*(omega_dot[0]+mtk_term2));
-  	  factor[1] = exp(-dt4*(omega_dot[1]+mtk_term2));
-  	  factor[2] = exp(-dt4*(omega_dot[2]+mtk_term2));
+            factor[1] = exp(-dt4*(omega_dot[1]+mtk_term2));
+            factor[2] = exp(-dt4*(omega_dot[2]+mtk_term2));
       Cuda_FixNHCuda_nh_v_press_and_nve_v_NoBias(&cuda->shared_data, groupbit, factor,(igroup == atom->firstgroup)?atom->nfirst:atom->nlocal,(pstyle == TRICLINIC)?1:0);
     }
     else
@@ -722,28 +722,28 @@ void FixNHCuda::initial_integrate(int vflag)
   }
   else if(which==BIAS)
   {
-  	if(pstat_flag)
-  	{
+          if(pstat_flag)
+          {
       compute_press_target();
       nh_omega_dot();
-  	  factor[0] = exp(-dt4*(omega_dot[0]+mtk_term2));
-  	  factor[1] = exp(-dt4*(omega_dot[1]+mtk_term2));
-  	  factor[2] = exp(-dt4*(omega_dot[2]+mtk_term2));
-  	  if(!temperature->cudable) 
-  	  {
-  	  	nh_v_press();
-  	  	cuda->cu_v->upload();
-  	  }
-  	  else
-  	  {
-   	    int groupbit_org=temperature->groupbit;
-   	    temperature->groupbit=groupbit;	
-  	    temperature->remove_bias_all();
+            factor[0] = exp(-dt4*(omega_dot[0]+mtk_term2));
+            factor[1] = exp(-dt4*(omega_dot[1]+mtk_term2));
+            factor[2] = exp(-dt4*(omega_dot[2]+mtk_term2));
+            if(!temperature->cudable)
+            {
+                    nh_v_press();
+                    cuda->cu_v->upload();
+            }
+            else
+            {
+               int groupbit_org=temperature->groupbit;
+               temperature->groupbit=groupbit;
+              temperature->remove_bias_all();
         Cuda_FixNHCuda_nh_v_press(&cuda->shared_data, groupbit, factor,(igroup == atom->firstgroup)?atom->nfirst:atom->nlocal,(pstyle == TRICLINIC)?1:0);
-  	    temperature->restore_bias_all();
-    	temperature->groupbit=groupbit_org;
-  	  }
-  	}
+              temperature->restore_bias_all();
+            temperature->groupbit=groupbit_org;
+            }
+          }
     Cuda_FixNHCuda_nve_v(&cuda->shared_data,groupbit,(igroup == atom->firstgroup)?atom->nfirst:atom->nlocal);
   }
 
@@ -763,7 +763,7 @@ void FixNHCuda::initial_integrate(int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   2nd half of Verlet update 
+   2nd half of Verlet update
 ------------------------------------------------------------------------- */
 
 void FixNHCuda::final_integrate()
@@ -786,33 +786,33 @@ void FixNHCuda::final_integrate()
   else if(which==BIAS)
   {
     Cuda_FixNHCuda_nve_v(&cuda->shared_data,groupbit,(igroup == atom->firstgroup)?atom->nfirst:atom->nlocal);
-    	
-  	if(pstat_flag)
-  	{
+
+          if(pstat_flag)
+          {
       factor[0] = exp(-dt4*(omega_dot[0]+mtk_term2));
       factor[1] = exp(-dt4*(omega_dot[1]+mtk_term2));
       factor[2] = exp(-dt4*(omega_dot[2]+mtk_term2));
-  	  if(!temperature->cudable) 
-  	  {
-  	  	cuda->cu_v->download();
-  	  	nh_v_press();
-  	  	cuda->cu_v->upload();
-  	  }
-  	  else
-  	  {
-    	int groupbit_org=temperature->groupbit;
-    	temperature->groupbit=groupbit;
- 	    temperature->remove_bias_all();
+            if(!temperature->cudable)
+            {
+                    cuda->cu_v->download();
+                    nh_v_press();
+                    cuda->cu_v->upload();
+            }
+            else
+            {
+            int groupbit_org=temperature->groupbit;
+            temperature->groupbit=groupbit;
+             temperature->remove_bias_all();
         Cuda_FixNHCuda_nh_v_press(&cuda->shared_data, groupbit, factor,(igroup == atom->firstgroup)?atom->nfirst:atom->nlocal,(pstyle == TRICLINIC)?1:0);
-  	    temperature->restore_bias_all();
-    	temperature->groupbit=groupbit_org;
-  	  }
-  	}
+              temperature->restore_bias_all();
+            temperature->groupbit=groupbit_org;
+            }
+          }
   }
   // compute new T,P
   // compute appropriately coupled elements of mvv_current
 
-  if(!temperature->cudable)	cuda->cu_v->download();
+  if(!temperature->cudable)        cuda->cu_v->download();
   t_current = temperature->compute_scalar();
   if (pstat_flag) {
     if (pstyle == ISO) double tmp = pressure->compute_scalar();
@@ -849,7 +849,7 @@ void FixNHCuda::initial_integrate_respa(int vflag, int ilevel, int iloop)
   if (ilevel == nlevels_respa-1) {
 
     // update eta_press_dot
-    
+
     if (pstat_flag && mpchain) nhc_press_integrate();
 
     // update eta_dot
@@ -860,7 +860,7 @@ void FixNHCuda::initial_integrate_respa(int vflag, int ilevel, int iloop)
       t_target = t_start + delta * (t_stop-t_start);
       eta_mass[0] = tdof * boltz * t_target / (t_freq*t_freq);
       for (int ich = 1; ich < mtchain; ich++)
-	eta_mass[ich] = boltz * t_target / (t_freq*t_freq);
+        eta_mass[ich] = boltz * t_target / (t_freq*t_freq);
       nhc_temp_integrate();
     }
 
@@ -870,17 +870,17 @@ void FixNHCuda::initial_integrate_respa(int vflag, int ilevel, int iloop)
 
     if (pstat_flag) {
       if (pstyle == ISO) {
-	temperature->compute_scalar();
-	double tmp = pressure->compute_scalar();
+        temperature->compute_scalar();
+        double tmp = pressure->compute_scalar();
       } else {
-       	temperature->compute_vector();
-	pressure->compute_vector();
+               temperature->compute_vector();
+        pressure->compute_vector();
       }
       couple();
       pressure->addstep(update->ntimestep+1);
       if (mtk_flag) couple_ke();
     }
-    
+
     if (pstat_flag) {
       compute_press_target();
       nh_omega_dot();
@@ -900,10 +900,10 @@ void FixNHCuda::initial_integrate_respa(int vflag, int ilevel, int iloop)
     if (pstat_flag) remap();
   }
 
-  // if barostat, redo KSpace coeffs at outermost level, 
+  // if barostat, redo KSpace coeffs at outermost level,
   // since volume has changed
 
-  if (ilevel == nlevels_respa-1 && kspace_flag && pstat_flag) 
+  if (ilevel == nlevels_respa-1 && kspace_flag && pstat_flag)
     force->kspace->setup();
 }
 
@@ -951,9 +951,9 @@ void FixNHCuda::couple()
     p_current[1] = tensor[1];
     p_current[2] = tensor[2];
   }
-  
-  // switch order from xy-xz-yz to Voigt 
-  
+
+  // switch order from xy-xz-yz to Voigt
+
   if (pstyle == TRICLINIC) {
     p_current[3] = tensor[5];
     p_current[4] = tensor[4];
@@ -967,7 +967,7 @@ void FixNHCuda::couple_ke()
 {
   double *tensor = temperature->vector;
   if (pstyle == ISO)
-    mvv_current[0] = mvv_current[1] = mvv_current[2] = 
+    mvv_current[0] = mvv_current[1] = mvv_current[2] =
       tdof * boltz * t_current/dimension;
   else if (pcouple == XYZ) {
     double ave = 1.0/3.0 * (tensor[0] + tensor[1] + tensor[2]);
@@ -1016,7 +1016,7 @@ void FixNHCuda::remap()
   else {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	domain->x2lamda(x[i],x[i]);
+        domain->x2lamda(x[i],x[i]);
   }
 
   if (nrigid)
@@ -1026,16 +1026,16 @@ void FixNHCuda::remap()
   // reset global and local box to new size/shape
 
   // This operation corresponds to applying the
-  // translate and scale operations 
+  // translate and scale operations
   // corresponding to the solution of the following ODE:
   //
   // h_dot = omega_dot * h
   //
   // where h_dot, omega_dot and h are all upper-triangular
-  // 3x3 tensors. In Voigt notation, the elements of the 
+  // 3x3 tensors. In Voigt notation, the elements of the
   // RHS product tensor are:
   // h_dot = [0*0, 1*1, 2*2, 1*3+3*2, 0*4+5*3+4*2, 0*5+5*1]
-  // 
+  //
   // Ordering of operations preserves time symmetry.
 
   double dto2 = dto/2.0;
@@ -1045,19 +1045,19 @@ void FixNHCuda::remap()
   if (pstyle == TRICLINIC) {
 
     h[4] *= exp(dto8*omega_dot[0]);
-    h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); 
+    h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
     h[4] *= exp(dto8*omega_dot[0]);
 
     h[3] *= exp(dto4*omega_dot[1]);
-    h[3] += dto2*(omega_dot[3]*h[2]); 
+    h[3] += dto2*(omega_dot[3]*h[2]);
     h[3] *= exp(dto4*omega_dot[1]);
 
     h[5] *= exp(dto4*omega_dot[0]);
-    h[5] += dto2*(omega_dot[5]*h[1]); 
+    h[5] += dto2*(omega_dot[5]*h[1]);
     h[5] *= exp(dto4*omega_dot[0]);
 
     h[4] *= exp(dto8*omega_dot[0]);
-    h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); 
+    h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
     h[4] *= exp(dto8*omega_dot[0]);
 
   }
@@ -1075,19 +1075,19 @@ void FixNHCuda::remap()
   if (pstyle == TRICLINIC) {
 
     h[4] *= exp(dto8*omega_dot[0]);
-    h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); 
+    h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
     h[4] *= exp(dto8*omega_dot[0]);
 
     h[3] *= exp(dto4*omega_dot[1]);
-    h[3] += dto2*(omega_dot[3]*h[2]); 
+    h[3] += dto2*(omega_dot[3]*h[2]);
     h[3] *= exp(dto4*omega_dot[1]);
 
     h[5] *= exp(dto4*omega_dot[0]);
-    h[5] += dto2*(omega_dot[5]*h[1]); 
+    h[5] += dto2*(omega_dot[5]*h[1]);
     h[5] *= exp(dto4*omega_dot[0]);
 
     h[4] *= exp(dto8*omega_dot[0]);
-    h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); 
+    h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
     h[4] *= exp(dto8*omega_dot[0]);
 
     domain->yz = h[3];
@@ -1095,10 +1095,10 @@ void FixNHCuda::remap()
     domain->xy = h[5];
 
     if (domain->yz < -0.5*domain->yprd || domain->yz > 0.5*domain->yprd ||
-	domain->xz < -0.5*domain->xprd || domain->xz > 0.5*domain->xprd ||
-	domain->xy < -0.5*domain->xprd || domain->xy > 0.5*domain->xprd)
+        domain->xz < -0.5*domain->xprd || domain->xz > 0.5*domain->xprd ||
+        domain->xy < -0.5*domain->xprd || domain->xy > 0.5*domain->xprd)
       error->all(FLERR,"Fix npt/nph has tilted box too far - "
-		 "box flips are not yet implemented");
+                 "box flips are not yet implemented");
   }
 
   domain->set_global_box();
@@ -1110,7 +1110,7 @@ void FixNHCuda::remap()
   else {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	domain->lamda2x(x[i],x[i]);
+        domain->lamda2x(x[i],x[i]);
   }
 
   if (nrigid)
@@ -1119,7 +1119,7 @@ void FixNHCuda::remap()
 }
 
 /* ----------------------------------------------------------------------
-   pack entire state of Fix into one write 
+   pack entire state of Fix into one write
 ------------------------------------------------------------------------- */
 
 void FixNHCuda::write_restart(FILE *fp)
@@ -1163,9 +1163,9 @@ void FixNHCuda::write_restart(FILE *fp)
     list[n++] = mpchain;
     if (mpchain) {
       for (int ich = 0; ich < mpchain; ich++)
-	list[n++] = etap[ich];
+        list[n++] = etap[ich];
       for (int ich = 0; ich < mpchain; ich++)
-	list[n++] = etap_dot[ich];
+        list[n++] = etap_dot[ich];
     }
 
     list[n++] = deviatoric_flag;
@@ -1189,7 +1189,7 @@ void FixNHCuda::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix 
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixNHCuda::restart(char *buf)
@@ -1201,9 +1201,9 @@ void FixNHCuda::restart(char *buf)
     int m = static_cast<int> (list[n++]);
     if (tstat_flag && m == mtchain) {
       for (int ich = 0; ich < mtchain; ich++)
-	eta[ich] = list[n++];
+        eta[ich] = list[n++];
       for (int ich = 0; ich < mtchain; ich++)
-	eta_dot[ich] = list[n++];
+        eta_dot[ich] = list[n++];
     } else n += 2*m;
   }
   flag = static_cast<int> (list[n++]);
@@ -1225,9 +1225,9 @@ void FixNHCuda::restart(char *buf)
     int m = static_cast<int> (list[n++]);
     if (pstat_flag && m == mpchain) {
       for (int ich = 0; ich < mpchain; ich++)
-	etap[ich] = list[n++];
+        etap[ich] = list[n++];
       for (int ich = 0; ich < mpchain; ich++)
-	etap_dot[ich] = list[n++];
+        etap_dot[ich] = list[n++];
     } else n+=2*m;
     flag = static_cast<int> (list[n++]);
     if (flag) {
@@ -1269,8 +1269,8 @@ int FixNHCuda::modify_param(int narg, char **arg)
 
     if (pstat_flag) {
       icompute = modify->find_compute(id_press);
-      if (icompute < 0) 
-	error->all(FLERR,"Pressure ID for fix modify does not exist");
+      if (icompute < 0)
+        error->all(FLERR,"Pressure ID for fix modify does not exist");
       modify->compute[icompute]->reset_extra_compute_fix(id_temp);
     }
 
@@ -1323,7 +1323,7 @@ double FixNHCuda::compute_scalar()
   //       M = mtchain
   //       p_eta_k = Q_k*eta_dot[k-1]
   //       Q_1 = L*k*T/t_freq^2
-  //       Q_k = k*T/t_freq^2, k > 1 
+  //       Q_k = k*T/t_freq^2, k > 1
 
   if (tstat_flag) {
     energy += lkt * eta[0] + 0.5*eta_mass[0]*eta_dot[0]*eta_dot[0];
@@ -1339,16 +1339,16 @@ double FixNHCuda::compute_scalar()
   //       W = N*k*T/p_freq^2
   //       sum is over barostatted dimensions
 
-  if (pstat_flag) { 
+  if (pstat_flag) {
     for (i = 0; i < 3; i++)
       if (p_flag[i])
-	energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i] +
-	  p_hydro*(volume-vol0) / (pdim*nktv2p);
+        energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i] +
+          p_hydro*(volume-vol0) / (pdim*nktv2p);
 
     if (pstyle == TRICLINIC) {
       for (i = 3; i < 6; i++)
-	if (p_flag[i])
-	  energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i]; 
+        if (p_flag[i])
+          energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i];
     }
 
     // extra contributions from thermostat chain for barostat
@@ -1356,8 +1356,8 @@ double FixNHCuda::compute_scalar()
     if (mpchain) {
       energy += lkt_press * etap[0] + 0.5*etap_mass[0]*etap_dot[0]*etap_dot[0];
       for (ich = 1; ich < mpchain; ich++)
-	energy += kt * etap[ich] + 
-	  0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
+        energy += kt * etap[ich] +
+          0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
     }
 
     // extra contribution from strain energy
@@ -1383,7 +1383,7 @@ double FixNHCuda::compute_vector(int n)
 {
   int ilen;
 
-  if (tstat_flag) { 
+  if (tstat_flag) {
     ilen = mtchain;
     if (n < ilen) return eta[n];
     n -= ilen;
@@ -1392,7 +1392,7 @@ double FixNHCuda::compute_vector(int n)
     n -= ilen;
   }
 
-  if (pstat_flag) { 
+  if (pstat_flag) {
     if (pstyle == ISO) {
       ilen = 1;
       if (n < ilen) return omega[n];
@@ -1406,7 +1406,7 @@ double FixNHCuda::compute_vector(int n)
       if (n < ilen) return omega[n];
       n -= ilen;
     }
-    
+
     if (pstyle == ISO) {
       ilen = 1;
       if (n < ilen) return omega_dot[n];
@@ -1420,7 +1420,7 @@ double FixNHCuda::compute_vector(int n)
       if (n < ilen) return omega_dot[n];
       n -= ilen;
     }
-    
+
     if (mpchain) {
       ilen = mpchain;
       if (n < ilen) return etap[n];
@@ -1440,88 +1440,88 @@ double FixNHCuda::compute_vector(int n)
   if (dimension == 3) volume = domain->xprd * domain->yprd * domain->zprd;
   else volume = domain->xprd * domain->yprd;
 
-  if (tstat_flag) { 
+  if (tstat_flag) {
     ilen = mtchain;
-    if (n < ilen) { 
+    if (n < ilen) {
       ich = n;
       if (ich == 0)
-	return lkt * eta[0];
+        return lkt * eta[0];
       else
-	return kt * eta[ich];
+        return kt * eta[ich];
     }
     n -= ilen;
     ilen = mtchain;
     if (n < ilen) {
       ich = n;
       if (ich == 0)
-	return 0.5*eta_mass[0]*eta_dot[0]*eta_dot[0];
+        return 0.5*eta_mass[0]*eta_dot[0]*eta_dot[0];
       else
-	return 0.5*eta_mass[ich]*eta_dot[ich]*eta_dot[ich];
+        return 0.5*eta_mass[ich]*eta_dot[ich]*eta_dot[ich];
     }
     n -= ilen;
   }
 
-  if (pstat_flag) { 
+  if (pstat_flag) {
     if (pstyle == ISO) {
       ilen = 1;
-      if (n < ilen) 
-	return p_hydro*(volume-vol0) / nktv2p;
+      if (n < ilen)
+        return p_hydro*(volume-vol0) / nktv2p;
       n -= ilen;
     } else if (pstyle == ANISO) {
       ilen = 3;
-      if (n < ilen) 
-	if (p_flag[n])
-	  return p_hydro*(volume-vol0) / (pdim*nktv2p);
-	else
-	  return 0.0;
+      if (n < ilen)
+        if (p_flag[n])
+          return p_hydro*(volume-vol0) / (pdim*nktv2p);
+        else
+          return 0.0;
       n -= ilen;
     } else {
       ilen = 6;
       if (n < ilen)
-	if (n > 2) return 0.0;
-	else if (p_flag[n])
-	  return p_hydro*(volume-vol0) / (pdim*nktv2p);
-	else
-	  return 0.0;
+        if (n > 2) return 0.0;
+        else if (p_flag[n])
+          return p_hydro*(volume-vol0) / (pdim*nktv2p);
+        else
+          return 0.0;
       n -= ilen;
     }
-    
+
     if (pstyle == ISO) {
       ilen = 1;
-      if (n < ilen) 
-	return pdim*0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
+      if (n < ilen)
+        return pdim*0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
       n -= ilen;
     } else if (pstyle == ANISO) {
       ilen = 3;
-      if (n < ilen) 
-	if (p_flag[n])
-	  return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
-	else return 0.0;
+      if (n < ilen)
+        if (p_flag[n])
+          return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
+        else return 0.0;
       n -= ilen;
     } else {
       ilen = 6;
       if (n < ilen)
-	if (p_flag[n])
-	  return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
-	else return 0.0;
+        if (p_flag[n])
+          return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
+        else return 0.0;
       n -= ilen;
     }
-    
+
     if (mpchain) {
       ilen = mpchain;
       if (n < ilen) {
-	ich = n;
-	if (ich == 0) return lkt_press * etap[0];
-	else return kt * etap[ich];
+        ich = n;
+        if (ich == 0) return lkt_press * etap[0];
+        else return kt * etap[ich];
       }
       n -= ilen;
       ilen = mpchain;
       if (n < ilen) {
-	ich = n;
-	if (ich == 0)
-	  return 0.5*etap_mass[0]*etap_dot[0]*etap_dot[0];
-	else
-	  return 0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
+        ich = n;
+        if (ich == 0)
+          return 0.5*etap_mass[0]*etap_dot[0]*etap_dot[0];
+        else
+          return 0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
       }
       n -= ilen;
     }
@@ -1529,7 +1529,7 @@ double FixNHCuda::compute_vector(int n)
     if (deviatoric_flag) {
       ilen = 1;
       if (n < ilen)
-	return compute_strain_energy();
+        return compute_strain_energy();
       n -= ilen;
     }
   }
@@ -1549,10 +1549,10 @@ void FixNHCuda::reset_dt()
   dto = dthalf;
 
   // If using respa, then remap is performed in innermost level
-  
+
   if (strcmp(update->integrate_style,"respa") == 0)
     dto = 0.5*step_respa[0];
-  
+
   p_freq_max = 0.0;
   if (pstat_flag) {
     p_freq_max = MAX(p_freq[0],p_freq[1]);
@@ -1598,48 +1598,48 @@ void FixNHCuda::nhc_temp_integrate()
     eta_dot[0] += eta_dotdot[0] * ncfac*dt4;
     eta_dot[0] *= tdrag_factor;
     eta_dot[0] *= expfac;
-    
+
     factor_eta = exp(-ncfac*dthalf*eta_dot[0]);
-	if(which==NOBIAS)
-	Cuda_FixNHCuda_nh_v_temp(&cuda->shared_data,groupbit,factor_eta,(igroup == atom->firstgroup)?atom->nfirst:atom->nlocal);
+        if(which==NOBIAS)
+        Cuda_FixNHCuda_nh_v_temp(&cuda->shared_data,groupbit,factor_eta,(igroup == atom->firstgroup)?atom->nfirst:atom->nlocal);
     else if(which==BIAS)
     {
-    	if(!temperature->cudable)
-    	{
-    		cuda->downloadAll();
-			nh_v_temp();
-			cuda->cu_v->upload();
-    	}
-    	else
-    	{
-    	   int groupbit_org=temperature->groupbit;
-    	   temperature->groupbit=groupbit;
-    	   temperature->remove_bias_all();
-			Cuda_FixNHCuda_nh_v_temp(&cuda->shared_data,groupbit,factor_eta,(igroup == atom->firstgroup)?atom->nfirst:atom->nlocal);
-    	   temperature->restore_bias_all();
-    	   temperature->groupbit=groupbit_org;
-    	}
-    		
+            if(!temperature->cudable)
+            {
+                    cuda->downloadAll();
+                        nh_v_temp();
+                        cuda->cu_v->upload();
+            }
+            else
+            {
+               int groupbit_org=temperature->groupbit;
+               temperature->groupbit=groupbit;
+               temperature->remove_bias_all();
+                        Cuda_FixNHCuda_nh_v_temp(&cuda->shared_data,groupbit,factor_eta,(igroup == atom->firstgroup)?atom->nfirst:atom->nlocal);
+               temperature->restore_bias_all();
+               temperature->groupbit=groupbit_org;
+            }
+
     }
     // rescale temperature due to velocity scaling
-    // should not be necessary to explicitly recompute the temperature 
+    // should not be necessary to explicitly recompute the temperature
 
     t_current *= factor_eta*factor_eta;
     kecurrent = tdof * boltz * t_current;
     eta_dotdot[0] = (kecurrent - lkt)/eta_mass[0];
-    
+
     for (ich = 0; ich < mtchain; ich++)
       eta[ich] += ncfac*dthalf*eta_dot[ich];
-    
+
     eta_dot[0] *= expfac;
     eta_dot[0] += eta_dotdot[0] * ncfac*dt4;
     eta_dot[0] *= expfac;
-    
+
     for (ich = 1; ich < mtchain; ich++) {
       expfac = exp(-ncfac*dt8*eta_dot[ich+1]);
       eta_dot[ich] *= expfac;
-      eta_dotdot[ich] = (eta_mass[ich-1]*eta_dot[ich-1]*eta_dot[ich-1] 
-			 - boltz * t_target)/eta_mass[ich];
+      eta_dotdot[ich] = (eta_mass[ich-1]*eta_dot[ich-1]*eta_dot[ich-1]
+                         - boltz * t_target)/eta_mass[ich];
       eta_dot[ich] += eta_dotdot[ich] * ncfac*dt4;
       eta_dot[ich] *= expfac;
     }
@@ -1663,7 +1663,7 @@ void FixNHCuda::nhc_press_integrate()
     if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
 
   if (pstyle == TRICLINIC) {
-    for (i = 3; i < 6; i++) 
+    for (i = 3; i < 6; i++)
       if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
   }
 
@@ -1679,46 +1679,46 @@ void FixNHCuda::nhc_press_integrate()
       etap_dot[ich] *= pdrag_factor;
       etap_dot[ich] *= expfac;
     }
-    
+
     expfac = exp(-ncfac*dt8*etap_dot[1]);
     etap_dot[0] *= expfac;
     etap_dot[0] += etap_dotdot[0] * ncfac*dt4;
     etap_dot[0] *= pdrag_factor;
     etap_dot[0] *= expfac;
-    
+
     for (ich = 0; ich < mpchain; ich++)
       etap[ich] += ncfac*dthalf*etap_dot[ich];
-    
+
     factor_etap = exp(-ncfac*dthalf*etap_dot[0]);
     for (i = 0; i < 3; i++)
       if (p_flag[i]) omega_dot[i] *= factor_etap;
-    
+
     if (pstyle == TRICLINIC) {
       for (i = 3; i < 6; i++)
-	if (p_flag[i]) omega_dot[i] *= factor_etap;
+        if (p_flag[i]) omega_dot[i] *= factor_etap;
     }
-    
+
     kecurrent = 0.0;
     for (i = 0; i < 3; i++)
       if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
-    
+
     if (pstyle == TRICLINIC) {
-      for (i = 3; i < 6; i++) 
-	if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
+      for (i = 3; i < 6; i++)
+        if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
     }
-    
+
     etap_dotdot[0] = (kecurrent - lkt_press)/etap_mass[0];
-    
+
     etap_dot[0] *= expfac;
     etap_dot[0] += etap_dotdot[0] * ncfac*dt4;
     etap_dot[0] *= expfac;
-    
+
     for (ich = 1; ich < mpchain; ich++) {
       expfac = exp(-ncfac*dt8*etap_dot[ich+1]);
       etap_dot[ich] *= expfac;
-      etap_dotdot[ich] = 
-	(etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] - boltz*t_target) / 
-	etap_mass[ich];
+      etap_dotdot[ich] =
+        (etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] - boltz*t_target) /
+        etap_mass[ich];
       etap_dot[ich] += etap_dotdot[ich] * ncfac*dt4;
       etap_dot[ich] *= expfac;
     }
@@ -1744,33 +1744,33 @@ void FixNHCuda::nh_v_press()
   if (which == NOBIAS) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	v[i][0] *= factor[0];
-	v[i][1] *= factor[1];
-	v[i][2] *= factor[2];
-	if (pstyle == TRICLINIC) {
-	  v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
-	  v[i][1] += -dthalf*v[i][2]*omega_dot[3];
-	}
-	v[i][0] *= factor[0];
-	v[i][1] *= factor[1];
-	v[i][2] *= factor[2];
+        v[i][0] *= factor[0];
+        v[i][1] *= factor[1];
+        v[i][2] *= factor[2];
+        if (pstyle == TRICLINIC) {
+          v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
+          v[i][1] += -dthalf*v[i][2]*omega_dot[3];
+        }
+        v[i][0] *= factor[0];
+        v[i][1] *= factor[1];
+        v[i][2] *= factor[2];
       }
     }
   } else if (which == BIAS) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	temperature->remove_bias(i,v[i]);
-	v[i][0] *= factor[0];
-	v[i][1] *= factor[1];
-	v[i][2] *= factor[2];
-	if (pstyle == TRICLINIC) {
-	  v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
-	  v[i][1] += -dthalf*v[i][2]*omega_dot[3];
-	}
-	v[i][0] *= factor[0];
-	v[i][1] *= factor[1];
-	v[i][2] *= factor[2];
-	temperature->restore_bias(i,v[i]);
+        temperature->remove_bias(i,v[i]);
+        v[i][0] *= factor[0];
+        v[i][1] *= factor[1];
+        v[i][2] *= factor[2];
+        if (pstyle == TRICLINIC) {
+          v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
+          v[i][1] += -dthalf*v[i][2]*omega_dot[3];
+        }
+        v[i][0] *= factor[0];
+        v[i][1] *= factor[1];
+        v[i][2] *= factor[2];
+        temperature->restore_bias(i,v[i]);
       }
     }
   }
@@ -1795,19 +1795,19 @@ void FixNHCuda::nve_v()
   if (rmass) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	dtfm = dtf / rmass[i];
-	v[i][0] += dtfm*f[i][0];
-	v[i][1] += dtfm*f[i][1];
-	v[i][2] += dtfm*f[i][2];
+        dtfm = dtf / rmass[i];
+        v[i][0] += dtfm*f[i][0];
+        v[i][1] += dtfm*f[i][1];
+        v[i][2] += dtfm*f[i][2];
       }
     }
   } else {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	dtfm = dtf / mass[type[i]];
-	v[i][0] += dtfm*f[i][0];
-	v[i][1] += dtfm*f[i][1];
-	v[i][2] += dtfm*f[i][2];
+        dtfm = dtf / mass[type[i]];
+        v[i][0] += dtfm*f[i][0];
+        v[i][1] += dtfm*f[i][1];
+        v[i][2] += dtfm*f[i][2];
       }
     }
   }
@@ -1850,24 +1850,24 @@ void FixNHCuda::nh_v_temp()
   if (which == NOBIAS) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	v[i][0] *= factor_eta;
-	v[i][1] *= factor_eta;
-	v[i][2] *= factor_eta;
+        v[i][0] *= factor_eta;
+        v[i][1] *= factor_eta;
+        v[i][2] *= factor_eta;
       }
     }
   } else if (which == BIAS) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	temperature->remove_bias(i,v[i]);
-	v[i][0] *= factor_eta;
-	v[i][1] *= factor_eta;
-	v[i][2] *= factor_eta;
-	temperature->restore_bias(i,v[i]);
+        temperature->remove_bias(i,v[i]);
+        v[i][0] *= factor_eta;
+        v[i][1] *= factor_eta;
+        v[i][2] *= factor_eta;
+        temperature->restore_bias(i,v[i]);
       }
     }
   }
 }
-  
+
 /* ----------------------------------------------------------------------
    compute sigma tensor
    needed whenever p_target or h0_inv changes
@@ -1875,7 +1875,7 @@ void FixNHCuda::nh_v_temp()
 
 void FixNHCuda::compute_sigma()
 {
-  // if nreset_h0 > 0, reset vol0 and h0_inv 
+  // if nreset_h0 > 0, reset vol0 and h0_inv
   // every nreset_h0 timesteps
 
   if (nreset_h0 > 0) {
@@ -1894,37 +1894,37 @@ void FixNHCuda::compute_sigma()
 
   // generate upper-triangular half of
   // sigma = vol0*h0inv*(p_target-p_hydro)*h0inv^t
-  // units of sigma are are PV/L^2 e.g. atm.A 
+  // units of sigma are are PV/L^2 e.g. atm.A
   //
   // [ 0 5 4 ]   [ 0 5 4 ] [ 0 5 4 ] [ 0 - - ]
   // [ 5 1 3 ] = [ - 1 3 ] [ 5 1 3 ] [ 5 1 - ]
   // [ 4 3 2 ]   [ - - 2 ] [ 4 3 2 ] [ 4 3 2 ]
 
-  sigma[0] = 
+  sigma[0] =
     vol0*(h0_inv[0]*((p_target[0]-p_hydro)*h0_inv[0] +
-		     p_target[5]*h0_inv[5]+p_target[4]*h0_inv[4]) +
-	  h0_inv[5]*(p_target[5]*h0_inv[0] +
-		     (p_target[1]-p_hydro)*h0_inv[5]+p_target[3]*h0_inv[4]) +
-	  h0_inv[4]*(p_target[4]*h0_inv[0]+p_target[3]*h0_inv[5] +
-		     (p_target[2]-p_hydro)*h0_inv[4]));
-  sigma[1] = 
+                     p_target[5]*h0_inv[5]+p_target[4]*h0_inv[4]) +
+          h0_inv[5]*(p_target[5]*h0_inv[0] +
+                     (p_target[1]-p_hydro)*h0_inv[5]+p_target[3]*h0_inv[4]) +
+          h0_inv[4]*(p_target[4]*h0_inv[0]+p_target[3]*h0_inv[5] +
+                     (p_target[2]-p_hydro)*h0_inv[4]));
+  sigma[1] =
     vol0*(h0_inv[1]*((p_target[1]-p_hydro)*h0_inv[1] +
-		     p_target[3]*h0_inv[3]) +
-	  h0_inv[3]*(p_target[3]*h0_inv[1] + 
-		     (p_target[2]-p_hydro)*h0_inv[3]));
-  sigma[2] = 
+                     p_target[3]*h0_inv[3]) +
+          h0_inv[3]*(p_target[3]*h0_inv[1] +
+                     (p_target[2]-p_hydro)*h0_inv[3]));
+  sigma[2] =
     vol0*(h0_inv[2]*((p_target[2]-p_hydro)*h0_inv[2]));
-  sigma[3] = 
+  sigma[3] =
     vol0*(h0_inv[1]*(p_target[3]*h0_inv[2]) +
-	  h0_inv[3]*((p_target[2]-p_hydro)*h0_inv[2]));
-  sigma[4] = 
+          h0_inv[3]*((p_target[2]-p_hydro)*h0_inv[2]));
+  sigma[4] =
     vol0*(h0_inv[0]*(p_target[4]*h0_inv[2]) +
-	  h0_inv[5]*(p_target[3]*h0_inv[2]) +
-	  h0_inv[4]*((p_target[2]-p_hydro)*h0_inv[2]));
-  sigma[5] = 
+          h0_inv[5]*(p_target[3]*h0_inv[2]) +
+          h0_inv[4]*((p_target[2]-p_hydro)*h0_inv[2]));
+  sigma[5] =
     vol0*(h0_inv[0]*(p_target[5]*h0_inv[1]+p_target[4]*h0_inv[3]) +
-	  h0_inv[5]*((p_target[1]-p_hydro)*h0_inv[1]+p_target[3]*h0_inv[3]) +
-	  h0_inv[4]*(p_target[3]*h0_inv[1]+(p_target[2]-p_hydro)*h0_inv[3]));
+          h0_inv[5]*((p_target[1]-p_hydro)*h0_inv[1]+p_target[3]*h0_inv[3]) +
+          h0_inv[4]*(p_target[3]*h0_inv[1]+(p_target[2]-p_hydro)*h0_inv[3]));
 }
 
 /* ----------------------------------------------------------------------
@@ -1933,20 +1933,20 @@ void FixNHCuda::compute_sigma()
 
 double FixNHCuda::compute_strain_energy()
 {
-  // compute strain energy = 0.5*Tr(sigma*h*h^t) in energy units 
+  // compute strain energy = 0.5*Tr(sigma*h*h^t) in energy units
 
   double* h = domain->h;
   double d0,d1,d2;
 
-  d0 = 
+  d0 =
     sigma[0]*(h[0]*h[0]+h[5]*h[5]+h[4]*h[4]) +
     sigma[5]*(          h[1]*h[5]+h[3]*h[4]) +
     sigma[4]*(                    h[2]*h[4]);
-  d1 = 
+  d1 =
     sigma[5]*(          h[5]*h[1]+h[4]*h[3]) +
     sigma[1]*(          h[1]*h[1]+h[3]*h[3]) +
     sigma[3]*(                    h[2]*h[3]);
-  d2 = 
+  d2 =
     sigma[4]*(                    h[4]*h[2]) +
     sigma[3]*(                    h[3]*h[2]) +
     sigma[2]*(                    h[2]*h[2]);
@@ -1962,30 +1962,30 @@ double FixNHCuda::compute_strain_energy()
 void FixNHCuda::compute_deviatoric()
 {
   // generate upper-triangular part of h*sigma*h^t
-  // units of fdev are are PV, e.g. atm*A^3 
+  // units of fdev are are PV, e.g. atm*A^3
   // [ 0 5 4 ]   [ 0 5 4 ] [ 0 5 4 ] [ 0 - - ]
   // [ 5 1 3 ] = [ - 1 3 ] [ 5 1 3 ] [ 5 1 - ]
   // [ 4 3 2 ]   [ - - 2 ] [ 4 3 2 ] [ 4 3 2 ]
-  
+
   double* h = domain->h;
-   
-  fdev[0] = 
+
+  fdev[0] =
     h[0]*(sigma[0]*h[0]+sigma[5]*h[5]+sigma[4]*h[4]) +
     h[5]*(sigma[5]*h[0]+sigma[1]*h[5]+sigma[3]*h[4]) +
     h[4]*(sigma[4]*h[0]+sigma[3]*h[5]+sigma[2]*h[4]);
-  fdev[1] = 
+  fdev[1] =
     h[1]*(              sigma[1]*h[1]+sigma[3]*h[3]) +
     h[3]*(              sigma[3]*h[1]+sigma[2]*h[3]);
-  fdev[2] = 
+  fdev[2] =
     h[2]*(                            sigma[2]*h[2]);
-  fdev[3] = 
+  fdev[3] =
     h[1]*(                            sigma[3]*h[2]) +
     h[3]*(                            sigma[2]*h[2]);
-  fdev[4] = 
+  fdev[4] =
     h[0]*(                            sigma[4]*h[2]) +
     h[5]*(                            sigma[3]*h[2]) +
     h[4]*(                            sigma[2]*h[2]);
-  fdev[5] = 
+  fdev[5] =
     h[0]*(              sigma[5]*h[1]+sigma[4]*h[3]) +
     h[5]*(              sigma[1]*h[1]+sigma[3]*h[3]) +
     h[4]*(              sigma[3]*h[1]+sigma[2]*h[3]);
@@ -2001,7 +2001,7 @@ void FixNHCuda::compute_press_target()
   if (update->endstep > update->beginstep)
     delta /= update->endstep - update->beginstep;
   else delta = 0.0;
-      
+
   p_hydro = 0.0;
   for (int i = 0; i < 3; i++)
     if (p_flag[i]) {
@@ -2034,21 +2034,21 @@ void FixNHCuda::nh_omega_dot()
 
   mtk_term1 = 0.0;
   if (mtk_flag)
-    if (pstyle == ISO) { 
+    if (pstyle == ISO) {
       mtk_term1 = tdof * boltz * t_current;
       mtk_term1 /= pdim * atom->natoms;
     } else {
       double *mvv_current = temperature->vector;
       for (int i = 0; i < 3; i++)
-	if (p_flag[i])
-	  mtk_term1 += mvv_current[i];
+        if (p_flag[i])
+          mtk_term1 += mvv_current[i];
       mtk_term1 /= pdim * atom->natoms;
     }
-  
+
   for (int i = 0; i < 3; i++)
     if (p_flag[i]) {
       f_omega = (p_current[i]-p_hydro)*volume /
-	(omega_mass[i] * nktv2p) + mtk_term1 / omega_mass[i];
+        (omega_mass[i] * nktv2p) + mtk_term1 / omega_mass[i];
       if (deviatoric_flag) f_omega -= fdev[i]/(omega_mass[i] * nktv2p);
       omega_dot[i] += f_omega*dthalf;
       omega_dot[i] *= pdrag_factor;
@@ -2058,20 +2058,19 @@ void FixNHCuda::nh_omega_dot()
   if (mtk_flag) {
     for (int i = 0; i < 3; i++)
       if (p_flag[i])
-	mtk_term2 += omega_dot[i];
+        mtk_term2 += omega_dot[i];
     mtk_term2 /= pdim * atom->natoms;
   }
 
   if (pstyle == TRICLINIC) {
     for (int i = 3; i < 6; i++) {
       if (p_flag[i]) {
-	f_omega = p_current[i]*volume/(omega_mass[i] * nktv2p);
-	if (deviatoric_flag) 
-	  f_omega -= fdev[i]/(omega_mass[i] * nktv2p);
-	omega_dot[i] += f_omega*dthalf;
-	omega_dot[i] *= pdrag_factor;
+        f_omega = p_current[i]*volume/(omega_mass[i] * nktv2p);
+        if (deviatoric_flag)
+          f_omega -= fdev[i]/(omega_mass[i] * nktv2p);
+        omega_dot[i] += f_omega*dthalf;
+        omega_dot[i] *= pdrag_factor;
       }
-    } 
+    }
   }
 }
-
diff --git a/src/USER-CUDA/fix_nh_cuda.h b/src/USER-CUDA/fix_nh_cuda.h
index 8c192b56dd..e57afe896a 100644
--- a/src/USER-CUDA/fix_nh_cuda.h
+++ b/src/USER-CUDA/fix_nh_cuda.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -76,13 +76,13 @@ class FixNHCuda : public Fix {
   double *eta_dotdot;
   double *eta_mass;
   int mtchain;                     // length of chain
-                                   
+
   double *etap;                    // chain thermostat for barostat
   double *etap_dot;
   double *etap_dotdot;
   double *etap_mass;
   int mpchain;                     // length of chain
-                                   
+
   int mtk_flag;                    // 0 if using Hoover barostat
   double mtk_term1,mtk_term2;
   int mtchain_default_flag;
@@ -117,7 +117,7 @@ class FixNHCuda : public Fix {
   double compute_strain_energy();
   void compute_press_target();
   void nh_omega_dot();
-  
+
   X_FLOAT triggerneighsq;
 };
 
diff --git a/src/USER-CUDA/fix_npt_cuda.cpp b/src/USER-CUDA/fix_npt_cuda.cpp
index db77ec0072..ea2dd1fe04 100644
--- a/src/USER-CUDA/fix_npt_cuda.cpp
+++ b/src/USER-CUDA/fix_npt_cuda.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,7 +45,7 @@ FixNPTCuda::FixNPTCuda(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = (char *) "all";
@@ -63,7 +63,7 @@ FixNPTCuda::FixNPTCuda(LAMMPS *lmp, int narg, char **arg) :
   id_press = new char[n];
   strcpy(id_press,id);
   strcat(id_press,"_press");
-  
+
   newarg = new char*[4];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";
diff --git a/src/USER-CUDA/fix_npt_cuda.h b/src/USER-CUDA/fix_npt_cuda.h
index 1dc5f5af35..37ff8ffc53 100644
--- a/src/USER-CUDA/fix_npt_cuda.h
+++ b/src/USER-CUDA/fix_npt_cuda.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CUDA/fix_nve_cuda.cpp b/src/USER-CUDA/fix_nve_cuda.cpp
index 00ed888245..992bb5d5d9 100644
--- a/src/USER-CUDA/fix_nve_cuda.cpp
+++ b/src/USER-CUDA/fix_nve_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -61,37 +61,37 @@ FixNVECuda::FixNVECuda(LAMMPS *lmp, int narg, char **arg) :
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
   if (strcmp(style,"nve/sphere") != 0 && narg < 3)
-		error->all(FLERR,"Illegal fix nve command");
-	
-	time_integrate = 1;
+                error->all(FLERR,"Illegal fix nve command");
+
+        time_integrate = 1;
 }
 
 /* ---------------------------------------------------------------------- */
 
 int FixNVECuda::setmask()
 {
-	int mask = 0;
-	mask |= INITIAL_INTEGRATE_CUDA;
-	mask |= FINAL_INTEGRATE_CUDA;
-	// mask |= INITIAL_INTEGRATE_RESPA_CUDA;
-	// mask |= FINAL_INTEGRATE_RESPA_CUDA;
-	return mask;
+        int mask = 0;
+        mask |= INITIAL_INTEGRATE_CUDA;
+        mask |= FINAL_INTEGRATE_CUDA;
+        // mask |= INITIAL_INTEGRATE_RESPA_CUDA;
+        // mask |= FINAL_INTEGRATE_RESPA_CUDA;
+        return mask;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void FixNVECuda::init()
 {
-	dtv = update->dt;
-	dtf = 0.5 * update->dt * force->ftm2v;
-	
-	if (strstr(update->integrate_style,"respa"))
-		step_respa = ((Respa *) update->integrate)->step;
-		
-	triggerneighsq= cuda->shared_data.atom.triggerneighsq;
+        dtv = update->dt;
+        dtf = 0.5 * update->dt * force->ftm2v;
+
+        if (strstr(update->integrate_style,"respa"))
+                step_respa = ((Respa *) update->integrate)->step;
+
+        triggerneighsq= cuda->shared_data.atom.triggerneighsq;
     cuda->neighbor_decide_by_integrator=1;
     Cuda_FixNVECuda_Init(&cuda->shared_data,dtv,dtf);
-    
+
 }
 
 /* ----------------------------------------------------------------------
@@ -100,58 +100,58 @@ void FixNVECuda::init()
 
 void FixNVECuda::initial_integrate(int vflag)
 {
-	if(triggerneighsq!=cuda->shared_data.atom.triggerneighsq) 
-	{
-		triggerneighsq= cuda->shared_data.atom.triggerneighsq;
-		Cuda_FixNVECuda_Init(&cuda->shared_data,dtv,dtf);
-	}
-	int nlocal = atom->nlocal;
-	if(igroup == atom->firstgroup) nlocal = atom->nfirst;
-
-    Cuda_FixNVECuda_InitialIntegrate(& cuda->shared_data, groupbit,nlocal);	
+        if(triggerneighsq!=cuda->shared_data.atom.triggerneighsq)
+        {
+                triggerneighsq= cuda->shared_data.atom.triggerneighsq;
+                Cuda_FixNVECuda_Init(&cuda->shared_data,dtv,dtf);
+        }
+        int nlocal = atom->nlocal;
+        if(igroup == atom->firstgroup) nlocal = atom->nfirst;
+
+    Cuda_FixNVECuda_InitialIntegrate(& cuda->shared_data, groupbit,nlocal);
 }
 
 /* ---------------------------------------------------------------------- */
 
 void FixNVECuda::final_integrate()
 {
-	int nlocal = atom->nlocal;
-	if(igroup == atom->firstgroup) nlocal = atom->nfirst;
-	
-	Cuda_FixNVECuda_FinalIntegrate(& cuda->shared_data, groupbit,nlocal);
+        int nlocal = atom->nlocal;
+        if(igroup == atom->firstgroup) nlocal = atom->nfirst;
+
+        Cuda_FixNVECuda_FinalIntegrate(& cuda->shared_data, groupbit,nlocal);
 }
 
 /* ---------------------------------------------------------------------- */
 
 void FixNVECuda::initial_integrate_respa(int vflag, int ilevel, int flag)
 {
-	//this point should not be reached yet since RESPA is not supported
-	if (flag) return;             // only used by NPT,NPH
-	
-	dtv = step_respa[ilevel];
-	dtf = 0.5 * step_respa[ilevel] * force->ftm2v;
-	
-	// innermost level - NVE update of v and x
-	// all other levels - NVE update of v
-	
-	if(ilevel == 0) initial_integrate(vflag);
-	else final_integrate();
+        //this point should not be reached yet since RESPA is not supported
+        if (flag) return;             // only used by NPT,NPH
+
+        dtv = step_respa[ilevel];
+        dtf = 0.5 * step_respa[ilevel] * force->ftm2v;
+
+        // innermost level - NVE update of v and x
+        // all other levels - NVE update of v
+
+        if(ilevel == 0) initial_integrate(vflag);
+        else final_integrate();
 }
 
 /* ---------------------------------------------------------------------- */
 
 void FixNVECuda::final_integrate_respa(int ilevel, int iloop)
 {
-	//this point should not be reached yet since RESPA is not supported
-	dtf = 0.5 * step_respa[ilevel] * force->ftm2v;
-	final_integrate();
+        //this point should not be reached yet since RESPA is not supported
+        dtf = 0.5 * step_respa[ilevel] * force->ftm2v;
+        final_integrate();
 }
 
 /* ---------------------------------------------------------------------- */
 
 void FixNVECuda::reset_dt()
 {
-	dtv = update->dt;
-	dtf = 0.5 * update->dt * force->ftm2v;
-	Cuda_FixNVECuda_Init(&cuda->shared_data,dtv,dtf);
+        dtv = update->dt;
+        dtf = 0.5 * update->dt * force->ftm2v;
+        Cuda_FixNVECuda_Init(&cuda->shared_data,dtv,dtf);
 }
diff --git a/src/USER-CUDA/fix_nve_cuda.h b/src/USER-CUDA/fix_nve_cuda.h
index 6968297610..f649db26a9 100644
--- a/src/USER-CUDA/fix_nve_cuda.h
+++ b/src/USER-CUDA/fix_nve_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -37,24 +37,24 @@ namespace LAMMPS_NS {
 
 class FixNVECuda : public Fix
 {
-	public:
-		FixNVECuda(class LAMMPS *, int, char **);
-		int setmask();
-		virtual void init();
-		virtual void initial_integrate(int);
-		virtual void final_integrate();
-		void initial_integrate_respa(int, int, int);
-		void final_integrate_respa(int, int);
-		void reset_dt();
-	
-		X_FLOAT triggerneighsq;
-		
-	protected:
-		class Cuda *cuda;
-		double dtv, dtf;
-		double *step_respa;
-		int mass_require;
-		
+        public:
+                FixNVECuda(class LAMMPS *, int, char **);
+                int setmask();
+                virtual void init();
+                virtual void initial_integrate(int);
+                virtual void final_integrate();
+                void initial_integrate_respa(int, int, int);
+                void final_integrate_respa(int, int);
+                void reset_dt();
+
+                X_FLOAT triggerneighsq;
+
+        protected:
+                class Cuda *cuda;
+                double dtv, dtf;
+                double *step_respa;
+                int mass_require;
+
 };
 
 }
diff --git a/src/USER-CUDA/fix_nvt_cuda.cpp b/src/USER-CUDA/fix_nvt_cuda.cpp
index 8438f2d3f6..e1380b0005 100644
--- a/src/USER-CUDA/fix_nvt_cuda.cpp
+++ b/src/USER-CUDA/fix_nvt_cuda.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -40,7 +40,7 @@ FixNVTCuda::FixNVTCuda(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = group->names[igroup];
diff --git a/src/USER-CUDA/fix_nvt_cuda.h b/src/USER-CUDA/fix_nvt_cuda.h
index 02e5ca3d58..227dbf6a94 100644
--- a/src/USER-CUDA/fix_nvt_cuda.h
+++ b/src/USER-CUDA/fix_nvt_cuda.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CUDA/fix_set_force_cuda.cpp b/src/USER-CUDA/fix_set_force_cuda.cpp
index 4726cca0bb..1010c087ad 100644
--- a/src/USER-CUDA/fix_set_force_cuda.cpp
+++ b/src/USER-CUDA/fix_set_force_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -45,7 +45,7 @@ FixSetForceCuda::FixSetForceCuda(LAMMPS *lmp, int narg, char **arg) :
   cuda = lmp->cuda;
   if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
-  
+
   if (narg != 6) error->all(FLERR,"Illegal fix setforce/cuda command");
 
   vector_flag = 1;
@@ -83,7 +83,7 @@ int FixSetForceCuda::setmask()
 void FixSetForceCuda::init()
 {
   if(not cu_foriginal)
-  cu_foriginal = new cCudaData<double, F_FLOAT, x> (foriginal,3);    
+  cu_foriginal = new cCudaData<double, F_FLOAT, x> (foriginal,3);
   if (strstr(update->integrate_style,"respa"))
     nlevels_respa = ((Respa *) update->integrate)->nlevels;
 }
@@ -93,14 +93,14 @@ void FixSetForceCuda::init()
 void FixSetForceCuda::setup(int vflag)
 {
   MYDBG( printf("# CUDA: FixSetForceCuda::setup\n"); )
-	
+
   if (strstr(update->integrate_style,"verlet"))
   {
     Cuda_FixSetForceCuda_Init(&cuda->shared_data);
     cuda->cu_f->upload();
     post_force(vflag);
     cuda->cu_f->download();
-    
+
   }
   else {
     ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1);
@@ -136,26 +136,26 @@ void FixSetForceCuda::post_force_respa(int vflag, int ilevel, int iloop)
 {
   if (ilevel == nlevels_respa-1) post_force(vflag);
   else {
-  	cuda->cu_f->download();
-  	cuda->cu_mask->download();
-  	
+          cuda->cu_f->download();
+          cuda->cu_mask->download();
+
     double **f = atom->f;
     int *mask = atom->mask;
     int nlocal = atom->nlocal;
 
     foriginal[0] = foriginal[1] = foriginal[2] = 0.0;
     force_flag = 0;
-    
+
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	foriginal[0] += f[i][0];
-	foriginal[1] += f[i][1];
-	foriginal[2] += f[i][2];
-	if (flagx) f[i][0] = 0.0;
-	if (flagy) f[i][1] = 0.0;
-	if (flagz) f[i][2] = 0.0;
+        foriginal[0] += f[i][0];
+        foriginal[1] += f[i][1];
+        foriginal[2] += f[i][2];
+        if (flagx) f[i][0] = 0.0;
+        if (flagy) f[i][1] = 0.0;
+        if (flagz) f[i][2] = 0.0;
       }
-  	cuda->cu_f->upload();
+          cuda->cu_f->upload();
   }
 }
 
diff --git a/src/USER-CUDA/fix_set_force_cuda.h b/src/USER-CUDA/fix_set_force_cuda.h
index c233294a5b..8fb523361c 100644
--- a/src/USER-CUDA/fix_set_force_cuda.h
+++ b/src/USER-CUDA/fix_set_force_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -49,10 +49,10 @@ class FixSetForceCuda : public Fix {
 
  private:
   class Cuda *cuda;
-  int flagx,flagy,flagz; 
+  int flagx,flagy,flagz;
   double xvalue,yvalue,zvalue;
   double foriginal[3],foriginal_all[3];
-  cCudaData<double     , F_FLOAT   		, x>* cu_foriginal;	
+  cCudaData<double     , F_FLOAT                   , x>* cu_foriginal;
   int force_flag;
   int nlevels_respa;
 };
diff --git a/src/USER-CUDA/fix_shake_cuda.cpp b/src/USER-CUDA/fix_shake_cuda.cpp
index 0fb8eaf6f6..5b155921d7 100644
--- a/src/USER-CUDA/fix_shake_cuda.cpp
+++ b/src/USER-CUDA/fix_shake_cuda.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -79,7 +79,7 @@ FixShakeCuda::FixShakeCuda(LAMMPS *lmp, int narg, char **arg) :
   cu_list = NULL;
   cu_bond_distance = NULL;
   cu_angle_distance = NULL;
-  cu_virial = new cCudaData<double 	  , ENERGY_FLOAT , xx >(virial,6);
+  cu_virial = new cCudaData<double           , ENERGY_FLOAT , xx >(virial,6);
   grow_arrays(atom->nmax);
   atom->add_callback(0);
 
@@ -123,20 +123,20 @@ FixShakeCuda::FixShakeCuda(LAMMPS *lmp, int narg, char **arg) :
 
     } else if (mode == 'b') {
       int i = atoi(arg[next]);
-      if (i < 1 || i > atom->nbondtypes) 
-	error->all(FLERR,"Invalid bond type index for fix shake");
+      if (i < 1 || i > atom->nbondtypes)
+        error->all(FLERR,"Invalid bond type index for fix shake");
       bond_flag[i] = 1;
 
     } else if (mode == 'a') {
       int i = atoi(arg[next]);
-      if (i < 1 || i > atom->nangletypes) 
-	error->all(FLERR,"Invalid angle type index for fix shake");
+      if (i < 1 || i > atom->nangletypes)
+        error->all(FLERR,"Invalid angle type index for fix shake");
       angle_flag[i] = 1;
 
     } else if (mode == 't') {
       int i = atoi(arg[next]);
-      if (i < 1 || i > atom->ntypes) 
-	error->all(FLERR,"Invalid atom type index for fix shake");
+      if (i < 1 || i > atom->ntypes)
+        error->all(FLERR,"Invalid atom type index for fix shake");
       type_flag[i] = 1;
 
     } else if (mode == 'm') {
@@ -156,7 +156,7 @@ FixShakeCuda::FixShakeCuda(LAMMPS *lmp, int narg, char **arg) :
 
   cu_bond_distance = new cCudaData<double, X_FLOAT, xx> (bond_distance, atom->nbondtypes+1);
   cu_angle_distance = new cCudaData<double, X_FLOAT, xx> (angle_distance, atom->nangletypes+1);
-  
+
   // allocate statistics arrays
 
   if (output_every) {
@@ -191,11 +191,11 @@ FixShakeCuda::FixShakeCuda(LAMMPS *lmp, int narg, char **arg) :
   maxlist = 0;
   list = NULL;
   Cuda_FixShakeCuda_Init(&cuda->shared_data,dtv, dtfsq,
-  	cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
-  	cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
-	max_iter,tolerance);
-  
-  
+          cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
+          cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
+        max_iter,tolerance);
+
+
 }
 
 /* ---------------------------------------------------------------------- */
@@ -300,7 +300,7 @@ int FixShakeCuda::setmask()
 
 /* ----------------------------------------------------------------------
    set bond and angle distances
-   this init must happen after force->bond and force->angle inits 
+   this init must happen after force->bond and force->angle inits
 ------------------------------------------------------------------------- */
 
 void FixShakeCuda::init()
@@ -330,7 +330,7 @@ void FixShakeCuda::init()
   if (i < modify->nfix) {
     for (int j = i; j < modify->nfix; j++)
       if (strcmp(modify->fix[j]->style,"shake") == 0)
-	error->all(FLERR,"Shake fix must come before NPT/NPH fix");
+        error->all(FLERR,"Shake fix must come before NPT/NPH fix");
   }
 
   // if rRESPA, find associated fix that must exist
@@ -349,7 +349,7 @@ void FixShakeCuda::init()
 
   if (force->bond == NULL)
     error->all(FLERR,"Bond potential must be defined for SHAKE");
-  for (i = 1; i <= atom->nbondtypes; i++) 
+  for (i = 1; i <= atom->nbondtypes; i++)
     bond_distance[i] = force->bond->equilibrium_distance(i);
 
   // set equilibrium angle distances
@@ -365,7 +365,7 @@ void FixShakeCuda::init()
     // extract bond types for the 2 bonds in the cluster
     // bond types must be same in all clusters of this angle type,
     //   else set error flag
-    
+
     flag = 0;
     bond1_type = bond2_type = 0;
     for (m = 0; m < nlocal; m++) {
@@ -374,46 +374,46 @@ void FixShakeCuda::init()
       type1 = MIN(shake_type[m][0],shake_type[m][1]);
       type2 = MAX(shake_type[m][0],shake_type[m][1]);
       if (bond1_type > 0) {
-	if (type1 != bond1_type || type2 != bond2_type) {
-	  flag = 1;
-	  break;
-	}
+        if (type1 != bond1_type || type2 != bond2_type) {
+          flag = 1;
+          break;
+        }
       }
       bond1_type = type1;
       bond2_type = type2;
     }
 
     // error check for any bond types that are not the same
-    
+
     MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_MAX,world);
     if (flag_all) error->all(FLERR,"Shake angles have different bond types");
-    
+
     // insure all procs have bond types
-    
+
     MPI_Allreduce(&bond1_type,&flag_all,1,MPI_INT,MPI_MAX,world);
     bond1_type = flag_all;
     MPI_Allreduce(&bond2_type,&flag_all,1,MPI_INT,MPI_MAX,world);
     bond2_type = flag_all;
-    
+
     // if bond types are 0, no SHAKE angles of this type exist
     // just skip this angle
-    
+
     if (bond1_type == 0) {
       angle_distance[i] = 0.0;
       continue;
     }
 
     // compute the angle distance as a function of 2 bond distances
-    
+
     angle = force->angle->equilibrium_angle(i);
-    rsq = 2.0*bond_distance[bond1_type]*bond_distance[bond2_type] * 
+    rsq = 2.0*bond_distance[bond1_type]*bond_distance[bond2_type] *
       (1.0-cos(angle));
     angle_distance[i] = sqrt(rsq);
   }
 }
 
 /* ----------------------------------------------------------------------
-   SHAKE as pre-integrator constraint 
+   SHAKE as pre-integrator constraint
 ------------------------------------------------------------------------- */
 
 void FixShakeCuda::setup(int vflag)
@@ -447,15 +447,15 @@ void FixShakeCuda::setup(int vflag)
     dtf_inner = step_respa[0] * force->ftm2v;
   }
   Cuda_FixShakeCuda_Init(&cuda->shared_data,dtv, dtfsq,
-  	cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
-  	cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
-	max_iter,tolerance);
+          cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
+          cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
+        max_iter,tolerance);
 }
 
 /* ----------------------------------------------------------------------
    build list of SHAKE clusters to constrain
    if one or more atoms in cluster are on this proc,
-     this proc lists the cluster exactly once 
+     this proc lists the cluster exactly once
 ------------------------------------------------------------------------- */
 
 void FixShakeCuda::pre_neighbor()
@@ -479,7 +479,7 @@ void FixShakeCuda::pre_neighbor()
     maxlist = nlocal;
     memory->destroy(list);
     memory->create(list,maxlist,"shake:list");
-    delete cu_list; cu_list = new cCudaData<int 	  , int	    , xx >(list,maxlist);
+    delete cu_list; cu_list = new cCudaData<int           , int            , xx >(list,maxlist);
   }
 
   // build list of SHAKE clusters I compute
@@ -488,53 +488,53 @@ void FixShakeCuda::pre_neighbor()
   int count2=0,count3=0,count4=0,count3a=0;
   for (int i = 0; i < nlocal; i++)
     if (shake_flag[i]) {
-    	if(shake_flag[i] == 2) count2++;
-    	if(shake_flag[i] == 3) count3++;
-    	if(shake_flag[i] == 4) count4++;
-    	if(shake_flag[i] == 1) count3a++;
-    	
+            if(shake_flag[i] == 2) count2++;
+            if(shake_flag[i] == 3) count3++;
+            if(shake_flag[i] == 4) count4++;
+            if(shake_flag[i] == 1) count3a++;
+
       if (shake_flag[i] == 2) {
-	atom1 = atom->map(shake_atom[i][0]);
-	atom2 = atom->map(shake_atom[i][1]);
-	if (atom1 == -1 || atom2 == -1) {
-	  char str[128];
-	  sprintf(str,
-		  "Shake atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
-		  shake_atom[i][0],shake_atom[i][1],me,update->ntimestep);
-	  error->one(FLERR,str);
-	}
-	if (i <= atom1 && i <= atom2) list[nlist++] = i;
+        atom1 = atom->map(shake_atom[i][0]);
+        atom2 = atom->map(shake_atom[i][1]);
+        if (atom1 == -1 || atom2 == -1) {
+          char str[128];
+          sprintf(str,
+                  "Shake atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
+                  shake_atom[i][0],shake_atom[i][1],me,update->ntimestep);
+          error->one(FLERR,str);
+        }
+        if (i <= atom1 && i <= atom2) list[nlist++] = i;
       } else if (shake_flag[i] % 2 == 1) {
-	atom1 = atom->map(shake_atom[i][0]);
-	atom2 = atom->map(shake_atom[i][1]);
-	atom3 = atom->map(shake_atom[i][2]);
-	if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
-	  char str[128];
-	  sprintf(str,
-		  "Shake atoms %d %d %d missing on proc %d at step " 
-		  BIGINT_FORMAT,
-		  shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],
-		  me,update->ntimestep);
-	  error->one(FLERR,str);
-	}
-	if (i <= atom1 && i <= atom2 && i <= atom3) list[nlist++] = i;
+        atom1 = atom->map(shake_atom[i][0]);
+        atom2 = atom->map(shake_atom[i][1]);
+        atom3 = atom->map(shake_atom[i][2]);
+        if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
+          char str[128];
+          sprintf(str,
+                  "Shake atoms %d %d %d missing on proc %d at step "
+                  BIGINT_FORMAT,
+                  shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],
+                  me,update->ntimestep);
+          error->one(FLERR,str);
+        }
+        if (i <= atom1 && i <= atom2 && i <= atom3) list[nlist++] = i;
       } else {
-	atom1 = atom->map(shake_atom[i][0]);
-	atom2 = atom->map(shake_atom[i][1]);
-	atom3 = atom->map(shake_atom[i][2]);
-	atom4 = atom->map(shake_atom[i][3]);
-	if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
-	  char str[128];
-	  sprintf(str,
-		  "Shake atoms %d %d %d %d missing on proc %d at step " 
-		  BIGINT_FORMAT,
-		  shake_atom[i][0],shake_atom[i][1],
-		  shake_atom[i][2],shake_atom[i][3],
-		  me,update->ntimestep);
-	  error->one(FLERR,str);
-	}
-	if (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4) 
-	  list[nlist++] = i;
+        atom1 = atom->map(shake_atom[i][0]);
+        atom2 = atom->map(shake_atom[i][1]);
+        atom3 = atom->map(shake_atom[i][2]);
+        atom4 = atom->map(shake_atom[i][3]);
+        if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
+          char str[128];
+          sprintf(str,
+                  "Shake atoms %d %d %d %d missing on proc %d at step "
+                  BIGINT_FORMAT,
+                  shake_atom[i][0],shake_atom[i][1],
+                  shake_atom[i][2],shake_atom[i][3],
+                  me,update->ntimestep);
+          error->one(FLERR,str);
+        }
+        if (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)
+          list[nlist++] = i;
       }
     }
     count2/=2;
@@ -553,7 +553,7 @@ void FixShakeCuda::pre_neighbor()
         int tmp = list[k]; list[k]=list[l]; list[l]=tmp;
       }
     }
-    
+
     for(int k = count2,l = count3; k < count3; k++)
     {
       if(shake_flag[list[k]]!=3)
@@ -563,7 +563,7 @@ void FixShakeCuda::pre_neighbor()
         int tmp = list[k]; list[k]=list[l]; list[l]=tmp;
       }
     }
-    
+
     for(int k = count3,l = count4; k < count4; k++)
     {
       if(shake_flag[list[k]]!=4)
@@ -573,42 +573,42 @@ void FixShakeCuda::pre_neighbor()
         int tmp = list[k]; list[k]=list[l]; list[l]=tmp;
       }
     }
-  	cu_list->upload();
-  	cu_bond_distance->upload();
-  	cu_angle_distance->upload();
-  	cu_shake_flag->upload();
-  	cu_shake_atom->upload();
-  	cu_shake_type->upload();
-  	
+          cu_list->upload();
+          cu_bond_distance->upload();
+          cu_angle_distance->upload();
+          cu_shake_flag->upload();
+          cu_shake_atom->upload();
+          cu_shake_type->upload();
+
     neighbor_step=true;
 }
 
 /* ----------------------------------------------------------------------
-   compute the force adjustment for SHAKE constraint 
+   compute the force adjustment for SHAKE constraint
 ------------------------------------------------------------------------- */
 
 void FixShakeCuda::post_force(int vflag)
 {
-	timespec starttime;
-	timespec endtime;
+        timespec starttime;
+        timespec endtime;
 
 
-	if(cuda->finished_setup && neighbor_step)
-	{
+        if(cuda->finished_setup && neighbor_step)
+        {
  Cuda_FixShakeCuda_Init(&cuda->shared_data,dtv, dtfsq,
-  	cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
-  	cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
-	max_iter,tolerance);
-	
-	}
-		
-	if(not cuda->finished_setup)
-	cuda->downloadAll();
-  if (update->ntimestep == next_output) 
+          cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
+          cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
+        max_iter,tolerance);
+
+        }
+
+        if(not cuda->finished_setup)
+        cuda->downloadAll();
+  if (update->ntimestep == next_output)
   {
-  	if(cuda->finished_setup) 
-  	cuda->cu_x->download();
-  	stats();
+          if(cuda->finished_setup)
+          cuda->cu_x->download();
+          stats();
   }
 
   // xshake = unconstrained move with current v,f
@@ -616,15 +616,15 @@ void FixShakeCuda::post_force(int vflag)
   unconstrained_update();
 
   // communicate results if necessary
-  
+
   //if(cuda->finished_setup) cu_xshake->download();
 
-  if (nprocs > 1) 
+  if (nprocs > 1)
   {
-  //if(cuda->finished_setup) 
+  //if(cuda->finished_setup)
   //cu_xshake->download();
-  	comm->forward_comm_fix(this);
-  //if(cuda->finished_setup) 
+          comm->forward_comm_fix(this);
+  //if(cuda->finished_setup)
   //cu_xshake->upload();
   }
   // virial setup
@@ -634,36 +634,36 @@ void FixShakeCuda::post_force(int vflag)
 
   // loop over clusters
 
-	clock_gettime(CLOCK_REALTIME,&starttime);
+        clock_gettime(CLOCK_REALTIME,&starttime);
   if(cuda->finished_setup)
   {
-  	cu_virial->upload();
-  	if(vflag_atom) cuda->cu_vatom->upload();
-  	
-  	Cuda_FixShakeCuda_Shake(&cuda->shared_data,vflag,vflag_atom,(int*)cu_list->dev_data(),nlist);
-  	cu_virial->download();
-    if(vflag_atom) cuda->cu_vatom->download();  	
-  	
+          cu_virial->upload();
+          if(vflag_atom) cuda->cu_vatom->upload();
+
+          Cuda_FixShakeCuda_Shake(&cuda->shared_data,vflag,vflag_atom,(int*)cu_list->dev_data(),nlist);
+          cu_virial->download();
+    if(vflag_atom) cuda->cu_vatom->download();
+
   }
   else
   for (int i = 0; i < nlist; i++) {
     int m = list[i];
-    if (shake_flag[m] == 2) shake2(m); 
-    else if (shake_flag[m] == 3) shake3(m); 
-    else if (shake_flag[m] == 4) shake4(m); 
-    else shake3angle(m); 
+    if (shake_flag[m] == 2) shake2(m);
+    else if (shake_flag[m] == 3) shake3(m);
+    else if (shake_flag[m] == 4) shake4(m);
+    else shake3angle(m);
   }
   if((not cuda->finished_setup))  cuda->cu_f->upload();
-	clock_gettime(CLOCK_REALTIME,&endtime);
-	if(cuda->finished_setup)
-	time_postforce+=(endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000);
-	else
-	time_postforce=0.0;
-	//printf("Postforce time: %lf\n",time_postforce);
+        clock_gettime(CLOCK_REALTIME,&endtime);
+        if(cuda->finished_setup)
+        time_postforce+=(endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000);
+        else
+        time_postforce=0.0;
+        //printf("Postforce time: %lf\n",time_postforce);
 }
 
 /* ----------------------------------------------------------------------
-   count # of degrees-of-freedom removed by SHAKE for atoms in igroup 
+   count # of degrees-of-freedom removed by SHAKE for atoms in igroup
 ------------------------------------------------------------------------- */
 
 int FixShakeCuda::dof(int igroup)
@@ -698,7 +698,7 @@ int FixShakeCuda::dof(int igroup)
    only include atoms in fix group and those bonds/angles specified in input
    test whether all clusters are valid
    set shake_flag, shake_atom, shake_type values
-   set bond,angle types negative so will be ignored in neighbor lists 
+   set bond,angle types negative so will be ignored in neighbor lists
 ------------------------------------------------------------------------- */
 
 void FixShakeCuda::find_clusters()
@@ -728,7 +728,7 @@ void FixShakeCuda::find_clusters()
   // setup ring of procs
 
   int next = me + 1;
-  int prev = me -1; 
+  int prev = me -1;
   if (next == nprocs) next = 0;
   if (prev < 0) prev = nprocs - 1;
 
@@ -795,19 +795,19 @@ void FixShakeCuda::find_clusters()
 
       m = atom->map(partner_tag[i][j]);
       if (m >= 0 && m < nlocal) {
-	partner_mask[i][j] = mask[m];
-	partner_type[i][j] = type[m];
-	if (nmass) {
-	  if (rmass) massone = rmass[m];
-	  else massone = mass[type[m]];
-	  partner_massflag[i][j] = masscheck(massone);
-	}
-	n = bondfind(i,tag[i],partner_tag[i][j]);
-	if (n >= 0) partner_bondtype[i][j] = bond_type[i][n];
-	else {
-	  n = bondfind(m,tag[i],partner_tag[i][j]);
-	  if (n >= 0) partner_bondtype[i][j] = bond_type[m][n];
-	}
+        partner_mask[i][j] = mask[m];
+        partner_type[i][j] = type[m];
+        if (nmass) {
+          if (rmass) massone = rmass[m];
+          else massone = mass[type[m]];
+          partner_massflag[i][j] = masscheck(massone);
+        }
+        n = bondfind(i,tag[i],partner_tag[i][j]);
+        if (n >= 0) partner_bondtype[i][j] = bond_type[i][n];
+        else {
+          n = bondfind(m,tag[i],partner_tag[i][j]);
+          if (n >= 0) partner_bondtype[i][j] = bond_type[m][n];
+        }
       } else nbuf += nper;
     }
   }
@@ -824,15 +824,15 @@ void FixShakeCuda::find_clusters()
     for (j = 0; j < npartner[i]; j++) {
       m = atom->map(partner_tag[i][j]);
       if (m < 0 || m >= nlocal) {
-	buf[size] = tag[i];
-	buf[size+1] = partner_tag[i][j];
-	buf[size+2] = 0;
-	buf[size+3] = 0;
-	buf[size+4] = 0;
-	n = bondfind(i,tag[i],partner_tag[i][j]);
-	if (n >= 0) buf[size+5] = bond_type[i][n];
-	else buf[size+5] = 0;
-	size += nper;
+        buf[size] = tag[i];
+        buf[size+1] = partner_tag[i][j];
+        buf[size+2] = 0;
+        buf[size+3] = 0;
+        buf[size+4] = 0;
+        n = bondfind(i,tag[i],partner_tag[i][j]);
+        if (n >= 0) buf[size+5] = bond_type[i][n];
+        else buf[size+5] = 0;
+        size += nper;
       }
     }
   }
@@ -849,17 +849,17 @@ void FixShakeCuda::find_clusters()
     while (i < size) {
       m = atom->map(buf[i+1]);
       if (m >= 0 && m < nlocal) {
-	buf[i+2] = mask[m];
-	buf[i+3] = type[m];
-	if (nmass) {
-	  if (rmass) massone = rmass[m];
-	  else massone = mass[type[m]];
-	  buf[i+4] = masscheck(massone);
-	}
-	if (buf[i+5] == 0) {
-	  n = bondfind(m,buf[i],buf[i+1]);
-	  if (n >= 0) buf[i+5] = bond_type[m][n];
-	}
+        buf[i+2] = mask[m];
+        buf[i+3] = type[m];
+        if (nmass) {
+          if (rmass) massone = rmass[m];
+          else massone = mass[type[m]];
+          buf[i+4] = masscheck(massone);
+        }
+        if (buf[i+5] == 0) {
+          n = bondfind(m,buf[i],buf[i+1]);
+          if (n >= 0) buf[i+5] = bond_type[m][n];
+        }
       }
       i += nper;
     }
@@ -932,29 +932,29 @@ void FixShakeCuda::find_clusters()
       if (partner_bondtype[i][j] <= 0) continue;
 
       if (bond_flag[partner_bondtype[i][j]]) {
-	partner_shake[i][j] = 1;
-	nshake[i]++;
-	continue;
+        partner_shake[i][j] = 1;
+        nshake[i]++;
+        continue;
       }
       if (type_flag[type[i]] || type_flag[partner_type[i][j]]) {
-	partner_shake[i][j] = 1;
-	nshake[i]++;
-	continue;
+        partner_shake[i][j] = 1;
+        nshake[i]++;
+        continue;
       }
       if (nmass) {
-	if (partner_massflag[i][j]) {
-	  partner_shake[i][j] = 1;
-	  nshake[i]++;
-	  continue;
-	} else {
-	  if (rmass) massone = rmass[i];
-	  else massone = mass[type[i]];
-	  if (masscheck(massone)) {
-	    partner_shake[i][j] = 1;
-	    nshake[i]++;
-	    continue;
-	  }
-	}
+        if (partner_massflag[i][j]) {
+          partner_shake[i][j] = 1;
+          nshake[i]++;
+          continue;
+        } else {
+          if (rmass) massone = rmass[i];
+          else massone = mass[type[i]];
+          if (masscheck(massone)) {
+            partner_shake[i][j] = 1;
+            nshake[i]++;
+            continue;
+          }
+        }
       }
     }
   }
@@ -977,7 +977,7 @@ void FixShakeCuda::find_clusters()
       else nbuf += 3;
     }
   }
-  
+
   MPI_Allreduce(&nbuf,&nbufmax,1,MPI_INT,MPI_MAX,world);
 
   buf = new int[nbufmax];
@@ -990,9 +990,9 @@ void FixShakeCuda::find_clusters()
     for (j = 0; j < npartner[i]; j++) {
       m = atom->map(partner_tag[i][j]);
       if (m < 0 || m >= nlocal) {
-	buf[size] = tag[i];
-	buf[size+1] = partner_tag[i][j];
-	size += 3;
+        buf[size] = tag[i];
+        buf[size+1] = partner_tag[i][j];
+        size += 3;
       }
     }
   }
@@ -1055,7 +1055,7 @@ void FixShakeCuda::find_clusters()
   // -----------------------------------------------------
   // set SHAKE arrays that are stored with atoms & add angle constraints
   // zero shake arrays for all owned atoms
-  // if I am central atom set shake_flag & shake_atom & shake_type 
+  // if I am central atom set shake_flag & shake_atom & shake_type
   // for 2-atom clusters, I am central atom if my atom ID < partner ID
   // for 3-atom clusters, test for angle constraint
   //   angle will be stored by this atom if it exists
@@ -1082,12 +1082,12 @@ void FixShakeCuda::find_clusters()
 
     if (nshake[i] == 1) {
       for (j = 0; j < npartner[i]; j++)
-	if (partner_shake[i][j]) break;
+        if (partner_shake[i][j]) break;
       if (partner_nshake[i][j] == 1 && tag[i] < partner_tag[i][j]) {
-	shake_flag[i] = 2;
-	shake_atom[i][0] = tag[i];
-	shake_atom[i][1] = partner_tag[i][j];
-	shake_type[i][0] = partner_bondtype[i][j];
+        shake_flag[i] = 2;
+        shake_atom[i][0] = tag[i];
+        shake_atom[i][1] = partner_tag[i][j];
+        shake_type[i][0] = partner_bondtype[i][j];
       }
     }
 
@@ -1095,12 +1095,12 @@ void FixShakeCuda::find_clusters()
       shake_flag[i] = 1;
       shake_atom[i][0] = tag[i];
       for (j = 0; j < npartner[i]; j++)
-	if (partner_shake[i][j]) {
-	  m = shake_flag[i];
-	  shake_atom[i][m] = partner_tag[i][j];
-	  shake_type[i][m-1] = partner_bondtype[i][j];
-	  shake_flag[i]++;
-	}
+        if (partner_shake[i][j]) {
+          m = shake_flag[i];
+          shake_atom[i][m] = partner_tag[i][j];
+          shake_type[i][m-1] = partner_bondtype[i][j];
+          shake_flag[i]++;
+        }
     }
 
     if (nshake[i] == 2) {
@@ -1108,8 +1108,8 @@ void FixShakeCuda::find_clusters()
       if (n < 0) continue;
       if (angle_type[i][n] < 0) continue;
       if (angle_flag[angle_type[i][n]]) {
-	shake_flag[i] = 1;
-	shake_type[i][2] = angle_type[i][n];
+        shake_flag[i] = 1;
+        shake_type[i][2] = angle_type[i][n];
       }
     }
   }
@@ -1131,14 +1131,14 @@ void FixShakeCuda::find_clusters()
       if (partner_shake[i][j] == 0) continue;
       m = atom->map(partner_tag[i][j]);
       if (m >= 0 && m < nlocal) {
-	shake_flag[m] = shake_flag[i];
-	shake_atom[m][0] = shake_atom[i][0];
-	shake_atom[m][1] = shake_atom[i][1];
-	shake_atom[m][2] = shake_atom[i][2];
-	shake_atom[m][3] = shake_atom[i][3];
-	shake_type[m][0] = shake_type[i][0];
-	shake_type[m][1] = shake_type[i][1];
-	shake_type[m][2] = shake_type[i][2];
+        shake_flag[m] = shake_flag[i];
+        shake_atom[m][0] = shake_atom[i][0];
+        shake_atom[m][1] = shake_atom[i][1];
+        shake_atom[m][2] = shake_atom[i][2];
+        shake_atom[m][3] = shake_atom[i][3];
+        shake_type[m][0] = shake_type[i][0];
+        shake_type[m][1] = shake_type[i][1];
+        shake_type[m][2] = shake_type[i][2];
       } else nbuf += 9;
     }
   }
@@ -1157,16 +1157,16 @@ void FixShakeCuda::find_clusters()
       if (partner_shake[i][j] == 0) continue;
       m = atom->map(partner_tag[i][j]);
       if (m < 0 || m >= nlocal) {
-	buf[size] = partner_tag[i][j];
-	buf[size+1] = shake_flag[i];
-	buf[size+2] = shake_atom[i][0];
-	buf[size+3] = shake_atom[i][1];
-	buf[size+4] = shake_atom[i][2];
-	buf[size+5] = shake_atom[i][3];
-	buf[size+6] = shake_type[i][0];
-	buf[size+7] = shake_type[i][1];
-	buf[size+8] = shake_type[i][2];
-	size += 9;
+        buf[size] = partner_tag[i][j];
+        buf[size+1] = shake_flag[i];
+        buf[size+2] = shake_atom[i][0];
+        buf[size+3] = shake_atom[i][1];
+        buf[size+4] = shake_atom[i][2];
+        buf[size+5] = shake_atom[i][3];
+        buf[size+6] = shake_type[i][0];
+        buf[size+7] = shake_type[i][1];
+        buf[size+8] = shake_type[i][2];
+        size += 9;
       }
     }
   }
@@ -1181,14 +1181,14 @@ void FixShakeCuda::find_clusters()
     while (i < size) {
       m = atom->map(buf[i]);
       if (m >= 0 && m < nlocal) {
-	shake_flag[m] = buf[i+1];
-	shake_atom[m][0] = buf[i+2];
-	shake_atom[m][1] = buf[i+3];
-	shake_atom[m][2] = buf[i+4];
-	shake_atom[m][3] = buf[i+5];
-	shake_type[m][0] = buf[i+6];
-	shake_type[m][1] = buf[i+7];
-	shake_type[m][2] = buf[i+8];
+        shake_flag[m] = buf[i+1];
+        shake_atom[m][0] = buf[i+2];
+        shake_atom[m][1] = buf[i+3];
+        shake_atom[m][2] = buf[i+4];
+        shake_atom[m][3] = buf[i+5];
+        shake_type[m][0] = buf[i+6];
+        shake_type[m][1] = buf[i+7];
+        shake_type[m][2] = buf[i+8];
       }
       i += 9;
     }
@@ -1262,11 +1262,11 @@ void FixShakeCuda::find_clusters()
     else if (shake_flag[i] == 3) count3++;
     else if (shake_flag[i] == 4) count4++;
   }
-  
+
   for(int i=0;i<nlocal;i++)
   {
   }
-  
+
 
   int tmp;
   tmp = count1;
@@ -1296,23 +1296,23 @@ void FixShakeCuda::find_clusters()
   cu_shake_atom->upload();
   cu_shake_type->upload();
   Cuda_FixShakeCuda_Init(&cuda->shared_data,dtv, dtfsq,
-  		cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
-  		cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
-	    max_iter,tolerance);
-  
+                  cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
+                  cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
+            max_iter,tolerance);
+
 }
 
 void FixShakeCuda::swap_clusters(int i, int j)
 {
-	int tmp;
-	tmp = shake_flag[i]; shake_flag[i] = shake_flag[j]; shake_flag[j] = tmp;
-	tmp = shake_atom[i][0]; shake_atom[i][0] = shake_atom[j][0]; shake_atom[j][0] = tmp;
-	tmp = shake_atom[i][1]; shake_atom[i][1] = shake_atom[j][1]; shake_atom[j][1] = tmp;
-	tmp = shake_atom[i][2]; shake_atom[i][2] = shake_atom[j][2]; shake_atom[j][2] = tmp;
-	tmp = shake_atom[i][3]; shake_atom[i][3] = shake_atom[j][3]; shake_atom[j][3] = tmp;
-	tmp = shake_type[i][0]; shake_type[i][0] = shake_type[j][0]; shake_type[j][0] = tmp;
-	tmp = shake_type[i][1]; shake_type[i][1] = shake_type[j][1]; shake_type[j][1] = tmp;
-	tmp = shake_type[i][2]; shake_type[i][2] = shake_type[j][2]; shake_type[j][2] = tmp;
+        int tmp;
+        tmp = shake_flag[i]; shake_flag[i] = shake_flag[j]; shake_flag[j] = tmp;
+        tmp = shake_atom[i][0]; shake_atom[i][0] = shake_atom[j][0]; shake_atom[j][0] = tmp;
+        tmp = shake_atom[i][1]; shake_atom[i][1] = shake_atom[j][1]; shake_atom[j][1] = tmp;
+        tmp = shake_atom[i][2]; shake_atom[i][2] = shake_atom[j][2]; shake_atom[j][2] = tmp;
+        tmp = shake_atom[i][3]; shake_atom[i][3] = shake_atom[j][3]; shake_atom[j][3] = tmp;
+        tmp = shake_type[i][0]; shake_type[i][0] = shake_type[j][0]; shake_type[j][0] = tmp;
+        tmp = shake_type[i][1]; shake_type[i][1] = shake_type[j][1]; shake_type[j][1] = tmp;
+        tmp = shake_type[i][2]; shake_type[i][2] = shake_type[j][2]; shake_type[j][2] = tmp;
 }
 
 /* ----------------------------------------------------------------------
@@ -1330,7 +1330,7 @@ int FixShakeCuda::masscheck(double massone)
 /* ----------------------------------------------------------------------
    update the unconstrained position of each atom
    only for SHAKE clusters, else set to 0.0
-   assumes NVE update, seems to be accurate enough for NVT,NPT,NPH as well 
+   assumes NVE update, seems to be accurate enough for NVT,NPT,NPH as well
 ------------------------------------------------------------------------- */
 
 void FixShakeCuda::unconstrained_update()
@@ -1340,25 +1340,25 @@ void FixShakeCuda::unconstrained_update()
     Cuda_FixShakeCuda_UnconstrainedUpdate(&cuda->shared_data);
     return;
   }
-  
+
   double dtfmsq;
-  
+
   if (rmass) {
     for (int i = 0; i < nlocal; i++) {
       if (shake_flag[i]) {
-	dtfmsq = dtfsq / rmass[i];
-	xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
-	xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
-	xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
+        dtfmsq = dtfsq / rmass[i];
+        xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
+        xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
+        xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
       } else xshake[i][2] = xshake[i][1] = xshake[i][0] = 0.0;
     }
   } else {
     for (int i = 0; i < nlocal; i++) {
       if (shake_flag[i]) {
-	dtfmsq = dtfsq / mass[type[i]];
-	xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
-	xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
-	xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
+        dtfmsq = dtfsq / mass[type[i]];
+        xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
+        xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
+        xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
       } else xshake[i][2] = xshake[i][1] = xshake[i][0] = 0.0;
     }
   }
@@ -1378,7 +1378,7 @@ void FixShakeCuda::shake2(int m)
   int i0 = atom->map(shake_atom[m][0]);
   int i1 = atom->map(shake_atom[m][1]);
   double bond1 = bond_distance[shake_type[m][0]];
-   
+
   // r01 = distance vec between atoms, with PBC
 
   double r01[3];
@@ -1401,7 +1401,7 @@ void FixShakeCuda::shake2(int m)
   double s01sq = s01[0]*s01[0] + s01[1]*s01[1] + s01[2]*s01[2];
 
   // a,b,c = coeffs in quadratic equation for lamda
-  
+
   if (rmass) {
     invmass0 = 1.0/rmass[i0];
     invmass1 = 1.0/rmass[i1];
@@ -1540,7 +1540,7 @@ void FixShakeCuda::shake3(int m)
   double determ = a11*a22 - a12*a21;
   if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
-  
+
   double a11inv = a22*determinv;
   double a12inv = -a12*determinv;
   double a21inv = -a21*determinv;
@@ -1568,14 +1568,14 @@ void FixShakeCuda::shake3(int m)
   double quad1,quad2,b1,b2,lamda01_new,lamda02_new;
 
   while (!done && niter < max_iter) {
-    quad1 = quad1_0101 * lamda01*lamda01 + quad1_0202 * lamda02*lamda02 + 
+    quad1 = quad1_0101 * lamda01*lamda01 + quad1_0202 * lamda02*lamda02 +
       quad1_0102 * lamda01*lamda02;
-    quad2 = quad2_0101 * lamda01*lamda01 + quad2_0202 * lamda02*lamda02 + 
+    quad2 = quad2_0101 * lamda01*lamda01 + quad2_0202 * lamda02*lamda02 +
       quad2_0102 * lamda01*lamda02;
-        
+
     b1 = bond1*bond1 - s01sq - quad1;
     b2 = bond2*bond2 - s02sq - quad2;
-        
+
     lamda01_new = a11inv*b1 + a12inv*b2;
     lamda02_new = a21inv*b1 + a22inv*b2;
 
@@ -1727,14 +1727,14 @@ void FixShakeCuda::shake4(int m)
     (s03[0]*r02[0] + s03[1]*r02[1] + s03[2]*r02[2]);
   double a33 = 2.0 * (invmass0+invmass3) *
     (s03[0]*r03[0] + s03[1]*r03[1] + s03[2]*r03[2]);
-  
+
   // inverse of matrix;
 
   double determ = a11*a22*a33 + a12*a23*a31 + a13*a21*a32 -
     a11*a23*a32 - a12*a21*a33 - a13*a22*a31;
   if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
-  
+
   double a11inv = determinv * (a22*a33 - a23*a32);
   double a12inv = -determinv * (a12*a33 - a13*a32);
   double a13inv = determinv * (a12*a23 - a13*a22);
@@ -1783,23 +1783,23 @@ void FixShakeCuda::shake4(int m)
   double quad1,quad2,quad3,b1,b2,b3,lamda01_new,lamda02_new,lamda03_new;
 
   while (!done && niter < max_iter) {
-    quad1 = quad1_0101 * lamda01*lamda01 + 
+    quad1 = quad1_0101 * lamda01*lamda01 +
       quad1_0202 * lamda02*lamda02 +
-      quad1_0303 * lamda03*lamda03 + 
+      quad1_0303 * lamda03*lamda03 +
       quad1_0102 * lamda01*lamda02 +
       quad1_0103 * lamda01*lamda03 +
       quad1_0203 * lamda02*lamda03;
 
-    quad2 = quad2_0101 * lamda01*lamda01 + 
+    quad2 = quad2_0101 * lamda01*lamda01 +
       quad2_0202 * lamda02*lamda02 +
-      quad2_0303 * lamda03*lamda03 + 
+      quad2_0303 * lamda03*lamda03 +
       quad2_0102 * lamda01*lamda02 +
       quad2_0103 * lamda01*lamda03 +
       quad2_0203 * lamda02*lamda03;
 
-    quad3 = quad3_0101 * lamda01*lamda01 + 
+    quad3 = quad3_0101 * lamda01*lamda01 +
       quad3_0202 * lamda02*lamda02 +
-      quad3_0303 * lamda03*lamda03 + 
+      quad3_0303 * lamda03*lamda03 +
       quad3_0102 * lamda01*lamda02 +
       quad3_0103 * lamda01*lamda03 +
       quad3_0203 * lamda02*lamda03;
@@ -1807,7 +1807,7 @@ void FixShakeCuda::shake4(int m)
     b1 = bond1*bond1 - s01sq - quad1;
     b2 = bond2*bond2 - s02sq - quad2;
     b3 = bond3*bond3 - s03sq - quad3;
-        
+
     lamda01_new = a11inv*b1 + a12inv*b2 + a13inv*b3;
     lamda02_new = a21inv*b1 + a22inv*b2 + a23inv*b3;
     lamda03_new = a31inv*b1 + a32inv*b2 + a33inv*b3;
@@ -1975,7 +1975,7 @@ void FixShakeCuda::shake3angle(int m)
     a11*a23*a32 - a12*a21*a33 - a13*a22*a31;
   if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
-  
+
   double a11inv = determinv * (a22*a33 - a23*a32);
   double a12inv = -determinv * (a12*a33 - a13*a32);
   double a13inv = determinv * (a12*a23 - a13*a22);
@@ -2024,23 +2024,23 @@ void FixShakeCuda::shake3angle(int m)
   double quad1,quad2,quad3,b1,b2,b3,lamda01_new,lamda02_new,lamda12_new;
 
   while (!done && niter < max_iter) {
-    quad1 = quad1_0101 * lamda01*lamda01 + 
+    quad1 = quad1_0101 * lamda01*lamda01 +
       quad1_0202 * lamda02*lamda02 +
-      quad1_1212 * lamda12*lamda12 + 
+      quad1_1212 * lamda12*lamda12 +
       quad1_0102 * lamda01*lamda02 +
       quad1_0112 * lamda01*lamda12 +
       quad1_0212 * lamda02*lamda12;
 
-    quad2 = quad2_0101 * lamda01*lamda01 + 
+    quad2 = quad2_0101 * lamda01*lamda01 +
       quad2_0202 * lamda02*lamda02 +
-      quad2_1212 * lamda12*lamda12 + 
+      quad2_1212 * lamda12*lamda12 +
       quad2_0102 * lamda01*lamda02 +
       quad2_0112 * lamda01*lamda12 +
       quad2_0212 * lamda02*lamda12;
-      
-    quad3 = quad3_0101 * lamda01*lamda01 + 
+
+    quad3 = quad3_0101 * lamda01*lamda01 +
       quad3_0202 * lamda02*lamda02 +
-      quad3_1212 * lamda12*lamda12 + 
+      quad3_1212 * lamda12*lamda12 +
       quad3_0102 * lamda01*lamda02 +
       quad3_0112 * lamda01*lamda12 +
       quad3_0212 * lamda02*lamda12;
@@ -2048,7 +2048,7 @@ void FixShakeCuda::shake3angle(int m)
     b1 = bond1*bond1 - s01sq - quad1;
     b2 = bond2*bond2 - s02sq - quad2;
     b3 = bond12*bond12 - s12sq - quad3;
-        
+
     lamda01_new = a11inv*b1 + a12inv*b2 + a13inv*b3;
     lamda02_new = a21inv*b1 + a22inv*b2 + a23inv*b3;
     lamda12_new = a31inv*b1 + a32inv*b2 + a33inv*b3;
@@ -2106,7 +2106,7 @@ void FixShakeCuda::shake3angle(int m)
 }
 
 /* ----------------------------------------------------------------------
-   print-out bond & angle statistics 
+   print-out bond & angle statistics
 ------------------------------------------------------------------------- */
 
 void FixShakeCuda::stats()
@@ -2152,7 +2152,7 @@ void FixShakeCuda::stats()
       delz = x[iatom][2] - x[jatom][2];
       domain->minimum_image(delx,dely,delz);
       r = sqrt(delx*delx + dely*dely + delz*delz);
-      
+
       m = shake_type[i][j-1];
       b_count[m]++;
       b_ave[m] += r;
@@ -2212,29 +2212,29 @@ void FixShakeCuda::stats()
   if (me == 0) {
     if (screen) {
       fprintf(screen,
-	      "SHAKE stats (type/ave/delta) on step " BIGINT_FORMAT "\n",
-	      update->ntimestep);
-      for (i = 1; i < nb; i++) 
-	if (b_count_all[i])
-	  fprintf(screen,"  %d %g %g\n",i,
-		  b_ave_all[i]/b_count_all[i],b_max_all[i]-b_min_all[i]);
-      for (i = 1; i < na; i++) 
-	if (a_count_all[i])
-	  fprintf(screen,"  %d %g %g\n",i,
-		  a_ave_all[i]/a_count_all[i],a_max_all[i]-a_min_all[i]);
+              "SHAKE stats (type/ave/delta) on step " BIGINT_FORMAT "\n",
+              update->ntimestep);
+      for (i = 1; i < nb; i++)
+        if (b_count_all[i])
+          fprintf(screen,"  %d %g %g\n",i,
+                  b_ave_all[i]/b_count_all[i],b_max_all[i]-b_min_all[i]);
+      for (i = 1; i < na; i++)
+        if (a_count_all[i])
+          fprintf(screen,"  %d %g %g\n",i,
+                  a_ave_all[i]/a_count_all[i],a_max_all[i]-a_min_all[i]);
     }
     if (logfile) {
       fprintf(logfile,
-	      "SHAKE stats (type/ave/delta) on step " BIGINT_FORMAT "\n",
-	      update->ntimestep);
-      for (i = 0; i < nb; i++) 
-	if (b_count_all[i])
-	  fprintf(logfile,"  %d %g %g\n",i,
-		  b_ave_all[i]/b_count_all[i],b_max_all[i]-b_min_all[i]);
-      for (i = 0; i < na; i++) 
-	if (a_count_all[i])
-	  fprintf(logfile,"  %d %g %g\n",i,
-		  a_ave_all[i]/a_count_all[i],a_max_all[i]-a_min_all[i]);
+              "SHAKE stats (type/ave/delta) on step " BIGINT_FORMAT "\n",
+              update->ntimestep);
+      for (i = 0; i < nb; i++)
+        if (b_count_all[i])
+          fprintf(logfile,"  %d %g %g\n",i,
+                  b_ave_all[i]/b_count_all[i],b_max_all[i]-b_min_all[i]);
+      for (i = 0; i < na; i++)
+        if (a_count_all[i])
+          fprintf(logfile,"  %d %g %g\n",i,
+                  a_ave_all[i]/a_count_all[i],a_max_all[i]-a_min_all[i]);
     }
   }
 
@@ -2286,7 +2286,7 @@ int FixShakeCuda::anglefind(int i, int n1, int n2)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double FixShakeCuda::memory_usage()
@@ -2301,7 +2301,7 @@ double FixShakeCuda::memory_usage()
 }
 
 /* ----------------------------------------------------------------------
-   allocate local atom-based arrays 
+   allocate local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixShakeCuda::grow_arrays(int nmax)
@@ -2321,13 +2321,13 @@ void FixShakeCuda::grow_arrays(int nmax)
   cu_shake_type->upload();
   if(cu_bond_distance)
   Cuda_FixShakeCuda_Init(&cuda->shared_data,dtv, dtfsq,
-  	cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
-  	cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
-	max_iter,tolerance);
+          cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
+          cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
+        max_iter,tolerance);
 }
 
 /* ----------------------------------------------------------------------
-   copy values within local atom-based arrays 
+   copy values within local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixShakeCuda::copy_arrays(int i, int j)
@@ -2371,7 +2371,7 @@ void FixShakeCuda::set_arrays(int i)
 }
 
 /* ----------------------------------------------------------------------
-   pack values in local atom-based arrays for exchange with another proc 
+   pack values in local atom-based arrays for exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixShakeCuda::pack_exchange(int i, double *buf)
@@ -2409,7 +2409,7 @@ int FixShakeCuda::pack_exchange(int i, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   unpack values in local atom-based arrays from exchange with another proc 
+   unpack values in local atom-based arrays from exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixShakeCuda::unpack_exchange(int nlocal, double *buf)
@@ -2461,7 +2461,7 @@ void FixShakeCuda::post_force_respa(int vflag, int ilevel, int iloop)
   // except last loop iteration of inner levels
 
   if (ilevel < nlevels_respa-1 && iloop == loop_respa[ilevel]-1) return;
-  
+
   // xshake = atom coords after next x update in innermost loop
   // depends on rRESPA level
   // for levels > 0 this includes more than one velocity update
@@ -2477,34 +2477,34 @@ void FixShakeCuda::post_force_respa(int vflag, int ilevel, int iloop)
   if (rmass) {
     for (int i = 0; i < nlocal; i++) {
       if (shake_flag[i]) {
-	invmass = 1.0 / rmass[i];
-	dtfmsq = dtfsq * invmass;
-	xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
-	xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
-	xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
-	for (jlevel = 0; jlevel < ilevel; jlevel++) {
-	  dtfmsq = dtf_innerhalf * step_respa[jlevel] * invmass;
-	  xshake[i][0] += dtfmsq*f_level[i][jlevel][0];
-	  xshake[i][1] += dtfmsq*f_level[i][jlevel][1];
-	  xshake[i][2] += dtfmsq*f_level[i][jlevel][2];
-	}
+        invmass = 1.0 / rmass[i];
+        dtfmsq = dtfsq * invmass;
+        xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
+        xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
+        xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
+        for (jlevel = 0; jlevel < ilevel; jlevel++) {
+          dtfmsq = dtf_innerhalf * step_respa[jlevel] * invmass;
+          xshake[i][0] += dtfmsq*f_level[i][jlevel][0];
+          xshake[i][1] += dtfmsq*f_level[i][jlevel][1];
+          xshake[i][2] += dtfmsq*f_level[i][jlevel][2];
+        }
       } else xshake[i][2] = xshake[i][1] = xshake[i][0] = 0.0;
     }
 
   } else {
     for (int i = 0; i < nlocal; i++) {
       if (shake_flag[i]) {
-	invmass = 1.0 / mass[type[i]];
-	dtfmsq = dtfsq * invmass;
-	xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
-	xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
-	xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
-	for (jlevel = 0; jlevel < ilevel; jlevel++) {
-	  dtfmsq = dtf_innerhalf * step_respa[jlevel] * invmass;
-	  xshake[i][0] += dtfmsq*f_level[i][jlevel][0];
-	  xshake[i][1] += dtfmsq*f_level[i][jlevel][1];
-	  xshake[i][2] += dtfmsq*f_level[i][jlevel][2];
-	}
+        invmass = 1.0 / mass[type[i]];
+        dtfmsq = dtfsq * invmass;
+        xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
+        xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
+        xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
+        for (jlevel = 0; jlevel < ilevel; jlevel++) {
+          dtfmsq = dtf_innerhalf * step_respa[jlevel] * invmass;
+          xshake[i][0] += dtfmsq*f_level[i][jlevel][0];
+          xshake[i][1] += dtfmsq*f_level[i][jlevel][1];
+          xshake[i][2] += dtfmsq*f_level[i][jlevel][2];
+        }
       } else xshake[i][2] = xshake[i][1] = xshake[i][0] = 0.0;
     }
   }
@@ -2537,18 +2537,18 @@ int FixShakeCuda::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pb
 {
   if(cuda->finished_setup)
   {
-  	 int iswap=*list;
-  	 if(iswap<0) 
-  	 {
-  	 	iswap=-iswap-1;
-  	 	int first= ((int*) buf)[0];
-  	 	Cuda_FixShakeCuda_PackComm_Self(&cuda->shared_data,n,iswap,first,pbc,pbc_flag);
-  	 }
-  	 else
+           int iswap=*list;
+           if(iswap<0)
+           {
+                   iswap=-iswap-1;
+                   int first= ((int*) buf)[0];
+                   Cuda_FixShakeCuda_PackComm_Self(&cuda->shared_data,n,iswap,first,pbc,pbc_flag);
+           }
+           else
      Cuda_FixShakeCuda_PackComm(&cuda->shared_data,n,iswap,(void*) buf,pbc,pbc_flag);
      return 3;
   }
-  
+
   int i,j,m;
   double dx,dy,dz;
 
@@ -2589,7 +2589,7 @@ void FixShakeCuda::unpack_comm(int n, int first, double *buf)
      Cuda_FixShakeCuda_UnpackComm(&cuda->shared_data,n,first,(void*)buf);
      return;
   }
-  
+
   int i,m,last;
 
   m = 0;
@@ -2615,7 +2615,7 @@ void FixShakeCuda::reset_dt()
   }
   if(cu_shake_atom)
   Cuda_FixShakeCuda_Init(&cuda->shared_data,dtv, dtfsq,
-  	cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
-  	cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
-	max_iter,tolerance);
+          cu_shake_flag->dev_data(),cu_shake_atom->dev_data(),cu_shake_type->dev_data(), cu_xshake->dev_data(),
+          cu_bond_distance->dev_data(),cu_angle_distance->dev_data(),cu_virial->dev_data(),
+        max_iter,tolerance);
 }
diff --git a/src/USER-CUDA/fix_shake_cuda.h b/src/USER-CUDA/fix_shake_cuda.h
index b0ebe584d7..03cd5aa086 100644
--- a/src/USER-CUDA/fix_shake_cuda.h
+++ b/src/USER-CUDA/fix_shake_cuda.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -63,11 +63,11 @@ class FixShakeCuda : public Fix {
   int *type_flag;                        // constrain bonds to these types
   double *mass_list;                     // constrain bonds to these masses
   int nmass;                             // # of masses in mass_list
-  bool neighbor_step;					 // was neighboring done in this step -> need to run the Cuda_FixShake_Init
+  bool neighbor_step;                                         // was neighboring done in this step -> need to run the Cuda_FixShake_Init
 
   double *bond_distance,*angle_distance; // constraint distances
-  cCudaData<double 	  , X_FLOAT , xx >* cu_bond_distance;
-  cCudaData<double 	  , X_FLOAT , xx >* cu_angle_distance;
+  cCudaData<double           , X_FLOAT , xx >* cu_bond_distance;
+  cCudaData<double           , X_FLOAT , xx >* cu_angle_distance;
 
   int ifix_respa;                        // rRESPA fix needed by SHAKE
   int nlevels_respa;                     // copies of needed rRESPA variables
@@ -85,17 +85,17 @@ class FixShakeCuda : public Fix {
   int **shake_atom;                      // global IDs of atoms in cluster
                                          // central atom is 1st
                                          // lowest global ID is 1st for size 2
-                                            
+
   int **shake_type;                      // bondtype of each bond in cluster
                                          // for angle cluster, 3rd value
                                          //   is angletype
   double **xshake;                       // unconstrained atom coords
-  cCudaData<int 	  , int	    , xx >* cu_shake_flag;
-  cCudaData<int 	  , int	    , yx >* cu_shake_atom;
-  cCudaData<int 	  , int	    , yx >* cu_shake_type;
-  cCudaData<double 	  , X_FLOAT , xy >* cu_xshake;
-  cCudaData<int 	  , int	    , xx >* cu_list;
-  cCudaData<double 	  , ENERGY_FLOAT , xx >* cu_virial;
+  cCudaData<int           , int            , xx >* cu_shake_flag;
+  cCudaData<int           , int            , yx >* cu_shake_atom;
+  cCudaData<int           , int            , yx >* cu_shake_type;
+  cCudaData<double           , X_FLOAT , xy >* cu_xshake;
+  cCudaData<int           , int            , xx >* cu_list;
+  cCudaData<double           , ENERGY_FLOAT , xx >* cu_virial;
   int* countoccur;
 
   int vflag;                            // virial flag
diff --git a/src/USER-CUDA/fix_temp_berendsen_cuda.cpp b/src/USER-CUDA/fix_temp_berendsen_cuda.cpp
index 32e86809e4..5f5e13dd3c 100644
--- a/src/USER-CUDA/fix_temp_berendsen_cuda.cpp
+++ b/src/USER-CUDA/fix_temp_berendsen_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -120,11 +120,11 @@ int FixTempBerendsenCuda::setmask()
 void FixTempBerendsenCuda::init()
 {
   int icompute = modify->find_compute(id_temp);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Temperature ID for fix temp/berendsen/cuda does not exist");
   temperature = modify->compute[icompute];
-  if(not temperature->cudable) 
-	error->warning(FLERR,"Fix temp/berendsen/cuda uses non cudable temperature compute");
+  if(not temperature->cudable)
+        error->warning(FLERR,"Fix temp/berendsen/cuda uses non cudable temperature compute");
   if (temperature->tempbias) which = BIAS;
   else which = NOBIAS;
 
@@ -154,32 +154,32 @@ void FixTempBerendsenCuda::end_of_step()
   int nlocal = atom->nlocal;
 
   if (which == NOBIAS) {
-	Cuda_FixTempBerendsenCuda_EndOfStep(&cuda->shared_data, groupbit,lamda);
+        Cuda_FixTempBerendsenCuda_EndOfStep(&cuda->shared_data, groupbit,lamda);
 
     } else {
       if(not temperature->cudable)
       {
-      	cuda->cu_x->download();cuda->cu_v->download();
+              cuda->cu_x->download();cuda->cu_v->download();
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  temperature->remove_bias(i,v[i]);
- 	  v[i][0] *= lamda;
-	  v[i][1] *= lamda;
-	  v[i][2] *= lamda;
-	  temperature->restore_bias(i,v[i]);
-	}
+        if (mask[i] & groupbit) {
+          temperature->remove_bias(i,v[i]);
+           v[i][0] *= lamda;
+          v[i][1] *= lamda;
+          v[i][2] *= lamda;
+          temperature->restore_bias(i,v[i]);
+        }
         }
-	  cuda->cu_v->upload();
+          cuda->cu_v->upload();
       }
       else
-	  {
-  	    temperature->remove_bias_all();
-	    Cuda_FixTempBerendsenCuda_EndOfStep(&cuda->shared_data, groupbit,lamda);
-	    temperature->restore_bias_all();
-	  }
+          {
+              temperature->remove_bias_all();
+            Cuda_FixTempBerendsenCuda_EndOfStep(&cuda->shared_data, groupbit,lamda);
+            temperature->restore_bias_all();
+          }
     }
 
-  
+
 }
 
 /* ---------------------------------------------------------------------- */
@@ -217,6 +217,3 @@ void FixTempBerendsenCuda::reset_target(double t_new)
 {
   t_start = t_stop = t_new;
 }
-
-
-
diff --git a/src/USER-CUDA/fix_temp_berendsen_cuda.h b/src/USER-CUDA/fix_temp_berendsen_cuda.h
index 391cd07e72..076d241813 100644
--- a/src/USER-CUDA/fix_temp_berendsen_cuda.h
+++ b/src/USER-CUDA/fix_temp_berendsen_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/fix_temp_rescale_cuda.cpp b/src/USER-CUDA/fix_temp_rescale_cuda.cpp
index 2582631887..85684d9b46 100644
--- a/src/USER-CUDA/fix_temp_rescale_cuda.cpp
+++ b/src/USER-CUDA/fix_temp_rescale_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -112,11 +112,11 @@ int FixTempRescaleCuda::setmask()
 void FixTempRescaleCuda::init()
 {
   int icompute = modify->find_compute(id_temp);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Temperature ID for fix temp/rescale/cuda does not exist");
   temperature = modify->compute[icompute];
-  if(not temperature->cudable) 
-	error->warning(FLERR,"Fix temp/rescale/cuda uses non cudable temperature compute");
+  if(not temperature->cudable)
+        error->warning(FLERR,"Fix temp/rescale/cuda uses non cudable temperature compute");
   if (temperature->tempbias) which = BIAS;
   else which = NOBIAS;
 }
@@ -149,29 +149,29 @@ void FixTempRescaleCuda::end_of_step()
     if (which == NOBIAS) {
       energy += (t_current-t_target) * efactor;
 
-	Cuda_FixTempRescaleCuda_EndOfStep(&cuda->shared_data, groupbit,factor);
+        Cuda_FixTempRescaleCuda_EndOfStep(&cuda->shared_data, groupbit,factor);
 
     } else if (which == BIAS) {
       energy += (t_current-t_target) * efactor;
       if(not temperature->cudable)
       {
-      	cuda->cu_x->download();cuda->cu_v->download();
+              cuda->cu_x->download();cuda->cu_v->download();
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  temperature->remove_bias(i,v[i]);
-	  v[i][0] *= factor;
-	  v[i][1] *= factor;
-	  v[i][2] *= factor;
-	  temperature->restore_bias(i,v[i]);
-	}
+        if (mask[i] & groupbit) {
+          temperature->remove_bias(i,v[i]);
+          v[i][0] *= factor;
+          v[i][1] *= factor;
+          v[i][2] *= factor;
+          temperature->restore_bias(i,v[i]);
         }
-	  cuda->cu_v->upload();
+        }
+          cuda->cu_v->upload();
       }
       else
       {
-	    temperature->remove_bias_all();
-	    Cuda_FixTempRescaleCuda_EndOfStep(&cuda->shared_data, groupbit,factor);
-	    temperature->restore_bias_all();
+            temperature->remove_bias_all();
+            Cuda_FixTempRescaleCuda_EndOfStep(&cuda->shared_data, groupbit,factor);
+            temperature->restore_bias_all();
       }
     }
 
@@ -201,8 +201,8 @@ int FixTempRescaleCuda::modify_param(int narg, char **arg)
       error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
       error->warning(FLERR,"Group for fix_modify temp != fix group");
-    if(not temperature->cudable) 
-	  error->warning(FLERR,"Fix temp/rescale/cuda uses non cudable temperature compute");
+    if(not temperature->cudable)
+          error->warning(FLERR,"Fix temp/rescale/cuda uses non cudable temperature compute");
     return 2;
   }
   return 0;
diff --git a/src/USER-CUDA/fix_temp_rescale_cuda.h b/src/USER-CUDA/fix_temp_rescale_cuda.h
index 75876e60d3..8e7fedfde1 100644
--- a/src/USER-CUDA/fix_temp_rescale_cuda.h
+++ b/src/USER-CUDA/fix_temp_rescale_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/fix_temp_rescale_limit_cuda.cpp b/src/USER-CUDA/fix_temp_rescale_limit_cuda.cpp
index 6979078a4c..a7d4aaa4d7 100644
--- a/src/USER-CUDA/fix_temp_rescale_limit_cuda.cpp
+++ b/src/USER-CUDA/fix_temp_rescale_limit_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -69,7 +69,7 @@ FixTempRescaleLimitCuda::FixTempRescaleLimitCuda(LAMMPS *lmp, int narg, char **a
   fraction = atof(arg[7]);
   limit = atof(arg[8]);
   if (limit <= 1.0) error->all(FLERR,"Illegal fix temp/rescale/limit/cuda command (limit must be > 1.0)");
-  
+
 
   // create a new compute temp
   // id = fix-ID + temp, compute group = fix group
@@ -115,11 +115,11 @@ int FixTempRescaleLimitCuda::setmask()
 void FixTempRescaleLimitCuda::init()
 {
   int icompute = modify->find_compute(id_temp);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Temperature ID for fix temp/rescale/limit/cuda does not exist");
   temperature = modify->compute[icompute];
-  if(not temperature->cudable) 
-	error->warning(FLERR,"Fix temp/rescale/limit/cuda uses non cudable temperature compute");
+  if(not temperature->cudable)
+        error->warning(FLERR,"Fix temp/rescale/limit/cuda uses non cudable temperature compute");
   if (temperature->tempbias) which = BIAS;
   else which = NOBIAS;
 }
@@ -157,34 +157,34 @@ void FixTempRescaleLimitCuda::end_of_step()
     if (which == NOBIAS) {
       energy += (t_current-t_target) * efactor;
 
-    
-	Cuda_FixTempRescaleLimitCuda_EndOfStep(&cuda->shared_data, groupbit,factor,current_limit);
-	
+
+        Cuda_FixTempRescaleLimitCuda_EndOfStep(&cuda->shared_data, groupbit,factor,current_limit);
+
     } else if (which == BIAS) {
       energy += (t_current-t_target) * efactor;
       if(not temperature->cudable)
       {
-      	cuda->cu_x->download();cuda->cu_v->download();
+              cuda->cu_x->download();cuda->cu_v->download();
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  temperature->remove_bias(i,v[i]);
-	  double vx = v[i][0] * factor;
-	  double vy = v[i][1] * factor;
-	  double vz = v[i][2] * factor;
-	  v[i][0]=vx>0?MIN(vx,current_limit):MAX(vx,-current_limit);
-	  v[i][1]=vy>0?MIN(vy,current_limit):MAX(vy,-current_limit);
-	  v[i][2]=vz>0?MIN(vz,current_limit):MAX(vz,-current_limit);
-	  
-	  temperature->restore_bias(i,v[i]);
-	}
+        if (mask[i] & groupbit) {
+          temperature->remove_bias(i,v[i]);
+          double vx = v[i][0] * factor;
+          double vy = v[i][1] * factor;
+          double vz = v[i][2] * factor;
+          v[i][0]=vx>0?MIN(vx,current_limit):MAX(vx,-current_limit);
+          v[i][1]=vy>0?MIN(vy,current_limit):MAX(vy,-current_limit);
+          v[i][2]=vz>0?MIN(vz,current_limit):MAX(vz,-current_limit);
+
+          temperature->restore_bias(i,v[i]);
+        }
         }
-	  cuda->cu_v->upload();
+          cuda->cu_v->upload();
       }
       else
       {
-   	    temperature->remove_bias_all();
-	    Cuda_FixTempRescaleLimitCuda_EndOfStep(&cuda->shared_data, groupbit,factor,current_limit);
-	    temperature->restore_bias_all();
+               temperature->remove_bias_all();
+            Cuda_FixTempRescaleLimitCuda_EndOfStep(&cuda->shared_data, groupbit,factor,current_limit);
+            temperature->restore_bias_all();
       }
     }
 
@@ -214,8 +214,8 @@ int FixTempRescaleLimitCuda::modify_param(int narg, char **arg)
       error->all(FLERR,"Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
       error->warning(FLERR,"Group for fix_modify temp != fix group");
-    if(not temperature->cudable) 
-	  error->warning(FLERR,"Fix temp/rescale/limit/cuda uses non cudable temperature compute");
+    if(not temperature->cudable)
+          error->warning(FLERR,"Fix temp/rescale/limit/cuda uses non cudable temperature compute");
     return 2;
   }
   return 0;
diff --git a/src/USER-CUDA/fix_temp_rescale_limit_cuda.h b/src/USER-CUDA/fix_temp_rescale_limit_cuda.h
index 7ee49d3c40..de3ccffe32 100644
--- a/src/USER-CUDA/fix_temp_rescale_limit_cuda.h
+++ b/src/USER-CUDA/fix_temp_rescale_limit_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/fix_viscous_cuda.cpp b/src/USER-CUDA/fix_viscous_cuda.cpp
index a85ce1b316..a95b5453c5 100644
--- a/src/USER-CUDA/fix_viscous_cuda.cpp
+++ b/src/USER-CUDA/fix_viscous_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -46,14 +46,14 @@ FixViscousCuda::FixViscousCuda(LAMMPS *lmp, int narg, char **arg) :
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	cu_gamma=NULL;
+        cu_gamma=NULL;
 }
 
 /* ---------------------------------------------------------------------- */
 
 FixViscousCuda::~FixViscousCuda()
 {
-	delete cu_gamma;
+        delete cu_gamma;
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/fix_viscous_cuda.h b/src/USER-CUDA/fix_viscous_cuda.h
index 54e75cc0d2..cfc7813110 100644
--- a/src/USER-CUDA/fix_viscous_cuda.h
+++ b/src/USER-CUDA/fix_viscous_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
diff --git a/src/USER-CUDA/modify_cuda.cpp b/src/USER-CUDA/modify_cuda.cpp
index e1d0c385d8..7ac2687330 100644
--- a/src/USER-CUDA/modify_cuda.cpp
+++ b/src/USER-CUDA/modify_cuda.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -137,7 +137,7 @@ void ModifyCuda::init()
   n_final_integrate_host = n_final_integrate;
   n_end_of_step_host = n_end_of_step;
   n_thermo_energy_host = n_thermo_energy;
-  
+
   n_initial_integrate = n_initial_integrate_cuda+n_initial_integrate_host;
   n_post_integrate = n_post_integrate_cuda+n_post_integrate_host;
   n_pre_exchange = n_pre_exchange_cuda+n_pre_exchange_host;
@@ -147,17 +147,17 @@ void ModifyCuda::init()
   n_final_integrate = n_final_integrate_cuda+n_final_integrate_host;
   n_end_of_step = n_end_of_step_cuda+n_end_of_step_host;
   n_thermo_energy = n_thermo_energy_cuda+n_thermo_energy_host;
-  
+
   list_init(INITIAL_INTEGRATE_RESPA,
-	    n_initial_integrate_respa,list_initial_integrate_respa);
+            n_initial_integrate_respa,list_initial_integrate_respa);
   list_init(POST_INTEGRATE_RESPA,
-	    n_post_integrate_respa,list_post_integrate_respa);
+            n_post_integrate_respa,list_post_integrate_respa);
   list_init(POST_FORCE_RESPA,
-	    n_post_force_respa,list_post_force_respa);
+            n_post_force_respa,list_post_force_respa);
   list_init(PRE_FORCE_RESPA,
-	    n_pre_force_respa,list_pre_force_respa);
+            n_pre_force_respa,list_pre_force_respa);
   list_init(FINAL_INTEGRATE_RESPA,
-	    n_final_integrate_respa,list_final_integrate_respa);
+            n_final_integrate_respa,list_final_integrate_respa);
 
   list_init(MIN_PRE_EXCHANGE,n_min_pre_exchange,list_min_pre_exchange);
   list_init(MIN_POST_FORCE,n_min_post_force,list_min_post_force);
@@ -231,16 +231,16 @@ void ModifyCuda::init()
 
 void ModifyCuda::initial_integrate(int vflag)
 {
-	for(int i = 0; i < n_initial_integrate_cuda; i++)
-		fix[list_initial_integrate_cuda[i]]->initial_integrate(vflag);
-
-	if(n_initial_integrate_host != 0)
-	{
-		cuda->downloadAll(); cuda->oncpu = true;
-		for (int i = 0; i < n_initial_integrate_host; i++)
-			fix[list_initial_integrate[i]]->initial_integrate(vflag);
-		cuda->uploadAll(); cuda->oncpu = false;
-	}
+        for(int i = 0; i < n_initial_integrate_cuda; i++)
+                fix[list_initial_integrate_cuda[i]]->initial_integrate(vflag);
+
+        if(n_initial_integrate_host != 0)
+        {
+                cuda->downloadAll(); cuda->oncpu = true;
+                for (int i = 0; i < n_initial_integrate_host; i++)
+                        fix[list_initial_integrate[i]]->initial_integrate(vflag);
+                cuda->uploadAll(); cuda->oncpu = false;
+        }
 }
 
 /* ----------------------------------------------------------------------
@@ -249,16 +249,16 @@ void ModifyCuda::initial_integrate(int vflag)
 
 void ModifyCuda::post_integrate()
 {
-	for(int i = 0; i < n_post_integrate_cuda; i++)
-		fix[list_post_integrate_cuda[i]]->post_integrate();
-	
-	if(n_post_integrate_host != 0)
-	{
-		cuda->downloadAll(); cuda->oncpu = true;
-		for (int i = 0; i < n_post_integrate_host; i++)
-			fix[list_post_integrate[i]]->post_integrate();
-		cuda->uploadAll(); cuda->oncpu = false;
-	}
+        for(int i = 0; i < n_post_integrate_cuda; i++)
+                fix[list_post_integrate_cuda[i]]->post_integrate();
+
+        if(n_post_integrate_host != 0)
+        {
+                cuda->downloadAll(); cuda->oncpu = true;
+                for (int i = 0; i < n_post_integrate_host; i++)
+                        fix[list_post_integrate[i]]->post_integrate();
+                cuda->uploadAll(); cuda->oncpu = false;
+        }
 }
 
 /* ----------------------------------------------------------------------
@@ -267,16 +267,16 @@ void ModifyCuda::post_integrate()
 
 void ModifyCuda::pre_exchange()
 {
-	for(int i = 0; i < n_pre_exchange_cuda; i++)
-		fix[list_pre_exchange_cuda[i]]->pre_exchange();
-
-	if(n_pre_exchange_host != 0)
-	{
-		cuda->downloadAll(); cuda->oncpu = true;
-		for (int i = 0; i < n_pre_exchange_host; i++)
-			fix[list_pre_exchange[i]]->pre_exchange();
-		cuda->uploadAll(); cuda->oncpu = false;
-	}
+        for(int i = 0; i < n_pre_exchange_cuda; i++)
+                fix[list_pre_exchange_cuda[i]]->pre_exchange();
+
+        if(n_pre_exchange_host != 0)
+        {
+                cuda->downloadAll(); cuda->oncpu = true;
+                for (int i = 0; i < n_pre_exchange_host; i++)
+                        fix[list_pre_exchange[i]]->pre_exchange();
+                cuda->uploadAll(); cuda->oncpu = false;
+        }
 }
 
 /* ----------------------------------------------------------------------
@@ -285,16 +285,16 @@ void ModifyCuda::pre_exchange()
 
 void ModifyCuda::pre_neighbor()
 {
-	for(int i = 0; i < n_pre_neighbor_cuda; i++)
-		fix[list_pre_neighbor_cuda[i]]->pre_neighbor();
-	
-	if(n_pre_neighbor_host != 0)
-	{
-		cuda->downloadAll(); cuda->oncpu = true;
-		for (int i = 0; i < n_pre_neighbor_host; i++)
-			fix[list_pre_neighbor[i]]->pre_neighbor();
-		cuda->uploadAll(); cuda->oncpu = false;
-	}
+        for(int i = 0; i < n_pre_neighbor_cuda; i++)
+                fix[list_pre_neighbor_cuda[i]]->pre_neighbor();
+
+        if(n_pre_neighbor_host != 0)
+        {
+                cuda->downloadAll(); cuda->oncpu = true;
+                for (int i = 0; i < n_pre_neighbor_host; i++)
+                        fix[list_pre_neighbor[i]]->pre_neighbor();
+                cuda->uploadAll(); cuda->oncpu = false;
+        }
 }
 
 /* ----------------------------------------------------------------------
@@ -303,30 +303,30 @@ void ModifyCuda::pre_neighbor()
 
 void ModifyCuda::setup_pre_force(int vflag)
 {
-	for(int i = 0; i < n_pre_force_cuda; i++)
-		fix[list_pre_force_cuda[i]]->pre_force(vflag);
-
-	if(n_pre_force_host != 0)
-	{
-		cuda->downloadAll(); cuda->oncpu = true;
-		for (int i = 0; i < n_pre_force_host; i++)
-			fix[list_pre_force[i]]->pre_force(vflag);
-		cuda->uploadAll(); cuda->oncpu = false;
-	}
+        for(int i = 0; i < n_pre_force_cuda; i++)
+                fix[list_pre_force_cuda[i]]->pre_force(vflag);
+
+        if(n_pre_force_host != 0)
+        {
+                cuda->downloadAll(); cuda->oncpu = true;
+                for (int i = 0; i < n_pre_force_host; i++)
+                        fix[list_pre_force[i]]->pre_force(vflag);
+                cuda->uploadAll(); cuda->oncpu = false;
+        }
 }
 
 void ModifyCuda::pre_force(int vflag)
 {
-	for(int i = 0; i < n_pre_force_cuda; i++)
-		fix[list_pre_force_cuda[i]]->pre_force(vflag);
-
-	if(n_pre_force_host != 0)
-	{
-		cuda->downloadAll(); cuda->oncpu = true;
-		for (int i = 0; i < n_pre_force_host; i++)
-			fix[list_pre_force[i]]->pre_force(vflag);
-		cuda->uploadAll(); cuda->oncpu = false;
-	}
+        for(int i = 0; i < n_pre_force_cuda; i++)
+                fix[list_pre_force_cuda[i]]->pre_force(vflag);
+
+        if(n_pre_force_host != 0)
+        {
+                cuda->downloadAll(); cuda->oncpu = true;
+                for (int i = 0; i < n_pre_force_host; i++)
+                        fix[list_pre_force[i]]->pre_force(vflag);
+                cuda->uploadAll(); cuda->oncpu = false;
+        }
 }
 
 /* ----------------------------------------------------------------------
@@ -335,16 +335,16 @@ void ModifyCuda::pre_force(int vflag)
 
 void ModifyCuda::post_force(int vflag)
 {
-	for(int i = 0; i < n_post_force_cuda; i++)
-			fix[list_post_force_cuda[i]]->post_force(vflag);
-
-	if(n_post_force_host != 0)
-	{
-		cuda->downloadAll(); cuda->oncpu = true;
-		for (int i = 0; i < n_post_force_host; i++)
-			fix[list_post_force[i]]->post_force(vflag);
-		cuda->uploadAll(); cuda->oncpu = false;
-	}
+        for(int i = 0; i < n_post_force_cuda; i++)
+                        fix[list_post_force_cuda[i]]->post_force(vflag);
+
+        if(n_post_force_host != 0)
+        {
+                cuda->downloadAll(); cuda->oncpu = true;
+                for (int i = 0; i < n_post_force_host; i++)
+                        fix[list_post_force[i]]->post_force(vflag);
+                cuda->uploadAll(); cuda->oncpu = false;
+        }
 }
 
 /* ----------------------------------------------------------------------
@@ -353,16 +353,16 @@ void ModifyCuda::post_force(int vflag)
 
 void ModifyCuda::final_integrate()
 {
-	for (int i = 0; i < n_final_integrate_cuda; i++)
-		fix[list_final_integrate_cuda[i]]->final_integrate();
-	
-	if(n_final_integrate_host != 0)
-	{
-		cuda->downloadAll(); cuda->oncpu = true;
-		for (int i = 0; i < n_final_integrate_host; i++)
-			fix[list_final_integrate[i]]->final_integrate();
-		cuda->uploadAll(); cuda->oncpu = false;
-	}
+        for (int i = 0; i < n_final_integrate_cuda; i++)
+                fix[list_final_integrate_cuda[i]]->final_integrate();
+
+        if(n_final_integrate_host != 0)
+        {
+                cuda->downloadAll(); cuda->oncpu = true;
+                for (int i = 0; i < n_final_integrate_host; i++)
+                        fix[list_final_integrate[i]]->final_integrate();
+                cuda->uploadAll(); cuda->oncpu = false;
+        }
 }
 
 /* ----------------------------------------------------------------------
@@ -372,24 +372,24 @@ void ModifyCuda::final_integrate()
 
 void ModifyCuda::end_of_step()
 {
-	for (int i = 0; i < n_end_of_step_cuda; i++)
-		if (update->ntimestep % end_of_step_every_cuda[i] == 0)
-			fix[list_end_of_step_cuda[i]]->end_of_step();
-	
-	if(n_end_of_step_host != 0)
-	{
-		int do_thisstep=0;
-		for (int i = 0; i < n_end_of_step_host; i++)
-			if (update->ntimestep % end_of_step_every[i] == 0) do_thisstep=1;
-		if(do_thisstep)
-		{
-		  cuda->downloadAll(); cuda->oncpu = true;
-		  for (int i = 0; i < n_end_of_step_host; i++)
-			 if (update->ntimestep % end_of_step_every[i] == 0)
-				fix[list_end_of_step[i]]->end_of_step();
-		  cuda->uploadAll(); cuda->oncpu = false;
-		}
-	}
+        for (int i = 0; i < n_end_of_step_cuda; i++)
+                if (update->ntimestep % end_of_step_every_cuda[i] == 0)
+                        fix[list_end_of_step_cuda[i]]->end_of_step();
+
+        if(n_end_of_step_host != 0)
+        {
+                int do_thisstep=0;
+                for (int i = 0; i < n_end_of_step_host; i++)
+                        if (update->ntimestep % end_of_step_every[i] == 0) do_thisstep=1;
+                if(do_thisstep)
+                {
+                  cuda->downloadAll(); cuda->oncpu = true;
+                  for (int i = 0; i < n_end_of_step_host; i++)
+                         if (update->ntimestep % end_of_step_every[i] == 0)
+                                fix[list_end_of_step[i]]->end_of_step();
+                  cuda->uploadAll(); cuda->oncpu = false;
+                }
+        }
 }
 
 /* ----------------------------------------------------------------------
@@ -400,20 +400,20 @@ void ModifyCuda::end_of_step()
 
 double ModifyCuda::thermo_energy()
 {
-	double energy = 0.0;
-	
-	for (int i = 0; i < n_thermo_energy_cuda; i++)
-		energy += fix[list_thermo_energy_cuda[i]]->compute_scalar();
-	
-	if(n_thermo_energy_host != 0)
-	{
-		cuda->downloadAll(); cuda->oncpu = true;
-		for (int i = 0; i < n_thermo_energy_host; i++)
-			energy += fix[list_thermo_energy[i]]->compute_scalar();
-		cuda->uploadAll(); cuda->oncpu = false;
-	}
-	
-	return energy;
+        double energy = 0.0;
+
+        for (int i = 0; i < n_thermo_energy_cuda; i++)
+                energy += fix[list_thermo_energy_cuda[i]]->compute_scalar();
+
+        if(n_thermo_energy_host != 0)
+        {
+                cuda->downloadAll(); cuda->oncpu = true;
+                for (int i = 0; i < n_thermo_energy_host; i++)
+                        energy += fix[list_thermo_energy[i]]->compute_scalar();
+                cuda->uploadAll(); cuda->oncpu = false;
+        }
+
+        return energy;
 }
 
 
diff --git a/src/USER-CUDA/modify_cuda.h b/src/USER-CUDA/modify_cuda.h
index 12c0ca25ec..bfea217046 100644
--- a/src/USER-CUDA/modify_cuda.h
+++ b/src/USER-CUDA/modify_cuda.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CUDA/neigh_full_cuda.cpp b/src/USER-CUDA/neigh_full_cuda.cpp
index 14fe153ec9..ba70497ef1 100644
--- a/src/USER-CUDA/neigh_full_cuda.cpp
+++ b/src/USER-CUDA/neigh_full_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -43,21 +43,21 @@ void NeighborCuda::full_bin_cuda(NeighList *list)
   if(includegroup) error->warning(FLERR,"Warning using inlcudegroup neighborbuild. This is not yet supported by CUDA neighborbuild styles.\n");
   int nlocal = atom->nlocal;
   int nall = nlocal + atom->nghost;
- 
+
   if(nlocal==0) return;
   CudaNeighList* clist=list->cuda_list;
   cuda_shared_neighlist* slist=&clist->sneighlist;
-  
+
   if(not clist) cuda->registerNeighborList(list);
-  
+
   clist->build_cuda=true;
-  
+
   if(slist->bin_extraspace<0.09)
   {
     for(int i=1;i<=atom->ntypes;i++)
     for(int j=1;j<=atom->ntypes;j++)
     {
-    	if(slist->maxcut<cutneighsq[i][j]) slist->maxcut=cutneighsq[i][j];
+            if(slist->maxcut<cutneighsq[i][j]) slist->maxcut=cutneighsq[i][j];
     }
     slist->maxcut=sqrt(slist->maxcut);
   }
@@ -79,19 +79,19 @@ void NeighborCuda::full_bin_cuda(NeighList *list)
       bin_dim_tmp[0]+=4;
       bin_dim_tmp[1]+=4;
       bin_dim_tmp[2]+=4;
- 	  if(bin_nmax_tmp<32) slist->maxcut*=1.2;
- 	 // printf("slist->maxcut: %lf\n", slist->maxcut);
+           if(bin_nmax_tmp<32) slist->maxcut*=1.2;
+          // printf("slist->maxcut: %lf\n", slist->maxcut);
     } while(bin_nmax_tmp<32);
     if((slist->bin_dim[0]!=bin_dim_tmp[0])||(slist->bin_dim[1]!=bin_dim_tmp[1])||(slist->bin_dim[2]!=bin_dim_tmp[2])||(slist->bin_nmax!=bin_nmax_tmp))
     {
-    	if(slist->binned_id!=NULL) 
-    	CudaWrapper_FreeCudaData(slist->binned_id,slist->bin_dim[0]*slist->bin_dim[1]*slist->bin_dim[2]*slist->bin_nmax*sizeof(int));
-    	slist->bin_dim[0] = bin_dim_tmp[0];
-    	slist->bin_dim[1] = bin_dim_tmp[1];
-    	slist->bin_dim[2] = bin_dim_tmp[2];
-    	slist->bin_nmax = bin_nmax_tmp;
-    	slist->binned_id=(int*) CudaWrapper_AllocCudaData(slist->bin_dim[0]*slist->bin_dim[1]*slist->bin_dim[2]*slist->bin_nmax*sizeof(int));
- 	  //printf("slist->bin: %i %i %i %i \n", bin_dim_tmp[0],bin_dim_tmp[1],bin_dim_tmp[2],bin_nmax_tmp);
+            if(slist->binned_id!=NULL)
+            CudaWrapper_FreeCudaData(slist->binned_id,slist->bin_dim[0]*slist->bin_dim[1]*slist->bin_dim[2]*slist->bin_nmax*sizeof(int));
+            slist->bin_dim[0] = bin_dim_tmp[0];
+            slist->bin_dim[1] = bin_dim_tmp[1];
+            slist->bin_dim[2] = bin_dim_tmp[2];
+            slist->bin_nmax = bin_nmax_tmp;
+            slist->binned_id=(int*) CudaWrapper_AllocCudaData(slist->bin_dim[0]*slist->bin_dim[1]*slist->bin_dim[2]*slist->bin_nmax*sizeof(int));
+           //printf("slist->bin: %i %i %i %i \n", bin_dim_tmp[0],bin_dim_tmp[1],bin_dim_tmp[2],bin_nmax_tmp);
     }
     //if(list->cuda_list->sneighlist.bin_nmax>512) error->all(FLERR,"To many atoms per bin. Likely cause is very long pair cutoff. This needs major rewrite of code and is not yet scheduled to be done.\n");
   }while(Cuda_BinAtoms(&cuda->shared_data, &list->cuda_list->sneighlist));
@@ -105,43 +105,43 @@ void NeighborCuda::full_bin_cuda(NeighList *list)
   (nex_group!=slist->nex_group)||
   (nex_mol!=slist->nex_mol))
   {
-  	slist->nex_type=nex_type;
-  	slist->nex_group=nex_group;
-  	slist->nex_mol=nex_mol;
-  	//printf("%i %i %i\n",nex_type,nex_group,nex_mol);
-  	if(nex_type)
-  	{
-  	delete clist->cu_ex_type;
-  	clist->cu_ex_type=new cCudaData<int , int , x> (&ex_type[0][0]   , & slist->ex_type     , (atom->ntypes+1)*(atom->ntypes+1) );
-  	clist->cu_ex_type->upload();
-  	}
- 	//printf("AA %i %i %i\n",nex_type,nex_group,nex_mol);
-  	if(nex_group)
-  	{
-   	delete clist->cu_ex1_bit;
-  	clist->cu_ex1_bit=new cCudaData<int , int , x> (ex1_bit   , & slist->ex1_bit     , nex_group );
-  	clist->cu_ex1_bit->upload();
-  	//printf("A %i %i %i\n",nex_type,nex_group,nex_mol);
-  	delete clist->cu_ex2_bit;
-  	clist->cu_ex2_bit=new cCudaData<int , int , x> (ex2_bit   , & slist->ex2_bit     , nex_group );
-  	clist->cu_ex2_bit->upload();
-  	}
-  	//printf("B %i %i %i\n",nex_type,nex_group,nex_mol);
-  	if(nex_mol)
-  	{
-  	delete clist->cu_ex_mol_bit;
-  	clist->cu_ex_mol_bit=new cCudaData<int , int , x> (ex_mol_bit   , & slist->ex_mol_bit     , nex_mol );
-  	clist->cu_ex_mol_bit->upload();
-  	}
-  	//printf("C %i %i %i\n",nex_type,nex_group,nex_mol);
+          slist->nex_type=nex_type;
+          slist->nex_group=nex_group;
+          slist->nex_mol=nex_mol;
+          //printf("%i %i %i\n",nex_type,nex_group,nex_mol);
+          if(nex_type)
+          {
+          delete clist->cu_ex_type;
+          clist->cu_ex_type=new cCudaData<int , int , x> (&ex_type[0][0]   , & slist->ex_type     , (atom->ntypes+1)*(atom->ntypes+1) );
+          clist->cu_ex_type->upload();
+          }
+         //printf("AA %i %i %i\n",nex_type,nex_group,nex_mol);
+          if(nex_group)
+          {
+           delete clist->cu_ex1_bit;
+          clist->cu_ex1_bit=new cCudaData<int , int , x> (ex1_bit   , & slist->ex1_bit     , nex_group );
+          clist->cu_ex1_bit->upload();
+          //printf("A %i %i %i\n",nex_type,nex_group,nex_mol);
+          delete clist->cu_ex2_bit;
+          clist->cu_ex2_bit=new cCudaData<int , int , x> (ex2_bit   , & slist->ex2_bit     , nex_group );
+          clist->cu_ex2_bit->upload();
+          }
+          //printf("B %i %i %i\n",nex_type,nex_group,nex_mol);
+          if(nex_mol)
+          {
+          delete clist->cu_ex_mol_bit;
+          clist->cu_ex_mol_bit=new cCudaData<int , int , x> (ex_mol_bit   , & slist->ex_mol_bit     , nex_mol );
+          clist->cu_ex_mol_bit->upload();
+          }
+          //printf("C %i %i %i\n",nex_type,nex_group,nex_mol);
   }
   int overflow = 0;
   int inum = 0;
   int npnt = 0;
   do
   {
-  	npnt=0;
-  	inum=0;
+          npnt=0;
+          inum=0;
     overflow=0;
     clist->grow_device();
     slist->cutneighsq=cutneighsq;
@@ -150,59 +150,59 @@ void NeighborCuda::full_bin_cuda(NeighList *list)
     //list->cuda_list->grow_device();
     if(cuda->shared_data.overlap_comm)
     {
-	  list->cuda_list->inum_border=0;
-	  list->cuda_list->cu_inum_border->upload();
+          list->cuda_list->inum_border=0;
+          list->cuda_list->cu_inum_border->upload();
     }
-    
+
     cuda->shared_data.atom.nall=nall;
     //Cuda_NeighborReBuildFirstneigh(&cuda->shared_data, &list->cuda_list->sneighlist);
     overflow= Cuda_NeighborBuildFullBin(&cuda->shared_data, &list->cuda_list->sneighlist);
-	
-	/*cuda->cu_debugdata->download();
-	printf("Debugdata: %i ",cuda->debugdata[0]);
-	for(int i=0;i<cuda->debugdata[0];i+=3) printf("// %i %i %i",cuda->debugdata[i+1],cuda->debugdata[i+2],cuda->debugdata[i+3]);
-	printf("\n");*/
-	//printf("maxneighborsA: %i %i %i %i\n",maxneighbors,pgsize,oneatom,atom->nmax);
-	
-    if(overflow<0) 
+
+        /*cuda->cu_debugdata->download();
+        printf("Debugdata: %i ",cuda->debugdata[0]);
+        for(int i=0;i<cuda->debugdata[0];i+=3) printf("// %i %i %i",cuda->debugdata[i+1],cuda->debugdata[i+2],cuda->debugdata[i+3]);
+        printf("\n");*/
+        //printf("maxneighborsA: %i %i %i %i\n",maxneighbors,pgsize,oneatom,atom->nmax);
+
+    if(overflow<0)
     {
-    	maxneighbors+=32; 
-    	if(-overflow>maxneighbors) maxneighbors=((-overflow+37)/32)*32;
-    	delete list->cuda_list->cu_neighbors;
-    	delete [] list->cuda_list->neighbors;
-    	list->cuda_list->neighbors= new int[slist->maxlocal*maxneighbors];
-    	list->cuda_list->sneighlist.maxneighbors=maxneighbors;
-	//printf("maxneighborsA1: %i %i %i %i %i\n",maxneighbors,pgsize,oneatom,atom->nmax,slist->maxlocal);
-    	list->cuda_list->cu_neighbors= new cCudaData<int, int, x> (list->cuda_list->neighbors	 		 , & list->cuda_list->sneighlist.neighbors, slist->maxlocal*maxneighbors );
-	//printf("maxneighborsA2: %i %i %i %i\n",maxneighbors,pgsize,oneatom,atom->nmax);
-    	
-    	if(cuda->shared_data.overlap_comm)
-    	{
-    	  list->cuda_list->sneighlist.maxneighbors=maxneighbors;
-    	  list->cuda_list->dev_free();
-    	  list->cuda_list->dev_alloc();
-    	}
-	//printf("maxneighborsA3: %i %i %i %i\n",maxneighbors,pgsize,oneatom,atom->nmax);
+            maxneighbors+=32;
+            if(-overflow>maxneighbors) maxneighbors=((-overflow+37)/32)*32;
+            delete list->cuda_list->cu_neighbors;
+            delete [] list->cuda_list->neighbors;
+            list->cuda_list->neighbors= new int[slist->maxlocal*maxneighbors];
+            list->cuda_list->sneighlist.maxneighbors=maxneighbors;
+        //printf("maxneighborsA1: %i %i %i %i %i\n",maxneighbors,pgsize,oneatom,atom->nmax,slist->maxlocal);
+            list->cuda_list->cu_neighbors= new cCudaData<int, int, x> (list->cuda_list->neighbors                          , & list->cuda_list->sneighlist.neighbors, slist->maxlocal*maxneighbors );
+        //printf("maxneighborsA2: %i %i %i %i\n",maxneighbors,pgsize,oneatom,atom->nmax);
+
+            if(cuda->shared_data.overlap_comm)
+            {
+              list->cuda_list->sneighlist.maxneighbors=maxneighbors;
+              list->cuda_list->dev_free();
+              list->cuda_list->dev_alloc();
+            }
+        //printf("maxneighborsA3: %i %i %i %i\n",maxneighbors,pgsize,oneatom,atom->nmax);
     }
-	//printf("maxneighborsB: %i %i %i %i\n",maxneighbors,pgsize,oneatom,atom->nmax);
+        //printf("maxneighborsB: %i %i %i %i\n",maxneighbors,pgsize,oneatom,atom->nmax);
     if(cuda->shared_data.overlap_comm)
     {
-  		list->cuda_list->cu_inum_border->download();
-  		list->cuda_list->sneighlist.inum_border2=list->cuda_list->inum_border;
+                  list->cuda_list->cu_inum_border->download();
+                  list->cuda_list->sneighlist.inum_border2=list->cuda_list->inum_border;
     }
   }
   while(overflow<0);
-  
+
   //cuda->cu_debugdata->download();
  // printf("Differences in: %i\n",cuda->debugdata[0]);
  // for(int i=0;i<20;i++) printf("%i %i %i %i// ",cuda->debugdata[4*i+1],cuda->debugdata[4*i+2],cuda->debugdata[4*i+3],cuda->debugdata[4*i+4]);
 //  printf("\n");
 /*for(int i=0;i<10;i++)
 {
-	printf("%i %i // ",i,numneigh[i]);
-	for(int j=0;j<numneigh[i];j++)
-	 printf("%i ",list->cuda_list->neighbors[i+j*nlocal]);
-	printf("\n");
+        printf("%i %i // ",i,numneigh[i]);
+        for(int j=0;j<numneigh[i];j++)
+         printf("%i ",list->cuda_list->neighbors[i+j*nlocal]);
+        printf("\n");
 }*/
 /*  int count=0;
   if(cuda->shared_data.overlap_comm)
@@ -214,7 +214,7 @@ void NeighborCuda::full_bin_cuda(NeighList *list)
   list->cuda_list->cu_neighbors->download();
   list->cuda_list->cu_neighbors_inner->download();
   list->cuda_list->cu_neighbors_border->download();
-  
+
   //list->cuda_list->cu_firstneigh->download();
  // list->cuda_list->nl_download();
   list->cuda_list->cu_numneigh->download();
@@ -222,53 +222,53 @@ void NeighborCuda::full_bin_cuda(NeighList *list)
   //for(int i=0;i<nlocal;i++)*/
  /* int i=123;
   {
-  	int k=-1;
-  	//printf("inum_border: %i\n",list->cuda_list->inum_border);
-  	//for(int j=0;j<list->numneigh[i];j++) printf("%i ",list->firstneigh[i][j]);printf("\n");
-  	for(int j=0;j<list->cuda_list->inum_border;j++)
-  	if(list->cuda_list->ilist_border[j]==i) k=j;
-  	int d=numneigh[i]-list->cuda_list->numneigh_inner[i];
-  	if(k>-1) d-=list->cuda_list->numneigh_border[k];
-  	if(d!=0) {printf("Error at %i %i %i %i %i\n",i,k,d,numneigh[i],list->cuda_list->numneigh_inner[i]); diff++;}
-  	if(k>-1 && count<10) 
-  	{
-  		printf("Numneighs: %i %i %i  Border_i: %i %i\n",numneigh[i],list->cuda_list->numneigh_inner[i],list->cuda_list->numneigh_border[k],k,(int)list->cuda_list->cu_ilist_border->dev_data());
-	cuda->shared_data.me=k;
-	for(int j=0;j<numneigh[i];j++)
-	 printf("%i ",list->cuda_list->neighbors[i+j*nlocal]);
-  	 printf("\n");
-	for(int j=0;j<list->cuda_list->numneigh_inner[i];j++)
-	 printf("%i ",list->cuda_list->neighbors_inner[i+j*nlocal]);
-	 printf(" // ");
-	for(int j=0;j<list->cuda_list->numneigh_border[k];j++)
-	 printf("%i ",list->cuda_list->neighbors_border[k+j*nlocal]);
-  	 printf("\n");
-  	 count++;
-  	}
+          int k=-1;
+          //printf("inum_border: %i\n",list->cuda_list->inum_border);
+          //for(int j=0;j<list->numneigh[i];j++) printf("%i ",list->firstneigh[i][j]);printf("\n");
+          for(int j=0;j<list->cuda_list->inum_border;j++)
+          if(list->cuda_list->ilist_border[j]==i) k=j;
+          int d=numneigh[i]-list->cuda_list->numneigh_inner[i];
+          if(k>-1) d-=list->cuda_list->numneigh_border[k];
+          if(d!=0) {printf("Error at %i %i %i %i %i\n",i,k,d,numneigh[i],list->cuda_list->numneigh_inner[i]); diff++;}
+          if(k>-1 && count<10)
+          {
+                  printf("Numneighs: %i %i %i  Border_i: %i %i\n",numneigh[i],list->cuda_list->numneigh_inner[i],list->cuda_list->numneigh_border[k],k,(int)list->cuda_list->cu_ilist_border->dev_data());
+        cuda->shared_data.me=k;
+        for(int j=0;j<numneigh[i];j++)
+         printf("%i ",list->cuda_list->neighbors[i+j*nlocal]);
+           printf("\n");
+        for(int j=0;j<list->cuda_list->numneigh_inner[i];j++)
+         printf("%i ",list->cuda_list->neighbors_inner[i+j*nlocal]);
+         printf(" // ");
+        for(int j=0;j<list->cuda_list->numneigh_border[k];j++)
+         printf("%i ",list->cuda_list->neighbors_border[k+j*nlocal]);
+           printf("\n");
+           count++;
+          }
   }
   printf("%i\n",diff);
   }*/
   list->cuda_list->cu_numneigh->download();
   list->cuda_list->cu_ilist->download();
   cuda->shared_data.atom.update_neigh=2;
-	//printf("Done\n");
-  
+        //printf("Done\n");
+
   MYDBG(printf(" # CUDA::NeighFullBinCuda ... end\n");)
-  
+
 }
 
 
 void NeighborCuda::full_nsq_cuda(NeighList *list)
 {
-	printf("Full_Nsq cuda neighbor list build is not implemented anymore.\n");
+        printf("Full_Nsq cuda neighbor list build is not implemented anymore.\n");
 return;
 /*
   MYDBG(printf(" # CUDA::NeighFullNSQCuda ... start\n");)
   int nlocal = atom->nlocal;
   int nall = nlocal + atom->nghost;
- 
+
   if(cuda->cu_xhold) cuda->cu_xhold->upload();
-  
+
 
   if(not list->cuda_list) cuda->registerNeighborList(list);
   list->cuda_list->build_cuda=true;
@@ -285,27 +285,27 @@ return;
   int npnt = 0;
   do
   {
-  	npage=0;
-  	npnt=0;
-  	inum=0;
+          npage=0;
+          npnt=0;
+          inum=0;
     overflow=0;
-  	neigh_lists_per_page=pgsize/maxneighbors;
+          neigh_lists_per_page=pgsize/maxneighbors;
     npage=(2*nlocal*maxneighbors-1)/pgsize;
     while(npage>list->maxpage) list->add_pages();
     pages = list->pages;
     npage=0;
-  	list->cuda_list->sneighlist.neigh_lists_per_page=pgsize/maxneighbors;
+          list->cuda_list->sneighlist.neigh_lists_per_page=pgsize/maxneighbors;
     list->cuda_list->grow_device();
     list->cuda_list->sneighlist.cutneighsq=cutneighsq;
     list->cuda_list->sneighlist.maxneighbors=maxneighbors;
     list->cuda_list->sneighlist.inum = list->inum = nlocal;
-    
+
     cuda->shared_data.atom.nall=nall;
     Cuda_NeighborReBuildFirstneigh(&cuda->shared_data, &list->cuda_list->sneighlist);
     overflow= not Cuda_NeighborBuildFullNsq(&cuda->shared_data, &list->cuda_list->sneighlist);
-	
-	
-	    
+
+
+
      if(overflow) maxneighbors+=32;
   }
   while(overflow);
@@ -313,4 +313,3 @@ return;
   MYDBG(printf(" # CUDA::NeighFullNSQCuda ... end\n");)
   */
 }
-
diff --git a/src/USER-CUDA/neighbor_cuda.cpp b/src/USER-CUDA/neighbor_cuda.cpp
index dc5af9f2f8..23953ebc15 100644
--- a/src/USER-CUDA/neighbor_cuda.cpp
+++ b/src/USER-CUDA/neighbor_cuda.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -58,7 +58,7 @@ void NeighborCuda::init()
 void NeighborCuda::choose_build(int index, NeighRequest *rq)
 {
   Neighbor::choose_build(index,rq);
-  
+
   if (rq->full && style == NSQ && rq->cudable)
     pair_build[index] = (Neighbor::PairPtr) &NeighborCuda::full_nsq_cuda;
   else if (rq->full && style == BIN && rq->cudable)
@@ -88,12 +88,12 @@ int NeighborCuda::check_distance()
       domain->box_corners();
       delta1 = delta2 = 0.0;
       for (int i = 0; i < 8; i++) {
-	delx = corners[i][0] - corners_hold[i][0];
-	dely = corners[i][1] - corners_hold[i][1];
-	delz = corners[i][2] - corners_hold[i][2];
-	delta = sqrt(delx*delx + dely*dely + delz*delz);
-	if (delta > delta1) delta1 = delta;
-	else if (delta > delta2) delta2 = delta;
+        delx = corners[i][0] - corners_hold[i][0];
+        dely = corners[i][1] - corners_hold[i][1];
+        delz = corners[i][2] - corners_hold[i][2];
+        delta = sqrt(delx*delx + dely*dely + delz*delz);
+        if (delta > delta1) delta1 = delta;
+        else if (delta > delta2) delta2 = delta;
       }
       delta = 0.5 * (skin - (delta1+delta2));
       deltasq = delta*delta;
@@ -117,7 +117,7 @@ int NeighborCuda::check_distance()
     }
   }
   else flag = cuda->shared_data.atom.reneigh_flag;
-  
+
   int flagall;
   MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_MAX,world);
   if (flagall && ago == MAX(every,delay)) ndanger++;
@@ -140,43 +140,43 @@ void NeighborCuda::build()
       cuda->update_xhold(maxhold, &xhold[0][0]);
     else {
       if (cuda->finished_setup) cuda->cu_x_download();
-      
+
       double **x = atom->x;
       int nlocal = atom->nlocal;
       if (includegroup) nlocal = atom->nfirst;
       if (nlocal > maxhold) {
-	maxhold = atom->nmax;
-	memory->destroy(xhold);
-	memory->create(xhold,maxhold,3,"neigh:xhold");
+        maxhold = atom->nmax;
+        memory->destroy(xhold);
+        memory->create(xhold,maxhold,3,"neigh:xhold");
       }
       for (i = 0; i < nlocal; i++) {
-	xhold[i][0] = x[i][0];
-	xhold[i][1] = x[i][1];
-	xhold[i][2] = x[i][2];
+        xhold[i][0] = x[i][0];
+        xhold[i][1] = x[i][1];
+        xhold[i][2] = x[i][2];
       }
       if (boxcheck) {
-	if (triclinic == 0) {
-	  boxlo_hold[0] = bboxlo[0];
-	  boxlo_hold[1] = bboxlo[1];
-	  boxlo_hold[2] = bboxlo[2];
-	  boxhi_hold[0] = bboxhi[0];
-	  boxhi_hold[1] = bboxhi[1];
-	  boxhi_hold[2] = bboxhi[2];
-	} else {
-	  domain->box_corners();
-	  corners = domain->corners;
-	  for (i = 0; i < 8; i++) {
-	    corners_hold[i][0] = corners[i][0];
-	    corners_hold[i][1] = corners[i][1];
-	    corners_hold[i][2] = corners[i][2];
-	  }
-	}
+        if (triclinic == 0) {
+          boxlo_hold[0] = bboxlo[0];
+          boxlo_hold[1] = bboxlo[1];
+          boxlo_hold[2] = bboxlo[2];
+          boxhi_hold[0] = bboxhi[0];
+          boxhi_hold[1] = bboxhi[1];
+          boxhi_hold[2] = bboxhi[2];
+        } else {
+          domain->box_corners();
+          corners = domain->corners;
+          for (i = 0; i < 8; i++) {
+            corners_hold[i][0] = corners[i][0];
+            corners_hold[i][1] = corners[i][1];
+            corners_hold[i][2] = corners[i][2];
+          }
+        }
       }
     }
   }
-  
+
   if (not cudable && cuda->finished_setup && atom->avec->cudable)
-    cuda->downloadAll(); 
+    cuda->downloadAll();
   if (cudable && (not cuda->finished_setup)) {
     cuda->checkResize();
     cuda->uploadAll();
@@ -194,7 +194,7 @@ void NeighborCuda::build()
     maxatom = atom->nmax;
     for (i = 0; i < nglist; i++) lists[glist[i]]->grow(maxatom);
   }
-  
+
   // extend atom bin list if necessary
 
   if (style != NSQ && atom->nmax > maxbin) {
diff --git a/src/USER-CUDA/neighbor_cuda.h b/src/USER-CUDA/neighbor_cuda.h
index c171b23be3..847c5bcb1e 100644
--- a/src/USER-CUDA/neighbor_cuda.h
+++ b/src/USER-CUDA/neighbor_cuda.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CUDA/pair_born_coul_long_cuda.cpp b/src/USER-CUDA/pair_born_coul_long_cuda.cpp
index 0918be7ce8..c5e65da3e2 100644
--- a/src/USER-CUDA/pair_born_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_born_coul_long_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -61,10 +61,10 @@ PairBornCoulLongCuda::PairBornCoulLongCuda(LAMMPS *lmp) : PairBornCoulLong(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->shared_data.pair.use_block_per_atom = 0;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->shared_data.pair.use_block_per_atom = 0;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -73,59 +73,59 @@ PairBornCoulLongCuda::PairBornCoulLongCuda(LAMMPS *lmp) : PairBornCoulLong(lmp)
 
 void PairBornCoulLongCuda::allocate()
 {
-	if(! allocated) PairBornCoulLong::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.coeff1  = rhoinv;
-		cuda->shared_data.pair.coeff2  = sigma;
-		cuda->shared_data.pair.coeff3  = a;
-		cuda->shared_data.pair.coeff4  = c;
-		cuda->shared_data.pair.coeff5  = d;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairBornCoulLong::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.coeff1  = rhoinv;
+                cuda->shared_data.pair.coeff2  = sigma;
+                cuda->shared_data.pair.coeff3  = a;
+                cuda->shared_data.pair.coeff4  = c;
+                cuda->shared_data.pair.coeff5  = d;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBornCoulLongCuda::compute(int eflag, int vflag)
 {
-	MYDBG( printf("PairBornCoulLongCuda compute start\n"); fflush(stdout);)
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
-	#ifdef CUDA_USE_BINNING
-	Cuda_PairBornCoulLongCuda(& cuda->shared_data, eflag, vflag);
-	#else
-	Cuda_PairBornCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
-	#endif
+        MYDBG( printf("PairBornCoulLongCuda compute start\n"); fflush(stdout);)
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
+        #ifdef CUDA_USE_BINNING
+        Cuda_PairBornCoulLongCuda(& cuda->shared_data, eflag, vflag);
+        #else
+        Cuda_PairBornCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        #endif
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	MYDBG( printf("PairBornCoulLongCuda compute end\n"); fflush(stdout);)
+        MYDBG( printf("PairBornCoulLongCuda compute end\n"); fflush(stdout);)
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBornCoulLongCuda::settings(int narg, char **arg)
 {
-	PairBornCoulLong::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        PairBornCoulLong::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBornCoulLongCuda::coeff(int narg, char **arg)
 {
-	PairBornCoulLong::coeff(narg, arg);
-	allocate();
+        PairBornCoulLong::coeff(narg, arg);
+        allocate();
 }
 
 void PairBornCoulLongCuda::init_style()
@@ -135,14 +135,14 @@ void PairBornCoulLongCuda::init_style()
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (strstr(update->integrate_style,"respa")) error->all(FLERR,"Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
-  	
-  	irequest = neighbor->request(this);
+
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
- 
+
 
   cut_coulsq = cut_coul * cut_coul;
   cuda->shared_data.pair.cut_coulsq_global=cut_coulsq;
@@ -152,32 +152,32 @@ void PairBornCoulLongCuda::init_style()
   g_ewald = force->kspace->g_ewald;
   cuda->shared_data.pair.g_ewald=g_ewald;
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
-  
+
 
   if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairBornCoulLongCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairBornCoulLongCuda::init_list\n");)
-	PairBornCoulLong::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairBornCoulLongCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairBornCoulLongCuda::init_list\n");)
+        PairBornCoulLong::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairBornCoulLongCuda::init_list end\n");)
 }
 
 void PairBornCoulLongCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairBornCoulLong::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairBornCoulLong::ev_setup(eflag,vflag);
+
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
 }
diff --git a/src/USER-CUDA/pair_born_coul_long_cuda.h b/src/USER-CUDA/pair_born_coul_long_cuda.h
index 91f6f650ae..497c2d533e 100644
--- a/src/USER-CUDA/pair_born_coul_long_cuda.h
+++ b/src/USER-CUDA/pair_born_coul_long_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairBornCoulLongCuda : public PairBornCoulLong
 {
-	public:
-		PairBornCoulLongCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairBornCoulLongCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp b/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp
index cc927fa5b0..00698ed81d 100644
--- a/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -54,10 +54,10 @@ PairBuckCoulCutCuda::PairBuckCoulCutCuda(LAMMPS *lmp) : PairBuckCoulCut(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->shared_data.pair.use_block_per_atom = 0;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->shared_data.pair.use_block_per_atom = 0;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -66,59 +66,59 @@ PairBuckCoulCutCuda::PairBuckCoulCutCuda(LAMMPS *lmp) : PairBuckCoulCut(lmp)
 
 void PairBuckCoulCutCuda::allocate()
 {
-	if(! allocated) PairBuckCoulCut::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut_coul     = cut_coul;
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.coeff1  = rhoinv;
-		cuda->shared_data.pair.coeff2  = buck1;
-		cuda->shared_data.pair.coeff3  = buck2;
-		cuda->shared_data.pair.coeff4  = a;
-		cuda->shared_data.pair.coeff5  = c;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairBuckCoulCut::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut_coul     = cut_coul;
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.coeff1  = rhoinv;
+                cuda->shared_data.pair.coeff2  = buck1;
+                cuda->shared_data.pair.coeff3  = buck2;
+                cuda->shared_data.pair.coeff4  = a;
+                cuda->shared_data.pair.coeff5  = c;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBuckCoulCutCuda::compute(int eflag, int vflag)
 {
-	MYDBG( printf("PairBuckCoulCutCuda compute start\n"); fflush(stdout);)
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
-	
-	Cuda_PairBuckCoulCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
-  
+        MYDBG( printf("PairBuckCoulCutCuda compute start\n"); fflush(stdout);)
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
+
+        Cuda_PairBuckCoulCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	MYDBG( printf("PairBuckCoulCutCuda compute end\n"); fflush(stdout);)
+        MYDBG( printf("PairBuckCoulCutCuda compute end\n"); fflush(stdout);)
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBuckCoulCutCuda::settings(int narg, char **arg)
 {
-	PairBuckCoulCut::settings(narg, arg);
-	cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        PairBuckCoulCut::settings(narg, arg);
+        cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBuckCoulCutCuda::coeff(int narg, char **arg)
 {
-	PairBuckCoulCut::coeff(narg, arg);
-	allocate();
+        PairBuckCoulCut::coeff(narg, arg);
+        allocate();
 }
 
 void PairBuckCoulCutCuda::init_style()
@@ -128,17 +128,17 @@ void PairBuckCoulCutCuda::init_style()
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (strstr(update->integrate_style,"respa")) error->all(FLERR,"Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
-  	
-  	irequest = neighbor->request(this);
+
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
- 
+
 
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
-  
+
    cuda->shared_data.pair.cut_coulsq_global=cut_coul_global * cut_coul_global;
 
   if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
@@ -146,25 +146,25 @@ void PairBuckCoulCutCuda::init_style()
 
 void PairBuckCoulCutCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairBuckCoulCutCuda::init_list\n");)
-	PairBuckCoulCut::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairBuckCoulCutCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairBuckCoulCutCuda::init_list\n");)
+        PairBuckCoulCut::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairBuckCoulCutCuda::init_list end\n");)
 }
 
 void PairBuckCoulCutCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairBuckCoulCut::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairBuckCoulCut::ev_setup(eflag,vflag);
+
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
 }
diff --git a/src/USER-CUDA/pair_buck_coul_cut_cuda.h b/src/USER-CUDA/pair_buck_coul_cut_cuda.h
index b46a18364a..c766eede1c 100644
--- a/src/USER-CUDA/pair_buck_coul_cut_cuda.h
+++ b/src/USER-CUDA/pair_buck_coul_cut_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairBuckCoulCutCuda : public PairBuckCoulCut
 {
-	public:
-		PairBuckCoulCutCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairBuckCoulCutCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_buck_coul_long_cuda.cpp b/src/USER-CUDA/pair_buck_coul_long_cuda.cpp
index 01cc624377..07948e5ee3 100644
--- a/src/USER-CUDA/pair_buck_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_buck_coul_long_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -61,10 +61,10 @@ PairBuckCoulLongCuda::PairBuckCoulLongCuda(LAMMPS *lmp) : PairBuckCoulLong(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->shared_data.pair.use_block_per_atom = 0;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->shared_data.pair.use_block_per_atom = 0;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -73,57 +73,57 @@ PairBuckCoulLongCuda::PairBuckCoulLongCuda(LAMMPS *lmp) : PairBuckCoulLong(lmp)
 
 void PairBuckCoulLongCuda::allocate()
 {
-	if(! allocated) PairBuckCoulLong::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.coeff1  = rhoinv;
-		cuda->shared_data.pair.coeff2  = buck1;
-		cuda->shared_data.pair.coeff3  = buck2;
-		cuda->shared_data.pair.coeff4  = a;
-		cuda->shared_data.pair.coeff5  = c;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairBuckCoulLong::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.coeff1  = rhoinv;
+                cuda->shared_data.pair.coeff2  = buck1;
+                cuda->shared_data.pair.coeff3  = buck2;
+                cuda->shared_data.pair.coeff4  = a;
+                cuda->shared_data.pair.coeff5  = c;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBuckCoulLongCuda::compute(int eflag, int vflag)
 {
-	MYDBG( printf("PairBuckCoulLongCuda compute start\n"); fflush(stdout);)
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        MYDBG( printf("PairBuckCoulLongCuda compute start\n"); fflush(stdout);)
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairBuckCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairBuckCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	MYDBG( printf("PairBuckCoulLongCuda compute end\n"); fflush(stdout);)
+        MYDBG( printf("PairBuckCoulLongCuda compute end\n"); fflush(stdout);)
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBuckCoulLongCuda::settings(int narg, char **arg)
 {
-	PairBuckCoulLong::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        PairBuckCoulLong::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBuckCoulLongCuda::coeff(int narg, char **arg)
 {
-	PairBuckCoulLong::coeff(narg, arg);
-	allocate();
+        PairBuckCoulLong::coeff(narg, arg);
+        allocate();
 }
 
 void PairBuckCoulLongCuda::init_style()
@@ -133,14 +133,14 @@ void PairBuckCoulLongCuda::init_style()
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (strstr(update->integrate_style,"respa")) error->all(FLERR,"Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
-  	
-  	irequest = neighbor->request(this);
+
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
- 
+
 
   cut_coulsq = cut_coul * cut_coul;
   cuda->shared_data.pair.cut_coulsq_global=cut_coulsq;
@@ -150,32 +150,32 @@ void PairBuckCoulLongCuda::init_style()
   g_ewald = force->kspace->g_ewald;
   cuda->shared_data.pair.g_ewald=g_ewald;
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
-  
+
 
   if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairBuckCoulLongCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairBuckCoulLongCuda::init_list\n");)
-	PairBuckCoulLong::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairBuckCoulLongCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairBuckCoulLongCuda::init_list\n");)
+        PairBuckCoulLong::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairBuckCoulLongCuda::init_list end\n");)
 }
 
 void PairBuckCoulLongCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairBuckCoulLong::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairBuckCoulLong::ev_setup(eflag,vflag);
+
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
 }
diff --git a/src/USER-CUDA/pair_buck_coul_long_cuda.h b/src/USER-CUDA/pair_buck_coul_long_cuda.h
index 39a3791031..e9ef8b3e48 100644
--- a/src/USER-CUDA/pair_buck_coul_long_cuda.h
+++ b/src/USER-CUDA/pair_buck_coul_long_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairBuckCoulLongCuda : public PairBuckCoulLong
 {
-	public:
-		PairBuckCoulLongCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairBuckCoulLongCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_buck_cuda.cpp b/src/USER-CUDA/pair_buck_cuda.cpp
index 40dd8bd13b..6443f92d2f 100644
--- a/src/USER-CUDA/pair_buck_cuda.cpp
+++ b/src/USER-CUDA/pair_buck_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -54,10 +54,10 @@ PairBuckCuda::PairBuckCuda(LAMMPS *lmp) : PairBuck(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->shared_data.pair.use_block_per_atom = 0;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->shared_data.pair.use_block_per_atom = 0;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -66,56 +66,56 @@ PairBuckCuda::PairBuckCuda(LAMMPS *lmp) : PairBuck(lmp)
 
 void PairBuckCuda::allocate()
 {
-	if(! allocated) PairBuck::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut;
-		cuda->shared_data.pair.coeff1  = rhoinv;
-		cuda->shared_data.pair.coeff2  = buck1;
-		cuda->shared_data.pair.coeff3  = buck2;
-		cuda->shared_data.pair.coeff4  = a;
-		cuda->shared_data.pair.coeff5  = c;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-	}
+        if(! allocated) PairBuck::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut;
+                cuda->shared_data.pair.coeff1  = rhoinv;
+                cuda->shared_data.pair.coeff2  = buck1;
+                cuda->shared_data.pair.coeff3  = buck2;
+                cuda->shared_data.pair.coeff4  = a;
+                cuda->shared_data.pair.coeff5  = c;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBuckCuda::compute(int eflag, int vflag)
 {
-	MYDBG( printf("PairBuckCuda compute start\n"); fflush(stdout);)
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        MYDBG( printf("PairBuckCuda compute start\n"); fflush(stdout);)
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairBuckCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairBuckCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	MYDBG( printf("PairBuckCuda compute end\n"); fflush(stdout);)
+        MYDBG( printf("PairBuckCuda compute end\n"); fflush(stdout);)
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBuckCuda::settings(int narg, char **arg)
 {
-	PairBuck::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
+        PairBuck::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairBuckCuda::coeff(int narg, char **arg)
 {
-	PairBuck::coeff(narg, arg);
-	allocate();
+        PairBuck::coeff(narg, arg);
+        allocate();
 }
 
 void PairBuckCuda::init_style()
@@ -125,42 +125,42 @@ void PairBuckCuda::init_style()
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (strstr(update->integrate_style,"respa")) error->all(FLERR,"Integrate Style Respa is not supported by pair style buck/coul/long/cuda");
-  	
-  	irequest = neighbor->request(this);
+
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
- 
+
 
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
-  
+
 
   if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairBuckCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairBuckCuda::init_list\n");)
-	PairBuck::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairBuckCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairBuckCuda::init_list\n");)
+        PairBuck::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairBuckCuda::init_list end\n");)
 }
 
 void PairBuckCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairBuck::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairBuck::ev_setup(eflag,vflag);
+
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
 }
diff --git a/src/USER-CUDA/pair_buck_cuda.h b/src/USER-CUDA/pair_buck_cuda.h
index 9ec29e1662..9ecb07d5b1 100644
--- a/src/USER-CUDA/pair_buck_cuda.h
+++ b/src/USER-CUDA/pair_buck_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairBuckCuda : public PairBuck
 {
-	public:
-		PairBuckCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairBuckCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp
index 5334e91f97..e6d7954e3f 100644
--- a/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,10 +69,10 @@ PairCGCMMCoulCutCuda::PairCGCMMCoulCutCuda(LAMMPS *lmp) : PairCGCMMCoulCut(lmp)
   if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cg_type_double = NULL;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cg_type_double = NULL;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -81,27 +81,27 @@ PairCGCMMCoulCutCuda::PairCGCMMCoulCutCuda(LAMMPS *lmp) : PairCGCMMCoulCut(lmp)
 
 void PairCGCMMCoulCutCuda::allocate()
 {
-	if(! allocated) PairCGCMMCoulCut::allocate();
-	int n = atom->ntypes;
-	if(! allocated2)
-	{
-		allocated2 = true;
-		
-  
-  		memory->create(cg_type_double,n+1,n+1,"paircg:cgtypedouble");
-  		
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.cut_coul= cut_coul;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = cg_type_double;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
-  	for (int i = 1; i <= n; i++) {
+        if(! allocated) PairCGCMMCoulCut::allocate();
+        int n = atom->ntypes;
+        if(! allocated2)
+        {
+                allocated2 = true;
+
+
+                  memory->create(cg_type_double,n+1,n+1,"paircg:cgtypedouble");
+
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.cut_coul= cut_coul;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = cg_type_double;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
+          for (int i = 1; i <= n; i++) {
       for (int j = i; j <= n; j++) {
         cg_type_double[i][j] = cg_type[i][j];
         cg_type_double[j][i] = cg_type[i][j];
@@ -113,53 +113,53 @@ void PairCGCMMCoulCutCuda::allocate()
 
 void PairCGCMMCoulCutCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairCGCMMCoulCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairCGCMMCoulCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairCGCMMCoulCutCuda::settings(int narg, char **arg)
 {
-	PairCGCMMCoulCut::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
-	cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
-	cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
+        PairCGCMMCoulCut::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
+        cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairCGCMMCoulCutCuda::coeff(int narg, char **arg)
 {
-	PairCGCMMCoulCut::coeff(narg, arg);
-	allocate();
+        PairCGCMMCoulCut::coeff(narg, arg);
+        allocate();
 }
 
 void PairCGCMMCoulCutCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairCGCMMCoulCutCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairCGCMMCoulCutCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -175,27 +175,25 @@ void PairCGCMMCoulCutCuda::init_style()
 
 void PairCGCMMCoulCutCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairCGCMMCoulCutCuda::init_list\n");)
-	PairCGCMMCoulCut::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairCGCMMCoulCutCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairCGCMMCoulCutCuda::init_list\n");)
+        PairCGCMMCoulCut::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairCGCMMCoulCutCuda::init_list end\n");)
 }
 
 void PairCGCMMCoulCutCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairCGCMMCoulCut::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairCGCMMCoulCut::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.h b/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.h
index 467b8a3feb..9ae9ce5821 100644
--- a/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.h
+++ b/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,20 +36,20 @@ namespace LAMMPS_NS {
 
 class PairCGCMMCoulCutCuda : public PairCGCMMCoulCut
 {
-	public:
-		PairCGCMMCoulCutCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		double** cg_type_double;
+        public:
+                PairCGCMMCoulCutCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                double** cg_type_double;
 };
 
 }
diff --git a/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp
index 862d8e56b3..3c3818ac7c 100644
--- a/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp
+++ b/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,10 +69,10 @@ PairCGCMMCoulDebyeCuda::PairCGCMMCoulDebyeCuda(LAMMPS *lmp) : PairCGCMMCoulCut(l
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cg_type_double = NULL;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cg_type_double = NULL;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -81,27 +81,27 @@ PairCGCMMCoulDebyeCuda::PairCGCMMCoulDebyeCuda(LAMMPS *lmp) : PairCGCMMCoulCut(l
 
 void PairCGCMMCoulDebyeCuda::allocate()
 {
-	if(! allocated) PairCGCMMCoulCut::allocate();
-	int n = atom->ntypes;
-	if(! allocated2)
-	{
-		allocated2 = true;
-		
-  
-  		memory->create(cg_type_double,n+1,n+1,"paircg:cgtypedouble");
-  		
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.cut_coul= cut_coul;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = cg_type_double;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
-  	for (int i = 1; i <= n; i++) {
+        if(! allocated) PairCGCMMCoulCut::allocate();
+        int n = atom->ntypes;
+        if(! allocated2)
+        {
+                allocated2 = true;
+
+
+                  memory->create(cg_type_double,n+1,n+1,"paircg:cgtypedouble");
+
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.cut_coul= cut_coul;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = cg_type_double;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
+          for (int i = 1; i <= n; i++) {
       for (int j = i; j <= n; j++) {
         cg_type_double[i][j] = cg_type[i][j];
         cg_type_double[j][i] = cg_type[i][j];
@@ -113,53 +113,53 @@ void PairCGCMMCoulDebyeCuda::allocate()
 
 void PairCGCMMCoulDebyeCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairCGCMMCoulDebyeCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairCGCMMCoulDebyeCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairCGCMMCoulDebyeCuda::settings(int narg, char **arg)
 {
-	PairCGCMMCoulCut::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
-	cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
-	cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
+        PairCGCMMCoulCut::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
+        cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairCGCMMCoulDebyeCuda::coeff(int narg, char **arg)
 {
-	PairCGCMMCoulCut::coeff(narg, arg);
-	allocate();
+        PairCGCMMCoulCut::coeff(narg, arg);
+        allocate();
 }
 
 void PairCGCMMCoulDebyeCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairCGCMMCoulDebyeCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairCGCMMCoulDebyeCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -175,27 +175,25 @@ void PairCGCMMCoulDebyeCuda::init_style()
 
 void PairCGCMMCoulDebyeCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairCGCMMCoulDebyeCuda::init_list\n");)
-	PairCGCMMCoulCut::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairCGCMMCoulDebyeCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairCGCMMCoulDebyeCuda::init_list\n");)
+        PairCGCMMCoulCut::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairCGCMMCoulDebyeCuda::init_list end\n");)
 }
 
 void PairCGCMMCoulDebyeCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairCGCMMCoulCut::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairCGCMMCoulCut::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.h b/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.h
index a392125161..98758e8d86 100644
--- a/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.h
+++ b/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,20 +36,20 @@ namespace LAMMPS_NS {
 
 class PairCGCMMCoulDebyeCuda : public PairCGCMMCoulCut
 {
-	public:
-		PairCGCMMCoulDebyeCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		double** cg_type_double;
+        public:
+                PairCGCMMCoulDebyeCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                double** cg_type_double;
 };
 
 }
diff --git a/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp
index c2d4ede4b4..3d276ad7e9 100644
--- a/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -70,10 +70,10 @@ PairCGCMMCoulLongCuda::PairCGCMMCoulLongCuda(LAMMPS *lmp) : PairCGCMMCoulLong(lm
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cg_type_double = NULL;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cg_type_double = NULL;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -82,27 +82,27 @@ PairCGCMMCoulLongCuda::PairCGCMMCoulLongCuda(LAMMPS *lmp) : PairCGCMMCoulLong(lm
 
 void PairCGCMMCoulLongCuda::allocate()
 {
-	if(! allocated) PairCGCMMCoulLong::allocate();
-	int n = atom->ntypes;
-	if(! allocated2)
-	{
-		allocated2 = true;
-		
-  
-  		memory->create(cg_type_double,n+1,n+1,"paircg:cgtypedouble");
-  		
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.cut_coul= cut_coul;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = cg_type_double;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
-  	for (int i = 1; i <= n; i++) {
+        if(! allocated) PairCGCMMCoulLong::allocate();
+        int n = atom->ntypes;
+        if(! allocated2)
+        {
+                allocated2 = true;
+
+
+                  memory->create(cg_type_double,n+1,n+1,"paircg:cgtypedouble");
+
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.cut_coul= cut_coul;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = cg_type_double;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
+          for (int i = 1; i <= n; i++) {
       for (int j = i; j <= n; j++) {
         cg_type_double[i][j] = cg_type[i][j];
         cg_type_double[j][i] = cg_type[i][j];
@@ -114,53 +114,53 @@ void PairCGCMMCoulLongCuda::allocate()
 
 void PairCGCMMCoulLongCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairCGCMMCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairCGCMMCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairCGCMMCoulLongCuda::settings(int narg, char **arg)
 {
-	PairCGCMMCoulLong::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
-	cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
-	cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
+        PairCGCMMCoulLong::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
+        cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairCGCMMCoulLongCuda::coeff(int narg, char **arg)
 {
-	PairCGCMMCoulLong::coeff(narg, arg);
-	allocate();
+        PairCGCMMCoulLong::coeff(narg, arg);
+        allocate();
 }
 
 void PairCGCMMCoulLongCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairCGCMMCoulLongCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairCGCMMCoulLongCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -177,27 +177,25 @@ void PairCGCMMCoulLongCuda::init_style()
 
 void PairCGCMMCoulLongCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairCGCMMCoulLongCuda::init_list\n");)
-	PairCGCMMCoulLong::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairCGCMMCoulLongCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairCGCMMCoulLongCuda::init_list\n");)
+        PairCGCMMCoulLong::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairCGCMMCoulLongCuda::init_list end\n");)
 }
 
 void PairCGCMMCoulLongCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairCGCMMCoulLong::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairCGCMMCoulLong::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.h b/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.h
index cad37fc8ca..d3021f8ab8 100644
--- a/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.h
+++ b/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,20 +36,20 @@ namespace LAMMPS_NS {
 
 class PairCGCMMCoulLongCuda : public PairCGCMMCoulLong
 {
-	public:
-		PairCGCMMCoulLongCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		double** cg_type_double;
+        public:
+                PairCGCMMCoulLongCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                double** cg_type_double;
 };
 
 }
diff --git a/src/USER-CUDA/pair_cg_cmm_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_cuda.cpp
index cc3e5e585b..4d89651cd9 100644
--- a/src/USER-CUDA/pair_cg_cmm_cuda.cpp
+++ b/src/USER-CUDA/pair_cg_cmm_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,10 +69,10 @@ PairCGCMMCuda::PairCGCMMCuda(LAMMPS *lmp) : PairCGCMM(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cg_type_double = NULL;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cg_type_double = NULL;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -81,30 +81,30 @@ PairCGCMMCuda::PairCGCMMCuda(LAMMPS *lmp) : PairCGCMM(lmp)
 
 void PairCGCMMCuda::allocate()
 {
-	if(! allocated) PairCGCMM::allocate();
-	int n = atom->ntypes;
-	if(! allocated2)
-	{
-		allocated2 = true;
-		
-  
-  		memory->create(cg_type_double,n+1,n+1,"paircg:cgtypedouble");
-  		
-		cuda->shared_data.pair.cut     = cut;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = cg_type_double;
-	    /*cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_cg_type_double_gm = new cCudaData<double, F_FLOAT, x> ((double*)cg_type_double, &cuda->shared_data.pair.coeff5_gm, (atom->ntypes+1)*(atom->ntypes+1));*/
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-	}
-  	for (int i = 1; i <= n; i++) {
+        if(! allocated) PairCGCMM::allocate();
+        int n = atom->ntypes;
+        if(! allocated2)
+        {
+                allocated2 = true;
+
+
+                  memory->create(cg_type_double,n+1,n+1,"paircg:cgtypedouble");
+
+                cuda->shared_data.pair.cut     = cut;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = cg_type_double;
+            /*cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_cg_type_double_gm = new cCudaData<double, F_FLOAT, x> ((double*)cg_type_double, &cuda->shared_data.pair.coeff5_gm, (atom->ntypes+1)*(atom->ntypes+1));*/
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+        }
+          for (int i = 1; i <= n; i++) {
       for (int j = i; j <= n; j++) {
         cg_type_double[i][j] = cg_type[i][j];
         cg_type_double[j][i] = cg_type[i][j];
@@ -116,49 +116,49 @@ void PairCGCMMCuda::allocate()
 
 void PairCGCMMCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairCGCMMCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairCGCMMCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairCGCMMCuda::settings(int narg, char **arg)
 {
-	PairCGCMM::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        PairCGCMM::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairCGCMMCuda::coeff(int narg, char **arg)
 {
-	PairCGCMM::coeff(narg, arg);
-	allocate();
+        PairCGCMM::coeff(narg, arg);
+        allocate();
 }
 
 void PairCGCMMCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairCGCMMCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairCGCMMCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -172,27 +172,25 @@ void PairCGCMMCuda::init_style()
 
 void PairCGCMMCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairCGCMMCuda::init_list\n");)
-	PairCGCMM::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairCGCMMCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairCGCMMCuda::init_list\n");)
+        PairCGCMM::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairCGCMMCuda::init_list end\n");)
 }
 
 void PairCGCMMCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairCGCMM::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairCGCMM::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_cg_cmm_cuda.h b/src/USER-CUDA/pair_cg_cmm_cuda.h
index 74236b889f..32e204270f 100644
--- a/src/USER-CUDA/pair_cg_cmm_cuda.h
+++ b/src/USER-CUDA/pair_cg_cmm_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -37,25 +37,25 @@ namespace LAMMPS_NS {
 
 class PairCGCMMCuda : public PairCGCMM
 {
-	public:
-		PairCGCMMCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		double** cg_type_double;
-		cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_cg_type_double_gm;
+        public:
+                PairCGCMMCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                double** cg_type_double;
+                cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_cg_type_double_gm;
 };
 
 }
diff --git a/src/USER-CUDA/pair_eam_alloy_cuda.cpp b/src/USER-CUDA/pair_eam_alloy_cuda.cpp
index fd78c57133..72cbb77d37 100644
--- a/src/USER-CUDA/pair_eam_alloy_cuda.cpp
+++ b/src/USER-CUDA/pair_eam_alloy_cuda.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -100,9 +100,9 @@ void PairEAMAlloyCuda::coeff(int narg, char **arg)
   for (i = 1; i <= n; i++) {
     for (j = i; j <= n; j++) {
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
-	count++;
+        setflag[i][j] = 1;
+        if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
+        count++;
       }
     }
   }
@@ -151,7 +151,7 @@ void PairEAMAlloyCuda::read_file(char *filename)
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
     error->all(FLERR,"Incorrect element names in EAM potential file");
-  
+
   char **words = new char*[file->nelements+1];
   nwords = 0;
   char *first = strtok(line," \t\n\r\f");
@@ -168,7 +168,7 @@ void PairEAMAlloyCuda::read_file(char *filename)
   if (me == 0) {
     fgets(line,MAXLINE,fptr);
     sscanf(line,"%d %lg %d %lg %lg",
-	   &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
+           &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
   }
 
   MPI_Bcast(&file->nrho,1,MPI_INT,0,world);
@@ -181,7 +181,7 @@ void PairEAMAlloyCuda::read_file(char *filename)
   memory->create(file->frho,file->nelements,file->nrho+1,"pair:frho");
   memory->create(file->rhor,file->nelements,file->nr+1,"pair:rhor");
   memory->create(file->z2r,file->nelements,file->nelements,file->nr+1,
-		 "pair:z2r");
+                 "pair:z2r");
   int i,j,tmp;
   for (i = 0; i < file->nelements; i++) {
     if (me == 0) {
@@ -229,7 +229,7 @@ void PairEAMAlloyCuda::file2array()
 
   // allocate frho arrays
   // nfrho = # of setfl elements + 1 for zero array
-  
+
   nfrho = setfl->nelements + 1;
   memory->destroy(frho);
   memory->create(frho,nfrho,nrho+1,"pair:frho");
@@ -310,12 +310,12 @@ void PairEAMAlloyCuda::file2array()
       irow = map[i];
       icol = map[j];
       if (irow == -1 || icol == -1) {
-	type2z2r[i][j] = 0;
-	continue;
+        type2z2r[i][j] = 0;
+        continue;
       }
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
diff --git a/src/USER-CUDA/pair_eam_alloy_cuda.h b/src/USER-CUDA/pair_eam_alloy_cuda.h
index d17d9f5c79..27ddcb1600 100644
--- a/src/USER-CUDA/pair_eam_alloy_cuda.h
+++ b/src/USER-CUDA/pair_eam_alloy_cuda.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CUDA/pair_eam_cuda.cpp b/src/USER-CUDA/pair_eam_cuda.cpp
index ee9a701b25..1e65aaf719 100644
--- a/src/USER-CUDA/pair_eam_cuda.cpp
+++ b/src/USER-CUDA/pair_eam_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -70,13 +70,13 @@ PairEAMCuda::PairEAMCuda(LAMMPS *lmp) : PairEAM(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->shared_data.pair.override_block_per_atom = 0;
-	
-	cuda->setSystemParams();
-	cu_rho=NULL;
-	cu_fp=NULL;
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->shared_data.pair.override_block_per_atom = 0;
+
+        cuda->setSystemParams();
+        cu_rho=NULL;
+        cu_fp=NULL;
     cu_frho_spline = NULL;
     cu_z2r_spline = NULL;
     cu_rhor_spline = NULL;
@@ -88,16 +88,16 @@ PairEAMCuda::PairEAMCuda(LAMMPS *lmp) : PairEAM(lmp)
 
 void PairEAMCuda::allocate()
 {
-	if(! allocated) PairEAM::allocate();
-		cuda->shared_data.pair.cutsq     = cutsq;
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cutforcesq;
+        if(! allocated) PairEAM::allocate();
+                cuda->shared_data.pair.cutsq     = cutsq;
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cutforcesq;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairEAMCuda::compute(int eflag, int vflag)
 {
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cutforcesq;
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cutforcesq;
     cuda->shared_data.pair.use_block_per_atom = 0;
     cuda->shared_data.pair.collect_forces_later = 0;
     if (atom->nmax > nmax) {
@@ -106,84 +106,84 @@ void PairEAMCuda::compute(int eflag, int vflag)
     nmax = atom->nmax;
     memory->create(rho,nmax,"pair:rho");
     memory->create(fp,nmax,"pair:fp");
-	delete cu_rho;
-	delete cu_fp;
-	cu_rho = new cCudaData<double, F_FLOAT, x> (rho, atom->nmax);
-	cu_fp  = new cCudaData<double, F_FLOAT, x> (fp, atom->nmax);
-	Cuda_PairEAMCuda_Init(&cuda->shared_data,rdr,rdrho,nfrho,nrhor,nr,nrho,nz2r,
-		cu_frho_spline->dev_data(),cu_rhor_spline->dev_data(),cu_z2r_spline->dev_data(),
-		cu_rho->dev_data(),cu_fp->dev_data(),type2frho,type2z2r,type2rhor);
-  	}
-
-	
-
-	if(eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
-    
-	Cuda_PairEAM1Cuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag,eflag_atom,vflag_atom);
+        delete cu_rho;
+        delete cu_fp;
+        cu_rho = new cCudaData<double, F_FLOAT, x> (rho, atom->nmax);
+        cu_fp  = new cCudaData<double, F_FLOAT, x> (fp, atom->nmax);
+        Cuda_PairEAMCuda_Init(&cuda->shared_data,rdr,rdrho,nfrho,nrhor,nr,nrho,nz2r,
+                cu_frho_spline->dev_data(),cu_rhor_spline->dev_data(),cu_z2r_spline->dev_data(),
+                cu_rho->dev_data(),cu_fp->dev_data(),type2frho,type2z2r,type2rhor);
+          }
+
+
+
+        if(eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
+
+        Cuda_PairEAM1Cuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag,eflag_atom,vflag_atom);
     comm->forward_comm_pair(this);
-	Cuda_PairEAM2Cuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag,eflag_atom,vflag_atom);
-    
-	if(eflag) cuda->cu_eng_vdwl->download();
-	if(vflag) cuda->cu_virial->download();
+        Cuda_PairEAM2Cuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag,eflag_atom,vflag_atom);
+
+        if(eflag) cuda->cu_eng_vdwl->download();
+        if(vflag) cuda->cu_virial->download();
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairEAMCuda::settings(int narg, char **arg)
 {
-	PairEAM::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cutforcesq;
+        PairEAM::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cutforcesq;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairEAMCuda::coeff(int narg, char **arg)
 {
-	PairEAM::coeff(narg, arg);
-	allocate();
+        PairEAM::coeff(narg, arg);
+        allocate();
 }
 
 void PairEAMCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairEAMCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairEAMCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
   file2array();
   array2spline();
   int irequest;
- 
- 
-  	irequest = neighbor->request(this);
+
+
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
 
-	delete cu_rhor_spline;
-	delete cu_z2r_spline;
-	delete cu_frho_spline;
-	
-	cu_rhor_spline = new cCudaData<double, F_FLOAT, xyz>((double*)rhor_spline,nrhor,nr+1,EAM_COEFF_LENGTH);
-	cu_z2r_spline = new cCudaData<double, F_FLOAT, xyz>((double*)z2r_spline,nz2r,nr+1,EAM_COEFF_LENGTH);
-	cu_frho_spline = new cCudaData<double, F_FLOAT, xyz>((double*)frho_spline,nfrho,nrho+1,EAM_COEFF_LENGTH);
-
-	cu_rhor_spline->upload();
-	cu_z2r_spline->upload();
-	cu_frho_spline->upload();
-	
+        delete cu_rhor_spline;
+        delete cu_z2r_spline;
+        delete cu_frho_spline;
+
+        cu_rhor_spline = new cCudaData<double, F_FLOAT, xyz>((double*)rhor_spline,nrhor,nr+1,EAM_COEFF_LENGTH);
+        cu_z2r_spline = new cCudaData<double, F_FLOAT, xyz>((double*)z2r_spline,nz2r,nr+1,EAM_COEFF_LENGTH);
+        cu_frho_spline = new cCudaData<double, F_FLOAT, xyz>((double*)frho_spline,nfrho,nrho+1,EAM_COEFF_LENGTH);
+
+        cu_rhor_spline->upload();
+        cu_z2r_spline->upload();
+        cu_frho_spline->upload();
+
   MYDBG(printf("# CUDA PairEAMCuda::init_style end\n"); )
 }
 
 void PairEAMCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairEAMCuda::init_list\n");)
-	PairEAM::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairEAMCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairEAMCuda::init_list\n");)
+        PairEAM::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairEAMCuda::init_list end\n");)
 }
 
 void PairEAMCuda::array2spline()
@@ -204,7 +204,7 @@ void PairEAMCuda::array2spline()
     for(int j=0;j<nrho+1;j++)
       frho_spline[i][j][7]=frho_spline[i][j][3];
   }
-  
+
   for (int i = 0; i < nrhor; i++){
     interpolate(nr,dr,rhor[i],rhor_spline[i]);
     for(int j=0;j<nr+1;j++)
@@ -222,7 +222,7 @@ void PairEAMCuda::array2spline()
 
 int PairEAMCuda::pack_comm(int n, int *iswap, double *buf, int pbc_flag, int *pbc)
 {
-  Cuda_PairEAMCuda_PackComm(&cuda->shared_data,n,*iswap,buf); 
+  Cuda_PairEAMCuda_PackComm(&cuda->shared_data,n,*iswap,buf);
   if(sizeof(F_FLOAT)<sizeof(double)) return 1;
   else return 1;
 }
@@ -231,7 +231,7 @@ int PairEAMCuda::pack_comm(int n, int *iswap, double *buf, int pbc_flag, int *pb
 
 void PairEAMCuda::unpack_comm(int n, int first, double *buf)
 {
-  Cuda_PairEAMCuda_UnpackComm(&cuda->shared_data,n,first,buf,cu_fp->dev_data()); 
+  Cuda_PairEAMCuda_UnpackComm(&cuda->shared_data,n,first,buf,cu_fp->dev_data());
 }
 
 void PairEAMCuda::ev_setup(int eflag, int vflag)
@@ -239,10 +239,10 @@ void PairEAMCuda::ev_setup(int eflag, int vflag)
   int maxeatomold=maxeatom;
   PairEAM::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
 }
diff --git a/src/USER-CUDA/pair_eam_cuda.h b/src/USER-CUDA/pair_eam_cuda.h
index 2f1f251fac..9d4a30ca0d 100644
--- a/src/USER-CUDA/pair_eam_cuda.h
+++ b/src/USER-CUDA/pair_eam_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -49,27 +49,27 @@ namespace LAMMPS_NS {
 
 class PairEAMCuda : public PairEAM
 {
-	public:
-		PairEAMCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void array2spline();
-		int pack_comm(int n, int *iswap, double *buf, int pbc_flag, int *pbc);
-		void unpack_comm(int n, int first, double *buf);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		virtual void ev_setup(int eflag, int vflag);
-		class CudaNeighList* cuda_neigh_list;
-		cCudaData<double, F_FLOAT, x>* cu_rho;
-		cCudaData<double, F_FLOAT, x>* cu_fp;
-	    cCudaData<double, F_FLOAT, xyz>* cu_rhor_spline;
-	    cCudaData<double, F_FLOAT, xyz>* cu_z2r_spline;
-	    cCudaData<double, F_FLOAT, xyz>* cu_frho_spline;
+        public:
+                PairEAMCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void array2spline();
+                int pack_comm(int n, int *iswap, double *buf, int pbc_flag, int *pbc);
+                void unpack_comm(int n, int first, double *buf);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                virtual void ev_setup(int eflag, int vflag);
+                class CudaNeighList* cuda_neigh_list;
+                cCudaData<double, F_FLOAT, x>* cu_rho;
+                cCudaData<double, F_FLOAT, x>* cu_fp;
+            cCudaData<double, F_FLOAT, xyz>* cu_rhor_spline;
+            cCudaData<double, F_FLOAT, xyz>* cu_z2r_spline;
+            cCudaData<double, F_FLOAT, xyz>* cu_frho_spline;
 
 };
 
diff --git a/src/USER-CUDA/pair_eam_fs_cuda.cpp b/src/USER-CUDA/pair_eam_fs_cuda.cpp
index 13efb5a4fe..1d6d6d5f3b 100644
--- a/src/USER-CUDA/pair_eam_fs_cuda.cpp
+++ b/src/USER-CUDA/pair_eam_fs_cuda.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -100,9 +100,9 @@ void PairEAMFSCuda::coeff(int narg, char **arg)
   for (i = 1; i <= n; i++) {
     for (j = i; j <= n; j++) {
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	if (i == j) atom->set_mass(i,fs->mass[map[i]]);
-	count++;
+        setflag[i][j] = 1;
+        if (i == j) atom->set_mass(i,fs->mass[map[i]]);
+        count++;
       }
     }
   }
@@ -151,7 +151,7 @@ void PairEAMFSCuda::read_file(char *filename)
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
     error->all(FLERR,"Incorrect element names in EAM potential file");
-  
+
   char **words = new char*[file->nelements+1];
   nwords = 0;
   char *first = strtok(line," \t\n\r\f");
@@ -168,7 +168,7 @@ void PairEAMFSCuda::read_file(char *filename)
   if (me == 0) {
     fgets(line,MAXLINE,fptr);
     sscanf(line,"%d %lg %d %lg %lg",
-	   &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
+           &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
   }
 
   MPI_Bcast(&file->nrho,1,MPI_INT,0,world);
@@ -179,11 +179,11 @@ void PairEAMFSCuda::read_file(char *filename)
 
   file->mass = new double[file->nelements];
   memory->create(file->frho,file->nelements,file->nrho+1,
-					      "pair:frho");
+                                              "pair:frho");
   memory->create(file->rhor,file->nelements,file->nelements,
-		 file->nr+1,"pair:rhor");
+                 file->nr+1,"pair:rhor");
   memory->create(file->z2r,file->nelements,file->nelements,
-		 file->nr+1,"pair:z2r");
+                 file->nr+1,"pair:z2r");
   int i,j,tmp;
   for (i = 0; i < file->nelements; i++) {
     if (me == 0) {
@@ -234,7 +234,7 @@ void PairEAMFSCuda::file2array()
 
   // allocate frho arrays
   // nfrho = # of fs elements + 1 for zero array
-  
+
   nfrho = fs->nelements + 1;
   memory->destroy(frho);
   memory->create(frho,nfrho,nrho+1,"pair:frho");
@@ -319,12 +319,12 @@ void PairEAMFSCuda::file2array()
       irow = map[i];
       icol = map[j];
       if (irow == -1 || icol == -1) {
-	type2z2r[i][j] = 0;
-	continue;
+        type2z2r[i][j] = 0;
+        continue;
       }
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
diff --git a/src/USER-CUDA/pair_eam_fs_cuda.h b/src/USER-CUDA/pair_eam_fs_cuda.h
index c2d4a5504d..a68501a0af 100644
--- a/src/USER-CUDA/pair_eam_fs_cuda.h
+++ b/src/USER-CUDA/pair_eam_fs_cuda.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-CUDA/pair_gran_hooke_cuda.cpp b/src/USER-CUDA/pair_gran_hooke_cuda.cpp
index 74a3dbca8d..223d31ad76 100644
--- a/src/USER-CUDA/pair_gran_hooke_cuda.cpp
+++ b/src/USER-CUDA/pair_gran_hooke_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -71,9 +71,9 @@ PairGranHookeCuda::PairGranHookeCuda(LAMMPS *lmp) : PairGranHooke(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -82,76 +82,76 @@ PairGranHookeCuda::PairGranHookeCuda(LAMMPS *lmp) : PairGranHooke(lmp)
 
 void PairGranHookeCuda::allocate()
 {
-	if(! allocated) PairGranHooke::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
- 		int n = atom->ntypes;
-		cuda->shared_data.pair.cutsq     = cutsq;
-		memory->create(cuda->shared_data.pair.coeff1,n+1,n+1,
-			       "pair:cuda_coeff1");
-		memory->create(cuda->shared_data.pair.coeff2,
-			       n+1,n+1,"pair:cuda_coeff2");
-		cuda->shared_data.pair.coeff1[0][0]=kn;
-		cuda->shared_data.pair.coeff1[0][1]=kt;
-		cuda->shared_data.pair.coeff1[1][0]=gamman;
-		cuda->shared_data.pair.coeff1[1][1]=gammat;
-		cuda->shared_data.pair.coeff2[0][0]=xmu;
-		cuda->shared_data.pair.coeff2[0][1]=dampflag;
-	}
+        if(! allocated) PairGranHooke::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                 int n = atom->ntypes;
+                cuda->shared_data.pair.cutsq     = cutsq;
+                memory->create(cuda->shared_data.pair.coeff1,n+1,n+1,
+                               "pair:cuda_coeff1");
+                memory->create(cuda->shared_data.pair.coeff2,
+                               n+1,n+1,"pair:cuda_coeff2");
+                cuda->shared_data.pair.coeff1[0][0]=kn;
+                cuda->shared_data.pair.coeff1[0][1]=kt;
+                cuda->shared_data.pair.coeff1[1][0]=gamman;
+                cuda->shared_data.pair.coeff1[1][1]=gammat;
+                cuda->shared_data.pair.coeff2[0][0]=xmu;
+                cuda->shared_data.pair.coeff2[0][1]=dampflag;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairGranHookeCuda::compute(int eflag, int vflag)
 {
-	     cuda->shared_data.pair.use_block_per_atom = 0;
-	//cuda->cu_debugdata->memset_device(0);
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
+             cuda->shared_data.pair.use_block_per_atom = 0;
+        //cuda->cu_debugdata->memset_device(0);
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairGranHookeCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairGranHookeCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	//cuda->cu_debugdata->download();
-	//printf("%lf %lf %lf %lf %lf %lf\n",1.0e-6*cuda->debugdata[0],1.0e-6*cuda->debugdata[1],1.0e-6*cuda->debugdata[2],1.0e-6*cuda->debugdata[3],1.0e-6*cuda->debugdata[4],1.0e-6*cuda->debugdata[5]);
-	
+        //cuda->cu_debugdata->download();
+        //printf("%lf %lf %lf %lf %lf %lf\n",1.0e-6*cuda->debugdata[0],1.0e-6*cuda->debugdata[1],1.0e-6*cuda->debugdata[2],1.0e-6*cuda->debugdata[3],1.0e-6*cuda->debugdata[4],1.0e-6*cuda->debugdata[5]);
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairGranHookeCuda::settings(int narg, char **arg)
 {
-	PairGranHooke::settings(narg, arg);
+        PairGranHooke::settings(narg, arg);
  }
 
 /* ---------------------------------------------------------------------- */
 
 void PairGranHookeCuda::coeff(int narg, char **arg)
 {
-	PairGranHooke::coeff(narg, arg);
-	allocate();
+        PairGranHooke::coeff(narg, arg);
+        allocate();
 }
 
 void PairGranHookeCuda::init_style()
 {
-	int i;
-	MYDBG(printf("# CUDA PairGranHookeCuda::init_style start\n"); )
+        int i;
+        MYDBG(printf("# CUDA PairGranHookeCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->gran = 1;
@@ -207,38 +207,36 @@ void PairGranHookeCuda::init_style()
     else
       onerad_dynamic[type[i]] = MAX(onerad_dynamic[type[i]],radius[i]);
   }
-  
+
   MPI_Allreduce(&onerad_dynamic[1],&maxrad_dynamic[1],atom->ntypes,
-		MPI_DOUBLE,MPI_MAX,world);
+                MPI_DOUBLE,MPI_MAX,world);
   MPI_Allreduce(&onerad_frozen[1],&maxrad_frozen[1],atom->ntypes,
-		MPI_DOUBLE,MPI_MAX,world);
+                MPI_DOUBLE,MPI_MAX,world);
 
   MYDBG(printf("# CUDA PairGranHookeCuda::init_style end\n"); )
 }
 
 void PairGranHookeCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairGranHookeCuda::init_list\n");)
-	PairGranHooke::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairGranHookeCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairGranHookeCuda::init_list\n");)
+        PairGranHooke::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairGranHookeCuda::init_list end\n");)
 }
 
 void PairGranHookeCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairGranHooke::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairGranHooke::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_gran_hooke_cuda.h b/src/USER-CUDA/pair_gran_hooke_cuda.h
index 727082f1f8..b2aee0f9d2 100644
--- a/src/USER-CUDA/pair_gran_hooke_cuda.h
+++ b/src/USER-CUDA/pair_gran_hooke_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairGranHookeCuda : public PairGranHooke
 {
-	public:
-		PairGranHookeCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairGranHookeCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj96_cut_cuda.cpp b/src/USER-CUDA/pair_lj96_cut_cuda.cpp
index 408665d85e..58d866528a 100644
--- a/src/USER-CUDA/pair_lj96_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_lj96_cut_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,9 +69,9 @@ PairLJ96CutCuda::PairLJ96CutCuda(LAMMPS *lmp) : PairLJ96Cut(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -80,68 +80,68 @@ PairLJ96CutCuda::PairLJ96CutCuda(LAMMPS *lmp) : PairLJ96Cut(lmp)
 
 void PairLJ96CutCuda::allocate()
 {
-	if(! allocated) PairLJ96Cut::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairLJ96Cut::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJ96CutCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
-	
-	Cuda_PairLJ96CutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
+
+        Cuda_PairLJ96CutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJ96CutCuda::settings(int narg, char **arg)
 {
-	PairLJ96Cut::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
+        PairLJ96Cut::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJ96CutCuda::coeff(int narg, char **arg)
 {
-	PairLJ96Cut::coeff(narg, arg);
-	allocate();
+        PairLJ96Cut::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJ96CutCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairLJ96CutCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairLJ96CutCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -155,27 +155,25 @@ void PairLJ96CutCuda::init_style()
 
 void PairLJ96CutCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJ96CutCuda::init_list\n");)
-	PairLJ96Cut::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJ96CutCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJ96CutCuda::init_list\n");)
+        PairLJ96Cut::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJ96CutCuda::init_list end\n");)
 }
 
 void PairLJ96CutCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJ96Cut::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJ96Cut::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj96_cut_cuda.h b/src/USER-CUDA/pair_lj96_cut_cuda.h
index 0abb66f6aa..aeb02ca670 100644
--- a/src/USER-CUDA/pair_lj96_cut_cuda.h
+++ b/src/USER-CUDA/pair_lj96_cut_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairLJ96CutCuda : public PairLJ96Cut
 {
-	public:
-		PairLJ96CutCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairLJ96CutCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp b/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp
index bcd3569094..83dd79d7d2 100644
--- a/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -54,10 +54,10 @@ PairLJCharmmCoulCharmmCuda::PairLJCharmmCoulCharmmCuda(LAMMPS *lmp) : PairLJChar
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->shared_data.pair.use_block_per_atom = 0;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->shared_data.pair.use_block_per_atom = 0;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -66,62 +66,62 @@ PairLJCharmmCoulCharmmCuda::PairLJCharmmCoulCharmmCuda(LAMMPS *lmp) : PairLJChar
 
 void PairLJCharmmCoulCharmmCuda::allocate()
 {
-	if(! allocated) PairLJCharmmCoulCharmm::allocate();
-	if(! allocated2)
-	{
-		cuda->accelerator(0,NULL);
-		allocated2 = true;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	    cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	}
+        if(! allocated) PairLJCharmmCoulCharmm::allocate();
+        if(! allocated2)
+        {
+                cuda->accelerator(0,NULL);
+                allocated2 = true;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+            cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCharmmCoulCharmmCuda::compute(int eflag, int vflag)
 {
-  	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->upload();
-	  if(eflag) cuda->cu_eng_coul->upload();
-	  if(vflag) cuda->cu_virial->upload();
-	}
-
-	Cuda_PairLJCharmmCoulCharmmCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom,denom_lj,cut_coul_innersq,denom_coul);
-	
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
-	}
+          if (eflag || vflag) ev_setup(eflag,vflag);
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->upload();
+          if(eflag) cuda->cu_eng_coul->upload();
+          if(vflag) cuda->cu_virial->upload();
+        }
+
+        Cuda_PairLJCharmmCoulCharmmCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom,denom_lj,cut_coul_innersq,denom_coul);
+
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCharmmCoulCharmmCuda::settings(int narg, char **arg)
 {
-	PairLJCharmmCoulCharmm::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (X_FLOAT) cut_lj;
-	cuda->shared_data.pair.cut_coulsq_global = (X_FLOAT) cut_coulsq;
-	cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_lj_inner;
+        PairLJCharmmCoulCharmm::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (X_FLOAT) cut_lj;
+        cuda->shared_data.pair.cut_coulsq_global = (X_FLOAT) cut_coulsq;
+        cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_lj_inner;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCharmmCoulCharmmCuda::coeff(int narg, char **arg)
 {
-	PairLJCharmmCoulCharmm::coeff(narg, arg);
-	allocate();
+        PairLJCharmmCoulCharmm::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJCharmmCoulCharmmCuda::init_style()
@@ -130,17 +130,17 @@ void PairLJCharmmCoulCharmmCuda::init_style()
     error->all(FLERR,"Pair style lj/charmm/coul/long requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
-	if(atom->molecular)
-	{
-	  cuda->shared_data.pair.collect_forces_later = 1;
-	}
-	
+        if(atom->molecular)
+        {
+          cuda->shared_data.pair.collect_forces_later = 1;
+        }
+
   int irequest;
- 
-   	irequest = neighbor->request(this);
+
+           irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
-    neighbor->requests[irequest]->cudable = 1; 
+    neighbor->requests[irequest]->cudable = 1;
 
    if (cut_lj_inner >= cut_lj || cut_coul_inner >= cut_coul)
     error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
@@ -151,41 +151,39 @@ void PairLJCharmmCoulCharmmCuda::init_style()
   cut_coulsq = cut_coul * cut_coul;
   cut_bothsq = MAX(cut_ljsq,cut_coulsq);
 
-  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) * 
+  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) *
     (cut_ljsq-cut_lj_innersq);
-  denom_coul = (cut_coulsq-cut_coul_innersq) * (cut_coulsq-cut_coul_innersq) * 
+  denom_coul = (cut_coulsq-cut_coul_innersq) * (cut_coulsq-cut_coul_innersq) *
     (cut_coulsq-cut_coul_innersq);
 
   cut_coulsq = cut_coul * cut_coul;
- 
+
   cuda->shared_data.pair.cut_coulsq_global=cut_coulsq;
-  
+
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
 }
 
 void PairLJCharmmCoulCharmmCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJCharmmCoulCharmmCuda::init_list\n");)
-	PairLJCharmmCoulCharmm::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJCharmmCoulCharmmCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJCharmmCoulCharmmCuda::init_list\n");)
+        PairLJCharmmCoulCharmm::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJCharmmCoulCharmmCuda::init_list end\n");)
 }
 
 void PairLJCharmmCoulCharmmCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJCharmmCoulCharmm::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJCharmmCoulCharmm::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.h b/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.h
index 39ec4735ef..bcc76b5b68 100644
--- a/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.h
+++ b/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -37,23 +37,23 @@ namespace LAMMPS_NS {
 
 class PairLJCharmmCoulCharmmCuda : public PairLJCharmmCoulCharmm
 {
-	public:
-		PairLJCharmmCoulCharmmCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
+        public:
+                PairLJCharmmCoulCharmmCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
 
 };
 
diff --git a/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp b/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp
index 10696094c0..340116959c 100644
--- a/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -54,10 +54,10 @@ PairLJCharmmCoulCharmmImplicitCuda::PairLJCharmmCoulCharmmImplicitCuda(LAMMPS *l
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->shared_data.pair.collect_forces_later = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->shared_data.pair.collect_forces_later = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -66,62 +66,62 @@ PairLJCharmmCoulCharmmImplicitCuda::PairLJCharmmCoulCharmmImplicitCuda(LAMMPS *l
 
 void PairLJCharmmCoulCharmmImplicitCuda::allocate()
 {
-	if(! allocated) PairLJCharmmCoulCharmmImplicit::allocate();
-	if(! allocated2)
-	{
-		cuda->accelerator(0,NULL);
-		allocated2 = true;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	    cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	}
+        if(! allocated) PairLJCharmmCoulCharmmImplicit::allocate();
+        if(! allocated2)
+        {
+                cuda->accelerator(0,NULL);
+                allocated2 = true;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+            cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCharmmCoulCharmmImplicitCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->upload();
-	  if(eflag) cuda->cu_eng_coul->upload();
-	  if(vflag) cuda->cu_virial->upload();
-	}
-
-	Cuda_PairLJCharmmCoulCharmmImplicitCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom,denom_lj,cut_coul_innersq,denom_coul);
-
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
-	}
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->upload();
+          if(eflag) cuda->cu_eng_coul->upload();
+          if(vflag) cuda->cu_virial->upload();
+        }
+
+        Cuda_PairLJCharmmCoulCharmmImplicitCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom,denom_lj,cut_coul_innersq,denom_coul);
+
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCharmmCoulCharmmImplicitCuda::settings(int narg, char **arg)
 {
-	PairLJCharmmCoulCharmmImplicit::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (X_FLOAT) cut_lj;
-	cuda->shared_data.pair.cut_coulsq_global = (X_FLOAT) cut_coulsq;
-	cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_lj_inner;
+        PairLJCharmmCoulCharmmImplicit::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (X_FLOAT) cut_lj;
+        cuda->shared_data.pair.cut_coulsq_global = (X_FLOAT) cut_coulsq;
+        cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_lj_inner;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCharmmCoulCharmmImplicitCuda::coeff(int narg, char **arg)
 {
-	PairLJCharmmCoulCharmmImplicit::coeff(narg, arg);
-	allocate();
+        PairLJCharmmCoulCharmmImplicit::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJCharmmCoulCharmmImplicitCuda::init_style()
@@ -131,11 +131,11 @@ void PairLJCharmmCoulCharmmImplicitCuda::init_style()
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
-   	irequest = neighbor->request(this);
+
+           irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
-    neighbor->requests[irequest]->cudable = 1; 
+    neighbor->requests[irequest]->cudable = 1;
 
    if (cut_lj_inner >= cut_lj || cut_coul_inner >= cut_coul)
     error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
@@ -146,41 +146,39 @@ void PairLJCharmmCoulCharmmImplicitCuda::init_style()
   cut_coulsq = cut_coul * cut_coul;
   cut_bothsq = MAX(cut_ljsq,cut_coulsq);
 
-  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) * 
+  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) *
     (cut_ljsq-cut_lj_innersq);
-  denom_coul = (cut_coulsq-cut_coul_innersq) * (cut_coulsq-cut_coul_innersq) * 
+  denom_coul = (cut_coulsq-cut_coul_innersq) * (cut_coulsq-cut_coul_innersq) *
     (cut_coulsq-cut_coul_innersq);
 
   cut_coulsq = cut_coul * cut_coul;
 
   cuda->shared_data.pair.cut_coulsq_global=cut_coulsq;
-  
+
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
 }
 
 void PairLJCharmmCoulCharmmImplicitCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJCharmmCoulCharmmImplicitCuda::init_list\n");)
-	PairLJCharmmCoulCharmmImplicit::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJCharmmCoulCharmmImplicitCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJCharmmCoulCharmmImplicitCuda::init_list\n");)
+        PairLJCharmmCoulCharmmImplicit::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJCharmmCoulCharmmImplicitCuda::init_list end\n");)
 }
 
 void PairLJCharmmCoulCharmmImplicitCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJCharmmCoulCharmmImplicit::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJCharmmCoulCharmmImplicit::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.h b/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.h
index 94d8d09543..748b6b6bbc 100644
--- a/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.h
+++ b/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -37,23 +37,23 @@ namespace LAMMPS_NS {
 
 class PairLJCharmmCoulCharmmImplicitCuda : public PairLJCharmmCoulCharmmImplicit
 {
-	public:
-		PairLJCharmmCoulCharmmImplicitCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
+        public:
+                PairLJCharmmCoulCharmmImplicitCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp b/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp
index 833b16f592..315f7ff80e 100644
--- a/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -61,10 +61,10 @@ PairLJCharmmCoulLongCuda::PairLJCharmmCoulLongCuda(LAMMPS *lmp) : PairLJCharmmCo
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->shared_data.pair.collect_forces_later = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->shared_data.pair.collect_forces_later = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -73,64 +73,64 @@ PairLJCharmmCoulLongCuda::PairLJCharmmCoulLongCuda(LAMMPS *lmp) : PairLJCharmmCo
 
 void PairLJCharmmCoulLongCuda::allocate()
 {
-	if(! allocated) PairLJCharmmCoulLong::allocate();
-	if(! allocated2)
-	{
-		cuda->accelerator(0,NULL);
-		allocated2 = true;
-		//cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	    cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	}
+        if(! allocated) PairLJCharmmCoulLong::allocate();
+        if(! allocated2)
+        {
+                cuda->accelerator(0,NULL);
+                allocated2 = true;
+                //cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+            cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCharmmCoulLongCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->upload();
-	  if(eflag) cuda->cu_eng_coul->upload();
-	  if(vflag) cuda->cu_virial->upload();
-	}
-
-	Cuda_PairLJCharmmCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom,denom_lj);
-
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
-	}
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->upload();
+          if(eflag) cuda->cu_eng_coul->upload();
+          if(vflag) cuda->cu_virial->upload();
+        }
+
+        Cuda_PairLJCharmmCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom,denom_lj);
+
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCharmmCoulLongCuda::settings(int narg, char **arg)
 {
-	PairLJCharmmCoulLong::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (X_FLOAT) cut_lj;
-	cuda->shared_data.pair.cut_coulsq_global = (X_FLOAT) cut_coulsq;
-	cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_lj_inner;	
+        PairLJCharmmCoulLong::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (X_FLOAT) cut_lj;
+        cuda->shared_data.pair.cut_coulsq_global = (X_FLOAT) cut_coulsq;
+        cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_lj_inner;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCharmmCoulLongCuda::coeff(int narg, char **arg)
 {
-	PairLJCharmmCoulLong::coeff(narg, arg);
-	allocate();
+        PairLJCharmmCoulLong::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJCharmmCoulLongCuda::init_style()
@@ -140,14 +140,14 @@ void PairLJCharmmCoulLongCuda::init_style()
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
 
-  	irequest = neighbor->request(this);
+
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
-    neighbor->requests[irequest]->cudable = 1; 
- 
-  if (cut_lj_inner >= cut_lj) 
+    neighbor->requests[irequest]->cudable = 1;
+
+  if (cut_lj_inner >= cut_lj)
     error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
 
   cut_lj_innersq = cut_lj_inner * cut_lj_inner;
@@ -155,7 +155,7 @@ void PairLJCharmmCoulLongCuda::init_style()
   cut_coulsq = cut_coul * cut_coul;
   cut_bothsq = MAX(cut_ljsq,cut_coulsq);
 
-  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) * 
+  denom_lj = (cut_ljsq-cut_lj_innersq) * (cut_ljsq-cut_lj_innersq) *
     (cut_ljsq-cut_lj_innersq);
 
   cut_coulsq = cut_coul * cut_coul;
@@ -166,34 +166,32 @@ void PairLJCharmmCoulLongCuda::init_style()
   g_ewald = force->kspace->g_ewald;
   cuda->shared_data.pair.g_ewald=g_ewald;
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
-  
+
 
   if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairLJCharmmCoulLongCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJCharmmCoulLongCuda::init_list\n");)
-	PairLJCharmmCoulLong::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJCharmmCoulLongCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJCharmmCoulLongCuda::init_list\n");)
+        PairLJCharmmCoulLong::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJCharmmCoulLongCuda::init_list end\n");)
 }
 
 void PairLJCharmmCoulLongCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJCharmmCoulLong::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJCharmmCoulLong::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.h b/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.h
index 4548883aaa..de575d5914 100644
--- a/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.h
+++ b/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -37,23 +37,23 @@ namespace LAMMPS_NS {
 
 class PairLJCharmmCoulLongCuda : public PairLJCharmmCoulLong
 {
-	public:
-		PairLJCharmmCoulLongCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
+        public:
+                PairLJCharmmCoulLongCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp b/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp
index 702f2089c9..5c0aa6d32a 100644
--- a/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -54,9 +54,9 @@ PairLJClass2CoulCutCuda::PairLJClass2CoulCutCuda(LAMMPS *lmp) : PairLJClass2Coul
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -65,38 +65,38 @@ PairLJClass2CoulCutCuda::PairLJClass2CoulCutCuda(LAMMPS *lmp) : PairLJClass2Coul
 
 void PairLJClass2CoulCutCuda::allocate()
 {
-	if(! allocated) PairLJClass2CoulCut::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.cut_coul= cut_coul;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairLJClass2CoulCut::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.cut_coul= cut_coul;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJClass2CoulCutCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairLJClass2CoulCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairLJClass2CoulCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
 }
 
@@ -104,17 +104,17 @@ void PairLJClass2CoulCutCuda::compute(int eflag, int vflag)
 
 void PairLJClass2CoulCutCuda::settings(int narg, char **arg)
 {
-	PairLJClass2CoulCut::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
-	cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
+        PairLJClass2CoulCut::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJClass2CoulCutCuda::coeff(int narg, char **arg)
 {
-	PairLJClass2CoulCut::coeff(narg, arg);
-	allocate();
+        PairLJClass2CoulCut::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJClass2CoulCutCuda::init_style()
@@ -124,41 +124,39 @@ void PairLJClass2CoulCutCuda::init_style()
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
- 
+
+
   irequest = neighbor->request(this);
   neighbor->requests[irequest]->full = 1;
   neighbor->requests[irequest]->half = 0;
   neighbor->requests[irequest]->cudable = 1;
- 
+
 
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
-  
+
 }
 
 void PairLJClass2CoulCutCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJClass2CoulCutCuda::init_list\n");)
-	PairLJClass2CoulCut::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJClass2CoulCutCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJClass2CoulCutCuda::init_list\n");)
+        PairLJClass2CoulCut::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJClass2CoulCutCuda::init_list end\n");)
 }
 
 void PairLJClass2CoulCutCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJClass2CoulCut::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJClass2CoulCut::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.h b/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.h
index e9edf9839b..0baf24942b 100644
--- a/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.h
+++ b/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairLJClass2CoulCutCuda : public PairLJClass2CoulCut
 {
-	public:
-		PairLJClass2CoulCutCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairLJClass2CoulCutCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp b/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp
index b0afe85554..5de5787e08 100644
--- a/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -61,9 +61,9 @@ PairLJClass2CoulLongCuda::PairLJClass2CoulLongCuda(LAMMPS *lmp) : PairLJClass2Co
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -72,37 +72,37 @@ PairLJClass2CoulLongCuda::PairLJClass2CoulLongCuda(LAMMPS *lmp) : PairLJClass2Co
 
 void PairLJClass2CoulLongCuda::allocate()
 {
-	if(! allocated) PairLJClass2CoulLong::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairLJClass2CoulLong::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJClass2CoulLongCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairLJClass2CoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairLJClass2CoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
 }
 
@@ -110,16 +110,16 @@ void PairLJClass2CoulLongCuda::compute(int eflag, int vflag)
 
 void PairLJClass2CoulLongCuda::settings(int narg, char **arg)
 {
-	PairLJClass2CoulLong::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        PairLJClass2CoulLong::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJClass2CoulLongCuda::coeff(int narg, char **arg)
 {
-	PairLJClass2CoulLong::coeff(narg, arg);
-	allocate();
+        PairLJClass2CoulLong::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJClass2CoulLongCuda::init_style()
@@ -129,9 +129,9 @@ void PairLJClass2CoulLongCuda::init_style()
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
 
-  	irequest = neighbor->request(this);
+
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -147,31 +147,29 @@ void PairLJClass2CoulLongCuda::init_style()
   g_ewald = force->kspace->g_ewald;
   cuda->shared_data.pair.g_ewald=g_ewald;
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
-  
+
 
   if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairLJClass2CoulLongCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJClass2CoulLongCuda::init_list\n");)
-	PairLJClass2CoulLong::init_list(id, ptr);
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	MYDBG(printf("# CUDA PairLJClass2CoulLongCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJClass2CoulLongCuda::init_list\n");)
+        PairLJClass2CoulLong::init_list(id, ptr);
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        MYDBG(printf("# CUDA PairLJClass2CoulLongCuda::init_list end\n");)
 }
 
 void PairLJClass2CoulLongCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJClass2CoulLong::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJClass2CoulLong::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_class2_coul_long_cuda.h b/src/USER-CUDA/pair_lj_class2_coul_long_cuda.h
index 6bf4a71e16..22ec5aa600 100644
--- a/src/USER-CUDA/pair_lj_class2_coul_long_cuda.h
+++ b/src/USER-CUDA/pair_lj_class2_coul_long_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairLJClass2CoulLongCuda : public PairLJClass2CoulLong
 {
-	public:
-		PairLJClass2CoulLongCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairLJClass2CoulLongCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_class2_cuda.cpp b/src/USER-CUDA/pair_lj_class2_cuda.cpp
index a218dc9cc8..df0ba7a0de 100644
--- a/src/USER-CUDA/pair_lj_class2_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_class2_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,9 +69,9 @@ PairLJClass2Cuda::PairLJClass2Cuda(LAMMPS *lmp) : PairLJClass2(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -80,63 +80,63 @@ PairLJClass2Cuda::PairLJClass2Cuda(LAMMPS *lmp) : PairLJClass2(lmp)
 
 void PairLJClass2Cuda::allocate()
 {
-	if(! allocated) PairLJClass2::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairLJClass2::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJClass2Cuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairLJClass2Cuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairLJClass2Cuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJClass2Cuda::settings(int narg, char **arg)
 {
-	PairLJClass2::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
+        PairLJClass2::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJClass2Cuda::coeff(int narg, char **arg)
 {
-	PairLJClass2::coeff(narg, arg);
-	allocate();
+        PairLJClass2::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJClass2Cuda::init_style()
 {
-	MYDBG(printf("# CUDA PairLJClass2Cuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairLJClass2Cuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
-  	irequest = neighbor->request(this);
+
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -146,24 +146,22 @@ void PairLJClass2Cuda::init_style()
 
 void PairLJClass2Cuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJClass2Cuda::init_list\n");)
-	PairLJClass2::init_list(id, ptr);
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	MYDBG(printf("# CUDA PairLJClass2Cuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJClass2Cuda::init_list\n");)
+        PairLJClass2::init_list(id, ptr);
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        MYDBG(printf("# CUDA PairLJClass2Cuda::init_list end\n");)
 }
 
 void PairLJClass2Cuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJClass2::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairLJClass2::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_class2_cuda.h b/src/USER-CUDA/pair_lj_class2_cuda.h
index 8643ad94aa..789fd7dcf5 100644
--- a/src/USER-CUDA/pair_lj_class2_cuda.h
+++ b/src/USER-CUDA/pair_lj_class2_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairLJClass2Cuda : public PairLJClass2
 {
-	public:
-		PairLJClass2Cuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairLJClass2Cuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp b/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp
index ac80ff5214..a702344f08 100644
--- a/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -54,9 +54,9 @@ PairLJCutCoulCutCuda::PairLJCutCoulCutCuda(LAMMPS *lmp) : PairLJCutCoulCut(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -65,38 +65,38 @@ PairLJCutCoulCutCuda::PairLJCutCoulCutCuda(LAMMPS *lmp) : PairLJCutCoulCut(lmp)
 
 void PairLJCutCoulCutCuda::allocate()
 {
-	if(! allocated) PairLJCutCoulCut::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.cut_coul= cut_coul;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairLJCutCoulCut::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.cut_coul= cut_coul;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutCoulCutCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairLJCutCoulCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairLJCutCoulCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
 }
 
@@ -104,17 +104,17 @@ void PairLJCutCoulCutCuda::compute(int eflag, int vflag)
 
 void PairLJCutCoulCutCuda::settings(int narg, char **arg)
 {
-	PairLJCutCoulCut::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
-	cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
+        PairLJCutCoulCut::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutCoulCutCuda::coeff(int narg, char **arg)
 {
-	PairLJCutCoulCut::coeff(narg, arg);
-	allocate();
+        PairLJCutCoulCut::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJCutCoulCutCuda::init_style()
@@ -124,41 +124,39 @@ void PairLJCutCoulCutCuda::init_style()
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
- 
+
+
   irequest = neighbor->request(this);
   neighbor->requests[irequest]->full = 1;
   neighbor->requests[irequest]->half = 0;
   neighbor->requests[irequest]->cudable = 1;
- 
+
 
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
-  
+
 }
 
 void PairLJCutCoulCutCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJCutCoulCutCuda::init_list\n");)
-	PairLJCutCoulCut::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJCutCoulCutCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJCutCoulCutCuda::init_list\n");)
+        PairLJCutCoulCut::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJCutCoulCutCuda::init_list end\n");)
 }
 
 void PairLJCutCoulCutCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJCutCoulCut::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJCutCoulCut::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.h b/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.h
index 130140d6ce..23fe8344d6 100644
--- a/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.h
+++ b/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairLJCutCoulCutCuda : public PairLJCutCoulCut
 {
-	public:
-		PairLJCutCoulCutCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairLJCutCoulCutCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp b/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp
index bc9a6f33ba..0ed229fff4 100644
--- a/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -54,9 +54,9 @@ PairLJCutCoulDebyeCuda::PairLJCutCoulDebyeCuda(LAMMPS *lmp) : PairLJCutCoulDebye
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -65,38 +65,38 @@ PairLJCutCoulDebyeCuda::PairLJCutCoulDebyeCuda(LAMMPS *lmp) : PairLJCutCoulDebye
 
 void PairLJCutCoulDebyeCuda::allocate()
 {
-	if(! allocated) PairLJCutCoulDebye::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.cut_coul= cut_coul;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairLJCutCoulDebye::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.cut_coul= cut_coul;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutCoulDebyeCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairLJCutCoulDebyeCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairLJCutCoulDebyeCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
 }
 
@@ -104,18 +104,18 @@ void PairLJCutCoulDebyeCuda::compute(int eflag, int vflag)
 
 void PairLJCutCoulDebyeCuda::settings(int narg, char **arg)
 {
-	PairLJCutCoulDebye::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
-	cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
-	cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
+        PairLJCutCoulDebye::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
+        cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutCoulDebyeCuda::coeff(int narg, char **arg)
 {
-	PairLJCutCoulDebye::coeff(narg, arg);
-	allocate();
+        PairLJCutCoulDebye::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJCutCoulDebyeCuda::init_style()
@@ -125,41 +125,39 @@ void PairLJCutCoulDebyeCuda::init_style()
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
- 
+
+
   irequest = neighbor->request(this);
   neighbor->requests[irequest]->full = 1;
   neighbor->requests[irequest]->half = 0;
   neighbor->requests[irequest]->cudable = 1;
- 
+
 
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
-  
+
 }
 
 void PairLJCutCoulDebyeCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJCutCoulDebyeCuda::init_list\n");)
-	PairLJCutCoulDebye::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJCutCoulDebyeCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJCutCoulDebyeCuda::init_list\n");)
+        PairLJCutCoulDebye::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJCutCoulDebyeCuda::init_list end\n");)
 }
 
 void PairLJCutCoulDebyeCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJCutCoulDebye::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJCutCoulDebye::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.h b/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.h
index 853c428143..0f3ff9b1c1 100644
--- a/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.h
+++ b/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairLJCutCoulDebyeCuda : public PairLJCutCoulDebye
 {
-	public:
-		PairLJCutCoulDebyeCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairLJCutCoulDebyeCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp b/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp
index cf60812217..37825a66b9 100644
--- a/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -61,9 +61,9 @@ PairLJCutCoulLongCuda::PairLJCutCoulLongCuda(LAMMPS *lmp) : PairLJCutCoulLong(lm
   if(cuda == NULL)
       error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -72,37 +72,37 @@ PairLJCutCoulLongCuda::PairLJCutCoulLongCuda(LAMMPS *lmp) : PairLJCutCoulLong(lm
 
 void PairLJCutCoulLongCuda::allocate()
 {
-	if(! allocated) PairLJCutCoulLong::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairLJCutCoulLong::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutCoulLongCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairLJCutCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairLJCutCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
 }
 
@@ -110,16 +110,16 @@ void PairLJCutCoulLongCuda::compute(int eflag, int vflag)
 
 void PairLJCutCoulLongCuda::settings(int narg, char **arg)
 {
-	PairLJCutCoulLong::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        PairLJCutCoulLong::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutCoulLongCuda::coeff(int narg, char **arg)
 {
-	PairLJCutCoulLong::coeff(narg, arg);
-	allocate();
+        PairLJCutCoulLong::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJCutCoulLongCuda::init_style()
@@ -129,7 +129,7 @@ void PairLJCutCoulLongCuda::init_style()
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
     int respa = 0;
     if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
@@ -160,10 +160,10 @@ void PairLJCutCoulLongCuda::init_style()
       neighbor->requests[irequest]->respaouter = 1;
     }
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -185,34 +185,32 @@ void PairLJCutCoulLongCuda::init_style()
   g_ewald = force->kspace->g_ewald;
   cuda->shared_data.pair.g_ewald=g_ewald;
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
-  
+
 
   if(ncoultablebits) error->warning(FLERR,"# CUDA: You asked for the usage of Coulomb Tables. This is not supported in CUDA Pair forces. Setting is ignored.\n");
 }
 
 void PairLJCutCoulLongCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJCutCoulLongCuda::init_list\n");)
-	PairLJCutCoulLong::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJCutCoulLongCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJCutCoulLongCuda::init_list\n");)
+        PairLJCutCoulLong::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJCutCoulLongCuda::init_list end\n");)
 }
 
 void PairLJCutCoulLongCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJCutCoulLong::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJCutCoulLong::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_cut_coul_long_cuda.h b/src/USER-CUDA/pair_lj_cut_coul_long_cuda.h
index 2f14357408..ca1d5fed94 100644
--- a/src/USER-CUDA/pair_lj_cut_coul_long_cuda.h
+++ b/src/USER-CUDA/pair_lj_cut_coul_long_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairLJCutCoulLongCuda : public PairLJCutCoulLong
 {
-	public:
-		PairLJCutCoulLongCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairLJCutCoulLongCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_cut_cuda.cpp b/src/USER-CUDA/pair_lj_cut_cuda.cpp
index c865f21361..7f35db0918 100644
--- a/src/USER-CUDA/pair_lj_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_cut_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,9 +69,9 @@ PairLJCutCuda::PairLJCutCuda(LAMMPS *lmp) : PairLJCut(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -80,68 +80,68 @@ PairLJCutCuda::PairLJCutCuda(LAMMPS *lmp) : PairLJCut(lmp)
 
 void PairLJCutCuda::allocate()
 {
-	if(! allocated) PairLJCut::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairLJCut::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairLJCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairLJCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutCuda::settings(int narg, char **arg)
 {
-	PairLJCut::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
+        PairLJCut::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutCuda::coeff(int narg, char **arg)
 {
-	PairLJCut::coeff(narg, arg);
-	allocate();
+        PairLJCut::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJCutCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairLJCutCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairLJCutCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -155,27 +155,25 @@ void PairLJCutCuda::init_style()
 
 void PairLJCutCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJCutCuda::init_list\n");)
-	PairLJCut::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJCutCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJCutCuda::init_list\n");)
+        PairLJCut::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJCutCuda::init_list end\n");)
 }
 
 void PairLJCutCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJCut::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairLJCut::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_cut_cuda.h b/src/USER-CUDA/pair_lj_cut_cuda.h
index f81d47952d..602a1e3d13 100644
--- a/src/USER-CUDA/pair_lj_cut_cuda.h
+++ b/src/USER-CUDA/pair_lj_cut_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairLJCutCuda : public PairLJCut
 {
-	public:
-		PairLJCutCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairLJCutCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp b/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp
index 50dfaa5fa9..ffc9533b45 100644
--- a/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,9 +69,9 @@ PairLJCutExperimentalCuda::PairLJCutExperimentalCuda(LAMMPS *lmp) : PairLJCut(lm
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -80,35 +80,35 @@ PairLJCutExperimentalCuda::PairLJCutExperimentalCuda(LAMMPS *lmp) : PairLJCut(lm
 
 void PairLJCutExperimentalCuda::allocate()
 {
-	if(! allocated) PairLJCut::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairLJCut::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutExperimentalCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
-	Cuda_PairLJCutExperimentalCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
+        Cuda_PairLJCutExperimentalCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  CudaWrapper_Sync();
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
+          CudaWrapper_Sync();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
     }
  }
 
@@ -116,31 +116,31 @@ void PairLJCutExperimentalCuda::compute(int eflag, int vflag)
 
 void PairLJCutExperimentalCuda::settings(int narg, char **arg)
 {
-	PairLJCut::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
+        PairLJCut::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJCutExperimentalCuda::coeff(int narg, char **arg)
 {
-	PairLJCut::coeff(narg, arg);
-	allocate();
+        PairLJCut::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJCutExperimentalCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairLJCutExperimentalCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairLJCutExperimentalCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -154,27 +154,25 @@ void PairLJCutExperimentalCuda::init_style()
 
 void PairLJCutExperimentalCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJCutExperimentalCuda::init_list\n");)
-	PairLJCut::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJCutExperimentalCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJCutExperimentalCuda::init_list\n");)
+        PairLJCut::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJCutExperimentalCuda::init_list end\n");)
 }
 
 void PairLJCutExperimentalCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJCut::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairLJCut::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_cut_experimental_cuda.h b/src/USER-CUDA/pair_lj_cut_experimental_cuda.h
index 9deb686524..25cf38624c 100644
--- a/src/USER-CUDA/pair_lj_cut_experimental_cuda.h
+++ b/src/USER-CUDA/pair_lj_cut_experimental_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairLJCutExperimentalCuda : public PairLJCut
 {
-	public:
-		PairLJCutExperimentalCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairLJCutExperimentalCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_expand_cuda.cpp b/src/USER-CUDA/pair_lj_expand_cuda.cpp
index 79f5f77c80..4420fb7c58 100644
--- a/src/USER-CUDA/pair_lj_expand_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_expand_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,9 +69,9 @@ PairLJExpandCuda::PairLJExpandCuda(LAMMPS *lmp) : PairLJExpand(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -80,70 +80,70 @@ PairLJExpandCuda::PairLJExpandCuda(LAMMPS *lmp) : PairLJExpand(lmp)
 
 void PairLJExpandCuda::allocate()
 {
-	if(! allocated) PairLJExpand::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut;
-		cuda->shared_data.pair.cutsq   = cutsq;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = shift;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairLJExpand::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut;
+                cuda->shared_data.pair.cutsq   = cutsq;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = shift;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJExpandCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
-	
-	Cuda_PairLJExpandCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
-	
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
+
+        Cuda_PairLJExpandCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJExpandCuda::settings(int narg, char **arg)
 {
-	PairLJExpand::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
+        PairLJExpand::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJExpandCuda::coeff(int narg, char **arg)
 {
-	PairLJExpand::coeff(narg, arg);
-	allocate();
+        PairLJExpand::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJExpandCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairLJExpandCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairLJExpandCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -156,27 +156,25 @@ void PairLJExpandCuda::init_style()
 
 void PairLJExpandCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJExpandCuda::init_list\n");)
-	PairLJExpand::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJExpandCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJExpandCuda::init_list\n");)
+        PairLJExpand::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJExpandCuda::init_list end\n");)
 }
 
 void PairLJExpandCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJExpand::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJExpand::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_expand_cuda.h b/src/USER-CUDA/pair_lj_expand_cuda.h
index 67d1030edb..4cc905a578 100644
--- a/src/USER-CUDA/pair_lj_expand_cuda.h
+++ b/src/USER-CUDA/pair_lj_expand_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairLJExpandCuda : public PairLJExpand
 {
-	public:
-		PairLJExpandCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairLJExpandCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp b/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp
index 862d180e96..44ead2c2fc 100644
--- a/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -54,10 +54,10 @@ PairLJGromacsCoulGromacsCuda::PairLJGromacsCoulGromacsCuda(LAMMPS *lmp) : PairLJ
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->shared_data.pair.use_block_per_atom = 0;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->shared_data.pair.use_block_per_atom = 0;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -66,72 +66,72 @@ PairLJGromacsCoulGromacsCuda::PairLJGromacsCoulGromacsCuda(LAMMPS *lmp) : PairLJ
 
 void PairLJGromacsCoulGromacsCuda::allocate()
 {
-	if(! allocated) PairLJGromacsCoulGromacs::allocate();
-	if(! allocated2)
-	{
-		cuda->accelerator(0,NULL);
-		allocated2 = true;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = ljsw1;
-		cuda->shared_data.pair.coeff6  = ljsw2;
-		cuda->shared_data.pair.coeff7  = ljsw3;
-		cuda->shared_data.pair.coeff8  = ljsw4;
-		cuda->shared_data.pair.coeff9  = ljsw5;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	    cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw1_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw1, &cuda->shared_data.pair.coeff5_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw2_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw2, &cuda->shared_data.pair.coeff6_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw3_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw3, &cuda->shared_data.pair.coeff7_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw4_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw4, &cuda->shared_data.pair.coeff8_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw5_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw5, &cuda->shared_data.pair.coeff9_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	}
+        if(! allocated) PairLJGromacsCoulGromacs::allocate();
+        if(! allocated2)
+        {
+                cuda->accelerator(0,NULL);
+                allocated2 = true;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = ljsw1;
+                cuda->shared_data.pair.coeff6  = ljsw2;
+                cuda->shared_data.pair.coeff7  = ljsw3;
+                cuda->shared_data.pair.coeff8  = ljsw4;
+                cuda->shared_data.pair.coeff9  = ljsw5;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+            cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw1_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw1, &cuda->shared_data.pair.coeff5_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw2_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw2, &cuda->shared_data.pair.coeff6_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw3_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw3, &cuda->shared_data.pair.coeff7_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw4_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw4, &cuda->shared_data.pair.coeff8_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw5_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw5, &cuda->shared_data.pair.coeff9_gm, (atom->ntypes+1)*(atom->ntypes+1));
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJGromacsCoulGromacsCuda::compute(int eflag, int vflag)
 {
-  	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->upload();
-	  if(eflag) cuda->cu_eng_coul->upload();
-	  if(vflag) cuda->cu_virial->upload();
-	}
-	
-	Cuda_PairLJGromacsCoulGromacsCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom,cut_coul_inner,coulsw1,coulsw2,coulsw5);
-	
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
-	}
+          if (eflag || vflag) ev_setup(eflag,vflag);
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->upload();
+          if(eflag) cuda->cu_eng_coul->upload();
+          if(vflag) cuda->cu_virial->upload();
+        }
+
+        Cuda_PairLJGromacsCoulGromacsCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom,cut_coul_inner,coulsw1,coulsw2,coulsw5);
+
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJGromacsCoulGromacsCuda::settings(int narg, char **arg)
 {
-	PairLJGromacsCoulGromacs::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (X_FLOAT) cut_lj;
-	cuda->shared_data.pair.cut_coulsq_global = (X_FLOAT) cut_coulsq;
-	cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_lj_inner;
+        PairLJGromacsCoulGromacs::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (X_FLOAT) cut_lj;
+        cuda->shared_data.pair.cut_coulsq_global = (X_FLOAT) cut_coulsq;
+        cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_lj_inner;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJGromacsCoulGromacsCuda::coeff(int narg, char **arg)
 {
-	PairLJGromacsCoulGromacs::coeff(narg, arg);
-	allocate();
+        PairLJGromacsCoulGromacs::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJGromacsCoulGromacsCuda::init_style()
@@ -140,17 +140,17 @@ void PairLJGromacsCoulGromacsCuda::init_style()
     error->all(FLERR,"Pair style lj/gromacs/coul/gromacs requires atom attribute q");
   // request regular or rRESPA neighbor lists
 
-	if(atom->molecular)
-	{
-	  cuda->shared_data.pair.collect_forces_later = 1;
-	}
-	
+        if(atom->molecular)
+        {
+          cuda->shared_data.pair.collect_forces_later = 1;
+        }
+
   int irequest;
- 
-   	irequest = neighbor->request(this);
+
+           irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
-    neighbor->requests[irequest]->cudable = 1; 
+    neighbor->requests[irequest]->cudable = 1;
 
    if (cut_lj_inner >= cut_lj || cut_coul_inner >= cut_coul)
     error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff");
@@ -161,37 +161,35 @@ void PairLJGromacsCoulGromacsCuda::init_style()
   cut_coulsq = cut_coul * cut_coul;
   cut_bothsq = MAX(cut_ljsq,cut_coulsq);
 
-  
+
   cut_coulsq = cut_coul * cut_coul;
- 
+
   cuda->shared_data.pair.cut_coulsq_global=cut_coulsq;
-  
+
   cuda->shared_data.pppm.qqrd2e=force->qqrd2e;
 }
 
 void PairLJGromacsCoulGromacsCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJGromacsCoulGromacsCuda::init_list\n");)
-	PairLJGromacsCoulGromacs::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJGromacsCoulGromacsCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJGromacsCoulGromacsCuda::init_list\n");)
+        PairLJGromacsCoulGromacs::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJGromacsCoulGromacsCuda::init_list end\n");)
 }
 
 void PairLJGromacsCoulGromacsCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJGromacsCoulGromacs::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairLJGromacsCoulGromacs::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.h b/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.h
index 333bbc0088..32f781bc8e 100644
--- a/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.h
+++ b/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -37,28 +37,28 @@ namespace LAMMPS_NS {
 
 class PairLJGromacsCoulGromacsCuda : public PairLJGromacsCoulGromacs
 {
-	public:
-		PairLJGromacsCoulGromacsCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw1_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw2_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw3_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw4_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw5_gm;
+        public:
+                PairLJGromacsCoulGromacsCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw1_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw2_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw3_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw4_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw5_gm;
 
 };
 
diff --git a/src/USER-CUDA/pair_lj_gromacs_cuda.cpp b/src/USER-CUDA/pair_lj_gromacs_cuda.cpp
index 518ab56325..c8a09aaf7f 100644
--- a/src/USER-CUDA/pair_lj_gromacs_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_gromacs_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -54,10 +54,10 @@ PairLJGromacsCuda::PairLJGromacsCuda(LAMMPS *lmp) : PairLJGromacs(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->shared_data.pair.use_block_per_atom = 0;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->shared_data.pair.use_block_per_atom = 0;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -66,115 +66,113 @@ PairLJGromacsCuda::PairLJGromacsCuda(LAMMPS *lmp) : PairLJGromacs(lmp)
 
 void PairLJGromacsCuda::allocate()
 {
-	if(! allocated) PairLJGromacs::allocate();
-	if(! allocated2)
-	{
-		cuda->accelerator(0,NULL);
-		allocated2 = true;
-		cuda->shared_data.pair.cut = cut;
-		cuda->shared_data.pair.cut_inner = cut_inner;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = ljsw1;
-		cuda->shared_data.pair.coeff6  = ljsw2;
-		cuda->shared_data.pair.coeff7  = ljsw3;
-		cuda->shared_data.pair.coeff8  = ljsw4;
-		cuda->shared_data.pair.coeff9  = ljsw5;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-	    cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw1_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw1, &cuda->shared_data.pair.coeff5_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw2_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw2, &cuda->shared_data.pair.coeff6_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw3_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw3, &cuda->shared_data.pair.coeff7_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw4_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw4, &cuda->shared_data.pair.coeff8_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw5_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw5, &cuda->shared_data.pair.coeff9_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	}
+        if(! allocated) PairLJGromacs::allocate();
+        if(! allocated2)
+        {
+                cuda->accelerator(0,NULL);
+                allocated2 = true;
+                cuda->shared_data.pair.cut = cut;
+                cuda->shared_data.pair.cut_inner = cut_inner;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = ljsw1;
+                cuda->shared_data.pair.coeff6  = ljsw2;
+                cuda->shared_data.pair.coeff7  = ljsw3;
+                cuda->shared_data.pair.coeff8  = ljsw4;
+                cuda->shared_data.pair.coeff9  = ljsw5;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+            cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw1_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw1, &cuda->shared_data.pair.coeff5_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw2_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw2, &cuda->shared_data.pair.coeff6_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw3_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw3, &cuda->shared_data.pair.coeff7_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw4_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw4, &cuda->shared_data.pair.coeff8_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw5_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw5, &cuda->shared_data.pair.coeff9_gm, (atom->ntypes+1)*(atom->ntypes+1));
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJGromacsCuda::compute(int eflag, int vflag)
 {
-  	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->upload();
-	  if(vflag) cuda->cu_virial->upload();
-	}
-	
-	Cuda_PairLJGromacsCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
-	
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
-	}
+          if (eflag || vflag) ev_setup(eflag,vflag);
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->upload();
+          if(vflag) cuda->cu_virial->upload();
+        }
+
+        Cuda_PairLJGromacsCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJGromacsCuda::settings(int narg, char **arg)
 {
-	PairLJGromacs::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
-	cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_inner_global;
+        PairLJGromacs::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
+        cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_inner_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJGromacsCuda::coeff(int narg, char **arg)
 {
-	PairLJGromacs::coeff(narg, arg);
-	allocate();
+        PairLJGromacs::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJGromacsCuda::init_style()
 {
   // request regular or rRESPA neighbor lists
 
-	if(atom->molecular)
-	{
-	  cuda->shared_data.pair.collect_forces_later = 1;
-	}
-	
+        if(atom->molecular)
+        {
+          cuda->shared_data.pair.collect_forces_later = 1;
+        }
+
   int irequest;
- 
-   	irequest = neighbor->request(this);
+
+           irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
-    neighbor->requests[irequest]->cudable = 1; 
+    neighbor->requests[irequest]->cudable = 1;
+
 
 
-   
 }
 
 void PairLJGromacsCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJGromacsCuda::init_list\n");)
-	PairLJGromacs::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJGromacsCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJGromacsCuda::init_list\n");)
+        PairLJGromacs::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJGromacsCuda::init_list end\n");)
 }
 
 void PairLJGromacsCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJGromacs::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJGromacs::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_gromacs_cuda.h b/src/USER-CUDA/pair_lj_gromacs_cuda.h
index 64e38aa763..87ee71f881 100644
--- a/src/USER-CUDA/pair_lj_gromacs_cuda.h
+++ b/src/USER-CUDA/pair_lj_gromacs_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -37,28 +37,28 @@ namespace LAMMPS_NS {
 
 class PairLJGromacsCuda : public PairLJGromacs
 {
-	public:
-		PairLJGromacsCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw1_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw2_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw3_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw4_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw5_gm;
+        public:
+                PairLJGromacsCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw1_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw2_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw3_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw4_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw5_gm;
 
 };
 
diff --git a/src/USER-CUDA/pair_lj_sdk_coul_cut_cuda.cpp b/src/USER-CUDA/pair_lj_sdk_coul_cut_cuda.cpp
index 458973525d..c74cc0c4ee 100644
--- a/src/USER-CUDA/pair_lj_sdk_coul_cut_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_sdk_coul_cut_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,10 +69,10 @@ PairLJSDKCoulCutCuda::PairLJSDKCoulCutCuda(LAMMPS *lmp) : PairLJSDKCoulCut(lmp)
   if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	lj_type_double = NULL;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        lj_type_double = NULL;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -81,27 +81,27 @@ PairLJSDKCoulCutCuda::PairLJSDKCoulCutCuda(LAMMPS *lmp) : PairLJSDKCoulCut(lmp)
 
 void PairLJSDKCoulCutCuda::allocate()
 {
-	if(! allocated) PairLJSDKCoulCut::allocate();
-	int n = atom->ntypes;
-	if(! allocated2)
-	{
-		allocated2 = true;
-		
-  
-  		memory->create(lj_type_double,n+1,n+1,"pairlj:ljtypedouble");
-  		
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.cut_coul= cut_coul;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = lj_type_double;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
-  	for (int i = 1; i <= n; i++) {
+        if(! allocated) PairLJSDKCoulCut::allocate();
+        int n = atom->ntypes;
+        if(! allocated2)
+        {
+                allocated2 = true;
+
+
+                  memory->create(lj_type_double,n+1,n+1,"pairlj:ljtypedouble");
+
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.cut_coul= cut_coul;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = lj_type_double;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
+          for (int i = 1; i <= n; i++) {
       for (int j = i; j <= n; j++) {
         lj_type_double[i][j] = lj_type[i][j];
         lj_type_double[j][i] = lj_type[i][j];
@@ -113,53 +113,53 @@ void PairLJSDKCoulCutCuda::allocate()
 
 void PairLJSDKCoulCutCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairLJSDKCoulCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairLJSDKCoulCutCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJSDKCoulCutCuda::settings(int narg, char **arg)
 {
-	PairLJSDKCoulCut::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
-	cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
-	cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
+        PairLJSDKCoulCut::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
+        cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJSDKCoulCutCuda::coeff(int narg, char **arg)
 {
-	PairLJSDKCoulCut::coeff(narg, arg);
-	allocate();
+        PairLJSDKCoulCut::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJSDKCoulCutCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairLJSDKCoulCutCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairLJSDKCoulCutCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -175,27 +175,25 @@ void PairLJSDKCoulCutCuda::init_style()
 
 void PairLJSDKCoulCutCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJSDKCoulCutCuda::init_list\n");)
-	PairLJSDKCoulCut::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJSDKCoulCutCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJSDKCoulCutCuda::init_list\n");)
+        PairLJSDKCoulCut::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJSDKCoulCutCuda::init_list end\n");)
 }
 
 void PairLJSDKCoulCutCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJSDKCoulCut::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairLJSDKCoulCut::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_sdk_coul_cut_cuda.h b/src/USER-CUDA/pair_lj_sdk_coul_cut_cuda.h
index e254a63f69..0e78ae7757 100644
--- a/src/USER-CUDA/pair_lj_sdk_coul_cut_cuda.h
+++ b/src/USER-CUDA/pair_lj_sdk_coul_cut_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,20 +36,20 @@ namespace LAMMPS_NS {
 
 class PairLJSDKCoulCutCuda : public PairLJSDKCoulCut
 {
-	public:
-		PairLJSDKCoulCutCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		double** lj_type_double;
+        public:
+                PairLJSDKCoulCutCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                double** lj_type_double;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_sdk_coul_debye_cuda.cpp b/src/USER-CUDA/pair_lj_sdk_coul_debye_cuda.cpp
index 418bdb0c64..afd140207e 100644
--- a/src/USER-CUDA/pair_lj_sdk_coul_debye_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_sdk_coul_debye_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,10 +69,10 @@ PairLJSDKCoulDebyeCuda::PairLJSDKCoulDebyeCuda(LAMMPS *lmp) : PairLJSDKCoulCut(l
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	lj_type_double = NULL;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        lj_type_double = NULL;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -81,27 +81,27 @@ PairLJSDKCoulDebyeCuda::PairLJSDKCoulDebyeCuda(LAMMPS *lmp) : PairLJSDKCoulCut(l
 
 void PairLJSDKCoulDebyeCuda::allocate()
 {
-	if(! allocated) PairLJSDKCoulCut::allocate();
-	int n = atom->ntypes;
-	if(! allocated2)
-	{
-		allocated2 = true;
-		
-  
-  		memory->create(lj_type_double,n+1,n+1,"pairlj:ljtypedouble");
-  		
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.cut_coul= cut_coul;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = lj_type_double;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
-  	for (int i = 1; i <= n; i++) {
+        if(! allocated) PairLJSDKCoulCut::allocate();
+        int n = atom->ntypes;
+        if(! allocated2)
+        {
+                allocated2 = true;
+
+
+                  memory->create(lj_type_double,n+1,n+1,"pairlj:ljtypedouble");
+
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.cut_coul= cut_coul;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = lj_type_double;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
+          for (int i = 1; i <= n; i++) {
       for (int j = i; j <= n; j++) {
         lj_type_double[i][j] = lj_type[i][j];
         lj_type_double[j][i] = lj_type[i][j];
@@ -113,53 +113,53 @@ void PairLJSDKCoulDebyeCuda::allocate()
 
 void PairLJSDKCoulDebyeCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairLJSDKCoulDebyeCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairLJSDKCoulDebyeCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJSDKCoulDebyeCuda::settings(int narg, char **arg)
 {
-	PairLJSDKCoulCut::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
-	cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
-	cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
+        PairLJSDKCoulCut::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul_global;
+        cuda->shared_data.pair.kappa = (F_FLOAT) kappa;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJSDKCoulDebyeCuda::coeff(int narg, char **arg)
 {
-	PairLJSDKCoulCut::coeff(narg, arg);
-	allocate();
+        PairLJSDKCoulCut::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJSDKCoulDebyeCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairLJSDKCoulDebyeCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairLJSDKCoulDebyeCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -175,27 +175,25 @@ void PairLJSDKCoulDebyeCuda::init_style()
 
 void PairLJSDKCoulDebyeCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJSDKCoulDebyeCuda::init_list\n");)
-	PairLJSDKCoulCut::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJSDKCoulDebyeCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJSDKCoulDebyeCuda::init_list\n");)
+        PairLJSDKCoulCut::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJSDKCoulDebyeCuda::init_list end\n");)
 }
 
 void PairLJSDKCoulDebyeCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJSDKCoulCut::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairLJSDKCoulCut::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_sdk_coul_debye_cuda.h b/src/USER-CUDA/pair_lj_sdk_coul_debye_cuda.h
index 9f193fc333..cceffdbfe7 100644
--- a/src/USER-CUDA/pair_lj_sdk_coul_debye_cuda.h
+++ b/src/USER-CUDA/pair_lj_sdk_coul_debye_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,20 +36,20 @@ namespace LAMMPS_NS {
 
 class PairLJSDKCoulDebyeCuda : public PairLJSDKCoulCut
 {
-	public:
-		PairLJSDKCoulDebyeCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		double** lj_type_double;
+        public:
+                PairLJSDKCoulDebyeCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                double** lj_type_double;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_sdk_coul_long_cuda.cpp b/src/USER-CUDA/pair_lj_sdk_coul_long_cuda.cpp
index 85b6f4a138..89134d7e37 100644
--- a/src/USER-CUDA/pair_lj_sdk_coul_long_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_sdk_coul_long_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -70,10 +70,10 @@ PairLJSDKCoulLongCuda::PairLJSDKCoulLongCuda(LAMMPS *lmp) : PairLJSDKCoulLong(lm
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	lj_type_double = NULL;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        lj_type_double = NULL;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -82,28 +82,28 @@ PairLJSDKCoulLongCuda::PairLJSDKCoulLongCuda(LAMMPS *lmp) : PairLJSDKCoulLong(lm
 
 void PairLJSDKCoulLongCuda::allocate()
 {
-	if(! allocated) PairLJSDKCoulLong::allocate();
-	int n = atom->ntypes;
-	if(! allocated2)
-	{
-		allocated2 = true;
-		
-  
-  		memory->create(lj_type_double,n+1,n+1,"pairlj:ljtypedouble");
-  		
-		cuda->shared_data.pair.cut     = cut_lj;
-		cuda->shared_data.pair.cut_coul= NULL;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = lj_type_double;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
+        if(! allocated) PairLJSDKCoulLong::allocate();
+        int n = atom->ntypes;
+        if(! allocated2)
+        {
+                allocated2 = true;
+
+
+                  memory->create(lj_type_double,n+1,n+1,"pairlj:ljtypedouble");
+
+                cuda->shared_data.pair.cut     = cut_lj;
+                cuda->shared_data.pair.cut_coul= NULL;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = lj_type_double;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
                 cuda->shared_data.pair.special_coul  = force->special_coul;
 
-	}
-  	for (int i = 1; i <= n; i++) {
+        }
+          for (int i = 1; i <= n; i++) {
       for (int j = i; j <= n; j++) {
         lj_type_double[i][j] = lj_type[i][j];
         lj_type_double[j][i] = lj_type[i][j];
@@ -115,47 +115,47 @@ void PairLJSDKCoulLongCuda::allocate()
 
 void PairLJSDKCoulLongCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(eflag) cuda->cu_eng_coul->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(eflag) cuda->cu_eng_coul->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairLJSDKCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairLJSDKCoulLongCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJSDKCoulLongCuda::settings(int narg, char **arg)
 {
-	PairLJSDKCoulLong::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
-	cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul;
+        PairLJSDKCoulLong::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_lj_global;
+        cuda->shared_data.pair.cut_coul_global = (F_FLOAT) cut_coul;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJSDKCoulLongCuda::coeff(int narg, char **arg)
 {
-	PairLJSDKCoulLong::coeff(narg, arg);
-	allocate();
+        PairLJSDKCoulLong::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJSDKCoulLongCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairLJSDKCoulLongCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairLJSDKCoulLongCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
-  	irequest = neighbor->request(this);
+
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -169,27 +169,25 @@ void PairLJSDKCoulLongCuda::init_style()
 
 void PairLJSDKCoulLongCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJSDKCoulLongCuda::init_list\n");)
-	PairLJSDKCoulLong::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJSDKCoulLongCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJSDKCoulLongCuda::init_list\n");)
+        PairLJSDKCoulLong::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJSDKCoulLongCuda::init_list end\n");)
 }
 
 void PairLJSDKCoulLongCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJSDKCoulLong::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairLJSDKCoulLong::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_sdk_coul_long_cuda.h b/src/USER-CUDA/pair_lj_sdk_coul_long_cuda.h
index 5b67883711..8debb81666 100644
--- a/src/USER-CUDA/pair_lj_sdk_coul_long_cuda.h
+++ b/src/USER-CUDA/pair_lj_sdk_coul_long_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,20 +36,20 @@ namespace LAMMPS_NS {
 
 class PairLJSDKCoulLongCuda : public PairLJSDKCoulLong
 {
-	public:
-		PairLJSDKCoulLongCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		double** lj_type_double;
+        public:
+                PairLJSDKCoulLongCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                double** lj_type_double;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_sdk_cuda.cpp b/src/USER-CUDA/pair_lj_sdk_cuda.cpp
index 6ce34418d4..64a7a48311 100644
--- a/src/USER-CUDA/pair_lj_sdk_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_sdk_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,10 +69,10 @@ PairLJSDKCuda::PairLJSDKCuda(LAMMPS *lmp) : PairLJSDK(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	lj_type_double = NULL;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        lj_type_double = NULL;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -81,30 +81,30 @@ PairLJSDKCuda::PairLJSDKCuda(LAMMPS *lmp) : PairLJSDK(lmp)
 
 void PairLJSDKCuda::allocate()
 {
-	if(! allocated) PairLJSDK::allocate();
-	int n = atom->ntypes;
-	if(! allocated2)
-	{
-		allocated2 = true;
-		
-  
-  		memory->create(lj_type_double,n+1,n+1,"pairlj:ljtypedouble");
-  		
-		cuda->shared_data.pair.cut     = cut;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = lj_type_double;
-	    /*cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj_type_double_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj_type_double, &cuda->shared_data.pair.coeff5_gm, (atom->ntypes+1)*(atom->ntypes+1));*/
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-	}
-  	for (int i = 1; i <= n; i++) {
+        if(! allocated) PairLJSDK::allocate();
+        int n = atom->ntypes;
+        if(! allocated2)
+        {
+                allocated2 = true;
+
+
+                  memory->create(lj_type_double,n+1,n+1,"pairlj:ljtypedouble");
+
+                cuda->shared_data.pair.cut     = cut;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = lj_type_double;
+            /*cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj_type_double_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj_type_double, &cuda->shared_data.pair.coeff5_gm, (atom->ntypes+1)*(atom->ntypes+1));*/
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+        }
+          for (int i = 1; i <= n; i++) {
       for (int j = i; j <= n; j++) {
         lj_type_double[i][j] = lj_type[i][j];
         lj_type_double[j][i] = lj_type[i][j];
@@ -116,40 +116,40 @@ void PairLJSDKCuda::allocate()
 
 void PairLJSDKCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairLJSDKCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        Cuda_PairLJSDKCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJSDKCuda::settings(int narg, char **arg)
 {
-	PairLJSDK::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
+        PairLJSDK::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJSDKCuda::coeff(int narg, char **arg)
 {
-	PairLJSDK::coeff(narg, arg);
-	allocate();
+        PairLJSDK::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJSDKCuda::init_style()
 {
   MYDBG(printf("# CUDA PairLJSDKCuda::init_style start\n"); )
- 
+
   int irequest = neighbor->request(this);
   neighbor->requests[irequest]->full = 1;
   neighbor->requests[irequest]->half = 0;
@@ -160,27 +160,25 @@ void PairLJSDKCuda::init_style()
 
 void PairLJSDKCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJSDKCuda::init_list\n");)
-	PairLJSDK::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJSDKCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJSDKCuda::init_list\n");)
+        PairLJSDK::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJSDKCuda::init_list end\n");)
 }
 
 void PairLJSDKCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJSDK::ev_setup(eflag,vflag);
-
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+        int maxeatomold=maxeatom;
+        PairLJSDK::ev_setup(eflag,vflag);
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_sdk_cuda.h b/src/USER-CUDA/pair_lj_sdk_cuda.h
index adc5041021..f5737adadc 100644
--- a/src/USER-CUDA/pair_lj_sdk_cuda.h
+++ b/src/USER-CUDA/pair_lj_sdk_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -37,25 +37,25 @@ namespace LAMMPS_NS {
 
 class PairLJSDKCuda : public PairLJSDK
 {
-	public:
-		PairLJSDKCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		double** lj_type_double;
-		cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj_type_double_gm;
+        public:
+                PairLJSDKCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                double** lj_type_double;
+                cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj_type_double_gm;
 };
 
 }
diff --git a/src/USER-CUDA/pair_lj_smooth_cuda.cpp b/src/USER-CUDA/pair_lj_smooth_cuda.cpp
index 84a4d9086a..62a7a7378d 100644
--- a/src/USER-CUDA/pair_lj_smooth_cuda.cpp
+++ b/src/USER-CUDA/pair_lj_smooth_cuda.cpp
@@ -1,23 +1,23 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
    Contributing author: Paul Crozier (SNL)
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -54,10 +54,10 @@ PairLJSmoothCuda::PairLJSmoothCuda(LAMMPS *lmp) : PairLJSmooth(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->shared_data.pair.use_block_per_atom = 0;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->shared_data.pair.use_block_per_atom = 0;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -66,115 +66,113 @@ PairLJSmoothCuda::PairLJSmoothCuda(LAMMPS *lmp) : PairLJSmooth(lmp)
 
 void PairLJSmoothCuda::allocate()
 {
-	if(! allocated) PairLJSmooth::allocate();
-	if(! allocated2)
-	{
-		cuda->accelerator(0,NULL);
-		allocated2 = true;
-		cuda->shared_data.pair.cut = cut;
-		cuda->shared_data.pair.cut_inner = cut_inner;
-		cuda->shared_data.pair.coeff1  = lj1;
-		cuda->shared_data.pair.coeff2  = lj2;
-		cuda->shared_data.pair.coeff3  = lj3;
-		cuda->shared_data.pair.coeff4  = lj4;
-		cuda->shared_data.pair.coeff5  = ljsw1;
-		cuda->shared_data.pair.coeff6  = ljsw2;
-		cuda->shared_data.pair.coeff7  = ljsw3;
-		cuda->shared_data.pair.coeff8  = ljsw4;
-		cuda->shared_data.pair.coeff9  = ljsw0;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-	    cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw0_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw0, &cuda->shared_data.pair.coeff9_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw1_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw1, &cuda->shared_data.pair.coeff5_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw2_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw2, &cuda->shared_data.pair.coeff6_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw3_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw3, &cuda->shared_data.pair.coeff7_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	    cu_ljsw4_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw4, &cuda->shared_data.pair.coeff8_gm, (atom->ntypes+1)*(atom->ntypes+1));
-	}
+        if(! allocated) PairLJSmooth::allocate();
+        if(! allocated2)
+        {
+                cuda->accelerator(0,NULL);
+                allocated2 = true;
+                cuda->shared_data.pair.cut = cut;
+                cuda->shared_data.pair.cut_inner = cut_inner;
+                cuda->shared_data.pair.coeff1  = lj1;
+                cuda->shared_data.pair.coeff2  = lj2;
+                cuda->shared_data.pair.coeff3  = lj3;
+                cuda->shared_data.pair.coeff4  = lj4;
+                cuda->shared_data.pair.coeff5  = ljsw1;
+                cuda->shared_data.pair.coeff6  = ljsw2;
+                cuda->shared_data.pair.coeff7  = ljsw3;
+                cuda->shared_data.pair.coeff8  = ljsw4;
+                cuda->shared_data.pair.coeff9  = ljsw0;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+            cu_lj1_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj1, &cuda->shared_data.pair.coeff1_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj2_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj2, &cuda->shared_data.pair.coeff2_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj3_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj3, &cuda->shared_data.pair.coeff3_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_lj4_gm = new cCudaData<double, F_FLOAT, x> ((double*)lj4, &cuda->shared_data.pair.coeff4_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw0_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw0, &cuda->shared_data.pair.coeff9_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw1_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw1, &cuda->shared_data.pair.coeff5_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw2_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw2, &cuda->shared_data.pair.coeff6_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw3_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw3, &cuda->shared_data.pair.coeff7_gm, (atom->ntypes+1)*(atom->ntypes+1));
+            cu_ljsw4_gm = new cCudaData<double, F_FLOAT, x> ((double*)ljsw4, &cuda->shared_data.pair.coeff8_gm, (atom->ntypes+1)*(atom->ntypes+1));
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJSmoothCuda::compute(int eflag, int vflag)
 {
-  	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->upload();
-	  if(vflag) cuda->cu_virial->upload();
-	}
-	
-	Cuda_PairLJSmoothCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
-	
-	if(not cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
-	}
+          if (eflag || vflag) ev_setup(eflag,vflag);
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->upload();
+          if(vflag) cuda->cu_virial->upload();
+        }
+
+        Cuda_PairLJSmoothCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+
+        if(not cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJSmoothCuda::settings(int narg, char **arg)
 {
-	PairLJSmooth::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
-	cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_inner_global;
+        PairLJSmooth::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
+        cuda->shared_data.pair.cut_inner_global = (F_FLOAT) cut_inner_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairLJSmoothCuda::coeff(int narg, char **arg)
 {
-	PairLJSmooth::coeff(narg, arg);
-	allocate();
+        PairLJSmooth::coeff(narg, arg);
+        allocate();
 }
 
 void PairLJSmoothCuda::init_style()
 {
   // request regular or rRESPA neighbor lists
 
-	if(atom->molecular)
-	{
-	  cuda->shared_data.pair.collect_forces_later = 1;
-	}
-	
+        if(atom->molecular)
+        {
+          cuda->shared_data.pair.collect_forces_later = 1;
+        }
+
   int irequest;
- 
-   	irequest = neighbor->request(this);
+
+           irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
-    neighbor->requests[irequest]->cudable = 1; 
+    neighbor->requests[irequest]->cudable = 1;
+
 
 
-   
 }
 
 void PairLJSmoothCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairLJSmoothCuda::init_list\n");)
-	PairLJSmooth::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairLJSmoothCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairLJSmoothCuda::init_list\n");)
+        PairLJSmooth::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairLJSmoothCuda::init_list end\n");)
 }
 
 void PairLJSmoothCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairLJSmooth::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairLJSmooth::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_lj_smooth_cuda.h b/src/USER-CUDA/pair_lj_smooth_cuda.h
index 32f6b4fabc..909ac186af 100644
--- a/src/USER-CUDA/pair_lj_smooth_cuda.h
+++ b/src/USER-CUDA/pair_lj_smooth_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -37,28 +37,28 @@ namespace LAMMPS_NS {
 
 class PairLJSmoothCuda : public PairLJSmooth
 {
-	public:
-		PairLJSmoothCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw0_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw1_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw2_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw3_gm;
-		cCudaData<double  , F_FLOAT , x >* cu_ljsw4_gm;
+        public:
+                PairLJSmoothCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                cCudaData<double  , F_FLOAT , x >* cu_lj1_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj2_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj3_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_lj4_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw0_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw1_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw2_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw3_gm;
+                cCudaData<double  , F_FLOAT , x >* cu_ljsw4_gm;
 
 };
 
diff --git a/src/USER-CUDA/pair_morse_cuda.cpp b/src/USER-CUDA/pair_morse_cuda.cpp
index ec2375fb92..ec5fabd5e8 100644
--- a/src/USER-CUDA/pair_morse_cuda.cpp
+++ b/src/USER-CUDA/pair_morse_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,9 +69,9 @@ PairMorseCuda::PairMorseCuda(LAMMPS *lmp) : PairMorse(lmp)
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	cuda->shared_data.pair.cudable_force = 1;
-	cuda->setSystemParams();
+        allocated2 = false;
+        cuda->shared_data.pair.cudable_force = 1;
+        cuda->setSystemParams();
 }
 
 /* ----------------------------------------------------------------------
@@ -80,67 +80,67 @@ PairMorseCuda::PairMorseCuda(LAMMPS *lmp) : PairMorse(lmp)
 
 void PairMorseCuda::allocate()
 {
-	if(! allocated) PairMorse::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cut     = cut;
-		cuda->shared_data.pair.coeff1  = r0;
-		cuda->shared_data.pair.coeff2  = alpha;
-		cuda->shared_data.pair.coeff3  = morse1;
-		cuda->shared_data.pair.coeff4  = d0;
-		cuda->shared_data.pair.offset  = offset;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-	}
+        if(! allocated) PairMorse::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cut     = cut;
+                cuda->shared_data.pair.coeff1  = r0;
+                cuda->shared_data.pair.coeff2  = alpha;
+                cuda->shared_data.pair.coeff3  = morse1;
+                cuda->shared_data.pair.coeff4  = d0;
+                cuda->shared_data.pair.offset  = offset;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairMorseCuda::compute(int eflag, int vflag)
 {
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
-	
-	Cuda_PairMorseCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
+
+        Cuda_PairMorseCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);
 
     if(not cuda->shared_data.pair.collect_forces_later)
     {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
     }
-	
+
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairMorseCuda::settings(int narg, char **arg)
 {
-	PairMorse::settings(narg, arg);
-	cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
+        PairMorse::settings(narg, arg);
+        cuda->shared_data.pair.cut_global = (F_FLOAT) cut_global;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairMorseCuda::coeff(int narg, char **arg)
 {
-	PairMorse::coeff(narg, arg);
-	allocate();
+        PairMorse::coeff(narg, arg);
+        allocate();
 }
 
 void PairMorseCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairMorseCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairMorseCuda::init_style start\n"); )
   // request regular or rRESPA neighbor lists
 
   int irequest;
- 
+
   if (update->whichflag == 0 && strstr(update->integrate_style,"respa")) {
 
-  } 
-  else 
+  }
+  else
   {
-  	irequest = neighbor->request(this);
+          irequest = neighbor->request(this);
     neighbor->requests[irequest]->full = 1;
     neighbor->requests[irequest]->half = 0;
     neighbor->requests[irequest]->cudable = 1;
@@ -153,27 +153,25 @@ void PairMorseCuda::init_style()
 
 void PairMorseCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairMorseCuda::init_list\n");)
-	PairMorse::init_list(id, ptr);
-	#ifndef CUDA_USE_BINNING
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	#endif
-	MYDBG(printf("# CUDA PairMorseCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairMorseCuda::init_list\n");)
+        PairMorse::init_list(id, ptr);
+        #ifndef CUDA_USE_BINNING
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        #endif
+        MYDBG(printf("# CUDA PairMorseCuda::init_list end\n");)
 }
 
 void PairMorseCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairMorse::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairMorse::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
-
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
-	
-}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 
+}
diff --git a/src/USER-CUDA/pair_morse_cuda.h b/src/USER-CUDA/pair_morse_cuda.h
index aae40294ba..1ce784631d 100644
--- a/src/USER-CUDA/pair_morse_cuda.h
+++ b/src/USER-CUDA/pair_morse_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,19 +36,19 @@ namespace LAMMPS_NS {
 
 class PairMorseCuda : public PairMorse
 {
-	public:
-		PairMorseCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-		class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
+        public:
+                PairMorseCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+                class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
 };
 
 }
diff --git a/src/USER-CUDA/pair_sw_cuda.cpp b/src/USER-CUDA/pair_sw_cuda.cpp
index 601ad7f2cf..89d1d744c9 100644
--- a/src/USER-CUDA/pair_sw_cuda.cpp
+++ b/src/USER-CUDA/pair_sw_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -71,9 +71,9 @@ PairSWCuda::PairSWCuda(LAMMPS *lmp) : PairSW(lmp)
   if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	params_f = NULL;
-	cuda->setSystemParams();
+        allocated2 = false;
+        params_f = NULL;
+        cuda->setSystemParams();
   cuda->shared_data.pair.cudable_force = 1;
   cuda->shared_data.pair.override_block_per_atom = 0;
   cuda->shared_data.pair.neighall = true;
@@ -86,14 +86,14 @@ PairSWCuda::PairSWCuda(LAMMPS *lmp) : PairSW(lmp)
 
 void PairSWCuda::allocate()
 {
-	if(! allocated) PairSW::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cutsq   = cutsq;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairSW::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cutsq   = cutsq;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
@@ -101,15 +101,15 @@ void PairSWCuda::allocate()
 void PairSWCuda::compute(int eflag, int vflag)
 {
   if(!init) {Cuda_PairSWCuda_Init(&cuda->shared_data,params_f,map, &elem2param[0][0][0],nelements); init=true;}
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairSWCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);//,&elem2param[0][0][0],map
+        Cuda_PairSWCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);//,&elem2param[0][0][0],map
   if(not cuda->shared_data.pair.collect_forces_later)
   {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
   }
 }
 
@@ -117,15 +117,15 @@ void PairSWCuda::compute(int eflag, int vflag)
 
 void PairSWCuda::settings(int narg, char **arg)
 {
-	PairSW::settings(narg, arg);
+        PairSW::settings(narg, arg);
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairSWCuda::coeff(int narg, char **arg)
 {
-	PairSW::coeff(narg, arg);
-	allocate();
+        PairSW::coeff(narg, arg);
+        allocate();
   params_f = (ParamSW_Float *) memory->srealloc(params_f,maxparam*sizeof(ParamSW_Float),
         "pair:params_f");
   for(int i=0;i<maxparam;i++)
@@ -164,11 +164,11 @@ void PairSWCuda::coeff(int narg, char **arg)
 
 void PairSWCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairSWCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairSWCuda::init_style start\n"); )
 
   int irequest;
- 
-	irequest = neighbor->request(this);
+
+        irequest = neighbor->request(this);
   neighbor->requests[irequest]->full = 1;
   neighbor->requests[irequest]->half = 0;
   neighbor->requests[irequest]->cudable = 1;
@@ -180,12 +180,12 @@ void PairSWCuda::init_style()
 
 void PairSWCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairSWCuda::init_list\n");)
-	PairSW::init_list(id, ptr);
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	MYDBG(printf("# CUDA PairSWCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairSWCuda::init_list\n");)
+        PairSW::init_list(id, ptr);
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        MYDBG(printf("# CUDA PairSWCuda::init_list end\n");)
   cu_params_f = (ParamSW_Float*) CudaWrapper_AllocCudaData(sizeof(ParamSW_Float)*maxparam);
   CudaWrapper_UploadCudaData((void*) params_f,(void*) cu_params_f,sizeof(ParamSW_Float)*maxparam);
   cu_elem2param = new cCudaData<int, int, xyz > ((int*) elem2param, nelements,nelements,nelements);
@@ -196,14 +196,12 @@ void PairSWCuda::init_list(int id, NeighList *ptr)
 
 void PairSWCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairSW::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairSW::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 }
-
-
diff --git a/src/USER-CUDA/pair_sw_cuda.h b/src/USER-CUDA/pair_sw_cuda.h
index be9ba9bb3d..8a871d9d40 100644
--- a/src/USER-CUDA/pair_sw_cuda.h
+++ b/src/USER-CUDA/pair_sw_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -38,23 +38,23 @@ namespace LAMMPS_NS {
 
 class PairSWCuda : public PairSW
 {
-	public:
-		PairSWCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-
-	  class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		ParamSW_Float* params_f;
-		ParamSW_Float* cu_params_f;
-		cCudaData<int, int, xyz >* cu_elem2param;
+        public:
+                PairSWCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+
+          class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                ParamSW_Float* params_f;
+                ParamSW_Float* cu_params_f;
+                cCudaData<int, int, xyz >* cu_elem2param;
     cCudaData<int, int, x >* cu_map;
     bool init;
     bool iszbl;
diff --git a/src/USER-CUDA/pair_tersoff_cuda.cpp b/src/USER-CUDA/pair_tersoff_cuda.cpp
index 4f1dba4e31..9ce69ae3a6 100644
--- a/src/USER-CUDA/pair_tersoff_cuda.cpp
+++ b/src/USER-CUDA/pair_tersoff_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -71,9 +71,9 @@ PairTersoffCuda::PairTersoffCuda(LAMMPS *lmp) : PairTersoff(lmp)
   if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	allocated2 = false;
-	params_f = NULL;
-	cuda->setSystemParams();
+        allocated2 = false;
+        params_f = NULL;
+        cuda->setSystemParams();
   cuda->shared_data.pair.cudable_force = 1;
   cuda->shared_data.pair.override_block_per_atom = 0;
   cuda->shared_data.pair.neighall = true;
@@ -87,14 +87,14 @@ PairTersoffCuda::PairTersoffCuda(LAMMPS *lmp) : PairTersoff(lmp)
 
 void PairTersoffCuda::allocate()
 {
-	if(! allocated) PairTersoff::allocate();
-	if(! allocated2)
-	{
-		allocated2 = true;
-		cuda->shared_data.pair.cutsq   = cutsq;
-		cuda->shared_data.pair.special_lj  = force->special_lj;
-		cuda->shared_data.pair.special_coul  = force->special_coul;
-	}
+        if(! allocated) PairTersoff::allocate();
+        if(! allocated2)
+        {
+                allocated2 = true;
+                cuda->shared_data.pair.cutsq   = cutsq;
+                cuda->shared_data.pair.special_lj  = force->special_lj;
+                cuda->shared_data.pair.special_coul  = force->special_coul;
+        }
 }
 
 /* ---------------------------------------------------------------------- */
@@ -102,15 +102,15 @@ void PairTersoffCuda::allocate()
 void PairTersoffCuda::compute(int eflag, int vflag)
 {
   if(!init) {Cuda_PairTersoffCuda_Init(&cuda->shared_data,params_f,map, &elem2param[0][0][0],nelements,iszbl); init=true;}
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	if(eflag) cuda->cu_eng_vdwl->upload();
-	if(vflag) cuda->cu_virial->upload();
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        if(eflag) cuda->cu_eng_vdwl->upload();
+        if(vflag) cuda->cu_virial->upload();
 
-	Cuda_PairTersoffCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);//,&elem2param[0][0][0],map
+        Cuda_PairTersoffCuda(& cuda->shared_data, & cuda_neigh_list->sneighlist, eflag, vflag, eflag_atom, vflag_atom);//,&elem2param[0][0][0],map
   if(not cuda->shared_data.pair.collect_forces_later)
   {
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(vflag) cuda->cu_virial->download();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(vflag) cuda->cu_virial->download();
   }
 }
 
@@ -118,15 +118,15 @@ void PairTersoffCuda::compute(int eflag, int vflag)
 
 void PairTersoffCuda::settings(int narg, char **arg)
 {
-	PairTersoff::settings(narg, arg);
+        PairTersoff::settings(narg, arg);
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairTersoffCuda::coeff(int narg, char **arg)
 {
-	PairTersoff::coeff(narg, arg);
-	allocate();
+        PairTersoff::coeff(narg, arg);
+        allocate();
   params_f = (Param_Float *) memory->srealloc(params_f,maxparam*sizeof(Param_Float),
         "pair:params_f");
   for(int i=0;i<maxparam;i++)
@@ -161,11 +161,11 @@ void PairTersoffCuda::coeff(int narg, char **arg)
 
 void PairTersoffCuda::init_style()
 {
-	MYDBG(printf("# CUDA PairTersoffCuda::init_style start\n"); )
+        MYDBG(printf("# CUDA PairTersoffCuda::init_style start\n"); )
 
   int irequest;
- 
-	irequest = neighbor->request(this);
+
+        irequest = neighbor->request(this);
   neighbor->requests[irequest]->full = 1;
   neighbor->requests[irequest]->half = 0;
   neighbor->requests[irequest]->cudable = 1;
@@ -177,12 +177,12 @@ void PairTersoffCuda::init_style()
 
 void PairTersoffCuda::init_list(int id, NeighList *ptr)
 {
-	MYDBG(printf("# CUDA PairTersoffCuda::init_list\n");)
-	PairTersoff::init_list(id, ptr);
-	// right now we can only handle verlet (id 0), not respa
-	if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
-	// see Neighbor::init() for details on lammps lists' logic
-	MYDBG(printf("# CUDA PairTersoffCuda::init_list end\n");)
+        MYDBG(printf("# CUDA PairTersoffCuda::init_list\n");)
+        PairTersoff::init_list(id, ptr);
+        // right now we can only handle verlet (id 0), not respa
+        if(id == 0) cuda_neigh_list = cuda->registerNeighborList(ptr);
+        // see Neighbor::init() for details on lammps lists' logic
+        MYDBG(printf("# CUDA PairTersoffCuda::init_list end\n");)
   cu_params_f = (Param_Float*) CudaWrapper_AllocCudaData(sizeof(Param_Float)*maxparam);
   CudaWrapper_UploadCudaData((void*) params_f,(void*) cu_params_f,sizeof(Param_Float)*maxparam);
   cu_elem2param = new cCudaData<int, int, xyz > ((int*) elem2param, nelements,nelements,nelements);
@@ -193,14 +193,12 @@ void PairTersoffCuda::init_list(int id, NeighList *ptr)
 
 void PairTersoffCuda::ev_setup(int eflag, int vflag)
 {
-	int maxeatomold=maxeatom;
-	PairTersoff::ev_setup(eflag,vflag);
+        int maxeatomold=maxeatom;
+        PairTersoff::ev_setup(eflag,vflag);
 
-  if (eflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
+  if (eflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData<double, ENERGY_FLOAT, x > ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax  );}
 
-  if (vflag_atom && atom->nmax > maxeatomold) 
-	{delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
+  if (vflag_atom && atom->nmax > maxeatomold)
+        {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData<double, ENERGY_FLOAT, yx > ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6  );}
 }
-
-
diff --git a/src/USER-CUDA/pair_tersoff_cuda.h b/src/USER-CUDA/pair_tersoff_cuda.h
index 34a06f91a9..02885dbb30 100644
--- a/src/USER-CUDA/pair_tersoff_cuda.h
+++ b/src/USER-CUDA/pair_tersoff_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -38,23 +38,23 @@ namespace LAMMPS_NS {
 
 class PairTersoffCuda : public PairTersoff
 {
-	public:
-		PairTersoffCuda(class LAMMPS *);
-		void compute(int, int);
-		void settings(int, char **);
-		void coeff(int, char **);
-		void init_list(int, class NeighList *);
-		void init_style();
-		void ev_setup(int eflag, int vflag);
-	protected:
-
-	  class Cuda *cuda;
-		void allocate();
-		bool allocated2;
-		class CudaNeighList* cuda_neigh_list;
-		Param_Float* params_f;
-		Param_Float* cu_params_f;
-		cCudaData<int, int, xyz >* cu_elem2param;
+        public:
+                PairTersoffCuda(class LAMMPS *);
+                void compute(int, int);
+                void settings(int, char **);
+                void coeff(int, char **);
+                void init_list(int, class NeighList *);
+                void init_style();
+                void ev_setup(int eflag, int vflag);
+        protected:
+
+          class Cuda *cuda;
+                void allocate();
+                bool allocated2;
+                class CudaNeighList* cuda_neigh_list;
+                Param_Float* params_f;
+                Param_Float* cu_params_f;
+                cCudaData<int, int, xyz >* cu_elem2param;
     cCudaData<int, int, x >* cu_map;
     bool init;
     bool iszbl;
diff --git a/src/USER-CUDA/pair_tersoff_zbl_cuda.cpp b/src/USER-CUDA/pair_tersoff_zbl_cuda.cpp
index 45236da515..1ac3b81ec6 100644
--- a/src/USER-CUDA/pair_tersoff_zbl_cuda.cpp
+++ b/src/USER-CUDA/pair_tersoff_zbl_cuda.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -94,8 +94,8 @@ void PairTersoffZBLCuda::read_file(char *file)
     if (comm->me == 0) {
       ptr = fgets(line,MAXLINE,fp);
       if (ptr == NULL) {
-	eof = 1;
-	fclose(fp);
+        eof = 1;
+        fclose(fp);
       } else n = strlen(line) + 1;
     }
     MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -116,8 +116,8 @@ void PairTersoffZBLCuda::read_file(char *file)
       if (comm->me == 0) {
         ptr = fgets(&line[n],MAXLINE-n,fp);
         if (ptr == NULL) {
-	  eof = 1;
-	  fclose(fp);
+          eof = 1;
+          fclose(fp);
         } else n = strlen(line) + 1;
       }
       MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -156,7 +156,7 @@ void PairTersoffZBLCuda::read_file(char *file)
     if (nparams == maxparam) {
       maxparam += DELTA;
       params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
-					  "pair:params");
+                                          "pair:params");
     }
 
     params[nparams].ielement = ielement;
@@ -186,18 +186,18 @@ void PairTersoffZBLCuda::read_file(char *file)
     params[nparams].powermint = int(params[nparams].powerm);
 
     if (
-	params[nparams].lam3 < 0.0 || params[nparams].c < 0.0 || 
-	params[nparams].d < 0.0 || params[nparams].powern < 0.0 || 
-	params[nparams].beta < 0.0 || params[nparams].lam2 < 0.0 || 
-	params[nparams].bigb < 0.0 || params[nparams].bigr < 0.0 ||
-	params[nparams].bigd < 0.0 ||
-	params[nparams].bigd > params[nparams].bigr ||
-	params[nparams].lam3 < 0.0 || params[nparams].biga < 0.0 ||
-	params[nparams].powerm - params[nparams].powermint != 0.0 ||
+        params[nparams].lam3 < 0.0 || params[nparams].c < 0.0 ||
+        params[nparams].d < 0.0 || params[nparams].powern < 0.0 ||
+        params[nparams].beta < 0.0 || params[nparams].lam2 < 0.0 ||
+        params[nparams].bigb < 0.0 || params[nparams].bigr < 0.0 ||
+        params[nparams].bigd < 0.0 ||
+        params[nparams].bigd > params[nparams].bigr ||
+        params[nparams].lam3 < 0.0 || params[nparams].biga < 0.0 ||
+        params[nparams].powerm - params[nparams].powermint != 0.0 ||
         (params[nparams].powermint != 3 && params[nparams].powermint != 1) ||
-	params[nparams].gamma < 0.0 ||
-	params[nparams].Z_i < 1.0 || params[nparams].Z_j < 1.0 ||
-	params[nparams].ZBLcut < 0.0 || params[nparams].ZBLexpscale < 0.0)
+        params[nparams].gamma < 0.0 ||
+        params[nparams].Z_i < 1.0 || params[nparams].Z_j < 1.0 ||
+        params[nparams].ZBLcut < 0.0 || params[nparams].ZBLexpscale < 0.0)
       error->all(FLERR,"Illegal Tersoff parameter");
 
     nparams++;
diff --git a/src/USER-CUDA/pair_tersoff_zbl_cuda.h b/src/USER-CUDA/pair_tersoff_zbl_cuda.h
index bd91a2abfa..59f1dc757f 100644
--- a/src/USER-CUDA/pair_tersoff_zbl_cuda.h
+++ b/src/USER-CUDA/pair_tersoff_zbl_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -36,15 +36,15 @@ namespace LAMMPS_NS {
 
 class PairTersoffZBLCuda : public PairTersoffCuda
 {
-	public:
-		PairTersoffZBLCuda(class LAMMPS *);
-	 private:
-	  double global_a_0;    // Bohr radius for Coulomb repulsion
-	  double global_epsilon_0;  // permittivity of vacuum for Coulomb repulsion
-	  double global_e;    // proton charge (negative of electron charge)
-
-	  void read_file(char *);
-	  void coeff(int narg, char **arg);
+        public:
+                PairTersoffZBLCuda(class LAMMPS *);
+         private:
+          double global_a_0;    // Bohr radius for Coulomb repulsion
+          double global_epsilon_0;  // permittivity of vacuum for Coulomb repulsion
+          double global_e;    // proton charge (negative of electron charge)
+
+          void read_file(char *);
+          void coeff(int narg, char **arg);
 };
 
 }
diff --git a/src/USER-CUDA/pppm_cuda.cpp b/src/USER-CUDA/pppm_cuda.cpp
index afcc1fb52c..60504bf556 100644
--- a/src/USER-CUDA/pppm_cuda.cpp
+++ b/src/USER-CUDA/pppm_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -28,7 +28,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -78,23 +78,23 @@ void printArray(double* data,int nx, int ny, int nz)
   for(int i=0;i<nz;i++)
   for(int j=0;j<ny;j++)
   {
-  	printf("%i %i\n",i,j);
-  	for(int k=0;k<nx;k++)
-  	printf("%e ",data[2*(i*ny*nx+j*nx+k)]);
-  	printf("\n\n");
+          printf("%i %i\n",i,j);
+          for(int k=0;k<nx;k++)
+          printf("%e ",data[2*(i*ny*nx+j*nx+k)]);
+          printf("\n\n");
   }
-} 
+}
 void printArray(double*** data,int nx, int ny, int nz)
 {
   for(int i=0;i<nx;i++)
   for(int j=0;j<ny;j++)
   {
-  	printf("%i %i\n",i,j);
-  	for(int k=0;k<nz;k++)
-  	printf("%e ",data[i][j][k]);
-  	printf("\n\n");
+          printf("%i %i\n",i,j);
+          for(int k=0;k<nz;k++)
+          printf("%e ",data[i][j][k]);
+          printf("\n\n");
   }
-} 
+}
 /* ---------------------------------------------------------------------- */
 
 PPPMCuda::PPPMCuda(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, (narg==2?1:narg), arg)
@@ -108,7 +108,7 @@ PPPMCuda::PPPMCuda(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, (narg==2?1:nar
   error->all(FLERR,"Using kspace_style pppm/cuda without cufft is not possible. Compile with cufft=1 to include cufft. Aborting.");
   #endif
   accuracy_relative = atof(arg[0]);
-  
+
   nfactors = 3;
   factors = new int[nfactors];
   factors[0] = 2;
@@ -131,7 +131,7 @@ PPPMCuda::PPPMCuda(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, (narg==2?1:nar
 
   fft1c = fft2c = NULL;
   remap = NULL;
- 
+
   density_brick_int=NULL;
   density_intScale=1000000;
   cu_vdx_brick = cu_vdy_brick = cu_vdz_brick = NULL;
@@ -143,43 +143,43 @@ PPPMCuda::PPPMCuda(LAMMPS *lmp, int narg, char **arg) : PPPM(lmp, (narg==2?1:nar
   cu_work1 = cu_work2 = cu_work3 = NULL;
   cu_vg = NULL;
   cu_fkx = cu_fky = cu_fkz = NULL;
-  
+
   cu_flag = NULL;
   cu_debugdata = NULL;
   cu_rho_coeff = NULL;
   cu_virial = NULL;
-  
+
   cu_gf_b = NULL;
-  
+
   cu_slabbuf = NULL;
   slabbuf = NULL;
-  
+
   nmax = 0;
   part2grid = NULL;
   cu_part2grid = NULL;
   adev_data_array=NULL;
   poissontime=0;
   old_nmax=0;
-  cu_pppm_grid_n=NULL;	
-  cu_pppm_grid_ids=NULL;	
-  
+  cu_pppm_grid_n=NULL;
+  cu_pppm_grid_ids=NULL;
+
   pppm_grid_nmax=0;
   pppm2partgrid=new int[3];
-  pppm_grid=new int[3];  
+  pppm_grid=new int[3];
   firstpass=true;
   scale = 1.0;
 }
 
 
 /* ----------------------------------------------------------------------
-   free all memory 
+   free all memory
 ------------------------------------------------------------------------- */
 
 PPPMCuda::~PPPMCuda()
 {
   delete [] slabbuf;
   delete cu_slabbuf;
-  
+
   delete [] factors;
   factors=NULL;
   deallocate();
@@ -190,16 +190,16 @@ PPPMCuda::~PPPMCuda()
 }
 
 /* ----------------------------------------------------------------------
-   called once before run 
+   called once before run
 ------------------------------------------------------------------------- */
 
 void PPPMCuda::init()
 {
-	
+
   cuda->shared_data.pppm.cudable_force=1;
-	
+
     //if(cuda->finished_run) {PPPM::init(); return;}
-    
+
   if (me == 0) {
     if (screen) fprintf(screen,"PPPMCuda initialization ...\n");
     if (logfile) fprintf(logfile,"PPPMCuda initialization ...\n");
@@ -216,8 +216,8 @@ void PPPMCuda::init()
   if (slabflag == 0 && domain->nonperiodic > 0)
     error->all(FLERR,"Cannot use nonperiodic boundaries with PPPMCuda");
   if (slabflag == 1) {
-    if (domain->xperiodic != 1 || domain->yperiodic != 1 || 
-	domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
+    if (domain->xperiodic != 1 || domain->yperiodic != 1 ||
+        domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
       error->all(FLERR,"Incorrect boundaries with slab PPPMCuda");
   }
 
@@ -305,7 +305,7 @@ void PPPMCuda::init()
   while (order > 1) {
     if (iteration && me == 0)
       error->warning(FLERR,"Reducing PPPMCuda order b/c stencil extends "
-		     "beyond neighbor processor");
+                     "beyond neighbor processor");
     iteration++;
 
     set_grid();
@@ -322,9 +322,9 @@ void PPPMCuda::init()
     nxhi_in = (comm->myloc[0]+1)*nx_pppm / comm->procgrid[0] - 1;
     nylo_in = comm->myloc[1]*ny_pppm / comm->procgrid[1];
     nyhi_in = (comm->myloc[1]+1)*ny_pppm / comm->procgrid[1] - 1;
-    nzlo_in = comm->myloc[2] * 
+    nzlo_in = comm->myloc[2] *
       (static_cast<int> (nz_pppm/slab_volfactor)) / comm->procgrid[2];
-    nzhi_in = (comm->myloc[2]+1) * 
+    nzhi_in = (comm->myloc[2]+1) *
       (static_cast<int> (nz_pppm/slab_volfactor)) / comm->procgrid[2] - 1;
 
     // nlower,nupper = stencil size for mapping particles to PPPMCuda grid
@@ -380,27 +380,27 @@ void PPPMCuda::init()
       dist[1] = cuthalf/domain->prd[1];
       dist[2] = cuthalf/domain->prd[2];
     }
-    
+
     int nlo,nhi;
-    
-    nlo = static_cast<int> ((sublo[0]-dist[0]-boxlo[0]) * 
-			    nx_pppm/xprd + shift) - OFFSET;
-    nhi = static_cast<int> ((subhi[0]+dist[0]-boxlo[0]) * 
-			    nx_pppm/xprd + shift) - OFFSET;
+
+    nlo = static_cast<int> ((sublo[0]-dist[0]-boxlo[0]) *
+                            nx_pppm/xprd + shift) - OFFSET;
+    nhi = static_cast<int> ((subhi[0]+dist[0]-boxlo[0]) *
+                            nx_pppm/xprd + shift) - OFFSET;
     nxlo_out = nlo + nlower;
     nxhi_out = nhi + nupper;
 
-    nlo = static_cast<int> ((sublo[1]-dist[1]-boxlo[1]) * 
-			    ny_pppm/yprd + shift) - OFFSET;
-    nhi = static_cast<int> ((subhi[1]+dist[1]-boxlo[1]) * 
-			    ny_pppm/yprd + shift) - OFFSET;
+    nlo = static_cast<int> ((sublo[1]-dist[1]-boxlo[1]) *
+                            ny_pppm/yprd + shift) - OFFSET;
+    nhi = static_cast<int> ((subhi[1]+dist[1]-boxlo[1]) *
+                            ny_pppm/yprd + shift) - OFFSET;
     nylo_out = nlo + nlower;
     nyhi_out = nhi + nupper;
 
-    nlo = static_cast<int> ((sublo[2]-dist[2]-boxlo[2]) * 
-			    nz_pppm/zprd_slab + shift) - OFFSET;
-    nhi = static_cast<int> ((subhi[2]+dist[2]-boxlo[2]) * 
-			    nz_pppm/zprd_slab + shift) - OFFSET;
+    nlo = static_cast<int> ((sublo[2]-dist[2]-boxlo[2]) *
+                            nz_pppm/zprd_slab + shift) - OFFSET;
+    nhi = static_cast<int> ((subhi[2]+dist[2]-boxlo[2]) *
+                            nz_pppm/zprd_slab + shift) - OFFSET;
     nzlo_out = nlo + nlower;
     nzhi_out = nhi + nupper;
 
@@ -415,7 +415,7 @@ void PPPMCuda::init()
       nzhi_in =  nz_pppm - 1;
       nzhi_out = nz_pppm - 1;
     }
-  
+
     // nlo_ghost,nhi_ghost = # of planes I will recv from 6 directions
     //   that overlay domain I own
     // proc in that direction tells me via sendrecv()
@@ -427,43 +427,43 @@ void PPPMCuda::init()
     nplanes = nxlo_in - nxlo_out;
     if (comm->procneigh[0][0] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[0][0],0,
-		   &nxhi_ghost,1,MPI_INT,comm->procneigh[0][1],0,
-		   world,&status);
+                   &nxhi_ghost,1,MPI_INT,comm->procneigh[0][1],0,
+                   world,&status);
     else nxhi_ghost = nplanes;
 
     nplanes = nxhi_out - nxhi_in;
     if (comm->procneigh[0][1] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[0][1],0,
-		   &nxlo_ghost,1,MPI_INT,comm->procneigh[0][0],
-		   0,world,&status);
+                   &nxlo_ghost,1,MPI_INT,comm->procneigh[0][0],
+                   0,world,&status);
     else nxlo_ghost = nplanes;
 
     nplanes = nylo_in - nylo_out;
     if (comm->procneigh[1][0] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[1][0],0,
-		   &nyhi_ghost,1,MPI_INT,comm->procneigh[1][1],0,
-		   world,&status);
+                   &nyhi_ghost,1,MPI_INT,comm->procneigh[1][1],0,
+                   world,&status);
     else nyhi_ghost = nplanes;
 
     nplanes = nyhi_out - nyhi_in;
     if (comm->procneigh[1][1] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[1][1],0,
-		   &nylo_ghost,1,MPI_INT,comm->procneigh[1][0],0,
-		   world,&status);
+                   &nylo_ghost,1,MPI_INT,comm->procneigh[1][0],0,
+                   world,&status);
     else nylo_ghost = nplanes;
 
     nplanes = nzlo_in - nzlo_out;
     if (comm->procneigh[2][0] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[2][0],0,
-		   &nzhi_ghost,1,MPI_INT,comm->procneigh[2][1],0,
-		   world,&status);
+                   &nzhi_ghost,1,MPI_INT,comm->procneigh[2][1],0,
+                   world,&status);
     else nzhi_ghost = nplanes;
 
     nplanes = nzhi_out - nzhi_in;
     if (comm->procneigh[2][1] != me)
       MPI_Sendrecv(&nplanes,1,MPI_INT,comm->procneigh[2][1],0,
-		   &nzlo_ghost,1,MPI_INT,comm->procneigh[2][0],0,
-		   world,&status);
+                   &nzlo_ghost,1,MPI_INT,comm->procneigh[2][0],0,
+                   world,&status);
     else nzlo_ghost = nplanes;
 
     // test that ghost overlap is not bigger than my sub-domain
@@ -570,9 +570,9 @@ void PPPMCuda::init()
 
   if (me == 0) {
     if (screen) fprintf(screen,"  brick FFT buffer size/proc = %d %d %d\n",
-			ngrid_max,nfft_both_max,nbuf_max);
+                        ngrid_max,nfft_both_max,nbuf_max);
     if (logfile) fprintf(logfile,"  brick FFT buffer size/proc = %d %d %d\n",
-			 ngrid_max,nfft_both_max,nbuf_max);
+                         ngrid_max,nfft_both_max,nbuf_max);
   }
   cuda_shared_pppm* ap=&(cuda->shared_data.pppm);
 
@@ -608,7 +608,7 @@ void PPPMCuda::init()
    ap->nlower=nlower;
    ap->nupper=nupper;
    ap->shiftone=shiftone;
-   
+
   // allocate K-space dependent memory
 
 
@@ -622,7 +622,7 @@ void PPPMCuda::init()
 }
 
 /* ----------------------------------------------------------------------
-   adjust PPPMCuda coeffs, called initially and whenever volume has changed 
+   adjust PPPMCuda coeffs, called initially and whenever volume has changed
 ------------------------------------------------------------------------- */
 
 void PPPMCuda::setup()
@@ -641,7 +641,7 @@ void PPPMCuda::setup()
   double zprd = prd[2];
   double zprd_slab = zprd*slab_volfactor;
   volume = xprd * yprd * zprd_slab;
-    
+
   delxinv = nx_pppm/xprd;
   delyinv = ny_pppm/yprd;
   delzinv = nz_pppm/zprd_slab;
@@ -655,20 +655,20 @@ void PPPMCuda::setup()
   // fkx,fky,fkz for my FFT grid pts
   Cuda_PPPM_Setup_fkxyz_vg(nx_pppm, ny_pppm,nz_pppm,unitkx,unitky,unitkz,g_ewald);
 
-  
+
 
   // modified (Hockney-Eastwood) Coulomb Green's function
 
-  int nbx = static_cast<int> ((g_ewald*xprd/(MY_PI*nx_pppm)) * 
-			      pow(-log(EPS_HOC),0.25));
-  int nby = static_cast<int> ((g_ewald*yprd/(MY_PI*ny_pppm)) * 
-			      pow(-log(EPS_HOC),0.25));
-  int nbz = static_cast<int> ((g_ewald*zprd_slab/(MY_PI*nz_pppm)) * 
-			      pow(-log(EPS_HOC),0.25));
+  int nbx = static_cast<int> ((g_ewald*xprd/(MY_PI*nx_pppm)) *
+                              pow(-log(EPS_HOC),0.25));
+  int nby = static_cast<int> ((g_ewald*yprd/(MY_PI*ny_pppm)) *
+                              pow(-log(EPS_HOC),0.25));
+  int nbz = static_cast<int> ((g_ewald*zprd_slab/(MY_PI*nz_pppm)) *
+                              pow(-log(EPS_HOC),0.25));
   Cuda_PPPM_setup_greensfn(nx_pppm,ny_pppm,nz_pppm,unitkx,unitky,unitkz,g_ewald,
 nbx,nby,nbz,xprd,yprd,zprd_slab);
 
-  
+
 #ifdef FFT_CUFFT
   cu_vdx_brick->upload();
   cu_vdy_brick->upload();
@@ -680,7 +680,7 @@ nbx,nby,nbz,xprd,yprd,zprd_slab);
 }
 
 /* ----------------------------------------------------------------------
-   compute the PPPMCuda long-range force, energy, virial 
+   compute the PPPMCuda long-range force, energy, virial
 ------------------------------------------------------------------------- */
 
 void PPPMCuda::compute(int eflag, int vflag)
@@ -693,7 +693,7 @@ void PPPMCuda::compute(int eflag, int vflag)
   timespec starttotal;
   timespec endtotal;
   // convert atoms from box to lamda coords
-  
+
   if (triclinic == 0) boxlo = domain->boxlo;
   else {
     boxlo = domain->boxlo_lamda;
@@ -706,21 +706,21 @@ void PPPMCuda::compute(int eflag, int vflag)
     memory->destroy(part2grid);
     nmax = atom->nmax;
     memory->create(part2grid,nmax,3,"pppm:part2grid");
- 	delete cu_part2grid;
- 	delete [] adev_data_array;
- 	adev_data_array=new dev_array[1];
- 	cu_part2grid = new cCudaData<int  , int   , yx > ((int*)part2grid,adev_data_array, nmax,3);
+         delete cu_part2grid;
+         delete [] adev_data_array;
+         adev_data_array=new dev_array[1];
+         cu_part2grid = new cCudaData<int  , int   , yx > ((int*)part2grid,adev_data_array, nmax,3);
 
-  	pppm_device_update(&cuda->shared_data,cu_part2grid->dev_data(),atom->nlocal,atom->nmax);
+          pppm_device_update(&cuda->shared_data,cu_part2grid->dev_data(),atom->nlocal,atom->nmax);
     old_nmax=nmax;
   }
   if(cu_atom->update_nlocal) {pppm_update_nlocal(cu_atom->nlocal);}
-  
+
   energy = 0.0;
-  if (vflag) 
+  if (vflag)
   {
-  	for (i = 0; i < 6; i++) virial[i] = 0.0;
-  	cu_virial->memset_device(0);
+          for (i = 0; i < 6; i++) virial[i] = 0.0;
+          cu_virial->memset_device(0);
   }
   if(eflag) cu_energy->memset_device(0);
   clock_gettime(CLOCK_REALTIME,&starttotal);
@@ -745,7 +745,7 @@ void PPPMCuda::compute(int eflag, int vflag)
   // all procs communicate density values from their ghost cells
   //   to fully sum contribution in their 3d bricks
   // remap from 3d decomposition to FFT decomposition
-  
+
   int nprocs=comm->nprocs;
 
   clock_gettime(CLOCK_REALTIME,&starttime);
@@ -768,7 +768,7 @@ void PPPMCuda::compute(int eflag, int vflag)
   // compute potential gradient on my FFT grid and
   //   portion of e_long on this proc's FFT grid
   // return gradients (electric fields) in 3d brick decomposition
-  
+
   clock_gettime(CLOCK_REALTIME,&starttime);
   poisson(eflag,vflag);
   clock_gettime(CLOCK_REALTIME,&endtime);
@@ -778,7 +778,7 @@ void PPPMCuda::compute(int eflag, int vflag)
   //   surrounding their 3d bricks
 
   // not necessary since all the calculations are done on one proc
-  
+
   // calculate the force on my particles
 
 
@@ -796,7 +796,7 @@ void PPPMCuda::compute(int eflag, int vflag)
     double energy_all;
     MPI_Allreduce(&energy,&energy_all,1,MPI_DOUBLE,MPI_SUM,world);
     energy = energy_all;
-   
+
     energy *= 0.5*volume;
     energy -= g_ewald*qsqsum/1.772453851 +
       MY_PI2*qsum*qsum / (g_ewald*g_ewald*volume);
@@ -816,15 +816,15 @@ void PPPMCuda::compute(int eflag, int vflag)
   if (slabflag) slabcorr(eflag);
 
   // convert atoms back from lamda to box coords
-  
+
   if (triclinic) domain->lamda2x(atom->nlocal);
-  
+
   if(firstpass) firstpass=false;
 }
 
 
 /* ----------------------------------------------------------------------
-   allocate memory that depends on # of K-vectors and order 
+   allocate memory that depends on # of K-vectors and order
 ------------------------------------------------------------------------- */
 
 
@@ -836,41 +836,41 @@ void PPPMCuda::allocate()
 
 
   memory->create3d_offset(density_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:density_brick");
+                          nxlo_out,nxhi_out,"pppm:density_brick");
   memory->create3d_offset(density_brick_int,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:density_brick_int");
+                          nxlo_out,nxhi_out,"pppm:density_brick_int");
 
 
   cu_density_brick = new cCudaData<double, PPPM_FLOAT, x> ((double*) &(density_brick[nzlo_out][nylo_out][nxlo_out]), & (dev_tmp[n_cudata++]),
-  				   (nzhi_out-nzlo_out+1)*(nyhi_out-nylo_out+1)*(nxhi_out-nxlo_out+1));
+                                     (nzhi_out-nzlo_out+1)*(nyhi_out-nylo_out+1)*(nxhi_out-nxlo_out+1));
 
   cu_density_brick_int = new cCudaData<int, int, x> ((int*) &(density_brick_int[nzlo_out][nylo_out][nxlo_out]), & (dev_tmp[n_cudata++]),
-  				   (nzhi_out-nzlo_out+1)*(nyhi_out-nylo_out+1)*(nxhi_out-nxlo_out+1));
+                                     (nzhi_out-nzlo_out+1)*(nyhi_out-nylo_out+1)*(nxhi_out-nxlo_out+1));
 
   memory->create3d_offset(vdx_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:vdx_brick");
+                          nxlo_out,nxhi_out,"pppm:vdx_brick");
   memory->create3d_offset(vdx_brick_tmp,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:vdx_brick_tmp");
+                          nxlo_out,nxhi_out,"pppm:vdx_brick_tmp");
 
   cu_vdx_brick = new cCudaData<double, PPPM_FLOAT, x> ((double*) &(vdx_brick[nzlo_out][nylo_out][nxlo_out]), & (dev_tmp[n_cudata++]),
-  				   (nzhi_out-nzlo_out+1)*(nyhi_out-nylo_out+1)*(nxhi_out-nxlo_out+1));
+                                     (nzhi_out-nzlo_out+1)*(nyhi_out-nylo_out+1)*(nxhi_out-nxlo_out+1));
 
   memory->create3d_offset(vdy_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:vdy_brick");
+                          nxlo_out,nxhi_out,"pppm:vdy_brick");
   cu_vdy_brick = new cCudaData<double, PPPM_FLOAT, x> ((double*) &(vdy_brick[nzlo_out][nylo_out][nxlo_out]), & (dev_tmp[n_cudata++]),
-  				   (nzhi_out-nzlo_out+1)*(nyhi_out-nylo_out+1)*(nxhi_out-nxlo_out+1));
+                                     (nzhi_out-nzlo_out+1)*(nyhi_out-nylo_out+1)*(nxhi_out-nxlo_out+1));
 
   memory->create3d_offset(vdz_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:vdz_brick");
+                          nxlo_out,nxhi_out,"pppm:vdz_brick");
   cu_vdz_brick = new cCudaData<double, PPPM_FLOAT, x> ((double*) &(vdz_brick[nzlo_out][nylo_out][nxlo_out]), & (dev_tmp[n_cudata++]),
-  				   (nzhi_out-nzlo_out+1)*(nyhi_out-nylo_out+1)*(nxhi_out-nxlo_out+1));
+                                     (nzhi_out-nzlo_out+1)*(nyhi_out-nylo_out+1)*(nxhi_out-nxlo_out+1));
 
   memory->create(density_fft,nfft_both,"pppm:density_fft");
 
   cu_density_fft = new cCudaData<double, PPPM_FLOAT, x> (density_fft, & (dev_tmp[n_cudata++]),nfft_both);
 
-  cu_energy = new cCudaData<double, ENERGY_FLOAT, x> (NULL, &(dev_tmp[n_cudata++]),ny_pppm*nz_pppm);    
-  cu_virial = new cCudaData<double, ENERGY_FLOAT, x> (NULL, &(dev_tmp[n_cudata++]),ny_pppm*nz_pppm*6);    
+  cu_energy = new cCudaData<double, ENERGY_FLOAT, x> (NULL, &(dev_tmp[n_cudata++]),ny_pppm*nz_pppm);
+  cu_virial = new cCudaData<double, ENERGY_FLOAT, x> (NULL, &(dev_tmp[n_cudata++]),ny_pppm*nz_pppm*6);
 
   memory->create(greensfn,nfft_both,"pppm:greensfn");
   cu_greensfn = new cCudaData<double, PPPM_FLOAT, x> (greensfn, & (dev_tmp[n_cudata++]) , nx_pppm*ny_pppm*nz_pppm);
@@ -878,11 +878,11 @@ void PPPMCuda::allocate()
   memory->create(work1,2*nx_pppm*ny_pppm*nz_pppm,"pppm:work1");
   memory->create(work2,2*nx_pppm*ny_pppm*nz_pppm,"pppm:work2");
   memory->create(work3,2*nx_pppm*ny_pppm*nz_pppm,"pppm:work3");
-  
+
   cu_work1 = new cCudaData<double, FFT_FLOAT, x> (work1, & (dev_tmp[n_cudata++]) , 2*nx_pppm*ny_pppm*nz_pppm);
   cu_work2 = new cCudaData<double, FFT_FLOAT, x> (work2, & (dev_tmp[n_cudata++]) , 2*nx_pppm*ny_pppm*nz_pppm);
   cu_work3 = new cCudaData<double, FFT_FLOAT, x> (work3, & (dev_tmp[n_cudata++]) , 2*nx_pppm*ny_pppm*nz_pppm);
-  
+
 
   memory->create(fkx,nx_pppm,"pppmcuda:fkx");
   cu_fkx = new cCudaData<double, PPPM_FLOAT, x> (fkx, & (dev_tmp[n_cudata++]) , nx_pppm);
@@ -912,7 +912,7 @@ void PPPMCuda::allocate()
   debugdata=new PPPM_FLOAT[100];
   cu_debugdata = new cCudaData<PPPM_FLOAT, PPPM_FLOAT, x> (debugdata,& (dev_tmp[n_cudata++]),100);
   cu_flag = new cCudaData<int, int, x> (&global_flag,& (dev_tmp[n_cudata++]),3);
-  
+
   // create 2 FFTs and a Remap
   // 1st FFT keeps data in FFT decompostion
   // 2nd FFT returns data in 3d brick decomposition
@@ -924,39 +924,39 @@ void PPPMCuda::allocate()
 
 
   fft1c = new FFT3dCuda(lmp,world,nx_pppm,ny_pppm,nz_pppm,
-		   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		   0,0,&tmp,true);
+                   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                   0,0,&tmp,true);
 
   fft2c = new FFT3dCuda(lmp,world,nx_pppm,ny_pppm,nz_pppm,
-		   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		   nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
-		   0,0,&tmp,false);
+                   nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                   nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
+                   0,0,&tmp,false);
 
- 
-#ifdef FFT_CUFFT  
+
+#ifdef FFT_CUFFT
   fft1c->set_cudata(cu_work2->dev_data(),cu_work1->dev_data());
   fft2c->set_cudata(cu_work2->dev_data(),cu_work3->dev_data());
 #endif
 
   remap = new Remap(lmp,world,
-		    nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
-		    nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
-		    1,0,0,2);
+                    nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,
+                    nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,
+                    1,0,0,2);
 
 
 pppm_device_init(cu_density_brick->dev_data(), cu_vdx_brick->dev_data(), cu_vdy_brick->dev_data(), cu_vdz_brick->dev_data(), cu_density_fft->dev_data(),cu_energy->dev_data(),cu_virial->dev_data()
-	    , cu_work1->dev_data(), cu_work2->dev_data(), cu_work3->dev_data(), cu_greensfn->dev_data(), cu_fkx->dev_data(), cu_fky->dev_data(), cu_fkz->dev_data(), cu_vg->dev_data()
-	    ,nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out,nx_pppm,ny_pppm,nz_pppm
-	    ,nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,cu_gf_b->dev_data()
-	    ,qqrd2e,order,cu_rho_coeff->dev_data(),cu_debugdata->dev_data(),cu_density_brick_int->dev_data(),slabflag
-	 );  
+            , cu_work1->dev_data(), cu_work2->dev_data(), cu_work3->dev_data(), cu_greensfn->dev_data(), cu_fkx->dev_data(), cu_fky->dev_data(), cu_fkz->dev_data(), cu_vg->dev_data()
+            ,nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in,nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out,nx_pppm,ny_pppm,nz_pppm
+            ,nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,cu_gf_b->dev_data()
+            ,qqrd2e,order,cu_rho_coeff->dev_data(),cu_debugdata->dev_data(),cu_density_brick_int->dev_data(),slabflag
+         );
 }
 
 
 
 /* ----------------------------------------------------------------------
-   deallocate memory that depends on # of K-vectors and order 
+   deallocate memory that depends on # of K-vectors and order
  ---------------------------------------------------------------------- */
 
 void PPPMCuda::deallocate()
@@ -965,7 +965,7 @@ void PPPMCuda::deallocate()
   memory->destroy3d_offset(vdx_brick,nzlo_out,nylo_out,nxlo_out);
   memory->destroy3d_offset(vdy_brick,nzlo_out,nylo_out,nxlo_out);
   memory->destroy3d_offset(vdz_brick,nzlo_out,nylo_out,nxlo_out);
-  
+
   density_brick = vdx_brick = vdy_brick = vdz_brick = NULL;
 
   memory->destroy(density_fft);
@@ -996,7 +996,7 @@ void PPPMCuda::deallocate()
   delete cu_density_fft;
   delete cu_energy;
   delete cu_virial;
-#ifdef FFT_CUFFT 
+#ifdef FFT_CUFFT
   delete cu_greensfn;
   delete cu_gf_b;
   delete cu_vg;
@@ -1012,7 +1012,7 @@ void PPPMCuda::deallocate()
   delete cu_debugdata;
   delete cu_rho_coeff;
 
-  
+
   cu_vdx_brick = cu_vdy_brick = cu_vdz_brick = NULL;
   cu_density_brick = NULL;
   cu_density_brick_int = NULL;
@@ -1026,12 +1026,12 @@ void PPPMCuda::deallocate()
   cu_vg = NULL;
   cu_fkx = cu_fky = cu_fkz = NULL;
 #endif
-  
+
   cu_flag = NULL;
   cu_debugdata = NULL;
   cu_rho_coeff = NULL;
   cu_part2grid = NULL;
-  
+
   memory->destroy(buf1);
   memory->destroy(buf2);
 
@@ -1052,7 +1052,7 @@ void PPPMCuda::deallocate()
 }
 
 /* ----------------------------------------------------------------------
-   set size of FFT grid (nx,ny,nz_pppm) and g_ewald 
+   set size of FFT grid (nx,ny,nz_pppm) and g_ewald
 -------------------------------------------------------------------------*/
 
 void PPPMCuda::set_grid()
@@ -1103,7 +1103,7 @@ void PPPMCuda::set_grid()
   double yprd = domain->yprd;
   double zprd = domain->zprd;
   double zprd_slab = zprd*slab_volfactor;
-  
+
   // make initial g_ewald estimate
   // based on desired error and real space cutoff
   // fluid-occupied volume used to estimate real-space error
@@ -1113,7 +1113,7 @@ void PPPMCuda::set_grid()
 
   if (!gewaldflag)
     g_ewald = sqrt(-log(accuracy*sqrt(natoms*cutoff*xprd*yprd*zprd) /
-			(2.0*q2))) / cutoff;
+                        (2.0*q2))) / cutoff;
 
   // set optimal nx_pppm,ny_pppm,nz_pppm based on order and precision
   // nz_pppm uses extended zprd_slab instead of zprd
@@ -1122,7 +1122,7 @@ void PPPMCuda::set_grid()
 
   if (!gridflag) {
     double err;
-    h_x = h_y = h_z = 1/g_ewald;  
+    h_x = h_y = h_z = 1/g_ewald;
 
     nx_pppm = static_cast<int> (xprd/h_x + 1);
     ny_pppm = static_cast<int> (yprd/h_y + 1);
@@ -1156,7 +1156,7 @@ void PPPMCuda::set_grid()
   while (!factorable(ny_pppm)) ny_pppm++;
   while (!factorable(nz_pppm)) nz_pppm++;
 
-  
+
   // adjust g_ewald for new grid size
 
   h_x = xprd/nx_pppm;
@@ -1182,7 +1182,7 @@ void PPPMCuda::set_grid()
     while (fabs(dgew) > SMALL && fmid != 0.0) {
       dgew *= 0.5;
       g_ewald = rtb + dgew;
-      fmid = diffpr(h_x,h_y,h_z,q2,acons);      
+      fmid = diffpr(h_x,h_y,h_z,q2,acons);
       if (fmid <= 0.0) rtb = g_ewald;
       ncount++;
       if (ncount > LARGE) error->all(FLERR,"Cannot compute PPPMCuda G");
@@ -1195,7 +1195,7 @@ void PPPMCuda::set_grid()
   double lpry = rms(h_y,yprd,natoms,q2,acons);
   double lprz = rms(h_z,zprd_slab,natoms,q2,acons);
   double lpr = sqrt(lprx*lprx + lpry*lpry + lprz*lprz) / sqrt(3.0);
-  double spr = 2.0*q2 * exp(-g_ewald*g_ewald*cutoff*cutoff) / 
+  double spr = 2.0*q2 * exp(-g_ewald*g_ewald*cutoff*cutoff) /
     sqrt(natoms*cutoff*xprd*yprd*zprd_slab);
 
   // free local memory
@@ -1211,7 +1211,7 @@ void PPPMCuda::set_grid()
       fprintf(screen,"  stencil order = %d\n",order);
       fprintf(screen,"  absolute RMS force accuracy = %g\n",MAX(lpr,spr));
       fprintf(screen,"  relative force accuracy = %g\n",
-	      MAX(lpr,spr)/two_charge_force);
+              MAX(lpr,spr)/two_charge_force);
     }
     if (logfile) {
       fprintf(logfile,"  G vector = %g\n",g_ewald);
@@ -1219,7 +1219,7 @@ void PPPMCuda::set_grid()
       fprintf(logfile,"  stencil order = %d\n",order);
       fprintf(logfile,"  absolute RMS force accuracy = %g\n",MAX(lpr,spr));
       fprintf(logfile,"  relative force accuracy = %g\n",
-	      MAX(lpr,spr)/two_charge_force);
+              MAX(lpr,spr)/two_charge_force);
     }
   }
 }
@@ -1228,13 +1228,13 @@ void PPPMCuda::set_grid()
 /* ----------------------------------------------------------------------
    find center grid pt for each of my particles
    check that full stencil for the particle will fit in my 3d brick
-   store central grid pt indices in part2grid array 
+   store central grid pt indices in part2grid array
 ------------------------------------------------------------------------- */
 
 
 void PPPMCuda::particle_map()
 {
-  MYDBG(printf("# CUDA PPPMCuda::particle_map() ... start\n");) 
+  MYDBG(printf("# CUDA PPPMCuda::particle_map() ... start\n");)
   int flag = 0;
 
     cu_flag->memset_device(0);
@@ -1249,25 +1249,25 @@ void PPPMCuda::particle_map()
        printf("z: %e ",debugdata[9]);
        printf("nx: %e ",debugdata[4]);
        printf("ny: %e ",debugdata[5]);
-       
+
       printf("\n");
       //printf("debugdata: cpu: %e %e %e %i\n",boxlo[0],boxlo[1],boxlo[2],atom->nlocal);
       cuda->cu_x->download();
-  	  int nx,ny,nz;
+            int nx,ny,nz;
 
-  	  double **x = atom->x;
+            double **x = atom->x;
       int nlocal = atom->nlocal;
-  	  for (int i = 0; i < nlocal; i++) {
+            for (int i = 0; i < nlocal; i++) {
         nx = static_cast<int> ((x[i][0]-boxlo[0])*delxinv+shift) - OFFSET;
         ny = static_cast<int> ((x[i][1]-boxlo[1])*delyinv+shift) - OFFSET;
-      	nz = static_cast<int> ((x[i][2]-boxlo[2])*delzinv+shift) - OFFSET;
-
-	    if(i==1203)printf("Outside Atom: %i %e %e %e (%i %i %i)\n",i,x[i][0],x[i][1],x[i][2],nx,ny,nz);
-    	if (nx+nlower < nxlo_out || nx+nupper > nxhi_out ||
-		ny+nlower < nylo_out || ny+nupper > nyhi_out ||
-		nz+nlower < nzlo_out || nz+nupper > nzhi_out || i==1203) {printf("Outside Atom: %i %e %e %e (%i %i %i)\n",i,x[i][0],x[i][1],x[i][2],nx,ny,nz); }
-  	  }
-      
+              nz = static_cast<int> ((x[i][2]-boxlo[2])*delzinv+shift) - OFFSET;
+
+            if(i==1203)printf("Outside Atom: %i %e %e %e (%i %i %i)\n",i,x[i][0],x[i][1],x[i][2],nx,ny,nz);
+            if (nx+nlower < nxlo_out || nx+nupper > nxhi_out ||
+                ny+nlower < nylo_out || ny+nupper > nyhi_out ||
+                nz+nlower < nzlo_out || nz+nupper > nzhi_out || i==1203) {printf("Outside Atom: %i %e %e %e (%i %i %i)\n",i,x[i][0],x[i][1],x[i][2],nx,ny,nz); }
+            }
+
     }
 
   int flag_all;
@@ -1279,7 +1279,7 @@ void PPPMCuda::particle_map()
    create discretized "density" on section of global grid due to my particles
    density(x,y,z) = charge "density" at grid points of my 3d brick
    (nxlo:nxhi,nylo:nyhi,nzlo:nzhi) is extent of my brick (including ghosts)
-   in global grid 
+   in global grid
 ------------------------------------------------------------------------- */
 
 
@@ -1290,7 +1290,7 @@ void PPPMCuda::make_rho()
 
 
 /* ----------------------------------------------------------------------
-   FFT-based Poisson solver 
+   FFT-based Poisson solver
 ------------------------------------------------------------------------- */
 void PPPMCuda::poisson(int eflag, int vflag)
 {
@@ -1302,27 +1302,27 @@ void PPPMCuda::poisson(int eflag, int vflag)
 #ifdef FFT_CUFFT
   timespec starttime;
   timespec endtime;
-  
+
 
   clock_gettime(CLOCK_REALTIME,&starttime);
   fft1c->compute(density_fft,work1,1);
-  
+
   clock_gettime(CLOCK_REALTIME,&endtime);
   poissontime+=(endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000);
 
 
-  
+
   if (eflag || vflag) {
     poisson_energy(nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft,vflag);
     ENERGY_FLOAT gpuvirial[6];
     energy+=sum_energy(cu_virial->dev_data(),cu_energy->dev_data(),nx_pppm,ny_pppm,nz_pppm,vflag,gpuvirial);
-    if(vflag) 
+    if(vflag)
     {
       for(int j=0;j<6;j++) virial[j]+=gpuvirial[j];
     }
   }
-  
-  
+
+
   // scale by 1/total-grid-pts to get rho(k)
   // multiply by Green's function to get V(k)
 
@@ -1333,8 +1333,8 @@ void PPPMCuda::poisson(int eflag, int vflag)
   // copy it into inner portion of vdx,vdy,vdz arrays
 
   // x direction gradient
-  
-  
+
+
   poisson_xgrad(nx_pppm,ny_pppm,nz_pppm);
 
 
@@ -1342,10 +1342,10 @@ void PPPMCuda::poisson(int eflag, int vflag)
   fft2c->compute(work2,work2,-1);
   clock_gettime(CLOCK_REALTIME,&endtime);
   poissontime+=(endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000);
-  
+
   poisson_vdx_brick(nxhi_out,nxlo_out,nyhi_out,nylo_out,nzhi_out,nzlo_out,nx_pppm,ny_pppm,nz_pppm);
-  
-  
+
+
   // y direction gradient
 
   poisson_ygrad(nx_pppm,ny_pppm,nz_pppm);
@@ -1356,7 +1356,7 @@ void PPPMCuda::poisson(int eflag, int vflag)
   poissontime+=(endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000);
 
   poisson_vdy_brick(nxhi_out,nxlo_out,nyhi_out,nylo_out,nzhi_out,nzlo_out,nx_pppm,ny_pppm,nz_pppm);
-      
+
   // z direction gradient
 
   poisson_zgrad(nx_pppm,ny_pppm,nz_pppm);
@@ -1371,7 +1371,7 @@ void PPPMCuda::poisson(int eflag, int vflag)
 }
 
 /*----------------------------------------------------------------------
-   interpolate from grid to get electric field & force on my particles 
+   interpolate from grid to get electric field & force on my particles
 -------------------------------------------------------------------------*/
 
 void PPPMCuda::fieldforce()
@@ -1429,30 +1429,30 @@ void PPPMCuda::slabcorr(int eflag)
   // compute local contribution to global dipole moment
   if(slabbuf==NULL)
   {
-  	slabbuf=new ENERGY_FLOAT[(atom->nmax+31)/32];
-  	cu_slabbuf = new cCudaData<ENERGY_FLOAT,ENERGY_FLOAT, x> (slabbuf, (atom->nmax+31)/32);
+          slabbuf=new ENERGY_FLOAT[(atom->nmax+31)/32];
+          cu_slabbuf = new cCudaData<ENERGY_FLOAT,ENERGY_FLOAT, x> (slabbuf, (atom->nmax+31)/32);
   }
   if(unsigned((atom->nlocal+31)/32)*sizeof(ENERGY_FLOAT)>=unsigned(cu_slabbuf->dev_size()))
   {
-  	delete [] slabbuf;
-  	delete cu_slabbuf;
-  	slabbuf=new ENERGY_FLOAT[(atom->nmax+31)/32];
-  	cu_slabbuf = new cCudaData<ENERGY_FLOAT,ENERGY_FLOAT, x> (slabbuf, (atom->nmax+31)/32);
+          delete [] slabbuf;
+          delete cu_slabbuf;
+          slabbuf=new ENERGY_FLOAT[(atom->nmax+31)/32];
+          cu_slabbuf = new cCudaData<ENERGY_FLOAT,ENERGY_FLOAT, x> (slabbuf, (atom->nmax+31)/32);
   }
-  
-  
+
+
   double dipole = cuda_slabcorr_energy(&cuda->shared_data,slabbuf,(ENERGY_FLOAT*) cu_slabbuf->dev_data());
 
   double dipole_all;
   MPI_Allreduce(&dipole,&dipole_all,1,MPI_DOUBLE,MPI_SUM,world);
 
   // compute corrections
-  
+
   double e_slabcorr = 2.0*MY_PI*dipole_all*dipole_all/volume;
-  
+
   if (eflag) energy += qqrd2e*scale * e_slabcorr;
-  
-  double ffact = -4.0*MY_PI*dipole_all/volume; 
- 
+
+  double ffact = -4.0*MY_PI*dipole_all/volume;
+
   cuda_slabcorr_force(&cuda->shared_data,ffact);
 }
diff --git a/src/USER-CUDA/pppm_cuda.h b/src/USER-CUDA/pppm_cuda.h
index ac12cd9623..2237155a11 100644
--- a/src/USER-CUDA/pppm_cuda.h
+++ b/src/USER-CUDA/pppm_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -51,7 +51,7 @@ class PPPMCuda : public PPPM {
   class Cuda *cuda;
   class FFT3dCuda *fft1c,*fft2c;
   double* work3;
- 
+
   cCudaData<double     , FFT_FLOAT      , x >* cu_work1;
   cCudaData<double     , FFT_FLOAT      , x >* cu_work2;
   cCudaData<double     , FFT_FLOAT      , x >* cu_work3;
@@ -62,39 +62,39 @@ class PPPMCuda : public PPPM {
   cCudaData<double     , PPPM_FLOAT     , x >* cu_fkz;
   cCudaData<double     , PPPM_FLOAT     , xy>* cu_vg;
   cCudaData<double     , PPPM_FLOAT     , x >* cu_density_brick;
-  cCudaData<int        , int     		, x >* cu_density_brick_int;
+  cCudaData<int        , int                     , x >* cu_density_brick_int;
   cCudaData<double     , PPPM_FLOAT     , x >* cu_vdx_brick;
   cCudaData<double     , PPPM_FLOAT     , x >* cu_vdy_brick;
   cCudaData<double     , PPPM_FLOAT     , x >* cu_vdz_brick;
   cCudaData<double     , PPPM_FLOAT     , x >* cu_density_fft;
   cCudaData<double     , ENERGY_FLOAT   , x >* cu_energy;
   cCudaData<double     , ENERGY_FLOAT   , x >* cu_virial;
-  cCudaData<double     , X_FLOAT   		, yx>* cu_x;
-  cCudaData<double     , V_FLOAT   		, yx>* cu_v;
-  cCudaData<double     , F_FLOAT   		, yx>* cu_f;	
-  cCudaData<double     , F_FLOAT   		, yx>* cu_q;	
-  cCudaData<int        , int   			, yx>* cu_part2grid;	
-  cCudaData<double	   , PPPM_FLOAT		, x >* cu_rho_coeff;
-  cCudaData<PPPM_FLOAT , PPPM_FLOAT		, x >* cu_debugdata;
-  cCudaData<int        , int   			, x >* cu_flag;	
-  cCudaData<int        , int   			, x >* cu_pppm_grid_n;	
-  cCudaData<int        , int   			, x >* cu_pppm_grid_ids;	
-  
+  cCudaData<double     , X_FLOAT                   , yx>* cu_x;
+  cCudaData<double     , V_FLOAT                   , yx>* cu_v;
+  cCudaData<double     , F_FLOAT                   , yx>* cu_f;
+  cCudaData<double     , F_FLOAT                   , yx>* cu_q;
+  cCudaData<int        , int                           , yx>* cu_part2grid;
+  cCudaData<double           , PPPM_FLOAT                , x >* cu_rho_coeff;
+  cCudaData<PPPM_FLOAT , PPPM_FLOAT                , x >* cu_debugdata;
+  cCudaData<int        , int                           , x >* cu_flag;
+  cCudaData<int        , int                           , x >* cu_pppm_grid_n;
+  cCudaData<int        , int                           , x >* cu_pppm_grid_ids;
+
   ENERGY_FLOAT* slabbuf;
   cCudaData<ENERGY_FLOAT, ENERGY_FLOAT, x >* cu_slabbuf;
-  
+
   int*** density_brick_int;
   PPPM_FLOAT density_intScale;
   int pppm_grid_nmax;
   int* pppm2partgrid;
-  int* pppm_grid; 
+  int* pppm_grid;
   PPPM_FLOAT* debugdata;
   bool firstpass;
-  
+
   void set_grid();
   void allocate();
   void deallocate();
-  
+
   virtual void particle_map();
   virtual void make_rho();
   void poisson(int, int);
diff --git a/src/USER-CUDA/verlet_cuda.cpp b/src/USER-CUDA/verlet_cuda.cpp
index 4079f3a6c5..a1df9fe3f0 100644
--- a/src/USER-CUDA/verlet_cuda.cpp
+++ b/src/USER-CUDA/verlet_cuda.cpp
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -58,12 +58,12 @@ using namespace LAMMPS_NS;
 #define MAKETIMEING
 
 
-VerletCuda::VerletCuda(LAMMPS *lmp, int narg, char **arg) : Verlet(lmp, narg, arg) {	
+VerletCuda::VerletCuda(LAMMPS *lmp, int narg, char **arg) : Verlet(lmp, narg, arg) {
   cuda = lmp->cuda;
    if(cuda == NULL)
         error->all(FLERR,"You cannot use a /cuda class, without activating 'cuda' acceleration. Provide '-c on' as command-line argument to LAMMPS..");
 
-	modify_cuda=(ModifyCuda*) modify;
+        modify_cuda=(ModifyCuda*) modify;
     int ifix = modify->find_fix("package_omp");
     if (ifix >= 0) external_force_clear = 1;
 }
@@ -74,44 +74,44 @@ VerletCuda::VerletCuda(LAMMPS *lmp, int narg, char **arg) : Verlet(lmp, narg, ar
 
 void VerletCuda::setup()
 {
-	//debug related variables
-	cuda->debugdata[0]=0;
-	cuda->cu_debugdata->upload();
-	dotestatom=cuda->dotestatom;
-	int testatom=cuda->testatom;//48267;
-	if(atom->nlocal==0)
-		error->warning(FLERR,"# CUDA: There are currently no atoms on one of the MPI processes. This is known to cause errors with the USER-CUDA package. Please use the 'processors' keyword to enforce more balanced processor layout.");
-	MYDBG(printf("# CUDA VerletCuda::setup start\n"); )
-
-	cuda->oncpu = true;
-	cuda->begin_setup = true;
-	cuda->finished_run = false;
-	
-	time_pair=0;
-	time_kspace=0;
-	time_comm=0;
-	time_modify=0;
-	time_fulliterate=0;
-		
+        //debug related variables
+        cuda->debugdata[0]=0;
+        cuda->cu_debugdata->upload();
+        dotestatom=cuda->dotestatom;
+        int testatom=cuda->testatom;//48267;
+        if(atom->nlocal==0)
+                error->warning(FLERR,"# CUDA: There are currently no atoms on one of the MPI processes. This is known to cause errors with the USER-CUDA package. Please use the 'processors' keyword to enforce more balanced processor layout.");
+        MYDBG(printf("# CUDA VerletCuda::setup start\n"); )
+
+        cuda->oncpu = true;
+        cuda->begin_setup = true;
+        cuda->finished_run = false;
+
+        time_pair=0;
+        time_kspace=0;
+        time_comm=0;
+        time_modify=0;
+        time_fulliterate=0;
+
     atom->setup();
-	
-	cuda_shared_atom*   cu_atom   = & cuda->shared_data.atom;
-	cuda_shared_domain* cu_domain = & cuda->shared_data.domain;
-	cuda_shared_pair*   cu_pair   = & cuda->shared_data.pair;
-	cu_atom->update_nlocal=1;
-	cu_atom->update_nmax=1;
-	
-	if(atom->molecular||(force->kspace&&(not cuda->shared_data.pppm.cudable_force))) cuda->shared_data.pair.collect_forces_later = true;
-
-	cuda->setDomainParams();
-	
-
-	if(cuda->shared_data.me==0)
-	printf("# CUDA: VerletCuda::setup: Allocate memory on device for maximum of %i atoms...\n", atom->nmax);
-	if(cuda->shared_data.me==0)
-	printf("# CUDA: Using precision: Global: %u X: %u V: %u F: %u PPPM: %u \n", CUDA_PRECISION==1?4:8,sizeof(X_FLOAT),sizeof(V_FLOAT),sizeof(F_FLOAT),sizeof(PPPM_FLOAT));
-	cuda->allocate();
-	
+
+        cuda_shared_atom*   cu_atom   = & cuda->shared_data.atom;
+        cuda_shared_domain* cu_domain = & cuda->shared_data.domain;
+        cuda_shared_pair*   cu_pair   = & cuda->shared_data.pair;
+        cu_atom->update_nlocal=1;
+        cu_atom->update_nmax=1;
+
+        if(atom->molecular||(force->kspace&&(not cuda->shared_data.pppm.cudable_force))) cuda->shared_data.pair.collect_forces_later = true;
+
+        cuda->setDomainParams();
+
+
+        if(cuda->shared_data.me==0)
+        printf("# CUDA: VerletCuda::setup: Allocate memory on device for maximum of %i atoms...\n", atom->nmax);
+        if(cuda->shared_data.me==0)
+        printf("# CUDA: Using precision: Global: %u X: %u V: %u F: %u PPPM: %u \n", CUDA_PRECISION==1?4:8,sizeof(X_FLOAT),sizeof(V_FLOAT),sizeof(F_FLOAT),sizeof(PPPM_FLOAT));
+        cuda->allocate();
+
 
   if (comm->me == 0 && screen) fprintf(screen,"Setting up run ...\n");
 
@@ -140,7 +140,7 @@ void VerletCuda::setup()
 
   if(atom->mass)
   cuda->cu_mass->upload();
- 
+
   if(cuda->cu_map_array)
   cuda->cu_map_array->upload();
 
@@ -157,7 +157,7 @@ void VerletCuda::setup()
   #ifdef NO_PREC_TIMING
     double startsec,endsec;
   #endif
- 	//if(atom->molecular||(force->kspace&&(not cuda->shared_data.pppm.cudable_force))) cuda->shared_data.pair.collect_forces_later = false;
+         //if(atom->molecular||(force->kspace&&(not cuda->shared_data.pppm.cudable_force))) cuda->shared_data.pair.collect_forces_later = false;
    if(test_BpA_vs_TpA && cuda->shared_data.pair.cudable_force && force->pair &&(cuda->shared_data.pair.override_block_per_atom<0))
    {
      int StyleLoops=10;
@@ -166,10 +166,10 @@ void VerletCuda::setup()
      cuda->shared_data.pair.use_block_per_atom = 0;
      neighbor->build();
      Cuda_Pair_GenerateXType(&cuda->shared_data);
-	 if(cuda->cu_v_radius) 
-	   Cuda_Pair_GenerateVRadius(&cuda->shared_data);
-	 if(cuda->cu_omega_rmass) 
-	   Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
+         if(cuda->cu_v_radius)
+           Cuda_Pair_GenerateVRadius(&cuda->shared_data);
+         if(cuda->cu_omega_rmass)
+           Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
      force->pair->compute(eflag,vflag);
        CudaWrapper_Sync();
      #ifdef NO_PREC_TIMING
@@ -178,17 +178,17 @@ void VerletCuda::setup()
      clock_gettime(CLOCK_REALTIME,&starttime);
      for(int i=0;i<StyleLoops;i++)
      {
-	   Cuda_Pair_GenerateXType(&cuda->shared_data);
-	   if(cuda->cu_v_radius) 
-	     Cuda_Pair_GenerateVRadius(&cuda->shared_data);
-	   if(cuda->cu_omega_rmass) 
-	     Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
+           Cuda_Pair_GenerateXType(&cuda->shared_data);
+           if(cuda->cu_v_radius)
+             Cuda_Pair_GenerateVRadius(&cuda->shared_data);
+           if(cuda->cu_omega_rmass)
+             Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
        force->pair->compute(eflag,vflag);
        CudaWrapper_Sync();
      }
      clock_gettime(CLOCK_REALTIME,&endtime);
-     
-  	 double TpAtime=endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+
+           double TpAtime=endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
      #ifdef NO_PREC_TIMING
        endsec = 1.0*clock()/CLOCKS_PER_SEC;
        TpAtime = endsec - startsec;
@@ -198,10 +198,10 @@ void VerletCuda::setup()
      cuda->shared_data.pair.use_block_per_atom = 1;
      neighbor->build();
      Cuda_Pair_GenerateXType(&cuda->shared_data);
-	 if(cuda->cu_v_radius) 
-	   Cuda_Pair_GenerateVRadius(&cuda->shared_data);
-	 if(cuda->cu_omega_rmass) 
-	   Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
+         if(cuda->cu_v_radius)
+           Cuda_Pair_GenerateVRadius(&cuda->shared_data);
+         if(cuda->cu_omega_rmass)
+           Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
      force->pair->compute(eflag,vflag);
        CudaWrapper_Sync();
 
@@ -211,26 +211,26 @@ void VerletCuda::setup()
      #endif
      for(int i=0;i<StyleLoops;i++)
      {
-	   Cuda_Pair_GenerateXType(&cuda->shared_data);
-	   if(cuda->cu_v_radius) 
-	     Cuda_Pair_GenerateVRadius(&cuda->shared_data);
-	   if(cuda->cu_omega_rmass) 
-	     Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
+           Cuda_Pair_GenerateXType(&cuda->shared_data);
+           if(cuda->cu_v_radius)
+             Cuda_Pair_GenerateVRadius(&cuda->shared_data);
+           if(cuda->cu_omega_rmass)
+             Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
        force->pair->compute(eflag,vflag);
        CudaWrapper_Sync();
      }
      clock_gettime(CLOCK_REALTIME,&endtime);
-  	 double BpAtime=endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+           double BpAtime=endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
       #ifdef NO_PREC_TIMING
        endsec = 1.0*clock()/CLOCKS_PER_SEC;
        BpAtime = endsec - startsec;
      #endif
-  	 
-	if(cuda->shared_data.me==0)
-  	 printf("\n# CUDA: Timing of parallelisation layout with %i loops:\n",StyleLoops);
-	if(cuda->shared_data.me==0)
-  	 printf("# CUDA: BpA TpA\n %lf %lf\n",BpAtime,TpAtime);
-  	 if(BpAtime>TpAtime) cuda->shared_data.pair.use_block_per_atom = 0;
+
+        if(cuda->shared_data.me==0)
+           printf("\n# CUDA: Timing of parallelisation layout with %i loops:\n",StyleLoops);
+        if(cuda->shared_data.me==0)
+           printf("# CUDA: BpA TpA\n %lf %lf\n",BpAtime,TpAtime);
+           if(BpAtime>TpAtime) cuda->shared_data.pair.use_block_per_atom = 0;
    }
    else
    cuda->shared_data.pair.use_block_per_atom = cuda->shared_data.pair.override_block_per_atom;
@@ -238,7 +238,7 @@ void VerletCuda::setup()
    if(atom->molecular||(force->kspace&&(not cuda->shared_data.pppm.cudable_force))) cuda->shared_data.pair.collect_forces_later = true;
    neighbor->build();
    neighbor->ncalls = 0;
-   
+
    force_clear();
 
    modify->setup_pre_force(vflag);
@@ -246,38 +246,38 @@ void VerletCuda::setup()
    cuda->cu_f->download();
    if(cuda->cu_torque)
    cuda->cu_torque->download();
-   
+
   //printf("# Verlet::setup: g f[0] = (%f, %f, %f)\n", atom->f[0][0], atom->f[0][1], atom->f[0][2]);
-  
+
   MYDBG( printf("# CUDA: VerletCuda::setup: initial force compute\n"); )
 
   //test_atom(testatom,"pre pair force");
-    
+
   if(cuda->shared_data.pair.cudable_force)
   {
-	cuda->uploadAll();
-	Cuda_Pair_GenerateXType(&cuda->shared_data);
-	if(cuda->cu_v_radius) 
-	Cuda_Pair_GenerateVRadius(&cuda->shared_data);
-	if(cuda->cu_omega_rmass) 
-	Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
+        cuda->uploadAll();
+        Cuda_Pair_GenerateXType(&cuda->shared_data);
+        if(cuda->cu_v_radius)
+        Cuda_Pair_GenerateVRadius(&cuda->shared_data);
+        if(cuda->cu_omega_rmass)
+        Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
   }
 
   if (force->pair) force->pair->compute(eflag,vflag);
-  
+
   if(cuda->shared_data.pair.cudable_force)
   {
-	if(cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->upload();
-	  if(eflag) cuda->cu_eng_coul->upload();
-	  if(vflag) cuda->cu_virial->upload();
+        if(cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->upload();
+          if(eflag) cuda->cu_eng_coul->upload();
+          if(vflag) cuda->cu_virial->upload();
       Cuda_Pair_CollectForces(&cuda->shared_data,eflag,vflag);
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
-	}		
-	cuda->downloadAll();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
+        }
+        cuda->downloadAll();
   }
 
   test_atom(testatom,"post pair force");
@@ -295,12 +295,12 @@ void VerletCuda::setup()
 
   if(cuda->shared_data.pppm.cudable_force)
   {
-	cuda->cu_tag ->upload();
-	cuda->cu_type->upload();
-	cuda->cu_x   ->upload();
-	cuda->cu_v   ->upload();
-	cuda->cu_f   ->upload();
-	if(cu_atom->q_flag) cuda->cu_q->upload();
+        cuda->cu_tag ->upload();
+        cuda->cu_type->upload();
+        cuda->cu_x   ->upload();
+        cuda->cu_v   ->upload();
+        cuda->cu_f   ->upload();
+        if(cu_atom->q_flag) cuda->cu_q->upload();
   }
   if (force->kspace) {
     force->kspace->setup();
@@ -308,9 +308,9 @@ void VerletCuda::setup()
   }
   if(cuda->shared_data.pppm.cudable_force)
   {
-	cuda->cu_f   ->download();
+        cuda->cu_f   ->download();
   }
-  
+
   test_atom(testatom,"post kspace");
 
   cuda->uploadAll();
@@ -318,7 +318,7 @@ void VerletCuda::setup()
   cuda->downloadAll();
 
   test_atom(testatom,"post reverse comm");
-  
+
  if(cuda->shared_data.me==0)
   printf("# CUDA: Total Device Memory useage post setup: %lf MB\n",1.0*CudaWrapper_CheckMemUseage()/1024/1024);
 
@@ -329,7 +329,7 @@ void VerletCuda::setup()
   output->setup(1);
 
   test_atom(testatom,"post setup");
-  
+
   MYDBG( printf("# CUDA: VerletCuda::setup: done\n"); )
   cuda->finished_setup = true;
   cuda->oncpu = false;
@@ -340,38 +340,38 @@ void VerletCuda::setup()
 void VerletCuda::setup_minimal(int flag)
 {
 
-	
-	dotestatom=0;
-	int testatom=104;
-	cuda->oncpu = true;
-	cuda->begin_setup = true;
-	cuda->finished_run = false;
-	MYDBG(printf("# CUDA VerletCuda::setup start\n"); )
-	    time_pair=0;
-	    time_kspace=0;
-	    time_comm=0;
-	    time_modify=0;
-		time_fulliterate=0;
-		
-	//cuda->allocate();
-	
-	cuda_shared_atom*   cu_atom   = & cuda->shared_data.atom;
-	cuda_shared_domain* cu_domain = & cuda->shared_data.domain;
-	cuda_shared_pair*   cu_pair   = & cuda->shared_data.pair;
-	cu_atom->update_nlocal=1;
-	cu_atom->update_nmax=1;
-	
-	if(atom->molecular) cuda->shared_data.pair.collect_forces_later = true;
-
-	cuda->setDomainParams();
-	
-
-
-	if(cuda->shared_data.me==0)
-	printf("# CUDA: VerletCuda::setup: Allocate memory on device for maximum of %i atoms...\n", atom->nmax);
-	cuda->allocate();
-	
-	
+
+        dotestatom=0;
+        int testatom=104;
+        cuda->oncpu = true;
+        cuda->begin_setup = true;
+        cuda->finished_run = false;
+        MYDBG(printf("# CUDA VerletCuda::setup start\n"); )
+            time_pair=0;
+            time_kspace=0;
+            time_comm=0;
+            time_modify=0;
+                time_fulliterate=0;
+
+        //cuda->allocate();
+
+        cuda_shared_atom*   cu_atom   = & cuda->shared_data.atom;
+        cuda_shared_domain* cu_domain = & cuda->shared_data.domain;
+        cuda_shared_pair*   cu_pair   = & cuda->shared_data.pair;
+        cu_atom->update_nlocal=1;
+        cu_atom->update_nmax=1;
+
+        if(atom->molecular) cuda->shared_data.pair.collect_forces_later = true;
+
+        cuda->setDomainParams();
+
+
+
+        if(cuda->shared_data.me==0)
+        printf("# CUDA: VerletCuda::setup: Allocate memory on device for maximum of %i atoms...\n", atom->nmax);
+        cuda->allocate();
+
+
 
 
   // setup domain, communication and neighboring
@@ -393,60 +393,60 @@ void VerletCuda::setup_minimal(int flag)
     neighbor->ncalls = 0;
   }
 
-	if(cuda->shared_data.me==0)
-	printf("# CUDA: VerletCuda::setup: Upload data...\n");
-	cuda->uploadAll();
+        if(cuda->shared_data.me==0)
+        printf("# CUDA: VerletCuda::setup: Upload data...\n");
+        cuda->uploadAll();
     cuda->uploadAllNeighborLists();
- 	if(atom->mass)
- 	cuda->cu_mass->upload();
- 
- 	if(cuda->cu_map_array)
- 	cuda->cu_map_array->upload();
- 
+         if(atom->mass)
+         cuda->cu_mass->upload();
+
+         if(cuda->cu_map_array)
+         cuda->cu_map_array->upload();
+
   // compute all forces
 
   ev_set(update->ntimestep);
   if(elist_atom) cuda->shared_data.atom.need_eatom = 1;
   if(vlist_atom) cuda->shared_data.atom.need_vatom = 1;
   if(elist_atom||vlist_atom) cuda->checkResize();
-   
+
   force_clear();
   cuda->cu_f->download();
-   
+
   //printf("# Verlet::setup: g f[0] = (%f, %f, %f)\n", atom->f[0][0], atom->f[0][1], atom->f[0][2]);
-  
+
   cuda->cu_mass->upload();
   MYDBG( printf("# CUDA: VerletCuda::setup: initial force compute\n"); )
 
   test_atom(testatom,"pre pair force");
-    
+
   if(cuda->shared_data.pair.cudable_force)
   {
-	cuda->uploadAll();
-	Cuda_Pair_GenerateXType(&cuda->shared_data);
-	if(cuda->cu_v_radius) 
-	Cuda_Pair_GenerateVRadius(&cuda->shared_data);
-	if(cuda->cu_omega_rmass) 
-	Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
+        cuda->uploadAll();
+        Cuda_Pair_GenerateXType(&cuda->shared_data);
+        if(cuda->cu_v_radius)
+        Cuda_Pair_GenerateVRadius(&cuda->shared_data);
+        if(cuda->cu_omega_rmass)
+        Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
   }
-  
+
   if (force->pair) force->pair->compute(eflag,vflag);
-  
+
   if(cuda->shared_data.pair.cudable_force)
   {
-	if(cuda->shared_data.pair.collect_forces_later)
-	{
-	  if(eflag) cuda->cu_eng_vdwl->upload();
-	  if(eflag) cuda->cu_eng_coul->upload();
-	  if(vflag) cuda->cu_virial->upload();
+        if(cuda->shared_data.pair.collect_forces_later)
+        {
+          if(eflag) cuda->cu_eng_vdwl->upload();
+          if(eflag) cuda->cu_eng_coul->upload();
+          if(vflag) cuda->cu_virial->upload();
       Cuda_Pair_CollectForces(&cuda->shared_data,eflag,vflag);
-	  if(eflag) cuda->cu_eng_vdwl->download();
-	  if(eflag) cuda->cu_eng_coul->download();
-	  if(vflag) cuda->cu_virial->download();
-	}		
-	cuda->downloadAll();
+          if(eflag) cuda->cu_eng_vdwl->download();
+          if(eflag) cuda->cu_eng_coul->download();
+          if(vflag) cuda->cu_virial->download();
+        }
+        cuda->downloadAll();
   }
-  
+
   test_atom(testatom,"post pair force");
 
   MYDBG( printf("# CUDA: VerletCuda::setup: initial force compute done\n"); )
@@ -462,12 +462,12 @@ void VerletCuda::setup_minimal(int flag)
 
   if(cuda->shared_data.pppm.cudable_force)
   {
-	cuda->cu_tag ->upload();
-	cuda->cu_type->upload();
-	cuda->cu_x   ->upload();
-	cuda->cu_v   ->upload();
-	cuda->cu_f   ->upload();
-	if(cu_atom->q_flag) cuda->cu_q->upload();
+        cuda->cu_tag ->upload();
+        cuda->cu_type->upload();
+        cuda->cu_x   ->upload();
+        cuda->cu_v   ->upload();
+        cuda->cu_f   ->upload();
+        if(cu_atom->q_flag) cuda->cu_q->upload();
   }
   if (force->kspace) {
     force->kspace->setup();
@@ -475,9 +475,9 @@ void VerletCuda::setup_minimal(int flag)
   }
   if(cuda->shared_data.pppm.cudable_force)
   {
-	cuda->cu_f   ->download();
+        cuda->cu_f   ->download();
   }
-  
+
   test_atom(testatom,"post kspace");
 
   cuda->uploadAll();
@@ -485,7 +485,7 @@ void VerletCuda::setup_minimal(int flag)
   cuda->downloadAll();
 
   test_atom(testatom,"post reverse comm");
-  
+
  if(cuda->shared_data.me==0)
   printf("# CUDA: Total Device Memory useage post setup: %lf MB\n",1.0*CudaWrapper_CheckMemUseage()/1024/1024);
 
@@ -516,16 +516,16 @@ void VerletCuda::run(int n)
   cuda->setTimingsZero();
 
   static double testtime=0.0;
-//				clock_gettime(CLOCK_REALTIME,&starttime);
-//  				clock_gettime(CLOCK_REALTIME,&endtime);
-//				testtime+=endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
-// 				printf("Time: %lf\n",testtime);*/
+//                                clock_gettime(CLOCK_REALTIME,&starttime);
+//                                  clock_gettime(CLOCK_REALTIME,&endtime);
+//                                testtime+=endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+//                                 printf("Time: %lf\n",testtime);*/
 
 
   cuda_shared_domain* cu_domain = & cuda->shared_data.domain;
 
   int nflag,ntimestep,sortflag;
-		
+
   int n_initial_integrate = modify_cuda->n_initial_integrate;
   int n_post_integrate = modify_cuda->n_post_integrate;
   int n_final_integrate = modify_cuda->n_final_integrate;
@@ -535,37 +535,37 @@ void VerletCuda::run(int n)
   int n_post_force = modify_cuda->n_post_force;
   int n_end_of_step = modify_cuda->n_end_of_step;
   MYDBG(printf("# CUDA: Fixes: i_int: %i p_int: %i f_int: %i pr_exc: %i pr_neigh: %i pr_f: %i p_f: %i eos: %i\n",
-	n_initial_integrate,n_post_integrate,n_final_integrate,n_pre_exchange,n_pre_neighbor,n_pre_force,n_post_force,n_end_of_step);)
+        n_initial_integrate,n_post_integrate,n_final_integrate,n_pre_exchange,n_pre_neighbor,n_pre_force,n_post_force,n_end_of_step);)
 
   if (atom->sortfreq > 0) sortflag = 1;
   else sortflag = 0;
 
 
-	if(cuda->shared_data.me==0)
-	{
-	  if((not cuda->shared_data.pair.cudable_force)&&(force->pair))
-		  error->warning(FLERR,"# CUDA: You asked for a Verlet integration using Cuda, "
-			             "but selected a pair force which has not yet been ported to Cuda");
-	  if((not cuda->shared_data.pppm.cudable_force)&&(force->kspace))
-		  error->warning(FLERR,"# CUDA: You asked for a Verlet integration using Cuda, "
-						 "but selected a kspace force which has not yet been ported to Cuda");
+        if(cuda->shared_data.me==0)
+        {
+          if((not cuda->shared_data.pair.cudable_force)&&(force->pair))
+                  error->warning(FLERR,"# CUDA: You asked for a Verlet integration using Cuda, "
+                                     "but selected a pair force which has not yet been ported to Cuda");
+          if((not cuda->shared_data.pppm.cudable_force)&&(force->kspace))
+                  error->warning(FLERR,"# CUDA: You asked for a Verlet integration using Cuda, "
+                                                 "but selected a kspace force which has not yet been ported to Cuda");
       if(modify_cuda->n_post_integrate_host+modify_cuda->n_pre_exchange_host+modify_cuda->n_pre_neighbor_host+modify_cuda->n_pre_force_host+modify_cuda->n_post_force_host+modify_cuda->n_end_of_step_host+modify_cuda->n_initial_integrate_host+modify_cuda->n_final_integrate_host)
-		  error->warning(FLERR,"# CUDA: You asked for a Verlet integration using Cuda, "
-						 "but several fixes have not yet been ported to Cuda.\n"
-						 "This can cause a severe speed penalty due to frequent data synchronization between host and GPU.");
-	  if(atom->firstgroupname) 
-		  error->warning(FLERR,"Warning: firstgroupname is used, this will cause additional data transfers.");
-	}
+                  error->warning(FLERR,"# CUDA: You asked for a Verlet integration using Cuda, "
+                                                 "but several fixes have not yet been ported to Cuda.\n"
+                                                 "This can cause a severe speed penalty due to frequent data synchronization between host and GPU.");
+          if(atom->firstgroupname)
+                  error->warning(FLERR,"Warning: firstgroupname is used, this will cause additional data transfers.");
+        }
     cuda->uploadAll();
-  
+
   if(cuda->neighbor_decide_by_integrator && cuda->cu_xhold)
   {
-  	 const int n=cuda->shared_data.atom.maxhold;
- 	 CudaWrapper_CopyData(cuda->cu_xhold->dev_data(),cuda->cu_x->dev_data(),n*sizeof(X_FLOAT));
- 	 CudaWrapper_CopyData((void*) &((X_FLOAT*)cuda->cu_xhold->dev_data())[n],(void*) &((X_FLOAT*)cuda->cu_x->dev_data())[atom->nmax],n*sizeof(X_FLOAT));
- 	 CudaWrapper_CopyData((void*) &((X_FLOAT*)cuda->cu_xhold->dev_data())[2*n],(void*) &((X_FLOAT*)cuda->cu_x->dev_data())[2*atom->nmax],n*sizeof(X_FLOAT));
+           const int n=cuda->shared_data.atom.maxhold;
+          CudaWrapper_CopyData(cuda->cu_xhold->dev_data(),cuda->cu_x->dev_data(),n*sizeof(X_FLOAT));
+          CudaWrapper_CopyData((void*) &((X_FLOAT*)cuda->cu_xhold->dev_data())[n],(void*) &((X_FLOAT*)cuda->cu_x->dev_data())[atom->nmax],n*sizeof(X_FLOAT));
+          CudaWrapper_CopyData((void*) &((X_FLOAT*)cuda->cu_xhold->dev_data())[2*n],(void*) &((X_FLOAT*)cuda->cu_x->dev_data())[2*atom->nmax],n*sizeof(X_FLOAT));
   }
-  
+
   cuda->shared_data.atom.reneigh_flag=0;
   cuda->shared_data.atom.update_nlocal=1;
   cuda->shared_data.atom.update_nmax=1;
@@ -576,422 +576,422 @@ void VerletCuda::run(int n)
   cuda->downloadtime=0;
   int firstreneigh=1;
 
-		for(int i = 0; i < n; i++)
-		{
-			if(atom->nlocal==0)
-				error->warning(FLERR,"# CUDA: There are currently no atoms on one of the MPI processes. This is currently prone to encountering errors with USER-CUDA package. Please use the 'processors' keyword to use a more balanced processor layout.");
-			ntimestep = ++update->ntimestep;
-			ev_set(ntimestep);
-			
-			// initial time integration
-				
-			test_atom(testatom,"Pre initial");
-
-			MYDBG( printf("# CUDA VerletCuda::iterate: before initial_integrate\n"); )
- 
- 			modify->initial_integrate(vflag);
-			
-			MYDBG( printf("# CUDA VerletCuda::iterate: after initial_integrate\n"); )
-
-			if(n_post_integrate) modify->post_integrate();
-			
-			
-			
-			// regular communication vs neighbor list rebuild
-			
-			test_atom(testatom,"Pre Exchange");
-			
-			MYDBG( printf("# CUDA VerletCuda::iterate: before neighbor decide\n"); )
-			nflag = neighbor->decide(); 
-			if(nflag == 0)
-			{
-				MYDBG( printf("# CUDA VerletCuda::iterate: communicate\n"); )
-				timer->stamp();
-				
-			    if((not (eflag||vflag))&&(cuda->shared_data.overlap_comm))
-			    {
-				  //overlap forward communication of ghost atom positions with inner force calculation (interactions between local atoms)
-			      //build communication buffers
-			//      printf("Pre forward_comm(1)\n");
-			      clock_gettime(CLOCK_REALTIME,&starttotal);
-	 			  cuda->shared_data.atom.reneigh_flag=0;
-				  clock_gettime(CLOCK_REALTIME,&starttime);
- 				  timer->stamp();
-				  comm->forward_comm(1);
- 				  timer->stamp(TIME_COMM);
-				  clock_gettime(CLOCK_REALTIME,&endtime);
-				  cuda->shared_data.cuda_timings.comm_forward_total+=
- 						endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
-			      
-			      //prepare force calculation
-			 //     printf("Pre force_clear\n");
-			      force_clear();
-			 //     printf("Pre Generate XType\n");
-				  Cuda_Pair_GenerateXType(&cuda->shared_data);
-				  if(cuda->cu_v_radius) 
-				    Cuda_Pair_GenerateVRadius(&cuda->shared_data);
-				  if(cuda->cu_omega_rmass) 
-				    Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
-		          
-		          //start force calculation asynchronus
-			      cuda->shared_data.comm.comm_phase=1;
-		          force->pair->compute(eflag, vflag);
-			      timer->stamp(TIME_PAIR);
+                for(int i = 0; i < n; i++)
+                {
+                        if(atom->nlocal==0)
+                                error->warning(FLERR,"# CUDA: There are currently no atoms on one of the MPI processes. This is currently prone to encountering errors with USER-CUDA package. Please use the 'processors' keyword to use a more balanced processor layout.");
+                        ntimestep = ++update->ntimestep;
+                        ev_set(ntimestep);
+
+                        // initial time integration
+
+                        test_atom(testatom,"Pre initial");
+
+                        MYDBG( printf("# CUDA VerletCuda::iterate: before initial_integrate\n"); )
+
+                         modify->initial_integrate(vflag);
+
+                        MYDBG( printf("# CUDA VerletCuda::iterate: after initial_integrate\n"); )
+
+                        if(n_post_integrate) modify->post_integrate();
+
+
+
+                        // regular communication vs neighbor list rebuild
+
+                        test_atom(testatom,"Pre Exchange");
+
+                        MYDBG( printf("# CUDA VerletCuda::iterate: before neighbor decide\n"); )
+                        nflag = neighbor->decide();
+                        if(nflag == 0)
+                        {
+                                MYDBG( printf("# CUDA VerletCuda::iterate: communicate\n"); )
+                                timer->stamp();
+
+                            if((not (eflag||vflag))&&(cuda->shared_data.overlap_comm))
+                            {
+                                  //overlap forward communication of ghost atom positions with inner force calculation (interactions between local atoms)
+                              //build communication buffers
+                        //      printf("Pre forward_comm(1)\n");
+                              clock_gettime(CLOCK_REALTIME,&starttotal);
+                                   cuda->shared_data.atom.reneigh_flag=0;
+                                  clock_gettime(CLOCK_REALTIME,&starttime);
+                                   timer->stamp();
+                                  comm->forward_comm(1);
+                                   timer->stamp(TIME_COMM);
+                                  clock_gettime(CLOCK_REALTIME,&endtime);
+                                  cuda->shared_data.cuda_timings.comm_forward_total+=
+                                                 endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+
+                              //prepare force calculation
+                         //     printf("Pre force_clear\n");
+                              force_clear();
+                         //     printf("Pre Generate XType\n");
+                                  Cuda_Pair_GenerateXType(&cuda->shared_data);
+                                  if(cuda->cu_v_radius)
+                                    Cuda_Pair_GenerateVRadius(&cuda->shared_data);
+                                  if(cuda->cu_omega_rmass)
+                                    Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
+
+                          //start force calculation asynchronus
+                              cuda->shared_data.comm.comm_phase=1;
+                          force->pair->compute(eflag, vflag);
+                              timer->stamp(TIME_PAIR);
                   //CudaWrapper_Sync();
-				
-				  //download comm buffers from GPU, perform MPI communication and upload buffers again
-				  clock_gettime(CLOCK_REALTIME,&starttime);
-				  comm->forward_comm(2);
- 				  clock_gettime(CLOCK_REALTIME,&endtime);
-				  cuda->shared_data.cuda_timings.comm_forward_total+=
- 						endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
- 				  timer->stamp(TIME_COMM);
- 				  
- 				  //wait for force calculation
-				  CudaWrapper_Sync();
-				  timer->stamp(TIME_PAIR);			
-				
-				  //unpack communication buffers
-				  clock_gettime(CLOCK_REALTIME,&starttime);
-				  comm->forward_comm(3);
-				  clock_gettime(CLOCK_REALTIME,&endtime);
-				  cuda->shared_data.cuda_timings.comm_forward_total+=
- 						endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
-				
- 				  timer->stamp(TIME_COMM);
-				  MYDBG( printf("# CUDA VerletCuda::iterate: communicate done\n"); )
-				  cuda->shared_data.cuda_timings.test1+=
- 						endtotal.tv_sec-starttotal.tv_sec+1.0*(endtotal.tv_nsec-starttotal.tv_nsec)/1000000000;
-			    }
-			    else
-			    {
-			  	  //perform standard forward communication
-				  clock_gettime(CLOCK_REALTIME,&starttime);
-				  comm->forward_comm();
-				  clock_gettime(CLOCK_REALTIME,&endtime);
-				  cuda->shared_data.cuda_timings.comm_forward_total+=
- 					endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
- 				  timer->stamp(TIME_COMM);
-				  MYDBG( printf("# CUDA VerletCuda::iterate: communicate done\n"); )
-			    }
-			}
-			else
-			{
- 				int nlocalold=cuda->shared_data.atom.nlocal;
- 				if(firstreneigh)
- 				{
- 				  cuda->shared_data.atom.update_nlocal=1; 
-  				cuda->shared_data.atom.update_nmax=1;
- 				  firstreneigh=0;
- 				}
- 				cuda->shared_data.buffer_new=1;
-				MYDBG( printf("# CUDA VerletCuda::iterate: neighbor\n"); )
- 				cuda->setDomainParams();
-				if(n_pre_exchange) modify->pre_exchange();
-				if(atom->nlocal!=cuda->shared_data.atom.nlocal) //did someone add atoms during pre_exchange?
-				{
-					cuda->checkResize();
-					cuda->uploadAll();
-				}
-				
-				//check domain changes
-				if(domain->triclinic) domain->x2lamda(atom->nlocal);
-				MYDBG( printf("# CUDA VerletCuda::iterate: neighbor pbc\n"); )
-				domain->pbc();
-				if(domain->box_change)
-				{
-					domain->reset_box();
-					comm->setup(); 
-					if (neighbor->style) neighbor->setup_bins(); 
-					
-				}
-				timer->stamp();
-				MYDBG( printf("# CUDA VerletCuda::iterate: neighbor exchange\n"); )
-
-				//perform exchange of local atoms
-				clock_gettime(CLOCK_REALTIME,&starttime);
-				comm->exchange();
-				clock_gettime(CLOCK_REALTIME,&endtime);
-
-				//special and nspecial fields of the atom data are not currently transfered via the GPU buffer might be changed in the future
-				if(comm->nprocs>1)
-				{
-				  clock_gettime(CLOCK_REALTIME,&starttime);
-				  if(atom->special)
-					cuda->cu_special->upload();
-				  if(atom->nspecial)
-					cuda->cu_nspecial->upload();
-				  clock_gettime(CLOCK_REALTIME,&endtime);
-				  cuda->shared_data.cuda_timings.test1+=
- 					  endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
-				}
-
-				cuda->shared_data.cuda_timings.comm_exchange_total+=
- 					endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
- 				
- 				if(nlocalold!=cuda->shared_data.atom.nlocal) cuda->shared_data.atom.update_nlocal=2;
-
-				//sort atoms
-      			if (sortflag && ntimestep >= atom->nextsort) atom->sort();
-				MYDBG( printf("# CUDA VerletCuda::iterate: neighbor borders\n"); )
-
-				//generate ghost atom lists, and transfer ghost atom data
-				clock_gettime(CLOCK_REALTIME,&starttime);
-				comm->borders();
-				clock_gettime(CLOCK_REALTIME,&endtime);
-				cuda->shared_data.cuda_timings.comm_border_total+=
- 					endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
-
-				clock_gettime(CLOCK_REALTIME,&starttime);
-				//atom index maps are generated on CPU, and need to be transfered to GPU if they are used
-				if(cuda->cu_map_array)
-				  cuda->cu_map_array->upload();
-				  
-				
-				if(domain->triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
-				
-				if(n_pre_neighbor) modify->pre_neighbor();
-
-  				cuda->shared_data.buffer_new=2;
-  				if(atom->molecular) cuda->cu_molecule->download();
-				MYDBG( printf("# CUDA VerletCuda::iterate: neighbor build\n"); )
-  			    timer->stamp(TIME_COMM);
-				clock_gettime(CLOCK_REALTIME,&endtime);
-				cuda->shared_data.cuda_timings.test2+=
- 					endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
-			    
-			  //rebuild neighbor list
-			  test_atom(testatom,"Pre Neighbor");
-				neighbor->build();
-  			timer->stamp(TIME_NEIGHBOR);
-				MYDBG( printf("# CUDA VerletCuda::iterate: neighbor done\n"); )
-				
-				//if bonded interactions are used (in this case collect_forces_later is true), transfer data which only changes upon exchange/border routines from GPU to CPU 
-				if(cuda->shared_data.pair.collect_forces_later)
-				{
-					if(cuda->cu_molecule) cuda->cu_molecule->download();
-					cuda->cu_tag->download();
-					cuda->cu_type->download();
-					cuda->cu_mask->download();
-		   		if(cuda->cu_q) cuda->cu_q->download();
-				}
-				cuda->shared_data.comm.comm_phase=3;
-			}
-	
-			test_atom(testatom,"Post Exchange");
-			
-			// force computations
-			
-			//only do force_clear if it has not been done during overlap of communication with local interactions
-			if(not((not (eflag||vflag))&&(cuda->shared_data.overlap_comm)&&(cuda->shared_data.comm.comm_phase<3)))
-			force_clear();
-			
-			if(n_pre_force) modify->pre_force(vflag);
-   			
-			timer->stamp();
-  			
-  			//if overlap of bonded interactions with nonbonded interactions takes place, download forces and positions
- 	/*	    if(cuda->shared_data.pair.collect_forces_later)
-		    {
-		      cuda->cu_x->downloadAsync(2);
-		      cuda->cu_f->downloadAsync(2);
-		    }*/
-		    
-			if(force->pair)
-			{
- 				if((not (eflag||vflag))&&(cuda->shared_data.overlap_comm)&&(cuda->shared_data.comm.comm_phase<3)&&cuda->shared_data.pair.cudable_force)
-				{
-				  //second part of force calculations in case of overlaping it with commuincation. Only interactions between local and ghost atoms are done now
-				  //regenerate data layout for force computations, its actually only needed for the ghost atoms
-				  cuda->shared_data.comm.comm_phase=2;
-      			 
-      			  timespec atime1,atime2;
-	  			  clock_gettime(CLOCK_REALTIME,&atime1);
- 				  
- 				  Cuda_Pair_GenerateXType(&cuda->shared_data);
-				  if(cuda->cu_v_radius) 
-				    Cuda_Pair_GenerateVRadius(&cuda->shared_data);
-				  if(cuda->cu_omega_rmass) 
-				    Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
-				  
-	  			  clock_gettime(CLOCK_REALTIME,&atime2);
-	  			  cuda->shared_data.cuda_timings.pair_xtype_conversion+=
-        			atime2.tv_sec-atime1.tv_sec+1.0*(atime2.tv_nsec-atime1.tv_nsec)/1000000000;
-				  force->pair->compute(eflag, vflag);
-		          				
-				}
-				else
-				{
-				  //calculate complete pair interactions
- 			      if(not cuda->shared_data.pair.cudable_force) cuda->downloadAll();
-				  else
-				  {
-				    //regenerate data layout for force computations, its actually only needed for the ghost atoms
-      			    timespec atime1,atime2;
-	  			    clock_gettime(CLOCK_REALTIME,&atime1);
-				   
-				    Cuda_Pair_GenerateXType(&cuda->shared_data);
-				    if(cuda->cu_v_radius) 
-				      Cuda_Pair_GenerateVRadius(&cuda->shared_data);
-				    if(cuda->cu_omega_rmass) 
-				      Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
-	  			 
-	  			    clock_gettime(CLOCK_REALTIME,&atime2);
-	  			    cuda->shared_data.cuda_timings.pair_xtype_conversion+=
-        				atime2.tv_sec-atime1.tv_sec+1.0*(atime2.tv_nsec-atime1.tv_nsec)/1000000000;
-				  }
-				  cuda->shared_data.comm.comm_phase=0;	
-				  force->pair->compute(eflag, vflag);
-				}
-
- 			    if(not cuda->shared_data.pair.cudable_force) cuda->uploadAll(); 
- 			    
- 			    //wait for force calculation in case of not using overlap with bonded interactions
- 			    if(not cuda->shared_data.pair.collect_forces_later)
- 				  CudaWrapper_Sync();
- 				  
-				timer->stamp(TIME_PAIR);
-			}
-   			
-   			//calculate bonded interactions
-		    if(atom->molecular)
-			{
-	          cuda->cu_x->downloadAsync(2);
-		      if(n_pre_force==0) Verlet::force_clear();
-		      else  cuda->cu_f->downloadAsync(2);
-		      
-			  timer->stamp(TIME_PAIR);
-			  
-			  test_atom(testatom,"pre bond force");
-			  if(force->bond) force->bond->compute(eflag, vflag);
-			  if(force->angle) force->angle->compute(eflag, vflag);
-			  if(force->dihedral) force->dihedral->compute(eflag, vflag);
-			  if(force->improper) force->improper->compute(eflag, vflag);
-			  timer->stamp(TIME_BOND);
-		    }
-		
-		   //collect forces in case pair force and bonded interactions were overlapped, and either no KSPACE or a GPU KSPACE style is used
-	       	if(cuda->shared_data.pair.collect_forces_later&&cuda->shared_data.pair.cudable_force&&(not (force->kspace&&(not cuda->shared_data.pppm.cudable_force))))
-	       	{
-		      clock_gettime(CLOCK_REALTIME,&starttime);
-		      cuda->cu_f->uploadAsync(2);
-
-  		      test_atom(testatom,"post molecular force");
-		      
- 	          
- 	          if(eflag) cuda->cu_eng_vdwl->upload();
-	          if(eflag) cuda->cu_eng_coul->upload();
-	          if(vflag) cuda->cu_virial->upload();
+
+                                  //download comm buffers from GPU, perform MPI communication and upload buffers again
+                                  clock_gettime(CLOCK_REALTIME,&starttime);
+                                  comm->forward_comm(2);
+                                   clock_gettime(CLOCK_REALTIME,&endtime);
+                                  cuda->shared_data.cuda_timings.comm_forward_total+=
+                                                 endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+                                   timer->stamp(TIME_COMM);
+
+                                   //wait for force calculation
+                                  CudaWrapper_Sync();
+                                  timer->stamp(TIME_PAIR);
+
+                                  //unpack communication buffers
+                                  clock_gettime(CLOCK_REALTIME,&starttime);
+                                  comm->forward_comm(3);
+                                  clock_gettime(CLOCK_REALTIME,&endtime);
+                                  cuda->shared_data.cuda_timings.comm_forward_total+=
+                                                 endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+
+                                   timer->stamp(TIME_COMM);
+                                  MYDBG( printf("# CUDA VerletCuda::iterate: communicate done\n"); )
+                                  cuda->shared_data.cuda_timings.test1+=
+                                                 endtotal.tv_sec-starttotal.tv_sec+1.0*(endtotal.tv_nsec-starttotal.tv_nsec)/1000000000;
+                            }
+                            else
+                            {
+                                    //perform standard forward communication
+                                  clock_gettime(CLOCK_REALTIME,&starttime);
+                                  comm->forward_comm();
+                                  clock_gettime(CLOCK_REALTIME,&endtime);
+                                  cuda->shared_data.cuda_timings.comm_forward_total+=
+                                         endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+                                   timer->stamp(TIME_COMM);
+                                  MYDBG( printf("# CUDA VerletCuda::iterate: communicate done\n"); )
+                            }
+                        }
+                        else
+                        {
+                                 int nlocalold=cuda->shared_data.atom.nlocal;
+                                 if(firstreneigh)
+                                 {
+                                   cuda->shared_data.atom.update_nlocal=1;
+                                  cuda->shared_data.atom.update_nmax=1;
+                                   firstreneigh=0;
+                                 }
+                                 cuda->shared_data.buffer_new=1;
+                                MYDBG( printf("# CUDA VerletCuda::iterate: neighbor\n"); )
+                                 cuda->setDomainParams();
+                                if(n_pre_exchange) modify->pre_exchange();
+                                if(atom->nlocal!=cuda->shared_data.atom.nlocal) //did someone add atoms during pre_exchange?
+                                {
+                                        cuda->checkResize();
+                                        cuda->uploadAll();
+                                }
+
+                                //check domain changes
+                                if(domain->triclinic) domain->x2lamda(atom->nlocal);
+                                MYDBG( printf("# CUDA VerletCuda::iterate: neighbor pbc\n"); )
+                                domain->pbc();
+                                if(domain->box_change)
+                                {
+                                        domain->reset_box();
+                                        comm->setup();
+                                        if (neighbor->style) neighbor->setup_bins();
+
+                                }
+                                timer->stamp();
+                                MYDBG( printf("# CUDA VerletCuda::iterate: neighbor exchange\n"); )
+
+                                //perform exchange of local atoms
+                                clock_gettime(CLOCK_REALTIME,&starttime);
+                                comm->exchange();
+                                clock_gettime(CLOCK_REALTIME,&endtime);
+
+                                //special and nspecial fields of the atom data are not currently transfered via the GPU buffer might be changed in the future
+                                if(comm->nprocs>1)
+                                {
+                                  clock_gettime(CLOCK_REALTIME,&starttime);
+                                  if(atom->special)
+                                        cuda->cu_special->upload();
+                                  if(atom->nspecial)
+                                        cuda->cu_nspecial->upload();
+                                  clock_gettime(CLOCK_REALTIME,&endtime);
+                                  cuda->shared_data.cuda_timings.test1+=
+                                           endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+                                }
+
+                                cuda->shared_data.cuda_timings.comm_exchange_total+=
+                                         endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+
+                                 if(nlocalold!=cuda->shared_data.atom.nlocal) cuda->shared_data.atom.update_nlocal=2;
+
+                                //sort atoms
+                              if (sortflag && ntimestep >= atom->nextsort) atom->sort();
+                                MYDBG( printf("# CUDA VerletCuda::iterate: neighbor borders\n"); )
+
+                                //generate ghost atom lists, and transfer ghost atom data
+                                clock_gettime(CLOCK_REALTIME,&starttime);
+                                comm->borders();
+                                clock_gettime(CLOCK_REALTIME,&endtime);
+                                cuda->shared_data.cuda_timings.comm_border_total+=
+                                         endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+
+                                clock_gettime(CLOCK_REALTIME,&starttime);
+                                //atom index maps are generated on CPU, and need to be transfered to GPU if they are used
+                                if(cuda->cu_map_array)
+                                  cuda->cu_map_array->upload();
+
+
+                                if(domain->triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
+
+                                if(n_pre_neighbor) modify->pre_neighbor();
+
+                                  cuda->shared_data.buffer_new=2;
+                                  if(atom->molecular) cuda->cu_molecule->download();
+                                MYDBG( printf("# CUDA VerletCuda::iterate: neighbor build\n"); )
+                              timer->stamp(TIME_COMM);
+                                clock_gettime(CLOCK_REALTIME,&endtime);
+                                cuda->shared_data.cuda_timings.test2+=
+                                         endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+
+                          //rebuild neighbor list
+                          test_atom(testatom,"Pre Neighbor");
+                                neighbor->build();
+                          timer->stamp(TIME_NEIGHBOR);
+                                MYDBG( printf("# CUDA VerletCuda::iterate: neighbor done\n"); )
+
+                                //if bonded interactions are used (in this case collect_forces_later is true), transfer data which only changes upon exchange/border routines from GPU to CPU
+                                if(cuda->shared_data.pair.collect_forces_later)
+                                {
+                                        if(cuda->cu_molecule) cuda->cu_molecule->download();
+                                        cuda->cu_tag->download();
+                                        cuda->cu_type->download();
+                                        cuda->cu_mask->download();
+                                   if(cuda->cu_q) cuda->cu_q->download();
+                                }
+                                cuda->shared_data.comm.comm_phase=3;
+                        }
+
+                        test_atom(testatom,"Post Exchange");
+
+                        // force computations
+
+                        //only do force_clear if it has not been done during overlap of communication with local interactions
+                        if(not((not (eflag||vflag))&&(cuda->shared_data.overlap_comm)&&(cuda->shared_data.comm.comm_phase<3)))
+                        force_clear();
+
+                        if(n_pre_force) modify->pre_force(vflag);
+
+                        timer->stamp();
+
+                          //if overlap of bonded interactions with nonbonded interactions takes place, download forces and positions
+         /*            if(cuda->shared_data.pair.collect_forces_later)
+                    {
+                      cuda->cu_x->downloadAsync(2);
+                      cuda->cu_f->downloadAsync(2);
+                    }*/
+
+                        if(force->pair)
+                        {
+                                 if((not (eflag||vflag))&&(cuda->shared_data.overlap_comm)&&(cuda->shared_data.comm.comm_phase<3)&&cuda->shared_data.pair.cudable_force)
+                                {
+                                  //second part of force calculations in case of overlaping it with commuincation. Only interactions between local and ghost atoms are done now
+                                  //regenerate data layout for force computations, its actually only needed for the ghost atoms
+                                  cuda->shared_data.comm.comm_phase=2;
+
+                                timespec atime1,atime2;
+                                    clock_gettime(CLOCK_REALTIME,&atime1);
+
+                                   Cuda_Pair_GenerateXType(&cuda->shared_data);
+                                  if(cuda->cu_v_radius)
+                                    Cuda_Pair_GenerateVRadius(&cuda->shared_data);
+                                  if(cuda->cu_omega_rmass)
+                                    Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
+
+                                    clock_gettime(CLOCK_REALTIME,&atime2);
+                                    cuda->shared_data.cuda_timings.pair_xtype_conversion+=
+                                atime2.tv_sec-atime1.tv_sec+1.0*(atime2.tv_nsec-atime1.tv_nsec)/1000000000;
+                                  force->pair->compute(eflag, vflag);
+
+                                }
+                                else
+                                {
+                                  //calculate complete pair interactions
+                               if(not cuda->shared_data.pair.cudable_force) cuda->downloadAll();
+                                  else
+                                  {
+                                    //regenerate data layout for force computations, its actually only needed for the ghost atoms
+                                  timespec atime1,atime2;
+                                      clock_gettime(CLOCK_REALTIME,&atime1);
+
+                                    Cuda_Pair_GenerateXType(&cuda->shared_data);
+                                    if(cuda->cu_v_radius)
+                                      Cuda_Pair_GenerateVRadius(&cuda->shared_data);
+                                    if(cuda->cu_omega_rmass)
+                                      Cuda_Pair_GenerateOmegaRmass(&cuda->shared_data);
+
+                                      clock_gettime(CLOCK_REALTIME,&atime2);
+                                      cuda->shared_data.cuda_timings.pair_xtype_conversion+=
+                                        atime2.tv_sec-atime1.tv_sec+1.0*(atime2.tv_nsec-atime1.tv_nsec)/1000000000;
+                                  }
+                                  cuda->shared_data.comm.comm_phase=0;
+                                  force->pair->compute(eflag, vflag);
+                                }
+
+                             if(not cuda->shared_data.pair.cudable_force) cuda->uploadAll();
+
+                             //wait for force calculation in case of not using overlap with bonded interactions
+                             if(not cuda->shared_data.pair.collect_forces_later)
+                                   CudaWrapper_Sync();
+
+                                timer->stamp(TIME_PAIR);
+                        }
+
+                           //calculate bonded interactions
+                    if(atom->molecular)
+                        {
+                  cuda->cu_x->downloadAsync(2);
+                      if(n_pre_force==0) Verlet::force_clear();
+                      else  cuda->cu_f->downloadAsync(2);
+
+                          timer->stamp(TIME_PAIR);
+
+                          test_atom(testatom,"pre bond force");
+                          if(force->bond) force->bond->compute(eflag, vflag);
+                          if(force->angle) force->angle->compute(eflag, vflag);
+                          if(force->dihedral) force->dihedral->compute(eflag, vflag);
+                          if(force->improper) force->improper->compute(eflag, vflag);
+                          timer->stamp(TIME_BOND);
+                    }
+
+                   //collect forces in case pair force and bonded interactions were overlapped, and either no KSPACE or a GPU KSPACE style is used
+                       if(cuda->shared_data.pair.collect_forces_later&&cuda->shared_data.pair.cudable_force&&(not (force->kspace&&(not cuda->shared_data.pppm.cudable_force))))
+                       {
+                      clock_gettime(CLOCK_REALTIME,&starttime);
+                      cuda->cu_f->uploadAsync(2);
+
+                        test_atom(testatom,"post molecular force");
+
+
+                   if(eflag) cuda->cu_eng_vdwl->upload();
+                  if(eflag) cuda->cu_eng_coul->upload();
+                  if(vflag) cuda->cu_virial->upload();
               Cuda_Pair_CollectForces(&cuda->shared_data,eflag,vflag);
-	          if(eflag) cuda->cu_eng_vdwl->download();
-	          if(eflag) cuda->cu_eng_coul->download();
-	          if(vflag) cuda->cu_virial->download();
-		      timer->stamp(TIME_PAIR);
-			  
-			  clock_gettime(CLOCK_REALTIME,&endtime);
-			  cuda->shared_data.cuda_timings.pair_force_collection+=
- 					endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
-	       	}		
-		
-		    //compute kspace force
-		   	if(force->kspace)
-		   	{
-			  if((not cuda->shared_data.pppm.cudable_force) && (not cuda->shared_data.pair.collect_forces_later)) 
-				cuda->downloadAll();
-			  if((not cuda->shared_data.pppm.cudable_force) && (cuda->shared_data.pair.collect_forces_later) && (not atom->molecular))
-			  {
-	            cuda->cu_x->downloadAsync(2);
-		        if(n_pre_force==0) Verlet::force_clear();
-		        else  cuda->cu_f->downloadAsync(2);
-		      
-			    timer->stamp(TIME_PAIR);
-			  }
-			  
-			  force->kspace->compute(eflag,vflag);
-			  if((not cuda->shared_data.pppm.cudable_force) && (not cuda->shared_data.pair.collect_forces_later)) 
-				cuda->uploadAll();
-			  timer->stamp(TIME_KSPACE);
-		   	}
-			
-			//collect forces in case pair forces and kspace was overlaped
-	   	    if(cuda->shared_data.pair.collect_forces_later&&cuda->shared_data.pair.cudable_force&&((force->kspace&&(not cuda->shared_data.pppm.cudable_force))))
-	       	{
-		      cuda->cu_f->uploadAsync(2);
-
-			  clock_gettime(CLOCK_REALTIME,&starttime);
-	          
-	          if(eflag) cuda->cu_eng_vdwl->upload();
-	          if(eflag) cuda->cu_eng_coul->upload();
-	      	  if(vflag) cuda->cu_virial->upload();
-          	  Cuda_Pair_CollectForces(&cuda->shared_data,eflag,vflag);
-	      	  if(eflag) cuda->cu_eng_vdwl->download();
-	      	  if(eflag) cuda->cu_eng_coul->download();
-	      	  if(vflag) cuda->cu_virial->download();
-		  	  timer->stamp(TIME_PAIR);
-			  
-			  clock_gettime(CLOCK_REALTIME,&endtime);
-  			  cuda->shared_data.cuda_timings.pair_force_collection+=
- 					endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
-	    	}		
-				
-			//send forces on ghost atoms back to other GPU: THIS SHOULD NEVER HAPPEN
-			if(force->newton)
-			{
-			  comm->reverse_comm();
-			  timer->stamp(TIME_COMM);
-			}
-   		    test_atom(testatom,"post force");
-			// force modifications, final time integration, diagnostics
-			
-			if(n_post_force) modify->post_force(vflag);
-
-			test_atom(testatom,"pre final");
-
-			modify->final_integrate();
-
-			test_atom(testatom,"post final");
-
-			if(n_end_of_step) modify->end_of_step();
-  
-			// all output
-			
-			test_atom(testatom,"pre output");
-			
-			if(ntimestep == output->next)
-			{
-			  if(not output->thermo->cudable)
-			  cuda->downloadAll();
-			  timer->stamp();
-			  output->write(ntimestep);
-			  timer->stamp(TIME_OUTPUT);
-			}
-
-			
-			test_atom(testatom,"post output");
-			
-			if(cuda->shared_data.atom.update_nlocal>0)
-			  cuda->shared_data.atom.update_nlocal--;
-  		if(cuda->shared_data.atom.update_nmax>0)
-  		  cuda->shared_data.atom.update_nmax--;
+                  if(eflag) cuda->cu_eng_vdwl->download();
+                  if(eflag) cuda->cu_eng_coul->download();
+                  if(vflag) cuda->cu_virial->download();
+                      timer->stamp(TIME_PAIR);
+
+                          clock_gettime(CLOCK_REALTIME,&endtime);
+                          cuda->shared_data.cuda_timings.pair_force_collection+=
+                                         endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+                       }
+
+                    //compute kspace force
+                           if(force->kspace)
+                           {
+                          if((not cuda->shared_data.pppm.cudable_force) && (not cuda->shared_data.pair.collect_forces_later))
+                                cuda->downloadAll();
+                          if((not cuda->shared_data.pppm.cudable_force) && (cuda->shared_data.pair.collect_forces_later) && (not atom->molecular))
+                          {
+                    cuda->cu_x->downloadAsync(2);
+                        if(n_pre_force==0) Verlet::force_clear();
+                        else  cuda->cu_f->downloadAsync(2);
+
+                            timer->stamp(TIME_PAIR);
+                          }
+
+                          force->kspace->compute(eflag,vflag);
+                          if((not cuda->shared_data.pppm.cudable_force) && (not cuda->shared_data.pair.collect_forces_later))
+                                cuda->uploadAll();
+                          timer->stamp(TIME_KSPACE);
+                           }
+
+                        //collect forces in case pair forces and kspace was overlaped
+                       if(cuda->shared_data.pair.collect_forces_later&&cuda->shared_data.pair.cudable_force&&((force->kspace&&(not cuda->shared_data.pppm.cudable_force))))
+                       {
+                      cuda->cu_f->uploadAsync(2);
+
+                          clock_gettime(CLOCK_REALTIME,&starttime);
+
+                  if(eflag) cuda->cu_eng_vdwl->upload();
+                  if(eflag) cuda->cu_eng_coul->upload();
+                        if(vflag) cuda->cu_virial->upload();
+                    Cuda_Pair_CollectForces(&cuda->shared_data,eflag,vflag);
+                        if(eflag) cuda->cu_eng_vdwl->download();
+                        if(eflag) cuda->cu_eng_coul->download();
+                        if(vflag) cuda->cu_virial->download();
+                            timer->stamp(TIME_PAIR);
+
+                          clock_gettime(CLOCK_REALTIME,&endtime);
+                            cuda->shared_data.cuda_timings.pair_force_collection+=
+                                         endtime.tv_sec-starttime.tv_sec+1.0*(endtime.tv_nsec-starttime.tv_nsec)/1000000000;
+                    }
+
+                        //send forces on ghost atoms back to other GPU: THIS SHOULD NEVER HAPPEN
+                        if(force->newton)
+                        {
+                          comm->reverse_comm();
+                          timer->stamp(TIME_COMM);
+                        }
+                       test_atom(testatom,"post force");
+                        // force modifications, final time integration, diagnostics
+
+                        if(n_post_force) modify->post_force(vflag);
+
+                        test_atom(testatom,"pre final");
+
+                        modify->final_integrate();
+
+                        test_atom(testatom,"post final");
+
+                        if(n_end_of_step) modify->end_of_step();
+
+                        // all output
+
+                        test_atom(testatom,"pre output");
+
+                        if(ntimestep == output->next)
+                        {
+                          if(not output->thermo->cudable)
+                          cuda->downloadAll();
+                          timer->stamp();
+                          output->write(ntimestep);
+                          timer->stamp(TIME_OUTPUT);
+                        }
+
+
+                        test_atom(testatom,"post output");
+
+                        if(cuda->shared_data.atom.update_nlocal>0)
+                          cuda->shared_data.atom.update_nlocal--;
+                  if(cuda->shared_data.atom.update_nmax>0)
+                    cuda->shared_data.atom.update_nmax--;
       if(cuda->shared_data.atom.update_neigh>0)
         cuda->shared_data.atom.update_neigh--;
-  		if(cuda->shared_data.domain.update>0)
-  			cuda->shared_data.domain.update--;
-  		if(cuda->shared_data.buffer_new>0)
-  			cuda->shared_data.buffer_new--;
-    	cuda->shared_data.atom.reneigh_flag=0;
-		}
-
-
-  		cuda->downloadAll();
- 		cuda->downloadAllNeighborLists();
-  		cuda->shared_data.atom.update_nlocal=1;
-  		cuda->shared_data.atom.update_nmax=1;
+                  if(cuda->shared_data.domain.update>0)
+                          cuda->shared_data.domain.update--;
+                  if(cuda->shared_data.buffer_new>0)
+                          cuda->shared_data.buffer_new--;
+            cuda->shared_data.atom.reneigh_flag=0;
+                }
+
+
+                  cuda->downloadAll();
+                 cuda->downloadAllNeighborLists();
+                  cuda->shared_data.atom.update_nlocal=1;
+                  cuda->shared_data.atom.update_nmax=1;
       cuda->shared_data.atom.update_neigh=1;
-  		cuda->shared_data.buffer_new=1;
-  		cuda->shared_data.domain.update=1;
-  		cuda->oncpu = true;
-  		cuda->finished_run = true;
+                  cuda->shared_data.buffer_new=1;
+                  cuda->shared_data.domain.update=1;
+                  cuda->oncpu = true;
+                  cuda->finished_run = true;
 }
 
 
@@ -1005,14 +1005,14 @@ void VerletCuda::force_clear()
   cuda->cu_f->memset_device(0);
   if(cuda->cu_torque) cuda->cu_torque->memset_device(0);
   return;
-  
+
   //The rest should not be necessary
   int i;
   for(i=0;i<atom->nlocal;i++)
   {
-  	atom->f[i][0]=0.0;
-  	atom->f[i][1]=0.0;
-  	atom->f[i][2]=0.0;  	
+          atom->f[i][0]=0.0;
+          atom->f[i][1]=0.0;
+          atom->f[i][2]=0.0;
   }
   // clear force on all particles
   // if either newton flag is set, also include ghosts
@@ -1024,9 +1024,9 @@ void VerletCuda::force_clear()
     if (torqueflag) {
       double **torque = atom->torque;
       for (i = 0; i < nall; i++) {
-	torque[i][0] = 0.0;
-	torque[i][1] = 0.0;
-	torque[i][2] = 0.0;
+        torque[i][0] = 0.0;
+        torque[i][1] = 0.0;
+        torque[i][2] = 0.0;
       }
     }
 
@@ -1037,26 +1037,26 @@ void VerletCuda::force_clear()
   } else {
     int nall = atom->nfirst;
 
-    
+
     if (torqueflag) {
       double **torque = atom->torque;
       for (i = 0; i < nall; i++) {
-	torque[i][0] = 0.0;
-	torque[i][1] = 0.0;
-	torque[i][2] = 0.0;
+        torque[i][0] = 0.0;
+        torque[i][1] = 0.0;
+        torque[i][2] = 0.0;
       }
     }
 
     if (force->newton) {
       nall = atom->nlocal + atom->nghost;
- 
+
       if (torqueflag) {
-	double **torque = atom->torque;
-	for (i = atom->nlocal; i < nall; i++) {
-	  torque[i][0] = 0.0;
-	  torque[i][1] = 0.0;
-	  torque[i][2] = 0.0;
-	}
+        double **torque = atom->torque;
+        for (i = atom->nlocal; i < nall; i++) {
+          torque[i][0] = 0.0;
+          torque[i][1] = 0.0;
+          torque[i][2] = 0.0;
+        }
       }
     }
   }
@@ -1070,35 +1070,35 @@ void VerletCuda::test_atom(int aatom, char* string)  //printing properties of on
   for(int i=0;i<atom->nlocal+atom->nghost;i++)
   {
   if((atom->tag[i]==aatom)&&(i<atom->nlocal))
-  	{
-  	  
-  	  printf("%i # CUDA %s: %i %i %e %e %e %i ",comm->me,string,update->ntimestep,atom->tag[i],atom->x[i][0],atom->v[i][0],atom->f[i][0],i);  
-  	  if(atom->molecular && (i<atom->nlocal))
-	  {
-	  	printf(" // %i %i %i ",atom->num_bond[i],atom->num_angle[i],atom->num_dihedral[i]);
-	  	for(int k=0;k<atom->num_bond[i];k++)
-	  	printf("// %i %i ",atom->bond_type[i][k],atom->bond_atom[i][k]);
-	  }
-	  printf("\n");
-  	}
+          {
+
+            printf("%i # CUDA %s: %i %i %e %e %e %i ",comm->me,string,update->ntimestep,atom->tag[i],atom->x[i][0],atom->v[i][0],atom->f[i][0],i);
+            if(atom->molecular && (i<atom->nlocal))
+          {
+                  printf(" // %i %i %i ",atom->num_bond[i],atom->num_angle[i],atom->num_dihedral[i]);
+                  for(int k=0;k<atom->num_bond[i];k++)
+                  printf("// %i %i ",atom->bond_type[i][k],atom->bond_atom[i][k]);
+          }
+          printf("\n");
+          }
   if(i<atom->nlocal)
   {
   if((atom->v[i][0]<-100||atom->v[i][0]>100)||
-  	 (atom->v[i][1]<-100||atom->v[i][1]>100)||
-  	 (atom->v[i][2]<-100||atom->v[i][2]>100)||
-  	 (atom->v[i][0]!=atom->v[i][0])||
-  	 (atom->v[i][1]!=atom->v[i][1])||
-  	 (atom->v[i][2]!=atom->v[i][2]))
-  	{printf("%i # CUDA %s velocity: %i %e %e %e %i\n",comm->me,string,atom->tag[i],atom->x[i][0],atom->v[i][0],atom->f[i][0],i);  check=true;}
+           (atom->v[i][1]<-100||atom->v[i][1]>100)||
+           (atom->v[i][2]<-100||atom->v[i][2]>100)||
+           (atom->v[i][0]!=atom->v[i][0])||
+           (atom->v[i][1]!=atom->v[i][1])||
+           (atom->v[i][2]!=atom->v[i][2]))
+          {printf("%i # CUDA %s velocity: %i %e %e %e %i\n",comm->me,string,atom->tag[i],atom->x[i][0],atom->v[i][0],atom->f[i][0],i);  check=true;}
   if((atom->f[i][0]<-10000||atom->f[i][0]>10000)||
-  	 (atom->f[i][1]<-10000||atom->f[i][1]>10000)||
-  	 (atom->f[i][2]<-10000||atom->f[i][2]>10000)||
-  	 (atom->f[i][0]!=atom->f[i][0])||
-  	 (atom->f[i][1]!=atom->f[i][1])||
-  	 (atom->f[i][2]!=atom->f[i][2]))
-  	{printf("%i # CUDA %s force: %i %e %e %e %i\n",comm->me,string,atom->tag[i],atom->x[i][0],atom->v[i][0],atom->f[i][0],i);    check=true;}
+           (atom->f[i][1]<-10000||atom->f[i][1]>10000)||
+           (atom->f[i][2]<-10000||atom->f[i][2]>10000)||
+           (atom->f[i][0]!=atom->f[i][0])||
+           (atom->f[i][1]!=atom->f[i][1])||
+           (atom->f[i][2]!=atom->f[i][2]))
+          {printf("%i # CUDA %s force: %i %e %e %e %i\n",comm->me,string,atom->tag[i],atom->x[i][0],atom->v[i][0],atom->f[i][0],i);    check=true;}
   if(atom->tag[i]<=0)
-  	printf("%i # CUDA %s tag: %i %e %e %e %i\n",comm->me,string,atom->tag[i],atom->x[i][0],atom->v[i][0],atom->f[i][0],i);  
+          printf("%i # CUDA %s tag: %i %e %e %e %i\n",comm->me,string,atom->tag[i],atom->x[i][0],atom->v[i][0],atom->f[i][0],i);
   }
   }
   if(check) exit(0);
diff --git a/src/USER-CUDA/verlet_cuda.h b/src/USER-CUDA/verlet_cuda.h
index 6992f438a4..21f1a049bc 100644
--- a/src/USER-CUDA/verlet_cuda.h
+++ b/src/USER-CUDA/verlet_cuda.h
@@ -1,22 +1,22 @@
 /* ----------------------------------------------------------------------
-   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 
+   LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
 
    Original Version:
    http://lammps.sandia.gov, Sandia National Laboratories
-   Steve Plimpton, sjplimp@sandia.gov 
+   Steve Plimpton, sjplimp@sandia.gov
 
-   See the README file in the top-level LAMMPS directory. 
+   See the README file in the top-level LAMMPS directory.
 
-   ----------------------------------------------------------------------- 
+   -----------------------------------------------------------------------
 
    USER-CUDA Package and associated modifications:
-   https://sourceforge.net/projects/lammpscuda/ 
+   https://sourceforge.net/projects/lammpscuda/
 
    Christian Trott, christian.trott@tu-ilmenau.de
    Lars Winterfeld, lars.winterfeld@tu-ilmenau.de
-   Theoretical Physics II, University of Technology Ilmenau, Germany 
+   Theoretical Physics II, University of Technology Ilmenau, Germany
 
-   See the README file in the USER-CUDA directory. 
+   See the README file in the USER-CUDA directory.
 
    This software is distributed under the GNU General Public License.
 ------------------------------------------------------------------------- */
@@ -37,24 +37,24 @@ namespace LAMMPS_NS {
 
 class VerletCuda : public Verlet
 {
-	public:
-		VerletCuda(class LAMMPS *, int, char **);
-		void setup();
- 		void setup_minimal(int);
-  		void run(int);
-		
-		void test_atom(int atom,char* astring); //debugging purpose
-		int dotestatom;	//debugging purpose
-	
-	protected:
-		class Cuda *cuda;
-		void force_clear();	
-	    double time_pair;
-	    double time_kspace;
-	    double time_comm;
-	    double time_modify;
-	    double time_fulliterate;
-	    ModifyCuda* modify_cuda;
+        public:
+                VerletCuda(class LAMMPS *, int, char **);
+                void setup();
+                 void setup_minimal(int);
+                  void run(int);
+
+                void test_atom(int atom,char* astring); //debugging purpose
+                int dotestatom;        //debugging purpose
+
+        protected:
+                class Cuda *cuda;
+                void force_clear();
+            double time_pair;
+            double time_kspace;
+            double time_comm;
+            double time_modify;
+            double time_fulliterate;
+            ModifyCuda* modify_cuda;
 };
 
 }
diff --git a/src/USER-EFF/atom_vec_electron.cpp b/src/USER-EFF/atom_vec_electron.cpp
index 4f73254c31..9cbdf22cbb 100644
--- a/src/USER-EFF/atom_vec_electron.cpp
+++ b/src/USER-EFF/atom_vec_electron.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -37,27 +37,27 @@ AtomVecElectron::AtomVecElectron(LAMMPS *lmp, int narg, char **arg) :
   AtomVec(lmp, narg, arg)
 {
   comm_x_only = comm_f_only = 0;
-  
+
   mass_type = 1;
   molecular = 0;
-  
+
   size_forward = 4;
-  size_reverse = 4;	
-  size_border = 9;	
+  size_reverse = 4;
+  size_border = 9;
   size_velocity = 3;
   size_data_atom = 8;
   size_data_vel = 5;
   xcol_data = 6;
-  
+
   atom->electron_flag = 1;
-  atom->q_flag = atom->spin_flag = atom->eradius_flag = 
+  atom->q_flag = atom->spin_flag = atom->eradius_flag =
     atom->ervel_flag = atom->erforce_flag = 1;
 }
 
 /* ----------------------------------------------------------------------
    grow atom-electron arrays
    n = 0 grows arrays by DELTA
-   n > 0 allocates arrays to size n 
+   n > 0 allocates arrays to size n
 ------------------------------------------------------------------------- */
 
 void AtomVecElectron::grow(int n)
@@ -65,7 +65,7 @@ void AtomVecElectron::grow(int n)
   if (n == 0) nmax += DELTA;
   else nmax = n;
   atom->nmax = nmax;
-  
+
   tag = memory->grow(atom->tag,nmax,"atom:tag");
   type = memory->grow(atom->type,nmax,"atom:type");
   mask = memory->grow(atom->mask,nmax,"atom:mask");
@@ -81,7 +81,7 @@ void AtomVecElectron::grow(int n)
   erforce = memory->grow(atom->erforce,nmax*comm->nthreads,"atom:erforce");
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
 }
 
@@ -114,21 +114,21 @@ void AtomVecElectron::copy(int i, int j, int delflag)
   v[j][0] = v[i][0];
   v[j][1] = v[i][1];
   v[j][2] = v[i][2];
-  
+
   q[j] = q[i];
   spin[j] = spin[i];
   eradius[j] = eradius[i];
   ervel[j] = ervel[i];
-  
+
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecElectron::pack_comm(int n, int *list, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -166,7 +166,7 @@ int AtomVecElectron::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecElectron::pack_comm_vel(int n, int *list, double *buf,
-				   int pbc_flag, int *pbc)
+                                   int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -195,34 +195,34 @@ int AtomVecElectron::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = eradius[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = eradius[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = eradius[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = eradius[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -248,7 +248,7 @@ int AtomVecElectron::pack_comm_hybrid(int n, int *list, double *buf)
 void AtomVecElectron::unpack_comm(int n, int first, double *buf)
 {
   int i,m,last;
-  
+
   m = 0;
   last = first + n;
   for (i = first; i < last; i++) {
@@ -264,7 +264,7 @@ void AtomVecElectron::unpack_comm(int n, int first, double *buf)
 void AtomVecElectron::unpack_comm_vel(int n, int first, double *buf)
 {
   int i,m,last;
-  
+
   m = 0;
   last = first + n;
   for (i = first; i < last; i++) {
@@ -296,7 +296,7 @@ int AtomVecElectron::unpack_comm_hybrid(int n, int first, double *buf)
 int AtomVecElectron::pack_reverse(int n, int first, double *buf)
 {
   int i,m,last;
-  
+
   m = 0;
   last = first + n;
   for (i = first; i < last; i++) {
@@ -326,7 +326,7 @@ int AtomVecElectron::pack_reverse_hybrid(int n, int first, double *buf)
 void AtomVecElectron::unpack_reverse(int n, int *list, double *buf)
 {
   int i,j,m;
-  
+
   m = 0;
   for (i = 0; i < n; i++) {
     j = list[i];
@@ -354,7 +354,7 @@ int AtomVecElectron::unpack_reverse_hybrid(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecElectron::pack_border(int n, int *list, double *buf,
-				 int pbc_flag, int *pbc)
+                                 int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -402,7 +402,7 @@ int AtomVecElectron::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecElectron::pack_border_vel(int n, int *list, double *buf,
-				     int pbc_flag, int *pbc)
+                                     int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -436,44 +436,44 @@ int AtomVecElectron::pack_border_vel(int n, int *list, double *buf,
     }
     if (domain->triclinic == 0) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = q[j];
-	buf[m++] = spin[j];
-	buf[m++] = eradius[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = q[j];
+        buf[m++] = spin[j];
+        buf[m++] = eradius[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = q[j];
-	buf[m++] = spin[j];
-	buf[m++] = eradius[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = q[j];
+        buf[m++] = spin[j];
+        buf[m++] = eradius[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -501,7 +501,7 @@ int AtomVecElectron::pack_border_hybrid(int n, int *list, double *buf)
 void AtomVecElectron::unpack_border(int n, int first, double *buf)
 {
   int i,m,last;
-  
+
   m = 0;
   last = first + n;
   for (i = first; i < last; i++) {
@@ -511,7 +511,7 @@ void AtomVecElectron::unpack_border(int n, int first, double *buf)
     x[i][2] = buf[m++];
     tag[i] = static_cast<int> (buf[m++]);
     type[i] = static_cast<int> (buf[m++]);
-    mask[i] = static_cast<int> (buf[m++]);		
+    mask[i] = static_cast<int> (buf[m++]);
     q[i] = buf[m++];
     spin[i] = static_cast<int> (buf[m++]);
     eradius[i] = buf[m++];
@@ -523,7 +523,7 @@ void AtomVecElectron::unpack_border(int n, int first, double *buf)
 void AtomVecElectron::unpack_border_vel(int n, int first, double *buf)
 {
   int i,m,last;
-  
+
   m = 0;
   last = first + n;
   for (i = first; i < last; i++) {
@@ -561,7 +561,7 @@ int AtomVecElectron::unpack_border_hybrid(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 int AtomVecElectron::pack_exchange(int i, double *buf)
@@ -576,16 +576,16 @@ int AtomVecElectron::pack_exchange(int i, double *buf)
   buf[m++] = tag[i];
   buf[m++] = type[i];
   buf[m++] = mask[i];
-  buf[m++] = image[i];	
+  buf[m++] = image[i];
   buf[m++] = q[i];
   buf[m++] = spin[i];
   buf[m++] = eradius[i];
   buf[m++] = ervel[i];
-  
+
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
-  
+
   buf[0] = m;
   return m;
 }
@@ -596,7 +596,7 @@ int AtomVecElectron::unpack_exchange(double *buf)
 {
   int nlocal = atom->nlocal;
   if (nlocal == nmax) grow(0);
-  
+
   int m = 1;
   x[nlocal][0] = buf[m++];
   x[nlocal][1] = buf[m++];
@@ -607,17 +607,17 @@ int AtomVecElectron::unpack_exchange(double *buf)
   tag[nlocal] = static_cast<int> (buf[m++]);
   type[nlocal] = static_cast<int> (buf[m++]);
   mask[nlocal] = static_cast<int> (buf[m++]);
-  image[nlocal] = static_cast<int> (buf[m++]);	
+  image[nlocal] = static_cast<int> (buf[m++]);
   q[nlocal] = buf[m++];
   spin[nlocal] = static_cast<int> (buf[m++]);
   eradius[nlocal] = buf[m++];
   ervel[nlocal] = buf[m++];
-  
+
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
-  
+        unpack_exchange(nlocal,&buf[m]);
+
   atom->nlocal++;
   return m;
 }
@@ -630,22 +630,22 @@ int AtomVecElectron::unpack_exchange(double *buf)
 int AtomVecElectron::size_restart()
 {
   int i;
-  
+
   int nlocal = atom->nlocal;
-  int n = 15 * nlocal;	// Associated with pack_restart
-  
+  int n = 15 * nlocal;        // Associated with pack_restart
+
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
-  
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+
   return n;
 }
 
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecElectron::pack_restart(int i, double *buf)
@@ -661,16 +661,16 @@ int AtomVecElectron::pack_restart(int i, double *buf)
   buf[m++] = v[i][0];
   buf[m++] = v[i][1];
   buf[m++] = v[i][2];
-  
+
   buf[m++] = q[i];
   buf[m++] = spin[i];
   buf[m++] = eradius[i];
   buf[m++] = ervel[i];
-  
+
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
-  
+
   buf[0] = m;
   return m;
 }
@@ -687,7 +687,7 @@ int AtomVecElectron::unpack_restart(double *buf)
     if (atom->nextra_store)
       memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
   }
-  
+
   int m = 1;
   x[nlocal][0] = buf[m++];
   x[nlocal][1] = buf[m++];
@@ -699,18 +699,18 @@ int AtomVecElectron::unpack_restart(double *buf)
   v[nlocal][0] = buf[m++];
   v[nlocal][1] = buf[m++];
   v[nlocal][2] = buf[m++];
-  
+
   q[nlocal] = buf[m++];
   spin[nlocal] = static_cast<int> (buf[m++]);
   eradius[nlocal] = buf[m++];
   ervel[nlocal] = buf[m++];
-  
+
   double **extra = atom->extra;
   if (atom->nextra_store) {
     int size = static_cast<int> (buf[0]) - m;
     for (int i = 0; i < size; i++) extra[nlocal][i] = buf[m++];
   }
-  
+
   atom->nlocal++;
   return m;
 }
@@ -724,7 +724,7 @@ void AtomVecElectron::create_atom(int itype, double *coord)
 {
   int nlocal = atom->nlocal;
   if (nlocal == nmax) grow(0);
-  
+
   tag[nlocal] = 0;
   type[nlocal] = itype;
   x[nlocal][0] = coord[0];
@@ -735,12 +735,12 @@ void AtomVecElectron::create_atom(int itype, double *coord)
   v[nlocal][0] = 0.0;
   v[nlocal][1] = 0.0;
   v[nlocal][2] = 0.0;
-  
+
   q[nlocal] = 0.0;
   spin[nlocal] = 1;
-  eradius[nlocal] = 1.0;	
-  ervel[nlocal] = 0.0; 
-  
+  eradius[nlocal] = 1.0;
+  ervel[nlocal] = 0.0;
+
   atom->nlocal++;
 }
 
@@ -752,33 +752,33 @@ void AtomVecElectron::create_atom(int itype, double *coord)
 void AtomVecElectron::data_atom(double *coord, int imagetmp, char **values)
 {
   int nlocal = atom->nlocal;
-  
+
   if (nlocal == nmax) grow(0);
-  
+
   tag[nlocal] = atoi(values[0]);
   if (tag[nlocal] <= 0)
     error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-  
+
   type[nlocal] = atoi(values[1]);
   if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
     error->one(FLERR,"Invalid atom type in Atoms section of data file");
-  
+
   q[nlocal] = atof(values[2]);
   spin[nlocal] = atoi(values[3]);
   eradius[nlocal] = atof(values[4]);
-  
+
   x[nlocal][0] = coord[0];
   x[nlocal][1] = coord[1];
   x[nlocal][2] = coord[2];
-  
+
   image[nlocal] = imagetmp;
-  
+
   mask[nlocal] = 1;
   v[nlocal][0] = 0.0;
   v[nlocal][1] = 0.0;
   v[nlocal][2] = 0.0;
   ervel[nlocal] = 0.0;
-  
+
   atom->nlocal++;
 }
 
@@ -794,12 +794,12 @@ int AtomVecElectron::data_atom_hybrid(int nlocal, char **values)
   eradius[nlocal] = atof(values[2]);
   if (eradius[nlocal] < 0.0)
     error->one(FLERR,"Invalid eradius in Atoms section of data file");
-  
+
   v[nlocal][0] = 0.0;
   v[nlocal][1] = 0.0;
   v[nlocal][2] = 0.0;
   ervel[nlocal] = 0.0;
-  
+
   return 3;
 }
 
@@ -826,13 +826,13 @@ int AtomVecElectron::data_vel_hybrid(int m, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecElectron::memory_usage()
 {
   bigint bytes = 0;
-  
+
   if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax);
   if (atom->memcheck("type")) bytes += memory->usage(type,nmax);
   if (atom->memcheck("mask")) bytes += memory->usage(mask,nmax);
@@ -840,12 +840,12 @@ bigint AtomVecElectron::memory_usage()
   if (atom->memcheck("x")) bytes += memory->usage(x,nmax,3);
   if (atom->memcheck("v")) bytes += memory->usage(v,nmax,3);
   if (atom->memcheck("f")) bytes += memory->usage(f,nmax*comm->nthreads,3);
-  
+
   if (atom->memcheck("q")) bytes += memory->usage(q,nmax);
   if (atom->memcheck("spin")) bytes += memory->usage(spin,nmax);
   if (atom->memcheck("eradius")) bytes += memory->usage(eradius,nmax);
   if (atom->memcheck("ervel")) bytes += memory->usage(ervel,nmax);
   if (atom->memcheck("erforce")) bytes += memory->usage(erforce,nmax*comm->nthreads);
-  
+
   return bytes;
 }
diff --git a/src/USER-EFF/atom_vec_electron.h b/src/USER-EFF/atom_vec_electron.h
index 6c527cacdd..cfe8f3ea9e 100644
--- a/src/USER-EFF/atom_vec_electron.h
+++ b/src/USER-EFF/atom_vec_electron.h
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -23,7 +23,7 @@ AtomStyle(electron,AtomVecElectron)
 #include "atom_vec.h"
 
 namespace LAMMPS_NS {
-  
+
 class AtomVecElectron : public AtomVec {
  public:
   AtomVecElectron(class LAMMPS *, int, char **);
@@ -58,14 +58,14 @@ class AtomVecElectron : public AtomVec {
   void data_vel(int, char **);
   int data_vel_hybrid(int, char **);
   bigint memory_usage();
-  
+
  private:
   int *tag,*type,*mask,*image;
   double **x,**v,**f;
   int *spin;
-  double *q,*eradius,*ervel,*erforce;	
+  double *q,*eradius,*ervel,*erforce;
 };
- 
+
 }
 
 #endif
diff --git a/src/USER-EFF/compute_ke_atom_eff.cpp b/src/USER-EFF/compute_ke_atom_eff.cpp
index 695cdc8874..165a3c401d 100644
--- a/src/USER-EFF/compute_ke_atom_eff.cpp
+++ b/src/USER-EFF/compute_ke_atom_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -44,7 +44,7 @@ ComputeKEAtomEff::ComputeKEAtomEff(LAMMPS *lmp, int narg, char **arg) :
 
   // error check
 
-  if (!atom->electron_flag) 
+  if (!atom->electron_flag)
     error->all(FLERR,"Compute ke/atom/eff requires atom style electron");
 }
 
@@ -80,9 +80,9 @@ void ComputeKEAtomEff::compute_peratom()
     memory->create(ke,nmax,"compute/ke/atom/eff:ke");
     vector_atom = ke;
   }
-  
+
   // compute kinetic energy for each atom in group
-  
+
   double mvv2e = force->mvv2e;
   double **v = atom->v;
   double *ervel = atom->ervel;
@@ -92,11 +92,11 @@ void ComputeKEAtomEff::compute_peratom()
   int *type = atom->type;
   int nlocal = atom->nlocal;
   double mefactor = domain->dimension/4.0;
-  
+
   if (mass)
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-        ke[i] = 0.5 * mvv2e * mass[type[i]] * 
+        ke[i] = 0.5 * mvv2e * mass[type[i]] *
           (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
         if (fabs(spin[i])==1)
           ke[i] += 0.5 * mvv2e * mefactor * mass[type[i]] * ervel[i]*ervel[i];
diff --git a/src/USER-EFF/compute_ke_atom_eff.h b/src/USER-EFF/compute_ke_atom_eff.h
index 1f04412e50..16ac96fc94 100644
--- a/src/USER-EFF/compute_ke_atom_eff.h
+++ b/src/USER-EFF/compute_ke_atom_eff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -32,7 +32,7 @@ class ComputeKEAtomEff : public Compute {
   void init();
   void compute_peratom();
   double memory_usage();
-  
+
  private:
   int nmax;
   double *ke;
diff --git a/src/USER-EFF/compute_ke_eff.cpp b/src/USER-EFF/compute_ke_eff.cpp
index 5da7d25740..2549ca93aa 100644
--- a/src/USER-EFF/compute_ke_eff.cpp
+++ b/src/USER-EFF/compute_ke_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -39,7 +39,7 @@ ComputeKEEff::ComputeKEEff(LAMMPS *lmp, int narg, char **arg) :
 
   // error check
 
-  if (!atom->electron_flag) 
+  if (!atom->electron_flag)
     error->all(FLERR,"Compute ke/eff requires atom style electron");
 }
 
@@ -70,7 +70,7 @@ double ComputeKEEff::compute_scalar()
   if (mass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-        ke += mass[type[i]]*(v[i][0]*v[i][0] + v[i][1]*v[i][1] + 
+        ke += mass[type[i]]*(v[i][0]*v[i][0] + v[i][1]*v[i][1] +
                              v[i][2]*v[i][2]);
         if (fabs(spin[i])==1) ke += mefactor*mass[type[i]]*ervel[i]*ervel[i];
       }
diff --git a/src/USER-EFF/compute_ke_eff.h b/src/USER-EFF/compute_ke_eff.h
index e8a31db551..cd71dd59f5 100644
--- a/src/USER-EFF/compute_ke_eff.h
+++ b/src/USER-EFF/compute_ke_eff.h
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -30,11 +30,11 @@ class ComputeKEEff : public Compute {
   ~ComputeKEEff() {};
   void init();
   double compute_scalar();
-  
+
  private:
   double pfactor;
 };
- 
+
 }
 
 #endif
diff --git a/src/USER-EFF/compute_temp_deform_eff.cpp b/src/USER-EFF/compute_temp_deform_eff.cpp
index 68e73a83d1..6923725912 100644
--- a/src/USER-EFF/compute_temp_deform_eff.cpp
+++ b/src/USER-EFF/compute_temp_deform_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -43,7 +43,7 @@ ComputeTempDeformEff::ComputeTempDeformEff(LAMMPS *lmp, int narg, char **arg) :
 {
   if (narg != 3) error->all(FLERR,"Illegal compute temp/deform/eff command");
 
-  if (!atom->electron_flag) 
+  if (!atom->electron_flag)
     error->all(FLERR,"Compute temp/deform/eff requires atom style electron");
 
   scalar_flag = vector_flag = 1;
@@ -79,7 +79,7 @@ void ComputeTempDeformEff::init()
 
   // check fix deform remap settings
 
-  for (i = 0; i < modify->nfix; i++) 
+  for (i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       if (((FixDeform *) modify->fix[i])->remapflag == X_REMAP &&
           comm->me == 0)
@@ -98,7 +98,7 @@ void ComputeTempDeformEff::dof_compute()
   double natoms = group->count(igroup);
   dof = domain->dimension * natoms;
   dof -= extra_dof + fix_dof;
-  
+
   // just include nuclear dof
 
   int *spin = atom->spin;
@@ -113,9 +113,9 @@ void ComputeTempDeformEff::dof_compute()
   int nelectrons;
   MPI_Allreduce(&one,&nelectrons,1,MPI_INT,MPI_SUM,world);
 
-  // Assume 3/2 k T per nucleus 
+  // Assume 3/2 k T per nucleus
   dof -= domain->dimension * nelectrons;
-  
+
   if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz);
   else tfactor = 0.0;
 }
@@ -125,9 +125,9 @@ void ComputeTempDeformEff::dof_compute()
 double ComputeTempDeformEff::compute_scalar()
 {
   double lamda[3],vstream[3],vthermal[3];
-  
+
   invoked_scalar = update->ntimestep;
-  
+
   double **x = atom->x;
   double **v = atom->v;
   double *ervel = atom->ervel;
@@ -141,30 +141,30 @@ double ComputeTempDeformEff::compute_scalar()
   // lamda = 0-1 triclinic lamda coords
   // vstream = streaming velocity = Hrate*lamda + Hratelo
   // vthermal = thermal velocity = v - vstream
-  
+
   double *h_rate = domain->h_rate;
   double *h_ratelo = domain->h_ratelo;
-  
-  double t = 0.0; 
- 
+
+  double t = 0.0;
+
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
         h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       vthermal[0] = v[i][0] - vstream[0];
       vthermal[1] = v[i][1] - vstream[1];
       vthermal[2] = v[i][2] - vstream[2];
-      
+
       if (mass) {
-        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] + 
+        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
               vthermal[2]*vthermal[2])* mass[type[i]];
         if (fabs(spin[i])==1) t += mefactor*mass[type[i]]*ervel[i]*ervel[i];
       }
     }
-  
+
   MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
   if (dynamic) dof_compute();
   scalar *= tfactor;
@@ -176,14 +176,14 @@ double ComputeTempDeformEff::compute_scalar()
 void ComputeTempDeformEff::compute_vector()
 {
   double lamda[3],vstream[3],vthermal[3];
-  
+
   invoked_vector = update->ntimestep;
-  
+
   double **x = atom->x;
   double **v = atom->v;
   double *ervel = atom->ervel;
   double *mass = atom->mass;
-  int *spin = atom->spin; 
+  int *spin = atom->spin;
   int *type = atom->type;
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
@@ -191,23 +191,23 @@ void ComputeTempDeformEff::compute_vector()
 
   double *h_rate = domain->h_rate;
   double *h_ratelo = domain->h_ratelo;
- 
+
   double massone,t[6];
   for (int i = 0; i < 6; i++) t[i] = 0.0;
-  
+
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
         h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       vthermal[0] = v[i][0] - vstream[0];
       vthermal[1] = v[i][1] - vstream[1];
       vthermal[2] = v[i][2] - vstream[2];
-      
+
       massone = mass[type[i]];
-      t[0] += massone * vthermal[0]*vthermal[0]; 
+      t[0] += massone * vthermal[0]*vthermal[0];
       t[1] += massone * vthermal[1]*vthermal[1];
       t[2] += massone * vthermal[2]*vthermal[2];
       t[3] += massone * vthermal[0]*vthermal[1];
@@ -219,7 +219,7 @@ void ComputeTempDeformEff::compute_vector()
         t[2] += mefactor * massone * ervel[i]*ervel[i];
       }
     }
-  
+
   MPI_Allreduce(t,vector,6,MPI_DOUBLE,MPI_SUM,world);
   for (int i = 0; i < 6; i++) vector[i] *= force->mvv2e;
 }
@@ -316,4 +316,3 @@ double ComputeTempDeformEff::memory_usage()
   double bytes = maxbias * sizeof(double);
   return bytes;
 }
-
diff --git a/src/USER-EFF/compute_temp_deform_eff.h b/src/USER-EFF/compute_temp_deform_eff.h
index 47f4409422..c5be074301 100644
--- a/src/USER-EFF/compute_temp_deform_eff.h
+++ b/src/USER-EFF/compute_temp_deform_eff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-EFF/compute_temp_eff.cpp b/src/USER-EFF/compute_temp_eff.cpp
index cf406c53e6..ea4474eb0c 100644
--- a/src/USER-EFF/compute_temp_eff.cpp
+++ b/src/USER-EFF/compute_temp_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -32,18 +32,18 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTempEff::ComputeTempEff(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTempEff::ComputeTempEff(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (!atom->electron_flag) 
+  if (!atom->electron_flag)
     error->all(FLERR,"Compute temp/eff requires atom style electron");
 
   scalar_flag = vector_flag = 1;
   size_vector = 6;
-  extscalar = 0; 
+  extscalar = 0;
   extvector = 1;
   tempflag = 1;
-  
+
   vector = new double[size_vector];
 }
 
@@ -70,7 +70,7 @@ void ComputeTempEff::dof_compute()
 {
   double natoms = group->count(igroup);
   dof = domain->dimension * natoms;
-  dof -= extra_dof + fix_dof;	
+  dof -= extra_dof + fix_dof;
 
   int *spin = atom->spin;
   int *mask = atom->mask;
@@ -84,7 +84,7 @@ void ComputeTempEff::dof_compute()
   int nelectrons;
   MPI_Allreduce(&one,&nelectrons,1,MPI_INT,MPI_SUM,world);
 
-  // Assume 3/2 k T per nucleus 
+  // Assume 3/2 k T per nucleus
 
   dof -= domain->dimension * nelectrons;
 
@@ -108,11 +108,11 @@ double ComputeTempEff::compute_scalar()
   double mefactor = domain->dimension/4.0;
 
   double t = 0.0;
-   
+
   if (mass) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * 
+        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
           mass[type[i]];
         if (fabs(spin[i])==1) t += mefactor*mass[type[i]]*ervel[i]*ervel[i];
       }
diff --git a/src/USER-EFF/compute_temp_eff.h b/src/USER-EFF/compute_temp_eff.h
index 197dd4dbc5..18a6a6ecb5 100644
--- a/src/USER-EFF/compute_temp_eff.h
+++ b/src/USER-EFF/compute_temp_eff.h
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -23,7 +23,7 @@ ComputeStyle(temp/eff,ComputeTempEff)
 #include "compute.h"
 
 namespace LAMMPS_NS {
-	
+
 class ComputeTempEff : public Compute {
  public:
   ComputeTempEff(class LAMMPS *, int, char **);
@@ -31,7 +31,7 @@ class ComputeTempEff : public Compute {
   void init();
   double compute_scalar();
   void compute_vector();
-  
+
  private:
   int fix_dof;
   double tfactor;
@@ -39,7 +39,7 @@ class ComputeTempEff : public Compute {
 
   void dof_compute();
 };
-	
+
 }
 
 #endif
diff --git a/src/USER-EFF/compute_temp_region_eff.cpp b/src/USER-EFF/compute_temp_region_eff.cpp
index 0dd2bf3cf6..5e8a42421b 100644
--- a/src/USER-EFF/compute_temp_region_eff.cpp
+++ b/src/USER-EFF/compute_temp_region_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -32,10 +32,10 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTempRegionEff::ComputeTempRegionEff(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTempRegionEff::ComputeTempRegionEff(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
-  if (!atom->electron_flag) 
+  if (!atom->electron_flag)
     error->all(FLERR,"Compute temp/region/eff requires atom style electron");
 
   if (narg != 4) error->all(FLERR,"Illegal compute temp/region/eff command");
@@ -46,14 +46,14 @@ ComputeTempRegionEff::ComputeTempRegionEff(LAMMPS *lmp, int narg, char **arg) :
   int n = strlen(arg[3]) + 1;
   idregion = new char[n];
   strcpy(idregion,arg[3]);
-  
+
   scalar_flag = vector_flag = 1;
   size_vector = 6;
   extscalar = 0;
   extvector = 1;
   tempflag = 1;
   tempbias = 1;
-  
+
   maxbias = 0;
   vbiasall = NULL;
   vector = new double[6];
@@ -62,7 +62,7 @@ ComputeTempRegionEff::ComputeTempRegionEff(LAMMPS *lmp, int narg, char **arg) :
 /* ---------------------------------------------------------------------- */
 
 ComputeTempRegionEff::~ComputeTempRegionEff()
-{ 
+{
   delete [] idregion;
   memory->destroy(vbiasall);
   delete [] vector;
@@ -115,7 +115,7 @@ double ComputeTempRegionEff::compute_scalar()
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
         count++;
-        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * 
+        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
           mass[type[i]];
         if (fabs(spin[i])==1) {
           t += mefactor*mass[type[i]]*ervel[i]*ervel[i];
@@ -130,7 +130,7 @@ double ComputeTempRegionEff::compute_scalar()
   tarray[1] = t;
   MPI_Allreduce(tarray,tarray_all,2,MPI_DOUBLE,MPI_SUM,world);
   dof = domain->dimension * tarray_all[0] - extra_dof;
- 
+
   int one = 0;
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
@@ -166,7 +166,7 @@ void ComputeTempRegionEff::compute_vector()
 
   for (i = 0; i < nlocal; i++)
     if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-      massone = mass[type[i]]; 
+      massone = mass[type[i]];
 
       t[0] += massone * v[i][0]*v[i][0];
       t[1] += massone * v[i][1]*v[i][1];
@@ -174,7 +174,7 @@ void ComputeTempRegionEff::compute_vector()
       t[3] += massone * v[i][0]*v[i][1];
       t[4] += massone * v[i][0]*v[i][2];
       t[5] += massone * v[i][1]*v[i][2];
-                
+
       if (fabs(spin[i])==1) {
         t[0] += mefactor * massone * ervel[i]*ervel[i];
         t[1] += mefactor * massone * ervel[i]*ervel[i];
@@ -190,7 +190,7 @@ void ComputeTempRegionEff::compute_vector()
    remove velocity bias from atom I to leave thermal velocity
    NOTE: the following commands do not bias the radial electron velocities
 ------------------------------------------------------------------------- */
-  
+
 void ComputeTempRegionEff::remove_bias(int i, double *v)
 {
   double *x = atom->x[i];
@@ -201,13 +201,13 @@ void ComputeTempRegionEff::remove_bias(int i, double *v)
     vbias[1] = v[1];
     vbias[2] = v[2];
     v[0] = v[1] = v[2] = 0.0;
-  }     
+  }
 }
 
 /* ----------------------------------------------------------------------
    remove velocity bias from all atoms to leave thermal velocity
 ------------------------------------------------------------------------- */
-  
+
 void ComputeTempRegionEff::remove_bias_all()
 {
   double **x = atom->x;
@@ -219,10 +219,10 @@ void ComputeTempRegionEff::remove_bias_all()
     memory->destroy(vbiasall);
     maxbias = atom->nmax;
     memory->create(vbiasall,maxbias,3,"temp/region:vbiasall");
-  } 
+  }
 
   Region *region = domain->regions[iregion];
-  
+
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       if (region->match(x[i][0],x[i][1],x[i][2]))
@@ -274,4 +274,3 @@ double ComputeTempRegionEff::memory_usage()
   double bytes = maxbias * sizeof(double);
   return bytes;
 }
-
diff --git a/src/USER-EFF/compute_temp_region_eff.h b/src/USER-EFF/compute_temp_region_eff.h
index 3340fe8261..5d6d7561d6 100644
--- a/src/USER-EFF/compute_temp_region_eff.h
+++ b/src/USER-EFF/compute_temp_region_eff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ class ComputeTempRegionEff : public Compute {
   void restore_bias(int, double *);
   void restore_bias_all();
   double memory_usage();
- 
+
  protected:
   int iregion;
   char *idregion;
diff --git a/src/USER-EFF/fix_langevin_eff.cpp b/src/USER-EFF/fix_langevin_eff.cpp
index 88f38ab83a..8e90f1995f 100644
--- a/src/USER-EFF/fix_langevin_eff.cpp
+++ b/src/USER-EFF/fix_langevin_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -93,20 +93,20 @@ void FixLangevinEff::post_force_no_tally()
     if (tstyle == EQUAL) {
       t_target = input->variable->compute_equal(tvar);
       if (t_target < 0.0)
-	error->one(FLERR,"Fix langevin/eff variable returned negative temperature");
+        error->one(FLERR,"Fix langevin/eff variable returned negative temperature");
       tsqrt = sqrt(t_target);
     } else {
       if (nlocal > maxatom2) {
-	maxatom2 = atom->nmax;
-	memory->destroy(tforce);
-	memory->create(tforce,maxatom2,"langevin/eff:tforce");
+        maxatom2 = atom->nmax;
+        memory->destroy(tforce);
+        memory->create(tforce,maxatom2,"langevin/eff:tforce");
       }
       input->variable->compute_atom(tvar,igroup,tforce,1,0);
       for (int i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit)
-	    if (tforce[i] < 0.0) 
-	      error->one(FLERR,
-			 "Fix langevin/eff variable returned negative temperature");
+        if (mask[i] & groupbit)
+            if (tforce[i] < 0.0)
+              error->one(FLERR,
+                         "Fix langevin/eff variable returned negative temperature");
     }
     modify->addstep_compute(update->ntimestep + 1);
   }
@@ -119,7 +119,7 @@ void FixLangevinEff::post_force_no_tally()
   //   and added force has extra term not multiplied by v = 0
   // for ZEROFLAG:
   //   sum random force over all atoms in group
-  //   subtract sum/particles from each atom in group    
+  //   subtract sum/particles from each atom in group
 
   double fran[4],fsum[4],fsumall[4];
   fsum[0] = fsum[1] = fsum[2] = fsum[3] = 0.0;
@@ -155,7 +155,7 @@ void FixLangevinEff::post_force_no_tally()
   dofelectrons = domain->dimension*nelectrons;
   dofnuclei = dof-dofelectrons;
 
-  // thermal partitioning factor between nuclei and electrons 
+  // thermal partitioning factor between nuclei and electrons
   // extra dof from electron size
   double gfactor3=(double) (dof+nelectrons)/dofnuclei;
 
@@ -163,17 +163,17 @@ void FixLangevinEff::post_force_no_tally()
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
         if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	gamma1 = gfactor1[type[i]] * gfactor3;
-	gamma2 = gfactor2[type[i]] * tsqrt;
-	fran[0] = gamma2*(random->uniform()-0.5);
-	fran[1] = gamma2*(random->uniform()-0.5);
-	fran[2] = gamma2*(random->uniform()-0.5);
-	f[i][0] += gamma1*v[i][0] + fran[0];
-	f[i][1] += gamma1*v[i][1] + fran[1];
-	f[i][2] += gamma1*v[i][2] + fran[2];
-	fsum[0] += fran[0];
-	fsum[1] += fran[1];
-	fsum[2] += fran[2];
+        gamma1 = gfactor1[type[i]] * gfactor3;
+        gamma2 = gfactor2[type[i]] * tsqrt;
+        fran[0] = gamma2*(random->uniform()-0.5);
+        fran[1] = gamma2*(random->uniform()-0.5);
+        fran[2] = gamma2*(random->uniform()-0.5);
+        f[i][0] += gamma1*v[i][0] + fran[0];
+        f[i][1] += gamma1*v[i][1] + fran[1];
+        f[i][2] += gamma1*v[i][2] + fran[2];
+        fsum[0] += fran[0];
+        fsum[1] += fran[1];
+        fsum[2] += fran[2];
         if (fabs(spin[i])==1) {
           fran[3] = sqrtmefactor*gamma2*(random->uniform()-0.5);
           erforce[i] += mefactor*gamma1*ervel[i]+fran[3];
@@ -185,28 +185,28 @@ void FixLangevinEff::post_force_no_tally()
     temperature->compute_scalar();
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	gamma1 = gfactor1[type[i]] * gfactor3;
-	gamma2 = gfactor2[type[i]] * tsqrt;
-	temperature->remove_bias(i,v[i]);
-	fran[0] = gamma2*(random->uniform()-0.5);
-	fran[1] = gamma2*(random->uniform()-0.5);
-	fran[2] = gamma2*(random->uniform()-0.5);
-	if (v[i][0] != 0.0)
-	  f[i][0] += gamma1*v[i][0] + fran[0];
-	if (v[i][1] != 0.0)
-	  f[i][1] += gamma1*v[i][1] + fran[1];
-	if (v[i][2] != 0.0)
-	  f[i][2] += gamma1*v[i][2] + fran[2];
-	fsum[0] += fran[0];
-	fsum[1] += fran[1];
-	fsum[2] += fran[2];
+        if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
+        gamma1 = gfactor1[type[i]] * gfactor3;
+        gamma2 = gfactor2[type[i]] * tsqrt;
+        temperature->remove_bias(i,v[i]);
+        fran[0] = gamma2*(random->uniform()-0.5);
+        fran[1] = gamma2*(random->uniform()-0.5);
+        fran[2] = gamma2*(random->uniform()-0.5);
+        if (v[i][0] != 0.0)
+          f[i][0] += gamma1*v[i][0] + fran[0];
+        if (v[i][1] != 0.0)
+          f[i][1] += gamma1*v[i][1] + fran[1];
+        if (v[i][2] != 0.0)
+          f[i][2] += gamma1*v[i][2] + fran[2];
+        fsum[0] += fran[0];
+        fsum[1] += fran[1];
+        fsum[2] += fran[2];
         if (fabs(spin[i])==1) {
           fran[3] = sqrtmefactor*gamma2*(random->uniform()-0.5);
           if (ervel[i] != 0.0) erforce[i] += mefactor*gamma1*ervel[i]+fran[3];
           fsum[3] += fran[3];
         }
-	temperature->restore_bias(i,v[i]);
+        temperature->restore_bias(i,v[i]);
       }
     }
   }
@@ -221,9 +221,9 @@ void FixLangevinEff::post_force_no_tally()
     fsumall[3] /= nelectrons;
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	f[i][0] -= fsumall[0];
-	f[i][1] -= fsumall[1];
-	f[i][2] -= fsumall[2];
+        f[i][0] -= fsumall[0];
+        f[i][1] -= fsumall[1];
+        f[i][2] -= fsumall[2];
         if (fabs(spin[i])==1) erforce[i] -= fsumall[3];
       }
     }
@@ -273,20 +273,20 @@ void FixLangevinEff::post_force_tally()
     if (tstyle == EQUAL) {
       t_target = input->variable->compute_equal(tvar);
       if (t_target < 0.0)
-	error->one(FLERR,"Fix langevin/eff variable returned negative temperature");
+        error->one(FLERR,"Fix langevin/eff variable returned negative temperature");
       tsqrt = sqrt(t_target);
     } else {
       if (nlocal > maxatom2) {
-	maxatom2 = atom->nmax;
-	memory->destroy(tforce);
-	memory->create(tforce,maxatom2,"langevin/eff:tforce");
+        maxatom2 = atom->nmax;
+        memory->destroy(tforce);
+        memory->create(tforce,maxatom2,"langevin/eff:tforce");
       }
       input->variable->compute_atom(tvar,igroup,tforce,1,0);
       for (int i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit)
-	    if (tforce[i] < 0.0) 
-	      error->one(FLERR,
-			 "Fix langevin/eff variable returned negative temperature");
+        if (mask[i] & groupbit)
+            if (tforce[i] < 0.0)
+              error->one(FLERR,
+                         "Fix langevin/eff variable returned negative temperature");
     }
     modify->addstep_compute(update->ntimestep + 1);
   }
@@ -336,15 +336,15 @@ void FixLangevinEff::post_force_tally()
   if (which == NOBIAS) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	gamma1 = gfactor1[type[i]] * gfactor3;
-	gamma2 = gfactor2[type[i]] * tsqrt;
-	flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
-	flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
-	flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
-	f[i][0] += flangevin[i][0];
-	f[i][1] += flangevin[i][1];
-	f[i][2] += flangevin[i][2];
+        if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
+        gamma1 = gfactor1[type[i]] * gfactor3;
+        gamma2 = gfactor2[type[i]] * tsqrt;
+        flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
+        flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
+        flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
+        f[i][0] += flangevin[i][0];
+        f[i][1] += flangevin[i][1];
+        f[i][2] += flangevin[i][2];
         if (fabs(spin[i])==1) {
           erforcelangevin[i] = mefactor*gamma1*ervel[i]+sqrtmefactor*gamma2*(random->uniform()-0.5);
           erforce[i] += erforcelangevin[i];
@@ -355,25 +355,25 @@ void FixLangevinEff::post_force_tally()
     temperature->compute_scalar();
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	gamma1 = gfactor1[type[i]] * gfactor3;
-	gamma2 = gfactor2[type[i]] * tsqrt;
-	temperature->remove_bias(i,v[i]);
-	flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
-	flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
-	flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
-	if (v[i][0] != 0.0) f[i][0] += flangevin[i][0];
-	else flangevin[i][0] = 0.0;
-	if (v[i][1] != 0.0) f[i][1] += flangevin[i][1];
-	else flangevin[i][1] = 0.0;
-	if (v[i][2] != 0.0) f[i][2] += flangevin[i][2];
-	else flangevin[i][2] = 0.0;
+        if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
+        gamma1 = gfactor1[type[i]] * gfactor3;
+        gamma2 = gfactor2[type[i]] * tsqrt;
+        temperature->remove_bias(i,v[i]);
+        flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
+        flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
+        flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
+        if (v[i][0] != 0.0) f[i][0] += flangevin[i][0];
+        else flangevin[i][0] = 0.0;
+        if (v[i][1] != 0.0) f[i][1] += flangevin[i][1];
+        else flangevin[i][1] = 0.0;
+        if (v[i][2] != 0.0) f[i][2] += flangevin[i][2];
+        else flangevin[i][2] = 0.0;
         if (fabs(spin[i])==1) {
           erforcelangevin[i] = mefactor*gamma1*ervel[i]+sqrtmefactor*gamma2*(random->uniform()-0.5);
           if (ervel[i] != 0.0) erforce[i] += erforcelangevin[i];
           else erforcelangevin[i] = 0.0;
         }
-	temperature->restore_bias(i,v[i]);
+        temperature->restore_bias(i,v[i]);
       }
     }
   }
@@ -389,14 +389,14 @@ void FixLangevinEff::end_of_step()
 
   double **v = atom->v;
   int *mask = atom->mask;
-  int nlocal = atom->nlocal;  
+  int nlocal = atom->nlocal;
   int *spin = atom->spin;
 
   energy_onestep = 0.0;
- 
+
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
-      energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] + 
+      energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] +
           flangevin[i][2]*v[i][2];
       if (fabs(spin[i])==1) energy_onestep += erforcelangevin[i];
     }
@@ -413,15 +413,15 @@ double FixLangevinEff::compute_scalar()
 
   double **v = atom->v;
   int *mask = atom->mask;
-  int nlocal = atom->nlocal;  
+  int nlocal = atom->nlocal;
   int *spin = atom->spin;
 
   if (update->ntimestep == update->beginstep) {
     energy_onestep = 0.0;
-    for (int i = 0; i < nlocal; i++) 
+    for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] + 
-	  flangevin[i][2]*v[i][2];
+        energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] +
+          flangevin[i][2]*v[i][2];
         if (fabs(spin[i])==1) energy_onestep += erforcelangevin[i];
       }
     energy = 0.5*energy_onestep*update->dt;
@@ -429,8 +429,7 @@ double FixLangevinEff::compute_scalar()
 
   double energy_me = energy - 0.5*energy_onestep*update->dt;
 
-  double energy_all;	 
-  MPI_Allreduce(&energy_me,&energy_all,1,MPI_DOUBLE,MPI_SUM,world);	
+  double energy_all;
+  MPI_Allreduce(&energy_me,&energy_all,1,MPI_DOUBLE,MPI_SUM,world);
   return -energy_all;
 }
-
diff --git a/src/USER-EFF/fix_langevin_eff.h b/src/USER-EFF/fix_langevin_eff.h
index 6eb78ff9b9..81d8312916 100644
--- a/src/USER-EFF/fix_langevin_eff.h
+++ b/src/USER-EFF/fix_langevin_eff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-EFF/fix_nh_eff.cpp b/src/USER-EFF/fix_nh_eff.cpp
index 4258a081ba..fb1a968ec5 100644
--- a/src/USER-EFF/fix_nh_eff.cpp
+++ b/src/USER-EFF/fix_nh_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -32,12 +32,12 @@ enum{NOBIAS,BIAS};
 
 FixNHEff::FixNHEff(LAMMPS *lmp, int narg, char **arg) : FixNH(lmp, narg, arg)
 {
-  if (!atom->electron_flag) 
+  if (!atom->electron_flag)
     error->all(FLERR,"Fix nvt/nph/npt/eff requires atom style electron");
 }
 
 /* ----------------------------------------------------------------------
-   perform half-step update of electron radial velocities 
+   perform half-step update of electron radial velocities
 -----------------------------------------------------------------------*/
 
 void FixNHEff::nve_v()
@@ -59,11 +59,11 @@ void FixNHEff::nve_v()
   int itype;
   double dtfm;
 
-  for (int i = 0; i < nlocal; i++) {    
+  for (int i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
       if (fabs(spin[i])==1) {
-	dtfm = dtf / mass[type[i]];
-	ervel[i] = dtfm * erforce[i] / mefactor;
+        dtfm = dtf / mass[type[i]];
+        ervel[i] = dtfm * erforce[i] / mefactor;
       }
     }
   }
diff --git a/src/USER-EFF/fix_nh_eff.h b/src/USER-EFF/fix_nh_eff.h
index c51b6be014..74c30f978e 100644
--- a/src/USER-EFF/fix_nh_eff.h
+++ b/src/USER-EFF/fix_nh_eff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-EFF/fix_nph_eff.cpp b/src/USER-EFF/fix_nph_eff.cpp
index f75dbee35a..e580a3fc73 100644
--- a/src/USER-EFF/fix_nph_eff.cpp
+++ b/src/USER-EFF/fix_nph_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ FixNPHEff::FixNPHEff(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = (char *) "all";
@@ -56,7 +56,7 @@ FixNPHEff::FixNPHEff(LAMMPS *lmp, int narg, char **arg) :
   id_press = new char[n];
   strcpy(id_press,id);
   strcat(id_press,"_press");
-  
+
   newarg = new char*[4];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";
diff --git a/src/USER-EFF/fix_nph_eff.h b/src/USER-EFF/fix_nph_eff.h
index 9862bf8d99..10766ec96c 100644
--- a/src/USER-EFF/fix_nph_eff.h
+++ b/src/USER-EFF/fix_nph_eff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-EFF/fix_npt_eff.cpp b/src/USER-EFF/fix_npt_eff.cpp
index 53b3ab11e2..baea9a16ea 100644
--- a/src/USER-EFF/fix_npt_eff.cpp
+++ b/src/USER-EFF/fix_npt_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ FixNPTEff::FixNPTEff(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = (char *) "all";
@@ -56,7 +56,7 @@ FixNPTEff::FixNPTEff(LAMMPS *lmp, int narg, char **arg) :
   id_press = new char[n];
   strcpy(id_press,id);
   strcat(id_press,"_press");
-  
+
   newarg = new char*[4];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";
diff --git a/src/USER-EFF/fix_npt_eff.h b/src/USER-EFF/fix_npt_eff.h
index ace91a596d..11f059d733 100644
--- a/src/USER-EFF/fix_npt_eff.h
+++ b/src/USER-EFF/fix_npt_eff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-EFF/fix_nve_eff.cpp b/src/USER-EFF/fix_nve_eff.cpp
index 6ddff5e30c..afe442ba5e 100644
--- a/src/USER-EFF/fix_nve_eff.cpp
+++ b/src/USER-EFF/fix_nve_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,7 +35,7 @@ using namespace FixConst;
 FixNVEEff::FixNVEEff(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (!atom->electron_flag) 
+  if (!atom->electron_flag)
     error->all(FLERR,"Fix nve/eff requires atom style electron");
 
   time_integrate = 1;
@@ -44,7 +44,7 @@ FixNVEEff::FixNVEEff(LAMMPS *lmp, int narg, char **arg) :
 /* ---------------------------------------------------------------------- */
 
 int FixNVEEff::setmask()
-{   
+{
   int mask = 0;
   mask |= INITIAL_INTEGRATE;
   mask |= FINAL_INTEGRATE;
@@ -89,7 +89,7 @@ void FixNVEEff::initial_integrate(int vflag)
   if (igroup == atom->firstgroup) nlocal = atom->nfirst;
 
   // x + dt * [v + 0.5 * dt * (f / m)];
-  
+
   if (mass) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
@@ -114,7 +114,7 @@ void FixNVEEff::initial_integrate(int vflag)
 void FixNVEEff::final_integrate()
 {
   double dtfm;
-  
+
   double **v = atom->v;
   double *ervel = atom->ervel;
   double *erforce = atom->erforce;
@@ -126,7 +126,7 @@ void FixNVEEff::final_integrate()
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
   if (igroup == atom->firstgroup) nlocal = atom->nfirst;
-  
+
   // dyn_v[i] += m * dt * dyn_f[i];
 
   if (mass) {
@@ -172,4 +172,3 @@ void FixNVEEff::reset_dt()
   dtv = update->dt;
   dtf = 0.5 * update->dt * force->ftm2v;
 }
-
diff --git a/src/USER-EFF/fix_nve_eff.h b/src/USER-EFF/fix_nve_eff.h
index 68be95295f..de01aa9b3d 100644
--- a/src/USER-EFF/fix_nve_eff.h
+++ b/src/USER-EFF/fix_nve_eff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-EFF/fix_nvt_eff.cpp b/src/USER-EFF/fix_nvt_eff.cpp
index 0236f406e0..17e01a31bb 100644
--- a/src/USER-EFF/fix_nvt_eff.cpp
+++ b/src/USER-EFF/fix_nvt_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ FixNVTEff::FixNVTEff(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = group->names[igroup];
diff --git a/src/USER-EFF/fix_nvt_eff.h b/src/USER-EFF/fix_nvt_eff.h
index 139febcf3d..9b63345ef2 100644
--- a/src/USER-EFF/fix_nvt_eff.h
+++ b/src/USER-EFF/fix_nvt_eff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-EFF/fix_nvt_sllod_eff.cpp b/src/USER-EFF/fix_nvt_sllod_eff.cpp
index 17d58664db..4aecdd4fde 100644
--- a/src/USER-EFF/fix_nvt_sllod_eff.cpp
+++ b/src/USER-EFF/fix_nvt_sllod_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -78,8 +78,8 @@ void FixNVTSllodEff::init()
   for (i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
-	error->all(FLERR,"Using fix nvt/sllod/eff with inconsistent fix deform "
-		   "remap option");
+        error->all(FLERR,"Using fix nvt/sllod/eff with inconsistent fix deform "
+                   "remap option");
       break;
     }
   if (i == modify->nfix)
diff --git a/src/USER-EFF/fix_nvt_sllod_eff.h b/src/USER-EFF/fix_nvt_sllod_eff.h
index 852ffb89c4..29676b6e30 100644
--- a/src/USER-EFF/fix_nvt_sllod_eff.h
+++ b/src/USER-EFF/fix_nvt_sllod_eff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-EFF/fix_temp_rescale_eff.cpp b/src/USER-EFF/fix_temp_rescale_eff.cpp
index 8d9fce342a..0482ae36d5 100644
--- a/src/USER-EFF/fix_temp_rescale_eff.cpp
+++ b/src/USER-EFF/fix_temp_rescale_eff.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -137,26 +137,26 @@ void FixTempRescaleEff::end_of_step()
     if (which == NOBIAS) {
       energy += (t_current-t_target) * efactor;
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  v[i][0] *= factor;
-	  v[i][1] *= factor;
-	  v[i][2] *= factor;
-          if (abs(spin[i])==1) 
+        if (mask[i] & groupbit) {
+          v[i][0] *= factor;
+          v[i][1] *= factor;
+          v[i][2] *= factor;
+          if (abs(spin[i])==1)
             ervel[i] *= factor;
-	}
+        }
       }
     } else {
       energy += (t_current-t_target) * efactor;
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  temperature->remove_bias(i,v[i]);
-	  v[i][0] *= factor;
-	  v[i][1] *= factor;
-	  v[i][2] *= factor;
+        if (mask[i] & groupbit) {
+          temperature->remove_bias(i,v[i]);
+          v[i][0] *= factor;
+          v[i][1] *= factor;
+          v[i][2] *= factor;
           if (abs(spin[i])==1)
-            ervel[i] *= factor;          
-	  temperature->restore_bias(i,v[i]);
-	}
+            ervel[i] *= factor;
+          temperature->restore_bias(i,v[i]);
+        }
       }
     }
 
@@ -204,4 +204,3 @@ double FixTempRescaleEff::compute_scalar()
 {
   return energy;
 }
- 
diff --git a/src/USER-EFF/fix_temp_rescale_eff.h b/src/USER-EFF/fix_temp_rescale_eff.h
index 9ac4c003ad..54155bcc53 100644
--- a/src/USER-EFF/fix_temp_rescale_eff.h
+++ b/src/USER-EFF/fix_temp_rescale_eff.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp
index 3641bf372d..ae67bac2a0 100644
--- a/src/USER-EFF/pair_eff_cut.cpp
+++ b/src/USER-EFF/pair_eff_cut.cpp
@@ -2,12 +2,12 @@
    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
    http://lammps.sandia.gov, Sandia National Laboratories
    Steve Plimpton, sjplimp@sandia.gov
-   
+
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
-   
+
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
@@ -75,7 +75,7 @@ void PairEffCut::compute(int eflag, int vflag)
   double ecp_epauli, ecp_fpair, ecp_e1rforce, ecp_e2rforce;
   double rsq,rc;
   int *ilist,*jlist,*numneigh,**firstneigh;
-  
+
   energy = eke = epauli = ecoul = errestrain = 0.0;
   // pvector = [KE, Pauli, ecoul, radial_restraint]
   for (i=0; i<4; i++) pvector[i] = 0.0;
@@ -88,7 +88,7 @@ void PairEffCut::compute(int eflag, int vflag)
   double *q = atom->q;
   double *erforce = atom->erforce;
   double *eradius = atom->eradius;
-  int *spin = atom->spin;	
+  int *spin = atom->spin;
   int *type = atom->type;
   int nlocal = atom->nlocal;
 
@@ -99,7 +99,7 @@ void PairEffCut::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -110,7 +110,7 @@ void PairEffCut::compute(int eflag, int vflag)
     itype = type[i];
     jlist = firstneigh[i];
     jnum = numneigh[i];
-  
+
     // add electron wavefuntion kinetic energy (not pairwise)
 
     if (abs(spin[i])==1 || spin[i]==2) {
@@ -120,7 +120,7 @@ void PairEffCut::compute(int eflag, int vflag)
       s_fpair = 0.0;
 
       KinElec(eradius[i],&eke,&e1rforce);
- 
+
       // Fixed-core
       if (spin[i] == 2) {
         // KE(2s)+Coul(1s-1s)+Coul(2s-nuclei)+Pauli(2s)
@@ -144,10 +144,10 @@ void PairEffCut::compute(int eflag, int vflag)
       epauli *= hhmss2e;
       s_fpair *= hhmss2e;
       e1rforce *= hhmss2e;
-      
+
       // Sum up contributions
       energy = eke + epauli + ecoul;
-      fpair = fpair + s_fpair;	
+      fpair = fpair + s_fpair;
 
       erforce[i] += e1rforce;
 
@@ -173,26 +173,26 @@ void PairEffCut::compute(int eflag, int vflag)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       rc = sqrt(rsq);
-      
+
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	
+
         energy = ecoul = epauli = ecp_epauli = 0.0;
         fx = fy = fz = fpair = s_fpair = ecp_fpair = 0.0;
 
         double taper = sqrt(cutsq[itype][jtype]);
         double dist = rc / taper;
-        double spline = cutoff(dist); 
+        double spline = cutoff(dist);
         double dspline = dcutoff(dist) / taper;
 
-	// nucleus (i) - nucleus (j) Coul interaction
+        // nucleus (i) - nucleus (j) Coul interaction
 
-	if (spin[i] == 0 && spin[j] == 0) {
-	  double qxq = q[i]*q[j];
+        if (spin[i] == 0 && spin[j] == 0) {
+          double qxq = q[i]*q[j];
 
           ElecNucNuc(qxq, rc, &ecoul, &fpair);
-	}
+        }
 
         // fixed-core (i) - nucleus (j) nuclear Coul interaction
         else if (spin[i] == 2 && spin[j] == 0) {
@@ -228,39 +228,39 @@ void PairEffCut::compute(int eflag, int vflag)
           ElecCoreNuc(qxq, rc, eradius[j], &ecoul, &fpair);
         }
 
-	// nucleus (i) - electron (j) Coul interaction
+        // nucleus (i) - electron (j) Coul interaction
 
-	else if  (spin[i] == 0 && abs(spin[j]) == 1) {
+        else if  (spin[i] == 0 && abs(spin[j]) == 1) {
           e1rforce = 0.0;
 
           ElecNucElec(q[i],rc,eradius[j],&ecoul,&fpair,&e1rforce);
 
-	  e1rforce = spline * qqrd2e * e1rforce;
-	  erforce[j] += e1rforce;
-	  
+          e1rforce = spline * qqrd2e * e1rforce;
+          erforce[j] += e1rforce;
+
           // Radial electron virial, iff flexible pressure flag set
-	  if (evflag && flexible_pressure_flag) { 
+          if (evflag && flexible_pressure_flag) {
             e1rvirial = eradius[j] * e1rforce;
             ev_tally_eff(j,j,nlocal,newton_pair,0.0,e1rvirial);
           }
-	}
+        }
 
-	// electron (i) - nucleus (j) Coul interaction
+        // electron (i) - nucleus (j) Coul interaction
 
-	else if (abs(spin[i]) == 1 && spin[j] == 0) {
+        else if (abs(spin[i]) == 1 && spin[j] == 0) {
           e1rforce = 0.0;
 
           ElecNucElec(q[j],rc,eradius[i],&ecoul,&fpair,&e1rforce);
 
-	  e1rforce = spline * qqrd2e * e1rforce;
-	  erforce[i] += e1rforce;
-	  
+          e1rforce = spline * qqrd2e * e1rforce;
+          erforce[i] += e1rforce;
+
           // Radial electron virial, iff flexible pressure flag set
-	  if (evflag && flexible_pressure_flag) {
+          if (evflag && flexible_pressure_flag) {
             e1rvirial = eradius[i] * e1rforce;
             ev_tally_eff(i,i,nlocal,newton_pair,0.0,e1rvirial);
           }
-	}
+        }
 
         // electron (i) - electron (j) interactions
 
@@ -342,7 +342,7 @@ void PairEffCut::compute(int eflag, int vflag)
           epauli *= hhmss2e;
           s_fpair *= hhmss2e;
 
-          // only update virial for i electron 
+          // only update virial for i electron
           e2rforce = spline * (qqrd2e * e2rforce + hhmss2e * s_e2rforce);
           erforce[i] += e2rforce;
 
@@ -373,7 +373,7 @@ void PairEffCut::compute(int eflag, int vflag)
                          &e1rforce,&e2rforce);
           ElecElecElec(rc,eradius[i],eradius[j],&ecoul,&fpair,
                          &e1rforce,&e2rforce);
-          
+
           PauliElecElec(0,rc,eradius[i],eradius[j],&epauli,
                        &s_fpair,&s_e1rforce,&s_e2rforce);
           PauliElecElec(1,rc,eradius[i],eradius[j],&epauli,
@@ -473,7 +473,7 @@ void PairEffCut::compute(int eflag, int vflag)
         else if (spin[i] == 3 && abs(spin[j]) == 3) {
           double qxq = q[i]*q[j];
 
-          ElecCoreCore(qxq,rc,eradius[i],eradius[j],&ecoul,&fpair); 
+          ElecCoreCore(qxq,rc,eradius[i],eradius[j],&ecoul,&fpair);
         }
 
         // Apply Coulomb conversion factor for all cases
@@ -506,41 +506,41 @@ void PairEffCut::compute(int eflag, int vflag)
         if (eflag_global) {
           if (newton_pair) {
             pvector[1] += spline * epauli;
-            pvector[2] += spline * ecoul; 
+            pvector[2] += spline * ecoul;
           }
           else {
             halfpauli = 0.5 * spline * epauli;
             halfcoul = 0.5 * spline * ecoul;
             if (i < nlocal) {
               pvector[1] += halfpauli;
-              pvector[2] += halfcoul; 
+              pvector[2] += halfcoul;
             }
             if (j < nlocal) {
               pvector[1] += halfpauli;
-              pvector[2] += halfcoul; 
+              pvector[2] += halfcoul;
             }
           }
         }
 
       }
     }
-    
+
     // limit electron stifness (size) for periodic systems, to max=half-box-size
 
     if (abs(spin[i]) == 1 && limit_size_flag) {
-      double half_box_length=0, dr, kfactor=hhmss2e*1.0; 
+      double half_box_length=0, dr, kfactor=hhmss2e*1.0;
       e1rforce = errestrain = 0.0;
 
       if (domain->xperiodic == 1 || domain->yperiodic == 1 ||
-	  domain->zperiodic == 1) {
-	delx = domain->boxhi[0]-domain->boxlo[0];
-	dely = domain->boxhi[1]-domain->boxlo[1];
-	delz = domain->boxhi[2]-domain->boxlo[2];
-	half_box_length = 0.5 * MIN(delx, MIN(dely, delz));
-	if (eradius[i] > half_box_length) {
-	  dr = eradius[i]-half_box_length;
-	  errestrain=0.5*kfactor*dr*dr;
-	  e1rforce=-kfactor*dr;
+          domain->zperiodic == 1) {
+        delx = domain->boxhi[0]-domain->boxlo[0];
+        dely = domain->boxhi[1]-domain->boxlo[1];
+        delz = domain->boxhi[2]-domain->boxlo[2];
+        half_box_length = 0.5 * MIN(delx, MIN(dely, delz));
+        if (eradius[i] > half_box_length) {
+          dr = eradius[i]-half_box_length;
+          errestrain=0.5*kfactor*dr*dr;
+          e1rforce=-kfactor*dr;
           if (eflag_global) pvector[3] += errestrain;
 
           erforce[i] += e1rforce;
@@ -560,7 +560,7 @@ void PairEffCut::compute(int eflag, int vflag)
     virial_fdotr_compute();
     if (flexible_pressure_flag) virial_eff_compute();
   }
-}	
+}
 
 /* ----------------------------------------------------------------------
    eff-specific contribution to global virial
@@ -574,7 +574,7 @@ void PairEffCut::virial_eff_compute()
   int *spin = atom->spin;
 
   // sum over force on all particles including ghosts
-  
+
   if (neighbor->includegroup == 0) {
     int nall = atom->nlocal + atom->nghost;
     for (int i = 0; i < nall; i++) {
@@ -585,10 +585,10 @@ void PairEffCut::virial_eff_compute()
         virial[2] += e_virial;
       }
     }
-    
+
   // neighbor includegroup flag is set
   // sum over force on initial nfirst particles and ghosts
-    
+
   } else {
     int nall = atom->nfirst;
     for (int i = 0; i < nall; i++) {
@@ -599,7 +599,7 @@ void PairEffCut::virial_eff_compute()
         virial[2] += e_virial;
       }
     }
-    
+
     nall = atom->nlocal + atom->nghost;
     for (int i = atom->nlocal; i < nall; i++) {
       if (spin[i]) {
@@ -618,7 +618,7 @@ void PairEffCut::virial_eff_compute()
 ------------------------------------------------------------------------- */
 
 void PairEffCut::ev_tally_eff(int i, int j, int nlocal, int newton_pair,
-			      double energy, double e_virial)
+                              double energy, double e_virial)
 {
   double energyhalf;
   double partial_evirial = e_virial/3.0;
@@ -634,7 +634,7 @@ void PairEffCut::ev_tally_eff(int i, int j, int nlocal, int newton_pair,
         energyhalf = 0.5*energy;
         if (i < nlocal)
           eng_coul += energyhalf;
-        if (j < nlocal) 
+        if (j < nlocal)
           eng_coul += energyhalf;
       }
     }
@@ -665,7 +665,7 @@ void PairEffCut::ev_tally_eff(int i, int j, int nlocal, int newton_pair,
           vatom[i][2] += half_partial_evirial;
         }
       }
-      if (spin[j]) { 
+      if (spin[j]) {
         if (newton_pair || j < nlocal) {
           vatom[j][0] += half_partial_evirial;
           vatom[j][1] += half_partial_evirial;
@@ -684,12 +684,12 @@ void PairEffCut::allocate()
 {
   allocated = 1;
   int n = atom->ntypes;
-  
+
   memory->create(setflag,n+1,n+1,"pair:setflag");
   for (int i = 1; i <= n; i++)
     for (int j = i; j <= n; j++)
       setflag[i][j] = 0;
-  
+
   memory->create(cutsq,n+1,n+1,"pair:cutsq");
   memory->create(cut,n+1,n+1,"pair:cut");
 }
@@ -700,7 +700,7 @@ void PairEffCut::allocate()
 
 void PairEffCut::settings(int narg, char **arg)
 {
-  if (narg != 1 && narg != 3 && narg != 5 && narg != 7) 
+  if (narg != 1 && narg != 3 && narg != 5 && narg != 7)
     error->all(FLERR,"Illegal pair_style command");
 
   // Defaults ECP parameters for Si
@@ -739,23 +739,23 @@ void PairEffCut::settings(int narg, char **arg)
       PAULI_CORE_C = force->numeric(arg[6]);
     }
   }
-  
+
   // Need to introduce 2 new constants w/out changing update.cpp
-  if (force->qqr2e==332.06371) {	// i.e. Real units chosen
-    h2e = 627.509;                      // hartree->kcal/mol    
+  if (force->qqr2e==332.06371) {        // i.e. Real units chosen
+    h2e = 627.509;                      // hartree->kcal/mol
     hhmss2e = 175.72044219620075;       // hartree->kcal/mol * (Bohr->Angstrom)^2
-  } else if (force->qqr2e==1.0) {	// electron units
+  } else if (force->qqr2e==1.0) {        // electron units
     h2e = 1.0;
     hhmss2e = 1.0;
   } else error->all(FLERR,"Check your units");
 
   // reset cutoffs that have been explicitly set
-  
+
   if (allocated) {
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -767,14 +767,14 @@ void PairEffCut::coeff(int narg, char **arg)
 {
   if (narg < 2 || narg > 3) error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
-  
+
   int ilo,ihi,jlo,jhi;
   force->bounds(arg[0],atom->ntypes,ilo,ihi);
   force->bounds(arg[1],atom->ntypes,jlo,jhi);
-  
+
   double cut_one = cut_global;
   if (narg == 3) cut_one = atof(arg[2]);
-  
+
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
     for (int j = MAX(jlo,i); j <= jhi; j++) {
@@ -783,7 +783,7 @@ void PairEffCut::coeff(int narg, char **arg)
       count++;
     }
   }
-  
+
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
@@ -795,25 +795,25 @@ void PairEffCut::init_style()
 {
   // error and warning checks
 
-  if (!atom->q_flag || !atom->spin_flag || 
+  if (!atom->q_flag || !atom->spin_flag ||
       !atom->eradius_flag || !atom->erforce_flag)
     error->all(FLERR,"Pair eff/cut requires atom attributes "
-	       "q, spin, eradius, erforce");
+               "q, spin, eradius, erforce");
 
   // add hook to minimizer for eradius and erforce
 
-  if (update->whichflag == 2) 
+  if (update->whichflag == 2)
     int ignore = update->minimize->request(this,1,0.01);
 
   // make sure to use the appropriate timestep when using real units
 
-  if (update->whichflag == 1) { 
+  if (update->whichflag == 1) {
     if (force->qqr2e == 332.06371 && update->dt == 1.0)
       error->all(FLERR,"You must lower the default real units timestep for pEFF ");
   }
 
   // need a half neigh list and optionally a granular history neigh list
- 
+
   int irequest = neighbor->request(this);
 }
 
@@ -825,7 +825,7 @@ double PairEffCut::init_one(int i, int j)
 {
   if (setflag[i][j] == 0)
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
-  
+
   return cut[i][j];
 }
 
@@ -836,7 +836,7 @@ double PairEffCut::init_one(int i, int j)
 void PairEffCut::write_restart(FILE *fp)
 {
   write_restart_settings(fp);
-  
+
   int i,j;
   for (i = 1; i <= atom->ntypes; i++)
     for (j = i; j <= atom->ntypes; j++) {
@@ -853,7 +853,7 @@ void PairEffCut::read_restart(FILE *fp)
 {
   read_restart_settings(fp);
   allocate();
-  
+
   int i,j;
   int me = comm->me;
   for (i = 1; i <= atom->ntypes; i++)
@@ -861,8 +861,8 @@ void PairEffCut::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) fread(&cut[i][j],sizeof(double),1,fp);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) fread(&cut[i][j],sizeof(double),1,fp);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -947,12 +947,12 @@ void PairEffCut::min_x_set(int ignore)
   int *spin = atom->spin;
   int nlocal = atom->nlocal;
 
-  for (int i = 0; i < nlocal; i++) 
+  for (int i = 0; i < nlocal; i++)
     if (spin[i]) eradius[i] = exp(min_eradius[i]);
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double PairEffCut::memory_usage()
diff --git a/src/USER-EFF/pair_eff_cut.h b/src/USER-EFF/pair_eff_cut.h
index 7519d7335d..0253359883 100644
--- a/src/USER-EFF/pair_eff_cut.h
+++ b/src/USER-EFF/pair_eff_cut.h
@@ -2,12 +2,12 @@
  LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
  http://lammps.sandia.gov, Sandia National Laboratories
  Steve Plimpton, sjplimp@sandia.gov
- 
+
  Copyright (2003) Sandia Corporation.  Under the terms of Contract
  DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
- certain rights in this software.  This software is distributed under 
+ certain rights in this software.  This software is distributed under
  the GNU General Public License.
- 
+
  See the README file in the top-level LAMMPS directory.
  ------------------------------------------------------------------------- */
 
@@ -38,7 +38,7 @@ class PairEffCut : public Pair {
   void read_restart(FILE *);
   virtual void write_restart_settings(FILE *);
   virtual void read_restart_settings(FILE *);
-  
+
   void min_xf_pointers(int, double **, double **);
   void min_xf_get(int);
   void min_x_set(int);
@@ -50,7 +50,7 @@ class PairEffCut : public Pair {
   double **cut;
   double PAULI_CORE_A, PAULI_CORE_B, PAULI_CORE_C;
   double hhmss2e, h2e;
-  
+
   int nmax;
   double *min_eradius,*min_erforce;
 
@@ -58,7 +58,7 @@ class PairEffCut : public Pair {
   void virial_eff_compute();
   void ev_tally_eff(int, int, int, int, double, double);
 };
- 
+
 }
 
 #endif
diff --git a/src/USER-EFF/pair_eff_inline.h b/src/USER-EFF/pair_eff_inline.h
index 6bd44fb7c2..30aad413b8 100644
--- a/src/USER-EFF/pair_eff_inline.h
+++ b/src/USER-EFF/pair_eff_inline.h
@@ -2,12 +2,12 @@
  LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
  http://lammps.sandia.gov, Sandia National Laboratories
  Steve Plimpton, sjplimp@sandia.gov
- 
+
  Copyright (2003) Sandia Corporation.  Under the terms of Contract
  DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
- certain rights in this software.  This software is distributed under 
+ certain rights in this software.  This software is distributed under
  the GNU General Public License.
- 
+
  See the README file in the top-level LAMMPS directory.
  ------------------------------------------------------------------------- */
 
@@ -194,7 +194,7 @@ inline double ipoly1(double x)
   /* First derivative P'(x) in the range x < 2 */
   int i;
   double b0, b1, b2;
-  
+
   b1 = 0.0; b0 = 0.0; x *= 2;
   for (i = DERF_TERMS; i >= 0; i--)
     {
@@ -228,11 +228,11 @@ inline double ipoly01(double x)
 inline double ierfoverx1(double x, double *df)
 {
   // Computes Erf(x)/x and its first derivative
-  
+
   double t, f;
   double x2;                                   // x squared
   double exp_term, recip_x;
-  
+
   if (x < 2.0)
     {
       /* erf(x) = x * y(t)     */
@@ -261,7 +261,7 @@ inline void KinElec(double radius, double *eke, double *frc)
 {
   *eke += 1.5 / (radius * radius);
   *frc += 3.0 / (radius * radius * radius);
-}        
+}
 
 /* ---------------------------------------------------------------------- */
 
@@ -273,28 +273,28 @@ inline void ElecNucNuc(double q, double rc, double *ecoul, double *frc)
 
 /* ---------------------------------------------------------------------- */
 
-inline void ElecNucElec(double q, double rc, double re1, 
-			double *ecoul, double *frc, double *fre1)
+inline void ElecNucElec(double q, double rc, double re1,
+                        double *ecoul, double *frc, double *fre1)
 {
   double a, arc;
   double coeff_a;
-  
+
   /* sqrt(2) */
   coeff_a = 1.4142135623730951;
-  
+
   /* E = -Z/r Erf(a r / re) */
   /* constants: sqrt(2), 2 / sqrt(pi) */
   a = coeff_a / re1;
   arc = a * rc;
-  
+
   /* Interaction between nuclear point charge and Gaussian electron */
   double E, dEdr, dEdr1, f, df;
-  
+
   f = ierfoverx1(arc, &df);
   dEdr = q * a * a * df;
   dEdr1 = -q * (a / re1) * (f + arc * df);
   E = -q * a * f;
-  
+
   *ecoul += E;
   *frc += dEdr;
   *fre1 += dEdr1;
@@ -302,40 +302,40 @@ inline void ElecNucElec(double q, double rc, double re1,
 
 /* ---------------------------------------------------------------------- */
 
-inline void ElecElecElec(double rc, double re1, double re2, 
-			 double *ecoul, double *frc, double *fre1, 
-			 double *fre2)
+inline void ElecElecElec(double rc, double re1, double re2,
+                         double *ecoul, double *frc, double *fre1,
+                         double *fre2)
 {
   double a, arc, re, fre;
   double coeff_a;
-  
+
   /* sqrt(2) */
   coeff_a = 1.4142135623730951;
-  
+
   re = sqrt(re1 * re1 + re2 * re2);
-  
+
   double ratio;
   ratio = rc / re;
-  
+
   /* constants: sqrt(2), 2 / sqrt(pi) */
   a = coeff_a / re;
   arc = a * rc;
-  
+
   /* V_elecelec = E * F                              */
   /* where E = -Z/r Erf(a r / re)                    */
   /*       F = (1 - (b s + c s^2) exp(-d s^2))       */
   /* and s = r / re                                  */
-  
+
   double E, dEdr, dEdr1, dEdr2, f, df;
-  
+
   f = ierfoverx1(arc, &df);
   dEdr = -a * a * df;
   fre = a * (f + arc * df) / (re * re);
   dEdr1 = fre * re1;
   dEdr2 = fre * re2;
-  
+
   E = a * f;
-  
+
   *ecoul += E;
   *frc += dEdr;
   *fre1 += dEdr1;
@@ -355,7 +355,7 @@ inline void ElecCoreNuc(double q, double rc, double re1, double *ecoul, double *
   arc = a * rc;
 
   f = ierfoverx1(arc, &df);
-  dEdr = -q * a * a * df; 
+  dEdr = -q * a * a * df;
   E = q * a * f;
 
   *ecoul += E;
@@ -364,7 +364,7 @@ inline void ElecCoreNuc(double q, double rc, double re1, double *ecoul, double *
 
 /* ---------------------------------------------------------------------- */
 
-inline void ElecCoreCore(double q, double rc, double re1, double re2, 
+inline void ElecCoreCore(double q, double rc, double re1, double re2,
   double *ecoul, double *frc)
 {
   double a, arc, re;
@@ -376,7 +376,7 @@ inline void ElecCoreCore(double q, double rc, double re1, double re2,
   re = sqrt(re1 * re1 + re2 * re2);
   a = coeff_a / re;
   arc = a * rc;
- 
+
   f = ierfoverx1(arc, &df);
   dEdr = -q * a * a * df;
   fre = q * a * (f + arc * df) / (re * re);
@@ -388,7 +388,7 @@ inline void ElecCoreCore(double q, double rc, double re1, double re2,
 
 /* ---------------------------------------------------------------------- */
 
-inline void ElecCoreElec(double q, double rc, double re1, double re2, 
+inline void ElecCoreElec(double q, double rc, double re1, double re2,
         double *ecoul, double *frc, double *fre2)
 {
   double a,arc, re;
@@ -401,7 +401,7 @@ inline void ElecCoreElec(double q, double rc, double re1, double re2,
   /*
   re1: core size
   re2: electron size
-  re3: size of the core, obtained from the electron density function rho(r) of core 
+  re3: size of the core, obtained from the electron density function rho(r) of core
   e.g. rho(r) = a1*exp(-((r)/b1)^2), a1 =157.9, b1 = 0.1441 -> re3 = 0.1441 for Si4+
   */
 
@@ -423,45 +423,45 @@ inline void ElecCoreElec(double q, double rc, double re1, double re2,
 
 /* ---------------------------------------------------------------------- */
 
-inline void PauliElecElec(int samespin, double rc, 
-			  double re1, double re2, double *epauli, 
-			  double *frc, double *fre1, double *fre2)
+inline void PauliElecElec(int samespin, double rc,
+                          double re1, double re2, double *epauli,
+                          double *frc, double *fre1, double *fre2)
 {
   double ree, rem;
   double S, t1, t2, tt;
   double dSdr1, dSdr2, dSdr;
   double dTdr1, dTdr2, dTdr;
   double O, dOdS, ratio;
-  
+
   re1 *= PAULI_RE; re2 *= PAULI_RE; rc *= PAULI_RC;
   ree = re1 * re1 + re2 * re2;
   rem = re1 * re1 - re2 * re2;
-  
-  S = (2.82842712474619 / pow((re2 / re1 + re1 / re2), 1.5)) * 
+
+  S = (2.82842712474619 / pow((re2 / re1 + re1 / re2), 1.5)) *
     exp(-rc * rc / ree);
-  
+
   t1 =  1.5 * (1 / (re1 * re1) + 1 / (re2 * re2));
   t2 =  2.0 * (3 * ree - 2 * rc * rc) / (ree * ree);
   tt = t1 - t2;
-  
+
   dSdr1 = (-1.5 / re1) * (rem / ree) + 2 * re1 * rc * rc / (ree * ree);
   dSdr2 = (1.5 / re2) * (rem / ree) + 2 * re2 * rc * rc / (ree * ree);
   dSdr  = -2 * rc / ree;
-  dTdr1 = -3 / (re1 * re1 * re1) - 12 * re1 / (ree * ree) + 8 * re1 * 
+  dTdr1 = -3 / (re1 * re1 * re1) - 12 * re1 / (ree * ree) + 8 * re1 *
     (-2 * rc * rc + 3 * ree) / (ree * ree * ree);
-  dTdr2 = -3 / (re2 * re2 * re2) - 12 * re2 / (ree * ree) + 8 * re2 * 
+  dTdr2 = -3 / (re2 * re2 * re2) - 12 * re2 / (ree * ree) + 8 * re2 *
     (-2 * rc * rc + 3 * ree) / (ree * ree * ree);
   dTdr  = 8 * rc / (ree * ree);
-  
+
   if (samespin == 1) {
     O = S * S / (1.0 - S * S) + (1 - PAULI_RHO) * S * S / (1.0 + S * S);
-    dOdS = 2 * S / ((1.0 - S * S) * (1.0 - S * S)) + 
+    dOdS = 2 * S / ((1.0 - S * S) * (1.0 - S * S)) +
       (1 - PAULI_RHO) * 2 * S / ((1.0 + S * S) * (1.0 + S * S));
   } else {
     O = -PAULI_RHO * S * S / (1.0 + S * S);
     dOdS = -PAULI_RHO * 2 * S / ((1.0 + S * S) * (1.0 + S * S));
   }
-  
+
   ratio = tt * dOdS * S;
   *fre1 -= PAULI_RE * (dTdr1 * O + ratio * dSdr1);
   *fre2 -= PAULI_RE * (dTdr2 * O + ratio * dSdr2);
@@ -471,16 +471,16 @@ inline void PauliElecElec(int samespin, double rc,
 
 /* ---------------------------------------------------------------------- */
 
-inline void PauliCoreElec(double rc, double re2, double *epauli, double *frc, 
+inline void PauliCoreElec(double rc, double re2, double *epauli, double *frc,
        double *fre2, double PAULI_CORE_A, double PAULI_CORE_B, double PAULI_CORE_C)
 {
   double E, dEdrc, dEdre2, rcsq, ssq;
-  
+
   rcsq = rc * rc;
   ssq = re2 * re2;
 
   E = PAULI_CORE_A * exp((-PAULI_CORE_B * rcsq) / (ssq + PAULI_CORE_C));
-  
+
   dEdrc = -2 * PAULI_CORE_A * PAULI_CORE_B * rc * exp(-PAULI_CORE_B * rcsq /
           (ssq + PAULI_CORE_C)) / (ssq + PAULI_CORE_C);
 
@@ -494,8 +494,8 @@ inline void PauliCoreElec(double rc, double re2, double *epauli, double *frc,
 
 /* ---------------------------------------------------------------------- */
 
-inline void RForce(double dx, double dy, double dz, 
-		   double rc, double force, double *fx, double *fy, double *fz)
+inline void RForce(double dx, double dy, double dz,
+                   double rc, double force, double *fx, double *fy, double *fz)
 {
   force /= rc;
   *fx = force * dx;
@@ -505,25 +505,25 @@ inline void RForce(double dx, double dy, double dz,
 
 /* ---------------------------------------------------------------------- */
 
-inline void SmallRForce(double dx, double dy, double dz, 
-			double rc, double force, 
-			double *fx, double *fy, double *fz)
+inline void SmallRForce(double dx, double dy, double dz,
+                        double rc, double force,
+                        double *fx, double *fy, double *fz)
 {
   /* Handles case where rc is small to avoid division by zero */
-  
+
   if (rc > 0.000001){
     force /= rc;
     *fx = force * dx; *fy = force * dy; *fz = force * dz;
   } else {
-    if (dx != 0) *fx = force / sqrt(1 + (dy * dy + dz * dz) / (dx * dx)); 
+    if (dx != 0) *fx = force / sqrt(1 + (dy * dy + dz * dz) / (dx * dx));
     else *fx = 0.0;
-    if (dy != 0) *fy = force / sqrt(1 + (dx * dx + dz * dz) / (dy * dy)); 
+    if (dy != 0) *fy = force / sqrt(1 + (dx * dx + dz * dz) / (dy * dy));
     else *fy = 0.0;
-    if (dz != 0) *fz = force / sqrt(1 + (dx * dx + dy * dy) / (dz * dz)); 
+    if (dz != 0) *fz = force / sqrt(1 + (dx * dx + dy * dy) / (dz * dz));
     else *fz = 0.0;
-    //		if (dx < 0) *fx = -*fx;
-    //		if (dy < 0) *fy = -*fy;
-    //		if (dz < 0) *fz = -*fz;
+    //                if (dx < 0) *fx = -*fx;
+    //                if (dy < 0) *fy = -*fy;
+    //                if (dz < 0) *fz = -*fz;
   }
 }
 
@@ -533,7 +533,7 @@ inline double cutoff(double x)
 {
   /*  cubic: return x * x * (2.0 * x - 3.0) + 1.0; */
   /*  quintic: return -6 * pow(x, 5) + 15 * pow(x, 4) - 10 * pow(x, 3) + 1; */
-  
+
   /* Seventh order spline */
   //      return 20 * pow(x, 7) - 70 * pow(x, 6) + 84 * pow(x, 5) - 35 * pow(x, 4) + 1;
   return (((20 * x - 70) * x + 84) * x - 35) * x * x * x * x + 1;
@@ -545,7 +545,7 @@ inline double dcutoff(double x)
 {
   /*  cubic: return (6.0 * x * x - 6.0 * x); */
   /*  quintic: return -30 * pow(x, 4) + 60 * pow(x, 3) - 30 * pow(x, 2); */
-  
+
   /* Seventh order spline */
   //      return 140 * pow(x, 6) - 420 * pow(x, 5) + 420 * pow(x, 4) - 140 * pow(x, 3);
   return (((140 * x - 420) * x + 420) * x - 140) * x * x * x;
diff --git a/src/USER-EWALDN/ewald_n.cpp b/src/USER-EWALDN/ewald_n.cpp
index b6291cb5de..8dd262a6e1 100644
--- a/src/USER-EWALDN/ewald_n.cpp
+++ b/src/USER-EWALDN/ewald_n.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -36,9 +36,9 @@ using namespace MathConst;
 
 #define SMALL 0.00001
 
-#define KSPACE_ILLEGAL	"Illegal kspace_style ewald/n command"
-#define KSPACE_ORDER	"Unsupported order in kspace_style ewald/n for"
-#define KSPACE_MIX	"Unsupported mixing rule in kspace_style ewald/n for"
+#define KSPACE_ILLEGAL        "Illegal kspace_style ewald/n command"
+#define KSPACE_ORDER        "Unsupported order in kspace_style ewald/n for"
+#define KSPACE_MIX        "Unsupported mixing rule in kspace_style ewald/n for"
 
 enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER};   // same as in pair.h
 
@@ -83,18 +83,18 @@ void EwaldN::init()
   nbox = -1;
   bytes = 0.0;
 
-  if (!comm->me) {					// output message
+  if (!comm->me) {                                        // output message
     if (screen) fprintf(screen,"EwaldN initialization ...\n");
     if (logfile) fprintf(logfile,"EwaldN initialization ...\n");
   }
 
-  if (domain->dimension == 2)				// check for errors
+  if (domain->dimension == 2)                                // check for errors
     error->all(FLERR,"Cannot use EwaldN with 2d simulation");
   if (slabflag == 0 && domain->nonperiodic > 0)
     error->all(FLERR,"Cannot use nonperiodic boundaries with EwaldN");
   if (slabflag == 1) {
-    if (domain->xperiodic != 1 || domain->yperiodic != 1 || 
-	domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
+    if (domain->xperiodic != 1 || domain->yperiodic != 1 ||
+        domain->boundary[2][0] != 1 || domain->boundary[2][1] != 1)
       error->all(FLERR,"Incorrect boundaries with slab EwaldN");
   }
 
@@ -102,44 +102,44 @@ void EwaldN::init()
   //mumurd2e = force->mumurd2e;
   //dielectric = force->dielectric;
   mumurd2e = dielectric = 1.0;
-  
+
   int tmp;
   Pair *pair = force->pair;
   int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : NULL;
   double *cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : NULL;
-  if (!(ptr||cutoff)) 
+  if (!(ptr||cutoff))
     error->all(FLERR,"KSpace style is incompatible with Pair style");
   int ewald_order = ptr ? *((int *) ptr) : 1<<1;
   int ewald_mix = ptr ? *((int *) pair->extract("ewald_mix",tmp)) : GEOMETRIC;
   memset(function, 0, EWALD_NFUNCS*sizeof(int));
-  for (int i=0; i<=EWALD_NORDER; ++i)			// transcribe order
-    if (ewald_order&(1<<i)) {				// from pair_style
+  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;
-	case 3:
-	  k = 3; break;
-	case 6:
-	  if (ewald_mix==GEOMETRIC) { k = 1; break; }
-	  else if (ewald_mix==ARITHMETIC) { k = 2; break; }
-	  sprintf(str, "%s pair_style %s", KSPACE_MIX, force->pair_style);
-	  error->all(FLERR,str);
-	default:
-	  sprintf(str, "%s pair_style %s", KSPACE_ORDER, force->pair_style);
-	  error->all(FLERR,str);
+        case 1:
+          k = 0; break;
+        case 3:
+          k = 3; break;
+        case 6:
+          if (ewald_mix==GEOMETRIC) { k = 1; break; }
+          else if (ewald_mix==ARITHMETIC) { k = 2; break; }
+          sprintf(str, "%s pair_style %s", KSPACE_MIX, force->pair_style);
+          error->all(FLERR,str);
+        default:
+          sprintf(str, "%s pair_style %s", KSPACE_ORDER, force->pair_style);
+          error->all(FLERR,str);
       }
       nfunctions += function[k] = 1;
       nsums += n[k];
     }
-    
-    
+
+
   g_ewald = 0;
   pair->init();  // so B is defined
   init_coeffs();
-  init_coeff_sums();  
-    
+  init_coeff_sums();
+
   double qsum, qsqsum, bsbsum;
   qsum = qsqsum = bsbsum = 0.0;
   if (function[0]) {
@@ -148,12 +148,12 @@ void EwaldN::init()
   }
   if (function[1]) {
     bsbsum = sum[1].x2;
-  } 
+  }
   if (function[2]) {
     bsbsum = sum[2].x2;
-  }    
-    
-    
+  }
+
+
   if (qsqsum == 0.0 && bsbsum == 0.0)
       error->all(FLERR,"Cannot use Ewald/n solver on system with no charge or LJ particles");
   if (fabs(qsum) > SMALL && comm->me == 0) {
@@ -161,18 +161,18 @@ void EwaldN::init()
       sprintf(str,"System is not charge neutral, net charge = %g",qsum);
       error->warning(FLERR,str);
   }
-    
+
   //set accuracy (force units) from accuracy_relative or accuracy_absolute
-    
+
   if (accuracy_absolute >= 0.0) accuracy = accuracy_absolute;
   else accuracy = accuracy_relative * two_charge_force;
-    
+
   // setup K-space resolution
-    
+
   q2 = qsqsum * force->qqrd2e / force->dielectric;
   b2 = bsbsum; //Are these units right?
   bigint natoms = atom->natoms;
-    
+
   if (function[0]) {       //Coulombic
     g_ewald = accuracy*sqrt(natoms*(*cutoff)*shape_det(domain->h)) / (2.0*q2);
     if (g_ewald >= 1.0)
@@ -182,49 +182,49 @@ void EwaldN::init()
   else if (function[1] || function[2]) {    //Only LJ
 
     double *cutoffLJ = pair ? (double *) pair->extract("cut_LJ",tmp) : NULL;
-    
+
     //Try Newton Solver
-    
+
     //Use old method to get guess
     g_ewald = (1.35 - 0.15*log(accuracy))/ *cutoffLJ;
-      
+
     double g_ewald_new = NewtonSolve(g_ewald,(*cutoffLJ),natoms,shape_det(domain->h),b2);
-           
+
     if (g_ewald_new > 0.0) g_ewald = g_ewald_new;
-    else error->warning(FLERR,"Ewald/n Newton solver failed, using old method to estimate g_ewald");  
-    
+    else error->warning(FLERR,"Ewald/n Newton solver failed, using old method to estimate g_ewald");
+
     if (g_ewald >= 1.0)
         error->all(FLERR,"KSpace accuracy too large to estimate G vector");
   }
-    
-  if (!comm->me) {					// output results
+
+  if (!comm->me) {                                        // output results
       if (screen) fprintf(screen, "  G vector = %g\n", g_ewald);
       if (logfile) fprintf(logfile, "  G vector = %g\n", g_ewald);
-  }  
-    
-    
+  }
+
+
   deallocate_peratom();
   peratom_allocate_flag = 0;
 }
 
 
 /* ----------------------------------------------------------------------
-   adjust EwaldN coeffs, called initially and whenever volume has changed 
+   adjust EwaldN coeffs, called initially and whenever volume has changed
 ------------------------------------------------------------------------- */
 
 void EwaldN::setup()
 {
-  volume = shape_det(domain->h)*slab_volfactor;		// cell volume
-  memcpy(unit, domain->h_inv, sizeof(shape));		// wave vector units
+  volume = shape_det(domain->h)*slab_volfactor;                // cell volume
+  memcpy(unit, domain->h_inv, sizeof(shape));                // wave vector units
   shape_scalar_mult(unit, 2.0*MY_PI);
   unit[2] /= slab_volfactor;
-    
+
   //int nbox_old = nbox, nkvec_old = nkvec;
   if (accuracy>=1) {
     nbox = 0;
-    error->all(FLERR,"KSpace accuracy too low"); 
+    error->all(FLERR,"KSpace accuracy too low");
   }
-    
+
   bigint natoms = atom->natoms;
   double err;
   int kxmax = 1;
@@ -244,7 +244,7 @@ void EwaldN::setup()
   while (err > accuracy) {
     kzmax++;
     err = rms(kzmax,domain->h[2]*slab_volfactor,natoms,q2,b2);
-  } 
+  }
   nbox = MAX(kxmax,kymax);
   nbox = MAX(nbox,kzmax);
   double gsqxmx = unit[0]*unit[0]*kxmax*kxmax;
@@ -253,20 +253,20 @@ void EwaldN::setup()
   gsqmx = MAX(gsqxmx,gsqymx);
   gsqmx = MAX(gsqmx,gsqzmx);
   gsqmx *= 1.00001;
-    
+
   reallocate();
-  coefficients();					// compute coeffs
+  coefficients();                                        // compute coeffs
   init_coeffs();
   init_coeff_sums();
   init_self();
 
-  if (!(first_output||comm->me)) {			// output on first
+  if (!(first_output||comm->me)) {                        // output on first
     first_output = 1;
     if (screen) fprintf(screen,
-       	"  vectors: nbox = %d, nkvec = %d\n", nbox, nkvec);
+               "  vectors: nbox = %d, nkvec = %d\n", nbox, nkvec);
     if (logfile) fprintf(logfile,
-	"  vectors: nbox = %d, nkvec = %d\n", nbox, nkvec);
-  }  
+        "  vectors: nbox = %d, nkvec = %d\n", nbox, nkvec);
+  }
 }
 
 /* ----------------------------------------------------------------------
@@ -274,80 +274,80 @@ void EwaldN::setup()
 ------------------------------------------------------------------------- */
 
 double EwaldN::rms(int km, double prd, bigint natoms, double q2, double b2)
-{  
+{
   double value = 0.0;
-    
-  //Coulombic 
-    
+
+  //Coulombic
+
   double g2 = g_ewald*g_ewald;
-    
-  value += 2.0*q2*g_ewald/prd * 
-    sqrt(1.0/(MY_PI*km*natoms)) * 
+
+  value += 2.0*q2*g_ewald/prd *
+    sqrt(1.0/(MY_PI*km*natoms)) *
     exp(-MY_PI*MY_PI*km*km/(g2*prd*prd));
-    
-  //Lennard-Jones  
-    
+
+  //Lennard-Jones
+
   double g7 = g2*g2*g2*g_ewald;
-    
-  value += 4.0*b2*g7/3.0 * 
-    sqrt(1.0/(MY_PI*natoms)) * 
+
+  value += 4.0*b2*g7/3.0 *
+    sqrt(1.0/(MY_PI*natoms)) *
     (exp(-MY_PI*MY_PI*km*km/(g2*prd*prd)) *
     (MY_PI*km/(g_ewald*prd) + 1));
-    
+
   return value;
 }
 
-void EwaldN::reallocate()				// allocate memory
+void EwaldN::reallocate()                                // allocate memory
 {
   int ix, iy, iz;
   int nkvec_max = nkvec;
   vector h;
 
-  nkvec = 0;						// determine size(kvec)
+  nkvec = 0;                                                // determine size(kvec)
   int *kflag = new int[(nbox+1)*(2*nbox+1)*(2*nbox+1)];
   int *flag = kflag;
 
   for (ix=0; ix<=nbox; ++ix)
     for (iy=-nbox; iy<=nbox; ++iy)
       for (iz=-nbox; iz<=nbox; ++iz)
-	if (!(ix||iy||iz)) *(flag++) = 0;
-	else if ((!ix)&&(iy<0)) *(flag++) = 0;
-	else if ((!(ix||iy))&&(iz<0)) *(flag++) = 0;	// use symmetry
-	else {
-	  h[0] = unit[0]*ix;
-	  h[1] = unit[5]*ix+unit[1]*iy;
-	  h[2] = unit[4]*ix+unit[3]*iy+unit[2]*iz;
-	  if ((*(flag++) = h[0]*h[0]+h[1]*h[1]+h[2]*h[2]<=gsqmx)) ++nkvec;
-	}
-  
+        if (!(ix||iy||iz)) *(flag++) = 0;
+        else if ((!ix)&&(iy<0)) *(flag++) = 0;
+        else if ((!(ix||iy))&&(iz<0)) *(flag++) = 0;        // use symmetry
+        else {
+          h[0] = unit[0]*ix;
+          h[1] = unit[5]*ix+unit[1]*iy;
+          h[2] = unit[4]*ix+unit[3]*iy+unit[2]*iz;
+          if ((*(flag++) = h[0]*h[0]+h[1]*h[1]+h[2]*h[2]<=gsqmx)) ++nkvec;
+        }
+
   if (nkvec>nkvec_max) {
-    deallocate();					// free memory
-    hvec = new hvector[nkvec];				// hvec
+    deallocate();                                        // free memory
+    hvec = new hvector[nkvec];                                // hvec
     bytes += (nkvec-nkvec_max)*sizeof(hvector);
-    kvec = new kvector[nkvec];				// kvec
+    kvec = new kvector[nkvec];                                // kvec
     bytes += (nkvec-nkvec_max)*sizeof(kvector);
-    kenergy = new double[nkvec*nfunctions];		// kenergy
+    kenergy = new double[nkvec*nfunctions];                // kenergy
     bytes += (nkvec-nkvec_max)*nfunctions*sizeof(double);
-    kvirial = new double[6*nkvec*nfunctions];		// kvirial
+    kvirial = new double[6*nkvec*nfunctions];                // kvirial
     bytes += 6*(nkvec-nkvec_max)*nfunctions*sizeof(double);
-    cek_local = new complex[nkvec*nsums];		// cek_local
+    cek_local = new complex[nkvec*nsums];                // cek_local
     bytes += (nkvec-nkvec_max)*nsums*sizeof(complex);
-    cek_global = new complex[nkvec*nsums];		// cek_global
+    cek_global = new complex[nkvec*nsums];                // cek_global
     bytes += (nkvec-nkvec_max)*nsums*sizeof(complex);
     nkvec_max = nkvec;
   }
 
-  flag = kflag;						// create index and
-  kvector *k = kvec;					// wave vectors
+  flag = kflag;                                                // create index and
+  kvector *k = kvec;                                        // wave vectors
   hvector *hi = hvec;
   for (ix=0; ix<=nbox; ++ix)
     for (iy=-nbox; iy<=nbox; ++iy)
       for (iz=-nbox; iz<=nbox; ++iz)
-	if (*(flag++)) {
-	  hi->x = unit[0]*ix;
-	  hi->y = unit[5]*ix+unit[1]*iy;
-	  (hi++)->z = unit[4]*ix+unit[3]*iy+unit[2]*iz;
-	  k->x = ix+nbox; k->y = iy+nbox; (k++)->z = iz+nbox; }
+        if (*(flag++)) {
+          hi->x = unit[0]*ix;
+          hi->y = unit[5]*ix+unit[1]*iy;
+          (hi++)->z = unit[4]*ix+unit[3]*iy+unit[2]*iz;
+          k->x = ix+nbox; k->y = iy+nbox; (k++)->z = iz+nbox; }
 
   delete [] kflag;
 }
@@ -361,7 +361,7 @@ void EwaldN::reallocate_atoms()
       allocate_peratom();
       nmax = atom->nmax;
     }
-    
+
   if ((nevec = atom->nmax*(2*nbox+1))<=nevec_max) return;
   delete [] ekr_local;
   ekr_local = new cvector[nevec];
@@ -370,7 +370,7 @@ void EwaldN::reallocate_atoms()
 }
 
 
-void EwaldN::allocate_peratom()				
+void EwaldN::allocate_peratom()
 {
   memory->create(energy_self_peratom,
       atom->nmax,EWALD_NFUNCS,"ewald/n:energy_self_peratom");
@@ -379,25 +379,25 @@ void EwaldN::allocate_peratom()
 }
 
 
-void EwaldN::deallocate_peratom()			// free memory
+void EwaldN::deallocate_peratom()                        // free memory
 {
   memory->destroy(energy_self_peratom);
   memory->destroy(virial_self_peratom);
 }
 
 
-void EwaldN::deallocate()				// free memory
+void EwaldN::deallocate()                                // free memory
 {
-  delete [] hvec;		hvec = NULL;
-  delete [] kvec;		kvec = NULL;
-  delete [] kenergy;		kenergy = NULL;
-  delete [] kvirial;		kvirial = NULL;
-  delete [] cek_local;		cek_local = NULL;
-  delete [] cek_global;		cek_global = NULL;
+  delete [] hvec;                hvec = NULL;
+  delete [] kvec;                kvec = NULL;
+  delete [] kenergy;                kenergy = NULL;
+  delete [] kvirial;                kvirial = NULL;
+  delete [] cek_local;                cek_local = NULL;
+  delete [] cek_global;                cek_global = NULL;
 }
 
 
-void EwaldN::coefficients()				// set up pre-factors
+void EwaldN::coefficients()                                // set up pre-factors
 {
   vector h;
   hvector *hi = hvec, *nh;
@@ -407,35 +407,35 @@ void EwaldN::coefficients()				// set up pre-factors
   int func0 = function[0], func12 = function[1]||function[2],
       func3 = function[3];
 
-  for (nh = (hi = hvec)+nkvec; hi<nh; ++hi) {		// wave vectors
+  for (nh = (hi = hvec)+nkvec; hi<nh; ++hi) {                // wave vectors
     memcpy(h, hi, sizeof(vector));
     expb2 = exp(-(b2 = (h2 = vec_dot(h, h))*eta2));
-    if (func0) {					// qi*qj/r coeffs
+    if (func0) {                                        // qi*qj/r coeffs
       *(ke++) = c1 = expb2/h2;
       *(kv++) = c1-(c2 = 2.0*c1*(1.0+b2)/h2)*h[0]*h[0];
-      *(kv++) = c1-c2*h[1]*h[1];			// lammps convention
-      *(kv++) = c1-c2*h[2]*h[2];			// instead of voigt
-      *(kv++) = -c2*h[1]*h[0];				
+      *(kv++) = c1-c2*h[1]*h[1];                        // lammps convention
+      *(kv++) = c1-c2*h[2]*h[2];                        // instead of voigt
+      *(kv++) = -c2*h[1]*h[0];
       *(kv++) = -c2*h[2]*h[0];
       *(kv++) = -c2*h[2]*h[1];
     }
-    if (func12) {					// -Bij/r^6 coeffs
-      b1 = sqrt(b2);					// minus sign folded
-      h1 = sqrt(h2);					// into constants
+    if (func12) {                                        // -Bij/r^6 coeffs
+      b1 = sqrt(b2);                                        // minus sign folded
+      h1 = sqrt(h2);                                        // into constants
       *(ke++) = c1 = -h1*h2*((c2=sqrt(MY_PI)*erfc(b1))+(0.5/b2-1.0)*expb2/b1);
       *(kv++) = c1-(c2 = 3.0*h1*(c2-expb2/b1))*h[0]*h[0];
-      *(kv++) = c1-c2*h[1]*h[1];			// lammps convention
-      *(kv++) = c1-c2*h[2]*h[2];			// instead of voigt
+      *(kv++) = c1-c2*h[1]*h[1];                        // lammps convention
+      *(kv++) = c1-c2*h[2]*h[2];                        // instead of voigt
       *(kv++) = -c2*h[1]*h[0];
       *(kv++) = -c2*h[2]*h[0];
       *(kv++) = -c2*h[2]*h[1];
     }
-    if (func3) {					// dipole coeffs
+    if (func3) {                                        // dipole coeffs
       *(ke++) = c1 = expb2/h2;
       *(kv++) = c1-(c2 = 2.0*c1*(1.0+b2)/h2)*h[0]*h[0];
-      *(kv++) = c1-c2*h[1]*h[1];			// lammps convention
-      *(kv++) = c1-c2*h[2]*h[2];			// instead of voigt
-      *(kv++) = -c2*h[1]*h[0];				
+      *(kv++) = c1-c2*h[1]*h[1];                        // lammps convention
+      *(kv++) = c1-c2*h[2]*h[2];                        // instead of voigt
+      *(kv++) = -c2*h[1]*h[0];
       *(kv++) = -c2*h[2]*h[0];
       *(kv++) = -c2*h[2]*h[1];
     }
@@ -443,19 +443,19 @@ void EwaldN::coefficients()				// set up pre-factors
 }
 
 
-void EwaldN::init_coeffs()				// local pair coeffs
+void EwaldN::init_coeffs()                                // local pair coeffs
 {
   int tmp;
   int n = atom->ntypes;
 
-  if (function[1]) {					// geometric 1/r^6
+  if (function[1]) {                                        // geometric 1/r^6
     double **b = (double **) force->pair->extract("B",tmp);
     delete [] B;
     B = new double[n+1];
     bytes += (n+1)*sizeof(double);
     for (int i=0; i<=n; ++i) B[i] = sqrt(fabs(b[i][i]));
   }
-  if (function[2]) {					// arithmetic 1/r^6
+  if (function[2]) {                                        // arithmetic 1/r^6
     double **epsilon = (double **) force->pair->extract("epsilon",tmp);
     double **sigma = (double **) force->pair->extract("sigma",tmp);
     double eps_i, sigma_i, sigma_n, *bi = B = new double[7*n+7];
@@ -464,47 +464,47 @@ void EwaldN::init_coeffs()				// local pair coeffs
 
     if (!(epsilon&&sigma))
       error->all(
-	  FLERR,"epsilon or sigma reference not set by pair style in ewald/n");
+          FLERR,"epsilon or sigma reference not set by pair style in ewald/n");
     for (int i=0; i<=n; ++i) {
       eps_i = sqrt(epsilon[i][i]);
       sigma_i = sigma[i][i];
       sigma_n = 1.0;
       for (int j=0; j<7; ++j) {
-	*(bi++) = sigma_n*eps_i*c[j]; sigma_n *= sigma_i;
+        *(bi++) = sigma_n*eps_i*c[j]; sigma_n *= sigma_i;
       }
     }
   }
 }
 
 
-void EwaldN::init_coeff_sums()				// sums based on atoms
+void EwaldN::init_coeff_sums()                                // sums based on atoms
 {
-  if (sums) return;					// calculated only once
+  if (sums) return;                                        // calculated only once
   sums = 1;
 
   Sum sum_local[EWALD_MAX_NSUMS];
 
   memset(sum_local, 0, EWALD_MAX_NSUMS*sizeof(Sum));
-  if (function[0]) {					// 1/r
+  if (function[0]) {                                        // 1/r
     double *q = atom->q, *qn = q+atom->nlocal;
     for (double *i=q; i<qn; ++i) {
       sum_local[0].x += i[0]; sum_local[0].x2 += i[0]*i[0]; }
   }
-  if (function[1]) {					// geometric 1/r^6
+  if (function[1]) {                                        // geometric 1/r^6
     int *type = atom->type, *ntype = type+atom->nlocal;
     for (int *i=type; i<ntype; ++i) {
       sum_local[1].x += B[i[0]]; sum_local[1].x2 += B[i[0]]*B[i[0]]; }
   }
-  if (function[2]) {					// arithmetic 1/r^6
+  if (function[2]) {                                        // arithmetic 1/r^6
     double *bi;
     int *type = atom->type, *ntype = type+atom->nlocal;
     for (int *i=type; i<ntype; ++i) {
       bi = B+7*i[0];
       sum_local[2].x2 += bi[0]*bi[6];
-      for (int k=2; k<9; ++k) sum_local[k].x += *(bi++); 
+      for (int k=2; k<9; ++k) sum_local[k].x += *(bi++);
     }
   }
-  if (function[3]&&atom->mu) {				// dipole
+  if (function[3]&&atom->mu) {                                // dipole
     double *mu = atom->mu[0], *nmu = mu+4*atom->nlocal;
     for (double *i = mu; i < nmu; i += 4)
       sum_local[9].x2 += i[3]*i[3];
@@ -518,24 +518,24 @@ void EwaldN::init_self()
   double g1 = g_ewald, g2 = g1*g1, g3 = g1*g2;
   const double qscale = force->qqrd2e * scale;
 
-  memset(energy_self, 0, EWALD_NFUNCS*sizeof(double));	// self energy
+  memset(energy_self, 0, EWALD_NFUNCS*sizeof(double));        // self energy
   memset(virial_self, 0, EWALD_NFUNCS*sizeof(double));
 
-  if (function[0]) {					// 1/r
+  if (function[0]) {                                        // 1/r
     virial_self[0] = -0.5*MY_PI*qscale/(g2*volume)*sum[0].x*sum[0].x;
     energy_self[0] = sum[0].x2*qscale*g1/sqrt(MY_PI)-virial_self[0];
   }
-  if (function[1]) {					// geometric 1/r^6
+  if (function[1]) {                                        // geometric 1/r^6
     virial_self[1] = MY_PI*sqrt(MY_PI)*g3/(6.0*volume)*sum[1].x*sum[1].x;
     energy_self[1] = -sum[1].x2*g3*g3/12.0+virial_self[1];
   }
-  if (function[2]) {					// arithmetic 1/r^6
+  if (function[2]) {                                        // arithmetic 1/r^6
     virial_self[2] = MY_PI*sqrt(MY_PI)*g3/(48.0*volume)*(sum[2].x*sum[8].x+
-	sum[3].x*sum[7].x+sum[4].x*sum[6].x+0.5*sum[5].x*sum[5].x);
+        sum[3].x*sum[7].x+sum[4].x*sum[6].x+0.5*sum[5].x*sum[5].x);
     energy_self[2] = -sum[2].x2*g3*g3/3.0+virial_self[2];
   }
-  if (function[3]) {					// dipole
-    virial_self[3] = 0;					// in surface
+  if (function[3]) {                                        // dipole
+    virial_self[3] = 0;                                        // in surface
     energy_self[3] = sum[9].x2*mumurd2e*2.0*g3/3.0/sqrt(MY_PI)-virial_self[3];
   }
 }
@@ -543,18 +543,18 @@ void EwaldN::init_self()
 
 void EwaldN::init_self_peratom()
 {
-  if (!(vflag_atom || eflag_atom)) return; 
+  if (!(vflag_atom || eflag_atom)) return;
 
   double g1 = g_ewald, g2 = g1*g1, g3 = g1*g2;
   const double qscale = force->qqrd2e * scale;
   double *energy = energy_self_peratom[0];
   double *virial = virial_self_peratom[0];
   int nlocal = atom->nlocal;
-    
+
   memset(energy, 0, EWALD_NFUNCS*nlocal*sizeof(double));
   memset(virial, 0, EWALD_NFUNCS*nlocal*sizeof(double));
 
-  if (function[0]) {					// 1/r
+  if (function[0]) {                                        // 1/r
     double *ei = energy;
     double *vi = virial;
     double ce = qscale*g1/sqrt(MY_PI);
@@ -566,7 +566,7 @@ void EwaldN::init_self_peratom()
       *ei = ce*q*q-vi[0];
     }
   }
-  if (function[1]) {					// geometric 1/r^6
+  if (function[1]) {                                        // geometric 1/r^6
     double *ei = energy+1;
     double *vi = virial+1;
     double ce = -g3*g3/12.0;
@@ -578,7 +578,7 @@ void EwaldN::init_self_peratom()
       *ei = ce*b*b+vi[0];
     }
   }
-  if (function[2]) {					// arithmetic 1/r^6
+  if (function[2]) {                                        // arithmetic 1/r^6
     double *bi;
     double *ei = energy+2;
     double *vi = virial+2;
@@ -586,30 +586,30 @@ void EwaldN::init_self_peratom()
     double cv = 0.5*MY_PI*sqrt(MY_PI)*g3/(48.0*volume);
     int *typei = atom->type, *typen = typei + atom->nlocal;
     for (; typei < typen; typei++, vi += EWALD_NFUNCS, ei += EWALD_NFUNCS) {
-      bi = B+7*typei[0]+7;       
+      bi = B+7*typei[0]+7;
       for (int k=2; k<9; ++k) *vi += cv*sum[k].x*(--bi)[0];
 
-      /* PJV 20120225: 
+      /* PJV 20120225:
          should this be this instead?  above implies an inverse dependence
-	 seems to be the above way in original;  i recall having tested
-	 arithmetic mixing in the conception phase, but an extra test would
-	 be prudent (pattern repeats in multiple functions below)
+         seems to be the above way in original;  i recall having tested
+         arithmetic mixing in the conception phase, but an extra test would
+         be prudent (pattern repeats in multiple functions below)
 
-      bi = B+7*typei[0];       
+      bi = B+7*typei[0];
       for (int k=2; k<9; ++k) *vi += cv*sum[k].x*(bi++)[0];
-      
+
       */
 
       *ei = ce*bi[0]*bi[6]+vi[0];
     }
   }
-  if (function[3]&&atom->mu) {				// dipole
+  if (function[3]&&atom->mu) {                                // dipole
     double *ei = energy+3;
     double *vi = virial+3;
     double *imu = atom->mu[0], *nmu = imu+4*atom->nlocal;
     double ce = mumurd2e*2.0*g3/3.0/sqrt(MY_PI);
     for (; imu < nmu; imu += 4, vi += EWALD_NFUNCS, ei += EWALD_NFUNCS) {
-      *vi = 0;						// in surface
+      *vi = 0;                                                // in surface
       *ei = ce*imu[3]*imu[3]-vi[0];
     }
   }
@@ -617,25 +617,25 @@ void EwaldN::init_self_peratom()
 
 
 /* ----------------------------------------------------------------------
-   compute the EwaldN long-range force, energy, virial 
+   compute the EwaldN long-range force, energy, virial
 ------------------------------------------------------------------------- */
 
 void EwaldN::compute(int eflag, int vflag)
 {
   if (!nbox) return;
-    
+
   // set energy/virial flags
   // invoke allocate_peratom() if needed for first time
-    
+
   if (eflag || vflag) ev_setup(eflag,vflag);
-  else evflag = eflag_global = vflag_global = eflag_atom = vflag_atom = 0;  
-    
+  else evflag = eflag_global = vflag_global = eflag_atom = vflag_atom = 0;
+
   if (!peratom_allocate_flag && (eflag_atom || vflag_atom)) {
       allocate_peratom();
       peratom_allocate_flag = 1;
       nmax = atom->nmax;
   }
-    
+
   reallocate_atoms();
   init_self_peratom();
   compute_ek();
@@ -665,22 +665,22 @@ void EwaldN::compute_ek()
   int func[EWALD_NFUNCS];
 
   memcpy(func, function, EWALD_NFUNCS*sizeof(int));
-  memset(cek_local, 0, n*sizeof(complex));		// reset sums
+  memset(cek_local, 0, n*sizeof(complex));                // reset sums
   while (x<xn) {
     zx = (zy = (zz = z+nbox)+1)-2;
-    C_SET(zz->x, 1, 0); C_SET(zz->y, 1, 0); C_SET(zz->z, 1, 0);	// z[0]
-    if (tri) {						// triclinic z[1]
+    C_SET(zz->x, 1, 0); C_SET(zz->y, 1, 0); C_SET(zz->z, 1, 0);        // z[0]
+    if (tri) {                                                // triclinic z[1]
       C_ANGLE(z1.x, unit[0]*x[0]+unit[5]*x[1]+unit[4]*x[2]);
       C_ANGLE(z1.y, unit[1]*x[1]+unit[3]*x[2]);
       C_ANGLE(z1.z, x[2]*unit[2]); x += 3;
     }
-    else {						// orthogonal z[1]
+    else {                                                // orthogonal z[1]
       C_ANGLE(z1.x, *(x++)*unit[0]);
       C_ANGLE(z1.y, *(x++)*unit[1]);
       C_ANGLE(z1.z, *(x++)*unit[2]);
     }
-    for (; zz<zn; --zx, ++zy, ++zz) {			// set up z[k]=e^(ik.r)
-      C_RMULT(zy->x, zz->x, z1.x);			// 3D k-vector
+    for (; zz<zn; --zx, ++zy, ++zz) {                        // set up z[k]=e^(ik.r)
+      C_RMULT(zy->x, zz->x, z1.x);                        // 3D k-vector
       C_RMULT(zy->y, zz->y, z1.y); C_CONJ(zx->y, zy->y);
       C_RMULT(zy->z, zz->z, z1.z); C_CONJ(zx->z, zy->z);
     }
@@ -689,30 +689,30 @@ void EwaldN::compute_ek()
     if (func[0]) qi = *(q++);
     if (func[1]) bi = B[*type];
     if (func[2]) memcpy(ci, B+7*type[0], 7*sizeof(double));
-    if (func[3]) { 
+    if (func[3]) {
       memcpy(mui, mu, sizeof(vector));
       vec_scalar_mult(mui, mu[3]);
       mu += 4;
       h = hvec;
     }
-    for (k=kvec; k<nk; ++k) {				// compute rho(k)
-      if (ky!=k->y) {					// based on order in 
-	if (kx!=k->x) cx = z[kx = k->x].x;		// reallocate
-	C_RMULT(zxy, z[ky = k->y].y, cx);
+    for (k=kvec; k<nk; ++k) {                                // compute rho(k)
+      if (ky!=k->y) {                                        // based on order in
+        if (kx!=k->x) cx = z[kx = k->x].x;                // reallocate
+        C_RMULT(zxy, z[ky = k->y].y, cx);
       }
       C_RMULT(zxyz, z[k->z].z, zxy);
       if (func[0]) {
-       	cek->re += zxyz.re*qi; (cek++)->im += zxyz.im*qi;
+               cek->re += zxyz.re*qi; (cek++)->im += zxyz.im*qi;
       }
       if (func[1]) {
-       	cek->re += zxyz.re*bi; (cek++)->im += zxyz.im*bi;
+               cek->re += zxyz.re*bi; (cek++)->im += zxyz.im*bi;
       }
       if (func[2]) for (i=0; i<7; ++i) {
-	cek->re += zxyz.re*ci[i]; (cek++)->im += zxyz.im*ci[i];
+        cek->re += zxyz.re*ci[i]; (cek++)->im += zxyz.im*ci[i];
       }
       if (func[3]) {
-	register double muk = mui[0]*h->x+mui[1]*h->y+mui[2]*h->z; ++h;
-	cek->re += zxyz.re*muk; (cek++)->im += zxyz.im*muk;
+        register double muk = mui[0]*h->x+mui[1]*h->y+mui[2]*h->z; ++h;
+        cek->re += zxyz.re*muk; (cek++)->im += zxyz.im*muk;
       }
     }
     ekr = (cvector *) ((char *) memcpy(ekr, z, lbytes)+lbytes);
@@ -743,63 +743,63 @@ void EwaldN::compute_force()
 
   if (atom->torque) t = atom->torque[0];
   memcpy(func, function, EWALD_NFUNCS*sizeof(int));
-  memset(sum, 0, EWALD_MAX_NSUMS*sizeof(vector));	// fj = -dE/dr =
-  for (; f<fn; f+=3) {					//      -i*qj*fac*
-    k = kvec;						//       Sum[conj(d)-d]
-    kx = ky = -1;					// d = k*conj(ekj)*ek
+  memset(sum, 0, EWALD_MAX_NSUMS*sizeof(vector));        // fj = -dE/dr =
+  for (; f<fn; f+=3) {                                        //      -i*qj*fac*
+    k = kvec;                                                //       Sum[conj(d)-d]
+    kx = ky = -1;                                        // d = k*conj(ekj)*ek
     ke = kenergy;
     cek = cek_global;
     memset(sum, 0, EWALD_MAX_NSUMS*sizeof(vector));
-    if (func[3]) { 
+    if (func[3]) {
       register double di = mu[3] * c[3];
       mui[0] = di*(mu++)[0]; mui[1] = di*(mu++)[0]; mui[2] = di*(mu++)[0];
       mu++;
     }
     for (nh = (h = hvec)+nkvec; h<nh; ++h, ++k) {
-      if (ky!=k->y) {					// based on order in
-	if (kx!=k->x) zx = z[kx = k->x].x; 		// reallocate
-	C_RMULT(zxy, z[ky = k->y].y, zx);
+      if (ky!=k->y) {                                        // based on order in
+        if (kx!=k->x) zx = z[kx = k->x].x;                 // reallocate
+        C_RMULT(zxy, z[ky = k->y].y, zx);
       }
       C_CRMULT(zc, z[k->z].z, zxy);
-      if (func[0]) {					// 1/r
-	register double im = *(ke++)*(zc.im*cek->re+cek->im*zc.re); ++cek;
-	sum[0][0] += h->x*im; sum[0][1] += h->y*im; sum[0][2] += h->z*im;
+      if (func[0]) {                                        // 1/r
+        register double im = *(ke++)*(zc.im*cek->re+cek->im*zc.re); ++cek;
+        sum[0][0] += h->x*im; sum[0][1] += h->y*im; sum[0][2] += h->z*im;
       }
-      if (func[1]) {					// geometric 1/r^6
-	register double im = *(ke++)*(zc.im*cek->re+cek->im*zc.re); ++cek;
-	sum[1][0] += h->x*im; sum[1][1] += h->y*im; sum[1][2] += h->z*im;
+      if (func[1]) {                                        // geometric 1/r^6
+        register double im = *(ke++)*(zc.im*cek->re+cek->im*zc.re); ++cek;
+        sum[1][0] += h->x*im; sum[1][1] += h->y*im; sum[1][2] += h->z*im;
       }
-      if (func[2]) {					// arithmetic 1/r^6
-	register double im, c = *(ke++);
-	for (i=2; i<9; ++i) {
-	  im = c*(zc.im*cek->re+cek->im*zc.re); ++cek;
-	  sum[i][0] += h->x*im; sum[i][1] += h->y*im; sum[i][2] += h->z*im;
-	}
+      if (func[2]) {                                        // arithmetic 1/r^6
+        register double im, c = *(ke++);
+        for (i=2; i<9; ++i) {
+          im = c*(zc.im*cek->re+cek->im*zc.re); ++cek;
+          sum[i][0] += h->x*im; sum[i][1] += h->y*im; sum[i][2] += h->z*im;
+        }
       }
-      if (func[3]) {					// dipole
-	register double im = *(ke++)*(zc.im*cek->re+
-	    cek->im*zc.re)*(mui[0]*h->x+mui[1]*h->y+mui[2]*h->z); ++cek;
-	sum[9][0] += h->x*im; sum[9][1] += h->y*im; sum[9][2] += h->z*im;
+      if (func[3]) {                                        // dipole
+        register double im = *(ke++)*(zc.im*cek->re+
+            cek->im*zc.re)*(mui[0]*h->x+mui[1]*h->y+mui[2]*h->z); ++cek;
+        sum[9][0] += h->x*im; sum[9][1] += h->y*im; sum[9][2] += h->z*im;
       }
     }
-    if (func[0]) {					// 1/r
+    if (func[0]) {                                        // 1/r
       register double qi = *(q++)*c[0];
       f[0] -= sum[0][0]*qi; f[1] -= sum[0][1]*qi; f[2] -= sum[0][2]*qi;
     }
-    if (func[1]) {					// geometric 1/r^6
+    if (func[1]) {                                        // geometric 1/r^6
       register double bi = B[*type]*c[1];
       f[0] -= sum[1][0]*bi; f[1] -= sum[1][1]*bi; f[2] -= sum[1][2]*bi;
     }
-    if (func[2]) {					// arithmetic 1/r^6
+    if (func[2]) {                                        // arithmetic 1/r^6
       register double *bi = B+7*type[0]+7;
       for (i=2; i<9; ++i) {
-	register double c2 = (--bi)[0]*c[2];
-	f[0] -= sum[i][0]*c2; f[1] -= sum[i][1]*c2; f[2] -= sum[i][2]*c2;
+        register double c2 = (--bi)[0]*c[2];
+        f[0] -= sum[i][0]*c2; f[1] -= sum[i][1]*c2; f[2] -= sum[i][2]*c2;
       }
     }
-    if (func[3]) {					// dipole
+    if (func[3]) {                                        // dipole
       f[0] -= sum[9][0]; f[1] -= sum[9][1]; f[2] -= sum[9][2];
-      *(t++) -= mui[1]*sum[0][2]+mui[2]*sum[0][1]-mui[0]*kt;	// torque
+      *(t++) -= mui[1]*sum[0][2]+mui[2]*sum[0][1]-mui[0]*kt;        // torque
       *(t++) -= mui[2]*sum[0][0]+mui[0]*sum[0][2]-mui[1]*kt;
       *(t++) -= mui[0]*sum[0][1]+mui[1]*sum[0][0]-mui[2]*kt;
     }
@@ -832,7 +832,7 @@ void EwaldN::compute_surface()
   energy_self[3] -= virial_self[3];
 
   if (!(vflag_atom || eflag_atom)) return;
- 
+
   double *ei = energy_self_peratom[0]+3;
   double *vi = virial_self_peratom[0]+3;
   double cv = 2.0*mumurd2e*MY_PI/(2.0*dielectric+1)/volume;
@@ -849,7 +849,7 @@ void EwaldN::compute_energy()
 {
   energy = 0.0;
   if (!eflag_global) return;
-  
+
   complex *cek = cek_global;
   double *ke = kenergy;
   const double qscale = force->qqrd2e * scale;
@@ -860,23 +860,23 @@ void EwaldN::compute_energy()
   int func[EWALD_NFUNCS];
 
   memcpy(func, function, EWALD_NFUNCS*sizeof(int));
-  memset(sum, 0, EWALD_NFUNCS*sizeof(double));		// reset sums
-  for (int k=0; k<nkvec; ++k) {				// sum over k vectors
-    if (func[0]) {					// 1/r
+  memset(sum, 0, EWALD_NFUNCS*sizeof(double));                // reset sums
+  for (int k=0; k<nkvec; ++k) {                                // sum over k vectors
+    if (func[0]) {                                        // 1/r
       sum[0] += *(ke++)*(cek->re*cek->re+cek->im*cek->im); ++cek; }
-    if (func[1]) {					// geometric 1/r^6
+    if (func[1]) {                                        // geometric 1/r^6
       sum[1] += *(ke++)*(cek->re*cek->re+cek->im*cek->im); ++cek; }
-    if (func[2]) {					// arithmetic 1/r^6
+    if (func[2]) {                                        // arithmetic 1/r^6
       register double r =
-	    (cek[0].re*cek[6].re+cek[0].im*cek[6].im)+
-	    (cek[1].re*cek[5].re+cek[1].im*cek[5].im)+
-	    (cek[2].re*cek[4].re+cek[2].im*cek[4].im)+
-	0.5*(cek[3].re*cek[3].re+cek[3].im*cek[3].im); cek += 7;
+            (cek[0].re*cek[6].re+cek[0].im*cek[6].im)+
+            (cek[1].re*cek[5].re+cek[1].im*cek[5].im)+
+            (cek[2].re*cek[4].re+cek[2].im*cek[4].im)+
+        0.5*(cek[3].re*cek[3].re+cek[3].im*cek[3].im); cek += 7;
       sum[2] += *(ke++)*r;
     }
-    if (func[3]) {					// dipole
+    if (func[3]) {                                        // dipole
       sum[3] += *(ke++)*(cek->re*cek->re+cek->im*cek->im); ++cek; }
-  }  
+  }
   for (int k=0; k<EWALD_NFUNCS; ++k) energy += c[k]*sum[k]-energy_self[k];
   if (slabflag) compute_slabcorr();
 }
@@ -885,7 +885,7 @@ void EwaldN::compute_energy()
 void EwaldN::compute_energy_peratom()
 {
   if (!eflag_atom) return;
-      
+
   kvector *k;
   hvector *h, *nh;
   cvector *z = ekr_local;
@@ -902,63 +902,63 @@ void EwaldN::compute_energy_peratom()
       2.0*MY_PI*sqrt(MY_PI)/(192.0*volume), 4.0*MY_PI*mumurd2e/volume};
   int i, kx, ky, lbytes = (2*nbox+1)*sizeof(cvector), *type = atom->type;
   int func[EWALD_NFUNCS];
-  
+
   memcpy(func, function, EWALD_NFUNCS*sizeof(int));
   for (int j = 0; j < atom->nlocal; j++, ++eatomj) {
-    k = kvec;						
-    kx = ky = -1;					
+    k = kvec;
+    kx = ky = -1;
     ke = kenergy;
     cek = cek_global;
     memset(sum, 0, EWALD_MAX_NSUMS*sizeof(double));
-    if (func[3]) { 
+    if (func[3]) {
       register double di = mu[3] * c[3];
       mui[0] = di*(mu++)[0]; mui[1] = di*(mu++)[0]; mui[2] = di*(mu++)[0];
       mu++;
     }
     for (nh = (h = hvec)+nkvec; h<nh; ++h, ++k) {
-      if (ky!=k->y) {					// based on order in
-	if (kx!=k->x) zx = z[kx = k->x].x; 		// reallocate
-	C_RMULT(zxy, z[ky = k->y].y, zx);
+      if (ky!=k->y) {                                        // based on order in
+        if (kx!=k->x) zx = z[kx = k->x].x;                 // reallocate
+        C_RMULT(zxy, z[ky = k->y].y, zx);
       }
       C_CRMULT(zc, z[k->z].z, zxy);
-      if (func[0]) {					// 1/r
-	sum[0] += *(ke++)*(cek->re*zc.re - cek->im*zc.im); ++cek; }
-      if (func[1]) {					// geometric 1/r^6
-	sum[1] += *(ke++)*(cek->re*zc.re - cek->im*zc.im); ++cek; }
-      if (func[2]) {					// arithmetic 1/r^6
-	register double im, c = *(ke++);
-	for (i=2; i<9; ++i) {
-	  im = c*(cek->re*zc.re - cek->im*zc.im); ++cek;
-	  sum[i] += im;
-	}
+      if (func[0]) {                                        // 1/r
+        sum[0] += *(ke++)*(cek->re*zc.re - cek->im*zc.im); ++cek; }
+      if (func[1]) {                                        // geometric 1/r^6
+        sum[1] += *(ke++)*(cek->re*zc.re - cek->im*zc.im); ++cek; }
+      if (func[2]) {                                        // arithmetic 1/r^6
+        register double im, c = *(ke++);
+        for (i=2; i<9; ++i) {
+          im = c*(cek->re*zc.re - cek->im*zc.im); ++cek;
+          sum[i] += im;
+        }
       }
-      if (func[3]) {					// dipole
-	sum[9] += *(ke++)*(cek->re*zc.re +
-		  cek->im*zc.im)*(mui[0]*h->x+mui[1]*h->y+mui[2]*h->z); ++cek;
+      if (func[3]) {                                        // dipole
+        sum[9] += *(ke++)*(cek->re*zc.re +
+                  cek->im*zc.im)*(mui[0]*h->x+mui[1]*h->y+mui[2]*h->z); ++cek;
       }
     }
-    
-    if (func[0]) {					// 1/r
+
+    if (func[0]) {                                        // 1/r
       register double qj = *(q++)*c[0];
       *eatomj += sum[0]*qj - energy_self_peratom[j][0];
     }
-    if (func[1]) {					// geometric 1/r^6
+    if (func[1]) {                                        // geometric 1/r^6
       register double bj = B[*type]*c[1];
       *eatomj += sum[1]*bj - energy_self_peratom[j][1];
     }
-    if (func[2]) {					// arithmetic 1/r^6
+    if (func[2]) {                                        // arithmetic 1/r^6
       register double *bj = B+7*type[0]+7;
       for (i=2; i<9; ++i) {
-	register double c2 = (--bj)[0]*c[2];
-	*eatomj += 0.5*sum[i]*c2;
-      }  
-      *eatomj -= energy_self_peratom[j][2];           
+        register double c2 = (--bj)[0]*c[2];
+        *eatomj += 0.5*sum[i]*c2;
+      }
+      *eatomj -= energy_self_peratom[j][2];
     }
-    if (func[3]) {					// dipole
+    if (func[3]) {                                        // dipole
       *eatomj += sum[9] - energy_self_peratom[j][3];
     }
     z = (cvector *) ((char *) z+lbytes);
-    ++type;   
+    ++type;
   }
 }
 
@@ -981,23 +981,23 @@ void EwaldN::compute_virial()
 
   memcpy(func, function, EWALD_NFUNCS*sizeof(int));
   memset(sum, 0, EWALD_NFUNCS*sizeof(shape));
-  for (int k=0; k<nkvec; ++k) {				// sum over k vectors
-    if (func[0]) { 					// 1/r
+  for (int k=0; k<nkvec; ++k) {                                // sum over k vectors
+    if (func[0]) {                                         // 1/r
       register double r = cek->re*cek->re+cek->im*cek->im; ++cek;
       sum[0][0] += *(kv++)*r; sum[0][1] += *(kv++)*r; sum[0][2] += *(kv++)*r;
       sum[0][3] += *(kv++)*r; sum[0][4] += *(kv++)*r; sum[0][5] += *(kv++)*r;
     }
-    if (func[1]) {					// geometric 1/r^6
+    if (func[1]) {                                        // geometric 1/r^6
       register double r = cek->re*cek->re+cek->im*cek->im; ++cek;
       sum[1][0] += *(kv++)*r; sum[1][1] += *(kv++)*r; sum[1][2] += *(kv++)*r;
       sum[1][3] += *(kv++)*r; sum[1][4] += *(kv++)*r; sum[1][5] += *(kv++)*r;
     }
-    if (func[2]) {					// arithmetic 1/r^6
+    if (func[2]) {                                        // arithmetic 1/r^6
       register double r =
-	    (cek[0].re*cek[6].re+cek[0].im*cek[6].im)+
-	    (cek[1].re*cek[5].re+cek[1].im*cek[5].im)+
-	    (cek[2].re*cek[4].re+cek[2].im*cek[4].im)+
-	0.5*(cek[3].re*cek[3].re+cek[3].im*cek[3].im); cek += 7;
+            (cek[0].re*cek[6].re+cek[0].im*cek[6].im)+
+            (cek[1].re*cek[5].re+cek[1].im*cek[5].im)+
+            (cek[2].re*cek[4].re+cek[2].im*cek[4].im)+
+        0.5*(cek[3].re*cek[3].re+cek[3].im*cek[3].im); cek += 7;
       sum[2][0] += *(kv++)*r; sum[2][1] += *(kv++)*r; sum[2][2] += *(kv++)*r;
       sum[2][3] += *(kv++)*r; sum[2][4] += *(kv++)*r; sum[2][5] += *(kv++)*r;
     }
@@ -1019,7 +1019,7 @@ void EwaldN::compute_virial()
 void EwaldN::compute_virial_peratom()
 {
   if (!vflag_atom) return;
-      
+
   kvector *k;
   hvector *h, *nh;
   cvector *z = ekr_local;
@@ -1038,93 +1038,93 @@ void EwaldN::compute_virial_peratom()
 
   memcpy(func, function, EWALD_NFUNCS*sizeof(int));
   int i, kx, ky, lbytes = (2*nbox+1)*sizeof(cvector), *type = atom->type;
-  for (int j = 0; j < atom->nlocal; j++, vatomj += 6) {					
-    k = kvec;						
-    kx = ky = -1;					
+  for (int j = 0; j < atom->nlocal; j++, vatomj += 6) {
+    k = kvec;
+    kx = ky = -1;
     kv = kvirial;
     cek = cek_global;
     memset(sum, 0, EWALD_MAX_NSUMS*sizeof(shape));
-    if (func[3]) { 
+    if (func[3]) {
       register double di = mu[3] * c[3];
       mui[0] = di*(mu++)[0]; mui[1] = di*(mu++)[1]; mui[2] = di*(mu++)[2];
       mu++;
     }
     for (nh = (h = hvec)+nkvec; h<nh; ++h, ++k) {
-      if (ky!=k->y) {					// based on order in
-	  if (kx!=k->x) zx = z[kx = k->x].x; 		// reallocate
-	  C_RMULT(zxy, z[ky = k->y].y, zx);
+      if (ky!=k->y) {                                        // based on order in
+          if (kx!=k->x) zx = z[kx = k->x].x;                 // reallocate
+          C_RMULT(zxy, z[ky = k->y].y, zx);
       }
       C_CRMULT(zc, z[k->z].z, zxy);
-      if (func[0]) {					// 1/r
-	  register double r = cek->re*zc.re - cek->im*zc.im; ++cek;
-	  sum[0][0] += *(kv++)*r;
-	  sum[0][1] += *(kv++)*r;
-	  sum[0][2] += *(kv++)*r;
-	  sum[0][3] += *(kv++)*r;
-	  sum[0][4] += *(kv++)*r;
-	  sum[0][5] += *(kv++)*r;
+      if (func[0]) {                                        // 1/r
+          register double r = cek->re*zc.re - cek->im*zc.im; ++cek;
+          sum[0][0] += *(kv++)*r;
+          sum[0][1] += *(kv++)*r;
+          sum[0][2] += *(kv++)*r;
+          sum[0][3] += *(kv++)*r;
+          sum[0][4] += *(kv++)*r;
+          sum[0][5] += *(kv++)*r;
       }
-      if (func[1]) {					// geometric 1/r^6
-	  register double r = cek->re*zc.re - cek->im*zc.im; ++cek;
-	  sum[1][0] += *(kv++)*r;
-	  sum[1][1] += *(kv++)*r;
-	  sum[1][2] += *(kv++)*r;
-	  sum[1][3] += *(kv++)*r;
-	  sum[1][4] += *(kv++)*r;
-	  sum[1][5] += *(kv++)*r;
+      if (func[1]) {                                        // geometric 1/r^6
+          register double r = cek->re*zc.re - cek->im*zc.im; ++cek;
+          sum[1][0] += *(kv++)*r;
+          sum[1][1] += *(kv++)*r;
+          sum[1][2] += *(kv++)*r;
+          sum[1][3] += *(kv++)*r;
+          sum[1][4] += *(kv++)*r;
+          sum[1][5] += *(kv++)*r;
       }
-      if (func[2]) {					// arithmetic 1/r^6
-	register double r;
-	for (i=2; i<9; ++i) {
-	  r = cek->re*zc.re - cek->im*zc.im; ++cek;
-	  sum[i][0] += *(kv++)*r;
-	  sum[i][1] += *(kv++)*r;
-	  sum[i][2] += *(kv++)*r;
-	  sum[i][3] += *(kv++)*r;
-	  sum[i][4] += *(kv++)*r;
-	  sum[i][5] += *(kv++)*r;
+      if (func[2]) {                                        // arithmetic 1/r^6
+        register double r;
+        for (i=2; i<9; ++i) {
+          r = cek->re*zc.re - cek->im*zc.im; ++cek;
+          sum[i][0] += *(kv++)*r;
+          sum[i][1] += *(kv++)*r;
+          sum[i][2] += *(kv++)*r;
+          sum[i][3] += *(kv++)*r;
+          sum[i][4] += *(kv++)*r;
+          sum[i][5] += *(kv++)*r;
       kv -= 6;
-	}
+        }
     kv += 6;
       }
-      if (func[3]) {					// dipole
-	 register double
-	   r = (cek->re*zc.re - cek->im*zc.im)
-	      *(mui[0]*h->x+mui[1]*h->y+mui[2]*h->z); ++cek;
-	 sum[9][0] += *(kv++)*r;
-	 sum[9][1] += *(kv++)*r;
-	 sum[9][2] += *(kv++)*r;
-	 sum[9][3] += *(kv++)*r;
-	 sum[9][4] += *(kv++)*r;
-	 sum[9][5] += *(kv++)*r;
+      if (func[3]) {                                        // dipole
+         register double
+           r = (cek->re*zc.re - cek->im*zc.im)
+              *(mui[0]*h->x+mui[1]*h->y+mui[2]*h->z); ++cek;
+         sum[9][0] += *(kv++)*r;
+         sum[9][1] += *(kv++)*r;
+         sum[9][2] += *(kv++)*r;
+         sum[9][3] += *(kv++)*r;
+         sum[9][4] += *(kv++)*r;
+         sum[9][5] += *(kv++)*r;
       }
     }
-		
-    if (func[0]) {					// 1/r
+
+    if (func[0]) {                                        // 1/r
       register double qi = *(q++)*c[0];
       for (int n = 0; n < 6; n++) vatomj[n] += sum[0][n]*qi;
     }
-    if (func[1]) {					// geometric 1/r^6
+    if (func[1]) {                                        // geometric 1/r^6
       register double bi = B[*type]*c[1];
       for (int n = 0; n < 6; n++) vatomj[n] += sum[1][n]*bi;
     }
-    if (func[2]) {					// arithmetic 1/r^6
+    if (func[2]) {                                        // arithmetic 1/r^6
       register double *bj = B+7*type[0]+7;
       for (i=2; i<9; ++i) {
-	register double c2 = (--bj)[0]*c[2];
-	for (int n = 0; n < 6; n++) vatomj[n] += 0.5*sum[i][n]*c2;
+        register double c2 = (--bj)[0]*c[2];
+        for (int n = 0; n < 6; n++) vatomj[n] += 0.5*sum[i][n]*c2;
       }
     }
-    if (func[3]) {					// dipole
+    if (func[3]) {                                        // dipole
       for (int n = 0; n < 6; n++) vatomj[n] += sum[9][n];
     }
 
     for (int k=0; k<EWALD_NFUNCS; ++k) {
       if (func[k]) {
-	for (int n = 0; n < 3; n++) vatomj[n] -= virial_self_peratom[j][k]; 
+        for (int n = 0; n < 3; n++) vatomj[n] -= virial_self_peratom[j][k];
       }
     }
-    
+
     z = (cvector *) ((char *) z+lbytes);
     ++type;
   }
@@ -1133,46 +1133,46 @@ void EwaldN::compute_virial_peratom()
 
 /* ----------------------------------------------------------------------
    Slab-geometry correction term to dampen inter-slab interactions between
-   periodically repeating slabs.  Yields good approximation to 2-D EwaldN if 
-   adequate empty space is left between repeating slabs (J. Chem. Phys. 
-   111, 3155).  Slabs defined here to be parallel to the xy plane. 
+   periodically repeating slabs.  Yields good approximation to 2-D EwaldN if
+   adequate empty space is left between repeating slabs (J. Chem. Phys.
+   111, 3155).  Slabs defined here to be parallel to the xy plane.
 ------------------------------------------------------------------------- */
 
 void EwaldN::compute_slabcorr()
 {
   // compute local contribution to global dipole moment
-  
+
   double *q = atom->q;
   double **x = atom->x;
   int nlocal = atom->nlocal;
-  
+
   double dipole = 0.0;
   for (int i = 0; i < nlocal; i++) dipole += q[i]*x[i][2];
-  
+
   // sum local contributions to get global dipole moment
-  
+
   double dipole_all;
   MPI_Allreduce(&dipole,&dipole_all,1,MPI_DOUBLE,MPI_SUM,world);
-  
+
   // compute corrections
-  
+
   const double e_slabcorr = 2.0*MY_PI*dipole_all*dipole_all/volume;
   const double qscale = force->qqrd2e * scale;
-  
+
   if (eflag_global) energy += qscale * e_slabcorr;
-  
+
   // per-atom energy
-  
+
   if (eflag_atom) {
-    double efact = 2.0*MY_PI*dipole_all/volume; 
+    double efact = 2.0*MY_PI*dipole_all/volume;
     for (int i = 0; i < nlocal; i++) eatom[i] += qscale * q[i]*x[i][2]*efact;
   }
-  
+
   // add on force corrections
-  
-  double ffact = -4.0*MY_PI*dipole_all/volume; 
+
+  double ffact = -4.0*MY_PI*dipole_all/volume;
   double **f = atom->f;
-  
+
   for (int i = 0; i < nlocal; i++) f[i][2] += qscale * q[i]*ffact;
 }
 
@@ -1187,11 +1187,11 @@ double EwaldN::NewtonSolve(double x, double Rc, bigint natoms, double vol, doubl
 
   maxit = 10000; //Maximum number of iterations
   tol = 0.00001; //Convergence tolerance
-        
+
   //Begin algorithm
-  
+
   for (int i = 0; i < maxit; i++) {
-    dx = f(x,Rc,natoms,vol,b2) / derivf(x,Rc,natoms,vol,b2); 
+    dx = f(x,Rc,natoms,vol,b2) / derivf(x,Rc,natoms,vol,b2);
     x = x - dx; //Update x
     if (fabs(dx) < tol) return x;
   }
@@ -1213,10 +1213,9 @@ double EwaldN::f(double x, double Rc, bigint natoms, double vol, double b2)
 /* ----------------------------------------------------------------------
  Calculate numerical derivative f'(x)
  ------------------------------------------------------------------------- */
-            
+
 double EwaldN::derivf(double x, double Rc, bigint natoms, double vol, double b2)
-{  
+{
   double h = 0.000001;  //Derivative step-size
   return (f(x + h,Rc,natoms,vol,b2) - f(x,Rc,natoms,vol,b2)) / h;
-}       
-
+}
diff --git a/src/USER-EWALDN/ewald_n.h b/src/USER-EWALDN/ewald_n.h
index 8747048770..4bc4bc1d83 100644
--- a/src/USER-EWALDN/ewald_n.h
+++ b/src/USER-EWALDN/ewald_n.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -25,10 +25,10 @@ KSpaceStyle(ewald/n,EwaldN)
 
 namespace LAMMPS_NS {
 
-#define EWALD_NORDER	6
-#define EWALD_NFUNCS	4
-#define EWALD_MAX_NSUMS	10
-#define EWALD_NSUMS	{1, 1, 7, 1}
+#define EWALD_NORDER        6
+#define EWALD_NFUNCS        4
+#define EWALD_MAX_NSUMS        10
+#define EWALD_NSUMS        {1, 1, 7, 1}
 
 typedef struct cvector { complex x, y, z; } cvector;
 typedef struct hvector { double x, y, z; } hvector;
@@ -64,7 +64,7 @@ class EwaldN : public KSpace {
   double mumurd2e, dielectric, *B, volume;
   struct Sum { double x, x2; } sum[EWALD_MAX_NSUMS];
   complex *cek_local, *cek_global;
- 
+
   double rms(int, double, bigint, double, double);
   void reallocate();
   void allocate_peratom();
diff --git a/src/USER-EWALDN/math_complex.h b/src/USER-EWALDN/math_complex.h
index 1540af012f..4f53b45288 100644
--- a/src/USER-EWALDN/math_complex.h
+++ b/src/USER-EWALDN/math_complex.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -18,7 +18,7 @@
 #ifndef LMP_MATH_COMPLEX_H
 #define LMP_MATH_COMPLEX_H
 
-#define COMPLEX_NULL	{0, 0}
+#define COMPLEX_NULL        {0, 0}
 
 namespace LAMMPS_NS {
 
@@ -70,4 +70,3 @@ typedef struct complex {
   memcpy(&d, &x, sizeof(complex)); }
 
 #endif
-
diff --git a/src/USER-EWALDN/math_vector.h b/src/USER-EWALDN/math_vector.h
index b7473b5d89..da65e069bd 100644
--- a/src/USER-EWALDN/math_vector.h
+++ b/src/USER-EWALDN/math_vector.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -21,80 +21,80 @@
 #include "math.h"
 #include "string.h"
 
-#define VECTOR_NULL	{0, 0, 0}
-#define SHAPE_NULL	{0, 0, 0, 0, 0, 0}
-#define FORM_NULL	{0, 0, 0, 0, 0, 0}
-#define MATRIX_NULL	{VECTOR_NULL, VECTOR_NULL, VECTOR_NULL}
-#define VECTOR4_NULL	{0, 0, 0, 0}
-#define QUATERNION_NULL	{0, 0, 0, 0}
-#define FORM4_NULL	{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+#define VECTOR_NULL        {0, 0, 0}
+#define SHAPE_NULL        {0, 0, 0, 0, 0, 0}
+#define FORM_NULL        {0, 0, 0, 0, 0, 0}
+#define MATRIX_NULL        {VECTOR_NULL, VECTOR_NULL, VECTOR_NULL}
+#define VECTOR4_NULL        {0, 0, 0, 0}
+#define QUATERNION_NULL        {0, 0, 0, 0}
+#define FORM4_NULL        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 
 #define FZERO 1e-15
 #define fzero(x) (((x)>-FZERO) && ((x)<FZERO))
 
 namespace LAMMPS_NS {
 
-typedef double vector[3];		// 0:x  1:y  2:z
+typedef double vector[3];                // 0:x  1:y  2:z
 typedef int lvector[3];
-typedef double shape[6];		// 0:xx 1:yy 2:zz 3:zy 4:zx 5:yx
-typedef int lshape[6];			// xy=0  xz=0  yz=0;
-typedef double form[6];			// 0:xx 1:yy 2:zz 3:zy 4:zx 5:yx
-typedef int lform[6];			// xy=yx xz=zx yz=zy;
-typedef vector matrix[3];		// 00:xx 11:yy 22:zz 21:zy 20:zx 10:yx
+typedef double shape[6];                // 0:xx 1:yy 2:zz 3:zy 4:zx 5:yx
+typedef int lshape[6];                        // xy=0  xz=0  yz=0;
+typedef double form[6];                        // 0:xx 1:yy 2:zz 3:zy 4:zx 5:yx
+typedef int lform[6];                        // xy=yx xz=zx yz=zy;
+typedef vector matrix[3];                // 00:xx 11:yy 22:zz 21:zy 20:zx 10:yx
 typedef lvector lmatrix[3];
-typedef double vector4[4];		// 4D vector
-typedef double form4[10];		// 0:00 1:11 2:22 3:33 4:32
-					// 5:31 6:30 7:21 8:20 9:10
-					// 01=10 02=20 03=30 etc
-typedef double quaternion[4];		// quaternion
+typedef double vector4[4];                // 4D vector
+typedef double form4[10];                // 0:00 1:11 2:22 3:33 4:32
+                                        // 5:31 6:30 7:21 8:20 9:10
+                                        // 01=10 02=20 03=30 etc
+typedef double quaternion[4];                // quaternion
 
 // vector operators
 
-inline double vec_dot(vector &a, vector &b) {			// a.b
+inline double vec_dot(vector &a, vector &b) {                        // a.b
   return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]; }
 
 inline void vec_null(vector &dest) {
   memset(dest, 0, sizeof(vector)); }
 
-inline void vec_neg(vector &dest) {				// -a
+inline void vec_neg(vector &dest) {                                // -a
   dest[0] = -dest[0];
   dest[1] = -dest[1];
   dest[2] = -dest[2]; }
 
-inline void vec_norm(vector &dest) { 				// a/|a|
-  register double f = sqrt(vec_dot(dest, dest)); 
-  dest[0] /= f; 
-  dest[1] /= f; 
+inline void vec_norm(vector &dest) {                                 // a/|a|
+  register double f = sqrt(vec_dot(dest, dest));
+  dest[0] /= f;
+  dest[1] /= f;
   dest[2] /= f; }
 
-inline void vec_add(vector &dest, vector &src) {		// a+b
+inline void vec_add(vector &dest, vector &src) {                // a+b
   dest[0] += src[0];
   dest[1] += src[1];
   dest[2] += src[2]; }
 
-inline void vec_subtr(vector &dest, vector &src) {		// a-b
+inline void vec_subtr(vector &dest, vector &src) {                // a-b
   dest[0] -= src[0];
   dest[1] -= src[1];
   dest[2] -= src[2]; }
 
-inline void vec_mult(vector &dest, vector &src) {		// a*b
+inline void vec_mult(vector &dest, vector &src) {                // a*b
   dest[0] *= src[0];
   dest[1] *= src[1];
   dest[2] *= src[2]; }
 
-inline void vec_div(vector &dest, vector &src) {		// a/b
+inline void vec_div(vector &dest, vector &src) {                // a/b
   dest[0] /= src[0];
   dest[1] /= src[1];
   dest[2] /= src[2]; }
 
-inline void vec_cross(vector &dest, vector &src) {		// a x b
+inline void vec_cross(vector &dest, vector &src) {                // a x b
   vector t = {
     dest[1]*src[2]-dest[2]*src[1],
     dest[2]*src[0]-dest[0]*src[2],
     dest[0]*src[1]-dest[1]*src[0]};
   memcpy(dest, t, sizeof(vector)); }
 
-inline void vec_scalar_mult(vector &dest, double f) {		// f*a
+inline void vec_scalar_mult(vector &dest, double f) {                // f*a
   dest[0] *= f;
   dest[1] *= f;
   dest[2] *= f; }
@@ -121,27 +121,27 @@ inline void shape_unit(shape &dest) {
   memset(dest, 0, sizeof(shape));
   dest[0] = dest[1] = dest[2] = 1.0; }
 
-inline void shape_add(shape &dest, shape &src) {		// h_a+h_b
+inline void shape_add(shape &dest, shape &src) {                // h_a+h_b
   dest[0] += src[0]; dest[1] += src[1]; dest[2] += src[2];
   dest[3] += src[3]; dest[4] += src[4]; dest[5] += src[5]; }
 
-inline void shape_subtr(shape &dest, shape &src) {		// h_a-h_b
+inline void shape_subtr(shape &dest, shape &src) {                // h_a-h_b
   dest[0] -= src[0]; dest[1] -= src[1]; dest[2] -= src[2];
   dest[3] -= src[3]; dest[4] -= src[4]; dest[5] -= src[5]; }
 
-inline void shape_inv(shape &h_inv, shape &h) {			// h^-1
+inline void shape_inv(shape &h_inv, shape &h) {                        // h^-1
   h_inv[0] = 1.0/h[0]; h_inv[1] = 1.0/h[1]; h_inv[2] = 1.0/h[2];
   h_inv[3] = -h[3]/(h[1]*h[2]);
   h_inv[4] = (h[3]*h[5]-h[1]*h[4])/(h[0]*h[1]*h[2]);
-  h_inv[5] = -h[5]/(h[0]*h[1]); } 
+  h_inv[5] = -h[5]/(h[0]*h[1]); }
 
-inline void shape_dot(shape &dest, shape &src) {		// h_a.h_b
+inline void shape_dot(shape &dest, shape &src) {                // h_a.h_b
   dest[3] = dest[1]*src[3]+dest[3]*src[2];
   dest[4] = dest[0]*src[4]+dest[5]*src[3]+dest[4]*src[2];
   dest[5] = dest[0]*src[5]+dest[5]*src[1];
   dest[0] *= src[0]; dest[1] *= src[1]; dest[2] *= src[2]; }
 
-inline void shape_scalar_mult(shape &dest, double f) {		// f*h
+inline void shape_scalar_mult(shape &dest, double f) {                // f*h
   dest[0] *= f; dest[1] *= f; dest[2] *= f;
   dest[3] *= f; dest[4] *= f; dest[5] *= f; }
 
@@ -155,7 +155,7 @@ inline void vec_shape_dot(vector &dest, shape &h, vector &src) {// a.h
   dest[1] = h[5]*src[0]+h[1]*src[1];
   dest[0] = h[0]*src[0]; }
 
-inline void shape_to_matrix(matrix &dest, shape &h) {		// m = h
+inline void shape_to_matrix(matrix &dest, shape &h) {                // m = h
   dest[0][0] = h[0]; dest[1][0] = h[5]; dest[2][0] = h[4];
   dest[0][1] =  0.0; dest[1][1] = h[1]; dest[2][1] = h[3];
   dest[0][2] =  0.0; dest[1][2] =  0.0; dest[2][2] = h[2]; }
@@ -170,10 +170,10 @@ inline void lshape_to_shape(shape &dest, lshape &src) {
 
 // form operators
 
-inline double form_det(form &m) {				// |m|
+inline double form_det(form &m) {                                // |m|
   return m[0]*(m[1]*m[2]-m[3]*m[3])+
     m[4]*(2.0*m[3]*m[5]-m[1]*m[4])-m[2]*m[5]*m[5]; }
-    
+
 inline void form_null(form &dest) {
   memset(dest, 0, sizeof(form)); }
 
@@ -181,15 +181,15 @@ inline void form_unit(form &dest) {
   memset(dest, 0, sizeof(form));
   dest[0] = dest[1] = dest[2] = 1.0; }
 
-inline void form_add(form &dest, form &src) {			// m_a+m_b
+inline void form_add(form &dest, form &src) {                        // m_a+m_b
   dest[0] += src[0]; dest[1] += src[1]; dest[2] += src[2];
   dest[3] += src[3]; dest[4] += src[4]; dest[5] += src[5]; }
 
-inline void form_subtr(shape &dest, form &src) {		// m_a-m_b
+inline void form_subtr(shape &dest, form &src) {                // m_a-m_b
   dest[0] -= src[0]; dest[1] -= src[1]; dest[2] -= src[2];
   dest[3] -= src[3]; dest[4] -= src[4]; dest[5] -= src[5]; }
 
-inline int form_inv(form &m_inv, form &m) {			// m^-1
+inline int form_inv(form &m_inv, form &m) {                        // m^-1
   register double det = form_det(m);
   if (fzero(det)) return 0;
   m_inv[0] = (m[1]*m[2]-m[3]*m[3])/det;
@@ -200,7 +200,7 @@ inline int form_inv(form &m_inv, form &m) {			// m^-1
   m_inv[5] = (m[3]*m[4]-m[2]*m[5])/det;
   return 1; }
 
-inline void form_dot(form &dest, form &src) {			// m_a.m_b
+inline void form_dot(form &dest, form &src) {                        // m_a.m_b
   form m;
   memcpy(m, dest, sizeof(form));
   dest[0] = m[0]*src[0]+m[4]*src[4]+m[5]*src[5];
@@ -210,7 +210,7 @@ inline void form_dot(form &dest, form &src) {			// m_a.m_b
   dest[4] = m[4]*src[2]+m[5]*src[3]+m[0]*src[4];
   dest[5] = m[5]*src[1]+m[4]*src[3]+m[0]*src[5]; }
 
-inline void form_vec_dot(vector &dest, form &m) {		// m.a
+inline void form_vec_dot(vector &dest, form &m) {                // m.a
   vector a;
   memcpy(a, dest, sizeof(vector));
   dest[0] = m[0]*a[0]+m[5]*a[1]+m[4]*a[2];
@@ -227,12 +227,12 @@ inline void lform_to_form(form &dest, lform &src) {
 
 // matrix operators
 
-inline double matrix_det(matrix &m) {				// |m|
+inline double matrix_det(matrix &m) {                                // |m|
   vector axb;
   memcpy(&axb, m[0], sizeof(vector));
   vec_cross(axb, m[1]);
   return vec_dot(axb, m[2]); }
-  
+
 inline void matrix_null(matrix &dest) {
   memset(dest, 0, sizeof(dest)); }
 
@@ -240,19 +240,19 @@ inline void matrix_unit(matrix &dest) {
   memset(dest, 0, sizeof(dest));
   dest[0][0] = dest[1][1] = dest[2][2] = 1.0; }
 
-inline void matrix_scalar_mult(matrix &dest, double f) {	// f*m
+inline void matrix_scalar_mult(matrix &dest, double f) {        // f*m
   vec_scalar_mult(dest[0], f);
   vec_scalar_mult(dest[1], f);
   vec_scalar_mult(dest[2], f); }
 
-inline void matrix_trans(matrix &dest) {			// m^t
+inline void matrix_trans(matrix &dest) {                        // m^t
   double f = dest[0][1]; dest[0][1] = dest[1][0]; dest[1][0] = f;
   f = dest[0][2]; dest[0][2] = dest[2][0]; dest[2][0] = f;
   f = dest[1][2]; dest[1][2] = dest[2][1]; dest[2][1] = f; }
 
-inline int matrix_inv(matrix &dest, matrix &src) {		// m^-1
+inline int matrix_inv(matrix &dest, matrix &src) {                // m^-1
   double f = matrix_det(src);
-  if (fzero(f)) return 0;				// singular matrix
+  if (fzero(f)) return 0;                                // singular matrix
   memcpy(dest[0], src[1], sizeof(vector));
   memcpy(dest[1], src[2], sizeof(vector));
   memcpy(dest[2], src[0], sizeof(vector));
@@ -262,16 +262,16 @@ inline int matrix_inv(matrix &dest, matrix &src) {		// m^-1
   matrix_scalar_mult(dest, 1.0/f);
   matrix_trans(dest);
   return 0; }
-  
+
 inline void matrix_vec_dot(vector &dest, vector &src, matrix &m) { // m.a
   dest[0] = m[0][0]*src[0]+m[1][0]*src[1]+m[2][0]*src[2];
   dest[1] = m[0][1]*src[0]+m[1][1]*src[1]+m[2][1]*src[2];
   dest[2] = m[0][2]*src[0]+m[1][2]*src[1]+m[2][2]*src[2]; }
 
-inline void matrix_to_shape(shape &dest, matrix &src) {		// h = m
+inline void matrix_to_shape(shape &dest, matrix &src) {                // h = m
   dest[0] = src[0][0]; dest[1] = src[1][1]; dest[2] = src[2][2];
   dest[3] = src[2][1]; dest[4] = src[2][0]; dest[5] = src[1][0]; }
-  
+
 inline void matrix_to_lmatrix(lmatrix &dest, matrix &src) {
   vec_to_lvec(dest[0], src[0]);
   vec_to_lvec(dest[1], src[1]);
@@ -284,20 +284,20 @@ inline void lmatrix_to_matrix(matrix &dest, lmatrix &src) {
 
 // quaternion operators
 
-inline double quat_dot(quaternion &p, quaternion &q) {		// p.q
+inline double quat_dot(quaternion &p, quaternion &q) {                // p.q
   return p[0]*q[0]+p[1]*q[1]+p[2]*q[2]+p[3]*q[3];
 }
 
-inline void quat_norm(quaternion &q) {				// q = q/|q|
+inline void quat_norm(quaternion &q) {                                // q = q/|q|
   double f = sqrt(q[0]*q[0]+q[1]*q[1]+q[2]*q[2]+q[3]*q[3]);
   q[0] /= f; q[1] /= f; q[2] /= f; q[3] /= f;
 }
 
-inline void quat_conj(quaternion &q) {				// q = conj(q)
+inline void quat_conj(quaternion &q) {                                // q = conj(q)
   q[1] = -q[1]; q[2] = -q[2]; q[3] = -q[3];
 }
 
-inline void quat_mult(quaternion &dest, quaternion &src) {	// dest *= src
+inline void quat_mult(quaternion &dest, quaternion &src) {        // dest *= src
   quaternion q;
   memcpy(q, dest, sizeof(quaternion));
   dest[0] =  src[0]*q[3]+src[1]*q[2]-src[2]*q[1]+src[3]*q[0];
@@ -306,7 +306,7 @@ inline void quat_mult(quaternion &dest, quaternion &src) {	// dest *= src
   dest[3] = -src[0]*q[0]-src[1]*q[1]-src[2]*q[2]+src[3]*q[3];
 }
 
-inline void quat_div(quaternion &dest, quaternion &src) {	// dest /= src
+inline void quat_div(quaternion &dest, quaternion &src) {        // dest /= src
   quaternion q;
   memcpy(q, dest, sizeof(quaternion));
   dest[0] =  src[0]*q[3]-src[1]*q[2]+src[2]*q[1]-src[3]*q[0];
@@ -314,16 +314,16 @@ inline void quat_div(quaternion &dest, quaternion &src) {	// dest /= src
   dest[2] =  src[0]*q[1]+src[1]*q[0]-src[2]*q[3]-src[3]*q[2];
   dest[3] = -src[0]*q[0]+src[1]*q[1]+src[2]*q[2]-src[3]*q[3];
 }
-							// dest = q*src*conj(q)
+                                                        // dest = q*src*conj(q)
 inline void quat_vec_rot(vector &dest, vector &src, quaternion &q) {
   quaternion aa={q[0]*q[0], q[1]*q[1], q[2]*q[2], q[3]*q[3]};
   form ab={q[0]*q[1], q[0]*q[2], q[0]*q[3], q[1]*q[2], q[1]*q[3], q[2]*q[3]};
   dest[0] = (aa[0]+aa[1]-aa[2]-aa[3])*src[0]+
-	    ((ab[3]-ab[2])*src[1]+(ab[1]+ab[4])*src[2])*2.0;
+            ((ab[3]-ab[2])*src[1]+(ab[1]+ab[4])*src[2])*2.0;
   dest[1] = (aa[0]-aa[1]+aa[2]-aa[3])*src[1]+
-	    ((ab[2]+ab[3])*src[0]+(ab[5]-ab[0])*src[2])*2.0;
+            ((ab[2]+ab[3])*src[0]+(ab[5]-ab[0])*src[2])*2.0;
   dest[2] = (aa[0]-aa[1]-aa[2]+aa[3])*src[2]+
-	    ((ab[4]-ab[1])*src[0]+(ab[0]+ab[5])*src[1])*2.0;
+            ((ab[4]-ab[1])*src[0]+(ab[0]+ab[5])*src[1])*2.0;
 }
 
 // vector4 operators
@@ -334,7 +334,7 @@ inline void vec4_null(vector4 &dest) {
 
 inline double vec4_dot(vector4 &a, vector4 &b) {
   return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]; }
-  
+
 // form operators
 
 inline void form4_null(form4 &dest) {
@@ -351,8 +351,8 @@ inline double form4_det(form4 &m) {
       m[5]*(2.0*m[4]*m[7]-m[2]*m[5])-m[3]*m[7]*m[7])+f*f+
     -m[1]*(m[2]*m[6]*m[6]+m[8]*(m[3]*m[8]-2.0*m[4]*m[6]))+
     m[9]*(
-	2.0*(m[2]*m[5]*m[6]+m[3]*m[7]*m[8]-m[4]*(m[6]*m[7]+m[5]*m[8]))+
-	m[9]*(m[4]*m[4]-m[2]*m[3])); }
+        2.0*(m[2]*m[5]*m[6]+m[3]*m[7]*m[8]-m[4]*(m[6]*m[7]+m[5]*m[8]))+
+        m[9]*(m[4]*m[4]-m[2]*m[3])); }
 
 inline int form4_inv(form4 &m_inv, form4 &m) {
   register double det = form4_det(m);
@@ -394,10 +394,10 @@ inline int regress2(vector &eqn, int order, double *x, double *y, int n) {
   vector xty = VECTOR_NULL;
   double xn, xi, yi;
   int i;
- 
+
   vec_null(eqn);
   xtx[0] = n;
-  if ((order = order%2)<0) order = -order;		// max: quad regress
+  if ((order = order%2)<0) order = -order;                // max: quad regress
   if (order<1) xtx[1] = 1.0;
   if (order<2) xtx[2] = 1.0;
   for (i=0; i<n; ++i) {
@@ -420,10 +420,10 @@ inline int regress3(vector4 &eqn, int order, double *x, double *y, int n) {
   vector4 xty = VECTOR4_NULL;
   double xn, xi, yi;
   int i;
- 
+
   vec4_null(eqn);
   xtx[0] = n;
-  if ((order = order%3)<0) order = -order;		// max: cubic regress
+  if ((order = order%3)<0) order = -order;                // max: cubic regress
   if (order<1) xtx[1] = 1.0;
   if (order<2) xtx[2] = 1.0;
   if (order<3) xtx[3] = 1.0;
diff --git a/src/USER-EWALDN/pair_buck_coul.cpp b/src/USER-EWALDN/pair_buck_coul.cpp
index 512f10aedc..dd7d323852 100644
--- a/src/USER-EWALDN/pair_buck_coul.cpp
+++ b/src/USER-EWALDN/pair_buck_coul.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -56,13 +56,13 @@ PairBuckCoul::PairBuckCoul(LAMMPS *lmp) : Pair(lmp)
    global settings
 ------------------------------------------------------------------------- */
 
-#define PAIR_ILLEGAL	"Illegal pair_style buck/coul command"
-#define PAIR_CUTOFF	"Only one cut-off allowed when requesting all long"
-#define PAIR_MISSING	"Cut-offs missing in pair_style buck/coul"
-#define PAIR_LJ_OFF	"LJ6 off not supported in pair_style buck/coul"
-#define PAIR_COUL_CUT	"Coulombic cut not supported in pair_style buck/coul"
-#define PAIR_LARGEST	"Using largest cut-off for buck/coul long long"
-#define PAIR_MIX	"Geometric mixing assumed for 1/r^6 coefficients"
+#define PAIR_ILLEGAL        "Illegal pair_style buck/coul command"
+#define PAIR_CUTOFF        "Only one cut-off allowed when requesting all long"
+#define PAIR_MISSING        "Cut-offs missing in pair_style buck/coul"
+#define PAIR_LJ_OFF        "LJ6 off not supported in pair_style buck/coul"
+#define PAIR_COUL_CUT        "Coulombic cut not supported in pair_style buck/coul"
+#define PAIR_LARGEST        "Using largest cut-off for buck/coul long long"
+#define PAIR_MIX        "Geometric mixing assumed for 1/r^6 coefficients"
 
 void PairBuckCoul::options(char **arg, int order)
 {
@@ -73,8 +73,8 @@ void PairBuckCoul::options(char **arg, int order)
   for (i=0; option[i]&&strcmp(arg[0], option[i]); ++i);
   switch (i) {
     default: error->all(FLERR,PAIR_ILLEGAL);
-    case 0: ewald_order |= 1<<order; break;		// set kspace r^-order
-    case 2: ewald_off |= 1<<order;			// turn r^-order off
+    case 0: ewald_order |= 1<<order; break;                // set kspace r^-order
+    case 2: ewald_off |= 1<<order;                        // turn r^-order off
     case 1: break;
   }
 }
@@ -83,7 +83,7 @@ void PairBuckCoul::options(char **arg, int order)
 void PairBuckCoul::settings(int narg, char **arg)
 {
   if (narg != 3 && narg != 4) error->all(FLERR,"Illegal pair_style command");
- 
+
   ewald_order = 0;
   ewald_off = 0;
   options(arg, 6);
@@ -98,11 +98,11 @@ void PairBuckCoul::settings(int narg, char **arg)
   if (narg == 4) cut_coul = force->numeric(*arg);
   else cut_coul = cut_buck_global;
 
-  if (allocated) {					// reset explicit cuts
+  if (allocated) {                                        // reset explicit cuts
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut_buck[i][j] = cut_buck_global;
+        if (setflag[i][j]) cut_buck[i][j] = cut_buck_global;
   }
 }
 
@@ -228,7 +228,7 @@ void PairBuckCoul::init_style()
 
   if (!atom->q_flag && (ewald_order&(1<<1)))
     error->all(FLERR,
-	"Invoking coulombic in pair style lj/coul requires atom attribute q");
+        "Invoking coulombic in pair style lj/coul requires atom attribute q");
 
   // request regular or rRESPA neighbor lists
 
@@ -277,12 +277,12 @@ void PairBuckCoul::init_style()
 
   // ensure use of KSpace long-range solver, set g_ewald
 
-  if (ewald_order&(1<<1)) {				// r^-1 kspace
-    if (force->kspace == NULL) 
+  if (ewald_order&(1<<1)) {                                // r^-1 kspace
+    if (force->kspace == NULL)
       error->all(FLERR,"Pair style is incompatible with KSpace style");
     g_ewald = force->kspace->g_ewald;
   }
-  if (ewald_order&(1<<6)) {				// r^-6 kspace
+  if (ewald_order&(1<<6)) {                                // r^-6 kspace
     if (!force->kspace && strcmp(force->kspace_style,"ewald/n"))
       error->all(FLERR,"Pair style is incompatible with KSpace style");
     g_ewald = force->kspace->g_ewald;
@@ -331,7 +331,7 @@ double PairBuckCoul::init_one(int i, int j)
 
   if (cut_respa && MIN(cut_buck[i][j],cut_coul) < cut_respa[3])
     error->all(FLERR,"Pair cutoff < Respa interior cutoff");
-     
+
   if (offset_flag) {
     double rexp = exp(-cut_buck[i][j]/buck_rho[i][j]);
     offset[i][j] = buck_a[i][j]*rexp - buck_c[i][j]/pow(cut_buck[i][j],6.0);
@@ -362,10 +362,10 @@ void PairBuckCoul::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&buck_a_read[i][j],sizeof(double),1,fp);
-	fwrite(&buck_rho_read[i][j],sizeof(double),1,fp);
-	fwrite(&buck_c_read[i][j],sizeof(double),1,fp);
-	fwrite(&cut_buck_read[i][j],sizeof(double),1,fp);
+        fwrite(&buck_a_read[i][j],sizeof(double),1,fp);
+        fwrite(&buck_rho_read[i][j],sizeof(double),1,fp);
+        fwrite(&buck_c_read[i][j],sizeof(double),1,fp);
+        fwrite(&cut_buck_read[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -387,16 +387,16 @@ void PairBuckCoul::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&buck_a_read[i][j],sizeof(double),1,fp);
-	  fread(&buck_rho_read[i][j],sizeof(double),1,fp);
-	  fread(&buck_c_read[i][j],sizeof(double),1,fp);
-	  fread(&cut_buck_read[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&buck_a_read[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&buck_rho_read[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&buck_c_read[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_buck_read[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&buck_a_read[i][j],sizeof(double),1,fp);
+          fread(&buck_rho_read[i][j],sizeof(double),1,fp);
+          fread(&buck_c_read[i][j],sizeof(double),1,fp);
+          fread(&cut_buck_read[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&buck_a_read[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&buck_rho_read[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&buck_c_read[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_buck_read[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -458,16 +458,16 @@ void PairBuckCoul::compute(int eflag, int vflag)
   int i, j, order1 = ewald_order&(1<<1), order6 = ewald_order&(1<<6);
   int *ineigh, *ineighn, *jneigh, *jneighn, typei, typej, ni;
   double qi = 0.0, qri = 0.0, *cutsqi, *cut_bucksqi,
-	 *buck1i, *buck2i, *buckai, *buckci, *rhoinvi, *offseti;
+         *buck1i, *buck2i, *buckai, *buckci, *rhoinvi, *offseti;
   double r, rsq, r2inv, force_coul, force_buck;
   double g2 = g_ewald*g_ewald, g6 = g2*g2*g2, g8 = g6*g2;
   vector xi, d;
 
   ineighn = (ineigh = list->ilist)+list->inum;
 
-  for (; ineigh<ineighn; ++ineigh) {			// loop over my atoms
+  for (; ineigh<ineighn; ++ineigh) {                        // loop over my atoms
     i = *ineigh; fi = f0+3*i;
-    if (order1) qri = (qi = q[i])*qqrd2e;		// initialize constants
+    if (order1) qri = (qi = q[i])*qqrd2e;                // initialize constants
     offseti = offset[typei = type[i]];
     buck1i = buck1[typei]; buck2i = buck2[typei];
     buckai = buck_a[typei]; buckci = buck_c[typei], rhoinvi = rhoinv[typei];
@@ -475,105 +475,105 @@ void PairBuckCoul::compute(int eflag, int vflag)
     memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
     jneighn = (jneigh = list->firstneigh[i])+list->numneigh[i];
 
-    for (; jneigh<jneighn; ++jneigh) {			// loop over neighbors
+    for (; jneigh<jneighn; ++jneigh) {                        // loop over neighbors
       j = *jneigh;
       ni = sbmask(j);
       j &= NEIGHMASK;
-      
+
       { register double *xj = x0+(j+(j<<1));
-	d[0] = xi[0] - xj[0];				// pair vector
-	d[1] = xi[1] - xj[1];
-	d[2] = xi[2] - xj[2]; }
+        d[0] = xi[0] - xj[0];                                // pair vector
+        d[1] = xi[1] - xj[1];
+        d[2] = xi[2] - xj[2]; }
 
       if ((rsq = vec_dot(d, d)) >= cutsqi[typej = type[j]]) continue;
       r2inv = 1.0/rsq;
       r = sqrt(rsq);
 
-      if (order1 && (rsq < cut_coulsq)) {		// coulombic
-	if (!ncoultablebits || rsq <= tabinnersq) {	// series real space
-	  register double x = g_ewald*r;
-	  register double s = qri*q[j], t = 1.0/(1.0+EWALD_P*x);
-	  if (ni == 0) {
-	    s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
-	    if (eflag) ecoul = t;
-	  }
-	  else {					// special case
-	    register double f = s*(1.0-special_coul[ni])/r;
-	    s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-f;
-	    if (eflag) ecoul = t-f;
-	  }
-	}						// table real space
-	else {
-	  register union_int_float_t t;
-	  t.f = rsq;
-	  register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
-	  register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
-	  if (ni == 0) {
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]);
-	    if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]);
-	  }
-	  else {					// special case
-	    t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
-	    if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
-	  }
-	}
+      if (order1 && (rsq < cut_coulsq)) {                // coulombic
+        if (!ncoultablebits || rsq <= tabinnersq) {        // series real space
+          register double x = g_ewald*r;
+          register double s = qri*q[j], t = 1.0/(1.0+EWALD_P*x);
+          if (ni == 0) {
+            s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
+            if (eflag) ecoul = t;
+          }
+          else {                                        // special case
+            register double f = s*(1.0-special_coul[ni])/r;
+            s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-f;
+            if (eflag) ecoul = t-f;
+          }
+        }                                                // table real space
+        else {
+          register union_int_float_t t;
+          t.f = rsq;
+          register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
+          register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
+          if (ni == 0) {
+            force_coul = qiqj*(ftable[k]+f*dftable[k]);
+            if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]);
+          }
+          else {                                        // special case
+            t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
+            force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
+            if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
+          }
+        }
       }
       else force_coul = ecoul = 0.0;
 
-      if (rsq < cut_bucksqi[typej]) {			// buckingham
-	register double rn = r2inv*r2inv*r2inv, 
-			expr = exp(-r*rhoinvi[typej]);
-	if (order6) {					// long-range
-	  register double x2 = g2*rsq, a2 = 1.0/x2;
-	  x2 = a2*exp(-x2)*buckci[typej];
-	  if (ni == 0) {
-	    force_buck =
-	      r*expr*buck1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
-	    if (eflag) evdwl = expr*buckai[typej]-g6*((a2+1.0)*a2+0.5)*x2;
-	  }
-	  else {					// special case
-	    register double f = special_lj[ni], t = rn*(1.0-f);
-	    force_buck = f*r*expr*buck1i[typej]-
-	      g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*buck2i[typej];
-	    if (eflag) evdwl = f*expr*buckai[typej] - 
-			 g6*((a2+1.0)*a2+0.5)*x2+t*buckci[typej];
-	  }
-	}
-	else {						// cut
-	  if (ni == 0) {
-	    force_buck = r*expr*buck1i[typej]-rn*buck2i[typej];
-	    if (eflag) evdwl = expr*buckai[typej] - 
-			 rn*buckci[typej]-offseti[typej];
-	  }
-	  else {					// special case
-	    register double f = special_lj[ni];
-	    force_buck = f*(r*expr*buck1i[typej]-rn*buck2i[typej]);
-	    if (eflag) 
-	      evdwl = f*(expr*buckai[typej]-rn*buckci[typej]-offseti[typej]);
-	  }
-	}
+      if (rsq < cut_bucksqi[typej]) {                        // buckingham
+        register double rn = r2inv*r2inv*r2inv,
+                        expr = exp(-r*rhoinvi[typej]);
+        if (order6) {                                        // long-range
+          register double x2 = g2*rsq, a2 = 1.0/x2;
+          x2 = a2*exp(-x2)*buckci[typej];
+          if (ni == 0) {
+            force_buck =
+              r*expr*buck1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
+            if (eflag) evdwl = expr*buckai[typej]-g6*((a2+1.0)*a2+0.5)*x2;
+          }
+          else {                                        // special case
+            register double f = special_lj[ni], t = rn*(1.0-f);
+            force_buck = f*r*expr*buck1i[typej]-
+              g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*buck2i[typej];
+            if (eflag) evdwl = f*expr*buckai[typej] -
+                         g6*((a2+1.0)*a2+0.5)*x2+t*buckci[typej];
+          }
+        }
+        else {                                                // cut
+          if (ni == 0) {
+            force_buck = r*expr*buck1i[typej]-rn*buck2i[typej];
+            if (eflag) evdwl = expr*buckai[typej] -
+                         rn*buckci[typej]-offseti[typej];
+          }
+          else {                                        // special case
+            register double f = special_lj[ni];
+            force_buck = f*(r*expr*buck1i[typej]-rn*buck2i[typej]);
+            if (eflag)
+              evdwl = f*(expr*buckai[typej]-rn*buckci[typej]-offseti[typej]);
+          }
+        }
       }
       else force_buck = evdwl = 0.0;
 
       fpair = (force_coul+force_buck)*r2inv;
 
       if (newton_pair || j < nlocal) {
-	register double *fj = f0+(j+(j<<1)), f;
-	fi[0] += f = d[0]*fpair; fj[0] -= f;
-	fi[1] += f = d[1]*fpair; fj[1] -= f;
-	fi[2] += f = d[2]*fpair; fj[2] -= f;
+        register double *fj = f0+(j+(j<<1)), f;
+        fi[0] += f = d[0]*fpair; fj[0] -= f;
+        fi[1] += f = d[1]*fpair; fj[1] -= f;
+        fi[2] += f = d[2]*fpair; fj[2] -= f;
       }
       else {
-	fi[0] += d[0]*fpair;
-	fi[1] += d[1]*fpair;
-	fi[2] += d[2]*fpair;
+        fi[0] += d[0]*fpair;
+        fi[1] += d[1]*fpair;
+        fi[2] += d[2]*fpair;
       }
 
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,ecoul,fpair,d[0],d[1],d[2]);
+                           evdwl,ecoul,fpair,d[0],d[1],d[2]);
     }
   }
 
@@ -596,7 +596,7 @@ void PairBuckCoul::compute_inner()
 
   double cut_out_on = cut_respa[0];
   double cut_out_off = cut_respa[1];
-  
+
   double cut_out_diff = cut_out_off - cut_out_on;
   double cut_out_on_sq = cut_out_on*cut_out_on;
   double cut_out_off_sq = cut_out_off*cut_out_off;
@@ -608,7 +608,7 @@ void PairBuckCoul::compute_inner()
 
   ineighn = (ineigh = listinner->ilist)+listinner->inum;
 
-  for (; ineigh<ineighn; ++ineigh) {			// loop over my atoms
+  for (; ineigh<ineighn; ++ineigh) {                        // loop over my atoms
     i = *ineigh; fi = f0+3*i;
     qri = qqrd2e*q[i];
     memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
@@ -616,50 +616,50 @@ void PairBuckCoul::compute_inner()
     buck1i = buck1[typei]; buck2i = buck2[typei]; rhoinvi = rhoinv[typei];
     jneighn = (jneigh = listinner->firstneigh[i])+listinner->numneigh[i];
 
-    for (; jneigh<jneighn; ++jneigh) {			// loop over neighbors
+    for (; jneigh<jneighn; ++jneigh) {                        // loop over neighbors
       j = *jneigh;
       ni = sbmask(j);
       j &= NEIGHMASK;
-      
+
       { register double *xj = x0+(j+(j<<1));
-	d[0] = xi[0] - xj[0];				// pair vector
-	d[1] = xi[1] - xj[1];
-	d[2] = xi[2] - xj[2]; }
+        d[0] = xi[0] - xj[0];                                // pair vector
+        d[1] = xi[1] - xj[1];
+        d[2] = xi[2] - xj[2]; }
 
       if ((rsq = vec_dot(d, d)) >= cut_out_off_sq) continue;
       r2inv = 1.0/rsq;
       r = sqrt(rsq);
 
-      if (order1 && (rsq < cut_coulsq))			// coulombic
-	force_coul = ni == 0 ?
-	  qri*q[j]/r : qri*q[j]/r*special_coul[ni];
+      if (order1 && (rsq < cut_coulsq))                        // coulombic
+        force_coul = ni == 0 ?
+          qri*q[j]/r : qri*q[j]/r*special_coul[ni];
 
-      if (rsq < cut_bucksqi[typej = type[j]]) {		// buckingham
-	register double rn = r2inv*r2inv*r2inv,
-			expr = exp(-r*rhoinvi[typej]);
-	force_buck = ni == 0 ?
-	  (r*expr*buck1i[typej]-rn*buck2i[typej]) :
-	  (r*expr*buck1i[typej]-rn*buck2i[typej])*special_lj[ni];
+      if (rsq < cut_bucksqi[typej = type[j]]) {                // buckingham
+        register double rn = r2inv*r2inv*r2inv,
+                        expr = exp(-r*rhoinvi[typej]);
+        force_buck = ni == 0 ?
+          (r*expr*buck1i[typej]-rn*buck2i[typej]) :
+          (r*expr*buck1i[typej]-rn*buck2i[typej])*special_lj[ni];
       }
       else force_buck = 0.0;
 
       fpair = (force_coul + force_buck) * r2inv;
-      
-      if (rsq > cut_out_on_sq) {			// switching
-        register double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	fpair  *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
+
+      if (rsq > cut_out_on_sq) {                        // switching
+        register double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+        fpair  *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
       }
 
-      if (newton_pair || j < nlocal) {			// force update
-	register double *fj = f0+(j+(j<<1)), f;
-	fi[0] += f = d[0]*fpair; fj[0] -= f;
-	fi[1] += f = d[1]*fpair; fj[1] -= f;
-	fi[2] += f = d[2]*fpair; fj[2] -= f;
+      if (newton_pair || j < nlocal) {                        // force update
+        register double *fj = f0+(j+(j<<1)), f;
+        fi[0] += f = d[0]*fpair; fj[0] -= f;
+        fi[1] += f = d[1]*fpair; fj[1] -= f;
+        fi[2] += f = d[2]*fpair; fj[2] -= f;
       }
       else {
-	fi[0] += d[0]*fpair;
-	fi[1] += d[1]*fpair;
-	fi[2] += d[2]*fpair;
+        fi[0] += d[0]*fpair;
+        fi[1] += d[1]*fpair;
+        fi[2] += d[2]*fpair;
       }
     }
   }
@@ -698,7 +698,7 @@ void PairBuckCoul::compute_middle()
 
   ineighn = (ineigh = listmiddle->ilist)+listmiddle->inum;
 
-  for (; ineigh<ineighn; ++ineigh) {			// loop over my atoms
+  for (; ineigh<ineighn; ++ineigh) {                        // loop over my atoms
     i = *ineigh; fi = f0+3*i;
     qri = qqrd2e*q[i];
     memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
@@ -706,55 +706,55 @@ void PairBuckCoul::compute_middle()
     buck1i = buck1[typei]; buck2i = buck2[typei]; rhoinvi = rhoinv[typei];
     jneighn = (jneigh = listmiddle->firstneigh[i])+listmiddle->numneigh[i];
 
-    for (; jneigh<jneighn; ++jneigh) {			// loop over neighbors
+    for (; jneigh<jneighn; ++jneigh) {                        // loop over neighbors
       j = *jneigh;
       ni = sbmask(j);
       j &= NEIGHMASK;
-      
+
       { register double *xj = x0+(j+(j<<1));
-	d[0] = xi[0] - xj[0];				// pair vector
-	d[1] = xi[1] - xj[1];
-	d[2] = xi[2] - xj[2]; }
+        d[0] = xi[0] - xj[0];                                // pair vector
+        d[1] = xi[1] - xj[1];
+        d[2] = xi[2] - xj[2]; }
 
       if ((rsq = vec_dot(d, d)) >= cut_out_off_sq) continue;
       if (rsq <= cut_in_off_sq) continue;
       r2inv = 1.0/rsq;
       r = sqrt(rsq);
 
-      if (order1 && (rsq < cut_coulsq))			// coulombic
-	force_coul = ni == 0 ?
-	  qri*q[j]/r : qri*q[j]/r*special_coul[ni];
+      if (order1 && (rsq < cut_coulsq))                        // coulombic
+        force_coul = ni == 0 ?
+          qri*q[j]/r : qri*q[j]/r*special_coul[ni];
 
-      if (rsq < cut_bucksqi[typej = type[j]]) {		// buckingham
-	register double rn = r2inv*r2inv*r2inv,
-			expr = exp(-r*rhoinvi[typej]);
-	force_buck = ni == 0 ?
-	  (r*expr*buck1i[typej]-rn*buck2i[typej]) :
-	  (r*expr*buck1i[typej]-rn*buck2i[typej])*special_lj[ni];
+      if (rsq < cut_bucksqi[typej = type[j]]) {                // buckingham
+        register double rn = r2inv*r2inv*r2inv,
+                        expr = exp(-r*rhoinvi[typej]);
+        force_buck = ni == 0 ?
+          (r*expr*buck1i[typej]-rn*buck2i[typej]) :
+          (r*expr*buck1i[typej]-rn*buck2i[typej])*special_lj[ni];
       }
       else force_buck = 0.0;
 
       fpair = (force_coul + force_buck) * r2inv;
-      
-      if (rsq < cut_in_on_sq) {				// switching
-        register double rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
-	fpair  *= rsw*rsw*(3.0 - 2.0*rsw);
+
+      if (rsq < cut_in_on_sq) {                                // switching
+        register double rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
+        fpair  *= rsw*rsw*(3.0 - 2.0*rsw);
       }
       if (rsq > cut_out_on_sq) {
-        register double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	fpair  *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
+        register double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+        fpair  *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
       }
 
-      if (newton_pair || j < nlocal) {			// force update
-	register double *fj = f0+(j+(j<<1)), f;
-	fi[0] += f = d[0]*fpair; fj[0] -= f;
-	fi[1] += f = d[1]*fpair; fj[1] -= f;
-	fi[2] += f = d[2]*fpair; fj[2] -= f;
+      if (newton_pair || j < nlocal) {                        // force update
+        register double *fj = f0+(j+(j<<1)), f;
+        fi[0] += f = d[0]*fpair; fj[0] -= f;
+        fi[1] += f = d[1]*fpair; fj[1] -= f;
+        fi[2] += f = d[2]*fpair; fj[2] -= f;
       }
       else {
-	fi[0] += d[0]*fpair;
-	fi[1] += d[1]*fpair;
-	fi[2] += d[2]*fpair;
+        fi[0] += d[0]*fpair;
+        fi[1] += d[1]*fpair;
+        fi[2] += d[2]*fpair;
       }
     }
   }
@@ -782,7 +782,7 @@ void PairBuckCoul::compute_outer(int eflag, int vflag)
   int i, j, order1 = ewald_order&(1<<1), order6 = ewald_order&(1<<6);
   int *ineigh, *ineighn, *jneigh, *jneighn, typei, typej, ni, respa_flag;
   double qi = 0.0, qri = 0.0, *cutsqi, *cut_bucksqi,
-	 *buck1i, *buck2i, *buckai, *buckci, *rhoinvi, *offseti;
+         *buck1i, *buck2i, *buckai, *buckci, *rhoinvi, *offseti;
   double r, rsq, r2inv, force_coul, force_buck;
   double g2 = g_ewald*g_ewald, g6 = g2*g2*g2, g8 = g6*g2;
   double respa_buck = 0.0, respa_coul = 0.0, frespa = 0.0;
@@ -797,9 +797,9 @@ void PairBuckCoul::compute_outer(int eflag, int vflag)
 
   ineighn = (ineigh = listouter->ilist)+listouter->inum;
 
-  for (; ineigh<ineighn; ++ineigh) {			// loop over my atoms
+  for (; ineigh<ineighn; ++ineigh) {                        // loop over my atoms
     i = *ineigh; fi = f0+3*i;
-    if (order1) qri = (qi = q[i])*qqrd2e;		// initialize constants
+    if (order1) qri = (qi = q[i])*qqrd2e;                // initialize constants
     offseti = offset[typei = type[i]];
     buck1i = buck1[typei]; buck2i = buck2[typei];
     buckai = buck_a[typei]; buckci = buck_c[typei]; rhoinvi = rhoinv[typei];
@@ -807,98 +807,98 @@ void PairBuckCoul::compute_outer(int eflag, int vflag)
     memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
     jneighn = (jneigh = listouter->firstneigh[i])+listouter->numneigh[i];
 
-    for (; jneigh<jneighn; ++jneigh) {			// loop over neighbors
+    for (; jneigh<jneighn; ++jneigh) {                        // loop over neighbors
       j = *jneigh;
       ni = sbmask(j);
       j &= NEIGHMASK;
-      
+
       { register double *xj = x0+(j+(j<<1));
-	d[0] = xi[0] - xj[0];				// pair vector
-	d[1] = xi[1] - xj[1];
-	d[2] = xi[2] - xj[2]; }
+        d[0] = xi[0] - xj[0];                                // pair vector
+        d[1] = xi[1] - xj[1];
+        d[2] = xi[2] - xj[2]; }
 
       if ((rsq = vec_dot(d, d)) >= cutsqi[typej = type[j]]) continue;
       r2inv = 1.0/rsq;
       r = sqrt(rsq);
 
       if ((respa_flag = (rsq>cut_in_off_sq)&&(rsq<cut_in_on_sq))) {
-	register double rsw = (r-cut_in_off)/cut_in_diff;
-	frespa = rsw*rsw*(3.0-2.0*rsw);
+        register double rsw = (r-cut_in_off)/cut_in_diff;
+        frespa = rsw*rsw*(3.0-2.0*rsw);
       }
 
-      if (order1 && (rsq < cut_coulsq)) {		// coulombic
-	if (!ncoultablebits || rsq <= tabinnersq) {	// series real space
-	  register double s = qri*q[j];
-	  if (respa_flag)				// correct for respa
-	    respa_coul = ni == 0 ? frespa*s/r : frespa*s/r*special_coul[ni];
-	  register double x = g_ewald*r, t = 1.0/(1.0+EWALD_P*x);
-	  if (ni == 0) {
-	    s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
-	    if (eflag) ecoul = t;
-	  }
-	  else {					// correct for special
-	    r = s*(1.0-special_coul[ni])/r; s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-r;
-	    if (eflag) ecoul = t-r;
-	  }
-	}						// table real space
-	else {
-	  if (respa_flag) respa_coul = ni == 0 ?	// correct for respa
-	      frespa*qri*q[j]/r :
-	      frespa*qri*q[j]/r*special_coul[ni];
-	  register union_int_float_t t;
-	  t.f = rsq;
-	  register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
-	  register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
-	  if (ni == 0) {
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]);
-	    if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]);
-	  }
-	  else {					// correct for special
-	    t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
-	    if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
-	  }
-	}
+      if (order1 && (rsq < cut_coulsq)) {                // coulombic
+        if (!ncoultablebits || rsq <= tabinnersq) {        // series real space
+          register double s = qri*q[j];
+          if (respa_flag)                                // correct for respa
+            respa_coul = ni == 0 ? frespa*s/r : frespa*s/r*special_coul[ni];
+          register double x = g_ewald*r, t = 1.0/(1.0+EWALD_P*x);
+          if (ni == 0) {
+            s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
+            if (eflag) ecoul = t;
+          }
+          else {                                        // correct for special
+            r = s*(1.0-special_coul[ni])/r; s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-r;
+            if (eflag) ecoul = t-r;
+          }
+        }                                                // table real space
+        else {
+          if (respa_flag) respa_coul = ni == 0 ?        // correct for respa
+              frespa*qri*q[j]/r :
+              frespa*qri*q[j]/r*special_coul[ni];
+          register union_int_float_t t;
+          t.f = rsq;
+          register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
+          register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
+          if (ni == 0) {
+            force_coul = qiqj*(ftable[k]+f*dftable[k]);
+            if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]);
+          }
+          else {                                        // correct for special
+            t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
+            force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
+            if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
+          }
+        }
       }
       else force_coul = respa_coul = ecoul = 0.0;
 
-      if (rsq < cut_bucksqi[typej]) {			// buckingham
-	register double rn = r2inv*r2inv*r2inv,
-			expr = exp(-r*rhoinvi[typej]);
-	if (respa_flag) respa_buck = ni == 0 ? 		// correct for respa
-	    frespa*(r*expr*buck1i[typej]-rn*buck2i[typej]) :
-	    frespa*(r*expr*buck1i[typej]-rn*buck2i[typej])*special_lj[ni];
-	if (order6) {					// long-range form
-	  register double x2 = g2*rsq, a2 = 1.0/x2;
-	  x2 = a2*exp(-x2)*buckci[typej];
-	  if (ni == 0) {
-	    force_buck =
-	      r*expr*buck1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
-	    if (eflag) evdwl = expr*buckai[typej]-g6*((a2+1.0)*a2+0.5)*x2;
-	  }
-	  else {					// correct for special
-	    register double f = special_lj[ni], t = rn*(1.0-f);
-	    force_buck = f*r*expr*buck1i[typej]-
-	      g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*buck2i[typej];
-	    if (eflag) evdwl = f*expr*buckai[typej] - 
-			 g6*((a2+1.0)*a2+0.5)*x2+t*buckci[typej];
-	  }
-	}
-	else {						// cut form
-	  if (ni == 0) {
-	    force_buck = r*expr*buck1i[typej]-rn*buck2i[typej];
-	    if (eflag) 
-	      evdwl = expr*buckai[typej]-rn*buckci[typej]-offseti[typej];
-	  }
-	  else {					// correct for special
-	    register double f = special_lj[ni];
-	    force_buck = f*(r*expr*buck1i[typej]-rn*buck2i[typej]);
-	    if (eflag)
-	      evdwl = f*(expr*buckai[typej]-rn*buckci[typej]-offseti[typej]);
-	  }
-	}
+      if (rsq < cut_bucksqi[typej]) {                        // buckingham
+        register double rn = r2inv*r2inv*r2inv,
+                        expr = exp(-r*rhoinvi[typej]);
+        if (respa_flag) respa_buck = ni == 0 ?                 // correct for respa
+            frespa*(r*expr*buck1i[typej]-rn*buck2i[typej]) :
+            frespa*(r*expr*buck1i[typej]-rn*buck2i[typej])*special_lj[ni];
+        if (order6) {                                        // long-range form
+          register double x2 = g2*rsq, a2 = 1.0/x2;
+          x2 = a2*exp(-x2)*buckci[typej];
+          if (ni == 0) {
+            force_buck =
+              r*expr*buck1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
+            if (eflag) evdwl = expr*buckai[typej]-g6*((a2+1.0)*a2+0.5)*x2;
+          }
+          else {                                        // correct for special
+            register double f = special_lj[ni], t = rn*(1.0-f);
+            force_buck = f*r*expr*buck1i[typej]-
+              g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*buck2i[typej];
+            if (eflag) evdwl = f*expr*buckai[typej] -
+                         g6*((a2+1.0)*a2+0.5)*x2+t*buckci[typej];
+          }
+        }
+        else {                                                // cut form
+          if (ni == 0) {
+            force_buck = r*expr*buck1i[typej]-rn*buck2i[typej];
+            if (eflag)
+              evdwl = expr*buckai[typej]-rn*buckci[typej]-offseti[typej];
+          }
+          else {                                        // correct for special
+            register double f = special_lj[ni];
+            force_buck = f*(r*expr*buck1i[typej]-rn*buck2i[typej]);
+            if (eflag)
+              evdwl = f*(expr*buckai[typej]-rn*buckci[typej]-offseti[typej]);
+          }
+        }
       }
       else force_buck = respa_buck = evdwl = 0.0;
 
@@ -906,19 +906,19 @@ void PairBuckCoul::compute_outer(int eflag, int vflag)
       frespa = fpair-(respa_coul+respa_buck)*r2inv;
 
       if (newton_pair || j < nlocal) {
-	register double *fj = f0+(j+(j<<1)), f;
-	fi[0] += f = d[0]*frespa; fj[0] -= f;
-	fi[1] += f = d[1]*frespa; fj[1] -= f;
-	fi[2] += f = d[2]*frespa; fj[2] -= f;
+        register double *fj = f0+(j+(j<<1)), f;
+        fi[0] += f = d[0]*frespa; fj[0] -= f;
+        fi[1] += f = d[1]*frespa; fj[1] -= f;
+        fi[2] += f = d[2]*frespa; fj[2] -= f;
       }
       else {
-	fi[0] += d[0]*frespa;
-	fi[1] += d[1]*frespa;
-	fi[2] += d[2]*frespa;
+        fi[0] += d[0]*frespa;
+        fi[1] += d[1]*frespa;
+        fi[2] += d[2]*frespa;
       }
 
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,ecoul,fpair,d[0],d[1],d[2]);
+                           evdwl,ecoul,fpair,d[0],d[1],d[2]);
     }
   }
 }
@@ -935,17 +935,17 @@ void PairBuckCoul::init_tables()
 
   tabinnersq = tabinner*tabinner;
   init_bitmap(tabinner,cut_coul,ncoultablebits,
-	      masklo,maskhi,ncoulmask,ncoulshiftbits);
-  
+              masklo,maskhi,ncoulmask,ncoulshiftbits);
+
   int ntable = 1;
   for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
-  
+
   // linear lookup tables of length N = 2^ncoultablebits
   // stored value = value at lower edge of bin
   // d values = delta from lower edge to upper edge of bin
 
   if (ftable) free_tables();
-  
+
   memory->create(rtable,ntable,"pair:rtable");
   memory->create(ftable,ntable,"pair:ftable");
   memory->create(ctable,ntable,"pair:ctable");
@@ -969,7 +969,7 @@ void PairBuckCoul::init_tables()
   int itablemin;
   minrsq_lookup.i = 0 << ncoulshiftbits;
   minrsq_lookup.i |= maskhi;
-    
+
   for (int i = 0; i < ntable; i++) {
     rsq_lookup.i = i << ncoulshiftbits;
     rsq_lookup.i |= masklo;
@@ -994,23 +994,23 @@ void PairBuckCoul::init_tables()
       ptable[i] = qqrd2e/r;
       vtable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
-	if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-	  rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
-	  ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
-	  ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
-	} else {
-	  ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
-	  ctable[i] = qqrd2e/r;
-	}
+        if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
+          ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
+          ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
+        } else {
+          ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
+          ctable[i] = qqrd2e/r;
+        }
       }
     }
     minrsq_lookup.f = MIN(minrsq_lookup.f,rsq_lookup.f);
   }
 
   tabinnersq = minrsq_lookup.f;
-  
+
   int ntablem1 = ntable - 1;
-  
+
   for (int i = 0; i < ntablem1; i++) {
     drtable[i] = 1.0/(rtable[i+1] - rtable[i]);
     dftable[i] = ftable[i+1] - ftable[i];
@@ -1024,10 +1024,10 @@ void PairBuckCoul::init_tables()
       dptable[i] = ptable[i+1] - ptable[i];
     }
   }
-  
-  // get the delta values for the last table entries 
+
+  // get the delta values for the last table entries
   // tables are connected periodically between 0 and ntablem1
-    
+
   drtable[ntablem1] = 1.0/(rtable[0] - rtable[ntablem1]);
   dftable[ntablem1] = ftable[0] - ftable[ntablem1];
   dctable[ntablem1] = ctable[0] - ctable[ntablem1];
@@ -1037,23 +1037,23 @@ void PairBuckCoul::init_tables()
     dptable[ntablem1] = ptable[0] - ptable[ntablem1];
   }
 
-  // get the correct delta values at itablemax    
+  // get the correct delta values at itablemax
   // smallest r is in bin itablemin
   // largest r is in bin itablemax, which is itablemin-1,
   //   or ntablem1 if itablemin=0
   // deltas at itablemax only needed if corresponding rsq < cut*cut
-  // if so, compute deltas between rsq and cut*cut 
-	
+  // if so, compute deltas between rsq and cut*cut
+
   double f_tmp,c_tmp,e_tmp,p_tmp = 0.0,v_tmp = 0.0;
   itablemin = minrsq_lookup.i & ncoulmask;
-  itablemin >>= ncoulshiftbits;  
-  int itablemax = itablemin - 1; 
-  if (itablemin == 0) itablemax = ntablem1;     
+  itablemin >>= ncoulshiftbits;
+  int itablemax = itablemin - 1;
+  if (itablemin == 0) itablemax = ntablem1;
   rsq_lookup.i = itablemax << ncoulshiftbits;
   rsq_lookup.i |= maskhi;
 
   if (rsq_lookup.f < cut_coulsq) {
-    rsq_lookup.f = cut_coulsq;  
+    rsq_lookup.f = cut_coulsq;
     r = sqrtf(rsq_lookup.f);
     grij = g_ewald * r;
     expm2 = exp(-grij*grij);
@@ -1071,7 +1071,7 @@ void PairBuckCoul::init_tables()
       v_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
         if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
           f_tmp += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
           c_tmp = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
         } else {
@@ -1081,14 +1081,14 @@ void PairBuckCoul::init_tables()
       }
     }
 
-    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);   
+    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);
     dftable[itablemax] = f_tmp - ftable[itablemax];
     dctable[itablemax] = c_tmp - ctable[itablemax];
     detable[itablemax] = e_tmp - etable[itablemax];
     if (cut_respa) {
       dvtable[itablemax] = v_tmp - vtable[itablemax];
       dptable[itablemax] = p_tmp - ptable[itablemax];
-    }   
+    }
   }
 }
 
@@ -1115,8 +1115,8 @@ void PairBuckCoul::free_tables()
 /* ---------------------------------------------------------------------- */
 
 double PairBuckCoul::single(int i, int j, int itype, int jtype,
-			    double rsq, double factor_coul, double factor_buck,
-			    double &fforce)
+                            double rsq, double factor_coul, double factor_buck,
+                            double &fforce)
 {
   double f, r, r2inv, r6inv, force_coul, force_buck;
   double g2 = g_ewald*g_ewald, g6 = g2*g2*g2, g8 = g6*g2, *q = atom->q;
@@ -1125,15 +1125,15 @@ double PairBuckCoul::single(int i, int j, int itype, int jtype,
   r2inv = 1.0/rsq;
   double eng = 0.0;
 
-  if ((ewald_order&2) && (rsq < cut_coulsq)) {		// coulombic
-    if (!ncoultablebits || rsq <= tabinnersq) {		// series real space
+  if ((ewald_order&2) && (rsq < cut_coulsq)) {                // coulombic
+    if (!ncoultablebits || rsq <= tabinnersq) {                // series real space
       register double x = g_ewald*r;
       register double s = force->qqrd2e*q[i]*q[j], t = 1.0/(1.0+EWALD_P*x);
       f = s*(1.0-factor_coul)/r; s *= g_ewald*exp(-x*x);
       force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-f;
       eng += t-f;
     }
-    else {						// table real space
+    else {                                                // table real space
       register union_int_float_t t;
       t.f = rsq;
       register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
@@ -1143,23 +1143,23 @@ double PairBuckCoul::single(int i, int j, int itype, int jtype,
       eng += qiqj*(etable[k]+f*detable[k]-t.f);
     }
   } else force_coul = 0.0;
-  
-  if (rsq < cut_bucksq[itype][jtype]) {			// buckingham
+
+  if (rsq < cut_bucksq[itype][jtype]) {                        // buckingham
     register double expr = factor_buck*exp(-sqrt(rsq)*rhoinv[itype][jtype]);
     r6inv = r2inv*r2inv*r2inv;
-    if (ewald_order&64) {				// long-range
+    if (ewald_order&64) {                                // long-range
       register double x2 = g2*rsq, a2 = 1.0/x2, t = r6inv*(1.0-factor_buck);
       x2 = a2*exp(-x2)*buck_c[itype][jtype];
       force_buck = buck1[itype][jtype]*r*expr-
-       	g8*(((6.0*a2+6.0)*a2+3.0)*a2+a2)*x2*rsq+t*buck2[itype][jtype];
+               g8*(((6.0*a2+6.0)*a2+3.0)*a2+a2)*x2*rsq+t*buck2[itype][jtype];
       eng += buck_a[itype][jtype]*expr-
-	g6*((a2+1.0)*a2+0.5)*x2+t*buck_c[itype][jtype];
+        g6*((a2+1.0)*a2+0.5)*x2+t*buck_c[itype][jtype];
     }
-    else {						// cut
-      force_buck = 
-	buck1[itype][jtype]*r*expr-factor_buck*buck_c[itype][jtype]*r6inv;
+    else {                                                // cut
+      force_buck =
+        buck1[itype][jtype]*r*expr-factor_buck*buck_c[itype][jtype]*r6inv;
       eng += buck_a[itype][jtype]*expr-
-	factor_buck*(buck_c[itype][jtype]*r6inv-offset[itype][jtype]);
+        factor_buck*(buck_c[itype][jtype]*r6inv-offset[itype][jtype]);
     }
   } else force_buck = 0.0;
 
diff --git a/src/USER-EWALDN/pair_buck_coul.h b/src/USER-EWALDN/pair_buck_coul.h
index 5b9d406cbc..6c29b13419 100644
--- a/src/USER-EWALDN/pair_buck_coul.h
+++ b/src/USER-EWALDN/pair_buck_coul.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -39,7 +39,7 @@ class PairBuckCoul : public Pair {
   double init_one(int, int);
   void write_restart(FILE *);
   void read_restart(FILE *);
-  
+
   void write_restart_settings(FILE *);
   void read_restart_settings(FILE *);
   double single(int, int, int, int, double, double, double, double &);
diff --git a/src/USER-EWALDN/pair_lj_coul.cpp b/src/USER-EWALDN/pair_lj_coul.cpp
index 1811278704..c38ad6b6f4 100644
--- a/src/USER-EWALDN/pair_lj_coul.cpp
+++ b/src/USER-EWALDN/pair_lj_coul.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -56,12 +56,12 @@ PairLJCoul::PairLJCoul(LAMMPS *lmp) : Pair(lmp)
    global settings
 ------------------------------------------------------------------------- */
 
-#define PAIR_ILLEGAL	"Illegal pair_style lj/coul command"
-#define PAIR_CUTOFF	"Only one cut-off allowed when requesting all long"
-#define PAIR_MISSING	"Cut-offs missing in pair_style lj/coul"
-#define PAIR_COUL_CUT	"Coulombic cut not supported in pair_style lj/coul"
-#define PAIR_LARGEST	"Using largest cut-off for lj/coul long long"
-#define PAIR_MIX	"Mixing forced for lj coefficients"
+#define PAIR_ILLEGAL        "Illegal pair_style lj/coul command"
+#define PAIR_CUTOFF        "Only one cut-off allowed when requesting all long"
+#define PAIR_MISSING        "Cut-offs missing in pair_style lj/coul"
+#define PAIR_COUL_CUT        "Coulombic cut not supported in pair_style lj/coul"
+#define PAIR_LARGEST        "Using largest cut-off for lj/coul long long"
+#define PAIR_MIX        "Mixing forced for lj coefficients"
 
 void PairLJCoul::options(char **arg, int order)
 {
@@ -72,8 +72,8 @@ void PairLJCoul::options(char **arg, int order)
   for (i=0; option[i]&&strcmp(arg[0], option[i]); ++i);
   switch (i) {
     default: error->all(FLERR,PAIR_ILLEGAL);
-    case 0: ewald_order |= 1<<order; break;		// set kspace r^-order
-    case 2: ewald_off |= 1<<order;			// turn r^-order off
+    case 0: ewald_order |= 1<<order; break;                // set kspace r^-order
+    case 2: ewald_off |= 1<<order;                        // turn r^-order off
     case 1: break;
   }
 }
@@ -96,11 +96,11 @@ void PairLJCoul::settings(int narg, char **arg)
   if (narg == 4) cut_coul = force->numeric(*arg);
   else cut_coul = cut_lj_global;
 
-  if (allocated) {					// reset explicit cuts
+  if (allocated) {                                        // reset explicit cuts
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
+        if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
   }
 }
 
@@ -226,7 +226,7 @@ void PairLJCoul::init_style()
 
   if (!atom->q_flag && (ewald_order&(1<<1)))
     error->all(FLERR,
-	"Invoking coulombic in pair style lj/coul requires atom attribute q");
+        "Invoking coulombic in pair style lj/coul requires atom attribute q");
 
   // request regular or rRESPA neighbor lists
 
@@ -275,14 +275,14 @@ void PairLJCoul::init_style()
 
   // ensure use of KSpace long-range solver, set g_ewald
 
-  if (ewald_order&(1<<1)) {				// r^-1 kspace
-    if (force->kspace == NULL) 
+  if (ewald_order&(1<<1)) {                                // r^-1 kspace
+    if (force->kspace == NULL)
       error->all(FLERR,"Pair style is incompatible with KSpace style");
     for (i=0; style1[i]&&strcmp(force->kspace_style, style1[i]); ++i);
     if (!style1[i]) error->all(FLERR,"Pair style is incompatible with KSpace style");
   }
-  if (ewald_order&(1<<6)) {				// r^-6 kspace
-    if (force->kspace == NULL) 
+  if (ewald_order&(1<<6)) {                                // r^-6 kspace
+    if (force->kspace == NULL)
       error->all(FLERR,"Pair style is incompatible with KSpace style");
     for (i=0; style6[i]&&strcmp(force->kspace_style, style6[i]); ++i);
     if (!style6[i]) error->all(FLERR,"Pair style is incompatible with KSpace style");
@@ -315,7 +315,7 @@ double PairLJCoul::init_one(int i, int j)
 {
   if ((ewald_order&(1<<6))||(setflag[i][j] == 0)) {
     epsilon[i][j] = mix_energy(epsilon_read[i][i],epsilon_read[j][j],
-			       sigma_read[i][i],sigma_read[j][j]);
+                               sigma_read[i][i],sigma_read[j][j]);
     sigma[i][j] = mix_distance(sigma_read[i][i],sigma_read[j][j]);
     if (ewald_order&(1<<6))
       cut_lj[i][j] = cut_lj_global;
@@ -341,7 +341,7 @@ double PairLJCoul::init_one(int i, int j)
 
   if (cut_respa && MIN(cut_lj[i][j],cut_coul) < cut_respa[3])
     error->all(FLERR,"Pair cutoff < Respa interior cutoff");
- 
+
   if (offset_flag) {
     double ratio = sigma[i][j] / cut_lj[i][j];
     offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
@@ -371,9 +371,9 @@ void PairLJCoul::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon_read[i][j],sizeof(double),1,fp);
-	fwrite(&sigma_read[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj_read[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon_read[i][j],sizeof(double),1,fp);
+        fwrite(&sigma_read[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj_read[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -395,14 +395,14 @@ void PairLJCoul::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon_read[i][j],sizeof(double),1,fp);
-	  fread(&sigma_read[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj_read[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon_read[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma_read[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj_read[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon_read[i][j],sizeof(double),1,fp);
+          fread(&sigma_read[i][j],sizeof(double),1,fp);
+          fread(&cut_lj_read[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon_read[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma_read[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj_read[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -450,7 +450,7 @@ void PairLJCoul::compute(int eflag, int vflag)
   evdwl = ecoul = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   double **x = atom->x, *x0 = x[0];
   double **f = atom->f, *f0 = f[0], *fi = f0;
   double *q = atom->q;
@@ -471,112 +471,112 @@ void PairLJCoul::compute(int eflag, int vflag)
 
   ineighn = (ineigh = list->ilist)+list->inum;
 
-  for (; ineigh<ineighn; ++ineigh) {			// loop over my atoms
+  for (; ineigh<ineighn; ++ineigh) {                        // loop over my atoms
     i = *ineigh; fi = f0+3*i;
-    if (order1) qri = (qi = q[i])*qqrd2e;		// initialize constants
+    if (order1) qri = (qi = q[i])*qqrd2e;                // initialize constants
     offseti = offset[typei = type[i]];
     lj1i = lj1[typei]; lj2i = lj2[typei]; lj3i = lj3[typei]; lj4i = lj4[typei];
     cutsqi = cutsq[typei]; cut_ljsqi = cut_ljsq[typei];
     memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
     jneighn = (jneigh = list->firstneigh[i])+list->numneigh[i];
 
-    for (; jneigh<jneighn; ++jneigh) {			// loop over neighbors
+    for (; jneigh<jneighn; ++jneigh) {                        // loop over neighbors
       j = *jneigh;
       ni = sbmask(j);
       j &= NEIGHMASK;
-      
+
       { register double *xj = x0+(j+(j<<1));
-	d[0] = xi[0] - xj[0];				// pair vector
-	d[1] = xi[1] - xj[1];
-	d[2] = xi[2] - xj[2]; }
+        d[0] = xi[0] - xj[0];                                // pair vector
+        d[1] = xi[1] - xj[1];
+        d[2] = xi[2] - xj[2]; }
 
       if ((rsq = vec_dot(d, d)) >= cutsqi[typej = type[j]]) continue;
       r2inv = 1.0/rsq;
 
-      if (order1 && (rsq < cut_coulsq)) {		// coulombic
-	if (!ncoultablebits || rsq <= tabinnersq) {	// series real space
-	  register double r = sqrt(rsq), x = g_ewald*r;
-	  register double s = qri*q[j], t = 1.0/(1.0+EWALD_P*x);
-	  if (ni == 0) {
-	    s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
-	    if (eflag) ecoul = t;
-	  }
-	  else {					// special case
-	    r = s*(1.0-special_coul[ni])/r; s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-r;
-	    if (eflag) ecoul = t-r;
-	  }
-	}						// table real space
-	else {
-	  register union_int_float_t t;
-	  t.f = rsq;
-	  register const int k = (t.i & ncoulmask)>>ncoulshiftbits;
-	  register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
-	  if (ni == 0) {
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]);
-	    if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]);
-	  }
-	  else {					// special case
-	    t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
-	    if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
-	  }
-	}
+      if (order1 && (rsq < cut_coulsq)) {                // coulombic
+        if (!ncoultablebits || rsq <= tabinnersq) {        // series real space
+          register double r = sqrt(rsq), x = g_ewald*r;
+          register double s = qri*q[j], t = 1.0/(1.0+EWALD_P*x);
+          if (ni == 0) {
+            s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
+            if (eflag) ecoul = t;
+          }
+          else {                                        // special case
+            r = s*(1.0-special_coul[ni])/r; s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-r;
+            if (eflag) ecoul = t-r;
+          }
+        }                                                // table real space
+        else {
+          register union_int_float_t t;
+          t.f = rsq;
+          register const int k = (t.i & ncoulmask)>>ncoulshiftbits;
+          register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
+          if (ni == 0) {
+            force_coul = qiqj*(ftable[k]+f*dftable[k]);
+            if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]);
+          }
+          else {                                        // special case
+            t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
+            force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
+            if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
+          }
+        }
       }
       else force_coul = ecoul = 0.0;
 
-      if (rsq < cut_ljsqi[typej]) {			// lj
-       	if (order6) {					// long-range lj
-	  register double rn = r2inv*r2inv*r2inv;
-	  register double x2 = g2*rsq, a2 = 1.0/x2;
-	  x2 = a2*exp(-x2)*lj4i[typej];
-	  if (ni == 0) {
-	    force_lj =
-	      (rn*=rn)*lj1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
-	    if (eflag)
-	      evdwl = rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2;
-	  }
-	  else {					// special case
-	    register double f = special_lj[ni], t = rn*(1.0-f);
-	    force_lj = f*(rn *= rn)*lj1i[typej]-
-	      g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*lj2i[typej];
-	    if (eflag) 
-	      evdwl = f*rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2+t*lj4i[typej];
-	  }
-	}
-	else {						// cut lj
-	  register double rn = r2inv*r2inv*r2inv;
-	  if (ni == 0) {
-	    force_lj = rn*(rn*lj1i[typej]-lj2i[typej]);
-	    if (eflag) evdwl = rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej];
-	  }
-	  else {					// special case
-	    register double f = special_lj[ni];
-	    force_lj = f*rn*(rn*lj1i[typej]-lj2i[typej]);
-	    if (eflag)
-	      evdwl = f * (rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej]);
-	  }
-	}
+      if (rsq < cut_ljsqi[typej]) {                        // lj
+               if (order6) {                                        // long-range lj
+          register double rn = r2inv*r2inv*r2inv;
+          register double x2 = g2*rsq, a2 = 1.0/x2;
+          x2 = a2*exp(-x2)*lj4i[typej];
+          if (ni == 0) {
+            force_lj =
+              (rn*=rn)*lj1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
+            if (eflag)
+              evdwl = rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2;
+          }
+          else {                                        // special case
+            register double f = special_lj[ni], t = rn*(1.0-f);
+            force_lj = f*(rn *= rn)*lj1i[typej]-
+              g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*lj2i[typej];
+            if (eflag)
+              evdwl = f*rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2+t*lj4i[typej];
+          }
+        }
+        else {                                                // cut lj
+          register double rn = r2inv*r2inv*r2inv;
+          if (ni == 0) {
+            force_lj = rn*(rn*lj1i[typej]-lj2i[typej]);
+            if (eflag) evdwl = rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej];
+          }
+          else {                                        // special case
+            register double f = special_lj[ni];
+            force_lj = f*rn*(rn*lj1i[typej]-lj2i[typej]);
+            if (eflag)
+              evdwl = f * (rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej]);
+          }
+        }
       }
       else force_lj = evdwl = 0.0;
 
       fpair = (force_coul+force_lj)*r2inv;
 
       if (newton_pair || j < nlocal) {
-	register double *fj = f0+(j+(j<<1)), f;
-	fi[0] += f = d[0]*fpair; fj[0] -= f;
-	fi[1] += f = d[1]*fpair; fj[1] -= f;
-	fi[2] += f = d[2]*fpair; fj[2] -= f;
+        register double *fj = f0+(j+(j<<1)), f;
+        fi[0] += f = d[0]*fpair; fj[0] -= f;
+        fi[1] += f = d[1]*fpair; fj[1] -= f;
+        fi[2] += f = d[2]*fpair; fj[2] -= f;
       }
       else {
-	fi[0] += d[0]*fpair;
-	fi[1] += d[1]*fpair;
-	fi[2] += d[2]*fpair;
+        fi[0] += d[0]*fpair;
+        fi[1] += d[1]*fpair;
+        fi[2] += d[2]*fpair;
       }
-      
+
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,ecoul,fpair,d[0],d[1],d[2]);
+                           evdwl,ecoul,fpair,d[0],d[1],d[2]);
     }
   }
 
@@ -599,7 +599,7 @@ void PairLJCoul::compute_inner()
 
   double cut_out_on = cut_respa[0];
   double cut_out_off = cut_respa[1];
-  
+
   double cut_out_diff = cut_out_off - cut_out_on;
   double cut_out_on_sq = cut_out_on*cut_out_on;
   double cut_out_off_sq = cut_out_off*cut_out_off;
@@ -611,7 +611,7 @@ void PairLJCoul::compute_inner()
 
   ineighn = (ineigh = list->ilist)+list->inum;
 
-  for (; ineigh<ineighn; ++ineigh) {			// loop over my atoms
+  for (; ineigh<ineighn; ++ineigh) {                        // loop over my atoms
     i = *ineigh; fi = f0+3*i;
     qri = qqrd2e*q[i];
     memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
@@ -619,48 +619,48 @@ void PairLJCoul::compute_inner()
     lj1i = lj1[typei]; lj2i = lj2[typei];
     jneighn = (jneigh = list->firstneigh[i])+list->numneigh[i];
 
-    for (; jneigh<jneighn; ++jneigh) {			// loop over neighbors
+    for (; jneigh<jneighn; ++jneigh) {                        // loop over neighbors
       j = *jneigh;
       ni = sbmask(j);
       j &= NEIGHMASK;
-      
+
       { register double *xj = x0+(j+(j<<1));
-	d[0] = xi[0] - xj[0];				// pair vector
-	d[1] = xi[1] - xj[1];
-	d[2] = xi[2] - xj[2]; }
+        d[0] = xi[0] - xj[0];                                // pair vector
+        d[1] = xi[1] - xj[1];
+        d[2] = xi[2] - xj[2]; }
 
       if ((rsq = vec_dot(d, d)) >= cut_out_off_sq) continue;
       r2inv = 1.0/rsq;
 
-      if (order1 && (rsq < cut_coulsq))			// coulombic
-	force_coul = ni == 0 ?
-	  qri*q[j]*sqrt(r2inv) : qri*q[j]*sqrt(r2inv)*special_coul[ni];
+      if (order1 && (rsq < cut_coulsq))                        // coulombic
+        force_coul = ni == 0 ?
+          qri*q[j]*sqrt(r2inv) : qri*q[j]*sqrt(r2inv)*special_coul[ni];
 
-      if (rsq < cut_ljsqi[typej = type[j]]) {		// lennard-jones
-	register double rn = r2inv*r2inv*r2inv;
-	force_lj = ni == 0 ?
-	  rn*(rn*lj1i[typej]-lj2i[typej]) :
-	  rn*(rn*lj1i[typej]-lj2i[typej])*special_lj[ni];
+      if (rsq < cut_ljsqi[typej = type[j]]) {                // lennard-jones
+        register double rn = r2inv*r2inv*r2inv;
+        force_lj = ni == 0 ?
+          rn*(rn*lj1i[typej]-lj2i[typej]) :
+          rn*(rn*lj1i[typej]-lj2i[typej])*special_lj[ni];
       }
       else force_lj = 0.0;
 
       fpair = (force_coul + force_lj) * r2inv;
-      
-      if (rsq > cut_out_on_sq) {			// switching
-        register double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	fpair  *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
+
+      if (rsq > cut_out_on_sq) {                        // switching
+        register double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+        fpair  *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
       }
 
-      if (newton_pair || j < nlocal) {			// force update
-	register double *fj = f0+(j+(j<<1)), f;
-	fi[0] += f = d[0]*fpair; fj[0] -= f;
-	fi[1] += f = d[1]*fpair; fj[1] -= f;
-	fi[2] += f = d[2]*fpair; fj[2] -= f;
+      if (newton_pair || j < nlocal) {                        // force update
+        register double *fj = f0+(j+(j<<1)), f;
+        fi[0] += f = d[0]*fpair; fj[0] -= f;
+        fi[1] += f = d[1]*fpair; fj[1] -= f;
+        fi[2] += f = d[2]*fpair; fj[2] -= f;
       }
       else {
-	fi[0] += d[0]*fpair;
-	fi[1] += d[1]*fpair;
-	fi[2] += d[2]*fpair;
+        fi[0] += d[0]*fpair;
+        fi[1] += d[1]*fpair;
+        fi[2] += d[2]*fpair;
       }
     }
   }
@@ -699,7 +699,7 @@ void PairLJCoul::compute_middle()
 
   ineighn = (ineigh = list->ilist)+list->inum;
 
-  for (; ineigh<ineighn; ++ineigh) {			// loop over my atoms
+  for (; ineigh<ineighn; ++ineigh) {                        // loop over my atoms
     i = *ineigh; fi = f0+3*i;
     qri = qqrd2e*q[i];
     memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
@@ -711,49 +711,49 @@ void PairLJCoul::compute_middle()
       j = *jneigh;
       ni = sbmask(j);
       j &= NEIGHMASK;
-      
+
       { register double *xj = x0+(j+(j<<1));
-	d[0] = xi[0] - xj[0];				// pair vector
-	d[1] = xi[1] - xj[1];
-	d[2] = xi[2] - xj[2]; }
+        d[0] = xi[0] - xj[0];                                // pair vector
+        d[1] = xi[1] - xj[1];
+        d[2] = xi[2] - xj[2]; }
 
       if ((rsq = vec_dot(d, d)) >= cut_out_off_sq) continue;
       if (rsq <= cut_in_off_sq) continue;
       r2inv = 1.0/rsq;
 
-      if (order1 && (rsq < cut_coulsq))			// coulombic
-	force_coul = ni == 0 ?
-	  qri*q[j]*sqrt(r2inv) : qri*q[j]*sqrt(r2inv)*special_coul[ni];
+      if (order1 && (rsq < cut_coulsq))                        // coulombic
+        force_coul = ni == 0 ?
+          qri*q[j]*sqrt(r2inv) : qri*q[j]*sqrt(r2inv)*special_coul[ni];
 
-      if (rsq < cut_ljsqi[typej = type[j]]) {		// lennard-jones
-	register double rn = r2inv*r2inv*r2inv;
-	force_lj = ni == 0 ?
-	  rn*(rn*lj1i[typej]-lj2i[typej]) :
-	  rn*(rn*lj1i[typej]-lj2i[typej])*special_lj[ni];
+      if (rsq < cut_ljsqi[typej = type[j]]) {                // lennard-jones
+        register double rn = r2inv*r2inv*r2inv;
+        force_lj = ni == 0 ?
+          rn*(rn*lj1i[typej]-lj2i[typej]) :
+          rn*(rn*lj1i[typej]-lj2i[typej])*special_lj[ni];
       }
       else force_lj = 0.0;
 
       fpair = (force_coul + force_lj) * r2inv;
-      
-      if (rsq < cut_in_on_sq) {				// switching
-        register double rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
-	fpair  *= rsw*rsw*(3.0 - 2.0*rsw);
+
+      if (rsq < cut_in_on_sq) {                                // switching
+        register double rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
+        fpair  *= rsw*rsw*(3.0 - 2.0*rsw);
       }
       if (rsq > cut_out_on_sq) {
-        register double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	fpair  *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
+        register double rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+        fpair  *= 1.0 + rsw*rsw*(2.0*rsw-3.0);
       }
 
-      if (newton_pair || j < nlocal) {			// force update
-	register double *fj = f0+(j+(j<<1)), f;
-	fi[0] += f = d[0]*fpair; fj[0] -= f;
-	fi[1] += f = d[1]*fpair; fj[1] -= f;
-	fi[2] += f = d[2]*fpair; fj[2] -= f;
+      if (newton_pair || j < nlocal) {                        // force update
+        register double *fj = f0+(j+(j<<1)), f;
+        fi[0] += f = d[0]*fpair; fj[0] -= f;
+        fi[1] += f = d[1]*fpair; fj[1] -= f;
+        fi[2] += f = d[2]*fpair; fj[2] -= f;
       }
       else {
-	fi[0] += d[0]*fpair;
-	fi[1] += d[1]*fpair;
-	fi[2] += d[2]*fpair;
+        fi[0] += d[0]*fpair;
+        fi[1] += d[1]*fpair;
+        fi[2] += d[2]*fpair;
       }
     }
   }
@@ -780,7 +780,7 @@ void PairLJCoul::compute_outer(int eflag, int vflag)
 
   int i, j, order1 = ewald_order&(1<<1), order6 = ewald_order&(1<<6);
   int *ineigh, *ineighn, *jneigh, *jneighn, typei, typej, ni, respa_flag;
-  double qi = 0.0, qri = 0.0; 
+  double qi = 0.0, qri = 0.0;
   double *cutsqi, *cut_ljsqi, *lj1i, *lj2i, *lj3i, *lj4i, *offseti;
   double rsq, r2inv, force_coul, force_lj;
   double g2 = g_ewald*g_ewald, g6 = g2*g2*g2, g8 = g6*g2;
@@ -796,104 +796,104 @@ void PairLJCoul::compute_outer(int eflag, int vflag)
 
   ineighn = (ineigh = list->ilist)+list->inum;
 
-  for (; ineigh<ineighn; ++ineigh) {			// loop over my atoms
+  for (; ineigh<ineighn; ++ineigh) {                        // loop over my atoms
     i = *ineigh; fi = f0+3*i;
-    if (order1) qri = (qi = q[i])*qqrd2e;		// initialize constants
+    if (order1) qri = (qi = q[i])*qqrd2e;                // initialize constants
     offseti = offset[typei = type[i]];
     lj1i = lj1[typei]; lj2i = lj2[typei]; lj3i = lj3[typei]; lj4i = lj4[typei];
     cutsqi = cutsq[typei]; cut_ljsqi = cut_ljsq[typei];
     memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
     jneighn = (jneigh = list->firstneigh[i])+list->numneigh[i];
 
-    for (; jneigh<jneighn; ++jneigh) {			// loop over neighbors
+    for (; jneigh<jneighn; ++jneigh) {                        // loop over neighbors
       j = *jneigh;
       ni = sbmask(j);
       j &= NEIGHMASK;
 
       { register double *xj = x0+(j+(j<<1));
-	d[0] = xi[0] - xj[0];				// pair vector
-	d[1] = xi[1] - xj[1];
-	d[2] = xi[2] - xj[2]; }
+        d[0] = xi[0] - xj[0];                                // pair vector
+        d[1] = xi[1] - xj[1];
+        d[2] = xi[2] - xj[2]; }
 
       if ((rsq = vec_dot(d, d)) >= cutsqi[typej = type[j]]) continue;
       r2inv = 1.0/rsq;
 
       if ((respa_flag = (rsq>cut_in_off_sq)&&(rsq<cut_in_on_sq))) {
-	register double rsw = (sqrt(rsq)-cut_in_off)/cut_in_diff;
-	frespa = rsw*rsw*(3.0-2.0*rsw);
+        register double rsw = (sqrt(rsq)-cut_in_off)/cut_in_diff;
+        frespa = rsw*rsw*(3.0-2.0*rsw);
       }
 
-      if (order1 && (rsq < cut_coulsq)) {		// coulombic
-	if (!ncoultablebits || rsq <= tabinnersq) {	// series real space
-	  register double r = sqrt(rsq), s = qri*q[j];
-	  if (respa_flag)				// correct for respa
-	    respa_coul = ni == 0 ? frespa*s/r : frespa*s/r*special_coul[ni];
-	  register double x = g_ewald*r, t = 1.0/(1.0+EWALD_P*x);
-	  if (ni == 0) {
-	    s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
-	    if (eflag) ecoul = t;
-	  }
-	  else {					// correct for special
-	    r = s*(1.0-special_coul[ni])/r; s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-r;
-	    if (eflag) ecoul = t-r;
-	  }
-	}						// table real space
-	else {
-	  if (respa_flag) respa_coul = ni == 0 ?	// correct for respa
-	      frespa*qri*q[j]/sqrt(rsq) :
-	      frespa*qri*q[j]/sqrt(rsq)*special_coul[ni];
-	  register union_int_float_t t;
-	  t.f = rsq;
-	  register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
-	  register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
-	  if (ni == 0) {
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]);
-	    if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]);
-	  }
-	  else {					// correct for special
-	    t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
-	    if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
-	  }
-	}
+      if (order1 && (rsq < cut_coulsq)) {                // coulombic
+        if (!ncoultablebits || rsq <= tabinnersq) {        // series real space
+          register double r = sqrt(rsq), s = qri*q[j];
+          if (respa_flag)                                // correct for respa
+            respa_coul = ni == 0 ? frespa*s/r : frespa*s/r*special_coul[ni];
+          register double x = g_ewald*r, t = 1.0/(1.0+EWALD_P*x);
+          if (ni == 0) {
+            s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
+            if (eflag) ecoul = t;
+          }
+          else {                                        // correct for special
+            r = s*(1.0-special_coul[ni])/r; s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-r;
+            if (eflag) ecoul = t-r;
+          }
+        }                                                // table real space
+        else {
+          if (respa_flag) respa_coul = ni == 0 ?        // correct for respa
+              frespa*qri*q[j]/sqrt(rsq) :
+              frespa*qri*q[j]/sqrt(rsq)*special_coul[ni];
+          register union_int_float_t t;
+          t.f = rsq;
+          register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
+          register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
+          if (ni == 0) {
+            force_coul = qiqj*(ftable[k]+f*dftable[k]);
+            if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]);
+          }
+          else {                                        // correct for special
+            t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
+            force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
+            if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
+          }
+        }
       }
       else force_coul = respa_coul = ecoul = 0.0;
 
-      if (rsq < cut_ljsqi[typej]) {			// lennard-jones
-	register double rn = r2inv*r2inv*r2inv;
-	if (respa_flag) respa_lj = ni == 0 ? 		// correct for respa
-	    frespa*rn*(rn*lj1i[typej]-lj2i[typej]) :
-	    frespa*rn*(rn*lj1i[typej]-lj2i[typej])*special_lj[ni];
-	if (order6) {					// long-range form
-	  register double x2 = g2*rsq, a2 = 1.0/x2;
-	  x2 = a2*exp(-x2)*lj4i[typej];
-	  if (ni == 0) {
-	    force_lj =
-	      (rn*=rn)*lj1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
-	    if (eflag) evdwl = rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2;
-	  }
-	  else {					// correct for special
-	    register double f = special_lj[ni], t = rn*(1.0-f);
-	    force_lj = f*(rn *= rn)*lj1i[typej]-
-	      g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*lj2i[typej];
-	    if (eflag)
-	      evdwl = f*rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2+t*lj4i[typej];
-	  }
-	}
-	else {						// cut form
-	  if (ni == 0) {
-	    force_lj = rn*(rn*lj1i[typej]-lj2i[typej]);
-	    if (eflag) evdwl = rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej];
-	  }
-	  else {					// correct for special
-	    register double f = special_lj[ni];
-	    force_lj = f*rn*(rn*lj1i[typej]-lj2i[typej]);
-	    if (eflag)
-	      evdwl = f*(rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej]);
-	  }
-	}
+      if (rsq < cut_ljsqi[typej]) {                        // lennard-jones
+        register double rn = r2inv*r2inv*r2inv;
+        if (respa_flag) respa_lj = ni == 0 ?                 // correct for respa
+            frespa*rn*(rn*lj1i[typej]-lj2i[typej]) :
+            frespa*rn*(rn*lj1i[typej]-lj2i[typej])*special_lj[ni];
+        if (order6) {                                        // long-range form
+          register double x2 = g2*rsq, a2 = 1.0/x2;
+          x2 = a2*exp(-x2)*lj4i[typej];
+          if (ni == 0) {
+            force_lj =
+              (rn*=rn)*lj1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
+            if (eflag) evdwl = rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2;
+          }
+          else {                                        // correct for special
+            register double f = special_lj[ni], t = rn*(1.0-f);
+            force_lj = f*(rn *= rn)*lj1i[typej]-
+              g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*lj2i[typej];
+            if (eflag)
+              evdwl = f*rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2+t*lj4i[typej];
+          }
+        }
+        else {                                                // cut form
+          if (ni == 0) {
+            force_lj = rn*(rn*lj1i[typej]-lj2i[typej]);
+            if (eflag) evdwl = rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej];
+          }
+          else {                                        // correct for special
+            register double f = special_lj[ni];
+            force_lj = f*rn*(rn*lj1i[typej]-lj2i[typej]);
+            if (eflag)
+              evdwl = f*(rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej]);
+          }
+        }
       }
       else force_lj = respa_lj = evdwl = 0.0;
 
@@ -901,19 +901,19 @@ void PairLJCoul::compute_outer(int eflag, int vflag)
       frespa = fpair-(respa_coul+respa_lj)*r2inv;
 
       if (newton_pair || j < nlocal) {
-	register double *fj = f0+(j+(j<<1)), f;
-	fi[0] += f = d[0]*frespa; fj[0] -= f;
-	fi[1] += f = d[1]*frespa; fj[1] -= f;
-	fi[2] += f = d[2]*frespa; fj[2] -= f;
+        register double *fj = f0+(j+(j<<1)), f;
+        fi[0] += f = d[0]*frespa; fj[0] -= f;
+        fi[1] += f = d[1]*frespa; fj[1] -= f;
+        fi[2] += f = d[2]*frespa; fj[2] -= f;
       }
       else {
-	fi[0] += d[0]*frespa;
-	fi[1] += d[1]*frespa;
-	fi[2] += d[2]*frespa;
+        fi[0] += d[0]*frespa;
+        fi[1] += d[1]*frespa;
+        fi[2] += d[2]*frespa;
       }
 
       if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			   evdwl,ecoul,fpair,d[0],d[1],d[2]);
+                           evdwl,ecoul,fpair,d[0],d[1],d[2]);
     }
   }
 }
@@ -930,17 +930,17 @@ void PairLJCoul::init_tables()
 
   tabinnersq = tabinner*tabinner;
   init_bitmap(tabinner,cut_coul,ncoultablebits,
-	      masklo,maskhi,ncoulmask,ncoulshiftbits);
-  
+              masklo,maskhi,ncoulmask,ncoulshiftbits);
+
   int ntable = 1;
   for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
-  
+
   // linear lookup tables of length N = 2^ncoultablebits
   // stored value = value at lower edge of bin
   // d values = delta from lower edge to upper edge of bin
 
   if (ftable) free_tables();
-  
+
   memory->create(rtable,ntable,"pair:rtable");
   memory->create(ftable,ntable,"pair:ftable");
   memory->create(ctable,ntable,"pair:ctable");
@@ -964,7 +964,7 @@ void PairLJCoul::init_tables()
   int itablemin;
   minrsq_lookup.i = 0 << ncoulshiftbits;
   minrsq_lookup.i |= maskhi;
-    
+
   for (int i = 0; i < ntable; i++) {
     rsq_lookup.i = i << ncoulshiftbits;
     rsq_lookup.i |= masklo;
@@ -989,23 +989,23 @@ void PairLJCoul::init_tables()
       ptable[i] = qqrd2e/r;
       vtable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
-	if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-	  rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
-	  ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
-	  ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
-	} else {
-	  ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
-	  ctable[i] = qqrd2e/r;
-	}
+        if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
+          ftable[i] += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
+          ctable[i] = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
+        } else {
+          ftable[i] = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
+          ctable[i] = qqrd2e/r;
+        }
       }
     }
     minrsq_lookup.f = MIN(minrsq_lookup.f,rsq_lookup.f);
   }
 
   tabinnersq = minrsq_lookup.f;
-  
+
   int ntablem1 = ntable - 1;
-  
+
   for (int i = 0; i < ntablem1; i++) {
     drtable[i] = 1.0/(rtable[i+1] - rtable[i]);
     dftable[i] = ftable[i+1] - ftable[i];
@@ -1019,10 +1019,10 @@ void PairLJCoul::init_tables()
       dptable[i] = ptable[i+1] - ptable[i];
     }
   }
-  
-  // get the delta values for the last table entries 
+
+  // get the delta values for the last table entries
   // tables are connected periodically between 0 and ntablem1
-    
+
   drtable[ntablem1] = 1.0/(rtable[0] - rtable[ntablem1]);
   dftable[ntablem1] = ftable[0] - ftable[ntablem1];
   dctable[ntablem1] = ctable[0] - ctable[ntablem1];
@@ -1032,23 +1032,23 @@ void PairLJCoul::init_tables()
     dptable[ntablem1] = ptable[0] - ptable[ntablem1];
   }
 
-  // get the correct delta values at itablemax    
+  // get the correct delta values at itablemax
   // smallest r is in bin itablemin
   // largest r is in bin itablemax, which is itablemin-1,
   //   or ntablem1 if itablemin=0
   // deltas at itablemax only needed if corresponding rsq < cut*cut
-  // if so, compute deltas between rsq and cut*cut 
-	
+  // if so, compute deltas between rsq and cut*cut
+
   double f_tmp,c_tmp,e_tmp,p_tmp = 0.0,v_tmp = 0.0;
   itablemin = minrsq_lookup.i & ncoulmask;
-  itablemin >>= ncoulshiftbits;  
-  int itablemax = itablemin - 1; 
-  if (itablemin == 0) itablemax = ntablem1;     
+  itablemin >>= ncoulshiftbits;
+  int itablemax = itablemin - 1;
+  if (itablemin == 0) itablemax = ntablem1;
   rsq_lookup.i = itablemax << ncoulshiftbits;
   rsq_lookup.i |= maskhi;
 
   if (rsq_lookup.f < cut_coulsq) {
-    rsq_lookup.f = cut_coulsq;  
+    rsq_lookup.f = cut_coulsq;
     r = sqrtf(rsq_lookup.f);
     grij = g_ewald * r;
     expm2 = exp(-grij*grij);
@@ -1066,7 +1066,7 @@ void PairLJCoul::init_tables()
       v_tmp = qqrd2e/r * (derfc + EWALD_F*grij*expm2);
       if (rsq_lookup.f > cut_respa[2]*cut_respa[2]) {
         if (rsq_lookup.f < cut_respa[3]*cut_respa[3]) {
-          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]); 
+          rsw = (r - cut_respa[2])/(cut_respa[3] - cut_respa[2]);
           f_tmp += qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
           c_tmp = qqrd2e/r * rsw*rsw*(3.0 - 2.0*rsw);
         } else {
@@ -1076,14 +1076,14 @@ void PairLJCoul::init_tables()
       }
     }
 
-    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);   
+    drtable[itablemax] = 1.0/(rsq_lookup.f - rtable[itablemax]);
     dftable[itablemax] = f_tmp - ftable[itablemax];
     dctable[itablemax] = c_tmp - ctable[itablemax];
     detable[itablemax] = e_tmp - etable[itablemax];
     if (cut_respa) {
       dvtable[itablemax] = v_tmp - vtable[itablemax];
       dptable[itablemax] = p_tmp - ptable[itablemax];
-    }   
+    }
   }
 }
 
@@ -1110,8 +1110,8 @@ void PairLJCoul::free_tables()
 /* ---------------------------------------------------------------------- */
 
 double PairLJCoul::single(int i, int j, int itype, int jtype,
-			  double rsq, double factor_coul, double factor_lj,
-			  double &fforce)
+                          double rsq, double factor_coul, double factor_lj,
+                          double &fforce)
 {
   double r2inv, r6inv, force_coul, force_lj;
   double g2 = g_ewald*g_ewald, g6 = g2*g2*g2, g8 = g6*g2, *q = atom->q;
@@ -1119,15 +1119,15 @@ double PairLJCoul::single(int i, int j, int itype, int jtype,
   double eng = 0.0;
 
   r2inv = 1.0/rsq;
-  if ((ewald_order&2) && (rsq < cut_coulsq)) {		// coulombic
-    if (!ncoultablebits || rsq <= tabinnersq) {		// series real space
+  if ((ewald_order&2) && (rsq < cut_coulsq)) {                // coulombic
+    if (!ncoultablebits || rsq <= tabinnersq) {                // series real space
       register double r = sqrt(rsq), x = g_ewald*r;
       register double s = force->qqrd2e*q[i]*q[j], t = 1.0/(1.0+EWALD_P*x);
       r = s*(1.0-factor_coul)/r; s *= g_ewald*exp(-x*x);
       force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-r;
       eng += t-r;
     }
-    else {						// table real space
+    else {                                                // table real space
       register union_int_float_t t;
       t.f = rsq;
       register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
@@ -1137,21 +1137,21 @@ double PairLJCoul::single(int i, int j, int itype, int jtype,
       eng += qiqj*(etable[k]+f*detable[k]-t.f);
     }
   } else force_coul = 0.0;
-  
-  if (rsq < cut_ljsq[itype][jtype]) {			// lennard-jones
+
+  if (rsq < cut_ljsq[itype][jtype]) {                        // lennard-jones
     r6inv = r2inv*r2inv*r2inv;
-    if (ewald_order&64) {				// long-range
+    if (ewald_order&64) {                                // long-range
       register double x2 = g2*rsq, a2 = 1.0/x2, t = r6inv*(1.0-factor_lj);
       x2 = a2*exp(-x2)*lj4[itype][jtype];
       force_lj = factor_lj*(r6inv *= r6inv)*lj1[itype][jtype]-
-       	g8*(((6.0*a2+6.0)*a2+3.0)*a2+a2)*x2*rsq+t*lj2[itype][jtype];
+               g8*(((6.0*a2+6.0)*a2+3.0)*a2+a2)*x2*rsq+t*lj2[itype][jtype];
       eng += factor_lj*r6inv*lj3[itype][jtype]-
-	g6*((a2+1.0)*a2+0.5)*x2+t*lj4[itype][jtype];
+        g6*((a2+1.0)*a2+0.5)*x2+t*lj4[itype][jtype];
     }
-    else {						// cut
+    else {                                                // cut
       force_lj = factor_lj*r6inv*(lj1[itype][jtype]*r6inv-lj2[itype][jtype]);
       eng += factor_lj*(r6inv*(r6inv*lj3[itype][jtype]-
-			       lj4[itype][jtype])-offset[itype][jtype]);
+                               lj4[itype][jtype])-offset[itype][jtype]);
     }
   } else force_lj = 0.0;
 
diff --git a/src/USER-EWALDN/pair_lj_coul.h b/src/USER-EWALDN/pair_lj_coul.h
index 4f17095770..b497cd2546 100644
--- a/src/USER-EWALDN/pair_lj_coul.h
+++ b/src/USER-EWALDN/pair_lj_coul.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ class PairLJCoul : public Pair {
   double init_one(int, int);
   void write_restart(FILE *);
   void read_restart(FILE *);
-  
+
   void write_restart_settings(FILE *);
   void read_restart_settings(FILE *);
   double single(int, int, int, int, double, double, double, double &);
diff --git a/src/USER-MISC/angle_cosine_shift.cpp b/src/USER-MISC/angle_cosine_shift.cpp
index cc4e153782..11b4cd070c 100644
--- a/src/USER-MISC/angle_cosine_shift.cpp
+++ b/src/USER-MISC/angle_cosine_shift.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -102,11 +102,11 @@ void AngleCosineShift::compute(int eflag, int vflag)
     // C= sine of angle
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
-    
+
     // force & energy
     kcos=kcost[type];
     ksin=ksint[type];
-    if (eflag) eangle = -k[type]-kcos*c-ksin*s;  
+    if (eflag) eangle = -k[type]-kcos*c-ksin*s;
 
     cps = c/s;          // NOTE absorbed one c
 
@@ -142,7 +142,7 @@ void AngleCosineShift::compute(int eflag, int vflag)
     }
 
     if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
   }
 }
 
@@ -158,7 +158,7 @@ void AngleCosineShift::allocate()
   memory->create(kcost  ,n+1,"Angle:kcost");
   memory->create(theta  ,n+1,"Angle:theta");
   memory->create(setflag,n+1, "Angle:setflag");
-  
+
   for (int i = 1; i <= n; i++) setflag[i] = 0;
 }
 
@@ -201,7 +201,7 @@ double AngleCosineShift::equilibrium_angle(int i)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void AngleCosineShift::write_restart(FILE *fp)
@@ -213,14 +213,14 @@ void AngleCosineShift::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void AngleCosineShift::read_restart(FILE *fp)
 {
   allocate();
 
-  if (comm->me == 0) 
+  if (comm->me == 0)
     {
        fread(&k[1],sizeof(double),atom->nangletypes,fp);
        fread(&kcost[1],sizeof(double),atom->nangletypes,fp);
@@ -246,7 +246,7 @@ double AngleCosineShift::single(int type, int i1, int i2, int i3)
   double delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
   double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
-  
+
   double delx2 = x[i3][0] - x[i2][0];
   double dely2 = x[i3][1] - x[i2][1];
   double delz2 = x[i3][2] - x[i2][2];
@@ -259,5 +259,5 @@ double AngleCosineShift::single(int type, int i1, int i2, int i3)
   if (c < -1.0) c = -1.0;
   double s=sqrt(1.0-c*c);
 
-  return -k[type]-kcost[type]*c-ksint[type]*s;  
+  return -k[type]-kcost[type]*c-ksint[type]*s;
 }
diff --git a/src/USER-MISC/angle_cosine_shift.h b/src/USER-MISC/angle_cosine_shift.h
index d8b7ea1741..3945161f0e 100644
--- a/src/USER-MISC/angle_cosine_shift.h
+++ b/src/USER-MISC/angle_cosine_shift.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/angle_cosine_shift_exp.cpp b/src/USER-MISC/angle_cosine_shift_exp.cpp
index 031cfec563..0c607b4c43 100644
--- a/src/USER-MISC/angle_cosine_shift_exp.cpp
+++ b/src/USER-MISC/angle_cosine_shift_exp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -42,7 +42,7 @@ AngleCosineShiftExp::~AngleCosineShiftExp()
     memory->destroy(setflag);
     memory->destroy(umin);
     memory->destroy(a);
-    memory->destroy(opt1);    
+    memory->destroy(opt1);
     memory->destroy(cost);
     memory->destroy(sint);
     memory->destroy(theta0);
@@ -58,7 +58,7 @@ void AngleCosineShiftExp::compute(int eflag, int vflag)
   double delx1,dely1,delz1,delx2,dely2,delz2;
   double eangle,f1[3],f3[3],ff;
   double rsq1,rsq2,r1,r2,c,s,a11,a12,a22;
-  double exp2,aa,uumin,cccpsss,cssmscc;            
+  double exp2,aa,uumin,cccpsss,cssmscc;
 
   eangle = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
@@ -106,9 +106,9 @@ void AngleCosineShiftExp::compute(int eflag, int vflag)
     // C= sine of angle
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
-    
+
     // force & energy
-        
+
     aa=a[type];
     uumin=umin[type];
 
@@ -119,19 +119,19 @@ void AngleCosineShiftExp::compute(int eflag, int vflag)
        {  //  |a|<0.01 so use expansions relative precision <1e-5
 //         std::cout << "Using expansion\n";
             if (eflag) eangle = -0.125*(1+cccpsss)*(4+aa*(cccpsss-1))*uumin;
-            ff=0.25*uumin*cssmscc*(2+aa*cccpsss)/s;   
+            ff=0.25*uumin*cssmscc*(2+aa*cccpsss)/s;
        }
      else
        {
-//   std::cout << "Not using expansion\n";            
+//   std::cout << "Not using expansion\n";
             exp2=exp(0.5*aa*(1+cccpsss));
             if (eflag) eangle = opt1[type]*(1-exp2);
-            ff=0.5*a[type]*opt1[type]*exp2*cssmscc/s;       
+            ff=0.5*a[type]*opt1[type]*exp2*cssmscc/s;
        }
 
     a11 =   ff*c/ rsq1;
     a12 =  -ff  / (r1*r2);
-    a22 =   ff*c/ rsq2;      
+    a22 =   ff*c/ rsq2;
 
     f1[0] = a11*delx1 + a12*delx2;
     f1[1] = a11*dely1 + a12*dely2;
@@ -161,7 +161,7 @@ void AngleCosineShiftExp::compute(int eflag, int vflag)
     }
 
     if (evflag) ev_tally(i1,i2,i3,nlocal,newton_bond,eangle,f1,f3,
-			 delx1,dely1,delz1,delx2,dely2,delz2);
+                         delx1,dely1,delz1,delx2,dely2,delz2);
   }
 }
 
@@ -208,7 +208,7 @@ void AngleCosineShiftExp::coeff(int narg, char **arg)
     cost[i]  = cos(theta0_*3.14159265/180);
     sint[i]  = sin(theta0_*3.14159265/180);
     theta0[i]=     theta0_*3.14159265/180;
-    
+
     if (!doExpansion[i]) opt1[i]=umin_/(exp(a_)-1);
 
     setflag[i] = 1;
@@ -226,7 +226,7 @@ double AngleCosineShiftExp::equilibrium_angle(int i)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void AngleCosineShiftExp::write_restart(FILE *fp)
@@ -239,7 +239,7 @@ void AngleCosineShiftExp::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void AngleCosineShiftExp::read_restart(FILE *fp)
@@ -279,7 +279,7 @@ double AngleCosineShiftExp::single(int type, int i1, int i2, int i3)
   double delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
   double r1 = sqrt(delx1*delx1 + dely1*dely1 + delz1*delz1);
-  
+
   double delx2 = x[i3][0] - x[i2][0];
   double dely2 = x[i3][1] - x[i2][1];
   double delz2 = x[i3][2] - x[i2][2];
diff --git a/src/USER-MISC/angle_cosine_shift_exp.h b/src/USER-MISC/angle_cosine_shift_exp.h
index 50883dc034..10c6d1ba6f 100644
--- a/src/USER-MISC/angle_cosine_shift_exp.h
+++ b/src/USER-MISC/angle_cosine_shift_exp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/angle_dipole.cpp b/src/USER-MISC/angle_dipole.cpp
index f5bbf00b61..4020842413 100644
--- a/src/USER-MISC/angle_dipole.cpp
+++ b/src/USER-MISC/angle_dipole.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -66,7 +66,7 @@ void AngleDipole::compute(int eflag, int vflag)
   int nlocal = atom->nlocal;
   int newton_bond = force->newton_bond;
 
-  if (!newton_bond) 
+  if (!newton_bond)
     error->all(FLERR,"'newton' flag for bonded interactions must be 'on'");
 
   for (n = 0; n < nanglelist; n++) {
@@ -87,19 +87,19 @@ void AngleDipole::compute(int eflag, int vflag)
     deltaGamma = cosGamma - cos(gamma0[type]);
     kdg = k[type] * deltaGamma;
 
-    if (eflag) eangle = kdg * deltaGamma; // energy  
-      
-    tangle = 2.0 * kdg / rmu; 
-      
+    if (eflag) eangle = kdg * deltaGamma; // energy
+
+    tangle = 2.0 * kdg / rmu;
+
     torque[iDip][0] += tangle * (dely*mu[iDip][2] - delz*mu[iDip][1]);
     torque[iDip][1] += tangle * (delz*mu[iDip][0] - delx*mu[iDip][2]);
     torque[iDip][2] += tangle * (delx*mu[iDip][1] - dely*mu[iDip][0]);
-    
+
     f1[0] = f1[1] = f1[2] = f3[0] = f3[1] = f3[2] = 0.0;
-    
+
     if (evflag) // tally energy (virial=0 because force=0)
       ev_tally(iRef,iDip,iDummy,nlocal,newton_bond,eangle,f1,f3,
-	       0.0,0.0,0.0,0.0,0.0,0.0);
+               0.0,0.0,0.0,0.0,0.0,0.0);
   }
 }
 
@@ -165,7 +165,7 @@ void AngleDipole::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void AngleDipole::read_restart(FILE *fp)
@@ -203,5 +203,5 @@ double AngleDipole::single(int type, int iRef, int iDip, int iDummy)
   double deltaGamma = cosGamma - cos(gamma0[type]);
   double kdg = k[type] * deltaGamma;
 
-  return kdg * deltaGamma; // energy  
+  return kdg * deltaGamma; // energy
 }
diff --git a/src/USER-MISC/angle_dipole.h b/src/USER-MISC/angle_dipole.h
index 09dd6821cf..f3138ad83c 100644
--- a/src/USER-MISC/angle_dipole.h
+++ b/src/USER-MISC/angle_dipole.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/bond_harmonic_shift.cpp b/src/USER-MISC/bond_harmonic_shift.cpp
index 958dad69f8..e140892141 100644
--- a/src/USER-MISC/bond_harmonic_shift.cpp
+++ b/src/USER-MISC/bond_harmonic_shift.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -75,7 +75,7 @@ void BondHarmonicShift::compute(int eflag, int vflag)
 
     rsq = delx*delx + dely*dely + delz*delz;
     r = sqrt(rsq);
-    
+
     dr = r - r0[type];
     rk = k[type] * dr;
 
@@ -115,7 +115,7 @@ void BondHarmonicShift::allocate()
   memory->create(r0,    n+1,"bond:r0");
   memory->create(r1,    n+1,"bond:r1");
   memory->create(setflag,n+1,"bond:setflag");
-  
+
   for (int i = 1; i <= n; i++) setflag[i] = 0;
 }
 
@@ -148,7 +148,7 @@ void BondHarmonicShift::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   return an equilbrium bond length 
+   return an equilbrium bond length
 ------------------------------------------------------------------------- */
 
 double BondHarmonicShift::equilibrium_distance(int i)
@@ -157,7 +157,7 @@ double BondHarmonicShift::equilibrium_distance(int i)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void BondHarmonicShift::write_restart(FILE *fp)
@@ -168,7 +168,7 @@ void BondHarmonicShift::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void BondHarmonicShift::read_restart(FILE *fp)
@@ -183,7 +183,7 @@ void BondHarmonicShift::read_restart(FILE *fp)
   MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world);
   MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world);
   MPI_Bcast(&r1[1],atom->nbondtypes,MPI_DOUBLE,0,world);
-  
+
   for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1;
 }
 
@@ -191,9 +191,9 @@ void BondHarmonicShift::read_restart(FILE *fp)
 
 double BondHarmonicShift::single(int type, double rsq, int i, int j)
 {
-  double r = sqrt(rsq);  
+  double r = sqrt(rsq);
   double dr = r - r0[type];
   double dr2=r0[type]-r1[type];
-  
+
   return k[type]*(dr*dr - dr2*dr2);
 }
diff --git a/src/USER-MISC/bond_harmonic_shift.h b/src/USER-MISC/bond_harmonic_shift.h
index b3378aea3f..74909a0bec 100644
--- a/src/USER-MISC/bond_harmonic_shift.h
+++ b/src/USER-MISC/bond_harmonic_shift.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/bond_harmonic_shift_cut.cpp b/src/USER-MISC/bond_harmonic_shift_cut.cpp
index da78a54aed..8ebb820e0b 100644
--- a/src/USER-MISC/bond_harmonic_shift_cut.cpp
+++ b/src/USER-MISC/bond_harmonic_shift_cut.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -75,9 +75,9 @@ void BondHarmonicShiftCut::compute(int eflag, int vflag)
 
     rsq = delx*delx + dely*dely + delz*delz;
     r = sqrt(rsq);
-    
+
     if (r>r1[type]) continue;
-    
+
     dr = r - r0[type];
     rk = k[type] * dr;
 
@@ -149,7 +149,7 @@ void BondHarmonicShiftCut::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   return an equilbrium bond length 
+   return an equilbrium bond length
 ------------------------------------------------------------------------- */
 
 double BondHarmonicShiftCut::equilibrium_distance(int i)
@@ -158,7 +158,7 @@ double BondHarmonicShiftCut::equilibrium_distance(int i)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void BondHarmonicShiftCut::write_restart(FILE *fp)
@@ -169,7 +169,7 @@ void BondHarmonicShiftCut::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void BondHarmonicShiftCut::read_restart(FILE *fp)
@@ -184,7 +184,7 @@ void BondHarmonicShiftCut::read_restart(FILE *fp)
   MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world);
   MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world);
   MPI_Bcast(&r1[1],atom->nbondtypes,MPI_DOUBLE,0,world);
-  
+
   for (int i = 1; i <= atom->nbondtypes; i++) setflag[i] = 1;
 }
 
@@ -192,10 +192,10 @@ void BondHarmonicShiftCut::read_restart(FILE *fp)
 
 double BondHarmonicShiftCut::single(int type, double rsq, int i, int j)
 {
-  double r = sqrt(rsq);  
-  
+  double r = sqrt(rsq);
+
   if (r>r1[type]) return 0;
-  
+
   double dr = r - r0[type];
   double dr2=r0[type]-r1[type];
   return k[type]*(dr*dr - dr2*dr2);
diff --git a/src/USER-MISC/bond_harmonic_shift_cut.h b/src/USER-MISC/bond_harmonic_shift_cut.h
index 6e957d286c..9767f11580 100644
--- a/src/USER-MISC/bond_harmonic_shift_cut.h
+++ b/src/USER-MISC/bond_harmonic_shift_cut.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/compute_ackland_atom.cpp b/src/USER-MISC/compute_ackland_atom.cpp
index 650688b130..2c70cf19f0 100644
--- a/src/USER-MISC/compute_ackland_atom.cpp
+++ b/src/USER-MISC/compute_ackland_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -140,15 +140,15 @@ void ComputeAcklandAtom::compute_peratom()
       // ensure distsq and nearest arrays are long enough
 
       if (jnum > maxneigh) {
-      	memory->destroy(distsq);
-      	memory->destroy(nearest);
-	memory->destroy(nearest_n0);
-	memory->destroy(nearest_n1);
-      	maxneigh = jnum;
-      	memory->create(distsq,maxneigh,"compute/ackland/atom:distsq");
-      	memory->create(nearest,maxneigh,"compute/ackland/atom:nearest");
-	memory->create(nearest_n0,maxneigh,"compute/ackland/atom:nearest_n0");
-	memory->create(nearest_n1,maxneigh,"compute/ackland/atom:nearest_n1");
+              memory->destroy(distsq);
+              memory->destroy(nearest);
+        memory->destroy(nearest_n0);
+        memory->destroy(nearest_n1);
+              maxneigh = jnum;
+              memory->create(distsq,maxneigh,"compute/ackland/atom:distsq");
+              memory->create(nearest,maxneigh,"compute/ackland/atom:nearest");
+        memory->create(nearest_n0,maxneigh,"compute/ackland/atom:nearest_n0");
+        memory->create(nearest_n1,maxneigh,"compute/ackland/atom:nearest_n1");
       }
 
       // loop over list of all neighbors within force cutoff
@@ -157,17 +157,17 @@ void ComputeAcklandAtom::compute_peratom()
 
       n = 0;
       for (jj = 0; jj < jnum; jj++) {
-      	j = jlist[jj];
-	j &= NEIGHMASK;
-	
-      	delx = xtmp - x[j][0];
-      	dely = ytmp - x[j][1];
-      	delz = ztmp - x[j][2];
-      	rsq = delx*delx + dely*dely + delz*delz;
-      	if (rsq < cutsq) {
-	  distsq[n] = rsq;
-	  nearest[n++] = j;
-	}  
+              j = jlist[jj];
+        j &= NEIGHMASK;
+
+              delx = xtmp - x[j][0];
+              dely = ytmp - x[j][1];
+              delz = ztmp - x[j][2];
+              rsq = delx*delx + dely*dely + delz*delz;
+              if (rsq < cutsq) {
+          distsq[n] = rsq;
+          nearest[n++] = j;
+        }
       }
 
       // Select 6 nearest neighbors
@@ -177,15 +177,15 @@ void ComputeAcklandAtom::compute_peratom()
       // Mean squared separation
 
       double r0_sq = 0.;
-      for (j = 0; j < 6; j++) 
-	r0_sq += distsq[j];
+      for (j = 0; j < 6; j++)
+        r0_sq += distsq[j];
       r0_sq /= 6.;
 
       // n0 near neighbors with: distsq<1.45*r0_sq
       // n1 near neighbors with: distsq<1.55*r0_sq
 
       double n0_dist_sq = 1.45*r0_sq,
-	n1_dist_sq = 1.55*r0_sq;
+        n1_dist_sq = 1.55*r0_sq;
       int n0 = 0, n1 = 0;
       for (j = 0; j < n; j++) {
          if (distsq[j] < n1_dist_sq) {
@@ -204,32 +204,32 @@ void ComputeAcklandAtom::compute_peratom()
       chi[0] = chi[1] = chi[2] = chi[3] = chi[4] = chi[5] = chi[6] = chi[7] = 0;
       double x_ij, y_ij, z_ij, x_ik, y_ik, z_ik;
       for (j = 0; j < n0; j++) {
-	x_ij = x[i][0]-x[nearest_n0[j]][0];
-	y_ij = x[i][1]-x[nearest_n0[j]][1];
-	z_ij = x[i][2]-x[nearest_n0[j]][2];
-	norm_j = sqrt (x_ij*x_ij + y_ij*y_ij + z_ij*z_ij);
-	if (norm_j <= 0.) continue;
-	for (k = j+1; k < n0; k++) {
-	  x_ik = x[i][0]-x[nearest_n0[k]][0];
-	  y_ik = x[i][1]-x[nearest_n0[k]][1];
-	  z_ik = x[i][2]-x[nearest_n0[k]][2];
-	  norm_k = sqrt (x_ik*x_ik + y_ik*y_ik + z_ik*z_ik);
-	  if (norm_k <= 0.)
-	    continue;
-
-	  bond_angle = (x_ij*x_ik + y_ij*y_ik + z_ij*z_ik) / (norm_j*norm_k);
-	  
-	  // Histogram for identifying the relevant peaks
-
-	  if (bond_angle < -0.945) chi[0]++;
-	  else if (bond_angle < -0.915) chi[1]++;
-	  else if (bond_angle < -0.755) chi[2]++;
-	  else if (bond_angle < -0.195) chi[3]++;
-	  else if (bond_angle < 0.195) chi[4]++;
-	  else if (bond_angle < 0.245) chi[5]++;
-	  else if (bond_angle < 0.795) chi[6]++;
-	  else chi[7]++;
-	}
+        x_ij = x[i][0]-x[nearest_n0[j]][0];
+        y_ij = x[i][1]-x[nearest_n0[j]][1];
+        z_ij = x[i][2]-x[nearest_n0[j]][2];
+        norm_j = sqrt (x_ij*x_ij + y_ij*y_ij + z_ij*z_ij);
+        if (norm_j <= 0.) continue;
+        for (k = j+1; k < n0; k++) {
+          x_ik = x[i][0]-x[nearest_n0[k]][0];
+          y_ik = x[i][1]-x[nearest_n0[k]][1];
+          z_ik = x[i][2]-x[nearest_n0[k]][2];
+          norm_k = sqrt (x_ik*x_ik + y_ik*y_ik + z_ik*z_ik);
+          if (norm_k <= 0.)
+            continue;
+
+          bond_angle = (x_ij*x_ik + y_ij*y_ik + z_ij*z_ik) / (norm_j*norm_k);
+
+          // Histogram for identifying the relevant peaks
+
+          if (bond_angle < -0.945) chi[0]++;
+          else if (bond_angle < -0.915) chi[1]++;
+          else if (bond_angle < -0.755) chi[2]++;
+          else if (bond_angle < -0.195) chi[3]++;
+          else if (bond_angle < 0.195) chi[4]++;
+          else if (bond_angle < 0.245) chi[5]++;
+          else if (bond_angle < 0.795) chi[6]++;
+          else chi[7]++;
+        }
       }
 
       // Deviations from the different lattice structures
@@ -237,41 +237,41 @@ void ComputeAcklandAtom::compute_peratom()
       double delta_bcc = 0.35*chi[4]/(double)(chi[5]+chi[6]-chi[4]);
       double delta_cp = fabs(1.-(double)chi[6]/24.);
       double delta_fcc = 0.61*(fabs((double)(chi[0]+chi[1]-6.))+
-			       (double)chi[2])/6.0;
+                               (double)chi[2])/6.0;
       double delta_hcp = (fabs((double)chi[0]-3.)+
-			  fabs((double)chi[0]+(double)chi[1]+
-			       (double)chi[2]+(double)chi[3]-9.0))/12.0;
-      
+                          fabs((double)chi[0]+(double)chi[1]+
+                               (double)chi[2]+(double)chi[3]-9.0))/12.0;
+
       // Identification of the local structure according to the reference
 
       if (chi[0] == 7)       { delta_bcc = 0.; }
       else if (chi[0] == 6)  { delta_fcc = 0.; }
       else if (chi[0] <= 3)  { delta_hcp = 0.; }
 
-      if (chi[7] > 0.)  
-         structure[i] = UNKNOWN; 
-      else 
-      if (chi[4] < 3.) 
+      if (chi[7] > 0.)
+         structure[i] = UNKNOWN;
+      else
+      if (chi[4] < 3.)
       {
-         if (n1 > 13 || n1 < 11) 
-            structure[i] = UNKNOWN; 
-         else 
-            structure[i] = ICO; 
-      } else 
-      if (delta_bcc <= delta_cp) 
+         if (n1 > 13 || n1 < 11)
+            structure[i] = UNKNOWN;
+         else
+            structure[i] = ICO;
+      } else
+      if (delta_bcc <= delta_cp)
       {
-         if (n1 < 11) 
-            structure[i] = UNKNOWN; 
-         else 
-            structure[i] = BCC; 
-      } else 
-      if (n1 > 12 || n1 < 11) 
-         structure[i] = UNKNOWN; 
-      else 
-      if (delta_fcc < delta_hcp) 
-         structure[i] = FCC; 
-      else 
-         structure[i] = HCP; 
+         if (n1 < 11)
+            structure[i] = UNKNOWN;
+         else
+            structure[i] = BCC;
+      } else
+      if (n1 > 12 || n1 < 11)
+         structure[i] = UNKNOWN;
+      else
+      if (delta_fcc < delta_hcp)
+         structure[i] = FCC;
+      else
+         structure[i] = HCP;
 
     } else structure[i] = 0.0;
   }
@@ -297,29 +297,29 @@ void ComputeAcklandAtom::select(int k, int n, double *arr)
   for (;;) {
     if (ir <= l+1) {
       if (ir == l+1 && arr[ir] < arr[l]) {
-	SWAP(arr[l],arr[ir])
+        SWAP(arr[l],arr[ir])
       }
       return;
     } else {
       mid=(l+ir) >> 1;
       SWAP(arr[mid],arr[l+1])
       if (arr[l] > arr[ir]) {
-	SWAP(arr[l],arr[ir])
+        SWAP(arr[l],arr[ir])
       }
       if (arr[l+1] > arr[ir]) {
-	SWAP(arr[l+1],arr[ir])
+        SWAP(arr[l+1],arr[ir])
       }
       if (arr[l] > arr[l+1]) {
-	SWAP(arr[l],arr[l+1])
+        SWAP(arr[l],arr[l+1])
       }
       i = l+1;
       j = ir;
       a = arr[l+1];
       for (;;) {
-	do i++; while (arr[i] < a);
-	do j--; while (arr[j] > a);
-	if (j < i) break;
-	SWAP(arr[i],arr[j])
+        do i++; while (arr[i] < a);
+        do j--; while (arr[j] > a);
+        if (j < i) break;
+        SWAP(arr[i],arr[j])
       }
       arr[l+1] = arr[j];
       arr[j] = a;
@@ -343,8 +343,8 @@ void ComputeAcklandAtom::select2(int k, int n, double *arr, int *iarr)
   for (;;) {
     if (ir <= l+1) {
       if (ir == l+1 && arr[ir] < arr[l]) {
-	SWAP(arr[l],arr[ir])
-	ISWAP(iarr[l],iarr[ir])
+        SWAP(arr[l],arr[ir])
+        ISWAP(iarr[l],iarr[ir])
       }
       return;
     } else {
@@ -352,27 +352,27 @@ void ComputeAcklandAtom::select2(int k, int n, double *arr, int *iarr)
       SWAP(arr[mid],arr[l+1])
       ISWAP(iarr[mid],iarr[l+1])
       if (arr[l] > arr[ir]) {
-	SWAP(arr[l],arr[ir])
-	ISWAP(iarr[l],iarr[ir])
+        SWAP(arr[l],arr[ir])
+        ISWAP(iarr[l],iarr[ir])
       }
       if (arr[l+1] > arr[ir]) {
-	SWAP(arr[l+1],arr[ir])
-	ISWAP(iarr[l+1],iarr[ir])
+        SWAP(arr[l+1],arr[ir])
+        ISWAP(iarr[l+1],iarr[ir])
       }
       if (arr[l] > arr[l+1]) {
-	SWAP(arr[l],arr[l+1])
-	ISWAP(iarr[l],iarr[l+1])
+        SWAP(arr[l],arr[l+1])
+        ISWAP(iarr[l],iarr[l+1])
       }
       i = l+1;
       j = ir;
       a = arr[l+1];
       ia = iarr[l+1];
       for (;;) {
-	do i++; while (arr[i] < a);
-	do j--; while (arr[j] > a);
-	if (j < i) break;
-	SWAP(arr[i],arr[j])
-	ISWAP(iarr[i],iarr[j])
+        do i++; while (arr[i] < a);
+        do j--; while (arr[j] > a);
+        if (j < i) break;
+        SWAP(arr[i],arr[j])
+        ISWAP(iarr[i],iarr[j])
       }
       arr[l+1] = arr[j];
       arr[j] = a;
diff --git a/src/USER-MISC/compute_ackland_atom.h b/src/USER-MISC/compute_ackland_atom.h
index 946827c406..ec42aa6630 100644
--- a/src/USER-MISC/compute_ackland_atom.h
+++ b/src/USER-MISC/compute_ackland_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/compute_temp_rotate.cpp b/src/USER-MISC/compute_temp_rotate.cpp
index 539683f4f4..69519249c7 100644
--- a/src/USER-MISC/compute_temp_rotate.cpp
+++ b/src/USER-MISC/compute_temp_rotate.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -34,7 +34,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTempRotate::ComputeTempRotate(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTempRotate::ComputeTempRotate(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg != 3) error->all(FLERR,"Illegal compute temp/rotate command");
@@ -120,10 +120,10 @@ double ComputeTempRotate::compute_scalar()
   }
 
   double t = 0.0;
-  
+
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
-      
+
       xbox = (image[i] & 1023) - 512;
       ybox = (image[i] >> 10 & 1023) - 512;
       zbox = (image[i] >> 20) - 512;
@@ -138,11 +138,11 @@ double ComputeTempRotate::compute_scalar()
       vthermal[1] = v[i][1] - vbiasall[i][1];
       vthermal[2] = v[i][2] - vbiasall[i][2];
       if (rmass)
-	t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] + 
-	      vthermal[2]*vthermal[2]) * rmass[i];
+        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
+              vthermal[2]*vthermal[2]) * rmass[i];
       else
-	t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] + 
-	      vthermal[2]*vthermal[2]) * mass[type[i]];
+        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
+              vthermal[2]*vthermal[2]) * mass[type[i]];
     }
 
   MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
@@ -242,9 +242,9 @@ void ComputeTempRotate::remove_bias_all()
   double **v = atom->v;
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
-  
+
   for (int i = 0; i < nlocal; i++)
-    if (mask[i] & groupbit) {   
+    if (mask[i] & groupbit) {
       v[i][0] -= vbiasall[i][0];
       v[i][1] -= vbiasall[i][1];
       v[i][2] -= vbiasall[i][2];
@@ -273,7 +273,7 @@ void ComputeTempRotate::restore_bias_all()
   double **v = atom->v;
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
-  
+
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       v[i][0] += vbiasall[i][0];
diff --git a/src/USER-MISC/compute_temp_rotate.h b/src/USER-MISC/compute_temp_rotate.h
index c539f250f6..8944f986be 100644
--- a/src/USER-MISC/compute_temp_rotate.h
+++ b/src/USER-MISC/compute_temp_rotate.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/dihedral_cosine_shift_exp.cpp b/src/USER-MISC/dihedral_cosine_shift_exp.cpp
index 29e15fe6ce..d607051d9f 100644
--- a/src/USER-MISC/dihedral_cosine_shift_exp.cpp
+++ b/src/USER-MISC/dihedral_cosine_shift_exp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,7 +50,7 @@ DihedralCosineShiftExp::~DihedralCosineShiftExp()
     memory->destroy(cost);
     memory->destroy(sint);
     memory->destroy(theta);
-    memory->destroy(doExpansion); 
+    memory->destroy(doExpansion);
    }
 }
 
@@ -63,7 +63,7 @@ void DihedralCosineShiftExp::compute(int eflag, int vflag)
   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 dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;  
+  double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;
   double c,s,p,sx2,sy2,sz2;
   double cccpsss,cssmscc,exp2;
 
@@ -110,7 +110,7 @@ void DihedralCosineShiftExp::compute(int eflag, int vflag)
     vb3y = x[i4][1] - x[i3][1];
     vb3z = x[i4][2] - x[i3][2];
     domain->minimum_image(vb3x,vb3y,vb3z);
-    
+
     // c,s calculation
 
     ax = vb1y*vb2zm - vb1z*vb2ym;
@@ -124,7 +124,7 @@ void DihedralCosineShiftExp::compute(int eflag, int vflag)
     rbsq = bx*bx + by*by + bz*bz;
     rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
     rg = sqrt(rgsq);
-    
+
     rginv = ra2inv = rb2inv = 0.0;
     if (rg > 0) rginv = 1.0/rg;
     if (rasq > 0) ra2inv = 1.0/rasq;
@@ -140,28 +140,28 @@ void DihedralCosineShiftExp::compute(int eflag, int vflag)
       int me;
       MPI_Comm_rank(world,&me);
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
-		me,update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+                me,update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-    
+
     double aa=a[type];
     double uumin=umin[type];
-    
+
     cccpsss = c*cost[type]+s*sint[type];
     cssmscc = c*sint[type]-s*cost[type];
 
@@ -185,7 +185,7 @@ void DihedralCosineShiftExp::compute(int eflag, int vflag)
     hgb = hg*rb2inv*rginv;
     gaa = -ra2inv*rg;
     gbb = rb2inv*rg;
-    
+
     dtfx = gaa*ax;
     dtfy = gaa*ay;
     dtfz = gaa*az;
@@ -195,7 +195,7 @@ void DihedralCosineShiftExp::compute(int eflag, int vflag)
     dthx = gbb*bx;
     dthy = gbb*by;
     dthz = gbb*bz;
-        
+
     sx2 = df*dtgx;
     sy2 = df*dtgy;
     sz2 = df*dtgz;
@@ -244,7 +244,7 @@ void DihedralCosineShiftExp::compute(int eflag, int vflag)
 
     if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,edihedral,f1,f3,f4,
-	       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+               vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
   }
 }
 
@@ -302,7 +302,7 @@ void DihedralCosineShiftExp::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void DihedralCosineShiftExp::write_restart(FILE *fp)
@@ -315,14 +315,14 @@ void DihedralCosineShiftExp::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void DihedralCosineShiftExp::read_restart(FILE *fp)
 {
   allocate();
 
-  if (comm->me == 0) { 
+  if (comm->me == 0) {
     fread(&umin[1],sizeof(double),atom->ndihedraltypes,fp);
     fread(&a[1],sizeof(double),atom->ndihedraltypes,fp);
     fread(&cost[1],sizeof(double),atom->ndihedraltypes,fp);
@@ -334,7 +334,7 @@ void DihedralCosineShiftExp::read_restart(FILE *fp)
   MPI_Bcast(&cost[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
   MPI_Bcast(&sint[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
   MPI_Bcast(&theta[1],atom->ndihedraltypes,MPI_DOUBLE,0,world);
- 
+
   for (int i = 1; i <= atom->ndihedraltypes; i++) {
     setflag[i] = 1;
     doExpansion[i]=(fabs(a[i])<0.01);
diff --git a/src/USER-MISC/dihedral_cosine_shift_exp.h b/src/USER-MISC/dihedral_cosine_shift_exp.h
index 3e77bf4914..62008e425b 100644
--- a/src/USER-MISC/dihedral_cosine_shift_exp.h
+++ b/src/USER-MISC/dihedral_cosine_shift_exp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/dihedral_table.cpp b/src/USER-MISC/dihedral_table.cpp
index b493cc68bf..89d4b6e39d 100644
--- a/src/USER-MISC/dihedral_table.cpp
+++ b/src/USER-MISC/dihedral_table.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -90,19 +90,19 @@ void DihedralTable::compute(int eflag, int vflag)
   // The dihedral angle "phi" is the angle between n123 and n234
   // the planes defined by atoms i1,i2,i3, and i2,i3,i4.
   //
-  // Definitions of vectors: vb12, vb23, vb34, perp12on23 
+  // Definitions of vectors: vb12, vb23, vb34, perp12on23
   //                         proj12on23, perp43on32, proj43on32
   //
   //  Note: The positions of the 4 atoms are labeled x[i1], x[i2], x[i3], x[i4]
   //        (which are also vectors)
   //
-  //             proj12on23                          proj34on23          
-  //             --------->                         ----------->         
-  //                           .                                         
-  //                          .                                          
-  //                         .                                  
-  //                  x[i2] .                       x[i3]                 
-  //    .                __@----------vb23-------->@ . . . .           . 
+  //             proj12on23                          proj34on23
+  //             --------->                         ----------->
+  //                           .
+  //                          .
+  //                         .
+  //                  x[i2] .                       x[i3]
+  //    .                __@----------vb23-------->@ . . . .           .
   //   /|\                /|                        \                  |
   //    |                /                           \                 |
   //    |               /                             \                |
@@ -115,9 +115,9 @@ void DihedralTable::compute(int eflag, int vflag)
   //    |        /                                           \         |
   //            @                                             \        |
   //                                                          _\|     \|/
-  //         x[i1]                                              @     
-  //                                                           
-  //                                                           x[i4]   
+  //         x[i1]                                              @
+  //
+  //                                                           x[i4]
   //
 
   double vb12[g_dim]; // displacement vector from atom i1 towards atom i2
@@ -159,11 +159,11 @@ void DihedralTable::compute(int eflag, int vflag)
     //
 
     // Phi() calculates the dihedral angle.
-    // This function also calculates the vectors: 
+    // This function also calculates the vectors:
     // vb12, vb23, vb34, n123, and n234, which we will need later.
 
 
-    double phi = Phi(x[i1], x[i2], x[i3], x[i4], domain, 
+    double phi = Phi(x[i1], x[i2], x[i3], x[i4], domain,
                      vb12, vb23, vb34, n123, n234);
 
 
@@ -171,7 +171,7 @@ void DihedralTable::compute(int eflag, int vflag)
     //
     // Gradient variables:
     //
-    // dphi_dx1, dphi_dx2, dphi_dx3, dphi_dx4 are the gradients of phi with 
+    // dphi_dx1, dphi_dx2, dphi_dx3, dphi_dx4 are the gradients of phi with
     // respect to the atomic positions of atoms i1, i2, i3, i4, respectively.
     // As an example, consider dphi_dx1.  The d'th element is:
     double dphi_dx1[g_dim]; //                 d phi
@@ -223,8 +223,8 @@ void DihedralTable::compute(int eflag, int vflag)
 
     // --- Compute the gradient vectors dphi/dx2 and dphi/dx3: ---
     //
-    // This is more tricky because atoms 2 and 3 are shared by both planes 
-    // 123 and 234 (the angle between which defines "phi").  Moving either 
+    // This is more tricky because atoms 2 and 3 are shared by both planes
+    // 123 and 234 (the angle between which defines "phi").  Moving either
     // one of these atoms effects both the 123 and 234 planes
     // Both the 123 and 234 planes intersect with the plane perpendicular to the
     // central bond axis (vb23).  The two lines where these intersections occur
@@ -257,9 +257,9 @@ void DihedralTable::compute(int eflag, int vflag)
 
     for (int d=0; d < g_dim; ++d) {
       // Recall that the n123 and n234 plane normal vectors are proportional to
-      // the dphi/dx1 and dphi/dx2 gradients vectors 
+      // the dphi/dx1 and dphi/dx2 gradients vectors
       // It turns out we can save slightly more CPU cycles by expressing
-      // dphi/dx2 and dphi/dx3 as linear combinations of dphi/dx1 and dphi/dx2 
+      // dphi/dx2 and dphi/dx3 as linear combinations of dphi/dx1 and dphi/dx2
       // which we computed already (instead of n123 & n234).
       dphi_dx2[d] = dphi123_dx2_coef*dphi_dx1[d] + dphi234_dx2_coef*dphi_dx4[d];
       dphi_dx3[d] = dphi123_dx3_coef*dphi_dx1[d] + dphi234_dx3_coef*dphi_dx4[d];
@@ -274,7 +274,7 @@ void DihedralTable::compute(int eflag, int vflag)
     cerr << "  -- testing gradient for dihedral (n="<<n<<") for atoms ("
          << i1 << "," << i2 << "," << i3 << "," << i4 << ") --" << endl;
 
-    PrintGradientComparison(*this, dphi_dx1, dphi_dx2, dphi_dx3, dphi_dx4, 
+    PrintGradientComparison(*this, dphi_dx1, dphi_dx2, dphi_dx3, dphi_dx4,
                             domain, x[i1], x[i2], x[i3], x[i4]);
 
     for (int d=0; d < g_dim; ++d) {
@@ -365,7 +365,7 @@ double DihedralTable::single(int type, int i1, int i2, int i3, int i4)
 
   double **x = atom->x;
 
-  double phi = Phi(x[i1], x[i2], x[i3], x[i4], domain, 
+  double phi = Phi(x[i1], x[i2], x[i3], x[i4], domain,
                    vb12, vb23, vb34, n123, n234);
 
   double u;
@@ -392,7 +392,7 @@ void DihedralTable::allocate()
 
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void DihedralTable::settings(int narg, char **arg)
@@ -404,7 +404,7 @@ void DihedralTable::settings(int narg, char **arg)
   else error->all(FLERR,"Unknown table style in dihedral style table");
 
   tablength = force->inumeric(arg[1]);
-  if (tablength < 3) 
+  if (tablength < 3)
     error->all(FLERR,"Illegal number of dihedral table entries");
   // delete old tables, since cannot just change settings
 
@@ -438,7 +438,7 @@ void DihedralTable::coeff(int narg, char **arg)
 
   int me;
   MPI_Comm_rank(world,&me);
-  tables = (Table *) 
+  tables = (Table *)
     memory->srealloc(tables,(ntables+1)*sizeof(Table), "dihedral:tables");
   Table *tb = &tables[ntables];
   null_table(tb);
@@ -461,11 +461,11 @@ void DihedralTable::coeff(int narg, char **arg)
     if (tb->phifile[i] >= tb->phifile[i+1]) {
       stringstream i_str;
       i_str << i+1;
-      string err_msg = 
+      string err_msg =
         string("Dihedral table values are not increasing (") +
-	string(arg[2]) + string(", ")+i_str.str()+string("th entry)");
+        string(arg[2]) + string(", ")+i_str.str()+string("th entry)");
       if (i==0)
-	err_msg += string("\n(This is probably a mistake with your table format.)\n");
+        err_msg += string("\n(This is probably a mistake with your table format.)\n");
       error->all(FLERR,err_msg.c_str());
     }
   }
@@ -477,7 +477,7 @@ void DihedralTable::coeff(int narg, char **arg)
     if ((phihi - philo) >= 360) {
       string err_msg;
       err_msg = string("Dihedral table angle range must be < 360 degrees (")
-	+string(arg[2]) + string(").");
+        +string(arg[2]) + string(").");
       error->all(FLERR,err_msg.c_str());
     }
   }
@@ -485,7 +485,7 @@ void DihedralTable::coeff(int narg, char **arg)
     if ((phihi - philo) >= TWOPI) {
       string err_msg;
       err_msg = string("Dihedral table angle range must be < 2*PI radians (")
-	+ string(arg[2]) + string(").");
+        + string(arg[2]) + string(").");
       error->all(FLERR,err_msg.c_str());
     }
   }
@@ -505,13 +505,13 @@ void DihedralTable::coeff(int narg, char **arg)
   // We also want the angles to be sorted in increasing order.
   // This messy code fixes these problems with the user's data:
   {
-    double *phifile_tmp = new double [tb->ninput];  //temporary arrays 
+    double *phifile_tmp = new double [tb->ninput];  //temporary arrays
     double *ffile_tmp = new double [tb->ninput];  //used for sorting
     double *efile_tmp = new double [tb->ninput];
 
     // After re-imaging, does the range of angles cross the 0 or 2*PI boundary?
     // If so, find the discontinuity:
-    int i_discontinuity = tb->ninput; 
+    int i_discontinuity = tb->ninput;
     for (int i=0; i < tb->ninput; i++) {
       double phi   = tb->phifile[i];
       // Add a multiple of 2*PI to phi until it lies in the range [0, 2*PI).
@@ -576,27 +576,27 @@ void DihedralTable::coeff(int narg, char **arg)
         double phi = i*TWOPI/tablength;
         double f;
         if ((tabstyle == SPLINE) && (tb->f_unspecified)) {
-          double dU_dphi = 
+          double dU_dphi =
             // (If the user did not specify the forces now, AND the user
-	    //  selected the "spline" option, (as opposed to "linear")
-	    //  THEN the tb->f array is uninitialized, so there's 
-	    //  no point to print out the contents of the tb->f[] array. 
-	    //  Instead, later on, we will calculate the force using the 
-	    //  -cyc_splintD() routine to calculate the derivative of the
-	    //  energy spline, using the energy data (tb->e[]).
+            //  selected the "spline" option, (as opposed to "linear")
+            //  THEN the tb->f array is uninitialized, so there's
+            //  no point to print out the contents of the tb->f[] array.
+            //  Instead, later on, we will calculate the force using the
+            //  -cyc_splintD() routine to calculate the derivative of the
+            //  energy spline, using the energy data (tb->e[]).
             //  To be nice and report something, I do the same thing here.)
             cyc_splintD(tb->phi, tb->e, tb->e2, tablength, TWOPI,phi);
           f = -dU_dphi;
         }
         else
-	  // Otherwise we calculated the tb->f[] array.  Report its contents.
+          // Otherwise we calculated the tb->f[] array.  Report its contents.
           f = tb->f[i];
         if (tb->use_degrees) {
           phi *= 180.0/PI;
-	  // If the user wants degree angle units, we should convert our 
-	  // internal force tables (in energy/radians) to (energy/degrees)
-	  f *= PI/180.0;
-	}
+          // If the user wants degree angle units, we should convert our
+          // internal force tables (in energy/radians) to (energy/degrees)
+          f *= PI/180.0;
+        }
         checkF_file << phi << " " << f << "\n";
       }
       checkF_file.close();
@@ -614,7 +614,7 @@ void DihedralTable::coeff(int narg, char **arg)
   }
   ntables++;
 
-  if (count == 0) 
+  if (count == 0)
     error->all(FLERR,"Illegal dihedral_coeff command");
 
 } //DihedralTable::coeff()
@@ -667,7 +667,7 @@ void DihedralTable::free_table(Table *tb)
   memory->destroy(tb->ffile);
   memory->destroy(tb->e2file);
   memory->destroy(tb->f2file);
-  
+
   memory->destroy(tb->phi);
   memory->destroy(tb->e);
   memory->destroy(tb->de);
@@ -698,7 +698,7 @@ void DihedralTable::read_table(Table *tb, char *file, char *keyword)
   while (1) {
     if (fgets(line,MAXLINE,fp) == NULL) {
       string err_msg=string("Did not find keyword \"")
-	+string(keyword)+string("\" in dihedral table file.");
+        +string(keyword)+string("\" in dihedral table file.");
       error->one(FLERR, err_msg.c_str());
     }
     if (strspn(line," \t\n\r") == strlen(line)) continue;  // blank line
@@ -736,25 +736,25 @@ void DihedralTable::read_table(Table *tb, char *file, char *keyword)
       if (tb->f_unspecified) {
         //sscanf(line,"%d %lg %lg",
         //       &itmp,&tb->phifile[i],&tb->efile[i]);
-	line_ss >> itmp;
-	line_ss >> tb->phifile[i];
-	line_ss >> tb->efile[i];
+        line_ss >> itmp;
+        line_ss >> tb->phifile[i];
+        line_ss >> tb->efile[i];
       }
       else {
         //sscanf(line,"%d %lg %lg %lg",
         //       &itmp,&tb->phifile[i],&tb->efile[i],&tb->ffile[i]);
-	line_ss >> itmp;
-	line_ss >> tb->phifile[i];
-	line_ss >> tb->efile[i];
-	line_ss >> tb->ffile[i];
+        line_ss >> itmp;
+        line_ss >> tb->phifile[i];
+        line_ss >> tb->efile[i];
+        line_ss >> tb->ffile[i];
       }
       if (! line_ss) {
-	stringstream err_msg;
-	err_msg << "Read error in table "<< keyword<<", near line "<<i+1<<"\n"
-	        << "   (Check to make sure the number of colums is correct.)";
-	if ((! tb->f_unspecified) && (i==0))
-	  err_msg << "\n   (This sometimes occurs if users forget to specify the \"NOF\" option.)\n";
-	error->one(FLERR, err_msg.str().c_str());
+        stringstream err_msg;
+        err_msg << "Read error in table "<< keyword<<", near line "<<i+1<<"\n"
+                << "   (Check to make sure the number of colums is correct.)";
+        if ((! tb->f_unspecified) && (i==0))
+          err_msg << "\n   (This sometimes occurs if users forget to specify the \"NOF\" option.)\n";
+        error->one(FLERR, err_msg.str().c_str());
       }
     }
     else //if it is a blank line, then skip it.
@@ -766,7 +766,7 @@ void DihedralTable::read_table(Table *tb, char *file, char *keyword)
 
 /* ----------------------------------------------------------------------
    build spline representation of e,f over entire range of read-in table
-   this function sets these values in e2file,f2file.  
+   this function sets these values in e2file,f2file.
    I also perform a crude check for force & energy consistency.
 ------------------------------------------------------------------------- */
 
@@ -781,7 +781,7 @@ void DihedralTable::spline_table(Table *tb)
     cyc_spline(tb->phifile, tb->ffile, tb->ninput, TWOPI, tb->f2file);
   }
 
-  // CHECK to help make sure the user calculated forces in a way 
+  // CHECK to help make sure the user calculated forces in a way
   // which is grossly numerically consistent with the energy table.
   //  --------------------------------------------------
   //             This is an ugly piece of code
@@ -790,7 +790,7 @@ void DihedralTable::spline_table(Table *tb)
     int num_disagreements = 0;
     for (int i=0; i<tb->ninput; i++) {
 
-      // Calculate what the force should be at the control points 
+      // Calculate what the force should be at the control points
       // by using linear interpolation of the derivatives of the energy:
 
       double phi_i = tb->phifile[i];
@@ -802,14 +802,14 @@ void DihedralTable::spline_table(Table *tb)
         im1 += tb->ninput;
         phi_im1 = tb->phifile[im1] - TWOPI;
       }
-      else 
+      else
         phi_im1 = tb->phifile[im1];
       int ip1 = i+1;
       if (ip1 >= tb->ninput) {
         ip1 -= tb->ninput;
         phi_ip1 = tb->phifile[ip1] + TWOPI;
       }
-      else 
+      else
         phi_ip1 = tb->phifile[ip1];
 
       // Now calculate the midpoints above and below phi_i = tb->phifile[i]
@@ -817,16 +817,16 @@ void DihedralTable::spline_table(Table *tb)
       double phi_hi= 0.5*(phi_i + phi_ip1); //midpoint between phi_i and phi_ip1
 
       // Use a linear approximation to the derivative at these two midpoints
-      double dU_dphi_lo = 
+      double dU_dphi_lo =
         (tb->efile[i] - tb->efile[im1])
-        / 
-	(phi_i - phi_im1);
-      double dU_dphi_hi = 
+        /
+        (phi_i - phi_im1);
+      double dU_dphi_hi =
         (tb->efile[ip1] - tb->efile[i])
-        / 
-	(phi_ip1 - phi_i);
+        /
+        (phi_ip1 - phi_i);
 
-      // Now calculate the derivative at position 
+      // Now calculate the derivative at position
       // phi_i (=tb->phifile[i]) using linear interpolation
 
       double a = (phi_i - phi_lo) / (phi_hi - phi_lo);
@@ -842,7 +842,7 @@ void DihedralTable::spline_table(Table *tb)
       // anything important.  It does not have to be perfect.
       // We are only checking for stupid user errors here.
 
-      if ((f != 0.0) && 
+      if ((f != 0.0) &&
           (tb->ffile[i] != 0.0) &&
           ((f/tb->ffile[i] < 0.5) || (f/tb->ffile[i] > 2.0))) {
         num_disagreements++;
@@ -883,7 +883,7 @@ void DihedralTable::compute_table(Table *tb)
   memory->create(tb->e2,tablength,"dihedral:e2");
   memory->create(tb->f2,tablength,"dihedral:f2");
 
-  // Use cubic spline interpolation to calculate the entries in the 
+  // Use cubic spline interpolation to calculate the entries in the
   // internal table. (This is true regardless...even if tabstyle!=SPLINE.)
   for (int i = 0; i < tablength; i++) {
     double phi = i*tb->delta;
@@ -965,7 +965,7 @@ void DihedralTable::param_extract(Table *tb, char *line)
     //else if (strcmp(word,"EQ") == 0) {
     //  word = strtok(NULL," \t\n\r\f");
     //  tb->theta0 = atof(word);
-    //} 
+    //}
     else {
       string err_msg("Invalid keyword in dihedral angle table parameters");
       err_msg += string(" (") + string(word) + string(")");
@@ -974,7 +974,7 @@ void DihedralTable::param_extract(Table *tb, char *line)
     word = strtok(NULL," \t\n\r\f");
   }
 
-  if (tb->ninput == 0) 
+  if (tb->ninput == 0)
     error->one(FLERR,"Dihedral table parameters did not set N");
 
 } // DihedralTable::param_extract()
@@ -1010,7 +1010,7 @@ void DihedralTable::bcast_table(Table *tb)
   //MPI_Bcast(&tb->theta0,1,MPI_DOUBLE,0,world);
 }
 
- 
+
 namespace LAMMPS_NS {
 namespace DIHEDRAL_TABLE_NS {
 
@@ -1042,7 +1042,7 @@ enum { //GSL status return codes.
 };
 
 
-int 
+int
 solve_cyc_tridiag(
   const double diag[], size_t d_stride,
   const double offdiag[], size_t o_stride,
@@ -1068,7 +1068,7 @@ solve_cyc_tridiag(
 
       /* factor */
 
-      if (N == 1) 
+      if (N == 1)
         {
           x[0] = b[0] / diag[0];
           return GSL_SUCCESS;
@@ -1157,15 +1157,15 @@ solve_cyc_tridiag(
    spline and splint routines modified from Numerical Recipes
 ------------------------------------------------------------------------- */
 
-void cyc_spline(double const *xa, 
-                double const *ya, 
+void cyc_spline(double const *xa,
+                double const *ya,
                 int n,
-                double period, 
+                double period,
                 double *y2a)
 {
 
-  double *diag    = new double[n];   
-  double *offdiag = new double[n];   
+  double *diag    = new double[n];
+  double *offdiag = new double[n];
   double *rhs     = new double[n];
   double xa_im1, xa_ip1;
 
@@ -1175,7 +1175,7 @@ void cyc_spline(double const *xa,
 
   for(int i=0; i < n; i++) {
 
-    // I have to lookup xa[i+1] and xa[i-1].  This gets tricky because of 
+    // I have to lookup xa[i+1] and xa[i-1].  This gets tricky because of
     // periodic boundary conditions.  We handle that now.
     int im1 = i-1;
     if (im1<0) {
@@ -1195,7 +1195,7 @@ void cyc_spline(double const *xa,
 
     // Recall that we want to find the y2a[] parameters (there are n of them).
     // To solve for them, we have a linear equation with n unknowns
-    // (in the cyclic case that is).  For details, the non-cyclic case is 
+    // (in the cyclic case that is).  For details, the non-cyclic case is
     // explained in equation 3.3.7 in Numerical Recipes in C, p. 115.
     diag[i]    = (xa_ip1 - xa_im1) / 3.0;
     offdiag[i] = (xa_ip1 - xa[i]) / 6.0;
@@ -1207,10 +1207,10 @@ void cyc_spline(double const *xa,
   // thousands of rows and columns).  However because this matix happens
   // to be tridiagonal (and cyclic), we can use the following cheap method:
   solve_cyc_tridiag(diag, 1,
-		    offdiag, 1,
-		    rhs, 1,
-		    y2a, 1,
-		    n);
+                    offdiag, 1,
+                    rhs, 1,
+                    y2a, 1,
+                    n);
 
   delete [] diag;
   delete [] offdiag;
@@ -1224,14 +1224,14 @@ void cyc_spline(double const *xa,
 
 // cyc_splint(): Evaluates a spline at position x, with n control
 //           points located at xa[], ya[], and with parameters y2a[]
-//           The xa[] must be monotonically increasing and their 
-//           range should not exceed period (ie xa[n-1] < xa[0] + period).  
+//           The xa[] must be monotonically increasing and their
+//           range should not exceed period (ie xa[n-1] < xa[0] + period).
 //           x must lie in the range:  [(xa[n-1]-period), (xa[0]+period)]
 //           "period" is typically 2*PI.
-double cyc_splint(double const *xa, 
-                  double const *ya, 
-                  double const *y2a, 
-                  int n, 
+double cyc_splint(double const *xa,
+                  double const *ya,
+                  double const *y2a,
+                  int n,
                   double period,
                   double x)
 {
@@ -1260,7 +1260,7 @@ double cyc_splint(double const *xa,
   double h = xhi-xlo;
   double a = (xhi-x) / h;
   double b = (x-xlo) / h;
-  double y = a*ya[klo] + b*ya[khi] + 
+  double y = a*ya[klo] + b*ya[khi] +
     ((a*a*a-a)*y2a[klo] + (b*b*b-b)*y2a[khi]) * (h*h)/6.0;
 
   return y;
@@ -1269,16 +1269,16 @@ double cyc_splint(double const *xa,
 
 
 
-// cyc_splintD(): Evaluate the deriviative of a cyclic spline at position x, 
+// cyc_splintD(): Evaluate the deriviative of a cyclic spline at position x,
 //           with n control points at xa[], ya[], with parameters y2a[].
-//           The xa[] must be monotonically increasing and their 
-//           range should not exceed period (ie xa[n-1] < xa[0] + period).  
+//           The xa[] must be monotonically increasing and their
+//           range should not exceed period (ie xa[n-1] < xa[0] + period).
 //           x must lie in the range:  [(xa[n-1]-period), (xa[0]+period)]
 //           "period" is typically 2*PI.
-double cyc_splintD(double const *xa, 
-                   double const *ya, 
-                   double const *y2a, 
-                   int n, 
+double cyc_splintD(double const *xa,
+                   double const *ya,
+                   double const *y2a,
+                   int n,
                    double period,
                    double x)
 {
@@ -1313,7 +1313,7 @@ double cyc_splintD(double const *xa,
   // Formula below taken from equation 3.3.5 of "numerical recipes in c"
   // "yD" = the derivative of y
   double yD = g/h - ( (3.0*a*a-1.0)*y2a[klo] - (3.0*b*b-1.0)*y2a[khi] ) * h/6.0;
-  // For rerefence: y = a*ylo + b*yhi + 
+  // For rerefence: y = a*ylo + b*yhi +
   //                  ((a*a*a-a)*y2a[klo] + (b*b*b-b)*y2a[khi]) * (h*h)/6.0;
 
   return yD;
diff --git a/src/USER-MISC/dihedral_table.h b/src/USER-MISC/dihedral_table.h
index 12b8ce6a49..4635e127b1 100644
--- a/src/USER-MISC/dihedral_table.h
+++ b/src/USER-MISC/dihedral_table.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -62,7 +62,7 @@ class DihedralTable : public Dihedral {
   int ntables;
   Table *tables;
   int *tabindex;
-  
+
   void allocate();
   void null_table(Table *);
   void free_table(Table *);
@@ -78,7 +78,7 @@ class DihedralTable : public Dihedral {
   // --------------------------------------------
 
   // -----------------------------------------------------------
-  //   uf_lookup() 
+  //   uf_lookup()
   //   quickly calculate the potential u and force f at angle x,
   //   using the internal tables tb->e and tb->f (evenly spaced)
   // -----------------------------------------------------------
@@ -97,24 +97,24 @@ class DihedralTable : public Dihedral {
 
     switch(tabstyle) {
       case LINEAR:
-	u = tb->e[i] + b * tb->de[i];
-	f = tb->f[i] + b * tb->df[i]; //<--works even if tb->f_unspecified==true
-	break;
+        u = tb->e[i] + b * tb->de[i];
+        f = tb->f[i] + b * tb->df[i]; //<--works even if tb->f_unspecified==true
+        break;
       case SPLINE:
-	a = 1.0 - b;
-	u = a * tb->e[i] + b * tb->e[ip1] + 
-	  ((a*a*a-a)*tb->e2[i] + (b*b*b-b)*tb->e2[ip1]) * 
-	  tb->deltasq6;
-	if (tb->f_unspecified)
-	  //Formula below taken from equation3.3.5 of "numerical recipes in c"
-	  //"f"=-derivative of e with respect to x (or "phi" in this case)
-	  f = (tb->e[i]-tb->e[ip1])*tb->invdelta +
-	    ((3.0*a*a-1.0)*tb->e2[i]+(1.0-3.0*b*b)*tb->e2[ip1])*tb->delta/6.0;
-	else
-	  f = a * tb->f[i] + b * tb->f[ip1] + 
-	    ((a*a*a-a)*tb->f2[i] + (b*b*b-b)*tb->f2[ip1]) * 
-	    tb->deltasq6;
-	break;
+        a = 1.0 - b;
+        u = a * tb->e[i] + b * tb->e[ip1] +
+          ((a*a*a-a)*tb->e2[i] + (b*b*b-b)*tb->e2[ip1]) *
+          tb->deltasq6;
+        if (tb->f_unspecified)
+          //Formula below taken from equation3.3.5 of "numerical recipes in c"
+          //"f"=-derivative of e with respect to x (or "phi" in this case)
+          f = (tb->e[i]-tb->e[ip1])*tb->invdelta +
+            ((3.0*a*a-1.0)*tb->e2[i]+(1.0-3.0*b*b)*tb->e2[ip1])*tb->delta/6.0;
+        else
+          f = a * tb->f[i] + b * tb->f[ip1] +
+            ((a*a*a-a)*tb->f2[i] + (b*b*b-b)*tb->f2[ip1]) *
+            tb->deltasq6;
+        break;
     } // switch(tabstyle)
   } // uf_lookup()
 
@@ -143,10 +143,10 @@ class DihedralTable : public Dihedral {
     }
     else if (tabstyle == SPLINE) {
       double a = 1.0 - b;
-      u = a * tb->e[i] + b * tb->e[ip1] + 
-        ((a*a*a-a)*tb->e2[i] + (b*b*b-b)*tb->e2[ip1]) * 
+      u = a * tb->e[i] + b * tb->e[ip1] +
+        ((a*a*a-a)*tb->e2[i] + (b*b*b-b)*tb->e2[ip1]) *
         tb->deltasq6;
-    } 
+    }
   } // u_lookup()
 
 
@@ -171,8 +171,8 @@ class DihedralTable : public Dihedral {
 
 
 // ------------------------------------------------------------------------
-// The following auxiliary functions were left out of the 
-// DihedralTable class either because they require template parameters, 
+// The following auxiliary functions were left out of the
+// DihedralTable class either because they require template parameters,
 // or because they have nothing to do with dihedral angles.
 // ------------------------------------------------------------------------
 
@@ -184,37 +184,37 @@ static const double TWOPI = 6.2831853071795862;
 // Determine the array of "y2" parameters of a cyclic spline from its control
 // points at positions x[] and y[]. (spline() must be invoked before splint())
 // The x[] positions should be sorted in order and not exceed period.
-void    cyc_spline(double const *xa, double const *ya, int n, 
+void    cyc_spline(double const *xa, double const *ya, int n,
                    double period, double *y2a);
 
 // Evaluate a cyclic spline at position x with n control points at xa[], ya[],
 // (The y2a array must be calculated using cyc_spline() above in advance.)
 // x (and all the xa[] positions) should lie in the range from 0 to period.
 // (Typically period = 2*PI, but this is optional.)
-double  cyc_splint(double const *xa, double const *ya, double const *y2a, 
+double  cyc_splint(double const *xa, double const *ya, double const *y2a,
                    int n, double period, double x);
 
 // Evaluate the deriviative of a cyclic spline at position x:
-double cyc_splintD(double const *xa, double const *ya, double const *y2a, 
+double cyc_splintD(double const *xa, double const *ya, double const *y2a,
                    int n, double period, double x);
 
 // -----------------------------------------------------------
 // ----  some simple vector operations are defined below. ----
 // -----------------------------------------------------------
 
-//  --- g_dim ---   As elsewhere in the LAMMPS code, coordinates here are 
+//  --- g_dim ---   As elsewhere in the LAMMPS code, coordinates here are
 // represented as entries in an array, not as named variables "x" "y" "z".
-// (I like this style.)  In this spirit, the vector operations here are 
-// defined for vectors of arbitrary size.  For this to work, the number 
+// (I like this style.)  In this spirit, the vector operations here are
+// defined for vectors of arbitrary size.  For this to work, the number
 // of dimensions, "g_dim", must be known at compile time:
 const int g_dim = 3;
-// In LAMMPS at least, this constant is always 3, and is only used inside 
+// In LAMMPS at least, this constant is always 3, and is only used inside
 // the dihedral code here.  (It should not conflict with 2-D simulations.)
 // Note: Compiler optimizations should eliminate any performance overhead
 //       associated with loops like "for (int i=0; i<g_dim; i++)"
 // If having a constant named "g_dim" is confusing people, I suppose
-// we can replace it with "3".  Note: the supplemental file 
-// "nd/dihedral_table_nd_mod.h" shows how to generalize the dihedral 
+// we can replace it with "3".  Note: the supplemental file
+// "nd/dihedral_table_nd_mod.h" shows how to generalize the dihedral
 // code in higher dimensions.
 
 template<class _Real>
@@ -229,7 +229,7 @@ DotProduct(_Real const *A, _Real const *B)
 
 // Normalize() divides the components of the vector "v" by it's length.
 // Normalize() silently ignores divide-by-zero errors but does not
-// crash.  (If "v" has length 0, then we replace v with the unit vector in 
+// crash.  (If "v" has length 0, then we replace v with the unit vector in
 // an arbitrary direction,(1,0,...).)
 // It returns the length of v (useful for checking if the operation succeeded).
 template<class _Real>
@@ -240,19 +240,19 @@ Normalize(_Real *v)
   if (length != 0.0)
   {
     _Real one_over_length = 1.0 / length;
-    for (int d=0; d < g_dim; ++d) 
+    for (int d=0; d < g_dim; ++d)
       v[d] *= one_over_length;
   }
   else {
     v[0] = 1.0;
-    for (int d=1; d < g_dim; ++d) 
+    for (int d=1; d < g_dim; ++d)
       v[d] = 0.0;
   }
   return length;
 }
 
 
-// CrossProduct(A,B,dest) computes the cross-product (A x B) 
+// CrossProduct(A,B,dest) computes the cross-product (A x B)
 // and stores the result in "dest".
 template<class _Real>
 inline void
@@ -272,7 +272,7 @@ inline double Phi(double const *x1, //array holding x,y,z coords atom 1
                   double const *x2, // :       :      :      :        2
                   double const *x3, // :       :      :      :        3
                   double const *x4, // :       :      :      :        4
-		  Domain *domain, //<-periodic boundary information
+                  Domain *domain, //<-periodic boundary information
                   // The following arrays are of doubles with g_dim elements.
                   // (g_dim is a constant known at compile time, usually 3).
                   // Their contents is calculated by this function.
diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp
index dd9ef8ffc4..9d0d621fe7 100644
--- a/src/USER-MISC/fix_addtorque.cpp
+++ b/src/USER-MISC/fix_addtorque.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -75,7 +75,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) :
     zvalue = atof(arg[5]);
     zstyle = CONSTANT;
   }
-  
+
   force_flag = 0;
   foriginal[0] = foriginal[1] = foriginal[2] = foriginal[3] = 0.0;
 }
@@ -167,7 +167,7 @@ void FixAddTorque::post_force(int vflag)
   double *rmass = atom->rmass;
   int nlocal = atom->nlocal;
   double mvv2e = force->mvv2e;
-  
+
   int xbox,ybox,zbox;
   double dx,dy,dz,vx,vy,vz,fx,fy,fz,massone,omegadotr;
   double xprd = domain->xprd;
@@ -180,7 +180,7 @@ void FixAddTorque::post_force(int vflag)
   // foriginal[123] = torque on atoms before extra force added
   foriginal[0] = foriginal[1] = foriginal[2] = foriginal[3] = 0.0;
   force_flag = 0;
-  
+
   if (varflag == EQUAL) {
     // variable torque, wrap with clear/add
     modify->clearstep_compute();
@@ -189,7 +189,7 @@ void FixAddTorque::post_force(int vflag)
     if (zstyle == EQUAL) zvalue = input->variable->compute_equal(zvar);
     modify->addstep_compute(update->ntimestep + 1);
   }
-  
+
   atom->check_mass();
   double masstotal = group->mass(igroup);
   group->xcm(igroup,masstotal,xcm);
@@ -214,12 +214,12 @@ void FixAddTorque::post_force(int vflag)
       tlocal[2] += massone * omegadotr * (dx*omega[1] - dy*omega[0]);
     }
   MPI_Allreduce(tlocal,itorque,3,MPI_DOUBLE,MPI_SUM,world);
-  
+
   tcm[0] = xvalue - mvv2e*itorque[0];
   tcm[1] = yvalue - mvv2e*itorque[1];
   tcm[2] = zvalue - mvv2e*itorque[2];
   group->omega(tcm,inertia,domegadt);
-  
+
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       xbox = (image[i] & 1023) - 512;
@@ -236,7 +236,7 @@ void FixAddTorque::post_force(int vflag)
       fx = massone * (dz*domegadt[1]-dy*domegadt[2] + vz*omega[1]-vy*omega[2]);
       fy = massone * (dx*domegadt[2]-dz*domegadt[0] + vx*omega[2]-vz*omega[0]);
       fz = massone * (dy*domegadt[0]-dx*domegadt[1] + vy*omega[0]-vx*omega[1]);
-      
+
       // potential energy = - x dot f
       foriginal[0] -= fx*x[i][0] + fy*x[i][1] + fz*x[i][2];
       foriginal[1] += dy*f[i][2] - dz*f[i][1];
diff --git a/src/USER-MISC/fix_addtorque.h b/src/USER-MISC/fix_addtorque.h
index 238ed9f164..08438ef91d 100644
--- a/src/USER-MISC/fix_addtorque.h
+++ b/src/USER-MISC/fix_addtorque.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/fix_imd.cpp b/src/USER-MISC/fix_imd.cpp
index 48606876f0..69379c0f52 100644
--- a/src/USER-MISC/fix_imd.cpp
+++ b/src/USER-MISC/fix_imd.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -13,37 +13,37 @@
 
 /* ----------------------------------------------------------------------
    The FixIMD class contains code from VMD and NAMD which is copyrighted
-   by the Board of Trustees of the University of Illinois and is free to 
+   by the Board of Trustees of the University of Illinois and is free to
    use with LAMMPS according to point 2 of the UIUC license (10% clause):
 
-" Licensee may, at its own expense, create and freely distribute 
-complimentary works that interoperate with the Software, directing others to 
-the TCBG server to license and obtain the Software itself. Licensee may, at 
-its own expense, modify the Software to make derivative works.  Except as 
-explicitly provided below, this License shall apply to any derivative work 
-as it does to the original Software distributed by Illinois.  Any derivative 
-work should be clearly marked and renamed to notify users that it is a 
-modified version and not the original Software distributed by Illinois.  
-Licensee agrees to reproduce the copyright notice and other proprietary 
-markings on any derivative work and to include in the documentation of such 
+" Licensee may, at its own expense, create and freely distribute
+complimentary works that interoperate with the Software, directing others to
+the TCBG server to license and obtain the Software itself. Licensee may, at
+its own expense, modify the Software to make derivative works.  Except as
+explicitly provided below, this License shall apply to any derivative work
+as it does to the original Software distributed by Illinois.  Any derivative
+work should be clearly marked and renamed to notify users that it is a
+modified version and not the original Software distributed by Illinois.
+Licensee agrees to reproduce the copyright notice and other proprietary
+markings on any derivative work and to include in the documentation of such
 work the acknowledgement:
 
- "This software includes code developed by the Theoretical and Computational 
-  Biophysics Group in the Beckman Institute for Advanced Science and 
+ "This software includes code developed by the Theoretical and Computational
+  Biophysics Group in the Beckman Institute for Advanced Science and
   Technology at the University of Illinois at Urbana-Champaign."
 
-Licensee may redistribute without restriction works with up to 1/2 of their 
-non-comment source code derived from at most 1/10 of the non-comment source 
-code developed by Illinois and contained in the Software, provided that the 
-above directions for notice and acknowledgement are observed.  Any other 
-distribution of the Software or any derivative work requires a separate 
-license with Illinois.  Licensee may contact Illinois (vmd@ks.uiuc.edu) to 
+Licensee may redistribute without restriction works with up to 1/2 of their
+non-comment source code derived from at most 1/10 of the non-comment source
+code developed by Illinois and contained in the Software, provided that the
+above directions for notice and acknowledgement are observed.  Any other
+distribution of the Software or any derivative work requires a separate
+license with Illinois.  Licensee may contact Illinois (vmd@ks.uiuc.edu) to
 negotiate an appropriate license for such distribution."
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
    Contributing author:  Axel Kohlmeyer (TempleU)
-   IMD API, hash, and socket code written by: John E. Stone, 
+   IMD API, hash, and socket code written by: John E. Stone,
    Justin Gullingsrud, and James Phillips, (TCBG, Beckman Institute, UIUC)
 ------------------------------------------------------------------------- */
 
@@ -124,7 +124,7 @@ static int inthash(const inthash_t *tptr, int key) {
   hashvalue = (((key*1103515249)>>tptr->downshift) & tptr->mask);
   if (hashvalue < 0) {
     hashvalue = 0;
-  }    
+  }
 
   return hashvalue;
 }
@@ -224,15 +224,15 @@ int *inthash_keys(inthash_t *tptr) {
 
   int *keys;
   inthash_node_t *node;
-  
+
   keys = (int *)calloc(tptr->entries, sizeof(int));
-  
+
   for (int i=0; i < tptr->size; ++i) {
     for (node=tptr->bucket[i]; node != NULL; node=node->next) {
       keys[node->data] = node->key;
     }
   }
-  
+
   return keys;
 }
 
@@ -271,7 +271,7 @@ int inthash_insert(inthash_t *tptr, int key, int data) {
 
 /*
  * inthash_destroy() - Delete the entire table, and all remaining entries.
- * 
+ *
  */
 void inthash_destroy(inthash_t *tptr) {
   inthash_node_t *node, *last;
@@ -279,12 +279,12 @@ void inthash_destroy(inthash_t *tptr) {
 
   for (i=0; i<tptr->size; i++) {
     node = tptr->bucket[i];
-    while (node != NULL) { 
-      last = node;   
+    while (node != NULL) {
+      last = node;
       node = node->next;
       free(last);
     }
-  }     
+  }
 
   /* free the entire array of buckets */
   if (tptr->bucket != NULL) {
@@ -432,22 +432,22 @@ using namespace LAMMPS_NS;
 using namespace FixConst;
 
 /* struct for packed data communication of coordinates and forces. */
-struct commdata { 
-  int tag; 
-  float x,y,z; 
+struct commdata {
+  int tag;
+  float x,y,z;
 };
 
 /***************************************************************
- * create class and parse arguments in LAMMPS script. Syntax: 
- * fix ID group-ID imd <imd_trate> <imd_port> [unwrap (on|off)] [fscale <imd_fscale>] 
+ * create class and parse arguments in LAMMPS script. Syntax:
+ * fix ID group-ID imd <imd_trate> <imd_port> [unwrap (on|off)] [fscale <imd_fscale>]
  ***************************************************************/
 FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg < 4) 
+  if (narg < 4)
     error->all(FLERR,"Illegal fix imd command");
 
-  imd_port = atoi(arg[3]); 
+  imd_port = atoi(arg[3]);
   if (imd_port < 1024)
     error->all(FLERR,"Illegal fix imd parameter: port < 1024");
 
@@ -457,18 +457,18 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) :
   connect_msg = 1;
   imd_fscale = 1.0;
   imd_trate = 1;
-  
+
   /* parse optional arguments */
   int argsdone = 4;
   while (argsdone+1 < narg) {
     if (0 == strcmp(arg[argsdone], "unwrap")) {
-      if (0 == strcmp(arg[argsdone+1], "on")) {  
+      if (0 == strcmp(arg[argsdone+1], "on")) {
         unwrap_flag = 1;
       } else {
         unwrap_flag = 0;
       }
     } else if (0 == strcmp(arg[argsdone], "nowait")) {
-      if (0 == strcmp(arg[argsdone+1], "on")) {  
+      if (0 == strcmp(arg[argsdone+1], "on")) {
         nowait_flag = 1;
       } else {
         nowait_flag = 0;
@@ -507,7 +507,7 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) :
   comm_buf = NULL;
   idmap = NULL;
   rev_idmap = NULL;
-  
+
   if (me == 0) {
     /* set up incoming socket on MPI rank 0. */
     imdsock_init();
@@ -524,7 +524,7 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) :
   MPI_Bcast(&imd_terminate, 1, MPI_INT, 0, world);
   if (imd_terminate)
     error->all(FLERR,"LAMMPS Terminated on error in IMD.");
-    
+
   /* storage required to communicate a single coordinate or force. */
   size_one = sizeof(struct commdata);
 
@@ -618,7 +618,7 @@ int FixIMD::reconnect()
   /* set up IMD communication, but only if needed. */
   imd_inactive = 0;
   imd_terminate = 0;
-  
+
   if (me == 0) {
     if (clientsock) return 1;
     if (screen && connect_msg)
@@ -626,7 +626,7 @@ int FixIMD::reconnect()
         fprintf(screen,"Listening for IMD connection on port %d. Transfer rate %d.\n",imd_port, imd_trate);
       else
         fprintf(screen,"Waiting for IMD connection on port %d. Transfer rate %d.\n",imd_port, imd_trate);
-    
+
     connect_msg = 0;
     clientsock = NULL;
     if (nowait_flag) {
@@ -644,7 +644,7 @@ int FixIMD::reconnect()
       } while (retval <= 0);
       clientsock = imdsock_accept(localsock);
     }
-    
+
     if (!imd_inactive && !clientsock) {
       if (screen)
         fprintf(screen, "IMD socket accept error. Dropping connection.\n");
@@ -677,7 +677,7 @@ int FixIMD::reconnect()
 }
 
 /* ---------------------------------------------------------------------- */
-/* wait for IMD client (e.g. VMD) to respond, initialize communication 
+/* wait for IMD client (e.g. VMD) to respond, initialize communication
  * buffers and collect tag/id maps. */
 void FixIMD::setup(int)
 {
@@ -709,7 +709,7 @@ void FixIMD::setup(int)
   inthash_t *hashtable=new inthash_t;
   inthash_init(hashtable, num_coords);
   idmap = (void *)hashtable;
-  
+
   MPI_Status status;
   MPI_Request request;
   int tmp, ndata;
@@ -718,14 +718,14 @@ void FixIMD::setup(int)
   if (me == 0) {
     int *taglist = new int[num_coords];
     int numtag=0; /* counter to map atom tags to a 0-based consecutive index list */
-    
+
     for (i=0; i < nlocal; ++i) {
       if (mask[i] & groupbit) {
         taglist[numtag] = tag[i];
         ++numtag;
       }
     }
-    
+
     /* loop over procs to receive remote data */
     for (i=1; i < comm->nprocs; ++i) {
       MPI_Irecv(comm_buf, maxbuf, MPI_BYTE, i, 0, world, &request);
@@ -740,7 +740,7 @@ void FixIMD::setup(int)
       }
     }
 
-    /* sort list of tags by value to have consistently the 
+    /* sort list of tags by value to have consistently the
      * same list when running in parallel and build hash table. */
     id_sort(taglist, 0, num_coords-1);
     for (i=0; i < num_coords; ++i) {
@@ -748,7 +748,7 @@ void FixIMD::setup(int)
     }
     delete[] taglist;
 
-    /* generate reverse index-to-tag map for communicating 
+    /* generate reverse index-to-tag map for communicating
      * IMD forces back to the proper atoms */
     rev_idmap=inthash_keys(hashtable);
   } else {
@@ -763,7 +763,7 @@ void FixIMD::setup(int)
     MPI_Recv(&tmp, 0, MPI_INT, 0, 0, world, &status);
     MPI_Rsend(comm_buf, nme*size_one, MPI_BYTE, 0, 0, world);
   }
-  
+
   return;
 }
 
@@ -834,7 +834,7 @@ void FixIMD::post_force(int vflag)
     while ((imdsock_selread(clientsock, 0) > 0) || imd_paused) {
       /* if something requested to turn off IMD while paused get out */
       if (imd_inactive) break;
-      
+
       int32 length;
       int msg = imd_recv_header(clientsock, &length);
 
@@ -881,7 +881,7 @@ void FixIMD::post_force(int vflag)
         case IMD_PAUSE:
           /* pause the running simulation. wait for second IMD_PAUSE to continue. */
           if (imd_paused) {
-            if (screen) 
+            if (screen)
               fprintf(screen, "Continuing run on IMD client request.\n");
             imd_paused = 0;
           } else {
@@ -893,9 +893,9 @@ void FixIMD::post_force(int vflag)
 
         case IMD_TRATE:
           /* change the IMD transmission data rate */
-          if (length > 0) 
+          if (length > 0)
             imd_trate = length;
-          if (screen) 
+          if (screen)
             fprintf(screen, "IMD client requested change of transfer rate. Now it is %d.\n", imd_trate);
           break;
 
@@ -904,7 +904,7 @@ void FixIMD::post_force(int vflag)
           imd_recv_energies(clientsock, &dummy_energies);
           break;
         }
-            
+
         case IMD_FCOORDS: {
           float *dummy_coords = new float[3*length];
           imd_recv_fcoords(clientsock, length, dummy_coords);
@@ -924,7 +924,7 @@ void FixIMD::post_force(int vflag)
           }
           imd_forces = length;
           buf = static_cast<struct commdata *>(force_buf);
-          
+
           /* compare data to hash table */
           for (int ii=0; ii < length; ++ii) {
             buf[ii].tag = rev_idmap[imd_tags[ii]];
@@ -936,7 +936,7 @@ void FixIMD::post_force(int vflag)
           delete[] imd_fdat;
           break;
         }
-            
+
         default:
           if (screen)
             fprintf(screen, "Unhandled incoming IMD message #%d. length=%d\n", msg, length);
@@ -944,11 +944,11 @@ void FixIMD::post_force(int vflag)
       }
     }
   }
-  
+
   /* update all tasks with current settings. */
   int old_imd_forces = imd_forces;
   MPI_Bcast(&imd_trate, 1, MPI_INT, 0, world);
-  MPI_Bcast(&imd_inactive, 1, MPI_INT, 0, world);  
+  MPI_Bcast(&imd_inactive, 1, MPI_INT, 0, world);
   MPI_Bcast(&imd_forces, 1, MPI_INT, 0, world);
   MPI_Bcast(&imd_terminate, 1, MPI_INT, 0, world);
   if (imd_terminate)
@@ -958,7 +958,7 @@ void FixIMD::post_force(int vflag)
     /* check if we need to readjust the forces comm buffer on the receiving nodes. */
     if (me != 0) {
       if (old_imd_forces < imd_forces) { /* grow holding space for forces, if needed. */
-        if (force_buf != NULL) 
+        if (force_buf != NULL)
           memory->sfree(force_buf);
         force_buf = memory->smalloc(imd_forces*size_one, "imd:force_buf");
       }
@@ -971,16 +971,16 @@ void FixIMD::post_force(int vflag)
    * at the expense of a more jumpy display. Rather than using
    * end_of_step() we do everything here in one go.
    *
-   * If we don't communicate, only check if we have forces 
+   * If we don't communicate, only check if we have forces
    * stored away and apply them. */
   if (update->ntimestep % imd_trate) {
     if (imd_forces > 0) {
       double **f = atom->f;
       buf = static_cast<struct commdata *>(force_buf);
 
-      /* XXX. this is in principle O(N**2) == not good. 
-       * however we assume for now that the number of atoms 
-       * that we manipulate via IMD will be small compared 
+      /* XXX. this is in principle O(N**2) == not good.
+       * however we assume for now that the number of atoms
+       * that we manipulate via IMD will be small compared
        * to the total system size, so we don't hurt too much. */
       for (int j=0; j < imd_forces; ++j) {
         for (int i=0; i < nlocal; ++i) {
@@ -996,7 +996,7 @@ void FixIMD::post_force(int vflag)
     }
     return;
   }
-  
+
   /* check and potentially grow local communication buffers. */
   int i, k, nmax, nme=0;
   for (i=0; i < nlocal; ++i)
@@ -1013,7 +1013,7 @@ void FixIMD::post_force(int vflag)
   MPI_Request request;
   int tmp, ndata;
   buf = static_cast<struct commdata *>(comm_buf);
-  
+
   if (me == 0) {
     /* collect data into new array. we bypass the IMD API to save
      * us one extra copy of the data. */
@@ -1072,7 +1072,7 @@ void FixIMD::post_force(int vflag)
       MPI_Wait(&request, &status);
       MPI_Get_count(&status, MPI_BYTE, &ndata);
       ndata /= size_one;
-      
+
       for (k=0; k<ndata; ++k) {
         const int j = 3*inthash_lookup((inthash_t *)idmap, buf[k].tag);
         if (j != HASH_FAIL) {
@@ -1169,12 +1169,12 @@ double FixIMD::memory_usage(void)
 /***************************************************************************/
 
 /* NOTE: the following code is the based on the example implementation
- * of the IMD protocol API from VMD and NAMD. The UIUC license allows 
+ * of the IMD protocol API from VMD and NAMD. The UIUC license allows
  * to re-use up to 10% of a project's code to be used in other software */
 
 /***************************************************************************
  * DESCRIPTION:
- *   Socket interface, abstracts machine dependent APIs/routines. 
+ *   Socket interface, abstracts machine dependent APIs/routines.
  ***************************************************************************/
 
 int imdsock_init(void) {
@@ -1190,7 +1190,7 @@ int imdsock_init(void) {
   }
 
   return rc;
-#else   
+#else
   return 0;
 #endif
 }
@@ -1201,7 +1201,7 @@ void * imdsock_create(void) {
 
   s = (imdsocket *) malloc(sizeof(imdsocket));
   if (s != NULL)
-    memset(s, 0, sizeof(imdsocket)); 
+    memset(s, 0, sizeof(imdsocket));
 
   if ((s->sd = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
     printf("Failed to open socket.");
@@ -1214,7 +1214,7 @@ void * imdsock_create(void) {
 
 int imdsock_bind(void * v, int port) {
   imdsocket *s = (imdsocket *) v;
-  memset(&(s->addr), 0, sizeof(s->addr)); 
+  memset(&(s->addr), 0, sizeof(s->addr));
   s->addr.sin_family = PF_INET;
   s->addr.sin_port = htons(port);
 
@@ -1296,7 +1296,7 @@ void imdsock_destroy(void * v) {
 #else
   close(s->sd);
 #endif
-  free(s);  
+  free(s);
 }
 
 int imdsock_selread(void *v, int sec) {
@@ -1304,9 +1304,9 @@ int imdsock_selread(void *v, int sec) {
   fd_set rfd;
   struct timeval tv;
   int rc;
- 
+
   if (v == NULL) return 0;
-  
+
   FD_ZERO(&rfd);
   FD_SET(s->sd, &rfd);
   memset((void *)&tv, 0, sizeof(struct timeval));
@@ -1317,13 +1317,13 @@ int imdsock_selread(void *v, int sec) {
   return rc;
 
 }
-  
+
 int imdsock_selwrite(void *v, int sec) {
   imdsocket *s = (imdsocket *)v;
   fd_set wfd;
   struct timeval tv;
   int rc;
- 
+
   if (v == NULL) return 0;
 
   FD_ZERO(&wfd);
@@ -1394,7 +1394,7 @@ static void swap_header(IMDheader *header) {
 static int32 imd_readn(void *s, char *ptr, int32 n) {
   int32 nleft;
   int32 nread;
- 
+
   nleft = n;
   while (nleft > 0) {
     if ((nread = imdsock_read(s, ptr, nleft)) < 0) {
@@ -1449,7 +1449,7 @@ IMDType imd_recv_header(void *s, int32 *length) {
     return IMD_IOERROR;
   swap_header(&header);
   *length = header.length;
-  return IMDType(header.type); 
+  return IMDType(header.type);
 }
 
 int imd_recv_mdcomm(void *s, int32 n, int32 *indices, float *forces) {
@@ -1474,4 +1474,3 @@ int imd_recv_fcoords(void *s, int32 n, float *coords) {
 // fill-column: 76
 // indent-tabs-mode: nil
 // End:
-
diff --git a/src/USER-MISC/fix_imd.h b/src/USER-MISC/fix_imd.h
index a7c3cb36eb..379742fb4d 100644
--- a/src/USER-MISC/fix_imd.h
+++ b/src/USER-MISC/fix_imd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -13,31 +13,31 @@
 
 /* ----------------------------------------------------------------------
    The FixIMD class contains code from VMD and NAMD which is copyrighted
-   by the Board of Trustees of the University of Illinois and is free to 
+   by the Board of Trustees of the University of Illinois and is free to
    use with LAMMPS according to point 2 of the UIUC license (10% clause):
 
-" Licensee may, at its own expense, create and freely distribute 
-complimentary works that interoperate with the Software, directing others to 
-the TCBG server to license and obtain the Software itself. Licensee may, at 
-its own expense, modify the Software to make derivative works.  Except as 
-explicitly provided below, this License shall apply to any derivative work 
-as it does to the original Software distributed by Illinois.  Any derivative 
-work should be clearly marked and renamed to notify users that it is a 
-modified version and not the original Software distributed by Illinois.  
-Licensee agrees to reproduce the copyright notice and other proprietary 
-markings on any derivative work and to include in the documentation of such 
+" Licensee may, at its own expense, create and freely distribute
+complimentary works that interoperate with the Software, directing others to
+the TCBG server to license and obtain the Software itself. Licensee may, at
+its own expense, modify the Software to make derivative works.  Except as
+explicitly provided below, this License shall apply to any derivative work
+as it does to the original Software distributed by Illinois.  Any derivative
+work should be clearly marked and renamed to notify users that it is a
+modified version and not the original Software distributed by Illinois.
+Licensee agrees to reproduce the copyright notice and other proprietary
+markings on any derivative work and to include in the documentation of such
 work the acknowledgement:
 
- "This software includes code developed by the Theoretical and Computational 
-  Biophysics Group in the Beckman Institute for Advanced Science and 
+ "This software includes code developed by the Theoretical and Computational
+  Biophysics Group in the Beckman Institute for Advanced Science and
   Technology at the University of Illinois at Urbana-Champaign."
 
-Licensee may redistribute without restriction works with up to 1/2 of their 
-non-comment source code derived from at most 1/10 of the non-comment source 
-code developed by Illinois and contained in the Software, provided that the 
-above directions for notice and acknowledgement are observed.  Any other 
-distribution of the Software or any derivative work requires a separate 
-license with Illinois.  Licensee may contact Illinois (vmd@ks.uiuc.edu) to 
+Licensee may redistribute without restriction works with up to 1/2 of their
+non-comment source code derived from at most 1/10 of the non-comment source
+code developed by Illinois and contained in the Software, provided that the
+above directions for notice and acknowledgement are observed.  Any other
+distribution of the Software or any derivative work requires a separate
+license with Illinois.  Licensee may contact Illinois (vmd@ks.uiuc.edu) to
 negotiate an appropriate license for such distribution."
 ------------------------------------------------------------------------- */
 
@@ -68,7 +68,7 @@ class FixIMD : public Fix {
   int setmask();
   void init();
   void setup(int);
-  void post_force(int); 
+  void post_force(int);
   void post_force_respa(int, int, int);
   double memory_usage();
 
@@ -76,8 +76,8 @@ class FixIMD : public Fix {
   int    imd_port;
   void  *localsock;
   void  *clientsock;
-  
-  int    num_coords;            // total number of atoms controlled by this fix 
+
+  int    num_coords;            // total number of atoms controlled by this fix
   int    size_one;              // bytes per atom in communication buffer.
   int    maxbuf;                // size of atom communication buffer.
   void  *comm_buf;              // communication buffer
diff --git a/src/USER-MISC/fix_smd.cpp b/src/USER-MISC/fix_smd.cpp
index 25d26b98e0..32fc75066b 100644
--- a/src/USER-MISC/fix_smd.cpp
+++ b/src/USER-MISC/fix_smd.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -31,9 +31,9 @@
 using namespace LAMMPS_NS;
 using namespace FixConst;
 
-enum { SMD_NONE=0, 
-       SMD_TETHER=1<<0, SMD_COUPLE=1<<1, 
-       SMD_CVEL=1<<2, SMD_CFOR=1<<3, 
+enum { SMD_NONE=0,
+       SMD_TETHER=1<<0, SMD_COUPLE=1<<1,
+       SMD_CVEL=1<<2, SMD_CFOR=1<<3,
        SMD_AUTOX=1<<4, SMD_AUTOY=1<<5, SMD_AUTOZ=1<<6};
 
 #define SMALL 0.001
@@ -69,7 +69,7 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) :
     f_smd = atof(arg[argoffs+1]);
     argoffs += 2;
   } else error->all(FLERR,"Illegal fix smd command");
-  
+
   if (strcmp(arg[argoffs],"tether") == 0) {
     if (narg < argoffs+5) error->all(FLERR,"Illegal fix smd command");
     styleflag |= SMD_TETHER;
@@ -86,10 +86,10 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) :
     if (narg < argoffs+6) error->all(FLERR,"Illegal fix smd command");
     styleflag |= SMD_COUPLE;
     igroup2 = group->find(arg[argoffs+1]);
-    if (igroup2 == -1) 
-      error->all(FLERR,"Could not find fix smd couple group ID"); 
-    if (igroup2 == igroup) 
-      error->all(FLERR,"Two groups cannot be the same in fix smd couple"); 
+    if (igroup2 == -1)
+      error->all(FLERR,"Could not find fix smd couple group ID");
+    if (igroup2 == igroup)
+      error->all(FLERR,"Two groups cannot be the same in fix smd couple");
     group2bit = group->bitmask[igroup2];
 
     if (strcmp(arg[argoffs+2],"NULL") == 0) xflag = 0;
@@ -101,7 +101,7 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) :
     if (strcmp(arg[argoffs+4],"NULL") == 0) zflag = 0;
     else if (strcmp(arg[argoffs+4],"auto") == 0) styleflag |= SMD_AUTOZ;
     else zc = atof(arg[argoffs+4]);
-    
+
     r0 = atof(arg[argoffs+5]);
     if (r0 < 0) error->all(FLERR,"R0 < 0 for fix smd command");
     argoffs +=6;
@@ -144,7 +144,7 @@ void FixSMD::init()
     if (styleflag & SMD_AUTOZ) dz = xcm2[2] - xcm[2];
     else dz = zc;
   }
-    
+
   if (!xflag) dx = 0.0;
   if (!yflag) dy = 0.0;
   if (!zflag) dz = 0.0;
@@ -154,7 +154,7 @@ void FixSMD::init()
     yn = dy/r_old;
     zn = dz/r_old;
   }
-    
+
   if (strstr(update->integrate_style,"respa"))
     nlevels_respa = ((Respa *) update->integrate)->nlevels;
 }
@@ -190,14 +190,14 @@ void FixSMD::smd_tether()
   group->xcm(igroup,masstotal,xcm);
 
   // fx,fy,fz = components of k * (r-r0)
-  
+
   double dx,dy,dz,fx,fy,fz,r,dr;
-  
+
   dx = xcm[0] - xc;
   dy = xcm[1] - yc;
   dz = xcm[2] - zc;
   r_now = sqrt(dx*dx + dy*dy + dz*dz);
-  
+
   if (!xflag) dx = 0.0;
   if (!yflag) dy = 0.0;
   if (!zflag) dz = 0.0;
@@ -218,7 +218,7 @@ void FixSMD::smd_tether()
     fy = f_smd*dy/r;
     fz = f_smd*dz/r;
   }
-    
+
   // apply restoring force to atoms in group
   // f = -k*(r-r0)*mass/masstotal
 
@@ -227,7 +227,7 @@ void FixSMD::smd_tether()
   int *type = atom->type;
   double *mass = atom->mass;
   int nlocal = atom->nlocal;
-  
+
   ftotal[0] = ftotal[1] = ftotal[2] = 0.0;
   force_flag = 0;
 
@@ -251,7 +251,7 @@ void FixSMD::smd_couple()
   double xcm[3],xcm2[3];
   group->xcm(igroup,masstotal,xcm);
   group->xcm(igroup2,masstotal2,xcm2);
-  
+
   // renormalize direction of spring
   double dx,dy,dz,r,dr;
   if (styleflag & SMD_AUTOX) dx = xcm2[0] - xcm[0];
@@ -274,10 +274,10 @@ void FixSMD::smd_couple()
     dy = xcm2[1] - xcm[1];
     dz = xcm2[2] - xcm[2];
     r_now = sqrt(dx*dx + dy*dy + dz*dz);
-    
+
     dx -= xn*r_old;
     dy -= yn*r_old;
-    dz -= zn*r_old;  
+    dz -= zn*r_old;
 
     if (!xflag) dx = 0.0;
     if (!yflag) dy = 0.0;
@@ -320,7 +320,7 @@ void FixSMD::smd_couple()
   force_flag = 0;
 
   double massfrac;
-  for (int i = 0; i < nlocal; i++) {         
+  for (int i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
       massfrac = mass[type[i]]/masstotal;
       f[i][0] += fx*massfrac;
@@ -345,7 +345,7 @@ void FixSMD::write_restart(FILE *fp)
 {
 #define RESTART_ITEMS 5
   double buf[RESTART_ITEMS], fsign;
-  
+
   if (comm->me == 0) {
     // make sure we project the force into the direction of the pulling.
     fsign  = (v_smd<0.0) ? -1.0 : 1.0;
diff --git a/src/USER-MISC/fix_smd.h b/src/USER-MISC/fix_smd.h
index 5319ca9558..339838d272 100644
--- a/src/USER-MISC/fix_smd.h
+++ b/src/USER-MISC/fix_smd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -43,7 +43,7 @@ class FixSMD : public Fix {
   int xflag,yflag,zflag;
   int styleflag;
   double r_old,r_now,pmf;
-  
+
   int igroup2,group2bit;
   double masstotal,masstotal2;
   int nlevels_respa;
diff --git a/src/USER-MISC/improper_cossq.cpp b/src/USER-MISC/improper_cossq.cpp
index a7684017d0..9bd5be609f 100644
--- a/src/USER-MISC/improper_cossq.cpp
+++ b/src/USER-MISC/improper_cossq.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -76,7 +76,7 @@ void ImproperCossq::compute(int eflag, int vflag)
 
    for (n = 0; n < nimproperlist; n++) {
       /* Ask the improper list for the atom types. */
-      i1 = improperlist[n][0]; 
+      i1 = improperlist[n][0];
       i2 = improperlist[n][1];
       i3 = improperlist[n][2];
       i4 = improperlist[n][3];
@@ -105,9 +105,9 @@ void ImproperCossq::compute(int eflag, int vflag)
       rlk = sqrt(rlksq);
 
       cosphi = (vb3x*vb1x + vb3y*vb1y + vb3z*vb1z)/(rji * rlk);
-     
-      /* Check that cos(phi) is in the correct limits. */     
-      if (cosphi > 1.0 + TOLERANCE || cosphi < (-1.0 - TOLERANCE)) 
+
+      /* Check that cos(phi) is in the correct limits. */
+      if (cosphi > 1.0 + TOLERANCE || cosphi < (-1.0 - TOLERANCE))
       {
          int me;
          MPI_Comm_rank(world,&me);
@@ -123,19 +123,19 @@ void ImproperCossq::compute(int eflag, int vflag)
             }
       }
 
-      
+
       /* Apply corrections to round-off errors. */
       if (cosphi > 1.0)  cosphi -= SMALL;
       if (cosphi < -1.0) cosphi += SMALL;
-      
+
       /* Calculate the angle: */
       double torangle = acos(cosphi);
       cosphi = cos(torangle - chi[type]);
 
       if (eflag) eimproper = 0.5 * k[type] * cosphi * cosphi;
-     
+
       /*
-      printf("The tags: %d-%d-%d-%d, of type %d .\n",atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4],type);   
+      printf("The tags: %d-%d-%d-%d, of type %d .\n",atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4],type);
       printf("The ji vector: %f, %f, %f.\nThe lk vector: %f, %f, %f.\n", vb1x,vb1y,vb1z,vb3x,vb3y,vb3z);
       printf("The cosine of the angle: %-1.16e.\n", cosphi);
       printf("The energy of the improper: %-1.16e with prefactor %-1.16e.\n", eimproper, 0.5*k[type]);
@@ -147,7 +147,7 @@ void ImproperCossq::compute(int eflag, int vflag)
       cjiji = rjisq;
       clklk = rlksq;
       /*CLKJI = RXLK * RXJI + RYLK * RYJI + RZLK * RZJI */
-      clkji = vb3x*vb1x + vb3y*vb1y + vb3z*vb1z; 
+      clkji = vb3x*vb1x + vb3y*vb1y + vb3z*vb1z;
 
       /*CFACT1 = CLKLK * CJIJI
         CFACT1 = SQRT(CFACT1)
@@ -171,7 +171,7 @@ void ImproperCossq::compute(int eflag, int vflag)
       f2[0] = - f1[0];
       f2[1] = - f1[1];
       f2[2] = - f1[2];
-      
+
       /*FKX = CFACT2 * RXLK - RXJI
         FKY = CFACT2 * RYLK - RYJI
         FKZ = CFACT2 * RZLK - RZJI*/
@@ -190,7 +190,7 @@ void ImproperCossq::compute(int eflag, int vflag)
         FIY = FIY * CFACT1
         FIZ = FIZ * CFACT1*/
       f1[0] *= cfact1;
-      f1[1] *= cfact1; 
+      f1[1] *= cfact1;
       f1[2] *= cfact1;
 
       /*FJX = FJX * CFACT1
@@ -203,15 +203,15 @@ void ImproperCossq::compute(int eflag, int vflag)
       /*FKX = FKX * CFACT1
         FKY = FKY * CFACT1
         FKZ = FKZ * CFACT1*/
-      f3[0] *= cfact1; 
-      f3[1] *= cfact1; 
+      f3[0] *= cfact1;
+      f3[1] *= cfact1;
       f3[2] *= cfact1;
 
       /*FLX = FLX * CFACT1
         FLY = FLY * CFACT1
         FLZ = FLZ * CFACT1*/
       f4[0] *= cfact1;
-      f4[1] *= cfact1; 
+      f4[1] *= cfact1;
       f4[2] *= cfact1;
 
       /* Apply force to each of 4 atoms */
@@ -241,7 +241,7 @@ void ImproperCossq::compute(int eflag, int vflag)
 
       if (evflag)
       ev_tally(i1,i2,i3,i4,nlocal,newton_bond,eimproper,f1,f3,f4,
-	       -vb1x,-vb1y,-vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+               -vb1x,-vb1y,-vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
    }
 }
 
@@ -265,7 +265,7 @@ void ImproperCossq::allocate()
 
 void ImproperCossq::coeff(int narg, char **arg)
 {
-   /* Check whether there exist sufficient number of arguments. 
+   /* Check whether there exist sufficient number of arguments.
       0: type of improper to be applied to
       1: energetic constant
       2: equilibrium angle in degrees */
@@ -290,7 +290,7 @@ void ImproperCossq::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 void ImproperCossq::write_restart(FILE *fp)
 {
@@ -299,7 +299,7 @@ void ImproperCossq::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 void ImproperCossq::read_restart(FILE *fp)
 {
diff --git a/src/USER-MISC/improper_cossq.h b/src/USER-MISC/improper_cossq.h
index d4b7ca64a7..498d3403b0 100644
--- a/src/USER-MISC/improper_cossq.h
+++ b/src/USER-MISC/improper_cossq.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/improper_ring.cpp b/src/USER-MISC/improper_ring.cpp
index cead4c87df..0afbb197ca 100644
--- a/src/USER-MISC/improper_ring.cpp
+++ b/src/USER-MISC/improper_ring.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -17,23 +17,23 @@
  ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Description:   This file implements the improper potential introduced 
+   Description:   This file implements the improper potential introduced
                   by Destree et al., in Equation 9 of:
-                  - M. Destree, F. Laupretre, A. Lyulin, and J.-P. 
-                    Ryckaert, J. Chem. Phys. 112, 9632 (2000), 
+                  - M. Destree, F. Laupretre, A. Lyulin, and J.-P.
+                    Ryckaert, J. Chem. Phys. 112, 9632 (2000),
                   and subsequently referred in:
                   - A.V. Lyulin, M.A.J Michels, Macromolecules, 35, 1463,
                     (2002)
                   This potential does not affect small amplitude vibrations
-                  but is used in an ad hoc way to prevent the onset of 
-                  accidentially large amplitude fluctuations leading to 
-                  the occurrence of a planar conformation of the three 
-                  bonds i, i + 1 and i', an intermediate conformation 
+                  but is used in an ad hoc way to prevent the onset of
+                  accidentially large amplitude fluctuations leading to
+                  the occurrence of a planar conformation of the three
+                  bonds i, i + 1 and i', an intermediate conformation
                   toward the chiral inversion of a methine carbon.
                   In the "Impropers" section of data file four atoms:
                   i, j, k and l are specified with i,j and l lying on the
                   backbone of the chain and k specifying the chirality
-                  of j. 
+                  of j.
 ------------------------------------------------------------------------- */
 
 #include "lmptype.h"
@@ -79,20 +79,20 @@ void ImproperRing::compute(int eflag, int vflag)
    /* Be careful!: "chi" is the equilibrium angle in radians. */
    int i1,i2,i3,i4,n,type;
 
-   double eimproper ; 
+   double eimproper ;
 
    /* Compatibility variables. */
    double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z;
    double f1[3], f3[3], f4[3];
-   
+
    /* Actual computation variables. */
    int at1[3], at2[3], at3[3], icomb;
-   double   bvec1x[3], bvec1y[3], bvec1z[3], 
-            bvec2x[3], bvec2y[3], bvec2z[3], 
+   double   bvec1x[3], bvec1y[3], bvec1z[3],
+            bvec2x[3], bvec2y[3], bvec2z[3],
             bvec1n[3], bvec2n[3], bend_angle[3];
    double   angle_summer, angfac, cfact1, cfact2, cfact3;
    double   cjiji, ckjji, ckjkj, fix, fiy, fiz, fjx, fjy, fjz, fkx, fky, fkz;
-  
+
    eimproper = 0.0;
    if (eflag || vflag) ev_setup(eflag,vflag);
    else evflag = 0;
@@ -106,9 +106,9 @@ void ImproperRing::compute(int eflag, int vflag)
    int newton_bond = force->newton_bond;
 
 
-   /* A description of the potential can be found in 
+   /* A description of the potential can be found in
       Macromolecules 35, pp. 1463-1472 (2002). */
-   for (n = 0; n < nimproperlist; n++) 
+   for (n = 0; n < nimproperlist; n++)
    {
       /* Take the ids of the atoms contributing to the improper potential. */
       i1 = improperlist[n][0];   /* Atom "1" of Figure 1 from the above reference.*/
@@ -117,9 +117,9 @@ void ImproperRing::compute(int eflag, int vflag)
       i4 = improperlist[n][3];   /* Atom "9" ... */
       type = improperlist[n][4];
 
-      /* Calculate the necessary variables for LAMMPS implementation. 
+      /* Calculate the necessary variables for LAMMPS implementation.
          if (evflag) ev_tally(i1,i2,i3,i4,nlocal,newton_bond,eimproper,f1,f3,f4,
-	                           vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);  
+                                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
          Although, they are irrelevant to the calculation of the potential, we keep
          them for maximal compatibility. */
       vb1x = x[i1][0] - x[i2][0]; vb1y = x[i1][1] - x[i2][1]; vb1z = x[i1][2] - x[i2][2];
@@ -131,27 +131,27 @@ void ImproperRing::compute(int eflag, int vflag)
       vb3x = x[i4][0] - x[i3][0]; vb3y = x[i4][1] - x[i3][1]; vb3z = x[i4][2] - x[i3][2];
       domain->minimum_image(vb3x,vb3y,vb3z);
 
-  
+
       /* Pass the atom tags to form the necessary combinations. */
       at1[0] = i1; at2[0] = i2; at3[0] = i4;  /* ids: 1-2-9 */
       at1[1] = i1; at2[1] = i2; at3[1] = i3;  /* ids: 1-2-3 */
       at1[2] = i4; at2[2] = i2; at3[2] = i3;  /* ids: 9-2-3 */
-      
+
 
       /* Initialize the sum of the angles differences. */
       angle_summer = 0.0;
       /* Take a loop over the three angles, defined by each triad: */
       for (icomb = 0; icomb < 3; icomb ++)
       {
-         
+
          /* Bond vector connecting the first and the second atom. */
          bvec1x[icomb] = x[at2[icomb]][0] - x[at1[icomb]][0];
          bvec1y[icomb] = x[at2[icomb]][1] - x[at1[icomb]][1];
          bvec1z[icomb] = x[at2[icomb]][2] - x[at1[icomb]][2];
          domain -> minimum_image(bvec1x[icomb], bvec1y[icomb], bvec1z[icomb]);
          /* also calculate the norm of the vector: */
-         bvec1n[icomb] = sqrt(  bvec1x[icomb]*bvec1x[icomb] 
-                              + bvec1y[icomb]*bvec1y[icomb] 
+         bvec1n[icomb] = sqrt(  bvec1x[icomb]*bvec1x[icomb]
+                              + bvec1y[icomb]*bvec1y[icomb]
                               + bvec1z[icomb]*bvec1z[icomb]);
          /* Bond vector connecting the second and the third atom. */
          bvec2x[icomb] = x[at3[icomb]][0] - x[at2[icomb]][0];
@@ -159,13 +159,13 @@ void ImproperRing::compute(int eflag, int vflag)
          bvec2z[icomb] = x[at3[icomb]][2] - x[at2[icomb]][2];
          domain -> minimum_image(bvec2x[icomb], bvec2y[icomb], bvec2z[icomb]);
          /* also calculate the norm of the vector: */
-         bvec2n[icomb] = sqrt(  bvec2x[icomb]*bvec2x[icomb] 
-                              + bvec2y[icomb]*bvec2y[icomb] 
+         bvec2n[icomb] = sqrt(  bvec2x[icomb]*bvec2x[icomb]
+                              + bvec2y[icomb]*bvec2y[icomb]
                               + bvec2z[icomb]*bvec2z[icomb]);
-        
+
          /* Calculate the bending angle of the atom triad: */
-         bend_angle[icomb] = (  bvec2x[icomb]*bvec1x[icomb] 
-                              + bvec2y[icomb]*bvec1y[icomb] 
+         bend_angle[icomb] = (  bvec2x[icomb]*bvec1x[icomb]
+                              + bvec2y[icomb]*bvec1y[icomb]
                               + bvec2z[icomb]*bvec1z[icomb]);
          bend_angle[icomb] /= (bvec1n[icomb] * bvec2n[icomb]);
          if (bend_angle[icomb] >  1.0) bend_angle[icomb] -= SMALL;
@@ -173,38 +173,38 @@ void ImproperRing::compute(int eflag, int vflag)
 
          /* Append the current angle to the sum of angle differences. */
          angle_summer += (bend_angle[icomb] - chi[type]);
-      } 
-      if (eflag) eimproper = (1.0/6.0) *k[type] * pow(angle_summer,6.0); 
+      }
+      if (eflag) eimproper = (1.0/6.0) *k[type] * pow(angle_summer,6.0);
       /*
-      printf("The tags: %d-%d-%d-%d, of type %d .\n",atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4],type);   
+      printf("The tags: %d-%d-%d-%d, of type %d .\n",atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4],type);
       // printf("The coordinates of the first: %f, %f, %f.\n", x[i1][0], x[i1][1], x[i1][2]);
       // printf("The coordinates of the second: %f, %f, %f.\n", x[i2][0], x[i2][1], x[i2][2]);
       // printf("The coordinates of the third: %f, %f, %f.\n", x[i3][0], x[i3][1], x[i3][2]);
       // printf("The coordinates of the fourth: %f, %f, %f.\n", x[i4][0], x[i4][1], x[i4][2]);
       printf("The angles are: %f / %f / %f equilibrium: %f.\n", bend_angle[0], bend_angle[1], bend_angle[2],chi[type]);
       printf("The energy of the improper: %f with prefactor %f.\n", eimproper,(1.0/6.0)*k[type]);
-      printf("The sum of the angles: %f.\n", angle_summer); 
+      printf("The sum of the angles: %f.\n", angle_summer);
       */
 
-      /* Force calculation acting on all atoms. 
+      /* Force calculation acting on all atoms.
          Calculate the derivatives of the potential. */
       angfac = k[type] * pow(angle_summer,5.0);
 
       f1[0] = 0.0; f1[1] = 0.0; f1[2] = 0.0;
       f3[0] = 0.0; f3[1] = 0.0; f3[2] = 0.0;
-      f4[0] = 0.0; f4[1] = 0.0; f4[2] = 0.0; 
-      
+      f4[0] = 0.0; f4[1] = 0.0; f4[2] = 0.0;
+
       /* Take a loop over the three angles, defined by each triad: */
       for (icomb = 0; icomb < 3; icomb ++)
       {
          /* Calculate the squares of the distances. */
          cjiji = bvec1n[icomb] * bvec1n[icomb];  ckjkj = bvec2n[icomb] * bvec2n[icomb];
-         
-         ckjji =   bvec2x[icomb] * bvec1x[icomb] 
+
+         ckjji =   bvec2x[icomb] * bvec1x[icomb]
                  + bvec2y[icomb] * bvec1y[icomb]
                  + bvec2z[icomb] * bvec1z[icomb] ;
-         
-         cfact1 = angfac / (sqrt(ckjkj * cjiji)); 
+
+         cfact1 = angfac / (sqrt(ckjkj * cjiji));
          cfact2 = ckjji / ckjkj;
          cfact3 = ckjji / cjiji;
 
@@ -212,15 +212,15 @@ void ImproperRing::compute(int eflag, int vflag)
          fkx = cfact2 * bvec2x[icomb] - bvec1x[icomb];
          fky = cfact2 * bvec2y[icomb] - bvec1y[icomb];
          fkz = cfact2 * bvec2z[icomb] - bvec1z[icomb];
-         
+
          /* Calculate the force acted on the first atom of the angle. */
          fix = bvec2x[icomb] - cfact3 * bvec1x[icomb];
          fiy = bvec2y[icomb] - cfact3 * bvec1y[icomb];
-         fiz = bvec2z[icomb] - cfact3 * bvec1z[icomb];       
+         fiz = bvec2z[icomb] - cfact3 * bvec1z[icomb];
 
          /* Finally, calculate the force acted on the middle atom of the angle.*/
-         fjx = - fix - fkx;  fjy = - fiy - fky;  fjz = - fiz - fkz;  
- 
+         fjx = - fix - fkx;  fjy = - fiy - fky;  fjz = - fiz - fkz;
+
          /* Consider the appropriate scaling of the forces: */
          fix *= cfact1; fiy *= cfact1; fiz *= cfact1;
          fjx *= cfact1; fjy *= cfact1; fjz *= cfact1;
@@ -229,7 +229,7 @@ void ImproperRing::compute(int eflag, int vflag)
          if      (at1[icomb] == i1)  {f1[0] += fix; f1[1] += fiy; f1[2] += fiz;}
          else if (at2[icomb] == i1)  {f1[0] += fjx; f1[1] += fjy; f1[2] += fjz;}
          else if (at3[icomb] == i1)  {f1[0] += fkx; f1[1] += fky; f1[2] += fkz;}
- 
+
          if      (at1[icomb] == i3)  {f3[0] += fix; f3[1] += fiy; f3[2] += fiz;}
          else if (at2[icomb] == i3)  {f3[0] += fjx; f3[1] += fjy; f3[2] += fjz;}
          else if (at3[icomb] == i3)  {f3[0] += fkx; f3[1] += fky; f3[2] += fkz;}
@@ -242,7 +242,7 @@ void ImproperRing::compute(int eflag, int vflag)
          /* Store the contribution to the global arrays: */
          /* Take the id of the atom from the at1[icomb] element, i1 = at1[icomb]. */
          if (newton_bond || at1[icomb] < nlocal) {
-            f[at1[icomb]][0] += fix;  
+            f[at1[icomb]][0] += fix;
             f[at1[icomb]][1] += fiy;
             f[at1[icomb]][2] += fiz;
          }
@@ -258,11 +258,11 @@ void ImproperRing::compute(int eflag, int vflag)
             f[at3[icomb]][1] += fky;
             f[at3[icomb]][2] += fkz;
          }
-   
+
       }
 
       if (evflag) ev_tally(i1,i2,i3,i4,nlocal,newton_bond,eimproper,f1,f3,f4,
-	                           vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
+                                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
 
   }
 }
@@ -287,7 +287,7 @@ void ImproperRing::allocate()
 
 void ImproperRing ::coeff(int narg, char **arg)
 {
-   /* Check whether there exist sufficient number of arguments. 
+   /* Check whether there exist sufficient number of arguments.
       0: type of improper to be applied to
       1: energetic constant
       2: equilibrium angle in degrees */
@@ -315,7 +315,7 @@ void ImproperRing ::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out coeffs to restart file 
+   proc 0 writes out coeffs to restart file
 ------------------------------------------------------------------------- */
 
 void ImproperRing ::write_restart(FILE *fp)
@@ -325,7 +325,7 @@ void ImproperRing ::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads coeffs from restart file, bcasts them 
+   proc 0 reads coeffs from restart file, bcasts them
 ------------------------------------------------------------------------- */
 
 void ImproperRing::read_restart(FILE *fp)
diff --git a/src/USER-MISC/improper_ring.h b/src/USER-MISC/improper_ring.h
index f68d5a6d21..0da0e5e05d 100644
--- a/src/USER-MISC/improper_ring.h
+++ b/src/USER-MISC/improper_ring.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/pair_cdeam.cpp b/src/USER-MISC/pair_cdeam.cpp
index 4da0065ae7..9d3a3cb084 100644
--- a/src/USER-MISC/pair_cdeam.cpp
+++ b/src/USER-MISC/pair_cdeam.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,420 +35,420 @@ using namespace LAMMPS_NS;
 // This is for debugging purposes. The ASSERT() macro is used in the code to check
 // if everything runs as expected. Change this to #if 0 if you don't need the checking.
 #if 0
-	#define ASSERT(cond) ((!(cond)) ? my_failure(error,__FILE__,__LINE__) : my_noop())
-
-	inline void my_noop() {}
-	inline void my_failure(Error* error, const char* file, int line) {
-		char str[1024];
-		sprintf(str,"Assertion failure: File %s, line %i", file, line);
-		error->one(FLERR,str);
-	}
+        #define ASSERT(cond) ((!(cond)) ? my_failure(error,__FILE__,__LINE__) : my_noop())
+
+        inline void my_noop() {}
+        inline void my_failure(Error* error, const char* file, int line) {
+                char str[1024];
+                sprintf(str,"Assertion failure: File %s, line %i", file, line);
+                error->one(FLERR,str);
+        }
 #else
-	#define ASSERT(cond)
+        #define ASSERT(cond)
 #endif
 
-#define MAXLINE 1024	// This sets the maximum line length in EAM input files.
+#define MAXLINE 1024        // This sets the maximum line length in EAM input files.
 
 PairCDEAM::PairCDEAM(LAMMPS *lmp, int _cdeamVersion) : PairEAM(lmp), PairEAMAlloy(lmp), cdeamVersion(_cdeamVersion)
 {
-	single_enable = 0;
-	restartinfo = 0;
-
-	rhoB = NULL;
-	D_values = NULL;
-	hcoeff = NULL;
-
-	// Set communication buffer sizes needed by this pair style.
-	if(cdeamVersion == 1) {
-		comm_forward = 4;
-		comm_reverse = 3;
-	}
-	else if(cdeamVersion == 2) {
-		comm_forward = 3;
-		comm_reverse = 2;
-	}
-	else {
-		error->all(FLERR,"Invalid CD-EAM potential version.");
-	}
+        single_enable = 0;
+        restartinfo = 0;
+
+        rhoB = NULL;
+        D_values = NULL;
+        hcoeff = NULL;
+
+        // Set communication buffer sizes needed by this pair style.
+        if(cdeamVersion == 1) {
+                comm_forward = 4;
+                comm_reverse = 3;
+        }
+        else if(cdeamVersion == 2) {
+                comm_forward = 3;
+                comm_reverse = 2;
+        }
+        else {
+                error->all(FLERR,"Invalid CD-EAM potential version.");
+        }
 }
 
 PairCDEAM::~PairCDEAM()
 {
-	memory->destroy(rhoB);
-	memory->destroy(D_values);
-	if(hcoeff) delete[] hcoeff;
+        memory->destroy(rhoB);
+        memory->destroy(D_values);
+        if(hcoeff) delete[] hcoeff;
 }
 
 void PairCDEAM::compute(int eflag, int vflag)
 {
-	int i,j,ii,jj,inum,jnum,itype,jtype;
-	double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
-	double rsq,rhoip,rhojp,recip,phi;
-	int *ilist,*jlist,*numneigh,**firstneigh;
-
-	evdwl = 0.0;
-	if (eflag || vflag) ev_setup(eflag,vflag);
-	else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;
-
-	// Grow per-atom arrays if necessary
-	if(atom->nmax > nmax) {
-		memory->destroy(rho);
-		memory->destroy(fp);
-		memory->destroy(rhoB);
-		memory->destroy(D_values);
-		nmax = atom->nmax;
-		memory->create(rho,nmax,"pair:rho");
-		memory->create(rhoB,nmax,"pair:rhoB");
-		memory->create(fp,nmax,"pair:fp");
-		memory->create(D_values,nmax,"pair:D_values");
-	}
-
-	double **x = atom->x;
-	double **f = atom->f;
-	int *type = atom->type;
-	int nlocal = atom->nlocal;
-	int newton_pair = force->newton_pair;
-
-	inum = list->inum;
-	ilist = list->ilist;
-	numneigh = list->numneigh;
-	firstneigh = list->firstneigh;
-
-	// Zero out per-atom arrays.
-	int m = nlocal + atom->nghost;
-	for(i = 0; i < m; i++) {
-		rho[i] = 0.0;
-		rhoB[i] = 0.0;
-		D_values[i] = 0.0;
-	}
-
-	// Stage I
-
-	// Compute rho and rhoB at each local atom site.
-	// Additionally calculate the D_i values here if we are using the one-site formulation.
-	// For the two-site formulation we have to calculate the D values in an extra loop (Stage II).
-	for(ii = 0; ii < inum; ii++) {
-		i = ilist[ii];
-		xtmp = x[i][0];
-		ytmp = x[i][1];
-		ztmp = x[i][2];
-		itype = type[i];
-		jlist = firstneigh[i];
-		jnum = numneigh[i];
-
-		for(jj = 0; jj < jnum; jj++) {
-			j = jlist[jj];
-			j &= NEIGHMASK;
-
-			delx = xtmp - x[j][0];
-			dely = ytmp - x[j][1];
-			delz = ztmp - x[j][2];
-			rsq = delx*delx + dely*dely + delz*delz;
-
-			if(rsq < cutforcesq) {
-				jtype = type[j];
-				double r = sqrt(rsq);
-				const EAMTableIndex index = radiusToTableIndex(r);
-				double localrho = RhoOfR(index, jtype, itype);
-				rho[i] += localrho;
-				if(jtype == speciesB) rhoB[i] += localrho;
-				if(newton_pair || j < nlocal) {
-					localrho = RhoOfR(index, itype, jtype);
-					rho[j] += localrho;
-					if(itype == speciesB) rhoB[j] += localrho;
-				}
-
-				if(cdeamVersion == 1 && itype != jtype) {
-					// Note: if the i-j interaction is not concentration dependent (because either
-					// i or j are not species A or B) then its contribution to D_i and D_j should
-					// be ignored.
-					// This if-clause is only required for a ternary.
-					if((itype == speciesA && jtype == speciesB) || (jtype == speciesA && itype == speciesB)) {
-						double Phi_AB = PhiOfR(index, itype, jtype, 1.0 / r);
-						D_values[i] += Phi_AB;
-						if(newton_pair || j < nlocal)
-							D_values[j] += Phi_AB;
-					}
-				}
-			}
-		}
-	}
-
-	// Communicate and sum densities.
-	if(newton_pair) {
-		communicationStage = 1;
-		comm->reverse_comm_pair(this);
-	}
-
-	// fp = derivative of embedding energy at each atom
-	// phi = embedding energy at each atom
-	for(ii = 0; ii < inum; ii++) {
-		i = ilist[ii];
-		EAMTableIndex index = rhoToTableIndex(rho[i]);
-		fp[i] = FPrimeOfRho(index, type[i]);
-		if(eflag) {
-			phi = FofRho(index, type[i]);
-			if (eflag_global) eng_vdwl += phi;
-			if (eflag_atom) eatom[i] += phi;
-		}
-	}
-
-	// Communicate derivative of embedding function and densities
-	// and D_values (this for one-site formulation only).
-	communicationStage = 2;
-	comm->forward_comm_pair(this);
-
-	// The electron densities may not drop to zero because then the concentration would no longer be defined.
-	// But the concentration is not needed anyway if there is no interaction with another atom, which is the case
-	// if the electron density is exactly zero. That's why the following lines have been commented out.
-	//
-	//for(i = 0; i < nlocal + atom->nghost; i++) {
-	//	if(rho[i] == 0 && (type[i] == speciesA || type[i] == speciesB))
-	//		error->one(FLERR,"CD-EAM potential routine: Detected atom with zero electron density.");
-	//}
-
-	// Stage II
-	// This is only required for the original two-site formulation of the CD-EAM potential.
-
-	if(cdeamVersion == 2) {
-		// Compute intermediate value D_i for each atom.
-		for(ii = 0; ii < inum; ii++) {
-			i = ilist[ii];
-			xtmp = x[i][0];
-			ytmp = x[i][1];
-			ztmp = x[i][2];
-			itype = type[i];
-			jlist = firstneigh[i];
-			jnum = numneigh[i];
-
-			// This code line is required for ternary alloys.
-			if(itype != speciesA && itype != speciesB) continue;
-
-			double x_i = rhoB[i] / rho[i];	// Concentration at atom i.
-
-			for(jj = 0; jj < jnum; jj++) {
-				j = jlist[jj];
-				j &= NEIGHMASK;
-				jtype = type[j];
-				if(itype == jtype) continue;
-
-				// This code line is required for ternary alloys.
-				if(jtype != speciesA && jtype != speciesB) continue;
-
-				delx = xtmp - x[j][0];
-				dely = ytmp - x[j][1];
-				delz = ztmp - x[j][2];
-				rsq = delx*delx + dely*dely + delz*delz;
-
-				if(rsq < cutforcesq) {
-					double r = sqrt(rsq);
-					const EAMTableIndex index = radiusToTableIndex(r);
-
-					// The concentration independent part of the cross pair potential.
-					double Phi_AB = PhiOfR(index, itype, jtype, 1.0 / r);
-
-					// Average concentration of two sites
-					double x_ij = 0.5 * (x_i + rhoB[j]/rho[j]);
-
-					// Calculate derivative of h(x_ij) polynomial function.
-					double h_prime = evalHprime(x_ij);
-
-					D_values[i] += h_prime * Phi_AB / (2.0 * rho[i] * rho[i]);
-					if(newton_pair || j < nlocal)
-						D_values[j] += h_prime * Phi_AB / (2.0 * rho[j] * rho[j]);
-				}
-			}
-		}
-
-		// Communicate and sum D values.
-		if(newton_pair) {
-			communicationStage = 3;
-			comm->reverse_comm_pair(this);
-		}
-		communicationStage = 4;
-		comm->forward_comm_pair(this);
-	}
-
-	// Stage III
-
-	// Compute force acting on each atom.
-	for(ii = 0; ii < inum; ii++) {
-		i = ilist[ii];
-		xtmp = x[i][0];
-		ytmp = x[i][1];
-		ztmp = x[i][2];
-		itype = type[i];
-
-		jlist = firstneigh[i];
-		jnum = numneigh[i];
-
-		// Concentration at site i
-		double x_i = -1.0;		// The value -1 indicates: no concentration dependence for all interactions of atom i.
-								// It will be replaced by the concentration at site i if atom i is either A or B.
-
-		double D_i, h_prime_i;
-
-		// This if-clause is only required for ternary alloys.
-		if((itype == speciesA || itype == speciesB) && rho[i] != 0.0) {
-
-			// Compute local concentration at site i.
-			x_i = rhoB[i]/rho[i];
-			ASSERT(x_i >= 0 && x_i<=1.0);
-
-			if(cdeamVersion == 1) {
-				// Calculate derivative of h(x_i) polynomial function.
-				h_prime_i = evalHprime(x_i);
-				D_i = D_values[i] * h_prime_i / (2.0 * rho[i] * rho[i]);
-			}
-			else if(cdeamVersion == 2) {
-				D_i = D_values[i];
-			}
-			else ASSERT(false);
-		}
-
-		for(jj = 0; jj < jnum; jj++) {
-			j = jlist[jj];
-			j &= NEIGHMASK;
-
-			delx = xtmp - x[j][0];
-			dely = ytmp - x[j][1];
-			delz = ztmp - x[j][2];
-			rsq = delx*delx + dely*dely + delz*delz;
-
-			if(rsq < cutforcesq) {
-				jtype = type[j];
-				double r = sqrt(rsq);
-				const EAMTableIndex index = radiusToTableIndex(r);
-
-				// rhoip = derivative of (density at atom j due to atom i)
-				// rhojp = derivative of (density at atom i due to atom j)
-				// psip needs both fp[i] and fp[j] terms since r_ij appears in two
-				//   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
-				//   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
-				rhoip = RhoPrimeOfR(index, itype, jtype);
-				rhojp = RhoPrimeOfR(index, jtype, itype);
-				fpair = fp[i]*rhojp + fp[j]*rhoip;
-				recip = 1.0/r;
-
-				double x_j = -1;  // The value -1 indicates: no concentration dependence for this i-j pair
-				                  // because atom j is not of species A nor B.
-
-				// This code line is required for ternary alloy.
-				if(jtype == speciesA || jtype == speciesB) {
-					ASSERT(rho[i] != 0.0);
-					ASSERT(rho[j] != 0.0);
-
-					// Compute local concentration at site j.
-					x_j = rhoB[j]/rho[j];
-					ASSERT(x_j >= 0 && x_j<=1.0);
-
-					double D_j;
-					if(cdeamVersion == 1) {
-						// Calculate derivative of h(x_j) polynomial function.
-						double h_prime_j = evalHprime(x_j);
-						D_j = D_values[j] * h_prime_j / (2.0 * rho[j] * rho[j]);
-					}
-					else if(cdeamVersion == 2) {
-						D_j = D_values[j];
-					}
-					else ASSERT(false);
-
-					double t2 = -rhoB[j];
-					if(itype == speciesB) t2 += rho[j];
-					fpair += D_j * rhoip * t2;
-				}
-
-				// This if-clause is only required for a ternary alloy.
-				// Actually we don't need it at all because D_i should be zero anyway if
-				// atom i has no concentration dependent interactions (because it is not species A or B).
-				if(x_i != -1.0) {
-					double t1 = -rhoB[i];
-					if(jtype == speciesB) t1 += rho[i];
-					fpair += D_i * rhojp * t1;
-				}
-
-				double phip;
-				double phi = PhiOfR(index, itype, jtype, recip, phip);
-				if(itype == jtype || x_i == -1.0 || x_j == -1.0) {
-					// Case of no concentration dependence.
-					fpair += phip;
-				}
-				else {
-					// We have a concentration dependence for the i-j interaction.
-					double h;
-					if(cdeamVersion == 1) {
-						// Calculate h(x_i) polynomial function.
-						double h_i = evalH(x_i);
-						// Calculate h(x_j) polynomial function.
-						double h_j = evalH(x_j);
-						h = 0.5 * (h_i + h_j);
-					}
-					else if(cdeamVersion == 2) {
-						// Average concentration.
-						double x_ij = 0.5 * (x_i + x_j);
-						// Calculate h(x_ij) polynomial function.
-						h = evalH(x_ij);
-					}
-					else ASSERT(false);
-					fpair += h * phip;
-					phi *= h;
-				}
-
-				// Divide by r_ij and negate to get forces from gradient.
-				fpair /= -r;
-
-				f[i][0] += delx*fpair;
-				f[i][1] += dely*fpair;
-				f[i][2] += delz*fpair;
-				if(newton_pair || j < nlocal) {
-					f[j][0] -= delx*fpair;
-					f[j][1] -= dely*fpair;
-					f[j][2] -= delz*fpair;
-				}
-
-				if(eflag) evdwl = phi;
-				if(evflag) ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
-			}
-		}
-	}
-
-	if(vflag_fdotr) virial_fdotr_compute();
+        int i,j,ii,jj,inum,jnum,itype,jtype;
+        double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
+        double rsq,rhoip,rhojp,recip,phi;
+        int *ilist,*jlist,*numneigh,**firstneigh;
+
+        evdwl = 0.0;
+        if (eflag || vflag) ev_setup(eflag,vflag);
+        else evflag = vflag_fdotr = eflag_global = eflag_atom = 0;
+
+        // Grow per-atom arrays if necessary
+        if(atom->nmax > nmax) {
+                memory->destroy(rho);
+                memory->destroy(fp);
+                memory->destroy(rhoB);
+                memory->destroy(D_values);
+                nmax = atom->nmax;
+                memory->create(rho,nmax,"pair:rho");
+                memory->create(rhoB,nmax,"pair:rhoB");
+                memory->create(fp,nmax,"pair:fp");
+                memory->create(D_values,nmax,"pair:D_values");
+        }
+
+        double **x = atom->x;
+        double **f = atom->f;
+        int *type = atom->type;
+        int nlocal = atom->nlocal;
+        int newton_pair = force->newton_pair;
+
+        inum = list->inum;
+        ilist = list->ilist;
+        numneigh = list->numneigh;
+        firstneigh = list->firstneigh;
+
+        // Zero out per-atom arrays.
+        int m = nlocal + atom->nghost;
+        for(i = 0; i < m; i++) {
+                rho[i] = 0.0;
+                rhoB[i] = 0.0;
+                D_values[i] = 0.0;
+        }
+
+        // Stage I
+
+        // Compute rho and rhoB at each local atom site.
+        // Additionally calculate the D_i values here if we are using the one-site formulation.
+        // For the two-site formulation we have to calculate the D values in an extra loop (Stage II).
+        for(ii = 0; ii < inum; ii++) {
+                i = ilist[ii];
+                xtmp = x[i][0];
+                ytmp = x[i][1];
+                ztmp = x[i][2];
+                itype = type[i];
+                jlist = firstneigh[i];
+                jnum = numneigh[i];
+
+                for(jj = 0; jj < jnum; jj++) {
+                        j = jlist[jj];
+                        j &= NEIGHMASK;
+
+                        delx = xtmp - x[j][0];
+                        dely = ytmp - x[j][1];
+                        delz = ztmp - x[j][2];
+                        rsq = delx*delx + dely*dely + delz*delz;
+
+                        if(rsq < cutforcesq) {
+                                jtype = type[j];
+                                double r = sqrt(rsq);
+                                const EAMTableIndex index = radiusToTableIndex(r);
+                                double localrho = RhoOfR(index, jtype, itype);
+                                rho[i] += localrho;
+                                if(jtype == speciesB) rhoB[i] += localrho;
+                                if(newton_pair || j < nlocal) {
+                                        localrho = RhoOfR(index, itype, jtype);
+                                        rho[j] += localrho;
+                                        if(itype == speciesB) rhoB[j] += localrho;
+                                }
+
+                                if(cdeamVersion == 1 && itype != jtype) {
+                                        // Note: if the i-j interaction is not concentration dependent (because either
+                                        // i or j are not species A or B) then its contribution to D_i and D_j should
+                                        // be ignored.
+                                        // This if-clause is only required for a ternary.
+                                        if((itype == speciesA && jtype == speciesB) || (jtype == speciesA && itype == speciesB)) {
+                                                double Phi_AB = PhiOfR(index, itype, jtype, 1.0 / r);
+                                                D_values[i] += Phi_AB;
+                                                if(newton_pair || j < nlocal)
+                                                        D_values[j] += Phi_AB;
+                                        }
+                                }
+                        }
+                }
+        }
+
+        // Communicate and sum densities.
+        if(newton_pair) {
+                communicationStage = 1;
+                comm->reverse_comm_pair(this);
+        }
+
+        // fp = derivative of embedding energy at each atom
+        // phi = embedding energy at each atom
+        for(ii = 0; ii < inum; ii++) {
+                i = ilist[ii];
+                EAMTableIndex index = rhoToTableIndex(rho[i]);
+                fp[i] = FPrimeOfRho(index, type[i]);
+                if(eflag) {
+                        phi = FofRho(index, type[i]);
+                        if (eflag_global) eng_vdwl += phi;
+                        if (eflag_atom) eatom[i] += phi;
+                }
+        }
+
+        // Communicate derivative of embedding function and densities
+        // and D_values (this for one-site formulation only).
+        communicationStage = 2;
+        comm->forward_comm_pair(this);
+
+        // The electron densities may not drop to zero because then the concentration would no longer be defined.
+        // But the concentration is not needed anyway if there is no interaction with another atom, which is the case
+        // if the electron density is exactly zero. That's why the following lines have been commented out.
+        //
+        //for(i = 0; i < nlocal + atom->nghost; i++) {
+        //        if(rho[i] == 0 && (type[i] == speciesA || type[i] == speciesB))
+        //                error->one(FLERR,"CD-EAM potential routine: Detected atom with zero electron density.");
+        //}
+
+        // Stage II
+        // This is only required for the original two-site formulation of the CD-EAM potential.
+
+        if(cdeamVersion == 2) {
+                // Compute intermediate value D_i for each atom.
+                for(ii = 0; ii < inum; ii++) {
+                        i = ilist[ii];
+                        xtmp = x[i][0];
+                        ytmp = x[i][1];
+                        ztmp = x[i][2];
+                        itype = type[i];
+                        jlist = firstneigh[i];
+                        jnum = numneigh[i];
+
+                        // This code line is required for ternary alloys.
+                        if(itype != speciesA && itype != speciesB) continue;
+
+                        double x_i = rhoB[i] / rho[i];        // Concentration at atom i.
+
+                        for(jj = 0; jj < jnum; jj++) {
+                                j = jlist[jj];
+                                j &= NEIGHMASK;
+                                jtype = type[j];
+                                if(itype == jtype) continue;
+
+                                // This code line is required for ternary alloys.
+                                if(jtype != speciesA && jtype != speciesB) continue;
+
+                                delx = xtmp - x[j][0];
+                                dely = ytmp - x[j][1];
+                                delz = ztmp - x[j][2];
+                                rsq = delx*delx + dely*dely + delz*delz;
+
+                                if(rsq < cutforcesq) {
+                                        double r = sqrt(rsq);
+                                        const EAMTableIndex index = radiusToTableIndex(r);
+
+                                        // The concentration independent part of the cross pair potential.
+                                        double Phi_AB = PhiOfR(index, itype, jtype, 1.0 / r);
+
+                                        // Average concentration of two sites
+                                        double x_ij = 0.5 * (x_i + rhoB[j]/rho[j]);
+
+                                        // Calculate derivative of h(x_ij) polynomial function.
+                                        double h_prime = evalHprime(x_ij);
+
+                                        D_values[i] += h_prime * Phi_AB / (2.0 * rho[i] * rho[i]);
+                                        if(newton_pair || j < nlocal)
+                                                D_values[j] += h_prime * Phi_AB / (2.0 * rho[j] * rho[j]);
+                                }
+                        }
+                }
+
+                // Communicate and sum D values.
+                if(newton_pair) {
+                        communicationStage = 3;
+                        comm->reverse_comm_pair(this);
+                }
+                communicationStage = 4;
+                comm->forward_comm_pair(this);
+        }
+
+        // Stage III
+
+        // Compute force acting on each atom.
+        for(ii = 0; ii < inum; ii++) {
+                i = ilist[ii];
+                xtmp = x[i][0];
+                ytmp = x[i][1];
+                ztmp = x[i][2];
+                itype = type[i];
+
+                jlist = firstneigh[i];
+                jnum = numneigh[i];
+
+                // Concentration at site i
+                double x_i = -1.0;                // The value -1 indicates: no concentration dependence for all interactions of atom i.
+                                                                // It will be replaced by the concentration at site i if atom i is either A or B.
+
+                double D_i, h_prime_i;
+
+                // This if-clause is only required for ternary alloys.
+                if((itype == speciesA || itype == speciesB) && rho[i] != 0.0) {
+
+                        // Compute local concentration at site i.
+                        x_i = rhoB[i]/rho[i];
+                        ASSERT(x_i >= 0 && x_i<=1.0);
+
+                        if(cdeamVersion == 1) {
+                                // Calculate derivative of h(x_i) polynomial function.
+                                h_prime_i = evalHprime(x_i);
+                                D_i = D_values[i] * h_prime_i / (2.0 * rho[i] * rho[i]);
+                        }
+                        else if(cdeamVersion == 2) {
+                                D_i = D_values[i];
+                        }
+                        else ASSERT(false);
+                }
+
+                for(jj = 0; jj < jnum; jj++) {
+                        j = jlist[jj];
+                        j &= NEIGHMASK;
+
+                        delx = xtmp - x[j][0];
+                        dely = ytmp - x[j][1];
+                        delz = ztmp - x[j][2];
+                        rsq = delx*delx + dely*dely + delz*delz;
+
+                        if(rsq < cutforcesq) {
+                                jtype = type[j];
+                                double r = sqrt(rsq);
+                                const EAMTableIndex index = radiusToTableIndex(r);
+
+                                // rhoip = derivative of (density at atom j due to atom i)
+                                // rhojp = derivative of (density at atom i due to atom j)
+                                // psip needs both fp[i] and fp[j] terms since r_ij appears in two
+                                //   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
+                                //   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
+                                rhoip = RhoPrimeOfR(index, itype, jtype);
+                                rhojp = RhoPrimeOfR(index, jtype, itype);
+                                fpair = fp[i]*rhojp + fp[j]*rhoip;
+                                recip = 1.0/r;
+
+                                double x_j = -1;  // The value -1 indicates: no concentration dependence for this i-j pair
+                                                  // because atom j is not of species A nor B.
+
+                                // This code line is required for ternary alloy.
+                                if(jtype == speciesA || jtype == speciesB) {
+                                        ASSERT(rho[i] != 0.0);
+                                        ASSERT(rho[j] != 0.0);
+
+                                        // Compute local concentration at site j.
+                                        x_j = rhoB[j]/rho[j];
+                                        ASSERT(x_j >= 0 && x_j<=1.0);
+
+                                        double D_j;
+                                        if(cdeamVersion == 1) {
+                                                // Calculate derivative of h(x_j) polynomial function.
+                                                double h_prime_j = evalHprime(x_j);
+                                                D_j = D_values[j] * h_prime_j / (2.0 * rho[j] * rho[j]);
+                                        }
+                                        else if(cdeamVersion == 2) {
+                                                D_j = D_values[j];
+                                        }
+                                        else ASSERT(false);
+
+                                        double t2 = -rhoB[j];
+                                        if(itype == speciesB) t2 += rho[j];
+                                        fpair += D_j * rhoip * t2;
+                                }
+
+                                // This if-clause is only required for a ternary alloy.
+                                // Actually we don't need it at all because D_i should be zero anyway if
+                                // atom i has no concentration dependent interactions (because it is not species A or B).
+                                if(x_i != -1.0) {
+                                        double t1 = -rhoB[i];
+                                        if(jtype == speciesB) t1 += rho[i];
+                                        fpair += D_i * rhojp * t1;
+                                }
+
+                                double phip;
+                                double phi = PhiOfR(index, itype, jtype, recip, phip);
+                                if(itype == jtype || x_i == -1.0 || x_j == -1.0) {
+                                        // Case of no concentration dependence.
+                                        fpair += phip;
+                                }
+                                else {
+                                        // We have a concentration dependence for the i-j interaction.
+                                        double h;
+                                        if(cdeamVersion == 1) {
+                                                // Calculate h(x_i) polynomial function.
+                                                double h_i = evalH(x_i);
+                                                // Calculate h(x_j) polynomial function.
+                                                double h_j = evalH(x_j);
+                                                h = 0.5 * (h_i + h_j);
+                                        }
+                                        else if(cdeamVersion == 2) {
+                                                // Average concentration.
+                                                double x_ij = 0.5 * (x_i + x_j);
+                                                // Calculate h(x_ij) polynomial function.
+                                                h = evalH(x_ij);
+                                        }
+                                        else ASSERT(false);
+                                        fpair += h * phip;
+                                        phi *= h;
+                                }
+
+                                // Divide by r_ij and negate to get forces from gradient.
+                                fpair /= -r;
+
+                                f[i][0] += delx*fpair;
+                                f[i][1] += dely*fpair;
+                                f[i][2] += delz*fpair;
+                                if(newton_pair || j < nlocal) {
+                                        f[j][0] -= delx*fpair;
+                                        f[j][1] -= dely*fpair;
+                                        f[j][2] -= delz*fpair;
+                                }
+
+                                if(eflag) evdwl = phi;
+                                if(evflag) ev_tally(i,j,nlocal,newton_pair,evdwl,0.0,fpair,delx,dely,delz);
+                        }
+                }
+        }
+
+        if(vflag_fdotr) virial_fdotr_compute();
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairCDEAM::coeff(int narg, char **arg)
 {
-	PairEAMAlloy::coeff(narg, arg);
-
-	// Make sure the EAM file is a CD-EAM binary alloy.
-	if(setfl->nelements < 2)
-		error->all(FLERR,"The EAM file must contain at least 2 elements to be used with the eam/cd pair style.");
-
-	// Read in the coefficients of the h polynomial from the end of the EAM file.
-	read_h_coeff(arg[2]);
-
-	// Determine which atom type is the A species and which is the B species in the alloy.
-	// By default take the first element (index 0) in the EAM file as the A species
-	// and the second element (index 1) in the EAM file as the B species.
-	speciesA = -1;
-	speciesB = -1;
-	for(int i = 1; i <= atom->ntypes; i++) {
-		if(map[i] == 0) {
-			if(speciesA >= 0)
-				error->all(FLERR,"The first element from the EAM file may only be mapped to a single atom type.");
-			speciesA = i;
-		}
-		if(map[i] == 1) {
-			if(speciesB >= 0)
-				error->all(FLERR,"The second element from the EAM file may only be mapped to a single atom type.");
-			speciesB = i;
-		}
-	}
-	if(speciesA < 0)
-		error->all(FLERR,"The first element from the EAM file must be mapped to exactly one atom type.");
-	if(speciesB < 0)
-		error->all(FLERR,"The second element from the EAM file must be mapped to exactly one atom type.");
+        PairEAMAlloy::coeff(narg, arg);
+
+        // Make sure the EAM file is a CD-EAM binary alloy.
+        if(setfl->nelements < 2)
+                error->all(FLERR,"The EAM file must contain at least 2 elements to be used with the eam/cd pair style.");
+
+        // Read in the coefficients of the h polynomial from the end of the EAM file.
+        read_h_coeff(arg[2]);
+
+        // Determine which atom type is the A species and which is the B species in the alloy.
+        // By default take the first element (index 0) in the EAM file as the A species
+        // and the second element (index 1) in the EAM file as the B species.
+        speciesA = -1;
+        speciesB = -1;
+        for(int i = 1; i <= atom->ntypes; i++) {
+                if(map[i] == 0) {
+                        if(speciesA >= 0)
+                                error->all(FLERR,"The first element from the EAM file may only be mapped to a single atom type.");
+                        speciesA = i;
+                }
+                if(map[i] == 1) {
+                        if(speciesB >= 0)
+                                error->all(FLERR,"The second element from the EAM file may only be mapped to a single atom type.");
+                        speciesB = i;
+                }
+        }
+        if(speciesA < 0)
+                error->all(FLERR,"The first element from the EAM file must be mapped to exactly one atom type.");
+        if(speciesB < 0)
+                error->all(FLERR,"The second element from the EAM file must be mapped to exactly one atom type.");
 }
 
 /* ----------------------------------------------------------------------
@@ -456,41 +456,41 @@ void PairCDEAM::coeff(int narg, char **arg)
 ------------------------------------------------------------------------- */
 void PairCDEAM::read_h_coeff(char *filename)
 {
-	if(comm->me == 0) {
-		// Open potential file
-		FILE *fp;
-		char line[MAXLINE];
-		char nextline[MAXLINE];
-		fp = fopen(filename,"r");
-		if (fp == NULL) {
-			char str[128];
-			sprintf(str,"Cannot open EAM potential file %s", filename);
-			error->one(FLERR,str);
-		}
-
-		// h coefficients are stored at the end of the file.
-		// Skip to last line of file.
-		while(fgets(nextline, MAXLINE, fp) != NULL) {
-			strcpy(line, nextline);
-		}
-		char* ptr = strtok(line, " \t\n\r\f");
-		int degree = atoi(ptr);
-		nhcoeff = degree+1;
-		hcoeff = new double[nhcoeff];
-		int i = 0;
-		while((ptr = strtok(NULL," \t\n\r\f")) != NULL && i < nhcoeff) {
-			hcoeff[i++] = atof(ptr);
-		}
-		if(i != nhcoeff || nhcoeff < 1)
-			error->one(FLERR,"Failed to read h(x) function coefficients from EAM file.");
-
-		// Close the potential file.
-		fclose(fp);
-	}
-
-	MPI_Bcast(&nhcoeff, 1, MPI_INT, 0, world);
-	if(comm->me != 0) hcoeff = new double[nhcoeff];
-	MPI_Bcast(hcoeff, nhcoeff, MPI_DOUBLE, 0, world);
+        if(comm->me == 0) {
+                // Open potential file
+                FILE *fp;
+                char line[MAXLINE];
+                char nextline[MAXLINE];
+                fp = fopen(filename,"r");
+                if (fp == NULL) {
+                        char str[128];
+                        sprintf(str,"Cannot open EAM potential file %s", filename);
+                        error->one(FLERR,str);
+                }
+
+                // h coefficients are stored at the end of the file.
+                // Skip to last line of file.
+                while(fgets(nextline, MAXLINE, fp) != NULL) {
+                        strcpy(line, nextline);
+                }
+                char* ptr = strtok(line, " \t\n\r\f");
+                int degree = atoi(ptr);
+                nhcoeff = degree+1;
+                hcoeff = new double[nhcoeff];
+                int i = 0;
+                while((ptr = strtok(NULL," \t\n\r\f")) != NULL && i < nhcoeff) {
+                        hcoeff[i++] = atof(ptr);
+                }
+                if(i != nhcoeff || nhcoeff < 1)
+                        error->one(FLERR,"Failed to read h(x) function coefficients from EAM file.");
+
+                // Close the potential file.
+                fclose(fp);
+        }
+
+        MPI_Bcast(&nhcoeff, 1, MPI_INT, 0, world);
+        if(comm->me != 0) hcoeff = new double[nhcoeff];
+        MPI_Bcast(hcoeff, nhcoeff, MPI_DOUBLE, 0, world);
 }
 
 
@@ -498,140 +498,140 @@ void PairCDEAM::read_h_coeff(char *filename)
 
 int PairCDEAM::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
 {
-	int i,j,m;
-
-	m = 0;
-	if(communicationStage == 2) {
-		if(cdeamVersion == 1) {
-			for (i = 0; i < n; i++) {
-				j = list[i];
-				buf[m++] = fp[j];
-				buf[m++] = rho[j];
-				buf[m++] = rhoB[j];
-				buf[m++] = D_values[j];
-			}
-			return 4;
-		}
-		else if(cdeamVersion == 2) {
-			for (i = 0; i < n; i++) {
-				j = list[i];
-				buf[m++] = fp[j];
-				buf[m++] = rho[j];
-				buf[m++] = rhoB[j];
-			}
-			return 3;
-		}
-		else { ASSERT(false); return 0; }
-	}
-	else if(communicationStage == 4) {
-		for (i = 0; i < n; i++) {
-			j = list[i];
-			buf[m++] = D_values[j];
-		}
-		return 1;
-	}
-	else return 0;
+        int i,j,m;
+
+        m = 0;
+        if(communicationStage == 2) {
+                if(cdeamVersion == 1) {
+                        for (i = 0; i < n; i++) {
+                                j = list[i];
+                                buf[m++] = fp[j];
+                                buf[m++] = rho[j];
+                                buf[m++] = rhoB[j];
+                                buf[m++] = D_values[j];
+                        }
+                        return 4;
+                }
+                else if(cdeamVersion == 2) {
+                        for (i = 0; i < n; i++) {
+                                j = list[i];
+                                buf[m++] = fp[j];
+                                buf[m++] = rho[j];
+                                buf[m++] = rhoB[j];
+                        }
+                        return 3;
+                }
+                else { ASSERT(false); return 0; }
+        }
+        else if(communicationStage == 4) {
+                for (i = 0; i < n; i++) {
+                        j = list[i];
+                        buf[m++] = D_values[j];
+                }
+                return 1;
+        }
+        else return 0;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairCDEAM::unpack_comm(int n, int first, double *buf)
 {
-	int i,m,last;
-
-	m = 0;
-	last = first + n;
-	if(communicationStage == 2) {
-		if(cdeamVersion == 1) {
-			for(i = first; i < last; i++) {
-				fp[i] = buf[m++];
-				rho[i] = buf[m++];
-				rhoB[i] = buf[m++];
-				D_values[i] = buf[m++];
-			}
-		}
-		else if(cdeamVersion == 2) {
-			for(i = first; i < last; i++) {
-				fp[i] = buf[m++];
-				rho[i] = buf[m++];
-				rhoB[i] = buf[m++];
-			}
-		}
-		else ASSERT(false);
-	}
-	else if(communicationStage == 4) {
-		for(i = first; i < last; i++) {
-			D_values[i] = buf[m++];
-		}
-	}
+        int i,m,last;
+
+        m = 0;
+        last = first + n;
+        if(communicationStage == 2) {
+                if(cdeamVersion == 1) {
+                        for(i = first; i < last; i++) {
+                                fp[i] = buf[m++];
+                                rho[i] = buf[m++];
+                                rhoB[i] = buf[m++];
+                                D_values[i] = buf[m++];
+                        }
+                }
+                else if(cdeamVersion == 2) {
+                        for(i = first; i < last; i++) {
+                                fp[i] = buf[m++];
+                                rho[i] = buf[m++];
+                                rhoB[i] = buf[m++];
+                        }
+                }
+                else ASSERT(false);
+        }
+        else if(communicationStage == 4) {
+                for(i = first; i < last; i++) {
+                        D_values[i] = buf[m++];
+                }
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 int PairCDEAM::pack_reverse_comm(int n, int first, double *buf)
 {
-	int i,m,last;
-
-	m = 0;
-	last = first + n;
-
-	if(communicationStage == 1) {
-		if(cdeamVersion == 1) {
-			for(i = first; i < last; i++) {
-				buf[m++] = rho[i];
-				buf[m++] = rhoB[i];
-				buf[m++] = D_values[i];
-			}
-			return 3;
-		}
-		else if(cdeamVersion == 2) {
-			for(i = first; i < last; i++) {
-				buf[m++] = rho[i];
-				buf[m++] = rhoB[i];
-			}
-			return 2;
-		}
-		else { ASSERT(false); return 0; }
-	}
-	else if(communicationStage == 3) {
-		for(i = first; i < last; i++) {
-			buf[m++] = D_values[i];
-		}
-		return 1;
-	}
-	else return 0;
+        int i,m,last;
+
+        m = 0;
+        last = first + n;
+
+        if(communicationStage == 1) {
+                if(cdeamVersion == 1) {
+                        for(i = first; i < last; i++) {
+                                buf[m++] = rho[i];
+                                buf[m++] = rhoB[i];
+                                buf[m++] = D_values[i];
+                        }
+                        return 3;
+                }
+                else if(cdeamVersion == 2) {
+                        for(i = first; i < last; i++) {
+                                buf[m++] = rho[i];
+                                buf[m++] = rhoB[i];
+                        }
+                        return 2;
+                }
+                else { ASSERT(false); return 0; }
+        }
+        else if(communicationStage == 3) {
+                for(i = first; i < last; i++) {
+                        buf[m++] = D_values[i];
+                }
+                return 1;
+        }
+        else return 0;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairCDEAM::unpack_reverse_comm(int n, int *list, double *buf)
 {
-	int i,j,m;
-
-	m = 0;
-	if(communicationStage == 1) {
-		if(cdeamVersion == 1) {
-			for(i = 0; i < n; i++) {
-				j = list[i];
-				rho[j] += buf[m++];
-				rhoB[j] += buf[m++];
-				D_values[j] += buf[m++];
-			}
-		}
-		else if(cdeamVersion == 2) {
-			for(i = 0; i < n; i++) {
-				j = list[i];
-				rho[j] += buf[m++];
-				rhoB[j] += buf[m++];
-			}
-		}
-		else ASSERT(false);
-	}
-	else if(communicationStage == 3) {
-		for(i = 0; i < n; i++) {
-			j = list[i];
-			D_values[j] += buf[m++];
-		}
-	}
+        int i,j,m;
+
+        m = 0;
+        if(communicationStage == 1) {
+                if(cdeamVersion == 1) {
+                        for(i = 0; i < n; i++) {
+                                j = list[i];
+                                rho[j] += buf[m++];
+                                rhoB[j] += buf[m++];
+                                D_values[j] += buf[m++];
+                        }
+                }
+                else if(cdeamVersion == 2) {
+                        for(i = 0; i < n; i++) {
+                                j = list[i];
+                                rho[j] += buf[m++];
+                                rhoB[j] += buf[m++];
+                        }
+                }
+                else ASSERT(false);
+        }
+        else if(communicationStage == 3) {
+                for(i = 0; i < n; i++) {
+                        j = list[i];
+                        D_values[j] += buf[m++];
+                }
+        }
 }
 
 /* ----------------------------------------------------------------------
@@ -639,6 +639,6 @@ void PairCDEAM::unpack_reverse_comm(int n, int *list, double *buf)
 ------------------------------------------------------------------------- */
 double PairCDEAM::memory_usage()
 {
-	double bytes = 2 * nmax * sizeof(double);
-	return PairEAMAlloy::memory_usage() + bytes;
+        double bytes = 2 * nmax * sizeof(double);
+        return PairEAMAlloy::memory_usage() + bytes;
 }
diff --git a/src/USER-MISC/pair_cdeam.h b/src/USER-MISC/pair_cdeam.h
index 836ad2fe7c..efc1b58012 100644
--- a/src/USER-MISC/pair_cdeam.h
+++ b/src/USER-MISC/pair_cdeam.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -36,25 +36,25 @@ public:
 
   /// Calculates the energies and forces for all atoms in the system.
   virtual void compute(int, int);
-  
+
   /// Parses the pair_coeff command parameters for this pair style.
   void coeff(int, char **);
-  
+
   /// This is for MPI communication with neighbor nodes.
   int pack_comm(int, int *, double *, int, int *);
   void unpack_comm(int, int, double *);
   int pack_reverse_comm(int, int, double *);
   void unpack_reverse_comm(int, int *, double *);
-  
+
   /// Reports the memory usage of this pair style to LAMMPS.
   double memory_usage();
-  
+
   /// Parses the coefficients of the h polynomial from the end of the EAM file.
   void read_h_coeff(char* filename);
-  
+
  public:
   // The public interface exposed by this potential class.
-  
+
   // Evaluates the h(x) polynomial for a given local concentration x.
   inline double evalH(double x) const {
     double v = 0.0;
@@ -63,7 +63,7 @@ public:
     }
     return v + hcoeff[0];
   };
-  
+
   // Calculates the derivative of the h(x) polynomial.
   inline double evalHprime(double x) const {
     double v = 0.0;
@@ -72,7 +72,7 @@ public:
     }
     return v + hcoeff[1];
   };
-  
+
   // We have two versions of the CD-EAM potential. The user can choose which one he wants to use:
   //
   // Version 1 - One-site concentration: The h(x_i) function depends only on the concentration at the atomic site i.
@@ -82,39 +82,39 @@ public:
   // Version 2 - Two-site concentration: The h(x_ij) function depends on the concentrations at two atomic sites i and j.
   // This is the original version from the 2005 PRL paper.
   int cdeamVersion;
-  
+
   // Per-atom arrays
-  
+
   // The partial density of B atoms at each atom site.
   double *rhoB;
-  
+
   // The intermediate value D_i for each atom.
   // The meaning of these values depend on the version of the CD-EAM potential used:
   //
-  //   For the one-site concentration version these are the v_i values defined in equation (21) 
+  //   For the one-site concentration version these are the v_i values defined in equation (21)
   //   of the MSMSE paper.
   //
-  //   For the old two-site concentration version these are the M_i values defined in equation (12) 
+  //   For the old two-site concentration version these are the M_i values defined in equation (12)
   //   of the MSMSE paper.
   double *D_values;
-  
+
   // The atom type index that is considered to be the A species in the alloy.
   int speciesA;
-  
+
   // The atom type index that is considered to be the B species in the alloy.
   int speciesB;
-  
+
  protected:
-  
+
   // Evaluation functions:
-  
-  // This structure specifies an entry in one of the EAM spline tables 
+
+  // This structure specifies an entry in one of the EAM spline tables
   // and the corresponding floating point part.
   typedef struct {
     int m;
     double p;
   } EAMTableIndex;
-  
+
   // Converts a radius value to an index value to be used in a spline table lookup.
   inline EAMTableIndex radiusToTableIndex(double r) const {
     EAMTableIndex index;
@@ -125,7 +125,7 @@ public:
     index.p = index.p <= 1.0 ? index.p : 1.0;
     return index;
   };
-  
+
   // Converts a density value to an index value to be used in a spline table lookup.
   inline EAMTableIndex rhoToTableIndex(double rho) const {
     EAMTableIndex index;
@@ -136,31 +136,31 @@ public:
     index.p = index.p <= 1.0 ? index.p : 1.0;
     return index;
   };
-  
+
   // Computes the derivative of rho(r)
   inline double RhoPrimeOfR(const EAMTableIndex& index, int itype, int jtype) const {
     const double* coeff = rhor_spline[type2rhor[itype][jtype]][index.m];
     return (coeff[0]*index.p + coeff[1])*index.p + coeff[2];
   };
-  
+
   // Computes rho(r)
   inline double RhoOfR(const EAMTableIndex& index, int itype, int jtype) const {
     const double* coeff = rhor_spline[type2rhor[itype][jtype]][index.m];
     return ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6];
   };
-  
+
   // Computes the derivative of F(rho)
   inline double FPrimeOfRho(const EAMTableIndex& index, int itype) const {
     const double* coeff = frho_spline[type2frho[itype]][index.m];
     return (coeff[0]*index.p + coeff[1])*index.p + coeff[2];
   };
-  
+
   // Computes F(rho)
   inline double FofRho(const EAMTableIndex& index, int itype) const {
     const double* coeff = frho_spline[type2frho[itype]][index.m];
     return ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6];
   };
-  
+
   // Computes the derivative of z2(r)
   inline double Z2PrimeOfR(const EAMTableIndex& index, int itype, int jtype) const {
     const double* coeff = z2r_spline[type2z2r[itype][jtype]][index.m];
@@ -172,7 +172,7 @@ public:
     const double* coeff = z2r_spline[type2z2r[itype][jtype]][index.m];
     return ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6];
   };
-  
+
   // Computes pair potential V_ij(r).
   inline double PhiOfR(const EAMTableIndex& index, int itype, int jtype, const double oneOverR) const {
     // phi = pair potential energy
@@ -181,7 +181,7 @@ public:
     const double z2 = ((coeff[3]*index.p + coeff[4])*index.p + coeff[5])*index.p + coeff[6];
     return z2 * oneOverR;
   };
-  
+
   // Computes pair potential V_ij(r) and its derivative.
   inline double PhiOfR(const EAMTableIndex& index, int itype, int jtype, const double oneOverR, double& phid) const {
     // phi = pair potential energy
@@ -195,19 +195,19 @@ public:
     phid = z2p * oneOverR - phi * oneOverR;
     return phi;
   };
-  
+
   // Parameters
-  
+
   // h() polynomial function coefficients
   double* hcoeff;
   // The number of coefficients in the polynomial.
   int nhcoeff;
-  
+
   // This specifies the calculation stage to let the pack/unpack communication routines know
   // which data to exchange.
   int communicationStage;
 };
- 
+
 /// The one-site concentration formulation of CD-EAM.
  class PairCDEAM_OneSite : public PairCDEAM
    {
@@ -215,7 +215,7 @@ public:
      /// Constructor.
      PairCDEAM_OneSite(class LAMMPS* lmp) : PairEAM(lmp), PairCDEAM(lmp, 1) {}
    };
- 
+
  /// The two-site concentration formulation of CD-EAM.
  class PairCDEAM_TwoSite : public PairCDEAM
    {
@@ -223,7 +223,7 @@ public:
      /// Constructor.
      PairCDEAM_TwoSite(class LAMMPS* lmp) : PairEAM(lmp), PairCDEAM(lmp, 2) {}
    };
- 
+
 }
 
 #endif
diff --git a/src/USER-MISC/pair_coul_diel.cpp b/src/USER-MISC/pair_coul_diel.cpp
index 7f63b1a201..8fb4ef6372 100644
--- a/src/USER-MISC/pair_coul_diel.cpp
+++ b/src/USER-MISC/pair_coul_diel.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -100,31 +100,31 @@ void PairCoulDiel::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	rarg = (r-rme[itype][jtype])/sigmae[itype][jtype];
-	th=tanh(rarg);
-	epsr=a_eps+b_eps*th;
-	depsdr=b_eps * (1.0 - th*th) / sigmae[itype][jtype];
-	
-	forcecoul = qqrd2e*qtmp*q[j]*((eps_s*(epsr+r*depsdr)/epsr/epsr) -1.)/rsq;
-	fpair = factor_coul*forcecoul/r;
-	
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  ecoul = (qqrd2e*qtmp*q[j]*((eps_s/epsr) -1.)/r) - offset[itype][jtype];
-	  ecoul *= factor_coul;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,0.0,
-			     ecoul,fpair,delx,dely,delz);
+        r = sqrt(rsq);
+        rarg = (r-rme[itype][jtype])/sigmae[itype][jtype];
+        th=tanh(rarg);
+        epsr=a_eps+b_eps*th;
+        depsdr=b_eps * (1.0 - th*th) / sigmae[itype][jtype];
+
+        forcecoul = qqrd2e*qtmp*q[j]*((eps_s*(epsr+r*depsdr)/epsr/epsr) -1.)/rsq;
+        fpair = factor_coul*forcecoul/r;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          ecoul = (qqrd2e*qtmp*q[j]*((eps_s/epsr) -1.)/r) - offset[itype][jtype];
+          ecoul *= factor_coul;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,0.0,
+                             ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -169,7 +169,7 @@ void PairCoulDiel::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -189,8 +189,8 @@ void PairCoulDiel::coeff(int narg, char **arg)
   eps_s = force->numeric(arg[2]);
   double rme_one =force->numeric(arg[3]);
   double sigmae_one = force->numeric(arg[4]);
-  
-  double cut_one = cut_global;  
+
+  double cut_one = cut_global;
   if (narg == 6) cut_one = force->numeric(arg[5]);
 
   int count = 0;
@@ -234,14 +234,14 @@ double PairCoulDiel::init_one(int i, int j)
 
   double *q = atom->q;
   double qqrd2e = force->qqrd2e;
- 
+
   if (offset_flag) {
     double rarg = (cut[i][j]-rme[i][j])/sigmae[i][j];
     double epsr=a_eps+b_eps*tanh(rarg);
     offset[i][j] = qqrd2e*q[i]*q[j]*((eps_s/epsr) -1.)/cut[i][j];
   } else offset[i][j] = 0.0;
-  
-  
+
+
   sigmae[j][i] = sigmae[i][j];
   rme[j][i] = rme[i][j];
   offset[j][i] = offset[i][j];
@@ -263,9 +263,9 @@ void PairCoulDiel::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&rme[i][j],sizeof(double),1,fp);
-	fwrite(&sigmae[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&rme[i][j],sizeof(double),1,fp);
+        fwrite(&sigmae[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -284,14 +284,14 @@ void PairCoulDiel::read_restart(FILE *fp)
   for (i = 1; i <= atom->ntypes; i++)
     for (j = i; j <= atom->ntypes; j++) {
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&rme[i][j],sizeof(double),1,fp);
-	  fread(&sigmae[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&rme[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigmae[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&rme[i][j],sizeof(double),1,fp);
+          fread(&sigmae[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&rme[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigmae[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -326,8 +326,8 @@ void PairCoulDiel::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairCoulDiel::single(int i, int j, int itype, int jtype,
-			   double rsq, double factor_coul, double factor_lj,
-			   double &fforce)
+                           double rsq, double factor_coul, double factor_lj,
+                           double &fforce)
 {
   double r, rarg,forcedielec,phidielec;
   double th,epsr,depsdr;
@@ -339,10 +339,10 @@ double PairCoulDiel::single(int i, int j, int itype, int jtype,
   th = tanh(rarg);
   epsr=a_eps+b_eps*th;
   depsdr=b_eps*(1.-th*th)/sigmae[itype][jtype];
-	
+
   forcedielec = qqrd2e*q[i]*q[j]*((eps_s*(epsr+r*depsdr)/epsr/epsr) -1.)/rsq;
   fforce = factor_coul*forcedielec/r;
-    
+
   phidielec = (qqrd2e*q[i]*q[j]*((eps_s/epsr) -1.)/r)- offset[itype][jtype];
   return factor_coul*phidielec;
 }
diff --git a/src/USER-MISC/pair_coul_diel.h b/src/USER-MISC/pair_coul_diel.h
index 14d7b8b143..2113e45680 100644
--- a/src/USER-MISC/pair_coul_diel.h
+++ b/src/USER-MISC/pair_coul_diel.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/pair_dipole_sf.cpp b/src/USER-MISC/pair_dipole_sf.cpp
index bd9e900c52..61534e6ec3 100644
--- a/src/USER-MISC/pair_dipole_sf.cpp
+++ b/src/USER-MISC/pair_dipole_sf.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -93,7 +93,7 @@ void PairDipoleSF::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -119,168 +119,168 @@ void PairDipoleSF::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	rinv = sqrt(r2inv);
+        r2inv = 1.0/rsq;
+        rinv = sqrt(r2inv);
+
+        // atom can have both a charge and dipole
+        // i,j = charge-charge, dipole-dipole, dipole-charge, or charge-dipole
 
-	// atom can have both a charge and dipole
-	// i,j = charge-charge, dipole-dipole, dipole-charge, or charge-dipole
+        forcecoulx = forcecouly = forcecoulz = 0.0;
+        tixcoul = tiycoul = tizcoul = 0.0;
+        tjxcoul = tjycoul = tjzcoul = 0.0;
 
-	forcecoulx = forcecouly = forcecoulz = 0.0;
-	tixcoul = tiycoul = tizcoul = 0.0;
-	tjxcoul = tjycoul = tjzcoul = 0.0;
-	
-	if (rsq < cut_coulsq[itype][jtype]) {
+        if (rsq < cut_coulsq[itype][jtype]) {
 
-	  if (qtmp != 0.0 && q[j] != 0.0) {
+          if (qtmp != 0.0 && q[j] != 0.0) {
             pre1 = qtmp*q[j]*rinv*(r2inv-1.0/cut_coulsq[itype][jtype]);
 
-	    forcecoulx += pre1*delx;
-	    forcecouly += pre1*dely;
-	    forcecoulz += pre1*delz;
-	  }
+            forcecoulx += pre1*delx;
+            forcecouly += pre1*dely;
+            forcecoulz += pre1*delz;
+          }
 
-	  if (mu[i][3] > 0.0 && mu[j][3] > 0.0) { 
+          if (mu[i][3] > 0.0 && mu[j][3] > 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
-	    rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
+            rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
 
             pdotp = mu[i][0]*mu[j][0] + mu[i][1]*mu[j][1] + mu[i][2]*mu[j][2];
             pidotr = mu[i][0]*delx + mu[i][1]*dely + mu[i][2]*delz;
             pjdotr = mu[j][0]*delx + mu[j][1]*dely + mu[j][2]*delz;
 
-	    afac = 1.0 - rsq*rsq * rcutcoul2inv*rcutcoul2inv;
-	    pre1 = afac * ( pdotp - 3.0 * r2inv * pidotr * pjdotr );
-	    aforcecoulx = pre1*delx;
-	    aforcecouly = pre1*dely;
-	    aforcecoulz = pre1*delz;
-	    
-	    bfac = 1.0 - 4.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv) +
-	      3.0*rsq*rsq*rcutcoul2inv*rcutcoul2inv;
-	    presf = 2.0 * r2inv * pidotr * pjdotr;
-	    bforcecoulx = bfac * (pjdotr*mu[i][0]+pidotr*mu[j][0]-presf*delx);
-	    bforcecouly = bfac * (pjdotr*mu[i][1]+pidotr*mu[j][1]-presf*dely);
-	    bforcecoulz = bfac * (pjdotr*mu[i][2]+pidotr*mu[j][2]-presf*delz);
-	    
-	    forcecoulx += 3.0 * r5inv * ( aforcecoulx + bforcecoulx );
-	    forcecouly += 3.0 * r5inv * ( aforcecouly + bforcecouly );
-	    forcecoulz += 3.0 * r5inv * ( aforcecoulz + bforcecoulz );
-	    
-	    pre2 = 3.0 * bfac * r5inv * pjdotr;
-	    pre3 = 3.0 * bfac * r5inv * pidotr;
-	    pre4 = -bfac * r3inv;
-	    
-	    crossx = pre4 * (mu[i][1]*mu[j][2] - mu[i][2]*mu[j][1]);
-	    crossy = pre4 * (mu[i][2]*mu[j][0] - mu[i][0]*mu[j][2]);
-	    crossz = pre4 * (mu[i][0]*mu[j][1] - mu[i][1]*mu[j][0]);
-
-	    tixcoul += crossx + pre2 * (mu[i][1]*delz - mu[i][2]*dely);
-	    tiycoul += crossy + pre2 * (mu[i][2]*delx - mu[i][0]*delz);
-	    tizcoul += crossz + pre2 * (mu[i][0]*dely - mu[i][1]*delx);
-	    tjxcoul += -crossx + pre3 * (mu[j][1]*delz - mu[j][2]*dely);
-	    tjycoul += -crossy + pre3 * (mu[j][2]*delx - mu[j][0]*delz);
-	    tjzcoul += -crossz + pre3 * (mu[j][0]*dely - mu[j][1]*delx);
-	  }
-
-	  if (mu[i][3] > 0.0 && q[j] != 0.0) { 
+            afac = 1.0 - rsq*rsq * rcutcoul2inv*rcutcoul2inv;
+            pre1 = afac * ( pdotp - 3.0 * r2inv * pidotr * pjdotr );
+            aforcecoulx = pre1*delx;
+            aforcecouly = pre1*dely;
+            aforcecoulz = pre1*delz;
+
+            bfac = 1.0 - 4.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv) +
+              3.0*rsq*rsq*rcutcoul2inv*rcutcoul2inv;
+            presf = 2.0 * r2inv * pidotr * pjdotr;
+            bforcecoulx = bfac * (pjdotr*mu[i][0]+pidotr*mu[j][0]-presf*delx);
+            bforcecouly = bfac * (pjdotr*mu[i][1]+pidotr*mu[j][1]-presf*dely);
+            bforcecoulz = bfac * (pjdotr*mu[i][2]+pidotr*mu[j][2]-presf*delz);
+
+            forcecoulx += 3.0 * r5inv * ( aforcecoulx + bforcecoulx );
+            forcecouly += 3.0 * r5inv * ( aforcecouly + bforcecouly );
+            forcecoulz += 3.0 * r5inv * ( aforcecoulz + bforcecoulz );
+
+            pre2 = 3.0 * bfac * r5inv * pjdotr;
+            pre3 = 3.0 * bfac * r5inv * pidotr;
+            pre4 = -bfac * r3inv;
+
+            crossx = pre4 * (mu[i][1]*mu[j][2] - mu[i][2]*mu[j][1]);
+            crossy = pre4 * (mu[i][2]*mu[j][0] - mu[i][0]*mu[j][2]);
+            crossz = pre4 * (mu[i][0]*mu[j][1] - mu[i][1]*mu[j][0]);
+
+            tixcoul += crossx + pre2 * (mu[i][1]*delz - mu[i][2]*dely);
+            tiycoul += crossy + pre2 * (mu[i][2]*delx - mu[i][0]*delz);
+            tizcoul += crossz + pre2 * (mu[i][0]*dely - mu[i][1]*delx);
+            tjxcoul += -crossx + pre3 * (mu[j][1]*delz - mu[j][2]*dely);
+            tjycoul += -crossy + pre3 * (mu[j][2]*delx - mu[j][0]*delz);
+            tjzcoul += -crossz + pre3 * (mu[j][0]*dely - mu[j][1]*delx);
+          }
+
+          if (mu[i][3] > 0.0 && q[j] != 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
             pidotr = mu[i][0]*delx + mu[i][1]*dely + mu[i][2]*delz;
-	    rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
-	    pre1 = 3.0 * q[j] * r5inv * pidotr * (1-rsq*rcutcoul2inv);
-	    pqfac = 1.0 - 3.0*rsq*rcutcoul2inv + 
-	      2.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv);
-	    pre2 = q[j] * r3inv * pqfac;
+            rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
+            pre1 = 3.0 * q[j] * r5inv * pidotr * (1-rsq*rcutcoul2inv);
+            pqfac = 1.0 - 3.0*rsq*rcutcoul2inv +
+              2.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv);
+            pre2 = q[j] * r3inv * pqfac;
 
-	    forcecoulx += pre2*mu[i][0] - pre1*delx;
+            forcecoulx += pre2*mu[i][0] - pre1*delx;
             forcecouly += pre2*mu[i][1] - pre1*dely;
             forcecoulz += pre2*mu[i][2] - pre1*delz;
-	    tixcoul += pre2 * (mu[i][1]*delz - mu[i][2]*dely);
-	    tiycoul += pre2 * (mu[i][2]*delx - mu[i][0]*delz);
-	    tizcoul += pre2 * (mu[i][0]*dely - mu[i][1]*delx);
-	  }
+            tixcoul += pre2 * (mu[i][1]*delz - mu[i][2]*dely);
+            tiycoul += pre2 * (mu[i][2]*delx - mu[i][0]*delz);
+            tizcoul += pre2 * (mu[i][0]*dely - mu[i][1]*delx);
+          }
 
-	  if (mu[j][3] > 0.0 && qtmp != 0.0) { 
+          if (mu[j][3] > 0.0 && qtmp != 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
             pjdotr = mu[j][0]*delx + mu[j][1]*dely + mu[j][2]*delz;
-	    rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
-	    pre1 = 3.0 * qtmp * r5inv * pjdotr * (1-rsq*rcutcoul2inv);
-	    qpfac = 1.0 - 3.0*rsq*rcutcoul2inv +
-	      2.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv);
-	    pre2 = qtmp * r3inv * qpfac;
+            rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
+            pre1 = 3.0 * qtmp * r5inv * pjdotr * (1-rsq*rcutcoul2inv);
+            qpfac = 1.0 - 3.0*rsq*rcutcoul2inv +
+              2.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv);
+            pre2 = qtmp * r3inv * qpfac;
 
-	    forcecoulx += pre1*delx - pre2*mu[j][0];
+            forcecoulx += pre1*delx - pre2*mu[j][0];
             forcecouly += pre1*dely - pre2*mu[j][1];
             forcecoulz += pre1*delz - pre2*mu[j][2];
-	    tjxcoul += -pre2 * (mu[j][1]*delz - mu[j][2]*dely);
-	    tjycoul += -pre2 * (mu[j][2]*delx - mu[j][0]*delz);
-	    tjzcoul += -pre2 * (mu[j][0]*dely - mu[j][1]*delx);
-	  }
-	}
-
-	// LJ interaction
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forceljcut = r6inv*(lj1[itype][jtype]*r6inv-lj2[itype][jtype])*r2inv;
-	  
-	  rcutlj2inv = 1.0 / cut_ljsq[itype][jtype];
-	  rcutlj6inv = rcutlj2inv * rcutlj2inv * rcutlj2inv;
-	  forceljsf = (lj1[itype][jtype]*rcutlj6inv - lj2[itype][jtype]) * 
-	    rcutlj6inv * rcutlj2inv;
-
-	  forcelj = factor_lj * (forceljcut - forceljsf);
-	} else forcelj = 0.0;
-	  
-	// total force
-
-	fq = factor_coul*qqrd2e;
-	fx = fq*forcecoulx + delx*forcelj;
-	fy = fq*forcecouly + dely*forcelj;
-	fz = fq*forcecoulz + delz*forcelj;
-	
-	// force & torque accumulation
-
-	f[i][0] += fx;
-	f[i][1] += fy;
-	f[i][2] += fz;
-	torque[i][0] += fq*tixcoul;
-	torque[i][1] += fq*tiycoul;
-	torque[i][2] += fq*tizcoul;
-
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	  torque[j][0] += fq*tjxcoul;
-	  torque[j][1] += fq*tjycoul;
-	  torque[j][2] += fq*tjzcoul;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq[itype][jtype]) {
-	    ecoul = qtmp * q[j] * rinv *
-	      pow((1.0-sqrt(rsq)/sqrt(cut_coulsq[itype][jtype])),2.0);
-	    if (mu[i][3] > 0.0 && mu[j][3] > 0.0)
-	      ecoul += bfac * (r3inv*pdotp - 3.0*r5inv*pidotr*pjdotr);
-	    if (mu[i][3] > 0.0 && q[j] != 0.0) 
-	      ecoul += -q[j] * r3inv * pqfac * pidotr;
-	    if (mu[j][3] > 0.0 && qtmp != 0.0)
-	      ecoul += qtmp * r3inv * qpfac * pjdotr;
-	    ecoul *= factor_coul*qqrd2e;
-	  } else ecoul = 0.0;
-	  
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype])+
-	      rcutlj6inv*(6*lj3[itype][jtype]*rcutlj6inv-3*lj4[itype][jtype])*
-	      rsq*rcutlj2inv+
-	      rcutlj6inv*(-7*lj3[itype][jtype]*rcutlj6inv+4*lj4[itype][jtype]);
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
-				 evdwl,ecoul,fx,fy,fz,delx,dely,delz);
+            tjxcoul += -pre2 * (mu[j][1]*delz - mu[j][2]*dely);
+            tjycoul += -pre2 * (mu[j][2]*delx - mu[j][0]*delz);
+            tjzcoul += -pre2 * (mu[j][0]*dely - mu[j][1]*delx);
+          }
+        }
+
+        // LJ interaction
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forceljcut = r6inv*(lj1[itype][jtype]*r6inv-lj2[itype][jtype])*r2inv;
+
+          rcutlj2inv = 1.0 / cut_ljsq[itype][jtype];
+          rcutlj6inv = rcutlj2inv * rcutlj2inv * rcutlj2inv;
+          forceljsf = (lj1[itype][jtype]*rcutlj6inv - lj2[itype][jtype]) *
+            rcutlj6inv * rcutlj2inv;
+
+          forcelj = factor_lj * (forceljcut - forceljsf);
+        } else forcelj = 0.0;
+
+        // total force
+
+        fq = factor_coul*qqrd2e;
+        fx = fq*forcecoulx + delx*forcelj;
+        fy = fq*forcecouly + dely*forcelj;
+        fz = fq*forcecoulz + delz*forcelj;
+
+        // force & torque accumulation
+
+        f[i][0] += fx;
+        f[i][1] += fy;
+        f[i][2] += fz;
+        torque[i][0] += fq*tixcoul;
+        torque[i][1] += fq*tiycoul;
+        torque[i][2] += fq*tizcoul;
+
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+          torque[j][0] += fq*tjxcoul;
+          torque[j][1] += fq*tjycoul;
+          torque[j][2] += fq*tjzcoul;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq[itype][jtype]) {
+            ecoul = qtmp * q[j] * rinv *
+              pow((1.0-sqrt(rsq)/sqrt(cut_coulsq[itype][jtype])),2.0);
+            if (mu[i][3] > 0.0 && mu[j][3] > 0.0)
+              ecoul += bfac * (r3inv*pdotp - 3.0*r5inv*pidotr*pjdotr);
+            if (mu[i][3] > 0.0 && q[j] != 0.0)
+              ecoul += -q[j] * r3inv * pqfac * pidotr;
+            if (mu[j][3] > 0.0 && qtmp != 0.0)
+              ecoul += qtmp * r3inv * qpfac * pjdotr;
+            ecoul *= factor_coul*qqrd2e;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype])+
+              rcutlj6inv*(6*lj3[itype][jtype]*rcutlj6inv-3*lj4[itype][jtype])*
+              rsq*rcutlj2inv+
+              rcutlj6inv*(-7*lj3[itype][jtype]*rcutlj6inv+4*lj4[itype][jtype]);
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally_xyz(i,j,nlocal,newton_pair,
+                                 evdwl,ecoul,fx,fy,fz,delx,dely,delz);
       }
     }
   }
@@ -289,7 +289,7 @@ void PairDipoleSF::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairDipoleSF::allocate()
@@ -317,7 +317,7 @@ void PairDipoleSF::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairDipoleSF::settings(int narg, char **arg)
@@ -335,10 +335,10 @@ void PairDipoleSF::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) {
-	  cut_lj[i][j] = cut_lj_global;
-	  cut_coul[i][j] = cut_coul_global;
-	}
+        if (setflag[i][j]) {
+          cut_lj[i][j] = cut_lj_global;
+          cut_coul[i][j] = cut_coul_global;
+        }
   }
 }
 
@@ -348,7 +348,7 @@ void PairDipoleSF::settings(int narg, char **arg)
 
 void PairDipoleSF::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 6) 
+  if (narg < 4 || narg > 6)
     error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
@@ -399,7 +399,7 @@ double PairDipoleSF::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut_lj[i][j] = mix_distance(cut_lj[i][i],cut_lj[j][j]);
     cut_coul[i][j] = mix_distance(cut_coul[i][i],cut_coul[j][j]);
@@ -413,7 +413,7 @@ double PairDipoleSF::init_one(int i, int j)
   lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
   lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
   lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
-     
+
   cut_ljsq[j][i] = cut_ljsq[i][j];
   cut_coulsq[j][i] = cut_coulsq[i][j];
   lj1[j][i] = lj1[i][j];
@@ -437,10 +437,10 @@ void PairDipoleSF::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj[i][j],sizeof(double),1,fp);
-	fwrite(&cut_coul[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj[i][j],sizeof(double),1,fp);
+        fwrite(&cut_coul[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -462,16 +462,16 @@ void PairDipoleSF::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj[i][j],sizeof(double),1,fp);
-	  fread(&cut_coul[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_coul[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut_lj[i][j],sizeof(double),1,fp);
+          fread(&cut_coul[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_coul[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
diff --git a/src/USER-MISC/pair_dipole_sf.h b/src/USER-MISC/pair_dipole_sf.h
index 945f48694c..57a577c61b 100644
--- a/src/USER-MISC/pair_dipole_sf.h
+++ b/src/USER-MISC/pair_dipole_sf.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/pair_edip.cpp b/src/USER-MISC/pair_edip.cpp
index 008251f934..a9efb04820 100755
--- a/src/USER-MISC/pair_edip.cpp
+++ b/src/USER-MISC/pair_edip.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -210,8 +210,8 @@ void PairEDIP::compute(int eflag, int vflag)
 
         interpolY1 = exp3B[interpolIDX];
         interpolY2 = exp3B[interpolIDX+1];
-        exp3B_ij = interpolY1 + (interpolY2 - interpolY1) * 
-	  (interpolTMP-interpolIDX);
+        exp3B_ij = interpolY1 + (interpolY2 - interpolY1) *
+          (interpolTMP-interpolIDX);
 
         exp3BDerived_ij = - exp3B_ij * gammInvRMinusCutoffA * invRMinusCutoffA;
 
@@ -220,8 +220,8 @@ void PairEDIP::compute(int eflag, int vflag)
 
         interpolY1 = exp2B[interpolIDX];
         interpolY2 = exp2B[interpolIDX+1];
-        exp2B_ij = interpolY1 + (interpolY2 - interpolY1) * 
-	  (interpolTMP-interpolIDX);
+        exp2B_ij = interpolY1 + (interpolY2 - interpolY1) *
+          (interpolTMP-interpolIDX);
 
         exp2BDerived_ij = - exp2B_ij * sigmaInvRMinusCutoffA * invRMinusCutoffA;
 
@@ -230,8 +230,8 @@ void PairEDIP::compute(int eflag, int vflag)
 
         interpolY1 = pow2B[interpolIDX];
         interpolY2 = pow2B[interpolIDX+1];
-        pow2B_ij = interpolY1 + (interpolY2 - interpolY1) * 
-	  (interpolTMP-interpolIDX);
+        pow2B_ij = interpolY1 + (interpolY2 - interpolY1) *
+          (interpolTMP-interpolIDX);
 
         prePow2B_ij[neighbor_j] = pow2B_ij;
 
@@ -241,15 +241,15 @@ void PairEDIP::compute(int eflag, int vflag)
         else {
             interpolY1 = cutoffFunction[interpolIDX];
             interpolY2 = cutoffFunction[interpolIDX+1];
-            cutoffFunction_ij = interpolY1 + (interpolY2 - interpolY1) * 
-	      (interpolTMP-interpolIDX);
+            cutoffFunction_ij = interpolY1 + (interpolY2 - interpolY1) *
+              (interpolTMP-interpolIDX);
 
             zeta_i += cutoffFunction_ij;
 
             interpolY1 = cutoffFunctionDerived[interpolIDX];
             interpolY2 = cutoffFunctionDerived[interpolIDX+1];
-            zeta_iDerived = interpolY1 + (interpolY2 - interpolY1) * 
-	      (interpolTMP-interpolIDX);
+            zeta_iDerived = interpolY1 + (interpolY2 - interpolY1) *
+              (interpolTMP-interpolIDX);
 
             zeta_iDerivedInvR_ij = zeta_iDerived * invR_ij;
 
@@ -271,22 +271,22 @@ void PairEDIP::compute(int eflag, int vflag)
 
     interpolY1 = expMinusBetaZeta_iZeta_iGrid[interpolIDX];
     interpolY2 = expMinusBetaZeta_iZeta_iGrid[interpolIDX+1];
-    expMinusBetaZeta_iZeta_i = interpolY1 + (interpolY2 - interpolY1) * 
+    expMinusBetaZeta_iZeta_i = interpolY1 + (interpolY2 - interpolY1) *
       (interpolTMP-interpolIDX);
 
     interpolY1 = qFunctionGrid[interpolIDX];
     interpolY2 = qFunctionGrid[interpolIDX+1];
-    qFunction = interpolY1 + (interpolY2 - interpolY1) * 
+    qFunction = interpolY1 + (interpolY2 - interpolY1) *
       (interpolTMP-interpolIDX);
 
     interpolY1 = tauFunctionGrid[interpolIDX];
     interpolY2 = tauFunctionGrid[interpolIDX+1];
-    tauFunction = interpolY1 + (interpolY2 - interpolY1) * 
+    tauFunction = interpolY1 + (interpolY2 - interpolY1) *
       (interpolTMP-interpolIDX);
 
     interpolY1 = tauFunctionDerivedGrid[interpolIDX];
     interpolY2 = tauFunctionDerivedGrid[interpolIDX+1];
-    tauFunctionDerived = interpolY1 + (interpolY2 - interpolY1) * 
+    tauFunctionDerived = interpolY1 + (interpolY2 - interpolY1) *
       (interpolTMP-interpolIDX);
 
     qFunctionDerived = -mu * qFunction;
@@ -326,8 +326,8 @@ void PairEDIP::compute(int eflag, int vflag)
       forceModCoord += (forceModCoord_factor*exp2B_ij);
 
       exp2BDerived_ij = preExp2BDerived_ij[neighbor_j];
-      forceMod2B = exp2BDerived_ij * potential2B_factor + 
-	exp2B_ij * pow2BDerived_ij;
+      forceMod2B = exp2BDerived_ij * potential2B_factor +
+        exp2B_ij * pow2BDerived_ij;
 
       directorCos_ij_x = invR_ij * dr_ij[0];
       directorCos_ij_y = invR_ij * dr_ij[1];
@@ -381,56 +381,56 @@ void PairEDIP::compute(int eflag, int vflag)
           directorCos_ik_y = invR_ik * dr_ik[1];
           directorCos_ik_z = invR_ik * dr_ik[2];
 
-          cosTeta = directorCos_ij_x * directorCos_ik_x + 
-	    directorCos_ij_y * directorCos_ik_y +
-	    directorCos_ij_z * directorCos_ik_z;
+          cosTeta = directorCos_ij_x * directorCos_ik_x +
+            directorCos_ij_y * directorCos_ik_y +
+            directorCos_ij_z * directorCos_ik_z;
 
           cosTetaDiff = cosTeta + tauFunction;
           cosTetaDiffCosTetaDiff = cosTetaDiff * cosTetaDiff;
           qFunctionCosTetaDiffCosTetaDiff = cosTetaDiffCosTetaDiff * qFunction;
-          expMinusQFunctionCosTetaDiffCosTetaDiff = 
-	    exp(-qFunctionCosTetaDiffCosTetaDiff);
+          expMinusQFunctionCosTetaDiffCosTetaDiff =
+            exp(-qFunctionCosTetaDiffCosTetaDiff);
 
-          potentia3B_factor = lambda * 
-	    ((1.0 - expMinusQFunctionCosTetaDiffCosTetaDiff) + 
-	     eta * qFunctionCosTetaDiffCosTetaDiff);
+          potentia3B_factor = lambda *
+            ((1.0 - expMinusQFunctionCosTetaDiffCosTetaDiff) +
+             eta * qFunctionCosTetaDiffCosTetaDiff);
 
           exp3B_ik = preExp3B_ij[neighbor_k];
           exp3BDerived_ik = preExp3BDerived_ij[neighbor_k];
 
-          forceMod3B_factor1_ij = - exp3BDerived_ij * exp3B_ik * 
-	    potentia3B_factor;
-          forceMod3B_factor2 = 2.0 * lambda * exp3B_ij * exp3B_ik * 
-	    qFunction * cosTetaDiff *
-	    (eta + expMinusQFunctionCosTetaDiffCosTetaDiff);
+          forceMod3B_factor1_ij = - exp3BDerived_ij * exp3B_ik *
+            potentia3B_factor;
+          forceMod3B_factor2 = 2.0 * lambda * exp3B_ij * exp3B_ik *
+            qFunction * cosTetaDiff *
+            (eta + expMinusQFunctionCosTetaDiffCosTetaDiff);
           forceMod3B_factor2_ij = forceMod3B_factor2 * invR_ij;
 
-          f_ij[0] = forceMod3B_factor1_ij * directorCos_ij_x + 
-	    forceMod3B_factor2_ij *
-	    (cosTeta * directorCos_ij_x - directorCos_ik_x);
-          f_ij[1] = forceMod3B_factor1_ij * directorCos_ij_y + 
-	    forceMod3B_factor2_ij *
-	    (cosTeta * directorCos_ij_y - directorCos_ik_y);
-          f_ij[2] = forceMod3B_factor1_ij * directorCos_ij_z + 
-	    forceMod3B_factor2_ij *
-	    (cosTeta * directorCos_ij_z - directorCos_ik_z);
-
-          forceMod3B_factor1_ik = - exp3BDerived_ik * exp3B_ij * 
-	    potentia3B_factor;
+          f_ij[0] = forceMod3B_factor1_ij * directorCos_ij_x +
+            forceMod3B_factor2_ij *
+            (cosTeta * directorCos_ij_x - directorCos_ik_x);
+          f_ij[1] = forceMod3B_factor1_ij * directorCos_ij_y +
+            forceMod3B_factor2_ij *
+            (cosTeta * directorCos_ij_y - directorCos_ik_y);
+          f_ij[2] = forceMod3B_factor1_ij * directorCos_ij_z +
+            forceMod3B_factor2_ij *
+            (cosTeta * directorCos_ij_z - directorCos_ik_z);
+
+          forceMod3B_factor1_ik = - exp3BDerived_ik * exp3B_ij *
+            potentia3B_factor;
           forceMod3B_factor2_ik = forceMod3B_factor2 * invR_ik;
 
-          f_ik[0] = forceMod3B_factor1_ik * directorCos_ik_x + 
-	    forceMod3B_factor2_ik *
-	    (cosTeta * directorCos_ik_x - directorCos_ij_x);
-          f_ik[1] = forceMod3B_factor1_ik * directorCos_ik_y + 
-	    forceMod3B_factor2_ik *
-	    (cosTeta * directorCos_ik_y - directorCos_ij_y);
-          f_ik[2] = forceMod3B_factor1_ik * directorCos_ik_z + 
-	    forceMod3B_factor2_ik *
-	    (cosTeta * directorCos_ik_z - directorCos_ij_z);
+          f_ik[0] = forceMod3B_factor1_ik * directorCos_ik_x +
+            forceMod3B_factor2_ik *
+            (cosTeta * directorCos_ik_x - directorCos_ij_x);
+          f_ik[1] = forceMod3B_factor1_ik * directorCos_ik_y +
+            forceMod3B_factor2_ik *
+            (cosTeta * directorCos_ik_y - directorCos_ij_y);
+          f_ik[2] = forceMod3B_factor1_ik * directorCos_ik_z +
+            forceMod3B_factor2_ik *
+            (cosTeta * directorCos_ik_z - directorCos_ij_z);
 
-          forceModCoord += (forceMod3B_factor2 * 
-			    (tauFunctionDerived -  0.5 * mu * cosTetaDiff));
+          forceModCoord += (forceMod3B_factor2 *
+                            (tauFunctionDerived -  0.5 * mu * cosTetaDiff));
 
           f[j][0] += f_ij[0];
           f[j][1] += f_ij[1];
@@ -482,7 +482,7 @@ void PairEDIP::compute(int eflag, int vflag)
 
         evdwl = 0.0;
         if (evflag) ev_tally(i, j, nlocal, newton_pair, evdwl, 0.0,
-			     forceModCoord_ij, dr_ij[0], dr_ij[1], dr_ij[2]);
+                             forceModCoord_ij, dr_ij[0], dr_ij[1], dr_ij[2]);
     }
   }
 
@@ -509,27 +509,27 @@ void PairEDIP::allocateGrids(void)
   // tauFunctionGrid
 
   maxArgumentTauFunctionGrid = leadDimInteractionList;
-  numGridPointsTauFunctionGrid = (int) 
+  numGridPointsTauFunctionGrid = (int)
     ((maxArgumentTauFunctionGrid) * GRIDDENSITY) + 2;
 
   memory->create(tauFunctionGrid,numGridPointsTauFunctionGrid,
-		 "edip:tauFunctionGrid");
+                 "edip:tauFunctionGrid");
   memory->create(tauFunctionDerivedGrid,numGridPointsTauFunctionGrid,
-		 "edip:tauFunctionDerivedGrid");
+                 "edip:tauFunctionDerivedGrid");
 
   // expMinusBetaZeta_iZeta_iGrid
 
   maxArgumentExpMinusBetaZeta_iZeta_i = leadDimInteractionList;
-  numGridPointsExpMinusBetaZeta_iZeta_i = (int) 
+  numGridPointsExpMinusBetaZeta_iZeta_i = (int)
     ((maxArgumentExpMinusBetaZeta_iZeta_i) * GRIDDENSITY) + 2;
   memory->create(expMinusBetaZeta_iZeta_iGrid,
-		 numGridPointsExpMinusBetaZeta_iZeta_i,
-		 "edip:expMinusBetaZeta_iZeta_iGrid");
+                 numGridPointsExpMinusBetaZeta_iZeta_i,
+                 "edip:expMinusBetaZeta_iZeta_iGrid");
 
   // qFunctionGrid
 
   maxArgumentQFunctionGrid = leadDimInteractionList;
-  numGridPointsQFunctionGrid = (int) 
+  numGridPointsQFunctionGrid = (int)
     ((maxArgumentQFunctionGrid) * GRIDDENSITY) + 2;
   memory->create(qFunctionGrid,numGridPointsQFunctionGrid,"edip:qFunctionGrid");
 
@@ -537,17 +537,17 @@ void PairEDIP::allocateGrids(void)
 
   numGridPointsOneCutoffFunction = (int) ((cutoffC - GRIDSTART) * GRIDDENSITY);
   numGridPointsNotOneCutoffFunction = (int) ((cutoffA-cutoffC) * GRIDDENSITY);
-  numGridPointsCutoffFunction = numGridPointsOneCutoffFunction + 
+  numGridPointsCutoffFunction = numGridPointsOneCutoffFunction +
     numGridPointsNotOneCutoffFunction+2;
 
   memory->create(cutoffFunction,numGridPointsCutoffFunction,
-		 "edip:cutoffFunction");
+                 "edip:cutoffFunction");
   memory->create(cutoffFunctionDerived,numGridPointsCutoffFunction,
-		 "edip:cutoffFunctionDerived");
+                 "edip:cutoffFunctionDerived");
 
   // pow2B
 
-  numGridPointsR = (int) 
+  numGridPointsR = (int)
     ((cutoffA + leftLimitToZero - GRIDSTART) * GRIDDENSITY);
   numGridPointsRTotal = numGridPointsR + 2;
 
@@ -563,14 +563,14 @@ void PairEDIP::allocateGrids(void)
 void PairEDIP::allocatePreLoops(void)
 {
   int nthreads = comm->nthreads;
-  
+
   memory->create(preInvR_ij,nthreads*leadDimInteractionList,"edip:preInvR_ij");
   memory->create(preExp3B_ij,nthreads*leadDimInteractionList,"edip:preExp3B_ij");
   memory->create(preExp3BDerived_ij,nthreads*leadDimInteractionList,
-		 "edip:preExp3BDerived_ij");
+                 "edip:preExp3BDerived_ij");
   memory->create(preExp2B_ij,nthreads*leadDimInteractionList,"edip:preExp2B_ij");
   memory->create(preExp2BDerived_ij,nthreads*leadDimInteractionList,
-		 "edip:preExp2BDerived_ij");
+                 "edip:preExp2BDerived_ij");
   memory->create(prePow2B_ij,nthreads*leadDimInteractionList,"edip:prePow2B_ij");
   memory->create(preForceCoord,5*nthreads*leadDimInteractionList,"edip:preForceCoord");
 }
@@ -621,7 +621,7 @@ void PairEDIP::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairEDIP::settings(int narg, char **arg)
@@ -660,17 +660,17 @@ void PairEDIP::initGrids(void)
 
   maxArgumentTauFunctionGrid = leadDimInteractionList;
 
-  numGridPointsTauFunctionGrid = (int) 
+  numGridPointsTauFunctionGrid = (int)
     ((maxArgumentTauFunctionGrid) * GRIDDENSITY) + 2;
 
   r = 0.0;
   deltaArgumentTauFunctionGrid = 1.0 / GRIDDENSITY;
 
   for (l = 0; l < numGridPointsTauFunctionGrid; l++) {
-      tauFunctionGrid[l] = u1 + u2 * u3 * exp(-u4 * r) - 
-	u2 * exp(-2.0 * u4 * r);
-      tauFunctionDerivedGrid[l] = - u2 * u3 * u4 * exp(-u4 * r) + 
-	2.0 * u2 * u4 * exp(-2.0 * u4 * r);
+      tauFunctionGrid[l] = u1 + u2 * u3 * exp(-u4 * r) -
+        u2 * exp(-2.0 * u4 * r);
+      tauFunctionDerivedGrid[l] = - u2 * u3 * u4 * exp(-u4 * r) +
+        2.0 * u2 * u4 * exp(-2.0 * u4 * r);
       r += deltaArgumentTauFunctionGrid;
   }
 
@@ -678,7 +678,7 @@ void PairEDIP::initGrids(void)
 
   maxArgumentExpMinusBetaZeta_iZeta_i = leadDimInteractionList;
 
-  numGridPointsExpMinusBetaZeta_iZeta_i = (int) 
+  numGridPointsExpMinusBetaZeta_iZeta_i = (int)
     ((maxArgumentExpMinusBetaZeta_iZeta_i) * GRIDDENSITY) + 2;
 
   r = 0.0;
@@ -692,7 +692,7 @@ void PairEDIP::initGrids(void)
   // qFunctionGrid
 
   maxArgumentQFunctionGrid = leadDimInteractionList;
-  numGridPointsQFunctionGrid = 
+  numGridPointsQFunctionGrid =
     (int) ((maxArgumentQFunctionGrid) * GRIDDENSITY) + 2;
 
   r = 0.0;
@@ -705,11 +705,11 @@ void PairEDIP::initGrids(void)
 
   // cutoffFunction
 
-  numGridPointsOneCutoffFunction = 
+  numGridPointsOneCutoffFunction =
     (int) ((cutoffC - GRIDSTART) * GRIDDENSITY);
-  numGridPointsNotOneCutoffFunction = 
+  numGridPointsNotOneCutoffFunction =
     (int) ((cutoffA-cutoffC) * GRIDDENSITY);
-  numGridPointsCutoffFunction = 
+  numGridPointsCutoffFunction =
     numGridPointsOneCutoffFunction+numGridPointsNotOneCutoffFunction+2;
 
   r = GRIDSTART;
@@ -721,20 +721,20 @@ void PairEDIP::initGrids(void)
       r += deltaArgumentCutoffFunction;
   }
 
-  for (l = numGridPointsOneCutoffFunction; 
+  for (l = numGridPointsOneCutoffFunction;
        l < numGridPointsCutoffFunction; l++) {
       temp = (cutoffA - cutoffC)/(r - cutoffC);
       temp3 = temp * temp * temp;
       temp4 = temp3 * temp;
       cutoffFunction[l] = exp(alpha/(1.0-temp3));
-      cutoffFunctionDerived[l] = (-3*alpha/(cutoffA-cutoffC)) * 
-	(temp4/((1-temp3)*(1-temp3)))*exp(alpha/(1.0-temp3));
+      cutoffFunctionDerived[l] = (-3*alpha/(cutoffA-cutoffC)) *
+        (temp4/((1-temp3)*(1-temp3)))*exp(alpha/(1.0-temp3));
       r += deltaArgumentCutoffFunction;
   }
 
   // pow2B
 
-  numGridPointsR = (int) 
+  numGridPointsR = (int)
     ((cutoffA + leftLimitToZero - GRIDSTART) * GRIDDENSITY);
   numGridPointsRTotal = numGridPointsR + 2;
 
@@ -804,7 +804,7 @@ void PairEDIP::coeff(int narg, char **arg)
   }
 
   // read potential file and initialize potential parameters
-  
+
   read_file(arg[2]);
   setup();
 
@@ -821,8 +821,8 @@ void PairEDIP::coeff(int narg, char **arg)
   for (int i = 1; i <= n; i++)
     for (int j = i; j <= n; j++)
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	count++;
+        setflag[i][j] = 1;
+        count++;
       }
 
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
@@ -898,8 +898,8 @@ void PairEDIP::read_file(char *file)
     if (comm->me == 0) {
       ptr = fgets(line,MAXLINE,fp);
       if (ptr == NULL) {
-	eof = 1;
-	fclose(fp);
+        eof = 1;
+        fclose(fp);
       } else n = strlen(line) + 1;
     }
     MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -920,8 +920,8 @@ void PairEDIP::read_file(char *file)
       if (comm->me == 0) {
         ptr = fgets(&line[n],MAXLINE-n,fp);
         if (ptr == NULL) {
-	  eof = 1;
-	  fclose(fp);
+          eof = 1;
+          fclose(fp);
         } else n = strlen(line) + 1;
       }
       MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -960,7 +960,7 @@ void PairEDIP::read_file(char *file)
     if (nparams == maxparam) {
       maxparam += DELTA;
       params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
-					  "pair:params");
+                                          "pair:params");
     }
 
     params[nparams].ielement = ielement;
@@ -985,13 +985,13 @@ void PairEDIP::read_file(char *file)
     params[nparams].u4 = atof(words[19]);
 
     if (params[nparams].A < 0.0 || params[nparams].B < 0.0 ||
-	params[nparams].cutoffA < 0.0 || params[nparams].cutoffC < 0.0 ||
-	params[nparams].alpha < 0.0 || params[nparams].beta < 0.0 ||
-	params[nparams].eta < 0.0 || params[nparams].gamm < 0.0 ||
-	params[nparams].lambda < 0.0 || params[nparams].mu < 0.0 ||
-	params[nparams].rho < 0.0 || params[nparams].sigma < 0.0)
+        params[nparams].cutoffA < 0.0 || params[nparams].cutoffC < 0.0 ||
+        params[nparams].alpha < 0.0 || params[nparams].beta < 0.0 ||
+        params[nparams].eta < 0.0 || params[nparams].gamm < 0.0 ||
+        params[nparams].lambda < 0.0 || params[nparams].mu < 0.0 ||
+        params[nparams].rho < 0.0 || params[nparams].sigma < 0.0)
       error->all(FLERR,"Illegal EDIP parameter");
-    
+
     nparams++;
   }
 
@@ -1015,16 +1015,16 @@ void PairEDIP::setup()
   for (i = 0; i < nelements; i++)
     for (j = 0; j < nelements; j++)
       for (k = 0; k < nelements; k++) {
-	n = -1;
-	for (m = 0; m < nparams; m++) {
-	  if (i == params[m].ielement && j == params[m].jelement && 
-	      k == params[m].kelement) {
-	    if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
-	    n = m;
-	  }
-	}
-	if (n < 0) error->all(FLERR,"Potential file is missing an entry");
-	elem2param[i][j][k] = n;
+        n = -1;
+        for (m = 0; m < nparams; m++) {
+          if (i == params[m].ielement && j == params[m].jelement &&
+              k == params[m].kelement) {
+            if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
+            n = m;
+          }
+        }
+        if (n < 0) error->all(FLERR,"Potential file is missing an entry");
+        elem2param[i][j][k] = n;
       }
 
   // set cutoff square
diff --git a/src/USER-MISC/pair_edip.h b/src/USER-MISC/pair_edip.h
index f83c32ed3e..c3ad25fb30 100755
--- a/src/USER-MISC/pair_edip.h
+++ b/src/USER-MISC/pair_edip.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -51,7 +51,7 @@ class PairEDIP : public Pair {
   double *preExp2BDerived_ij;
   double *prePow2B_ij;
   double *preForceCoord;
-  
+
   // grids
 
   double *cutoffFunction;
diff --git a/src/USER-MISC/pair_gauss_cut.cpp b/src/USER-MISC/pair_gauss_cut.cpp
index 0568c40ea0..e70bada2f5 100644
--- a/src/USER-MISC/pair_gauss_cut.cpp
+++ b/src/USER-MISC/pair_gauss_cut.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -107,27 +107,27 @@ void PairGaussCut::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	rexp = (r-rmh[itype][jtype])/sigmah[itype][jtype];
-	ugauss = pgauss[itype][jtype]*exp(-0.5*rexp*rexp); 
-	fpair = factor_lj*rexp/r*ugauss/sigmah[itype][jtype];
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  evdwl = ugauss - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r = sqrt(rsq);
+        rexp = (r-rmh[itype][jtype])/sigmah[itype][jtype];
+        ugauss = pgauss[itype][jtype]*exp(-0.5*rexp*rexp);
+        fpair = factor_lj*rexp/r*ugauss/sigmah[itype][jtype];
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          evdwl = ugauss - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -137,7 +137,7 @@ void PairGaussCut::compute(int eflag, int vflag)
 
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairGaussCut::allocate()
@@ -161,7 +161,7 @@ void PairGaussCut::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairGaussCut::settings(int narg, char **arg)
@@ -176,7 +176,7 @@ void PairGaussCut::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -226,13 +226,13 @@ double PairGaussCut::init_one(int i, int j)
     error->all(FLERR,"for gauss/cut pair style, parameters need to be set explicitly for all pairs.");
   }
   pgauss[i][j] = hgauss[i][j] / sqrt(MY_2PI)/ sigmah[i][j];
-  
+
 
   if (offset_flag) {
     double rexp = (cut[i][j]-rmh[i][j])/sigmah[i][j];
     offset[i][j] = pgauss[i][j] * exp(-0.5*rexp*rexp);
   } else offset[i][j] = 0.0;
-  
+
   hgauss[j][i] = hgauss[i][j];
   sigmah[j][i] = sigmah[i][j];
   rmh[j][i] = rmh[i][j];
@@ -254,13 +254,13 @@ double PairGaussCut::init_one(int i, int j)
       if (type[k] == j) count[1] += 1.0;
     }
     MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
-  } 
+  }
 
   return cut[i][j];
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairGaussCut::write_restart(FILE *fp)
@@ -272,10 +272,10 @@ void PairGaussCut::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&hgauss[i][j],sizeof(double),1,fp);
-	fwrite(&rmh[i][j],sizeof(double),1,fp);
-	fwrite(&sigmah[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&hgauss[i][j],sizeof(double),1,fp);
+        fwrite(&rmh[i][j],sizeof(double),1,fp);
+        fwrite(&sigmah[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -296,16 +296,16 @@ void PairGaussCut::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&hgauss[i][j],sizeof(double),1,fp);
-	  fread(&rmh[i][j],sizeof(double),1,fp);
-	  fread(&sigmah[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&hgauss[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&rmh[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigmah[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&hgauss[i][j],sizeof(double),1,fp);
+          fread(&rmh[i][j],sizeof(double),1,fp);
+          fread(&sigmah[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&hgauss[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&rmh[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigmah[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -341,15 +341,15 @@ void PairGaussCut::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairGaussCut::single(int i, int j, int itype, int jtype, double rsq,
-			 double factor_coul, double factor_lj,
-			 double &fforce)
+                         double factor_coul, double factor_lj,
+                         double &fforce)
 {
   double r, rexp,ugauss,phigauss;
 
   r=sqrt(rsq);
   rexp = (r-rmh[itype][jtype])/sigmah[itype][jtype];
-  ugauss = pgauss[itype][jtype]*exp(-0.5*rexp*rexp); 
-	
+  ugauss = pgauss[itype][jtype]*exp(-0.5*rexp*rexp);
+
   fforce = factor_lj*rexp/r*ugauss/sigmah[itype][jtype];
 
   phigauss = ugauss - offset[itype][jtype];
@@ -360,7 +360,7 @@ double PairGaussCut::single(int i, int j, int itype, int jtype, double rsq,
 double PairGaussCut::memory_usage()
 {
   const int n=atom->ntypes;
-  
+
   double bytes = Pair::memory_usage();
 
   bytes += 7*((n+1)*(n+1) * sizeof(double) + (n+1)*sizeof(double *));
@@ -368,4 +368,3 @@ double PairGaussCut::memory_usage()
 
   return bytes;
 }
-
diff --git a/src/USER-MISC/pair_gauss_cut.h b/src/USER-MISC/pair_gauss_cut.h
index 8a10308278..b43276fe7d 100644
--- a/src/USER-MISC/pair_gauss_cut.h
+++ b/src/USER-MISC/pair_gauss_cut.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/pair_lj_sf.cpp b/src/USER-MISC/pair_lj_sf.cpp
index 9745f296be..d378cfab4e 100644
--- a/src/USER-MISC/pair_lj_sf.cpp
+++ b/src/USER-MISC/pair_lj_sf.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -61,11 +61,11 @@ void PairLJShiftedForce::compute(int eflag, int vflag)
   double rsq,r2inv,r6inv,forcelj,factor_lj;
   double r,t;
   int *ilist,*jlist,*numneigh,**firstneigh;
-  
+
   evdwl = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
-  
+
   double **x = atom->x;
   double **f = atom->f;
   int *type = atom->type;
@@ -73,14 +73,14 @@ void PairLJShiftedForce::compute(int eflag, int vflag)
   int nall = nlocal + atom->nghost;
   double *special_lj = force->special_lj;
   int newton_pair = force->newton_pair;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
-  
+
   for (ii = 0; ii < inum; ii++) {
     i = ilist[ii];
     xtmp = x[i][0];
@@ -89,53 +89,53 @@ void PairLJShiftedForce::compute(int eflag, int vflag)
     itype = type[i];
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       factor_lj = special_lj[sbmask(j)];
       j &= NEIGHMASK;
-      
+
       delx = xtmp - x[j][0];
       dely = ytmp - x[j][1];
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r = sqrt(rsq);
-	t = r/cut[itype][jtype];
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]) - 
-	  t*foffset[itype][jtype];
-	fpair = factor_lj*forcelj*r2inv;
-	
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-	
-	if (eflag) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) +
-	    (t-1.0)*foffset[itype][jtype] - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-	
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r = sqrt(rsq);
+        t = r/cut[itype][jtype];
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]) -
+          t*foffset[itype][jtype];
+        fpair = factor_lj*forcelj*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) +
+            (t-1.0)*foffset[itype][jtype] - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
-  
+
   if (vflag_fdotr) virial_fdotr_compute();
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLJShiftedForce::allocate()
@@ -161,7 +161,7 @@ void PairLJShiftedForce::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLJShiftedForce::settings(int narg, char **arg)
@@ -172,14 +172,14 @@ void PairLJShiftedForce::settings(int narg, char **arg)
 
   if (cut_global <= 0.0)
     error->all(FLERR,"Illegal pair_style command");
-  
+
   // reset cutoffs that have been explicitly set
 
   if (allocated) {
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -204,7 +204,7 @@ void PairLJShiftedForce::coeff(int narg, char **arg)
 
   if (cut_one <= 0.0)
     error->all(FLERR,"Incorrect args for pair coefficients");
-  
+
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
     for (int j = MAX(jlo,i); j <= jhi; j++) {
@@ -227,7 +227,7 @@ double PairLJShiftedForce::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
   }
@@ -238,10 +238,10 @@ double PairLJShiftedForce::init_one(int i, int j)
   lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
 
   double ratio = sigma[i][j] / cut[i][j];
-  foffset[i][j] = 4.0 * epsilon[i][j] * (12.0 * pow(ratio,12.0) - 
-					 6.0 * pow(ratio,6.0));
+  foffset[i][j] = 4.0 * epsilon[i][j] * (12.0 * pow(ratio,12.0) -
+                                         6.0 * pow(ratio,6.0));
   offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
-  
+
   cut[j][i] = cut[i][j];
   lj1[j][i] = lj1[i][j];
   lj2[j][i] = lj2[i][j];
@@ -249,12 +249,12 @@ double PairLJShiftedForce::init_one(int i, int j)
   lj4[j][i] = lj4[i][j];
   foffset[j][i] = foffset[i][j];
   offset[j][i] = offset[i][j];
-  
+
   return cut[i][j];
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairLJShiftedForce::write_restart(FILE *fp)
@@ -266,9 +266,9 @@ void PairLJShiftedForce::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -289,14 +289,14 @@ void PairLJShiftedForce::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -332,16 +332,16 @@ void PairLJShiftedForce::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJShiftedForce::single(int i, int j, int itype, int jtype, double rsq,
-			 double factor_coul, double factor_lj,
-			 double &fforce)
+                         double factor_coul, double factor_lj,
+                         double &fforce)
 {
   double r2inv,r6inv,forcelj,philj,r,t;
 
   r2inv = 1.0/rsq;
   r6inv = r2inv*r2inv*r2inv;
-  r = sqrt(rsq); 
+  r = sqrt(rsq);
   t = r/cut[itype][jtype];
-  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]) - 
+  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]) -
     t*foffset[itype][jtype];
   fforce = factor_lj*forcelj*r2inv;
 
diff --git a/src/USER-MISC/pair_lj_sf.h b/src/USER-MISC/pair_lj_sf.h
index 819e46cf72..6252d4134a 100644
--- a/src/USER-MISC/pair_lj_sf.h
+++ b/src/USER-MISC/pair_lj_sf.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-MISC/pair_meam_spline.cpp b/src/USER-MISC/pair_meam_spline.cpp
index 8e563fb174..46224bb853 100644
--- a/src/USER-MISC/pair_meam_spline.cpp
+++ b/src/USER-MISC/pair_meam_spline.cpp
@@ -91,7 +91,7 @@ PairMEAMSpline::PairMEAMSpline(LAMMPS *lmp) : Pair(lmp)
   nmax = 0;
   maxNeighbors = 0;
   twoBodyInfo = NULL;
-  
+
   comm_forward = 1;
   comm_reverse = 0;
 }
@@ -106,7 +106,7 @@ PairMEAMSpline::~PairMEAMSpline()
 
   delete[] twoBodyInfo;
   memory->destroy(Uprime_values);
-  
+
   if(allocated) {
     memory->destroy(setflag);
     memory->destroy(cutsq);
@@ -119,8 +119,8 @@ PairMEAMSpline::~PairMEAMSpline()
 void PairMEAMSpline::compute(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag, vflag);
-  else evflag = vflag_fdotr = 
-	 eflag_global = vflag_global = eflag_atom = vflag_atom = 0;
+  else evflag = vflag_fdotr =
+         eflag_global = vflag_global = eflag_atom = vflag_atom = 0;
 
   double cutforcesq = cutoff*cutoff;
 
@@ -157,7 +157,7 @@ void PairMEAMSpline::compute(int eflag, int vflag)
     delete[] twoBodyInfo;
     twoBodyInfo = new MEAM2Body[maxNeighbors];
   }
-  
+
   // Sum three-body contributions to charge density and
   // compute embedding energies
 
@@ -171,43 +171,43 @@ void PairMEAMSpline::compute(int eflag, int vflag)
     double rho_value = 0;
     int numBonds = 0;
     MEAM2Body* nextTwoBodyInfo = twoBodyInfo;
-    
+
     for(int jj = 0; jj < jnum; jj++) {
       int j = jlist[jj];
       j &= NEIGHMASK;
-      
+
       double jdelx = x[j][0] - xtmp;
       double jdely = x[j][1] - ytmp;
       double jdelz = x[j][2] - ztmp;
       double rij_sq = jdelx*jdelx + jdely*jdely + jdelz*jdelz;
-      
+
       if(rij_sq < cutforcesq) {
-	double rij = sqrt(rij_sq);
-	double partial_sum = 0;
-	
-	nextTwoBodyInfo->tag = j;
-	nextTwoBodyInfo->r = rij;
-	nextTwoBodyInfo->f = f.eval(rij, nextTwoBodyInfo->fprime);
-	nextTwoBodyInfo->del[0] = jdelx / rij;
-	nextTwoBodyInfo->del[1] = jdely / rij;
-	nextTwoBodyInfo->del[2] = jdelz / rij;
-	
-	for(int kk = 0; kk < numBonds; kk++) {
-	  const MEAM2Body& bondk = twoBodyInfo[kk];
-	  double cos_theta = (nextTwoBodyInfo->del[0]*bondk.del[0] + 
-			      nextTwoBodyInfo->del[1]*bondk.del[1] + 
-			      nextTwoBodyInfo->del[2]*bondk.del[2]);
-	  partial_sum += bondk.f * g.eval(cos_theta);
-	}
-	
-	rho_value += nextTwoBodyInfo->f * partial_sum;
-	rho_value += rho.eval(rij);
-	
-	numBonds++;
-	nextTwoBodyInfo++;
+        double rij = sqrt(rij_sq);
+        double partial_sum = 0;
+
+        nextTwoBodyInfo->tag = j;
+        nextTwoBodyInfo->r = rij;
+        nextTwoBodyInfo->f = f.eval(rij, nextTwoBodyInfo->fprime);
+        nextTwoBodyInfo->del[0] = jdelx / rij;
+        nextTwoBodyInfo->del[1] = jdely / rij;
+        nextTwoBodyInfo->del[2] = jdelz / rij;
+
+        for(int kk = 0; kk < numBonds; kk++) {
+          const MEAM2Body& bondk = twoBodyInfo[kk];
+          double cos_theta = (nextTwoBodyInfo->del[0]*bondk.del[0] +
+                              nextTwoBodyInfo->del[1]*bondk.del[1] +
+                              nextTwoBodyInfo->del[2]*bondk.del[2]);
+          partial_sum += bondk.f * g.eval(cos_theta);
+        }
+
+        rho_value += nextTwoBodyInfo->f * partial_sum;
+        rho_value += rho.eval(rij);
+
+        numBonds++;
+        nextTwoBodyInfo++;
       }
     }
-    
+
     // Compute embedding energy and its derivative
 
     double Uprime_i;
@@ -217,76 +217,76 @@ void PairMEAMSpline::compute(int eflag, int vflag)
       if(eflag_global) eng_vdwl += embeddingEnergy;
       if(eflag_atom) eatom[i] += embeddingEnergy;
     }
-    
+
     double forces_i[3] = {0, 0, 0};
-    
+
     // Compute three-body contributions to force
 
     for(int jj = 0; jj < numBonds; jj++) {
       const MEAM2Body bondj = twoBodyInfo[jj];
       double rij = bondj.r;
       int j = bondj.tag;
-      
+
       double f_rij_prime = bondj.fprime;
       double f_rij = bondj.f;
-      
+
       double forces_j[3] = {0, 0, 0};
-      
+
       MEAM2Body const* bondk = twoBodyInfo;
       for(int kk = 0; kk < jj; kk++, ++bondk) {
-	double rik = bondk->r;
-	
-	double cos_theta = (bondj.del[0]*bondk->del[0] + 
-			    bondj.del[1]*bondk->del[1] + 
-			    bondj.del[2]*bondk->del[2]);
-	double g_prime;
-	double g_value = g.eval(cos_theta, g_prime);
-	double f_rik_prime = bondk->fprime;
-	double f_rik = bondk->f;
-	
-	double fij = -Uprime_i * g_value * f_rik * f_rij_prime;
-	double fik = -Uprime_i * g_value * f_rij * f_rik_prime;
-	
-	double prefactor = Uprime_i * f_rij * f_rik * g_prime;
-	double prefactor_ij = prefactor / rij;
-	double prefactor_ik = prefactor / rik;
-	fij += prefactor_ij * cos_theta;
-	fik += prefactor_ik * cos_theta;
-	
-	double fj[3], fk[3];
-	
-	fj[0] = bondj.del[0] * fij - bondk->del[0] * prefactor_ij;
-	fj[1] = bondj.del[1] * fij - bondk->del[1] * prefactor_ij;
-	fj[2] = bondj.del[2] * fij - bondk->del[2] * prefactor_ij;
-	forces_j[0] += fj[0];
-	forces_j[1] += fj[1];
-	forces_j[2] += fj[2];
-	
-	fk[0] = bondk->del[0] * fik - bondj.del[0] * prefactor_ik;
-	fk[1] = bondk->del[1] * fik - bondj.del[1] * prefactor_ik;
-	fk[2] = bondk->del[2] * fik - bondj.del[2] * prefactor_ik;
-	forces_i[0] -= fk[0];
-	forces_i[1] -= fk[1];
-	forces_i[2] -= fk[2];
-	
-	int k = bondk->tag;
-	forces[k][0] += fk[0];
-	forces[k][1] += fk[1];
-	forces[k][2] += fk[2];
-	
-	if(evflag) {
-	  double delta_ij[3];
-	  double delta_ik[3];
-	  delta_ij[0] = bondj.del[0] * rij;
-	  delta_ij[1] = bondj.del[1] * rij;
-	  delta_ij[2] = bondj.del[2] * rij;
-	  delta_ik[0] = bondk->del[0] * rik;
-	  delta_ik[1] = bondk->del[1] * rik;
-	  delta_ik[2] = bondk->del[2] * rik;
-	  ev_tally3(i, j, k, 0.0, 0.0, fj, fk, delta_ij, delta_ik);
-	}
+        double rik = bondk->r;
+
+        double cos_theta = (bondj.del[0]*bondk->del[0] +
+                            bondj.del[1]*bondk->del[1] +
+                            bondj.del[2]*bondk->del[2]);
+        double g_prime;
+        double g_value = g.eval(cos_theta, g_prime);
+        double f_rik_prime = bondk->fprime;
+        double f_rik = bondk->f;
+
+        double fij = -Uprime_i * g_value * f_rik * f_rij_prime;
+        double fik = -Uprime_i * g_value * f_rij * f_rik_prime;
+
+        double prefactor = Uprime_i * f_rij * f_rik * g_prime;
+        double prefactor_ij = prefactor / rij;
+        double prefactor_ik = prefactor / rik;
+        fij += prefactor_ij * cos_theta;
+        fik += prefactor_ik * cos_theta;
+
+        double fj[3], fk[3];
+
+        fj[0] = bondj.del[0] * fij - bondk->del[0] * prefactor_ij;
+        fj[1] = bondj.del[1] * fij - bondk->del[1] * prefactor_ij;
+        fj[2] = bondj.del[2] * fij - bondk->del[2] * prefactor_ij;
+        forces_j[0] += fj[0];
+        forces_j[1] += fj[1];
+        forces_j[2] += fj[2];
+
+        fk[0] = bondk->del[0] * fik - bondj.del[0] * prefactor_ik;
+        fk[1] = bondk->del[1] * fik - bondj.del[1] * prefactor_ik;
+        fk[2] = bondk->del[2] * fik - bondj.del[2] * prefactor_ik;
+        forces_i[0] -= fk[0];
+        forces_i[1] -= fk[1];
+        forces_i[2] -= fk[2];
+
+        int k = bondk->tag;
+        forces[k][0] += fk[0];
+        forces[k][1] += fk[1];
+        forces[k][2] += fk[2];
+
+        if(evflag) {
+          double delta_ij[3];
+          double delta_ik[3];
+          delta_ij[0] = bondj.del[0] * rij;
+          delta_ij[1] = bondj.del[1] * rij;
+          delta_ij[2] = bondj.del[2] * rij;
+          delta_ik[0] = bondk->del[0] * rik;
+          delta_ik[1] = bondk->del[1] * rik;
+          delta_ik[2] = bondk->del[2] * rik;
+          ev_tally3(i, j, k, 0.0, 0.0, fj, fk, delta_ij, delta_ik);
+        }
       }
-      
+
       forces[i][0] -= forces_j[0];
       forces[i][1] -= forces_j[1];
       forces[i][2] -= forces_j[2];
@@ -294,21 +294,21 @@ void PairMEAMSpline::compute(int eflag, int vflag)
       forces[j][1] += forces_j[1];
       forces[j][2] += forces_j[2];
     }
-    
+
     forces[i][0] += forces_i[0];
     forces[i][1] += forces_i[1];
     forces[i][2] += forces_i[2];
   }
-  
+
   // Communicate U'(rho) values
 
   comm->forward_comm_pair(this);
-  
+
   int inum_half = listhalf->inum;
   int* ilist_half = listhalf->ilist;
   int* numneigh_half = listhalf->numneigh;
   int** firstneigh_half = listhalf->firstneigh;
-  
+
   // Compute two-body pair interactions
 
   for(int ii = 0; ii < inum_half; ii++) {
@@ -318,44 +318,44 @@ void PairMEAMSpline::compute(int eflag, int vflag)
     double ztmp = x[i][2];
     int* jlist = firstneigh_half[i];
     int jnum = numneigh_half[i];
-    
+
     for(int jj = 0; jj < jnum; jj++) {
       int j = jlist[jj];
       j &= NEIGHMASK;
-      
+
       double jdel[3];
       jdel[0] = x[j][0] - xtmp;
       jdel[1] = x[j][1] - ytmp;
       jdel[2] = x[j][2] - ztmp;
       double rij_sq = jdel[0]*jdel[0] + jdel[1]*jdel[1] + jdel[2]*jdel[2];
-      
+
       if(rij_sq < cutforcesq) {
-	double rij = sqrt(rij_sq);
-	
-	double rho_prime;
-	rho.eval(rij, rho_prime);
-	double fpair = rho_prime * (Uprime_values[i] + Uprime_values[j]);
-	
-	double pair_pot_deriv;
-	double pair_pot = phi.eval(rij, pair_pot_deriv);
-	fpair += pair_pot_deriv;
-	
-	// Divide by r_ij to get forces from gradient
-
-	fpair /= rij;
-	
-	forces[i][0] += jdel[0]*fpair;
-	forces[i][1] += jdel[1]*fpair;
-	forces[i][2] += jdel[2]*fpair;
-	forces[j][0] -= jdel[0]*fpair;
-	forces[j][1] -= jdel[1]*fpair;
-	forces[j][2] -= jdel[2]*fpair;
-	if (evflag) ev_tally(i, j, nlocal, newton_pair, 
-			     pair_pot, 0.0, -fpair, jdel[0], jdel[1], jdel[2]);
+        double rij = sqrt(rij_sq);
+
+        double rho_prime;
+        rho.eval(rij, rho_prime);
+        double fpair = rho_prime * (Uprime_values[i] + Uprime_values[j]);
+
+        double pair_pot_deriv;
+        double pair_pot = phi.eval(rij, pair_pot_deriv);
+        fpair += pair_pot_deriv;
+
+        // Divide by r_ij to get forces from gradient
+
+        fpair /= rij;
+
+        forces[i][0] += jdel[0]*fpair;
+        forces[i][1] += jdel[1]*fpair;
+        forces[i][2] += jdel[2]*fpair;
+        forces[j][0] -= jdel[0]*fpair;
+        forces[j][1] -= jdel[1]*fpair;
+        forces[j][2] -= jdel[2]*fpair;
+        if (evflag) ev_tally(i, j, nlocal, newton_pair,
+                             pair_pot, 0.0, -fpair, jdel[0], jdel[1], jdel[2]);
       }
     }
   }
-  
+
   if(vflag_fdotr) virial_fdotr_compute();
 }
 
@@ -365,7 +365,7 @@ void PairMEAMSpline::allocate()
 {
   allocated = 1;
   int n = atom->ntypes;
-  
+
   memory->create(setflag,n+1,n+1,"pair:setflag");
   memory->create(cutsq,n+1,n+1,"pair:cutsq");
 
@@ -373,7 +373,7 @@ void PairMEAMSpline::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairMEAMSpline::settings(int narg, char **arg)
@@ -432,10 +432,10 @@ void PairMEAMSpline::coeff(int narg, char **arg)
 
   if (nelements > 1)
     error->all(FLERR,
-	       "Pair meam/spline only supports single element potentials");
+               "Pair meam/spline only supports single element potentials");
 
   // read potential file
-  
+
   read_file(arg[2]);
 
   // clear setflag since coeff() called once with I,J = * *
@@ -451,8 +451,8 @@ void PairMEAMSpline::coeff(int narg, char **arg)
   for (int i = 1; i <= n; i++)
     for (int j = i; j <= n; j++)
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	count++;
+        setflag[i][j] = 1;
+        count++;
       }
 
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
@@ -466,57 +466,57 @@ void PairMEAMSpline::coeff(int narg, char **arg)
 
 void PairMEAMSpline::read_file(const char* filename)
 {
-	if(comm->me == 0) {
-		FILE *fp = fopen(filename, "r");
-		if(fp == NULL) {
-			char str[1024];
-			sprintf(str,"Cannot open spline MEAM potential file %s", filename);
-			error->one(FLERR,str);
-		}
-
-		// Skip first line of file.
-		char line[MAXLINE];
-		fgets(line, MAXLINE, fp);
-
-		// Parse spline functions.
-		phi.parse(fp, error);
-		rho.parse(fp, error);
-		U.parse(fp, error);
-		f.parse(fp, error);
-		g.parse(fp, error);
-
-		fclose(fp);
-	}
-
-	// Transfer spline functions from master processor to all other processors.
-	phi.communicate(world, comm->me);
-	rho.communicate(world, comm->me);
-	f.communicate(world, comm->me);
-	U.communicate(world, comm->me);
-	g.communicate(world, comm->me);
-
-	// Calculate 'zero-point energy' of single atom in vacuum.
-	zero_atom_energy = U.eval(0.0);
-
-	// Determine maximum cutoff radius of all relevant spline functions.
-	cutoff = 0.0;
-	if(phi.cutoff() > cutoff) cutoff = phi.cutoff();
-	if(rho.cutoff() > cutoff) cutoff = rho.cutoff();
-	if(f.cutoff() > cutoff) cutoff = f.cutoff();
-
-	// Set LAMMPS pair interaction flags.
-	for(int i = 1; i <= atom->ntypes; i++) {
-		for(int j = 1; j <= atom->ntypes; j++) {
-			setflag[i][j] = 1;
-			cutsq[i][j] = cutoff;
-		}
-	}
-
-	//phi.writeGnuplot("phi.gp", "Phi(r)");
-	//rho.writeGnuplot("rho.gp", "Rho(r)");
-	//f.writeGnuplot("f.gp", "f(r)");
-	//U.writeGnuplot("U.gp", "U(rho)");
-	//g.writeGnuplot("g.gp", "g(x)");
+        if(comm->me == 0) {
+                FILE *fp = fopen(filename, "r");
+                if(fp == NULL) {
+                        char str[1024];
+                        sprintf(str,"Cannot open spline MEAM potential file %s", filename);
+                        error->one(FLERR,str);
+                }
+
+                // Skip first line of file.
+                char line[MAXLINE];
+                fgets(line, MAXLINE, fp);
+
+                // Parse spline functions.
+                phi.parse(fp, error);
+                rho.parse(fp, error);
+                U.parse(fp, error);
+                f.parse(fp, error);
+                g.parse(fp, error);
+
+                fclose(fp);
+        }
+
+        // Transfer spline functions from master processor to all other processors.
+        phi.communicate(world, comm->me);
+        rho.communicate(world, comm->me);
+        f.communicate(world, comm->me);
+        U.communicate(world, comm->me);
+        g.communicate(world, comm->me);
+
+        // Calculate 'zero-point energy' of single atom in vacuum.
+        zero_atom_energy = U.eval(0.0);
+
+        // Determine maximum cutoff radius of all relevant spline functions.
+        cutoff = 0.0;
+        if(phi.cutoff() > cutoff) cutoff = phi.cutoff();
+        if(rho.cutoff() > cutoff) cutoff = rho.cutoff();
+        if(f.cutoff() > cutoff) cutoff = f.cutoff();
+
+        // Set LAMMPS pair interaction flags.
+        for(int i = 1; i <= atom->ntypes; i++) {
+                for(int j = 1; j <= atom->ntypes; j++) {
+                        setflag[i][j] = 1;
+                        cutsq[i][j] = cutoff;
+                }
+        }
+
+        //phi.writeGnuplot("phi.gp", "Phi(r)");
+        //rho.writeGnuplot("rho.gp", "Rho(r)");
+        //f.writeGnuplot("f.gp", "f(r)");
+        //U.writeGnuplot("U.gp", "U(rho)");
+        //g.writeGnuplot("g.gp", "g(x)");
 }
 
 /* ----------------------------------------------------------------------
@@ -524,19 +524,19 @@ void PairMEAMSpline::read_file(const char* filename)
 ------------------------------------------------------------------------- */
 void PairMEAMSpline::init_style()
 {
-	if(force->newton_pair == 0)
-		error->all(FLERR,"Pair style meam/spline requires newton pair on");
-
-	// Need both full and half neighbor list.
-	int irequest_full = neighbor->request(this);
-	neighbor->requests[irequest_full]->id = 1;
-	neighbor->requests[irequest_full]->half = 0;
-	neighbor->requests[irequest_full]->full = 1;
-	int irequest_half = neighbor->request(this);
-	neighbor->requests[irequest_half]->id = 2;
-	neighbor->requests[irequest_half]->half = 0;
-	neighbor->requests[irequest_half]->half_from_full = 1;
-	neighbor->requests[irequest_half]->otherlist = irequest_full;
+        if(force->newton_pair == 0)
+                error->all(FLERR,"Pair style meam/spline requires newton pair on");
+
+        // Need both full and half neighbor list.
+        int irequest_full = neighbor->request(this);
+        neighbor->requests[irequest_full]->id = 1;
+        neighbor->requests[irequest_full]->half = 0;
+        neighbor->requests[irequest_full]->full = 1;
+        int irequest_half = neighbor->request(this);
+        neighbor->requests[irequest_half]->id = 2;
+        neighbor->requests[irequest_half]->half = 0;
+        neighbor->requests[irequest_half]->half_from_full = 1;
+        neighbor->requests[irequest_half]->otherlist = irequest_full;
 }
 
 /* ----------------------------------------------------------------------
@@ -545,8 +545,8 @@ void PairMEAMSpline::init_style()
 ------------------------------------------------------------------------- */
 void PairMEAMSpline::init_list(int id, NeighList *ptr)
 {
-	if(id == 1) listfull = ptr;
-	else if(id == 2) listhalf = ptr;
+        if(id == 1) listfull = ptr;
+        else if(id == 2) listhalf = ptr;
 }
 
 /* ----------------------------------------------------------------------
@@ -554,32 +554,32 @@ void PairMEAMSpline::init_list(int id, NeighList *ptr)
 ------------------------------------------------------------------------- */
 double PairMEAMSpline::init_one(int i, int j)
 {
-	return cutoff;
+        return cutoff;
 }
 
 /* ---------------------------------------------------------------------- */
 
 int PairMEAMSpline::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
 {
-	int* list_iter = list;
-	int* list_iter_end = list + n;
-	while(list_iter != list_iter_end)
-		*buf++ = Uprime_values[*list_iter++];
-	return 1;
+        int* list_iter = list;
+        int* list_iter_end = list + n;
+        while(list_iter != list_iter_end)
+                *buf++ = Uprime_values[*list_iter++];
+        return 1;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void PairMEAMSpline::unpack_comm(int n, int first, double *buf)
 {
-	memcpy(&Uprime_values[first], buf, n * sizeof(buf[0]));
+        memcpy(&Uprime_values[first], buf, n * sizeof(buf[0]));
 }
 
 /* ---------------------------------------------------------------------- */
 
 int PairMEAMSpline::pack_reverse_comm(int n, int first, double *buf)
 {
-	return 0;
+        return 0;
 }
 
 /* ---------------------------------------------------------------------- */
@@ -593,116 +593,116 @@ void PairMEAMSpline::unpack_reverse_comm(int n, int *list, double *buf)
 ------------------------------------------------------------------------- */
 double PairMEAMSpline::memory_usage()
 {
-	return nmax * sizeof(double);	// The Uprime_values array.
+        return nmax * sizeof(double);        // The Uprime_values array.
 }
 
 
 /// Parses the spline knots from a text file.
 void PairMEAMSpline::SplineFunction::parse(FILE* fp, Error* error)
 {
-	char line[MAXLINE];
-
-	// Parse number of spline knots.
-	fgets(line, MAXLINE, fp);
-	int n = atoi(line);
-	if(n < 2)
-		error->one(FLERR,"Invalid number of spline knots in MEAM potential file");
-
-	// Parse first derivatives at beginning and end of spline.
-	fgets(line, MAXLINE, fp);
-	double d0 = atof(strtok(line, " \t\n\r\f"));
-	double dN = atof(strtok(NULL, " \t\n\r\f"));
-	init(n, d0, dN);
-
-	// Skip line.
-	fgets(line, MAXLINE, fp);
-
-	// Parse knot coordinates.
-	for(int i=0; i<n; i++) {
-		fgets(line, MAXLINE, fp);
-		double x, y, y2;
-		if(sscanf(line, "%lg %lg %lg", &x, &y, &y2) != 3) {
-			error->one(FLERR,"Invalid knot line in MEAM potential file");
-		}
-		setKnot(i, x, y);
-	}
-
-	prepareSpline(error);
+        char line[MAXLINE];
+
+        // Parse number of spline knots.
+        fgets(line, MAXLINE, fp);
+        int n = atoi(line);
+        if(n < 2)
+                error->one(FLERR,"Invalid number of spline knots in MEAM potential file");
+
+        // Parse first derivatives at beginning and end of spline.
+        fgets(line, MAXLINE, fp);
+        double d0 = atof(strtok(line, " \t\n\r\f"));
+        double dN = atof(strtok(NULL, " \t\n\r\f"));
+        init(n, d0, dN);
+
+        // Skip line.
+        fgets(line, MAXLINE, fp);
+
+        // Parse knot coordinates.
+        for(int i=0; i<n; i++) {
+                fgets(line, MAXLINE, fp);
+                double x, y, y2;
+                if(sscanf(line, "%lg %lg %lg", &x, &y, &y2) != 3) {
+                        error->one(FLERR,"Invalid knot line in MEAM potential file");
+                }
+                setKnot(i, x, y);
+        }
+
+        prepareSpline(error);
 }
 
 /// Calculates the second derivatives at the knots of the cubic spline.
 void PairMEAMSpline::SplineFunction::prepareSpline(Error* error)
 {
-	xmin = X[0];
-	xmax = X[N-1];
-
-	isGridSpline = true;
-	h = (xmax-xmin)/(N-1);
-	hsq = h*h;
-
-	double* u = new double[N];
-	Y2[0] = -0.5;
-	u[0] = (3.0/(X[1]-X[0])) * ((Y[1]-Y[0])/(X[1]-X[0]) - deriv0);
-	for(int i = 1; i <= N-2; i++) {
-		double sig = (X[i]-X[i-1]) / (X[i+1]-X[i-1]);
-		double p = sig * Y2[i-1] + 2.0;
-		Y2[i] = (sig - 1.0) / p;
-		u[i] = (Y[i+1]-Y[i]) / (X[i+1]-X[i]) - (Y[i]-Y[i-1])/(X[i]-X[i-1]);
-		u[i] = (6.0 * u[i]/(X[i+1]-X[i-1]) - sig*u[i-1])/p;
-
-		if(fabs(h*i+xmin - X[i]) > 1e-8)
-			isGridSpline = false;
-	}
-
-	double qn = 0.5;
-	double un = (3.0/(X[N-1]-X[N-2])) * (derivN - (Y[N-1]-Y[N-2])/(X[N-1]-X[N-2]));
-	Y2[N-1] = (un - qn*u[N-2]) / (qn * Y2[N-2] + 1.0);
-	for(int k = N-2; k >= 0; k--) {
-		Y2[k] = Y2[k] * Y2[k+1] + u[k];
-	}
-
-	delete[] u;
+        xmin = X[0];
+        xmax = X[N-1];
+
+        isGridSpline = true;
+        h = (xmax-xmin)/(N-1);
+        hsq = h*h;
+
+        double* u = new double[N];
+        Y2[0] = -0.5;
+        u[0] = (3.0/(X[1]-X[0])) * ((Y[1]-Y[0])/(X[1]-X[0]) - deriv0);
+        for(int i = 1; i <= N-2; i++) {
+                double sig = (X[i]-X[i-1]) / (X[i+1]-X[i-1]);
+                double p = sig * Y2[i-1] + 2.0;
+                Y2[i] = (sig - 1.0) / p;
+                u[i] = (Y[i+1]-Y[i]) / (X[i+1]-X[i]) - (Y[i]-Y[i-1])/(X[i]-X[i-1]);
+                u[i] = (6.0 * u[i]/(X[i+1]-X[i-1]) - sig*u[i-1])/p;
+
+                if(fabs(h*i+xmin - X[i]) > 1e-8)
+                        isGridSpline = false;
+        }
+
+        double qn = 0.5;
+        double un = (3.0/(X[N-1]-X[N-2])) * (derivN - (Y[N-1]-Y[N-2])/(X[N-1]-X[N-2]));
+        Y2[N-1] = (un - qn*u[N-2]) / (qn * Y2[N-2] + 1.0);
+        for(int k = N-2; k >= 0; k--) {
+                Y2[k] = Y2[k] * Y2[k+1] + u[k];
+        }
+
+        delete[] u;
 
 #if !SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES
-	if(!isGridSpline)
-		error->one(FLERR,"Support for MEAM potentials with non-uniform cubic splines has not been enabled in the MEAM potential code. Set SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES in pair_spline_meam.h to 1 to enable it");
+        if(!isGridSpline)
+                error->one(FLERR,"Support for MEAM potentials with non-uniform cubic splines has not been enabled in the MEAM potential code. Set SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES in pair_spline_meam.h to 1 to enable it");
 #endif
 
-	// Shift the spline to X=0 to speed up interpolation.
-	for(int i = 0; i < N; i++) {
-		Xs[i] = X[i] - xmin;
+        // Shift the spline to X=0 to speed up interpolation.
+        for(int i = 0; i < N; i++) {
+                Xs[i] = X[i] - xmin;
 #if !SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES
-		if(i < N-1) Ydelta[i] = (Y[i+1]-Y[i])/h;
-		Y2[i] /= h*6.0;
+                if(i < N-1) Ydelta[i] = (Y[i+1]-Y[i])/h;
+                Y2[i] /= h*6.0;
 #endif
-	}
-	xmax_shifted = xmax - xmin;
+        }
+        xmax_shifted = xmax - xmin;
 }
 
 /// Broadcasts the spline function parameters to all processors.
 void PairMEAMSpline::SplineFunction::communicate(MPI_Comm& world, int me)
 {
-	MPI_Bcast(&N, 1, MPI_INT, 0, world);
-	MPI_Bcast(&deriv0, 1, MPI_DOUBLE, 0, world);
-	MPI_Bcast(&derivN, 1, MPI_DOUBLE, 0, world);
-	MPI_Bcast(&xmin, 1, MPI_DOUBLE, 0, world);
-	MPI_Bcast(&xmax, 1, MPI_DOUBLE, 0, world);
-	MPI_Bcast(&xmax_shifted, 1, MPI_DOUBLE, 0, world);
-	MPI_Bcast(&isGridSpline, 1, MPI_INT, 0, world);
-	MPI_Bcast(&h, 1, MPI_DOUBLE, 0, world);
-	MPI_Bcast(&hsq, 1, MPI_DOUBLE, 0, world);
-	if(me != 0) {
-		X = new double[N];
-		Xs = new double[N];
-		Y = new double[N];
-		Y2 = new double[N];
-		Ydelta = new double[N];
-	}
-	MPI_Bcast(X, N, MPI_DOUBLE, 0, world);
-	MPI_Bcast(Xs, N, MPI_DOUBLE, 0, world);
-	MPI_Bcast(Y, N, MPI_DOUBLE, 0, world);
-	MPI_Bcast(Y2, N, MPI_DOUBLE, 0, world);
-	MPI_Bcast(Ydelta, N, MPI_DOUBLE, 0, world);
+        MPI_Bcast(&N, 1, MPI_INT, 0, world);
+        MPI_Bcast(&deriv0, 1, MPI_DOUBLE, 0, world);
+        MPI_Bcast(&derivN, 1, MPI_DOUBLE, 0, world);
+        MPI_Bcast(&xmin, 1, MPI_DOUBLE, 0, world);
+        MPI_Bcast(&xmax, 1, MPI_DOUBLE, 0, world);
+        MPI_Bcast(&xmax_shifted, 1, MPI_DOUBLE, 0, world);
+        MPI_Bcast(&isGridSpline, 1, MPI_INT, 0, world);
+        MPI_Bcast(&h, 1, MPI_DOUBLE, 0, world);
+        MPI_Bcast(&hsq, 1, MPI_DOUBLE, 0, world);
+        if(me != 0) {
+                X = new double[N];
+                Xs = new double[N];
+                Y = new double[N];
+                Y2 = new double[N];
+                Ydelta = new double[N];
+        }
+        MPI_Bcast(X, N, MPI_DOUBLE, 0, world);
+        MPI_Bcast(Xs, N, MPI_DOUBLE, 0, world);
+        MPI_Bcast(Y, N, MPI_DOUBLE, 0, world);
+        MPI_Bcast(Y2, N, MPI_DOUBLE, 0, world);
+        MPI_Bcast(Ydelta, N, MPI_DOUBLE, 0, world);
 }
 
 /// Writes a Gnuplot script that plots the spline function.
@@ -710,23 +710,22 @@ void PairMEAMSpline::SplineFunction::communicate(MPI_Comm& world, int me)
 /// This function is for debugging only!
 void PairMEAMSpline::SplineFunction::writeGnuplot(const char* filename, const char* title) const
 {
-	FILE* fp = fopen(filename, "w");
-	fprintf(fp, "#!/usr/bin/env gnuplot\n");
-	if(title) fprintf(fp, "set title \"%s\"\n", title);
-	double tmin = X[0] - (X[N-1] - X[0]) * 0.05;
-	double tmax = X[N-1] + (X[N-1] - X[0]) * 0.05;
-	double delta = (tmax - tmin) / (N*200);
-	fprintf(fp, "set xrange [%f:%f]\n", tmin, tmax);
-	fprintf(fp, "plot '-' with lines notitle, '-' with points notitle pt 3 lc 3\n");
-	for(double x = tmin; x <= tmax+1e-8; x += delta) {
-		double y = eval(x);
-		fprintf(fp, "%f %f\n", x, y);
-	}
-	fprintf(fp, "e\n");
-	for(int i = 0; i < N; i++) {
-		fprintf(fp, "%f %f\n", X[i], Y[i]);
-	}
-	fprintf(fp, "e\n");
-	fclose(fp);
+        FILE* fp = fopen(filename, "w");
+        fprintf(fp, "#!/usr/bin/env gnuplot\n");
+        if(title) fprintf(fp, "set title \"%s\"\n", title);
+        double tmin = X[0] - (X[N-1] - X[0]) * 0.05;
+        double tmax = X[N-1] + (X[N-1] - X[0]) * 0.05;
+        double delta = (tmax - tmin) / (N*200);
+        fprintf(fp, "set xrange [%f:%f]\n", tmin, tmax);
+        fprintf(fp, "plot '-' with lines notitle, '-' with points notitle pt 3 lc 3\n");
+        for(double x = tmin; x <= tmax+1e-8; x += delta) {
+                double y = eval(x);
+                fprintf(fp, "%f %f\n", x, y);
+        }
+        fprintf(fp, "e\n");
+        for(int i = 0; i < N; i++) {
+                fprintf(fp, "%f %f\n", X[i], Y[i]);
+        }
+        fprintf(fp, "e\n");
+        fclose(fp);
 }
-
diff --git a/src/USER-MISC/pair_meam_spline.h b/src/USER-MISC/pair_meam_spline.h
index 733a05cf93..fdf8972e63 100644
--- a/src/USER-MISC/pair_meam_spline.h
+++ b/src/USER-MISC/pair_meam_spline.h
@@ -76,199 +76,199 @@ namespace LAMMPS_NS {
 class PairMEAMSpline : public Pair
 {
 public:
-	PairMEAMSpline(class LAMMPS *);
-	virtual ~PairMEAMSpline();
-	virtual void compute(int, int);
-	void settings(int, char **);
-	void coeff(int, char **);
-	void init_style();
-	void init_list(int, class NeighList *);
-	double init_one(int, int);
-
-	int pack_comm(int, int *, double *, int, int *);
-	void unpack_comm(int, int, double *);
-	int pack_reverse_comm(int, int, double *);
-	void unpack_reverse_comm(int, int *, double *);
-	double memory_usage();
+        PairMEAMSpline(class LAMMPS *);
+        virtual ~PairMEAMSpline();
+        virtual void compute(int, int);
+        void settings(int, char **);
+        void coeff(int, char **);
+        void init_style();
+        void init_list(int, class NeighList *);
+        double init_one(int, int);
+
+        int pack_comm(int, int *, double *, int, int *);
+        void unpack_comm(int, int, double *);
+        int pack_reverse_comm(int, int, double *);
+        void unpack_reverse_comm(int, int *, double *);
+        double memory_usage();
 
 protected:
   char **elements;              // names of unique elements
   int *map;                     // mapping from atom types to elements
   int nelements;                // # of unique elements
 
-	class SplineFunction {
-	public:
-
-		/// Default constructor.
-		SplineFunction() : X(NULL), Xs(NULL), Y(NULL), Y2(NULL), Ydelta(NULL), N(0) {}
-
-		/// Destructor.
-		~SplineFunction() {
-			delete[] X;
-			delete[] Xs;
-			delete[] Y;
-			delete[] Y2;
-			delete[] Ydelta;
-		}
-
-		/// Initialization of spline function.
-		void init(int _N, double _deriv0, double _derivN) {
-			N = _N;
-			deriv0 = _deriv0;
-			derivN = _derivN;
-			delete[] X;
-			delete[] Xs;
-			delete[] Y;
-			delete[] Y2;
-			delete[] Ydelta;
-			X = new double[N];
-			Xs = new double[N];
-			Y = new double[N];
-			Y2 = new double[N];
-			Ydelta = new double[N];
-		}
-
-		/// Adds a knot to the spline.
-		void setKnot(int n, double x, double y) { X[n] = x; Y[n] = y; }
-
-		/// Returns the number of knots.
-		int numKnots() const { return N; }
-
-		/// Parses the spline knots from a text file.
-		void parse(FILE* fp, Error* error);
-
-		/// Calculates the second derivatives of the cubic spline.
-		void prepareSpline(Error* error);
-
-		/// Evaluates the spline function at position x.
-		inline double eval(double x) const
-		{
-			x -= xmin;
-			if(x <= 0.0) {  // Left extrapolation.
-				return Y[0] + deriv0 * x;
-			}
-			else if(x >= xmax_shifted) {  // Right extrapolation.
-				return Y[N-1] + derivN * (x - xmax_shifted);
-			}
-			else {
+        class SplineFunction {
+        public:
+
+                /// Default constructor.
+                SplineFunction() : X(NULL), Xs(NULL), Y(NULL), Y2(NULL), Ydelta(NULL), N(0) {}
+
+                /// Destructor.
+                ~SplineFunction() {
+                        delete[] X;
+                        delete[] Xs;
+                        delete[] Y;
+                        delete[] Y2;
+                        delete[] Ydelta;
+                }
+
+                /// Initialization of spline function.
+                void init(int _N, double _deriv0, double _derivN) {
+                        N = _N;
+                        deriv0 = _deriv0;
+                        derivN = _derivN;
+                        delete[] X;
+                        delete[] Xs;
+                        delete[] Y;
+                        delete[] Y2;
+                        delete[] Ydelta;
+                        X = new double[N];
+                        Xs = new double[N];
+                        Y = new double[N];
+                        Y2 = new double[N];
+                        Ydelta = new double[N];
+                }
+
+                /// Adds a knot to the spline.
+                void setKnot(int n, double x, double y) { X[n] = x; Y[n] = y; }
+
+                /// Returns the number of knots.
+                int numKnots() const { return N; }
+
+                /// Parses the spline knots from a text file.
+                void parse(FILE* fp, Error* error);
+
+                /// Calculates the second derivatives of the cubic spline.
+                void prepareSpline(Error* error);
+
+                /// Evaluates the spline function at position x.
+                inline double eval(double x) const
+                {
+                        x -= xmin;
+                        if(x <= 0.0) {  // Left extrapolation.
+                                return Y[0] + deriv0 * x;
+                        }
+                        else if(x >= xmax_shifted) {  // Right extrapolation.
+                                return Y[N-1] + derivN * (x - xmax_shifted);
+                        }
+                        else {
 #if SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES
-				// Do interval search.
-				int klo = 0;
-				int khi = N-1;
-				while(khi - klo > 1) {
-					int k = (khi + klo) / 2;
-					if(Xs[k] > x) khi = k;
-					else klo = k;
-				}
-				double h = Xs[khi] - Xs[klo];
-				// Do spline interpolation.
-				double a = (Xs[khi] - x)/h;
-				double b = 1.0 - a; // = (x - X[klo])/h
-				return a * Y[klo] + b * Y[khi] + ((a*a*a - a) * Y2[klo] + (b*b*b - b) * Y2[khi])*(h*h)/6.0;
+                                // Do interval search.
+                                int klo = 0;
+                                int khi = N-1;
+                                while(khi - klo > 1) {
+                                        int k = (khi + klo) / 2;
+                                        if(Xs[k] > x) khi = k;
+                                        else klo = k;
+                                }
+                                double h = Xs[khi] - Xs[klo];
+                                // Do spline interpolation.
+                                double a = (Xs[khi] - x)/h;
+                                double b = 1.0 - a; // = (x - X[klo])/h
+                                return a * Y[klo] + b * Y[khi] + ((a*a*a - a) * Y2[klo] + (b*b*b - b) * Y2[khi])*(h*h)/6.0;
 #else
-				// For a spline with grid points, we can directly calculate the interval X is in.
-				int klo = (int)(x / h);
-				int khi = klo + 1;
-				double a = Xs[khi] - x;
-				double b = h - a;
-				return Y[khi] - a * Ydelta[klo] + ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]);
+                                // For a spline with grid points, we can directly calculate the interval X is in.
+                                int klo = (int)(x / h);
+                                int khi = klo + 1;
+                                double a = Xs[khi] - x;
+                                double b = h - a;
+                                return Y[khi] - a * Ydelta[klo] + ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]);
 #endif
-			}
-		}
-
-		/// Evaluates the spline function and its first derivative at position x.
-		inline double eval(double x, double& deriv) const
-		{
-			x -= xmin;
-			if(x <= 0.0) {  // Left extrapolation.
-				deriv = deriv0;
-				return Y[0] + deriv0 * x;
-			}
-			else if(x >= xmax_shifted) {  // Right extrapolation.
-				deriv = derivN;
-				return Y[N-1] + derivN * (x - xmax_shifted);
-			}
-			else {
+                        }
+                }
+
+                /// Evaluates the spline function and its first derivative at position x.
+                inline double eval(double x, double& deriv) const
+                {
+                        x -= xmin;
+                        if(x <= 0.0) {  // Left extrapolation.
+                                deriv = deriv0;
+                                return Y[0] + deriv0 * x;
+                        }
+                        else if(x >= xmax_shifted) {  // Right extrapolation.
+                                deriv = derivN;
+                                return Y[N-1] + derivN * (x - xmax_shifted);
+                        }
+                        else {
 #if SPLINE_MEAM_SUPPORT_NON_GRID_SPLINES
-				// Do interval search.
-				int klo = 0;
-				int khi = N-1;
-				while(khi - klo > 1) {
-					int k = (khi + klo) / 2;
-					if(Xs[k] > x) khi = k;
-					else klo = k;
-				}
-				double h = Xs[khi] - Xs[klo];
-				// Do spline interpolation.
-				double a = (Xs[khi] - x)/h;
-				double b = 1.0 - a; // = (x - X[klo])/h
-				deriv = (Y[khi] - Y[klo]) / h + ((3.0*b*b - 1.0) * Y2[khi] - (3.0*a*a - 1.0) * Y2[klo]) * h / 6.0;
-				return a * Y[klo] + b * Y[khi] + ((a*a*a - a) * Y2[klo] + (b*b*b - b) * Y2[khi]) * (h*h) / 6.0;
+                                // Do interval search.
+                                int klo = 0;
+                                int khi = N-1;
+                                while(khi - klo > 1) {
+                                        int k = (khi + klo) / 2;
+                                        if(Xs[k] > x) khi = k;
+                                        else klo = k;
+                                }
+                                double h = Xs[khi] - Xs[klo];
+                                // Do spline interpolation.
+                                double a = (Xs[khi] - x)/h;
+                                double b = 1.0 - a; // = (x - X[klo])/h
+                                deriv = (Y[khi] - Y[klo]) / h + ((3.0*b*b - 1.0) * Y2[khi] - (3.0*a*a - 1.0) * Y2[klo]) * h / 6.0;
+                                return a * Y[klo] + b * Y[khi] + ((a*a*a - a) * Y2[klo] + (b*b*b - b) * Y2[khi]) * (h*h) / 6.0;
 #else
-				// For a spline with grid points, we can directly calculate the interval X is in.
-				int klo = (int)(x / h);
-				int khi = klo + 1;
-				double a = Xs[khi] - x;
-				double b = h - a;
-				deriv = Ydelta[klo] + ((3.0*b*b - hsq) * Y2[khi] - (3.0*a*a - hsq) * Y2[klo]);
-				return Y[khi] - a * Ydelta[klo] + ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]);
+                                // For a spline with grid points, we can directly calculate the interval X is in.
+                                int klo = (int)(x / h);
+                                int khi = klo + 1;
+                                double a = Xs[khi] - x;
+                                double b = h - a;
+                                deriv = Ydelta[klo] + ((3.0*b*b - hsq) * Y2[khi] - (3.0*a*a - hsq) * Y2[klo]);
+                                return Y[khi] - a * Ydelta[klo] + ((a*a - hsq) * a * Y2[klo] + (b*b - hsq) * b * Y2[khi]);
 #endif
-			}
-		}
-
-		/// Returns the number of bytes used by this function object.
-		double memory_usage() const { return sizeof(*this) + sizeof(X[0]) * N * 3; }
-
-		/// Returns the cutoff radius of this function.
-		double cutoff() const { return X[N-1]; }
-
-		/// Writes a Gnuplot script that plots the spline function.
-		void writeGnuplot(const char* filename, const char* title = NULL) const;
-
-		/// Broadcasts the spline function parameters to all processors.
-		void communicate(MPI_Comm& world, int me);
-
-	private:
-		double* X;				// Positions of spline knots
-		double* Xs;				// Shifted positions of spline knots
-		double* Y;				// Function values at spline knots
-		double* Y2;				// Second derivatives at spline knots
-		double* Ydelta;			// If this is a grid spline, Ydelta[i] = (Y[i+1]-Y[i])/h
-		int N;					// Number of spline knots
-		double deriv0;			// First derivative at knot 0
-		double derivN;			// First derivative at knot (N-1)
-		double xmin;			// The beginning of the interval on which the spline function is defined.
-		double xmax;			// The end of the interval on which the spline function is defined.
-		int isGridSpline;		// Indicates that all spline knots are on a regular grid.
-		double h;				// The distance between knots if this is a grid spline with equidistant knots.
-		double hsq;				// The squared distance between knots if this is a grid spline with equidistant knots.
-		double xmax_shifted;	// The end of the spline interval after it has been shifted to begin at X=0.
-	};
-
-	/// Helper data structure for potential routine.
-	struct MEAM2Body {
-		int tag;
-		double r;
-		double f, fprime;
-		double del[3];
-	};
-
-	SplineFunction phi;			// Phi(r_ij)
-	SplineFunction rho;			// Rho(r_ij)
-	SplineFunction f;			// f(r_ij)
-	SplineFunction U;			// U(rho)
-	SplineFunction g;			// g(cos_theta)
-	double zero_atom_energy;	// Shift embedding energy by this value to make it zero for a single atom in vacuum.
-
-	double cutoff;              // The cutoff radius
-
-	double* Uprime_values;		// Used for temporary storage of U'(rho) values
-	int nmax;					// Size of temporary array.
-	int maxNeighbors;			// The last maximum number of neighbors a single atoms has.
-	MEAM2Body* twoBodyInfo;		// Temporary array.
-
-	void read_file(const char* filename);
-	void allocate();
+                        }
+                }
+
+                /// Returns the number of bytes used by this function object.
+                double memory_usage() const { return sizeof(*this) + sizeof(X[0]) * N * 3; }
+
+                /// Returns the cutoff radius of this function.
+                double cutoff() const { return X[N-1]; }
+
+                /// Writes a Gnuplot script that plots the spline function.
+                void writeGnuplot(const char* filename, const char* title = NULL) const;
+
+                /// Broadcasts the spline function parameters to all processors.
+                void communicate(MPI_Comm& world, int me);
+
+        private:
+                double* X;                                // Positions of spline knots
+                double* Xs;                                // Shifted positions of spline knots
+                double* Y;                                // Function values at spline knots
+                double* Y2;                                // Second derivatives at spline knots
+                double* Ydelta;                        // If this is a grid spline, Ydelta[i] = (Y[i+1]-Y[i])/h
+                int N;                                        // Number of spline knots
+                double deriv0;                        // First derivative at knot 0
+                double derivN;                        // First derivative at knot (N-1)
+                double xmin;                        // The beginning of the interval on which the spline function is defined.
+                double xmax;                        // The end of the interval on which the spline function is defined.
+                int isGridSpline;                // Indicates that all spline knots are on a regular grid.
+                double h;                                // The distance between knots if this is a grid spline with equidistant knots.
+                double hsq;                                // The squared distance between knots if this is a grid spline with equidistant knots.
+                double xmax_shifted;        // The end of the spline interval after it has been shifted to begin at X=0.
+        };
+
+        /// Helper data structure for potential routine.
+        struct MEAM2Body {
+                int tag;
+                double r;
+                double f, fprime;
+                double del[3];
+        };
+
+        SplineFunction phi;                        // Phi(r_ij)
+        SplineFunction rho;                        // Rho(r_ij)
+        SplineFunction f;                        // f(r_ij)
+        SplineFunction U;                        // U(rho)
+        SplineFunction g;                        // g(cos_theta)
+        double zero_atom_energy;        // Shift embedding energy by this value to make it zero for a single atom in vacuum.
+
+        double cutoff;              // The cutoff radius
+
+        double* Uprime_values;                // Used for temporary storage of U'(rho) values
+        int nmax;                                        // Size of temporary array.
+        int maxNeighbors;                        // The last maximum number of neighbors a single atoms has.
+        MEAM2Body* twoBodyInfo;                // Temporary array.
+
+        void read_file(const char* filename);
+        void allocate();
 };
 
 }
diff --git a/src/USER-MISC/pair_tersoff_table.cpp b/src/USER-MISC/pair_tersoff_table.cpp
index 74997af935..ce25a86393 100644
--- a/src/USER-MISC/pair_tersoff_table.cpp
+++ b/src/USER-MISC/pair_tersoff_table.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -80,7 +80,7 @@ PairTersoffTable::~PairTersoffTable()
     memory->destroy(setflag);
     memory->destroy(cutsq);
     delete [] map;
-    
+
     deallocateGrids();
     deallocatePreLoops();
   }
@@ -103,7 +103,7 @@ void PairTersoffTable::compute(int eflag, int vflag)
   double invR_ij, invR_ik, cosTeta;
   double repulsivePotential, attractivePotential;
   double exponentRepulsivePotential, exponentAttractivePotential,interpolTMP,interpolDeltaX,interpolY1;
-  double interpolY2, cutoffFunctionIJ, attractiveExponential, repulsiveExponential, cutoffFunctionDerivedIJ,zeta; 
+  double interpolY2, cutoffFunctionIJ, attractiveExponential, repulsiveExponential, cutoffFunctionDerivedIJ,zeta;
   double gtetaFunctionIJK,gtetaFunctionDerivedIJK,cutoffFunctionIK;
   double cutoffFunctionDerivedIK,factor_force3_ij,factor_1_force3_ik;
   double factor_2_force3_ik,betaZetaPowerIJK,betaZetaPowerDerivedIJK,factor_force_tot;
@@ -142,8 +142,8 @@ void PairTersoffTable::compute(int eflag, int vflag)
     if (jnum > leadingDimensionInteractionList) {
       char errmsg[256];
       sprintf(errmsg,"Too many neighbors for interaction list: %d vs %d.\n"
-	      "Check your system or increase 'leadingDimensionInteractionList'",
-	      jnum, leadingDimensionInteractionList);
+              "Check your system or increase 'leadingDimensionInteractionList'",
+              jnum, leadingDimensionInteractionList);
       error->one(FLERR,errmsg);
     }
 
@@ -168,11 +168,11 @@ void PairTersoffTable::compute(int eflag, int vflag)
       r_ij = sqrt(r_ij);
 
       invR_ij = 1.0 / r_ij;
-      
+
       directorCos_ij_x = invR_ij * dr_ij[0];
       directorCos_ij_y = invR_ij * dr_ij[1];
       directorCos_ij_z = invR_ij * dr_ij[2];
-      
+
       // preCutoffFunction
       interpolDeltaX =  r_ij - GRIDSTART;
       interpolTMP = (interpolDeltaX * GRIDDENSITY_FCUTOFF);
@@ -187,47 +187,47 @@ void PairTersoffTable::compute(int eflag, int vflag)
 
 
       for (int neighbor_k = neighbor_j + 1; neighbor_k < jnum; neighbor_k++) {
-	double dr_ik[3], r_ik;
-
-	k = jlist[neighbor_k];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	dr_ik[0] = xtmp -x[k][0];
-	dr_ik[1] = ytmp -x[k][1];
-	dr_ik[2] = ztmp -x[k][2];
-	r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
-
-	if (r_ik > params[ikparam].cutsq) continue;
-
-	r_ik = sqrt(r_ik);
-
-	invR_ik = 1.0 / r_ik;
-          
-	directorCos_ik_x = invR_ik * dr_ik[0];
-	directorCos_ik_y = invR_ik * dr_ik[1];
-	directorCos_ik_z = invR_ik * dr_ik[2];
-          
-	cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y + directorCos_ij_z * directorCos_ik_z;
-          
-	// preGtetaFunction
-	interpolDeltaX=cosTeta+1.0;
-	interpolTMP = (interpolDeltaX * GRIDDENSITY_GTETA);
-	interpolIDX = (int) interpolTMP;
-	interpolY1 = gtetaFunction[itype][interpolIDX];
-	interpolY2 = gtetaFunction[itype][interpolIDX+1];
-	gtetaFunction_temp = interpolY1 + (interpolY2 - interpolY1) * (interpolTMP - interpolIDX);
-	// preGtetaFunctionDerived
-	interpolY1 = gtetaFunctionDerived[itype][interpolIDX];
-	interpolY2 = gtetaFunctionDerived[itype][interpolIDX+1];
-	gtetaFunctionDerived_temp = interpolY1 + (interpolY2 - interpolY1) * (interpolTMP - interpolIDX);
-          
-	preGtetaFunction[neighbor_j][neighbor_k]=params[ijkparam].gamma*gtetaFunction_temp;
-	preGtetaFunctionDerived[neighbor_j][neighbor_k]=params[ijkparam].gamma*gtetaFunctionDerived_temp;
-	preGtetaFunction[neighbor_k][neighbor_j]=params[ijkparam].gamma*gtetaFunction_temp;
-	preGtetaFunctionDerived[neighbor_k][neighbor_j]=params[ijkparam].gamma*gtetaFunctionDerived_temp;
+        double dr_ik[3], r_ik;
+
+        k = jlist[neighbor_k];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        dr_ik[0] = xtmp -x[k][0];
+        dr_ik[1] = ytmp -x[k][1];
+        dr_ik[2] = ztmp -x[k][2];
+        r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
+
+        if (r_ik > params[ikparam].cutsq) continue;
+
+        r_ik = sqrt(r_ik);
+
+        invR_ik = 1.0 / r_ik;
+
+        directorCos_ik_x = invR_ik * dr_ik[0];
+        directorCos_ik_y = invR_ik * dr_ik[1];
+        directorCos_ik_z = invR_ik * dr_ik[2];
+
+        cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y + directorCos_ij_z * directorCos_ik_z;
+
+        // preGtetaFunction
+        interpolDeltaX=cosTeta+1.0;
+        interpolTMP = (interpolDeltaX * GRIDDENSITY_GTETA);
+        interpolIDX = (int) interpolTMP;
+        interpolY1 = gtetaFunction[itype][interpolIDX];
+        interpolY2 = gtetaFunction[itype][interpolIDX+1];
+        gtetaFunction_temp = interpolY1 + (interpolY2 - interpolY1) * (interpolTMP - interpolIDX);
+        // preGtetaFunctionDerived
+        interpolY1 = gtetaFunctionDerived[itype][interpolIDX];
+        interpolY2 = gtetaFunctionDerived[itype][interpolIDX+1];
+        gtetaFunctionDerived_temp = interpolY1 + (interpolY2 - interpolY1) * (interpolTMP - interpolIDX);
+
+        preGtetaFunction[neighbor_j][neighbor_k]=params[ijkparam].gamma*gtetaFunction_temp;
+        preGtetaFunctionDerived[neighbor_j][neighbor_k]=params[ijkparam].gamma*gtetaFunctionDerived_temp;
+        preGtetaFunction[neighbor_k][neighbor_j]=params[ijkparam].gamma*gtetaFunction_temp;
+        preGtetaFunctionDerived[neighbor_k][neighbor_j]=params[ijkparam].gamma*gtetaFunctionDerived_temp;
 
       } // loop on K
 
@@ -254,7 +254,7 @@ void PairTersoffTable::compute(int eflag, int vflag)
 
       r_ij = sqrt(r_ij);
       invR_ij = 1.0 / r_ij;
-      
+
       directorCos_ij_x = invR_ij * dr_ij[0];
       directorCos_ij_y = invR_ij * dr_ij[1];
       directorCos_ij_z = invR_ij * dr_ij[2];
@@ -284,72 +284,72 @@ void PairTersoffTable::compute(int eflag, int vflag)
       cutoffFunctionDerivedIJ = preCutoffFunctionDerived[neighbor_j];
 
       zeta = 0.0;
-            
+
       // first loop over neighbours 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;
-
-	k = jlist[neighbor_k];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	dr_ik[0] = xtmp -x[k][0];
-	dr_ik[1] = ytmp -x[k][1];
-	dr_ik[2] = ztmp -x[k][2];
-	r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
-
-	if (r_ik > params[ikparam].cutsq) continue;
-
-	r_ik = sqrt(r_ik);
-
-	invR_ik = 1.0 / r_ik;
-          
-	directorCos_ik_x = invR_ik * r_ik_x;
-	directorCos_ik_y = invR_ik * r_ik_y;
-	directorCos_ik_z = invR_ik * r_ik_z;
-          
-	gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
-          
-	cutoffFunctionIK = preCutoffFunction[neighbor_k];
-          
-	zeta += cutoffFunctionIK * gtetaFunctionIJK;
-          
+        double dr_ik[3], r_ik;
+
+        k = jlist[neighbor_k];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        dr_ik[0] = xtmp -x[k][0];
+        dr_ik[1] = ytmp -x[k][1];
+        dr_ik[2] = ztmp -x[k][2];
+        r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
+
+        if (r_ik > params[ikparam].cutsq) continue;
+
+        r_ik = sqrt(r_ik);
+
+        invR_ik = 1.0 / r_ik;
+
+        directorCos_ik_x = invR_ik * r_ik_x;
+        directorCos_ik_y = invR_ik * r_ik_y;
+        directorCos_ik_z = invR_ik * r_ik_z;
+
+        gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
+
+        cutoffFunctionIK = preCutoffFunction[neighbor_k];
+
+        zeta += cutoffFunctionIK * gtetaFunctionIJK;
+
       }
 
       // first loop over neighbours 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;
-
-	k = jlist[neighbor_k];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	dr_ik[0] = xtmp -x[k][0];
-	dr_ik[1] = ytmp -x[k][1];
-	dr_ik[2] = ztmp -x[k][2];
-	r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
-
-	if (r_ik > params[ikparam].cutsq) continue;
-
-	r_ik = sqrt(r_ik);
-	invR_ik = 1.0 / r_ik;
-          
-	directorCos_ik_x = invR_ik * dr_ik[0];
-	directorCos_ik_y = invR_ik * dr_ik[1];
-	directorCos_ik_z = invR_ik * dr_ik[2];
-          
-	gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
-          
-	cutoffFunctionIK = preCutoffFunction[neighbor_k];
-          
-	zeta += cutoffFunctionIK * gtetaFunctionIJK;
+        double dr_ik[3], r_ik;
+
+        k = jlist[neighbor_k];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        dr_ik[0] = xtmp -x[k][0];
+        dr_ik[1] = ytmp -x[k][1];
+        dr_ik[2] = ztmp -x[k][2];
+        r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
+
+        if (r_ik > params[ikparam].cutsq) continue;
+
+        r_ik = sqrt(r_ik);
+        invR_ik = 1.0 / r_ik;
+
+        directorCos_ik_x = invR_ik * dr_ik[0];
+        directorCos_ik_y = invR_ik * dr_ik[1];
+        directorCos_ik_z = invR_ik * dr_ik[2];
+
+        gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
+
+        cutoffFunctionIK = preCutoffFunction[neighbor_k];
+
+        zeta += cutoffFunctionIK * gtetaFunctionIJK;
       }
-            
-      // betaZetaPowerIJK 
+
+      // betaZetaPowerIJK
       interpolDeltaX= params[ijparam].beta * zeta;
       interpolTMP = (interpolDeltaX * GRIDDENSITY_BIJ);
       interpolIDX = (int) interpolTMP;
@@ -386,133 +386,133 @@ void PairTersoffTable::compute(int eflag, int vflag)
 
       // second loop over neighbours 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];
-
-	k = jlist[neighbor_k];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	dr_ik[0] = xtmp -x[k][0];
-	dr_ik[1] = ytmp -x[k][1];
-	dr_ik[2] = ztmp -x[k][2];
-	r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
-
-	if (r_ik > params[ikparam].cutsq) continue;
-
-	r_ik = sqrt(r_ik);
-	invR_ik = 1.0 / r_ik;
-          
-	directorCos_ik_x = invR_ik * dr_ik[0];
-	directorCos_ik_y = invR_ik * dr_ik[1];
-	directorCos_ik_z = invR_ik * dr_ik[2];
-          
-	cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y + directorCos_ij_z * directorCos_ik_z;
-          
-	gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
-          
-	gtetaFunctionDerivedIJK = preGtetaFunctionDerived[neighbor_j][neighbor_k];
-          
-	cutoffFunctionIK = preCutoffFunction[neighbor_k];
-          
-	cutoffFunctionDerivedIK = preCutoffFunctionDerived[neighbor_k];
-          
-	factor_force3_ij= cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ij *factor_force_tot;
-          
-	f_ij[0] = factor_force3_ij * (directorCos_ij_x*cosTeta - directorCos_ik_x);
-	f_ij[1] = factor_force3_ij * (directorCos_ij_y*cosTeta - directorCos_ik_y);
-	f_ij[2] = factor_force3_ij * (directorCos_ij_z*cosTeta - directorCos_ik_z);
-          
-	factor_1_force3_ik = (cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ik)*factor_force_tot;
-	factor_2_force3_ik = -(cutoffFunctionDerivedIK * gtetaFunctionIJK)*factor_force_tot;
-          
-	f_ik[0] = factor_1_force3_ik * (directorCos_ik_x*cosTeta - directorCos_ij_x) + factor_2_force3_ik * directorCos_ik_x;
-	f_ik[1] = factor_1_force3_ik * (directorCos_ik_y*cosTeta - directorCos_ij_y) + factor_2_force3_ik * directorCos_ik_y;
-	f_ik[2] = factor_1_force3_ik * (directorCos_ik_z*cosTeta - directorCos_ij_z) + factor_2_force3_ik * directorCos_ik_z;
-          
-	f[j][0] -= f_ij[0];
-	f[j][1] -= f_ij[1];
-	f[j][2] -= f_ij[2];
-
-	f[k][0] -= f_ik[0];
-	f[k][1] -= f_ik[1];
-	f[k][2] -= f_ik[2];
-
-	fxtmp += f_ij[0] + f_ik[0];
-	fytmp += f_ij[1] + f_ik[1];
-	fztmp += f_ij[2] + f_ik[2];
-
-	// potential energy
-	evdwl = 0.0;
-
-	if (evflag) ev_tally3(i,j,k,evdwl,0.0,f_ij,f_ik,dr_ij,dr_ik);
+        double dr_ik[3], r_ik, f_ik[3];
+
+        k = jlist[neighbor_k];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        dr_ik[0] = xtmp -x[k][0];
+        dr_ik[1] = ytmp -x[k][1];
+        dr_ik[2] = ztmp -x[k][2];
+        r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
+
+        if (r_ik > params[ikparam].cutsq) continue;
+
+        r_ik = sqrt(r_ik);
+        invR_ik = 1.0 / r_ik;
+
+        directorCos_ik_x = invR_ik * dr_ik[0];
+        directorCos_ik_y = invR_ik * dr_ik[1];
+        directorCos_ik_z = invR_ik * dr_ik[2];
+
+        cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y + directorCos_ij_z * directorCos_ik_z;
+
+        gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
+
+        gtetaFunctionDerivedIJK = preGtetaFunctionDerived[neighbor_j][neighbor_k];
+
+        cutoffFunctionIK = preCutoffFunction[neighbor_k];
+
+        cutoffFunctionDerivedIK = preCutoffFunctionDerived[neighbor_k];
+
+        factor_force3_ij= cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ij *factor_force_tot;
+
+        f_ij[0] = factor_force3_ij * (directorCos_ij_x*cosTeta - directorCos_ik_x);
+        f_ij[1] = factor_force3_ij * (directorCos_ij_y*cosTeta - directorCos_ik_y);
+        f_ij[2] = factor_force3_ij * (directorCos_ij_z*cosTeta - directorCos_ik_z);
+
+        factor_1_force3_ik = (cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ik)*factor_force_tot;
+        factor_2_force3_ik = -(cutoffFunctionDerivedIK * gtetaFunctionIJK)*factor_force_tot;
+
+        f_ik[0] = factor_1_force3_ik * (directorCos_ik_x*cosTeta - directorCos_ij_x) + factor_2_force3_ik * directorCos_ik_x;
+        f_ik[1] = factor_1_force3_ik * (directorCos_ik_y*cosTeta - directorCos_ij_y) + factor_2_force3_ik * directorCos_ik_y;
+        f_ik[2] = factor_1_force3_ik * (directorCos_ik_z*cosTeta - directorCos_ij_z) + factor_2_force3_ik * directorCos_ik_z;
+
+        f[j][0] -= f_ij[0];
+        f[j][1] -= f_ij[1];
+        f[j][2] -= f_ij[2];
+
+        f[k][0] -= f_ik[0];
+        f[k][1] -= f_ik[1];
+        f[k][2] -= f_ik[2];
+
+        fxtmp += f_ij[0] + f_ik[0];
+        fytmp += f_ij[1] + f_ik[1];
+        fztmp += f_ij[2] + f_ik[2];
+
+        // potential energy
+        evdwl = 0.0;
+
+        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
       for (int neighbor_k = neighbor_j+1; neighbor_k < jnum; neighbor_k++) {
-	double dr_ik[3], r_ik, f_ik[3];
-
-	k = jlist[neighbor_k];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	dr_ik[0] = xtmp -x[k][0];
-	dr_ik[1] = ytmp -x[k][1];
-	dr_ik[2] = ztmp -x[k][2];
-	r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
-
-	if (r_ik > params[ikparam].cutsq) continue;
-
-	r_ik = sqrt(r_ik);
-	invR_ik = 1.0 / r_ik;
-          
-	directorCos_ik_x = invR_ik * dr_ik[0];
-	directorCos_ik_y = invR_ik * dr_ik[1];
-	directorCos_ik_z = invR_ik * dr_ik[2];
-          
-	cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y + directorCos_ij_z * directorCos_ik_z;
-          
-	gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
-          
-	gtetaFunctionDerivedIJK = preGtetaFunctionDerived[neighbor_j][neighbor_k];
-          
-	cutoffFunctionIK = preCutoffFunction[neighbor_k];
-          
-	cutoffFunctionDerivedIK = preCutoffFunctionDerived[neighbor_k];
-          
-	factor_force3_ij= cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ij *factor_force_tot;
-          
-	f_ij[0] = factor_force3_ij * (directorCos_ij_x*cosTeta - directorCos_ik_x);
-	f_ij[1] = factor_force3_ij * (directorCos_ij_y*cosTeta - directorCos_ik_y);
-	f_ij[2] = factor_force3_ij * (directorCos_ij_z*cosTeta - directorCos_ik_z);
-          
-	factor_1_force3_ik = (cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ik)*factor_force_tot;
-	factor_2_force3_ik = -(cutoffFunctionDerivedIK * gtetaFunctionIJK)*factor_force_tot;
-          
-	f_ik[0] = factor_1_force3_ik * (directorCos_ik_x*cosTeta - directorCos_ij_x) + factor_2_force3_ik * directorCos_ik_x;
-	f_ik[1] = factor_1_force3_ik * (directorCos_ik_y*cosTeta - directorCos_ij_y) + factor_2_force3_ik * directorCos_ik_y;
-	f_ik[2] = factor_1_force3_ik * (directorCos_ik_z*cosTeta - directorCos_ij_z) + factor_2_force3_ik * directorCos_ik_z;
-          
-	f[j][0] -= f_ij[0];
-	f[j][1] -= f_ij[1];
-	f[j][2] -= f_ij[2];
-
-	f[k][0] -= f_ik[0];
-	f[k][1] -= f_ik[1];
-	f[k][2] -= f_ik[2];
-
-	fxtmp += f_ij[0] + f_ik[0];
-	fytmp += f_ij[1] + f_ik[1];
-	fztmp += f_ij[2] + f_ik[2];
-
-	// potential energy
-	evdwl = 0.0;
-
-	if (evflag) ev_tally3(i,j,k,evdwl,0.0,f_ij,f_ik,dr_ij,dr_ik);
-         
+        double dr_ik[3], r_ik, f_ik[3];
+
+        k = jlist[neighbor_k];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        dr_ik[0] = xtmp -x[k][0];
+        dr_ik[1] = ytmp -x[k][1];
+        dr_ik[2] = ztmp -x[k][2];
+        r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
+
+        if (r_ik > params[ikparam].cutsq) continue;
+
+        r_ik = sqrt(r_ik);
+        invR_ik = 1.0 / r_ik;
+
+        directorCos_ik_x = invR_ik * dr_ik[0];
+        directorCos_ik_y = invR_ik * dr_ik[1];
+        directorCos_ik_z = invR_ik * dr_ik[2];
+
+        cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y + directorCos_ij_z * directorCos_ik_z;
+
+        gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
+
+        gtetaFunctionDerivedIJK = preGtetaFunctionDerived[neighbor_j][neighbor_k];
+
+        cutoffFunctionIK = preCutoffFunction[neighbor_k];
+
+        cutoffFunctionDerivedIK = preCutoffFunctionDerived[neighbor_k];
+
+        factor_force3_ij= cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ij *factor_force_tot;
+
+        f_ij[0] = factor_force3_ij * (directorCos_ij_x*cosTeta - directorCos_ik_x);
+        f_ij[1] = factor_force3_ij * (directorCos_ij_y*cosTeta - directorCos_ik_y);
+        f_ij[2] = factor_force3_ij * (directorCos_ij_z*cosTeta - directorCos_ik_z);
+
+        factor_1_force3_ik = (cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ik)*factor_force_tot;
+        factor_2_force3_ik = -(cutoffFunctionDerivedIK * gtetaFunctionIJK)*factor_force_tot;
+
+        f_ik[0] = factor_1_force3_ik * (directorCos_ik_x*cosTeta - directorCos_ij_x) + factor_2_force3_ik * directorCos_ik_x;
+        f_ik[1] = factor_1_force3_ik * (directorCos_ik_y*cosTeta - directorCos_ij_y) + factor_2_force3_ik * directorCos_ik_y;
+        f_ik[2] = factor_1_force3_ik * (directorCos_ik_z*cosTeta - directorCos_ij_z) + factor_2_force3_ik * directorCos_ik_z;
+
+        f[j][0] -= f_ij[0];
+        f[j][1] -= f_ij[1];
+        f[j][2] -= f_ij[2];
+
+        f[k][0] -= f_ik[0];
+        f[k][1] -= f_ik[1];
+        f[k][2] -= f_ik[2];
+
+        fxtmp += f_ij[0] + f_ik[0];
+        fytmp += f_ij[1] + f_ik[1];
+        fztmp += f_ij[2] + f_ik[2];
+
+        // potential energy
+        evdwl = 0.0;
+
+        if (evflag) ev_tally3(i,j,k,evdwl,0.0,f_ij,f_ik,dr_ij,dr_ik);
+
       }
     } // loop on J
     f[i][0] += fxtmp;
@@ -525,7 +525,7 @@ void PairTersoffTable::compute(int eflag, int vflag)
 
 /* ---------------------------------------------------------------------- */
 
-void PairTersoffTable::deallocatePreLoops(void) 
+void PairTersoffTable::deallocatePreLoops(void)
 {
     memory->destroy (preGtetaFunction);
     memory->destroy (preGtetaFunctionDerived);
@@ -538,14 +538,14 @@ void PairTersoffTable::allocatePreLoops(void)
   memory->create(preGtetaFunction,leadingDimensionInteractionList,leadingDimensionInteractionList,"tersofftable:preGtetaFunction");
 
   memory->create(preGtetaFunctionDerived,leadingDimensionInteractionList,leadingDimensionInteractionList,"tersofftable:preGtetaFunctionDerived");
-  
+
   memory->create(preCutoffFunction,leadingDimensionInteractionList,"tersofftable:preCutoffFunction");
-  
+
   memory->create(preCutoffFunctionDerived,leadingDimensionInteractionList,"tersofftable:preCutoffFunctionDerived");
 }
 
-void PairTersoffTable::deallocateGrids() 
-{ 
+void PairTersoffTable::deallocateGrids()
+{
   int i,j;
 
   memory->destroy(exponential);
@@ -560,7 +560,7 @@ void PairTersoffTable::deallocateGrids()
 void PairTersoffTable::allocateGrids(void)
 {
   int   i, j, l;
-      
+
   int     numGridPointsExponential, numGridPointsGtetaFunction, numGridPointsOneCutoffFunction;
   int     numGridPointsNotOneCutoffFunction, numGridPointsCutoffFunction, numGridPointsBetaZetaPower;
   // double minArgumentExponential;
@@ -569,7 +569,7 @@ void PairTersoffTable::allocateGrids(void)
   double  r, minMu, maxLambda, maxCutoff;
   double const PI=acos(-1.0);
 
-  // exponential 
+  // exponential
 
   // find min and max argument
   minMu=params[0].lam2;
@@ -579,9 +579,9 @@ void PairTersoffTable::allocateGrids(void)
     if (params[i].lam1 > maxLambda) maxLambda = params[i].lam1;
   }
   maxCutoff=cutmax;
-    
+
   minArgumentExponential=minMu*GRIDSTART;
-    
+
   numGridPointsExponential=(int)((maxLambda*maxCutoff-minArgumentExponential)*GRIDDENSITY_EXP)+2;
 
   memory->create(exponential,numGridPointsExponential,"tersofftable:exponential");
@@ -593,7 +593,7 @@ void PairTersoffTable::allocateGrids(void)
       exponential[i] = exp(-r);
       r += deltaArgumentExponential;
     }
-    
+
 
   // gtetaFunction
 
@@ -601,12 +601,12 @@ void PairTersoffTable::allocateGrids(void)
 
   memory->create(gtetaFunction,nelements,numGridPointsGtetaFunction,"tersofftable:gtetaFunction");
   memory->create(gtetaFunctionDerived,nelements,numGridPointsGtetaFunction,"tersofftable:gtetaFunctionDerived");
-    
+
   r = minArgumentExponential;
   for (i=0; i<nelements; i++) {
     r = -1.0;
     deltaArgumentGtetaFunction = 1.0 / GRIDDENSITY_GTETA;
-    
+
     int iparam = elem2param[i][i][i];
     double c = params[iparam].c;
     double d = params[iparam].d;
@@ -619,7 +619,7 @@ void PairTersoffTable::allocateGrids(void)
     }
   }
 
-    
+
   // cutoffFunction, zetaFunction, find grids.
 
   int ngrid_max = -1;
@@ -638,55 +638,55 @@ void PairTersoffTable::allocateGrids(void)
     for (j=0; j<nelements; j++) {
       for (j=0; j<nelements; j++) {
 
-	int ijparam = elem2param[i][j][j];
-	double cutoffR = params[ijparam].cutoffR;
-	double cutoffS = params[ijparam].cutoffS;
+        int ijparam = elem2param[i][j][j];
+        double cutoffR = params[ijparam].cutoffR;
+        double cutoffS = params[ijparam].cutoffS;
 
-	numGridPointsOneCutoffFunction=(int) ((cutoffR-GRIDSTART)*GRIDDENSITY_FCUTOFF)+1;
-	numGridPointsNotOneCutoffFunction=(int) ((cutoffS-cutoffR)*GRIDDENSITY_FCUTOFF)+2;
-	numGridPointsCutoffFunction=numGridPointsOneCutoffFunction+numGridPointsNotOneCutoffFunction;
+        numGridPointsOneCutoffFunction=(int) ((cutoffR-GRIDSTART)*GRIDDENSITY_FCUTOFF)+1;
+        numGridPointsNotOneCutoffFunction=(int) ((cutoffS-cutoffR)*GRIDDENSITY_FCUTOFF)+2;
+        numGridPointsCutoffFunction=numGridPointsOneCutoffFunction+numGridPointsNotOneCutoffFunction;
 
-	ngrid_max = MAX(ngrid_max,numGridPointsCutoffFunction);
+        ngrid_max = MAX(ngrid_max,numGridPointsCutoffFunction);
       }
     }
   }
-    
+
   memory->create(cutoffFunction,nelements,nelements,ngrid_max,"tersoff:cutfunc");
   memory->create(cutoffFunctionDerived,nelements,nelements,ngrid_max,"tersoff:cutfuncD");
-    
+
   // cutoffFunction, compute.
 
   for (i=0; i<nelements; i++) {
     for (j=0; j<nelements; j++) {
       for (j=0; j<nelements; j++) {
-	int ijparam = elem2param[i][j][j];
-	double cutoffR = params[ijparam].cutoffR;
-	double cutoffS = params[ijparam].cutoffS;
-
-	numGridPointsOneCutoffFunction=(int) ((cutoffR-GRIDSTART)*GRIDDENSITY_FCUTOFF)+1;
-	numGridPointsNotOneCutoffFunction=(int) ((cutoffS-cutoffR)*GRIDDENSITY_FCUTOFF)+2;
-	numGridPointsCutoffFunction=numGridPointsOneCutoffFunction+numGridPointsNotOneCutoffFunction;
-
-	r = GRIDSTART;
-	deltaArgumentCutoffFunction = 1.0 / GRIDDENSITY_FCUTOFF;
-		
-	for (l = 0; l < numGridPointsOneCutoffFunction; l++) {
-	  cutoffFunction[i][j][l] = 1.0;
-	  cutoffFunctionDerived[i][j][l]=0.0;
-	  r += deltaArgumentCutoffFunction;
-	}
-
-	for (l = numGridPointsOneCutoffFunction; l < numGridPointsCutoffFunction; l++) {
-	  cutoffFunction[i][j][l] = 0.5 + 0.5 * cos (PI * (r - cutoffR)/(cutoffS-cutoffR)) ;
-	  cutoffFunctionDerived[i][j][l] =  -0.5 * PI * sin (PI * (r - cutoffR)/(cutoffS-cutoffR)) / (cutoffS-cutoffR) ;
-	  r += deltaArgumentCutoffFunction;
-	}
+        int ijparam = elem2param[i][j][j];
+        double cutoffR = params[ijparam].cutoffR;
+        double cutoffS = params[ijparam].cutoffS;
+
+        numGridPointsOneCutoffFunction=(int) ((cutoffR-GRIDSTART)*GRIDDENSITY_FCUTOFF)+1;
+        numGridPointsNotOneCutoffFunction=(int) ((cutoffS-cutoffR)*GRIDDENSITY_FCUTOFF)+2;
+        numGridPointsCutoffFunction=numGridPointsOneCutoffFunction+numGridPointsNotOneCutoffFunction;
+
+        r = GRIDSTART;
+        deltaArgumentCutoffFunction = 1.0 / GRIDDENSITY_FCUTOFF;
+
+        for (l = 0; l < numGridPointsOneCutoffFunction; l++) {
+          cutoffFunction[i][j][l] = 1.0;
+          cutoffFunctionDerived[i][j][l]=0.0;
+          r += deltaArgumentCutoffFunction;
+        }
+
+        for (l = numGridPointsOneCutoffFunction; l < numGridPointsCutoffFunction; l++) {
+          cutoffFunction[i][j][l] = 0.5 + 0.5 * cos (PI * (r - cutoffR)/(cutoffS-cutoffR)) ;
+          cutoffFunctionDerived[i][j][l] =  -0.5 * PI * sin (PI * (r - cutoffR)/(cutoffS-cutoffR)) / (cutoffS-cutoffR) ;
+          r += deltaArgumentCutoffFunction;
+        }
       }
     }
   }
 
   // betaZetaPower, compute
-    
+
   memory->create(betaZetaPower,nelements,zeta_max,"tersoff:zetafunc");
   memory->create(betaZetaPowerDerived,nelements,zeta_max,"tersoff:zetafuncD");
 
@@ -701,11 +701,11 @@ void PairTersoffTable::allocateGrids(void)
 
     r=0.0;
     deltaArgumentBetaZetaPower = 1.0 / GRIDDENSITY_BIJ;
-  
+
     betaZetaPower[i][0]=1.0;
 
     r += deltaArgumentBetaZetaPower;
-            
+
     for (j = 1; j < numGridPointsBetaZetaPower; j++) {
       double powern=params[iparam].powern;
       betaZetaPower[i][j]=pow((1+pow(r,powern)),-1/(2*powern));
@@ -728,7 +728,7 @@ void PairTersoffTable::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairTersoffTable::settings(int narg, char **arg)
@@ -784,7 +784,7 @@ void PairTersoffTable::coeff(int narg, char **arg)
   }
 
   // read potential file and initialize potential parameters
-  
+
   read_file(arg[2]);
   setup();
 
@@ -801,8 +801,8 @@ void PairTersoffTable::coeff(int narg, char **arg)
   for (int i = 1; i <= n; i++)
     for (int j = i; j <= n; j++)
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	count++;
+        setflag[i][j] = 1;
+        count++;
       }
 
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
@@ -876,8 +876,8 @@ void PairTersoffTable::read_file(char *file)
     if (comm->me == 0) {
       ptr = fgets(line,MAXLINE,fp);
       if (ptr == NULL) {
-	eof = 1;
-	fclose(fp);
+        eof = 1;
+        fclose(fp);
       } else n = strlen(line) + 1;
     }
     MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -898,8 +898,8 @@ void PairTersoffTable::read_file(char *file)
       if (comm->me == 0) {
         ptr = fgets(&line[n],MAXLINE-n,fp);
         if (ptr == NULL) {
-	  eof = 1;
-	  fclose(fp);
+          eof = 1;
+          fclose(fp);
         } else n = strlen(line) + 1;
       }
       MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -938,7 +938,7 @@ void PairTersoffTable::read_file(char *file)
     if (nparams == maxparam) {
       maxparam += DELTA;
       params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
-					  "pair:params");
+                                          "pair:params");
     }
 
     params[nparams].ielement = ielement;
@@ -966,16 +966,16 @@ void PairTersoffTable::read_file(char *file)
     // currently only allow m exponent of 1 or 3
     params[nparams].powermint = int(params[nparams].powerm);
 
-    if (params[nparams].c < 0.0 || params[nparams].d < 0.0 || 
-	params[nparams].powern < 0.0 || params[nparams].beta < 0.0 || 
-	params[nparams].lam2 < 0.0 || params[nparams].bigb < 0.0 || 
-	params[nparams].cutoffR < 0.0 ||params[nparams].cutoffS < 0.0 ||
-	params[nparams].cutoffR > params[nparams].cutoffS ||
-	params[nparams].lam1 < 0.0 || params[nparams].biga < 0.0
+    if (params[nparams].c < 0.0 || params[nparams].d < 0.0 ||
+        params[nparams].powern < 0.0 || params[nparams].beta < 0.0 ||
+        params[nparams].lam2 < 0.0 || params[nparams].bigb < 0.0 ||
+        params[nparams].cutoffR < 0.0 ||params[nparams].cutoffS < 0.0 ||
+        params[nparams].cutoffR > params[nparams].cutoffS ||
+        params[nparams].lam1 < 0.0 || params[nparams].biga < 0.0
     ) error->all(FLERR,"Illegal Tersoff parameter");
 
     // only tersoff_2 parametrization is implemented
-    if (params[nparams].gamma != 1.0 || params[nparams].lam3 != 0.0) 
+    if (params[nparams].gamma != 1.0 || params[nparams].lam3 != 0.0)
       error->all(FLERR,"Current tersoff/table pair_style implements only tersoff_2 parametrization");
     nparams++;
   }
@@ -999,16 +999,16 @@ void PairTersoffTable::setup()
   for (i = 0; i < nelements; i++)
     for (j = 0; j < nelements; j++)
       for (k = 0; k < nelements; k++) {
-	n = -1;
-	for (m = 0; m < nparams; m++) {
-	  if (i == params[m].ielement && j == params[m].jelement && 
-	      k == params[m].kelement) {
-	    if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
-	    n = m;
-	  }
-	}
-	if (n < 0) error->all(FLERR,"Potential file is missing an entry");
-	elem2param[i][j][k] = n;
+        n = -1;
+        for (m = 0; m < nparams; m++) {
+          if (i == params[m].ielement && j == params[m].jelement &&
+              k == params[m].kelement) {
+            if (n >= 0) error->all(FLERR,"Potential file has duplicate entry");
+            n = m;
+          }
+        }
+        if (n < 0) error->all(FLERR,"Potential file is missing an entry");
+        elem2param[i][j][k] = n;
       }
 
   // set cutoff square
@@ -1022,4 +1022,4 @@ void PairTersoffTable::setup()
   for (m = 0; m < nparams; m++) {
     if (params[m].cut > cutmax) cutmax = params[m].cut;
   }
-}  
+}
diff --git a/src/USER-MISC/pair_tersoff_table.h b/src/USER-MISC/pair_tersoff_table.h
index fb7550c3b5..82e9087a48 100644
--- a/src/USER-MISC/pair_tersoff_table.h
+++ b/src/USER-MISC/pair_tersoff_table.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,8 +54,8 @@ class PairTersoffTable : public Pair {
     int ielement,jelement,kelement;
     int powermint;
   };
-  
-  
+
+
   double cutmax;                // max cutoff for all elements
   int nelements;                // # of unique elements
   char **elements;              // names of unique elements
diff --git a/src/USER-OMP/angle_charmm_omp.cpp b/src/USER-OMP/angle_charmm_omp.cpp
index 36a5127ccf..1efe62d4d3 100644
--- a/src/USER-OMP/angle_charmm_omp.cpp
+++ b/src/USER-OMP/angle_charmm_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,11 +65,11 @@ void AngleCharmmOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -145,10 +145,10 @@ void AngleCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
@@ -194,6 +194,6 @@ void AngleCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,i3,nlocal,NEWTON_BOND,eangle,f1,f3,
-			     delx1,dely1,delz1,delx2,dely2,delz2,thr);
+                             delx1,dely1,delz1,delx2,dely2,delz2,thr);
   }
 }
diff --git a/src/USER-OMP/angle_charmm_omp.h b/src/USER-OMP/angle_charmm_omp.h
index f9f13cad33..8cbb992c3b 100644
--- a/src/USER-OMP/angle_charmm_omp.h
+++ b/src/USER-OMP/angle_charmm_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/angle_class2_omp.cpp b/src/USER-OMP/angle_class2_omp.cpp
index 37b28343e1..0dbd0cbfda 100644
--- a/src/USER-OMP/angle_class2_omp.cpp
+++ b/src/USER-OMP/angle_class2_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,11 +65,11 @@ void AngleClass2OMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -126,10 +126,10 @@ void AngleClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
@@ -141,7 +141,7 @@ void AngleClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     dtheta3 = dtheta2*dtheta;
     dtheta4 = dtheta3*dtheta;
 
-    de_angle = 2.0*k2[type]*dtheta + 3.0*k3[type]*dtheta2 + 
+    de_angle = 2.0*k2[type]*dtheta + 3.0*k3[type]*dtheta2 +
       4.0*k4[type]*dtheta3;
 
     a = -de_angle*s;
@@ -237,6 +237,6 @@ void AngleClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,i3,nlocal,NEWTON_BOND,eangle,f1,f3,
-			     delx1,dely1,delz1,delx2,dely2,delz2,thr);
+                             delx1,dely1,delz1,delx2,dely2,delz2,thr);
   }
 }
diff --git a/src/USER-OMP/angle_class2_omp.h b/src/USER-OMP/angle_class2_omp.h
index 5317f7c447..fcfdae51a7 100644
--- a/src/USER-OMP/angle_class2_omp.h
+++ b/src/USER-OMP/angle_class2_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/angle_cosine_delta_omp.cpp b/src/USER-OMP/angle_cosine_delta_omp.cpp
index 8c14513ca8..5ba57d20b5 100644
--- a/src/USER-OMP/angle_cosine_delta_omp.cpp
+++ b/src/USER-OMP/angle_cosine_delta_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,11 +65,11 @@ void AngleCosineDeltaOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -123,21 +123,21 @@ void AngleCosineDeltaOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     theta = acos(c);
- 
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
-   
+
     cot = c/s;
- 
+
     // force & energy
-	
-    dtheta = theta - theta0[type]; 
+
+    dtheta = theta - theta0[type];
     dcostheta = cos(dtheta);
     tk = k[type] * (1.0-dcostheta);
 
@@ -146,15 +146,15 @@ void AngleCosineDeltaOMP::eval(int nfrom, int nto, ThrData * const thr)
     a = -k[type];
 
     // expand dtheta for cos and sin contribution to force
-    
+
     a11 = a*c / rsq1;
     a12 = -a / (r1*r2);
     a22 = a*c / rsq2;
-    
+
     b11 = -a*c*cot / rsq1;
     b12 = a*cot / (r1*r2);
     b22 = -a*c*cot / rsq2;
-        
+
     c0 = cos(theta0[type]);
     s0 = sin(theta0[type]);
 
@@ -186,6 +186,6 @@ void AngleCosineDeltaOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,i3,nlocal,NEWTON_BOND,eangle,f1,f3,
-			     delx1,dely1,delz1,delx2,dely2,delz2,thr);
+                             delx1,dely1,delz1,delx2,dely2,delz2,thr);
   }
 }
diff --git a/src/USER-OMP/angle_cosine_delta_omp.h b/src/USER-OMP/angle_cosine_delta_omp.h
index aecc30f794..57b1d9364d 100644
--- a/src/USER-OMP/angle_cosine_delta_omp.h
+++ b/src/USER-OMP/angle_cosine_delta_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/angle_cosine_omp.cpp b/src/USER-OMP/angle_cosine_omp.cpp
index 4bc93e95ac..a773f94c50 100644
--- a/src/USER-OMP/angle_cosine_omp.cpp
+++ b/src/USER-OMP/angle_cosine_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,11 +65,11 @@ void AngleCosineOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -163,6 +163,6 @@ void AngleCosineOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,i3,nlocal,NEWTON_BOND,eangle,f1,f3,
-			     delx1,dely1,delz1,delx2,dely2,delz2,thr);
+                             delx1,dely1,delz1,delx2,dely2,delz2,thr);
   }
 }
diff --git a/src/USER-OMP/angle_cosine_omp.h b/src/USER-OMP/angle_cosine_omp.h
index 6d2995ba0f..16eb3ff944 100644
--- a/src/USER-OMP/angle_cosine_omp.h
+++ b/src/USER-OMP/angle_cosine_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/angle_cosine_periodic_omp.cpp b/src/USER-OMP/angle_cosine_periodic_omp.cpp
index 0f121efd73..a86b68611f 100644
--- a/src/USER-OMP/angle_cosine_periodic_omp.cpp
+++ b/src/USER-OMP/angle_cosine_periodic_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,11 +65,11 @@ void AngleCosinePeriodicOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -141,7 +141,7 @@ void AngleCosinePeriodicOMP::eval(int nfrom, int nto, ThrData * const thr)
     tn = 1.0;
     tn_1 = 1.0;
     tn_2 = 0.0;
-    un = 1.0; 
+    un = 1.0;
     un_1 = 2.0;
     un_2 = 0.0;
 
@@ -172,7 +172,7 @@ void AngleCosinePeriodicOMP::eval(int nfrom, int nto, ThrData * const thr)
     a11 = a*c / rsq1;
     a12 = -a / (r1*r2);
     a22 = a*c / rsq2;
-        
+
     f1[0] = a11*delx1 + a12*delx2;
     f1[1] = a11*dely1 + a12*dely2;
     f1[2] = a11*delz1 + a12*delz2;
@@ -201,6 +201,6 @@ void AngleCosinePeriodicOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,i3,nlocal,NEWTON_BOND,eangle,f1,f3,
-			     delx1,dely1,delz1,delx2,dely2,delz2,thr);
+                             delx1,dely1,delz1,delx2,dely2,delz2,thr);
   }
 }
diff --git a/src/USER-OMP/angle_cosine_periodic_omp.h b/src/USER-OMP/angle_cosine_periodic_omp.h
index 9d05b3e071..3c7da10ceb 100644
--- a/src/USER-OMP/angle_cosine_periodic_omp.h
+++ b/src/USER-OMP/angle_cosine_periodic_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/angle_cosine_shift_exp_omp.cpp b/src/USER-OMP/angle_cosine_shift_exp_omp.cpp
index 26ad2976cf..81cd8ecad3 100644
--- a/src/USER-OMP/angle_cosine_shift_exp_omp.cpp
+++ b/src/USER-OMP/angle_cosine_shift_exp_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,11 +65,11 @@ void AngleCosineShiftExpOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -87,7 +87,7 @@ void AngleCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
   double delx1,dely1,delz1,delx2,dely2,delz2;
   double eangle,f1[3],f3[3],ff;
   double rsq1,rsq2,r1,r2,c,s,a11,a12,a22;
-  double exp2,aa,uumin,cccpsss,cssmscc;            
+  double exp2,aa,uumin,cccpsss,cssmscc;
 
   const double * const * const x = atom->x;
   double * const * const f = thr->get_f();
@@ -129,9 +129,9 @@ void AngleCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
     // C= sine of angle
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
-    
+
     // force & energy
-        
+
     aa=a[type];
     uumin=umin[type];
 
@@ -142,19 +142,19 @@ void AngleCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
        {  //  |a|<0.01 so use expansions relative precision <1e-5
 //         std::cout << "Using expansion\n";
             if (EFLAG) eangle = -0.125*(1+cccpsss)*(4+aa*(cccpsss-1))*uumin;
-            ff=0.25*uumin*cssmscc*(2+aa*cccpsss)/s;   
+            ff=0.25*uumin*cssmscc*(2+aa*cccpsss)/s;
        }
      else
        {
-//   std::cout << "Not using expansion\n";            
+//   std::cout << "Not using expansion\n";
             exp2=exp(0.5*aa*(1+cccpsss));
             if (EFLAG) eangle = opt1[type]*(1-exp2);
-            ff=0.5*a[type]*opt1[type]*exp2*cssmscc/s;       
+            ff=0.5*a[type]*opt1[type]*exp2*cssmscc/s;
        }
 
     a11 =   ff*c/ rsq1;
     a12 =  -ff  / (r1*r2);
-    a22 =   ff*c/ rsq2;      
+    a22 =   ff*c/ rsq2;
 
     f1[0] = a11*delx1 + a12*delx2;
     f1[1] = a11*dely1 + a12*dely2;
@@ -184,6 +184,6 @@ void AngleCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,i3,nlocal,NEWTON_BOND,eangle,f1,f3,
-			     delx1,dely1,delz1,delx2,dely2,delz2,thr);
+                             delx1,dely1,delz1,delx2,dely2,delz2,thr);
   }
 }
diff --git a/src/USER-OMP/angle_cosine_shift_exp_omp.h b/src/USER-OMP/angle_cosine_shift_exp_omp.h
index b70045b890..aba70f8a3c 100644
--- a/src/USER-OMP/angle_cosine_shift_exp_omp.h
+++ b/src/USER-OMP/angle_cosine_shift_exp_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/angle_cosine_shift_omp.cpp b/src/USER-OMP/angle_cosine_shift_omp.cpp
index 6024f99766..2c830cf393 100644
--- a/src/USER-OMP/angle_cosine_shift_omp.cpp
+++ b/src/USER-OMP/angle_cosine_shift_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,11 +65,11 @@ void AngleCosineShiftOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -129,11 +129,11 @@ void AngleCosineShiftOMP::eval(int nfrom, int nto, ThrData * const thr)
     // C= sine of angle
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
-    
+
     // force & energy
     const double kcos=kcost[type];
     const double ksin=ksint[type];
-    if (EFLAG) eangle = -k[type]-kcos*c-ksin*s;  
+    if (EFLAG) eangle = -k[type]-kcos*c-ksin*s;
 
     cps = c/s;          // NOTE absorbed one c
 
@@ -169,6 +169,6 @@ void AngleCosineShiftOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,i3,nlocal,NEWTON_BOND,eangle,f1,f3,
-			     delx1,dely1,delz1,delx2,dely2,delz2,thr);
+                             delx1,dely1,delz1,delx2,dely2,delz2,thr);
   }
 }
diff --git a/src/USER-OMP/angle_cosine_shift_omp.h b/src/USER-OMP/angle_cosine_shift_omp.h
index 4afe4a233e..09402fb341 100644
--- a/src/USER-OMP/angle_cosine_shift_omp.h
+++ b/src/USER-OMP/angle_cosine_shift_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/angle_cosine_squared_omp.cpp b/src/USER-OMP/angle_cosine_squared_omp.cpp
index d518167508..ccdaf2bdbc 100644
--- a/src/USER-OMP/angle_cosine_squared_omp.cpp
+++ b/src/USER-OMP/angle_cosine_squared_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,11 +65,11 @@ void AngleCosineSquaredOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -124,12 +124,12 @@ void AngleCosineSquaredOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     // force & energy
-	
+
     dcostheta = c - cos(theta0[type]);
     tk = k[type] * dcostheta;
 
@@ -168,6 +168,6 @@ void AngleCosineSquaredOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,i3,nlocal,NEWTON_BOND,eangle,f1,f3,
-			     delx1,dely1,delz1,delx2,dely2,delz2,thr);
+                             delx1,dely1,delz1,delx2,dely2,delz2,thr);
   }
 }
diff --git a/src/USER-OMP/angle_cosine_squared_omp.h b/src/USER-OMP/angle_cosine_squared_omp.h
index aeadd2e95d..758863e612 100644
--- a/src/USER-OMP/angle_cosine_squared_omp.h
+++ b/src/USER-OMP/angle_cosine_squared_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/angle_dipole_omp.cpp b/src/USER-OMP/angle_dipole_omp.cpp
index 6499c48469..f9cbc6f51d 100644
--- a/src/USER-OMP/angle_dipole_omp.cpp
+++ b/src/USER-OMP/angle_dipole_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,7 +50,7 @@ void AngleDipoleOMP::compute(int eflag, int vflag)
     ev_setup(eflag,vflag);
   } else evflag = 0;
 
-  if (!force->newton_bond) 
+  if (!force->newton_bond)
     error->all(FLERR,"'newton' flag for bonded interactions must be 'on'");
 
   const int nall = atom->nlocal + atom->nghost;
@@ -111,16 +111,16 @@ void AngleDipoleOMP::eval(int nfrom, int nto, ThrData * const thr)
     deltaGamma = cosGamma - cos(gamma0[type]);
     kdg = k[type] * deltaGamma;
 
-    if (EFLAG) eangle = kdg * deltaGamma; // energy  
-      
-    tangle = 2.0 * kdg / rmu; 
-      
+    if (EFLAG) eangle = kdg * deltaGamma; // energy
+
+    tangle = 2.0 * kdg / rmu;
+
     torque[iDip][0] += tangle * (dely*mu[iDip][2] - delz*mu[iDip][1]);
     torque[iDip][1] += tangle * (delz*mu[iDip][0] - delx*mu[iDip][2]);
     torque[iDip][2] += tangle * (delx*mu[iDip][1] - dely*mu[iDip][0]);
 
     if (EFLAG) // tally energy (virial=0 because force=0)
       ev_tally_thr(this,iRef,iDip,iDummy,nlocal,/* NEWTON_BOND */ 1,
-		   eangle,f1,f3,0.0,0.0,0.0,0.0,0.0,0.0,thr);
+                   eangle,f1,f3,0.0,0.0,0.0,0.0,0.0,0.0,thr);
   }
 }
diff --git a/src/USER-OMP/angle_dipole_omp.h b/src/USER-OMP/angle_dipole_omp.h
index 23e69ad5ee..ab7133da34 100644
--- a/src/USER-OMP/angle_dipole_omp.h
+++ b/src/USER-OMP/angle_dipole_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/angle_harmonic_omp.cpp b/src/USER-OMP/angle_harmonic_omp.cpp
index 1ebfa3fdde..b6ff1a1ddd 100644
--- a/src/USER-OMP/angle_harmonic_omp.cpp
+++ b/src/USER-OMP/angle_harmonic_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,11 +65,11 @@ void AngleHarmonicOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -124,10 +124,10 @@ void AngleHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
@@ -172,6 +172,6 @@ void AngleHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,i3,nlocal,NEWTON_BOND,eangle,f1,f3,
-			     delx1,dely1,delz1,delx2,dely2,delz2,thr);
+                             delx1,dely1,delz1,delx2,dely2,delz2,thr);
   }
 }
diff --git a/src/USER-OMP/angle_harmonic_omp.h b/src/USER-OMP/angle_harmonic_omp.h
index f8169de117..80c8f491aa 100644
--- a/src/USER-OMP/angle_harmonic_omp.h
+++ b/src/USER-OMP/angle_harmonic_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/angle_sdk_omp.cpp b/src/USER-OMP/angle_sdk_omp.cpp
index e5d9552982..43e0049e16 100644
--- a/src/USER-OMP/angle_sdk_omp.cpp
+++ b/src/USER-OMP/angle_sdk_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -67,11 +67,11 @@ void AngleSDKOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -126,15 +126,15 @@ void AngleSDKOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
 
-    // 1-3 LJ interaction. 
+    // 1-3 LJ interaction.
     // we only want to use the repulsive part,
     // and it can be scaled (or off).
     // so this has to be done here and not in the
@@ -143,7 +143,7 @@ void AngleSDKOMP::eval(int nfrom, int nto, ThrData * const thr)
     f13 = e13 = delx3 = dely3 = delz3 = 0.0;
 
     if (repflag) {
-      
+
       delx3 = x[i1][0] - x[i3][0];
       dely3 = x[i1][1] - x[i3][1];
       delz3 = x[i1][2] - x[i3][2];
@@ -152,35 +152,35 @@ void AngleSDKOMP::eval(int nfrom, int nto, ThrData * const thr)
 
       const int type1 = atom->type[i1];
       const int type3 = atom->type[i3];
-      
+
       if (rsq3 < rminsq[type1][type3]) {
-	const int ljt = lj_type[type1][type3];
-	const double r2inv = 1.0/rsq3;
+        const int ljt = lj_type[type1][type3];
+        const double r2inv = 1.0/rsq3;
+
+        if (ljt == LJ12_4) {
+          const double r4inv=r2inv*r2inv;
 
-	if (ljt == LJ12_4) {
-	  const double r4inv=r2inv*r2inv;
+          f13 = r4inv*(lj1[type1][type3]*r4inv*r4inv - lj2[type1][type3]);
+          if (EFLAG) e13 = r4inv*(lj3[type1][type3]*r4inv*r4inv - lj4[type1][type3]);
 
-	  f13 = r4inv*(lj1[type1][type3]*r4inv*r4inv - lj2[type1][type3]);
-	  if (EFLAG) e13 = r4inv*(lj3[type1][type3]*r4inv*r4inv - lj4[type1][type3]);
-	  
-	} else if (ljt == LJ9_6) {
-	  const double r3inv = r2inv*sqrt(r2inv);
-	  const double r6inv = r3inv*r3inv;
+        } else if (ljt == LJ9_6) {
+          const double r3inv = r2inv*sqrt(r2inv);
+          const double r6inv = r3inv*r3inv;
 
-	  f13 = r6inv*(lj1[type1][type3]*r3inv - lj2[type1][type3]);
-	  if (EFLAG) e13 = r6inv*(lj3[type1][type3]*r3inv - lj4[type1][type3]);
+          f13 = r6inv*(lj1[type1][type3]*r3inv - lj2[type1][type3]);
+          if (EFLAG) e13 = r6inv*(lj3[type1][type3]*r3inv - lj4[type1][type3]);
 
-	} else if (ljt == LJ12_6) {
-	  const double r6inv = r2inv*r2inv*r2inv;
+        } else if (ljt == LJ12_6) {
+          const double r6inv = r2inv*r2inv*r2inv;
 
-	  f13 = r6inv*(lj1[type1][type3]*r6inv - lj2[type1][type3]);
-	  if (EFLAG) e13 = r6inv*(lj3[type1][type3]*r6inv - lj4[type1][type3]);
-	}
+          f13 = r6inv*(lj1[type1][type3]*r6inv - lj2[type1][type3]);
+          if (EFLAG) e13 = r6inv*(lj3[type1][type3]*r6inv - lj4[type1][type3]);
+        }
 
-	// make sure energy is 0.0 at the cutoff.
-	if (EFLAG) e13 -= emin[type1][type3];
+        // make sure energy is 0.0 at the cutoff.
+        if (EFLAG) e13 -= emin[type1][type3];
 
-	f13 *= r2inv;
+        f13 *= r2inv;
       }
     }
 
@@ -225,9 +225,9 @@ void AngleSDKOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG) {
       ev_tally_thr(this,i1,i2,i3,nlocal,NEWTON_BOND,eangle,f1,f3,
-		   delx1,dely1,delz1,delx2,dely2,delz2,thr);
+                   delx1,dely1,delz1,delx2,dely2,delz2,thr);
       if (repflag) ev_tally13_thr(this,i1,i3,nlocal,NEWTON_BOND,
-				  e13,f13,delx3,dely3,delz3,thr);
+                                  e13,f13,delx3,dely3,delz3,thr);
     }
   }
 }
diff --git a/src/USER-OMP/angle_sdk_omp.h b/src/USER-OMP/angle_sdk_omp.h
index 350490811f..9ab75904ce 100644
--- a/src/USER-OMP/angle_sdk_omp.h
+++ b/src/USER-OMP/angle_sdk_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/angle_table_omp.cpp b/src/USER-OMP/angle_table_omp.cpp
index edb162d983..8eb73b4c2b 100644
--- a/src/USER-OMP/angle_table_omp.cpp
+++ b/src/USER-OMP/angle_table_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,11 +65,11 @@ void AngleTableOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -124,10 +124,10 @@ void AngleTableOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     c = delx1*delx2 + dely1*dely2 + delz1*delz2;
     c /= r1*r2;
-        
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-        
+
     s = sqrt(1.0 - c*c);
     if (s < SMALL) s = SMALL;
     s = 1.0/s;
@@ -136,10 +136,10 @@ void AngleTableOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     theta = acos(c);
     uf_lookup(type,theta,u,mdu);
-    
+
     if (EFLAG) eangle = u;
 
-    a = mdu * s;               
+    a = mdu * s;
     a11 = a*c / rsq1;
     a12 = -a / (r1*r2);
     a22 = a*c / rsq2;
@@ -172,6 +172,6 @@ void AngleTableOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,i3,nlocal,NEWTON_BOND,eangle,f1,f3,
-			     delx1,dely1,delz1,delx2,dely2,delz2,thr);
+                             delx1,dely1,delz1,delx2,dely2,delz2,thr);
   }
 }
diff --git a/src/USER-OMP/angle_table_omp.h b/src/USER-OMP/angle_table_omp.h
index 31d7db60b6..97c9bb65a7 100644
--- a/src/USER-OMP/angle_table_omp.h
+++ b/src/USER-OMP/angle_table_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/bond_class2_omp.cpp b/src/USER-OMP/bond_class2_omp.cpp
index 1d0efe3862..a31ac2e3aa 100644
--- a/src/USER-OMP/bond_class2_omp.cpp
+++ b/src/USER-OMP/bond_class2_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -61,11 +61,11 @@ void BondClass2OMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -128,6 +128,6 @@ void BondClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,nlocal,NEWTON_BOND,
-			     ebond,fbond,delx,dely,delz,thr);
+                             ebond,fbond,delx,dely,delz,thr);
   }
 }
diff --git a/src/USER-OMP/bond_class2_omp.h b/src/USER-OMP/bond_class2_omp.h
index ab41ae401e..845e28f592 100644
--- a/src/USER-OMP/bond_class2_omp.h
+++ b/src/USER-OMP/bond_class2_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/bond_fene_expand_omp.cpp b/src/USER-OMP/bond_fene_expand_omp.cpp
index 42de952298..39c43d978e 100644
--- a/src/USER-OMP/bond_fene_expand_omp.cpp
+++ b/src/USER-OMP/bond_fene_expand_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -62,11 +62,11 @@ void BondFENEExpandOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -116,11 +116,11 @@ void BondFENEExpandOMP::eval(int nfrom, int nto, ThrData * const thr)
       char str[128];
 
       sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
-	      update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
+              update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
       error->warning(FLERR,str,0);
 
       if (check_error_thr((rlogarg <= -3.0),tid,FLERR,"Bad FENE bond"))
-	return;
+        return;
 
       rlogarg = 0.1;
     }
@@ -140,7 +140,7 @@ void BondFENEExpandOMP::eval(int nfrom, int nto, ThrData * const thr)
     if (EFLAG) {
       ebond = -0.5 * k[type]*r0sq*log(rlogarg);
       if (rshiftsq < TWO_1_3*sigma[type]*sigma[type])
-	ebond += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
+        ebond += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
     }
 
     // apply force to each of 2 atoms
@@ -158,6 +158,6 @@ void BondFENEExpandOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,nlocal,NEWTON_BOND,
-			     ebond,fbond,delx,dely,delz,thr);
+                             ebond,fbond,delx,dely,delz,thr);
   }
 }
diff --git a/src/USER-OMP/bond_fene_expand_omp.h b/src/USER-OMP/bond_fene_expand_omp.h
index a383fe58a7..317b81e5de 100644
--- a/src/USER-OMP/bond_fene_expand_omp.h
+++ b/src/USER-OMP/bond_fene_expand_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/bond_fene_omp.cpp b/src/USER-OMP/bond_fene_omp.cpp
index f9556392fb..72596d1864 100644
--- a/src/USER-OMP/bond_fene_omp.cpp
+++ b/src/USER-OMP/bond_fene_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -62,11 +62,11 @@ void BondFENEOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -112,11 +112,11 @@ void BondFENEOMP::eval(int nfrom, int nto, ThrData * const thr)
       char str[128];
 
       sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
-	      update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
+              update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
       error->warning(FLERR,str,0);
 
       if (check_error_thr((rlogarg <= -3.0),tid,FLERR,"Bad FENE bond"))
-	return;
+        return;
 
       rlogarg = 0.1;
     }
@@ -136,7 +136,7 @@ void BondFENEOMP::eval(int nfrom, int nto, ThrData * const thr)
     if (EFLAG) {
       ebond = -0.5 * k[type]*r0sq*log(rlogarg);
       if (rsq < TWO_1_3*sigma[type]*sigma[type])
-	ebond += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
+        ebond += 4.0*epsilon[type]*sr6*(sr6-1.0) + epsilon[type];
     }
 
     // apply force to each of 2 atoms
@@ -154,6 +154,6 @@ void BondFENEOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,nlocal,NEWTON_BOND,
-			     ebond,fbond,delx,dely,delz,thr);
+                             ebond,fbond,delx,dely,delz,thr);
   }
 }
diff --git a/src/USER-OMP/bond_fene_omp.h b/src/USER-OMP/bond_fene_omp.h
index c3b0348e93..13e843fe13 100644
--- a/src/USER-OMP/bond_fene_omp.h
+++ b/src/USER-OMP/bond_fene_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/bond_harmonic_omp.cpp b/src/USER-OMP/bond_harmonic_omp.cpp
index 19b03194be..9c8c6d2c71 100644
--- a/src/USER-OMP/bond_harmonic_omp.cpp
+++ b/src/USER-OMP/bond_harmonic_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,11 +60,11 @@ void BondHarmonicOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -124,6 +124,6 @@ void BondHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,nlocal,NEWTON_BOND,
-			     ebond,fbond,delx,dely,delz,thr);
+                             ebond,fbond,delx,dely,delz,thr);
   }
 }
diff --git a/src/USER-OMP/bond_harmonic_omp.h b/src/USER-OMP/bond_harmonic_omp.h
index c542033d5e..0a81b52f41 100644
--- a/src/USER-OMP/bond_harmonic_omp.h
+++ b/src/USER-OMP/bond_harmonic_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp b/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp
index e5f1b49f23..de2c72e890 100644
--- a/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp
+++ b/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,11 +60,11 @@ void BondHarmonicShiftCutOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -127,6 +127,6 @@ void BondHarmonicShiftCutOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,nlocal,NEWTON_BOND,
-			     ebond,fbond,delx,dely,delz,thr);
+                             ebond,fbond,delx,dely,delz,thr);
   }
 }
diff --git a/src/USER-OMP/bond_harmonic_shift_cut_omp.h b/src/USER-OMP/bond_harmonic_shift_cut_omp.h
index fd4f6185f0..f465ff5b3a 100644
--- a/src/USER-OMP/bond_harmonic_shift_cut_omp.h
+++ b/src/USER-OMP/bond_harmonic_shift_cut_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/bond_harmonic_shift_omp.cpp b/src/USER-OMP/bond_harmonic_shift_omp.cpp
index 87d62afd15..2d566f771b 100644
--- a/src/USER-OMP/bond_harmonic_shift_omp.cpp
+++ b/src/USER-OMP/bond_harmonic_shift_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,11 +60,11 @@ void BondHarmonicShiftOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -124,6 +124,6 @@ void BondHarmonicShiftOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,nlocal,NEWTON_BOND,
-			     ebond,fbond,delx,dely,delz,thr);
+                             ebond,fbond,delx,dely,delz,thr);
   }
 }
diff --git a/src/USER-OMP/bond_harmonic_shift_omp.h b/src/USER-OMP/bond_harmonic_shift_omp.h
index 6c5aa1324e..58ee6ce23d 100644
--- a/src/USER-OMP/bond_harmonic_shift_omp.h
+++ b/src/USER-OMP/bond_harmonic_shift_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/bond_morse_omp.cpp b/src/USER-OMP/bond_morse_omp.cpp
index 39979edf39..0a91857c8e 100644
--- a/src/USER-OMP/bond_morse_omp.cpp
+++ b/src/USER-OMP/bond_morse_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,11 +60,11 @@ void BondMorseOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -125,6 +125,6 @@ void BondMorseOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,nlocal,NEWTON_BOND,
-			     ebond,fbond,delx,dely,delz,thr);
+                             ebond,fbond,delx,dely,delz,thr);
   }
 }
diff --git a/src/USER-OMP/bond_morse_omp.h b/src/USER-OMP/bond_morse_omp.h
index e6a9177868..09d3a4458d 100644
--- a/src/USER-OMP/bond_morse_omp.h
+++ b/src/USER-OMP/bond_morse_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/bond_nonlinear_omp.cpp b/src/USER-OMP/bond_nonlinear_omp.cpp
index cfb046bf67..46eed47604 100644
--- a/src/USER-OMP/bond_nonlinear_omp.cpp
+++ b/src/USER-OMP/bond_nonlinear_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,11 +60,11 @@ void BondNonlinearOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -125,6 +125,6 @@ void BondNonlinearOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,nlocal,NEWTON_BOND,
-			     ebond,fbond,delx,dely,delz,thr);
+                             ebond,fbond,delx,dely,delz,thr);
   }
 }
diff --git a/src/USER-OMP/bond_nonlinear_omp.h b/src/USER-OMP/bond_nonlinear_omp.h
index ae1b671ad4..fcb0fa325d 100644
--- a/src/USER-OMP/bond_nonlinear_omp.h
+++ b/src/USER-OMP/bond_nonlinear_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/bond_quartic_omp.cpp b/src/USER-OMP/bond_quartic_omp.cpp
index d4ce470cde..d07ee9aca6 100644
--- a/src/USER-OMP/bond_quartic_omp.cpp
+++ b/src/USER-OMP/bond_quartic_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -66,11 +66,11 @@ void BondQuarticOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -122,12 +122,12 @@ void BondQuarticOMP::eval(int nfrom, int nto, ThrData * const thr)
     if (rsq > rc[type]*rc[type]) {
       bondlist[n][2] = 0;
       for (m = 0; m < atom->num_bond[i1]; m++)
-	if (atom->bond_atom[i1][m] == atom->tag[i2])
-	  atom->bond_type[i1][m] = 0;
+        if (atom->bond_atom[i1][m] == atom->tag[i2])
+          atom->bond_type[i1][m] = 0;
       if (i2 < atom->nlocal)
-	for (m = 0; m < atom->num_bond[i2]; m++)
-	  if (atom->bond_atom[i2][m] == atom->tag[i1])
-	    atom->bond_type[i2][m] = 0;
+        for (m = 0; m < atom->num_bond[i2]; m++)
+          if (atom->bond_atom[i2][m] == atom->tag[i1])
+            atom->bond_type[i2][m] = 0;
       continue;
     }
 
@@ -141,7 +141,7 @@ void BondQuarticOMP::eval(int nfrom, int nto, ThrData * const thr)
     ra = dr - b1[type];
     rb = dr - b2[type];
     fbond = -k[type]/r * (r2*(ra+rb) + 2.0*dr*ra*rb);
-    
+
     if (rsq < TWO_1_3) {
       sr2 = 1.0/rsq;
       sr6 = sr2*sr2*sr2;
@@ -181,18 +181,18 @@ void BondQuarticOMP::eval(int nfrom, int nto, ThrData * const thr)
       fpair = -fpair;
 
       if (NEWTON_BOND || i1 < nlocal) {
-	f[i1][0] += delx*fpair;
-	f[i1][1] += dely*fpair;
-	f[i1][2] += delz*fpair;
+        f[i1][0] += delx*fpair;
+        f[i1][1] += dely*fpair;
+        f[i1][2] += delz*fpair;
       }
       if (NEWTON_BOND || i2 < nlocal) {
-	f[i2][0] -= delx*fpair;
-	f[i2][1] -= dely*fpair;
-	f[i2][2] -= delz*fpair;
+        f[i2][0] -= delx*fpair;
+        f[i2][1] -= dely*fpair;
+        f[i2][2] -= delz*fpair;
       }
 
       if (EVFLAG) ev_tally_thr(force->pair,i1,i2,nlocal,NEWTON_BOND,
-			       evdwl,0.0,fpair,delx,dely,delz,thr);
+                               evdwl,0.0,fpair,delx,dely,delz,thr);
     }
   }
 }
diff --git a/src/USER-OMP/bond_quartic_omp.h b/src/USER-OMP/bond_quartic_omp.h
index bdc7d229e2..3a249a6cac 100644
--- a/src/USER-OMP/bond_quartic_omp.h
+++ b/src/USER-OMP/bond_quartic_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/bond_table_omp.cpp b/src/USER-OMP/bond_table_omp.cpp
index fe344dcfbe..fefadfc44a 100644
--- a/src/USER-OMP/bond_table_omp.cpp
+++ b/src/USER-OMP/bond_table_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,11 +60,11 @@ void BondTableOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -122,6 +122,6 @@ void BondTableOMP::eval(int nfrom, int nto, ThrData * const thr)
     }
 
     if (EVFLAG) ev_tally_thr(this,i1,i2,nlocal,NEWTON_BOND,
-			     ebond,fbond,delx,dely,delz,thr);
+                             ebond,fbond,delx,dely,delz,thr);
   }
 }
diff --git a/src/USER-OMP/bond_table_omp.h b/src/USER-OMP/bond_table_omp.h
index 17e48463d3..37e057ee26 100644
--- a/src/USER-OMP/bond_table_omp.h
+++ b/src/USER-OMP/bond_table_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/dihedral_charmm_omp.cpp b/src/USER-OMP/dihedral_charmm_omp.cpp
index 9b9cbca6fe..fbebfbaaac 100644
--- a/src/USER-OMP/dihedral_charmm_omp.cpp
+++ b/src/USER-OMP/dihedral_charmm_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -72,11 +72,11 @@ void DihedralCharmmOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -90,13 +90,13 @@ void DihedralCharmmOMP::compute(int eflag, int vflag)
 template <int EVFLAG, int EFLAG, int NEWTON_BOND>
 void DihedralCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
 {
-  
+
   int i1,i2,i3,i4,i,m,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 dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;  
+  double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;
   double c,s,p,sx2,sy2,sz2;
   int itype,jtype;
   double delx,dely,delz,rsq,r2inv,r6inv;
@@ -144,7 +144,7 @@ void DihedralCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
     vb3y = x[i4][1] - x[i3][1];
     vb3z = x[i4][2] - x[i3][2];
     domain->minimum_image(vb3x,vb3y,vb3z);
-    
+
     // c,s calculation
 
     ax = vb1y*vb2zm - vb1z*vb2ym;
@@ -158,7 +158,7 @@ void DihedralCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
     rbsq = bx*bx + by*by + bz*bz;
     rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
     rg = sqrt(rgsq);
-    
+
     rginv = ra2inv = rb2inv = 0.0;
     if (rg > 0) rginv = 1.0/rg;
     if (rasq > 0) ra2inv = 1.0/rasq;
@@ -174,29 +174,29 @@ void DihedralCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
       int me = comm->me;
 
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		me,thr->get_tid(),update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                me,thr->get_tid(),update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-         
+
     m = multiplicity[type];
     p = 1.0;
     ddf1 = df1 = 0.0;
-    
+
     for (i = 0; i < m; i++) {
       ddf1 = p*c - df1*s;
       df1 = p*s + df1*c;
@@ -207,21 +207,21 @@ void DihedralCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
     df1 = df1*cos_shift[type] - ddf1*sin_shift[type];
     df1 *= -m;
     p += 1.0;
- 
+
     if (m == 0) {
       p = 1.0 + cos_shift[type];
       df1 = 0.0;
     }
 
-    if (EFLAG) edihedral = k[type] * p; 
-       
+    if (EFLAG) edihedral = k[type] * p;
+
     fg = vb1x*vb2xm + vb1y*vb2ym + vb1z*vb2zm;
     hg = vb3x*vb2xm + vb3y*vb2ym + vb3z*vb2zm;
     fga = fg*ra2inv*rginv;
     hgb = hg*rb2inv*rginv;
     gaa = -ra2inv*rg;
     gbb = rb2inv*rg;
-    
+
     dtfx = gaa*ax;
     dtfy = gaa*ay;
     dtfz = gaa*az;
@@ -231,9 +231,9 @@ void DihedralCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
     dthx = gbb*bx;
     dthy = gbb*by;
     dthz = gbb*bz;
-    
+
     df = -k[type] * df1;
-    
+
     sx2 = df*dtgx;
     sy2 = df*dtgy;
     sz2 = df*dtgz;
@@ -253,7 +253,7 @@ void DihedralCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
     f3[0] = -sx2 - f4[0];
     f3[1] = -sy2 - f4[1];
     f3[2] = -sz2 - f4[2];
-    
+
     // apply force to each of 4 atoms
 
     if (NEWTON_BOND || i1 < nlocal) {
@@ -282,7 +282,7 @@ void DihedralCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,edihedral,f1,f3,f4,
-		   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
     // 1-4 LJ and Coulomb interactions
     // tally energy/virial in pair, using newton_bond as newton flag
 
@@ -304,25 +304,24 @@ void DihedralCharmmOMP::eval(int nfrom, int nto, ThrData * const thr)
       fpair = weight[type] * (forcelj+forcecoul)*r2inv;
 
       if (EFLAG) {
-	ecoul = weight[type] * forcecoul;
-	evdwl = r6inv * (lj14_3[itype][jtype]*r6inv - lj14_4[itype][jtype]);
-	evdwl *= weight[type];
+        ecoul = weight[type] * forcecoul;
+        evdwl = r6inv * (lj14_3[itype][jtype]*r6inv - lj14_4[itype][jtype]);
+        evdwl *= weight[type];
       }
 
       if (NEWTON_BOND || i1 < nlocal) {
-	f[i1][0] += delx*fpair;
-	f[i1][1] += dely*fpair;
-	f[i1][2] += delz*fpair;
+        f[i1][0] += delx*fpair;
+        f[i1][1] += dely*fpair;
+        f[i1][2] += delz*fpair;
       }
       if (NEWTON_BOND || i4 < nlocal) {
-	f[i4][0] -= delx*fpair;
-	f[i4][1] -= dely*fpair;
-	f[i4][2] -= delz*fpair;
+        f[i4][0] -= delx*fpair;
+        f[i4][1] -= dely*fpair;
+        f[i4][2] -= delz*fpair;
       }
 
       if (EVFLAG) ev_tally_thr(force->pair,i1,i4,nlocal,NEWTON_BOND,
-			       evdwl,ecoul,fpair,delx,dely,delz,thr);
+                               evdwl,ecoul,fpair,delx,dely,delz,thr);
     }
   }
 }
-
diff --git a/src/USER-OMP/dihedral_charmm_omp.h b/src/USER-OMP/dihedral_charmm_omp.h
index 6705b89fbc..cd0ae5f8ea 100644
--- a/src/USER-OMP/dihedral_charmm_omp.h
+++ b/src/USER-OMP/dihedral_charmm_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/dihedral_class2_omp.cpp b/src/USER-OMP/dihedral_class2_omp.cpp
index 1c473ca4b1..0d150851c8 100644
--- a/src/USER-OMP/dihedral_class2_omp.cpp
+++ b/src/USER-OMP/dihedral_class2_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,11 +64,11 @@ void DihedralClass2OMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -82,7 +82,7 @@ void DihedralClass2OMP::compute(int eflag, int vflag)
 template <int EVFLAG, int EFLAG, int NEWTON_BOND>
 void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 {
-  
+
   int i1,i2,i3,i4,i,j,k,n,type;
   double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,vb2xm,vb2ym,vb2zm;
   double edihedral;
@@ -136,7 +136,7 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     vb3y = x[i4][1] - x[i3][1];
     vb3z = x[i4][2] - x[i3][2];
     domain->minimum_image(vb3x,vb3y,vb3z);
-    
+
     // distances
 
     r1mag2 = vb1x*vb1x + vb1y*vb1y + vb1z*vb1z;
@@ -162,14 +162,14 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     costh12 = (vb1x*vb2x + vb1y*vb2y + vb1z*vb2z) * r12c1;
     costh13 = c0;
     costh23 = (vb2xm*vb3x + vb2ym*vb3y + vb2zm*vb3z) * r12c2;
-          
+
     // cos and sin of 2 angles and final c
 
     sin2 = MAX(1.0 - costh12*costh12,0.0);
     sc1 = sqrt(sin2);
     if (sc1 < SMALL) sc1 = SMALL;
     sc1 = 1.0/sc1;
-          
+
     sin2 = MAX(1.0 - costh23*costh23,0.0);
     sc2 = sqrt(sin2);
     if (sc2 < SMALL) sc2 = SMALL;
@@ -186,19 +186,19 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
       int me = comm->me;
 
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		me,thr->get_tid(),update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                me,thr->get_tid(),update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
 
@@ -216,7 +216,7 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     a12 = r12c1 * (costh12*c*s1 + costh23*s12);
     a13 = rb1*rb3*s12;
     a23 = r12c2 * (-costh23*c*s2 - costh12*s12);
-          
+
     sx1  = a11*vb1x + a12*vb2x + a13*vb3x;
     sx2  = a12*vb1x + a22*vb2x + a23*vb3x;
     sx12 = a13*vb1x + a23*vb2x + a33*vb3x;
@@ -244,18 +244,18 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	dphidr[i][j] = -dcosphidr[i][j] / sinphi;
+        dphidr[i][j] = -dcosphidr[i][j] / sinphi;
 
     // energy
 
     dphi1 = phi - phi1[type];
     dphi2 = 2.0*phi - phi2[type];
     dphi3 = 3.0*phi - phi3[type];
-    
+
     if (EFLAG) edihedral = k1[type]*(1.0 - cos(dphi1)) +
-		 k2[type]*(1.0 - cos(dphi2)) +
-		 k3[type]*(1.0 - cos(dphi3));
-    
+                 k2[type]*(1.0 - cos(dphi2)) +
+                 k3[type]*(1.0 - cos(dphi3));
+
     de_dihedral = k1[type]*sin(dphi1) + 2.0*k2[type]*sin(dphi2) +
       3.0*k3[type]*sin(dphi3);
 
@@ -263,18 +263,18 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] = de_dihedral*dphidr[i][j];
+        fabcd[i][j] = de_dihedral*dphidr[i][j];
 
     // set up d(bond)/d(r) array
     // dbonddr(i,j,k) = bond i, atom j, coordinate k
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++)
-	for (k = 0; k < 3; k++)
-	  dbonddr[i][j][k] = 0.0;
-    
+        for (k = 0; k < 3; k++)
+          dbonddr[i][j][k] = 0.0;
+
     // bond1
-    
+
     dbonddr[0][0][0] = vb1x / r1;
     dbonddr[0][0][1] = vb1y / r1;
     dbonddr[0][0][2] = vb1z / r1;
@@ -292,7 +292,7 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     dbonddr[1][2][2] = -vb2z / r2;
 
     // bond3
-    
+
     dbonddr[2][2][0] = vb3x / r3;
     dbonddr[2][2][1] = vb3y / r3;
     dbonddr[2][2][2] = vb3z / r3;
@@ -305,71 +305,71 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 2; i++)
       for (j = 0; j < 4; j++)
-	for (k = 0; k < 3; k++)
-	  dthetadr[i][j][k] = 0.0;
-    
+        for (k = 0; k < 3; k++)
+          dthetadr[i][j][k] = 0.0;
+
     t1 = costh12 / r1mag2;
     t2 = costh23 / r2mag2;
     t3 = costh12 / r2mag2;
     t4 = costh23 / r3mag2;
-    
+
     // angle12
-    
+
     dthetadr[0][0][0] = sc1 * ((t1 * vb1x) - (vb2x * r12c1));
     dthetadr[0][0][1] = sc1 * ((t1 * vb1y) - (vb2y * r12c1));
     dthetadr[0][0][2] = sc1 * ((t1 * vb1z) - (vb2z * r12c1));
-    
+
     dthetadr[0][1][0] = sc1 * ((-t1 * vb1x) + (vb2x * r12c1) +
-			       (-t3 * vb2x) + (vb1x * r12c1));
+                               (-t3 * vb2x) + (vb1x * r12c1));
     dthetadr[0][1][1] = sc1 * ((-t1 * vb1y) + (vb2y * r12c1) +
-			       (-t3 * vb2y) + (vb1y * r12c1));
+                               (-t3 * vb2y) + (vb1y * r12c1));
     dthetadr[0][1][2] = sc1 * ((-t1 * vb1z) + (vb2z * r12c1) +
-			       (-t3 * vb2z) + (vb1z * r12c1));
-    
-    dthetadr[0][2][0] = sc1 * ((t3 * vb2x) - (vb1x * r12c1)); 
+                               (-t3 * vb2z) + (vb1z * r12c1));
+
+    dthetadr[0][2][0] = sc1 * ((t3 * vb2x) - (vb1x * r12c1));
     dthetadr[0][2][1] = sc1 * ((t3 * vb2y) - (vb1y * r12c1));
     dthetadr[0][2][2] = sc1 * ((t3 * vb2z) - (vb1z * r12c1));
-    
+
     // angle23
-    
+
     dthetadr[1][1][0] = sc2 * ((t2 * vb2x) + (vb3x * r12c2));
     dthetadr[1][1][1] = sc2 * ((t2 * vb2y) + (vb3y * r12c2));
     dthetadr[1][1][2] = sc2 * ((t2 * vb2z) + (vb3z * r12c2));
-    
+
     dthetadr[1][2][0] = sc2 * ((-t2 * vb2x) - (vb3x * r12c2) +
-			       (t4 * vb3x) + (vb2x * r12c2));
+                               (t4 * vb3x) + (vb2x * r12c2));
     dthetadr[1][2][1] = sc2 * ((-t2 * vb2y) - (vb3y * r12c2) +
-			       (t4 * vb3y) + (vb2y * r12c2));
+                               (t4 * vb3y) + (vb2y * r12c2));
     dthetadr[1][2][2] = sc2 * ((-t2 * vb2z) - (vb3z * r12c2) +
-			       (t4 * vb3z) + (vb2z * r12c2));
-    
+                               (t4 * vb3z) + (vb2z * r12c2));
+
     dthetadr[1][3][0] = -sc2 * ((t4 * vb3x) + (vb2x * r12c2));
     dthetadr[1][3][1] = -sc2 * ((t4 * vb3y) + (vb2y * r12c2));
     dthetadr[1][3][2] = -sc2 * ((t4 * vb3z) + (vb2z * r12c2));
-    
+
     // mid-bond/torsion coupling
     // energy on bond2 (middle bond)
-    
+
     cos2phi = cos(2.0*phi);
     cos3phi = cos(3.0*phi);
-    
+
     bt1 = mbt_f1[type] * cosphi;
     bt2 = mbt_f2[type] * cos2phi;
     bt3 = mbt_f3[type] * cos3phi;
     sumbte = bt1 + bt2 + bt3;
     db = r2 - mbt_r0[type];
     if (EFLAG) edihedral += db * sumbte;
-    
+
     // force on bond2
-    
+
     bt1 = -mbt_f1[type] * sinphi;
     bt2 = -2.0 * mbt_f2[type] * sin(2.0*phi);
     bt3 = -3.0 * mbt_f3[type] * sin(3.0*phi);
     sumbtf = bt1 + bt2 + bt3;
-    
+
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*dbonddr[1][i][j];
+        fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*dbonddr[1][i][j];
 
     // end-bond/torsion coupling
     // energy on bond1 (first bond)
@@ -391,7 +391,7 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] -= db*sumbtf*dphidr[i][j] + sumbte*dbonddr[0][i][j];
+        fabcd[i][j] -= db*sumbtf*dphidr[i][j] + sumbte*dbonddr[0][i][j];
 
     // end-bond/torsion coupling
     // energy on bond3 (last bond)
@@ -413,7 +413,7 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*dbonddr[2][i][j];
+        fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*dbonddr[2][i][j];
 
     // angle/torsion coupling
     // energy on angle1
@@ -435,7 +435,7 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] -= da*sumbtf*dphidr[i][j] + sumbte*dthetadr[0][i][j];
+        fabcd[i][j] -= da*sumbtf*dphidr[i][j] + sumbte*dthetadr[0][i][j];
 
     // energy on angle2
 
@@ -456,20 +456,20 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] += da*sumbtf*dphidr[i][j] + sumbte*dthetadr[1][i][j];
+        fabcd[i][j] += da*sumbtf*dphidr[i][j] + sumbte*dthetadr[1][i][j];
 
     // angle/angle/torsion coupling
 
     da1 = acos(costh12) - aat_theta0_1[type];
     da2 = acos(costh23) - aat_theta0_2[type];
-          
+
     if (EFLAG) edihedral += aat_k[type]*da1*da2*cosphi;
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] -= aat_k[type] * 
-	  (cosphi * (da2*dthetadr[0][i][j] - da1*dthetadr[1][i][j]) +
-	   sinphi * da1*da2*dphidr[i][j]);
+        fabcd[i][j] -= aat_k[type] *
+          (cosphi * (da2*dthetadr[0][i][j] - da1*dthetadr[1][i][j]) +
+           sinphi * da1*da2*dphidr[i][j]);
 
     // bond1/bond3 coupling
 
@@ -483,7 +483,7 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
       tk2 = -bb13t_k[type] * dr2 / r1;
 
       if (EFLAG) edihedral += bb13t_k[type]*dr1*dr2;
-        
+
       fabcd[0][0] += tk2 * vb1x;
       fabcd[0][1] += tk2 * vb1y;
       fabcd[0][2] += tk2 * vb1z;
@@ -491,7 +491,7 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
       fabcd[1][0] -= tk2 * vb1x;
       fabcd[1][1] -= tk2 * vb1y;
       fabcd[1][2] -= tk2 * vb1z;
-        
+
       fabcd[2][0] -= tk1 * vb3x;
       fabcd[2][1] -= tk1 * vb3y;
       fabcd[2][2] -= tk1 * vb3z;
@@ -529,8 +529,7 @@ void DihedralClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,edihedral,
-		   fabcd[0],fabcd[2],fabcd[3],
-		   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+                   fabcd[0],fabcd[2],fabcd[3],
+                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
   }
 }
-
diff --git a/src/USER-OMP/dihedral_class2_omp.h b/src/USER-OMP/dihedral_class2_omp.h
index ac7b21cb4b..889bbaf920 100644
--- a/src/USER-OMP/dihedral_class2_omp.h
+++ b/src/USER-OMP/dihedral_class2_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp b/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp
index 29a7e48f52..15f4dd97c1 100644
--- a/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp
+++ b/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,11 +64,11 @@ void DihedralCosineShiftExpOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -82,13 +82,13 @@ void DihedralCosineShiftExpOMP::compute(int eflag, int vflag)
 template <int EVFLAG, int EFLAG, int NEWTON_BOND>
 void DihedralCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
 {
-  
+
   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,fg,hg,fga,hgb,gaa,gbb;
-  double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;  
+  double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;
   double c,s,sx2,sy2,sz2;
   double cccpsss,cssmscc,exp2;
 
@@ -131,7 +131,7 @@ void DihedralCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
     vb3y = x[i4][1] - x[i3][1];
     vb3z = x[i4][2] - x[i3][2];
     domain->minimum_image(vb3x,vb3y,vb3z);
-    
+
     // c,s calculation
 
     ax = vb1y*vb2zm - vb1z*vb2ym;
@@ -145,7 +145,7 @@ void DihedralCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
     rbsq = bx*bx + by*by + bz*bz;
     rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
     rg = sqrt(rgsq);
-    
+
     rginv = ra2inv = rb2inv = 0.0;
     if (rg > 0) rginv = 1.0/rg;
     if (rasq > 0) ra2inv = 1.0/rasq;
@@ -161,19 +161,19 @@ void DihedralCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
       int me = comm->me;
 
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		me,thr->get_tid(),update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                me,thr->get_tid(),update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
 
@@ -182,11 +182,11 @@ void DihedralCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     double aa=a[type];
     double uumin=umin[type];
-    
+
     cccpsss = c*cost[type]+s*sint[type];
     cssmscc = c*sint[type]-s*cost[type];
 
-    if (doExpansion[type]) { 
+    if (doExpansion[type]) {
       //  |a|<0.001 so use expansions relative precision <1e-5
       if (EFLAG) edihedral = -0.125*(1+cccpsss)*(4+aa*(cccpsss-1))*uumin;
       df=0.5*uumin*( cssmscc + 0.5*aa*cccpsss);
@@ -195,14 +195,14 @@ void DihedralCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
       if (EFLAG) edihedral = opt1[type]*(1-exp2);
       df= 0.5*opt1[type]*aa* ( exp2*cssmscc );
     }
-       
+
     fg = vb1x*vb2xm + vb1y*vb2ym + vb1z*vb2zm;
     hg = vb3x*vb2xm + vb3y*vb2ym + vb3z*vb2zm;
     fga = fg*ra2inv*rginv;
     hgb = hg*rb2inv*rginv;
     gaa = -ra2inv*rg;
     gbb = rb2inv*rg;
-    
+
     dtfx = gaa*ax;
     dtfy = gaa*ay;
     dtfz = gaa*az;
@@ -261,7 +261,6 @@ void DihedralCosineShiftExpOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,edihedral,f1,f3,f4,
-		   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
   }
 }
-
diff --git a/src/USER-OMP/dihedral_cosine_shift_exp_omp.h b/src/USER-OMP/dihedral_cosine_shift_exp_omp.h
index 502c2c01e9..7e1accebf1 100644
--- a/src/USER-OMP/dihedral_cosine_shift_exp_omp.h
+++ b/src/USER-OMP/dihedral_cosine_shift_exp_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/dihedral_harmonic_omp.cpp b/src/USER-OMP/dihedral_harmonic_omp.cpp
index 2f5dfb01fd..11023ee36c 100644
--- a/src/USER-OMP/dihedral_harmonic_omp.cpp
+++ b/src/USER-OMP/dihedral_harmonic_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -34,7 +34,7 @@ using namespace LAMMPS_NS;
 /* ---------------------------------------------------------------------- */
 
 DihedralHarmonicOMP::DihedralHarmonicOMP(class LAMMPS *lmp)
-  : DihedralHarmonic(lmp), ThrOMP(lmp,THR_DIHEDRAL) 
+  : DihedralHarmonic(lmp), ThrOMP(lmp,THR_DIHEDRAL)
 {
   suffix_flag |= Suffix::OMP;
 }
@@ -64,11 +64,11 @@ void DihedralHarmonicOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -82,13 +82,13 @@ void DihedralHarmonicOMP::compute(int eflag, int vflag)
 template <int EVFLAG, int EFLAG, int NEWTON_BOND>
 void DihedralHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
 {
-  
+
   int i1,i2,i3,i4,i,m,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 dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;  
+  double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;
   double c,s,p,sx2,sy2,sz2;
 
   edihedral = 0.0;
@@ -130,7 +130,7 @@ void DihedralHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
     vb3y = x[i4][1] - x[i3][1];
     vb3z = x[i4][2] - x[i3][2];
     domain->minimum_image(vb3x,vb3y,vb3z);
-    
+
     // c,s calculation
 
     ax = vb1y*vb2zm - vb1z*vb2ym;
@@ -144,7 +144,7 @@ void DihedralHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
     rbsq = bx*bx + by*by + bz*bz;
     rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
     rg = sqrt(rgsq);
-    
+
     rginv = ra2inv = rb2inv = 0.0;
     if (rg > 0) rginv = 1.0/rg;
     if (rasq > 0) ra2inv = 1.0/rasq;
@@ -160,29 +160,29 @@ void DihedralHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
       int me = comm->me;
 
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		me,thr->get_tid(),update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                me,thr->get_tid(),update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
-         
+
     m = multiplicity[type];
     p = 1.0;
     ddf1 = df1 = 0.0;
-    
+
     for (i = 0; i < m; i++) {
       ddf1 = p*c - df1*s;
       df1 = p*s + df1*c;
@@ -193,21 +193,21 @@ void DihedralHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
     df1 = df1*cos_shift[type] - ddf1*sin_shift[type];
     df1 *= -m;
     p += 1.0;
- 
+
     if (m == 0) {
       p = 1.0 + cos_shift[type];
       df1 = 0.0;
     }
 
-    if (EFLAG) edihedral = k[type] * p; 
-       
+    if (EFLAG) edihedral = k[type] * p;
+
     fg = vb1x*vb2xm + vb1y*vb2ym + vb1z*vb2zm;
     hg = vb3x*vb2xm + vb3y*vb2ym + vb3z*vb2zm;
     fga = fg*ra2inv*rginv;
     hgb = hg*rb2inv*rginv;
     gaa = -ra2inv*rg;
     gbb = rb2inv*rg;
-    
+
     dtfx = gaa*ax;
     dtfy = gaa*ay;
     dtfz = gaa*az;
@@ -217,9 +217,9 @@ void DihedralHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
     dthx = gbb*bx;
     dthy = gbb*by;
     dthz = gbb*bz;
-    
+
     df = -k[type] * df1;
-    
+
     sx2 = df*dtgx;
     sy2 = df*dtgy;
     sz2 = df*dtgz;
@@ -239,7 +239,7 @@ void DihedralHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
     f3[0] = -sx2 - f4[0];
     f3[1] = -sy2 - f4[1];
     f3[2] = -sz2 - f4[2];
-    
+
     // apply force to each of 4 atoms
 
     if (NEWTON_BOND || i1 < nlocal) {
@@ -268,6 +268,6 @@ void DihedralHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,edihedral,f1,f3,f4,
-		   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
   }
 }
diff --git a/src/USER-OMP/dihedral_harmonic_omp.h b/src/USER-OMP/dihedral_harmonic_omp.h
index 744054ae43..b55bf015f2 100644
--- a/src/USER-OMP/dihedral_harmonic_omp.h
+++ b/src/USER-OMP/dihedral_harmonic_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/dihedral_helix_omp.cpp b/src/USER-OMP/dihedral_helix_omp.cpp
index dc9673699d..a869367bdb 100644
--- a/src/USER-OMP/dihedral_helix_omp.cpp
+++ b/src/USER-OMP/dihedral_helix_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -67,11 +67,11 @@ void DihedralHelixOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -85,7 +85,7 @@ void DihedralHelixOMP::compute(int eflag, int vflag)
 template <int EVFLAG, int EFLAG, int NEWTON_BOND>
 void DihedralHelixOMP::eval(int nfrom, int nto, ThrData * const thr)
 {
-  
+
   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];
@@ -134,7 +134,7 @@ void DihedralHelixOMP::eval(int nfrom, int nto, ThrData * const thr)
     vb3y = x[i4][1] - x[i3][1];
     vb3z = x[i4][2] - x[i3][2];
     domain->minimum_image(vb3x,vb3y,vb3z);
-    
+
     // c0 calculation
 
     sb1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
@@ -192,19 +192,19 @@ void DihedralHelixOMP::eval(int nfrom, int nto, ThrData * const thr)
       int me = comm->me;
 
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		me,thr->get_tid(),update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                me,thr->get_tid(),update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
 
@@ -221,7 +221,7 @@ void DihedralHelixOMP::eval(int nfrom, int nto, ThrData * const thr)
       cphi[type]*sin(phi + MY_PI4)*siinv;
 
     if (EFLAG) edihedral = aphi[type]*(1.0 - c) + bphi[type]*(1.0 + cos(3.0*phi)) +
-		 cphi[type]*(1.0 + cos(phi + MY_PI4));
+                 cphi[type]*(1.0 + cos(phi + MY_PI4));
 
     a = pd;
     c = c * a;
@@ -281,6 +281,6 @@ void DihedralHelixOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,edihedral,f1,f3,f4,
-		   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
   }
 }
diff --git a/src/USER-OMP/dihedral_helix_omp.h b/src/USER-OMP/dihedral_helix_omp.h
index de3d5b8f30..24f16c4d7e 100644
--- a/src/USER-OMP/dihedral_helix_omp.h
+++ b/src/USER-OMP/dihedral_helix_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/dihedral_multi_harmonic_omp.cpp b/src/USER-OMP/dihedral_multi_harmonic_omp.cpp
index decc12e75a..a40bdba955 100644
--- a/src/USER-OMP/dihedral_multi_harmonic_omp.cpp
+++ b/src/USER-OMP/dihedral_multi_harmonic_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,11 +64,11 @@ void DihedralMultiHarmonicOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -82,7 +82,7 @@ void DihedralMultiHarmonicOMP::compute(int eflag, int vflag)
 template <int EVFLAG, int EFLAG, int NEWTON_BOND>
 void DihedralMultiHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
 {
-  
+
   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];
@@ -131,20 +131,20 @@ void DihedralMultiHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
     vb3y = x[i4][1] - x[i3][1];
     vb3z = x[i4][2] - x[i3][2];
     domain->minimum_image(vb3x,vb3y,vb3z);
-    
+
     // c0 calculation
-        
+
     sb1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
     sb2 = 1.0 / (vb2x*vb2x + vb2y*vb2y + vb2z*vb2z);
     sb3 = 1.0 / (vb3x*vb3x + vb3y*vb3y + vb3z*vb3z);
-        
+
     rb1 = sqrt(sb1);
     rb3 = sqrt(sb3);
-        
+
     c0 = (vb1x*vb3x + vb1y*vb3y + vb1z*vb3z) * rb1*rb3;
 
     // 1st and 2nd angle
-        
+
     b1mag2 = vb1x*vb1x + vb1y*vb1y + vb1z*vb1z;
     b1mag = sqrt(b1mag2);
     b2mag2 = vb2x*vb2x + vb2y*vb2y + vb2z*vb2z;
@@ -182,22 +182,22 @@ void DihedralMultiHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
     if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) {
       int me = comm->me;
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		me,thr->get_tid(),update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                me,thr->get_tid(),update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
 
@@ -207,7 +207,7 @@ void DihedralMultiHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     pd = a2[type] + c*(2.0*a3[type] + c*(3.0*a4[type] + c*4.0*a5[type]));
 
-    if (EFLAG) 
+    if (EFLAG)
       edihedral = a1[type] + c*(a2[type] + c*(a3[type] + c*(a4[type] + c*a5[type])));
 
     a = pd;
@@ -268,6 +268,6 @@ void DihedralMultiHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,edihedral,f1,f3,f4,
-		   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
   }
 }
diff --git a/src/USER-OMP/dihedral_multi_harmonic_omp.h b/src/USER-OMP/dihedral_multi_harmonic_omp.h
index 73e34a49e5..c6b80237a5 100644
--- a/src/USER-OMP/dihedral_multi_harmonic_omp.h
+++ b/src/USER-OMP/dihedral_multi_harmonic_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/dihedral_opls_omp.cpp b/src/USER-OMP/dihedral_opls_omp.cpp
index 5beee8a8cb..30b805611b 100644
--- a/src/USER-OMP/dihedral_opls_omp.cpp
+++ b/src/USER-OMP/dihedral_opls_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,11 +65,11 @@ void DihedralOPLSOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -83,7 +83,7 @@ void DihedralOPLSOMP::compute(int eflag, int vflag)
 template <int EVFLAG, int EFLAG, int NEWTON_BOND>
 void DihedralOPLSOMP::eval(int nfrom, int nto, ThrData * const thr)
 {
-  
+
   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];
@@ -132,7 +132,7 @@ void DihedralOPLSOMP::eval(int nfrom, int nto, ThrData * const thr)
     vb3y = x[i4][1] - x[i3][1];
     vb3z = x[i4][2] - x[i3][2];
     domain->minimum_image(vb3x,vb3y,vb3z);
-    
+
     // c0 calculation
 
     sb1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
@@ -190,19 +190,19 @@ void DihedralOPLSOMP::eval(int nfrom, int nto, ThrData * const thr)
       int me = comm->me;
 
       if (screen) {
-	char str[128];
-	sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		me,thr->get_tid(),update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Dihedral problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                me,thr->get_tid(),update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
 
@@ -219,7 +219,7 @@ void DihedralOPLSOMP::eval(int nfrom, int nto, ThrData * const thr)
     if (fabs(si) < SMALLER) si = SMALLER;
     siinv = 1.0/si;
 
-    pd = k1[type] - 2.0*k2[type]*sin(2.0*phi)*siinv + 
+    pd = k1[type] - 2.0*k2[type]*sin(2.0*phi)*siinv +
       3.0*k3[type]*sin(3.0*phi)*siinv - 4.0*k4[type]*sin(4.0*phi)*siinv;
 
     if (EFLAG) edihedral = k1[type]*(1.0 + c) + k2[type]*(1.0 - cos(2.0*phi))
@@ -284,7 +284,6 @@ void DihedralOPLSOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,edihedral,f1,f3,f4,
-		   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
   }
 }
-
diff --git a/src/USER-OMP/dihedral_opls_omp.h b/src/USER-OMP/dihedral_opls_omp.h
index 4092ab167e..fbb5455f9c 100644
--- a/src/USER-OMP/dihedral_opls_omp.h
+++ b/src/USER-OMP/dihedral_opls_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/dihedral_table_omp.cpp b/src/USER-OMP/dihedral_table_omp.cpp
index c2ed9d63b8..55f5ffd97b 100644
--- a/src/USER-OMP/dihedral_table_omp.cpp
+++ b/src/USER-OMP/dihedral_table_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,11 +64,11 @@ void DihedralTableOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -93,19 +93,19 @@ void DihedralTableOMP::eval(int nfrom, int nto, ThrData * const thr)
   // The dihedral angle "phi" is the angle between n123 and n234
   // the planes defined by atoms i1,i2,i3, and i2,i3,i4.
   //
-  // Definitions of vectors: vb12, vb23, vb34, perp12on23 
+  // Definitions of vectors: vb12, vb23, vb34, perp12on23
   //                         proj12on23, perp43on32, proj43on32
   //
   //  Note: The positions of the 4 atoms are labeled x[i1], x[i2], x[i3], x[i4]
   //        (which are also vectors)
   //
-  //             proj12on23                          proj34on23          
-  //             --------->                         ----------->         
-  //                           .                                         
-  //                          .                                          
-  //                         .                                  
-  //                  x[i2] .                       x[i3]                 
-  //    .                __@----------vb23-------->@ . . . .           . 
+  //             proj12on23                          proj34on23
+  //             --------->                         ----------->
+  //                           .
+  //                          .
+  //                         .
+  //                  x[i2] .                       x[i3]
+  //    .                __@----------vb23-------->@ . . . .           .
   //   /|\                /|                        \                  |
   //    |                /                           \                 |
   //    |               /                             \                |
@@ -118,9 +118,9 @@ void DihedralTableOMP::eval(int nfrom, int nto, ThrData * const thr)
   //    |        /                                           \         |
   //            @                                             \        |
   //                                                          _\|     \|/
-  //         x[i1]                                              @     
-  //                                                           
-  //                                                           x[i4]   
+  //         x[i1]                                              @
+  //
+  //                                                           x[i4]
   //
 
   double vb12[g_dim]; // displacement vector from atom i1 towards atom i2
@@ -158,11 +158,11 @@ void DihedralTableOMP::eval(int nfrom, int nto, ThrData * const thr)
     //
 
     // Phi() calculates the dihedral angle.
-    // This function also calculates the vectors: 
+    // This function also calculates the vectors:
     // vb12, vb23, vb34, n123, and n234, which we will need later.
 
 
-    double phi = Phi(x[i1], x[i2], x[i3], x[i4], domain, 
+    double phi = Phi(x[i1], x[i2], x[i3], x[i4], domain,
                      vb12, vb23, vb34, n123, n234);
 
 
@@ -170,7 +170,7 @@ void DihedralTableOMP::eval(int nfrom, int nto, ThrData * const thr)
     //
     // Gradient variables:
     //
-    // dphi_dx1, dphi_dx2, dphi_dx3, dphi_dx4 are the gradients of phi with 
+    // dphi_dx1, dphi_dx2, dphi_dx3, dphi_dx4 are the gradients of phi with
     // respect to the atomic positions of atoms i1, i2, i3, i4, respectively.
     // As an example, consider dphi_dx1.  The d'th element is:
     double dphi_dx1[g_dim]; //                 d phi
@@ -222,8 +222,8 @@ void DihedralTableOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     // --- Compute the gradient vectors dphi/dx2 and dphi/dx3: ---
     //
-    // This is more tricky because atoms 2 and 3 are shared by both planes 
-    // 123 and 234 (the angle between which defines "phi").  Moving either 
+    // This is more tricky because atoms 2 and 3 are shared by both planes
+    // 123 and 234 (the angle between which defines "phi").  Moving either
     // one of these atoms effects both the 123 and 234 planes
     // Both the 123 and 234 planes intersect with the plane perpendicular to the
     // central bond axis (vb23).  The two lines where these intersections occur
@@ -256,9 +256,9 @@ void DihedralTableOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (int d=0; d < g_dim; ++d) {
       // Recall that the n123 and n234 plane normal vectors are proportional to
-      // the dphi/dx1 and dphi/dx2 gradients vectors 
+      // the dphi/dx1 and dphi/dx2 gradients vectors
       // It turns out we can save slightly more CPU cycles by expressing
-      // dphi/dx2 and dphi/dx3 as linear combinations of dphi/dx1 and dphi/dx2 
+      // dphi/dx2 and dphi/dx3 as linear combinations of dphi/dx1 and dphi/dx2
       // which we computed already (instead of n123 & n234).
       dphi_dx2[d] = dphi123_dx2_coef*dphi_dx1[d] + dphi234_dx2_coef*dphi_dx4[d];
       dphi_dx3[d] = dphi123_dx3_coef*dphi_dx1[d] + dphi234_dx3_coef*dphi_dx4[d];
@@ -273,7 +273,7 @@ void DihedralTableOMP::eval(int nfrom, int nto, ThrData * const thr)
     cerr << "  -- testing gradient for dihedral (n="<<n<<") for atoms ("
          << i1 << "," << i2 << "," << i3 << "," << i4 << ") --" << endl;
 
-    PrintGradientComparison(*this, dphi_dx1, dphi_dx2, dphi_dx3, dphi_dx4, 
+    PrintGradientComparison(*this, dphi_dx1, dphi_dx2, dphi_dx3, dphi_dx4,
                             domain, x[i1], x[i2], x[i3], x[i4]);
 
     for (int d=0; d < g_dim; ++d) {
@@ -339,7 +339,7 @@ void DihedralTableOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,edihedral,f1,f3,f4,
-		   vb12[0],vb12[1],vb12[2],vb23[0],vb23[1],vb23[2],vb34[0],
-		   vb34[1],vb34[2],thr);
+                   vb12[0],vb12[1],vb12[2],vb23[0],vb23[1],vb23[2],vb34[0],
+                   vb34[1],vb34[2],thr);
   }
 }
diff --git a/src/USER-OMP/dihedral_table_omp.h b/src/USER-OMP/dihedral_table_omp.h
index 638834b104..fadb57ed1d 100644
--- a/src/USER-OMP/dihedral_table_omp.h
+++ b/src/USER-OMP/dihedral_table_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/ewald_omp.cpp b/src/USER-OMP/ewald_omp.cpp
index 1461ea4ad6..93b61af186 100644
--- a/src/USER-OMP/ewald_omp.cpp
+++ b/src/USER-OMP/ewald_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -34,7 +34,7 @@ using namespace MathConst;
 
 /* ---------------------------------------------------------------------- */
 
-EwaldOMP::EwaldOMP(LAMMPS *lmp, int narg, char **arg) 
+EwaldOMP::EwaldOMP(LAMMPS *lmp, int narg, char **arg)
   : Ewald(lmp, narg, arg), ThrOMP(lmp, THR_KSPACE)
 {
   suffix_flag |= Suffix::OMP;
@@ -54,7 +54,7 @@ void EwaldOMP::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   compute the Ewald long-range force, energy, virial 
+   compute the Ewald long-range force, energy, virial
 ------------------------------------------------------------------------- */
 
 void EwaldOMP::compute(int eflag, int vflag)
@@ -123,22 +123,22 @@ void EwaldOMP::compute(int eflag, int vflag)
       kz = kzvecs[k];
 
       for (i = ifrom; i < ito; i++) {
-	cypz = cs[ky][1][i]*cs[kz][2][i] - sn[ky][1][i]*sn[kz][2][i];
-	sypz = sn[ky][1][i]*cs[kz][2][i] + cs[ky][1][i]*sn[kz][2][i];
-	exprl = cs[kx][0][i]*cypz - sn[kx][0][i]*sypz;
-	expim = sn[kx][0][i]*cypz + cs[kx][0][i]*sypz;
-	partial = expim*sfacrl_all[k] - exprl*sfacim_all[k];
-	ek[i][0] += partial*eg[k][0];
-	ek[i][1] += partial*eg[k][1];
-	ek[i][2] += partial*eg[k][2];
-
-	if (evflag_atom) {
-	  const double partial_peratom = exprl*sfacrl_all[k] + expim*sfacim_all[k];
-	  if (eflag_atom) eatom[i] += q[i]*ug[k]*partial_peratom;
-	  if (vflag_atom)
-	    for (j = 0; j < 6; j++)
-	      vatom[i][j] += ug[k]*vg[k][j]*partial_peratom;
-	}
+        cypz = cs[ky][1][i]*cs[kz][2][i] - sn[ky][1][i]*sn[kz][2][i];
+        sypz = sn[ky][1][i]*cs[kz][2][i] + cs[ky][1][i]*sn[kz][2][i];
+        exprl = cs[kx][0][i]*cypz - sn[kx][0][i]*sypz;
+        expim = sn[kx][0][i]*cypz + cs[kx][0][i]*sypz;
+        partial = expim*sfacrl_all[k] - exprl*sfacim_all[k];
+        ek[i][0] += partial*eg[k][0];
+        ek[i][1] += partial*eg[k][1];
+        ek[i][2] += partial*eg[k][2];
+
+        if (evflag_atom) {
+          const double partial_peratom = exprl*sfacrl_all[k] + expim*sfacim_all[k];
+          if (eflag_atom) eatom[i] += q[i]*ug[k]*partial_peratom;
+          if (vflag_atom)
+            for (j = 0; j < 6; j++)
+              vatom[i][j] += ug[k]*vg[k][j]*partial_peratom;
+        }
       }
     }
 
@@ -150,7 +150,7 @@ void EwaldOMP::compute(int eflag, int vflag)
       f[i][1] += fac*ek[i][1];
       f[i][2] += fac*ek[i][2];
     }
- 
+
     // global energy
 
     if (eflag_global) {
@@ -158,8 +158,8 @@ void EwaldOMP::compute(int eflag, int vflag)
 #pragma omp for private(k)
 #endif
       for (k = 0; k < kcount; k++)
-	eng_tmp += ug[k] * (sfacrl_all[k]*sfacrl_all[k] + 
-			    sfacim_all[k]*sfacim_all[k]);
+        eng_tmp += ug[k] * (sfacrl_all[k]*sfacrl_all[k] +
+                            sfacim_all[k]*sfacim_all[k]);
     }
 
     // global virial
@@ -169,13 +169,13 @@ void EwaldOMP::compute(int eflag, int vflag)
 #pragma omp for private(k)
 #endif
       for (k = 0; k < kcount; k++) {
-	double uk = ug[k] * (sfacrl_all[k]*sfacrl_all[k] + sfacim_all[k]*sfacim_all[k]);
-	v0 += uk*vg[k][0];
-	v1 += uk*vg[k][1];
-	v2 += uk*vg[k][2];
-	v3 += uk*vg[k][3];
-	v4 += uk*vg[k][4];
-	v5 += uk*vg[k][5];
+        double uk = ug[k] * (sfacrl_all[k]*sfacrl_all[k] + sfacim_all[k]*sfacim_all[k]);
+        v0 += uk*vg[k][0];
+        v1 += uk*vg[k][1];
+        v2 += uk*vg[k][2];
+        v3 += uk*vg[k][3];
+        v4 += uk*vg[k][4];
+        v5 += uk*vg[k][5];
       }
     }
 
@@ -184,16 +184,16 @@ void EwaldOMP::compute(int eflag, int vflag)
 
     if (evflag_atom) {
       if (eflag_atom) {
-	for (i = ifrom; i < ito; i++) {
-	  eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum /
-	    (g_ewald*g_ewald*volume);
-	  eatom[i] *= qscale;
-	}
+        for (i = ifrom; i < ito; i++) {
+          eatom[i] -= g_ewald*q[i]*q[i]/MY_PIS + MY_PI2*q[i]*qsum /
+            (g_ewald*g_ewald*volume);
+          eatom[i] *= qscale;
+        }
       }
 
       if (vflag_atom)
-	for (i = ifrom; i < ito; i++)
-	  for (j = 0; j < 6; j++) vatom[i][j] *= q[i]*qscale;
+        for (i = ifrom; i < ito; i++)
+          for (j = 0; j < 6; j++) vatom[i][j] *= q[i]*qscale;
     }
 
     reduce_thr(this, eflag,vflag,thr);
@@ -233,9 +233,9 @@ void EwaldOMP::eik_dot_r()
     int i,ifrom,ito,k,l,m,n,ic,tid;
     double cstr1,sstr1,cstr2,sstr2,cstr3,sstr3,cstr4,sstr4;
     double sqk,clpm,slpm;
-    
+
     loop_setup_thr(ifrom, ito, tid, nlocal, nthreads);
-    
+
     double * const sfacrl_thr = sfacrl + tid*kmax3d;
     double * const sfacim_thr = sfacim + tid*kmax3d;
 
@@ -246,42 +246,42 @@ void EwaldOMP::eik_dot_r()
     for (ic = 0; ic < 3; ic++) {
       sqk = unitk[ic]*unitk[ic];
       if (sqk <= gsqmx) {
-	cstr1 = 0.0;
-	sstr1 = 0.0;
-	for (i = ifrom; i < ito; i++) {
-	  cs[0][ic][i] = 1.0;
-	  sn[0][ic][i] = 0.0;
-	  cs[1][ic][i] = cos(unitk[ic]*x[i][ic]);
-	  sn[1][ic][i] = sin(unitk[ic]*x[i][ic]);
-	  cs[-1][ic][i] = cs[1][ic][i];
-	  sn[-1][ic][i] = -sn[1][ic][i];
-	  cstr1 += q[i]*cs[1][ic][i];
-	  sstr1 += q[i]*sn[1][ic][i];
-	}
-	sfacrl_thr[n] = cstr1;
-	sfacim_thr[n++] = sstr1;
+        cstr1 = 0.0;
+        sstr1 = 0.0;
+        for (i = ifrom; i < ito; i++) {
+          cs[0][ic][i] = 1.0;
+          sn[0][ic][i] = 0.0;
+          cs[1][ic][i] = cos(unitk[ic]*x[i][ic]);
+          sn[1][ic][i] = sin(unitk[ic]*x[i][ic]);
+          cs[-1][ic][i] = cs[1][ic][i];
+          sn[-1][ic][i] = -sn[1][ic][i];
+          cstr1 += q[i]*cs[1][ic][i];
+          sstr1 += q[i]*sn[1][ic][i];
+        }
+        sfacrl_thr[n] = cstr1;
+        sfacim_thr[n++] = sstr1;
       }
     }
 
     for (m = 2; m <= kmax; m++) {
       for (ic = 0; ic < 3; ic++) {
-	sqk = m*unitk[ic] * m*unitk[ic];
-	if (sqk <= gsqmx) {
-	  cstr1 = 0.0;
-	  sstr1 = 0.0;
-	  for (i = ifrom; i < ito; i++) {
-	    cs[m][ic][i] = cs[m-1][ic][i]*cs[1][ic][i] - 
-	      sn[m-1][ic][i]*sn[1][ic][i];
-	    sn[m][ic][i] = sn[m-1][ic][i]*cs[1][ic][i] + 
-	      cs[m-1][ic][i]*sn[1][ic][i];
-	    cs[-m][ic][i] = cs[m][ic][i];
-	    sn[-m][ic][i] = -sn[m][ic][i];
-	    cstr1 += q[i]*cs[m][ic][i];
-	    sstr1 += q[i]*sn[m][ic][i];
-	  }
-	  sfacrl_thr[n] = cstr1;
-	  sfacim_thr[n++] = sstr1;
-	}
+        sqk = m*unitk[ic] * m*unitk[ic];
+        if (sqk <= gsqmx) {
+          cstr1 = 0.0;
+          sstr1 = 0.0;
+          for (i = ifrom; i < ito; i++) {
+            cs[m][ic][i] = cs[m-1][ic][i]*cs[1][ic][i] -
+              sn[m-1][ic][i]*sn[1][ic][i];
+            sn[m][ic][i] = sn[m-1][ic][i]*cs[1][ic][i] +
+              cs[m-1][ic][i]*sn[1][ic][i];
+            cs[-m][ic][i] = cs[m][ic][i];
+            sn[-m][ic][i] = -sn[m][ic][i];
+            cstr1 += q[i]*cs[m][ic][i];
+            sstr1 += q[i]*sn[m][ic][i];
+          }
+          sfacrl_thr[n] = cstr1;
+          sfacim_thr[n++] = sstr1;
+        }
       }
     }
 
@@ -289,23 +289,23 @@ void EwaldOMP::eik_dot_r()
 
     for (k = 1; k <= kxmax; k++) {
       for (l = 1; l <= kymax; l++) {
-	sqk = (k*unitk[0] * k*unitk[0]) + (l*unitk[1] * l*unitk[1]);
-	if (sqk <= gsqmx) {
-	  cstr1 = 0.0;
-	  sstr1 = 0.0;
-	  cstr2 = 0.0;
-	  sstr2 = 0.0;
-	  for (i = ifrom; i < ito; i++) {
-	    cstr1 += q[i]*(cs[k][0][i]*cs[l][1][i] - sn[k][0][i]*sn[l][1][i]);
-	    sstr1 += q[i]*(sn[k][0][i]*cs[l][1][i] + cs[k][0][i]*sn[l][1][i]);
-	    cstr2 += q[i]*(cs[k][0][i]*cs[l][1][i] + sn[k][0][i]*sn[l][1][i]);
-	    sstr2 += q[i]*(sn[k][0][i]*cs[l][1][i] - cs[k][0][i]*sn[l][1][i]);
-	  }
-	  sfacrl_thr[n] = cstr1;
-	  sfacim_thr[n++] = sstr1;
-	  sfacrl_thr[n] = cstr2;
-	  sfacim_thr[n++] = sstr2;
-	}
+        sqk = (k*unitk[0] * k*unitk[0]) + (l*unitk[1] * l*unitk[1]);
+        if (sqk <= gsqmx) {
+          cstr1 = 0.0;
+          sstr1 = 0.0;
+          cstr2 = 0.0;
+          sstr2 = 0.0;
+          for (i = ifrom; i < ito; i++) {
+            cstr1 += q[i]*(cs[k][0][i]*cs[l][1][i] - sn[k][0][i]*sn[l][1][i]);
+            sstr1 += q[i]*(sn[k][0][i]*cs[l][1][i] + cs[k][0][i]*sn[l][1][i]);
+            cstr2 += q[i]*(cs[k][0][i]*cs[l][1][i] + sn[k][0][i]*sn[l][1][i]);
+            sstr2 += q[i]*(sn[k][0][i]*cs[l][1][i] - cs[k][0][i]*sn[l][1][i]);
+          }
+          sfacrl_thr[n] = cstr1;
+          sfacim_thr[n++] = sstr1;
+          sfacrl_thr[n] = cstr2;
+          sfacim_thr[n++] = sstr2;
+        }
       }
     }
 
@@ -313,23 +313,23 @@ void EwaldOMP::eik_dot_r()
 
     for (l = 1; l <= kymax; l++) {
       for (m = 1; m <= kzmax; m++) {
-	sqk = (l*unitk[1] * l*unitk[1]) + (m*unitk[2] * m*unitk[2]);
-	if (sqk <= gsqmx) {
-	  cstr1 = 0.0;
-	  sstr1 = 0.0;
-	  cstr2 = 0.0;
-	  sstr2 = 0.0;
-	  for (i = ifrom; i < ito; i++) {
-	    cstr1 += q[i]*(cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i]);
-	    sstr1 += q[i]*(sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i]);
-	    cstr2 += q[i]*(cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i]);
-	    sstr2 += q[i]*(sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i]);
-	  }
-	  sfacrl_thr[n] = cstr1;
-	  sfacim_thr[n++] = sstr1;
-	  sfacrl_thr[n] = cstr2;
-	  sfacim_thr[n++] = sstr2;
-	}
+        sqk = (l*unitk[1] * l*unitk[1]) + (m*unitk[2] * m*unitk[2]);
+        if (sqk <= gsqmx) {
+          cstr1 = 0.0;
+          sstr1 = 0.0;
+          cstr2 = 0.0;
+          sstr2 = 0.0;
+          for (i = ifrom; i < ito; i++) {
+            cstr1 += q[i]*(cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i]);
+            sstr1 += q[i]*(sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i]);
+            cstr2 += q[i]*(cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i]);
+            sstr2 += q[i]*(sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i]);
+          }
+          sfacrl_thr[n] = cstr1;
+          sfacim_thr[n++] = sstr1;
+          sfacrl_thr[n] = cstr2;
+          sfacim_thr[n++] = sstr2;
+        }
       }
     }
 
@@ -337,23 +337,23 @@ void EwaldOMP::eik_dot_r()
 
     for (k = 1; k <= kxmax; k++) {
       for (m = 1; m <= kzmax; m++) {
-	sqk = (k*unitk[0] * k*unitk[0]) + (m*unitk[2] * m*unitk[2]);
-	if (sqk <= gsqmx) {
-	  cstr1 = 0.0;
-	  sstr1 = 0.0;
-	  cstr2 = 0.0;
-	  sstr2 = 0.0;
-	  for (i = ifrom; i < ito; i++) {
-	    cstr1 += q[i]*(cs[k][0][i]*cs[m][2][i] - sn[k][0][i]*sn[m][2][i]);
-	    sstr1 += q[i]*(sn[k][0][i]*cs[m][2][i] + cs[k][0][i]*sn[m][2][i]);
-	    cstr2 += q[i]*(cs[k][0][i]*cs[m][2][i] + sn[k][0][i]*sn[m][2][i]);
-	    sstr2 += q[i]*(sn[k][0][i]*cs[m][2][i] - cs[k][0][i]*sn[m][2][i]);
-	  }
-	  sfacrl_thr[n] = cstr1;
-	  sfacim_thr[n++] = sstr1;
-	  sfacrl_thr[n] = cstr2;
-	  sfacim_thr[n++] = sstr2;
-	}
+        sqk = (k*unitk[0] * k*unitk[0]) + (m*unitk[2] * m*unitk[2]);
+        if (sqk <= gsqmx) {
+          cstr1 = 0.0;
+          sstr1 = 0.0;
+          cstr2 = 0.0;
+          sstr2 = 0.0;
+          for (i = ifrom; i < ito; i++) {
+            cstr1 += q[i]*(cs[k][0][i]*cs[m][2][i] - sn[k][0][i]*sn[m][2][i]);
+            sstr1 += q[i]*(sn[k][0][i]*cs[m][2][i] + cs[k][0][i]*sn[m][2][i]);
+            cstr2 += q[i]*(cs[k][0][i]*cs[m][2][i] + sn[k][0][i]*sn[m][2][i]);
+            sstr2 += q[i]*(sn[k][0][i]*cs[m][2][i] - cs[k][0][i]*sn[m][2][i]);
+          }
+          sfacrl_thr[n] = cstr1;
+          sfacim_thr[n++] = sstr1;
+          sfacrl_thr[n] = cstr2;
+          sfacim_thr[n++] = sstr2;
+        }
       }
     }
 
@@ -361,49 +361,49 @@ void EwaldOMP::eik_dot_r()
 
     for (k = 1; k <= kxmax; k++) {
       for (l = 1; l <= kymax; l++) {
-	for (m = 1; m <= kzmax; m++) {
-	  sqk = (k*unitk[0] * k*unitk[0]) + (l*unitk[1] * l*unitk[1]) +
-	    (m*unitk[2] * m*unitk[2]);
-	  if (sqk <= gsqmx) {
-	    cstr1 = 0.0;
-	    sstr1 = 0.0;
-	    cstr2 = 0.0;
-	    sstr2 = 0.0;
-	    cstr3 = 0.0;
-	    sstr3 = 0.0;
-	    cstr4 = 0.0;
-	    sstr4 = 0.0;
-	    for (i = ifrom; i < ito; i++) {
-	      clpm = cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i];
-	      slpm = sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i];
-	      cstr1 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
-	      sstr1 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
-	    
-	      clpm = cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i];
-	      slpm = -sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i];
-	      cstr2 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
-	      sstr2 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
-	    
-	      clpm = cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i];
-	      slpm = sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i];
-	      cstr3 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
-	      sstr3 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
-	    
-	      clpm = cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i];
-	      slpm = -sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i];
-	      cstr4 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
-	      sstr4 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
-	    }
-	    sfacrl_thr[n] = cstr1;
-	    sfacim_thr[n++] = sstr1;
-	    sfacrl_thr[n] = cstr2;
-	    sfacim_thr[n++] = sstr2;
-	    sfacrl_thr[n] = cstr3;
-	    sfacim_thr[n++] = sstr3;
-	    sfacrl_thr[n] = cstr4;
-	    sfacim_thr[n++] = sstr4;
-	  }
-	}
+        for (m = 1; m <= kzmax; m++) {
+          sqk = (k*unitk[0] * k*unitk[0]) + (l*unitk[1] * l*unitk[1]) +
+            (m*unitk[2] * m*unitk[2]);
+          if (sqk <= gsqmx) {
+            cstr1 = 0.0;
+            sstr1 = 0.0;
+            cstr2 = 0.0;
+            sstr2 = 0.0;
+            cstr3 = 0.0;
+            sstr3 = 0.0;
+            cstr4 = 0.0;
+            sstr4 = 0.0;
+            for (i = ifrom; i < ito; i++) {
+              clpm = cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i];
+              slpm = sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i];
+              cstr1 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
+              sstr1 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
+
+              clpm = cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i];
+              slpm = -sn[l][1][i]*cs[m][2][i] + cs[l][1][i]*sn[m][2][i];
+              cstr2 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
+              sstr2 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
+
+              clpm = cs[l][1][i]*cs[m][2][i] + sn[l][1][i]*sn[m][2][i];
+              slpm = sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i];
+              cstr3 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
+              sstr3 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
+
+              clpm = cs[l][1][i]*cs[m][2][i] - sn[l][1][i]*sn[m][2][i];
+              slpm = -sn[l][1][i]*cs[m][2][i] - cs[l][1][i]*sn[m][2][i];
+              cstr4 += q[i]*(cs[k][0][i]*clpm - sn[k][0][i]*slpm);
+              sstr4 += q[i]*(sn[k][0][i]*clpm + cs[k][0][i]*slpm);
+            }
+            sfacrl_thr[n] = cstr1;
+            sfacim_thr[n++] = sstr1;
+            sfacrl_thr[n] = cstr2;
+            sfacim_thr[n++] = sstr2;
+            sfacrl_thr[n] = cstr3;
+            sfacim_thr[n++] = sstr3;
+            sfacrl_thr[n] = cstr4;
+            sfacim_thr[n++] = sstr4;
+          }
+        }
       }
     }
 
diff --git a/src/USER-OMP/ewald_omp.h b/src/USER-OMP/ewald_omp.h
index 515a74ed35..222806f15a 100644
--- a/src/USER-OMP/ewald_omp.h
+++ b/src/USER-OMP/ewald_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/fix_gravity_omp.cpp b/src/USER-OMP/fix_gravity_omp.cpp
index 3b55d1e7fa..fd32a00e58 100644
--- a/src/USER-OMP/fix_gravity_omp.cpp
+++ b/src/USER-OMP/fix_gravity_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -82,11 +82,11 @@ void FixGravityOMP::post_force(int vflag)
 #endif
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	massone = rmass[i];
-	f[i][0] += massone*xacc_thr;
-	f[i][1] += massone*yacc_thr;
-	f[i][2] += massone*zacc_thr;
-	grav -= massone * (xacc_thr*x[i][0] + yacc_thr*x[i][1] + zacc_thr*x[i][2]);
+        massone = rmass[i];
+        f[i][0] += massone*xacc_thr;
+        f[i][1] += massone*yacc_thr;
+        f[i][2] += massone*zacc_thr;
+        grav -= massone * (xacc_thr*x[i][0] + yacc_thr*x[i][1] + zacc_thr*x[i][2]);
       }
   } else {
 #if defined(_OPENMP)
@@ -94,11 +94,11 @@ void FixGravityOMP::post_force(int vflag)
 #endif
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	massone = mass[type[i]];
-	f[i][0] += massone*xacc_thr;
-	f[i][1] += massone*yacc_thr;
-	f[i][2] += massone*zacc_thr;
-	grav -= massone * (xacc_thr*x[i][0] + yacc_thr*x[i][1] + zacc_thr*x[i][2]);
+        massone = mass[type[i]];
+        f[i][0] += massone*xacc_thr;
+        f[i][1] += massone*yacc_thr;
+        f[i][2] += massone*zacc_thr;
+        grav -= massone * (xacc_thr*x[i][0] + yacc_thr*x[i][1] + zacc_thr*x[i][2]);
       }
   }
   egrav = grav;
@@ -110,4 +110,3 @@ void FixGravityOMP::post_force_respa(int vflag, int ilevel, int iloop)
 {
   if (ilevel == nlevels_respa-1) post_force(vflag);
 }
-
diff --git a/src/USER-OMP/fix_gravity_omp.h b/src/USER-OMP/fix_gravity_omp.h
index dd0144410e..ca104a1a9a 100644
--- a/src/USER-OMP/fix_gravity_omp.h
+++ b/src/USER-OMP/fix_gravity_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/fix_nve_sphere_omp.cpp b/src/USER-OMP/fix_nve_sphere_omp.cpp
index 6ac5afe55e..bbe009ecc9 100644
--- a/src/USER-OMP/fix_nve_sphere_omp.cpp
+++ b/src/USER-OMP/fix_nve_sphere_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,7 +45,7 @@ void FixNVESphereOMP::initial_integrate(int vflag)
   const int * const mask = atom->mask;
   const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal;
   int i;
-  
+
   // set timestep here since dt may have changed or come via rRESPA
   const double dtfrotate = dtf / INERTIA;
 
@@ -63,7 +63,7 @@ void FixNVESphereOMP::initial_integrate(int vflag)
       x[i][0] += dtv * v[i][0];
       x[i][1] += dtv * v[i][1];
       x[i][2] += dtv * v[i][2];
-      
+
       const double dtirotate = dtfrotate / (radius[i]*radius[i]*rmass[i]);
       omega[i][0] += dtirotate * torque[i][0];
       omega[i][1] += dtirotate * torque[i][1];
@@ -80,19 +80,19 @@ void FixNVESphereOMP::initial_integrate(int vflag)
 #if defined(_OPENMP)
 #pragma omp parallel for private(i) default(none)
 #endif
-    for (i = 0; i < nlocal; i++) { 
+    for (i = 0; i < nlocal; i++) {
       double g0,g1,g2,msq,scale;
       if (mask[i] & groupbit) {
-	if (mu[i][3] > 0.0) {
-	  g0 = mu[i][0] + dtv * (omega[i][1]*mu[i][2]-omega[i][2]*mu[i][1]);
-	  g1 = mu[i][1] + dtv * (omega[i][2]*mu[i][0]-omega[i][0]*mu[i][2]);
-	  g2 = mu[i][2] + dtv * (omega[i][0]*mu[i][1]-omega[i][1]*mu[i][0]);
-	  msq = g0*g0 + g1*g1 + g2*g2;
-	  scale = mu[i][3]/sqrt(msq);
-	  mu[i][0] = g0*scale;
-	  mu[i][1] = g1*scale;
-	  mu[i][2] = g2*scale;
-	}
+        if (mu[i][3] > 0.0) {
+          g0 = mu[i][0] + dtv * (omega[i][1]*mu[i][2]-omega[i][2]*mu[i][1]);
+          g1 = mu[i][1] + dtv * (omega[i][2]*mu[i][0]-omega[i][0]*mu[i][2]);
+          g2 = mu[i][2] + dtv * (omega[i][0]*mu[i][1]-omega[i][1]*mu[i][0]);
+          msq = g0*g0 + g1*g1 + g2*g2;
+          scale = mu[i][3]/sqrt(msq);
+          mu[i][0] = g0*scale;
+          mu[i][1] = g1*scale;
+          mu[i][2] = g2*scale;
+        }
       }
     }
   }
@@ -111,7 +111,7 @@ void FixNVESphereOMP::final_integrate()
   const int * const mask = atom->mask;
   const int nlocal = (igroup == atom->firstgroup) ? atom->nfirst : atom->nlocal;
   int i;
-  
+
   // set timestep here since dt may have changed or come via rRESPA
 
   const double dtfrotate = dtf / INERTIA;
@@ -128,7 +128,7 @@ void FixNVESphereOMP::final_integrate()
       v[i][0] += dtfm * f[i][0];
       v[i][1] += dtfm * f[i][1];
       v[i][2] += dtfm * f[i][2];
-      
+
       const double dtirotate = dtfrotate / (radius[i]*radius[i]*rmass[i]);
       omega[i][0] += dtirotate * torque[i][0];
       omega[i][1] += dtirotate * torque[i][1];
diff --git a/src/USER-OMP/fix_nve_sphere_omp.h b/src/USER-OMP/fix_nve_sphere_omp.h
index fe86039b18..ea965f1bb1 100644
--- a/src/USER-OMP/fix_nve_sphere_omp.h
+++ b/src/USER-OMP/fix_nve_sphere_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp
index 53e431dba4..7e770ce907 100644
--- a/src/USER-OMP/fix_omp.cpp
+++ b/src/USER-OMP/fix_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -92,9 +92,9 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) :  Fix(lmp, narg, arg),
     comm->nthreads = nthreads;
     if (comm->me == 0) {
       if (screen)
-	fprintf(screen,"  reset %d OpenMP thread(s) per MPI task\n", nthreads);
+        fprintf(screen,"  reset %d OpenMP thread(s) per MPI task\n", nthreads);
       if (logfile)
-	fprintf(logfile,"  reset %d OpenMP thread(s) per MPI task\n", nthreads);
+        fprintf(logfile,"  reset %d OpenMP thread(s) per MPI task\n", nthreads);
     }
   }
 
@@ -108,11 +108,11 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) :  Fix(lmp, narg, arg),
 
     if (comm->me == 0) {
       const char * const mode = _neighbor ? "OpenMP capable" : "serial";
-      
+
       if (screen)
-	fprintf(screen,"  using %s neighbor list subroutines\n", mode);
+        fprintf(screen,"  using %s neighbor list subroutines\n", mode);
       if (logfile)
-	fprintf(logfile,"  using %s neighbor list subroutines\n", mode);
+        fprintf(logfile,"  using %s neighbor list subroutines\n", mode);
     }
   }
 
@@ -121,23 +121,23 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) :  Fix(lmp, narg, arg),
     if (strcmp(arg[5],"neigh/half") == 0)
       _newton = true;
     else if (strcmp(arg[5],"neigh/full") == 0)
-	_newton = false;
+        _newton = false;
     else
       error->all(FLERR,"Illegal fix OMP command");
 
     if (comm->me == 0) {
       const char * const mode = _newton ? "half" : "full";
-      
+
       if (screen)
-	fprintf(screen,"  using /omp styles with %s neighbor list builds\n", mode);
+        fprintf(screen,"  using /omp styles with %s neighbor list builds\n", mode);
       if (logfile)
-	fprintf(logfile,"  using /omp styles with %s neighbor list builds\n", mode);
+        fprintf(logfile,"  using /omp styles with %s neighbor list builds\n", mode);
     }
   }
 #endif
 
   // allocate list for per thread accumulator manager class instances
-  // and then have each thread create an instance of this class to 
+  // and then have each thread create an instance of this class to
   // encourage the OS to use storage that is "close" to each thread's CPU.
   thr = new ThrData *[nthreads];
   _nthr = nthreads;
@@ -204,29 +204,29 @@ void FixOMP::init()
 // determine which is the last force style with OpenMP
 // support as this is the one that has to reduce the forces
 
-#define CheckStyleForOMP(name)						\
-  check_hybrid = 0;							\
-  if (force->name) {							\
-    if ( (strcmp(force->name ## _style,"hybrid") == 0) ||		\
-         (strcmp(force->name ## _style,"hybrid/overlay") == 0) )	\
-      check_hybrid=1;							\
-    if (force->name->suffix_flag & Suffix::OMP) {			\
-      last_force_name = (const char *) #name;				\
-      last_omp_name = force->name ## _style;				\
-      last_omp_style = (void *) force->name;				\
-    }									\
+#define CheckStyleForOMP(name)                                                \
+  check_hybrid = 0;                                                        \
+  if (force->name) {                                                        \
+    if ( (strcmp(force->name ## _style,"hybrid") == 0) ||                \
+         (strcmp(force->name ## _style,"hybrid/overlay") == 0) )        \
+      check_hybrid=1;                                                        \
+    if (force->name->suffix_flag & Suffix::OMP) {                        \
+      last_force_name = (const char *) #name;                                \
+      last_omp_name = force->name ## _style;                                \
+      last_omp_style = (void *) force->name;                                \
+    }                                                                        \
   }
 
-#define CheckHybridForOMP(name,Class)					\
-  if (check_hybrid) {							\
-    Class ## Hybrid *style = (Class ## Hybrid *) force->name;		\
-    for (int i=0; i < style->nstyles; i++) {				\
-      if (style->styles[i]->suffix_flag & Suffix::OMP) {		\
-	last_force_name = (const char *) #name;				\
-	last_omp_name = style->keywords[i];				\
-	last_omp_style = style->styles[i];				\
-      }									\
-    }									\
+#define CheckHybridForOMP(name,Class)                                        \
+  if (check_hybrid) {                                                        \
+    Class ## Hybrid *style = (Class ## Hybrid *) force->name;                \
+    for (int i=0; i < style->nstyles; i++) {                                \
+      if (style->styles[i]->suffix_flag & Suffix::OMP) {                \
+        last_force_name = (const char *) #name;                                \
+        last_omp_name = style->keywords[i];                                \
+        last_omp_style = style->styles[i];                                \
+      }                                                                        \
+    }                                                                        \
   }
 
   CheckStyleForOMP(pair);
@@ -258,22 +258,22 @@ void FixOMP::init()
   if (comm->me == 0) {
     if (last_omp_style) {
       if (last_pair_hybrid) {
-	if (screen)
-	  fprintf(screen,"Hybrid pair style last /omp style %s\n", last_hybrid_name);
-	if (logfile)
-	  fprintf(logfile,"Hybrid pair style last /omp style %s\n", last_hybrid_name);
+        if (screen)
+          fprintf(screen,"Hybrid pair style last /omp style %s\n", last_hybrid_name);
+        if (logfile)
+          fprintf(logfile,"Hybrid pair style last /omp style %s\n", last_hybrid_name);
       }
       if (screen)
-	fprintf(screen,"Last active /omp style is %s_style %s\n",
-		last_force_name, last_omp_name);
+        fprintf(screen,"Last active /omp style is %s_style %s\n",
+                last_force_name, last_omp_name);
       if (logfile)
-	fprintf(logfile,"Last active /omp style is %s_style %s\n",
-		last_force_name, last_omp_name);
+        fprintf(logfile,"Last active /omp style is %s_style %s\n",
+                last_force_name, last_omp_name);
     } else {
       if (screen)
-	fprintf(screen,"No /omp style for force computation currently active\n");
+        fprintf(screen,"No /omp style for force computation currently active\n");
       if (logfile)
-	fprintf(screen,"No /omp style for force computation currently active\n");
+        fprintf(screen,"No /omp style for force computation currently active\n");
     }
   }
 }
@@ -325,6 +325,6 @@ double FixOMP::memory_usage()
 {
   double bytes = comm->nthreads * (sizeof(ThrData *) + sizeof(ThrData));
   bytes += comm->nthreads * thr[0]->memory_usage();
-  
+
   return bytes;
 }
diff --git a/src/USER-OMP/fix_omp.h b/src/USER-OMP/fix_omp.h
index 6fa2c11cd5..d797b08418 100644
--- a/src/USER-OMP/fix_omp.h
+++ b/src/USER-OMP/fix_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ class FixOMP : public Fix {
                            // to do the general force reduction
   void *last_pair_hybrid;  // pointer to the pair style that needs
                            // to call virial_fdot_compute()
-  
+
  public:
   bool get_neighbor() const {return _neighbor;};
   bool get_newton() const   {return _newton;};
diff --git a/src/USER-OMP/fix_peri_neigh_omp.cpp b/src/USER-OMP/fix_peri_neigh_omp.cpp
index 2b3780f41e..000278c8b7 100644
--- a/src/USER-OMP/fix_peri_neigh_omp.cpp
+++ b/src/USER-OMP/fix_peri_neigh_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -43,9 +43,8 @@ void FixPeriNeighOMP::init()
   int irequest = neighbor->request((void *) this);
   neighbor->requests[irequest]->pair = 0;
   neighbor->requests[irequest]->fix  = 1;
-  neighbor->requests[irequest]->half = 0; 
+  neighbor->requests[irequest]->half = 0;
   neighbor->requests[irequest]->full = 1;
   neighbor->requests[irequest]->omp = use_omp;
   neighbor->requests[irequest]->occasional = 1;
 }
-
diff --git a/src/USER-OMP/fix_peri_neigh_omp.h b/src/USER-OMP/fix_peri_neigh_omp.h
index 11a383a2fe..6d91f39be1 100644
--- a/src/USER-OMP/fix_peri_neigh_omp.h
+++ b/src/USER-OMP/fix_peri_neigh_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -27,7 +27,7 @@ namespace LAMMPS_NS {
 class FixPeriNeighOMP : public FixPeriNeigh {
 
  public:
-  FixPeriNeighOMP(class LAMMPS *lmp, int narg, char **argv) : 
+  FixPeriNeighOMP(class LAMMPS *lmp, int narg, char **argv) :
     FixPeriNeigh(lmp,narg,argv) {};
   virtual void init();
 };
diff --git a/src/USER-OMP/fix_qeq_comb_omp.cpp b/src/USER-OMP/fix_qeq_comb_omp.cpp
index d283e6793b..db3c9fcf77 100644
--- a/src/USER-OMP/fix_qeq_comb_omp.cpp
+++ b/src/USER-OMP/fix_qeq_comb_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,7 +35,7 @@ using namespace FixConst;
 
 /* ---------------------------------------------------------------------- */
 
-FixQEQCombOMP::FixQEQCombOMP(LAMMPS *lmp, int narg, char **arg) 
+FixQEQCombOMP::FixQEQCombOMP(LAMMPS *lmp, int narg, char **arg)
   : FixQEQComb(lmp, narg, arg)
 {
   if (narg < 5) error->all(FLERR,"Illegal fix qeq/comb/omp command");
@@ -88,7 +88,7 @@ void FixQEQCombOMP::post_force(int vflag)
 
   // more loops for first-time charge equilibrium
 
-  iloop = 0; 
+  iloop = 0;
   if (firstflag) loopmax = 5000;
   else loopmax = 2000;
 
@@ -96,7 +96,7 @@ void FixQEQCombOMP::post_force(int vflag)
 
   if (me == 0 && fp)
     fprintf(fp,"Charge equilibration on step " BIGINT_FORMAT "\n",
-	    update->ntimestep);
+            update->ntimestep);
 
   heatpq = 0.05;
   qmass  = 0.000548580;
@@ -104,7 +104,7 @@ void FixQEQCombOMP::post_force(int vflag)
   dtq2   = 0.5*dtq*dtq/qmass;
 
   double enegchk = 0.0;
-  double enegtot = 0.0; 
+  double enegtot = 0.0;
   double enegmax = 0.0;
 
   double *q = atom->q;
@@ -117,8 +117,8 @@ void FixQEQCombOMP::post_force(int vflag)
   for (iloop = 0; iloop < loopmax; iloop ++ ) {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	q1[i] += qf[i]*dtq2 - heatpq*q1[i];
-	q[i]  += q1[i]; 
+        q1[i] += qf[i]*dtq2 - heatpq*q1[i];
+        q[i]  += q1[i];
       }
 
     enegtot = comb->yasu_char(qf,igroup);
@@ -127,10 +127,10 @@ void FixQEQCombOMP::post_force(int vflag)
 
     for (i = 0; i < nlocal ; i++)
       if (mask[i] & groupbit) {
-	q2[i] = enegtot-qf[i];
-	enegmax = MAX(enegmax,fabs(q2[i]));
-	enegchk += fabs(q2[i]);
-	qf[i] = q2[i];
+        q2[i] = enegtot-qf[i];
+        enegmax = MAX(enegmax,fabs(q2[i]));
+        enegchk += fabs(q2[i]);
+        qf[i] = q2[i];
       }
 
     MPI_Allreduce(&enegchk,&enegchkall,1,MPI_DOUBLE,MPI_SUM,world);
@@ -142,20 +142,19 @@ void FixQEQCombOMP::post_force(int vflag)
 
     if (me == 0 && fp)
       fprintf(fp,"  iteration: %d, enegtot %.6g, "
-	      "enegmax %.6g, fq deviation: %.6g\n",
-	      iloop,enegtot,enegmax,enegchk); 
+              "enegmax %.6g, fq deviation: %.6g\n",
+              iloop,enegtot,enegmax,enegchk);
 
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	q1[i] += qf[i]*dtq2 - heatpq*q1[i]; 
-  } 
+        q1[i] += qf[i]*dtq2 - heatpq*q1[i];
+  }
 
   if (me == 0 && fp) {
     if (iloop == loopmax)
       fprintf(fp,"Charges did not converge in %d iterations\n",iloop);
     else
       fprintf(fp,"Charges converged in %d iterations to %.10f tolerance\n",
-	      iloop,enegchk);
+              iloop,enegchk);
   }
 }
-
diff --git a/src/USER-OMP/fix_shear_history_omp.cpp b/src/USER-OMP/fix_shear_history_omp.cpp
index d539b69709..b5aa41b90b 100644
--- a/src/USER-OMP/fix_shear_history_omp.cpp
+++ b/src/USER-OMP/fix_shear_history_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,7 +69,7 @@ void FixShearHistoryOMP::pre_exchange()
     const int gmax = gfrom + gdelta;
     const int gto = (gmax > nall) ? nall : gmax;
 
-    
+
     int i,j,ii,jj,m,inum,jnum;
     int *ilist,*jlist,*numneigh,**firstneigh;
     int *touch,**firsttouch;
@@ -99,45 +99,45 @@ void FixShearHistoryOMP::pre_exchange()
       touch = firsttouch[i];
 
       for (jj = 0; jj < jnum; jj++) {
-	if (touch[jj]) {
-	  j = jlist[jj];
-	  j &= NEIGHMASK;
-	  shear = &allshear[3*jj];
-	  
-	  if ((i >= lfrom) && (i < lto)) {
-	    if (npartner[i] < MAXTOUCH) {
-	      m = npartner[i];
-	      partner[i][m] = tag[j];
-	      shearpartner[i][m][0] = shear[0];
-	      shearpartner[i][m][1] = shear[1];
-	      shearpartner[i][m][2] = shear[2];
-	    }
-	    npartner[i]++;
-	  }
-
-	  if ((j >= lfrom) && (j < lto)) {
-	    if (npartner[j] < MAXTOUCH) {
-	      m = npartner[j];
-	      partner[j][m] = tag[i];
-	      shearpartner[j][m][0] = -shear[0];
-	      shearpartner[j][m][1] = -shear[1];
-	      shearpartner[j][m][2] = -shear[2];
-	    }
-	    npartner[j]++;
-	  }
-	  
-	  if ((j >= gfrom) && (j < gto)) {
-	    npartner[j]++;
-	  }
-	}
+        if (touch[jj]) {
+          j = jlist[jj];
+          j &= NEIGHMASK;
+          shear = &allshear[3*jj];
+
+          if ((i >= lfrom) && (i < lto)) {
+            if (npartner[i] < MAXTOUCH) {
+              m = npartner[i];
+              partner[i][m] = tag[j];
+              shearpartner[i][m][0] = shear[0];
+              shearpartner[i][m][1] = shear[1];
+              shearpartner[i][m][2] = shear[2];
+            }
+            npartner[i]++;
+          }
+
+          if ((j >= lfrom) && (j < lto)) {
+            if (npartner[j] < MAXTOUCH) {
+              m = npartner[j];
+              partner[j][m] = tag[i];
+              shearpartner[j][m][0] = -shear[0];
+              shearpartner[j][m][1] = -shear[1];
+              shearpartner[j][m][2] = -shear[2];
+            }
+            npartner[j]++;
+          }
+
+          if ((j >= gfrom) && (j < gto)) {
+            npartner[j]++;
+          }
+        }
       }
     }
-  
+
     // test for too many touching neighbors
     int myflag = 0;
     for (i = lfrom; i < lto; i++)
       if (npartner[i] >= MAXTOUCH) myflag = 1;
-  
+
     if (myflag)
 #if defined(_OPENMP)
 #pragma omp atomic
diff --git a/src/USER-OMP/fix_shear_history_omp.h b/src/USER-OMP/fix_shear_history_omp.h
index 9a360b7923..aa581ff6a7 100644
--- a/src/USER-OMP/fix_shear_history_omp.h
+++ b/src/USER-OMP/fix_shear_history_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/fix_wall_gran_omp.cpp b/src/USER-OMP/fix_wall_gran_omp.cpp
index 5b38d41159..030bf12679 100644
--- a/src/USER-OMP/fix_wall_gran_omp.cpp
+++ b/src/USER-OMP/fix_wall_gran_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -81,7 +81,7 @@ void FixWallGranOMP::post_force(int vflag)
   int i;
 #if defined(_OPENMP)
 #pragma omp parallel for private(i) default(none) firstprivate(vwall,wlo,whi)
-#endif  
+#endif
   for (i = 0; i < nlocal; i++) {
 
     if (mask[i] & groupbit) {
@@ -90,53 +90,53 @@ void FixWallGranOMP::post_force(int vflag)
       dx = dy = dz = 0.0;
 
       if (wallstyle == XPLANE) {
-	del1 = x[i][0] - wlo;
-	del2 = whi - x[i][0];
-	if (del1 < del2) dx = del1;
-	else dx = -del2;
+        del1 = x[i][0] - wlo;
+        del2 = whi - x[i][0];
+        if (del1 < del2) dx = del1;
+        else dx = -del2;
       } else if (wallstyle == YPLANE) {
-	del1 = x[i][1] - wlo;
-	del2 = whi - x[i][1];
-	if (del1 < del2) dy = del1;
-	else dy = -del2;
+        del1 = x[i][1] - wlo;
+        del2 = whi - x[i][1];
+        if (del1 < del2) dy = del1;
+        else dy = -del2;
       } else if (wallstyle == ZPLANE) {
-	del1 = x[i][2] - wlo;
-	del2 = whi - x[i][2];
-	if (del1 < del2) dz = del1;
-	else dz = -del2;
+        del1 = x[i][2] - wlo;
+        del2 = whi - x[i][2];
+        if (del1 < del2) dz = del1;
+        else dz = -del2;
       } else if (wallstyle == ZCYLINDER) {
         delxy = sqrt(x[i][0]*x[i][0] + x[i][1]*x[i][1]);
-	delr = cylradius - delxy;
-	if (delr > radius[i]) dz = cylradius;
-	else {
-	  dx = -delr/delxy * x[i][0];
-	  dy = -delr/delxy * x[i][1];
-	  if (wshear && axis != 2) {
-	    vwall[0] = vshear * x[i][1]/delxy;
-	    vwall[1] = -vshear * x[i][0]/delxy;
-	    vwall[2] = 0.0;
-	  }
-	}
+        delr = cylradius - delxy;
+        if (delr > radius[i]) dz = cylradius;
+        else {
+          dx = -delr/delxy * x[i][0];
+          dy = -delr/delxy * x[i][1];
+          if (wshear && axis != 2) {
+            vwall[0] = vshear * x[i][1]/delxy;
+            vwall[1] = -vshear * x[i][0]/delxy;
+            vwall[2] = 0.0;
+          }
+        }
       }
 
       rsq = dx*dx + dy*dy + dz*dz;
 
       if (rsq > radius[i]*radius[i]) {
-	if (pairstyle != HOOKE) {
-	  shear[i][0] = 0.0;
-	  shear[i][1] = 0.0;
-	  shear[i][2] = 0.0;
-	}
+        if (pairstyle != HOOKE) {
+          shear[i][0] = 0.0;
+          shear[i][1] = 0.0;
+          shear[i][2] = 0.0;
+        }
       } else {
-	if (pairstyle == HOOKE)
-	  hooke(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
-		radius[i],rmass[i]);
-	else if (pairstyle == HOOKE_HISTORY)
-	  hooke_history(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
-			radius[i],rmass[i],shear[i]);
-	else if (pairstyle == HERTZ_HISTORY)
-	  hertz_history(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
-			radius[i],rmass[i],shear[i]);
+        if (pairstyle == HOOKE)
+          hooke(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
+                radius[i],rmass[i]);
+        else if (pairstyle == HOOKE_HISTORY)
+          hooke_history(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
+                        radius[i],rmass[i],shear[i]);
+        else if (pairstyle == HERTZ_HISTORY)
+          hertz_history(rsq,dx,dy,dz,vwall,v[i],f[i],omega[i],torque[i],
+                        radius[i],rmass[i],shear[i]);
       }
     }
   }
@@ -150,4 +150,3 @@ void FixWallGranOMP::post_force_respa(int vflag, int ilevel, int iloop)
 {
   if (ilevel == nlevels_respa-1) post_force(vflag);
 }
-
diff --git a/src/USER-OMP/fix_wall_gran_omp.h b/src/USER-OMP/fix_wall_gran_omp.h
index cfdfb9c75d..cd26a7b40a 100644
--- a/src/USER-OMP/fix_wall_gran_omp.h
+++ b/src/USER-OMP/fix_wall_gran_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/improper_class2_omp.cpp b/src/USER-OMP/improper_class2_omp.cpp
index 4204502396..0a4758f55e 100644
--- a/src/USER-OMP/improper_class2_omp.cpp
+++ b/src/USER-OMP/improper_class2_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,11 +64,11 @@ void ImproperClass2OMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -104,7 +104,7 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
   double fabcd[4][3];
 
   eimproper = 0.0;
- 
+
   const double * const * const x = atom->x;
   double * const * const f = thr->get_f();
   const int * const * const improperlist = neighbor->improperlist;
@@ -113,10 +113,10 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
   for (i = 0; i < 3; i++)
     for (j = 0; j < 4; j++)
       for (k = 0; k < 3; k++) {
-	dthetadr[i][j][k] = 0.0;
-	drAB[i][j][k] = 0.0;
-	drCB[i][j][k] = 0.0;
-	drDB[i][j][k] = 0.0;
+        dthetadr[i][j][k] = 0.0;
+        drAB[i][j][k] = 0.0;
+        drCB[i][j][k] = 0.0;
+        drDB[i][j][k] = 0.0;
       }
 
   for (n = nfrom; n < nto; n++) {
@@ -148,42 +148,42 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     // bond lengths and associated values
 
     for (i = 0; i < 3; i++) {
-      rmag2[i] = delr[i][0]*delr[i][0] + delr[i][1]*delr[i][1] + 
-	delr[i][2]*delr[i][2];
+      rmag2[i] = delr[i][0]*delr[i][0] + delr[i][1]*delr[i][1] +
+        delr[i][2]*delr[i][2];
       rmag[i] = sqrt(rmag2[i]);
       rinvmag[i] = 1.0/rmag[i];
     }
 
     // angle ABC, CBD, ABD
 
-    costheta[0] = (delr[0][0]*delr[1][0] + delr[0][1]*delr[1][1] +  
-		   delr[0][2]*delr[1][2]) / (rmag[0]*rmag[1]);
-    costheta[1] = (delr[1][0]*delr[2][0] + delr[1][1]*delr[2][1] + 
-		   delr[1][2]*delr[2][2]) / (rmag[1]*rmag[2]);
-    costheta[2] = (delr[0][0]*delr[2][0] + delr[0][1]*delr[2][1] + 
-		   delr[0][2]*delr[2][2]) / (rmag[0]*rmag[2]);
+    costheta[0] = (delr[0][0]*delr[1][0] + delr[0][1]*delr[1][1] +
+                   delr[0][2]*delr[1][2]) / (rmag[0]*rmag[1]);
+    costheta[1] = (delr[1][0]*delr[2][0] + delr[1][1]*delr[2][1] +
+                   delr[1][2]*delr[2][2]) / (rmag[1]*rmag[2]);
+    costheta[2] = (delr[0][0]*delr[2][0] + delr[0][1]*delr[2][1] +
+                   delr[0][2]*delr[2][2]) / (rmag[0]*rmag[2]);
 
     // angle error check
 
     for (i = 0; i < 3; i++) {
       if (costheta[i] == -1.0) {
-	int me = comm->me;
-	if (screen) {
-	  char str[128];
-	  sprintf(str,
-		  "Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		  me, thr->get_tid(),update->ntimestep,
-		  atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	  error->warning(FLERR,str,0);
-	  fprintf(screen,"  1st atom: %d %g %g %g\n",
-		  me,x[i1][0],x[i1][1],x[i1][2]);
-	  fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		  me,x[i2][0],x[i2][1],x[i2][2]);
-	  fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		  me,x[i3][0],x[i3][1],x[i3][2]);
-	  fprintf(screen,"  4th atom: %d %g %g %g\n",
-		  me,x[i4][0],x[i4][1],x[i4][2]);
-	}
+        int me = comm->me;
+        if (screen) {
+          char str[128];
+          sprintf(str,
+                  "Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                  me, thr->get_tid(),update->ntimestep,
+                  atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+          error->warning(FLERR,str,0);
+          fprintf(screen,"  1st atom: %d %g %g %g\n",
+                  me,x[i1][0],x[i1][1],x[i1][2]);
+          fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                  me,x[i2][0],x[i2][1],x[i2][2]);
+          fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                  me,x[i3][0],x[i3][1],x[i3][2]);
+          fprintf(screen,"  4th atom: %d %g %g %g\n",
+                  me,x[i4][0],x[i4][1],x[i4][2]);
+        }
       }
     }
 
@@ -254,19 +254,19 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++)
-	for (k = 0; k < 3; k++) {
-	  dr[i][j][k] = delr[i][k] * ddelr[i][j] / rmag[i];
-	  dinvr[i][j][k] = -dr[i][j][k] / rmag2[i];
-	}
+        for (k = 0; k < 3; k++) {
+          dr[i][j][k] = delr[i][k] * ddelr[i][j] / rmag[i];
+          dinvr[i][j][k] = -dr[i][j][k] / rmag2[i];
+        }
 
     // compute d(1 / (|r_AB| * |r_CB| * |r_DB|) / dr
     // i = atom A/B/C/D, j = X/Y/Z
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	dinv3r[i][j] = rinvmag[1] * (rinvmag[2] * dinvr[0][i][j] +
-				     rinvmag[0] * dinvr[2][i][j]) +
-	  rinvmag[2] * rinvmag[0] * dinvr[1][i][j];
+        dinv3r[i][j] = rinvmag[1] * (rinvmag[2] * dinvr[0][i][j] +
+                                     rinvmag[0] * dinvr[2][i][j]) +
+          rinvmag[2] * rinvmag[0] * dinvr[1][i][j];
 
     // compute d(theta)/d(r) for 3 angles
     // angleABC
@@ -275,30 +275,30 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     tt3 = costheta[0] / rmag2[1];
     sc1 = 1.0 / sqrt(1.0 - cossqtheta[0]);
 
-    dthetadr[0][0][0] = sc1 * ((tt1 * delr[0][0]) - 
-			       (delr[1][0] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][0][1] = sc1 * ((tt1 * delr[0][1]) - 
-			       (delr[1][1] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][0][2] = sc1 * ((tt1 * delr[0][2]) - 
-			       (delr[1][2] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][1][0] = -sc1 * ((tt1 * delr[0][0]) - 
-				(delr[1][0] * rinvmag[0] * rinvmag[1]) +
-				(tt3 * delr[1][0]) - 
-				(delr[0][0] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][1][1] = -sc1 * ((tt1 * delr[0][1]) - 
-				(delr[1][1] * rinvmag[0] * rinvmag[1]) +
-				(tt3 * delr[1][1]) - 
-				(delr[0][1] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][1][2] = -sc1 * ((tt1 * delr[0][2]) - 
-				(delr[1][2] * rinvmag[0] * rinvmag[1]) +
-				(tt3 * delr[1][2]) - 
-				(delr[0][2] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][2][0] = sc1 * ((tt3 * delr[1][0]) - 
-			       (delr[0][0] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][2][1] = sc1 * ((tt3 * delr[1][1]) - 
-			       (delr[0][1] * rinvmag[0] * rinvmag[1]));
-    dthetadr[0][2][2] = sc1 * ((tt3 * delr[1][2]) - 
-			       (delr[0][2] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][0][0] = sc1 * ((tt1 * delr[0][0]) -
+                               (delr[1][0] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][0][1] = sc1 * ((tt1 * delr[0][1]) -
+                               (delr[1][1] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][0][2] = sc1 * ((tt1 * delr[0][2]) -
+                               (delr[1][2] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][1][0] = -sc1 * ((tt1 * delr[0][0]) -
+                                (delr[1][0] * rinvmag[0] * rinvmag[1]) +
+                                (tt3 * delr[1][0]) -
+                                (delr[0][0] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][1][1] = -sc1 * ((tt1 * delr[0][1]) -
+                                (delr[1][1] * rinvmag[0] * rinvmag[1]) +
+                                (tt3 * delr[1][1]) -
+                                (delr[0][1] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][1][2] = -sc1 * ((tt1 * delr[0][2]) -
+                                (delr[1][2] * rinvmag[0] * rinvmag[1]) +
+                                (tt3 * delr[1][2]) -
+                                (delr[0][2] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][2][0] = sc1 * ((tt3 * delr[1][0]) -
+                               (delr[0][0] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][2][1] = sc1 * ((tt3 * delr[1][1]) -
+                               (delr[0][1] * rinvmag[0] * rinvmag[1]));
+    dthetadr[0][2][2] = sc1 * ((tt3 * delr[1][2]) -
+                               (delr[0][2] * rinvmag[0] * rinvmag[1]));
 
     // angleCBD
 
@@ -306,30 +306,30 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     tt3 = costheta[1] / rmag2[2];
     sc1 = 1.0 / sqrt(1.0 - cossqtheta[1]);
 
-    dthetadr[1][2][0] = sc1 * ((tt1 * delr[1][0]) - 
-			       (delr[2][0] * rinvmag[1] * rinvmag[2]));
-    dthetadr[1][2][1] = sc1 * ((tt1 * delr[1][1]) - 
-			       (delr[2][1] * rinvmag[1] * rinvmag[2]));
-    dthetadr[1][2][2] = sc1 * ((tt1 * delr[1][2]) - 
-			       (delr[2][2] * rinvmag[1] * rinvmag[2]));
-    dthetadr[1][1][0] = -sc1 * ((tt1 * delr[1][0]) - 
-				(delr[2][0] * rinvmag[1] * rinvmag[2]) +
-				(tt3 * delr[2][0]) - 
-				(delr[1][0] * rinvmag[2] * rinvmag[1]));
-    dthetadr[1][1][1] = -sc1 * ((tt1 * delr[1][1]) - 
-				(delr[2][1] * rinvmag[1] * rinvmag[2]) +
-				(tt3 * delr[2][1]) - 
-				(delr[1][1] * rinvmag[2] * rinvmag[1]));
-    dthetadr[1][1][2] = -sc1 * ((tt1 * delr[1][2]) - 
-				(delr[2][2] * rinvmag[1] * rinvmag[2]) +
-				(tt3 * delr[2][2]) - 
-				(delr[1][2] * rinvmag[2] * rinvmag[1]));
-    dthetadr[1][3][0] = sc1 * ((tt3 * delr[2][0]) - 
-			       (delr[1][0] * rinvmag[2] * rinvmag[1]));
-    dthetadr[1][3][1] = sc1 * ((tt3 * delr[2][1]) - 
-			       (delr[1][1] * rinvmag[2] * rinvmag[1]));
-    dthetadr[1][3][2] = sc1 * ((tt3 * delr[2][2]) - 
-			       (delr[1][2] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][2][0] = sc1 * ((tt1 * delr[1][0]) -
+                               (delr[2][0] * rinvmag[1] * rinvmag[2]));
+    dthetadr[1][2][1] = sc1 * ((tt1 * delr[1][1]) -
+                               (delr[2][1] * rinvmag[1] * rinvmag[2]));
+    dthetadr[1][2][2] = sc1 * ((tt1 * delr[1][2]) -
+                               (delr[2][2] * rinvmag[1] * rinvmag[2]));
+    dthetadr[1][1][0] = -sc1 * ((tt1 * delr[1][0]) -
+                                (delr[2][0] * rinvmag[1] * rinvmag[2]) +
+                                (tt3 * delr[2][0]) -
+                                (delr[1][0] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][1][1] = -sc1 * ((tt1 * delr[1][1]) -
+                                (delr[2][1] * rinvmag[1] * rinvmag[2]) +
+                                (tt3 * delr[2][1]) -
+                                (delr[1][1] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][1][2] = -sc1 * ((tt1 * delr[1][2]) -
+                                (delr[2][2] * rinvmag[1] * rinvmag[2]) +
+                                (tt3 * delr[2][2]) -
+                                (delr[1][2] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][3][0] = sc1 * ((tt3 * delr[2][0]) -
+                               (delr[1][0] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][3][1] = sc1 * ((tt3 * delr[2][1]) -
+                               (delr[1][1] * rinvmag[2] * rinvmag[1]));
+    dthetadr[1][3][2] = sc1 * ((tt3 * delr[2][2]) -
+                               (delr[1][2] * rinvmag[2] * rinvmag[1]));
 
     // angleABD
 
@@ -337,30 +337,30 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     tt3 = costheta[2] / rmag2[2];
     sc1 = 1.0 / sqrt(1.0 - cossqtheta[2]);
 
-    dthetadr[2][0][0] = sc1 * ((tt1 * delr[0][0]) - 
-			       (delr[2][0] * rinvmag[0] * rinvmag[2]));
-    dthetadr[2][0][1] = sc1 * ((tt1 * delr[0][1]) - 
-			       (delr[2][1] * rinvmag[0] * rinvmag[2]));
-    dthetadr[2][0][2] = sc1 * ((tt1 * delr[0][2]) - 
-			       (delr[2][2] * rinvmag[0] * rinvmag[2]));
-    dthetadr[2][1][0] = -sc1 * ((tt1 * delr[0][0]) - 
-				(delr[2][0] * rinvmag[0] * rinvmag[2]) +
-				(tt3 * delr[2][0]) - 
-				(delr[0][0] * rinvmag[2] * rinvmag[0]));
-    dthetadr[2][1][1] = -sc1 * ((tt1 * delr[0][1]) - 
-				(delr[2][1] * rinvmag[0] * rinvmag[2]) +
-				(tt3 * delr[2][1]) - 
-				(delr[0][1] * rinvmag[2] * rinvmag[0]));
-    dthetadr[2][1][2] = -sc1 * ((tt1 * delr[0][2]) - 
-				(delr[2][2] * rinvmag[0] * rinvmag[2]) +
-				(tt3 * delr[2][2]) - 
-				(delr[0][2] * rinvmag[2] * rinvmag[0]));
-    dthetadr[2][3][0] = sc1 * ((tt3 * delr[2][0]) - 
-			       (delr[0][0] * rinvmag[2] * rinvmag[0]));
-    dthetadr[2][3][1] = sc1 * ((tt3 * delr[2][1]) - 
-			       (delr[0][1] * rinvmag[2] * rinvmag[0]));
-    dthetadr[2][3][2] = sc1 * ((tt3 * delr[2][2]) - 
-			       (delr[0][2] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][0][0] = sc1 * ((tt1 * delr[0][0]) -
+                               (delr[2][0] * rinvmag[0] * rinvmag[2]));
+    dthetadr[2][0][1] = sc1 * ((tt1 * delr[0][1]) -
+                               (delr[2][1] * rinvmag[0] * rinvmag[2]));
+    dthetadr[2][0][2] = sc1 * ((tt1 * delr[0][2]) -
+                               (delr[2][2] * rinvmag[0] * rinvmag[2]));
+    dthetadr[2][1][0] = -sc1 * ((tt1 * delr[0][0]) -
+                                (delr[2][0] * rinvmag[0] * rinvmag[2]) +
+                                (tt3 * delr[2][0]) -
+                                (delr[0][0] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][1][1] = -sc1 * ((tt1 * delr[0][1]) -
+                                (delr[2][1] * rinvmag[0] * rinvmag[2]) +
+                                (tt3 * delr[2][1]) -
+                                (delr[0][1] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][1][2] = -sc1 * ((tt1 * delr[0][2]) -
+                                (delr[2][2] * rinvmag[0] * rinvmag[2]) +
+                                (tt3 * delr[2][2]) -
+                                (delr[0][2] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][3][0] = sc1 * ((tt3 * delr[2][0]) -
+                               (delr[0][0] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][3][1] = sc1 * ((tt3 * delr[2][1]) -
+                               (delr[0][1] * rinvmag[2] * rinvmag[0]));
+    dthetadr[2][3][2] = sc1 * ((tt3 * delr[2][2]) -
+                               (delr[0][2] * rinvmag[2] * rinvmag[0]));
 
     // compute d( 1 / sin(theta))/dr
     // i = angle, j = atom, k = direction
@@ -368,8 +368,8 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
     for (i = 0; i < 3; i++) {
       cossin2 = -costheta[i] / sinsqtheta[i];
       for (j = 0; j < 4; j++)
-	for (k = 0; k < 3; k++)
-	  dinvsth[i][j][k] = cossin2 * dthetadr[i][j][k];
+        for (k = 0; k < 3; k++)
+          dinvsth[i][j][k] = cossin2 * dthetadr[i][j][k];
     }
 
     // compute d(1 / sin(theta) * |r_AB| * |r_CB| * |r_DB|)/dr
@@ -377,12 +377,12 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++) {
-	dinvs3r[0][i][j] = (invstheta[1] * dinv3r[i][j]) +
-	  (inv3r * dinvsth[1][i][j]);
-	dinvs3r[1][i][j] = (invstheta[2] * dinv3r[i][j]) +
-	  (inv3r * dinvsth[2][i][j]);
-	dinvs3r[2][i][j] = (invstheta[0] * dinv3r[i][j]) +
-	  (inv3r * dinvsth[0][i][j]);
+        dinvs3r[0][i][j] = (invstheta[1] * dinv3r[i][j]) +
+          (inv3r * dinvsth[1][i][j]);
+        dinvs3r[1][i][j] = (invstheta[2] * dinv3r[i][j]) +
+          (inv3r * dinvsth[2][i][j]);
+        dinvs3r[2][i][j] = (invstheta[0] * dinv3r[i][j]) +
+          (inv3r * dinvsth[0][i][j]);
       }
 
     // drCB(i,j,k), etc
@@ -406,12 +406,12 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++) {
-	cross(delr[1],drDB[i][j],rCBxdrDB);
-	cross(drCB[i][j],delr[2],drCBxrDB);
-	for (k = 0; k < 3; k++) dd[k] = rCBxdrDB[k] + drCBxrDB[k];
-	dot1 = dot(dd,delr[0]);
-	dot2 = dot(rCBxrDB,drAB[i][j]);
-	fdot[0][j][i] = dot1 + dot2;
+        cross(delr[1],drDB[i][j],rCBxdrDB);
+        cross(drCB[i][j],delr[2],drCBxrDB);
+        for (k = 0; k < 3; k++) dd[k] = rCBxdrDB[k] + drCBxrDB[k];
+        dot1 = dot(dd,delr[0]);
+        dot2 = dot(rCBxrDB,drAB[i][j]);
+        fdot[0][j][i] = dot1 + dot2;
       }
 
     // d((r_DB x r_AB) dot r_CB)
@@ -423,12 +423,12 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++) {
-	cross(delr[2],drAB[i][j],rDBxdrAB);
-	cross(drDB[i][j],delr[0],drDBxrAB);
-	for (k = 0; k < 3; k++) dd[k] = rDBxdrAB[k] + drDBxrAB[k];
-	dot1 = dot(dd,delr[1]);
-	dot2 = dot(rDBxrAB,drCB[i][j]);
-	fdot[1][j][i] = dot1 + dot2;
+        cross(delr[2],drAB[i][j],rDBxdrAB);
+        cross(drDB[i][j],delr[0],drDBxrAB);
+        for (k = 0; k < 3; k++) dd[k] = rDBxdrAB[k] + drDBxrAB[k];
+        dot1 = dot(dd,delr[1]);
+        dot2 = dot(rDBxrAB,drCB[i][j]);
+        fdot[1][j][i] = dot1 + dot2;
       }
 
     // d((r_AB x r_CB) dot r_DB)
@@ -440,33 +440,33 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++) {
-	cross(delr[0],drCB[i][j],rABxdrCB);
-	cross(drAB[i][j],delr[1],drABxrCB);
-	for (k = 0; k < 3; k++) dd[k] = rABxdrCB[k] + drABxrCB[k];
-	dot1 = dot(dd,delr[2]);
-	dot2 = dot(rABxrCB,drDB[i][j]);
-	fdot[2][j][i] = dot1 + dot2;
+        cross(delr[0],drCB[i][j],rABxdrCB);
+        cross(drAB[i][j],delr[1],drABxrCB);
+        for (k = 0; k < 3; k++) dd[k] = rABxdrCB[k] + drABxrCB[k];
+        dot1 = dot(dd,delr[2]);
+        dot2 = dot(rABxrCB,drDB[i][j]);
+        fdot[2][j][i] = dot1 + dot2;
       }
 
     // force on each atom
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++) {
-	ftmp = (fdot[0][i][j] * invs3r[0]) + 
-	  (dinvs3r[0][i][j] * dotCBDBAB);
-	dchi[0][i][j] = ftmp / cos(chiABCD);
-	ftmp = (fdot[1][i][j] * invs3r[1]) + 
-	  (dinvs3r[1][i][j] * dotDBABCB);
-	dchi[1][i][j] = ftmp / cos(chiCBDA);
-	ftmp = (fdot[2][i][j] * invs3r[2]) + 
-	  (dinvs3r[2][i][j] * dotABCBDB);
-	dchi[2][i][j] = ftmp / cos(chiDBAC);
-	dtotalchi[i][j] = (dchi[0][i][j]+dchi[1][i][j]+dchi[2][i][j]) / 3.0;
+        ftmp = (fdot[0][i][j] * invs3r[0]) +
+          (dinvs3r[0][i][j] * dotCBDBAB);
+        dchi[0][i][j] = ftmp / cos(chiABCD);
+        ftmp = (fdot[1][i][j] * invs3r[1]) +
+          (dinvs3r[1][i][j] * dotDBABCB);
+        dchi[1][i][j] = ftmp / cos(chiCBDA);
+        ftmp = (fdot[2][i][j] * invs3r[2]) +
+          (dinvs3r[2][i][j] * dotABCBDB);
+        dchi[2][i][j] = ftmp / cos(chiDBAC);
+        dtotalchi[i][j] = (dchi[0][i][j]+dchi[1][i][j]+dchi[2][i][j]) / 3.0;
       }
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] = -2.0*k0[type] * deltachi*dtotalchi[i][j];
+        fabcd[i][j] = -2.0*k0[type] * deltachi*dtotalchi[i][j];
 
     // apply force to each of 4 atoms
 
@@ -496,11 +496,11 @@ void ImproperClass2OMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,eimproper,
-		   fabcd[0],fabcd[2],fabcd[3],
-		   delr[0][0],delr[0][1],delr[0][2],
-		   delr[1][0],delr[1][1],delr[1][2],
-		   delr[2][0]-delr[1][0],delr[2][1]-delr[1][1],
-		   delr[2][2]-delr[1][2],thr);
+                   fabcd[0],fabcd[2],fabcd[3],
+                   delr[0][0],delr[0][1],delr[0][2],
+                   delr[1][0],delr[1][1],delr[1][2],
+                   delr[2][0]-delr[1][0],delr[2][1]-delr[1][1],
+                   delr[2][2]-delr[1][2],thr);
   }
 
   // compute angle-angle interactions
@@ -562,7 +562,7 @@ void ImproperClass2OMP::angleangle_thr(int nfrom, int nto, ThrData * const thr)
     rBC = sqrt(rBCmag2);
     rBDmag2 = delxBD*delxBD + delyBD*delyBD + delzBD*delzBD;
     rBD = sqrt(rBDmag2);
-        
+
     // angle ABC, ABD, CBD
 
     costhABC = (delxAB*delxBC + delyAB*delyBC + delzAB*delzBC) / (rAB * rBC);
@@ -586,17 +586,17 @@ void ImproperClass2OMP::angleangle_thr(int nfrom, int nto, ThrData * const thr)
 
     // energy
 
-    if (EFLAG) eimproper = aa_k2[type] * dthABC * dthABD + 
-		 aa_k1[type] * dthABC * dthCBD +
-		 aa_k3[type] * dthABD * dthCBD;
+    if (EFLAG) eimproper = aa_k2[type] * dthABC * dthABD +
+                 aa_k1[type] * dthABC * dthCBD +
+                 aa_k3[type] * dthABD * dthCBD;
 
     // d(theta)/d(r) array
     // angle i, atom j, coordinate k
 
     for (i = 0; i < 3; i++)
       for (j = 0; j < 4; j++)
-	for (k = 0; k < 3; k++)
-	  dthetadr[i][j][k] = 0.0;
+        for (k = 0; k < 3; k++)
+          dthetadr[i][j][k] = 0.0;
 
     // angle ABC
 
@@ -609,11 +609,11 @@ void ImproperClass2OMP::angleangle_thr(int nfrom, int nto, ThrData * const thr)
     dthetadr[0][0][1] = sc1 * ((t1 * delyAB) - (delyBC * r12));
     dthetadr[0][0][2] = sc1 * ((t1 * delzAB) - (delzBC * r12));
     dthetadr[0][1][0] = sc1 * ((-t1 * delxAB) + (delxBC * r12) +
-			       (-t3 * delxBC) + (delxAB * r12));
+                               (-t3 * delxBC) + (delxAB * r12));
     dthetadr[0][1][1] = sc1 * ((-t1 * delyAB) + (delyBC * r12) +
-			       (-t3 * delyBC) + (delyAB * r12));
+                               (-t3 * delyBC) + (delyAB * r12));
     dthetadr[0][1][2] = sc1 * ((-t1 * delzAB) + (delzBC * r12) +
-			       (-t3 * delzBC) + (delzAB * r12));
+                               (-t3 * delzBC) + (delzAB * r12));
     dthetadr[0][2][0] = sc1 * ((t3 * delxBC) - (delxAB * r12));
     dthetadr[0][2][1] = sc1 * ((t3 * delyBC) - (delyAB * r12));
     dthetadr[0][2][2] = sc1 * ((t3 * delzBC) - (delzAB * r12));
@@ -629,11 +629,11 @@ void ImproperClass2OMP::angleangle_thr(int nfrom, int nto, ThrData * const thr)
     dthetadr[1][2][1] = sc1 * ((t1 * delyBC) - (delyBD * r12));
     dthetadr[1][2][2] = sc1 * ((t1 * delzBC) - (delzBD * r12));
     dthetadr[1][1][0] = sc1 * ((-t1 * delxBC) + (delxBD * r12) +
-			       (-t3 * delxBD) + (delxBC * r12));
+                               (-t3 * delxBD) + (delxBC * r12));
     dthetadr[1][1][1] = sc1 * ((-t1 * delyBC) + (delyBD * r12) +
-			       (-t3 * delyBD) + (delyBC * r12));
+                               (-t3 * delyBD) + (delyBC * r12));
     dthetadr[1][1][2] = sc1 * ((-t1 * delzBC) + (delzBD * r12) +
-			       (-t3 * delzBD) + (delzBC * r12));
+                               (-t3 * delzBD) + (delzBC * r12));
     dthetadr[1][3][0] = sc1 * ((t3 * delxBD) - (delxBC * r12));
     dthetadr[1][3][1] = sc1 * ((t3 * delyBD) - (delyBC * r12));
     dthetadr[1][3][2] = sc1 * ((t3 * delzBD) - (delzBC * r12));
@@ -649,11 +649,11 @@ void ImproperClass2OMP::angleangle_thr(int nfrom, int nto, ThrData * const thr)
     dthetadr[2][0][1] = sc1 * ((t1 * delyAB) - (delyBD * r12));
     dthetadr[2][0][2] = sc1 * ((t1 * delzAB) - (delzBD * r12));
     dthetadr[2][1][0] = sc1 * ((-t1 * delxAB) + (delxBD * r12) +
-			       (-t3 * delxBD) + (delxAB * r12));
+                               (-t3 * delxBD) + (delxAB * r12));
     dthetadr[2][1][1] = sc1 * ((-t1 * delyAB) + (delyBD * r12) +
-			       (-t3 * delyBD) + (delyAB * r12));
+                               (-t3 * delyBD) + (delyAB * r12));
     dthetadr[2][1][2] = sc1 * ((-t1 * delzAB) + (delzBD * r12) +
-			       (-t3 * delzBD) + (delzAB * r12));
+                               (-t3 * delzBD) + (delzAB * r12));
     dthetadr[2][3][0] = sc1 * ((t3 * delxBD) - (delxAB * r12));
     dthetadr[2][3][1] = sc1 * ((t3 * delyBD) - (delyAB * r12));
     dthetadr[2][3][2] = sc1 * ((t3 * delzBD) - (delzAB * r12));
@@ -662,13 +662,13 @@ void ImproperClass2OMP::angleangle_thr(int nfrom, int nto, ThrData * const thr)
 
     for (i = 0; i < 4; i++)
       for (j = 0; j < 3; j++)
-	fabcd[i][j] = - 
-	  ((aa_k1[type] * 
-	    (dthABC*dthetadr[1][i][j] + dthCBD*dthetadr[0][i][j])) +
-	   (aa_k2[type] * 
-	    (dthABC*dthetadr[2][i][j] + dthABD*dthetadr[0][i][j])) +
-	   (aa_k3[type] *
-	    (dthABD*dthetadr[1][i][j] + dthCBD*dthetadr[2][i][j])));
+        fabcd[i][j] = -
+          ((aa_k1[type] *
+            (dthABC*dthetadr[1][i][j] + dthCBD*dthetadr[0][i][j])) +
+           (aa_k2[type] *
+            (dthABC*dthetadr[2][i][j] + dthABD*dthetadr[0][i][j])) +
+           (aa_k3[type] *
+            (dthABD*dthetadr[1][i][j] + dthCBD*dthetadr[2][i][j])));
 
     // apply force to each of 4 atoms
 
@@ -698,7 +698,7 @@ void ImproperClass2OMP::angleangle_thr(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,eimproper,
-		   fabcd[0],fabcd[2],fabcd[3],delxAB,delyAB,delzAB,
-		   delxBC,delyBC,delzBC,delxBD,delyBD,delzBD,thr);
+                   fabcd[0],fabcd[2],fabcd[3],delxAB,delyAB,delzAB,
+                   delxBC,delyBC,delzBC,delxBD,delyBD,delzBD,thr);
   }
 }
diff --git a/src/USER-OMP/improper_class2_omp.h b/src/USER-OMP/improper_class2_omp.h
index 8eca8cd8c1..6f668a0078 100644
--- a/src/USER-OMP/improper_class2_omp.h
+++ b/src/USER-OMP/improper_class2_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -41,7 +41,7 @@ class ImproperClass2OMP : public ImproperClass2, public ThrOMP {
 
   template <int EVFLAG, int EFLAG, int NEWTON_BOND>
   void angleangle_thr(int, int, ThrData * const thr);
-  
+
 };
 
 }
diff --git a/src/USER-OMP/improper_cossq_omp.cpp b/src/USER-OMP/improper_cossq_omp.cpp
index b7ddd2e59c..1e1b53eaf7 100644
--- a/src/USER-OMP/improper_cossq_omp.cpp
+++ b/src/USER-OMP/improper_cossq_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,11 +64,11 @@ void ImproperCossqOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -125,43 +125,43 @@ void ImproperCossqOMP::eval(int nfrom, int nto, ThrData * const thr)
     rlk = sqrt(rlksq);
 
     cosphi = (vb3x*vb1x + vb3y*vb1y + vb3z*vb1z)/(rji * rlk);
-     
-    /* Check that cos(phi) is in the correct limits. */     
+
+    /* Check that cos(phi) is in the correct limits. */
     if (cosphi > 1.0 + TOLERANCE || cosphi < (-1.0 - TOLERANCE)) {
       int me = comm->me;
 
       if (screen) {
-	char str[128];
-	sprintf(str,"Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		me,thr->get_tid(),update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                me,thr->get_tid(),update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
 
-      
+
       /* Apply corrections to round-off errors. */
       if (cosphi > 1.0)  cosphi -= SMALL;
       if (cosphi < -1.0) cosphi += SMALL;
-      
+
       /* Calculate the angle: */
       double torangle = acos(cosphi);
       cosphi = cos(torangle - chi[type]);
 
       if (EFLAG) eimproper = 0.5 * k[type] * cosphi * cosphi;
-     
+
       /*
-	printf("The tags: %d-%d-%d-%d, of type %d .\n",atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4],type);   
-	printf("The ji vector: %f, %f, %f.\nThe lk vector: %f, %f, %f.\n", vb1x,vb1y,vb1z,vb3x,vb3y,vb3z);
-	printf("The cosine of the angle: %-1.16e.\n", cosphi);
-	printf("The energy of the improper: %-1.16e with prefactor %-1.16e.\n", eimproper, 0.5*k[type]);
+        printf("The tags: %d-%d-%d-%d, of type %d .\n",atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4],type);
+        printf("The ji vector: %f, %f, %f.\nThe lk vector: %f, %f, %f.\n", vb1x,vb1y,vb1z,vb3x,vb3y,vb3z);
+        printf("The cosine of the angle: %-1.16e.\n", cosphi);
+        printf("The energy of the improper: %-1.16e with prefactor %-1.16e.\n", eimproper, 0.5*k[type]);
       */
 
       /* Work out forces. */
@@ -170,11 +170,11 @@ void ImproperCossqOMP::eval(int nfrom, int nto, ThrData * const thr)
       cjiji = rjisq;
       clklk = rlksq;
       /*CLKJI = RXLK * RXJI + RYLK * RYJI + RZLK * RZJI */
-      clkji = vb3x*vb1x + vb3y*vb1y + vb3z*vb1z; 
+      clkji = vb3x*vb1x + vb3y*vb1y + vb3z*vb1z;
 
       /*CFACT1 = CLKLK * CJIJI
-	CFACT1 = SQRT(CFACT1)
-	CFACT1 = ANGFAC / CFACT1*/
+        CFACT1 = SQRT(CFACT1)
+        CFACT1 = ANGFAC / CFACT1*/
       cfact1 = angfac / sqrt(clklk * cjiji);
       /*CFACT2 = CLKJI / CLKLK*/
       cfact2 = clkji / clklk;
@@ -182,90 +182,89 @@ void ImproperCossqOMP::eval(int nfrom, int nto, ThrData * const thr)
       cfact3 = clkji / cjiji;
 
       /*FIX = -RXLK + CFACT3 * RXJI
-	FIY = -RYLK + CFACT3 * RYJI
-	FIZ = -RZLK + CFACT3 * RZJI*/
+        FIY = -RYLK + CFACT3 * RYJI
+        FIZ = -RZLK + CFACT3 * RZJI*/
       f1[0] = - vb3x + cfact3 * vb1x;
       f1[1] = - vb3y + cfact3 * vb1y;
       f1[2] = - vb3z + cfact3 * vb1z;
 
       /*FJX = -FIX
-	FJY = -FIY
-	FJZ = -FIZ*/
+        FJY = -FIY
+        FJZ = -FIZ*/
       f2[0] = - f1[0];
       f2[1] = - f1[1];
       f2[2] = - f1[2];
-      
+
       /*FKX = CFACT2 * RXLK - RXJI
-	FKY = CFACT2 * RYLK - RYJI
-	FKZ = CFACT2 * RZLK - RZJI*/
+        FKY = CFACT2 * RYLK - RYJI
+        FKZ = CFACT2 * RZLK - RZJI*/
       f3[0] = cfact2 * vb3x - vb1x;
       f3[1] = cfact2 * vb3y - vb1y;
       f3[2] = cfact2 * vb3z - vb1z;
 
       /*FLX = -FKX
-	FLY = -FKY
-	FLZ = -FKZ*/
+        FLY = -FKY
+        FLZ = -FKZ*/
       f4[0] = - f3[0];
       f4[1] = - f3[1];
       f4[2] = - f3[2];
 
       /*FIX = FIX * CFACT1
-	FIY = FIY * CFACT1
-	FIZ = FIZ * CFACT1*/
+        FIY = FIY * CFACT1
+        FIZ = FIZ * CFACT1*/
       f1[0] *= cfact1;
-      f1[1] *= cfact1; 
+      f1[1] *= cfact1;
       f1[2] *= cfact1;
 
       /*FJX = FJX * CFACT1
-	FJY = FJY * CFACT1
-	FJZ = FJZ * CFACT1*/
+        FJY = FJY * CFACT1
+        FJZ = FJZ * CFACT1*/
       f2[0] *= cfact1;
       f2[1] *= cfact1;
       f2[2] *= cfact1;
 
       /*FKX = FKX * CFACT1
-	FKY = FKY * CFACT1
-	FKZ = FKZ * CFACT1*/
-      f3[0] *= cfact1; 
-      f3[1] *= cfact1; 
+        FKY = FKY * CFACT1
+        FKZ = FKZ * CFACT1*/
+      f3[0] *= cfact1;
+      f3[1] *= cfact1;
       f3[2] *= cfact1;
 
       /*FLX = FLX * CFACT1
-	FLY = FLY * CFACT1
-	FLZ = FLZ * CFACT1*/
+        FLY = FLY * CFACT1
+        FLZ = FLZ * CFACT1*/
       f4[0] *= cfact1;
-      f4[1] *= cfact1; 
+      f4[1] *= cfact1;
       f4[2] *= cfact1;
 
       /* Apply force to each of 4 atoms */
       if (NEWTON_BOND || i1 < nlocal) {
-	f[i1][0] += f1[0];
-	f[i1][1] += f1[1];
-	f[i1][2] += f1[2];
+        f[i1][0] += f1[0];
+        f[i1][1] += f1[1];
+        f[i1][2] += f1[2];
       }
 
       if (NEWTON_BOND || i2 < nlocal) {
-	f[i2][0] += f2[0];
-	f[i2][1] += f2[1];
-	f[i2][2] += f2[2];
+        f[i2][0] += f2[0];
+        f[i2][1] += f2[1];
+        f[i2][2] += f2[2];
       }
 
       if (NEWTON_BOND || i3 < nlocal) {
-	f[i3][0] += f3[0];
-	f[i3][1] += f3[1];
-	f[i3][2] += f3[2];
+        f[i3][0] += f3[0];
+        f[i3][1] += f3[1];
+        f[i3][2] += f3[2];
       }
 
       if (NEWTON_BOND || i4 < nlocal) {
-	f[i4][0] += f4[0];
-	f[i4][1] += f4[1];
-	f[i4][2] += f4[2];
+        f[i4][0] += f4[0];
+        f[i4][1] += f4[1];
+        f[i4][2] += f4[2];
       }
 
       if (EVFLAG)
-	ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,eimproper,f1,f3,f4,
-		     -vb1x,-vb1y,-vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+        ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,eimproper,f1,f3,f4,
+                     -vb1x,-vb1y,-vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
     }
   }
 }
-
diff --git a/src/USER-OMP/improper_cossq_omp.h b/src/USER-OMP/improper_cossq_omp.h
index 4b98338cfa..8fd1bc09a0 100644
--- a/src/USER-OMP/improper_cossq_omp.h
+++ b/src/USER-OMP/improper_cossq_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/improper_cvff_omp.cpp b/src/USER-OMP/improper_cvff_omp.cpp
index 11387a76bc..fd8b4aca1d 100644
--- a/src/USER-OMP/improper_cvff_omp.cpp
+++ b/src/USER-OMP/improper_cvff_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,11 +64,11 @@ void ImproperCvffOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -131,18 +131,18 @@ void ImproperCvffOMP::eval(int nfrom, int nto, ThrData * const thr)
     domain->minimum_image(vb3x,vb3y,vb3z);
 
     // c0 calculation
-        
+
     sb1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
     sb2 = 1.0 / (vb2x*vb2x + vb2y*vb2y + vb2z*vb2z);
     sb3 = 1.0 / (vb3x*vb3x + vb3y*vb3y + vb3z*vb3z);
-        
+
     rb1 = sqrt(sb1);
     rb3 = sqrt(sb3);
-        
+
     c0 = (vb1x*vb3x + vb1y*vb3y + vb1z*vb3z) * rb1*rb3;
 
     // 1st and 2nd angle
-        
+
     b1mag2 = vb1x*vb1x + vb1y*vb1y + vb1z*vb1z;
     b1mag = sqrt(b1mag2);
     b2mag2 = vb2x*vb2x + vb2y*vb2y + vb2z*vb2z;
@@ -179,22 +179,22 @@ void ImproperCvffOMP::eval(int nfrom, int nto, ThrData * const thr)
       int me = comm->me;
 
       if (screen) {
-	char str[128];
-	sprintf(str,"Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		me,thr->get_tid(),update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                me,thr->get_tid(),update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
 
@@ -202,7 +202,7 @@ void ImproperCvffOMP::eval(int nfrom, int nto, ThrData * const thr)
     // p = 1 + cos(n*phi) for d = 1
     // p = 1 - cos(n*phi) for d = -1
     // pd = dp/dc / 2
-        
+
     m = multiplicity[type];
 
     if (m == 2) {
@@ -231,7 +231,7 @@ void ImproperCvffOMP::eval(int nfrom, int nto, ThrData * const thr)
       p = 2.0;
       pd = 0.0;
     }
-    
+
     if (sign[type] == -1) {
       p = 2.0 - p;
       pd = -pd;
@@ -297,6 +297,6 @@ void ImproperCvffOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,eimproper,f1,f3,f4,
-		   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
   }
 }
diff --git a/src/USER-OMP/improper_cvff_omp.h b/src/USER-OMP/improper_cvff_omp.h
index 912da93b5d..8ab8f1615c 100644
--- a/src/USER-OMP/improper_cvff_omp.h
+++ b/src/USER-OMP/improper_cvff_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/improper_harmonic_omp.cpp b/src/USER-OMP/improper_harmonic_omp.cpp
index 748afdd2ca..77f1a1c596 100644
--- a/src/USER-OMP/improper_harmonic_omp.cpp
+++ b/src/USER-OMP/improper_harmonic_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,11 +64,11 @@ void ImproperHarmonicOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -123,13 +123,13 @@ void ImproperHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
     ss1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
     ss2 = 1.0 / (vb2x*vb2x + vb2y*vb2y + vb2z*vb2z);
     ss3 = 1.0 / (vb3x*vb3x + vb3y*vb3y + vb3z*vb3z);
-        
+
     r1 = sqrt(ss1);
     r2 = sqrt(ss2);
     r3 = sqrt(ss3);
-        
+
     // sin and cos of angle
-        
+
     c0 = (vb1x * vb3x + vb1y * vb3y + vb1z * vb3z) * r1 * r3;
     c1 = (vb1x * vb2x + vb1y * vb2y + vb1z * vb2z) * r1 * r2;
     c2 = -(vb3x * vb2x + vb3y * vb2y + vb3z * vb2z) * r3 * r2;
@@ -151,22 +151,22 @@ void ImproperHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
       int me = comm->me;
 
       if (screen) {
-	char str[128];
-	sprintf(str,"Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		me,thr->get_tid(),update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                me,thr->get_tid(),update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) c = 1.0;
     if (c < -1.0) c = -1.0;
 
@@ -238,6 +238,6 @@ void ImproperHarmonicOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,eimproper,f1,f3,f4,
-		   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
   }
 }
diff --git a/src/USER-OMP/improper_harmonic_omp.h b/src/USER-OMP/improper_harmonic_omp.h
index 73cf6c21db..d6325016a7 100644
--- a/src/USER-OMP/improper_harmonic_omp.h
+++ b/src/USER-OMP/improper_harmonic_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/improper_ring_omp.cpp b/src/USER-OMP/improper_ring_omp.cpp
index 99ae6e532b..6f8a73c41c 100644
--- a/src/USER-OMP/improper_ring_omp.cpp
+++ b/src/USER-OMP/improper_ring_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,11 +64,11 @@ void ImproperRingOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -90,15 +90,15 @@ void ImproperRingOMP::eval(int nfrom, int nto, ThrData * const thr)
   /* Compatibility variables. */
   double vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z;
   double f1[3], f3[3], f4[3];
-   
+
   /* Actual computation variables. */
   int at1[3], at2[3], at3[3], icomb;
-  double   bvec1x[3], bvec1y[3], bvec1z[3], 
-    bvec2x[3], bvec2y[3], bvec2z[3], 
+  double   bvec1x[3], bvec1y[3], bvec1z[3],
+    bvec2x[3], bvec2y[3], bvec2z[3],
     bvec1n[3], bvec2n[3], bend_angle[3];
   double   angle_summer, angfac, cfact1, cfact2, cfact3;
   double   cjiji, ckjji, ckjkj, fix, fiy, fiz, fjx, fjy, fjz, fkx, fky, fkz;
-  
+
   eimproper = 0.0;
 
   const double * const * const x = atom->x;
@@ -106,7 +106,7 @@ void ImproperRingOMP::eval(int nfrom, int nto, ThrData * const thr)
   const int * const * const improperlist = neighbor->improperlist;
   const int nlocal = atom->nlocal;
 
-  /* A description of the potential can be found in 
+  /* A description of the potential can be found in
      Macromolecules 35, pp. 1463-1472 (2002). */
   for (n = nfrom; n < nto; n++) {
     /* Take the ids of the atoms contributing to the improper potential. */
@@ -116,9 +116,9 @@ void ImproperRingOMP::eval(int nfrom, int nto, ThrData * const thr)
     i4 = improperlist[n][3];   /* Atom "9" ... */
     type = improperlist[n][4];
 
-    /* Calculate the necessary variables for LAMMPS implementation. 
+    /* Calculate the necessary variables for LAMMPS implementation.
        if (evflag) ev_tally(i1,i2,i3,i4,nlocal,newton_bond,eimproper,f1,f3,f4,
-       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);  
+       vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z);
        Although, they are irrelevant to the calculation of the potential, we keep
        them for maximal compatibility. */
     vb1x = x[i1][0] - x[i2][0]; vb1y = x[i1][1] - x[i2][1]; vb1z = x[i1][2] - x[i2][2];
@@ -130,137 +130,137 @@ void ImproperRingOMP::eval(int nfrom, int nto, ThrData * const thr)
     vb3x = x[i4][0] - x[i3][0]; vb3y = x[i4][1] - x[i3][1]; vb3z = x[i4][2] - x[i3][2];
     domain->minimum_image(vb3x,vb3y,vb3z);
 
-  
+
     /* Pass the atom tags to form the necessary combinations. */
     at1[0] = i1; at2[0] = i2; at3[0] = i4;  /* ids: 1-2-9 */
     at1[1] = i1; at2[1] = i2; at3[1] = i3;  /* ids: 1-2-3 */
     at1[2] = i4; at2[2] = i2; at3[2] = i3;  /* ids: 9-2-3 */
-      
+
 
     /* Initialize the sum of the angles differences. */
     angle_summer = 0.0;
     /* Take a loop over the three angles, defined by each triad: */
     for (icomb = 0; icomb < 3; icomb ++) {
-         
+
       /* Bond vector connecting the first and the second atom. */
       bvec1x[icomb] = x[at2[icomb]][0] - x[at1[icomb]][0];
       bvec1y[icomb] = x[at2[icomb]][1] - x[at1[icomb]][1];
       bvec1z[icomb] = x[at2[icomb]][2] - x[at1[icomb]][2];
       domain -> minimum_image(bvec1x[icomb], bvec1y[icomb], bvec1z[icomb]);
       /* also calculate the norm of the vector: */
-      bvec1n[icomb] = sqrt(  bvec1x[icomb]*bvec1x[icomb] 
-			     + bvec1y[icomb]*bvec1y[icomb] 
-			     + bvec1z[icomb]*bvec1z[icomb]);
+      bvec1n[icomb] = sqrt(  bvec1x[icomb]*bvec1x[icomb]
+                             + bvec1y[icomb]*bvec1y[icomb]
+                             + bvec1z[icomb]*bvec1z[icomb]);
       /* Bond vector connecting the second and the third atom. */
       bvec2x[icomb] = x[at3[icomb]][0] - x[at2[icomb]][0];
       bvec2y[icomb] = x[at3[icomb]][1] - x[at2[icomb]][1];
       bvec2z[icomb] = x[at3[icomb]][2] - x[at2[icomb]][2];
       domain -> minimum_image(bvec2x[icomb], bvec2y[icomb], bvec2z[icomb]);
       /* also calculate the norm of the vector: */
-      bvec2n[icomb] = sqrt(  bvec2x[icomb]*bvec2x[icomb] 
-			     + bvec2y[icomb]*bvec2y[icomb] 
-			     + bvec2z[icomb]*bvec2z[icomb]);
-        
+      bvec2n[icomb] = sqrt(  bvec2x[icomb]*bvec2x[icomb]
+                             + bvec2y[icomb]*bvec2y[icomb]
+                             + bvec2z[icomb]*bvec2z[icomb]);
+
       /* Calculate the bending angle of the atom triad: */
-      bend_angle[icomb] = (  bvec2x[icomb]*bvec1x[icomb] 
-			     + bvec2y[icomb]*bvec1y[icomb] 
-			     + bvec2z[icomb]*bvec1z[icomb]);
+      bend_angle[icomb] = (  bvec2x[icomb]*bvec1x[icomb]
+                             + bvec2y[icomb]*bvec1y[icomb]
+                             + bvec2z[icomb]*bvec1z[icomb]);
       bend_angle[icomb] /= (bvec1n[icomb] * bvec2n[icomb]);
       if (bend_angle[icomb] >  1.0) bend_angle[icomb] -= SMALL;
       if (bend_angle[icomb] < -1.0) bend_angle[icomb] += SMALL;
 
       /* Append the current angle to the sum of angle differences. */
       angle_summer += (bend_angle[icomb] - chi[type]);
-    } 
-    if (EFLAG) eimproper = (1.0/6.0) *k[type] * pow(angle_summer,6.0); 
+    }
+    if (EFLAG) eimproper = (1.0/6.0) *k[type] * pow(angle_summer,6.0);
     /*
-      printf("The tags: %d-%d-%d-%d, of type %d .\n",atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4],type);   
+      printf("The tags: %d-%d-%d-%d, of type %d .\n",atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4],type);
       // printf("The coordinates of the first: %f, %f, %f.\n", x[i1][0], x[i1][1], x[i1][2]);
       // printf("The coordinates of the second: %f, %f, %f.\n", x[i2][0], x[i2][1], x[i2][2]);
       // printf("The coordinates of the third: %f, %f, %f.\n", x[i3][0], x[i3][1], x[i3][2]);
       // printf("The coordinates of the fourth: %f, %f, %f.\n", x[i4][0], x[i4][1], x[i4][2]);
       printf("The angles are: %f / %f / %f equilibrium: %f.\n", bend_angle[0], bend_angle[1], bend_angle[2],chi[type]);
       printf("The energy of the improper: %f with prefactor %f.\n", eimproper,(1.0/6.0)*k[type]);
-      printf("The sum of the angles: %f.\n", angle_summer); 
+      printf("The sum of the angles: %f.\n", angle_summer);
     */
 
-    /* Force calculation acting on all atoms. 
+    /* Force calculation acting on all atoms.
        Calculate the derivatives of the potential. */
     angfac = k[type] * pow(angle_summer,5.0);
 
     f1[0] = 0.0; f1[1] = 0.0; f1[2] = 0.0;
     f3[0] = 0.0; f3[1] = 0.0; f3[2] = 0.0;
-    f4[0] = 0.0; f4[1] = 0.0; f4[2] = 0.0; 
-      
+    f4[0] = 0.0; f4[1] = 0.0; f4[2] = 0.0;
+
     /* Take a loop over the three angles, defined by each triad: */
     for (icomb = 0; icomb < 3; icomb ++)
       {
-	/* Calculate the squares of the distances. */
-	cjiji = bvec1n[icomb] * bvec1n[icomb];  ckjkj = bvec2n[icomb] * bvec2n[icomb];
-         
-	ckjji =   bvec2x[icomb] * bvec1x[icomb] 
-	  + bvec2y[icomb] * bvec1y[icomb]
-	  + bvec2z[icomb] * bvec1z[icomb] ;
-         
-	cfact1 = angfac / (sqrt(ckjkj * cjiji)); 
-	cfact2 = ckjji / ckjkj;
-	cfact3 = ckjji / cjiji;
-
-	/* Calculate the force acted on the thrid atom of the angle. */
-	fkx = cfact2 * bvec2x[icomb] - bvec1x[icomb];
-	fky = cfact2 * bvec2y[icomb] - bvec1y[icomb];
-	fkz = cfact2 * bvec2z[icomb] - bvec1z[icomb];
-         
-	/* Calculate the force acted on the first atom of the angle. */
-	fix = bvec2x[icomb] - cfact3 * bvec1x[icomb];
-	fiy = bvec2y[icomb] - cfact3 * bvec1y[icomb];
-	fiz = bvec2z[icomb] - cfact3 * bvec1z[icomb];       
-
-	/* Finally, calculate the force acted on the middle atom of the angle.*/
-	fjx = - fix - fkx;  fjy = - fiy - fky;  fjz = - fiz - fkz;  
- 
-	/* Consider the appropriate scaling of the forces: */
-	fix *= cfact1; fiy *= cfact1; fiz *= cfact1;
-	fjx *= cfact1; fjy *= cfact1; fjz *= cfact1;
-	fkx *= cfact1; fky *= cfact1; fkz *= cfact1;
-
-	if      (at1[icomb] == i1)  {f1[0] += fix; f1[1] += fiy; f1[2] += fiz;}
-	else if (at2[icomb] == i1)  {f1[0] += fjx; f1[1] += fjy; f1[2] += fjz;}
-	else if (at3[icomb] == i1)  {f1[0] += fkx; f1[1] += fky; f1[2] += fkz;}
- 
-	if      (at1[icomb] == i3)  {f3[0] += fix; f3[1] += fiy; f3[2] += fiz;}
-	else if (at2[icomb] == i3)  {f3[0] += fjx; f3[1] += fjy; f3[2] += fjz;}
-	else if (at3[icomb] == i3)  {f3[0] += fkx; f3[1] += fky; f3[2] += fkz;}
-
-	if      (at1[icomb] == i4)  {f4[0] += fix; f4[1] += fiy; f4[2] += fiz;}
-	else if (at2[icomb] == i4)  {f4[0] += fjx; f4[1] += fjy; f4[2] += fjz;}
-	else if (at3[icomb] == i4)  {f4[0] += fkx; f4[1] += fky; f4[2] += fkz;}
-
-
-	/* Store the contribution to the global arrays: */
-	/* Take the id of the atom from the at1[icomb] element, i1 = at1[icomb]. */
-	if (NEWTON_BOND || at1[icomb] < nlocal) {
-	  f[at1[icomb]][0] += fix;  
-	  f[at1[icomb]][1] += fiy;
-	  f[at1[icomb]][2] += fiz;
-	}
-	/* Take the id of the atom from the at2[icomb] element, i2 = at2[icomb]. */
-	if (NEWTON_BOND || at2[icomb] < nlocal) {
-	  f[at2[icomb]][0] += fjx;
-	  f[at2[icomb]][1] += fjy;
-	  f[at2[icomb]][2] += fjz;
-	}
-	/* Take the id of the atom from the at3[icomb] element, i3 = at3[icomb]. */
-	if (NEWTON_BOND || at3[icomb] < nlocal) {
-	  f[at3[icomb]][0] += fkx;
-	  f[at3[icomb]][1] += fky;
-	  f[at3[icomb]][2] += fkz;
-	}
-   
+        /* Calculate the squares of the distances. */
+        cjiji = bvec1n[icomb] * bvec1n[icomb];  ckjkj = bvec2n[icomb] * bvec2n[icomb];
+
+        ckjji =   bvec2x[icomb] * bvec1x[icomb]
+          + bvec2y[icomb] * bvec1y[icomb]
+          + bvec2z[icomb] * bvec1z[icomb] ;
+
+        cfact1 = angfac / (sqrt(ckjkj * cjiji));
+        cfact2 = ckjji / ckjkj;
+        cfact3 = ckjji / cjiji;
+
+        /* Calculate the force acted on the thrid atom of the angle. */
+        fkx = cfact2 * bvec2x[icomb] - bvec1x[icomb];
+        fky = cfact2 * bvec2y[icomb] - bvec1y[icomb];
+        fkz = cfact2 * bvec2z[icomb] - bvec1z[icomb];
+
+        /* Calculate the force acted on the first atom of the angle. */
+        fix = bvec2x[icomb] - cfact3 * bvec1x[icomb];
+        fiy = bvec2y[icomb] - cfact3 * bvec1y[icomb];
+        fiz = bvec2z[icomb] - cfact3 * bvec1z[icomb];
+
+        /* Finally, calculate the force acted on the middle atom of the angle.*/
+        fjx = - fix - fkx;  fjy = - fiy - fky;  fjz = - fiz - fkz;
+
+        /* Consider the appropriate scaling of the forces: */
+        fix *= cfact1; fiy *= cfact1; fiz *= cfact1;
+        fjx *= cfact1; fjy *= cfact1; fjz *= cfact1;
+        fkx *= cfact1; fky *= cfact1; fkz *= cfact1;
+
+        if      (at1[icomb] == i1)  {f1[0] += fix; f1[1] += fiy; f1[2] += fiz;}
+        else if (at2[icomb] == i1)  {f1[0] += fjx; f1[1] += fjy; f1[2] += fjz;}
+        else if (at3[icomb] == i1)  {f1[0] += fkx; f1[1] += fky; f1[2] += fkz;}
+
+        if      (at1[icomb] == i3)  {f3[0] += fix; f3[1] += fiy; f3[2] += fiz;}
+        else if (at2[icomb] == i3)  {f3[0] += fjx; f3[1] += fjy; f3[2] += fjz;}
+        else if (at3[icomb] == i3)  {f3[0] += fkx; f3[1] += fky; f3[2] += fkz;}
+
+        if      (at1[icomb] == i4)  {f4[0] += fix; f4[1] += fiy; f4[2] += fiz;}
+        else if (at2[icomb] == i4)  {f4[0] += fjx; f4[1] += fjy; f4[2] += fjz;}
+        else if (at3[icomb] == i4)  {f4[0] += fkx; f4[1] += fky; f4[2] += fkz;}
+
+
+        /* Store the contribution to the global arrays: */
+        /* Take the id of the atom from the at1[icomb] element, i1 = at1[icomb]. */
+        if (NEWTON_BOND || at1[icomb] < nlocal) {
+          f[at1[icomb]][0] += fix;
+          f[at1[icomb]][1] += fiy;
+          f[at1[icomb]][2] += fiz;
+        }
+        /* Take the id of the atom from the at2[icomb] element, i2 = at2[icomb]. */
+        if (NEWTON_BOND || at2[icomb] < nlocal) {
+          f[at2[icomb]][0] += fjx;
+          f[at2[icomb]][1] += fjy;
+          f[at2[icomb]][2] += fjz;
+        }
+        /* Take the id of the atom from the at3[icomb] element, i3 = at3[icomb]. */
+        if (NEWTON_BOND || at3[icomb] < nlocal) {
+          f[at3[icomb]][0] += fkx;
+          f[at3[icomb]][1] += fky;
+          f[at3[icomb]][2] += fkz;
+        }
+
       }
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,eimproper,f1,f3,f4,
-		   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
   }
 }
diff --git a/src/USER-OMP/improper_ring_omp.h b/src/USER-OMP/improper_ring_omp.h
index 52743f8d84..2b2616ab03 100644
--- a/src/USER-OMP/improper_ring_omp.h
+++ b/src/USER-OMP/improper_ring_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/improper_umbrella_omp.cpp b/src/USER-OMP/improper_umbrella_omp.cpp
index 4b792b6218..ebc1fc299f 100644
--- a/src/USER-OMP/improper_umbrella_omp.cpp
+++ b/src/USER-OMP/improper_umbrella_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,11 +64,11 @@ void ImproperUmbrellaOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_bond) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_bond) eval<0,0,1>(ifrom, ito, thr);
@@ -153,22 +153,22 @@ void ImproperUmbrellaOMP::eval(int nfrom, int nto, ThrData * const thr)
       int me = comm->me;
 
       if (screen) {
-	char str[128];
-	sprintf(str,"Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
-		me,thr->get_tid(),update->ntimestep,
-		atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
-	error->warning(FLERR,str,0);
-	fprintf(screen,"  1st atom: %d %g %g %g\n",
-		me,x[i1][0],x[i1][1],x[i1][2]);
-	fprintf(screen,"  2nd atom: %d %g %g %g\n",
-		me,x[i2][0],x[i2][1],x[i2][2]);
-	fprintf(screen,"  3rd atom: %d %g %g %g\n",
-		me,x[i3][0],x[i3][1],x[i3][2]);
-	fprintf(screen,"  4th atom: %d %g %g %g\n",
-		me,x[i4][0],x[i4][1],x[i4][2]);
+        char str[128];
+        sprintf(str,"Improper problem: %d/%d " BIGINT_FORMAT " %d %d %d %d",
+                me,thr->get_tid(),update->ntimestep,
+                atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+        error->warning(FLERR,str,0);
+        fprintf(screen,"  1st atom: %d %g %g %g\n",
+                me,x[i1][0],x[i1][1],x[i1][2]);
+        fprintf(screen,"  2nd atom: %d %g %g %g\n",
+                me,x[i2][0],x[i2][1],x[i2][2]);
+        fprintf(screen,"  3rd atom: %d %g %g %g\n",
+                me,x[i3][0],x[i3][1],x[i3][2]);
+        fprintf(screen,"  4th atom: %d %g %g %g\n",
+                me,x[i4][0],x[i4][1],x[i4][2]);
       }
     }
-    
+
     if (c > 1.0) s = 1.0;
     if (c < -1.0) s = -1.0;
 
@@ -176,15 +176,15 @@ void ImproperUmbrellaOMP::eval(int nfrom, int nto, ThrData * const thr)
     if (s < SMALL) s = SMALL;
     cotphi = c/s;
 
-    projhfg = (vb3x*vb1x+vb3y*vb1y+vb3z*vb1z) / 
-      sqrt(vb1x*vb1x+vb1y*vb1y+vb1z*vb1z); 
-    projhfg += (vb3x*vb2x+vb3y*vb2y+vb3z*vb2z) / 
+    projhfg = (vb3x*vb1x+vb3y*vb1y+vb3z*vb1z) /
+      sqrt(vb1x*vb1x+vb1y*vb1y+vb1z*vb1z);
+    projhfg += (vb3x*vb2x+vb3y*vb2y+vb3z*vb2z) /
       sqrt(vb2x*vb2x+vb2y*vb2y+vb2z*vb2z);
     if (projhfg > 0.0) {
       s *= -1.0;
       cotphi *= -1.0;
     }
-	
+
     //  force and energy
     // if w0 = 0: E = k * (1 - cos w)
     // if w0 != 0: E = 0.5 * C (cos w - cos w0)^2, C = k/(sin(w0)^2
@@ -254,6 +254,6 @@ void ImproperUmbrellaOMP::eval(int nfrom, int nto, ThrData * const thr)
 
     if (EVFLAG)
       ev_tally_thr(this,i1,i2,i3,i4,nlocal,NEWTON_BOND,eimproper,f1,f3,f4,
-		   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
+                   vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z,thr);
   }
 }
diff --git a/src/USER-OMP/improper_umbrella_omp.h b/src/USER-OMP/improper_umbrella_omp.h
index 39feb6d7b3..41bdfed4d5 100644
--- a/src/USER-OMP/improper_umbrella_omp.h
+++ b/src/USER-OMP/improper_umbrella_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/neigh_derive_omp.cpp b/src/USER-OMP/neigh_derive_omp.cpp
index 187a6c8753..4356f17b62 100644
--- a/src/USER-OMP/neigh_derive_omp.cpp
+++ b/src/USER-OMP/neigh_derive_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -62,7 +62,7 @@ void Neighbor::half_from_full_no_newton_omp(NeighList *list)
     if (pgsize - npnt < oneatom) {
       npnt = 0;
       npage += nthreads;
-      // only one thread at a time may check whether we 
+      // only one thread at a time may check whether we
       // need new neighbor list pages and then add to them.
       if (npage >= list->maxpage) list->add_pages(nthreads);
     }
@@ -160,13 +160,13 @@ void Neighbor::half_from_full_newton_omp(NeighList *list)
       joriginal = jlist[jj];
       j = joriginal & NEIGHMASK;
       if (j < nlocal) {
-	if (i > j) continue;
+        if (i > j) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        }
       }
       neighptr[n++] = joriginal;
     }
@@ -181,4 +181,3 @@ void Neighbor::half_from_full_newton_omp(NeighList *list)
   NEIGH_OMP_CLOSE;
   list->inum = inum_full;
 }
-
diff --git a/src/USER-OMP/neigh_full_omp.cpp b/src/USER-OMP/neigh_full_omp.cpp
index dcfaad9a49..91fd0fd1d3 100644
--- a/src/USER-OMP/neigh_full_omp.cpp
+++ b/src/USER-OMP/neigh_full_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -94,10 +94,10 @@ void Neighbor::full_nsq_omp(NeighList *list)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
       }
     }
 
@@ -177,35 +177,35 @@ void Neighbor::full_nsq_ghost_omp(NeighList *list)
 
     if (i < nlocal) {
       for (j = 0; j < nall; j++) {
-	if (i == j) continue;
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-	
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        if (i == j) continue;
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     } else {
       for (j = 0; j < nall; j++) {
-	if (i == j) continue;
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-	
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighghostsq[itype][jtype])
-	  neighptr[n++] = j;
+        if (i == j) continue;
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighghostsq[itype][jtype])
+          neighptr[n++] = j;
       }
     }
 
@@ -291,22 +291,22 @@ void Neighbor::full_bin_omp(NeighList *list)
 
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (i == j) continue;
-
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        if (i == j) continue;
+
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
@@ -396,49 +396,49 @@ void Neighbor::full_bin_ghost_omp(NeighList *list)
     if (i < nlocal) {
       ibin = coord2bin(x[i]);
       for (k = 0; k < nstencil; k++) {
-	for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	  if (i == j) continue;
-	  
-	  jtype = type[j];
-	  if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-	
-	  delx = xtmp - x[j][0];
-	  dely = ytmp - x[j][1];
-	  delz = ztmp - x[j][2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-
-	  if (rsq <= cutneighsq[itype][jtype]) {
-	    if (molecular) {
-	      which = find_special(special[i],nspecial[i],tag[j]);
-	      if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	    } else neighptr[n++] = j;
-	  }
-	}
+        for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
+          if (i == j) continue;
+
+          jtype = type[j];
+          if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+          delx = xtmp - x[j][0];
+          dely = ytmp - x[j][1];
+          delz = ztmp - x[j][2];
+          rsq = delx*delx + dely*dely + delz*delz;
+
+          if (rsq <= cutneighsq[itype][jtype]) {
+            if (molecular) {
+              which = find_special(special[i],nspecial[i],tag[j]);
+              if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+            } else neighptr[n++] = j;
+          }
+        }
       }
 
     } else {
       ibin = coord2bin(x[i],xbin,ybin,zbin);
       for (k = 0; k < nstencil; k++) {
-	xbin2 = xbin + stencilxyz[k][0];
-	ybin2 = ybin + stencilxyz[k][1];
-	zbin2 = zbin + stencilxyz[k][2];
-	if (xbin2 < 0 || xbin2 >= mbinx ||
-	    ybin2 < 0 || ybin2 >= mbiny ||
-	    zbin2 < 0 || zbin2 >= mbinz) continue;
-	for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	  if (i == j) continue;
-	  
-	  jtype = type[j];
-	  if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-	
-	  delx = xtmp - x[j][0];
-	  dely = ytmp - x[j][1];
-	  delz = ztmp - x[j][2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-
-	  if (rsq <= cutneighghostsq[itype][jtype])
-	    neighptr[n++] = j;
-	}
+        xbin2 = xbin + stencilxyz[k][0];
+        ybin2 = ybin + stencilxyz[k][1];
+        zbin2 = zbin + stencilxyz[k][2];
+        if (xbin2 < 0 || xbin2 >= mbinx ||
+            ybin2 < 0 || ybin2 >= mbiny ||
+            zbin2 < 0 || zbin2 >= mbinz) continue;
+        for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
+          if (i == j) continue;
+
+          jtype = type[j];
+          if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+          delx = xtmp - x[j][0];
+          dely = ytmp - x[j][1];
+          delz = ztmp - x[j][2];
+          rsq = delx*delx + dely*dely + delz*delz;
+
+          if (rsq <= cutneighghostsq[itype][jtype])
+            neighptr[n++] = j;
+        }
       }
     }
 
@@ -531,23 +531,23 @@ void Neighbor::full_multi_omp(NeighList *list)
     ns = nstencil_multi[itype];
     for (k = 0; k < ns; k++) {
       for (j = binhead[ibin+s[k]]; j >= 0; j = bins[j]) {
-	jtype = type[j];
-	if (cutsq[jtype] < distsq[k]) continue;
-	if (i == j) continue;
-
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        jtype = type[j];
+        if (cutsq[jtype] < distsq[k]) continue;
+        if (i == j) continue;
+
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
diff --git a/src/USER-OMP/neigh_gran_omp.cpp b/src/USER-OMP/neigh_gran_omp.cpp
index 8a03da8e64..71fee4ec4f 100644
--- a/src/USER-OMP/neigh_gran_omp.cpp
+++ b/src/USER-OMP/neigh_gran_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -90,20 +90,20 @@ void Neighbor::granular_nsq_no_newton_omp(NeighList *list)
 #endif
     {
       if (pgsize - npnt < oneatom) {
-	npnt = 0;
-	npage += nthreads;
-	if (npage >= list->maxpage) {
-	  list->add_pages(nthreads);
-	  if (fix_history)
-	    listgranhistory->add_pages(nthreads);
-	}
+        npnt = 0;
+        npage += nthreads;
+        if (npage >= list->maxpage) {
+          list->add_pages(nthreads);
+          if (fix_history)
+            listgranhistory->add_pages(nthreads);
+        }
       }
 
       n = nn = 0;
       neighptr = &(list->pages[npage][npnt]);
       if (fix_history) {
-	touchptr = &(listgranhistory->pages[npage][npnt]);
-	shearptr = &(listgranhistory->dpages[npage][3*npnt]);
+        touchptr = &(listgranhistory->pages[npage][npnt]);
+        shearptr = &(listgranhistory->dpages[npage][3*npnt]);
       }
     }
 
@@ -126,32 +126,32 @@ void Neighbor::granular_nsq_no_newton_omp(NeighList *list)
       cutsq = (radsum+skin) * (radsum+skin);
 
       if (rsq <= cutsq) {
-	neighptr[n] = j;
-
-	if (fix_history) {
-	  if (rsq < radsum*radsum) {
-	    for (m = 0; m < npartner[i]; m++)
-	      if (partner[i][m] == tag[j]) break;
-	    if (m < npartner[i]) {
-	      touchptr[n] = 1;
-	      shearptr[nn++] = shearpartner[i][m][0];
-	      shearptr[nn++] = shearpartner[i][m][1];
-	      shearptr[nn++] = shearpartner[i][m][2];
-	    } else {
-	      touchptr[n] = 0;
-	      shearptr[nn++] = 0.0;
-	      shearptr[nn++] = 0.0;
-	      shearptr[nn++] = 0.0;
-	    }
-	  } else {
-	    touchptr[n] = 0;
-	    shearptr[nn++] = 0.0;
-	    shearptr[nn++] = 0.0;
-	    shearptr[nn++] = 0.0;
-	  }
-	}
-
-	n++;
+        neighptr[n] = j;
+
+        if (fix_history) {
+          if (rsq < radsum*radsum) {
+            for (m = 0; m < npartner[i]; m++)
+              if (partner[i][m] == tag[j]) break;
+            if (m < npartner[i]) {
+              touchptr[n] = 1;
+              shearptr[nn++] = shearpartner[i][m][0];
+              shearptr[nn++] = shearpartner[i][m][1];
+              shearptr[nn++] = shearpartner[i][m][2];
+            } else {
+              touchptr[n] = 0;
+              shearptr[nn++] = 0.0;
+              shearptr[nn++] = 0.0;
+              shearptr[nn++] = 0.0;
+            }
+          } else {
+            touchptr[n] = 0;
+            shearptr[nn++] = 0.0;
+            shearptr[nn++] = 0.0;
+            shearptr[nn++] = 0.0;
+          }
+        }
+
+        n++;
       }
     }
 
@@ -236,18 +236,18 @@ void Neighbor::granular_nsq_newton_omp(NeighList *list)
       if (includegroup && !(mask[j] & bitmask)) continue;
 
       if (j >= nlocal) {
-	jtag = tag[j];
-	if (itag > jtag) {
-	  if ((itag+jtag) % 2 == 0) continue;
-	} else if (itag < jtag) {
-	  if ((itag+jtag) % 2 == 1) continue;
-	} else {
-	  if (x[j][2] < ztmp) continue;
-	  if (x[j][2] == ztmp) {
-	    if (x[j][1] < ytmp) continue;
-	    if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	  }
-	}
+        jtag = tag[j];
+        if (itag > jtag) {
+          if ((itag+jtag) % 2 == 0) continue;
+        } else if (itag < jtag) {
+          if ((itag+jtag) % 2 == 1) continue;
+        } else {
+          if (x[j][2] < ztmp) continue;
+          if (x[j][2] == ztmp) {
+            if (x[j][1] < ytmp) continue;
+            if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+          }
+        }
       }
 
       if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
@@ -258,7 +258,7 @@ void Neighbor::granular_nsq_newton_omp(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
       radsum = radi + radius[j];
       cutsq = (radsum+skin) * (radsum+skin);
-      
+
       if (rsq <= cutsq) neighptr[n++] = j;
     }
 
@@ -348,20 +348,20 @@ void Neighbor::granular_bin_no_newton_omp(NeighList *list)
 #endif
     {
       if (pgsize - npnt < oneatom) {
-	npnt = 0;
-	npage += nthreads;
-	if (npage >= list->maxpage) {
-	  list->add_pages(nthreads);
-	  if (fix_history)
-	    listgranhistory->add_pages(nthreads);
-	}
+        npnt = 0;
+        npage += nthreads;
+        if (npage >= list->maxpage) {
+          list->add_pages(nthreads);
+          if (fix_history)
+            listgranhistory->add_pages(nthreads);
+        }
       }
 
       n = nn = 0;
       neighptr = &(list->pages[npage][npnt]);
       if (fix_history) {
-	touchptr = &(listgranhistory->pages[npage][npnt]);
-	shearptr = &(listgranhistory->dpages[npage][3*npnt]);
+        touchptr = &(listgranhistory->pages[npage][npnt]);
+        shearptr = &(listgranhistory->dpages[npage][3*npnt]);
       }
     }
 
@@ -378,44 +378,44 @@ void Neighbor::granular_bin_no_newton_omp(NeighList *list)
 
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (j <= i) continue;
-	if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-	radsum = radi + radius[j];
-	cutsq = (radsum+skin) * (radsum+skin);
-
-	if (rsq <= cutsq) {
-	  neighptr[n] = j;
-
-	  if (fix_history) {
-	    if (rsq < radsum*radsum) {
-	      for (m = 0; m < npartner[i]; m++)
-		if (partner[i][m] == tag[j]) break;
-	      if (m < npartner[i]) {
-		touchptr[n] = 1;
-		shearptr[nn++] = shearpartner[i][m][0];
-		shearptr[nn++] = shearpartner[i][m][1];
-		shearptr[nn++] = shearpartner[i][m][2];
-	      } else {
-		touchptr[n] = 0;
-		shearptr[nn++] = 0.0;
-		shearptr[nn++] = 0.0;
-		shearptr[nn++] = 0.0;
-	      }
-	    } else {
-	      touchptr[n] = 0;
-	      shearptr[nn++] = 0.0;
-	      shearptr[nn++] = 0.0;
-	      shearptr[nn++] = 0.0;
-	    }
-	  }
-
-	  n++;
-	}
+        if (j <= i) continue;
+        if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+        radsum = radi + radius[j];
+        cutsq = (radsum+skin) * (radsum+skin);
+
+        if (rsq <= cutsq) {
+          neighptr[n] = j;
+
+          if (fix_history) {
+            if (rsq < radsum*radsum) {
+              for (m = 0; m < npartner[i]; m++)
+                if (partner[i][m] == tag[j]) break;
+              if (m < npartner[i]) {
+                touchptr[n] = 1;
+                shearptr[nn++] = shearpartner[i][m][0];
+                shearptr[nn++] = shearpartner[i][m][1];
+                shearptr[nn++] = shearpartner[i][m][2];
+              } else {
+                touchptr[n] = 0;
+                shearptr[nn++] = 0.0;
+                shearptr[nn++] = 0.0;
+                shearptr[nn++] = 0.0;
+              }
+            } else {
+              touchptr[n] = 0;
+              shearptr[nn++] = 0.0;
+              shearptr[nn++] = 0.0;
+              shearptr[nn++] = 0.0;
+            }
+          }
+
+          n++;
+        }
       }
     }
 
@@ -503,11 +503,11 @@ void Neighbor::granular_bin_newton_omp(NeighList *list)
 
     for (j = bins[i]; j >= 0; j = bins[j]) {
       if (j >= nlocal) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        }
       }
 
       if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
@@ -527,16 +527,16 @@ void Neighbor::granular_bin_newton_omp(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
+        if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
 
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-	radsum = radi + radius[j];
-	cutsq = (radsum+skin) * (radsum+skin);
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+        radsum = radi + radius[j];
+        cutsq = (radsum+skin) * (radsum+skin);
 
-	if (rsq <= cutsq) neighptr[n++] = j;
+        if (rsq <= cutsq) neighptr[n++] = j;
       }
     }
 
@@ -623,25 +623,25 @@ void Neighbor::granular_bin_newton_tri_omp(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp) {
-	    if (x[j][0] < xtmp) continue;
-	    if (x[j][0] == xtmp && j <= i) continue;
-	  }
-	}
-
-	if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-	radsum = radi + radius[j];
-	cutsq = (radsum+skin) * (radsum+skin);
-
-	if (rsq <= cutsq) neighptr[n++] = j;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp) {
+            if (x[j][0] < xtmp) continue;
+            if (x[j][0] == xtmp && j <= i) continue;
+          }
+        }
+
+        if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+        radsum = radi + radius[j];
+        cutsq = (radsum+skin) * (radsum+skin);
+
+        if (rsq <= cutsq) neighptr[n++] = j;
       }
     }
 
diff --git a/src/USER-OMP/neigh_half_bin_omp.cpp b/src/USER-OMP/neigh_half_bin_omp.cpp
index 3ff15b11da..6da44d4203 100644
--- a/src/USER-OMP/neigh_half_bin_omp.cpp
+++ b/src/USER-OMP/neigh_half_bin_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -95,22 +95,22 @@ void Neighbor::half_bin_no_newton_omp(NeighList *list)
 
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (j <= i) continue;
-
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        if (j <= i) continue;
+
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
@@ -196,11 +196,11 @@ void Neighbor::half_bin_newton_omp(NeighList *list)
 
     for (j = bins[i]; j >= 0; j = bins[j]) {
       if (j >= nlocal) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        }
       }
 
       jtype = type[j];
@@ -212,10 +212,10 @@ void Neighbor::half_bin_newton_omp(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
       }
     }
 
@@ -224,20 +224,20 @@ void Neighbor::half_bin_newton_omp(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
@@ -326,29 +326,29 @@ void Neighbor::half_bin_newton_tri_omp(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp) {
-	    if (x[j][0] < xtmp) continue;
-	    if (x[j][0] == xtmp && j <= i) continue;
-	  }
-	}
-
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp) {
+            if (x[j][0] < xtmp) continue;
+            if (x[j][0] == xtmp && j <= i) continue;
+          }
+        }
+
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
diff --git a/src/USER-OMP/neigh_half_multi_omp.cpp b/src/USER-OMP/neigh_half_multi_omp.cpp
index ca74276139..0dbe2530af 100644
--- a/src/USER-OMP/neigh_half_multi_omp.cpp
+++ b/src/USER-OMP/neigh_half_multi_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -102,23 +102,23 @@ void Neighbor::half_multi_no_newton_omp(NeighList *list)
     ns = nstencil_multi[itype];
     for (k = 0; k < ns; k++) {
       for (j = binhead[ibin+s[k]]; j >= 0; j = bins[j]) {
-	if (j <= i) continue;
-	jtype = type[j];
-	if (cutsq[jtype] < distsq[k]) continue;
-
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        if (j <= i) continue;
+        jtype = type[j];
+        if (cutsq[jtype] < distsq[k]) continue;
+
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
@@ -207,11 +207,11 @@ void Neighbor::half_multi_newton_omp(NeighList *list)
 
     for (j = bins[i]; j >= 0; j = bins[j]) {
       if (j >= nlocal) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        }
       }
 
       jtype = type[j];
@@ -223,10 +223,10 @@ void Neighbor::half_multi_newton_omp(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
       }
     }
 
@@ -240,22 +240,22 @@ void Neighbor::half_multi_newton_omp(NeighList *list)
     ns = nstencil_multi[itype];
     for (k = 0; k < ns; k++) {
       for (j = binhead[ibin+s[k]]; j >= 0; j = bins[j]) {
-	jtype = type[j];
-	if (cutsq[jtype] < distsq[k]) continue;
-
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        jtype = type[j];
+        if (cutsq[jtype] < distsq[k]) continue;
+
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
@@ -353,30 +353,30 @@ void Neighbor::half_multi_newton_tri_omp(NeighList *list)
     ns = nstencil_multi[itype];
     for (k = 0; k < ns; k++) {
       for (j = binhead[ibin+s[k]]; j >= 0; j = bins[j]) {
-	jtype = type[j];
-	if (cutsq[jtype] < distsq[k]) continue;
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp) {
-	    if (x[j][0] < xtmp) continue;
-	    if (x[j][0] == xtmp && j <= i) continue;
-	  }
-	}
-
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        jtype = type[j];
+        if (cutsq[jtype] < distsq[k]) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp) {
+            if (x[j][0] < xtmp) continue;
+            if (x[j][0] == xtmp && j <= i) continue;
+          }
+        }
+
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
diff --git a/src/USER-OMP/neigh_half_nsq_omp.cpp b/src/USER-OMP/neigh_half_nsq_omp.cpp
index c557fe7d84..a8a9e39827 100644
--- a/src/USER-OMP/neigh_half_nsq_omp.cpp
+++ b/src/USER-OMP/neigh_half_nsq_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -94,10 +94,10 @@ void Neighbor::half_nsq_no_newton_omp(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
       }
     }
 
@@ -180,18 +180,18 @@ void Neighbor::half_nsq_newton_omp(NeighList *list)
       if (includegroup && !(mask[j] & bitmask)) continue;
 
       if (j >= nlocal) {
-	jtag = tag[j];
-	if (itag > jtag) {
-	  if ((itag+jtag) % 2 == 0) continue;
-	} else if (itag < jtag) {
-	  if ((itag+jtag) % 2 == 1) continue;
-	} else {
-	  if (x[j][2] < ztmp) continue;
-	  if (x[j][2] == ztmp) {
-	    if (x[j][1] < ytmp) continue;
-	    if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	  }
-	}
+        jtag = tag[j];
+        if (itag > jtag) {
+          if ((itag+jtag) % 2 == 0) continue;
+        } else if (itag < jtag) {
+          if ((itag+jtag) % 2 == 1) continue;
+        } else {
+          if (x[j][2] < ztmp) continue;
+          if (x[j][2] == ztmp) {
+            if (x[j][1] < ytmp) continue;
+            if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+          }
+        }
       }
 
       jtype = type[j];
@@ -203,10 +203,10 @@ void Neighbor::half_nsq_newton_omp(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
       }
     }
 
diff --git a/src/USER-OMP/neigh_respa_omp.cpp b/src/USER-OMP/neigh_respa_omp.cpp
index e0817385d6..de22caa6cc 100644
--- a/src/USER-OMP/neigh_respa_omp.cpp
+++ b/src/USER-OMP/neigh_respa_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -122,9 +122,9 @@ void Neighbor::respa_nsq_no_newton_omp(NeighList *list)
 #endif
     if (respamiddle) {
       if (pgsize - npnt_middle < oneatom) {
-	npnt_middle = 0;
-	npage_middle += nthreads;
-	if (npage_middle == listmiddle->maxpage) listmiddle->add_pages(nthreads);
+        npnt_middle = 0;
+        npage_middle += nthreads;
+        if (npage_middle == listmiddle->maxpage) listmiddle->add_pages(nthreads);
       }
       neighptr_middle = &(listmiddle->pages[npage_middle][npnt_middle]);
       n_middle = 0;
@@ -148,20 +148,20 @@ void Neighbor::respa_nsq_no_newton_omp(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
 
         if (rsq < cut_inner_sq) {
-	  if (which == 0) neighptr_inner[n_inner++] = j;
-	  else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          if (which == 0) neighptr_inner[n_inner++] = j;
+          else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
         }
 
         if (respamiddle && rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	  if (which == 0) neighptr_middle[n_middle++] = j;
-	  else if (which > 0) 
-	    neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+          if (which == 0) neighptr_middle[n_middle++] = j;
+          else if (which > 0)
+            neighptr_middle[n_middle++] = j ^ (which << SBBITS);
         }
       }
     }
@@ -186,7 +186,7 @@ void Neighbor::respa_nsq_no_newton_omp(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (n_middle > oneatom)
-	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
+        error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
     }
   }
   NEIGH_OMP_CLOSE;
@@ -297,9 +297,9 @@ void Neighbor::respa_nsq_newton_omp(NeighList *list)
 #endif
     if (respamiddle) {
       if (pgsize - npnt_middle < oneatom) {
-	npnt_middle = 0;
-	npage_middle += nthreads;
-	if (npage_middle == listmiddle->maxpage) listmiddle->add_pages(nthreads);
+        npnt_middle = 0;
+        npage_middle += nthreads;
+        if (npage_middle == listmiddle->maxpage) listmiddle->add_pages(nthreads);
       }
       neighptr_middle = &(listmiddle->pages[npage_middle][npnt_middle]);
       n_middle = 0;
@@ -317,18 +317,18 @@ void Neighbor::respa_nsq_newton_omp(NeighList *list)
       if (includegroup && !(mask[j] & bitmask)) continue;
 
       if (j >= nlocal) {
-	jtag = tag[j];
-	if (itag > jtag) {
-	  if ((itag+jtag) % 2 == 0) continue;
-	} else if (itag < jtag) {
-	  if ((itag+jtag) % 2 == 1) continue;
-	} else {
-	  if (x[j][2] < ztmp) continue;
-	  if (x[j][2] == ztmp) {
-	    if (x[j][1] < ytmp) continue;
-	    if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	  }
-	}
+        jtag = tag[j];
+        if (itag > jtag) {
+          if ((itag+jtag) % 2 == 0) continue;
+        } else if (itag < jtag) {
+          if ((itag+jtag) % 2 == 1) continue;
+        } else {
+          if (x[j][2] < ztmp) continue;
+          if (x[j][2] == ztmp) {
+            if (x[j][1] < ytmp) continue;
+            if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+          }
+        }
       }
 
       jtype = type[j];
@@ -340,21 +340,21 @@ void Neighbor::respa_nsq_newton_omp(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
 
         if (rsq < cut_inner_sq) {
-	  if (which == 0) neighptr_inner[n_inner++] = j;
-	  else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          if (which == 0) neighptr_inner[n_inner++] = j;
+          else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
         }
 
-        if (respamiddle && 
-	    rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	  if (which == 0) neighptr_middle[n_middle++] = j;
-	  else if (which > 0) 
-	    neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+        if (respamiddle &&
+            rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
+          if (which == 0) neighptr_middle[n_middle++] = j;
+          else if (which > 0)
+            neighptr_middle[n_middle++] = j ^ (which << SBBITS);
         }
       }
     }
@@ -379,7 +379,7 @@ void Neighbor::respa_nsq_newton_omp(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (n_middle > oneatom)
-	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
+        error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
     }
   }
   NEIGH_OMP_CLOSE;
@@ -494,9 +494,9 @@ void Neighbor::respa_bin_no_newton_omp(NeighList *list)
 #endif
     if (respamiddle) {
       if (pgsize - npnt_middle < oneatom) {
-	npnt_middle = 0;
-	npage_middle += nthreads;
-	if (npage_middle == listmiddle->maxpage) listmiddle->add_pages(nthreads);
+        npnt_middle = 0;
+        npage_middle += nthreads;
+        if (npage_middle == listmiddle->maxpage) listmiddle->add_pages(nthreads);
       }
       neighptr_middle = &(listmiddle->pages[npage_middle][npnt_middle]);
       n_middle = 0;
@@ -515,35 +515,35 @@ void Neighbor::respa_bin_no_newton_omp(NeighList *list)
 
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (j <= i) continue;
-
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-
-	  if (rsq < cut_inner_sq) {
-	    if (which == 0) neighptr_inner[n_inner++] = j;
-	    else if (which > 0) 
-	      neighptr_inner[n_inner++] = j ^ (which << SBBITS);
-	  }
-
-	  if (respamiddle && 
-	      rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	    if (which == 0) neighptr_middle[n_middle++] = j;
-	    else if (which > 0) 
-	      neighptr_middle[n_middle++] = j ^ (which << SBBITS);
-	  }
-	}
+        if (j <= i) continue;
+
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+
+          if (rsq < cut_inner_sq) {
+            if (which == 0) neighptr_inner[n_inner++] = j;
+            else if (which > 0)
+              neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          }
+
+          if (respamiddle &&
+              rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
+            if (which == 0) neighptr_middle[n_middle++] = j;
+            else if (which > 0)
+              neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+          }
+        }
       }
     }
 
@@ -567,7 +567,7 @@ void Neighbor::respa_bin_no_newton_omp(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (n_middle > oneatom)
-	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
+        error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
     }
   }
   NEIGH_OMP_CLOSE;
@@ -575,7 +575,7 @@ void Neighbor::respa_bin_no_newton_omp(NeighList *list)
   listinner->inum = nlocal;
   if (respamiddle) listmiddle->inum = nlocal;
 }
-      
+
 /* ----------------------------------------------------------------------
    multiple respa lists
    binned neighbor list construction with full Newton's 3rd law
@@ -681,9 +681,9 @@ void Neighbor::respa_bin_newton_omp(NeighList *list)
 #endif
     if (respamiddle) {
       if (pgsize - npnt_middle < oneatom) {
-	npnt_middle = 0;
-	npage_middle += nthreads;
-	if (npage_middle == listmiddle->maxpage) listmiddle->add_pages(nthreads);
+        npnt_middle = 0;
+        npage_middle += nthreads;
+        if (npage_middle == listmiddle->maxpage) listmiddle->add_pages(nthreads);
       }
       neighptr_middle = &(listmiddle->pages[npage_middle][npnt_middle]);
       n_middle = 0;
@@ -700,11 +700,11 @@ void Neighbor::respa_bin_newton_omp(NeighList *list)
 
     for (j = bins[i]; j >= 0; j = bins[j]) {
       if (j >= nlocal) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        }
       }
 
       jtype = type[j];
@@ -716,21 +716,21 @@ void Neighbor::respa_bin_newton_omp(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
 
         if (rsq < cut_inner_sq) {
-	  if (which == 0) neighptr_inner[n_inner++] = j;
-	  else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          if (which == 0) neighptr_inner[n_inner++] = j;
+          else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
         }
 
-        if (respamiddle && 
-	    rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	  if (which == 0) neighptr_middle[n_middle++] = j;
-	  else if (which > 0) 
-	    neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+        if (respamiddle &&
+            rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
+          if (which == 0) neighptr_middle[n_middle++] = j;
+          else if (which > 0)
+            neighptr_middle[n_middle++] = j ^ (which << SBBITS);
         }
       }
     }
@@ -740,33 +740,33 @@ void Neighbor::respa_bin_newton_omp(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-
-	  if (rsq < cut_inner_sq) {
-	    if (which == 0) neighptr_inner[n_inner++] = j;
-	    else if (which > 0) 
-	      neighptr_inner[n_inner++] = j ^ (which << SBBITS);
-	  }
-
-	  if (respamiddle && 
-	      rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	    if (which == 0) neighptr_middle[n_middle++] = j;
-	    else if (which > 0) 
-	      neighptr_middle[n_middle++] = j ^ (which << SBBITS);
-	  }
-	}
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+
+          if (rsq < cut_inner_sq) {
+            if (which == 0) neighptr_inner[n_inner++] = j;
+            else if (which > 0)
+              neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          }
+
+          if (respamiddle &&
+              rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
+            if (which == 0) neighptr_middle[n_middle++] = j;
+            else if (which > 0)
+              neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+          }
+        }
       }
     }
 
@@ -790,7 +790,7 @@ void Neighbor::respa_bin_newton_omp(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (n_middle > oneatom)
-	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
+        error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
     }
   }
   NEIGH_OMP_CLOSE;
@@ -904,9 +904,9 @@ void Neighbor::respa_bin_newton_tri_omp(NeighList *list)
 #endif
     if (respamiddle) {
       if (pgsize - npnt_middle < oneatom) {
-	npnt_middle = 0;
-	npage_middle += nthreads;
-	if (npage_middle == listmiddle->maxpage) listmiddle->add_pages(nthreads);
+        npnt_middle = 0;
+        npage_middle += nthreads;
+        if (npage_middle == listmiddle->maxpage) listmiddle->add_pages(nthreads);
       }
       neighptr_middle = &(listmiddle->pages[npage_middle][npnt_middle]);
       n_middle = 0;
@@ -926,42 +926,42 @@ void Neighbor::respa_bin_newton_tri_omp(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp) {
-	    if (x[j][0] < xtmp) continue;
-	    if (x[j][0] == xtmp && j <= i) continue;
-	  }
-	}
-
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-
-	  if (rsq < cut_inner_sq) {
-	    if (which == 0) neighptr_inner[n_inner++] = j;
-	    else if (which > 0) 
-	      neighptr_inner[n_inner++] = j ^ (which << SBBITS);
-	  }
-
-	  if (respamiddle &&
-	      rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	    if (which == 0) neighptr_middle[n_middle++] = j;
-	    else if (which > 0) 
-	      neighptr_middle[n_middle++] = j ^ (which << SBBITS);
-	  }
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp) {
+            if (x[j][0] < xtmp) continue;
+            if (x[j][0] == xtmp && j <= i) continue;
+          }
+        }
+
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+
+          if (rsq < cut_inner_sq) {
+            if (which == 0) neighptr_inner[n_inner++] = j;
+            else if (which > 0)
+              neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          }
+
+          if (respamiddle &&
+              rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
+            if (which == 0) neighptr_middle[n_middle++] = j;
+            else if (which > 0)
+              neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+          }
+        }
       }
     }
 
@@ -985,7 +985,7 @@ void Neighbor::respa_bin_newton_tri_omp(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (n_middle > oneatom)
-	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
+        error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
     }
   }
   NEIGH_OMP_CLOSE;
diff --git a/src/USER-OMP/neighbor_omp.h b/src/USER-OMP/neighbor_omp.h
index 138ef96d5b..fd27ba8b61 100644
--- a/src/USER-OMP/neighbor_omp.h
+++ b/src/USER-OMP/neighbor_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -24,30 +24,30 @@ namespace LAMMPS_NS {
 #if defined(_OPENMP)
 
 // make sure we have at least one page for each thread
-#define NEIGH_OMP_INIT					\
-  const int nthreads = comm->nthreads;			\
-  if (nthreads > list->maxpage)				\
+#define NEIGH_OMP_INIT                                        \
+  const int nthreads = comm->nthreads;                        \
+  if (nthreads > list->maxpage)                                \
     list->add_pages(nthreads - list->maxpage)
 
 // get thread id and then assign each thread a fixed chunk of atoms
-#define NEIGH_OMP_SETUP(num)				\
-  {							\
-    const int tid = omp_get_thread_num();		\
-    const int idelta = 1 + num/nthreads;		\
-    const int ifrom = tid*idelta;			\
-    const int ito   = ((ifrom + idelta) > num)		\
-      ? num : (ifrom+idelta);				\
+#define NEIGH_OMP_SETUP(num)                                \
+  {                                                        \
+    const int tid = omp_get_thread_num();                \
+    const int idelta = 1 + num/nthreads;                \
+    const int ifrom = tid*idelta;                        \
+    const int ito   = ((ifrom + idelta) > num)                \
+      ? num : (ifrom+idelta);                                \
 
 #define NEIGH_OMP_CLOSE }
 
 #else /* !defined(_OPENMP) */
 
-#define NEIGH_OMP_INIT					\
+#define NEIGH_OMP_INIT                                        \
   const int nthreads = comm->nthreads;
 
-#define NEIGH_OMP_SETUP(num)				\
-    const int tid = 0;					\
-    const int ifrom = 0;				\
+#define NEIGH_OMP_SETUP(num)                                \
+    const int tid = 0;                                        \
+    const int ifrom = 0;                                \
     const int ito = num
 
 #define NEIGH_OMP_CLOSE
diff --git a/src/USER-OMP/pair_adp_omp.cpp b/src/USER-OMP/pair_adp_omp.cpp
index 389144e1d1..4d05b16c70 100644
--- a/src/USER-OMP/pair_adp_omp.cpp
+++ b/src/USER-OMP/pair_adp_omp.cpp
@@ -72,7 +72,7 @@ void PairADPOMP::compute(int eflag, int vflag)
     loop_setup_thr(ifrom, ito, tid, inum, nthreads);
     ThrData *thr = fix->get_thr(tid);
     ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr);
-    
+
     if (force->newton_pair)
       thr->init_adp(nall, rho, mu, lambda);
     else
@@ -80,11 +80,11 @@ void PairADPOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -149,21 +149,21 @@ void PairADPOMP::eval(int iifrom, int iito, ThrData * const thr)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cutforcesq) {
-	jtype = type[j];
-	p = sqrt(rsq)*rdr + 1.0;
-	m = static_cast<int> (p);
-	m = MIN(m,nr-1);
-	p -= m;
-	p = MIN(p,1.0);
-	coeff = rhor_spline[type2rhor[jtype][itype]][m];
-	rho_t[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        jtype = type[j];
+        p = sqrt(rsq)*rdr + 1.0;
+        m = static_cast<int> (p);
+        m = MIN(m,nr-1);
+        p -= m;
+        p = MIN(p,1.0);
+        coeff = rhor_spline[type2rhor[jtype][itype]][m];
+        rho_t[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
         coeff = u2r_spline[type2u2r[jtype][itype]][m];
-	u2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        u2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
         mu_t[i][0] += u2*delx;
         mu_t[i][1] += u2*dely;
         mu_t[i][2] += u2*delz;
         coeff = w2r_spline[type2w2r[jtype][itype]][m];
-	w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
         lambda_t[i][0] += w2*delx*delx;
         lambda_t[i][1] += w2*dely*dely;
         lambda_t[i][2] += w2*delz*delz;
@@ -171,24 +171,24 @@ void PairADPOMP::eval(int iifrom, int iito, ThrData * const thr)
         lambda_t[i][4] += w2*delx*delz;
         lambda_t[i][5] += w2*delx*dely;
 
-	if (NEWTON_PAIR || j < nlocal) {
+        if (NEWTON_PAIR || j < nlocal) {
           // verify sign difference for mu and lambda
-	  coeff = rhor_spline[type2rhor[itype][jtype]][m];
-	  rho_t[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+          coeff = rhor_spline[type2rhor[itype][jtype]][m];
+          rho_t[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
           coeff = u2r_spline[type2u2r[itype][jtype]][m];
           u2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
           mu_t[j][0] -= u2*delx;
           mu_t[j][1] -= u2*dely;
           mu_t[j][2] -= u2*delz;
           coeff = w2r_spline[type2w2r[itype][jtype]][m];
-	  w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+          w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
           lambda_t[j][0] += w2*delx*delx;
           lambda_t[j][1] += w2*dely*dely;
           lambda_t[j][2] += w2*delz*delz;
           lambda_t[j][3] += w2*dely*delz;
           lambda_t[j][4] += w2*delx*delz;
           lambda_t[j][5] += w2*delx*dely;
-	}
+        }
       }
     }
   }
@@ -214,7 +214,7 @@ void PairADPOMP::eval(int iifrom, int iito, ThrData * const thr)
 
     // wait until master thread is done with communication
     sync_threads();
-  
+
   } else {
     // reduce per thread density
     data_reduce_thr(&(rho[0]), nlocal, comm->nthreads, 1, tid);
@@ -224,7 +224,7 @@ void PairADPOMP::eval(int iifrom, int iito, ThrData * const thr)
     // wait until reduction is complete
     sync_threads();
   }
-  
+
   // fp = derivative of embedding energy at each atom
   // phi = embedding energy at each atom
 
@@ -241,11 +241,11 @@ void PairADPOMP::eval(int iifrom, int iito, ThrData * const thr)
       phi = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
       phi += 0.5*(mu[i][0]*mu[i][0]+mu[i][1]*mu[i][1]+mu[i][2]*mu[i][2]);
       phi += 0.5*(lambda[i][0]*lambda[i][0]+lambda[i][1]*
-		  lambda[i][1]+lambda[i][2]*lambda[i][2]);
+                  lambda[i][1]+lambda[i][2]*lambda[i][2]);
       phi += 1.0*(lambda[i][3]*lambda[i][3]+lambda[i][4]*
-		  lambda[i][4]+lambda[i][5]*lambda[i][5]);
+                  lambda[i][4]+lambda[i][5]*lambda[i][5]);
       phi -= 1.0/6.0*(lambda[i][0]+lambda[i][1]+lambda[i][2])*
-	(lambda[i][0]+lambda[i][1]+lambda[i][2]);
+        (lambda[i][0]+lambda[i][1]+lambda[i][2]);
       e_tally_thr(this,i,i,nlocal,/* newton_pair */ 1, phi, 0.0, thr);
     }
   }
@@ -287,51 +287,51 @@ void PairADPOMP::eval(int iifrom, int iito, ThrData * const thr)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cutforcesq) {
-	jtype = type[j];
-	r = sqrt(rsq);
-	p = r*rdr + 1.0;
-	m = static_cast<int> (p);
-	m = MIN(m,nr-1);
-	p -= m;
-	p = MIN(p,1.0);
-
-	// rhoip = derivative of (density at atom j due to atom i)
-	// rhojp = derivative of (density at atom i due to atom j)
-	// phi = pair potential energy
-	// phip = phi'
-	// z2 = phi * r
-	// z2p = (phi * r)' = (phi' r) + phi
+        jtype = type[j];
+        r = sqrt(rsq);
+        p = r*rdr + 1.0;
+        m = static_cast<int> (p);
+        m = MIN(m,nr-1);
+        p -= m;
+        p = MIN(p,1.0);
+
+        // rhoip = derivative of (density at atom j due to atom i)
+        // rhojp = derivative of (density at atom i due to atom j)
+        // phi = pair potential energy
+        // phip = phi'
+        // z2 = phi * r
+        // z2p = (phi * r)' = (phi' r) + phi
         // u2 = u
         // u2p = u'
         // w2 = w
         // w2p = w'
-	// psip needs both fp[i] and fp[j] terms since r_ij appears in two
-	//   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
-	//   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
-
-	coeff = rhor_spline[type2rhor[itype][jtype]][m];
-	rhoip = (coeff[0]*p + coeff[1])*p + coeff[2];
-	coeff = rhor_spline[type2rhor[jtype][itype]][m];
-	rhojp = (coeff[0]*p + coeff[1])*p + coeff[2];
-	coeff = z2r_spline[type2z2r[itype][jtype]][m];
-	z2p = (coeff[0]*p + coeff[1])*p + coeff[2];
-	z2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        // psip needs both fp[i] and fp[j] terms since r_ij appears in two
+        //   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
+        //   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
+
+        coeff = rhor_spline[type2rhor[itype][jtype]][m];
+        rhoip = (coeff[0]*p + coeff[1])*p + coeff[2];
+        coeff = rhor_spline[type2rhor[jtype][itype]][m];
+        rhojp = (coeff[0]*p + coeff[1])*p + coeff[2];
+        coeff = z2r_spline[type2z2r[itype][jtype]][m];
+        z2p = (coeff[0]*p + coeff[1])*p + coeff[2];
+        z2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
         coeff = u2r_spline[type2u2r[itype][jtype]][m];
-	u2p = (coeff[0]*p + coeff[1])*p + coeff[2];
-	u2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        u2p = (coeff[0]*p + coeff[1])*p + coeff[2];
+        u2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
         coeff = w2r_spline[type2w2r[itype][jtype]][m];
-	w2p = (coeff[0]*p + coeff[1])*p + coeff[2];
-	w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        w2p = (coeff[0]*p + coeff[1])*p + coeff[2];
+        w2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
 
-	recip = 1.0/r;
-	phi = z2*recip;
-	phip = z2p*recip - phi*recip;
-	psip = fp[i]*rhojp + fp[j]*rhoip + phip;
-	fpair = -psip*recip;
+        recip = 1.0/r;
+        phi = z2*recip;
+        phip = z2p*recip - phi*recip;
+        psip = fp[i]*rhojp + fp[j]*rhoip + phip;
+        fpair = -psip*recip;
 
         delmux = mu[i][0]-mu[j][0];
-	delmuy = mu[i][1]-mu[j][1];
-	delmuz = mu[i][2]-mu[j][2];
+        delmuy = mu[i][1]-mu[j][1];
+        delmuz = mu[i][2]-mu[j][2];
         trdelmu = delmux*delx+delmuy*dely+delmuz*delz;
         sumlamxx = lambda[i][0]+lambda[j][0];
         sumlamyy = lambda[i][1]+lambda[j][1];
@@ -340,37 +340,37 @@ void PairADPOMP::eval(int iifrom, int iito, ThrData * const thr)
         sumlamxz = lambda[i][4]+lambda[j][4];
         sumlamxy = lambda[i][5]+lambda[j][5];
         tradellam = sumlamxx*delx*delx+sumlamyy*dely*dely+
-	  sumlamzz*delz*delz+2.0*sumlamxy*delx*dely+
-	  2.0*sumlamxz*delx*delz+2.0*sumlamyz*dely*delz;
+          sumlamzz*delz*delz+2.0*sumlamxy*delx*dely+
+          2.0*sumlamxz*delx*delz+2.0*sumlamyz*dely*delz;
         nu = sumlamxx+sumlamyy+sumlamzz;
 
-        adpx = delmux*u2 + trdelmu*u2p*delx*recip + 
-	  2.0*w2*(sumlamxx*delx+sumlamxy*dely+sumlamxz*delz) + 
-	  w2p*delx*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*delx;
-        adpy = delmuy*u2 + trdelmu*u2p*dely*recip + 
-	  2.0*w2*(sumlamxy*delx+sumlamyy*dely+sumlamyz*delz) + 
-	  w2p*dely*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*dely;
-        adpz = delmuz*u2 + trdelmu*u2p*delz*recip + 
-	  2.0*w2*(sumlamxz*delx+sumlamyz*dely+sumlamzz*delz) + 
-	  w2p*delz*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*delz;
+        adpx = delmux*u2 + trdelmu*u2p*delx*recip +
+          2.0*w2*(sumlamxx*delx+sumlamxy*dely+sumlamxz*delz) +
+          w2p*delx*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*delx;
+        adpy = delmuy*u2 + trdelmu*u2p*dely*recip +
+          2.0*w2*(sumlamxy*delx+sumlamyy*dely+sumlamyz*delz) +
+          w2p*dely*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*dely;
+        adpz = delmuz*u2 + trdelmu*u2p*delz*recip +
+          2.0*w2*(sumlamxz*delx+sumlamyz*dely+sumlamzz*delz) +
+          w2p*delz*recip*tradellam - 1.0/3.0*nu*(w2p*r+2.0*w2)*delz;
         adpx*=-1.0; adpy*=-1.0; adpz*=-1.0;
 
         fx = delx*fpair+adpx;
-	fy = dely*fpair+adpy;
-	fz = delz*fpair+adpz;
-
-	fxtmp += fx;
-	fytmp += fy;
-	fztmp += fz;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	}
-
-	if (EFLAG) evdwl = phi;
-	if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,evdwl,0.0,
-				     fx,fy,fz,delx,dely,delz,thr);
+        fy = dely*fpair+adpy;
+        fz = delz*fpair+adpz;
+
+        fxtmp += fx;
+        fytmp += fy;
+        fztmp += fz;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+        }
+
+        if (EFLAG) evdwl = phi;
+        if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,evdwl,0.0,
+                                     fx,fy,fz,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_adp_omp.h b/src/USER-OMP/pair_adp_omp.h
index 9a7f4023fb..e5c4c4af9f 100644
--- a/src/USER-OMP/pair_adp_omp.h
+++ b/src/USER-OMP/pair_adp_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_airebo_omp.cpp b/src/USER-OMP/pair_airebo_omp.cpp
index 35bc988fea..5000ea2a09 100644
--- a/src/USER-OMP/pair_airebo_omp.cpp
+++ b/src/USER-OMP/pair_airebo_omp.cpp
@@ -77,7 +77,7 @@ void PairAIREBOOMP::compute(int eflag, int vflag)
 ------------------------------------------------------------------------- */
 
 double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
-				    double VA, int vflag_atom, ThrData * const thr)
+                                    double VA, int vflag_atom, ThrData * const thr)
 {
   int atomi,atomj,k,n,l,atomk,atoml,atomn,atom1,atom2,atom3,atom4;
   int itype,jtype,ktype,ltype,ntype;
@@ -140,12 +140,12 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       rik[2] = x[atomi][2]-x[atomk][2];
       rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
       lamdajik = 4.0*kronecker(itype,1) *
-	((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
+        ((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
       wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dS);
       Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
-	(wik*kronecker(itype,1));
+        (wik*kronecker(itype,1));
       cosjik = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) /
-	(rijmag*rikmag);
+        (rijmag*rikmag);
       cosjik = MIN(cosjik,1.0);
       cosjik = MAX(cosjik,-1.0);
 
@@ -180,7 +180,7 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       rik[2] = x[atomi][2]-x[atomk][2];
       rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
       lamdajik = 4.0*kronecker(itype,1) *
-	((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
+        ((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
       wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
 
       const double invrikm = 1.0/rikmag;
@@ -192,11 +192,11 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       cosjik = MAX(cosjik,-1.0);
 
       dcosjikdri[0] = ((rij[0]+rik[0])*invrijkm) -
-	(cosjik*((rij[0]*invrijm2)+(rik[0]*invrikm2)));
+        (cosjik*((rij[0]*invrijm2)+(rik[0]*invrikm2)));
       dcosjikdri[1] = ((rij[1]+rik[1])*invrijkm) -
-	(cosjik*((rij[1]*invrijm2)+(rik[1]*invrikm2)));
+        (cosjik*((rij[1]*invrijm2)+(rik[1]*invrikm2)));
       dcosjikdri[2] = ((rij[2]+rik[2])*invrijkm) -
-	(cosjik*((rij[2]*invrijm2)+(rik[2]*invrikm2)));
+        (cosjik*((rij[2]*invrijm2)+(rik[2]*invrikm2)));
       dcosjikdrk[0] = (-rij[0]*invrijkm) + (cosjik*(rik[0]*invrikm2));
       dcosjikdrk[1] = (-rij[1]*invrijkm) + (cosjik*(rik[1]*invrikm2));
       dcosjikdrk[2] = (-rij[2]*invrijkm) + (cosjik*(rik[2]*invrikm2));
@@ -264,9 +264,9 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       f[atomk][0] += fk[0]; f[atomk][1] += fk[1]; f[atomk][2] += fk[2];
 
       if (vflag_atom) {
-	rji[0] = -rij[0]; rji[1] = -rij[1]; rji[2] = -rij[2];
-	rki[0] = -rik[0]; rki[1] = -rik[1]; rki[2] = -rik[2];
-	v_tally3_thr(atomi,atomj,atomk,fj,fk,rji,rki,thr);
+        rji[0] = -rij[0]; rji[1] = -rij[1]; rji[2] = -rij[2];
+        rki[0] = -rik[0]; rki[1] = -rik[1]; rki[2] = -rik[2];
+        v_tally3_thr(atomi,atomj,atomk,fj,fk,rji,rki,thr);
       }
     }
   }
@@ -286,12 +286,12 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       rjl[2] = x[atomj][2]-x[atoml][2];
       rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
       lamdaijl = 4.0*kronecker(jtype,1) *
-	((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
+        ((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
       wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dS);
       Nlj = nC[atoml]-(wjl*kronecker(jtype,0)) +
-	nH[atoml]-(wjl*kronecker(jtype,1));
+        nH[atoml]-(wjl*kronecker(jtype,1));
       cosijl = -1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2])) /
-	(rijmag*rjlmag);
+        (rijmag*rjlmag);
       cosijl = MIN(cosijl,1.0);
       cosijl = MAX(cosijl,-1.0);
 
@@ -321,7 +321,7 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       rjl[2] = x[atomj][2]-x[atoml][2];
       rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
       lamdaijl = 4.0*kronecker(jtype,1) *
-	((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
+        ((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
       wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
 
       const double invrjlm = 1.0/rjlmag;
@@ -329,7 +329,7 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       const double invrjlm2 = invrjlm*invrjlm;
 
       cosijl = (-1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2])))
-	* invrijlm;
+        * invrijlm;
 
       cosijl = MIN(cosijl,1.0);
       cosijl = MAX(cosijl,-1.0);
@@ -338,11 +338,11 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       dcosijldri[1] = (-rjl[1]*invrijlm) - (cosijl*rij[1]*invrijm2);
       dcosijldri[2] = (-rjl[2]*invrijlm) - (cosijl*rij[2]*invrijm2);
       dcosijldrj[0] = ((-rij[0]+rjl[0])*invrijlm) +
-	(cosijl*((rij[0]*invrijm2)-(rjl[0]*invrjlm2)));
+        (cosijl*((rij[0]*invrijm2)-(rjl[0]*invrjlm2)));
       dcosijldrj[1] = ((-rij[1]+rjl[1])*invrijlm) +
-	(cosijl*((rij[1]*invrijm2)-(rjl[1]*invrjlm2)));
+        (cosijl*((rij[1]*invrijm2)-(rjl[1]*invrjlm2)));
       dcosijldrj[2] = ((-rij[2]+rjl[2])*invrijlm) +
-	(cosijl*((rij[2]*invrijm2)-(rjl[2]*invrjlm2)));
+        (cosijl*((rij[2]*invrijm2)-(rjl[2]*invrjlm2)));
       dcosijldrl[0] = (rij[0]*invrijlm)+(cosijl*rjl[0]*invrjlm2);
       dcosijldrl[1] = (rij[1]*invrijlm)+(cosijl*rjl[1]*invrjlm2);
       dcosijldrl[2] = (rij[2]*invrijlm)+(cosijl*rjl[2]*invrjlm2);
@@ -409,8 +409,8 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       f[atoml][0] += fl[0]; f[atoml][1] += fl[1]; f[atoml][2] += fl[2];
 
       if (vflag_atom) {
-	rlj[0] = -rjl[0]; rlj[1] = -rjl[1]; rlj[2] = -rjl[2];
-	v_tally3_thr(atomi,atomj,atoml,fi,fl,rij,rlj,thr);
+        rlj[0] = -rjl[0]; rlj[1] = -rjl[1]; rlj[2] = -rjl[2];
+        v_tally3_thr(atomi,atomj,atoml,fi,fl,rij,rlj,thr);
       }
     }
   }
@@ -433,7 +433,7 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
       wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
       Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
-	(wik*kronecker(itype,1));
+        (wik*kronecker(itype,1));
       SpN = Sp(Nki,Nmin,Nmax,dNki);
 
       tmp2 = VA*dN3[0]*dwik/rikmag;
@@ -457,28 +457,28 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
 
       if (fabs(dNki) > TOL) {
-	REBO_neighs_k = REBO_firstneigh[atomk];
-	for (n = 0; n < REBO_numneigh[atomk]; n++) {
-	  atomn = REBO_neighs_k[n];
-	  if (atomn != atomi) {
-	    ntype = map[type[atomn]];
-	    rkn[0] = x[atomk][0]-x[atomn][0];
-	    rkn[1] = x[atomk][1]-x[atomn][1];
-	    rkn[2] = x[atomk][2]-x[atomn][2];
-	    rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
-	    Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
-
-	    tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)/rknmag;
-	    f[atomk][0] -= tmp2*rkn[0];
-	    f[atomk][1] -= tmp2*rkn[1];
-	    f[atomk][2] -= tmp2*rkn[2];
-	    f[atomn][0] += tmp2*rkn[0];
-	    f[atomn][1] += tmp2*rkn[1];
-	    f[atomn][2] += tmp2*rkn[2];
-
-	    if (vflag_atom) v_tally2_thr(atomk,atomn,-tmp2,rkn,thr);
-	  }
-	}
+        REBO_neighs_k = REBO_firstneigh[atomk];
+        for (n = 0; n < REBO_numneigh[atomk]; n++) {
+          atomn = REBO_neighs_k[n];
+          if (atomn != atomi) {
+            ntype = map[type[atomn]];
+            rkn[0] = x[atomk][0]-x[atomn][0];
+            rkn[1] = x[atomk][1]-x[atomn][1];
+            rkn[2] = x[atomk][2]-x[atomn][2];
+            rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
+            Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
+
+            tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)/rknmag;
+            f[atomk][0] -= tmp2*rkn[0];
+            f[atomk][1] -= tmp2*rkn[1];
+            f[atomk][2] -= tmp2*rkn[2];
+            f[atomn][0] += tmp2*rkn[0];
+            f[atomn][1] += tmp2*rkn[1];
+            f[atomn][2] += tmp2*rkn[2];
+
+            if (vflag_atom) v_tally2_thr(atomk,atomn,-tmp2,rkn,thr);
+          }
+        }
       }
     }
   }
@@ -496,7 +496,7 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
       wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
       Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
-	(wjl*kronecker(jtype,1));
+        (wjl*kronecker(jtype,1));
       SpN = Sp(Nlj,Nmin,Nmax,dNlj);
 
       tmp2 = VA*dN3[1]*dwjl/rjlmag;
@@ -520,28 +520,28 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
 
       if (fabs(dNlj) > TOL) {
-	REBO_neighs_l = REBO_firstneigh[atoml];
-	for (n = 0; n < REBO_numneigh[atoml]; n++) {
-	  atomn = REBO_neighs_l[n];
-	  if (atomn != atomj) {
-	    ntype = map[type[atomn]];
-	    rln[0] = x[atoml][0]-x[atomn][0];
-	    rln[1] = x[atoml][1]-x[atomn][1];
-	    rln[2] = x[atoml][2]-x[atomn][2];
-	    rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
-	    Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
-
-	    tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)/rlnmag;
-	    f[atoml][0] -= tmp2*rln[0];
-	    f[atoml][1] -= tmp2*rln[1];
-	    f[atoml][2] -= tmp2*rln[2];
-	    f[atomn][0] += tmp2*rln[0];
-	    f[atomn][1] += tmp2*rln[1];
-	    f[atomn][2] += tmp2*rln[2];
-
-	    if (vflag_atom) v_tally2_thr(atoml,atomn,-tmp2,rln,thr);
-	  }
-	}
+        REBO_neighs_l = REBO_firstneigh[atoml];
+        for (n = 0; n < REBO_numneigh[atoml]; n++) {
+          atomn = REBO_neighs_l[n];
+          if (atomn != atomj) {
+            ntype = map[type[atomn]];
+            rln[0] = x[atoml][0]-x[atomn][0];
+            rln[1] = x[atoml][1]-x[atomn][1];
+            rln[2] = x[atoml][2]-x[atomn][2];
+            rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
+            Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
+
+            tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)/rlnmag;
+            f[atoml][0] -= tmp2*rln[0];
+            f[atoml][1] -= tmp2*rln[1];
+            f[atoml][2] -= tmp2*rln[2];
+            f[atomn][0] += tmp2*rln[0];
+            f[atomn][1] += tmp2*rln[1];
+            f[atomn][2] += tmp2*rln[2];
+
+            if (vflag_atom) v_tally2_thr(atoml,atomn,-tmp2,rln,thr);
+          }
+        }
       }
     }
   }
@@ -571,197 +571,197 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
       atom1 = atomk;
       ktype = map[type[atomk]];
       if (atomk != atomj) {
-	r21[0] = x[atom2][0]-x[atom1][0];
-	r21[1] = x[atom2][1]-x[atom1][1];
-	r21[2] = x[atom2][2]-x[atom1][2];
-	r21mag = sqrt(r21[0]*r21[0] + r21[1]*r21[1] + r21[2]*r21[2]);
-	cos321 = -1.0*((r21[0]*r32[0])+(r21[1]*r32[1])+(r21[2]*r32[2])) /
-	  (r21mag*r32mag);
-	cos321 = MIN(cos321,1.0);
-	cos321 = MAX(cos321,-1.0);
-	Sp2(cos321,thmin,thmax,dcut321);
-	sin321 = sqrt(1.0 - cos321*cos321);
-	sink2i = 1.0/(sin321*sin321);
-	rik2i = 1.0/(r21mag*r21mag);
-	if (sin321 != 0.0) {
-	  rr = (r23mag*r23mag)-(r21mag*r21mag);
-	  rjk[0] = r21[0]-r23[0];
-	  rjk[1] = r21[1]-r23[1];
-	  rjk[2] = r21[2]-r23[2];
-	  rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
-	  rijrik = 2.0*r23mag*r21mag;
-	  rik2 = r21mag*r21mag;
-	  dctik = (-rr+rjk2)/(rijrik*rik2);
-	  dctij = (rr+rjk2)/(rijrik*r23mag*r23mag);
-	  dctjk = -2.0/rijrik;
-	  w21 = Sp(r21mag,rcmin[itype][ktype],rcmaxp[itype][ktype],dw21);
-	  rijmag = r32mag;
-	  rikmag = r21mag;
-	  rij2 = r32mag*r32mag;
-	  rik2 = r21mag*r21mag;
-	  costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
-	  tspjik = Sp2(costmp,thmin,thmax,dtsjik);
-	  dtsjik = -dtsjik;
-
-	  REBO_neighs_j = REBO_firstneigh[j];
-	  for (l = 0; l < REBO_numneigh[j]; l++) {
-	    atoml = REBO_neighs_j[l];
-	    atom4 = atoml;
-	    ltype = map[type[atoml]];
-	    if (!(atoml == atomi || atoml == atomk)) {
-	      r34[0] = x[atom3][0]-x[atom4][0];
-	      r34[1] = x[atom3][1]-x[atom4][1];
-	      r34[2] = x[atom3][2]-x[atom4][2];
-	      r34mag = sqrt((r34[0]*r34[0])+(r34[1]*r34[1])+(r34[2]*r34[2]));
-	      cos234 = (r32[0]*r34[0] + r32[1]*r34[1] + r32[2]*r34[2]) /
-		(r32mag*r34mag);
-	      cos234 = MIN(cos234,1.0);
-	      cos234 = MAX(cos234,-1.0);
-	      sin234 = sqrt(1.0 - cos234*cos234);
-	      sinl2i = 1.0/(sin234*sin234);
-	      rjl2i = 1.0/(r34mag*r34mag);
-
-	      if (sin234 != 0.0) {
-		w34 = Sp(r34mag,rcmin[jtype][ltype],rcmaxp[jtype][ltype],dw34);
-		rr = (r23mag*r23mag)-(r34mag*r34mag);
-		ril[0] = r23[0]+r34[0];
-		ril[1] = r23[1]+r34[1];
-		ril[2] = r23[2]+r34[2];
-		ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
-		rijrjl = 2.0*r23mag*r34mag;
-		rjl2 = r34mag*r34mag;
-		dctjl = (-rr+ril2)/(rijrjl*rjl2);
-		dctji = (rr+ril2)/(rijrjl*r23mag*r23mag);
-		dctil = -2.0/rijrjl;
-		rjlmag = r34mag;
-		rjl2 = r34mag*r34mag;
-		costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
-		tspijl = Sp2(costmp,thmin,thmax,dtsijl);
-		dtsijl = -dtsijl;
-		prefactor = VA*Tij;
-
-		cross321[0] = (r32[1]*r21[2])-(r32[2]*r21[1]);
-		cross321[1] = (r32[2]*r21[0])-(r32[0]*r21[2]);
-		cross321[2] = (r32[0]*r21[1])-(r32[1]*r21[0]);
-		cross234[0] = (r23[1]*r34[2])-(r23[2]*r34[1]);
-		cross234[1] = (r23[2]*r34[0])-(r23[0]*r34[2]);
-		cross234[2] = (r23[0]*r34[1])-(r23[1]*r34[0]);
-
-		cwnum = (cross321[0]*cross234[0]) +
-		  (cross321[1]*cross234[1]) + (cross321[2]*cross234[2]);
-		cwnom = r21mag*r34mag*r23mag*r23mag*sin321*sin234;
-		om1234 = cwnum/cwnom;
-		cw = om1234;
-		Etmp += ((1.0-(om1234*om1234))*w21*w34) *
-		  (1.0-tspjik)*(1.0-tspijl);
-
-		dt1dik = (rik2i)-(dctik*sink2i*cos321);
-		dt1djk = (-dctjk*sink2i*cos321);
-		dt1djl = (rjl2i)-(dctjl*sinl2i*cos234);
-		dt1dil = (-dctil*sinl2i*cos234);
-		dt1dij = (2.0/(r23mag*r23mag))-(dctij*sink2i*cos321) -
-		  (dctji*sinl2i*cos234);
-
-		dt2dik[0] = (-r23[2]*cross234[1])+(r23[1]*cross234[2]);
-		dt2dik[1] = (-r23[0]*cross234[2])+(r23[2]*cross234[0]);
-		dt2dik[2] = (-r23[1]*cross234[0])+(r23[0]*cross234[1]);
-
-		dt2djl[0] = (-r23[1]*cross321[2])+(r23[2]*cross321[1]);
-		dt2djl[1] = (-r23[2]*cross321[0])+(r23[0]*cross321[2]);
-		dt2djl[2] = (-r23[0]*cross321[1])+(r23[1]*cross321[0]);
-
-		dt2dij[0] = (r21[2]*cross234[1])-(r34[2]*cross321[1]) -
-		  (r21[1]*cross234[2])+(r34[1]*cross321[2]);
-		dt2dij[1] = (r21[0]*cross234[2])-(r34[0]*cross321[2]) -
-		  (r21[2]*cross234[0])+(r34[2]*cross321[0]);
-		dt2dij[2] = (r21[1]*cross234[0])-(r34[1]*cross321[0]) -
-		  (r21[0]*cross234[1])+(r34[0]*cross321[1]);
-
-		aa = (prefactor*2.0*cw/cwnom)*w21*w34 *
-		  (1.0-tspjik)*(1.0-tspijl);
-		aaa1 = -prefactor*(1.0-(om1234*om1234)) *
-		  (1.0-tspjik)*(1.0-tspijl);
-		aaa2 = aaa1*w21*w34;
-		at2 = aa*cwnum;
-
-		fcijpc = (-dt1dij*at2)+(aaa2*dtsjik*dctij*(1.0-tspijl)) +
-		  (aaa2*dtsijl*dctji*(1.0-tspjik));
-		fcikpc = (-dt1dik*at2)+(aaa2*dtsjik*dctik*(1.0-tspijl));
-		fcjlpc = (-dt1djl*at2)+(aaa2*dtsijl*dctjl*(1.0-tspjik));
-		fcjkpc = (-dt1djk*at2)+(aaa2*dtsjik*dctjk*(1.0-tspijl));
-		fcilpc = (-dt1dil*at2)+(aaa2*dtsijl*dctil*(1.0-tspjik));
-
-		F23[0] = (fcijpc*r23[0])+(aa*dt2dij[0]);
-		F23[1] = (fcijpc*r23[1])+(aa*dt2dij[1]);
-		F23[2] = (fcijpc*r23[2])+(aa*dt2dij[2]);
-
-		F12[0] = (fcikpc*r21[0])+(aa*dt2dik[0]);
-		F12[1] = (fcikpc*r21[1])+(aa*dt2dik[1]);
-		F12[2] = (fcikpc*r21[2])+(aa*dt2dik[2]);
-
-		F34[0] = (fcjlpc*r34[0])+(aa*dt2djl[0]);
-		F34[1] = (fcjlpc*r34[1])+(aa*dt2djl[1]);
-		F34[2] = (fcjlpc*r34[2])+(aa*dt2djl[2]);
-
-		F31[0] = (fcjkpc*rjk[0]);
-		F31[1] = (fcjkpc*rjk[1]);
-		F31[2] = (fcjkpc*rjk[2]);
-
-		F24[0] = (fcilpc*ril[0]);
-		F24[1] = (fcilpc*ril[1]);
-		F24[2] = (fcilpc*ril[2]);
-
-		f1[0] = -F12[0]-F31[0];
-		f1[1] = -F12[1]-F31[1];
-		f1[2] = -F12[2]-F31[2];
-		f2[0] = F23[0]+F12[0]+F24[0];
-		f2[1] = F23[1]+F12[1]+F24[1];
-		f2[2] = F23[2]+F12[2]+F24[2];
-		f3[0] = -F23[0]+F34[0]+F31[0];
-		f3[1] = -F23[1]+F34[1]+F31[1];
-		f3[2] = -F23[2]+F34[2]+F31[2];
-		f4[0] = -F34[0]-F24[0];
-		f4[1] = -F34[1]-F24[1];
-		f4[2] = -F34[2]-F24[2];
-
-		// coordination forces
-
-		tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
-		  (1.0-tspjik)*(1.0-tspijl)*dw21*w34/r21mag;
-		f2[0] -= tmp2*r21[0];
-		f2[1] -= tmp2*r21[1];
-		f2[2] -= tmp2*r21[2];
-		f1[0] += tmp2*r21[0];
-		f1[1] += tmp2*r21[1];
-		f1[2] += tmp2*r21[2];
-
-		tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
-		  (1.0-tspjik)*(1.0-tspijl)*w21*dw34/r34mag;
-		f3[0] -= tmp2*r34[0];
-		f3[1] -= tmp2*r34[1];
-		f3[2] -= tmp2*r34[2];
-		f4[0] += tmp2*r34[0];
-		f4[1] += tmp2*r34[1];
-		f4[2] += tmp2*r34[2];
-
-		f[atom1][0] += f1[0]; f[atom1][1] += f1[1];
-		f[atom1][2] += f1[2];
-		f[atom2][0] += f2[0]; f[atom2][1] += f2[1];
-		f[atom2][2] += f2[2];
-		f[atom3][0] += f3[0]; f[atom3][1] += f3[1];
-		f[atom3][2] += f3[2];
-		f[atom4][0] += f4[0]; f[atom4][1] += f4[1];
-		f[atom4][2] += f4[2];
-
-		if (vflag_atom) {
-		  r13[0] = -rjk[0]; r13[1] = -rjk[1]; r13[2] = -rjk[2];
-		  r43[0] = -r34[0]; r43[1] = -r34[1]; r43[2] = -r34[2];
-		  v_tally4_thr(atom1,atom2,atom3,atom4,f1,f2,f4,r13,r23,r43,thr);
-		}
-	      }
-	    }
-	  }
-	}
+        r21[0] = x[atom2][0]-x[atom1][0];
+        r21[1] = x[atom2][1]-x[atom1][1];
+        r21[2] = x[atom2][2]-x[atom1][2];
+        r21mag = sqrt(r21[0]*r21[0] + r21[1]*r21[1] + r21[2]*r21[2]);
+        cos321 = -1.0*((r21[0]*r32[0])+(r21[1]*r32[1])+(r21[2]*r32[2])) /
+          (r21mag*r32mag);
+        cos321 = MIN(cos321,1.0);
+        cos321 = MAX(cos321,-1.0);
+        Sp2(cos321,thmin,thmax,dcut321);
+        sin321 = sqrt(1.0 - cos321*cos321);
+        sink2i = 1.0/(sin321*sin321);
+        rik2i = 1.0/(r21mag*r21mag);
+        if (sin321 != 0.0) {
+          rr = (r23mag*r23mag)-(r21mag*r21mag);
+          rjk[0] = r21[0]-r23[0];
+          rjk[1] = r21[1]-r23[1];
+          rjk[2] = r21[2]-r23[2];
+          rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
+          rijrik = 2.0*r23mag*r21mag;
+          rik2 = r21mag*r21mag;
+          dctik = (-rr+rjk2)/(rijrik*rik2);
+          dctij = (rr+rjk2)/(rijrik*r23mag*r23mag);
+          dctjk = -2.0/rijrik;
+          w21 = Sp(r21mag,rcmin[itype][ktype],rcmaxp[itype][ktype],dw21);
+          rijmag = r32mag;
+          rikmag = r21mag;
+          rij2 = r32mag*r32mag;
+          rik2 = r21mag*r21mag;
+          costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
+          tspjik = Sp2(costmp,thmin,thmax,dtsjik);
+          dtsjik = -dtsjik;
+
+          REBO_neighs_j = REBO_firstneigh[j];
+          for (l = 0; l < REBO_numneigh[j]; l++) {
+            atoml = REBO_neighs_j[l];
+            atom4 = atoml;
+            ltype = map[type[atoml]];
+            if (!(atoml == atomi || atoml == atomk)) {
+              r34[0] = x[atom3][0]-x[atom4][0];
+              r34[1] = x[atom3][1]-x[atom4][1];
+              r34[2] = x[atom3][2]-x[atom4][2];
+              r34mag = sqrt((r34[0]*r34[0])+(r34[1]*r34[1])+(r34[2]*r34[2]));
+              cos234 = (r32[0]*r34[0] + r32[1]*r34[1] + r32[2]*r34[2]) /
+                (r32mag*r34mag);
+              cos234 = MIN(cos234,1.0);
+              cos234 = MAX(cos234,-1.0);
+              sin234 = sqrt(1.0 - cos234*cos234);
+              sinl2i = 1.0/(sin234*sin234);
+              rjl2i = 1.0/(r34mag*r34mag);
+
+              if (sin234 != 0.0) {
+                w34 = Sp(r34mag,rcmin[jtype][ltype],rcmaxp[jtype][ltype],dw34);
+                rr = (r23mag*r23mag)-(r34mag*r34mag);
+                ril[0] = r23[0]+r34[0];
+                ril[1] = r23[1]+r34[1];
+                ril[2] = r23[2]+r34[2];
+                ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
+                rijrjl = 2.0*r23mag*r34mag;
+                rjl2 = r34mag*r34mag;
+                dctjl = (-rr+ril2)/(rijrjl*rjl2);
+                dctji = (rr+ril2)/(rijrjl*r23mag*r23mag);
+                dctil = -2.0/rijrjl;
+                rjlmag = r34mag;
+                rjl2 = r34mag*r34mag;
+                costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
+                tspijl = Sp2(costmp,thmin,thmax,dtsijl);
+                dtsijl = -dtsijl;
+                prefactor = VA*Tij;
+
+                cross321[0] = (r32[1]*r21[2])-(r32[2]*r21[1]);
+                cross321[1] = (r32[2]*r21[0])-(r32[0]*r21[2]);
+                cross321[2] = (r32[0]*r21[1])-(r32[1]*r21[0]);
+                cross234[0] = (r23[1]*r34[2])-(r23[2]*r34[1]);
+                cross234[1] = (r23[2]*r34[0])-(r23[0]*r34[2]);
+                cross234[2] = (r23[0]*r34[1])-(r23[1]*r34[0]);
+
+                cwnum = (cross321[0]*cross234[0]) +
+                  (cross321[1]*cross234[1]) + (cross321[2]*cross234[2]);
+                cwnom = r21mag*r34mag*r23mag*r23mag*sin321*sin234;
+                om1234 = cwnum/cwnom;
+                cw = om1234;
+                Etmp += ((1.0-(om1234*om1234))*w21*w34) *
+                  (1.0-tspjik)*(1.0-tspijl);
+
+                dt1dik = (rik2i)-(dctik*sink2i*cos321);
+                dt1djk = (-dctjk*sink2i*cos321);
+                dt1djl = (rjl2i)-(dctjl*sinl2i*cos234);
+                dt1dil = (-dctil*sinl2i*cos234);
+                dt1dij = (2.0/(r23mag*r23mag))-(dctij*sink2i*cos321) -
+                  (dctji*sinl2i*cos234);
+
+                dt2dik[0] = (-r23[2]*cross234[1])+(r23[1]*cross234[2]);
+                dt2dik[1] = (-r23[0]*cross234[2])+(r23[2]*cross234[0]);
+                dt2dik[2] = (-r23[1]*cross234[0])+(r23[0]*cross234[1]);
+
+                dt2djl[0] = (-r23[1]*cross321[2])+(r23[2]*cross321[1]);
+                dt2djl[1] = (-r23[2]*cross321[0])+(r23[0]*cross321[2]);
+                dt2djl[2] = (-r23[0]*cross321[1])+(r23[1]*cross321[0]);
+
+                dt2dij[0] = (r21[2]*cross234[1])-(r34[2]*cross321[1]) -
+                  (r21[1]*cross234[2])+(r34[1]*cross321[2]);
+                dt2dij[1] = (r21[0]*cross234[2])-(r34[0]*cross321[2]) -
+                  (r21[2]*cross234[0])+(r34[2]*cross321[0]);
+                dt2dij[2] = (r21[1]*cross234[0])-(r34[1]*cross321[0]) -
+                  (r21[0]*cross234[1])+(r34[0]*cross321[1]);
+
+                aa = (prefactor*2.0*cw/cwnom)*w21*w34 *
+                  (1.0-tspjik)*(1.0-tspijl);
+                aaa1 = -prefactor*(1.0-(om1234*om1234)) *
+                  (1.0-tspjik)*(1.0-tspijl);
+                aaa2 = aaa1*w21*w34;
+                at2 = aa*cwnum;
+
+                fcijpc = (-dt1dij*at2)+(aaa2*dtsjik*dctij*(1.0-tspijl)) +
+                  (aaa2*dtsijl*dctji*(1.0-tspjik));
+                fcikpc = (-dt1dik*at2)+(aaa2*dtsjik*dctik*(1.0-tspijl));
+                fcjlpc = (-dt1djl*at2)+(aaa2*dtsijl*dctjl*(1.0-tspjik));
+                fcjkpc = (-dt1djk*at2)+(aaa2*dtsjik*dctjk*(1.0-tspijl));
+                fcilpc = (-dt1dil*at2)+(aaa2*dtsijl*dctil*(1.0-tspjik));
+
+                F23[0] = (fcijpc*r23[0])+(aa*dt2dij[0]);
+                F23[1] = (fcijpc*r23[1])+(aa*dt2dij[1]);
+                F23[2] = (fcijpc*r23[2])+(aa*dt2dij[2]);
+
+                F12[0] = (fcikpc*r21[0])+(aa*dt2dik[0]);
+                F12[1] = (fcikpc*r21[1])+(aa*dt2dik[1]);
+                F12[2] = (fcikpc*r21[2])+(aa*dt2dik[2]);
+
+                F34[0] = (fcjlpc*r34[0])+(aa*dt2djl[0]);
+                F34[1] = (fcjlpc*r34[1])+(aa*dt2djl[1]);
+                F34[2] = (fcjlpc*r34[2])+(aa*dt2djl[2]);
+
+                F31[0] = (fcjkpc*rjk[0]);
+                F31[1] = (fcjkpc*rjk[1]);
+                F31[2] = (fcjkpc*rjk[2]);
+
+                F24[0] = (fcilpc*ril[0]);
+                F24[1] = (fcilpc*ril[1]);
+                F24[2] = (fcilpc*ril[2]);
+
+                f1[0] = -F12[0]-F31[0];
+                f1[1] = -F12[1]-F31[1];
+                f1[2] = -F12[2]-F31[2];
+                f2[0] = F23[0]+F12[0]+F24[0];
+                f2[1] = F23[1]+F12[1]+F24[1];
+                f2[2] = F23[2]+F12[2]+F24[2];
+                f3[0] = -F23[0]+F34[0]+F31[0];
+                f3[1] = -F23[1]+F34[1]+F31[1];
+                f3[2] = -F23[2]+F34[2]+F31[2];
+                f4[0] = -F34[0]-F24[0];
+                f4[1] = -F34[1]-F24[1];
+                f4[2] = -F34[2]-F24[2];
+
+                // coordination forces
+
+                tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
+                  (1.0-tspjik)*(1.0-tspijl)*dw21*w34/r21mag;
+                f2[0] -= tmp2*r21[0];
+                f2[1] -= tmp2*r21[1];
+                f2[2] -= tmp2*r21[2];
+                f1[0] += tmp2*r21[0];
+                f1[1] += tmp2*r21[1];
+                f1[2] += tmp2*r21[2];
+
+                tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
+                  (1.0-tspjik)*(1.0-tspijl)*w21*dw34/r34mag;
+                f3[0] -= tmp2*r34[0];
+                f3[1] -= tmp2*r34[1];
+                f3[2] -= tmp2*r34[2];
+                f4[0] += tmp2*r34[0];
+                f4[1] += tmp2*r34[1];
+                f4[2] += tmp2*r34[2];
+
+                f[atom1][0] += f1[0]; f[atom1][1] += f1[1];
+                f[atom1][2] += f1[2];
+                f[atom2][0] += f2[0]; f[atom2][1] += f2[1];
+                f[atom2][2] += f2[2];
+                f[atom3][0] += f3[0]; f[atom3][1] += f3[1];
+                f[atom3][2] += f3[2];
+                f[atom4][0] += f4[0]; f[atom4][1] += f4[1];
+                f[atom4][2] += f4[2];
+
+                if (vflag_atom) {
+                  r13[0] = -rjk[0]; r13[1] = -rjk[1]; r13[2] = -rjk[2];
+                  r43[0] = -r34[0]; r43[1] = -r34[1]; r43[2] = -r34[2];
+                  v_tally4_thr(atom1,atom2,atom3,atom4,f1,f2,f4,r13,r23,r43,thr);
+                }
+              }
+            }
+          }
+        }
       }
     }
 
@@ -771,60 +771,60 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
     for (k = 0; k < REBO_numneigh[i]; k++) {
       atomk = REBO_neighs[k];
       if (atomk != atomj) {
-	ktype = map[type[atomk]];
-	rik[0] = x[atomi][0]-x[atomk][0];
-	rik[1] = x[atomi][1]-x[atomk][1];
-	rik[2] = x[atomi][2]-x[atomk][2];
-	rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
-	wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-	Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
-	  (wik*kronecker(itype,1));
-	SpN = Sp(Nki,Nmin,Nmax,dNki);
-
-	tmp2 = VA*dN3[0]*dwik*Etmp/rikmag;
-	f[atomi][0] -= tmp2*rik[0];
-	f[atomi][1] -= tmp2*rik[1];
-	f[atomi][2] -= tmp2*rik[2];
-	f[atomk][0] += tmp2*rik[0];
-	f[atomk][1] += tmp2*rik[1];
-	f[atomk][2] += tmp2*rik[2];
-
-	if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
-
-	tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)*Etmp/rikmag;
-	f[atomi][0] -= tmp2*rik[0];
-	f[atomi][1] -= tmp2*rik[1];
-	f[atomi][2] -= tmp2*rik[2];
-	f[atomk][0] += tmp2*rik[0];
-	f[atomk][1] += tmp2*rik[1];
-	f[atomk][2] += tmp2*rik[2];
-
-	if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
-
-	if (fabs(dNki) > TOL) {
-	  REBO_neighs_k = REBO_firstneigh[atomk];
-	  for (n = 0; n < REBO_numneigh[atomk]; n++) {
-	    atomn = REBO_neighs_k[n];
-	    ntype = map[type[atomn]];
-	    if (atomn != atomi) {
-	      rkn[0] = x[atomk][0]-x[atomn][0];
-	      rkn[1] = x[atomk][1]-x[atomn][1];
-	      rkn[2] = x[atomk][2]-x[atomn][2];
-	      rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
-	      Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
-
-	      tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)*Etmp/rknmag;
-	      f[atomk][0] -= tmp2*rkn[0];
-	      f[atomk][1] -= tmp2*rkn[1];
-	      f[atomk][2] -= tmp2*rkn[2];
-	      f[atomn][0] += tmp2*rkn[0];
-	      f[atomn][1] += tmp2*rkn[1];
-	      f[atomn][2] += tmp2*rkn[2];
-
-	      if (vflag_atom) v_tally2_thr(atomk,atomn,-tmp2,rkn,thr);
-	    }
-	  }
-	}
+        ktype = map[type[atomk]];
+        rik[0] = x[atomi][0]-x[atomk][0];
+        rik[1] = x[atomi][1]-x[atomk][1];
+        rik[2] = x[atomi][2]-x[atomk][2];
+        rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
+        wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
+        Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
+          (wik*kronecker(itype,1));
+        SpN = Sp(Nki,Nmin,Nmax,dNki);
+
+        tmp2 = VA*dN3[0]*dwik*Etmp/rikmag;
+        f[atomi][0] -= tmp2*rik[0];
+        f[atomi][1] -= tmp2*rik[1];
+        f[atomi][2] -= tmp2*rik[2];
+        f[atomk][0] += tmp2*rik[0];
+        f[atomk][1] += tmp2*rik[1];
+        f[atomk][2] += tmp2*rik[2];
+
+        if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
+
+        tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)*Etmp/rikmag;
+        f[atomi][0] -= tmp2*rik[0];
+        f[atomi][1] -= tmp2*rik[1];
+        f[atomi][2] -= tmp2*rik[2];
+        f[atomk][0] += tmp2*rik[0];
+        f[atomk][1] += tmp2*rik[1];
+        f[atomk][2] += tmp2*rik[2];
+
+        if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
+
+        if (fabs(dNki) > TOL) {
+          REBO_neighs_k = REBO_firstneigh[atomk];
+          for (n = 0; n < REBO_numneigh[atomk]; n++) {
+            atomn = REBO_neighs_k[n];
+            ntype = map[type[atomn]];
+            if (atomn != atomi) {
+              rkn[0] = x[atomk][0]-x[atomn][0];
+              rkn[1] = x[atomk][1]-x[atomn][1];
+              rkn[2] = x[atomk][2]-x[atomn][2];
+              rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
+              Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
+
+              tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)*Etmp/rknmag;
+              f[atomk][0] -= tmp2*rkn[0];
+              f[atomk][1] -= tmp2*rkn[1];
+              f[atomk][2] -= tmp2*rkn[2];
+              f[atomn][0] += tmp2*rkn[0];
+              f[atomn][1] += tmp2*rkn[1];
+              f[atomn][2] += tmp2*rkn[2];
+
+              if (vflag_atom) v_tally2_thr(atomk,atomn,-tmp2,rkn,thr);
+            }
+          }
+        }
       }
     }
 
@@ -834,60 +834,60 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
     for (l = 0; l < REBO_numneigh[j]; l++) {
       atoml = REBO_neighs[l];
       if (atoml != atomi) {
-	ltype = map[type[atoml]];
-	rjl[0] = x[atomj][0]-x[atoml][0];
-	rjl[1] = x[atomj][1]-x[atoml][1];
-	rjl[2] = x[atomj][2]-x[atoml][2];
-	rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
-	wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
-	Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
-	  (wjl*kronecker(jtype,1));
-	SpN = Sp(Nlj,Nmin,Nmax,dNlj);
-
-	tmp2 = VA*dN3[1]*dwjl*Etmp/rjlmag;
-	f[atomj][0] -= tmp2*rjl[0];
-	f[atomj][1] -= tmp2*rjl[1];
-	f[atomj][2] -= tmp2*rjl[2];
-	f[atoml][0] += tmp2*rjl[0];
-	f[atoml][1] += tmp2*rjl[1];
-	f[atoml][2] += tmp2*rjl[2];
-
-	if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
-
-	tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)*Etmp/rjlmag;
-	f[atomj][0] -= tmp2*rjl[0];
-	f[atomj][1] -= tmp2*rjl[1];
-	f[atomj][2] -= tmp2*rjl[2];
-	f[atoml][0] += tmp2*rjl[0];
-	f[atoml][1] += tmp2*rjl[1];
-	f[atoml][2] += tmp2*rjl[2];
-
-	if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
-
-	if (fabs(dNlj) > TOL) {
-	  REBO_neighs_l = REBO_firstneigh[atoml];
-	  for (n = 0; n < REBO_numneigh[atoml]; n++) {
-	    atomn = REBO_neighs_l[n];
-	    ntype = map[type[atomn]];
-	    if (atomn !=atomj) {
-	      rln[0] = x[atoml][0]-x[atomn][0];
-	      rln[1] = x[atoml][1]-x[atomn][1];
-	      rln[2] = x[atoml][2]-x[atomn][2];
-	      rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
-	      Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
-
-	      tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)*Etmp/rlnmag;
-	      f[atoml][0] -= tmp2*rln[0];
-	      f[atoml][1] -= tmp2*rln[1];
-	      f[atoml][2] -= tmp2*rln[2];
-	      f[atomn][0] += tmp2*rln[0];
-	      f[atomn][1] += tmp2*rln[1];
-	      f[atomn][2] += tmp2*rln[2];
-
-	      if (vflag_atom) v_tally2_thr(atoml,atomn,-tmp2,rln,thr);
-	    }
-	  }
-	}
+        ltype = map[type[atoml]];
+        rjl[0] = x[atomj][0]-x[atoml][0];
+        rjl[1] = x[atomj][1]-x[atoml][1];
+        rjl[2] = x[atomj][2]-x[atoml][2];
+        rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
+        wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
+        Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
+          (wjl*kronecker(jtype,1));
+        SpN = Sp(Nlj,Nmin,Nmax,dNlj);
+
+        tmp2 = VA*dN3[1]*dwjl*Etmp/rjlmag;
+        f[atomj][0] -= tmp2*rjl[0];
+        f[atomj][1] -= tmp2*rjl[1];
+        f[atomj][2] -= tmp2*rjl[2];
+        f[atoml][0] += tmp2*rjl[0];
+        f[atoml][1] += tmp2*rjl[1];
+        f[atoml][2] += tmp2*rjl[2];
+
+        if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
+
+        tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)*Etmp/rjlmag;
+        f[atomj][0] -= tmp2*rjl[0];
+        f[atomj][1] -= tmp2*rjl[1];
+        f[atomj][2] -= tmp2*rjl[2];
+        f[atoml][0] += tmp2*rjl[0];
+        f[atoml][1] += tmp2*rjl[1];
+        f[atoml][2] += tmp2*rjl[2];
+
+        if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
+
+        if (fabs(dNlj) > TOL) {
+          REBO_neighs_l = REBO_firstneigh[atoml];
+          for (n = 0; n < REBO_numneigh[atoml]; n++) {
+            atomn = REBO_neighs_l[n];
+            ntype = map[type[atomn]];
+            if (atomn !=atomj) {
+              rln[0] = x[atoml][0]-x[atomn][0];
+              rln[1] = x[atoml][1]-x[atomn][1];
+              rln[2] = x[atoml][2]-x[atomn][2];
+              rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
+              Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
+
+              tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)*Etmp/rlnmag;
+              f[atoml][0] -= tmp2*rln[0];
+              f[atoml][1] -= tmp2*rln[1];
+              f[atoml][2] -= tmp2*rln[2];
+              f[atomn][0] += tmp2*rln[0];
+              f[atomn][1] += tmp2*rln[1];
+              f[atomn][2] += tmp2*rln[2];
+
+              if (vflag_atom) v_tally2_thr(atoml,atomn,-tmp2,rln,thr);
+            }
+          }
+        }
       }
     }
   }
@@ -901,8 +901,8 @@ double PairAIREBOOMP::bondorder_thr(int i, int j, double rij[3], double rijmag,
 ------------------------------------------------------------------------- */
 
 double PairAIREBOOMP::bondorderLJ_thr(int i, int j, double rij[3], double rijmag,
-				      double VA, double rij0[3], double rij0mag,
-				      int vflag_atom, ThrData * const thr)
+                                      double VA, double rij0[3], double rij0mag,
+                                      int vflag_atom, ThrData * const thr)
 {
   int k,n,l,atomk,atoml,atomn,atom1,atom2,atom3,atom4;
   int atomi,atomj,itype,jtype,ktype,ltype,ntype;
@@ -970,12 +970,12 @@ double PairAIREBOOMP::bondorderLJ_thr(int i, int j, double rij[3], double rijmag
       rik[2] = x[atomi][2]-x[atomk][2];
       rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
       lamdajik = 4.0*kronecker(itype,1) *
-	((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
+        ((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
       wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dS);
       Nki = nC[atomk]-(wik*kronecker(itype,0)) +
-	nH[atomk]-(wik*kronecker(itype,1));
+        nH[atomk]-(wik*kronecker(itype,1));
       cosjik = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) /
-	(rijmag*rikmag);
+        (rijmag*rikmag);
       cosjik = MIN(cosjik,1.0);
       cosjik = MAX(cosjik,-1.0);
 
@@ -1010,12 +1010,12 @@ double PairAIREBOOMP::bondorderLJ_thr(int i, int j, double rij[3], double rijmag
       rjl[2] = x[atomj][2]-x[atoml][2];
       rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
       lamdaijl = 4.0*kronecker(jtype,1) *
-	((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
+        ((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
       wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dS);
       Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
-	(wjl*kronecker(jtype,1));
+        (wjl*kronecker(jtype,1));
       cosijl = -1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2])) /
-	(rijmag*rjlmag);
+        (rijmag*rjlmag);
       cosijl = MIN(cosijl,1.0);
       cosijl = MAX(cosijl,-1.0);
 
@@ -1054,73 +1054,73 @@ double PairAIREBOOMP::bondorderLJ_thr(int i, int j, double rij[3], double rijmag
       atomk = REBO_neighs_i[k];
       ktype = map[type[atomk]];
       if (atomk != atomj) {
-	rik[0] = x[atomi][0]-x[atomk][0];
-	rik[1] = x[atomi][1]-x[atomk][1];
-	rik[2] = x[atomi][2]-x[atomk][2];
-	rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
-	cos321 = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) /
-	  (rijmag*rikmag);
-	cos321 = MIN(cos321,1.0);
-	cos321 = MAX(cos321,-1.0);
-
-	rjk[0] = rik[0]-rij[0];
-	rjk[1] = rik[1]-rij[1];
-	rjk[2] = rik[2]-rij[2];
-	rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
-	rij2 = rijmag*rijmag;
-	rik2 = rikmag*rikmag;
-	costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
-	tspjik = Sp2(costmp,thmin,thmax,dtsjik);
-
-	if (sqrt(1.0 - cos321*cos321) > sqrt(TOL)) {
-	  wik = Sp(rikmag,rcmin[itype][ktype],rcmaxp[itype][ktype],dwik);
-	  REBO_neighs_j = REBO_firstneigh[j];
-	  for (l = 0; l < REBO_numneigh[j]; l++) {
-	    atoml = REBO_neighs_j[l];
-	    ltype = map[type[atoml]];
-	    if (!(atoml == atomi || atoml == atomk)) {
-	      rjl[0] = x[atomj][0]-x[atoml][0];
-	      rjl[1] = x[atomj][1]-x[atoml][1];
-	      rjl[2] = x[atomj][2]-x[atoml][2];
-	      rjlmag = sqrt(rjl[0]*rjl[0] + rjl[1]*rjl[1] + rjl[2]*rjl[2]);
-	      cos234 = -((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2])) /
-		(rijmag*rjlmag);
-	      cos234 = MIN(cos234,1.0);
-	      cos234 = MAX(cos234,-1.0);
-
-	      ril[0] = rij[0]+rjl[0];
-	      ril[1] = rij[1]+rjl[1];
-	      ril[2] = rij[2]+rjl[2];
-	      ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
-	      rijrjl = 2.0*rijmag*rjlmag;
-	      rjl2 = rjlmag*rjlmag;
-	      costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
-	      tspijl = Sp2(costmp,thmin,thmax,dtsijl);
-
-	      if (sqrt(1.0 - cos234*cos234) > sqrt(TOL)) {
-		wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmaxp[jtype][ltype],dS);
-		crosskij[0] = (rij[1]*rik[2]-rij[2]*rik[1]);
-		crosskij[1] = (rij[2]*rik[0]-rij[0]*rik[2]);
-		crosskij[2] = (rij[0]*rik[1]-rij[1]*rik[0]);
-		crosskijmag = sqrt(crosskij[0]*crosskij[0] +
-				   crosskij[1]*crosskij[1] +
-				   crosskij[2]*crosskij[2]);
-		crossijl[0] = (rij[1]*rjl[2]-rij[2]*rjl[1]);
-		crossijl[1] = (rij[2]*rjl[0]-rij[0]*rjl[2]);
-		crossijl[2] = (rij[0]*rjl[1]-rij[1]*rjl[0]);
-		crossijlmag = sqrt(crossijl[0]*crossijl[0] +
-				   crossijl[1]*crossijl[1] +
-				   crossijl[2]*crossijl[2]);
-		omkijl = -1.0*(((crosskij[0]*crossijl[0]) +
-				(crosskij[1]*crossijl[1]) +
-				(crosskij[2]*crossijl[2])) /
-			       (crosskijmag*crossijlmag));
-		Etmp += ((1.0-(omkijl*omkijl))*wik*wjl) *
-		  (1.0-tspjik)*(1.0-tspijl);
-	      }
-	    }
-	  }
-	}
+        rik[0] = x[atomi][0]-x[atomk][0];
+        rik[1] = x[atomi][1]-x[atomk][1];
+        rik[2] = x[atomi][2]-x[atomk][2];
+        rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
+        cos321 = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2])) /
+          (rijmag*rikmag);
+        cos321 = MIN(cos321,1.0);
+        cos321 = MAX(cos321,-1.0);
+
+        rjk[0] = rik[0]-rij[0];
+        rjk[1] = rik[1]-rij[1];
+        rjk[2] = rik[2]-rij[2];
+        rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
+        rij2 = rijmag*rijmag;
+        rik2 = rikmag*rikmag;
+        costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
+        tspjik = Sp2(costmp,thmin,thmax,dtsjik);
+
+        if (sqrt(1.0 - cos321*cos321) > sqrt(TOL)) {
+          wik = Sp(rikmag,rcmin[itype][ktype],rcmaxp[itype][ktype],dwik);
+          REBO_neighs_j = REBO_firstneigh[j];
+          for (l = 0; l < REBO_numneigh[j]; l++) {
+            atoml = REBO_neighs_j[l];
+            ltype = map[type[atoml]];
+            if (!(atoml == atomi || atoml == atomk)) {
+              rjl[0] = x[atomj][0]-x[atoml][0];
+              rjl[1] = x[atomj][1]-x[atoml][1];
+              rjl[2] = x[atomj][2]-x[atoml][2];
+              rjlmag = sqrt(rjl[0]*rjl[0] + rjl[1]*rjl[1] + rjl[2]*rjl[2]);
+              cos234 = -((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2])) /
+                (rijmag*rjlmag);
+              cos234 = MIN(cos234,1.0);
+              cos234 = MAX(cos234,-1.0);
+
+              ril[0] = rij[0]+rjl[0];
+              ril[1] = rij[1]+rjl[1];
+              ril[2] = rij[2]+rjl[2];
+              ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
+              rijrjl = 2.0*rijmag*rjlmag;
+              rjl2 = rjlmag*rjlmag;
+              costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
+              tspijl = Sp2(costmp,thmin,thmax,dtsijl);
+
+              if (sqrt(1.0 - cos234*cos234) > sqrt(TOL)) {
+                wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmaxp[jtype][ltype],dS);
+                crosskij[0] = (rij[1]*rik[2]-rij[2]*rik[1]);
+                crosskij[1] = (rij[2]*rik[0]-rij[0]*rik[2]);
+                crosskij[2] = (rij[0]*rik[1]-rij[1]*rik[0]);
+                crosskijmag = sqrt(crosskij[0]*crosskij[0] +
+                                   crosskij[1]*crosskij[1] +
+                                   crosskij[2]*crosskij[2]);
+                crossijl[0] = (rij[1]*rjl[2]-rij[2]*rjl[1]);
+                crossijl[1] = (rij[2]*rjl[0]-rij[0]*rjl[2]);
+                crossijl[2] = (rij[0]*rjl[1]-rij[1]*rjl[0]);
+                crossijlmag = sqrt(crossijl[0]*crossijl[0] +
+                                   crossijl[1]*crossijl[1] +
+                                   crossijl[2]*crossijl[2]);
+                omkijl = -1.0*(((crosskij[0]*crossijl[0]) +
+                                (crosskij[1]*crossijl[1]) +
+                                (crosskij[2]*crossijl[2])) /
+                               (crosskijmag*crossijlmag));
+                Etmp += ((1.0-(omkijl*omkijl))*wik*wjl) *
+                  (1.0-tspjik)*(1.0-tspijl);
+              }
+            }
+          }
+        }
       }
     }
   }
@@ -1144,102 +1144,102 @@ double PairAIREBOOMP::bondorderLJ_thr(int i, int j, double rij[3], double rijmag
     for (k = 0; k < REBO_numneigh[i]; k++) {
       atomk = REBO_neighs_i[k];
       if (atomk != atomj) {
-	lamdajik = 0.0;
-	rik[0] = x[atomi][0]-x[atomk][0];
-	rik[1] = x[atomi][1]-x[atomk][1];
-	rik[2] = x[atomi][2]-x[atomk][2];
-	rikmag = sqrt(rik[0]*rik[0] + rik[1]*rik[1] + rik[2]*rik[2]);
-	lamdajik = 4.0*kronecker(itype,1) *
-	  ((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
-	wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-
-	const double invrikm = 1.0/rikmag;
-	const double invrijkm = invrijm*invrikm;
-	const double invrikm2 = invrikm*invrikm;
-
-	cosjik = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2]))
-	  * invrijkm;
-	cosjik = MIN(cosjik,1.0);
-	cosjik = MAX(cosjik,-1.0);
-
-	dcosjikdri[0] = ((rij[0]+rik[0])*invrijkm) -
-	  (cosjik*((rij[0]*invrijm2)+(rik[0]*invrikm2)));
-	dcosjikdri[1] = ((rij[1]+rik[1])*invrijkm) -
-	  (cosjik*((rij[1]*invrijm2)+(rik[1]*invrikm2)));
-	dcosjikdri[2] = ((rij[2]+rik[2])*invrijkm) -
-	  (cosjik*((rij[2]*invrijm2)+(rik[2]*invrikm2)));
-	dcosjikdrk[0] = (-rij[0]*invrijkm) + (cosjik*(rik[0]*invrikm2));
-	dcosjikdrk[1] = (-rij[1]*invrijkm) + (cosjik*(rik[1]*invrikm2));
-	dcosjikdrk[2] = (-rij[2]*invrijkm) + (cosjik*(rik[2]*invrikm2));
-	dcosjikdrj[0] = (-rik[0]*invrijkm) + (cosjik*(rij[0]*invrijm2));
-	dcosjikdrj[1] = (-rik[1]*invrijkm) + (cosjik*(rij[1]*invrijm2));
-	dcosjikdrj[2] = (-rik[2]*invrijkm) + (cosjik*(rij[2]*invrijm2));
-
-	g = gSpline(cosjik,(NijC+NijH),itype,&dgdc,&dgdN);
-
-	tmp2 = VA*.5*(tmp*wik*dgdc*exp(lamdajik));
-	fj[0] = -tmp2*dcosjikdrj[0];
-	fj[1] = -tmp2*dcosjikdrj[1];
-	fj[2] = -tmp2*dcosjikdrj[2];
-	fi[0] = -tmp2*dcosjikdri[0];
-	fi[1] = -tmp2*dcosjikdri[1];
-	fi[2] = -tmp2*dcosjikdri[2];
-	fk[0] = -tmp2*dcosjikdrk[0];
-	fk[1] = -tmp2*dcosjikdrk[1];
-	fk[2] = -tmp2*dcosjikdrk[2];
-
-	tmp2 = VA*.5*(tmp*wik*g*exp(lamdajik)*4.0*kronecker(itype,1));
-	fj[0] -= tmp2*(-rij[0]*invrijm);
-	fj[1] -= tmp2*(-rij[1]*invrijm);
-	fj[2] -= tmp2*(-rij[2]*invrijm);
-	fi[0] -= tmp2*((-rik[0]/rikmag)+(rij[0]*invrijm));
-	fi[1] -= tmp2*((-rik[1]/rikmag)+(rij[1]*invrijm));
-	fi[2] -= tmp2*((-rik[2]/rikmag)+(rij[2]*invrijm));
-	fk[0] -= tmp2*(rik[0]/rikmag);
-	fk[1] -= tmp2*(rik[1]/rikmag);
-	fk[2] -= tmp2*(rik[2]/rikmag);
-
-	// coordination forces
-
-	// dwik forces
-
-	tmp2 = VA*.5*(tmp*dwik*g*exp(lamdajik))/rikmag;
-	fi[0] -= tmp2*rik[0];
-	fi[1] -= tmp2*rik[1];
-	fi[2] -= tmp2*rik[2];
-	fk[0] += tmp2*rik[0];
-	fk[1] += tmp2*rik[1];
-	fk[2] += tmp2*rik[2];
-
-	// PIJ forces
-
-	tmp2 = VA*.5*(tmp*dN2[ktype]*dwik)/rikmag;
-	fi[0] -= tmp2*rik[0];
-	fi[1] -= tmp2*rik[1];
-	fi[2] -= tmp2*rik[2];
-	fk[0] += tmp2*rik[0];
-	fk[1] += tmp2*rik[1];
-	fk[2] += tmp2*rik[2];
-
-	// dgdN forces
-
-	tmp2 = VA*.5*(tmp*tmp3*dwik)/rikmag;
-	fi[0] -= tmp2*rik[0];
-	fi[1] -= tmp2*rik[1];
-	fi[2] -= tmp2*rik[2];
-	fk[0] += tmp2*rik[0];
-	fk[1] += tmp2*rik[1];
-	fk[2] += tmp2*rik[2];
-
-	f[atomi][0] += fi[0]; f[atomi][1] += fi[1]; f[atomi][2] += fi[2];
-	f[atomj][0] += fj[0]; f[atomj][1] += fj[1]; f[atomj][2] += fj[2];
-	f[atomk][0] += fk[0]; f[atomk][1] += fk[1]; f[atomk][2] += fk[2];
-
-	if (vflag_atom) {
-	  rji[0] = -rij[0]; rji[1] = -rij[1]; rji[2] = -rij[2];
-	  rki[0] = -rik[0]; rki[1] = -rik[1]; rki[2] = -rik[2];
-	  v_tally3_thr(atomi,atomj,atomk,fj,fk,rji,rki,thr);
-	}
+        lamdajik = 0.0;
+        rik[0] = x[atomi][0]-x[atomk][0];
+        rik[1] = x[atomi][1]-x[atomk][1];
+        rik[2] = x[atomi][2]-x[atomk][2];
+        rikmag = sqrt(rik[0]*rik[0] + rik[1]*rik[1] + rik[2]*rik[2]);
+        lamdajik = 4.0*kronecker(itype,1) *
+          ((rho[ktype][1]-rikmag)-(rho[jtype][1]-rijmag));
+        wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
+
+        const double invrikm = 1.0/rikmag;
+        const double invrijkm = invrijm*invrikm;
+        const double invrikm2 = invrikm*invrikm;
+
+        cosjik = ((rij[0]*rik[0])+(rij[1]*rik[1])+(rij[2]*rik[2]))
+          * invrijkm;
+        cosjik = MIN(cosjik,1.0);
+        cosjik = MAX(cosjik,-1.0);
+
+        dcosjikdri[0] = ((rij[0]+rik[0])*invrijkm) -
+          (cosjik*((rij[0]*invrijm2)+(rik[0]*invrikm2)));
+        dcosjikdri[1] = ((rij[1]+rik[1])*invrijkm) -
+          (cosjik*((rij[1]*invrijm2)+(rik[1]*invrikm2)));
+        dcosjikdri[2] = ((rij[2]+rik[2])*invrijkm) -
+          (cosjik*((rij[2]*invrijm2)+(rik[2]*invrikm2)));
+        dcosjikdrk[0] = (-rij[0]*invrijkm) + (cosjik*(rik[0]*invrikm2));
+        dcosjikdrk[1] = (-rij[1]*invrijkm) + (cosjik*(rik[1]*invrikm2));
+        dcosjikdrk[2] = (-rij[2]*invrijkm) + (cosjik*(rik[2]*invrikm2));
+        dcosjikdrj[0] = (-rik[0]*invrijkm) + (cosjik*(rij[0]*invrijm2));
+        dcosjikdrj[1] = (-rik[1]*invrijkm) + (cosjik*(rij[1]*invrijm2));
+        dcosjikdrj[2] = (-rik[2]*invrijkm) + (cosjik*(rij[2]*invrijm2));
+
+        g = gSpline(cosjik,(NijC+NijH),itype,&dgdc,&dgdN);
+
+        tmp2 = VA*.5*(tmp*wik*dgdc*exp(lamdajik));
+        fj[0] = -tmp2*dcosjikdrj[0];
+        fj[1] = -tmp2*dcosjikdrj[1];
+        fj[2] = -tmp2*dcosjikdrj[2];
+        fi[0] = -tmp2*dcosjikdri[0];
+        fi[1] = -tmp2*dcosjikdri[1];
+        fi[2] = -tmp2*dcosjikdri[2];
+        fk[0] = -tmp2*dcosjikdrk[0];
+        fk[1] = -tmp2*dcosjikdrk[1];
+        fk[2] = -tmp2*dcosjikdrk[2];
+
+        tmp2 = VA*.5*(tmp*wik*g*exp(lamdajik)*4.0*kronecker(itype,1));
+        fj[0] -= tmp2*(-rij[0]*invrijm);
+        fj[1] -= tmp2*(-rij[1]*invrijm);
+        fj[2] -= tmp2*(-rij[2]*invrijm);
+        fi[0] -= tmp2*((-rik[0]/rikmag)+(rij[0]*invrijm));
+        fi[1] -= tmp2*((-rik[1]/rikmag)+(rij[1]*invrijm));
+        fi[2] -= tmp2*((-rik[2]/rikmag)+(rij[2]*invrijm));
+        fk[0] -= tmp2*(rik[0]/rikmag);
+        fk[1] -= tmp2*(rik[1]/rikmag);
+        fk[2] -= tmp2*(rik[2]/rikmag);
+
+        // coordination forces
+
+        // dwik forces
+
+        tmp2 = VA*.5*(tmp*dwik*g*exp(lamdajik))/rikmag;
+        fi[0] -= tmp2*rik[0];
+        fi[1] -= tmp2*rik[1];
+        fi[2] -= tmp2*rik[2];
+        fk[0] += tmp2*rik[0];
+        fk[1] += tmp2*rik[1];
+        fk[2] += tmp2*rik[2];
+
+        // PIJ forces
+
+        tmp2 = VA*.5*(tmp*dN2[ktype]*dwik)/rikmag;
+        fi[0] -= tmp2*rik[0];
+        fi[1] -= tmp2*rik[1];
+        fi[2] -= tmp2*rik[2];
+        fk[0] += tmp2*rik[0];
+        fk[1] += tmp2*rik[1];
+        fk[2] += tmp2*rik[2];
+
+        // dgdN forces
+
+        tmp2 = VA*.5*(tmp*tmp3*dwik)/rikmag;
+        fi[0] -= tmp2*rik[0];
+        fi[1] -= tmp2*rik[1];
+        fi[2] -= tmp2*rik[2];
+        fk[0] += tmp2*rik[0];
+        fk[1] += tmp2*rik[1];
+        fk[2] += tmp2*rik[2];
+
+        f[atomi][0] += fi[0]; f[atomi][1] += fi[1]; f[atomi][2] += fi[2];
+        f[atomj][0] += fj[0]; f[atomj][1] += fj[1]; f[atomj][2] += fj[2];
+        f[atomk][0] += fk[0]; f[atomk][1] += fk[1]; f[atomk][2] += fk[2];
+
+        if (vflag_atom) {
+          rji[0] = -rij[0]; rji[1] = -rij[1]; rji[2] = -rij[2];
+          rki[0] = -rik[0]; rki[1] = -rik[1]; rki[2] = -rik[2];
+          v_tally3_thr(atomi,atomj,atomk,fj,fk,rji,rki,thr);
+        }
       }
     }
 
@@ -1251,101 +1251,101 @@ double PairAIREBOOMP::bondorderLJ_thr(int i, int j, double rij[3], double rijmag
     for (l = 0; l < REBO_numneigh[j]; l++) {
       atoml = REBO_neighs[l];
       if (atoml !=atomi) {
-	ltype = map[type[atoml]];
-	rjl[0] = x[atomj][0]-x[atoml][0];
-	rjl[1] = x[atomj][1]-x[atoml][1];
-	rjl[2] = x[atomj][2]-x[atoml][2];
-	rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
-	lamdaijl = 4.0*kronecker(jtype,1) *
-	  ((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
-	wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
-
-	const double invrjlm = 1.0/rjlmag;
-	const double invrijlm = invrijm*invrjlm;
-	const double invrjlm2 = invrjlm*invrjlm;
-
-	cosijl = (-1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2]))) *
-	  invrijlm;
-	cosijl = MIN(cosijl,1.0);
-	cosijl = MAX(cosijl,-1.0);
-
-	dcosijldri[0] = (-rjl[0]*invrijlm) - (cosijl*rij[0]*invrijm2);
-	dcosijldri[1] = (-rjl[1]*invrijlm) - (cosijl*rij[1]*invrijm2);
-	dcosijldri[2] = (-rjl[2]*invrijlm) - (cosijl*rij[2]*invrijm2);
-	dcosijldrj[0] = ((-rij[0]+rjl[0])*invrijlm) +
-	  (cosijl*((rij[0]*invrijm2)-(rjl[0]*invrjlm2)));
-	dcosijldrj[1] = ((-rij[1]+rjl[1])*invrijlm) +
-	  (cosijl*((rij[1]*invrijm2)-(rjl[1]*invrjlm2)));
-	dcosijldrj[2] = ((-rij[2]+rjl[2])*invrijlm) +
-	  (cosijl*((rij[2]*invrijm2)-(rjl[2]*invrjlm2)));
-	dcosijldrl[0] = (rij[0]*invrijlm) + (cosijl*rjl[0]*invrjlm2);
-	dcosijldrl[1] = (rij[1]*invrijlm) + (cosijl*rjl[1]*invrjlm2);
-	dcosijldrl[2] = (rij[2]*invrijlm) + (cosijl*rjl[2]*invrjlm2);
-
-	// evaluate splines g and derivatives dg
-
-	g = gSpline(cosijl,NjiC+NjiH,jtype,&dgdc,&dgdN);
-	tmp2 = VA*.5*(tmp*wjl*dgdc*exp(lamdaijl));
-	fi[0] = -tmp2*dcosijldri[0];
-	fi[1] = -tmp2*dcosijldri[1];
-	fi[2] = -tmp2*dcosijldri[2];
-	fj[0] = -tmp2*dcosijldrj[0];
-	fj[1] = -tmp2*dcosijldrj[1];
-	fj[2] = -tmp2*dcosijldrj[2];
-	fl[0] = -tmp2*dcosijldrl[0];
-	fl[1] = -tmp2*dcosijldrl[1];
-	fl[2] = -tmp2*dcosijldrl[2];
-
-	tmp2 = VA*.5*(tmp*wjl*g*exp(lamdaijl)*4.0*kronecker(jtype,1));
-	fi[0] -= tmp2*(rij[0]*invrijm);
-	fi[1] -= tmp2*(rij[1]*invrijm);
-	fi[2] -= tmp2*(rij[2]*invrijm);
-	fj[0] -= tmp2*((-rjl[0]*invrjlm)-(rij[0]*invrijm));
-	fj[1] -= tmp2*((-rjl[1]*invrjlm)-(rij[1]*invrijm));
-	fj[2] -= tmp2*((-rjl[2]*invrjlm)-(rij[2]*invrijm));
-	fl[0] -= tmp2*(rjl[0]*invrjlm);
-	fl[1] -= tmp2*(rjl[1]*invrjlm);
-	fl[2] -= tmp2*(rjl[2]*invrjlm);
-
- 	// coordination forces
-	// dwik forces
-
-	tmp2 = VA*.5*(tmp*dwjl*g*exp(lamdaijl))*invrjlm;
-	fj[0] -= tmp2*rjl[0];
-	fj[1] -= tmp2*rjl[1];
-	fj[2] -= tmp2*rjl[2];
-	fl[0] += tmp2*rjl[0];
-	fl[1] += tmp2*rjl[1];
-	fl[2] += tmp2*rjl[2];
-
-	// PIJ forces
-
-	tmp2 = VA*.5*(tmp*dN2[ltype]*dwjl)*invrjlm;
-	fj[0] -= tmp2*rjl[0];
-	fj[1] -= tmp2*rjl[1];
-	fj[2] -= tmp2*rjl[2];
-	fl[0] += tmp2*rjl[0];
-	fl[1] += tmp2*rjl[1];
-	fl[2] += tmp2*rjl[2];
-
-	// dgdN forces
-
-	tmp2=VA*.5*(tmp*tmp3*dwjl)*invrjlm;
-	fj[0] -= tmp2*rjl[0];
-	fj[1] -= tmp2*rjl[1];
-	fj[2] -= tmp2*rjl[2];
-	fl[0] += tmp2*rjl[0];
-	fl[1] += tmp2*rjl[1];
-	fl[2] += tmp2*rjl[2];
-
-	f[atomi][0] += fi[0]; f[atomi][1] += fi[1]; f[atomi][2] += fi[2];
-	f[atomj][0] += fj[0]; f[atomj][1] += fj[1]; f[atomj][2] += fj[2];
-	f[atoml][0] += fl[0]; f[atoml][1] += fl[1]; f[atoml][2] += fl[2];
-
-	if (vflag_atom) {
-	  rlj[0] = -rjl[0]; rlj[1] = -rjl[1]; rlj[2] = -rjl[2];
-	  v_tally3_thr(atomi,atomj,atoml,fi,fl,rij,rlj,thr);
-	}
+        ltype = map[type[atoml]];
+        rjl[0] = x[atomj][0]-x[atoml][0];
+        rjl[1] = x[atomj][1]-x[atoml][1];
+        rjl[2] = x[atomj][2]-x[atoml][2];
+        rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
+        lamdaijl = 4.0*kronecker(jtype,1) *
+          ((rho[ltype][1]-rjlmag)-(rho[itype][1]-rijmag));
+        wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
+
+        const double invrjlm = 1.0/rjlmag;
+        const double invrijlm = invrijm*invrjlm;
+        const double invrjlm2 = invrjlm*invrjlm;
+
+        cosijl = (-1.0*((rij[0]*rjl[0])+(rij[1]*rjl[1])+(rij[2]*rjl[2]))) *
+          invrijlm;
+        cosijl = MIN(cosijl,1.0);
+        cosijl = MAX(cosijl,-1.0);
+
+        dcosijldri[0] = (-rjl[0]*invrijlm) - (cosijl*rij[0]*invrijm2);
+        dcosijldri[1] = (-rjl[1]*invrijlm) - (cosijl*rij[1]*invrijm2);
+        dcosijldri[2] = (-rjl[2]*invrijlm) - (cosijl*rij[2]*invrijm2);
+        dcosijldrj[0] = ((-rij[0]+rjl[0])*invrijlm) +
+          (cosijl*((rij[0]*invrijm2)-(rjl[0]*invrjlm2)));
+        dcosijldrj[1] = ((-rij[1]+rjl[1])*invrijlm) +
+          (cosijl*((rij[1]*invrijm2)-(rjl[1]*invrjlm2)));
+        dcosijldrj[2] = ((-rij[2]+rjl[2])*invrijlm) +
+          (cosijl*((rij[2]*invrijm2)-(rjl[2]*invrjlm2)));
+        dcosijldrl[0] = (rij[0]*invrijlm) + (cosijl*rjl[0]*invrjlm2);
+        dcosijldrl[1] = (rij[1]*invrijlm) + (cosijl*rjl[1]*invrjlm2);
+        dcosijldrl[2] = (rij[2]*invrijlm) + (cosijl*rjl[2]*invrjlm2);
+
+        // evaluate splines g and derivatives dg
+
+        g = gSpline(cosijl,NjiC+NjiH,jtype,&dgdc,&dgdN);
+        tmp2 = VA*.5*(tmp*wjl*dgdc*exp(lamdaijl));
+        fi[0] = -tmp2*dcosijldri[0];
+        fi[1] = -tmp2*dcosijldri[1];
+        fi[2] = -tmp2*dcosijldri[2];
+        fj[0] = -tmp2*dcosijldrj[0];
+        fj[1] = -tmp2*dcosijldrj[1];
+        fj[2] = -tmp2*dcosijldrj[2];
+        fl[0] = -tmp2*dcosijldrl[0];
+        fl[1] = -tmp2*dcosijldrl[1];
+        fl[2] = -tmp2*dcosijldrl[2];
+
+        tmp2 = VA*.5*(tmp*wjl*g*exp(lamdaijl)*4.0*kronecker(jtype,1));
+        fi[0] -= tmp2*(rij[0]*invrijm);
+        fi[1] -= tmp2*(rij[1]*invrijm);
+        fi[2] -= tmp2*(rij[2]*invrijm);
+        fj[0] -= tmp2*((-rjl[0]*invrjlm)-(rij[0]*invrijm));
+        fj[1] -= tmp2*((-rjl[1]*invrjlm)-(rij[1]*invrijm));
+        fj[2] -= tmp2*((-rjl[2]*invrjlm)-(rij[2]*invrijm));
+        fl[0] -= tmp2*(rjl[0]*invrjlm);
+        fl[1] -= tmp2*(rjl[1]*invrjlm);
+        fl[2] -= tmp2*(rjl[2]*invrjlm);
+
+         // coordination forces
+        // dwik forces
+
+        tmp2 = VA*.5*(tmp*dwjl*g*exp(lamdaijl))*invrjlm;
+        fj[0] -= tmp2*rjl[0];
+        fj[1] -= tmp2*rjl[1];
+        fj[2] -= tmp2*rjl[2];
+        fl[0] += tmp2*rjl[0];
+        fl[1] += tmp2*rjl[1];
+        fl[2] += tmp2*rjl[2];
+
+        // PIJ forces
+
+        tmp2 = VA*.5*(tmp*dN2[ltype]*dwjl)*invrjlm;
+        fj[0] -= tmp2*rjl[0];
+        fj[1] -= tmp2*rjl[1];
+        fj[2] -= tmp2*rjl[2];
+        fl[0] += tmp2*rjl[0];
+        fl[1] += tmp2*rjl[1];
+        fl[2] += tmp2*rjl[2];
+
+        // dgdN forces
+
+        tmp2=VA*.5*(tmp*tmp3*dwjl)*invrjlm;
+        fj[0] -= tmp2*rjl[0];
+        fj[1] -= tmp2*rjl[1];
+        fj[2] -= tmp2*rjl[2];
+        fl[0] += tmp2*rjl[0];
+        fl[1] += tmp2*rjl[1];
+        fl[2] += tmp2*rjl[2];
+
+        f[atomi][0] += fi[0]; f[atomi][1] += fi[1]; f[atomi][2] += fi[2];
+        f[atomj][0] += fj[0]; f[atomj][1] += fj[1]; f[atomj][2] += fj[2];
+        f[atoml][0] += fl[0]; f[atoml][1] += fl[1]; f[atoml][2] += fl[2];
+
+        if (vflag_atom) {
+          rlj[0] = -rjl[0]; rlj[1] = -rjl[1]; rlj[2] = -rjl[2];
+          v_tally3_thr(atomi,atomj,atoml,fi,fl,rij,rlj,thr);
+        }
       }
     }
 
@@ -1359,60 +1359,60 @@ double PairAIREBOOMP::bondorderLJ_thr(int i, int j, double rij[3], double rijmag
     for (k = 0; k < REBO_numneigh[i]; k++) {
       atomk = REBO_neighs_i[k];
       if (atomk != atomj) {
-	ktype = map[type[atomk]];
-	rik[0] = x[atomi][0]-x[atomk][0];
-	rik[1] = x[atomi][1]-x[atomk][1];
-	rik[2] = x[atomi][2]-x[atomk][2];
-	rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
-	wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-	Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
-	  (wik*kronecker(itype,1));
-	SpN = Sp(Nki,Nmin,Nmax,dNki);
-
-	tmp2 = VA*dN3[0]*dwik/rikmag;
-	f[atomi][0] -= tmp2*rik[0];
-	f[atomi][1] -= tmp2*rik[1];
-	f[atomi][2] -= tmp2*rik[2];
-	f[atomk][0] += tmp2*rik[0];
-	f[atomk][1] += tmp2*rik[1];
-	f[atomk][2] += tmp2*rik[2];
-
-	if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
-
-	tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)/rikmag;
-	f[atomi][0] -= tmp2*rik[0];
-	f[atomi][1] -= tmp2*rik[1];
-	f[atomi][2] -= tmp2*rik[2];
-	f[atomk][0] += tmp2*rik[0];
-	f[atomk][1] += tmp2*rik[1];
-	f[atomk][2] += tmp2*rik[2];
-
-	if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
-
-	if (fabs(dNki) > TOL) {
-	  REBO_neighs_k = REBO_firstneigh[atomk];
-	  for (n = 0; n < REBO_numneigh[atomk]; n++) {
-	    atomn = REBO_neighs_k[n];
-	    if (atomn != atomi) {
-	      ntype = map[type[atomn]];
-	      rkn[0] = x[atomk][0]-x[atomn][0];
-	      rkn[1] = x[atomk][1]-x[atomn][1];
-	      rkn[2] = x[atomk][2]-x[atomn][2];
-	      rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
-	      Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
-
-	      tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)/rknmag;
-	      f[atomk][0] -= tmp2*rkn[0];
-	      f[atomk][1] -= tmp2*rkn[1];
-	      f[atomk][2] -= tmp2*rkn[2];
-	      f[atomn][0] += tmp2*rkn[0];
-	      f[atomn][1] += tmp2*rkn[1];
-	      f[atomn][2] += tmp2*rkn[2];
-
-	      if (vflag_atom) v_tally2_thr(atomk,atomn,-tmp2,rkn,thr);
-	    }
-	  }
-	}
+        ktype = map[type[atomk]];
+        rik[0] = x[atomi][0]-x[atomk][0];
+        rik[1] = x[atomi][1]-x[atomk][1];
+        rik[2] = x[atomi][2]-x[atomk][2];
+        rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
+        wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
+        Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
+          (wik*kronecker(itype,1));
+        SpN = Sp(Nki,Nmin,Nmax,dNki);
+
+        tmp2 = VA*dN3[0]*dwik/rikmag;
+        f[atomi][0] -= tmp2*rik[0];
+        f[atomi][1] -= tmp2*rik[1];
+        f[atomi][2] -= tmp2*rik[2];
+        f[atomk][0] += tmp2*rik[0];
+        f[atomk][1] += tmp2*rik[1];
+        f[atomk][2] += tmp2*rik[2];
+
+        if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
+
+        tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)/rikmag;
+        f[atomi][0] -= tmp2*rik[0];
+        f[atomi][1] -= tmp2*rik[1];
+        f[atomi][2] -= tmp2*rik[2];
+        f[atomk][0] += tmp2*rik[0];
+        f[atomk][1] += tmp2*rik[1];
+        f[atomk][2] += tmp2*rik[2];
+
+        if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
+
+        if (fabs(dNki) > TOL) {
+          REBO_neighs_k = REBO_firstneigh[atomk];
+          for (n = 0; n < REBO_numneigh[atomk]; n++) {
+            atomn = REBO_neighs_k[n];
+            if (atomn != atomi) {
+              ntype = map[type[atomn]];
+              rkn[0] = x[atomk][0]-x[atomn][0];
+              rkn[1] = x[atomk][1]-x[atomn][1];
+              rkn[2] = x[atomk][2]-x[atomn][2];
+              rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
+              Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
+
+              tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)/rknmag;
+              f[atomk][0] -= tmp2*rkn[0];
+              f[atomk][1] -= tmp2*rkn[1];
+              f[atomk][2] -= tmp2*rkn[2];
+              f[atomn][0] += tmp2*rkn[0];
+              f[atomn][1] += tmp2*rkn[1];
+              f[atomn][2] += tmp2*rkn[2];
+
+              if (vflag_atom) v_tally2_thr(atomk,atomn,-tmp2,rkn,thr);
+            }
+          }
+        }
       }
     }
 
@@ -1422,60 +1422,60 @@ double PairAIREBOOMP::bondorderLJ_thr(int i, int j, double rij[3], double rijmag
     for (l = 0; l < REBO_numneigh[j]; l++) {
       atoml = REBO_neighs[l];
       if (atoml != atomi) {
-	ltype = map[type[atoml]];
-	rjl[0] = x[atomj][0]-x[atoml][0];
-	rjl[1] = x[atomj][1]-x[atoml][1];
-	rjl[2] = x[atomj][2]-x[atoml][2];
-	rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
-	wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
-	Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
-	  (wjl*kronecker(jtype,1));
-	SpN = Sp(Nlj,Nmin,Nmax,dNlj);
-
-	tmp2 = VA*dN3[1]*dwjl/rjlmag;
-	f[atomj][0] -= tmp2*rjl[0];
-	f[atomj][1] -= tmp2*rjl[1];
-	f[atomj][2] -= tmp2*rjl[2];
-	f[atoml][0] += tmp2*rjl[0];
-	f[atoml][1] += tmp2*rjl[1];
-	f[atoml][2] += tmp2*rjl[2];
-
-	if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
-
-	tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)/rjlmag;
-	f[atomj][0] -= tmp2*rjl[0];
-	f[atomj][1] -= tmp2*rjl[1];
-	f[atomj][2] -= tmp2*rjl[2];
-	f[atoml][0] += tmp2*rjl[0];
-	f[atoml][1] += tmp2*rjl[1];
-	f[atoml][2] += tmp2*rjl[2];
-
-	if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
-
-	if (fabs(dNlj) > TOL) {
-	  REBO_neighs_l = REBO_firstneigh[atoml];
-	  for (n = 0; n < REBO_numneigh[atoml]; n++) {
-	    atomn = REBO_neighs_l[n];
-	    if (atomn != atomj) {
-	      ntype = map[type[atomn]];
-	      rln[0] = x[atoml][0]-x[atomn][0];
-	      rln[1] = x[atoml][1]-x[atomn][1];
-	      rln[2] = x[atoml][2]-x[atomn][2];
-	      rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
-	      Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
-
-	      tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)/rlnmag;
-	      f[atoml][0] -= tmp2*rln[0];
-	      f[atoml][1] -= tmp2*rln[1];
-	      f[atoml][2] -= tmp2*rln[2];
-	      f[atomn][0] += tmp2*rln[0];
-	      f[atomn][1] += tmp2*rln[1];
-	      f[atomn][2] += tmp2*rln[2];
-
-	      if (vflag_atom) v_tally2_thr(atoml,atomn,-tmp2,rln,thr);
-	    }
-	  }
-	}
+        ltype = map[type[atoml]];
+        rjl[0] = x[atomj][0]-x[atoml][0];
+        rjl[1] = x[atomj][1]-x[atoml][1];
+        rjl[2] = x[atomj][2]-x[atoml][2];
+        rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
+        wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
+        Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
+          (wjl*kronecker(jtype,1));
+        SpN = Sp(Nlj,Nmin,Nmax,dNlj);
+
+        tmp2 = VA*dN3[1]*dwjl/rjlmag;
+        f[atomj][0] -= tmp2*rjl[0];
+        f[atomj][1] -= tmp2*rjl[1];
+        f[atomj][2] -= tmp2*rjl[2];
+        f[atoml][0] += tmp2*rjl[0];
+        f[atoml][1] += tmp2*rjl[1];
+        f[atoml][2] += tmp2*rjl[2];
+
+        if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
+
+        tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)/rjlmag;
+        f[atomj][0] -= tmp2*rjl[0];
+        f[atomj][1] -= tmp2*rjl[1];
+        f[atomj][2] -= tmp2*rjl[2];
+        f[atoml][0] += tmp2*rjl[0];
+        f[atoml][1] += tmp2*rjl[1];
+        f[atoml][2] += tmp2*rjl[2];
+
+        if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
+
+        if (fabs(dNlj) > TOL) {
+          REBO_neighs_l = REBO_firstneigh[atoml];
+          for (n = 0; n < REBO_numneigh[atoml]; n++) {
+            atomn = REBO_neighs_l[n];
+            if (atomn != atomj) {
+              ntype = map[type[atomn]];
+              rln[0] = x[atoml][0]-x[atomn][0];
+              rln[1] = x[atoml][1]-x[atomn][1];
+              rln[2] = x[atoml][2]-x[atomn][2];
+              rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
+              Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
+
+              tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)/rlnmag;
+              f[atoml][0] -= tmp2*rln[0];
+              f[atoml][1] -= tmp2*rln[1];
+              f[atoml][2] -= tmp2*rln[2];
+              f[atomn][0] += tmp2*rln[0];
+              f[atomn][1] += tmp2*rln[1];
+              f[atomn][2] += tmp2*rln[2];
+
+              if (vflag_atom) v_tally2_thr(atoml,atomn,-tmp2,rln,thr);
+            }
+          }
+        }
       }
     }
 
@@ -1496,329 +1496,329 @@ double PairAIREBOOMP::bondorderLJ_thr(int i, int j, double rij[3], double rijmag
 
       REBO_neighs_i = REBO_firstneigh[i];
       for (k = 0; k < REBO_numneigh[i]; k++) {
-	atomk = REBO_neighs_i[k];
-	atom1 = atomk;
-	ktype = map[type[atomk]];
-	if (atomk != atomj) {
-	  r21[0] = x[atom2][0]-x[atom1][0];
-	  r21[1] = x[atom2][1]-x[atom1][1];
-	  r21[2] = x[atom2][2]-x[atom1][2];
-	  r21mag = sqrt(r21[0]*r21[0] + r21[1]*r21[1] + r21[2]*r21[2]);
-	  cos321 = ((r21[0]*rij[0])+(r21[1]*rij[1])+(r21[2]*rij[2])) /
-	    (r21mag*rijmag);
-	  cos321 = MIN(cos321,1.0);
-	  cos321 = MAX(cos321,-1.0);
-	  sin321 = sqrt(1.0 - cos321*cos321);
-	  sink2i = 1.0/(sin321*sin321);
-	  rik2i = 1.0/(r21mag*r21mag);
-
-	  if (sin321 != 0.0) {
-	    rr = (rijmag*rijmag)-(r21mag*r21mag);
-	    rjk[0] = r21[0]-rij[0];
-	    rjk[1] = r21[1]-rij[1];
-	    rjk[2] = r21[2]-rij[2];
-	    rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
-	    rijrik = 2.0*rijmag*r21mag;
-	    rik2 = r21mag*r21mag;
-	    dctik = (-rr+rjk2)/(rijrik*rik2);
-	    dctij = (rr+rjk2)/(rijrik*rijmag*rijmag);
-	    dctjk = -2.0/rijrik;
-	    w21 = Sp(r21mag,rcmin[itype][ktype],rcmaxp[itype][ktype],dw21);
-	    rikmag = r21mag;
-	    rij2 = r32mag*r32mag;
-	    rik2 = r21mag*r21mag;
-	    costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
-	    tspjik = Sp2(costmp,thmin,thmax,dtsjik);
-	    dtsjik = -dtsjik;
-
-	    REBO_neighs_j = REBO_firstneigh[j];
-	    for (l = 0; l < REBO_numneigh[j]; l++) {
-	      atoml = REBO_neighs_j[l];
-	      atom4 = atoml;
-	      ltype = map[type[atoml]];
-	      if (!(atoml == atomi || atoml == atomk)) {
-		r34[0] = x[atom3][0]-x[atom4][0];
-		r34[1] = x[atom3][1]-x[atom4][1];
-		r34[2] = x[atom3][2]-x[atom4][2];
-		r34mag = sqrt(r34[0]*r34[0] + r34[1]*r34[1] + r34[2]*r34[2]);
-		cos234 = -1.0*((rij[0]*r34[0])+(rij[1]*r34[1]) +
-			       (rij[2]*r34[2]))/(rijmag*r34mag);
-		cos234 = MIN(cos234,1.0);
-		cos234 = MAX(cos234,-1.0);
-		sin234 = sqrt(1.0 - cos234*cos234);
-		sinl2i = 1.0/(sin234*sin234);
-		rjl2i = 1.0/(r34mag*r34mag);
-
-		if (sin234 != 0.0) {
-		  w34 = Sp(r34mag,rcmin[jtype][ltype],
-			   rcmaxp[jtype][ltype],dw34);
-		  rr = (r23mag*r23mag)-(r34mag*r34mag);
-		  ril[0] = r23[0]+r34[0];
-		  ril[1] = r23[1]+r34[1];
-		  ril[2] = r23[2]+r34[2];
-		  ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
-		  rijrjl = 2.0*r23mag*r34mag;
-		  rjl2 = r34mag*r34mag;
-		  dctjl = (-rr+ril2)/(rijrjl*rjl2);
-		  dctji = (rr+ril2)/(rijrjl*r23mag*r23mag);
-		  dctil = -2.0/rijrjl;
-		  rjlmag = r34mag;
-		  rjl2 = r34mag*r34mag;
-		  costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
-		  tspijl = Sp2(costmp,thmin,thmax,dtsijl);
-		  dtsijl = -dtsijl; //need minus sign
-		  prefactor = VA*Tij;
-
-		  cross321[0] = (r32[1]*r21[2])-(r32[2]*r21[1]);
-		  cross321[1] = (r32[2]*r21[0])-(r32[0]*r21[2]);
-		  cross321[2] = (r32[0]*r21[1])-(r32[1]*r21[0]);
-		  cross234[0] = (r23[1]*r34[2])-(r23[2]*r34[1]);
-		  cross234[1] = (r23[2]*r34[0])-(r23[0]*r34[2]);
-		  cross234[2] = (r23[0]*r34[1])-(r23[1]*r34[0]);
-
-		  cwnum = (cross321[0]*cross234[0]) +
-		    (cross321[1]*cross234[1])+(cross321[2]*cross234[2]);
-		  cwnom = r21mag*r34mag*r23mag*r23mag*sin321*sin234;
-		  om1234 = cwnum/cwnom;
-		  cw = om1234;
-		  Etmp += ((1.0-(om1234*om1234))*w21*w34) *
-		    (1.0-tspjik)*(1.0-tspijl);
-
-		  dt1dik = (rik2i)-(dctik*sink2i*cos321);
-		  dt1djk = (-dctjk*sink2i*cos321);
-		  dt1djl = (rjl2i)-(dctjl*sinl2i*cos234);
-		  dt1dil = (-dctil*sinl2i*cos234);
-		  dt1dij = (2.0/(r23mag*r23mag)) -
-		    (dctij*sink2i*cos321)-(dctji*sinl2i*cos234);
-
-		  dt2dik[0] = (-r23[2]*cross234[1])+(r23[1]*cross234[2]);
-		  dt2dik[1] = (-r23[0]*cross234[2])+(r23[2]*cross234[0]);
-		  dt2dik[2] = (-r23[1]*cross234[0])+(r23[0]*cross234[1]);
-
-		  dt2djl[0] = (-r23[1]*cross321[2])+(r23[2]*cross321[1]);
-		  dt2djl[1] = (-r23[2]*cross321[0])+(r23[0]*cross321[2]);
-		  dt2djl[2] = (-r23[0]*cross321[1])+(r23[1]*cross321[0]);
-
-		  dt2dij[0] = (r21[2]*cross234[1]) -
-		    (r34[2]*cross321[1])-(r21[1]*cross234[2]) +
-		    (r34[1]*cross321[2]);
-		  dt2dij[1] = (r21[0]*cross234[2]) -
-		    (r34[0]*cross321[2])-(r21[2]*cross234[0]) +
-		    (r34[2]*cross321[0]);
-		  dt2dij[2] = (r21[1]*cross234[0]) -
-		    (r34[1]*cross321[0])-(r21[0]*cross234[1]) +
-		    (r34[0]*cross321[1]);
-
-		  aa = (prefactor*2.0*cw/cwnom)*w21*w34 *
-		    (1.0-tspjik)*(1.0-tspijl);
-		  aaa1 = -prefactor*(1.0-(om1234*om1234)) *
-		    (1.0-tspjik)*(1.0-tspijl);
-		  aaa2 = aaa1*w21*w34;
-		  at2 = aa*cwnum;
-
-		  fcijpc = (-dt1dij*at2)+(aaa2*dtsjik*dctij*(1.0-tspijl)) +
-		    (aaa2*dtsijl*dctji*(1.0-tspjik));
-		  fcikpc = (-dt1dik*at2)+(aaa2*dtsjik*dctik*(1.0-tspijl));
-		  fcjlpc = (-dt1djl*at2)+(aaa2*dtsijl*dctjl*(1.0-tspjik));
-		  fcjkpc = (-dt1djk*at2)+(aaa2*dtsjik*dctjk*(1.0-tspijl));
-		  fcilpc = (-dt1dil*at2)+(aaa2*dtsijl*dctil*(1.0-tspjik));
-
-		  F23[0] = (fcijpc*r23[0])+(aa*dt2dij[0]);
-		  F23[1] = (fcijpc*r23[1])+(aa*dt2dij[1]);
-		  F23[2] = (fcijpc*r23[2])+(aa*dt2dij[2]);
-
-		  F12[0] = (fcikpc*r21[0])+(aa*dt2dik[0]);
-		  F12[1] = (fcikpc*r21[1])+(aa*dt2dik[1]);
-		  F12[2] = (fcikpc*r21[2])+(aa*dt2dik[2]);
-
-		  F34[0] = (fcjlpc*r34[0])+(aa*dt2djl[0]);
-		  F34[1] = (fcjlpc*r34[1])+(aa*dt2djl[1]);
-		  F34[2] = (fcjlpc*r34[2])+(aa*dt2djl[2]);
-
-		  F31[0] = (fcjkpc*rjk[0]);
-		  F31[1] = (fcjkpc*rjk[1]);
-		  F31[2] = (fcjkpc*rjk[2]);
-
-		  F24[0] = (fcilpc*ril[0]);
-		  F24[1] = (fcilpc*ril[1]);
-		  F24[2] = (fcilpc*ril[2]);
-
-		  f1[0] = -F12[0]-F31[0];
-		  f1[1] = -F12[1]-F31[1];
-		  f1[2] = -F12[2]-F31[2];
-		  f2[0] = F23[0]+F12[0]+F24[0];
-		  f2[1] = F23[1]+F12[1]+F24[1];
-		  f2[2] = F23[2]+F12[2]+F24[2];
-		  f3[0] = -F23[0]+F34[0]+F31[0];
-		  f3[1] = -F23[1]+F34[1]+F31[1];
-		  f3[2] = -F23[2]+F34[2]+F31[2];
-		  f4[0] = -F34[0]-F24[0];
-		  f4[1] = -F34[1]-F24[1];
-		  f4[2] = -F34[2]-F24[2];
-
-		  // coordination forces
-
-		  tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
-		    (1.0-tspjik)*(1.0-tspijl)*dw21*w34/r21mag;
-		  f2[0] -= tmp2*r21[0];
-		  f2[1] -= tmp2*r21[1];
-		  f2[2] -= tmp2*r21[2];
-		  f1[0] += tmp2*r21[0];
-		  f1[1] += tmp2*r21[1];
-		  f1[2] += tmp2*r21[2];
-
-		  tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
-		    (1.0-tspjik)*(1.0-tspijl)*w21*dw34/r34mag;
-		  f3[0] -= tmp2*r34[0];
-		  f3[1] -= tmp2*r34[1];
-		  f3[2] -= tmp2*r34[2];
-		  f4[0] += tmp2*r34[0];
-		  f4[1] += tmp2*r34[1];
-		  f4[2] += tmp2*r34[2];
-
-		  f[atom1][0] += f1[0]; f[atom1][1] += f1[1];
-		  f[atom1][2] += f1[2];
-		  f[atom2][0] += f2[0]; f[atom2][1] += f2[1];
-		  f[atom2][2] += f2[2];
-		  f[atom3][0] += f3[0]; f[atom3][1] += f3[1];
-		  f[atom3][2] += f3[2];
-		  f[atom4][0] += f4[0]; f[atom4][1] += f4[1];
-		  f[atom4][2] += f4[2];
-
-		  if (vflag_atom) {
-		    r13[0] = -rjk[0]; r13[1] = -rjk[1]; r13[2] = -rjk[2];
-		    r43[0] = -r34[0]; r43[1] = -r34[1]; r43[2] = -r34[2];
-		    v_tally4_thr(atom1,atom2,atom3,atom4,f1,f2,f4,r13,r23,r43,thr);
-		  }
-		}
-	      }
-	    }
-	  }
-	}
+        atomk = REBO_neighs_i[k];
+        atom1 = atomk;
+        ktype = map[type[atomk]];
+        if (atomk != atomj) {
+          r21[0] = x[atom2][0]-x[atom1][0];
+          r21[1] = x[atom2][1]-x[atom1][1];
+          r21[2] = x[atom2][2]-x[atom1][2];
+          r21mag = sqrt(r21[0]*r21[0] + r21[1]*r21[1] + r21[2]*r21[2]);
+          cos321 = ((r21[0]*rij[0])+(r21[1]*rij[1])+(r21[2]*rij[2])) /
+            (r21mag*rijmag);
+          cos321 = MIN(cos321,1.0);
+          cos321 = MAX(cos321,-1.0);
+          sin321 = sqrt(1.0 - cos321*cos321);
+          sink2i = 1.0/(sin321*sin321);
+          rik2i = 1.0/(r21mag*r21mag);
+
+          if (sin321 != 0.0) {
+            rr = (rijmag*rijmag)-(r21mag*r21mag);
+            rjk[0] = r21[0]-rij[0];
+            rjk[1] = r21[1]-rij[1];
+            rjk[2] = r21[2]-rij[2];
+            rjk2 = (rjk[0]*rjk[0])+(rjk[1]*rjk[1])+(rjk[2]*rjk[2]);
+            rijrik = 2.0*rijmag*r21mag;
+            rik2 = r21mag*r21mag;
+            dctik = (-rr+rjk2)/(rijrik*rik2);
+            dctij = (rr+rjk2)/(rijrik*rijmag*rijmag);
+            dctjk = -2.0/rijrik;
+            w21 = Sp(r21mag,rcmin[itype][ktype],rcmaxp[itype][ktype],dw21);
+            rikmag = r21mag;
+            rij2 = r32mag*r32mag;
+            rik2 = r21mag*r21mag;
+            costmp = 0.5*(rij2+rik2-rjk2)/rijmag/rikmag;
+            tspjik = Sp2(costmp,thmin,thmax,dtsjik);
+            dtsjik = -dtsjik;
+
+            REBO_neighs_j = REBO_firstneigh[j];
+            for (l = 0; l < REBO_numneigh[j]; l++) {
+              atoml = REBO_neighs_j[l];
+              atom4 = atoml;
+              ltype = map[type[atoml]];
+              if (!(atoml == atomi || atoml == atomk)) {
+                r34[0] = x[atom3][0]-x[atom4][0];
+                r34[1] = x[atom3][1]-x[atom4][1];
+                r34[2] = x[atom3][2]-x[atom4][2];
+                r34mag = sqrt(r34[0]*r34[0] + r34[1]*r34[1] + r34[2]*r34[2]);
+                cos234 = -1.0*((rij[0]*r34[0])+(rij[1]*r34[1]) +
+                               (rij[2]*r34[2]))/(rijmag*r34mag);
+                cos234 = MIN(cos234,1.0);
+                cos234 = MAX(cos234,-1.0);
+                sin234 = sqrt(1.0 - cos234*cos234);
+                sinl2i = 1.0/(sin234*sin234);
+                rjl2i = 1.0/(r34mag*r34mag);
+
+                if (sin234 != 0.0) {
+                  w34 = Sp(r34mag,rcmin[jtype][ltype],
+                           rcmaxp[jtype][ltype],dw34);
+                  rr = (r23mag*r23mag)-(r34mag*r34mag);
+                  ril[0] = r23[0]+r34[0];
+                  ril[1] = r23[1]+r34[1];
+                  ril[2] = r23[2]+r34[2];
+                  ril2 = (ril[0]*ril[0])+(ril[1]*ril[1])+(ril[2]*ril[2]);
+                  rijrjl = 2.0*r23mag*r34mag;
+                  rjl2 = r34mag*r34mag;
+                  dctjl = (-rr+ril2)/(rijrjl*rjl2);
+                  dctji = (rr+ril2)/(rijrjl*r23mag*r23mag);
+                  dctil = -2.0/rijrjl;
+                  rjlmag = r34mag;
+                  rjl2 = r34mag*r34mag;
+                  costmp = 0.5*(rij2+rjl2-ril2)/rijmag/rjlmag;
+                  tspijl = Sp2(costmp,thmin,thmax,dtsijl);
+                  dtsijl = -dtsijl; //need minus sign
+                  prefactor = VA*Tij;
+
+                  cross321[0] = (r32[1]*r21[2])-(r32[2]*r21[1]);
+                  cross321[1] = (r32[2]*r21[0])-(r32[0]*r21[2]);
+                  cross321[2] = (r32[0]*r21[1])-(r32[1]*r21[0]);
+                  cross234[0] = (r23[1]*r34[2])-(r23[2]*r34[1]);
+                  cross234[1] = (r23[2]*r34[0])-(r23[0]*r34[2]);
+                  cross234[2] = (r23[0]*r34[1])-(r23[1]*r34[0]);
+
+                  cwnum = (cross321[0]*cross234[0]) +
+                    (cross321[1]*cross234[1])+(cross321[2]*cross234[2]);
+                  cwnom = r21mag*r34mag*r23mag*r23mag*sin321*sin234;
+                  om1234 = cwnum/cwnom;
+                  cw = om1234;
+                  Etmp += ((1.0-(om1234*om1234))*w21*w34) *
+                    (1.0-tspjik)*(1.0-tspijl);
+
+                  dt1dik = (rik2i)-(dctik*sink2i*cos321);
+                  dt1djk = (-dctjk*sink2i*cos321);
+                  dt1djl = (rjl2i)-(dctjl*sinl2i*cos234);
+                  dt1dil = (-dctil*sinl2i*cos234);
+                  dt1dij = (2.0/(r23mag*r23mag)) -
+                    (dctij*sink2i*cos321)-(dctji*sinl2i*cos234);
+
+                  dt2dik[0] = (-r23[2]*cross234[1])+(r23[1]*cross234[2]);
+                  dt2dik[1] = (-r23[0]*cross234[2])+(r23[2]*cross234[0]);
+                  dt2dik[2] = (-r23[1]*cross234[0])+(r23[0]*cross234[1]);
+
+                  dt2djl[0] = (-r23[1]*cross321[2])+(r23[2]*cross321[1]);
+                  dt2djl[1] = (-r23[2]*cross321[0])+(r23[0]*cross321[2]);
+                  dt2djl[2] = (-r23[0]*cross321[1])+(r23[1]*cross321[0]);
+
+                  dt2dij[0] = (r21[2]*cross234[1]) -
+                    (r34[2]*cross321[1])-(r21[1]*cross234[2]) +
+                    (r34[1]*cross321[2]);
+                  dt2dij[1] = (r21[0]*cross234[2]) -
+                    (r34[0]*cross321[2])-(r21[2]*cross234[0]) +
+                    (r34[2]*cross321[0]);
+                  dt2dij[2] = (r21[1]*cross234[0]) -
+                    (r34[1]*cross321[0])-(r21[0]*cross234[1]) +
+                    (r34[0]*cross321[1]);
+
+                  aa = (prefactor*2.0*cw/cwnom)*w21*w34 *
+                    (1.0-tspjik)*(1.0-tspijl);
+                  aaa1 = -prefactor*(1.0-(om1234*om1234)) *
+                    (1.0-tspjik)*(1.0-tspijl);
+                  aaa2 = aaa1*w21*w34;
+                  at2 = aa*cwnum;
+
+                  fcijpc = (-dt1dij*at2)+(aaa2*dtsjik*dctij*(1.0-tspijl)) +
+                    (aaa2*dtsijl*dctji*(1.0-tspjik));
+                  fcikpc = (-dt1dik*at2)+(aaa2*dtsjik*dctik*(1.0-tspijl));
+                  fcjlpc = (-dt1djl*at2)+(aaa2*dtsijl*dctjl*(1.0-tspjik));
+                  fcjkpc = (-dt1djk*at2)+(aaa2*dtsjik*dctjk*(1.0-tspijl));
+                  fcilpc = (-dt1dil*at2)+(aaa2*dtsijl*dctil*(1.0-tspjik));
+
+                  F23[0] = (fcijpc*r23[0])+(aa*dt2dij[0]);
+                  F23[1] = (fcijpc*r23[1])+(aa*dt2dij[1]);
+                  F23[2] = (fcijpc*r23[2])+(aa*dt2dij[2]);
+
+                  F12[0] = (fcikpc*r21[0])+(aa*dt2dik[0]);
+                  F12[1] = (fcikpc*r21[1])+(aa*dt2dik[1]);
+                  F12[2] = (fcikpc*r21[2])+(aa*dt2dik[2]);
+
+                  F34[0] = (fcjlpc*r34[0])+(aa*dt2djl[0]);
+                  F34[1] = (fcjlpc*r34[1])+(aa*dt2djl[1]);
+                  F34[2] = (fcjlpc*r34[2])+(aa*dt2djl[2]);
+
+                  F31[0] = (fcjkpc*rjk[0]);
+                  F31[1] = (fcjkpc*rjk[1]);
+                  F31[2] = (fcjkpc*rjk[2]);
+
+                  F24[0] = (fcilpc*ril[0]);
+                  F24[1] = (fcilpc*ril[1]);
+                  F24[2] = (fcilpc*ril[2]);
+
+                  f1[0] = -F12[0]-F31[0];
+                  f1[1] = -F12[1]-F31[1];
+                  f1[2] = -F12[2]-F31[2];
+                  f2[0] = F23[0]+F12[0]+F24[0];
+                  f2[1] = F23[1]+F12[1]+F24[1];
+                  f2[2] = F23[2]+F12[2]+F24[2];
+                  f3[0] = -F23[0]+F34[0]+F31[0];
+                  f3[1] = -F23[1]+F34[1]+F31[1];
+                  f3[2] = -F23[2]+F34[2]+F31[2];
+                  f4[0] = -F34[0]-F24[0];
+                  f4[1] = -F34[1]-F24[1];
+                  f4[2] = -F34[2]-F24[2];
+
+                  // coordination forces
+
+                  tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
+                    (1.0-tspjik)*(1.0-tspijl)*dw21*w34/r21mag;
+                  f2[0] -= tmp2*r21[0];
+                  f2[1] -= tmp2*r21[1];
+                  f2[2] -= tmp2*r21[2];
+                  f1[0] += tmp2*r21[0];
+                  f1[1] += tmp2*r21[1];
+                  f1[2] += tmp2*r21[2];
+
+                  tmp2 = VA*Tij*((1.0-(om1234*om1234))) *
+                    (1.0-tspjik)*(1.0-tspijl)*w21*dw34/r34mag;
+                  f3[0] -= tmp2*r34[0];
+                  f3[1] -= tmp2*r34[1];
+                  f3[2] -= tmp2*r34[2];
+                  f4[0] += tmp2*r34[0];
+                  f4[1] += tmp2*r34[1];
+                  f4[2] += tmp2*r34[2];
+
+                  f[atom1][0] += f1[0]; f[atom1][1] += f1[1];
+                  f[atom1][2] += f1[2];
+                  f[atom2][0] += f2[0]; f[atom2][1] += f2[1];
+                  f[atom2][2] += f2[2];
+                  f[atom3][0] += f3[0]; f[atom3][1] += f3[1];
+                  f[atom3][2] += f3[2];
+                  f[atom4][0] += f4[0]; f[atom4][1] += f4[1];
+                  f[atom4][2] += f4[2];
+
+                  if (vflag_atom) {
+                    r13[0] = -rjk[0]; r13[1] = -rjk[1]; r13[2] = -rjk[2];
+                    r43[0] = -r34[0]; r43[1] = -r34[1]; r43[2] = -r34[2];
+                    v_tally4_thr(atom1,atom2,atom3,atom4,f1,f2,f4,r13,r23,r43,thr);
+                  }
+                }
+              }
+            }
+          }
+        }
       }
 
       REBO_neighs = REBO_firstneigh[i];
       for (k = 0; k < REBO_numneigh[i]; k++) {
-	atomk = REBO_neighs[k];
-	if (atomk != atomj) {
-	  ktype = map[type[atomk]];
-	  rik[0] = x[atomi][0]-x[atomk][0];
-	  rik[1] = x[atomi][1]-x[atomk][1];
-	  rik[2] = x[atomi][2]-x[atomk][2];
-	  rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
-	  wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-	  Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
-	    (wik*kronecker(itype,1));
-	  SpN = Sp(Nki,Nmin,Nmax,dNki);
-
-	  tmp2 = VA*dN3[0]*dwik*Etmp/rikmag;
-	  f[atomi][0] -= tmp2*rik[0];
-	  f[atomi][1] -= tmp2*rik[1];
-	  f[atomi][2] -= tmp2*rik[2];
-	  f[atomk][0] += tmp2*rik[0];
-	  f[atomk][1] += tmp2*rik[1];
-	  f[atomk][2] += tmp2*rik[2];
-
-	  if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
-
-	  tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)*Etmp/rikmag;
-	  f[atomi][0] -= tmp2*rik[0];
-	  f[atomi][1] -= tmp2*rik[1];
-	  f[atomi][2] -= tmp2*rik[2];
-	  f[atomk][0] += tmp2*rik[0];
-	  f[atomk][1] += tmp2*rik[1];
-	  f[atomk][2] += tmp2*rik[2];
-
-	  if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
-
-	  if (fabs(dNki)  >TOL) {
-	    REBO_neighs_k = REBO_firstneigh[atomk];
-	    for (n = 0; n < REBO_numneigh[atomk]; n++) {
-	      atomn = REBO_neighs_k[n];
-	      ntype = map[type[atomn]];
-	      if (atomn !=atomi) {
-		rkn[0] = x[atomk][0]-x[atomn][0];
-		rkn[1] = x[atomk][1]-x[atomn][1];
-		rkn[2] = x[atomk][2]-x[atomn][2];
-		rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
-		Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
-
-		tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)*Etmp/rknmag;
-		f[atomk][0] -= tmp2*rkn[0];
-		f[atomk][1] -= tmp2*rkn[1];
-		f[atomk][2] -= tmp2*rkn[2];
-		f[atomn][0] += tmp2*rkn[0];
-		f[atomn][1] += tmp2*rkn[1];
-		f[atomn][2] += tmp2*rkn[2];
-
-		if (vflag_atom) v_tally2_thr(atomk,atomn,-tmp2,rkn,thr);
-	      }
-	    }
-	  }
-	}
+        atomk = REBO_neighs[k];
+        if (atomk != atomj) {
+          ktype = map[type[atomk]];
+          rik[0] = x[atomi][0]-x[atomk][0];
+          rik[1] = x[atomi][1]-x[atomk][1];
+          rik[2] = x[atomi][2]-x[atomk][2];
+          rikmag = sqrt((rik[0]*rik[0])+(rik[1]*rik[1])+(rik[2]*rik[2]));
+          wik = Sp(rikmag,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
+          Nki = nC[atomk]-(wik*kronecker(itype,0))+nH[atomk] -
+            (wik*kronecker(itype,1));
+          SpN = Sp(Nki,Nmin,Nmax,dNki);
+
+          tmp2 = VA*dN3[0]*dwik*Etmp/rikmag;
+          f[atomi][0] -= tmp2*rik[0];
+          f[atomi][1] -= tmp2*rik[1];
+          f[atomi][2] -= tmp2*rik[2];
+          f[atomk][0] += tmp2*rik[0];
+          f[atomk][1] += tmp2*rik[1];
+          f[atomk][2] += tmp2*rik[2];
+
+          if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
+
+          tmp2 = VA*dN3[2]*(2.0*NconjtmpI*dwik*SpN)*Etmp/rikmag;
+          f[atomi][0] -= tmp2*rik[0];
+          f[atomi][1] -= tmp2*rik[1];
+          f[atomi][2] -= tmp2*rik[2];
+          f[atomk][0] += tmp2*rik[0];
+          f[atomk][1] += tmp2*rik[1];
+          f[atomk][2] += tmp2*rik[2];
+
+          if (vflag_atom) v_tally2_thr(atomi,atomk,-tmp2,rik,thr);
+
+          if (fabs(dNki)  >TOL) {
+            REBO_neighs_k = REBO_firstneigh[atomk];
+            for (n = 0; n < REBO_numneigh[atomk]; n++) {
+              atomn = REBO_neighs_k[n];
+              ntype = map[type[atomn]];
+              if (atomn !=atomi) {
+                rkn[0] = x[atomk][0]-x[atomn][0];
+                rkn[1] = x[atomk][1]-x[atomn][1];
+                rkn[2] = x[atomk][2]-x[atomn][2];
+                rknmag = sqrt((rkn[0]*rkn[0])+(rkn[1]*rkn[1])+(rkn[2]*rkn[2]));
+                Sp(rknmag,rcmin[ktype][ntype],rcmax[ktype][ntype],dwkn);
+
+                tmp2 = VA*dN3[2]*(2.0*NconjtmpI*wik*dNki*dwkn)*Etmp/rknmag;
+                f[atomk][0] -= tmp2*rkn[0];
+                f[atomk][1] -= tmp2*rkn[1];
+                f[atomk][2] -= tmp2*rkn[2];
+                f[atomn][0] += tmp2*rkn[0];
+                f[atomn][1] += tmp2*rkn[1];
+                f[atomn][2] += tmp2*rkn[2];
+
+                if (vflag_atom) v_tally2_thr(atomk,atomn,-tmp2,rkn,thr);
+              }
+            }
+          }
+        }
       }
 
       // Tij forces
 
       REBO_neighs = REBO_firstneigh[j];
       for (l = 0; l < REBO_numneigh[j]; l++) {
-	atoml = REBO_neighs[l];
-	if (atoml != atomi) {
-	  ltype = map[type[atoml]];
-	  rjl[0] = x[atomj][0]-x[atoml][0];
-	  rjl[1] = x[atomj][1]-x[atoml][1];
-	  rjl[2] = x[atomj][2]-x[atoml][2];
-	  rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
-	  wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
-	  Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
-	    (wjl*kronecker(jtype,1));
-	  SpN = Sp(Nlj,Nmin,Nmax,dNlj);
-
-	  tmp2 = VA*dN3[1]*dwjl*Etmp/rjlmag;
-	  f[atomj][0] -= tmp2*rjl[0];
-	  f[atomj][1] -= tmp2*rjl[1];
-	  f[atomj][2] -= tmp2*rjl[2];
-	  f[atoml][0] += tmp2*rjl[0];
-	  f[atoml][1] += tmp2*rjl[1];
-	  f[atoml][2] += tmp2*rjl[2];
-
-	  if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
-
-	  tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)*Etmp/rjlmag;
-	  f[atomj][0] -= tmp2*rjl[0];
-	  f[atomj][1] -= tmp2*rjl[1];
-	  f[atomj][2] -= tmp2*rjl[2];
-	  f[atoml][0] += tmp2*rjl[0];
-	  f[atoml][1] += tmp2*rjl[1];
-	  f[atoml][2] += tmp2*rjl[2];
-
-	  if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
-
-	  if (fabs(dNlj) > TOL) {
-	    REBO_neighs_l = REBO_firstneigh[atoml];
-	    for (n = 0; n < REBO_numneigh[atoml]; n++) {
-	      atomn = REBO_neighs_l[n];
-	      ntype = map[type[atomn]];
-	      if (atomn != atomj) {
-		rln[0] = x[atoml][0]-x[atomn][0];
-		rln[1] = x[atoml][1]-x[atomn][1];
-		rln[2] = x[atoml][2]-x[atomn][2];
-		rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
-		Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
-
-		tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)*Etmp/rlnmag;
-		f[atoml][0] -= tmp2*rln[0];
-		f[atoml][1] -= tmp2*rln[1];
-		f[atoml][2] -= tmp2*rln[2];
-		f[atomn][0] += tmp2*rln[0];
-		f[atomn][1] += tmp2*rln[1];
-		f[atomn][2] += tmp2*rln[2];
-
-		if (vflag_atom) v_tally2_thr(atoml,atomn,-tmp2,rln,thr);
-	      }
-	    }
-	  }
-	}
+        atoml = REBO_neighs[l];
+        if (atoml != atomi) {
+          ltype = map[type[atoml]];
+          rjl[0] = x[atomj][0]-x[atoml][0];
+          rjl[1] = x[atomj][1]-x[atoml][1];
+          rjl[2] = x[atomj][2]-x[atoml][2];
+          rjlmag = sqrt((rjl[0]*rjl[0])+(rjl[1]*rjl[1])+(rjl[2]*rjl[2]));
+          wjl = Sp(rjlmag,rcmin[jtype][ltype],rcmax[jtype][ltype],dwjl);
+          Nlj = nC[atoml]-(wjl*kronecker(jtype,0))+nH[atoml] -
+            (wjl*kronecker(jtype,1));
+          SpN = Sp(Nlj,Nmin,Nmax,dNlj);
+
+          tmp2 = VA*dN3[1]*dwjl*Etmp/rjlmag;
+          f[atomj][0] -= tmp2*rjl[0];
+          f[atomj][1] -= tmp2*rjl[1];
+          f[atomj][2] -= tmp2*rjl[2];
+          f[atoml][0] += tmp2*rjl[0];
+          f[atoml][1] += tmp2*rjl[1];
+          f[atoml][2] += tmp2*rjl[2];
+
+          if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
+
+          tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*dwjl*SpN)*Etmp/rjlmag;
+          f[atomj][0] -= tmp2*rjl[0];
+          f[atomj][1] -= tmp2*rjl[1];
+          f[atomj][2] -= tmp2*rjl[2];
+          f[atoml][0] += tmp2*rjl[0];
+          f[atoml][1] += tmp2*rjl[1];
+          f[atoml][2] += tmp2*rjl[2];
+
+          if (vflag_atom) v_tally2_thr(atomj,atoml,-tmp2,rjl,thr);
+
+          if (fabs(dNlj) > TOL) {
+            REBO_neighs_l = REBO_firstneigh[atoml];
+            for (n = 0; n < REBO_numneigh[atoml]; n++) {
+              atomn = REBO_neighs_l[n];
+              ntype = map[type[atomn]];
+              if (atomn != atomj) {
+                rln[0] = x[atoml][0]-x[atomn][0];
+                rln[1] = x[atoml][1]-x[atomn][1];
+                rln[2] = x[atoml][2]-x[atomn][2];
+                rlnmag = sqrt((rln[0]*rln[0])+(rln[1]*rln[1])+(rln[2]*rln[2]));
+                Sp(rlnmag,rcmin[ltype][ntype],rcmax[ltype][ntype],dwln);
+
+                tmp2 = VA*dN3[2]*(2.0*NconjtmpJ*wjl*dNlj*dwln)*Etmp/rlnmag;
+                f[atoml][0] -= tmp2*rln[0];
+                f[atoml][1] -= tmp2*rln[1];
+                f[atoml][2] -= tmp2*rln[2];
+                f[atomn][0] += tmp2*rln[0];
+                f[atomn][1] += tmp2*rln[1];
+                f[atomn][2] += tmp2*rln[2];
+
+                if (vflag_atom) v_tally2_thr(atoml,atomn,-tmp2,rln,thr);
+              }
+            }
+          }
+        }
       }
     }
   }
@@ -1831,7 +1831,7 @@ double PairAIREBOOMP::bondorderLJ_thr(int i, int j, double rij[3], double rijmag
 ------------------------------------------------------------------------- */
 
 void PairAIREBOOMP::FREBO_thr(int ifrom, int ito, int evflag, int eflag,
-			      int vflag_atom, ThrData * const thr)
+                              int vflag_atom, ThrData * const thr)
 {
   int i,j,k,m,ii,itype,jtype,itag,jtag;
   double delx,dely,delz,evdwl,fpair,xtmp,ytmp,ztmp;
@@ -1866,13 +1866,13 @@ void PairAIREBOOMP::FREBO_thr(int ifrom, int ito, int evflag, int eflag,
       jtag = tag[j];
 
       if (itag > jtag) {
-	if ((itag+jtag) % 2 == 0) continue;
+        if ((itag+jtag) % 2 == 0) continue;
       } else if (itag < jtag) {
-	if ((itag+jtag) % 2 == 1) continue;
+        if ((itag+jtag) % 2 == 1) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
-	if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
+        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
       }
 
       jtype = map[type[j]];
@@ -1896,9 +1896,9 @@ void PairAIREBOOMP::FREBO_thr(int ifrom, int ito, int evflag, int eflag,
 
       VA = dVA = 0.0;
       for (m = 0; m < 3; m++) {
-	term = -wij * BIJc[itype][jtype][m] * exp(-Beta[itype][jtype][m]*rij);
-	VA += term;
-	dVA += -Beta[itype][jtype][m] * term;
+        term = -wij * BIJc[itype][jtype][m] * exp(-Beta[itype][jtype][m]*rij);
+        VA += term;
+        dVA += -Beta[itype][jtype][m] * term;
       }
       dVA += VA/wij * dwij;
       del[0] = delx;
@@ -1917,7 +1917,7 @@ void PairAIREBOOMP::FREBO_thr(int ifrom, int ito, int evflag, int eflag,
 
       if (eflag) evdwl = VR + bij*VA;
       if (evflag) ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,
-			       evdwl,0.0,fpair,delx,dely,delz,thr);
+                               evdwl,0.0,fpair,delx,dely,delz,thr);
     }
   }
 }
@@ -1928,7 +1928,7 @@ void PairAIREBOOMP::FREBO_thr(int ifrom, int ito, int evflag, int eflag,
 ------------------------------------------------------------------------- */
 
 void PairAIREBOOMP::FLJ_thr(int ifrom, int ito, int evflag, int eflag,
-			    int vflag_atom, ThrData * const thr)
+                            int vflag_atom, ThrData * const thr)
 {
   int i,j,k,m,ii,jj,kk,mm,jnum,itype,jtype,ktype,mtype,itag,jtag;
   int atomi,atomj,atomk,atomm;
@@ -1987,13 +1987,13 @@ void PairAIREBOOMP::FLJ_thr(int ifrom, int ito, int evflag, int eflag,
       jtag = tag[j];
 
       if (itag > jtag) {
-	if ((itag+jtag) % 2 == 0) continue;
+        if ((itag+jtag) % 2 == 0) continue;
       } else if (itag < jtag) {
-	if ((itag+jtag) % 2 == 1) continue;
+        if ((itag+jtag) % 2 == 1) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
-	if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
+        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
       }
 
       jtype = map[type[j]];
@@ -2013,133 +2013,133 @@ void PairAIREBOOMP::FLJ_thr(int ifrom, int ito, int evflag, int eflag,
       if (rijsq >= cutljsq[itype][jtype]) continue;
       rij = sqrt(rijsq);
       if (rij >= cut3rebo) {
-	best = 0.0;
-	testpath = 0;
+        best = 0.0;
+        testpath = 0;
       } else if (rij >= rcmax[itype][jtype]) {
-	best = 0.0;
-	testpath = 1;
+        best = 0.0;
+        testpath = 1;
       } else {
-	best = Sp(rij,rcmin[itype][jtype],rcmax[itype][jtype],dwij);
-	npath = 2;
-	if (best < 1.0) testpath = 1;
-	else testpath = 0;
+        best = Sp(rij,rcmin[itype][jtype],rcmax[itype][jtype],dwij);
+        npath = 2;
+        if (best < 1.0) testpath = 1;
+        else testpath = 0;
       }
 
       done = 0;
       if (testpath) {
 
-	// test all 3-body paths = I-K-J
-	// I-K interactions come from atom I's REBO neighbors
-	// if wik > current best, compute wkj
-	// if best = 1.0, done
-
-	REBO_neighs_i = REBO_firstneigh[i];
-	for (kk = 0; kk < REBO_numneigh[i] && done==0; kk++) {
-	  k = REBO_neighs_i[kk];
-	  if (k == j) continue;
-	  ktype = map[type[k]];
-
-	  delik[0] = x[i][0] - x[k][0];
-	  delik[1] = x[i][1] - x[k][1];
-	  delik[2] = x[i][2] - x[k][2];
-	  rsq = delik[0]*delik[0] + delik[1]*delik[1] + delik[2]*delik[2];
-	  if (rsq < rcmaxsq[itype][ktype]) {
-	    rik = sqrt(rsq);
-	    wik = Sp(rik,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
-	  } else wik = 0.0;
-
-	  if (wik > best) {
-	    deljk[0] = x[j][0] - x[k][0];
-	    deljk[1] = x[j][1] - x[k][1];
-	    deljk[2] = x[j][2] - x[k][2];
-	    rsq = deljk[0]*deljk[0] + deljk[1]*deljk[1] + deljk[2]*deljk[2];
-	    if (rsq < rcmaxsq[ktype][jtype]) {
-	      rkj = sqrt(rsq);
-	      wkj = Sp(rkj,rcmin[ktype][jtype],rcmax[ktype][jtype],dwkj);
-	      if (wik*wkj > best) {
-		best = wik*wkj;
-		npath = 3;
- 		atomk = k;
-            	delikS[0] = delik[0];
-            	delikS[1] = delik[1];
-            	delikS[2] = delik[2];
-	    	rikS = rik;
-	    	wikS = wik;
-	    	dwikS = dwik;
-            	deljkS[0] = deljk[0];
-            	deljkS[1] = deljk[1];
-            	deljkS[2] = deljk[2];
-	    	rkjS = rkj;
-	    	wkjS = wkj;
-	    	dwkjS = dwkj;
-		if (best == 1.0) {
-		  done = 1;
-		  break;
-		}
-	      }
-	    }
-
-	    // test all 4-body paths = I-K-M-J
-	    // K-M interactions come from atom K's REBO neighbors
-	    // if wik*wkm > current best, compute wmj
-	    // if best = 1.0, done
-
-	    REBO_neighs_k = REBO_firstneigh[k];
-	    for (mm = 0; mm < REBO_numneigh[k] && done==0; mm++) {
-	      m = REBO_neighs_k[mm];
-	      if (m == i || m == j) continue;
-	      mtype = map[type[m]];
-	      delkm[0] = x[k][0] - x[m][0];
-	      delkm[1] = x[k][1] - x[m][1];
-	      delkm[2] = x[k][2] - x[m][2];
-	      rsq = delkm[0]*delkm[0] + delkm[1]*delkm[1] + delkm[2]*delkm[2];
-	      if (rsq < rcmaxsq[ktype][mtype]) {
-		rkm = sqrt(rsq);
-		wkm = Sp(rkm,rcmin[ktype][mtype],rcmax[ktype][mtype],dwkm);
-	      } else wkm = 0.0;
-
-	      if (wik*wkm > best) {
-		deljm[0] = x[j][0] - x[m][0];
-		deljm[1] = x[j][1] - x[m][1];
-		deljm[2] = x[j][2] - x[m][2];
-		rsq = deljm[0]*deljm[0] + deljm[1]*deljm[1] +
-		  deljm[2]*deljm[2];
-		if (rsq < rcmaxsq[mtype][jtype]) {
-		  rmj = sqrt(rsq);
-		  wmj = Sp(rmj,rcmin[mtype][jtype],rcmax[mtype][jtype],dwmj);
-		  if (wik*wkm*wmj > best) {
-		    best = wik*wkm*wmj;
-		    npath = 4;
-		    atomk = k;
-		    delikS[0] = delik[0];
-	            delikS[1] = delik[1];
-        	    delikS[2] = delik[2];
-		    rikS = rik;
-		    wikS = wik;
-		    dwikS = dwik;
-		    atomm = m;
-	            delkmS[0] = delkm[0];
-        	    delkmS[1] = delkm[1];
-            	    delkmS[2] = delkm[2];
-		    rkmS = rkm;
-		    wkmS = wkm;
-		    dwkmS = dwkm;
-	            deljmS[0] = deljm[0];
-        	    deljmS[1] = deljm[1];
-           	    deljmS[2] = deljm[2];
-		    rmjS = rmj;
-		    wmjS = wmj;
-		    dwmjS = dwmj;
-		    if (best == 1.0) {
-		      done = 1;
-		      break;
-		    }
-		  }
-		}
-	      }
-	    }
-	  }
-	}
+        // test all 3-body paths = I-K-J
+        // I-K interactions come from atom I's REBO neighbors
+        // if wik > current best, compute wkj
+        // if best = 1.0, done
+
+        REBO_neighs_i = REBO_firstneigh[i];
+        for (kk = 0; kk < REBO_numneigh[i] && done==0; kk++) {
+          k = REBO_neighs_i[kk];
+          if (k == j) continue;
+          ktype = map[type[k]];
+
+          delik[0] = x[i][0] - x[k][0];
+          delik[1] = x[i][1] - x[k][1];
+          delik[2] = x[i][2] - x[k][2];
+          rsq = delik[0]*delik[0] + delik[1]*delik[1] + delik[2]*delik[2];
+          if (rsq < rcmaxsq[itype][ktype]) {
+            rik = sqrt(rsq);
+            wik = Sp(rik,rcmin[itype][ktype],rcmax[itype][ktype],dwik);
+          } else wik = 0.0;
+
+          if (wik > best) {
+            deljk[0] = x[j][0] - x[k][0];
+            deljk[1] = x[j][1] - x[k][1];
+            deljk[2] = x[j][2] - x[k][2];
+            rsq = deljk[0]*deljk[0] + deljk[1]*deljk[1] + deljk[2]*deljk[2];
+            if (rsq < rcmaxsq[ktype][jtype]) {
+              rkj = sqrt(rsq);
+              wkj = Sp(rkj,rcmin[ktype][jtype],rcmax[ktype][jtype],dwkj);
+              if (wik*wkj > best) {
+                best = wik*wkj;
+                npath = 3;
+                 atomk = k;
+                    delikS[0] = delik[0];
+                    delikS[1] = delik[1];
+                    delikS[2] = delik[2];
+                    rikS = rik;
+                    wikS = wik;
+                    dwikS = dwik;
+                    deljkS[0] = deljk[0];
+                    deljkS[1] = deljk[1];
+                    deljkS[2] = deljk[2];
+                    rkjS = rkj;
+                    wkjS = wkj;
+                    dwkjS = dwkj;
+                if (best == 1.0) {
+                  done = 1;
+                  break;
+                }
+              }
+            }
+
+            // test all 4-body paths = I-K-M-J
+            // K-M interactions come from atom K's REBO neighbors
+            // if wik*wkm > current best, compute wmj
+            // if best = 1.0, done
+
+            REBO_neighs_k = REBO_firstneigh[k];
+            for (mm = 0; mm < REBO_numneigh[k] && done==0; mm++) {
+              m = REBO_neighs_k[mm];
+              if (m == i || m == j) continue;
+              mtype = map[type[m]];
+              delkm[0] = x[k][0] - x[m][0];
+              delkm[1] = x[k][1] - x[m][1];
+              delkm[2] = x[k][2] - x[m][2];
+              rsq = delkm[0]*delkm[0] + delkm[1]*delkm[1] + delkm[2]*delkm[2];
+              if (rsq < rcmaxsq[ktype][mtype]) {
+                rkm = sqrt(rsq);
+                wkm = Sp(rkm,rcmin[ktype][mtype],rcmax[ktype][mtype],dwkm);
+              } else wkm = 0.0;
+
+              if (wik*wkm > best) {
+                deljm[0] = x[j][0] - x[m][0];
+                deljm[1] = x[j][1] - x[m][1];
+                deljm[2] = x[j][2] - x[m][2];
+                rsq = deljm[0]*deljm[0] + deljm[1]*deljm[1] +
+                  deljm[2]*deljm[2];
+                if (rsq < rcmaxsq[mtype][jtype]) {
+                  rmj = sqrt(rsq);
+                  wmj = Sp(rmj,rcmin[mtype][jtype],rcmax[mtype][jtype],dwmj);
+                  if (wik*wkm*wmj > best) {
+                    best = wik*wkm*wmj;
+                    npath = 4;
+                    atomk = k;
+                    delikS[0] = delik[0];
+                    delikS[1] = delik[1];
+                    delikS[2] = delik[2];
+                    rikS = rik;
+                    wikS = wik;
+                    dwikS = dwik;
+                    atomm = m;
+                    delkmS[0] = delkm[0];
+                    delkmS[1] = delkm[1];
+                        delkmS[2] = delkm[2];
+                    rkmS = rkm;
+                    wkmS = wkm;
+                    dwkmS = dwkm;
+                    deljmS[0] = deljm[0];
+                    deljmS[1] = deljm[1];
+                       deljmS[2] = deljm[2];
+                    rmjS = rmj;
+                    wmjS = wmj;
+                    dwmjS = dwmj;
+                    if (best == 1.0) {
+                      done = 1;
+                      break;
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
       }
 
       cij = 1.0 - best;
@@ -2156,18 +2156,18 @@ void PairAIREBOOMP::FLJ_thr(int ifrom, int ito, int evflag, int eflag,
       rljmin = sigmin * rljmin;
 
       if (rij > rljmax) {
-	slw = 0.0;
-	dslw = 0.0;
+        slw = 0.0;
+        dslw = 0.0;
       } else if (rij > rljmin) {
-	drij = rij - rljmin;
-	swidth = rljmax - rljmin;
-	tee = drij / swidth;
-	tee2 = tee*tee;
-	slw = 1.0 - tee2 * (3.0 - 2.0 * tee);
-	dslw = 6.0 * tee * (1.0 - tee) / rij / swidth;
+        drij = rij - rljmin;
+        swidth = rljmax - rljmin;
+        tee = drij / swidth;
+        tee2 = tee*tee;
+        slw = 1.0 - tee2 * (3.0 - 2.0 * tee);
+        dslw = 6.0 * tee * (1.0 - tee) / rij / swidth;
       } else {
-	slw = 1.0;
-	dslw = 0.0;
+        slw = 1.0;
+        dslw = 0.0;
       }
 
       r2inv = 1.0/rijsq;
@@ -2184,16 +2184,16 @@ void PairAIREBOOMP::FLJ_thr(int ifrom, int ito, int evflag, int eflag,
       Str = Sp2(rij,rcLJmin[itype][jtype],rcLJmax[itype][jtype],dStr);
       VA = Str*cij*VLJ;
       if (Str > 0.0) {
-	scale = rcmin[itype][jtype] / rij;
-	delscale[0] = scale * delij[0];
-	delscale[1] = scale * delij[1];
-	delscale[2] = scale * delij[2];
-	Stb = bondorderLJ_thr(i,j,delscale,rcmin[itype][jtype],VA,
-			      delij,rij,vflag_atom,thr);
+        scale = rcmin[itype][jtype] / rij;
+        delscale[0] = scale * delij[0];
+        delscale[1] = scale * delij[1];
+        delscale[2] = scale * delij[2];
+        Stb = bondorderLJ_thr(i,j,delscale,rcmin[itype][jtype],VA,
+                              delij,rij,vflag_atom,thr);
       } else Stb = 0.0;
 
       fpair = -(dStr * (Stb*cij*VLJ - cij*VLJ) +
-		dVLJ * (Str*Stb*cij + cij - Str*cij)) / rij;
+                dVLJ * (Str*Stb*cij + cij - Str*cij)) / rij;
 
       f[i][0] += delij[0]*fpair;
       f[i][1] += delij[1]*fpair;
@@ -2204,84 +2204,84 @@ void PairAIREBOOMP::FLJ_thr(int ifrom, int ito, int evflag, int eflag,
 
       if (eflag) evdwl = VA*Stb + (1.0-Str)*cij*VLJ;
       if (evflag) ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,
-			       evdwl,0.0,fpair,delij[0],delij[1],delij[2],thr);
+                               evdwl,0.0,fpair,delij[0],delij[1],delij[2],thr);
 
       if (cij < 1.0) {
-	dC = Str*Stb*VLJ + (1.0-Str)*VLJ;
-	if (npath == 2) {
-	  fpair = dC*dwij / rij;
-	  f[atomi][0] += delij[0]*fpair;
-	  f[atomi][1] += delij[1]*fpair;
-	  f[atomi][2] += delij[2]*fpair;
-	  f[atomj][0] -= delij[0]*fpair;
-	  f[atomj][1] -= delij[1]*fpair;
-	  f[atomj][2] -= delij[2]*fpair;
-
-	  if (vflag_atom) v_tally2_thr(atomi,atomj,fpair,delij,thr);
-
-	} else if (npath == 3) {
-	  fpair1 = dC*dwikS*wkjS / rikS;
-	  fi[0] = delikS[0]*fpair1;
-	  fi[1] = delikS[1]*fpair1;
-	  fi[2] = delikS[2]*fpair1;
-	  fpair2 = dC*wikS*dwkjS / rkjS;
-	  fj[0] = deljkS[0]*fpair2;
-	  fj[1] = deljkS[1]*fpair2;
-	  fj[2] = deljkS[2]*fpair2;
-
-	  f[atomi][0] += fi[0];
-	  f[atomi][1] += fi[1];
-	  f[atomi][2] += fi[2];
-	  f[atomj][0] += fj[0];
-	  f[atomj][1] += fj[1];
-	  f[atomj][2] += fj[2];
-	  f[atomk][0] -= fi[0] + fj[0];
-	  f[atomk][1] -= fi[1] + fj[1];
-	  f[atomk][2] -= fi[2] + fj[2];
-
-	  if (vflag_atom)
-	    v_tally3_thr(atomi,atomj,atomk,fi,fj,delikS,deljkS,thr);
-
-	} else {
-	  fpair1 = dC*dwikS*wkmS*wmjS / rikS;
-	  fi[0] = delikS[0]*fpair1;
-	  fi[1] = delikS[1]*fpair1;
-	  fi[2] = delikS[2]*fpair1;
-
-	  fpair2 = dC*wikS*dwkmS*wmjS / rkmS;
-	  fk[0] = delkmS[0]*fpair2 - fi[0];
-	  fk[1] = delkmS[1]*fpair2 - fi[1];
-	  fk[2] = delkmS[2]*fpair2 - fi[2];
-
-	  fpair3 = dC*wikS*wkmS*dwmjS / rmjS;
-	  fj[0] = deljmS[0]*fpair3;
-	  fj[1] = deljmS[1]*fpair3;
-	  fj[2] = deljmS[2]*fpair3;
-
-	  fm[0] = -delkmS[0]*fpair2 - fj[0];
-	  fm[1] = -delkmS[1]*fpair2 - fj[1];
-	  fm[2] = -delkmS[2]*fpair2 - fj[2];
-
-	  f[atomi][0] += fi[0];
-	  f[atomi][1] += fi[1];
-	  f[atomi][2] += fi[2];
-	  f[atomj][0] += fj[0];
-	  f[atomj][1] += fj[1];
-	  f[atomj][2] += fj[2];
-	  f[atomk][0] += fk[0];
-	  f[atomk][1] += fk[1];
-	  f[atomk][2] += fk[2];
-	  f[atomm][0] += fm[0];
-	  f[atomm][1] += fm[1];
-	  f[atomm][2] += fm[2];
-
-	  if (vflag_atom) {
-	    delimS[0] = delikS[0] + delkmS[0];
-	    delimS[1] = delikS[1] + delkmS[1];
-	    delimS[2] = delikS[2] + delkmS[2];
-	    v_tally4_thr(atomi,atomj,atomk,atomm,fi,fj,fk,delimS,deljmS,delkmS,thr);
-	  }
-	}
+        dC = Str*Stb*VLJ + (1.0-Str)*VLJ;
+        if (npath == 2) {
+          fpair = dC*dwij / rij;
+          f[atomi][0] += delij[0]*fpair;
+          f[atomi][1] += delij[1]*fpair;
+          f[atomi][2] += delij[2]*fpair;
+          f[atomj][0] -= delij[0]*fpair;
+          f[atomj][1] -= delij[1]*fpair;
+          f[atomj][2] -= delij[2]*fpair;
+
+          if (vflag_atom) v_tally2_thr(atomi,atomj,fpair,delij,thr);
+
+        } else if (npath == 3) {
+          fpair1 = dC*dwikS*wkjS / rikS;
+          fi[0] = delikS[0]*fpair1;
+          fi[1] = delikS[1]*fpair1;
+          fi[2] = delikS[2]*fpair1;
+          fpair2 = dC*wikS*dwkjS / rkjS;
+          fj[0] = deljkS[0]*fpair2;
+          fj[1] = deljkS[1]*fpair2;
+          fj[2] = deljkS[2]*fpair2;
+
+          f[atomi][0] += fi[0];
+          f[atomi][1] += fi[1];
+          f[atomi][2] += fi[2];
+          f[atomj][0] += fj[0];
+          f[atomj][1] += fj[1];
+          f[atomj][2] += fj[2];
+          f[atomk][0] -= fi[0] + fj[0];
+          f[atomk][1] -= fi[1] + fj[1];
+          f[atomk][2] -= fi[2] + fj[2];
+
+          if (vflag_atom)
+            v_tally3_thr(atomi,atomj,atomk,fi,fj,delikS,deljkS,thr);
+
+        } else {
+          fpair1 = dC*dwikS*wkmS*wmjS / rikS;
+          fi[0] = delikS[0]*fpair1;
+          fi[1] = delikS[1]*fpair1;
+          fi[2] = delikS[2]*fpair1;
+
+          fpair2 = dC*wikS*dwkmS*wmjS / rkmS;
+          fk[0] = delkmS[0]*fpair2 - fi[0];
+          fk[1] = delkmS[1]*fpair2 - fi[1];
+          fk[2] = delkmS[2]*fpair2 - fi[2];
+
+          fpair3 = dC*wikS*wkmS*dwmjS / rmjS;
+          fj[0] = deljmS[0]*fpair3;
+          fj[1] = deljmS[1]*fpair3;
+          fj[2] = deljmS[2]*fpair3;
+
+          fm[0] = -delkmS[0]*fpair2 - fj[0];
+          fm[1] = -delkmS[1]*fpair2 - fj[1];
+          fm[2] = -delkmS[2]*fpair2 - fj[2];
+
+          f[atomi][0] += fi[0];
+          f[atomi][1] += fi[1];
+          f[atomi][2] += fi[2];
+          f[atomj][0] += fj[0];
+          f[atomj][1] += fj[1];
+          f[atomj][2] += fj[2];
+          f[atomk][0] += fk[0];
+          f[atomk][1] += fk[1];
+          f[atomk][2] += fk[2];
+          f[atomm][0] += fm[0];
+          f[atomm][1] += fm[1];
+          f[atomm][2] += fm[2];
+
+          if (vflag_atom) {
+            delimS[0] = delikS[0] + delkmS[0];
+            delimS[1] = delikS[1] + delkmS[1];
+            delimS[2] = delikS[2] + delkmS[2];
+            v_tally4_thr(atomi,atomj,atomk,atomm,fi,fj,fk,delimS,deljmS,delkmS,thr);
+          }
+        }
       }
     }
   }
@@ -2292,7 +2292,7 @@ void PairAIREBOOMP::FLJ_thr(int ifrom, int ito, int evflag, int eflag,
 ------------------------------------------------------------------------- */
 
 void PairAIREBOOMP::TORSION_thr(int ifrom, int ito,
-				int evflag, int eflag, ThrData * const thr)
+                                int evflag, int eflag, ThrData * const thr)
 {
   int i,j,k,l,ii,itag,jtag;
   double evdwl,fpair,xtmp,ytmp,ztmp;
@@ -2338,13 +2338,13 @@ void PairAIREBOOMP::TORSION_thr(int ifrom, int ito,
       jtag = tag[j];
 
       if (itag > jtag) {
-	if ((itag+jtag) % 2 == 0) continue;
+        if ((itag+jtag) % 2 == 0) continue;
       } else if (itag < jtag) {
-	if ((itag+jtag) % 2 == 1) continue;
+        if ((itag+jtag) % 2 == 1) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
-	if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
+        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
       }
 
       jtype = map[type[j]];
@@ -2362,285 +2362,285 @@ void PairAIREBOOMP::TORSION_thr(int ifrom, int ito,
       w23 = Sp(r23,rcmin[itype][jtype],rcmax[itype][jtype],dw23);
 
       for (kk = 0; kk < REBO_numneigh[i]; kk++) {
-	k = REBO_neighs_i[kk];
-	ktype = map[type[k]];
-	if (k == j) continue;
-	del21[0] = x[i][0]-x[k][0];
-	del21[1] = x[i][1]-x[k][1];
-	del21[2] = x[i][2]-x[k][2];
-	rsq = del21[0]*del21[0] + del21[1]*del21[1] + del21[2]*del21[2];
-	r21 = sqrt(rsq);
-	cos321 = - ((del21[0]*del32[0]) + (del21[1]*del32[1]) +
-		    (del21[2]*del32[2])) / (r21*r32);
-	cos321 = MIN(cos321,1.0);
-	cos321 = MAX(cos321,-1.0);
-	sin321 = sqrt(1.0 - cos321*cos321);
-	if (sin321 < TOL) continue;
-
-	deljk[0] = del21[0]-del23[0];
-	deljk[1] = del21[1]-del23[1];
-	deljk[2] = del21[2]-del23[2];
-	rjk2 = deljk[0]*deljk[0] + deljk[1]*deljk[1] + deljk[2]*deljk[2];
-	rjk=sqrt(rjk2);
-	rik2 = r21*r21;
-	w21 = Sp(r21,rcmin[itype][ktype],rcmax[itype][ktype],dw21);
-
-	rij = r32;
-	rik = r21;
-	rij2 = r32*r32;
-	rik2 = r21*r21;
-	costmp = 0.5*(rij2+rik2-rjk2)/rij/rik;
-	tspjik = Sp2(costmp,thmin,thmax,dtsjik);
-	dtsjik = -dtsjik;
-
-	REBO_neighs_j = REBO_firstneigh[j];
-	for (ll = 0; ll < REBO_numneigh[j]; ll++) {
-	  l = REBO_neighs_j[ll];
-	  ltype = map[type[l]];
-	  if (l == i || l == k) continue;
-	  del34[0] = x[j][0]-x[l][0];
-	  del34[1] = x[j][1]-x[l][1];
-	  del34[2] = x[j][2]-x[l][2];
-	  rsq = del34[0]*del34[0] + del34[1]*del34[1] + del34[2]*del34[2];
-	  r34 = sqrt(rsq);
-	  cos234 = (del32[0]*del34[0] + del32[1]*del34[1] +
-		    del32[2]*del34[2]) / (r32*r34);
-	  cos234 = MIN(cos234,1.0);
-	  cos234 = MAX(cos234,-1.0);
-	  sin234 = sqrt(1.0 - cos234*cos234);
-	  if (sin234 < TOL) continue;
-	  w34 = Sp(r34,rcmin[jtype][ltype],rcmax[jtype][ltype],dw34);
-	  delil[0] = del23[0] + del34[0];
-	  delil[1] = del23[1] + del34[1];
-	  delil[2] = del23[2] + del34[2];
-	  ril2 = delil[0]*delil[0] + delil[1]*delil[1] + delil[2]*delil[2];
-	  ril=sqrt(ril2);
-	  rjl2 = r34*r34;
-
-	  rjl = r34;
-	  rjl2 = r34*r34;
-	  costmp = 0.5*(rij2+rjl2-ril2)/rij/rjl;
-	  tspijl = Sp2(costmp,thmin,thmax,dtsijl);
-	  dtsijl = -dtsijl; //need minus sign
-	  cross321[0] = (del32[1]*del21[2])-(del32[2]*del21[1]);
-	  cross321[1] = (del32[2]*del21[0])-(del32[0]*del21[2]);
-	  cross321[2] = (del32[0]*del21[1])-(del32[1]*del21[0]);
-	  cross321mag = sqrt(cross321[0]*cross321[0]+
-			     cross321[1]*cross321[1]+
-			     cross321[2]*cross321[2]);
-	  cross234[0] = (del23[1]*del34[2])-(del23[2]*del34[1]);
-	  cross234[1] = (del23[2]*del34[0])-(del23[0]*del34[2]);
-	  cross234[2] = (del23[0]*del34[1])-(del23[1]*del34[0]);
-	  cross234mag = sqrt(cross234[0]*cross234[0]+
-			     cross234[1]*cross234[1]+
-			     cross234[2]*cross234[2]);
-	  cwnum = (cross321[0]*cross234[0]) +
-	    (cross321[1]*cross234[1])+(cross321[2]*cross234[2]);
-	  cwnom = r21*r34*r32*r32*sin321*sin234;
-	  cw = cwnum/cwnom;
-
-	  cw2 = (.5*(1.0-cw));
-	  ekijl = epsilonT[ktype][ltype];
-	  Ec = 256.0*ekijl/405.0;
-	  Vtors = (Ec*(pow(cw2,5.0)))-(ekijl/10.0);
-
-	  if (eflag) evdwl = Vtors*w21*w23*w34*(1.0-tspjik)*(1.0-tspijl);
-
-	  dndij[0] = (cross234[1]*del21[2])-(cross234[2]*del21[1]);
-	  dndij[1] = (cross234[2]*del21[0])-(cross234[0]*del21[2]);
-	  dndij[2] = (cross234[0]*del21[1])-(cross234[1]*del21[0]);
-
-	  tmpvec[0] = (del34[1]*cross321[2])-(del34[2]*cross321[1]);
-	  tmpvec[1] = (del34[2]*cross321[0])-(del34[0]*cross321[2]);
-	  tmpvec[2] = (del34[0]*cross321[1])-(del34[1]*cross321[0]);
-
-	  dndij[0] = dndij[0]+tmpvec[0];
-	  dndij[1] = dndij[1]+tmpvec[1];
-	  dndij[2] = dndij[2]+tmpvec[2];
-
-	  dndik[0] = (del23[1]*cross234[2])-(del23[2]*cross234[1]);
-	  dndik[1] = (del23[2]*cross234[0])-(del23[0]*cross234[2]);
-	  dndik[2] = (del23[0]*cross234[1])-(del23[1]*cross234[0]);
-
-	  dndjl[0] = (cross321[1]*del23[2])-(cross321[2]*del23[1]);
-	  dndjl[1] = (cross321[2]*del23[0])-(cross321[0]*del23[2]);
-	  dndjl[2] = (cross321[0]*del23[1])-(cross321[1]*del23[0]);
-
-	  dcidij = ((r23*r23)-(r21*r21)+(rjk*rjk))/(2.0*r23*r23*r21);
-	  dcidik = ((r21*r21)-(r23*r23)+(rjk*rjk))/(2.0*r23*r21*r21);
-	  dcidjk = (-rjk)/(r23*r21);
-	  dcjdji = ((r23*r23)-(r34*r34)+(ril*ril))/(2.0*r23*r23*r34);
-	  dcjdjl = ((r34*r34)-(r23*r23)+(ril*ril))/(2.0*r23*r34*r34);
-	  dcjdil = (-ril)/(r23*r34);
-
-	  dsidij = (-cos321/sin321)*dcidij;
-	  dsidik = (-cos321/sin321)*dcidik;
-	  dsidjk = (-cos321/sin321)*dcidjk;
-
-	  dsjdji = (-cos234/sin234)*dcjdji;
-	  dsjdjl = (-cos234/sin234)*dcjdjl;
-	  dsjdil = (-cos234/sin234)*dcjdil;
-
-	  dxidij = (r21*sin321)+(r23*r21*dsidij);
-	  dxidik = (r23*sin321)+(r23*r21*dsidik);
-	  dxidjk = (r23*r21*dsidjk);
-
-	  dxjdji = (r34*sin234)+(r23*r34*dsjdji);
-	  dxjdjl = (r23*sin234)+(r23*r34*dsjdjl);
-	  dxjdil = (r23*r34*dsjdil);
-
-	  ddndij = (dxidij*cross234mag)+(cross321mag*dxjdji);
-	  ddndik = dxidik*cross234mag;
-	  ddndjk = dxidjk*cross234mag;
-	  ddndjl = cross321mag*dxjdjl;
-	  ddndil = cross321mag*dxjdil;
-	  dcwddn = -cwnum/(cwnom*cwnom);
-	  dcwdn = 1.0/cwnom;
-	  dvpdcw = (-1.0)*Ec*(-.5)*5.0*pow(cw2,4.0) *
-	    w23*w21*w34*(1.0-tspjik)*(1.0-tspijl);
-
-	  Ftmp[0] = dvpdcw*((dcwdn*dndij[0])+(dcwddn*ddndij*del23[0]/r23));
-	  Ftmp[1] = dvpdcw*((dcwdn*dndij[1])+(dcwddn*ddndij*del23[1]/r23));
-	  Ftmp[2] = dvpdcw*((dcwdn*dndij[2])+(dcwddn*ddndij*del23[2]/r23));
-	  fi[0] = Ftmp[0];
-	  fi[1] = Ftmp[1];
-	  fi[2] = Ftmp[2];
-	  fj[0] = -Ftmp[0];
-	  fj[1] = -Ftmp[1];
-	  fj[2] = -Ftmp[2];
-
-	  Ftmp[0] = dvpdcw*((dcwdn*dndik[0])+(dcwddn*ddndik*del21[0]/r21));
-	  Ftmp[1] = dvpdcw*((dcwdn*dndik[1])+(dcwddn*ddndik*del21[1]/r21));
-	  Ftmp[2] = dvpdcw*((dcwdn*dndik[2])+(dcwddn*ddndik*del21[2]/r21));
-	  fi[0] += Ftmp[0];
-	  fi[1] += Ftmp[1];
-	  fi[2] += Ftmp[2];
-	  fk[0] = -Ftmp[0];
-	  fk[1] = -Ftmp[1];
-	  fk[2] = -Ftmp[2];
-
-	  Ftmp[0] = (dvpdcw*dcwddn*ddndjk*deljk[0])/rjk;
-	  Ftmp[1] = (dvpdcw*dcwddn*ddndjk*deljk[1])/rjk;
-	  Ftmp[2] = (dvpdcw*dcwddn*ddndjk*deljk[2])/rjk;
-	  fj[0] += Ftmp[0];
-	  fj[1] += Ftmp[1];
-	  fj[2] += Ftmp[2];
-	  fk[0] -= Ftmp[0];
-	  fk[1] -= Ftmp[1];
-	  fk[2] -= Ftmp[2];
-
-	  Ftmp[0] = dvpdcw*((dcwdn*dndjl[0])+(dcwddn*ddndjl*del34[0]/r34));
-	  Ftmp[1] = dvpdcw*((dcwdn*dndjl[1])+(dcwddn*ddndjl*del34[1]/r34));
-	  Ftmp[2] = dvpdcw*((dcwdn*dndjl[2])+(dcwddn*ddndjl*del34[2]/r34));
-	  fj[0] += Ftmp[0];
-	  fj[1] += Ftmp[1];
-	  fj[2] += Ftmp[2];
-	  fl[0] = -Ftmp[0];
-	  fl[1] = -Ftmp[1];
-	  fl[2] = -Ftmp[2];
-
-	  Ftmp[0] = (dvpdcw*dcwddn*ddndil*delil[0])/ril;
-	  Ftmp[1] = (dvpdcw*dcwddn*ddndil*delil[1])/ril;
-	  Ftmp[2] = (dvpdcw*dcwddn*ddndil*delil[2])/ril;
-	  fi[0] += Ftmp[0];
-	  fi[1] += Ftmp[1];
-	  fi[2] += Ftmp[2];
-	  fl[0] -= Ftmp[0];
-	  fl[1] -= Ftmp[1];
-	  fl[2] -= Ftmp[2];
-
-	  // coordination forces
-
-	  fpair = Vtors*dw21*w23*w34*(1.0-tspjik)*(1.0-tspijl) / r21;
-	  fi[0] -= del21[0]*fpair;
-	  fi[1] -= del21[1]*fpair;
-	  fi[2] -= del21[2]*fpair;
-	  fk[0] += del21[0]*fpair;
-	  fk[1] += del21[1]*fpair;
-	  fk[2] += del21[2]*fpair;
-
-	  fpair = Vtors*w21*dw23*w34*(1.0-tspjik)*(1.0-tspijl) / r23;
-	  fi[0] -= del23[0]*fpair;
-	  fi[1] -= del23[1]*fpair;
-	  fi[2] -= del23[2]*fpair;
-	  fj[0] += del23[0]*fpair;
-	  fj[1] += del23[1]*fpair;
-	  fj[2] += del23[2]*fpair;
-
-	  fpair = Vtors*w21*w23*dw34*(1.0-tspjik)*(1.0-tspijl) / r34;
-	  fj[0] -= del34[0]*fpair;
-	  fj[1] -= del34[1]*fpair;
-	  fj[2] -= del34[2]*fpair;
-	  fl[0] += del34[0]*fpair;
-	  fl[1] += del34[1]*fpair;
-	  fl[2] += del34[2]*fpair;
-
-	  // additional cut off function forces
-
-	  fcpc = -Vtors*w21*w23*w34*dtsjik*(1.0-tspijl);
-	  fpair = fcpc*dcidij/rij;
-	  fi[0] += fpair*del23[0];
-	  fi[1] += fpair*del23[1];
-	  fi[2] += fpair*del23[2];
-	  fj[0] -= fpair*del23[0];
-	  fj[1] -= fpair*del23[1];
-	  fj[2] -= fpair*del23[2];
-
-	  fpair = fcpc*dcidik/rik;
-	  fi[0] += fpair*del21[0];
-	  fi[1] += fpair*del21[1];
-	  fi[2] += fpair*del21[2];
-	  fk[0] -= fpair*del21[0];
-	  fk[1] -= fpair*del21[1];
-	  fk[2] -= fpair*del21[2];
-
-	  fpair = fcpc*dcidjk/rjk;
-	  fj[0] += fpair*deljk[0];
-	  fj[1] += fpair*deljk[1];
-	  fj[2] += fpair*deljk[2];
-	  fk[0] -= fpair*deljk[0];
-	  fk[1] -= fpair*deljk[1];
-	  fk[2] -= fpair*deljk[2];
-
-	  fcpc = -Vtors*w21*w23*w34*(1.0-tspjik)*dtsijl;
-	  fpair = fcpc*dcjdji/rij;
-	  fi[0] += fpair*del23[0];
-	  fi[1] += fpair*del23[1];
-	  fi[2] += fpair*del23[2];
-	  fj[0] -= fpair*del23[0];
-	  fj[1] -= fpair*del23[1];
-	  fj[2] -= fpair*del23[2];
-
-	  fpair = fcpc*dcjdjl/rjl;
-	  fj[0] += fpair*del34[0];
-	  fj[1] += fpair*del34[1];
-	  fj[2] += fpair*del34[2];
-	  fl[0] -= fpair*del34[0];
-	  fl[1] -= fpair*del34[1];
-	  fl[2] -= fpair*del34[2];
-
-	  fpair = fcpc*dcjdil/ril;
-	  fi[0] += fpair*delil[0];
-	  fi[1] += fpair*delil[1];
-	  fi[2] += fpair*delil[2];
-	  fl[0] -= fpair*delil[0];
-	  fl[1] -= fpair*delil[1];
-	  fl[2] -= fpair*delil[2];
-
-	  // sum per-atom forces into atom force array
-
-	  f[i][0] += fi[0]; f[i][1] += fi[1]; f[i][2] += fi[2];
-	  f[j][0] += fj[0]; f[j][1] += fj[1]; f[j][2] += fj[2];
-	  f[k][0] += fk[0]; f[k][1] += fk[1]; f[k][2] += fk[2];
-	  f[l][0] += fl[0]; f[l][1] += fl[1]; f[l][2] += fl[2];
-
-	  if (evflag) {
-	    delkl[0] = delil[0] - del21[0];
-	    delkl[1] = delil[1] - del21[1];
-	    delkl[2] = delil[2] - del21[2];
-	    ev_tally4_thr(this,i,j,k,l,evdwl,fi,fj,fk,delil,del34,delkl,thr);
-	  }
-	}
+        k = REBO_neighs_i[kk];
+        ktype = map[type[k]];
+        if (k == j) continue;
+        del21[0] = x[i][0]-x[k][0];
+        del21[1] = x[i][1]-x[k][1];
+        del21[2] = x[i][2]-x[k][2];
+        rsq = del21[0]*del21[0] + del21[1]*del21[1] + del21[2]*del21[2];
+        r21 = sqrt(rsq);
+        cos321 = - ((del21[0]*del32[0]) + (del21[1]*del32[1]) +
+                    (del21[2]*del32[2])) / (r21*r32);
+        cos321 = MIN(cos321,1.0);
+        cos321 = MAX(cos321,-1.0);
+        sin321 = sqrt(1.0 - cos321*cos321);
+        if (sin321 < TOL) continue;
+
+        deljk[0] = del21[0]-del23[0];
+        deljk[1] = del21[1]-del23[1];
+        deljk[2] = del21[2]-del23[2];
+        rjk2 = deljk[0]*deljk[0] + deljk[1]*deljk[1] + deljk[2]*deljk[2];
+        rjk=sqrt(rjk2);
+        rik2 = r21*r21;
+        w21 = Sp(r21,rcmin[itype][ktype],rcmax[itype][ktype],dw21);
+
+        rij = r32;
+        rik = r21;
+        rij2 = r32*r32;
+        rik2 = r21*r21;
+        costmp = 0.5*(rij2+rik2-rjk2)/rij/rik;
+        tspjik = Sp2(costmp,thmin,thmax,dtsjik);
+        dtsjik = -dtsjik;
+
+        REBO_neighs_j = REBO_firstneigh[j];
+        for (ll = 0; ll < REBO_numneigh[j]; ll++) {
+          l = REBO_neighs_j[ll];
+          ltype = map[type[l]];
+          if (l == i || l == k) continue;
+          del34[0] = x[j][0]-x[l][0];
+          del34[1] = x[j][1]-x[l][1];
+          del34[2] = x[j][2]-x[l][2];
+          rsq = del34[0]*del34[0] + del34[1]*del34[1] + del34[2]*del34[2];
+          r34 = sqrt(rsq);
+          cos234 = (del32[0]*del34[0] + del32[1]*del34[1] +
+                    del32[2]*del34[2]) / (r32*r34);
+          cos234 = MIN(cos234,1.0);
+          cos234 = MAX(cos234,-1.0);
+          sin234 = sqrt(1.0 - cos234*cos234);
+          if (sin234 < TOL) continue;
+          w34 = Sp(r34,rcmin[jtype][ltype],rcmax[jtype][ltype],dw34);
+          delil[0] = del23[0] + del34[0];
+          delil[1] = del23[1] + del34[1];
+          delil[2] = del23[2] + del34[2];
+          ril2 = delil[0]*delil[0] + delil[1]*delil[1] + delil[2]*delil[2];
+          ril=sqrt(ril2);
+          rjl2 = r34*r34;
+
+          rjl = r34;
+          rjl2 = r34*r34;
+          costmp = 0.5*(rij2+rjl2-ril2)/rij/rjl;
+          tspijl = Sp2(costmp,thmin,thmax,dtsijl);
+          dtsijl = -dtsijl; //need minus sign
+          cross321[0] = (del32[1]*del21[2])-(del32[2]*del21[1]);
+          cross321[1] = (del32[2]*del21[0])-(del32[0]*del21[2]);
+          cross321[2] = (del32[0]*del21[1])-(del32[1]*del21[0]);
+          cross321mag = sqrt(cross321[0]*cross321[0]+
+                             cross321[1]*cross321[1]+
+                             cross321[2]*cross321[2]);
+          cross234[0] = (del23[1]*del34[2])-(del23[2]*del34[1]);
+          cross234[1] = (del23[2]*del34[0])-(del23[0]*del34[2]);
+          cross234[2] = (del23[0]*del34[1])-(del23[1]*del34[0]);
+          cross234mag = sqrt(cross234[0]*cross234[0]+
+                             cross234[1]*cross234[1]+
+                             cross234[2]*cross234[2]);
+          cwnum = (cross321[0]*cross234[0]) +
+            (cross321[1]*cross234[1])+(cross321[2]*cross234[2]);
+          cwnom = r21*r34*r32*r32*sin321*sin234;
+          cw = cwnum/cwnom;
+
+          cw2 = (.5*(1.0-cw));
+          ekijl = epsilonT[ktype][ltype];
+          Ec = 256.0*ekijl/405.0;
+          Vtors = (Ec*(pow(cw2,5.0)))-(ekijl/10.0);
+
+          if (eflag) evdwl = Vtors*w21*w23*w34*(1.0-tspjik)*(1.0-tspijl);
+
+          dndij[0] = (cross234[1]*del21[2])-(cross234[2]*del21[1]);
+          dndij[1] = (cross234[2]*del21[0])-(cross234[0]*del21[2]);
+          dndij[2] = (cross234[0]*del21[1])-(cross234[1]*del21[0]);
+
+          tmpvec[0] = (del34[1]*cross321[2])-(del34[2]*cross321[1]);
+          tmpvec[1] = (del34[2]*cross321[0])-(del34[0]*cross321[2]);
+          tmpvec[2] = (del34[0]*cross321[1])-(del34[1]*cross321[0]);
+
+          dndij[0] = dndij[0]+tmpvec[0];
+          dndij[1] = dndij[1]+tmpvec[1];
+          dndij[2] = dndij[2]+tmpvec[2];
+
+          dndik[0] = (del23[1]*cross234[2])-(del23[2]*cross234[1]);
+          dndik[1] = (del23[2]*cross234[0])-(del23[0]*cross234[2]);
+          dndik[2] = (del23[0]*cross234[1])-(del23[1]*cross234[0]);
+
+          dndjl[0] = (cross321[1]*del23[2])-(cross321[2]*del23[1]);
+          dndjl[1] = (cross321[2]*del23[0])-(cross321[0]*del23[2]);
+          dndjl[2] = (cross321[0]*del23[1])-(cross321[1]*del23[0]);
+
+          dcidij = ((r23*r23)-(r21*r21)+(rjk*rjk))/(2.0*r23*r23*r21);
+          dcidik = ((r21*r21)-(r23*r23)+(rjk*rjk))/(2.0*r23*r21*r21);
+          dcidjk = (-rjk)/(r23*r21);
+          dcjdji = ((r23*r23)-(r34*r34)+(ril*ril))/(2.0*r23*r23*r34);
+          dcjdjl = ((r34*r34)-(r23*r23)+(ril*ril))/(2.0*r23*r34*r34);
+          dcjdil = (-ril)/(r23*r34);
+
+          dsidij = (-cos321/sin321)*dcidij;
+          dsidik = (-cos321/sin321)*dcidik;
+          dsidjk = (-cos321/sin321)*dcidjk;
+
+          dsjdji = (-cos234/sin234)*dcjdji;
+          dsjdjl = (-cos234/sin234)*dcjdjl;
+          dsjdil = (-cos234/sin234)*dcjdil;
+
+          dxidij = (r21*sin321)+(r23*r21*dsidij);
+          dxidik = (r23*sin321)+(r23*r21*dsidik);
+          dxidjk = (r23*r21*dsidjk);
+
+          dxjdji = (r34*sin234)+(r23*r34*dsjdji);
+          dxjdjl = (r23*sin234)+(r23*r34*dsjdjl);
+          dxjdil = (r23*r34*dsjdil);
+
+          ddndij = (dxidij*cross234mag)+(cross321mag*dxjdji);
+          ddndik = dxidik*cross234mag;
+          ddndjk = dxidjk*cross234mag;
+          ddndjl = cross321mag*dxjdjl;
+          ddndil = cross321mag*dxjdil;
+          dcwddn = -cwnum/(cwnom*cwnom);
+          dcwdn = 1.0/cwnom;
+          dvpdcw = (-1.0)*Ec*(-.5)*5.0*pow(cw2,4.0) *
+            w23*w21*w34*(1.0-tspjik)*(1.0-tspijl);
+
+          Ftmp[0] = dvpdcw*((dcwdn*dndij[0])+(dcwddn*ddndij*del23[0]/r23));
+          Ftmp[1] = dvpdcw*((dcwdn*dndij[1])+(dcwddn*ddndij*del23[1]/r23));
+          Ftmp[2] = dvpdcw*((dcwdn*dndij[2])+(dcwddn*ddndij*del23[2]/r23));
+          fi[0] = Ftmp[0];
+          fi[1] = Ftmp[1];
+          fi[2] = Ftmp[2];
+          fj[0] = -Ftmp[0];
+          fj[1] = -Ftmp[1];
+          fj[2] = -Ftmp[2];
+
+          Ftmp[0] = dvpdcw*((dcwdn*dndik[0])+(dcwddn*ddndik*del21[0]/r21));
+          Ftmp[1] = dvpdcw*((dcwdn*dndik[1])+(dcwddn*ddndik*del21[1]/r21));
+          Ftmp[2] = dvpdcw*((dcwdn*dndik[2])+(dcwddn*ddndik*del21[2]/r21));
+          fi[0] += Ftmp[0];
+          fi[1] += Ftmp[1];
+          fi[2] += Ftmp[2];
+          fk[0] = -Ftmp[0];
+          fk[1] = -Ftmp[1];
+          fk[2] = -Ftmp[2];
+
+          Ftmp[0] = (dvpdcw*dcwddn*ddndjk*deljk[0])/rjk;
+          Ftmp[1] = (dvpdcw*dcwddn*ddndjk*deljk[1])/rjk;
+          Ftmp[2] = (dvpdcw*dcwddn*ddndjk*deljk[2])/rjk;
+          fj[0] += Ftmp[0];
+          fj[1] += Ftmp[1];
+          fj[2] += Ftmp[2];
+          fk[0] -= Ftmp[0];
+          fk[1] -= Ftmp[1];
+          fk[2] -= Ftmp[2];
+
+          Ftmp[0] = dvpdcw*((dcwdn*dndjl[0])+(dcwddn*ddndjl*del34[0]/r34));
+          Ftmp[1] = dvpdcw*((dcwdn*dndjl[1])+(dcwddn*ddndjl*del34[1]/r34));
+          Ftmp[2] = dvpdcw*((dcwdn*dndjl[2])+(dcwddn*ddndjl*del34[2]/r34));
+          fj[0] += Ftmp[0];
+          fj[1] += Ftmp[1];
+          fj[2] += Ftmp[2];
+          fl[0] = -Ftmp[0];
+          fl[1] = -Ftmp[1];
+          fl[2] = -Ftmp[2];
+
+          Ftmp[0] = (dvpdcw*dcwddn*ddndil*delil[0])/ril;
+          Ftmp[1] = (dvpdcw*dcwddn*ddndil*delil[1])/ril;
+          Ftmp[2] = (dvpdcw*dcwddn*ddndil*delil[2])/ril;
+          fi[0] += Ftmp[0];
+          fi[1] += Ftmp[1];
+          fi[2] += Ftmp[2];
+          fl[0] -= Ftmp[0];
+          fl[1] -= Ftmp[1];
+          fl[2] -= Ftmp[2];
+
+          // coordination forces
+
+          fpair = Vtors*dw21*w23*w34*(1.0-tspjik)*(1.0-tspijl) / r21;
+          fi[0] -= del21[0]*fpair;
+          fi[1] -= del21[1]*fpair;
+          fi[2] -= del21[2]*fpair;
+          fk[0] += del21[0]*fpair;
+          fk[1] += del21[1]*fpair;
+          fk[2] += del21[2]*fpair;
+
+          fpair = Vtors*w21*dw23*w34*(1.0-tspjik)*(1.0-tspijl) / r23;
+          fi[0] -= del23[0]*fpair;
+          fi[1] -= del23[1]*fpair;
+          fi[2] -= del23[2]*fpair;
+          fj[0] += del23[0]*fpair;
+          fj[1] += del23[1]*fpair;
+          fj[2] += del23[2]*fpair;
+
+          fpair = Vtors*w21*w23*dw34*(1.0-tspjik)*(1.0-tspijl) / r34;
+          fj[0] -= del34[0]*fpair;
+          fj[1] -= del34[1]*fpair;
+          fj[2] -= del34[2]*fpair;
+          fl[0] += del34[0]*fpair;
+          fl[1] += del34[1]*fpair;
+          fl[2] += del34[2]*fpair;
+
+          // additional cut off function forces
+
+          fcpc = -Vtors*w21*w23*w34*dtsjik*(1.0-tspijl);
+          fpair = fcpc*dcidij/rij;
+          fi[0] += fpair*del23[0];
+          fi[1] += fpair*del23[1];
+          fi[2] += fpair*del23[2];
+          fj[0] -= fpair*del23[0];
+          fj[1] -= fpair*del23[1];
+          fj[2] -= fpair*del23[2];
+
+          fpair = fcpc*dcidik/rik;
+          fi[0] += fpair*del21[0];
+          fi[1] += fpair*del21[1];
+          fi[2] += fpair*del21[2];
+          fk[0] -= fpair*del21[0];
+          fk[1] -= fpair*del21[1];
+          fk[2] -= fpair*del21[2];
+
+          fpair = fcpc*dcidjk/rjk;
+          fj[0] += fpair*deljk[0];
+          fj[1] += fpair*deljk[1];
+          fj[2] += fpair*deljk[2];
+          fk[0] -= fpair*deljk[0];
+          fk[1] -= fpair*deljk[1];
+          fk[2] -= fpair*deljk[2];
+
+          fcpc = -Vtors*w21*w23*w34*(1.0-tspjik)*dtsijl;
+          fpair = fcpc*dcjdji/rij;
+          fi[0] += fpair*del23[0];
+          fi[1] += fpair*del23[1];
+          fi[2] += fpair*del23[2];
+          fj[0] -= fpair*del23[0];
+          fj[1] -= fpair*del23[1];
+          fj[2] -= fpair*del23[2];
+
+          fpair = fcpc*dcjdjl/rjl;
+          fj[0] += fpair*del34[0];
+          fj[1] += fpair*del34[1];
+          fj[2] += fpair*del34[2];
+          fl[0] -= fpair*del34[0];
+          fl[1] -= fpair*del34[1];
+          fl[2] -= fpair*del34[2];
+
+          fpair = fcpc*dcjdil/ril;
+          fi[0] += fpair*delil[0];
+          fi[1] += fpair*delil[1];
+          fi[2] += fpair*delil[2];
+          fl[0] -= fpair*delil[0];
+          fl[1] -= fpair*delil[1];
+          fl[2] -= fpair*delil[2];
+
+          // sum per-atom forces into atom force array
+
+          f[i][0] += fi[0]; f[i][1] += fi[1]; f[i][2] += fi[2];
+          f[j][0] += fj[0]; f[j][1] += fj[1]; f[j][2] += fj[2];
+          f[k][0] += fk[0]; f[k][1] += fk[1]; f[k][2] += fk[2];
+          f[l][0] += fl[0]; f[l][1] += fl[1]; f[l][2] += fl[2];
+
+          if (evflag) {
+            delkl[0] = delil[0] - del21[0];
+            delkl[1] = delil[1] - del21[1];
+            delkl[2] = delil[2] - del21[2];
+            ev_tally4_thr(this,i,j,k,l,evdwl,fi,fj,fk,delil,del34,delkl,thr);
+          }
+        }
       }
     }
   }
@@ -2664,7 +2664,7 @@ void PairAIREBOOMP::REBO_neigh_thr()
     memory->destroy(nH);
     memory->create(REBO_numneigh,maxlocal,"AIREBO:numneigh");
     REBO_firstneigh = (int **) memory->smalloc(maxlocal*sizeof(int *),
-					       "AIREBO:firstneigh");
+                                               "AIREBO:firstneigh");
     memory->create(nC,maxlocal,"AIREBO:nC");
     memory->create(nH,maxlocal,"AIREBO:nH");
   }
@@ -2712,9 +2712,9 @@ void PairAIREBOOMP::REBO_neigh_thr()
 #pragma omp critical
 #endif
       if (pgsize - npnt < oneatom) {
-	npnt = 0;
-	npage += nthreads;
-	if (npage >= maxpage) add_pages(nthreads);
+        npnt = 0;
+        npage += nthreads;
+        if (npage >= maxpage) add_pages(nthreads);
       }
       neighptr = &(pages[npage][npnt]);
       n = 0;
@@ -2728,21 +2728,21 @@ void PairAIREBOOMP::REBO_neigh_thr()
       jnum = numneigh[i];
 
       for (jj = 0; jj < jnum; jj++) {
-	j = jlist[jj];
-	j &= NEIGHMASK;
-	jtype = map[type[j]];
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq < rcmaxsq[itype][jtype]) {
-	  neighptr[n++] = j;
-	  if (jtype == 0)
-	    nC[i] += Sp(sqrt(rsq),rcmin[itype][jtype],rcmax[itype][jtype],dS);
-	  else
-	    nH[i] += Sp(sqrt(rsq),rcmin[itype][jtype],rcmax[itype][jtype],dS);
-	}
+        j = jlist[jj];
+        j &= NEIGHMASK;
+        jtype = map[type[j]];
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq < rcmaxsq[itype][jtype]) {
+          neighptr[n++] = j;
+          if (jtype == 0)
+            nC[i] += Sp(sqrt(rsq),rcmin[itype][jtype],rcmax[itype][jtype],dS);
+          else
+            nH[i] += Sp(sqrt(rsq),rcmin[itype][jtype],rcmax[itype][jtype],dS);
+        }
       }
 
       REBO_firstneigh[i] = neighptr;
@@ -2750,7 +2750,7 @@ void PairAIREBOOMP::REBO_neigh_thr()
       npnt += n;
 
       if (npnt >= pgsize)
-	error->one(FLERR,"REBO list overflow, boost neigh_modify one or page");
+        error->one(FLERR,"REBO list overflow, boost neigh_modify one or page");
     }
   }
 }
diff --git a/src/USER-OMP/pair_airebo_omp.h b/src/USER-OMP/pair_airebo_omp.h
index 9ba598fa8f..03bc5e5f8c 100644
--- a/src/USER-OMP/pair_airebo_omp.h
+++ b/src/USER-OMP/pair_airebo_omp.h
@@ -34,15 +34,15 @@ class PairAIREBOOMP : public PairAIREBO, public ThrOMP {
 
  protected:
   double bondorder_thr(int i, int j, double rij[3], double rijmag,
-		       double VA, int vflag_atom, ThrData * const thr);
+                       double VA, int vflag_atom, ThrData * const thr);
   double bondorderLJ_thr(int i, int j, double rij[3], double rijmag,
-			 double VA, double rij0[3], double rijmag0,
-			 int vflag_atom, ThrData * const thr);
+                         double VA, double rij0[3], double rijmag0,
+                         int vflag_atom, ThrData * const thr);
 
   void FREBO_thr(int ifrom, int ito, int evflag, int eflag,
-		 int vflag_atom, ThrData * const thr);
+                 int vflag_atom, ThrData * const thr);
   void FLJ_thr(int ifrom, int ito, int evflag, int eflag,
-	       int vflag_atom, ThrData * const thr);
+               int vflag_atom, ThrData * const thr);
   void TORSION_thr(int ifrom, int ito, int evflag, int eflag, ThrData * const thr);
   void REBO_neigh_thr();
 };
diff --git a/src/USER-OMP/pair_beck_omp.cpp b/src/USER-OMP/pair_beck_omp.cpp
index 231aad0390..9bec6c0db2 100644
--- a/src/USER-OMP/pair_beck_omp.cpp
+++ b/src/USER-OMP/pair_beck_omp.cpp
@@ -56,11 +56,11 @@ void PairBeckOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -121,7 +121,7 @@ void PairBeckOMP::eval(int iifrom, int iito, ThrData * const thr)
 
       if (rsq < cutsq[itype][jtype]) {
         r = sqrt(rsq);
-        r5 = rsq*rsq*r; 
+        r5 = rsq*rsq*r;
         aaij = aa[itype][jtype];
         alphaij = alpha[itype][jtype];
         betaij = beta[itype][jtype];
@@ -129,31 +129,31 @@ void PairBeckOMP::eval(int iifrom, int iito, ThrData * const thr)
         term2 = 1.0/pow(term1,5.0);
         term3 = 21.672 + 30.0*aaij*aaij + 6.0*rsq;
         term4 = alphaij + r5*betaij;
-        term5 = alphaij + 6.0*r5*betaij; 
+        term5 = alphaij + 6.0*r5*betaij;
         rinv  = 1.0/r;
-	force_beck = AA[itype][jtype]*exp(-1.0*r*term4)*term5;
-        force_beck -= BB[itype][jtype]*r*term2*term3; 
- 
-	fpair = factor_lj*force_beck*rinv;
-        
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
+        force_beck = AA[itype][jtype]*exp(-1.0*r*term4)*term5;
+        force_beck -= BB[itype][jtype]*r*term2*term3;
+
+        fpair = factor_lj*force_beck*rinv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
           term6 = 1.0/pow(term1,3.0);
           term1inv = 1.0/term1;
           evdwl = AA[itype][jtype]*exp(-1.0*r*term4);
           evdwl -= BB[itype][jtype]*term6*(1.0+(2.709+3.0*aaij*aaij)*term1inv);
-	}
+        }
 
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_beck_omp.h b/src/USER-OMP/pair_beck_omp.h
index f079ff5ecb..18a4401bbc 100644
--- a/src/USER-OMP/pair_beck_omp.h
+++ b/src/USER-OMP/pair_beck_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_born_coul_long_omp.cpp b/src/USER-OMP/pair_born_coul_long_omp.cpp
index 73bf7e066b..f627f19bac 100644
--- a/src/USER-OMP/pair_born_coul_long_omp.cpp
+++ b/src/USER-OMP/pair_born_coul_long_omp.cpp
@@ -64,11 +64,11 @@ void PairBornCoulLongOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -133,51 +133,51 @@ void PairBornCoulLongOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-
-	if (rsq < cut_coulsq) {
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
-	  forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
-	    + born3[itype][jtype]*r2inv*r6inv;
-	} else forceborn = 0.0;
-	
-	fpair = (forcecoul + factor_lj*forceborn)*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = prefactor*erfc;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv 
-	      + d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+
+        if (rsq < cut_coulsq) {
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
+          forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
+            + born3[itype][jtype]*r2inv*r6inv;
+        } else forceborn = 0.0;
+
+        fpair = (forcecoul + factor_lj*forceborn)*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            ecoul = prefactor*erfc;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv
+              + d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_born_coul_long_omp.h b/src/USER-OMP/pair_born_coul_long_omp.h
index 3271c566a4..bdf81e514e 100644
--- a/src/USER-OMP/pair_born_coul_long_omp.h
+++ b/src/USER-OMP/pair_born_coul_long_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_born_coul_wolf_omp.cpp b/src/USER-OMP/pair_born_coul_wolf_omp.cpp
index c1ec917a2b..35e0ac7443 100644
--- a/src/USER-OMP/pair_born_coul_wolf_omp.cpp
+++ b/src/USER-OMP/pair_born_coul_wolf_omp.cpp
@@ -58,11 +58,11 @@ void PairBornCoulWolfOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -100,10 +100,10 @@ void PairBornCoulWolfOMP::eval(int iifrom, int iito, ThrData * const thr)
 
   // self and shifted coulombic energy
 
-  e_self = v_sh = 0.0; 
+  e_self = v_sh = 0.0;
   e_shift = erfc(alf*cut_coul)/cut_coul;
-  f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) / 
-    cut_coul; 
+  f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) /
+    cut_coul;
 
   ilist = list->ilist;
   numneigh = list->numneigh;
@@ -140,51 +140,51 @@ void PairBornCoulWolfOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
 
-	if (rsq < cut_coulsq) {
+        if (rsq < cut_coulsq) {
           prefactor = qqrd2e*qtmp*q[j]/r;
-          erfcc = erfc(alf*r); 
+          erfcc = erfc(alf*r);
           erfcd = exp(-alf*alf*r*r);
-          v_sh = (erfcc - e_shift*r) * prefactor; 
+          v_sh = (erfcc - e_shift*r) * prefactor;
           dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
           forcecoul = dvdrr*rsq*prefactor;
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
-	  forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
-	    + born3[itype][jtype]*r2inv*r6inv;
-	} else forceborn = 0.0;
-
-	fpair = (forcecoul + factor_lj*forceborn)*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = v_sh;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv +
-	      d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
+          forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
+            + born3[itype][jtype]*r2inv*r6inv;
+        } else forceborn = 0.0;
+
+        fpair = (forcecoul + factor_lj*forceborn)*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            ecoul = v_sh;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv +
+              d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_born_coul_wolf_omp.h b/src/USER-OMP/pair_born_coul_wolf_omp.h
index a190ad1a07..d714b32d29 100644
--- a/src/USER-OMP/pair_born_coul_wolf_omp.h
+++ b/src/USER-OMP/pair_born_coul_wolf_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_born_omp.cpp b/src/USER-OMP/pair_born_omp.cpp
index ebcdbf72bc..847efaa013 100644
--- a/src/USER-OMP/pair_born_omp.cpp
+++ b/src/USER-OMP/pair_born_omp.cpp
@@ -56,11 +56,11 @@ void PairBornOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -117,31 +117,31 @@ void PairBornOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r = sqrt(rsq);
-	rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
-	forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
-	  + born3[itype][jtype]*r2inv*r6inv;
-	fpair = factor_lj*forceborn*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv 
-	    + d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r = sqrt(rsq);
+        rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
+        forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
+          + born3[itype][jtype]*r2inv*r6inv;
+        fpair = factor_lj*forceborn*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv
+            + d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_born_omp.h b/src/USER-OMP/pair_born_omp.h
index 7260644728..db3c768f7a 100644
--- a/src/USER-OMP/pair_born_omp.h
+++ b/src/USER-OMP/pair_born_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_brownian_omp.cpp b/src/USER-OMP/pair_brownian_omp.cpp
index 8da8221345..561c82abf5 100644
--- a/src/USER-OMP/pair_brownian_omp.cpp
+++ b/src/USER-OMP/pair_brownian_omp.cpp
@@ -50,7 +50,7 @@ PairBrownianOMP::PairBrownianOMP(LAMMPS *lmp) :
 
 /* ---------------------------------------------------------------------- */
 
-PairBrownianOMP::~PairBrownianOMP() 
+PairBrownianOMP::~PairBrownianOMP()
 {
   if (random_thr) {
     for (int i=1; i < comm->nthreads; ++i)
@@ -80,37 +80,37 @@ void PairBrownianOMP::compute(int eflag, int vflag)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (int j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (int j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	double wallhi[3], walllo[3];
-	for (int j = 0; j < 3; j++){
-	  wallhi[j] = domain->prd[j];
-	  walllo[j] = 0;
-	}    
-	for (int m = 0; m < wallfix->nwall; m++){
-	  int dim = wallfix->wallwhich[m] / 2;
-	  int side = wallfix->wallwhich[m] % 2;
-	  if (wallfix->wallstyle[m] == VARIABLE){
-	    wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	  }	   
-	  else wallcoord = wallfix->coord0[m];	   
-	  if (side == 0) walllo[dim] = wallcoord;
-	  else wallhi[dim] = wallcoord;	   
-	}
-	for (int j = 0; j < 3; j++)
-	  dims[j] = wallhi[j] - walllo[j];
+        double wallhi[3], walllo[3];
+        for (int j = 0; j < 3; j++){
+          wallhi[j] = domain->prd[j];
+          walllo[j] = 0;
+        }
+        for (int m = 0; m < wallfix->nwall; m++){
+          int dim = wallfix->wallwhich[m] / 2;
+          int side = wallfix->wallwhich[m] % 2;
+          if (wallfix->wallstyle[m] == VARIABLE){
+            wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+          }
+          else wallcoord = wallfix->coord0[m];
+          if (side == 0) walllo[dim] = wallcoord;
+          else wallhi[dim] = wallcoord;
+        }
+        for (int j = 0; j < 3; j++)
+          dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0);
-	//RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0);
+        //RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	//RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        //RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
@@ -135,23 +135,23 @@ void PairBrownianOMP::compute(int eflag, int vflag)
     // generate a random number generator instance for
     // all threads != 0. make sure we use unique seeds.
     if (random_thr && tid > 0)
-      random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me 
-				    + comm->nprocs*tid);
+      random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me
+                                    + comm->nprocs*tid);
     if (flaglog) {
       if (evflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
-    } else { 
+    } else {
       if (evflag) {
-	if (force->newton_pair) eval<0,1,1>(ifrom, ito, thr);
-	else eval<0,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<0,1,1>(ifrom, ito, thr);
+        else eval<0,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
-	else eval<0,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
+        else eval<0,0,0>(ifrom, ito, thr);
       }
     }
 
@@ -202,8 +202,8 @@ void PairBrownianOMP::eval(int iifrom, int iito, ThrData * const thr)
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];       
-    
+    jnum = numneigh[i];
+
     // FLD contribution to force and torque due to isotropic terms
 
     if (flagfld) {
@@ -211,12 +211,12 @@ void PairBrownianOMP::eval(int iifrom, int iito, ThrData * const thr)
       f[i][1] += prethermostat*sqrt(R0)*(rng.uniform()-0.5);
       f[i][2] += prethermostat*sqrt(R0)*(rng.uniform()-0.5);
       if (FLAGLOG) {
-	torque[i][0] += prethermostat*sqrt(RT0)*(rng.uniform()-0.5);
-	torque[i][1] += prethermostat*sqrt(RT0)*(rng.uniform()-0.5);
-	torque[i][2] += prethermostat*sqrt(RT0)*(rng.uniform()-0.5);
+        torque[i][0] += prethermostat*sqrt(RT0)*(rng.uniform()-0.5);
+        torque[i][1] += prethermostat*sqrt(RT0)*(rng.uniform()-0.5);
+        torque[i][2] += prethermostat*sqrt(RT0)*(rng.uniform()-0.5);
       }
     }
-    
+
     if (!flagHI) continue;
 
     for (jj = 0; jj < jnum; jj++) {
@@ -230,25 +230,25 @@ void PairBrownianOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);      
-          
+        r = sqrt(rsq);
+
         // scalar resistances a_sq and a_sh
 
         h_sep = r - 2.0*radi;
-        
+
         // check for overlaps
 
         if (h_sep < 0.0) overlaps++;
-        
+
         // if less than minimum gap, use minimum gap instead
 
         if (r < cut_inner[itype][jtype])
-          h_sep = cut_inner[itype][jtype] - 2.0*radi;          
-        
+          h_sep = cut_inner[itype][jtype] - 2.0*radi;
+
         // scale h_sep by radi
 
         h_sep = h_sep/radi;
-  
+
         // scalar resistances
 
         if (FLAGLOG) {
@@ -257,70 +257,70 @@ void PairBrownianOMP::eval(int iifrom, int iito, ThrData * const thr)
           a_pu = 8.0*MY_PI*mu*pow(radi,3.0)*(3.0/160.0*log(1.0/h_sep));
         } else
           a_sq = 6.0*MY_PI*mu*radi*(1.0/4.0/h_sep);
-         
+
         // generate the Pairwise Brownian Force: a_sq
 
         Fbmag = prethermostat*sqrt(a_sq);
-        
+
         // generate a random number
 
         randr = rng.uniform()-0.5;
-          
+
         // contribution due to Brownian motion
 
         fx = Fbmag*randr*delx/r;
         fy = Fbmag*randr*dely/r;
         fz = Fbmag*randr*delz/r;
-        
+
         // add terms due to a_sh
 
         if (FLAGLOG) {
 
           // generate two orthogonal vectors to the line of centers
 
-          p1[0] = delx/r; p1[1] = dely/r; p1[2] = delz/r;                    
+          p1[0] = delx/r; p1[1] = dely/r; p1[2] = delz/r;
           set_3_orthogonal_vectors(p1,p2,p3);
-          
+
           // magnitude
 
-          Fbmag = prethermostat*sqrt(a_sh);          
-          
+          Fbmag = prethermostat*sqrt(a_sh);
+
           // force in each of the two directions
 
           randr = rng.uniform()-0.5;
           fx += Fbmag*randr*p2[0];
           fy += Fbmag*randr*p2[1];
           fz += Fbmag*randr*p2[2];
-          
+
           randr = rng.uniform()-0.5;
           fx += Fbmag*randr*p3[0];
           fy += Fbmag*randr*p3[1];
-          fz += Fbmag*randr*p3[2];          
-        }       
-        
+          fz += Fbmag*randr*p3[2];
+        }
+
         // scale forces to appropriate units
 
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
+
         // sum to total force
 
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;   
-
-	if (NEWTON_PAIR || j < nlocal) {
-	  //randr = rng.uniform()-0.5;
-	  //fx = Fbmag*randr*delx/r;
-	  //fy = Fbmag*randr*dely/r;
-	  //fz = Fbmag*randr*delz/r;
-
-	  f[j][0] += fx;
-	  f[j][1] += fy;
-	  f[j][2] += fz;  
-	}
-        
+        f[i][2] -= fz;
+
+        if (NEWTON_PAIR || j < nlocal) {
+          //randr = rng.uniform()-0.5;
+          //fx = Fbmag*randr*delx/r;
+          //fy = Fbmag*randr*dely/r;
+          //fz = Fbmag*randr*delz/r;
+
+          f[j][0] += fx;
+          f[j][1] += fy;
+          f[j][2] += fz;
+        }
+
         // torque due to the Brownian Force
 
         if (FLAGLOG) {
@@ -330,56 +330,56 @@ void PairBrownianOMP::eval(int iifrom, int iito, ThrData * const thr)
           xl[0] = -delx/r*radi;
           xl[1] = -dely/r*radi;
           xl[2] = -delz/r*radi;
-          
+
           // torque = xl_cross_F
 
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;              
-        
+          tz = xl[0]*fy - xl[1]*fx;
+
           // torque is same on both particles
 
           torque[i][0] -= tx;
           torque[i][1] -= ty;
-          torque[i][2] -= tz;          
-        
-	  if (NEWTON_PAIR || j < nlocal) {
-	    torque[j][0] -= tx;
-	    torque[j][1] -= ty;
-	    torque[j][2] -= tz;       
-	  }
+          torque[i][2] -= tz;
+
+          if (NEWTON_PAIR || j < nlocal) {
+            torque[j][0] -= tx;
+            torque[j][1] -= ty;
+            torque[j][2] -= tz;
+          }
 
           // torque due to a_pu
 
-          Fbmag = prethermostat*sqrt(a_pu);         
-          
+          Fbmag = prethermostat*sqrt(a_pu);
+
           // force in each direction
 
           randr = rng.uniform()-0.5;
           tx = Fbmag*randr*p2[0];
           ty = Fbmag*randr*p2[1];
           tz = Fbmag*randr*p2[2];
-          
+
           randr = rng.uniform()-0.5;
           tx += Fbmag*randr*p3[0];
           ty += Fbmag*randr*p3[1];
-          tz += Fbmag*randr*p3[2];    
-          
+          tz += Fbmag*randr*p3[2];
+
           // torque has opposite sign on two particles
 
           torque[i][0] -= tx;
           torque[i][1] -= ty;
-          torque[i][2] -= tz;          
-        
-	  if (NEWTON_PAIR || j < nlocal) {
-	    torque[j][0] += tx;
-	    torque[j][1] += ty;
-	    torque[j][2] += tz;  
-	  }     
+          torque[i][2] -= tz;
+
+          if (NEWTON_PAIR || j < nlocal) {
+            torque[j][0] += tx;
+            torque[j][1] += ty;
+            torque[j][2] += tz;
+          }
         }
 
         if (EVFLAG) ev_tally_xyz(i,j,nlocal,NEWTON_PAIR,
-				 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
+                                 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
       }
     }
   }
diff --git a/src/USER-OMP/pair_brownian_omp.h b/src/USER-OMP/pair_brownian_omp.h
index adf6d3362d..cdabe08ba1 100644
--- a/src/USER-OMP/pair_brownian_omp.h
+++ b/src/USER-OMP/pair_brownian_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_brownian_poly_omp.cpp b/src/USER-OMP/pair_brownian_poly_omp.cpp
index 891d868c25..6affbf96cf 100644
--- a/src/USER-OMP/pair_brownian_poly_omp.cpp
+++ b/src/USER-OMP/pair_brownian_poly_omp.cpp
@@ -50,7 +50,7 @@ PairBrownianPolyOMP::PairBrownianPolyOMP(LAMMPS *lmp) :
 
 /* ---------------------------------------------------------------------- */
 
-PairBrownianPolyOMP::~PairBrownianPolyOMP() 
+PairBrownianPolyOMP::~PairBrownianPolyOMP()
 {
   if (random_thr) {
     for (int i=1; i < comm->nthreads; ++i)
@@ -80,37 +80,37 @@ void PairBrownianPolyOMP::compute(int eflag, int vflag)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (int j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (int j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	double wallhi[3], walllo[3];
-	for (int j = 0; j < 3; j++){
-	  wallhi[j] = domain->prd[j];
-	  walllo[j] = 0;
-	}    
-	for (int m = 0; m < wallfix->nwall; m++){
-	  int dim = wallfix->wallwhich[m] / 2;
-	  int side = wallfix->wallwhich[m] % 2;
-	  if (wallfix->wallstyle[m] == VARIABLE){
-	    wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	  }	   
-	  else wallcoord = wallfix->coord0[m];	   
-	  if (side == 0) walllo[dim] = wallcoord;
-	  else wallhi[dim] = wallcoord;	   
-	}
-	for (int j = 0; j < 3; j++)
-	  dims[j] = wallhi[j] - walllo[j];
+        double wallhi[3], walllo[3];
+        for (int j = 0; j < 3; j++){
+          wallhi[j] = domain->prd[j];
+          walllo[j] = 0;
+        }
+        for (int m = 0; m < wallfix->nwall; m++){
+          int dim = wallfix->wallwhich[m] / 2;
+          int side = wallfix->wallwhich[m] % 2;
+          if (wallfix->wallstyle[m] == VARIABLE){
+            wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+          }
+          else wallcoord = wallfix->coord0[m];
+          if (side == 0) walllo[dim] = wallcoord;
+          else wallhi[dim] = wallcoord;
+        }
+        for (int j = 0; j < 3; j++)
+          dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0);
-	//RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0);
+        //RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	//RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        //RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3)*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
@@ -135,16 +135,16 @@ void PairBrownianPolyOMP::compute(int eflag, int vflag)
     // generate a random number generator instance for
     // all threads != 0. make sure we use unique seeds.
     if (random_thr && tid > 0)
-      random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me 
-				    + comm->nprocs*tid);
+      random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me
+                                    + comm->nprocs*tid);
     if (flaglog) {
       if (evflag)
-	eval<1,1>(ifrom, ito, thr);
+        eval<1,1>(ifrom, ito, thr);
       else
-	eval<1,0>(ifrom, ito, thr);
-    } else { 
+        eval<1,0>(ifrom, ito, thr);
+    } else {
       if (evflag)
-	eval<0,1>(ifrom, ito, thr);
+        eval<0,1>(ifrom, ito, thr);
       else eval<0,0>(ifrom, ito, thr);
     }
 
@@ -175,7 +175,7 @@ void PairBrownianPolyOMP::eval(int iifrom, int iito, ThrData * const thr)
   double prethermostat;
   double xl[3],a_sq,a_sh,a_pu,Fbmag;
   double p1[3],p2[3],p3[3];
-  
+
   // scale factor for Brownian moments
 
   prethermostat = sqrt(24.0*force->boltz*t_target/update->dt);
@@ -195,8 +195,8 @@ void PairBrownianPolyOMP::eval(int iifrom, int iito, ThrData * const thr)
     itype = type[i];
     radi = radius[i];
     jlist = firstneigh[i];
-    jnum = numneigh[i];       
-    
+    jnum = numneigh[i];
+
     // FLD contribution to force and torque due to isotropic terms
 
     if (flagfld) {
@@ -204,13 +204,13 @@ void PairBrownianPolyOMP::eval(int iifrom, int iito, ThrData * const thr)
       f[i][1] += prethermostat*sqrt(R0*radi)*(rng.uniform()-0.5);
       f[i][2] += prethermostat*sqrt(R0*radi)*(rng.uniform()-0.5);
       if (FLAGLOG) {
-	const double rad3 = radi*radi*radi;
-	torque[i][0] += prethermostat*sqrt(RT0*rad3)*(rng.uniform()-0.5);
-	torque[i][1] += prethermostat*sqrt(RT0*rad3)*(rng.uniform()-0.5);
-	torque[i][2] += prethermostat*sqrt(RT0*rad3)*(rng.uniform()-0.5);
+        const double rad3 = radi*radi*radi;
+        torque[i][0] += prethermostat*sqrt(RT0*rad3)*(rng.uniform()-0.5);
+        torque[i][1] += prethermostat*sqrt(RT0*rad3)*(rng.uniform()-0.5);
+        torque[i][2] += prethermostat*sqrt(RT0*rad3)*(rng.uniform()-0.5);
       }
     }
-    
+
     if (!flagHI) continue;
 
     for (jj = 0; jj < jnum; jj++) {
@@ -225,99 +225,99 @@ void PairBrownianPolyOMP::eval(int iifrom, int iito, ThrData * const thr)
       radj = radius[j];
 
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);      
-          
+        r = sqrt(rsq);
+
         // scalar resistances a_sq and a_sh
 
         h_sep = r - radi-radj;
-        
+
         // check for overlaps
 
         if (h_sep < 0.0) overlaps++;
-        
+
         // if less than minimum gap, use minimum gap instead
 
         if (r < cut_inner[itype][jtype])
           h_sep = cut_inner[itype][jtype] - radi-radj;
-        
+
         // scale h_sep by radi
 
         h_sep = h_sep/radi;
         beta0 = radj/radi;
         beta1 = 1.0 + beta0;
-  
+
         // scalar resistances
 
         if (FLAGLOG) {
-          a_sq = beta0*beta0/beta1/beta1/h_sep + 
-	    (1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3.0)*log(1.0/h_sep);
-          a_sq += (1.0+18.0*beta0-29.0*beta0*beta0+18.0*pow(beta0,3.0) + 
-		   pow(beta0,4.0))/21.0/pow(beta1,4.0)*h_sep*log(1.0/h_sep);
+          a_sq = beta0*beta0/beta1/beta1/h_sep +
+            (1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3.0)*log(1.0/h_sep);
+          a_sq += (1.0+18.0*beta0-29.0*beta0*beta0+18.0*pow(beta0,3.0) +
+                   pow(beta0,4.0))/21.0/pow(beta1,4.0)*h_sep*log(1.0/h_sep);
           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.0) * 
-	    log(1.0/h_sep);
-          a_sh += 4.0*(16.0-45.0*beta0+58.0*beta0*beta0-45.0*pow(beta0,3.0) + 
-		       16.0*pow(beta0,4.0))/375.0/pow(beta1,4.0) * 
-	    h_sep*log(1.0/h_sep);
+          a_sh = 4.0*beta0*(2.0+beta0+2.0*beta0*beta0)/15.0/pow(beta1,3.0) *
+            log(1.0/h_sep);
+          a_sh += 4.0*(16.0-45.0*beta0+58.0*beta0*beta0-45.0*pow(beta0,3.0) +
+                       16.0*pow(beta0,4.0))/375.0/pow(beta1,4.0) *
+            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.0))/250.0/pow(beta1,3.0)*h_sep*log(1.0/h_sep);
+          a_pu += (32.0-33.0*beta0+83.0*beta0*beta0+43.0 *
+                   pow(beta0,3.0))/250.0/pow(beta1,3.0)*h_sep*log(1.0/h_sep);
           a_pu *= 8.0*MY_PI*mu*pow(radi,3.0);
 
         } else a_sq = 6.0*MY_PI*mu*radi*(beta0*beta0/beta1/beta1/h_sep);
-         
+
         // generate the Pairwise Brownian Force: a_sq
 
         Fbmag = prethermostat*sqrt(a_sq);
-        
+
         // generate a random number
 
         randr = rng.uniform()-0.5;
-          
+
         // contribution due to Brownian motion
 
         fx = Fbmag*randr*delx/r;
         fy = Fbmag*randr*dely/r;
         fz = Fbmag*randr*delz/r;
-        
+
         // add terms due to a_sh
 
         if (FLAGLOG) {
 
           // generate two orthogonal vectors to the line of centers
 
-          p1[0] = delx/r; p1[1] = dely/r; p1[2] = delz/r;                    
+          p1[0] = delx/r; p1[1] = dely/r; p1[2] = delz/r;
           set_3_orthogonal_vectors(p1,p2,p3);
-          
+
           // magnitude
 
-          Fbmag = prethermostat*sqrt(a_sh);          
-          
+          Fbmag = prethermostat*sqrt(a_sh);
+
           // force in each of the two directions
 
           randr = rng.uniform()-0.5;
           fx += Fbmag*randr*p2[0];
           fy += Fbmag*randr*p2[1];
           fz += Fbmag*randr*p2[2];
-          
+
           randr = rng.uniform()-0.5;
           fx += Fbmag*randr*p3[0];
           fy += Fbmag*randr*p3[1];
-          fz += Fbmag*randr*p3[2];          
-        }       
-        
+          fz += Fbmag*randr*p3[2];
+        }
+
         // scale forces to appropriate units
 
         fx = vxmu2f*fx;
         fy = vxmu2f*fy;
         fz = vxmu2f*fz;
-        
+
         // sum to total force
 
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;   
+        f[i][2] -= fz;
 
         // torque due to the Brownian Force
 
@@ -328,47 +328,47 @@ void PairBrownianPolyOMP::eval(int iifrom, int iito, ThrData * const thr)
           xl[0] = -delx/r*radi;
           xl[1] = -dely/r*radi;
           xl[2] = -delz/r*radi;
-          
+
           // torque = xl_cross_F
 
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;              
-        
+          tz = xl[0]*fy - xl[1]*fx;
+
           // torque is same on both particles
 
           torque[i][0] -= tx;
           torque[i][1] -= ty;
-          torque[i][2] -= tz;          
-        
+          torque[i][2] -= tz;
+
           // torque due to a_pu
 
-          Fbmag = prethermostat*sqrt(a_pu);         
-          
+          Fbmag = prethermostat*sqrt(a_pu);
+
           // force in each direction
 
           randr = rng.uniform()-0.5;
           tx = Fbmag*randr*p2[0];
           ty = Fbmag*randr*p2[1];
           tz = Fbmag*randr*p2[2];
-          
+
           randr = rng.uniform()-0.5;
           tx += Fbmag*randr*p3[0];
           ty += Fbmag*randr*p3[1];
-          tz += Fbmag*randr*p3[2];    
-          
+          tz += Fbmag*randr*p3[2];
+
           // torque has opposite sign on two particles
 
           torque[i][0] -= tx;
           torque[i][1] -= ty;
-          torque[i][2] -= tz;          
-        
+          torque[i][2] -= tz;
+
         }
 
-	// set j = nlocal so that only I gets tallied
+        // set j = nlocal so that only I gets tallied
 
         if (EVFLAG) ev_tally_xyz(i,nlocal,nlocal,/* newton_pair */ 0,
-				 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
+                                 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
       }
     }
   }
diff --git a/src/USER-OMP/pair_brownian_poly_omp.h b/src/USER-OMP/pair_brownian_poly_omp.h
index 23443e51e0..663696c6c6 100644
--- a/src/USER-OMP/pair_brownian_poly_omp.h
+++ b/src/USER-OMP/pair_brownian_poly_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_buck_coul_cut_omp.cpp b/src/USER-OMP/pair_buck_coul_cut_omp.cpp
index a3152ee15a..8b570ff1a0 100644
--- a/src/USER-OMP/pair_buck_coul_cut_omp.cpp
+++ b/src/USER-OMP/pair_buck_coul_cut_omp.cpp
@@ -56,11 +56,11 @@ void PairBuckCoulCutOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -123,43 +123,43 @@ void PairBuckCoulCutOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-
-	if (rsq < cut_coulsq[itype][jtype])
-	  forcecoul = qqrd2e * qtmp*q[j]/r;
-	else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  rexp = exp(-r*rhoinv[itype][jtype]);
-	  forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
-	} else forcebuck = 0.0;
-	
-	fpair = (forcecoul + factor_lj*forcebuck)*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq[itype][jtype])
-	    ecoul = factor_coul * qqrd2e * qtmp*q[j]/r;
-	  else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+
+        if (rsq < cut_coulsq[itype][jtype])
+          forcecoul = qqrd2e * qtmp*q[j]/r;
+        else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          rexp = exp(-r*rhoinv[itype][jtype]);
+          forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
+        } else forcebuck = 0.0;
+
+        fpair = (forcecoul + factor_lj*forcebuck)*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq[itype][jtype])
+            ecoul = factor_coul * qqrd2e * qtmp*q[j]/r;
+          else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_buck_coul_cut_omp.h b/src/USER-OMP/pair_buck_coul_cut_omp.h
index 8fee0808c0..cf142b022a 100644
--- a/src/USER-OMP/pair_buck_coul_cut_omp.h
+++ b/src/USER-OMP/pair_buck_coul_cut_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_buck_coul_long_omp.cpp b/src/USER-OMP/pair_buck_coul_long_omp.cpp
index 3347e728ea..85f2b48db9 100644
--- a/src/USER-OMP/pair_buck_coul_long_omp.cpp
+++ b/src/USER-OMP/pair_buck_coul_long_omp.cpp
@@ -64,11 +64,11 @@ void PairBuckCoulLongOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -134,50 +134,50 @@ void PairBuckCoulLongOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-
-	if (rsq < cut_coulsq) {
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  rexp = exp(-r*rhoinv[itype][jtype]);
-	  forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
-	} else forcebuck = 0.0;
-	
-	fpair = (forcecoul + factor_lj*forcebuck)*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = prefactor*erfc;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+
+        if (rsq < cut_coulsq) {
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          rexp = exp(-r*rhoinv[itype][jtype]);
+          forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
+        } else forcebuck = 0.0;
+
+        fpair = (forcecoul + factor_lj*forcebuck)*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            ecoul = prefactor*erfc;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_buck_coul_long_omp.h b/src/USER-OMP/pair_buck_coul_long_omp.h
index a47e809eec..1309bc4c4b 100644
--- a/src/USER-OMP/pair_buck_coul_long_omp.h
+++ b/src/USER-OMP/pair_buck_coul_long_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_buck_coul_omp.cpp b/src/USER-OMP/pair_buck_coul_omp.cpp
index 4ff10ba02c..d1e54f1b11 100644
--- a/src/USER-OMP/pair_buck_coul_omp.cpp
+++ b/src/USER-OMP/pair_buck_coul_omp.cpp
@@ -66,11 +66,11 @@ void PairBuckCoulOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -108,14 +108,14 @@ void PairBuckCoulOMP::eval(int iifrom, int iito, ThrData * const thr)
   int i, ii, j, order1 = ewald_order&(1<<1), order6 = ewald_order&(1<<6);
   int *jneigh, *jneighn, typei, typej, ni;
   double qi, qri, *cutsqi, *cut_bucksqi,
-	 *buck1i, *buck2i, *buckai, *buckci, *rhoinvi, *offseti;
+         *buck1i, *buck2i, *buckai, *buckci, *rhoinvi, *offseti;
   double r, rsq, r2inv, force_coul, force_buck;
   double g2 = g_ewald*g_ewald, g6 = g2*g2*g2, g8 = g6*g2;
   vector xi, d;
 
-  for (ii = iifrom; ii < iito; ++ii) {			// loop over my atoms
+  for (ii = iifrom; ii < iito; ++ii) {                        // loop over my atoms
     i = ilist[ii]; fi = f0+3*i;
-    if (order1) qri = (qi = q[i])*qqrd2e;		// initialize constants
+    if (order1) qri = (qi = q[i])*qqrd2e;                // initialize constants
     offseti = offset[typei = type[i]];
     buck1i = buck1[typei]; buck2i = buck2[typei];
     buckai = buck_a[typei]; buckci = buck_c[typei], rhoinvi = rhoinv[typei];
@@ -123,97 +123,97 @@ void PairBuckCoulOMP::eval(int iifrom, int iito, ThrData * const thr)
     memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
     jneighn = (jneigh = list->firstneigh[i])+list->numneigh[i];
 
-    for (; jneigh<jneighn; ++jneigh) {			// loop over neighbors
+    for (; jneigh<jneighn; ++jneigh) {                        // loop over neighbors
       j = *jneigh;
       ni = sbmask(j);
       j &= NEIGHMASK;
-      
+
       { const register double *xj = x0+(j+(j<<1));
-	d[0] = xi[0] - xj[0];				// pair vector
-	d[1] = xi[1] - xj[1];
-	d[2] = xi[2] - xj[2]; }
+        d[0] = xi[0] - xj[0];                                // pair vector
+        d[1] = xi[1] - xj[1];
+        d[2] = xi[2] - xj[2]; }
 
       if ((rsq = vec_dot(d, d)) >= cutsqi[typej = type[j]]) continue;
       r2inv = 1.0/rsq;
       r = sqrt(rsq);
 
-      if (order1 && (rsq < cut_coulsq)) {		// coulombic
-	if (!ncoultablebits || rsq <= tabinnersq) {	// series real space
-	  register double x = g_ewald*r;
-	  register double s = qri*q[j], t = 1.0/(1.0+EWALD_P*x);
-	  if (ni == 0) {
-	    s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
-	    if (EFLAG) ecoul = t;
-	  } else {					// special case
-	    register double f = s*(1.0-special_coul[ni])/r;
-	    s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-f;
-	    if (EFLAG) ecoul = t-f;
-	  }					// table real space
-	} else {
-	  register union_int_float_t t;
-	  t.f = rsq;
-	  register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
-	  register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
-	  if (ni == 0) {
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]);
-	    if (EFLAG) ecoul = qiqj*(etable[k]+f*detable[k]);
-	  }
-	  else {					// special case
-	    t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
-	    if (EFLAG) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
-	  }
-	}
+      if (order1 && (rsq < cut_coulsq)) {                // coulombic
+        if (!ncoultablebits || rsq <= tabinnersq) {        // series real space
+          register double x = g_ewald*r;
+          register double s = qri*q[j], t = 1.0/(1.0+EWALD_P*x);
+          if (ni == 0) {
+            s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
+            if (EFLAG) ecoul = t;
+          } else {                                        // special case
+            register double f = s*(1.0-special_coul[ni])/r;
+            s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-f;
+            if (EFLAG) ecoul = t-f;
+          }                                        // table real space
+        } else {
+          register union_int_float_t t;
+          t.f = rsq;
+          register const int k = (t.i & ncoulmask) >> ncoulshiftbits;
+          register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
+          if (ni == 0) {
+            force_coul = qiqj*(ftable[k]+f*dftable[k]);
+            if (EFLAG) ecoul = qiqj*(etable[k]+f*detable[k]);
+          }
+          else {                                        // special case
+            t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
+            force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
+            if (EFLAG) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
+          }
+        }
       } else force_coul = ecoul = 0.0;
 
-      if (rsq < cut_bucksqi[typej]) {			// buckingham
-	register double rn = r2inv*r2inv*r2inv, 
-			expr = exp(-r*rhoinvi[typej]);
-	if (order6) {					// long-range
-	  register double x2 = g2*rsq, a2 = 1.0/x2;
-	  x2 = a2*exp(-x2)*buckci[typej];
-	  if (ni == 0) {
-	    force_buck =
-	      r*expr*buck1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
-	    if (EFLAG) evdwl = expr*buckai[typej]-g6*((a2+1.0)*a2+0.5)*x2;
-	  } else {					// special case
-	    register double f = special_lj[ni], t = rn*(1.0-f);
-	    force_buck = f*r*expr*buck1i[typej]-
-	      g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*buck2i[typej];
-	    if (EFLAG) evdwl = f*expr*buckai[typej] - 
-			 g6*((a2+1.0)*a2+0.5)*x2+t*buckci[typej];
-	  }
-	} else {						// cut
-	  if (ni == 0) {
-	    force_buck = r*expr*buck1i[typej]-rn*buck2i[typej];
-	    if (EFLAG) evdwl = expr*buckai[typej] - 
-			 rn*buckci[typej]-offseti[typej];
-	  } else {					// special case
-	    register double f = special_lj[ni];
-	    force_buck = f*(r*expr*buck1i[typej]-rn*buck2i[typej]);
-	    if (EFLAG) 
-	      evdwl = f*(expr*buckai[typej]-rn*buckci[typej]-offseti[typej]);
-	  }
-	}
+      if (rsq < cut_bucksqi[typej]) {                        // buckingham
+        register double rn = r2inv*r2inv*r2inv,
+                        expr = exp(-r*rhoinvi[typej]);
+        if (order6) {                                        // long-range
+          register double x2 = g2*rsq, a2 = 1.0/x2;
+          x2 = a2*exp(-x2)*buckci[typej];
+          if (ni == 0) {
+            force_buck =
+              r*expr*buck1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
+            if (EFLAG) evdwl = expr*buckai[typej]-g6*((a2+1.0)*a2+0.5)*x2;
+          } else {                                        // special case
+            register double f = special_lj[ni], t = rn*(1.0-f);
+            force_buck = f*r*expr*buck1i[typej]-
+              g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*buck2i[typej];
+            if (EFLAG) evdwl = f*expr*buckai[typej] -
+                         g6*((a2+1.0)*a2+0.5)*x2+t*buckci[typej];
+          }
+        } else {                                                // cut
+          if (ni == 0) {
+            force_buck = r*expr*buck1i[typej]-rn*buck2i[typej];
+            if (EFLAG) evdwl = expr*buckai[typej] -
+                         rn*buckci[typej]-offseti[typej];
+          } else {                                        // special case
+            register double f = special_lj[ni];
+            force_buck = f*(r*expr*buck1i[typej]-rn*buck2i[typej]);
+            if (EFLAG)
+              evdwl = f*(expr*buckai[typej]-rn*buckci[typej]-offseti[typej]);
+          }
+        }
       } else force_buck = evdwl = 0.0;
 
       fpair = (force_coul+force_buck)*r2inv;
 
       if (NEWTON_PAIR || j < nlocal) {
-	register double *fj = f0+(j+(j<<1)), f;
-	fi[0] += f = d[0]*fpair; fj[0] -= f;
-	fi[1] += f = d[1]*fpair; fj[1] -= f;
-	fi[2] += f = d[2]*fpair; fj[2] -= f;
+        register double *fj = f0+(j+(j<<1)), f;
+        fi[0] += f = d[0]*fpair; fj[0] -= f;
+        fi[1] += f = d[1]*fpair; fj[1] -= f;
+        fi[2] += f = d[2]*fpair; fj[2] -= f;
       } else {
-	fi[0] += d[0]*fpair;
-	fi[1] += d[1]*fpair;
-	fi[2] += d[2]*fpair;
+        fi[0] += d[0]*fpair;
+        fi[1] += d[1]*fpair;
+        fi[2] += d[2]*fpair;
       }
 
       if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-			       evdwl,ecoul,fpair,d[0],d[1],d[2],thr);
+                               evdwl,ecoul,fpair,d[0],d[1],d[2],thr);
     }
   }
 }
diff --git a/src/USER-OMP/pair_buck_coul_omp.h b/src/USER-OMP/pair_buck_coul_omp.h
index 823f64a4ab..9fc11818a6 100644
--- a/src/USER-OMP/pair_buck_coul_omp.h
+++ b/src/USER-OMP/pair_buck_coul_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_buck_omp.cpp b/src/USER-OMP/pair_buck_omp.cpp
index ae6cbcf4b7..8b32e2cfa5 100644
--- a/src/USER-OMP/pair_buck_omp.cpp
+++ b/src/USER-OMP/pair_buck_omp.cpp
@@ -56,11 +56,11 @@ void PairBuckOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -117,33 +117,33 @@ void PairBuckOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r = sqrt(rsq);
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r = sqrt(rsq);
-	rexp = exp(-r*rhoinv[itype][jtype]);
-	forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
-	fpair = factor_lj*forcebuck*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r = sqrt(rsq);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r = sqrt(rsq);
+        rexp = exp(-r*rhoinv[itype][jtype]);
+        forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
+        fpair = factor_lj*forcebuck*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_buck_omp.h b/src/USER-OMP/pair_buck_omp.h
index c73e3f0d08..72e1178803 100644
--- a/src/USER-OMP/pair_buck_omp.h
+++ b/src/USER-OMP/pair_buck_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_cdeam_omp.cpp b/src/USER-OMP/pair_cdeam_omp.cpp
index 4963528b7c..bec3ce4b25 100644
--- a/src/USER-OMP/pair_cdeam_omp.cpp
+++ b/src/USER-OMP/pair_cdeam_omp.cpp
@@ -30,16 +30,16 @@ using namespace LAMMPS_NS;
 // This is for debugging purposes. The ASSERT() macro is used in the code to check
 // if everything runs as expected. Change this to #if 0 if you don't need the checking.
 #if 0
-	#define ASSERT(cond) ((!(cond)) ? my_failure(error,__FILE__,__LINE__) : my_noop())
-
-	inline void my_noop() {}
-	inline void my_failure(Error* error, const char* file, int line) {
-		char str[1024];
-		sprintf(str,"Assertion failure: File %s, line %i", file, line);
-		error->one(FLERR,str);
-	}
+        #define ASSERT(cond) ((!(cond)) ? my_failure(error,__FILE__,__LINE__) : my_noop())
+
+        inline void my_noop() {}
+        inline void my_failure(Error* error, const char* file, int line) {
+                char str[1024];
+                sprintf(str,"Assertion failure: File %s, line %i", file, line);
+                error->one(FLERR,str);
+        }
 #else
-	#define ASSERT(cond)
+        #define ASSERT(cond)
 #endif
 
 /* ---------------------------------------------------------------------- */
@@ -83,11 +83,11 @@ void PairCDEAMOMP::compute(int eflag, int vflag)
 #endif
   {
     int ifrom, ito, tid;
- 
+
     loop_setup_thr(ifrom, ito, tid, inum, nthreads);
     ThrData *thr = fix->get_thr(tid);
     ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr);
-    
+
     if (force->newton_pair)
       thr->init_cdeam(nall, rho, rhoB, D_values);
     else
@@ -96,34 +96,34 @@ void PairCDEAMOMP::compute(int eflag, int vflag)
     switch (cdeamVersion) {
 
     case 1:
-  
+
       if (evflag) {
-	if (eflag) {
-	  if (force->newton_pair) eval<1,1,1,1>(ifrom, ito, thr);
-	  else eval<1,1,0,1>(ifrom, ito, thr);
-	} else {
-	  if (force->newton_pair) eval<1,0,1,1>(ifrom, ito, thr);
-	  else eval<1,0,0,1>(ifrom, ito, thr);
-	}
+        if (eflag) {
+          if (force->newton_pair) eval<1,1,1,1>(ifrom, ito, thr);
+          else eval<1,1,0,1>(ifrom, ito, thr);
+        } else {
+          if (force->newton_pair) eval<1,0,1,1>(ifrom, ito, thr);
+          else eval<1,0,0,1>(ifrom, ito, thr);
+        }
       } else {
-	if (force->newton_pair) eval<0,0,1,1>(ifrom, ito, thr);
-	else eval<0,0,0,1>(ifrom, ito, thr);
+        if (force->newton_pair) eval<0,0,1,1>(ifrom, ito, thr);
+        else eval<0,0,0,1>(ifrom, ito, thr);
       }
       break;
 
     case 2:
 
       if (evflag) {
-	if (eflag) {
-	  if (force->newton_pair) eval<1,1,1,2>(ifrom, ito, thr);
-	  else eval<1,1,0,2>(ifrom, ito, thr);
-	} else {
-	  if (force->newton_pair) eval<1,0,1,2>(ifrom, ito, thr);
-	  else eval<1,0,0,2>(ifrom, ito, thr);
-	}
+        if (eflag) {
+          if (force->newton_pair) eval<1,1,1,2>(ifrom, ito, thr);
+          else eval<1,1,0,2>(ifrom, ito, thr);
+        } else {
+          if (force->newton_pair) eval<1,0,1,2>(ifrom, ito, thr);
+          else eval<1,0,0,2>(ifrom, ito, thr);
+        }
       } else {
-	if (force->newton_pair) eval<0,0,1,2>(ifrom, ito, thr);
-	else eval<0,0,0,2>(ifrom, ito, thr);
+        if (force->newton_pair) eval<0,0,1,2>(ifrom, ito, thr);
+        else eval<0,0,0,2>(ifrom, ito, thr);
       }
       break;
 
@@ -133,7 +133,7 @@ void PairCDEAMOMP::compute(int eflag, int vflag)
 #endif
     error->all(FLERR,"unsupported eam/cd pair style variant");
     }
-    
+
     reduce_thr(this, eflag, vflag, thr);
   } // end of omp parallel region
 }
@@ -191,31 +191,31 @@ void PairCDEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if(rsq < cutforcesq) {
-	jtype = type[j];
-	double r = sqrt(rsq);
-	const EAMTableIndex index = radiusToTableIndex(r);
-	double localrho = RhoOfR(index, jtype, itype);
-	rho_t[i] += localrho;
-	if(jtype == speciesB) rhoB_t[i] += localrho;
-	if(NEWTON_PAIR || j < nlocal) {
-	  localrho = RhoOfR(index, itype, jtype);
-	  rho_t[j] += localrho;
-	  if(itype == speciesB) rhoB_t[j] += localrho;
-	}
-
-	if(CDEAMVERSION == 1 && itype != jtype) {
-	  // Note: if the i-j interaction is not concentration dependent (because either
-	  // i or j are not species A or B) then its contribution to D_i and D_j should
-	  // be ignored.
-	  // This if-clause is only required for a ternary.
-	  if((itype == speciesA && jtype == speciesB) 
-	     || (jtype == speciesA && itype == speciesB)) {
-	    double Phi_AB = PhiOfR(index, itype, jtype, 1.0 / r);
-	    D_values_t[i] += Phi_AB;
-	    if(NEWTON_PAIR || j < nlocal)
-	      D_values_t[j] += Phi_AB;
-	  }
-	}
+        jtype = type[j];
+        double r = sqrt(rsq);
+        const EAMTableIndex index = radiusToTableIndex(r);
+        double localrho = RhoOfR(index, jtype, itype);
+        rho_t[i] += localrho;
+        if(jtype == speciesB) rhoB_t[i] += localrho;
+        if(NEWTON_PAIR || j < nlocal) {
+          localrho = RhoOfR(index, itype, jtype);
+          rho_t[j] += localrho;
+          if(itype == speciesB) rhoB_t[j] += localrho;
+        }
+
+        if(CDEAMVERSION == 1 && itype != jtype) {
+          // Note: if the i-j interaction is not concentration dependent (because either
+          // i or j are not species A or B) then its contribution to D_i and D_j should
+          // be ignored.
+          // This if-clause is only required for a ternary.
+          if((itype == speciesA && jtype == speciesB)
+             || (jtype == speciesA && itype == speciesB)) {
+            double Phi_AB = PhiOfR(index, itype, jtype, 1.0 / r);
+            D_values_t[i] += Phi_AB;
+            if(NEWTON_PAIR || j < nlocal)
+              D_values_t[j] += Phi_AB;
+          }
+        }
       }
     }
   }
@@ -243,7 +243,7 @@ void PairCDEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
 
     // wait until master thread is done with communication
     sync_threads();
-  
+
   } else {
     // reduce per thread density
     data_reduce_thr(rho, nlocal, nthreads, 1, tid);
@@ -254,7 +254,7 @@ void PairCDEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
     // wait until reduction is complete
     sync_threads();
   }
-  
+
   // fp = derivative of embedding energy at each atom
   // phi = embedding energy at each atom
 
@@ -288,8 +288,8 @@ void PairCDEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
   // if the electron density is exactly zero. That's why the following lines have been commented out.
   //
   //for(i = 0; i < nlocal + atom->nghost; i++) {
-  //	if(rho[i] == 0 && (type[i] == speciesA || type[i] == speciesB))
-  //		error->one(FLERR,"CD-EAM potential routine: Detected atom with zero electron density.");
+  //        if(rho[i] == 0 && (type[i] == speciesA || type[i] == speciesB))
+  //                error->one(FLERR,"CD-EAM potential routine: Detected atom with zero electron density.");
   //}
 
   // Stage II
@@ -309,39 +309,39 @@ void PairCDEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
       // This code line is required for ternary alloys.
       if(itype != speciesA && itype != speciesB) continue;
 
-      double x_i = rhoB[i] / rho[i];	// Concentration at atom i.
+      double x_i = rhoB[i] / rho[i];        // Concentration at atom i.
 
       for(jj = 0; jj < jnum; jj++) {
-	j = jlist[jj];
-	j &= NEIGHMASK;
-	jtype = type[j];
-	if(itype == jtype) continue;
+        j = jlist[jj];
+        j &= NEIGHMASK;
+        jtype = type[j];
+        if(itype == jtype) continue;
 
-	// This code line is required for ternary alloys.
-	if(jtype != speciesA && jtype != speciesB) continue;
+        // This code line is required for ternary alloys.
+        if(jtype != speciesA && jtype != speciesB) continue;
 
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
 
-	if(rsq < cutforcesq) {
-	  double r = sqrt(rsq);
-	  const EAMTableIndex index = radiusToTableIndex(r);
+        if(rsq < cutforcesq) {
+          double r = sqrt(rsq);
+          const EAMTableIndex index = radiusToTableIndex(r);
 
-	  // The concentration independent part of the cross pair potential.
-	  double Phi_AB = PhiOfR(index, itype, jtype, 1.0 / r);
+          // The concentration independent part of the cross pair potential.
+          double Phi_AB = PhiOfR(index, itype, jtype, 1.0 / r);
 
-	  // Average concentration of two sites
-	  double x_ij = 0.5 * (x_i + rhoB[j]/rho[j]);
+          // Average concentration of two sites
+          double x_ij = 0.5 * (x_i + rhoB[j]/rho[j]);
 
-	  // Calculate derivative of h(x_ij) polynomial function.
-	  double h_prime = evalHprime(x_ij);
+          // Calculate derivative of h(x_ij) polynomial function.
+          double h_prime = evalHprime(x_ij);
 
-	  D_values_t[i] += h_prime * Phi_AB / (2.0 * rho[i] * rho[i]);
-	  if(NEWTON_PAIR || j < nlocal)
-	    D_values_t[j] += h_prime * Phi_AB / (2.0 * rho[j] * rho[j]);
-	}
+          D_values_t[i] += h_prime * Phi_AB / (2.0 * rho[i] * rho[i]);
+          if(NEWTON_PAIR || j < nlocal)
+            D_values_t[j] += h_prime * Phi_AB / (2.0 * rho[j] * rho[j]);
+        }
       }
     }
 
@@ -355,11 +355,11 @@ void PairCDEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
 #pragma omp master
 #endif
       { communicationStage = 3;
-	comm->reverse_comm_pair(this); }
+        comm->reverse_comm_pair(this); }
 
       // wait until master thread is done with communication
       sync_threads();
-  
+
   } else {
       data_reduce_thr(D_values, nlocal, nthreads, 1, tid);
 
@@ -372,7 +372,7 @@ void PairCDEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
 #endif
     { communicationStage = 4;
       comm->forward_comm_pair(this); }
-    
+
     // wait until master thread is done with communication
     sync_threads();
   }
@@ -392,7 +392,7 @@ void PairCDEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
     jnum = numneigh[i];
 
     // Concentration at site i
-    double x_i = -1.0;		// The value -1 indicates: no concentration dependence for all interactions of atom i.
+    double x_i = -1.0;                // The value -1 indicates: no concentration dependence for all interactions of atom i.
     // It will be replaced by the concentration at site i if atom i is either A or B.
 
     double D_i, h_prime_i;
@@ -405,11 +405,11 @@ void PairCDEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
       ASSERT(x_i >= 0 && x_i<=1.0);
 
       if(CDEAMVERSION == 1) {
-	// Calculate derivative of h(x_i) polynomial function.
-	h_prime_i = evalHprime(x_i);
-	D_i = D_values[i] * h_prime_i / (2.0 * rho[i] * rho[i]);
+        // Calculate derivative of h(x_i) polynomial function.
+        h_prime_i = evalHprime(x_i);
+        D_i = D_values[i] * h_prime_i / (2.0 * rho[i] * rho[i]);
       } else if(CDEAMVERSION == 2) {
-	D_i = D_values[i];
+        D_i = D_values[i];
       } else ASSERT(false);
     }
 
@@ -423,95 +423,95 @@ void PairCDEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if(rsq < cutforcesq) {
-	jtype = type[j];
-	double r = sqrt(rsq);
-	const EAMTableIndex index = radiusToTableIndex(r);
-
-	// rhoip = derivative of (density at atom j due to atom i)
-	// rhojp = derivative of (density at atom i due to atom j)
-	// psip needs both fp[i] and fp[j] terms since r_ij appears in two
-	//   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
-	//   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
-	rhoip = RhoPrimeOfR(index, itype, jtype);
-	rhojp = RhoPrimeOfR(index, jtype, itype);
-	fpair = fp[i]*rhojp + fp[j]*rhoip;
-	recip = 1.0/r;
-
-	double x_j = -1;  // The value -1 indicates: no concentration dependence for this i-j pair
-	// because atom j is not of species A nor B.
-
-	// This code line is required for ternary alloy.
-	if(jtype == speciesA || jtype == speciesB) {
-	  ASSERT(rho[i] != 0.0);
-	  ASSERT(rho[j] != 0.0);
-
-	  // Compute local concentration at site j.
-	  x_j = rhoB[j]/rho[j];
-	  ASSERT(x_j >= 0 && x_j<=1.0);
-
-	  double D_j;
-	  if(CDEAMVERSION == 1) {
-	    // Calculate derivative of h(x_j) polynomial function.
-	    double h_prime_j = evalHprime(x_j);
-	    D_j = D_values[j] * h_prime_j / (2.0 * rho[j] * rho[j]);
-	  } else if(CDEAMVERSION == 2) {
-	    D_j = D_values[j];
-	  } else ASSERT(false);
-
-	  double t2 = -rhoB[j];
-	  if(itype == speciesB) t2 += rho[j];
-	  fpair += D_j * rhoip * t2;
-	}
-
-	// This if-clause is only required for a ternary alloy.
-	// Actually we don't need it at all because D_i should be zero anyway if
-	// atom i has no concentration dependent interactions (because it is not species A or B).
-	if(x_i != -1.0) {
-	  double t1 = -rhoB[i];
-	  if(jtype == speciesB) t1 += rho[i];
-	  fpair += D_i * rhojp * t1;
-	}
-
-	double phip;
-	double phi = PhiOfR(index, itype, jtype, recip, phip);
-	if(itype == jtype || x_i == -1.0 || x_j == -1.0) {
-	  // Case of no concentration dependence.
-	  fpair += phip;
-	} else {
-	  // We have a concentration dependence for the i-j interaction.
-	  double h;
-	  if(CDEAMVERSION == 1) {
-	    // Calculate h(x_i) polynomial function.
-	    double h_i = evalH(x_i);
-	    // Calculate h(x_j) polynomial function.
-	    double h_j = evalH(x_j);
-	    h = 0.5 * (h_i + h_j);
-	  } else if(CDEAMVERSION == 2) {
-	    // Average concentration.
-	    double x_ij = 0.5 * (x_i + x_j);
-	    // Calculate h(x_ij) polynomial function.
-	    h = evalH(x_ij);
-	  } else ASSERT(false);
-
-	  fpair += h * phip;
-	  phi *= h;
-	}
-
-	// Divide by r_ij and negate to get forces from gradient.
-	fpair /= -r;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if(NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if(EFLAG) evdwl = phi;
-	if(EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,evdwl,0.0,
-				fpair,delx,dely,delz,thr);
+        jtype = type[j];
+        double r = sqrt(rsq);
+        const EAMTableIndex index = radiusToTableIndex(r);
+
+        // rhoip = derivative of (density at atom j due to atom i)
+        // rhojp = derivative of (density at atom i due to atom j)
+        // psip needs both fp[i] and fp[j] terms since r_ij appears in two
+        //   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
+        //   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
+        rhoip = RhoPrimeOfR(index, itype, jtype);
+        rhojp = RhoPrimeOfR(index, jtype, itype);
+        fpair = fp[i]*rhojp + fp[j]*rhoip;
+        recip = 1.0/r;
+
+        double x_j = -1;  // The value -1 indicates: no concentration dependence for this i-j pair
+        // because atom j is not of species A nor B.
+
+        // This code line is required for ternary alloy.
+        if(jtype == speciesA || jtype == speciesB) {
+          ASSERT(rho[i] != 0.0);
+          ASSERT(rho[j] != 0.0);
+
+          // Compute local concentration at site j.
+          x_j = rhoB[j]/rho[j];
+          ASSERT(x_j >= 0 && x_j<=1.0);
+
+          double D_j;
+          if(CDEAMVERSION == 1) {
+            // Calculate derivative of h(x_j) polynomial function.
+            double h_prime_j = evalHprime(x_j);
+            D_j = D_values[j] * h_prime_j / (2.0 * rho[j] * rho[j]);
+          } else if(CDEAMVERSION == 2) {
+            D_j = D_values[j];
+          } else ASSERT(false);
+
+          double t2 = -rhoB[j];
+          if(itype == speciesB) t2 += rho[j];
+          fpair += D_j * rhoip * t2;
+        }
+
+        // This if-clause is only required for a ternary alloy.
+        // Actually we don't need it at all because D_i should be zero anyway if
+        // atom i has no concentration dependent interactions (because it is not species A or B).
+        if(x_i != -1.0) {
+          double t1 = -rhoB[i];
+          if(jtype == speciesB) t1 += rho[i];
+          fpair += D_i * rhojp * t1;
+        }
+
+        double phip;
+        double phi = PhiOfR(index, itype, jtype, recip, phip);
+        if(itype == jtype || x_i == -1.0 || x_j == -1.0) {
+          // Case of no concentration dependence.
+          fpair += phip;
+        } else {
+          // We have a concentration dependence for the i-j interaction.
+          double h;
+          if(CDEAMVERSION == 1) {
+            // Calculate h(x_i) polynomial function.
+            double h_i = evalH(x_i);
+            // Calculate h(x_j) polynomial function.
+            double h_j = evalH(x_j);
+            h = 0.5 * (h_i + h_j);
+          } else if(CDEAMVERSION == 2) {
+            // Average concentration.
+            double x_ij = 0.5 * (x_i + x_j);
+            // Calculate h(x_ij) polynomial function.
+            h = evalH(x_ij);
+          } else ASSERT(false);
+
+          fpair += h * phip;
+          phi *= h;
+        }
+
+        // Divide by r_ij and negate to get forces from gradient.
+        fpair /= -r;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if(NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if(EFLAG) evdwl = phi;
+        if(EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,evdwl,0.0,
+                                fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_cdeam_omp.h b/src/USER-OMP/pair_cdeam_omp.h
index 46f460f8fa..2839ab0ed0 100644
--- a/src/USER-OMP/pair_cdeam_omp.h
+++ b/src/USER-OMP/pair_cdeam_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,7 +50,7 @@ class PairCDEAMOMP : public PairCDEAM, public ThrOMP {
     /// Constructor.
     PairCDEAM_OneSiteOMP(class LAMMPS* lmp) : PairEAM(lmp), PairCDEAMOMP(lmp, 1) {}
   };
-  
+
   /// The two-site concentration formulation of CD-EAM.
   class PairCDEAM_TwoSiteOMP : public PairCDEAMOMP
   {
diff --git a/src/USER-OMP/pair_colloid_omp.cpp b/src/USER-OMP/pair_colloid_omp.cpp
index 8032984365..e2f5c56d99 100644
--- a/src/USER-OMP/pair_colloid_omp.cpp
+++ b/src/USER-OMP/pair_colloid_omp.cpp
@@ -57,11 +57,11 @@ void PairColloidOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -120,94 +120,94 @@ void PairColloidOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq >= cutsq[itype][jtype]) continue;
-      
+
       switch(form[itype][jtype]) {
       case SMALL_SMALL:
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-	if (EFLAG) 
-	  evdwl = r6inv*(r6inv*lj3[itype][jtype]-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	break;
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+        if (EFLAG)
+          evdwl = r6inv*(r6inv*lj3[itype][jtype]-lj4[itype][jtype]) -
+            offset[itype][jtype];
+        break;
 
       case SMALL_LARGE:
-	c2 = a2[itype][jtype];
-	K[1] = c2*c2;
-	K[2] = rsq;
-	K[0] = K[1] - rsq;
-	K[4] = rsq*rsq;
-	K[3] = K[1] - K[2];
-	K[3] *= K[3]*K[3];
-	K[6] = K[3]*K[3];
-	fR = sigma3[itype][jtype]*a12[itype][jtype]*c2*K[1]/K[3];
-	fpair = 4.0/15.0*fR*factor_lj * 
-	  (2.0*(K[1]+K[2]) * (K[1]*(5.0*K[1]+22.0*K[2])+5.0*K[4]) * 
-	   sigma6[itype][jtype]/K[6]-5.0) / K[0];
-	if (EFLAG) 
-	  evdwl = 2.0/9.0*fR * 
-	    (1.0-(K[1]*(K[1]*(K[1]/3.0+3.0*K[2])+4.2*K[4])+K[2]*K[4]) *
-	     sigma6[itype][jtype]/K[6]) - offset[itype][jtype];
-
-	if (check_error_thr((rsq <= K[1]),tid,FLERR,
-			    "Overlapping small/large in pair colloid"))
-	  return;
-
-	break;
+        c2 = a2[itype][jtype];
+        K[1] = c2*c2;
+        K[2] = rsq;
+        K[0] = K[1] - rsq;
+        K[4] = rsq*rsq;
+        K[3] = K[1] - K[2];
+        K[3] *= K[3]*K[3];
+        K[6] = K[3]*K[3];
+        fR = sigma3[itype][jtype]*a12[itype][jtype]*c2*K[1]/K[3];
+        fpair = 4.0/15.0*fR*factor_lj *
+          (2.0*(K[1]+K[2]) * (K[1]*(5.0*K[1]+22.0*K[2])+5.0*K[4]) *
+           sigma6[itype][jtype]/K[6]-5.0) / K[0];
+        if (EFLAG)
+          evdwl = 2.0/9.0*fR *
+            (1.0-(K[1]*(K[1]*(K[1]/3.0+3.0*K[2])+4.2*K[4])+K[2]*K[4]) *
+             sigma6[itype][jtype]/K[6]) - offset[itype][jtype];
+
+        if (check_error_thr((rsq <= K[1]),tid,FLERR,
+                            "Overlapping small/large in pair colloid"))
+          return;
+
+        break;
 
       case LARGE_LARGE:
-	r = sqrt(rsq);
-	c1 = a1[itype][jtype];
-	c2 = a2[itype][jtype];
-	K[0] = c1*c2;
-	K[1] = c1+c2;
-	K[2] = c1-c2;
-	K[3] = K[1]+r;
-	K[4] = K[1]-r;
-	K[5] = K[2]+r;
-	K[6] = K[2]-r;
-	K[7] = 1.0/(K[3]*K[4]);
-	K[8] = 1.0/(K[5]*K[6]);
-	g[0] = pow(K[3],-7.0);
-	g[1] = pow(K[4],-7.0);
-	g[2] = pow(K[5],-7.0);
-	g[3] = pow(K[6],-7.0);
-	h[0] = ((K[3]+5.0*K[1])*K[3]+30.0*K[0])*g[0];
-	h[1] = ((K[4]+5.0*K[1])*K[4]+30.0*K[0])*g[1];
-	h[2] = ((K[5]+5.0*K[2])*K[5]-30.0*K[0])*g[2];
-	h[3] = ((K[6]+5.0*K[2])*K[6]-30.0*K[0])*g[3];
-	g[0] *= 42.0*K[0]/K[3]+6.0*K[1]+K[3];
-	g[1] *= 42.0*K[0]/K[4]+6.0*K[1]+K[4];
-	g[2] *= -42.0*K[0]/K[5]+6.0*K[2]+K[5];
-	g[3] *= -42.0*K[0]/K[6]+6.0*K[2]+K[6];
-	
-	fR = a12[itype][jtype]*sigma6[itype][jtype]/r/37800.0;
-	evdwl = fR * (h[0]-h[1]-h[2]+h[3]);
-	dUR = evdwl/r + 5.0*fR*(g[0]+g[1]-g[2]-g[3]);
-	dUA = -a12[itype][jtype]/3.0*r*((2.0*K[0]*K[7]+1.0)*K[7] + 
-					(2.0*K[0]*K[8]-1.0)*K[8]);
-	fpair = factor_lj * (dUR+dUA)/r;
-	if (EFLAG)
-	  evdwl += a12[itype][jtype]/6.0 * 
-	    (2.0*K[0]*(K[7]+K[8])-log(K[8]/K[7])) - offset[itype][jtype];
-	if (r <= K[1]) error->one(FLERR,"Overlapping large/large in pair colloid");
-	break;
+        r = sqrt(rsq);
+        c1 = a1[itype][jtype];
+        c2 = a2[itype][jtype];
+        K[0] = c1*c2;
+        K[1] = c1+c2;
+        K[2] = c1-c2;
+        K[3] = K[1]+r;
+        K[4] = K[1]-r;
+        K[5] = K[2]+r;
+        K[6] = K[2]-r;
+        K[7] = 1.0/(K[3]*K[4]);
+        K[8] = 1.0/(K[5]*K[6]);
+        g[0] = pow(K[3],-7.0);
+        g[1] = pow(K[4],-7.0);
+        g[2] = pow(K[5],-7.0);
+        g[3] = pow(K[6],-7.0);
+        h[0] = ((K[3]+5.0*K[1])*K[3]+30.0*K[0])*g[0];
+        h[1] = ((K[4]+5.0*K[1])*K[4]+30.0*K[0])*g[1];
+        h[2] = ((K[5]+5.0*K[2])*K[5]-30.0*K[0])*g[2];
+        h[3] = ((K[6]+5.0*K[2])*K[6]-30.0*K[0])*g[3];
+        g[0] *= 42.0*K[0]/K[3]+6.0*K[1]+K[3];
+        g[1] *= 42.0*K[0]/K[4]+6.0*K[1]+K[4];
+        g[2] *= -42.0*K[0]/K[5]+6.0*K[2]+K[5];
+        g[3] *= -42.0*K[0]/K[6]+6.0*K[2]+K[6];
+
+        fR = a12[itype][jtype]*sigma6[itype][jtype]/r/37800.0;
+        evdwl = fR * (h[0]-h[1]-h[2]+h[3]);
+        dUR = evdwl/r + 5.0*fR*(g[0]+g[1]-g[2]-g[3]);
+        dUA = -a12[itype][jtype]/3.0*r*((2.0*K[0]*K[7]+1.0)*K[7] +
+                                        (2.0*K[0]*K[8]-1.0)*K[8]);
+        fpair = factor_lj * (dUR+dUA)/r;
+        if (EFLAG)
+          evdwl += a12[itype][jtype]/6.0 *
+            (2.0*K[0]*(K[7]+K[8])-log(K[8]/K[7])) - offset[itype][jtype];
+        if (r <= K[1]) error->one(FLERR,"Overlapping large/large in pair colloid");
+        break;
       }
-      
+
       if (EFLAG) evdwl *= factor_lj;
-    
+
       fxtmp += delx*fpair;
       fytmp += dely*fpair;
       fztmp += delz*fpair;
       if (NEWTON_PAIR || j < nlocal) {
-	f[j][0] -= delx*fpair;
-	f[j][1] -= dely*fpair;
-	f[j][2] -= delz*fpair;
+        f[j][0] -= delx*fpair;
+        f[j][1] -= dely*fpair;
+        f[j][2] -= delz*fpair;
       }
 
       if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-			       evdwl,0.0,fpair,delx,dely,delz,thr);
+                               evdwl,0.0,fpair,delx,dely,delz,thr);
     }
     f[i][0] += fxtmp;
     f[i][1] += fytmp;
diff --git a/src/USER-OMP/pair_colloid_omp.h b/src/USER-OMP/pair_colloid_omp.h
index cde7e9b650..6605fbce00 100644
--- a/src/USER-OMP/pair_colloid_omp.h
+++ b/src/USER-OMP/pair_colloid_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_comb_omp.cpp b/src/USER-OMP/pair_comb_omp.cpp
index c44bd4027b..eea2c6b610 100644
--- a/src/USER-OMP/pair_comb_omp.cpp
+++ b/src/USER-OMP/pair_comb_omp.cpp
@@ -64,11 +64,11 @@ void PairCombOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (vflag_atom) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (vflag_atom) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (vflag_atom) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (vflag_atom) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else eval<0,0,0>(ifrom, ito, thr);
 
@@ -89,7 +89,7 @@ void PairCombOMP::eval(int iifrom, int iito, ThrData * const thr)
   int mr1,mr2,mr3;
   int rsc,inty;
   double elp_ij,filp[3],fjlp[3],fklp[3];
-  double iq,jq; 
+  double iq,jq;
   double yaself;
   double potal,fac11,fac11e;
   double vionij,fvionij,sr1,sr2,sr3,Eov,Fov;
@@ -108,7 +108,7 @@ void PairCombOMP::eval(int iifrom, int iito, ThrData * const thr)
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
 
-  yaself = vionij = fvionij = Eov = Fov = 0.0; 
+  yaself = vionij = fvionij = Eov = Fov = 0.0;
 
   double fxtmp,fytmp,fztmp;
   double fjxtmp,fjytmp,fjztmp;
@@ -139,7 +139,7 @@ void PairCombOMP::eval(int iifrom, int iito, ThrData * const thr)
     yaself = self(&params[iparam_i],iq,potal);
 
     if (EVFLAG) ev_tally_thr(this,i,i,nlocal,0,yaself,
-			     0.0,0.0,0.0,0.0,0.0,thr);
+                             0.0,0.0,0.0,0.0,0.0,thr);
 
     // two-body interactions (long and short repulsive)
 
@@ -154,16 +154,16 @@ void PairCombOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtag = tag[j];
 
       if (itag > jtag) {
-	if ((itag+jtag) % 2 == 0) continue;
+        if ((itag+jtag) % 2 == 0) continue;
       } else if (itag < jtag) {
-	if ((itag+jtag) % 2 == 1) continue;
+        if ((itag+jtag) % 2 == 1) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
-	if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
+        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
       }
 
-      // Qj calculates 2-body Coulombic 
+      // Qj calculates 2-body Coulombic
 
       jtype = map[type[j]];
       jq = q[j];
@@ -188,7 +188,7 @@ void PairCombOMP::eval(int iifrom, int iito, ThrData * const thr)
       // 1/r energy and forces
 
       direct(inty,mr1,mr2,mr3,rsq,sr1,sr2,sr3,iq,jq,
-	     potal,fac11,fac11e,vionij,fvionij);
+             potal,fac11,fac11e,vionij,fvionij);
 
       // field correction to self energy
 
@@ -204,9 +204,9 @@ void PairCombOMP::eval(int iifrom, int iito, ThrData * const thr)
       f[j][1] -= dely*fvionij;
       f[j][2] -= delz*fvionij;
 
-      if (EVFLAG) 
-	ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,
-		     0.0,vionij,fvionij,delx,dely,delz,thr);
+      if (EVFLAG)
+        ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,
+                     0.0,vionij,fvionij,delx,dely,delz,thr);
 
       // short range q-independent
 
@@ -224,8 +224,8 @@ void PairCombOMP::eval(int iifrom, int iito, ThrData * const thr)
       f[j][2] -= delz*fpair;
 
       if (EVFLAG)
-	ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,
-		     evdwl,0.0,fpair,delx,dely,delz,thr);
+        ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,
+                     evdwl,0.0,fpair,delx,dely,delz,thr);
     }
 
     // accumulate coordination number information
@@ -234,23 +234,23 @@ void PairCombOMP::eval(int iifrom, int iito, ThrData * const thr)
       int numcoor = 0;
       for (jj = 0; jj < sht_jnum; jj++) {
         j = sht_jlist[jj];
-	jtype = map[type[j]];
-	iparam_ij = elem2param[itype][jtype][jtype];
-	
-	if(params[iparam_ij].hfocor > 0.0 ) {
-	  delr1[0] = x[j][0] - xtmp;
-	  delr1[1] = x[j][1] - ytmp;
-	  delr1[2] = x[j][2] - ztmp;
-	  rsq1 = vec3_dot(delr1,delr1);
-	  
-	  if (rsq1 > params[iparam_ij].cutsq) continue;
-	  ++numcoor;
-	}
+        jtype = map[type[j]];
+        iparam_ij = elem2param[itype][jtype][jtype];
+
+        if(params[iparam_ij].hfocor > 0.0 ) {
+          delr1[0] = x[j][0] - xtmp;
+          delr1[1] = x[j][1] - ytmp;
+          delr1[2] = x[j][2] - ztmp;
+          rsq1 = vec3_dot(delr1,delr1);
+
+          if (rsq1 > params[iparam_ij].cutsq) continue;
+          ++numcoor;
+        }
       }
-      NCo[i] = numcoor; 
+      NCo[i] = numcoor;
     }
 
-    // three-body interactions 
+    // three-body interactions
     // half i-j loop
 
     for (jj = 0; jj < sht_jnum; jj++) {
@@ -278,34 +278,34 @@ void PairCombOMP::eval(int iifrom, int iito, ThrData * const thr)
       cuo_flag1 = 0; cuo_flag2 = 0;
 
       for (kk = 0; kk < sht_jnum; kk++) {
-	k = sht_jlist[kk];
-	if (j == k) continue;
-	ktype = map[type[k]];
-	iparam_ijk = elem2param[itype][jtype][ktype];
+        k = sht_jlist[kk];
+        if (j == k) continue;
+        ktype = map[type[k]];
+        iparam_ijk = elem2param[itype][jtype][ktype];
 
-	delr2[0] = x[k][0] - xtmp;
-	delr2[1] = x[k][1] - ytmp;
-	delr2[2] = x[k][2] - ztmp;
-	rsq2 = vec3_dot(delr2,delr2);
+        delr2[0] = x[k][0] - xtmp;
+        delr2[1] = x[k][1] - ytmp;
+        delr2[2] = x[k][2] - ztmp;
+        rsq2 = vec3_dot(delr2,delr2);
 
-	if (rsq2 > params[iparam_ijk].cutsq) continue;
+        if (rsq2 > params[iparam_ijk].cutsq) continue;
 
-	zeta_ij += zeta(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
+        zeta_ij += zeta(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
 
-	if (params[iparam_ijk].hfocor == -2.0) cuo_flag1 = 1;
-	if (params[iparam_ijk].hfocor == -1.0) cuo_flag2 = 1;
+        if (params[iparam_ijk].hfocor == -2.0) cuo_flag1 = 1;
+        if (params[iparam_ijk].hfocor == -1.0) cuo_flag2 = 1;
       }
 
       if (cuo_flag1 && cuo_flag2) cuo_flag = 1;
       else cuo_flag = 0;
 
       force_zeta(&params[iparam_ij],EFLAG,i,nj,rsq1,zeta_ij,
-		 iq,jq,fpair,prefactor,evdwl);
+                 iq,jq,fpair,prefactor,evdwl);
 
       // over-coordination correction for HfO2
 
       if (cor_flag && NCo[i] != 0)
-	Over_cor(&params[iparam_ij],rsq1,NCo[i],Eov, Fov);
+        Over_cor(&params[iparam_ij],rsq1,NCo[i],Eov, Fov);
       evdwl +=  Eov;
       fpair +=  Fov;
 
@@ -317,47 +317,47 @@ void PairCombOMP::eval(int iifrom, int iito, ThrData * const thr)
       fjztmp -= delr1[2]*fpair;
 
       if (EVFLAG) ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,evdwl,0.0,
-			       -fpair,-delr1[0],-delr1[1],-delr1[2],thr);
+                               -fpair,-delr1[0],-delr1[1],-delr1[2],thr);
 
       // attractive term via loop over k (3-body forces)
 
       for (kk = 0; kk < sht_jnum; kk++) {
-	k = sht_jlist[kk];
-	if (j == k) continue;
-	ktype = map[type[k]];
-	iparam_ijk = elem2param[itype][jtype][ktype];
-
-	delr2[0] = x[k][0] - xtmp;
-	delr2[1] = x[k][1] - ytmp;
-	delr2[2] = x[k][2] - ztmp;
-	rsq2 = vec3_dot(delr2,delr2);
-	if (rsq2 > params[iparam_ijk].cutsq) continue;
-
-	for (rsc = 0; rsc < 3; rsc++)
-	  fi[rsc] = fj[rsc] = fk[rsc] = 0.0;
-
-	attractive(&params[iparam_ijk],prefactor,
-		   rsq1,rsq2,delr1,delr2,fi,fj,fk);
-
-	// 3-body LP and BB correction and forces
-
-	elp_ij = elp(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
-	flp(&params[iparam_ijk],rsq1,rsq2,delr1,delr2,filp,fjlp,fklp); 
-
-	fxtmp += fi[0] + filp[0];
-	fytmp += fi[1] + filp[1];
-	fztmp += fi[2] + filp[2];
-	fjxtmp += fj[0] + fjlp[0];
-	fjytmp += fj[1] + fjlp[1];
-	fjztmp += fj[2] + fjlp[2];
-	f[k][0] += fk[0] + fklp[0];
-	f[k][1] += fk[1] + fklp[1];
-	f[k][2] += fk[2] + fklp[2];
-
-        if (EVFLAG) 
-	  ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,
-		       elp_ij,0.0,0.0,0.0,0.0,0.0, thr);
-	if (VFLAG_ATOM) v_tally3_thr(i,j,k,fj,fk,delr1,delr2,thr);
+        k = sht_jlist[kk];
+        if (j == k) continue;
+        ktype = map[type[k]];
+        iparam_ijk = elem2param[itype][jtype][ktype];
+
+        delr2[0] = x[k][0] - xtmp;
+        delr2[1] = x[k][1] - ytmp;
+        delr2[2] = x[k][2] - ztmp;
+        rsq2 = vec3_dot(delr2,delr2);
+        if (rsq2 > params[iparam_ijk].cutsq) continue;
+
+        for (rsc = 0; rsc < 3; rsc++)
+          fi[rsc] = fj[rsc] = fk[rsc] = 0.0;
+
+        attractive(&params[iparam_ijk],prefactor,
+                   rsq1,rsq2,delr1,delr2,fi,fj,fk);
+
+        // 3-body LP and BB correction and forces
+
+        elp_ij = elp(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
+        flp(&params[iparam_ijk],rsq1,rsq2,delr1,delr2,filp,fjlp,fklp);
+
+        fxtmp += fi[0] + filp[0];
+        fytmp += fi[1] + filp[1];
+        fztmp += fi[2] + filp[2];
+        fjxtmp += fj[0] + fjlp[0];
+        fjytmp += fj[1] + fjlp[1];
+        fjztmp += fj[2] + fjlp[2];
+        f[k][0] += fk[0] + fklp[0];
+        f[k][1] += fk[1] + fklp[1];
+        f[k][2] += fk[2] + fklp[2];
+
+        if (EVFLAG)
+          ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,
+                       elp_ij,0.0,0.0,0.0,0.0,0.0, thr);
+        if (VFLAG_ATOM) v_tally3_thr(i,j,k,fj,fk,delr1,delr2,thr);
       }
       f[j][0] += fjxtmp;
       f[j][1] += fjytmp;
@@ -440,7 +440,7 @@ double PairCombOMP::yasu_char(double *qf_fix, int &igroup)
 
       for (int jj = 0; jj < jnum; jj++) {
         const int j = jlist[jj] & NEIGHMASK;
-	const int jtag = tag[j];	
+        const int jtag = tag[j];
 
         if (itag > jtag) {
           if ((itag+jtag) % 2 == 0) continue;
@@ -450,7 +450,7 @@ double PairCombOMP::yasu_char(double *qf_fix, int &igroup)
           if (x[j][2] < ytmp) continue;
           if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
           if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
-        } 
+        }
 
         const int jtype = map[type[j]];
         double jq = q[j];
@@ -485,32 +485,32 @@ double PairCombOMP::yasu_char(double *qf_fix, int &igroup)
 #endif
         qf[j] += (iq * fqij + fqjj);
       }
-      
+
         // three-body interactions
-	
+
       for (int jj = 0; jj < jnum; jj++) {
-	const int j = jlist[jj] & NEIGHMASK;
-	const int jtype = map[type[j]];
-	const double jq = q[j];
+        const int j = jlist[jj] & NEIGHMASK;
+        const int jtype = map[type[j]];
+        const double jq = q[j];
 
-	delr1[0] = x[j][0] - xtmp;
-	delr1[1] = x[j][1] - ytmp;
-	delr1[2] = x[j][2] - ztmp;
-	double rsq1 = vec3_dot(delr1,delr1);
+        delr1[0] = x[j][0] - xtmp;
+        delr1[1] = x[j][1] - ytmp;
+        delr1[2] = x[j][2] - ztmp;
+        double rsq1 = vec3_dot(delr1,delr1);
 
         const int iparam_ij = elem2param[itype][jtype][jtype];
 
         if (rsq1 > params[iparam_ij].cutsq) continue;
-	nj ++;
+        nj ++;
 
         // charge force in Aij and Bij
 
         qfo_short(&params[iparam_ij],i,nj,rsq1,iq,jq,fqij,fqjj);
-        fqi += fqij;  
+        fqi += fqij;
 #if defined(_OPENMP)
 #pragma omp atomic
 #endif
-	qf[j] += fqjj;
+        qf[j] += fqjj;
       }
 
 #if defined(_OPENMP)
@@ -553,7 +553,7 @@ void PairCombOMP::Short_neigh_thr()
     nmax = atom->nmax;
     memory->sfree(sht_first);
     sht_first = (int **) memory->smalloc(nmax*sizeof(int *),
-	    "pair:sht_first");
+            "pair:sht_first");
     memory->grow(sht_num,nmax,"pair:sht_num");
     memory->grow(NCo,nmax,"pair:NCo");
     memory->grow(bbij,nmax,nmax,"pair:bbij");
@@ -596,42 +596,42 @@ void PairCombOMP::Short_neigh_thr()
 
     if (iifrom < inum) {
       for (ii = iifrom; ii < iito; ii++) {
-	i = ilist[ii];
+        i = ilist[ii];
 
 #if defined(_OPENMP)
 #pragma omp critical
 #endif
-	if(pgsize - npntj < oneatom) {
-	  npntj = 0;
-	  npage += nthreads;
-	  if (npage >= maxpage) add_pages(nthreads);
-	}
- 
-	neighptrj = &pages[npage][npntj];
-	nj = 0;
-
-	xtmp = x[i][0];
-	ytmp = x[i][1];
-	ztmp = x[i][2];
-
-	jlist = firstneigh[i];
-	jnum = numneigh[i];
-
-	for (jj = 0; jj < jnum; jj++) {
-	  j = jlist[jj];
-	  j &= NEIGHMASK;
-
-	  delrj[0] = xtmp - x[j][0];
-	  delrj[1] = ytmp - x[j][1];
-	  delrj[2] = ztmp - x[j][2];
-	  rsq = vec3_dot(delrj,delrj);
-      
-	  if (rsq > cutmin) continue;
-	  neighptrj[nj++] = j;
-	}
-	sht_first[i] = neighptrj;
-	sht_num[i] = nj;
-	npntj += nj;
+        if(pgsize - npntj < oneatom) {
+          npntj = 0;
+          npage += nthreads;
+          if (npage >= maxpage) add_pages(nthreads);
+        }
+
+        neighptrj = &pages[npage][npntj];
+        nj = 0;
+
+        xtmp = x[i][0];
+        ytmp = x[i][1];
+        ztmp = x[i][2];
+
+        jlist = firstneigh[i];
+        jnum = numneigh[i];
+
+        for (jj = 0; jj < jnum; jj++) {
+          j = jlist[jj];
+          j &= NEIGHMASK;
+
+          delrj[0] = xtmp - x[j][0];
+          delrj[1] = ytmp - x[j][1];
+          delrj[2] = ztmp - x[j][2];
+          rsq = vec3_dot(delrj,delrj);
+
+          if (rsq > cutmin) continue;
+          neighptrj[nj++] = j;
+        }
+        sht_first[i] = neighptrj;
+        sht_num[i] = nj;
+        npntj += nj;
       }
     }
   }
diff --git a/src/USER-OMP/pair_coul_cut_omp.cpp b/src/USER-OMP/pair_coul_cut_omp.cpp
index e485efdb3c..37b311f93e 100644
--- a/src/USER-OMP/pair_coul_cut_omp.cpp
+++ b/src/USER-OMP/pair_coul_cut_omp.cpp
@@ -56,11 +56,11 @@ void PairCoulCutOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -122,25 +122,25 @@ void PairCoulCutOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	rinv = sqrt(r2inv);
-	forcecoul = qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
-	fpair = factor_coul*forcecoul * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG)
-	  ecoul = factor_coul * qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 0.0,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        rinv = sqrt(r2inv);
+        forcecoul = qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
+        fpair = factor_coul*forcecoul * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG)
+          ecoul = factor_coul * qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 0.0,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_coul_cut_omp.h b/src/USER-OMP/pair_coul_cut_omp.h
index 3499ee4ae6..9e5fe81197 100644
--- a/src/USER-OMP/pair_coul_cut_omp.h
+++ b/src/USER-OMP/pair_coul_cut_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_coul_debye_omp.cpp b/src/USER-OMP/pair_coul_debye_omp.cpp
index 580b85087e..4c8aaba007 100644
--- a/src/USER-OMP/pair_coul_debye_omp.cpp
+++ b/src/USER-OMP/pair_coul_debye_omp.cpp
@@ -56,11 +56,11 @@ void PairCoulDebyeOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -122,27 +122,27 @@ void PairCoulDebyeOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	screening = exp(-kappa*r);
-	forcecoul = qqrd2e * qtmp*q[j] * screening * (kappa + rinv);
-	fpair = factor_coul*forcecoul * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG)
-	  ecoul = factor_coul * qqrd2e * qtmp*q[j] * rinv * screening;
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 0.0,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        screening = exp(-kappa*r);
+        forcecoul = qqrd2e * qtmp*q[j] * screening * (kappa + rinv);
+        fpair = factor_coul*forcecoul * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG)
+          ecoul = factor_coul * qqrd2e * qtmp*q[j] * rinv * screening;
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 0.0,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_coul_debye_omp.h b/src/USER-OMP/pair_coul_debye_omp.h
index f016de8b5d..dc08647553 100644
--- a/src/USER-OMP/pair_coul_debye_omp.h
+++ b/src/USER-OMP/pair_coul_debye_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_coul_diel_omp.cpp b/src/USER-OMP/pair_coul_diel_omp.cpp
index 29d83b3876..c583800004 100644
--- a/src/USER-OMP/pair_coul_diel_omp.cpp
+++ b/src/USER-OMP/pair_coul_diel_omp.cpp
@@ -56,11 +56,11 @@ void PairCoulDielOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -123,31 +123,31 @@ void PairCoulDielOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	rarg = (r-rme[itype][jtype])/sigmae[itype][jtype];
-	th=tanh(rarg);
-	epsr=a_eps+b_eps*th;
-	depsdr=b_eps * (1.0 - th*th) / sigmae[itype][jtype];
-	
-	forcecoul = qqrd2e*qtmp*q[j]*((eps_s*(epsr+r*depsdr)/epsr/epsr) -1.)/rsq;
-	fpair = factor_coul*forcecoul/r;
-	
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  ecoul = (qqrd2e*qtmp*q[j]*((eps_s/epsr) -1.)/r) - offset[itype][jtype];
-	  ecoul *= factor_coul;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 0.0,ecoul,fpair,delx,dely,delz,thr);
+        r = sqrt(rsq);
+        rarg = (r-rme[itype][jtype])/sigmae[itype][jtype];
+        th=tanh(rarg);
+        epsr=a_eps+b_eps*th;
+        depsdr=b_eps * (1.0 - th*th) / sigmae[itype][jtype];
+
+        forcecoul = qqrd2e*qtmp*q[j]*((eps_s*(epsr+r*depsdr)/epsr/epsr) -1.)/rsq;
+        fpair = factor_coul*forcecoul/r;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          ecoul = (qqrd2e*qtmp*q[j]*((eps_s/epsr) -1.)/r) - offset[itype][jtype];
+          ecoul *= factor_coul;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 0.0,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_coul_diel_omp.h b/src/USER-OMP/pair_coul_diel_omp.h
index 2dc0083ae3..68206e4c28 100644
--- a/src/USER-OMP/pair_coul_diel_omp.h
+++ b/src/USER-OMP/pair_coul_diel_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_coul_long_omp.cpp b/src/USER-OMP/pair_coul_long_omp.cpp
index 8be5e35a0f..5ae5478755 100644
--- a/src/USER-OMP/pair_coul_long_omp.cpp
+++ b/src/USER-OMP/pair_coul_long_omp.cpp
@@ -65,11 +65,11 @@ void PairCoulLongOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -133,54 +133,54 @@ void PairCoulLongOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cut_coulsq) {
-	r2inv = 1.0/rsq;
-	if (!ncoultablebits || rsq <= tabinnersq) {
-	  r = sqrt(rsq);
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * scale[itype][jtype] * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else {
-	  union_int_float_t rsq_lookup;
-	  rsq_lookup.f = rsq;
-	  itable = rsq_lookup.i & ncoulmask;
-	  itable >>= ncoulshiftbits;
-	  fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	  table = ftable[itable] + fraction*dftable[itable];
-	  forcecoul = scale[itype][jtype] * qtmp*q[j] * table;
-	  if (factor_coul < 1.0) {
-	    table = ctable[itable] + fraction*dctable[itable];
-	    prefactor = scale[itype][jtype] * qtmp*q[j] * table;
-	    forcecoul -= (1.0-factor_coul)*prefactor;
-	  }
-	}
-
-	fpair = forcecoul * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (!ncoultablebits || rsq <= tabinnersq)
-	    ecoul = prefactor*erfc;
-	  else {
-	    table = etable[itable] + fraction*detable[itable];
-	    ecoul = scale[itype][jtype] * qtmp*q[j] * table;
-	  }
-	  if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 0.0,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        if (!ncoultablebits || rsq <= tabinnersq) {
+          r = sqrt(rsq);
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * scale[itype][jtype] * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else {
+          union_int_float_t rsq_lookup;
+          rsq_lookup.f = rsq;
+          itable = rsq_lookup.i & ncoulmask;
+          itable >>= ncoulshiftbits;
+          fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+          table = ftable[itable] + fraction*dftable[itable];
+          forcecoul = scale[itype][jtype] * qtmp*q[j] * table;
+          if (factor_coul < 1.0) {
+            table = ctable[itable] + fraction*dctable[itable];
+            prefactor = scale[itype][jtype] * qtmp*q[j] * table;
+            forcecoul -= (1.0-factor_coul)*prefactor;
+          }
+        }
+
+        fpair = forcecoul * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (!ncoultablebits || rsq <= tabinnersq)
+            ecoul = prefactor*erfc;
+          else {
+            table = etable[itable] + fraction*detable[itable];
+            ecoul = scale[itype][jtype] * qtmp*q[j] * table;
+          }
+          if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 0.0,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_coul_long_omp.h b/src/USER-OMP/pair_coul_long_omp.h
index d7655637d0..d628d22b60 100644
--- a/src/USER-OMP/pair_coul_long_omp.h
+++ b/src/USER-OMP/pair_coul_long_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_coul_wolf_omp.cpp b/src/USER-OMP/pair_coul_wolf_omp.cpp
index f290d7e3da..16e0c4ed90 100644
--- a/src/USER-OMP/pair_coul_wolf_omp.cpp
+++ b/src/USER-OMP/pair_coul_wolf_omp.cpp
@@ -58,11 +58,11 @@ void PairCoulWolfOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -99,10 +99,10 @@ void PairCoulWolfOMP::eval(int iifrom, int iito, ThrData * const thr)
 
   // self and shifted coulombic energy
 
-  e_self = v_sh = 0.0; 
+  e_self = v_sh = 0.0;
   e_shift = erfc(alf*cut_coul)/cut_coul;
-  f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) / 
-    cut_coul; 
+  f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) /
+    cut_coul;
 
   ilist = list->ilist;
   numneigh = list->numneigh;
@@ -136,34 +136,34 @@ void PairCoulWolfOMP::eval(int iifrom, int iito, ThrData * const thr)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_coulsq) {
-	r = sqrt(rsq);
-	prefactor = qqrd2e*qtmp*q[j]/r;
-	erfcc = erfc(alf*r); 
-	erfcd = exp(-alf*alf*r*r);
-	v_sh = (erfcc - e_shift*r) * prefactor; 
-	dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
-	forcecoul = dvdrr*rsq*prefactor;
-	if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	fpair = forcecoul / rsq;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = v_sh;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 0.0,ecoul,fpair,delx,dely,delz,thr);
+        r = sqrt(rsq);
+        prefactor = qqrd2e*qtmp*q[j]/r;
+        erfcc = erfc(alf*r);
+        erfcd = exp(-alf*alf*r*r);
+        v_sh = (erfcc - e_shift*r) * prefactor;
+        dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
+        forcecoul = dvdrr*rsq*prefactor;
+        if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        fpair = forcecoul / rsq;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            ecoul = v_sh;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 0.0,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_coul_wolf_omp.h b/src/USER-OMP/pair_coul_wolf_omp.h
index 0b474601f2..aef683d22c 100644
--- a/src/USER-OMP/pair_coul_wolf_omp.h
+++ b/src/USER-OMP/pair_coul_wolf_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_dipole_cut_omp.cpp b/src/USER-OMP/pair_dipole_cut_omp.cpp
index 9e278b9a21..34d7e6c17e 100644
--- a/src/USER-OMP/pair_dipole_cut_omp.cpp
+++ b/src/USER-OMP/pair_dipole_cut_omp.cpp
@@ -56,11 +56,11 @@ void PairDipoleCutOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -128,142 +128,142 @@ void PairDipoleCutOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	rinv = sqrt(r2inv);
+        r2inv = 1.0/rsq;
+        rinv = sqrt(r2inv);
 
-	// atom can have both a charge and dipole
-	// i,j = charge-charge, dipole-dipole, dipole-charge, or charge-dipole
+        // atom can have both a charge and dipole
+        // i,j = charge-charge, dipole-dipole, dipole-charge, or charge-dipole
 
-	forcecoulx = forcecouly = forcecoulz = 0.0;
-	tixcoul = tiycoul = tizcoul = 0.0;
-	tjxcoul = tjycoul = tjzcoul = 0.0;
-	
-	if (rsq < cut_coulsq[itype][jtype]) {
+        forcecoulx = forcecouly = forcecoulz = 0.0;
+        tixcoul = tiycoul = tizcoul = 0.0;
+        tjxcoul = tjycoul = tjzcoul = 0.0;
 
-	  if (qtmp != 0.0 && q[j] != 0.0) {
+        if (rsq < cut_coulsq[itype][jtype]) {
+
+          if (qtmp != 0.0 && q[j] != 0.0) {
             r3inv = r2inv*rinv;
-	    pre1 = qtmp*q[j]*r3inv;
+            pre1 = qtmp*q[j]*r3inv;
 
-	    forcecoulx += pre1*delx;
-	    forcecouly += pre1*dely;
-	    forcecoulz += pre1*delz;
-	  }
+            forcecoulx += pre1*delx;
+            forcecouly += pre1*dely;
+            forcecoulz += pre1*delz;
+          }
 
-	  if (mu[i][3] > 0.0 && mu[j][3] > 0.0) { 
+          if (mu[i][3] > 0.0 && mu[j][3] > 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
-	    r7inv = r5inv*r2inv;
+            r7inv = r5inv*r2inv;
 
             pdotp = mu[i][0]*mu[j][0] + mu[i][1]*mu[j][1] + mu[i][2]*mu[j][2];
             pidotr = mu[i][0]*delx + mu[i][1]*dely + mu[i][2]*delz;
             pjdotr = mu[j][0]*delx + mu[j][1]*dely + mu[j][2]*delz;
 
-	    pre1 = 3.0*r5inv*pdotp - 15.0*r7inv*pidotr*pjdotr;
-	    pre2 = 3.0*r5inv*pjdotr;
-	    pre3 = 3.0*r5inv*pidotr;
-	    pre4 = -1.0*r3inv;
-
-	    forcecoulx += pre1*delx + pre2*mu[i][0] + pre3*mu[j][0];
-	    forcecouly += pre1*dely + pre2*mu[i][1] + pre3*mu[j][1];
-	    forcecoulz += pre1*delz + pre2*mu[i][2] + pre3*mu[j][2];
-	    
-	    crossx = pre4 * (mu[i][1]*mu[j][2] - mu[i][2]*mu[j][1]);
-	    crossy = pre4 * (mu[i][2]*mu[j][0] - mu[i][0]*mu[j][2]);
-	    crossz = pre4 * (mu[i][0]*mu[j][1] - mu[i][1]*mu[j][0]);
-
-	    tixcoul += crossx + pre2 * (mu[i][1]*delz - mu[i][2]*dely);
-	    tiycoul += crossy + pre2 * (mu[i][2]*delx - mu[i][0]*delz);
-	    tizcoul += crossz + pre2 * (mu[i][0]*dely - mu[i][1]*delx);
-	    tjxcoul += -crossx + pre3 * (mu[j][1]*delz - mu[j][2]*dely);
-	    tjycoul += -crossy + pre3 * (mu[j][2]*delx - mu[j][0]*delz);
-	    tjzcoul += -crossz + pre3 * (mu[j][0]*dely - mu[j][1]*delx);
-	  }
-
-	  if (mu[i][3] > 0.0 && q[j] != 0.0) { 
+            pre1 = 3.0*r5inv*pdotp - 15.0*r7inv*pidotr*pjdotr;
+            pre2 = 3.0*r5inv*pjdotr;
+            pre3 = 3.0*r5inv*pidotr;
+            pre4 = -1.0*r3inv;
+
+            forcecoulx += pre1*delx + pre2*mu[i][0] + pre3*mu[j][0];
+            forcecouly += pre1*dely + pre2*mu[i][1] + pre3*mu[j][1];
+            forcecoulz += pre1*delz + pre2*mu[i][2] + pre3*mu[j][2];
+
+            crossx = pre4 * (mu[i][1]*mu[j][2] - mu[i][2]*mu[j][1]);
+            crossy = pre4 * (mu[i][2]*mu[j][0] - mu[i][0]*mu[j][2]);
+            crossz = pre4 * (mu[i][0]*mu[j][1] - mu[i][1]*mu[j][0]);
+
+            tixcoul += crossx + pre2 * (mu[i][1]*delz - mu[i][2]*dely);
+            tiycoul += crossy + pre2 * (mu[i][2]*delx - mu[i][0]*delz);
+            tizcoul += crossz + pre2 * (mu[i][0]*dely - mu[i][1]*delx);
+            tjxcoul += -crossx + pre3 * (mu[j][1]*delz - mu[j][2]*dely);
+            tjycoul += -crossy + pre3 * (mu[j][2]*delx - mu[j][0]*delz);
+            tjzcoul += -crossz + pre3 * (mu[j][0]*dely - mu[j][1]*delx);
+          }
+
+          if (mu[i][3] > 0.0 && q[j] != 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
             pidotr = mu[i][0]*delx + mu[i][1]*dely + mu[i][2]*delz;
-	    pre1 = 3.0*q[j]*r5inv * pidotr;
-	    pre2 = q[j]*r3inv;
+            pre1 = 3.0*q[j]*r5inv * pidotr;
+            pre2 = q[j]*r3inv;
 
-	    forcecoulx += pre2*mu[i][0] - pre1*delx;
+            forcecoulx += pre2*mu[i][0] - pre1*delx;
             forcecouly += pre2*mu[i][1] - pre1*dely;
             forcecoulz += pre2*mu[i][2] - pre1*delz;
-	    tixcoul += pre2 * (mu[i][1]*delz - mu[i][2]*dely);
-	    tiycoul += pre2 * (mu[i][2]*delx - mu[i][0]*delz);
-	    tizcoul += pre2 * (mu[i][0]*dely - mu[i][1]*delx);
-	  }
+            tixcoul += pre2 * (mu[i][1]*delz - mu[i][2]*dely);
+            tiycoul += pre2 * (mu[i][2]*delx - mu[i][0]*delz);
+            tizcoul += pre2 * (mu[i][0]*dely - mu[i][1]*delx);
+          }
 
-	  if (mu[j][3] > 0.0 && qtmp != 0.0) { 
+          if (mu[j][3] > 0.0 && qtmp != 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
             pjdotr = mu[j][0]*delx + mu[j][1]*dely + mu[j][2]*delz;
-	    pre1 = 3.0*qtmp*r5inv * pjdotr;
-	    pre2 = qtmp*r3inv;
+            pre1 = 3.0*qtmp*r5inv * pjdotr;
+            pre2 = qtmp*r3inv;
 
-	    forcecoulx += pre1*delx - pre2*mu[j][0];
+            forcecoulx += pre1*delx - pre2*mu[j][0];
             forcecouly += pre1*dely - pre2*mu[j][1];
             forcecoulz += pre1*delz - pre2*mu[j][2];
-	    tjxcoul += -pre2 * (mu[j][1]*delz - mu[j][2]*dely);
-	    tjycoul += -pre2 * (mu[j][2]*delx - mu[j][0]*delz);
-	    tjzcoul += -pre2 * (mu[j][0]*dely - mu[j][1]*delx);
-	  }
-	}
-
-	// LJ interaction
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  forcelj *= factor_lj * r2inv;
-	} else forcelj = 0.0;
-	  
-	// total force
-
-	fq = factor_coul*qqrd2e;
-	fx = fq*forcecoulx + delx*forcelj;
-	fy = fq*forcecouly + dely*forcelj;
-	fz = fq*forcecoulz + delz*forcelj;
-	
-	// force & torque accumulation
-
-	fxtmp += fx;
-	fytmp += fy;
-	fztmp += fz;
-	t1tmp += fq*tixcoul;
-	t2tmp += fq*tiycoul;
-	t3tmp += fq*tizcoul;
-
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	  torque[j][0] += fq*tjxcoul;
-	  torque[j][1] += fq*tjycoul;
-	  torque[j][2] += fq*tjzcoul;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq[itype][jtype]) {
-	    ecoul = qtmp*q[j]*rinv;
-	    if (mu[i][3] > 0.0 && mu[j][3] > 0.0)
-	      ecoul += r3inv*pdotp - 3.0*r5inv*pidotr*pjdotr;
-	    if (mu[i][3] > 0.0 && q[j] != 0.0) 
-	      ecoul += -q[j]*r3inv*pidotr;
-	    if (mu[j][3] > 0.0 && qtmp != 0.0)
-	      ecoul += qtmp*r3inv*pjdotr;
-	    ecoul *= factor_coul*qqrd2e;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,
-				     evdwl,ecoul,fx,fy,fz,delx,dely,delz,thr);
+            tjxcoul += -pre2 * (mu[j][1]*delz - mu[j][2]*dely);
+            tjycoul += -pre2 * (mu[j][2]*delx - mu[j][0]*delz);
+            tjzcoul += -pre2 * (mu[j][0]*dely - mu[j][1]*delx);
+          }
+        }
+
+        // LJ interaction
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          forcelj *= factor_lj * r2inv;
+        } else forcelj = 0.0;
+
+        // total force
+
+        fq = factor_coul*qqrd2e;
+        fx = fq*forcecoulx + delx*forcelj;
+        fy = fq*forcecouly + dely*forcelj;
+        fz = fq*forcecoulz + delz*forcelj;
+
+        // force & torque accumulation
+
+        fxtmp += fx;
+        fytmp += fy;
+        fztmp += fz;
+        t1tmp += fq*tixcoul;
+        t2tmp += fq*tiycoul;
+        t3tmp += fq*tizcoul;
+
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+          torque[j][0] += fq*tjxcoul;
+          torque[j][1] += fq*tjycoul;
+          torque[j][2] += fq*tjzcoul;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq[itype][jtype]) {
+            ecoul = qtmp*q[j]*rinv;
+            if (mu[i][3] > 0.0 && mu[j][3] > 0.0)
+              ecoul += r3inv*pdotp - 3.0*r5inv*pidotr*pjdotr;
+            if (mu[i][3] > 0.0 && q[j] != 0.0)
+              ecoul += -q[j]*r3inv*pidotr;
+            if (mu[j][3] > 0.0 && qtmp != 0.0)
+              ecoul += qtmp*r3inv*pjdotr;
+            ecoul *= factor_coul*qqrd2e;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                     evdwl,ecoul,fx,fy,fz,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_dipole_cut_omp.h b/src/USER-OMP/pair_dipole_cut_omp.h
index b175450c9f..4e874b1ffb 100644
--- a/src/USER-OMP/pair_dipole_cut_omp.h
+++ b/src/USER-OMP/pair_dipole_cut_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_dipole_sf_omp.cpp b/src/USER-OMP/pair_dipole_sf_omp.cpp
index 07721562b8..4090bc3c02 100644
--- a/src/USER-OMP/pair_dipole_sf_omp.cpp
+++ b/src/USER-OMP/pair_dipole_sf_omp.cpp
@@ -56,11 +56,11 @@ void PairDipoleSFOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -132,170 +132,170 @@ void PairDipoleSFOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	rinv = sqrt(r2inv);
+        r2inv = 1.0/rsq;
+        rinv = sqrt(r2inv);
 
-	// atom can have both a charge and dipole
-	// i,j = charge-charge, dipole-dipole, dipole-charge, or charge-dipole
-	// atom can have both a charge and dipole
-	// i,j = charge-charge, dipole-dipole, dipole-charge, or charge-dipole
+        // atom can have both a charge and dipole
+        // i,j = charge-charge, dipole-dipole, dipole-charge, or charge-dipole
+        // atom can have both a charge and dipole
+        // i,j = charge-charge, dipole-dipole, dipole-charge, or charge-dipole
 
-	forcecoulx = forcecouly = forcecoulz = 0.0;
-	tixcoul = tiycoul = tizcoul = 0.0;
-	tjxcoul = tjycoul = tjzcoul = 0.0;
-	
-	if (rsq < cut_coulsq[itype][jtype]) {
+        forcecoulx = forcecouly = forcecoulz = 0.0;
+        tixcoul = tiycoul = tizcoul = 0.0;
+        tjxcoul = tjycoul = tjzcoul = 0.0;
 
-	  if (qtmp != 0.0 && q[j] != 0.0) {
+        if (rsq < cut_coulsq[itype][jtype]) {
+
+          if (qtmp != 0.0 && q[j] != 0.0) {
             pre1 = qtmp*q[j]*rinv*(r2inv-1.0/cut_coulsq[itype][jtype]);
 
-	    forcecoulx += pre1*delx;
-	    forcecouly += pre1*dely;
-	    forcecoulz += pre1*delz;
-	  }
+            forcecoulx += pre1*delx;
+            forcecouly += pre1*dely;
+            forcecoulz += pre1*delz;
+          }
 
-	  if (mu[i][3] > 0.0 && mu[j][3] > 0.0) { 
+          if (mu[i][3] > 0.0 && mu[j][3] > 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
-	    rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
+            rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
 
             pdotp = mu[i][0]*mu[j][0] + mu[i][1]*mu[j][1] + mu[i][2]*mu[j][2];
             pidotr = mu[i][0]*delx + mu[i][1]*dely + mu[i][2]*delz;
             pjdotr = mu[j][0]*delx + mu[j][1]*dely + mu[j][2]*delz;
 
-	    afac = 1.0 - rsq*rsq * rcutcoul2inv*rcutcoul2inv;
-	    pre1 = afac * ( pdotp - 3.0 * r2inv * pidotr * pjdotr );
-	    aforcecoulx = pre1*delx;
-	    aforcecouly = pre1*dely;
-	    aforcecoulz = pre1*delz;
-	    
-	    bfac = 1.0 - 4.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv) +
-	      3.0*rsq*rsq*rcutcoul2inv*rcutcoul2inv;
-	    presf = 2.0 * r2inv * pidotr * pjdotr;
-	    bforcecoulx = bfac * (pjdotr*mu[i][0]+pidotr*mu[j][0]-presf*delx);
-	    bforcecouly = bfac * (pjdotr*mu[i][1]+pidotr*mu[j][1]-presf*dely);
-	    bforcecoulz = bfac * (pjdotr*mu[i][2]+pidotr*mu[j][2]-presf*delz);
-	    
-	    forcecoulx += 3.0 * r5inv * ( aforcecoulx + bforcecoulx );
-	    forcecouly += 3.0 * r5inv * ( aforcecouly + bforcecouly );
-	    forcecoulz += 3.0 * r5inv * ( aforcecoulz + bforcecoulz );
-	    
-	    pre2 = 3.0 * bfac * r5inv * pjdotr;
-	    pre3 = 3.0 * bfac * r5inv * pidotr;
-	    pre4 = -bfac * r3inv;
-	    
-	    crossx = pre4 * (mu[i][1]*mu[j][2] - mu[i][2]*mu[j][1]);
-	    crossy = pre4 * (mu[i][2]*mu[j][0] - mu[i][0]*mu[j][2]);
-	    crossz = pre4 * (mu[i][0]*mu[j][1] - mu[i][1]*mu[j][0]);
-
-	    tixcoul += crossx + pre2 * (mu[i][1]*delz - mu[i][2]*dely);
-	    tiycoul += crossy + pre2 * (mu[i][2]*delx - mu[i][0]*delz);
-	    tizcoul += crossz + pre2 * (mu[i][0]*dely - mu[i][1]*delx);
-	    tjxcoul += -crossx + pre3 * (mu[j][1]*delz - mu[j][2]*dely);
-	    tjycoul += -crossy + pre3 * (mu[j][2]*delx - mu[j][0]*delz);
-	    tjzcoul += -crossz + pre3 * (mu[j][0]*dely - mu[j][1]*delx);
-	  }
-
-	  if (mu[i][3] > 0.0 && q[j] != 0.0) { 
+            afac = 1.0 - rsq*rsq * rcutcoul2inv*rcutcoul2inv;
+            pre1 = afac * ( pdotp - 3.0 * r2inv * pidotr * pjdotr );
+            aforcecoulx = pre1*delx;
+            aforcecouly = pre1*dely;
+            aforcecoulz = pre1*delz;
+
+            bfac = 1.0 - 4.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv) +
+              3.0*rsq*rsq*rcutcoul2inv*rcutcoul2inv;
+            presf = 2.0 * r2inv * pidotr * pjdotr;
+            bforcecoulx = bfac * (pjdotr*mu[i][0]+pidotr*mu[j][0]-presf*delx);
+            bforcecouly = bfac * (pjdotr*mu[i][1]+pidotr*mu[j][1]-presf*dely);
+            bforcecoulz = bfac * (pjdotr*mu[i][2]+pidotr*mu[j][2]-presf*delz);
+
+            forcecoulx += 3.0 * r5inv * ( aforcecoulx + bforcecoulx );
+            forcecouly += 3.0 * r5inv * ( aforcecouly + bforcecouly );
+            forcecoulz += 3.0 * r5inv * ( aforcecoulz + bforcecoulz );
+
+            pre2 = 3.0 * bfac * r5inv * pjdotr;
+            pre3 = 3.0 * bfac * r5inv * pidotr;
+            pre4 = -bfac * r3inv;
+
+            crossx = pre4 * (mu[i][1]*mu[j][2] - mu[i][2]*mu[j][1]);
+            crossy = pre4 * (mu[i][2]*mu[j][0] - mu[i][0]*mu[j][2]);
+            crossz = pre4 * (mu[i][0]*mu[j][1] - mu[i][1]*mu[j][0]);
+
+            tixcoul += crossx + pre2 * (mu[i][1]*delz - mu[i][2]*dely);
+            tiycoul += crossy + pre2 * (mu[i][2]*delx - mu[i][0]*delz);
+            tizcoul += crossz + pre2 * (mu[i][0]*dely - mu[i][1]*delx);
+            tjxcoul += -crossx + pre3 * (mu[j][1]*delz - mu[j][2]*dely);
+            tjycoul += -crossy + pre3 * (mu[j][2]*delx - mu[j][0]*delz);
+            tjzcoul += -crossz + pre3 * (mu[j][0]*dely - mu[j][1]*delx);
+          }
+
+          if (mu[i][3] > 0.0 && q[j] != 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
             pidotr = mu[i][0]*delx + mu[i][1]*dely + mu[i][2]*delz;
-	    rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
-	    pre1 = 3.0 * q[j] * r5inv * pidotr * (1-rsq*rcutcoul2inv);
-	    pqfac = 1.0 - 3.0*rsq*rcutcoul2inv + 
-	      2.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv);
-	    pre2 = q[j] * r3inv * pqfac;
+            rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
+            pre1 = 3.0 * q[j] * r5inv * pidotr * (1-rsq*rcutcoul2inv);
+            pqfac = 1.0 - 3.0*rsq*rcutcoul2inv +
+              2.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv);
+            pre2 = q[j] * r3inv * pqfac;
 
-	    forcecoulx += pre2*mu[i][0] - pre1*delx;
+            forcecoulx += pre2*mu[i][0] - pre1*delx;
             forcecouly += pre2*mu[i][1] - pre1*dely;
             forcecoulz += pre2*mu[i][2] - pre1*delz;
-	    tixcoul += pre2 * (mu[i][1]*delz - mu[i][2]*dely);
-	    tiycoul += pre2 * (mu[i][2]*delx - mu[i][0]*delz);
-	    tizcoul += pre2 * (mu[i][0]*dely - mu[i][1]*delx);
-	  }
+            tixcoul += pre2 * (mu[i][1]*delz - mu[i][2]*dely);
+            tiycoul += pre2 * (mu[i][2]*delx - mu[i][0]*delz);
+            tizcoul += pre2 * (mu[i][0]*dely - mu[i][1]*delx);
+          }
 
-	  if (mu[j][3] > 0.0 && qtmp != 0.0) { 
+          if (mu[j][3] > 0.0 && qtmp != 0.0) {
             r3inv = r2inv*rinv;
             r5inv = r3inv*r2inv;
             pjdotr = mu[j][0]*delx + mu[j][1]*dely + mu[j][2]*delz;
-	    rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
-	    pre1 = 3.0 * qtmp * r5inv * pjdotr * (1-rsq*rcutcoul2inv);
-	    qpfac = 1.0 - 3.0*rsq*rcutcoul2inv +
-	      2.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv);
-	    pre2 = qtmp * r3inv * qpfac;
+            rcutcoul2inv=1.0/cut_coulsq[itype][jtype];
+            pre1 = 3.0 * qtmp * r5inv * pjdotr * (1-rsq*rcutcoul2inv);
+            qpfac = 1.0 - 3.0*rsq*rcutcoul2inv +
+              2.0*rsq*sqrt(rsq)*rcutcoul2inv*sqrt(rcutcoul2inv);
+            pre2 = qtmp * r3inv * qpfac;
 
-	    forcecoulx += pre1*delx - pre2*mu[j][0];
+            forcecoulx += pre1*delx - pre2*mu[j][0];
             forcecouly += pre1*dely - pre2*mu[j][1];
             forcecoulz += pre1*delz - pre2*mu[j][2];
-	    tjxcoul += -pre2 * (mu[j][1]*delz - mu[j][2]*dely);
-	    tjycoul += -pre2 * (mu[j][2]*delx - mu[j][0]*delz);
-	    tjzcoul += -pre2 * (mu[j][0]*dely - mu[j][1]*delx);
-	  }
-	}
-
-	// LJ interaction
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forceljcut = r6inv*(lj1[itype][jtype]*r6inv-lj2[itype][jtype])*r2inv;
-	  
-	  rcutlj2inv = 1.0 / cut_ljsq[itype][jtype];
-	  rcutlj6inv = rcutlj2inv * rcutlj2inv * rcutlj2inv;
-	  forceljsf = (lj1[itype][jtype]*rcutlj6inv - lj2[itype][jtype]) * 
-	    rcutlj6inv * rcutlj2inv;
-
-	  forcelj = factor_lj * (forceljcut - forceljsf);
-	} else forcelj = 0.0;
-	  
-	// total force
-
-	fq = factor_coul*qqrd2e;
-	fx = fq*forcecoulx + delx*forcelj;
-	fy = fq*forcecouly + dely*forcelj;
-	fz = fq*forcecoulz + delz*forcelj;
-	
-	// force & torque accumulation
-
-	fxtmp += fx;
-	fytmp += fy;
-	fztmp += fz;
-	t1tmp += fq*tixcoul;
-	t2tmp += fq*tiycoul;
-	t3tmp += fq*tizcoul;
-
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	  torque[j][0] += fq*tjxcoul;
-	  torque[j][1] += fq*tjycoul;
-	  torque[j][2] += fq*tjzcoul;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq[itype][jtype]) {
-	    ecoul = qtmp * q[j] * rinv *
-	      pow((1.0-sqrt(rsq)/sqrt(cut_coulsq[itype][jtype])),2.0);
-	    if (mu[i][3] > 0.0 && mu[j][3] > 0.0)
-	      ecoul += bfac * (r3inv*pdotp - 3.0*r5inv*pidotr*pjdotr);
-	    if (mu[i][3] > 0.0 && q[j] != 0.0) 
-	      ecoul += -q[j] * r3inv * pqfac * pidotr;
-	    if (mu[j][3] > 0.0 && qtmp != 0.0)
-	      ecoul += qtmp * r3inv * qpfac * pjdotr;
-	    ecoul *= factor_coul*qqrd2e;
-	  } else ecoul = 0.0;
-	  
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype])+
-	      rcutlj6inv*(6*lj3[itype][jtype]*rcutlj6inv-3*lj4[itype][jtype])*
-	      rsq*rcutlj2inv+
-	      rcutlj6inv*(-7*lj3[itype][jtype]*rcutlj6inv+4*lj4[itype][jtype]);
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,
-				     evdwl,ecoul,fx,fy,fz,delx,dely,delz,thr);
+            tjxcoul += -pre2 * (mu[j][1]*delz - mu[j][2]*dely);
+            tjycoul += -pre2 * (mu[j][2]*delx - mu[j][0]*delz);
+            tjzcoul += -pre2 * (mu[j][0]*dely - mu[j][1]*delx);
+          }
+        }
+
+        // LJ interaction
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forceljcut = r6inv*(lj1[itype][jtype]*r6inv-lj2[itype][jtype])*r2inv;
+
+          rcutlj2inv = 1.0 / cut_ljsq[itype][jtype];
+          rcutlj6inv = rcutlj2inv * rcutlj2inv * rcutlj2inv;
+          forceljsf = (lj1[itype][jtype]*rcutlj6inv - lj2[itype][jtype]) *
+            rcutlj6inv * rcutlj2inv;
+
+          forcelj = factor_lj * (forceljcut - forceljsf);
+        } else forcelj = 0.0;
+
+        // total force
+
+        fq = factor_coul*qqrd2e;
+        fx = fq*forcecoulx + delx*forcelj;
+        fy = fq*forcecouly + dely*forcelj;
+        fz = fq*forcecoulz + delz*forcelj;
+
+        // force & torque accumulation
+
+        fxtmp += fx;
+        fytmp += fy;
+        fztmp += fz;
+        t1tmp += fq*tixcoul;
+        t2tmp += fq*tiycoul;
+        t3tmp += fq*tizcoul;
+
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+          torque[j][0] += fq*tjxcoul;
+          torque[j][1] += fq*tjycoul;
+          torque[j][2] += fq*tjzcoul;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq[itype][jtype]) {
+            ecoul = qtmp * q[j] * rinv *
+              pow((1.0-sqrt(rsq)/sqrt(cut_coulsq[itype][jtype])),2.0);
+            if (mu[i][3] > 0.0 && mu[j][3] > 0.0)
+              ecoul += bfac * (r3inv*pdotp - 3.0*r5inv*pidotr*pjdotr);
+            if (mu[i][3] > 0.0 && q[j] != 0.0)
+              ecoul += -q[j] * r3inv * pqfac * pidotr;
+            if (mu[j][3] > 0.0 && qtmp != 0.0)
+              ecoul += qtmp * r3inv * qpfac * pjdotr;
+            ecoul *= factor_coul*qqrd2e;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype])+
+              rcutlj6inv*(6*lj3[itype][jtype]*rcutlj6inv-3*lj4[itype][jtype])*
+              rsq*rcutlj2inv+
+              rcutlj6inv*(-7*lj3[itype][jtype]*rcutlj6inv+4*lj4[itype][jtype]);
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                     evdwl,ecoul,fx,fy,fz,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_dipole_sf_omp.h b/src/USER-OMP/pair_dipole_sf_omp.h
index 89c80fa788..3ff008cef5 100644
--- a/src/USER-OMP/pair_dipole_sf_omp.h
+++ b/src/USER-OMP/pair_dipole_sf_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_dpd_omp.cpp b/src/USER-OMP/pair_dpd_omp.cpp
index f8d472f041..cb7f560e05 100644
--- a/src/USER-OMP/pair_dpd_omp.cpp
+++ b/src/USER-OMP/pair_dpd_omp.cpp
@@ -39,7 +39,7 @@ PairDPDOMP::PairDPDOMP(LAMMPS *lmp) :
 
 /* ---------------------------------------------------------------------- */
 
-PairDPDOMP::~PairDPDOMP() 
+PairDPDOMP::~PairDPDOMP()
 {
   if (random_thr) {
     for (int i=1; i < comm->nthreads; ++i)
@@ -82,16 +82,16 @@ void PairDPDOMP::compute(int eflag, int vflag)
     // generate a random number generator instance for
     // all threads != 0. make sure we use unique seeds.
     if (random_thr && tid > 0)
-      random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me 
-				    + comm->nprocs*tid);
+      random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me
+                                    + comm->nprocs*tid);
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -155,44 +155,44 @@ void PairDPDOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	if (r < EPSILON) continue;     // r can be 0.0 in DPD systems
-	rinv = 1.0/r;
-	delvx = vxtmp - v[j][0];
-	delvy = vytmp - v[j][1];
-	delvz = vztmp - v[j][2];
-	dot = delx*delvx + dely*delvy + delz*delvz;
-	wd = 1.0 - r/cut[itype][jtype];
-	randnum = rng.gaussian();
-
-	// conservative force = a0 * wd
-	// drag force = -gamma * wd^2 * (delx dot delv) / r
-	// random force = sigma * wd * rnd * dtinvsqrt;
-
-	fpair = a0[itype][jtype]*wd;
-	fpair -= gamma[itype][jtype]*wd*wd*dot*rinv;
-	fpair += sigma[itype][jtype]*wd*randnum*dtinvsqrt;
-	fpair *= factor_dpd*rinv;	
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
+        r = sqrt(rsq);
+        if (r < EPSILON) continue;     // r can be 0.0 in DPD systems
+        rinv = 1.0/r;
+        delvx = vxtmp - v[j][0];
+        delvy = vytmp - v[j][1];
+        delvz = vztmp - v[j][2];
+        dot = delx*delvx + dely*delvy + delz*delvz;
+        wd = 1.0 - r/cut[itype][jtype];
+        randnum = rng.gaussian();
+
+        // conservative force = a0 * wd
+        // drag force = -gamma * wd^2 * (delx dot delv) / r
+        // random force = sigma * wd * rnd * dtinvsqrt;
+
+        fpair = a0[itype][jtype]*wd;
+        fpair -= gamma[itype][jtype]*wd*wd*dot*rinv;
+        fpair += sigma[itype][jtype]*wd*randnum*dtinvsqrt;
+        fpair *= factor_dpd*rinv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
           // unshifted eng of conservative term:
-	  // evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]);
-	  // eng shifted to 0.0 at cutoff
-	  evdwl = 0.5*a0[itype][jtype]*cut[itype][jtype] * wd*wd;
-	  evdwl *= factor_dpd;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+          // evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]);
+          // eng shifted to 0.0 at cutoff
+          evdwl = 0.5*a0[itype][jtype]*cut[itype][jtype] * wd*wd;
+          evdwl *= factor_dpd;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_dpd_omp.h b/src/USER-OMP/pair_dpd_omp.h
index c3802f8e60..470e6f1133 100644
--- a/src/USER-OMP/pair_dpd_omp.h
+++ b/src/USER-OMP/pair_dpd_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_dpd_tstat_omp.cpp b/src/USER-OMP/pair_dpd_tstat_omp.cpp
index 2074f12b1e..6965e69349 100644
--- a/src/USER-OMP/pair_dpd_tstat_omp.cpp
+++ b/src/USER-OMP/pair_dpd_tstat_omp.cpp
@@ -39,7 +39,7 @@ PairDPDTstatOMP::PairDPDTstatOMP(LAMMPS *lmp) :
 
 /* ---------------------------------------------------------------------- */
 
-PairDPDTstatOMP::~PairDPDTstatOMP() 
+PairDPDTstatOMP::~PairDPDTstatOMP()
 {
   if (random_thr) {
     for (int i=1; i < comm->nthreads; ++i)
@@ -64,7 +64,7 @@ void PairDPDTstatOMP::compute(int eflag, int vflag)
 
   if (!random_thr)
     random_thr = new RanMars*[nthreads];
-  
+
   // to ensure full compatibility with the serial DPD style
   // we use is random number generator instance for thread 0
   random_thr[0] = random;
@@ -82,16 +82,16 @@ void PairDPDTstatOMP::compute(int eflag, int vflag)
     // generate a random number generator instance for
     // all threads != 0. make sure we use unique seeds.
     if (random_thr && tid > 0)
-      random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me 
-				    + comm->nprocs*tid);
+      random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me
+                                    + comm->nprocs*tid);
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -130,7 +130,7 @@ void PairDPDTstatOMP::eval(int iifrom, int iito, ThrData * const thr)
     double boltz = force->boltz;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i; j <= atom->ntypes; j++)
-	sigma[i][j] = sigma[j][i] = sqrt(2.0*boltz*temperature*gamma[i][j]);
+        sigma[i][j] = sigma[j][i] = sqrt(2.0*boltz*temperature*gamma[i][j]);
   }
 
   ilist = list->ilist;
@@ -165,34 +165,34 @@ void PairDPDTstatOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	if (r < EPSILON) continue;     // r can be 0.0 in DPD systems
-	rinv = 1.0/r;
-	delvx = vxtmp - v[j][0];
-	delvy = vytmp - v[j][1];
-	delvz = vztmp - v[j][2];
-	dot = delx*delvx + dely*delvy + delz*delvz;
-	wd = 1.0 - r/cut[itype][jtype];
-	randnum = rng.gaussian();
-
-	// drag force = -gamma * wd^2 * (delx dot delv) / r
-	// random force = sigma * wd * rnd * dtinvsqrt;
-
-	fpair = -gamma[itype][jtype]*wd*wd*dot*rinv;
-	fpair += sigma[itype][jtype]*wd*randnum*dtinvsqrt;
-	fpair *= factor_dpd*rinv;	
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 0.0,0.0,fpair,delx,dely,delz,thr);
+        r = sqrt(rsq);
+        if (r < EPSILON) continue;     // r can be 0.0 in DPD systems
+        rinv = 1.0/r;
+        delvx = vxtmp - v[j][0];
+        delvy = vytmp - v[j][1];
+        delvz = vztmp - v[j][2];
+        dot = delx*delvx + dely*delvy + delz*delvz;
+        wd = 1.0 - r/cut[itype][jtype];
+        randnum = rng.gaussian();
+
+        // drag force = -gamma * wd^2 * (delx dot delv) / r
+        // random force = sigma * wd * rnd * dtinvsqrt;
+
+        fpair = -gamma[itype][jtype]*wd*wd*dot*rinv;
+        fpair += sigma[itype][jtype]*wd*randnum*dtinvsqrt;
+        fpair *= factor_dpd*rinv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 0.0,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_dpd_tstat_omp.h b/src/USER-OMP/pair_dpd_tstat_omp.h
index 87c9de5505..b04874efc2 100644
--- a/src/USER-OMP/pair_dpd_tstat_omp.h
+++ b/src/USER-OMP/pair_dpd_tstat_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_eam_alloy_omp.cpp b/src/USER-OMP/pair_eam_alloy_omp.cpp
index 54be571b7f..3dff868b6a 100644
--- a/src/USER-OMP/pair_eam_alloy_omp.cpp
+++ b/src/USER-OMP/pair_eam_alloy_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -96,9 +96,9 @@ void PairEAMAlloyOMP::coeff(int narg, char **arg)
   for (i = 1; i <= n; i++) {
     for (j = i; j <= n; j++) {
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
-	count++;
+        setflag[i][j] = 1;
+        if (i == j) atom->set_mass(i,setfl->mass[map[i]]);
+        count++;
       }
     }
   }
@@ -147,7 +147,7 @@ void PairEAMAlloyOMP::read_file(char *filename)
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
     error->all(FLERR,"Incorrect element names in EAM potential file");
-  
+
   char **words = new char*[file->nelements+1];
   nwords = 0;
   strtok(line," \t\n\r\f");
@@ -164,7 +164,7 @@ void PairEAMAlloyOMP::read_file(char *filename)
   if (me == 0) {
     fgets(line,MAXLINE,fptr);
     sscanf(line,"%d %lg %d %lg %lg",
-	   &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
+           &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
   }
 
   MPI_Bcast(&file->nrho,1,MPI_INT,0,world);
@@ -177,7 +177,7 @@ void PairEAMAlloyOMP::read_file(char *filename)
   memory->create(file->frho,file->nelements,file->nrho+1,"pair:frho");
   memory->create(file->rhor,file->nelements,file->nr+1,"pair:rhor");
   memory->create(file->z2r,file->nelements,file->nelements,file->nr+1,
-		 "pair:z2r");
+                 "pair:z2r");
 
   int i,j,tmp;
   for (i = 0; i < file->nelements; i++) {
@@ -226,7 +226,7 @@ void PairEAMAlloyOMP::file2array()
 
   // allocate frho arrays
   // nfrho = # of setfl elements + 1 for zero array
-  
+
   nfrho = setfl->nelements + 1;
   memory->destroy(frho);
   memory->create(frho,nfrho,nrho+1,"pair:frho");
@@ -307,12 +307,12 @@ void PairEAMAlloyOMP::file2array()
       irow = map[i];
       icol = map[j];
       if (irow == -1 || icol == -1) {
-	type2z2r[i][j] = 0;
-	continue;
+        type2z2r[i][j] = 0;
+        continue;
       }
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
diff --git a/src/USER-OMP/pair_eam_alloy_omp.h b/src/USER-OMP/pair_eam_alloy_omp.h
index 7a71fbc17a..a044b18f60 100644
--- a/src/USER-OMP/pair_eam_alloy_omp.h
+++ b/src/USER-OMP/pair_eam_alloy_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_eam_fs_omp.cpp b/src/USER-OMP/pair_eam_fs_omp.cpp
index d0963fa621..84101913c5 100644
--- a/src/USER-OMP/pair_eam_fs_omp.cpp
+++ b/src/USER-OMP/pair_eam_fs_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -96,9 +96,9 @@ void PairEAMFSOMP::coeff(int narg, char **arg)
   for (i = 1; i <= n; i++) {
     for (j = i; j <= n; j++) {
       if (map[i] >= 0 && map[j] >= 0) {
-	setflag[i][j] = 1;
-	if (i == j) atom->set_mass(i,fs->mass[map[i]]);
-	count++;
+        setflag[i][j] = 1;
+        if (i == j) atom->set_mass(i,fs->mass[map[i]]);
+        count++;
       }
     }
   }
@@ -147,7 +147,7 @@ void PairEAMFSOMP::read_file(char *filename)
   int nwords = atom->count_words(line);
   if (nwords != file->nelements + 1)
     error->all(FLERR,"Incorrect element names in EAM potential file");
-  
+
   char **words = new char*[file->nelements+1];
   nwords = 0;
   strtok(line," \t\n\r\f");
@@ -164,7 +164,7 @@ void PairEAMFSOMP::read_file(char *filename)
   if (me == 0) {
     fgets(line,MAXLINE,fptr);
     sscanf(line,"%d %lg %d %lg %lg",
-	   &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
+           &file->nrho,&file->drho,&file->nr,&file->dr,&file->cut);
   }
 
   MPI_Bcast(&file->nrho,1,MPI_INT,0,world);
@@ -175,11 +175,11 @@ void PairEAMFSOMP::read_file(char *filename)
 
   file->mass = new double[file->nelements];
   memory->create(file->frho,file->nelements,file->nrho+1,
-					      "pair:frho");
+                                              "pair:frho");
   memory->create(file->rhor,file->nelements,file->nelements,
-		 file->nr+1,"pair:rhor");
+                 file->nr+1,"pair:rhor");
   memory->create(file->z2r,file->nelements,file->nelements,
-		 file->nr+1,"pair:z2r");
+                 file->nr+1,"pair:z2r");
 
   int i,j,tmp;
   for (i = 0; i < file->nelements; i++) {
@@ -231,7 +231,7 @@ void PairEAMFSOMP::file2array()
 
   // allocate frho arrays
   // nfrho = # of fs elements + 1 for zero array
-  
+
   nfrho = fs->nelements + 1;
   memory->destroy(frho);
   memory->create(frho,nfrho,nrho+1,"pair:frho");
@@ -316,12 +316,12 @@ void PairEAMFSOMP::file2array()
       irow = map[i];
       icol = map[j];
       if (irow == -1 || icol == -1) {
-	type2z2r[i][j] = 0;
-	continue;
+        type2z2r[i][j] = 0;
+        continue;
       }
       if (irow < icol) {
-	irow = map[j];
-	icol = map[i];
+        irow = map[j];
+        icol = map[i];
       }
       n = 0;
       for (m = 0; m < irow; m++) n += m + 1;
diff --git a/src/USER-OMP/pair_eam_fs_omp.h b/src/USER-OMP/pair_eam_fs_omp.h
index bee6cef762..42d4d59eb6 100644
--- a/src/USER-OMP/pair_eam_fs_omp.h
+++ b/src/USER-OMP/pair_eam_fs_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_eam_omp.cpp b/src/USER-OMP/pair_eam_omp.cpp
index 17efa59a52..0d74a94ba0 100644
--- a/src/USER-OMP/pair_eam_omp.cpp
+++ b/src/USER-OMP/pair_eam_omp.cpp
@@ -67,7 +67,7 @@ void PairEAMOMP::compute(int eflag, int vflag)
     loop_setup_thr(ifrom, ito, tid, inum, nthreads);
     ThrData *thr = fix->get_thr(tid);
     ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr);
-    
+
     if (force->newton_pair)
       thr->init_eam(nall, rho);
     else
@@ -75,11 +75,11 @@ void PairEAMOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -139,18 +139,18 @@ void PairEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cutforcesq) {
-	jtype = type[j];
-	p = sqrt(rsq)*rdr + 1.0;
-	m = static_cast<int> (p);
-	m = MIN(m,nr-1);
-	p -= m;
-	p = MIN(p,1.0);
-	coeff = rhor_spline[type2rhor[jtype][itype]][m];
-	rho_t[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
-	if (NEWTON_PAIR || j < nlocal) {
-	  coeff = rhor_spline[type2rhor[itype][jtype]][m];
-	  rho_t[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
-	}
+        jtype = type[j];
+        p = sqrt(rsq)*rdr + 1.0;
+        m = static_cast<int> (p);
+        m = MIN(m,nr-1);
+        p -= m;
+        p = MIN(p,1.0);
+        coeff = rhor_spline[type2rhor[jtype][itype]][m];
+        rho_t[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        if (NEWTON_PAIR || j < nlocal) {
+          coeff = rhor_spline[type2rhor[itype][jtype]][m];
+          rho_t[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        }
       }
     }
   }
@@ -174,14 +174,14 @@ void PairEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
 
     // wait until master thread is done with communication
     sync_threads();
-  
+
   } else {
     data_reduce_thr(rho, nlocal, nthreads, 1, tid);
 
     // wait until reduction is complete
     sync_threads();
   }
-  
+
   // fp = derivative of embedding energy at each atom
   // phi = embedding energy at each atom
 
@@ -237,50 +237,50 @@ void PairEAMOMP::eval(int iifrom, int iito, ThrData * const thr)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cutforcesq) {
-	jtype = type[j];
-	r = sqrt(rsq);
-	p = r*rdr + 1.0;
-	m = static_cast<int> (p);
-	m = MIN(m,nr-1);
-	p -= m;
-	p = MIN(p,1.0);
-
-	// rhoip = derivative of (density at atom j due to atom i)
-	// rhojp = derivative of (density at atom i due to atom j)
-	// phi = pair potential energy
-	// phip = phi'
-	// z2 = phi * r
-	// z2p = (phi * r)' = (phi' r) + phi
-	// psip needs both fp[i] and fp[j] terms since r_ij appears in two
-	//   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
-	//   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
-
-	coeff = rhor_spline[type2rhor[itype][jtype]][m];
-	rhoip = (coeff[0]*p + coeff[1])*p + coeff[2];
-	coeff = rhor_spline[type2rhor[jtype][itype]][m];
-	rhojp = (coeff[0]*p + coeff[1])*p + coeff[2];
-	coeff = z2r_spline[type2z2r[itype][jtype]][m];
-	z2p = (coeff[0]*p + coeff[1])*p + coeff[2];
-	z2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
-
-	recip = 1.0/r;
-	phi = z2*recip;
-	phip = z2p*recip - phi*recip;
-	psip = fp[i]*rhojp + fp[j]*rhoip + phip;
-	fpair = -psip*recip;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) evdwl = phi;
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        jtype = type[j];
+        r = sqrt(rsq);
+        p = r*rdr + 1.0;
+        m = static_cast<int> (p);
+        m = MIN(m,nr-1);
+        p -= m;
+        p = MIN(p,1.0);
+
+        // rhoip = derivative of (density at atom j due to atom i)
+        // rhojp = derivative of (density at atom i due to atom j)
+        // phi = pair potential energy
+        // phip = phi'
+        // z2 = phi * r
+        // z2p = (phi * r)' = (phi' r) + phi
+        // psip needs both fp[i] and fp[j] terms since r_ij appears in two
+        //   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
+        //   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
+
+        coeff = rhor_spline[type2rhor[itype][jtype]][m];
+        rhoip = (coeff[0]*p + coeff[1])*p + coeff[2];
+        coeff = rhor_spline[type2rhor[jtype][itype]][m];
+        rhojp = (coeff[0]*p + coeff[1])*p + coeff[2];
+        coeff = z2r_spline[type2z2r[itype][jtype]][m];
+        z2p = (coeff[0]*p + coeff[1])*p + coeff[2];
+        z2 = ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+
+        recip = 1.0/r;
+        phi = z2*recip;
+        phip = z2p*recip - phi*recip;
+        psip = fp[i]*rhojp + fp[j]*rhoip + phip;
+        fpair = -psip*recip;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) evdwl = phi;
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_eam_omp.h b/src/USER-OMP/pair_eam_omp.h
index 6b0f1274fc..0f9d3cd51e 100644
--- a/src/USER-OMP/pair_eam_omp.h
+++ b/src/USER-OMP/pair_eam_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_edip_omp.cpp b/src/USER-OMP/pair_edip_omp.cpp
index 4d1fc3e833..d9d68d7a07 100644
--- a/src/USER-OMP/pair_edip_omp.cpp
+++ b/src/USER-OMP/pair_edip_omp.cpp
@@ -63,11 +63,11 @@ void PairEDIPOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (vflag_atom) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (vflag_atom) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (vflag_atom) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (vflag_atom) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else eval<0,0,0>(ifrom, ito, thr);
 
@@ -204,8 +204,8 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
 
         interpolY1 = exp3B[interpolIDX];
         interpolY2 = exp3B[interpolIDX+1];
-        exp3B_ij = interpolY1 + (interpolY2 - interpolY1) * 
-	  (interpolTMP-interpolIDX);
+        exp3B_ij = interpolY1 + (interpolY2 - interpolY1) *
+          (interpolTMP-interpolIDX);
 
         exp3BDerived_ij = - exp3B_ij * gammInvRMinusCutoffA * invRMinusCutoffA;
 
@@ -214,8 +214,8 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
 
         interpolY1 = exp2B[interpolIDX];
         interpolY2 = exp2B[interpolIDX+1];
-        exp2B_ij = interpolY1 + (interpolY2 - interpolY1) * 
-	  (interpolTMP-interpolIDX);
+        exp2B_ij = interpolY1 + (interpolY2 - interpolY1) *
+          (interpolTMP-interpolIDX);
 
         exp2BDerived_ij = - exp2B_ij * sigmaInvRMinusCutoffA * invRMinusCutoffA;
 
@@ -224,8 +224,8 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
 
         interpolY1 = pow2B[interpolIDX];
         interpolY2 = pow2B[interpolIDX+1];
-        pow2B_ij = interpolY1 + (interpolY2 - interpolY1) * 
-	  (interpolTMP-interpolIDX);
+        pow2B_ij = interpolY1 + (interpolY2 - interpolY1) *
+          (interpolTMP-interpolIDX);
 
         pre_thrPow2B_ij[neighbor_j] = pow2B_ij;
 
@@ -235,15 +235,15 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
         else {
             interpolY1 = cutoffFunction[interpolIDX];
             interpolY2 = cutoffFunction[interpolIDX+1];
-            cutoffFunction_ij = interpolY1 + (interpolY2 - interpolY1) * 
-	      (interpolTMP-interpolIDX);
+            cutoffFunction_ij = interpolY1 + (interpolY2 - interpolY1) *
+              (interpolTMP-interpolIDX);
 
             zeta_i += cutoffFunction_ij;
 
             interpolY1 = cutoffFunctionDerived[interpolIDX];
             interpolY2 = cutoffFunctionDerived[interpolIDX+1];
-            zeta_iDerived = interpolY1 + (interpolY2 - interpolY1) * 
-	      (interpolTMP-interpolIDX);
+            zeta_iDerived = interpolY1 + (interpolY2 - interpolY1) *
+              (interpolTMP-interpolIDX);
 
             zeta_iDerivedInvR_ij = zeta_iDerived * invR_ij;
 
@@ -265,22 +265,22 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
 
     interpolY1 = expMinusBetaZeta_iZeta_iGrid[interpolIDX];
     interpolY2 = expMinusBetaZeta_iZeta_iGrid[interpolIDX+1];
-    expMinusBetaZeta_iZeta_i = interpolY1 + (interpolY2 - interpolY1) * 
+    expMinusBetaZeta_iZeta_i = interpolY1 + (interpolY2 - interpolY1) *
       (interpolTMP-interpolIDX);
 
     interpolY1 = qFunctionGrid[interpolIDX];
     interpolY2 = qFunctionGrid[interpolIDX+1];
-    qFunction = interpolY1 + (interpolY2 - interpolY1) * 
+    qFunction = interpolY1 + (interpolY2 - interpolY1) *
       (interpolTMP-interpolIDX);
 
     interpolY1 = tauFunctionGrid[interpolIDX];
     interpolY2 = tauFunctionGrid[interpolIDX+1];
-    tauFunction = interpolY1 + (interpolY2 - interpolY1) * 
+    tauFunction = interpolY1 + (interpolY2 - interpolY1) *
       (interpolTMP-interpolIDX);
 
     interpolY1 = tauFunctionDerivedGrid[interpolIDX];
     interpolY2 = tauFunctionDerivedGrid[interpolIDX+1];
-    tauFunctionDerived = interpolY1 + (interpolY2 - interpolY1) * 
+    tauFunctionDerived = interpolY1 + (interpolY2 - interpolY1) *
       (interpolTMP-interpolIDX);
 
     qFunctionDerived = -mu * qFunction;
@@ -320,8 +320,8 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
       forceModCoord += (forceModCoord_factor*exp2B_ij);
 
       exp2BDerived_ij = pre_thrExp2BDerived_ij[neighbor_j];
-      forceMod2B = exp2BDerived_ij * potential2B_factor + 
-	exp2B_ij * pow2BDerived_ij;
+      forceMod2B = exp2BDerived_ij * potential2B_factor +
+        exp2B_ij * pow2BDerived_ij;
 
       directorCos_ij_x = invR_ij * dr_ij[0];
       directorCos_ij_y = invR_ij * dr_ij[1];
@@ -347,7 +347,7 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
       evdwl = (exp2B_ij * potential2B_factor);
 
       if (EVFLAG) ev_tally_thr(this,i, j, nlocal, /* newton_pair */ 1, evdwl, 0.0,
-			       -forceMod2B*invR_ij, dr_ij[0], dr_ij[1], dr_ij[2],thr);
+                               -forceMod2B*invR_ij, dr_ij[0], dr_ij[1], dr_ij[2],thr);
 
       // three-body Forces
 
@@ -375,56 +375,56 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
           directorCos_ik_y = invR_ik * dr_ik[1];
           directorCos_ik_z = invR_ik * dr_ik[2];
 
-          cosTeta = directorCos_ij_x * directorCos_ik_x + 
-	    directorCos_ij_y * directorCos_ik_y +
-	    directorCos_ij_z * directorCos_ik_z;
+          cosTeta = directorCos_ij_x * directorCos_ik_x +
+            directorCos_ij_y * directorCos_ik_y +
+            directorCos_ij_z * directorCos_ik_z;
 
           cosTetaDiff = cosTeta + tauFunction;
           cosTetaDiffCosTetaDiff = cosTetaDiff * cosTetaDiff;
           qFunctionCosTetaDiffCosTetaDiff = cosTetaDiffCosTetaDiff * qFunction;
-          expMinusQFunctionCosTetaDiffCosTetaDiff = 
-	    exp(-qFunctionCosTetaDiffCosTetaDiff);
+          expMinusQFunctionCosTetaDiffCosTetaDiff =
+            exp(-qFunctionCosTetaDiffCosTetaDiff);
 
-          potentia3B_factor = lambda * 
-	    ((1.0 - expMinusQFunctionCosTetaDiffCosTetaDiff) + 
-	     eta * qFunctionCosTetaDiffCosTetaDiff);
+          potentia3B_factor = lambda *
+            ((1.0 - expMinusQFunctionCosTetaDiffCosTetaDiff) +
+             eta * qFunctionCosTetaDiffCosTetaDiff);
 
           exp3B_ik = pre_thrExp3B_ij[neighbor_k];
           exp3BDerived_ik = pre_thrExp3BDerived_ij[neighbor_k];
 
-          forceMod3B_factor1_ij = - exp3BDerived_ij * exp3B_ik * 
-	    potentia3B_factor;
-          forceMod3B_factor2 = 2.0 * lambda * exp3B_ij * exp3B_ik * 
-	    qFunction * cosTetaDiff *
-	    (eta + expMinusQFunctionCosTetaDiffCosTetaDiff);
+          forceMod3B_factor1_ij = - exp3BDerived_ij * exp3B_ik *
+            potentia3B_factor;
+          forceMod3B_factor2 = 2.0 * lambda * exp3B_ij * exp3B_ik *
+            qFunction * cosTetaDiff *
+            (eta + expMinusQFunctionCosTetaDiffCosTetaDiff);
           forceMod3B_factor2_ij = forceMod3B_factor2 * invR_ij;
 
-          f_ij[0] = forceMod3B_factor1_ij * directorCos_ij_x + 
-	    forceMod3B_factor2_ij *
-	    (cosTeta * directorCos_ij_x - directorCos_ik_x);
-          f_ij[1] = forceMod3B_factor1_ij * directorCos_ij_y + 
-	    forceMod3B_factor2_ij *
-	    (cosTeta * directorCos_ij_y - directorCos_ik_y);
-          f_ij[2] = forceMod3B_factor1_ij * directorCos_ij_z + 
-	    forceMod3B_factor2_ij *
-	    (cosTeta * directorCos_ij_z - directorCos_ik_z);
-
-          forceMod3B_factor1_ik = - exp3BDerived_ik * exp3B_ij * 
-	    potentia3B_factor;
+          f_ij[0] = forceMod3B_factor1_ij * directorCos_ij_x +
+            forceMod3B_factor2_ij *
+            (cosTeta * directorCos_ij_x - directorCos_ik_x);
+          f_ij[1] = forceMod3B_factor1_ij * directorCos_ij_y +
+            forceMod3B_factor2_ij *
+            (cosTeta * directorCos_ij_y - directorCos_ik_y);
+          f_ij[2] = forceMod3B_factor1_ij * directorCos_ij_z +
+            forceMod3B_factor2_ij *
+            (cosTeta * directorCos_ij_z - directorCos_ik_z);
+
+          forceMod3B_factor1_ik = - exp3BDerived_ik * exp3B_ij *
+            potentia3B_factor;
           forceMod3B_factor2_ik = forceMod3B_factor2 * invR_ik;
 
-          f_ik[0] = forceMod3B_factor1_ik * directorCos_ik_x + 
-	    forceMod3B_factor2_ik *
-	    (cosTeta * directorCos_ik_x - directorCos_ij_x);
-          f_ik[1] = forceMod3B_factor1_ik * directorCos_ik_y + 
-	    forceMod3B_factor2_ik *
-	    (cosTeta * directorCos_ik_y - directorCos_ij_y);
-          f_ik[2] = forceMod3B_factor1_ik * directorCos_ik_z + 
-	    forceMod3B_factor2_ik *
-	    (cosTeta * directorCos_ik_z - directorCos_ij_z);
+          f_ik[0] = forceMod3B_factor1_ik * directorCos_ik_x +
+            forceMod3B_factor2_ik *
+            (cosTeta * directorCos_ik_x - directorCos_ij_x);
+          f_ik[1] = forceMod3B_factor1_ik * directorCos_ik_y +
+            forceMod3B_factor2_ik *
+            (cosTeta * directorCos_ik_y - directorCos_ij_y);
+          f_ik[2] = forceMod3B_factor1_ik * directorCos_ik_z +
+            forceMod3B_factor2_ik *
+            (cosTeta * directorCos_ik_z - directorCos_ij_z);
 
-          forceModCoord += (forceMod3B_factor2 * 
-			    (tauFunctionDerived -  0.5 * mu * cosTetaDiff));
+          forceModCoord += (forceMod3B_factor2 *
+                            (tauFunctionDerived -  0.5 * mu * cosTetaDiff));
 
           f[j][0] += f_ij[0];
           f[j][1] += f_ij[1];
@@ -476,7 +476,7 @@ void PairEDIPOMP::eval(int iifrom, int iito, ThrData * const thr)
 
         evdwl = 0.0;
         if (EVFLAG) ev_tally_thr(this,i, j, nlocal, /* newton_pair */ 1, 0.0, 0.0,
-				 forceModCoord_ij, dr_ij[0], dr_ij[1], dr_ij[2],thr);
+                                 forceModCoord_ij, dr_ij[0], dr_ij[1], dr_ij[2],thr);
     }
   }
 }
diff --git a/src/USER-OMP/pair_eim_omp.cpp b/src/USER-OMP/pair_eim_omp.cpp
index cf1fcf5e35..ad0909f242 100644
--- a/src/USER-OMP/pair_eim_omp.cpp
+++ b/src/USER-OMP/pair_eim_omp.cpp
@@ -67,19 +67,19 @@ void PairEIMOMP::compute(int eflag, int vflag)
     loop_setup_thr(ifrom, ito, tid, inum, nthreads);
     ThrData *thr = fix->get_thr(tid);
     ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr);
-    
+
     if (force->newton_pair)
       thr->init_eim(nall, rho, fp);
     else
       thr->init_eim(atom->nlocal, rho, fp);
-    
+
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -141,17 +141,17 @@ void PairEIMOMP::eval(int iifrom, int iito, ThrData * const thr)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cutforcesq[itype][jtype]) {
-	p = sqrt(rsq)*rdr + 1.0;
-	m = static_cast<int> (p);
-	m = MIN(m,nr-1);
-	p -= m;
-	p = MIN(p,1.0);
-	coeff = Fij_spline[type2Fij[itype][jtype]][m];
-	rho_t[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
-	if (NEWTON_PAIR || j < nlocal) {
-	  coeff = Fij_spline[type2Fij[jtype][itype]][m];
-	  rho_t[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
-	}
+        p = sqrt(rsq)*rdr + 1.0;
+        m = static_cast<int> (p);
+        m = MIN(m,nr-1);
+        p -= m;
+        p = MIN(p,1.0);
+        coeff = Fij_spline[type2Fij[itype][jtype]][m];
+        rho_t[i] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        if (NEWTON_PAIR || j < nlocal) {
+          coeff = Fij_spline[type2Fij[jtype][itype]][m];
+          rho_t[j] += ((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6];
+        }
       }
     }
   }
@@ -170,9 +170,9 @@ void PairEIMOMP::eval(int iifrom, int iito, ThrData * const thr)
 #if defined(_OPENMP)
 #pragma omp master
 #endif
-    { 
+    {
       rhofp = 1;
-      comm->reverse_comm_pair(this); 
+      comm->reverse_comm_pair(this);
     }
 
   } else {
@@ -185,14 +185,14 @@ void PairEIMOMP::eval(int iifrom, int iito, ThrData * const thr)
 #if defined(_OPENMP)
 #pragma omp master
 #endif
-  { 
+  {
     rhofp = 1;
-    comm->forward_comm_pair(this); 
+    comm->forward_comm_pair(this);
   }
 
   // wait until master is finished communicating
   sync_threads();
- 
+
   for (ii = iifrom; ii < iito; ii++) {
     i = ilist[ii];
     xtmp = x[i][0];
@@ -201,17 +201,17 @@ void PairEIMOMP::eval(int iifrom, int iito, ThrData * const thr)
     itype = type[i];
     jlist = firstneigh[i];
     jnum = numneigh[i];
- 
+
     for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
       jtype = type[j];
- 
+
       delx = xtmp - x[j][0];
       dely = ytmp - x[j][1];
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
- 
+
       if (rsq < cutforcesq[itype][jtype]) {
         p = sqrt(rsq)*rdr + 1.0;
         m = static_cast<int> (p);
@@ -221,8 +221,8 @@ void PairEIMOMP::eval(int iifrom, int iito, ThrData * const thr)
         coeff = Gij_spline[type2Gij[itype][jtype]][m];
         fp_t[i] += rho[j]*(((coeff[3]*p + coeff[4])*p + coeff[5])*p + coeff[6]);
         if (NEWTON_PAIR || j < nlocal) {
-          fp_t[j] += rho[i]*(((coeff[3]*p + coeff[4])*p + coeff[5])*p + 
-			   coeff[6]);
+          fp_t[j] += rho[i]*(((coeff[3]*p + coeff[4])*p + coeff[5])*p +
+                           coeff[6]);
         }
       }
     }
@@ -242,9 +242,9 @@ void PairEIMOMP::eval(int iifrom, int iito, ThrData * const thr)
 #if defined(_OPENMP)
 #pragma omp master
 #endif
-    { 
+    {
       rhofp = 2;
-      comm->reverse_comm_pair(this); 
+      comm->reverse_comm_pair(this);
     }
 
   } else {
@@ -257,9 +257,9 @@ void PairEIMOMP::eval(int iifrom, int iito, ThrData * const thr)
 #if defined(_OPENMP)
 #pragma omp master
 #endif
-  { 
+  {
     rhofp = 2;
-    comm->forward_comm_pair(this); 
+    comm->forward_comm_pair(this);
   }
 
   // wait until master is finished communicating
@@ -298,12 +298,12 @@ void PairEIMOMP::eval(int iifrom, int iito, ThrData * const thr)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cutforcesq[itype][jtype]) {
-	r = sqrt(rsq);
-	p = r*rdr + 1.0;
-	m = static_cast<int> (p);
-	m = MIN(m,nr-1);
-	p -= m;
-	p = MIN(p,1.0);
+        r = sqrt(rsq);
+        p = r*rdr + 1.0;
+        m = static_cast<int> (p);
+        m = MIN(m,nr-1);
+        p -= m;
+        p = MIN(p,1.0);
 
         // rhoip = derivative of (density at atom j due to atom i)
         // rhojp = derivative of (density at atom i due to atom j)
@@ -324,18 +324,18 @@ void PairEIMOMP::eval(int iifrom, int iito, ThrData * const thr)
                fp[i]*rhojp + fp[j]*rhoip;
         recip = 1.0/r;
         fpair = -psip*recip;
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) evdwl = phi-q0[itype]*q0[jtype]*coul;
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) evdwl = phi-q0[itype]*q0[jtype]*coul;
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_eim_omp.h b/src/USER-OMP/pair_eim_omp.h
index ad273e28eb..c63222d7fb 100644
--- a/src/USER-OMP/pair_eim_omp.h
+++ b/src/USER-OMP/pair_eim_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_gauss_cut_omp.cpp b/src/USER-OMP/pair_gauss_cut_omp.cpp
index 09e27c18f2..cb54785627 100644
--- a/src/USER-OMP/pair_gauss_cut_omp.cpp
+++ b/src/USER-OMP/pair_gauss_cut_omp.cpp
@@ -56,11 +56,11 @@ void PairGaussCutOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -118,27 +118,27 @@ void PairGaussCutOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	rexp = (r-rmh[itype][jtype])/sigmah[itype][jtype];
-	ugauss = pgauss[itype][jtype]*exp(-0.5*rexp*rexp); 
-	fpair = factor_lj*rexp/r*ugauss/sigmah[itype][jtype];
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = ugauss - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r = sqrt(rsq);
+        rexp = (r-rmh[itype][jtype])/sigmah[itype][jtype];
+        ugauss = pgauss[itype][jtype]*exp(-0.5*rexp*rexp);
+        fpair = factor_lj*rexp/r*ugauss/sigmah[itype][jtype];
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = ugauss - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_gauss_cut_omp.h b/src/USER-OMP/pair_gauss_cut_omp.h
index d3da26abed..2da2c14fdb 100644
--- a/src/USER-OMP/pair_gauss_cut_omp.h
+++ b/src/USER-OMP/pair_gauss_cut_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_gauss_omp.cpp b/src/USER-OMP/pair_gauss_omp.cpp
index 3de24e18d2..ae8af0d774 100644
--- a/src/USER-OMP/pair_gauss_omp.cpp
+++ b/src/USER-OMP/pair_gauss_omp.cpp
@@ -58,11 +58,11 @@ void PairGaussOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) occ = eval<1,1,1>(ifrom, ito, thr);
-	else occ = eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) occ = eval<1,1,1>(ifrom, ito, thr);
+        else occ = eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) occ = eval<1,0,1>(ifrom, ito, thr);
-	else occ = eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) occ = eval<1,0,1>(ifrom, ito, thr);
+        else occ = eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) occ = eval<0,0,1>(ifrom, ito, thr);
@@ -122,34 +122,34 @@ double PairGaussOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       // define a Gaussian well to be occupied if
-      // the site it interacts with is within the force maximum    
-    
+      // the site it interacts with is within the force maximum
+
       if (EFLAG)
-	if (eflag_global && rsq < 0.5/b[itype][jtype]) occ++;
+        if (eflag_global && rsq < 0.5/b[itype][jtype]) occ++;
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	forcelj = - 2.0*a[itype][jtype]*b[itype][jtype] * rsq * 
-	  exp(-b[itype][jtype]*rsq); 
-	fpair = factor_lj*forcelj*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = -(a[itype][jtype]*exp(-b[itype][jtype]*rsq) -
-		    offset[itype][jtype]);
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        forcelj = - 2.0*a[itype][jtype]*b[itype][jtype] * rsq *
+          exp(-b[itype][jtype]*rsq);
+        fpair = factor_lj*forcelj*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = -(a[itype][jtype]*exp(-b[itype][jtype]*rsq) -
+                    offset[itype][jtype]);
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_gauss_omp.h b/src/USER-OMP/pair_gauss_omp.h
index 81d9d0ce3f..a65a98730a 100644
--- a/src/USER-OMP/pair_gauss_omp.h
+++ b/src/USER-OMP/pair_gauss_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_gayberne_omp.cpp b/src/USER-OMP/pair_gayberne_omp.cpp
index f12b84f3f5..98fa5428a2 100644
--- a/src/USER-OMP/pair_gayberne_omp.cpp
+++ b/src/USER-OMP/pair_gayberne_omp.cpp
@@ -58,11 +58,11 @@ void PairGayBerneOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -134,81 +134,81 @@ void PairGayBerneOMP::eval(int iifrom, int iito, ThrData * const thr)
 
       if (rsq < cutsq[itype][jtype]) {
 
-	switch (form[itype][jtype]) {
-	case SPHERE_SPHERE:
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  forcelj *= -r2inv;
-	  if (EFLAG) 
-	    one_eng = r6inv*(r6inv*lj3[itype][jtype]-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	  fforce[0] = r12[0]*forcelj;
-	  fforce[1] = r12[1]*forcelj;
-	  fforce[2] = r12[2]*forcelj;
-	  ttor[0] = ttor[1] = ttor[2] = 0.0;
-	  rtor[0] = rtor[1] = rtor[2] = 0.0;
-	  break;
+        switch (form[itype][jtype]) {
+        case SPHERE_SPHERE:
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          forcelj *= -r2inv;
+          if (EFLAG)
+            one_eng = r6inv*(r6inv*lj3[itype][jtype]-lj4[itype][jtype]) -
+              offset[itype][jtype];
+          fforce[0] = r12[0]*forcelj;
+          fforce[1] = r12[1]*forcelj;
+          fforce[2] = r12[2]*forcelj;
+          ttor[0] = ttor[1] = ttor[2] = 0.0;
+          rtor[0] = rtor[1] = rtor[2] = 0.0;
+          break;
 
         case SPHERE_ELLIPSE:
-	  jquat = bonus[ellipsoid[j]].quat;
-	  MathExtra::quat_to_mat_trans(jquat,a2);
-	  MathExtra::diag_times3(well[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,b2);
-	  MathExtra::diag_times3(shape2[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,g2);
-	  one_eng = gayberne_lj(j,i,a2,b2,g2,r12,rsq,fforce,rtor);
-	  ttor[0] = ttor[1] = ttor[2] = 0.0;
-	  break;
+          jquat = bonus[ellipsoid[j]].quat;
+          MathExtra::quat_to_mat_trans(jquat,a2);
+          MathExtra::diag_times3(well[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,b2);
+          MathExtra::diag_times3(shape2[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,g2);
+          one_eng = gayberne_lj(j,i,a2,b2,g2,r12,rsq,fforce,rtor);
+          ttor[0] = ttor[1] = ttor[2] = 0.0;
+          break;
 
         case ELLIPSE_SPHERE:
-	  one_eng = gayberne_lj(i,j,a1,b1,g1,r12,rsq,fforce,ttor);
-	  rtor[0] = rtor[1] = rtor[2] = 0.0;
-	  break;
-
-	default:
-	  jquat = bonus[ellipsoid[j]].quat;
-	  MathExtra::quat_to_mat_trans(jquat,a2);
-	  MathExtra::diag_times3(well[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,b2);
-	  MathExtra::diag_times3(shape2[jtype],a2,temp);
-	  MathExtra::transpose_times3(a2,temp,g2);
-	  one_eng = gayberne_analytic(i,j,a1,a2,b1,b2,g1,g2,r12,rsq,
-				      fforce,ttor,rtor);
-	  break;
-	}
+          one_eng = gayberne_lj(i,j,a1,b1,g1,r12,rsq,fforce,ttor);
+          rtor[0] = rtor[1] = rtor[2] = 0.0;
+          break;
+
+        default:
+          jquat = bonus[ellipsoid[j]].quat;
+          MathExtra::quat_to_mat_trans(jquat,a2);
+          MathExtra::diag_times3(well[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,b2);
+          MathExtra::diag_times3(shape2[jtype],a2,temp);
+          MathExtra::transpose_times3(a2,temp,g2);
+          one_eng = gayberne_analytic(i,j,a1,a2,b1,b2,g1,g2,r12,rsq,
+                                      fforce,ttor,rtor);
+          break;
+        }
 
         fforce[0] *= factor_lj;
-	fforce[1] *= factor_lj;
-	fforce[2] *= factor_lj;
+        fforce[1] *= factor_lj;
+        fforce[2] *= factor_lj;
         ttor[0] *= factor_lj;
-	ttor[1] *= factor_lj;
-	ttor[2] *= factor_lj;
+        ttor[1] *= factor_lj;
+        ttor[2] *= factor_lj;
 
         fxtmp += fforce[0];
-	fytmp += fforce[1];
-	fztmp += fforce[2];
+        fytmp += fforce[1];
+        fztmp += fforce[2];
         t1tmp += ttor[0];
-	t2tmp += ttor[1];
-	t3tmp += ttor[2];
+        t2tmp += ttor[1];
+        t3tmp += ttor[2];
 
         if (NEWTON_PAIR || j < nlocal) {
           rtor[0] *= factor_lj;
-	  rtor[1] *= factor_lj;
-	  rtor[2] *= factor_lj;
+          rtor[1] *= factor_lj;
+          rtor[2] *= factor_lj;
           f[j][0] -= fforce[0];
-	  f[j][1] -= fforce[1];
-	  f[j][2] -= fforce[2];
+          f[j][1] -= fforce[1];
+          f[j][2] -= fforce[2];
           tor[j][0] += rtor[0];
-	  tor[j][1] += rtor[1];
-	  tor[j][2] += rtor[2];
+          tor[j][1] += rtor[1];
+          tor[j][2] += rtor[2];
         }
 
         if (EFLAG) evdwl = factor_lj*one_eng;
 
-	if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,
-				     evdwl,0.0,fforce[0],fforce[1],fforce[2],
-				     -r12[0],-r12[1],-r12[2],thr);
+        if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                     evdwl,0.0,fforce[0],fforce[1],fforce[2],
+                                     -r12[0],-r12[1],-r12[2],thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_gayberne_omp.h b/src/USER-OMP/pair_gayberne_omp.h
index 0bd0b8b086..0e7b6708ff 100644
--- a/src/USER-OMP/pair_gayberne_omp.h
+++ b/src/USER-OMP/pair_gayberne_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_gran_hertz_history_omp.cpp b/src/USER-OMP/pair_gran_hertz_history_omp.cpp
index 283b3532e3..4de7f12bad 100644
--- a/src/USER-OMP/pair_gran_hertz_history_omp.cpp
+++ b/src/USER-OMP/pair_gran_hertz_history_omp.cpp
@@ -60,7 +60,7 @@ void PairGranHertzHistoryOMP::compute(int eflag, int vflag)
     if (evflag)
       if (shearupdate) eval<1,1>(ifrom, ito, thr);
       else eval<1,0>(ifrom, ito, thr);
-    else 
+    else
       if (shearupdate) eval<0,1>(ifrom, ito, thr);
       else eval<0,0>(ifrom, ito, thr);
 
@@ -133,145 +133,145 @@ void PairGranHertzHistoryOMP::eval(int iifrom, int iito, ThrData * const thr)
 
       if (rsq >= radsum*radsum) {
 
-	// unset non-touching neighbors
+        // unset non-touching neighbors
 
         touch[jj] = 0;
-	shear = &allshear[3*jj];
+        shear = &allshear[3*jj];
         shear[0] = 0.0;
         shear[1] = 0.0;
         shear[2] = 0.0;
 
       } else {
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	rsqinv = 1.0/rsq;
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        rsqinv = 1.0/rsq;
 
-	// relative translational velocity
+        // relative translational velocity
 
-	vr1 = v[i][0] - v[j][0];
-	vr2 = v[i][1] - v[j][1];
-	vr3 = v[i][2] - v[j][2];
+        vr1 = v[i][0] - v[j][0];
+        vr2 = v[i][1] - v[j][1];
+        vr3 = v[i][2] - v[j][2];
 
-	// normal component
+        // normal component
 
-	vnnr = vr1*delx + vr2*dely + vr3*delz;
-	vn1 = delx*vnnr * rsqinv;
-	vn2 = dely*vnnr * rsqinv;
-	vn3 = delz*vnnr * rsqinv;
+        vnnr = vr1*delx + vr2*dely + vr3*delz;
+        vn1 = delx*vnnr * rsqinv;
+        vn2 = dely*vnnr * rsqinv;
+        vn3 = delz*vnnr * rsqinv;
 
-	// tangential component
+        // tangential component
 
-	vt1 = vr1 - vn1;
-	vt2 = vr2 - vn2;
-	vt3 = vr3 - vn3;
+        vt1 = vr1 - vn1;
+        vt2 = vr2 - vn2;
+        vt3 = vr3 - vn3;
 
-	// relative rotational velocity
+        // relative rotational velocity
 
-	wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
-	wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
-	wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
+        wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
+        wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
+        wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
 
-	// normal force = Hertzian contact + normal velocity damping
+        // normal force = Hertzian contact + normal velocity damping
 
-	if (rmass) {
-	  meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
-	  if (mask[i] & freeze_group_bit) meff = rmass[j];
-	  if (mask[j] & freeze_group_bit) meff = rmass[i];
-	} else {
-	  itype = type[i];
-	  jtype = type[j];
-	  meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
-	  if (mask[i] & freeze_group_bit) meff = mass[jtype];
-	  if (mask[j] & freeze_group_bit) meff = mass[itype];
-	}
+        if (rmass) {
+          meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
+          if (mask[i] & freeze_group_bit) meff = rmass[j];
+          if (mask[j] & freeze_group_bit) meff = rmass[i];
+        } else {
+          itype = type[i];
+          jtype = type[j];
+          meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
+          if (mask[i] & freeze_group_bit) meff = mass[jtype];
+          if (mask[j] & freeze_group_bit) meff = mass[itype];
+        }
 
-	damp = meff*gamman*vnnr*rsqinv;
-	ccel = kn*(radsum-r)*rinv - damp;
-	polyhertz = sqrt((radsum-r)*radi*radj / radsum);
-	ccel *= polyhertz;
+        damp = meff*gamman*vnnr*rsqinv;
+        ccel = kn*(radsum-r)*rinv - damp;
+        polyhertz = sqrt((radsum-r)*radi*radj / radsum);
+        ccel *= polyhertz;
 
-	// relative velocities
+        // relative velocities
 
-	vtr1 = vt1 - (delz*wr2-dely*wr3);
-	vtr2 = vt2 - (delx*wr3-delz*wr1);
-	vtr3 = vt3 - (dely*wr1-delx*wr2);
-	vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
-	vrel = sqrt(vrel);
+        vtr1 = vt1 - (delz*wr2-dely*wr3);
+        vtr2 = vt2 - (delx*wr3-delz*wr1);
+        vtr3 = vt3 - (dely*wr1-delx*wr2);
+        vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
+        vrel = sqrt(vrel);
 
-	// shear history effects
+        // shear history effects
 
-	touch[jj] = 1;
-	shear = &allshear[3*jj];
+        touch[jj] = 1;
+        shear = &allshear[3*jj];
 
-	if (SHEARUPDATE) {
-	  shear[0] += vtr1*dt;
-	  shear[1] += vtr2*dt;
-	  shear[2] += vtr3*dt;
-	}
+        if (SHEARUPDATE) {
+          shear[0] += vtr1*dt;
+          shear[1] += vtr2*dt;
+          shear[2] += vtr3*dt;
+        }
         shrmag = sqrt(shear[0]*shear[0] + shear[1]*shear[1] +
-		      shear[2]*shear[2]);
+                      shear[2]*shear[2]);
 
-	// rotate shear displacements
+        // rotate shear displacements
 
-	rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
-	rsht *= rsqinv;
-	if (SHEARUPDATE) {
-	  shear[0] -= rsht*delx;
-	  shear[1] -= rsht*dely;
-	  shear[2] -= rsht*delz;
-	}
+        rsht = shear[0]*delx + shear[1]*dely + shear[2]*delz;
+        rsht *= rsqinv;
+        if (SHEARUPDATE) {
+          shear[0] -= rsht*delx;
+          shear[1] -= rsht*dely;
+          shear[2] -= rsht*delz;
+        }
 
-	// tangential forces = shear + tangential velocity damping
+        // tangential forces = shear + tangential velocity damping
 
         fs1 = -polyhertz * (kt*shear[0] + meff*gammat*vtr1);
         fs2 = -polyhertz * (kt*shear[1] + meff*gammat*vtr2);
         fs3 = -polyhertz * (kt*shear[2] + meff*gammat*vtr3);
 
-	// rescale frictional displacements and forces if needed
-
-	fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
-	fn = xmu * fabs(ccel*r);
-
-	if (fs > fn) {
-	  if (shrmag != 0.0) {
-	    const double fnfs = fn/fs;
-	    const double mgkt = meff*gammat/kt;
-	    shear[0] = fnfs * (shear[0] + mgkt*vtr1) - mgkt*vtr1;
-	    shear[1] = fnfs * (shear[1] + mgkt*vtr2) - mgkt*vtr2;
-	    shear[2] = fnfs * (shear[2] + mgkt*vtr3) - mgkt*vtr3;
-	    fs1 *= fnfs;
-	    fs2 *= fnfs;
-	    fs3 *= fnfs;
-	  } else fs1 = fs2 = fs3 = 0.0;
-	}
-
-	// forces & torques
-
-	fx = delx*ccel + fs1;
-	fy = dely*ccel + fs2;
-	fz = delz*ccel + fs3;
-	fxtmp  += fx;
-	fytmp  += fy;
-	fztmp  += fz;
-
-	tor1 = rinv * (dely*fs3 - delz*fs2);
-	tor2 = rinv * (delz*fs1 - delx*fs3);
-	tor3 = rinv * (delx*fs2 - dely*fs1);
-	t1tmp -= radi*tor1;
-	t2tmp -= radi*tor2;
-	t3tmp -= radi*tor3;
-
-	if (j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	  torque[j][0] -= radj*tor1;
-	  torque[j][1] -= radj*tor2;
-	  torque[j][2] -= radj*tor3;
-	}
-
-	if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,/* newton_pair */ 0,
-				     0.0,0.0,fx,fy,fz,delx,dely,delz,thr);
+        // rescale frictional displacements and forces if needed
+
+        fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
+        fn = xmu * fabs(ccel*r);
+
+        if (fs > fn) {
+          if (shrmag != 0.0) {
+            const double fnfs = fn/fs;
+            const double mgkt = meff*gammat/kt;
+            shear[0] = fnfs * (shear[0] + mgkt*vtr1) - mgkt*vtr1;
+            shear[1] = fnfs * (shear[1] + mgkt*vtr2) - mgkt*vtr2;
+            shear[2] = fnfs * (shear[2] + mgkt*vtr3) - mgkt*vtr3;
+            fs1 *= fnfs;
+            fs2 *= fnfs;
+            fs3 *= fnfs;
+          } else fs1 = fs2 = fs3 = 0.0;
+        }
+
+        // forces & torques
+
+        fx = delx*ccel + fs1;
+        fy = dely*ccel + fs2;
+        fz = delz*ccel + fs3;
+        fxtmp  += fx;
+        fytmp  += fy;
+        fztmp  += fz;
+
+        tor1 = rinv * (dely*fs3 - delz*fs2);
+        tor2 = rinv * (delz*fs1 - delx*fs3);
+        tor3 = rinv * (delx*fs2 - dely*fs1);
+        t1tmp -= radi*tor1;
+        t2tmp -= radi*tor2;
+        t3tmp -= radi*tor3;
+
+        if (j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+          torque[j][0] -= radj*tor1;
+          torque[j][1] -= radj*tor2;
+          torque[j][2] -= radj*tor3;
+        }
+
+        if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,/* newton_pair */ 0,
+                                     0.0,0.0,fx,fy,fz,delx,dely,delz,thr);
 
       }
     }
diff --git a/src/USER-OMP/pair_gran_hertz_history_omp.h b/src/USER-OMP/pair_gran_hertz_history_omp.h
index 956e057093..1a8d819920 100644
--- a/src/USER-OMP/pair_gran_hertz_history_omp.h
+++ b/src/USER-OMP/pair_gran_hertz_history_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_gran_hooke_history_omp.cpp b/src/USER-OMP/pair_gran_hooke_history_omp.cpp
index 42ba42a1bc..dc298de7e5 100644
--- a/src/USER-OMP/pair_gran_hooke_history_omp.cpp
+++ b/src/USER-OMP/pair_gran_hooke_history_omp.cpp
@@ -65,7 +65,7 @@ void PairGranHookeHistoryOMP::compute(int eflag, int vflag)
     if (evflag)
       if (shearupdate) eval<1,1>(ifrom, ito, thr);
       else eval<1,0>(ifrom, ito, thr);
-    else 
+    else
       if (shearupdate) eval<0,1>(ifrom, ito, thr);
       else eval<0,0>(ifrom, ito, thr);
 
@@ -139,7 +139,7 @@ void PairGranHookeHistoryOMP::eval(int iifrom, int iito, ThrData * const thr)
 
       if (rsq >= radsum*radsum) {
 
-	// unset non-touching neighbors
+        // unset non-touching neighbors
 
         touch[jj] = 0;
         myshear[0] = 0.0;
@@ -147,133 +147,133 @@ void PairGranHookeHistoryOMP::eval(int iifrom, int iito, ThrData * const thr)
         myshear[2] = 0.0;
 
       } else {
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	rsqinv = 1.0/rsq;
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        rsqinv = 1.0/rsq;
 
-	// relative translational velocity
+        // relative translational velocity
 
-	vr1 = v[i][0] - v[j][0];
-	vr2 = v[i][1] - v[j][1];
-	vr3 = v[i][2] - v[j][2];
+        vr1 = v[i][0] - v[j][0];
+        vr2 = v[i][1] - v[j][1];
+        vr3 = v[i][2] - v[j][2];
 
-	// normal component
+        // normal component
 
-	vnnr = vr1*delx + vr2*dely + vr3*delz;
-	vn1 = delx*vnnr * rsqinv;
-	vn2 = dely*vnnr * rsqinv;
-	vn3 = delz*vnnr * rsqinv;
+        vnnr = vr1*delx + vr2*dely + vr3*delz;
+        vn1 = delx*vnnr * rsqinv;
+        vn2 = dely*vnnr * rsqinv;
+        vn3 = delz*vnnr * rsqinv;
 
-	// tangential component
+        // tangential component
 
-	vt1 = vr1 - vn1;
-	vt2 = vr2 - vn2;
-	vt3 = vr3 - vn3;
+        vt1 = vr1 - vn1;
+        vt2 = vr2 - vn2;
+        vt3 = vr3 - vn3;
 
-	// relative rotational velocity
+        // relative rotational velocity
 
-	wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
-	wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
-	wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
+        wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
+        wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
+        wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
 
-	// normal forces = Hookian contact + normal velocity damping
+        // normal forces = Hookian contact + normal velocity damping
 
-	if (rmass) {
-	  meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
-	  if (mask[i] & freeze_group_bit) meff = rmass[j];
-	  if (mask[j] & freeze_group_bit) meff = rmass[i];
-	} else {
-	  jtype = type[j];
-	  meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
-	  if (mask[i] & freeze_group_bit) meff = mass[jtype];
-	  if (mask[j] & freeze_group_bit) meff = mass[itype];
-	}
+        if (rmass) {
+          meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
+          if (mask[i] & freeze_group_bit) meff = rmass[j];
+          if (mask[j] & freeze_group_bit) meff = rmass[i];
+        } else {
+          jtype = type[j];
+          meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
+          if (mask[i] & freeze_group_bit) meff = mass[jtype];
+          if (mask[j] & freeze_group_bit) meff = mass[itype];
+        }
 
-	damp = meff*gamman*vnnr*rsqinv;
-	ccel = kn*(radsum-r)*rinv - damp;
+        damp = meff*gamman*vnnr*rsqinv;
+        ccel = kn*(radsum-r)*rinv - damp;
 
-	// relative velocities
+        // relative velocities
 
-	vtr1 = vt1 - (delz*wr2-dely*wr3);
-	vtr2 = vt2 - (delx*wr3-delz*wr1);
-	vtr3 = vt3 - (dely*wr1-delx*wr2);
-	vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
-	vrel = sqrt(vrel);
+        vtr1 = vt1 - (delz*wr2-dely*wr3);
+        vtr2 = vt2 - (delx*wr3-delz*wr1);
+        vtr3 = vt3 - (dely*wr1-delx*wr2);
+        vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
+        vrel = sqrt(vrel);
 
-	// shear history effects
+        // shear history effects
 
-	touch[jj] = 1;
-	memcpy(myshear,allshear + 3*jj, 3*sizeof(double));
+        touch[jj] = 1;
+        memcpy(myshear,allshear + 3*jj, 3*sizeof(double));
 
-	if (SHEARUPDATE) {
-	  myshear[0] += vtr1*dt;
-	  myshear[1] += vtr2*dt;
-	  myshear[2] += vtr3*dt;
-	}
+        if (SHEARUPDATE) {
+          myshear[0] += vtr1*dt;
+          myshear[1] += vtr2*dt;
+          myshear[2] += vtr3*dt;
+        }
         shrmag = sqrt(myshear[0]*myshear[0] + myshear[1]*myshear[1] +
-		      myshear[2]*myshear[2]);
-
-	// rotate shear displacements
-
-	rsht = myshear[0]*delx + myshear[1]*dely + myshear[2]*delz;
-	rsht *= rsqinv;
-	if (SHEARUPDATE) {
-	  myshear[0] -= rsht*delx;
-	  myshear[1] -= rsht*dely;
-	  myshear[2] -= rsht*delz;
-	}
-
-	// tangential forces = shear + tangential velocity damping
-
-	fs1 = - (kt*myshear[0] + meff*gammat*vtr1);
-	fs2 = - (kt*myshear[1] + meff*gammat*vtr2);
-	fs3 = - (kt*myshear[2] + meff*gammat*vtr3);
-
-	// rescale frictional displacements and forces if needed
-
-	fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
-	fn = xmu * fabs(ccel*r);
-
-	if (fs > fn) {
-	  if (shrmag != 0.0) {
-	    const double fnfs = fn/fs;
-	    const double mgkt = meff*gammat/kt;
-	    myshear[0] = fnfs * (myshear[0] + mgkt*vtr1) - mgkt*vtr1;
-	    myshear[1] = fnfs * (myshear[1] + mgkt*vtr2) - mgkt*vtr2;
-	    myshear[2] = fnfs * (myshear[2] + mgkt*vtr3) - mgkt*vtr3;
-	    fs1 *= fnfs;
-	    fs2 *= fnfs;
-	    fs3 *= fnfs;
-	  } else fs1 = fs2 = fs3 = 0.0;
-	}
-
-	// forces & torques
-
-	fx = delx*ccel + fs1;
-	fy = dely*ccel + fs2;
-	fz = delz*ccel + fs3;
-	fxtmp  += fx;
-	fytmp  += fy;
-	fztmp  += fz;
-
-	tor1 = rinv * (dely*fs3 - delz*fs2);
-	tor2 = rinv * (delz*fs1 - delx*fs3);
-	tor3 = rinv * (delx*fs2 - dely*fs1);
-	t1tmp -= radi*tor1;
-	t2tmp -= radi*tor2;
-	t3tmp -= radi*tor3;
-
-	if (j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	  torque[j][0] -= radj*tor1;
-	  torque[j][1] -= radj*tor2;
-	  torque[j][2] -= radj*tor3;
-	}
-
-	if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,/* newton_pair */ 0,
-				     0.0,0.0,fx,fy,fz,delx,dely,delz,thr);
+                      myshear[2]*myshear[2]);
+
+        // rotate shear displacements
+
+        rsht = myshear[0]*delx + myshear[1]*dely + myshear[2]*delz;
+        rsht *= rsqinv;
+        if (SHEARUPDATE) {
+          myshear[0] -= rsht*delx;
+          myshear[1] -= rsht*dely;
+          myshear[2] -= rsht*delz;
+        }
+
+        // tangential forces = shear + tangential velocity damping
+
+        fs1 = - (kt*myshear[0] + meff*gammat*vtr1);
+        fs2 = - (kt*myshear[1] + meff*gammat*vtr2);
+        fs3 = - (kt*myshear[2] + meff*gammat*vtr3);
+
+        // rescale frictional displacements and forces if needed
+
+        fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3);
+        fn = xmu * fabs(ccel*r);
+
+        if (fs > fn) {
+          if (shrmag != 0.0) {
+            const double fnfs = fn/fs;
+            const double mgkt = meff*gammat/kt;
+            myshear[0] = fnfs * (myshear[0] + mgkt*vtr1) - mgkt*vtr1;
+            myshear[1] = fnfs * (myshear[1] + mgkt*vtr2) - mgkt*vtr2;
+            myshear[2] = fnfs * (myshear[2] + mgkt*vtr3) - mgkt*vtr3;
+            fs1 *= fnfs;
+            fs2 *= fnfs;
+            fs3 *= fnfs;
+          } else fs1 = fs2 = fs3 = 0.0;
+        }
+
+        // forces & torques
+
+        fx = delx*ccel + fs1;
+        fy = dely*ccel + fs2;
+        fz = delz*ccel + fs3;
+        fxtmp  += fx;
+        fytmp  += fy;
+        fztmp  += fz;
+
+        tor1 = rinv * (dely*fs3 - delz*fs2);
+        tor2 = rinv * (delz*fs1 - delx*fs3);
+        tor3 = rinv * (delx*fs2 - dely*fs1);
+        t1tmp -= radi*tor1;
+        t2tmp -= radi*tor2;
+        t3tmp -= radi*tor3;
+
+        if (j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+          torque[j][0] -= radj*tor1;
+          torque[j][1] -= radj*tor2;
+          torque[j][2] -= radj*tor3;
+        }
+
+        if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,/* newton_pair */ 0,
+                                     0.0,0.0,fx,fy,fz,delx,dely,delz,thr);
 
       }
       memcpy(allshear + 3*jj, myshear, 3*sizeof(double));
diff --git a/src/USER-OMP/pair_gran_hooke_history_omp.h b/src/USER-OMP/pair_gran_hooke_history_omp.h
index 7588469e74..9cdebf7104 100644
--- a/src/USER-OMP/pair_gran_hooke_history_omp.h
+++ b/src/USER-OMP/pair_gran_hooke_history_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_gran_hooke_omp.cpp b/src/USER-OMP/pair_gran_hooke_omp.cpp
index 223acdbd4a..519384105e 100644
--- a/src/USER-OMP/pair_gran_hooke_omp.cpp
+++ b/src/USER-OMP/pair_gran_hooke_omp.cpp
@@ -57,7 +57,7 @@ void PairGranHookeOMP::compute(int eflag, int vflag)
     if (evflag)
       if (force->newton_pair) eval<1,1>(ifrom, ito, thr);
       else eval<1,0>(ifrom, ito, thr);
-    else 
+    else
       if (force->newton_pair) eval<0,1>(ifrom, ito, thr);
       else eval<0,0>(ifrom, ito, thr);
 
@@ -121,100 +121,100 @@ void PairGranHookeOMP::eval(int iifrom, int iito, ThrData * const thr)
       radsum = radi + radj;
 
       if (rsq < radsum*radsum) {
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	rsqinv = 1.0/rsq;
-
-	// relative translational velocity
-
-	vr1 = v[i][0] - v[j][0];
-	vr2 = v[i][1] - v[j][1];
-	vr3 = v[i][2] - v[j][2];
-
-	// normal component
-
-	vnnr = vr1*delx + vr2*dely + vr3*delz;
-	vn1 = delx*vnnr * rsqinv;
-	vn2 = dely*vnnr * rsqinv;
-	vn3 = delz*vnnr * rsqinv;
-
-	// tangential component
-
-	vt1 = vr1 - vn1;
-	vt2 = vr2 - vn2;
-	vt3 = vr3 - vn3;
-
-	// relative rotational velocity
-
-	wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
-	wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
-	wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
-
-	// normal forces = Hookian contact + normal velocity damping
-
-	if (rmass) {
-	  meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
-	  if (mask[i] & freeze_group_bit) meff = rmass[j];
-	  if (mask[j] & freeze_group_bit) meff = rmass[i];
-	} else {
-	  itype = type[i];
-	  jtype = type[j];
-	  meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
-	  if (mask[i] & freeze_group_bit) meff = mass[jtype];
-	  if (mask[j] & freeze_group_bit) meff = mass[itype];
-	}
-
-	damp = meff*gamman*vnnr*rsqinv;
-	ccel = kn*(radsum-r)*rinv - damp;
-
-	// relative velocities
-
-	vtr1 = vt1 - (delz*wr2-dely*wr3);
-	vtr2 = vt2 - (delx*wr3-delz*wr1);
-	vtr3 = vt3 - (dely*wr1-delx*wr2);
-	vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
-	vrel = sqrt(vrel);
-
-	// force normalization
-
-	fn = xmu * fabs(ccel*r);
-	fs = meff*gammat*vrel;
-	if (vrel != 0.0) ft = MIN(fn,fs) / vrel;
-	else ft = 0.0;
-
-	// tangential force due to tangential velocity damping
-
-	fs1 = -ft*vtr1;
-	fs2 = -ft*vtr2;
-	fs3 = -ft*vtr3;
-
-	// forces & torques
-
-	fx = delx*ccel + fs1;
-	fy = dely*ccel + fs2;
-	fz = delz*ccel + fs3;
-	fxtmp  += fx;
-	fytmp  += fy;
-	fztmp  += fz;
-
-	tor1 = rinv * (dely*fs3 - delz*fs2);
-	tor2 = rinv * (delz*fs1 - delx*fs3);
-	tor3 = rinv * (delx*fs2 - dely*fs1);
-	t1tmp -= radi*tor1;
-	t2tmp -= radi*tor2;
-	t3tmp -= radi*tor3;
-
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= fx;
-	  f[j][1] -= fy;
-	  f[j][2] -= fz;
-	  torque[j][0] -= radj*tor1;
-	  torque[j][1] -= radj*tor2;
-	  torque[j][2] -= radj*tor3;
-	}
-
-	if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,
-				     0.0,0.0,fx,fy,fz,delx,dely,delz,thr);
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        rsqinv = 1.0/rsq;
+
+        // relative translational velocity
+
+        vr1 = v[i][0] - v[j][0];
+        vr2 = v[i][1] - v[j][1];
+        vr3 = v[i][2] - v[j][2];
+
+        // normal component
+
+        vnnr = vr1*delx + vr2*dely + vr3*delz;
+        vn1 = delx*vnnr * rsqinv;
+        vn2 = dely*vnnr * rsqinv;
+        vn3 = delz*vnnr * rsqinv;
+
+        // tangential component
+
+        vt1 = vr1 - vn1;
+        vt2 = vr2 - vn2;
+        vt3 = vr3 - vn3;
+
+        // relative rotational velocity
+
+        wr1 = (radi*omega[i][0] + radj*omega[j][0]) * rinv;
+        wr2 = (radi*omega[i][1] + radj*omega[j][1]) * rinv;
+        wr3 = (radi*omega[i][2] + radj*omega[j][2]) * rinv;
+
+        // normal forces = Hookian contact + normal velocity damping
+
+        if (rmass) {
+          meff = rmass[i]*rmass[j] / (rmass[i]+rmass[j]);
+          if (mask[i] & freeze_group_bit) meff = rmass[j];
+          if (mask[j] & freeze_group_bit) meff = rmass[i];
+        } else {
+          itype = type[i];
+          jtype = type[j];
+          meff = mass[itype]*mass[jtype] / (mass[itype]+mass[jtype]);
+          if (mask[i] & freeze_group_bit) meff = mass[jtype];
+          if (mask[j] & freeze_group_bit) meff = mass[itype];
+        }
+
+        damp = meff*gamman*vnnr*rsqinv;
+        ccel = kn*(radsum-r)*rinv - damp;
+
+        // relative velocities
+
+        vtr1 = vt1 - (delz*wr2-dely*wr3);
+        vtr2 = vt2 - (delx*wr3-delz*wr1);
+        vtr3 = vt3 - (dely*wr1-delx*wr2);
+        vrel = vtr1*vtr1 + vtr2*vtr2 + vtr3*vtr3;
+        vrel = sqrt(vrel);
+
+        // force normalization
+
+        fn = xmu * fabs(ccel*r);
+        fs = meff*gammat*vrel;
+        if (vrel != 0.0) ft = MIN(fn,fs) / vrel;
+        else ft = 0.0;
+
+        // tangential force due to tangential velocity damping
+
+        fs1 = -ft*vtr1;
+        fs2 = -ft*vtr2;
+        fs3 = -ft*vtr3;
+
+        // forces & torques
+
+        fx = delx*ccel + fs1;
+        fy = dely*ccel + fs2;
+        fz = delz*ccel + fs3;
+        fxtmp  += fx;
+        fytmp  += fy;
+        fztmp  += fz;
+
+        tor1 = rinv * (dely*fs3 - delz*fs2);
+        tor2 = rinv * (delz*fs1 - delx*fs3);
+        tor3 = rinv * (delx*fs2 - dely*fs1);
+        t1tmp -= radi*tor1;
+        t2tmp -= radi*tor2;
+        t3tmp -= radi*tor3;
+
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= fx;
+          f[j][1] -= fy;
+          f[j][2] -= fz;
+          torque[j][0] -= radj*tor1;
+          torque[j][1] -= radj*tor2;
+          torque[j][2] -= radj*tor3;
+        }
+
+        if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                     0.0,0.0,fx,fy,fz,delx,dely,delz,thr);
 
       }
     }
diff --git a/src/USER-OMP/pair_gran_hooke_omp.h b/src/USER-OMP/pair_gran_hooke_omp.h
index b275992bfa..81f831fcea 100644
--- a/src/USER-OMP/pair_gran_hooke_omp.h
+++ b/src/USER-OMP/pair_gran_hooke_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp
index 074271a193..8e4b8a7a90 100644
--- a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp
+++ b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp
@@ -83,11 +83,11 @@ void PairHbondDreidingLJOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -135,7 +135,7 @@ void PairHbondDreidingLJOMP::eval(int iifrom, int iito, ThrData * const thr)
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
 
-  
+
   // ii = loop over donors
   // jj = loop over acceptors
   // kk = loop over hydrogens bonded to donor
@@ -173,107 +173,107 @@ void PairHbondDreidingLJOMP::eval(int iifrom, int iito, ThrData * const thr)
       rsq = delx*delx + dely*dely + delz*delz;
 
       for (kk = 0; kk < knum; kk++) {
-	k = atom->map(klist[kk]);
-	if (k < 0) continue;
-	ktype = type[k];
-	m = type2param[itype][jtype][ktype];
-	if (m < 0) continue;
-	pm = &params[m];
-
-	if (rsq < pm->cut_outersq) {
-	  delr1[0] = xtmp - x[k][0];
-	  delr1[1] = ytmp - x[k][1];
-	  delr1[2] = ztmp - x[k][2];
-	  domain->minimum_image(delr1);
-	  rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
-	  r1 = sqrt(rsq1);
-	  
-	  delr2[0] = x[j][0] - x[k][0];
-	  delr2[1] = x[j][1] - x[k][1];
-	  delr2[2] = x[j][2] - x[k][2];
-	  domain->minimum_image(delr2);
-	  rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
-	  r2 = sqrt(rsq2);
-	  
-	  // angle (cos and sin)
-	  
-	  c = delr1[0]*delr2[0] + delr1[1]*delr2[1] + delr1[2]*delr2[2];
-	  c /= r1*r2;
-	  if (c > 1.0) c = 1.0;
-	  if (c < -1.0) c = -1.0;
-	  ac = acos(c);
-
-	  if (ac > pm->cut_angle && ac < (2.0*MY_PI - pm->cut_angle)) {
-	    s = sqrt(1.0 - c*c);
-	    if (s < SMALL) s = SMALL;
-
-	    // LJ-specific kernel
-
-	    r2inv = 1.0/rsq;
-	    r10inv = r2inv*r2inv*r2inv*r2inv*r2inv;
-	    force_kernel = r10inv*(pm->lj1*r2inv - pm->lj2)*r2inv * 
-	      pow(c,(double)pm->ap);
-	    force_angle = pm->ap * r10inv*(pm->lj3*r2inv - pm->lj4) * 
-	      pow(c,pm->ap-1.0)*s;
-
-	    eng_lj = r10inv*(pm->lj3*r2inv - pm->lj4);
-	    if (rsq > pm->cut_innersq) {
-	      switch1 = (pm->cut_outersq-rsq) * (pm->cut_outersq-rsq) * 
-			(pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
-			pm->denom_vdw;
-	      switch2 = 12.0*rsq * (pm->cut_outersq-rsq) *
-			(rsq-pm->cut_innersq) / pm->denom_vdw;
-	      force_kernel = force_kernel*switch1 + eng_lj*switch2;
-	      eng_lj *= switch1;
-	    }
-
-	    if (EFLAG) {
-	      evdwl = eng_lj * pow(c,(double)pm->ap);
-	      evdwl *= factor_hb;
-	    }
-
-	    a = factor_hb*force_angle/s;
-	    b = factor_hb*force_kernel;
-	    
-	    a11 = a*c / rsq1;
-	    a12 = -a / (r1*r2);
-	    a22 = a*c / rsq2;
-	    
-	    vx1 = a11*delr1[0] + a12*delr2[0];
-	    vx2 = a22*delr2[0] + a12*delr1[0];
-	    vy1 = a11*delr1[1] + a12*delr2[1];
-	    vy2 = a22*delr2[1] + a12*delr1[1];
-	    vz1 = a11*delr1[2] + a12*delr2[2];
-	    vz2 = a22*delr2[2] + a12*delr1[2];
-	    
-	    fi[0] = vx1 + b*delx;
-	    fi[1] = vy1 + b*dely;
-	    fi[2] = vz1 + b*delz;
-	    fj[0] = vx2 - b*delx;
-	    fj[1] = vy2 - b*dely;
-	    fj[2] = vz2 - b*delz;
-
-	    fxtmp += fi[0];
-	    fytmp += fi[1];
-	    fztmp += fi[2];
-
-	    f[j][0] += fj[0];
-	    f[j][1] += fj[1];
-	    f[j][2] += fj[2];
-	    
-	    f[k][0] -= vx1 + vx2;
-	    f[k][1] -= vy1 + vy2;
-	    f[k][2] -= vz1 + vz2;
-
-	    // KIJ instead of IJK b/c delr1/delr2 are both with respect to k
-
-	    if (EVFLAG) ev_tally3_thr(this,k,i,j,evdwl,0.0,fi,fj,delr1,delr2,thr);
-	    if (EFLAG) {
-	      hbcount++;
-	      hbeng += evdwl;
-	    }
-	  }
-	}
+        k = atom->map(klist[kk]);
+        if (k < 0) continue;
+        ktype = type[k];
+        m = type2param[itype][jtype][ktype];
+        if (m < 0) continue;
+        pm = &params[m];
+
+        if (rsq < pm->cut_outersq) {
+          delr1[0] = xtmp - x[k][0];
+          delr1[1] = ytmp - x[k][1];
+          delr1[2] = ztmp - x[k][2];
+          domain->minimum_image(delr1);
+          rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
+          r1 = sqrt(rsq1);
+
+          delr2[0] = x[j][0] - x[k][0];
+          delr2[1] = x[j][1] - x[k][1];
+          delr2[2] = x[j][2] - x[k][2];
+          domain->minimum_image(delr2);
+          rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
+          r2 = sqrt(rsq2);
+
+          // angle (cos and sin)
+
+          c = delr1[0]*delr2[0] + delr1[1]*delr2[1] + delr1[2]*delr2[2];
+          c /= r1*r2;
+          if (c > 1.0) c = 1.0;
+          if (c < -1.0) c = -1.0;
+          ac = acos(c);
+
+          if (ac > pm->cut_angle && ac < (2.0*MY_PI - pm->cut_angle)) {
+            s = sqrt(1.0 - c*c);
+            if (s < SMALL) s = SMALL;
+
+            // LJ-specific kernel
+
+            r2inv = 1.0/rsq;
+            r10inv = r2inv*r2inv*r2inv*r2inv*r2inv;
+            force_kernel = r10inv*(pm->lj1*r2inv - pm->lj2)*r2inv *
+              pow(c,(double)pm->ap);
+            force_angle = pm->ap * r10inv*(pm->lj3*r2inv - pm->lj4) *
+              pow(c,pm->ap-1.0)*s;
+
+            eng_lj = r10inv*(pm->lj3*r2inv - pm->lj4);
+            if (rsq > pm->cut_innersq) {
+              switch1 = (pm->cut_outersq-rsq) * (pm->cut_outersq-rsq) *
+                        (pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
+                        pm->denom_vdw;
+              switch2 = 12.0*rsq * (pm->cut_outersq-rsq) *
+                        (rsq-pm->cut_innersq) / pm->denom_vdw;
+              force_kernel = force_kernel*switch1 + eng_lj*switch2;
+              eng_lj *= switch1;
+            }
+
+            if (EFLAG) {
+              evdwl = eng_lj * pow(c,(double)pm->ap);
+              evdwl *= factor_hb;
+            }
+
+            a = factor_hb*force_angle/s;
+            b = factor_hb*force_kernel;
+
+            a11 = a*c / rsq1;
+            a12 = -a / (r1*r2);
+            a22 = a*c / rsq2;
+
+            vx1 = a11*delr1[0] + a12*delr2[0];
+            vx2 = a22*delr2[0] + a12*delr1[0];
+            vy1 = a11*delr1[1] + a12*delr2[1];
+            vy2 = a22*delr2[1] + a12*delr1[1];
+            vz1 = a11*delr1[2] + a12*delr2[2];
+            vz2 = a22*delr2[2] + a12*delr1[2];
+
+            fi[0] = vx1 + b*delx;
+            fi[1] = vy1 + b*dely;
+            fi[2] = vz1 + b*delz;
+            fj[0] = vx2 - b*delx;
+            fj[1] = vy2 - b*dely;
+            fj[2] = vz2 - b*delz;
+
+            fxtmp += fi[0];
+            fytmp += fi[1];
+            fztmp += fi[2];
+
+            f[j][0] += fj[0];
+            f[j][1] += fj[1];
+            f[j][2] += fj[2];
+
+            f[k][0] -= vx1 + vx2;
+            f[k][1] -= vy1 + vy2;
+            f[k][2] -= vz1 + vz2;
+
+            // KIJ instead of IJK b/c delr1/delr2 are both with respect to k
+
+            if (EVFLAG) ev_tally3_thr(this,k,i,j,evdwl,0.0,fi,fj,delr1,delr2,thr);
+            if (EFLAG) {
+              hbcount++;
+              hbeng += evdwl;
+            }
+          }
+        }
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_hbond_dreiding_lj_omp.h b/src/USER-OMP/pair_hbond_dreiding_lj_omp.h
index 9373916849..dc5108b3d7 100644
--- a/src/USER-OMP/pair_hbond_dreiding_lj_omp.h
+++ b/src/USER-OMP/pair_hbond_dreiding_lj_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp
index fe0106473f..3dccd98dbf 100644
--- a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp
+++ b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp
@@ -83,11 +83,11 @@ void PairHbondDreidingMorseOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -134,7 +134,7 @@ void PairHbondDreidingMorseOMP::eval(int iifrom, int iito, ThrData * const thr)
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
 
-  
+
   // ii = loop over donors
   // jj = loop over acceptors
   // kk = loop over hydrogens bonded to donor
@@ -172,106 +172,106 @@ void PairHbondDreidingMorseOMP::eval(int iifrom, int iito, ThrData * const thr)
       rsq = delx*delx + dely*dely + delz*delz;
 
       for (kk = 0; kk < knum; kk++) {
-	k = atom->map(klist[kk]);
-	if (k < 0) continue;
-	ktype = type[k];
-	m = type2param[itype][jtype][ktype];
-	if (m < 0) continue;
-	pm = &params[m];
-
-	if (rsq < pm->cut_outersq) {
-	  delr1[0] = xtmp - x[k][0];
-	  delr1[1] = ytmp - x[k][1];
-	  delr1[2] = ztmp - x[k][2];
-	  domain->minimum_image(delr1);
-	  rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
-	  r1 = sqrt(rsq1);
-	  
-	  delr2[0] = x[j][0] - x[k][0];
-	  delr2[1] = x[j][1] - x[k][1];
-	  delr2[2] = x[j][2] - x[k][2];
-	  domain->minimum_image(delr2);
-	  rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
-	  r2 = sqrt(rsq2);
-	  
-	  // angle (cos and sin)
-	  
-	  c = delr1[0]*delr2[0] + delr1[1]*delr2[1] + delr1[2]*delr2[2];
-	  c /= r1*r2;
-	  if (c > 1.0) c = 1.0;
-	  if (c < -1.0) c = -1.0;
-	  ac = acos(c);
-
-	  if (ac > pm->cut_angle && ac < (2.0*MY_PI - pm->cut_angle)) {
-	    s = sqrt(1.0 - c*c);
-	    if (s < SMALL) s = SMALL;
-
-	    // Morse-specific kernel
-
-	    r = sqrt(rsq);
-	    dr = r - pm->r0;
-	    dexp = exp(-pm->alpha * dr);
-	    force_kernel = pm->morse1*(dexp*dexp - dexp)/r * pow(c,(double)pm->ap);
-	    force_angle = pm->ap * eng_morse * pow(c,(double)pm->ap-1.0)*s;
-
-	    eng_morse = pm->d0 * (dexp*dexp - 2.0*dexp);
-	    if (rsq > pm->cut_innersq) {
-	      switch1 = (pm->cut_outersq-rsq) * (pm->cut_outersq-rsq) *
-			(pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
-			pm->denom_vdw;
-	      switch2 = 12.0*rsq * (pm->cut_outersq-rsq) *
-			(rsq-pm->cut_innersq) / pm->denom_vdw;
-	      force_kernel = force_kernel*switch1 + eng_morse*switch2;
-	      eng_morse *= switch1;
-	    }
-
-	    if (EFLAG) {
-	      evdwl = eng_morse * pow(c,(double)params[m].ap);
-	      evdwl *= factor_hb;
-	    }
-
-	    a = factor_hb*force_angle/s;
-	    b = factor_hb*force_kernel;
-	    
-	    a11 = a*c / rsq1;
-	    a12 = -a / (r1*r2);
-	    a22 = a*c / rsq2;
-	    
-	    vx1 = a11*delr1[0] + a12*delr2[0];
-	    vx2 = a22*delr2[0] + a12*delr1[0];
-	    vy1 = a11*delr1[1] + a12*delr2[1];
-	    vy2 = a22*delr2[1] + a12*delr1[1];
-	    vz1 = a11*delr1[2] + a12*delr2[2];
-	    vz2 = a22*delr2[2] + a12*delr1[2];
-	    
-	    fi[0] = vx1 + b*delx;
-	    fi[1] = vy1 + b*dely;
-	    fi[2] = vz1 + b*delz;
-	    fj[0] = vx2 - b*delx;
-	    fj[1] = vy2 - b*dely;
-	    fj[2] = vz2 - b*delz;
-
-	    fxtmp += fi[0];
-	    fytmp += fi[1];
-	    fztmp += fi[2];
-
-	    f[j][0] += fj[0];
-	    f[j][1] += fj[1];
-	    f[j][2] += fj[2];
-	    
-	    f[k][0] -= vx1 + vx2;
-	    f[k][1] -= vy1 + vy2;
-	    f[k][2] -= vz1 + vz2;
-
-	    // KIJ instead of IJK b/c delr1/delr2 are both with respect to k
-
-	    if (EVFLAG) ev_tally3_thr(this,k,i,j,evdwl,0.0,fi,fj,delr1,delr2,thr);
-	    if (EFLAG) {
-	      hbcount++;
-	      hbeng += evdwl;
-	    }
-	  }
-	}
+        k = atom->map(klist[kk]);
+        if (k < 0) continue;
+        ktype = type[k];
+        m = type2param[itype][jtype][ktype];
+        if (m < 0) continue;
+        pm = &params[m];
+
+        if (rsq < pm->cut_outersq) {
+          delr1[0] = xtmp - x[k][0];
+          delr1[1] = ytmp - x[k][1];
+          delr1[2] = ztmp - x[k][2];
+          domain->minimum_image(delr1);
+          rsq1 = delr1[0]*delr1[0] + delr1[1]*delr1[1] + delr1[2]*delr1[2];
+          r1 = sqrt(rsq1);
+
+          delr2[0] = x[j][0] - x[k][0];
+          delr2[1] = x[j][1] - x[k][1];
+          delr2[2] = x[j][2] - x[k][2];
+          domain->minimum_image(delr2);
+          rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
+          r2 = sqrt(rsq2);
+
+          // angle (cos and sin)
+
+          c = delr1[0]*delr2[0] + delr1[1]*delr2[1] + delr1[2]*delr2[2];
+          c /= r1*r2;
+          if (c > 1.0) c = 1.0;
+          if (c < -1.0) c = -1.0;
+          ac = acos(c);
+
+          if (ac > pm->cut_angle && ac < (2.0*MY_PI - pm->cut_angle)) {
+            s = sqrt(1.0 - c*c);
+            if (s < SMALL) s = SMALL;
+
+            // Morse-specific kernel
+
+            r = sqrt(rsq);
+            dr = r - pm->r0;
+            dexp = exp(-pm->alpha * dr);
+            force_kernel = pm->morse1*(dexp*dexp - dexp)/r * pow(c,(double)pm->ap);
+            force_angle = pm->ap * eng_morse * pow(c,(double)pm->ap-1.0)*s;
+
+            eng_morse = pm->d0 * (dexp*dexp - 2.0*dexp);
+            if (rsq > pm->cut_innersq) {
+              switch1 = (pm->cut_outersq-rsq) * (pm->cut_outersq-rsq) *
+                        (pm->cut_outersq + 2.0*rsq - 3.0*pm->cut_innersq) /
+                        pm->denom_vdw;
+              switch2 = 12.0*rsq * (pm->cut_outersq-rsq) *
+                        (rsq-pm->cut_innersq) / pm->denom_vdw;
+              force_kernel = force_kernel*switch1 + eng_morse*switch2;
+              eng_morse *= switch1;
+            }
+
+            if (EFLAG) {
+              evdwl = eng_morse * pow(c,(double)params[m].ap);
+              evdwl *= factor_hb;
+            }
+
+            a = factor_hb*force_angle/s;
+            b = factor_hb*force_kernel;
+
+            a11 = a*c / rsq1;
+            a12 = -a / (r1*r2);
+            a22 = a*c / rsq2;
+
+            vx1 = a11*delr1[0] + a12*delr2[0];
+            vx2 = a22*delr2[0] + a12*delr1[0];
+            vy1 = a11*delr1[1] + a12*delr2[1];
+            vy2 = a22*delr2[1] + a12*delr1[1];
+            vz1 = a11*delr1[2] + a12*delr2[2];
+            vz2 = a22*delr2[2] + a12*delr1[2];
+
+            fi[0] = vx1 + b*delx;
+            fi[1] = vy1 + b*dely;
+            fi[2] = vz1 + b*delz;
+            fj[0] = vx2 - b*delx;
+            fj[1] = vy2 - b*dely;
+            fj[2] = vz2 - b*delz;
+
+            fxtmp += fi[0];
+            fytmp += fi[1];
+            fztmp += fi[2];
+
+            f[j][0] += fj[0];
+            f[j][1] += fj[1];
+            f[j][2] += fj[2];
+
+            f[k][0] -= vx1 + vx2;
+            f[k][1] -= vy1 + vy2;
+            f[k][2] -= vz1 + vz2;
+
+            // KIJ instead of IJK b/c delr1/delr2 are both with respect to k
+
+            if (EVFLAG) ev_tally3_thr(this,k,i,j,evdwl,0.0,fi,fj,delr1,delr2,thr);
+            if (EFLAG) {
+              hbcount++;
+              hbeng += evdwl;
+            }
+          }
+        }
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_hbond_dreiding_morse_omp.h b/src/USER-OMP/pair_hbond_dreiding_morse_omp.h
index d2edd7281b..5a8aaf2c5a 100644
--- a/src/USER-OMP/pair_hbond_dreiding_morse_omp.h
+++ b/src/USER-OMP/pair_hbond_dreiding_morse_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_line_lj_omp.cpp b/src/USER-OMP/pair_line_lj_omp.cpp
index b4b1ea3a06..27c630166e 100644
--- a/src/USER-OMP/pair_line_lj_omp.cpp
+++ b/src/USER-OMP/pair_line_lj_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,7 +69,7 @@ void PairLineLJOMP::compute(int eflag, int vflag)
   for (int i = 0; i < nall; ++i)
     if (line[i] >= 0)
       if (dnum[i] == 0)
-	discretize(i,sigma[type[i]][type[i]]);
+        discretize(i,sigma[type[i]][type[i]]);
 
 #if defined(_OPENMP)
 #pragma omp parallel default(none) shared(eflag,vflag)
@@ -83,11 +83,11 @@ void PairLineLJOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -140,192 +140,192 @@ void PairLineLJOMP::eval(int iifrom, int iito, ThrData * const thr)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq >= cutsq[itype][jtype]) continue;
-      
+
       // line/line interactions = NxN particles
-      
+
       evdwl = 0.0;
       if (line[i] >= 0 && line[j] >= 0) {
-	npi = dnum[i];
-	ifirst = dfirst[i];
-	npj = dnum[j];
-	jfirst = dfirst[j];
-
-	fi[0] = fi[1] = fj[0] = fj[1] = ti = tj = 0.0;
-
-	for (ni = 0; ni < npi; ni++) {
-	  dxi = discrete[ifirst+ni].dx;
-	  dyi = discrete[ifirst+ni].dy;
-
-	  for (nj = 0; nj < npj; nj++) {
-	    dxj = discrete[jfirst+nj].dx;
-	    dyj = discrete[jfirst+nj].dy;
-
-	    xi[0] = x[i][0] + dxi;
-	    xi[1] = x[i][1] + dyi;
-	    xj[0] = x[j][0] + dxj;
-	    xj[1] = x[j][1] + dyj;
-
-	    delx = xi[0] - xj[0];
-	    dely = xi[1] - xj[1];
-	    rsq = delx*delx + dely*dely;
-
-	    sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
-	    sig3 = sig*sig*sig;
-	    term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	    term1 = 2.0 * term2 * sig3*sig3;
-	    r2inv = 1.0/rsq;
-	    r6inv = r2inv*r2inv*r2inv;
-	    forcelj = r6inv * (term1*r6inv - term2);
-	    fpair = forcelj*r2inv;
-
-	    if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	    fi[0] += delx*fpair;
-	    fi[1] += dely*fpair;
-	    ti += fpair*(dxi*dely - dyi*delx);
-
-	    if (NEWTON_PAIR || j < nlocal) {
-	      fj[0] -= delx*fpair;
-	      fj[1] -= dely*fpair;
-	      tj += fpair*(dxj*dely - dyj*delx);
-	    }
-	  }
-	}
-
-	f[i][0] += fi[0];
-	f[i][1] += fi[1];
-	f[j][0] += fj[0];
-	f[j][1] += fj[1];
-	torque[i][2] += ti;
-	torque[j][2] += tj;
+        npi = dnum[i];
+        ifirst = dfirst[i];
+        npj = dnum[j];
+        jfirst = dfirst[j];
+
+        fi[0] = fi[1] = fj[0] = fj[1] = ti = tj = 0.0;
+
+        for (ni = 0; ni < npi; ni++) {
+          dxi = discrete[ifirst+ni].dx;
+          dyi = discrete[ifirst+ni].dy;
+
+          for (nj = 0; nj < npj; nj++) {
+            dxj = discrete[jfirst+nj].dx;
+            dyj = discrete[jfirst+nj].dy;
+
+            xi[0] = x[i][0] + dxi;
+            xi[1] = x[i][1] + dyi;
+            xj[0] = x[j][0] + dxj;
+            xj[1] = x[j][1] + dyj;
+
+            delx = xi[0] - xj[0];
+            dely = xi[1] - xj[1];
+            rsq = delx*delx + dely*dely;
+
+            sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
+            sig3 = sig*sig*sig;
+            term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+            term1 = 2.0 * term2 * sig3*sig3;
+            r2inv = 1.0/rsq;
+            r6inv = r2inv*r2inv*r2inv;
+            forcelj = r6inv * (term1*r6inv - term2);
+            fpair = forcelj*r2inv;
+
+            if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+            fi[0] += delx*fpair;
+            fi[1] += dely*fpair;
+            ti += fpair*(dxi*dely - dyi*delx);
+
+            if (NEWTON_PAIR || j < nlocal) {
+              fj[0] -= delx*fpair;
+              fj[1] -= dely*fpair;
+              tj += fpair*(dxj*dely - dyj*delx);
+            }
+          }
+        }
+
+        f[i][0] += fi[0];
+        f[i][1] += fi[1];
+        f[j][0] += fj[0];
+        f[j][1] += fj[1];
+        torque[i][2] += ti;
+        torque[j][2] += tj;
 
       // line/particle interaction = Nx1 particles
       // convert line into Np particles based on sigma and line length
 
       } else if (line[i] >= 0) {
-	npi = dnum[i];
-	ifirst = dfirst[i];
-
-	fi[0] = fi[1] = fj[0] = fj[1] = ti = tj = 0.0;
-
-	for (ni = 0; ni < npi; ni++) {
-	  dxi = discrete[ifirst+ni].dx;
-	  dyi = discrete[ifirst+ni].dy;
-
-	  xi[0] = x[i][0] + dxi;
-	  xi[1] = x[i][1] + dyi;
-	  xj[0] = x[j][0];
-	  xj[1] = x[j][1];
-
-	  delx = xi[0] - xj[0];
-	  dely = xi[1] - xj[1];
-	  rsq = delx*delx + dely*dely;
-
-	  sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
-	  sig3 = sig*sig*sig;
-	  term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	  term1 = 2.0 * term2 * sig3*sig3;
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (term1*r6inv - term2);
-	  fpair = forcelj*r2inv;
-
-	  if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	  fi[0] += delx*fpair;
-	  fi[1] += dely*fpair;
-	  ti += fpair*(dxi*dely - dyi*delx);
-
-	  if (NEWTON_PAIR || j < nlocal) {
-	    fj[0] -= delx*fpair;
-	    fj[1] -= dely*fpair;
-	    tj += fpair*(dxj*dely - dyj*delx);
-	  }
-	}
-
-	f[i][0] += fi[0];
-	f[i][1] += fi[1];
-	f[j][0] += fj[0];
-	f[j][1] += fj[1];
-	torque[i][2] += ti;
-	torque[j][2] += tj;
+        npi = dnum[i];
+        ifirst = dfirst[i];
+
+        fi[0] = fi[1] = fj[0] = fj[1] = ti = tj = 0.0;
+
+        for (ni = 0; ni < npi; ni++) {
+          dxi = discrete[ifirst+ni].dx;
+          dyi = discrete[ifirst+ni].dy;
+
+          xi[0] = x[i][0] + dxi;
+          xi[1] = x[i][1] + dyi;
+          xj[0] = x[j][0];
+          xj[1] = x[j][1];
+
+          delx = xi[0] - xj[0];
+          dely = xi[1] - xj[1];
+          rsq = delx*delx + dely*dely;
+
+          sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
+          sig3 = sig*sig*sig;
+          term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+          term1 = 2.0 * term2 * sig3*sig3;
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (term1*r6inv - term2);
+          fpair = forcelj*r2inv;
+
+          if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+          fi[0] += delx*fpair;
+          fi[1] += dely*fpair;
+          ti += fpair*(dxi*dely - dyi*delx);
+
+          if (NEWTON_PAIR || j < nlocal) {
+            fj[0] -= delx*fpair;
+            fj[1] -= dely*fpair;
+            tj += fpair*(dxj*dely - dyj*delx);
+          }
+        }
+
+        f[i][0] += fi[0];
+        f[i][1] += fi[1];
+        f[j][0] += fj[0];
+        f[j][1] += fj[1];
+        torque[i][2] += ti;
+        torque[j][2] += tj;
 
       // particle/line interaction = Nx1 particles
       // convert line into Np particles based on sigma and line length
 
       } else if (line[j] >= 0) {
-	npj = dnum[j];
-	jfirst = dfirst[j];
-
-	fi[0] = fi[1] = fj[0] = fj[1] = ti = tj = 0.0;
-
-	for (nj = 0; nj < npj; nj++) {
-	  dxj = discrete[jfirst+nj].dx;
-	  dyj = discrete[jfirst+nj].dy;
-
-	  xi[0] = x[i][0];
-	  xi[1] = x[i][1];
-	  xj[0] = x[j][0] + dxj;
-	  xj[1] = x[j][1] + dyj;
-
-	  delx = xi[0] - xj[0];
-	  dely = xi[1] - xj[1];
-	  rsq = delx*delx + dely*dely;
-
-	  sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
-	  sig3 = sig*sig*sig;
-	  term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	  term1 = 2.0 * term2 * sig3*sig3;
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (term1*r6inv - term2);
-	  fpair = forcelj*r2inv;
-	  
-	  if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	  fi[0] += delx*fpair;
-	  fi[1] += dely*fpair;
-	  ti += fpair*(dxi*dely - dyi*delx);
-
-	  if (NEWTON_PAIR || j < nlocal) {
-	    fj[0] -= delx*fpair;
-	    fj[1] -= dely*fpair;
-	    tj -= fpair*(dxj*dely - dyj*delx);
-	  }
-	}
-
-	f[i][0] += fi[0];
-	f[i][1] += fi[1];
-	f[j][0] += fj[0];
-	f[j][1] += fj[1];
-	torque[i][2] += ti;
-	torque[j][2] += tj;
+        npj = dnum[j];
+        jfirst = dfirst[j];
+
+        fi[0] = fi[1] = fj[0] = fj[1] = ti = tj = 0.0;
+
+        for (nj = 0; nj < npj; nj++) {
+          dxj = discrete[jfirst+nj].dx;
+          dyj = discrete[jfirst+nj].dy;
+
+          xi[0] = x[i][0];
+          xi[1] = x[i][1];
+          xj[0] = x[j][0] + dxj;
+          xj[1] = x[j][1] + dyj;
+
+          delx = xi[0] - xj[0];
+          dely = xi[1] - xj[1];
+          rsq = delx*delx + dely*dely;
+
+          sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
+          sig3 = sig*sig*sig;
+          term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+          term1 = 2.0 * term2 * sig3*sig3;
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (term1*r6inv - term2);
+          fpair = forcelj*r2inv;
+
+          if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+          fi[0] += delx*fpair;
+          fi[1] += dely*fpair;
+          ti += fpair*(dxi*dely - dyi*delx);
+
+          if (NEWTON_PAIR || j < nlocal) {
+            fj[0] -= delx*fpair;
+            fj[1] -= dely*fpair;
+            tj -= fpair*(dxj*dely - dyj*delx);
+          }
+        }
+
+        f[i][0] += fi[0];
+        f[i][1] += fi[1];
+        f[j][0] += fj[0];
+        f[j][1] += fj[1];
+        torque[i][2] += ti;
+        torque[j][2] += tj;
 
       // particle/particle interaction = 1x1 particles
 
       } else {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = forcelj*r2inv;
-
-	if (EFLAG)
-	  evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = forcelj*r2inv;
+
+        if (EFLAG)
+          evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
       }
 
       if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-			       evdwl,0.0,fpair,delx,dely,delz,thr);
+                               evdwl,0.0,fpair,delx,dely,delz,thr);
     }
   }
 }
diff --git a/src/USER-OMP/pair_line_lj_omp.h b/src/USER-OMP/pair_line_lj_omp.h
index 93b38afaf0..9a5e4333e0 100644
--- a/src/USER-OMP/pair_line_lj_omp.h
+++ b/src/USER-OMP/pair_line_lj_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj96_cut_omp.cpp b/src/USER-OMP/pair_lj96_cut_omp.cpp
index b92749bf56..16827c7ee1 100644
--- a/src/USER-OMP/pair_lj96_cut_omp.cpp
+++ b/src/USER-OMP/pair_lj96_cut_omp.cpp
@@ -57,11 +57,11 @@ void PairLJ96CutOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -118,30 +118,30 @@ void PairLJ96CutOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r3inv = sqrt(r6inv);
-
-	forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype])
-	    - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r3inv = sqrt(r6inv);
+
+        forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype])
+            - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj96_cut_omp.h b/src/USER-OMP/pair_lj96_cut_omp.h
index a8040320c8..037c68fc03 100644
--- a/src/USER-OMP/pair_lj96_cut_omp.h
+++ b/src/USER-OMP/pair_lj96_cut_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp
index 811fdbcdac..739f754a23 100644
--- a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp
+++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp
@@ -56,11 +56,11 @@ void PairLJCharmmCoulCharmmImplicitOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -127,70 +127,70 @@ void PairLJCharmmCoulCharmmImplicitOMP::eval(int iifrom, int iito, ThrData * con
       jtype = type[j];
 
       if (rsq < cut_bothsq) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  forcecoul = 2.0 * qqrd2e * qtmp*q[j]*r2inv;
-	  if (rsq > cut_coul_innersq) {
-	    switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-	      (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) * invdenom_coul;
-	    switch2 = 12.0*rsq * (cut_coulsq-rsq) * 
-	      (rsq-cut_coul_innersq) * invdenom_coul;
-	    forcecoul *= switch1 + switch2;
-	  }
-	  forcecoul *= factor_coul;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  jtype = type[j];
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  if (rsq > cut_lj_innersq) {
-	    switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	      (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) * invdenom_lj;
-	    switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	      (rsq-cut_lj_innersq) * invdenom_lj;
-	    philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	    forcelj = forcelj*switch1 + philj*switch2;
-	  }
-	  forcelj *= factor_lj;
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = qqrd2e * qtmp*q[j]*r2inv;
-	    if (rsq > cut_coul_innersq) {
-	      switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-		(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) *
-		invdenom_coul;
-	      ecoul *= switch1;
-	    }
-	    ecoul *= factor_coul;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) * invdenom_lj;
-	      evdwl *= switch1;
-	    }
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-	
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          forcecoul = 2.0 * qqrd2e * qtmp*q[j]*r2inv;
+          if (rsq > cut_coul_innersq) {
+            switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
+              (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) * invdenom_coul;
+            switch2 = 12.0*rsq * (cut_coulsq-rsq) *
+              (rsq-cut_coul_innersq) * invdenom_coul;
+            forcecoul *= switch1 + switch2;
+          }
+          forcecoul *= factor_coul;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq) {
+          r6inv = r2inv*r2inv*r2inv;
+          jtype = type[j];
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          if (rsq > cut_lj_innersq) {
+            switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+              (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) * invdenom_lj;
+            switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+              (rsq-cut_lj_innersq) * invdenom_lj;
+            philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+            forcelj = forcelj*switch1 + philj*switch2;
+          }
+          forcelj *= factor_lj;
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            ecoul = qqrd2e * qtmp*q[j]*r2inv;
+            if (rsq > cut_coul_innersq) {
+              switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
+                (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) *
+                invdenom_coul;
+              ecoul *= switch1;
+            }
+            ecoul *= factor_coul;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) * invdenom_lj;
+              evdwl *= switch1;
+            }
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h
index dff01ce499..9fb2835353 100644
--- a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h
+++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp
index 7c1b104182..318cb3aaa8 100644
--- a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp
+++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp
@@ -56,11 +56,11 @@ void PairLJCharmmCoulCharmmOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -127,70 +127,70 @@ void PairLJCharmmCoulCharmmOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cut_bothsq) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
-	  if (rsq > cut_coul_innersq) {
-	    switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-	      (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) * invdenom_coul;
-	    switch2 = 12.0*rsq * (cut_coulsq-rsq) * 
-	      (rsq-cut_coul_innersq) * invdenom_coul;
-	    forcecoul *= switch1 + switch2;
-	  }
-	  forcecoul *= factor_coul;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  jtype = type[j];
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  if (rsq > cut_lj_innersq) {
-	    switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	      (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) * invdenom_lj;
-	    switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	      (rsq-cut_lj_innersq) * invdenom_lj;
-	    philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	    forcelj = forcelj*switch1 + philj*switch2;
-	  }
-	  forcelj *= factor_lj;
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
-	    if (rsq > cut_coul_innersq) {
-	      switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
-		(cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) *
-		invdenom_coul;
-	      ecoul *= switch1;
-	    }
-	    ecoul *= factor_coul;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) * invdenom_lj;
-	      evdwl *= switch1;
-	    }
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-	
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
+          if (rsq > cut_coul_innersq) {
+            switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
+              (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) * invdenom_coul;
+            switch2 = 12.0*rsq * (cut_coulsq-rsq) *
+              (rsq-cut_coul_innersq) * invdenom_coul;
+            forcecoul *= switch1 + switch2;
+          }
+          forcecoul *= factor_coul;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq) {
+          r6inv = r2inv*r2inv*r2inv;
+          jtype = type[j];
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          if (rsq > cut_lj_innersq) {
+            switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+              (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) * invdenom_lj;
+            switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+              (rsq-cut_lj_innersq) * invdenom_lj;
+            philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+            forcelj = forcelj*switch1 + philj*switch2;
+          }
+          forcelj *= factor_lj;
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            ecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
+            if (rsq > cut_coul_innersq) {
+              switch1 = (cut_coulsq-rsq) * (cut_coulsq-rsq) *
+                (cut_coulsq + 2.0*rsq - 3.0*cut_coul_innersq) *
+                invdenom_coul;
+              ecoul *= switch1;
+            }
+            ecoul *= factor_coul;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) * invdenom_lj;
+              evdwl *= switch1;
+            }
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h
index 0eda030ebd..9591d62c85 100644
--- a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h
+++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp
index 9a5b1300e3..afdc527567 100644
--- a/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp
+++ b/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp
@@ -57,11 +57,11 @@ void PairLJCharmmCoulLongOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -122,88 +122,88 @@ void PairLJCharmmCoulLongOMP::eval(int iifrom, int iito, ThrData * const thr)
       const int jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	const double r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    const double A1 =  0.254829592;
-	    const double A2 = -0.284496736;
-	    const double A3 =  1.421413741;
-	    const double A4 = -1.453152027;
-	    const double A5 =  1.061405429;
-	    const double EWALD_F = 1.12837917;
-	    const double INV_EWALD_P = 1.0/0.3275911;
-
-	    const double r = sqrt(rsq);
-	    const double grij = g_ewald * r;
-	    const double expm2 = exp(-grij*grij);
-	    const double t = INV_EWALD_P / (INV_EWALD_P + grij);
-	    const double erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    const double prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (EFLAG) ecoul = prefactor*erfc;
-	    if (sbindex) {
-	      const double adjust = (1.0-special_coul[sbindex])*prefactor;
-	      forcecoul -= adjust;
-	      if (EFLAG) ecoul -= adjust;
-	    }
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    const int itable = (rsq_lookup.i & ncoulmask) >> ncoulshiftbits;
-	    const double fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    const double table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (EFLAG) ecoul = qtmp*q[j] * (etable[itable] + fraction*detable[itable]);
-	    if (sbindex) {
-	      const double table2 = ctable[itable] + fraction*dctable[itable];
-	      const double prefactor = qtmp*q[j] * table2;
-	      const double adjust = (1.0-special_coul[sbindex])*prefactor;
-	      forcecoul -= adjust;
-	      if (EFLAG) ecoul -= adjust;
-	    }
-	  }
-	}
-
-	if (rsq < cut_ljsq) {
-	  const double r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  if (EFLAG) evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-
-	  if (rsq > cut_lj_innersq) {
-	    const double drsq = cut_ljsq - rsq;
-	    const double cut2 = (rsq - cut_lj_innersq) * drsq;
-	    const double switch1 = drsq * (drsq*drsq + 3.0*cut2) * inv_denom_lj;
-	    const double switch2 = 12.0*rsq * cut2 * inv_denom_lj;
-	    if (EFLAG) {
-	      forcelj = forcelj*switch1 + evdwl*switch2;
-	      evdwl *= switch1;
-	    } else {
-	      const double philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	      forcelj =  forcelj*switch1 + philj*switch2;
-	    }
-	  }
-
-	  if (sbindex) {
-	    const double factor_lj = special_lj[sbindex];
-	    forcelj *= factor_lj;
-	    if (EFLAG) evdwl *= factor_lj;
-	  }
-
-	}
-	const double fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        const double r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            const double A1 =  0.254829592;
+            const double A2 = -0.284496736;
+            const double A3 =  1.421413741;
+            const double A4 = -1.453152027;
+            const double A5 =  1.061405429;
+            const double EWALD_F = 1.12837917;
+            const double INV_EWALD_P = 1.0/0.3275911;
+
+            const double r = sqrt(rsq);
+            const double grij = g_ewald * r;
+            const double expm2 = exp(-grij*grij);
+            const double t = INV_EWALD_P / (INV_EWALD_P + grij);
+            const double erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            const double prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (EFLAG) ecoul = prefactor*erfc;
+            if (sbindex) {
+              const double adjust = (1.0-special_coul[sbindex])*prefactor;
+              forcecoul -= adjust;
+              if (EFLAG) ecoul -= adjust;
+            }
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            const int itable = (rsq_lookup.i & ncoulmask) >> ncoulshiftbits;
+            const double fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            const double table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (EFLAG) ecoul = qtmp*q[j] * (etable[itable] + fraction*detable[itable]);
+            if (sbindex) {
+              const double table2 = ctable[itable] + fraction*dctable[itable];
+              const double prefactor = qtmp*q[j] * table2;
+              const double adjust = (1.0-special_coul[sbindex])*prefactor;
+              forcecoul -= adjust;
+              if (EFLAG) ecoul -= adjust;
+            }
+          }
+        }
+
+        if (rsq < cut_ljsq) {
+          const double r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          if (EFLAG) evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+
+          if (rsq > cut_lj_innersq) {
+            const double drsq = cut_ljsq - rsq;
+            const double cut2 = (rsq - cut_lj_innersq) * drsq;
+            const double switch1 = drsq * (drsq*drsq + 3.0*cut2) * inv_denom_lj;
+            const double switch2 = 12.0*rsq * cut2 * inv_denom_lj;
+            if (EFLAG) {
+              forcelj = forcelj*switch1 + evdwl*switch2;
+              evdwl *= switch1;
+            } else {
+              const double philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+              forcelj =  forcelj*switch1 + philj*switch2;
+            }
+          }
+
+          if (sbindex) {
+            const double factor_lj = special_lj[sbindex];
+            forcelj *= factor_lj;
+            if (EFLAG) evdwl *= factor_lj;
+          }
+
+        }
+        const double fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_omp.h b/src/USER-OMP/pair_lj_charmm_coul_long_omp.h
index 91b9c01c1a..ba28d05114 100644
--- a/src/USER-OMP/pair_lj_charmm_coul_long_omp.h
+++ b/src/USER-OMP/pair_lj_charmm_coul_long_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_charmm_coul_pppm_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_pppm_omp.cpp
index e19152ad6e..b5878dfe3d 100644
--- a/src/USER-OMP/pair_lj_charmm_coul_pppm_omp.cpp
+++ b/src/USER-OMP/pair_lj_charmm_coul_pppm_omp.cpp
@@ -90,19 +90,19 @@ void PairLJCharmmCoulPPPMOMP::compute(int eflag, int vflag)
       kspace->compute_proxy(eflag,vflag);
     } else {
       if (evflag) {
-	if (eflag) {
-	  if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	  else eval<1,1,0>(ifrom, ito, thr);
-	} else {
-	  if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	  else eval<1,0,0>(ifrom, ito, thr);
-	}
+        if (eflag) {
+          if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+          else eval<1,1,0>(ifrom, ito, thr);
+        } else {
+          if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+          else eval<1,0,0>(ifrom, ito, thr);
+        }
       } else {
-	if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
-	else eval<0,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
+        else eval<0,0,0>(ifrom, ito, thr);
       }
     }
-    
+
     sync_threads();
     reduce_thr(this, eflag, vflag, thr, nproxy);
   } // end of omp parallel region
@@ -164,84 +164,84 @@ void PairLJCharmmCoulPPPMOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  jtype = type[j];
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  if (rsq > cut_lj_innersq) {
-	    switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-	      (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	    switch2 = 12.0*rsq * (cut_ljsq-rsq) * 
-	      (rsq-cut_lj_innersq) / denom_lj;
-	    philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	    forcelj = forcelj*switch1 + philj*switch2;
-	  }
-	  forcelj *= factor_lj;
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-	    if (rsq > cut_lj_innersq) {
-	      switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
-		(cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
-	      evdwl *= switch1;
-	    }
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-	
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq) {
+          r6inv = r2inv*r2inv*r2inv;
+          jtype = type[j];
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          if (rsq > cut_lj_innersq) {
+            switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+              (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+            switch2 = 12.0*rsq * (cut_ljsq-rsq) *
+              (rsq-cut_lj_innersq) / denom_lj;
+            philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+            forcelj = forcelj*switch1 + philj*switch2;
+          }
+          forcelj *= factor_lj;
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+            if (rsq > cut_lj_innersq) {
+              switch1 = (cut_ljsq-rsq) * (cut_ljsq-rsq) *
+                (cut_ljsq + 2.0*rsq - 3.0*cut_lj_innersq) / denom_lj;
+              evdwl *= switch1;
+            }
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_charmm_coul_pppm_omp.h b/src/USER-OMP/pair_lj_charmm_coul_pppm_omp.h
index 1faee2c479..835f40389f 100644
--- a/src/USER-OMP/pair_lj_charmm_coul_pppm_omp.h
+++ b/src/USER-OMP/pair_lj_charmm_coul_pppm_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp b/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp
index a6a7f30449..361923cb54 100644
--- a/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp
+++ b/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp
@@ -56,11 +56,11 @@ void PairLJClass2CoulCutOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -125,45 +125,45 @@ void PairLJClass2CoulCutOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	rinv = sqrt(r2inv);
-
-	if (rsq < cut_coulsq[itype][jtype]) {
-	  forcecoul = qqrd2e * qtmp*q[j]*rinv;
-	  forcecoul *= factor_coul;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r3inv = r2inv*rinv;
-	  r6inv = r3inv*r3inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	  forcelj *= factor_lj;
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq[itype][jtype])
-	    ecoul = factor_coul * qqrd2e * qtmp*q[j]*rinv;
-	  else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        rinv = sqrt(r2inv);
+
+        if (rsq < cut_coulsq[itype][jtype]) {
+          forcecoul = qqrd2e * qtmp*q[j]*rinv;
+          forcecoul *= factor_coul;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r3inv = r2inv*rinv;
+          r6inv = r3inv*r3inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+          forcelj *= factor_lj;
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq[itype][jtype])
+            ecoul = factor_coul * qqrd2e * qtmp*q[j]*rinv;
+          else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_class2_coul_cut_omp.h b/src/USER-OMP/pair_lj_class2_coul_cut_omp.h
index b22a29aa18..f03da67a15 100644
--- a/src/USER-OMP/pair_lj_class2_coul_cut_omp.h
+++ b/src/USER-OMP/pair_lj_class2_coul_cut_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp b/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp
index 6412beb247..6049d7a98c 100644
--- a/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp
+++ b/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp
@@ -64,11 +64,11 @@ void PairLJClass2CoulLongOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -133,53 +133,53 @@ void PairLJClass2CoulLongOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  r = sqrt(rsq);
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  rinv = sqrt(r2inv);
-	  r3inv = r2inv*rinv;
-	  r6inv = r3inv*r3inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	  forcelj *= factor_lj;
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = prefactor*erfc;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-	
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          r = sqrt(rsq);
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          rinv = sqrt(r2inv);
+          r3inv = r2inv*rinv;
+          r6inv = r3inv*r3inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+          forcelj *= factor_lj;
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            ecoul = prefactor*erfc;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_class2_coul_long_omp.h b/src/USER-OMP/pair_lj_class2_coul_long_omp.h
index b32799bf84..973850c25c 100644
--- a/src/USER-OMP/pair_lj_class2_coul_long_omp.h
+++ b/src/USER-OMP/pair_lj_class2_coul_long_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_class2_coul_pppm_omp.cpp b/src/USER-OMP/pair_lj_class2_coul_pppm_omp.cpp
index a32005ff9b..1b0ca0ec7d 100644
--- a/src/USER-OMP/pair_lj_class2_coul_pppm_omp.cpp
+++ b/src/USER-OMP/pair_lj_class2_coul_pppm_omp.cpp
@@ -90,19 +90,19 @@ void PairLJClass2CoulPPPMOMP::compute(int eflag, int vflag)
       kspace->compute_proxy(eflag,vflag);
     } else {
       if (evflag) {
-	if (eflag) {
-	  if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	  else eval<1,1,0>(ifrom, ito, thr);
-	} else {
-	  if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	  else eval<1,0,0>(ifrom, ito, thr);
-	}
+        if (eflag) {
+          if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+          else eval<1,1,0>(ifrom, ito, thr);
+        } else {
+          if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+          else eval<1,0,0>(ifrom, ito, thr);
+        }
       } else {
-	if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
-	else eval<0,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
+        else eval<0,0,0>(ifrom, ito, thr);
       }
     }
-    
+
     sync_threads();
     reduce_thr(this, eflag, vflag, thr, nproxy);
   } // end of omp parallel region
@@ -162,53 +162,53 @@ void PairLJClass2CoulPPPMOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  r = sqrt(rsq);
-	  grij = g_ewald * r;
-	  expm2 = exp(-grij*grij);
-	  t = 1.0 / (1.0 + EWALD_P*grij);
-	  erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	  prefactor = qqrd2e * qtmp*q[j]/r;
-	  forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  rinv = sqrt(r2inv);
-	  r3inv = r2inv*rinv;
-	  r6inv = r3inv*r3inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	  forcelj *= factor_lj;
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = prefactor*erfc;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-	
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          r = sqrt(rsq);
+          grij = g_ewald * r;
+          expm2 = exp(-grij*grij);
+          t = 1.0 / (1.0 + EWALD_P*grij);
+          erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+          prefactor = qqrd2e * qtmp*q[j]/r;
+          forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          rinv = sqrt(r2inv);
+          r3inv = r2inv*rinv;
+          r6inv = r3inv*r3inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+          forcelj *= factor_lj;
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            ecoul = prefactor*erfc;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_class2_coul_pppm_omp.h b/src/USER-OMP/pair_lj_class2_coul_pppm_omp.h
index 3f77bf4f9a..8a5def6bcc 100644
--- a/src/USER-OMP/pair_lj_class2_coul_pppm_omp.h
+++ b/src/USER-OMP/pair_lj_class2_coul_pppm_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_class2_omp.cpp b/src/USER-OMP/pair_lj_class2_omp.cpp
index 018c3320c1..978335d21e 100644
--- a/src/USER-OMP/pair_lj_class2_omp.cpp
+++ b/src/USER-OMP/pair_lj_class2_omp.cpp
@@ -56,11 +56,11 @@ void PairLJClass2OMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -117,30 +117,30 @@ void PairLJClass2OMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r3inv = sqrt(r6inv);
-
-	forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype])
-	    - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r3inv = sqrt(r6inv);
+
+        forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype])
+            - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_class2_omp.h b/src/USER-OMP/pair_lj_class2_omp.h
index 317c7376c5..5acd2cfb39 100644
--- a/src/USER-OMP/pair_lj_class2_omp.h
+++ b/src/USER-OMP/pair_lj_class2_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_coul_omp.cpp b/src/USER-OMP/pair_lj_coul_omp.cpp
index 28e4a47645..21fd9ff8cd 100644
--- a/src/USER-OMP/pair_lj_coul_omp.cpp
+++ b/src/USER-OMP/pair_lj_coul_omp.cpp
@@ -66,11 +66,11 @@ void PairLJCoulOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -112,112 +112,112 @@ void PairLJCoulOMP::eval(int iifrom, int iito, ThrData * const thr)
   double g2 = g_ewald*g_ewald, g6 = g2*g2*g2, g8 = g6*g2;
   vector xi, d;
 
-  for (ii = iifrom; ii < iito; ++ii) {			// loop over my atoms
+  for (ii = iifrom; ii < iito; ++ii) {                        // loop over my atoms
     i = ilist[ii]; fi = f0+3*i;
-    if (order1) qri = (qi = q[i])*qqrd2e;		// initialize constants
+    if (order1) qri = (qi = q[i])*qqrd2e;                // initialize constants
     offseti = offset[typei = type[i]];
     lj1i = lj1[typei]; lj2i = lj2[typei]; lj3i = lj3[typei]; lj4i = lj4[typei];
     cutsqi = cutsq[typei]; cut_ljsqi = cut_ljsq[typei];
     memcpy(xi, x0+(i+(i<<1)), sizeof(vector));
     jneighn = (jneigh = list->firstneigh[i])+list->numneigh[i];
 
-    for (; jneigh<jneighn; ++jneigh) {			// loop over neighbors
+    for (; jneigh<jneighn; ++jneigh) {                        // loop over neighbors
       j = *jneigh;
       ni = sbmask(j);
       j &= NEIGHMASK;
-      
+
       { register const double *xj = x0+(j+(j<<1));
-	d[0] = xi[0] - xj[0];				// pair vector
-	d[1] = xi[1] - xj[1];
-	d[2] = xi[2] - xj[2]; }
+        d[0] = xi[0] - xj[0];                                // pair vector
+        d[1] = xi[1] - xj[1];
+        d[2] = xi[2] - xj[2]; }
 
       if ((rsq = vec_dot(d, d)) >= cutsqi[typej = type[j]]) continue;
       r2inv = 1.0/rsq;
 
-      if (order1 && (rsq < cut_coulsq)) {		// coulombic
-	if (!ncoultablebits || rsq <= tabinnersq) {	// series real space
-	  register double r = sqrt(rsq), x = g_ewald*r;
-	  register double s = qri*q[j], t = 1.0/(1.0+EWALD_P*x);
-	  if (ni == 0) {
-	    s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
-	    if (EFLAG) ecoul = t;
-	  }
-	  else {					// special case
-	    r = s*(1.0-special_coul[ni])/r; s *= g_ewald*exp(-x*x);
-	    force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-r;
-	    if (EFLAG) ecoul = t-r;
-	  }
-	}						// table real space
-	else {
-	  register union_int_float_t t;
-	  t.f = rsq;
-	  register const int k = (t.i & ncoulmask)>>ncoulshiftbits;
-	  register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
-	  if (ni == 0) {
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]);
-	    if (EFLAG) ecoul = qiqj*(etable[k]+f*detable[k]);
-	  }
-	  else {					// special case
-	    t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
-	    force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
-	    if (EFLAG) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
-	  }
-	}
+      if (order1 && (rsq < cut_coulsq)) {                // coulombic
+        if (!ncoultablebits || rsq <= tabinnersq) {        // series real space
+          register double r = sqrt(rsq), x = g_ewald*r;
+          register double s = qri*q[j], t = 1.0/(1.0+EWALD_P*x);
+          if (ni == 0) {
+            s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s;
+            if (EFLAG) ecoul = t;
+          }
+          else {                                        // special case
+            r = s*(1.0-special_coul[ni])/r; s *= g_ewald*exp(-x*x);
+            force_coul = (t *= ((((t*A5+A4)*t+A3)*t+A2)*t+A1)*s/x)+EWALD_F*s-r;
+            if (EFLAG) ecoul = t-r;
+          }
+        }                                                // table real space
+        else {
+          register union_int_float_t t;
+          t.f = rsq;
+          register const int k = (t.i & ncoulmask)>>ncoulshiftbits;
+          register double f = (rsq-rtable[k])*drtable[k], qiqj = qi*q[j];
+          if (ni == 0) {
+            force_coul = qiqj*(ftable[k]+f*dftable[k]);
+            if (EFLAG) ecoul = qiqj*(etable[k]+f*detable[k]);
+          }
+          else {                                        // special case
+            t.f = (1.0-special_coul[ni])*(ctable[k]+f*dctable[k]);
+            force_coul = qiqj*(ftable[k]+f*dftable[k]-t.f);
+            if (EFLAG) ecoul = qiqj*(etable[k]+f*detable[k]-t.f);
+          }
+        }
       }
       else force_coul = ecoul = 0.0;
 
-      if (rsq < cut_ljsqi[typej]) {			// lj
-       	if (order6) {					// long-range lj
-	  register double rn = r2inv*r2inv*r2inv;
-	  register double x2 = g2*rsq, a2 = 1.0/x2;
-	  x2 = a2*exp(-x2)*lj4i[typej];
-	  if (ni == 0) {
-	    force_lj =
-	      (rn*=rn)*lj1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
-	    if (EFLAG)
-	      evdwl = rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2;
-	  }
-	  else {					// special case
-	    register double f = special_lj[ni], t = rn*(1.0-f);
-	    force_lj = f*(rn *= rn)*lj1i[typej]-
-	      g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*lj2i[typej];
-	    if (EFLAG) 
-	      evdwl = f*rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2+t*lj4i[typej];
-	  }
-	}
-	else {						// cut lj
-	  register double rn = r2inv*r2inv*r2inv;
-	  if (ni == 0) {
-	    force_lj = rn*(rn*lj1i[typej]-lj2i[typej]);
-	    if (EFLAG) evdwl = rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej];
-	  }
-	  else {					// special case
-	    register double f = special_lj[ni];
-	    force_lj = f*rn*(rn*lj1i[typej]-lj2i[typej]);
-	    if (EFLAG)
-	      evdwl = f * (rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej]);
-	  }
-	}
+      if (rsq < cut_ljsqi[typej]) {                        // lj
+               if (order6) {                                        // long-range lj
+          register double rn = r2inv*r2inv*r2inv;
+          register double x2 = g2*rsq, a2 = 1.0/x2;
+          x2 = a2*exp(-x2)*lj4i[typej];
+          if (ni == 0) {
+            force_lj =
+              (rn*=rn)*lj1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq;
+            if (EFLAG)
+              evdwl = rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2;
+          }
+          else {                                        // special case
+            register double f = special_lj[ni], t = rn*(1.0-f);
+            force_lj = f*(rn *= rn)*lj1i[typej]-
+              g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*lj2i[typej];
+            if (EFLAG)
+              evdwl = f*rn*lj3i[typej]-g6*((a2+1.0)*a2+0.5)*x2+t*lj4i[typej];
+          }
+        }
+        else {                                                // cut lj
+          register double rn = r2inv*r2inv*r2inv;
+          if (ni == 0) {
+            force_lj = rn*(rn*lj1i[typej]-lj2i[typej]);
+            if (EFLAG) evdwl = rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej];
+          }
+          else {                                        // special case
+            register double f = special_lj[ni];
+            force_lj = f*rn*(rn*lj1i[typej]-lj2i[typej]);
+            if (EFLAG)
+              evdwl = f * (rn*(rn*lj3i[typej]-lj4i[typej])-offseti[typej]);
+          }
+        }
       }
       else force_lj = evdwl = 0.0;
 
       fpair = (force_coul+force_lj)*r2inv;
 
       if (NEWTON_PAIR || j < nlocal) {
-	register double *fj = f0+(j+(j<<1)), f;
-	fi[0] += f = d[0]*fpair; fj[0] -= f;
-	fi[1] += f = d[1]*fpair; fj[1] -= f;
-	fi[2] += f = d[2]*fpair; fj[2] -= f;
+        register double *fj = f0+(j+(j<<1)), f;
+        fi[0] += f = d[0]*fpair; fj[0] -= f;
+        fi[1] += f = d[1]*fpair; fj[1] -= f;
+        fi[2] += f = d[2]*fpair; fj[2] -= f;
       }
       else {
-	fi[0] += d[0]*fpair;
-	fi[1] += d[1]*fpair;
-	fi[2] += d[2]*fpair;
+        fi[0] += d[0]*fpair;
+        fi[1] += d[1]*fpair;
+        fi[2] += d[2]*fpair;
       }
-      
+
       if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-			       evdwl,ecoul,fpair,d[0],d[1],d[2],thr);
+                               evdwl,ecoul,fpair,d[0],d[1],d[2],thr);
     }
   }
 }
diff --git a/src/USER-OMP/pair_lj_coul_omp.h b/src/USER-OMP/pair_lj_coul_omp.h
index e2259e16a0..6e988126a3 100644
--- a/src/USER-OMP/pair_lj_coul_omp.h
+++ b/src/USER-OMP/pair_lj_coul_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_cubic_omp.cpp b/src/USER-OMP/pair_lj_cubic_omp.cpp
index 97cfdc68a3..bf4b2b2bc8 100644
--- a/src/USER-OMP/pair_lj_cubic_omp.cpp
+++ b/src/USER-OMP/pair_lj_cubic_omp.cpp
@@ -57,11 +57,11 @@ void PairLJCubicOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -119,39 +119,39 @@ void PairLJCubicOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
+        r2inv = 1.0/rsq;
         if (rsq <= cut_inner_sq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	} else {
-	  r = sqrt(rsq); 
-	  rmin = sigma[itype][jtype]*RT6TWO;
-	  t = (r - cut_inner[itype][jtype])/rmin;
-	  forcelj = epsilon[itype][jtype]*(-DPHIDS + A3*t*t/2.0)*r/rmin;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        } else {
+          r = sqrt(rsq);
+          rmin = sigma[itype][jtype]*RT6TWO;
+          t = (r - cut_inner[itype][jtype])/rmin;
+          forcelj = epsilon[itype][jtype]*(-DPHIDS + A3*t*t/2.0)*r/rmin;
         }
-	fpair = factor_lj*forcelj*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
+        fpair = factor_lj*forcelj*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
           if (rsq <= cut_inner_sq[itype][jtype])
-	    evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]); 
-	  else
-	    evdwl = epsilon[itype][jtype]*
-	      (PHIS + DPHIDS*t - A3*t*t*t/6.0);
+            evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+          else
+            evdwl = epsilon[itype][jtype]*
+              (PHIS + DPHIDS*t - A3*t*t*t/6.0);
 
-	  evdwl *= factor_lj;
-	}
+          evdwl *= factor_lj;
+        }
 
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_cubic_omp.h b/src/USER-OMP/pair_lj_cubic_omp.h
index a6ed7d2b97..78b298bb35 100644
--- a/src/USER-OMP/pair_lj_cubic_omp.h
+++ b/src/USER-OMP/pair_lj_cubic_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp
index b681ec5f03..6c1bdedef4 100644
--- a/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp
+++ b/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp
@@ -56,11 +56,11 @@ void PairLJCutCoulCutOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -124,44 +124,44 @@ void PairLJCutCoulCutOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq[itype][jtype]) {
-	  rinv = sqrt(r2inv);
-	  forcecoul = qqrd2e * qtmp*q[j]*rinv;
-	  forcecoul *= factor_coul;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  forcelj *= factor_lj;
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq[itype][jtype])
-	    ecoul = factor_coul * qqrd2e * qtmp*q[j]*rinv;
-	  else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq[itype][jtype]) {
+          rinv = sqrt(r2inv);
+          forcecoul = qqrd2e * qtmp*q[j]*rinv;
+          forcecoul *= factor_coul;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          forcelj *= factor_lj;
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq[itype][jtype])
+            ecoul = factor_coul * qqrd2e * qtmp*q[j]*rinv;
+          else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_omp.h b/src/USER-OMP/pair_lj_cut_coul_cut_omp.h
index 3d4be420e7..0d5de5b7b7 100644
--- a/src/USER-OMP/pair_lj_cut_coul_cut_omp.h
+++ b/src/USER-OMP/pair_lj_cut_coul_cut_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp
index 102259dd11..81a73d78b1 100644
--- a/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp
+++ b/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp
@@ -56,11 +56,11 @@ void PairLJCutCoulDebyeOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -125,46 +125,46 @@ void PairLJCutCoulDebyeOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq[itype][jtype]) {
-	  r = sqrt(rsq);
-	  rinv = 1.0/r;
-	  screening = exp(-kappa*r);
-	  forcecoul = qqrd2e * qtmp*q[j] * screening * (kappa + rinv);
-	  forcecoul *= factor_coul;
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  forcelj *= factor_lj;
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq[itype][jtype])
-	    ecoul = factor_coul * qqrd2e * qtmp*q[j] * rinv * screening;
-	  else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq[itype][jtype]) {
+          r = sqrt(rsq);
+          rinv = 1.0/r;
+          screening = exp(-kappa*r);
+          forcecoul = qqrd2e * qtmp*q[j] * screening * (kappa + rinv);
+          forcecoul *= factor_coul;
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          forcelj *= factor_lj;
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq[itype][jtype])
+            ecoul = factor_coul * qqrd2e * qtmp*q[j] * rinv * screening;
+          else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_cut_coul_debye_omp.h b/src/USER-OMP/pair_lj_cut_coul_debye_omp.h
index e2205cb7ce..b327fc665f 100644
--- a/src/USER-OMP/pair_lj_cut_coul_debye_omp.h
+++ b/src/USER-OMP/pair_lj_cut_coul_debye_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp
index 5f9b80ac80..19639ac731 100644
--- a/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp
+++ b/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp
@@ -65,11 +65,11 @@ void PairLJCutCoulLongOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -135,71 +135,71 @@ void PairLJCutCoulLongOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  forcelj *= factor_lj;
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          forcelj *= factor_lj;
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_cut_coul_long_omp.h b/src/USER-OMP/pair_lj_cut_coul_long_omp.h
index a907959ae3..cea3271af0 100644
--- a/src/USER-OMP/pair_lj_cut_coul_long_omp.h
+++ b/src/USER-OMP/pair_lj_cut_coul_long_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_cut_coul_long_tip4p_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_long_tip4p_omp.cpp
index 3e03fa6b97..e11d7769f6 100644
--- a/src/USER-OMP/pair_lj_cut_coul_long_tip4p_omp.cpp
+++ b/src/USER-OMP/pair_lj_cut_coul_long_tip4p_omp.cpp
@@ -119,25 +119,25 @@ void PairLJCutCoulLongTIP4POMP::compute(int eflag, int vflag)
   if (!ncoultablebits) {
     if (evflag) {
       if (eflag) {
-	if (vflag) eval<1,1,1,1>(ifrom, ito, thr);
-	else eval<1,1,1,0>(ifrom, ito, thr);
+        if (vflag) eval<1,1,1,1>(ifrom, ito, thr);
+        else eval<1,1,1,0>(ifrom, ito, thr);
       } else {
-	if (vflag) eval<1,1,0,1>(ifrom, ito, thr);
-	else eval<1,1,0,0>(ifrom, ito, thr);
+        if (vflag) eval<1,1,0,1>(ifrom, ito, thr);
+        else eval<1,1,0,0>(ifrom, ito, thr);
       }
     } else eval<1,0,0,0>(ifrom, ito, thr);
   } else {
     if (evflag) {
       if (eflag) {
-	if (vflag) eval<0,1,1,1>(ifrom, ito, thr);
-	else eval<0,1,1,0>(ifrom, ito, thr);
+        if (vflag) eval<0,1,1,1>(ifrom, ito, thr);
+        else eval<0,1,1,0>(ifrom, ito, thr);
       } else {
-	if (vflag) eval<0,1,0,1>(ifrom, ito, thr);
-	else eval<0,1,0,0>(ifrom, ito, thr);
+        if (vflag) eval<0,1,0,1>(ifrom, ito, thr);
+        else eval<0,1,0,0>(ifrom, ito, thr);
       }
     } else eval<0,0,0,0>(ifrom, ito, thr);
   }
-  
+
 
     reduce_thr(this, eflag, vflag, thr);
   } // end of omp parallel region
@@ -214,26 +214,26 @@ void PairLJCutCoulLongTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
       // LJ interaction based on true rsq
 
       if (rsq < cut_ljsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	forcelj *= factor_lj * r2inv;
-
-	fxtmp += delx*forcelj;
-	fytmp += dely*forcelj;
-	fztmp += delz*forcelj;
-	f[j][0] -= delx*forcelj;
-	f[j][1] -= dely*forcelj;
-	f[j][2] -= delz*forcelj;
-
-	if (EFLAG) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	} else evdwl = 0.0;
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal, /* newton_pair = */ 1,
-				 evdwl,0.0,forcelj,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        forcelj *= factor_lj * r2inv;
+
+        fxtmp += delx*forcelj;
+        fytmp += dely*forcelj;
+        fztmp += delz*forcelj;
+        f[j][0] -= delx*forcelj;
+        f[j][1] -= dely*forcelj;
+        f[j][2] -= delz*forcelj;
+
+        if (EFLAG) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        } else evdwl = 0.0;
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal, /* newton_pair = */ 1,
+                                 evdwl,0.0,forcelj,delx,dely,delz,thr);
       }
 
       // adjust rsq and delxyz for off-site O charge(s),
@@ -241,213 +241,213 @@ void PairLJCutCoulLongTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
 
       if (rsq < cut_coulsqplus) {
 
-	if (itype == typeO || jtype == typeO) {
-	  x2 = mpos[j];
-	  jH1 = h1idx[j];
-	  jH2 = h2idx[j];
-
-	  if (check_error_thr((jtype == typeO  && ( jH1 < 0 || jH2 < 0 )),
-			      tid, FLERR,"TIP4P hydrogen is missing"))
-	    return;
-
-	  delx = x1[0] - x2[0];
-	  dely = x1[1] - x2[1];
-	  delz = x1[2] - x2[2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-	}
-
-	// Coulombic interaction based on modified rsq
-
-	if (rsq < cut_coulsq) {
-	  r2inv = 1 / rsq;
-	  if (CTABLE || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) {
-	      forcecoul -= (1.0-factor_coul)*prefactor; 
-	    }
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-
-	  cforce = forcecoul * r2inv;
-
-	  // if i,j are not O atoms, force is applied directly
-	  // if i or j are O atoms, force is on fictitious atom & partitioned
-	  // force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
-	  // f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
-	  // preserves total force and torque on water molecule
-	  // virial = sum(r x F) where each water's atoms are near xi and xj
-	  // vlist stores 2,4,6 atoms whose forces contribute to virial
-
-	  n = 0;
-
-	  if (itype != typeO) {
-	    fxtmp += delx * cforce;
-	    fytmp += dely * cforce;
-	    fztmp += delz * cforce;
-
-	    if (VFLAG) {
-	      v[0] = x[i][0] * delx * cforce;
-	      v[1] = x[i][1] * dely * cforce;
-	      v[2] = x[i][2] * delz * cforce;
-	      v[3] = x[i][0] * dely * cforce;
-	      v[4] = x[i][0] * delz * cforce;
-	      v[5] = x[i][1] * delz * cforce;
-	      vlist[n++] = i;
-	    }
-
-	  } else {
-
-	    fdx = delx*cforce;
-	    fdy = dely*cforce;
-	    fdz = delz*cforce;
-
-	    delxOM = x[i][0] - x1[0];
-	    delyOM = x[i][1] - x1[1];
-	    delzOM = x[i][2] - x1[2];
-
-	    ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
-	      (qdist*qdist);
-
-	    f1x = alpha * (fdx - ddotf * delxOM);
-	    f1y = alpha * (fdy - ddotf * delyOM);
-	    f1z = alpha * (fdz - ddotf * delzOM);
-
-	    fOx = fdx - f1x;
-	    fOy = fdy - f1y;
-	    fOz = fdz - f1z;
-
-	    fHx = 0.5 * f1x;
-	    fHy = 0.5 * f1y;
-	    fHz = 0.5 * f1z;
-
-	    fxtmp += fOx;
-	    fytmp += fOy;
-	    fztmp += fOz;
-
-	    f[iH1][0] += fHx;
-	    f[iH1][1] += fHy;
-	    f[iH1][2] += fHz;
-
-	    f[iH2][0] += fHx;
-	    f[iH2][1] += fHy;
-	    f[iH2][2] += fHz;
-
-	    if (VFLAG) {
-	      domain->closest_image(x[i],x[iH1],xH1);
-	      domain->closest_image(x[i],x[iH2],xH2);
-
-	      v[0] = x[i][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
-	      v[1] = x[i][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
-	      v[2] = x[i][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
-	      v[3] = x[i][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
-	      v[4] = x[i][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
-	      v[5] = x[i][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
-
-	      vlist[n++] = i;
-	      vlist[n++] = iH1;
-	      vlist[n++] = iH2;
-	    }
-	  }
-
-	  if (jtype != typeO) {
-	    f[j][0] -= delx * cforce;
-	    f[j][1] -= dely * cforce;
-	    f[j][2] -= delz * cforce;
-
-	    if (VFLAG) {
-	      v[0] -= x[j][0] * delx * cforce;
-	      v[1] -= x[j][1] * dely * cforce;
-	      v[2] -= x[j][2] * delz * cforce;
-	      v[3] -= x[j][0] * dely * cforce;
-	      v[4] -= x[j][0] * delz * cforce;
-	      v[5] -= x[j][1] * delz * cforce;
-	      vlist[n++] = j;
-	    }
-
-	  } else {
-
-	    fdx = -delx*cforce;
-	    fdy = -dely*cforce;
-	    fdz = -delz*cforce;
-
-	    delxOM = x[j][0] - x2[0];
-	    delyOM = x[j][1] - x2[1];
-	    delzOM = x[j][2] - x2[2];
-
-	    ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
-	      (qdist*qdist);
-
-	    f1x = alpha * (fdx - ddotf * delxOM);
-	    f1y = alpha * (fdy - ddotf * delyOM);
-	    f1z = alpha * (fdz - ddotf * delzOM);
-
-	    fOx = fdx - f1x;
-	    fOy = fdy - f1y;
-	    fOz = fdz - f1z;
-
-	    fHx = 0.5 * f1x;
-	    fHy = 0.5 * f1y;
-	    fHz = 0.5 * f1z;
-
-	    f[j][0] += fOx;
-	    f[j][1] += fOy;
-	    f[j][2] += fOz;
-
-	    f[jH1][0] += fHx;
-	    f[jH1][1] += fHy;
-	    f[jH1][2] += fHz;
-
-	    f[jH2][0] += fHx;
-	    f[jH2][1] += fHy;
-	    f[jH2][2] += fHz;
-
-	    if (VFLAG) {
-	      domain->closest_image(x[j],x[jH1],xH1);
-	      domain->closest_image(x[j],x[jH2],xH2);
-
-	      v[0] += x[j][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
-	      v[1] += x[j][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
-	      v[2] += x[j][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
-	      v[3] += x[j][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
-	      v[4] += x[j][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
-	      v[5] += x[j][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
-
-	      vlist[n++] = j;
-	      vlist[n++] = jH1;
-	      vlist[n++] = jH2;
-	    }
-	  }
-
-	  if (EFLAG) {
-	    if (CTABLE || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (EVFLAG) ev_tally_list_thr(this,n,vlist,ecoul,v,thr);
-	}
+        if (itype == typeO || jtype == typeO) {
+          x2 = mpos[j];
+          jH1 = h1idx[j];
+          jH2 = h2idx[j];
+
+          if (check_error_thr((jtype == typeO  && ( jH1 < 0 || jH2 < 0 )),
+                              tid, FLERR,"TIP4P hydrogen is missing"))
+            return;
+
+          delx = x1[0] - x2[0];
+          dely = x1[1] - x2[1];
+          delz = x1[2] - x2[2];
+          rsq = delx*delx + dely*dely + delz*delz;
+        }
+
+        // Coulombic interaction based on modified rsq
+
+        if (rsq < cut_coulsq) {
+          r2inv = 1 / rsq;
+          if (CTABLE || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) {
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+
+          cforce = forcecoul * r2inv;
+
+          // if i,j are not O atoms, force is applied directly
+          // if i or j are O atoms, force is on fictitious atom & partitioned
+          // force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
+          // f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
+          // preserves total force and torque on water molecule
+          // virial = sum(r x F) where each water's atoms are near xi and xj
+          // vlist stores 2,4,6 atoms whose forces contribute to virial
+
+          n = 0;
+
+          if (itype != typeO) {
+            fxtmp += delx * cforce;
+            fytmp += dely * cforce;
+            fztmp += delz * cforce;
+
+            if (VFLAG) {
+              v[0] = x[i][0] * delx * cforce;
+              v[1] = x[i][1] * dely * cforce;
+              v[2] = x[i][2] * delz * cforce;
+              v[3] = x[i][0] * dely * cforce;
+              v[4] = x[i][0] * delz * cforce;
+              v[5] = x[i][1] * delz * cforce;
+              vlist[n++] = i;
+            }
+
+          } else {
+
+            fdx = delx*cforce;
+            fdy = dely*cforce;
+            fdz = delz*cforce;
+
+            delxOM = x[i][0] - x1[0];
+            delyOM = x[i][1] - x1[1];
+            delzOM = x[i][2] - x1[2];
+
+            ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
+              (qdist*qdist);
+
+            f1x = alpha * (fdx - ddotf * delxOM);
+            f1y = alpha * (fdy - ddotf * delyOM);
+            f1z = alpha * (fdz - ddotf * delzOM);
+
+            fOx = fdx - f1x;
+            fOy = fdy - f1y;
+            fOz = fdz - f1z;
+
+            fHx = 0.5 * f1x;
+            fHy = 0.5 * f1y;
+            fHz = 0.5 * f1z;
+
+            fxtmp += fOx;
+            fytmp += fOy;
+            fztmp += fOz;
+
+            f[iH1][0] += fHx;
+            f[iH1][1] += fHy;
+            f[iH1][2] += fHz;
+
+            f[iH2][0] += fHx;
+            f[iH2][1] += fHy;
+            f[iH2][2] += fHz;
+
+            if (VFLAG) {
+              domain->closest_image(x[i],x[iH1],xH1);
+              domain->closest_image(x[i],x[iH2],xH2);
+
+              v[0] = x[i][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
+              v[1] = x[i][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
+              v[2] = x[i][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
+              v[3] = x[i][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
+              v[4] = x[i][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
+              v[5] = x[i][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
+
+              vlist[n++] = i;
+              vlist[n++] = iH1;
+              vlist[n++] = iH2;
+            }
+          }
+
+          if (jtype != typeO) {
+            f[j][0] -= delx * cforce;
+            f[j][1] -= dely * cforce;
+            f[j][2] -= delz * cforce;
+
+            if (VFLAG) {
+              v[0] -= x[j][0] * delx * cforce;
+              v[1] -= x[j][1] * dely * cforce;
+              v[2] -= x[j][2] * delz * cforce;
+              v[3] -= x[j][0] * dely * cforce;
+              v[4] -= x[j][0] * delz * cforce;
+              v[5] -= x[j][1] * delz * cforce;
+              vlist[n++] = j;
+            }
+
+          } else {
+
+            fdx = -delx*cforce;
+            fdy = -dely*cforce;
+            fdz = -delz*cforce;
+
+            delxOM = x[j][0] - x2[0];
+            delyOM = x[j][1] - x2[1];
+            delzOM = x[j][2] - x2[2];
+
+            ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
+              (qdist*qdist);
+
+            f1x = alpha * (fdx - ddotf * delxOM);
+            f1y = alpha * (fdy - ddotf * delyOM);
+            f1z = alpha * (fdz - ddotf * delzOM);
+
+            fOx = fdx - f1x;
+            fOy = fdy - f1y;
+            fOz = fdz - f1z;
+
+            fHx = 0.5 * f1x;
+            fHy = 0.5 * f1y;
+            fHz = 0.5 * f1z;
+
+            f[j][0] += fOx;
+            f[j][1] += fOy;
+            f[j][2] += fOz;
+
+            f[jH1][0] += fHx;
+            f[jH1][1] += fHy;
+            f[jH1][2] += fHz;
+
+            f[jH2][0] += fHx;
+            f[jH2][1] += fHy;
+            f[jH2][2] += fHz;
+
+            if (VFLAG) {
+              domain->closest_image(x[j],x[jH1],xH1);
+              domain->closest_image(x[j],x[jH2],xH2);
+
+              v[0] += x[j][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
+              v[1] += x[j][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
+              v[2] += x[j][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
+              v[3] += x[j][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
+              v[4] += x[j][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
+              v[5] += x[j][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
+
+              vlist[n++] = j;
+              vlist[n++] = jH1;
+              vlist[n++] = jH2;
+            }
+          }
+
+          if (EFLAG) {
+            if (CTABLE || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (EVFLAG) ev_tally_list_thr(this,n,vlist,ecoul,v,thr);
+        }
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_cut_coul_long_tip4p_omp.h b/src/USER-OMP/pair_lj_cut_coul_long_tip4p_omp.h
index 37743abf14..4610e1f23e 100644
--- a/src/USER-OMP/pair_lj_cut_coul_long_tip4p_omp.h
+++ b/src/USER-OMP/pair_lj_cut_coul_long_tip4p_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_cut_coul_pppm_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_pppm_omp.cpp
index bc767958bb..093f8d0216 100644
--- a/src/USER-OMP/pair_lj_cut_coul_pppm_omp.cpp
+++ b/src/USER-OMP/pair_lj_cut_coul_pppm_omp.cpp
@@ -90,19 +90,19 @@ void PairLJCutCoulPPPMOMP::compute(int eflag, int vflag)
       kspace->compute_proxy(eflag,vflag);
     } else {
       if (evflag) {
-	if (eflag) {
-	  if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	  else eval<1,1,0>(ifrom, ito, thr);
-	} else {
-	  if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	  else eval<1,0,0>(ifrom, ito, thr);
-	}
+        if (eflag) {
+          if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+          else eval<1,1,0>(ifrom, ito, thr);
+        } else {
+          if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+          else eval<1,0,0>(ifrom, ito, thr);
+        }
       } else {
-	if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
-	else eval<0,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
+        else eval<0,0,0>(ifrom, ito, thr);
       }
     }
-    
+
     sync_threads();
     reduce_thr(this, eflag, vflag, thr, nproxy);
   } // end of omp parallel region
@@ -162,71 +162,71 @@ void PairLJCutCoulPPPMOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  forcelj *= factor_lj;
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    if (!ncoultablebits || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          forcelj *= factor_lj;
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            if (!ncoultablebits || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_cut_coul_pppm_omp.h b/src/USER-OMP/pair_lj_cut_coul_pppm_omp.h
index 010b7818b2..092996a21f 100644
--- a/src/USER-OMP/pair_lj_cut_coul_pppm_omp.h
+++ b/src/USER-OMP/pair_lj_cut_coul_pppm_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_cut_coul_pppm_tip4p_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_pppm_tip4p_omp.cpp
index eb780621cb..63c4658347 100644
--- a/src/USER-OMP/pair_lj_cut_coul_pppm_tip4p_omp.cpp
+++ b/src/USER-OMP/pair_lj_cut_coul_pppm_tip4p_omp.cpp
@@ -46,7 +46,7 @@ PairLJCutCoulPPPMTIP4POMP::PairLJCutCoulPPPMTIP4POMP(LAMMPS *lmp) :
   suffix_flag |= Suffix::OMP;
   respa_enable = 0;
   nproxy=1;
-  
+
   kspace = NULL;
 
   // for caching m-shift corrected positions
@@ -138,25 +138,25 @@ void PairLJCutCoulPPPMTIP4POMP::compute(int eflag, int vflag)
       kspace->compute_proxy(eflag,vflag);
     } else {
       if (!ncoultablebits) {
-	if (evflag) {
-	  if (eflag) {
-	    if (vflag) eval<1,1,1,1>(ifrom, ito, thr);
-	    else eval<1,1,1,0>(ifrom, ito, thr);
-	  } else {
-	    if (vflag) eval<1,1,0,1>(ifrom, ito, thr);
-	    else eval<1,1,0,0>(ifrom, ito, thr);
-	  }
-	} else eval<1,0,0,0>(ifrom, ito, thr);
+        if (evflag) {
+          if (eflag) {
+            if (vflag) eval<1,1,1,1>(ifrom, ito, thr);
+            else eval<1,1,1,0>(ifrom, ito, thr);
+          } else {
+            if (vflag) eval<1,1,0,1>(ifrom, ito, thr);
+            else eval<1,1,0,0>(ifrom, ito, thr);
+          }
+        } else eval<1,0,0,0>(ifrom, ito, thr);
       } else {
-	if (evflag) {
-	  if (eflag) {
-	    if (vflag) eval<0,1,1,1>(ifrom, ito, thr);
-	    else eval<0,1,1,0>(ifrom, ito, thr);
-	  } else {
-	    if (vflag) eval<0,1,0,1>(ifrom, ito, thr);
-	    else eval<0,1,0,0>(ifrom, ito, thr);
-	  }
-	} else eval<0,0,0,0>(ifrom, ito, thr);
+        if (evflag) {
+          if (eflag) {
+            if (vflag) eval<0,1,1,1>(ifrom, ito, thr);
+            else eval<0,1,1,0>(ifrom, ito, thr);
+          } else {
+            if (vflag) eval<0,1,0,1>(ifrom, ito, thr);
+            else eval<0,1,0,0>(ifrom, ito, thr);
+          }
+        } else eval<0,0,0,0>(ifrom, ito, thr);
       }
     }
 
@@ -236,26 +236,26 @@ void PairLJCutCoulPPPMTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
       // LJ interaction based on true rsq
 
       if (rsq < cut_ljsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	forcelj *= factor_lj * r2inv;
-
-	fxtmp += delx*forcelj;
-	fytmp += dely*forcelj;
-	fztmp += delz*forcelj;
-	f[j][0] -= delx*forcelj;
-	f[j][1] -= dely*forcelj;
-	f[j][2] -= delz*forcelj;
-
-	if (EFLAG) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	} else evdwl = 0.0;
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal, /* newton_pair = */ 1,
-				 evdwl,0.0,forcelj,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        forcelj *= factor_lj * r2inv;
+
+        fxtmp += delx*forcelj;
+        fytmp += dely*forcelj;
+        fztmp += delz*forcelj;
+        f[j][0] -= delx*forcelj;
+        f[j][1] -= dely*forcelj;
+        f[j][2] -= delz*forcelj;
+
+        if (EFLAG) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        } else evdwl = 0.0;
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal, /* newton_pair = */ 1,
+                                 evdwl,0.0,forcelj,delx,dely,delz,thr);
       }
 
       // adjust rsq and delxyz for off-site O charge(s),
@@ -263,213 +263,213 @@ void PairLJCutCoulPPPMTIP4POMP::eval(int iifrom, int iito, ThrData * const thr)
 
       if (rsq < cut_coulsqplus) {
 
-	if (itype == typeO || jtype == typeO) {
-	  x2 = mpos[j];
-	  jH1 = h1idx[j];
-	  jH2 = h2idx[j];
-
-	  if (check_error_thr((jtype == typeO  && ( jH1 < 0 || jH2 < 0 )),
-			      tid, FLERR,"TIP4P hydrogen is missing"))
-	    return;
-
-	  delx = x1[0] - x2[0];
-	  dely = x1[1] - x2[1];
-	  delz = x1[2] - x2[2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-	}
-
-	// Coulombic interaction based on modified rsq
-
-	if (rsq < cut_coulsq) {
-	  r2inv = 1 / rsq;
-	  if (CTABLE || rsq <= tabinnersq) {
-	    r = sqrt(rsq);
-	    grij = g_ewald * r;
-	    expm2 = exp(-grij*grij);
-	    t = 1.0 / (1.0 + EWALD_P*grij);
-	    erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (factor_coul < 1.0) {
-	      forcecoul -= (1.0-factor_coul)*prefactor; 
-	    }
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    itable = rsq_lookup.i & ncoulmask;
-	    itable >>= ncoulshiftbits;
-	    fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (factor_coul < 1.0) {
-	      table = ctable[itable] + fraction*dctable[itable];
-	      prefactor = qtmp*q[j] * table;
-	      forcecoul -= (1.0-factor_coul)*prefactor;
-	    }
-	  }
-
-	  cforce = forcecoul * r2inv;
-
-	  // if i,j are not O atoms, force is applied directly
-	  // if i or j are O atoms, force is on fictitious atom & partitioned
-	  // force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
-	  // f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
-	  // preserves total force and torque on water molecule
-	  // virial = sum(r x F) where each water's atoms are near xi and xj
-	  // vlist stores 2,4,6 atoms whose forces contribute to virial
-
-	  n = 0;
-
-	  if (itype != typeO) {
-	    fxtmp += delx * cforce;
-	    fytmp += dely * cforce;
-	    fztmp += delz * cforce;
-
-	    if (VFLAG) {
-	      v[0] = x[i][0] * delx * cforce;
-	      v[1] = x[i][1] * dely * cforce;
-	      v[2] = x[i][2] * delz * cforce;
-	      v[3] = x[i][0] * dely * cforce;
-	      v[4] = x[i][0] * delz * cforce;
-	      v[5] = x[i][1] * delz * cforce;
-	      vlist[n++] = i;
-	    }
-
-	  } else {
-
-	    fdx = delx*cforce;
-	    fdy = dely*cforce;
-	    fdz = delz*cforce;
-
-	    delxOM = x[i][0] - x1[0];
-	    delyOM = x[i][1] - x1[1];
-	    delzOM = x[i][2] - x1[2];
-
-	    ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
-	      (qdist*qdist);
-
-	    f1x = alpha * (fdx - ddotf * delxOM);
-	    f1y = alpha * (fdy - ddotf * delyOM);
-	    f1z = alpha * (fdz - ddotf * delzOM);
-
-	    fOx = fdx - f1x;
-	    fOy = fdy - f1y;
-	    fOz = fdz - f1z;
-
-	    fHx = 0.5 * f1x;
-	    fHy = 0.5 * f1y;
-	    fHz = 0.5 * f1z;
-
-	    fxtmp += fOx;
-	    fytmp += fOy;
-	    fztmp += fOz;
-
-	    f[iH1][0] += fHx;
-	    f[iH1][1] += fHy;
-	    f[iH1][2] += fHz;
-
-	    f[iH2][0] += fHx;
-	    f[iH2][1] += fHy;
-	    f[iH2][2] += fHz;
-
-	    if (VFLAG) {
-	      domain->closest_image(x[i],x[iH1],xH1);
-	      domain->closest_image(x[i],x[iH2],xH2);
-
-	      v[0] = x[i][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
-	      v[1] = x[i][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
-	      v[2] = x[i][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
-	      v[3] = x[i][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
-	      v[4] = x[i][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
-	      v[5] = x[i][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
-
-	      vlist[n++] = i;
-	      vlist[n++] = iH1;
-	      vlist[n++] = iH2;
-	    }
-	  }
-
-	  if (jtype != typeO) {
-	    f[j][0] -= delx * cforce;
-	    f[j][1] -= dely * cforce;
-	    f[j][2] -= delz * cforce;
-
-	    if (VFLAG) {
-	      v[0] -= x[j][0] * delx * cforce;
-	      v[1] -= x[j][1] * dely * cforce;
-	      v[2] -= x[j][2] * delz * cforce;
-	      v[3] -= x[j][0] * dely * cforce;
-	      v[4] -= x[j][0] * delz * cforce;
-	      v[5] -= x[j][1] * delz * cforce;
-	      vlist[n++] = j;
-	    }
-
-	  } else {
-
-	    fdx = -delx*cforce;
-	    fdy = -dely*cforce;
-	    fdz = -delz*cforce;
-
-	    delxOM = x[j][0] - x2[0];
-	    delyOM = x[j][1] - x2[1];
-	    delzOM = x[j][2] - x2[2];
-
-	    ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
-	      (qdist*qdist);
-
-	    f1x = alpha * (fdx - ddotf * delxOM);
-	    f1y = alpha * (fdy - ddotf * delyOM);
-	    f1z = alpha * (fdz - ddotf * delzOM);
-
-	    fOx = fdx - f1x;
-	    fOy = fdy - f1y;
-	    fOz = fdz - f1z;
-
-	    fHx = 0.5 * f1x;
-	    fHy = 0.5 * f1y;
-	    fHz = 0.5 * f1z;
-
-	    f[j][0] += fOx;
-	    f[j][1] += fOy;
-	    f[j][2] += fOz;
-
-	    f[jH1][0] += fHx;
-	    f[jH1][1] += fHy;
-	    f[jH1][2] += fHz;
-
-	    f[jH2][0] += fHx;
-	    f[jH2][1] += fHy;
-	    f[jH2][2] += fHz;
-
-	    if (VFLAG) {
-	      domain->closest_image(x[j],x[jH1],xH1);
-	      domain->closest_image(x[j],x[jH2],xH2);
-
-	      v[0] += x[j][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
-	      v[1] += x[j][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
-	      v[2] += x[j][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
-	      v[3] += x[j][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
-	      v[4] += x[j][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
-	      v[5] += x[j][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
-
-	      vlist[n++] = j;
-	      vlist[n++] = jH1;
-	      vlist[n++] = jH2;
-	    }
-	  }
-
-	  if (EFLAG) {
-	    if (CTABLE || rsq <= tabinnersq)
-	      ecoul = prefactor*erfc;
-	    else {
-	      table = etable[itable] + fraction*detable[itable];
-	      ecoul = qtmp*q[j] * table;
-	    }
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-
-	  if (EVFLAG) ev_tally_list_thr(this,n,vlist,ecoul,v,thr);
-	}
+        if (itype == typeO || jtype == typeO) {
+          x2 = mpos[j];
+          jH1 = h1idx[j];
+          jH2 = h2idx[j];
+
+          if (check_error_thr((jtype == typeO  && ( jH1 < 0 || jH2 < 0 )),
+                              tid, FLERR,"TIP4P hydrogen is missing"))
+            return;
+
+          delx = x1[0] - x2[0];
+          dely = x1[1] - x2[1];
+          delz = x1[2] - x2[2];
+          rsq = delx*delx + dely*dely + delz*delz;
+        }
+
+        // Coulombic interaction based on modified rsq
+
+        if (rsq < cut_coulsq) {
+          r2inv = 1 / rsq;
+          if (CTABLE || rsq <= tabinnersq) {
+            r = sqrt(rsq);
+            grij = g_ewald * r;
+            expm2 = exp(-grij*grij);
+            t = 1.0 / (1.0 + EWALD_P*grij);
+            erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (factor_coul < 1.0) {
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            itable = rsq_lookup.i & ncoulmask;
+            itable >>= ncoulshiftbits;
+            fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (factor_coul < 1.0) {
+              table = ctable[itable] + fraction*dctable[itable];
+              prefactor = qtmp*q[j] * table;
+              forcecoul -= (1.0-factor_coul)*prefactor;
+            }
+          }
+
+          cforce = forcecoul * r2inv;
+
+          // if i,j are not O atoms, force is applied directly
+          // if i or j are O atoms, force is on fictitious atom & partitioned
+          // force partitioning due to Feenstra, J Comp Chem, 20, 786 (1999)
+          // f_f = fictitious force, fO = f_f (1 - 2 alpha), fH = alpha f_f
+          // preserves total force and torque on water molecule
+          // virial = sum(r x F) where each water's atoms are near xi and xj
+          // vlist stores 2,4,6 atoms whose forces contribute to virial
+
+          n = 0;
+
+          if (itype != typeO) {
+            fxtmp += delx * cforce;
+            fytmp += dely * cforce;
+            fztmp += delz * cforce;
+
+            if (VFLAG) {
+              v[0] = x[i][0] * delx * cforce;
+              v[1] = x[i][1] * dely * cforce;
+              v[2] = x[i][2] * delz * cforce;
+              v[3] = x[i][0] * dely * cforce;
+              v[4] = x[i][0] * delz * cforce;
+              v[5] = x[i][1] * delz * cforce;
+              vlist[n++] = i;
+            }
+
+          } else {
+
+            fdx = delx*cforce;
+            fdy = dely*cforce;
+            fdz = delz*cforce;
+
+            delxOM = x[i][0] - x1[0];
+            delyOM = x[i][1] - x1[1];
+            delzOM = x[i][2] - x1[2];
+
+            ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
+              (qdist*qdist);
+
+            f1x = alpha * (fdx - ddotf * delxOM);
+            f1y = alpha * (fdy - ddotf * delyOM);
+            f1z = alpha * (fdz - ddotf * delzOM);
+
+            fOx = fdx - f1x;
+            fOy = fdy - f1y;
+            fOz = fdz - f1z;
+
+            fHx = 0.5 * f1x;
+            fHy = 0.5 * f1y;
+            fHz = 0.5 * f1z;
+
+            fxtmp += fOx;
+            fytmp += fOy;
+            fztmp += fOz;
+
+            f[iH1][0] += fHx;
+            f[iH1][1] += fHy;
+            f[iH1][2] += fHz;
+
+            f[iH2][0] += fHx;
+            f[iH2][1] += fHy;
+            f[iH2][2] += fHz;
+
+            if (VFLAG) {
+              domain->closest_image(x[i],x[iH1],xH1);
+              domain->closest_image(x[i],x[iH2],xH2);
+
+              v[0] = x[i][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
+              v[1] = x[i][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
+              v[2] = x[i][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
+              v[3] = x[i][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
+              v[4] = x[i][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
+              v[5] = x[i][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
+
+              vlist[n++] = i;
+              vlist[n++] = iH1;
+              vlist[n++] = iH2;
+            }
+          }
+
+          if (jtype != typeO) {
+            f[j][0] -= delx * cforce;
+            f[j][1] -= dely * cforce;
+            f[j][2] -= delz * cforce;
+
+            if (VFLAG) {
+              v[0] -= x[j][0] * delx * cforce;
+              v[1] -= x[j][1] * dely * cforce;
+              v[2] -= x[j][2] * delz * cforce;
+              v[3] -= x[j][0] * dely * cforce;
+              v[4] -= x[j][0] * delz * cforce;
+              v[5] -= x[j][1] * delz * cforce;
+              vlist[n++] = j;
+            }
+
+          } else {
+
+            fdx = -delx*cforce;
+            fdy = -dely*cforce;
+            fdz = -delz*cforce;
+
+            delxOM = x[j][0] - x2[0];
+            delyOM = x[j][1] - x2[1];
+            delzOM = x[j][2] - x2[2];
+
+            ddotf = (delxOM * fdx + delyOM * fdy + delzOM * fdz) /
+              (qdist*qdist);
+
+            f1x = alpha * (fdx - ddotf * delxOM);
+            f1y = alpha * (fdy - ddotf * delyOM);
+            f1z = alpha * (fdz - ddotf * delzOM);
+
+            fOx = fdx - f1x;
+            fOy = fdy - f1y;
+            fOz = fdz - f1z;
+
+            fHx = 0.5 * f1x;
+            fHy = 0.5 * f1y;
+            fHz = 0.5 * f1z;
+
+            f[j][0] += fOx;
+            f[j][1] += fOy;
+            f[j][2] += fOz;
+
+            f[jH1][0] += fHx;
+            f[jH1][1] += fHy;
+            f[jH1][2] += fHz;
+
+            f[jH2][0] += fHx;
+            f[jH2][1] += fHy;
+            f[jH2][2] += fHz;
+
+            if (VFLAG) {
+              domain->closest_image(x[j],x[jH1],xH1);
+              domain->closest_image(x[j],x[jH2],xH2);
+
+              v[0] += x[j][0]*fOx + xH1[0]*fHx + xH2[0]*fHx;
+              v[1] += x[j][1]*fOy + xH1[1]*fHy + xH2[1]*fHy;
+              v[2] += x[j][2]*fOz + xH1[2]*fHz + xH2[2]*fHz;
+              v[3] += x[j][0]*fOy + xH1[0]*fHy + xH2[0]*fHy;
+              v[4] += x[j][0]*fOz + xH1[0]*fHz + xH2[0]*fHz;
+              v[5] += x[j][1]*fOz + xH1[1]*fHz + xH2[1]*fHz;
+
+              vlist[n++] = j;
+              vlist[n++] = jH1;
+              vlist[n++] = jH2;
+            }
+          }
+
+          if (EFLAG) {
+            if (CTABLE || rsq <= tabinnersq)
+              ecoul = prefactor*erfc;
+            else {
+              table = etable[itable] + fraction*detable[itable];
+              ecoul = qtmp*q[j] * table;
+            }
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+
+          if (EVFLAG) ev_tally_list_thr(this,n,vlist,ecoul,v,thr);
+        }
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_cut_coul_pppm_tip4p_omp.h b/src/USER-OMP/pair_lj_cut_coul_pppm_tip4p_omp.h
index 4596369324..6811b09738 100644
--- a/src/USER-OMP/pair_lj_cut_coul_pppm_tip4p_omp.h
+++ b/src/USER-OMP/pair_lj_cut_coul_pppm_tip4p_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_omp.cpp
index f8d3b1f8ac..83e5244add 100644
--- a/src/USER-OMP/pair_lj_cut_omp.cpp
+++ b/src/USER-OMP/pair_lj_cut_omp.cpp
@@ -57,11 +57,11 @@ void PairLJCutOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -118,28 +118,28 @@ void PairLJCutOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype])
-	    - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype])
+            - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_cut_omp.h b/src/USER-OMP/pair_lj_cut_omp.h
index f97996e480..419b0693b1 100644
--- a/src/USER-OMP/pair_lj_cut_omp.h
+++ b/src/USER-OMP/pair_lj_cut_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_expand_omp.cpp b/src/USER-OMP/pair_lj_expand_omp.cpp
index 5d64d0d0e6..936c55c827 100644
--- a/src/USER-OMP/pair_lj_expand_omp.cpp
+++ b/src/USER-OMP/pair_lj_expand_omp.cpp
@@ -56,11 +56,11 @@ void PairLJExpandOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -118,31 +118,31 @@ void PairLJExpandOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	rshift = r - shift[itype][jtype];
-	rshiftsq = rshift*rshift;
-	r2inv = 1.0/rshiftsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj/rshift/r;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype])
-	    - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r = sqrt(rsq);
+        rshift = r - shift[itype][jtype];
+        rshiftsq = rshift*rshift;
+        r2inv = 1.0/rshiftsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj/rshift/r;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype])
+            - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_expand_omp.h b/src/USER-OMP/pair_lj_expand_omp.h
index 9ff8d3080a..53728ead6d 100644
--- a/src/USER-OMP/pair_lj_expand_omp.h
+++ b/src/USER-OMP/pair_lj_expand_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp
index bf3e2046d7..4df4d334e7 100644
--- a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp
+++ b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp
@@ -56,11 +56,11 @@ void PairLJGromacsCoulGromacsOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -125,70 +125,70 @@ void PairLJGromacsCoulGromacsOMP::eval(int iifrom, int iito, ThrData * const thr
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
+        r2inv = 1.0/rsq;
 
-	// skip if qi or qj = 0.0 since this potential may be used as
-	// coarse-grain model with many uncharged atoms
+        // skip if qi or qj = 0.0 since this potential may be used as
+        // coarse-grain model with many uncharged atoms
 
-	if (rsq < cut_coulsq && qtmp != 0.0 && q[j] != 0.0) {
-	  forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
+        if (rsq < cut_coulsq && qtmp != 0.0 && q[j] != 0.0) {
+          forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
           if (rsq > cut_coul_innersq) {
-            r = sqrt(rsq); 
-	    tc = r - cut_coul_inner;
+            r = sqrt(rsq);
+            tc = r - cut_coul_inner;
             fswitchcoul = qqrd2e * qtmp*q[j]*r*tc*tc*(coulsw1 + coulsw2*tc);
             forcecoul += fswitchcoul;
           }
-	  forcecoul *= factor_coul;
-	} else forcecoul = 0.0;
+          forcecoul *= factor_coul;
+        } else forcecoul = 0.0;
 
-	if (rsq < cut_ljsq) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  jtype = type[j];
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        if (rsq < cut_ljsq) {
+          r6inv = r2inv*r2inv*r2inv;
+          jtype = type[j];
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
           if (rsq > cut_lj_innersq) {
-            r = sqrt(rsq); 
-	    tlj = r - cut_lj_inner;
-	    fswitch = r*tlj*tlj*(ljsw1[itype][jtype] + 
-				 ljsw2[itype][jtype]*tlj);
-	    forcelj += fswitch;
+            r = sqrt(rsq);
+            tlj = r - cut_lj_inner;
+            fswitch = r*tlj*tlj*(ljsw1[itype][jtype] +
+                                 ljsw2[itype][jtype]*tlj);
+            forcelj += fswitch;
           }
-	  forcelj *= factor_lj;
-	} else forcelj = 0.0;
-
-	fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = qqrd2e * qtmp*q[j] * (sqrt(r2inv) - coulsw5);
+          forcelj *= factor_lj;
+        } else forcelj = 0.0;
+
+        fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_coulsq) {
+            ecoul = qqrd2e * qtmp*q[j] * (sqrt(r2inv) - coulsw5);
             if (rsq > cut_coul_innersq) {
               ecoulswitch = tc*tc*tc * (coulsw3 + coulsw4*tc);
               ecoul += qqrd2e*qtmp*q[j]*ecoulswitch;
             }
-	    ecoul *= factor_coul;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq) {
-	    evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	    evdwl += ljsw5[itype][jtype];
+            ecoul *= factor_coul;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq) {
+            evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+            evdwl += ljsw5[itype][jtype];
             if (rsq > cut_lj_innersq) {
-              eswitch = tlj*tlj*tlj * 
-		(ljsw3[itype][jtype] + ljsw4[itype][jtype]*tlj);
+              eswitch = tlj*tlj*tlj *
+                (ljsw3[itype][jtype] + ljsw4[itype][jtype]*tlj);
               evdwl += eswitch;
             }
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-	
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h
index ee506c2c4a..353e4d673d 100644
--- a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h
+++ b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_gromacs_omp.cpp b/src/USER-OMP/pair_lj_gromacs_omp.cpp
index 457dc233ce..ce97ad2d1d 100644
--- a/src/USER-OMP/pair_lj_gromacs_omp.cpp
+++ b/src/USER-OMP/pair_lj_gromacs_omp.cpp
@@ -56,11 +56,11 @@ void PairLJGromacsOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -118,39 +118,39 @@ void PairLJGromacsOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
         if (rsq > cut_inner_sq[itype][jtype]) {
-          r = sqrt(rsq); 
-	  t = r - cut_inner[itype][jtype];
-	  fswitch = r*t*t*(ljsw1[itype][jtype] + ljsw2[itype][jtype]*t);
-	  forcelj += fswitch;
+          r = sqrt(rsq);
+          t = r - cut_inner[itype][jtype];
+          fswitch = r*t*t*(ljsw1[itype][jtype] + ljsw2[itype][jtype]*t);
+          forcelj += fswitch;
         }
 
-	fpair = factor_lj*forcelj*r2inv;
+        fpair = factor_lj*forcelj*r2inv;
 
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
 
-	if (EFLAG) {
-	  evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]); 
-	  evdwl += ljsw5[itype][jtype];
+        if (EFLAG) {
+          evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+          evdwl += ljsw5[itype][jtype];
           if (rsq > cut_inner_sq[itype][jtype]) {
             eswitch = t*t*t*(ljsw3[itype][jtype] + ljsw4[itype][jtype]*t);
             evdwl += eswitch;
           }
-	  evdwl *= factor_lj;
-	}
+          evdwl *= factor_lj;
+        }
 
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_gromacs_omp.h b/src/USER-OMP/pair_lj_gromacs_omp.h
index 8e0f4bd281..3669d1b219 100644
--- a/src/USER-OMP/pair_lj_gromacs_omp.h
+++ b/src/USER-OMP/pair_lj_gromacs_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp b/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp
index 6632f4fc47..aa4e432a78 100644
--- a/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp
+++ b/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp
@@ -58,11 +58,11 @@ void PairLJSDKCoulLongOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval_thr<1,1,1>(ifrom, ito, thr);
-	else eval_thr<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval_thr<1,1,1>(ifrom, ito, thr);
+        else eval_thr<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval_thr<1,0,1>(ifrom, ito, thr);
-	else eval_thr<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval_thr<1,0,1>(ifrom, ito, thr);
+        else eval_thr<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval_thr<0,0,1>(ifrom, ito, thr);
@@ -122,100 +122,100 @@ void PairLJSDKCoulLongOMP::eval_thr(int iifrom, int iito, ThrData * const thr)
       const int jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	const double r2inv = 1.0/rsq;
-	const int ljt = lj_type[itype][jtype];
-
-	if (rsq < cut_coulsq) {
-	  if (!ncoultablebits || rsq <= tabinnersq) {
-	    const double A1 =  0.254829592;
-	    const double A2 = -0.284496736;
-	    const double A3 =  1.421413741;
-	    const double A4 = -1.453152027;
-	    const double A5 =  1.061405429;
-	    const double EWALD_F = 1.12837917;
-	    const double INV_EWALD_P = 1.0/0.3275911;
-
-	    const double r = sqrt(rsq);
-	    const double grij = g_ewald * r;
-	    const double expm2 = exp(-grij*grij);
-	    const double t = INV_EWALD_P / (INV_EWALD_P + grij);
-	    const double erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
-	    const double prefactor = qqrd2e * qtmp*q[j]/r;
-	    forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
-	    if (EFLAG) ecoul = prefactor*erfc;
-	    if (sbindex) {
-	      const double adjust = (1.0-special_coul[sbindex])*prefactor;
-	      forcecoul -= adjust;
-	      if (EFLAG) ecoul -= adjust;
-	    }
-	  } else {
-	    union_int_float_t rsq_lookup;
-	    rsq_lookup.f = rsq;
-	    const int itable = (rsq_lookup.i & ncoulmask) >> ncoulshiftbits;
-	    const double fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
-	    const double table = ftable[itable] + fraction*dftable[itable];
-	    forcecoul = qtmp*q[j] * table;
-	    if (EFLAG) ecoul = qtmp*q[j] * (etable[itable] + fraction*detable[itable]);
-	    if (sbindex) {
-	      const double table2 = ctable[itable] + fraction*dctable[itable];
-	      const double prefactor = qtmp*q[j] * table2;
-	      const double adjust = (1.0-special_coul[sbindex])*prefactor;
-	      forcecoul -= adjust;
-	      if (EFLAG) ecoul -= adjust;
-	    }
-	  }
-	}
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-
-	  if (ljt == LJ12_4) {
-	    const double r4inv=r2inv*r2inv;
-	    forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
-			     - lj2[itype][jtype]);
-
-	    if (EFLAG)
-	      evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
-			     - lj4[itype][jtype]) - offset[itype][jtype];
-
-	  } else if (ljt == LJ9_6) {
-	    const double r3inv = r2inv*sqrt(r2inv);
-	    const double r6inv = r3inv*r3inv;
-	    forcelj = r6inv*(lj1[itype][jtype]*r3inv
-			     - lj2[itype][jtype]);
-	    if (EFLAG)
-	      evdwl = r6inv*(lj3[itype][jtype]*r3inv
-			     - lj4[itype][jtype]) - offset[itype][jtype];
-
-	  } else if (ljt == LJ12_6) {
-	    const double r6inv = r2inv*r2inv*r2inv;
-	    forcelj = r6inv*(lj1[itype][jtype]*r6inv
-			     - lj2[itype][jtype]);
-	    if (EFLAG)
-	      evdwl = r6inv*(lj3[itype][jtype]*r6inv
-			     - lj4[itype][jtype]) - offset[itype][jtype];
-	  }
-
-	  if (sbindex) {
-	    const double factor_lj = special_lj[sbindex];
-	    forcelj *= factor_lj;
-	    if (EFLAG) evdwl *= factor_lj;
-	  }
-
-	}
-
-	const double fpair = (forcecoul + forcelj) * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,ecoul,fpair,delx,dely,delz,thr);
+        const double r2inv = 1.0/rsq;
+        const int ljt = lj_type[itype][jtype];
+
+        if (rsq < cut_coulsq) {
+          if (!ncoultablebits || rsq <= tabinnersq) {
+            const double A1 =  0.254829592;
+            const double A2 = -0.284496736;
+            const double A3 =  1.421413741;
+            const double A4 = -1.453152027;
+            const double A5 =  1.061405429;
+            const double EWALD_F = 1.12837917;
+            const double INV_EWALD_P = 1.0/0.3275911;
+
+            const double r = sqrt(rsq);
+            const double grij = g_ewald * r;
+            const double expm2 = exp(-grij*grij);
+            const double t = INV_EWALD_P / (INV_EWALD_P + grij);
+            const double erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+            const double prefactor = qqrd2e * qtmp*q[j]/r;
+            forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+            if (EFLAG) ecoul = prefactor*erfc;
+            if (sbindex) {
+              const double adjust = (1.0-special_coul[sbindex])*prefactor;
+              forcecoul -= adjust;
+              if (EFLAG) ecoul -= adjust;
+            }
+          } else {
+            union_int_float_t rsq_lookup;
+            rsq_lookup.f = rsq;
+            const int itable = (rsq_lookup.i & ncoulmask) >> ncoulshiftbits;
+            const double fraction = (rsq_lookup.f - rtable[itable]) * drtable[itable];
+            const double table = ftable[itable] + fraction*dftable[itable];
+            forcecoul = qtmp*q[j] * table;
+            if (EFLAG) ecoul = qtmp*q[j] * (etable[itable] + fraction*detable[itable]);
+            if (sbindex) {
+              const double table2 = ctable[itable] + fraction*dctable[itable];
+              const double prefactor = qtmp*q[j] * table2;
+              const double adjust = (1.0-special_coul[sbindex])*prefactor;
+              forcecoul -= adjust;
+              if (EFLAG) ecoul -= adjust;
+            }
+          }
+        }
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+
+          if (ljt == LJ12_4) {
+            const double r4inv=r2inv*r2inv;
+            forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
+                             - lj2[itype][jtype]);
+
+            if (EFLAG)
+              evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
+                             - lj4[itype][jtype]) - offset[itype][jtype];
+
+          } else if (ljt == LJ9_6) {
+            const double r3inv = r2inv*sqrt(r2inv);
+            const double r6inv = r3inv*r3inv;
+            forcelj = r6inv*(lj1[itype][jtype]*r3inv
+                             - lj2[itype][jtype]);
+            if (EFLAG)
+              evdwl = r6inv*(lj3[itype][jtype]*r3inv
+                             - lj4[itype][jtype]) - offset[itype][jtype];
+
+          } else if (ljt == LJ12_6) {
+            const double r6inv = r2inv*r2inv*r2inv;
+            forcelj = r6inv*(lj1[itype][jtype]*r6inv
+                             - lj2[itype][jtype]);
+            if (EFLAG)
+              evdwl = r6inv*(lj3[itype][jtype]*r6inv
+                             - lj4[itype][jtype]) - offset[itype][jtype];
+          }
+
+          if (sbindex) {
+            const double factor_lj = special_lj[sbindex];
+            forcelj *= factor_lj;
+            if (EFLAG) evdwl *= factor_lj;
+          }
+
+        }
+
+        const double fpair = (forcecoul + forcelj) * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,ecoul,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_sdk_coul_long_omp.h b/src/USER-OMP/pair_lj_sdk_coul_long_omp.h
index 01912535b1..a615efb507 100644
--- a/src/USER-OMP/pair_lj_sdk_coul_long_omp.h
+++ b/src/USER-OMP/pair_lj_sdk_coul_long_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_sdk_omp.cpp b/src/USER-OMP/pair_lj_sdk_omp.cpp
index 127ff41c86..63b1a8c171 100644
--- a/src/USER-OMP/pair_lj_sdk_omp.cpp
+++ b/src/USER-OMP/pair_lj_sdk_omp.cpp
@@ -60,11 +60,11 @@ void PairLJSDKOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval_thr<1,1,1>(ifrom, ito, thr);
-	else eval_thr<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval_thr<1,1,1>(ifrom, ito, thr);
+        else eval_thr<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval_thr<1,0,1>(ifrom, ito, thr);
-	else eval_thr<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval_thr<1,0,1>(ifrom, ito, thr);
+        else eval_thr<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval_thr<0,0,1>(ifrom, ito, thr);
@@ -123,50 +123,50 @@ void PairLJSDKOMP::eval_thr(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	const int ljt = lj_type[itype][jtype];
-
-	if (ljt == LJ12_4) {
-	  const double r4inv=r2inv*r2inv;
-	  forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
-			   - lj2[itype][jtype]);
-
-	  if (EFLAG)
-	    evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
-			   - lj4[itype][jtype]) - offset[itype][jtype];
-	  
-	} else if (ljt == LJ9_6) {
-	  const double r3inv = r2inv*sqrt(r2inv);
-	  const double r6inv = r3inv*r3inv;
-	  forcelj = r6inv*(lj1[itype][jtype]*r3inv
-			   - lj2[itype][jtype]);
-	  if (EFLAG)
-	    evdwl = r6inv*(lj3[itype][jtype]*r3inv
-			   - lj4[itype][jtype]) - offset[itype][jtype];
-
-	} else if (ljt == LJ12_6) {
-	  const double r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv*(lj1[itype][jtype]*r6inv
-			  - lj2[itype][jtype]);
-	  if (EFLAG)
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv
-			   - lj4[itype][jtype]) - offset[itype][jtype];
-	} else continue;
-
-	fpair = factor_lj*forcelj*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) evdwl *= factor_lj;
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        const int ljt = lj_type[itype][jtype];
+
+        if (ljt == LJ12_4) {
+          const double r4inv=r2inv*r2inv;
+          forcelj = r4inv*(lj1[itype][jtype]*r4inv*r4inv
+                           - lj2[itype][jtype]);
+
+          if (EFLAG)
+            evdwl = r4inv*(lj3[itype][jtype]*r4inv*r4inv
+                           - lj4[itype][jtype]) - offset[itype][jtype];
+
+        } else if (ljt == LJ9_6) {
+          const double r3inv = r2inv*sqrt(r2inv);
+          const double r6inv = r3inv*r3inv;
+          forcelj = r6inv*(lj1[itype][jtype]*r3inv
+                           - lj2[itype][jtype]);
+          if (EFLAG)
+            evdwl = r6inv*(lj3[itype][jtype]*r3inv
+                           - lj4[itype][jtype]) - offset[itype][jtype];
+
+        } else if (ljt == LJ12_6) {
+          const double r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv*(lj1[itype][jtype]*r6inv
+                          - lj2[itype][jtype]);
+          if (EFLAG)
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv
+                           - lj4[itype][jtype]) - offset[itype][jtype];
+        } else continue;
+
+        fpair = factor_lj*forcelj*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) evdwl *= factor_lj;
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_sdk_omp.h b/src/USER-OMP/pair_lj_sdk_omp.h
index f2c9e5ff1f..c3837fb683 100644
--- a/src/USER-OMP/pair_lj_sdk_omp.h
+++ b/src/USER-OMP/pair_lj_sdk_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_sf_omp.cpp b/src/USER-OMP/pair_lj_sf_omp.cpp
index b2314e13be..5c14e29131 100644
--- a/src/USER-OMP/pair_lj_sf_omp.cpp
+++ b/src/USER-OMP/pair_lj_sf_omp.cpp
@@ -56,11 +56,11 @@ void PairLJShiftedForceOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -117,31 +117,31 @@ void PairLJShiftedForceOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	t = sqrt(r2inv*cutsq[itype][jtype]);
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]) - 
-	  t*foffset[itype][jtype];
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) +
-	    (t-1.0)*foffset[itype][jtype] - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        t = sqrt(r2inv*cutsq[itype][jtype]);
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]) -
+          t*foffset[itype][jtype];
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) +
+            (t-1.0)*foffset[itype][jtype] - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_sf_omp.h b/src/USER-OMP/pair_lj_sf_omp.h
index c73c8f746b..92db973b3d 100644
--- a/src/USER-OMP/pair_lj_sf_omp.h
+++ b/src/USER-OMP/pair_lj_sf_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_smooth_linear_omp.cpp b/src/USER-OMP/pair_lj_smooth_linear_omp.cpp
index 8fd4a259ed..a8f3ad8daa 100644
--- a/src/USER-OMP/pair_lj_smooth_linear_omp.cpp
+++ b/src/USER-OMP/pair_lj_smooth_linear_omp.cpp
@@ -56,11 +56,11 @@ void PairLJSmoothLinearOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -118,32 +118,32 @@ void PairLJSmoothLinearOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
         rinv  = sqrt(r2inv);
-	forcelj = r6inv*(lj1[itype][jtype]*r6inv-lj2[itype][jtype]);
-	forcelj = rinv*forcelj - dljcut[itype][jtype];
- 
-	fpair = factor_lj*forcelj*rinv;
-        
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
+        forcelj = r6inv*(lj1[itype][jtype]*r6inv-lj2[itype][jtype]);
+        forcelj = rinv*forcelj - dljcut[itype][jtype];
+
+        fpair = factor_lj*forcelj*rinv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
           r = sqrt(rsq);
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
           evdwl = evdwl - ljcut[itype][jtype]
-	  		+ (r-cut[itype][jtype])*dljcut[itype][jtype]; 
-	}
+                          + (r-cut[itype][jtype])*dljcut[itype][jtype];
+        }
 
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_smooth_linear_omp.h b/src/USER-OMP/pair_lj_smooth_linear_omp.h
index 1c3b861ca0..940c0ea707 100644
--- a/src/USER-OMP/pair_lj_smooth_linear_omp.h
+++ b/src/USER-OMP/pair_lj_smooth_linear_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lj_smooth_omp.cpp b/src/USER-OMP/pair_lj_smooth_omp.cpp
index 1595d07712..b1918c3fcd 100644
--- a/src/USER-OMP/pair_lj_smooth_omp.cpp
+++ b/src/USER-OMP/pair_lj_smooth_omp.cpp
@@ -56,11 +56,11 @@ void PairLJSmoothOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -118,43 +118,43 @@ void PairLJSmoothOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	if (rsq < cut_inner_sq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv-lj2[itype][jtype]);
-	} else {
-	  r = sqrt(rsq); 
-	  t = r - cut_inner[itype][jtype];
-	  tsq = t*t;
-	  fskin = ljsw1[itype][jtype] + ljsw2[itype][jtype]*t +
-	    ljsw3[itype][jtype]*tsq + ljsw4[itype][jtype]*tsq*t; 
-	  forcelj = fskin*r;
-	}
-        
-	fpair = factor_lj*forcelj*r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (rsq < cut_inner_sq[itype][jtype])
-	    evdwl = r6inv * (lj3[itype][jtype]*r6inv - 
-			     lj4[itype][jtype]) - offset[itype][jtype];
-	  else
-	    evdwl = ljsw0[itype][jtype] - ljsw1[itype][jtype]*t -
-	      ljsw2[itype][jtype]*tsq/2.0 - ljsw3[itype][jtype]*tsq*t/3.0 -
-	      ljsw4[itype][jtype]*tsq*tsq/4.0 - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        if (rsq < cut_inner_sq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv-lj2[itype][jtype]);
+        } else {
+          r = sqrt(rsq);
+          t = r - cut_inner[itype][jtype];
+          tsq = t*t;
+          fskin = ljsw1[itype][jtype] + ljsw2[itype][jtype]*t +
+            ljsw3[itype][jtype]*tsq + ljsw4[itype][jtype]*tsq*t;
+          forcelj = fskin*r;
+        }
+
+        fpair = factor_lj*forcelj*r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (rsq < cut_inner_sq[itype][jtype])
+            evdwl = r6inv * (lj3[itype][jtype]*r6inv -
+                             lj4[itype][jtype]) - offset[itype][jtype];
+          else
+            evdwl = ljsw0[itype][jtype] - ljsw1[itype][jtype]*t -
+              ljsw2[itype][jtype]*tsq/2.0 - ljsw3[itype][jtype]*tsq*t/3.0 -
+              ljsw4[itype][jtype]*tsq*tsq/4.0 - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_lj_smooth_omp.h b/src/USER-OMP/pair_lj_smooth_omp.h
index eb6eb92dec..0b47a792a4 100644
--- a/src/USER-OMP/pair_lj_smooth_omp.h
+++ b/src/USER-OMP/pair_lj_smooth_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lubricate_omp.cpp b/src/USER-OMP/pair_lubricate_omp.cpp
index 00a81f345b..22090b2978 100644
--- a/src/USER-OMP/pair_lubricate_omp.cpp
+++ b/src/USER-OMP/pair_lubricate_omp.cpp
@@ -51,7 +51,7 @@ PairLubricateOMP::PairLubricateOMP(LAMMPS *lmp) :
 
 /* ---------------------------------------------------------------------- */
 
-PairLubricateOMP::~PairLubricateOMP() 
+PairLubricateOMP::~PairLubricateOMP()
 {}
 
 /* ---------------------------------------------------------------------- */
@@ -66,7 +66,7 @@ void PairLubricateOMP::compute(int eflag, int vflag)
   const int nthreads = comm->nthreads;
   const int inum = list->inum;
 
-  
+
   // This section of code adjusts R0/RT0/RS0 if necessary due to changes
   // in the volume fraction as a result of fix deform or moving walls
 
@@ -74,45 +74,45 @@ void PairLubricateOMP::compute(int eflag, int vflag)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (int j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (int j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	 double wallhi[3], walllo[3];
-	 for (int j = 0; j < 3; j++){
-	   wallhi[j] = domain->prd[j];
-	   walllo[j] = 0;
-	 }    
-	 for (int m = 0; m < wallfix->nwall; m++){
-	   int dim = wallfix->wallwhich[m] / 2;
-	   int side = wallfix->wallwhich[m] % 2;
-	   if (wallfix->wallstyle[m] == VARIABLE){
-	     wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	   }	   
-	   else wallcoord = wallfix->coord0[m];	   
-	   if (side == 0) walllo[dim] = wallcoord;
-	   else wallhi[dim] = wallcoord;	   
-	 }
-	 for (int j = 0; j < 3; j++)
-	   dims[j] = wallhi[j] - walllo[j];
+         double wallhi[3], walllo[3];
+         for (int j = 0; j < 3; j++){
+           wallhi[j] = domain->prd[j];
+           walllo[j] = 0;
+         }
+         for (int m = 0; m < wallfix->nwall; m++){
+           int dim = wallfix->wallwhich[m] / 2;
+           int side = wallfix->wallwhich[m] % 2;
+           if (wallfix->wallstyle[m] == VARIABLE){
+             wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+           }
+           else wallcoord = wallfix->coord0[m];
+           if (side == 0) walllo[dim] = wallcoord;
+           else wallhi[dim] = wallcoord;
+         }
+         for (int j = 0; j < 3; j++)
+           dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0);
-	RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
-	  (1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.16*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0);
+        RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
+          (1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
-	  (1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*rad*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        RT0 = 8*MY_PI*mu*pow(rad,3.0)*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        RS0 = 20.0/3.0*MY_PI*mu*pow(rad,3.0)*
+          (1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
-  
+
   // end of R0 adjustment code
-  
+
 
 #if defined(_OPENMP)
 #pragma omp parallel default(none) shared(eflag,vflag)
@@ -126,19 +126,19 @@ void PairLubricateOMP::compute(int eflag, int vflag)
 
     if (flaglog) {
       if (evflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
-    } else { 
+    } else {
       if (evflag) {
-	if (force->newton_pair) eval<0,1,1>(ifrom, ito, thr);
-	else eval<0,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<0,1,1>(ifrom, ito, thr);
+        else eval<0,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
-	else eval<0,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
+        else eval<0,0,0>(ifrom, ito, thr);
       }
     }
 
@@ -153,7 +153,7 @@ void PairLubricateOMP::eval(int iifrom, int iito, ThrData * const thr)
   double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz,tx,ty,tz;
   double rsq,r,h_sep,radi;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3,wt1,wt2,wt3,wdotn;  
+  double vt1,vt2,vt3,wt1,wt2,wt3,wdotn;
   double vRS0;
   double vi[3],vj[3],wi[3],wj[3],xl[3];
   double a_sq,a_sh,a_pu;
@@ -195,10 +195,10 @@ void PairLubricateOMP::eval(int iifrom, int iito, ThrData * const thr)
       i = ilist[ii];
       itype = type[i];
       radi = radius[i];
-      
+
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
-	h_rate[4]*lamda[2] + h_ratelo[0];
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
+        h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       v[i][0] -= vstream[0];
@@ -214,7 +214,7 @@ void PairLubricateOMP::eval(int iifrom, int iito, ThrData * const thr)
 
     Ef[0][0] = h_rate[0]/domain->xprd;
     Ef[1][1] = h_rate[1]/domain->yprd;
-    Ef[2][2] = h_rate[2]/domain->zprd; 
+    Ef[2][2] = h_rate[2]/domain->zprd;
     Ef[0][1] = Ef[1][0] = 0.5 * h_rate[5]/domain->yprd;
     Ef[0][2] = Ef[2][0] = 0.5 * h_rate[4]/domain->zprd;
     Ef[1][2] = Ef[2][1] = 0.5 * h_rate[3]/domain->zprd;
@@ -244,29 +244,29 @@ void PairLubricateOMP::eval(int iifrom, int iito, ThrData * const thr)
     radi = radius[i];
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     // angular velocity
 
     wi[0] = omega[i][0];
     wi[1] = omega[i][1];
-    wi[2] = omega[i][2];          
-     
+    wi[2] = omega[i][2];
+
     // FLD contribution to force and torque due to isotropic terms
     // FLD contribution to stress from isotropic RS0
 
     if (flagfld) {
       f[i][0] -= vxmu2f*R0*v[i][0];
       f[i][1] -= vxmu2f*R0*v[i][1];
-      f[i][2] -= vxmu2f*R0*v[i][2];    
+      f[i][2] -= vxmu2f*R0*v[i][2];
       torque[i][0] -= vxmu2f*RT0*wi[0];
       torque[i][1] -= vxmu2f*RT0*wi[1];
-      torque[i][2] -= vxmu2f*RT0*wi[2];   
+      torque[i][2] -= vxmu2f*RT0*wi[2];
 
       if (shearing && vflag_either) {
-	vRS0 = -vxmu2f * RS0;
-	v_tally_tensor(i,i,nlocal,NEWTON_PAIR,
-		       vRS0*Ef[0][0],vRS0*Ef[1][1],vRS0*Ef[2][2],
-		       vRS0*Ef[0][1],vRS0*Ef[0][2],vRS0*Ef[1][2]);
+        vRS0 = -vxmu2f * RS0;
+        v_tally_tensor(i,i,nlocal,NEWTON_PAIR,
+                       vRS0*Ef[0][0],vRS0*Ef[1][1],vRS0*Ef[2][2],
+                       vRS0*Ef[0][1],vRS0*Ef[0][2],vRS0*Ef[1][2]);
       }
     }
 
@@ -283,20 +283,20 @@ void PairLubricateOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-  
+        r = sqrt(rsq);
+
         // angular momentum = I*omega = 2/5 * M*R^2 * omega
-	
-	wj[0] = omega[j][0];
-	wj[1] = omega[j][1];
-	wj[2] = omega[j][2];              
+
+        wj[0] = omega[j][0];
+        wj[1] = omega[j][1];
+        wj[2] = omega[j][2];
 
         // xl = point of closest approach on particle i from its center
 
         xl[0] = -delx/r*radi;
         xl[1] = -dely/r*radi;
         xl[2] = -delz/r*radi;
-  
+
         // velocity at the point of closest approach on both particles
         // v = v + omega_cross_xl - Ef.xl
 
@@ -304,41 +304,41 @@ void PairLubricateOMP::eval(int iifrom, int iito, ThrData * const thr)
 
         vi[0] = v[i][0] + (wi[1]*xl[2] - wi[2]*xl[1])
                         - (Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
-        
+
         vi[1] = v[i][1] + (wi[2]*xl[0] - wi[0]*xl[2])
                         - (Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
-        
+
         vi[2] = v[i][2] + (wi[0]*xl[1] - wi[1]*xl[0])
                         - (Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
-  
+
         // particle j
 
         vj[0] = v[j][0] - (wj[1]*xl[2] - wj[2]*xl[1])
                         + (Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
-        
+
         vj[1] = v[j][1] - (wj[2]*xl[0] - wj[0]*xl[2])
                         + (Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
-        
+
         vj[2] = v[j][2] - (wj[0]*xl[1] - wj[1]*xl[0])
                         + (Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
-        
+
         // scalar resistances XA and YA
 
         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])
-          h_sep = cut_inner[itype][jtype] - 2.0*radi;          
-        
+          h_sep = cut_inner[itype][jtype] - 2.0*radi;
+
         // scale h_sep by radi
 
         h_sep = h_sep/radi;
-  
+
         // scalar resistances
 
         if (FLAGLOG) {
@@ -347,14 +347,14 @@ void PairLubricateOMP::eval(int iifrom, int iito, ThrData * const thr)
           a_pu = 8.0*MY_PI*mu*pow(radi,3.0)*(3.0/160.0*log(1.0/h_sep));
         } else
           a_sq = 6.0*MY_PI*mu*radi*(1.0/4.0/h_sep);
-  
+
         // relative velocity at the point of closest approach
-	// includes fluid velocity
+        // includes fluid velocity
 
         vr1 = vi[0] - vj[0];
         vr2 = vi[1] - vj[1];
         vr3 = vi[2] - vj[2];
-        
+
         // normal component (vr.n)n
 
         vnnr = (vr1*delx + vr2*dely + vr3*delz)/r;
@@ -379,7 +379,7 @@ void PairLubricateOMP::eval(int iifrom, int iito, ThrData * const thr)
         if (FLAGLOG) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
 
         // scale forces for appropriate units
@@ -387,65 +387,65 @@ void PairLubricateOMP::eval(int iifrom, int iito, ThrData * const thr)
         fx *= vxmu2f;
         fy *= vxmu2f;
         fz *= vxmu2f;
-        
+
         // add to total force
 
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;    
-        
+        f[i][2] -= fz;
+
         if (NEWTON_PAIR || j < nlocal) {
           f[j][0] += fx;
           f[j][1] += fy;
-          f[j][2] += fz;    
+          f[j][2] += fz;
         }
-  
+
         // torque due to this force
 
         if (FLAGLOG) {
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;                  
-    
+          tz = xl[0]*fy - xl[1]*fx;
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-            
+          torque[i][2] -= vxmu2f*tz;
+
           if (NEWTON_PAIR || j < nlocal) {
             torque[j][0] -= vxmu2f*tx;
             torque[j][1] -= vxmu2f*ty;
             torque[j][2] -= vxmu2f*tz;
           }
-          
+
           // torque due to a_pu
 
-          wdotn = ((wi[0]-wj[0])*delx + (wi[1]-wj[1])*dely + 
-		   (wi[2]-wj[2])*delz)/r;
+          wdotn = ((wi[0]-wj[0])*delx + (wi[1]-wj[1])*dely +
+                   (wi[2]-wj[2])*delz)/r;
           wt1 = (wi[0]-wj[0]) - wdotn*delx/r;
           wt2 = (wi[1]-wj[1]) - wdotn*dely/r;
           wt3 = (wi[2]-wj[2]) - wdotn*delz/r;
-          
+
           tx = a_pu*wt1;
           ty = a_pu*wt2;
           tz = a_pu*wt3;
-          
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
-            
+          torque[i][2] -= vxmu2f*tz;
+
           if (NEWTON_PAIR || j < nlocal) {
             torque[j][0] += vxmu2f*tx;
             torque[j][1] += vxmu2f*ty;
             torque[j][2] += vxmu2f*tz;
           }
-        }        
+        }
 
         if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,0.0,0.0,
-				     -fx,-fy,-fz,delx,dely,delz,thr);
+                                     -fx,-fy,-fz,delx,dely,delz,thr);
       }
     }
   }
-  
+
   // restore streaming component of velocity, omega, angmom
 
   if (shearing) {
@@ -456,10 +456,10 @@ void PairLubricateOMP::eval(int iifrom, int iito, ThrData * const thr)
       i = ilist[ii];
       itype = type[i];
       radi = radius[i];
-      
+
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
-	h_rate[4]*lamda[2] + h_ratelo[0];
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
+        h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       v[i][0] += vstream[0];
diff --git a/src/USER-OMP/pair_lubricate_omp.h b/src/USER-OMP/pair_lubricate_omp.h
index 045421e566..b35dc5d563 100644
--- a/src/USER-OMP/pair_lubricate_omp.h
+++ b/src/USER-OMP/pair_lubricate_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_lubricate_poly_omp.cpp b/src/USER-OMP/pair_lubricate_poly_omp.cpp
index 306c3f9bdf..26339b7749 100644
--- a/src/USER-OMP/pair_lubricate_poly_omp.cpp
+++ b/src/USER-OMP/pair_lubricate_poly_omp.cpp
@@ -52,7 +52,7 @@ PairLubricatePolyOMP::PairLubricatePolyOMP(LAMMPS *lmp) :
 
 /* ---------------------------------------------------------------------- */
 
-PairLubricatePolyOMP::~PairLubricatePolyOMP() 
+PairLubricatePolyOMP::~PairLubricatePolyOMP()
 {}
 
 /* ---------------------------------------------------------------------- */
@@ -75,41 +75,41 @@ void PairLubricatePolyOMP::compute(int eflag, int vflag)
   if (flagVF) // Flag for volume fraction corrections
     if (flagdeform || flagwall == 2){ // Possible changes in volume fraction
       if (flagdeform && !flagwall)
-	for (int j = 0; j < 3; j++)
-	  dims[j] = domain->prd[j];      
+        for (int j = 0; j < 3; j++)
+          dims[j] = domain->prd[j];
       else if (flagwall == 2 || (flagdeform && flagwall == 1)){
-	 double wallhi[3], walllo[3];
-	 for (int j = 0; j < 3; j++){
-	   wallhi[j] = domain->prd[j];
-	   walllo[j] = 0;
-	 }    
-	 for (int m = 0; m < wallfix->nwall; m++){
-	   int dim = wallfix->wallwhich[m] / 2;
-	   int side = wallfix->wallwhich[m] % 2;
-	   if (wallfix->wallstyle[m] == VARIABLE){
-	     wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
-	   }	   
-	   else wallcoord = wallfix->coord0[m];	   
-	   if (side == 0) walllo[dim] = wallcoord;
-	   else wallhi[dim] = wallcoord;	   
-	 }
-	 for (int j = 0; j < 3; j++)
-	   dims[j] = wallhi[j] - walllo[j];
+         double wallhi[3], walllo[3];
+         for (int j = 0; j < 3; j++){
+           wallhi[j] = domain->prd[j];
+           walllo[j] = 0;
+         }
+         for (int m = 0; m < wallfix->nwall; m++){
+           int dim = wallfix->wallwhich[m] / 2;
+           int side = wallfix->wallwhich[m] % 2;
+           if (wallfix->wallstyle[m] == VARIABLE){
+             wallcoord = input->variable->compute_equal(wallfix->varindex[m]);
+           }
+           else wallcoord = wallfix->coord0[m];
+           if (side == 0) walllo[dim] = wallcoord;
+           else wallhi[dim] = wallcoord;
+         }
+         for (int j = 0; j < 3; j++)
+           dims[j] = wallhi[j] - walllo[j];
       }
       double vol_T = dims[0]*dims[1]*dims[2];
       double vol_f = vol_P/vol_T;
       if (flaglog == 0) {
-	R0  = 6*MY_PI*mu*(1.0 + 2.16*vol_f);
-	RT0 = 8*MY_PI*mu;
-	RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*(1.0 + 2.16*vol_f);
+        RT0 = 8*MY_PI*mu;
+        RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.33*vol_f + 2.80*vol_f*vol_f);
       } else {
-	R0  = 6*MY_PI*mu*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
-	RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f); 
-	RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
+        R0  = 6*MY_PI*mu*(1.0 + 2.725*vol_f - 6.583*vol_f*vol_f);
+        RT0 = 8*MY_PI*mu*(1.0 + 0.749*vol_f - 2.469*vol_f*vol_f);
+        RS0 = 20.0/3.0*MY_PI*mu*(1.0 + 3.64*vol_f - 6.95*vol_f*vol_f);
       }
     }
 
-  // end of R0 adjustment code  
+  // end of R0 adjustment code
 
 
 #if defined(_OPENMP)
@@ -124,23 +124,23 @@ void PairLubricatePolyOMP::compute(int eflag, int vflag)
 
     if (flaglog) {
       if (shearing) {
-	if (evflag)
-	  eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (evflag)
+          eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (evflag)
-	  eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (evflag)
+          eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
-    } else { 
+    } else {
       if (shearing) {
-	if (evflag)
-	  eval<0,1,1>(ifrom, ito, thr);
-	else eval<0,1,0>(ifrom, ito, thr);
+        if (evflag)
+          eval<0,1,1>(ifrom, ito, thr);
+        else eval<0,1,0>(ifrom, ito, thr);
       } else {
-	if (evflag)
-	  eval<0,0,1>(ifrom, ito, thr);
-	else eval<0,0,0>(ifrom, ito, thr);
+        if (evflag)
+          eval<0,0,1>(ifrom, ito, thr);
+        else eval<0,0,0>(ifrom, ito, thr);
       }
     }
 
@@ -155,7 +155,7 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr)
   double xtmp,ytmp,ztmp,delx,dely,delz,fx,fy,fz,tx,ty,tz;
   double rsq,r,h_sep,beta0,beta1,radi,radj;
   double vr1,vr2,vr3,vnnr,vn1,vn2,vn3;
-  double vt1,vt2,vt3,wt1,wt2,wt3,wdotn;  
+  double vt1,vt2,vt3,wt1,wt2,wt3,wdotn;
   double vRS0;
   double vi[3],vj[3],wi[3],wj[3],xl[3],jl[3];
   double a_sq,a_sh,a_pu;
@@ -198,8 +198,8 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr)
       itype = type[i];
       radi = radius[i];
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
-	h_rate[4]*lamda[2] + h_ratelo[0];
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
+        h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       v[i][0] -= vstream[0];
@@ -215,7 +215,7 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr)
 
     Ef[0][0] = h_rate[0]/domain->xprd;
     Ef[1][1] = h_rate[1]/domain->yprd;
-    Ef[2][2] = h_rate[2]/domain->zprd; 
+    Ef[2][2] = h_rate[2]/domain->zprd;
     Ef[0][1] = Ef[1][0] = 0.5 * h_rate[5]/domain->yprd;
     Ef[0][2] = Ef[2][0] = 0.5 * h_rate[4]/domain->zprd;
     Ef[1][2] = Ef[2][1] = 0.5 * h_rate[3]/domain->zprd;
@@ -245,13 +245,13 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr)
     radi = radius[i];
     jlist = firstneigh[i];
     jnum = numneigh[i];
-    
+
     // angular velocity
 
     wi[0] = omega[i][0];
     wi[1] = omega[i][1];
-    wi[2] = omega[i][2];          
-     
+    wi[2] = omega[i][2];
+
     // FLD contribution to force and torque due to isotropic terms
     // FLD contribution to stress from isotropic RS0
 
@@ -262,13 +262,13 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr)
       const double rad3 = radi*radi*radi;
       torque[i][0] -= vxmu2f*RT0*rad3*wi[0];
       torque[i][1] -= vxmu2f*RT0*rad3*wi[1];
-      torque[i][2] -= vxmu2f*RT0*rad3*wi[2];   
-    
+      torque[i][2] -= vxmu2f*RT0*rad3*wi[2];
+
       if (SHEARING && vflag_either) {
-	vRS0 = -vxmu2f * RS0*rad3;
-	v_tally_tensor(i,i,nlocal,/* newton_pair */ 0,
-		       vRS0*Ef[0][0],vRS0*Ef[1][1],vRS0*Ef[2][2],
-		       vRS0*Ef[0][1],vRS0*Ef[0][2],vRS0*Ef[1][2]);
+        vRS0 = -vxmu2f * RS0*rad3;
+        v_tally_tensor(i,i,nlocal,/* newton_pair */ 0,
+                       vRS0*Ef[0][0],vRS0*Ef[1][1],vRS0*Ef[2][2],
+                       vRS0*Ef[0][1],vRS0*Ef[0][2],vRS0*Ef[1][2]);
       }
     }
 
@@ -286,13 +286,13 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr)
       radj = atom->radius[j];
 
       if (rsq < cutsq[itype][jtype]) {
-        r = sqrt(rsq);  
-  
+        r = sqrt(rsq);
+
         // angular momentum = I*omega = 2/5 * M*R^2 * omega
 
-	wj[0] = omega[j][0];
-	wj[1] = omega[j][1];
-	wj[2] = omega[j][2];              
+        wj[0] = omega[j][0];
+        wj[1] = omega[j][1];
+        wj[2] = omega[j][2];
 
         // xl = point of closest approach on particle i from its center
 
@@ -302,7 +302,7 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr)
         jl[0] = -delx/r*radj;
         jl[1] = -dely/r*radj;
         jl[2] = -delz/r*radj;
-  
+
         // velocity at the point of closest approach on both particles
         // v = v + omega_cross_xl - Ef.xl
 
@@ -310,71 +310,71 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr)
 
         vi[0] = v[i][0] + (wi[1]*xl[2] - wi[2]*xl[1])
                         - (Ef[0][0]*xl[0] + Ef[0][1]*xl[1] + Ef[0][2]*xl[2]);
-        
+
         vi[1] = v[i][1] + (wi[2]*xl[0] - wi[0]*xl[2])
                         - (Ef[1][0]*xl[0] + Ef[1][1]*xl[1] + Ef[1][2]*xl[2]);
-        
+
         vi[2] = v[i][2] + (wi[0]*xl[1] - wi[1]*xl[0])
                         - (Ef[2][0]*xl[0] + Ef[2][1]*xl[1] + Ef[2][2]*xl[2]);
-  
+
         // particle j
 
         vj[0] = v[j][0] - (wj[1]*jl[2] - wj[2]*jl[1])
                         + (Ef[0][0]*jl[0] + Ef[0][1]*jl[1] + Ef[0][2]*jl[2]);
-        
+
         vj[1] = v[j][1] - (wj[2]*jl[0] - wj[0]*jl[2])
                         + (Ef[1][0]*jl[0] + Ef[1][1]*jl[1] + Ef[1][2]*jl[2]);
-        
+
         vj[2] = v[j][2] - (wj[0]*jl[1] - wj[1]*jl[0])
                         + (Ef[2][0]*jl[0] + Ef[2][1]*jl[1] + Ef[2][2]*jl[2]);
-        
+
         // scalar resistances XA and YA
 
         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])
-          h_sep = cut_inner[itype][jtype] - radi-radj;          
-        
+          h_sep = cut_inner[itype][jtype] - radi-radj;
+
         // scale h_sep by radi
 
         h_sep = h_sep/radi;
         beta0 = radj/radi;
         beta1 = 1.0 + beta0;
-  
+
         // scalar resistances
 
         if (FLAGLOG) {
-          a_sq = beta0*beta0/beta1/beta1/h_sep + 
-	    (1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3.0)*log(1.0/h_sep);
-          a_sq += (1.0+18.0*beta0-29.0*beta0*beta0+18.0 * 
-		   pow(beta0,3.0)+pow(beta0,4.0))/21.0/pow(beta1,4.0) * 
-	    h_sep*log(1.0/h_sep);
+          a_sq = beta0*beta0/beta1/beta1/h_sep +
+            (1.0+7.0*beta0+beta0*beta0)/5.0/pow(beta1,3.0)*log(1.0/h_sep);
+          a_sq += (1.0+18.0*beta0-29.0*beta0*beta0+18.0 *
+                   pow(beta0,3.0)+pow(beta0,4.0))/21.0/pow(beta1,4.0) *
+            h_sep*log(1.0/h_sep);
           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.0) * 
-	    log(1.0/h_sep);
-          a_sh += 4.0*(16.0-45.0*beta0+58.0*beta0*beta0-45.0*pow(beta0,3.0) + 
-		       16.0*pow(beta0,4.0))/375.0/pow(beta1,4.0) * 
-	    h_sep*log(1.0/h_sep);
+          a_sh = 4.0*beta0*(2.0+beta0+2.0*beta0*beta0)/15.0/pow(beta1,3.0) *
+            log(1.0/h_sep);
+          a_sh += 4.0*(16.0-45.0*beta0+58.0*beta0*beta0-45.0*pow(beta0,3.0) +
+                       16.0*pow(beta0,4.0))/375.0/pow(beta1,4.0) *
+            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.0))/250.0/pow(beta1,3.0)*h_sep*log(1.0/h_sep);
+          a_pu += (32.0-33.0*beta0+83.0*beta0*beta0+43.0 *
+                   pow(beta0,3.0))/250.0/pow(beta1,3.0)*h_sep*log(1.0/h_sep);
           a_pu *= 8.0*MY_PI*mu*pow(radi,3.0);
         } else a_sq = 6.0*MY_PI*mu*radi*(beta0*beta0/beta1/beta1/h_sep);
-  
+
         // relative velocity at the point of closest approach
-	// includes fluid velocity
+        // includes fluid velocity
 
         vr1 = vi[0] - vj[0];
         vr2 = vi[1] - vj[1];
         vr3 = vi[2] - vj[2];
-        
+
         // normal component (vr.n)n
 
         vnnr = (vr1*delx + vr2*dely + vr3*delz)/r;
@@ -399,7 +399,7 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr)
         if (FLAGLOG) {
           fx = fx + a_sh*vt1;
           fy = fy + a_sh*vt2;
-          fz = fz + a_sh*vt3;                  
+          fz = fz + a_sh*vt3;
         }
 
         // scale forces for appropriate units
@@ -407,48 +407,48 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr)
         fx *= vxmu2f;
         fy *= vxmu2f;
         fz *= vxmu2f;
-        
+
         // add to total force
 
         f[i][0] -= fx;
         f[i][1] -= fy;
-        f[i][2] -= fz;    
-        
+        f[i][2] -= fz;
+
         // torque due to this force
 
         if (FLAGLOG) {
           tx = xl[1]*fz - xl[2]*fy;
           ty = xl[2]*fx - xl[0]*fz;
-          tz = xl[0]*fy - xl[1]*fx;                  
-    
+          tz = xl[0]*fy - xl[1]*fx;
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
+          torque[i][2] -= vxmu2f*tz;
 
           // torque due to a_pu
 
-          wdotn = ((wi[0]-wj[0])*delx + (wi[1]-wj[1])*dely + 
-		   (wi[2]-wj[2])*delz)/r;
+          wdotn = ((wi[0]-wj[0])*delx + (wi[1]-wj[1])*dely +
+                   (wi[2]-wj[2])*delz)/r;
           wt1 = (wi[0]-wj[0]) - wdotn*delx/r;
           wt2 = (wi[1]-wj[1]) - wdotn*dely/r;
           wt3 = (wi[2]-wj[2]) - wdotn*delz/r;
-          
+
           tx = a_pu*wt1;
           ty = a_pu*wt2;
           tz = a_pu*wt3;
-          
+
           torque[i][0] -= vxmu2f*tx;
           torque[i][1] -= vxmu2f*ty;
-          torque[i][2] -= vxmu2f*tz;        
+          torque[i][2] -= vxmu2f*tz;
 
-        }        
+        }
 
         if (EVFLAG) ev_tally_xyz(i,nlocal,nlocal, /* newton_pair */ 0,
-				 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
+                                 0.0,0.0,-fx,-fy,-fz,delx,dely,delz);
       }
     }
   }
-  
+
   // restore streaming component of velocity, omega, angmom
 
   if (SHEARING) {
@@ -459,10 +459,10 @@ void PairLubricatePolyOMP::eval(int iifrom, int iito, ThrData * const thr)
       i = ilist[ii];
       itype = type[i];
       radi = radius[i];
-      
+
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
-	h_rate[4]*lamda[2] + h_ratelo[0];
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
+        h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       v[i][0] += vstream[0];
diff --git a/src/USER-OMP/pair_lubricate_poly_omp.h b/src/USER-OMP/pair_lubricate_poly_omp.h
index 8e44d94093..e9984ce0d4 100644
--- a/src/USER-OMP/pair_lubricate_poly_omp.h
+++ b/src/USER-OMP/pair_lubricate_poly_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_meam_spline_omp.cpp b/src/USER-OMP/pair_meam_spline_omp.cpp
index 33dfcd466c..cf9a6c5bc9 100644
--- a/src/USER-OMP/pair_meam_spline_omp.cpp
+++ b/src/USER-OMP/pair_meam_spline_omp.cpp
@@ -67,14 +67,14 @@ void PairMEAMSplineOMP::compute(int eflag, int vflag)
     loop_setup_thr(ifrom, ito, tid, inum, nthreads);
     ThrData *thr = fix->get_thr(tid);
     ev_setup_thr(eflag, vflag, nall, eatom, vatom, thr);
-    
+
     thr->init_eam(nall,Uprime_values);
 
     if (evflag) {
       if (eflag) {
-	eval<1,1>(ifrom, ito, thr);
+        eval<1,1>(ifrom, ito, thr);
       } else {
-	eval<1,0>(ifrom, ito, thr);
+        eval<1,0>(ifrom, ito, thr);
       }
     } else {
       eval<0,0>(ifrom, ito, thr);
@@ -90,7 +90,7 @@ void PairMEAMSplineOMP::eval(int iifrom, int iito, ThrData * const thr)
   const int* const ilist_full = listfull->ilist;
   const int* const numneigh_full = listfull->numneigh;
   const int* const * const firstneigh_full = listfull->firstneigh;
-  
+
   // Determine the maximum number of neighbors a single atom has.
   int myMaxNeighbors = 0;
   for(int ii = iifrom; ii < iito; ii++) {
@@ -133,27 +133,27 @@ void PairMEAMSplineOMP::eval(int iifrom, int iito, ThrData * const thr)
       const double rij_sq = jdelx*jdelx + jdely*jdely + jdelz*jdelz;
 
       if (rij_sq < cutforcesq) {
-	const double rij = sqrt(rij_sq);
-	double partial_sum = 0;
-
-	nextTwoBodyInfo->tag = j;
-	nextTwoBodyInfo->r = rij;
-	nextTwoBodyInfo->f = f.eval(rij, nextTwoBodyInfo->fprime);
-	nextTwoBodyInfo->del[0] = jdelx / rij;
-	nextTwoBodyInfo->del[1] = jdely / rij;
-	nextTwoBodyInfo->del[2] = jdelz / rij;
-
-	for(int kk = 0; kk < numBonds; kk++) {
-	  const MEAM2Body& bondk = myTwoBodyInfo[kk];
-	  double cos_theta = (nextTwoBodyInfo->del[0]*bondk.del[0] + nextTwoBodyInfo->del[1]*bondk.del[1] + nextTwoBodyInfo->del[2]*bondk.del[2]);
-	  partial_sum += bondk.f * g.eval(cos_theta);
-	}
-
-	rho_value += nextTwoBodyInfo->f * partial_sum;
-	rho_value += rho.eval(rij);
-
-	numBonds++;
-	nextTwoBodyInfo++;
+        const double rij = sqrt(rij_sq);
+        double partial_sum = 0;
+
+        nextTwoBodyInfo->tag = j;
+        nextTwoBodyInfo->r = rij;
+        nextTwoBodyInfo->f = f.eval(rij, nextTwoBodyInfo->fprime);
+        nextTwoBodyInfo->del[0] = jdelx / rij;
+        nextTwoBodyInfo->del[1] = jdely / rij;
+        nextTwoBodyInfo->del[2] = jdelz / rij;
+
+        for(int kk = 0; kk < numBonds; kk++) {
+          const MEAM2Body& bondk = myTwoBodyInfo[kk];
+          double cos_theta = (nextTwoBodyInfo->del[0]*bondk.del[0] + nextTwoBodyInfo->del[1]*bondk.del[1] + nextTwoBodyInfo->del[2]*bondk.del[2]);
+          partial_sum += bondk.f * g.eval(cos_theta);
+        }
+
+        rho_value += nextTwoBodyInfo->f * partial_sum;
+        rho_value += rho.eval(rij);
+
+        numBonds++;
+        nextTwoBodyInfo++;
       }
     }
 
@@ -181,55 +181,55 @@ void PairMEAMSplineOMP::eval(int iifrom, int iito, ThrData * const thr)
 
       MEAM2Body const* bondk = myTwoBodyInfo;
       for(int kk = 0; kk < jj; kk++, ++bondk) {
-	const double rik = bondk->r;
-
-	const double cos_theta = (bondj.del[0]*bondk->del[0] + bondj.del[1]*bondk->del[1] + bondj.del[2]*bondk->del[2]);
-	double g_prime;
-	double g_value = g.eval(cos_theta, g_prime);
-	const double f_rik_prime = bondk->fprime;
-	const double f_rik = bondk->f;
-
-	double fij = -Uprime_i * g_value * f_rik * f_rij_prime;
-	double fik = -Uprime_i * g_value * f_rij * f_rik_prime;
-
-	const double prefactor = Uprime_i * f_rij * f_rik * g_prime;
-	const double prefactor_ij = prefactor / rij;
-	const double prefactor_ik = prefactor / rik;
-	fij += prefactor_ij * cos_theta;
-	fik += prefactor_ik * cos_theta;
-
-	double fj[3], fk[3];
-
-	fj[0] = bondj.del[0] * fij - bondk->del[0] * prefactor_ij;
-	fj[1] = bondj.del[1] * fij - bondk->del[1] * prefactor_ij;
-	fj[2] = bondj.del[2] * fij - bondk->del[2] * prefactor_ij;
-	forces_j[0] += fj[0];
-	forces_j[1] += fj[1];
-	forces_j[2] += fj[2];
-
-	fk[0] = bondk->del[0] * fik - bondj.del[0] * prefactor_ik;
-	fk[1] = bondk->del[1] * fik - bondj.del[1] * prefactor_ik;
-	fk[2] = bondk->del[2] * fik - bondj.del[2] * prefactor_ik;
-	forces_i[0] -= fk[0];
-	forces_i[1] -= fk[1];
-	forces_i[2] -= fk[2];
-
-	const int k = bondk->tag;
-	forces[k][0] += fk[0];
-	forces[k][1] += fk[1];
-	forces[k][2] += fk[2];
-
-	if(EVFLAG) {
-	  double delta_ij[3];
-	  double delta_ik[3];
-	  delta_ij[0] = bondj.del[0] * rij;
-	  delta_ij[1] = bondj.del[1] * rij;
-	  delta_ij[2] = bondj.del[2] * rij;
-	  delta_ik[0] = bondk->del[0] * rik;
-	  delta_ik[1] = bondk->del[1] * rik;
-	  delta_ik[2] = bondk->del[2] * rik;
-	  ev_tally3_thr(this,i,j,k,0.0,0.0,fj,fk,delta_ij,delta_ik,thr);
-	}
+        const double rik = bondk->r;
+
+        const double cos_theta = (bondj.del[0]*bondk->del[0] + bondj.del[1]*bondk->del[1] + bondj.del[2]*bondk->del[2]);
+        double g_prime;
+        double g_value = g.eval(cos_theta, g_prime);
+        const double f_rik_prime = bondk->fprime;
+        const double f_rik = bondk->f;
+
+        double fij = -Uprime_i * g_value * f_rik * f_rij_prime;
+        double fik = -Uprime_i * g_value * f_rij * f_rik_prime;
+
+        const double prefactor = Uprime_i * f_rij * f_rik * g_prime;
+        const double prefactor_ij = prefactor / rij;
+        const double prefactor_ik = prefactor / rik;
+        fij += prefactor_ij * cos_theta;
+        fik += prefactor_ik * cos_theta;
+
+        double fj[3], fk[3];
+
+        fj[0] = bondj.del[0] * fij - bondk->del[0] * prefactor_ij;
+        fj[1] = bondj.del[1] * fij - bondk->del[1] * prefactor_ij;
+        fj[2] = bondj.del[2] * fij - bondk->del[2] * prefactor_ij;
+        forces_j[0] += fj[0];
+        forces_j[1] += fj[1];
+        forces_j[2] += fj[2];
+
+        fk[0] = bondk->del[0] * fik - bondj.del[0] * prefactor_ik;
+        fk[1] = bondk->del[1] * fik - bondj.del[1] * prefactor_ik;
+        fk[2] = bondk->del[2] * fik - bondj.del[2] * prefactor_ik;
+        forces_i[0] -= fk[0];
+        forces_i[1] -= fk[1];
+        forces_i[2] -= fk[2];
+
+        const int k = bondk->tag;
+        forces[k][0] += fk[0];
+        forces[k][1] += fk[1];
+        forces[k][2] += fk[2];
+
+        if(EVFLAG) {
+          double delta_ij[3];
+          double delta_ik[3];
+          delta_ij[0] = bondj.del[0] * rij;
+          delta_ij[1] = bondj.del[1] * rij;
+          delta_ij[2] = bondj.del[2] * rij;
+          delta_ik[0] = bondk->del[0] * rik;
+          delta_ik[1] = bondk->del[1] * rik;
+          delta_ik[2] = bondk->del[2] * rik;
+          ev_tally3_thr(this,i,j,k,0.0,0.0,fj,fk,delta_ij,delta_ik,thr);
+        }
       }
 
       forces[i][0] -= forces_j[0];
@@ -247,7 +247,7 @@ void PairMEAMSplineOMP::eval(int iifrom, int iito, ThrData * const thr)
 
   delete[] myTwoBodyInfo;
 
-  sync_threads();  
+  sync_threads();
 
   // reduce per thread density
   data_reduce_thr(Uprime_values, nall, nthreads, 1, tid);
@@ -287,27 +287,27 @@ void PairMEAMSplineOMP::eval(int iifrom, int iito, ThrData * const thr)
       double rij_sq = jdel[0]*jdel[0] + jdel[1]*jdel[1] + jdel[2]*jdel[2];
 
       if(rij_sq < cutforcesq) {
-	double rij = sqrt(rij_sq);
-
-	double rho_prime;
-	rho.eval(rij, rho_prime);
-	double fpair = rho_prime * (Uprime_values[i] + Uprime_values[j]);
-
-	double pair_pot_deriv;
-	double pair_pot = phi.eval(rij, pair_pot_deriv);
-	fpair += pair_pot_deriv;
-
-	// Divide by r_ij to get forces from gradient.
-	fpair /= rij;
-
-	forces[i][0] += jdel[0]*fpair;
-	forces[i][1] += jdel[1]*fpair;
-	forces[i][2] += jdel[2]*fpair;
-	forces[j][0] -= jdel[0]*fpair;
-	forces[j][1] -= jdel[1]*fpair;
-	forces[j][2] -= jdel[2]*fpair;
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal, 1 /* newton_pair */, 
-				 pair_pot,0.0,-fpair,jdel[0],jdel[1],jdel[2],thr);
+        double rij = sqrt(rij_sq);
+
+        double rho_prime;
+        rho.eval(rij, rho_prime);
+        double fpair = rho_prime * (Uprime_values[i] + Uprime_values[j]);
+
+        double pair_pot_deriv;
+        double pair_pot = phi.eval(rij, pair_pot_deriv);
+        fpair += pair_pot_deriv;
+
+        // Divide by r_ij to get forces from gradient.
+        fpair /= rij;
+
+        forces[i][0] += jdel[0]*fpair;
+        forces[i][1] += jdel[1]*fpair;
+        forces[i][2] += jdel[2]*fpair;
+        forces[j][0] -= jdel[0]*fpair;
+        forces[j][1] -= jdel[1]*fpair;
+        forces[j][2] -= jdel[2]*fpair;
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal, 1 /* newton_pair */,
+                                 pair_pot,0.0,-fpair,jdel[0],jdel[1],jdel[2],thr);
       }
     }
   }
diff --git a/src/USER-OMP/pair_meam_spline_omp.h b/src/USER-OMP/pair_meam_spline_omp.h
index c8f92ce74c..2fd169609f 100644
--- a/src/USER-OMP/pair_meam_spline_omp.h
+++ b/src/USER-OMP/pair_meam_spline_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_morse_omp.cpp b/src/USER-OMP/pair_morse_omp.cpp
index 18a3fe4950..d1b0d56cfd 100644
--- a/src/USER-OMP/pair_morse_omp.cpp
+++ b/src/USER-OMP/pair_morse_omp.cpp
@@ -56,11 +56,11 @@ void PairMorseOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -117,28 +117,28 @@ void PairMorseOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	dr = r - r0[itype][jtype];
-	dexp = exp(-alpha[itype][jtype] * dr);
-	fpair = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r = sqrt(rsq);
+        dr = r - r0[itype][jtype];
+        dexp = exp(-alpha[itype][jtype] * dr);
+        fpair = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_morse_omp.h b/src/USER-OMP/pair_morse_omp.h
index a20aad6716..40797e2502 100644
--- a/src/USER-OMP/pair_morse_omp.h
+++ b/src/USER-OMP/pair_morse_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_peri_lps_omp.cpp b/src/USER-OMP/pair_peri_lps_omp.cpp
index ef6de8777f..d61f71aa06 100644
--- a/src/USER-OMP/pair_peri_lps_omp.cpp
+++ b/src/USER-OMP/pair_peri_lps_omp.cpp
@@ -56,8 +56,8 @@ void PairPeriLPSOMP::compute(int eflag, int vflag)
   // grow bond forces array if necessary
 
   if (atom->nmax > nmax) {
-    memory->destroy(s0_new);				
-    memory->destroy(theta);				
+    memory->destroy(s0_new);
+    memory->destroy(theta);
     nmax = atom->nmax;
     memory->create(s0_new,nmax,"pair:s0_new");
     memory->create(theta,nmax,"pair:theta");
@@ -75,11 +75,11 @@ void PairPeriLPSOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -163,7 +163,7 @@ void PairPeriLPSOMP::eval(int iifrom, int iito, ThrData * const thr)
       if (periodic) domain->minimum_image(delx0,dely0,delz0);
       rsq0 = delx0*delx0 + dely0*dely0 + delz0*delz0;
       jtype = type[j];
- 
+
       r = sqrt(rsq);
 
       // short-range interaction distance based on initial particle position
@@ -179,27 +179,27 @@ void PairPeriLPSOMP::eval(int iifrom, int iito, ThrData * const thr)
         dr = r - d_ij;
 
         // kshort based upon short-range force constant
-	// of the bond-based theory used in PMB model
+        // of the bond-based theory used in PMB model
 
         double kshort = (15.0 * 18.0 * bulkmodulus[itype][itype]) /
-	  (MY_PI * cutsq[itype][jtype] * cutsq[itype][jtype]);
+          (MY_PI * cutsq[itype][jtype] * cutsq[itype][jtype]);
         rk = (kshort * vfrac[j]) * (dr / cut[itype][jtype]);
 
         if (r > 0.0) fpair = -(rk/r);
         else fpair = 0.0;
 
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
 
         if (EFLAG) evdwl = 0.5*rk*dr;
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,evdwl,0.0,
-				 fpair*vfrac[i],delx,dely,delz,thr);
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,evdwl,0.0,
+                                 fpair*vfrac[i],delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
@@ -216,7 +216,7 @@ void PairPeriLPSOMP::eval(int iifrom, int iito, ThrData * const thr)
   const int idelta = 1 + nlocal/comm->nthreads;
   iifrom = thr->get_tid()*idelta;
   iito   = ((iifrom + idelta) > nlocal) ? nlocal : (iifrom + idelta);
-#else 
+#else
   iifrom = 0;
   iito = nlocal;
 #endif
@@ -231,7 +231,7 @@ void PairPeriLPSOMP::eval(int iifrom, int iito, ThrData * const thr)
 #if defined(_OPENMP)
 #pragma omp master
 #endif
-  { // communicate dilatation (theta) of each particle	
+  { // communicate dilatation (theta) of each particle
     comm->forward_comm_pair(this);
     // communicate weighted volume (wvolume) upon every reneighbor
     if (neighbor->ago == 0)
@@ -242,10 +242,10 @@ void PairPeriLPSOMP::eval(int iifrom, int iito, ThrData * const thr)
 
   // Volume-dependent part of the energy
   if (EFLAG) {
-    for (i = iifrom; i < iito; i++) {   
+    for (i = iifrom; i < iito; i++) {
       itype = type[i];
       e_tally_thr(this, i, i, nlocal, NEWTON_PAIR,
-		  0.5 * bulkmodulus[itype][itype] * (theta[i] * theta[i]), 0.0, thr);
+                  0.5 * bulkmodulus[itype][itype] * (theta[i] * theta[i]), 0.0, thr);
     }
   }
 
@@ -261,9 +261,9 @@ void PairPeriLPSOMP::eval(int iifrom, int iito, ThrData * const thr)
     xtmp = x[i][0];
     ytmp = x[i][1];
     ztmp = x[i][2];
-    xtmp0 = x0[i][0];			
-    ytmp0 = x0[i][1];		
-    ztmp0 = x0[i][2];			
+    xtmp0 = x0[i][0];
+    ytmp0 = x0[i][1];
+    ztmp0 = x0[i][2];
     itype = type[i];
     jnum = npartner[i];
     first = true;
@@ -286,10 +286,10 @@ void PairPeriLPSOMP::eval(int iifrom, int iito, ThrData * const thr)
       delz = ztmp - x[j][2];
       if (periodic) domain->minimum_image(delx,dely,delz);
       rsq = delx*delx + dely*dely + delz*delz;
-      delx0 = xtmp0 - x0[j][0];						
-      dely0 = ytmp0 - x0[j][1];						
-      delz0 = ztmp0 - x0[j][2];						
-      if (periodic) domain->minimum_image(delx0,dely0,delz0);   
+      delx0 = xtmp0 - x0[j][0];
+      dely0 = ytmp0 - x0[j][1];
+      delz0 = ztmp0 - x0[j][2];
+      if (periodic) domain->minimum_image(delx0,dely0,delz0);
       jtype = type[j];
       delta = cut[itype][jtype];
       r = sqrt(rsq);
@@ -302,18 +302,18 @@ void PairPeriLPSOMP::eval(int iifrom, int iito, ThrData * const thr)
       // scale vfrac[j] if particle j near the horizon
 
       if ((fabs(r0[i][jj] - delta)) <= half_lc)
-        vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) + 
-	  (1.0 + ((delta - half_lc)/(2*half_lc) ) );
+        vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) +
+          (1.0 + ((delta - half_lc)/(2*half_lc) ) );
       else vfrac_scale = 1.0;
 
       omega_plus  = influence_function(-1.0*delx0,-1.0*dely0,-1.0*delz0);
       omega_minus = influence_function(delx0,dely0,delz0);
-      rk = ( (3.0 * bulkmodulus[itype][itype]) - 
-	     (5.0 * shearmodulus[itype][itype]) ) * vfrac[j] * vfrac_scale * 
-	( (omega_plus * theta[i] / wvolume[i]) + 
-	  ( omega_minus * theta[j] / wvolume[j] ) ) * r0[i][jj]; 
+      rk = ( (3.0 * bulkmodulus[itype][itype]) -
+             (5.0 * shearmodulus[itype][itype]) ) * vfrac[j] * vfrac_scale *
+        ( (omega_plus * theta[i] / wvolume[i]) +
+          ( omega_minus * theta[j] / wvolume[j] ) ) * r0[i][jj];
       rk +=  15.0 * ( shearmodulus[itype][itype] * vfrac[j] * vfrac_scale ) *
-	( (omega_plus / wvolume[i]) + (omega_minus / wvolume[j]) ) * dr; 
+        ( (omega_plus / wvolume[i]) + (omega_minus / wvolume[j]) ) * dr;
 
       if (r > 0.0) fbond = -(rk/r);
       else fbond = 0.0;
@@ -322,14 +322,14 @@ void PairPeriLPSOMP::eval(int iifrom, int iito, ThrData * const thr)
       f[i][1] += dely*fbond;
       f[i][2] += delz*fbond;
 
-      // since I-J is double counted, set newton off & use 1/2 factor and I,I 
+      // since I-J is double counted, set newton off & use 1/2 factor and I,I
 
       double deviatoric_extension = dr - (theta[i]* r0[i][jj] / 3.0);
-      if (EFLAG) evdwl = 0.5 * 15 * (shearmodulus[itype][itype]/wvolume[i]) * 
-		   omega_plus*(deviatoric_extension * deviatoric_extension) *
-		   vfrac[j] * vfrac_scale;
+      if (EFLAG) evdwl = 0.5 * 15 * (shearmodulus[itype][itype]/wvolume[i]) *
+                   omega_plus*(deviatoric_extension * deviatoric_extension) *
+                   vfrac[j] * vfrac_scale;
       if (EVFLAG) ev_tally_thr(this,i,i,nlocal,0,0.5*evdwl,0.0,
-			       0.5*fbond*vfrac[i],delx,dely,delz,thr);
+                               0.5*fbond*vfrac[i],delx,dely,delz,thr);
 
       // find stretch in bond I-J and break if necessary
       // use s0 from previous timestep
@@ -370,7 +370,7 @@ void PairPeriLPSOMP::compute_dilatation_thr(int ifrom, int ito)
   double **x0 = atom->x0;
   double *vfrac = atom->vfrac;
   double vfrac_scale = 1.0;
-  
+
   double lc = domain->lattice->xlattice;
   double half_lc = 0.5*lc;
 
@@ -431,11 +431,11 @@ void PairPeriLPSOMP::compute_dilatation_thr(int ifrom, int ito)
       else vfrac_scale = 1.0;
 
       theta[i] += influence_function(delx0, dely0, delz0) * r0[i][jj] * dr *
-	vfrac[j] * vfrac_scale;
+        vfrac[j] * vfrac_scale;
     }
 
     // if wvolume[i] is zero, then particle i has no bonds
-    // therefore, the dilatation is set to 
+    // therefore, the dilatation is set to
 
     if (wvolume[i] != 0.0) theta[i] = (3.0/wvolume[i]) * theta[i];
     else theta[i] = 0;
@@ -451,4 +451,3 @@ double PairPeriLPSOMP::memory_usage()
 
   return bytes;
 }
-
diff --git a/src/USER-OMP/pair_peri_lps_omp.h b/src/USER-OMP/pair_peri_lps_omp.h
index f234a41098..aedb51472e 100644
--- a/src/USER-OMP/pair_peri_lps_omp.h
+++ b/src/USER-OMP/pair_peri_lps_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_peri_pmb_omp.cpp b/src/USER-OMP/pair_peri_pmb_omp.cpp
index 36e4d1a16e..404f1d5695 100644
--- a/src/USER-OMP/pair_peri_pmb_omp.cpp
+++ b/src/USER-OMP/pair_peri_pmb_omp.cpp
@@ -71,11 +71,11 @@ void PairPeriPMBOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -158,7 +158,7 @@ void PairPeriPMBOMP::eval(int iifrom, int iito, ThrData * const thr)
       if (periodic) domain->minimum_image(delx0,dely0,delz0);
       rsq0 = delx0*delx0 + dely0*dely0 + delz0*delz0;
       jtype = type[j];
- 
+
       r = sqrt(rsq);
 
       // short-range interaction distance based on initial particle position
@@ -173,23 +173,23 @@ void PairPeriPMBOMP::eval(int iifrom, int iito, ThrData * const thr)
       if (r < d_ij) {
         dr = r - d_ij;
 
-        rk = (15.0 * kspring[itype][jtype] * vfrac[j]) * 
-	  (dr / cut[itype][jtype]);
+        rk = (15.0 * kspring[itype][jtype] * vfrac[j]) *
+          (dr / cut[itype][jtype]);
         if (r > 0.0) fpair = -(rk/r);
         else fpair = 0.0;
 
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
 
         if (EFLAG) evdwl = 0.5*rk*dr;
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,evdwl,0.0,
-				 fpair*vfrac[i],delx,dely,delz,thr);
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,evdwl,0.0,
+                                 fpair*vfrac[i],delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
@@ -206,7 +206,7 @@ void PairPeriPMBOMP::eval(int iifrom, int iito, ThrData * const thr)
   const int idelta = 1 + nlocal/comm->nthreads;
   iifrom = thr->get_tid()*idelta;
   iito   = ((iifrom + idelta) > nlocal) ? nlocal : (iifrom + idelta);
-#else 
+#else
   iifrom = 0;
   iito = nlocal;
 #endif
@@ -234,8 +234,8 @@ void PairPeriPMBOMP::eval(int iifrom, int iito, ThrData * const thr)
       // check if lost a partner without first breaking bond
 
       if (j < 0) {
-	partner[i][jj] = 0;
-	continue;
+        partner[i][jj] = 0;
+        continue;
       }
 
       // compute force density, add to PD equation of motion
@@ -257,8 +257,8 @@ void PairPeriPMBOMP::eval(int iifrom, int iito, ThrData * const thr)
       // scale vfrac[j] if particle j near the horizon
 
       if ((fabs(r0[i][jj] - delta)) <= half_lc)
-	vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) + 
-	  (1.0 + ((delta - half_lc)/(2*half_lc) ) );
+        vfrac_scale = (-1.0/(2*half_lc))*(r0[i][jj]) +
+          (1.0 + ((delta - half_lc)/(2*half_lc) ) );
       else vfrac_scale = 1.0;
 
       stretch = dr / r0[i][jj];
@@ -270,12 +270,12 @@ void PairPeriPMBOMP::eval(int iifrom, int iito, ThrData * const thr)
       f[i][1] += dely*fbond;
       f[i][2] += delz*fbond;
 
-      // since I-J is double counted, set newton off & use 1/2 factor and I,I 
+      // since I-J is double counted, set newton off & use 1/2 factor and I,I
 
       if (EFLAG) evdwl = 0.5*rk*dr;
-      if (EVFLAG) 
-	ev_tally_thr(this,i,i,nlocal,0,0.5*evdwl,0.0,
-		     0.5*fbond*vfrac[i],delx,dely,delz,thr);
+      if (EVFLAG)
+        ev_tally_thr(this,i,i,nlocal,0,0.5*evdwl,0.0,
+                     0.5*fbond*vfrac[i],delx,dely,delz,thr);
 
       // find stretch in bond I-J and break if necessary
       // use s0 from previous timestep
@@ -285,9 +285,9 @@ void PairPeriPMBOMP::eval(int iifrom, int iito, ThrData * const thr)
       // update s0 for next timestep
 
       if (first)
-	s0_new[i] = s00[itype][jtype] - (alpha[itype][jtype] * stretch);
+        s0_new[i] = s00[itype][jtype] - (alpha[itype][jtype] * stretch);
       else
-	s0_new[i] = MAX(s0_new[i],s00[itype][jtype] - (alpha[itype][jtype] * stretch));
+        s0_new[i] = MAX(s0_new[i],s00[itype][jtype] - (alpha[itype][jtype] * stretch));
 
       first = false;
     }
@@ -297,7 +297,7 @@ void PairPeriPMBOMP::eval(int iifrom, int iito, ThrData * const thr)
 
   // store new s0 (in parallel)
   if (iifrom < nlocal)
-    for (i = iifrom; i < iito; i++) s0[i] = s0_new[i]; 
+    for (i = iifrom; i < iito; i++) s0[i] = s0_new[i];
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/USER-OMP/pair_peri_pmb_omp.h b/src/USER-OMP/pair_peri_pmb_omp.h
index 8a7fc091d9..cb2d83250e 100644
--- a/src/USER-OMP/pair_peri_pmb_omp.h
+++ b/src/USER-OMP/pair_peri_pmb_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_rebo_omp.cpp b/src/USER-OMP/pair_rebo_omp.cpp
index 70b5c4e8ae..9a1ce8e11b 100644
--- a/src/USER-OMP/pair_rebo_omp.cpp
+++ b/src/USER-OMP/pair_rebo_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_rebo_omp.h b/src/USER-OMP/pair_rebo_omp.h
index 4606e56ae1..685c5d26a0 100644
--- a/src/USER-OMP/pair_rebo_omp.h
+++ b/src/USER-OMP/pair_rebo_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_resquared_omp.cpp b/src/USER-OMP/pair_resquared_omp.cpp
index 8decc2d6c5..de05202300 100644
--- a/src/USER-OMP/pair_resquared_omp.cpp
+++ b/src/USER-OMP/pair_resquared_omp.cpp
@@ -58,11 +58,11 @@ void PairRESquaredOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -126,7 +126,7 @@ void PairRESquaredOMP::eval(int iifrom, int iito, ThrData * const thr)
       // compute if less than cutoff
 
       if (rsq < cutsq[itype][jtype]) {
-	fforce[0] = fforce[1] = fforce[2] = 0.0;
+        fforce[0] = fforce[1] = fforce[2] = 0.0;
 
         switch (form[itype][jtype]) {
 
@@ -178,9 +178,9 @@ void PairRESquaredOMP::eval(int iifrom, int iito, ThrData * const thr)
         fforce[0] *= factor_lj;
         fforce[1] *= factor_lj;
         fforce[2] *= factor_lj;
-	fxtmp += fforce[0];
-	fytmp += fforce[1];
-	fztmp += fforce[2];
+        fxtmp += fforce[0];
+        fytmp += fforce[1];
+        fztmp += fforce[2];
 
         if (NEWTON_PAIR || j < nlocal) {
           f[j][0] -= fforce[0];
@@ -190,9 +190,9 @@ void PairRESquaredOMP::eval(int iifrom, int iito, ThrData * const thr)
 
         if (EFLAG) evdwl = factor_lj*one_eng;
 
-	if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,
-				     evdwl,0.0,fforce[0],fforce[1],fforce[2],
-				     -r12[0],-r12[1],-r12[2],thr);
+        if (EVFLAG) ev_tally_xyz_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                     evdwl,0.0,fforce[0],fforce[1],fforce[2],
+                                     -r12[0],-r12[1],-r12[2],thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_resquared_omp.h b/src/USER-OMP/pair_resquared_omp.h
index 53a6e2e28f..cc2a59d74a 100644
--- a/src/USER-OMP/pair_resquared_omp.h
+++ b/src/USER-OMP/pair_resquared_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_soft_omp.cpp b/src/USER-OMP/pair_soft_omp.cpp
index f0c9e60df2..51a43be28c 100644
--- a/src/USER-OMP/pair_soft_omp.cpp
+++ b/src/USER-OMP/pair_soft_omp.cpp
@@ -60,11 +60,11 @@ void PairSoftOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -121,26 +121,26 @@ void PairSoftOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	arg = MY_PI/cut[itype][jtype];
-	if (r > SMALL) fpair = factor_lj * prefactor[itype][jtype] * 
-		       sin(arg*r) * arg/r;
-	else fpair = 0.0;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG)
-	  evdwl = factor_lj * prefactor[itype][jtype] * (1.0+cos(arg*r));
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r = sqrt(rsq);
+        arg = MY_PI/cut[itype][jtype];
+        if (r > SMALL) fpair = factor_lj * prefactor[itype][jtype] *
+                       sin(arg*r) * arg/r;
+        else fpair = 0.0;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG)
+          evdwl = factor_lj * prefactor[itype][jtype] * (1.0+cos(arg*r));
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_soft_omp.h b/src/USER-OMP/pair_soft_omp.h
index 1698089521..74958208ed 100644
--- a/src/USER-OMP/pair_soft_omp.h
+++ b/src/USER-OMP/pair_soft_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_sw_omp.cpp b/src/USER-OMP/pair_sw_omp.cpp
index 1da1450ad0..6bac2420e1 100644
--- a/src/USER-OMP/pair_sw_omp.cpp
+++ b/src/USER-OMP/pair_sw_omp.cpp
@@ -56,9 +56,9 @@ void PairSWOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	eval<1,1>(ifrom, ito, thr);
+        eval<1,1>(ifrom, ito, thr);
       } else {
-	eval<1,0>(ifrom, ito, thr);
+        eval<1,0>(ifrom, ito, thr);
       }
     } else eval<0,0>(ifrom, ito, thr);
 
@@ -113,13 +113,13 @@ void PairSWOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtag = tag[j];
 
       if (itag > jtag) {
-	if ((itag+jtag) % 2 == 0) continue;
+        if ((itag+jtag) % 2 == 0) continue;
       } else if (itag < jtag) {
-	if ((itag+jtag) % 2 == 1) continue;
+        if ((itag+jtag) % 2 == 1) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
-	if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
+        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
       }
 
       jtype = map[type[j]];
@@ -142,7 +142,7 @@ void PairSWOMP::eval(int iifrom, int iito, ThrData * const thr)
       f[j][2] -= delz*fpair;
 
       if (EVFLAG) ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,
-			       evdwl,0.0,fpair,delx,dely,delz,thr);
+                               evdwl,0.0,fpair,delx,dely,delz,thr);
     }
 
     jnumm1 = jnum - 1;
@@ -162,32 +162,32 @@ void PairSWOMP::eval(int iifrom, int iito, ThrData * const thr)
       fjxtmp = fjytmp = fjztmp = 0.0;
 
       for (kk = jj+1; kk < jnum; kk++) {
-	k = jlist[kk];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	delr2[0] = x[k][0] - xtmp;
-	delr2[1] = x[k][1] - ytmp;
-	delr2[2] = x[k][2] - ztmp;
-	rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
-	if (rsq2 > params[ikparam].cutsq) continue;
-
-	threebody(&params[ijparam],&params[ikparam],&params[ijkparam],
-		  rsq1,rsq2,delr1,delr2,fj,fk,EFLAG,evdwl);
-
-	fxtmp -= fj[0] + fk[0];
-	fytmp -= fj[1] + fk[1];
-	fztmp -= fj[2] + fk[2];
-	fjxtmp += fj[0];
-	fjytmp += fj[1];
-	fjztmp += fj[2];
-	f[k][0] += fk[0];
-	f[k][1] += fk[1];
-	f[k][2] += fk[2];
-
-	if (EVFLAG) ev_tally3_thr(this,i,j,k,evdwl,0.0,fj,fk,delr1,delr2,thr);
+        k = jlist[kk];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        delr2[0] = x[k][0] - xtmp;
+        delr2[1] = x[k][1] - ytmp;
+        delr2[2] = x[k][2] - ztmp;
+        rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
+        if (rsq2 > params[ikparam].cutsq) continue;
+
+        threebody(&params[ijparam],&params[ikparam],&params[ijkparam],
+                  rsq1,rsq2,delr1,delr2,fj,fk,EFLAG,evdwl);
+
+        fxtmp -= fj[0] + fk[0];
+        fytmp -= fj[1] + fk[1];
+        fztmp -= fj[2] + fk[2];
+        fjxtmp += fj[0];
+        fjytmp += fj[1];
+        fjztmp += fj[2];
+        f[k][0] += fk[0];
+        f[k][1] += fk[1];
+        f[k][2] += fk[2];
+
+        if (EVFLAG) ev_tally3_thr(this,i,j,k,evdwl,0.0,fj,fk,delr1,delr2,thr);
       }
       f[j][0] += fjxtmp;
       f[j][1] += fjytmp;
diff --git a/src/USER-OMP/pair_sw_omp.h b/src/USER-OMP/pair_sw_omp.h
index c4af86007a..a99edba46e 100644
--- a/src/USER-OMP/pair_sw_omp.h
+++ b/src/USER-OMP/pair_sw_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_table_omp.cpp b/src/USER-OMP/pair_table_omp.cpp
index 5c6b7717f7..ee2e447a56 100644
--- a/src/USER-OMP/pair_table_omp.cpp
+++ b/src/USER-OMP/pair_table_omp.cpp
@@ -57,11 +57,11 @@ void PairTableOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -80,7 +80,7 @@ void PairTableOMP::eval(int iifrom, int iito, ThrData * const thr)
   double rsq,factor_lj,fraction,value,a,b;
   int *ilist,*jlist,*numneigh,**firstneigh;
   Table *tb;
-  
+
   union_int_float_t rsq_lookup;
   int tlm1 = tablength - 1;
 
@@ -123,75 +123,75 @@ void PairTableOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	tb = &tables[tabindex[itype][jtype]];
-
-	if (check_error_thr((rsq < tb->innersq),tid,
-			    FLERR,"Pair distance < table inner cutoff"))
-	  return;
- 
-	if (tabstyle == LOOKUP) {
-	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
-
-	  if (check_error_thr((itable >= tlm1),tid,
-			      FLERR,"Pair distance > table outer cutoff"))
-	    return;
-
-	  fpair = factor_lj * tb->f[itable];
-	} else if (tabstyle == LINEAR) {
-	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
-
-	  if (check_error_thr((itable >= tlm1),tid,
-			      FLERR,"Pair distance > table outer cutoff"))
-	    return;
-
-	  fraction = (rsq - tb->rsq[itable]) * tb->invdelta;
-	  value = tb->f[itable] + fraction*tb->df[itable];
-	  fpair = factor_lj * value;
-	} else if (tabstyle == SPLINE) {
-	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
-
-	  if (check_error_thr((itable >= tlm1),tid,
-			      FLERR,"Pair distance > table outer cutoff"))
-	    return;
-
-	  b = (rsq - tb->rsq[itable]) * tb->invdelta;
-	  a = 1.0 - b;
-	  value = a * tb->f[itable] + b * tb->f[itable+1] + 
-	    ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) * 
+        tb = &tables[tabindex[itype][jtype]];
+
+        if (check_error_thr((rsq < tb->innersq),tid,
+                            FLERR,"Pair distance < table inner cutoff"))
+          return;
+
+        if (tabstyle == LOOKUP) {
+          itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
+
+          if (check_error_thr((itable >= tlm1),tid,
+                              FLERR,"Pair distance > table outer cutoff"))
+            return;
+
+          fpair = factor_lj * tb->f[itable];
+        } else if (tabstyle == LINEAR) {
+          itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
+
+          if (check_error_thr((itable >= tlm1),tid,
+                              FLERR,"Pair distance > table outer cutoff"))
+            return;
+
+          fraction = (rsq - tb->rsq[itable]) * tb->invdelta;
+          value = tb->f[itable] + fraction*tb->df[itable];
+          fpair = factor_lj * value;
+        } else if (tabstyle == SPLINE) {
+          itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
+
+          if (check_error_thr((itable >= tlm1),tid,
+                              FLERR,"Pair distance > table outer cutoff"))
+            return;
+
+          b = (rsq - tb->rsq[itable]) * tb->invdelta;
+          a = 1.0 - b;
+          value = a * tb->f[itable] + b * tb->f[itable+1] +
+            ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) *
             tb->deltasq6;
-	  fpair = factor_lj * value;
-	} else {
-	  rsq_lookup.f = rsq;
-	  itable = rsq_lookup.i & tb->nmask;
-	  itable >>= tb->nshiftbits;
-	  fraction = (rsq_lookup.f - tb->rsq[itable]) * tb->drsq[itable];
-	  value = tb->f[itable] + fraction*tb->df[itable];
-	  fpair = factor_lj * value;
-	}
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  if (tabstyle == LOOKUP)
-	    evdwl = tb->e[itable];
-	  else if (tabstyle == LINEAR || tabstyle == BITMAP)
-	    evdwl = tb->e[itable] + fraction*tb->de[itable];
-	  else
-	    evdwl = a * tb->e[itable] + b * tb->e[itable+1] + 
-	      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * 
-	      tb->deltasq6;
-	  evdwl *= factor_lj;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+          fpair = factor_lj * value;
+        } else {
+          rsq_lookup.f = rsq;
+          itable = rsq_lookup.i & tb->nmask;
+          itable >>= tb->nshiftbits;
+          fraction = (rsq_lookup.f - tb->rsq[itable]) * tb->drsq[itable];
+          value = tb->f[itable] + fraction*tb->df[itable];
+          fpair = factor_lj * value;
+        }
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          if (tabstyle == LOOKUP)
+            evdwl = tb->e[itable];
+          else if (tabstyle == LINEAR || tabstyle == BITMAP)
+            evdwl = tb->e[itable] + fraction*tb->de[itable];
+          else
+            evdwl = a * tb->e[itable] + b * tb->e[itable+1] +
+              ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) *
+              tb->deltasq6;
+          evdwl *= factor_lj;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
 
diff --git a/src/USER-OMP/pair_table_omp.h b/src/USER-OMP/pair_table_omp.h
index 974149b9ac..dbc0b8e5b9 100644
--- a/src/USER-OMP/pair_table_omp.h
+++ b/src/USER-OMP/pair_table_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_tersoff_omp.cpp b/src/USER-OMP/pair_tersoff_omp.cpp
index c725d64253..573ed92ba3 100644
--- a/src/USER-OMP/pair_tersoff_omp.cpp
+++ b/src/USER-OMP/pair_tersoff_omp.cpp
@@ -56,11 +56,11 @@ void PairTersoffOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (vflag_atom) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (vflag_atom) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (vflag_atom) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (vflag_atom) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else eval<0,0,0>(ifrom, ito, thr);
 
@@ -116,13 +116,13 @@ void PairTersoffOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtag = tag[j];
 
       if (itag > jtag) {
-	if ((itag+jtag) % 2 == 0) continue;
+        if ((itag+jtag) % 2 == 0) continue;
       } else if (itag < jtag) {
-	if ((itag+jtag) % 2 == 1) continue;
+        if ((itag+jtag) % 2 == 1) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
-	if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp && x[j][1] < ytmp) continue;
+        if (x[j][2] == ztmp && x[j][1] == ytmp && x[j][0] < xtmp) continue;
       }
 
       jtype = map[type[j]];
@@ -145,7 +145,7 @@ void PairTersoffOMP::eval(int iifrom, int iito, ThrData * const thr)
       f[j][2] -= delz*fpair;
 
       if (EVFLAG) ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,
-			       evdwl,0.0,fpair,delx,dely,delz,thr);
+                               evdwl,0.0,fpair,delx,dely,delz,thr);
     }
 
     // three-body interactions
@@ -170,19 +170,19 @@ void PairTersoffOMP::eval(int iifrom, int iito, ThrData * const thr)
       zeta_ij = 0.0;
 
       for (kk = 0; kk < jnum; kk++) {
-	if (jj == kk) continue;
-	k = jlist[kk];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	iparam_ijk = elem2param[itype][jtype][ktype];
-
-	delr2[0] = x[k][0] - xtmp;
-	delr2[1] = x[k][1] - ytmp;
-	delr2[2] = x[k][2] - ztmp;
-	rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
-	if (rsq2 > params[iparam_ijk].cutsq) continue;
-
-	zeta_ij += zeta(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
+        if (jj == kk) continue;
+        k = jlist[kk];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        iparam_ijk = elem2param[itype][jtype][ktype];
+
+        delr2[0] = x[k][0] - xtmp;
+        delr2[1] = x[k][1] - ytmp;
+        delr2[2] = x[k][2] - ztmp;
+        rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
+        if (rsq2 > params[iparam_ijk].cutsq) continue;
+
+        zeta_ij += zeta(&params[iparam_ijk],rsq1,rsq2,delr1,delr2);
       }
 
       // pairwise force due to zeta
@@ -197,37 +197,37 @@ void PairTersoffOMP::eval(int iifrom, int iito, ThrData * const thr)
       fjztmp -= delr1[2]*fpair;
 
       if (EVFLAG) ev_tally_thr(this,i,j,nlocal,/* newton_pair */ 1,evdwl,0.0,
-			       -fpair,-delr1[0],-delr1[1],-delr1[2],thr);
+                               -fpair,-delr1[0],-delr1[1],-delr1[2],thr);
 
       // attractive term via loop over k
 
       for (kk = 0; kk < jnum; kk++) {
-	if (jj == kk) continue;
-	k = jlist[kk];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	iparam_ijk = elem2param[itype][jtype][ktype];
-
-	delr2[0] = x[k][0] - xtmp;
-	delr2[1] = x[k][1] - ytmp;
-	delr2[2] = x[k][2] - ztmp;
-	rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
-	if (rsq2 > params[iparam_ijk].cutsq) continue;
-
-	attractive(&params[iparam_ijk],prefactor,
-		   rsq1,rsq2,delr1,delr2,fi,fj,fk);
-
-	fxtmp += fi[0];
-	fytmp += fi[1];
-	fztmp += fi[2];
-	fjxtmp += fj[0];
-	fjytmp += fj[1];
-	fjztmp += fj[2];
-	f[k][0] += fk[0];
-	f[k][1] += fk[1];
-	f[k][2] += fk[2];
-
-	if (VFLAG_ATOM) v_tally3_thr(i,j,k,fj,fk,delr1,delr2,thr);
+        if (jj == kk) continue;
+        k = jlist[kk];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        iparam_ijk = elem2param[itype][jtype][ktype];
+
+        delr2[0] = x[k][0] - xtmp;
+        delr2[1] = x[k][1] - ytmp;
+        delr2[2] = x[k][2] - ztmp;
+        rsq2 = delr2[0]*delr2[0] + delr2[1]*delr2[1] + delr2[2]*delr2[2];
+        if (rsq2 > params[iparam_ijk].cutsq) continue;
+
+        attractive(&params[iparam_ijk],prefactor,
+                   rsq1,rsq2,delr1,delr2,fi,fj,fk);
+
+        fxtmp += fi[0];
+        fytmp += fi[1];
+        fztmp += fi[2];
+        fjxtmp += fj[0];
+        fjytmp += fj[1];
+        fjztmp += fj[2];
+        f[k][0] += fk[0];
+        f[k][1] += fk[1];
+        f[k][2] += fk[2];
+
+        if (VFLAG_ATOM) v_tally3_thr(i,j,k,fj,fk,delr1,delr2,thr);
       }
       f[j][0] += fjxtmp;
       f[j][1] += fjytmp;
diff --git a/src/USER-OMP/pair_tersoff_table_omp.cpp b/src/USER-OMP/pair_tersoff_table_omp.cpp
index 5deb5525ff..4560975b11 100644
--- a/src/USER-OMP/pair_tersoff_table_omp.cpp
+++ b/src/USER-OMP/pair_tersoff_table_omp.cpp
@@ -89,7 +89,7 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
   double invR_ij, invR_ik, cosTeta;
   double repulsivePotential, attractivePotential;
   double exponentRepulsivePotential, exponentAttractivePotential,interpolTMP,interpolDeltaX,interpolY1;
-  double interpolY2, cutoffFunctionIJ, attractiveExponential, repulsiveExponential, cutoffFunctionDerivedIJ,zeta; 
+  double interpolY2, cutoffFunctionIJ, attractiveExponential, repulsiveExponential, cutoffFunctionDerivedIJ,zeta;
   double gtetaFunctionIJK,gtetaFunctionDerivedIJK,cutoffFunctionIK;
   double cutoffFunctionDerivedIK,factor_force3_ij,factor_1_force3_ik;
   double factor_2_force3_ik,betaZetaPowerIJK,betaZetaPowerDerivedIJK,factor_force_tot;
@@ -123,9 +123,9 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
     jnum = numneigh[i];
 
     if (check_error_thr((jnum > leadingDimensionInteractionList), tid,
-			FLERR,"Too many neighbors for interaction list.\n"
-			"Check your system or increase 'leadingDimension"
-			"InteractionList'"))
+                        FLERR,"Too many neighbors for interaction list.\n"
+                        "Check your system or increase 'leadingDimension"
+                        "InteractionList'"))
       return;
 
     // Pre-calculate gteta and cutoff function
@@ -149,11 +149,11 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
       r_ij = sqrt(r_ij);
 
       invR_ij = 1.0 / r_ij;
-      
+
       directorCos_ij_x = invR_ij * dr_ij[0];
       directorCos_ij_y = invR_ij * dr_ij[1];
       directorCos_ij_z = invR_ij * dr_ij[2];
-      
+
       // preCutoffFunction
       interpolDeltaX =  r_ij - GRIDSTART;
       interpolTMP = (interpolDeltaX * GRIDDENSITY_FCUTOFF);
@@ -168,47 +168,47 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
 
 
       for (int neighbor_k = neighbor_j + 1; neighbor_k < jnum; neighbor_k++) {
-	double dr_ik[3], r_ik;
-
-	k = jlist[neighbor_k];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	dr_ik[0] = xtmp -x[k][0];
-	dr_ik[1] = ytmp -x[k][1];
-	dr_ik[2] = ztmp -x[k][2];
-	r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
-
-	if (r_ik > params[ikparam].cutsq) continue;
-
-	r_ik = sqrt(r_ik);
-
-	invR_ik = 1.0 / r_ik;
-          
-	directorCos_ik_x = invR_ik * dr_ik[0];
-	directorCos_ik_y = invR_ik * dr_ik[1];
-	directorCos_ik_z = invR_ik * dr_ik[2];
-          
-	cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y + directorCos_ij_z * directorCos_ik_z;
-          
-	// preGtetaFunction
-	interpolDeltaX=cosTeta+1.0;
-	interpolTMP = (interpolDeltaX * GRIDDENSITY_GTETA);
-	interpolIDX = (int) interpolTMP;
-	interpolY1 = gtetaFunction[itype][interpolIDX];
-	interpolY2 = gtetaFunction[itype][interpolIDX+1];
-	gtetaFunction_temp = interpolY1 + (interpolY2 - interpolY1) * (interpolTMP - interpolIDX);
-	// preGtetaFunctionDerived
-	interpolY1 = gtetaFunctionDerived[itype][interpolIDX];
-	interpolY2 = gtetaFunctionDerived[itype][interpolIDX+1];
-	gtetaFunctionDerived_temp = interpolY1 + (interpolY2 - interpolY1) * (interpolTMP - interpolIDX);
-          
-	preGtetaFunction[neighbor_j][neighbor_k]=params[ijkparam].gamma*gtetaFunction_temp;
-	preGtetaFunctionDerived[neighbor_j][neighbor_k]=params[ijkparam].gamma*gtetaFunctionDerived_temp;
-	preGtetaFunction[neighbor_k][neighbor_j]=params[ijkparam].gamma*gtetaFunction_temp;
-	preGtetaFunctionDerived[neighbor_k][neighbor_j]=params[ijkparam].gamma*gtetaFunctionDerived_temp;
+        double dr_ik[3], r_ik;
+
+        k = jlist[neighbor_k];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        dr_ik[0] = xtmp -x[k][0];
+        dr_ik[1] = ytmp -x[k][1];
+        dr_ik[2] = ztmp -x[k][2];
+        r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
+
+        if (r_ik > params[ikparam].cutsq) continue;
+
+        r_ik = sqrt(r_ik);
+
+        invR_ik = 1.0 / r_ik;
+
+        directorCos_ik_x = invR_ik * dr_ik[0];
+        directorCos_ik_y = invR_ik * dr_ik[1];
+        directorCos_ik_z = invR_ik * dr_ik[2];
+
+        cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y + directorCos_ij_z * directorCos_ik_z;
+
+        // preGtetaFunction
+        interpolDeltaX=cosTeta+1.0;
+        interpolTMP = (interpolDeltaX * GRIDDENSITY_GTETA);
+        interpolIDX = (int) interpolTMP;
+        interpolY1 = gtetaFunction[itype][interpolIDX];
+        interpolY2 = gtetaFunction[itype][interpolIDX+1];
+        gtetaFunction_temp = interpolY1 + (interpolY2 - interpolY1) * (interpolTMP - interpolIDX);
+        // preGtetaFunctionDerived
+        interpolY1 = gtetaFunctionDerived[itype][interpolIDX];
+        interpolY2 = gtetaFunctionDerived[itype][interpolIDX+1];
+        gtetaFunctionDerived_temp = interpolY1 + (interpolY2 - interpolY1) * (interpolTMP - interpolIDX);
+
+        preGtetaFunction[neighbor_j][neighbor_k]=params[ijkparam].gamma*gtetaFunction_temp;
+        preGtetaFunctionDerived[neighbor_j][neighbor_k]=params[ijkparam].gamma*gtetaFunctionDerived_temp;
+        preGtetaFunction[neighbor_k][neighbor_j]=params[ijkparam].gamma*gtetaFunction_temp;
+        preGtetaFunctionDerived[neighbor_k][neighbor_j]=params[ijkparam].gamma*gtetaFunctionDerived_temp;
 
       } // loop on K
 
@@ -235,7 +235,7 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
 
       r_ij = sqrt(r_ij);
       invR_ij = 1.0 / r_ij;
-      
+
       directorCos_ij_x = invR_ij * dr_ij[0];
       directorCos_ij_y = invR_ij * dr_ij[1];
       directorCos_ij_z = invR_ij * dr_ij[2];
@@ -265,72 +265,72 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
       cutoffFunctionDerivedIJ = preCutoffFunctionDerived[neighbor_j];
 
       zeta = 0.0;
-            
+
       // first loop over neighbours 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;
-
-	k = jlist[neighbor_k];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	dr_ik[0] = xtmp -x[k][0];
-	dr_ik[1] = ytmp -x[k][1];
-	dr_ik[2] = ztmp -x[k][2];
-	r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
-
-	if (r_ik > params[ikparam].cutsq) continue;
-
-	r_ik = sqrt(r_ik);
-
-	invR_ik = 1.0 / r_ik;
-          
-	directorCos_ik_x = invR_ik * r_ik_x;
-	directorCos_ik_y = invR_ik * r_ik_y;
-	directorCos_ik_z = invR_ik * r_ik_z;
-          
-	gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
-          
-	cutoffFunctionIK = preCutoffFunction[neighbor_k];
-          
-	zeta += cutoffFunctionIK * gtetaFunctionIJK;
-          
+        double dr_ik[3], r_ik;
+
+        k = jlist[neighbor_k];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        dr_ik[0] = xtmp -x[k][0];
+        dr_ik[1] = ytmp -x[k][1];
+        dr_ik[2] = ztmp -x[k][2];
+        r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
+
+        if (r_ik > params[ikparam].cutsq) continue;
+
+        r_ik = sqrt(r_ik);
+
+        invR_ik = 1.0 / r_ik;
+
+        directorCos_ik_x = invR_ik * r_ik_x;
+        directorCos_ik_y = invR_ik * r_ik_y;
+        directorCos_ik_z = invR_ik * r_ik_z;
+
+        gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
+
+        cutoffFunctionIK = preCutoffFunction[neighbor_k];
+
+        zeta += cutoffFunctionIK * gtetaFunctionIJK;
+
       }
 
       // first loop over neighbours 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;
-
-	k = jlist[neighbor_k];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	dr_ik[0] = xtmp -x[k][0];
-	dr_ik[1] = ytmp -x[k][1];
-	dr_ik[2] = ztmp -x[k][2];
-	r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
-
-	if (r_ik > params[ikparam].cutsq) continue;
-
-	r_ik = sqrt(r_ik);
-	invR_ik = 1.0 / r_ik;
-          
-	directorCos_ik_x = invR_ik * dr_ik[0];
-	directorCos_ik_y = invR_ik * dr_ik[1];
-	directorCos_ik_z = invR_ik * dr_ik[2];
-          
-	gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
-          
-	cutoffFunctionIK = preCutoffFunction[neighbor_k];
-          
-	zeta += cutoffFunctionIK * gtetaFunctionIJK;
+        double dr_ik[3], r_ik;
+
+        k = jlist[neighbor_k];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        dr_ik[0] = xtmp -x[k][0];
+        dr_ik[1] = ytmp -x[k][1];
+        dr_ik[2] = ztmp -x[k][2];
+        r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
+
+        if (r_ik > params[ikparam].cutsq) continue;
+
+        r_ik = sqrt(r_ik);
+        invR_ik = 1.0 / r_ik;
+
+        directorCos_ik_x = invR_ik * dr_ik[0];
+        directorCos_ik_y = invR_ik * dr_ik[1];
+        directorCos_ik_z = invR_ik * dr_ik[2];
+
+        gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
+
+        cutoffFunctionIK = preCutoffFunction[neighbor_k];
+
+        zeta += cutoffFunctionIK * gtetaFunctionIJK;
       }
-            
-      // betaZetaPowerIJK 
+
+      // betaZetaPowerIJK
       interpolDeltaX= params[ijparam].beta * zeta;
       interpolTMP = (interpolDeltaX * GRIDDENSITY_BIJ);
       interpolIDX = (int) interpolTMP;
@@ -358,145 +358,145 @@ void PairTersoffTableOMP::eval(int iifrom, int iito, ThrData * const thr)
       fztmp -= f_ij[2];
 
       // potential energy
-      evdwl = cutoffFunctionIJ * repulsivePotential 
-	+ cutoffFunctionIJ * attractivePotential * betaZetaPowerIJK;
+      evdwl = cutoffFunctionIJ * repulsivePotential
+        + cutoffFunctionIJ * attractivePotential * betaZetaPowerIJK;
 
       if (EVFLAG) ev_tally_thr(this,i, j, nlocal, /* newton_pair */ 1, 0.5 * evdwl, 0.0,
-			       -factor_force_ij*invR_ij, dr_ij[0], dr_ij[1], dr_ij[2],thr);
+                               -factor_force_ij*invR_ij, dr_ij[0], dr_ij[1], dr_ij[2],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
       for (int neighbor_k = 0; neighbor_k < neighbor_j; neighbor_k++) {
-	double dr_ik[3], r_ik, f_ik[3];
-
-	k = jlist[neighbor_k];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	dr_ik[0] = xtmp -x[k][0];
-	dr_ik[1] = ytmp -x[k][1];
-	dr_ik[2] = ztmp -x[k][2];
-	r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
-
-	if (r_ik > params[ikparam].cutsq) continue;
-
-	r_ik = sqrt(r_ik);
-	invR_ik = 1.0 / r_ik;
-          
-	directorCos_ik_x = invR_ik * dr_ik[0];
-	directorCos_ik_y = invR_ik * dr_ik[1];
-	directorCos_ik_z = invR_ik * dr_ik[2];
-          
-	cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y
-	  + directorCos_ij_z * directorCos_ik_z;
-          
-	gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
-          
-	gtetaFunctionDerivedIJK = preGtetaFunctionDerived[neighbor_j][neighbor_k];
-          
-	cutoffFunctionIK = preCutoffFunction[neighbor_k];
-          
-	cutoffFunctionDerivedIK = preCutoffFunctionDerived[neighbor_k];
-          
-	factor_force3_ij= cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ij *factor_force_tot;
-          
-	f_ij[0] = factor_force3_ij * (directorCos_ij_x*cosTeta - directorCos_ik_x);
-	f_ij[1] = factor_force3_ij * (directorCos_ij_y*cosTeta - directorCos_ik_y);
-	f_ij[2] = factor_force3_ij * (directorCos_ij_z*cosTeta - directorCos_ik_z);
-          
-	factor_1_force3_ik = (cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ik)*factor_force_tot;
-	factor_2_force3_ik = -(cutoffFunctionDerivedIK * gtetaFunctionIJK)*factor_force_tot;
-          
-	f_ik[0] = factor_1_force3_ik * (directorCos_ik_x*cosTeta - directorCos_ij_x)
-	  + factor_2_force3_ik * directorCos_ik_x;
-	f_ik[1] = factor_1_force3_ik * (directorCos_ik_y*cosTeta - directorCos_ij_y)
-	  + factor_2_force3_ik * directorCos_ik_y;
-	f_ik[2] = factor_1_force3_ik * (directorCos_ik_z*cosTeta - directorCos_ij_z)
-	  + factor_2_force3_ik * directorCos_ik_z;
-          
-	f[j][0] -= f_ij[0];
-	f[j][1] -= f_ij[1];
-	f[j][2] -= f_ij[2];
-
-	f[k][0] -= f_ik[0];
-	f[k][1] -= f_ik[1];
-	f[k][2] -= f_ik[2];
-
-	fxtmp += f_ij[0] + f_ik[0];
-	fytmp += f_ij[1] + f_ik[1];
-	fztmp += f_ij[2] + f_ik[2];
-
-	if (VFLAG_ATOM) v_tally3_thr(i,j,k,f_ij,f_ik,dr_ij,dr_ik,thr);
+        double dr_ik[3], r_ik, f_ik[3];
+
+        k = jlist[neighbor_k];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        dr_ik[0] = xtmp -x[k][0];
+        dr_ik[1] = ytmp -x[k][1];
+        dr_ik[2] = ztmp -x[k][2];
+        r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
+
+        if (r_ik > params[ikparam].cutsq) continue;
+
+        r_ik = sqrt(r_ik);
+        invR_ik = 1.0 / r_ik;
+
+        directorCos_ik_x = invR_ik * dr_ik[0];
+        directorCos_ik_y = invR_ik * dr_ik[1];
+        directorCos_ik_z = invR_ik * dr_ik[2];
+
+        cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y
+          + directorCos_ij_z * directorCos_ik_z;
+
+        gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
+
+        gtetaFunctionDerivedIJK = preGtetaFunctionDerived[neighbor_j][neighbor_k];
+
+        cutoffFunctionIK = preCutoffFunction[neighbor_k];
+
+        cutoffFunctionDerivedIK = preCutoffFunctionDerived[neighbor_k];
+
+        factor_force3_ij= cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ij *factor_force_tot;
+
+        f_ij[0] = factor_force3_ij * (directorCos_ij_x*cosTeta - directorCos_ik_x);
+        f_ij[1] = factor_force3_ij * (directorCos_ij_y*cosTeta - directorCos_ik_y);
+        f_ij[2] = factor_force3_ij * (directorCos_ij_z*cosTeta - directorCos_ik_z);
+
+        factor_1_force3_ik = (cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ik)*factor_force_tot;
+        factor_2_force3_ik = -(cutoffFunctionDerivedIK * gtetaFunctionIJK)*factor_force_tot;
+
+        f_ik[0] = factor_1_force3_ik * (directorCos_ik_x*cosTeta - directorCos_ij_x)
+          + factor_2_force3_ik * directorCos_ik_x;
+        f_ik[1] = factor_1_force3_ik * (directorCos_ik_y*cosTeta - directorCos_ij_y)
+          + factor_2_force3_ik * directorCos_ik_y;
+        f_ik[2] = factor_1_force3_ik * (directorCos_ik_z*cosTeta - directorCos_ij_z)
+          + factor_2_force3_ik * directorCos_ik_z;
+
+        f[j][0] -= f_ij[0];
+        f[j][1] -= f_ij[1];
+        f[j][2] -= f_ij[2];
+
+        f[k][0] -= f_ik[0];
+        f[k][1] -= f_ik[1];
+        f[k][2] -= f_ik[2];
+
+        fxtmp += f_ij[0] + f_ik[0];
+        fytmp += f_ij[1] + f_ik[1];
+        fztmp += f_ij[2] + f_ik[2];
+
+        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
       for (int neighbor_k = neighbor_j+1; neighbor_k < jnum; neighbor_k++) {
-	double dr_ik[3], r_ik, f_ik[3];
-
-	k = jlist[neighbor_k];
-	k &= NEIGHMASK;
-	ktype = map[type[k]];
-	ikparam = elem2param[itype][ktype][ktype];
-	ijkparam = elem2param[itype][jtype][ktype];
-
-	dr_ik[0] = xtmp -x[k][0];
-	dr_ik[1] = ytmp -x[k][1];
-	dr_ik[2] = ztmp -x[k][2];
-	r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
-
-	if (r_ik > params[ikparam].cutsq) continue;
-
-	r_ik = sqrt(r_ik);
-	invR_ik = 1.0 / r_ik;
-          
-	directorCos_ik_x = invR_ik * dr_ik[0];
-	directorCos_ik_y = invR_ik * dr_ik[1];
-	directorCos_ik_z = invR_ik * dr_ik[2];
-          
-	cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y
-	  + directorCos_ij_z * directorCos_ik_z;
-          
-	gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
-          
-	gtetaFunctionDerivedIJK = preGtetaFunctionDerived[neighbor_j][neighbor_k];
-          
-	cutoffFunctionIK = preCutoffFunction[neighbor_k];
-          
-	cutoffFunctionDerivedIK = preCutoffFunctionDerived[neighbor_k];
-          
-	factor_force3_ij= cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ij *factor_force_tot;
-          
-	f_ij[0] = factor_force3_ij * (directorCos_ij_x*cosTeta - directorCos_ik_x);
-	f_ij[1] = factor_force3_ij * (directorCos_ij_y*cosTeta - directorCos_ik_y);
-	f_ij[2] = factor_force3_ij * (directorCos_ij_z*cosTeta - directorCos_ik_z);
-          
-	factor_1_force3_ik = (cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ik)*factor_force_tot;
-	factor_2_force3_ik = -(cutoffFunctionDerivedIK * gtetaFunctionIJK)*factor_force_tot;
-          
-	f_ik[0] = factor_1_force3_ik * (directorCos_ik_x*cosTeta - directorCos_ij_x)
-	  + factor_2_force3_ik * directorCos_ik_x;
-	f_ik[1] = factor_1_force3_ik * (directorCos_ik_y*cosTeta - directorCos_ij_y)
-	  + factor_2_force3_ik * directorCos_ik_y;
-	f_ik[2] = factor_1_force3_ik * (directorCos_ik_z*cosTeta - directorCos_ij_z)
-	  + factor_2_force3_ik * directorCos_ik_z;
-          
-	f[j][0] -= f_ij[0];
-	f[j][1] -= f_ij[1];
-	f[j][2] -= f_ij[2];
-
-	f[k][0] -= f_ik[0];
-	f[k][1] -= f_ik[1];
-	f[k][2] -= f_ik[2];
-
-	fxtmp += f_ij[0] + f_ik[0];
-	fytmp += f_ij[1] + f_ik[1];
-	fztmp += f_ij[2] + f_ik[2];
-
-	if (VFLAG_ATOM) v_tally3_thr(i,j,k,f_ij,f_ik,dr_ij,dr_ik,thr);
-         
+        double dr_ik[3], r_ik, f_ik[3];
+
+        k = jlist[neighbor_k];
+        k &= NEIGHMASK;
+        ktype = map[type[k]];
+        ikparam = elem2param[itype][ktype][ktype];
+        ijkparam = elem2param[itype][jtype][ktype];
+
+        dr_ik[0] = xtmp -x[k][0];
+        dr_ik[1] = ytmp -x[k][1];
+        dr_ik[2] = ztmp -x[k][2];
+        r_ik = dr_ik[0]*dr_ik[0] + dr_ik[1]*dr_ik[1] + dr_ik[2]*dr_ik[2];
+
+        if (r_ik > params[ikparam].cutsq) continue;
+
+        r_ik = sqrt(r_ik);
+        invR_ik = 1.0 / r_ik;
+
+        directorCos_ik_x = invR_ik * dr_ik[0];
+        directorCos_ik_y = invR_ik * dr_ik[1];
+        directorCos_ik_z = invR_ik * dr_ik[2];
+
+        cosTeta = directorCos_ij_x * directorCos_ik_x + directorCos_ij_y * directorCos_ik_y
+          + directorCos_ij_z * directorCos_ik_z;
+
+        gtetaFunctionIJK = preGtetaFunction[neighbor_j][neighbor_k];
+
+        gtetaFunctionDerivedIJK = preGtetaFunctionDerived[neighbor_j][neighbor_k];
+
+        cutoffFunctionIK = preCutoffFunction[neighbor_k];
+
+        cutoffFunctionDerivedIK = preCutoffFunctionDerived[neighbor_k];
+
+        factor_force3_ij= cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ij *factor_force_tot;
+
+        f_ij[0] = factor_force3_ij * (directorCos_ij_x*cosTeta - directorCos_ik_x);
+        f_ij[1] = factor_force3_ij * (directorCos_ij_y*cosTeta - directorCos_ik_y);
+        f_ij[2] = factor_force3_ij * (directorCos_ij_z*cosTeta - directorCos_ik_z);
+
+        factor_1_force3_ik = (cutoffFunctionIK * gtetaFunctionDerivedIJK * invR_ik)*factor_force_tot;
+        factor_2_force3_ik = -(cutoffFunctionDerivedIK * gtetaFunctionIJK)*factor_force_tot;
+
+        f_ik[0] = factor_1_force3_ik * (directorCos_ik_x*cosTeta - directorCos_ij_x)
+          + factor_2_force3_ik * directorCos_ik_x;
+        f_ik[1] = factor_1_force3_ik * (directorCos_ik_y*cosTeta - directorCos_ij_y)
+          + factor_2_force3_ik * directorCos_ik_y;
+        f_ik[2] = factor_1_force3_ik * (directorCos_ik_z*cosTeta - directorCos_ij_z)
+          + factor_2_force3_ik * directorCos_ik_z;
+
+        f[j][0] -= f_ij[0];
+        f[j][1] -= f_ij[1];
+        f[j][2] -= f_ij[2];
+
+        f[k][0] -= f_ik[0];
+        f[k][1] -= f_ik[1];
+        f[k][2] -= f_ik[2];
+
+        fxtmp += f_ij[0] + f_ik[0];
+        fytmp += f_ij[1] + f_ik[1];
+        fztmp += f_ij[2] + f_ik[2];
+
+        if (VFLAG_ATOM) v_tally3_thr(i,j,k,f_ij,f_ik,dr_ij,dr_ik,thr);
+
       }
     } // loop on J
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_tersoff_zbl_omp.cpp b/src/USER-OMP/pair_tersoff_zbl_omp.cpp
index 74e77d5444..f143312e0a 100644
--- a/src/USER-OMP/pair_tersoff_zbl_omp.cpp
+++ b/src/USER-OMP/pair_tersoff_zbl_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -111,8 +111,8 @@ void PairTersoffZBLOMP::read_file(char *file)
     if (comm->me == 0) {
       ptr = fgets(line,MAXLINE,fp);
       if (ptr == NULL) {
-	eof = 1;
-	fclose(fp);
+        eof = 1;
+        fclose(fp);
       } else n = strlen(line) + 1;
     }
     MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -133,8 +133,8 @@ void PairTersoffZBLOMP::read_file(char *file)
       if (comm->me == 0) {
         ptr = fgets(&line[n],MAXLINE-n,fp);
         if (ptr == NULL) {
-	  eof = 1;
-	  fclose(fp);
+          eof = 1;
+          fclose(fp);
         } else n = strlen(line) + 1;
       }
       MPI_Bcast(&eof,1,MPI_INT,0,world);
@@ -173,7 +173,7 @@ void PairTersoffZBLOMP::read_file(char *file)
     if (nparams == maxparam) {
       maxparam += DELTA;
       params = (Param *) memory->srealloc(params,maxparam*sizeof(Param),
-					  "pair:params");
+                                          "pair:params");
     }
 
     params[nparams].ielement = ielement;
@@ -203,18 +203,18 @@ void PairTersoffZBLOMP::read_file(char *file)
     params[nparams].powermint = int(params[nparams].powerm);
 
     if (
-	params[nparams].lam3 < 0.0 || params[nparams].c < 0.0 || 
-	params[nparams].d < 0.0 || params[nparams].powern < 0.0 || 
-	params[nparams].beta < 0.0 || params[nparams].lam2 < 0.0 || 
-	params[nparams].bigb < 0.0 || params[nparams].bigr < 0.0 ||
-	params[nparams].bigd < 0.0 ||
-	params[nparams].bigd > params[nparams].bigr ||
-	params[nparams].lam3 < 0.0 || params[nparams].biga < 0.0 ||
-	params[nparams].powerm - params[nparams].powermint != 0.0 ||
+        params[nparams].lam3 < 0.0 || params[nparams].c < 0.0 ||
+        params[nparams].d < 0.0 || params[nparams].powern < 0.0 ||
+        params[nparams].beta < 0.0 || params[nparams].lam2 < 0.0 ||
+        params[nparams].bigb < 0.0 || params[nparams].bigr < 0.0 ||
+        params[nparams].bigd < 0.0 ||
+        params[nparams].bigd > params[nparams].bigr ||
+        params[nparams].lam3 < 0.0 || params[nparams].biga < 0.0 ||
+        params[nparams].powerm - params[nparams].powermint != 0.0 ||
         (params[nparams].powermint != 3 && params[nparams].powermint != 1) ||
-	params[nparams].gamma < 0.0 ||
-	params[nparams].Z_i < 1.0 || params[nparams].Z_j < 1.0 ||
-	params[nparams].ZBLcut < 0.0 || params[nparams].ZBLexpscale < 0.0)
+        params[nparams].gamma < 0.0 ||
+        params[nparams].Z_i < 1.0 || params[nparams].Z_j < 1.0 ||
+        params[nparams].ZBLcut < 0.0 || params[nparams].ZBLexpscale < 0.0)
       error->all(FLERR,"Illegal Tersoff parameter");
 
     nparams++;
@@ -226,21 +226,21 @@ void PairTersoffZBLOMP::read_file(char *file)
 /* ---------------------------------------------------------------------- */
 
 void PairTersoffZBLOMP::force_zeta(Param *param, double rsq, double zeta_ij,
-				   double &fforce, double &prefactor,
-				   int eflag, double &eng)
+                                   double &fforce, double &prefactor,
+                                   int eflag, double &eng)
 {
   double r,fa,fa_d,bij;
 
   r = sqrt(rsq);
 
   fa = (r > param->bigr + param->bigd) ? 0.0 :
-    -param->bigb * exp(-param->lam2 * r) * ters_fc(r,param) * 
+    -param->bigb * exp(-param->lam2 * r) * ters_fc(r,param) *
     F_fermi(r,param->ZBLexpscale,param->ZBLcut);
 
   fa_d = (r > param->bigr + param->bigd) ? 0.0 :
     param->bigb * exp(-param->lam2 * r) *
-    (param->lam2 * ters_fc(r,param) * 
-     F_fermi(r,param->ZBLexpscale,param->ZBLcut) - 
+    (param->lam2 * ters_fc(r,param) *
+     F_fermi(r,param->ZBLexpscale,param->ZBLcut) -
      ters_fc_d(r,param) * F_fermi(r,param->ZBLexpscale,param->ZBLcut)
      - ters_fc(r,param) * F_fermi_d(r,param->ZBLexpscale,param->ZBLcut));
 
@@ -253,7 +253,7 @@ void PairTersoffZBLOMP::force_zeta(Param *param, double rsq, double zeta_ij,
 /* ---------------------------------------------------------------------- */
 
 void PairTersoffZBLOMP::repulsive(Param *param, double rsq, double &fforce,
-			       int eflag, double &eng)
+                               int eflag, double &eng)
 {
   double r,tmp_fc,tmp_fc_d,tmp_exp;
 
@@ -265,32 +265,31 @@ void PairTersoffZBLOMP::repulsive(Param *param, double rsq, double &fforce,
   tmp_exp = exp(-param->lam1 * r);
   double fforce_ters = param->biga * tmp_exp * (tmp_fc_d - tmp_fc*param->lam1);
   double eng_ters = tmp_fc * param->biga * tmp_exp;
-	
+
   // ZBL repulsive portion
 
   double esq = pow(global_e,2.0);
-  double a_ij = (0.8854*global_a_0) / 
+  double a_ij = (0.8854*global_a_0) /
     (pow(param->Z_i,0.23) + pow(param->Z_j,0.23));
   double premult = (param->Z_i * param->Z_j * esq)/(4.0*MY_PI*global_epsilon_0);
   double r_ov_a = r/a_ij;
-  double phi = 0.1818*exp(-3.2*r_ov_a) + 0.5099*exp(-0.9423*r_ov_a) + 
+  double phi = 0.1818*exp(-3.2*r_ov_a) + 0.5099*exp(-0.9423*r_ov_a) +
     0.2802*exp(-0.4029*r_ov_a) + 0.02817*exp(-0.2016*r_ov_a);
-  double dphi = (1.0/a_ij) * (-3.2*0.1818*exp(-3.2*r_ov_a) - 
-			      0.9423*0.5099*exp(-0.9423*r_ov_a) - 
-			      0.4029*0.2802*exp(-0.4029*r_ov_a) - 
-			      0.2016*0.02817*exp(-0.2016*r_ov_a));
+  double dphi = (1.0/a_ij) * (-3.2*0.1818*exp(-3.2*r_ov_a) -
+                              0.9423*0.5099*exp(-0.9423*r_ov_a) -
+                              0.4029*0.2802*exp(-0.4029*r_ov_a) -
+                              0.2016*0.02817*exp(-0.2016*r_ov_a));
   double fforce_ZBL = premult*-pow(r,-2.0)* phi + premult*pow(r,-1.0)*dphi;
   double eng_ZBL = premult*(1.0/r)*phi;
-  
+
   // combine two parts with smoothing by Fermi-like function
 
   fforce = -(-F_fermi_d(r,param->ZBLexpscale,param->ZBLcut) * eng_ZBL +
-	     (1.0 - F_fermi(r,param->ZBLexpscale,param->ZBLcut))*fforce_ZBL +
-	     F_fermi_d(r,param->ZBLexpscale,param->ZBLcut)*eng_ters +
-	     F_fermi(r,param->ZBLexpscale,param->ZBLcut)*fforce_ters) / r;
-  
+             (1.0 - F_fermi(r,param->ZBLexpscale,param->ZBLcut))*fforce_ZBL +
+             F_fermi_d(r,param->ZBLexpscale,param->ZBLcut)*eng_ters +
+             F_fermi(r,param->ZBLexpscale,param->ZBLcut)*fforce_ters) / r;
+
   if (eflag)
     eng = (1.0 - F_fermi(r,param->ZBLexpscale,param->ZBLcut))*eng_ZBL +
       F_fermi(r,param->ZBLexpscale,param->ZBLcut)*eng_ters;
 }
-
diff --git a/src/USER-OMP/pair_tersoff_zbl_omp.h b/src/USER-OMP/pair_tersoff_zbl_omp.h
index 84d6ef1135..32d7b6b4c4 100644
--- a/src/USER-OMP/pair_tersoff_zbl_omp.h
+++ b/src/USER-OMP/pair_tersoff_zbl_omp.h
@@ -29,9 +29,9 @@ class PairTersoffZBLOMP : public PairTersoffOMP {
   virtual ~PairTersoffZBLOMP() {}
 
  protected:
-  double global_a_0;		// Bohr radius for Coulomb repulsion
-  double global_epsilon_0;	// permittivity of vacuum for Coulomb repulsion
-  double global_e;		// proton charge (negative of electron charge)
+  double global_a_0;                // Bohr radius for Coulomb repulsion
+  double global_epsilon_0;        // permittivity of vacuum for Coulomb repulsion
+  double global_e;                // proton charge (negative of electron charge)
 
   virtual void read_file(char *);
   virtual void repulsive(Param *, double, double &, int, double &);
diff --git a/src/USER-OMP/pair_tri_lj_omp.cpp b/src/USER-OMP/pair_tri_lj_omp.cpp
index eedbc570af..16dce231ba 100644
--- a/src/USER-OMP/pair_tri_lj_omp.cpp
+++ b/src/USER-OMP/pair_tri_lj_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -71,16 +71,16 @@ void PairTriLJOMP::compute(int eflag, int vflag)
   // until we find a good way to multi-thread it.
   for (int i = 0; i < nall; ++i) {
     double dc1[3],dc2[3],dc3[3],p[3][3];
-    
+
     if (tri[i] >= 0) {
       if (dnum[i] == 0) {
-	MathExtra::quat_to_mat(bonus[tri[i]].quat,p);
-	MathExtra::matvec(p,bonus[tri[i]].c1,dc1);
-	MathExtra::matvec(p,bonus[tri[i]].c2,dc2);
-	MathExtra::matvec(p,bonus[tri[i]].c3,dc3);
-	dfirst[i] = ndiscrete;
-	discretize(i,sigma[type[i]][type[i]],dc1,dc2,dc3);
-	dnum[i] = ndiscrete - dfirst[i];
+        MathExtra::quat_to_mat(bonus[tri[i]].quat,p);
+        MathExtra::matvec(p,bonus[tri[i]].c1,dc1);
+        MathExtra::matvec(p,bonus[tri[i]].c2,dc2);
+        MathExtra::matvec(p,bonus[tri[i]].c3,dc3);
+        dfirst[i] = ndiscrete;
+        discretize(i,sigma[type[i]][type[i]],dc1,dc2,dc3);
+        dnum[i] = ndiscrete - dfirst[i];
       }
     }
   }
@@ -97,11 +97,11 @@ void PairTriLJOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -155,247 +155,247 @@ void PairTriLJOMP::eval(int iifrom, int iito, ThrData * const thr)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq >= cutsq[itype][jtype]) continue;
-      
+
       // tri/tri interactions = NxN particles
       // c1,c2,c3 = corner pts of triangle I or J
-      
+
       evdwl = 0.0;
       if (tri[i] >= 0 && tri[j] >= 0) {
-	npi = dnum[i];
-	ifirst = dfirst[i];
-	npj = dnum[j];
-	jfirst = dfirst[j];
-
-	fi[0]=fi[1]=fi[2]=fj[0]=fj[1]=fj[2]=0.0;
-	ti[0]=ti[1]=ti[2]=tj[0]=tj[1]=tj[2]=0.0;
-
-	for (ni = 0; ni < npi; ni++) {
-	  dxi = discrete[ifirst+ni].dx;
-	  dyi = discrete[ifirst+ni].dy;
-	  dzi = discrete[ifirst+ni].dz;
-
-	  for (nj = 0; nj < npj; nj++) {
-	    dxj = discrete[jfirst+nj].dx;
-	    dyj = discrete[jfirst+nj].dy;
-	    dzj = discrete[jfirst+nj].dz;
-
-	    xi[0] = x[i][0] + dxi;
-	    xi[1] = x[i][1] + dyi;
-	    xi[2] = x[i][2] + dzi;
-	    xj[0] = x[j][0] + dxj;
-	    xj[1] = x[j][1] + dyj;
-	    xj[2] = x[j][2] + dzj;
-
-	    delx = xi[0] - xj[0];
-	    dely = xi[1] - xj[1];
-	    delz = xi[2] - xj[2];
-	    rsq = delx*delx + dely*dely + delz*delz;
- 
-	    sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
-	    sig3 = sig*sig*sig;
-	    term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	    term1 = 2.0 * term2 * sig3*sig3;
-	    r2inv = 1.0/rsq;
-	    r6inv = r2inv*r2inv*r2inv;
-	    forcelj = r6inv * (term1*r6inv - term2);
-	    fpair = forcelj*r2inv;
-
-	    if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	    fi[0] += delx*fpair;
-	    fi[1] += dely*fpair;
-	    fi[2] += delz*fpair;
-	    ti[0] += fpair*(dyi*delz - dzi*dely);
-	    ti[1] += fpair*(dzi*delx - dxi*delz);
-	    ti[2] += fpair*(dxi*dely - dyi*delx);
-
-	    if (NEWTON_PAIR || j < nlocal) {
-	      fj[0] -= delx*fpair;
-	      fj[1] -= dely*fpair;
-	      fj[2] -= delz*fpair;
-	      tj[0] -= fpair*(dyj*delz - dzj*dely);
-	      tj[1] -= fpair*(dzj*delx - dxj*delz);
-	      tj[2] -= fpair*(dxj*dely - dyj*delx);
-	    }
-	  }
-	}
-
-	f[i][0] += fi[0];
-	f[i][1] += fi[1];
-	f[i][2] += fi[2];
-	f[j][0] += fj[0];
-	f[j][1] += fj[1];
-	f[j][2] += fj[2];
-	torque[i][0] += ti[0];
-	torque[i][1] += ti[1];
-	torque[i][2] += ti[2];
-	torque[j][0] += tj[0];
-	torque[j][1] += tj[1];
-	torque[j][2] += tj[2];
-
-	// tri/particle interaction = Nx1 particles
-	// c1,c2,c3 = corner pts of triangle I
+        npi = dnum[i];
+        ifirst = dfirst[i];
+        npj = dnum[j];
+        jfirst = dfirst[j];
+
+        fi[0]=fi[1]=fi[2]=fj[0]=fj[1]=fj[2]=0.0;
+        ti[0]=ti[1]=ti[2]=tj[0]=tj[1]=tj[2]=0.0;
+
+        for (ni = 0; ni < npi; ni++) {
+          dxi = discrete[ifirst+ni].dx;
+          dyi = discrete[ifirst+ni].dy;
+          dzi = discrete[ifirst+ni].dz;
+
+          for (nj = 0; nj < npj; nj++) {
+            dxj = discrete[jfirst+nj].dx;
+            dyj = discrete[jfirst+nj].dy;
+            dzj = discrete[jfirst+nj].dz;
+
+            xi[0] = x[i][0] + dxi;
+            xi[1] = x[i][1] + dyi;
+            xi[2] = x[i][2] + dzi;
+            xj[0] = x[j][0] + dxj;
+            xj[1] = x[j][1] + dyj;
+            xj[2] = x[j][2] + dzj;
+
+            delx = xi[0] - xj[0];
+            dely = xi[1] - xj[1];
+            delz = xi[2] - xj[2];
+            rsq = delx*delx + dely*dely + delz*delz;
+
+            sig = 0.5 * (discrete[ifirst+ni].sigma+discrete[jfirst+nj].sigma);
+            sig3 = sig*sig*sig;
+            term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+            term1 = 2.0 * term2 * sig3*sig3;
+            r2inv = 1.0/rsq;
+            r6inv = r2inv*r2inv*r2inv;
+            forcelj = r6inv * (term1*r6inv - term2);
+            fpair = forcelj*r2inv;
+
+            if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+            fi[0] += delx*fpair;
+            fi[1] += dely*fpair;
+            fi[2] += delz*fpair;
+            ti[0] += fpair*(dyi*delz - dzi*dely);
+            ti[1] += fpair*(dzi*delx - dxi*delz);
+            ti[2] += fpair*(dxi*dely - dyi*delx);
+
+            if (NEWTON_PAIR || j < nlocal) {
+              fj[0] -= delx*fpair;
+              fj[1] -= dely*fpair;
+              fj[2] -= delz*fpair;
+              tj[0] -= fpair*(dyj*delz - dzj*dely);
+              tj[1] -= fpair*(dzj*delx - dxj*delz);
+              tj[2] -= fpair*(dxj*dely - dyj*delx);
+            }
+          }
+        }
+
+        f[i][0] += fi[0];
+        f[i][1] += fi[1];
+        f[i][2] += fi[2];
+        f[j][0] += fj[0];
+        f[j][1] += fj[1];
+        f[j][2] += fj[2];
+        torque[i][0] += ti[0];
+        torque[i][1] += ti[1];
+        torque[i][2] += ti[2];
+        torque[j][0] += tj[0];
+        torque[j][1] += tj[1];
+        torque[j][2] += tj[2];
+
+        // tri/particle interaction = Nx1 particles
+        // c1,c2,c3 = corner pts of triangle I
 
       } else if (tri[i] >= 0) {
-	npi = dnum[i];
-	ifirst = dfirst[i];
-
-	fi[0]=fi[1]=fi[2]=fj[0]=fj[1]=fj[2]=0.0;
-	ti[0]=ti[1]=ti[2]=tj[0]=tj[1]=tj[2]=0.0;
-
-	for (ni = 0; ni < npi; ni++) {
-	  dxi = discrete[ifirst+ni].dx;
-	  dyi = discrete[ifirst+ni].dy;
-	  dzi = discrete[ifirst+ni].dz;
-
-	  xi[0] = x[i][0] + dxi;
-	  xi[1] = x[i][1] + dyi;
-	  xi[2] = x[i][2] + dzi;
-	  xj[0] = x[j][0];
-	  xj[1] = x[j][1];
-	  xj[2] = x[j][2];
-
-	  delx = xi[0] - xj[0];
-	  dely = xi[1] - xj[1];
-	  delz = xi[2] - xj[2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-
-	  sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
-	  sig3 = sig*sig*sig;
-	  term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	  term1 = 2.0 * term2 * sig3*sig3;
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (term1*r6inv - term2);
-	  fpair = forcelj*r2inv;
-
-	  if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	  fi[0] += delx*fpair;
-	  fi[1] += dely*fpair;
-	  fi[2] += delz*fpair;
-	  ti[0] += fpair*(dyi*delz - dzi*dely);
-	  ti[1] += fpair*(dzi*delx - dxi*delz);
-	  ti[2] += fpair*(dxi*dely - dyi*delx);
-
-	  if (NEWTON_PAIR || j < nlocal) {
-	    fj[0] -= delx*fpair;
-	    fj[1] -= dely*fpair;
-	    fj[2] -= delz*fpair;
-	    tj[0] -= fpair*(dyj*delz - dzj*dely);
-	    tj[1] -= fpair*(dzj*delx - dxj*delz);
-	    tj[2] -= fpair*(dxj*dely - dyj*delx);
-	  }
-	}
-
-	f[i][0] += fi[0];
-	f[i][1] += fi[1];
-	f[i][2] += fi[2];
-	f[j][0] += fj[0];
-	f[j][1] += fj[1];
-	f[j][2] += fj[2];
-	torque[i][0] += ti[0];
-	torque[i][1] += ti[1];
-	torque[i][2] += ti[2];
-	torque[j][0] += tj[0];
-	torque[j][1] += tj[1];
-	torque[j][2] += tj[2];
-
-	// particle/tri interaction = Nx1 particles
-	// c1,c2,c3 = corner pts of triangle J
+        npi = dnum[i];
+        ifirst = dfirst[i];
+
+        fi[0]=fi[1]=fi[2]=fj[0]=fj[1]=fj[2]=0.0;
+        ti[0]=ti[1]=ti[2]=tj[0]=tj[1]=tj[2]=0.0;
+
+        for (ni = 0; ni < npi; ni++) {
+          dxi = discrete[ifirst+ni].dx;
+          dyi = discrete[ifirst+ni].dy;
+          dzi = discrete[ifirst+ni].dz;
+
+          xi[0] = x[i][0] + dxi;
+          xi[1] = x[i][1] + dyi;
+          xi[2] = x[i][2] + dzi;
+          xj[0] = x[j][0];
+          xj[1] = x[j][1];
+          xj[2] = x[j][2];
+
+          delx = xi[0] - xj[0];
+          dely = xi[1] - xj[1];
+          delz = xi[2] - xj[2];
+          rsq = delx*delx + dely*dely + delz*delz;
+
+          sig = 0.5 * (discrete[ifirst+ni].sigma+sigma[jtype][jtype]);
+          sig3 = sig*sig*sig;
+          term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+          term1 = 2.0 * term2 * sig3*sig3;
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (term1*r6inv - term2);
+          fpair = forcelj*r2inv;
+
+          if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+          fi[0] += delx*fpair;
+          fi[1] += dely*fpair;
+          fi[2] += delz*fpair;
+          ti[0] += fpair*(dyi*delz - dzi*dely);
+          ti[1] += fpair*(dzi*delx - dxi*delz);
+          ti[2] += fpair*(dxi*dely - dyi*delx);
+
+          if (NEWTON_PAIR || j < nlocal) {
+            fj[0] -= delx*fpair;
+            fj[1] -= dely*fpair;
+            fj[2] -= delz*fpair;
+            tj[0] -= fpair*(dyj*delz - dzj*dely);
+            tj[1] -= fpair*(dzj*delx - dxj*delz);
+            tj[2] -= fpair*(dxj*dely - dyj*delx);
+          }
+        }
+
+        f[i][0] += fi[0];
+        f[i][1] += fi[1];
+        f[i][2] += fi[2];
+        f[j][0] += fj[0];
+        f[j][1] += fj[1];
+        f[j][2] += fj[2];
+        torque[i][0] += ti[0];
+        torque[i][1] += ti[1];
+        torque[i][2] += ti[2];
+        torque[j][0] += tj[0];
+        torque[j][1] += tj[1];
+        torque[j][2] += tj[2];
+
+        // particle/tri interaction = Nx1 particles
+        // c1,c2,c3 = corner pts of triangle J
 
       } else if (tri[j] >= 0) {
-	npj = dnum[j];
-	jfirst = dfirst[j];
-
-	fi[0]=fi[1]=fi[2]=fj[0]=fj[1]=fj[2]=0.0;
-	ti[0]=ti[1]=ti[2]=tj[0]=tj[1]=tj[2]=0.0;
-
-	for (nj = 0; nj < npj; nj++) {
-	  dxj = discrete[jfirst+nj].dx;
-	  dyj = discrete[jfirst+nj].dy;
-	  dzj = discrete[jfirst+nj].dz;
-
-	  xi[0] = x[i][0];
-	  xi[1] = x[i][1];
-	  xi[2] = x[i][2];
-	  xj[0] = x[j][0] + dxj;
-	  xj[1] = x[j][1] + dyj;
-	  xj[2] = x[j][2] + dzj;
-
-	  delx = xi[0] - xj[0];
-	  dely = xi[1] - xj[1];
-	  delz = xi[2] - xj[2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-
-	  sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
-	  sig3 = sig*sig*sig;
-	  term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
-	  term1 = 2.0 * term2 * sig3*sig3;
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (term1*r6inv - term2);
-	  fpair = forcelj*r2inv;
-	  
-	  if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	  if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
-
-	  fi[0] += delx*fpair;
-	  fi[1] += dely*fpair;
-	  fi[2] += delz*fpair;
-	  ti[0] += fpair*(dyi*delz - dzi*dely);
-	  ti[1] += fpair*(dzi*delx - dxi*delz);
-	  ti[2] += fpair*(dxi*dely - dyi*delx);
-
-	  if (NEWTON_PAIR || j < nlocal) {
-	    fj[0] -= delx*fpair;
-	    fj[1] -= dely*fpair;
-	    fj[2] -= delz*fpair;
-	    tj[0] -= fpair*(dyj*delz - dzj*dely);
-	    tj[1] -= fpair*(dzj*delx - dxj*delz);
-	    tj[2] -= fpair*(dxj*dely - dyj*delx);
-	  }
-	}
-
-	f[i][0] += fi[0];
-	f[i][1] += fi[1];
-	f[i][2] += fi[2];
-	f[j][0] += fj[0];
-	f[j][1] += fj[1];
-	f[j][2] += fj[2];
-	torque[i][0] += ti[0];
-	torque[i][1] += ti[1];
-	torque[i][2] += ti[2];
-	torque[j][0] += tj[0];
-	torque[j][1] += tj[1];
-	torque[j][2] += tj[2];
-
-	// particle/particle interaction = 1x1 particles
+        npj = dnum[j];
+        jfirst = dfirst[j];
+
+        fi[0]=fi[1]=fi[2]=fj[0]=fj[1]=fj[2]=0.0;
+        ti[0]=ti[1]=ti[2]=tj[0]=tj[1]=tj[2]=0.0;
+
+        for (nj = 0; nj < npj; nj++) {
+          dxj = discrete[jfirst+nj].dx;
+          dyj = discrete[jfirst+nj].dy;
+          dzj = discrete[jfirst+nj].dz;
+
+          xi[0] = x[i][0];
+          xi[1] = x[i][1];
+          xi[2] = x[i][2];
+          xj[0] = x[j][0] + dxj;
+          xj[1] = x[j][1] + dyj;
+          xj[2] = x[j][2] + dzj;
+
+          delx = xi[0] - xj[0];
+          dely = xi[1] - xj[1];
+          delz = xi[2] - xj[2];
+          rsq = delx*delx + dely*dely + delz*delz;
+
+          sig = 0.5 * (sigma[itype][itype]+discrete[jfirst+nj].sigma);
+          sig3 = sig*sig*sig;
+          term2 = 24.0*epsilon[itype][jtype] * sig3*sig3;
+          term1 = 2.0 * term2 * sig3*sig3;
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (term1*r6inv - term2);
+          fpair = forcelj*r2inv;
+
+          if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+          if (EFLAG) evdwl += r6inv*(term1/12.0*r6inv-term2/6.0);
+
+          fi[0] += delx*fpair;
+          fi[1] += dely*fpair;
+          fi[2] += delz*fpair;
+          ti[0] += fpair*(dyi*delz - dzi*dely);
+          ti[1] += fpair*(dzi*delx - dxi*delz);
+          ti[2] += fpair*(dxi*dely - dyi*delx);
+
+          if (NEWTON_PAIR || j < nlocal) {
+            fj[0] -= delx*fpair;
+            fj[1] -= dely*fpair;
+            fj[2] -= delz*fpair;
+            tj[0] -= fpair*(dyj*delz - dzj*dely);
+            tj[1] -= fpair*(dzj*delx - dxj*delz);
+            tj[2] -= fpair*(dxj*dely - dyj*delx);
+          }
+        }
+
+        f[i][0] += fi[0];
+        f[i][1] += fi[1];
+        f[i][2] += fi[2];
+        f[j][0] += fj[0];
+        f[j][1] += fj[1];
+        f[j][2] += fj[2];
+        torque[i][0] += ti[0];
+        torque[i][1] += ti[1];
+        torque[i][2] += ti[2];
+        torque[j][0] += tj[0];
+        torque[j][1] += tj[1];
+        torque[j][2] += tj[2];
+
+        // particle/particle interaction = 1x1 particles
 
       } else {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = forcelj*r2inv;
-
-	if (EFLAG)
-	  evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = forcelj*r2inv;
+
+        if (EFLAG)
+          evdwl += r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
       }
 
       if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-			       evdwl,0.0,fpair,delx,dely,delz,thr);
+                               evdwl,0.0,fpair,delx,dely,delz,thr);
     }
   }
 }
diff --git a/src/USER-OMP/pair_tri_lj_omp.h b/src/USER-OMP/pair_tri_lj_omp.h
index d21c562a80..7c66fdcf44 100644
--- a/src/USER-OMP/pair_tri_lj_omp.h
+++ b/src/USER-OMP/pair_tri_lj_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_yukawa_colloid_omp.cpp b/src/USER-OMP/pair_yukawa_colloid_omp.cpp
index 101f69f1dc..e66d1bb2bf 100644
--- a/src/USER-OMP/pair_yukawa_colloid_omp.cpp
+++ b/src/USER-OMP/pair_yukawa_colloid_omp.cpp
@@ -56,11 +56,11 @@ void PairYukawaColloidOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -120,28 +120,28 @@ void PairYukawaColloidOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	screening = exp(-kappa*(r-(radi+radj)));
-	forceyukawa = a[itype][jtype] * screening;
-
-	fpair = factor*forceyukawa * rinv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = a[itype][jtype]/kappa * screening - offset[itype][jtype];
-	  evdwl *= factor;
-	}
-	if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        screening = exp(-kappa*(r-(radi+radj)));
+        forceyukawa = a[itype][jtype] * screening;
+
+        fpair = factor*forceyukawa * rinv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = a[itype][jtype]/kappa * screening - offset[itype][jtype];
+          evdwl *= factor;
+        }
+        if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_yukawa_colloid_omp.h b/src/USER-OMP/pair_yukawa_colloid_omp.h
index c424e9eff3..b0ef483b5b 100644
--- a/src/USER-OMP/pair_yukawa_colloid_omp.h
+++ b/src/USER-OMP/pair_yukawa_colloid_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pair_yukawa_omp.cpp b/src/USER-OMP/pair_yukawa_omp.cpp
index c7fa20e814..3028901a9e 100644
--- a/src/USER-OMP/pair_yukawa_omp.cpp
+++ b/src/USER-OMP/pair_yukawa_omp.cpp
@@ -56,11 +56,11 @@ void PairYukawaOMP::compute(int eflag, int vflag)
 
     if (evflag) {
       if (eflag) {
-	if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
-	else eval<1,1,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
+        else eval<1,1,0>(ifrom, ito, thr);
       } else {
-	if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
-	else eval<1,0,0>(ifrom, ito, thr);
+        if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
+        else eval<1,0,0>(ifrom, ito, thr);
       }
     } else {
       if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
@@ -117,30 +117,30 @@ void PairYukawaOMP::eval(int iifrom, int iito, ThrData * const thr)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	screening = exp(-kappa*r);
-	forceyukawa = a[itype][jtype] * screening * (kappa + rinv);
-
-	fpair = factor*forceyukawa * r2inv;
-
-	fxtmp += delx*fpair;
-	fytmp += dely*fpair;
-	fztmp += delz*fpair;
-	if (NEWTON_PAIR || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (EFLAG) {
-	  evdwl = a[itype][jtype] * screening * rinv - offset[itype][jtype];
-	  evdwl *= factor;
-	}
-
-	if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
-				 evdwl,0.0,fpair,delx,dely,delz,thr);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        screening = exp(-kappa*r);
+        forceyukawa = a[itype][jtype] * screening * (kappa + rinv);
+
+        fpair = factor*forceyukawa * r2inv;
+
+        fxtmp += delx*fpair;
+        fytmp += dely*fpair;
+        fztmp += delz*fpair;
+        if (NEWTON_PAIR || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (EFLAG) {
+          evdwl = a[itype][jtype] * screening * rinv - offset[itype][jtype];
+          evdwl *= factor;
+        }
+
+        if (EVFLAG) ev_tally_thr(this,i,j,nlocal,NEWTON_PAIR,
+                                 evdwl,0.0,fpair,delx,dely,delz,thr);
       }
     }
     f[i][0] += fxtmp;
diff --git a/src/USER-OMP/pair_yukawa_omp.h b/src/USER-OMP/pair_yukawa_omp.h
index 99abc569fa..d9db213474 100644
--- a/src/USER-OMP/pair_yukawa_omp.h
+++ b/src/USER-OMP/pair_yukawa_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pppm_cg_omp.cpp b/src/USER-OMP/pppm_cg_omp.cpp
index 47708f9829..51fc048b3b 100644
--- a/src/USER-OMP/pppm_cg_omp.cpp
+++ b/src/USER-OMP/pppm_cg_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -48,7 +48,7 @@ PPPMCGOMP::PPPMCGOMP(LAMMPS *lmp, int narg, char **arg) :
 }
 
 /* ----------------------------------------------------------------------
-   allocate memory that depends on # of K-vectors and order 
+   allocate memory that depends on # of K-vectors and order
 ------------------------------------------------------------------------- */
 
 void PPPMCGOMP::allocate()
@@ -78,7 +78,7 @@ void PPPMCGOMP::allocate()
   // reallocate density brick, so it fits our needs
   memory->destroy3d_offset(density_brick,nzlo_out,nylo_out,nxlo_out);
   memory->create3d_offset(density_brick,nzlo_out,nzend,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:density_brick");
+                          nxlo_out,nxhi_out,"pppm:density_brick");
 }
 
 // NOTE: special version of reduce_data for FFT_SCALAR data type.
@@ -102,12 +102,12 @@ static void data_reduce_fft(FFT_SCALAR *dall, int nall, int nthreads, int ndim,
     const int ito   = ((ifrom + idelta) > nvals) ? nvals : (ifrom + idelta);
 
     // this if protects against having more threads than atoms
-    if (ifrom < nall) { 
+    if (ifrom < nall) {
       for (int m = ifrom; m < ito; ++m) {
-	for (int n = 1; n < nthreads; ++n) {
-	  dall[m] += dall[n*nvals + m];
-	  dall[n*nvals + m] = 0.0;
-	}
+        for (int n = 1; n < nthreads; ++n) {
+          dall[m] += dall[n*nvals + m];
+          dall[n*nvals + m] = 0.0;
+        }
       }
     }
   }
@@ -118,7 +118,7 @@ static void data_reduce_fft(FFT_SCALAR *dall, int nall, int nthreads, int ndim,
 }
 
 /* ----------------------------------------------------------------------
-   free memory that depends on # of K-vectors and order 
+   free memory that depends on # of K-vectors and order
 ------------------------------------------------------------------------- */
 
 void PPPMCGOMP::deallocate()
@@ -132,7 +132,7 @@ void PPPMCGOMP::deallocate()
 }
 
 /* ----------------------------------------------------------------------
-   adjust PPPMCG coeffs, called initially and whenever volume has changed 
+   adjust PPPMCG coeffs, called initially and whenever volume has changed
 ------------------------------------------------------------------------- */
 
 void PPPMCGOMP::setup()
@@ -152,7 +152,7 @@ void PPPMCGOMP::setup()
   const double zprd = prd[2];
   const double zprd_slab = zprd*slab_volfactor;
   volume = xprd * yprd * zprd_slab;
-    
+
   delxinv = nx_pppm/xprd;
   delyinv = ny_pppm/yprd;
   delzinv = nz_pppm/zprd_slab;
@@ -190,36 +190,36 @@ void PPPMCGOMP::setup()
   for (k = nzlo_fft; k <= nzhi_fft; k++) {
     for (j = nylo_fft; j <= nyhi_fft; j++) {
       for (i = nxlo_fft; i <= nxhi_fft; i++) {
-	sqk = fkx[i]*fkx[i] + fky[j]*fky[j] + fkz[k]*fkz[k];
-	if (sqk == 0.0) {
-	  vg[n][0] = 0.0;
-	  vg[n][1] = 0.0;
-	  vg[n][2] = 0.0;
-	  vg[n][3] = 0.0;
-	  vg[n][4] = 0.0;
-	  vg[n][5] = 0.0;
-	} else {
-	  vterm = -2.0 * (1.0/sqk + 0.25/(g_ewald*g_ewald));
-	  vg[n][0] = 1.0 + vterm*fkx[i]*fkx[i];
-	  vg[n][1] = 1.0 + vterm*fky[j]*fky[j];
-	  vg[n][2] = 1.0 + vterm*fkz[k]*fkz[k];
-	  vg[n][3] = vterm*fkx[i]*fky[j];
-	  vg[n][4] = vterm*fkx[i]*fkz[k];
-	  vg[n][5] = vterm*fky[j]*fkz[k];
-	}
-	n++;
+        sqk = fkx[i]*fkx[i] + fky[j]*fky[j] + fkz[k]*fkz[k];
+        if (sqk == 0.0) {
+          vg[n][0] = 0.0;
+          vg[n][1] = 0.0;
+          vg[n][2] = 0.0;
+          vg[n][3] = 0.0;
+          vg[n][4] = 0.0;
+          vg[n][5] = 0.0;
+        } else {
+          vterm = -2.0 * (1.0/sqk + 0.25/(g_ewald*g_ewald));
+          vg[n][0] = 1.0 + vterm*fkx[i]*fkx[i];
+          vg[n][1] = 1.0 + vterm*fky[j]*fky[j];
+          vg[n][2] = 1.0 + vterm*fkz[k]*fkz[k];
+          vg[n][3] = vterm*fkx[i]*fky[j];
+          vg[n][4] = vterm*fkx[i]*fkz[k];
+          vg[n][5] = vterm*fky[j]*fkz[k];
+        }
+        n++;
       }
     }
   }
 
   // modified (Hockney-Eastwood) Coulomb Green's function
 
-  const int nbx = static_cast<int> ((g_ewald*xprd/(MY_PI*nx_pppm)) * 
-				    pow(-log(EPS_HOC),0.25));
-  const int nby = static_cast<int> ((g_ewald*yprd/(MY_PI*ny_pppm)) * 
-				    pow(-log(EPS_HOC),0.25));
-  const int nbz = static_cast<int> ((g_ewald*zprd_slab/(MY_PI*nz_pppm)) * 
-				    pow(-log(EPS_HOC),0.25));
+  const int nbx = static_cast<int> ((g_ewald*xprd/(MY_PI*nx_pppm)) *
+                                    pow(-log(EPS_HOC),0.25));
+  const int nby = static_cast<int> ((g_ewald*yprd/(MY_PI*ny_pppm)) *
+                                    pow(-log(EPS_HOC),0.25));
+  const int nbz = static_cast<int> ((g_ewald*zprd_slab/(MY_PI*nz_pppm)) *
+                                    pow(-log(EPS_HOC),0.25));
 
   const double form = 1.0;
 
@@ -233,80 +233,80 @@ void PPPMCGOMP::setup()
     double sum1,dot1,dot2;
     double numerator,denominator;
     const double gew2 = -4.0*g_ewald*g_ewald;
-    
+
     const int nnx = nxhi_fft-nxlo_fft+1;
     const int nny = nyhi_fft-nylo_fft+1;
-    
+
     loop_setup_thr(nnfrom, nnto, tid, nfft, comm->nthreads);
-    
+
     for (m = nzlo_fft; m <= nzhi_fft; m++) {
-      
+
       const double fkzm = fkz[m];
       snz = sin(0.5*fkzm*zprd_slab/nz_pppm);
       snz *= snz;
 
       for (l = nylo_fft; l <= nyhi_fft; l++) {
-	const double fkyl = fky[l];
-	sny = sin(0.5*fkyl*yprd/ny_pppm);
-	sny *= sny;
+        const double fkyl = fky[l];
+        sny = sin(0.5*fkyl*yprd/ny_pppm);
+        sny *= sny;
+
+        for (k = nxlo_fft; k <= nxhi_fft; k++) {
 
-	for (k = nxlo_fft; k <= nxhi_fft; k++) {
+          /* only compute the part designated to this thread */
+          nn = k-nxlo_fft + nnx*(l-nylo_fft + nny*(m-nzlo_fft));
+          if ((nn < nnfrom) || (nn >=nnto)) continue;
 
-	  /* only compute the part designated to this thread */
-	  nn = k-nxlo_fft + nnx*(l-nylo_fft + nny*(m-nzlo_fft));
-	  if ((nn < nnfrom) || (nn >=nnto)) continue;
+          const double fkxk = fkx[k];
+          snx = sin(0.5*fkxk*xprd/nx_pppm);
+          snx *= snx;
 
-	  const double fkxk = fkx[k];
-	  snx = sin(0.5*fkxk*xprd/nx_pppm);
-	  snx *= snx;
-      
-	  sqk = fkxk*fkxk + fkyl*fkyl + fkzm*fkzm;
+          sqk = fkxk*fkxk + fkyl*fkyl + fkzm*fkzm;
 
-	  if (sqk != 0.0) {
-	    numerator = form*MY_4PI/sqk;
-	    denominator = gf_denom(snx,sny,snz);
+          if (sqk != 0.0) {
+            numerator = form*MY_4PI/sqk;
+            denominator = gf_denom(snx,sny,snz);
             const double dorder = static_cast<double>(order);
-	    sum1 = 0.0;
-	    for (nx = -nbx; nx <= nbx; nx++) {
-	      qx = fkxk + unitkx*nx_pppm*nx;
-	      sx = exp(qx*qx/gew2);
-	      wx = 1.0;
-	      argx = 0.5*qx*xprd/nx_pppm;
-	      if (argx != 0.0) wx = pow(sin(argx)/argx,dorder);
-	      wx *=wx;
-
-	      for (ny = -nby; ny <= nby; ny++) {
-		qy = fkyl + unitky*ny_pppm*ny;
-		sy = exp(qy*qy/gew2);
-		wy = 1.0;
-		argy = 0.5*qy*yprd/ny_pppm;
-		if (argy != 0.0) wy = pow(sin(argy)/argy,dorder);
-		wy *= wy;
-
-		for (nz = -nbz; nz <= nbz; nz++) {
-		  qz = fkzm + unitkz*nz_pppm*nz;
-		  sz = exp(qz*qz/gew2);
-		  wz = 1.0;
-		  argz = 0.5*qz*zprd_slab/nz_pppm;
-		  if (argz != 0.0) wz = pow(sin(argz)/argz,dorder);
-		  wz *= wz;
-
-		  dot1 = fkxk*qx + fkyl*qy + fkzm*qz;
-		  dot2 = qx*qx+qy*qy+qz*qz;
-		  sum1 += (dot1/dot2) * sx*sy*sz * wx*wy*wz;
-		}
-	      }
-	    }
-	    greensfn[nn] = numerator*sum1/denominator;
-	  } else greensfn[nn] = 0.0;
-	}
+            sum1 = 0.0;
+            for (nx = -nbx; nx <= nbx; nx++) {
+              qx = fkxk + unitkx*nx_pppm*nx;
+              sx = exp(qx*qx/gew2);
+              wx = 1.0;
+              argx = 0.5*qx*xprd/nx_pppm;
+              if (argx != 0.0) wx = pow(sin(argx)/argx,dorder);
+              wx *=wx;
+
+              for (ny = -nby; ny <= nby; ny++) {
+                qy = fkyl + unitky*ny_pppm*ny;
+                sy = exp(qy*qy/gew2);
+                wy = 1.0;
+                argy = 0.5*qy*yprd/ny_pppm;
+                if (argy != 0.0) wy = pow(sin(argy)/argy,dorder);
+                wy *= wy;
+
+                for (nz = -nbz; nz <= nbz; nz++) {
+                  qz = fkzm + unitkz*nz_pppm*nz;
+                  sz = exp(qz*qz/gew2);
+                  wz = 1.0;
+                  argz = 0.5*qz*zprd_slab/nz_pppm;
+                  if (argz != 0.0) wz = pow(sin(argz)/argz,dorder);
+                  wz *= wz;
+
+                  dot1 = fkxk*qx + fkyl*qy + fkzm*qz;
+                  dot2 = qx*qx+qy*qy+qz*qz;
+                  sum1 += (dot1/dot2) * sx*sy*sz * wx*wy*wz;
+                }
+              }
+            }
+            greensfn[nn] = numerator*sum1/denominator;
+          } else greensfn[nn] = 0.0;
+        }
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   run the regular toplevel compute method from plain PPPPMCG 
+   run the regular toplevel compute method from plain PPPPMCG
    which will have individual methods replaced by our threaded
    versions and then call the obligatory force reduction.
 ------------------------------------------------------------------------- */
@@ -334,7 +334,7 @@ void PPPMCGOMP::compute(int eflag, int vflag)
    create discretized "density" on section of global grid due to my particles
    density(x,y,z) = charge "density" at grid points of my 3d brick
    (nxlo:nxhi,nylo:nyhi,nzlo:nzhi) is extent of my brick (including ghosts)
-   in global grid 
+   in global grid
 ------------------------------------------------------------------------- */
 
 void PPPMCGOMP::make_rho()
@@ -346,7 +346,7 @@ void PPPMCGOMP::make_rho()
 #if defined(_OPENMP)
 #pragma omp parallel default(none)
 #endif
-  {  
+  {
 #if defined(_OPENMP)
     // each thread works on a fixed chunk of atoms.
     const int tid = omp_get_thread_num();
@@ -379,30 +379,30 @@ void PPPMCGOMP::make_rho()
     // this if protects against having more threads than charged local atoms
     if (ifrom < num_charged) {
       for (j = ifrom; j < ito; j++) {
-	i = is_charged[j];
-
-	nx = part2grid[i][0];
-	ny = part2grid[i][1];
-	nz = part2grid[i][2];
-	dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
-	dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
-	dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
-
-	compute_rho1d_thr(r1d,dx,dy,dz);
-
-	z0 = delvolinv * q[i];
-	for (n = nlower; n <= nupper; n++) {
-	  mz = n+nz;
-	  y0 = z0*r1d[2][n];
-	  for (m = nlower; m <= nupper; m++) {
-	    my = m+ny;
-	    x0 = y0*r1d[1][m];
-	    for (l = nlower; l <= nupper; l++) {
-	      mx = l+nx;
-	      db[mz][my][mx] += x0*r1d[0][l];
-	    }
-	  }
-	}
+        i = is_charged[j];
+
+        nx = part2grid[i][0];
+        ny = part2grid[i][1];
+        nz = part2grid[i][2];
+        dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
+        dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
+        dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
+
+        compute_rho1d_thr(r1d,dx,dy,dz);
+
+        z0 = delvolinv * q[i];
+        for (n = nlower; n <= nupper; n++) {
+          mz = n+nz;
+          y0 = z0*r1d[2][n];
+          for (m = nlower; m <= nupper; m++) {
+            my = m+ny;
+            x0 = y0*r1d[1][m];
+            for (l = nlower; l <= nupper; l++) {
+              mx = l+nx;
+              db[mz][my][mx] += x0*r1d[0][l];
+            }
+          }
+        }
       }
     }
 #if defined(_OPENMP)
@@ -415,7 +415,7 @@ void PPPMCGOMP::make_rho()
 }
 
 /* ----------------------------------------------------------------------
-   interpolate from grid to get electric field & force on my particles 
+   interpolate from grid to get electric field & force on my particles
 ------------------------------------------------------------------------- */
 
 void PPPMCGOMP::fieldforce()
@@ -434,7 +434,7 @@ void PPPMCGOMP::fieldforce()
 #if defined(_OPENMP)
 #pragma omp parallel default(none)
 #endif
-  {  
+  {
 #if defined(_OPENMP)
     // each thread works on a fixed chunk of atoms.
     const int tid = omp_get_thread_num();
@@ -450,47 +450,47 @@ void PPPMCGOMP::fieldforce()
     ThrData *thr = fix->get_thr(tid);
     double * const * const f = thr->get_f();
     FFT_SCALAR * const * const r1d =  static_cast<FFT_SCALAR **>(thr->get_rho1d());
-    
+
     int i,j,l,m,n,nx,ny,nz,mx,my,mz;
     FFT_SCALAR dx,dy,dz,x0,y0,z0;
     FFT_SCALAR ekx,eky,ekz;
 
     // this if protects against having more threads than charged local atoms
-    if (ifrom < num_charged) { 
+    if (ifrom < num_charged) {
       for (j = ifrom; j < ito; j++) {
-	i = is_charged[j];
-
-	nx = part2grid[i][0];
-	ny = part2grid[i][1];
-	nz = part2grid[i][2];
-	dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
-	dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
-	dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
-
-	compute_rho1d_thr(r1d,dx,dy,dz);
-
-	ekx = eky = ekz = ZEROF;
-	for (n = nlower; n <= nupper; n++) {
-	  mz = n+nz;
-	  z0 = r1d[2][n];
-	  for (m = nlower; m <= nupper; m++) {
-	    my = m+ny;
-	    y0 = z0*r1d[1][m];
-	    for (l = nlower; l <= nupper; l++) {
-	      mx = l+nx;
-	      x0 = y0*r1d[0][l];
-	      ekx -= x0*vdx_brick[mz][my][mx];
-	      eky -= x0*vdy_brick[mz][my][mx];
-	      ekz -= x0*vdz_brick[mz][my][mx];
-	    }
-	  }
-	}
-
-	// convert E-field to force
-	const double qfactor = qqrd2e*scale*q[i];
-	f[i][0] += qfactor*ekx;
-	f[i][1] += qfactor*eky;
-	f[i][2] += qfactor*ekz;
+        i = is_charged[j];
+
+        nx = part2grid[i][0];
+        ny = part2grid[i][1];
+        nz = part2grid[i][2];
+        dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
+        dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
+        dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
+
+        compute_rho1d_thr(r1d,dx,dy,dz);
+
+        ekx = eky = ekz = ZEROF;
+        for (n = nlower; n <= nupper; n++) {
+          mz = n+nz;
+          z0 = r1d[2][n];
+          for (m = nlower; m <= nupper; m++) {
+            my = m+ny;
+            y0 = z0*r1d[1][m];
+            for (l = nlower; l <= nupper; l++) {
+              mx = l+nx;
+              x0 = y0*r1d[0][l];
+              ekx -= x0*vdx_brick[mz][my][mx];
+              eky -= x0*vdy_brick[mz][my][mx];
+              ekz -= x0*vdz_brick[mz][my][mx];
+            }
+          }
+        }
+
+        // convert E-field to force
+        const double qfactor = qqrd2e*scale*q[i];
+        f[i][0] += qfactor*ekx;
+        f[i][1] += qfactor*eky;
+        f[i][2] += qfactor*ekz;
       }
     }
   }
@@ -537,49 +537,49 @@ void PPPMCGOMP::fieldforce_peratom()
     // this if protects against having more threads than charged local atoms
     if (ifrom < num_charged) {
       for (j = ifrom; j < ito; j++) {
-	i = is_charged[j];
-
-	nx = part2grid[i][0];
-	ny = part2grid[i][1];
-	nz = part2grid[i][2];
-	dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
-	dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
-	dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
-
-	compute_rho1d_thr(r1d,dx,dy,dz);
-
-	u = v0 = v1 = v2 = v3 = v4 = v5 = ZEROF;
-	for (n = nlower; n <= nupper; n++) {
-	  mz = n+nz;
-	  z0 = r1d[2][n];
-	  for (m = nlower; m <= nupper; m++) {
-	    my = m+ny;
-	    y0 = z0*r1d[1][m];
-	    for (l = nlower; l <= nupper; l++) {
-	      mx = l+nx;
-	      x0 = y0*r1d[0][l];
-	      if (eflag_atom) u += x0*u_brick[mz][my][mx];
-	      if (vflag_atom) {
-		v0 += x0*v0_brick[mz][my][mx];
-		v1 += x0*v1_brick[mz][my][mx];
-		v2 += x0*v2_brick[mz][my][mx];
-		v3 += x0*v3_brick[mz][my][mx];
-		v4 += x0*v4_brick[mz][my][mx];
-		v5 += x0*v5_brick[mz][my][mx];
-	      }
-	    }
-	  }
-	}
-
-	if (eflag_atom) eatom[i] += q[i]*u;
-	if (vflag_atom) {
-	  vatom[i][0] += v0;
-	  vatom[i][1] += v1;
-	  vatom[i][2] += v2;
-	  vatom[i][3] += v3;
-	  vatom[i][4] += v4;
-	  vatom[i][5] += v5;
-	}
+        i = is_charged[j];
+
+        nx = part2grid[i][0];
+        ny = part2grid[i][1];
+        nz = part2grid[i][2];
+        dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
+        dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
+        dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
+
+        compute_rho1d_thr(r1d,dx,dy,dz);
+
+        u = v0 = v1 = v2 = v3 = v4 = v5 = ZEROF;
+        for (n = nlower; n <= nupper; n++) {
+          mz = n+nz;
+          z0 = r1d[2][n];
+          for (m = nlower; m <= nupper; m++) {
+            my = m+ny;
+            y0 = z0*r1d[1][m];
+            for (l = nlower; l <= nupper; l++) {
+              mx = l+nx;
+              x0 = y0*r1d[0][l];
+              if (eflag_atom) u += x0*u_brick[mz][my][mx];
+              if (vflag_atom) {
+                v0 += x0*v0_brick[mz][my][mx];
+                v1 += x0*v1_brick[mz][my][mx];
+                v2 += x0*v2_brick[mz][my][mx];
+                v3 += x0*v3_brick[mz][my][mx];
+                v4 += x0*v4_brick[mz][my][mx];
+                v5 += x0*v5_brick[mz][my][mx];
+              }
+            }
+          }
+        }
+
+        if (eflag_atom) eatom[i] += q[i]*u;
+        if (vflag_atom) {
+          vatom[i][0] += v0;
+          vatom[i][1] += v1;
+          vatom[i][2] += v2;
+          vatom[i][3] += v3;
+          vatom[i][4] += v4;
+          vatom[i][5] += v5;
+        }
       }
     }
   }
@@ -587,10 +587,10 @@ void PPPMCGOMP::fieldforce_peratom()
 
 /* ----------------------------------------------------------------------
    charge assignment into rho1d
-   dx,dy,dz = distance of particle from "lower left" grid point 
+   dx,dy,dz = distance of particle from "lower left" grid point
 ------------------------------------------------------------------------- */
 void PPPMCGOMP::compute_rho1d_thr(FFT_SCALAR * const * const r1d, const FFT_SCALAR &dx,
-				  const FFT_SCALAR &dy, const FFT_SCALAR &dz)
+                                  const FFT_SCALAR &dy, const FFT_SCALAR &dz)
 {
   int k,l;
   FFT_SCALAR r1,r2,r3;
@@ -608,4 +608,3 @@ void PPPMCGOMP::compute_rho1d_thr(FFT_SCALAR * const * const r1d, const FFT_SCAL
     r1d[2][k] = r3;
   }
 }
-
diff --git a/src/USER-OMP/pppm_cg_omp.h b/src/USER-OMP/pppm_cg_omp.h
index 598c5522a6..10a9d35f29 100644
--- a/src/USER-OMP/pppm_cg_omp.h
+++ b/src/USER-OMP/pppm_cg_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -40,7 +40,7 @@ namespace LAMMPS_NS {
   virtual void make_rho();
 
   void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &,
-			 const FFT_SCALAR &, const FFT_SCALAR &);
+                         const FFT_SCALAR &, const FFT_SCALAR &);
 //  void compute_rho_coeff();
 //  void slabcorr(int);
 
diff --git a/src/USER-OMP/pppm_omp.cpp b/src/USER-OMP/pppm_omp.cpp
index 24308de534..5c400b6f48 100644
--- a/src/USER-OMP/pppm_omp.cpp
+++ b/src/USER-OMP/pppm_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -49,7 +49,7 @@ PPPMOMP::PPPMOMP(LAMMPS *lmp, int narg, char **arg) :
 }
 
 /* ----------------------------------------------------------------------
-   allocate memory that depends on # of K-vectors and order 
+   allocate memory that depends on # of K-vectors and order
 ------------------------------------------------------------------------- */
 
 void PPPMOMP::allocate()
@@ -79,7 +79,7 @@ void PPPMOMP::allocate()
   // reallocate density brick, so it fits our needs
   memory->destroy3d_offset(density_brick,nzlo_out,nylo_out,nxlo_out);
   memory->create3d_offset(density_brick,nzlo_out,nzend,nylo_out,nyhi_out,
-			  nxlo_out,nxhi_out,"pppm:density_brick");
+                          nxlo_out,nxhi_out,"pppm:density_brick");
 }
 
 // NOTE: special version of reduce_data for FFT_SCALAR data type.
@@ -103,12 +103,12 @@ static void data_reduce_fft(FFT_SCALAR *dall, int nall, int nthreads, int ndim,
     const int ito   = ((ifrom + idelta) > nvals) ? nvals : (ifrom + idelta);
 
     // this if protects against having more threads than atoms
-    if (ifrom < nall) { 
+    if (ifrom < nall) {
       for (int m = ifrom; m < ito; ++m) {
-	for (int n = 1; n < nthreads; ++n) {
-	  dall[m] += dall[n*nvals + m];
-	  dall[n*nvals + m] = 0.0;
-	}
+        for (int n = 1; n < nthreads; ++n) {
+          dall[m] += dall[n*nvals + m];
+          dall[n*nvals + m] = 0.0;
+        }
       }
     }
   }
@@ -119,7 +119,7 @@ static void data_reduce_fft(FFT_SCALAR *dall, int nall, int nthreads, int ndim,
 }
 
 /* ----------------------------------------------------------------------
-   free memory that depends on # of K-vectors and order 
+   free memory that depends on # of K-vectors and order
 ------------------------------------------------------------------------- */
 
 void PPPMOMP::deallocate()
@@ -133,7 +133,7 @@ void PPPMOMP::deallocate()
 }
 
 /* ----------------------------------------------------------------------
-   adjust PPPM coeffs, called initially and whenever volume has changed 
+   adjust PPPM coeffs, called initially and whenever volume has changed
 ------------------------------------------------------------------------- */
 
 void PPPMOMP::setup()
@@ -153,7 +153,7 @@ void PPPMOMP::setup()
   const double zprd = prd[2];
   const double zprd_slab = zprd*slab_volfactor;
   volume = xprd * yprd * zprd_slab;
-    
+
   delxinv = nx_pppm/xprd;
   delyinv = ny_pppm/yprd;
   delzinv = nz_pppm/zprd_slab;
@@ -191,36 +191,36 @@ void PPPMOMP::setup()
   for (k = nzlo_fft; k <= nzhi_fft; k++) {
     for (j = nylo_fft; j <= nyhi_fft; j++) {
       for (i = nxlo_fft; i <= nxhi_fft; i++) {
-	sqk = fkx[i]*fkx[i] + fky[j]*fky[j] + fkz[k]*fkz[k];
-	if (sqk == 0.0) {
-	  vg[n][0] = 0.0;
-	  vg[n][1] = 0.0;
-	  vg[n][2] = 0.0;
-	  vg[n][3] = 0.0;
-	  vg[n][4] = 0.0;
-	  vg[n][5] = 0.0;
-	} else {
-	  vterm = -2.0 * (1.0/sqk + 0.25/(g_ewald*g_ewald));
-	  vg[n][0] = 1.0 + vterm*fkx[i]*fkx[i];
-	  vg[n][1] = 1.0 + vterm*fky[j]*fky[j];
-	  vg[n][2] = 1.0 + vterm*fkz[k]*fkz[k];
-	  vg[n][3] = vterm*fkx[i]*fky[j];
-	  vg[n][4] = vterm*fkx[i]*fkz[k];
-	  vg[n][5] = vterm*fky[j]*fkz[k];
-	}
-	n++;
+        sqk = fkx[i]*fkx[i] + fky[j]*fky[j] + fkz[k]*fkz[k];
+        if (sqk == 0.0) {
+          vg[n][0] = 0.0;
+          vg[n][1] = 0.0;
+          vg[n][2] = 0.0;
+          vg[n][3] = 0.0;
+          vg[n][4] = 0.0;
+          vg[n][5] = 0.0;
+        } else {
+          vterm = -2.0 * (1.0/sqk + 0.25/(g_ewald*g_ewald));
+          vg[n][0] = 1.0 + vterm*fkx[i]*fkx[i];
+          vg[n][1] = 1.0 + vterm*fky[j]*fky[j];
+          vg[n][2] = 1.0 + vterm*fkz[k]*fkz[k];
+          vg[n][3] = vterm*fkx[i]*fky[j];
+          vg[n][4] = vterm*fkx[i]*fkz[k];
+          vg[n][5] = vterm*fky[j]*fkz[k];
+        }
+        n++;
       }
     }
   }
 
   // modified (Hockney-Eastwood) Coulomb Green's function
 
-  const int nbx = static_cast<int> ((g_ewald*xprd/(MY_PI*nx_pppm)) * 
-				    pow(-log(EPS_HOC),0.25));
-  const int nby = static_cast<int> ((g_ewald*yprd/(MY_PI*ny_pppm)) * 
-				    pow(-log(EPS_HOC),0.25));
-  const int nbz = static_cast<int> ((g_ewald*zprd_slab/(MY_PI*nz_pppm)) * 
-				    pow(-log(EPS_HOC),0.25));
+  const int nbx = static_cast<int> ((g_ewald*xprd/(MY_PI*nx_pppm)) *
+                                    pow(-log(EPS_HOC),0.25));
+  const int nby = static_cast<int> ((g_ewald*yprd/(MY_PI*ny_pppm)) *
+                                    pow(-log(EPS_HOC),0.25));
+  const int nbz = static_cast<int> ((g_ewald*zprd_slab/(MY_PI*nz_pppm)) *
+                                    pow(-log(EPS_HOC),0.25));
 
   const double form = 1.0;
 
@@ -234,80 +234,80 @@ void PPPMOMP::setup()
     double sum1,dot1,dot2;
     double numerator,denominator;
     const double gew2 = -4.0*g_ewald*g_ewald;
-    
+
     const int nnx = nxhi_fft-nxlo_fft+1;
     const int nny = nyhi_fft-nylo_fft+1;
-    
+
     loop_setup_thr(nnfrom, nnto, tid, nfft, comm->nthreads);
-    
+
     for (m = nzlo_fft; m <= nzhi_fft; m++) {
-      
+
       const double fkzm = fkz[m];
       snz = sin(0.5*fkzm*zprd_slab/nz_pppm);
       snz *= snz;
 
       for (l = nylo_fft; l <= nyhi_fft; l++) {
-	const double fkyl = fky[l];
-	sny = sin(0.5*fkyl*yprd/ny_pppm);
-	sny *= sny;
-
-	for (k = nxlo_fft; k <= nxhi_fft; k++) {
-
-	  /* only compute the part designated to this thread */
-	  nn = k-nxlo_fft + nnx*(l-nylo_fft + nny*(m-nzlo_fft));
-	  if ((nn < nnfrom) || (nn >=nnto)) continue;
-
-	  const double fkxk = fkx[k];
-	  snx = sin(0.5*fkxk*xprd/nx_pppm);
-	  snx *= snx;
-      
-	  sqk = fkxk*fkxk + fkyl*fkyl + fkzm*fkzm;
-
-	  if (sqk != 0.0) {
-	    numerator = form*MY_4PI/sqk;
-	    denominator = gf_denom(snx,sny,snz);  
-	    sum1 = 0.0;
-	    const double dorder = static_cast<double>(order);
-	    for (nx = -nbx; nx <= nbx; nx++) {
-	      qx = fkxk + unitkx*nx_pppm*nx;
-	      sx = exp(qx*qx/gew2);
-	      wx = 1.0;
-	      argx = 0.5*qx*xprd/nx_pppm;
-	      if (argx != 0.0) wx = pow(sin(argx)/argx,dorder);
-	      wx *=wx;
-
-	      for (ny = -nby; ny <= nby; ny++) {
-		qy = fkyl + unitky*ny_pppm*ny;
-		sy = exp(qy*qy/gew2);
-		wy = 1.0;
-		argy = 0.5*qy*yprd/ny_pppm;
-		if (argy != 0.0) wy = pow(sin(argy)/argy,dorder);
-		wy *= wy;
-
-		for (nz = -nbz; nz <= nbz; nz++) {
-		  qz = fkzm + unitkz*nz_pppm*nz;
-		  sz = exp(qz*qz/gew2);
-		  wz = 1.0;
-		  argz = 0.5*qz*zprd_slab/nz_pppm;
-		  if (argz != 0.0) wz = pow(sin(argz)/argz,dorder);
-		  wz *= wz;
-
-		  dot1 = fkxk*qx + fkyl*qy + fkzm*qz;
-		  dot2 = qx*qx+qy*qy+qz*qz;
-		  sum1 += (dot1/dot2) * sx*sy*sz * wx*wy*wz;
-		}
-	      }
-	    }
-	    greensfn[nn] = numerator*sum1/denominator;
-	  } else greensfn[nn] = 0.0;
-	}
+        const double fkyl = fky[l];
+        sny = sin(0.5*fkyl*yprd/ny_pppm);
+        sny *= sny;
+
+        for (k = nxlo_fft; k <= nxhi_fft; k++) {
+
+          /* only compute the part designated to this thread */
+          nn = k-nxlo_fft + nnx*(l-nylo_fft + nny*(m-nzlo_fft));
+          if ((nn < nnfrom) || (nn >=nnto)) continue;
+
+          const double fkxk = fkx[k];
+          snx = sin(0.5*fkxk*xprd/nx_pppm);
+          snx *= snx;
+
+          sqk = fkxk*fkxk + fkyl*fkyl + fkzm*fkzm;
+
+          if (sqk != 0.0) {
+            numerator = form*MY_4PI/sqk;
+            denominator = gf_denom(snx,sny,snz);
+            sum1 = 0.0;
+            const double dorder = static_cast<double>(order);
+            for (nx = -nbx; nx <= nbx; nx++) {
+              qx = fkxk + unitkx*nx_pppm*nx;
+              sx = exp(qx*qx/gew2);
+              wx = 1.0;
+              argx = 0.5*qx*xprd/nx_pppm;
+              if (argx != 0.0) wx = pow(sin(argx)/argx,dorder);
+              wx *=wx;
+
+              for (ny = -nby; ny <= nby; ny++) {
+                qy = fkyl + unitky*ny_pppm*ny;
+                sy = exp(qy*qy/gew2);
+                wy = 1.0;
+                argy = 0.5*qy*yprd/ny_pppm;
+                if (argy != 0.0) wy = pow(sin(argy)/argy,dorder);
+                wy *= wy;
+
+                for (nz = -nbz; nz <= nbz; nz++) {
+                  qz = fkzm + unitkz*nz_pppm*nz;
+                  sz = exp(qz*qz/gew2);
+                  wz = 1.0;
+                  argz = 0.5*qz*zprd_slab/nz_pppm;
+                  if (argz != 0.0) wz = pow(sin(argz)/argz,dorder);
+                  wz *= wz;
+
+                  dot1 = fkxk*qx + fkyl*qy + fkzm*qz;
+                  dot2 = qx*qx+qy*qy+qz*qz;
+                  sum1 += (dot1/dot2) * sx*sy*sz * wx*wy*wz;
+                }
+              }
+            }
+            greensfn[nn] = numerator*sum1/denominator;
+          } else greensfn[nn] = 0.0;
+        }
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   run the regular toplevel compute method from plain PPPPM 
+   run the regular toplevel compute method from plain PPPPM
    which will have individual methods replaced by our threaded
    versions and then call the obligatory force reduction.
 ------------------------------------------------------------------------- */
@@ -335,7 +335,7 @@ void PPPMOMP::compute(int eflag, int vflag)
    create discretized "density" on section of global grid due to my particles
    density(x,y,z) = charge "density" at grid points of my 3d brick
    (nxlo:nxhi,nylo:nyhi,nzlo:nzhi) is extent of my brick (including ghosts)
-   in global grid 
+   in global grid
 ------------------------------------------------------------------------- */
 
 void PPPMOMP::make_rho()
@@ -348,7 +348,7 @@ void PPPMOMP::make_rho()
 #if defined(_OPENMP)
 #pragma omp parallel default(none)
 #endif
-  {  
+  {
 #if defined(_OPENMP)
     // each thread works on a fixed chunk of atoms.
     const int tid = omp_get_thread_num();
@@ -377,33 +377,33 @@ void PPPMOMP::make_rho()
     // (nx,ny,nz) = global coords of grid pt to "lower left" of charge
     // (dx,dy,dz) = distance to "lower left" grid pt
     // (mx,my,mz) = global coords of moving stencil pt
-    
+
     // this if protects against having more threads than local atoms
-    if (ifrom < nlocal) { 
+    if (ifrom < nlocal) {
       for (int i = ifrom; i < ito; i++) {
 
-	nx = part2grid[i][0];
-	ny = part2grid[i][1];
-	nz = part2grid[i][2];
-	dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
-	dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
-	dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
-
-	compute_rho1d_thr(r1d,dx,dy,dz);
-
-	z0 = delvolinv * q[i];
-	for (n = nlower; n <= nupper; n++) {
-	  mz = n+nz;
-	  y0 = z0*r1d[2][n];
-	  for (m = nlower; m <= nupper; m++) {
-	    my = m+ny;
-	    x0 = y0*r1d[1][m];
-	    for (l = nlower; l <= nupper; l++) {
-	      mx = l+nx;
-	      db[mz][my][mx] += x0*r1d[0][l];
-	    }
-	  }
-	}
+        nx = part2grid[i][0];
+        ny = part2grid[i][1];
+        nz = part2grid[i][2];
+        dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
+        dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
+        dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
+
+        compute_rho1d_thr(r1d,dx,dy,dz);
+
+        z0 = delvolinv * q[i];
+        for (n = nlower; n <= nupper; n++) {
+          mz = n+nz;
+          y0 = z0*r1d[2][n];
+          for (m = nlower; m <= nupper; m++) {
+            my = m+ny;
+            x0 = y0*r1d[1][m];
+            for (l = nlower; l <= nupper; l++) {
+              mx = l+nx;
+              db[mz][my][mx] += x0*r1d[0][l];
+            }
+          }
+        }
       }
     }
 #if defined(_OPENMP)
@@ -416,7 +416,7 @@ void PPPMOMP::make_rho()
 }
 
 /* ----------------------------------------------------------------------
-   interpolate from grid to get electric field & force on my particles 
+   interpolate from grid to get electric field & force on my particles
 ------------------------------------------------------------------------- */
 
 void PPPMOMP::fieldforce()
@@ -436,7 +436,7 @@ void PPPMOMP::fieldforce()
 #if defined(_OPENMP)
 #pragma omp parallel default(none)
 #endif
-  {  
+  {
 #if defined(_OPENMP)
     // each thread works on a fixed chunk of atoms.
     const int tid = omp_get_thread_num();
@@ -452,46 +452,46 @@ void PPPMOMP::fieldforce()
     ThrData *thr = fix->get_thr(tid);
     double * const * const f = thr->get_f();
     FFT_SCALAR * const * const r1d =  static_cast<FFT_SCALAR **>(thr->get_rho1d());
-    
+
     int l,m,n,nx,ny,nz,mx,my,mz;
     FFT_SCALAR dx,dy,dz,x0,y0,z0;
     FFT_SCALAR ekx,eky,ekz;
 
     // this if protects against having more threads than local atoms
-    if (ifrom < nlocal) { 
+    if (ifrom < nlocal) {
       for (int i = ifrom; i < ito; i++) {
 
-	nx = part2grid[i][0];
-	ny = part2grid[i][1];
-	nz = part2grid[i][2];
-	dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
-	dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
-	dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
-
-	compute_rho1d_thr(r1d,dx,dy,dz);
-
-	ekx = eky = ekz = ZEROF;
-	for (n = nlower; n <= nupper; n++) {
-	  mz = n+nz;
-	  z0 = r1d[2][n];
-	  for (m = nlower; m <= nupper; m++) {
-	    my = m+ny;
-	    y0 = z0*r1d[1][m];
-	    for (l = nlower; l <= nupper; l++) {
-	      mx = l+nx;
-	      x0 = y0*r1d[0][l];
-	      ekx -= x0*vdx_brick[mz][my][mx];
-	      eky -= x0*vdy_brick[mz][my][mx];
-	      ekz -= x0*vdz_brick[mz][my][mx];
-	    }
-	  }
-	}
-
-	// convert E-field to force
-	const double qfactor = qqrd2e*scale*q[i];
-	f[i][0] += qfactor*ekx;
-	f[i][1] += qfactor*eky;
-	f[i][2] += qfactor*ekz;
+        nx = part2grid[i][0];
+        ny = part2grid[i][1];
+        nz = part2grid[i][2];
+        dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
+        dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
+        dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
+
+        compute_rho1d_thr(r1d,dx,dy,dz);
+
+        ekx = eky = ekz = ZEROF;
+        for (n = nlower; n <= nupper; n++) {
+          mz = n+nz;
+          z0 = r1d[2][n];
+          for (m = nlower; m <= nupper; m++) {
+            my = m+ny;
+            y0 = z0*r1d[1][m];
+            for (l = nlower; l <= nupper; l++) {
+              mx = l+nx;
+              x0 = y0*r1d[0][l];
+              ekx -= x0*vdx_brick[mz][my][mx];
+              eky -= x0*vdy_brick[mz][my][mx];
+              ekz -= x0*vdz_brick[mz][my][mx];
+            }
+          }
+        }
+
+        // convert E-field to force
+        const double qfactor = qqrd2e*scale*q[i];
+        f[i][0] += qfactor*ekx;
+        f[i][1] += qfactor*eky;
+        f[i][2] += qfactor*ekz;
       }
     }
   }
@@ -540,47 +540,47 @@ void PPPMOMP::fieldforce_peratom()
     if (ifrom < nlocal) {
       for (int i = ifrom; i < ito; i++) {
 
-	nx = part2grid[i][0];
-	ny = part2grid[i][1];
-	nz = part2grid[i][2];
-	dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
-	dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
-	dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
-
-	compute_rho1d_thr(r1d,dx,dy,dz);
-
-	u = v0 = v1 = v2 = v3 = v4 = v5 = ZEROF;
-	for (n = nlower; n <= nupper; n++) {
-	  mz = n+nz;
-	  z0 = r1d[2][n];
-	  for (m = nlower; m <= nupper; m++) {
-	    my = m+ny;
-	    y0 = z0*r1d[1][m];
-	    for (l = nlower; l <= nupper; l++) {
-	      mx = l+nx;
-	      x0 = y0*r1d[0][l];
-	      if (eflag_atom) u += x0*u_brick[mz][my][mx];
-	      if (vflag_atom) {
-		v0 += x0*v0_brick[mz][my][mx];
-		v1 += x0*v1_brick[mz][my][mx];
-		v2 += x0*v2_brick[mz][my][mx];
-		v3 += x0*v3_brick[mz][my][mx];
-		v4 += x0*v4_brick[mz][my][mx];
-		v5 += x0*v5_brick[mz][my][mx];
-	      }
-	    }
-	  }
-	}
-
-	if (eflag_atom) eatom[i] += q[i]*u;
-	if (vflag_atom) {
-	  vatom[i][0] += v0;
-	  vatom[i][1] += v1;
-	  vatom[i][2] += v2;
-	  vatom[i][3] += v3;
-	  vatom[i][4] += v4;
-	  vatom[i][5] += v5;
-	}
+        nx = part2grid[i][0];
+        ny = part2grid[i][1];
+        nz = part2grid[i][2];
+        dx = nx+shiftone - (x[i][0]-boxlo[0])*delxinv;
+        dy = ny+shiftone - (x[i][1]-boxlo[1])*delyinv;
+        dz = nz+shiftone - (x[i][2]-boxlo[2])*delzinv;
+
+        compute_rho1d_thr(r1d,dx,dy,dz);
+
+        u = v0 = v1 = v2 = v3 = v4 = v5 = ZEROF;
+        for (n = nlower; n <= nupper; n++) {
+          mz = n+nz;
+          z0 = r1d[2][n];
+          for (m = nlower; m <= nupper; m++) {
+            my = m+ny;
+            y0 = z0*r1d[1][m];
+            for (l = nlower; l <= nupper; l++) {
+              mx = l+nx;
+              x0 = y0*r1d[0][l];
+              if (eflag_atom) u += x0*u_brick[mz][my][mx];
+              if (vflag_atom) {
+                v0 += x0*v0_brick[mz][my][mx];
+                v1 += x0*v1_brick[mz][my][mx];
+                v2 += x0*v2_brick[mz][my][mx];
+                v3 += x0*v3_brick[mz][my][mx];
+                v4 += x0*v4_brick[mz][my][mx];
+                v5 += x0*v5_brick[mz][my][mx];
+              }
+            }
+          }
+        }
+
+        if (eflag_atom) eatom[i] += q[i]*u;
+        if (vflag_atom) {
+          vatom[i][0] += v0;
+          vatom[i][1] += v1;
+          vatom[i][2] += v2;
+          vatom[i][3] += v3;
+          vatom[i][4] += v4;
+          vatom[i][5] += v5;
+        }
       }
     }
   }
@@ -588,10 +588,10 @@ void PPPMOMP::fieldforce_peratom()
 
 /* ----------------------------------------------------------------------
    charge assignment into rho1d
-   dx,dy,dz = distance of particle from "lower left" grid point 
+   dx,dy,dz = distance of particle from "lower left" grid point
 ------------------------------------------------------------------------- */
 void PPPMOMP::compute_rho1d_thr(FFT_SCALAR * const * const r1d, const FFT_SCALAR &dx,
-				const FFT_SCALAR &dy, const FFT_SCALAR &dz)
+                                const FFT_SCALAR &dy, const FFT_SCALAR &dz)
 {
   int k,l;
   FFT_SCALAR r1,r2,r3;
diff --git a/src/USER-OMP/pppm_omp.h b/src/USER-OMP/pppm_omp.h
index 93caa6ed6e..b3c069844c 100644
--- a/src/USER-OMP/pppm_omp.h
+++ b/src/USER-OMP/pppm_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -40,7 +40,7 @@ namespace LAMMPS_NS {
   virtual void make_rho();
 
   void compute_rho1d_thr(FFT_SCALAR * const * const, const FFT_SCALAR &,
-			 const FFT_SCALAR &, const FFT_SCALAR &);
+                         const FFT_SCALAR &, const FFT_SCALAR &);
 //  void compute_rho_coeff();
 //  void slabcorr(int);
 
diff --git a/src/USER-OMP/pppm_proxy.cpp b/src/USER-OMP/pppm_proxy.cpp
index 4e8112060f..25c2158a08 100644
--- a/src/USER-OMP/pppm_proxy.cpp
+++ b/src/USER-OMP/pppm_proxy.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -62,4 +62,3 @@ void PPPMProxy::compute_proxy(int eflag, int vflag)
   setup_proxy();
   PPPM::compute(eflag,vflag);
 }
-
diff --git a/src/USER-OMP/pppm_proxy.h b/src/USER-OMP/pppm_proxy.h
index 505efe2e81..110abfc9da 100644
--- a/src/USER-OMP/pppm_proxy.h
+++ b/src/USER-OMP/pppm_proxy.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/pppm_tip4p_omp.cpp b/src/USER-OMP/pppm_tip4p_omp.cpp
index 219b1b2030..e59275239b 100644
--- a/src/USER-OMP/pppm_tip4p_omp.cpp
+++ b/src/USER-OMP/pppm_tip4p_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -71,12 +71,12 @@ static void data_reduce_fft(FFT_SCALAR *dall, int nall, int nthreads, int ndim,
     const int ito   = ((ifrom + idelta) > nvals) ? nvals : (ifrom + idelta);
 
     // this if protects against having more threads than atoms
-    if (ifrom < nall) { 
+    if (ifrom < nall) {
       for (int m = ifrom; m < ito; ++m) {
-	for (int n = 1; n < nthreads; ++n) {
-	  dall[m] += dall[n*nvals + m];
-	  dall[n*nvals + m] = 0.0;
-	}
+        for (int n = 1; n < nthreads; ++n) {
+          dall[m] += dall[n*nvals + m];
+          dall[n*nvals + m] = 0.0;
+        }
       }
     }
   }
@@ -101,7 +101,7 @@ void PPPMTIP4POMP::init()
 /* ----------------------------------------------------------------------
    find center grid pt for each of my particles
    check that full stencil for the particle will fit in my 3d brick
-   store central grid pt indices in part2grid array 
+   store central grid pt indices in part2grid array
 ------------------------------------------------------------------------- */
 
 void PPPMTIP4POMP::particle_map()
@@ -119,7 +119,7 @@ void PPPMTIP4POMP::particle_map()
     double xM[3];
 
     if (type[i] == typeO) {
-      find_M(i,iH1,iH2,xM);      
+      find_M(i,iH1,iH2,xM);
     } else {
       xM[0] = x[i][0];
       xM[1] = x[i][1];
@@ -141,8 +141,8 @@ void PPPMTIP4POMP::particle_map()
     // check that entire stencil around nx,ny,nz will fit in my 3d brick
 
     if (nx+nlower < nxlo_out || nx+nupper > nxhi_out ||
-	ny+nlower < nylo_out || ny+nupper > nyhi_out ||
-	nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag++;
+        ny+nlower < nylo_out || ny+nupper > nyhi_out ||
+        nz+nlower < nzlo_out || nz+nupper > nzhi_out) flag++;
   }
 
   int flag_all;
@@ -154,7 +154,7 @@ void PPPMTIP4POMP::particle_map()
    create discretized "density" on section of global grid due to my particles
    density(x,y,z) = charge "density" at grid points of my 3d brick
    (nxlo:nxhi,nylo:nyhi,nzlo:nzhi) is extent of my brick (including ghosts)
-   in global grid 
+   in global grid
 ------------------------------------------------------------------------- */
 
 void PPPMTIP4POMP::make_rho()
@@ -168,7 +168,7 @@ void PPPMTIP4POMP::make_rho()
 #if defined(_OPENMP)
 #pragma omp parallel default(none)
 #endif
-  {  
+  {
 #if defined(_OPENMP)
     // each thread works on a fixed chunk of atoms.
     const int tid = omp_get_thread_num();
@@ -198,41 +198,41 @@ void PPPMTIP4POMP::make_rho()
     // (nx,ny,nz) = global coords of grid pt to "lower left" of charge
     // (dx,dy,dz) = distance to "lower left" grid pt
     // (mx,my,mz) = global coords of moving stencil pt
-    
+
     // this if protects against having more threads than local atoms
-    if (ifrom < nlocal) { 
+    if (ifrom < nlocal) {
       for (int i = ifrom; i < ito; i++) {
 
-	if (type[i] == typeO) {
-	  find_M(i,iH1,iH2,xM);      
-	} else {
-	  xM[0] = x[i][0];
-	  xM[1] = x[i][1];
-	  xM[2] = x[i][2];
-	}
-
-	nx = part2grid[i][0];
-	ny = part2grid[i][1];
-	nz = part2grid[i][2];
-	dx = nx+shiftone - (xM[0]-boxlo[0])*delxinv;
-	dy = ny+shiftone - (xM[1]-boxlo[1])*delyinv;
-	dz = nz+shiftone - (xM[2]-boxlo[2])*delzinv;
-
-	compute_rho1d_thr(r1d,dx,dy,dz);
-
-	z0 = delvolinv * q[i];
-	for (n = nlower; n <= nupper; n++) {
-	  mz = n+nz;
-	  y0 = z0*r1d[2][n];
-	  for (m = nlower; m <= nupper; m++) {
-	    my = m+ny;
-	    x0 = y0*r1d[1][m];
-	    for (l = nlower; l <= nupper; l++) {
-	      mx = l+nx;
-	      db[mz][my][mx] += x0*r1d[0][l];
-	    }
-	  }
-	}
+        if (type[i] == typeO) {
+          find_M(i,iH1,iH2,xM);
+        } else {
+          xM[0] = x[i][0];
+          xM[1] = x[i][1];
+          xM[2] = x[i][2];
+        }
+
+        nx = part2grid[i][0];
+        ny = part2grid[i][1];
+        nz = part2grid[i][2];
+        dx = nx+shiftone - (xM[0]-boxlo[0])*delxinv;
+        dy = ny+shiftone - (xM[1]-boxlo[1])*delyinv;
+        dz = nz+shiftone - (xM[2]-boxlo[2])*delzinv;
+
+        compute_rho1d_thr(r1d,dx,dy,dz);
+
+        z0 = delvolinv * q[i];
+        for (n = nlower; n <= nupper; n++) {
+          mz = n+nz;
+          y0 = z0*r1d[2][n];
+          for (m = nlower; m <= nupper; m++) {
+            my = m+ny;
+            x0 = y0*r1d[1][m];
+            for (l = nlower; l <= nupper; l++) {
+              mx = l+nx;
+              db[mz][my][mx] += x0*r1d[0][l];
+            }
+          }
+        }
       }
     }
 #if defined(_OPENMP)
@@ -245,7 +245,7 @@ void PPPMTIP4POMP::make_rho()
 }
 
 /* ----------------------------------------------------------------------
-   interpolate from grid to get electric field & force on my particles 
+   interpolate from grid to get electric field & force on my particles
 ------------------------------------------------------------------------- */
 
 void PPPMTIP4POMP::fieldforce()
@@ -266,7 +266,7 @@ void PPPMTIP4POMP::fieldforce()
 #if defined(_OPENMP)
 #pragma omp parallel default(none)
 #endif
-  {  
+  {
 #if defined(_OPENMP)
     // each thread works on a fixed chunk of atoms.
     const int tid = omp_get_thread_num();
@@ -282,7 +282,7 @@ void PPPMTIP4POMP::fieldforce()
     ThrData *thr = fix->get_thr(tid);
     double * const * const f = thr->get_f();
     FFT_SCALAR * const * const r1d =  static_cast<FFT_SCALAR **>(thr->get_rho1d());
-    
+
     int l,m,n,nx,ny,nz,mx,my,mz;
     FFT_SCALAR dx,dy,dz,x0,y0,z0;
     FFT_SCALAR ekx,eky,ekz;
@@ -291,79 +291,79 @@ void PPPMTIP4POMP::fieldforce()
     double ddotf, rOMx, rOMy, rOMz, f1x, f1y, f1z;
 
     // this if protects against having more threads than local atoms
-    if (ifrom < nlocal) { 
+    if (ifrom < nlocal) {
       for (int i = ifrom; i < ito; i++) {
 
-	if (type[i] == typeO) {
-	  find_M(i,iH1,iH2,xM);      
-	} else {
-	  xM[0] = x[i][0];
-	  xM[1] = x[i][1];
-	  xM[2] = x[i][2];
-	}
-
-	nx = part2grid[i][0];
-	ny = part2grid[i][1];
-	nz = part2grid[i][2];
-	dx = nx+shiftone - (xM[0]-boxlo[0])*delxinv;
-	dy = ny+shiftone - (xM[1]-boxlo[1])*delyinv;
-	dz = nz+shiftone - (xM[2]-boxlo[2])*delzinv;
-
-	compute_rho1d_thr(r1d,dx,dy,dz);
-
-	ekx = eky = ekz = ZEROF;
-	for (n = nlower; n <= nupper; n++) {
-	  mz = n+nz;
-	  z0 = r1d[2][n];
-	  for (m = nlower; m <= nupper; m++) {
-	    my = m+ny;
-	    y0 = z0*r1d[1][m];
-	    for (l = nlower; l <= nupper; l++) {
-	      mx = l+nx;
-	      x0 = y0*r1d[0][l];
-	      ekx -= x0*vdx_brick[mz][my][mx];
-	      eky -= x0*vdy_brick[mz][my][mx];
-	      ekz -= x0*vdz_brick[mz][my][mx];
-	    }
-	  }
-	}
-
-	// convert E-field to force
-	const double qfactor = qqrd2e*scale*q[i];
-
-	if (type[i] != typeO) {
-	  f[i][0] += qfactor*ekx;
-	  f[i][1] += qfactor*eky;
-	  f[i][2] += qfactor*ekz;
-
-	} else {
-	  fx = qfactor * ekx;
-	  fy = qfactor * eky;
-	  fz = qfactor * ekz;
-	  find_M(i,iH1,iH2,xM);
-
-	  rOMx = xM[0] - x[i][0];
-	  rOMy = xM[1] - x[i][1];
-	  rOMz = xM[2] - x[i][2];
-  
-	  ddotf = (rOMx * fx + rOMy * fy + rOMz * fz) / (qdist * qdist);
-
-	  f1x = ddotf * rOMx;
-	  f1y = ddotf * rOMy;
-	  f1z = ddotf * rOMz;
-
-	  f[i][0] += fx - alpha * (fx - f1x);
-	  f[i][1] += fy - alpha * (fy - f1y);
-	  f[i][2] += fz - alpha * (fz - f1z);
-
-	  f[iH1][0] += 0.5*alpha*(fx - f1x);
-	  f[iH1][1] += 0.5*alpha*(fy - f1y);
-	  f[iH1][2] += 0.5*alpha*(fz - f1z);
-
-	  f[iH2][0] += 0.5*alpha*(fx - f1x);
-	  f[iH2][1] += 0.5*alpha*(fy - f1y);
-	  f[iH2][2] += 0.5*alpha*(fz - f1z);
-	}
+        if (type[i] == typeO) {
+          find_M(i,iH1,iH2,xM);
+        } else {
+          xM[0] = x[i][0];
+          xM[1] = x[i][1];
+          xM[2] = x[i][2];
+        }
+
+        nx = part2grid[i][0];
+        ny = part2grid[i][1];
+        nz = part2grid[i][2];
+        dx = nx+shiftone - (xM[0]-boxlo[0])*delxinv;
+        dy = ny+shiftone - (xM[1]-boxlo[1])*delyinv;
+        dz = nz+shiftone - (xM[2]-boxlo[2])*delzinv;
+
+        compute_rho1d_thr(r1d,dx,dy,dz);
+
+        ekx = eky = ekz = ZEROF;
+        for (n = nlower; n <= nupper; n++) {
+          mz = n+nz;
+          z0 = r1d[2][n];
+          for (m = nlower; m <= nupper; m++) {
+            my = m+ny;
+            y0 = z0*r1d[1][m];
+            for (l = nlower; l <= nupper; l++) {
+              mx = l+nx;
+              x0 = y0*r1d[0][l];
+              ekx -= x0*vdx_brick[mz][my][mx];
+              eky -= x0*vdy_brick[mz][my][mx];
+              ekz -= x0*vdz_brick[mz][my][mx];
+            }
+          }
+        }
+
+        // convert E-field to force
+        const double qfactor = qqrd2e*scale*q[i];
+
+        if (type[i] != typeO) {
+          f[i][0] += qfactor*ekx;
+          f[i][1] += qfactor*eky;
+          f[i][2] += qfactor*ekz;
+
+        } else {
+          fx = qfactor * ekx;
+          fy = qfactor * eky;
+          fz = qfactor * ekz;
+          find_M(i,iH1,iH2,xM);
+
+          rOMx = xM[0] - x[i][0];
+          rOMy = xM[1] - x[i][1];
+          rOMz = xM[2] - x[i][2];
+
+          ddotf = (rOMx * fx + rOMy * fy + rOMz * fz) / (qdist * qdist);
+
+          f1x = ddotf * rOMx;
+          f1y = ddotf * rOMy;
+          f1z = ddotf * rOMz;
+
+          f[i][0] += fx - alpha * (fx - f1x);
+          f[i][1] += fy - alpha * (fy - f1y);
+          f[i][2] += fz - alpha * (fz - f1z);
+
+          f[iH1][0] += 0.5*alpha*(fx - f1x);
+          f[iH1][1] += 0.5*alpha*(fy - f1y);
+          f[iH1][2] += 0.5*alpha*(fz - f1z);
+
+          f[iH2][0] += 0.5*alpha*(fx - f1x);
+          f[iH2][1] += 0.5*alpha*(fy - f1y);
+          f[iH2][2] += 0.5*alpha*(fz - f1z);
+        }
       }
     }
   }
@@ -384,7 +384,7 @@ void PPPMTIP4POMP::find_M(int i, int &iH1, int &iH2, double *xM)
   if (atom->type[iH1] != typeH || atom->type[iH2] != typeH)
     error->one(FLERR,"TIP4P hydrogen has incorrect atom type");
 
-  const double * const * const x = atom->x; 
+  const double * const * const x = atom->x;
 
   double delx1 = x[iH1][0] - x[i][0];
   double dely1 = x[iH1][1] - x[i][1];
diff --git a/src/USER-OMP/pppm_tip4p_omp.h b/src/USER-OMP/pppm_tip4p_omp.h
index 33e5b0f224..11801ccb35 100644
--- a/src/USER-OMP/pppm_tip4p_omp.h
+++ b/src/USER-OMP/pppm_tip4p_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -29,14 +29,14 @@ class PPPMTIP4POMP : public PPPMOMP {
   PPPMTIP4POMP(class LAMMPS *, int, char **);
   virtual ~PPPMTIP4POMP () {};
   virtual void init();
-    
+
  protected:
   virtual void particle_map();
   virtual void fieldforce();
   virtual void make_rho();
 
  private:
-  void find_M(int, int &, int &, double *); 
+  void find_M(int, int &, int &, double *);
 
 //  void slabcorr(int);
 
diff --git a/src/USER-OMP/pppm_tip4p_proxy.cpp b/src/USER-OMP/pppm_tip4p_proxy.cpp
index 367b51e48d..db851dec5b 100644
--- a/src/USER-OMP/pppm_tip4p_proxy.cpp
+++ b/src/USER-OMP/pppm_tip4p_proxy.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -62,4 +62,3 @@ void PPPMTIP4PProxy::compute_proxy(int eflag, int vflag)
   setup_proxy();
   PPPMTIP4P::compute(eflag,vflag);
 }
-
diff --git a/src/USER-OMP/pppm_tip4p_proxy.h b/src/USER-OMP/pppm_tip4p_proxy.h
index fee06800ff..0a670d8b63 100644
--- a/src/USER-OMP/pppm_tip4p_proxy.h
+++ b/src/USER-OMP/pppm_tip4p_proxy.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-OMP/thr_data.cpp b/src/USER-OMP/thr_data.cpp
index bc3d6d635b..cebed27721 100644
--- a/src/USER-OMP/thr_data.cpp
+++ b/src/USER-OMP/thr_data.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -24,10 +24,10 @@
 using namespace LAMMPS_NS;
 
 
-ThrData::ThrData(int tid) 
+ThrData::ThrData(int tid)
   : _f(NULL), _torque(NULL), _erforce(NULL), _de(NULL), _drho(NULL), _mu(NULL),
     _lambda(NULL), _rhoB(NULL), _D_values(NULL), _rho(NULL), _fp(NULL),
-    _rho1d(NULL), _tid(tid) 
+    _rho1d(NULL), _tid(tid)
 {
   // nothing else to do here.
 }
@@ -44,7 +44,7 @@ void ThrData::check_tid(int tid)
 /* ---------------------------------------------------------------------- */
 
 void ThrData::init_force(int nall, double **f, double **torque,
-			 double *erforce, double *de, double *drho)
+                         double *erforce, double *de, double *drho)
 {
   eng_vdwl=eng_coul=eng_bond=eng_angle=eng_dihed=eng_imprp=eng_kspce=0.0;
   memset(virial_pair,0,6*sizeof(double));
@@ -184,7 +184,7 @@ void ThrData::virial_fdotr_compute(double **x, int nlocal, int nghost, int nfirs
 
 /* ---------------------------------------------------------------------- */
 
-double ThrData::memory_usage() 
+double ThrData::memory_usage()
 {
   double bytes = (7 + 6*6) * sizeof(double);
   bytes += 2 * sizeof(double*);
@@ -215,12 +215,12 @@ void LAMMPS_NS::data_reduce_thr(double *dall, int nall, int nthreads, int ndim,
     const int ito   = ((ifrom + idelta) > nvals) ? nvals : (ifrom + idelta);
 
     // this if protects against having more threads than atoms
-    if (ifrom < nvals) { 
+    if (ifrom < nvals) {
       for (int m = ifrom; m < ito; ++m) {
-	for (int n = 1; n < nthreads; ++n) {
-	  dall[m] += dall[n*nvals + m];
-	  dall[n*nvals + m] = 0.0;
-	}
+        for (int n = 1; n < nthreads; ++n) {
+          dall[m] += dall[n*nvals + m];
+          dall[n*nvals + m] = 0.0;
+        }
       }
     }
   }
@@ -229,4 +229,3 @@ void LAMMPS_NS::data_reduce_thr(double *dall, int nall, int nthreads, int ndim,
   return;
 #endif
 }
-
diff --git a/src/USER-OMP/thr_data.h b/src/USER-OMP/thr_data.h
index f2f8da0614..6345a203c7 100644
--- a/src/USER-OMP/thr_data.h
+++ b/src/USER-OMP/thr_data.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,7 +50,7 @@ class ThrData {
   // setup and erase per atom arrays
   void init_adp(int, double *, double **, double **); // ADP (+ EAM)
   void init_cdeam(int, double *, double *, double *); // CDEAM (+ EAM)
-  void init_eam(int, double *);                       // EAM 
+  void init_eam(int, double *);                       // EAM
   void init_eim(int, double *, double *);             // EIM (+ EAM)
 
   void init_pppm(void *r1d) { _rho1d = r1d; };
@@ -76,7 +76,7 @@ class ThrData {
   double virial_bond[6];  // virial contribution from bonds
   double virial_angle[6]; // virial contribution from angles
   double virial_dihed[6]; // virial contribution from dihedrals
-  double virial_imprp[6]; // virial contribution from impropers 
+  double virial_imprp[6]; // virial contribution from impropers
   double virial_kspce[6]; // virial contribution from kspace
   double *eatom_pair;
   double *eatom_bond;
diff --git a/src/USER-OMP/thr_omp.cpp b/src/USER-OMP/thr_omp.cpp
index f916c519d2..c41c2bc72d 100644
--- a/src/USER-OMP/thr_omp.cpp
+++ b/src/USER-OMP/thr_omp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,21 +64,21 @@ ThrOMP::~ThrOMP()
    ---------------------------------------------------------------------- */
 
 void ThrOMP::ev_setup_thr(int eflag, int vflag, int nall, double *eatom,
-			  double **vatom, ThrData *thr)
+                          double **vatom, ThrData *thr)
 {
   const int tid = thr->get_tid();
   if (tid == 0) thr_error = 0;
-  
+
   if (thr_style & THR_PAIR) {
     if (eflag & 2) {
       thr->eatom_pair = eatom + tid*nall;
       if (nall > 0)
-	memset(&(thr->eatom_pair[0]),0,nall*sizeof(double));
+        memset(&(thr->eatom_pair[0]),0,nall*sizeof(double));
     }
     if (vflag & 4) {
       thr->vatom_pair = vatom + tid*nall;
       if (nall > 0)
-	memset(&(thr->vatom_pair[0][0]),0,nall*6*sizeof(double));
+        memset(&(thr->vatom_pair[0][0]),0,nall*6*sizeof(double));
     }
   }
 
@@ -86,12 +86,12 @@ void ThrOMP::ev_setup_thr(int eflag, int vflag, int nall, double *eatom,
     if (eflag & 2) {
       thr->eatom_bond = eatom + tid*nall;
       if (nall > 0)
-	memset(&(thr->eatom_bond[0]),0,nall*sizeof(double));
+        memset(&(thr->eatom_bond[0]),0,nall*sizeof(double));
     }
     if (vflag & 4) {
       thr->vatom_bond = vatom + tid*nall;
       if (nall > 0)
-	memset(&(thr->vatom_bond[0][0]),0,nall*6*sizeof(double));
+        memset(&(thr->vatom_bond[0][0]),0,nall*6*sizeof(double));
     }
   }
 
@@ -99,12 +99,12 @@ void ThrOMP::ev_setup_thr(int eflag, int vflag, int nall, double *eatom,
     if (eflag & 2) {
       thr->eatom_angle = eatom + tid*nall;
       if (nall > 0)
-	memset(&(thr->eatom_angle[0]),0,nall*sizeof(double));
+        memset(&(thr->eatom_angle[0]),0,nall*sizeof(double));
     }
     if (vflag & 4) {
       thr->vatom_angle = vatom + tid*nall;
       if (nall > 0)
-	memset(&(thr->vatom_angle[0][0]),0,nall*6*sizeof(double));
+        memset(&(thr->vatom_angle[0][0]),0,nall*6*sizeof(double));
     }
   }
 
@@ -112,12 +112,12 @@ void ThrOMP::ev_setup_thr(int eflag, int vflag, int nall, double *eatom,
     if (eflag & 2) {
       thr->eatom_dihed = eatom + tid*nall;
       if (nall > 0)
-	memset(&(thr->eatom_dihed[0]),0,nall*sizeof(double));
+        memset(&(thr->eatom_dihed[0]),0,nall*sizeof(double));
     }
     if (vflag & 4) {
       thr->vatom_dihed = vatom + tid*nall;
       if (nall > 0)
-	memset(&(thr->vatom_dihed[0][0]),0,nall*6*sizeof(double));
+        memset(&(thr->vatom_dihed[0][0]),0,nall*6*sizeof(double));
     }
   }
 
@@ -125,12 +125,12 @@ void ThrOMP::ev_setup_thr(int eflag, int vflag, int nall, double *eatom,
     if (eflag & 2) {
       thr->eatom_imprp = eatom + tid*nall;
       if (nall > 0)
-	memset(&(thr->eatom_imprp[0]),0,nall*sizeof(double));
+        memset(&(thr->eatom_imprp[0]),0,nall*sizeof(double));
     }
     if (vflag & 4) {
       thr->vatom_imprp = vatom + tid*nall;
       if (nall > 0)
-	memset(&(thr->vatom_imprp[0][0]),0,nall*6*sizeof(double));
+        memset(&(thr->vatom_imprp[0][0]),0,nall*6*sizeof(double));
     }
   }
 
@@ -147,7 +147,7 @@ void ThrOMP::ev_setup_thr(int eflag, int vflag, int nall, double *eatom,
    ---------------------------------------------------------------------- */
 
 void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
-			ThrData *const thr, const int nproxy)
+                        ThrData *const thr, const int nproxy)
 {
   const int nlocal = lmp->atom->nlocal;
   const int nghost = lmp->atom->nghost;
@@ -155,7 +155,7 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
   const int nfirst = lmp->atom->nfirst;
   const int nthreads = lmp->comm->nthreads;
   const int evflag = eflag | vflag;
-  
+
   const int tid = thr->get_tid();
   double **f = lmp->atom->f;
   double **x = lmp->atom->x;
@@ -173,18 +173,18 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
     if (pair->vflag_fdotr) {
 
       if (style == fix->last_pair_hybrid) {
-	// pair_style hybrid will compute fdotr for us
-	// but we first need to reduce the forces
-	data_reduce_thr(&(f[0][0]), nall, nthreads, 3, tid);
-	need_force_reduce = 0;
+        // pair_style hybrid will compute fdotr for us
+        // but we first need to reduce the forces
+        data_reduce_thr(&(f[0][0]), nall, nthreads, 3, tid);
+        need_force_reduce = 0;
       }
 
       // this is a non-hybrid pair style. compute per thread fdotr
       if (fix->last_pair_hybrid == NULL) {
-	if (lmp->neighbor->includegroup == 0)
-	  thr->virial_fdotr_compute(x, nlocal, nghost, -1);
-	else
-	  thr->virial_fdotr_compute(x, nlocal, nghost, nfirst);
+        if (lmp->neighbor->includegroup == 0)
+          thr->virial_fdotr_compute(x, nlocal, nghost, -1);
+        else
+          thr->virial_fdotr_compute(x, nlocal, nghost, nfirst);
       }
     }
 
@@ -193,23 +193,23 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
 #pragma omp critical
 #endif
       {
-	if (eflag & 1) {
-	  pair->eng_vdwl += thr->eng_vdwl;
-	  pair->eng_coul += thr->eng_coul;
-	  thr->eng_vdwl = 0.0;
-	  thr->eng_coul = 0.0;
-	}
-	if (vflag & 3)
-	  for (int i=0; i < 6; ++i) {
-	    pair->virial[i] += thr->virial_pair[i];
-	    thr->virial_pair[i] = 0.0;
-	  }
+        if (eflag & 1) {
+          pair->eng_vdwl += thr->eng_vdwl;
+          pair->eng_coul += thr->eng_coul;
+          thr->eng_vdwl = 0.0;
+          thr->eng_coul = 0.0;
+        }
+        if (vflag & 3)
+          for (int i=0; i < 6; ++i) {
+            pair->virial[i] += thr->virial_pair[i];
+            thr->virial_pair[i] = 0.0;
+          }
       }
       if (eflag & 2) {
-	data_reduce_thr(&(pair->eatom[0]), nall, nthreads, 1, tid);
+        data_reduce_thr(&(pair->eatom[0]), nall, nthreads, 1, tid);
       }
       if (vflag & 4) {
-	data_reduce_thr(&(pair->vatom[0][0]), nall, nthreads, 6, tid);
+        data_reduce_thr(&(pair->vatom[0][0]), nall, nthreads, 6, tid);
       }
     }
   }
@@ -221,56 +221,56 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
     if (tid >= nproxy && pair->vflag_fdotr) {
 
       if (fix->last_pair_hybrid) {
-	if (tid == nproxy)
-	  lmp->error->all(FLERR,
-			  "Cannot use hybrid pair style with kspace proxy");
-	else return;
+        if (tid == nproxy)
+          lmp->error->all(FLERR,
+                          "Cannot use hybrid pair style with kspace proxy");
+        else return;
       }
 
       // this is a non-hybrid pair style. compute per thread fdotr
       if (fix->last_pair_hybrid == NULL) {
-	if (lmp->neighbor->includegroup == 0)
-	  thr->virial_fdotr_compute(x, nlocal, nghost, -1);
-	else
-	  thr->virial_fdotr_compute(x, nlocal, nghost, nfirst);
+        if (lmp->neighbor->includegroup == 0)
+          thr->virial_fdotr_compute(x, nlocal, nghost, -1);
+        else
+          thr->virial_fdotr_compute(x, nlocal, nghost, nfirst);
       }
     }
-    
+
     if (evflag) {
 #if defined(_OPENMP)
 #pragma omp critical
 #endif
       {
-	if (tid < nproxy) {
-	  // nothing to collect for kspace proxy threads
-	  // just reset pair accumulators to 0.0.
-	  if (eflag & 1) {
-	    thr->eng_vdwl = 0.0;
-	    thr->eng_coul = 0.0;
-	  }
-	  if (vflag & 3)
-	    for (int i=0; i < 6; ++i) {
-	      thr->virial_pair[i] = 0.0;
-	    }
-	} else {
-	  if (eflag & 1) {
-	    pair->eng_vdwl += thr->eng_vdwl;
-	    pair->eng_coul += thr->eng_coul;
-	    thr->eng_vdwl = 0.0;
-	    thr->eng_coul = 0.0;
-	  }
-	  if (vflag & 3)
-	    for (int i=0; i < 6; ++i) {
-	      pair->virial[i] += thr->virial_pair[i];
-	      thr->virial_pair[i] = 0.0;
-	    }
-	}
+        if (tid < nproxy) {
+          // nothing to collect for kspace proxy threads
+          // just reset pair accumulators to 0.0.
+          if (eflag & 1) {
+            thr->eng_vdwl = 0.0;
+            thr->eng_coul = 0.0;
+          }
+          if (vflag & 3)
+            for (int i=0; i < 6; ++i) {
+              thr->virial_pair[i] = 0.0;
+            }
+        } else {
+          if (eflag & 1) {
+            pair->eng_vdwl += thr->eng_vdwl;
+            pair->eng_coul += thr->eng_coul;
+            thr->eng_vdwl = 0.0;
+            thr->eng_coul = 0.0;
+          }
+          if (vflag & 3)
+            for (int i=0; i < 6; ++i) {
+              pair->virial[i] += thr->virial_pair[i];
+              thr->virial_pair[i] = 0.0;
+            }
+        }
       }
       if (eflag & 2) {
-	data_reduce_thr(&(pair->eatom[0]), nall, nthreads, 1, tid);
+        data_reduce_thr(&(pair->eatom[0]), nall, nthreads, 1, tid);
       }
       if (vflag & 4) {
-	data_reduce_thr(&(pair->vatom[0][0]), nall, nthreads, 6, tid);
+        data_reduce_thr(&(pair->vatom[0][0]), nall, nthreads, 6, tid);
       }
     }
   }
@@ -284,24 +284,24 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
 #pragma omp critical
 #endif
       {
-	if (eflag & 1) {
-	  bond->energy += thr->eng_bond;
-	  thr->eng_bond = 0.0;
-	}
-
-	if (vflag & 3) {
-	  for (int i=0; i < 6; ++i) {
-	    bond->virial[i] += thr->virial_bond[i];
-	    thr->virial_bond[i] = 0.0;
-	  }
-	}
-
-	if (eflag & 2) {
-	  data_reduce_thr(&(bond->eatom[0]), nall, nthreads, 1, tid);
-	}
-	if (vflag & 4) {
-	  data_reduce_thr(&(bond->vatom[0][0]), nall, nthreads, 6, tid);
-	}
+        if (eflag & 1) {
+          bond->energy += thr->eng_bond;
+          thr->eng_bond = 0.0;
+        }
+
+        if (vflag & 3) {
+          for (int i=0; i < 6; ++i) {
+            bond->virial[i] += thr->virial_bond[i];
+            thr->virial_bond[i] = 0.0;
+          }
+        }
+
+        if (eflag & 2) {
+          data_reduce_thr(&(bond->eatom[0]), nall, nthreads, 1, tid);
+        }
+        if (vflag & 4) {
+          data_reduce_thr(&(bond->vatom[0][0]), nall, nthreads, 6, tid);
+        }
       }
     }
     break;
@@ -314,54 +314,54 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
 #pragma omp critical
 #endif
       {
-	if (eflag & 1) {
-	  angle->energy += thr->eng_angle;
-	  thr->eng_angle = 0.0;
-	}
-
-	if (vflag & 3) {
-	  for (int i=0; i < 6; ++i) {
-	    angle->virial[i] += thr->virial_angle[i];
-	    thr->virial_angle[i] = 0.0;
-	  }
-	}
-
-	if (eflag & 2) {
-	  data_reduce_thr(&(angle->eatom[0]), nall, nthreads, 1, tid);
-	}
-	if (vflag & 4) {
-	  data_reduce_thr(&(angle->vatom[0][0]), nall, nthreads, 6, tid);
-	}
+        if (eflag & 1) {
+          angle->energy += thr->eng_angle;
+          thr->eng_angle = 0.0;
+        }
+
+        if (vflag & 3) {
+          for (int i=0; i < 6; ++i) {
+            angle->virial[i] += thr->virial_angle[i];
+            thr->virial_angle[i] = 0.0;
+          }
+        }
+
+        if (eflag & 2) {
+          data_reduce_thr(&(angle->eatom[0]), nall, nthreads, 1, tid);
+        }
+        if (vflag & 4) {
+          data_reduce_thr(&(angle->vatom[0][0]), nall, nthreads, 6, tid);
+        }
       }
     }
     break;
 
   case THR_DIHEDRAL:
-    
+
     if (evflag) {
       Dihedral * const dihedral = lmp->force->dihedral;
 #if defined(_OPENMP)
 #pragma omp critical
 #endif
       {
-	if (eflag & 1) {
-	  dihedral->energy += thr->eng_dihed;
-	  thr->eng_dihed = 0.0;
-	}
-
-	if (vflag & 3) {
-	  for (int i=0; i < 6; ++i) {
-	    dihedral->virial[i] += thr->virial_dihed[i];
-	    thr->virial_dihed[i] = 0.0;
-	  }
-	}
-
-	if (eflag & 2) {
-	  data_reduce_thr(&(dihedral->eatom[0]), nall, nthreads, 1, tid);
-	}
-	if (vflag & 4) {
-	  data_reduce_thr(&(dihedral->vatom[0][0]), nall, nthreads, 6, tid);
-	}
+        if (eflag & 1) {
+          dihedral->energy += thr->eng_dihed;
+          thr->eng_dihed = 0.0;
+        }
+
+        if (vflag & 3) {
+          for (int i=0; i < 6; ++i) {
+            dihedral->virial[i] += thr->virial_dihed[i];
+            thr->virial_dihed[i] = 0.0;
+          }
+        }
+
+        if (eflag & 2) {
+          data_reduce_thr(&(dihedral->eatom[0]), nall, nthreads, 1, tid);
+        }
+        if (vflag & 4) {
+          data_reduce_thr(&(dihedral->vatom[0][0]), nall, nthreads, 6, tid);
+        }
       }
     }
     break;
@@ -375,32 +375,32 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
 #pragma omp critical
 #endif
       {
-	if (eflag & 1) {
-	  dihedral->energy += thr->eng_dihed;
-	  pair->eng_vdwl += thr->eng_vdwl;
-	  pair->eng_coul += thr->eng_coul;
-	  thr->eng_dihed = 0.0;
-	  thr->eng_vdwl = 0.0;
-	  thr->eng_coul = 0.0;
-	}
-
-	if (vflag & 3) {
-	  for (int i=0; i < 6; ++i) {
-	    dihedral->virial[i] += thr->virial_dihed[i];
-	    pair->virial[i] += thr->virial_pair[i];
-	    thr->virial_dihed[i] = 0.0;
-	    thr->virial_pair[i] = 0.0;
-	  }
-	}
-
-	if (eflag & 2) {
-	  data_reduce_thr(&(dihedral->eatom[0]), nall, nthreads, 1, tid);
-	  data_reduce_thr(&(pair->eatom[0]), nall, nthreads, 1, tid);
-	}
-	if (vflag & 4) {
-	  data_reduce_thr(&(dihedral->vatom[0][0]), nall, nthreads, 6, tid);
-	  data_reduce_thr(&(pair->vatom[0][0]), nall, nthreads, 6, tid);
-	}
+        if (eflag & 1) {
+          dihedral->energy += thr->eng_dihed;
+          pair->eng_vdwl += thr->eng_vdwl;
+          pair->eng_coul += thr->eng_coul;
+          thr->eng_dihed = 0.0;
+          thr->eng_vdwl = 0.0;
+          thr->eng_coul = 0.0;
+        }
+
+        if (vflag & 3) {
+          for (int i=0; i < 6; ++i) {
+            dihedral->virial[i] += thr->virial_dihed[i];
+            pair->virial[i] += thr->virial_pair[i];
+            thr->virial_dihed[i] = 0.0;
+            thr->virial_pair[i] = 0.0;
+          }
+        }
+
+        if (eflag & 2) {
+          data_reduce_thr(&(dihedral->eatom[0]), nall, nthreads, 1, tid);
+          data_reduce_thr(&(pair->eatom[0]), nall, nthreads, 1, tid);
+        }
+        if (vflag & 4) {
+          data_reduce_thr(&(dihedral->vatom[0][0]), nall, nthreads, 6, tid);
+          data_reduce_thr(&(pair->vatom[0][0]), nall, nthreads, 6, tid);
+        }
       }
     }
     break;
@@ -413,24 +413,24 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
 #pragma omp critical
 #endif
       {
-	if (eflag & 1) {
-	  improper->energy += thr->eng_imprp;
-	  thr->eng_imprp = 0.0;
-	}
-
-	if (vflag & 3) {
-	  for (int i=0; i < 6; ++i) {
-	    improper->virial[i] += thr->virial_imprp[i];
-	    thr->virial_imprp[i] = 0.0;
-	  }
-	}
-
-	if (eflag & 2) {
-	  data_reduce_thr(&(improper->eatom[0]), nall, nthreads, 1, tid);
-	}
-	if (vflag & 4) {
-	  data_reduce_thr(&(improper->vatom[0][0]), nall, nthreads, 6, tid);
-	}
+        if (eflag & 1) {
+          improper->energy += thr->eng_imprp;
+          thr->eng_imprp = 0.0;
+        }
+
+        if (vflag & 3) {
+          for (int i=0; i < 6; ++i) {
+            improper->virial[i] += thr->virial_imprp[i];
+            thr->virial_imprp[i] = 0.0;
+          }
+        }
+
+        if (eflag & 2) {
+          data_reduce_thr(&(improper->eatom[0]), nall, nthreads, 1, tid);
+        }
+        if (vflag & 4) {
+          data_reduce_thr(&(improper->vatom[0][0]), nall, nthreads, 6, tid);
+        }
       }
     }
     break;
@@ -444,7 +444,7 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
     printf("tid:%d unhandled thr_style case %d\n", tid, thr_style);
     break;
   }
-    
+
   if (style == fix->last_omp_style) {
     if (need_force_reduce)
       data_reduce_thr(&(f[0][0]), nall, nthreads, 3, tid);
@@ -458,9 +458,9 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
    tally eng_vdwl and eng_coul into per thread global and per-atom accumulators
 ------------------------------------------------------------------------- */
 
-void ThrOMP::e_tally_thr(Pair * const pair, const int i, const int j, 
-			 const int nlocal, const int newton_pair,
-			 const double evdwl, const double ecoul, ThrData * const thr)
+void ThrOMP::e_tally_thr(Pair * const pair, const int i, const int j,
+                         const int nlocal, const int newton_pair,
+                         const double evdwl, const double ecoul, ThrData * const thr)
 {
   if (pair->eflag_global) {
     if (newton_pair) {
@@ -470,12 +470,12 @@ void ThrOMP::e_tally_thr(Pair * const pair, const int i, const int j,
       const double evdwlhalf = 0.5*evdwl;
       const double ecoulhalf = 0.5*ecoul;
       if (i < nlocal) {
-	thr->eng_vdwl += evdwlhalf;
-	thr->eng_coul += ecoulhalf;
+        thr->eng_vdwl += evdwlhalf;
+        thr->eng_coul += ecoulhalf;
       }
       if (j < nlocal) {
-	thr->eng_vdwl += evdwlhalf;
-	thr->eng_coul += ecoulhalf;
+        thr->eng_vdwl += evdwlhalf;
+        thr->eng_coul += ecoulhalf;
       }
     }
   }
@@ -487,7 +487,7 @@ void ThrOMP::e_tally_thr(Pair * const pair, const int i, const int j,
 }
 
 /* helper functions */
-static void v_tally(double * const vout, const double * const vin) 
+static void v_tally(double * const vout, const double * const vin)
 {
   vout[0] += vin[0];
   vout[1] += vin[1];
@@ -497,7 +497,7 @@ static void v_tally(double * const vout, const double * const vin)
   vout[5] += vin[5];
 }
 
-static void v_tally(double * const vout, const double scale, const double * const vin) 
+static void v_tally(double * const vout, const double scale, const double * const vin)
 {
   vout[0] += scale*vin[0];
   vout[1] += scale*vin[1];
@@ -510,9 +510,9 @@ static void v_tally(double * const vout, const double scale, const double * cons
 /* ----------------------------------------------------------------------
    tally virial into per thread global and per-atom accumulators
 ------------------------------------------------------------------------- */
-void ThrOMP::v_tally_thr(Pair * const pair, const int i, const int j, 
-			 const int nlocal, const int newton_pair,
-			 const double * const v, ThrData * const thr)
+void ThrOMP::v_tally_thr(Pair * const pair, const int i, const int j,
+                         const int nlocal, const int newton_pair,
+                         const double * const v, ThrData * const thr)
 {
   if (pair->vflag_global) {
     double * const va = thr->virial_pair;
@@ -542,9 +542,9 @@ void ThrOMP::v_tally_thr(Pair * const pair, const int i, const int j,
 ------------------------------------------------------------------------- */
 
 void ThrOMP::ev_tally_thr(Pair * const pair, const int i, const int j, const int nlocal,
-			  const int newton_pair, const double evdwl, const double ecoul,
-			  const double fpair, const double delx, const double dely,
-			  const double delz, ThrData * const thr)
+                          const int newton_pair, const double evdwl, const double ecoul,
+                          const double fpair, const double delx, const double dely,
+                          const double delz, ThrData * const thr)
 {
 
   if (pair->eflag_either)
@@ -569,11 +569,11 @@ void ThrOMP::ev_tally_thr(Pair * const pair, const int i, const int j, const int
 ------------------------------------------------------------------------- */
 
 void ThrOMP::ev_tally_xyz_thr(Pair * const pair, const int i, const int j,
-			      const int nlocal, const int newton_pair, 
-			      const double evdwl, const double ecoul,
-			      const double fx, const double fy, const double fz,
-			      const double delx, const double dely, const double delz,
-			      ThrData * const thr)
+                              const int nlocal, const int newton_pair,
+                              const double evdwl, const double ecoul,
+                              const double fx, const double fy, const double fz,
+                              const double delx, const double dely, const double delz,
+                              ThrData * const thr)
 {
 
   if (pair->eflag_either)
@@ -599,10 +599,10 @@ void ThrOMP::ev_tally_xyz_thr(Pair * const pair, const int i, const int j,
  ------------------------------------------------------------------------- */
 
 void ThrOMP::ev_tally3_thr(Pair * const pair, const int i, const int j, const int k,
-			   const double evdwl, const double ecoul,
-			   const double * const fj, const double * const fk,
-			   const double * const drji, const double * const drki,
-			   ThrData * const thr)
+                           const double evdwl, const double ecoul,
+                           const double * const fj, const double * const fk,
+                           const double * const drji, const double * const drki,
+                           ThrData * const thr)
 {
   if (pair->eflag_either) {
     if (pair->eflag_global) {
@@ -626,7 +626,7 @@ void ThrOMP::ev_tally3_thr(Pair * const pair, const int i, const int j, const in
     v[3] = drji[0]*fj[1] + drki[0]*fk[1];
     v[4] = drji[0]*fj[2] + drki[0]*fk[2];
     v[5] = drji[1]*fj[2] + drki[1]*fk[2];
-      
+
     if (pair->vflag_global) v_tally(thr->virial_pair,v);
 
     if (pair->vflag_atom) {
@@ -643,11 +643,11 @@ void ThrOMP::ev_tally3_thr(Pair * const pair, const int i, const int j, const in
  ------------------------------------------------------------------------- */
 
 void ThrOMP::ev_tally4_thr(Pair * const pair, const int i, const int j,
-			   const int k, const int m, const double evdwl,
-			   const double * const fi, const double * const fj,
-			   const double * const fk, const double * const drim,
-			   const double * const drjm, const double * const drkm,
-			   ThrData * const thr)
+                           const int k, const int m, const double evdwl,
+                           const double * const fi, const double * const fj,
+                           const double * const fk, const double * const drim,
+                           const double * const drjm, const double * const drkm,
+                           ThrData * const thr)
 {
   double v[6];
 
@@ -669,7 +669,7 @@ void ThrOMP::ev_tally4_thr(Pair * const pair, const int i, const int j,
     v[3] = 0.25 * (drim[0]*fi[1] + drjm[0]*fj[1] + drkm[0]*fk[1]);
     v[4] = 0.25 * (drim[0]*fi[2] + drjm[0]*fj[2] + drkm[0]*fk[2]);
     v[5] = 0.25 * (drim[1]*fi[2] + drjm[1]*fj[2] + drkm[1]*fk[2]);
-    
+
     v_tally(thr->vatom_pair[i],v);
     v_tally(thr->vatom_pair[j],v);
     v_tally(thr->vatom_pair[k],v);
@@ -684,8 +684,8 @@ void ThrOMP::ev_tally4_thr(Pair * const pair, const int i, const int j,
  ------------------------------------------------------------------------- */
 
 void ThrOMP::ev_tally_list_thr(Pair * const pair, const int n,
-			       const int * const list, const double ecoul,
-			       const double * const v, ThrData * const thr)
+                               const int * const list, const double ecoul,
+                               const double * const v, ThrData * const thr)
 {
   if (pair->eflag_either) {
     if (pair->eflag_global) thr->eng_coul += ecoul;
@@ -711,8 +711,8 @@ void ThrOMP::ev_tally_list_thr(Pair * const pair, const int n,
       vtmp[5] = s * v[5];
 
       for (int i = 0; i < n; i++) {
-	const int j = list[i];
-	v_tally(thr->vatom_pair[j],vtmp);
+        const int j = list[i];
+        v_tally(thr->vatom_pair[j],vtmp);
       }
     }
   }
@@ -723,27 +723,27 @@ void ThrOMP::ev_tally_list_thr(Pair * const pair, const int n,
 ------------------------------------------------------------------------- */
 
 void ThrOMP::ev_tally_thr(Bond * const bond, const int i, const int j, const int nlocal,
-			  const int newton_bond, const double ebond, const double fbond,
-			  const double delx, const double dely, const double delz,
-			  ThrData * const thr)
+                          const int newton_bond, const double ebond, const double fbond,
+                          const double delx, const double dely, const double delz,
+                          ThrData * const thr)
 {
   if (bond->eflag_either) {
     const double ebondhalf = 0.5*ebond;
     if (newton_bond) {
       if (bond->eflag_global)
-	thr->eng_bond += ebond;
+        thr->eng_bond += ebond;
       if (bond->eflag_atom) {
-	thr->eatom_bond[i] += ebondhalf;
-	thr->eatom_bond[j] += ebondhalf;
+        thr->eatom_bond[i] += ebondhalf;
+        thr->eatom_bond[j] += ebondhalf;
       }
     } else {
       if (bond->eflag_global) {
-	if (i < nlocal) thr->eng_bond += ebondhalf;
-	if (j < nlocal) thr->eng_bond += ebondhalf;
+        if (i < nlocal) thr->eng_bond += ebondhalf;
+        if (j < nlocal) thr->eng_bond += ebondhalf;
       }
       if (bond->eflag_atom) {
-	if (i < nlocal) thr->eatom_bond[i] += ebondhalf;
-	if (j < nlocal) thr->eatom_bond[j] += ebondhalf;
+        if (i < nlocal) thr->eatom_bond[i] += ebondhalf;
+        if (j < nlocal) thr->eatom_bond[j] += ebondhalf;
       }
     }
   }
@@ -760,12 +760,12 @@ void ThrOMP::ev_tally_thr(Bond * const bond, const int i, const int j, const int
 
     if (bond->vflag_global) {
       if (newton_bond)
-	v_tally(thr->virial_bond,v);
+        v_tally(thr->virial_bond,v);
       else {
-	if (i < nlocal)
-	  v_tally(thr->virial_bond,0.5,v);
-	if (j < nlocal)
-	  v_tally(thr->virial_bond,0.5,v);
+        if (i < nlocal)
+          v_tally(thr->virial_bond,0.5,v);
+        if (j < nlocal)
+          v_tally(thr->virial_bond,0.5,v);
       }
     }
 
@@ -778,13 +778,13 @@ void ThrOMP::ev_tally_thr(Bond * const bond, const int i, const int j, const int
       v[5] *= 0.5;
 
       if (newton_bond) {
-	v_tally(thr->vatom_bond[i],v);
-	v_tally(thr->vatom_bond[j],v);
+        v_tally(thr->vatom_bond[i],v);
+        v_tally(thr->vatom_bond[j],v);
       } else {
-	if (j < nlocal)
-	  v_tally(thr->vatom_bond[i],v);
-	if (j < nlocal)
-	  v_tally(thr->vatom_bond[j],v);
+        if (j < nlocal)
+          v_tally(thr->vatom_bond[i],v);
+        if (j < nlocal)
+          v_tally(thr->vatom_bond[j],v);
       }
     }
   }
@@ -796,32 +796,32 @@ void ThrOMP::ev_tally_thr(Bond * const bond, const int i, const int j, const int
 ------------------------------------------------------------------------- */
 
 void ThrOMP::ev_tally_thr(Angle * const angle, const int i, const int j, const int k,
-			  const int nlocal, const int newton_bond, const double eangle,
-			  const double * const f1, const double * const f3,
-			  const double delx1, const double dely1, const double delz1,
-			  const double delx2, const double dely2, const double delz2,
-			  ThrData * const thr)
+                          const int nlocal, const int newton_bond, const double eangle,
+                          const double * const f1, const double * const f3,
+                          const double delx1, const double dely1, const double delz1,
+                          const double delx2, const double dely2, const double delz2,
+                          ThrData * const thr)
 {
   if (angle->eflag_either) {
     const double eanglethird = THIRD*eangle;
     if (newton_bond) {
       if (angle->eflag_global)
-	thr->eng_angle += eangle;
+        thr->eng_angle += eangle;
       if (angle->eflag_atom) {
-	thr->eatom_angle[i] += eanglethird;
-	thr->eatom_angle[j] += eanglethird;
-	thr->eatom_angle[k] += eanglethird;
+        thr->eatom_angle[i] += eanglethird;
+        thr->eatom_angle[j] += eanglethird;
+        thr->eatom_angle[k] += eanglethird;
       }
     } else {
       if (angle->eflag_global) {
-	if (i < nlocal) thr->eng_angle += eanglethird;
-	if (j < nlocal) thr->eng_angle += eanglethird;
-	if (k < nlocal) thr->eng_angle += eanglethird;
+        if (i < nlocal) thr->eng_angle += eanglethird;
+        if (j < nlocal) thr->eng_angle += eanglethird;
+        if (k < nlocal) thr->eng_angle += eanglethird;
       }
       if (angle->eflag_atom) {
-	if (i < nlocal) thr->eatom_angle[i] += eanglethird;
-	if (j < nlocal) thr->eatom_angle[j] += eanglethird;
-	if (k < nlocal) thr->eatom_angle[k] += eanglethird;
+        if (i < nlocal) thr->eatom_angle[i] += eanglethird;
+        if (j < nlocal) thr->eatom_angle[j] += eanglethird;
+        if (k < nlocal) thr->eatom_angle[k] += eanglethird;
       }
     }
   }
@@ -838,13 +838,13 @@ void ThrOMP::ev_tally_thr(Angle * const angle, const int i, const int j, const i
 
     if (angle->vflag_global) {
       if (newton_bond) {
-	v_tally(thr->virial_angle,v);
+        v_tally(thr->virial_angle,v);
       } else {
-	int cnt = 0;
-	if (i < nlocal) ++cnt;
-	if (j < nlocal) ++cnt;
-	if (k < nlocal) ++cnt;
-	v_tally(thr->virial_angle,cnt*THIRD,v);
+        int cnt = 0;
+        if (i < nlocal) ++cnt;
+        if (j < nlocal) ++cnt;
+        if (k < nlocal) ++cnt;
+        v_tally(thr->virial_angle,cnt*THIRD,v);
       }
     }
 
@@ -857,13 +857,13 @@ void ThrOMP::ev_tally_thr(Angle * const angle, const int i, const int j, const i
       v[5] *= THIRD;
 
       if (newton_bond) {
-	v_tally(thr->vatom_angle[i],v);
-	v_tally(thr->vatom_angle[j],v);
-	v_tally(thr->vatom_angle[k],v);
+        v_tally(thr->vatom_angle[i],v);
+        v_tally(thr->vatom_angle[j],v);
+        v_tally(thr->vatom_angle[k],v);
       } else {
-	if (j < nlocal) v_tally(thr->vatom_angle[i],v);
-	if (j < nlocal) v_tally(thr->vatom_angle[j],v);
-	if (k < nlocal) v_tally(thr->vatom_angle[k],v);
+        if (j < nlocal) v_tally(thr->vatom_angle[i],v);
+        if (j < nlocal) v_tally(thr->vatom_angle[j],v);
+        if (k < nlocal) v_tally(thr->vatom_angle[k],v);
       }
     }
   }
@@ -874,10 +874,10 @@ void ThrOMP::ev_tally_thr(Angle * const angle, const int i, const int j, const i
 ------------------------------------------------------------------------- */
 
 void ThrOMP::ev_tally13_thr(Angle * const angle, const int i1, const int i3,
-			    const int nlocal, const int newton_bond,
-			    const double epair, const double fpair,
-			    const double delx, const double dely,
-			    const double delz, ThrData * const thr)
+                            const int nlocal, const int newton_bond,
+                            const double epair, const double fpair,
+                            const double delx, const double dely,
+                            const double delz, ThrData * const thr)
 {
 
   if (angle->eflag_either) {
@@ -885,9 +885,9 @@ void ThrOMP::ev_tally13_thr(Angle * const angle, const int i1, const int i3,
 
     if (angle->eflag_global) {
       if (newton_bond || i1 < nlocal)
-	thr->eng_angle += epairhalf;
+        thr->eng_angle += epairhalf;
       if (newton_bond || i3 < nlocal)
-	thr->eng_angle += epairhalf;
+        thr->eng_angle += epairhalf;
     }
 
     if (angle->eflag_atom) {
@@ -895,7 +895,7 @@ void ThrOMP::ev_tally13_thr(Angle * const angle, const int i1, const int i3,
       if (newton_bond || i3 < nlocal) thr->eatom_angle[i3] += epairhalf;
     }
   }
-  
+
   if (angle->vflag_either) {
     double v[6];
     v[0] = delx*delx*fpair;
@@ -913,15 +913,15 @@ void ThrOMP::ev_tally13_thr(Angle * const angle, const int i1, const int i3,
 
     if (angle->vflag_atom) {
       if (newton_bond || i1 < nlocal) {
-	double * const va = thr->vatom_angle[i1];
-	v_tally(va,0.5,v);
+        double * const va = thr->vatom_angle[i1];
+        v_tally(va,0.5,v);
       }
       if (newton_bond || i3 < nlocal) {
-	double * const va = thr->vatom_angle[i3];
-	v_tally(va,0.5,v);
+        double * const va = thr->vatom_angle[i3];
+        v_tally(va,0.5,v);
       }
     }
-  }  
+  }
 }
 
 
@@ -929,45 +929,45 @@ void ThrOMP::ev_tally13_thr(Angle * const angle, const int i1, const int i3,
    tally energy and virial into global and per-atom accumulators
    virial = r1F1 + r2F2 + r3F3 + r4F4 = (r1-r2) F1 + (r3-r2) F3 + (r4-r2) F4
           = (r1-r2) F1 + (r3-r2) F3 + (r4-r3 + r3-r2) F4
-	  = vb1*f1 + vb2*f3 + (vb3+vb2)*f4
+          = vb1*f1 + vb2*f3 + (vb3+vb2)*f4
 ------------------------------------------------------------------------- */
 
 void ThrOMP::ev_tally_thr(Dihedral * const dihed, const int i1, const int i2,
-			  const int i3, const int i4, const int nlocal,
-			  const int newton_bond, const double edihedral,
-			  const double * const f1, const double * const f3,
-			  const double * const f4, const double vb1x,
-			  const double vb1y, const double vb1z, const double vb2x,
-			  const double vb2y, const double vb2z, const double vb3x,
-			  const double vb3y, const double vb3z, ThrData * const thr)
+                          const int i3, const int i4, const int nlocal,
+                          const int newton_bond, const double edihedral,
+                          const double * const f1, const double * const f3,
+                          const double * const f4, const double vb1x,
+                          const double vb1y, const double vb1z, const double vb2x,
+                          const double vb2y, const double vb2z, const double vb3x,
+                          const double vb3y, const double vb3z, ThrData * const thr)
 {
 
   if (dihed->eflag_either) {
     if (dihed->eflag_global) {
       if (newton_bond) {
-	thr->eng_dihed += edihedral;
+        thr->eng_dihed += edihedral;
       } else {
-	const double edihedralquarter = 0.25*edihedral;
-	int cnt = 0;
-	if (i1 < nlocal) ++cnt;
-	if (i2 < nlocal) ++cnt;
-	if (i3 < nlocal) ++cnt;
-	if (i4 < nlocal) ++cnt;
-	thr->eng_dihed += static_cast<double>(cnt)*edihedralquarter;
+        const double edihedralquarter = 0.25*edihedral;
+        int cnt = 0;
+        if (i1 < nlocal) ++cnt;
+        if (i2 < nlocal) ++cnt;
+        if (i3 < nlocal) ++cnt;
+        if (i4 < nlocal) ++cnt;
+        thr->eng_dihed += static_cast<double>(cnt)*edihedralquarter;
       }
     }
     if (dihed->eflag_atom) {
       const double edihedralquarter = 0.25*edihedral;
       if (newton_bond) {
-	thr->eatom_dihed[i1] += edihedralquarter;
-	thr->eatom_dihed[i2] += edihedralquarter;
-	thr->eatom_dihed[i3] += edihedralquarter;
-	thr->eatom_dihed[i4] += edihedralquarter;
+        thr->eatom_dihed[i1] += edihedralquarter;
+        thr->eatom_dihed[i2] += edihedralquarter;
+        thr->eatom_dihed[i3] += edihedralquarter;
+        thr->eatom_dihed[i4] += edihedralquarter;
       } else {
-	if (i1 < nlocal) thr->eatom_dihed[i1] +=  edihedralquarter;
-	if (i2 < nlocal) thr->eatom_dihed[i2] +=  edihedralquarter;
-	if (i3 < nlocal) thr->eatom_dihed[i3] +=  edihedralquarter;
-	if (i4 < nlocal) thr->eatom_dihed[i4] +=  edihedralquarter;
+        if (i1 < nlocal) thr->eatom_dihed[i1] +=  edihedralquarter;
+        if (i2 < nlocal) thr->eatom_dihed[i2] +=  edihedralquarter;
+        if (i3 < nlocal) thr->eatom_dihed[i3] +=  edihedralquarter;
+        if (i4 < nlocal) thr->eatom_dihed[i4] +=  edihedralquarter;
       }
     }
   }
@@ -983,14 +983,14 @@ void ThrOMP::ev_tally_thr(Dihedral * const dihed, const int i1, const int i2,
 
     if (dihed->vflag_global) {
       if (newton_bond) {
-	v_tally(thr->virial_dihed,v);
+        v_tally(thr->virial_dihed,v);
       } else {
-	int cnt = 0;
-	if (i1 < nlocal) ++cnt;
-	if (i2 < nlocal) ++cnt;
-	if (i3 < nlocal) ++cnt;
-	if (i4 < nlocal) ++cnt;
-	v_tally(thr->virial_dihed,0.25*static_cast<double>(cnt),v);
+        int cnt = 0;
+        if (i1 < nlocal) ++cnt;
+        if (i2 < nlocal) ++cnt;
+        if (i3 < nlocal) ++cnt;
+        if (i4 < nlocal) ++cnt;
+        v_tally(thr->virial_dihed,0.25*static_cast<double>(cnt),v);
       }
     }
 
@@ -1000,18 +1000,18 @@ void ThrOMP::ev_tally_thr(Dihedral * const dihed, const int i1, const int i2,
     v[3] *= 0.25;
     v[4] *= 0.25;
     v[5] *= 0.25;
-    
+
     if (dihed->vflag_atom) {
       if (newton_bond) {
-	v_tally(thr->vatom_dihed[i1],v);
-	v_tally(thr->vatom_dihed[i2],v);
-	v_tally(thr->vatom_dihed[i3],v);
-	v_tally(thr->vatom_dihed[i4],v);
+        v_tally(thr->vatom_dihed[i1],v);
+        v_tally(thr->vatom_dihed[i2],v);
+        v_tally(thr->vatom_dihed[i3],v);
+        v_tally(thr->vatom_dihed[i4],v);
       } else {
-	if (i1 < nlocal) v_tally(thr->vatom_dihed[i1],v);
-	if (i2 < nlocal) v_tally(thr->vatom_dihed[i2],v);
-	if (i3 < nlocal) v_tally(thr->vatom_dihed[i3],v);
-	if (i4 < nlocal) v_tally(thr->vatom_dihed[i4],v);
+        if (i1 < nlocal) v_tally(thr->vatom_dihed[i1],v);
+        if (i2 < nlocal) v_tally(thr->vatom_dihed[i2],v);
+        if (i3 < nlocal) v_tally(thr->vatom_dihed[i3],v);
+        if (i4 < nlocal) v_tally(thr->vatom_dihed[i4],v);
       }
     }
   }
@@ -1021,45 +1021,45 @@ void ThrOMP::ev_tally_thr(Dihedral * const dihed, const int i1, const int i2,
    tally energy and virial into global and per-atom accumulators
    virial = r1F1 + r2F2 + r3F3 + r4F4 = (r1-r2) F1 + (r3-r2) F3 + (r4-r2) F4
           = (r1-r2) F1 + (r3-r2) F3 + (r4-r3 + r3-r2) F4
-	  = vb1*f1 + vb2*f3 + (vb3+vb2)*f4
+          = vb1*f1 + vb2*f3 + (vb3+vb2)*f4
 ------------------------------------------------------------------------- */
 
 void ThrOMP::ev_tally_thr(Improper * const imprp, const int i1, const int i2,
-			  const int i3, const int i4, const int nlocal,
-			  const int newton_bond, const double eimproper,
-			  const double * const f1, const double * const f3,
-			  const double * const f4, const double vb1x,
-			  const double vb1y, const double vb1z, const double vb2x,
-			  const double vb2y, const double vb2z, const double vb3x,
-			  const double vb3y, const double vb3z, ThrData * const thr)
+                          const int i3, const int i4, const int nlocal,
+                          const int newton_bond, const double eimproper,
+                          const double * const f1, const double * const f3,
+                          const double * const f4, const double vb1x,
+                          const double vb1y, const double vb1z, const double vb2x,
+                          const double vb2y, const double vb2z, const double vb3x,
+                          const double vb3y, const double vb3z, ThrData * const thr)
 {
 
   if (imprp->eflag_either) {
     if (imprp->eflag_global) {
       if (newton_bond) {
-	thr->eng_imprp += eimproper;
+        thr->eng_imprp += eimproper;
       } else {
-	const double eimproperquarter = 0.25*eimproper;
-	int cnt = 0;
-	if (i1 < nlocal) ++cnt;
-	if (i2 < nlocal) ++cnt;
-	if (i3 < nlocal) ++cnt;
-	if (i4 < nlocal) ++cnt;
-	thr->eng_imprp += static_cast<double>(cnt)*eimproperquarter;
+        const double eimproperquarter = 0.25*eimproper;
+        int cnt = 0;
+        if (i1 < nlocal) ++cnt;
+        if (i2 < nlocal) ++cnt;
+        if (i3 < nlocal) ++cnt;
+        if (i4 < nlocal) ++cnt;
+        thr->eng_imprp += static_cast<double>(cnt)*eimproperquarter;
       }
     }
     if (imprp->eflag_atom) {
       const double eimproperquarter = 0.25*eimproper;
       if (newton_bond) {
-	thr->eatom_imprp[i1] += eimproperquarter;
-	thr->eatom_imprp[i2] += eimproperquarter;
-	thr->eatom_imprp[i3] += eimproperquarter;
-	thr->eatom_imprp[i4] += eimproperquarter;
+        thr->eatom_imprp[i1] += eimproperquarter;
+        thr->eatom_imprp[i2] += eimproperquarter;
+        thr->eatom_imprp[i3] += eimproperquarter;
+        thr->eatom_imprp[i4] += eimproperquarter;
       } else {
-	if (i1 < nlocal) thr->eatom_imprp[i1] +=  eimproperquarter;
-	if (i2 < nlocal) thr->eatom_imprp[i2] +=  eimproperquarter;
-	if (i3 < nlocal) thr->eatom_imprp[i3] +=  eimproperquarter;
-	if (i4 < nlocal) thr->eatom_imprp[i4] +=  eimproperquarter;
+        if (i1 < nlocal) thr->eatom_imprp[i1] +=  eimproperquarter;
+        if (i2 < nlocal) thr->eatom_imprp[i2] +=  eimproperquarter;
+        if (i3 < nlocal) thr->eatom_imprp[i3] +=  eimproperquarter;
+        if (i4 < nlocal) thr->eatom_imprp[i4] +=  eimproperquarter;
       }
     }
   }
@@ -1075,14 +1075,14 @@ void ThrOMP::ev_tally_thr(Improper * const imprp, const int i1, const int i2,
 
     if (imprp->vflag_global) {
       if (newton_bond) {
-	v_tally(thr->virial_imprp,v);
+        v_tally(thr->virial_imprp,v);
       } else {
-	int cnt = 0;
-	if (i1 < nlocal) ++cnt;
-	if (i2 < nlocal) ++cnt;
-	if (i3 < nlocal) ++cnt;
-	if (i4 < nlocal) ++cnt;
-	v_tally(thr->virial_imprp,0.25*static_cast<double>(cnt),v);
+        int cnt = 0;
+        if (i1 < nlocal) ++cnt;
+        if (i2 < nlocal) ++cnt;
+        if (i3 < nlocal) ++cnt;
+        if (i4 < nlocal) ++cnt;
+        v_tally(thr->virial_imprp,0.25*static_cast<double>(cnt),v);
       }
     }
 
@@ -1092,18 +1092,18 @@ void ThrOMP::ev_tally_thr(Improper * const imprp, const int i1, const int i2,
     v[3] *= 0.25;
     v[4] *= 0.25;
     v[5] *= 0.25;
-    
+
     if (imprp->vflag_atom) {
       if (newton_bond) {
-	v_tally(thr->vatom_imprp[i1],v);
-	v_tally(thr->vatom_imprp[i2],v);
-	v_tally(thr->vatom_imprp[i3],v);
-	v_tally(thr->vatom_imprp[i4],v);
+        v_tally(thr->vatom_imprp[i1],v);
+        v_tally(thr->vatom_imprp[i2],v);
+        v_tally(thr->vatom_imprp[i3],v);
+        v_tally(thr->vatom_imprp[i4],v);
       } else {
-	if (i1 < nlocal) v_tally(thr->vatom_imprp[i1],v);
-	if (i2 < nlocal) v_tally(thr->vatom_imprp[i2],v);
-	if (i3 < nlocal) v_tally(thr->vatom_imprp[i3],v);
-	if (i4 < nlocal) v_tally(thr->vatom_imprp[i4],v);
+        if (i1 < nlocal) v_tally(thr->vatom_imprp[i1],v);
+        if (i2 < nlocal) v_tally(thr->vatom_imprp[i2],v);
+        if (i3 < nlocal) v_tally(thr->vatom_imprp[i3],v);
+        if (i4 < nlocal) v_tally(thr->vatom_imprp[i4],v);
       }
     }
   }
@@ -1116,10 +1116,10 @@ void ThrOMP::ev_tally_thr(Improper * const imprp, const int i1, const int i2,
 ------------------------------------------------------------------------- */
 
 void ThrOMP::v_tally2_thr(const int i, const int j, const double fpair,
-			  const double * const drij, ThrData * const thr)
+                          const double * const drij, ThrData * const thr)
 {
   double v[6];
-  
+
   v[0] = 0.5 * drij[0]*drij[0]*fpair;
   v[1] = 0.5 * drij[1]*drij[1]*fpair;
   v[2] = 0.5 * drij[2]*drij[2]*fpair;
@@ -1137,12 +1137,12 @@ void ThrOMP::v_tally2_thr(const int i, const int j, const double fpair,
 ------------------------------------------------------------------------- */
 
 void ThrOMP::v_tally3_thr(const int i, const int j, const int k,
-			  const double * const fi, const double * const fj,
-			  const double * const drik, const double * const drjk,
-			  ThrData * const thr)
+                          const double * const fi, const double * const fj,
+                          const double * const drik, const double * const drjk,
+                          ThrData * const thr)
 {
   double v[6];
-  
+
   v[0] = THIRD * (drik[0]*fi[0] + drjk[0]*fj[0]);
   v[1] = THIRD * (drik[1]*fi[1] + drjk[1]*fj[1]);
   v[2] = THIRD * (drik[2]*fi[2] + drjk[2]*fj[2]);
@@ -1161,10 +1161,10 @@ void ThrOMP::v_tally3_thr(const int i, const int j, const int k,
 ------------------------------------------------------------------------- */
 
 void ThrOMP::v_tally4_thr(const int i, const int j, const int k, const int m,
-			  const double * const fi, const double * const fj,
-			  const double * const fk, const double * const drim,
-			  const double * const drjm, const double * const drkm,
-			  ThrData * const thr)
+                          const double * const fi, const double * const fj,
+                          const double * const fk, const double * const drim,
+                          const double * const drjm, const double * const drkm,
+                          ThrData * const thr)
 {
   double v[6];
 
@@ -1183,9 +1183,9 @@ void ThrOMP::v_tally4_thr(const int i, const int j, const int k, const int m,
 
 /* ---------------------------------------------------------------------- */
 
-double ThrOMP::memory_usage_thr() 
+double ThrOMP::memory_usage_thr()
 {
   double bytes=0.0;
-  
+
   return bytes;
 }
diff --git a/src/USER-OMP/thr_omp.h b/src/USER-OMP/thr_omp.h
index 72fc330cb4..19e50031f8 100644
--- a/src/USER-OMP/thr_omp.h
+++ b/src/USER-OMP/thr_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -57,21 +57,21 @@ class ThrOMP {
     };
 
   enum {THR_NONE=0,THR_PAIR=1,THR_BOND=1<<1,THR_ANGLE=1<<2,
-	THR_DIHEDRAL=1<<3,THR_IMPROPER=1<<4,THR_KSPACE=1<<5,
-	THR_CHARMM=1<<6,THR_PROXY=1<<7,THR_HYBRID=1<<8,THR_FIX=1<<9};
+        THR_DIHEDRAL=1<<3,THR_IMPROPER=1<<4,THR_KSPACE=1<<5,
+        THR_CHARMM=1<<6,THR_PROXY=1<<7,THR_HYBRID=1<<8,THR_FIX=1<<9};
 
  protected:
   // extra ev_tally setup work for threaded styles
   void ev_setup_thr(int, int, int, double *, double **, ThrData *);
 
   // compute global per thread virial contribution from per-thread force
-  void virial_fdotr_compute_thr(double * const, const double * const * const, 
-				const double * const * const,
-				const int, const int, const int);
+  void virial_fdotr_compute_thr(double * const, const double * const * const,
+                                const double * const * const,
+                                const int, const int, const int);
 
   // reduce per thread data as needed
   void reduce_thr(void * const style, const int eflag, const int vflag,
-		  ThrData * const thr, const int nproxy=0);
+                  ThrData * const thr, const int nproxy=0);
 
   // thread safe variant error abort support.
   // signals an error condition in any thread by making
@@ -82,7 +82,7 @@ class ThrOMP {
   // use return value to jump/return to end of threaded region.
 
   bool check_error_thr(const bool cond, const int tid, const char *fname,
-		       const int line, const char *errmsg) {
+                       const int line, const char *errmsg) {
     if (cond) {
 #if defined(_OPENMP)
 #pragma omp atomic
@@ -92,8 +92,8 @@ class ThrOMP {
       else lmp->error->one(fname,line,errmsg);
     } else {
       if (thr_error > 0) {
-	if (tid == 0) lmp->error->one(fname,line,errmsg);
-	else return true;
+        if (tid == 0) lmp->error->one(fname,line,errmsg);
+        else return true;
       } else return false;
     }
     return false;
@@ -106,68 +106,68 @@ class ThrOMP {
 
   // Pair
   void e_tally_thr(Pair * const, const int, const int, const int,
-		   const int, const double, const double, ThrData * const);
+                   const int, const double, const double, ThrData * const);
   void v_tally_thr(Pair * const, const int, const int, const int,
-		   const int, const double * const, ThrData * const);
+                   const int, const double * const, ThrData * const);
 
   void ev_tally_thr(Pair * const, const int, const int, const int, const int,
-		    const double, const double, const double, const double,
-		    const double, const double, ThrData * const);
+                    const double, const double, const double, const double,
+                    const double, const double, ThrData * const);
   void ev_tally_xyz_thr(Pair * const, const int, const int, const int,
-			const int, const double, const double, const double,
-			const double, const double, const double,
-			const double, const double, ThrData * const);
+                        const int, const double, const double, const double,
+                        const double, const double, const double,
+                        const double, const double, ThrData * const);
   void ev_tally3_thr(Pair * const, const int, const int, const int, const double,
-		     const double, const double * const, const double * const,
-		     const double * const, const double * const, ThrData * const);
+                     const double, const double * const, const double * const,
+                     const double * const, const double * const, ThrData * const);
   void ev_tally4_thr(Pair * const, const int, const int, const int, const int,
-		     const double, const double * const, const double * const,
-		     const double * const, const double * const, const double * const,
-		     const double * const, ThrData * const);
+                     const double, const double * const, const double * const,
+                     const double * const, const double * const, const double * const,
+                     const double * const, ThrData * const);
 
   // Bond
   void ev_tally_thr(Bond * const, const int, const int, const int, const int,
-		    const double, const double, const double, const double,
-		    const double, ThrData * const);
+                    const double, const double, const double, const double,
+                    const double, ThrData * const);
 
   // Angle
   void ev_tally_thr(Angle * const, const int, const int, const int, const int, const int,
-		    const double, const double * const, const double * const,
-		    const double, const double, const double, const double, const double,
-		    const double, ThrData * const thr);
+                    const double, const double * const, const double * const,
+                    const double, const double, const double, const double, const double,
+                    const double, ThrData * const thr);
   void ev_tally13_thr(Angle * const, const int, const int, const int, const int,
-		      const double, const double, const double, const double,
-		      const double, ThrData * const thr);
+                      const double, const double, const double, const double,
+                      const double, ThrData * const thr);
 
   // Dihedral
   void ev_tally_thr(Dihedral * const, const int, const int, const int, const int, const int,
-		    const int, const double, const double * const, const double * const,
-		    const double * const, const double, const double, const double,
-		    const double, const double, const double, const double, const double,
-		    const double, ThrData * const);
+                    const int, const double, const double * const, const double * const,
+                    const double * const, const double, const double, const double,
+                    const double, const double, const double, const double, const double,
+                    const double, ThrData * const);
 
   // Improper
   void ev_tally_thr(Improper * const, const int, const int, const int, const int, const int,
-		    const int, const double, const double * const, const double * const,
-		    const double * const, const double, const double, const double,
-		    const double, const double, const double, const double, const double,
-		    const double, ThrData * const);
+                    const int, const double, const double * const, const double * const,
+                    const double * const, const double, const double, const double,
+                    const double, const double, const double, const double, const double,
+                    const double, ThrData * const);
 
   // style independent versions
   void v_tally2_thr(const int, const int, const double, const double * const, ThrData * const);
   void v_tally3_thr(const int, const int, const int, const double * const, const double * const,
-		    const double * const, const double * const, ThrData * const);
+                    const double * const, const double * const, ThrData * const);
   void v_tally4_thr(const int, const int, const int, const int, const double * const,
-		    const double * const, const double * const, const double * const,
-		    const double * const, const double * const, ThrData * const);
+                    const double * const, const double * const, const double * const,
+                    const double * const, const double * const, ThrData * const);
   void ev_tally_list_thr(Pair * const, const int, const int * const,
-			 const double , const double * const , ThrData * const);
+                         const double , const double * const , ThrData * const);
 
 };
 
 // set loop range thread id, and force array offset for threaded runs.
 static inline void loop_setup_thr(int &ifrom, int &ito, int &tid,
-				  int inum, int nthreads, int nproxy=0)
+                                  int inum, int nthreads, int nproxy=0)
 {
 #if defined(_OPENMP)
   tid = omp_get_thread_num();
diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp
index cde118fa33..b61c149002 100644
--- a/src/USER-REAXC/fix_qeq_reax.cpp
+++ b/src/USER-REAXC/fix_qeq_reax.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -53,11 +53,11 @@ using namespace FixConst;
 
 /* ---------------------------------------------------------------------- */
 
-FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : 
+FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
-  if (narg != 8) error->all(FLERR,"Illegal fix qeq/reax command"); 
-  
+  if (narg != 8) error->all(FLERR,"Illegal fix qeq/reax command");
+
   nevery = atoi(arg[3]);
   swa = atof(arg[4]);
   swb = atof(arg[5]);
@@ -73,7 +73,7 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) :
   s = NULL;
   t = NULL;
   nprev = 5;
-  
+
   Hdia_inv = NULL;
   b_s = NULL;
   b_t = NULL;
@@ -111,7 +111,7 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) :
 FixQEqReax::~FixQEqReax()
 {
   // unregister callbacks to this fix from Atom class
- 
+
   atom->delete_callback(id,0);
 
   memory->destroy(s_hist);
@@ -153,7 +153,7 @@ void FixQEqReax::pertype_parameters(char *arg)
     gamma = (double *) pair->extract("gamma",tmp);
     if (chi == NULL || eta == NULL || gamma == NULL)
       error->all(FLERR,
-		 "Fix qeq/reax could not extract params from pair reax/c");
+                 "Fix qeq/reax could not extract params from pair reax/c");
     return;
   }
 
@@ -171,11 +171,11 @@ void FixQEqReax::pertype_parameters(char *arg)
   if (comm->me == 0) {
     if ((pf = fopen(arg,"r")) == NULL)
       error->one(FLERR,"Fix qeq/reax parameter file could not be found");
-    
+
     for (i = 1; i <= ntypes && !feof(pf); i++) {
       fscanf(pf,"%d %lg %lg %lg",&itype,&v1,&v2,&v3);
       if (itype < 1 || itype > ntypes)
-	error->one(FLERR,"Fix qeq/reax invalid atom type in param file");
+        error->one(FLERR,"Fix qeq/reax invalid atom type in param file");
       chi[itype] = v1;
       eta[itype] = v2;
       gamma[itype] = v3;
@@ -255,7 +255,7 @@ void FixQEqReax::allocate_matrix()
     m += list->numneigh[i];
   }
   m_cap = MAX( (int)(m * SAFE_ZONE), MIN_CAP * MIN_NBRS );
-  
+
   H.n = n_cap;
   H.m = m_cap;
   memory->create(H.firstnbr,n_cap,"qeq:H.firstnbr");
@@ -271,7 +271,7 @@ void FixQEqReax::deallocate_matrix()
   memory->destroy( H.firstnbr );
   memory->destroy( H.numnbrs );
   memory->destroy( H.jlist );
-  memory->destroy( H.val ); 
+  memory->destroy( H.val );
 }
 
 /* ---------------------------------------------------------------------- */
@@ -287,7 +287,7 @@ void FixQEqReax::reallocate_matrix()
 void FixQEqReax::init()
 {
   if (!atom->q_flag) error->all(FLERR,"Fix qeq/reax requires atom attribute q");
-	
+
   // need a half neighbor list w/ Newton off
   // built whenever re-neighboring occurs
 
@@ -319,7 +319,7 @@ void FixQEqReax::init_shielding()
 
   ntypes = atom->ntypes;
   memory->create(shld,ntypes+1,ntypes+1,"qeq:shileding");
-  
+
   for( i = 1; i <= ntypes; ++i )
     for( j = 1; j <= ntypes; ++j )
       shld[i][j] = pow( gamma[i] * gamma[j], -1.5 );
@@ -351,7 +351,7 @@ void FixQEqReax::init_taper()
   Tap[2] =-210.0 * (swa3*swb2 + swa2*swb3) / d7;
   Tap[1] = 140.0 * swa3 * swb3 / d7;
   Tap[0] = (-35.0*swa3*swb2*swb2 + 21.0*swa2*swb3*swb2 +
-	    7.0*swa*swb3*swb3 + swb3*swb3*swb ) / d7;
+            7.0*swa*swb3*swb3 + swb3*swb3*swb ) / d7;
 }
 
 /* ---------------------------------------------------------------------- */
@@ -364,7 +364,7 @@ void FixQEqReax::setup_pre_force(int vflag)
   allocate_matrix();
 
   pre_force(vflag);
-}  
+}
 
 /* ---------------------------------------------------------------------- */
 
@@ -372,14 +372,14 @@ void FixQEqReax::setup_pre_force_respa(int vflag, int ilevel)
 {
   if (ilevel < nlevels_respa-1) return;
   setup_pre_force(vflag);
-}  
+}
 
 /* ---------------------------------------------------------------------- */
 
 void FixQEqReax::min_setup_pre_force(int vflag)
 {
   setup_pre_force(vflag);
-}  
+}
 
 /* ---------------------------------------------------------------------- */
 
@@ -387,7 +387,7 @@ void FixQEqReax::init_storage()
 {
   N = atom->nlocal + atom->nghost;
   for( int i = 0; i < N; i++ ) {
-    Hdia_inv[i] = 1. / eta[atom->type[i]]; 
+    Hdia_inv[i] = 1. / eta[atom->type[i]];
     b_s[i] = -chi[atom->type[i]];
     b_t[i] = -1.0;
     b_prc[i] = 0;
@@ -412,9 +412,9 @@ void FixQEqReax::pre_force(int vflag)
   if( atom->nmax > nmax ) reallocate_storage();
   if( n > n_cap*DANGER_ZONE || m_fill > m_cap*DANGER_ZONE )
     reallocate_matrix();
-  
+
   init_matvec();
-  matvecs = CG(b_s, s);	// CG on s - parallel
+  matvecs = CG(b_s, s);        // CG on s - parallel
   matvecs += CG(b_t, t); // CG on t - parallel
   calculate_Q();
 
@@ -456,7 +456,7 @@ void FixQEqReax::init_matvec()
     //t[i] = 2 * t_hist[i][0] - t_hist[i][1];
 
     /* quadratic extrapolation for s & t from previous solutions */
-    //s[i] = s_hist[i][2] + 3 * ( s_hist[i][0] - s_hist[i][1] );        
+    //s[i] = s_hist[i][2] + 3 * ( s_hist[i][0] - s_hist[i][1] );
     t[i] = t_hist[i][2] + 3 * ( t_hist[i][0] - t_hist[i][1] );
 
     /* cubic extrapolation for s & t from previous solutions */
@@ -488,7 +488,7 @@ void FixQEqReax::compute_H()
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // fill in the H matrix
   m_fill = 0;
   r_sqr = 0;
@@ -497,20 +497,20 @@ void FixQEqReax::compute_H()
     jlist = firstneigh[i];
     jnum = numneigh[i];
     H.firstnbr[i] = m_fill;
-    
+
     for( jj = 0; jj < jnum; jj++ ) {
       j = jlist[jj];
-      
+
       dx = x[j][0] - x[i][0];
       dy = x[j][1] - x[i][1];
       dz = x[j][2] - x[i][2];
       r_sqr = SQR(dx) + SQR(dy) + SQR(dz);
-      
+
       flag = 0;
       if (r_sqr <= SQR(swb)) {
         if (j < n) flag = 1;
         else if (tag[i] < tag[j]) flag = 1;
-	else if (tag[i] == tag[j]) {
+        else if (tag[i] == tag[j]) {
           if (dz > SMALL) flag = 1;
           else if (fabs(dz) < SMALL) {
             if (dy > SMALL) flag = 1;
@@ -519,21 +519,21 @@ void FixQEqReax::compute_H()
           }
         }
       }
-      
+
       if( flag ) {
-	H.jlist[m_fill] = j;
-	H.val[m_fill] = calculate_H( sqrt(r_sqr), shld[type[i]][type[j]] );
-	m_fill++;
+        H.jlist[m_fill] = j;
+        H.val[m_fill] = calculate_H( sqrt(r_sqr), shld[type[i]][type[j]] );
+        m_fill++;
       }
     }
-    
+
     H.numnbrs[i] = m_fill - H.firstnbr[i];
   }
 
   if (m_fill >= H.m) {
     char str[128];
     sprintf(str,"H matrix size has been exceeded: m_fill=%d H.m=%d\n",
-	     m_fill, H.m );
+             m_fill, H.m );
     error->warning(FLERR,str);
     error->all(FLERR,"Fix qeq/reax has insufficient QEq matrix size");
   }
@@ -583,21 +583,21 @@ int FixQEqReax::CG( double *b, double *x )
     comm->forward_comm_fix(this); //Dist_vector( d );
     sparse_matvec( &H, d, q );
     comm->reverse_comm_fix(this); //Coll_vector( q );
-    
+
     tmp = parallel_dot( d, q, n );
     alpha = sig_new / tmp;
     //  comm->me, i, parallel_norm( d, n ), parallel_norm( q, n ), tmp );
-    
+
     vector_add( x, alpha, d, n );
     vector_add( r, -alpha, q, n );
-    
+
     // pre-conditioning
     for( j = 0; j < n; ++j )
       p[j] = r[j] * Hdia_inv[j];
-    
+
     sig_old = sig_new;
     sig_new = parallel_dot( r, p, n );
-    
+
 
     beta = sig_new / sig_old;
     vector_sum( d, 1., p, beta, d, n );
@@ -619,7 +619,7 @@ void FixQEqReax::sparse_matvec( sparse_matrix *A, double *x, double *b )
     b[i] = eta[ atom->type[i] ] * x[i];
   for( i = n; i < N; ++i )
     b[i] = 0;
-  
+
   for( i = 0; i < n; ++i ) {
     for( itr_j=A->firstnbr[i]; itr_j<A->firstnbr[i]+A->numnbrs[i]; itr_j++) {
       j = A->jlist[itr_j];
@@ -640,10 +640,10 @@ void FixQEqReax::calculate_Q()
   s_sum = parallel_vector_acc( s, n );
   t_sum = parallel_vector_acc( t, n);
   u = s_sum / t_sum;
-  
+
   for( i = 0; i < n; ++i ) {
     q[i] = s[i] - u * t[i];
-  
+
     /* backup s & t */
     for( k = 4; k > 0; --k ) {
       s_hist[i][k] = s_hist[i][k-1];
@@ -659,12 +659,12 @@ void FixQEqReax::calculate_Q()
 
 /* ---------------------------------------------------------------------- */
 
-int FixQEqReax::pack_comm(int n, int *list, double *buf, 
-			  int pbc_flag, int *pbc)
+int FixQEqReax::pack_comm(int n, int *list, double *buf,
+                          int pbc_flag, int *pbc)
 {
   int m;
 
-  if( pack_flag == 1) 
+  if( pack_flag == 1)
     for(m = 0; m < n; m++) buf[m] = d[list[m]];
   else if( pack_flag == 2 )
     for(m = 0; m < n; m++) buf[m] = s[list[m]];
@@ -675,23 +675,23 @@ int FixQEqReax::pack_comm(int n, int *list, double *buf,
 
   return 1;
 }
- 
+
 /* ---------------------------------------------------------------------- */
 
 void FixQEqReax::unpack_comm(int n, int first, double *buf)
 {
   int i, m;
-  
-  if( pack_flag == 1) 
+
+  if( pack_flag == 1)
     for(m = 0, i = first; m < n; m++, i++) d[i] = buf[m];
-  else if( pack_flag == 2) 
+  else if( pack_flag == 2)
     for(m = 0, i = first; m < n; m++, i++) s[i] = buf[m];
-  else if( pack_flag == 3) 
+  else if( pack_flag == 3)
     for(m = 0, i = first; m < n; m++, i++) t[i] = buf[m];
-  else if( pack_flag == 4) 
+  else if( pack_flag == 4)
     for(m = 0, i = first; m < n; m++, i++) atom->q[i] = buf[m];
 }
- 
+
 /* ---------------------------------------------------------------------- */
 
 int FixQEqReax::pack_reverse_comm(int n, int first, double *buf)
@@ -700,7 +700,7 @@ int FixQEqReax::pack_reverse_comm(int n, int first, double *buf)
   for(m = 0, i = first; m < n; m++, i++) buf[m] = q[i];
   return 1;
 }
- 
+
 /* ---------------------------------------------------------------------- */
 
 void FixQEqReax::unpack_reverse_comm(int n, int *list, double *buf)
@@ -720,7 +720,7 @@ double FixQEqReax::memory_usage()
   bytes += atom->nmax*11 * sizeof(double); // storage
   bytes += n_cap*2 * sizeof(int); // matrix...
   bytes += m_cap * sizeof(int);
-  bytes += m_cap * sizeof(double); 
+  bytes += m_cap * sizeof(double);
 
   return bytes;
 }
@@ -823,7 +823,7 @@ double FixQEqReax::parallel_vector_acc( double *v, int n )
 double FixQEqReax::norm( double* v1, int k )
 {
   double ret = 0;
-  
+
   for( --k; k>=0; --k )
     ret +=  ( v1[k] * v1[k] );
 
@@ -832,8 +832,8 @@ double FixQEqReax::norm( double* v1, int k )
 
 /* ---------------------------------------------------------------------- */
 
-void FixQEqReax::vector_sum( double* dest, double c, double* v, 
-				double d, double* y, int k )
+void FixQEqReax::vector_sum( double* dest, double c, double* v,
+                                double d, double* y, int k )
 {
   for( --k; k>=0; --k )
     dest[k] = c * v[k] + d * y[k];
@@ -852,7 +852,7 @@ void FixQEqReax::vector_scale( double* dest, double c, double* v, int k )
 double FixQEqReax::dot( double* v1, double* v2, int k )
 {
   double ret = 0;
-  
+
   for( --k; k>=0; --k )
     ret +=  v1[k] * v2[k];
 
diff --git a/src/USER-REAXC/fix_qeq_reax.h b/src/USER-REAXC/fix_qeq_reax.h
index 9bab44179b..b6f55976e3 100644
--- a/src/USER-REAXC/fix_qeq_reax.h
+++ b/src/USER-REAXC/fix_qeq_reax.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -72,7 +72,7 @@ class FixQEqReax : public Fix {
   // fictitious charges
 
   double *s, *t;
-  double **s_hist, **t_hist;	
+  double **s_hist, **t_hist;
   int nprev;
 
   typedef struct{
@@ -92,11 +92,11 @@ class FixQEqReax : public Fix {
   double *p, *q, *r, *d;
 
   //GMRES storage
-  //double *g,*y;	  
+  //double *g,*y;
   //double **v;
   //double **h;
   //double *hc, *hs;
-  
+
   void pertype_parameters(char*);
   void init_shielding();
   void init_taper();
@@ -106,17 +106,17 @@ class FixQEqReax : public Fix {
   void allocate_matrix();
   void deallocate_matrix();
   void reallocate_matrix();
-  
+
   void init_matvec();
   void init_H();
   void compute_H();
   double calculate_H(double,double);
   void calculate_Q();
-  
+
   int CG(double*,double*);
   //int GMRES(double*,double*);
   void sparse_matvec(sparse_matrix*,double*,double*);
-  
+
   int pack_comm(int, int *, double *, int, int *);
   void unpack_comm(int, int, double *);
   int pack_reverse_comm(int, int, double *);
diff --git a/src/USER-REAXC/fix_reax_c.cpp b/src/USER-REAXC/fix_reax_c.cpp
index 8ec7165ffd..ebaa652ad1 100644
--- a/src/USER-REAXC/fix_reax_c.cpp
+++ b/src/USER-REAXC/fix_reax_c.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -36,17 +36,17 @@ using namespace FixConst;
 
 /* ---------------------------------------------------------------------- */
 
-FixReaxC::FixReaxC(LAMMPS *lmp,int narg, char **arg) : 
+FixReaxC::FixReaxC(LAMMPS *lmp,int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
   // perform initial allocation of atom-based arrays
   // register with atom class
-  
+
   num_bonds = NULL;
   num_hbonds = NULL;
   grow_arrays(atom->nmax);
   atom->add_callback(0);
-  
+
   // initialize arrays to MIN so atom migration is OK the 1st time
 
   int nlocal = atom->nlocal;
@@ -136,7 +136,7 @@ int FixReaxC::unpack_exchange(int nlocal, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int FixReaxC::pack_comm(int n, int *list, double *buf,
-			 int pbc_flag, int *pbc)
+                         int pbc_flag, int *pbc)
 {
   int i,j,m;
 
diff --git a/src/USER-REAXC/fix_reax_c.h b/src/USER-REAXC/fix_reax_c.h
index c54636ef51..8676f90f8b 100644
--- a/src/USER-REAXC/fix_reax_c.h
+++ b/src/USER-REAXC/fix_reax_c.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -36,7 +36,7 @@ namespace LAMMPS_NS {
 
 class FixReaxC : public Fix {
   friend class PairReaxC;
-  
+
  public:
   FixReaxC(class LAMMPS *,int, char **);
   ~FixReaxC();
diff --git a/src/USER-REAXC/fix_reaxc_bonds.cpp b/src/USER-REAXC/fix_reaxc_bonds.cpp
index bc4505b904..a4f11018f4 100644
--- a/src/USER-REAXC/fix_reaxc_bonds.cpp
+++ b/src/USER-REAXC/fix_reaxc_bonds.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) :
   nevery = atoi(arg[3]);
   nrepeat = atoi(arg[4]);
   global_freq = nfreq = atoi(arg[5]);
-  
+
   if (nevery <= 0 || nrepeat <= 0 || nfreq <= 0)
     error->all(FLERR,"Illegal fix reax/c/bonds command");
   if (nfreq % nevery || (nrepeat-1)*nevery >= nfreq)
@@ -117,7 +117,7 @@ void FixReaxCBonds::init()
 {
   reaxc = (PairReaxC *) force->pair_match("reax/c",1);
   if (reaxc == NULL) error->all(FLERR,"Cannot use fix reax/c/bonds without "
-		  "pair_style reax/c");
+                  "pair_style reax/c");
 
   if (nvalid < update->ntimestep) {
     irepeat = 0;
@@ -157,7 +157,7 @@ void FixReaxCBonds::Output_ReaxC_Bonds(bigint ntimestep, FILE *fp)
     for (i = 0; i < nmax; i++) {
       sbo[i] = nlp[i] = avq[i] = 0.0;
       for (j = 0; j < MAXBOND; j++) {
-	tmpid[i][j] = 0;
+        tmpid[i][j] = 0;
         tmpabo[i][j] = 0.0;
       }
     }
@@ -218,14 +218,14 @@ void FixReaxCBonds::GatherBond( reax_system *system, reax_list *lists)
       bo_tmp = bo_ij->bo_data.BO;
 
       if (bo_tmp > bo_cut) {
-	here:;
-	if (jtag != tmpid[i][nj] && tmpid[i][nj] != 0) {
-	  nj ++;
-	  if (nj > MAXBOND) error->all(FLERR,"Increase MAXBOND value");
-	  goto here;
-	}
-	tmpid[i][nj] = jtag;
-	tmpabo[i][nj] += bo_tmp;
+        here:;
+        if (jtag != tmpid[i][nj] && tmpid[i][nj] != 0) {
+          nj ++;
+          if (nj > MAXBOND) error->all(FLERR,"Increase MAXBOND value");
+          goto here;
+        }
+        tmpid[i][nj] = jtag;
+        tmpabo[i][nj] += bo_tmp;
         nj ++;
       }
 
@@ -239,7 +239,7 @@ void FixReaxCBonds::GatherBond( reax_system *system, reax_list *lists)
 /* ---------------------------------------------------------------------- */
 
 void FixReaxCBonds::FindBond( reax_system *system, reax_list *lists,
-		int &numbonds)
+                int &numbonds)
 {
   int *ilist, i, ii, inum;
   int j, pj, nj, jtag, jtype;
@@ -268,9 +268,9 @@ void FixReaxCBonds::FindBond( reax_system *system, reax_list *lists,
 
     for (j = 0; j < MAXBOND; j++){
       if (tmpabo[i][j] > bo_cut) {
-	neighid[i][nj] = tmpid[i][j];
-	abo[i][nj] = tmpabo[i][j];
-	nj ++;
+        neighid[i][nj] = tmpid[i][j];
+        abo[i][nj] = tmpabo[i][j];
+        nj ++;
       }
     }
     numneigh[i] = nj;
@@ -280,8 +280,8 @@ void FixReaxCBonds::FindBond( reax_system *system, reax_list *lists,
 
 /* ---------------------------------------------------------------------- */
 
-void FixReaxCBonds::PassBuffer( reax_system *system, double *buf, 
-		int &nbuf_local)
+void FixReaxCBonds::PassBuffer( reax_system *system, double *buf,
+                int &nbuf_local)
 {
   int i, j, k, jtag, numbonds;
   int nlocal = atom->nlocal;
@@ -297,7 +297,7 @@ void FixReaxCBonds::PassBuffer( reax_system *system, double *buf,
     buf[j+4] = numneigh[i];
     numbonds = nint(buf[j+4]);
 
-    for (k = 5; k < 5+numbonds; k++) {  
+    for (k = 5; k < 5+numbonds; k++) {
       buf[j+k] = neighid[i][k-5];
     }
     j += (5+numbonds);
@@ -306,7 +306,7 @@ void FixReaxCBonds::PassBuffer( reax_system *system, double *buf,
     else buf[j] = atom->molecule[i];
     j ++;
 
-    for (k = 0; k < numbonds; k++) {	
+    for (k = 0; k < numbonds; k++) {
       buf[j+k] = abo[i][k];
     }
     j += (1+numbonds);
@@ -316,8 +316,8 @@ void FixReaxCBonds::PassBuffer( reax_system *system, double *buf,
 
 /* ---------------------------------------------------------------------- */
 
-void FixReaxCBonds::RecvBuffer( reax_system *system, double *buf, 
-		int nbuf, int nbuf_local, int natoms, int maxnum)
+void FixReaxCBonds::RecvBuffer( reax_system *system, double *buf,
+                int nbuf, int nbuf_local, int natoms, int maxnum)
 {
   int i, j, k, l, itype, jtype, itag, jtag;
   int inode, nlocal_tmp, numbonds, molid;
@@ -329,13 +329,13 @@ void FixReaxCBonds::RecvBuffer( reax_system *system, double *buf,
   MPI_Request irequest, irequest2;
   MPI_Status istatus;
 
-  if (me == 0 ){ 
+  if (me == 0 ){
     fprintf(fp,"# Timestep " BIGINT_FORMAT " \n",ntimestep);
     fprintf(fp,"# \n");
     fprintf(fp,"# Number of particles %d \n",natoms);
     fprintf(fp,"# \n");
     fprintf(fp,"# Max number of bonds per atom %d with "
-	    "coarse bond order cutoff %5.3f \n",maxnum,cutof3);
+            "coarse bond order cutoff %5.3f \n",maxnum,cutof3);
     fprintf(fp,"# Particle connection table and bond orders \n");
     fprintf(fp,"# id type nb id_1...id_nb mol bo_1...bo_nb abo nlp q \n");
   }
@@ -344,38 +344,38 @@ void FixReaxCBonds::RecvBuffer( reax_system *system, double *buf,
   if (me == 0) {
     for (inode = 0; inode < nprocs; inode ++) {
       if (inode == 0) {
-	nlocal_tmp = nlocal;
+        nlocal_tmp = nlocal;
       } else {
-	MPI_Irecv(&buf[0],nbuf,MPI_DOUBLE,inode,0,world,&irequest);
+        MPI_Irecv(&buf[0],nbuf,MPI_DOUBLE,inode,0,world,&irequest);
         MPI_Wait(&irequest,&istatus);
-	nlocal_tmp = nint(buf[0]);
+        nlocal_tmp = nint(buf[0]);
       }
       j = 2;
       for (i = 0; i < nlocal_tmp; i ++) {
-	itag = nint(buf[j-1]);
-	itype = nint(buf[j+0]);
-	sbotmp = buf[j+1];
-	nlptmp = buf[j+2];
-	avqtmp = buf[j+3];
-	numbonds = nint(buf[j+4]);
+        itag = nint(buf[j-1]);
+        itype = nint(buf[j+0]);
+        sbotmp = buf[j+1];
+        nlptmp = buf[j+2];
+        avqtmp = buf[j+3];
+        numbonds = nint(buf[j+4]);
 
-	fprintf(fp," %d %d %d",itag,itype,numbonds);
+        fprintf(fp," %d %d %d",itag,itype,numbonds);
 
-	for (k = 5; k < 5+numbonds; k++) {
+        for (k = 5; k < 5+numbonds; k++) {
           jtag = nint(buf[j+k]);
-	  fprintf(fp," %d",jtag);
-	}
-	j += (5+numbonds);
-
-	fprintf(fp," %d",nint(buf[j]));
-	j ++;
-
-	for (k = 0; k < numbonds; k++) {
-	  abotmp = buf[j+k];
-	  fprintf(fp,"%14.3f",abotmp);
-	}
-	j += (1+numbonds);
-	fprintf(fp,"%14.3f%14.3f%14.3f\n",sbotmp,nlptmp,avqtmp);
+          fprintf(fp," %d",jtag);
+        }
+        j += (5+numbonds);
+
+        fprintf(fp," %d",nint(buf[j]));
+        j ++;
+
+        for (k = 0; k < numbonds; k++) {
+          abotmp = buf[j+k];
+          fprintf(fp,"%14.3f",abotmp);
+        }
+        j += (1+numbonds);
+        fprintf(fp,"%14.3f%14.3f%14.3f\n",sbotmp,nlptmp,avqtmp);
       }
     }
   } else {
@@ -455,4 +455,3 @@ double FixReaxCBonds::memory_usage()
 
   return bytes;
 }
-
diff --git a/src/USER-REAXC/fix_reaxc_bonds.h b/src/USER-REAXC/fix_reaxc_bonds.h
index 94c8806cad..e58a5766ab 100644
--- a/src/USER-REAXC/fix_reaxc_bonds.h
+++ b/src/USER-REAXC/fix_reaxc_bonds.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-REAXC/pair_reax_c.cpp b/src/USER-REAXC/pair_reax_c.cpp
index a9921e4fc7..2195132a0f 100644
--- a/src/USER-REAXC/pair_reax_c.cpp
+++ b/src/USER-REAXC/pair_reax_c.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -62,13 +62,13 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp)
 
   system = (reax_system *)
     memory->smalloc(sizeof(reax_system),"reax:system");
-  control = (control_params *) 
+  control = (control_params *)
     memory->smalloc(sizeof(control_params),"reax:control");
   data = (simulation_data *)
     memory->smalloc(sizeof(simulation_data),"reax:data");
   workspace = (storage *)
     memory->smalloc(sizeof(storage),"reax:storage");
-  lists = (reax_list *) 
+  lists = (reax_list *)
     memory->smalloc(LIST_N * sizeof(reax_list),"reax:lists");
   out_control = (output_controls *)
     memory->smalloc(sizeof(output_controls),"reax:out_control");
@@ -128,7 +128,7 @@ PairReaxC::~PairReaxC()
     DeAllocate_System( system );
   }
   //fprintf( stderr, "4\n" );
-  
+
   memory->destroy( system );
   memory->destroy( control );
   memory->destroy( data );
@@ -190,7 +190,7 @@ void PairReaxC::settings(int narg, char **arg)
     control->hbond_cut = 7.50;
     control->thb_cut = 0.001;
     control->thb_cutsq = 0.00001;
-   
+
     out_control->write_steps = 0;
     out_control->traj_method = 0;
     strcpy( out_control->traj_title, "default_title" );
@@ -246,7 +246,7 @@ void PairReaxC::coeff( int nargs, char **args )
   // read ffield file
 
   Read_Force_Field(args[2], &(system->reax_param), control);
- 
+
   // read args that map atom types to elements in potential file
   // map[i] = which element the Ith atom type is, -1 if NULL
 
@@ -276,7 +276,7 @@ void PairReaxC::coeff( int nargs, char **args )
       setflag[i][j] = 1;
       count++;
     }
-    
+
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
@@ -290,7 +290,7 @@ void PairReaxC::init_style( )
   int iqeq;
   for (iqeq = 0; iqeq < modify->nfix; iqeq++)
     if (strcmp(modify->fix[iqeq]->style,"qeq/reax") == 0) break;
-  if (iqeq == modify->nfix && qeqflag == 1) 
+  if (iqeq == modify->nfix && qeqflag == 1)
     error->all(FLERR,"Pair reax/c requires use of fix qeq/reax");
 
   system->n = atom->nlocal; // my atoms
@@ -299,8 +299,8 @@ void PairReaxC::init_style( )
   system->wsize = comm->nprocs;
 
   system->big_box.V = 0;
-  system->big_box.box_norms[0] = 0; 
-  system->big_box.box_norms[1] = 0; 
+  system->big_box.box_norms[0] = 0;
+  system->big_box.box_norms[1] = 0;
   system->big_box.box_norms[2] = 0;
 
   if (atom->tag_enable == 0)
@@ -344,7 +344,7 @@ void PairReaxC::setup( )
   if (setup_flag == 0) {
 
     setup_flag = 1;
-    
+
     int *num_bonds = fix_reax->num_bonds;
     int *num_hbonds = fix_reax->num_hbonds;
 
@@ -359,15 +359,15 @@ void PairReaxC::setup( )
 
     PreAllocate_Space( system, control, workspace, world );
     write_reax_atoms();
-    
+
     int num_nbrs = estimate_reax_lists();
-    if(!Make_List(system->total_cap, num_nbrs, TYP_FAR_NEIGHBOR, 
-		  lists+FAR_NBRS, world))
+    if(!Make_List(system->total_cap, num_nbrs, TYP_FAR_NEIGHBOR,
+                  lists+FAR_NBRS, world))
       error->all(FLERR,"Pair reax/c problem in far neighbor list");
-  
+
     write_reax_lists();
-    Initialize( system, control, data, workspace, &lists, out_control, 
-		mpi_data, world );
+    Initialize( system, control, data, workspace, &lists, out_control,
+                mpi_data, world );
     for( int k = 0; k < system->N; ++k ) {
       num_bonds[k] = system->my_atoms[k].num_bonds;
       num_hbonds[k] = system->my_atoms[k].num_hbonds;
@@ -383,7 +383,7 @@ void PairReaxC::setup( )
 
     for(int k = oldN; k < system->N; ++k)
       Set_End_Index( k, Start_Index( k, lists+BONDS ), lists+BONDS );
-    
+
     // check if I need to shrink/extend my data-structs
 
     ReAllocate( system, control, data, workspace, &lists, mpi_data );
@@ -417,9 +417,9 @@ void PairReaxC::compute(int eflag, int vflag)
 
 /*  if ((eflag_atom || vflag_atom) && firstwarn) {
     firstwarn = 0;
-    if (comm->me == 0) 
+    if (comm->me == 0)
       error->warning(FLERR,"Pair reax/c cannot yet compute "
-		     "per-atom energy or stress");
+                     "per-atom energy or stress");
   } */
 
   if (vflag_global) control->virial = 1;
@@ -430,15 +430,15 @@ void PairReaxC::compute(int eflag, int vflag)
   system->bigN = static_cast<int> (atom->natoms);  // all atoms in the system
 
   system->big_box.V = 0;
-  system->big_box.box_norms[0] = 0; 
-  system->big_box.box_norms[1] = 0; 
+  system->big_box.box_norms[0] = 0;
+  system->big_box.box_norms[1] = 0;
   system->big_box.box_norms[2] = 0;
   if( comm->me == 0 ) t_start = MPI_Wtime();
 
   // setup data structures
 
   setup();
-  
+
   Reset( system, control, data, workspace, &lists, world );
   workspace->realloc.num_far = write_reax_lists();
   // timing for filling in the reax lists
@@ -481,7 +481,7 @@ void PairReaxC::compute(int eflag, int vflag)
     // Store the different parts of the energy
     // in a list for output by compute pair command
 
-    pvector[0] = data->my_en.e_bond;   
+    pvector[0] = data->my_en.e_bond;
     pvector[1] = data->my_en.e_ov + data->my_en.e_un;
     pvector[2] = data->my_en.e_lp;
     pvector[3] = 0.0;
@@ -512,11 +512,11 @@ void PairReaxC::compute(int eflag, int vflag)
 
   Output_Results( system, control, data, &lists, out_control, mpi_data );
 
-  if(fixbond_flag) 
-	  fixbond( system, control, data, &lists, out_control, mpi_data );
+  if(fixbond_flag)
+          fixbond( system, control, data, &lists, out_control, mpi_data );
 
-  if(fixspecies_flag) 
-	  fixspecies( system, control, data, &lists, out_control, mpi_data );
+  if(fixspecies_flag)
+          fixspecies( system, control, data, &lists, out_control, mpi_data );
 
 }
 
@@ -526,7 +526,7 @@ void PairReaxC::write_reax_atoms()
 {
   int *num_bonds = fix_reax->num_bonds;
   int *num_hbonds = fix_reax->num_hbonds;
-  
+
   for( int i = 0; i < system->N; ++i ){
     system->my_atoms[i].orig_id = atom->tag[i];
     system->my_atoms[i].type = map[atom->type[i]];
@@ -551,8 +551,8 @@ void PairReaxC::get_distance( rvec xj, rvec xi, double *d_sqr, rvec *dvec )
 
 /* ---------------------------------------------------------------------- */
 
-void PairReaxC::set_far_nbr( far_neighbor_data *fdest, 
-			      int j, double d, rvec dvec )
+void PairReaxC::set_far_nbr( far_neighbor_data *fdest,
+                              int j, double d, rvec dvec )
 {
   fdest->nbr = j;
   fdest->d = d;
@@ -599,36 +599,36 @@ int PairReaxC::estimate_reax_lists()
       j &= NEIGHMASK;
       get_distance( x[j], x[i], &d_sqr, &dvec );
       dist[j] = sqrt(d_sqr);
-      
+
       if( dist[j] <= control->nonb_cut )
-	++num_nbrs;
+        ++num_nbrs;
     }
 
     // compute the nbrs among ghost atoms
     for( itr_j = 0; itr_j < numneigh[i]; ++itr_j ){
       j = jlist[itr_j];
       j &= NEIGHMASK;
-      
-      if( j >= nlocal && !marked[j] && 
-	  dist[j] <= (control->vlist_cut - control->bond_cut) ){
-	marked[j] = 1;
-	++num_marked;
-
-	for( itr_g = 0; itr_g < numneigh[i]; ++itr_g ){
-	  g = jlist[itr_g];
-	  g &= NEIGHMASK;
-	  
-	  if( g >= nlocal && !marked[g] ){
-	    get_distance( x[g], x[j], &g_d_sqr, &g_dvec );
-	    //g_dvec[0] = x[g][0] - x[j][0];
-	    //g_dvec[1] = x[g][1] - x[j][1];
-	    //g_dvec[2] = x[g][2] - x[j][2];
-	    //g_d_sqr = SQR(g_dvec[0]) + SQR(g_dvec[1]) + SQR(g_dvec[2]);
-	    
-	    if( g_d_sqr <= SQR(control->bond_cut) )
-	      ++num_nbrs;
-	  }
-	}
+
+      if( j >= nlocal && !marked[j] &&
+          dist[j] <= (control->vlist_cut - control->bond_cut) ){
+        marked[j] = 1;
+        ++num_marked;
+
+        for( itr_g = 0; itr_g < numneigh[i]; ++itr_g ){
+          g = jlist[itr_g];
+          g &= NEIGHMASK;
+
+          if( g >= nlocal && !marked[g] ){
+            get_distance( x[g], x[j], &g_d_sqr, &g_dvec );
+            //g_dvec[0] = x[g][0] - x[j][0];
+            //g_dvec[1] = x[g][1] - x[j][1];
+            //g_dvec[2] = x[g][2] - x[j][2];
+            //g_d_sqr = SQR(g_dvec[0]) + SQR(g_dvec[1]) + SQR(g_dvec[2]);
+
+            if( g_d_sqr <= SQR(control->bond_cut) )
+              ++num_nbrs;
+          }
+        }
       }
     }
   }
@@ -637,15 +637,15 @@ int PairReaxC::estimate_reax_lists()
     if( !marked[i] ) {
       marked[i] = 1;
       ++num_marked;
-      
+
       for( j = i+1; j < system->N; ++j )
-	if( !marked[j] ) {
-	  get_distance( x[j], x[i], &d_sqr, &dvec );
-	  if( d_sqr <= SQR(control->bond_cut) )
-	    ++num_nbrs;
-	}
+        if( !marked[j] ) {
+          get_distance( x[j], x[i], &d_sqr, &dvec );
+          if( d_sqr <= SQR(control->bond_cut) )
+            ++num_nbrs;
+        }
     }
-  
+
   free( marked );
   free( dist );
 
@@ -676,7 +676,7 @@ int PairReaxC::write_reax_lists()
   far_nbrs = lists + FAR_NBRS;
   far_list = far_nbrs->select.far_nbr_list;
 
-  num_nbrs = 0;  
+  num_nbrs = 0;
   marked = (int*) calloc( system->N, sizeof(int) );
   dist = (double*) calloc( system->N, sizeof(double) );
 
@@ -693,8 +693,8 @@ int PairReaxC::write_reax_lists()
       dist[j] = sqrt( d_sqr );
 
       if( dist[j] <= control->nonb_cut ){
-	set_far_nbr( &far_list[num_nbrs], j, dist[j], dvec );
-	++num_nbrs;
+        set_far_nbr( &far_list[num_nbrs], j, dist[j], dvec );
+        ++num_nbrs;
       }
     }
     Set_End_Index( i, num_nbrs, far_nbrs );
@@ -704,27 +704,27 @@ int PairReaxC::write_reax_lists()
       j = jlist[itr_j];
       j &= NEIGHMASK;
 
-      if( j >= nlocal && !marked[j] && 
-	  dist[j] <= (control->vlist_cut - control->bond_cut) ){
-	marked[j] = 1;      
-     	Set_Start_Index( j, num_nbrs, far_nbrs );
-
-	for( itr_g = 0; itr_g < numneigh[i]; ++itr_g ){
-	  g = jlist[itr_g];
-	  g &= NEIGHMASK;
-	  
-	  if( g >= nlocal && !marked[g] ){
-	    get_distance( x[g], x[j], &g_d_sqr, &g_dvec );
-	    
-	    if( g_d_sqr <= SQR(control->bond_cut) ){
-	      g_d = sqrt( g_d_sqr );
-	      
-	      set_far_nbr( &far_list[num_nbrs], g, g_d, g_dvec );
-	      ++num_nbrs;
-	    }
-	  }
-	}
-	Set_End_Index( j, num_nbrs, far_nbrs );
+      if( j >= nlocal && !marked[j] &&
+          dist[j] <= (control->vlist_cut - control->bond_cut) ){
+        marked[j] = 1;
+             Set_Start_Index( j, num_nbrs, far_nbrs );
+
+        for( itr_g = 0; itr_g < numneigh[i]; ++itr_g ){
+          g = jlist[itr_g];
+          g &= NEIGHMASK;
+
+          if( g >= nlocal && !marked[g] ){
+            get_distance( x[g], x[j], &g_d_sqr, &g_dvec );
+
+            if( g_d_sqr <= SQR(control->bond_cut) ){
+              g_d = sqrt( g_d_sqr );
+
+              set_far_nbr( &far_list[num_nbrs], g, g_d, g_dvec );
+              ++num_nbrs;
+            }
+          }
+        }
+        Set_End_Index( j, num_nbrs, far_nbrs );
       }
     }
   }
@@ -733,27 +733,27 @@ int PairReaxC::write_reax_lists()
     if( !marked[i] ) {
       marked[i] = 1;
       Set_Start_Index( i, num_nbrs, far_nbrs );
-      
+
       for( j = i+1; j < system->N; ++j )
-	if( !marked[j] ) {
-	  get_distance( x[j], x[i], &d_sqr, &dvec );
-	  if( d_sqr <= SQR(control->bond_cut) ) {
-	    set_far_nbr( &far_list[num_nbrs], j, sqrt(d_sqr), dvec );
-	    ++num_nbrs;
-	  }
-	}
+        if( !marked[j] ) {
+          get_distance( x[j], x[i], &d_sqr, &dvec );
+          if( d_sqr <= SQR(control->bond_cut) ) {
+            set_far_nbr( &far_list[num_nbrs], j, sqrt(d_sqr), dvec );
+            ++num_nbrs;
+          }
+        }
 
       Set_End_Index( i, num_nbrs, far_nbrs );
     }
-  
+
   free( marked );
   free( dist );
-  
+
   return num_nbrs;
 }
-  
+
 /* ---------------------------------------------------------------------- */
-  
+
 void PairReaxC::read_reax_forces()
 {
   for( int i = 0; i < system->N; ++i ) {
diff --git a/src/USER-REAXC/pair_reax_c.h b/src/USER-REAXC/pair_reax_c.h
index cfd9e35937..111074ac88 100644
--- a/src/USER-REAXC/pair_reax_c.h
+++ b/src/USER-REAXC/pair_reax_c.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -59,7 +59,7 @@ class PairReaxC : public Pair {
   double cutmax;
   int *map;
   class FixReaxC *fix_reax;
-  
+
   double *chi,*eta,*gamma;
   int qeqflag;
   int setup_flag;
@@ -74,7 +74,7 @@ class PairReaxC : public Pair {
   void read_reax_forces();
   void setup();
 };
-  
+
 }
 
 #endif
diff --git a/src/USER-REAXC/reaxc_allocate.cpp b/src/USER-REAXC/reaxc_allocate.cpp
index f8387a4524..039b2a00cb 100644
--- a/src/USER-REAXC/reaxc_allocate.cpp
+++ b/src/USER-REAXC/reaxc_allocate.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -41,11 +41,11 @@
 
 
 /* allocate space for my_atoms
-   important: we cannot know the exact number of atoms that will fall into a 
-   process's box throughout the whole simulation. therefore 
+   important: we cannot know the exact number of atoms that will fall into a
+   process's box throughout the whole simulation. therefore
    we need to make upper bound estimates for various data structures */
-int PreAllocate_Space( reax_system *system, control_params *control, 
-		       storage *workspace, MPI_Comm comm )
+int PreAllocate_Space( reax_system *system, control_params *control,
+                       storage *workspace, MPI_Comm comm )
 {
   int  i;
 
@@ -53,27 +53,27 @@ int PreAllocate_Space( reax_system *system, control_params *control,
   system->local_cap = MAX( (int)(system->n * SAFE_ZONE), MIN_CAP );
   system->total_cap = MAX( (int)(system->N * SAFE_ZONE), MIN_CAP );
 #if defined(DEBUG)
-  fprintf( stderr, "p%d: local_cap=%d total_cap=%d\n", 
-	   system->my_rank, system->local_cap, system->total_cap );
+  fprintf( stderr, "p%d: local_cap=%d total_cap=%d\n",
+           system->my_rank, system->local_cap, system->total_cap );
 #endif
 
-  system->my_atoms = (reax_atom*) 
+  system->my_atoms = (reax_atom*)
     scalloc( system->total_cap, sizeof(reax_atom), "my_atoms", comm );
-  
+
   /* space for keeping restriction info, if any */
   // not yet implemented in the parallel version!!!
   // if( control->restrict_bonds ) {
-  //   workspace->restricted  = (int*) 
+  //   workspace->restricted  = (int*)
   //     scalloc( system->local_cap, sizeof(int), "restricted_atoms", comm );
-    
-  //   workspace->restricted_list = (int**) 
+
+  //   workspace->restricted_list = (int**)
   //     scalloc( system->local_cap, sizeof(int*), "restricted_list", comm );
-    
+
   //   for( i = 0; i < system->local_cap; ++i )
-  //     workspace->restricted_list[i] = (int*) 
-  // 	scalloc( MAX_RESTRICT, sizeof(int), "restricted_list[i]", comm );
+  //     workspace->restricted_list[i] = (int*)
+  //         scalloc( MAX_RESTRICT, sizeof(int), "restricted_list[i]", comm );
   // }
-  
+
   return SUCCESS;
 }
 
@@ -99,16 +99,16 @@ inline void reax_atom_Copy( reax_atom *dest, reax_atom *src )
 void Copy_Atom_List( reax_atom *dest, reax_atom *src, int n )
 {
   int i;
-  
+
   for( i = 0; i < n; ++i )
     memcpy( dest+i, src+i, sizeof(reax_atom) );
 }
 
 
-int Allocate_System( reax_system *system, int local_cap, int total_cap, 
-		     char *msg )
+int Allocate_System( reax_system *system, int local_cap, int total_cap,
+                     char *msg )
 {
-  system->my_atoms = (reax_atom*) 
+  system->my_atoms = (reax_atom*)
     realloc( system->my_atoms, total_cap*sizeof(reax_atom) );
 
   return SUCCESS;
@@ -123,7 +123,7 @@ void DeAllocate_System( reax_system *system )
 
   // dealloocate the atom list
   sfree( system->my_atoms, "system->my_atoms" );
-  
+
   // deallocate the ffield parameters storage
   ff_params = &(system->reax_param);
   ntypes = ff_params->num_atom_types;
@@ -133,7 +133,7 @@ void DeAllocate_System( reax_system *system )
   for( i = 0; i < ntypes; ++i ) {
     for( j = 0; j < ntypes; ++j ) {
       for( k = 0; k < ntypes; ++k ) {
-	sfree( ff_params->fbp[i][j][k], "ff:fbp[i,j,k]" );
+        sfree( ff_params->fbp[i][j][k], "ff:fbp[i,j,k]" );
       }
       sfree( ff_params->fbp[i][j], "ff:fbp[i,j]" );
       sfree( ff_params->thbp[i][j], "ff:thbp[i,j]" );
@@ -159,7 +159,7 @@ void DeAllocate_Workspace( control_params *control, storage *workspace )
 
   if( !workspace->allocated )
     return;
-  
+
   workspace->allocated = 0;
 
   /* communication storage */
@@ -279,10 +279,10 @@ void DeAllocate_Workspace( control_params *control, storage *workspace )
 }
 
 
-int Allocate_Workspace( reax_system *system, control_params *control, 
-			storage *workspace, int local_cap, int total_cap, 
-			MPI_Comm comm, char *msg )
-{ 
+int Allocate_Workspace( reax_system *system, control_params *control,
+                        storage *workspace, int local_cap, int total_cap,
+                        MPI_Comm comm, char *msg )
+{
   int i, total_real, total_rvec, local_int, local_real, local_rvec;
 
   workspace->allocated = 1;
@@ -292,7 +292,7 @@ int Allocate_Workspace( reax_system *system, control_params *control,
   local_real = local_cap * sizeof(real);
   local_rvec = local_cap * sizeof(rvec);
 
-  /* communication storage */  
+  /* communication storage */
   for( i = 0; i < MAX_NBRS; ++i ) {
     workspace->tmp_dbl[i] = (real*)
       scalloc( total_cap, sizeof(real), "tmp_dbl", comm );
@@ -303,7 +303,7 @@ int Allocate_Workspace( reax_system *system, control_params *control,
   }
 
   /* bond order related storage  */
-  workspace->within_bond_box = (int*) 
+  workspace->within_bond_box = (int*)
     scalloc( total_cap, sizeof(int), "skin", comm );
   workspace->total_bond_order = (real*) smalloc( total_real, "total_bo", comm );
   workspace->Deltap = (real*) smalloc( total_real, "Deltap", comm );
@@ -311,10 +311,10 @@ int Allocate_Workspace( reax_system *system, control_params *control,
   workspace->dDeltap_self = (rvec*) smalloc( total_rvec, "dDeltap_self", comm );
   workspace->Delta = (real*) smalloc( total_real, "Delta", comm );
   workspace->Delta_lp = (real*) smalloc( total_real, "Delta_lp", comm );
-  workspace->Delta_lp_temp = (real*) 
+  workspace->Delta_lp_temp = (real*)
     smalloc( total_real, "Delta_lp_temp", comm );
   workspace->dDelta_lp = (real*) smalloc( total_real, "dDelta_lp", comm );
-  workspace->dDelta_lp_temp = (real*) 
+  workspace->dDelta_lp_temp = (real*)
     smalloc( total_real, "dDelta_lp_temp", comm );
   workspace->Delta_e = (real*) smalloc( total_real, "Delta_e", comm );
   workspace->Delta_boc = (real*) smalloc( total_real, "Delta_boc", comm );
@@ -323,14 +323,14 @@ int Allocate_Workspace( reax_system *system, control_params *control,
   workspace->nlp_temp = (real*) smalloc( total_real, "nlp_temp", comm );
   workspace->Clp = (real*) smalloc( total_real, "Clp", comm );
   workspace->vlpex = (real*) smalloc( total_real, "vlpex", comm );
-  workspace->bond_mark = (int*) 
+  workspace->bond_mark = (int*)
     scalloc( total_cap, sizeof(int), "bond_mark", comm );
-  workspace->done_after = (int*) 
+  workspace->done_after = (int*)
     scalloc( total_cap, sizeof(int), "done_after", comm );
   // fprintf( stderr, "p%d: bond order storage\n", system->my_rank );
 
   /* QEq storage */
-  workspace->Hdia_inv = (real*) 
+  workspace->Hdia_inv = (real*)
     scalloc( total_cap, sizeof(real), "Hdia_inv", comm );
   workspace->b_s = (real*) scalloc( total_cap, sizeof(real), "b_s", comm );
   workspace->b_t = (real*) scalloc( total_cap, sizeof(real), "b_t", comm );
@@ -338,11 +338,11 @@ int Allocate_Workspace( reax_system *system, control_params *control,
   workspace->b_prm = (real*) scalloc( total_cap, sizeof(real), "b_prm", comm );
   workspace->s = (real*) scalloc( total_cap, sizeof(real), "s", comm );
   workspace->t = (real*) scalloc( total_cap, sizeof(real), "t", comm );
-  workspace->droptol = (real*) 
+  workspace->droptol = (real*)
     scalloc( total_cap, sizeof(real), "droptol", comm );
   workspace->b = (rvec2*) scalloc( total_cap, sizeof(rvec2), "b", comm );
   workspace->x = (rvec2*) scalloc( total_cap, sizeof(rvec2), "x", comm );
-  
+
   /* GMRES storage */
   workspace->y = (real*) scalloc( RESTART+1, sizeof(real), "y", comm );
   workspace->z = (real*) scalloc( RESTART+1, sizeof(real), "z", comm );
@@ -351,7 +351,7 @@ int Allocate_Workspace( reax_system *system, control_params *control,
   workspace->hs = (real*) scalloc( RESTART+1, sizeof(real), "hs", comm );
   workspace->hc = (real*) scalloc( RESTART+1, sizeof(real), "hc", comm );
   workspace->v = (real**) scalloc( RESTART+1, sizeof(real*), "v", comm );
-  
+
   for( i = 0; i < RESTART+1; ++i ) {
     workspace->h[i] = (real*) scalloc( RESTART+1, sizeof(real), "h[i]", comm );
     workspace->v[i] = (real*) scalloc( total_cap, sizeof(real), "v[i]", comm );
@@ -374,20 +374,20 @@ int Allocate_Workspace( reax_system *system, control_params *control,
   // not yet implemented in the parallel version!!!
   // if( control->molecular_analysis || control->diffusion_coef ) {
   //   workspace->mark = (int*) scalloc( local_cap, sizeof(int), "mark", comm );
-  //   workspace->old_mark = (int*) 
+  //   workspace->old_mark = (int*)
   //     scalloc( local_cap, sizeof(int), "old_mark", comm );
   // }
-  // else 
+  // else
   //   workspace->mark = workspace->old_mark = NULL;
 
   // if( control->diffusion_coef )
-  //   workspace->x_old = (rvec*) 
+  //   workspace->x_old = (rvec*)
   //     scalloc( local_cap, sizeof(rvec), "x_old", comm );
   // else workspace->x_old = NULL;
-  
+
   // /* force related storage */
   workspace->f = (rvec*) scalloc( total_cap, sizeof(rvec), "f", comm );
-  workspace->CdDelta = (real*) 
+  workspace->CdDelta = (real*)
     scalloc( total_cap, sizeof(real), "CdDelta", comm );
 
 #ifdef TEST_FORCES
@@ -408,13 +408,13 @@ int Allocate_Workspace( reax_system *system, control_params *control,
   workspace->f_tot =(rvec*) smalloc( total_rvec, "f_tot", comm );
 
   if( system->my_rank == MASTER_NODE ) {
-    workspace->rcounts = (int*) 
+    workspace->rcounts = (int*)
       smalloc( system->wsize*sizeof(int), "rcount", comm );
-    workspace->displs = (int*) 
+    workspace->displs = (int*)
       smalloc( system->wsize*sizeof(int), "displs", comm );
-    workspace->id_all = (int*) 
+    workspace->id_all = (int*)
       smalloc( system->bigN*sizeof(int), "id_all", comm );
-    workspace->f_all = (rvec*) 
+    workspace->f_all = (rvec*)
       smalloc( system->bigN*sizeof(rvec), "f_all", comm );
   }
   else{
@@ -430,7 +430,7 @@ int Allocate_Workspace( reax_system *system, control_params *control,
 
 
 void Reallocate_Neighbor_List( reax_list *far_nbrs, int n, int num_intrs,
-			       MPI_Comm comm )
+                               MPI_Comm comm )
 {
   Delete_List( far_nbrs, comm );
   if(!Make_List( n, num_intrs, TYP_FAR_NEIGHBOR, far_nbrs, comm )){
@@ -444,14 +444,14 @@ int Allocate_Matrix( sparse_matrix **pH, int cap, int m, MPI_Comm comm )
 {
   sparse_matrix *H;
 
-  *pH = (sparse_matrix*) 
+  *pH = (sparse_matrix*)
     smalloc( sizeof(sparse_matrix), "sparse_matrix", comm );
   H = *pH;
   H->cap = cap;
   H->m = m;
-  H->start = (int*) smalloc( sizeof(int) * cap, "matrix_start", comm ); 
+  H->start = (int*) smalloc( sizeof(int) * cap, "matrix_start", comm );
   H->end = (int*) smalloc( sizeof(int) * cap, "matrix_end", comm );
-  H->entries = (sparse_matrix_entry*) 
+  H->entries = (sparse_matrix_entry*)
     smalloc( sizeof(sparse_matrix_entry)*m, "matrix_entries", comm );
 
   return SUCCESS;
@@ -467,8 +467,8 @@ void Deallocate_Matrix( sparse_matrix *H )
 }
 
 
-int Reallocate_Matrix( sparse_matrix **H, int n, int m, char *name, 
-		       MPI_Comm comm )
+int Reallocate_Matrix( sparse_matrix **H, int n, int m, char *name,
+                       MPI_Comm comm )
 {
   Deallocate_Matrix( *H );
   if( !Allocate_Matrix( H, n, m, comm ) ) {
@@ -478,15 +478,15 @@ int Reallocate_Matrix( sparse_matrix **H, int n, int m, char *name,
 
 #if defined(DEBUG_FOCUS)
   fprintf( stderr, "reallocating %s matrix, n = %d, m = %d\n", name, n, m );
-  fprintf( stderr, "memory allocated: %s = %dMB\n", 
-	   name, (int)(m * sizeof(sparse_matrix_entry) / (1024*1024)) );
+  fprintf( stderr, "memory allocated: %s = %dMB\n",
+           name, (int)(m * sizeof(sparse_matrix_entry) / (1024*1024)) );
 #endif
   return SUCCESS;
 }
 
 
-int Reallocate_HBonds_List( reax_system *system, reax_list *hbonds, 
-			    MPI_Comm comm )
+int Reallocate_HBonds_List( reax_system *system, reax_list *hbonds,
+                            MPI_Comm comm )
 {
   int i, id, total_hbonds;
 
@@ -497,9 +497,9 @@ int Reallocate_HBonds_List( reax_system *system, reax_list *hbonds,
       // system->my_atoms[i].num_hbonds = MAX(Num_Entries(id,hbonds)*SAFER_ZONE,
       //                                   MIN_HBONDS);
       total_hbonds += system->my_atoms[i].num_hbonds;
-    } 
+    }
   total_hbonds = (int)(MAX( total_hbonds*SAFER_ZONE, MIN_CAP*MIN_HBONDS ));
-  
+
   Delete_List( hbonds, comm );
   if( !Make_List( system->Hcap, total_hbonds, TYP_HBOND, hbonds, comm ) ) {
     fprintf( stderr, "not enough space for hbonds list. terminating!\n" );
@@ -511,7 +511,7 @@ int Reallocate_HBonds_List( reax_system *system, reax_list *hbonds,
 
 
 int Reallocate_Bonds_List( reax_system *system, reax_list *bonds,
-			   int *total_bonds, int *est_3body, MPI_Comm comm )
+                           int *total_bonds, int *est_3body, MPI_Comm comm )
 {
   int i;
 
@@ -524,7 +524,7 @@ int Reallocate_Bonds_List( reax_system *system, reax_list *bonds,
     *total_bonds += system->my_atoms[i].num_bonds;
   }
   *total_bonds = (int)(MAX( *total_bonds * SAFE_ZONE, MIN_CAP*MIN_BONDS ));
-  
+
   Delete_List( bonds, comm );
   if(!Make_List(system->total_cap, *total_bonds, TYP_BOND, bonds, comm)) {
     fprintf( stderr, "not enough space for bonds list. terminating!\n" );
@@ -544,7 +544,7 @@ int Estimate_GCell_Population( reax_system* system, MPI_Comm comm )
   grid_cell *gc;
   simulation_box *big_box, *my_ext_box;
   reax_atom *atoms;
-  
+
   big_box    = &(system->big_box);
   my_ext_box = &(system->my_ext_box);
   g          = &(system->my_grid);
@@ -557,43 +557,43 @@ int Estimate_GCell_Population( reax_system* system, MPI_Comm comm )
       //  atoms[l].x[d] += big_box->box_norms[d];
       //else if( atoms[l].x[d] >= big_box->max[d] )
       //  atoms[l].x[d] -= big_box->box_norms[d];
-      
+
       c[d] = (int)((atoms[l].x[d]-my_ext_box->min[d])*g->inv_len[d]);
-      
+
       if( c[d] >= g->native_end[d] )
-	c[d] = g->native_end[d] - 1;
+        c[d] = g->native_end[d] - 1;
       else if( c[d] < g->native_str[d] )
-	c[d] = g->native_str[d];
+        c[d] = g->native_str[d];
     }
 #if defined(DEBUG)
-    fprintf( stderr, "p%d bin_my_atoms: l:%d - atom%d @ %.5f %.5f %.5f"	\
-	     "--> cell: %d %d %d\n",
-	     system->my_rank, l, atoms[l].orig_id, 
-	     atoms[l].x[0], atoms[l].x[1], atoms[l].x[2],
-	     c[0], c[1], c[2] );
+    fprintf( stderr, "p%d bin_my_atoms: l:%d - atom%d @ %.5f %.5f %.5f"        \
+             "--> cell: %d %d %d\n",
+             system->my_rank, l, atoms[l].orig_id,
+             atoms[l].x[0], atoms[l].x[1], atoms[l].x[2],
+             c[0], c[1], c[2] );
 #endif
     gc = &( g->cells[c[0]][c[1]][c[2]] );
     gc->top++;
   }
- 
+
   max_atoms = 0;
   for( i = 0; i < g->ncells[0]; i++ )
     for( j = 0; j < g->ncells[1]; j++ )
       for( k = 0; k < g->ncells[2]; k++ ) {
-	gc = &(g->cells[i][j][k]);
-	if( max_atoms < gc->top )
-	  max_atoms = gc->top;
+        gc = &(g->cells[i][j][k]);
+        if( max_atoms < gc->top )
+          max_atoms = gc->top;
 #if defined(DEBUG)
-	fprintf( stderr, "p%d gc[%d,%d,%d]->top=%d\n", 
-		 system->my_rank, i, j, k, gc->top );
+        fprintf( stderr, "p%d gc[%d,%d,%d]->top=%d\n",
+                 system->my_rank, i, j, k, gc->top );
 #endif
       }
 
-  my_max = (int)(MAX(max_atoms*SAFE_ZONE, MIN_GCELL_POPL)); 
+  my_max = (int)(MAX(max_atoms*SAFE_ZONE, MIN_GCELL_POPL));
   MPI_Allreduce( &my_max, &all_max, 1, MPI_INT, MPI_MAX, comm );
 #if defined(DEBUG)
-  fprintf( stderr, "p%d max_atoms=%d, my_max=%d, all_max=%d\n", 
-	   system->my_rank, max_atoms, my_max, all_max );
+  fprintf( stderr, "p%d max_atoms=%d, my_max=%d, all_max=%d\n",
+           system->my_rank, max_atoms, my_max, all_max );
 #endif
 
   return all_max;
@@ -605,7 +605,7 @@ void Allocate_Grid( reax_system *system, MPI_Comm comm )
   int i, j, k, l;
   grid *g;
   grid_cell *gc;
-  
+
   g = &( system->my_grid );
 
   /* allocate gcell reordering space */
@@ -613,29 +613,29 @@ void Allocate_Grid( reax_system *system, MPI_Comm comm )
 
   /* allocate the gcells for the new grid */
   g->max_nbrs = (2*g->vlist_span[0]+1)*(2*g->vlist_span[1]+1)*
-    (2*g->vlist_span[2]+1)+3; 
+    (2*g->vlist_span[2]+1)+3;
 
-  g->cells = (grid_cell***) 
+  g->cells = (grid_cell***)
     scalloc( g->ncells[0], sizeof(grid_cell**), "gcells", comm );
   for( i = 0; i < g->ncells[0]; i++ ) {
-    g->cells[i] = (grid_cell**) 
+    g->cells[i] = (grid_cell**)
       scalloc( g->ncells[1], sizeof(grid_cell*),"gcells[i]", comm );
-      
-    for( j = 0; j < g->ncells[1]; ++j )	{
-      g->cells[i][j] = (grid_cell*) 
-	scalloc( g->ncells[2], sizeof(grid_cell), "gcells[i][j]", comm );
+
+    for( j = 0; j < g->ncells[1]; ++j )        {
+      g->cells[i][j] = (grid_cell*)
+        scalloc( g->ncells[2], sizeof(grid_cell), "gcells[i][j]", comm );
 
       for( k = 0; k < g->ncells[2]; k++ ) {
-	gc = &(g->cells[i][j][k]);
-	gc->top = gc->mark = gc->str = gc->end = 0;
-	gc->nbrs = (grid_cell**) 
-	  scalloc( g->max_nbrs, sizeof(grid_cell*), "g:nbrs", comm );
-	gc->nbrs_x = (ivec*) 
-	  scalloc( g->max_nbrs, sizeof(ivec), "g:nbrs_x", comm );
-	gc->nbrs_cp = (rvec*) 
-	  scalloc( g->max_nbrs, sizeof(rvec), "g:nbrs_cp", comm );
-	for( l = 0; l < g->max_nbrs; ++l )
-	  gc->nbrs[l] = NULL;
+        gc = &(g->cells[i][j][k]);
+        gc->top = gc->mark = gc->str = gc->end = 0;
+        gc->nbrs = (grid_cell**)
+          scalloc( g->max_nbrs, sizeof(grid_cell*), "g:nbrs", comm );
+        gc->nbrs_x = (ivec*)
+          scalloc( g->max_nbrs, sizeof(ivec), "g:nbrs_x", comm );
+        gc->nbrs_cp = (rvec*)
+          scalloc( g->max_nbrs, sizeof(rvec), "g:nbrs_cp", comm );
+        for( l = 0; l < g->max_nbrs; ++l )
+          gc->nbrs[l] = NULL;
       }
     }
   }
@@ -644,21 +644,21 @@ void Allocate_Grid( reax_system *system, MPI_Comm comm )
   g->max_atoms = Estimate_GCell_Population( system, comm );
   /* space for storing atom id's is required only for native cells */
   for( i = g->native_str[0]; i < g->native_end[0]; ++i )
-    for( j = g->native_str[1]; j < g->native_end[1]; ++j )  
+    for( j = g->native_str[1]; j < g->native_end[1]; ++j )
       for( k = g->native_str[2]; k < g->native_end[2]; ++k )
-	g->cells[i][j][k].atoms = (int*) scalloc( g->max_atoms, sizeof(int), 
-						  "g:atoms", comm );
+        g->cells[i][j][k].atoms = (int*) scalloc( g->max_atoms, sizeof(int),
+                                                  "g:atoms", comm );
 #if defined(DEBUG_FOCUS)
   fprintf( stderr, "p%d-allocated %dx%dx%d grid: nbrs=%d atoms=%d space=%dMB\n",
-	   system->my_rank, g->ncells[0], g->ncells[1], g->ncells[2],
-	   g->max_nbrs, g->max_atoms,
-	   (int)
-	   ((g->total*sizeof(grid_cell)+g->total*g->max_nbrs*sizeof(int*) +
-	     g->total*g->max_nbrs*sizeof(rvec) + 
-	     (g->native_end[0]-g->native_str[0])*
-	     (g->native_end[1]-g->native_str[1])*
-	     (g->native_end[2]-g->native_str[2])*g->max_atoms*sizeof(int))/
-	    (1024*1024)) );
+           system->my_rank, g->ncells[0], g->ncells[1], g->ncells[2],
+           g->max_nbrs, g->max_atoms,
+           (int)
+           ((g->total*sizeof(grid_cell)+g->total*g->max_nbrs*sizeof(int*) +
+             g->total*g->max_nbrs*sizeof(rvec) +
+             (g->native_end[0]-g->native_str[0])*
+             (g->native_end[1]-g->native_str[1])*
+             (g->native_end[2]-g->native_str[2])*g->max_atoms*sizeof(int))/
+            (1024*1024)) );
 #endif
 }
 
@@ -674,12 +674,12 @@ void Deallocate_Grid( grid *g )
   for( i = 0; i < g->ncells[0]; i++ ) {
     for( j = 0; j < g->ncells[1]; j++ ) {
       for( k = 0; k < g->ncells[2]; k++ ) {
-	gc = &(g->cells[i][j][k]);
-	sfree( gc->nbrs, "g:nbrs" );
-	sfree( gc->nbrs_x, "g:nbrs_x" );
-	sfree( gc->nbrs_cp, "g:nbrs_cp" );
-	if(gc->atoms != NULL )
-	  sfree( gc->atoms, "g:atoms" );
+        gc = &(g->cells[i][j][k]);
+        sfree( gc->nbrs, "g:nbrs" );
+        sfree( gc->nbrs_x, "g:nbrs_x" );
+        sfree( gc->nbrs_cp, "g:nbrs_cp" );
+        if(gc->atoms != NULL )
+          sfree( gc->atoms, "g:atoms" );
       }
       sfree( g->cells[i][j], "g:cells[i][j]" );
     }
@@ -694,12 +694,12 @@ void Deallocate_Grid( grid *g )
     1- transfer an atom who has moved into other proc's domain (mpi_atom)
     2- exchange boundary atoms (boundary_atom)
     3- update position info for boundary atoms (mpi_rvec)
-    
+
     the largest space by far is required for the 2nd comm operation above.
-    buffers are void*, type cast to the correct pointer type to access 
+    buffers are void*, type cast to the correct pointer type to access
     the allocated buffers */
-int  Allocate_MPI_Buffers( mpi_datatypes *mpi_data, int est_recv, 
-			   neighbor_proc *my_nbrs, char *msg )
+int  Allocate_MPI_Buffers( mpi_datatypes *mpi_data, int est_recv,
+                           neighbor_proc *my_nbrs, char *msg )
 {
   int i;
   mpi_out_data  *mpi_buf;
@@ -708,22 +708,22 @@ int  Allocate_MPI_Buffers( mpi_datatypes *mpi_data, int est_recv,
   comm = mpi_data->world;
 
   /* in buffers */
-  mpi_data->in1_buffer = (void*) 
+  mpi_data->in1_buffer = (void*)
     scalloc( est_recv, sizeof(boundary_atom), "in1_buffer", comm );
-  mpi_data->in2_buffer = (void*) 
+  mpi_data->in2_buffer = (void*)
     scalloc( est_recv, sizeof(boundary_atom), "in2_buffer", comm );
-  
+
   /* out buffers */
   for( i = 0; i < MAX_NBRS; ++i ) {
     mpi_buf = &( mpi_data->out_buffers[i] );
     /* allocate storage for the neighbor processor i */
-    mpi_buf->index = (int*) 
+    mpi_buf->index = (int*)
       scalloc( my_nbrs[i].est_send, sizeof(int), "mpibuf:index", comm );
-    mpi_buf->out_atoms = (void*) 
-      scalloc( my_nbrs[i].est_send, sizeof(boundary_atom), "mpibuf:out_atoms", 
-	       comm );
+    mpi_buf->out_atoms = (void*)
+      scalloc( my_nbrs[i].est_send, sizeof(boundary_atom), "mpibuf:out_atoms",
+               comm );
   }
-  
+
   return SUCCESS;
 }
 
@@ -744,9 +744,9 @@ void Deallocate_MPI_Buffers( mpi_datatypes *mpi_data )
 }
 
 
-void ReAllocate( reax_system *system, control_params *control, 
-		 simulation_data *data, storage *workspace, reax_list **lists, 
-		 mpi_datatypes *mpi_data )
+void ReAllocate( reax_system *system, control_params *control,
+                 simulation_data *data, storage *workspace, reax_list **lists,
+                 mpi_datatypes *mpi_data )
 {
   int i, j, k, p;
   int num_bonds, est_3body, nflag, Nflag, Hflag, mpi_flag, ret, total_send;
@@ -766,22 +766,22 @@ void ReAllocate( reax_system *system, control_params *control,
 
 #if defined(DEBUG)
   fprintf( stderr, "p%d@reallocate: n: %d, N: %d, numH: %d\n",
-	   system->my_rank, system->n, system->N, system->numH );
+           system->my_rank, system->n, system->N, system->numH );
   fprintf( stderr, "p%d@reallocate: local_cap: %d, total_cap: %d, Hcap: %d\n",
-	   system->my_rank, system->local_cap, system->total_cap, 
-	   system->Hcap);
-  fprintf( stderr, "p%d: realloc.num_far: %d\n", 
-	   system->my_rank, realloc->num_far );
-  fprintf( stderr, "p%d: realloc.H: %d, realloc.Htop: %d\n", 
-	   system->my_rank, realloc->H, realloc->Htop );
-  fprintf( stderr, "p%d: realloc.Hbonds: %d, realloc.num_hbonds: %d\n", 
-	   system->my_rank, realloc->hbonds, realloc->num_hbonds );
-  fprintf( stderr, "p%d: realloc.bonds: %d, num_bonds: %d\n", 
-	   system->my_rank, realloc->bonds, realloc->num_bonds );
-  fprintf( stderr, "p%d: realloc.num_3body: %d\n", 
-	   system->my_rank, realloc->num_3body );
+           system->my_rank, system->local_cap, system->total_cap,
+           system->Hcap);
+  fprintf( stderr, "p%d: realloc.num_far: %d\n",
+           system->my_rank, realloc->num_far );
+  fprintf( stderr, "p%d: realloc.H: %d, realloc.Htop: %d\n",
+           system->my_rank, realloc->H, realloc->Htop );
+  fprintf( stderr, "p%d: realloc.Hbonds: %d, realloc.num_hbonds: %d\n",
+           system->my_rank, realloc->hbonds, realloc->num_hbonds );
+  fprintf( stderr, "p%d: realloc.bonds: %d, num_bonds: %d\n",
+           system->my_rank, realloc->bonds, realloc->num_bonds );
+  fprintf( stderr, "p%d: realloc.num_3body: %d\n",
+           system->my_rank, realloc->num_3body );
 #endif
-  
+
   // IMPORTANT: LOOSE ZONES CHECKS ARE DISABLED FOR NOW BY &&'ing with 0!!!
   nflag = 0;
   if( system->n >= DANGER_ZONE * system->local_cap ||
@@ -801,25 +801,25 @@ void ReAllocate( reax_system *system, control_params *control,
     /* system */
 #if defined(DEBUG_FOCUS)
     fprintf( stderr, "p%d: reallocating system and workspace -"\
-	     "n=%d  N=%d  local_cap=%d  total_cap=%d\n",
-	     system->my_rank, system->n, system->N, 
-	     system->local_cap, system->total_cap );
+             "n=%d  N=%d  local_cap=%d  total_cap=%d\n",
+             system->my_rank, system->n, system->N,
+             system->local_cap, system->total_cap );
 #endif
     ret = Allocate_System( system, system->local_cap, system->total_cap, msg );
     if( ret != SUCCESS ) {
       fprintf( stderr, "not enough space for atom_list: total_cap=%d",
-	       system->total_cap );
+               system->total_cap );
       fprintf( stderr, "terminating...\n" );
       MPI_Abort( comm, INSUFFICIENT_MEMORY );
     }
-    
+
     /* workspace */
     DeAllocate_Workspace( control, workspace );
-    ret = Allocate_Workspace( system, control, workspace, system->local_cap, 
-			      system->total_cap, comm, msg );
+    ret = Allocate_Workspace( system, control, workspace, system->local_cap,
+                              system->total_cap, comm, msg );
     if( ret != SUCCESS ) {
       fprintf( stderr, "no space for workspace: local_cap=%d total_cap=%d",
-	       system->local_cap, system->total_cap );
+               system->local_cap, system->total_cap );
       fprintf( stderr, "terminating...\n" );
       MPI_Abort( comm, INSUFFICIENT_MEMORY );
     }
@@ -833,19 +833,19 @@ void ReAllocate( reax_system *system, control_params *control,
 
     if( Nflag || realloc->num_far >= far_nbrs->num_intrs * DANGER_ZONE ) {
       if( realloc->num_far > far_nbrs->num_intrs ) {
-	fprintf( stderr, "step%d-ran out of space on far_nbrs: top=%d, max=%d",
-		 data->step, realloc->num_far, far_nbrs->num_intrs );
-	MPI_Abort( comm, INSUFFICIENT_MEMORY );
+        fprintf( stderr, "step%d-ran out of space on far_nbrs: top=%d, max=%d",
+                 data->step, realloc->num_far, far_nbrs->num_intrs );
+        MPI_Abort( comm, INSUFFICIENT_MEMORY );
       }
 
-      newsize = static_cast<int> 
-	(MAX( realloc->num_far*SAFE_ZONE, MIN_CAP*MIN_NBRS ));      
+      newsize = static_cast<int>
+        (MAX( realloc->num_far*SAFE_ZONE, MIN_CAP*MIN_NBRS ));
 #if defined(DEBUG_FOCUS)
-      fprintf( stderr, "p%d: reallocating far_nbrs: num_fars=%d, space=%dMB\n", 
-	       system->my_rank, (int)(realloc->num_far*SAFE_ZONE), 
-	       (newsize*sizeof(far_neighbor_data)/(1024*1024)) );
+      fprintf( stderr, "p%d: reallocating far_nbrs: num_fars=%d, space=%dMB\n",
+               system->my_rank, (int)(realloc->num_far*SAFE_ZONE),
+               (newsize*sizeof(far_neighbor_data)/(1024*1024)) );
 #endif
-      
+
       Reallocate_Neighbor_List( far_nbrs, system->total_cap, newsize, comm );
       realloc->num_far = 0;
     }
@@ -856,22 +856,22 @@ void ReAllocate( reax_system *system, control_params *control,
   H = workspace->H;
   if( nflag || realloc->Htop >= H->m * DANGER_ZONE ) {
     if( realloc->Htop > H->m ) {
-      fprintf( stderr, 
-	       "step%d - ran out of space on H matrix: Htop=%d, max = %d",
-	       data->step, realloc->Htop, H->m );
+      fprintf( stderr,
+               "step%d - ran out of space on H matrix: Htop=%d, max = %d",
+               data->step, realloc->Htop, H->m );
       MPI_Abort( comm, INSUFFICIENT_MEMORY );
     }
 #if defined(DEBUG_FOCUS)
-    fprintf( stderr, "p%d: reallocating H matrix: Htop=%d, space=%dMB\n", 
-	     system->my_rank, (int)(realloc->Htop*SAFE_ZONE), 
-	     (int)(realloc->Htop * SAFE_ZONE * sizeof(sparse_matrix_entry) / 
-		   (1024*1024)) );
+    fprintf( stderr, "p%d: reallocating H matrix: Htop=%d, space=%dMB\n",
+             system->my_rank, (int)(realloc->Htop*SAFE_ZONE),
+             (int)(realloc->Htop * SAFE_ZONE * sizeof(sparse_matrix_entry) /
+                   (1024*1024)) );
 #endif
 
-    newsize = static_cast<int> 
-	(MAX( realloc->Htop*SAFE_ZONE, MIN_CAP*MIN_NBRS ));
-    Reallocate_Matrix( &(workspace->H), system->local_cap, 
-		       newsize, "H", comm );
+    newsize = static_cast<int>
+        (MAX( realloc->Htop*SAFE_ZONE, MIN_CAP*MIN_NBRS ));
+    Reallocate_Matrix( &(workspace->H), system->local_cap,
+                       newsize, "H", comm );
     //Deallocate_Matrix( workspace->L );
     //Deallocate_Matrix( workspace->U );
     workspace->L = NULL;
@@ -881,10 +881,10 @@ void ReAllocate( reax_system *system, control_params *control,
 #endif /*PURE_REAX*/
 
   /* hydrogen bonds list */
-  if( control->hbond_cut > 0 ) { 
+  if( control->hbond_cut > 0 ) {
     Hflag = 0;
-    if( system->numH >= DANGER_ZONE * system->Hcap || 
-	(0 && system->numH <= LOOSE_ZONE * system->Hcap) ) {
+    if( system->numH >= DANGER_ZONE * system->Hcap ||
+        (0 && system->numH <= LOOSE_ZONE * system->Hcap) ) {
       Hflag = 1;
       system->Hcap = int(MAX( system->numH * SAFER_ZONE, MIN_CAP ));
     }
@@ -894,7 +894,7 @@ void ReAllocate( reax_system *system, control_params *control,
       realloc->hbonds = 0;
 #if defined(DEBUG_FOCUS)
       fprintf(stderr, "p%d: reallocating hbonds: total_hbonds=%d space=%dMB\n",
-	      system->my_rank, ret, (int)(ret*sizeof(hbond_data)/(1024*1024)));
+              system->my_rank, ret, (int)(ret*sizeof(hbond_data)/(1024*1024)));
 #endif
     }
   }
@@ -902,14 +902,14 @@ void ReAllocate( reax_system *system, control_params *control,
   /* bonds list */
   num_bonds = est_3body = -1;
   if( Nflag || realloc->bonds ){
-    Reallocate_Bonds_List( system, (*lists)+BONDS, &num_bonds, 
-			   &est_3body, comm );
+    Reallocate_Bonds_List( system, (*lists)+BONDS, &num_bonds,
+                           &est_3body, comm );
     realloc->bonds = 0;
     realloc->num_3body = MAX( realloc->num_3body, est_3body );
 #if defined(DEBUG_FOCUS)
-    fprintf( stderr, "p%d: reallocating bonds: total_bonds=%d, space=%dMB\n", 
-	     system->my_rank, num_bonds, 
-	     (int)(num_bonds*sizeof(bond_data)/(1024*1024)) );
+    fprintf( stderr, "p%d: reallocating bonds: total_bonds=%d, space=%dMB\n",
+             system->my_rank, num_bonds,
+             (int)(num_bonds*sizeof(bond_data)/(1024*1024)) );
 #endif
   }
 
@@ -917,19 +917,19 @@ void ReAllocate( reax_system *system, control_params *control,
   if( realloc->num_3body > 0 ) {
 #if defined(DEBUG_FOCUS)
     fprintf( stderr, "p%d: reallocating 3body list: num_3body=%d, space=%dMB\n",
-	     system->my_rank, realloc->num_3body, 
-	     (int)(realloc->num_3body * sizeof(three_body_interaction_data) / 
-		   (1024*1024)) );
+             system->my_rank, realloc->num_3body,
+             (int)(realloc->num_3body * sizeof(three_body_interaction_data) /
+                   (1024*1024)) );
 #endif
     Delete_List( (*lists)+THREE_BODIES, comm );
-    
+
     if( num_bonds == -1 )
       num_bonds = ((*lists)+BONDS)->num_intrs;
 
     realloc->num_3body = (int)(MAX(realloc->num_3body*SAFE_ZONE, MIN_3BODIES));
 
-    if( !Make_List( num_bonds, realloc->num_3body, TYP_THREE_BODY, 
-		    (*lists)+THREE_BODIES, comm ) ) {
+    if( !Make_List( num_bonds, realloc->num_3body, TYP_THREE_BODY,
+                    (*lists)+THREE_BODIES, comm ) ) {
       fprintf( stderr, "Problem in initializing angles list. Terminating!\n" );
       MPI_Abort( comm, CANNOT_INITIALIZE );
     }
@@ -944,22 +944,22 @@ void ReAllocate( reax_system *system, control_params *control,
 #endif
     for( i = g->native_str[0]; i < g->native_end[0]; i++ )
       for( j = g->native_str[1]; j < g->native_end[1]; j++ )
-	for( k = g->native_str[2]; k < g->native_end[2]; k++ ) {
-	  // reallocate g->atoms
-	  sfree( g->cells[i][j][k].atoms, "g:atoms" );  
-	  g->cells[i][j][k].atoms = (int*) 
-	    scalloc( realloc->gcell_atoms, sizeof(int), "g:atoms", comm);
-	}
+        for( k = g->native_str[2]; k < g->native_end[2]; k++ ) {
+          // reallocate g->atoms
+          sfree( g->cells[i][j][k].atoms, "g:atoms" );
+          g->cells[i][j][k].atoms = (int*)
+            scalloc( realloc->gcell_atoms, sizeof(int), "g:atoms", comm);
+        }
     realloc->gcell_atoms = -1;
   }
 
   /* mpi buffers */
-  // we have to be at a renbring step - 
+  // we have to be at a renbring step -
   // to ensure correct values at mpi_buffers for update_boundary_positions
   if( !renbr )
     mpi_flag = 0;
   // check whether in_buffer capacity is enough
-  else if( system->max_recved >= system->est_recv * 0.90 ) 
+  else if( system->max_recved >= system->est_recv * 0.90 )
     mpi_flag = 1;
   else {
     // otherwise check individual outgoing buffers
@@ -968,8 +968,8 @@ void ReAllocate( reax_system *system, control_params *control,
       nbr_pr   = &( system->my_nbrs[p] );
       nbr_data = &( mpi_data->out_buffers[p] );
       if( nbr_data->cnt >= nbr_pr->est_send * 0.90 ) {
-	mpi_flag = 1;
-	break;
+        mpi_flag = 1;
+        break;
       }
     }
   }
@@ -977,14 +977,14 @@ void ReAllocate( reax_system *system, control_params *control,
   if( mpi_flag ) {
 #if defined(DEBUG_FOCUS)
     fprintf( stderr, "p%d: reallocating mpi_buf: old_recv=%d\n",
-	     system->my_rank, system->est_recv );
-    for( p = 0; p < MAX_NBRS; ++p ) 
-      fprintf( stderr, "p%d: nbr%d old_send=%d\n", 
-	       system->my_rank, p, system->my_nbrs[p].est_send );
+             system->my_rank, system->est_recv );
+    for( p = 0; p < MAX_NBRS; ++p )
+      fprintf( stderr, "p%d: nbr%d old_send=%d\n",
+               system->my_rank, p, system->my_nbrs[p].est_send );
 #endif
     /* update mpi buffer estimates based on last comm */
     system->est_recv = MAX( system->max_recved*SAFER_ZONE, MIN_SEND );
-    system->est_trans = 
+    system->est_trans =
       (system->est_recv * sizeof(boundary_atom)) / sizeof(mpi_atom);
     total_send = 0;
     for( p = 0; p < MAX_NBRS; ++p ) {
@@ -995,18 +995,18 @@ void ReAllocate( reax_system *system, control_params *control,
     }
 #if defined(DEBUG_FOCUS)
     fprintf( stderr, "p%d: reallocating mpi_buf: recv=%d send=%d total=%dMB\n",
-	     system->my_rank, system->est_recv, total_send,
-	     (int)((system->est_recv+total_send)*sizeof(boundary_atom)/
-		   (1024*1024)));
-    for( p = 0; p < MAX_NBRS; ++p ) 
-      fprintf( stderr, "p%d: nbr%d new_send=%d\n", 
-	       system->my_rank, p, system->my_nbrs[p].est_send );
+             system->my_rank, system->est_recv, total_send,
+             (int)((system->est_recv+total_send)*sizeof(boundary_atom)/
+                   (1024*1024)));
+    for( p = 0; p < MAX_NBRS; ++p )
+      fprintf( stderr, "p%d: nbr%d new_send=%d\n",
+               system->my_rank, p, system->my_nbrs[p].est_send );
 #endif
 
     /* reallocate mpi buffers */
     Deallocate_MPI_Buffers( mpi_data );
-    ret = Allocate_MPI_Buffers( mpi_data, system->est_recv, 
-				system->my_nbrs, msg );
+    ret = Allocate_MPI_Buffers( mpi_data, system->est_recv,
+                                system->my_nbrs, msg );
     if( ret != SUCCESS ) {
       fprintf( stderr, "%s", msg );
       fprintf( stderr, "terminating...\n" );
@@ -1015,9 +1015,9 @@ void ReAllocate( reax_system *system, control_params *control,
   }
 #endif /*PURE_REAX*/
 
-#if defined(DEBUG_FOCUS) 
-  fprintf( stderr, "p%d @ step%d: reallocate done\n", 
-	   system->my_rank, data->step );
+#if defined(DEBUG_FOCUS)
+  fprintf( stderr, "p%d @ step%d: reallocate done\n",
+           system->my_rank, data->step );
   MPI_Barrier( comm );
 #endif
 }
diff --git a/src/USER-REAXC/reaxc_allocate.h b/src/USER-REAXC/reaxc_allocate.h
index e3d9049c57..0ad5f1a710 100644
--- a/src/USER-REAXC/reaxc_allocate.h
+++ b/src/USER-REAXC/reaxc_allocate.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -34,8 +34,8 @@ void reax_atom_Copy( reax_atom*, reax_atom* );
 int  Allocate_System( reax_system*, int, int, char* );
 void DeAllocate_System( reax_system* );
 
-int  Allocate_Workspace( reax_system*, control_params*, storage*, 
-			 int, int, MPI_Comm, char* );
+int  Allocate_Workspace( reax_system*, control_params*, storage*,
+                         int, int, MPI_Comm, char* );
 void DeAllocate_Workspace( control_params*, storage* );
 
 void Allocate_Grid( reax_system*, MPI_Comm );
@@ -49,6 +49,6 @@ int  Allocate_HBond_List( int, int, int*, int*, reax_list* );
 
 int  Allocate_Bond_List( int, int*, reax_list* );
 
-void ReAllocate( reax_system*, control_params*, simulation_data*, storage*, 
-		 reax_list**, mpi_datatypes* );
+void ReAllocate( reax_system*, control_params*, simulation_data*, storage*,
+                 reax_list**, mpi_datatypes* );
 #endif
diff --git a/src/USER-REAXC/reaxc_basic_comm.cpp b/src/USER-REAXC/reaxc_basic_comm.cpp
index 1a0452ed97..bd7b857d6d 100644
--- a/src/USER-REAXC/reaxc_basic_comm.cpp
+++ b/src/USER-REAXC/reaxc_basic_comm.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -67,8 +67,8 @@ void rvec2_packer( void *dummy, mpi_out_data *out_buf )
 }
 
 
-void Dist( reax_system* system, mpi_datatypes *mpi_data, 
-	   void *buf, MPI_Datatype type, int scale, dist_packer pack )
+void Dist( reax_system* system, mpi_datatypes *mpi_data,
+           void *buf, MPI_Datatype type, int scale, dist_packer pack )
 {
   int d;
   mpi_out_data *out_bufs;
@@ -87,27 +87,27 @@ void Dist( reax_system* system, mpi_datatypes *mpi_data,
     /* initiate recvs */
     nbr1 = &(system->my_nbrs[2*d]);
     if( nbr1->atoms_cnt )
-      MPI_Irecv( buf + nbr1->atoms_str*scale, nbr1->atoms_cnt, type, 
-		 nbr1->rank, 2*d+1,comm, &req1 );
-    
+      MPI_Irecv( buf + nbr1->atoms_str*scale, nbr1->atoms_cnt, type,
+                 nbr1->rank, 2*d+1,comm, &req1 );
+
     nbr2 = &(system->my_nbrs[2*d+1]);
     if( nbr2->atoms_cnt )
-      MPI_Irecv( buf + nbr2->atoms_str*scale, nbr2->atoms_cnt, type, 
-		 nbr2->rank, 2*d, comm, &req2 );
+      MPI_Irecv( buf + nbr2->atoms_str*scale, nbr2->atoms_cnt, type,
+                 nbr2->rank, 2*d, comm, &req2 );
 
     /* send both messages in dimension d */
     if( out_bufs[2*d].cnt ) {
       pack( buf, out_bufs + (2*d) );
-      MPI_Send( out_bufs[2*d].out_atoms, out_bufs[2*d].cnt, type, 
-		nbr1->rank, 2*d, comm );
+      MPI_Send( out_bufs[2*d].out_atoms, out_bufs[2*d].cnt, type,
+                nbr1->rank, 2*d, comm );
     }
-    
+
     if( out_bufs[2*d+1].cnt ) {
       pack( buf, out_bufs + (2*d+1) );
-      MPI_Send( out_bufs[2*d+1].out_atoms, out_bufs[2*d+1].cnt, type, 
-		nbr2->rank, 2*d+1, comm );
+      MPI_Send( out_bufs[2*d+1].out_atoms, out_bufs[2*d+1].cnt, type,
+                nbr2->rank, 2*d+1, comm );
     }
-    
+
     if( nbr1->atoms_cnt ) MPI_Wait( &req1, &stat1 );
     if( nbr2->atoms_cnt ) MPI_Wait( &req2, &stat2 );
   }
@@ -123,7 +123,7 @@ void real_unpacker( void *dummy_in, void *dummy_buf, mpi_out_data *out_buf )
   int i;
   real *in = (real*) dummy_in;
   real *buf = (real*) dummy_buf;
-  
+
   for( i = 0; i < out_buf->cnt; ++i )
     buf[ out_buf->index[i] ] += in[i];
 }
@@ -138,8 +138,8 @@ void rvec_unpacker( void *dummy_in, void *dummy_buf, mpi_out_data *out_buf )
   for( i = 0; i < out_buf->cnt; ++i ) {
     rvec_Add( buf[ out_buf->index[i] ], in[i] );
 #if defined(DEBUG)
-    fprintf( stderr, "rvec_unpacker: cnt=%d  i =%d  index[i]=%d\n", 
-	     out_buf->cnt, i, out_buf->index[i] );
+    fprintf( stderr, "rvec_unpacker: cnt=%d  i =%d  index[i]=%d\n",
+             out_buf->cnt, i, out_buf->index[i] );
 #endif
   }
 }
@@ -158,8 +158,8 @@ void rvec2_unpacker( void *dummy_in, void *dummy_buf, mpi_out_data *out_buf )
 }
 
 
-void Coll( reax_system* system, mpi_datatypes *mpi_data, 
-	   void *buf, MPI_Datatype type, int scale, coll_unpacker unpack )
+void Coll( reax_system* system, mpi_datatypes *mpi_data,
+           void *buf, MPI_Datatype type, int scale, coll_unpacker unpack )
 {
   int d;
   void *in1, *in2;
@@ -189,27 +189,27 @@ void Coll( reax_system* system, mpi_datatypes *mpi_data,
 
     /* send both messages in dimension d */
     if( nbr1->atoms_cnt )
-      MPI_Send( buf + nbr1->atoms_str*scale, nbr1->atoms_cnt, type, 
-		nbr1->rank, 2*d, comm );
-    
+      MPI_Send( buf + nbr1->atoms_str*scale, nbr1->atoms_cnt, type,
+                nbr1->rank, 2*d, comm );
+
     if( nbr2->atoms_cnt )
-      MPI_Send( buf + nbr2->atoms_str*scale, nbr2->atoms_cnt, type, 
-		nbr2->rank, 2*d+1, comm );
+      MPI_Send( buf + nbr2->atoms_str*scale, nbr2->atoms_cnt, type,
+                nbr2->rank, 2*d+1, comm );
 
 #if defined(DEBUG)
-    fprintf( stderr, "p%d coll[%d] nbr1: str=%d cnt=%d recv=%d\n", 
-	     system->my_rank, d, nbr1->atoms_str, nbr1->atoms_cnt, 
-	     out_bufs[2*d].cnt );
-    fprintf( stderr, "p%d coll[%d] nbr2: str=%d cnt=%d recv=%d\n", 
-	     system->my_rank, d, nbr2->atoms_str, nbr2->atoms_cnt, 
-	     out_bufs[2*d+1].cnt );
+    fprintf( stderr, "p%d coll[%d] nbr1: str=%d cnt=%d recv=%d\n",
+             system->my_rank, d, nbr1->atoms_str, nbr1->atoms_cnt,
+             out_bufs[2*d].cnt );
+    fprintf( stderr, "p%d coll[%d] nbr2: str=%d cnt=%d recv=%d\n",
+             system->my_rank, d, nbr2->atoms_str, nbr2->atoms_cnt,
+             out_bufs[2*d+1].cnt );
 #endif
 
     if( out_bufs[2*d].cnt ) {
       MPI_Wait( &req1, &stat1 );
       unpack( in1, buf, out_bufs + (2*d) );
     }
-    
+
     if( out_bufs[2*d+1].cnt ) {
       MPI_Wait( &req2, &stat2 );
       unpack( in2, buf, out_bufs + (2*d+1) );
@@ -272,14 +272,14 @@ real Parallel_Vector_Acc( real *v, int n, MPI_Comm comm )
 
 /*****************************************************************************/
 #if defined(TEST_FORCES)
-void Coll_ids_at_Master( reax_system *system, storage *workspace, 
-			 mpi_datatypes *mpi_data )
+void Coll_ids_at_Master( reax_system *system, storage *workspace,
+                         mpi_datatypes *mpi_data )
 {
   int i;
   int *id_list;
 
-  MPI_Gather( &system->n, 1, MPI_INT, workspace->rcounts, 1, MPI_INT, 
-	      MASTER_NODE, mpi_data->world ); 
+  MPI_Gather( &system->n, 1, MPI_INT, workspace->rcounts, 1, MPI_INT,
+              MASTER_NODE, mpi_data->world );
 
   if( system->my_rank == MASTER_NODE ){
     workspace->displs[0] = 0;
@@ -290,10 +290,10 @@ void Coll_ids_at_Master( reax_system *system, storage *workspace,
   id_list = (int*) malloc( system->n * sizeof(int) );
   for( i = 0; i < system->n; ++i )
     id_list[i] = system->my_atoms[i].orig_id;
-  
-  MPI_Gatherv( id_list, system->n, MPI_INT, 
-	       workspace->id_all, workspace->rcounts, workspace->displs, 
-	       MPI_INT, MASTER_NODE, mpi_data->world );
+
+  MPI_Gatherv( id_list, system->n, MPI_INT,
+               workspace->id_all, workspace->rcounts, workspace->displs,
+               MPI_INT, MASTER_NODE, mpi_data->world );
 
   free( id_list );
 
@@ -306,12 +306,12 @@ void Coll_ids_at_Master( reax_system *system, storage *workspace,
 }
 
 
-void Coll_rvecs_at_Master( reax_system *system, storage *workspace, 
-			   mpi_datatypes *mpi_data, rvec* v )
+void Coll_rvecs_at_Master( reax_system *system, storage *workspace,
+                           mpi_datatypes *mpi_data, rvec* v )
 {
-  MPI_Gatherv( v, system->n, mpi_data->mpi_rvec, 
-	       workspace->f_all, workspace->rcounts, workspace->displs, 
-	       mpi_data->mpi_rvec, MASTER_NODE, mpi_data->world );
+  MPI_Gatherv( v, system->n, mpi_data->mpi_rvec,
+               workspace->f_all, workspace->rcounts, workspace->displs,
+               mpi_data->mpi_rvec, MASTER_NODE, mpi_data->world );
 }
 
 #endif
diff --git a/src/USER-REAXC/reaxc_basic_comm.h b/src/USER-REAXC/reaxc_basic_comm.h
index de9f7a5316..95cfe11b49 100644
--- a/src/USER-REAXC/reaxc_basic_comm.h
+++ b/src/USER-REAXC/reaxc_basic_comm.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -37,8 +37,8 @@ void Dist(reax_system*, mpi_datatypes*, void*, MPI_Datatype, int, dist_packer);
 void real_unpacker( void*, void*, mpi_out_data* );
 void rvec_unpacker( void*, void*, mpi_out_data* );
 void rvec2_unpacker( void*, void*, mpi_out_data* );
-void Coll( reax_system*, mpi_datatypes*, void*, MPI_Datatype, 
-	   int, coll_unpacker );
+void Coll( reax_system*, mpi_datatypes*, void*, MPI_Datatype,
+           int, coll_unpacker );
 
 real Parallel_Norm( real*, int, MPI_Comm );
 real Parallel_Dot( real*, real*, int, MPI_Comm );
diff --git a/src/USER-REAXC/reaxc_bond_orders.cpp b/src/USER-REAXC/reaxc_bond_orders.cpp
index 19ede46cea..297fb8fbfc 100644
--- a/src/USER-REAXC/reaxc_bond_orders.cpp
+++ b/src/USER-REAXC/reaxc_bond_orders.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -38,25 +38,25 @@
 #endif
 
 #ifdef TEST_FORCES
-void Get_dBO( reax_system *system, reax_list **lists, 
-	      int i, int pj, real C, rvec *v )
+void Get_dBO( reax_system *system, reax_list **lists,
+              int i, int pj, real C, rvec *v )
 {
   reax_list *bonds = (*lists) + BONDS;
   reax_list *dBOs = (*lists) + DBOS;
   int start_pj, end_pj, k;
-  
+
   pj = bonds->select.bond_list[pj].dbond_index;
   start_pj = Start_Index(pj, dBOs);
   end_pj = End_Index(pj, dBOs);
 
   for( k = start_pj; k < end_pj; ++k )
-    rvec_Scale( v[dBOs->select.dbo_list[k].wrt], 
-		C, dBOs->select.dbo_list[k].dBO );  
+    rvec_Scale( v[dBOs->select.dbo_list[k].wrt],
+                C, dBOs->select.dbo_list[k].dBO );
 }
 
 
-void Get_dBOpinpi2( reax_system *system, reax_list **lists, 
-		    int i, int pj, real Cpi, real Cpi2, rvec *vpi, rvec *vpi2 )
+void Get_dBOpinpi2( reax_system *system, reax_list **lists,
+                    int i, int pj, real Cpi, real Cpi2, rvec *vpi, rvec *vpi2 )
 {
   reax_list *bonds = (*lists) + BONDS;
   reax_list *dBOs = (*lists) + DBOS;
@@ -76,8 +76,8 @@ void Get_dBOpinpi2( reax_system *system, reax_list **lists,
 }
 
 
-void Add_dBO( reax_system *system, reax_list **lists, 
-	      int i, int pj, real C, rvec *v )
+void Add_dBO( reax_system *system, reax_list **lists,
+              int i, int pj, real C, rvec *v )
 {
   reax_list *bonds = (*lists) + BONDS;
   reax_list *dBOs = (*lists) + DBOS;
@@ -89,14 +89,14 @@ void Add_dBO( reax_system *system, reax_list **lists,
   //fprintf( stderr, "i=%d j=%d start=%d end=%d\n", i, pj, start_pj, end_pj );
 
   for( k = start_pj; k < end_pj; ++k )
-    rvec_ScaledAdd( v[dBOs->select.dbo_list[k].wrt], 
-		    C, dBOs->select.dbo_list[k].dBO );
+    rvec_ScaledAdd( v[dBOs->select.dbo_list[k].wrt],
+                    C, dBOs->select.dbo_list[k].dBO );
 
 }
 
 
-void Add_dBOpinpi2( reax_system *system, reax_list **lists, 
-		    int i, int pj, real Cpi, real Cpi2, rvec *vpi, rvec *vpi2 )
+void Add_dBOpinpi2( reax_system *system, reax_list **lists,
+                    int i, int pj, real Cpi, real Cpi2, rvec *vpi, rvec *vpi2 )
 {
   reax_list *bonds = (*lists) + BONDS;
   reax_list *dBOs = (*lists) + DBOS;
@@ -116,8 +116,8 @@ void Add_dBOpinpi2( reax_system *system, reax_list **lists,
 }
 
 
-void Add_dBO_to_Forces( reax_system *system, reax_list **lists, 
-			int i, int pj, real C )
+void Add_dBO_to_Forces( reax_system *system, reax_list **lists,
+                        int i, int pj, real C )
 {
   reax_list *bonds = (*lists) + BONDS;
   reax_list *dBOs = (*lists) + DBOS;
@@ -128,13 +128,13 @@ void Add_dBO_to_Forces( reax_system *system, reax_list **lists,
   end_pj = End_Index(pj, dBOs);
 
   for( k = start_pj; k < end_pj; ++k )
-    rvec_ScaledAdd( system->my_atoms[dBOs->select.dbo_list[k].wrt].f, 
-		    C, dBOs->select.dbo_list[k].dBO );
+    rvec_ScaledAdd( system->my_atoms[dBOs->select.dbo_list[k].wrt].f,
+                    C, dBOs->select.dbo_list[k].dBO );
 }
 
 
-void Add_dBOpinpi2_to_Forces( reax_system *system, reax_list **lists, 
-			      int i, int pj, real Cpi, real Cpi2 )
+void Add_dBOpinpi2_to_Forces( reax_system *system, reax_list **lists,
+                              int i, int pj, real Cpi, real Cpi2 )
 {
   reax_list *bonds = (*lists) + BONDS;
   reax_list *dBOs = (*lists) + DBOS;
@@ -162,13 +162,13 @@ void Add_dDelta( reax_system *system, reax_list **lists, int i, real C, rvec *v
   int k;
 
   for( k = start; k < end; ++k )
-    rvec_ScaledAdd( v[dDeltas->select.dDelta_list[k].wrt], 
-		    C, dDeltas->select.dDelta_list[k].dVal );
+    rvec_ScaledAdd( v[dDeltas->select.dDelta_list[k].wrt],
+                    C, dDeltas->select.dDelta_list[k].dVal );
 }
 
 
-void Add_dDelta_to_Forces( reax_system *system, reax_list **lists, 
-			   int i, real C )
+void Add_dDelta_to_Forces( reax_system *system, reax_list **lists,
+                           int i, real C )
 {
   reax_list *dDeltas = &((*lists)[DDELTAS]);
   int start = Start_Index(i, dDeltas);
@@ -176,14 +176,14 @@ void Add_dDelta_to_Forces( reax_system *system, reax_list **lists,
   int k;
 
   for( k = start; k < end; ++k )
-    rvec_ScaledAdd( system->my_atoms[dDeltas->select.dDelta_list[k].wrt].f, 
-		    C, dDeltas->select.dDelta_list[k].dVal );
+    rvec_ScaledAdd( system->my_atoms[dDeltas->select.dDelta_list[k].wrt].f,
+                    C, dDeltas->select.dDelta_list[k].dVal );
 }
 
 
 
-void Calculate_dBO( int i, int pj, 
-		    storage *workspace, reax_list **lists, int *top )
+void Calculate_dBO( int i, int pj,
+                    storage *workspace, reax_list **lists, int *top )
 {
   /* Initializations */
   reax_list *bonds, *dBOs;
@@ -191,7 +191,7 @@ void Calculate_dBO( int i, int pj,
   bond_data *nbr_l, *nbr_k;
   bond_order_data *bo_ij;
   dbond_data *top_dbo;
-  
+
   //  rvec due_j[1000], due_i[1000];
   //  rvec due_j_pi[1000], due_i_pi[1000];
 
@@ -218,77 +218,77 @@ void Calculate_dBO( int i, int pj,
 
     for( ; l < end_j && bonds->select.bond_list[l].nbr < nbr_k->nbr; ++l ) {
       /* These are the neighbors of j which are not in the nbr_list of i
-	 Note that they might also include i! */
+         Note that they might also include i! */
       nbr_l = &(bonds->select.bond_list[l]);
       top_dbo->wrt = nbr_l->nbr;
-   
-      //rvec_ScaledAdd( due_j[top_dbo->wrt], 
-      //                -bo_ij->BO * bo_ij->A2_ji, nbr_l->bo_data.dBOp ); 
-	
+
+      //rvec_ScaledAdd( due_j[top_dbo->wrt],
+      //                -bo_ij->BO * bo_ij->A2_ji, nbr_l->bo_data.dBOp );
+
       /*3rd, dBO*/
       rvec_Scale( top_dbo->dBO, -bo_ij->C3dbo, nbr_l->bo_data.dBOp );
       /*4th, dBOpi*/
       rvec_Scale( top_dbo->dBOpi, -bo_ij->C4dbopi, nbr_l->bo_data.dBOp );
       /*4th, dBOpp*/
       rvec_Scale( top_dbo->dBOpi2, -bo_ij->C4dbopi2, nbr_l->bo_data.dBOp );
-	  
+
       if( nbr_l->nbr == i ) {
-	/* do the adjustments on i */       
-	//rvec_ScaledAdd( due_i[i], bo_ij->A0_ij+bo_ij->BO*bo_ij->A1_ij,
-	//                bo_ij->dBOp );  /*1st, dBO*/
-	//rvec_ScaledAdd( due_i[i], bo_ij->BO * bo_ij->A2_ij, 
-	//                workspace->dDeltap_self[i] ); /*2nd, dBO*/
- 
-	/*1st, dBO*/
-	rvec_ScaledAdd( top_dbo->dBO, bo_ij->C1dbo, bo_ij->dBOp );
-	/*2nd, dBO*/
-	rvec_ScaledAdd( top_dbo->dBO, 
-			bo_ij->C2dbo, workspace->dDeltap_self[i] );
-
-	/*1st, dBOpi*/
-	rvec_ScaledAdd(top_dbo->dBOpi,bo_ij->C1dbopi,bo_ij->dln_BOp_pi );
-	/*2nd, dBOpi*/
-	rvec_ScaledAdd( top_dbo->dBOpi, bo_ij->C2dbopi, bo_ij->dBOp );
-	/*3rd, dBOpi*/
-	rvec_ScaledAdd( top_dbo->dBOpi, 
-			bo_ij->C3dbopi, workspace->dDeltap_self[i] );
-	      
-	/*1st, dBO_p*/
-	rvec_ScaledAdd( top_dbo->dBOpi2, 
-			bo_ij->C1dbopi2, bo_ij->dln_BOp_pi2 );
-	/*2nd, dBO_p*/
-	rvec_ScaledAdd( top_dbo->dBOpi2, bo_ij->C2dbopi2, bo_ij->dBOp );
-	/*3rd, dBO_p*/
-	rvec_ScaledAdd( top_dbo->dBOpi2, 
-			bo_ij->C3dbopi2, workspace->dDeltap_self[i] );
+        /* do the adjustments on i */
+        //rvec_ScaledAdd( due_i[i], bo_ij->A0_ij+bo_ij->BO*bo_ij->A1_ij,
+        //                bo_ij->dBOp );  /*1st, dBO*/
+        //rvec_ScaledAdd( due_i[i], bo_ij->BO * bo_ij->A2_ij,
+        //                workspace->dDeltap_self[i] ); /*2nd, dBO*/
+
+        /*1st, dBO*/
+        rvec_ScaledAdd( top_dbo->dBO, bo_ij->C1dbo, bo_ij->dBOp );
+        /*2nd, dBO*/
+        rvec_ScaledAdd( top_dbo->dBO,
+                        bo_ij->C2dbo, workspace->dDeltap_self[i] );
+
+        /*1st, dBOpi*/
+        rvec_ScaledAdd(top_dbo->dBOpi,bo_ij->C1dbopi,bo_ij->dln_BOp_pi );
+        /*2nd, dBOpi*/
+        rvec_ScaledAdd( top_dbo->dBOpi, bo_ij->C2dbopi, bo_ij->dBOp );
+        /*3rd, dBOpi*/
+        rvec_ScaledAdd( top_dbo->dBOpi,
+                        bo_ij->C3dbopi, workspace->dDeltap_self[i] );
+
+        /*1st, dBO_p*/
+        rvec_ScaledAdd( top_dbo->dBOpi2,
+                        bo_ij->C1dbopi2, bo_ij->dln_BOp_pi2 );
+        /*2nd, dBO_p*/
+        rvec_ScaledAdd( top_dbo->dBOpi2, bo_ij->C2dbopi2, bo_ij->dBOp );
+        /*3rd, dBO_p*/
+        rvec_ScaledAdd( top_dbo->dBOpi2,
+                        bo_ij->C3dbopi2, workspace->dDeltap_self[i] );
       }
 
       //rvec_Add( workspace->dDelta[nbr_l->nbr], top_dbo->dBO );
       ++(*top), ++top_dbo;
     }
-	  
-    /* Now we are processing neighbor k of i. */ 
+
+    /* Now we are processing neighbor k of i. */
     top_dbo->wrt = nbr_k->nbr;
-      
+
     //2nd, dBO
-    //rvec_ScaledAdd( due_i[top_dbo->wrt], 
+    //rvec_ScaledAdd( due_i[top_dbo->wrt],
     //                -bo_ij->BO * bo_ij->A2_ij, nbr_k->bo_data.dBOp );
-      
+
     /*2nd, dBO*/
     rvec_Scale( top_dbo->dBO, -bo_ij->C2dbo, nbr_k->bo_data.dBOp );
     /*3rd, dBOpi*/
     rvec_Scale( top_dbo->dBOpi, -bo_ij->C3dbopi, nbr_k->bo_data.dBOp );
     /*3rd, dBOpp*/
     rvec_Scale( top_dbo->dBOpi2, -bo_ij->C3dbopi2, nbr_k->bo_data.dBOp );
-	  
+
     if( l < end_j && bonds->select.bond_list[l].nbr == nbr_k->nbr ) {
       /* This is a common neighbor of i and j. */
       nbr_l = &(bonds->select.bond_list[l]);
 
       /*3rd, dBO*/
-      //rvec_ScaledAdd( due_j[top_dbo->wrt], 
+      //rvec_ScaledAdd( due_j[top_dbo->wrt],
       //                -bo_ij->BO * bo_ij->A2_ji, nbr_l->bo_data.dBOp );
-	  
+
       /*3rd, dBO*/
       rvec_ScaledAdd( top_dbo->dBO, -bo_ij->C3dbo, nbr_l->bo_data.dBOp );
       /*4th, dBOpi*/
@@ -297,13 +297,13 @@ void Calculate_dBO( int i, int pj,
       rvec_ScaledAdd(top_dbo->dBOpi2,-bo_ij->C4dbopi2,nbr_l->bo_data.dBOp);
       ++l;
     }
-    else if( k == pj ) {  
+    else if( k == pj ) {
       /* This negihbor is j. */
-      //rvec_ScaledAdd( due_j[j], -(bo_ij->A0_ij+bo_ij->BO*bo_ij->A1_ij), 
+      //rvec_ScaledAdd( due_j[j], -(bo_ij->A0_ij+bo_ij->BO*bo_ij->A1_ij),
       //                bo_ij->dBOp );  /*1st, dBO*/
-      //rvec_ScaledAdd( due_j[j], bo_ij->BO * bo_ij->A2_ji, 
+      //rvec_ScaledAdd( due_j[j], bo_ij->BO * bo_ij->A2_ji,
       //                workspace->dDeltap_self[j] );  /*3rd, dBO*/
-	  
+
       /*1st, dBO*/
       rvec_ScaledAdd( top_dbo->dBO, -bo_ij->C1dbo, bo_ij->dBOp );
       /*3rd, dBO*/
@@ -314,16 +314,16 @@ void Calculate_dBO( int i, int pj,
       /*2nd, dBOpi*/
       rvec_ScaledAdd( top_dbo->dBOpi, -bo_ij->C2dbopi, bo_ij->dBOp );
       /*4th, dBOpi*/
-      rvec_ScaledAdd( top_dbo->dBOpi, 
-		      bo_ij->C4dbopi, workspace->dDeltap_self[j] );
+      rvec_ScaledAdd( top_dbo->dBOpi,
+                      bo_ij->C4dbopi, workspace->dDeltap_self[j] );
 
       /*1st, dBOpi2*/
       rvec_ScaledAdd(top_dbo->dBOpi2,-bo_ij->C1dbopi2,bo_ij->dln_BOp_pi2);
       /*2nd, dBOpi2*/
       rvec_ScaledAdd(top_dbo->dBOpi2,-bo_ij->C2dbopi2,bo_ij->dBOp );
       /*4th, dBOpi2*/
-      rvec_ScaledAdd(top_dbo->dBOpi2, bo_ij->C4dbopi2, 
-		     workspace->dDeltap_self[j] );
+      rvec_ScaledAdd(top_dbo->dBOpi2, bo_ij->C4dbopi2,
+                     workspace->dDeltap_self[j] );
     }
 
     // rvec_Add( workspace->dDelta[nbr_k->nbr], top_dbo->dBO );
@@ -337,10 +337,10 @@ void Calculate_dBO( int i, int pj,
     top_dbo->wrt = nbr_l->nbr;
 
     // fprintf( stdout, "\tl: %d nbr:%d\n", l, nbr_l->nbr+1 );
-      
-    // rvec_ScaledAdd( due_j[top_dbo->wrt], 
-    //                 -bo_ij->BO * bo_ij->A2_ji, nbr_l->bo_data.dBOp ); 
-      
+
+    // rvec_ScaledAdd( due_j[top_dbo->wrt],
+    //                 -bo_ij->BO * bo_ij->A2_ji, nbr_l->bo_data.dBOp );
+
     /*3rd, dBO*/
     rvec_Scale( top_dbo->dBO, -bo_ij->C3dbo, nbr_l->bo_data.dBOp );
     /*4th, dBOpi*/
@@ -350,32 +350,32 @@ void Calculate_dBO( int i, int pj,
 
     if( nbr_l->nbr == i )
       {
-	/* do the adjustments on i */	
-	//rvec_ScaledAdd( due_i[i], bo_ij->A0_ij + bo_ij->BO * bo_ij->A1_ij,
-	//                bo_ij->dBOp );  /*1st, dBO*/
-	//rvec_ScaledAdd( due_i[i], bo_ij->BO * bo_ij->A2_ij, 
-	//                workspace->dDeltap_self[i] ); /*2nd, dBO*/
-	  
-	/*1st, dBO*/
-	rvec_ScaledAdd( top_dbo->dBO, bo_ij->C1dbo, bo_ij->dBOp );
-	/*2nd, dBO*/
-	rvec_ScaledAdd(top_dbo->dBO,bo_ij->C2dbo,workspace->dDeltap_self[i]);
-
-	/*1st, dBO_p*/
-	rvec_ScaledAdd( top_dbo->dBOpi, bo_ij->C1dbopi, bo_ij->dln_BOp_pi );
-	/*2nd, dBOpi*/
-	rvec_ScaledAdd( top_dbo->dBOpi, bo_ij->C2dbopi, bo_ij->dBOp );
-	/*3rd,dBOpi*/
-	rvec_ScaledAdd( top_dbo->dBOpi, 
-			bo_ij->C3dbopi, workspace->dDeltap_self[i] );
-
-	/*1st, dBO_p*/
-	rvec_ScaledAdd(top_dbo->dBOpi2, bo_ij->C1dbopi2, bo_ij->dln_BOp_pi2);
-	/*2nd, dBO_p*/
-	rvec_ScaledAdd(top_dbo->dBOpi2, bo_ij->C2dbopi2, bo_ij->dBOp);
-	/*3rd,dBO_p*/
-	rvec_ScaledAdd(top_dbo->dBOpi2, 
-		       bo_ij->C3dbopi2, workspace->dDeltap_self[i]);
+        /* do the adjustments on i */
+        //rvec_ScaledAdd( due_i[i], bo_ij->A0_ij + bo_ij->BO * bo_ij->A1_ij,
+        //                bo_ij->dBOp );  /*1st, dBO*/
+        //rvec_ScaledAdd( due_i[i], bo_ij->BO * bo_ij->A2_ij,
+        //                workspace->dDeltap_self[i] ); /*2nd, dBO*/
+
+        /*1st, dBO*/
+        rvec_ScaledAdd( top_dbo->dBO, bo_ij->C1dbo, bo_ij->dBOp );
+        /*2nd, dBO*/
+        rvec_ScaledAdd(top_dbo->dBO,bo_ij->C2dbo,workspace->dDeltap_self[i]);
+
+        /*1st, dBO_p*/
+        rvec_ScaledAdd( top_dbo->dBOpi, bo_ij->C1dbopi, bo_ij->dln_BOp_pi );
+        /*2nd, dBOpi*/
+        rvec_ScaledAdd( top_dbo->dBOpi, bo_ij->C2dbopi, bo_ij->dBOp );
+        /*3rd,dBOpi*/
+        rvec_ScaledAdd( top_dbo->dBOpi,
+                        bo_ij->C3dbopi, workspace->dDeltap_self[i] );
+
+        /*1st, dBO_p*/
+        rvec_ScaledAdd(top_dbo->dBOpi2, bo_ij->C1dbopi2, bo_ij->dln_BOp_pi2);
+        /*2nd, dBO_p*/
+        rvec_ScaledAdd(top_dbo->dBOpi2, bo_ij->C2dbopi2, bo_ij->dBOp);
+        /*3rd,dBO_p*/
+        rvec_ScaledAdd(top_dbo->dBOpi2,
+                       bo_ij->C3dbopi2, workspace->dDeltap_self[i]);
       }
 
     // rvec_Add( workspace->dDelta[nbr_l->nbr], top_dbo->dBO );
@@ -383,25 +383,25 @@ void Calculate_dBO( int i, int pj,
   }
 
   //  for( k = 0; k < 21; ++k ){
-  //  fprintf( stderr, "%d %d %d, due_i:[%g %g %g]\n", 
+  //  fprintf( stderr, "%d %d %d, due_i:[%g %g %g]\n",
   //           i+1, j+1, k+1, due_i[k][0], due_i[k][1], due_i[k][2] );
-  //  fprintf( stderr, "%d %d %d, due_j:[%g %g %g]\n", 
+  //  fprintf( stderr, "%d %d %d, due_j:[%g %g %g]\n",
   //           i+1, j+1, k+1, due_j[k][0], due_j[k][1], due_j[k][2] );
 }
 #endif
 
 
-void Add_dBond_to_Forces_NPT( int i, int pj, simulation_data *data, 
-			      storage *workspace, reax_list **lists )
+void Add_dBond_to_Forces_NPT( int i, int pj, simulation_data *data,
+                              storage *workspace, reax_list **lists )
 {
   reax_list *bonds = (*lists) + BONDS;
   bond_data *nbr_j, *nbr_k;
-  bond_order_data *bo_ij, *bo_ji; 
+  bond_order_data *bo_ij, *bo_ji;
   dbond_coefficients coef;
   rvec temp, ext_press;
   ivec rel_box;
   int pk, k, j;
-  
+
   /* Initializations */
   nbr_j = &(bonds->select.bond_list[pj]);
   j = nbr_j->nbr;
@@ -425,8 +425,8 @@ void Add_dBond_to_Forces_NPT( int i, int pj, simulation_data *data,
   coef.C1dDelta = bo_ij->C1dbo * (workspace->CdDelta[i]+workspace->CdDelta[j]);
   coef.C2dDelta = bo_ij->C2dbo * (workspace->CdDelta[i]+workspace->CdDelta[j]);
   coef.C3dDelta = bo_ij->C3dbo * (workspace->CdDelta[i]+workspace->CdDelta[j]);
- 
-  
+
+
   /************************************
    * forces related to atom i          *
    * first neighbors of atom i         *
@@ -449,9 +449,9 @@ void Add_dBond_to_Forces_NPT( int i, int pj, simulation_data *data,
     /* if( !ivec_isZero( nbr_k->rel_box ) )
        fprintf( stderr, "%3d %3d %3d: dvec[%10.6f %10.6f %10.6f]"
        "ext[%3d %3d %3d] f[%10.6f %10.6f %10.6f]\n",
-       i+1, system->my_atoms[i].x[0], 
-       system->my_atoms[i].x[1], system->my_atoms[i].x[2], 
-       j+1, k+1, system->my_atoms[k].x[0], 
+       i+1, system->my_atoms[i].x[0],
+       system->my_atoms[i].x[1], system->my_atoms[i].x[2],
+       j+1, k+1, system->my_atoms[k].x[0],
        system->my_atoms[k].x[1], system->my_atoms[k].x[2],
        nbr_k->dvec[0], nbr_k->dvec[1], nbr_k->dvec[2],
        nbr_k->rel_box[0], nbr_k->rel_box[1], nbr_k->rel_box[2],
@@ -466,26 +466,26 @@ void Add_dBond_to_Forces_NPT( int i, int pj, simulation_data *data,
   rvec_ScaledAdd( temp, coef.C1dbopi, bo_ij->dln_BOp_pi );        /*1st,dBOpi*/
   rvec_ScaledAdd( temp, coef.C2dbopi, bo_ij->dBOp );              /*2nd,dBOpi*/
   rvec_ScaledAdd( temp, coef.C3dbopi, workspace->dDeltap_self[i]);/*3rd,dBOpi*/
-	      
+
   rvec_ScaledAdd( temp, coef.C1dbopi2, bo_ij->dln_BOp_pi2 );  /*1st,dBO_pi2*/
   rvec_ScaledAdd( temp, coef.C2dbopi2, bo_ij->dBOp );         /*2nd,dBO_pi2*/
   rvec_ScaledAdd( temp, coef.C3dbopi2, workspace->dDeltap_self[i] );/*3rd*/
-  
+
   /* force */
   rvec_Add( workspace->f[i], temp );
   /* ext pressure due to i is dropped, counting force on j will be enough */
 
 
   /******************************************************
-   * forces and pressure related to atom j               * 
+   * forces and pressure related to atom j               *
    * first neighbors of atom j                           *
    ******************************************************/
   for( pk = Start_Index(j, bonds); pk < End_Index(j, bonds); ++pk ) {
     nbr_k = &(bonds->select.bond_list[pk]);
     k = nbr_k->nbr;
-      
+
     rvec_Scale( temp, -coef.C3dbo, nbr_k->bo_data.dBOp );      /*3rd,dBO*/
-    rvec_ScaledAdd( temp, -coef.C3dDelta, nbr_k->bo_data.dBOp);/*dDelta*/ 
+    rvec_ScaledAdd( temp, -coef.C3dDelta, nbr_k->bo_data.dBOp);/*dDelta*/
     rvec_ScaledAdd( temp, -coef.C4dbopi, nbr_k->bo_data.dBOp); /*4th,dBOpi*/
     rvec_ScaledAdd( temp, -coef.C4dbopi2, nbr_k->bo_data.dBOp);/*4th,dBOpi2*/
 
@@ -496,30 +496,30 @@ void Add_dBond_to_Forces_NPT( int i, int pj, simulation_data *data,
       ivec_Sum( rel_box, nbr_k->rel_box, nbr_j->rel_box ); //rel_box(k, i)
       rvec_iMultiply( ext_press, rel_box, temp );
       rvec_Add( data->my_ext_press, ext_press );
-	  
+
       /* if( !ivec_isZero( rel_box ) )
-	 fprintf( stderr, "%3d %3d %3d: dvec[%10.6f %10.6f %10.6f]"
-	 "ext[%3d %3d %3d] f[%10.6f %10.6f %10.6f]\n",
-	 i+1, j+1, system->my_atoms[j].x[0], 
-	 system->my_atoms[j].x[1], system->my_atoms[j].x[2], 
-	 k+1, system->my_atoms[k].x[0], 
-	 system->my_atoms[k].x[1], system->my_atoms[k].x[2],
-	 nbr_k->dvec[0], nbr_k->dvec[1], nbr_k->dvec[2],
-	 rel_box[0], rel_box[1], rel_box[2],
-	 temp[0], temp[1], temp[2] ); */
+         fprintf( stderr, "%3d %3d %3d: dvec[%10.6f %10.6f %10.6f]"
+         "ext[%3d %3d %3d] f[%10.6f %10.6f %10.6f]\n",
+         i+1, j+1, system->my_atoms[j].x[0],
+         system->my_atoms[j].x[1], system->my_atoms[j].x[2],
+         k+1, system->my_atoms[k].x[0],
+         system->my_atoms[k].x[1], system->my_atoms[k].x[2],
+         nbr_k->dvec[0], nbr_k->dvec[1], nbr_k->dvec[2],
+         rel_box[0], rel_box[1], rel_box[2],
+         temp[0], temp[1], temp[2] ); */
     }
   }
-  
+
   /* then atom j itself */
   rvec_Scale( temp, -coef.C1dbo, bo_ij->dBOp );                    /*1st, dBO*/
   rvec_ScaledAdd( temp, coef.C3dbo, workspace->dDeltap_self[j] );  /*2nd, dBO*/
   rvec_ScaledAdd( temp, -coef.C1dDelta, bo_ij->dBOp );             /*1st, dBO*/
   rvec_ScaledAdd( temp, coef.C3dDelta, workspace->dDeltap_self[j]);/*2nd, dBO*/
-  
+
   rvec_ScaledAdd( temp, -coef.C1dbopi, bo_ij->dln_BOp_pi );       /*1st,dBOpi*/
   rvec_ScaledAdd( temp, -coef.C2dbopi, bo_ij->dBOp );             /*2nd,dBOpi*/
   rvec_ScaledAdd( temp, coef.C4dbopi, workspace->dDeltap_self[j]);/*3rd,dBOpi*/
-	      
+
   rvec_ScaledAdd( temp, -coef.C1dbopi2, bo_ij->dln_BOp_pi2 );    /*1st,dBOpi2*/
   rvec_ScaledAdd( temp, -coef.C2dbopi2, bo_ij->dBOp );           /*2nd,dBOpi2*/
   rvec_ScaledAdd( temp,coef.C4dbopi2,workspace->dDeltap_self[j]);/*3rd,dBOpi2*/
@@ -531,11 +531,11 @@ void Add_dBond_to_Forces_NPT( int i, int pj, simulation_data *data,
   rvec_Add( data->my_ext_press, ext_press );
 
   /* if( !ivec_isZero( nbr_j->rel_box ) )
-     fprintf( stderr, "%3d %3d %3d: dvec[%10.6f %10.6f %10.6f]" 
+     fprintf( stderr, "%3d %3d %3d: dvec[%10.6f %10.6f %10.6f]"
      "ext[%3d %3d %3d] f[%10.6f %10.6f %10.6f]\n",
-     i+1, system->my_atoms[i].x[0], system->my_atoms[i].x[1], 
-     system->my_atoms[i].x[2], 
-     j+1,system->my_atoms[j].x[0], system->my_atoms[j].x[1], 
+     i+1, system->my_atoms[i].x[0], system->my_atoms[i].x[1],
+     system->my_atoms[i].x[2],
+     j+1,system->my_atoms[j].x[0], system->my_atoms[j].x[1],
      system->my_atoms[j].x[2],
      j+1, nbr_j->dvec[0], nbr_j->dvec[1], nbr_j->dvec[2],
      nbr_j->rel_box[0], nbr_j->rel_box[1], nbr_j->rel_box[2],
@@ -544,12 +544,12 @@ void Add_dBond_to_Forces_NPT( int i, int pj, simulation_data *data,
 
 
 
-void Add_dBond_to_Forces( reax_system *system, int i, int pj, 
-			  storage *workspace, reax_list **lists )
+void Add_dBond_to_Forces( reax_system *system, int i, int pj,
+                          storage *workspace, reax_list **lists )
 {
   reax_list *bonds = (*lists) + BONDS;
   bond_data *nbr_j, *nbr_k;
-  bond_order_data *bo_ij, *bo_ji; 
+  bond_order_data *bo_ij, *bo_ji;
   dbond_coefficients coef;
   int pk, k, j;
 
@@ -557,7 +557,7 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj,
   real f_scaler;
   rvec fi_tmp, fj_tmp, fk_tmp, delij, delji, delki, delkj, temp;
 
-  /* Initializations */ 
+  /* Initializations */
   nbr_j = &(bonds->select.bond_list[pj]);
   j = nbr_j->nbr;
   bo_ij = &(nbr_j->bo_data);
@@ -580,17 +580,17 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj,
   coef.C1dDelta = bo_ij->C1dbo * (workspace->CdDelta[i]+workspace->CdDelta[j]);
   coef.C2dDelta = bo_ij->C2dbo * (workspace->CdDelta[i]+workspace->CdDelta[j]);
   coef.C3dDelta = bo_ij->C3dbo * (workspace->CdDelta[i]+workspace->CdDelta[j]);
- 
+
   // forces on i
-  rvec_Scale( 	  temp, coef.C1dbo,    bo_ij->dBOp );                     
-  rvec_ScaledAdd( temp, coef.C2dbo,    workspace->dDeltap_self[i] );  
-  rvec_ScaledAdd( temp, coef.C1dDelta, bo_ij->dBOp );              
+  rvec_Scale(           temp, coef.C1dbo,    bo_ij->dBOp );
+  rvec_ScaledAdd( temp, coef.C2dbo,    workspace->dDeltap_self[i] );
+  rvec_ScaledAdd( temp, coef.C1dDelta, bo_ij->dBOp );
   rvec_ScaledAdd( temp, coef.C2dDelta, workspace->dDeltap_self[i] );
-  rvec_ScaledAdd( temp, coef.C1dbopi,  bo_ij->dln_BOp_pi );        
-  rvec_ScaledAdd( temp, coef.C2dbopi,  bo_ij->dBOp );              
+  rvec_ScaledAdd( temp, coef.C1dbopi,  bo_ij->dln_BOp_pi );
+  rvec_ScaledAdd( temp, coef.C2dbopi,  bo_ij->dBOp );
   rvec_ScaledAdd( temp, coef.C3dbopi,  workspace->dDeltap_self[i]);
-  rvec_ScaledAdd( temp, coef.C1dbopi2, bo_ij->dln_BOp_pi2 );  
-  rvec_ScaledAdd( temp, coef.C2dbopi2, bo_ij->dBOp );         
+  rvec_ScaledAdd( temp, coef.C1dbopi2, bo_ij->dln_BOp_pi2 );
+  rvec_ScaledAdd( temp, coef.C2dbopi2, bo_ij->dBOp );
   rvec_ScaledAdd( temp, coef.C3dbopi2, workspace->dDeltap_self[i] );
   rvec_Add( workspace->f[i], temp );
 
@@ -601,15 +601,15 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj,
   }
 
   // forces on j
-  rvec_Scale( 	  temp, -coef.C1dbo,    bo_ij->dBOp );                   
-  rvec_ScaledAdd( temp,  coef.C3dbo,    workspace->dDeltap_self[j] ); 
-  rvec_ScaledAdd( temp, -coef.C1dDelta, bo_ij->dBOp );            
+  rvec_Scale(           temp, -coef.C1dbo,    bo_ij->dBOp );
+  rvec_ScaledAdd( temp,  coef.C3dbo,    workspace->dDeltap_self[j] );
+  rvec_ScaledAdd( temp, -coef.C1dDelta, bo_ij->dBOp );
   rvec_ScaledAdd( temp,  coef.C3dDelta, workspace->dDeltap_self[j]);
-  rvec_ScaledAdd( temp, -coef.C1dbopi,  bo_ij->dln_BOp_pi );       
-  rvec_ScaledAdd( temp, -coef.C2dbopi,  bo_ij->dBOp );            
+  rvec_ScaledAdd( temp, -coef.C1dbopi,  bo_ij->dln_BOp_pi );
+  rvec_ScaledAdd( temp, -coef.C2dbopi,  bo_ij->dBOp );
   rvec_ScaledAdd( temp,  coef.C4dbopi,  workspace->dDeltap_self[j]);
-  rvec_ScaledAdd( temp, -coef.C1dbopi2, bo_ij->dln_BOp_pi2 );    
-  rvec_ScaledAdd( temp, -coef.C2dbopi2, bo_ij->dBOp );           
+  rvec_ScaledAdd( temp, -coef.C1dbopi2, bo_ij->dln_BOp_pi2 );
+  rvec_ScaledAdd( temp, -coef.C2dbopi2, bo_ij->dBOp );
   rvec_ScaledAdd( temp,  coef.C4dbopi2, workspace->dDeltap_self[j]);
   rvec_Add( workspace->f[j], temp );
 
@@ -618,15 +618,15 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj,
     rvec_ScaledSum( delji, 1., system->my_atoms[j].x,-1., system->my_atoms[i].x );
     system->pair_ptr->v_tally(j,fj_tmp,delji);
   }
-    
+
   // forces on k: i neighbor
   for( pk = Start_Index(i, bonds); pk < End_Index(i, bonds); ++pk ) {
     nbr_k = &(bonds->select.bond_list[pk]);
     k = nbr_k->nbr;
 
-    rvec_Scale(     temp, -coef.C2dbo,    nbr_k->bo_data.dBOp);       
+    rvec_Scale(     temp, -coef.C2dbo,    nbr_k->bo_data.dBOp);
     rvec_ScaledAdd( temp, -coef.C2dDelta, nbr_k->bo_data.dBOp);
-    rvec_ScaledAdd( temp, -coef.C3dbopi,  nbr_k->bo_data.dBOp); 
+    rvec_ScaledAdd( temp, -coef.C3dbopi,  nbr_k->bo_data.dBOp);
     rvec_ScaledAdd( temp, -coef.C3dbopi2, nbr_k->bo_data.dBOp);
     rvec_Add( workspace->f[k], temp );
 
@@ -638,15 +638,15 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj,
       system->pair_ptr->v_tally(k,fk_tmp,delkj);
     }
   }
- 
+
   // forces on k: j neighbor
   for( pk = Start_Index(j, bonds); pk < End_Index(j, bonds); ++pk ) {
     nbr_k = &(bonds->select.bond_list[pk]);
     k = nbr_k->nbr;
-      
+
     rvec_Scale(     temp, -coef.C3dbo,    nbr_k->bo_data.dBOp );
     rvec_ScaledAdd( temp, -coef.C3dDelta, nbr_k->bo_data.dBOp);
-    rvec_ScaledAdd( temp, -coef.C4dbopi,  nbr_k->bo_data.dBOp); 
+    rvec_ScaledAdd( temp, -coef.C4dbopi,  nbr_k->bo_data.dBOp);
     rvec_ScaledAdd( temp, -coef.C4dbopi2, nbr_k->bo_data.dBOp);
     rvec_Add( workspace->f[k], temp );
 
@@ -658,14 +658,14 @@ void Add_dBond_to_Forces( reax_system *system, int i, int pj,
       system->pair_ptr->v_tally(k,fk_tmp,delkj);
     }
   }
- 
+
 }
 
 
-int BOp( storage *workspace, reax_list *bonds, real bo_cut, 
-	 int i, int btop_i, far_neighbor_data *nbr_pj,
-	 single_body_parameters *sbp_i, single_body_parameters *sbp_j,
-	 two_body_parameters *twbp ) {
+int BOp( storage *workspace, reax_list *bonds, real bo_cut,
+         int i, int btop_i, far_neighbor_data *nbr_pj,
+         single_body_parameters *sbp_i, single_body_parameters *sbp_j,
+         two_body_parameters *twbp ) {
   int j, btop_j;
   real r2, C12, C34, C56;
   real Cln_BOp_s, Cln_BOp_pi, Cln_BOp_pi2;
@@ -675,34 +675,34 @@ int BOp( storage *workspace, reax_list *bonds, real bo_cut,
 
   j = nbr_pj->nbr;
   r2 = SQR(nbr_pj->d);
-	
+
   if( sbp_i->r_s > 0.0 && sbp_j->r_s > 0.0 ) {
     C12 = twbp->p_bo1 * pow( nbr_pj->d / twbp->r_s, twbp->p_bo2 );
     BO_s = (1.0 + bo_cut) * exp( C12 );
   }
   else BO_s = C12 = 0.0;
-  
+
   if( sbp_i->r_pi > 0.0 && sbp_j->r_pi > 0.0 ) {
     C34 = twbp->p_bo3 * pow( nbr_pj->d / twbp->r_p, twbp->p_bo4 );
     BO_pi = exp( C34 );
   }
   else BO_pi = C34 = 0.0;
-  
+
   if( sbp_i->r_pi_pi > 0.0 && sbp_j->r_pi_pi > 0.0 ) {
-    C56 = twbp->p_bo5 * pow( nbr_pj->d / twbp->r_pp, twbp->p_bo6 );	
+    C56 = twbp->p_bo5 * pow( nbr_pj->d / twbp->r_pp, twbp->p_bo6 );
     BO_pi2= exp( C56 );
   }
   else BO_pi2 = C56 = 0.0;
-  
+
   /* Initially BO values are the uncorrected ones, page 1 */
   BO = BO_s + BO_pi + BO_pi2;
-  
+
   if( BO >= bo_cut ) {
     /****** bonds i-j and j-i ******/
     ibond = &( bonds->select.bond_list[btop_i] );
     btop_j = End_Index( j, bonds );
     jbond = &(bonds->select.bond_list[btop_j]);
-	    
+
     ibond->nbr = j;
     jbond->nbr = i;
     ibond->d = nbr_pj->d;
@@ -716,40 +716,40 @@ int BOp( storage *workspace, reax_list *bonds, real bo_cut,
     ibond->sym_index = btop_j;
     jbond->sym_index = btop_i;
     Set_End_Index( j, btop_j+1, bonds );
-	     	  
+
     bo_ij = &( ibond->bo_data );
     bo_ji = &( jbond->bo_data );
     bo_ji->BO = bo_ij->BO = BO;
     bo_ji->BO_s = bo_ij->BO_s = BO_s;
     bo_ji->BO_pi = bo_ij->BO_pi = BO_pi;
     bo_ji->BO_pi2 = bo_ij->BO_pi2 = BO_pi2;
-  
+
     /* Bond Order page2-3, derivative of total bond order prime */
     Cln_BOp_s = twbp->p_bo2 * C12 / r2;
     Cln_BOp_pi = twbp->p_bo4 * C34 / r2;
     Cln_BOp_pi2 = twbp->p_bo6 * C56 / r2;
-  
-    /* Only dln_BOp_xx wrt. dr_i is stored here, note that 
+
+    /* Only dln_BOp_xx wrt. dr_i is stored here, note that
        dln_BOp_xx/dr_i = -dln_BOp_xx/dr_j and all others are 0 */
     rvec_Scale(bo_ij->dln_BOp_s,-bo_ij->BO_s*Cln_BOp_s,ibond->dvec);
     rvec_Scale(bo_ij->dln_BOp_pi,-bo_ij->BO_pi*Cln_BOp_pi,ibond->dvec);
     rvec_Scale(bo_ij->dln_BOp_pi2,
-	       -bo_ij->BO_pi2*Cln_BOp_pi2,ibond->dvec);
+               -bo_ij->BO_pi2*Cln_BOp_pi2,ibond->dvec);
     rvec_Scale(bo_ji->dln_BOp_s, -1., bo_ij->dln_BOp_s);
     rvec_Scale(bo_ji->dln_BOp_pi, -1., bo_ij->dln_BOp_pi );
     rvec_Scale(bo_ji->dln_BOp_pi2, -1., bo_ij->dln_BOp_pi2 );
-    
-    /* Only dBOp wrt. dr_i is stored here, note that 
+
+    /* Only dBOp wrt. dr_i is stored here, note that
        dBOp/dr_i = -dBOp/dr_j and all others are 0 */
-    rvec_Scale( bo_ij->dBOp, 
-		-(bo_ij->BO_s * Cln_BOp_s + 
-		  bo_ij->BO_pi * Cln_BOp_pi + 
-		  bo_ij->BO_pi2 * Cln_BOp_pi2), ibond->dvec );
+    rvec_Scale( bo_ij->dBOp,
+                -(bo_ij->BO_s * Cln_BOp_s +
+                  bo_ij->BO_pi * Cln_BOp_pi +
+                  bo_ij->BO_pi2 * Cln_BOp_pi2), ibond->dvec );
     rvec_Scale( bo_ji->dBOp, -1., bo_ij->dBOp );
-    
+
     rvec_Add( workspace->dDeltap_self[i], bo_ij->dBOp );
     rvec_Add( workspace->dDeltap_self[j], bo_ji->dBOp );
-    
+
     bo_ij->BO_s -= bo_cut;
     bo_ij->BO -= bo_cut;
     bo_ji->BO_s -= bo_cut;
@@ -758,58 +758,58 @@ int BOp( storage *workspace, reax_list *bonds, real bo_cut,
     workspace->total_bond_order[j] += bo_ji->BO; //currently total_BOp
     bo_ij->Cdbo = bo_ij->Cdbopi = bo_ij->Cdbopi2 = 0.0;
     bo_ji->Cdbo = bo_ji->Cdbopi = bo_ji->Cdbopi2 = 0.0;
-    
+
     /*fprintf( stderr, "%d %d %g %g %g\n",
       i+1, j+1, bo_ij->BO, bo_ij->BO_pi, bo_ij->BO_pi2 );*/
-	    
-    /*fprintf( stderr, "Cln_BOp_s: %f, pbo2: %f, C12:%f\n", 
+
+    /*fprintf( stderr, "Cln_BOp_s: %f, pbo2: %f, C12:%f\n",
       Cln_BOp_s, twbp->p_bo2, C12 );
-      fprintf( stderr, "Cln_BOp_pi: %f, pbo4: %f, C34:%f\n", 
+      fprintf( stderr, "Cln_BOp_pi: %f, pbo4: %f, C34:%f\n",
       Cln_BOp_pi, twbp->p_bo4, C34 );
       fprintf( stderr, "Cln_BOp_pi2: %f, pbo6: %f, C56:%f\n",
       Cln_BOp_pi2, twbp->p_bo6, C56 );*/
     /*fprintf(stderr, "pbo1: %f, pbo2:%f\n", twbp->p_bo1, twbp->p_bo2);
       fprintf(stderr, "pbo3: %f, pbo4:%f\n", twbp->p_bo3, twbp->p_bo4);
       fprintf(stderr, "pbo5: %f, pbo6:%f\n", twbp->p_bo5, twbp->p_bo6);
-      fprintf( stderr, "r_s: %f, r_p: %f, r_pp: %f\n", 
+      fprintf( stderr, "r_s: %f, r_p: %f, r_pp: %f\n",
       twbp->r_s, twbp->r_p, twbp->r_pp );
       fprintf( stderr, "C12: %g, C34:%g, C56:%g\n", C12, C34, C56 );*/
-    
+
     /*fprintf( stderr, "\tfactors: %g %g %g\n",
-      -(bo_ij->BO_s * Cln_BOp_s + bo_ij->BO_pi * Cln_BOp_pi + 
+      -(bo_ij->BO_s * Cln_BOp_s + bo_ij->BO_pi * Cln_BOp_pi +
       bo_ij->BO_pi2 * Cln_BOp_pp),
       -bo_ij->BO_pi * Cln_BOp_pi, -bo_ij->BO_pi2 * Cln_BOp_pi2 );*/
-    /*fprintf( stderr, "dBOpi:\t[%g, %g, %g]\n", 
+    /*fprintf( stderr, "dBOpi:\t[%g, %g, %g]\n",
       bo_ij->dBOp[0], bo_ij->dBOp[1], bo_ij->dBOp[2] );
-      fprintf( stderr, "dBOpi:\t[%g, %g, %g]\n", 
-      bo_ij->dln_BOp_pi[0], bo_ij->dln_BOp_pi[1], 
+      fprintf( stderr, "dBOpi:\t[%g, %g, %g]\n",
+      bo_ij->dln_BOp_pi[0], bo_ij->dln_BOp_pi[1],
       bo_ij->dln_BOp_pi[2] );
       fprintf( stderr, "dBOpi2:\t[%g, %g, %g]\n\n",
-      bo_ij->dln_BOp_pi2[0], bo_ij->dln_BOp_pi2[1], 
+      bo_ij->dln_BOp_pi2[0], bo_ij->dln_BOp_pi2[1],
       bo_ij->dln_BOp_pi2[2] );*/
 
     return 1;
   }
-  
+
   return 0;
 }
-  
+
 
 int compare_bonds( const void *p1, const void *p2 )
 {
   return ((bond_data *)p1)->nbr - ((bond_data *)p2)->nbr;
 }
 
-  
-void BO( reax_system *system, control_params *control, simulation_data *data, 
-	 storage *workspace, reax_list **lists, output_controls *out_control )
+
+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;
   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;
-  real exp_p1i,	exp_p2i, exp_p1j, exp_p2j;
+  real exp_p1i,        exp_p2i, exp_p1j, exp_p2j;
   real temp, u1_ij, u1_ji, Cf1A_ij, Cf1B_ij, Cf1_ij, Cf1_ji;
   real Cf45_ij, Cf45_ji, p_lp1; //u_ij, u_ji
   real A0_ij, A1_ij, A2_ij, A2_ji, A3_ij, A3_ji;
@@ -830,7 +830,7 @@ void BO( reax_system *system, control_params *control, simulation_data *data,
   dBOs = (*lists) + DBOS;
 
   //for( i = 0; i < system->N; ++i )
-  //  qsort( &(bonds->select.bond_list[Start_Index(i, bonds)]), 
+  //  qsort( &(bonds->select.bond_list[Start_Index(i, bonds)]),
   //   Num_Entries(i, bonds), sizeof(bond_data), compare_bonds );
 #endif
 
@@ -843,10 +843,10 @@ void BO( reax_system *system, control_params *control, simulation_data *data,
     type_i = system->my_atoms[i].type;
     sbp_i = &(system->reax_param.sbp[type_i]);
     workspace->Deltap[i] = workspace->total_bond_order[i] - sbp_i->valency;
-    workspace->Deltap_boc[i] = 
+    workspace->Deltap_boc[i] =
       workspace->total_bond_order[i] - sbp_i->valency_val;
-    
-    //fprintf( stdout, "%d(%d) %24.15f\n", 
+
+    //fprintf( stdout, "%d(%d) %24.15f\n",
     //     i, workspace->bond_mark[i], workspace->total_bond_order[i] );
     workspace->total_bond_order[i] = 0;
   }
@@ -871,227 +871,227 @@ void BO( reax_system *system, control_params *control, simulation_data *data,
       // fprintf( stderr, "\tj:%d - ubo: %8.3f\n", j+1, bo_ij->BO );
 
       if( i < j || workspace->bond_mark[j] > 3 ) {
-	twbp = &( system->reax_param.tbp[type_i][type_j] );
+        twbp = &( system->reax_param.tbp[type_i][type_j] );
 #ifdef TEST_FORCES
-	Set_Start_Index( pj, top_dbo, dBOs );
-	/* fprintf( stderr, "%6d%6d%12.6f%12.6f%12.6f\n", 
-	   workspace->reverse_map[i], workspace->reverse_map[j],
-	   twbp->ovc, twbp->v13cor, bo_ij->BO ); */
+        Set_Start_Index( pj, top_dbo, dBOs );
+        /* fprintf( stderr, "%6d%6d%12.6f%12.6f%12.6f\n",
+           workspace->reverse_map[i], workspace->reverse_map[j],
+           twbp->ovc, twbp->v13cor, bo_ij->BO ); */
 #endif
 
-	if( twbp->ovc < 0.001 && twbp->v13cor < 0.001 ) {
-	  /* There is no correction to bond orders nor to derivatives
-	     of bond order prime! So we leave bond orders unchanged and
-	     set derivative of bond order coefficients such that 
-	     dBO = dBOp & dBOxx = dBOxxp in Add_dBO_to_Forces */
-	  bo_ij->C1dbo = 1.000000;
-	  bo_ij->C2dbo = 0.000000;
-	  bo_ij->C3dbo = 0.000000; 
-
-	  bo_ij->C1dbopi = bo_ij->BO_pi;
-	  bo_ij->C2dbopi = 0.000000;
-	  bo_ij->C3dbopi = 0.000000;
-	  bo_ij->C4dbopi = 0.000000;
-
-	  bo_ij->C1dbopi2 = bo_ij->BO_pi2; 
-	  bo_ij->C2dbopi2 = 0.000000;
-	  bo_ij->C3dbopi2 = 0.000000;
-	  bo_ij->C4dbopi2 = 0.000000;
+        if( twbp->ovc < 0.001 && twbp->v13cor < 0.001 ) {
+          /* There is no correction to bond orders nor to derivatives
+             of bond order prime! So we leave bond orders unchanged and
+             set derivative of bond order coefficients such that
+             dBO = dBOp & dBOxx = dBOxxp in Add_dBO_to_Forces */
+          bo_ij->C1dbo = 1.000000;
+          bo_ij->C2dbo = 0.000000;
+          bo_ij->C3dbo = 0.000000;
+
+          bo_ij->C1dbopi = bo_ij->BO_pi;
+          bo_ij->C2dbopi = 0.000000;
+          bo_ij->C3dbopi = 0.000000;
+          bo_ij->C4dbopi = 0.000000;
+
+          bo_ij->C1dbopi2 = bo_ij->BO_pi2;
+          bo_ij->C2dbopi2 = 0.000000;
+          bo_ij->C3dbopi2 = 0.000000;
+          bo_ij->C4dbopi2 = 0.000000;
 
 #ifdef TEST_FORCES
-	  pdbo = &(dBOs->select.dbo_list[ top_dbo ]);
-		  
-	  // compute dBO_ij/dr_i
-	  pdbo->wrt = i;
-	  rvec_Copy( pdbo->dBO, bo_ij->dBOp );
-	  rvec_Scale( pdbo->dBOpi, bo_ij->BO_pi, bo_ij->dln_BOp_pi );
-	  rvec_Scale( pdbo->dBOpi2, bo_ij->BO_pi2, bo_ij->dln_BOp_pi2);
-
-	  // compute dBO_ij/dr_j
-	  pdbo++;
-	  pdbo->wrt = j;
-	  rvec_Scale( pdbo->dBO, -1.0, bo_ij->dBOp );
-	  rvec_Scale( pdbo->dBOpi, -bo_ij->BO_pi, bo_ij->dln_BOp_pi );
-	  rvec_Scale(pdbo->dBOpi2, -bo_ij->BO_pi2, bo_ij->dln_BOp_pi2);
-
-	  top_dbo += 2;
+          pdbo = &(dBOs->select.dbo_list[ top_dbo ]);
+
+          // compute dBO_ij/dr_i
+          pdbo->wrt = i;
+          rvec_Copy( pdbo->dBO, bo_ij->dBOp );
+          rvec_Scale( pdbo->dBOpi, bo_ij->BO_pi, bo_ij->dln_BOp_pi );
+          rvec_Scale( pdbo->dBOpi2, bo_ij->BO_pi2, bo_ij->dln_BOp_pi2);
+
+          // compute dBO_ij/dr_j
+          pdbo++;
+          pdbo->wrt = j;
+          rvec_Scale( pdbo->dBO, -1.0, bo_ij->dBOp );
+          rvec_Scale( pdbo->dBOpi, -bo_ij->BO_pi, bo_ij->dln_BOp_pi );
+          rvec_Scale(pdbo->dBOpi2, -bo_ij->BO_pi2, bo_ij->dln_BOp_pi2);
+
+          top_dbo += 2;
 #endif
-	}
-	else {
-	  val_j = system->reax_param.sbp[type_j].valency;
-	  Deltap_j = workspace->Deltap[j];
-	  Deltap_boc_j = workspace->Deltap_boc[j];
-	    
-	  /* on page 1 */
-	  if( twbp->ovc >= 0.001 ) {
-	    /* Correction for overcoordination */		
-	    exp_p1i = exp( -p_boc1 * Deltap_i );
-	    exp_p2i = exp( -p_boc2 * Deltap_i );
-	    exp_p1j = exp( -p_boc1 * Deltap_j );
-	    exp_p2j = exp( -p_boc2 * Deltap_j );
-		  
-	    f2 = exp_p1i + exp_p1j;			
-	    f3 = -1.0 / p_boc2 * log( 0.5 * ( exp_p2i  + exp_p2j ) );
-	    f1 = 0.5 * ( ( val_i + f2 )/( val_i + f2 + f3 ) + 
-			 ( val_j + f2 )/( val_j + f2 + f3 ) );
-		  
-	    /*fprintf( stderr,"%d %d\t%g %g   j:%g %g  p_boc:%g %g\n"
-	      "\tf:%g  %g  %g, exp:%g %g %g %g\n", 
-	      i+1, j+1, 
-	      val_i, Deltap_i, val_j, Deltap_j, p_boc1, p_boc2,
-	      f1, f2, f3, exp_p1i, exp_p2i, exp_p1j, exp_p2j );*/
-
-	    /* Now come the derivates */		
-	    /* Bond Order pages 5-7, derivative of f1 */
-	    temp = f2 + f3;
-	    u1_ij = val_i + temp;
-	    u1_ji = val_j + temp;
-	    Cf1A_ij = 0.5 * f3 * (1.0 / SQR( u1_ij ) + 
-				  1.0 / SQR( u1_ji ));
-	    Cf1B_ij = -0.5 * (( u1_ij - f3 ) / SQR( u1_ij ) + 
-			      ( u1_ji - f3 ) / SQR( u1_ji ));
-		    
-	    //Cf1_ij = -Cf1A_ij * p_boc1 * exp_p1i + 
-	    //          Cf1B_ij * exp_p2i / ( exp_p2i + exp_p2j );
-	    Cf1_ij = 0.50 * ( -p_boc1 * exp_p1i / u1_ij - 
-			      ((val_i+f2) / SQR(u1_ij)) * 
-			      ( -p_boc1 * exp_p1i +  
-				exp_p2i / ( exp_p2i + exp_p2j ) ) + 
-			      -p_boc1 * exp_p1i / u1_ji - 
-			      ((val_j+f2) / SQR(u1_ji)) * 
-			      ( -p_boc1 * exp_p1i +  
-				exp_p2i / ( exp_p2i + exp_p2j ) ));
-	       
-				      
-	    Cf1_ji = -Cf1A_ij * p_boc1 * exp_p1j + 
-	      Cf1B_ij * exp_p2j / ( exp_p2i + exp_p2j ); 
-
-	    //fprintf( stderr, "\tCf1:%g  %g\n", Cf1_ij, Cf1_ji );
-	  }
-	  else {
-	    /* No overcoordination correction! */
-	    f1 = 1.0;
-	    Cf1_ij = Cf1_ji = 0.0;		  
-	  }
-
-	  if( twbp->v13cor >= 0.001 ) {
-	    /* Correction for 1-3 bond orders */
-	    exp_f4 =exp(-(twbp->p_boc4 * SQR( bo_ij->BO ) -
-			  Deltap_boc_i) * twbp->p_boc3 + twbp->p_boc5);
-	    exp_f5 =exp(-(twbp->p_boc4 * SQR( bo_ij->BO ) -
-			  Deltap_boc_j) * twbp->p_boc3 + twbp->p_boc5);
-
-	    f4 = 1. / (1. + exp_f4);
-	    f5 = 1. / (1. + exp_f5);
-	    f4f5 = f4 * f5;
-	
-	    /* Bond Order pages 8-9, derivative of f4 and f5 */
-	    /*temp = twbp->p_boc5 - 
-	      twbp->p_boc3 * twbp->p_boc4 * SQR( bo_ij->BO );
-	      u_ij = temp + twbp->p_boc3 * Deltap_boc_i;
-	      u_ji = temp + twbp->p_boc3 * Deltap_boc_j;
-	      Cf45_ij = Cf45( u_ij, u_ji ) / f4f5;
-	      Cf45_ji = Cf45( u_ji, u_ij ) / f4f5;*/
-	    Cf45_ij = -f4 * exp_f4;
-	    Cf45_ji = -f5 * exp_f5;
-	  }
-	  else {
-	    f4 = f5 = f4f5 = 1.0;
-	    Cf45_ij = Cf45_ji = 0.0;
-	  }
-     		  
-	  /* Bond Order page 10, derivative of total bond order */
-	  A0_ij = f1 * f4f5;
-	  A1_ij = -2 * twbp->p_boc3 * twbp->p_boc4 * bo_ij->BO * 
-	    (Cf45_ij + Cf45_ji);
-	  A2_ij = Cf1_ij / f1 + twbp->p_boc3 * Cf45_ij;
-	  A2_ji = Cf1_ji / f1 + twbp->p_boc3 * Cf45_ji;
-	  A3_ij = A2_ij + Cf1_ij / f1;
-	  A3_ji = A2_ji + Cf1_ji / f1;
-      
-	  /*fprintf( stderr, "\tBO: %f, A0: %f, A1: %f" 
-	    "A2_ij: %f A2_ji: %f, A3_ij: %f, A3_ji: %f\n",
-	    bo_ij->BO, 
-	    A0_ij, A1_ij, A2_ij, A2_ji, A3_ij, A3_ji );*/
-	
-
-	  /* find corrected bond orders and their derivative coef */
-	  bo_ij->BO    = bo_ij->BO    * A0_ij;
-	  bo_ij->BO_pi = bo_ij->BO_pi * A0_ij *f1;
-	  bo_ij->BO_pi2= bo_ij->BO_pi2* A0_ij *f1;
-	  bo_ij->BO_s  = bo_ij->BO - ( bo_ij->BO_pi + bo_ij->BO_pi2 );
-
-	  bo_ij->C1dbo = A0_ij + bo_ij->BO * A1_ij;
-	  bo_ij->C2dbo = bo_ij->BO * A2_ij;
-	  bo_ij->C3dbo = bo_ij->BO * A2_ji; 
-
-	  bo_ij->C1dbopi = f1*f1*f4*f5;
-	  bo_ij->C2dbopi = bo_ij->BO_pi * A1_ij;
-	  bo_ij->C3dbopi = bo_ij->BO_pi * A3_ij;
-	  bo_ij->C4dbopi = bo_ij->BO_pi * A3_ji;
-
-	  bo_ij->C1dbopi2 = f1*f1*f4*f5;
-	  bo_ij->C2dbopi2 = bo_ij->BO_pi2 * A1_ij;
-	  bo_ij->C3dbopi2 = bo_ij->BO_pi2 * A3_ij;
-	  bo_ij->C4dbopi2 = bo_ij->BO_pi2 * A3_ji;
+        }
+        else {
+          val_j = system->reax_param.sbp[type_j].valency;
+          Deltap_j = workspace->Deltap[j];
+          Deltap_boc_j = workspace->Deltap_boc[j];
+
+          /* on page 1 */
+          if( twbp->ovc >= 0.001 ) {
+            /* Correction for overcoordination */
+            exp_p1i = exp( -p_boc1 * Deltap_i );
+            exp_p2i = exp( -p_boc2 * Deltap_i );
+            exp_p1j = exp( -p_boc1 * Deltap_j );
+            exp_p2j = exp( -p_boc2 * Deltap_j );
+
+            f2 = exp_p1i + exp_p1j;
+            f3 = -1.0 / p_boc2 * log( 0.5 * ( exp_p2i  + exp_p2j ) );
+            f1 = 0.5 * ( ( val_i + f2 )/( val_i + f2 + f3 ) +
+                         ( val_j + f2 )/( val_j + f2 + f3 ) );
+
+            /*fprintf( stderr,"%d %d\t%g %g   j:%g %g  p_boc:%g %g\n"
+              "\tf:%g  %g  %g, exp:%g %g %g %g\n",
+              i+1, j+1,
+              val_i, Deltap_i, val_j, Deltap_j, p_boc1, p_boc2,
+              f1, f2, f3, exp_p1i, exp_p2i, exp_p1j, exp_p2j );*/
+
+            /* Now come the derivates */
+            /* Bond Order pages 5-7, derivative of f1 */
+            temp = f2 + f3;
+            u1_ij = val_i + temp;
+            u1_ji = val_j + temp;
+            Cf1A_ij = 0.5 * f3 * (1.0 / SQR( u1_ij ) +
+                                  1.0 / SQR( u1_ji ));
+            Cf1B_ij = -0.5 * (( u1_ij - f3 ) / SQR( u1_ij ) +
+                              ( u1_ji - f3 ) / SQR( u1_ji ));
+
+            //Cf1_ij = -Cf1A_ij * p_boc1 * exp_p1i +
+            //          Cf1B_ij * exp_p2i / ( exp_p2i + exp_p2j );
+            Cf1_ij = 0.50 * ( -p_boc1 * exp_p1i / u1_ij -
+                              ((val_i+f2) / SQR(u1_ij)) *
+                              ( -p_boc1 * exp_p1i +
+                                exp_p2i / ( exp_p2i + exp_p2j ) ) +
+                              -p_boc1 * exp_p1i / u1_ji -
+                              ((val_j+f2) / SQR(u1_ji)) *
+                              ( -p_boc1 * exp_p1i +
+                                exp_p2i / ( exp_p2i + exp_p2j ) ));
+
+
+            Cf1_ji = -Cf1A_ij * p_boc1 * exp_p1j +
+              Cf1B_ij * exp_p2j / ( exp_p2i + exp_p2j );
+
+            //fprintf( stderr, "\tCf1:%g  %g\n", Cf1_ij, Cf1_ji );
+          }
+          else {
+            /* No overcoordination correction! */
+            f1 = 1.0;
+            Cf1_ij = Cf1_ji = 0.0;
+          }
+
+          if( twbp->v13cor >= 0.001 ) {
+            /* Correction for 1-3 bond orders */
+            exp_f4 =exp(-(twbp->p_boc4 * SQR( bo_ij->BO ) -
+                          Deltap_boc_i) * twbp->p_boc3 + twbp->p_boc5);
+            exp_f5 =exp(-(twbp->p_boc4 * SQR( bo_ij->BO ) -
+                          Deltap_boc_j) * twbp->p_boc3 + twbp->p_boc5);
+
+            f4 = 1. / (1. + exp_f4);
+            f5 = 1. / (1. + exp_f5);
+            f4f5 = f4 * f5;
+
+            /* Bond Order pages 8-9, derivative of f4 and f5 */
+            /*temp = twbp->p_boc5 -
+              twbp->p_boc3 * twbp->p_boc4 * SQR( bo_ij->BO );
+              u_ij = temp + twbp->p_boc3 * Deltap_boc_i;
+              u_ji = temp + twbp->p_boc3 * Deltap_boc_j;
+              Cf45_ij = Cf45( u_ij, u_ji ) / f4f5;
+              Cf45_ji = Cf45( u_ji, u_ij ) / f4f5;*/
+            Cf45_ij = -f4 * exp_f4;
+            Cf45_ji = -f5 * exp_f5;
+          }
+          else {
+            f4 = f5 = f4f5 = 1.0;
+            Cf45_ij = Cf45_ji = 0.0;
+          }
+
+          /* Bond Order page 10, derivative of total bond order */
+          A0_ij = f1 * f4f5;
+          A1_ij = -2 * twbp->p_boc3 * twbp->p_boc4 * bo_ij->BO *
+            (Cf45_ij + Cf45_ji);
+          A2_ij = Cf1_ij / f1 + twbp->p_boc3 * Cf45_ij;
+          A2_ji = Cf1_ji / f1 + twbp->p_boc3 * Cf45_ji;
+          A3_ij = A2_ij + Cf1_ij / f1;
+          A3_ji = A2_ji + Cf1_ji / f1;
+
+          /*fprintf( stderr, "\tBO: %f, A0: %f, A1: %f"
+            "A2_ij: %f A2_ji: %f, A3_ij: %f, A3_ji: %f\n",
+            bo_ij->BO,
+            A0_ij, A1_ij, A2_ij, A2_ji, A3_ij, A3_ji );*/
+
+
+          /* find corrected bond orders and their derivative coef */
+          bo_ij->BO    = bo_ij->BO    * A0_ij;
+          bo_ij->BO_pi = bo_ij->BO_pi * A0_ij *f1;
+          bo_ij->BO_pi2= bo_ij->BO_pi2* A0_ij *f1;
+          bo_ij->BO_s  = bo_ij->BO - ( bo_ij->BO_pi + bo_ij->BO_pi2 );
+
+          bo_ij->C1dbo = A0_ij + bo_ij->BO * A1_ij;
+          bo_ij->C2dbo = bo_ij->BO * A2_ij;
+          bo_ij->C3dbo = bo_ij->BO * A2_ji;
+
+          bo_ij->C1dbopi = f1*f1*f4*f5;
+          bo_ij->C2dbopi = bo_ij->BO_pi * A1_ij;
+          bo_ij->C3dbopi = bo_ij->BO_pi * A3_ij;
+          bo_ij->C4dbopi = bo_ij->BO_pi * A3_ji;
+
+          bo_ij->C1dbopi2 = f1*f1*f4*f5;
+          bo_ij->C2dbopi2 = bo_ij->BO_pi2 * A1_ij;
+          bo_ij->C3dbopi2 = bo_ij->BO_pi2 * A3_ij;
+          bo_ij->C4dbopi2 = bo_ij->BO_pi2 * A3_ji;
 
 #ifdef TEST_FORCES
-	  Calculate_dBO( i, pj, workspace, lists, &top_dbo );
+          Calculate_dBO( i, pj, workspace, lists, &top_dbo );
 #endif
-	}
-
-	/* neglect bonds that are < 1e-10 */
-	if( bo_ij->BO < 1e-10 )
-	  bo_ij->BO = 0.0;
-	if( bo_ij->BO_s < 1e-10 )
-	  bo_ij->BO_s = 0.0;
-	if( bo_ij->BO_pi < 1e-10 )
-	  bo_ij->BO_pi = 0.0;
-	if( bo_ij->BO_pi2 < 1e-10 )
-	  bo_ij->BO_pi2 = 0.0;
-
-	workspace->total_bond_order[i] += bo_ij->BO; //now keeps total_BO
-
-
-	/* fprintf( stderr, "%d %d\t%g %g %g %g\n"
-	   "Cdbo:\t%g %g %g\n"
-	   "Cdbopi:\t%g %g %g %g\n"
-	   "Cdbopi2:%g %g %g %g\n\n", 
-	   i+1, j+1, 
-	   bonds->select.bond_list[ pj ].d, 
-	   bo_ij->BO,bo_ij->BO_pi, bo_ij->BO_pi2, 
-	   bo_ij->C1dbo, bo_ij->C2dbo, bo_ij->C3dbo,
-	   bo_ij->C1dbopi, bo_ij->C2dbopi, 
-	   bo_ij->C3dbopi, bo_ij->C4dbopi,
-	   bo_ij->C1dbopi2,bo_ij->C2dbopi2, 
-	   bo_ij->C3dbopi2, bo_ij->C4dbopi2 ); */
-
-	/* fprintf( stderr, "%d %d  BO:%f BO_s:%f BO_pi:%f BO_pi2:%f\n",
-	   i+1,j+1,bo_ij->BO,bo_ij->BO_s,bo_ij->BO_pi,bo_ij->BO_pi2 );*/
+        }
+
+        /* neglect bonds that are < 1e-10 */
+        if( bo_ij->BO < 1e-10 )
+          bo_ij->BO = 0.0;
+        if( bo_ij->BO_s < 1e-10 )
+          bo_ij->BO_s = 0.0;
+        if( bo_ij->BO_pi < 1e-10 )
+          bo_ij->BO_pi = 0.0;
+        if( bo_ij->BO_pi2 < 1e-10 )
+          bo_ij->BO_pi2 = 0.0;
+
+        workspace->total_bond_order[i] += bo_ij->BO; //now keeps total_BO
+
+
+        /* fprintf( stderr, "%d %d\t%g %g %g %g\n"
+           "Cdbo:\t%g %g %g\n"
+           "Cdbopi:\t%g %g %g %g\n"
+           "Cdbopi2:%g %g %g %g\n\n",
+           i+1, j+1,
+           bonds->select.bond_list[ pj ].d,
+           bo_ij->BO,bo_ij->BO_pi, bo_ij->BO_pi2,
+           bo_ij->C1dbo, bo_ij->C2dbo, bo_ij->C3dbo,
+           bo_ij->C1dbopi, bo_ij->C2dbopi,
+           bo_ij->C3dbopi, bo_ij->C4dbopi,
+           bo_ij->C1dbopi2,bo_ij->C2dbopi2,
+           bo_ij->C3dbopi2, bo_ij->C4dbopi2 ); */
+
+        /* fprintf( stderr, "%d %d  BO:%f BO_s:%f BO_pi:%f BO_pi2:%f\n",
+           i+1,j+1,bo_ij->BO,bo_ij->BO_s,bo_ij->BO_pi,bo_ij->BO_pi2 );*/
 
 #ifdef TEST_FORCES
-	Set_End_Index( pj, top_dbo, dBOs );
-	Add_dBO( system, lists, i, pj, 1.0, workspace->dDelta );
+        Set_End_Index( pj, top_dbo, dBOs );
+        Add_dBO( system, lists, i, pj, 1.0, workspace->dDelta );
 #endif
       }
       else {
-	/* We only need to update bond orders from bo_ji
-	   everything else is set in uncorrected_bo calculations */
-	sym_index = bonds->select.bond_list[pj].sym_index;
-	bo_ji = &(bonds->select.bond_list[ sym_index ].bo_data);
-	bo_ij->BO = bo_ji->BO;
-	bo_ij->BO_s = bo_ji->BO_s;
-	bo_ij->BO_pi = bo_ji->BO_pi;
-	bo_ij->BO_pi2 = bo_ji->BO_pi2;
-
-	workspace->total_bond_order[i] += bo_ij->BO;// now keeps total_BO
+        /* We only need to update bond orders from bo_ji
+           everything else is set in uncorrected_bo calculations */
+        sym_index = bonds->select.bond_list[pj].sym_index;
+        bo_ji = &(bonds->select.bond_list[ sym_index ].bo_data);
+        bo_ij->BO = bo_ji->BO;
+        bo_ij->BO_s = bo_ji->BO_s;
+        bo_ij->BO_pi = bo_ji->BO_pi;
+        bo_ij->BO_pi2 = bo_ji->BO_pi2;
+
+        workspace->total_bond_order[i] += bo_ij->BO;// now keeps total_BO
 #ifdef TEST_FORCES
-	Add_dBO( system, lists, j, sym_index, 1.0, workspace->dDelta );
+        Add_dBO( system, lists, j, sym_index, 1.0, workspace->dDelta );
 #endif
-      }	  
+      }
     }
 
-#ifdef TEST_FORCES 
+#ifdef TEST_FORCES
     // fprintf( stderr, "dDelta computations\nj:" );
     Set_Start_Index( i, top_dDelta, dDeltas );
     ptop_dDelta = &( dDeltas->select.dDelta_list[top_dDelta] );
@@ -1101,22 +1101,22 @@ void BO( reax_system *system, control_params *control, simulation_data *data,
       // fprintf( stderr, "%d  ", j );
 
       if( !rvec_isZero( workspace->dDelta[j] ) ) {
-	ptop_dDelta->wrt = j;
-	rvec_Copy( ptop_dDelta->dVal, workspace->dDelta[j] );
-	rvec_MakeZero( workspace->dDelta[j] );
-	++top_dDelta, ++ptop_dDelta;
+        ptop_dDelta->wrt = j;
+        rvec_Copy( ptop_dDelta->dVal, workspace->dDelta[j] );
+        rvec_MakeZero( workspace->dDelta[j] );
+        ++top_dDelta, ++ptop_dDelta;
       }
-	  
+
       start_j = Start_Index(j, bonds);
-      end_j = End_Index(j, bonds);     
+      end_j = End_Index(j, bonds);
       for( pk = start_j; pk < end_j; ++pk ) {
-	k = bonds->select.bond_list[pk].nbr;    
-	if( !rvec_isZero( workspace->dDelta[k] ) ) {
-	  ptop_dDelta->wrt = k;
-	  rvec_Copy( ptop_dDelta->dVal, workspace->dDelta[k] );
-	  rvec_MakeZero( workspace->dDelta[k] );
-	  ++top_dDelta, ++ptop_dDelta;
-	}
+        k = bonds->select.bond_list[pk].nbr;
+        if( !rvec_isZero( workspace->dDelta[k] ) ) {
+          ptop_dDelta->wrt = k;
+          rvec_Copy( ptop_dDelta->dVal, workspace->dDelta[k] );
+          rvec_MakeZero( workspace->dDelta[k] );
+          ++top_dDelta, ++ptop_dDelta;
+        }
       }
     }
 
@@ -1125,8 +1125,8 @@ void BO( reax_system *system, control_params *control, simulation_data *data,
     /*for(pj = Start_Index(i,dDeltas); pj < End_Index(i,dDeltas); ++pj)
       fprintf( stdout, "dDel: %d %d [%g %g %g]\n",
       i+1, dDeltas->select.dDelta_list[pj].wrt+1,
-      dDeltas->select.dDelta_list[pj].dVal[0], 
-      dDeltas->select.dDelta_list[pj].dVal[1], 
+      dDeltas->select.dDelta_list[pj].dVal[0],
+      dDeltas->select.dDelta_list[pj].dVal[1],
       dDeltas->select.dDelta_list[pj].dVal[2] );*/
 #endif
   }
@@ -1143,7 +1143,7 @@ void BO( reax_system *system, control_params *control, simulation_data *data,
   for( j = 0; j < system->N; ++j ){
     type_j = system->my_atoms[j].type;
     sbp_j = &(system->reax_param.sbp[ type_j ]);
-    
+
     workspace->Delta[j] = workspace->total_bond_order[j] - sbp_j->valency;
     workspace->Delta_e[j] = workspace->total_bond_order[j] - sbp_j->valency_e;
     workspace->Delta_boc[j] = workspace->total_bond_order[j] -
@@ -1151,8 +1151,8 @@ void BO( reax_system *system, control_params *control, simulation_data *data,
     workspace->Delta_val[j] = workspace->total_bond_order[j] -
       sbp_j->valency_val;
 
-    workspace->vlpex[j] = workspace->Delta_e[j] - 
-      2.0 * (int)(workspace->Delta_e[j]/2.0);    
+    workspace->vlpex[j] = workspace->Delta_e[j] -
+      2.0 * (int)(workspace->Delta_e[j]/2.0);
     explp1 = exp(-p_lp1 * SQR(2.0 + workspace->vlpex[j]));
     workspace->nlp[j] = explp1 - (int)(workspace->Delta_e[j] / 2.0);
     workspace->Delta_lp[j] = sbp_j->nlp_opt - workspace->nlp[j];
@@ -1179,7 +1179,7 @@ void BO( reax_system *system, control_params *control, simulation_data *data,
     //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", 
+    //fprintf( stdout, "%d(%d) %24.15f\n",
     //     j, workspace->bond_mark[j], workspace->total_bond_order[j] );
   }
 
@@ -1204,15 +1204,15 @@ int Locate_Symmetric_Bond( reax_list *bonds, int i, int j )
   int mid_nbr;
 
   while( (mid_nbr = bonds->select.bond_list[mid].nbr) != j ) {
-    /*fprintf( stderr, "\tstart: %d   end: %d   mid: %d\n", 
+    /*fprintf( stderr, "\tstart: %d   end: %d   mid: %d\n",
       start, end, mid );*/
     if( mid_nbr < j )
       start = mid+1;
     else end = mid - 1;
-      
+
     mid = (start + end) / 2;
   }
-  
+
   return mid;
 }
 
diff --git a/src/USER-REAXC/reaxc_bond_orders.h b/src/USER-REAXC/reaxc_bond_orders.h
index 8ca9b8b237..0912a936d6 100644
--- a/src/USER-REAXC/reaxc_bond_orders.h
+++ b/src/USER-REAXC/reaxc_bond_orders.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -38,26 +38,26 @@ typedef struct{
 
 #ifdef TEST_FORCES
 void Get_dBO( reax_system*, reax_list**, int, int, real, rvec* );
-void Get_dBOpinpi2( reax_system*, reax_list**, 
-		    int, int, real, real, rvec*, rvec* );
+void Get_dBOpinpi2( reax_system*, reax_list**,
+                    int, int, real, real, rvec*, rvec* );
 
 void Add_dBO( reax_system*, reax_list**, int, int, real, rvec* );
-void Add_dBOpinpi2( reax_system*, reax_list**, 
-		    int, int, real, real, rvec*, rvec* );
+void Add_dBOpinpi2( reax_system*, reax_list**,
+                    int, int, real, real, rvec*, rvec* );
 
 void Add_dBO_to_Forces( reax_system*, reax_list**, int, int, real );
-void Add_dBOpinpi2_to_Forces( reax_system*, reax_list**, 
-			      int, int, real, real );
+void Add_dBOpinpi2_to_Forces( reax_system*, reax_list**,
+                              int, int, real, real );
 
 void Add_dDelta( reax_system*, reax_list**, int, real, rvec* );
 void Add_dDelta_to_Forces( reax_system *, reax_list**, int, real );
 #endif
 
 void Add_dBond_to_Forces( reax_system*, int, int, storage*, reax_list** );
-void Add_dBond_to_Forces_NPT( int, int, simulation_data*, 
-			      storage*, reax_list** );
+void Add_dBond_to_Forces_NPT( int, int, simulation_data*,
+                              storage*, reax_list** );
 int BOp(storage*, reax_list*, real, int, int, far_neighbor_data*,
-	single_body_parameters*, single_body_parameters*, two_body_parameters*);
+        single_body_parameters*, single_body_parameters*, two_body_parameters*);
 void BO( reax_system*, control_params*, simulation_data*,
-	 storage*, reax_list**, output_controls* );
+         storage*, reax_list**, output_controls* );
 #endif
diff --git a/src/USER-REAXC/reaxc_bonds.cpp b/src/USER-REAXC/reaxc_bonds.cpp
index 4418527992..45b493237f 100644
--- a/src/USER-REAXC/reaxc_bonds.cpp
+++ b/src/USER-REAXC/reaxc_bonds.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -40,9 +40,9 @@
 #endif
 
 
-void Bonds( reax_system *system, control_params *control, 
-	    simulation_data *data, storage *workspace, reax_list **lists, 
-	    output_controls *out_control )
+void Bonds( reax_system *system, control_params *control,
+            simulation_data *data, storage *workspace, reax_list **lists,
+            output_controls *out_control )
 {
   int i, j, pj, natoms;
   int start_i, end_i;
@@ -70,91 +70,91 @@ void Bonds( reax_system *system, control_params *control,
 
     for( pj = start_i; pj < end_i; ++pj ) {
       j = bonds->select.bond_list[pj].nbr;
-      
+
       if( system->my_atoms[i].orig_id <= system->my_atoms[j].orig_id ) {
-	/* set the pointers */
-	type_i = system->my_atoms[i].type;
-	type_j = system->my_atoms[j].type;
-	sbp_i = &( system->reax_param.sbp[type_i] );
-	sbp_j = &( system->reax_param.sbp[type_j] );
-	twbp = &( system->reax_param.tbp[type_i][type_j] );
-	bo_ij = &( bonds->select.bond_list[pj].bo_data );
-
-	/* calculate the constants */
-	pow_BOs_be2 = pow( bo_ij->BO_s, twbp->p_be2 );
-	exp_be12 = exp( twbp->p_be1 * ( 1.0 - pow_BOs_be2 ) );
-	CEbo = -twbp->De_s * exp_be12 * 
-	  ( 1.0 - twbp->p_be1 * twbp->p_be2 * pow_BOs_be2 );
-	      
-	/* calculate the Bond Energy */
-	data->my_en.e_bond += ebond = 
-	  -twbp->De_s * bo_ij->BO_s * exp_be12 
-	  -twbp->De_p * bo_ij->BO_pi 
-	  -twbp->De_pp * bo_ij->BO_pi2;
-	
-	/* tally into per-atom energy */
+        /* set the pointers */
+        type_i = system->my_atoms[i].type;
+        type_j = system->my_atoms[j].type;
+        sbp_i = &( system->reax_param.sbp[type_i] );
+        sbp_j = &( system->reax_param.sbp[type_j] );
+        twbp = &( system->reax_param.tbp[type_i][type_j] );
+        bo_ij = &( bonds->select.bond_list[pj].bo_data );
+
+        /* calculate the constants */
+        pow_BOs_be2 = pow( bo_ij->BO_s, twbp->p_be2 );
+        exp_be12 = exp( twbp->p_be1 * ( 1.0 - pow_BOs_be2 ) );
+        CEbo = -twbp->De_s * exp_be12 *
+          ( 1.0 - twbp->p_be1 * twbp->p_be2 * pow_BOs_be2 );
+
+        /* calculate the Bond Energy */
+        data->my_en.e_bond += ebond =
+          -twbp->De_s * bo_ij->BO_s * exp_be12
+          -twbp->De_p * bo_ij->BO_pi
+          -twbp->De_pp * bo_ij->BO_pi2;
+
+        /* tally into per-atom energy */
         if( system->pair_ptr->evflag)
           system->pair_ptr->ev_tally(i,j,natoms,1,ebond,0.0,0.0,0.0,0.0,0.0);
-	
-	/* calculate derivatives of Bond Orders */
-	bo_ij->Cdbo += CEbo;
-	bo_ij->Cdbopi -= (CEbo + twbp->De_p);
-	bo_ij->Cdbopi2 -= (CEbo + twbp->De_pp);
-	      
+
+        /* calculate derivatives of Bond Orders */
+        bo_ij->Cdbo += CEbo;
+        bo_ij->Cdbopi -= (CEbo + twbp->De_p);
+        bo_ij->Cdbopi2 -= (CEbo + twbp->De_pp);
+
 #ifdef TEST_ENERGY
-	//fprintf( out_control->ebond, "%6d%6d%24.15e%24.15e%24.15e\n",
-	fprintf( out_control->ebond, "%6d%6d%12.4f%12.4f%12.4f\n",
-		 system->my_atoms[i].orig_id, 
-		 system->my_atoms[j].orig_id, 
-		 bo_ij->BO, ebond, data->my_en.e_bond );
+        //fprintf( out_control->ebond, "%6d%6d%24.15e%24.15e%24.15e\n",
+        fprintf( out_control->ebond, "%6d%6d%12.4f%12.4f%12.4f\n",
+                 system->my_atoms[i].orig_id,
+                 system->my_atoms[j].orig_id,
+                 bo_ij->BO, ebond, data->my_en.e_bond );
 #endif
 #ifdef TEST_FORCES
-	Add_dBO( system, lists, i, pj, CEbo, workspace->f_be );
-	Add_dBOpinpi2( system, lists, i, pj, 
-		       -(CEbo + twbp->De_p), -(CEbo + twbp->De_pp), 
-		       workspace->f_be, workspace->f_be );
+        Add_dBO( system, lists, i, pj, CEbo, workspace->f_be );
+        Add_dBOpinpi2( system, lists, i, pj,
+                       -(CEbo + twbp->De_p), -(CEbo + twbp->De_pp),
+                       workspace->f_be, workspace->f_be );
 #endif
-	/* Stabilisation terminal triple bond */
-	if( bo_ij->BO >= 1.00 ) {
-	  if( gp37 == 2 ||
-	      (sbp_i->mass == 12.0000 && sbp_j->mass == 15.9990) || 
-	      (sbp_j->mass == 12.0000 && sbp_i->mass == 15.9990) ) {
-	    exphu = exp( -gp7 * SQR(bo_ij->BO - 2.50) );
-	    exphua1 = exp(-gp3 * (workspace->total_bond_order[i]-bo_ij->BO));
-	    exphub1 = exp(-gp3 * (workspace->total_bond_order[j]-bo_ij->BO));
-	    exphuov = exp(gp4 * (workspace->Delta[i] + workspace->Delta[j]));
-	    hulpov = 1.0 / (1.0 + 25.0 * exphuov);
-	    
-	    estriph = gp10 * exphu * hulpov * (exphua1 + exphub1);
-	    data->my_en.e_bond += estriph;
-	    
-	    decobdbo = gp10 * exphu * hulpov * (exphua1 + exphub1) *
-	      ( gp3 - 2.0 * gp7 * (bo_ij->BO-2.50) );
-	    decobdboua = -gp10 * exphu * hulpov *
-	      (gp3*exphua1 + 25.0*gp4*exphuov*hulpov*(exphua1+exphub1));
-	    decobdboub = -gp10 * exphu * hulpov *
-	      (gp3*exphub1 + 25.0*gp4*exphuov*hulpov*(exphua1+exphub1));
-	    
-	    /* tally into per-atom energy */
-	    if( system->pair_ptr->evflag)
-	      system->pair_ptr->ev_tally(i,j,natoms,1,estriph,0.0,0.0,0.0,0.0,0.0);
-	    
-	    bo_ij->Cdbo += decobdbo;
-	    workspace->CdDelta[i] += decobdboua;
-	    workspace->CdDelta[j] += decobdboub;
+        /* Stabilisation terminal triple bond */
+        if( bo_ij->BO >= 1.00 ) {
+          if( gp37 == 2 ||
+              (sbp_i->mass == 12.0000 && sbp_j->mass == 15.9990) ||
+              (sbp_j->mass == 12.0000 && sbp_i->mass == 15.9990) ) {
+            exphu = exp( -gp7 * SQR(bo_ij->BO - 2.50) );
+            exphua1 = exp(-gp3 * (workspace->total_bond_order[i]-bo_ij->BO));
+            exphub1 = exp(-gp3 * (workspace->total_bond_order[j]-bo_ij->BO));
+            exphuov = exp(gp4 * (workspace->Delta[i] + workspace->Delta[j]));
+            hulpov = 1.0 / (1.0 + 25.0 * exphuov);
+
+            estriph = gp10 * exphu * hulpov * (exphua1 + exphub1);
+            data->my_en.e_bond += estriph;
+
+            decobdbo = gp10 * exphu * hulpov * (exphua1 + exphub1) *
+              ( gp3 - 2.0 * gp7 * (bo_ij->BO-2.50) );
+            decobdboua = -gp10 * exphu * hulpov *
+              (gp3*exphua1 + 25.0*gp4*exphuov*hulpov*(exphua1+exphub1));
+            decobdboub = -gp10 * exphu * hulpov *
+              (gp3*exphub1 + 25.0*gp4*exphuov*hulpov*(exphua1+exphub1));
+
+            /* tally into per-atom energy */
+            if( system->pair_ptr->evflag)
+              system->pair_ptr->ev_tally(i,j,natoms,1,estriph,0.0,0.0,0.0,0.0,0.0);
+
+            bo_ij->Cdbo += decobdbo;
+            workspace->CdDelta[i] += decobdboua;
+            workspace->CdDelta[j] += decobdboub;
 #ifdef TEST_ENERGY
-	    //fprintf( out_control->ebond, 
-	    //  "%6d%6d%24.15e%24.15e%24.15e%24.15e\n",
-	    //  system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
-	    //  estriph, decobdbo, decobdboua, decobdboub );
+            //fprintf( out_control->ebond,
+            //  "%6d%6d%24.15e%24.15e%24.15e%24.15e\n",
+            //  system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+            //  estriph, decobdbo, decobdboua, decobdboub );
 #endif
 #ifdef TEST_FORCES
-	    Add_dBO( system, lists, i, pj, decobdbo, workspace->f_be );
-	    Add_dDelta( system, lists, i, decobdboua, workspace->f_be );
-	    Add_dDelta( system, lists, j, decobdboub, workspace->f_be );
+            Add_dBO( system, lists, i, pj, decobdbo, workspace->f_be );
+            Add_dDelta( system, lists, i, decobdboua, workspace->f_be );
+            Add_dDelta( system, lists, j, decobdboub, workspace->f_be );
 #endif
-	  }
-	}
+          }
+        }
       }
     }
   }
diff --git a/src/USER-REAXC/reaxc_bonds.h b/src/USER-REAXC/reaxc_bonds.h
index 5a911cb21a..a4a1fb0b44 100644
--- a/src/USER-REAXC/reaxc_bonds.h
+++ b/src/USER-REAXC/reaxc_bonds.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -29,6 +29,6 @@
 
 #include "reaxc_types.h"
 
-void Bonds( reax_system*, control_params*, simulation_data*, 
-	    storage*, reax_list**, output_controls* );
+void Bonds( reax_system*, control_params*, simulation_data*,
+            storage*, reax_list**, output_controls* );
 #endif
diff --git a/src/USER-REAXC/reaxc_control.cpp b/src/USER-REAXC/reaxc_control.cpp
index 3a2585744a..4069017504 100644
--- a/src/USER-REAXC/reaxc_control.cpp
+++ b/src/USER-REAXC/reaxc_control.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -34,8 +34,8 @@
 #endif
 
 
-char Read_Control_File( char *control_file, control_params* control, 
-			output_controls *out_control )
+char Read_Control_File( char *control_file, control_params* control,
+                        output_controls *out_control )
 {
   FILE *fp;
   char *s, **tmp;
@@ -131,7 +131,7 @@ char Read_Control_File( char *control_file, control_params* control,
       ival = atoi(tmp[1]);
       control->ensemble = ival;
       if( ival == iNPT || ival ==sNPT || ival == NPT )
-	control->virial = 1;
+        control->virial = 1;
     }
     else if( strcmp(tmp[0], "nsteps") == 0 ) {
       ival = atoi(tmp[1]);
@@ -150,7 +150,7 @@ char Read_Control_File( char *control_file, control_params* control,
       control->procs_by_dim[2] = ival;
 
       control->nprocs = control->procs_by_dim[0]*control->procs_by_dim[1]*
-	control->procs_by_dim[2];
+        control->procs_by_dim[2];
     }
     //else if( strcmp(tmp[0], "restart") == 0 ) {
     //  ival = atoi(tmp[1]);
@@ -203,15 +203,15 @@ char Read_Control_File( char *control_file, control_params* control,
       val = atof(tmp[1]);
       control->bond_cut = val;
     }
-    else if( strcmp(tmp[0], "bond_graph_cutoff") == 0 ) { 
+    else if( strcmp(tmp[0], "bond_graph_cutoff") == 0 ) {
       val = atof(tmp[1]);
       control->bg_cut = val;
     }
-    else if( strcmp(tmp[0], "thb_cutoff") == 0 ) { 
+    else if( strcmp(tmp[0], "thb_cutoff") == 0 ) {
       val = atof(tmp[1]);
       control->thb_cut = val;
     }
-    else if( strcmp(tmp[0], "thb_cutoff_sq") == 0 ) { 
+    else if( strcmp(tmp[0], "thb_cutoff_sq") == 0 ) {
       val = atof(tmp[1]);
       control->thb_cutsq = val;
     }
@@ -246,16 +246,16 @@ char Read_Control_File( char *control_file, control_params* control,
     else if( strcmp(tmp[0], "temp_init") == 0 ) {
       val = atof(tmp[1]);
       control->T_init = val;
-	
+
       if( control->T_init < 0.1 )
-	control->T_init = 0.1;
+        control->T_init = 0.1;
     }
     else if( strcmp(tmp[0], "temp_final") == 0 ) {
       val = atof(tmp[1]);
       control->T_final = val;
-	
+
       if( control->T_final < 0.1 )
-	control->T_final = 0.1;
+        control->T_final = 0.1;
     }
     else if( strcmp(tmp[0], "t_mass") == 0 ) {
       val = atof(tmp[1]);
@@ -275,30 +275,30 @@ char Read_Control_File( char *control_file, control_params* control,
     }
     else if( strcmp(tmp[0], "pressure") == 0 ) {
       if( control->ensemble == iNPT ) {
-	control->P[0] = control->P[1] = control->P[2] = atof(tmp[1]);
+        control->P[0] = control->P[1] = control->P[2] = atof(tmp[1]);
       }
       else if( control->ensemble == sNPT ) {
-	control->P[0] = atof(tmp[1]);
-	control->P[1] = atof(tmp[2]);
-	control->P[2] = atof(tmp[3]);
+        control->P[0] = atof(tmp[1]);
+        control->P[1] = atof(tmp[2]);
+        control->P[2] = atof(tmp[3]);
       }
     }
     else if( strcmp(tmp[0], "p_mass") == 0 ) {
       // convert p_mass from fs to ps
       if( control->ensemble == iNPT ) {
-	control->Tau_P[0] = control->Tau_P[1] = control->Tau_P[2] = 
-	  atof(tmp[1]) * 1.e-3;
+        control->Tau_P[0] = control->Tau_P[1] = control->Tau_P[2] =
+          atof(tmp[1]) * 1.e-3;
       }
       else if( control->ensemble == sNPT ) {
-	control->Tau_P[0] = atof(tmp[1]) * 1.e-3;
-	control->Tau_P[1] = atof(tmp[2]) * 1.e-3;
-	control->Tau_P[2] = atof(tmp[3]) * 1.e-3;
+        control->Tau_P[0] = atof(tmp[1]) * 1.e-3;
+        control->Tau_P[1] = atof(tmp[2]) * 1.e-3;
+        control->Tau_P[2] = atof(tmp[3]) * 1.e-3;
       }
     }
     else if( strcmp(tmp[0], "pt_mass") == 0 ) {
       val = atof(tmp[1]);
-      control->Tau_PT[0] = control->Tau_PT[1] = control->Tau_PT[2] = 
-	val * 1.e-3;  // convert pt_mass from fs to ps
+      control->Tau_PT[0] = control->Tau_PT[1] = control->Tau_PT[2] =
+        val * 1.e-3;  // convert pt_mass from fs to ps
     }
     else if( strcmp(tmp[0], "compress") == 0 ) {
       val = atof(tmp[1]);
@@ -307,7 +307,7 @@ char Read_Control_File( char *control_file, control_params* control,
     else if( strcmp(tmp[0], "press_mode") == 0 ) {
       ival = atoi(tmp[1]);
       control->press_mode = ival;
-    }      
+    }
     else if( strcmp(tmp[0], "geo_format") == 0 ) {
       ival = atoi( tmp[1] );
       control->geo_format = ival;
@@ -351,10 +351,10 @@ char Read_Control_File( char *control_file, control_params* control,
       ival = atoi(tmp[1]);
       control->molecular_analysis = ival;
     }
-    else if( strcmp(tmp[0], "ignore") == 0 ) { 
+    else if( strcmp(tmp[0], "ignore") == 0 ) {
       control->num_ignored = atoi(tmp[1]);
       for( i = 0; i < control->num_ignored; ++i )
-	control->ignore[atoi(tmp[i+2])] = 1;
+        control->ignore[atoi(tmp[i+2])] = 1;
     }
     else if( strcmp(tmp[0], "dipole_anal") == 0 ) {
       ival = atoi(tmp[1]);
diff --git a/src/USER-REAXC/reaxc_control.h b/src/USER-REAXC/reaxc_control.h
index f453ed5e60..b2b455d6b8 100644
--- a/src/USER-REAXC/reaxc_control.h
+++ b/src/USER-REAXC/reaxc_control.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
diff --git a/src/USER-REAXC/reaxc_defs.h b/src/USER-REAXC/reaxc_defs.h
index 1cc3106bbd..33eb8dc170 100644
--- a/src/USER-REAXC/reaxc_defs.h
+++ b/src/USER-REAXC/reaxc_defs.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -64,7 +64,7 @@
 #define CAL_to_JOULES   4.184000   // CALories --> JOULES
 #define JOULES_to_CAL   1/4.184000 // JOULES --> CALories
 #define AMU_to_GRAM     1.6605e-24
-#define ANG_to_CM       1e-8   
+#define ANG_to_CM       1e-8
 #define AVOGNR          6.0221367e23
 #define P_CONV          1e-24 * AVOGNR * JOULES_to_CAL
 
@@ -79,7 +79,7 @@
 #define MAX_ATOM_TYPES      25
 
 #define NUM_INTRS      10
-#define ALMOST_ZERO    1e-10 
+#define ALMOST_ZERO    1e-10
 #define NEG_INF       -1e10
 #define NO_BOND        1e-3  // 0.001
 #define HB_THRESHOLD   1e-2  // 0.01
@@ -122,30 +122,30 @@ enum restart_formats { WRITE_ASCII, WRITE_BINARY, RF_N };
 
 enum ensembles { NVE, bNVT, nhNVT, sNPT, iNPT, NPT, ens_N };
 
-enum lists { BONDS, OLD_BONDS, THREE_BODIES, 
-	     HBONDS, FAR_NBRS, DBOS, DDELTAS, LIST_N };
+enum lists { BONDS, OLD_BONDS, THREE_BODIES,
+             HBONDS, FAR_NBRS, DBOS, DDELTAS, LIST_N };
 
-enum interactions { TYP_VOID, TYP_BOND, TYP_THREE_BODY, 
-		    TYP_HBOND, TYP_FAR_NEIGHBOR, TYP_DBO, TYP_DDELTA, TYP_N };
+enum interactions { TYP_VOID, TYP_BOND, TYP_THREE_BODY,
+                    TYP_HBOND, TYP_FAR_NEIGHBOR, TYP_DBO, TYP_DDELTA, TYP_N };
 
 enum message_tags { INIT, UPDATE, BNDRY, UPDATE_BNDRY,
-		    EXC_VEC1, EXC_VEC2, DIST_RVEC2, COLL_RVEC2, 
-		    DIST_RVECS, COLL_RVECS, INIT_DESCS, ATOM_LINES, 
-		    BOND_LINES, ANGLE_LINES, RESTART_ATOMS, TAGS_N };
+                    EXC_VEC1, EXC_VEC2, DIST_RVEC2, COLL_RVEC2,
+                    DIST_RVECS, COLL_RVECS, INIT_DESCS, ATOM_LINES,
+                    BOND_LINES, ANGLE_LINES, RESTART_ATOMS, TAGS_N };
 
-enum errors { FILE_NOT_FOUND = -10, UNKNOWN_ATOM_TYPE = -11, 
-	      CANNOT_OPEN_FILE = -12, CANNOT_INITIALIZE = -13, 
-	      INSUFFICIENT_MEMORY = -14, UNKNOWN_OPTION = -15,
-	      INVALID_INPUT = -16, INVALID_GEO = -17 };
+enum errors { FILE_NOT_FOUND = -10, UNKNOWN_ATOM_TYPE = -11,
+              CANNOT_OPEN_FILE = -12, CANNOT_INITIALIZE = -13,
+              INSUFFICIENT_MEMORY = -14, UNKNOWN_OPTION = -15,
+              INVALID_INPUT = -16, INVALID_GEO = -17 };
 
 enum exchanges { NONE, NEAR_EXCH, FULL_EXCH };
 
-enum gcell_types { NO_NBRS=0, NEAR_ONLY=1, HBOND_ONLY=2, FAR_ONLY=4, 
-		   NEAR_HBOND=3, NEAR_FAR=5, HBOND_FAR=6, FULL_NBRS=7, 
-		   NATIVE=8 };
+enum gcell_types { NO_NBRS=0, NEAR_ONLY=1, HBOND_ONLY=2, FAR_ONLY=4,
+                   NEAR_HBOND=3, NEAR_FAR=5, HBOND_FAR=6, FULL_NBRS=7,
+                   NATIVE=8 };
 
-enum atoms { C_ATOM = 0, H_ATOM = 1, O_ATOM = 2, N_ATOM = 3, 
-	     S_ATOM = 4, SI_ATOM = 5, GE_ATOM = 6, X_ATOM = 7 };
+enum atoms { C_ATOM = 0, H_ATOM = 1, O_ATOM = 2, N_ATOM = 3,
+             S_ATOM = 4, SI_ATOM = 5, GE_ATOM = 6, X_ATOM = 7 };
 
 enum traj_methods { REG_TRAJ, MPI_TRAJ, TF_N };
 
diff --git a/src/USER-REAXC/reaxc_ffield.cpp b/src/USER-REAXC/reaxc_ffield.cpp
index 0230e611b9..7d587ddb27 100644
--- a/src/USER-REAXC/reaxc_ffield.cpp
+++ b/src/USER-REAXC/reaxc_ffield.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -35,8 +35,8 @@
 #endif
 
 
-char Read_Force_Field( char *ffield_file, reax_interaction *reax, 
-		       control_params *control )
+char Read_Force_Field( char *ffield_file, reax_interaction *reax,
+                       control_params *control )
 {
   FILE    *fp;
   char    *s;
@@ -55,7 +55,7 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
     fprintf( stderr, "error opening the force filed file! terminating...\n" );
     MPI_Abort( comm, FILE_NOT_FOUND );
   }
-  
+
   s = (char*) malloc(sizeof(char)*MAX_LINE);
   tmp = (char**) malloc(sizeof(char*)*MAX_TOKENS);
   for (i=0; i < MAX_TOKENS; i++)
@@ -80,17 +80,17 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
   reax->gp.n_global = n;
   reax->gp.l = (real*) malloc(sizeof(real)*n);
 
-  /* see reax_types.h for mapping between l[i] and the lambdas used in ff */ 
+  /* see reax_types.h for mapping between l[i] and the lambdas used in ff */
   for (i=0; i < n; i++) {
     fgets(s,MAX_LINE,fp);
     c = Tokenize(s,&tmp);
-    
+
     val = (real) atof(tmp[0]);
     reax->gp.l[i] = val;
   }
 
   control->bo_cut    = 0.01 * reax->gp.l[29];
-  control->nonb_low  = reax->gp.l[11];  
+  control->nonb_low  = reax->gp.l[11];
   control->nonb_cut  = reax->gp.l[12];
 
   /* next line is number of atom types and some comments */
@@ -104,78 +104,78 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
   fgets(s,MAX_LINE,fp);
 
   /* Allocating structures in reax_interaction */
-  reax->sbp = (single_body_parameters*) 
-    scalloc( reax->num_atom_types, sizeof(single_body_parameters), "sbp", 
-	     comm );
-  reax->tbp = (two_body_parameters**)   
+  reax->sbp = (single_body_parameters*)
+    scalloc( reax->num_atom_types, sizeof(single_body_parameters), "sbp",
+             comm );
+  reax->tbp = (two_body_parameters**)
     scalloc( reax->num_atom_types, sizeof(two_body_parameters*), "tbp", comm );
-  reax->thbp= (three_body_header***)    
+  reax->thbp= (three_body_header***)
     scalloc( reax->num_atom_types, sizeof(three_body_header**), "thbp", comm );
-  reax->hbp = (hbond_parameters***)     
+  reax->hbp = (hbond_parameters***)
     scalloc( reax->num_atom_types, sizeof(hbond_parameters**), "hbp", comm );
-  reax->fbp = (four_body_header****)    
+  reax->fbp = (four_body_header****)
     scalloc( reax->num_atom_types, sizeof(four_body_header***), "fbp", comm );
-  tor_flag  = (char****)                
+  tor_flag  = (char****)
     scalloc( reax->num_atom_types, sizeof(char***), "tor_flag", comm );
-  
+
   for( i = 0; i < reax->num_atom_types; i++ ) {
-    reax->tbp[i] = (two_body_parameters*) 
-      scalloc( reax->num_atom_types, sizeof(two_body_parameters), "tbp[i]", 
-	       comm );
-    reax->thbp[i]= (three_body_header**)  
-      scalloc( reax->num_atom_types, sizeof(three_body_header*), "thbp[i]", 
-	       comm );
-    reax->hbp[i] = (hbond_parameters**)   
-      scalloc( reax->num_atom_types, sizeof(hbond_parameters*), "hbp[i]", 
-	       comm );
-    reax->fbp[i] = (four_body_header***)  
-      scalloc( reax->num_atom_types, sizeof(four_body_header**), "fbp[i]", 
-	       comm );
-    tor_flag[i]  = (char***)              
+    reax->tbp[i] = (two_body_parameters*)
+      scalloc( reax->num_atom_types, sizeof(two_body_parameters), "tbp[i]",
+               comm );
+    reax->thbp[i]= (three_body_header**)
+      scalloc( reax->num_atom_types, sizeof(three_body_header*), "thbp[i]",
+               comm );
+    reax->hbp[i] = (hbond_parameters**)
+      scalloc( reax->num_atom_types, sizeof(hbond_parameters*), "hbp[i]",
+               comm );
+    reax->fbp[i] = (four_body_header***)
+      scalloc( reax->num_atom_types, sizeof(four_body_header**), "fbp[i]",
+               comm );
+    tor_flag[i]  = (char***)
       scalloc( reax->num_atom_types, sizeof(char**), "tor_flag[i]", comm );
-    
+
     for( j = 0; j < reax->num_atom_types; j++ ) {
-      reax->thbp[i][j]= (three_body_header*) 
-	scalloc( reax->num_atom_types, sizeof(three_body_header), "thbp[i,j]", 
-		 comm );
-      reax->hbp[i][j] = (hbond_parameters*)  
-	scalloc( reax->num_atom_types, sizeof(hbond_parameters), "hbp[i,j]", 
-		 comm );
-      reax->fbp[i][j] = (four_body_header**) 
-	scalloc( reax->num_atom_types, sizeof(four_body_header*), "fbp[i,j]", 
-		 comm );
-      tor_flag[i][j]  = (char**)             
-	scalloc( reax->num_atom_types, sizeof(char*), "tor_flag[i,j]", comm );
-      
+      reax->thbp[i][j]= (three_body_header*)
+        scalloc( reax->num_atom_types, sizeof(three_body_header), "thbp[i,j]",
+                 comm );
+      reax->hbp[i][j] = (hbond_parameters*)
+        scalloc( reax->num_atom_types, sizeof(hbond_parameters), "hbp[i,j]",
+                 comm );
+      reax->fbp[i][j] = (four_body_header**)
+        scalloc( reax->num_atom_types, sizeof(four_body_header*), "fbp[i,j]",
+                 comm );
+      tor_flag[i][j]  = (char**)
+        scalloc( reax->num_atom_types, sizeof(char*), "tor_flag[i,j]", comm );
+
       for (k=0; k < reax->num_atom_types; k++) {
-	reax->fbp[i][j][k] = (four_body_header*) 
-	  scalloc( reax->num_atom_types, sizeof(four_body_header), "fbp[i,j,k]",
-		   comm );
-	tor_flag[i][j][k]  = (char*)             
-	  scalloc( reax->num_atom_types, sizeof(char), "tor_flag[i,j,k]", 
-		   comm );
+        reax->fbp[i][j][k] = (four_body_header*)
+          scalloc( reax->num_atom_types, sizeof(four_body_header), "fbp[i,j,k]",
+                   comm );
+        tor_flag[i][j][k]  = (char*)
+          scalloc( reax->num_atom_types, sizeof(char), "tor_flag[i,j,k]",
+                   comm );
       }
     }
   }
 
-  // vdWaals type: 1: Shielded Morse, no inner-wall 
-  //               2: inner wall, no shielding  
+  // vdWaals type: 1: Shielded Morse, no inner-wall
+  //               2: inner wall, no shielding
   //               3: inner wall+shielding
   reax->gp.vdw_type = 0;
-  
+
   /* reading single atom parameters */
-  /* there are 4 or 5 lines of each single atom parameters in ff files, 
-     depending on using lgvdw or not. These parameters later determine 
+  /* there are 4 or 5 lines of each single atom parameters in ff files,
+     depending on using lgvdw or not. These parameters later determine
      some of the pair and triplet parameters using combination rules. */
 
   for( i = 0; i < reax->num_atom_types; i++ ) {
     /* line one */
     fgets( s, MAX_LINE, fp );
     c = Tokenize( s, &tmp );
-    
+
     for( j = 0; j < (int)(strlen(tmp[0])); ++j )
       reax->sbp[i].name[j] = toupper( tmp[0][j] );
-    
+
     val = atof(tmp[1]); reax->sbp[i].r_s        = val;
     val = atof(tmp[2]); reax->sbp[i].valency    = val;
     val = atof(tmp[3]); reax->sbp[i].mass       = val;
@@ -189,29 +189,29 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
     /* line two */
     fgets( s, MAX_LINE, fp );
     c = Tokenize( s, &tmp );
-    
+
     val = atof(tmp[0]); reax->sbp[i].alpha      = val;
     val = atof(tmp[1]); reax->sbp[i].gamma_w    = val;
     val = atof(tmp[2]); reax->sbp[i].valency_boc= val;
     val = atof(tmp[3]); reax->sbp[i].p_ovun5    = val;
-    val = atof(tmp[4]); 
+    val = atof(tmp[4]);
     val = atof(tmp[5]); reax->sbp[i].chi        = val;
     val = atof(tmp[6]); reax->sbp[i].eta        = 2.0 * val;
     val = atof(tmp[7]); reax->sbp[i].p_hbond = (int) val;
-    
+
     /* line 3 */
     fgets( s, MAX_LINE, fp );
     c = Tokenize( s, &tmp );
-    
+
     val = atof(tmp[0]); reax->sbp[i].r_pi_pi    = val;
     val = atof(tmp[1]); reax->sbp[i].p_lp2      = val;
-    val = atof(tmp[2]); 
+    val = atof(tmp[2]);
     val = atof(tmp[3]); reax->sbp[i].b_o_131    = val;
     val = atof(tmp[4]); reax->sbp[i].b_o_132    = val;
     val = atof(tmp[5]); reax->sbp[i].b_o_133    = val;
-    val = atof(tmp[6]); 
-    val = atof(tmp[7]); 
-    
+    val = atof(tmp[6]);
+    val = atof(tmp[7]);
+
     /* line 4  */
     fgets( s, MAX_LINE, fp );
     c = Tokenize( s, &tmp );
@@ -224,7 +224,7 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
 
     val = atof(tmp[0]); reax->sbp[i].p_ovun2    = val;
     val = atof(tmp[1]); reax->sbp[i].p_val3     = val;
-    val = atof(tmp[2]); 
+    val = atof(tmp[2]);
     val = atof(tmp[3]); reax->sbp[i].valency_val= val;
     val = atof(tmp[4]); reax->sbp[i].p_val5     = val;
     val = atof(tmp[5]); reax->sbp[i].rcore2     = val;
@@ -242,74 +242,74 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
         MPI_Abort( comm, FILE_NOT_FOUND );
       }
 
-      val = atof(tmp[0]); reax->sbp[i].lgcij   	= val;
-      val = atof(tmp[1]); reax->sbp[i].lgre   	= val;
+      val = atof(tmp[0]); reax->sbp[i].lgcij           = val;
+      val = atof(tmp[1]); reax->sbp[i].lgre           = val;
     }
 
     if( reax->sbp[i].rcore2>0.01 && reax->sbp[i].acore2>0.01 ){ // Inner-wall
       if( reax->sbp[i].gamma_w>0.5 ){ // Shielding vdWaals
-	if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 3 ) {
-	  if (errorflag) 
-	    fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n"	\
-		   "Force field parameters for element %s\n"		\
-		   "indicate inner wall+shielding, but earlier\n"	\
-		   "atoms indicate different vdWaals-method.\n"		\
-		   "This may cause division-by-zero errors.\n"		\
-		   "Keeping vdWaals-setting for earlier atoms.\n", 
-		   reax->sbp[i].name );
-	  errorflag = 0;
-	}
-	else{
-	  reax->gp.vdw_type = 3;
+        if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 3 ) {
+          if (errorflag)
+            fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n"        \
+                   "Force field parameters for element %s\n"                \
+                   "indicate inner wall+shielding, but earlier\n"        \
+                   "atoms indicate different vdWaals-method.\n"                \
+                   "This may cause division-by-zero errors.\n"                \
+                   "Keeping vdWaals-setting for earlier atoms.\n",
+                   reax->sbp[i].name );
+          errorflag = 0;
+        }
+        else{
+          reax->gp.vdw_type = 3;
 #if defined(DEBUG)
-	  fprintf( stderr, "vdWaals type for element %s: Shielding+inner-wall",
-		   reax->sbp[i].name );
+          fprintf( stderr, "vdWaals type for element %s: Shielding+inner-wall",
+                   reax->sbp[i].name );
 #endif
-	}
+        }
       }
       else {  // No shielding vdWaals parameters present
-	if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 2 )
-	  fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n"	\
-		   "Force field parameters for element %s\n"		\
-		   "indicate inner wall without shielding, but earlier\n" \
-		   "atoms indicate different vdWaals-method.\n"		\
-		   "This may cause division-by-zero errors.\n"		\
-		   "Keeping vdWaals-setting for earlier atoms.\n", 
-		   reax->sbp[i].name );
-	else{
-	  reax->gp.vdw_type = 2;
+        if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 2 )
+          fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n"        \
+                   "Force field parameters for element %s\n"                \
+                   "indicate inner wall without shielding, but earlier\n" \
+                   "atoms indicate different vdWaals-method.\n"                \
+                   "This may cause division-by-zero errors.\n"                \
+                   "Keeping vdWaals-setting for earlier atoms.\n",
+                   reax->sbp[i].name );
+        else{
+          reax->gp.vdw_type = 2;
 #if defined(DEBUG)
-	  fprintf( stderr,"vdWaals type for element%s: No Shielding,inner-wall",
-		   reax->sbp[i].name );
+          fprintf( stderr,"vdWaals type for element%s: No Shielding,inner-wall",
+                   reax->sbp[i].name );
 #endif
-	}
+        }
       }
     }
     else{ // No Inner wall parameters present
       if( reax->sbp[i].gamma_w>0.5 ){ // Shielding vdWaals
-	if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 1 )
-	  fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n"	\
-		   "Force field parameters for element %s\n"		\
-		   "indicate  shielding without inner wall, but earlier\n" \
-		   "atoms indicate different vdWaals-method.\n"		\
-		   "This may cause division-by-zero errors.\n"		\
-		   "Keeping vdWaals-setting for earlier atoms.\n", 
-		   reax->sbp[i].name );
-	else{
-	  reax->gp.vdw_type = 1;
+        if( reax->gp.vdw_type != 0 && reax->gp.vdw_type != 1 )
+          fprintf( stderr, "Warning: inconsistent vdWaals-parameters\n"        \
+                   "Force field parameters for element %s\n"                \
+                   "indicate  shielding without inner wall, but earlier\n" \
+                   "atoms indicate different vdWaals-method.\n"                \
+                   "This may cause division-by-zero errors.\n"                \
+                   "Keeping vdWaals-setting for earlier atoms.\n",
+                   reax->sbp[i].name );
+        else{
+          reax->gp.vdw_type = 1;
 #if defined(DEBUG)
-	  fprintf( stderr,"vdWaals type for element%s: Shielding,no inner-wall",
-		   reax->sbp[i].name );
+          fprintf( stderr,"vdWaals type for element%s: Shielding,no inner-wall",
+                   reax->sbp[i].name );
 #endif
-	}
+        }
       }
       else{
-	fprintf( stderr, "Error: inconsistent vdWaals-parameters\n"\
-		 "No shielding or inner-wall set for element %s\n",
-		 reax->sbp[i].name );
-	MPI_Abort( comm, INVALID_INPUT );
+        fprintf( stderr, "Error: inconsistent vdWaals-parameters\n"\
+                 "No shielding or inner-wall set for element %s\n",
+                 reax->sbp[i].name );
+        MPI_Abort( comm, INVALID_INPUT );
       }
-    } 
+    }
   }
 
 #if defined(DEBUG)
@@ -319,9 +319,9 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
   /* Equate vval3 to valf for first-row elements (25/10/2004) */
   for( i = 0; i < reax->num_atom_types; i++ )
     if( reax->sbp[i].mass < 21 &&
-	reax->sbp[i].valency_val != reax->sbp[i].valency_boc ){
+        reax->sbp[i].valency_val != reax->sbp[i].valency_boc ){
       fprintf( stderr, "Warning: changed valency_val to valency_boc for %s\n",
-	       reax->sbp[i].name );
+               reax->sbp[i].name );
       reax->sbp[i].valency_val = reax->sbp[i].valency_boc;
     }
 
@@ -333,12 +333,12 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
 
   /* a line of comments */
   fgets(s,MAX_LINE,fp);
-  
+
   for (i=0; i < l; i++) {
     /* line 1 */
     fgets(s,MAX_LINE,fp);
     c=Tokenize(s,&tmp);
-      
+
     j = atoi(tmp[0]) - 1;
     k = atoi(tmp[1]) - 1;
 
@@ -356,7 +356,7 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
       reax->tbp[k][j].p_bo5     = val;
       val = atof(tmp[7]); reax->tbp[j][k].v13cor    = val;
       reax->tbp[k][j].v13cor    = val;
-                          
+
       val = atof(tmp[8]); reax->tbp[j][k].p_bo6     = val;
       reax->tbp[k][j].p_bo6     = val;
       val = atof(tmp[9]); reax->tbp[j][k].p_ovun1 = val;
@@ -372,118 +372,118 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
       reax->tbp[k][j].p_bo3     = val;
       val = atof(tmp[2]); reax->tbp[j][k].p_bo4     = val;
       reax->tbp[k][j].p_bo4     = val;
-      val = atof(tmp[3]); 
-                          
+      val = atof(tmp[3]);
+
       val = atof(tmp[4]); reax->tbp[j][k].p_bo1     = val;
       reax->tbp[k][j].p_bo1     = val;
       val = atof(tmp[5]); reax->tbp[j][k].p_bo2     = val;
       reax->tbp[k][j].p_bo2     = val;
       val = atof(tmp[6]); reax->tbp[j][k].ovc       = val;
       reax->tbp[k][j].ovc       = val;
-                          
-      val = atof(tmp[7]); 
+
+      val = atof(tmp[7]);
     }
   }
 
   /* calculating combination rules and filling up remaining fields. */
-  
+
   for (i=0; i < reax->num_atom_types; i++)
     for (j=i; j < reax->num_atom_types; j++) {
       reax->tbp[i][j].r_s = 0.5 *
-	(reax->sbp[i].r_s + reax->sbp[j].r_s);
+        (reax->sbp[i].r_s + reax->sbp[j].r_s);
       reax->tbp[j][i].r_s = 0.5 *
-	(reax->sbp[j].r_s + reax->sbp[i].r_s);
+        (reax->sbp[j].r_s + reax->sbp[i].r_s);
 
       reax->tbp[i][j].r_p = 0.5 *
-	(reax->sbp[i].r_pi + reax->sbp[j].r_pi);
+        (reax->sbp[i].r_pi + reax->sbp[j].r_pi);
       reax->tbp[j][i].r_p = 0.5 *
-	(reax->sbp[j].r_pi + reax->sbp[i].r_pi);
+        (reax->sbp[j].r_pi + reax->sbp[i].r_pi);
 
       reax->tbp[i][j].r_pp = 0.5 *
-	(reax->sbp[i].r_pi_pi + reax->sbp[j].r_pi_pi);
+        (reax->sbp[i].r_pi_pi + reax->sbp[j].r_pi_pi);
       reax->tbp[j][i].r_pp = 0.5 *
-	(reax->sbp[j].r_pi_pi + reax->sbp[i].r_pi_pi);
-
-
-      reax->tbp[i][j].p_boc3 = 
-	sqrt(reax->sbp[i].b_o_132 *
-	     reax->sbp[j].b_o_132);
-      reax->tbp[j][i].p_boc3 = 
-	sqrt(reax->sbp[j].b_o_132 *
-	     reax->sbp[i].b_o_132);
-
-      reax->tbp[i][j].p_boc4 = 
-	sqrt(reax->sbp[i].b_o_131 *
-	     reax->sbp[j].b_o_131);
-      reax->tbp[j][i].p_boc4 = 
-	sqrt(reax->sbp[j].b_o_131 *
-	     reax->sbp[i].b_o_131);
-
-      reax->tbp[i][j].p_boc5 = 
-	sqrt(reax->sbp[i].b_o_133 *
-	     reax->sbp[j].b_o_133);
-      reax->tbp[j][i].p_boc5 = 
-	sqrt(reax->sbp[j].b_o_133 *
-	     reax->sbp[i].b_o_133);
-
-	
-      reax->tbp[i][j].D = 
-	sqrt(reax->sbp[i].epsilon *
-	     reax->sbp[j].epsilon);
-
-      reax->tbp[j][i].D = 
-	sqrt(reax->sbp[j].epsilon *
-	     reax->sbp[i].epsilon);
-
-      reax->tbp[i][j].alpha = 
-	sqrt(reax->sbp[i].alpha *
-	     reax->sbp[j].alpha);
-
-      reax->tbp[j][i].alpha = 
-	sqrt(reax->sbp[j].alpha *
-	     reax->sbp[i].alpha);
-
-      reax->tbp[i][j].r_vdW = 
-	2.0 * sqrt(reax->sbp[i].r_vdw * reax->sbp[j].r_vdw);
+        (reax->sbp[j].r_pi_pi + reax->sbp[i].r_pi_pi);
+
+
+      reax->tbp[i][j].p_boc3 =
+        sqrt(reax->sbp[i].b_o_132 *
+             reax->sbp[j].b_o_132);
+      reax->tbp[j][i].p_boc3 =
+        sqrt(reax->sbp[j].b_o_132 *
+             reax->sbp[i].b_o_132);
+
+      reax->tbp[i][j].p_boc4 =
+        sqrt(reax->sbp[i].b_o_131 *
+             reax->sbp[j].b_o_131);
+      reax->tbp[j][i].p_boc4 =
+        sqrt(reax->sbp[j].b_o_131 *
+             reax->sbp[i].b_o_131);
+
+      reax->tbp[i][j].p_boc5 =
+        sqrt(reax->sbp[i].b_o_133 *
+             reax->sbp[j].b_o_133);
+      reax->tbp[j][i].p_boc5 =
+        sqrt(reax->sbp[j].b_o_133 *
+             reax->sbp[i].b_o_133);
+
+
+      reax->tbp[i][j].D =
+        sqrt(reax->sbp[i].epsilon *
+             reax->sbp[j].epsilon);
+
+      reax->tbp[j][i].D =
+        sqrt(reax->sbp[j].epsilon *
+             reax->sbp[i].epsilon);
+
+      reax->tbp[i][j].alpha =
+        sqrt(reax->sbp[i].alpha *
+             reax->sbp[j].alpha);
+
+      reax->tbp[j][i].alpha =
+        sqrt(reax->sbp[j].alpha *
+             reax->sbp[i].alpha);
+
+      reax->tbp[i][j].r_vdW =
+        2.0 * sqrt(reax->sbp[i].r_vdw * reax->sbp[j].r_vdw);
 
       reax->tbp[j][i].r_vdW =
-	2.0 * sqrt(reax->sbp[j].r_vdw * reax->sbp[i].r_vdw);
+        2.0 * sqrt(reax->sbp[j].r_vdw * reax->sbp[i].r_vdw);
 
       reax->tbp[i][j].gamma_w =
-	sqrt(reax->sbp[i].gamma_w *
-	     reax->sbp[j].gamma_w);
+        sqrt(reax->sbp[i].gamma_w *
+             reax->sbp[j].gamma_w);
 
       reax->tbp[j][i].gamma_w =
-	sqrt(reax->sbp[j].gamma_w *
-	     reax->sbp[i].gamma_w);
+        sqrt(reax->sbp[j].gamma_w *
+             reax->sbp[i].gamma_w);
 
       reax->tbp[i][j].gamma =
-	pow(reax->sbp[i].gamma *
-	    reax->sbp[j].gamma,-1.5);
+        pow(reax->sbp[i].gamma *
+            reax->sbp[j].gamma,-1.5);
 
       reax->tbp[j][i].gamma =
-	pow(reax->sbp[j].gamma *
-	    reax->sbp[i].gamma,-1.5);
+        pow(reax->sbp[j].gamma *
+            reax->sbp[i].gamma,-1.5);
 
       // additions for additional vdWaals interaction types - inner core
-      
+
       reax->tbp[i][j].rcore = reax->tbp[j][i].rcore =
-	sqrt( reax->sbp[i].rcore2 * reax->sbp[j].rcore2 );
+        sqrt( reax->sbp[i].rcore2 * reax->sbp[j].rcore2 );
 
       reax->tbp[i][j].ecore = reax->tbp[j][i].ecore =
-	sqrt( reax->sbp[i].ecore2 * reax->sbp[j].ecore2 );
+        sqrt( reax->sbp[i].ecore2 * reax->sbp[j].ecore2 );
 
       reax->tbp[i][j].acore = reax->tbp[j][i].acore =
-	sqrt( reax->sbp[i].acore2 * reax->sbp[j].acore2 );
+        sqrt( reax->sbp[i].acore2 * reax->sbp[j].acore2 );
 
-      // additions for additional vdWalls interaction types lg correction 
+      // additions for additional vdWalls interaction types lg correction
 
       reax->tbp[i][j].lgcij = reax->tbp[j][i].lgcij =
-	sqrt( reax->sbp[i].lgcij * reax->sbp[j].lgcij );
+        sqrt( reax->sbp[i].lgcij * reax->sbp[j].lgcij );
 
-      reax->tbp[i][j].lgre = reax->tbp[j][i].lgre = 2.0 *	
+      reax->tbp[i][j].lgre = reax->tbp[j][i].lgre = 2.0 *
         sqrt( reax->sbp[i].lgre*reax->sbp[j].lgre );
- 
+
     }
 
 
@@ -493,114 +493,114 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
   fgets(s,MAX_LINE,fp);
   c=Tokenize(s,&tmp);
   l = atoi(tmp[0]);
-  
+
   for (i=0; i < l; i++) {
     fgets(s,MAX_LINE,fp);
     c=Tokenize(s,&tmp);
-      
+
     j = atoi(tmp[0]) - 1;
     k = atoi(tmp[1]) - 1;
 
-    if (j < reax->num_atom_types && k < reax->num_atom_types)	{
-      val = atof(tmp[2]); 
+    if (j < reax->num_atom_types && k < reax->num_atom_types)        {
+      val = atof(tmp[2]);
       if (val > 0.0) {
-	reax->tbp[j][k].D = val;
-	reax->tbp[k][j].D = val;
+        reax->tbp[j][k].D = val;
+        reax->tbp[k][j].D = val;
       }
 
-      val = atof(tmp[3]); 
+      val = atof(tmp[3]);
       if (val > 0.0) {
-	reax->tbp[j][k].r_vdW = 2 * val;
-	reax->tbp[k][j].r_vdW = 2 * val;
+        reax->tbp[j][k].r_vdW = 2 * val;
+        reax->tbp[k][j].r_vdW = 2 * val;
       }
 
-      val = atof(tmp[4]); 
+      val = atof(tmp[4]);
       if (val > 0.0) {
-	reax->tbp[j][k].alpha = val;
-	reax->tbp[k][j].alpha = val;
+        reax->tbp[j][k].alpha = val;
+        reax->tbp[k][j].alpha = val;
       }
 
-      val = atof(tmp[5]); 
+      val = atof(tmp[5]);
       if (val > 0.0) {
-	reax->tbp[j][k].r_s = val;
-	reax->tbp[k][j].r_s = val;
+        reax->tbp[j][k].r_s = val;
+        reax->tbp[k][j].r_s = val;
       }
 
-      val = atof(tmp[6]); 
+      val = atof(tmp[6]);
       if (val > 0.0) {
-	reax->tbp[j][k].r_p = val;
-	reax->tbp[k][j].r_p = val;
+        reax->tbp[j][k].r_p = val;
+        reax->tbp[k][j].r_p = val;
       }
 
-      val = atof(tmp[7]); 
+      val = atof(tmp[7]);
       if (val > 0.0) {
-	reax->tbp[j][k].r_pp = val;
-	reax->tbp[k][j].r_pp = val;
+        reax->tbp[j][k].r_pp = val;
+        reax->tbp[k][j].r_pp = val;
       }
 
-      val = atof(tmp[8]); 
+      val = atof(tmp[8]);
       if (val >= 0.0) {
-	reax->tbp[j][k].lgcij = val;
-	reax->tbp[k][j].lgcij = val;
+        reax->tbp[j][k].lgcij = val;
+        reax->tbp[k][j].lgcij = val;
       }
     }
   }
-  
 
-  /* 3-body parameters - 
+
+  /* 3-body parameters -
      supports multi-well potentials (upto MAX_3BODY_PARAM in mytypes.h) */
   /* clear entries first */
   for( i = 0; i < reax->num_atom_types; ++i )
     for( j = 0; j < reax->num_atom_types; ++j )
       for( k = 0; k < reax->num_atom_types; ++k )
-	reax->thbp[i][j][k].cnt = 0;
+        reax->thbp[i][j][k].cnt = 0;
 
-  /* next line is number of 3-body params and some comments */	
+  /* next line is number of 3-body params and some comments */
   fgets( s, MAX_LINE, fp );
   c = Tokenize( s, &tmp );
   l = atoi( tmp[0] );
-  
+
   for( i = 0; i < l; i++ ) {
     fgets(s,MAX_LINE,fp);
     c=Tokenize(s,&tmp);
-      
+
     j = atoi(tmp[0]) - 1;
     k = atoi(tmp[1]) - 1;
     m = atoi(tmp[2]) - 1;
 
-    if (j < reax->num_atom_types && k < reax->num_atom_types && 
-	m < reax->num_atom_types) {
+    if (j < reax->num_atom_types && k < reax->num_atom_types &&
+        m < reax->num_atom_types) {
       cnt = reax->thbp[j][k][m].cnt;
       reax->thbp[j][k][m].cnt++;
       reax->thbp[m][k][j].cnt++;
 
-      val = atof(tmp[3]); 
+      val = atof(tmp[3]);
       reax->thbp[j][k][m].prm[cnt].theta_00 = val;
       reax->thbp[m][k][j].prm[cnt].theta_00 = val;
 
-      val = atof(tmp[4]); 
+      val = atof(tmp[4]);
       reax->thbp[j][k][m].prm[cnt].p_val1 = val;
       reax->thbp[m][k][j].prm[cnt].p_val1 = val;
 
-      val = atof(tmp[5]); 
+      val = atof(tmp[5]);
       reax->thbp[j][k][m].prm[cnt].p_val2 = val;
       reax->thbp[m][k][j].prm[cnt].p_val2 = val;
 
-      val = atof(tmp[6]); 
+      val = atof(tmp[6]);
       reax->thbp[j][k][m].prm[cnt].p_coa1 = val;
       reax->thbp[m][k][j].prm[cnt].p_coa1 = val;
 
-      val = atof(tmp[7]); 
+      val = atof(tmp[7]);
       reax->thbp[j][k][m].prm[cnt].p_val7 = val;
       reax->thbp[m][k][j].prm[cnt].p_val7 = val;
 
-      val = atof(tmp[8]); 
+      val = atof(tmp[8]);
       reax->thbp[j][k][m].prm[cnt].p_pen1 = val;
       reax->thbp[m][k][j].prm[cnt].p_pen1 = val;
 
-      val = atof(tmp[9]); 
+      val = atof(tmp[9]);
       reax->thbp[j][k][m].prm[cnt].p_val4 = val;
-      reax->thbp[m][k][j].prm[cnt].p_val4 = val;	  
+      reax->thbp[m][k][j].prm[cnt].p_val4 = val;
     }
   }
 
@@ -610,17 +610,17 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
      position. However, explicit X-Y-Z-W takes precedence over the
      default description.
      supports multi-well potentials (upto MAX_4BODY_PARAM in mytypes.h)
-     IMPORTANT: for now, directions on how to read multi-entries from ffield 
+     IMPORTANT: for now, directions on how to read multi-entries from ffield
      is not clear */
-  
+
   /* clear all entries first */
   for( i = 0; i < reax->num_atom_types; ++i )
     for( j = 0; j < reax->num_atom_types; ++j )
       for( k = 0; k < reax->num_atom_types; ++k )
-	for( m = 0; m < reax->num_atom_types; ++m ) {
-	  reax->fbp[i][j][k][m].cnt = 0;
-	  tor_flag[i][j][k][m] = 0;
-	}
+        for( m = 0; m < reax->num_atom_types; ++m ) {
+          reax->fbp[i][j][k][m].cnt = 0;
+          tor_flag[i][j][k][m] = 0;
+        }
 
   /* next line is number of 4-body params and some comments */
   fgets( s, MAX_LINE, fp );
@@ -630,73 +630,73 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
   for( i = 0; i < l; i++ ) {
     fgets( s, MAX_LINE, fp );
     c = Tokenize( s, &tmp );
-        
+
     j = atoi(tmp[0]) - 1;
     k = atoi(tmp[1]) - 1;
     m = atoi(tmp[2]) - 1;
     n = atoi(tmp[3]) - 1;
-      
+
     if (j >= 0 && n >= 0) { // this means the entry is not in compact form
-      if (j < reax->num_atom_types && k < reax->num_atom_types && 
-	  m < reax->num_atom_types && n < reax->num_atom_types) {
-	/* these flags ensure that this entry take precedence
-	   over the compact form entries */
-	tor_flag[j][k][m][n] = 1;
-	tor_flag[n][m][k][j] = 1;
-
-	reax->fbp[j][k][m][n].cnt = 1;
-	reax->fbp[n][m][k][j].cnt = 1;
-	/* cnt = reax->fbp[j][k][m][n].cnt;
-	   reax->fbp[j][k][m][n].cnt++;
-	   reax->fbp[n][m][k][j].cnt++; */
-
-	val = atof(tmp[4]); 
-	reax->fbp[j][k][m][n].prm[0].V1 = val;
-	reax->fbp[n][m][k][j].prm[0].V1 = val;
-
-	val = atof(tmp[5]); 
-	reax->fbp[j][k][m][n].prm[0].V2 = val;
-	reax->fbp[n][m][k][j].prm[0].V2 = val;
-
-	val = atof(tmp[6]); 
-	reax->fbp[j][k][m][n].prm[0].V3 = val;
-	reax->fbp[n][m][k][j].prm[0].V3 = val;
-
-	val = atof(tmp[7]); 
-	reax->fbp[j][k][m][n].prm[0].p_tor1 = val;
-	reax->fbp[n][m][k][j].prm[0].p_tor1 = val;
-
-	val = atof(tmp[8]); 
-	reax->fbp[j][k][m][n].prm[0].p_cot1 = val;
-	reax->fbp[n][m][k][j].prm[0].p_cot1 = val;	      
+      if (j < reax->num_atom_types && k < reax->num_atom_types &&
+          m < reax->num_atom_types && n < reax->num_atom_types) {
+        /* these flags ensure that this entry take precedence
+           over the compact form entries */
+        tor_flag[j][k][m][n] = 1;
+        tor_flag[n][m][k][j] = 1;
+
+        reax->fbp[j][k][m][n].cnt = 1;
+        reax->fbp[n][m][k][j].cnt = 1;
+        /* cnt = reax->fbp[j][k][m][n].cnt;
+           reax->fbp[j][k][m][n].cnt++;
+           reax->fbp[n][m][k][j].cnt++; */
+
+        val = atof(tmp[4]);
+        reax->fbp[j][k][m][n].prm[0].V1 = val;
+        reax->fbp[n][m][k][j].prm[0].V1 = val;
+
+        val = atof(tmp[5]);
+        reax->fbp[j][k][m][n].prm[0].V2 = val;
+        reax->fbp[n][m][k][j].prm[0].V2 = val;
+
+        val = atof(tmp[6]);
+        reax->fbp[j][k][m][n].prm[0].V3 = val;
+        reax->fbp[n][m][k][j].prm[0].V3 = val;
+
+        val = atof(tmp[7]);
+        reax->fbp[j][k][m][n].prm[0].p_tor1 = val;
+        reax->fbp[n][m][k][j].prm[0].p_tor1 = val;
+
+        val = atof(tmp[8]);
+        reax->fbp[j][k][m][n].prm[0].p_cot1 = val;
+        reax->fbp[n][m][k][j].prm[0].p_cot1 = val;
       }
-    }      
+    }
     else { /* This means the entry is of the form 0-X-Y-0 */
       if( k < reax->num_atom_types && m < reax->num_atom_types )
-	for( p = 0; p < reax->num_atom_types; p++ )
-	  for( o = 0; o < reax->num_atom_types; o++ ) {
-	    reax->fbp[p][k][m][o].cnt = 1;
-	    reax->fbp[o][m][k][p].cnt = 1;
-	    /* cnt = reax->fbp[p][k][m][o].cnt;
-	       reax->fbp[p][k][m][o].cnt++;
-	       reax->fbp[o][m][k][p].cnt++; */
-
-	    if (tor_flag[p][k][m][o] == 0) {
-	      reax->fbp[p][k][m][o].prm[0].V1 = atof(tmp[4]);
-	      reax->fbp[p][k][m][o].prm[0].V2 = atof(tmp[5]);
-	      reax->fbp[p][k][m][o].prm[0].V3 = atof(tmp[6]);
-	      reax->fbp[p][k][m][o].prm[0].p_tor1 = atof(tmp[7]);
-	      reax->fbp[p][k][m][o].prm[0].p_cot1 = atof(tmp[8]);
-	    }
-		  
-	    if (tor_flag[o][m][k][p] == 0) {
-	      reax->fbp[o][m][k][p].prm[0].V1 = atof(tmp[4]);
-	      reax->fbp[o][m][k][p].prm[0].V2 = atof(tmp[5]);
-	      reax->fbp[o][m][k][p].prm[0].V3 = atof(tmp[6]);
-	      reax->fbp[o][m][k][p].prm[0].p_tor1 = atof(tmp[7]);
-	      reax->fbp[o][m][k][p].prm[0].p_cot1 = atof(tmp[8]);
-	    }		
-	  }
+        for( p = 0; p < reax->num_atom_types; p++ )
+          for( o = 0; o < reax->num_atom_types; o++ ) {
+            reax->fbp[p][k][m][o].cnt = 1;
+            reax->fbp[o][m][k][p].cnt = 1;
+            /* cnt = reax->fbp[p][k][m][o].cnt;
+               reax->fbp[p][k][m][o].cnt++;
+               reax->fbp[o][m][k][p].cnt++; */
+
+            if (tor_flag[p][k][m][o] == 0) {
+              reax->fbp[p][k][m][o].prm[0].V1 = atof(tmp[4]);
+              reax->fbp[p][k][m][o].prm[0].V2 = atof(tmp[5]);
+              reax->fbp[p][k][m][o].prm[0].V3 = atof(tmp[6]);
+              reax->fbp[p][k][m][o].prm[0].p_tor1 = atof(tmp[7]);
+              reax->fbp[p][k][m][o].prm[0].p_cot1 = atof(tmp[8]);
+            }
+
+            if (tor_flag[o][m][k][p] == 0) {
+              reax->fbp[o][m][k][p].prm[0].V1 = atof(tmp[4]);
+              reax->fbp[o][m][k][p].prm[0].V2 = atof(tmp[5]);
+              reax->fbp[o][m][k][p].prm[0].V3 = atof(tmp[6]);
+              reax->fbp[o][m][k][p].prm[0].p_tor1 = atof(tmp[7]);
+              reax->fbp[o][m][k][p].prm[0].p_cot1 = atof(tmp[8]);
+            }
+          }
     }
   }
 
@@ -710,28 +710,28 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
   for( i = 0; i < l; i++ ) {
     fgets( s, MAX_LINE, fp );
     c = Tokenize( s, &tmp );
-      
+
     j = atoi(tmp[0]) - 1;
     k = atoi(tmp[1]) - 1;
     m = atoi(tmp[2]) - 1;
 
 
     if( j < reax->num_atom_types && m < reax->num_atom_types ) {
-      val = atof(tmp[3]); 
+      val = atof(tmp[3]);
       reax->hbp[j][k][m].r0_hb = val;
 
-      val = atof(tmp[4]); 
+      val = atof(tmp[4]);
       reax->hbp[j][k][m].p_hb1 = val;
 
-      val = atof(tmp[5]); 
+      val = atof(tmp[5]);
       reax->hbp[j][k][m].p_hb2 = val;
 
-      val = atof(tmp[6]); 
+      val = atof(tmp[6]);
       reax->hbp[j][k][m].p_hb3 = val;
     }
   }
 
-  
+
   /* deallocate helper storage */
   for( i = 0; i < MAX_TOKENS; i++ )
     free( tmp[i] );
@@ -743,7 +743,7 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
   for( i = 0; i < reax->num_atom_types; i++ ) {
     for( j = 0; j < reax->num_atom_types; j++ ) {
       for( k = 0; k < reax->num_atom_types; k++ ) {
-	free( tor_flag[i][j][k] );
+        free( tor_flag[i][j][k] );
       }
       free( tor_flag[i][j] );
     }
@@ -758,6 +758,6 @@ char Read_Force_Field( char *ffield_file, reax_interaction *reax,
 #if defined(DEBUG_FOCUS)
   fprintf( stderr, "force field read\n" );
 #endif
-  
+
   return SUCCESS;
 }
diff --git a/src/USER-REAXC/reaxc_ffield.h b/src/USER-REAXC/reaxc_ffield.h
index b4632b6379..6ccc94d7d0 100644
--- a/src/USER-REAXC/reaxc_ffield.h
+++ b/src/USER-REAXC/reaxc_ffield.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
diff --git a/src/USER-REAXC/reaxc_forces.cpp b/src/USER-REAXC/reaxc_forces.cpp
index fa20fba109..578f25e895 100644
--- a/src/USER-REAXC/reaxc_forces.cpp
+++ b/src/USER-REAXC/reaxc_forces.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -60,15 +60,15 @@
 
 interaction_function Interaction_Functions[NUM_INTRS];
 
-void Dummy_Interaction( reax_system *system, control_params *control, 
-			simulation_data *data, storage *workspace, 
-			reax_list **lists, output_controls *out_control )
+void Dummy_Interaction( reax_system *system, control_params *control,
+                        simulation_data *data, storage *workspace,
+                        reax_list **lists, output_controls *out_control )
 {
 }
 
 
 void Init_Force_Functions( control_params *control )
-{ 
+{
   Interaction_Functions[0] = BO;
   Interaction_Functions[1] = Bonds; //Dummy_Interaction;
   Interaction_Functions[2] = Atom_Energy; //Dummy_Interaction;
@@ -84,17 +84,17 @@ void Init_Force_Functions( control_params *control )
 }
 
 
-void Compute_Bonded_Forces( reax_system *system, control_params *control, 
-			    simulation_data *data, storage *workspace, 
-			    reax_list **lists, output_controls *out_control,
-			    MPI_Comm comm )
+void Compute_Bonded_Forces( reax_system *system, control_params *control,
+                            simulation_data *data, storage *workspace,
+                            reax_list **lists, output_controls *out_control,
+                            MPI_Comm comm )
 {
   int i;
 
   /* Mark beginning of a new timestep in bonded energy files */
 #if defined(TEST_ENERGY)
   Debug_Marker_Bonded( out_control, data->step );
-#endif 
+#endif
 
   /* Implement all force calls as function pointers */
   for( i = 0; i < NUM_INTRS; i++ ) {
@@ -102,8 +102,8 @@ void Compute_Bonded_Forces( reax_system *system, control_params *control,
     fprintf( stderr, "p%d: starting f%d\n", system->my_rank, i );
     MPI_Barrier( comm );
 #endif
-    (Interaction_Functions[i])( system, control, data, workspace, 
-				lists, out_control );
+    (Interaction_Functions[i])( system, control, data, workspace,
+                                lists, out_control );
 #if defined(DEBUG)
     fprintf( stderr, "p%d: f%d done\n", system->my_rank, i );
     MPI_Barrier( comm );
@@ -112,10 +112,10 @@ void Compute_Bonded_Forces( reax_system *system, control_params *control,
 }
 
 
-void Compute_NonBonded_Forces( reax_system *system, control_params *control, 
-			       simulation_data *data, storage *workspace, 
-			       reax_list **lists, output_controls *out_control,
-			       MPI_Comm comm )
+void Compute_NonBonded_Forces( reax_system *system, control_params *control,
+                               simulation_data *data, storage *workspace,
+                               reax_list **lists, output_controls *out_control,
+                               MPI_Comm comm )
 {
   /* Mark beginning of a new timestep in nonbonded energy files */
 #if defined(TEST_ENERGY)
@@ -124,12 +124,12 @@ void Compute_NonBonded_Forces( reax_system *system, control_params *control,
 
   /* van der Waals and Coulomb interactions */
   if( control->tabulate == 0 )
-    vdW_Coulomb_Energy( system, control, data, workspace, 
-			lists, out_control );
+    vdW_Coulomb_Energy( system, control, data, workspace,
+                        lists, out_control );
   else
-    Tabulated_vdW_Coulomb_Energy( system, control, data, workspace, 
-				  lists, out_control );
-  
+    Tabulated_vdW_Coulomb_Energy( system, control, data, workspace,
+                                  lists, out_control );
+
 #if defined(DEBUG)
   fprintf( stderr, "p%d: nonbonded forces done\n", system->my_rank );
   MPI_Barrier( comm );
@@ -138,12 +138,12 @@ void Compute_NonBonded_Forces( reax_system *system, control_params *control,
 
 
 
-/* this version of Compute_Total_Force computes forces from 
-   coefficients accumulated by all interaction functions. 
+/* this version of Compute_Total_Force computes forces from
+   coefficients accumulated by all interaction functions.
    Saves enormous time & space! */
-void Compute_Total_Force( reax_system *system, control_params *control, 
-			  simulation_data *data, storage *workspace, 
-			  reax_list **lists, mpi_datatypes *mpi_data )
+void Compute_Total_Force( reax_system *system, control_params *control,
+                          simulation_data *data, storage *workspace,
+                          reax_list **lists, mpi_datatypes *mpi_data )
 {
   int i, pj;
   reax_list *bonds = (*lists) + BONDS;
@@ -151,20 +151,20 @@ void Compute_Total_Force( reax_system *system, control_params *control,
   for( i = 0; i < system->N; ++i )
     for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj )
       if( i < bonds->select.bond_list[pj].nbr ) {
-	if( control->virial == 0 )
-	  Add_dBond_to_Forces( system, i, pj, workspace, lists );
-	else 
-	  Add_dBond_to_Forces_NPT( i, pj, data, workspace, lists );
+        if( control->virial == 0 )
+          Add_dBond_to_Forces( system, i, pj, workspace, lists );
+        else
+          Add_dBond_to_Forces_NPT( i, pj, data, workspace, lists );
       }
 
   //Print_Total_Force( system, data, workspace );
 #if defined(PURE_REAX)
-  /* now all forces are computed to their partially-final values 
-     based on the neighbors information each processor has had. 
+  /* now all forces are computed to their partially-final values
+     based on the neighbors information each processor has had.
      final values of force on each atom needs to be computed by adding up
      all partially-final pieces */
-  Coll( system, mpi_data, workspace->f, mpi_data->mpi_rvec, 
-	sizeof(rvec)/sizeof(void), rvec_unpacker );
+  Coll( system, mpi_data, workspace->f, mpi_data->mpi_rvec,
+        sizeof(rvec)/sizeof(void), rvec_unpacker );
   for( i = 0; i < system->n; ++i )
     rvec_Copy( system->my_atoms[i].f, workspace->f[i] );
 
@@ -187,7 +187,7 @@ void Compute_Total_Force( reax_system *system, control_params *control,
 }
 
 void Validate_Lists( reax_system *system, storage *workspace, reax_list **lists,
-		     int step, int n, int N, int numH, MPI_Comm comm )
+                     int step, int n, int N, int numH, MPI_Comm comm )
 {
   int i, comp, Hindex;
   reax_list *bonds, *hbonds;
@@ -197,22 +197,22 @@ void Validate_Lists( reax_system *system, storage *workspace, reax_list **lists,
   /* bond list */
   if( N > 0 ) {
     bonds = *lists + BONDS;
-    
+
     for( i = 0; i < N; ++i ) {
       // if( i < n ) - we need to update ghost estimates for delayed nbrings
       system->my_atoms[i].num_bonds = MAX(Num_Entries(i,bonds)*2, MIN_BONDS);
-     
+
       //if( End_Index(i, bonds) >= Start_Index(i+1, bonds)-2 )
       //workspace->realloc.bonds = 1;
-      
+
       if( i < N-1 )
-	comp = Start_Index(i+1, bonds);
+        comp = Start_Index(i+1, bonds);
       else comp = bonds->num_intrs;
-      
+
       if( End_Index(i, bonds) > comp ) {
-	fprintf( stderr, "step%d-bondchk failed: i=%d end(i)=%d str(i+1)=%d\n",
-		 step, i, End_Index(i,bonds), comp );
-	MPI_Abort( comm, INSUFFICIENT_MEMORY );
+        fprintf( stderr, "step%d-bondchk failed: i=%d end(i)=%d str(i+1)=%d\n",
+                 step, i, End_Index(i,bonds), comp );
+        MPI_Abort( comm, INSUFFICIENT_MEMORY );
       }
     }
   }
@@ -221,26 +221,26 @@ void Validate_Lists( reax_system *system, storage *workspace, reax_list **lists,
   /* hbonds list */
   if( numH > 0 ) {
     hbonds = *lists + HBONDS;
-    
+
     for( i = 0; i < n; ++i ) {
       Hindex = system->my_atoms[i].Hindex;
       if( Hindex > -1 ) {
-	system->my_atoms[i].num_hbonds = 
-	  (int)(MAX( Num_Entries(Hindex, hbonds)*SAFER_ZONE, MIN_HBONDS ));
-	
-	//if( Num_Entries(i, hbonds) >= 
-	//(Start_Index(i+1,hbonds)-Start_Index(i,hbonds))*0.90/*DANGER_ZONE*/){
-	//  workspace->realloc.hbonds = 1;
-	
-	if( Hindex < numH-1 )
-	  comp = Start_Index(Hindex+1, hbonds);
-	else comp = hbonds->num_intrs;
-	
-	if( End_Index(Hindex, hbonds) > comp ) {
-	  fprintf(stderr,"step%d-hbondchk failed: H=%d end(H)=%d str(H+1)=%d\n",
-		  step, Hindex, End_Index(Hindex,hbonds), comp );
-	  MPI_Abort( comm, INSUFFICIENT_MEMORY );
-	}
+        system->my_atoms[i].num_hbonds =
+          (int)(MAX( Num_Entries(Hindex, hbonds)*SAFER_ZONE, MIN_HBONDS ));
+
+        //if( Num_Entries(i, hbonds) >=
+        //(Start_Index(i+1,hbonds)-Start_Index(i,hbonds))*0.90/*DANGER_ZONE*/){
+        //  workspace->realloc.hbonds = 1;
+
+        if( Hindex < numH-1 )
+          comp = Start_Index(Hindex+1, hbonds);
+        else comp = hbonds->num_intrs;
+
+        if( End_Index(Hindex, hbonds) > comp ) {
+          fprintf(stderr,"step%d-hbondchk failed: H=%d end(H)=%d str(H+1)=%d\n",
+                  step, Hindex, End_Index(Hindex,hbonds), comp );
+          MPI_Abort( comm, INSUFFICIENT_MEMORY );
+        }
       }
     }
   }
@@ -257,8 +257,8 @@ real Compute_H( real r, real gamma, real *ctap )
   taper = taper * r + ctap[3];
   taper = taper * r + ctap[2];
   taper = taper * r + ctap[1];
-  taper = taper * r + ctap[0];	      
-  
+  taper = taper * r + ctap[0];
+
   dr3gamij_1 = ( r*r*r + gamma );
   dr3gamij_3 = pow( dr3gamij_1 , 0.33333333333333 );
   return taper * EV_to_KCALpMOL / dr3gamij_3;
@@ -273,24 +273,24 @@ real Compute_tabH( real r_ij, int ti, int tj )
 
   tmin  = MIN( ti, tj );
   tmax  = MAX( ti, tj );
-  t = &( LR[tmin][tmax] );	  
+  t = &( LR[tmin][tmax] );
 
   /* cubic spline interpolation */
   r = (int)(r_ij * t->inv_dx);
   if( r == 0 )  ++r;
   base = (real)(r+1) * t->dx;
   dif = r_ij - base;
-  val = ((t->ele[r].d*dif + t->ele[r].c)*dif + t->ele[r].b)*dif + 
+  val = ((t->ele[r].d*dif + t->ele[r].c)*dif + t->ele[r].b)*dif +
     t->ele[r].a;
   val *= EV_to_KCALpMOL / C_ele;
-  
+
   return val;
 }
 
 
-void Init_Forces( reax_system *system, control_params *control, 
-		  simulation_data *data, storage *workspace, reax_list **lists,
-		  output_controls *out_control, MPI_Comm comm ) {
+void Init_Forces( reax_system *system, control_params *control,
+                  simulation_data *data, storage *workspace, reax_list **lists,
+                  output_controls *out_control, MPI_Comm comm ) {
   int i, j, pj;
   int start_i, end_i;
   int type_i, type_j;
@@ -323,7 +323,7 @@ void Init_Forces( reax_system *system, control_params *control,
   num_hbonds = 0;
   btop_i = btop_j = 0;
   renbr = (data->step-data->prev_steps) % control->reneighbor == 0;
-  
+
   for( i = 0; i < system->N; ++i ) {
     atom_i = &(system->my_atoms[i]);
     type_i  = atom_i->type;
@@ -331,7 +331,7 @@ void Init_Forces( reax_system *system, control_params *control,
     end_i   = End_Index(i, far_nbrs);
     btop_i = End_Index( i, bonds );
     sbp_i = &(system->reax_param.sbp[type_i]);
-    
+
     if( i < system->n ) {
       local = 1;
       cutoff = control->nonb_cut;
@@ -350,12 +350,12 @@ void Init_Forces( reax_system *system, control_params *control,
       ++Htop;
 
       if( control->hbond_cut > 0 ) {
-	ihb = sbp_i->p_hbond;
-	if( ihb == 1 )
-	  ihb_top = End_Index( atom_i->Hindex, hbonds );
-	else ihb_top = -1;
+        ihb = sbp_i->p_hbond;
+        if( ihb == 1 )
+          ihb_top = End_Index( atom_i->Hindex, hbonds );
+        else ihb_top = -1;
       }
-    } 
+    }
 
     /* update i-j distance - check if j is within cutoff */
     for( pj = start_i; pj < end_i; ++pj ) {
@@ -363,91 +363,91 @@ void Init_Forces( reax_system *system, control_params *control,
       j = nbr_pj->nbr;
       atom_j = &(system->my_atoms[j]);
       //fprintf( stderr, "%d%d i=%d x_i: %f %f %f,j=%d x_j: %f %f %f, d=%f\n",
-      //	 MIN(atom_i->orig_id, atom_j->orig_id), 
-      //	 MAX(atom_i->orig_id, atom_j->orig_id),
-      //	 i, atom_i->x[0], atom_i->x[1], atom_i->x[2], 
-      //	 j, atom_j->x[0], atom_j->x[1], atom_j->x[2], nbr_pj->d );
-      if( renbr ) { 
-	if(nbr_pj->d <= cutoff)
-	  flag = 1;
-	else flag = 0;
+      //         MIN(atom_i->orig_id, atom_j->orig_id),
+      //         MAX(atom_i->orig_id, atom_j->orig_id),
+      //         i, atom_i->x[0], atom_i->x[1], atom_i->x[2],
+      //         j, atom_j->x[0], atom_j->x[1], atom_j->x[2], nbr_pj->d );
+      if( renbr ) {
+        if(nbr_pj->d <= cutoff)
+          flag = 1;
+        else flag = 0;
       }
       else{
-	nbr_pj->dvec[0] = atom_j->x[0] - atom_i->x[0];
-	nbr_pj->dvec[1] = atom_j->x[1] - atom_i->x[1];
-	nbr_pj->dvec[2] = atom_j->x[2] - atom_i->x[2];
-	nbr_pj->d = rvec_Norm_Sqr( nbr_pj->dvec );
-	if( nbr_pj->d <= SQR(cutoff) ) {
-	  nbr_pj->d = sqrt(nbr_pj->d);
-	  flag = 1;
-	}
-	else {
-	  flag = 0;
-	}
+        nbr_pj->dvec[0] = atom_j->x[0] - atom_i->x[0];
+        nbr_pj->dvec[1] = atom_j->x[1] - atom_i->x[1];
+        nbr_pj->dvec[2] = atom_j->x[2] - atom_i->x[2];
+        nbr_pj->d = rvec_Norm_Sqr( nbr_pj->dvec );
+        if( nbr_pj->d <= SQR(cutoff) ) {
+          nbr_pj->d = sqrt(nbr_pj->d);
+          flag = 1;
+        }
+        else {
+          flag = 0;
+        }
       }
-      
-      if( flag ){	
-	type_j = atom_j->type;
-	r_ij = nbr_pj->d;
-	sbp_j = &(system->reax_param.sbp[type_j]);
-	twbp = &(system->reax_param.tbp[type_i][type_j]);
-	
-	if( local ) {
-	  /* H matrix entry */
-	  if( j < system->n || atom_i->orig_id < atom_j->orig_id ) {//tryQEq||1
-	    H->entries[Htop].j = j;
-	    //fprintf( stdout, "%d%d %d %d\n", 
-	    //     MIN(atom_i->orig_id, atom_j->orig_id), 
-	    //     MAX(atom_i->orig_id, atom_j->orig_id), 
-	    //     MIN(atom_i->orig_id, atom_j->orig_id), 
-	    //     MAX(atom_i->orig_id, atom_j->orig_id) ); 
-	    if( control->tabulate == 0 )
-	      H->entries[Htop].val = Compute_H(r_ij,twbp->gamma,workspace->Tap);
-	    else H->entries[Htop].val = Compute_tabH(r_ij, type_i, type_j);
-	    ++Htop;
-	  }
-	
-	  /* hydrogen bond lists */ 
-	  if( control->hbond_cut > 0 && (ihb==1 || ihb==2) && 
-	      nbr_pj->d <= control->hbond_cut ) {
-	    // fprintf( stderr, "%d %d\n", atom1, atom2 );
-	    jhb = sbp_j->p_hbond;
-	    if( ihb == 1 && jhb == 2 ) {
-	      hbonds->select.hbond_list[ihb_top].nbr = j;
-	      hbonds->select.hbond_list[ihb_top].scl = 1;
-	      hbonds->select.hbond_list[ihb_top].ptr = nbr_pj;
-	      ++ihb_top;
-	      ++num_hbonds;
-	    }
-	    else if( j < system->n && ihb == 2 && jhb == 1 ) {
-	      jhb_top = End_Index( atom_j->Hindex, hbonds );
-	      hbonds->select.hbond_list[jhb_top].nbr = i;
-	      hbonds->select.hbond_list[jhb_top].scl = -1;
-	      hbonds->select.hbond_list[jhb_top].ptr = nbr_pj;
-	      Set_End_Index( atom_j->Hindex, jhb_top+1, hbonds );
-	      ++num_hbonds;
-	    }
-	  }
-	}
-	    
-	/* uncorrected bond orders */
-	if( //(workspace->bond_mark[i] < 3 || workspace->bond_mark[j] < 3) &&
-	    nbr_pj->d <= control->bond_cut &&
-	    BOp( workspace, bonds, control->bo_cut, 
-		 i , btop_i, nbr_pj, sbp_i, sbp_j, twbp ) ) {
-	  num_bonds += 2;
-	  ++btop_i;
-
-	  if( workspace->bond_mark[j] > workspace->bond_mark[i] + 1 )
-	    workspace->bond_mark[j] = workspace->bond_mark[i] + 1;
-	  else if( workspace->bond_mark[i] > workspace->bond_mark[j] + 1 ) {
-	    workspace->bond_mark[i] = workspace->bond_mark[j] + 1;
-	    //if( workspace->bond_mark[i] == 1000 )
-	    //  workspace->done_after[i] = pj;
-	  }
-	  //fprintf( stdout, "%d%d - %d(%d) %d(%d)\n", 
-	  //   i , j, i, workspace->bond_mark[i], j, workspace->bond_mark[j] );
-	}
+
+      if( flag ){
+        type_j = atom_j->type;
+        r_ij = nbr_pj->d;
+        sbp_j = &(system->reax_param.sbp[type_j]);
+        twbp = &(system->reax_param.tbp[type_i][type_j]);
+
+        if( local ) {
+          /* H matrix entry */
+          if( j < system->n || atom_i->orig_id < atom_j->orig_id ) {//tryQEq||1
+            H->entries[Htop].j = j;
+            //fprintf( stdout, "%d%d %d %d\n",
+            //     MIN(atom_i->orig_id, atom_j->orig_id),
+            //     MAX(atom_i->orig_id, atom_j->orig_id),
+            //     MIN(atom_i->orig_id, atom_j->orig_id),
+            //     MAX(atom_i->orig_id, atom_j->orig_id) );
+            if( control->tabulate == 0 )
+              H->entries[Htop].val = Compute_H(r_ij,twbp->gamma,workspace->Tap);
+            else H->entries[Htop].val = Compute_tabH(r_ij, type_i, type_j);
+            ++Htop;
+          }
+
+          /* hydrogen bond lists */
+          if( control->hbond_cut > 0 && (ihb==1 || ihb==2) &&
+              nbr_pj->d <= control->hbond_cut ) {
+            // fprintf( stderr, "%d %d\n", atom1, atom2 );
+            jhb = sbp_j->p_hbond;
+            if( ihb == 1 && jhb == 2 ) {
+              hbonds->select.hbond_list[ihb_top].nbr = j;
+              hbonds->select.hbond_list[ihb_top].scl = 1;
+              hbonds->select.hbond_list[ihb_top].ptr = nbr_pj;
+              ++ihb_top;
+              ++num_hbonds;
+            }
+            else if( j < system->n && ihb == 2 && jhb == 1 ) {
+              jhb_top = End_Index( atom_j->Hindex, hbonds );
+              hbonds->select.hbond_list[jhb_top].nbr = i;
+              hbonds->select.hbond_list[jhb_top].scl = -1;
+              hbonds->select.hbond_list[jhb_top].ptr = nbr_pj;
+              Set_End_Index( atom_j->Hindex, jhb_top+1, hbonds );
+              ++num_hbonds;
+            }
+          }
+        }
+
+        /* uncorrected bond orders */
+        if( //(workspace->bond_mark[i] < 3 || workspace->bond_mark[j] < 3) &&
+            nbr_pj->d <= control->bond_cut &&
+            BOp( workspace, bonds, control->bo_cut,
+                 i , btop_i, nbr_pj, sbp_i, sbp_j, twbp ) ) {
+          num_bonds += 2;
+          ++btop_i;
+
+          if( workspace->bond_mark[j] > workspace->bond_mark[i] + 1 )
+            workspace->bond_mark[j] = workspace->bond_mark[i] + 1;
+          else if( workspace->bond_mark[i] > workspace->bond_mark[j] + 1 ) {
+            workspace->bond_mark[i] = workspace->bond_mark[j] + 1;
+            //if( workspace->bond_mark[i] == 1000 )
+            //  workspace->done_after[i] = pj;
+          }
+          //fprintf( stdout, "%d%d - %d(%d) %d(%d)\n",
+          //   i , j, i, workspace->bond_mark[i], j, workspace->bond_mark[j] );
+        }
       }
     }
 
@@ -455,90 +455,90 @@ void Init_Forces( reax_system *system, control_params *control,
     if( local ) {
       H->end[i] = Htop;
       if( ihb == 1 )
-	Set_End_Index( atom_i->Hindex, ihb_top, hbonds );
+        Set_End_Index( atom_i->Hindex, ihb_top, hbonds );
     }
   }
 
   //fprintf( stderr, "after the first init loop\n" );
-  /*for( i = system->n; i < system->N; ++i ) 
+  /*for( i = system->n; i < system->N; ++i )
     if( workspace->bond_mark[i] > 3 ) {
       start_i = Start_Index(i, bonds);
       end_i = End_Index(i, bonds);
       num_bonds -= (end_i - start_i);
-      Set_End_Index(i, start_i, bonds ); 
+      Set_End_Index(i, start_i, bonds );
       }*/
 
   /*for( i = system->n; i < system->N; ++i ) {
     start_i = Start_Index(i, far_nbrs);
     end_i = workspace->done_after[i];
-    
+
     if( workspace->bond_mark[i] >= 2 && start_i < end_i ) {
       atom_i = &(system->my_atoms[i]);
       type_i = atom_i->type;
       btop_i = End_Index( i, bonds );
       sbp_i = &(system->reax_param.sbp[type_i]);
-      
+
       for( pj = start_i; pj < end_i; ++pj ) {
-	nbr_pj = &( far_nbrs->select.far_nbr_list[pj] );
-	j = nbr_pj->nbr;
-	
-	if( workspace->bond_mark[j] >= 2 && nbr_pj->d <= control->bond_cut ) {
-	  atom_j = &(system->my_atoms[j]);
-	  type_j = atom_j->type;
-	  sbp_j = &(system->reax_param.sbp[type_j]);
-	  twbp = &(system->reax_param.tbp[type_i][type_j]);
-	  
-	  if( BOp( workspace, bonds, control->bo_cut, 
-		   i , btop_i, nbr_pj, sbp_i, sbp_j, twbp ) ) {
-	    num_bonds += 2;
-	    ++btop_i;
-
-	    if( workspace->bond_mark[j] > workspace->bond_mark[i] + 1 )
-	      workspace->bond_mark[j] = workspace->bond_mark[i] + 1;
-	    else if( workspace->bond_mark[i] > workspace->bond_mark[j] + 1 )
-	      workspace->bond_mark[i] = workspace->bond_mark[j] + 1;
-
-	    //fprintf( stdout, "%d%d - %d(%d) %d(%d) new\n", 
-	    // i , j, i, workspace->bond_mark[i], j, workspace->bond_mark[j] );
-	  }
-	}
+        nbr_pj = &( far_nbrs->select.far_nbr_list[pj] );
+        j = nbr_pj->nbr;
+
+        if( workspace->bond_mark[j] >= 2 && nbr_pj->d <= control->bond_cut ) {
+          atom_j = &(system->my_atoms[j]);
+          type_j = atom_j->type;
+          sbp_j = &(system->reax_param.sbp[type_j]);
+          twbp = &(system->reax_param.tbp[type_i][type_j]);
+
+          if( BOp( workspace, bonds, control->bo_cut,
+                   i , btop_i, nbr_pj, sbp_i, sbp_j, twbp ) ) {
+            num_bonds += 2;
+            ++btop_i;
+
+            if( workspace->bond_mark[j] > workspace->bond_mark[i] + 1 )
+              workspace->bond_mark[j] = workspace->bond_mark[i] + 1;
+            else if( workspace->bond_mark[i] > workspace->bond_mark[j] + 1 )
+              workspace->bond_mark[i] = workspace->bond_mark[j] + 1;
+
+            //fprintf( stdout, "%d%d - %d(%d) %d(%d) new\n",
+            // i , j, i, workspace->bond_mark[i], j, workspace->bond_mark[j] );
+          }
+        }
       }
       Set_End_Index( i, btop_i, bonds );
     }
     }*/
-  
+
   workspace->realloc.Htop = Htop;
   workspace->realloc.num_bonds = num_bonds;
   workspace->realloc.num_hbonds = num_hbonds;
 
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d @ step%d: Htop = %d num_bonds = %d num_hbonds = %d\n", 
-	   system->my_rank, data->step, Htop, num_bonds, num_hbonds );
+  fprintf( stderr, "p%d @ step%d: Htop = %d num_bonds = %d num_hbonds = %d\n",
+           system->my_rank, data->step, Htop, num_bonds, num_hbonds );
   MPI_Barrier( comm );
 #endif
 #if defined( DEBUG )
-  Print_Bonds( system, bonds, "debugbonds.out" );  
-  Print_Bond_List2( system, bonds, "pbonds.out" );  
+  Print_Bonds( system, bonds, "debugbonds.out" );
+  Print_Bond_List2( system, bonds, "pbonds.out" );
   Print_Sparse_Matrix( system, H );
   for( i = 0; i < H->n; ++i )
     for( j = H->start[i]; j < H->end[i]; ++j )
-      fprintf( stderr, "%d %d %.15e\n", 
-	       MIN(system->my_atoms[i].orig_id, 
-		   system->my_atoms[H->entries[j].j].orig_id),
-	       MAX(system->my_atoms[i].orig_id, 
-		   system->my_atoms[H->entries[j].j].orig_id),
-	       H->entries[j].val );
+      fprintf( stderr, "%d %d %.15e\n",
+               MIN(system->my_atoms[i].orig_id,
+                   system->my_atoms[H->entries[j].j].orig_id),
+               MAX(system->my_atoms[i].orig_id,
+                   system->my_atoms[H->entries[j].j].orig_id),
+               H->entries[j].val );
 #endif
 
-  Validate_Lists( system, workspace, lists, data->step, 
-		  system->n, system->N, system->numH, comm );
+  Validate_Lists( system, workspace, lists, data->step,
+                  system->n, system->N, system->numH, comm );
 }
 
 
-void Init_Forces_noQEq( reax_system *system, control_params *control, 
-			simulation_data *data, storage *workspace, 
-			reax_list **lists, output_controls *out_control, 
-			MPI_Comm comm ) {
+void Init_Forces_noQEq( reax_system *system, control_params *control,
+                        simulation_data *data, storage *workspace,
+                        reax_list **lists, output_controls *out_control,
+                        MPI_Comm comm ) {
   int i, j, pj;
   int start_i, end_i;
   int type_i, type_j;
@@ -567,7 +567,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control,
   num_hbonds = 0;
   btop_i = btop_j = 0;
   renbr = (data->step-data->prev_steps) % control->reneighbor == 0;
-  
+
   for( i = 0; i < system->N; ++i ) {
     atom_i = &(system->my_atoms[i]);
     type_i  = atom_i->type;
@@ -575,7 +575,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control,
     end_i   = End_Index(i, far_nbrs);
     btop_i = End_Index( i, bonds );
     sbp_i = &(system->reax_param.sbp[type_i]);
-    
+
     if( i < system->n ) {
       local = 1;
       cutoff = MAX( control->hbond_cut, control->bond_cut );
@@ -590,7 +590,7 @@ void Init_Forces_noQEq( reax_system *system, control_params *control,
     if( local && control->hbond_cut > 0 ) {
       ihb = sbp_i->p_hbond;
       if( ihb == 1 )
-	ihb_top = End_Index( atom_i->Hindex, hbonds );
+        ihb_top = End_Index( atom_i->Hindex, hbonds );
       else ihb_top = -1;
     }
 
@@ -599,75 +599,75 @@ void Init_Forces_noQEq( reax_system *system, control_params *control,
       nbr_pj = &( far_nbrs->select.far_nbr_list[pj] );
       j = nbr_pj->nbr;
       atom_j = &(system->my_atoms[j]);
-      
-      if( renbr ) { 
-	if( nbr_pj->d <= cutoff )
-	  flag = 1;
-	else flag = 0;
+
+      if( renbr ) {
+        if( nbr_pj->d <= cutoff )
+          flag = 1;
+        else flag = 0;
       }
       else{
-	nbr_pj->dvec[0] = atom_j->x[0] - atom_i->x[0];
-	nbr_pj->dvec[1] = atom_j->x[1] - atom_i->x[1];
-	nbr_pj->dvec[2] = atom_j->x[2] - atom_i->x[2];
-	nbr_pj->d = rvec_Norm_Sqr( nbr_pj->dvec );
-	if( nbr_pj->d <= SQR(cutoff) ) {
-	  nbr_pj->d = sqrt(nbr_pj->d);
-	  flag = 1;
-	}
-	else {
-	  flag = 0;
-	}
+        nbr_pj->dvec[0] = atom_j->x[0] - atom_i->x[0];
+        nbr_pj->dvec[1] = atom_j->x[1] - atom_i->x[1];
+        nbr_pj->dvec[2] = atom_j->x[2] - atom_i->x[2];
+        nbr_pj->d = rvec_Norm_Sqr( nbr_pj->dvec );
+        if( nbr_pj->d <= SQR(cutoff) ) {
+          nbr_pj->d = sqrt(nbr_pj->d);
+          flag = 1;
+        }
+        else {
+          flag = 0;
+        }
       }
-      
+
       if( flag ) {
-	type_j = atom_j->type;
-	r_ij = nbr_pj->d;
-	sbp_j = &(system->reax_param.sbp[type_j]);
-	twbp = &(system->reax_param.tbp[type_i][type_j]);
-	
-	if( local ) {
-	  /* hydrogen bond lists */ 
-	  if( control->hbond_cut > 0 && (ihb==1 || ihb==2) && 
-	      nbr_pj->d <= control->hbond_cut ) {
-	    // fprintf( stderr, "%d %d\n", atom1, atom2 );
-	    jhb = sbp_j->p_hbond;
-	    if( ihb == 1 && jhb == 2 ) {
-	      hbonds->select.hbond_list[ihb_top].nbr = j;
-	      hbonds->select.hbond_list[ihb_top].scl = 1;
-	      hbonds->select.hbond_list[ihb_top].ptr = nbr_pj;
-	      ++ihb_top;
-	      ++num_hbonds;
-	    }
-	    else if( j < system->n && ihb == 2 && jhb == 1 ) {
-	      jhb_top = End_Index( atom_j->Hindex, hbonds );
-	      hbonds->select.hbond_list[jhb_top].nbr = i;
-	      hbonds->select.hbond_list[jhb_top].scl = -1;
-	      hbonds->select.hbond_list[jhb_top].ptr = nbr_pj;
-	      Set_End_Index( atom_j->Hindex, jhb_top+1, hbonds );
-	      ++num_hbonds;
-	    }
-	  }
-	}
-	    
-	
-	/* uncorrected bond orders */
-	if( //(workspace->bond_mark[i] < 3 || workspace->bond_mark[j] < 3) &&
-	    nbr_pj->d <= control->bond_cut &&
-	    BOp( workspace, bonds, control->bo_cut, 
-		 i , btop_i, nbr_pj, sbp_i, sbp_j, twbp ) ) {
-	  num_bonds += 2;
-	  ++btop_i;
-
-	  if( workspace->bond_mark[j] > workspace->bond_mark[i] + 1 )
-	    workspace->bond_mark[j] = workspace->bond_mark[i] + 1;
-	  else if( workspace->bond_mark[i] > workspace->bond_mark[j] + 1 ) {
-	    workspace->bond_mark[i] = workspace->bond_mark[j] + 1;
-	    //if( workspace->bond_mark[i] == 1000 )
-	    //  workspace->done_after[i] = pj;
-	  }
-	  //fprintf( stdout, "%d%d - %d(%d) %d(%d)\n", 
-	  //   i , j, i, workspace->bond_mark[i], j, workspace->bond_mark[j] );
-	}
+        type_j = atom_j->type;
+        r_ij = nbr_pj->d;
+        sbp_j = &(system->reax_param.sbp[type_j]);
+        twbp = &(system->reax_param.tbp[type_i][type_j]);
+
+        if( local ) {
+          /* hydrogen bond lists */
+          if( control->hbond_cut > 0 && (ihb==1 || ihb==2) &&
+              nbr_pj->d <= control->hbond_cut ) {
+            // fprintf( stderr, "%d %d\n", atom1, atom2 );
+            jhb = sbp_j->p_hbond;
+            if( ihb == 1 && jhb == 2 ) {
+              hbonds->select.hbond_list[ihb_top].nbr = j;
+              hbonds->select.hbond_list[ihb_top].scl = 1;
+              hbonds->select.hbond_list[ihb_top].ptr = nbr_pj;
+              ++ihb_top;
+              ++num_hbonds;
+            }
+            else if( j < system->n && ihb == 2 && jhb == 1 ) {
+              jhb_top = End_Index( atom_j->Hindex, hbonds );
+              hbonds->select.hbond_list[jhb_top].nbr = i;
+              hbonds->select.hbond_list[jhb_top].scl = -1;
+              hbonds->select.hbond_list[jhb_top].ptr = nbr_pj;
+              Set_End_Index( atom_j->Hindex, jhb_top+1, hbonds );
+              ++num_hbonds;
+            }
+          }
+        }
+
+
+        /* uncorrected bond orders */
+        if( //(workspace->bond_mark[i] < 3 || workspace->bond_mark[j] < 3) &&
+            nbr_pj->d <= control->bond_cut &&
+            BOp( workspace, bonds, control->bo_cut,
+                 i , btop_i, nbr_pj, sbp_i, sbp_j, twbp ) ) {
+          num_bonds += 2;
+          ++btop_i;
+
+          if( workspace->bond_mark[j] > workspace->bond_mark[i] + 1 )
+            workspace->bond_mark[j] = workspace->bond_mark[i] + 1;
+          else if( workspace->bond_mark[i] > workspace->bond_mark[j] + 1 ) {
+            workspace->bond_mark[i] = workspace->bond_mark[j] + 1;
+            //if( workspace->bond_mark[i] == 1000 )
+            //  workspace->done_after[i] = pj;
+          }
+          //fprintf( stdout, "%d%d - %d(%d) %d(%d)\n",
+          //   i , j, i, workspace->bond_mark[i], j, workspace->bond_mark[j] );
+        }
       }
     }
 
@@ -676,35 +676,35 @@ void Init_Forces_noQEq( reax_system *system, control_params *control,
       Set_End_Index( atom_i->Hindex, ihb_top, hbonds );
   }
 
-  /*for( i = system->n; i < system->N; ++i ) 
+  /*for( i = system->n; i < system->N; ++i )
     if( workspace->bond_mark[i] > 3 ) {
       start_i = Start_Index(i, bonds);
       end_i = End_Index(i, bonds);
       num_bonds -= (end_i - start_i);
-      Set_End_Index(i, start_i, bonds ); 
+      Set_End_Index(i, start_i, bonds );
       }*/
-  
+
   workspace->realloc.num_bonds = num_bonds;
   workspace->realloc.num_hbonds = num_hbonds;
 
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d @ step%d: num_bonds = %d num_hbonds = %d\n", 
-	   system->my_rank, data->step, num_bonds, num_hbonds );
+  fprintf( stderr, "p%d @ step%d: num_bonds = %d num_hbonds = %d\n",
+           system->my_rank, data->step, num_bonds, num_hbonds );
   MPI_Barrier( comm );
 #endif
 #if defined( DEBUG )
-  Print_Bonds( system, bonds, "debugbonds.out" );  
-  Print_Bond_List2( system, bonds, "pbonds.out" );  
+  Print_Bonds( system, bonds, "debugbonds.out" );
+  Print_Bond_List2( system, bonds, "pbonds.out" );
 #endif
 
-  Validate_Lists( system, workspace, lists, data->step, 
-		  system->n, system->N, system->numH, comm );
+  Validate_Lists( system, workspace, lists, data->step,
+                  system->n, system->N, system->numH, comm );
 }
 
 
-void Estimate_Storages( reax_system *system, control_params *control, 
-			reax_list **lists, int *Htop, int *hb_top, 
-			int *bond_top, int *num_3body, MPI_Comm comm ) 
+void Estimate_Storages( reax_system *system, control_params *control,
+                        reax_list **lists, int *Htop, int *hb_top,
+                        int *bond_top, int *num_3body, MPI_Comm comm )
 {
   int i, j, pj;
   int start_i, end_i;
@@ -733,7 +733,7 @@ void Estimate_Storages( reax_system *system, control_params *control,
     start_i = Start_Index(i, far_nbrs);
     end_i   = End_Index(i, far_nbrs);
     sbp_i = &(system->reax_param.sbp[type_i]);
-    
+
     if( i < system->n ) {
       local = 1;
       cutoff = control->nonb_cut;
@@ -745,63 +745,63 @@ void Estimate_Storages( reax_system *system, control_params *control,
       cutoff = control->bond_cut;
       ihb = -1;
     }
-    
+
     for( pj = start_i; pj < end_i; ++pj ) {
       nbr_pj = &( far_nbrs->select.far_nbr_list[pj] );
       j = nbr_pj->nbr;
       atom_j = &(system->my_atoms[j]);
 
       if(nbr_pj->d <= cutoff) {
-	type_j = system->my_atoms[j].type;
-	r_ij = nbr_pj->d;
-	sbp_j = &(system->reax_param.sbp[type_j]);
-	twbp = &(system->reax_param.tbp[type_i][type_j]);
-	
-	if( local ) {
-	  if( j < system->n || atom_i->orig_id < atom_j->orig_id ) //tryQEq ||1
-	    ++(*Htop);
-	
-	  /* hydrogen bond lists */ 
-	  if( control->hbond_cut > 0.1 && (ihb==1 || ihb==2) && 
-	      nbr_pj->d <= control->hbond_cut ) {
-	    jhb = sbp_j->p_hbond;
-	    if( ihb == 1 && jhb == 2 )
-	      ++hb_top[i];
-	    else if( j < system->n && ihb == 2 && jhb == 1 ) 
-	      ++hb_top[j];
-	  }
-	}
-	    
-	/* uncorrected bond orders */
-	if( nbr_pj->d <= control->bond_cut ) {
-	  r2 = SQR(r_ij);
-	  	  
-	  if( sbp_i->r_s > 0.0 && sbp_j->r_s > 0.0) {
-	    C12 = twbp->p_bo1 * pow( r_ij / twbp->r_s, twbp->p_bo2 );
-	    BO_s = (1.0 + control->bo_cut) * exp( C12 );
-	  }
-	  else BO_s = C12 = 0.0;
-	  
-	  if( sbp_i->r_pi > 0.0 && sbp_j->r_pi > 0.0) {
-	    C34 = twbp->p_bo3 * pow( r_ij / twbp->r_p, twbp->p_bo4 );
-	    BO_pi = exp( C34 );
-	  }
-	  else BO_pi = C34 = 0.0;
-	  
-	  if( sbp_i->r_pi_pi > 0.0 && sbp_j->r_pi_pi > 0.0) {
-	    C56 = twbp->p_bo5 * pow( r_ij / twbp->r_pp, twbp->p_bo6 );	
-	    BO_pi2= exp( C56 );
-	  }
-	  else BO_pi2 = C56 = 0.0;
-	  
-	  /* Initially BO values are the uncorrected ones, page 1 */
-	  BO = BO_s + BO_pi + BO_pi2;
-
-	  if( BO >= control->bo_cut ) {
-	    ++bond_top[i];
-	    ++bond_top[j];
-	  }
-	}
+        type_j = system->my_atoms[j].type;
+        r_ij = nbr_pj->d;
+        sbp_j = &(system->reax_param.sbp[type_j]);
+        twbp = &(system->reax_param.tbp[type_i][type_j]);
+
+        if( local ) {
+          if( j < system->n || atom_i->orig_id < atom_j->orig_id ) //tryQEq ||1
+            ++(*Htop);
+
+          /* hydrogen bond lists */
+          if( control->hbond_cut > 0.1 && (ihb==1 || ihb==2) &&
+              nbr_pj->d <= control->hbond_cut ) {
+            jhb = sbp_j->p_hbond;
+            if( ihb == 1 && jhb == 2 )
+              ++hb_top[i];
+            else if( j < system->n && ihb == 2 && jhb == 1 )
+              ++hb_top[j];
+          }
+        }
+
+        /* uncorrected bond orders */
+        if( nbr_pj->d <= control->bond_cut ) {
+          r2 = SQR(r_ij);
+
+          if( sbp_i->r_s > 0.0 && sbp_j->r_s > 0.0) {
+            C12 = twbp->p_bo1 * pow( r_ij / twbp->r_s, twbp->p_bo2 );
+            BO_s = (1.0 + control->bo_cut) * exp( C12 );
+          }
+          else BO_s = C12 = 0.0;
+
+          if( sbp_i->r_pi > 0.0 && sbp_j->r_pi > 0.0) {
+            C34 = twbp->p_bo3 * pow( r_ij / twbp->r_p, twbp->p_bo4 );
+            BO_pi = exp( C34 );
+          }
+          else BO_pi = C34 = 0.0;
+
+          if( sbp_i->r_pi_pi > 0.0 && sbp_j->r_pi_pi > 0.0) {
+            C56 = twbp->p_bo5 * pow( r_ij / twbp->r_pp, twbp->p_bo6 );
+            BO_pi2= exp( C56 );
+          }
+          else BO_pi2 = C56 = 0.0;
+
+          /* Initially BO values are the uncorrected ones, page 1 */
+          BO = BO_s + BO_pi + BO_pi2;
+
+          if( BO >= control->bo_cut ) {
+            ++bond_top[i];
+            ++bond_top[j];
+          }
+        }
       }
     }
   }
@@ -818,17 +818,17 @@ void Estimate_Storages( reax_system *system, control_params *control,
   }
 
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d @ estimate storages: Htop = %d, num_3body = %d\n", 
-	   system->my_rank, *Htop, *num_3body );
+  fprintf( stderr, "p%d @ estimate storages: Htop = %d, num_3body = %d\n",
+           system->my_rank, *Htop, *num_3body );
   MPI_Barrier( comm );
 #endif
 }
 
 
-void Compute_Forces( reax_system *system, control_params *control, 
-		     simulation_data *data, storage *workspace, 
-		     reax_list **lists, output_controls *out_control, 
-		     mpi_datatypes *mpi_data )
+void Compute_Forces( reax_system *system, control_params *control,
+                     simulation_data *data, storage *workspace,
+                     reax_list **lists, output_controls *out_control,
+                     mpi_datatypes *mpi_data )
 {
   MPI_Comm comm;
   int qeq_flag;
@@ -853,8 +853,8 @@ void Compute_Forces( reax_system *system, control_params *control,
   if( qeq_flag )
     Init_Forces( system, control, data, workspace, lists, out_control, comm );
   else
-    Init_Forces_noQEq( system, control, data, workspace, 
-		       lists, out_control, comm );
+    Init_Forces_noQEq( system, control, data, workspace,
+                       lists, out_control, comm );
 
 #if defined(LOG_PERFORMANCE)
   //MPI_Barrier( mpi_data->world );
@@ -864,8 +864,8 @@ void Compute_Forces( reax_system *system, control_params *control,
 
 
   /********* bonded interactions ************/
-  Compute_Bonded_Forces( system, control, data, workspace, 
-			 lists, out_control, mpi_data->world );
+  Compute_Bonded_Forces( system, control, data, workspace,
+                         lists, out_control, mpi_data->world );
 
 #if defined(LOG_PERFORMANCE)
   //MPI_Barrier( mpi_data->world );
@@ -873,8 +873,8 @@ void Compute_Forces( reax_system *system, control_params *control,
     Update_Timing_Info( &t_start, &(data->timing.bonded) );
 #endif
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d @ step%d: completed bonded\n", 
-	   system->my_rank, data->step );
+  fprintf( stderr, "p%d @ step%d: completed bonded\n",
+           system->my_rank, data->step );
   MPI_Barrier( mpi_data->world );
 #endif
 
@@ -886,7 +886,7 @@ void Compute_Forces( reax_system *system, control_params *control,
 
 #if defined(LOG_PERFORMANCE)
   //MPI_Barrier( mpi_data->world );
-  if( system->my_rank == MASTER_NODE ) 
+  if( system->my_rank == MASTER_NODE )
     Update_Timing_Info( &t_start, &(data->timing.qEq) );
 #endif
 #if defined(DEBUG_FOCUS)
@@ -897,8 +897,8 @@ void Compute_Forces( reax_system *system, control_params *control,
 
 
   /********* nonbonded interactions ************/
-  Compute_NonBonded_Forces( system, control, data, workspace, 
-			    lists, out_control, mpi_data->world );
+  Compute_NonBonded_Forces( system, control, data, workspace,
+                            lists, out_control, mpi_data->world );
 
 #if defined(LOG_PERFORMANCE)
   //MPI_Barrier( mpi_data->world );
@@ -906,8 +906,8 @@ void Compute_Forces( reax_system *system, control_params *control,
     Update_Timing_Info( &t_start, &(data->timing.nonb) );
 #endif
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d @ step%d: nonbonded forces completed\n", 
-	   system->my_rank, data->step );
+  fprintf( stderr, "p%d @ step%d: nonbonded forces completed\n",
+           system->my_rank, data->step );
   MPI_Barrier( mpi_data->world );
 #endif
 
@@ -921,14 +921,14 @@ void Compute_Forces( reax_system *system, control_params *control,
     Update_Timing_Info( &t_start, &(data->timing.bonded) );
 #endif
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d @ step%d: total forces computed\n", 
-	   system->my_rank, data->step );
+  fprintf( stderr, "p%d @ step%d: total forces computed\n",
+           system->my_rank, data->step );
   //Print_Total_Force( system, data, workspace );
   MPI_Barrier( mpi_data->world );
 #endif
 
 #if defined(TEST_FORCES)
-  Print_Force_Files( system, control, data, workspace, 
-		     lists, out_control, mpi_data );
+  Print_Force_Files( system, control, data, workspace,
+                     lists, out_control, mpi_data );
 #endif
 }
diff --git a/src/USER-REAXC/reaxc_forces.h b/src/USER-REAXC/reaxc_forces.h
index fe97a7121c..6c839a7023 100644
--- a/src/USER-REAXC/reaxc_forces.h
+++ b/src/USER-REAXC/reaxc_forces.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -33,8 +33,8 @@
 extern interaction_function Interaction_Functions[NUM_INTRS];
 
 void Init_Force_Functions( control_params* );
-void Compute_Forces( reax_system*, control_params*, simulation_data*, 
-		     storage*, reax_list**, output_controls*, mpi_datatypes* );
-void Estimate_Storages( reax_system*, control_params*, reax_list**, 
-			int*, int*, int*, int*, MPI_Comm );
+void Compute_Forces( reax_system*, control_params*, simulation_data*,
+                     storage*, reax_list**, output_controls*, mpi_datatypes* );
+void Estimate_Storages( reax_system*, control_params*, reax_list**,
+                        int*, int*, int*, int*, MPI_Comm );
 #endif
diff --git a/src/USER-REAXC/reaxc_hydrogen_bonds.cpp b/src/USER-REAXC/reaxc_hydrogen_bonds.cpp
index d9d40267b7..12a929d3b8 100644
--- a/src/USER-REAXC/reaxc_hydrogen_bonds.cpp
+++ b/src/USER-REAXC/reaxc_hydrogen_bonds.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -40,9 +40,9 @@
 #endif
 
 
-void Hydrogen_Bonds( reax_system *system, control_params *control, 
-		     simulation_data *data, storage *workspace, 
-		     reax_list **lists, output_controls *out_control )
+void Hydrogen_Bonds( reax_system *system, control_params *control,
+                     simulation_data *data, storage *workspace,
+                     reax_list **lists, output_controls *out_control )
 {
   int  i, j, k, pi, pk;
   int  type_i, type_j, type_k;
@@ -75,7 +75,7 @@ void Hydrogen_Bonds( reax_system *system, control_params *control,
   /* loops below discover the Hydrogen bonds between i-j-k triplets.
      here j is H atom and there has to be some bond between i and j.
      Hydrogen bond is between j and k.
-     so in this function i->X, j->H, k->Z when we map 
+     so in this function i->X, j->H, k->Z when we map
      variables onto the ones in the handout.*/
   for( j = 0; j < system->n; ++j )
     /* j has to be of type H */
@@ -86,157 +86,157 @@ void Hydrogen_Bonds( reax_system *system, control_params *control,
       end_j      = End_Index(j, bonds);
       hb_start_j = Start_Index( system->my_atoms[j].Hindex, hbonds );
       hb_end_j   = End_Index( system->my_atoms[j].Hindex, hbonds );
-      
+
       top = 0;
       for( pi = start_j; pi < end_j; ++pi )  {
-	pbond_ij = &( bond_list[pi] );
-	i = pbond_ij->nbr;
-	bo_ij = &(pbond_ij->bo_data);
-	type_i = system->my_atoms[i].type;
-	
-	if( system->reax_param.sbp[type_i].p_hbond == 2 && 
-	    bo_ij->BO >= HB_THRESHOLD )
-	  hblist[top++] = pi;
+        pbond_ij = &( bond_list[pi] );
+        i = pbond_ij->nbr;
+        bo_ij = &(pbond_ij->bo_data);
+        type_i = system->my_atoms[i].type;
+
+        if( system->reax_param.sbp[type_i].p_hbond == 2 &&
+            bo_ij->BO >= HB_THRESHOLD )
+          hblist[top++] = pi;
       }
-      
-      // fprintf( stderr, "j: %d, top: %d, hb_start_j: %d, hb_end_j:%d\n", 
+
+      // fprintf( stderr, "j: %d, top: %d, hb_start_j: %d, hb_end_j:%d\n",
       //          j, top, hb_start_j, hb_end_j );
-      
+
       for( pk = hb_start_j; pk < hb_end_j; ++pk ) {
-	/* set k's varibles */
-	k = hbond_list[pk].nbr;
-	type_k = system->my_atoms[k].type;
-	nbr_jk = hbond_list[pk].ptr;
-	r_jk = nbr_jk->d;
-	rvec_Scale( dvec_jk, hbond_list[pk].scl, nbr_jk->dvec );
-	    
-	for( itr = 0; itr < top; ++itr ) {
-	  pi = hblist[itr];
-	  pbond_ij = &( bonds->select.bond_list[pi] );
-	  i = pbond_ij->nbr;
-			  
-	  if( system->my_atoms[i].orig_id != system->my_atoms[k].orig_id ) {
-	    bo_ij = &(pbond_ij->bo_data);
-	    type_i = system->my_atoms[i].type;
-	    r_ij = pbond_ij->d;	     
-	    hbp = &(system->reax_param.hbp[ type_i ][ type_j ][ type_k ]);
-	    ++num_hb_intrs;
-
-	    Calculate_Theta( pbond_ij->dvec, pbond_ij->d, dvec_jk, r_jk,
-			     &theta, &cos_theta );
-	    /* the derivative of cos(theta) */
-	    Calculate_dCos_Theta( pbond_ij->dvec, pbond_ij->d, dvec_jk, r_jk,
-				  &dcos_theta_di, &dcos_theta_dj, 
-				  &dcos_theta_dk );
-		    
-	    /* hyrogen bond energy*/
-	    sin_theta2 = sin( theta/2.0 );
-	    sin_xhz4 = SQR(sin_theta2);
-	    sin_xhz4 *= sin_xhz4;
-	    cos_xhz1 = ( 1.0 - cos_theta );
-	    exp_hb2 = exp( -hbp->p_hb2 * bo_ij->BO );
-	    exp_hb3 = exp( -hbp->p_hb3 * ( hbp->r0_hb / r_jk + 
-					   r_jk / hbp->r0_hb - 2.0 ) );
-	    
-	    data->my_en.e_hb += e_hb = 
-	      hbp->p_hb1 * (1.0 - exp_hb2) * exp_hb3 * sin_xhz4;
-	    
-	    CEhb1 = hbp->p_hb1 * hbp->p_hb2 * exp_hb2 * exp_hb3 * sin_xhz4;
-	    CEhb2 = -hbp->p_hb1/2.0 * (1.0 - exp_hb2) * exp_hb3 * cos_xhz1;
-	    CEhb3 = -hbp->p_hb3 * 
-	      (-hbp->r0_hb / SQR(r_jk) + 1.0 / hbp->r0_hb) * e_hb;
-
-	    /*fprintf( stdout, 
-	      "%6d%6d%6d%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f\n",
-	      system->my_atoms[i].orig_id, system->my_atoms[j].orig_id, 
-	      system->my_atoms[k].orig_id, 
-	      r_jk, theta, hbp->p_hb1, exp_hb2, hbp->p_hb3, hbp->r0_hb, 
-	      exp_hb3, sin_xhz4, e_hb ); */
-	    
-	    /* hydrogen bond forces */
-	    bo_ij->Cdbo += CEhb1; // dbo term
-
-	    if( control->virial == 0 ) {
-	      // dcos terms
-	      rvec_ScaledAdd( workspace->f[i], +CEhb2, dcos_theta_di ); 
-	      rvec_ScaledAdd( workspace->f[j], +CEhb2, dcos_theta_dj );
-	      rvec_ScaledAdd( workspace->f[k], +CEhb2, dcos_theta_dk );
-	      // dr terms
-	      rvec_ScaledAdd( workspace->f[j], -CEhb3/r_jk, dvec_jk ); 
-	      rvec_ScaledAdd( workspace->f[k], +CEhb3/r_jk, dvec_jk );
-	    }
-	    else {
-	      /* for pressure coupling, terms that are not related to bond order
-		 derivatives are added directly into pressure vector/tensor */
-	      rvec_Scale( force, +CEhb2, dcos_theta_di ); // dcos terms
-	      rvec_Add( workspace->f[i], force );
-	      rvec_iMultiply( ext_press, pbond_ij->rel_box, force );
-	      rvec_ScaledAdd( data->my_ext_press, 1.0, ext_press );
-
-	      rvec_ScaledAdd( workspace->f[j], +CEhb2, dcos_theta_dj );
-	      
-	      ivec_Scale( rel_jk, hbond_list[pk].scl, nbr_jk->rel_box );
-	      rvec_Scale( force, +CEhb2, dcos_theta_dk );
-	      rvec_Add( workspace->f[k], force );
-	      rvec_iMultiply( ext_press, rel_jk, force );
-	      rvec_ScaledAdd( data->my_ext_press, 1.0, ext_press );
-	      // dr terms
-	      rvec_ScaledAdd( workspace->f[j], -CEhb3/r_jk, dvec_jk ); 
-
-	      rvec_Scale( force, CEhb3/r_jk, dvec_jk );
-	      rvec_Add( workspace->f[k], force );
-	      rvec_iMultiply( ext_press, rel_jk, force );
-	      rvec_ScaledAdd( data->my_ext_press, 1.0, ext_press );
-	    }
-
-	    /* tally into per-atom virials */
-	    if (system->pair_ptr->vflag_atom || system->pair_ptr->evflag) {
-	      rvec_ScaledSum( delij, 1., system->my_atoms[i].x,
-				    -1., system->my_atoms[j].x );
-	      rvec_ScaledSum( delkj, 1., system->my_atoms[k].x,
-	 			    -1., system->my_atoms[j].x );
-
-	      rvec_Scale(fi_tmp, CEhb2, dcos_theta_di);
-	      rvec_Scale(fk_tmp, CEhb2, dcos_theta_dk);
-	      rvec_ScaledAdd(fk_tmp, CEhb3/r_jk, dvec_jk);
+        /* set k's varibles */
+        k = hbond_list[pk].nbr;
+        type_k = system->my_atoms[k].type;
+        nbr_jk = hbond_list[pk].ptr;
+        r_jk = nbr_jk->d;
+        rvec_Scale( dvec_jk, hbond_list[pk].scl, nbr_jk->dvec );
+
+        for( itr = 0; itr < top; ++itr ) {
+          pi = hblist[itr];
+          pbond_ij = &( bonds->select.bond_list[pi] );
+          i = pbond_ij->nbr;
+
+          if( system->my_atoms[i].orig_id != system->my_atoms[k].orig_id ) {
+            bo_ij = &(pbond_ij->bo_data);
+            type_i = system->my_atoms[i].type;
+            r_ij = pbond_ij->d;
+            hbp = &(system->reax_param.hbp[ type_i ][ type_j ][ type_k ]);
+            ++num_hb_intrs;
+
+            Calculate_Theta( pbond_ij->dvec, pbond_ij->d, dvec_jk, r_jk,
+                             &theta, &cos_theta );
+            /* the derivative of cos(theta) */
+            Calculate_dCos_Theta( pbond_ij->dvec, pbond_ij->d, dvec_jk, r_jk,
+                                  &dcos_theta_di, &dcos_theta_dj,
+                                  &dcos_theta_dk );
+
+            /* hyrogen bond energy*/
+            sin_theta2 = sin( theta/2.0 );
+            sin_xhz4 = SQR(sin_theta2);
+            sin_xhz4 *= sin_xhz4;
+            cos_xhz1 = ( 1.0 - cos_theta );
+            exp_hb2 = exp( -hbp->p_hb2 * bo_ij->BO );
+            exp_hb3 = exp( -hbp->p_hb3 * ( hbp->r0_hb / r_jk +
+                                           r_jk / hbp->r0_hb - 2.0 ) );
+
+            data->my_en.e_hb += e_hb =
+              hbp->p_hb1 * (1.0 - exp_hb2) * exp_hb3 * sin_xhz4;
+
+            CEhb1 = hbp->p_hb1 * hbp->p_hb2 * exp_hb2 * exp_hb3 * sin_xhz4;
+            CEhb2 = -hbp->p_hb1/2.0 * (1.0 - exp_hb2) * exp_hb3 * cos_xhz1;
+            CEhb3 = -hbp->p_hb3 *
+              (-hbp->r0_hb / SQR(r_jk) + 1.0 / hbp->r0_hb) * e_hb;
+
+            /*fprintf( stdout,
+              "%6d%6d%6d%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f\n",
+              system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+              system->my_atoms[k].orig_id,
+              r_jk, theta, hbp->p_hb1, exp_hb2, hbp->p_hb3, hbp->r0_hb,
+              exp_hb3, sin_xhz4, e_hb ); */
+
+            /* hydrogen bond forces */
+            bo_ij->Cdbo += CEhb1; // dbo term
+
+            if( control->virial == 0 ) {
+              // dcos terms
+              rvec_ScaledAdd( workspace->f[i], +CEhb2, dcos_theta_di );
+              rvec_ScaledAdd( workspace->f[j], +CEhb2, dcos_theta_dj );
+              rvec_ScaledAdd( workspace->f[k], +CEhb2, dcos_theta_dk );
+              // dr terms
+              rvec_ScaledAdd( workspace->f[j], -CEhb3/r_jk, dvec_jk );
+              rvec_ScaledAdd( workspace->f[k], +CEhb3/r_jk, dvec_jk );
+            }
+            else {
+              /* for pressure coupling, terms that are not related to bond order
+                 derivatives are added directly into pressure vector/tensor */
+              rvec_Scale( force, +CEhb2, dcos_theta_di ); // dcos terms
+              rvec_Add( workspace->f[i], force );
+              rvec_iMultiply( ext_press, pbond_ij->rel_box, force );
+              rvec_ScaledAdd( data->my_ext_press, 1.0, ext_press );
+
+              rvec_ScaledAdd( workspace->f[j], +CEhb2, dcos_theta_dj );
+
+              ivec_Scale( rel_jk, hbond_list[pk].scl, nbr_jk->rel_box );
+              rvec_Scale( force, +CEhb2, dcos_theta_dk );
+              rvec_Add( workspace->f[k], force );
+              rvec_iMultiply( ext_press, rel_jk, force );
+              rvec_ScaledAdd( data->my_ext_press, 1.0, ext_press );
+              // dr terms
+              rvec_ScaledAdd( workspace->f[j], -CEhb3/r_jk, dvec_jk );
+
+              rvec_Scale( force, CEhb3/r_jk, dvec_jk );
+              rvec_Add( workspace->f[k], force );
+              rvec_iMultiply( ext_press, rel_jk, force );
+              rvec_ScaledAdd( data->my_ext_press, 1.0, ext_press );
+            }
+
+            /* tally into per-atom virials */
+            if (system->pair_ptr->vflag_atom || system->pair_ptr->evflag) {
+              rvec_ScaledSum( delij, 1., system->my_atoms[i].x,
+                                    -1., system->my_atoms[j].x );
+              rvec_ScaledSum( delkj, 1., system->my_atoms[k].x,
+                                     -1., system->my_atoms[j].x );
+
+              rvec_Scale(fi_tmp, CEhb2, dcos_theta_di);
+              rvec_Scale(fk_tmp, CEhb2, dcos_theta_dk);
+              rvec_ScaledAdd(fk_tmp, CEhb3/r_jk, dvec_jk);
 
               system->pair_ptr->ev_tally3(i,j,k,e_hb,0.0,fi_tmp,fk_tmp,delij,delkj);
-	    }
+            }
 
 #ifdef TEST_ENERGY
-	    /* fprintf( out_control->ehb, 
-	       "%24.15e%24.15e%24.15e\n%24.15e%24.15e%24.15e\n%24.15e%24.15e%24.15e\n",
-	       dcos_theta_di[0], dcos_theta_di[1], dcos_theta_di[2], 
-	       dcos_theta_dj[0], dcos_theta_dj[1], dcos_theta_dj[2], 
-	       dcos_theta_dk[0], dcos_theta_dk[1], dcos_theta_dk[2]);
-	       fprintf( out_control->ehb, "%24.15e%24.15e%24.15e\n",
-	       CEhb1, CEhb2, CEhb3 ); */
-	    fprintf( out_control->ehb, 
-		     //"%6d%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e\n",
-		     "%6d%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f\n",
-		     system->my_atoms[i].orig_id, system->my_atoms[j].orig_id, 
-		     system->my_atoms[k].orig_id, 
-		     r_jk, theta, bo_ij->BO, e_hb, data->my_en.e_hb );       
+            /* fprintf( out_control->ehb,
+               "%24.15e%24.15e%24.15e\n%24.15e%24.15e%24.15e\n%24.15e%24.15e%24.15e\n",
+               dcos_theta_di[0], dcos_theta_di[1], dcos_theta_di[2],
+               dcos_theta_dj[0], dcos_theta_dj[1], dcos_theta_dj[2],
+               dcos_theta_dk[0], dcos_theta_dk[1], dcos_theta_dk[2]);
+               fprintf( out_control->ehb, "%24.15e%24.15e%24.15e\n",
+               CEhb1, CEhb2, CEhb3 ); */
+            fprintf( out_control->ehb,
+                     //"%6d%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e\n",
+                     "%6d%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f\n",
+                     system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+                     system->my_atoms[k].orig_id,
+                     r_jk, theta, bo_ij->BO, e_hb, data->my_en.e_hb );
 #endif
 #ifdef TEST_FORCES
-	    Add_dBO( system, lists, j, pi, +CEhb1, workspace->f_hb ); //dbo term
-	    // dcos terms
-	    rvec_ScaledAdd( workspace->f_hb[i], +CEhb2, dcos_theta_di );
-	    rvec_ScaledAdd( workspace->f_hb[j], +CEhb2, dcos_theta_dj );
-	    rvec_ScaledAdd( workspace->f_hb[k], +CEhb2, dcos_theta_dk );
-	    // dr terms
-	    rvec_ScaledAdd( workspace->f_hb[j], -CEhb3/r_jk, dvec_jk ); 
-	    rvec_ScaledAdd( workspace->f_hb[k], +CEhb3/r_jk, dvec_jk );
+            Add_dBO( system, lists, j, pi, +CEhb1, workspace->f_hb ); //dbo term
+            // dcos terms
+            rvec_ScaledAdd( workspace->f_hb[i], +CEhb2, dcos_theta_di );
+            rvec_ScaledAdd( workspace->f_hb[j], +CEhb2, dcos_theta_dj );
+            rvec_ScaledAdd( workspace->f_hb[k], +CEhb2, dcos_theta_dk );
+            // dr terms
+            rvec_ScaledAdd( workspace->f_hb[j], -CEhb3/r_jk, dvec_jk );
+            rvec_ScaledAdd( workspace->f_hb[k], +CEhb3/r_jk, dvec_jk );
 #endif
-	  }
-	}
+          }
+        }
       }
     }
 
 #if defined(DEBUG)
   fprintf( stderr, "Number of hydrogen bonds: %d\n", num_hb_intrs );
   fprintf( stderr, "Hydrogen Bond Energy: %g\n", data->my_en.e_hb );
-  fprintf( stderr, "hydbonds: ext_press (%24.15e %24.15e %24.15e)\n", 
-	   data->ext_press[0], data->ext_press[1], data->ext_press[2] );
+  fprintf( stderr, "hydbonds: ext_press (%24.15e %24.15e %24.15e)\n",
+           data->ext_press[0], data->ext_press[1], data->ext_press[2] );
 #endif
 }
diff --git a/src/USER-REAXC/reaxc_hydrogen_bonds.h b/src/USER-REAXC/reaxc_hydrogen_bonds.h
index f25b669440..04d3d26d5c 100644
--- a/src/USER-REAXC/reaxc_hydrogen_bonds.h
+++ b/src/USER-REAXC/reaxc_hydrogen_bonds.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -30,6 +30,6 @@
 #include "reaxc_types.h"
 
 void Hydrogen_Bonds( reax_system*, control_params*, simulation_data*,
-		     storage*, reax_list**, output_controls* );
+                     storage*, reax_list**, output_controls* );
 
 #endif
diff --git a/src/USER-REAXC/reaxc_init_md.cpp b/src/USER-REAXC/reaxc_init_md.cpp
index 55d0f14348..14e0a575ad 100644
--- a/src/USER-REAXC/reaxc_init_md.cpp
+++ b/src/USER-REAXC/reaxc_init_md.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -58,13 +58,13 @@
 
 #if defined(PURE_REAX)
 /************************ initialize system ************************/
-int Reposition_Atoms( reax_system *system, control_params *control, 
-		      simulation_data *data, mpi_datatypes *mpi_data, 
-		      char *msg )
+int Reposition_Atoms( reax_system *system, control_params *control,
+                      simulation_data *data, mpi_datatypes *mpi_data,
+                      char *msg )
 {
   int   i;
   rvec  dx;
-  
+
   /* reposition atoms */
   if( control->reposition_atoms == 0 ) { //fit atoms to periodic box
     rvec_MakeZero( dx );
@@ -80,7 +80,7 @@ int Reposition_Atoms( reax_system *system, control_params *control,
     strcpy( msg, "reposition_atoms: invalid option" );
     return FAILURE;
   }
-  
+
   for( i = 0; i < system->n; ++i )
     // Inc_on_T3_Gen( system->my_atoms[i].x, dx, &(system->big_box) );
     rvec_Add( system->my_atoms[i].x, dx );
@@ -94,47 +94,47 @@ void Generate_Initial_Velocities( reax_system *system, real T )
 {
   int i;
   real m, scale, norm;
-  
-  
+
+
   if( T <= 0.1 ) {
     for( i = 0; i < system->n; i++ )
       rvec_MakeZero( system->my_atoms[i].v );
   }
   else {
     Randomize();
-    
+
     for( i = 0; i < system->n; i++ ) {
       rvec_Random( system->my_atoms[i].v );
-      
+
       norm = rvec_Norm_Sqr( system->my_atoms[i].v );
       m = system->reax_param.sbp[ system->my_atoms[i].type ].mass;
       scale = sqrt( m * norm / (3.0 * K_B * T) );
-      
+
       rvec_Scale( system->my_atoms[i].v, 1./scale, system->my_atoms[i].v );
-      
-      // fprintf( stderr, "v = %f %f %f\n", 
-      // system->my_atoms[i].v[0], 
-      // system->my_atoms[i].v[1], 
-      // system->my_atoms[i].v[2] );      
-      
+
+      // fprintf( stderr, "v = %f %f %f\n",
+      // system->my_atoms[i].v[0],
+      // system->my_atoms[i].v[1],
+      // system->my_atoms[i].v[2] );
+
       // fprintf( stderr, "scale = %f\n", scale );
-      // fprintf( stderr, "v = %f %f %f\n", 
-      // system->my_atoms[i].v[0], 
-      // system->my_atoms[i].v[1], 
+      // fprintf( stderr, "v = %f %f %f\n",
+      // system->my_atoms[i].v[0],
+      // system->my_atoms[i].v[1],
       // system->my_atoms[i].v[2] );
     }
   }
 }
 
 
-int Init_System( reax_system *system, control_params *control, 
-		 simulation_data *data, storage *workspace, 
-		 mpi_datatypes *mpi_data, char *msg )
+int Init_System( reax_system *system, control_params *control,
+                 simulation_data *data, storage *workspace,
+                 mpi_datatypes *mpi_data, char *msg )
 {
   int i;
   reax_atom *atom;
   int nrecv[MAX_NBRS];
-  
+
   Setup_New_Grid( system, control, mpi_data->world );
 #if defined(DEBUG_FOCUS)
   fprintf( stderr, "p%d GRID:\n", system->my_rank );
@@ -147,7 +147,7 @@ int Init_System( reax_system *system, control_params *control,
   for( i = 0; i < MAX_NBRS; ++i ) nrecv[i] = 0;
   system->max_recved = 0;
   system->N = SendRecv( system, mpi_data, mpi_data->boundary_atom_type, nrecv,
-			Estimate_Boundary_Atoms, Unpack_Estimate_Message, 1 );
+                        Estimate_Boundary_Atoms, Unpack_Estimate_Message, 1 );
   system->total_cap = MAX( (int)(system->N * SAFE_ZONE), MIN_CAP );
   Bin_Boundary_Atoms( system );
 
@@ -157,44 +157,44 @@ int Init_System( reax_system *system, control_params *control,
     for( i = 0; i < system->n; ++i ) {
       atom = &(system->my_atoms[i]);
       if( system->reax_param.sbp[ atom->type ].p_hbond == 1 )
-	atom->Hindex = system->numH++;
+        atom->Hindex = system->numH++;
       else atom->Hindex = -1;
     }
   system->Hcap = MAX( system->numH * SAFER_ZONE, MIN_CAP );
 
-  //Allocate_System( system, system->local_cap, system->total_cap, msg ); 
+  //Allocate_System( system, system->local_cap, system->total_cap, msg );
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d: n=%d local_cap=%d\n", 
-	   system->my_rank, system->n, system->local_cap );
-  fprintf( stderr, "p%d: N=%d total_cap=%d\n", 
-	   system->my_rank, system->N, system->total_cap );
-  fprintf( stderr, "p%d: numH=%d H_cap=%d\n", 
-	   system->my_rank, system->numH, system->Hcap );
-#endif
- 
+  fprintf( stderr, "p%d: n=%d local_cap=%d\n",
+           system->my_rank, system->n, system->local_cap );
+  fprintf( stderr, "p%d: N=%d total_cap=%d\n",
+           system->my_rank, system->N, system->total_cap );
+  fprintf( stderr, "p%d: numH=%d H_cap=%d\n",
+           system->my_rank, system->numH, system->Hcap );
+#endif
+
   // if( Reposition_Atoms( system, control, data, mpi_data, msg ) == FAILURE )
   //   return FAILURE;
-  
+
   /* initialize velocities so that desired init T can be attained */
-  if( !control->restart || (control->restart && control->random_vel) )  
+  if( !control->restart || (control->restart && control->random_vel) )
     Generate_Initial_Velocities( system, control->T_init );
-  
+
   return SUCCESS;
 }
 
 
 /************************ initialize simulation data ************************/
-int Init_Simulation_Data( reax_system *system, control_params *control, 
-			  simulation_data *data, mpi_datatypes *mpi_data, 
-			  char *msg )
+int Init_Simulation_Data( reax_system *system, control_params *control,
+                          simulation_data *data, mpi_datatypes *mpi_data,
+                          char *msg )
 {
   Reset_Simulation_Data( data, control->virial );
 
-  if( !control->restart )  
+  if( !control->restart )
     data->step = data->prev_steps = 0;
 
   Compute_Total_Mass( system, data, mpi_data->comm_mesh3D );
-  Compute_Center_of_Mass( system, data, mpi_data, mpi_data->comm_mesh3D );    
+  Compute_Center_of_Mass( system, data, mpi_data, mpi_data->comm_mesh3D );
   Compute_Kinetic_Energy( system, data, mpi_data->comm_mesh3D );
 
   switch( control->ensemble ){
@@ -202,62 +202,62 @@ int Init_Simulation_Data( reax_system *system, control_params *control,
     data->N_f = 3 * system->bigN;
     Evolve = Velocity_Verlet_NVE;
     break;
-  
+
   case bNVT:
     data->N_f = 3 * system->bigN + 1;
     Evolve = Velocity_Verlet_Berendsen_NVT;
     break;
-  
+
   case nhNVT:
     fprintf( stderr, "WARNING: Nose-Hoover NVT is still under testing.\n" );
     //return FAILURE;
-    data->N_f = 3 * system->bigN + 1;      
+    data->N_f = 3 * system->bigN + 1;
     Evolve = Velocity_Verlet_Nose_Hoover_NVT_Klein;
     if( !control->restart || (control->restart && control->random_vel) ) {
-      data->therm.G_xi = control->Tau_T * 
-	(2.0 * data->sys_en.e_kin - data->N_f * K_B * control->T );
+      data->therm.G_xi = control->Tau_T *
+        (2.0 * data->sys_en.e_kin - data->N_f * K_B * control->T );
       data->therm.v_xi = data->therm.G_xi * control->dt;
       data->therm.v_xi_old = 0;
       data->therm.xi = 0;
     }
     break;
-        
+
   case sNPT: /* Semi-Isotropic NPT */
     data->N_f = 3 * system->bigN + 4;
     Evolve = Velocity_Verlet_Berendsen_NPT;
     if( !control->restart )
       Reset_Pressures( data );
     break;
-    
+
   case iNPT: /* Isotropic NPT */
     data->N_f = 3 * system->bigN + 2;
     Evolve = Velocity_Verlet_Berendsen_NPT;
     if( !control->restart )
       Reset_Pressures( data );
     break;
-  
+
   case NPT: /* Anisotropic NPT */
     strcpy( msg, "init_simulation_data: option not yet implemented" );
     return FAILURE;
-    
+
     data->N_f = 3 * system->bigN + 9;
     Evolve = Velocity_Verlet_Berendsen_NPT;
     /*if( !control->restart ) {
-      data->therm.G_xi = control->Tau_T * 
+      data->therm.G_xi = control->Tau_T *
       (2.0 * data->my_en.e_Kin - data->N_f * K_B * control->T );
       data->therm.v_xi = data->therm.G_xi * control->dt;
       data->iso_bar.eps = 0.33333 * log(system->box.volume);
-      data->inv_W = 1.0 / 
+      data->inv_W = 1.0 /
       ( data->N_f * K_B * control->T * SQR(control->Tau_P) );
       Compute_Pressure( system, control, data, out_control );
       }*/
     break;
-    
+
   default:
     strcpy( msg, "init_simulation_data: ensemble not recognized" );
     return FAILURE;
   }
-  
+
   /* initialize the timer(s) */
   MPI_Barrier( mpi_data->world );  // wait for everyone to come here
   if( system->my_rank == MASTER_NODE ) {
@@ -266,7 +266,7 @@ int Init_Simulation_Data( reax_system *system, control_params *control,
     Reset_Timing( &data->timing );
 #endif
   }
-  
+
 
 #if defined(DEBUG)
       fprintf( stderr, "data->N_f: %8.3f\n", data->N_f );
@@ -283,33 +283,33 @@ int Init_System( reax_system *system, control_params *control, char *msg )
   /* determine the local and total capacity */
   system->local_cap = MAX( (int)(system->n * SAFE_ZONE), MIN_CAP );
   system->total_cap = MAX( (int)(system->N * SAFE_ZONE), MIN_CAP );
-  
+
   /* estimate numH and Hcap */
   system->numH = 0;
   if( control->hbond_cut > 0 )
     for( i = 0; i < system->n; ++i ) {
       atom = &(system->my_atoms[i]);
       if( system->reax_param.sbp[ atom->type ].p_hbond == 1 )
-	atom->Hindex = system->numH++;
+        atom->Hindex = system->numH++;
       else atom->Hindex = -1;
     }
   system->Hcap = (int)(MAX( system->numH * SAFER_ZONE, MIN_CAP ));
 
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d: n=%d local_cap=%d\n", 
-	   system->my_rank, system->n, system->local_cap );
-  fprintf( stderr, "p%d: N=%d total_cap=%d\n", 
-	   system->my_rank, system->N, system->total_cap );
-  fprintf( stderr, "p%d: numH=%d H_cap=%d\n", 
-	   system->my_rank, system->numH, system->Hcap );
+  fprintf( stderr, "p%d: n=%d local_cap=%d\n",
+           system->my_rank, system->n, system->local_cap );
+  fprintf( stderr, "p%d: N=%d total_cap=%d\n",
+           system->my_rank, system->N, system->total_cap );
+  fprintf( stderr, "p%d: numH=%d H_cap=%d\n",
+           system->my_rank, system->numH, system->Hcap );
 #endif
 
   return SUCCESS;
 }
 
 
-int Init_Simulation_Data( reax_system *system, control_params *control, 
-			  simulation_data *data, char *msg )
+int Init_Simulation_Data( reax_system *system, control_params *control,
+                          simulation_data *data, char *msg )
 {
   Reset_Simulation_Data( data, control->virial );
 
@@ -321,7 +321,7 @@ int Init_Simulation_Data( reax_system *system, control_params *control,
 #endif
   }
 
-  //if( !control->restart )  
+  //if( !control->restart )
   data->step = data->prev_steps = 0;
 
   return SUCCESS;
@@ -343,7 +343,7 @@ void Init_Taper( control_params *control,  storage *workspace, MPI_Comm comm )
 
   if( fabs( swa ) > 0.01 )
     fprintf( stderr, "Warning: non-zero lower Taper-radius cutoff\n" );
-  
+
   if( swb < 0 ) {
     fprintf( stderr, "Negative upper Taper-radius cutoff\n" );
     MPI_Abort( comm,  INVALID_INPUT );
@@ -365,18 +365,18 @@ void Init_Taper( control_params *control,  storage *workspace, MPI_Comm comm )
   workspace->Tap[3] = 140.0 * (swa3*swb + 3.0*swa2*swb2 + swa*swb3 ) / d7;
   workspace->Tap[2] =-210.0 * (swa3*swb2 + swa2*swb3) / d7;
   workspace->Tap[1] = 140.0 * swa3 * swb3 / d7;
-  workspace->Tap[0] = (-35.0*swa3*swb2*swb2 + 21.0*swa2*swb3*swb2 + 
-		     7.0*swa*swb3*swb3 + swb3*swb3*swb ) / d7;
+  workspace->Tap[0] = (-35.0*swa3*swb2*swb2 + 21.0*swa2*swb3*swb2 +
+                     7.0*swa*swb3*swb3 + swb3*swb3*swb ) / d7;
 }
 
 
-int Init_Workspace( reax_system *system, control_params *control, 
-		    storage *workspace, MPI_Comm comm, char *msg )
-{ 
+int Init_Workspace( reax_system *system, control_params *control,
+                    storage *workspace, MPI_Comm comm, char *msg )
+{
   int ret;
-  
-  ret = Allocate_Workspace( system, control, workspace, 
-			    system->local_cap, system->total_cap, comm, msg );
+
+  ret = Allocate_Workspace( system, control, workspace,
+                            system->local_cap, system->total_cap, comm, msg );
   if( ret != SUCCESS )
     return ret;
 
@@ -391,8 +391,8 @@ int Init_Workspace( reax_system *system, control_params *control,
 
 
 /************** setup communication data structures  **************/
-int Init_MPI_Datatypes( reax_system *system, storage *workspace, 
-			mpi_datatypes *mpi_data, MPI_Comm comm, char *msg )
+int Init_MPI_Datatypes( reax_system *system, storage *workspace,
+                        mpi_datatypes *mpi_data, MPI_Comm comm, char *msg )
 {
 #if defined(PURE_REAX)
   int           i, block[11];
@@ -414,7 +414,7 @@ int Init_MPI_Datatypes( reax_system *system, storage *workspace,
   mpi_data->in1_buffer = NULL;
   mpi_data->in2_buffer = NULL;
 
-  /* mpi_atom - [orig_id, imprt_id, type, num_bonds, num_hbonds, name, 
+  /* mpi_atom - [orig_id, imprt_id, type, num_bonds, num_hbonds, name,
                  x, v, f_old, s, t] */
   block[0] = block[1] = block[2] = block[3] = block[4] = 1;
   block[5] = 8;
@@ -431,8 +431,8 @@ int Init_MPI_Datatypes( reax_system *system, storage *workspace,
   MPI_Address( &(sample.v[0]),       disp + 7 );
   MPI_Address( &(sample.f_old[0]),   disp + 8 );
   MPI_Address( &(sample.s[0]),       disp + 9 );
-  MPI_Address( &(sample.t[0]),       disp + 10 ); 
-  
+  MPI_Address( &(sample.t[0]),       disp + 10 );
+
   base = (MPI_Aint)(&(sample));
   for( i = 0; i < 11; ++i ) disp[i] -= base;
 
@@ -446,14 +446,14 @@ int Init_MPI_Datatypes( reax_system *system, storage *workspace,
   /* boundary_atom - [orig_id, imprt_id, type, num_bonds, num_hbonds, x] */
   block[0] = block[1] = block[2] = block[3] = block[4] = 1;
   block[5] = 3;
-  
+
   MPI_Address( &(b_sample.orig_id),    disp + 0 );
   MPI_Address( &(b_sample.imprt_id),   disp + 1 );
   MPI_Address( &(b_sample.type),       disp + 2 );
   MPI_Address( &(b_sample.num_bonds),  disp + 3 );
   MPI_Address( &(b_sample.num_hbonds), disp + 4 );
   MPI_Address( &(b_sample.x[0]),       disp + 5 );
-    
+
   base = (MPI_Aint)(&(b_sample));
   for( i = 0; i < 6; ++i ) disp[i] -= base;
 
@@ -483,20 +483,20 @@ int Init_MPI_Datatypes( reax_system *system, storage *workspace,
 
   /* restart_atom - [orig_id, type, name[8], x, v] */
   block[0] = block[1] = 1 ;
-  block[2] = 8; 
+  block[2] = 8;
   block[3] = block[4] = 3;
-  
+
   MPI_Address( &(r_sample.orig_id),    disp + 0 );
   MPI_Address( &(r_sample.type),       disp + 1 );
   MPI_Address( &(r_sample.name),       disp + 2 );
   MPI_Address( &(r_sample.x[0]),       disp + 3 );
   MPI_Address( &(r_sample.v[0]),       disp + 4 );
-    
+
   base = (MPI_Aint)(&(r_sample));
   for( i = 0; i < 5; ++i ) disp[i] -= base;
 
   type[0] = type[1] = MPI_INT;
-  type[2] = MPI_CHAR; 
+  type[2] = MPI_CHAR;
   type[3] = type[4] = MPI_DOUBLE;
 
   MPI_Type_struct( 5, block, disp, type, &(mpi_data->restart_atom_type) );
@@ -509,44 +509,44 @@ int Init_MPI_Datatypes( reax_system *system, storage *workspace,
 
 /********************** allocate lists *************************/
 #if defined(PURE_REAX)
-int  Init_Lists( reax_system *system, control_params *control, 
-		 simulation_data *data, storage *workspace, reax_list **lists, 
-		 mpi_datatypes *mpi_data, char *msg )
+int  Init_Lists( reax_system *system, control_params *control,
+                 simulation_data *data, storage *workspace, reax_list **lists,
+                 mpi_datatypes *mpi_data, char *msg )
 {
   int i, num_nbrs;
   int total_hbonds, total_bonds, bond_cap, num_3body, cap_3body, Htop;
   int *hb_top, *bond_top;
   MPI_Comm comm;
-  
+
   comm = mpi_data->world;
   //for( i = 0; i < MAX_NBRS; ++i ) nrecv[i] = system->my_nbrs[i].est_recv;
   //system->N = SendRecv( system, mpi_data, mpi_data->boundary_atom_type, nrecv,
-  //		Sort_Boundary_Atoms, Unpack_Exchange_Message, 1 );
+  //                Sort_Boundary_Atoms, Unpack_Exchange_Message, 1 );
   num_nbrs = Estimate_NumNeighbors( system, lists );
-  if(!Make_List( system->total_cap, num_nbrs, TYP_FAR_NEIGHBOR, 
-		 *lists+FAR_NBRS, comm )){
+  if(!Make_List( system->total_cap, num_nbrs, TYP_FAR_NEIGHBOR,
+                 *lists+FAR_NBRS, comm )){
     fprintf(stderr, "Problem in initializing far nbrs list. Terminating!\n");
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
 #if defined(DEBUG_FOCUS)
   fprintf( stderr, "p%d: allocated far_nbrs: num_far=%d, space=%dMB\n",
-	   system->my_rank, num_nbrs, 
-	   (int)(num_nbrs*sizeof(far_neighbor_data)/(1024*1024)) );
+           system->my_rank, num_nbrs,
+           (int)(num_nbrs*sizeof(far_neighbor_data)/(1024*1024)) );
 #endif
 
   Generate_Neighbor_Lists( system, data, workspace, lists );
   bond_top = (int*) calloc( system->total_cap, sizeof(int) );
   hb_top = (int*) calloc( system->local_cap, sizeof(int) );
   Estimate_Storages( system, control, lists,
-		     &Htop, hb_top, bond_top, &num_3body, comm );
-  
+                     &Htop, hb_top, bond_top, &num_3body, comm );
+
   Allocate_Matrix( &(workspace->H), system->local_cap, Htop, comm );
   workspace->L = NULL;
   workspace->U = NULL;
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d: allocated H matrix: Htop=%d, space=%dMB\n", 
-	   system->my_rank, Htop, 
-	   (int)(Htop * sizeof(sparse_matrix_entry) / (1024*1024)) );
+  fprintf( stderr, "p%d: allocated H matrix: Htop=%d, space=%dMB\n",
+           system->my_rank, Htop,
+           (int)(Htop * sizeof(sparse_matrix_entry) / (1024*1024)) );
 #endif
 
   if( control->hbond_cut > 0 ) {
@@ -558,18 +558,18 @@ int  Init_Lists( reax_system *system, control_params *control,
     }
     total_hbonds = MAX( total_hbonds*SAFER_ZONE, MIN_CAP*MIN_HBONDS );
 
-    if( !Make_List( system->Hcap, total_hbonds, TYP_HBOND, 
-		    *lists+HBONDS, comm ) ) {
+    if( !Make_List( system->Hcap, total_hbonds, TYP_HBOND,
+                    *lists+HBONDS, comm ) ) {
       fprintf( stderr, "not enough space for hbonds list. terminating!\n" );
       MPI_Abort( comm, INSUFFICIENT_MEMORY );
-    } 
+    }
 #if defined(DEBUG_FOCUS)
-    fprintf( stderr, "p%d: allocated hbonds: total_hbonds=%d, space=%dMB\n", 
-	     system->my_rank, total_hbonds, 
-	     (int)(total_hbonds*sizeof(hbond_data)/(1024*1024)) );
+    fprintf( stderr, "p%d: allocated hbonds: total_hbonds=%d, space=%dMB\n",
+             system->my_rank, total_hbonds,
+             (int)(total_hbonds*sizeof(hbond_data)/(1024*1024)) );
 #endif
   }
-  
+
   /* bonds list */
   //Allocate_Bond_List( system->N, bond_top, (*lists)+BONDS );
   //num_bonds = bond_top[system->N-1];
@@ -579,48 +579,48 @@ int  Init_Lists( reax_system *system, control_params *control,
     total_bonds += bond_top[i];
   }
   bond_cap = MAX( total_bonds*SAFE_ZONE, MIN_CAP*MIN_BONDS );
-  
-  if( !Make_List( system->total_cap, bond_cap, TYP_BOND, 
-		  *lists+BONDS, comm ) ) {
+
+  if( !Make_List( system->total_cap, bond_cap, TYP_BOND,
+                  *lists+BONDS, comm ) ) {
     fprintf( stderr, "not enough space for bonds list. terminating!\n" );
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d: allocated bonds: total_bonds=%d, space=%dMB\n", 
-	   system->my_rank, bond_cap, 
-	   (int)(bond_cap*sizeof(bond_data)/(1024*1024)) );
+  fprintf( stderr, "p%d: allocated bonds: total_bonds=%d, space=%dMB\n",
+           system->my_rank, bond_cap,
+           (int)(bond_cap*sizeof(bond_data)/(1024*1024)) );
 #endif
 
   /* 3bodies list */
   cap_3body = MAX( num_3body*SAFE_ZONE, MIN_3BODIES );
-  if( !Make_List( bond_cap, cap_3body, TYP_THREE_BODY, 
-		  *lists+THREE_BODIES, comm ) ){
+  if( !Make_List( bond_cap, cap_3body, TYP_THREE_BODY,
+                  *lists+THREE_BODIES, comm ) ){
     fprintf( stderr, "Problem in initializing angles list. Terminating!\n" );
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d: allocated 3-body list: num_3body=%d, space=%dMB\n", 
-	   system->my_rank, cap_3body, 
-	   (int)(cap_3body*sizeof(three_body_interaction_data)/(1024*1024)) );
+  fprintf( stderr, "p%d: allocated 3-body list: num_3body=%d, space=%dMB\n",
+           system->my_rank, cap_3body,
+           (int)(cap_3body*sizeof(three_body_interaction_data)/(1024*1024)) );
 #endif
 
 #if defined(TEST_FORCES)
-  if( !Make_List( system->total_cap, bond_cap*8, TYP_DDELTA, 
-		  *lists+DDELTAS, comm ) ) {
+  if( !Make_List( system->total_cap, bond_cap*8, TYP_DDELTA,
+                  *lists+DDELTAS, comm ) ) {
     fprintf( stderr, "Problem in initializing dDelta list. Terminating!\n" );
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
-  fprintf( stderr, "p%d: allocated dDelta list: num_ddelta=%d space=%ldMB\n", 
-	   system->my_rank, bond_cap*30, 
-	   bond_cap*8*sizeof(dDelta_data)/(1024*1024) );
+  fprintf( stderr, "p%d: allocated dDelta list: num_ddelta=%d space=%ldMB\n",
+           system->my_rank, bond_cap*30,
+           bond_cap*8*sizeof(dDelta_data)/(1024*1024) );
 
   if( !Make_List( bond_cap, bond_cap*50, TYP_DBO, *lists+DBOS, comm ) ) {
     fprintf( stderr, "Problem in initializing dBO list. Terminating!\n" );
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
-  fprintf( stderr, "p%d: allocated dbond list: num_dbonds=%d space=%ldMB\n", 
-	   system->my_rank, bond_cap*MAX_BONDS*3, 
-	   bond_cap*MAX_BONDS*3*sizeof(dbond_data)/(1024*1024) );
+  fprintf( stderr, "p%d: allocated dbond list: num_dbonds=%d space=%ldMB\n",
+           system->my_rank, bond_cap*MAX_BONDS*3,
+           bond_cap*MAX_BONDS*3*sizeof(dbond_data)/(1024*1024) );
 #endif
 
   free( hb_top );
@@ -629,22 +629,22 @@ int  Init_Lists( reax_system *system, control_params *control,
   return SUCCESS;
 }
 #elif defined(LAMMPS_REAX)
-int  Init_Lists( reax_system *system, control_params *control, 
-		 simulation_data *data, storage *workspace, reax_list **lists, 
-		 mpi_datatypes *mpi_data, char *msg )
+int  Init_Lists( reax_system *system, control_params *control,
+                 simulation_data *data, storage *workspace, reax_list **lists,
+                 mpi_datatypes *mpi_data, char *msg )
 {
   int i, num_nbrs;
   int total_hbonds, total_bonds, bond_cap, num_3body, cap_3body, Htop;
   int *hb_top, *bond_top;
   int nrecv[MAX_NBRS];
   MPI_Comm comm;
-  
+
   comm = mpi_data->world;
   bond_top = (int*) calloc( system->total_cap, sizeof(int) );
   hb_top = (int*) calloc( system->local_cap, sizeof(int) );
   Estimate_Storages( system, control, lists,
-		     &Htop, hb_top, bond_top, &num_3body, comm );
-  
+                     &Htop, hb_top, bond_top, &num_3body, comm );
+
   if( control->hbond_cut > 0 ) {
     /* init H indexes */
     total_hbonds = 0;
@@ -654,18 +654,18 @@ int  Init_Lists( reax_system *system, control_params *control,
     }
     total_hbonds = (int)(MAX( total_hbonds*SAFER_ZONE, MIN_CAP*MIN_HBONDS ));
 
-    if( !Make_List( system->Hcap, total_hbonds, TYP_HBOND, 
-		    *lists+HBONDS, comm ) ) {
+    if( !Make_List( system->Hcap, total_hbonds, TYP_HBOND,
+                    *lists+HBONDS, comm ) ) {
       fprintf( stderr, "not enough space for hbonds list. terminating!\n" );
       MPI_Abort( comm, INSUFFICIENT_MEMORY );
-    } 
+    }
 #if defined(DEBUG_FOCUS)
-    fprintf( stderr, "p%d: allocated hbonds: total_hbonds=%d, space=%dMB\n", 
-	     system->my_rank, total_hbonds, 
-	     (int)(total_hbonds*sizeof(hbond_data)/(1024*1024)) );
+    fprintf( stderr, "p%d: allocated hbonds: total_hbonds=%d, space=%dMB\n",
+             system->my_rank, total_hbonds,
+             (int)(total_hbonds*sizeof(hbond_data)/(1024*1024)) );
 #endif
   }
-  
+
   /* bonds list */
   //Allocate_Bond_List( system->N, bond_top, (*lists)+BONDS );
   //num_bonds = bond_top[system->N-1];
@@ -675,48 +675,48 @@ int  Init_Lists( reax_system *system, control_params *control,
     total_bonds += bond_top[i];
   }
   bond_cap = (int)(MAX( total_bonds*SAFE_ZONE, MIN_CAP*MIN_BONDS ));
-  
-  if( !Make_List( system->total_cap, bond_cap, TYP_BOND, 
-		  *lists+BONDS, comm ) ) {
+
+  if( !Make_List( system->total_cap, bond_cap, TYP_BOND,
+                  *lists+BONDS, comm ) ) {
     fprintf( stderr, "not enough space for bonds list. terminating!\n" );
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d: allocated bonds: total_bonds=%d, space=%dMB\n", 
-	   system->my_rank, bond_cap, 
-	   (int)(bond_cap*sizeof(bond_data)/(1024*1024)) );
+  fprintf( stderr, "p%d: allocated bonds: total_bonds=%d, space=%dMB\n",
+           system->my_rank, bond_cap,
+           (int)(bond_cap*sizeof(bond_data)/(1024*1024)) );
 #endif
 
   /* 3bodies list */
   cap_3body = (int)(MAX( num_3body*SAFE_ZONE, MIN_3BODIES ));
-  if( !Make_List( bond_cap, cap_3body, TYP_THREE_BODY, 
-		  *lists+THREE_BODIES, comm ) ){
+  if( !Make_List( bond_cap, cap_3body, TYP_THREE_BODY,
+                  *lists+THREE_BODIES, comm ) ){
     fprintf( stderr, "Problem in initializing angles list. Terminating!\n" );
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
 #if defined(DEBUG_FOCUS)
-  fprintf( stderr, "p%d: allocated 3-body list: num_3body=%d, space=%dMB\n", 
-	   system->my_rank, cap_3body, 
-	   (int)(cap_3body*sizeof(three_body_interaction_data)/(1024*1024)) );
+  fprintf( stderr, "p%d: allocated 3-body list: num_3body=%d, space=%dMB\n",
+           system->my_rank, cap_3body,
+           (int)(cap_3body*sizeof(three_body_interaction_data)/(1024*1024)) );
 #endif
 
 #if defined(TEST_FORCES)
-  if( !Make_List( system->total_cap, bond_cap*8, TYP_DDELTA, 
-		  *lists+DDELTAS, comm ) ) {
+  if( !Make_List( system->total_cap, bond_cap*8, TYP_DDELTA,
+                  *lists+DDELTAS, comm ) ) {
     fprintf( stderr, "Problem in initializing dDelta list. Terminating!\n" );
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
-  fprintf( stderr, "p%d: allocated dDelta list: num_ddelta=%d space=%ldMB\n", 
-	   system->my_rank, bond_cap*30, 
-	   bond_cap*8*sizeof(dDelta_data)/(1024*1024) );
+  fprintf( stderr, "p%d: allocated dDelta list: num_ddelta=%d space=%ldMB\n",
+           system->my_rank, bond_cap*30,
+           bond_cap*8*sizeof(dDelta_data)/(1024*1024) );
 
   if( !Make_List( bond_cap, bond_cap*50, TYP_DBO, (*lists)+DBOS, comm ) ) {
     fprintf( stderr, "Problem in initializing dBO list. Terminating!\n" );
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
-  fprintf( stderr, "p%d: allocated dbond list: num_dbonds=%d space=%ldMB\n", 
-	   system->my_rank, bond_cap*MAX_BONDS*3, 
-	   bond_cap*MAX_BONDS*3*sizeof(dbond_data)/(1024*1024) );
+  fprintf( stderr, "p%d: allocated dbond list: num_dbonds=%d space=%ldMB\n",
+           system->my_rank, bond_cap*MAX_BONDS*3,
+           bond_cap*MAX_BONDS*3*sizeof(dbond_data)/(1024*1024) );
 #endif
 
   free( hb_top );
@@ -729,19 +729,19 @@ int  Init_Lists( reax_system *system, control_params *control,
 
 
 #if defined(PURE_REAX)
-void Initialize( reax_system *system, control_params *control, 
-		 simulation_data *data, storage *workspace, 
-		 reax_list **lists, output_controls *out_control, 
-		 mpi_datatypes *mpi_data )
+void Initialize( reax_system *system, control_params *control,
+                 simulation_data *data, storage *workspace,
+                 reax_list **lists, output_controls *out_control,
+                 mpi_datatypes *mpi_data )
 {
   char msg[MAX_STR];
 
   if( Init_MPI_Datatypes( system, workspace, mpi_data, MPI_COMM_WORLD, msg ) ==
       FAILURE ) {
     fprintf( stderr, "p%d: init_mpi_datatypes: could not create datatypes\n",
-	     system->my_rank );
+             system->my_rank );
     fprintf( stderr, "p%d: mpi_data couldn't be initialized! terminating.\n",
-	     system->my_rank );
+             system->my_rank );
     MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
   }
 #if defined(DEBUG)
@@ -749,9 +749,9 @@ void Initialize( reax_system *system, control_params *control,
 #endif
 
   if( Init_System(system, control, data, workspace, mpi_data, msg) == FAILURE ){
-    fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); 
+    fprintf( stderr, "p%d: %s\n", system->my_rank, msg );
     fprintf( stderr, "p%d: system could not be initialized! terminating.\n",
-	     system->my_rank );
+             system->my_rank );
     MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
   }
 #if defined(DEBUG)
@@ -759,32 +759,32 @@ void Initialize( reax_system *system, control_params *control,
 #endif
 
   if( Init_Simulation_Data(system, control, data, mpi_data, msg) == FAILURE ) {
-    fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); 
+    fprintf( stderr, "p%d: %s\n", system->my_rank, msg );
     fprintf( stderr, "p%d: sim_data couldn't be initialized! terminating.\n",
-	     system->my_rank );
+             system->my_rank );
     MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
   }
 #if defined(DEBUG)
   fprintf( stderr, "p%d: initialized simulation data\n", system->my_rank );
 #endif
 
-  if( Init_Workspace( system, control, workspace, mpi_data->world, msg ) == 
+  if( Init_Workspace( system, control, workspace, mpi_data->world, msg ) ==
       FAILURE ) {
-    fprintf( stderr, "p%d:init_workspace: not enough memory\n", 
-	     system->my_rank );
+    fprintf( stderr, "p%d:init_workspace: not enough memory\n",
+             system->my_rank );
     fprintf( stderr, "p%d:workspace couldn't be initialized! terminating.\n",
-	     system->my_rank );
+             system->my_rank );
     MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
   }
 #if defined(DEBUG)
   fprintf( stderr, "p%d: initialized workspace\n", system->my_rank );
 #endif
-  
-  if( Init_Lists( system, control, data, workspace, lists, mpi_data, msg ) == 
+
+  if( Init_Lists( system, control, data, workspace, lists, mpi_data, msg ) ==
       FAILURE ) {
       fprintf( stderr, "p%d: %s\n", system->my_rank, msg );
       fprintf( stderr, "p%d: system could not be initialized! terminating.\n",
-	       system->my_rank );
+               system->my_rank );
       MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
     }
 #if defined(DEBUG)
@@ -793,8 +793,8 @@ void Initialize( reax_system *system, control_params *control,
 
   if(Init_Output_Files(system,control,out_control,mpi_data,msg) == FAILURE) {
     fprintf( stderr, "p%d: %s\n", system->my_rank, msg );
-    fprintf( stderr, "p%d: could not open output files! terminating...\n", 
-	     system->my_rank );
+    fprintf( stderr, "p%d: could not open output files! terminating...\n",
+             system->my_rank );
     MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
   }
 #if defined(DEBUG)
@@ -805,7 +805,7 @@ void Initialize( reax_system *system, control_params *control,
     if( Init_Lookup_Tables(system,control,workspace,mpi_data,msg) == FAILURE ) {
       fprintf( stderr, "p%d: %s\n", system->my_rank, msg );
       fprintf( stderr, "p%d: couldn't create lookup table! terminating.\n",
-	       system->my_rank );
+               system->my_rank );
       MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
     }
 #if defined(DEBUG)
@@ -817,36 +817,36 @@ void Initialize( reax_system *system, control_params *control,
 #if defined(DEBUG)
   fprintf( stderr, "p%d: initialized force functions\n", system->my_rank );
 #endif
-  /*#ifdef TEST_FORCES 
+  /*#ifdef TEST_FORCES
     Init_Force_Test_Functions();
     fprintf(stderr,"p%d: initialized force test functions\n",system->my_rank);
     #endif */
 }
 
 #elif defined(LAMMPS_REAX)
-void Initialize( reax_system *system, control_params *control, 
-		 simulation_data *data, storage *workspace, 
-		 reax_list **lists, output_controls *out_control,
-		 mpi_datatypes *mpi_data, MPI_Comm comm )
+void Initialize( reax_system *system, control_params *control,
+                 simulation_data *data, storage *workspace,
+                 reax_list **lists, output_controls *out_control,
+                 mpi_datatypes *mpi_data, MPI_Comm comm )
 {
   char msg[MAX_STR];
 
 
   if( Init_MPI_Datatypes(system, workspace, mpi_data, comm, msg) == FAILURE ) {
     fprintf( stderr, "p%d: init_mpi_datatypes: could not create datatypes\n",
-	     system->my_rank );
+             system->my_rank );
     fprintf( stderr, "p%d: mpi_data couldn't be initialized! terminating.\n",
-	     system->my_rank );
+             system->my_rank );
     MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
   }
 #if defined(DEBUG)
   fprintf( stderr, "p%d: initialized mpi datatypes\n", system->my_rank );
 #endif
-  
+
   if( Init_System(system, control, msg) == FAILURE ){
-    fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); 
+    fprintf( stderr, "p%d: %s\n", system->my_rank, msg );
     fprintf( stderr, "p%d: system could not be initialized! terminating.\n",
-	     system->my_rank );
+             system->my_rank );
     MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
   }
 #if defined(DEBUG)
@@ -854,32 +854,32 @@ void Initialize( reax_system *system, control_params *control,
 #endif
 
   if( Init_Simulation_Data( system, control, data, msg ) == FAILURE ) {
-    fprintf( stderr, "p%d: %s\n", system->my_rank, msg ); 
+    fprintf( stderr, "p%d: %s\n", system->my_rank, msg );
     fprintf( stderr, "p%d: sim_data couldn't be initialized! terminating.\n",
-	     system->my_rank );
+             system->my_rank );
     MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
   }
 #if defined(DEBUG)
   fprintf( stderr, "p%d: initialized simulation data\n", system->my_rank );
 #endif
 
-  if( Init_Workspace( system, control, workspace, mpi_data->world, msg ) == 
+  if( Init_Workspace( system, control, workspace, mpi_data->world, msg ) ==
       FAILURE ) {
-    fprintf( stderr, "p%d:init_workspace: not enough memory\n", 
-	     system->my_rank );
+    fprintf( stderr, "p%d:init_workspace: not enough memory\n",
+             system->my_rank );
     fprintf( stderr, "p%d:workspace couldn't be initialized! terminating.\n",
-	     system->my_rank );
+             system->my_rank );
     MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
   }
 #if defined(DEBUG)
   fprintf( stderr, "p%d: initialized workspace\n", system->my_rank );
 #endif
 
-  if( Init_Lists( system, control, data, workspace, lists, mpi_data, msg ) == 
+  if( Init_Lists( system, control, data, workspace, lists, mpi_data, msg ) ==
       FAILURE ) {
       fprintf( stderr, "p%d: %s\n", system->my_rank, msg );
       fprintf( stderr, "p%d: system could not be initialized! terminating.\n",
-	       system->my_rank );
+               system->my_rank );
       MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
     }
 #if defined(DEBUG)
@@ -888,8 +888,8 @@ void Initialize( reax_system *system, control_params *control,
 
   if( Init_Output_Files(system,control,out_control,mpi_data,msg)== FAILURE) {
     fprintf( stderr, "p%d: %s\n", system->my_rank, msg );
-    fprintf( stderr, "p%d: could not open output files! terminating...\n", 
-	     system->my_rank );
+    fprintf( stderr, "p%d: could not open output files! terminating...\n",
+             system->my_rank );
     MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
   }
 #if defined(DEBUG)
@@ -900,7 +900,7 @@ void Initialize( reax_system *system, control_params *control,
     if( Init_Lookup_Tables( system, control, workspace, mpi_data, msg ) == FAILURE ) {
       fprintf( stderr, "p%d: %s\n", system->my_rank, msg );
       fprintf( stderr, "p%d: couldn't create lookup table! terminating.\n",
-	       system->my_rank );
+               system->my_rank );
       MPI_Abort( mpi_data->world, CANNOT_INITIALIZE );
     }
 #if defined(DEBUG)
@@ -913,7 +913,7 @@ void Initialize( reax_system *system, control_params *control,
 #if defined(DEBUG)
   fprintf( stderr, "p%d: initialized force functions\n", system->my_rank );
 #endif
-  /*#if defined(TEST_FORCES) 
+  /*#if defined(TEST_FORCES)
     Init_Force_Test_Functions();
     fprintf(stderr,"p%d: initialized force test functions\n",system->my_rank);
   #endif*/
diff --git a/src/USER-REAXC/reaxc_init_md.h b/src/USER-REAXC/reaxc_init_md.h
index 26990dfdec..ddaf587a4f 100644
--- a/src/USER-REAXC/reaxc_init_md.h
+++ b/src/USER-REAXC/reaxc_init_md.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -31,10 +31,10 @@
 
 #if defined(PURE_REAX)
 void Initialize( reax_system*, control_params*, simulation_data*,
-		 storage*, reax_list**, output_controls*, mpi_datatypes* );
+                 storage*, reax_list**, output_controls*, mpi_datatypes* );
 #elif defined(LAMMPS_REAX)
-void Initialize( reax_system*, control_params*, simulation_data*, storage*, 
-		 reax_list**, output_controls*, mpi_datatypes*, MPI_Comm );
+void Initialize( reax_system*, control_params*, simulation_data*, storage*,
+                 reax_list**, output_controls*, mpi_datatypes*, MPI_Comm );
 #endif
 
 #endif
diff --git a/src/USER-REAXC/reaxc_io_tools.cpp b/src/USER-REAXC/reaxc_io_tools.cpp
index 9024b9b3d8..65466724eb 100644
--- a/src/USER-REAXC/reaxc_io_tools.cpp
+++ b/src/USER-REAXC/reaxc_io_tools.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -49,9 +49,9 @@
 print_interaction Print_Interactions[NUM_INTRS];
 
 /************************ initialize output controls ************************/
-int Init_Output_Files( reax_system *system, control_params *control, 
-		       output_controls *out_control, mpi_datatypes *mpi_data, 
-		       char *msg )
+int Init_Output_Files( reax_system *system, control_params *control,
+                       output_controls *out_control, mpi_datatypes *mpi_data,
+                       char *msg )
 {
   char temp[MAX_STR];
   int ret;
@@ -70,19 +70,19 @@ int Init_Output_Files( reax_system *system, control_params *control,
       sprintf( temp, "%s.out", control->sim_name );
       if( (out_control->out = fopen( temp, "w" )) != NULL ) {
 #if !defined(DEBUG) && !defined(DEBUG_FOCUS)
-	fprintf( out_control->out, "%-6s%14s%14s%14s%11s%13s%13s\n",
-		 "step", "total energy", "potential", "kinetic", 
-		 "T(K)", "V(A^3)", "P(Gpa)" );
+        fprintf( out_control->out, "%-6s%14s%14s%14s%11s%13s%13s\n",
+                 "step", "total energy", "potential", "kinetic",
+                 "T(K)", "V(A^3)", "P(Gpa)" );
 #else
-	fprintf( out_control->out, "%-6s%24s%24s%24s%13s%16s%13s\n",
-		 "step", "total energy", "potential", "kinetic", 
-		 "T(K)", "V(A^3)", "P(GPa)" );
+        fprintf( out_control->out, "%-6s%24s%24s%24s%13s%16s%13s\n",
+                 "step", "total energy", "potential", "kinetic",
+                 "T(K)", "V(A^3)", "P(GPa)" );
 #endif
-	fflush( out_control->out );
+        fflush( out_control->out );
       }
       else {
-	strcpy( msg, "init_out_controls: .out file could not be opened\n" );
-	return FAILURE;
+        strcpy( msg, "init_out_controls: .out file could not be opened\n" );
+        return FAILURE;
       }
 #endif
 
@@ -90,55 +90,55 @@ int Init_Output_Files( reax_system *system, control_params *control,
       sprintf( temp, "%s.pot", control->sim_name );
       if( (out_control->pot = fopen( temp, "w" )) != NULL ) {
 #if !defined(DEBUG) && !defined(DEBUG_FOCUS)
-	fprintf( out_control->pot, 
-		 "%-6s%14s%14s%14s%14s%14s%14s%14s%14s%14s%14s%14s\n",
-		 "step", "ebond", "eatom", "elp", 
-		 "eang", "ecoa", "ehb", "etor", "econj", 
-		 "evdw","ecoul", "epol" );
+        fprintf( out_control->pot,
+                 "%-6s%14s%14s%14s%14s%14s%14s%14s%14s%14s%14s%14s\n",
+                 "step", "ebond", "eatom", "elp",
+                 "eang", "ecoa", "ehb", "etor", "econj",
+                 "evdw","ecoul", "epol" );
 #else
-	fprintf( out_control->pot, 
-		 "%-6s%24s%24s%24s%24s%24s%24s%24s%24s%24s%24s%24s\n",
-		 "step", "ebond", "eatom", "elp", 
-		 "eang", "ecoa", "ehb", "etor", "econj", 
-		 "evdw","ecoul", "epol" );	
+        fprintf( out_control->pot,
+                 "%-6s%24s%24s%24s%24s%24s%24s%24s%24s%24s%24s%24s\n",
+                 "step", "ebond", "eatom", "elp",
+                 "eang", "ecoa", "ehb", "etor", "econj",
+                 "evdw","ecoul", "epol" );
 #endif
-	fflush( out_control->pot );
+        fflush( out_control->pot );
       }
       else {
-	strcpy( msg, "init_out_controls: .pot file could not be opened\n" );
-	return FAILURE;
+        strcpy( msg, "init_out_controls: .pot file could not be opened\n" );
+        return FAILURE;
       }
-      
+
       /* init log file */
 #if defined(LOG_PERFORMANCE)
       sprintf( temp, "%s.log", control->sim_name );
       if( (out_control->log = fopen( temp, "w" )) != NULL ) {
-	fprintf( out_control->log, "%6s%8s%8s%8s%8s%8s%8s%8s%8s\n",
-		 "step", "total", "comm", "nbrs", "init", "bonded", "nonb", 
-		 "qeq", "matvecs" );
-	fflush( out_control->log );
+        fprintf( out_control->log, "%6s%8s%8s%8s%8s%8s%8s%8s%8s\n",
+                 "step", "total", "comm", "nbrs", "init", "bonded", "nonb",
+                 "qeq", "matvecs" );
+        fflush( out_control->log );
       }
       else {
-	strcpy( msg, "init_out_controls: .log file could not be opened\n" );
-	return FAILURE;
+        strcpy( msg, "init_out_controls: .log file could not be opened\n" );
+        return FAILURE;
       }
 #endif
     }
 
     /* init pressure file */
     if( control->ensemble == NPT  ||
-	control->ensemble == iNPT ||
-	control->ensemble == sNPT ) {
+        control->ensemble == iNPT ||
+        control->ensemble == sNPT ) {
       sprintf( temp, "%s.prs", control->sim_name );
       if( (out_control->prs = fopen( temp, "w" )) != NULL ) {
-	fprintf(out_control->prs,"%8s%13s%13s%13s%13s%13s%13s%13s\n",
-		"step", "Pint/norm[x]", "Pint/norm[y]", "Pint/norm[z]",
-		"Pext/Ptot[x]", "Pext/Ptot[y]", "Pext/Ptot[z]", "Pkin/V" );
-	fflush( out_control->prs );
+        fprintf(out_control->prs,"%8s%13s%13s%13s%13s%13s%13s%13s\n",
+                "step", "Pint/norm[x]", "Pint/norm[y]", "Pint/norm[z]",
+                "Pext/Ptot[x]", "Pext/Ptot[y]", "Pext/Ptot[z]", "Pkin/V" );
+        fflush( out_control->prs );
       }
       else {
-	strcpy(msg,"init_out_controls: .prs file couldn't be opened\n");
-	return FAILURE;
+        strcpy(msg,"init_out_controls: .prs file couldn't be opened\n");
+        return FAILURE;
       }
     }
 
@@ -147,28 +147,28 @@ int Init_Output_Files( reax_system *system, control_params *control,
     // if( control->dipole_anal ) {
     //   sprintf( temp, "%s.dpl", control->sim_name );
     //   if( (out_control->dpl = fopen( temp, "w" )) != NULL ) {
-    // 	fprintf( out_control->dpl, "%6s%20s%30s",
-    // 		 "step", "molecule count", "avg dipole moment norm" );
-    // 	fflush( out_control->dpl );
+    //         fprintf( out_control->dpl, "%6s%20s%30s",
+    //                  "step", "molecule count", "avg dipole moment norm" );
+    //         fflush( out_control->dpl );
     //   }
     //   else {
-    // 	strcpy(msg, "init_out_controls: .dpl file couldn't be opened\n");
-    // 	return FAILURE;
+    //         strcpy(msg, "init_out_controls: .dpl file couldn't be opened\n");
+    //         return FAILURE;
     //   }
     // }
- 
+
     /* init diffusion coef analysis file */
     // not yet implemented in the parallel version!!!
     // if( control->diffusion_coef ) {
     //   sprintf( temp, "%s.drft", control->sim_name );
     //   if( (out_control->drft = fopen( temp, "w" )) != NULL ) {
-    // 	fprintf( out_control->drft, "%7s%20s%20s\n", 
-    // 		 "step", "type count", "avg disp^2" );
-    // 	fflush( out_control->drft );
+    //         fprintf( out_control->drft, "%7s%20s%20s\n",
+    //                  "step", "type count", "avg disp^2" );
+    //         fflush( out_control->drft );
     //   }
     //   else {
-    // 	strcpy(msg,"init_out_controls: .drft file couldn't be opened\n");
-    // 	return FAILURE;
+    //         strcpy(msg,"init_out_controls: .drft file couldn't be opened\n");
+    //         return FAILURE;
     //   }
     // }
   }
@@ -176,14 +176,14 @@ int Init_Output_Files( reax_system *system, control_params *control,
 
   /* init molecular analysis file */
   /* proc0 opens this file and shares it with everyone.
-     then all processors write into it in a round-robin 
+     then all processors write into it in a round-robin
      fashion controlled by their rank */
   /*if( control->molecular_analysis ) {
     if( system->my_rank == MASTER_NODE ) {
       sprintf( temp, "%s.mol", control->sim_name );
       if( (out_control->mol = fopen( temp, "w" )) == NULL ) {
-	strcpy(msg,"init_out_controls: .mol file could not be opened\n");
-	return FAILURE;
+        strcpy(msg,"init_out_controls: .mol file could not be opened\n");
+        return FAILURE;
       }
     }
 
@@ -208,14 +208,14 @@ int Init_Output_Files( reax_system *system, control_params *control,
 
   /* open overcoordination energy file */
   sprintf( temp, "%s.eov.%d", control->sim_name, system->my_rank );
-  if( (out_control->eov = fopen( temp, "w" )) == NULL )	{
+  if( (out_control->eov = fopen( temp, "w" )) == NULL )        {
     strcpy(msg,"Init_Out_Files: .eov file couldn't be opened\n");
     return FAILURE;
   }
 
   /* open undercoordination energy file */
   sprintf( temp, "%s.eun.%d", control->sim_name, system->my_rank );
-  if( (out_control->eun = fopen( temp, "w" )) == NULL )	{
+  if( (out_control->eun = fopen( temp, "w" )) == NULL )        {
     strcpy(msg,"Init_Out_Files: .eun file couldn't be opened\n");
     return FAILURE;
   }
@@ -257,7 +257,7 @@ int Init_Output_Files( reax_system *system, control_params *control,
 
   /* open hydrogen bond energy file */
   sprintf( temp, "%s.ehb.%d", control->sim_name, system->my_rank );
-  if( (out_control->ehb = fopen( temp, "w" )) == NULL )	{
+  if( (out_control->ehb = fopen( temp, "w" )) == NULL )        {
     strcpy(msg,"Init_Out_Files: .ehb file couldn't be opened\n");
     return FAILURE;
   }
@@ -285,7 +285,7 @@ int Init_Output_Files( reax_system *system, control_params *control,
     strcpy(msg,"Init_Out_Files: .fbo file couldn't be opened\n");
     return FAILURE;
   }
-  
+
   /* open bond orders derivatives file */
   sprintf( temp, "%s.fdbo.%d", control->sim_name, system->my_rank );
   if( (out_control->fdbo = fopen( temp, "w" )) == NULL ) {
@@ -308,7 +308,7 @@ int Init_Output_Files( reax_system *system, control_params *control,
       strcpy(msg,"Init_Out_Files: .flp file couldn't be opened\n");
       return FAILURE;
     }
-    
+
     /* open overcoordination forces file */
     sprintf( temp, "%s.fov", control->sim_name );
     if( (out_control->fov = fopen( temp, "w" )) == NULL ) {
@@ -321,7 +321,7 @@ int Init_Output_Files( reax_system *system, control_params *control,
     if( (out_control->fun = fopen( temp, "w" )) == NULL ) {
       strcpy(msg,"Init_Out_Files: .fun file couldn't be opened\n");
       return FAILURE;
-    }    
+    }
 
     /* open angle forces file */
     sprintf( temp, "%s.fang", control->sim_name );
@@ -336,14 +336,14 @@ int Init_Output_Files( reax_system *system, control_params *control,
       strcpy(msg,"Init_Out_Files: .fcoa file couldn't be opened\n");
       return FAILURE;
     }
-    
+
     /* open penalty forces file */
     sprintf( temp, "%s.fpen", control->sim_name );
     if( (out_control->fpen = fopen( temp, "w" )) == NULL ) {
       strcpy(msg,"Init_Out_Files: .fpen file couldn't be opened\n");
       return FAILURE;
     }
-    
+
     /* open torsion forces file */
     sprintf( temp, "%s.ftor", control->sim_name );
     if( (out_control->ftor = fopen( temp, "w" )) == NULL ) {
@@ -360,11 +360,11 @@ int Init_Output_Files( reax_system *system, control_params *control,
 
     /* open hydrogen bond forces file */
     sprintf( temp, "%s.fhb", control->sim_name );
-    if( (out_control->fhb = fopen( temp, "w" )) == NULL )	{
+    if( (out_control->fhb = fopen( temp, "w" )) == NULL )        {
       strcpy(msg,"Init_Out_Files: .fhb file couldn't be opened\n");
       return FAILURE;
     }
-    
+
     /* open vdw forces file */
     sprintf( temp, "%s.fvdw", control->sim_name );
     if( (out_control->fvdw = fopen( temp, "w" )) == NULL ) {
@@ -378,7 +378,7 @@ int Init_Output_Files( reax_system *system, control_params *control,
       strcpy(msg,"Init_Out_Files: .fele file couldn't be opened\n");
       return FAILURE;
     }
-    
+
     /* open total force file */
     sprintf( temp, "%s.ftot", control->sim_name );
     if( (out_control->ftot = fopen( temp, "w" )) == NULL ) {
@@ -425,8 +425,8 @@ int Init_Output_Files( reax_system *system, control_params *control,
 
 
 /************************ close output files ************************/
-int Close_Output_Files( reax_system *system, control_params *control, 
-			output_controls *out_control, mpi_datatypes *mpi_data )
+int Close_Output_Files( reax_system *system, control_params *control,
+                        output_controls *out_control, mpi_datatypes *mpi_data )
 {
   if( out_control->write_steps > 0 )
     End_Traj( system->my_rank, out_control );
@@ -443,7 +443,7 @@ int Close_Output_Files( reax_system *system, control_params *control,
     }
 
     if( control->ensemble == NPT || control->ensemble == iNPT ||
-	control->ensemble == sNPT )
+        control->ensemble == sNPT )
       fclose( out_control->prs );
 
     // not yet implemented in the parallel version
@@ -451,7 +451,7 @@ int Close_Output_Files( reax_system *system, control_params *control,
     //if( control->diffusion_coef ) fclose( out_control->drft );
     //if( control->molecular_analysis ) fclose( out_control->mol );
   }
-  
+
 #ifdef TEST_ENERGY
   fclose( out_control->ebond );
   fclose( out_control->elp );
@@ -472,7 +472,7 @@ int Close_Output_Files( reax_system *system, control_params *control,
   fclose( out_control->fdbo );
 
   if( system->my_rank == MASTER_NODE ) {
-    fclose( out_control->fbond ); 
+    fclose( out_control->fbond );
     fclose( out_control->flp );
     fclose( out_control->fov );
     fclose( out_control->fun );
@@ -507,12 +507,12 @@ void Print_Box( simulation_box* box, char *name, FILE *out )
   // int i, j;
 
   fprintf( out, "%s:\n", name );
-  fprintf( out, "\tmin[%8.3f %8.3f %8.3f]\n", 
-	   box->min[0], box->min[1], box->min[2] );
+  fprintf( out, "\tmin[%8.3f %8.3f %8.3f]\n",
+           box->min[0], box->min[1], box->min[2] );
   fprintf( out, "\tmax[%8.3f %8.3f %8.3f]\n",
-	   box->max[0], box->max[1], box->max[2] );
-  fprintf( out, "\tdims[%8.3f%8.3f%8.3f]\n", 
-	   box->box_norms[0], box->box_norms[1], box->box_norms[2] );
+           box->max[0], box->max[1], box->max[2] );
+  fprintf( out, "\tdims[%8.3f%8.3f%8.3f]\n",
+           box->box_norms[0], box->box_norms[1], box->box_norms[2] );
 
   // fprintf( out, "box: {" );
   // for( i = 0; i < 3; ++i )
@@ -529,7 +529,7 @@ void Print_Box( simulation_box* box, char *name, FILE *out )
   //   {
   //     fprintf( out, "{" );
   //     for( j = 0; j < 3; ++j )
-  // 	fprintf( out, "%8.3f ", box->trans[i][j] );
+  //         fprintf( out, "%8.3f ", box->trans[i][j] );
   //     fprintf( out, "}" );
   //   }
   // fprintf( out, "}\n" );
@@ -539,7 +539,7 @@ void Print_Box( simulation_box* box, char *name, FILE *out )
   //   {
   //     fprintf( out, "{" );
   //     for( j = 0; j < 3; ++j )
-  // 	fprintf( out, "%8.3f ", box->trans_inv[i][j] );
+  //         fprintf( out, "%8.3f ", box->trans_inv[i][j] );
   //     fprintf( out, "}" );
   //   }
   // fprintf( out, "}\n" );
@@ -551,43 +551,43 @@ void Print_Grid( grid* g, FILE *out )
 {
   int x, y, z, gc_type;
   ivec gc_str;
-  char gcell_type_text[10][12] = 
-    { "NO_NBRS", "NEAR_ONLY", "HBOND_ONLY", "FAR_ONLY",  
+  char gcell_type_text[10][12] =
+    { "NO_NBRS", "NEAR_ONLY", "HBOND_ONLY", "FAR_ONLY",
       "NEAR_HBOND", "NEAR_FAR", "HBOND_FAR", "FULL_NBRS", "NATIVE" };
 
   fprintf( out, "\tnumber of grid cells: %d %d %d\n",
-	   g->ncells[0], g->ncells[1], g->ncells[2] );
-  fprintf( out, "\tgcell lengths: %8.3f %8.3f %8.3f\n", 
-	   g->cell_len[0], g->cell_len[1], g->cell_len[2] );
+           g->ncells[0], g->ncells[1], g->ncells[2] );
+  fprintf( out, "\tgcell lengths: %8.3f %8.3f %8.3f\n",
+           g->cell_len[0], g->cell_len[1], g->cell_len[2] );
   fprintf( out, "\tinverses of gcell lengths: %8.3f %8.3f %8.3f\n",
-	   g->inv_len[0], g->inv_len[1], g->inv_len[2] );
+           g->inv_len[0], g->inv_len[1], g->inv_len[2] );
   fprintf( out, "\t---------------------------------\n" );
   fprintf( out, "\tnumber of native gcells: %d %d %d\n",
-	   g->native_cells[0], g->native_cells[1], g->native_cells[2] );
+           g->native_cells[0], g->native_cells[1], g->native_cells[2] );
   fprintf( out, "\tnative gcell span: %d-%d  %d-%d  %d-%d\n",
-	   g->native_str[0], g->native_end[0], 
-	   g->native_str[1], g->native_end[1], 
-	   g->native_str[2], g->native_end[2] );
+           g->native_str[0], g->native_end[0],
+           g->native_str[1], g->native_end[1],
+           g->native_str[2], g->native_end[2] );
   fprintf( out, "\t---------------------------------\n" );
   fprintf( out, "\tvlist gcell stretch: %d %d %d\n",
-	   g->vlist_span[0], g->vlist_span[1], g->vlist_span[2] );
+           g->vlist_span[0], g->vlist_span[1], g->vlist_span[2] );
   fprintf( out, "\tnonbonded nbrs gcell stretch: %d %d %d\n",
-	   g->nonb_span[0], g->nonb_span[1], g->nonb_span[2] );
+           g->nonb_span[0], g->nonb_span[1], g->nonb_span[2] );
   fprintf( out, "\tbonded nbrs gcell stretch: %d %d %d\n",
-	   g->bond_span[0], g->bond_span[1], g->bond_span[2] );
+           g->bond_span[0], g->bond_span[1], g->bond_span[2] );
   fprintf( out, "\t---------------------------------\n" );
   fprintf( out, "\tghost gcell span: %d %d %d\n",
-	   g->ghost_span[0], g->ghost_span[1], g->ghost_span[2] );
+           g->ghost_span[0], g->ghost_span[1], g->ghost_span[2] );
   fprintf( out, "\tnonbonded ghost gcell span: %d %d %d\n",
-	   g->ghost_nonb_span[0],g->ghost_nonb_span[1],g->ghost_nonb_span[2]);
+           g->ghost_nonb_span[0],g->ghost_nonb_span[1],g->ghost_nonb_span[2]);
   fprintf(out, "\thbonded ghost gcell span: %d %d %d\n",
-	  g->ghost_hbond_span[0],g->ghost_hbond_span[1],g->ghost_hbond_span[2]);
+          g->ghost_hbond_span[0],g->ghost_hbond_span[1],g->ghost_hbond_span[2]);
   fprintf( out, "\tbonded ghost gcell span: %d %d %d\n",
-	   g->ghost_bond_span[0],g->ghost_bond_span[1],g->ghost_bond_span[2]);
+           g->ghost_bond_span[0],g->ghost_bond_span[1],g->ghost_bond_span[2]);
   //fprintf(out, "\t---------------------------------\n" );
   //fprintf(out, "\tmax number of gcells at the boundary: %d\n", g->gcell_cap);
   fprintf( out, "\t---------------------------------\n" );
-  
+
   fprintf( stderr, "GCELL MARKS:\n" );
   gc_type = g->cells[0][0][0].type;
   ivec_MakeZero( gc_str );
@@ -596,19 +596,19 @@ void Print_Grid( grid* g, FILE *out )
   for( x = 0; x < g->ncells[0]; ++x )
     for( y = 0; y < g->ncells[1]; ++y )
       for( z = 0; z < g->ncells[2]; ++z )
-	if( g->cells[x][y][z].type != gc_type ){
-	  fprintf( stderr, 
-		   "\tgcells from(%2d %2d %2d) to (%2d %2d %2d): %d - %s\n",
-		   gc_str[0], gc_str[1], gc_str[2], x, y, z, 
-		   gc_type, gcell_type_text[gc_type] );
-	  gc_type = g->cells[x][y][z].type;
-	  gc_str[0] = x;
-	  gc_str[1] = y;
-	  gc_str[2] = z;
-	}
+        if( g->cells[x][y][z].type != gc_type ){
+          fprintf( stderr,
+                   "\tgcells from(%2d %2d %2d) to (%2d %2d %2d): %d - %s\n",
+                   gc_str[0], gc_str[1], gc_str[2], x, y, z,
+                   gc_type, gcell_type_text[gc_type] );
+          gc_type = g->cells[x][y][z].type;
+          gc_str[0] = x;
+          gc_str[1] = y;
+          gc_str[2] = z;
+        }
   fprintf( stderr, "\tgcells from(%2d %2d %2d) to (%2d %2d %2d): %d - %s\n",
-	   gc_str[0], gc_str[1], gc_str[2], x, y, z,
-	   gc_type, gcell_type_text[gc_type] );
+           gc_str[0], gc_str[1], gc_str[2], x, y, z,
+           gc_type, gcell_type_text[gc_type] );
   fprintf( out, "-------------------------------------\n" );
 }
 
@@ -625,32 +625,32 @@ void Print_GCell_Exchange_Bounds( int my_rank, neighbor_proc *my_nbrs )
 
   sprintf( fname, "gcell_exchange_bounds%d", my_rank );
   f = fopen( fname, "w" );
- 
+
   /* loop over neighbor processes */
   for( r[0] = -1; r[0] <= 1; ++r[0])
     for( r[1] = -1; r[1] <= 1; ++r[1] )
-      for( r[2] = -1; r[2] <= 1; ++r[2] )       
-	if( r[0]!=0 || r[1]!=0 || r[2]!=0 ) {
-	  nbr_pr = &(my_nbrs[nbr]);
-	  
-	  fprintf( f, "p%-2d GCELL BOUNDARIES with r(%2d %2d %2d):\n",
-		   my_rank, r[0], r[1], r[2] );
-	  
-	  fprintf( f, "\tsend_type %s: send(%d %d %d) to (%d %d %d)\n", 
-		   exch[nbr_pr->send_type],
-		   nbr_pr->str_send[0], nbr_pr->str_send[1], 
-		   nbr_pr->str_send[2],
-		   nbr_pr->end_send[0], nbr_pr->end_send[1],
-		   nbr_pr->end_send[2] );
-	  
-	  fprintf( f, "\trecv_type %s: recv(%d %d %d) to (%d %d %d)\n", 
-		   exch[nbr_pr->recv_type],
-		   nbr_pr->str_recv[0], nbr_pr->str_recv[1], 
-		   nbr_pr->str_recv[2],
-		   nbr_pr->end_recv[0], nbr_pr->end_recv[1],
-		   nbr_pr->end_recv[2] );
-	}
-  
+      for( r[2] = -1; r[2] <= 1; ++r[2] )
+        if( r[0]!=0 || r[1]!=0 || r[2]!=0 ) {
+          nbr_pr = &(my_nbrs[nbr]);
+
+          fprintf( f, "p%-2d GCELL BOUNDARIES with r(%2d %2d %2d):\n",
+                   my_rank, r[0], r[1], r[2] );
+
+          fprintf( f, "\tsend_type %s: send(%d %d %d) to (%d %d %d)\n",
+                   exch[nbr_pr->send_type],
+                   nbr_pr->str_send[0], nbr_pr->str_send[1],
+                   nbr_pr->str_send[2],
+                   nbr_pr->end_send[0], nbr_pr->end_send[1],
+                   nbr_pr->end_send[2] );
+
+          fprintf( f, "\trecv_type %s: recv(%d %d %d) to (%d %d %d)\n",
+                   exch[nbr_pr->recv_type],
+                   nbr_pr->str_recv[0], nbr_pr->str_recv[1],
+                   nbr_pr->str_recv[2],
+                   nbr_pr->end_recv[0], nbr_pr->end_recv[1],
+                   nbr_pr->end_recv[2] );
+        }
+
   fclose(f);
 }
 
@@ -663,8 +663,8 @@ void Print_Native_GCells( reax_system *system )
   FILE      *f;
   grid      *g;
   grid_cell *gc;
-  char gcell_type_text[10][12] = 
-    { "NO_NBRS", "NEAR_ONLY", "HBOND_ONLY", "FAR_ONLY",  
+  char gcell_type_text[10][12] =
+    { "NO_NBRS", "NEAR_ONLY", "HBOND_ONLY", "FAR_ONLY",
       "NEAR_HBOND", "NEAR_FAR", "HBOND_FAR", "FULL_NBRS", "NATIVE" };
 
   sprintf( fname, "native_gcells.%d", system->my_rank );
@@ -674,19 +674,19 @@ void Print_Native_GCells( reax_system *system )
   for( i = g->native_str[0]; i < g->native_end[0]; i++ )
     for( j = g->native_str[1]; j < g->native_end[1]; j++ )
       for( k = g->native_str[2]; k < g->native_end[2]; k++ )
-  	{
-  	  gc = &( g->cells[i][j][k] );
+          {
+            gc = &( g->cells[i][j][k] );
 
-  	  fprintf( f, "p%d gcell(%2d %2d %2d) of type %d(%s)\n",
-  		   system->my_rank, i, j, k, 
-		   gc->type, gcell_type_text[gc->type] );
+            fprintf( f, "p%d gcell(%2d %2d %2d) of type %d(%s)\n",
+                     system->my_rank, i, j, k,
+                   gc->type, gcell_type_text[gc->type] );
 
-  	  fprintf( f, "\tatom list start: %d, end: %d\n\t", gc->str, gc->end );
+            fprintf( f, "\tatom list start: %d, end: %d\n\t", gc->str, gc->end );
 
-	  for( l = gc->str; l < gc->end; ++l )
-  	    fprintf( f, "%5d", system->my_atoms[l].orig_id );
-  	  fprintf( f, "\n" );
-  	}  
+          for( l = gc->str; l < gc->end; ++l )
+              fprintf( f, "%5d", system->my_atoms[l].orig_id );
+            fprintf( f, "\n" );
+          }
 
   fclose(f);
 }
@@ -700,8 +700,8 @@ void Print_All_GCells( reax_system *system )
   FILE      *f;
   grid      *g;
   grid_cell *gc;
-  char gcell_type_text[10][12] = 
-    { "NO_NBRS", "NEAR_ONLY", "HBOND_ONLY", "FAR_ONLY",  
+  char gcell_type_text[10][12] =
+    { "NO_NBRS", "NEAR_ONLY", "HBOND_ONLY", "FAR_ONLY",
       "NEAR_HBOND", "NEAR_FAR", "HBOND_FAR", "FULL_NBRS", "NATIVE" };
 
   sprintf( fname, "all_gcells.%d", system->my_rank );
@@ -711,19 +711,19 @@ void Print_All_GCells( reax_system *system )
   for( i = 0; i < g->ncells[0]; i++ )
     for( j = 0; j < g->ncells[1]; j++ )
       for( k = 0; k < g->ncells[2]; k++ )
-  	{
-  	  gc = &( g->cells[i][j][k] );
+          {
+            gc = &( g->cells[i][j][k] );
 
-  	  fprintf( f, "p%d gcell(%2d %2d %2d) of type %d(%s)\n",
-  		   system->my_rank, i, j, k, 
-		   gc->type, gcell_type_text[gc->type] );
+            fprintf( f, "p%d gcell(%2d %2d %2d) of type %d(%s)\n",
+                     system->my_rank, i, j, k,
+                   gc->type, gcell_type_text[gc->type] );
 
-  	  fprintf( f, "\tatom list start: %d, end: %d\n\t", gc->str, gc->end );
-  	  
-	  for( l = gc->str; l < gc->end; ++l )
-  	    fprintf( f, "%5d", system->my_atoms[l].orig_id );
-  	  fprintf( f, "\n" );
-  	}  
+            fprintf( f, "\tatom list start: %d, end: %d\n\t", gc->str, gc->end );
+
+          for( l = gc->str; l < gc->end; ++l )
+              fprintf( f, "%5d", system->my_atoms[l].orig_id );
+            fprintf( f, "\n" );
+          }
 
   fclose(f);
 }
@@ -748,11 +748,11 @@ void Print_My_Atoms( reax_system *system )
 
   for( i = 0; i < system->n; ++i )
     fprintf( fh, "p%-2d %-5d %2d %24.15e%24.15e%24.15e\n",
-	     system->my_rank, 
-	     system->my_atoms[i].orig_id, system->my_atoms[i].type, 
-	     system->my_atoms[i].x[0], 
-	     system->my_atoms[i].x[1], 
-	     system->my_atoms[i].x[2] );
+             system->my_rank,
+             system->my_atoms[i].orig_id, system->my_atoms[i].type,
+             system->my_atoms[i].x[0],
+             system->my_atoms[i].x[1],
+             system->my_atoms[i].x[2] );
 
   fclose( fh );
 }
@@ -776,21 +776,21 @@ void Print_My_Ext_Atoms( reax_system *system )
 
   for( i = 0; i < system->N; ++i )
     fprintf( fh, "p%-2d %-5d imprt%-5d %2d %24.15e%24.15e%24.15e\n",
-	     system->my_rank, system->my_atoms[i].orig_id, 
-	     system->my_atoms[i].imprt_id, system->my_atoms[i].type, 
-	     system->my_atoms[i].x[0], 
-	     system->my_atoms[i].x[1], 
-	     system->my_atoms[i].x[2] );
+             system->my_rank, system->my_atoms[i].orig_id,
+             system->my_atoms[i].imprt_id, system->my_atoms[i].type,
+             system->my_atoms[i].x[0],
+             system->my_atoms[i].x[1],
+             system->my_atoms[i].x[2] );
 
   fclose( fh );
 }
 
 
-void Print_Far_Neighbors( reax_system *system, reax_list **lists, 
-			  control_params *control )
+void Print_Far_Neighbors( reax_system *system, reax_list **lists,
+                          control_params *control )
 {
   char  fname[100];
-  int   i, j, id_i, id_j, nbr, natoms;  
+  int   i, j, id_i, id_j, nbr, natoms;
   FILE *fout;
   reax_list *far_nbrs;
 
@@ -807,19 +807,19 @@ void Print_Far_Neighbors( reax_system *system, reax_list **lists,
       id_j = system->my_atoms[nbr].orig_id;
 
       fprintf( fout, "%6d%6d%24.15e%24.15e%24.15e%24.15e\n",
-	       id_i, id_j, far_nbrs->select.far_nbr_list[j].d,
-	       far_nbrs->select.far_nbr_list[j].dvec[0],
-	       far_nbrs->select.far_nbr_list[j].dvec[1],
-	       far_nbrs->select.far_nbr_list[j].dvec[2] );
-	
+               id_i, id_j, far_nbrs->select.far_nbr_list[j].d,
+               far_nbrs->select.far_nbr_list[j].dvec[0],
+               far_nbrs->select.far_nbr_list[j].dvec[1],
+               far_nbrs->select.far_nbr_list[j].dvec[2] );
+
       fprintf( fout, "%6d%6d%24.15e%24.15e%24.15e%24.15e\n",
-	       id_j, id_i, far_nbrs->select.far_nbr_list[j].d,
-	       -far_nbrs->select.far_nbr_list[j].dvec[0],
-	       -far_nbrs->select.far_nbr_list[j].dvec[1],
-	       -far_nbrs->select.far_nbr_list[j].dvec[2] );
+               id_j, id_i, far_nbrs->select.far_nbr_list[j].d,
+               -far_nbrs->select.far_nbr_list[j].dvec[0],
+               -far_nbrs->select.far_nbr_list[j].dvec[1],
+               -far_nbrs->select.far_nbr_list[j].dvec[2] );
     }
   }
-    
+
   fclose( fout );
 }
 
@@ -830,10 +830,10 @@ void Print_Sparse_Matrix( reax_system *system, sparse_matrix *A )
 
   for( i = 0; i < A->n; ++i )
     for( j = A->start[i]; j < A->end[i]; ++j )
-      fprintf( stderr, "%d %d %.15e\n", 
-	       system->my_atoms[i].orig_id,
-	       system->my_atoms[A->entries[j].j].orig_id, 
-	       A->entries[j].val );
+      fprintf( stderr, "%d %d %.15e\n",
+               system->my_atoms[i].orig_id,
+               system->my_atoms[A->entries[j].j].orig_id,
+               A->entries[j].val );
 }
 
 
@@ -844,10 +844,10 @@ void Print_Sparse_Matrix2( reax_system *system, sparse_matrix *A, char *fname )
 
   for( i = 0; i < A->n; ++i )
     for( j = A->start[i]; j < A->end[i]; ++j )
-      fprintf( f, "%d %d %.15e\n", 
-	       system->my_atoms[i].orig_id,
-	       system->my_atoms[A->entries[j].j].orig_id, 
-	       A->entries[j].val );
+      fprintf( f, "%d %d %.15e\n",
+               system->my_atoms[i].orig_id,
+               system->my_atoms[A->entries[j].j].orig_id,
+               A->entries[j].val );
 
   fclose(f);
 }
@@ -863,11 +863,11 @@ void Print_Symmetric_Sparse(reax_system *system, sparse_matrix *A, char *fname)
     ai = &(system->my_atoms[i]);
     for( j = A->start[i]; j < A->end[i]; ++j ) {
       aj = &(system->my_atoms[A->entries[j].j]);
-      fprintf( f, "%d %d %.15e\n", 
-	       ai->renumber, aj->renumber, A->entries[j].val );
+      fprintf( f, "%d %d %.15e\n",
+               ai->renumber, aj->renumber, A->entries[j].val );
       if( A->entries[j].j < system->n && ai->renumber != aj->renumber )
-	fprintf( f, "%d %d %.15e\n", 
-		 aj->renumber, ai->renumber, A->entries[j].val );
+        fprintf( f, "%d %d %.15e\n",
+                 aj->renumber, ai->renumber, A->entries[j].val );
     }
   }
 
@@ -875,8 +875,8 @@ void Print_Symmetric_Sparse(reax_system *system, sparse_matrix *A, char *fname)
 }
 
 
-void Print_Linear_System( reax_system *system, control_params *control, 
-			  storage *workspace, int step )
+void Print_Linear_System( reax_system *system, control_params *control,
+                          storage *workspace, int step )
 {
   int   i, j;
   char  fname[100];
@@ -889,35 +889,35 @@ void Print_Linear_System( reax_system *system, control_params *control,
   out = fopen( fname, "w" );
   for( i = 0; i < system->n; i++ ) {
     ai = &(system->my_atoms[i]);
-    fprintf( out, "%6d%2d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n", 
-	     ai->renumber, ai->type, ai->x[0], ai->x[1], ai->x[2], 
-	     workspace->s[i], workspace->b_s[i], 
-	     workspace->t[i], workspace->b_t[i] );
+    fprintf( out, "%6d%2d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n",
+             ai->renumber, ai->type, ai->x[0], ai->x[1], ai->x[2],
+             workspace->s[i], workspace->b_s[i],
+             workspace->t[i], workspace->b_t[i] );
   }
   fclose( out );
-  
+
   // print QEq coef matrix
   sprintf( fname, "%s.p%dH%d", control->sim_name, system->my_rank, step );
   Print_Symmetric_Sparse( system, workspace->H, fname );
-  
+
   // print the incomplete H matrix
   /*sprintf( fname, "%s.p%dHinc%d", control->sim_name, system->my_rank, step );
   out = fopen( fname, "w" );
   H = workspace->H;
   for( i = 0; i < H->n; ++i ) {
     ai = &(system->my_atoms[i]);
-    for( j = H->start[i]; j < H->end[i]; ++j ) 
+    for( j = H->start[i]; j < H->end[i]; ++j )
       if( H->entries[j].j < system->n ) {
-	aj = &(system->my_atoms[H->entries[j].j]);
-	fprintf( out, "%d %d %.15e\n", 
-		 ai->orig_id, aj->orig_id, H->entries[j].val );
-	if( ai->orig_id != aj->orig_id )
-	  fprintf( out, "%d %d %.15e\n", 
-		   aj->orig_id, ai->orig_id, H->entries[j].val );
+        aj = &(system->my_atoms[H->entries[j].j]);
+        fprintf( out, "%d %d %.15e\n",
+                 ai->orig_id, aj->orig_id, H->entries[j].val );
+        if( ai->orig_id != aj->orig_id )
+          fprintf( out, "%d %d %.15e\n",
+                   aj->orig_id, ai->orig_id, H->entries[j].val );
       }
   }
   fclose( out );*/
-  
+
   // print the L from incomplete cholesky decomposition
   /*sprintf( fname, "%s.p%dL%d", control->sim_name, system->my_rank, step );
     Print_Sparse_Matrix2( system, workspace->L, fname );*/
@@ -934,8 +934,8 @@ void Print_LinSys_Soln( reax_system *system, real *x, real *b_prm, real *b )
   fout = fopen( fname, "w" );
 
   for( i = 0; i < system->n; ++i )
-    fprintf( fout, "%6d%10.4f%10.4f%10.4f\n", 
-	     system->my_atoms[i].orig_id, x[i], b_prm[i], b[i] );
+    fprintf( fout, "%6d%10.4f%10.4f%10.4f\n",
+             system->my_atoms[i].orig_id, x[i], b_prm[i], b[i] );
 
   fclose( fout );
 }
@@ -951,11 +951,11 @@ void Print_Charges( reax_system *system )
   fout = fopen( fname, "w" );
 
   for( i = 0; i < system->n; ++i )
-    fprintf( fout, "%6d %10.7f %10.7f %10.7f\n", 
-	     system->my_atoms[i].orig_id, 
-	     system->my_atoms[i].s[0], 
-	     system->my_atoms[i].t[0], 
-	     system->my_atoms[i].q );
+    fprintf( fout, "%6d %10.7f %10.7f %10.7f\n",
+             system->my_atoms[i].orig_id,
+             system->my_atoms[i].s[0],
+             system->my_atoms[i].t[0],
+             system->my_atoms[i].q );
 
   fclose( fout );
 }
@@ -973,22 +973,22 @@ void Print_Bonds( reax_system *system, reax_list *bonds, char *fname )
       pbond = &(bonds->select.bond_list[pj]);
       bo_ij = &(pbond->bo_data);
       j = pbond->nbr;
-      //fprintf( f, "%6d%6d%23.15e%23.15e%23.15e%23.15e%23.15e\n", 
-      //       system->my_atoms[i].orig_id, system->my_atoms[j].orig_id, 
+      //fprintf( f, "%6d%6d%23.15e%23.15e%23.15e%23.15e%23.15e\n",
+      //       system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
       //       pbond->d, bo_ij->BO, bo_ij->BO_s, bo_ij->BO_pi, bo_ij->BO_pi2 );
-      fprintf( f, "%8d%8d %24.15f %24.15f\n", 
-	       i, j,//system->my_atoms[i].orig_id, system->my_atoms[j].orig_id, 
-	       pbond->d, bo_ij->BO );
+      fprintf( f, "%8d%8d %24.15f %24.15f\n",
+               i, j,//system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+               pbond->d, bo_ij->BO );
     }
 
   fclose(f);
 }
 
 
-int fn_qsort_intcmp( const void *a, const void *b ) 
-{ 
-  return( *(int *)a - *(int *)b ); 
-} 
+int fn_qsort_intcmp( const void *a, const void *b )
+{
+  return( *(int *)a - *(int *)b );
+}
 
 void Print_Bond_List2( reax_system *system, reax_list *bonds, char *fname )
 {
@@ -1002,12 +1002,12 @@ void Print_Bond_List2( reax_system *system, reax_list *bonds, char *fname )
     id_i = system->my_atoms[i].orig_id;
     fprintf( f, "%6d:", id_i);
     for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) {
-      nbr = bonds->select.bond_list[pj].nbr;	
+      nbr = bonds->select.bond_list[pj].nbr;
       id_j = system->my_atoms[nbr].orig_id;
-      if( id_i < id_j ) 
-	temp[num++] = id_j;
+      if( id_i < id_j )
+        temp[num++] = id_j;
     }
-    
+
     qsort(&temp, num, sizeof(int), fn_qsort_intcmp);
     for(j=0; j < num; j++)
       fprintf(f, "%6d", temp[j] );
@@ -1016,8 +1016,8 @@ void Print_Bond_List2( reax_system *system, reax_list *bonds, char *fname )
 }
 
 
-void Print_Total_Force( reax_system *system, simulation_data *data, 
-			storage *workspace )
+void Print_Total_Force( reax_system *system, simulation_data *data,
+                        storage *workspace )
 {
   int    i;
 
@@ -1025,15 +1025,15 @@ void Print_Total_Force( reax_system *system, simulation_data *data,
   fprintf( stderr, "%6s\t%-38s\n", "atom", "atom.f[0,1,2]");
 
   for( i = 0; i < system->N; ++i )
-    fprintf( stderr, "%6d %f %f %f\n", 
-	     //"%6d%24.15e%24.15e%24.15e\n", 
-	     system->my_atoms[i].orig_id,
-	     workspace->f[i][0], workspace->f[i][1], workspace->f[i][2] );
+    fprintf( stderr, "%6d %f %f %f\n",
+             //"%6d%24.15e%24.15e%24.15e\n",
+             system->my_atoms[i].orig_id,
+             workspace->f[i][0], workspace->f[i][1], workspace->f[i][2] );
 }
 
-void fixbond( reax_system *system, control_params *control, 
-		     simulation_data *data, reax_list **lists, 
-		     output_controls *out_control, mpi_datatypes *mpi_data )
+void fixbond( reax_system *system, control_params *control,
+                     simulation_data *data, reax_list **lists,
+                     output_controls *out_control, mpi_datatypes *mpi_data )
 {
   // count the number of bonds around each atom, for fix reax/c/bond
   int i, j, pj, my_bonds_0, i_id, j_id;
@@ -1051,9 +1051,9 @@ void fixbond( reax_system *system, control_params *control,
       j_id = system->my_atoms[j].orig_id;
       BO_tmp = bonds->select.bond_list[pj].bo_data.BO;
       if( i_id != j_id && BO_tmp >= control->bg_cut ) {
-	++my_bonds_0;
-	system->my_atoms[i].nbr_id[my_bonds_0] = j_id;
-	system->my_atoms[i].nbr_bo[my_bonds_0] = BO_tmp;
+        ++my_bonds_0;
+        system->my_atoms[i].nbr_id[my_bonds_0] = j_id;
+        system->my_atoms[i].nbr_bo[my_bonds_0] = BO_tmp;
       }
     }
     my_bonds_max = MAX(my_bonds_0, my_bonds_max);
@@ -1063,9 +1063,9 @@ void fixbond( reax_system *system, control_params *control,
 }
 
 
-void fixspecies( reax_system *system, control_params *control, 
-		     simulation_data *data, reax_list **lists, 
-		     output_controls *out_control, mpi_datatypes *mpi_data )
+void fixspecies( reax_system *system, control_params *control,
+                     simulation_data *data, reax_list **lists,
+                     output_controls *out_control, mpi_datatypes *mpi_data )
 {
   // count the number of bonds around each atom, for fix reax/c/bond
   int i, j, pj, my_bonds_0, i_id, j_id;
@@ -1083,9 +1083,9 @@ void fixspecies( reax_system *system, control_params *control,
       j_id = system->my_atoms[j].orig_id;
       BO_tmp = bonds->select.bond_list[pj].bo_data.BO;
       if( i_id != j_id && BO_tmp >= control->bg_cut ) {
-	++my_bonds_0;
-	system->my_atoms[i].nbr_id[my_bonds_0] = j_id;
-	system->my_atoms[i].nbr_bo[my_bonds_0] = BO_tmp;
+        ++my_bonds_0;
+        system->my_atoms[i].nbr_id[my_bonds_0] = j_id;
+        system->my_atoms[i].nbr_bo[my_bonds_0] = BO_tmp;
       }
     }
     my_bonds_max = MAX(my_bonds_0, my_bonds_max);
@@ -1095,114 +1095,114 @@ void fixspecies( reax_system *system, control_params *control,
 }
 
 
-void Output_Results( reax_system *system, control_params *control, 
-		     simulation_data *data, reax_list **lists, 
-		     output_controls *out_control, mpi_datatypes *mpi_data )
+void Output_Results( reax_system *system, control_params *control,
+                     simulation_data *data, reax_list **lists,
+                     output_controls *out_control, mpi_datatypes *mpi_data )
 {
 #if defined(LOG_PERFORMANCE)
   real t_elapsed, denom;
 #endif
 
-  if((out_control->energy_update_freq > 0 && 
+  if((out_control->energy_update_freq > 0 &&
       data->step%out_control->energy_update_freq == 0) ||
-     (out_control->write_steps > 0 && 
+     (out_control->write_steps > 0 &&
       data->step%out_control->write_steps == 0)){
     /* update system-wide energies */
     Compute_System_Energy( system, data, mpi_data->world );
-    
+
     /* output energies */
-    if( system->my_rank == MASTER_NODE && 
-	out_control->energy_update_freq > 0 &&
-	data->step % out_control->energy_update_freq == 0 ) {
+    if( system->my_rank == MASTER_NODE &&
+        out_control->energy_update_freq > 0 &&
+        data->step % out_control->energy_update_freq == 0 ) {
 #if !defined(DEBUG) && !defined(DEBUG_FOCUS)
 #if defined(PURE_REAX)
-      fprintf( out_control->out, 
-	       "%-6d%14.2f%14.2f%14.2f%11.2f%13.2f%13.5f\n",
-	       data->step, data->sys_en.e_tot, data->sys_en.e_pot, 
-	       E_CONV * data->sys_en.e_kin, data->therm.T,
-	       system->big_box.V, data->iso_bar.P );
+      fprintf( out_control->out,
+               "%-6d%14.2f%14.2f%14.2f%11.2f%13.2f%13.5f\n",
+               data->step, data->sys_en.e_tot, data->sys_en.e_pot,
+               E_CONV * data->sys_en.e_kin, data->therm.T,
+               system->big_box.V, data->iso_bar.P );
       fflush( out_control->out );
 #endif
 
-      fprintf( out_control->pot, 
-	       "%-6d%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f\n",
-	       data->step,
-	       data->sys_en.e_bond,
-	       data->sys_en.e_ov + data->sys_en.e_un,  data->sys_en.e_lp,
-	       data->sys_en.e_ang + data->sys_en.e_pen, data->sys_en.e_coa,
-	       data->sys_en.e_hb,
-	       data->sys_en.e_tor, data->sys_en.e_con, 
-	       data->sys_en.e_vdW, data->sys_en.e_ele, data->sys_en.e_pol);
+      fprintf( out_control->pot,
+               "%-6d%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f%14.2f\n",
+               data->step,
+               data->sys_en.e_bond,
+               data->sys_en.e_ov + data->sys_en.e_un,  data->sys_en.e_lp,
+               data->sys_en.e_ang + data->sys_en.e_pen, data->sys_en.e_coa,
+               data->sys_en.e_hb,
+               data->sys_en.e_tor, data->sys_en.e_con,
+               data->sys_en.e_vdW, data->sys_en.e_ele, data->sys_en.e_pol);
       fflush( out_control->pot );
 #else
 #if defined(PURE_REAX)
-      fprintf( out_control->out, 
-	       "%-6d%24.15e%24.15e%24.15e%13.5f%16.5f%13.5f\n",
-	       data->step, data->sys_en.e_tot, data->sys_en.e_pot,
-	       E_CONV * data->sys_en.e_kin, data->therm.T,
-	       system->big_box.V, data->iso_bar.P );
+      fprintf( out_control->out,
+               "%-6d%24.15e%24.15e%24.15e%13.5f%16.5f%13.5f\n",
+               data->step, data->sys_en.e_tot, data->sys_en.e_pot,
+               E_CONV * data->sys_en.e_kin, data->therm.T,
+               system->big_box.V, data->iso_bar.P );
       fflush( out_control->out );
 #endif
 
-      fprintf( out_control->pot, 
-	       "%-6d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n",
-	       data->step,
-	       data->sys_en.e_bond,
-	       data->sys_en.e_ov + data->sys_en.e_un,  data->sys_en.e_lp,
-	       data->sys_en.e_ang + data->sys_en.e_pen, data->sys_en.e_coa,
-	       data->sys_en.e_hb,
-	       data->sys_en.e_tor, data->sys_en.e_con, 
-	       data->sys_en.e_vdW, data->sys_en.e_ele, data->sys_en.e_pol);
+      fprintf( out_control->pot,
+               "%-6d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n",
+               data->step,
+               data->sys_en.e_bond,
+               data->sys_en.e_ov + data->sys_en.e_un,  data->sys_en.e_lp,
+               data->sys_en.e_ang + data->sys_en.e_pen, data->sys_en.e_coa,
+               data->sys_en.e_hb,
+               data->sys_en.e_tor, data->sys_en.e_con,
+               data->sys_en.e_vdW, data->sys_en.e_ele, data->sys_en.e_pol);
       fflush( out_control->pot );
 #endif //DEBUG
-      
+
 #if defined(LOG_PERFORMANCE)
       t_elapsed = Get_Timing_Info( data->timing.total );
       if( data->step - data->prev_steps > 0 )
-	denom = 1.0 / out_control->energy_update_freq;
+        denom = 1.0 / out_control->energy_update_freq;
       else denom = 1;
-      
+
       fprintf( out_control->log, "%6d%8.3f%8.3f%8.3f%8.3f%8.3f%8.3f%8.3f%6d\n",
-	       data->step, 
-	       t_elapsed * denom, 
-	       data->timing.comm * denom,
-	       data->timing.nbrs * denom,
-	       data->timing.init_forces * denom,
-	       data->timing.bonded * denom,
-	       data->timing.nonb * denom,
-	       data->timing.qEq * denom,
-	       (int)((data->timing.s_matvecs+data->timing.t_matvecs)*denom) );
-      
+               data->step,
+               t_elapsed * denom,
+               data->timing.comm * denom,
+               data->timing.nbrs * denom,
+               data->timing.init_forces * denom,
+               data->timing.bonded * denom,
+               data->timing.nonb * denom,
+               data->timing.qEq * denom,
+               (int)((data->timing.s_matvecs+data->timing.t_matvecs)*denom) );
+
       Reset_Timing( &(data->timing) );
       fflush( out_control->log );
 #endif //LOG_PERFORMANCE
-      
+
       if( control->virial ){
-	fprintf( out_control->prs, 
-		 "%8d%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f\n",
-		 data->step, 
-		 data->int_press[0], data->int_press[1], data->int_press[2],
-		 data->ext_press[0], data->ext_press[1], data->ext_press[2], 
-		 data->kin_press );
-	
-	fprintf( out_control->prs, 
-		 "%8s%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f\n",
-		 "",system->big_box.box_norms[0], system->big_box.box_norms[1], 
-		 system->big_box.box_norms[2],
-		 data->tot_press[0], data->tot_press[1], data->tot_press[2], 
-		 system->big_box.V );
-	
-	fflush( out_control->prs);
+        fprintf( out_control->prs,
+                 "%8d%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f\n",
+                 data->step,
+                 data->int_press[0], data->int_press[1], data->int_press[2],
+                 data->ext_press[0], data->ext_press[1], data->ext_press[2],
+                 data->kin_press );
+
+        fprintf( out_control->prs,
+                 "%8s%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f%13.6f\n",
+                 "",system->big_box.box_norms[0], system->big_box.box_norms[1],
+                 system->big_box.box_norms[2],
+                 data->tot_press[0], data->tot_press[1], data->tot_press[2],
+                 system->big_box.V );
+
+        fflush( out_control->prs);
       }
     }
-    
+
     /* write current frame */
-    if( out_control->write_steps > 0 && 
-	(data->step-data->prev_steps) % out_control->write_steps == 0 ) {
+    if( out_control->write_steps > 0 &&
+        (data->step-data->prev_steps) % out_control->write_steps == 0 ) {
       Append_Frame( system, control, data, lists, out_control, mpi_data );
     }
   }
-  
+
 #if defined(DEBUG)
   fprintf( stderr, "output_results... done\n" );
 #endif
@@ -1212,40 +1212,40 @@ void Output_Results( reax_system *system, control_params *control,
 #ifdef TEST_ENERGY
 void Debug_Marker_Bonded( output_controls *out_control, int step )
 {
-  fprintf( out_control->ebond, "step: %d\n%6s%6s%12s%12s%12s\n", 
-	   step, "atom1", "atom2", "bo", "ebond", "total" );
-  fprintf( out_control->elp, "step: %d\n%6s%12s%12s%12s\n", 
-	   step, "atom", "nlp", "elp", "total" );
-  fprintf( out_control->eov, "step: %d\n%6s%12s%12s\n", 
-	   step, "atom", "eov", "total" );
-  fprintf( out_control->eun, "step: %d\n%6s%12s%12s\n", 
-	   step, "atom", "eun", "total" );
-  fprintf( out_control->eval, "step: %d\n%6s%6s%6s%12s%12s%12s%12s%12s%12s\n", 
-	   step, "atom1", "atom2", "atom3", "angle", "theta0", 
-	   "bo(12)", "bo(23)", "eval", "total" );
-  fprintf( out_control->epen, "step: %d\n%6s%6s%6s%12s%12s%12s%12s%12s\n", 
-	   step, "atom1", "atom2", "atom3", "angle", "bo(12)", "bo(23)",
-	   "epen", "total" );
-  fprintf( out_control->ecoa, "step: %d\n%6s%6s%6s%12s%12s%12s%12s%12s\n", 
-	   step, "atom1", "atom2", "atom3", "angle", "bo(12)", "bo(23)",
-	   "ecoa", "total" );
-  fprintf( out_control->ehb,  "step: %d\n%6s%6s%6s%12s%12s%12s%12s%12s\n", 
-	   step, "atom1", "atom2", "atom3", "r(23)", "angle", "bo(12)", 
-	   "ehb", "total" );
-  fprintf( out_control->etor, "step: %d\n%6s%6s%6s%6s%12s%12s%12s%12s\n", 
-	   step, "atom1", "atom2", "atom3", "atom4", "phi", "bo(23)", 
-	   "etor", "total" );
+  fprintf( out_control->ebond, "step: %d\n%6s%6s%12s%12s%12s\n",
+           step, "atom1", "atom2", "bo", "ebond", "total" );
+  fprintf( out_control->elp, "step: %d\n%6s%12s%12s%12s\n",
+           step, "atom", "nlp", "elp", "total" );
+  fprintf( out_control->eov, "step: %d\n%6s%12s%12s\n",
+           step, "atom", "eov", "total" );
+  fprintf( out_control->eun, "step: %d\n%6s%12s%12s\n",
+           step, "atom", "eun", "total" );
+  fprintf( out_control->eval, "step: %d\n%6s%6s%6s%12s%12s%12s%12s%12s%12s\n",
+           step, "atom1", "atom2", "atom3", "angle", "theta0",
+           "bo(12)", "bo(23)", "eval", "total" );
+  fprintf( out_control->epen, "step: %d\n%6s%6s%6s%12s%12s%12s%12s%12s\n",
+           step, "atom1", "atom2", "atom3", "angle", "bo(12)", "bo(23)",
+           "epen", "total" );
+  fprintf( out_control->ecoa, "step: %d\n%6s%6s%6s%12s%12s%12s%12s%12s\n",
+           step, "atom1", "atom2", "atom3", "angle", "bo(12)", "bo(23)",
+           "ecoa", "total" );
+  fprintf( out_control->ehb,  "step: %d\n%6s%6s%6s%12s%12s%12s%12s%12s\n",
+           step, "atom1", "atom2", "atom3", "r(23)", "angle", "bo(12)",
+           "ehb", "total" );
+  fprintf( out_control->etor, "step: %d\n%6s%6s%6s%6s%12s%12s%12s%12s\n",
+           step, "atom1", "atom2", "atom3", "atom4", "phi", "bo(23)",
+           "etor", "total" );
   fprintf( out_control->econ,"step:%d\n%6s%6s%6s%6s%12s%12s%12s%12s%12s%12s\n",
-	   step, "atom1", "atom2", "atom3", "atom4", 
-	   "phi", "bo(12)", "bo(23)", "bo(34)", "econ", "total" );
+           step, "atom1", "atom2", "atom3", "atom4",
+           "phi", "bo(12)", "bo(23)", "bo(34)", "econ", "total" );
 }
 
 void Debug_Marker_Nonbonded( output_controls *out_control, int step )
 {
   fprintf( out_control->evdw, "step: %d\n%6s%6s%12s%12s%12s\n",
-	   step, "atom1", "atom2", "r12", "evdw", "total" );
+           step, "atom1", "atom2", "r12", "evdw", "total" );
   fprintf( out_control->ecou, "step: %d\n%6s%6s%12s%12s%12s%12s%12s\n",
-	   step, "atom1", "atom2", "r12", "q1", "q2", "ecou", "total" );
+           step, "atom1", "atom2", "r12", "q1", "q2", "ecou", "total" );
 }
 
 #endif
@@ -1253,16 +1253,16 @@ void Debug_Marker_Nonbonded( output_controls *out_control, int step )
 
 #ifdef TEST_FORCES
 void Dummy_Printer( reax_system *system, control_params *control,
-		    simulation_data *data, storage *workspace, 
-		    reax_list **lists, output_controls *out_control )
+                    simulation_data *data, storage *workspace,
+                    reax_list **lists, output_controls *out_control )
 {
 }
 
 
 
-void Print_Bond_Orders( reax_system *system, control_params *control, 
-			simulation_data *data, storage *workspace, 
-			reax_list **lists, output_controls *out_control )
+void Print_Bond_Orders( reax_system *system, control_params *control,
+                        simulation_data *data, storage *workspace,
+                        reax_list **lists, output_controls *out_control )
 {
   int i, pj, pk;
   bond_order_data *bo_ij;
@@ -1272,50 +1272,50 @@ void Print_Bond_Orders( reax_system *system, control_params *control,
 
   /* bond orders */
   fprintf( out_control->fbo, "step: %d\n", data->step );
-  fprintf( out_control->fbo, "%6s%6s%12s%12s%12s%12s%12s\n", 
-	   "atom1", "atom2", "r_ij", "total_bo", "bo_s", "bo_p", "bo_pp" );
-  
+  fprintf( out_control->fbo, "%6s%6s%12s%12s%12s%12s%12s\n",
+           "atom1", "atom2", "r_ij", "total_bo", "bo_s", "bo_p", "bo_pp" );
+
   for( i = 0; i < system->N; ++i )
     for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) {
-	bo_ij = &(bonds->select.bond_list[pj].bo_data);	
-	fprintf( out_control->fbo, 
-		 "%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e\n", 
-		 system->my_atoms[i].orig_id, 
-		 system->my_atoms[bonds->select.bond_list[pj].nbr].orig_id,
-		 bonds->select.bond_list[pj].d,
-		 bo_ij->BO, bo_ij->BO_s, bo_ij->BO_pi, bo_ij->BO_pi2 );
+        bo_ij = &(bonds->select.bond_list[pj].bo_data);
+        fprintf( out_control->fbo,
+                 "%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e\n",
+                 system->my_atoms[i].orig_id,
+                 system->my_atoms[bonds->select.bond_list[pj].nbr].orig_id,
+                 bonds->select.bond_list[pj].d,
+                 bo_ij->BO, bo_ij->BO_s, bo_ij->BO_pi, bo_ij->BO_pi2 );
     }
 
 
   /* derivatives of bond orders */
   fprintf( out_control->fdbo, "step: %d\n", data->step );
-  fprintf( out_control->fdbo, "%6s%6s%6s%24s%24s%24s\n", 
-	   "atom1", "atom2", "atom2", "dBO", "dBOpi", "dBOpi2" ); 
+  fprintf( out_control->fdbo, "%6s%6s%6s%24s%24s%24s\n",
+           "atom1", "atom2", "atom2", "dBO", "dBOpi", "dBOpi2" );
   for( i = 0; i < system->N; ++i )
     for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) {
-      /* fprintf( out_control->fdbo, "%6d %6d\tstart: %6d\tend: %6d\n", 
-	 system->my_atoms[i].orig_id, 
-	 system->my_atoms[bonds->select.bond_list[pj].nbr].orig_id,
-	 Start_Index( pj, dBOs ), End_Index( pj, dBOs ) ); */      
+      /* fprintf( out_control->fdbo, "%6d %6d\tstart: %6d\tend: %6d\n",
+         system->my_atoms[i].orig_id,
+         system->my_atoms[bonds->select.bond_list[pj].nbr].orig_id,
+         Start_Index( pj, dBOs ), End_Index( pj, dBOs ) ); */
       for( pk = Start_Index(pj, dBOs); pk < End_Index(pj, dBOs); ++pk ) {
-	dbo_k = &(dBOs->select.dbo_list[pk]);
-	fprintf( out_control->fdbo, "%6d%6d%6d%24.15e%24.15e%24.15e\n",
-		 system->my_atoms[i].orig_id, 
-		 system->my_atoms[bonds->select.bond_list[pj].nbr].orig_id,
-		 system->my_atoms[dbo_k->wrt].orig_id,
-		 dbo_k->dBO[0], dbo_k->dBO[1], dbo_k->dBO[2] );
-	
-	fprintf( out_control->fdbo, "%6d%6d%6d%24.15e%24.15e%24.15e\n",
-		 system->my_atoms[i].orig_id, 
-		 system->my_atoms[bonds->select.bond_list[pj].nbr].orig_id,
-		 system->my_atoms[dbo_k->wrt].orig_id,
-		 dbo_k->dBOpi[0], dbo_k->dBOpi[1], dbo_k->dBOpi[2] );
-	
-	fprintf( out_control->fdbo, "%6d%6d%6d%24.15e%24.15e%24.15e\n",
-		 system->my_atoms[i].orig_id, 
-		 system->my_atoms[bonds->select.bond_list[pj].nbr].orig_id,
-		 system->my_atoms[dbo_k->wrt].orig_id,
-		 dbo_k->dBOpi2[0], dbo_k->dBOpi2[1], dbo_k->dBOpi2[2] ); 
+        dbo_k = &(dBOs->select.dbo_list[pk]);
+        fprintf( out_control->fdbo, "%6d%6d%6d%24.15e%24.15e%24.15e\n",
+                 system->my_atoms[i].orig_id,
+                 system->my_atoms[bonds->select.bond_list[pj].nbr].orig_id,
+                 system->my_atoms[dbo_k->wrt].orig_id,
+                 dbo_k->dBO[0], dbo_k->dBO[1], dbo_k->dBO[2] );
+
+        fprintf( out_control->fdbo, "%6d%6d%6d%24.15e%24.15e%24.15e\n",
+                 system->my_atoms[i].orig_id,
+                 system->my_atoms[bonds->select.bond_list[pj].nbr].orig_id,
+                 system->my_atoms[dbo_k->wrt].orig_id,
+                 dbo_k->dBOpi[0], dbo_k->dBOpi[1], dbo_k->dBOpi[2] );
+
+        fprintf( out_control->fdbo, "%6d%6d%6d%24.15e%24.15e%24.15e\n",
+                 system->my_atoms[i].orig_id,
+                 system->my_atoms[bonds->select.bond_list[pj].nbr].orig_id,
+                 system->my_atoms[dbo_k->wrt].orig_id,
+                 dbo_k->dBOpi2[0], dbo_k->dBOpi2[1], dbo_k->dBOpi2[2] );
       }
     }
 }
@@ -1327,20 +1327,20 @@ void Print_Forces( FILE *f, storage *workspace, int N, int step )
 
   fprintf( f, "step: %d\n", step );
   for( i = 0; i < N; ++i )
-    //fprintf( f, "%6d %23.15e %23.15e %23.15e\n", 
-    //fprintf( f, "%6d%12.6f%12.6f%12.6f\n", 
-    fprintf( f, "%6d %19.9e %19.9e %19.9e\n", 
-	     workspace->id_all[i], workspace->f_all[i][0], 
-	     workspace->f_all[i][1], workspace->f_all[i][2] );	     
+    //fprintf( f, "%6d %23.15e %23.15e %23.15e\n",
+    //fprintf( f, "%6d%12.6f%12.6f%12.6f\n",
+    fprintf( f, "%6d %19.9e %19.9e %19.9e\n",
+             workspace->id_all[i], workspace->f_all[i][0],
+             workspace->f_all[i][1], workspace->f_all[i][2] );
 }
 
 
-void Print_Force_Files( reax_system *system, control_params *control, 
-		        simulation_data *data, storage *workspace, 
-		        reax_list **lists, output_controls *out_control, 
-			mpi_datatypes *mpi_data )
+void Print_Force_Files( reax_system *system, control_params *control,
+                        simulation_data *data, storage *workspace,
+                        reax_list **lists, output_controls *out_control,
+                        mpi_datatypes *mpi_data )
 {
-  int i, d; 
+  int i, d;
 
   Coll_ids_at_Master( system, workspace, mpi_data );
 
@@ -1400,12 +1400,12 @@ void Print_Force_Files( reax_system *system, control_params *control,
 
   for( i = 0; i < system->n; ++i ) {
     for( d = 0; d < 3; ++d )
-      workspace->f_tot[i][d] = workspace->f_be[i][d] + 
-	workspace->f_lp[i][d]+workspace->f_ov[i][d]+workspace->f_un[i][d] + 
-	workspace->f_ang[i][d]+workspace->f_pen[i][d]+workspace->f_coa[i][d] +
-	workspace->f_tor[i][d]+workspace->f_con[i][d] + 
-	workspace->f_vdw[i][d]+workspace->f_ele[i][d] +
-	workspace->f_hb[i][d];
+      workspace->f_tot[i][d] = workspace->f_be[i][d] +
+        workspace->f_lp[i][d]+workspace->f_ov[i][d]+workspace->f_un[i][d] +
+        workspace->f_ang[i][d]+workspace->f_pen[i][d]+workspace->f_coa[i][d] +
+        workspace->f_tor[i][d]+workspace->f_con[i][d] +
+        workspace->f_vdw[i][d]+workspace->f_ele[i][d] +
+        workspace->f_hb[i][d];
   }
 
   Coll_rvecs_at_Master( system, workspace, mpi_data, workspace->f_tot );
@@ -1415,13 +1415,13 @@ void Print_Force_Files( reax_system *system, control_params *control,
 #endif
 
 
-#if defined(TEST_FORCES) || defined(TEST_ENERGY) 
+#if defined(TEST_FORCES) || defined(TEST_ENERGY)
 
-void Print_Far_Neighbors_List( reax_system *system, reax_list **lists, 
-			       control_params *control, simulation_data *data, 
-			       output_controls *out_control )
+void Print_Far_Neighbors_List( reax_system *system, reax_list **lists,
+                               control_params *control, simulation_data *data,
+                               output_controls *out_control )
 {
-  int   i, j, id_i, id_j, nbr, natoms;  
+  int   i, j, id_i, id_j, nbr, natoms;
   int num=0;
   int temp[500];
   reax_list *far_nbrs;
@@ -1436,13 +1436,13 @@ void Print_Far_Neighbors_List( reax_system *system, reax_list **lists,
     id_i = system->my_atoms[i].orig_id;
     fprintf( out_control->flist, "%6d:",id_i);
     num=0;
-    
+
     for( j = Start_Index(i,far_nbrs); j < End_Index(i,far_nbrs); ++j ) {
       nbr = far_nbrs->select.far_nbr_list[j].nbr;
       id_j = system->my_atoms[nbr].orig_id;
       temp[num++] = id_j;
     }
-    
+
     qsort(&temp, num, sizeof(int), fn_qsort_intcmp);
     for(j=0; j < num; j++)
       fprintf(out_control->flist, "%6d",temp[j]);
@@ -1450,9 +1450,9 @@ void Print_Far_Neighbors_List( reax_system *system, reax_list **lists,
   }
 }
 
-void Print_Bond_List( reax_system *system, control_params *control, 
-		      simulation_data *data, reax_list **lists, 
-		      output_controls *out_control)
+void Print_Bond_List( reax_system *system, control_params *control,
+                      simulation_data *data, reax_list **lists,
+                      output_controls *out_control)
 {
   int i,j, id_i, id_j, nbr, pj;
   reax_list *bonds = (*lists) + BONDS;
@@ -1469,12 +1469,12 @@ void Print_Bond_List( reax_system *system, control_params *control,
     id_i = system->my_atoms[i].orig_id;
     fprintf( out_control->blist, "%6d:", id_i);
     for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) {
-      nbr = bonds->select.bond_list[pj].nbr;	
+      nbr = bonds->select.bond_list[pj].nbr;
       id_j = system->my_atoms[nbr].orig_id;
-      if( id_i < id_j ) 
-	temp[num++] = id_j;
+      if( id_i < id_j )
+        temp[num++] = id_j;
     }
-    
+
     qsort(&temp, num, sizeof(int), fn_qsort_intcmp);
     for(j=0; j < num; j++)
       fprintf(out_control->blist, "%6d",temp[j]);
@@ -1492,226 +1492,226 @@ void Print_Init_Atoms( reax_system *system, storage *workspace )
   int i;
 
   fprintf( stderr, "p%d had %d atoms\n",
-	   system->my_rank, workspace->init_cnt );
+           system->my_rank, workspace->init_cnt );
 
   for( i = 0; i < workspace->init_cnt; ++i )
     fprintf( stderr, "p%d, atom%d: %d  %s  %8.3f %8.3f %8.3f\n",
-	     system->my_rank, i, 
-	     workspace->init_atoms[i].type, workspace->init_atoms[i].name, 
-	     workspace->init_atoms[i].x[0], 
-	     workspace->init_atoms[i].x[1], 
-	     workspace->init_atoms[i].x[2] );
+             system->my_rank, i,
+             workspace->init_atoms[i].type, workspace->init_atoms[i].name,
+             workspace->init_atoms[i].x[0],
+             workspace->init_atoms[i].x[1],
+             workspace->init_atoms[i].x[2] );
 }
 #endif //OLD_VERSION
 
 
-/*void Print_Bond_Forces( reax_system *system, control_params *control, 
-			simulation_data *data, storage *workspace, 
-			reax_list **lists, output_controls *out_control )
+/*void Print_Bond_Forces( reax_system *system, control_params *control,
+                        simulation_data *data, storage *workspace,
+                        reax_list **lists, output_controls *out_control )
 {
   int i;
 
   fprintf( out_control->fbond, "step: %d\n", data->step );
-  fprintf( out_control->fbond, "%6s%24s%24s%24s\n", 
-	   "atom", "f_be[0]", "f_be[1]", "f_be[2]" ); 
-  
+  fprintf( out_control->fbond, "%6s%24s%24s%24s\n",
+           "atom", "f_be[0]", "f_be[1]", "f_be[2]" );
+
   for( i = 0; i < system->bigN; ++i )
     fprintf(out_control->fbond, "%6d%24.15e%24.15e%24.15e\n",
-	    system->my_atoms[i].orig_id, 
-	    workspace->f_all[i][0], workspace->f_all[i][1], 
-	    workspace->f_all[i][2]);
+            system->my_atoms[i].orig_id,
+            workspace->f_all[i][0], workspace->f_all[i][1],
+            workspace->f_all[i][2]);
 }
 
-void Print_LonePair_Forces( reax_system *system, control_params *control, 
-			    simulation_data *data, storage *workspace, 
-			    reax_list **lists, output_controls *out_control )
+void Print_LonePair_Forces( reax_system *system, control_params *control,
+                            simulation_data *data, storage *workspace,
+                            reax_list **lists, output_controls *out_control )
 {
   int i;
 
   fprintf( out_control->flp, "step: %d\n", data->step );
   fprintf( out_control->flp, "%6s%24s\n", "atom", "f_lonepair" );
-  
+
   for( i = 0; i < system->bigN; ++i )
     fprintf(out_control->flp, "%6d%24.15e%24.15e%24.15e\n",
-	    system->my_atoms[i].orig_id, 
-	    workspace->f_all[i][0], workspace->f_all[i][1], 
-	    workspace->f_all[i][2]);
+            system->my_atoms[i].orig_id,
+            workspace->f_all[i][0], workspace->f_all[i][1],
+            workspace->f_all[i][2]);
 }
 
 
 void Print_OverCoor_Forces( reax_system *system, control_params *control,
-			    simulation_data *data, storage *workspace, 
-			    reax_list **lists, output_controls *out_control )
+                            simulation_data *data, storage *workspace,
+                            reax_list **lists, output_controls *out_control )
 {
   int i;
 
   fprintf( out_control->fov, "step: %d\n", data->step );
-  fprintf( out_control->fov, "%6s%-38s%-38s%-38s\n", 
-	   "atom","f_over[0]", "f_over[1]", "f_over[2]" );
-  
+  fprintf( out_control->fov, "%6s%-38s%-38s%-38s\n",
+           "atom","f_over[0]", "f_over[1]", "f_over[2]" );
+
   for( i = 0; i < system->bigN; ++i )
-    fprintf( out_control->fov, 
-	     "%6d %24.15e%24.15e%24.15e 0 0 0\n",
-	     system->my_atoms[i].orig_id, 
-	     workspace->f_all[i][0], workspace->f_all[i][1], 
-	     workspace->f_all[i][2] );
+    fprintf( out_control->fov,
+             "%6d %24.15e%24.15e%24.15e 0 0 0\n",
+             system->my_atoms[i].orig_id,
+             workspace->f_all[i][0], workspace->f_all[i][1],
+             workspace->f_all[i][2] );
 }
 
 
 void Print_UnderCoor_Forces( reax_system *system, control_params *control,
-			     simulation_data *data, storage *workspace, 
-			     reax_list **lists, output_controls *out_control )
+                             simulation_data *data, storage *workspace,
+                             reax_list **lists, output_controls *out_control )
 {
   int i;
 
   fprintf( out_control->fun, "step: %d\n", data->step );
-  fprintf( out_control->fun, "%6s%-38s%-38s%-38s\n", 
-	   "atom","f_under[0]", "f_under[1]", "f_under[2]" );
-  
+  fprintf( out_control->fun, "%6s%-38s%-38s%-38s\n",
+           "atom","f_under[0]", "f_under[1]", "f_under[2]" );
+
   for( i = 0; i < system->bigN; ++i )
-    fprintf( out_control->fun, 
-	     "%6d %24.15e%24.15e%24.15e 0 0 0\n",
-	     system->my_atoms[i].orig_id, 
-	     workspace->f_all[i][0], workspace->f_all[i][1], 
-	     workspace->f_all[i][2] );
+    fprintf( out_control->fun,
+             "%6d %24.15e%24.15e%24.15e 0 0 0\n",
+             system->my_atoms[i].orig_id,
+             workspace->f_all[i][0], workspace->f_all[i][1],
+             workspace->f_all[i][2] );
 }
 
 
-void Print_ValAngle_Forces( reax_system *system, control_params *control, 
-			    simulation_data *data, storage *workspace, 
-			    reax_list **lists, output_controls *out_control )
+void Print_ValAngle_Forces( reax_system *system, control_params *control,
+                            simulation_data *data, storage *workspace,
+                            reax_list **lists, output_controls *out_control )
 {
   int j;
 
   fprintf( out_control->f3body, "step: %d\n", data->step );
-  fprintf( out_control->f3body, "%6s%-37s%-37s%-37s%-38s\n", 
-	   "atom", "3-body total", "f_ang", "f_pen", "f_coa" );
-  
+  fprintf( out_control->f3body, "%6s%-37s%-37s%-37s%-38s\n",
+           "atom", "3-body total", "f_ang", "f_pen", "f_coa" );
+
   for( j = 0; j < system->N; ++j ){
     if( rvec_isZero(workspace->f_pen[j]) && rvec_isZero(workspace->f_coa[j]) )
-      fprintf( out_control->f3body, 
-	       "%6d %24.15e%24.15e%24.15e  0 0 0  0 0 0\n",
-	       system->my_atoms[j].orig_id, 
-	       workspace->f_ang[j][0], workspace->f_ang[j][1], 
-	       workspace->f_ang[j][2] );
+      fprintf( out_control->f3body,
+               "%6d %24.15e%24.15e%24.15e  0 0 0  0 0 0\n",
+               system->my_atoms[j].orig_id,
+               workspace->f_ang[j][0], workspace->f_ang[j][1],
+               workspace->f_ang[j][2] );
     else if( rvec_isZero(workspace->f_coa[j]) )
-      fprintf( out_control->f3body, 
-	       "%6d %24.15e%24.15e%24.15e %24.15e%24.15e%24.15e "	\
-	       "%24.15e%24.15e%24.15e\n",
-	       system->my_atoms[j].orig_id, 
-	       workspace->f_ang[j][0] + workspace->f_pen[j][0],
-	       workspace->f_ang[j][1] + workspace->f_pen[j][1],
-	       workspace->f_ang[j][2] + workspace->f_pen[j][2],
-	       workspace->f_ang[j][0], workspace->f_ang[j][1],
-	       workspace->f_ang[j][2],
-	       workspace->f_pen[j][0], workspace->f_pen[j][1],
-	       workspace->f_pen[j][2] );
+      fprintf( out_control->f3body,
+               "%6d %24.15e%24.15e%24.15e %24.15e%24.15e%24.15e "        \
+               "%24.15e%24.15e%24.15e\n",
+               system->my_atoms[j].orig_id,
+               workspace->f_ang[j][0] + workspace->f_pen[j][0],
+               workspace->f_ang[j][1] + workspace->f_pen[j][1],
+               workspace->f_ang[j][2] + workspace->f_pen[j][2],
+               workspace->f_ang[j][0], workspace->f_ang[j][1],
+               workspace->f_ang[j][2],
+               workspace->f_pen[j][0], workspace->f_pen[j][1],
+               workspace->f_pen[j][2] );
     else{
       fprintf( out_control->f3body, "%6d %24.15e%24.15e%24.15e ",
-	     system->my_atoms[j].orig_id, 
-	       workspace->f_ang[j][0] + workspace->f_pen[j][0] + 
-	       workspace->f_coa[j][0],
-	       workspace->f_ang[j][1] + workspace->f_pen[j][1] + 
-	       workspace->f_coa[j][1],
-	       workspace->f_ang[j][2] + workspace->f_pen[j][2] + 
-	       workspace->f_coa[j][2] );
-    
-      fprintf( out_control->f3body, 
-	       "%24.15e%24.15e%24.15e %24.15e%24.15e%24.15e "\
-	       "%24.15e%24.15e%24.15e\n",
-	       workspace->f_ang[j][0], workspace->f_ang[j][1],
-	       workspace->f_ang[j][2],
-	       workspace->f_pen[j][0], workspace->f_pen[j][1],
-	       workspace->f_pen[j][2],
-	       workspace->f_coa[j][0], workspace->f_coa[j][1],
-	       workspace->f_coa[j][2] );
-	}
+             system->my_atoms[j].orig_id,
+               workspace->f_ang[j][0] + workspace->f_pen[j][0] +
+               workspace->f_coa[j][0],
+               workspace->f_ang[j][1] + workspace->f_pen[j][1] +
+               workspace->f_coa[j][1],
+               workspace->f_ang[j][2] + workspace->f_pen[j][2] +
+               workspace->f_coa[j][2] );
+
+      fprintf( out_control->f3body,
+               "%24.15e%24.15e%24.15e %24.15e%24.15e%24.15e "\
+               "%24.15e%24.15e%24.15e\n",
+               workspace->f_ang[j][0], workspace->f_ang[j][1],
+               workspace->f_ang[j][2],
+               workspace->f_pen[j][0], workspace->f_pen[j][1],
+               workspace->f_pen[j][2],
+               workspace->f_coa[j][0], workspace->f_coa[j][1],
+               workspace->f_coa[j][2] );
+        }
   }
 }
 
 
-void Print_Hydrogen_Bond_Forces( reax_system *system, control_params *control, 
-				 simulation_data *data, storage *workspace, 
-				 reax_list **lists, output_controls *out_control)
+void Print_Hydrogen_Bond_Forces( reax_system *system, control_params *control,
+                                 simulation_data *data, storage *workspace,
+                                 reax_list **lists, output_controls *out_control)
 {
   int j;
 
   fprintf( out_control->fhb, "step: %d\n", data->step );
   fprintf( out_control->fhb, "%6s\t%-38s\n", "atom", "f_hb[0,1,2]" );
-  
+
   for( j = 0; j < system->N; ++j )
     fprintf(out_control->fhb, "%6d%24.15e%24.15e%24.15e\n",
-	     system->my_atoms[j].orig_id, 
-	     workspace->f_hb[j][0], 
-	     workspace->f_hb[j][1], 
-	     workspace->f_hb[j][2] );
+             system->my_atoms[j].orig_id,
+             workspace->f_hb[j][0],
+             workspace->f_hb[j][1],
+             workspace->f_hb[j][2] );
 }
 
 
-void Print_Four_Body_Forces( reax_system *system, control_params *control, 
-			     simulation_data *data, storage *workspace, 
-			     reax_list **lists, output_controls *out_control )
+void Print_Four_Body_Forces( reax_system *system, control_params *control,
+                             simulation_data *data, storage *workspace,
+                             reax_list **lists, output_controls *out_control )
 {
   int j;
 
   fprintf( out_control->f4body, "step: %d\n", data->step );
-  fprintf( out_control->f4body, "%6s\t%-38s%-38s%-38s\n", 
-	   "atom", "4-body total", "f_tor", "f_con" );
+  fprintf( out_control->f4body, "%6s\t%-38s%-38s%-38s\n",
+           "atom", "4-body total", "f_tor", "f_con" );
 
   for( j = 0; j < system->N; ++j ){
     if( !rvec_isZero( workspace->f_con[j] ) )
-      fprintf( out_control->f4body, 
-	       "%6d %24.15e%24.15e%24.15e %24.15e%24.15e%24.15e "\
-	       "%24.15e%24.15e%24.15e\n",
-	     system->my_atoms[j].orig_id, 
-	       workspace->f_tor[j][0] + workspace->f_con[j][0], 
-	       workspace->f_tor[j][1] + workspace->f_con[j][1], 
-	       workspace->f_tor[j][2] + workspace->f_con[j][2],
-	       workspace->f_tor[j][0], workspace->f_tor[j][1], 
-	       workspace->f_tor[j][2],
-	       workspace->f_con[j][0], workspace->f_con[j][1], 
-	       workspace->f_con[j][2] );
+      fprintf( out_control->f4body,
+               "%6d %24.15e%24.15e%24.15e %24.15e%24.15e%24.15e "\
+               "%24.15e%24.15e%24.15e\n",
+             system->my_atoms[j].orig_id,
+               workspace->f_tor[j][0] + workspace->f_con[j][0],
+               workspace->f_tor[j][1] + workspace->f_con[j][1],
+               workspace->f_tor[j][2] + workspace->f_con[j][2],
+               workspace->f_tor[j][0], workspace->f_tor[j][1],
+               workspace->f_tor[j][2],
+               workspace->f_con[j][0], workspace->f_con[j][1],
+               workspace->f_con[j][2] );
     else
-      fprintf( out_control->f4body, 
-	       "%6d %24.15e%24.15e%24.15e  0 0 0\n",
-	       system->my_atoms[j].orig_id, workspace->f_tor[j][0],
-	       workspace->f_tor[j][1], workspace->f_tor[j][2] );
+      fprintf( out_control->f4body,
+               "%6d %24.15e%24.15e%24.15e  0 0 0\n",
+               system->my_atoms[j].orig_id, workspace->f_tor[j][0],
+               workspace->f_tor[j][1], workspace->f_tor[j][2] );
   }
 
 }
 
 
-void Print_vdW_Coulomb_Forces( reax_system *system, control_params *control, 
-			       simulation_data *data, storage *workspace, 
-			       reax_list **lists, output_controls *out_control )
+void Print_vdW_Coulomb_Forces( reax_system *system, control_params *control,
+                               simulation_data *data, storage *workspace,
+                               reax_list **lists, output_controls *out_control )
 {
   int  i;
 
   return;
 
   fprintf( out_control->fnonb, "step: %d\n", data->step );
-  fprintf( out_control->fnonb, "%6s\t%-38s%-38s%-38s\n", 
-	   "atom", "nonbonded_total[0,1,2]", "f_vdw[0,1,2]", "f_ele[0,1,2]" );
+  fprintf( out_control->fnonb, "%6s\t%-38s%-38s%-38s\n",
+           "atom", "nonbonded_total[0,1,2]", "f_vdw[0,1,2]", "f_ele[0,1,2]" );
 
   for( i = 0; i < system->N; ++i )
-    fprintf( out_control->fnonb, 
-	     "%6d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n", 
-	     system->my_atoms[i].orig_id, 
-	     workspace->f_vdw[i][0] + workspace->f_ele[i][0],
-	     workspace->f_vdw[i][1] + workspace->f_ele[i][1], 
-	     workspace->f_vdw[i][2] + workspace->f_ele[i][2],
-	     workspace->f_vdw[i][0], 
-	     workspace->f_vdw[i][1], 
-	     workspace->f_vdw[i][2],
-	     workspace->f_ele[i][0], 
-	     workspace->f_ele[i][1], 
-	     workspace->f_ele[i][2] );
+    fprintf( out_control->fnonb,
+             "%6d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n",
+             system->my_atoms[i].orig_id,
+             workspace->f_vdw[i][0] + workspace->f_ele[i][0],
+             workspace->f_vdw[i][1] + workspace->f_ele[i][1],
+             workspace->f_vdw[i][2] + workspace->f_ele[i][2],
+             workspace->f_vdw[i][0],
+             workspace->f_vdw[i][1],
+             workspace->f_vdw[i][2],
+             workspace->f_ele[i][0],
+             workspace->f_ele[i][1],
+             workspace->f_ele[i][2] );
 }
 
 
-void Print_Total_Force( reax_system *system, control_params *control, 
-			simulation_data *data, storage *workspace, 
-			reax_list **lists, output_controls *out_control )
+void Print_Total_Force( reax_system *system, control_params *control,
+                        simulation_data *data, storage *workspace,
+                        reax_list **lists, output_controls *out_control )
 {
   int    i;
 
@@ -1721,50 +1721,50 @@ void Print_Total_Force( reax_system *system, control_params *control,
   fprintf( out_control->ftot, "%6s\t%-38s\n", "atom", "atom.f[0,1,2]");
 
   for( i = 0; i < system->n; ++i )
-    fprintf( out_control->ftot, "%6d%24.15e%24.15e%24.15e\n", 
-	     system->my_atoms[i].orig_id,
-	     system->my_atoms[i].f[0], 
-	     system->my_atoms[i].f[1], 
-	     system->my_atoms[i].f[2] );
+    fprintf( out_control->ftot, "%6d%24.15e%24.15e%24.15e\n",
+             system->my_atoms[i].orig_id,
+             system->my_atoms[i].f[0],
+             system->my_atoms[i].f[1],
+             system->my_atoms[i].f[2] );
 }
 
 
-void Compare_Total_Forces( reax_system *system, control_params *control, 
-			   simulation_data *data, storage *workspace, 
-			   reax_list **lists, output_controls *out_control )
+void Compare_Total_Forces( reax_system *system, control_params *control,
+                           simulation_data *data, storage *workspace,
+                           reax_list **lists, output_controls *out_control )
 {
   int i;
 
   return;
 
   fprintf( out_control->ftot2, "step: %d\n", data->step );
-  fprintf( out_control->ftot2, "%6s\t%-38s%-38s\n", 
-	   "atom", "f_total[0,1,2]", "test_force_total[0,1,2]" );
+  fprintf( out_control->ftot2, "%6s\t%-38s%-38s\n",
+           "atom", "f_total[0,1,2]", "test_force_total[0,1,2]" );
 
   for( i = 0; i < system->N; ++i )
-    fprintf( out_control->ftot2, "%6d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n", 
-	     system->my_atoms[i].orig_id,
-	     system->my_atoms[i].f[0], 
-	     system->my_atoms[i].f[1], 
-	     system->my_atoms[i].f[2],
-	     workspace->f_be[i][0] + workspace->f_lp[i][0] + 
-	     workspace->f_ov[i][0] + workspace->f_un[i][0] + 
-	     workspace->f_ang[i][0]+ workspace->f_pen[i][0]+ 
-	     workspace->f_coa[i][0]+ + workspace->f_hb[i][0] + 
-	     workspace->f_tor[i][0] + workspace->f_con[i][0] + 
-	     workspace->f_vdw[i][0] + workspace->f_ele[i][0],
-	     workspace->f_be[i][1] + workspace->f_lp[i][1] + 
-	     workspace->f_ov[i][1] + workspace->f_un[i][1] + 
-             workspace->f_ang[i][1]+ workspace->f_pen[i][1]+ 
-	     workspace->f_coa[i][1]+ + workspace->f_hb[i][1] + 
-	     workspace->f_tor[i][1] + workspace->f_con[i][1] + 
-	     workspace->f_vdw[i][1] + workspace->f_ele[i][1], 
-	     workspace->f_be[i][2] + workspace->f_lp[i][2] + 
-	     workspace->f_ov[i][2] + workspace->f_un[i][2] + 
-             workspace->f_ang[i][2]+ workspace->f_pen[i][2] + 
-	     workspace->f_coa[i][2]+ + workspace->f_hb[i][2] + 
-	     workspace->f_tor[i][2] + workspace->f_con[i][2] + 
-	     workspace->f_vdw[i][2] + workspace->f_ele[i][2] );
+    fprintf( out_control->ftot2, "%6d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n",
+             system->my_atoms[i].orig_id,
+             system->my_atoms[i].f[0],
+             system->my_atoms[i].f[1],
+             system->my_atoms[i].f[2],
+             workspace->f_be[i][0] + workspace->f_lp[i][0] +
+             workspace->f_ov[i][0] + workspace->f_un[i][0] +
+             workspace->f_ang[i][0]+ workspace->f_pen[i][0]+
+             workspace->f_coa[i][0]+ + workspace->f_hb[i][0] +
+             workspace->f_tor[i][0] + workspace->f_con[i][0] +
+             workspace->f_vdw[i][0] + workspace->f_ele[i][0],
+             workspace->f_be[i][1] + workspace->f_lp[i][1] +
+             workspace->f_ov[i][1] + workspace->f_un[i][1] +
+             workspace->f_ang[i][1]+ workspace->f_pen[i][1]+
+             workspace->f_coa[i][1]+ + workspace->f_hb[i][1] +
+             workspace->f_tor[i][1] + workspace->f_con[i][1] +
+             workspace->f_vdw[i][1] + workspace->f_ele[i][1],
+             workspace->f_be[i][2] + workspace->f_lp[i][2] +
+             workspace->f_ov[i][2] + workspace->f_un[i][2] +
+             workspace->f_ang[i][2]+ workspace->f_pen[i][2] +
+             workspace->f_coa[i][2]+ + workspace->f_hb[i][2] +
+             workspace->f_tor[i][2] + workspace->f_con[i][2] +
+             workspace->f_vdw[i][2] + workspace->f_ele[i][2] );
 }*/
 
 /*void Init_Force_Test_Functions( )
diff --git a/src/USER-REAXC/reaxc_io_tools.h b/src/USER-REAXC/reaxc_io_tools.h
index 5b775bd78b..72847731aa 100644
--- a/src/USER-REAXC/reaxc_io_tools.h
+++ b/src/USER-REAXC/reaxc_io_tools.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -29,10 +29,10 @@
 
 #include "reaxc_types.h"
 
-int Init_Output_Files( reax_system*, control_params*, 
-		       output_controls*, mpi_datatypes*, char* );
-int Close_Output_Files( reax_system*, control_params*,  
-			output_controls*, mpi_datatypes* );
+int Init_Output_Files( reax_system*, control_params*,
+                       output_controls*, mpi_datatypes*, char* );
+int Close_Output_Files( reax_system*, control_params*,
+                        output_controls*, mpi_datatypes* );
 
 void  Print_Box( simulation_box*, char*, FILE* );
 
@@ -54,63 +54,63 @@ void  Print_Charges( reax_system* );
 void  Print_Bonds( reax_system*, reax_list*, char* );
 void  Print_Bond_List2( reax_system*, reax_list*, char* );
 void  Print_Total_Force( reax_system*, simulation_data*, storage* );
-void  Output_Results( reax_system*, control_params*, simulation_data*, 
-		      reax_list**, output_controls*, mpi_datatypes* );
-void  fixbond( reax_system*, control_params*, simulation_data*, 
-		      reax_list**, output_controls*, mpi_datatypes* );
-void  fixspecies( reax_system*, control_params*, simulation_data*, 
-		      reax_list**, output_controls*, mpi_datatypes* );
-
-#if defined(DEBUG_FOCUS) || defined(TEST_FORCES) || defined(TEST_ENERGY) 
+void  Output_Results( reax_system*, control_params*, simulation_data*,
+                      reax_list**, output_controls*, mpi_datatypes* );
+void  fixbond( reax_system*, control_params*, simulation_data*,
+                      reax_list**, output_controls*, mpi_datatypes* );
+void  fixspecies( reax_system*, control_params*, simulation_data*,
+                      reax_list**, output_controls*, mpi_datatypes* );
+
+#if defined(DEBUG_FOCUS) || defined(TEST_FORCES) || defined(TEST_ENERGY)
 void Debug_Marker_Bonded( output_controls*, int );
 void Debug_Marker_Nonbonded( output_controls*, int );
-void  Print_Near_Neighbors_List( reax_system*, reax_list**, control_params*, 
-				 simulation_data*, output_controls* );
-void  Print_Far_Neighbors_List( reax_system*, reax_list**, control_params*, 
-				simulation_data*, output_controls* );
-void  Print_Bond_List( reax_system*, control_params*, simulation_data*, 
-		       reax_list**, output_controls* );
-/*void Dummy_Printer( reax_system*, control_params*, simulation_data*, 
-		    storage*, reax_list**, output_controls* );
-void Print_Bond_Orders( reax_system*, control_params*, simulation_data*, 
-			storage*, reax_list**, output_controls* );
-void Print_Bond_Forces( reax_system*, control_params*, simulation_data*, 
-			storage*, reax_list**, output_controls* );
-void Print_LonePair_Forces( reax_system*, control_params*, simulation_data*, 
-			    storage*, reax_list**, output_controls* );
-void Print_OverUnderCoor_Forces( reax_system*, control_params*, 
-				 simulation_data*, storage*, reax_list**, 
-				 output_controls* );
-void Print_Three_Body_Forces( reax_system*, control_params*, simulation_data*, 
-				 storage*, reax_list**, output_controls* );
-void Print_Hydrogen_Bond_Forces( reax_system*, control_params*, 
-				 simulation_data*, storage*, reax_list**, 
-				 output_controls* );
-void Print_Four_Body_Forces( reax_system*, control_params*, simulation_data*, 
-				 storage*, reax_list**, output_controls* );
-void Print_vdW_Coulomb_Forces( reax_system*, control_params*, 
-			       simulation_data*, storage*, reax_list**, 
-			       output_controls* );
-void Print_Total_Force( reax_system*, control_params*, simulation_data*, 
-			storage*, reax_list**, output_controls* );
-void Compare_Total_Forces( reax_system*, control_params*, simulation_data*, 
+void  Print_Near_Neighbors_List( reax_system*, reax_list**, control_params*,
+                                 simulation_data*, output_controls* );
+void  Print_Far_Neighbors_List( reax_system*, reax_list**, control_params*,
+                                simulation_data*, output_controls* );
+void  Print_Bond_List( reax_system*, control_params*, simulation_data*,
+                       reax_list**, output_controls* );
+/*void Dummy_Printer( reax_system*, control_params*, simulation_data*,
+                    storage*, reax_list**, output_controls* );
+void Print_Bond_Orders( reax_system*, control_params*, simulation_data*,
+                        storage*, reax_list**, output_controls* );
+void Print_Bond_Forces( reax_system*, control_params*, simulation_data*,
+                        storage*, reax_list**, output_controls* );
+void Print_LonePair_Forces( reax_system*, control_params*, simulation_data*,
+                            storage*, reax_list**, output_controls* );
+void Print_OverUnderCoor_Forces( reax_system*, control_params*,
+                                 simulation_data*, storage*, reax_list**,
+                                 output_controls* );
+void Print_Three_Body_Forces( reax_system*, control_params*, simulation_data*,
+                                 storage*, reax_list**, output_controls* );
+void Print_Hydrogen_Bond_Forces( reax_system*, control_params*,
+                                 simulation_data*, storage*, reax_list**,
+                                 output_controls* );
+void Print_Four_Body_Forces( reax_system*, control_params*, simulation_data*,
+                                 storage*, reax_list**, output_controls* );
+void Print_vdW_Coulomb_Forces( reax_system*, control_params*,
+                               simulation_data*, storage*, reax_list**,
+                               output_controls* );
+void Print_Total_Force( reax_system*, control_params*, simulation_data*,
+                        storage*, reax_list**, output_controls* );
+void Compare_Total_Forces( reax_system*, control_params*, simulation_data*,
 storage*, reax_list**, output_controls* );*/
 //void  Print_Total_Force( reax_system*, control_params* );
-void Print_Force_Files( reax_system*, control_params*, simulation_data*, 
-			storage*, reax_list**, output_controls*, 
-			mpi_datatypes * );
+void Print_Force_Files( reax_system*, control_params*, simulation_data*,
+                        storage*, reax_list**, output_controls*,
+                        mpi_datatypes * );
 //void Init_Force_Test_Functions( );
 
-int fn_qsort_intcmp( const void *, const void * ); 
+int fn_qsort_intcmp( const void *, const void * );
 
-void Print_Far_Neighbors_List( reax_system*, reax_list**, control_params*, 
-			       simulation_data*, output_controls* );
+void Print_Far_Neighbors_List( reax_system*, reax_list**, control_params*,
+                               simulation_data*, output_controls* );
 
 void Print_Near_Neighbors_List( reax_system*, reax_list**, control_params*,
-				simulation_data*, output_controls* );
+                                simulation_data*, output_controls* );
 
-void Print_Bond_List( reax_system*, control_params*, simulation_data*, 
-		      reax_list**, output_controls*);
+void Print_Bond_List( reax_system*, control_params*, simulation_data*,
+                      reax_list**, output_controls*);
 
 #endif
 #endif
diff --git a/src/USER-REAXC/reaxc_list.cpp b/src/USER-REAXC/reaxc_list.cpp
index 6eab487af0..9a6ee51b1f 100644
--- a/src/USER-REAXC/reaxc_list.cpp
+++ b/src/USER-REAXC/reaxc_list.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -38,10 +38,10 @@
 int Make_List(int n, int num_intrs, int type, reax_list *l, MPI_Comm comm)
 {
   l->allocated = 1;
-  
+
   l->n = n;
   l->num_intrs = num_intrs;
-    
+
   l->index = (int*) smalloc( n * sizeof(int), "list:index", comm );
   l->end_index = (int*) smalloc( n * sizeof(int), "list:end_index", comm );
 
@@ -54,38 +54,38 @@ int Make_List(int n, int num_intrs, int type, reax_list *l, MPI_Comm comm)
   case TYP_VOID:
     l->select.v = (void*) smalloc(l->num_intrs * sizeof(void*), "list:v", comm);
     break;
-    
+
   case TYP_THREE_BODY:
-    l->select.three_body_list = (three_body_interaction_data*) 
-      smalloc( l->num_intrs * sizeof(three_body_interaction_data), 
-	       "list:three_bodies", comm );
+    l->select.three_body_list = (three_body_interaction_data*)
+      smalloc( l->num_intrs * sizeof(three_body_interaction_data),
+               "list:three_bodies", comm );
     break;
-    
+
   case TYP_BOND:
-    l->select.bond_list = (bond_data*) 
+    l->select.bond_list = (bond_data*)
       smalloc( l->num_intrs * sizeof(bond_data), "list:bonds", comm );
     break;
-    
+
   case TYP_DBO:
-    l->select.dbo_list = (dbond_data*) 
+    l->select.dbo_list = (dbond_data*)
       smalloc( l->num_intrs * sizeof(dbond_data), "list:dbonds", comm );
     break;
-    
+
   case TYP_DDELTA:
-    l->select.dDelta_list = (dDelta_data*) 
+    l->select.dDelta_list = (dDelta_data*)
       smalloc( l->num_intrs * sizeof(dDelta_data), "list:dDeltas", comm );
     break;
-    
+
   case TYP_FAR_NEIGHBOR:
-    l->select.far_nbr_list = (far_neighbor_data*) 
+    l->select.far_nbr_list = (far_neighbor_data*)
       smalloc(l->num_intrs * sizeof(far_neighbor_data), "list:far_nbrs", comm);
     break;
-        
+
   case TYP_HBOND:
     l->select.hbond_list = (hbond_data*)
       smalloc( l->num_intrs * sizeof(hbond_data), "list:hbonds", comm );
-    break;			
-    
+    break;
+
   default:
     fprintf( stderr, "ERROR: no %d list type defined!\n", l->type );
     MPI_Abort( comm, INVALID_INPUT );
@@ -103,7 +103,7 @@ void Delete_List( reax_list *l, MPI_Comm comm )
 
   sfree( l->index, "list:index" );
   sfree( l->end_index, "list:end_index" );
-  
+
   switch(l->type) {
   case TYP_VOID:
     sfree( l->select.v, "list:v" );
diff --git a/src/USER-REAXC/reaxc_list.h b/src/USER-REAXC/reaxc_list.h
index 39ca1b973e..ab7fbce19c 100644
--- a/src/USER-REAXC/reaxc_list.h
+++ b/src/USER-REAXC/reaxc_list.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
diff --git a/src/USER-REAXC/reaxc_lookup.cpp b/src/USER-REAXC/reaxc_lookup.cpp
index 9f6396fdfb..aa7b069afa 100644
--- a/src/USER-REAXC/reaxc_lookup.cpp
+++ b/src/USER-REAXC/reaxc_lookup.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -38,20 +38,20 @@
 LR_lookup_table **LR;
 
 /* Fills solution into x. Warning: will modify c and d! */
-void Tridiagonal_Solve( const real *a, const real *b, 
-			real *c, real *d, real *x, unsigned int n){
+void Tridiagonal_Solve( const real *a, const real *b,
+                        real *c, real *d, real *x, unsigned int n){
   int i;
   real id;
- 
+
   /* Modify the coefficients. */
-  c[0] /= b[0];	/* Division by zero risk. */
-  d[0] /= b[0];	/* Division by zero would imply a singular matrix. */
+  c[0] /= b[0];        /* Division by zero risk. */
+  d[0] /= b[0];        /* Division by zero would imply a singular matrix. */
   for(i = 1; i < n; i++){
     id = (b[i] - c[i-1] * a[i]);  /* Division by zero risk. */
-    c[i] /= id;	        /* Last value calculated is redundant. */
+    c[i] /= id;                /* Last value calculated is redundant. */
     d[i] = (d[i] - d[i-1] * a[i])/id;
   }
-  
+
   /* Now back substitute. */
   x[n - 1] = d[n - 1];
   for(i = n - 2; i >= 0; i--)
@@ -59,9 +59,9 @@ void Tridiagonal_Solve( const real *a, const real *b,
 }
 
 
-void Natural_Cubic_Spline( const real *h, const real *f, 
-			   cubic_spline_coef *coef, unsigned int n, 
-			   MPI_Comm comm )
+void Natural_Cubic_Spline( const real *h, const real *f,
+                           cubic_spline_coef *coef, unsigned int n,
+                           MPI_Comm comm )
 {
   int i;
   real *a, *b, *c, *d, *v;
@@ -80,7 +80,7 @@ void Natural_Cubic_Spline( const real *h, const real *f,
 
   b[0] = b[n-1] = 0;
   for( i = 1; i < n-1; ++i )
-    b[i] = 2 * (h[i-1] + h[i]); 
+    b[i] = 2 * (h[i-1] + h[i]);
 
   c[0] = c[n-2] = c[n-1] = 0;
   for( i = 1; i < n-2; ++i )
@@ -89,11 +89,11 @@ void Natural_Cubic_Spline( const real *h, const real *f,
   d[0] = d[n-1] = 0;
   for( i = 1; i < n-1; ++i )
     d[i] = 6 * ((f[i+1]-f[i])/h[i] - (f[i]-f[i-1])/h[i-1]);
-  
+
   v[0] = 0;
   v[n-1] = 0;
   Tridiagonal_Solve( &(a[1]), &(b[1]), &(c[1]), &(d[1]), &(v[1]), n-2 );
-  
+
   for( i = 1; i < n; ++i ){
     coef[i-1].d = (v[i] - v[i-1]) / (6*h[i-1]);
     coef[i-1].c = v[i]/2;
@@ -111,8 +111,8 @@ void Natural_Cubic_Spline( const real *h, const real *f,
 
 
 void Complete_Cubic_Spline( const real *h, const real *f, real v0, real vlast,
-			    cubic_spline_coef *coef, unsigned int n, 
-			    MPI_Comm comm )
+                            cubic_spline_coef *coef, unsigned int n,
+                            MPI_Comm comm )
 {
   int i;
   real *a, *b, *c, *d, *v;
@@ -131,13 +131,13 @@ void Complete_Cubic_Spline( const real *h, const real *f, real v0, real vlast,
 
   b[0] = 2*h[0];
   for( i = 1; i < n; ++i )
-    b[i] = 2 * (h[i-1] + h[i]); 
+    b[i] = 2 * (h[i-1] + h[i]);
 
   c[n-1] = 0;
   for( i = 0; i < n-1; ++i )
     c[i] = h[i];
 
-  d[0] = 6 * (f[1]-f[0])/h[0] - 6 * v0;   
+  d[0] = 6 * (f[1]-f[0])/h[0] - 6 * v0;
   d[n-1] = 6 * vlast - 6 * (f[n-1]-f[n-2]/h[n-2]);
   for( i = 1; i < n-1; ++i )
     d[i] = 6 * ((f[i+1]-f[i])/h[i] - (f[i]-f[i-1])/h[i-1]);
@@ -169,12 +169,12 @@ void LR_Lookup( LR_lookup_table *t, real r, LR_data *y )
   base = (real)(i+1) * t->dx;
   dif = r - base;
 
-  y->e_vdW = ((t->vdW[i].d*dif + t->vdW[i].c)*dif + t->vdW[i].b)*dif + 
+  y->e_vdW = ((t->vdW[i].d*dif + t->vdW[i].c)*dif + t->vdW[i].b)*dif +
     t->vdW[i].a;
-  y->CEvd = ((t->CEvd[i].d*dif + t->CEvd[i].c)*dif + 
-	     t->CEvd[i].b)*dif + t->CEvd[i].a;
+  y->CEvd = ((t->CEvd[i].d*dif + t->CEvd[i].c)*dif +
+             t->CEvd[i].b)*dif + t->CEvd[i].a;
 
-  y->e_ele = ((t->ele[i].d*dif + t->ele[i].c)*dif + t->ele[i].b)*dif + 
+  y->e_ele = ((t->ele[i].d*dif + t->ele[i].c)*dif + t->ele[i].b)*dif +
     t->ele[i].a;
   y->CEclmb = ((t->CEclmb[i].d*dif + t->CEclmb[i].c)*dif + t->CEclmb[i].b)*dif +
     t->CEclmb[i].a;
@@ -183,8 +183,8 @@ void LR_Lookup( LR_lookup_table *t, real r, LR_data *y )
 }
 
 
-int Init_Lookup_Tables( reax_system *system, control_params *control, 
-			storage *workspace, mpi_datatypes *mpi_data, char *msg )
+int Init_Lookup_Tables( reax_system *system, control_params *control,
+                        storage *workspace, mpi_datatypes *mpi_data, char *msg )
 {
   int i, j, r;
   int num_atom_types;
@@ -203,25 +203,25 @@ int Init_Lookup_Tables( reax_system *system, control_params *control,
 
   num_atom_types = system->reax_param.num_atom_types;
   dr = control->nonb_cut / control->tabulate;
-  h = (real*) 
+  h = (real*)
     smalloc( (control->tabulate+2) * sizeof(real), "lookup:h", comm );
-  fh = (real*) 
+  fh = (real*)
     smalloc( (control->tabulate+2) * sizeof(real), "lookup:fh", comm );
-  fvdw = (real*) 
+  fvdw = (real*)
     smalloc( (control->tabulate+2) * sizeof(real), "lookup:fvdw", comm );
-  fCEvd = (real*) 
+  fCEvd = (real*)
     smalloc( (control->tabulate+2) * sizeof(real), "lookup:fCEvd", comm );
-  fele = (real*) 
+  fele = (real*)
     smalloc( (control->tabulate+2) * sizeof(real), "lookup:fele", comm );
-  fCEclmb = (real*) 
+  fCEclmb = (real*)
     smalloc( (control->tabulate+2) * sizeof(real), "lookup:fCEclmb", comm );
-  
-  /* allocate Long-Range LookUp Table space based on 
+
+  /* allocate Long-Range LookUp Table space based on
      number of atom types in the ffield file */
-  LR = (LR_lookup_table**) 
+  LR = (LR_lookup_table**)
     scalloc( num_atom_types, sizeof(LR_lookup_table*), "lookup:LR", comm );
   for( i = 0; i < num_atom_types; ++i )
-    LR[i] = (LR_lookup_table*) 
+    LR[i] = (LR_lookup_table*)
       scalloc( num_atom_types, sizeof(LR_lookup_table), "lookup:LR[i]", comm );
 
   /* most atom types in ffield file will not exist in the current
@@ -232,8 +232,8 @@ int Init_Lookup_Tables( reax_system *system, control_params *control,
   for( i = 0; i < system->n; ++i )
     existing_types[ system->my_atoms[i].type ] = 1;
 
-  MPI_Allreduce( existing_types, aggregated, MAX_ATOM_TYPES, 
-		 MPI_INT, MPI_SUM, mpi_data->world );
+  MPI_Allreduce( existing_types, aggregated, MAX_ATOM_TYPES,
+                 MPI_INT, MPI_SUM, mpi_data->world );
 
   /* fill in the lookup table entries for existing atom types.
      only lower half should be enough. */
@@ -241,75 +241,75 @@ int Init_Lookup_Tables( reax_system *system, control_params *control,
     if( aggregated[i] )
       //for( j = 0; 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;
-	  LR[i][j].n = control->tabulate + 2;
-	  LR[i][j].dx = dr;
-	  LR[i][j].inv_dx = control->tabulate / control->nonb_cut;
-	  LR[i][j].y = (LR_data*) 
-	    smalloc( LR[i][j].n * sizeof(LR_data), "lookup:LR[i,j].y", comm );
-	  LR[i][j].H = (cubic_spline_coef*) 
-	    smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].H" , 
-		     comm );
-	  LR[i][j].vdW = (cubic_spline_coef*) 
-	    smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].vdW",
-		     comm);
-	  LR[i][j].CEvd = (cubic_spline_coef*) 
-	    smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].CEvd",
-		     comm);
-	  LR[i][j].ele = (cubic_spline_coef*) 
-	    smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].ele", 
-		     comm );
-	  LR[i][j].CEclmb = (cubic_spline_coef*) 
-	    smalloc( LR[i][j].n*sizeof(cubic_spline_coef), 
-		     "lookup:LR[i,j].CEclmb", comm );
-	  
-	  for( r = 1; r <= control->tabulate; ++r ) {
-	    LR_vdW_Coulomb( system, workspace, control, i, j, r * dr, &(LR[i][j].y[r]) );
-	    h[r] = LR[i][j].dx;
-	    fh[r] = LR[i][j].y[r].H;
-	    fvdw[r] = LR[i][j].y[r].e_vdW;
-	    fCEvd[r] = LR[i][j].y[r].CEvd;
-	    fele[r] = LR[i][j].y[r].e_ele;
-	    fCEclmb[r] = LR[i][j].y[r].CEclmb;
-	  }
-
-	  // init the start-end points
-	  h[r] = LR[i][j].dx;
-	  v0_vdw = LR[i][j].y[1].CEvd;
-	  v0_ele = LR[i][j].y[1].CEclmb;
-	  fh[r] = fh[r-1];
-	  fvdw[r] = fvdw[r-1];
-	  fCEvd[r] = fCEvd[r-1];
-	  fele[r] = fele[r-1];
-	  fCEclmb[r] = fCEclmb[r-1];
-	  vlast_vdw = fCEvd[r-1];
-	  vlast_ele = fele[r-1];
-	  
-	  Natural_Cubic_Spline( &h[1], &fh[1], 
-				&(LR[i][j].H[1]), control->tabulate+1, comm );
-
-	  Complete_Cubic_Spline( &h[1], &fvdw[1], v0_vdw, vlast_vdw, 
-				 &(LR[i][j].vdW[1]), control->tabulate+1, 
-				 comm );
-
-	  Natural_Cubic_Spline( &h[1], &fCEvd[1], 
-				&(LR[i][j].CEvd[1]), control->tabulate+1, 
-				comm );
-
-	  Complete_Cubic_Spline( &h[1], &fele[1], v0_ele, vlast_ele, 
-				 &(LR[i][j].ele[1]), control->tabulate+1, 
-				 comm );
-
-	  Natural_Cubic_Spline( &h[1], &fCEclmb[1], 
-				&(LR[i][j].CEclmb[1]), control->tabulate+1, 
-				comm );
-	}
-	else{
-	  LR[i][j].n = 0;
-	}
-  
+        if( aggregated[j] ) {
+          LR[i][j].xmin = 0;
+          LR[i][j].xmax = control->nonb_cut;
+          LR[i][j].n = control->tabulate + 2;
+          LR[i][j].dx = dr;
+          LR[i][j].inv_dx = control->tabulate / control->nonb_cut;
+          LR[i][j].y = (LR_data*)
+            smalloc( LR[i][j].n * sizeof(LR_data), "lookup:LR[i,j].y", comm );
+          LR[i][j].H = (cubic_spline_coef*)
+            smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].H" ,
+                     comm );
+          LR[i][j].vdW = (cubic_spline_coef*)
+            smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].vdW",
+                     comm);
+          LR[i][j].CEvd = (cubic_spline_coef*)
+            smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].CEvd",
+                     comm);
+          LR[i][j].ele = (cubic_spline_coef*)
+            smalloc( LR[i][j].n*sizeof(cubic_spline_coef),"lookup:LR[i,j].ele",
+                     comm );
+          LR[i][j].CEclmb = (cubic_spline_coef*)
+            smalloc( LR[i][j].n*sizeof(cubic_spline_coef),
+                     "lookup:LR[i,j].CEclmb", comm );
+
+          for( r = 1; r <= control->tabulate; ++r ) {
+            LR_vdW_Coulomb( system, workspace, control, i, j, r * dr, &(LR[i][j].y[r]) );
+            h[r] = LR[i][j].dx;
+            fh[r] = LR[i][j].y[r].H;
+            fvdw[r] = LR[i][j].y[r].e_vdW;
+            fCEvd[r] = LR[i][j].y[r].CEvd;
+            fele[r] = LR[i][j].y[r].e_ele;
+            fCEclmb[r] = LR[i][j].y[r].CEclmb;
+          }
+
+          // init the start-end points
+          h[r] = LR[i][j].dx;
+          v0_vdw = LR[i][j].y[1].CEvd;
+          v0_ele = LR[i][j].y[1].CEclmb;
+          fh[r] = fh[r-1];
+          fvdw[r] = fvdw[r-1];
+          fCEvd[r] = fCEvd[r-1];
+          fele[r] = fele[r-1];
+          fCEclmb[r] = fCEclmb[r-1];
+          vlast_vdw = fCEvd[r-1];
+          vlast_ele = fele[r-1];
+
+          Natural_Cubic_Spline( &h[1], &fh[1],
+                                &(LR[i][j].H[1]), control->tabulate+1, comm );
+
+          Complete_Cubic_Spline( &h[1], &fvdw[1], v0_vdw, vlast_vdw,
+                                 &(LR[i][j].vdW[1]), control->tabulate+1,
+                                 comm );
+
+          Natural_Cubic_Spline( &h[1], &fCEvd[1],
+                                &(LR[i][j].CEvd[1]), control->tabulate+1,
+                                comm );
+
+          Complete_Cubic_Spline( &h[1], &fele[1], v0_ele, vlast_ele,
+                                 &(LR[i][j].ele[1]), control->tabulate+1,
+                                 comm );
+
+          Natural_Cubic_Spline( &h[1], &fCEclmb[1],
+                                &(LR[i][j].CEclmb[1]), control->tabulate+1,
+                                comm );
+        }
+        else{
+          LR[i][j].n = 0;
+        }
+
   free(h);
   free(fh);
   free(fvdw);
@@ -331,12 +331,12 @@ void Deallocate_Lookup_Tables( reax_system *system )
   for( i = 0; i < ntypes; ++i ) {
     for( j = i; j < ntypes; ++j )
       if( LR[i][j].n ) {
-	sfree( LR[i][j].y, "LR[i,j].y" );
-	sfree( LR[i][j].H, "LR[i,j].H" );
-	sfree( LR[i][j].vdW, "LR[i,j].vdW" );
-	sfree( LR[i][j].CEvd, "LR[i,j].CEvd" );
-	sfree( LR[i][j].ele, "LR[i,j].ele" );
-	sfree( LR[i][j].CEclmb, "LR[i,j].CEclmb" );
+        sfree( LR[i][j].y, "LR[i,j].y" );
+        sfree( LR[i][j].H, "LR[i,j].H" );
+        sfree( LR[i][j].vdW, "LR[i,j].vdW" );
+        sfree( LR[i][j].CEvd, "LR[i,j].CEvd" );
+        sfree( LR[i][j].ele, "LR[i,j].ele" );
+        sfree( LR[i][j].CEclmb, "LR[i,j].CEclmb" );
       }
     sfree( LR[i], "LR[i]" );
   }
diff --git a/src/USER-REAXC/reaxc_lookup.h b/src/USER-REAXC/reaxc_lookup.h
index 437f26bc77..79c734c63c 100644
--- a/src/USER-REAXC/reaxc_lookup.h
+++ b/src/USER-REAXC/reaxc_lookup.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -29,8 +29,8 @@
 
 #include "reaxc_types.h"
 
-int Init_Lookup_Tables( reax_system*, control_params*, storage*, 
-			mpi_datatypes*, char* );
+int Init_Lookup_Tables( reax_system*, control_params*, storage*,
+                        mpi_datatypes*, char* );
 
 void Deallocate_Lookup_Tables( reax_system* );
 
diff --git a/src/USER-REAXC/reaxc_multi_body.cpp b/src/USER-REAXC/reaxc_multi_body.cpp
index 7cac68865b..4932a79b99 100644
--- a/src/USER-REAXC/reaxc_multi_body.cpp
+++ b/src/USER-REAXC/reaxc_multi_body.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -38,9 +38,9 @@
 #endif
 
 
-void Atom_Energy( reax_system *system, control_params *control, 
-		  simulation_data *data, storage *workspace, reax_list **lists,
-		  output_controls *out_control )
+void Atom_Energy( 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;
   real Delta_lpcorr, dfvl;
@@ -58,7 +58,7 @@ void Atom_Energy( reax_system *system, control_params *control,
   single_body_parameters *sbp_i, *sbp_j;
   two_body_parameters *twbp;
   bond_data *pbond;
-  bond_order_data *bo_ij; 
+  bond_order_data *bo_ij;
   reax_list *bonds = (*lists) + BONDS;
 
   /* Initialize parameters */
@@ -76,19 +76,19 @@ void Atom_Energy( reax_system *system, control_params *control,
     sbp_i = &(system->reax_param.sbp[ type_i ]);
 
     /* lone-pair Energy */
-    p_lp2 = sbp_i->p_lp2;      
+    p_lp2 = sbp_i->p_lp2;
     expvd2 = exp( -75 * workspace->Delta_lp[i] );
     inv_expvd2 = 1. / (1. + expvd2 );
-      
+
     /* calculate the energy */
-    data->my_en.e_lp += e_lp = 
+    data->my_en.e_lp += e_lp =
       p_lp2 * workspace->Delta_lp[i] * inv_expvd2;
-    
-    dElp = p_lp2 * inv_expvd2 + 
+
+    dElp = p_lp2 * inv_expvd2 +
       75 * p_lp2 * workspace->Delta_lp[i] * expvd2 * SQR(inv_expvd2);
     CElp = dElp * workspace->dDelta_lp[i];
 
-    workspace->CdDelta[i] += CElp;  // lp - 1st term  
+    workspace->CdDelta[i] += CElp;  // lp - 1st term
 
     /* tally into per-atom energy */
     if( system->pair_ptr->evflag)
@@ -96,11 +96,11 @@ void Atom_Energy( reax_system *system, control_params *control,
 
 #ifdef TEST_ENERGY
 //  fprintf( out_control->elp, "%24.15e%24.15e%24.15e%24.15e\n",
-//	     p_lp2, workspace->Delta_lp_temp[i], expvd2, dElp );
+//             p_lp2, workspace->Delta_lp_temp[i], expvd2, dElp );
 //  fprintf( out_control->elp, "%6d%24.15e%24.15e%24.15e\n",
     fprintf( out_control->elp, "%6d%12.4f%12.4f%12.4f\n",
-	     system->my_atoms[i].orig_id, workspace->nlp[i], 
-	     e_lp, data->my_en.e_lp );
+             system->my_atoms[i].orig_id, workspace->nlp[i],
+             e_lp, data->my_en.e_lp );
 #endif
 #ifdef TEST_FORCES
     Add_dDelta( system, lists, i, CElp, workspace->f_lp );  // lp - 1st term
@@ -109,39 +109,39 @@ void Atom_Energy( reax_system *system, control_params *control,
     /* correction for C2 */
     if( p_lp3 > 0.001 && !strcmp(system->reax_param.sbp[type_i].name, "C") )
       for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) {
-	j = bonds->select.bond_list[pj].nbr;
-	type_j = system->my_atoms[j].type;
-
-	if( !strcmp( system->reax_param.sbp[type_j].name, "C" ) ) {
-	  twbp = &( system->reax_param.tbp[type_i][type_j]);
-	  bo_ij = &( bonds->select.bond_list[pj].bo_data );
-	  Di = workspace->Delta[i];
-	  vov3 = bo_ij->BO - Di - 0.040*pow(Di, 4.);
-
-	  if( vov3 > 3. ) {
-	    data->my_en.e_lp += e_lph = p_lp3 * SQR(vov3-3.0);
-	    
-	    deahu2dbo = 2.*p_lp3*(vov3 - 3.);
-	    deahu2dsbo = 2.*p_lp3*(vov3 - 3.)*(-1. - 0.16*pow(Di, 3.));
-		
-	    bo_ij->Cdbo += deahu2dbo;
-	    workspace->CdDelta[i] += deahu2dsbo;
-
-	    /* tally into per-atom energy */
-	    if( system->pair_ptr->evflag)
+        j = bonds->select.bond_list[pj].nbr;
+        type_j = system->my_atoms[j].type;
+
+        if( !strcmp( system->reax_param.sbp[type_j].name, "C" ) ) {
+          twbp = &( system->reax_param.tbp[type_i][type_j]);
+          bo_ij = &( bonds->select.bond_list[pj].bo_data );
+          Di = workspace->Delta[i];
+          vov3 = bo_ij->BO - Di - 0.040*pow(Di, 4.);
+
+          if( vov3 > 3. ) {
+            data->my_en.e_lp += e_lph = p_lp3 * SQR(vov3-3.0);
+
+            deahu2dbo = 2.*p_lp3*(vov3 - 3.);
+            deahu2dsbo = 2.*p_lp3*(vov3 - 3.)*(-1. - 0.16*pow(Di, 3.));
+
+            bo_ij->Cdbo += deahu2dbo;
+            workspace->CdDelta[i] += deahu2dsbo;
+
+            /* tally into per-atom energy */
+            if( system->pair_ptr->evflag)
               system->pair_ptr->ev_tally(i,j,system->n,1,e_lph,0.0,0.0,0.0,0.0,0.0);
-		
+
 #ifdef TEST_ENERGY
-	    fprintf(out_control->elp,"C2cor%6d%6d%12.6f%12.6f%12.6f\n",
-	            system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
-	            e_lph, deahu2dbo, deahu2dsbo );
+            fprintf(out_control->elp,"C2cor%6d%6d%12.6f%12.6f%12.6f\n",
+                    system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+                    e_lph, deahu2dbo, deahu2dsbo );
 #endif
 #ifdef TEST_FORCES
-	    Add_dBO(system, lists, i, pj, deahu2dbo, workspace->f_lp);
-	    Add_dDelta(system, lists, i, deahu2dsbo, workspace->f_lp);
+            Add_dBO(system, lists, i, pj, deahu2dbo, workspace->f_lp);
+            Add_dDelta(system, lists, i, deahu2dsbo, workspace->f_lp);
 #endif
-	  }
-	}    
+          }
+        }
       }
   }
 
@@ -151,41 +151,41 @@ void Atom_Energy( reax_system *system, control_params *control,
     sbp_i = &(system->reax_param.sbp[ type_i ]);
 
     /* over-coordination energy */
-    if( sbp_i->mass > 21.0 ) 
+    if( sbp_i->mass > 21.0 )
       dfvl = 0.0;
     else dfvl = 1.0; // only for 1st-row elements
-      
+
     p_ovun2 = sbp_i->p_ovun2;
     sum_ovun1 = sum_ovun2 = 0;
     for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) {
-	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;
-	sum_ovun2 += (workspace->Delta[j] - dfvl*workspace->Delta_lp_temp[j])*
-	  ( bo_ij->BO_pi + bo_ij->BO_pi2 );
-
-	/*fprintf( stdout, "%4d%4d%12.6f%12.6f%12.6f\n",
-            i+1, j+1,      
-            dfvl * workspace->Delta_lp_temp[j], 
-	    sbp_j->nlp_opt,
+        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;
+        sum_ovun2 += (workspace->Delta[j] - dfvl*workspace->Delta_lp_temp[j])*
+          ( bo_ij->BO_pi + bo_ij->BO_pi2 );
+
+        /*fprintf( stdout, "%4d%4d%12.6f%12.6f%12.6f\n",
+            i+1, j+1,
+            dfvl * workspace->Delta_lp_temp[j],
+            sbp_j->nlp_opt,
             workspace->nlp_temp[j] );*/
       }
 
     exp_ovun1 = p_ovun3 * exp( p_ovun4 * sum_ovun2 );
     inv_exp_ovun1 = 1.0 / (1 + exp_ovun1);
-    Delta_lpcorr  = workspace->Delta[i] - 
+    Delta_lpcorr  = workspace->Delta[i] -
       (dfvl * workspace->Delta_lp_temp[i]) * inv_exp_ovun1;
-	
+
     exp_ovun2 = exp( p_ovun2 * Delta_lpcorr );
     inv_exp_ovun2 = 1.0 / (1.0 + exp_ovun2);
-	
+
     DlpVi = 1.0 / (Delta_lpcorr + sbp_i->valency + 1e-8);
     CEover1 = Delta_lpcorr * DlpVi * inv_exp_ovun2;
-			
+
     data->my_en.e_ov += e_ov = sum_ovun1 * CEover1;
 
     CEover2 = sum_ovun1 * DlpVi * inv_exp_ovun2 *
@@ -193,14 +193,14 @@ void Atom_Energy( reax_system *system, control_params *control,
 
     CEover3 = CEover2 * (1.0 - dfvl * workspace->dDelta_lp[i] * inv_exp_ovun1 );
 
-    CEover4 = CEover2 * (dfvl * workspace->Delta_lp_temp[i]) * 
+    CEover4 = CEover2 * (dfvl * workspace->Delta_lp_temp[i]) *
       p_ovun4 * exp_ovun1 * SQR(inv_exp_ovun1);
 
-      
+
     /* under-coordination potential */
     p_ovun2 = sbp_i->p_ovun2;
     p_ovun5 = sbp_i->p_ovun5;
-	
+
     exp_ovun2n = 1.0 / exp_ovun2;
     exp_ovun6 = exp( p_ovun6 * Delta_lpcorr );
     exp_ovun8 = p_ovun7 * exp(p_ovun8 * sum_ovun2);
@@ -209,15 +209,15 @@ void Atom_Energy( reax_system *system, control_params *control,
 
     data->my_en.e_un += e_un =
       -p_ovun5 * (1.0 - exp_ovun6) * inv_exp_ovun2n * inv_exp_ovun8;
-			
-    CEunder1 = inv_exp_ovun2n * 
+
+    CEunder1 = inv_exp_ovun2n *
       ( p_ovun5 * p_ovun6 * exp_ovun6 * inv_exp_ovun8 +
-	p_ovun2 * e_un * exp_ovun2n );
+        p_ovun2 * e_un * exp_ovun2n );
     CEunder2 = -e_un * p_ovun8 * exp_ovun8 * inv_exp_ovun8;
     CEunder3 = CEunder1 * (1.0 - dfvl*workspace->dDelta_lp[i]*inv_exp_ovun1);
-    CEunder4 = CEunder1 * (dfvl*workspace->Delta_lp_temp[i]) * 
+    CEunder4 = CEunder1 * (dfvl*workspace->Delta_lp_temp[i]) *
       p_ovun4 * exp_ovun1 * SQR(inv_exp_ovun1) + CEunder2;
-    
+
     /* tally into per-atom energy */
     if( system->pair_ptr->evflag) {
       eng_tmp = e_ov + e_un;
@@ -233,97 +233,97 @@ void Atom_Energy( reax_system *system, control_params *control,
     Add_dDelta( system, lists, i, CEover3, workspace->f_ov ); // OvCoor 2nd
     Add_dDelta( system, lists, i, CEunder3, workspace->f_un ); // UnCoor 1st
 #endif
-      
+
     for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) {
       pbond = &(bonds->select.bond_list[pj]);
       j = pbond->nbr;
       bo_ij = &(pbond->bo_data);
       twbp  = &(system->reax_param.tbp[ system->my_atoms[i].type ]
-		[system->my_atoms[pbond->nbr].type]);
+                [system->my_atoms[pbond->nbr].type]);
 
 
-      bo_ij->Cdbo += CEover1 * twbp->p_ovun1 * twbp->De_s;// OvCoor-1st 
-      workspace->CdDelta[j] += CEover4 * (1.0 - dfvl*workspace->dDelta_lp[j]) * 
-	(bo_ij->BO_pi + bo_ij->BO_pi2); // OvCoor-3a
-      bo_ij->Cdbopi += CEover4 * 
-	(workspace->Delta[j] - dfvl*workspace->Delta_lp_temp[j]); // OvCoor-3b
-      bo_ij->Cdbopi2 += CEover4 * 
-	(workspace->Delta[j] - dfvl*workspace->Delta_lp_temp[j]);  // OvCoor-3b
+      bo_ij->Cdbo += CEover1 * twbp->p_ovun1 * twbp->De_s;// OvCoor-1st
+      workspace->CdDelta[j] += CEover4 * (1.0 - dfvl*workspace->dDelta_lp[j]) *
+        (bo_ij->BO_pi + bo_ij->BO_pi2); // OvCoor-3a
+      bo_ij->Cdbopi += CEover4 *
+        (workspace->Delta[j] - dfvl*workspace->Delta_lp_temp[j]); // OvCoor-3b
+      bo_ij->Cdbopi2 += CEover4 *
+        (workspace->Delta[j] - dfvl*workspace->Delta_lp_temp[j]);  // OvCoor-3b
 
 
       workspace->CdDelta[j] += CEunder4 * (1.0 - dfvl*workspace->dDelta_lp[j]) *
-	(bo_ij->BO_pi + bo_ij->BO_pi2);   // UnCoor - 2a
-      bo_ij->Cdbopi += CEunder4 * 
-	(workspace->Delta[j] - dfvl*workspace->Delta_lp_temp[j]);  // UnCoor-2b
-      bo_ij->Cdbopi2 += CEunder4 * 
-	(workspace->Delta[j] - dfvl*workspace->Delta_lp_temp[j]);  // UnCoor-2b
+        (bo_ij->BO_pi + bo_ij->BO_pi2);   // UnCoor - 2a
+      bo_ij->Cdbopi += CEunder4 *
+        (workspace->Delta[j] - dfvl*workspace->Delta_lp_temp[j]);  // UnCoor-2b
+      bo_ij->Cdbopi2 += CEunder4 *
+        (workspace->Delta[j] - dfvl*workspace->Delta_lp_temp[j]);  // UnCoor-2b
 
 
 #ifdef TEST_ENERGY
-/*	  fprintf( out_control->eov, "%6d%12.6f\n", 
-		   workspace->reverse_map[j], 
-		   // CEover1 * twbp->p_ovun1 * twbp->De_s, CEover3, 
-		   CEover4 * (1.0 - workspace->dDelta_lp[j]) * 
-		   (bo_ij->BO_pi + bo_ij->BO_pi2)
-*///		   /*CEover4 * (workspace->Delta[j]-workspace->Delta_lp[j])*/);
-//	  fprintf( out_control->eov, "%6d%12.6f\n", 
-//	  fprintf( out_control->eov, "%6d%24.15e\n", 
-//		   system->my_atoms[j].orig_id, 
-		   // CEover1 * twbp->p_ovun1 * twbp->De_s, CEover3, 
-//		   CEover4 * (1.0 - workspace->dDelta_lp[j]) * 
-//		   (bo_ij->BO_pi + bo_ij->BO_pi2)
-//		   /*CEover4 * (workspace->Delta[j]-workspace->Delta_lp[j])*/);
-
-	  // CEunder4 * (1.0 - workspace->dDelta_lp[j]) * 
-	  // (bo_ij->BO_pi + bo_ij->BO_pi2),
-	  // CEunder4 * (workspace->Delta[j] - workspace->Delta_lp[j]) );
+/*          fprintf( out_control->eov, "%6d%12.6f\n",
+                   workspace->reverse_map[j],
+                   // CEover1 * twbp->p_ovun1 * twbp->De_s, CEover3,
+                   CEover4 * (1.0 - workspace->dDelta_lp[j]) *
+                   (bo_ij->BO_pi + bo_ij->BO_pi2)
+*///                   /*CEover4 * (workspace->Delta[j]-workspace->Delta_lp[j])*/);
+//          fprintf( out_control->eov, "%6d%12.6f\n",
+//          fprintf( out_control->eov, "%6d%24.15e\n",
+//                   system->my_atoms[j].orig_id,
+                   // CEover1 * twbp->p_ovun1 * twbp->De_s, CEover3,
+//                   CEover4 * (1.0 - workspace->dDelta_lp[j]) *
+//                   (bo_ij->BO_pi + bo_ij->BO_pi2)
+//                   /*CEover4 * (workspace->Delta[j]-workspace->Delta_lp[j])*/);
+
+          // CEunder4 * (1.0 - workspace->dDelta_lp[j]) *
+          // (bo_ij->BO_pi + bo_ij->BO_pi2),
+          // CEunder4 * (workspace->Delta[j] - workspace->Delta_lp[j]) );
 #endif
 
 #ifdef TEST_FORCES
       Add_dBO( system, lists, i, pj, CEover1 * twbp->p_ovun1 * twbp->De_s,
-	       workspace->f_ov ); // OvCoor - 1st term
+               workspace->f_ov ); // OvCoor - 1st term
 
       Add_dDelta( system, lists, j,
-		  CEover4 * (1.0 - dfvl*workspace->dDelta_lp[j]) * 
-		  (bo_ij->BO_pi + bo_ij->BO_pi2),
-		  workspace->f_ov );   // OvCoor - 3a
+                  CEover4 * (1.0 - dfvl*workspace->dDelta_lp[j]) *
+                  (bo_ij->BO_pi + bo_ij->BO_pi2),
+                  workspace->f_ov );   // OvCoor - 3a
 
-      Add_dBOpinpi2( system, lists, i, pj, 
-		     CEover4 * (workspace->Delta[j] - 
-				dfvl * workspace->Delta_lp_temp[j]),
-		     CEover4 * (workspace->Delta[j] - 
-				dfvl * workspace->Delta_lp_temp[j]),
-		     workspace->f_ov, workspace->f_ov ); // OvCoor - 3b
+      Add_dBOpinpi2( system, lists, i, pj,
+                     CEover4 * (workspace->Delta[j] -
+                                dfvl * workspace->Delta_lp_temp[j]),
+                     CEover4 * (workspace->Delta[j] -
+                                dfvl * workspace->Delta_lp_temp[j]),
+                     workspace->f_ov, workspace->f_ov ); // OvCoor - 3b
 
       Add_dDelta( system, lists, j,
-		  CEunder4 * (1.0 - dfvl*workspace->dDelta_lp[j]) * 
-		  (bo_ij->BO_pi + bo_ij->BO_pi2),
-		  workspace->f_un ); // UnCoor - 2a
-
-      Add_dBOpinpi2( system, lists, i, pj, 
-		     CEunder4 * (workspace->Delta[j] - 
-				 dfvl * workspace->Delta_lp_temp[j]),
-		     CEunder4 * (workspace->Delta[j] - 
-				 dfvl * workspace->Delta_lp_temp[j]),
-		     workspace->f_un, workspace->f_un ); // UnCoor - 2b
+                  CEunder4 * (1.0 - dfvl*workspace->dDelta_lp[j]) *
+                  (bo_ij->BO_pi + bo_ij->BO_pi2),
+                  workspace->f_un ); // UnCoor - 2a
+
+      Add_dBOpinpi2( system, lists, i, pj,
+                     CEunder4 * (workspace->Delta[j] -
+                                 dfvl * workspace->Delta_lp_temp[j]),
+                     CEunder4 * (workspace->Delta[j] -
+                                 dfvl * workspace->Delta_lp_temp[j]),
+                     workspace->f_un, workspace->f_un ); // UnCoor - 2b
 #endif
     }
 
 #ifdef TEST_ENERGY
     //fprintf( out_control->elp, "%6d%24.15e%24.15e%24.15e\n",
     //fprintf( out_control->elp, "%6d%12.4f%12.4f%12.4f\n",
-    //     system->my_atoms[i].orig_id, workspace->nlp[i], 
+    //     system->my_atoms[i].orig_id, workspace->nlp[i],
     //     e_lp, data->my_en.e_lp );
-    
-    //fprintf( out_control->eov, "%6d%24.15e%24.15e\n", 
-    fprintf( out_control->eov, "%6d%12.4f%12.4f\n", 
-	     system->my_atoms[i].orig_id, 
-	     e_ov, data->my_en.e_ov + data->my_en.e_un );
-    
-    //fprintf( out_control->eun, "%6d%24.15e%24.15e\n", 
-    fprintf( out_control->eun, "%6d%12.4f%12.4f\n", 
-	     system->my_atoms[i].orig_id, 
-	     e_un, data->my_en.e_ov + data->my_en.e_un );
+
+    //fprintf( out_control->eov, "%6d%24.15e%24.15e\n",
+    fprintf( out_control->eov, "%6d%12.4f%12.4f\n",
+             system->my_atoms[i].orig_id,
+             e_ov, data->my_en.e_ov + data->my_en.e_un );
+
+    //fprintf( out_control->eun, "%6d%24.15e%24.15e\n",
+    fprintf( out_control->eun, "%6d%12.4f%12.4f\n",
+             system->my_atoms[i].orig_id,
+             e_un, data->my_en.e_ov + data->my_en.e_un );
 #endif
   }
 }
diff --git a/src/USER-REAXC/reaxc_multi_body.h b/src/USER-REAXC/reaxc_multi_body.h
index ba43b31a6d..a17c9f484e 100644
--- a/src/USER-REAXC/reaxc_multi_body.h
+++ b/src/USER-REAXC/reaxc_multi_body.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -30,7 +30,6 @@
 #include "reaxc_types.h"
 
 void Atom_Energy( reax_system*, control_params*, simulation_data*,
-		  storage*, reax_list**, output_controls* );
+                  storage*, reax_list**, output_controls* );
 
 #endif
-
diff --git a/src/USER-REAXC/reaxc_nonbonded.cpp b/src/USER-REAXC/reaxc_nonbonded.cpp
index 1fec8b5912..bbaac67d3e 100644
--- a/src/USER-REAXC/reaxc_nonbonded.cpp
+++ b/src/USER-REAXC/reaxc_nonbonded.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -38,9 +38,9 @@
 #include "reaxc_vector.h"
 #endif
 
-void vdW_Coulomb_Energy( reax_system *system, control_params *control, 
-			 simulation_data *data, storage *workspace, 
-			 reax_list **lists, output_controls *out_control )
+void vdW_Coulomb_Energy( reax_system *system, control_params *control,
+                         simulation_data *data, storage *workspace,
+                         reax_list **lists, output_controls *out_control )
 {
   int i, j, pj, natoms;
   int start_i, end_i, orig_i, orig_j, flag;
@@ -83,25 +83,25 @@ void vdW_Coulomb_Energy( reax_system *system, control_params *control,
       if( nbr_pj->d <= control->nonb_cut && (j < natoms || orig_i < orig_j) ) {
 #elif defined(LAMMPS_REAX)
       flag = 0;
-      if(nbr_pj->d <= control->nonb_cut) { 
-	if (j < natoms) flag = 1;
-	else if (orig_i < orig_j) flag = 1;
-	else if (orig_i == orig_j) {
-	  if (nbr_pj->dvec[2] > SMALL) flag = 1;
-	  else if (fabs(nbr_pj->dvec[2]) < SMALL) {
-	    if (nbr_pj->dvec[1] > SMALL) flag = 1;
-	    else if (fabs(nbr_pj->dvec[1]) < SMALL && nbr_pj->dvec[0] > SMALL)
-	      flag = 1;
-	  }
-	}
+      if(nbr_pj->d <= control->nonb_cut) {
+        if (j < natoms) flag = 1;
+        else if (orig_i < orig_j) flag = 1;
+        else if (orig_i == orig_j) {
+          if (nbr_pj->dvec[2] > SMALL) flag = 1;
+          else if (fabs(nbr_pj->dvec[2]) < SMALL) {
+            if (nbr_pj->dvec[1] > SMALL) flag = 1;
+            else if (fabs(nbr_pj->dvec[1]) < SMALL && nbr_pj->dvec[0] > SMALL)
+              flag = 1;
+          }
+        }
       }
-      
+
       if (flag) {
 #endif
 
       r_ij = nbr_pj->d;
       twbp = &(system->reax_param.tbp[ system->my_atoms[i].type ]
-		                       [ system->my_atoms[j].type ]);
+                                       [ system->my_atoms[j].type ]);
 
       /* Calculate Taper and its derivative */
       // Tap = nbr_pj->Tap;   -- precomputed during compte_H
@@ -112,7 +112,7 @@ void vdW_Coulomb_Energy( reax_system *system, control_params *control,
       Tap = Tap * r_ij + workspace->Tap[2];
       Tap = Tap * r_ij + workspace->Tap[1];
       Tap = Tap * r_ij + workspace->Tap[0];
-	  
+
       dTap = 7*workspace->Tap[7] * r_ij + 6*workspace->Tap[6];
       dTap = dTap * r_ij + 5*workspace->Tap[5];
       dTap = dTap * r_ij + 4*workspace->Tap[4];
@@ -122,119 +122,119 @@ void vdW_Coulomb_Energy( reax_system *system, control_params *control,
 
       /*vdWaals Calculations*/
       if(system->reax_param.gp.vdw_type==1 || system->reax_param.gp.vdw_type==3)
-	{ // shielding
-	  powr_vdW1 = pow(r_ij, p_vdW1);
-	  powgi_vdW1 = pow( 1.0 / twbp->gamma_w, p_vdW1);
-	
-	  fn13 = pow( powr_vdW1 + powgi_vdW1, p_vdW1i );
-	  exp1 = exp( twbp->alpha * (1.0 - fn13 / twbp->r_vdW) );
-	  exp2 = exp( 0.5 * twbp->alpha * (1.0 - fn13 / twbp->r_vdW) );
-
-	  e_vdW = twbp->D * (exp1 - 2.0 * exp2);	  
-	  data->my_en.e_vdW += Tap * e_vdW;
-	
-	  dfn13 = pow( powr_vdW1 + powgi_vdW1, p_vdW1i - 1.0) * 
-	    pow(r_ij, p_vdW1 - 2.0);
-	  
-	  CEvd = dTap * e_vdW - 
-	    Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13;
-	}
+        { // shielding
+          powr_vdW1 = pow(r_ij, p_vdW1);
+          powgi_vdW1 = pow( 1.0 / twbp->gamma_w, p_vdW1);
+
+          fn13 = pow( powr_vdW1 + powgi_vdW1, p_vdW1i );
+          exp1 = exp( twbp->alpha * (1.0 - fn13 / twbp->r_vdW) );
+          exp2 = exp( 0.5 * twbp->alpha * (1.0 - fn13 / twbp->r_vdW) );
+
+          e_vdW = twbp->D * (exp1 - 2.0 * exp2);
+          data->my_en.e_vdW += Tap * e_vdW;
+
+          dfn13 = pow( powr_vdW1 + powgi_vdW1, p_vdW1i - 1.0) *
+            pow(r_ij, p_vdW1 - 2.0);
+
+          CEvd = dTap * e_vdW -
+            Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13;
+        }
       else{ // no shielding
-	exp1 = exp( twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
-	exp2 = exp( 0.5 * twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
-	
-	e_vdW = twbp->D * (exp1 - 2.0 * exp2);
-	data->my_en.e_vdW += Tap * e_vdW;
-
-	CEvd = dTap * e_vdW - 
-	  Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) / r_ij;
+        exp1 = exp( twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
+        exp2 = exp( 0.5 * twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
+
+        e_vdW = twbp->D * (exp1 - 2.0 * exp2);
+        data->my_en.e_vdW += Tap * e_vdW;
+
+        CEvd = dTap * e_vdW -
+          Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) / r_ij;
       }
 
       if(system->reax_param.gp.vdw_type==2 || system->reax_param.gp.vdw_type==3)
-	{ // innner wall
-	  e_core = twbp->ecore * exp(twbp->acore * (1.0-(r_ij/twbp->rcore)));
-	  data->my_en.e_vdW += Tap * e_core;
+        { // innner wall
+          e_core = twbp->ecore * exp(twbp->acore * (1.0-(r_ij/twbp->rcore)));
+          data->my_en.e_vdW += Tap * e_core;
 
-	  de_core = -(twbp->acore/twbp->rcore) * e_core;
-	  CEvd += dTap * e_core + Tap * de_core / r_ij;
+          de_core = -(twbp->acore/twbp->rcore) * e_core;
+          CEvd += dTap * e_core + Tap * de_core / r_ij;
 
           //  lg correction, only if lgvdw is yes
-	  if (control->lgflag) {
-            r_ij5 = pow( r_ij, 5.0 ); 
+          if (control->lgflag) {
+            r_ij5 = pow( r_ij, 5.0 );
             r_ij6 = pow( r_ij, 6.0 );
             re6 = pow( twbp->lgre, 6.0 );
-            e_lg = -(twbp->lgcij/( r_ij6 + re6 )); 
+            e_lg = -(twbp->lgcij/( r_ij6 + re6 ));
             data->my_en.e_vdW += Tap * e_lg;
 
             de_lg = -6.0 * e_lg *  r_ij5 / ( r_ij6 + re6 ) ;
             CEvd += dTap * e_lg + Tap * de_lg / r_ij;
-	  }
+          }
 
-	}
+        }
 
       /*Coulomb Calculations*/
       dr3gamij_1 = ( r_ij * r_ij * r_ij + twbp->gamma );
       dr3gamij_3 = pow( dr3gamij_1 , 0.33333333333333 );
 
       tmp = Tap / dr3gamij_3;
-      data->my_en.e_ele += e_ele = 
-	C_ele * system->my_atoms[i].q * system->my_atoms[j].q * tmp;
-		
-      CEclmb = C_ele * system->my_atoms[i].q * system->my_atoms[j].q * 
-	( dTap -  Tap * r_ij / dr3gamij_1 ) / dr3gamij_3;
+      data->my_en.e_ele += e_ele =
+        C_ele * system->my_atoms[i].q * system->my_atoms[j].q * tmp;
+
+      CEclmb = C_ele * system->my_atoms[i].q * system->my_atoms[j].q *
+        ( dTap -  Tap * r_ij / dr3gamij_1 ) / dr3gamij_3;
 
       /* tally into per-atom energy */
       if( system->pair_ptr->evflag || system->pair_ptr->vflag_atom) {
         pe_vdw = Tap * (e_vdW + e_core + e_lg);
-	rvec_ScaledSum( delij, 1., system->my_atoms[i].x,
-			      -1., system->my_atoms[j].x );
-	f_tmp = -(CEvd + CEclmb);
+        rvec_ScaledSum( delij, 1., system->my_atoms[i].x,
+                              -1., system->my_atoms[j].x );
+        f_tmp = -(CEvd + CEclmb);
         system->pair_ptr->ev_tally(i,j,natoms,1,pe_vdw,e_ele,
-			f_tmp,delij[0],delij[1],delij[2]);
-      }	
+                        f_tmp,delij[0],delij[1],delij[2]);
+      }
 
       /* fprintf(stderr, "%5d %5d %10.6f %10.6f\n",
         MIN( system->my_atoms[i].orig_id, system->my_atoms[j].orig_id ),
-        MAX( system->my_atoms[i].orig_id, system->my_atoms[j].orig_id ), 
-        CEvd, CEclmb );       	  */
+        MAX( system->my_atoms[i].orig_id, system->my_atoms[j].orig_id ),
+        CEvd, CEclmb );                 */
 
       if( control->virial == 0 ) {
-	rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec );
-	rvec_ScaledAdd( workspace->f[j], +(CEvd + CEclmb), nbr_pj->dvec );
+        rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec );
+        rvec_ScaledAdd( workspace->f[j], +(CEvd + CEclmb), nbr_pj->dvec );
       }
       else { /* NPT, iNPT or sNPT */
-	/* for pressure coupling, terms not related to bond order 
-	   derivatives are added directly into pressure vector/tensor */
-	rvec_Scale( temp, CEvd + CEclmb, nbr_pj->dvec );
-	    
-	rvec_ScaledAdd( workspace->f[i], -1., temp );
-	rvec_Add( workspace->f[j], temp );
-	    
-	rvec_iMultiply( ext_press, nbr_pj->rel_box, temp );
-	rvec_Add( data->my_ext_press, ext_press );
-	    
-	/* fprintf( stderr, "nonbonded(%d,%d): rel_box (%f %f %f) 
-	  force(%f %f %f) ext_press (%12.6f %12.6f %12.6f)\n", 
-	  i, j, nbr_pj->rel_box[0], nbr_pj->rel_box[1], nbr_pj->rel_box[2],
-	  temp[0], temp[1], temp[2],
-	  data->ext_press[0], data->ext_press[1], data->ext_press[2] );  	*/
+        /* for pressure coupling, terms not related to bond order
+           derivatives are added directly into pressure vector/tensor */
+        rvec_Scale( temp, CEvd + CEclmb, nbr_pj->dvec );
+
+        rvec_ScaledAdd( workspace->f[i], -1., temp );
+        rvec_Add( workspace->f[j], temp );
+
+        rvec_iMultiply( ext_press, nbr_pj->rel_box, temp );
+        rvec_Add( data->my_ext_press, ext_press );
+
+        /* fprintf( stderr, "nonbonded(%d,%d): rel_box (%f %f %f)
+          force(%f %f %f) ext_press (%12.6f %12.6f %12.6f)\n",
+          i, j, nbr_pj->rel_box[0], nbr_pj->rel_box[1], nbr_pj->rel_box[2],
+          temp[0], temp[1], temp[2],
+          data->ext_press[0], data->ext_press[1], data->ext_press[2] );          */
       }
-      
+
 #ifdef TEST_ENERGY
-      // fprintf( out_control->evdw, 
-      // "%12.9f%12.9f%12.9f%12.9f%12.9f%12.9f%12.9f%12.9f\n", 
+      // fprintf( out_control->evdw,
+      // "%12.9f%12.9f%12.9f%12.9f%12.9f%12.9f%12.9f%12.9f\n",
       // workspace->Tap[7],workspace->Tap[6],workspace->Tap[5],
-      // workspace->Tap[4],workspace->Tap[3],workspace->Tap[2], 
+      // workspace->Tap[4],workspace->Tap[3],workspace->Tap[2],
       // workspace->Tap[1], Tap );
       //fprintf( out_control->evdw, "%6d%6d%24.15e%24.15e%24.15e\n",
       fprintf( out_control->evdw, "%6d%6d%12.4f%12.4f%12.4f\n",
-	       system->my_atoms[i].orig_id, system->my_atoms[j].orig_id, 
-	       r_ij, e_vdW, data->my_en.e_vdW );
+               system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+               r_ij, e_vdW, data->my_en.e_vdW );
       //fprintf(out_control->ecou,"%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e\n",
       fprintf( out_control->ecou, "%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f\n",
-	       system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
-	       r_ij, system->my_atoms[i].q, system->my_atoms[j].q, 
-	       e_ele, data->my_en.e_ele );
+               system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+               r_ij, system->my_atoms[i].q, system->my_atoms[j].q,
+               e_ele, data->my_en.e_ele );
 #endif
 #ifdef TEST_FORCES
       rvec_ScaledAdd( workspace->f_vdw[i], -CEvd, nbr_pj->dvec );
@@ -247,8 +247,8 @@ void vdW_Coulomb_Energy( reax_system *system, control_params *control,
   }
 
 #if defined(DEBUG)
-  fprintf( stderr, "nonbonded: ext_press (%12.6f %12.6f %12.6f)\n", 
-	   data->ext_press[0], data->ext_press[1], data->ext_press[2] );
+  fprintf( stderr, "nonbonded: ext_press (%12.6f %12.6f %12.6f)\n",
+           data->ext_press[0], data->ext_press[1], data->ext_press[2] );
   MPI_Barrier( MPI_COMM_WORLD );
 #endif
 
@@ -257,10 +257,10 @@ void vdW_Coulomb_Energy( reax_system *system, control_params *control,
 
 
 
-void Tabulated_vdW_Coulomb_Energy( reax_system *system,control_params *control, 
-				   simulation_data *data, storage *workspace, 
-				   reax_list **lists, 
-				   output_controls *out_control )
+void Tabulated_vdW_Coulomb_Energy( reax_system *system,control_params *control,
+                                   simulation_data *data, storage *workspace,
+                                   reax_list **lists,
+                                   output_controls *out_control )
 {
   int i, j, pj, r, natoms, steps, update_freq, update_energies;
   int type_i, type_j, tmin, tmax;
@@ -297,19 +297,19 @@ void Tabulated_vdW_Coulomb_Energy( reax_system *system,control_params *control,
       if( nbr_pj->d <= control->nonb_cut && (j < natoms || orig_i < orig_j) ) {
 #elif defined(LAMMPS_REAX)
       flag = 0;
-      if(nbr_pj->d <= control->nonb_cut) { 
-	if (j < natoms) flag = 1;
-	else if (orig_i < orig_j) flag = 1;
-	else if (orig_i == orig_j) {
-	  if (nbr_pj->dvec[2] > SMALL) flag = 1;
-	  else if (fabs(nbr_pj->dvec[2]) < SMALL) {
-	    if (nbr_pj->dvec[1] > SMALL) flag = 1;
-	    else if (fabs(nbr_pj->dvec[1]) < SMALL && nbr_pj->dvec[0] > SMALL)
-	      flag = 1;
-	  }
-	}
+      if(nbr_pj->d <= control->nonb_cut) {
+        if (j < natoms) flag = 1;
+        else if (orig_i < orig_j) flag = 1;
+        else if (orig_i == orig_j) {
+          if (nbr_pj->dvec[2] > SMALL) flag = 1;
+          else if (fabs(nbr_pj->dvec[2]) < SMALL) {
+            if (nbr_pj->dvec[1] > SMALL) flag = 1;
+            else if (fabs(nbr_pj->dvec[1]) < SMALL && nbr_pj->dvec[0] > SMALL)
+              flag = 1;
+          }
+        }
       }
-      
+
       if (flag) {
 #endif
       j = nbr_pj->nbr;
@@ -318,8 +318,8 @@ void Tabulated_vdW_Coulomb_Energy( reax_system *system,control_params *control,
       r_ij   = nbr_pj->d;
       tmin  = MIN( type_i, type_j );
       tmax  = MAX( type_i, type_j );
-      t = &( LR[tmin][tmax] ); 
-      //t = &( LR[type_i][type_j] ); 
+      t = &( LR[tmin][tmax] );
+      //t = &( LR[type_i][type_j] );
 
       /* Cubic Spline Interpolation */
       r = (int)(r_ij * t->inv_dx);
@@ -327,62 +327,62 @@ void Tabulated_vdW_Coulomb_Energy( reax_system *system,control_params *control,
       base = (real)(r+1) * t->dx;
       dif = r_ij - base;
       //fprintf(stderr, "r: %f, i: %d, base: %f, dif: %f\n", r, i, base, dif);
-      
+
       if( update_energies ) {
-	e_vdW = ((t->vdW[r].d*dif + t->vdW[r].c)*dif + t->vdW[r].b)*dif + 
-	  t->vdW[r].a;
-	
-	e_ele = ((t->ele[r].d*dif + t->ele[r].c)*dif + t->ele[r].b)*dif + 
-	  t->ele[r].a;
-	e_ele *= system->my_atoms[i].q * system->my_atoms[j].q;
-	
-	data->my_en.e_vdW += e_vdW;
-	data->my_en.e_ele += e_ele;
-      }	
-      
-      CEvd = ((t->CEvd[r].d*dif + t->CEvd[r].c)*dif + t->CEvd[r].b)*dif + 
-	t->CEvd[r].a;
-            
-      CEclmb = ((t->CEclmb[r].d*dif+t->CEclmb[r].c)*dif+t->CEclmb[r].b)*dif + 
-	t->CEclmb[r].a;
+        e_vdW = ((t->vdW[r].d*dif + t->vdW[r].c)*dif + t->vdW[r].b)*dif +
+          t->vdW[r].a;
+
+        e_ele = ((t->ele[r].d*dif + t->ele[r].c)*dif + t->ele[r].b)*dif +
+          t->ele[r].a;
+        e_ele *= system->my_atoms[i].q * system->my_atoms[j].q;
+
+        data->my_en.e_vdW += e_vdW;
+        data->my_en.e_ele += e_ele;
+      }
+
+      CEvd = ((t->CEvd[r].d*dif + t->CEvd[r].c)*dif + t->CEvd[r].b)*dif +
+        t->CEvd[r].a;
+
+      CEclmb = ((t->CEclmb[r].d*dif+t->CEclmb[r].c)*dif+t->CEclmb[r].b)*dif +
+        t->CEclmb[r].a;
       CEclmb *= system->my_atoms[i].q * system->my_atoms[j].q;
 
 
       /* tally into per-atom energy */
       if( system->pair_ptr->evflag || system->pair_ptr->vflag_atom) {
-	rvec_ScaledSum( delij, 1., system->my_atoms[i].x,
-			      -1., system->my_atoms[j].x );
-	f_tmp = -(CEvd + CEclmb);
+        rvec_ScaledSum( delij, 1., system->my_atoms[i].x,
+                              -1., system->my_atoms[j].x );
+        f_tmp = -(CEvd + CEclmb);
         system->pair_ptr->ev_tally(i,j,natoms,1,e_vdW,e_ele,
-			f_tmp,delij[0],delij[1],delij[2]);
-      }	
+                        f_tmp,delij[0],delij[1],delij[2]);
+      }
 
       if( control->virial == 0 ) {
-	rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec );
-	rvec_ScaledAdd( workspace->f[j], +(CEvd + CEclmb), nbr_pj->dvec );
+        rvec_ScaledAdd( workspace->f[i], -(CEvd + CEclmb), nbr_pj->dvec );
+        rvec_ScaledAdd( workspace->f[j], +(CEvd + CEclmb), nbr_pj->dvec );
       }
       else { // NPT, iNPT or sNPT
-	/* for pressure coupling, terms not related to bond order derivatives
-	   are added directly into pressure vector/tensor */
-	rvec_Scale( temp, CEvd + CEclmb, nbr_pj->dvec );
-	      
-	rvec_ScaledAdd( workspace->f[i], -1., temp );
-	rvec_Add( workspace->f[j], temp );
-	      
-	rvec_iMultiply( ext_press, nbr_pj->rel_box, temp );
-	rvec_Add( data->my_ext_press, ext_press );
+        /* for pressure coupling, terms not related to bond order derivatives
+           are added directly into pressure vector/tensor */
+        rvec_Scale( temp, CEvd + CEclmb, nbr_pj->dvec );
+
+        rvec_ScaledAdd( workspace->f[i], -1., temp );
+        rvec_Add( workspace->f[j], temp );
+
+        rvec_iMultiply( ext_press, nbr_pj->rel_box, temp );
+        rvec_Add( data->my_ext_press, ext_press );
       }
 
 #ifdef TEST_ENERGY
       //fprintf( out_control->evdw, "%6d%6d%24.15e%24.15e%24.15e\n",
       fprintf( out_control->evdw, "%6d%6d%12.4f%12.4f%12.4f\n",
-	       system->my_atoms[i].orig_id, system->my_atoms[j].orig_id, 
-	       r_ij, e_vdW, data->my_en.e_vdW );
+               system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+               r_ij, e_vdW, data->my_en.e_vdW );
       //fprintf(out_control->ecou,"%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e\n",
       fprintf( out_control->ecou, "%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f\n",
-	       system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
-	       r_ij, system->my_atoms[i].q, system->my_atoms[j].q, 
-	       e_ele, data->my_en.e_ele );
+               system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+               r_ij, system->my_atoms[i].q, system->my_atoms[j].q,
+               e_ele, data->my_en.e_ele );
 #endif
 #ifdef TEST_FORCES
       rvec_ScaledAdd( workspace->f_vdw[i], -CEvd, nbr_pj->dvec );
@@ -408,19 +408,19 @@ void Compute_Polarization_Energy( reax_system *system, simulation_data *data )
   for( i = 0; i < system->n; i++ ) {
     q = system->my_atoms[i].q;
     type_i = system->my_atoms[i].type;
-      
-    en_tmp = KCALpMOL_to_EV * (system->reax_param.sbp[type_i].chi * q + 
-		(system->reax_param.sbp[type_i].eta / 2.) * SQR(q));
+
+    en_tmp = KCALpMOL_to_EV * (system->reax_param.sbp[type_i].chi * q +
+                (system->reax_param.sbp[type_i].eta / 2.) * SQR(q));
     data->my_en.e_pol += en_tmp;
 
     /* tally into per-atom energy */
-    if( system->pair_ptr->evflag) 
+    if( system->pair_ptr->evflag)
       system->pair_ptr->ev_tally(i,i,system->n,1,0.0,en_tmp,0.0,0.0,0.0,0.0);
   }
 }
 
-void LR_vdW_Coulomb( reax_system *system, storage *workspace, 
-	control_params *control, int i, int j, real r_ij, LR_data *lr )
+void LR_vdW_Coulomb( reax_system *system, storage *workspace,
+        control_params *control, int i, int j, real r_ij, LR_data *lr )
 {
   real p_vdW1 = system->reax_param.gp.l[28];
   real p_vdW1i = 1.0 / p_vdW1;
@@ -445,7 +445,7 @@ void LR_vdW_Coulomb( reax_system *system, storage *workspace,
   Tap = Tap * r_ij + workspace->Tap[2];
   Tap = Tap * r_ij + workspace->Tap[1];
   Tap = Tap * r_ij + workspace->Tap[0];
-	  
+
   dTap = 7*workspace->Tap[7] * r_ij + 6*workspace->Tap[6];
   dTap = dTap * r_ij + 5*workspace->Tap[5];
   dTap = dTap * r_ij + 4*workspace->Tap[4];
@@ -458,22 +458,22 @@ void LR_vdW_Coulomb( reax_system *system, storage *workspace,
     { // shielding
       powr_vdW1 = pow(r_ij, p_vdW1);
       powgi_vdW1 = pow( 1.0 / twbp->gamma_w, p_vdW1);
-	
+
       fn13 = pow( powr_vdW1 + powgi_vdW1, p_vdW1i );
       exp1 = exp( twbp->alpha * (1.0 - fn13 / twbp->r_vdW) );
       exp2 = exp( 0.5 * twbp->alpha * (1.0 - fn13 / twbp->r_vdW) );
 
       lr->e_vdW = Tap * twbp->D * (exp1 - 2.0 * exp2);
-	
+
       dfn13 = pow( powr_vdW1 + powgi_vdW1, p_vdW1i-1.0) * pow(r_ij, p_vdW1-2.0);
-	  
-      lr->CEvd = dTap * twbp->D * (exp1 - 2.0 * exp2) - 
-	Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13;
+
+      lr->CEvd = dTap * twbp->D * (exp1 - 2.0 * exp2) -
+        Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) * dfn13;
     }
   else{ // no shielding
     exp1 = exp( twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
     exp2 = exp( 0.5 * twbp->alpha * (1.0 - r_ij / twbp->r_vdW) );
-	
+
     lr->e_vdW = Tap * twbp->D * (exp1 - 2.0 * exp2);
     lr->CEvd = dTap * twbp->D * (exp1 - 2.0 * exp2) -
       Tap * twbp->D * (twbp->alpha / twbp->r_vdW) * (exp1 - exp2) / r_ij;
@@ -483,16 +483,16 @@ void LR_vdW_Coulomb( reax_system *system, storage *workspace,
     { // innner wall
       e_core = twbp->ecore * exp(twbp->acore * (1.0-(r_ij/twbp->rcore)));
       lr->e_vdW += Tap * e_core;
-      
+
       de_core = -(twbp->acore/twbp->rcore) * e_core;
       lr->CEvd += dTap * e_core + Tap * de_core / r_ij;
 
       //  lg correction, only if lgvdw is yes
       if (control->lgflag) {
-        r_ij5 = pow( r_ij, 5.0 ); 
+        r_ij5 = pow( r_ij, 5.0 );
         r_ij6 = pow( r_ij, 6.0 );
         re6 = pow( twbp->lgre, 6.0 );
-        e_lg = -(twbp->lgcij/( r_ij6 + re6 )); 
+        e_lg = -(twbp->lgcij/( r_ij6 + re6 ));
         lr->e_vdW += Tap * e_lg;
 
         de_lg = -6.0 * e_lg *  r_ij5 / ( r_ij6 + re6 ) ;
@@ -501,7 +501,7 @@ void LR_vdW_Coulomb( reax_system *system, storage *workspace,
 
     }
 
-  
+
   /* Coulomb calculations */
   dr3gamij_1 = ( r_ij * r_ij * r_ij + twbp->gamma );
   dr3gamij_3 = pow( dr3gamij_1 , 0.33333333333333 );
@@ -511,10 +511,10 @@ void LR_vdW_Coulomb( reax_system *system, storage *workspace,
   lr->e_ele = C_ele * tmp;
   // fprintf( stderr,
   //    "i:%d(%d), j:%d(%d), gamma:%f, Tap:%f, dr3gamij_3:%f, qi: %f, qj: %f\n",
-  //    i, system->my_atoms[i].type, j, system->my_atoms[j].type, 
-  //    twbp->gamma, Tap, dr3gamij_3, 
+  //    i, system->my_atoms[i].type, j, system->my_atoms[j].type,
+  //    twbp->gamma, Tap, dr3gamij_3,
   //    system->my_atoms[i].q, system->my_atoms[j].q );
-		
+
   lr->CEclmb = C_ele * ( dTap -  Tap * r_ij / dr3gamij_1 ) / dr3gamij_3;
   // fprintf( stdout, "%d %d\t%g\t%g  %g\t%g  %g\t%g  %g\n",
   //    i+1, j+1, r_ij, e_vdW, CEvd * r_ij,
diff --git a/src/USER-REAXC/reaxc_nonbonded.h b/src/USER-REAXC/reaxc_nonbonded.h
index e5cd8e3eb1..ecb07494c6 100644
--- a/src/USER-REAXC/reaxc_nonbonded.h
+++ b/src/USER-REAXC/reaxc_nonbonded.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -30,14 +30,14 @@
 #include "reaxc_types.h"
 
 void vdW_Coulomb_Energy( reax_system*, control_params*, simulation_data*,
-			 storage*, reax_list**, output_controls* );
+                         storage*, reax_list**, output_controls* );
 
-void Tabulated_vdW_Coulomb_Energy( reax_system*, control_params*, 
-				   simulation_data*, storage*, 
-				   reax_list**, output_controls* );
+void Tabulated_vdW_Coulomb_Energy( reax_system*, control_params*,
+                                   simulation_data*, storage*,
+                                   reax_list**, output_controls* );
 
 void Compute_Polarization_Energy( reax_system*, simulation_data* );
 
 void LR_vdW_Coulomb( reax_system*, storage*, control_params*,
-		int, int, real, LR_data* );
+                int, int, real, LR_data* );
 #endif
diff --git a/src/USER-REAXC/reaxc_reset_tools.cpp b/src/USER-REAXC/reaxc_reset_tools.cpp
index 234104c190..d57296a1c1 100644
--- a/src/USER-REAXC/reaxc_reset_tools.cpp
+++ b/src/USER-REAXC/reaxc_reset_tools.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -48,7 +48,7 @@ void Reset_Atoms( reax_system* system, control_params *control )
     for( i = 0; i < system->n; ++i ) {
       atom = &(system->my_atoms[i]);
       if( system->reax_param.sbp[ atom->type ].p_hbond == 1 )
-	atom->Hindex = system->numH++;
+        atom->Hindex = system->numH++;
       else atom->Hindex = -1;
     }
 }
@@ -86,7 +86,7 @@ void Reset_Pressures( simulation_data *data )
 {
   data->flex_bar.P_scalar = 0;
   rtensor_MakeZero( data->flex_bar.P );
-  
+
   data->iso_bar.P = 0;
   rvec_MakeZero( data->int_press );
   rvec_MakeZero( data->my_ext_press );
@@ -156,11 +156,11 @@ void Reset_Grid( grid *g )
   int i, j, k;
 
   for( i = 0; i < g->ncells[0]; i++ )
-    for( j = 0; j < g->ncells[1]; j++ ) 
+    for( j = 0; j < g->ncells[1]; j++ )
       for( k = 0; k < g->ncells[2]; k++ ) {
-	g->cells[i][j][k].top = 0;
-	g->cells[i][j][k].str = 0;
-	g->cells[i][j][k].end = 0;
+        g->cells[i][j][k].top = 0;
+        g->cells[i][j][k].str = 0;
+        g->cells[i][j][k].end = 0;
       }
 }
 
@@ -175,8 +175,8 @@ void Reset_Out_Buffers( mpi_out_data *out_buf, int n )
 
 
 void Reset_Neighbor_Lists( reax_system *system, control_params *control,
-			   storage *workspace, reax_list **lists, 
-			   MPI_Comm comm )
+                           storage *workspace, reax_list **lists,
+                           MPI_Comm comm )
 {
   int i, total_bonds, Hindex, total_hbonds;
   reax_list *bonds, *hbonds;
@@ -197,10 +197,10 @@ void Reset_Neighbor_Lists( reax_system *system, control_params *control,
     if( total_bonds >= bonds->num_intrs * DANGER_ZONE ) {
       workspace->realloc.bonds = 1;
       if( total_bonds >= bonds->num_intrs ) {
-	fprintf(stderr, 
-		"p%d: not enough space for bonds! total=%d allocated=%d\n", 
-		system->my_rank, total_bonds, bonds->num_intrs );
-	MPI_Abort( comm, INSUFFICIENT_MEMORY );
+        fprintf(stderr,
+                "p%d: not enough space for bonds! total=%d allocated=%d\n",
+                system->my_rank, total_bonds, bonds->num_intrs );
+        MPI_Abort( comm, INSUFFICIENT_MEMORY );
       }
     }
   }
@@ -209,28 +209,28 @@ void Reset_Neighbor_Lists( reax_system *system, control_params *control,
   //   system->my_rank, hbonds->n, hbonds->num_intrs, workspace->num_H );
   // MPI_Barrier( comm );
   /* hbonds list */
-  if( control->hbond_cut > 0 && system->numH > 0 ) { 
+  if( control->hbond_cut > 0 && system->numH > 0 ) {
     hbonds = (*lists) + HBONDS;
     total_hbonds = 0;
-    
+
     /* reset start-end indexes */
     for( i = 0; i < system->n; ++i ) {
       Hindex = system->my_atoms[i].Hindex;
       if( Hindex > -1 ) {
-	Set_Start_Index( Hindex, total_hbonds, hbonds );
-	Set_End_Index( Hindex, total_hbonds, hbonds );
-	total_hbonds += system->my_atoms[i].num_hbonds;
+        Set_Start_Index( Hindex, total_hbonds, hbonds );
+        Set_End_Index( Hindex, total_hbonds, hbonds );
+        total_hbonds += system->my_atoms[i].num_hbonds;
       }
     }
-    
+
     /* is reallocation needed? */
     if( total_hbonds >= hbonds->num_intrs * 0.90/*DANGER_ZONE*/ ) {
       workspace->realloc.hbonds = 1;
       if( total_hbonds >= hbonds->num_intrs ) {
-	fprintf(stderr, 
-		"p%d: not enough space for hbonds! total=%d allocated=%d\n", 
-		system->my_rank, total_hbonds, hbonds->num_intrs );
-	MPI_Abort( comm, INSUFFICIENT_MEMORY );
+        fprintf(stderr,
+                "p%d: not enough space for hbonds! total=%d allocated=%d\n",
+                system->my_rank, total_hbonds, hbonds->num_intrs );
+        MPI_Abort( comm, INSUFFICIENT_MEMORY );
       }
     }
   }
@@ -240,20 +240,19 @@ void Reset_Neighbor_Lists( reax_system *system, control_params *control,
 
 
 void Reset( reax_system *system, control_params *control, simulation_data *data,
-	    storage *workspace, reax_list **lists, MPI_Comm comm )
+            storage *workspace, reax_list **lists, MPI_Comm comm )
 {
   Reset_Atoms( system, control );
-  
+
   Reset_Simulation_Data( data, control->virial );
 
-  Reset_Workspace( system, workspace );  
+  Reset_Workspace( system, workspace );
 
   Reset_Neighbor_Lists( system, control, workspace, lists, comm );
 
-#if defined(DEBUG_FOCUS) 
+#if defined(DEBUG_FOCUS)
   fprintf( stderr, "p%d @ step%d: reset done\n", system->my_rank, data->step );
   MPI_Barrier( comm );
 #endif
 
 }
-
diff --git a/src/USER-REAXC/reaxc_reset_tools.h b/src/USER-REAXC/reaxc_reset_tools.h
index 1662813a5c..adc562735c 100644
--- a/src/USER-REAXC/reaxc_reset_tools.h
+++ b/src/USER-REAXC/reaxc_reset_tools.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -35,10 +35,10 @@ void Reset_Timing( reax_timing* );
 void Reset_Workspace( reax_system*, storage* );
 void Reset_Grid( grid* );
 void Reset_Out_Buffers( mpi_out_data*, int );
-void Reset_Neighbor_Lists( reax_system*, control_params*, storage*, 
-			   reax_list**, MPI_Comm );
+void Reset_Neighbor_Lists( reax_system*, control_params*, storage*,
+                           reax_list**, MPI_Comm );
 void Reset( reax_system*, control_params*, simulation_data*, storage*,
-	    reax_list**, MPI_Comm );
+            reax_list**, MPI_Comm );
 #ifdef TEST_FORCES
 void Reset_Test_Forces( reax_system*, storage* );
 #endif
diff --git a/src/USER-REAXC/reaxc_system_props.cpp b/src/USER-REAXC/reaxc_system_props.cpp
index f708d9cac3..0410b625a9 100644
--- a/src/USER-REAXC/reaxc_system_props.cpp
+++ b/src/USER-REAXC/reaxc_system_props.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -40,25 +40,25 @@ void Temperature_Control( control_params *control, simulation_data *data )
 {
   real tmp;
 
-  if( control->T_mode == 1 ) {// step-wise temperature control 
+  if( control->T_mode == 1 ) {// step-wise temperature control
     if((data->step-data->prev_steps) % ((int)(control->T_freq/control->dt))==0){
       if( fabs( control->T - control->T_final ) >= fabs( control->T_rate ) )
-	control->T += control->T_rate;
-      else control->T = control->T_final;	 
+        control->T += control->T_rate;
+      else control->T = control->T_final;
     }
   }
   else if( control->T_mode == 2 ) { // constant slope control
     tmp = control->T_rate * control->dt / control->T_freq;
-    
+
     if( fabs( control->T - control->T_final ) >= fabs( tmp ) )
-      control->T += tmp;       
+      control->T += tmp;
   }
 }
 
 
 
-void Compute_Kinetic_Energy( reax_system* system, simulation_data* data, 
-			     MPI_Comm comm )
+void Compute_Kinetic_Energy( reax_system* system, simulation_data* data,
+                             MPI_Comm comm )
 {
   int i;
   rvec p;
@@ -70,27 +70,27 @@ void Compute_Kinetic_Energy( reax_system* system, simulation_data* data,
 
   for( i = 0; i < system->n; i++ ) {
     m = system->reax_param.sbp[system->my_atoms[i].type].mass;
-    
+
     rvec_Scale( p, m, system->my_atoms[i].v );
     data->my_en.e_kin += 0.5 * rvec_Dot( p, system->my_atoms[i].v );
   }
-  
-  MPI_Allreduce( &data->my_en.e_kin,  &data->sys_en.e_kin,  
-		 1, MPI_DOUBLE, MPI_SUM, comm );
+
+  MPI_Allreduce( &data->my_en.e_kin,  &data->sys_en.e_kin,
+                 1, MPI_DOUBLE, MPI_SUM, comm );
 
   data->therm.T = (2. * data->sys_en.e_kin) / (data->N_f * K_B);
 
   // avoid T being an absolute zero, might cause F.P.E!
-  if( fabs(data->therm.T) < ALMOST_ZERO ) 
+  if( fabs(data->therm.T) < ALMOST_ZERO )
     data->therm.T = ALMOST_ZERO;
 }
 
 
-void Compute_System_Energy( reax_system *system, simulation_data *data, 
-			    MPI_Comm comm )
+void Compute_System_Energy( reax_system *system, simulation_data *data,
+                            MPI_Comm comm )
 {
   real my_en[15], sys_en[15];
-  
+
   my_en[0] = data->my_en.e_bond;
   my_en[1] = data->my_en.e_ov;
   my_en[2] = data->my_en.e_un;
@@ -107,13 +107,13 @@ void Compute_System_Energy( reax_system *system, simulation_data *data,
   my_en[13] = data->my_en.e_kin;
   MPI_Reduce( my_en, sys_en, 14, MPI_DOUBLE, MPI_SUM, MASTER_NODE, comm );
 
-  data->my_en.e_pot = data->my_en.e_bond + 
+  data->my_en.e_pot = data->my_en.e_bond +
     data->my_en.e_ov + data->my_en.e_un  + data->my_en.e_lp +
-    data->my_en.e_ang + data->my_en.e_pen + data->my_en.e_coa + 
-    data->my_en.e_hb + 
-    data->my_en.e_tor + data->my_en.e_con + 
+    data->my_en.e_ang + data->my_en.e_pen + data->my_en.e_coa +
+    data->my_en.e_hb +
+    data->my_en.e_tor + data->my_en.e_con +
     data->my_en.e_vdW + data->my_en.e_ele + data->my_en.e_pol;
-  
+
   data->my_en.e_tot = data->my_en.e_pot + E_CONV * data->my_en.e_kin;
 
   if( system->my_rank == MASTER_NODE ) {
@@ -132,24 +132,24 @@ void Compute_System_Energy( reax_system *system, simulation_data *data,
     data->sys_en.e_pol = sys_en[12];
     data->sys_en.e_kin = sys_en[13];
 
-    data->sys_en.e_pot = data->sys_en.e_bond + 
+    data->sys_en.e_pot = data->sys_en.e_bond +
       data->sys_en.e_ov + data->sys_en.e_un  + data->sys_en.e_lp +
-      data->sys_en.e_ang + data->sys_en.e_pen + data->sys_en.e_coa + 
-      data->sys_en.e_hb + 
-      data->sys_en.e_tor + data->sys_en.e_con + 
+      data->sys_en.e_ang + data->sys_en.e_pen + data->sys_en.e_coa +
+      data->sys_en.e_hb +
+      data->sys_en.e_tor + data->sys_en.e_con +
       data->sys_en.e_vdW + data->sys_en.e_ele + data->sys_en.e_pol;
-    
+
     data->sys_en.e_tot = data->sys_en.e_pot + E_CONV * data->sys_en.e_kin;
   }
 }
 
 
-void Compute_Total_Mass( reax_system *system, simulation_data *data, 
-			 MPI_Comm comm  )
+void Compute_Total_Mass( reax_system *system, simulation_data *data,
+                         MPI_Comm comm  )
 {
   int  i;
   real tmp;
-  
+
   tmp = 0;
   for( i = 0; i < system->n; i++ )
     tmp += system->reax_param.sbp[ system->my_atoms[i].type ].mass;
@@ -161,8 +161,8 @@ void Compute_Total_Mass( reax_system *system, simulation_data *data,
 
 
 
-void Compute_Center_of_Mass( reax_system *system, simulation_data *data, 
-			     mpi_datatypes *mpi_data, MPI_Comm comm )
+void Compute_Center_of_Mass( reax_system *system, simulation_data *data,
+                             mpi_datatypes *mpi_data, MPI_Comm comm )
 {
   int i;
   real m, det; //xx, xy, xz, yy, yz, zz;
@@ -182,11 +182,11 @@ void Compute_Center_of_Mass( reax_system *system, simulation_data *data,
 
     rvec_ScaledAdd( my_xcm, m, system->my_atoms[i].x );
     rvec_ScaledAdd( my_vcm, m, system->my_atoms[i].v );
-    
+
     rvec_Cross( tvec, system->my_atoms[i].x, system->my_atoms[i].v );
     rvec_ScaledAdd( my_amcm, m, tvec );
   }
-  
+
   MPI_Allreduce( my_xcm, data->xcm, 3, MPI_DOUBLE, MPI_SUM, comm );
   MPI_Allreduce( my_vcm, data->vcm, 3, MPI_DOUBLE, MPI_SUM, comm );
   MPI_Allreduce( my_amcm, data->amcm, 3, MPI_DOUBLE, MPI_SUM, comm );
@@ -211,9 +211,9 @@ void Compute_Center_of_Mass( reax_system *system, simulation_data *data,
     tmp_mat[2]/*my_xz*/ += diff[0] * diff[2] * m;
     tmp_mat[3]/*my_yy*/ += diff[1] * diff[1] * m;
     tmp_mat[4]/*my_yz*/ += diff[1] * diff[2] * m;
-    tmp_mat[5]/*my_zz*/ += diff[2] * diff[2] * m;      
+    tmp_mat[5]/*my_zz*/ += diff[2] * diff[2] * m;
   }
-  
+
   MPI_Reduce( tmp_mat, tot_mat, 6, MPI_DOUBLE, MPI_SUM, MASTER_NODE, comm );
 
   if( system->my_rank == MASTER_NODE ) {
@@ -223,15 +223,15 @@ void Compute_Center_of_Mass( reax_system *system, simulation_data *data,
     mat[1][1] = tot_mat[0] + tot_mat[5];  // xx + zz;
     mat[2][1] = mat[1][2] = -tot_mat[4];  // -yz;
     mat[2][2] = tot_mat[0] + tot_mat[3];  // xx + yy;
-    
+
     /* invert the inertial tensor */
-    det = ( mat[0][0] * mat[1][1] * mat[2][2] + 
-	    mat[0][1] * mat[1][2] * mat[2][0] + 
-	    mat[0][2] * mat[1][0] * mat[2][1] ) -
-      ( mat[0][0] * mat[1][2] * mat[2][1] + 
-	mat[0][1] * mat[1][0] * mat[2][2] + 
-	mat[0][2] * mat[1][1] * mat[2][0] );
-    
+    det = ( mat[0][0] * mat[1][1] * mat[2][2] +
+            mat[0][1] * mat[1][2] * mat[2][0] +
+            mat[0][2] * mat[1][0] * mat[2][1] ) -
+      ( mat[0][0] * mat[1][2] * mat[2][1] +
+        mat[0][1] * mat[1][0] * mat[2][2] +
+        mat[0][2] * mat[1][1] * mat[2][0] );
+
     inv[0][0] = mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1];
     inv[0][1] = mat[0][2] * mat[2][1] - mat[0][1] * mat[2][2];
     inv[0][2] = mat[0][1] * mat[1][2] - mat[0][2] * mat[1][1];
@@ -241,7 +241,7 @@ void Compute_Center_of_Mass( reax_system *system, simulation_data *data,
     inv[2][0] = mat[1][0] * mat[2][1] - mat[2][0] * mat[1][1];
     inv[2][1] = mat[2][0] * mat[0][1] - mat[0][0] * mat[2][1];
     inv[2][2] = mat[0][0] * mat[1][1] - mat[1][0] * mat[0][1];
-    
+
     if( det > ALMOST_ZERO )
       rtensor_Scale( inv, 1./det, inv );
     else rtensor_MakeZero( inv );
@@ -256,22 +256,22 @@ void Compute_Center_of_Mass( reax_system *system, simulation_data *data,
   data->erot_cm = 0.5 * E_CONV * rvec_Dot( data->avcm, data->amcm );
 
 #if defined(DEBUG)
-  fprintf( stderr, "xcm:  %24.15e %24.15e %24.15e\n", 
-	   data->xcm[0], data->xcm[1], data->xcm[2] );
-  fprintf( stderr, "vcm:  %24.15e %24.15e %24.15e\n", 
-	   data->vcm[0], data->vcm[1], data->vcm[2] );  
-  fprintf( stderr, "amcm: %24.15e %24.15e %24.15e\n", 
-	   data->amcm[0], data->amcm[1], data->amcm[2] );
+  fprintf( stderr, "xcm:  %24.15e %24.15e %24.15e\n",
+           data->xcm[0], data->xcm[1], data->xcm[2] );
+  fprintf( stderr, "vcm:  %24.15e %24.15e %24.15e\n",
+           data->vcm[0], data->vcm[1], data->vcm[2] );
+  fprintf( stderr, "amcm: %24.15e %24.15e %24.15e\n",
+           data->amcm[0], data->amcm[1], data->amcm[2] );
   /* fprintf( stderr, "mat:  %f %f %f\n     %f %f %f\n     %f %f %f\n",
-     mat[0][0], mat[0][1], mat[0][2], 
-     mat[1][0], mat[1][1], mat[1][2], 
+     mat[0][0], mat[0][1], mat[0][2],
+     mat[1][0], mat[1][1], mat[1][2],
      mat[2][0], mat[2][1], mat[2][2] );
      fprintf( stderr, "inv:  %g %g %g\n     %g %g %g\n     %g %g %g\n",
-     inv[0][0], inv[0][1], inv[0][2], 
-     inv[1][0], inv[1][1], inv[1][2], 
+     inv[0][0], inv[0][1], inv[0][2],
+     inv[1][0], inv[1][1], inv[1][2],
      inv[2][0], inv[2][1], inv[2][2] ); */
-  fprintf( stderr, "avcm: %24.15e %24.15e %24.15e\n", 
-	   data->avcm[0], data->avcm[1], data->avcm[2] );
+  fprintf( stderr, "avcm: %24.15e %24.15e %24.15e\n",
+           data->avcm[0], data->avcm[1], data->avcm[2] );
 #endif
 }
 
@@ -280,13 +280,13 @@ void Compute_Center_of_Mass( reax_system *system, simulation_data *data,
 /* IMPORTANT: This function assumes that current kinetic energy
  * the system is already computed
  *
- * IMPORTANT: In Klein's paper, it is stated that a dU/dV term needs 
- *  to be added when there are long-range interactions or long-range 
+ * IMPORTANT: In Klein's paper, it is stated that a dU/dV term needs
+ *  to be added when there are long-range interactions or long-range
  *  corrections to short-range interactions present.
- *  We may want to add that for more accuracy. 
+ *  We may want to add that for more accuracy.
  */
-void Compute_Pressure(reax_system* system, control_params *control, 
-		      simulation_data* data, mpi_datatypes *mpi_data)
+void Compute_Pressure(reax_system* system, control_params *control,
+                      simulation_data* data, mpi_datatypes *mpi_data)
 {
   int i;
   reax_atom *p_atom;
@@ -300,76 +300,76 @@ void Compute_Pressure(reax_system* system, control_params *control,
   if( control->press_mode == 0 || control->press_mode == 2 ) {
     for( i = 0; i < system->n; ++i ) {
       p_atom = &( system->my_atoms[i] );
-      
+
       /* transform x into unitbox coordinates */
       Transform_to_UnitBox( p_atom->x, big_box, 1, tx );
-      
+
       /* this atom's contribution to internal pressure */
       rvec_Multiply( tmp, p_atom->f, tx );
       rvec_Add( int_press, tmp );
-      
+
 #if defined(DEBUG)
-      fprintf( stderr, "%8d%8.2f%8.2f%8.2f", 
-	       i+1, p_atom->x[0], p_atom->x[1], p_atom->x[2] );
-      fprintf( stderr, "%8.2f%8.2f%8.2f", 
-	       p_atom->f[0], p_atom->f[1], p_atom->f[2] );
-      fprintf( stderr, "%8.2f%8.2f%8.2f\n", 
-	       int_press[0], int_press[1], int_press[2] );
+      fprintf( stderr, "%8d%8.2f%8.2f%8.2f",
+               i+1, p_atom->x[0], p_atom->x[1], p_atom->x[2] );
+      fprintf( stderr, "%8.2f%8.2f%8.2f",
+               p_atom->f[0], p_atom->f[1], p_atom->f[2] );
+      fprintf( stderr, "%8.2f%8.2f%8.2f\n",
+               int_press[0], int_press[1], int_press[2] );
 #endif
     }
   }
 
   /* sum up internal and external pressure */
-#if defined(DEBUG)  
+#if defined(DEBUG)
   fprintf(stderr,"p%d:p_int(%10.5f %10.5f %10.5f)p_ext(%10.5f %10.5f %10.5f)\n",
-	  system->my_rank, int_press[0], int_press[1], int_press[2],
-	  data->my_ext_press[0], data->my_ext_press[1], data->my_ext_press[2] );
+          system->my_rank, int_press[0], int_press[1], int_press[2],
+          data->my_ext_press[0], data->my_ext_press[1], data->my_ext_press[2] );
 #endif
-  MPI_Allreduce( int_press, data->int_press, 
-		 3, MPI_DOUBLE, MPI_SUM, mpi_data->comm_mesh3D );
-  MPI_Allreduce( data->my_ext_press, data->ext_press, 
-		 3, MPI_DOUBLE, MPI_SUM, mpi_data->comm_mesh3D );
-#if defined(DEBUG)  
-  fprintf( stderr, "p%d: %10.5f %10.5f %10.5f\n", 
-	   system->my_rank, 
-	   data->int_press[0], data->int_press[1], data->int_press[2] );
-  fprintf( stderr, "p%d: %10.5f %10.5f %10.5f\n", 
-	   system->my_rank,
-	   data->ext_press[0], data->ext_press[1], data->ext_press[2] );
+  MPI_Allreduce( int_press, data->int_press,
+                 3, MPI_DOUBLE, MPI_SUM, mpi_data->comm_mesh3D );
+  MPI_Allreduce( data->my_ext_press, data->ext_press,
+                 3, MPI_DOUBLE, MPI_SUM, mpi_data->comm_mesh3D );
+#if defined(DEBUG)
+  fprintf( stderr, "p%d: %10.5f %10.5f %10.5f\n",
+           system->my_rank,
+           data->int_press[0], data->int_press[1], data->int_press[2] );
+  fprintf( stderr, "p%d: %10.5f %10.5f %10.5f\n",
+           system->my_rank,
+           data->ext_press[0], data->ext_press[1], data->ext_press[2] );
 #endif
 
   /* kinetic contribution */
   data->kin_press = 2.*(E_CONV*data->sys_en.e_kin) / (3.*big_box->V*P_CONV);
 
-  /* Calculate total pressure in each direction */  
-  data->tot_press[0] = data->kin_press - 
-    (( data->int_press[0] + data->ext_press[0] ) / 
+  /* Calculate total pressure in each direction */
+  data->tot_press[0] = data->kin_press -
+    (( data->int_press[0] + data->ext_press[0] ) /
      ( big_box->box_norms[1] * big_box->box_norms[2] * P_CONV ));
 
-  data->tot_press[1] = data->kin_press - 
-    (( data->int_press[1] + data->ext_press[1] ) / 
+  data->tot_press[1] = data->kin_press -
+    (( data->int_press[1] + data->ext_press[1] ) /
      ( big_box->box_norms[0] * big_box->box_norms[2] * P_CONV ));
 
-  data->tot_press[2] = data->kin_press - 
-    (( data->int_press[2] + data->ext_press[2] ) / 
+  data->tot_press[2] = data->kin_press -
+    (( data->int_press[2] + data->ext_press[2] ) /
      ( big_box->box_norms[0] * big_box->box_norms[1] * P_CONV ));
 
   /* Average pressure for the whole box */
-  data->iso_bar.P = 
+  data->iso_bar.P =
     ( data->tot_press[0] + data->tot_press[1] + data->tot_press[2] ) / 3.;
 }
 
 
 
 /*
-void Compute_Pressure_Isotropic_Klein( reax_system* system, 
-				       simulation_data* data )
+void Compute_Pressure_Isotropic_Klein( reax_system* system,
+                                       simulation_data* data )
 {
   int i;
   reax_atom *p_atom;
   rvec dx;
 
-  // IMPORTANT: This function assumes that current kinetic energy and 
+  // IMPORTANT: This function assumes that current kinetic energy and
   // the center of mass of the system is already computed before.
   data->iso_bar.P = 2.0 * data->my_en.e_kin;
 
@@ -378,11 +378,11 @@ void Compute_Pressure_Isotropic_Klein( reax_system* system,
     rvec_ScaledSum(dx,1.0,p_atom->x,-1.0,data->xcm);
     data->iso_bar.P += ( -F_CONV * rvec_Dot(p_atom->f, dx) );
   }
-  
+
   data->iso_bar.P /= (3.0 * system->my_box.V);
-  
-  // IMPORTANT: In Klein's paper, it is stated that a dU/dV term needs 
-  // to be added when there are long-range interactions or long-range 
+
+  // IMPORTANT: In Klein's paper, it is stated that a dU/dV term needs
+  // to be added when there are long-range interactions or long-range
   // corrections to short-range interactions present.
   // We may want to add that for more accuracy.
 }
@@ -395,22 +395,22 @@ void Compute_Pressure( reax_system* system, simulation_data* data )
   rtensor temp;
 
   rtensor_MakeZero( data->flex_bar.P );
-  
+
   for( i = 0; i < system->N; ++i ) {
     p_atom = &( system->my_atoms[i] );
-    
+
     // Distance_on_T3_Gen( data->rcm, p_atom->x, &(system->my_box), &dx );
-    
+
     rvec_OuterProduct( temp, p_atom->v, p_atom->v );
-    rtensor_ScaledAdd( data->flex_bar.P, 
-		       system->reax_param.sbp[ p_atom->type ].mass, temp );
-    
+    rtensor_ScaledAdd( data->flex_bar.P,
+                       system->reax_param.sbp[ p_atom->type ].mass, temp );
+
     // rvec_OuterProduct(temp,workspace->virial_forces[i],p_atom->x); //dx);
     rtensor_ScaledAdd( data->flex_bar.P, -F_CONV, temp );
   }
-  
+
   rtensor_Scale( data->flex_bar.P, 1.0 / system->my_box.V, data->flex_bar.P );
-  
+
   data->iso_bar.P = rtensor_Trace( data->flex_bar.P ) / 3.0;
 }
 */
diff --git a/src/USER-REAXC/reaxc_system_props.h b/src/USER-REAXC/reaxc_system_props.h
index fb1cc40e60..544b051dce 100644
--- a/src/USER-REAXC/reaxc_system_props.h
+++ b/src/USER-REAXC/reaxc_system_props.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -37,10 +37,10 @@ void Compute_System_Energy( reax_system*, simulation_data*, MPI_Comm );
 
 void Compute_Total_Mass( reax_system*, simulation_data*, MPI_Comm );
 
-void Compute_Center_of_Mass( reax_system*, simulation_data*, 
-			     mpi_datatypes*, MPI_Comm );
+void Compute_Center_of_Mass( reax_system*, simulation_data*,
+                             mpi_datatypes*, MPI_Comm );
 
-void Compute_Pressure( reax_system*, control_params*, 
-		       simulation_data*, mpi_datatypes* );
+void Compute_Pressure( reax_system*, control_params*,
+                       simulation_data*, mpi_datatypes* );
 //void Compute_Pressure( reax_system*, simulation_data* );
 #endif
diff --git a/src/USER-REAXC/reaxc_tool_box.cpp b/src/USER-REAXC/reaxc_tool_box.cpp
index 1846500e05..bee7bb6efe 100644
--- a/src/USER-REAXC/reaxc_tool_box.cpp
+++ b/src/USER-REAXC/reaxc_tool_box.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -42,22 +42,22 @@ int SumScan( int n, int me, int root, MPI_Comm comm )
   if( me == root ) {
     MPI_Comm_size( comm, &wsize );
     nbuf = (int *) calloc( wsize, sizeof(int) );
-    
+
     MPI_Gather( &n, 1, MPI_INT, nbuf, 1, MPI_INT, root, comm );
-    
+
     for( i = 0; i < wsize-1; ++i ) {
       nbuf[i+1] += nbuf[i];
     }
-    
+
     MPI_Scatter( nbuf, 1, MPI_INT, &my_order, 1, MPI_INT, root, comm );
-    
+
     free( nbuf );
   }
   else {
     MPI_Gather( &n, 1, MPI_INT, nbuf, 1, MPI_INT, root, comm );
     MPI_Scatter( nbuf, 1, MPI_INT, &my_order, 1, MPI_INT, root, comm );
   }
-  
+
   return my_order;
 }
 
@@ -72,7 +72,7 @@ void SumScanB( int n, int me, int wsize, int root, MPI_Comm comm, int *nbuf )
     for( i = 0; i < wsize-1; ++i )
       nbuf[i+1] += nbuf[i];
   }
- 
+
   MPI_Bcast( nbuf, wsize, MPI_INT, root, comm );
 }
 #endif
@@ -85,12 +85,12 @@ void Transform( rvec x1, simulation_box *box, char flag, rvec x2 )
   real tmp;
 
   //  printf(">x1: (%lf, %lf, %lf)\n",x1[0],x1[1],x1[2]);
-	  
+
   if (flag > 0) {
     for (i=0; i < 3; i++) {
       tmp = 0.0;
       for (j=0; j < 3; j++)
-	tmp += box->trans[i][j]*x1[j]; 
+        tmp += box->trans[i][j]*x1[j];
       x2[i] = tmp;
     }
   }
@@ -98,18 +98,18 @@ void Transform( rvec x1, simulation_box *box, char flag, rvec x2 )
     for (i=0; i < 3; i++) {
       tmp = 0.0;
       for (j=0; j < 3; j++)
-	tmp += box->trans_inv[i][j]*x1[j]; 
+        tmp += box->trans_inv[i][j]*x1[j];
       x2[i] = tmp;
     }
   }
-  //  printf(">x2: (%lf, %lf, %lf)\n", x2[0], x2[1], x2[2]);  
+  //  printf(">x2: (%lf, %lf, %lf)\n", x2[0], x2[1], x2[2]);
 }
 
 
 void Transform_to_UnitBox( rvec x1, simulation_box *box, char flag, rvec x2 )
 {
   Transform( x1, box, flag, x2 );
-  
+
   x2[0] /= box->box_norms[0];
   x2[1] /= box->box_norms[1];
   x2[2] /= box->box_norms[2];
@@ -122,21 +122,21 @@ void Fit_to_Periodic_Box( simulation_box *box, rvec *p )
   int i;
 
   for( i = 0; i < 3; ++i ) {
-    if( (*p)[i] < box->min[i] ) { 
+    if( (*p)[i] < box->min[i] ) {
       /* handle lower coords */
       while( (*p)[i] < box->min[i] )
-	(*p)[i] += box->box_norms[i];
+        (*p)[i] += box->box_norms[i];
     }
     else if( (*p)[i] >= box->max[i] ) {
       /* handle higher coords */
       while( (*p)[i] >= box->max[i] )
-	(*p)[i] -= box->box_norms[i];
+        (*p)[i] -= box->box_norms[i];
     }
   }
 }
 
 #if defined(PURE_REAX)
-/* determine the touch point, tp, of a box to 
+/* determine the touch point, tp, of a box to
    its neighbor denoted by the relative coordinate rl */
 inline void Box_Touch_Point( simulation_box *box, ivec rl, rvec tp )
 {
@@ -156,8 +156,8 @@ inline void Box_Touch_Point( simulation_box *box, ivec rl, rvec tp )
 /* assumes orthogonal box */
 inline int is_Inside_Box( simulation_box *box, rvec p )
 {
-  if( p[0] < box->min[0] || p[0] >= box->max[0] || 
-      p[1] < box->min[1] || p[1] >= box->max[1] || 
+  if( p[0] < box->min[0] || p[0] >= box->max[0] ||
+      p[1] < box->min[1] || p[1] >= box->max[1] ||
       p[2] < box->min[2] || p[2] >= box->max[2] )
      return 0;
 
@@ -173,11 +173,11 @@ inline int iown_midpoint( simulation_box *box, rvec p1, rvec p2 )
   midp[1] = (p1[1] + p2[1]) / 2;
   midp[2] = (p1[2] + p2[2]) / 2;
 
-  if( midp[0] < box->min[0] || midp[0] >= box->max[0] || 
-      midp[1] < box->min[1] || midp[1] >= box->max[1] || 
+  if( midp[0] < box->min[0] || midp[0] >= box->max[0] ||
+      midp[1] < box->min[1] || midp[1] >= box->max[1] ||
       midp[2] < box->min[2] || midp[2] >= box->max[2] )
      return 0;
-  
+
   return 1;
 }
 
@@ -185,13 +185,13 @@ inline int iown_midpoint( simulation_box *box, rvec p1, rvec p2 )
 
 /**************** from grid.c ****************/
 /* finds the closest point of grid cell cj to ci.
-   no need to consider periodic boundary conditions as in the serial case 
+   no need to consider periodic boundary conditions as in the serial case
    because the box of a process is not periodic in itself */
 inline void GridCell_Closest_Point( grid_cell *gci, grid_cell *gcj,
-				    ivec ci, ivec cj, rvec cp )
+                                    ivec ci, ivec cj, rvec cp )
 {
   int  d;
-  
+
   for( d = 0; d < 3; d++ )
     if( cj[d] > ci[d] )
       cp[d] = gcj->min[d];
@@ -206,7 +206,7 @@ inline void GridCell_Closest_Point( grid_cell *gci, grid_cell *gcj,
 inline void GridCell_to_Box_Points( grid_cell *gc, ivec rl, rvec cp, rvec fp )
 {
   int d;
- 
+
   for( d = 0; d < 3; ++d )
     if( rl[d] == -1 ) {
       cp[d] = gc->min[d];
@@ -218,7 +218,7 @@ inline void GridCell_to_Box_Points( grid_cell *gc, ivec rl, rvec cp, rvec fp )
     else{
       cp[d] = gc->max[d];
       fp[d] = gc->min[d];
-    }  
+    }
 }
 
 
@@ -269,12 +269,12 @@ int is_Valid_Serial( storage *workspace, int serial )
 {
   // if( workspace->map_serials[ serial ] < 0 )
   // {
-  // fprintf( stderr, "CONECT line includes invalid pdb serial number %d.\n", 
+  // fprintf( stderr, "CONECT line includes invalid pdb serial number %d.\n",
   // serial );
   // fprintf( stderr, "Please correct the input file.Terminating...\n" );
   //  MPI_Abort( MPI_COMM_WORLD, INVALID_INPUT );
   // }
-  
+
   return SUCCESS;
 }
 
@@ -283,11 +283,11 @@ int is_Valid_Serial( storage *workspace, int serial )
 int Check_Input_Range( int val, int lo, int hi, char *message, MPI_Comm comm )
 {
   if( val < lo || val > hi ) {
-    fprintf( stderr, "%s\nInput %d - Out of range %d-%d. Terminating...\n", 
-	     message, val, lo, hi );
+    fprintf( stderr, "%s\nInput %d - Out of range %d-%d. Terminating...\n",
+             message, val, lo, hi );
     MPI_Abort( comm, INVALID_INPUT );
   }
-  
+
   return 1;
 }
 
@@ -297,7 +297,7 @@ void Trim_Spaces( char *element )
   int i, j;
 
   for( i = 0; element[i] == ' '; ++i ); // skip initial space chars
-  
+
   for( j = i; j < (int)(strlen(element)) && element[j] != ' '; ++j )
     element[j-i] = toupper( element[j] ); // make uppercase, offset to 0
   element[j-i] = 0; // finalize the string
@@ -307,7 +307,7 @@ void Trim_Spaces( char *element )
 /************ from system_props.c *************/
 struct timeval tim;
 real t_end;
- 
+
 real Get_Time( )
 {
   gettimeofday(&tim, NULL );
@@ -316,7 +316,7 @@ real Get_Time( )
 
 
 real Get_Timing_Info( real t_start )
-{ 
+{
   gettimeofday(&tim, NULL );
   t_end = tim.tv_sec + (tim.tv_usec / 1000000.0);
   return (t_end - t_start);
@@ -343,7 +343,7 @@ int Get_Atom_Type( reax_interaction *reax_param, char *s, MPI_Comm comm )
 
   fprintf( stderr, "Unknown atom type %s. Terminating...\n", s );
   MPI_Abort( comm, UNKNOWN_ATOM_TYPE );
-  
+
   return -1;
 }
 
@@ -393,7 +393,7 @@ int Tokenize( char* s, char*** tok )
   int count=0;
 
   strncpy( test, s, MAX_LINE );
-  
+
   for( word = strtok(test, sep); word; word = strtok(NULL, sep) ) {
     strncpy( (*tok)[count], word, MAX_LINE );
     count++;
@@ -411,15 +411,15 @@ void *smalloc( long n, char *name, MPI_Comm comm )
 
   if( n <= 0 ) {
     fprintf( stderr, "WARNING: trying to allocate %ld bytes for array %s. ",
-	     n, name );
+             n, name );
     fprintf( stderr, "returning NULL.\n" );
     return NULL;
   }
 
   ptr = malloc( n );
   if( ptr == NULL ) {
-    fprintf( stderr, "ERROR: failed to allocate %ld bytes for array %s", 
-	     n, name );
+    fprintf( stderr, "ERROR: failed to allocate %ld bytes for array %s",
+             n, name );
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
 
@@ -434,22 +434,22 @@ void *scalloc( int n, int size, char *name, MPI_Comm comm )
 
   if( n <= 0 ) {
     fprintf( stderr, "WARNING: trying to allocate %d elements for array %s. ",
-	     n, name );
+             n, name );
     fprintf( stderr, "returning NULL.\n" );
     return NULL;
   }
 
   if( size <= 0 ) {
     fprintf( stderr, "WARNING: elements size for array %s is %d. ",
-	     name, size );
+             name, size );
     fprintf( stderr, "returning NULL.\n" );
     return NULL;
   }
 
   ptr = calloc( n, size );
   if( ptr == NULL ) {
-    fprintf( stderr, "ERROR: failed to allocate %d bytes for array %s", 
-	     n*size, name );
+    fprintf( stderr, "ERROR: failed to allocate %d bytes for array %s",
+             n*size, name );
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
 
@@ -462,11 +462,10 @@ void sfree( void *ptr, char *name )
 {
   if( ptr == NULL ) {
     fprintf( stderr, "WARNING: trying to free the already NULL pointer %s!\n",
-	     name );
+             name );
     return;
   }
-  
+
   free( ptr );
   ptr = NULL;
 }
-
diff --git a/src/USER-REAXC/reaxc_tool_box.h b/src/USER-REAXC/reaxc_tool_box.h
index b6666abe4f..b9e1f4a8db 100644
--- a/src/USER-REAXC/reaxc_tool_box.h
+++ b/src/USER-REAXC/reaxc_tool_box.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
diff --git a/src/USER-REAXC/reaxc_torsion_angles.cpp b/src/USER-REAXC/reaxc_torsion_angles.cpp
index 9b3258d8b6..1cbcc5892a 100644
--- a/src/USER-REAXC/reaxc_torsion_angles.cpp
+++ b/src/USER-REAXC/reaxc_torsion_angles.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -42,14 +42,14 @@
 #define MIN_SINE 1e-10
 
 real Calculate_Omega( rvec dvec_ij, real r_ij,
-		      rvec dvec_jk, real r_jk,
-		      rvec dvec_kl, real r_kl,
-		      rvec dvec_li, real r_li,
-		      three_body_interaction_data *p_ijk, 
-		      three_body_interaction_data *p_jkl, 
-		      rvec dcos_omega_di, rvec dcos_omega_dj, 
-		      rvec dcos_omega_dk, rvec dcos_omega_dl, 
-		      output_controls *out_control )
+                      rvec dvec_jk, real r_jk,
+                      rvec dvec_kl, real r_kl,
+                      rvec dvec_li, real r_li,
+                      three_body_interaction_data *p_ijk,
+                      three_body_interaction_data *p_jkl,
+                      rvec dcos_omega_di, rvec dcos_omega_dj,
+                      rvec dcos_omega_dk, rvec dcos_omega_dl,
+                      output_controls *out_control )
 {
   real unnorm_cos_omega, unnorm_sin_omega, omega;
   real sin_ijk, cos_ijk, sin_jkl, cos_jkl;
@@ -63,13 +63,13 @@ real Calculate_Omega( rvec dvec_ij, real r_ij,
   cos_jkl = cos( p_jkl->theta );
 
   /* omega */
-  unnorm_cos_omega = -rvec_Dot(dvec_ij, dvec_jk) * rvec_Dot(dvec_jk, dvec_kl) + 
+  unnorm_cos_omega = -rvec_Dot(dvec_ij, dvec_jk) * rvec_Dot(dvec_jk, dvec_kl) +
     SQR( r_jk ) *  rvec_Dot( dvec_ij, dvec_kl );
 
   rvec_Cross( cross_jk_kl, dvec_jk, dvec_kl );
   unnorm_sin_omega = -r_jk * rvec_Dot( dvec_ij, cross_jk_kl );
 
-  omega = atan2( unnorm_sin_omega, unnorm_cos_omega ); 
+  omega = atan2( unnorm_sin_omega, unnorm_cos_omega );
 
 
   /* derivatives */
@@ -91,16 +91,16 @@ real Calculate_Omega( rvec dvec_ij, real r_ij,
   poem = 2.0 * r_ij * r_kl * sin_ijk * sin_jkl;
   if( poem < 1e-20 ) poem = 1e-20;
 
-  tel  = SQR( r_ij ) + SQR( r_jk ) + SQR( r_kl ) - SQR( r_li ) - 
-    2.0 * ( r_ij * r_jk * cos_ijk - r_ij * r_kl * cos_ijk * cos_jkl + 
-	    r_jk * r_kl * cos_jkl );
-				  
+  tel  = SQR( r_ij ) + SQR( r_jk ) + SQR( r_kl ) - SQR( r_li ) -
+    2.0 * ( r_ij * r_jk * cos_ijk - r_ij * r_kl * cos_ijk * cos_jkl +
+            r_jk * r_kl * cos_jkl );
+
   arg  = tel / poem;
   if( arg >  1.0 ) arg =  1.0;
   if( arg < -1.0 ) arg = -1.0;
 
 
-  /* fprintf( out_control->etor, 
+  /* fprintf( out_control->etor,
      "%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f%12.6f\n",
      htra, htrb, htrc, hthd, hthe, hnra, hnrc, hnhd, hnhe );
      fprintf( out_control->etor, "%12.6f%12.6f%12.6f\n",
@@ -114,10 +114,10 @@ real Calculate_Omega( rvec dvec_ij, real r_ij,
      fprintf( out_control->etor, "%12.6f%12.6f%12.6f\n",
      poem, tel, arg ); */
   /* fprintf( out_control->etor, "%12.6f%12.6f%12.6f\n",
-     -p_ijk->dcos_dk[0]/sin_ijk, -p_ijk->dcos_dk[1]/sin_ijk, 
+     -p_ijk->dcos_dk[0]/sin_ijk, -p_ijk->dcos_dk[1]/sin_ijk,
      -p_ijk->dcos_dk[2]/sin_ijk );
      fprintf( out_control->etor, "%12.6f%12.6f%12.6f\n",
-     -p_jkl->dcos_dk[0]/sin_jkl, -p_jkl->dcos_dk[1]/sin_jkl, 
+     -p_jkl->dcos_dk[0]/sin_jkl, -p_jkl->dcos_dk[1]/sin_jkl,
      -p_jkl->dcos_dk[2]/sin_jkl );*/
 
   if( sin_ijk >= 0 && sin_ijk <= MIN_SINE ) sin_ijk = MIN_SINE;
@@ -131,15 +131,15 @@ real Calculate_Omega( rvec dvec_ij, real r_ij,
   rvec_Scale( dcos_omega_di, 2.0 / poem, dcos_omega_di );
 
   // dcos_omega_dj
-  rvec_ScaledSum( dcos_omega_dj,-(htra-arg*hnra)/r_ij, dvec_ij, 
-		  -htrb / r_jk, dvec_jk );
+  rvec_ScaledSum( dcos_omega_dj,-(htra-arg*hnra)/r_ij, dvec_ij,
+                  -htrb / r_jk, dvec_jk );
   rvec_ScaledAdd( dcos_omega_dj,-(hthd-arg*hnhd)/sin_ijk, p_ijk->dcos_dj );
   rvec_ScaledAdd( dcos_omega_dj,-(hthe-arg*hnhe)/sin_jkl, p_jkl->dcos_di );
   rvec_Scale( dcos_omega_dj, 2.0 / poem, dcos_omega_dj );
 
   // dcos_omega_dk
-  rvec_ScaledSum( dcos_omega_dk,-(htrc-arg*hnrc)/r_kl, dvec_kl,  
-		  htrb / r_jk, dvec_jk );
+  rvec_ScaledSum( dcos_omega_dk,-(htrc-arg*hnrc)/r_kl, dvec_kl,
+                  htrb / r_jk, dvec_jk );
   rvec_ScaledAdd( dcos_omega_dk,-(hthd-arg*hnhd)/sin_ijk, p_ijk->dcos_di );
   rvec_ScaledAdd( dcos_omega_dk,-(hthe-arg*hnhe)/sin_jkl, p_jkl->dcos_dj );
   rvec_Scale( dcos_omega_dk, 2.0 / poem, dcos_omega_dk );
@@ -149,14 +149,14 @@ real Calculate_Omega( rvec dvec_ij, real r_ij,
   rvec_ScaledAdd( dcos_omega_dl,-(hthe-arg*hnhe)/sin_jkl, p_jkl->dcos_dk );
   rvec_Scale( dcos_omega_dl, 2.0 / poem, dcos_omega_dl );
 
-  return omega;  
+  return omega;
 }
 
 
 
-void Torsion_Angles( reax_system *system, control_params *control, 
-		     simulation_data *data, storage *workspace, 
-		     reax_list **lists, output_controls *out_control )
+void Torsion_Angles( reax_system *system, control_params *control,
+                     simulation_data *data, storage *workspace,
+                     reax_list **lists, output_controls *out_control )
 {
   int i, j, k, l, pi, pj, pk, pl, pij, plk, natoms;
   int type_i, type_j, type_k, type_l;
@@ -215,418 +215,418 @@ void Torsion_Angles( reax_system *system, control_params *control,
     Delta_j = workspace->Delta_boc[j];
     start_j = Start_Index(j, bonds);
     end_j = End_Index(j, bonds);
-        
+
     for( pk = start_j; pk < end_j; ++pk ) {
       pbond_jk = &( bonds->select.bond_list[pk] );
       k = pbond_jk->nbr;
       bo_jk = &( pbond_jk->bo_data );
       BOA_jk = bo_jk->BO - control->thb_cut;
-	
+
       /* see if there are any 3-body interactions involving j&k
-	 where j is the central atom. Otherwise there is no point in
-	 trying to form a 4-body interaction out of this neighborhood */
-      if( system->my_atoms[j].orig_id < system->my_atoms[k].orig_id && 
-	  bo_jk->BO > control->thb_cut/*0*/ && Num_Entries(pk, thb_intrs) ) {
-	start_k = Start_Index(k, bonds);
-	end_k = End_Index(k, bonds);	    	       
-	pj = pbond_jk->sym_index; // pj points to j on k's list
-	  
-	/* do the same check as above: 
-	   are there any 3-body interactions involving k&j 
-	   where k is the central atom */
-	if( Num_Entries(pj, thb_intrs) ) {
-	  type_k = system->my_atoms[k].type;
-	  Delta_k = workspace->Delta_boc[k];
-	  r_jk = pbond_jk->d;
-	    
-	  start_pk = Start_Index(pk, thb_intrs );
-	  end_pk = End_Index(pk, thb_intrs );
-	  start_pj = Start_Index(pj, thb_intrs );
-	  end_pj = End_Index(pj, thb_intrs );		
-	    
-	  exp_tor2_jk = exp( -p_tor2 * BOA_jk );
-	  exp_cot2_jk = exp( -p_cot2 * SQR(BOA_jk - 1.5) );
-	  exp_tor3_DjDk = exp( -p_tor3 * (Delta_j + Delta_k) );
-	  exp_tor4_DjDk = exp( p_tor4  * (Delta_j + Delta_k) );
-	  exp_tor34_inv = 1.0 / (1.0 + exp_tor3_DjDk + exp_tor4_DjDk);
-	  f11_DjDk = (2.0 + exp_tor3_DjDk) * exp_tor34_inv;
-	    
-	    
-	  /* pick i up from j-k interaction where j is the central atom */
-	  for( pi = start_pk; pi < end_pk; ++pi ) {
-	    p_ijk = &( thb_intrs->select.three_body_list[pi] );
-	    pij = p_ijk->pthb; // pij is pointer to i on j's bond_list
-	    pbond_ij = &( bonds->select.bond_list[pij] );
-	    bo_ij = &( pbond_ij->bo_data );
-	      
-	      
-	    if( bo_ij->BO > control->thb_cut/*0*/ ) {
-	      i = p_ijk->thb;
-	      type_i = system->my_atoms[i].type;
-	      r_ij = pbond_ij->d;
-	      BOA_ij = bo_ij->BO - control->thb_cut;
-		
-	      theta_ijk = p_ijk->theta;
-	      sin_ijk = sin( theta_ijk );
-	      cos_ijk = cos( theta_ijk );
-	      //tan_ijk_i = 1. / tan( theta_ijk );
-	      if( sin_ijk >= 0 && sin_ijk <= MIN_SINE ) 
-		tan_ijk_i = cos_ijk / MIN_SINE;
-	      else if( sin_ijk <= 0 && sin_ijk >= -MIN_SINE ) 
-		tan_ijk_i = cos_ijk / -MIN_SINE;
-	      else tan_ijk_i = cos_ijk / sin_ijk;
-		
-	      exp_tor2_ij = exp( -p_tor2 * BOA_ij );
-	      exp_cot2_ij = exp( -p_cot2 * SQR(BOA_ij -1.5) );
-		
-		
-	      /* pick l up from j-k interaction where k is the central atom */
-	      for( pl = start_pj; pl < end_pj; ++pl ) {
-		p_jkl = &( thb_intrs->select.three_body_list[pl] );
-		l = p_jkl->thb;
-		plk = p_jkl->pthb; //pointer to l on k's bond_list!
-		pbond_kl = &( bonds->select.bond_list[plk] );
-		bo_kl = &( pbond_kl->bo_data );
-		type_l = system->my_atoms[l].type;
-		fbh = &(system->reax_param.fbp[type_i][type_j]
-			[type_k][type_l]);
-		fbp = &(system->reax_param.fbp[type_i][type_j]
-			[type_k][type_l].prm[0]);
-
-		  
-		if( i != l && fbh->cnt && 
-		    bo_kl->BO > control->thb_cut/*0*/ &&
-		    bo_ij->BO * bo_jk->BO * bo_kl->BO > control->thb_cut/*0*/ ){
-		  ++num_frb_intrs;
-		  r_kl = pbond_kl->d;
-		  BOA_kl = bo_kl->BO - control->thb_cut;
-		    
-		  theta_jkl = p_jkl->theta;
-		  sin_jkl = sin( theta_jkl );
-		  cos_jkl = cos( theta_jkl );
-		  //tan_jkl_i = 1. / tan( theta_jkl );
-		  if( sin_jkl >= 0 && sin_jkl <= MIN_SINE ) 
-		    tan_jkl_i = cos_jkl / MIN_SINE;
-		  else if( sin_jkl <= 0 && sin_jkl >= -MIN_SINE ) 
-		    tan_jkl_i = cos_jkl / -MIN_SINE;
-		  else tan_jkl_i = cos_jkl /sin_jkl;
-		    
-		  rvec_ScaledSum( dvec_li, 1., system->my_atoms[i].x, 
-				  -1., system->my_atoms[l].x );
-		  r_li = rvec_Norm( dvec_li );				 
-		    
-		    
-		  /* omega and its derivative */
-		  omega = Calculate_Omega( pbond_ij->dvec, r_ij, 
-					   pbond_jk->dvec, r_jk, 
-					   pbond_kl->dvec, r_kl,
-					   dvec_li, r_li,
-					   p_ijk, p_jkl,
-					   dcos_omega_di, dcos_omega_dj,
-					   dcos_omega_dk, dcos_omega_dl,
-					   out_control );
-		    
-		  cos_omega = cos( omega );
-		  cos2omega = cos( 2. * omega );
-		  cos3omega = cos( 3. * omega );
-		  /* end omega calculations */
-		    
-		  /* torsion energy */
-		  exp_tor1 = exp( fbp->p_tor1 * 
-				  SQR(2.0 - bo_jk->BO_pi - f11_DjDk) );
-		  exp_tor2_kl = exp( -p_tor2 * BOA_kl );
-		  exp_cot2_kl = exp( -p_cot2 * SQR(BOA_kl - 1.5) );
-		  fn10 = (1.0 - exp_tor2_ij) * (1.0 - exp_tor2_jk) * 
-		    (1.0 - exp_tor2_kl);
-		    
-		  CV = 0.5 * ( fbp->V1 * (1.0 + cos_omega) + 
-			       fbp->V2 * exp_tor1 * (1.0 - cos2omega) +
-			       fbp->V3 * (1.0 + cos3omega) );
-		    
-		  data->my_en.e_tor += e_tor = fn10 * sin_ijk * sin_jkl * CV;
-		    
-		  dfn11 = (-p_tor3 * exp_tor3_DjDk +
-			   (p_tor3 * exp_tor3_DjDk - p_tor4 * exp_tor4_DjDk) *
-			   (2.0 + exp_tor3_DjDk) * exp_tor34_inv) * 
-		    exp_tor34_inv;
-		    
-		  CEtors1 = sin_ijk * sin_jkl * CV;
-		    
-		  CEtors2 = -fn10 * 2.0 * fbp->p_tor1 * fbp->V2 * exp_tor1 *
-		    (2.0 - bo_jk->BO_pi - f11_DjDk) * (1.0 - SQR(cos_omega)) *
-		    sin_ijk * sin_jkl; 
-		  CEtors3 = CEtors2 * dfn11;
-		    
-		  CEtors4 = CEtors1 * p_tor2 * exp_tor2_ij * 
-		    (1.0 - exp_tor2_jk) * (1.0 - exp_tor2_kl);
-		  CEtors5 = CEtors1 * p_tor2 * 
-		    (1.0 - exp_tor2_ij) * exp_tor2_jk * (1.0 - exp_tor2_kl);
-		  CEtors6 = CEtors1 * p_tor2 * 
-		    (1.0 - exp_tor2_ij) * (1.0 - exp_tor2_jk) * exp_tor2_kl;
-		    
-		  cmn = -fn10 * CV;
-		  CEtors7 = cmn * sin_jkl * tan_ijk_i;
-		  CEtors8 = cmn * sin_ijk * tan_jkl_i;
-		    
-		  CEtors9 = fn10 * sin_ijk * sin_jkl * 
-		    (0.5 * fbp->V1 - 2.0 * fbp->V2 * exp_tor1 * cos_omega +
-		     1.5 * fbp->V3 * (cos2omega + 2.0 * SQR(cos_omega)));
-		  /* end  of torsion energy */
-				  
-
-		  /* 4-body conjugation energy */
-		  fn12 = exp_cot2_ij * exp_cot2_jk * exp_cot2_kl;
-		  data->my_en.e_con += e_con =
-		    fbp->p_cot1 * fn12 * 
-		    (1.0 + (SQR(cos_omega) - 1.0) * sin_ijk * sin_jkl);
-		    
-		  Cconj = -2.0 * fn12 * fbp->p_cot1 * p_cot2 * 
-		    (1.0 + (SQR(cos_omega) - 1.0) * sin_ijk * sin_jkl);
-		    
-		  CEconj1 = Cconj * (BOA_ij - 1.5e0);
-		  CEconj2 = Cconj * (BOA_jk - 1.5e0);
-		  CEconj3 = Cconj * (BOA_kl - 1.5e0);
-		    
-		  CEconj4 = -fbp->p_cot1 * fn12 * 
-		    (SQR(cos_omega) - 1.0) * sin_jkl * tan_ijk_i;
-		  CEconj5 = -fbp->p_cot1 * fn12 * 
-		    (SQR(cos_omega) - 1.0) * sin_ijk * tan_jkl_i;
-		  CEconj6 = 2.0 * fbp->p_cot1 * fn12 * 
-		    cos_omega * sin_ijk * sin_jkl;
-		  /* end 4-body conjugation energy */
-		  
-		  /* forces */
-		  bo_jk->Cdbopi += CEtors2;
-		  workspace->CdDelta[j] += CEtors3;
-		  workspace->CdDelta[k] += CEtors3;
-		  bo_ij->Cdbo += (CEtors4 + CEconj1);
-		  bo_jk->Cdbo += (CEtors5 + CEconj2);
-		  bo_kl->Cdbo += (CEtors6 + CEconj3);
-		    
-		  if( control->virial == 0 ) {
-		    /* dcos_theta_ijk */
-		    rvec_ScaledAdd( workspace->f[i], 
-				    CEtors7 + CEconj4, p_ijk->dcos_dk );
-		    rvec_ScaledAdd( workspace->f[j], 
-				    CEtors7 + CEconj4, p_ijk->dcos_dj );
-		    rvec_ScaledAdd( workspace->f[k], 
-				    CEtors7 + CEconj4, p_ijk->dcos_di );
-		      
-		    /* dcos_theta_jkl */
-		    rvec_ScaledAdd( workspace->f[j], 
-				    CEtors8 + CEconj5, p_jkl->dcos_di );
-		    rvec_ScaledAdd( workspace->f[k], 
-				    CEtors8 + CEconj5, p_jkl->dcos_dj );
-		    rvec_ScaledAdd( workspace->f[l], 
-				    CEtors8 + CEconj5, p_jkl->dcos_dk );
-		      
-		    /* dcos_omega */
-		    rvec_ScaledAdd( workspace->f[i], 
-				    CEtors9 + CEconj6, dcos_omega_di );
-		    rvec_ScaledAdd( workspace->f[j], 
-				    CEtors9 + CEconj6, dcos_omega_dj );
-		    rvec_ScaledAdd( workspace->f[k], 
-				    CEtors9 + CEconj6, dcos_omega_dk );
-		    rvec_ScaledAdd( workspace->f[l], 
-				    CEtors9 + CEconj6, dcos_omega_dl );
-		  }
-		  else {
-		    ivec_Sum(rel_box_jl, pbond_jk->rel_box, pbond_kl->rel_box);
-		      
-		    /* dcos_theta_ijk */
-		    rvec_Scale( force, CEtors7 + CEconj4, p_ijk->dcos_dk );
-		    rvec_Add( workspace->f[i], force );
-		    rvec_iMultiply( ext_press, pbond_ij->rel_box, force );
-		    rvec_Add( data->my_ext_press, ext_press );
-			
-		    rvec_ScaledAdd( workspace->f[j], 
-				    CEtors7 + CEconj4, p_ijk->dcos_dj );
-			
-		    rvec_Scale( force, CEtors7 + CEconj4, p_ijk->dcos_di );
-		    rvec_Add( workspace->f[k], force );
-		    rvec_iMultiply( ext_press, pbond_jk->rel_box, force );
-		    rvec_Add( data->my_ext_press, ext_press );
-		      
-		      
-		    /* dcos_theta_jkl */
-		    rvec_ScaledAdd( workspace->f[j], 
-				    CEtors8 + CEconj5, p_jkl->dcos_di );
-			
-		    rvec_Scale( force, CEtors8 + CEconj5, p_jkl->dcos_dj );
-		    rvec_Add( workspace->f[k], force );
-		    rvec_iMultiply( ext_press, pbond_jk->rel_box, force );
-		    rvec_Add( data->my_ext_press, ext_press );
-		      
-		    rvec_Scale( force, CEtors8 + CEconj5, p_jkl->dcos_dk );
-		    rvec_Add( workspace->f[l], force );
-		    rvec_iMultiply( ext_press, rel_box_jl, force );
-		    rvec_Add( data->my_ext_press, ext_press );
-		      
-		      
-		    /* dcos_omega */				      
-		    rvec_Scale( force, CEtors9 + CEconj6, dcos_omega_di );
-		    rvec_Add( workspace->f[i], force );
-		    rvec_iMultiply( ext_press, pbond_ij->rel_box, force );
-		    rvec_Add( data->my_ext_press, ext_press );
-		      
-		    rvec_ScaledAdd( workspace->f[j], 
-				    CEtors9 + CEconj6, dcos_omega_dj );
-		      
-		    rvec_Scale( force, CEtors9 + CEconj6, dcos_omega_dk );
-		    rvec_Add( workspace->f[k], force );
-		    rvec_iMultiply( ext_press, pbond_jk->rel_box, force );
-		    rvec_Add( data->my_ext_press, ext_press );
-		      
-		    rvec_Scale( force, CEtors9 + CEconj6, dcos_omega_dl );
-		    rvec_Add( workspace->f[l], force );
-		    rvec_iMultiply( ext_press, rel_box_jl, force );
-		    rvec_Add( data->my_ext_press, ext_press );
-		  }
-
-		  /* tally into per-atom virials */
-		  if( system->pair_ptr->vflag_atom || system->pair_ptr->evflag) {
-
-		    // acquire vectors
-		    rvec_ScaledSum( delil, 1., system->my_atoms[l].x,
-					  -1., system->my_atoms[i].x );
-		    rvec_ScaledSum( deljl, 1., system->my_atoms[l].x,
-					  -1., system->my_atoms[j].x );
-		    rvec_ScaledSum( delkl, 1., system->my_atoms[l].x,
-					  -1., system->my_atoms[k].x );
-		    // dcos_theta_ijk
-		    rvec_Scale( fi_tmp, CEtors7 + CEconj4, p_ijk->dcos_dk );
-		    rvec_Scale( fj_tmp, CEtors7 + CEconj4, p_ijk->dcos_dj );
-		    rvec_Scale( fk_tmp, CEtors7 + CEconj4, p_ijk->dcos_di );
-
-		    // dcos_theta_jkl
-		    rvec_ScaledAdd( fj_tmp, CEtors8 + CEconj5, p_jkl->dcos_di );
-		    rvec_ScaledAdd( fk_tmp, CEtors8 + CEconj5, p_jkl->dcos_dj );
-
-		    // dcos_omega
-		    rvec_ScaledAdd( fi_tmp, CEtors9 + CEconj6, dcos_omega_di );
-		    rvec_ScaledAdd( fj_tmp, CEtors9 + CEconj6, dcos_omega_dj );
-		    rvec_ScaledAdd( fk_tmp, CEtors9 + CEconj6, dcos_omega_dk );
-
-		    // tally
-		    eng_tmp = e_tor + e_con;
-		    if( system->pair_ptr->evflag)
-			    system->pair_ptr->ev_tally(j,k,natoms,1,eng_tmp,0.0,0.0,0.0,0.0,0.0);
-		    if( system->pair_ptr->vflag_atom)
-			    system->pair_ptr->v_tally4(i,j,k,l,fi_tmp,fj_tmp,fk_tmp,delil,deljl,delkl);
-		  }
-		  
+         where j is the central atom. Otherwise there is no point in
+         trying to form a 4-body interaction out of this neighborhood */
+      if( system->my_atoms[j].orig_id < system->my_atoms[k].orig_id &&
+          bo_jk->BO > control->thb_cut/*0*/ && Num_Entries(pk, thb_intrs) ) {
+        start_k = Start_Index(k, bonds);
+        end_k = End_Index(k, bonds);
+        pj = pbond_jk->sym_index; // pj points to j on k's list
+
+        /* do the same check as above:
+           are there any 3-body interactions involving k&j
+           where k is the central atom */
+        if( Num_Entries(pj, thb_intrs) ) {
+          type_k = system->my_atoms[k].type;
+          Delta_k = workspace->Delta_boc[k];
+          r_jk = pbond_jk->d;
+
+          start_pk = Start_Index(pk, thb_intrs );
+          end_pk = End_Index(pk, thb_intrs );
+          start_pj = Start_Index(pj, thb_intrs );
+          end_pj = End_Index(pj, thb_intrs );
+
+          exp_tor2_jk = exp( -p_tor2 * BOA_jk );
+          exp_cot2_jk = exp( -p_cot2 * SQR(BOA_jk - 1.5) );
+          exp_tor3_DjDk = exp( -p_tor3 * (Delta_j + Delta_k) );
+          exp_tor4_DjDk = exp( p_tor4  * (Delta_j + Delta_k) );
+          exp_tor34_inv = 1.0 / (1.0 + exp_tor3_DjDk + exp_tor4_DjDk);
+          f11_DjDk = (2.0 + exp_tor3_DjDk) * exp_tor34_inv;
+
+
+          /* pick i up from j-k interaction where j is the central atom */
+          for( pi = start_pk; pi < end_pk; ++pi ) {
+            p_ijk = &( thb_intrs->select.three_body_list[pi] );
+            pij = p_ijk->pthb; // pij is pointer to i on j's bond_list
+            pbond_ij = &( bonds->select.bond_list[pij] );
+            bo_ij = &( pbond_ij->bo_data );
+
+
+            if( bo_ij->BO > control->thb_cut/*0*/ ) {
+              i = p_ijk->thb;
+              type_i = system->my_atoms[i].type;
+              r_ij = pbond_ij->d;
+              BOA_ij = bo_ij->BO - control->thb_cut;
+
+              theta_ijk = p_ijk->theta;
+              sin_ijk = sin( theta_ijk );
+              cos_ijk = cos( theta_ijk );
+              //tan_ijk_i = 1. / tan( theta_ijk );
+              if( sin_ijk >= 0 && sin_ijk <= MIN_SINE )
+                tan_ijk_i = cos_ijk / MIN_SINE;
+              else if( sin_ijk <= 0 && sin_ijk >= -MIN_SINE )
+                tan_ijk_i = cos_ijk / -MIN_SINE;
+              else tan_ijk_i = cos_ijk / sin_ijk;
+
+              exp_tor2_ij = exp( -p_tor2 * BOA_ij );
+              exp_cot2_ij = exp( -p_cot2 * SQR(BOA_ij -1.5) );
+
+
+              /* pick l up from j-k interaction where k is the central atom */
+              for( pl = start_pj; pl < end_pj; ++pl ) {
+                p_jkl = &( thb_intrs->select.three_body_list[pl] );
+                l = p_jkl->thb;
+                plk = p_jkl->pthb; //pointer to l on k's bond_list!
+                pbond_kl = &( bonds->select.bond_list[plk] );
+                bo_kl = &( pbond_kl->bo_data );
+                type_l = system->my_atoms[l].type;
+                fbh = &(system->reax_param.fbp[type_i][type_j]
+                        [type_k][type_l]);
+                fbp = &(system->reax_param.fbp[type_i][type_j]
+                        [type_k][type_l].prm[0]);
+
+
+                if( i != l && fbh->cnt &&
+                    bo_kl->BO > control->thb_cut/*0*/ &&
+                    bo_ij->BO * bo_jk->BO * bo_kl->BO > control->thb_cut/*0*/ ){
+                  ++num_frb_intrs;
+                  r_kl = pbond_kl->d;
+                  BOA_kl = bo_kl->BO - control->thb_cut;
+
+                  theta_jkl = p_jkl->theta;
+                  sin_jkl = sin( theta_jkl );
+                  cos_jkl = cos( theta_jkl );
+                  //tan_jkl_i = 1. / tan( theta_jkl );
+                  if( sin_jkl >= 0 && sin_jkl <= MIN_SINE )
+                    tan_jkl_i = cos_jkl / MIN_SINE;
+                  else if( sin_jkl <= 0 && sin_jkl >= -MIN_SINE )
+                    tan_jkl_i = cos_jkl / -MIN_SINE;
+                  else tan_jkl_i = cos_jkl /sin_jkl;
+
+                  rvec_ScaledSum( dvec_li, 1., system->my_atoms[i].x,
+                                  -1., system->my_atoms[l].x );
+                  r_li = rvec_Norm( dvec_li );
+
+
+                  /* omega and its derivative */
+                  omega = Calculate_Omega( pbond_ij->dvec, r_ij,
+                                           pbond_jk->dvec, r_jk,
+                                           pbond_kl->dvec, r_kl,
+                                           dvec_li, r_li,
+                                           p_ijk, p_jkl,
+                                           dcos_omega_di, dcos_omega_dj,
+                                           dcos_omega_dk, dcos_omega_dl,
+                                           out_control );
+
+                  cos_omega = cos( omega );
+                  cos2omega = cos( 2. * omega );
+                  cos3omega = cos( 3. * omega );
+                  /* end omega calculations */
+
+                  /* torsion energy */
+                  exp_tor1 = exp( fbp->p_tor1 *
+                                  SQR(2.0 - bo_jk->BO_pi - f11_DjDk) );
+                  exp_tor2_kl = exp( -p_tor2 * BOA_kl );
+                  exp_cot2_kl = exp( -p_cot2 * SQR(BOA_kl - 1.5) );
+                  fn10 = (1.0 - exp_tor2_ij) * (1.0 - exp_tor2_jk) *
+                    (1.0 - exp_tor2_kl);
+
+                  CV = 0.5 * ( fbp->V1 * (1.0 + cos_omega) +
+                               fbp->V2 * exp_tor1 * (1.0 - cos2omega) +
+                               fbp->V3 * (1.0 + cos3omega) );
+
+                  data->my_en.e_tor += e_tor = fn10 * sin_ijk * sin_jkl * CV;
+
+                  dfn11 = (-p_tor3 * exp_tor3_DjDk +
+                           (p_tor3 * exp_tor3_DjDk - p_tor4 * exp_tor4_DjDk) *
+                           (2.0 + exp_tor3_DjDk) * exp_tor34_inv) *
+                    exp_tor34_inv;
+
+                  CEtors1 = sin_ijk * sin_jkl * CV;
+
+                  CEtors2 = -fn10 * 2.0 * fbp->p_tor1 * fbp->V2 * exp_tor1 *
+                    (2.0 - bo_jk->BO_pi - f11_DjDk) * (1.0 - SQR(cos_omega)) *
+                    sin_ijk * sin_jkl;
+                  CEtors3 = CEtors2 * dfn11;
+
+                  CEtors4 = CEtors1 * p_tor2 * exp_tor2_ij *
+                    (1.0 - exp_tor2_jk) * (1.0 - exp_tor2_kl);
+                  CEtors5 = CEtors1 * p_tor2 *
+                    (1.0 - exp_tor2_ij) * exp_tor2_jk * (1.0 - exp_tor2_kl);
+                  CEtors6 = CEtors1 * p_tor2 *
+                    (1.0 - exp_tor2_ij) * (1.0 - exp_tor2_jk) * exp_tor2_kl;
+
+                  cmn = -fn10 * CV;
+                  CEtors7 = cmn * sin_jkl * tan_ijk_i;
+                  CEtors8 = cmn * sin_ijk * tan_jkl_i;
+
+                  CEtors9 = fn10 * sin_ijk * sin_jkl *
+                    (0.5 * fbp->V1 - 2.0 * fbp->V2 * exp_tor1 * cos_omega +
+                     1.5 * fbp->V3 * (cos2omega + 2.0 * SQR(cos_omega)));
+                  /* end  of torsion energy */
+
+
+                  /* 4-body conjugation energy */
+                  fn12 = exp_cot2_ij * exp_cot2_jk * exp_cot2_kl;
+                  data->my_en.e_con += e_con =
+                    fbp->p_cot1 * fn12 *
+                    (1.0 + (SQR(cos_omega) - 1.0) * sin_ijk * sin_jkl);
+
+                  Cconj = -2.0 * fn12 * fbp->p_cot1 * p_cot2 *
+                    (1.0 + (SQR(cos_omega) - 1.0) * sin_ijk * sin_jkl);
+
+                  CEconj1 = Cconj * (BOA_ij - 1.5e0);
+                  CEconj2 = Cconj * (BOA_jk - 1.5e0);
+                  CEconj3 = Cconj * (BOA_kl - 1.5e0);
+
+                  CEconj4 = -fbp->p_cot1 * fn12 *
+                    (SQR(cos_omega) - 1.0) * sin_jkl * tan_ijk_i;
+                  CEconj5 = -fbp->p_cot1 * fn12 *
+                    (SQR(cos_omega) - 1.0) * sin_ijk * tan_jkl_i;
+                  CEconj6 = 2.0 * fbp->p_cot1 * fn12 *
+                    cos_omega * sin_ijk * sin_jkl;
+                  /* end 4-body conjugation energy */
+
+                  /* forces */
+                  bo_jk->Cdbopi += CEtors2;
+                  workspace->CdDelta[j] += CEtors3;
+                  workspace->CdDelta[k] += CEtors3;
+                  bo_ij->Cdbo += (CEtors4 + CEconj1);
+                  bo_jk->Cdbo += (CEtors5 + CEconj2);
+                  bo_kl->Cdbo += (CEtors6 + CEconj3);
+
+                  if( control->virial == 0 ) {
+                    /* dcos_theta_ijk */
+                    rvec_ScaledAdd( workspace->f[i],
+                                    CEtors7 + CEconj4, p_ijk->dcos_dk );
+                    rvec_ScaledAdd( workspace->f[j],
+                                    CEtors7 + CEconj4, p_ijk->dcos_dj );
+                    rvec_ScaledAdd( workspace->f[k],
+                                    CEtors7 + CEconj4, p_ijk->dcos_di );
+
+                    /* dcos_theta_jkl */
+                    rvec_ScaledAdd( workspace->f[j],
+                                    CEtors8 + CEconj5, p_jkl->dcos_di );
+                    rvec_ScaledAdd( workspace->f[k],
+                                    CEtors8 + CEconj5, p_jkl->dcos_dj );
+                    rvec_ScaledAdd( workspace->f[l],
+                                    CEtors8 + CEconj5, p_jkl->dcos_dk );
+
+                    /* dcos_omega */
+                    rvec_ScaledAdd( workspace->f[i],
+                                    CEtors9 + CEconj6, dcos_omega_di );
+                    rvec_ScaledAdd( workspace->f[j],
+                                    CEtors9 + CEconj6, dcos_omega_dj );
+                    rvec_ScaledAdd( workspace->f[k],
+                                    CEtors9 + CEconj6, dcos_omega_dk );
+                    rvec_ScaledAdd( workspace->f[l],
+                                    CEtors9 + CEconj6, dcos_omega_dl );
+                  }
+                  else {
+                    ivec_Sum(rel_box_jl, pbond_jk->rel_box, pbond_kl->rel_box);
+
+                    /* dcos_theta_ijk */
+                    rvec_Scale( force, CEtors7 + CEconj4, p_ijk->dcos_dk );
+                    rvec_Add( workspace->f[i], force );
+                    rvec_iMultiply( ext_press, pbond_ij->rel_box, force );
+                    rvec_Add( data->my_ext_press, ext_press );
+
+                    rvec_ScaledAdd( workspace->f[j],
+                                    CEtors7 + CEconj4, p_ijk->dcos_dj );
+
+                    rvec_Scale( force, CEtors7 + CEconj4, p_ijk->dcos_di );
+                    rvec_Add( workspace->f[k], force );
+                    rvec_iMultiply( ext_press, pbond_jk->rel_box, force );
+                    rvec_Add( data->my_ext_press, ext_press );
+
+
+                    /* dcos_theta_jkl */
+                    rvec_ScaledAdd( workspace->f[j],
+                                    CEtors8 + CEconj5, p_jkl->dcos_di );
+
+                    rvec_Scale( force, CEtors8 + CEconj5, p_jkl->dcos_dj );
+                    rvec_Add( workspace->f[k], force );
+                    rvec_iMultiply( ext_press, pbond_jk->rel_box, force );
+                    rvec_Add( data->my_ext_press, ext_press );
+
+                    rvec_Scale( force, CEtors8 + CEconj5, p_jkl->dcos_dk );
+                    rvec_Add( workspace->f[l], force );
+                    rvec_iMultiply( ext_press, rel_box_jl, force );
+                    rvec_Add( data->my_ext_press, ext_press );
+
+
+                    /* dcos_omega */
+                    rvec_Scale( force, CEtors9 + CEconj6, dcos_omega_di );
+                    rvec_Add( workspace->f[i], force );
+                    rvec_iMultiply( ext_press, pbond_ij->rel_box, force );
+                    rvec_Add( data->my_ext_press, ext_press );
+
+                    rvec_ScaledAdd( workspace->f[j],
+                                    CEtors9 + CEconj6, dcos_omega_dj );
+
+                    rvec_Scale( force, CEtors9 + CEconj6, dcos_omega_dk );
+                    rvec_Add( workspace->f[k], force );
+                    rvec_iMultiply( ext_press, pbond_jk->rel_box, force );
+                    rvec_Add( data->my_ext_press, ext_press );
+
+                    rvec_Scale( force, CEtors9 + CEconj6, dcos_omega_dl );
+                    rvec_Add( workspace->f[l], force );
+                    rvec_iMultiply( ext_press, rel_box_jl, force );
+                    rvec_Add( data->my_ext_press, ext_press );
+                  }
+
+                  /* tally into per-atom virials */
+                  if( system->pair_ptr->vflag_atom || system->pair_ptr->evflag) {
+
+                    // acquire vectors
+                    rvec_ScaledSum( delil, 1., system->my_atoms[l].x,
+                                          -1., system->my_atoms[i].x );
+                    rvec_ScaledSum( deljl, 1., system->my_atoms[l].x,
+                                          -1., system->my_atoms[j].x );
+                    rvec_ScaledSum( delkl, 1., system->my_atoms[l].x,
+                                          -1., system->my_atoms[k].x );
+                    // dcos_theta_ijk
+                    rvec_Scale( fi_tmp, CEtors7 + CEconj4, p_ijk->dcos_dk );
+                    rvec_Scale( fj_tmp, CEtors7 + CEconj4, p_ijk->dcos_dj );
+                    rvec_Scale( fk_tmp, CEtors7 + CEconj4, p_ijk->dcos_di );
+
+                    // dcos_theta_jkl
+                    rvec_ScaledAdd( fj_tmp, CEtors8 + CEconj5, p_jkl->dcos_di );
+                    rvec_ScaledAdd( fk_tmp, CEtors8 + CEconj5, p_jkl->dcos_dj );
+
+                    // dcos_omega
+                    rvec_ScaledAdd( fi_tmp, CEtors9 + CEconj6, dcos_omega_di );
+                    rvec_ScaledAdd( fj_tmp, CEtors9 + CEconj6, dcos_omega_dj );
+                    rvec_ScaledAdd( fk_tmp, CEtors9 + CEconj6, dcos_omega_dk );
+
+                    // tally
+                    eng_tmp = e_tor + e_con;
+                    if( system->pair_ptr->evflag)
+                            system->pair_ptr->ev_tally(j,k,natoms,1,eng_tmp,0.0,0.0,0.0,0.0,0.0);
+                    if( system->pair_ptr->vflag_atom)
+                            system->pair_ptr->v_tally4(i,j,k,l,fi_tmp,fj_tmp,fk_tmp,delil,deljl,delkl);
+                  }
+
 
 #ifdef TEST_ENERGY
-		  /* fprintf( out_control->etor, 
-		     "%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f\n",
-		     r_ij, r_jk, r_kl, cos_ijk, cos_jkl, sin_ijk, sin_jkl );
-		     fprintf( out_control->etor, "%12.8f\n", dfn11 ); */
-		  /* fprintf( out_control->etor, 
-		     "%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f\n",
-		     CEtors2, CEtors3, CEtors4, CEtors5, CEtors6, 
-		     CEtors7, CEtors8, CEtors9 ); */
-		  /* fprintf( out_control->etor, 
-		     "%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f\n",
-		     htra, htrb, htrc, hthd, hthe, hnra, hnrc, hnhd, hnhe ); */
-		  /* fprintf( out_control->etor, 
-		     "%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f\n",
-		     CEconj1, CEconj2, CEconj3, CEconj4, CEconj5, CEconj6 ); */
-				  
-		  /* fprintf( out_control->etor, "%12.6f%12.6f%12.6f%12.6f\n",
-		     fbp->V1, fbp->V2, fbp->V3, fbp->p_tor1 );*/
-		  
-		  fprintf(out_control->etor, 
-			  //"%6d%6d%6d%6d%24.15e%24.15e%24.15e%24.15e\n", 
-			  "%6d%6d%6d%6d%12.4f%12.4f%12.4f%12.4f\n", 
-			  system->my_atoms[i].orig_id,system->my_atoms[j].orig_id, 
-			  system->my_atoms[k].orig_id,system->my_atoms[l].orig_id, 
-			   RAD2DEG(omega), BOA_jk, e_tor, data->my_en.e_tor );
-		  
-		  fprintf(out_control->econ, 
-			  //"%6d%6d%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n", 
-			  "%6d%6d%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f%12.4f\n", 
-			  system->my_atoms[i].orig_id,system->my_atoms[j].orig_id, 
-			  system->my_atoms[k].orig_id,system->my_atoms[l].orig_id, 
-			  RAD2DEG(omega), BOA_ij, BOA_jk, BOA_kl, 
-			  e_con, data->my_en.e_con );
+                  /* fprintf( out_control->etor,
+                     "%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f\n",
+                     r_ij, r_jk, r_kl, cos_ijk, cos_jkl, sin_ijk, sin_jkl );
+                     fprintf( out_control->etor, "%12.8f\n", dfn11 ); */
+                  /* fprintf( out_control->etor,
+                     "%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f\n",
+                     CEtors2, CEtors3, CEtors4, CEtors5, CEtors6,
+                     CEtors7, CEtors8, CEtors9 ); */
+                  /* fprintf( out_control->etor,
+                     "%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f\n",
+                     htra, htrb, htrc, hthd, hthe, hnra, hnrc, hnhd, hnhe ); */
+                  /* fprintf( out_control->etor,
+                     "%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f\n",
+                     CEconj1, CEconj2, CEconj3, CEconj4, CEconj5, CEconj6 ); */
+
+                  /* fprintf( out_control->etor, "%12.6f%12.6f%12.6f%12.6f\n",
+                     fbp->V1, fbp->V2, fbp->V3, fbp->p_tor1 );*/
+
+                  fprintf(out_control->etor,
+                          //"%6d%6d%6d%6d%24.15e%24.15e%24.15e%24.15e\n",
+                          "%6d%6d%6d%6d%12.4f%12.4f%12.4f%12.4f\n",
+                          system->my_atoms[i].orig_id,system->my_atoms[j].orig_id,
+                          system->my_atoms[k].orig_id,system->my_atoms[l].orig_id,
+                           RAD2DEG(omega), BOA_jk, e_tor, data->my_en.e_tor );
+
+                  fprintf(out_control->econ,
+                          //"%6d%6d%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n",
+                          "%6d%6d%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f%12.4f\n",
+                          system->my_atoms[i].orig_id,system->my_atoms[j].orig_id,
+                          system->my_atoms[k].orig_id,system->my_atoms[l].orig_id,
+                          RAD2DEG(omega), BOA_ij, BOA_jk, BOA_kl,
+                          e_con, data->my_en.e_con );
 #endif
-		    
+
 #ifdef TEST_FORCES
-		  /* Torsion Forces */
-		  Add_dBOpinpi2( system, lists, j, pk, CEtors2, 0.0, 
-				 workspace->f_tor, workspace->f_tor );
-		  Add_dDelta( system, lists, j, CEtors3, workspace->f_tor );
-		  Add_dDelta( system, lists, k, CEtors3, workspace->f_tor );
-		  Add_dBO( system, lists, j, pij, CEtors4, workspace->f_tor );
-		  Add_dBO( system, lists, j, pk, CEtors5, workspace->f_tor );
-		  Add_dBO( system, lists, k, plk, CEtors6, workspace->f_tor );
-		    
-		  rvec_ScaledAdd( workspace->f_tor[i], 
-				  CEtors7, p_ijk->dcos_dk );
-		  rvec_ScaledAdd( workspace->f_tor[j], 
-				  CEtors7, p_ijk->dcos_dj );
-		  rvec_ScaledAdd( workspace->f_tor[k], 
-				  CEtors7, p_ijk->dcos_di );
-			  
-		  rvec_ScaledAdd( workspace->f_tor[j], 
-				  CEtors8, p_jkl->dcos_di );
-		  rvec_ScaledAdd( workspace->f_tor[k], 
-				  CEtors8, p_jkl->dcos_dj );
-		  rvec_ScaledAdd( workspace->f_tor[l], 
-				  CEtors8, p_jkl->dcos_dk );
-			  
-		  rvec_ScaledAdd( workspace->f_tor[i], 
-				  CEtors9, dcos_omega_di );
-		  rvec_ScaledAdd( workspace->f_tor[j], 
-				  CEtors9, dcos_omega_dj );
-		  rvec_ScaledAdd( workspace->f_tor[k], 
-				  CEtors9, dcos_omega_dk );
-		  rvec_ScaledAdd( workspace->f_tor[l], 
-				  CEtors9, dcos_omega_dl );
-		    
-		  /* Conjugation Forces */
-		  Add_dBO( system, lists, j, pij, CEconj1, workspace->f_con );
-		  Add_dBO( system, lists, j, pk, CEconj2, workspace->f_con );
-		  Add_dBO( system, lists, k, plk, CEconj3, workspace->f_con );
-		    
-		  rvec_ScaledAdd( workspace->f_con[i], 
-				  CEconj4, p_ijk->dcos_dk );
-		  rvec_ScaledAdd( workspace->f_con[j], 
-				  CEconj4, p_ijk->dcos_dj );
-		  rvec_ScaledAdd( workspace->f_con[k], 
-				  CEconj4, p_ijk->dcos_di );
-		    
-		  rvec_ScaledAdd( workspace->f_con[j], 
-				  CEconj5, p_jkl->dcos_di );
-		  rvec_ScaledAdd( workspace->f_con[k], 
-				  CEconj5, p_jkl->dcos_dj );
-		  rvec_ScaledAdd( workspace->f_con[l], 
-				  CEconj5, p_jkl->dcos_dk );
-		    
-		  rvec_ScaledAdd( workspace->f_con[i], 
-				  CEconj6, dcos_omega_di );
-		  rvec_ScaledAdd( workspace->f_con[j], 
-				  CEconj6, dcos_omega_dj );
-		  rvec_ScaledAdd( workspace->f_con[k], 
-				  CEconj6, dcos_omega_dk );
-		  rvec_ScaledAdd( workspace->f_con[l], 
-				  CEconj6, dcos_omega_dl );
+                  /* Torsion Forces */
+                  Add_dBOpinpi2( system, lists, j, pk, CEtors2, 0.0,
+                                 workspace->f_tor, workspace->f_tor );
+                  Add_dDelta( system, lists, j, CEtors3, workspace->f_tor );
+                  Add_dDelta( system, lists, k, CEtors3, workspace->f_tor );
+                  Add_dBO( system, lists, j, pij, CEtors4, workspace->f_tor );
+                  Add_dBO( system, lists, j, pk, CEtors5, workspace->f_tor );
+                  Add_dBO( system, lists, k, plk, CEtors6, workspace->f_tor );
+
+                  rvec_ScaledAdd( workspace->f_tor[i],
+                                  CEtors7, p_ijk->dcos_dk );
+                  rvec_ScaledAdd( workspace->f_tor[j],
+                                  CEtors7, p_ijk->dcos_dj );
+                  rvec_ScaledAdd( workspace->f_tor[k],
+                                  CEtors7, p_ijk->dcos_di );
+
+                  rvec_ScaledAdd( workspace->f_tor[j],
+                                  CEtors8, p_jkl->dcos_di );
+                  rvec_ScaledAdd( workspace->f_tor[k],
+                                  CEtors8, p_jkl->dcos_dj );
+                  rvec_ScaledAdd( workspace->f_tor[l],
+                                  CEtors8, p_jkl->dcos_dk );
+
+                  rvec_ScaledAdd( workspace->f_tor[i],
+                                  CEtors9, dcos_omega_di );
+                  rvec_ScaledAdd( workspace->f_tor[j],
+                                  CEtors9, dcos_omega_dj );
+                  rvec_ScaledAdd( workspace->f_tor[k],
+                                  CEtors9, dcos_omega_dk );
+                  rvec_ScaledAdd( workspace->f_tor[l],
+                                  CEtors9, dcos_omega_dl );
+
+                  /* Conjugation Forces */
+                  Add_dBO( system, lists, j, pij, CEconj1, workspace->f_con );
+                  Add_dBO( system, lists, j, pk, CEconj2, workspace->f_con );
+                  Add_dBO( system, lists, k, plk, CEconj3, workspace->f_con );
+
+                  rvec_ScaledAdd( workspace->f_con[i],
+                                  CEconj4, p_ijk->dcos_dk );
+                  rvec_ScaledAdd( workspace->f_con[j],
+                                  CEconj4, p_ijk->dcos_dj );
+                  rvec_ScaledAdd( workspace->f_con[k],
+                                  CEconj4, p_ijk->dcos_di );
+
+                  rvec_ScaledAdd( workspace->f_con[j],
+                                  CEconj5, p_jkl->dcos_di );
+                  rvec_ScaledAdd( workspace->f_con[k],
+                                  CEconj5, p_jkl->dcos_dj );
+                  rvec_ScaledAdd( workspace->f_con[l],
+                                  CEconj5, p_jkl->dcos_dk );
+
+                  rvec_ScaledAdd( workspace->f_con[i],
+                                  CEconj6, dcos_omega_di );
+                  rvec_ScaledAdd( workspace->f_con[j],
+                                  CEconj6, dcos_omega_dj );
+                  rvec_ScaledAdd( workspace->f_con[k],
+                                  CEconj6, dcos_omega_dk );
+                  rvec_ScaledAdd( workspace->f_con[l],
+                                  CEconj6, dcos_omega_dl );
 #endif
-		} // pl check ends
-	      } // pl loop ends
-	    } // pi check ends
-	  } // pi loop ends
-	} // k-j neighbor check ends
+                } // pl check ends
+              } // pl loop ends
+            } // pi check ends
+          } // pi loop ends
+        } // k-j neighbor check ends
       } // j<k && j-k neighbor check ends
     } // pk loop ends
   } // j loop
-  
+
 #if defined(DEBUG)
   fprintf( stderr, "Number of torsion angles: %d\n", num_frb_intrs );
-  fprintf( stderr, "Torsion Energy: %g\t Conjugation Energy: %g\n", 
-	   data->my_en.e_tor, data->my_en.e_con );
+  fprintf( stderr, "Torsion Energy: %g\t Conjugation Energy: %g\n",
+           data->my_en.e_tor, data->my_en.e_con );
 
   fprintf( stderr, "4body: ext_press (%12.6f %12.6f %12.6f)\n",
-	   data->ext_press[0], data->ext_press[1], data->ext_press[2] );
+           data->ext_press[0], data->ext_press[1], data->ext_press[2] );
 #endif
 }
diff --git a/src/USER-REAXC/reaxc_torsion_angles.h b/src/USER-REAXC/reaxc_torsion_angles.h
index a34ef7709e..755e8c6532 100644
--- a/src/USER-REAXC/reaxc_torsion_angles.h
+++ b/src/USER-REAXC/reaxc_torsion_angles.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -30,6 +30,6 @@
 #include "reaxc_types.h"
 
 void Torsion_Angles( reax_system*, control_params*, simulation_data*,
-		     storage*, reax_list**, output_controls* );
+                     storage*, reax_list**, output_controls* );
 
 #endif
diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp
index 88a35c7354..8fbd26217f 100644
--- a/src/USER-REAXC/reaxc_traj.cpp
+++ b/src/USER-REAXC/reaxc_traj.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -38,7 +38,7 @@
 
 #if defined(PURE_REAX)
 int Set_My_Trajectory_View( MPI_File trj, int offset, MPI_Datatype etype,
-			    MPI_Comm comm, int my_rank, int my_n, int big_n )
+                            MPI_Comm comm, int my_rank, int my_n, int big_n )
 {
   int my_disp;
   int length[3];
@@ -70,83 +70,83 @@ int Set_My_Trajectory_View( MPI_File trj, int offset, MPI_Datatype etype,
   MPI_Type_commit( &view );
 
   MPI_File_set_view( trj, offset, etype, view, "native", MPI_INFO_NULL );
-  
+
   return my_disp;
 }
 #endif
 
 
-int Reallocate_Output_Buffer( output_controls *out_control, int req_space, 
-			      MPI_Comm comm )
+int Reallocate_Output_Buffer( output_controls *out_control, int req_space,
+                              MPI_Comm comm )
 {
-  if( out_control->buffer_len > 0 ) 
+  if( out_control->buffer_len > 0 )
     free( out_control->buffer );
 
   out_control->buffer_len = (int)(req_space*SAFE_ZONE);
   out_control->buffer = (char*) malloc(out_control->buffer_len*sizeof(char));
   if( out_control->buffer == NULL ) {
-    fprintf( stderr, 
-	     "insufficient memory for required buffer size %d. terminating!\n",
-	     (int) (req_space*SAFE_ZONE) );
+    fprintf( stderr,
+             "insufficient memory for required buffer size %d. terminating!\n",
+             (int) (req_space*SAFE_ZONE) );
     MPI_Abort( comm, INSUFFICIENT_MEMORY );
   }
-  
+
   return SUCCESS;
 }
 
 
-void Write_Skip_Line( output_controls *out_control, mpi_datatypes *mpi_data, 
-		      int my_rank, int skip, int num_section )
+void Write_Skip_Line( output_controls *out_control, mpi_datatypes *mpi_data,
+                      int my_rank, int skip, int num_section )
 {
 #if defined(PURE_REAX)
   MPI_Status status;
 
   if( out_control->traj_method == MPI_TRAJ ) {
-    MPI_File_set_view( out_control->trj, out_control->trj_offset, 
-		       mpi_data->header_line, mpi_data->header_line, 
-		       "native", MPI_INFO_NULL );
+    MPI_File_set_view( out_control->trj, out_control->trj_offset,
+                       mpi_data->header_line, mpi_data->header_line,
+                       "native", MPI_INFO_NULL );
     if( my_rank == MASTER_NODE ) {
-      sprintf( out_control->line, INT2_LINE, "chars_to_skip_section:", 
-	       skip, num_section );
-      MPI_File_write( out_control->trj, out_control->line, 1, 
-		      mpi_data->header_line, &status );
+      sprintf( out_control->line, INT2_LINE, "chars_to_skip_section:",
+               skip, num_section );
+      MPI_File_write( out_control->trj, out_control->line, 1,
+                      mpi_data->header_line, &status );
     }
     out_control->trj_offset += HEADER_LINE_LEN;
   }
   else {
     if( my_rank == MASTER_NODE )
-      fprintf( out_control->strj, INT2_LINE, 
-	       "chars_to_skip_section:", skip, num_section );
+      fprintf( out_control->strj, INT2_LINE,
+               "chars_to_skip_section:", skip, num_section );
   }
 #elif defined(LAMMPS_REAX)
   if( my_rank == MASTER_NODE )
-    fprintf( out_control->strj, INT2_LINE, 
-	     "chars_to_skip_section:", skip, num_section );
+    fprintf( out_control->strj, INT2_LINE,
+             "chars_to_skip_section:", skip, num_section );
 #endif
 
 }
 
 
-int Write_Header( reax_system *system, control_params *control, 
-		  output_controls *out_control, mpi_datatypes *mpi_data )
+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", 
-			     "CoM to origin" };
+  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",
+                             "CoM to origin" };
   char t_regime[3][25] = { "T-coupling only", "step-wise", "constant slope" };
 
   char traj_methods[TF_N][10] = { "custom", "xyz" };
-  char atom_formats[8][40] =  { "none", "invalid", "invalid", "invalid", 
-				"xyz_q", 
-				"xyz_q_fxfyfz", 
-				"xyz_q_vxvyvz", 
-				"detailed_atom_info" };
-  char bond_formats[3][30] = { "none", 
-			       "basic_bond_info", 
-			       "detailed_bond_info" };
+  char atom_formats[8][40] =  { "none", "invalid", "invalid", "invalid",
+                                "xyz_q",
+                                "xyz_q_fxfyfz",
+                                "xyz_q_vxvyvz",
+                                "detailed_atom_info" };
+  char bond_formats[3][30] = { "none",
+                               "basic_bond_info",
+                               "detailed_bond_info" };
   char angle_formats[2][30] = { "none", "basic_angle_info" };
 
   /* set header lengths */
@@ -161,172 +161,172 @@ int Write_Header( reax_system *system, control_params *control,
     /* clear the contents of line & buffer */
     out_control->line[0] = 0;
     out_control->buffer[0] = 0;
-    
+
     /* to skip the header */
-    sprintf( out_control->line, INT_LINE, "chars_to_skip_header:", 
-	     (num_hdr_lines-1) * HEADER_LINE_LEN );
+    sprintf( out_control->line, INT_LINE, "chars_to_skip_header:",
+             (num_hdr_lines-1) * HEADER_LINE_LEN );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
+
     /* general simulation info */
-    sprintf( out_control->line, STR_LINE, "simulation_name:", 
-	     out_control->traj_title );
+    sprintf( out_control->line, STR_LINE, "simulation_name:",
+             out_control->traj_title );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
+
     sprintf( out_control->line, INT_LINE, "number_of_atoms:", system->bigN );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, STR_LINE, "ensemble_type:", 
-	     ensembles[ control->ensemble ] );
+
+    sprintf( out_control->line, STR_LINE, "ensemble_type:",
+             ensembles[ control->ensemble ] );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, INT_LINE, "number_of_steps:", 
-	     control->nsteps );
+
+    sprintf( out_control->line, INT_LINE, "number_of_steps:",
+             control->nsteps );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "timestep_length_(in_fs):", 
-	     control->dt * 1000 );
+
+    sprintf( out_control->line, REAL_LINE, "timestep_length_(in_fs):",
+             control->dt * 1000 );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
+
     /* restart info */
-    sprintf( out_control->line, STR_LINE, "is_this_a_restart?:", 
-	     (control->restart ? "yes" : "no") );
+    sprintf( out_control->line, STR_LINE, "is_this_a_restart?:",
+             (control->restart ? "yes" : "no") );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    //sprintf( out_control->line, STR_LINE, "restarted_from_file:", 
+
+    //sprintf( out_control->line, STR_LINE, "restarted_from_file:",
     //     (control->restart ? control->restart_from : "NA") );
     //strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    //sprintf( out_control->line, STR_LINE, "kept_restart_velocities?:", 
+
+    //sprintf( out_control->line, STR_LINE, "kept_restart_velocities?:",
     //     (control->restart ? (control->random_vel ? "no":"yes"):"NA") );
     //strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, STR_LINE, "write_restart_files?:", 
-	     ((out_control->restart_freq > 0) ? "yes" : "no") );
+
+    sprintf( out_control->line, STR_LINE, "write_restart_files?:",
+             ((out_control->restart_freq > 0) ? "yes" : "no") );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, INT_LINE, "frequency_to_write_restarts:", 
-	     out_control->restart_freq );
+
+    sprintf( out_control->line, INT_LINE, "frequency_to_write_restarts:",
+             out_control->restart_freq );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
+
     /* preferences */
-    sprintf( out_control->line, STR_LINE, "tabulate_long_range_intrs?:", 
-	     (control->tabulate ? "yes" : "no") );
+    sprintf( out_control->line, STR_LINE, "tabulate_long_range_intrs?:",
+             (control->tabulate ? "yes" : "no") );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
+
     sprintf( out_control->line, INT_LINE, "table_size:", control->tabulate );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, STR_LINE, "restrict_bonds?:", 
-	     (control->restrict_bonds ? "yes" : "no") );
+
+    sprintf( out_control->line, STR_LINE, "restrict_bonds?:",
+             (control->restrict_bonds ? "yes" : "no") );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
+
     sprintf( out_control->line, INT_LINE, "bond_restriction_length:",
-	     control->restrict_bonds );
+             control->restrict_bonds );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, STR_LINE, "reposition_atoms?:", 
-	     reposition[control->reposition_atoms] );
+
+    sprintf( out_control->line, STR_LINE, "reposition_atoms?:",
+             reposition[control->reposition_atoms] );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, INT_LINE, "remove_CoM_velocity?:", 
-	     (control->ensemble==NVE) ? 0 : control->remove_CoM_vel);
+
+    sprintf( out_control->line, INT_LINE, "remove_CoM_velocity?:",
+             (control->ensemble==NVE) ? 0 : control->remove_CoM_vel);
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    
+
+
     /* cut-off values */
-    sprintf( out_control->line, REAL_LINE, "bonded_intr_dist_cutoff:", 
-	     control->bond_cut );
+    sprintf( out_control->line, REAL_LINE, "bonded_intr_dist_cutoff:",
+             control->bond_cut );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "nonbonded_intr_dist_cutoff:", 
-	     control->nonb_cut );
+
+    sprintf( out_control->line, REAL_LINE, "nonbonded_intr_dist_cutoff:",
+             control->nonb_cut );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "hbond_dist_cutoff:", 
-	     control->hbond_cut );
+
+    sprintf( out_control->line, REAL_LINE, "hbond_dist_cutoff:",
+             control->hbond_cut );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "reax_bond_threshold:", 
-	     control->bo_cut );
+
+    sprintf( out_control->line, REAL_LINE, "reax_bond_threshold:",
+             control->bo_cut );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "physical_bond_threshold:", 
-	     control->bg_cut );
+
+    sprintf( out_control->line, REAL_LINE, "physical_bond_threshold:",
+             control->bg_cut );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "valence_angle_threshold:", 
-	     control->thb_cut );
+
+    sprintf( out_control->line, REAL_LINE, "valence_angle_threshold:",
+             control->thb_cut );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
+
     sprintf( out_control->line, SCI_LINE, "QEq_tolerance:", control->q_err );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
+
     /* temperature controls */
     sprintf( out_control->line, REAL_LINE, "initial_temperature:",
-	     control->T_init );
+             control->T_init );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "target_temperature:", 
-	     control->T_final );
+
+    sprintf( out_control->line, REAL_LINE, "target_temperature:",
+             control->T_final );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "thermal_inertia:", 
-	     control->Tau_T );
+
+    sprintf( out_control->line, REAL_LINE, "thermal_inertia:",
+             control->Tau_T );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, STR_LINE, "temperature_regime:", 
-	     t_regime[ control->T_mode ] );
+
+    sprintf( out_control->line, STR_LINE, "temperature_regime:",
+             t_regime[ control->T_mode ] );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "temperature_change_rate_(K/ps):", 
-	     control->T_rate / control->T_freq );
+
+    sprintf( out_control->line, REAL_LINE, "temperature_change_rate_(K/ps):",
+             control->T_rate / control->T_freq );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
+
     /* pressure controls */
-    sprintf( out_control->line, REAL3_LINE, "target_pressure_(GPa):", 
-	     control->P[0], control->P[1], control->P[2] );
+    sprintf( out_control->line, REAL3_LINE, "target_pressure_(GPa):",
+             control->P[0], control->P[1], control->P[2] );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL3_LINE, "virial_inertia:", 
-	     control->Tau_P[0], control->Tau_P[1], control->Tau_P[2] );
+
+    sprintf( out_control->line, REAL3_LINE, "virial_inertia:",
+             control->Tau_P[0], control->Tau_P[1], control->Tau_P[2] );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
+
     /* trajectory */
-    sprintf( out_control->line, INT_LINE, "energy_dumping_freq:", 
-	     out_control->energy_update_freq );
+    sprintf( out_control->line, INT_LINE, "energy_dumping_freq:",
+             out_control->energy_update_freq );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, INT_LINE, "trajectory_dumping_freq:", 
-	     out_control->write_steps );
+
+    sprintf( out_control->line, INT_LINE, "trajectory_dumping_freq:",
+             out_control->write_steps );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, STR_LINE, "compress_trajectory_output?:", 
-	     (out_control->traj_compress ? "yes" : "no") );
+
+    sprintf( out_control->line, STR_LINE, "compress_trajectory_output?:",
+             (out_control->traj_compress ? "yes" : "no") );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, STR_LINE, "trajectory_format:", 
-	     traj_methods[ out_control->traj_method ] );
+
+    sprintf( out_control->line, STR_LINE, "trajectory_format:",
+             traj_methods[ out_control->traj_method ] );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, STR_LINE, "atom_info:", 
-	     atom_formats[ out_control->atom_info ] );
+
+    sprintf( out_control->line, STR_LINE, "atom_info:",
+             atom_formats[ out_control->atom_info ] );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, STR_LINE, "bond_info:", 
-	     bond_formats[ out_control->bond_info ] );
+
+    sprintf( out_control->line, STR_LINE, "bond_info:",
+             bond_formats[ out_control->bond_info ] );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, STR_LINE, "angle_info:", 
-	     angle_formats[ out_control->angle_info ] );
+
+    sprintf( out_control->line, STR_LINE, "angle_info:",
+             angle_formats[ out_control->angle_info ] );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-      
+
     /* analysis */
-    //sprintf( out_control->line, STR_LINE, "molecular_analysis:", 
+    //sprintf( out_control->line, STR_LINE, "molecular_analysis:",
     //     (control->molec_anal ? "yes" : "no") );
     //strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, INT_LINE, "molecular_analysis_frequency:", 
-	     control->molecular_analysis );
+
+    sprintf( out_control->line, INT_LINE, "molecular_analysis_frequency:",
+             control->molecular_analysis );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
   }
 
@@ -334,12 +334,12 @@ int Write_Header( reax_system *system, control_params *control,
 #if defined(PURE_REAX)
   if( out_control->traj_method == MPI_TRAJ ) {
     out_control->trj_offset = 0;
-    Set_My_Trajectory_View( out_control->trj, 
-			    out_control->trj_offset, mpi_data->header_line,
-			    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 );
+    Set_My_Trajectory_View( out_control->trj,
+                            out_control->trj_offset, mpi_data->header_line,
+                            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 );
     out_control->trj_offset = (num_hdr_lines) * HEADER_LINE_LEN;
   }
   else {
@@ -350,13 +350,13 @@ int Write_Header( reax_system *system, control_params *control,
   if( system->my_rank == MASTER_NODE )
     fprintf( out_control->strj, "%s", out_control->buffer );
 #endif
-  
+
   return SUCCESS;
 }
 
 
 int Write_Init_Desc( reax_system *system, control_params *control,
-		     output_controls *out_control, mpi_datatypes *mpi_data )
+                     output_controls *out_control, mpi_datatypes *mpi_data )
 {
   int i, me, np, cnt, buffer_len, buffer_req;
   reax_atom *p_atom;
@@ -367,9 +367,9 @@ int Write_Init_Desc( reax_system *system, control_params *control,
   np = system->wsize;
 
   /* skip info */
-  Write_Skip_Line( out_control, mpi_data, me, 
-		   system->bigN * INIT_DESC_LEN, system->bigN );
-  
+  Write_Skip_Line( out_control, mpi_data, me,
+                   system->bigN * INIT_DESC_LEN, system->bigN );
+
   if( out_control->traj_method == REG_TRAJ && me == MASTER_NODE )
     buffer_req = system->bigN * INIT_DESC_LEN + 1;
   else buffer_req = system->n * INIT_DESC_LEN + 1;
@@ -381,51 +381,51 @@ int Write_Init_Desc( reax_system *system, control_params *control,
   out_control->buffer[0] = 0;
   for( i = 0; i < system->n; ++i ) {
     p_atom = &( system->my_atoms[i] );
-    sprintf( out_control->line, INIT_DESC, 
-	     p_atom->orig_id, p_atom->type, p_atom->name, 
-	     system->reax_param.sbp[ p_atom->type ].mass );
-    strncpy( out_control->buffer + i*INIT_DESC_LEN, 
-	     out_control->line, INIT_DESC_LEN+1 );
+    sprintf( out_control->line, INIT_DESC,
+             p_atom->orig_id, p_atom->type, p_atom->name,
+             system->reax_param.sbp[ p_atom->type ].mass );
+    strncpy( out_control->buffer + i*INIT_DESC_LEN,
+             out_control->line, INIT_DESC_LEN+1 );
   }
 
 #if defined(PURE_REAX)
   if( out_control->traj_method == MPI_TRAJ ) {
-    Set_My_Trajectory_View( out_control->trj, out_control->trj_offset, 
-			    mpi_data->init_desc_line, mpi_data->world, 
-			    me, system->n, system->bigN );
-    MPI_File_write( out_control->trj, out_control->buffer, system->n, 
-		    mpi_data->init_desc_line, &status );
+    Set_My_Trajectory_View( out_control->trj, out_control->trj_offset,
+                            mpi_data->init_desc_line, mpi_data->world,
+                            me, system->n, system->bigN );
+    MPI_File_write( out_control->trj, out_control->buffer, system->n,
+                    mpi_data->init_desc_line, &status );
     out_control->trj_offset += system->bigN * INIT_DESC_LEN;
   }
   else{
     if( me != MASTER_NODE )
-      MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, 
-		np * INIT_DESCS + me, mpi_data->world );
+      MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
+                np * INIT_DESCS + me, mpi_data->world );
     else{
       buffer_len = system->n * INIT_DESC_LEN;
       for( i = 0; i < np; ++i )
-	if( i != MASTER_NODE ) {
-	  MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
-		    MPI_CHAR, i, np*INIT_DESCS+i, mpi_data->world, &status );
-	  MPI_Get_count( &status, MPI_CHAR, &cnt );
-	  buffer_len += cnt;
-	}
+        if( i != MASTER_NODE ) {
+          MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
+                    MPI_CHAR, i, np*INIT_DESCS+i, mpi_data->world, &status );
+          MPI_Get_count( &status, MPI_CHAR, &cnt );
+          buffer_len += cnt;
+        }
       out_control->buffer[buffer_len] = 0;
       fprintf( out_control->strj, "%s", out_control->buffer );
     }
   }
 #elif defined(LAMMPS_REAX)
   if( me != MASTER_NODE )
-    MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, 
-	      np * INIT_DESCS + me, mpi_data->world );
+    MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
+              np * INIT_DESCS + me, mpi_data->world );
   else{
     buffer_len = system->n * INIT_DESC_LEN;
     for( i = 0; i < np; ++i )
       if( i != MASTER_NODE ) {
-	MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
-		  MPI_CHAR, i, np*INIT_DESCS+i, mpi_data->world, &status );
-	MPI_Get_count( &status, MPI_CHAR, &cnt );
-	buffer_len += cnt;
+        MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
+                  MPI_CHAR, i, np*INIT_DESCS+i, mpi_data->world, &status );
+        MPI_Get_count( &status, MPI_CHAR, &cnt );
+        buffer_len += cnt;
       }
     out_control->buffer[buffer_len] = 0;
     fprintf( out_control->strj, "%s", out_control->buffer );
@@ -436,14 +436,14 @@ int Write_Init_Desc( reax_system *system, control_params *control,
 }
 
 
-int Init_Traj( reax_system *system, control_params *control, 
-	       output_controls *out_control, mpi_datatypes *mpi_data, 
-	       char *msg )
+int Init_Traj( reax_system *system, control_params *control,
+               output_controls *out_control, mpi_datatypes *mpi_data,
+               char *msg )
 {
   char fname[MAX_STR];
-  int  atom_line_len[ NR_OPT_ATOM ] = { 0, 0, 0, 0, 
-					ATOM_BASIC_LEN, ATOM_wV_LEN, 
-					ATOM_wF_LEN, ATOM_FULL_LEN };
+  int  atom_line_len[ NR_OPT_ATOM ] = { 0, 0, 0, 0,
+                                        ATOM_BASIC_LEN, ATOM_wV_LEN,
+                                        ATOM_wF_LEN, ATOM_FULL_LEN };
   int  bond_line_len[ NR_OPT_BOND ] = { 0, BOND_BASIC_LEN, BOND_FULL_LEN };
   int  angle_line_len[ NR_OPT_ANGLE ] = { 0, ANGLE_BASIC_LEN };
 
@@ -459,19 +459,19 @@ int Init_Traj( reax_system *system, control_params *control,
   /* angles? */
   out_control->angle_line_len = angle_line_len[ out_control->angle_info ];
   out_control->write_angles = ( out_control->angle_line_len ? 1 : 0 );
-  
+
   /* allocate line & buffer space */
   out_control->line = (char*) calloc( MAX_TRJ_LINE_LEN + 1, sizeof(char) );
   out_control->buffer_len = 0;
   out_control->buffer = NULL;
-  
-  /* fprintf( stderr, "p%d: init_traj: atom_line_len = %d "		\
-     "bond_line_len = %d, angle_line_len = %d\n"			\
-     "max_line = %d, max_buffer_size = %d\n", 
-     system->my_rank, out_control->atom_line_len, 
+
+  /* fprintf( stderr, "p%d: init_traj: atom_line_len = %d "                \
+     "bond_line_len = %d, angle_line_len = %d\n"                        \
+     "max_line = %d, max_buffer_size = %d\n",
+     system->my_rank, out_control->atom_line_len,
      out_control->bond_line_len, out_control->angle_line_len,
      MAX_TRJ_LINE_LEN, MAX_TRJ_BUFFER_SIZE ); */
-  
+
   /* write trajectory header and atom info, if applicable */
 #if defined(PURE_REAX)
   if( out_control->traj_method == MPI_TRAJ ) {
@@ -479,15 +479,15 @@ int Init_Traj( reax_system *system, control_params *control,
     if( system->my_rank == MASTER_NODE ) {
       MPI_File_delete( fname, MPI_INFO_NULL );
     }
-      
+
     /* open a fresh trajectory file */
-    if( MPI_File_open( mpi_data->world, fname, 
-		       MPI_MODE_CREATE | MPI_MODE_WRONLY, MPI_INFO_NULL, 
-		       &(out_control->trj) ) ) {
+    if( MPI_File_open( mpi_data->world, fname,
+                       MPI_MODE_CREATE | MPI_MODE_WRONLY, MPI_INFO_NULL,
+                       &(out_control->trj) ) ) {
       strcpy( msg, "init_traj: unable to open trajectory file" );
       return FAILURE;
     }
-    
+
     /* build the mpi structs for trajectory */
     /* header_line */
     MPI_Type_contiguous( HEADER_LINE_LEN, MPI_CHAR, &(mpi_data->header_line) );
@@ -496,16 +496,16 @@ int Init_Traj( reax_system *system, control_params *control,
     MPI_Type_contiguous( INIT_DESC_LEN, MPI_CHAR, &(mpi_data->init_desc_line) );
     MPI_Type_commit( &(mpi_data->init_desc_line) );
     /* atom */
-    MPI_Type_contiguous( out_control->atom_line_len, MPI_CHAR, 
-			 &(mpi_data->atom_line) );
+    MPI_Type_contiguous( out_control->atom_line_len, MPI_CHAR,
+                         &(mpi_data->atom_line) );
     MPI_Type_commit( &(mpi_data->atom_line) );
     /* bonds */
-    MPI_Type_contiguous( out_control->bond_line_len, MPI_CHAR, 
-			 &(mpi_data->bond_line) );
+    MPI_Type_contiguous( out_control->bond_line_len, MPI_CHAR,
+                         &(mpi_data->bond_line) );
     MPI_Type_commit( &(mpi_data->bond_line) );
     /* angles */
-    MPI_Type_contiguous( out_control->angle_line_len, MPI_CHAR, 
-			 &(mpi_data->angle_line) );
+    MPI_Type_contiguous( out_control->angle_line_len, MPI_CHAR,
+                         &(mpi_data->angle_line) );
     MPI_Type_commit( &(mpi_data->angle_line) );
   }
   else if( out_control->traj_method == REG_TRAJ) {
@@ -513,7 +513,7 @@ int Init_Traj( reax_system *system, control_params *control,
       out_control->strj = fopen( fname, "w" );
   }
   else {
-    strcpy( msg, "init_traj: unknown trajectory option" );   
+    strcpy( msg, "init_traj: unknown trajectory option" );
     return FAILURE;
   }
 #elif defined(LAMMPS_REAX)
@@ -522,7 +522,7 @@ int Init_Traj( reax_system *system, control_params *control,
       out_control->strj = fopen( fname, "w" );
   }
   else {
-    strcpy( msg, "init_traj: unknown trajectory option" );   
+    strcpy( msg, "init_traj: unknown trajectory option" );
     return FAILURE;
   }
 #endif
@@ -539,14 +539,14 @@ int Init_Traj( reax_system *system, control_params *control,
 #if defined(DEBUG_FOCUS)
   fprintf( stderr, "p%d: atom descriptions written\n", system->my_rank );
 #endif
-  
+
   return SUCCESS;
 }
 
 
-int Write_Frame_Header( reax_system *system, control_params *control, 
-			simulation_data *data, output_controls *out_control, 
-			mpi_datatypes *mpi_data )
+int Write_Frame_Header( reax_system *system, control_params *control,
+                        simulation_data *data, output_controls *out_control,
+                        mpi_datatypes *mpi_data )
 {
   int me, num_frm_hdr_lines, my_frm_hdr_lines, buffer_req;
   MPI_Status status;
@@ -557,7 +557,7 @@ int Write_Frame_Header( reax_system *system, control_params *control,
   my_frm_hdr_lines = num_frm_hdr_lines * ( me == MASTER_NODE );
   buffer_req = my_frm_hdr_lines * HEADER_LINE_LEN;
   if( buffer_req > out_control->buffer_len * DANGER_ZONE )
-    Reallocate_Output_Buffer( out_control, buffer_req, mpi_data->world );  
+    Reallocate_Output_Buffer( out_control, buffer_req, mpi_data->world );
 
   /* only the master node writes into trajectory header */
   if( me == MASTER_NODE ) {
@@ -566,111 +566,111 @@ int Write_Frame_Header( reax_system *system, control_params *control,
     out_control->buffer[0] = 0;
 
     /* skip info */
-    sprintf( out_control->line, INT_LINE, "chars_to_skip_frame_header:", 
-	     (num_frm_hdr_lines - 1) * HEADER_LINE_LEN );
+    sprintf( out_control->line, INT_LINE, "chars_to_skip_frame_header:",
+             (num_frm_hdr_lines - 1) * HEADER_LINE_LEN );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
 
     /* step & time */
     sprintf( out_control->line, INT_LINE, "step:", data->step );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "time_in_ps:", 
-	     data->step * control->dt );
+
+    sprintf( out_control->line, REAL_LINE, "time_in_ps:",
+             data->step * control->dt );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    
+
+
     /* box info */
     sprintf( out_control->line, REAL_LINE, "volume:", system->big_box.V );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL3_LINE, "box_dimensions:", 
-	     system->big_box.box_norms[0], 
-	     system->big_box.box_norms[1], 
-	     system->big_box.box_norms[2] );
+
+    sprintf( out_control->line, REAL3_LINE, "box_dimensions:",
+             system->big_box.box_norms[0],
+             system->big_box.box_norms[1],
+             system->big_box.box_norms[2] );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL3_LINE, 
-	     "coordinate_angles:", 90.0, 90.0, 90.0 );
+
+    sprintf( out_control->line, REAL3_LINE,
+             "coordinate_angles:", 90.0, 90.0, 90.0 );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    
+
+
     /* system T and P */
     sprintf( out_control->line, REAL_LINE, "temperature:", data->therm.T );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "pressure:", 
-	     (control->ensemble==iNPT) ?  
-	     data->iso_bar.P : data->flex_bar.P_scalar );
+
+    sprintf( out_control->line, REAL_LINE, "pressure:",
+             (control->ensemble==iNPT) ?
+             data->iso_bar.P : data->flex_bar.P_scalar );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    
+
+
     /* energies */
-    sprintf( out_control->line, REAL_LINE, "total_energy:", 
-	     data->sys_en.e_tot );
+    sprintf( out_control->line, REAL_LINE, "total_energy:",
+             data->sys_en.e_tot );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "total_kinetic:", 
-	     data->sys_en.e_kin );
+
+    sprintf( out_control->line, REAL_LINE, "total_kinetic:",
+             data->sys_en.e_kin );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "total_potential:", 
-	     data->sys_en.e_pot );
+
+    sprintf( out_control->line, REAL_LINE, "total_potential:",
+             data->sys_en.e_pot );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "bond_energy:", 
-	     data->sys_en.e_bond );
+
+    sprintf( out_control->line, REAL_LINE, "bond_energy:",
+             data->sys_en.e_bond );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "atom_energy:", 
-	     data->sys_en.e_ov + data->sys_en.e_un  );
+
+    sprintf( out_control->line, REAL_LINE, "atom_energy:",
+             data->sys_en.e_ov + data->sys_en.e_un  );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "lone_pair_energy:", 
-	     data->sys_en.e_lp  );
+
+    sprintf( out_control->line, REAL_LINE, "lone_pair_energy:",
+             data->sys_en.e_lp  );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "valence_angle_energy:", 
-	     data->sys_en.e_ang + data->sys_en.e_pen );
+
+    sprintf( out_control->line, REAL_LINE, "valence_angle_energy:",
+             data->sys_en.e_ang + data->sys_en.e_pen );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "3-body_conjugation:", 
-	     data->sys_en.e_coa );
+
+    sprintf( out_control->line, REAL_LINE, "3-body_conjugation:",
+             data->sys_en.e_coa );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "hydrogen_bond_energy:", 
-	     data->sys_en.e_hb );
+
+    sprintf( out_control->line, REAL_LINE, "hydrogen_bond_energy:",
+             data->sys_en.e_hb );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "torsion_angle_energy:", 
-	     data->sys_en.e_tor );
+
+    sprintf( out_control->line, REAL_LINE, "torsion_angle_energy:",
+             data->sys_en.e_tor );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "4-body_conjugation:", 
-	     data->sys_en.e_con );
+
+    sprintf( out_control->line, REAL_LINE, "4-body_conjugation:",
+             data->sys_en.e_con );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "vdWaals_energy:", 
-	     data->sys_en.e_vdW );
+
+    sprintf( out_control->line, REAL_LINE, "vdWaals_energy:",
+             data->sys_en.e_vdW );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "electrostatics_energy:", 
-	     data->sys_en.e_ele );
+
+    sprintf( out_control->line, REAL_LINE, "electrostatics_energy:",
+             data->sys_en.e_ele );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
-    
-    sprintf( out_control->line, REAL_LINE, "polarization_energy:", 
-	     data->sys_en.e_pol );
+
+    sprintf( out_control->line, REAL_LINE, "polarization_energy:",
+             data->sys_en.e_pol );
     strncat( out_control->buffer, out_control->line, HEADER_LINE_LEN+1 );
   }
 
   /* dump out the buffer */
 #if defined(PURE_REAX)
-  if( out_control->traj_method == MPI_TRAJ ) {  
-    Set_My_Trajectory_View( out_control->trj, out_control->trj_offset, 
-			    mpi_data->header_line, mpi_data->world, 
-			    me, my_frm_hdr_lines, num_frm_hdr_lines );
-    
+  if( out_control->traj_method == MPI_TRAJ ) {
+    Set_My_Trajectory_View( out_control->trj, out_control->trj_offset,
+                            mpi_data->header_line, mpi_data->world,
+                            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, &status);
     out_control->trj_offset += (num_frm_hdr_lines) * HEADER_LINE_LEN;
   }
   else {
@@ -688,7 +688,7 @@ int Write_Frame_Header( reax_system *system, control_params *control,
 
 
 int Write_Atoms( reax_system *system, control_params *control,
-		 output_controls *out_control, mpi_datatypes *mpi_data )
+                 output_controls *out_control, mpi_datatypes *mpi_data )
 {
   int i, me, np, line_len, buffer_len, buffer_req, cnt;
   MPI_Status  status;
@@ -698,8 +698,8 @@ int Write_Atoms( reax_system *system, control_params *control,
   np = system->wsize;
   line_len = out_control->atom_line_len;
 
-  Write_Skip_Line( out_control, mpi_data, me, 
-		   system->bigN*line_len, system->bigN );
+  Write_Skip_Line( out_control, mpi_data, me,
+                   system->bigN*line_len, system->bigN );
 
   if( out_control->traj_method == REG_TRAJ && me == MASTER_NODE )
     buffer_req = system->bigN * line_len + 1;
@@ -715,30 +715,30 @@ int Write_Atoms( reax_system *system, control_params *control,
     p_atom = &( system->my_atoms[i] );
 
     switch( out_control->atom_info ) {
-    case OPT_ATOM_BASIC: 
-      sprintf( out_control->line, ATOM_BASIC, 
-	       p_atom->orig_id, p_atom->x[0], p_atom->x[1], p_atom->x[2], 
-	       p_atom->q );
+    case OPT_ATOM_BASIC:
+      sprintf( out_control->line, ATOM_BASIC,
+               p_atom->orig_id, p_atom->x[0], p_atom->x[1], p_atom->x[2],
+               p_atom->q );
       break;
     case OPT_ATOM_wF:
-      sprintf( out_control->line, ATOM_wF, 
-	       p_atom->orig_id, p_atom->x[0], p_atom->x[1], p_atom->x[2],
-	       p_atom->f[0], p_atom->f[1], p_atom->f[2], p_atom->q );
+      sprintf( out_control->line, ATOM_wF,
+               p_atom->orig_id, p_atom->x[0], p_atom->x[1], p_atom->x[2],
+               p_atom->f[0], p_atom->f[1], p_atom->f[2], p_atom->q );
       break;
     case OPT_ATOM_wV:
-      sprintf( out_control->line, ATOM_wV, 
-	       p_atom->orig_id, p_atom->x[0], p_atom->x[1], p_atom->x[2],
-	       p_atom->v[0], p_atom->v[1], p_atom->v[2], p_atom->q );
+      sprintf( out_control->line, ATOM_wV,
+               p_atom->orig_id, p_atom->x[0], p_atom->x[1], p_atom->x[2],
+               p_atom->v[0], p_atom->v[1], p_atom->v[2], p_atom->q );
       break;
     case OPT_ATOM_FULL:
       sprintf( out_control->line, ATOM_FULL,
-	       p_atom->orig_id, p_atom->x[0], p_atom->x[1], p_atom->x[2],
-	       p_atom->v[0], p_atom->v[1], p_atom->v[2],
-	       p_atom->f[0], p_atom->f[1], p_atom->f[2], p_atom->q );
+               p_atom->orig_id, p_atom->x[0], p_atom->x[1], p_atom->x[2],
+               p_atom->v[0], p_atom->v[1], p_atom->v[2],
+               p_atom->f[0], p_atom->f[1], p_atom->f[2], p_atom->q );
       break;
     default:
-      fprintf( stderr, 
-	       "write_traj_atoms: unknown atom trajectroy format!\n");
+      fprintf( stderr,
+               "write_traj_atoms: unknown atom trajectroy format!\n");
       MPI_Abort( mpi_data->world, UNKNOWN_OPTION );
     }
 
@@ -747,56 +747,56 @@ int Write_Atoms( reax_system *system, control_params *control,
 
 #if defined(PURE_REAX)
   if( out_control->traj_method == MPI_TRAJ ) {
-    Set_My_Trajectory_View( out_control->trj, out_control->trj_offset, 
-			    mpi_data->atom_line, mpi_data->world, 
-			    me, system->n, system->bigN );  
-    MPI_File_write( out_control->trj, out_control->buffer, system->n, 
-		    mpi_data->atom_line, &status );
+    Set_My_Trajectory_View( out_control->trj, out_control->trj_offset,
+                            mpi_data->atom_line, mpi_data->world,
+                            me, system->n, system->bigN );
+    MPI_File_write( out_control->trj, out_control->buffer, system->n,
+                    mpi_data->atom_line, &status );
     out_control->trj_offset += (system->bigN) * out_control->atom_line_len;
   }
   else{
     if( me != MASTER_NODE )
-      MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, 
-		np*ATOM_LINES+me, mpi_data->world );
+      MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
+                np*ATOM_LINES+me, mpi_data->world );
     else{
       buffer_len = system->n * line_len;
       for( i = 0; i < np; ++i )
-	if( i != MASTER_NODE ) {
-	  MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
-		    MPI_CHAR, i, np*ATOM_LINES+i, mpi_data->world, &status );
-	  MPI_Get_count( &status, MPI_CHAR, &cnt );
-	  buffer_len += cnt;
-	}
+        if( i != MASTER_NODE ) {
+          MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
+                    MPI_CHAR, i, np*ATOM_LINES+i, mpi_data->world, &status );
+          MPI_Get_count( &status, MPI_CHAR, &cnt );
+          buffer_len += cnt;
+        }
       out_control->buffer[buffer_len] = 0;
       fprintf( out_control->strj, "%s", out_control->buffer );
-    }    
+    }
   }
 #elif defined(LAMMPS_REAX)
   if( me != MASTER_NODE )
-    MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, 
-	      np*ATOM_LINES+me, mpi_data->world );
+    MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
+              np*ATOM_LINES+me, mpi_data->world );
   else{
     buffer_len = system->n * line_len;
     for( i = 0; i < np; ++i )
       if( i != MASTER_NODE ) {
-	MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
-		  MPI_CHAR, i, np*ATOM_LINES+i, mpi_data->world, &status );
-	MPI_Get_count( &status, MPI_CHAR, &cnt );
-	buffer_len += cnt;
+        MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
+                  MPI_CHAR, i, np*ATOM_LINES+i, mpi_data->world, &status );
+        MPI_Get_count( &status, MPI_CHAR, &cnt );
+        buffer_len += cnt;
       }
     out_control->buffer[buffer_len] = 0;
     fprintf( out_control->strj, "%s", out_control->buffer );
   }
 #endif
-  
+
   return SUCCESS;
 }
 
 
-int Write_Bonds(reax_system *system, control_params *control, reax_list *bonds, 
-		output_controls *out_control, mpi_datatypes *mpi_data)
+int Write_Bonds(reax_system *system, control_params *control, reax_list *bonds,
+                output_controls *out_control, mpi_datatypes *mpi_data)
 {
-  int i, j, pj, me, np; 
+  int i, j, pj, me, np;
   int my_bonds, num_bonds;
   int line_len, buffer_len, buffer_req, cnt;
   MPI_Status  status;
@@ -804,16 +804,16 @@ int Write_Bonds(reax_system *system, control_params *control, reax_list *bonds,
 
   me = system->my_rank;
   np = system->wsize;
-  line_len = out_control->bond_line_len;  
+  line_len = out_control->bond_line_len;
 
   /* count the number of bonds I will write */
   my_bonds = 0;
   for( i=0; i < system->n; ++i )
     for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) {
       j = bonds->select.bond_list[pj].nbr;
-      if( system->my_atoms[i].orig_id <= system->my_atoms[j].orig_id && 
-	  bonds->select.bond_list[pj].bo_data.BO >= control->bg_cut )
-	++my_bonds;
+      if( system->my_atoms[i].orig_id <= system->my_atoms[j].orig_id &&
+          bonds->select.bond_list[pj].bo_data.BO >= control->bg_cut )
+        ++my_bonds;
     }
 
   /* allreduce - total number of bonds */
@@ -827,7 +827,7 @@ int Write_Bonds(reax_system *system, control_params *control, reax_list *bonds,
 
   if( buffer_req > out_control->buffer_len * DANGER_ZONE )
     Reallocate_Output_Buffer( out_control, buffer_req, mpi_data->world );
-  
+
   /* fill in the buffer */
   out_control->line[0] = 0;
   out_control->buffer[0] = 0;
@@ -837,28 +837,28 @@ int Write_Bonds(reax_system *system, control_params *control, reax_list *bonds,
     for( pj = Start_Index(i, bonds); pj < End_Index(i, bonds); ++pj ) {
       bo_ij = &( bonds->select.bond_list[pj] );
       j = bo_ij->nbr;
-	
-      if( system->my_atoms[i].orig_id <= system->my_atoms[j].orig_id && 
-	  bo_ij->bo_data.BO >= control->bg_cut ) {
-	switch( out_control->bond_info ) {
-	case OPT_BOND_BASIC:
-	  sprintf( out_control->line, BOND_BASIC, 
-		   system->my_atoms[i].orig_id, system->my_atoms[j].orig_id, 
-		   bo_ij->d, bo_ij->bo_data.BO );
-	  break;
-	case OPT_BOND_FULL:
-	  sprintf( out_control->line, BOND_FULL,
-		   system->my_atoms[i].orig_id, system->my_atoms[j].orig_id, 
-		   bo_ij->d, bo_ij->bo_data.BO, bo_ij->bo_data.BO_s, 
-		   bo_ij->bo_data.BO_pi, bo_ij->bo_data.BO_pi2 );
-	  break;
-	default:
-	  fprintf(stderr, "write_traj_bonds: FATAL! invalid bond_info option");
-	  MPI_Abort( mpi_data->world, UNKNOWN_OPTION );
-	}
-	strncpy( out_control->buffer + my_bonds*line_len, 
-		 out_control->line, line_len+1 );
-	++my_bonds;
+
+      if( system->my_atoms[i].orig_id <= system->my_atoms[j].orig_id &&
+          bo_ij->bo_data.BO >= control->bg_cut ) {
+        switch( out_control->bond_info ) {
+        case OPT_BOND_BASIC:
+          sprintf( out_control->line, BOND_BASIC,
+                   system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+                   bo_ij->d, bo_ij->bo_data.BO );
+          break;
+        case OPT_BOND_FULL:
+          sprintf( out_control->line, BOND_FULL,
+                   system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+                   bo_ij->d, bo_ij->bo_data.BO, bo_ij->bo_data.BO_s,
+                   bo_ij->bo_data.BO_pi, bo_ij->bo_data.BO_pi2 );
+          break;
+        default:
+          fprintf(stderr, "write_traj_bonds: FATAL! invalid bond_info option");
+          MPI_Abort( mpi_data->world, UNKNOWN_OPTION );
+        }
+        strncpy( out_control->buffer + my_bonds*line_len,
+                 out_control->line, line_len+1 );
+        ++my_bonds;
       }
     }
   }
@@ -866,66 +866,66 @@ int Write_Bonds(reax_system *system, control_params *control, reax_list *bonds,
 
 #if defined(PURE_REAX)
   if( out_control->traj_method == MPI_TRAJ ) {
-    Set_My_Trajectory_View( out_control->trj, out_control->trj_offset, 
-			    mpi_data->bond_line, mpi_data->world, 
-			    me, my_bonds, num_bonds );
-    MPI_File_write( out_control->trj, out_control->buffer, my_bonds, 
-		    mpi_data->bond_line, &status );
+    Set_My_Trajectory_View( out_control->trj, out_control->trj_offset,
+                            mpi_data->bond_line, mpi_data->world,
+                            me, my_bonds, num_bonds );
+    MPI_File_write( out_control->trj, out_control->buffer, my_bonds,
+                    mpi_data->bond_line, &status );
     out_control->trj_offset += num_bonds * line_len;
   }
   else{
     if( me != MASTER_NODE )
-      MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, 
-		np*BOND_LINES+me, mpi_data->world );
+      MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
+                np*BOND_LINES+me, mpi_data->world );
     else{
       buffer_len = my_bonds * line_len;
       for( i = 0; i < np; ++i )
-	if( i != MASTER_NODE ) {
-	  MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
-		    MPI_CHAR, i, np*BOND_LINES+i, mpi_data->world, &status );
-	  MPI_Get_count( &status, MPI_CHAR, &cnt );
-	  buffer_len += cnt;
-	}
+        if( i != MASTER_NODE ) {
+          MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
+                    MPI_CHAR, i, np*BOND_LINES+i, mpi_data->world, &status );
+          MPI_Get_count( &status, MPI_CHAR, &cnt );
+          buffer_len += cnt;
+        }
       out_control->buffer[buffer_len] = 0;
       fprintf( out_control->strj, "%s", out_control->buffer );
-    }    
+    }
   }
 #elif defined(LAMMPS_REAX)
   if( me != MASTER_NODE )
-    MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, 
-	      np*BOND_LINES+me, mpi_data->world );
+    MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
+              np*BOND_LINES+me, mpi_data->world );
   else{
     buffer_len = my_bonds * line_len;
     for( i = 0; i < np; ++i )
       if( i != MASTER_NODE ) {
-	MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
-		  MPI_CHAR, i, np*BOND_LINES+i, mpi_data->world, &status );
-	MPI_Get_count( &status, MPI_CHAR, &cnt );
-	buffer_len += cnt;
+        MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
+                  MPI_CHAR, i, np*BOND_LINES+i, mpi_data->world, &status );
+        MPI_Get_count( &status, MPI_CHAR, &cnt );
+        buffer_len += cnt;
       }
     out_control->buffer[buffer_len] = 0;
     fprintf( out_control->strj, "%s", out_control->buffer );
-  } 
+  }
 #endif
-  
+
   return SUCCESS;
 }
 
 
-int Write_Angles( reax_system *system, control_params *control, 
-		  reax_list *bonds, reax_list *thb_intrs, 
-		  output_controls *out_control, mpi_datatypes *mpi_data )
+int Write_Angles( reax_system *system, control_params *control,
+                  reax_list *bonds, reax_list *thb_intrs,
+                  output_controls *out_control, mpi_datatypes *mpi_data )
 {
   int i, j, k, pi, pk, me, np;
   int my_angles, num_angles;
   int line_len, buffer_len, buffer_req, cnt;
-  bond_data  *bo_ij, *bo_jk;  
+  bond_data  *bo_ij, *bo_jk;
   three_body_interaction_data *angle_ijk;
   MPI_Status  status;
-  
+
   me = system->my_rank;
   np = system->wsize;
-  line_len = out_control->angle_line_len;  
+  line_len = out_control->angle_line_len;
 
   /* count the number of valence angles I will output */
   my_angles = 0;
@@ -933,18 +933,18 @@ int Write_Angles( reax_system *system, control_params *control,
     for( pi = Start_Index(j, bonds); pi < End_Index(j, bonds); ++pi ) {
       bo_ij = &(bonds->select.bond_list[pi]);
       i     = bo_ij->nbr;
-      
+
       if( bo_ij->bo_data.BO >= control->bg_cut ) // physical j&i bond
-	for( pk = Start_Index( pi, thb_intrs ); 
-	     pk < End_Index( pi, thb_intrs ); ++pk ) {
-	  angle_ijk = &(thb_intrs->select.three_body_list[pk]);
-	  k       = angle_ijk->thb;
-	  bo_jk   = &(bonds->select.bond_list[ angle_ijk->pthb ]); 
-
-	  if( system->my_atoms[i].orig_id < system->my_atoms[k].orig_id && 
-	      bo_jk->bo_data.BO >= control->bg_cut ) // physical j&k bond
-	    ++my_angles;   	
-	}
+        for( pk = Start_Index( pi, thb_intrs );
+             pk < End_Index( pi, thb_intrs ); ++pk ) {
+          angle_ijk = &(thb_intrs->select.three_body_list[pk]);
+          k       = angle_ijk->thb;
+          bo_jk   = &(bonds->select.bond_list[ angle_ijk->pthb ]);
+
+          if( system->my_atoms[i].orig_id < system->my_atoms[k].orig_id &&
+              bo_jk->bo_data.BO >= control->bg_cut ) // physical j&k bond
+            ++my_angles;
+        }
     }
   /* total number of valences */
   MPI_Allreduce(&my_angles, &num_angles, 1, MPI_INT, MPI_SUM,  mpi_data->world);
@@ -966,78 +966,78 @@ int Write_Angles( reax_system *system, control_params *control,
     for( pi = Start_Index(j, bonds); pi < End_Index(j, bonds); ++pi ) {
       bo_ij = &(bonds->select.bond_list[pi]);
       i     = bo_ij->nbr;
-      
+
       if( bo_ij->bo_data.BO >= control->bg_cut ) // physical j&i bond
-	for( pk = Start_Index( pi, thb_intrs ); 
-	     pk < End_Index( pi, thb_intrs ); ++pk ) {
-	  angle_ijk = &(thb_intrs->select.three_body_list[pk]);
-	  k       = angle_ijk->thb;
-	  bo_jk   = &(bonds->select.bond_list[ angle_ijk->pthb ]); 
-	  
-	  if( system->my_atoms[i].orig_id < system->my_atoms[k].orig_id && 
-	      bo_jk->bo_data.BO >= control->bg_cut ) { // physical j&k bond
-	    sprintf( out_control->line, ANGLE_BASIC,
-		     system->my_atoms[i].orig_id, system->my_atoms[j].orig_id, 
-		     system->my_atoms[k].orig_id, RAD2DEG( angle_ijk->theta ) );
-	    
-	    strncpy( out_control->buffer + my_angles*line_len, 
-		     out_control->line, line_len+1 );
-	    ++my_angles;
-	  }
-	}
+        for( pk = Start_Index( pi, thb_intrs );
+             pk < End_Index( pi, thb_intrs ); ++pk ) {
+          angle_ijk = &(thb_intrs->select.three_body_list[pk]);
+          k       = angle_ijk->thb;
+          bo_jk   = &(bonds->select.bond_list[ angle_ijk->pthb ]);
+
+          if( system->my_atoms[i].orig_id < system->my_atoms[k].orig_id &&
+              bo_jk->bo_data.BO >= control->bg_cut ) { // physical j&k bond
+            sprintf( out_control->line, ANGLE_BASIC,
+                     system->my_atoms[i].orig_id, system->my_atoms[j].orig_id,
+                     system->my_atoms[k].orig_id, RAD2DEG( angle_ijk->theta ) );
+
+            strncpy( out_control->buffer + my_angles*line_len,
+                     out_control->line, line_len+1 );
+            ++my_angles;
+          }
+        }
     }
 
 #if defined(PURE_REAX)
   if( out_control->traj_method == MPI_TRAJ ){
-    Set_My_Trajectory_View( out_control->trj, out_control->trj_offset, 
-			    mpi_data->angle_line, mpi_data->world, 
-			    me, my_angles, num_angles );  
-    MPI_File_write( out_control->trj, out_control->buffer, my_angles, 
-		    mpi_data->angle_line, &status );
+    Set_My_Trajectory_View( out_control->trj, out_control->trj_offset,
+                            mpi_data->angle_line, mpi_data->world,
+                            me, my_angles, num_angles );
+    MPI_File_write( out_control->trj, out_control->buffer, my_angles,
+                    mpi_data->angle_line, &status );
     out_control->trj_offset += num_angles * line_len;
   }
   else{
     if( me != MASTER_NODE )
-      MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, 
-		np*ANGLE_LINES+me, mpi_data->world );
+      MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
+                np*ANGLE_LINES+me, mpi_data->world );
     else{
       buffer_len = my_angles * line_len;
       for( i = 0; i < np; ++i )
-	if( i != MASTER_NODE ) {
-	  MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
-		    MPI_CHAR, i, np*ANGLE_LINES+i, mpi_data->world, &status );
-	  MPI_Get_count( &status, MPI_CHAR, &cnt );
-	  buffer_len += cnt;
-	}
+        if( i != MASTER_NODE ) {
+          MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
+                    MPI_CHAR, i, np*ANGLE_LINES+i, mpi_data->world, &status );
+          MPI_Get_count( &status, MPI_CHAR, &cnt );
+          buffer_len += cnt;
+        }
       out_control->buffer[buffer_len] = 0;
       fprintf( out_control->strj, "%s", out_control->buffer );
     }
   }
 #elif defined(LAMMPS_REAX)
   if( me != MASTER_NODE )
-    MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE, 
-	      np*ANGLE_LINES+me, mpi_data->world );
+    MPI_Send( out_control->buffer, buffer_req-1, MPI_CHAR, MASTER_NODE,
+              np*ANGLE_LINES+me, mpi_data->world );
   else{
     buffer_len = my_angles * line_len;
     for( i = 0; i < np; ++i )
       if( i != MASTER_NODE ) {
-	MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
-		  MPI_CHAR, i, np*ANGLE_LINES+i, mpi_data->world, &status );
-	MPI_Get_count( &status, MPI_CHAR, &cnt );
-	buffer_len += cnt;
+        MPI_Recv( out_control->buffer + buffer_len, buffer_req - buffer_len,
+                  MPI_CHAR, i, np*ANGLE_LINES+i, mpi_data->world, &status );
+        MPI_Get_count( &status, MPI_CHAR, &cnt );
+        buffer_len += cnt;
       }
     out_control->buffer[buffer_len] = 0;
     fprintf( out_control->strj, "%s", out_control->buffer );
   }
 #endif
-  
+
   return SUCCESS;
 }
 
 
-int Append_Frame( reax_system *system, control_params *control, 
-		  simulation_data *data, reax_list **lists, 
-		  output_controls *out_control, mpi_datatypes *mpi_data )
+int Append_Frame( reax_system *system, control_params *control,
+                  simulation_data *data, reax_list **lists,
+                  output_controls *out_control, mpi_datatypes *mpi_data )
 {
 #if defined(DEBUG_FOCUS)
   fprintf( stderr, "p%d: appending frame %d\n", system->my_rank, data->step );
@@ -1051,8 +1051,8 @@ int Append_Frame( reax_system *system, control_params *control,
     Write_Bonds( system, control, (*lists + BONDS), out_control, mpi_data );
 
   if( out_control->write_angles )
-    Write_Angles( system, control, (*lists + BONDS), (*lists + THREE_BODIES), 
-		  out_control, mpi_data );
+    Write_Angles( system, control, (*lists + BONDS), (*lists + THREE_BODIES),
+                  out_control, mpi_data );
 #if defined(DEBUG_FOCUS)
   fprintf( stderr, "p%d: appended frame %d\n", system->my_rank, data->step );
 #endif
@@ -1071,10 +1071,10 @@ int End_Traj( int my_rank, output_controls *out_control )
 #elif defined(LAMMPS_REAX)
   if( my_rank == MASTER_NODE )
     fclose( out_control->strj );
-#endif  
+#endif
 
   free( out_control->buffer );
   free( out_control->line );
-  
+
   return SUCCESS;
 }
diff --git a/src/USER-REAXC/reaxc_traj.h b/src/USER-REAXC/reaxc_traj.h
index 074e65df28..e00341e5e1 100644
--- a/src/USER-REAXC/reaxc_traj.h
+++ b/src/USER-REAXC/reaxc_traj.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -72,11 +72,11 @@ enum BOND_LINE_OPTS  { OPT_NOBOND, OPT_BOND_BASIC, OPT_BOND_FULL, NR_OPT_BOND };
 enum ANGLE_LINE_OPTS { OPT_NOANGLE, OPT_ANGLE_BASIC, NR_OPT_ANGLE };
 
 
-int  Init_Traj( reax_system*, control_params*, output_controls*, 
-		mpi_datatypes*, char* );
+int  Init_Traj( reax_system*, control_params*, output_controls*,
+                mpi_datatypes*, char* );
 int  End_Traj( int, output_controls* );
 
-int  Append_Frame( reax_system*, control_params*, simulation_data*, 
-		   reax_list**, output_controls*, mpi_datatypes* );
+int  Append_Frame( reax_system*, control_params*, simulation_data*,
+                   reax_list**, output_controls*, mpi_datatypes* );
 
 #endif
diff --git a/src/USER-REAXC/reaxc_types.h b/src/USER-REAXC/reaxc_types.h
index 69f74a1b2c..90feca2dd4 100644
--- a/src/USER-REAXC/reaxc_types.h
+++ b/src/USER-REAXC/reaxc_types.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -52,12 +52,12 @@
 //#define MIDPOINT_BOUNDARIES
 
 #define REAX_MAX_STR            1024
-#define REAX_MAX_NBRS           6    
+#define REAX_MAX_NBRS           6
 #define REAX_MAX_3BODY_PARAM    5
 #define REAX_MAX_4BODY_PARAM    5
 #define REAX_MAX_ATOM_TYPES     25
 #define REAX_MAX_MOLECULE_SIZE  20
-#define MAX_BOND    		20  // same as reaxc_defs.h
+#define MAX_BOND                    20  // same as reaxc_defs.h
 
 /********************** TYPE DEFINITIONS ********************/
 typedef int  ivec[3];
@@ -87,12 +87,12 @@ typedef struct
   int  type;
   int  num_bonds;
   int  num_hbonds;
-  //int  pad;  // pad to 8-byte address boundary   
+  //int  pad;  // pad to 8-byte address boundary
   char name[8];
-  rvec x;     // position 
-  rvec v;     // velocity 
-  rvec f_old; // old force 
-  rvec4 s, t;  // for calculating q 
+  rvec x;     // position
+  rvec v;     // velocity
+  rvec f_old; // old force
+  rvec4 s, t;  // for calculating q
 } mpi_atom;
 
 
@@ -102,9 +102,9 @@ typedef struct
   int  imprt_id;
   int  type;
   int  num_bonds;
-  int  num_hbonds;  
+  int  num_hbonds;
   //int  pad;
-  rvec x;     // position 
+  rvec x;     // position
 } boundary_atom;
 
 
@@ -157,7 +157,7 @@ typedef struct
 
 
 /* Global params mapping */
-/* 
+/*
 l[0]  = p_boc1
 l[1]  = p_boc2
 l[2]  = p_coa2
@@ -200,7 +200,7 @@ l[38] = p_coa3
 */
 
 typedef struct
-{      
+{
   int n_global;
   real* l;
   int vdw_type;
@@ -222,7 +222,7 @@ typedef struct
   real r_pi;
   real valency_e;
   real nlp_opt;
-  
+
   /* Line two in field file */
   real alpha;
   real gamma_w;
@@ -238,7 +238,7 @@ typedef struct
   real b_o_131;
   real b_o_132;
   real b_o_133;
-  
+
   /* Line four in the field file */
   real p_ovun2;
   real p_val3;
@@ -353,24 +353,24 @@ typedef struct
   int  type;
   char name[8];
 
-  rvec x; // position 
-  rvec v; // velocity 
-  rvec f; // force    
+  rvec x; // position
+  rvec v; // velocity
+  rvec f; // force
   rvec f_old;
 
-  real q; // charge   
-  rvec4 s; // they take part in 
-  rvec4 t; // computing q 
+  real q; // charge
+  rvec4 s; // they take part in
+  rvec4 t; // computing q
 
   int Hindex;
   int num_bonds;
   int num_hbonds;
   int renumber;
 
-  int numbonds;  		// true number of bonds around atoms
-  int nbr_id[MAX_BOND];  	// ids of neighbors around atoms
-  double nbr_bo[MAX_BOND];  	// BO values of bond between i and nbr
-  double sum_bo, no_lp;   	// sum of BO values and no. of lone pairs
+  int numbonds;                  // true number of bonds around atoms
+  int nbr_id[MAX_BOND];          // ids of neighbors around atoms
+  double nbr_bo[MAX_BOND];          // BO values of bond between i and nbr
+  double sum_bo, no_lp;           // sum of BO values and no. of lone pairs
 } reax_atom;
 
 
@@ -379,7 +379,7 @@ typedef struct
 {
   real V;
   rvec min, max, box_norms;
-  
+
   rtensor box, box_inv;
   rtensor trans, trans_inv;
   rtensor g;
@@ -403,7 +403,7 @@ struct grid_cell
   ivec* nbrs_x;
   rvec* nbrs_cp;
 };
-  
+
 typedef struct grid_cell grid_cell;
 
 
@@ -412,7 +412,7 @@ typedef struct
   int  total, max_atoms, max_nbrs;
   ivec ncells;
   rvec cell_len;
-  rvec inv_len; 
+  rvec inv_len;
 
   ivec bond_span;
   ivec nonb_span;
@@ -501,10 +501,10 @@ typedef struct
   ivec procs_by_dim;
   /* ensemble values:
      0 : NVE
-     1 : bNVT (Berendsen) 
+     1 : bNVT (Berendsen)
      2 : nhNVT (Nose-Hoover)
      3 : sNPT (Parrinello-Rehman-Nose-Hoover) semiisotropic
-     4 : iNPT (Parrinello-Rehman-Nose-Hoover) isotropic 
+     4 : iNPT (Parrinello-Rehman-Nose-Hoover) isotropic
      5 : NPT  (Parrinello-Rehman-Nose-Hoover) Anisotropic*/
   int  ensemble;
   int  nsteps;
@@ -516,7 +516,7 @@ typedef struct
   int  remove_CoM_vel;
   int  random_vel;
   int  reposition_atoms;
-  
+
   int  reneighbor;
   real vlist_cut;
   real bond_cut;
@@ -534,14 +534,14 @@ typedef struct
   int qeq_freq;
   real q_err;
   int refactor;
-  real droptol;  
+  real droptol;
 
   real T_init, T_final, T;
   real Tau_T;
   int  T_mode;
   real T_rate, T_freq;
-  
-  int  virial;  
+
+  int  virial;
   rvec P, Tau_P, Tau_PT;
   int  press_mode;
   real compressibility;
@@ -587,7 +587,7 @@ typedef struct
 {
   rtensor P;
   real P_scalar;
-  
+
   real eps;
   real v_eps;
   real v_eps_old;
@@ -622,22 +622,22 @@ typedef struct
 typedef struct
 {
   real e_tot;
-  real e_kin;                      // Total kinetic energy 
+  real e_kin;                      // Total kinetic energy
   real e_pot;
 
-  real e_bond;                     // Total bond energy 
-  real e_ov;                       // Total over coordination 
-  real e_un;                       // Total under coordination energy 
-  real e_lp;                       // Total under coordination energy 
-  real e_ang;                      // Total valance angle energy 
-  real e_pen;                      // Total penalty energy 
-  real e_coa;                      // Total three body conjgation energy 
-  real e_hb;                       // Total Hydrogen bond energy 
-  real e_tor;                      // Total torsional energy 
-  real e_con;                      // Total four body conjugation energy  
-  real e_vdW;                      // Total van der Waals energy 
-  real e_ele;                      // Total electrostatics energy 
-  real e_pol;                      // Polarization energy 
+  real e_bond;                     // Total bond energy
+  real e_ov;                       // Total over coordination
+  real e_un;                       // Total under coordination energy
+  real e_lp;                       // Total under coordination energy
+  real e_ang;                      // Total valance angle energy
+  real e_pen;                      // Total penalty energy
+  real e_coa;                      // Total three body conjgation energy
+  real e_hb;                       // Total Hydrogen bond energy
+  real e_tor;                      // Total torsional energy
+  real e_con;                      // Total four body conjugation energy
+  real e_vdW;                      // Total van der Waals energy
+  real e_ele;                      // Total electrostatics energy
+  real e_pol;                      // Polarization energy
 } energy_data;
 
 typedef struct
@@ -646,27 +646,27 @@ typedef struct
   int  prev_steps;
   real time;
 
-  real M;			   // Total Mass 
-  real inv_M;                      // 1 / Total Mass 
+  real M;                           // Total Mass
+  real inv_M;                      // 1 / Total Mass
 
-  rvec xcm;                        // Center of mass 
-  rvec vcm;                        // Center of mass velocity 
-  rvec fcm;                        // Center of mass force 
-  rvec amcm;                       // Angular momentum of CoM 
-  rvec avcm;                       // Angular velocity of CoM 
-  real etran_cm;                   // Translational kinetic energy of CoM 
-  real erot_cm;                    // Rotational kinetic energy of CoM 
+  rvec xcm;                        // Center of mass
+  rvec vcm;                        // Center of mass velocity
+  rvec fcm;                        // Center of mass force
+  rvec amcm;                       // Angular momentum of CoM
+  rvec avcm;                       // Angular velocity of CoM
+  real etran_cm;                   // Translational kinetic energy of CoM
+  real erot_cm;                    // Rotational kinetic energy of CoM
 
-  rtensor kinetic;                 // Kinetic energy tensor 
-  rtensor virial;                  // Hydrodynamic virial 
+  rtensor kinetic;                 // Kinetic energy tensor
+  rtensor virial;                  // Hydrodynamic virial
 
   energy_data my_en;
   energy_data sys_en;
 
-  real               N_f;          //Number of degrees of freedom 
+  real               N_f;          //Number of degrees of freedom
   rvec               t_scale;
   rtensor            p_scale;
-  thermostat         therm;        // Used in Nose_Hoover method 
+  thermostat         therm;        // Used in Nose_Hoover method
   isotropic_barostat iso_bar;
   flexible_barostat  flex_bar;
   real               inv_W;
@@ -677,13 +677,13 @@ typedef struct
   rvec ext_press;
   rvec tot_press;
 
-  reax_timing timing;  
+  reax_timing timing;
 } simulation_data;
 
 
 typedef struct{
   int thb;
-  int pthb; // pointer to the third body on the central atom's nbrlist 
+  int pthb; // pointer to the third body on the central atom's nbrlist
   real theta, cos_theta;
   rvec dcos_di, dcos_dj, dcos_dk;
 } three_body_interaction_data;
@@ -748,7 +748,7 @@ typedef struct {
 } sparse_matrix;
 
 
-typedef struct { 
+typedef struct {
   int num_far;
   int H, Htop;
   int hbonds, num_hbonds;
@@ -782,7 +782,7 @@ typedef struct
   real *Hdia_inv, *b_s, *b_t, *b_prc, *b_prm, *s, *t;
   real *droptol;
   rvec2 *b, *x;
-  
+
   /* GMRES storage */
   real *y, *z, *g;
   real *hc, *hs;
@@ -796,16 +796,16 @@ typedef struct
   /* storage for analysis */
   int  *mark, *old_mark;
   rvec *x_old;
-  
+
   /* storage space for bond restrictions */
   int  *restricted;
-  int **restricted_list;  
+  int **restricted_list;
 
   /* integrator */
   rvec *v_const;
 
   /* force calculations */
-  real *CdDelta;  // coefficient of dDelta 
+  real *CdDelta;  // coefficient of dDelta
   rvec *f;
 #ifdef TEST_FORCES
   rvec *f_ele;
@@ -822,7 +822,7 @@ typedef struct
   rvec *f_tor;
   rvec *f_con;
   rvec *f_tot;
-  rvec *dDelta;   // calculated on the fly in bond_orders.c together with bo' 
+  rvec *dDelta;   // calculated on the fly in bond_orders.c together with bo'
 
   int  *rcounts;
   int  *displs;
@@ -940,7 +940,7 @@ typedef struct
   int atom_count;
   int atom_list[REAX_MAX_MOLECULE_SIZE];
   int mtypes[REAX_MAX_ATOM_TYPES];
-} molecule; 
+} molecule;
 
 
 typedef struct
@@ -975,20 +975,20 @@ typedef struct
 extern LR_lookup_table **LR;
 
 /* function pointer defs */
-typedef void (*evolve_function)(reax_system*, control_params*, 
-				simulation_data*, storage*, reax_list**, 
-				output_controls*, mpi_datatypes* );
+typedef void (*evolve_function)(reax_system*, control_params*,
+                                simulation_data*, storage*, reax_list**,
+                                output_controls*, mpi_datatypes* );
 #if defined(PURE_REAX)
 evolve_function  Evolve;
 #endif
 
-typedef void (*interaction_function) (reax_system*, control_params*, 
-				      simulation_data*, storage*, 
-				      reax_list**, output_controls*);
+typedef void (*interaction_function) (reax_system*, control_params*,
+                                      simulation_data*, storage*,
+                                      reax_list**, output_controls*);
 
-typedef void (*print_interaction)(reax_system*, control_params*, 
-				  simulation_data*, storage*, 
-				  reax_list**, output_controls*);
+typedef void (*print_interaction)(reax_system*, control_params*,
+                                  simulation_data*, storage*,
+                                  reax_list**, output_controls*);
 
 typedef real (*lookup_function)(real);
 
diff --git a/src/USER-REAXC/reaxc_valence_angles.cpp b/src/USER-REAXC/reaxc_valence_angles.cpp
index 6eee1548a1..5049fb769f 100644
--- a/src/USER-REAXC/reaxc_valence_angles.cpp
+++ b/src/USER-REAXC/reaxc_valence_angles.cpp
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -39,22 +39,22 @@
 
 
 /* calculates the theta angle between i-j-k */
-void Calculate_Theta( rvec dvec_ji, real d_ji, rvec dvec_jk, real d_jk, 
-		      real *theta, real *cos_theta )
+void Calculate_Theta( rvec dvec_ji, real d_ji, rvec dvec_jk, real d_jk,
+                      real *theta, real *cos_theta )
 {
   (*cos_theta) = Dot( dvec_ji, dvec_jk, 3 ) / ( d_ji * d_jk );
   if( *cos_theta > 1. ) *cos_theta  = 1.0;
   if( *cos_theta < -1. ) *cos_theta  = -1.0;
- 
+
   (*theta) = acos( *cos_theta );
 }
 
 
 /* calculates the derivative of the cosine of the angle between i-j-k */
-void Calculate_dCos_Theta( rvec dvec_ji, real d_ji, rvec dvec_jk, real d_jk, 
-			   rvec* dcos_theta_di, 
-			   rvec* dcos_theta_dj, 
-			   rvec* dcos_theta_dk )
+void Calculate_dCos_Theta( rvec dvec_ji, real d_ji, rvec dvec_jk, real d_jk,
+                           rvec* dcos_theta_di,
+                           rvec* dcos_theta_dj,
+                           rvec* dcos_theta_dk )
 {
   int t;
   real sqr_d_ji = SQR(d_ji);
@@ -65,21 +65,21 @@ void Calculate_dCos_Theta( rvec dvec_ji, real d_ji, rvec dvec_jk, real d_jk,
   real Cdot_inv3 = dot_dvecs * inv_dists3;
 
   for( t = 0; t < 3; ++t ) {
-    (*dcos_theta_di)[t] = dvec_jk[t] * inv_dists - 
+    (*dcos_theta_di)[t] = dvec_jk[t] * inv_dists -
       Cdot_inv3 * sqr_d_jk * dvec_ji[t];
     (*dcos_theta_dj)[t] = -(dvec_jk[t] + dvec_ji[t]) * inv_dists +
       Cdot_inv3 * ( sqr_d_jk * dvec_ji[t] + sqr_d_ji * dvec_jk[t] );
-    (*dcos_theta_dk)[t] = dvec_ji[t] * inv_dists - 
+    (*dcos_theta_dk)[t] = dvec_ji[t] * inv_dists -
       Cdot_inv3 * sqr_d_ji * dvec_jk[t];
   }
 }
 
 
-/* this is a 3-body interaction in which the main role is 
+/* this is a 3-body interaction in which the main role is
    played by j which sits in the middle of the other two. */
-void Valence_Angles( reax_system *system, control_params *control, 
-		     simulation_data *data, storage *workspace, 
-		     reax_list **lists, output_controls *out_control )
+void Valence_Angles( reax_system *system, control_params *control,
+                     simulation_data *data, storage *workspace,
+                     reax_list **lists, output_controls *out_control )
 {
   int i, j, pi, k, pk, t;
   int type_i, type_j, type_k;
@@ -125,26 +125,26 @@ void Valence_Angles( reax_system *system, control_params *control,
   p_val10 = system->reax_param.gp.l[17];
   num_thb_intrs = 0;
 
-  
-  for( j = 0; j < system->N; ++j ) { 	// Ray: the first one with system->N
+
+  for( j = 0; j < system->N; ++j ) {         // Ray: the first one with system->N
     // fprintf( out_control->eval, "j: %d\n", j );
     type_j = system->my_atoms[j].type;
     start_j = Start_Index(j, bonds);
     end_j = End_Index(j, bonds);
-    
+
     p_val3 = system->reax_param.sbp[ type_j ].p_val3;
     p_val5 = system->reax_param.sbp[ type_j ].p_val5;
-    
+
     SBOp = 0, prod_SBO = 1;
     for( t = start_j; t < end_j; ++t ) {
       bo_jt = &(bonds->select.bond_list[t].bo_data);
       SBOp += (bo_jt->BO_pi + bo_jt->BO_pi2);
       temp = SQR( bo_jt->BO );
-      temp *= temp; 
+      temp *= temp;
       temp *= temp;
       prod_SBO *= exp( -temp );
     }
-    
+
     /* modifications to match Adri's code - 09/01/09 */
     if( workspace->vlpex[j] >= 0 ){
       vlpadj = 0;
@@ -157,388 +157,388 @@ void Valence_Angles( reax_system *system, control_params *control,
 
     SBO = SBOp + (1 - prod_SBO) * (-workspace->Delta_boc[j] - p_val8 * vlpadj);
     dSBO1 = -8 * prod_SBO * ( workspace->Delta_boc[j] + p_val8 * vlpadj );
-      
+
     if( SBO <= 0 )
       SBO2 = 0, CSBO2 = 0;
     else if( SBO > 0 && SBO <= 1 ) {
-	SBO2 = pow( SBO, p_val9 );
-	CSBO2 = p_val9 * pow( SBO, p_val9 - 1 );
+        SBO2 = pow( SBO, p_val9 );
+        CSBO2 = p_val9 * pow( SBO, p_val9 - 1 );
     }
     else if( SBO > 1 && SBO < 2 ) {
       SBO2 = 2 - pow( 2-SBO, p_val9 );
       CSBO2 = p_val9 * pow( 2 - SBO, p_val9 - 1 );
     }
-    else 
-      SBO2 = 2, CSBO2 = 0;  
-    
-    expval6 = exp( p_val6 * workspace->Delta_boc[j] );    
-    
+    else
+      SBO2 = 2, CSBO2 = 0;
+
+    expval6 = exp( p_val6 * workspace->Delta_boc[j] );
+
     for( pi = start_j; pi < end_j; ++pi ) {
       Set_Start_Index( pi, num_thb_intrs, thb_intrs );
       pbond_ij = &(bonds->select.bond_list[pi]);
       bo_ij = &(pbond_ij->bo_data);
       BOA_ij = bo_ij->BO - control->thb_cut;
-      
-      
-      if( BOA_ij/*bo_ij->BO*/ > 0.0 && 
-	  ( j < system->n || pbond_ij->nbr < system->n ) ) {
-	i = pbond_ij->nbr;
-	r_ij = pbond_ij->d;	 
-	type_i = system->my_atoms[i].type;
-	// fprintf( out_control->eval, "i: %d\n", i );
-	
-	
-	/* first copy 3-body intrs from previously computed ones where i>k.
-	   in the second for-loop below, 
-	   we compute only new 3-body intrs where i < k */
-	for( pk = start_j; pk < pi; ++pk ) {
-	  // fprintf( out_control->eval, "pk: %d\n", pk );
-	  start_pk = Start_Index( pk, thb_intrs );
-	  end_pk = End_Index( pk, thb_intrs );
-		  
-	  for( t = start_pk; t < end_pk; ++t )
-	    if( thb_intrs->select.three_body_list[t].thb == i ) {
-	      p_ijk = &(thb_intrs->select.three_body_list[num_thb_intrs] );
-	      p_kji = &(thb_intrs->select.three_body_list[t]);
-	      
-	      p_ijk->thb = bonds->select.bond_list[pk].nbr;
-	      p_ijk->pthb  = pk;
-	      p_ijk->theta = p_kji->theta;			  
-	      rvec_Copy( p_ijk->dcos_di, p_kji->dcos_dk );
-	      rvec_Copy( p_ijk->dcos_dj, p_kji->dcos_dj );
-	      rvec_Copy( p_ijk->dcos_dk, p_kji->dcos_di );
-	      
-	      ++num_thb_intrs;
-	      break;
-	    }
-	}
-	      
-
-	/* and this is the second for loop mentioned above */
-	for( pk = pi+1; pk < end_j; ++pk ) {
-	  pbond_jk = &(bonds->select.bond_list[pk]);
-	  bo_jk    = &(pbond_jk->bo_data);
-	  BOA_jk   = bo_jk->BO - control->thb_cut;
-	  k        = pbond_jk->nbr;
-	  type_k   = system->my_atoms[k].type;
-	  p_ijk    = &( thb_intrs->select.three_body_list[num_thb_intrs] );
-	  
-	  Calculate_Theta( pbond_ij->dvec, pbond_ij->d, 
-			   pbond_jk->dvec, pbond_jk->d,
-			   &theta, &cos_theta );
-	  
-	  Calculate_dCos_Theta( pbond_ij->dvec, pbond_ij->d, 
-				pbond_jk->dvec, pbond_jk->d, 
-				&(p_ijk->dcos_di), &(p_ijk->dcos_dj), 
-				&(p_ijk->dcos_dk) );
-	  p_ijk->thb = k;
-	  p_ijk->pthb = pk;
-	  p_ijk->theta = theta;
-	  
-	  sin_theta = sin( theta );
-	  if( sin_theta < 1.0e-5 )
-	    sin_theta = 1.0e-5;
-
-	  ++num_thb_intrs;
-	  
-	  
-	  if( (j < system->n) && (BOA_jk > 0.0) && 
-              (bo_ij->BO > control->thb_cut) &&  
-              (bo_jk->BO > control->thb_cut) &&  
+
+
+      if( BOA_ij/*bo_ij->BO*/ > 0.0 &&
+          ( j < system->n || pbond_ij->nbr < system->n ) ) {
+        i = pbond_ij->nbr;
+        r_ij = pbond_ij->d;
+        type_i = system->my_atoms[i].type;
+        // fprintf( out_control->eval, "i: %d\n", i );
+
+
+        /* first copy 3-body intrs from previously computed ones where i>k.
+           in the second for-loop below,
+           we compute only new 3-body intrs where i < k */
+        for( pk = start_j; pk < pi; ++pk ) {
+          // fprintf( out_control->eval, "pk: %d\n", pk );
+          start_pk = Start_Index( pk, thb_intrs );
+          end_pk = End_Index( pk, thb_intrs );
+
+          for( t = start_pk; t < end_pk; ++t )
+            if( thb_intrs->select.three_body_list[t].thb == i ) {
+              p_ijk = &(thb_intrs->select.three_body_list[num_thb_intrs] );
+              p_kji = &(thb_intrs->select.three_body_list[t]);
+
+              p_ijk->thb = bonds->select.bond_list[pk].nbr;
+              p_ijk->pthb  = pk;
+              p_ijk->theta = p_kji->theta;
+              rvec_Copy( p_ijk->dcos_di, p_kji->dcos_dk );
+              rvec_Copy( p_ijk->dcos_dj, p_kji->dcos_dj );
+              rvec_Copy( p_ijk->dcos_dk, p_kji->dcos_di );
+
+              ++num_thb_intrs;
+              break;
+            }
+        }
+
+
+        /* and this is the second for loop mentioned above */
+        for( pk = pi+1; pk < end_j; ++pk ) {
+          pbond_jk = &(bonds->select.bond_list[pk]);
+          bo_jk    = &(pbond_jk->bo_data);
+          BOA_jk   = bo_jk->BO - control->thb_cut;
+          k        = pbond_jk->nbr;
+          type_k   = system->my_atoms[k].type;
+          p_ijk    = &( thb_intrs->select.three_body_list[num_thb_intrs] );
+
+          Calculate_Theta( pbond_ij->dvec, pbond_ij->d,
+                           pbond_jk->dvec, pbond_jk->d,
+                           &theta, &cos_theta );
+
+          Calculate_dCos_Theta( pbond_ij->dvec, pbond_ij->d,
+                                pbond_jk->dvec, pbond_jk->d,
+                                &(p_ijk->dcos_di), &(p_ijk->dcos_dj),
+                                &(p_ijk->dcos_dk) );
+          p_ijk->thb = k;
+          p_ijk->pthb = pk;
+          p_ijk->theta = theta;
+
+          sin_theta = sin( theta );
+          if( sin_theta < 1.0e-5 )
+            sin_theta = 1.0e-5;
+
+          ++num_thb_intrs;
+
+
+          if( (j < system->n) && (BOA_jk > 0.0) &&
+              (bo_ij->BO > control->thb_cut) &&
+              (bo_jk->BO > control->thb_cut) &&
               (bo_ij->BO * bo_jk->BO > control->thb_cutsq) ) {
-	    r_jk = pbond_jk->d;		      
-	    thbh = &( system->reax_param.thbp[ type_i ][ type_j ][ type_k ] );
-	    
-	    /* if( system->my_atoms[i].orig_id < system->my_atoms[k].orig_id )
-	       fprintf( fval, "%6d %6d %6d %7.3f %7.3f %7.3f\n", 
-	       system->my_atoms[i].orig_id, 
-	       system->my_atoms[j].orig_id, 
-	       system->my_atoms[k].orig_id,
-	       bo_ij->BO, bo_jk->BO, p_ijk->theta );
-	       else 
-	       fprintf( fval, "%6d %6d %6d %7.3f %7.3f %7.3f\n", 
-	       system->my_atoms[k].orig_id,
-	       system->my_atoms[j].orig_id, 
-	       system->my_atoms[i].orig_id, 
-	       bo_jk->BO, bo_ij->BO, p_ijk->theta ); */
-	    
-	    for( cnt = 0; cnt < thbh->cnt; ++cnt ) {
-	      // fprintf( out_control->eval, "%6d%6d%6d -- exists in thbp\n", 
-	      //          i+1, j+1, k+1 );
-
-	      if( fabs(thbh->prm[cnt].p_val1) > 0.001 ) {
-		thbp = &( thbh->prm[cnt] );			     
-
-		/* ANGLE ENERGY */
-		p_val1 = thbp->p_val1;
-		p_val2 = thbp->p_val2;
-		p_val4 = thbp->p_val4;
-		p_val7 = thbp->p_val7;
-		theta_00 = thbp->theta_00;
-		
-		exp3ij = exp( -p_val3 * pow( BOA_ij, p_val4 ) );
-		f7_ij = 1.0 - exp3ij;
-		Cf7ij = p_val3 * p_val4 * pow( BOA_ij, p_val4 - 1.0 ) * exp3ij;
-		
-		exp3jk = exp( -p_val3 * pow( BOA_jk, p_val4 ) );
-		f7_jk = 1.0 - exp3jk;
-		Cf7jk = p_val3 * p_val4 * pow( BOA_jk, p_val4 - 1.0 ) * exp3jk;
-		
-		expval7 = exp( -p_val7 * workspace->Delta_boc[j] );
-		trm8 = 1.0 + expval6 + expval7;
-		f8_Dj = p_val5 - ( (p_val5 - 1.0) * (2.0 + expval6) / trm8 );
-		Cf8j = ( (1.0 - p_val5) / SQR(trm8) ) *
-		  ( p_val6 * expval6 * trm8 - 
-		    (2.0 + expval6) * ( p_val6*expval6 - p_val7*expval7 ) );
-		
-		theta_0 = 180.0 - theta_00 * (1.0 - 
-					      exp(-p_val10 * (2.0 - SBO2)));
-		theta_0 = DEG2RAD( theta_0 );		      
-		
-		expval2theta  = exp( -p_val2 * SQR(theta_0 - theta) );
-		if( p_val1 >= 0 ) 
-		  expval12theta = p_val1 * (1.0 - expval2theta);
-		else // To avoid linear Me-H-Me angles (6/6/06)
-		  expval12theta = p_val1 * -expval2theta;
-		
-		CEval1 = Cf7ij * f7_jk * f8_Dj * expval12theta;
-		CEval2 = Cf7jk * f7_ij * f8_Dj * expval12theta;
-		CEval3 = Cf8j  * f7_ij * f7_jk * expval12theta;
-		CEval4 = -2.0 * p_val1 * p_val2 * f7_ij * f7_jk * f8_Dj * 
-		  expval2theta * (theta_0 - theta);
-		
-		Ctheta_0 = p_val10 * DEG2RAD(theta_00) * 
-		  exp( -p_val10 * (2.0 - SBO2) );
-		
-		CEval5 = -CEval4 * Ctheta_0 * CSBO2;
-		CEval6 = CEval5 * dSBO1;
-		CEval7 = CEval5 * dSBO2;
-		CEval8 = -CEval4 / sin_theta;
-		
-		data->my_en.e_ang += e_ang = 
-		  f7_ij * f7_jk * f8_Dj * expval12theta;
-		/* END ANGLE ENERGY*/
-		
-		
-		/* PENALTY ENERGY */
-		p_pen1 = thbp->p_pen1;
-		p_pen2 = system->reax_param.gp.l[19];
-		p_pen3 = system->reax_param.gp.l[20];
-		p_pen4 = system->reax_param.gp.l[21];
-		
-		exp_pen2ij = exp( -p_pen2 * SQR( BOA_ij - 2.0 ) );
-		exp_pen2jk = exp( -p_pen2 * SQR( BOA_jk - 2.0 ) );
-		exp_pen3 = exp( -p_pen3 * workspace->Delta[j] );
-		exp_pen4 = exp(  p_pen4 * workspace->Delta[j] );
-		trm_pen34 = 1.0 + exp_pen3 + exp_pen4;
-		f9_Dj = ( 2.0 + exp_pen3 ) / trm_pen34;
-		Cf9j = ( -p_pen3 * exp_pen3 * trm_pen34 - 
-			 (2.0 + exp_pen3) * ( -p_pen3 * exp_pen3 + 
-					      p_pen4 * exp_pen4 ) ) / 
-		  SQR( trm_pen34 );
-		
-		data->my_en.e_pen += e_pen = 
-		  p_pen1 * f9_Dj * exp_pen2ij * exp_pen2jk;
-		
-		CEpen1 = e_pen * Cf9j / f9_Dj;
-		temp   = -2.0 * p_pen2 * e_pen;
-		CEpen2 = temp * (BOA_ij - 2.0);
-		CEpen3 = temp * (BOA_jk - 2.0);
-		/* END PENALTY ENERGY */
-		
-		
-		/* COALITION ENERGY */
-		p_coa1 = thbp->p_coa1;
-		p_coa2 = system->reax_param.gp.l[2];
-		p_coa3 = system->reax_param.gp.l[38];
-		p_coa4 = system->reax_param.gp.l[30];
-		
-		exp_coa2 = exp( p_coa2 * workspace->Delta_val[j] );
-		data->my_en.e_coa += e_coa = 
-		  p_coa1 / (1. + exp_coa2) *
-		  exp( -p_coa3 * SQR(workspace->total_bond_order[i]-BOA_ij) ) *
-		  exp( -p_coa3 * SQR(workspace->total_bond_order[k]-BOA_jk) ) *
-		  exp( -p_coa4 * SQR(BOA_ij - 1.5) ) * 
-		  exp( -p_coa4 * SQR(BOA_jk - 1.5) );
-		
-		CEcoa1 = -2 * p_coa4 * (BOA_ij - 1.5) * e_coa;
-		CEcoa2 = -2 * p_coa4 * (BOA_jk - 1.5) * e_coa;
-		CEcoa3 = -p_coa2 * exp_coa2 * e_coa / (1 + exp_coa2);
-		CEcoa4 = -2 * p_coa3 * 
-		  (workspace->total_bond_order[i]-BOA_ij) * e_coa;
-		CEcoa5 = -2 * p_coa3 * 
-		  (workspace->total_bond_order[k]-BOA_jk) * e_coa;
-		/* END COALITION ENERGY */
-
-		
-		/* FORCES */
-		bo_ij->Cdbo += (CEval1 + CEpen2 + (CEcoa1 - CEcoa4));
-		bo_jk->Cdbo += (CEval2 + CEpen3 + (CEcoa2 - CEcoa5));
-		workspace->CdDelta[j] += ((CEval3 + CEval7) + CEpen1 + CEcoa3);
-		workspace->CdDelta[i] += CEcoa4;
-		workspace->CdDelta[k] += CEcoa5;		      
-		
-		for( t = start_j; t < end_j; ++t ) {
-		    pbond_jt = &( bonds->select.bond_list[t] );
-		    bo_jt = &(pbond_jt->bo_data);
-		    temp_bo_jt = bo_jt->BO;
-		    temp = CUBE( temp_bo_jt );
-		    pBOjt7 = temp * temp * temp_bo_jt; 
-		    
-		    // fprintf( out_control->eval, "%6d%12.8f\n", 
-		    // workspace->reverse_map[bonds->select.bond_list[t].nbr],
-		    // (CEval6 * pBOjt7) );
-		    
-		    bo_jt->Cdbo += (CEval6 * pBOjt7);
-		    bo_jt->Cdbopi += CEval5;
-		    bo_jt->Cdbopi2 += CEval5;
-		}		      
-		
-		if( control->virial == 0 ) {
-		  rvec_ScaledAdd( workspace->f[i], CEval8, p_ijk->dcos_di );
-		  rvec_ScaledAdd( workspace->f[j], CEval8, p_ijk->dcos_dj );
-		  rvec_ScaledAdd( workspace->f[k], CEval8, p_ijk->dcos_dk );
-		}
-		else {
-		  /* terms not related to bond order derivatives are
-		     added directly into forces and pressure vector/tensor */
-		  rvec_Scale( force, CEval8, p_ijk->dcos_di );
-		  rvec_Add( workspace->f[i], force );
-		  rvec_iMultiply( ext_press, pbond_ij->rel_box, force );
-		  rvec_Add( data->my_ext_press, ext_press );
-		  
-		  rvec_ScaledAdd( workspace->f[j], CEval8, p_ijk->dcos_dj );
-		  
-		  rvec_Scale( force, CEval8, p_ijk->dcos_dk );
-		  rvec_Add( workspace->f[k], force );
-		  rvec_iMultiply( ext_press, pbond_jk->rel_box, force );
-		  rvec_Add( data->my_ext_press, ext_press );
-		}
-
-		/* tally into per-atom virials */
-		if( system->pair_ptr->vflag_atom || system->pair_ptr->evflag) {
-			
-		  /* Acquire vectors */
-		  rvec_ScaledSum( delij, 1., system->my_atoms[i].x,
-					-1., system->my_atoms[j].x );
-		  rvec_ScaledSum( delkj, 1., system->my_atoms[k].x,
-					-1., system->my_atoms[j].x );
-		  
-		  rvec_Scale( fi_tmp, -CEval8, p_ijk->dcos_di );
-		  rvec_Scale( fj_tmp, -CEval8, p_ijk->dcos_dj );
-		  rvec_Scale( fk_tmp, -CEval8, p_ijk->dcos_dk );
-		  
-		  eng_tmp = e_ang + e_pen + e_coa;
-
-		  if( system->pair_ptr->evflag)
-			  system->pair_ptr->ev_tally(j,j,system->N,1,eng_tmp,0.0,0.0,0.0,0.0,0.0);
-		  if( system->pair_ptr->vflag_atom)
-			  system->pair_ptr->v_tally3(i,j,k,fi_tmp,fk_tmp,delij,delkj);
-		}
-		
+            r_jk = pbond_jk->d;
+            thbh = &( system->reax_param.thbp[ type_i ][ type_j ][ type_k ] );
+
+            /* if( system->my_atoms[i].orig_id < system->my_atoms[k].orig_id )
+               fprintf( fval, "%6d %6d %6d %7.3f %7.3f %7.3f\n",
+               system->my_atoms[i].orig_id,
+               system->my_atoms[j].orig_id,
+               system->my_atoms[k].orig_id,
+               bo_ij->BO, bo_jk->BO, p_ijk->theta );
+               else
+               fprintf( fval, "%6d %6d %6d %7.3f %7.3f %7.3f\n",
+               system->my_atoms[k].orig_id,
+               system->my_atoms[j].orig_id,
+               system->my_atoms[i].orig_id,
+               bo_jk->BO, bo_ij->BO, p_ijk->theta ); */
+
+            for( cnt = 0; cnt < thbh->cnt; ++cnt ) {
+              // fprintf( out_control->eval, "%6d%6d%6d -- exists in thbp\n",
+              //          i+1, j+1, k+1 );
+
+              if( fabs(thbh->prm[cnt].p_val1) > 0.001 ) {
+                thbp = &( thbh->prm[cnt] );
+
+                /* ANGLE ENERGY */
+                p_val1 = thbp->p_val1;
+                p_val2 = thbp->p_val2;
+                p_val4 = thbp->p_val4;
+                p_val7 = thbp->p_val7;
+                theta_00 = thbp->theta_00;
+
+                exp3ij = exp( -p_val3 * pow( BOA_ij, p_val4 ) );
+                f7_ij = 1.0 - exp3ij;
+                Cf7ij = p_val3 * p_val4 * pow( BOA_ij, p_val4 - 1.0 ) * exp3ij;
+
+                exp3jk = exp( -p_val3 * pow( BOA_jk, p_val4 ) );
+                f7_jk = 1.0 - exp3jk;
+                Cf7jk = p_val3 * p_val4 * pow( BOA_jk, p_val4 - 1.0 ) * exp3jk;
+
+                expval7 = exp( -p_val7 * workspace->Delta_boc[j] );
+                trm8 = 1.0 + expval6 + expval7;
+                f8_Dj = p_val5 - ( (p_val5 - 1.0) * (2.0 + expval6) / trm8 );
+                Cf8j = ( (1.0 - p_val5) / SQR(trm8) ) *
+                  ( p_val6 * expval6 * trm8 -
+                    (2.0 + expval6) * ( p_val6*expval6 - p_val7*expval7 ) );
+
+                theta_0 = 180.0 - theta_00 * (1.0 -
+                                              exp(-p_val10 * (2.0 - SBO2)));
+                theta_0 = DEG2RAD( theta_0 );
+
+                expval2theta  = exp( -p_val2 * SQR(theta_0 - theta) );
+                if( p_val1 >= 0 )
+                  expval12theta = p_val1 * (1.0 - expval2theta);
+                else // To avoid linear Me-H-Me angles (6/6/06)
+                  expval12theta = p_val1 * -expval2theta;
+
+                CEval1 = Cf7ij * f7_jk * f8_Dj * expval12theta;
+                CEval2 = Cf7jk * f7_ij * f8_Dj * expval12theta;
+                CEval3 = Cf8j  * f7_ij * f7_jk * expval12theta;
+                CEval4 = -2.0 * p_val1 * p_val2 * f7_ij * f7_jk * f8_Dj *
+                  expval2theta * (theta_0 - theta);
+
+                Ctheta_0 = p_val10 * DEG2RAD(theta_00) *
+                  exp( -p_val10 * (2.0 - SBO2) );
+
+                CEval5 = -CEval4 * Ctheta_0 * CSBO2;
+                CEval6 = CEval5 * dSBO1;
+                CEval7 = CEval5 * dSBO2;
+                CEval8 = -CEval4 / sin_theta;
+
+                data->my_en.e_ang += e_ang =
+                  f7_ij * f7_jk * f8_Dj * expval12theta;
+                /* END ANGLE ENERGY*/
+
+
+                /* PENALTY ENERGY */
+                p_pen1 = thbp->p_pen1;
+                p_pen2 = system->reax_param.gp.l[19];
+                p_pen3 = system->reax_param.gp.l[20];
+                p_pen4 = system->reax_param.gp.l[21];
+
+                exp_pen2ij = exp( -p_pen2 * SQR( BOA_ij - 2.0 ) );
+                exp_pen2jk = exp( -p_pen2 * SQR( BOA_jk - 2.0 ) );
+                exp_pen3 = exp( -p_pen3 * workspace->Delta[j] );
+                exp_pen4 = exp(  p_pen4 * workspace->Delta[j] );
+                trm_pen34 = 1.0 + exp_pen3 + exp_pen4;
+                f9_Dj = ( 2.0 + exp_pen3 ) / trm_pen34;
+                Cf9j = ( -p_pen3 * exp_pen3 * trm_pen34 -
+                         (2.0 + exp_pen3) * ( -p_pen3 * exp_pen3 +
+                                              p_pen4 * exp_pen4 ) ) /
+                  SQR( trm_pen34 );
+
+                data->my_en.e_pen += e_pen =
+                  p_pen1 * f9_Dj * exp_pen2ij * exp_pen2jk;
+
+                CEpen1 = e_pen * Cf9j / f9_Dj;
+                temp   = -2.0 * p_pen2 * e_pen;
+                CEpen2 = temp * (BOA_ij - 2.0);
+                CEpen3 = temp * (BOA_jk - 2.0);
+                /* END PENALTY ENERGY */
+
+
+                /* COALITION ENERGY */
+                p_coa1 = thbp->p_coa1;
+                p_coa2 = system->reax_param.gp.l[2];
+                p_coa3 = system->reax_param.gp.l[38];
+                p_coa4 = system->reax_param.gp.l[30];
+
+                exp_coa2 = exp( p_coa2 * workspace->Delta_val[j] );
+                data->my_en.e_coa += e_coa =
+                  p_coa1 / (1. + exp_coa2) *
+                  exp( -p_coa3 * SQR(workspace->total_bond_order[i]-BOA_ij) ) *
+                  exp( -p_coa3 * SQR(workspace->total_bond_order[k]-BOA_jk) ) *
+                  exp( -p_coa4 * SQR(BOA_ij - 1.5) ) *
+                  exp( -p_coa4 * SQR(BOA_jk - 1.5) );
+
+                CEcoa1 = -2 * p_coa4 * (BOA_ij - 1.5) * e_coa;
+                CEcoa2 = -2 * p_coa4 * (BOA_jk - 1.5) * e_coa;
+                CEcoa3 = -p_coa2 * exp_coa2 * e_coa / (1 + exp_coa2);
+                CEcoa4 = -2 * p_coa3 *
+                  (workspace->total_bond_order[i]-BOA_ij) * e_coa;
+                CEcoa5 = -2 * p_coa3 *
+                  (workspace->total_bond_order[k]-BOA_jk) * e_coa;
+                /* END COALITION ENERGY */
+
+
+                /* FORCES */
+                bo_ij->Cdbo += (CEval1 + CEpen2 + (CEcoa1 - CEcoa4));
+                bo_jk->Cdbo += (CEval2 + CEpen3 + (CEcoa2 - CEcoa5));
+                workspace->CdDelta[j] += ((CEval3 + CEval7) + CEpen1 + CEcoa3);
+                workspace->CdDelta[i] += CEcoa4;
+                workspace->CdDelta[k] += CEcoa5;
+
+                for( t = start_j; t < end_j; ++t ) {
+                    pbond_jt = &( bonds->select.bond_list[t] );
+                    bo_jt = &(pbond_jt->bo_data);
+                    temp_bo_jt = bo_jt->BO;
+                    temp = CUBE( temp_bo_jt );
+                    pBOjt7 = temp * temp * temp_bo_jt;
+
+                    // fprintf( out_control->eval, "%6d%12.8f\n",
+                    // workspace->reverse_map[bonds->select.bond_list[t].nbr],
+                    // (CEval6 * pBOjt7) );
+
+                    bo_jt->Cdbo += (CEval6 * pBOjt7);
+                    bo_jt->Cdbopi += CEval5;
+                    bo_jt->Cdbopi2 += CEval5;
+                }
+
+                if( control->virial == 0 ) {
+                  rvec_ScaledAdd( workspace->f[i], CEval8, p_ijk->dcos_di );
+                  rvec_ScaledAdd( workspace->f[j], CEval8, p_ijk->dcos_dj );
+                  rvec_ScaledAdd( workspace->f[k], CEval8, p_ijk->dcos_dk );
+                }
+                else {
+                  /* terms not related to bond order derivatives are
+                     added directly into forces and pressure vector/tensor */
+                  rvec_Scale( force, CEval8, p_ijk->dcos_di );
+                  rvec_Add( workspace->f[i], force );
+                  rvec_iMultiply( ext_press, pbond_ij->rel_box, force );
+                  rvec_Add( data->my_ext_press, ext_press );
+
+                  rvec_ScaledAdd( workspace->f[j], CEval8, p_ijk->dcos_dj );
+
+                  rvec_Scale( force, CEval8, p_ijk->dcos_dk );
+                  rvec_Add( workspace->f[k], force );
+                  rvec_iMultiply( ext_press, pbond_jk->rel_box, force );
+                  rvec_Add( data->my_ext_press, ext_press );
+                }
+
+                /* tally into per-atom virials */
+                if( system->pair_ptr->vflag_atom || system->pair_ptr->evflag) {
+
+                  /* Acquire vectors */
+                  rvec_ScaledSum( delij, 1., system->my_atoms[i].x,
+                                        -1., system->my_atoms[j].x );
+                  rvec_ScaledSum( delkj, 1., system->my_atoms[k].x,
+                                        -1., system->my_atoms[j].x );
+
+                  rvec_Scale( fi_tmp, -CEval8, p_ijk->dcos_di );
+                  rvec_Scale( fj_tmp, -CEval8, p_ijk->dcos_dj );
+                  rvec_Scale( fk_tmp, -CEval8, p_ijk->dcos_dk );
+
+                  eng_tmp = e_ang + e_pen + e_coa;
+
+                  if( system->pair_ptr->evflag)
+                          system->pair_ptr->ev_tally(j,j,system->N,1,eng_tmp,0.0,0.0,0.0,0.0,0.0);
+                  if( system->pair_ptr->vflag_atom)
+                          system->pair_ptr->v_tally3(i,j,k,fi_tmp,fk_tmp,delij,delkj);
+                }
+
 #ifdef TEST_ENERGY
-		/*fprintf( out_control->eval, "%12.8f%12.8f%12.8f%12.8f\n",
-		  p_val3, p_val4, BOA_ij, BOA_jk );
-		fprintf(out_control->eval, "%13.8f%13.8f%13.8f%13.8f%13.8f\n",
-			workspace->Delta_e[j], workspace->vlpex[j],
-			dSBO1, dSBO2, vlpadj );
-		fprintf( out_control->eval, "%12.8f%12.8f%12.8f%12.8f\n",
-			 f7_ij, f7_jk, f8_Dj, expval12theta );
-		fprintf( out_control->eval, 
-			 "%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f\n",
-			 CEval1, CEval2, CEval3, CEval4, 
-			 CEval5, CEval6, CEval7, CEval8 );
-		
-		fprintf( out_control->eval, 
-		"%12.8f%12.8f%12.8f\n%12.8f%12.8f%12.8f\n%12.8f%12.8f%12.8f\n",
-		   p_ijk->dcos_di[0]/sin_theta, p_ijk->dcos_di[1]/sin_theta,
-		   p_ijk->dcos_di[2]/sin_theta, 
-		   p_ijk->dcos_dj[0]/sin_theta, p_ijk->dcos_dj[1]/sin_theta,
-		   p_ijk->dcos_dj[2]/sin_theta, 
-		   p_ijk->dcos_dk[0]/sin_theta, p_ijk->dcos_dk[1]/sin_theta,
-		   p_ijk->dcos_dk[2]/sin_theta);
-		
-		fprintf( out_control->eval, 
-			 "%6d%6d%6d%15.8f%15.8f\n",
-			 system->my_atoms[i].orig_id, 
-			 system->my_atoms[j].orig_id, 
-			 system->my_atoms[k].orig_id,
-			 RAD2DEG(theta), e_ang );*/
-
-		fprintf( out_control->eval, 
-		//"%6d%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n",
-			 "%6d%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f%12.4f\n",
-			 system->my_atoms[i].orig_id, 
-			 system->my_atoms[j].orig_id, 
-			 system->my_atoms[k].orig_id,
-			 RAD2DEG(theta), theta_0, BOA_ij, BOA_jk,
-			 e_ang, data->my_en.e_ang );
-		
-		fprintf( out_control->epen, 
-			 //"%6d%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e\n",
-			 "%6d%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f\n",
-			 system->my_atoms[i].orig_id,
-			 system->my_atoms[j].orig_id,
-			 system->my_atoms[k].orig_id,
-			 RAD2DEG(theta), BOA_ij, BOA_jk, e_pen, 
-			 data->my_en.e_pen );
-		
-		fprintf( out_control->ecoa, 
-			 //"%6d%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e\n",
-			 "%6d%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f\n",
-			 system->my_atoms[i].orig_id, 
-			 system->my_atoms[j].orig_id, 
-			 system->my_atoms[k].orig_id,
-			 RAD2DEG(theta), BOA_ij, BOA_jk, 
-			 e_coa, data->my_en.e_coa );
+                /*fprintf( out_control->eval, "%12.8f%12.8f%12.8f%12.8f\n",
+                  p_val3, p_val4, BOA_ij, BOA_jk );
+                fprintf(out_control->eval, "%13.8f%13.8f%13.8f%13.8f%13.8f\n",
+                        workspace->Delta_e[j], workspace->vlpex[j],
+                        dSBO1, dSBO2, vlpadj );
+                fprintf( out_control->eval, "%12.8f%12.8f%12.8f%12.8f\n",
+                         f7_ij, f7_jk, f8_Dj, expval12theta );
+                fprintf( out_control->eval,
+                         "%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f%12.8f\n",
+                         CEval1, CEval2, CEval3, CEval4,
+                         CEval5, CEval6, CEval7, CEval8 );
+
+                fprintf( out_control->eval,
+                "%12.8f%12.8f%12.8f\n%12.8f%12.8f%12.8f\n%12.8f%12.8f%12.8f\n",
+                   p_ijk->dcos_di[0]/sin_theta, p_ijk->dcos_di[1]/sin_theta,
+                   p_ijk->dcos_di[2]/sin_theta,
+                   p_ijk->dcos_dj[0]/sin_theta, p_ijk->dcos_dj[1]/sin_theta,
+                   p_ijk->dcos_dj[2]/sin_theta,
+                   p_ijk->dcos_dk[0]/sin_theta, p_ijk->dcos_dk[1]/sin_theta,
+                   p_ijk->dcos_dk[2]/sin_theta);
+
+                fprintf( out_control->eval,
+                         "%6d%6d%6d%15.8f%15.8f\n",
+                         system->my_atoms[i].orig_id,
+                         system->my_atoms[j].orig_id,
+                         system->my_atoms[k].orig_id,
+                         RAD2DEG(theta), e_ang );*/
+
+                fprintf( out_control->eval,
+                //"%6d%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e%24.15e\n",
+                         "%6d%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f%12.4f\n",
+                         system->my_atoms[i].orig_id,
+                         system->my_atoms[j].orig_id,
+                         system->my_atoms[k].orig_id,
+                         RAD2DEG(theta), theta_0, BOA_ij, BOA_jk,
+                         e_ang, data->my_en.e_ang );
+
+                fprintf( out_control->epen,
+                         //"%6d%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e\n",
+                         "%6d%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f\n",
+                         system->my_atoms[i].orig_id,
+                         system->my_atoms[j].orig_id,
+                         system->my_atoms[k].orig_id,
+                         RAD2DEG(theta), BOA_ij, BOA_jk, e_pen,
+                         data->my_en.e_pen );
+
+                fprintf( out_control->ecoa,
+                         //"%6d%6d%6d%24.15e%24.15e%24.15e%24.15e%24.15e\n",
+                         "%6d%6d%6d%12.4f%12.4f%12.4f%12.4f%12.4f\n",
+                         system->my_atoms[i].orig_id,
+                         system->my_atoms[j].orig_id,
+                         system->my_atoms[k].orig_id,
+                         RAD2DEG(theta), BOA_ij, BOA_jk,
+                         e_coa, data->my_en.e_coa );
 #endif
 
 #ifdef TEST_FORCES            /* angle forces */
-		Add_dBO( system, lists, j, pi, CEval1, workspace->f_ang );
-		Add_dBO( system, lists, j, pk, CEval2, workspace->f_ang );
-		Add_dDelta( system, lists, j, 
-			    CEval3 + CEval7, workspace->f_ang );
-		
-		for( t = start_j; t < end_j; ++t ) {
-		  pbond_jt = &( bonds->select.bond_list[t] );
-		  bo_jt = &(pbond_jt->bo_data);
-		  temp_bo_jt = bo_jt->BO;
-		  temp = CUBE( temp_bo_jt );
-		  pBOjt7 = temp * temp * temp_bo_jt; 
-		  
-		  Add_dBO( system, lists, j, t, pBOjt7 * CEval6, 
-			   workspace->f_ang );
-		  Add_dBOpinpi2( system, lists, j, t, CEval5, CEval5, 
-				 workspace->f_ang, workspace->f_ang );
-		}
-		
-		rvec_ScaledAdd( workspace->f_ang[i], CEval8, p_ijk->dcos_di );
-		rvec_ScaledAdd( workspace->f_ang[j], CEval8, p_ijk->dcos_dj );
-		rvec_ScaledAdd( workspace->f_ang[k], CEval8, p_ijk->dcos_dk );
-		/* end angle forces */
-		
-		/* penalty forces */
-		Add_dDelta( system, lists, j, CEpen1, workspace->f_pen );
-		Add_dBO( system, lists, j, pi, CEpen2, workspace->f_pen );
-		Add_dBO( system, lists, j, pk, CEpen3, workspace->f_pen );
-		/* end penalty forces */
-		
-		/* coalition forces */
-		Add_dBO( system, lists, j, pi, CEcoa1 - CEcoa4, 
-			 workspace->f_coa );
-		Add_dBO( system, lists, j, pk, CEcoa2 - CEcoa5, 
-			 workspace->f_coa );
-		Add_dDelta( system, lists, j, CEcoa3, workspace->f_coa );
-		Add_dDelta( system, lists, i, CEcoa4, workspace->f_coa );
-		Add_dDelta( system, lists, k, CEcoa5, workspace->f_coa );
-		/* end coalition forces */
+                Add_dBO( system, lists, j, pi, CEval1, workspace->f_ang );
+                Add_dBO( system, lists, j, pk, CEval2, workspace->f_ang );
+                Add_dDelta( system, lists, j,
+                            CEval3 + CEval7, workspace->f_ang );
+
+                for( t = start_j; t < end_j; ++t ) {
+                  pbond_jt = &( bonds->select.bond_list[t] );
+                  bo_jt = &(pbond_jt->bo_data);
+                  temp_bo_jt = bo_jt->BO;
+                  temp = CUBE( temp_bo_jt );
+                  pBOjt7 = temp * temp * temp_bo_jt;
+
+                  Add_dBO( system, lists, j, t, pBOjt7 * CEval6,
+                           workspace->f_ang );
+                  Add_dBOpinpi2( system, lists, j, t, CEval5, CEval5,
+                                 workspace->f_ang, workspace->f_ang );
+                }
+
+                rvec_ScaledAdd( workspace->f_ang[i], CEval8, p_ijk->dcos_di );
+                rvec_ScaledAdd( workspace->f_ang[j], CEval8, p_ijk->dcos_dj );
+                rvec_ScaledAdd( workspace->f_ang[k], CEval8, p_ijk->dcos_dk );
+                /* end angle forces */
+
+                /* penalty forces */
+                Add_dDelta( system, lists, j, CEpen1, workspace->f_pen );
+                Add_dBO( system, lists, j, pi, CEpen2, workspace->f_pen );
+                Add_dBO( system, lists, j, pk, CEpen3, workspace->f_pen );
+                /* end penalty forces */
+
+                /* coalition forces */
+                Add_dBO( system, lists, j, pi, CEcoa1 - CEcoa4,
+                         workspace->f_coa );
+                Add_dBO( system, lists, j, pk, CEcoa2 - CEcoa5,
+                         workspace->f_coa );
+                Add_dDelta( system, lists, j, CEcoa3, workspace->f_coa );
+                Add_dDelta( system, lists, i, CEcoa4, workspace->f_coa );
+                Add_dDelta( system, lists, k, CEcoa5, workspace->f_coa );
+                /* end coalition forces */
 #endif
-	      }
-	    }
-	  }
-	}
+              }
+            }
+          }
+        }
       }
-      
+
       Set_End_Index(pi, num_thb_intrs, thb_intrs );
     }
   }
@@ -547,20 +547,20 @@ void Valence_Angles( reax_system *system, control_params *control,
     workspace->realloc.num_3body = num_thb_intrs;
     if( num_thb_intrs > thb_intrs->num_intrs ) {
       fprintf( stderr, "step%d-ran out of space on angle_list: top=%d, max=%d",
-	       data->step, num_thb_intrs, thb_intrs->num_intrs );
+               data->step, num_thb_intrs, thb_intrs->num_intrs );
       MPI_Abort( MPI_COMM_WORLD, INSUFFICIENT_MEMORY );
     }
   }
-  //fprintf( stderr,"%d: Number of angle interactions: %d\n", 
-  // data->step, num_thb_intrs );  
-  
+  //fprintf( stderr,"%d: Number of angle interactions: %d\n",
+  // data->step, num_thb_intrs );
+
 #if defined(DEBUG)
   fprintf( stderr, "Number of angle interactions: %d\n", num_thb_intrs );
-  fprintf( stderr, 
-	   "Angle Energy: %g\t Penalty Energy: %g\t Coalition Energy: %g\t\n",
-	   data->my_en.e_ang, data->my_en.e_pen, data->my_en.e_coa );
-  
-  fprintf( stderr, "3body: ext_press (%12.6f %12.6f %12.6f)\n", 
-	   data->ext_press[0], data->ext_press[1], data->ext_press[2] );
+  fprintf( stderr,
+           "Angle Energy: %g\t Penalty Energy: %g\t Coalition Energy: %g\t\n",
+           data->my_en.e_ang, data->my_en.e_pen, data->my_en.e_coa );
+
+  fprintf( stderr, "3body: ext_press (%12.6f %12.6f %12.6f)\n",
+           data->ext_press[0], data->ext_press[1], data->ext_press[2] );
 #endif
 }
diff --git a/src/USER-REAXC/reaxc_valence_angles.h b/src/USER-REAXC/reaxc_valence_angles.h
index 21cb5ec451..d7b79d7fc7 100644
--- a/src/USER-REAXC/reaxc_valence_angles.h
+++ b/src/USER-REAXC/reaxc_valence_angles.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -30,10 +30,10 @@
 #include "reaxc_types.h"
 
 void Valence_Angles( reax_system*, control_params*, simulation_data*,
-		     storage*, reax_list**, output_controls* );
+                     storage*, reax_list**, output_controls* );
 
 void Calculate_Theta( rvec, real, rvec, real, real*, real* );
-		      
+
 void Calculate_dCos_Theta( rvec, real, rvec, real, rvec*, rvec*, rvec* );
-			   
+
 #endif
diff --git a/src/USER-REAXC/reaxc_vector.cpp b/src/USER-REAXC/reaxc_vector.cpp
index df4a546d8d..1008eabe34 100644
--- a/src/USER-REAXC/reaxc_vector.cpp
+++ b/src/USER-REAXC/reaxc_vector.cpp
@@ -1,6 +1,6 @@
 /*----------------------------------------------------------------------
   PuReMD - Purdue ReaxFF Molecular Dynamics Program
-  
+
   Copyright (2010) Purdue University
   Hasan Metin Aktulga, hmaktulga@lbl.gov
   Joseph Fogarty, jcfogart@mail.usf.edu
@@ -9,17 +9,17 @@
 
   Please cite the related publication:
   H. M. Aktulga, J. C. Fogarty, S. A. Pandit, A. Y. Grama,
-  "Parallel Reactive Molecular Dynamics: Numerical Methods and 
+  "Parallel Reactive Molecular Dynamics: Numerical Methods and
   Algorithmic Techniques", Parallel Computing, in press.
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
@@ -37,7 +37,7 @@ int Vector_isZero( real* v, int k )
   for( --k; k>=0; --k )
     if( fabs( v[k] ) > ALMOST_ZERO )
       return 0;
-  
+
   return 1;
 }
 
@@ -80,7 +80,7 @@ void Vector_Add( real* dest, real c, real* v, int k )
 real Dot( real* v1, real* v2, int k )
 {
   real ret = 0;
-  
+
   for( --k; k>=0; --k )
     ret +=  v1[k] * v2[k];
 
@@ -91,7 +91,7 @@ real Dot( real* v1, real* v2, int k )
 real Norm( real* v1, int k )
 {
   real ret = 0;
-  
+
   for( --k; k>=0; --k )
     ret +=  SQR( v1[k] );
 
@@ -143,7 +143,7 @@ void rvec_Sum( rvec ret, rvec v1 ,rvec v2 )
 
 void rvec_ScaledSum( rvec ret, real c1, rvec v1 ,real c2, rvec v2 )
 {
-  ret[0] = c1 * v1[0] + c2 * v2[0]; 
+  ret[0] = c1 * v1[0] + c2 * v2[0];
   ret[1] = c1 * v1[1] + c2 * v2[1];
   ret[2] = c1 * v1[2] + c2 * v2[2];
 }
@@ -233,8 +233,8 @@ real rvec_Norm( rvec v )
 
 int rvec_isZero( rvec v )
 {
-  if( fabs(v[0]) > ALMOST_ZERO || 
-      fabs(v[1]) > ALMOST_ZERO || 
+  if( fabs(v[0]) > ALMOST_ZERO ||
+      fabs(v[1]) > ALMOST_ZERO ||
       fabs(v[2]) > ALMOST_ZERO )
     return 0;
   return 1;
@@ -264,31 +264,31 @@ void rtensor_Multiply( rtensor ret, rtensor m1, rtensor m2 )
   rtensor temp;
 
   // check if the result matrix is the same as one of m1, m2.
-  // if so, we cannot modify the contents of m1 or m2, so 
+  // if so, we cannot modify the contents of m1 or m2, so
   // we have to use a temp matrix.
   if( ret == m1 || ret == m2 )
     {
       for( i = 0; i < 3; ++i )
-	for( j = 0; j < 3; ++j )
-	  {
-	    temp[i][j] = 0;	    
-	    for( k = 0; k < 3; ++k )
-	      temp[i][j] += m1[i][k] * m2[k][j];
-	  }
-      
+        for( j = 0; j < 3; ++j )
+          {
+            temp[i][j] = 0;
+            for( k = 0; k < 3; ++k )
+              temp[i][j] += m1[i][k] * m2[k][j];
+          }
+
       for( i = 0; i < 3; ++i )
-	for( j = 0; j < 3; ++j )
-	  ret[i][j] = temp[i][j];	
+        for( j = 0; j < 3; ++j )
+          ret[i][j] = temp[i][j];
     }
   else
     {
       for( i = 0; i < 3; ++i )
-	for( j = 0; j < 3; ++j )
-	  {
-	    ret[i][j] = 0;	    
-	    for( k = 0; k < 3; ++k )
-	      ret[i][j] += m1[i][k] * m2[k][j];
-	  }
+        for( j = 0; j < 3; ++j )
+          {
+            ret[i][j] = 0;
+            for( k = 0; k < 3; ++k )
+              ret[i][j] += m1[i][k] * m2[k][j];
+          }
     }
 }
 
@@ -298,20 +298,20 @@ void rtensor_MatVec( rvec ret, rtensor m, rvec v )
   int i;
   rvec temp;
 
-  // if ret is the same vector as v, we cannot modify the 
+  // if ret is the same vector as v, we cannot modify the
   // contents of v until all computation is finished.
   if( ret == v )
     {
       for( i = 0; i < 3; ++i )
-	temp[i] = m[i][0] * v[0] + m[i][1] * v[1] + m[i][2] * v[2];
+        temp[i] = m[i][0] * v[0] + m[i][1] * v[1] + m[i][2] * v[2];
 
       for( i = 0; i < 3; ++i )
-	ret[i] = temp[i];
+        ret[i] = temp[i];
     }
   else
     {
       for( i = 0; i < 3; ++i )
-	ret[i] = m[i][0] * v[0] + m[i][1] * v[1] + m[i][2] * v[2];
+        ret[i] = m[i][0] * v[0] + m[i][1] * v[1] + m[i][2] * v[2];
     }
 }
 
@@ -356,8 +356,8 @@ void rtensor_Sum( rtensor ret, rtensor t1, rtensor t2 )
 }
 
 
-void rtensor_ScaledSum( rtensor ret, real c1, rtensor t1, 
-			       real c2, rtensor t2 )
+void rtensor_ScaledSum( rtensor ret, real c1, rtensor t1,
+                               real c2, rtensor t2 )
 {
   int i, j;
 
@@ -423,7 +423,7 @@ void Print_rTensor(FILE* fp, rtensor t)
     {
       fprintf(fp,"[");
       for (j=0; j < 3; j++)
-	fprintf(fp,"%8.3f,\t",t[i][j]);
+        fprintf(fp,"%8.3f,\t",t[i][j]);
       fprintf(fp,"]\n");
     }
 }
@@ -520,4 +520,3 @@ void ivec_Max3( ivec res, ivec v1, ivec v2, ivec v3 )
   res[1] = MAX3( v1[1], v2[1], v3[1] );
   res[2] = MAX3( v1[2], v2[2], v3[2] );
 }
-
diff --git a/src/USER-REAXC/reaxc_vector.h b/src/USER-REAXC/reaxc_vector.h
index 2d43cc057c..a33e249bcd 100644
--- a/src/USER-REAXC/reaxc_vector.h
+++ b/src/USER-REAXC/reaxc_vector.h
@@ -14,12 +14,12 @@
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
-  published by the Free Software Foundation; either version 2 of 
+  published by the Free Software Foundation; either version 2 of
   the License, or (at your option) any later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details:
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------*/
diff --git a/src/USER-SPH/atom_vec_meso.cpp b/src/USER-SPH/atom_vec_meso.cpp
index 792355007b..4bf403daec 100644
--- a/src/USER-SPH/atom_vec_meso.cpp
+++ b/src/USER-SPH/atom_vec_meso.cpp
@@ -28,24 +28,24 @@ using namespace LAMMPS_NS;
 /* ---------------------------------------------------------------------- */
 
 AtomVecMeso::AtomVecMeso(LAMMPS *lmp, int narg, char **arg) :
-	AtomVec(lmp, narg, arg) {
-	molecular = 0;
-	mass_type = 1;
-
-	comm_x_only = 0; // we communicate not only x forward but also vest ...
-	comm_f_only = 0; // we also communicate de and drho in reverse direction
-	size_forward = 8; // 3 + rho + e + vest[3], that means we may only communicate 5 in hybrid
-	size_reverse = 5; // 3 + drho + de
-	size_border = 12; // 6 + rho + e + vest[3] + cv
-	size_velocity = 3;
-	size_data_atom = 8;
-	size_data_vel = 4;
-	xcol_data = 6;
-
-	atom->e_flag = 1;
-	atom->rho_flag = 1;
-	atom->cv_flag = 1;
-	atom->vest_flag = 1;
+        AtomVec(lmp, narg, arg) {
+        molecular = 0;
+        mass_type = 1;
+
+        comm_x_only = 0; // we communicate not only x forward but also vest ...
+        comm_f_only = 0; // we also communicate de and drho in reverse direction
+        size_forward = 8; // 3 + rho + e + vest[3], that means we may only communicate 5 in hybrid
+        size_reverse = 5; // 3 + drho + de
+        size_border = 12; // 6 + rho + e + vest[3] + cv
+        size_velocity = 3;
+        size_data_atom = 8;
+        size_data_vel = 4;
+        xcol_data = 6;
+
+        atom->e_flag = 1;
+        atom->rho_flag = 1;
+        atom->cv_flag = 1;
+        atom->vest_flag = 1;
 }
 
 /* ----------------------------------------------------------------------
@@ -55,32 +55,32 @@ AtomVecMeso::AtomVecMeso(LAMMPS *lmp, int narg, char **arg) :
  ------------------------------------------------------------------------- */
 
 void AtomVecMeso::grow(int n) {
-	if (n == 0)
-		nmax += DELTA;
-	else
-		nmax = n;
-	atom->nmax = nmax;
-	if (nmax < 0 || nmax > MAXSMALLINT)
-		error->one(FLERR,"Per-processor system is too big");
-
-	tag = memory->grow(atom->tag, nmax, "atom:tag");
-	type = memory->grow(atom->type, nmax, "atom:type");
-	mask = memory->grow(atom->mask, nmax, "atom:mask");
-	image = memory->grow(atom->image, nmax, "atom:image");
-	x = memory->grow(atom->x, nmax, 3, "atom:x");
-	v = memory->grow(atom->v, nmax, 3, "atom:v");
-	f = memory->grow(atom->f, nmax*comm->nthreads, 3, "atom:f");
-
-	rho = memory->grow(atom->rho, nmax, "atom:rho");
-	drho = memory->grow(atom->drho, nmax*comm->nthreads, "atom:drho");
-	e = memory->grow(atom->e, nmax, "atom:e");
-	de = memory->grow(atom->de, nmax*comm->nthreads, "atom:de");
-	vest = memory->grow(atom->vest, nmax, 3, "atom:vest");
-	cv = memory->grow(atom->cv, nmax, "atom:cv");
-
-	if (atom->nextra_grow)
-		for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
-			modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
+        if (n == 0)
+                nmax += DELTA;
+        else
+                nmax = n;
+        atom->nmax = nmax;
+        if (nmax < 0 || nmax > MAXSMALLINT)
+                error->one(FLERR,"Per-processor system is too big");
+
+        tag = memory->grow(atom->tag, nmax, "atom:tag");
+        type = memory->grow(atom->type, nmax, "atom:type");
+        mask = memory->grow(atom->mask, nmax, "atom:mask");
+        image = memory->grow(atom->image, nmax, "atom:image");
+        x = memory->grow(atom->x, nmax, 3, "atom:x");
+        v = memory->grow(atom->v, nmax, 3, "atom:v");
+        f = memory->grow(atom->f, nmax*comm->nthreads, 3, "atom:f");
+
+        rho = memory->grow(atom->rho, nmax, "atom:rho");
+        drho = memory->grow(atom->drho, nmax*comm->nthreads, "atom:drho");
+        e = memory->grow(atom->e, nmax, "atom:e");
+        de = memory->grow(atom->de, nmax*comm->nthreads, "atom:de");
+        vest = memory->grow(atom->vest, nmax, 3, "atom:vest");
+        cv = memory->grow(atom->cv, nmax, "atom:cv");
+
+        if (atom->nextra_grow)
+                for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
+                        modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
 }
 
 /* ----------------------------------------------------------------------
@@ -88,495 +88,495 @@ void AtomVecMeso::grow(int n) {
  ------------------------------------------------------------------------- */
 
 void AtomVecMeso::grow_reset() {
-	tag = atom->tag;
-	type = atom->type;
-	mask = atom->mask;
-	image = atom->image;
-	x = atom->x;
-	v = atom->v;
-	f = atom->f;
-	rho = atom->rho;
-	drho = atom->drho;
-	e = atom->e;
-	de = atom->de;
-	vest = atom->vest;
-	cv = atom->cv;
+        tag = atom->tag;
+        type = atom->type;
+        mask = atom->mask;
+        image = atom->image;
+        x = atom->x;
+        v = atom->v;
+        f = atom->f;
+        rho = atom->rho;
+        drho = atom->drho;
+        e = atom->e;
+        de = atom->de;
+        vest = atom->vest;
+        cv = atom->cv;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void AtomVecMeso::copy(int i, int j, int delflag) {
-	//printf("in AtomVecMeso::copy\n");
-	tag[j] = tag[i];
-	type[j] = type[i];
-	mask[j] = mask[i];
-	image[j] = image[i];
-	x[j][0] = x[i][0];
-	x[j][1] = x[i][1];
-	x[j][2] = x[i][2];
-	v[j][0] = v[i][0];
-	v[j][1] = v[i][1];
-	v[j][2] = v[i][2];
-
-	rho[j] = rho[i];
-	drho[j] = drho[i];
-	e[j] = e[i];
-	de[j] = de[i];
-	cv[j] = cv[i];
-	vest[j][0] = vest[i][0];
-	vest[j][1] = vest[i][1];
-	vest[j][2] = vest[i][2];
-
-	if (atom->nextra_grow)
-		for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
-			modify->fix[atom->extra_grow[iextra]]->copy_arrays(i, j);
+        //printf("in AtomVecMeso::copy\n");
+        tag[j] = tag[i];
+        type[j] = type[i];
+        mask[j] = mask[i];
+        image[j] = image[i];
+        x[j][0] = x[i][0];
+        x[j][1] = x[i][1];
+        x[j][2] = x[i][2];
+        v[j][0] = v[i][0];
+        v[j][1] = v[i][1];
+        v[j][2] = v[i][2];
+
+        rho[j] = rho[i];
+        drho[j] = drho[i];
+        e[j] = e[i];
+        de[j] = de[i];
+        cv[j] = cv[i];
+        vest[j][0] = vest[i][0];
+        vest[j][1] = vest[i][1];
+        vest[j][2] = vest[i][2];
+
+        if (atom->nextra_grow)
+                for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
+                        modify->fix[atom->extra_grow[iextra]]->copy_arrays(i, j);
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::pack_comm_hybrid(int n, int *list, double *buf) {
-	//printf("in AtomVecMeso::pack_comm_hybrid\n");
-	int i, j, m;
-
-	m = 0;
-	for (i = 0; i < n; i++) {
-		j = list[i];
-		buf[m++] = rho[j];
-		buf[m++] = e[j];
-		buf[m++] = vest[j][0];
-		buf[m++] = vest[j][1];
-		buf[m++] = vest[j][2];
-	}
-	return m;
+        //printf("in AtomVecMeso::pack_comm_hybrid\n");
+        int i, j, m;
+
+        m = 0;
+        for (i = 0; i < n; i++) {
+                j = list[i];
+                buf[m++] = rho[j];
+                buf[m++] = e[j];
+                buf[m++] = vest[j][0];
+                buf[m++] = vest[j][1];
+                buf[m++] = vest[j][2];
+        }
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::unpack_comm_hybrid(int n, int first, double *buf) {
-	//printf("in AtomVecMeso::unpack_comm_hybrid\n");
-	int i, m, last;
-
-	m = 0;
-	last = first + n;
-	for (i = first; i < last; i++) {
-		rho[i] = buf[m++];
-		e[i] = buf[m++];
-		vest[i][0] = buf[m++];
-		vest[i][1] = buf[m++];
-		vest[i][2] = buf[m++];
-	}
-	return m;
+        //printf("in AtomVecMeso::unpack_comm_hybrid\n");
+        int i, m, last;
+
+        m = 0;
+        last = first + n;
+        for (i = first; i < last; i++) {
+                rho[i] = buf[m++];
+                e[i] = buf[m++];
+                vest[i][0] = buf[m++];
+                vest[i][1] = buf[m++];
+                vest[i][2] = buf[m++];
+        }
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::pack_border_hybrid(int n, int *list, double *buf) {
-	//printf("in AtomVecMeso::pack_border_hybrid\n");
-	int i, j, m;
-
-	m = 0;
-	for (i = 0; i < n; i++) {
-		j = list[i];
-		buf[m++] = rho[j];
-		buf[m++] = e[j];
-		buf[m++] = vest[j][0];
-		buf[m++] = vest[j][1];
-		buf[m++] = vest[j][2];
-	}
-	return m;
+        //printf("in AtomVecMeso::pack_border_hybrid\n");
+        int i, j, m;
+
+        m = 0;
+        for (i = 0; i < n; i++) {
+                j = list[i];
+                buf[m++] = rho[j];
+                buf[m++] = e[j];
+                buf[m++] = vest[j][0];
+                buf[m++] = vest[j][1];
+                buf[m++] = vest[j][2];
+        }
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::unpack_border_hybrid(int n, int first, double *buf) {
-	//printf("in AtomVecMeso::unpack_border_hybrid\n");
-	int i, m, last;
-
-	m = 0;
-	last = first + n;
-	for (i = first; i < last; i++) {
-		rho[i] = buf[m++];
-		e[i] = buf[m++];
-		vest[i][0] = buf[m++];
-		vest[i][1] = buf[m++];
-		vest[i][2] = buf[m++];
-	}
-	return m;
+        //printf("in AtomVecMeso::unpack_border_hybrid\n");
+        int i, m, last;
+
+        m = 0;
+        last = first + n;
+        for (i = first; i < last; i++) {
+                rho[i] = buf[m++];
+                e[i] = buf[m++];
+                vest[i][0] = buf[m++];
+                vest[i][1] = buf[m++];
+                vest[i][2] = buf[m++];
+        }
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::pack_reverse_hybrid(int n, int first, double *buf) {
-	//printf("in AtomVecMeso::pack_reverse_hybrid\n");
-	int i, m, last;
-
-	m = 0;
-	last = first + n;
-	for (i = first; i < last; i++) {
-		buf[m++] = drho[i];
-		buf[m++] = de[i];
-	}
-	return m;
+        //printf("in AtomVecMeso::pack_reverse_hybrid\n");
+        int i, m, last;
+
+        m = 0;
+        last = first + n;
+        for (i = first; i < last; i++) {
+                buf[m++] = drho[i];
+                buf[m++] = de[i];
+        }
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::unpack_reverse_hybrid(int n, int *list, double *buf) {
-	//printf("in AtomVecMeso::unpack_reverse_hybrid\n");
-	int i, j, m;
-
-	m = 0;
-	for (i = 0; i < n; i++) {
-		j = list[i];
-		drho[j] += buf[m++];
-		de[j] += buf[m++];
-	}
-	return m;
+        //printf("in AtomVecMeso::unpack_reverse_hybrid\n");
+        int i, j, m;
+
+        m = 0;
+        for (i = 0; i < n; i++) {
+                j = list[i];
+                drho[j] += buf[m++];
+                de[j] += buf[m++];
+        }
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::pack_comm(int n, int *list, double *buf, int pbc_flag,
-		int *pbc) {
-	//printf("in AtomVecMeso::pack_comm\n");
-	int i, j, m;
-	double dx, dy, dz;
-
-	m = 0;
-	if (pbc_flag == 0) {
-		for (i = 0; i < n; i++) {
-			j = list[i];
-			buf[m++] = x[j][0];
-			buf[m++] = x[j][1];
-			buf[m++] = x[j][2];
-			buf[m++] = rho[j];
-			buf[m++] = e[j];
-			buf[m++] = vest[j][0];
-			buf[m++] = vest[j][1];
-			buf[m++] = vest[j][2];
-		}
-	} else {
-		if (domain->triclinic == 0) {
-			dx = pbc[0] * domain->xprd;
-			dy = pbc[1] * domain->yprd;
-			dz = pbc[2] * domain->zprd;
-		} else {
-			dx = pbc[0] * domain->xprd + pbc[5] * domain->xy + pbc[4] * domain->xz;
-			dy = pbc[1] * domain->yprd + pbc[3] * domain->yz;
-			dz = pbc[2] * domain->zprd;
-		}
-		for (i = 0; i < n; i++) {
-			j = list[i];
-			buf[m++] = x[j][0] + dx;
-			buf[m++] = x[j][1] + dy;
-			buf[m++] = x[j][2] + dz;
-			buf[m++] = rho[j];
-			buf[m++] = e[j];
-			buf[m++] = vest[j][0];
-			buf[m++] = vest[j][1];
-			buf[m++] = vest[j][2];
-		}
-	}
-	return m;
+                int *pbc) {
+        //printf("in AtomVecMeso::pack_comm\n");
+        int i, j, m;
+        double dx, dy, dz;
+
+        m = 0;
+        if (pbc_flag == 0) {
+                for (i = 0; i < n; i++) {
+                        j = list[i];
+                        buf[m++] = x[j][0];
+                        buf[m++] = x[j][1];
+                        buf[m++] = x[j][2];
+                        buf[m++] = rho[j];
+                        buf[m++] = e[j];
+                        buf[m++] = vest[j][0];
+                        buf[m++] = vest[j][1];
+                        buf[m++] = vest[j][2];
+                }
+        } else {
+                if (domain->triclinic == 0) {
+                        dx = pbc[0] * domain->xprd;
+                        dy = pbc[1] * domain->yprd;
+                        dz = pbc[2] * domain->zprd;
+                } else {
+                        dx = pbc[0] * domain->xprd + pbc[5] * domain->xy + pbc[4] * domain->xz;
+                        dy = pbc[1] * domain->yprd + pbc[3] * domain->yz;
+                        dz = pbc[2] * domain->zprd;
+                }
+                for (i = 0; i < n; i++) {
+                        j = list[i];
+                        buf[m++] = x[j][0] + dx;
+                        buf[m++] = x[j][1] + dy;
+                        buf[m++] = x[j][2] + dz;
+                        buf[m++] = rho[j];
+                        buf[m++] = e[j];
+                        buf[m++] = vest[j][0];
+                        buf[m++] = vest[j][1];
+                        buf[m++] = vest[j][2];
+                }
+        }
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::pack_comm_vel(int n, int *list, double *buf, int pbc_flag,
-		int *pbc) {
-	//printf("in AtomVecMeso::pack_comm_vel\n");
-	int i, j, m;
-	double dx, dy, dz;
-
-	m = 0;
-	if (pbc_flag == 0) {
-		for (i = 0; i < n; i++) {
-			j = list[i];
-			buf[m++] = x[j][0];
-			buf[m++] = x[j][1];
-			buf[m++] = x[j][2];
-			buf[m++] = v[j][0];
-			buf[m++] = v[j][1];
-			buf[m++] = v[j][2];
-			buf[m++] = rho[j];
-			buf[m++] = e[j];
-			buf[m++] = vest[j][0];
-			buf[m++] = vest[j][1];
-			buf[m++] = vest[j][2];
-		}
-	} else {
-		if (domain->triclinic == 0) {
-			dx = pbc[0] * domain->xprd;
-			dy = pbc[1] * domain->yprd;
-			dz = pbc[2] * domain->zprd;
-		} else {
-			dx = pbc[0] * domain->xprd + pbc[5] * domain->xy + pbc[4] * domain->xz;
-			dy = pbc[1] * domain->yprd + pbc[3] * domain->yz;
-			dz = pbc[2] * domain->zprd;
-		}
-		for (i = 0; i < n; i++) {
-			j = list[i];
-			buf[m++] = x[j][0] + dx;
-			buf[m++] = x[j][1] + dy;
-			buf[m++] = x[j][2] + dz;
-			buf[m++] = v[j][0];
-			buf[m++] = v[j][1];
-			buf[m++] = v[j][2];
-			buf[m++] = rho[j];
-			buf[m++] = e[j];
-			buf[m++] = vest[j][0];
-			buf[m++] = vest[j][1];
-			buf[m++] = vest[j][2];
-		}
-	}
-	return m;
+                int *pbc) {
+        //printf("in AtomVecMeso::pack_comm_vel\n");
+        int i, j, m;
+        double dx, dy, dz;
+
+        m = 0;
+        if (pbc_flag == 0) {
+                for (i = 0; i < n; i++) {
+                        j = list[i];
+                        buf[m++] = x[j][0];
+                        buf[m++] = x[j][1];
+                        buf[m++] = x[j][2];
+                        buf[m++] = v[j][0];
+                        buf[m++] = v[j][1];
+                        buf[m++] = v[j][2];
+                        buf[m++] = rho[j];
+                        buf[m++] = e[j];
+                        buf[m++] = vest[j][0];
+                        buf[m++] = vest[j][1];
+                        buf[m++] = vest[j][2];
+                }
+        } else {
+                if (domain->triclinic == 0) {
+                        dx = pbc[0] * domain->xprd;
+                        dy = pbc[1] * domain->yprd;
+                        dz = pbc[2] * domain->zprd;
+                } else {
+                        dx = pbc[0] * domain->xprd + pbc[5] * domain->xy + pbc[4] * domain->xz;
+                        dy = pbc[1] * domain->yprd + pbc[3] * domain->yz;
+                        dz = pbc[2] * domain->zprd;
+                }
+                for (i = 0; i < n; i++) {
+                        j = list[i];
+                        buf[m++] = x[j][0] + dx;
+                        buf[m++] = x[j][1] + dy;
+                        buf[m++] = x[j][2] + dz;
+                        buf[m++] = v[j][0];
+                        buf[m++] = v[j][1];
+                        buf[m++] = v[j][2];
+                        buf[m++] = rho[j];
+                        buf[m++] = e[j];
+                        buf[m++] = vest[j][0];
+                        buf[m++] = vest[j][1];
+                        buf[m++] = vest[j][2];
+                }
+        }
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void AtomVecMeso::unpack_comm(int n, int first, double *buf) {
-	//printf("in AtomVecMeso::unpack_comm\n");
-	int i, m, last;
-
-	m = 0;
-	last = first + n;
-	for (i = first; i < last; i++) {
-		x[i][0] = buf[m++];
-		x[i][1] = buf[m++];
-		x[i][2] = buf[m++];
-		rho[i] = buf[m++];
-		e[i] = buf[m++];
-		vest[i][0] = buf[m++];
-		vest[i][1] = buf[m++];
-		vest[i][2] = buf[m++];
-	}
+        //printf("in AtomVecMeso::unpack_comm\n");
+        int i, m, last;
+
+        m = 0;
+        last = first + n;
+        for (i = first; i < last; i++) {
+                x[i][0] = buf[m++];
+                x[i][1] = buf[m++];
+                x[i][2] = buf[m++];
+                rho[i] = buf[m++];
+                e[i] = buf[m++];
+                vest[i][0] = buf[m++];
+                vest[i][1] = buf[m++];
+                vest[i][2] = buf[m++];
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void AtomVecMeso::unpack_comm_vel(int n, int first, double *buf) {
-	//printf("in AtomVecMeso::unpack_comm_vel\n");
-	int i, m, last;
-
-	m = 0;
-	last = first + n;
-	for (i = first; i < last; i++) {
-		x[i][0] = buf[m++];
-		x[i][1] = buf[m++];
-		x[i][2] = buf[m++];
-		v[i][0] = buf[m++];
-		v[i][1] = buf[m++];
-		v[i][2] = buf[m++];
-		rho[i] = buf[m++];
-		e[i] = buf[m++];
-		vest[i][0] = buf[m++];
-		vest[i][1] = buf[m++];
-		vest[i][2] = buf[m++];
-	}
+        //printf("in AtomVecMeso::unpack_comm_vel\n");
+        int i, m, last;
+
+        m = 0;
+        last = first + n;
+        for (i = first; i < last; i++) {
+                x[i][0] = buf[m++];
+                x[i][1] = buf[m++];
+                x[i][2] = buf[m++];
+                v[i][0] = buf[m++];
+                v[i][1] = buf[m++];
+                v[i][2] = buf[m++];
+                rho[i] = buf[m++];
+                e[i] = buf[m++];
+                vest[i][0] = buf[m++];
+                vest[i][1] = buf[m++];
+                vest[i][2] = buf[m++];
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::pack_reverse(int n, int first, double *buf) {
-	//printf("in AtomVecMeso::pack_reverse\n");
-	int i, m, last;
-
-	m = 0;
-	last = first + n;
-	for (i = first; i < last; i++) {
-		buf[m++] = f[i][0];
-		buf[m++] = f[i][1];
-		buf[m++] = f[i][2];
-		buf[m++] = drho[i];
-		buf[m++] = de[i];
-	}
-	return m;
+        //printf("in AtomVecMeso::pack_reverse\n");
+        int i, m, last;
+
+        m = 0;
+        last = first + n;
+        for (i = first; i < last; i++) {
+                buf[m++] = f[i][0];
+                buf[m++] = f[i][1];
+                buf[m++] = f[i][2];
+                buf[m++] = drho[i];
+                buf[m++] = de[i];
+        }
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void AtomVecMeso::unpack_reverse(int n, int *list, double *buf) {
-	//printf("in AtomVecMeso::unpack_reverse\n");
-	int i, j, m;
-
-	m = 0;
-	for (i = 0; i < n; i++) {
-		j = list[i];
-		f[j][0] += buf[m++];
-		f[j][1] += buf[m++];
-		f[j][2] += buf[m++];
-		drho[j] += buf[m++];
-		de[j] += buf[m++];
-	}
+        //printf("in AtomVecMeso::unpack_reverse\n");
+        int i, j, m;
+
+        m = 0;
+        for (i = 0; i < n; i++) {
+                j = list[i];
+                f[j][0] += buf[m++];
+                f[j][1] += buf[m++];
+                f[j][2] += buf[m++];
+                drho[j] += buf[m++];
+                de[j] += buf[m++];
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::pack_border(int n, int *list, double *buf, int pbc_flag,
-		int *pbc) {
-	//printf("in AtomVecMeso::pack_border\n");
-	int i, j, m;
-	double dx, dy, dz;
-
-	m = 0;
-	if (pbc_flag == 0) {
-		for (i = 0; i < n; i++) {
-			j = list[i];
-			buf[m++] = x[j][0];
-			buf[m++] = x[j][1];
-			buf[m++] = x[j][2];
-			buf[m++] = tag[j];
-			buf[m++] = type[j];
-			buf[m++] = mask[j];
-			buf[m++] = rho[j];
-			buf[m++] = e[j];
-			buf[m++] = cv[j];
-			buf[m++] = vest[j][0];
-			buf[m++] = vest[j][1];
-			buf[m++] = vest[j][2];
-		}
-	} else {
-		if (domain->triclinic == 0) {
-			dx = pbc[0] * domain->xprd;
-			dy = pbc[1] * domain->yprd;
-			dz = pbc[2] * domain->zprd;
-		} else {
-			dx = pbc[0];
-			dy = pbc[1];
-			dz = pbc[2];
-		}
-		for (i = 0; i < n; i++) {
-			j = list[i];
-			buf[m++] = x[j][0] + dx;
-			buf[m++] = x[j][1] + dy;
-			buf[m++] = x[j][2] + dz;
-			buf[m++] = tag[j];
-			buf[m++] = type[j];
-			buf[m++] = mask[j];
-			buf[m++] = rho[j];
-			buf[m++] = e[j];
-			buf[m++] = cv[j];
-			buf[m++] = vest[j][0];
-			buf[m++] = vest[j][1];
-			buf[m++] = vest[j][2];
-		}
-	}
-	return m;
+                int *pbc) {
+        //printf("in AtomVecMeso::pack_border\n");
+        int i, j, m;
+        double dx, dy, dz;
+
+        m = 0;
+        if (pbc_flag == 0) {
+                for (i = 0; i < n; i++) {
+                        j = list[i];
+                        buf[m++] = x[j][0];
+                        buf[m++] = x[j][1];
+                        buf[m++] = x[j][2];
+                        buf[m++] = tag[j];
+                        buf[m++] = type[j];
+                        buf[m++] = mask[j];
+                        buf[m++] = rho[j];
+                        buf[m++] = e[j];
+                        buf[m++] = cv[j];
+                        buf[m++] = vest[j][0];
+                        buf[m++] = vest[j][1];
+                        buf[m++] = vest[j][2];
+                }
+        } else {
+                if (domain->triclinic == 0) {
+                        dx = pbc[0] * domain->xprd;
+                        dy = pbc[1] * domain->yprd;
+                        dz = pbc[2] * domain->zprd;
+                } else {
+                        dx = pbc[0];
+                        dy = pbc[1];
+                        dz = pbc[2];
+                }
+                for (i = 0; i < n; i++) {
+                        j = list[i];
+                        buf[m++] = x[j][0] + dx;
+                        buf[m++] = x[j][1] + dy;
+                        buf[m++] = x[j][2] + dz;
+                        buf[m++] = tag[j];
+                        buf[m++] = type[j];
+                        buf[m++] = mask[j];
+                        buf[m++] = rho[j];
+                        buf[m++] = e[j];
+                        buf[m++] = cv[j];
+                        buf[m++] = vest[j][0];
+                        buf[m++] = vest[j][1];
+                        buf[m++] = vest[j][2];
+                }
+        }
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::pack_border_vel(int n, int *list, double *buf, int pbc_flag,
-		int *pbc) {
-	//printf("in AtomVecMeso::pack_border_vel\n");
-	int i, j, m;
-	double dx, dy, dz;
-
-	m = 0;
-	if (pbc_flag == 0) {
-		for (i = 0; i < n; i++) {
-			j = list[i];
-			buf[m++] = x[j][0];
-			buf[m++] = x[j][1];
-			buf[m++] = x[j][2];
-			buf[m++] = tag[j];
-			buf[m++] = type[j];
-			buf[m++] = mask[j];
-			buf[m++] = v[j][0];
-			buf[m++] = v[j][1];
-			buf[m++] = v[j][2];
-			buf[m++] = rho[j];
-			buf[m++] = e[j];
-			buf[m++] = cv[j];
-			buf[m++] = vest[j][0];
-			buf[m++] = vest[j][1];
-			buf[m++] = vest[j][2];
-		}
-	} else {
-		if (domain->triclinic == 0) {
-			dx = pbc[0] * domain->xprd;
-			dy = pbc[1] * domain->yprd;
-			dz = pbc[2] * domain->zprd;
-		} else {
-			dx = pbc[0];
-			dy = pbc[1];
-			dz = pbc[2];
-		}
-		for (i = 0; i < n; i++) {
-			j = list[i];
-			buf[m++] = x[j][0] + dx;
-			buf[m++] = x[j][1] + dy;
-			buf[m++] = x[j][2] + dz;
-			buf[m++] = tag[j];
-			buf[m++] = type[j];
-			buf[m++] = mask[j];
-			buf[m++] = v[j][0];
-			buf[m++] = v[j][1];
-			buf[m++] = v[j][2];
-			buf[m++] = rho[j];
-			buf[m++] = e[j];
-			buf[m++] = cv[j];
-			buf[m++] = vest[j][0];
-			buf[m++] = vest[j][1];
-			buf[m++] = vest[j][2];
-		}
-	}
-	return m;
+                int *pbc) {
+        //printf("in AtomVecMeso::pack_border_vel\n");
+        int i, j, m;
+        double dx, dy, dz;
+
+        m = 0;
+        if (pbc_flag == 0) {
+                for (i = 0; i < n; i++) {
+                        j = list[i];
+                        buf[m++] = x[j][0];
+                        buf[m++] = x[j][1];
+                        buf[m++] = x[j][2];
+                        buf[m++] = tag[j];
+                        buf[m++] = type[j];
+                        buf[m++] = mask[j];
+                        buf[m++] = v[j][0];
+                        buf[m++] = v[j][1];
+                        buf[m++] = v[j][2];
+                        buf[m++] = rho[j];
+                        buf[m++] = e[j];
+                        buf[m++] = cv[j];
+                        buf[m++] = vest[j][0];
+                        buf[m++] = vest[j][1];
+                        buf[m++] = vest[j][2];
+                }
+        } else {
+                if (domain->triclinic == 0) {
+                        dx = pbc[0] * domain->xprd;
+                        dy = pbc[1] * domain->yprd;
+                        dz = pbc[2] * domain->zprd;
+                } else {
+                        dx = pbc[0];
+                        dy = pbc[1];
+                        dz = pbc[2];
+                }
+                for (i = 0; i < n; i++) {
+                        j = list[i];
+                        buf[m++] = x[j][0] + dx;
+                        buf[m++] = x[j][1] + dy;
+                        buf[m++] = x[j][2] + dz;
+                        buf[m++] = tag[j];
+                        buf[m++] = type[j];
+                        buf[m++] = mask[j];
+                        buf[m++] = v[j][0];
+                        buf[m++] = v[j][1];
+                        buf[m++] = v[j][2];
+                        buf[m++] = rho[j];
+                        buf[m++] = e[j];
+                        buf[m++] = cv[j];
+                        buf[m++] = vest[j][0];
+                        buf[m++] = vest[j][1];
+                        buf[m++] = vest[j][2];
+                }
+        }
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 void AtomVecMeso::unpack_border(int n, int first, double *buf) {
-	//printf("in AtomVecMeso::unpack_border\n");
-	int i, m, last;
-
-	m = 0;
-	last = first + n;
-	for (i = first; i < last; i++) {
-		if (i == nmax)
-			grow(0);
-		x[i][0] = buf[m++];
-		x[i][1] = buf[m++];
-		x[i][2] = buf[m++];
-		tag[i] = static_cast<int> (buf[m++]);
-		type[i] = static_cast<int> (buf[m++]);
-		mask[i] = static_cast<int> (buf[m++]);
-		rho[i] = buf[m++];
-		e[i] = buf[m++];
-		cv[i] = buf[m++];
-		vest[i][0] = buf[m++];
-		vest[i][1] = buf[m++];
-		vest[i][2] = buf[m++];
-	}
+        //printf("in AtomVecMeso::unpack_border\n");
+        int i, m, last;
+
+        m = 0;
+        last = first + n;
+        for (i = first; i < last; i++) {
+                if (i == nmax)
+                        grow(0);
+                x[i][0] = buf[m++];
+                x[i][1] = buf[m++];
+                x[i][2] = buf[m++];
+                tag[i] = static_cast<int> (buf[m++]);
+                type[i] = static_cast<int> (buf[m++]);
+                mask[i] = static_cast<int> (buf[m++]);
+                rho[i] = buf[m++];
+                e[i] = buf[m++];
+                cv[i] = buf[m++];
+                vest[i][0] = buf[m++];
+                vest[i][1] = buf[m++];
+                vest[i][2] = buf[m++];
+        }
 }
 
 /* ---------------------------------------------------------------------- */
 
 void AtomVecMeso::unpack_border_vel(int n, int first, double *buf) {
-	//printf("in AtomVecMeso::unpack_border_vel\n");
-	int i, m, last;
-
-	m = 0;
-	last = first + n;
-	for (i = first; i < last; i++) {
-		if (i == nmax)
-			grow(0);
-		x[i][0] = buf[m++];
-		x[i][1] = buf[m++];
-		x[i][2] = buf[m++];
-		tag[i] = static_cast<int> (buf[m++]);
-		type[i] = static_cast<int> (buf[m++]);
-		mask[i] = static_cast<int> (buf[m++]);
-		v[i][0] = buf[m++];
-		v[i][1] = buf[m++];
-		v[i][2] = buf[m++];
-		rho[i] = buf[m++];
-		e[i] = buf[m++];
-		cv[i] = buf[m++];
-		vest[i][0] = buf[m++];
-		vest[i][1] = buf[m++];
-		vest[i][2] = buf[m++];
-	}
+        //printf("in AtomVecMeso::unpack_border_vel\n");
+        int i, m, last;
+
+        m = 0;
+        last = first + n;
+        for (i = first; i < last; i++) {
+                if (i == nmax)
+                        grow(0);
+                x[i][0] = buf[m++];
+                x[i][1] = buf[m++];
+                x[i][2] = buf[m++];
+                tag[i] = static_cast<int> (buf[m++]);
+                type[i] = static_cast<int> (buf[m++]);
+                mask[i] = static_cast<int> (buf[m++]);
+                v[i][0] = buf[m++];
+                v[i][1] = buf[m++];
+                v[i][2] = buf[m++];
+                rho[i] = buf[m++];
+                e[i] = buf[m++];
+                cv[i] = buf[m++];
+                vest[i][0] = buf[m++];
+                vest[i][1] = buf[m++];
+                vest[i][2] = buf[m++];
+        }
 }
 
 /* ----------------------------------------------------------------------
@@ -585,66 +585,66 @@ void AtomVecMeso::unpack_border_vel(int n, int first, double *buf) {
  ------------------------------------------------------------------------- */
 
 int AtomVecMeso::pack_exchange(int i, double *buf) {
-	//printf("in AtomVecMeso::pack_exchange\n");
-	int m = 1;
-	buf[m++] = x[i][0];
-	buf[m++] = x[i][1];
-	buf[m++] = x[i][2];
-	buf[m++] = v[i][0];
-	buf[m++] = v[i][1];
-	buf[m++] = v[i][2];
-	buf[m++] = tag[i];
-	buf[m++] = type[i];
-	buf[m++] = mask[i];
-	buf[m++] = image[i];
-	buf[m++] = rho[i];
-	buf[m++] = e[i];
-	buf[m++] = cv[i];
-	buf[m++] = vest[i][0];
-	buf[m++] = vest[i][1];
-	buf[m++] = vest[i][2];
-
-	if (atom->nextra_grow)
-		for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
-			m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i, &buf[m]);
-
-	buf[0] = m;
-	return m;
+        //printf("in AtomVecMeso::pack_exchange\n");
+        int m = 1;
+        buf[m++] = x[i][0];
+        buf[m++] = x[i][1];
+        buf[m++] = x[i][2];
+        buf[m++] = v[i][0];
+        buf[m++] = v[i][1];
+        buf[m++] = v[i][2];
+        buf[m++] = tag[i];
+        buf[m++] = type[i];
+        buf[m++] = mask[i];
+        buf[m++] = image[i];
+        buf[m++] = rho[i];
+        buf[m++] = e[i];
+        buf[m++] = cv[i];
+        buf[m++] = vest[i][0];
+        buf[m++] = vest[i][1];
+        buf[m++] = vest[i][2];
+
+        if (atom->nextra_grow)
+                for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
+                        m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i, &buf[m]);
+
+        buf[0] = m;
+        return m;
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecMeso::unpack_exchange(double *buf) {
-	//printf("in AtomVecMeso::unpack_exchange\n");
-	int nlocal = atom->nlocal;
-	if (nlocal == nmax)
-		grow(0);
-
-	int m = 1;
-	x[nlocal][0] = buf[m++];
-	x[nlocal][1] = buf[m++];
-	x[nlocal][2] = buf[m++];
-	v[nlocal][0] = buf[m++];
-	v[nlocal][1] = buf[m++];
-	v[nlocal][2] = buf[m++];
-	tag[nlocal] = static_cast<int> (buf[m++]);
-	type[nlocal] = static_cast<int> (buf[m++]);
-	mask[nlocal] = static_cast<int> (buf[m++]);
-	image[nlocal] = static_cast<int> (buf[m++]);
-	rho[nlocal] = buf[m++];
-	e[nlocal] = buf[m++];
-	cv[nlocal] = buf[m++];
-	vest[nlocal][0] = buf[m++];
-	vest[nlocal][1] = buf[m++];
-	vest[nlocal][2] = buf[m++];
-
-	if (atom->nextra_grow)
-		for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
-			m += modify->fix[atom->extra_grow[iextra]]-> unpack_exchange(nlocal,
-					&buf[m]);
-
-	atom->nlocal++;
-	return m;
+        //printf("in AtomVecMeso::unpack_exchange\n");
+        int nlocal = atom->nlocal;
+        if (nlocal == nmax)
+                grow(0);
+
+        int m = 1;
+        x[nlocal][0] = buf[m++];
+        x[nlocal][1] = buf[m++];
+        x[nlocal][2] = buf[m++];
+        v[nlocal][0] = buf[m++];
+        v[nlocal][1] = buf[m++];
+        v[nlocal][2] = buf[m++];
+        tag[nlocal] = static_cast<int> (buf[m++]);
+        type[nlocal] = static_cast<int> (buf[m++]);
+        mask[nlocal] = static_cast<int> (buf[m++]);
+        image[nlocal] = static_cast<int> (buf[m++]);
+        rho[nlocal] = buf[m++];
+        e[nlocal] = buf[m++];
+        cv[nlocal] = buf[m++];
+        vest[nlocal][0] = buf[m++];
+        vest[nlocal][1] = buf[m++];
+        vest[nlocal][2] = buf[m++];
+
+        if (atom->nextra_grow)
+                for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
+                        m += modify->fix[atom->extra_grow[iextra]]-> unpack_exchange(nlocal,
+                                        &buf[m]);
+
+        atom->nlocal++;
+        return m;
 }
 
 /* ----------------------------------------------------------------------
@@ -653,17 +653,17 @@ int AtomVecMeso::unpack_exchange(double *buf) {
  ------------------------------------------------------------------------- */
 
 int AtomVecMeso::size_restart() {
-	int i;
+        int i;
 
-	int nlocal = atom->nlocal;
-	int n = 17 * nlocal; // 11 + rho + e + cv + vest[3]
+        int nlocal = atom->nlocal;
+        int n = 17 * nlocal; // 11 + rho + e + cv + vest[3]
 
-	if (atom->nextra_restart)
-		for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
-			for (i = 0; i < nlocal; i++)
-				n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        if (atom->nextra_restart)
+                for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
+                        for (i = 0; i < nlocal; i++)
+                                n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
-	return n;
+        return n;
 }
 
 /* ----------------------------------------------------------------------
@@ -673,30 +673,30 @@ int AtomVecMeso::size_restart() {
  ------------------------------------------------------------------------- */
 
 int AtomVecMeso::pack_restart(int i, double *buf) {
-	int m = 1;
-	buf[m++] = x[i][0];
-	buf[m++] = x[i][1];
-	buf[m++] = x[i][2];
-	buf[m++] = tag[i];
-	buf[m++] = type[i];
-	buf[m++] = mask[i];
-	buf[m++] = image[i];
-	buf[m++] = v[i][0];
-	buf[m++] = v[i][1];
-	buf[m++] = v[i][2];
-	buf[m++] = rho[i];
-	buf[m++] = e[i];
-	buf[m++] = cv[i];
-	buf[m++] = vest[i][0];
-	buf[m++] = vest[i][1];
-	buf[m++] = vest[i][2];
-
-	if (atom->nextra_restart)
-		for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
-			m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i, &buf[m]);
-
-	buf[0] = m;
-	return m;
+        int m = 1;
+        buf[m++] = x[i][0];
+        buf[m++] = x[i][1];
+        buf[m++] = x[i][2];
+        buf[m++] = tag[i];
+        buf[m++] = type[i];
+        buf[m++] = mask[i];
+        buf[m++] = image[i];
+        buf[m++] = v[i][0];
+        buf[m++] = v[i][1];
+        buf[m++] = v[i][2];
+        buf[m++] = rho[i];
+        buf[m++] = e[i];
+        buf[m++] = cv[i];
+        buf[m++] = vest[i][0];
+        buf[m++] = vest[i][1];
+        buf[m++] = vest[i][2];
+
+        if (atom->nextra_restart)
+                for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
+                        m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i, &buf[m]);
+
+        buf[0] = m;
+        return m;
 }
 
 /* ----------------------------------------------------------------------
@@ -704,40 +704,40 @@ int AtomVecMeso::pack_restart(int i, double *buf) {
  ------------------------------------------------------------------------- */
 
 int AtomVecMeso::unpack_restart(double *buf) {
-	int nlocal = atom->nlocal;
-	if (nlocal == nmax) {
-		grow(0);
-		if (atom->nextra_store)
-			memory->grow(atom->extra, nmax, atom->nextra_store, "atom:extra");
-	}
-
-	int m = 1;
-	x[nlocal][0] = buf[m++];
-	x[nlocal][1] = buf[m++];
-	x[nlocal][2] = buf[m++];
-	tag[nlocal] = static_cast<int> (buf[m++]);
-	type[nlocal] = static_cast<int> (buf[m++]);
-	mask[nlocal] = static_cast<int> (buf[m++]);
-	image[nlocal] = static_cast<int> (buf[m++]);
-	v[nlocal][0] = buf[m++];
-	v[nlocal][1] = buf[m++];
-	v[nlocal][2] = buf[m++];
-	rho[nlocal] = buf[m++];
-	e[nlocal] = buf[m++];
-	cv[nlocal] = buf[m++];
-	vest[nlocal][0] = buf[m++];
-	vest[nlocal][1] = buf[m++];
-	vest[nlocal][2] = buf[m++];
-
-	double **extra = atom->extra;
-	if (atom->nextra_store) {
-		int size = static_cast<int> (buf[0]) - m;
-		for (int i = 0; i < size; i++)
-			extra[nlocal][i] = buf[m++];
-	}
-
-	atom->nlocal++;
-	return m;
+        int nlocal = atom->nlocal;
+        if (nlocal == nmax) {
+                grow(0);
+                if (atom->nextra_store)
+                        memory->grow(atom->extra, nmax, atom->nextra_store, "atom:extra");
+        }
+
+        int m = 1;
+        x[nlocal][0] = buf[m++];
+        x[nlocal][1] = buf[m++];
+        x[nlocal][2] = buf[m++];
+        tag[nlocal] = static_cast<int> (buf[m++]);
+        type[nlocal] = static_cast<int> (buf[m++]);
+        mask[nlocal] = static_cast<int> (buf[m++]);
+        image[nlocal] = static_cast<int> (buf[m++]);
+        v[nlocal][0] = buf[m++];
+        v[nlocal][1] = buf[m++];
+        v[nlocal][2] = buf[m++];
+        rho[nlocal] = buf[m++];
+        e[nlocal] = buf[m++];
+        cv[nlocal] = buf[m++];
+        vest[nlocal][0] = buf[m++];
+        vest[nlocal][1] = buf[m++];
+        vest[nlocal][2] = buf[m++];
+
+        double **extra = atom->extra;
+        if (atom->nextra_store) {
+                int size = static_cast<int> (buf[0]) - m;
+                for (int i = 0; i < size; i++)
+                        extra[nlocal][i] = buf[m++];
+        }
+
+        atom->nlocal++;
+        return m;
 }
 
 /* ----------------------------------------------------------------------
@@ -746,30 +746,30 @@ int AtomVecMeso::unpack_restart(double *buf) {
  ------------------------------------------------------------------------- */
 
 void AtomVecMeso::create_atom(int itype, double *coord) {
-	int nlocal = atom->nlocal;
-	if (nlocal == nmax)
-		grow(0);
-
-	tag[nlocal] = 0;
-	type[nlocal] = itype;
-	x[nlocal][0] = coord[0];
-	x[nlocal][1] = coord[1];
-	x[nlocal][2] = coord[2];
-	mask[nlocal] = 1;
-	image[nlocal] = (512 << 20) | (512 << 10) | 512;
-	v[nlocal][0] = 0.0;
-	v[nlocal][1] = 0.0;
-	v[nlocal][2] = 0.0;
-	rho[nlocal] = 0.0;
-	e[nlocal] = 0.0;
-	cv[nlocal] = 1.0;
-	vest[nlocal][0] = 0.0;
-	vest[nlocal][1] = 0.0;
-	vest[nlocal][2] = 0.0;
-	de[nlocal] = 0.0;
-	drho[nlocal] = 0.0;
-
-	atom->nlocal++;
+        int nlocal = atom->nlocal;
+        if (nlocal == nmax)
+                grow(0);
+
+        tag[nlocal] = 0;
+        type[nlocal] = itype;
+        x[nlocal][0] = coord[0];
+        x[nlocal][1] = coord[1];
+        x[nlocal][2] = coord[2];
+        mask[nlocal] = 1;
+        image[nlocal] = (512 << 20) | (512 << 10) | 512;
+        v[nlocal][0] = 0.0;
+        v[nlocal][1] = 0.0;
+        v[nlocal][2] = 0.0;
+        rho[nlocal] = 0.0;
+        e[nlocal] = 0.0;
+        cv[nlocal] = 1.0;
+        vest[nlocal][0] = 0.0;
+        vest[nlocal][1] = 0.0;
+        vest[nlocal][2] = 0.0;
+        de[nlocal] = 0.0;
+        drho[nlocal] = 0.0;
+
+        atom->nlocal++;
 }
 
 /* ----------------------------------------------------------------------
@@ -778,43 +778,43 @@ void AtomVecMeso::create_atom(int itype, double *coord) {
  ------------------------------------------------------------------------- */
 
 void AtomVecMeso::data_atom(double *coord, int imagetmp, char **values) {
-	int nlocal = atom->nlocal;
-	if (nlocal == nmax)
-		grow(0);
+        int nlocal = atom->nlocal;
+        if (nlocal == nmax)
+                grow(0);
 
-	tag[nlocal] = atoi(values[0]);
-	if (tag[nlocal] <= 0)
-		error->one(FLERR,"Invalid atom ID in Atoms section of data file");
+        tag[nlocal] = atoi(values[0]);
+        if (tag[nlocal] <= 0)
+                error->one(FLERR,"Invalid atom ID in Atoms section of data file");
 
-	type[nlocal] = atoi(values[1]);
-	if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
-		error->one(FLERR,"Invalid atom type in Atoms section of data file");
+        type[nlocal] = atoi(values[1]);
+        if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
+                error->one(FLERR,"Invalid atom type in Atoms section of data file");
 
-	rho[nlocal] = atof(values[2]);
-	e[nlocal] = atof(values[3]);
-	cv[nlocal] = atof(values[4]);
+        rho[nlocal] = atof(values[2]);
+        e[nlocal] = atof(values[3]);
+        cv[nlocal] = atof(values[4]);
 
-	x[nlocal][0] = coord[0];
-	x[nlocal][1] = coord[1];
-	x[nlocal][2] = coord[2];
+        x[nlocal][0] = coord[0];
+        x[nlocal][1] = coord[1];
+        x[nlocal][2] = coord[2];
 
-	//printf("rho=%f, e=%f, cv=%f, x=%f\n", rho[nlocal], e[nlocal], cv[nlocal], x[nlocal][0]);
+        //printf("rho=%f, e=%f, cv=%f, x=%f\n", rho[nlocal], e[nlocal], cv[nlocal], x[nlocal][0]);
 
-	image[nlocal] = imagetmp;
+        image[nlocal] = imagetmp;
 
-	mask[nlocal] = 1;
-	v[nlocal][0] = 0.0;
-	v[nlocal][1] = 0.0;
-	v[nlocal][2] = 0.0;
+        mask[nlocal] = 1;
+        v[nlocal][0] = 0.0;
+        v[nlocal][1] = 0.0;
+        v[nlocal][2] = 0.0;
 
-	vest[nlocal][0] = 0.0;
-	vest[nlocal][1] = 0.0;
-	vest[nlocal][2] = 0.0;
+        vest[nlocal][0] = 0.0;
+        vest[nlocal][1] = 0.0;
+        vest[nlocal][2] = 0.0;
 
-	de[nlocal] = 0.0;
-	drho[nlocal] = 0.0;
+        de[nlocal] = 0.0;
+        drho[nlocal] = 0.0;
 
-	atom->nlocal++;
+        atom->nlocal++;
 }
 
 /* ----------------------------------------------------------------------
@@ -824,11 +824,11 @@ void AtomVecMeso::data_atom(double *coord, int imagetmp, char **values) {
 
 int AtomVecMeso::data_atom_hybrid(int nlocal, char **values) {
 
-	rho[nlocal] = atof(values[0]);
-	e[nlocal] = atof(values[1]);
-	cv[nlocal] = atof(values[2]);
+        rho[nlocal] = atof(values[0]);
+        e[nlocal] = atof(values[1]);
+        cv[nlocal] = atof(values[2]);
 
-	return 3;
+        return 3;
 }
 
 /* ----------------------------------------------------------------------
@@ -836,34 +836,34 @@ int AtomVecMeso::data_atom_hybrid(int nlocal, char **values) {
  ------------------------------------------------------------------------- */
 
 bigint AtomVecMeso::memory_usage() {
-	bigint bytes = 0;
-
-	if (atom->memcheck("tag"))
-		bytes += memory->usage(tag, nmax);
-	if (atom->memcheck("type"))
-		bytes += memory->usage(type, nmax);
-	if (atom->memcheck("mask"))
-		bytes += memory->usage(mask, nmax);
-	if (atom->memcheck("image"))
-		bytes += memory->usage(image, nmax);
-	if (atom->memcheck("x"))
-		bytes += memory->usage(x, nmax, 3);
-	if (atom->memcheck("v"))
-		bytes += memory->usage(v, nmax, 3);
-	if (atom->memcheck("f"))
-		bytes += memory->usage(f, nmax*comm->nthreads, 3);
-	if (atom->memcheck("rho"))
-		bytes += memory->usage(rho, nmax);
-	if (atom->memcheck("drho"))
-		bytes += memory->usage(drho, nmax*comm->nthreads);
-	if (atom->memcheck("e"))
-		bytes += memory->usage(e, nmax);
-	if (atom->memcheck("de"))
-		bytes += memory->usage(de, nmax*comm->nthreads);
-	if (atom->memcheck("cv"))
-		bytes += memory->usage(cv, nmax);
-	if (atom->memcheck("vest"))
-		bytes += memory->usage(vest, nmax);
-
-	return bytes;
+        bigint bytes = 0;
+
+        if (atom->memcheck("tag"))
+                bytes += memory->usage(tag, nmax);
+        if (atom->memcheck("type"))
+                bytes += memory->usage(type, nmax);
+        if (atom->memcheck("mask"))
+                bytes += memory->usage(mask, nmax);
+        if (atom->memcheck("image"))
+                bytes += memory->usage(image, nmax);
+        if (atom->memcheck("x"))
+                bytes += memory->usage(x, nmax, 3);
+        if (atom->memcheck("v"))
+                bytes += memory->usage(v, nmax, 3);
+        if (atom->memcheck("f"))
+                bytes += memory->usage(f, nmax*comm->nthreads, 3);
+        if (atom->memcheck("rho"))
+                bytes += memory->usage(rho, nmax);
+        if (atom->memcheck("drho"))
+                bytes += memory->usage(drho, nmax*comm->nthreads);
+        if (atom->memcheck("e"))
+                bytes += memory->usage(e, nmax);
+        if (atom->memcheck("de"))
+                bytes += memory->usage(de, nmax*comm->nthreads);
+        if (atom->memcheck("cv"))
+                bytes += memory->usage(cv, nmax);
+        if (atom->memcheck("vest"))
+                bytes += memory->usage(vest, nmax);
+
+        return bytes;
 }
diff --git a/src/USER-SPH/atom_vec_meso.h b/src/USER-SPH/atom_vec_meso.h
index b187198c09..eeb3bb456e 100644
--- a/src/USER-SPH/atom_vec_meso.h
+++ b/src/USER-SPH/atom_vec_meso.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-SPH/compute_meso_e_atom.cpp b/src/USER-SPH/compute_meso_e_atom.cpp
index 4ee0dce518..0446d948c4 100644
--- a/src/USER-SPH/compute_meso_e_atom.cpp
+++ b/src/USER-SPH/compute_meso_e_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -78,10 +78,10 @@ void ComputeMesoEAtom::compute_peratom()
 
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	      evector[i] = e[i];
+              evector[i] = e[i];
       }
       else {
-      	evector[i] = 0.0;
+              evector[i] = 0.0;
       }
     }
 }
diff --git a/src/USER-SPH/compute_meso_e_atom.h b/src/USER-SPH/compute_meso_e_atom.h
index 07fc01c920..d3a896bafd 100644
--- a/src/USER-SPH/compute_meso_e_atom.h
+++ b/src/USER-SPH/compute_meso_e_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-SPH/compute_meso_rho_atom.cpp b/src/USER-SPH/compute_meso_rho_atom.cpp
index 465bbfe164..e1db218544 100644
--- a/src/USER-SPH/compute_meso_rho_atom.cpp
+++ b/src/USER-SPH/compute_meso_rho_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -80,10 +80,10 @@ void ComputeMesoRhoAtom::compute_peratom()
 
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	      rhoVector[i] = rho[i];
+              rhoVector[i] = rho[i];
       }
       else {
-      	rhoVector[i] = 0.0;
+              rhoVector[i] = 0.0;
       }
     }
 }
diff --git a/src/USER-SPH/compute_meso_rho_atom.h b/src/USER-SPH/compute_meso_rho_atom.h
index e1100a2f81..6c51593b2e 100644
--- a/src/USER-SPH/compute_meso_rho_atom.h
+++ b/src/USER-SPH/compute_meso_rho_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-SPH/compute_meso_t_atom.cpp b/src/USER-SPH/compute_meso_t_atom.cpp
index 5d4f1177ba..98b0c88f55 100644
--- a/src/USER-SPH/compute_meso_t_atom.cpp
+++ b/src/USER-SPH/compute_meso_t_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -30,7 +30,7 @@ ComputeMesoTAtom::ComputeMesoTAtom(LAMMPS *lmp, int narg, char **arg) :
 {
   if (narg != 3) error->all(FLERR,"Number of arguments for compute meso_t/atom command != 3");
   if ((atom->e_flag != 1) || (atom->cv_flag != 1))
-  	error->all(FLERR,"compute meso_e/atom command requires atom_style with both energy and heat capacity (e.g. meso)");
+          error->all(FLERR,"compute meso_e/atom command requires atom_style with both energy and heat capacity (e.g. meso)");
 
   peratom_flag = 1;
   size_peratom_cols = 0;
@@ -80,12 +80,12 @@ void ComputeMesoTAtom::compute_peratom()
 
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-      	if (cv[i] > 0.0) {
-      		tvector[i] = e[i] / cv[i];
-      	}
+              if (cv[i] > 0.0) {
+                      tvector[i] = e[i] / cv[i];
+              }
       }
       else {
-      	tvector[i] = 0.0;
+              tvector[i] = 0.0;
       }
     }
 }
diff --git a/src/USER-SPH/compute_meso_t_atom.h b/src/USER-SPH/compute_meso_t_atom.h
index 279d749f87..6b8c618e0f 100644
--- a/src/USER-SPH/compute_meso_t_atom.h
+++ b/src/USER-SPH/compute_meso_t_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-SPH/fix_meso.cpp b/src/USER-SPH/fix_meso.cpp
index ffb69a8c80..53e7b66b65 100644
--- a/src/USER-SPH/fix_meso.cpp
+++ b/src/USER-SPH/fix_meso.cpp
@@ -165,4 +165,3 @@ void FixMeso::reset_dt() {
   dtv = update->dt;
   dtf = 0.5 * update->dt * force->ftm2v;
 }
-
diff --git a/src/USER-SPH/fix_meso.h b/src/USER-SPH/fix_meso.h
index eee5ee1d45..f9fcb5a893 100644
--- a/src/USER-SPH/fix_meso.h
+++ b/src/USER-SPH/fix_meso.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-SPH/fix_meso_stationary.cpp b/src/USER-SPH/fix_meso_stationary.cpp
index f12297f072..101b2639f1 100644
--- a/src/USER-SPH/fix_meso_stationary.cpp
+++ b/src/USER-SPH/fix_meso_stationary.cpp
@@ -120,4 +120,3 @@ void FixMesoStationary::reset_dt() {
   dtv = update->dt;
   dtf = 0.5 * update->dt * force->ftm2v;
 }
-
diff --git a/src/USER-SPH/fix_meso_stationary.h b/src/USER-SPH/fix_meso_stationary.h
index 08869d2105..6cc83f9e93 100644
--- a/src/USER-SPH/fix_meso_stationary.h
+++ b/src/USER-SPH/fix_meso_stationary.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-SPH/pair_sph_heatconduction.h b/src/USER-SPH/pair_sph_heatconduction.h
index 81402fda2e..95b4e845ae 100644
--- a/src/USER-SPH/pair_sph_heatconduction.h
+++ b/src/USER-SPH/pair_sph_heatconduction.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-SPH/pair_sph_idealgas.h b/src/USER-SPH/pair_sph_idealgas.h
index 540789afeb..e9d2e9a8b3 100644
--- a/src/USER-SPH/pair_sph_idealgas.h
+++ b/src/USER-SPH/pair_sph_idealgas.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-SPH/pair_sph_lj.h b/src/USER-SPH/pair_sph_lj.h
index 244ee044a5..cb8f8c745a 100644
--- a/src/USER-SPH/pair_sph_lj.h
+++ b/src/USER-SPH/pair_sph_lj.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-SPH/pair_sph_rhosum.cpp b/src/USER-SPH/pair_sph_rhosum.cpp
index 3985297dd8..4e1a1e52da 100644
--- a/src/USER-SPH/pair_sph_rhosum.cpp
+++ b/src/USER-SPH/pair_sph_rhosum.cpp
@@ -311,4 +311,3 @@ void PairSPHRhoSum::unpack_comm(int n, int first, double *buf) {
   for (i = first; i < last; i++)
     rho[i] = buf[m++];
 }
-
diff --git a/src/USER-SPH/pair_sph_rhosum.h b/src/USER-SPH/pair_sph_rhosum.h
index 227cdef95c..57639ff378 100644
--- a/src/USER-SPH/pair_sph_rhosum.h
+++ b/src/USER-SPH/pair_sph_rhosum.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-SPH/pair_sph_taitwater.h b/src/USER-SPH/pair_sph_taitwater.h
index de081aa544..6e90aac537 100644
--- a/src/USER-SPH/pair_sph_taitwater.h
+++ b/src/USER-SPH/pair_sph_taitwater.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/USER-SPH/pair_sph_taitwater_morris.h b/src/USER-SPH/pair_sph_taitwater_morris.h
index 5390d73f08..05568b12d6 100644
--- a/src/USER-SPH/pair_sph_taitwater_morris.h
+++ b/src/USER-SPH/pair_sph_taitwater_morris.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/XTC/dump_xtc.cpp b/src/XTC/dump_xtc.cpp
index d003a1c20f..2ff16b3881 100644
--- a/src/XTC/dump_xtc.cpp
+++ b/src/XTC/dump_xtc.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -14,12 +14,12 @@
 /* ----------------------------------------------------------------------
    Contributing authors: Naveen Michaud-Agrawal (Johns Hopkins U)
                          open-source XDR routines from
-			   Frans van Hoesel (http://md.chem.rug.nl/hoesel)
-			   are included in this file
+                           Frans van Hoesel (http://md.chem.rug.nl/hoesel)
+                           are included in this file
                          Axel Kohlmeyer (Temple U)
                            port to platforms without XDR support
                            added support for unwrapped trajectories
-			   support for groups
+                           support for groups
 ------------------------------------------------------------------------- */
 
 #include "math.h"
@@ -68,7 +68,7 @@ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
   // allocate global array for atom coords
 
   bigint n = group->count(igroup);
-  if (n > MAXSMALLINT/3/sizeof(float)) 
+  if (n > MAXSMALLINT/3/sizeof(float))
     error->all(FLERR,"Too many atoms for dump xtc");
   natoms = static_cast<int> (n);
 
@@ -210,29 +210,29 @@ void DumpXTC::pack(int *ids)
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	int ix = (image[i] & 1023) - 512;
-	int iy = (image[i] >> 10 & 1023) - 512;
-	int iz = (image[i] >> 20) - 512;
-	
-	if (domain->triclinic) {
-	  buf[m++] = sfactor * (x[i][0] + ix * xprd + iy * xy + iz * xz);
-	  buf[m++] = sfactor * (x[i][1] + iy * yprd + iz * yz);
-	  buf[m++] = sfactor * (x[i][2] + iz * zprd);
-	} else {
-	  buf[m++] = sfactor * (x[i][0] + ix * xprd);
-	  buf[m++] = sfactor * (x[i][1] + iy * yprd);
-	  buf[m++] = sfactor * (x[i][2] + iz * zprd);
-	}
-	ids[n++] = tag[i];
+        int ix = (image[i] & 1023) - 512;
+        int iy = (image[i] >> 10 & 1023) - 512;
+        int iz = (image[i] >> 20) - 512;
+
+        if (domain->triclinic) {
+          buf[m++] = sfactor * (x[i][0] + ix * xprd + iy * xy + iz * xz);
+          buf[m++] = sfactor * (x[i][1] + iy * yprd + iz * yz);
+          buf[m++] = sfactor * (x[i][2] + iz * zprd);
+        } else {
+          buf[m++] = sfactor * (x[i][0] + ix * xprd);
+          buf[m++] = sfactor * (x[i][1] + iy * yprd);
+          buf[m++] = sfactor * (x[i][2] + iz * zprd);
+        }
+        ids[n++] = tag[i];
       }
 
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	buf[m++] = sfactor*x[i][0];
-	buf[m++] = sfactor*x[i][1];
-	buf[m++] = sfactor*x[i][2];
-	ids[n++] = tag[i];
+        buf[m++] = sfactor*x[i][0];
+        buf[m++] = sfactor*x[i][1];
+        buf[m++] = sfactor*x[i][2];
+        ids[n++] = tag[i];
       }
   }
 }
@@ -273,10 +273,10 @@ int DumpXTC::modify_param(int narg, char **arg)
   } else if (strcmp(arg[0],"precision") == 0) {
     if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     precision = atof(arg[1]);
-    if ((fabs(precision-10.0) > EPS) && (fabs(precision-100.0) > EPS) && 
-	(fabs(precision-1000.0) > EPS) && (fabs(precision-10000.0) > EPS) && 
-	(fabs(precision-100000.0) > EPS) && 
-	(fabs(precision-1000000.0) > EPS)) 
+    if ((fabs(precision-10.0) > EPS) && (fabs(precision-100.0) > EPS) &&
+        (fabs(precision-1000.0) > EPS) && (fabs(precision-10000.0) > EPS) &&
+        (fabs(precision-100000.0) > EPS) &&
+        (fabs(precision-1000000.0) > EPS))
       error->all(FLERR,"Illegal dump_modify command");
     return 2;
   }
@@ -310,32 +310,32 @@ void DumpXTC::write_frame()
 /*____________________________________________________________________________
  |
  | Below are the routines to be used by C programmers. Use the 'normal'
- | xdr routines to write integers, floats, etc (see man xdr)	
+ | xdr routines to write integers, floats, etc (see man xdr)
  |
  | int xdropen(XDR *xdrs, const char *filename, const char *type)
- |	This will open the file with the given filename and the 
- |	given mode. You should pass it an allocated XDR struct
- |	in xdrs, to be used in all other calls to xdr routines.
- |	Mode is 'w' to create, or update an file, and for all 
- |	other values of mode the file is opened for reading. 
- |	You need to call xdrclose to flush the output and close
- |	the file.
+ |        This will open the file with the given filename and the
+ |        given mode. You should pass it an allocated XDR struct
+ |        in xdrs, to be used in all other calls to xdr routines.
+ |        Mode is 'w' to create, or update an file, and for all
+ |        other values of mode the file is opened for reading.
+ |        You need to call xdrclose to flush the output and close
+ |        the file.
  |
- |	Note that you should not use xdrstdio_create, which
- |	comes with the standard xdr library.
+ |        Note that you should not use xdrstdio_create, which
+ |        comes with the standard xdr library.
  |
  | int xdrclose(XDR *xdrs)
- |	Flush the data to the file, and close the file;
- |	You should not use xdr_destroy (which comes standard
- |	with the xdr libraries).
- |	 
+ |        Flush the data to the file, and close the file;
+ |        You should not use xdr_destroy (which comes standard
+ |        with the xdr libraries).
+ |
  | int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
- |	This is \fInot\fR a standard xdr routine. I named it this 
- |	way, because it invites people to use the other xdr 
- |	routines.
+ |        This is \fInot\fR a standard xdr routine. I named it this
+ |        way, because it invites people to use the other xdr
+ |        routines.
  |
- |	(c) 1995 Frans van Hoesel, hoesel@chem.rug.nl
-*/	
+ |        (c) 1995 Frans van Hoesel, hoesel@chem.rug.nl
+*/
 
 #define MAXID 20
 static FILE *xdrfiles[MAXID];
@@ -362,9 +362,9 @@ static int magicints[] = {
   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, 
+  82570, 104031, 131072, 165140, 208063, 262144, 330280, 416127,
   524287, 660561,
-  832255, 1048576, 1321122, 1664510, 2097152, 2642245, 3329021, 
+  832255, 1048576, 1321122, 1664510, 2097152, 2642245, 3329021,
   4194304, 5284491, 6658042,
   8388607, 10568983, 13316085, 16777216 };
 
@@ -388,7 +388,7 @@ int xdropen(XDR *xdrs, const char *filename, const char *type)
   static int init_done = 0;
   enum xdr_op lmode;
   int xdrid;
-    
+
   if (init_done == 0) {
     for (xdrid = 1; xdrid < MAXID; xdrid++) {
       xdridptr[xdrid] = NULL;
@@ -440,24 +440,24 @@ int xdropen(XDR *xdrs, const char *filename, const char *type)
  | done by xdr_destroy).
  |
 */
- 
+
 int xdrclose(XDR *xdrs)
 {
   int xdrid;
-    
+
   if (xdrs == NULL) {
     fprintf(stderr, "xdrclose: passed a NULL pointer\n");
     exit(1);
   }
   for (xdrid = 1; xdrid < MAXID; xdrid++) {
     if (xdridptr[xdrid] == xdrs) {
-      
+
       xdr_destroy(xdrs);
       fclose(xdrfiles[xdrid]);
       xdridptr[xdrid] = NULL;
       return 1;
     }
-  } 
+  }
   fprintf(stderr, "xdrclose: no such open xdr file\n");
   exit(1);
   return 1;
@@ -493,7 +493,7 @@ static void sendbits(int buf[], int num_of_bits, int num)
   unsigned int cnt, lastbyte;
   int lastbits;
   unsigned char * cbuf;
-    
+
   cbuf = ((unsigned char *)buf) + 3 * sizeof(*buf);
   cnt = (unsigned int) buf[0];
   lastbits = buf[1];
@@ -531,7 +531,7 @@ static int sizeofint(const int size)
 {
   unsigned int num = 1;
   int num_of_bits = 0;
-  
+
   while (size >= num && num_of_bits < 32) {
     num_of_bits++;
     num <<= 1;
@@ -558,7 +558,7 @@ static int sizeofints( const int num_of_ints, unsigned int sizes[])
   num_of_bytes = 1;
   bytes[0] = 1;
   num_of_bits = 0;
-  for (i=0; i < num_of_ints; i++) {	
+  for (i=0; i < num_of_ints; i++) {
     tmp = 0;
     for (bytecnt = 0; bytecnt < num_of_bytes; bytecnt++) {
       tmp = bytes[bytecnt] * sizes[i] + tmp;
@@ -582,10 +582,10 @@ static int sizeofints( const int num_of_ints, unsigned int sizes[])
 
 /*____________________________________________________________________________
  |
- | sendints - send a small set of small integers in compressed 
+ | sendints - send a small set of small integers in compressed
  |
  | this routine is used internally by xdr3dfcoord, to send a set of
- | small integers to the buffer. 
+ | small integers to the buffer.
  | Multiplication with fixed (specified maximum ) sizes is used to get
  | to one big, multibyte integer. Allthough the routine could be
  | modified to handle sizes bigger than 16777216, or more than just
@@ -594,27 +594,27 @@ static int sizeofints( const int num_of_ints, unsigned int sizes[])
  | or the byte buffer (32 bytes) is unchecked and causes bad results.
  |
  */
- 
+
 static void sendints(int buf[], const int num_of_ints, const int num_of_bits,
-		     unsigned int sizes[], unsigned int nums[])
+                     unsigned int sizes[], unsigned int nums[])
 {
   int i;
   unsigned int bytes[32], num_of_bytes, bytecnt, tmp;
-  
+
   tmp = nums[0];
   num_of_bytes = 0;
   do {
     bytes[num_of_bytes++] = tmp & 0xff;
     tmp >>= 8;
   } while (tmp != 0);
-  
+
   for (i = 1; i < num_of_ints; i++) {
     if (nums[i] >= sizes[i]) {
       fprintf(stderr,"major breakdown in sendints num %d doesn't "
-	      "match size %d\n", nums[i], sizes[i]);
+              "match size %d\n", nums[i], sizes[i]);
       exit(1);
     }
-    /* use one step multiply */    
+    /* use one step multiply */
     tmp = nums[i];
     for (bytecnt = 0; bytecnt < num_of_bytes; bytecnt++) {
       tmp = bytes[bytecnt] * sizes[i] + tmp;
@@ -643,7 +643,7 @@ static void sendints(int buf[], const int num_of_ints, const int num_of_bits,
 /*___________________________________________________________________________
  |
  | receivebits - decode number from buf using specified number of bits
- | 
+ |
  | extract the number of bits from the array buf and construct an integer
  | from it. Return that value.
  |
@@ -651,16 +651,16 @@ static void sendints(int buf[], const int num_of_ints, const int num_of_bits,
 
 static int receivebits(int buf[], int num_of_bits)
 {
-  int cnt, num; 
+  int cnt, num;
   unsigned int lastbits, lastbyte;
   unsigned char * cbuf;
   int mask = (1 << num_of_bits) -1;
-  
+
   cbuf = ((unsigned char *)buf) + 3 * sizeof(*buf);
   cnt = buf[0];
   lastbits = (unsigned int) buf[1];
   lastbyte = (unsigned int) buf[2];
-  
+
   num = 0;
   while (num_of_bits >= 8) {
     lastbyte = ( lastbyte << 8 ) | cbuf[cnt++];
@@ -679,7 +679,7 @@ static int receivebits(int buf[], int num_of_bits)
   buf[0] = cnt;
   buf[1] = lastbits;
   buf[2] = lastbyte;
-  return num; 
+  return num;
 }
 
 /*____________________________________________________________________________
@@ -694,11 +694,11 @@ static int receivebits(int buf[], int num_of_bits)
 */
 
 static void receiveints(int buf[], const int num_of_ints, int num_of_bits,
-			unsigned int sizes[], int nums[])
+                        unsigned int sizes[], int nums[])
 {
   int bytes[32];
   int i, j, num_of_bytes, p, num;
-  
+
   bytes[1] = bytes[2] = bytes[3] = 0;
   num_of_bytes = 0;
   while (num_of_bits > 8) {
@@ -720,7 +720,7 @@ static void receiveints(int buf[], const int num_of_ints, int num_of_bits,
   }
   nums[0] = bytes[0] | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24);
 }
-   
+
 /*____________________________________________________________________________
  |
  | xdr3dfcoord - read or write compressed 3d coordinates to xdr file.
@@ -747,11 +747,11 @@ static void receiveints(int buf[], const int num_of_ints, int num_of_bits,
  | it shouldn't harm in the general case.
  |
  */
- 
+
 int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
 {
   static int oldsize;
-  
+
   int minint[3], maxint[3], mindiff, *lip, diff;
   int lint1, lint2, lint3, oldlint1, oldlint2, oldlint3, smallidx;
   int minidx, maxidx;
@@ -761,12 +761,12 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
   float *lfp, lf;
   int tmp, *thiscoord,  prevcoord[3];
   unsigned int tmpcoord[30];
-  
+
   int bufsize, xdrid, lsize;
   unsigned int bitsize;
   float inv_precision;
   int errval = 1;
-  
+
   /* find out if xdrs is opened for reading or for writing */
   xdrid = 0;
   while (xdridptr[xdrid] != xdrs) {
@@ -777,9 +777,9 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
     }
   }
   if (xdrmodes[xdrid] == 'w') {
-    
+
     /* xdrs is open for writing */
-    
+
     if (xdr_int(xdrs, size) == 0)
       return 0;
     size3 = *size * 3;
@@ -788,34 +788,34 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
      */
     if (*size <= 9 ) {
       return (xdr_vector(xdrs, (char *) fp, size3, sizeof(*fp),
-			 (xdrproc_t)xdr_float));
+                         (xdrproc_t)xdr_float));
     }
-    
+
     xdr_float(xdrs, precision);
     if (ip == NULL) {
       ip = (int *) malloc(size3 * sizeof(*ip));
       if (ip == NULL) {
-	fprintf(stderr,"malloc failed\n");
-	exit(1);
+        fprintf(stderr,"malloc failed\n");
+        exit(1);
       }
       bufsize = (int) (size3 * 1.2);
       buf = (int *) malloc(bufsize * sizeof(*buf));
       if (buf == NULL) {
-	fprintf(stderr,"malloc failed\n");
-	exit(1);
+        fprintf(stderr,"malloc failed\n");
+        exit(1);
       }
       oldsize = *size;
     } else if (*size > oldsize) {
       ip = (int *) realloc(ip, size3 * sizeof(*ip));
       if (ip == NULL) {
-	fprintf(stderr,"malloc failed\n");
-	exit(1);
+        fprintf(stderr,"malloc failed\n");
+        exit(1);
       }
       bufsize = (int) (size3 * 1.2);
       buf = (int *) realloc(buf, bufsize * sizeof(*buf));
       if (buf == NULL) {
-	fprintf(stderr,"malloc failed\n");
-	exit(1);
+        fprintf(stderr,"malloc failed\n");
+        exit(1);
       }
       oldsize = *size;
     }
@@ -831,12 +831,12 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
     while(lfp < fp + size3 ) {
       /* find nearest integer */
       if (*lfp >= 0.0)
-	lf = *lfp * *precision + 0.5;
+        lf = *lfp * *precision + 0.5;
       else
-	lf = *lfp * *precision - 0.5;
+        lf = *lfp * *precision - 0.5;
       if (fabs(lf) > MAXABS) {
-	/* scaling would cause overflow */
-	errval = 0;
+        /* scaling would cause overflow */
+        errval = 0;
       }
       lint1 = (int) lf;
       if (lint1 < minint[0]) minint[0] = lint1;
@@ -844,12 +844,12 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
       *lip++ = lint1;
       lfp++;
       if (*lfp >= 0.0)
-	lf = *lfp * *precision + 0.5;
+        lf = *lfp * *precision + 0.5;
       else
-	lf = *lfp * *precision - 0.5;
+        lf = *lfp * *precision - 0.5;
       if (fabs(lf) > MAXABS) {
-	/* scaling would cause overflow */
-	errval = 0;
+        /* scaling would cause overflow */
+        errval = 0;
       }
       lint2 = (int) lf;
       if (lint2 < minint[1]) minint[1] = lint2;
@@ -857,12 +857,12 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
       *lip++ = lint2;
       lfp++;
       if (*lfp >= 0.0)
-	lf = *lfp * *precision + 0.5;
+        lf = *lfp * *precision + 0.5;
       else
-	lf = *lfp * *precision - 0.5;
+        lf = *lfp * *precision - 0.5;
       if (fabs(lf) > MAXABS) {
-	/* scaling would cause overflow */
-	errval = 0;
+        /* scaling would cause overflow */
+        errval = 0;
       }
       lint3 = (int) lf;
       if (lint3 < minint[2]) minint[2] = lint3;
@@ -871,7 +871,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
       lfp++;
       diff = abs(oldlint1-lint1)+abs(oldlint2-lint2)+abs(oldlint3-lint3);
       if (diff < mindiff && lfp > fp + 3)
-	mindiff = diff;
+        mindiff = diff;
       oldlint1 = lint1;
       oldlint2 = lint2;
       oldlint3 = lint3;
@@ -879,14 +879,14 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
     xdr_int(xdrs, &(minint[0]));
     xdr_int(xdrs, &(minint[1]));
     xdr_int(xdrs, &(minint[2]));
-    
+
     xdr_int(xdrs, &(maxint[0]));
     xdr_int(xdrs, &(maxint[1]));
     xdr_int(xdrs, &(maxint[2]));
-    
+
     if ((float)maxint[0] - (float)minint[0] >= MAXABS ||
-	(float)maxint[1] - (float)minint[1] >= MAXABS ||
-	(float)maxint[2] - (float)minint[2] >= MAXABS) {
+        (float)maxint[1] - (float)minint[1] >= MAXABS ||
+        (float)maxint[2] - (float)minint[2] >= MAXABS) {
       /* turning value in unsigned by subtracting minint
        * would cause overflow
        */
@@ -895,7 +895,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
     sizeint[0] = maxint[0] - minint[0]+1;
     sizeint[1] = maxint[1] - minint[1]+1;
     sizeint[2] = maxint[2] - minint[2]+1;
-    
+
     /* check if one of the sizes is to big to be multiplied */
     if ((sizeint[0] | sizeint[1] | sizeint[2] ) > 0xffffff) {
       bitsizeint[0] = sizeofint(sizeint[0]);
@@ -923,160 +923,160 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
       is_small = 0;
       thiscoord = (int *)(luip) + i * 3;
       if (smallidx < maxidx && i >= 1 &&
-	  abs(thiscoord[0] - prevcoord[0]) < larger &&
-	  abs(thiscoord[1] - prevcoord[1]) < larger &&
-	  abs(thiscoord[2] - prevcoord[2]) < larger) {
-	is_smaller = 1;
+          abs(thiscoord[0] - prevcoord[0]) < larger &&
+          abs(thiscoord[1] - prevcoord[1]) < larger &&
+          abs(thiscoord[2] - prevcoord[2]) < larger) {
+        is_smaller = 1;
       } else if (smallidx > minidx) {
-	is_smaller = -1;
+        is_smaller = -1;
       } else {
-	is_smaller = 0;
+        is_smaller = 0;
       }
       if (i + 1 < *size) {
-	if (abs(thiscoord[0] - thiscoord[3]) < small &&
-	    abs(thiscoord[1] - thiscoord[4]) < small &&
-	    abs(thiscoord[2] - thiscoord[5]) < small) {
-	  /* interchange first with second atom for better
-	   * compression of water molecules
-	   */
-	  tmp = thiscoord[0]; thiscoord[0] = thiscoord[3];
-	  thiscoord[3] = tmp;
-	  tmp = thiscoord[1]; thiscoord[1] = thiscoord[4];
-	  thiscoord[4] = tmp;
-	  tmp = thiscoord[2]; thiscoord[2] = thiscoord[5];
-	  thiscoord[5] = tmp;
-	  is_small = 1;
-	}
-	
+        if (abs(thiscoord[0] - thiscoord[3]) < small &&
+            abs(thiscoord[1] - thiscoord[4]) < small &&
+            abs(thiscoord[2] - thiscoord[5]) < small) {
+          /* interchange first with second atom for better
+           * compression of water molecules
+           */
+          tmp = thiscoord[0]; thiscoord[0] = thiscoord[3];
+          thiscoord[3] = tmp;
+          tmp = thiscoord[1]; thiscoord[1] = thiscoord[4];
+          thiscoord[4] = tmp;
+          tmp = thiscoord[2]; thiscoord[2] = thiscoord[5];
+          thiscoord[5] = tmp;
+          is_small = 1;
+        }
+
       }
       tmpcoord[0] = thiscoord[0] - minint[0];
       tmpcoord[1] = thiscoord[1] - minint[1];
       tmpcoord[2] = thiscoord[2] - minint[2];
       if (bitsize == 0) {
-	sendbits(buf, bitsizeint[0], tmpcoord[0]);
-	sendbits(buf, bitsizeint[1], tmpcoord[1]);
-	sendbits(buf, bitsizeint[2], tmpcoord[2]);
+        sendbits(buf, bitsizeint[0], tmpcoord[0]);
+        sendbits(buf, bitsizeint[1], tmpcoord[1]);
+        sendbits(buf, bitsizeint[2], tmpcoord[2]);
       } else {
-	sendints(buf, 3, bitsize, sizeint, tmpcoord);
+        sendints(buf, 3, bitsize, sizeint, tmpcoord);
       }
       prevcoord[0] = thiscoord[0];
       prevcoord[1] = thiscoord[1];
       prevcoord[2] = thiscoord[2];
       thiscoord = thiscoord + 3;
       i++;
-      
+
       run = 0;
       if (is_small == 0 && is_smaller == -1)
-	is_smaller = 0;
+        is_smaller = 0;
       while (is_small && run < 8*3) {
-	if (is_smaller == -1 && (SQR(thiscoord[0] - prevcoord[0]) +
-				 SQR(thiscoord[1] - prevcoord[1]) +
-				 SQR(thiscoord[2] - prevcoord[2]) >= 
-				 smaller * smaller)) {
-	  is_smaller = 0;
-	}
-	
-	tmpcoord[run++] = thiscoord[0] - prevcoord[0] + small;
-	tmpcoord[run++] = thiscoord[1] - prevcoord[1] + small;
-	tmpcoord[run++] = thiscoord[2] - prevcoord[2] + small;
-	
-	prevcoord[0] = thiscoord[0];
-	prevcoord[1] = thiscoord[1];
-	prevcoord[2] = thiscoord[2];
-	
-	i++;
-	thiscoord = thiscoord + 3;
-	is_small = 0;
-	if (i < *size &&
-	    abs(thiscoord[0] - prevcoord[0]) < small &&
-	    abs(thiscoord[1] - prevcoord[1]) < small &&
-	    abs(thiscoord[2] - prevcoord[2]) < small) {
-	  is_small = 1;
-	}
+        if (is_smaller == -1 && (SQR(thiscoord[0] - prevcoord[0]) +
+                                 SQR(thiscoord[1] - prevcoord[1]) +
+                                 SQR(thiscoord[2] - prevcoord[2]) >=
+                                 smaller * smaller)) {
+          is_smaller = 0;
+        }
+
+        tmpcoord[run++] = thiscoord[0] - prevcoord[0] + small;
+        tmpcoord[run++] = thiscoord[1] - prevcoord[1] + small;
+        tmpcoord[run++] = thiscoord[2] - prevcoord[2] + small;
+
+        prevcoord[0] = thiscoord[0];
+        prevcoord[1] = thiscoord[1];
+        prevcoord[2] = thiscoord[2];
+
+        i++;
+        thiscoord = thiscoord + 3;
+        is_small = 0;
+        if (i < *size &&
+            abs(thiscoord[0] - prevcoord[0]) < small &&
+            abs(thiscoord[1] - prevcoord[1]) < small &&
+            abs(thiscoord[2] - prevcoord[2]) < small) {
+          is_small = 1;
+        }
       }
       if (run != prevrun || is_smaller != 0) {
-	prevrun = run;
-	sendbits(buf, 1, 1); /* flag the change in run-length */
-	sendbits(buf, 5, run+is_smaller+1);
+        prevrun = run;
+        sendbits(buf, 1, 1); /* flag the change in run-length */
+        sendbits(buf, 5, run+is_smaller+1);
       } else {
-	sendbits(buf, 1, 0); /* flag the fact that runlength did not change */
+        sendbits(buf, 1, 0); /* flag the fact that runlength did not change */
       }
       for (k=0; k < run; k+=3) {
-	sendints(buf, 3, smallidx, sizesmall, &tmpcoord[k]);	
+        sendints(buf, 3, smallidx, sizesmall, &tmpcoord[k]);
       }
       if (is_smaller != 0) {
-	smallidx += is_smaller;
-	if (is_smaller < 0) {
-	  small = smaller;
-	  smaller = magicints[smallidx-1] / 2;
-	} else {
-	  smaller = small;
-	  small = magicints[smallidx] / 2;
-	}
-	sizesmall[0] = sizesmall[1] = sizesmall[2] = magicints[smallidx];
+        smallidx += is_smaller;
+        if (is_smaller < 0) {
+          small = smaller;
+          smaller = magicints[smallidx-1] / 2;
+        } else {
+          smaller = small;
+          small = magicints[smallidx] / 2;
+        }
+        sizesmall[0] = sizesmall[1] = sizesmall[2] = magicints[smallidx];
       }
     }
     if (buf[1] != 0) buf[0]++;;
     xdr_int(xdrs, &(buf[0])); /* buf[0] holds the length in bytes */
     return errval * (xdr_opaque(xdrs, (caddr_t)&(buf[3]), (u_int)buf[0]));
   } else {
-    
+
     /* xdrs is open for reading */
-    
-    if (xdr_int(xdrs, &lsize) == 0) 
+
+    if (xdr_int(xdrs, &lsize) == 0)
       return 0;
     if (*size != 0 && lsize != *size) {
       fprintf(stderr, "wrong number of coordinates in xdr3dfcoor; "
-	      "%d arg vs %d in file", *size, lsize);
+              "%d arg vs %d in file", *size, lsize);
     }
     *size = lsize;
     size3 = *size * 3;
     if (*size <= 9) {
       return (xdr_vector(xdrs, (char *) fp, size3, sizeof(*fp),
-			 (xdrproc_t)xdr_float));
+                         (xdrproc_t)xdr_float));
     }
     xdr_float(xdrs, precision);
     if (ip == NULL) {
       ip = (int *) malloc(size3 * sizeof(*ip));
       if (ip == NULL) {
-	fprintf(stderr,"malloc failed\n");
-	exit(1);
+        fprintf(stderr,"malloc failed\n");
+        exit(1);
       }
       bufsize = (int) (size3 * 1.2);
       buf = (int *) malloc(bufsize * sizeof(*buf));
       if (buf == NULL) {
-	fprintf(stderr,"malloc failed\n");
-	exit(1);
+        fprintf(stderr,"malloc failed\n");
+        exit(1);
       }
       oldsize = *size;
     } else if (*size > oldsize) {
       ip = (int *)realloc(ip, size3 * sizeof(*ip));
       if (ip == NULL) {
-	fprintf(stderr,"malloc failed\n");
-	exit(1);
+        fprintf(stderr,"malloc failed\n");
+        exit(1);
       }
       bufsize = (int) (size3 * 1.2);
       buf = (int *)realloc(buf, bufsize * sizeof(*buf));
       if (buf == NULL) {
-	fprintf(stderr,"malloc failed\n");
-	exit(1);
+        fprintf(stderr,"malloc failed\n");
+        exit(1);
       }
       oldsize = *size;
     }
     buf[0] = buf[1] = buf[2] = 0;
-    
+
     xdr_int(xdrs, &(minint[0]));
     xdr_int(xdrs, &(minint[1]));
     xdr_int(xdrs, &(minint[2]));
-    
+
     xdr_int(xdrs, &(maxint[0]));
     xdr_int(xdrs, &(maxint[1]));
     xdr_int(xdrs, &(maxint[2]));
-    
+
     sizeint[0] = maxint[0] - minint[0]+1;
     sizeint[1] = maxint[1] - minint[1]+1;
     sizeint[2] = maxint[2] - minint[2]+1;
-    
+
     /* check if one of the sizes is to big to be multiplied */
     if ((sizeint[0] | sizeint[1] | sizeint[2] ) > 0xffffff) {
       bitsizeint[0] = sizeofint(sizeint[0]);
@@ -1086,7 +1086,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
     } else {
       bitsize = sizeofints(3, sizeint);
     }
-    
+
     xdr_int(xdrs, &smallidx);
     maxidx = MYMIN(LASTIDX, smallidx + 8) ;
     minidx = maxidx - 8; /* often this equal smallidx */
@@ -1094,15 +1094,15 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
     small = magicints[smallidx] / 2;
     sizesmall[0] = sizesmall[1] = sizesmall[2] = magicints[smallidx] ;
     larger = magicints[maxidx];
-    
+
     /* buf[0] holds the length in bytes */
-    
+
     if (xdr_int(xdrs, &(buf[0])) == 0)
       return 0;
     if (xdr_opaque(xdrs, (caddr_t)&(buf[3]), (u_int)buf[0]) == 0)
       return 0;
     buf[0] = buf[1] = buf[2] = 0;
-    
+
     lfp = fp;
     inv_precision = 1.0 / * precision;
     run = 0;
@@ -1110,79 +1110,79 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision)
     lip = ip;
     while ( i < lsize ) {
       thiscoord = (int *)(lip) + i * 3;
-      
+
       if (bitsize == 0) {
-	thiscoord[0] = receivebits(buf, bitsizeint[0]);
-	thiscoord[1] = receivebits(buf, bitsizeint[1]);
-	thiscoord[2] = receivebits(buf, bitsizeint[2]);
+        thiscoord[0] = receivebits(buf, bitsizeint[0]);
+        thiscoord[1] = receivebits(buf, bitsizeint[1]);
+        thiscoord[2] = receivebits(buf, bitsizeint[2]);
       } else {
-	receiveints(buf, 3, bitsize, sizeint, thiscoord);
+        receiveints(buf, 3, bitsize, sizeint, thiscoord);
       }
-      
+
       i++;
       thiscoord[0] += minint[0];
       thiscoord[1] += minint[1];
       thiscoord[2] += minint[2];
-      
+
       prevcoord[0] = thiscoord[0];
       prevcoord[1] = thiscoord[1];
       prevcoord[2] = thiscoord[2];
-      
-      
+
+
       flag = receivebits(buf, 1);
       is_smaller = 0;
       if (flag == 1) {
-	run = receivebits(buf, 5);
-	is_smaller = run % 3;
-	run -= is_smaller;
-	is_smaller--;
+        run = receivebits(buf, 5);
+        is_smaller = run % 3;
+        run -= is_smaller;
+        is_smaller--;
       }
       if (run > 0) {
-	thiscoord += 3;
-	for (k = 0; k < run; k+=3) {
-	  receiveints(buf, 3, smallidx, sizesmall, thiscoord);
-	  i++;
-	  thiscoord[0] += prevcoord[0] - small;
-	  thiscoord[1] += prevcoord[1] - small;
-	  thiscoord[2] += prevcoord[2] - small;
-	  if (k == 0) {
-	    /* interchange first with second atom for better
-	     * compression of water molecules
-	     */
-	    tmp = thiscoord[0]; thiscoord[0] = prevcoord[0];
-	    prevcoord[0] = tmp;
-	    tmp = thiscoord[1]; thiscoord[1] = prevcoord[1];
-	    prevcoord[1] = tmp;
-	    tmp = thiscoord[2]; thiscoord[2] = prevcoord[2];
-	    prevcoord[2] = tmp;
-	    *lfp++ = prevcoord[0] * inv_precision;
-	    *lfp++ = prevcoord[1] * inv_precision;
-	    *lfp++ = prevcoord[2] * inv_precision;
-	  } else {
-	    prevcoord[0] = thiscoord[0];
-	    prevcoord[1] = thiscoord[1];
-	    prevcoord[2] = thiscoord[2];
-	  }
-	  *lfp++ = thiscoord[0] * inv_precision;
-	  *lfp++ = thiscoord[1] * inv_precision;
-	  *lfp++ = thiscoord[2] * inv_precision;
-	}
+        thiscoord += 3;
+        for (k = 0; k < run; k+=3) {
+          receiveints(buf, 3, smallidx, sizesmall, thiscoord);
+          i++;
+          thiscoord[0] += prevcoord[0] - small;
+          thiscoord[1] += prevcoord[1] - small;
+          thiscoord[2] += prevcoord[2] - small;
+          if (k == 0) {
+            /* interchange first with second atom for better
+             * compression of water molecules
+             */
+            tmp = thiscoord[0]; thiscoord[0] = prevcoord[0];
+            prevcoord[0] = tmp;
+            tmp = thiscoord[1]; thiscoord[1] = prevcoord[1];
+            prevcoord[1] = tmp;
+            tmp = thiscoord[2]; thiscoord[2] = prevcoord[2];
+            prevcoord[2] = tmp;
+            *lfp++ = prevcoord[0] * inv_precision;
+            *lfp++ = prevcoord[1] * inv_precision;
+            *lfp++ = prevcoord[2] * inv_precision;
+          } else {
+            prevcoord[0] = thiscoord[0];
+            prevcoord[1] = thiscoord[1];
+            prevcoord[2] = thiscoord[2];
+          }
+          *lfp++ = thiscoord[0] * inv_precision;
+          *lfp++ = thiscoord[1] * inv_precision;
+          *lfp++ = thiscoord[2] * inv_precision;
+        }
       } else {
-	*lfp++ = thiscoord[0] * inv_precision;
-	*lfp++ = thiscoord[1] * inv_precision;
-	*lfp++ = thiscoord[2] * inv_precision;		
+        *lfp++ = thiscoord[0] * inv_precision;
+        *lfp++ = thiscoord[1] * inv_precision;
+        *lfp++ = thiscoord[2] * inv_precision;
       }
       smallidx += is_smaller;
       if (is_smaller < 0) {
-	small = smaller;
-	if (smallidx > FIRSTIDX) {
-	  smaller = magicints[smallidx - 1] /2;
-	} else {
-	  smaller = 0;
-	}
+        small = smaller;
+        if (smallidx > FIRSTIDX) {
+          smaller = magicints[smallidx - 1] /2;
+        } else {
+          smaller = 0;
+        }
       } else if (is_smaller > 0) {
-	smaller = small;
-	small = magicints[smallidx] / 2;
+        smaller = small;
+        small = magicints[smallidx] / 2;
       }
       sizesmall[0] = sizesmall[1] = sizesmall[2] = magicints[smallidx] ;
     }
diff --git a/src/XTC/dump_xtc.h b/src/XTC/dump_xtc.h
index e0a113e09d..8d7d89df46 100644
--- a/src/XTC/dump_xtc.h
+++ b/src/XTC/dump_xtc.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,7 +35,7 @@ class DumpXTC : public Dump {
  public:
   DumpXTC(class LAMMPS *, int, char**);
   ~DumpXTC();
-	
+
  private:
   int natoms,ntotal;
   int nevery_save;
diff --git a/src/XTC/xdr_compat.cpp b/src/XTC/xdr_compat.cpp
index cacedb7705..12bc777b90 100644
--- a/src/XTC/xdr_compat.cpp
+++ b/src/XTC/xdr_compat.cpp
@@ -8,15 +8,15 @@
 /* This file is needed for systems, that do not provide XDR support
  * in their system libraries. It was written for windows, but will
  * most probably work on other platforms too. better make sure you
- * test that the xtc files produced are ok before using it. 
+ * test that the xtc files produced are ok before using it.
  *
- * It is also needed on BG/L and Cray XT3/XT4 as we don't have 
+ * It is also needed on BG/L and Cray XT3/XT4 as we don't have
  * XDR support in the lightweight kernel runtimes either.
  *
- * This file contains the definitions for Sun External Data 
+ * This file contains the definitions for Sun External Data
  * Representation (XDR) headers and routines.
  *
- * Although the rest of LAMPPS is GPL, you can copy and use the XDR 
+ * Although the rest of LAMPPS is GPL, you can copy and use the XDR
  * routines in any way you want as long as you obey Sun's license:
  *
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -45,7 +45,7 @@
  * Sun Microsystems, Inc.
  * 2550 Garcia Avenue
  * Mountain View, California  94043
- */ 
+ */
 
 #ifdef __cplusplus
 extern "C" {
@@ -62,10 +62,10 @@ static xdr_uint32_t xdr_swapbytes(xdr_uint32_t x)
   int i;
   char *px=(char *)&x;
   char *py=(char *)&y;
-  
+
   for(i=0;i<4;i++)
     py[i]=px[3-i];
-  
+
   return y;
 }
 
@@ -132,11 +132,11 @@ xdr_int (XDR *xdrs, int *ip)
 
     case XDR_DECODE:
       if (!xdr_getint32 (xdrs, &l))
-	  {
-	    return FALSE;
-	  }
+          {
+            return FALSE;
+          }
       *ip = (int) l;
-	  
+
     case XDR_FREE:
       return TRUE;
   }
@@ -160,11 +160,11 @@ xdr_u_int (XDR *xdrs, unsigned int *up)
 
     case XDR_DECODE:
       if (!xdr_getuint32 (xdrs, &l))
-	  {
-	    return FALSE;
-	  }
+          {
+            return FALSE;
+          }
       *up = (unsigned int) l;
-	  
+
     case XDR_FREE:
       return TRUE;
   }
@@ -190,9 +190,9 @@ xdr_short (XDR *xdrs, short *sp)
 
     case XDR_DECODE:
       if (!xdr_getint32 (xdrs, &l))
-	{
-	  return FALSE;
-	}
+        {
+          return FALSE;
+        }
       *sp = (short) l;
       return TRUE;
 
@@ -219,10 +219,10 @@ xdr_u_short (XDR *xdrs, unsigned short *usp)
 
     case XDR_DECODE:
       if (!xdr_getuint32 (xdrs, &l))
-	{
-	  return FALSE;
-	}
-	  *usp = (unsigned short) l;
+        {
+          return FALSE;
+        }
+          *usp = (unsigned short) l;
       return TRUE;
 
     case XDR_FREE:
@@ -272,8 +272,8 @@ xdr_u_char (XDR *xdrs, unsigned char *cp)
 bool_t
 xdr_bool (XDR *xdrs, int *bp)
 {
-#define XDR_FALSE	((xdr_int32_t) 0)
-#define XDR_TRUE	((xdr_int32_t) 1)
+#define XDR_FALSE        ((xdr_int32_t) 0)
+#define XDR_TRUE        ((xdr_int32_t) 1)
 
   xdr_int32_t lb;
 
@@ -285,9 +285,9 @@ xdr_bool (XDR *xdrs, int *bp)
 
     case XDR_DECODE:
       if (!xdr_getint32 (xdrs, &lb))
-	{
-	  return FALSE;
-	}
+        {
+          return FALSE;
+        }
       *bp = (lb == XDR_FALSE) ? FALSE : TRUE;
       return TRUE;
 
@@ -329,20 +329,20 @@ xdr_opaque (XDR *xdrs, char *cp, unsigned int cnt)
     {
     case XDR_DECODE:
       if (!xdr_getbytes (xdrs, cp, cnt))
-	{
-	  return FALSE;
-	}
+        {
+          return FALSE;
+        }
       if (rndup == 0)
-	return TRUE;
+        return TRUE;
       return xdr_getbytes (xdrs, (char *)crud, rndup);
 
     case XDR_ENCODE:
       if (!xdr_putbytes (xdrs, cp, cnt))
-	{
-	  return FALSE;
-	}
+        {
+          return FALSE;
+        }
       if (rndup == 0)
-	return TRUE;
+        return TRUE;
       return xdr_putbytes (xdrs, xdr_zero, rndup);
 
     case XDR_FREE:
@@ -363,7 +363,7 @@ xdr_opaque (XDR *xdrs, char *cp, unsigned int cnt)
 bool_t
 xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize)
 {
-  char *sp = *cpp;	/* sp is the actual string pointer */
+  char *sp = *cpp;        /* sp is the actual string pointer */
   unsigned int size = 0;
   unsigned int nodesize = 0;
 
@@ -374,19 +374,19 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize)
     {
     case XDR_FREE:
       if (sp == NULL)
-	{
-	  return TRUE;		/* already free */
-	}
+        {
+          return TRUE;                /* already free */
+        }
       /* fall through... */
     case XDR_ENCODE:
       if (sp == NULL)
-	    return FALSE;
+            return FALSE;
       size = strlen (sp);
       break;
     case XDR_DECODE:
       break;
     }
-  
+
   if (!xdr_u_int (xdrs, &size))
     {
       return FALSE;
@@ -404,16 +404,16 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize)
     {
     case XDR_DECODE:
       if (nodesize == 0)
-	{
-	  return TRUE;
-	}
+        {
+          return TRUE;
+        }
       if (sp == NULL)
-	*cpp = sp = (char *) malloc (nodesize);
+        *cpp = sp = (char *) malloc (nodesize);
       if (sp == NULL)
-	{
-	  (void) fputs ("xdr_string: out of memory\n", stderr);
-	  return FALSE;
-	}
+        {
+          (void) fputs ("xdr_string: out of memory\n", stderr);
+          return FALSE;
+        }
       sp[size] = 0;
       /* fall into ... */
 
@@ -435,28 +435,28 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize)
 bool_t
 xdr_float(XDR *xdrs, float *fp)
 {
-	xdr_int32_t tmp;
-	
-	switch (xdrs->x_op) {
+        xdr_int32_t tmp;
+
+        switch (xdrs->x_op) {
 
-	case XDR_ENCODE:
-		tmp = *(xdr_int32_t *)fp;
-   	    return (xdr_putint32(xdrs, &tmp));
+        case XDR_ENCODE:
+                tmp = *(xdr_int32_t *)fp;
+               return (xdr_putint32(xdrs, &tmp));
 
-		break;
+                break;
 
-	case XDR_DECODE:
-			if (xdr_getint32(xdrs, &tmp)) {
-				*(xdr_int32_t *)fp = tmp;
-				return (TRUE);
-			}
+        case XDR_DECODE:
+                        if (xdr_getint32(xdrs, &tmp)) {
+                                *(xdr_int32_t *)fp = tmp;
+                                return (TRUE);
+                        }
 
-		break;
+                break;
 
-	case XDR_FREE:
-		return (TRUE);
-	}
-	return (FALSE);
+        case XDR_FREE:
+                return (TRUE);
+        }
+        return (FALSE);
 }
 
 
@@ -475,53 +475,53 @@ xdr_double(XDR *xdrs, double *dp)
   if(LSW<0) {
     double x=0.987654321; /* Just a number */
 
-    /* Possible representations in IEEE double precision: 
+    /* Possible representations in IEEE double precision:
      * (S=small endian, B=big endian)
-     * 
+     *
      * Byte order, Word order, Hex
-     *     S           S       b8 56 0e 3c dd 9a ef 3f    
+     *     S           S       b8 56 0e 3c dd 9a ef 3f
      *     B           S       3c 0e 56 b8 3f ef 9a dd
      *     S           B       dd 9a ef 3f b8 56 0e 3c
      *     B           B       3f ef 9a dd 3c 0e 56 b8
-     */ 
-    
+     */
+
     unsigned char ix = *((char *)&x);
-    
+
     if(ix==0xdd || ix==0x3f)
       LSW=1;  /* Big endian word order */
     else if(ix==0xb8 || ix==0x3c)
       LSW=0;  /* Small endian word order */
     else { /* Catch strange errors */
       printf("Error when detecting floating-point word order.\n"
-	     "Do you have a non-IEEE system?\n"
-	     "If possible, use the XDR libraries provided with your system,\n"
-	     "instead of the Gromacs fallback XDR source.\n");
+             "Do you have a non-IEEE system?\n"
+             "If possible, use the XDR libraries provided with your system,\n"
+             "instead of the Gromacs fallback XDR source.\n");
       exit(0);
     }
-  }  
-  
+  }
+
   switch (xdrs->x_op) {
-    
+
   case XDR_ENCODE:
     ip = (int *)dp;
     tmp[0] = ip[!LSW];
     tmp[1] = ip[LSW];
     return (xdr_putint32(xdrs, tmp) &&
- 	      xdr_putint32(xdrs, tmp+1));
- 
+               xdr_putint32(xdrs, tmp+1));
+
     break;
-    
+
   case XDR_DECODE:
     ip = (int *)dp;
     if (xdr_getint32(xdrs, tmp+!LSW) &&
- 	  xdr_getint32(xdrs, tmp+LSW)) {
-	ip[0] = tmp[0];
-	ip[1] = tmp[1];
-	return (TRUE);
+           xdr_getint32(xdrs, tmp+LSW)) {
+        ip[0] = tmp[0];
+        ip[1] = tmp[1];
+        return (TRUE);
     }
 
     break;
-    
+
   case XDR_FREE:
     return (TRUE);
   }
@@ -542,10 +542,10 @@ xdr_double(XDR *xdrs, double *dp)
  * > xdr_elem: routine to XDR each element
  */
 bool_t
-xdr_vector (XDR *xdrs, char *basep, unsigned int nelem, 
+xdr_vector (XDR *xdrs, char *basep, unsigned int nelem,
             unsigned int elemsize, xdrproc_t xdr_elem)
 {
-#define LASTUNSIGNED	((unsigned int)0-1)
+#define LASTUNSIGNED        ((unsigned int)0-1)
   unsigned int i;
   char *elptr;
 
@@ -553,9 +553,9 @@ xdr_vector (XDR *xdrs, char *basep, unsigned int nelem,
   for (i = 0; i < nelem; i++)
     {
       if (!(*xdr_elem) (xdrs, elptr, LASTUNSIGNED))
-	{
-	  return FALSE;
-	}
+        {
+          return FALSE;
+        }
       elptr += elemsize;
     }
   return TRUE;
@@ -580,16 +580,16 @@ static bool_t xdrstdio_putuint32 (XDR *, xdr_uint32_t *);
  */
 static const struct xdr_ops xdrstdio_ops =
 {
-  xdrstdio_getbytes,       	/* deserialize counted bytes */
-  xdrstdio_putbytes,     	/* serialize counted bytes */
-  xdrstdio_getpos,		/* get offset in the stream */
-  xdrstdio_setpos,		/* set offset in the stream */
-  xdrstdio_inline,		/* prime stream for inline macros */
-  xdrstdio_destroy,		/* destroy stream */
-  xdrstdio_getint32,	/* deserialize a int */
-  xdrstdio_putint32,	/* serialize a int */
-  xdrstdio_getuint32,	/* deserialize a int */
-  xdrstdio_putuint32		/* serialize a int */
+  xdrstdio_getbytes,               /* deserialize counted bytes */
+  xdrstdio_putbytes,             /* serialize counted bytes */
+  xdrstdio_getpos,                /* get offset in the stream */
+  xdrstdio_setpos,                /* set offset in the stream */
+  xdrstdio_inline,                /* prime stream for inline macros */
+  xdrstdio_destroy,                /* destroy stream */
+  xdrstdio_getint32,        /* deserialize a int */
+  xdrstdio_putint32,        /* serialize a int */
+  xdrstdio_getuint32,        /* deserialize a int */
+  xdrstdio_putuint32                /* serialize a int */
 };
 
 /*
@@ -625,7 +625,7 @@ static bool_t
 xdrstdio_getbytes (XDR *xdrs, char *addr, unsigned int len)
 {
   if ((len != 0) && (fread (addr, (int) len, 1,
-			    (FILE *) xdrs->x_private) != 1))
+                            (FILE *) xdrs->x_private) != 1))
     return FALSE;
   return TRUE;
 }
@@ -634,7 +634,7 @@ static bool_t
 xdrstdio_putbytes (XDR *xdrs, char *addr, unsigned int len)
 {
   if ((len != 0) && (fwrite (addr, (int) len, 1,
-			     (FILE *) xdrs->x_private) != 1))
+                             (FILE *) xdrs->x_private) != 1))
     return FALSE;
   return TRUE;
 }
@@ -691,30 +691,30 @@ xdrstdio_putint32 (XDR *xdrs, xdr_int32_t *ip)
 static bool_t
 xdrstdio_getuint32 (XDR *xdrs, xdr_uint32_t *ip)
 {
-	xdr_uint32_t mycopy;
-	
-	if (fread ((char *) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1)
-		return FALSE;
-	*ip = xdr_ntohl (mycopy);
-	return TRUE;
+        xdr_uint32_t mycopy;
+
+        if (fread ((char *) &mycopy, 4, 1, (FILE *) xdrs->x_private) != 1)
+                return FALSE;
+        *ip = xdr_ntohl (mycopy);
+        return TRUE;
 }
 
 static bool_t
 xdrstdio_putuint32 (XDR *xdrs, xdr_uint32_t *ip)
 {
-	xdr_uint32_t mycopy = xdr_htonl (*ip);
-	
-	ip = &mycopy;
-	if (fwrite ((char *) ip, 4, 1, (FILE *) xdrs->x_private) != 1)
-		return FALSE;
-	return TRUE;
+        xdr_uint32_t mycopy = xdr_htonl (*ip);
+
+        ip = &mycopy;
+        if (fwrite ((char *) ip, 4, 1, (FILE *) xdrs->x_private) != 1)
+                return FALSE;
+        return TRUE;
 }
 
 #ifdef __cplusplus
 }
 #endif
 
-#else 
+#else
 /* satisfy compilers that do not like to compile empty files. */
 static void i_am_a_dummy_subroutine(void) {
   return;
diff --git a/src/XTC/xdr_compat.h b/src/XTC/xdr_compat.h
index cb9be93991..d1946ef0af 100644
--- a/src/XTC/xdr_compat.h
+++ b/src/XTC/xdr_compat.h
@@ -13,15 +13,15 @@ extern "C" {
  * This file is needed for systems, that do not provide XDR support
  * in their system libraries. It was written for windows, but will
  * most probably work on other platforms too. better make sure you
- * test that the xtc files produced are ok before using it. 
+ * test that the xtc files produced are ok before using it.
  *
  * It is also needed on BG/L, BG/P and Cray XT3/XT4/XT5 as we don't
  * have XDR support in the lightweight kernel runtimes either.
  *
- * This file contains the definitions for Sun External Data 
+ * This file contains the definitions for Sun External Data
  * Representation (XDR) headers and routines.
  *
- * Although the rest of LAMPPS is GPL, you can copy and use the XDR 
+ * Although the rest of LAMPPS is GPL, you can copy and use the XDR
  * routines in any way you want as long as you obey Sun's license:
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  * unrestricted use provided that this legend is included on all tape
@@ -49,12 +49,12 @@ extern "C" {
  * Sun Microsystems, Inc.
  * 2550 Garcia Avenue
  * Mountain View, California  94043
- */ 
+ */
 
 /*
  * Xdr operations.  XDR_ENCODE causes the type to be encoded into the
  * stream.  XDR_DECODE causes the type to be extracted from the stream.
- * XDR_FREE can be used to release the space allocated by an 
+ * XDR_FREE can be used to release the space allocated by an
  * XDR_DECODE request.
  */
 
@@ -65,7 +65,7 @@ typedef char * caddr_t;
 typedef unsigned int u_int;
 #endif
 
-/* 
+/*
  * Aninteger type that is 32 bits wide. Check if int,
  * long or short is 32 bits and die if none of them is :-)
  */
@@ -95,7 +95,7 @@ enum xdr_op {
 #      define  TRUE    (1)
 #endif
 
-#define BYTES_PER_XDR_UNIT	(4)
+#define BYTES_PER_XDR_UNIT        (4)
 /* Macro to round up to units of 4. */
 #define XDR_RNDUP(x)  (((x) + BYTES_PER_XDR_UNIT - 1) & ~(BYTES_PER_XDR_UNIT - 1))
 
@@ -110,36 +110,36 @@ enum xdr_op {
 typedef struct XDR XDR;
 struct XDR
   {
-    enum xdr_op x_op;		/* operation; fast additional param */
+    enum xdr_op x_op;                /* operation; fast additional param */
     struct xdr_ops  *x_ops;
-    char *x_public;		/* users' data */
-    char *x_private;		/* pointer to private data */
-    char *x_base;		/* private used for position info */
-    int x_handy;		/* extra private word */
+    char *x_public;                /* users' data */
+    char *x_private;                /* pointer to private data */
+    char *x_base;                /* private used for position info */
+    int x_handy;                /* extra private word */
   };
 
 struct xdr_ops
       {
-	bool_t (*x_getbytes) (XDR *__xdrs, char *__addr, unsigned int __len);
-	/* get some bytes from " */
-	bool_t (*x_putbytes) (XDR *__xdrs, char *__addr, unsigned int __len);
-	/* put some bytes to " */
-	unsigned int (*x_getpostn) (XDR *__xdrs);
-	/* returns bytes off from beginning */
-	bool_t (*x_setpostn) (XDR *__xdrs, unsigned int __pos);
-	/* lets you reposition the stream */
-	xdr_int32_t *(*x_inline) (XDR *__xdrs, int __len);
-	/* buf quick ptr to buffered data */
-	void (*x_destroy) (XDR *__xdrs);
-	/* free privates of this xdr_stream */
-	bool_t (*x_getint32) (XDR *__xdrs, xdr_int32_t *__ip);
-	/* get a int from underlying stream */
-	bool_t (*x_putint32) (XDR *__xdrs, xdr_int32_t *__ip);
-	/* put a int to " */
-	bool_t (*x_getuint32) (XDR *__xdrs, xdr_uint32_t *__ip);
-	/* get a unsigned int from underlying stream */
-	bool_t (*x_putuint32) (XDR *__xdrs, xdr_uint32_t *__ip);
-	/* put a int to " */
+        bool_t (*x_getbytes) (XDR *__xdrs, char *__addr, unsigned int __len);
+        /* get some bytes from " */
+        bool_t (*x_putbytes) (XDR *__xdrs, char *__addr, unsigned int __len);
+        /* put some bytes to " */
+        unsigned int (*x_getpostn) (XDR *__xdrs);
+        /* returns bytes off from beginning */
+        bool_t (*x_setpostn) (XDR *__xdrs, unsigned int __pos);
+        /* lets you reposition the stream */
+        xdr_int32_t *(*x_inline) (XDR *__xdrs, int __len);
+        /* buf quick ptr to buffered data */
+        void (*x_destroy) (XDR *__xdrs);
+        /* free privates of this xdr_stream */
+        bool_t (*x_getint32) (XDR *__xdrs, xdr_int32_t *__ip);
+        /* get a int from underlying stream */
+        bool_t (*x_putint32) (XDR *__xdrs, xdr_int32_t *__ip);
+        /* put a int to " */
+        bool_t (*x_getuint32) (XDR *__xdrs, xdr_uint32_t *__ip);
+        /* get a unsigned int from underlying stream */
+        bool_t (*x_putuint32) (XDR *__xdrs, xdr_uint32_t *__ip);
+        /* put a int to " */
 };
 
 /*
@@ -177,26 +177,26 @@ typedef bool_t (*xdrproc_t) (XDR *, void *,...);
 #define xdr_putuint32(xdrs, uint32p)                      \
         (*(xdrs)->x_ops->x_putuint32)(xdrs, uint32p)
 
-#define xdr_getbytes(xdrs, addr, len)			\
-	(*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
+#define xdr_getbytes(xdrs, addr, len)                        \
+        (*(xdrs)->x_ops->x_getbytes)(xdrs, addr, len)
 
-#define xdr_putbytes(xdrs, addr, len)			\
-	(*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
+#define xdr_putbytes(xdrs, addr, len)                        \
+        (*(xdrs)->x_ops->x_putbytes)(xdrs, addr, len)
 
-#define xdr_getpos(xdrs)				\
-	(*(xdrs)->x_ops->x_getpostn)(xdrs)
+#define xdr_getpos(xdrs)                                \
+        (*(xdrs)->x_ops->x_getpostn)(xdrs)
 
-#define xdr_setpos(xdrs, pos)				\
-	(*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
+#define xdr_setpos(xdrs, pos)                                \
+        (*(xdrs)->x_ops->x_setpostn)(xdrs, pos)
 
-#define	xdr_inline(xdrs, len)				\
-	(*(xdrs)->x_ops->x_inline)(xdrs, len)
+#define        xdr_inline(xdrs, len)                                \
+        (*(xdrs)->x_ops->x_inline)(xdrs, len)
 
-#define	xdr_destroy(xdrs)					\
-	do {							\
-		if ((xdrs)->x_ops->x_destroy)			\
-			(*(xdrs)->x_ops->x_destroy)(xdrs);	\
-	} while (0)
+#define        xdr_destroy(xdrs)                                        \
+        do {                                                        \
+                if ((xdrs)->x_ops->x_destroy)                        \
+                        (*(xdrs)->x_ops->x_destroy)(xdrs);        \
+        } while (0)
 
 
 extern bool_t xdr_int (XDR *__xdrs, int *__ip);
@@ -209,7 +209,7 @@ extern bool_t xdr_string (XDR *__xdrs, char **__cpp, unsigned int __maxsize);
 extern bool_t xdr_char (XDR *__xdrs, char *__cp);
 extern bool_t xdr_u_char (XDR *__xdrs, unsigned char *__cp);
 extern bool_t xdr_vector (XDR *__xdrs, char *__basep, unsigned int __nelem,
-			  unsigned int __elemsize, xdrproc_t __xdr_elem);
+                          unsigned int __elemsize, xdrproc_t __xdr_elem);
 extern bool_t xdr_float (XDR *__xdrs, float *__fp);
 extern bool_t xdr_double (XDR *__xdrs, double *__dp);
 extern void xdrstdio_create (XDR *__xdrs, FILE *__file, enum xdr_op __xop);
@@ -223,4 +223,3 @@ extern void xdr_free (xdrproc_t __proc, char *__objp);
 
 
 #endif /* XDR_COMPAT_H */
-
diff --git a/src/accelerator_cuda.h b/src/accelerator_cuda.h
index 307a045cae..1f4f863533 100644
--- a/src/accelerator_cuda.h
+++ b/src/accelerator_cuda.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -41,7 +41,7 @@ class Cuda {
  public:
   int cuda_exists;
   int oncpu;
-  
+
   Cuda(class LAMMPS *) {cuda_exists = 0;}
   ~Cuda() {}
   void accelerator(int, char **) {}
@@ -73,7 +73,7 @@ class ModifyCuda : public Modify {
  ModifyCuda(class LAMMPS *lmp) : Modify(lmp) {}
   ~ModifyCuda() {}
 };
- 
+
 class VerletCuda : public Verlet {
  public:
  VerletCuda(class LAMMPS *lmp, int narg, char **arg) : Verlet(lmp,narg,arg) {}
diff --git a/src/accelerator_omp.h b/src/accelerator_omp.h
index 5ad4277b93..89db35cae2 100644
--- a/src/accelerator_omp.h
+++ b/src/accelerator_omp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/angle.cpp b/src/angle.cpp
index 526bfa646e..9d9ee2fc91 100644
--- a/src/angle.cpp
+++ b/src/angle.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -77,7 +77,7 @@ void Angle::ev_setup(int eflag, int vflag)
   vflag_either = vflag;
   vflag_global = vflag % 4;
   vflag_atom = vflag / 4;
-  
+
   // reallocate per-atom arrays if necessary
 
   if (eflag_atom && atom->nmax > maxeatom) {
@@ -120,9 +120,9 @@ void Angle::ev_setup(int eflag, int vflag)
 ------------------------------------------------------------------------- */
 
 void Angle::ev_tally(int i, int j, int k, int nlocal, int newton_bond,
-		     double eangle, double *f1, double *f3,
-		     double delx1, double dely1, double delz1,
-		     double delx2, double dely2, double delz2)
+                     double eangle, double *f1, double *f3,
+                     double delx1, double dely1, double delz1,
+                     double delx2, double dely2, double delz2)
 {
   double eanglethird,v[6];
 
@@ -130,10 +130,10 @@ void Angle::ev_tally(int i, int j, int k, int nlocal, int newton_bond,
     if (eflag_global) {
       if (newton_bond) energy += eangle;
       else {
-	eanglethird = THIRD*eangle;
-	if (i < nlocal) energy += eanglethird;
-	if (j < nlocal) energy += eanglethird;
-	if (k < nlocal) energy += eanglethird;
+        eanglethird = THIRD*eangle;
+        if (i < nlocal) energy += eanglethird;
+        if (j < nlocal) energy += eanglethird;
+        if (k < nlocal) energy += eanglethird;
       }
     }
     if (eflag_atom) {
@@ -154,64 +154,64 @@ void Angle::ev_tally(int i, int j, int k, int nlocal, int newton_bond,
 
     if (vflag_global) {
       if (newton_bond) {
-	virial[0] += v[0];
-	virial[1] += v[1];
-	virial[2] += v[2];
-	virial[3] += v[3];
-	virial[4] += v[4];
-	virial[5] += v[5];
+        virial[0] += v[0];
+        virial[1] += v[1];
+        virial[2] += v[2];
+        virial[3] += v[3];
+        virial[4] += v[4];
+        virial[5] += v[5];
       } else {
-	if (i < nlocal) {
-	  virial[0] += THIRD*v[0];
-	  virial[1] += THIRD*v[1];
-	  virial[2] += THIRD*v[2];
-	  virial[3] += THIRD*v[3];
-	  virial[4] += THIRD*v[4];
-	  virial[5] += THIRD*v[5];
-	}
-	if (j < nlocal) {
-	  virial[0] += THIRD*v[0];
-	  virial[1] += THIRD*v[1];
-	  virial[2] += THIRD*v[2];
-	  virial[3] += THIRD*v[3];
-	  virial[4] += THIRD*v[4];
-	  virial[5] += THIRD*v[5];
-	}
-	if (k < nlocal) {
-	  virial[0] += THIRD*v[0];
-	  virial[1] += THIRD*v[1];
-	  virial[2] += THIRD*v[2];
-	  virial[3] += THIRD*v[3];
-	  virial[4] += THIRD*v[4];
-	  virial[5] += THIRD*v[5];
-	}
+        if (i < nlocal) {
+          virial[0] += THIRD*v[0];
+          virial[1] += THIRD*v[1];
+          virial[2] += THIRD*v[2];
+          virial[3] += THIRD*v[3];
+          virial[4] += THIRD*v[4];
+          virial[5] += THIRD*v[5];
+        }
+        if (j < nlocal) {
+          virial[0] += THIRD*v[0];
+          virial[1] += THIRD*v[1];
+          virial[2] += THIRD*v[2];
+          virial[3] += THIRD*v[3];
+          virial[4] += THIRD*v[4];
+          virial[5] += THIRD*v[5];
+        }
+        if (k < nlocal) {
+          virial[0] += THIRD*v[0];
+          virial[1] += THIRD*v[1];
+          virial[2] += THIRD*v[2];
+          virial[3] += THIRD*v[3];
+          virial[4] += THIRD*v[4];
+          virial[5] += THIRD*v[5];
+        }
       }
     }
 
     if (vflag_atom) {
       if (newton_bond || i < nlocal) {
-	vatom[i][0] += THIRD*v[0];
-	vatom[i][1] += THIRD*v[1];
-	vatom[i][2] += THIRD*v[2];
-	vatom[i][3] += THIRD*v[3];
-	vatom[i][4] += THIRD*v[4];
-	vatom[i][5] += THIRD*v[5];
+        vatom[i][0] += THIRD*v[0];
+        vatom[i][1] += THIRD*v[1];
+        vatom[i][2] += THIRD*v[2];
+        vatom[i][3] += THIRD*v[3];
+        vatom[i][4] += THIRD*v[4];
+        vatom[i][5] += THIRD*v[5];
       }
       if (newton_bond || j < nlocal) {
-	vatom[j][0] += THIRD*v[0];
-	vatom[j][1] += THIRD*v[1];
-	vatom[j][2] += THIRD*v[2];
-	vatom[j][3] += THIRD*v[3];
-	vatom[j][4] += THIRD*v[4];
-	vatom[j][5] += THIRD*v[5];
+        vatom[j][0] += THIRD*v[0];
+        vatom[j][1] += THIRD*v[1];
+        vatom[j][2] += THIRD*v[2];
+        vatom[j][3] += THIRD*v[3];
+        vatom[j][4] += THIRD*v[4];
+        vatom[j][5] += THIRD*v[5];
       }
       if (newton_bond || k < nlocal) {
-	vatom[k][0] += THIRD*v[0];
-	vatom[k][1] += THIRD*v[1];
-	vatom[k][2] += THIRD*v[2];
-	vatom[k][3] += THIRD*v[3];
-	vatom[k][4] += THIRD*v[4];
-	vatom[k][5] += THIRD*v[5];
+        vatom[k][0] += THIRD*v[0];
+        vatom[k][1] += THIRD*v[1];
+        vatom[k][2] += THIRD*v[2];
+        vatom[k][3] += THIRD*v[3];
+        vatom[k][4] += THIRD*v[4];
+        vatom[k][5] += THIRD*v[5];
       }
     }
   }
diff --git a/src/angle.h b/src/angle.h
index a94846b0e8..e46ae2f470 100644
--- a/src/angle.h
+++ b/src/angle.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -52,7 +52,7 @@ class Angle : protected Pointers {
 
   void ev_setup(int, int);
   void ev_tally(int, int, int, int, int, double, double *, double *,
-		double, double, double, double, double, double);
+                double, double, double, double, double, double);
 };
 
 }
diff --git a/src/atom.cpp b/src/atom.cpp
index 4a68a7e0f6..7d4564359c 100644
--- a/src/atom.cpp
+++ b/src/atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -135,14 +135,14 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
   map_style = 0;
   map_tag_max = 0;
   map_nhash = 0;
-  
+
   nprimes = 38;
   primes = new int[nprimes];
   int plist[] = {5041,10007,20011,30011,40009,50021,60013,70001,80021,
-		 90001,100003,110017,120011,130003,140009,150001,160001,
-		 170003,180001,190027,200003,210011,220009,230003,240007,
-		 250007,260003,270001,280001,290011,300007,310019,320009,
-		 330017,340007,350003,362881,3628801};
+                 90001,100003,110017,120011,130003,140009,150001,160001,
+                 170003,180001,190027,200003,210011,220009,230003,240007,
+                 250007,260003,270001,280001,290011,300007,310019,320009,
+                 330017,340007,350003,362881,3628801};
   for (int i = 0; i < nprimes; i++) primes[i] = plist[i];
 
   // default atom style = atomic
@@ -264,7 +264,7 @@ void Atom::create_avec(const char *style, int narg, char **arg, char *suffix)
 
   sphere_flag = ellipsoid_flag = line_flag = tri_flag = 0;
   peri_flag = electron_flag = 0;
-    
+
   molecule_flag = q_flag = mu_flag = 0;
   rmass_flag = radius_flag = omega_flag = torque_flag = angmom_flag = 0;
   vfrac_flag = spin_flag = eradius_flag = ervel_flag = erforce_flag = 0;
@@ -295,7 +295,7 @@ void Atom::create_avec(const char *style, int narg, char **arg, char *suffix)
 ------------------------------------------------------------------------- */
 
 AtomVec *Atom::new_avec(const char *style, int narg, char **arg,
-			char *suffix, int &sflag)
+                        char *suffix, int &sflag)
 {
   if (suffix && lmp->suffix_enable) {
     sflag = 1;
@@ -379,7 +379,7 @@ AtomVec *Atom::style_match(const char *style)
     AtomVecHybrid *avec_hybrid = (AtomVecHybrid *) avec;
     for (int i = 0; i < avec_hybrid->nstyles; i++)
       if (strcmp(avec_hybrid->keywords[i],style) == 0)
-	return avec_hybrid->styles[i];
+        return avec_hybrid->styles[i];
   }
   return NULL;
 }
@@ -401,20 +401,20 @@ void Atom::modify_params(int narg, char **arg)
       if (strcmp(arg[iarg+1],"array") == 0) map_style = 1;
       else if (strcmp(arg[iarg+1],"hash") == 0) map_style = 2;
       else error->all(FLERR,"Illegal atom_modify command");
-      if (domain->box_exist) 
-	error->all(FLERR,
-		   "Atom_modify map command after simulation box is defined");
+      if (domain->box_exist)
+        error->all(FLERR,
+                   "Atom_modify map command after simulation box is defined");
       iarg += 2;
     } else if (strcmp(arg[iarg],"first") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
       if (strcmp(arg[iarg+1],"all") == 0) {
-	delete [] firstgroupname;
-	firstgroupname = NULL;
+        delete [] firstgroupname;
+        firstgroupname = NULL;
       } else {
-	int n = strlen(arg[iarg+1]) + 1;
-	firstgroupname = new char[n];
-	strcpy(firstgroupname,arg[iarg+1]);
-	sortfreq = 0;
+        int n = strlen(arg[iarg+1]) + 1;
+        firstgroupname = new char[n];
+        strcpy(firstgroupname,arg[iarg+1]);
+        sortfreq = 0;
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"sort") == 0) {
@@ -422,10 +422,10 @@ void Atom::modify_params(int narg, char **arg)
       sortfreq = atoi(arg[iarg+1]);
       userbinsize = atof(arg[iarg+2]);
       if (sortfreq < 0 || userbinsize < 0.0)
-	error->all(FLERR,"Illegal atom_modify command");
-      if (sortfreq >= 0 && firstgroupname) 
-	error->all(FLERR,"Atom_modify sort and first options "
-		   "cannot be used together");
+        error->all(FLERR,"Illegal atom_modify command");
+      if (sortfreq >= 0 && firstgroupname)
+        error->all(FLERR,"Atom_modify sort and first options "
+                   "cannot be used together");
       iarg += 3;
     } else error->all(FLERR,"Illegal atom_modify command");
   }
@@ -515,18 +515,18 @@ void Atom::map_clear()
       ibucket = global % map_nbucket;
       index = map_bucket[ibucket];
       while (index > -1) {
-	if (map_hash[index].global == global) break;
-	previous = index;
-	index = map_hash[index].next;
+        if (map_hash[index].global == global) break;
+        previous = index;
+        index = map_hash[index].next;
       }
       if (index == -1) continue;
 
       // delete the hash entry and add it to free list
       // special logic if entry is 1st in the bucket
-    
+
       if (previous == -1) map_bucket[ibucket] = map_hash[index].next;
       else map_hash[previous].next = map_hash[index].next;
-    
+
       map_hash[index].next = map_free;
       map_free = index;
       map_nused--;
@@ -538,7 +538,7 @@ void Atom::map_clear()
    set global -> local map for all of my own and ghost atoms
    loop in reverse order so that nearby images take precedence over far ones
      and owned atoms take precedence over images
-   this enables valid lookups of bond topology atoms 
+   this enables valid lookups of bond topology atoms
    for hash table option:
      if hash table too small, re-init
      global ID may already be in table if image atom was set
@@ -565,13 +565,13 @@ void Atom::map_set()
       ibucket = global % map_nbucket;
       index = map_bucket[ibucket];
       while (index > -1) {
-	if (map_hash[index].global == global) break;
-	previous = index;
-	index = map_hash[index].next;
+        if (map_hash[index].global == global) break;
+        previous = index;
+        index = map_hash[index].next;
       }
       if (index > -1) {
-	map_hash[index].local = i;
-	continue;
+        map_hash[index].local = i;
+        continue;
       }
 
       // take one entry from free list
@@ -603,7 +603,7 @@ void Atom::map_one(int global, int local)
   else {
     // search for key
     // if found it, just overwrite local value with index
-    
+
     int previous = -1;
     int ibucket = global % map_nbucket;
     int index = map_bucket[ibucket];
@@ -616,11 +616,11 @@ void Atom::map_one(int global, int local)
       map_hash[index].local = local;
       return;
     }
-    
+
     // take one entry from free list
     // add the new global/local pair as entry at end of bucket list
     // special logic if this entry is 1st in bucket
-    
+
     index = map_free;
     map_free = map_hash[map_free].next;
     if (previous == -1) map_bucket[ibucket] = index;
@@ -708,7 +708,7 @@ int Atom::tag_consecutive()
 {
   int idmin = MAXTAGINT;
   int idmax = 0;
-  
+
   for (int i = 0; i < nlocal; i++) {
     idmin = MIN(idmin,tag[i]);
     idmax = MAX(idmax,tag[i]);
@@ -826,18 +826,18 @@ void Atom::data_atoms(int n, char *buf)
     next = strchr(buf,'\n');
 
     values[0] = strtok(buf," \t\n\r\f");
-    if (values[0] == NULL) 
+    if (values[0] == NULL)
       error->all(FLERR,"Incorrect atom format in data file");
     for (m = 1; m < nwords; m++) {
       values[m] = strtok(NULL," \t\n\r\f");
-      if (values[m] == NULL) 
-	error->all(FLERR,"Incorrect atom format in data file");
+      if (values[m] == NULL)
+        error->all(FLERR,"Incorrect atom format in data file");
     }
 
     if (imageflag)
       imagedata = ((atoi(values[iptr+2]) + 512 & 1023) << 20) |
-	((atoi(values[iptr+1]) + 512 & 1023) << 10) |
-	(atoi(values[iptr]) + 512 & 1023);
+        ((atoi(values[iptr+1]) + 512 & 1023) << 10) |
+        (atoi(values[iptr]) + 512 & 1023);
     else imagedata = (512 << 20) | (512 << 10) | 512;
 
     xdata[0] = atof(values[xptr]);
@@ -850,8 +850,8 @@ void Atom::data_atoms(int n, char *buf)
     } else coord = xdata;
 
     if (coord[0] >= sublo[0] && coord[0] < subhi[0] &&
-	coord[1] >= sublo[1] && coord[1] < subhi[1] &&
-	coord[2] >= sublo[2] && coord[2] < subhi[2])
+        coord[1] >= sublo[1] && coord[1] < subhi[1] &&
+        coord[2] >= sublo[2] && coord[2] < subhi[2])
       avec->data_atom(xdata,imagedata,values);
 
     buf = next + 1;
@@ -964,8 +964,8 @@ void Atom::data_bonds(int n, char *buf)
     next = strchr(buf,'\n');
     *next = '\0';
     sscanf(buf,"%d %d %d %d",&tmp,&itype,&atom1,&atom2);
-    if (atom1 <= 0 || atom1 > map_tag_max || 
-	atom2 <= 0 || atom2 > map_tag_max)
+    if (atom1 <= 0 || atom1 > map_tag_max ||
+        atom2 <= 0 || atom2 > map_tag_max)
       error->one(FLERR,"Invalid atom ID in Bonds section of data file");
     if (itype <= 0 || itype > nbondtypes)
       error->one(FLERR,"Invalid bond type in Bonds section of data file");
@@ -976,9 +976,9 @@ void Atom::data_bonds(int n, char *buf)
     }
     if (newton_bond == 0) {
       if ((m = map(atom2)) >= 0) {
-	bond_type[m][num_bond[m]] = itype;
-	bond_atom[m][num_bond[m]] = atom1;
-	num_bond[m]++;
+        bond_type[m][num_bond[m]] = itype;
+        bond_atom[m][num_bond[m]] = atom1;
+        num_bond[m]++;
       }
     }
     buf = next + 1;
@@ -999,9 +999,9 @@ void Atom::data_angles(int n, char *buf)
     next = strchr(buf,'\n');
     *next = '\0';
     sscanf(buf,"%d %d %d %d %d",&tmp,&itype,&atom1,&atom2,&atom3);
-    if (atom1 <= 0 || atom1 > map_tag_max || 
-	atom2 <= 0 || atom2 > map_tag_max || 
-	atom3 <= 0 || atom3 > map_tag_max)
+    if (atom1 <= 0 || atom1 > map_tag_max ||
+        atom2 <= 0 || atom2 > map_tag_max ||
+        atom3 <= 0 || atom3 > map_tag_max)
       error->one(FLERR,"Invalid atom ID in Angles section of data file");
     if (itype <= 0 || itype > nangletypes)
       error->one(FLERR,"Invalid angle type in Angles section of data file");
@@ -1014,18 +1014,18 @@ void Atom::data_angles(int n, char *buf)
     }
     if (newton_bond == 0) {
       if ((m = map(atom1)) >= 0) {
-	angle_type[m][num_angle[m]] = itype;
-	angle_atom1[m][num_angle[m]] = atom1;
-	angle_atom2[m][num_angle[m]] = atom2;
-	angle_atom3[m][num_angle[m]] = atom3;
-	num_angle[m]++;
+        angle_type[m][num_angle[m]] = itype;
+        angle_atom1[m][num_angle[m]] = atom1;
+        angle_atom2[m][num_angle[m]] = atom2;
+        angle_atom3[m][num_angle[m]] = atom3;
+        num_angle[m]++;
       }
       if ((m = map(atom3)) >= 0) {
-	angle_type[m][num_angle[m]] = itype;
-	angle_atom1[m][num_angle[m]] = atom1;
-	angle_atom2[m][num_angle[m]] = atom2;
-	angle_atom3[m][num_angle[m]] = atom3;
-	num_angle[m]++;
+        angle_type[m][num_angle[m]] = itype;
+        angle_atom1[m][num_angle[m]] = atom1;
+        angle_atom2[m][num_angle[m]] = atom2;
+        angle_atom3[m][num_angle[m]] = atom3;
+        num_angle[m]++;
       }
     }
     buf = next + 1;
@@ -1046,14 +1046,14 @@ void Atom::data_dihedrals(int n, char *buf)
     next = strchr(buf,'\n');
     *next = '\0';
     sscanf(buf,"%d %d %d %d %d %d",&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
-    if (atom1 <= 0 || atom1 > map_tag_max || 
-	atom2 <= 0 || atom2 > map_tag_max || 
-	atom3 <= 0 || atom3 > map_tag_max || 
-	atom4 <= 0 || atom4 > map_tag_max)
+    if (atom1 <= 0 || atom1 > map_tag_max ||
+        atom2 <= 0 || atom2 > map_tag_max ||
+        atom3 <= 0 || atom3 > map_tag_max ||
+        atom4 <= 0 || atom4 > map_tag_max)
       error->one(FLERR,"Invalid atom ID in Dihedrals section of data file");
     if (itype <= 0 || itype > ndihedraltypes)
       error->one(FLERR,
-		 "Invalid dihedral type in Dihedrals section of data file");
+                 "Invalid dihedral type in Dihedrals section of data file");
     if ((m = map(atom2)) >= 0) {
       dihedral_type[m][num_dihedral[m]] = itype;
       dihedral_atom1[m][num_dihedral[m]] = atom1;
@@ -1064,28 +1064,28 @@ void Atom::data_dihedrals(int n, char *buf)
     }
     if (newton_bond == 0) {
       if ((m = map(atom1)) >= 0) {
-	dihedral_type[m][num_dihedral[m]] = itype;
-	dihedral_atom1[m][num_dihedral[m]] = atom1;
-	dihedral_atom2[m][num_dihedral[m]] = atom2;
-	dihedral_atom3[m][num_dihedral[m]] = atom3;
-	dihedral_atom4[m][num_dihedral[m]] = atom4;
-	num_dihedral[m]++;
+        dihedral_type[m][num_dihedral[m]] = itype;
+        dihedral_atom1[m][num_dihedral[m]] = atom1;
+        dihedral_atom2[m][num_dihedral[m]] = atom2;
+        dihedral_atom3[m][num_dihedral[m]] = atom3;
+        dihedral_atom4[m][num_dihedral[m]] = atom4;
+        num_dihedral[m]++;
       }
       if ((m = map(atom3)) >= 0) {
-	dihedral_type[m][num_dihedral[m]] = itype;
-	dihedral_atom1[m][num_dihedral[m]] = atom1;
-	dihedral_atom2[m][num_dihedral[m]] = atom2;
-	dihedral_atom3[m][num_dihedral[m]] = atom3;
-	dihedral_atom4[m][num_dihedral[m]] = atom4;
-	num_dihedral[m]++;
+        dihedral_type[m][num_dihedral[m]] = itype;
+        dihedral_atom1[m][num_dihedral[m]] = atom1;
+        dihedral_atom2[m][num_dihedral[m]] = atom2;
+        dihedral_atom3[m][num_dihedral[m]] = atom3;
+        dihedral_atom4[m][num_dihedral[m]] = atom4;
+        num_dihedral[m]++;
       }
       if ((m = map(atom4)) >= 0) {
-	dihedral_type[m][num_dihedral[m]] = itype;
-	dihedral_atom1[m][num_dihedral[m]] = atom1;
-	dihedral_atom2[m][num_dihedral[m]] = atom2;
-	dihedral_atom3[m][num_dihedral[m]] = atom3;
-	dihedral_atom4[m][num_dihedral[m]] = atom4;
-	num_dihedral[m]++;
+        dihedral_type[m][num_dihedral[m]] = itype;
+        dihedral_atom1[m][num_dihedral[m]] = atom1;
+        dihedral_atom2[m][num_dihedral[m]] = atom2;
+        dihedral_atom3[m][num_dihedral[m]] = atom3;
+        dihedral_atom4[m][num_dihedral[m]] = atom4;
+        num_dihedral[m]++;
       }
     }
     buf = next + 1;
@@ -1106,14 +1106,14 @@ void Atom::data_impropers(int n, char *buf)
     next = strchr(buf,'\n');
     *next = '\0';
     sscanf(buf,"%d %d %d %d %d %d",&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
-    if (atom1 <= 0 || atom1 > map_tag_max || 
-	atom2 <= 0 || atom2 > map_tag_max || 
-	atom3 <= 0 || atom3 > map_tag_max || 
-	atom4 <= 0 || atom4 > map_tag_max)
+    if (atom1 <= 0 || atom1 > map_tag_max ||
+        atom2 <= 0 || atom2 > map_tag_max ||
+        atom3 <= 0 || atom3 > map_tag_max ||
+        atom4 <= 0 || atom4 > map_tag_max)
       error->one(FLERR,"Invalid atom ID in Impropers section of data file");
     if (itype <= 0 || itype > nimpropertypes)
       error->one(FLERR,
-		 "Invalid improper type in Impropers section of data file");
+                 "Invalid improper type in Impropers section of data file");
     if ((m = map(atom2)) >= 0) {
       improper_type[m][num_improper[m]] = itype;
       improper_atom1[m][num_improper[m]] = atom1;
@@ -1124,28 +1124,28 @@ void Atom::data_impropers(int n, char *buf)
     }
     if (newton_bond == 0) {
       if ((m = map(atom1)) >= 0) {
-	improper_type[m][num_improper[m]] = itype;
-	improper_atom1[m][num_improper[m]] = atom1;
-	improper_atom2[m][num_improper[m]] = atom2;
-	improper_atom3[m][num_improper[m]] = atom3;
-	improper_atom4[m][num_improper[m]] = atom4;
-	num_improper[m]++;
+        improper_type[m][num_improper[m]] = itype;
+        improper_atom1[m][num_improper[m]] = atom1;
+        improper_atom2[m][num_improper[m]] = atom2;
+        improper_atom3[m][num_improper[m]] = atom3;
+        improper_atom4[m][num_improper[m]] = atom4;
+        num_improper[m]++;
       }
       if ((m = map(atom3)) >= 0) {
-	improper_type[m][num_improper[m]] = itype;
-	improper_atom1[m][num_improper[m]] = atom1;
-	improper_atom2[m][num_improper[m]] = atom2;
-	improper_atom3[m][num_improper[m]] = atom3;
-	improper_atom4[m][num_improper[m]] = atom4;
-	num_improper[m]++;
+        improper_type[m][num_improper[m]] = itype;
+        improper_atom1[m][num_improper[m]] = atom1;
+        improper_atom2[m][num_improper[m]] = atom2;
+        improper_atom3[m][num_improper[m]] = atom3;
+        improper_atom4[m][num_improper[m]] = atom4;
+        num_improper[m]++;
       }
       if ((m = map(atom4)) >= 0) {
-	improper_type[m][num_improper[m]] = itype;
-	improper_atom1[m][num_improper[m]] = atom1;
-	improper_atom2[m][num_improper[m]] = atom2;
-	improper_atom3[m][num_improper[m]] = atom3;
-	improper_atom4[m][num_improper[m]] = atom4;
-	num_improper[m]++;
+        improper_type[m][num_improper[m]] = itype;
+        improper_atom1[m][num_improper[m]] = atom1;
+        improper_atom2[m][num_improper[m]] = atom2;
+        improper_atom3[m][num_improper[m]] = atom3;
+        improper_atom4[m][num_improper[m]] = atom4;
+        num_improper[m]++;
       }
     }
     buf = next + 1;
@@ -1180,7 +1180,7 @@ void Atom::set_mass(const char *str)
   int n = sscanf(str,"%d %lg",&itype,&mass_one);
   if (n != 2) error->all(FLERR,"Invalid mass line in data file");
 
-  if (itype < 1 || itype > ntypes) 
+  if (itype < 1 || itype > ntypes)
     error->all(FLERR,"Invalid type for mass set");
 
   mass[itype] = mass_one;
@@ -1197,7 +1197,7 @@ void Atom::set_mass(const char *str)
 void Atom::set_mass(int itype, double value)
 {
   if (mass == NULL) error->all(FLERR,"Cannot set mass for this atom style");
-  if (itype < 1 || itype > ntypes) 
+  if (itype < 1 || itype > ntypes)
     error->all(FLERR,"Invalid type for mass set");
 
   mass[itype] = value;
@@ -1281,7 +1281,7 @@ int Atom::radius_consistency(int itype, double &rad)
 ------------------------------------------------------------------------- */
 
 int Atom::shape_consistency(int itype,
-			    double &shapex, double &shapey, double &shapez)
+                            double &shapex, double &shapey, double &shapez)
 {
   double zero[3] = {0.0, 0.0, 0.0};
   double one[3] = {-1.0, -1.0, -1.0};
@@ -1435,7 +1435,7 @@ void Atom::sort()
     while (permute[empty] != i) {
       avec->copy(permute[empty],empty,0);
       empty = current[empty] = permute[empty];
-    }      
+    }
     avec->copy(nlocal,empty,0);
     current[empty] = permute[empty];
   }
@@ -1471,13 +1471,13 @@ void Atom::setup_sort_bins()
   else if (!lmp->cuda) binsize = 0.5 * neighbor->cutneighmax;
   else {
     if (domain->dimension == 3) {
-      double vol = (domain->boxhi[0]-domain->boxlo[0]) * 
-	(domain->boxhi[1]-domain->boxlo[1]) * 
-	(domain->boxhi[2]-domain->boxlo[2]);
+      double vol = (domain->boxhi[0]-domain->boxlo[0]) *
+        (domain->boxhi[1]-domain->boxlo[1]) *
+        (domain->boxhi[2]-domain->boxlo[2]);
       binsize = pow(1.0*CUDA_CHUNK/natoms*vol,1.0/3.0);
     } else {
-      double area = (domain->boxhi[0]-domain->boxlo[0]) * 
-	(domain->boxhi[1]-domain->boxlo[1]);
+      double area = (domain->boxhi[0]-domain->boxlo[0]) *
+        (domain->boxhi[1]-domain->boxlo[1]);
       binsize = pow(1.0*CUDA_CHUNK/natoms*area,1.0/2.0);
     }
   }
@@ -1487,7 +1487,7 @@ void Atom::setup_sort_bins()
 
   // nbin xyz = local bins
   // bbox lo/hi = bounding box of my sub-domain
- 
+
   if (domain->triclinic)
     domain->bbox(domain->sublo_lamda,domain->subhi_lamda,bboxlo,bboxhi);
   else {
@@ -1498,12 +1498,12 @@ void Atom::setup_sort_bins()
     bboxhi[1] = domain->subhi[1];
     bboxhi[2] = domain->subhi[2];
   }
-  
+
   nbinx = static_cast<int> ((bboxhi[0]-bboxlo[0]) * bininv);
   nbiny = static_cast<int> ((bboxhi[1]-bboxlo[1]) * bininv);
   nbinz = static_cast<int> ((bboxhi[2]-bboxlo[2]) * bininv);
   if (domain->dimension == 2) nbinz = 1;
-  
+
   if (nbinx == 0) nbinx = 1;
   if (nbiny == 0) nbiny = 1;
   if (nbinz == 0) nbinz = 1;
@@ -1512,7 +1512,7 @@ void Atom::setup_sort_bins()
   bininvy = nbiny / (bboxhi[1]-bboxlo[1]);
   bininvz = nbinz / (bboxhi[2]-bboxlo[2]);
 
-  if (1.0*nbinx*nbiny*nbinz > INT_MAX) 
+  if (1.0*nbinx*nbiny*nbinz > INT_MAX)
     error->one(FLERR,"Too many atom sorting bins");
 
   nbins = nbinx*nbiny*nbinz;
@@ -1670,7 +1670,7 @@ int Atom::memcheck(const char *str)
   strcpy(padded," ");
   strcat(padded,str);
   strcat(padded," ");
-  
+
   if (strstr(memstr,padded)) {
     delete [] padded;
     return 0;
diff --git a/src/atom.h b/src/atom.h
index 111761884b..9a93e620d1 100644
--- a/src/atom.h
+++ b/src/atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -94,7 +94,7 @@ class Atom : protected Pointers {
   int cs_flag,csforce_flag,vforce_flag,ervelforce_flag,etag_flag;
   int rho_flag,e_flag,cv_flag,vest_flag;
 
-  // extra peratom info in restart file destined for fix & diag 
+  // extra peratom info in restart file destined for fix & diag
 
   double **extra;
 
@@ -173,7 +173,7 @@ class Atom : protected Pointers {
 
   // functions for global to local ID mapping
   // map lookup function inlined for efficiency
-  
+
   inline int map(int global) {
     if (map_style == 1) return map_array[global];
     else return map_find_hash(global);
diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp
index 0d415692ec..e33fb007bc 100644
--- a/src/atom_vec.cpp
+++ b/src/atom_vec.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/atom_vec.h b/src/atom_vec.h
index b0d9d85451..b05d4bf4ca 100644
--- a/src/atom_vec.h
+++ b/src/atom_vec.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -29,7 +29,7 @@ class AtomVec : protected Pointers {
   int comm_x_only;                     // 1 if only exchange x in forward comm
   int comm_f_only;                     // 1 if only exchange f in reverse comm
 
-  int size_forward;                    // # of values per atom in comm       
+  int size_forward;                    // # of values per atom in comm
   int size_reverse;                    // # in reverse comm
   int size_border;                     // # in border comm
   int size_velocity;                   // # of velocity based quantities
diff --git a/src/atom_vec_atomic.cpp b/src/atom_vec_atomic.cpp
index 61f8681dde..080a32c23e 100644
--- a/src/atom_vec_atomic.cpp
+++ b/src/atom_vec_atomic.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -46,7 +46,7 @@ AtomVecAtomic::AtomVecAtomic(LAMMPS *lmp, int narg, char **arg) :
 /* ----------------------------------------------------------------------
    grow atom arrays
    n = 0 grows arrays by DELTA
-   n > 0 allocates arrays to size n 
+   n > 0 allocates arrays to size n
 ------------------------------------------------------------------------- */
 
 void AtomVecAtomic::grow(int n)
@@ -66,7 +66,7 @@ void AtomVecAtomic::grow(int n)
   f = memory->grow(atom->f,nmax*comm->nthreads,3,"atom:f");
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
 }
 
@@ -99,14 +99,14 @@ void AtomVecAtomic::copy(int i, int j, int delflag)
   v[j][2] = v[i][2];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecAtomic::pack_comm(int n, int *list, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -142,7 +142,7 @@ int AtomVecAtomic::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecAtomic::pack_comm_vel(int n, int *list, double *buf,
-				 int pbc_flag, int *pbc)
+                                 int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -170,32 +170,32 @@ int AtomVecAtomic::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -269,7 +269,7 @@ void AtomVecAtomic::unpack_reverse(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecAtomic::pack_border(int n, int *list, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -311,7 +311,7 @@ int AtomVecAtomic::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecAtomic::pack_border_vel(int n, int *list, double *buf,
-				   int pbc_flag, int *pbc)
+                                   int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -342,38 +342,38 @@ int AtomVecAtomic::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -423,7 +423,7 @@ void AtomVecAtomic::unpack_border_vel(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 int AtomVecAtomic::pack_exchange(int i, double *buf)
@@ -441,7 +441,7 @@ int AtomVecAtomic::pack_exchange(int i, double *buf)
   buf[m++] = image[i];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -468,9 +468,9 @@ int AtomVecAtomic::unpack_exchange(double *buf)
   image[nlocal] = static_cast<int> (buf[m++]);
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -489,9 +489,9 @@ int AtomVecAtomic::size_restart()
   int n = 11 * nlocal;
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -499,7 +499,7 @@ int AtomVecAtomic::size_restart()
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecAtomic::pack_restart(int i, double *buf)
@@ -517,7 +517,7 @@ int AtomVecAtomic::pack_restart(int i, double *buf)
   buf[m++] = v[i][2];
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
 
   buf[0] = m;
@@ -616,7 +616,7 @@ void AtomVecAtomic::data_atom(double *coord, int imagetmp, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecAtomic::memory_usage()
diff --git a/src/atom_vec_atomic.h b/src/atom_vec_atomic.h
index 4503b50a74..d7aa50c214 100644
--- a/src/atom_vec_atomic.h
+++ b/src/atom_vec_atomic.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/atom_vec_charge.cpp b/src/atom_vec_charge.cpp
index 41a8f12282..b9ec7a1851 100644
--- a/src/atom_vec_charge.cpp
+++ b/src/atom_vec_charge.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-AtomVecCharge::AtomVecCharge(LAMMPS *lmp, int narg, char **arg) : 
+AtomVecCharge::AtomVecCharge(LAMMPS *lmp, int narg, char **arg) :
   AtomVec(lmp, narg, arg)
 {
   molecular = 0;
@@ -48,7 +48,7 @@ AtomVecCharge::AtomVecCharge(LAMMPS *lmp, int narg, char **arg) :
 /* ----------------------------------------------------------------------
    grow atom arrays
    n = 0 grows arrays by DELTA
-   n > 0 allocates arrays to size n 
+   n > 0 allocates arrays to size n
 ------------------------------------------------------------------------- */
 
 void AtomVecCharge::grow(int n)
@@ -70,7 +70,7 @@ void AtomVecCharge::grow(int n)
   q = memory->grow(atom->q,nmax,"atom:q");
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
 }
 
@@ -106,14 +106,14 @@ void AtomVecCharge::copy(int i, int j, int delflag)
   q[j] = q[i];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
 }
 
 /* ---------------------------------------------------------------------- */
 
 int AtomVecCharge::pack_comm(int n, int *list, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -149,7 +149,7 @@ int AtomVecCharge::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecCharge::pack_comm_vel(int n, int *list, double *buf,
-				 int pbc_flag, int *pbc)
+                                 int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -177,32 +177,32 @@ int AtomVecCharge::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -276,7 +276,7 @@ void AtomVecCharge::unpack_reverse(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecCharge::pack_border(int n, int *list, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -320,7 +320,7 @@ int AtomVecCharge::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecCharge::pack_border_vel(int n, int *list, double *buf,
-				   int pbc_flag, int *pbc)
+                                   int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -352,40 +352,40 @@ int AtomVecCharge::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = q[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = q[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = q[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = q[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
       }
     }
   }
@@ -464,7 +464,7 @@ int AtomVecCharge::unpack_border_hybrid(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 int AtomVecCharge::pack_exchange(int i, double *buf)
@@ -484,7 +484,7 @@ int AtomVecCharge::pack_exchange(int i, double *buf)
   buf[m++] = q[i];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -513,9 +513,9 @@ int AtomVecCharge::unpack_exchange(double *buf)
   q[nlocal] = buf[m++];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -534,9 +534,9 @@ int AtomVecCharge::size_restart()
   int n = 12 * nlocal;
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -544,7 +544,7 @@ int AtomVecCharge::size_restart()
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecCharge::pack_restart(int i, double *buf)
@@ -564,7 +564,7 @@ int AtomVecCharge::pack_restart(int i, double *buf)
   buf[m++] = q[i];
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
 
   buf[0] = m;
@@ -681,7 +681,7 @@ int AtomVecCharge::data_atom_hybrid(int nlocal, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecCharge::memory_usage()
diff --git a/src/atom_vec_charge.h b/src/atom_vec_charge.h
index d2b6b75189..bc658a2073 100644
--- a/src/atom_vec_charge.h
+++ b/src/atom_vec_charge.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp
index ceaab905d7..fc0396ec60 100755
--- a/src/atom_vec_ellipsoid.cpp
+++ b/src/atom_vec_ellipsoid.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -120,7 +120,7 @@ void AtomVecEllipsoid::grow_bonus()
     error->one(FLERR,"Per-processor system is too big");
 
   bonus = (Bonus *) memory->srealloc(bonus,nmax_bonus*sizeof(Bonus),
-				     "atom:bonus");
+                                     "atom:bonus");
 }
 
 /* ----------------------------------------------------------------------
@@ -189,8 +189,8 @@ void AtomVecEllipsoid::clear_bonus()
    this may create or delete entry in bonus data
 ------------------------------------------------------------------------- */
 
-void AtomVecEllipsoid::set_shape(int i, 
-				 double shapex, double shapey, double shapez)
+void AtomVecEllipsoid::set_shape(int i,
+                                 double shapex, double shapey, double shapez)
 {
   if (ellipsoid[i] < 0) {
     if (shapex == 0.0 && shapey == 0.0 && shapez == 0.0) return;
@@ -221,7 +221,7 @@ void AtomVecEllipsoid::set_shape(int i,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecEllipsoid::pack_comm(int n, int *list, double *buf,
-				int pbc_flag, int *pbc)
+                                int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -235,11 +235,11 @@ int AtomVecEllipsoid::pack_comm(int n, int *list, double *buf,
       buf[m++] = x[j][1];
       buf[m++] = x[j][2];
       if (ellipsoid[j] >= 0) {
-	quat = bonus[ellipsoid[j]].quat;
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
+        quat = bonus[ellipsoid[j]].quat;
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
       }
     }
   } else {
@@ -258,11 +258,11 @@ int AtomVecEllipsoid::pack_comm(int n, int *list, double *buf,
       buf[m++] = x[j][1] + dy;
       buf[m++] = x[j][2] + dz;
       if (ellipsoid[j] >= 0) {
-	quat = bonus[ellipsoid[j]].quat;
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
+        quat = bonus[ellipsoid[j]].quat;
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
       }
     }
   }
@@ -272,7 +272,7 @@ int AtomVecEllipsoid::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecEllipsoid::pack_comm_vel(int n, int *list, double *buf,
-				    int pbc_flag, int *pbc)
+                                    int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -286,11 +286,11 @@ int AtomVecEllipsoid::pack_comm_vel(int n, int *list, double *buf,
       buf[m++] = x[j][1];
       buf[m++] = x[j][2];
       if (ellipsoid[j] >= 0) {
-	quat = bonus[ellipsoid[j]].quat;
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
+        quat = bonus[ellipsoid[j]].quat;
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
       }
       buf[m++] = v[j][0];
       buf[m++] = v[j][1];
@@ -311,52 +311,52 @@ int AtomVecEllipsoid::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (ellipsoid[j] >= 0) {
-	  quat = bonus[ellipsoid[j]].quat;
-	  buf[m++] = quat[0];
-	  buf[m++] = quat[1];
-	  buf[m++] = quat[2];
-	  buf[m++] = quat[3];
-	}
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
-	buf[m++] = angmom[j][0];
-	buf[m++] = angmom[j][1];
-	buf[m++] = angmom[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (ellipsoid[j] >= 0) {
+          quat = bonus[ellipsoid[j]].quat;
+          buf[m++] = quat[0];
+          buf[m++] = quat[1];
+          buf[m++] = quat[2];
+          buf[m++] = quat[3];
+        }
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+        buf[m++] = angmom[j][0];
+        buf[m++] = angmom[j][1];
+        buf[m++] = angmom[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (ellipsoid[j] >= 0) {
-	  quat = bonus[ellipsoid[j]].quat;
-	  buf[m++] = quat[0];
-	  buf[m++] = quat[1];
-	  buf[m++] = quat[2];
-	  buf[m++] = quat[3];
-	}
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
-	buf[m++] = angmom[j][0];
-	buf[m++] = angmom[j][1];
-	buf[m++] = angmom[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (ellipsoid[j] >= 0) {
+          quat = bonus[ellipsoid[j]].quat;
+          buf[m++] = quat[0];
+          buf[m++] = quat[1];
+          buf[m++] = quat[2];
+          buf[m++] = quat[3];
+        }
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
+        buf[m++] = angmom[j][0];
+        buf[m++] = angmom[j][1];
+        buf[m++] = angmom[j][2];
       }
     }
   }
@@ -529,7 +529,7 @@ int AtomVecEllipsoid::unpack_reverse_hybrid(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecEllipsoid::pack_border(int n, int *list, double *buf,
-				  int pbc_flag, int *pbc)
+                                  int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -547,16 +547,16 @@ int AtomVecEllipsoid::pack_border(int n, int *list, double *buf,
       buf[m++] = mask[j];
       if (ellipsoid[j] < 0) buf[m++] = 0;
       else {
-	buf[m++] = 1;
-	shape = bonus[ellipsoid[j]].shape;
-	quat = bonus[ellipsoid[j]].quat;
-	buf[m++] = shape[0];
-	buf[m++] = shape[1];
-	buf[m++] = shape[2];
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
+        buf[m++] = 1;
+        shape = bonus[ellipsoid[j]].shape;
+        quat = bonus[ellipsoid[j]].quat;
+        buf[m++] = shape[0];
+        buf[m++] = shape[1];
+        buf[m++] = shape[2];
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
       }
     }
   } else {
@@ -579,16 +579,16 @@ int AtomVecEllipsoid::pack_border(int n, int *list, double *buf,
       buf[m++] = mask[j];
       if (ellipsoid[j] < 0) buf[m++] = 0;
       else {
-	buf[m++] = 1;
-	shape = bonus[ellipsoid[j]].shape;
-	quat = bonus[ellipsoid[j]].quat;
-	buf[m++] = shape[0];
-	buf[m++] = shape[1];
-	buf[m++] = shape[2];
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
+        buf[m++] = 1;
+        shape = bonus[ellipsoid[j]].shape;
+        quat = bonus[ellipsoid[j]].quat;
+        buf[m++] = shape[0];
+        buf[m++] = shape[1];
+        buf[m++] = shape[2];
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
       }
     }
   }
@@ -598,7 +598,7 @@ int AtomVecEllipsoid::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecEllipsoid::pack_border_vel(int n, int *list, double *buf,
-				      int pbc_flag, int *pbc)
+                                      int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -616,16 +616,16 @@ int AtomVecEllipsoid::pack_border_vel(int n, int *list, double *buf,
       buf[m++] = mask[j];
       if (ellipsoid[j] < 0) buf[m++] = 0;
       else {
-	buf[m++] = 1;
-	shape = bonus[ellipsoid[j]].shape;
-	quat = bonus[ellipsoid[j]].quat;
-	buf[m++] = shape[0];
-	buf[m++] = shape[1];
-	buf[m++] = shape[2];
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
+        buf[m++] = 1;
+        shape = bonus[ellipsoid[j]].shape;
+        quat = bonus[ellipsoid[j]].quat;
+        buf[m++] = shape[0];
+        buf[m++] = shape[1];
+        buf[m++] = shape[2];
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
       }
       buf[m++] = v[j][0];
       buf[m++] = v[j][1];
@@ -646,69 +646,69 @@ int AtomVecEllipsoid::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	if (ellipsoid[j] < 0) buf[m++] = 0;
-	else {
-	  buf[m++] = 1;
-	  quat = bonus[ellipsoid[j]].quat;
-	  buf[m++] = shape[0];
-	  buf[m++] = shape[1];
-	  buf[m++] = shape[2];
-	  buf[m++] = quat[0];
-	  buf[m++] = quat[1];
-	  buf[m++] = quat[2];
-	  buf[m++] = quat[3];
-	}
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
-	buf[m++] = angmom[j][0];
-	buf[m++] = angmom[j][1];
-	buf[m++] = angmom[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        if (ellipsoid[j] < 0) buf[m++] = 0;
+        else {
+          buf[m++] = 1;
+          quat = bonus[ellipsoid[j]].quat;
+          buf[m++] = shape[0];
+          buf[m++] = shape[1];
+          buf[m++] = shape[2];
+          buf[m++] = quat[0];
+          buf[m++] = quat[1];
+          buf[m++] = quat[2];
+          buf[m++] = quat[3];
+        }
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+        buf[m++] = angmom[j][0];
+        buf[m++] = angmom[j][1];
+        buf[m++] = angmom[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	if (ellipsoid[j] < 0) buf[m++] = 0;
-	else {
-	  buf[m++] = 1;
-	  shape = bonus[ellipsoid[j]].shape;
-	  quat = bonus[ellipsoid[j]].quat;
-	  buf[m++] = shape[0];
-	  buf[m++] = shape[1];
-	  buf[m++] = shape[2];
-	  buf[m++] = quat[0];
-	  buf[m++] = quat[1];
-	  buf[m++] = quat[2];
-	  buf[m++] = quat[3];
-	}
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
-	buf[m++] = angmom[j][0];
-	buf[m++] = angmom[j][1];
-	buf[m++] = angmom[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        if (ellipsoid[j] < 0) buf[m++] = 0;
+        else {
+          buf[m++] = 1;
+          shape = bonus[ellipsoid[j]].shape;
+          quat = bonus[ellipsoid[j]].quat;
+          buf[m++] = shape[0];
+          buf[m++] = shape[1];
+          buf[m++] = shape[2];
+          buf[m++] = quat[0];
+          buf[m++] = quat[1];
+          buf[m++] = quat[2];
+          buf[m++] = quat[3];
+        }
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
+        buf[m++] = angmom[j][0];
+        buf[m++] = angmom[j][1];
+        buf[m++] = angmom[j][2];
       }
     }
   }
@@ -893,7 +893,7 @@ int AtomVecEllipsoid::pack_exchange(int i, double *buf)
     buf[m++] = quat[2];
     buf[m++] = quat[3];
   }
-  
+
   if (atom->nextra_grow)
     for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
@@ -946,7 +946,7 @@ int AtomVecEllipsoid::unpack_exchange(double *buf)
   if (atom->nextra_grow)
     for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -970,7 +970,7 @@ int AtomVecEllipsoid::size_restart()
   if (atom->nextra_restart)
     for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -1030,7 +1030,7 @@ int AtomVecEllipsoid::unpack_restart(double *buf)
   int nlocal = atom->nlocal;
   if (nlocal == nmax) {
     grow(0);
-    if (atom->nextra_store) 
+    if (atom->nextra_store)
       memory->grow(atom->extra,nmax,atom->nextra_store,"atom:extra");
   }
 
@@ -1067,7 +1067,7 @@ int AtomVecEllipsoid::unpack_restart(double *buf)
     bonus[nlocal_bonus].ilocal = nlocal;
     ellipsoid[nlocal] = nlocal_bonus++;
   }
-  
+
   double **extra = atom->extra;
   if (atom->nextra_store) {
     int size = static_cast<int> (buf[0]) - m;
@@ -1098,7 +1098,7 @@ void AtomVecEllipsoid::create_atom(int itype, double *coord)
   v[nlocal][0] = 0.0;
   v[nlocal][1] = 0.0;
   v[nlocal][2] = 0.0;
-  
+
   rmass[nlocal] = 1.0;
   angmom[nlocal][0] = 0.0;
   angmom[nlocal][1] = 0.0;
@@ -1232,7 +1232,7 @@ int AtomVecEllipsoid::data_vel_hybrid(int m, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecEllipsoid::memory_usage()
@@ -1251,7 +1251,7 @@ bigint AtomVecEllipsoid::memory_usage()
   if (atom->memcheck("angmom")) bytes += memory->usage(angmom,nmax,3);
   if (atom->memcheck("torque")) bytes += memory->usage(torque,nmax*comm->nthreads,3);
   if (atom->memcheck("ellipsoid")) bytes += memory->usage(ellipsoid,nmax);
-  
+
   bytes += nmax_bonus*sizeof(Bonus);
 
   return bytes;
diff --git a/src/atom_vec_ellipsoid.h b/src/atom_vec_ellipsoid.h
index 2e2e13fbbb..65966819d6 100755
--- a/src/atom_vec_ellipsoid.h
+++ b/src/atom_vec_ellipsoid.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp
index 2f0f51699d..fc93450c86 100644
--- a/src/atom_vec_hybrid.cpp
+++ b/src/atom_vec_hybrid.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -42,9 +42,9 @@ AtomVecHybrid::AtomVecHybrid(LAMMPS *lmp, int narg, char **arg) :
 
   for (i = 0; i < narg; i++) {
     for (k = 0; k < i; k++)
-      if (strcmp(arg[i],keywords[k]) == 0) 
-	error->all(FLERR,"Atom style hybrid cannot use same atom style twice");
-    if (strcmp(arg[i],"hybrid") == 0) 
+      if (strcmp(arg[i],keywords[k]) == 0)
+        error->all(FLERR,"Atom style hybrid cannot use same atom style twice");
+    if (strcmp(arg[i],"hybrid") == 0)
       error->all(FLERR,"Atom style hybrid cannot have hybrid as an argument");
     styles[i] = atom->new_avec(arg[i],0,NULL,NULL,dummy);
     keywords[i] = new char[strlen(arg[i])+1];
@@ -108,7 +108,7 @@ void AtomVecHybrid::init()
 /* ----------------------------------------------------------------------
    grow atom arrays
    n = 0 grows arrays by DELTA
-   n > 0 allocates arrays to size n 
+   n > 0 allocates arrays to size n
 ------------------------------------------------------------------------- */
 
 void AtomVecHybrid::grow(int n)
@@ -134,7 +134,7 @@ void AtomVecHybrid::grow(int n)
   grow_reset();
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
 }
 
@@ -164,7 +164,7 @@ void AtomVecHybrid::copy(int i, int j, int delflag)
   atom->nextra_grow = tmp;
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       modify->fix[atom->extra_grow[iextra]]->copy_arrays(i,j);
 }
 
@@ -178,7 +178,7 @@ void AtomVecHybrid::clear_bonus()
 /* ---------------------------------------------------------------------- */
 
 int AtomVecHybrid::pack_comm(int n, int *list, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   int i,j,k,m;
   double dx,dy,dz;
@@ -220,7 +220,7 @@ int AtomVecHybrid::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecHybrid::pack_comm_vel(int n, int *list, double *buf,
-				 int pbc_flag, int *pbc)
+                                 int pbc_flag, int *pbc)
 {
   int i,j,k,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -238,14 +238,14 @@ int AtomVecHybrid::pack_comm_vel(int n, int *list, double *buf,
       buf[m++] = v[j][1];
       buf[m++] = v[j][2];
       if (omega_flag) {
-	buf[m++] = omega[j][0];
-	buf[m++] = omega[j][1];
-	buf[m++] = omega[j][2];
+        buf[m++] = omega[j][0];
+        buf[m++] = omega[j][1];
+        buf[m++] = omega[j][2];
       }
       if (angmom_flag) {
-	buf[m++] = angmom[j][0];
-	buf[m++] = angmom[j][1];
-	buf[m++] = angmom[j][2];
+        buf[m++] = angmom[j][0];
+        buf[m++] = angmom[j][1];
+        buf[m++] = angmom[j][2];
       }
     }
   } else {
@@ -260,52 +260,52 @@ int AtomVecHybrid::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
-	if (omega_flag) {
-	  buf[m++] = omega[j][0];
-	  buf[m++] = omega[j][1];
-	  buf[m++] = omega[j][2];
-	}
-	if (angmom_flag) {
-	  buf[m++] = angmom[j][0];
-	  buf[m++] = angmom[j][1];
-	  buf[m++] = angmom[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+        if (omega_flag) {
+          buf[m++] = omega[j][0];
+          buf[m++] = omega[j][1];
+          buf[m++] = omega[j][2];
+        }
+        if (angmom_flag) {
+          buf[m++] = angmom[j][0];
+          buf[m++] = angmom[j][1];
+          buf[m++] = angmom[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
-	if (omega_flag) {
-	  buf[m++] = omega[j][0];
-	  buf[m++] = omega[j][1];
-	  buf[m++] = omega[j][2];
-	}
-	if (angmom_flag) {
-	  buf[m++] = angmom[j][0];
-	  buf[m++] = angmom[j][1];
-	  buf[m++] = angmom[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
+        if (omega_flag) {
+          buf[m++] = omega[j][0];
+          buf[m++] = omega[j][1];
+          buf[m++] = omega[j][2];
+        }
+        if (angmom_flag) {
+          buf[m++] = angmom[j][0];
+          buf[m++] = angmom[j][1];
+          buf[m++] = angmom[j][2];
+        }
       }
     }
   }
@@ -418,7 +418,7 @@ void AtomVecHybrid::unpack_reverse(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecHybrid::pack_border(int n, int *list, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   int i,j,k,m;
   double dx,dy,dz;
@@ -466,7 +466,7 @@ int AtomVecHybrid::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecHybrid::pack_border_vel(int n, int *list, double *buf,
-				   int pbc_flag, int *pbc)
+                                   int pbc_flag, int *pbc)
 {
   int i,j,k,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -487,14 +487,14 @@ int AtomVecHybrid::pack_border_vel(int n, int *list, double *buf,
       buf[m++] = v[j][1];
       buf[m++] = v[j][2];
       if (omega_flag) {
-	buf[m++] = omega[j][0];
-	buf[m++] = omega[j][1];
-	buf[m++] = omega[j][2];
+        buf[m++] = omega[j][0];
+        buf[m++] = omega[j][1];
+        buf[m++] = omega[j][2];
       }
       if (angmom_flag) {
-	buf[m++] = angmom[j][0];
-	buf[m++] = angmom[j][1];
-	buf[m++] = angmom[j][2];
+        buf[m++] = angmom[j][0];
+        buf[m++] = angmom[j][1];
+        buf[m++] = angmom[j][2];
       }
     }
   } else {
@@ -509,58 +509,58 @@ int AtomVecHybrid::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
-	if (omega_flag) {
-	  buf[m++] = omega[j][0];
-	  buf[m++] = omega[j][1];
-	  buf[m++] = omega[j][2];
-	}
-	if (angmom_flag) {
-	  buf[m++] = angmom[j][0];
-	  buf[m++] = angmom[j][1];
-	  buf[m++] = angmom[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+        if (omega_flag) {
+          buf[m++] = omega[j][0];
+          buf[m++] = omega[j][1];
+          buf[m++] = omega[j][2];
+        }
+        if (angmom_flag) {
+          buf[m++] = angmom[j][0];
+          buf[m++] = angmom[j][1];
+          buf[m++] = angmom[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
-	if (omega_flag) {
-	  buf[m++] = omega[j][0];
-	  buf[m++] = omega[j][1];
-	  buf[m++] = omega[j][2];
-	}
-	if (angmom_flag) {
-	  buf[m++] = angmom[j][0];
-	  buf[m++] = angmom[j][1];
-	  buf[m++] = angmom[j][2];
-	}
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
+        if (omega_flag) {
+          buf[m++] = omega[j][0];
+          buf[m++] = omega[j][1];
+          buf[m++] = omega[j][2];
+        }
+        if (angmom_flag) {
+          buf[m++] = angmom[j][0];
+          buf[m++] = angmom[j][1];
+          buf[m++] = angmom[j][2];
+        }
       }
     }
   }
@@ -649,13 +649,13 @@ int AtomVecHybrid::pack_exchange(int i, double *buf)
   atom->nextra_grow = 0;
 
   m = 0;
-  for (k = 0; k < nstyles; k++) 
+  for (k = 0; k < nstyles; k++)
     m += styles[k]->pack_exchange(i,&buf[m]);
 
   atom->nextra_grow = tmp;
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -687,9 +687,9 @@ int AtomVecHybrid::unpack_exchange(double *buf)
   atom->nextra_grow = tmp;
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -713,9 +713,9 @@ int AtomVecHybrid::size_restart()
 
   int nlocal = atom->nlocal;
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (int i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -738,7 +738,7 @@ int AtomVecHybrid::pack_restart(int i, double *buf)
   atom->nextra_restart = tmp;
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
 
   buf[0] = m;
@@ -840,7 +840,7 @@ void AtomVecHybrid::data_atom(double *coord, int imagetmp, char **values)
   // each sub-style parses sub-style specific values
 
   int m = 5;
-  for (int k = 0; k < nstyles; k++) 
+  for (int k = 0; k < nstyles; k++)
     m += styles[k]->data_atom_hybrid(nlocal,&values[m]);
 
   atom->nlocal++;
@@ -859,7 +859,7 @@ void AtomVecHybrid::data_vel(int m, char **values)
   // each sub-style parses sub-style specific values
 
   int n = 3;
-  for (int k = 0; k < nstyles; k++) 
+  for (int k = 0; k < nstyles; k++)
     n += styles[k]->data_vel_hybrid(m,&values[n]);
 }
 
diff --git a/src/atom_vec_hybrid.h b/src/atom_vec_hybrid.h
index 4f2f2d1851..ea1d1ff234 100644
--- a/src/atom_vec_hybrid.h
+++ b/src/atom_vec_hybrid.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp
index 550f2b3249..55997b990b 100644
--- a/src/atom_vec_line.cpp
+++ b/src/atom_vec_line.cpp
@@ -129,7 +129,7 @@ void AtomVecLine::grow_bonus()
     error->one(FLERR,"Per-processor system is too big");
 
   bonus = (Bonus *) memory->srealloc(bonus,nmax_bonus*sizeof(Bonus),
-				     "atom:bonus");
+                                     "atom:bonus");
 }
 
 /* ----------------------------------------------------------------------
@@ -199,7 +199,7 @@ void AtomVecLine::clear_bonus()
    this may create or delete entry in bonus data
 ------------------------------------------------------------------------- */
 
-void AtomVecLine::set_length(int i, double value) 
+void AtomVecLine::set_length(int i, double value)
 {
   if (line[i] < 0) {
     if (value == 0.0) return;
@@ -218,7 +218,7 @@ void AtomVecLine::set_length(int i, double value)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecLine::pack_comm(int n, int *list, double *buf,
-			   int pbc_flag, int *pbc)
+                           int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -257,7 +257,7 @@ int AtomVecLine::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecLine::pack_comm_vel(int n, int *list, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -289,40 +289,40 @@ int AtomVecLine::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (line[j] >= 0) buf[m++] = bonus[line[j]].theta;
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
-	buf[m++] = omega[j][0];
-	buf[m++] = omega[j][1];
-	buf[m++] = omega[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (line[j] >= 0) buf[m++] = bonus[line[j]].theta;
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+        buf[m++] = omega[j][0];
+        buf[m++] = omega[j][1];
+        buf[m++] = omega[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (line[j] >= 0) buf[m++] = bonus[line[j]].theta;
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
-	buf[m++] = omega[j][0];
-	buf[m++] = omega[j][1];
-	buf[m++] = omega[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (line[j] >= 0) buf[m++] = bonus[line[j]].theta;
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
+        buf[m++] = omega[j][0];
+        buf[m++] = omega[j][1];
+        buf[m++] = omega[j][2];
       }
     }
   }
@@ -467,7 +467,7 @@ int AtomVecLine::unpack_reverse_hybrid(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecLine::pack_border(int n, int *list, double *buf,
-			     int pbc_flag, int *pbc)
+                             int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -485,9 +485,9 @@ int AtomVecLine::pack_border(int n, int *list, double *buf,
       buf[m++] = molecule[j];
       if (line[j] < 0) buf[m++] = 0;
       else {
-	buf[m++] = 1;
-	buf[m++] = bonus[line[j]].length;
-	buf[m++] = bonus[line[j]].theta;
+        buf[m++] = 1;
+        buf[m++] = bonus[line[j]].length;
+        buf[m++] = bonus[line[j]].theta;
       }
     }
   } else {
@@ -511,9 +511,9 @@ int AtomVecLine::pack_border(int n, int *list, double *buf,
       buf[m++] = molecule[j];
       if (line[j] < 0) buf[m++] = 0;
       else {
-	buf[m++] = 1;
-	buf[m++] = bonus[line[j]].length;
-	buf[m++] = bonus[line[j]].theta;
+        buf[m++] = 1;
+        buf[m++] = bonus[line[j]].length;
+        buf[m++] = bonus[line[j]].theta;
       }
     }
   }
@@ -523,7 +523,7 @@ int AtomVecLine::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecLine::pack_border_vel(int n, int *list, double *buf,
-				 int pbc_flag, int *pbc)
+                                 int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -541,9 +541,9 @@ int AtomVecLine::pack_border_vel(int n, int *list, double *buf,
       buf[m++] = molecule[j];
       if (line[j] < 0) buf[m++] = 0;
       else {
-	buf[m++] = 1;
-	buf[m++] = bonus[line[j]].length;
-	buf[m++] = bonus[line[j]].theta;
+        buf[m++] = 1;
+        buf[m++] = bonus[line[j]].length;
+        buf[m++] = bonus[line[j]].theta;
       }
       buf[m++] = v[j][0];
       buf[m++] = v[j][1];
@@ -564,58 +564,58 @@ int AtomVecLine::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = molecule[j];
-	if (line[j] < 0) buf[m++] = 0;
-	else {
-	  buf[m++] = 1;
-	  buf[m++] = bonus[line[j]].length;
-	  buf[m++] = bonus[line[j]].theta;
-	}
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
-	buf[m++] = omega[j][0];
-	buf[m++] = omega[j][1];
-	buf[m++] = omega[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = molecule[j];
+        if (line[j] < 0) buf[m++] = 0;
+        else {
+          buf[m++] = 1;
+          buf[m++] = bonus[line[j]].length;
+          buf[m++] = bonus[line[j]].theta;
+        }
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+        buf[m++] = omega[j][0];
+        buf[m++] = omega[j][1];
+        buf[m++] = omega[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = molecule[j];
-	if (line[j] < 0) buf[m++] = 0;
-	else {
-	  buf[m++] = 1;
-	  buf[m++] = bonus[line[j]].length;
-	  buf[m++] = bonus[line[j]].theta;
-	}
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
-	buf[m++] = omega[j][0];
-	buf[m++] = omega[j][1];
-	buf[m++] = omega[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = molecule[j];
+        if (line[j] < 0) buf[m++] = 0;
+        else {
+          buf[m++] = 1;
+          buf[m++] = bonus[line[j]].length;
+          buf[m++] = bonus[line[j]].theta;
+        }
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
+        buf[m++] = omega[j][0];
+        buf[m++] = omega[j][1];
+        buf[m++] = omega[j][2];
       }
     }
   }
@@ -737,7 +737,7 @@ int AtomVecLine::unpack_border_hybrid(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 int AtomVecLine::pack_exchange(int i, double *buf)
@@ -769,7 +769,7 @@ int AtomVecLine::pack_exchange(int i, double *buf)
   }
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -812,9 +812,9 @@ int AtomVecLine::unpack_exchange(double *buf)
   }
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -836,9 +836,9 @@ int AtomVecLine::size_restart()
     else n += 17;
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -846,7 +846,7 @@ int AtomVecLine::size_restart()
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecLine::pack_restart(int i, double *buf)
@@ -878,7 +878,7 @@ int AtomVecLine::pack_restart(int i, double *buf)
   }
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
 
   buf[0] = m;
@@ -1104,7 +1104,7 @@ int AtomVecLine::data_vel_hybrid(int m, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecLine::memory_usage()
@@ -1141,20 +1141,20 @@ void AtomVecLine::consistency_check(int n, char *str)
   int iflag = 0;
   int count = 0;
   for (int i = 0; i < n; i++) {
-      
+
     if (line[i] >= 0) {
       count++;
       if (line[i] >= nlocal_bonus) iflag++;
       if (bonus[line[i]].ilocal != i) iflag++;
       //if (comm->me == 1 && update->ntimestep == 873)
-      //	printf("CCHK %s: %d %d: %d %d: %d %d\n",
+      //        printf("CCHK %s: %d %d: %d %d: %d %d\n",
       //       str,i,n,line[i],nlocal_bonus,bonus[line[i]].ilocal,iflag);
     }
   }
 
   if (iflag) {
     printf("BAD vecline ptrs: %s: %d %d: %d\n",str,comm->me,
-	   update->ntimestep,iflag);
+           update->ntimestep,iflag);
     MPI_Abort(world,1);
   }
 
diff --git a/src/atom_vec_line.h b/src/atom_vec_line.h
index 38b7aee79b..b37bb66771 100644
--- a/src/atom_vec_line.h
+++ b/src/atom_vec_line.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/atom_vec_sphere.cpp b/src/atom_vec_sphere.cpp
index 5630fa6bac..f77a7e091b 100644
--- a/src/atom_vec_sphere.cpp
+++ b/src/atom_vec_sphere.cpp
@@ -49,7 +49,7 @@ AtomVecSphere::AtomVecSphere(LAMMPS *lmp, int narg, char **arg) :
   xcol_data = 5;
 
   atom->sphere_flag = 1;
-  atom->radius_flag = atom->rmass_flag = atom->omega_flag = 
+  atom->radius_flag = atom->rmass_flag = atom->omega_flag =
     atom->torque_flag = 1;
 }
 
@@ -70,7 +70,7 @@ void AtomVecSphere::init()
       FixAdapt *fix = (FixAdapt *) modify->fix[i];
       if (fix->diamflag) {
         radvary = 1;
-	comm_x_only = 0;
+        comm_x_only = 0;
         size_forward = 5;
       }
     }
@@ -152,7 +152,7 @@ void AtomVecSphere::copy(int i, int j, int delflag)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecSphere::pack_comm(int n, int *list, double *buf,
-			       int pbc_flag, int *pbc)
+                               int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -161,26 +161,26 @@ int AtomVecSphere::pack_comm(int n, int *list, double *buf,
     m = 0;
     if (pbc_flag == 0) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0];
-	buf[m++] = x[j][1];
-	buf[m++] = x[j][2];
+        j = list[i];
+        buf[m++] = x[j][0];
+        buf[m++] = x[j][1];
+        buf[m++] = x[j][2];
       }
     } else {
       if (domain->triclinic == 0) {
-	dx = pbc[0]*domain->xprd;
-	dy = pbc[1]*domain->yprd;
-	dz = pbc[2]*domain->zprd;
+        dx = pbc[0]*domain->xprd;
+        dy = pbc[1]*domain->yprd;
+        dz = pbc[2]*domain->zprd;
       } else {
-	dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
-	dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
-	dz = pbc[2]*domain->zprd;
+        dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
+        dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
+        dz = pbc[2]*domain->zprd;
       }
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
       }
     }
 
@@ -188,30 +188,30 @@ int AtomVecSphere::pack_comm(int n, int *list, double *buf,
     m = 0;
     if (pbc_flag == 0) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0];
-	buf[m++] = x[j][1];
-	buf[m++] = x[j][2];
-	buf[m++] = radius[j];
-	buf[m++] = rmass[j];
+        j = list[i];
+        buf[m++] = x[j][0];
+        buf[m++] = x[j][1];
+        buf[m++] = x[j][2];
+        buf[m++] = radius[j];
+        buf[m++] = rmass[j];
       }
     } else {
       if (domain->triclinic == 0) {
-	dx = pbc[0]*domain->xprd;
-	dy = pbc[1]*domain->yprd;
-	dz = pbc[2]*domain->zprd;
+        dx = pbc[0]*domain->xprd;
+        dy = pbc[1]*domain->yprd;
+        dz = pbc[2]*domain->zprd;
       } else {
-	dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
-	dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
-	dz = pbc[2]*domain->zprd;
+        dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
+        dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
+        dz = pbc[2]*domain->zprd;
       }
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = radius[j];
-	buf[m++] = rmass[j];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = radius[j];
+        buf[m++] = rmass[j];
       }
     }
   }
@@ -222,7 +222,7 @@ int AtomVecSphere::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecSphere::pack_comm_vel(int n, int *list, double *buf,
-				   int pbc_flag, int *pbc)
+                                   int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -231,62 +231,62 @@ int AtomVecSphere::pack_comm_vel(int n, int *list, double *buf,
     m = 0;
     if (pbc_flag == 0) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0];
-	buf[m++] = x[j][1];
-	buf[m++] = x[j][2];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
-	buf[m++] = omega[j][0];
-	buf[m++] = omega[j][1];
-	buf[m++] = omega[j][2];
+        j = list[i];
+        buf[m++] = x[j][0];
+        buf[m++] = x[j][1];
+        buf[m++] = x[j][2];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+        buf[m++] = omega[j][0];
+        buf[m++] = omega[j][1];
+        buf[m++] = omega[j][2];
       }
     } else {
       if (domain->triclinic == 0) {
-	dx = pbc[0]*domain->xprd;
-	dy = pbc[1]*domain->yprd;
-	dz = pbc[2]*domain->zprd;
+        dx = pbc[0]*domain->xprd;
+        dy = pbc[1]*domain->yprd;
+        dz = pbc[2]*domain->zprd;
       } else {
-	dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
-	dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
-	dz = pbc[2]*domain->zprd;
+        dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
+        dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
+        dz = pbc[2]*domain->zprd;
       }
       if (!deform_vremap) {
-	for (i = 0; i < n; i++) {
-	  j = list[i];
-	  buf[m++] = x[j][0] + dx;
-	  buf[m++] = x[j][1] + dy;
-	  buf[m++] = x[j][2] + dz;
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	  buf[m++] = omega[j][0];
-	  buf[m++] = omega[j][1];
-	  buf[m++] = omega[j][2];
-	}
+        for (i = 0; i < n; i++) {
+          j = list[i];
+          buf[m++] = x[j][0] + dx;
+          buf[m++] = x[j][1] + dy;
+          buf[m++] = x[j][2] + dz;
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+          buf[m++] = omega[j][0];
+          buf[m++] = omega[j][1];
+          buf[m++] = omega[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;
-	  buf[m++] = x[j][1] + dy;
-	  buf[m++] = x[j][2] + dz;
-	  if (mask[i] & deform_groupbit) {
-	    buf[m++] = v[j][0] + dvx;
-	    buf[m++] = v[j][1] + dvy;
-	    buf[m++] = v[j][2] + dvz;
-	  } else {
-	    buf[m++] = v[j][0];
-	    buf[m++] = v[j][1];
-	    buf[m++] = v[j][2];
-	  }
-	  buf[m++] = omega[j][0];
-	  buf[m++] = omega[j][1];
-	  buf[m++] = omega[j][2];
-	}
+        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;
+          buf[m++] = x[j][1] + dy;
+          buf[m++] = x[j][2] + dz;
+          if (mask[i] & deform_groupbit) {
+            buf[m++] = v[j][0] + dvx;
+            buf[m++] = v[j][1] + dvy;
+            buf[m++] = v[j][2] + dvz;
+          } else {
+            buf[m++] = v[j][0];
+            buf[m++] = v[j][1];
+            buf[m++] = v[j][2];
+          }
+          buf[m++] = omega[j][0];
+          buf[m++] = omega[j][1];
+          buf[m++] = omega[j][2];
+        }
       }
     }
 
@@ -294,68 +294,68 @@ int AtomVecSphere::pack_comm_vel(int n, int *list, double *buf,
     m = 0;
     if (pbc_flag == 0) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0];
-	buf[m++] = x[j][1];
-	buf[m++] = x[j][2];
-	buf[m++] = radius[j];
-	buf[m++] = rmass[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
-	buf[m++] = omega[j][0];
-	buf[m++] = omega[j][1];
-	buf[m++] = omega[j][2];
+        j = list[i];
+        buf[m++] = x[j][0];
+        buf[m++] = x[j][1];
+        buf[m++] = x[j][2];
+        buf[m++] = radius[j];
+        buf[m++] = rmass[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+        buf[m++] = omega[j][0];
+        buf[m++] = omega[j][1];
+        buf[m++] = omega[j][2];
       }
     } else {
       if (domain->triclinic == 0) {
-	dx = pbc[0]*domain->xprd;
-	dy = pbc[1]*domain->yprd;
-	dz = pbc[2]*domain->zprd;
+        dx = pbc[0]*domain->xprd;
+        dy = pbc[1]*domain->yprd;
+        dz = pbc[2]*domain->zprd;
       } else {
-	dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
-	dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
-	dz = pbc[2]*domain->zprd;
+        dx = pbc[0]*domain->xprd + pbc[5]*domain->xy + pbc[4]*domain->xz;
+        dy = pbc[1]*domain->yprd + pbc[3]*domain->yz;
+        dz = pbc[2]*domain->zprd;
       }
       if (!deform_vremap) {
-	for (i = 0; i < n; i++) {
-	  j = list[i];
-	  buf[m++] = x[j][0] + dx;
-	  buf[m++] = x[j][1] + dy;
-	  buf[m++] = x[j][2] + dz;
-	  buf[m++] = radius[j];
-	  buf[m++] = rmass[j];
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	  buf[m++] = omega[j][0];
-	  buf[m++] = omega[j][1];
-	  buf[m++] = omega[j][2];
-	}
+        for (i = 0; i < n; i++) {
+          j = list[i];
+          buf[m++] = x[j][0] + dx;
+          buf[m++] = x[j][1] + dy;
+          buf[m++] = x[j][2] + dz;
+          buf[m++] = radius[j];
+          buf[m++] = rmass[j];
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+          buf[m++] = omega[j][0];
+          buf[m++] = omega[j][1];
+          buf[m++] = omega[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;
-	  buf[m++] = x[j][1] + dy;
-	  buf[m++] = x[j][2] + dz;
-	  buf[m++] = radius[j];
-	  buf[m++] = rmass[j];
-	  if (mask[i] & deform_groupbit) {
-	    buf[m++] = v[j][0] + dvx;
-	    buf[m++] = v[j][1] + dvy;
-	    buf[m++] = v[j][2] + dvz;
-	  } else {
-	    buf[m++] = v[j][0];
-	    buf[m++] = v[j][1];
-	    buf[m++] = v[j][2];
-	  }
-	  buf[m++] = omega[j][0];
-	  buf[m++] = omega[j][1];
-	  buf[m++] = omega[j][2];
-	}
+        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;
+          buf[m++] = x[j][1] + dy;
+          buf[m++] = x[j][2] + dz;
+          buf[m++] = radius[j];
+          buf[m++] = rmass[j];
+          if (mask[i] & deform_groupbit) {
+            buf[m++] = v[j][0] + dvx;
+            buf[m++] = v[j][1] + dvy;
+            buf[m++] = v[j][2] + dvz;
+          } else {
+            buf[m++] = v[j][0];
+            buf[m++] = v[j][1];
+            buf[m++] = v[j][2];
+          }
+          buf[m++] = omega[j][0];
+          buf[m++] = omega[j][1];
+          buf[m++] = omega[j][2];
+        }
       }
     }
   }
@@ -535,7 +535,7 @@ int AtomVecSphere::unpack_reverse_hybrid(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecSphere::pack_border(int n, int *list, double *buf,
-				 int pbc_flag, int *pbc)
+                                 int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -581,7 +581,7 @@ int AtomVecSphere::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecSphere::pack_border_vel(int n, int *list, double *buf,
-				     int pbc_flag, int *pbc)
+                                     int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -617,48 +617,48 @@ int AtomVecSphere::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = radius[j];
-	buf[m++] = rmass[j];
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
-	buf[m++] = omega[j][0];
-	buf[m++] = omega[j][1];
-	buf[m++] = omega[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = radius[j];
+        buf[m++] = rmass[j];
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+        buf[m++] = omega[j][0];
+        buf[m++] = omega[j][1];
+        buf[m++] = omega[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = radius[j];
-	buf[m++] = rmass[j];
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
-	buf[m++] = omega[j][0];
-	buf[m++] = omega[j][1];
-	buf[m++] = omega[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = radius[j];
+        buf[m++] = rmass[j];
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
+        buf[m++] = omega[j][0];
+        buf[m++] = omega[j][1];
+        buf[m++] = omega[j][2];
       }
     }
   }
@@ -746,7 +746,7 @@ int AtomVecSphere::unpack_border_hybrid(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 int AtomVecSphere::pack_exchange(int i, double *buf)
@@ -770,7 +770,7 @@ int AtomVecSphere::pack_exchange(int i, double *buf)
   buf[m++] = omega[i][2];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -803,9 +803,9 @@ int AtomVecSphere::unpack_exchange(double *buf)
   omega[nlocal][2] = buf[m++];
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -824,9 +824,9 @@ int AtomVecSphere::size_restart()
   int n = 16 * nlocal;
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -834,7 +834,7 @@ int AtomVecSphere::size_restart()
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecSphere::pack_restart(int i, double *buf)
@@ -858,7 +858,7 @@ int AtomVecSphere::pack_restart(int i, double *buf)
   buf[m++] = omega[i][2];
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
 
   buf[0] = m;
@@ -963,7 +963,7 @@ void AtomVecSphere::data_atom(double *coord, int imagetmp, char **values)
     error->one(FLERR,"Invalid density in Atoms section of data file");
 
   if (radius[nlocal] == 0.0) rmass[nlocal] = density;
-  else 
+  else
     rmass[nlocal] = 4.0*MY_PI/3.0 *
       radius[nlocal]*radius[nlocal]*radius[nlocal] * density;
 
@@ -1000,7 +1000,7 @@ int AtomVecSphere::data_atom_hybrid(int nlocal, char **values)
     error->one(FLERR,"Invalid density in Atoms section of data file");
 
   if (radius[nlocal] == 0.0) rmass[nlocal] = density;
-  else 
+  else
     rmass[nlocal] = 4.0*MY_PI/3.0 *
       radius[nlocal]*radius[nlocal]*radius[nlocal] * density;
 
@@ -1034,7 +1034,7 @@ int AtomVecSphere::data_vel_hybrid(int m, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecSphere::memory_usage()
diff --git a/src/atom_vec_sphere.h b/src/atom_vec_sphere.h
index 1df8aaa2da..3ee23e9dc4 100644
--- a/src/atom_vec_sphere.h
+++ b/src/atom_vec_sphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp
index 0ad878a308..283718ef94 100644
--- a/src/atom_vec_tri.cpp
+++ b/src/atom_vec_tri.cpp
@@ -130,7 +130,7 @@ void AtomVecTri::grow_bonus()
     error->one(FLERR,"Per-processor system is too big");
 
   bonus = (Bonus *) memory->srealloc(bonus,nmax_bonus*sizeof(Bonus),
-				     "atom:bonus");
+                                     "atom:bonus");
 }
 
 /* ----------------------------------------------------------------------
@@ -256,7 +256,7 @@ void AtomVecTri::set_equilateral(int i, double size)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecTri::pack_comm(int n, int *list, double *buf,
-			  int pbc_flag, int *pbc)
+                          int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -270,11 +270,11 @@ int AtomVecTri::pack_comm(int n, int *list, double *buf,
       buf[m++] = x[j][1];
       buf[m++] = x[j][2];
       if (tri[j] >= 0) {
-	quat = bonus[tri[j]].quat;
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
+        quat = bonus[tri[j]].quat;
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
       }
     }
   } else {
@@ -293,11 +293,11 @@ int AtomVecTri::pack_comm(int n, int *list, double *buf,
       buf[m++] = x[j][1] + dy;
       buf[m++] = x[j][2] + dz;
       if (tri[j] >= 0) {
-	quat = bonus[tri[j]].quat;
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
+        quat = bonus[tri[j]].quat;
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
       }
     }
   }
@@ -308,7 +308,7 @@ int AtomVecTri::pack_comm(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecTri::pack_comm_vel(int n, int *list, double *buf,
-			      int pbc_flag, int *pbc)
+                              int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -322,11 +322,11 @@ int AtomVecTri::pack_comm_vel(int n, int *list, double *buf,
       buf[m++] = x[j][1];
       buf[m++] = x[j][2];
       if (tri[j] >= 0) {
-	quat = bonus[tri[j]].quat;
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
+        quat = bonus[tri[j]].quat;
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
       }
       buf[m++] = v[j][0];
       buf[m++] = v[j][1];
@@ -347,52 +347,52 @@ int AtomVecTri::pack_comm_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (tri[j] >= 0) {
-	  quat = bonus[tri[j]].quat;
-	  buf[m++] = quat[0];
-	  buf[m++] = quat[1];
-	  buf[m++] = quat[2];
-	  buf[m++] = quat[3];
-	}
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
-	buf[m++] = angmom[j][0];
-	buf[m++] = angmom[j][1];
-	buf[m++] = angmom[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (tri[j] >= 0) {
+          quat = bonus[tri[j]].quat;
+          buf[m++] = quat[0];
+          buf[m++] = quat[1];
+          buf[m++] = quat[2];
+          buf[m++] = quat[3];
+        }
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+        buf[m++] = angmom[j][0];
+        buf[m++] = angmom[j][1];
+        buf[m++] = angmom[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	if (tri[j] >= 0) {
-	  quat = bonus[tri[j]].quat;
-	  buf[m++] = quat[0];
-	  buf[m++] = quat[1];
-	  buf[m++] = quat[2];
-	  buf[m++] = quat[3];
-	}
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
-	buf[m++] = angmom[j][0];
-	buf[m++] = angmom[j][1];
-	buf[m++] = angmom[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        if (tri[j] >= 0) {
+          quat = bonus[tri[j]].quat;
+          buf[m++] = quat[0];
+          buf[m++] = quat[1];
+          buf[m++] = quat[2];
+          buf[m++] = quat[3];
+        }
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
+        buf[m++] = angmom[j][0];
+        buf[m++] = angmom[j][1];
+        buf[m++] = angmom[j][2];
       }
     }
   }
@@ -565,7 +565,7 @@ int AtomVecTri::unpack_reverse_hybrid(int n, int *list, double *buf)
 /* ---------------------------------------------------------------------- */
 
 int AtomVecTri::pack_border(int n, int *list, double *buf,
-			    int pbc_flag, int *pbc)
+                            int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz;
@@ -584,28 +584,28 @@ int AtomVecTri::pack_border(int n, int *list, double *buf,
       buf[m++] = molecule[j];
       if (tri[j] < 0) buf[m++] = 0;
       else {
-	buf[m++] = 1;
-	quat = bonus[tri[j]].quat;
-	c1 = bonus[tri[j]].c1;
-	c2 = bonus[tri[j]].c2;
-	c3 = bonus[tri[j]].c3;
-	inertia = bonus[tri[j]].inertia;
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
-	buf[m++] = c1[0];
-	buf[m++] = c1[1];
-	buf[m++] = c1[2];
-	buf[m++] = c2[0];
-	buf[m++] = c2[1];
-	buf[m++] = c2[2];
-	buf[m++] = c3[0];
-	buf[m++] = c3[1];
-	buf[m++] = c3[2];
-	buf[m++] = inertia[0];
-	buf[m++] = inertia[1];
-	buf[m++] = inertia[2];
+        buf[m++] = 1;
+        quat = bonus[tri[j]].quat;
+        c1 = bonus[tri[j]].c1;
+        c2 = bonus[tri[j]].c2;
+        c3 = bonus[tri[j]].c3;
+        inertia = bonus[tri[j]].inertia;
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
+        buf[m++] = c1[0];
+        buf[m++] = c1[1];
+        buf[m++] = c1[2];
+        buf[m++] = c2[0];
+        buf[m++] = c2[1];
+        buf[m++] = c2[2];
+        buf[m++] = c3[0];
+        buf[m++] = c3[1];
+        buf[m++] = c3[2];
+        buf[m++] = inertia[0];
+        buf[m++] = inertia[1];
+        buf[m++] = inertia[2];
       }
     }
   } else {
@@ -629,28 +629,28 @@ int AtomVecTri::pack_border(int n, int *list, double *buf,
       buf[m++] = molecule[j];
       if (tri[j] < 0) buf[m++] = 0;
       else {
-	buf[m++] = 1;
-	quat = bonus[tri[j]].quat;
-	c1 = bonus[tri[j]].c1;
-	c2 = bonus[tri[j]].c2;
-	c3 = bonus[tri[j]].c3;
-	inertia = bonus[tri[j]].inertia;
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
-	buf[m++] = c1[0];
-	buf[m++] = c1[1];
-	buf[m++] = c1[2];
-	buf[m++] = c2[0];
-	buf[m++] = c2[1];
-	buf[m++] = c2[2];
-	buf[m++] = c3[0];
-	buf[m++] = c3[1];
-	buf[m++] = c3[2];
-	buf[m++] = inertia[0];
-	buf[m++] = inertia[1];
-	buf[m++] = inertia[2];
+        buf[m++] = 1;
+        quat = bonus[tri[j]].quat;
+        c1 = bonus[tri[j]].c1;
+        c2 = bonus[tri[j]].c2;
+        c3 = bonus[tri[j]].c3;
+        inertia = bonus[tri[j]].inertia;
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
+        buf[m++] = c1[0];
+        buf[m++] = c1[1];
+        buf[m++] = c1[2];
+        buf[m++] = c2[0];
+        buf[m++] = c2[1];
+        buf[m++] = c2[2];
+        buf[m++] = c3[0];
+        buf[m++] = c3[1];
+        buf[m++] = c3[2];
+        buf[m++] = inertia[0];
+        buf[m++] = inertia[1];
+        buf[m++] = inertia[2];
       }
     }
   }
@@ -660,7 +660,7 @@ int AtomVecTri::pack_border(int n, int *list, double *buf,
 /* ---------------------------------------------------------------------- */
 
 int AtomVecTri::pack_border_vel(int n, int *list, double *buf,
-				int pbc_flag, int *pbc)
+                                int pbc_flag, int *pbc)
 {
   int i,j,m;
   double dx,dy,dz,dvx,dvy,dvz;
@@ -679,28 +679,28 @@ int AtomVecTri::pack_border_vel(int n, int *list, double *buf,
       buf[m++] = molecule[j];
       if (tri[j] < 0) buf[m++] = 0;
       else {
-	buf[m++] = 1;
-	quat = bonus[tri[j]].quat;
-	c1 = bonus[tri[j]].c1;
-	c2 = bonus[tri[j]].c2;
-	c3 = bonus[tri[j]].c3;
-	inertia = bonus[tri[j]].inertia;
-	buf[m++] = quat[0];
-	buf[m++] = quat[1];
-	buf[m++] = quat[2];
-	buf[m++] = quat[3];
-	buf[m++] = c1[0];
-	buf[m++] = c1[1];
-	buf[m++] = c1[2];
-	buf[m++] = c2[0];
-	buf[m++] = c2[1];
-	buf[m++] = c2[2];
-	buf[m++] = c3[0];
-	buf[m++] = c3[1];
-	buf[m++] = c3[2];
-	buf[m++] = inertia[0];
-	buf[m++] = inertia[1];
-	buf[m++] = inertia[2];
+        buf[m++] = 1;
+        quat = bonus[tri[j]].quat;
+        c1 = bonus[tri[j]].c1;
+        c2 = bonus[tri[j]].c2;
+        c3 = bonus[tri[j]].c3;
+        inertia = bonus[tri[j]].inertia;
+        buf[m++] = quat[0];
+        buf[m++] = quat[1];
+        buf[m++] = quat[2];
+        buf[m++] = quat[3];
+        buf[m++] = c1[0];
+        buf[m++] = c1[1];
+        buf[m++] = c1[2];
+        buf[m++] = c2[0];
+        buf[m++] = c2[1];
+        buf[m++] = c2[2];
+        buf[m++] = c3[0];
+        buf[m++] = c3[1];
+        buf[m++] = c3[2];
+        buf[m++] = inertia[0];
+        buf[m++] = inertia[1];
+        buf[m++] = inertia[2];
       }
       buf[m++] = v[j][0];
       buf[m++] = v[j][1];
@@ -721,96 +721,96 @@ int AtomVecTri::pack_border_vel(int n, int *list, double *buf,
     }
     if (!deform_vremap) {
       for (i = 0; i < n; i++) {
-	j = list[i];
-	buf[m++] = x[j][0] + dx;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = molecule[j];
-	if (tri[j] < 0) buf[m++] = 0;
-	else {
-	  buf[m++] = 1;
-	  quat = bonus[tri[j]].quat;
-	  c1 = bonus[tri[j]].c1;
-	  c2 = bonus[tri[j]].c2;
-	  c3 = bonus[tri[j]].c3;
-	  inertia = bonus[tri[j]].inertia;
-	  buf[m++] = quat[0];
-	  buf[m++] = quat[1];
-	  buf[m++] = quat[2];
-	  buf[m++] = quat[3];
-	  buf[m++] = c1[0];
-	  buf[m++] = c1[1];
-	  buf[m++] = c1[2];
-	  buf[m++] = c2[0];
-	  buf[m++] = c2[1];
-	  buf[m++] = c2[2];
-	  buf[m++] = c3[0];
-	  buf[m++] = c3[1];
-	  buf[m++] = c3[2];
-	  buf[m++] = inertia[0];
-	  buf[m++] = inertia[1];
-	  buf[m++] = inertia[2];
-	}
-	buf[m++] = v[j][0];
-	buf[m++] = v[j][1];
-	buf[m++] = v[j][2];
-	buf[m++] = angmom[j][0];
-	buf[m++] = angmom[j][1];
-	buf[m++] = angmom[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = molecule[j];
+        if (tri[j] < 0) buf[m++] = 0;
+        else {
+          buf[m++] = 1;
+          quat = bonus[tri[j]].quat;
+          c1 = bonus[tri[j]].c1;
+          c2 = bonus[tri[j]].c2;
+          c3 = bonus[tri[j]].c3;
+          inertia = bonus[tri[j]].inertia;
+          buf[m++] = quat[0];
+          buf[m++] = quat[1];
+          buf[m++] = quat[2];
+          buf[m++] = quat[3];
+          buf[m++] = c1[0];
+          buf[m++] = c1[1];
+          buf[m++] = c1[2];
+          buf[m++] = c2[0];
+          buf[m++] = c2[1];
+          buf[m++] = c2[2];
+          buf[m++] = c3[0];
+          buf[m++] = c3[1];
+          buf[m++] = c3[2];
+          buf[m++] = inertia[0];
+          buf[m++] = inertia[1];
+          buf[m++] = inertia[2];
+        }
+        buf[m++] = v[j][0];
+        buf[m++] = v[j][1];
+        buf[m++] = v[j][2];
+        buf[m++] = angmom[j][0];
+        buf[m++] = angmom[j][1];
+        buf[m++] = angmom[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;
-	buf[m++] = x[j][1] + dy;
-	buf[m++] = x[j][2] + dz;
-	buf[m++] = tag[j];
-	buf[m++] = type[j];
-	buf[m++] = mask[j];
-	buf[m++] = molecule[j];
-	if (tri[j] < 0) buf[m++] = 0;
-	else {
-	  buf[m++] = 1;
-	  quat = bonus[tri[j]].quat;
-	  c1 = bonus[tri[j]].c1;
-	  c2 = bonus[tri[j]].c2;
-	  c3 = bonus[tri[j]].c3;
-	  inertia = bonus[tri[j]].inertia;
-	  buf[m++] = quat[0];
-	  buf[m++] = quat[1];
-	  buf[m++] = quat[2];
-	  buf[m++] = quat[3];
-	  buf[m++] = c1[0];
-	  buf[m++] = c1[1];
-	  buf[m++] = c1[2];
-	  buf[m++] = c2[0];
-	  buf[m++] = c2[1];
-	  buf[m++] = c2[2];
-	  buf[m++] = c3[0];
-	  buf[m++] = c3[1];
-	  buf[m++] = c3[2];
-	  buf[m++] = inertia[0];
-	  buf[m++] = inertia[1];
-	  buf[m++] = inertia[2];
-	}
-	if (mask[i] & deform_groupbit) {
-	  buf[m++] = v[j][0] + dvx;
-	  buf[m++] = v[j][1] + dvy;
-	  buf[m++] = v[j][2] + dvz;
-	} else {
-	  buf[m++] = v[j][0];
-	  buf[m++] = v[j][1];
-	  buf[m++] = v[j][2];
-	}
-	buf[m++] = angmom[j][0];
-	buf[m++] = angmom[j][1];
-	buf[m++] = angmom[j][2];
+        j = list[i];
+        buf[m++] = x[j][0] + dx;
+        buf[m++] = x[j][1] + dy;
+        buf[m++] = x[j][2] + dz;
+        buf[m++] = tag[j];
+        buf[m++] = type[j];
+        buf[m++] = mask[j];
+        buf[m++] = molecule[j];
+        if (tri[j] < 0) buf[m++] = 0;
+        else {
+          buf[m++] = 1;
+          quat = bonus[tri[j]].quat;
+          c1 = bonus[tri[j]].c1;
+          c2 = bonus[tri[j]].c2;
+          c3 = bonus[tri[j]].c3;
+          inertia = bonus[tri[j]].inertia;
+          buf[m++] = quat[0];
+          buf[m++] = quat[1];
+          buf[m++] = quat[2];
+          buf[m++] = quat[3];
+          buf[m++] = c1[0];
+          buf[m++] = c1[1];
+          buf[m++] = c1[2];
+          buf[m++] = c2[0];
+          buf[m++] = c2[1];
+          buf[m++] = c2[2];
+          buf[m++] = c3[0];
+          buf[m++] = c3[1];
+          buf[m++] = c3[2];
+          buf[m++] = inertia[0];
+          buf[m++] = inertia[1];
+          buf[m++] = inertia[2];
+        }
+        if (mask[i] & deform_groupbit) {
+          buf[m++] = v[j][0] + dvx;
+          buf[m++] = v[j][1] + dvy;
+          buf[m++] = v[j][2] + dvz;
+        } else {
+          buf[m++] = v[j][0];
+          buf[m++] = v[j][1];
+          buf[m++] = v[j][2];
+        }
+        buf[m++] = angmom[j][0];
+        buf[m++] = angmom[j][1];
+        buf[m++] = angmom[j][2];
       }
     }
   }
@@ -1012,7 +1012,7 @@ int AtomVecTri::unpack_border_hybrid(int n, int first, double *buf)
 
 /* ----------------------------------------------------------------------
    pack data for atom I for sending to another proc
-   xyz must be 1st 3 values, so comm::exchange() can test on them 
+   xyz must be 1st 3 values, so comm::exchange() can test on them
 ------------------------------------------------------------------------- */
 
 int AtomVecTri::pack_exchange(int i, double *buf)
@@ -1063,7 +1063,7 @@ int AtomVecTri::pack_exchange(int i, double *buf)
   }
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->pack_exchange(i,&buf[m]);
 
   buf[0] = m;
@@ -1125,9 +1125,9 @@ int AtomVecTri::unpack_exchange(double *buf)
   }
 
   if (atom->nextra_grow)
-    for (int iextra = 0; iextra < atom->nextra_grow; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
       m += modify->fix[atom->extra_grow[iextra]]->
-	unpack_exchange(nlocal,&buf[m]);
+        unpack_exchange(nlocal,&buf[m]);
 
   atom->nlocal++;
   return m;
@@ -1149,9 +1149,9 @@ int AtomVecTri::size_restart()
     else n += 17;
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       for (i = 0; i < nlocal; i++)
-	n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
+        n += modify->fix[atom->extra_restart[iextra]]->size_restart(i);
 
   return n;
 }
@@ -1159,7 +1159,7 @@ int AtomVecTri::size_restart()
 /* ----------------------------------------------------------------------
    pack atom I's data for restart file including extra quantities
    xyz must be 1st 3 values, so that read_restart can test on them
-   molecular types may be negative, but write as positive   
+   molecular types may be negative, but write as positive
 ------------------------------------------------------------------------- */
 
 int AtomVecTri::pack_restart(int i, double *buf)
@@ -1210,7 +1210,7 @@ int AtomVecTri::pack_restart(int i, double *buf)
   }
 
   if (atom->nextra_restart)
-    for (int iextra = 0; iextra < atom->nextra_restart; iextra++) 
+    for (int iextra = 0; iextra < atom->nextra_restart; iextra++)
       m += modify->fix[atom->extra_restart[iextra]]->pack_restart(i,&buf[m]);
 
   buf[0] = m;
@@ -1469,7 +1469,7 @@ void AtomVecTri::data_atom_bonus(int m, char **values)
 
   int ierror = MathExtra::jacobi(tensor,bonus[nlocal_bonus].inertia,evectors);
   if (ierror) error->one(FLERR,"Insufficient Jacobi rotations for triangle");
-  
+
   double ex_space[3],ey_space[3],ez_space[3];
   ex_space[0] = evectors[0][0];
   ex_space[1] = evectors[1][0];
@@ -1488,7 +1488,7 @@ void AtomVecTri::data_atom_bonus(int m, char **values)
   if (MathExtra::dot3(norm,ez_space) < 0.0) MathExtra::negate3(ez_space);
 
   // create initial quaternion
-  
+
   MathExtra::exyz_to_q(ex_space,ey_space,ez_space,bonus[nlocal_bonus].quat);
 
   // bonus c1,c2,c3 = displacement of c1,c2,c3 from centroid
@@ -1497,13 +1497,13 @@ void AtomVecTri::data_atom_bonus(int m, char **values)
   double disp[3];
   MathExtra::sub3(c1,centroid,disp);
   MathExtra::transpose_matvec(ex_space,ey_space,ez_space,
-			      disp,bonus[nlocal_bonus].c1);
+                              disp,bonus[nlocal_bonus].c1);
   MathExtra::sub3(c2,centroid,disp);
   MathExtra::transpose_matvec(ex_space,ey_space,ez_space,
-			      disp,bonus[nlocal_bonus].c2);
+                              disp,bonus[nlocal_bonus].c2);
   MathExtra::sub3(c3,centroid,disp);
   MathExtra::transpose_matvec(ex_space,ey_space,ez_space,
-			      disp,bonus[nlocal_bonus].c3);
+                              disp,bonus[nlocal_bonus].c3);
 
   bonus[nlocal_bonus].ilocal = m;
   tri[m] = nlocal_bonus++;
@@ -1536,7 +1536,7 @@ int AtomVecTri::data_vel_hybrid(int m, char **values)
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint AtomVecTri::memory_usage()
diff --git a/src/atom_vec_tri.h b/src/atom_vec_tri.h
index 10a0743bd5..f481c8f072 100644
--- a/src/atom_vec_tri.h
+++ b/src/atom_vec_tri.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/balance.cpp b/src/balance.cpp
index 1af18c5c1b..502794cf69 100644
--- a/src/balance.cpp
+++ b/src/balance.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -102,61 +102,61 @@ void Balance::command(int narg, char **arg)
     if (strcmp(arg[iarg],"x") == 0) {
       if (xflag == DYNAMIC) error->all(FLERR,"Illegal balance command");
       if (strcmp(arg[iarg+1],"uniform") == 0) {
-	if (iarg+2 > narg) error->all(FLERR,"Illegal balance command");
-	xflag = UNIFORM;
-	iarg += 2;
+        if (iarg+2 > narg) error->all(FLERR,"Illegal balance command");
+        xflag = UNIFORM;
+        iarg += 2;
       } else {
-	if (1 + procgrid[0]-1 > narg)
-	  error->all(FLERR,"Illegal balance command");
-	xflag = USER;
-	delete [] user_xsplit;
-	user_xsplit = new double[procgrid[0]+1];
-	user_xsplit[0] = 0.0;
-	iarg++;
-	for (int i = 1; i < procgrid[0]; i++)
-	  user_xsplit[i] = force->numeric(arg[iarg++]);
-	user_xsplit[procgrid[0]] = 1.0;
+        if (1 + procgrid[0]-1 > narg)
+          error->all(FLERR,"Illegal balance command");
+        xflag = USER;
+        delete [] user_xsplit;
+        user_xsplit = new double[procgrid[0]+1];
+        user_xsplit[0] = 0.0;
+        iarg++;
+        for (int i = 1; i < procgrid[0]; i++)
+          user_xsplit[i] = force->numeric(arg[iarg++]);
+        user_xsplit[procgrid[0]] = 1.0;
       }
     } else if (strcmp(arg[iarg],"y") == 0) {
       if (yflag == DYNAMIC) error->all(FLERR,"Illegal balance command");
       if (strcmp(arg[iarg+1],"uniform") == 0) {
-	if (iarg+2 > narg) error->all(FLERR,"Illegal balance command");
-	yflag = UNIFORM;
-	iarg += 2;
+        if (iarg+2 > narg) error->all(FLERR,"Illegal balance command");
+        yflag = UNIFORM;
+        iarg += 2;
       } else {
-	if (1 + procgrid[1]-1 > narg)
-	  error->all(FLERR,"Illegal balance command");
-	yflag = USER;
-	delete [] user_ysplit;
-	user_ysplit = new double[procgrid[1]+1];
-	user_ysplit[0] = 0.0;
-	iarg++;
-	for (int i = 1; i < procgrid[1]; i++)
-	  user_ysplit[i] = force->numeric(arg[iarg++]);
-	user_ysplit[procgrid[1]] = 1.0;
+        if (1 + procgrid[1]-1 > narg)
+          error->all(FLERR,"Illegal balance command");
+        yflag = USER;
+        delete [] user_ysplit;
+        user_ysplit = new double[procgrid[1]+1];
+        user_ysplit[0] = 0.0;
+        iarg++;
+        for (int i = 1; i < procgrid[1]; i++)
+          user_ysplit[i] = force->numeric(arg[iarg++]);
+        user_ysplit[procgrid[1]] = 1.0;
       }
     } else if (strcmp(arg[iarg],"z") == 0) {
       if (zflag == DYNAMIC) error->all(FLERR,"Illegal balance command");
       if (strcmp(arg[iarg+1],"uniform") == 0) {
-	if (iarg+2 > narg) error->all(FLERR,"Illegal balance command");
-	zflag = UNIFORM;
-	iarg += 2;
+        if (iarg+2 > narg) error->all(FLERR,"Illegal balance command");
+        zflag = UNIFORM;
+        iarg += 2;
       } else {
-	if (1 + procgrid[2]-1 > narg)
-	  error->all(FLERR,"Illegal balance command");
-	zflag = USER;
-	delete [] user_zsplit;
-	user_zsplit = new double[procgrid[2]+1];
-	user_zsplit[0] = 0.0;
-	iarg++;
-	for (int i = 1; i < procgrid[2]; i++)
-	  user_zsplit[i] = force->numeric(arg[iarg++]);
-	user_zsplit[procgrid[2]] = 1.0;
+        if (1 + procgrid[2]-1 > narg)
+          error->all(FLERR,"Illegal balance command");
+        zflag = USER;
+        delete [] user_zsplit;
+        user_zsplit = new double[procgrid[2]+1];
+        user_zsplit[0] = 0.0;
+        iarg++;
+        for (int i = 1; i < procgrid[2]; i++)
+          user_zsplit[i] = force->numeric(arg[iarg++]);
+        user_zsplit[procgrid[2]] = 1.0;
       }
 
     } else if (strcmp(arg[iarg],"dynamic") == 0) {
       if (xflag != NONE || yflag != NONE || zflag != NONE)
-	error->all(FLERR,"Illegal balance command");
+        error->all(FLERR,"Illegal balance command");
       if (iarg+5 > narg) error->all(FLERR,"Illegal balance command");
       dflag = 1;
       xflag = yflag = DYNAMIC;
@@ -164,7 +164,7 @@ void Balance::command(int narg, char **arg)
       nrepeat = atoi(arg[iarg+1]);
       niter = atoi(arg[iarg+2]);
       if (nrepeat <= 0 || niter <= 0)
-	error->all(FLERR,"Illegal balance command");
+        error->all(FLERR,"Illegal balance command");
       int n = strlen(arg[iarg+3]) + 1;
       bstr = new char[n];
       strcpy(bstr,arg[iarg+3]);
@@ -182,23 +182,23 @@ void Balance::command(int narg, char **arg)
 
   if (xflag == USER)
     for (int i = 1; i <= procgrid[0]; i++)
-      if (user_xsplit[i-1] >= user_xsplit[i]) 
-	error->all(FLERR,"Illegal balance command");
+      if (user_xsplit[i-1] >= user_xsplit[i])
+        error->all(FLERR,"Illegal balance command");
   if (yflag == USER)
     for (int i = 1; i <= procgrid[1]; i++)
-      if (user_ysplit[i-1] >= user_ysplit[i]) 
-	error->all(FLERR,"Illegal balance command");
+      if (user_ysplit[i-1] >= user_ysplit[i])
+        error->all(FLERR,"Illegal balance command");
   if (zflag == USER)
     for (int i = 1; i <= procgrid[2]; i++)
-      if (user_zsplit[i-1] >= user_zsplit[i]) 
-	error->all(FLERR,"Illegal balance command");
+      if (user_zsplit[i-1] >= user_zsplit[i])
+        error->all(FLERR,"Illegal balance command");
 
   if (dflag) {
     for (int i = 0; i < strlen(bstr); i++) {
-      if (bstr[i] != 'x' && bstr[i] != 'y' && bstr[i] != 'z') 
-	error->all(FLERR,"Balance dynamic string is invalid");
-      if (bstr[i] == 'z' && dimension == 2) 
-	error->all(FLERR,"Balance dynamic string is invalid for 2d simulation");
+      if (bstr[i] != 'x' && bstr[i] != 'y' && bstr[i] != 'z')
+        error->all(FLERR,"Balance dynamic string is invalid");
+      if (bstr[i] == 'z' && dimension == 2)
+        error->all(FLERR,"Balance dynamic string is invalid for 2d simulation");
     }
   }
 
@@ -227,19 +227,19 @@ void Balance::command(int narg, char **arg)
   // explicit setting of sub-domain sizes
 
   if (xflag == UNIFORM) {
-    for (int i = 0; i < procgrid[0]; i++) 
+    for (int i = 0; i < procgrid[0]; i++)
       comm->xsplit[i] = i * 1.0/procgrid[0];
     comm->xsplit[procgrid[0]] = 1.0;
   }
 
   if (yflag == UNIFORM) {
-    for (int i = 0; i < procgrid[1]; i++) 
+    for (int i = 0; i < procgrid[1]; i++)
       comm->ysplit[i] = i * 1.0/procgrid[1];
     comm->ysplit[procgrid[1]] = 1.0;
   }
 
   if (zflag == UNIFORM) {
-    for (int i = 0; i < procgrid[2]; i++) 
+    for (int i = 0; i < procgrid[2]; i++)
       comm->zsplit[i] = i * 1.0/procgrid[2];
     comm->zsplit[procgrid[2]] = 1.0;
   }
@@ -276,7 +276,7 @@ void Balance::command(int narg, char **arg)
   } else {
     if (dimension == 3) {
       if (xflag == UNIFORM && yflag == UNIFORM && zflag == UNIFORM)
-	comm->uniform = 1;
+        comm->uniform = 1;
     } else {
       if (xflag == UNIFORM && yflag == UNIFORM) comm->uniform = 1;
     }
@@ -302,8 +302,8 @@ void Balance::command(int narg, char **arg)
   MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
   if (natoms != atom->natoms) {
     char str[128];
-    sprintf(str,"Lost atoms via balance: original " BIGINT_FORMAT 
-	    " current " BIGINT_FORMAT,atom->natoms,natoms);
+    sprintf(str,"Lost atoms via balance: original " BIGINT_FORMAT
+            " current " BIGINT_FORMAT,atom->natoms,natoms);
     error->all(FLERR,str);
   }
 
@@ -316,16 +316,16 @@ void Balance::command(int narg, char **arg)
     if (screen) {
       fprintf(screen,"  iteration count = %d\n",count);
       fprintf(screen,"  initial/final max atoms/proc = %d %d\n",
-	      maxinit,maxfinal);
+              maxinit,maxfinal);
       fprintf(screen,"  initial/final imbalance factor = %g %g\n",
-	      imbinit,imbfinal);
+              imbinit,imbfinal);
     }
     if (logfile) {
       fprintf(logfile,"  iteration count = %d\n",count);
       fprintf(logfile,"  initial/final max atoms/proc = %d %d\n",
-	      maxinit,maxfinal);
+              maxinit,maxfinal);
       fprintf(logfile,"  initial/final imbalance factor = %g %g\n",
-	      imbinit,imbfinal);
+              imbinit,imbfinal);
     }
   }
 
@@ -333,29 +333,29 @@ void Balance::command(int narg, char **arg)
     if (screen) {
       fprintf(screen,"  x cuts:");
       for (int i = 0; i <= comm->procgrid[0]; i++)
-	fprintf(screen," %g",comm->xsplit[i]);
+        fprintf(screen," %g",comm->xsplit[i]);
       fprintf(screen,"\n");
       fprintf(screen,"  y cuts:");
       for (int i = 0; i <= comm->procgrid[1]; i++)
-	fprintf(screen," %g",comm->ysplit[i]);
+        fprintf(screen," %g",comm->ysplit[i]);
       fprintf(screen,"\n");
       fprintf(screen,"  z cuts:");
       for (int i = 0; i <= comm->procgrid[2]; i++)
-	fprintf(screen," %g",comm->zsplit[i]);
+        fprintf(screen," %g",comm->zsplit[i]);
       fprintf(screen,"\n");
     }
     if (logfile) {
       fprintf(logfile,"  x cuts:");
       for (int i = 0; i <= comm->procgrid[0]; i++)
-	fprintf(logfile," %g",comm->xsplit[i]);
+        fprintf(logfile," %g",comm->xsplit[i]);
       fprintf(logfile,"\n");
       fprintf(logfile,"  y cuts:");
       for (int i = 0; i <= comm->procgrid[1]; i++)
-	fprintf(logfile," %g",comm->ysplit[i]);
+        fprintf(logfile," %g",comm->ysplit[i]);
       fprintf(logfile,"\n");
       fprintf(logfile,"  z cuts:");
       for (int i = 0; i <= comm->procgrid[2]; i++)
-	fprintf(logfile," %g",comm->zsplit[i]);
+        fprintf(logfile," %g",comm->zsplit[i]);
       fprintf(logfile,"\n");
     }
   }
@@ -427,7 +427,7 @@ void Balance::dynamic_setup(char *str)
     if (str[i] == 'y') ops[i] = Y;
     if (str[i] == 'z') ops[i] = Z;
   }
-  
+
   splits[0] = comm->xsplit;
   splits[1] = comm->ysplit;
   splits[2] = comm->zsplit;
@@ -452,7 +452,7 @@ void Balance::dynamic_setup(char *str)
 ------------------------------------------------------------------------- */
 
 void Balance::dynamic_setup(int nrepeat_in, int niter_in,
-			    char *str, double thresh_in)
+                            char *str, double thresh_in)
 {
   nrepeat = nrepeat_in;
   niter = niter_in;
@@ -480,12 +480,12 @@ int Balance::dynamic_once()
   for (int irepeat = 0; irepeat < nrepeat; irepeat++) {
     for (i = 0; i < nops; i++) {
       for (m = 0; m < niter; m++) {
-	stats(ops[i],procgrid[ops[i]],splits[ops[i]],counts[ops[i]]);
-	adjust(procgrid[ops[i]],counts[ops[i]],splits[ops[i]]);
-	count++;
+        stats(ops[i],procgrid[ops[i]],splits[ops[i]],counts[ops[i]]);
+        adjust(procgrid[ops[i]],counts[ops[i]],splits[ops[i]]);
+        count++;
 
 #ifdef BALANCE_DEBUG
-	dumpout(-1);
+        dumpout(-1);
 #endif
       }
       imbfactor = imbalance_splits(max);
@@ -523,12 +523,12 @@ int Balance::dynamic()
   for (int irepeat = 0; irepeat < nrepeat; irepeat++) {
     for (i = 0; i < nops; i++) {
       for (m = 0; m < niter; m++) {
-	stats(ops[i],procgrid[ops[i]],splits[ops[i]],counts[ops[i]]);
-	adjust(procgrid[ops[i]],counts[ops[i]],splits[ops[i]]);
-	count++;
+        stats(ops[i],procgrid[ops[i]],splits[ops[i]],counts[ops[i]]);
+        adjust(procgrid[ops[i]],counts[ops[i]],splits[ops[i]]);
+        count++;
 
 #ifdef BALANCE_DEBUG
-	dumpout(-1);
+        dumpout(-1);
 #endif
       }
       imbfactor = imbalance_splits(max);
@@ -632,27 +632,27 @@ void Balance::adjust(int n, bigint *count, double *split)
 
     if (mycount > leftcount && mycount > rightcount) {
       if (mycount-MAX(leftcount,rightcount) >= fabs(leftcount-rightcount)) {
-	if (leftcount <= rightcount) {
-	  targetleft = damp * 
-	    (rightcount-leftcount + (mycount-rightcount)/3.0);
-	  targetright = damp * (mycount-rightcount)/3.0;
-	  cuts[i] = split[i] + targetleft/rho;
-	  cuts[i+1] = split[i+1] - targetright/rho;
-	} else {
-	  targetleft = damp * (mycount-leftcount)/3.0;
-	  targetright = damp * 
-	    (leftcount-rightcount + (mycount-leftcount)/3.0);
-	  cuts[i] = split[i] + targetleft/rho;
-	  cuts[i+1] = split[i+1] - targetright/rho;
-	}
+        if (leftcount <= rightcount) {
+          targetleft = damp *
+            (rightcount-leftcount + (mycount-rightcount)/3.0);
+          targetright = damp * (mycount-rightcount)/3.0;
+          cuts[i] = split[i] + targetleft/rho;
+          cuts[i+1] = split[i+1] - targetright/rho;
+        } else {
+          targetleft = damp * (mycount-leftcount)/3.0;
+          targetright = damp *
+            (leftcount-rightcount + (mycount-leftcount)/3.0);
+          cuts[i] = split[i] + targetleft/rho;
+          cuts[i+1] = split[i+1] - targetright/rho;
+        }
       } else if (leftcount < rightcount) {
-	target = damp * 0.5*(mycount-leftcount);
-	cuts[i] = split[i] + target/rho;
-	cuts[i+1] = split[i+1];
+        target = damp * 0.5*(mycount-leftcount);
+        cuts[i] = split[i] + target/rho;
+        cuts[i+1] = split[i+1];
       } else if (rightcount < leftcount) {
-	target = damp * 0.5*(mycount-rightcount);
-	cuts[i+1] = split[i+1] - target/rho;
-	cuts[i] = split[i];
+        target = damp * 0.5*(mycount-rightcount);
+        cuts[i+1] = split[i+1] - target/rho;
+        cuts[i] = split[i];
       }
 
     // middle slice has more atoms than only left or right slice
@@ -743,32 +743,32 @@ void Balance::dumpout(bigint tstamp)
     if (domain->dimension == 2) {
       int m = 0;
       for (int j = 0; j < comm->procgrid[1]; j++)
-	for (int i = 0; i < comm->procgrid[0]; i++) {
-	  int c1 = j*nx + i + 1;
-	  int c2 = c1 + 1;
-	  int c3 = c2 + nx;
-	  int c4 = c3 - 1;
-	  fprintf(fp,"%d %d %d %d %d %d\n",m+1,m+1,c1,c2,c3,c4);
-	  m++;
-	}
+        for (int i = 0; i < comm->procgrid[0]; i++) {
+          int c1 = j*nx + i + 1;
+          int c2 = c1 + 1;
+          int c3 = c2 + nx;
+          int c4 = c3 - 1;
+          fprintf(fp,"%d %d %d %d %d %d\n",m+1,m+1,c1,c2,c3,c4);
+          m++;
+        }
 
     } else {
       int m = 0;
       for (int k = 0; k < comm->procgrid[2]; k++)
-	for (int j = 0; j < comm->procgrid[1]; j++)
-	  for (int i = 0; i < comm->procgrid[0]; i++) {
-	    int c1 = k*ny*nx + j*nx + i + 1;
-	    int c2 = c1 + 1;
-	    int c3 = c2 + nx;
-	    int c4 = c3 - 1;
-	    int c5 = c1 + ny*nx;
-	    int c6 = c2 + ny*nx;
-	    int c7 = c3 + ny*nx;
-	    int c8 = c4 + ny*nx;
-	    fprintf(fp,"%d %d %d %d %d %d %d %d %d %d\n",
-		    m+1,m+1,c1,c2,c3,c4,c5,c6,c7,c8);
-	    m++;
-	  }
+        for (int j = 0; j < comm->procgrid[1]; j++)
+          for (int i = 0; i < comm->procgrid[0]; i++) {
+            int c1 = k*ny*nx + j*nx + i + 1;
+            int c2 = c1 + 1;
+            int c3 = c2 + nx;
+            int c4 = c3 - 1;
+            int c5 = c1 + ny*nx;
+            int c6 = c2 + ny*nx;
+            int c7 = c3 + ny*nx;
+            int c8 = c4 + ny*nx;
+            fprintf(fp,"%d %d %d %d %d %d %d %d %d %d\n",
+                    m+1,m+1,c1,c2,c3,c4,c5,c6,c7,c8);
+            m++;
+          }
     }
   }
 
@@ -787,9 +787,9 @@ void Balance::dumpout(bigint tstamp)
   fprintf(fp,"ITEM: TIMESTEP\n");
   fprintf(fp,"%ld\n",tstep);
   fprintf(fp,"ITEM: NUMBER OF NODES\n");
-  if (domain->dimension == 2) 
+  if (domain->dimension == 2)
     fprintf(fp,"%d\n",nx*ny);
-  else 
+  else
     fprintf(fp,"%d\n",nx*ny*nz);
   fprintf(fp,"ITEM: BOX BOUNDS\n");
   fprintf(fp,"%g %g\n",boxlo[0],boxhi[0]);
@@ -801,22 +801,22 @@ void Balance::dumpout(bigint tstamp)
     int m = 0;
     for (int j = 0; j < ny; j++)
       for (int i = 0; i < nx; i++) {
-	fprintf(fp,"%d %d %g %g %g\n",m+1,1,
-		boxlo[0] + prd[0]*comm->xsplit[i],
-		boxlo[1] + prd[1]*comm->ysplit[j],
-		0.0);
-	m++;
+        fprintf(fp,"%d %d %g %g %g\n",m+1,1,
+                boxlo[0] + prd[0]*comm->xsplit[i],
+                boxlo[1] + prd[1]*comm->ysplit[j],
+                0.0);
+        m++;
       }
   } else {
     int m = 0;
     for (int k = 0; k < nz; k++)
       for (int j = 0; j < ny; j++)
-	for (int i = 0; i < nx; i++) {
-	  fprintf(fp,"%d %d %g %g %g\n",m+1,1,
-		  boxlo[0] + prd[0]*comm->xsplit[i],
-		  boxlo[1] + prd[1]*comm->ysplit[j],
-		  boxlo[2] + prd[2]*comm->zsplit[j]);
-	  m++;
+        for (int i = 0; i < nx; i++) {
+          fprintf(fp,"%d %d %g %g %g\n",m+1,1,
+                  boxlo[0] + prd[0]*comm->xsplit[i],
+                  boxlo[1] + prd[1]*comm->ysplit[j],
+                  boxlo[2] + prd[2]*comm->zsplit[j]);
+          m++;
       }
   }
 }
diff --git a/src/balance.h b/src/balance.h
index f2a3376b40..68c1ba1e8b 100644
--- a/src/balance.h
+++ b/src/balance.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/bond.cpp b/src/bond.cpp
index 14138ab38d..a054cac495 100644
--- a/src/bond.cpp
+++ b/src/bond.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -77,7 +77,7 @@ void Bond::ev_setup(int eflag, int vflag)
   vflag_either = vflag;
   vflag_global = vflag % 4;
   vflag_atom = vflag / 4;
-  
+
   // reallocate per-atom arrays if necessary
 
   if (eflag_atom && atom->nmax > maxeatom) {
@@ -119,8 +119,8 @@ void Bond::ev_setup(int eflag, int vflag)
 ------------------------------------------------------------------------- */
 
 void Bond::ev_tally(int i, int j, int nlocal, int newton_bond,
-		    double ebond, double fbond,
-		    double delx, double dely, double delz)
+                    double ebond, double fbond,
+                    double delx, double dely, double delz)
 {
   double ebondhalf,v[6];
 
@@ -128,9 +128,9 @@ void Bond::ev_tally(int i, int j, int nlocal, int newton_bond,
     if (eflag_global) {
       if (newton_bond) energy += ebond;
       else {
-	ebondhalf = 0.5*ebond;
-	if (i < nlocal) energy += ebondhalf;
-	if (j < nlocal) energy += ebondhalf;
+        ebondhalf = 0.5*ebond;
+        if (i < nlocal) energy += ebondhalf;
+        if (j < nlocal) energy += ebondhalf;
       }
     }
     if (eflag_atom) {
@@ -150,48 +150,48 @@ void Bond::ev_tally(int i, int j, int nlocal, int newton_bond,
 
     if (vflag_global) {
       if (newton_bond) {
-	virial[0] += v[0];
-	virial[1] += v[1];
-	virial[2] += v[2];
-	virial[3] += v[3];
-	virial[4] += v[4];
-	virial[5] += v[5];
+        virial[0] += v[0];
+        virial[1] += v[1];
+        virial[2] += v[2];
+        virial[3] += v[3];
+        virial[4] += v[4];
+        virial[5] += v[5];
       } else {
-	if (i < nlocal) {
-	  virial[0] += 0.5*v[0];
-	  virial[1] += 0.5*v[1];
-	  virial[2] += 0.5*v[2];
-	  virial[3] += 0.5*v[3];
-	  virial[4] += 0.5*v[4];
-	  virial[5] += 0.5*v[5];
-	}
-	if (j < nlocal) {
-	  virial[0] += 0.5*v[0];
-	  virial[1] += 0.5*v[1];
-	  virial[2] += 0.5*v[2];
-	  virial[3] += 0.5*v[3];
-	  virial[4] += 0.5*v[4];
-	  virial[5] += 0.5*v[5];
-	}
+        if (i < nlocal) {
+          virial[0] += 0.5*v[0];
+          virial[1] += 0.5*v[1];
+          virial[2] += 0.5*v[2];
+          virial[3] += 0.5*v[3];
+          virial[4] += 0.5*v[4];
+          virial[5] += 0.5*v[5];
+        }
+        if (j < nlocal) {
+          virial[0] += 0.5*v[0];
+          virial[1] += 0.5*v[1];
+          virial[2] += 0.5*v[2];
+          virial[3] += 0.5*v[3];
+          virial[4] += 0.5*v[4];
+          virial[5] += 0.5*v[5];
+        }
       }
     }
 
     if (vflag_atom) {
       if (newton_bond || i < nlocal) {
-	vatom[i][0] += 0.5*v[0];
-	vatom[i][1] += 0.5*v[1];
-	vatom[i][2] += 0.5*v[2];
-	vatom[i][3] += 0.5*v[3];
-	vatom[i][4] += 0.5*v[4];
-	vatom[i][5] += 0.5*v[5];
+        vatom[i][0] += 0.5*v[0];
+        vatom[i][1] += 0.5*v[1];
+        vatom[i][2] += 0.5*v[2];
+        vatom[i][3] += 0.5*v[3];
+        vatom[i][4] += 0.5*v[4];
+        vatom[i][5] += 0.5*v[5];
       }
       if (newton_bond || j < nlocal) {
-	vatom[j][0] += 0.5*v[0];
-	vatom[j][1] += 0.5*v[1];
-	vatom[j][2] += 0.5*v[2];
-	vatom[j][3] += 0.5*v[3];
-	vatom[j][4] += 0.5*v[4];
-	vatom[j][5] += 0.5*v[5];
+        vatom[j][0] += 0.5*v[0];
+        vatom[j][1] += 0.5*v[1];
+        vatom[j][2] += 0.5*v[2];
+        vatom[j][3] += 0.5*v[3];
+        vatom[j][4] += 0.5*v[4];
+        vatom[j][5] += 0.5*v[5];
       }
     }
   }
diff --git a/src/bond.h b/src/bond.h
index 7c055d4174..e2a977d5a8 100644
--- a/src/bond.h
+++ b/src/bond.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp
index c85c15b02a..1d853b7fec 100644
--- a/src/bond_hybrid.cpp
+++ b/src/bond_hybrid.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -80,9 +80,9 @@ void BondHybrid::compute(int eflag, int vflag)
     }
     for (m = 0; m < nstyles; m++) {
       if (nbondlist[m] > maxbond[m]) {
-	memory->destroy(bondlist[m]);
-	maxbond[m] = nbondlist[m] + EXTRA;
-	memory->create(bondlist[m],maxbond[m],3,"bond_hybrid:bondlist");
+        memory->destroy(bondlist[m]);
+        maxbond[m] = nbondlist[m] + EXTRA;
+        memory->create(bondlist[m],maxbond[m],3,"bond_hybrid:bondlist");
       }
       nbondlist[m] = 0;
     }
@@ -96,7 +96,7 @@ void BondHybrid::compute(int eflag, int vflag)
       nbondlist[m]++;
     }
   }
-  
+
   // call each sub-style's compute function
   // set neighbor->bondlist to sub-style bondlist before call
   // accumulate sub-style global/peratom energy/virial in hybrid
@@ -124,8 +124,8 @@ void BondHybrid::compute(int eflag, int vflag)
       if (force->newton_bond) n += atom->nghost;
       double **vatom_substyle = styles[m]->vatom;
       for (i = 0; i < n; i++)
-	for (j = 0; j < 6; j++)
-	  vatom[i][j] += vatom_substyle[i][j];
+        for (j = 0; j < 6; j++)
+          vatom[i][j] += vatom_substyle[i][j];
     }
   }
 
@@ -212,11 +212,11 @@ void BondHybrid::settings(int narg, char **arg)
 
   while (i < narg) {
     for (m = 0; m < nstyles; m++)
-      if (strcmp(arg[i],keywords[m]) == 0) 
-	error->all(FLERR,"Bond style hybrid cannot use same pair style twice");
-    if (strcmp(arg[i],"hybrid") == 0) 
+      if (strcmp(arg[i],keywords[m]) == 0)
+        error->all(FLERR,"Bond style hybrid cannot use same pair style twice");
+    if (strcmp(arg[i],"hybrid") == 0)
       error->all(FLERR,"Bond style hybrid cannot have hybrid as an argument");
-    if (strcmp(arg[i],"none") == 0) 
+    if (strcmp(arg[i],"none") == 0)
       error->all(FLERR,"Bond style hybrid cannot have none as an argument");
     styles[nstyles] = force->new_bond(arg[i],lmp->suffix,dummy);
     keywords[nstyles] = new char[strlen(arg[i])+1];
@@ -277,17 +277,17 @@ void BondHybrid::coeff(int narg, char **arg)
 
 void BondHybrid::init_style()
 {
-  for (int m = 0; m < nstyles; m++) 
+  for (int m = 0; m < nstyles; m++)
     if (styles[m]) styles[m]->init_style();
 }
 
 /* ----------------------------------------------------------------------
-   return an equilbrium bond length 
+   return an equilbrium bond length
 ------------------------------------------------------------------------- */
 
 double BondHybrid::equilibrium_distance(int i)
 {
-  if (map[i] < 0) 
+  if (map[i] < 0)
     error->one(FLERR,"Invoked bond equil distance on bond style none");
   return styles[map[i]]->equilibrium_distance(i);
 }
diff --git a/src/bond_hybrid.h b/src/bond_hybrid.h
index 058524161e..57c82b0e63 100644
--- a/src/bond_hybrid.h
+++ b/src/bond_hybrid.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -51,7 +51,7 @@ class BondHybrid : public Bond {
   int *nbondlist;               // # of bonds in sub-style bondlists
   int *maxbond;                 // max # of bonds sub-style lists can store
   int ***bondlist;              // bondlist for each sub-style
-  
+
   void allocate();
 };
 
diff --git a/src/change_box.cpp b/src/change_box.cpp
index 84f7e773da..ddce444e1b 100644
--- a/src/change_box.cpp
+++ b/src/change_box.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -44,12 +44,12 @@ void ChangeBox::command(int narg, char **arg)
 {
   int i;
 
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"Change_box command before simulation box is defined");
   if (narg < 2) error->all(FLERR,"Illegal change_box command");
-  if (modify->nfix_restart_peratom) 
+  if (modify->nfix_restart_peratom)
     error->all(FLERR,"Cannot change_box after "
-	       "reading restart file with per-atom info");
+               "reading restart file with per-atom info");
 
   if (comm->me == 0 && screen) fprintf(screen,"Changing box ...\n");
 
@@ -72,7 +72,7 @@ void ChangeBox::command(int narg, char **arg)
   int iarg = 1;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"x") == 0 || strcmp(arg[iarg],"y") == 0 ||
-	strcmp(arg[iarg],"z") == 0) {
+        strcmp(arg[iarg],"z") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal change_box command");
       ops[nops].style = XYZ;
       if (strcmp(arg[iarg],"x") == 0) ops[nops].dim = X;
@@ -80,45 +80,45 @@ void ChangeBox::command(int narg, char **arg)
       else if (strcmp(arg[iarg],"z") == 0) ops[nops].dim = Z;
 
       if (dimension == 2 && ops[nops].dim == Z)
-	error->all(FLERR,"Cannot change_box in z dimension for 2d simulation");
+        error->all(FLERR,"Cannot change_box in z dimension for 2d simulation");
 
       if (strcmp(arg[iarg+1],"final") == 0) {
-	if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command");
-	ops[nops].flavor = FINAL;
-	ops[nops].flo = atof(arg[iarg+2]);
-	ops[nops].fhi = atof(arg[iarg+3]);
-	ops[nops].vdim1 = ops[nops].vdim2 = -1;
-	nops++;
-	iarg += 4;
+        if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command");
+        ops[nops].flavor = FINAL;
+        ops[nops].flo = atof(arg[iarg+2]);
+        ops[nops].fhi = atof(arg[iarg+3]);
+        ops[nops].vdim1 = ops[nops].vdim2 = -1;
+        nops++;
+        iarg += 4;
       } else if (strcmp(arg[iarg+1],"delta") == 0) {
-	if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command");
-	ops[nops].flavor = DELTA;
-	ops[nops].dlo = atof(arg[iarg+2]);
-	ops[nops].dhi = atof(arg[iarg+3]);
-	ops[nops].vdim1 = ops[nops].vdim2 = -1;
-	nops++;
-	iarg += 4;
+        if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command");
+        ops[nops].flavor = DELTA;
+        ops[nops].dlo = atof(arg[iarg+2]);
+        ops[nops].dhi = atof(arg[iarg+3]);
+        ops[nops].vdim1 = ops[nops].vdim2 = -1;
+        nops++;
+        iarg += 4;
       } else if (strcmp(arg[iarg+1],"scale") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command");
-	ops[nops].flavor = SCALE;
-	ops[nops].scale = atof(arg[iarg+2]);
-	ops[nops].vdim1 = ops[nops].vdim2 = -1;
-	nops++;
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command");
+        ops[nops].flavor = SCALE;
+        ops[nops].scale = atof(arg[iarg+2]);
+        ops[nops].vdim1 = ops[nops].vdim2 = -1;
+        nops++;
+        iarg += 3;
       } else if (strcmp(arg[iarg+1],"volume") == 0) {
-	if (nops == 0 || ops[nops-1].style != XYZ || 
-	    ops[nops].dim == ops[nops-1].dim)
-	  error->all(FLERR,"Change_box volume used incorrectly");
-	if (ops[nops-1].vdim2 >= 0)
-	  error->all(FLERR,"Change_box volume used incorrectly");
-	else if (ops[nops-1].vdim1 >= 0) ops[nops-1].vdim2 = ops[nops].dim;
-	else ops[nops-1].vdim1 = ops[nops].dim;
-	iarg += 2;
+        if (nops == 0 || ops[nops-1].style != XYZ ||
+            ops[nops].dim == ops[nops-1].dim)
+          error->all(FLERR,"Change_box volume used incorrectly");
+        if (ops[nops-1].vdim2 >= 0)
+          error->all(FLERR,"Change_box volume used incorrectly");
+        else if (ops[nops-1].vdim1 >= 0) ops[nops-1].vdim2 = ops[nops].dim;
+        else ops[nops-1].vdim1 = ops[nops].dim;
+        iarg += 2;
 
       } else error->all(FLERR,"Illegal change_box command");
 
     } else if (strcmp(arg[iarg],"xy") == 0 || strcmp(arg[iarg],"xz") == 0 ||
-	strcmp(arg[iarg],"yz") == 0) {
+        strcmp(arg[iarg],"yz") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal change_box command");
       ops[nops].style = TILT;
       if (strcmp(arg[iarg],"xy") == 0) ops[nops].dim = XY;
@@ -126,20 +126,20 @@ void ChangeBox::command(int narg, char **arg)
       else if (strcmp(arg[iarg],"yz") == 0) ops[nops].dim = YZ;
 
       if (dimension == 2 && (ops[nops].dim == XZ || ops[nops].dim == YZ))
-	error->all(FLERR,"Cannot change_box in xz or yz for 2d simulation");
+        error->all(FLERR,"Cannot change_box in xz or yz for 2d simulation");
 
       if (strcmp(arg[iarg+1],"final") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command");
-	ops[nops].flavor = FINAL;
-	ops[nops].ftilt = atof(arg[iarg+2]);
-	nops++;
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command");
+        ops[nops].flavor = FINAL;
+        ops[nops].ftilt = atof(arg[iarg+2]);
+        nops++;
+        iarg += 3;
       } else if (strcmp(arg[iarg+1],"delta") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command");
-	ops[nops].flavor = DELTA;
-	ops[nops].dtilt = atof(arg[iarg+2]);
-	nops++;
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command");
+        ops[nops].flavor = DELTA;
+        ops[nops].dtilt = atof(arg[iarg+2]);
+        nops++;
+        iarg += 3;
       } else error->all(FLERR,"Illegal change_box command");
 
     } else if (strcmp(arg[iarg],"boundary") == 0) {
@@ -216,85 +216,85 @@ void ChangeBox::command(int narg, char **arg)
       else volume = domain->xprd * domain->yprd * domain->zprd;
 
       if (ops[i].flavor == FINAL) {
-	domain->boxlo[ops[i].dim] = scale[ops[i].dim]*ops[i].flo;
-	domain->boxhi[ops[i].dim] = scale[ops[i].dim]*ops[i].fhi;
-	if (ops[i].vdim1 >= 0) 
-	  volume_preserve(ops[i].vdim1,ops[i].vdim2,volume);
-	domain->set_initial_box();
-	domain->set_global_box();
-	domain->set_local_box();
-	domain->print_box("  ");
+        domain->boxlo[ops[i].dim] = scale[ops[i].dim]*ops[i].flo;
+        domain->boxhi[ops[i].dim] = scale[ops[i].dim]*ops[i].fhi;
+        if (ops[i].vdim1 >= 0)
+          volume_preserve(ops[i].vdim1,ops[i].vdim2,volume);
+        domain->set_initial_box();
+        domain->set_global_box();
+        domain->set_local_box();
+        domain->print_box("  ");
 
       } else if (ops[i].flavor == DELTA) {
-	domain->boxlo[ops[i].dim] += scale[ops[i].dim]*ops[i].dlo;
-	domain->boxhi[ops[i].dim] += scale[ops[i].dim]*ops[i].dhi;
-	if (ops[i].vdim1 >= 0) 
-	  volume_preserve(ops[i].vdim1,ops[i].vdim2,volume);
-	domain->set_initial_box();
-	domain->set_global_box();
-	domain->set_local_box();
-	domain->print_box("  ");
+        domain->boxlo[ops[i].dim] += scale[ops[i].dim]*ops[i].dlo;
+        domain->boxhi[ops[i].dim] += scale[ops[i].dim]*ops[i].dhi;
+        if (ops[i].vdim1 >= 0)
+          volume_preserve(ops[i].vdim1,ops[i].vdim2,volume);
+        domain->set_initial_box();
+        domain->set_global_box();
+        domain->set_local_box();
+        domain->print_box("  ");
 
       } else if (ops[i].flavor == SCALE) {
-	double mid = 0.5 * 
-	  (domain->boxlo[ops[i].dim] + domain->boxhi[ops[i].dim]);
-	double delta = domain->boxlo[ops[i].dim] - mid;
-	domain->boxlo[ops[i].dim] = mid + ops[i].scale*delta;
-	delta = domain->boxhi[ops[i].dim] - mid;
-	domain->boxhi[ops[i].dim] = mid + ops[i].scale*delta;
-	if (ops[i].vdim1 >= 0) 
-	  volume_preserve(ops[i].vdim1,ops[i].vdim2,volume);
-	domain->set_initial_box();
-	domain->set_global_box();
-	domain->set_local_box();
-	domain->print_box("  ");
+        double mid = 0.5 *
+          (domain->boxlo[ops[i].dim] + domain->boxhi[ops[i].dim]);
+        double delta = domain->boxlo[ops[i].dim] - mid;
+        domain->boxlo[ops[i].dim] = mid + ops[i].scale*delta;
+        delta = domain->boxhi[ops[i].dim] - mid;
+        domain->boxhi[ops[i].dim] = mid + ops[i].scale*delta;
+        if (ops[i].vdim1 >= 0)
+          volume_preserve(ops[i].vdim1,ops[i].vdim2,volume);
+        domain->set_initial_box();
+        domain->set_global_box();
+        domain->set_local_box();
+        domain->print_box("  ");
       }
 
     } else if (ops[i].style == TILT) {
       if (domain->triclinic == 0)
-	error->all(FLERR,"Cannot change box tilt factors for orthogonal box");
-      
+        error->all(FLERR,"Cannot change box tilt factors for orthogonal box");
+
       if (ops[i].flavor == FINAL) {
-	if (ops[i].dim == XY) domain->xy = scale[X]*ops[i].ftilt;
-	else if (ops[i].dim == XZ) domain->xz = scale[X]*ops[i].ftilt;
-	else if (ops[i].dim == YZ) domain->yz = scale[Y]*ops[i].ftilt;
-	domain->set_initial_box();
-	domain->set_global_box();
-	domain->set_local_box();
-	domain->print_box("  ");
+        if (ops[i].dim == XY) domain->xy = scale[X]*ops[i].ftilt;
+        else if (ops[i].dim == XZ) domain->xz = scale[X]*ops[i].ftilt;
+        else if (ops[i].dim == YZ) domain->yz = scale[Y]*ops[i].ftilt;
+        domain->set_initial_box();
+        domain->set_global_box();
+        domain->set_local_box();
+        domain->print_box("  ");
 
       } else if (ops[i].flavor == DELTA) {
-	if (ops[i].dim == XY) domain->xy += scale[X]*ops[i].dtilt;
-	else if (ops[i].dim == XZ) domain->xz += scale[X]*ops[i].dtilt;
-	else if (ops[i].dim == YZ) domain->yz += scale[Y]*ops[i].dtilt;
-	domain->set_initial_box();
-	domain->set_global_box();
-	domain->set_local_box();
-	domain->print_box("  ");
+        if (ops[i].dim == XY) domain->xy += scale[X]*ops[i].dtilt;
+        else if (ops[i].dim == XZ) domain->xz += scale[X]*ops[i].dtilt;
+        else if (ops[i].dim == YZ) domain->yz += scale[Y]*ops[i].dtilt;
+        domain->set_initial_box();
+        domain->set_global_box();
+        domain->set_local_box();
+        domain->print_box("  ");
       }
 
     } else if (ops[i].style == BOUNDARY) {
       domain->set_boundary(3,&arg[ops[i].boundindex],1);
       if (domain->dimension == 2 && domain->zperiodic == 0)
-	error->all(FLERR,
-		   "Cannot change box z boundary to "
-		   "nonperiodic for a 2d simulation");
+        error->all(FLERR,
+                   "Cannot change box z boundary to "
+                   "nonperiodic for a 2d simulation");
       domain->set_initial_box();
       domain->set_global_box();
       domain->set_local_box();
-      
+
     } else if (ops[i].style == ORTHO) {
       if (domain->xy != 0.0 || domain->yz != 0.0 || domain->xz != 0.0)
-	error->all(FLERR,
-		   "Cannot change box to orthogonal when tilt is non-zero");
+        error->all(FLERR,
+                   "Cannot change box to orthogonal when tilt is non-zero");
       if (output->ndump)
-	error->all(FLERR,
-		   "Cannot change box ortho/triclinic with dumps defined");
+        error->all(FLERR,
+                   "Cannot change box ortho/triclinic with dumps defined");
       for (int i = 0; i < modify->nfix; i++)
-	if (modify->fix[i]->no_change_box)
-	  error->all(FLERR,
-		     "Cannot change box ortho/triclinic with "
-		     "certain fixes defined");
+        if (modify->fix[i]->no_change_box)
+          error->all(FLERR,
+                     "Cannot change box ortho/triclinic with "
+                     "certain fixes defined");
       domain->triclinic = 0;
       domain->set_initial_box();
       domain->set_global_box();
@@ -303,13 +303,13 @@ void ChangeBox::command(int narg, char **arg)
 
     } else if (ops[i].style == TRICLINIC) {
       if (output->ndump)
-	error->all(FLERR,
-		   "Cannot change box ortho/triclinic with dumps defined");
+        error->all(FLERR,
+                   "Cannot change box ortho/triclinic with dumps defined");
       for (int i = 0; i < modify->nfix; i++)
-	if (modify->fix[i]->no_change_box)
-	  error->all(FLERR,
-		     "Cannot change box ortho/triclinic with "
-		     "certain fixes defined");
+        if (modify->fix[i]->no_change_box)
+          error->all(FLERR,
+                     "Cannot change box ortho/triclinic with "
+                     "certain fixes defined");
       domain->triclinic = 1;
       domain->set_lamda_box();
       domain->set_initial_box();
@@ -329,14 +329,14 @@ void ChangeBox::command(int narg, char **arg)
       double **x = atom->x;
       int *mask = atom->mask;
       int nlocal = atom->nlocal;
-      
+
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit)
-	  domain->x2lamda(x[i],x[i],boxlo,h_inv);
-      
+        if (mask[i] & groupbit)
+          domain->x2lamda(x[i],x[i],boxlo,h_inv);
+
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit)
-	  domain->lamda2x(x[i],x[i]);
+        if (mask[i] & groupbit)
+          domain->lamda2x(x[i],x[i]);
 
       save_box_state();
     }
@@ -374,8 +374,8 @@ void ChangeBox::command(int narg, char **arg)
   MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
   if (natoms != atom->natoms && comm->me == 0) {
     char str[128];
-    sprintf(str,"Lost atoms via change_box: original " BIGINT_FORMAT 
-	    " current " BIGINT_FORMAT,atom->natoms,natoms);
+    sprintf(str,"Lost atoms via change_box: original " BIGINT_FORMAT
+            " current " BIGINT_FORMAT,atom->natoms,natoms);
     error->warning(FLERR,str);
   }
 }
diff --git a/src/change_box.h b/src/change_box.h
index 10c3810aa4..4592cf7031 100644
--- a/src/change_box.h
+++ b/src/change_box.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/comm.cpp b/src/comm.cpp
index 49ba0cad71..69d096e873 100644
--- a/src/comm.cpp
+++ b/src/comm.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -57,7 +57,7 @@ enum{ONELEVEL,TWOLEVEL,NUMA,CUSTOM};
 enum{CART,CARTREORDER,XYZ};
 
 /* ----------------------------------------------------------------------
-   setup MPI and allocate buffer space 
+   setup MPI and allocate buffer space
 ------------------------------------------------------------------------- */
 
 Comm::Comm(LAMMPS *lmp) : Pointers(lmp)
@@ -162,11 +162,11 @@ void Comm::set_proc_grid()
     MPI_Status status;
     if (me == 0) {
       MPI_Recv(other_procgrid,3,MPI_INT,
-	       universe->root_proc[recv_from_partition],0,
-	       universe->uworld,&status);
+               universe->root_proc[recv_from_partition],0,
+               universe->uworld,&status);
       MPI_Recv(other_coregrid,3,MPI_INT,
-	       universe->root_proc[recv_from_partition],0,
-	       universe->uworld,&status);
+               universe->root_proc[recv_from_partition],0,
+               universe->uworld,&status);
     }
     MPI_Bcast(other_procgrid,3,MPI_INT,0,world);
     MPI_Bcast(other_coregrid,3,MPI_INT,0,world);
@@ -181,12 +181,12 @@ void Comm::set_proc_grid()
 
   if (gridflag == ONELEVEL) {
     pmap->onelevel_grid(nprocs,user_procgrid,procgrid,
-			otherflag,other_style,other_procgrid,other_coregrid);
+                        otherflag,other_style,other_procgrid,other_coregrid);
 
   } else if (gridflag == TWOLEVEL) {
     pmap->twolevel_grid(nprocs,user_procgrid,procgrid,
-			ncores,user_coregrid,coregrid,
-			otherflag,other_style,other_procgrid,other_coregrid);
+                        ncores,user_coregrid,coregrid,
+                        otherflag,other_style,other_procgrid,other_coregrid);
 
   } else if (gridflag == NUMA) {
     pmap->numa_grid(nprocs,user_procgrid,procgrid,coregrid);
@@ -207,7 +207,7 @@ void Comm::set_proc_grid()
 
   if (grid2proc) memory->destroy(grid2proc);
   memory->create(grid2proc,procgrid[0],procgrid[1],procgrid[2],
-		 "comm:grid2proc");
+                 "comm:grid2proc");
 
   // map processor IDs to 3d processor grid
   // produces myloc, procneigh, grid2proc
@@ -227,7 +227,7 @@ void Comm::set_proc_grid()
       pmap->cart_map(1,procgrid,ncores,coregrid,myloc,procneigh,grid2proc);
     else if (mapflag == XYZ)
       pmap->xyz_map(xyz,procgrid,ncores,coregrid,myloc,procneigh,grid2proc);
-    
+
   } else if (gridflag == NUMA) {
     pmap->numa_map(0,coregrid,myloc,procneigh,grid2proc);
 
@@ -240,17 +240,17 @@ void Comm::set_proc_grid()
   if (me == 0) {
     if (screen) {
       fprintf(screen,"  %d by %d by %d MPI processor grid\n",
-	      procgrid[0],procgrid[1],procgrid[2]);
-      if (gridflag == NUMA || gridflag == TWOLEVEL) 
-	fprintf(screen,"  %d by %d by %d core grid within node\n",
-		coregrid[0],coregrid[1],coregrid[2]);
+              procgrid[0],procgrid[1],procgrid[2]);
+      if (gridflag == NUMA || gridflag == TWOLEVEL)
+        fprintf(screen,"  %d by %d by %d core grid within node\n",
+                coregrid[0],coregrid[1],coregrid[2]);
     }
     if (logfile) {
       fprintf(logfile,"  %d by %d by %d MPI processor grid\n",
-	      procgrid[0],procgrid[1],procgrid[2]);
-      if (gridflag == NUMA || gridflag == TWOLEVEL) 
-	fprintf(logfile,"  %d by %d by %d core grid within node\n",
-		coregrid[0],coregrid[1],coregrid[2]);
+              procgrid[0],procgrid[1],procgrid[2]);
+      if (gridflag == NUMA || gridflag == TWOLEVEL)
+        fprintf(logfile,"  %d by %d by %d core grid within node\n",
+                coregrid[0],coregrid[1],coregrid[2]);
     }
   }
 
@@ -288,11 +288,11 @@ void Comm::set_proc_grid()
   if (send_to_partition >= 0) {
     if (me == 0) {
       MPI_Send(procgrid,3,MPI_INT,
-	       universe->root_proc[send_to_partition],0,
-	       universe->uworld);
+               universe->root_proc[send_to_partition],0,
+               universe->uworld);
       MPI_Send(coregrid,3,MPI_INT,
-	       universe->root_proc[send_to_partition],0,
-	       universe->uworld);
+               universe->root_proc[send_to_partition],0,
+               universe->uworld);
     }
   }
 }
@@ -383,7 +383,7 @@ void Comm::setup()
   int i;
   int ntypes = atom->ntypes;
   double *prd,*sublo,*subhi;
-  
+
   double cut = MAX(neighbor->cutneighmax,cutghostuser);
 
   if (triclinic == 0) {
@@ -395,8 +395,8 @@ void Comm::setup()
     if (style == MULTI) {
       double *cuttype = neighbor->cuttype;
       for (i = 1; i <= ntypes; i++)
-	cutghostmulti[i][0] = cutghostmulti[i][1] = cutghostmulti[i][2] = 
-	  cuttype[i];
+        cutghostmulti[i][0] = cutghostmulti[i][1] = cutghostmulti[i][2] =
+          cuttype[i];
     }
 
   } else {
@@ -415,9 +415,9 @@ void Comm::setup()
     if (style == MULTI) {
       double *cuttype = neighbor->cuttype;
       for (i = 1; i <= ntypes; i++) {
-	cutghostmulti[i][0] = cuttype[i] * length0;
-	cutghostmulti[i][1] = cuttype[i] * length1;
-	cutghostmulti[i][2] = cuttype[i] * length2;
+        cutghostmulti[i][0] = cuttype[i] * length0;
+        cutghostmulti[i][1] = cuttype[i] * length1;
+        cutghostmulti[i][2] = cuttype[i] * length2;
       }
     }
   }
@@ -460,8 +460,8 @@ void Comm::setup()
       right = myloc[0] + 1;
       if (right == procgrid[0]) right = 0;
       sendneed[0][1] = MIN(maxneed[0],right);
-    } else recvneed[0][0] = recvneed[0][1] = 
-	     sendneed[0][0] = sendneed[0][1] = maxneed[0];
+    } else recvneed[0][0] = recvneed[0][1] =
+             sendneed[0][0] = sendneed[0][1] = maxneed[0];
 
     if (!periodicity[1]) {
       recvneed[1][0] = MIN(maxneed[1],myloc[1]);
@@ -472,8 +472,8 @@ void Comm::setup()
       right = myloc[1] + 1;
       if (right == procgrid[1]) right = 0;
       sendneed[1][1] = MIN(maxneed[1],right);
-    } else recvneed[1][0] = recvneed[1][1] = 
-	     sendneed[1][0] = sendneed[1][1] = maxneed[1];
+    } else recvneed[1][0] = recvneed[1][1] =
+             sendneed[1][0] = sendneed[1][1] = maxneed[1];
 
     if (!periodicity[2]) {
       recvneed[2][0] = MIN(maxneed[2],myloc[2]);
@@ -484,8 +484,8 @@ void Comm::setup()
       right = myloc[2] + 1;
       if (right == procgrid[2]) right = 0;
       sendneed[2][1] = MIN(maxneed[2],right);
-    } else recvneed[2][0] = recvneed[2][1] = 
-	     sendneed[2][0] = sendneed[2][1] = maxneed[2];
+    } else recvneed[2][0] = recvneed[2][1] =
+             sendneed[2][0] = sendneed[2][1] = maxneed[2];
 
   } else {
     recvneed[0][0] = updown(0,0,myloc[0],prd[0],periodicity[0],xsplit);
@@ -506,7 +506,7 @@ void Comm::setup()
     if (right == procgrid[1]) right = 0;
     sendneed[1][1] = updown(1,0,right,prd[1],periodicity[1],ysplit);
 
-    if (domain->dimension == 3) { 
+    if (domain->dimension == 3) {
       recvneed[2][0] = updown(2,0,myloc[2],prd[2],periodicity[2],zsplit);
       recvneed[2][1] = updown(2,1,myloc[2],prd[2],periodicity[2],zsplit);
       left = myloc[2] - 1;
@@ -515,8 +515,8 @@ void Comm::setup()
       right = myloc[2] + 1;
       if (right == procgrid[2]) right = 0;
       sendneed[2][1] = updown(2,0,right,prd[2],periodicity[2],zsplit);
-    } else recvneed[2][0] = recvneed[2][1] = 
-	     sendneed[2][0] = sendneed[2][1] = 0;
+    } else recvneed[2][0] = recvneed[2][1] =
+             sendneed[2][0] = sendneed[2][1] = 0;
 
     int all[6];
     MPI_Allreduce(&recvneed[0][0],all,6,MPI_INT,MPI_MAX,world);
@@ -554,55 +554,55 @@ void Comm::setup()
     for (ineed = 0; ineed < 2*maxneed[dim]; ineed++) {
       pbc_flag[iswap] = 0;
       pbc[iswap][0] = pbc[iswap][1] = pbc[iswap][2] =
-	pbc[iswap][3] = pbc[iswap][4] = pbc[iswap][5] = 0;
-      
+        pbc[iswap][3] = pbc[iswap][4] = pbc[iswap][5] = 0;
+
       if (ineed % 2 == 0) {
-	sendproc[iswap] = procneigh[dim][0];
-	recvproc[iswap] = procneigh[dim][1];
-	if (style == SINGLE) {
-	  if (ineed < 2) slablo[iswap] = -BIG;
-	  else slablo[iswap] = 0.5 * (sublo[dim] + subhi[dim]);
-	  slabhi[iswap] = sublo[dim] + cutghost[dim];
-	} else {
-	  for (i = 1; i <= ntypes; i++) {
-	    if (ineed < 2) multilo[iswap][i] = -BIG;
-	    else multilo[iswap][i] = 0.5 * (sublo[dim] + subhi[dim]);
-	    multihi[iswap][i] = sublo[dim] + cutghostmulti[i][dim];
-	  }
-	}
-	if (myloc[dim] == 0) {
-	  pbc_flag[iswap] = 1;
-	  pbc[iswap][dim] = 1;
-	  if (triclinic) {
-	    if (dim == 1) pbc[iswap][5] = 1;
-	    else if (dim == 2) pbc[iswap][4] = pbc[iswap][3] = 1;
-	  }
-	}
-	
+        sendproc[iswap] = procneigh[dim][0];
+        recvproc[iswap] = procneigh[dim][1];
+        if (style == SINGLE) {
+          if (ineed < 2) slablo[iswap] = -BIG;
+          else slablo[iswap] = 0.5 * (sublo[dim] + subhi[dim]);
+          slabhi[iswap] = sublo[dim] + cutghost[dim];
+        } else {
+          for (i = 1; i <= ntypes; i++) {
+            if (ineed < 2) multilo[iswap][i] = -BIG;
+            else multilo[iswap][i] = 0.5 * (sublo[dim] + subhi[dim]);
+            multihi[iswap][i] = sublo[dim] + cutghostmulti[i][dim];
+          }
+        }
+        if (myloc[dim] == 0) {
+          pbc_flag[iswap] = 1;
+          pbc[iswap][dim] = 1;
+          if (triclinic) {
+            if (dim == 1) pbc[iswap][5] = 1;
+            else if (dim == 2) pbc[iswap][4] = pbc[iswap][3] = 1;
+          }
+        }
+
       } else {
-	sendproc[iswap] = procneigh[dim][1];
-	recvproc[iswap] = procneigh[dim][0];
-	if (style == SINGLE) {
-	  slablo[iswap] = subhi[dim] - cutghost[dim];
-	  if (ineed < 2) slabhi[iswap] = BIG;
-	  else slabhi[iswap] = 0.5 * (sublo[dim] + subhi[dim]);
-	} else {
-	  for (i = 1; i <= ntypes; i++) {
-	    multilo[iswap][i] = subhi[dim] - cutghostmulti[i][dim];
-	    if (ineed < 2) multihi[iswap][i] = BIG;
-	    else multihi[iswap][i] = 0.5 * (sublo[dim] + subhi[dim]);
-	  }
-	}
-	if (myloc[dim] == procgrid[dim]-1) {
-	  pbc_flag[iswap] = 1;
-	  pbc[iswap][dim] = -1;
-	  if (triclinic) {
-	    if (dim == 1) pbc[iswap][5] = -1;
-	    else if (dim == 2) pbc[iswap][4] = pbc[iswap][3] = -1;
-	  }
-	}
+        sendproc[iswap] = procneigh[dim][1];
+        recvproc[iswap] = procneigh[dim][0];
+        if (style == SINGLE) {
+          slablo[iswap] = subhi[dim] - cutghost[dim];
+          if (ineed < 2) slabhi[iswap] = BIG;
+          else slabhi[iswap] = 0.5 * (sublo[dim] + subhi[dim]);
+        } else {
+          for (i = 1; i <= ntypes; i++) {
+            multilo[iswap][i] = subhi[dim] - cutghostmulti[i][dim];
+            if (ineed < 2) multihi[iswap][i] = BIG;
+            else multihi[iswap][i] = 0.5 * (sublo[dim] + subhi[dim]);
+          }
+        }
+        if (myloc[dim] == procgrid[dim]-1) {
+          pbc_flag[iswap] = 1;
+          pbc[iswap][dim] = -1;
+          if (triclinic) {
+            if (dim == 1) pbc[iswap][5] = -1;
+            else if (dim == 2) pbc[iswap][4] = pbc[iswap][3] = -1;
+          }
+        }
       }
-      
+
       iswap++;
     }
   }
@@ -617,8 +617,8 @@ void Comm::setup()
    return how many procs away are needed to encompass cutghost away from loc
 ------------------------------------------------------------------------- */
 
-int Comm::updown(int dim, int dir, int loc, 
-		 double prd, int periodicity, double *split)
+int Comm::updown(int dim, int dir, int loc,
+                 double prd, int periodicity, double *split)
 {
   int index,count;
   double frac,delta;
@@ -630,8 +630,8 @@ int Comm::updown(int dim, int dir, int loc,
     count = 0;
     while (delta < frac) {
       if (index < 0) {
-	if (!periodicity) break;
-	index = procgrid[dim] - 1;
+        if (!periodicity) break;
+        index = procgrid[dim] - 1;
       }
       count++;
       delta += split[index+1] - split[index];
@@ -645,8 +645,8 @@ int Comm::updown(int dim, int dir, int loc,
     count = 0;
     while (delta < frac) {
       if (index >= procgrid[dim]) {
-	if (!periodicity) break;
-	index = 0;
+        if (!periodicity) break;
+        index = 0;
       }
       count++;
       delta += split[index+1] - split[index];
@@ -655,7 +655,7 @@ int Comm::updown(int dim, int dir, int loc,
   }
 
   return count;
-}  
+}
 
 /* ----------------------------------------------------------------------
    forward communication of atom coords every timestep
@@ -678,59 +678,59 @@ void Comm::forward_comm(int dummy)
   for (int iswap = 0; iswap < nswap; iswap++) {
     if (sendproc[iswap] != me) {
       if (comm_x_only) {
-	if (size_forward_recv[iswap]) buf = x[firstrecv[iswap]];
-	else buf = NULL;
-	if (size_forward_recv[iswap])
-	  MPI_Irecv(buf,size_forward_recv[iswap],MPI_DOUBLE,
-		    recvproc[iswap],0,world,&request);
-	n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
-			    buf_send,pbc_flag[iswap],pbc[iswap]);
-	if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	if (size_forward_recv[iswap]) MPI_Wait(&request,&status);
+        if (size_forward_recv[iswap]) buf = x[firstrecv[iswap]];
+        else buf = NULL;
+        if (size_forward_recv[iswap])
+          MPI_Irecv(buf,size_forward_recv[iswap],MPI_DOUBLE,
+                    recvproc[iswap],0,world,&request);
+        n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
+                            buf_send,pbc_flag[iswap],pbc[iswap]);
+        if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+        if (size_forward_recv[iswap]) MPI_Wait(&request,&status);
       } else if (ghost_velocity) {
-	if (size_forward_recv[iswap])
-	  MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
-		    recvproc[iswap],0,world,&request);
-	n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
-				buf_send,pbc_flag[iswap],pbc[iswap]);
-	if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	if (size_forward_recv[iswap]) MPI_Wait(&request,&status);
-	avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_recv);
+        if (size_forward_recv[iswap])
+          MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
+                    recvproc[iswap],0,world,&request);
+        n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
+                                buf_send,pbc_flag[iswap],pbc[iswap]);
+        if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+        if (size_forward_recv[iswap]) MPI_Wait(&request,&status);
+        avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_recv);
       } else {
-	if (size_forward_recv[iswap])
-	  MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
-		    recvproc[iswap],0,world,&request);
-	n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
-			    buf_send,pbc_flag[iswap],pbc[iswap]);
-	if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	if (size_forward_recv[iswap]) MPI_Wait(&request,&status);
-	avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv);
+        if (size_forward_recv[iswap])
+          MPI_Irecv(buf_recv,size_forward_recv[iswap],MPI_DOUBLE,
+                    recvproc[iswap],0,world,&request);
+        n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
+                            buf_send,pbc_flag[iswap],pbc[iswap]);
+        if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+        if (size_forward_recv[iswap]) MPI_Wait(&request,&status);
+        avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_recv);
       }
 
     } else {
       if (comm_x_only) {
-	if (sendnum[iswap])
-	  n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
-			      x[firstrecv[iswap]],pbc_flag[iswap],
-			      pbc[iswap]);
+        if (sendnum[iswap])
+          n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
+                              x[firstrecv[iswap]],pbc_flag[iswap],
+                              pbc[iswap]);
       } else if (ghost_velocity) {
-	n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
-				buf_send,pbc_flag[iswap],pbc[iswap]);
-	avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_send);
+        n = avec->pack_comm_vel(sendnum[iswap],sendlist[iswap],
+                                buf_send,pbc_flag[iswap],pbc[iswap]);
+        avec->unpack_comm_vel(recvnum[iswap],firstrecv[iswap],buf_send);
       } else {
-	n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
-			    buf_send,pbc_flag[iswap],pbc[iswap]);
-	avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_send);
+        n = avec->pack_comm(sendnum[iswap],sendlist[iswap],
+                            buf_send,pbc_flag[iswap],pbc[iswap]);
+        avec->unpack_comm(recvnum[iswap],firstrecv[iswap],buf_send);
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   reverse communication of forces on atoms every timestep 
+   reverse communication of forces on atoms every timestep
    other per-atom attributes may also be sent via pack/unpack routines
 ------------------------------------------------------------------------- */
-      
+
 void Comm::reverse_comm()
 {
   int n;
@@ -747,33 +747,33 @@ void Comm::reverse_comm()
   for (int iswap = nswap-1; iswap >= 0; iswap--) {
     if (sendproc[iswap] != me) {
       if (comm_f_only) {
-	if (size_reverse_recv[iswap])
-	  MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE,
-		    sendproc[iswap],0,world,&request);
-	if (size_reverse_send[iswap]) buf = f[firstrecv[iswap]];
-	else buf = NULL;
-	if (size_reverse_send[iswap])
-	  MPI_Send(buf,size_reverse_send[iswap],MPI_DOUBLE,
-		   recvproc[iswap],0,world);
-	if (size_reverse_recv[iswap]) MPI_Wait(&request,&status);
+        if (size_reverse_recv[iswap])
+          MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE,
+                    sendproc[iswap],0,world,&request);
+        if (size_reverse_send[iswap]) buf = f[firstrecv[iswap]];
+        else buf = NULL;
+        if (size_reverse_send[iswap])
+          MPI_Send(buf,size_reverse_send[iswap],MPI_DOUBLE,
+                   recvproc[iswap],0,world);
+        if (size_reverse_recv[iswap]) MPI_Wait(&request,&status);
       } else {
-	if (size_reverse_recv[iswap])
-	  MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE,
-		    sendproc[iswap],0,world,&request);
-	n = avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send);
-	if (n) MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world);
-	if (size_reverse_recv[iswap]) MPI_Wait(&request,&status);
+        if (size_reverse_recv[iswap])
+          MPI_Irecv(buf_recv,size_reverse_recv[iswap],MPI_DOUBLE,
+                    sendproc[iswap],0,world,&request);
+        n = avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send);
+        if (n) MPI_Send(buf_send,n,MPI_DOUBLE,recvproc[iswap],0,world);
+        if (size_reverse_recv[iswap]) MPI_Wait(&request,&status);
       }
       avec->unpack_reverse(sendnum[iswap],sendlist[iswap],buf_recv);
 
     } else {
       if (comm_f_only) {
-	if (sendnum[iswap])
-	    avec->unpack_reverse(sendnum[iswap],sendlist[iswap],
-				f[firstrecv[iswap]]);
+        if (sendnum[iswap])
+            avec->unpack_reverse(sendnum[iswap],sendlist[iswap],
+                                f[firstrecv[iswap]]);
       } else {
-	n = avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send);
-	avec->unpack_reverse(sendnum[iswap],sendlist[iswap],buf_send);
+        n = avec->pack_reverse(recvnum[iswap],firstrecv[iswap],buf_send);
+        avec->unpack_reverse(sendnum[iswap],sendlist[iswap],buf_send);
       }
     }
   }
@@ -801,7 +801,7 @@ void Comm::exchange()
   AtomVec *avec = atom->avec;
 
   // clear global->local map for owned and ghost atoms
-  // b/c atoms migrate to new procs in exchange() and 
+  // b/c atoms migrate to new procs in exchange() and
   // new ghosts are created in borders()
   // map_set() is done at end of borders()
 
@@ -832,10 +832,10 @@ void Comm::exchange()
 
     while (i < nlocal) {
       if (x[i][dim] < lo || x[i][dim] >= hi) {
-	if (nsend > maxsend) grow_send(nsend,1);
-	nsend += avec->pack_exchange(i,&buf_send[nsend]);
-	avec->copy(nlocal-1,i,1);
-	nlocal--;
+        if (nsend > maxsend) grow_send(nsend,1);
+        nsend += avec->pack_exchange(i,&buf_send[nsend]);
+        avec->copy(nlocal-1,i,1);
+        nlocal--;
       } else i++;
     }
     atom->nlocal = nlocal;
@@ -851,27 +851,27 @@ void Comm::exchange()
 
     } else {
       MPI_Sendrecv(&nsend,1,MPI_INT,procneigh[dim][0],0,
-		   &nrecv1,1,MPI_INT,procneigh[dim][1],0,world,&status);
+                   &nrecv1,1,MPI_INT,procneigh[dim][1],0,world,&status);
       nrecv = nrecv1;
       if (procgrid[dim] > 2) {
-	MPI_Sendrecv(&nsend,1,MPI_INT,procneigh[dim][1],0,
-		     &nrecv2,1,MPI_INT,procneigh[dim][0],0,world,&status);
-	nrecv += nrecv2;
+        MPI_Sendrecv(&nsend,1,MPI_INT,procneigh[dim][1],0,
+                     &nrecv2,1,MPI_INT,procneigh[dim][0],0,world,&status);
+        nrecv += nrecv2;
       }
       if (nrecv > maxrecv) grow_recv(nrecv);
-      
+
       MPI_Irecv(buf_recv,nrecv1,MPI_DOUBLE,procneigh[dim][1],0,
-		world,&request);
+                world,&request);
       MPI_Send(buf_send,nsend,MPI_DOUBLE,procneigh[dim][0],0,world);
       MPI_Wait(&request,&status);
-      
+
       if (procgrid[dim] > 2) {
-	MPI_Irecv(&buf_recv[nrecv1],nrecv2,MPI_DOUBLE,procneigh[dim][0],0,
-		  world,&request);
-	MPI_Send(buf_send,nsend,MPI_DOUBLE,procneigh[dim][1],0,world);
-	MPI_Wait(&request,&status);
+        MPI_Irecv(&buf_recv[nrecv1],nrecv2,MPI_DOUBLE,procneigh[dim][0],0,
+                  world,&request);
+        MPI_Send(buf_send,nsend,MPI_DOUBLE,procneigh[dim][1],0,world);
+        MPI_Wait(&request,&status);
       }
-      
+
       buf = buf_recv;
     }
 
@@ -934,16 +934,16 @@ void Comm::borders()
 
       x = atom->x;
       if (style == SINGLE) {
-	lo = slablo[iswap];
-	hi = slabhi[iswap];
+        lo = slablo[iswap];
+        hi = slabhi[iswap];
       } else {
-	type = atom->type;
-	mlo = multilo[iswap];
-	mhi = multihi[iswap];
+        type = atom->type;
+        mlo = multilo[iswap];
+        mhi = multihi[iswap];
       }
       if (ineed % 2 == 0) {
-	nfirst = nlast;
-	nlast = atom->nlocal + atom->nghost;
+        nfirst = nlast;
+        nlast = atom->nlocal + atom->nghost;
       }
 
       nsend = 0;
@@ -961,92 +961,92 @@ void Comm::borders()
       // on these sends, break loop in two: owned (in group) and ghost
 
       if (sendflag) {
-	if (!bordergroup || ineed >= 2) {
-	  if (style == SINGLE) {
-	    for (i = nfirst; i < nlast; i++)
-	      if (x[i][dim] >= lo && x[i][dim] <= hi) {
-		if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
-		sendlist[iswap][nsend++] = i;
-	      }
-	  } else {
-	    for (i = nfirst; i < nlast; i++) {
-	      itype = type[i];
-	      if (x[i][dim] >= mlo[itype] && x[i][dim] <= mhi[itype]) {
-		if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
-		sendlist[iswap][nsend++] = i;
-	      }
-	    }
-	  }
-	  
-	} else {
-	  if (style == SINGLE) {
-	    ngroup = atom->nfirst;
-	    for (i = 0; i < ngroup; i++)
-	      if (x[i][dim] >= lo && x[i][dim] <= hi) {
-		if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
-		sendlist[iswap][nsend++] = i;
-	      }
-	    for (i = atom->nlocal; i < nlast; i++)
-	      if (x[i][dim] >= lo && x[i][dim] <= hi) {
-		if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
-		sendlist[iswap][nsend++] = i;
-	      }
-	  } else {
-	    ngroup = atom->nfirst;
-	    for (i = 0; i < ngroup; i++) {
-	      itype = type[i];
-	      if (x[i][dim] >= mlo[itype] && x[i][dim] <= mhi[itype]) {
-		if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
-		sendlist[iswap][nsend++] = i;
-	      }
-	    }
-	    for (i = atom->nlocal; i < nlast; i++) {
-	      itype = type[i];
-	      if (x[i][dim] >= mlo[itype] && x[i][dim] <= mhi[itype]) {
-		if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
-		sendlist[iswap][nsend++] = i;
-	      }
-	    }
-	  }
-	}
+        if (!bordergroup || ineed >= 2) {
+          if (style == SINGLE) {
+            for (i = nfirst; i < nlast; i++)
+              if (x[i][dim] >= lo && x[i][dim] <= hi) {
+                if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
+                sendlist[iswap][nsend++] = i;
+              }
+          } else {
+            for (i = nfirst; i < nlast; i++) {
+              itype = type[i];
+              if (x[i][dim] >= mlo[itype] && x[i][dim] <= mhi[itype]) {
+                if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
+                sendlist[iswap][nsend++] = i;
+              }
+            }
+          }
+
+        } else {
+          if (style == SINGLE) {
+            ngroup = atom->nfirst;
+            for (i = 0; i < ngroup; i++)
+              if (x[i][dim] >= lo && x[i][dim] <= hi) {
+                if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
+                sendlist[iswap][nsend++] = i;
+              }
+            for (i = atom->nlocal; i < nlast; i++)
+              if (x[i][dim] >= lo && x[i][dim] <= hi) {
+                if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
+                sendlist[iswap][nsend++] = i;
+              }
+          } else {
+            ngroup = atom->nfirst;
+            for (i = 0; i < ngroup; i++) {
+              itype = type[i];
+              if (x[i][dim] >= mlo[itype] && x[i][dim] <= mhi[itype]) {
+                if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
+                sendlist[iswap][nsend++] = i;
+              }
+            }
+            for (i = atom->nlocal; i < nlast; i++) {
+              itype = type[i];
+              if (x[i][dim] >= mlo[itype] && x[i][dim] <= mhi[itype]) {
+                if (nsend == maxsendlist[iswap]) grow_list(iswap,nsend);
+                sendlist[iswap][nsend++] = i;
+              }
+            }
+          }
+        }
       }
 
       // pack up list of border atoms
 
       if (nsend*size_border > maxsend)
-	grow_send(nsend*size_border,0);
+        grow_send(nsend*size_border,0);
       if (ghost_velocity)
-	n = avec->pack_border_vel(nsend,sendlist[iswap],buf_send,
-				  pbc_flag[iswap],pbc[iswap]);
+        n = avec->pack_border_vel(nsend,sendlist[iswap],buf_send,
+                                  pbc_flag[iswap],pbc[iswap]);
       else
-	n = avec->pack_border(nsend,sendlist[iswap],buf_send,
-			      pbc_flag[iswap],pbc[iswap]);
-      
+        n = avec->pack_border(nsend,sendlist[iswap],buf_send,
+                              pbc_flag[iswap],pbc[iswap]);
+
       // swap atoms with other proc
       // no MPI calls except SendRecv if nsend/nrecv = 0
       // put incoming ghosts at end of my atom arrays
       // if swapping with self, simply copy, no messages
 
       if (sendproc[iswap] != me) {
-	MPI_Sendrecv(&nsend,1,MPI_INT,sendproc[iswap],0,
-		     &nrecv,1,MPI_INT,recvproc[iswap],0,world,&status);
-	if (nrecv*size_border > maxrecv) grow_recv(nrecv*size_border);
-	if (nrecv) MPI_Irecv(buf_recv,nrecv*size_border,MPI_DOUBLE,
-			     recvproc[iswap],0,world,&request);
-	if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
-	if (nrecv) MPI_Wait(&request,&status);
-	buf = buf_recv;
+        MPI_Sendrecv(&nsend,1,MPI_INT,sendproc[iswap],0,
+                     &nrecv,1,MPI_INT,recvproc[iswap],0,world,&status);
+        if (nrecv*size_border > maxrecv) grow_recv(nrecv*size_border);
+        if (nrecv) MPI_Irecv(buf_recv,nrecv*size_border,MPI_DOUBLE,
+                             recvproc[iswap],0,world,&request);
+        if (n) MPI_Send(buf_send,n,MPI_DOUBLE,sendproc[iswap],0,world);
+        if (nrecv) MPI_Wait(&request,&status);
+        buf = buf_recv;
       } else {
-	nrecv = nsend;
-	buf = buf_send;
+        nrecv = nsend;
+        buf = buf_send;
       }
 
       // unpack buffer
 
       if (ghost_velocity)
-	avec->unpack_border_vel(nrecv,atom->nlocal+atom->nghost,buf);
+        avec->unpack_border_vel(nrecv,atom->nlocal+atom->nghost,buf);
       else
-	avec->unpack_border(nrecv,atom->nlocal+atom->nghost,buf);
+        avec->unpack_border(nrecv,atom->nlocal+atom->nghost,buf);
 
       // set all pointers & counters
 
@@ -1091,17 +1091,17 @@ void Comm::forward_comm_pair(Pair *pair)
     // pack buffer
 
     n = pair->pack_comm(sendnum[iswap],sendlist[iswap],
-			buf_send,pbc_flag[iswap],pbc[iswap]);
+                        buf_send,pbc_flag[iswap],pbc[iswap]);
 
     // exchange with another proc
     // if self, set recv buffer to send buffer
 
     if (sendproc[iswap] != me) {
       if (recvnum[iswap])
-	MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
-		  world,&request);
+        MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
+                  world,&request);
       if (sendnum[iswap])
-	MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
+        MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
       if (recvnum[iswap]) MPI_Wait(&request,&status);
       buf = buf_recv;
     } else buf = buf_send;
@@ -1129,15 +1129,15 @@ void Comm::reverse_comm_pair(Pair *pair)
 
     n = pair->pack_reverse_comm(recvnum[iswap],firstrecv[iswap],buf_send);
 
-    // exchange with another proc 
+    // exchange with another proc
     // if self, set recv buffer to send buffer
 
     if (sendproc[iswap] != me) {
-      if (sendnum[iswap]) 
-	MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
-		  world,&request);
+      if (sendnum[iswap])
+        MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
+                  world,&request);
       if (recvnum[iswap])
-	MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
+        MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
       if (sendnum[iswap]) MPI_Wait(&request,&status);
       buf = buf_recv;
     } else buf = buf_send;
@@ -1164,17 +1164,17 @@ void Comm::forward_comm_fix(Fix *fix)
     // pack buffer
 
     n = fix->pack_comm(sendnum[iswap],sendlist[iswap],
-		       buf_send,pbc_flag[iswap],pbc[iswap]);
+                       buf_send,pbc_flag[iswap],pbc[iswap]);
 
     // exchange with another proc
     // if self, set recv buffer to send buffer
 
     if (sendproc[iswap] != me) {
-      if (recvnum[iswap]) 
-	MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
-		  world,&request);
-      if (sendnum[iswap]) 
-	MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
+      if (recvnum[iswap])
+        MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
+                  world,&request);
+      if (sendnum[iswap])
+        MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
       if (recvnum[iswap]) MPI_Wait(&request,&status);
       buf = buf_recv;
     } else buf = buf_send;
@@ -1202,15 +1202,15 @@ void Comm::reverse_comm_fix(Fix *fix)
 
     n = fix->pack_reverse_comm(recvnum[iswap],firstrecv[iswap],buf_send);
 
-    // exchange with another proc 
+    // exchange with another proc
     // if self, set recv buffer to send buffer
 
     if (sendproc[iswap] != me) {
-      if (sendnum[iswap]) 
-	MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
-		  world,&request);
-      if (recvnum[iswap]) 
-	MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
+      if (sendnum[iswap])
+        MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
+                  world,&request);
+      if (recvnum[iswap])
+        MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
       if (sendnum[iswap]) MPI_Wait(&request,&status);
       buf = buf_recv;
     } else buf = buf_send;
@@ -1237,17 +1237,17 @@ void Comm::forward_comm_compute(Compute *compute)
     // pack buffer
 
     n = compute->pack_comm(sendnum[iswap],sendlist[iswap],
-			   buf_send,pbc_flag[iswap],pbc[iswap]);
+                           buf_send,pbc_flag[iswap],pbc[iswap]);
 
     // exchange with another proc
     // if self, set recv buffer to send buffer
 
     if (sendproc[iswap] != me) {
-      if (recvnum[iswap]) 
-	MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
-		  world,&request);
-      if (sendnum[iswap]) 
-	MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
+      if (recvnum[iswap])
+        MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
+                  world,&request);
+      if (sendnum[iswap])
+        MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
       if (recvnum[iswap]) MPI_Wait(&request,&status);
       buf = buf_recv;
     } else buf = buf_send;
@@ -1275,15 +1275,15 @@ void Comm::reverse_comm_compute(Compute *compute)
 
     n = compute->pack_reverse_comm(recvnum[iswap],firstrecv[iswap],buf_send);
 
-    // exchange with another proc 
+    // exchange with another proc
     // if self, set recv buffer to send buffer
 
     if (sendproc[iswap] != me) {
-      if (sendnum[iswap]) 
-	MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
-		  world,&request);
-      if (recvnum[iswap]) 
-	MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
+      if (sendnum[iswap])
+        MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
+                  world,&request);
+      if (recvnum[iswap])
+        MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
       if (sendnum[iswap]) MPI_Wait(&request,&status);
       buf = buf_recv;
     } else buf = buf_send;
@@ -1310,17 +1310,17 @@ void Comm::forward_comm_dump(Dump *dump)
     // pack buffer
 
     n = dump->pack_comm(sendnum[iswap],sendlist[iswap],
-			buf_send,pbc_flag[iswap],pbc[iswap]);
+                        buf_send,pbc_flag[iswap],pbc[iswap]);
 
     // exchange with another proc
     // if self, set recv buffer to send buffer
 
     if (sendproc[iswap] != me) {
-      if (recvnum[iswap]) 
-	MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
-		  world,&request);
-      if (sendnum[iswap]) 
-	MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
+      if (recvnum[iswap])
+        MPI_Irecv(buf_recv,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,
+                  world,&request);
+      if (sendnum[iswap])
+        MPI_Send(buf_send,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,world);
       if (recvnum[iswap]) MPI_Wait(&request,&status);
       buf = buf_recv;
     } else buf = buf_send;
@@ -1348,15 +1348,15 @@ void Comm::reverse_comm_dump(Dump *dump)
 
     n = dump->pack_reverse_comm(recvnum[iswap],firstrecv[iswap],buf_send);
 
-    // exchange with another proc 
+    // exchange with another proc
     // if self, set recv buffer to send buffer
 
     if (sendproc[iswap] != me) {
-      if (sendnum[iswap]) 
-	MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
-		  world,&request);
-      if (recvnum[iswap]) 
-	MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
+      if (sendnum[iswap])
+        MPI_Irecv(buf_recv,n*sendnum[iswap],MPI_DOUBLE,sendproc[iswap],0,
+                  world,&request);
+      if (recvnum[iswap])
+        MPI_Send(buf_send,n*recvnum[iswap],MPI_DOUBLE,recvproc[iswap],0,world);
       if (sendnum[iswap]) MPI_Wait(&request,&status);
       buf = buf_recv;
     } else buf = buf_send;
@@ -1368,7 +1368,7 @@ void Comm::reverse_comm_dump(Dump *dump)
 }
 
 /* ----------------------------------------------------------------------
-   realloc the size of the send buffer as needed with BUFFACTOR & BUFEXTRA 
+   realloc the size of the send buffer as needed with BUFFACTOR & BUFEXTRA
    if flag = 1, realloc
    if flag = 0, don't need to realloc with copy, just free/malloc
 ------------------------------------------------------------------------- */
@@ -1385,7 +1385,7 @@ void Comm::grow_send(int n, int flag)
 }
 
 /* ----------------------------------------------------------------------
-   free/malloc the size of the recv buffer as needed with BUFFACTOR 
+   free/malloc the size of the recv buffer as needed with BUFFACTOR
 ------------------------------------------------------------------------- */
 
 void Comm::grow_recv(int n)
@@ -1396,7 +1396,7 @@ void Comm::grow_recv(int n)
 }
 
 /* ----------------------------------------------------------------------
-   realloc the size of the iswap sendlist as needed with BUFFACTOR 
+   realloc the size of the iswap sendlist as needed with BUFFACTOR
 ------------------------------------------------------------------------- */
 
 void Comm::grow_list(int iswap, int n)
@@ -1406,7 +1406,7 @@ void Comm::grow_list(int iswap, int n)
 }
 
 /* ----------------------------------------------------------------------
-   realloc the buffers needed for swaps 
+   realloc the buffers needed for swaps
 ------------------------------------------------------------------------- */
 
 void Comm::grow_swap(int n)
@@ -1429,7 +1429,7 @@ void Comm::grow_swap(int n)
 }
 
 /* ----------------------------------------------------------------------
-   allocation of swap info 
+   allocation of swap info
 ------------------------------------------------------------------------- */
 
 void Comm::allocate_swap(int n)
@@ -1459,7 +1459,7 @@ void Comm::allocate_multi(int n)
 }
 
 /* ----------------------------------------------------------------------
-   free memory for swaps 
+   free memory for swaps
 ------------------------------------------------------------------------- */
 
 void Comm::free_swap()
@@ -1507,16 +1507,16 @@ void Comm::set(int narg, char **arg)
       if (iarg+2 > narg) error->all(FLERR,"Illegal communicate command");
       bordergroup = group->find(arg[iarg+1]);
       if (bordergroup < 0)
-	error->all(FLERR,"Invalid group in communicate command");
-      if (bordergroup && (atom->firstgroupname == NULL || 
-			  strcmp(arg[iarg+1],atom->firstgroupname) != 0))
-	error->all(FLERR,"Communicate group != atom_modify first group");
+        error->all(FLERR,"Invalid group in communicate command");
+      if (bordergroup && (atom->firstgroupname == NULL ||
+                          strcmp(arg[iarg+1],atom->firstgroupname) != 0))
+        error->all(FLERR,"Communicate group != atom_modify first group");
       iarg += 2;
     } else if (strcmp(arg[iarg],"cutoff") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal communicate command");
       cutghostuser = atof(arg[iarg+1]);
-      if (cutghostuser < 0.0) 
-	error->all(FLERR,"Invalid cutoff in communicate command");
+      if (cutghostuser < 0.0)
+        error->all(FLERR,"Invalid cutoff in communicate command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"vel") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal communicate command");
@@ -1544,7 +1544,7 @@ void Comm::set_processors(int narg, char **arg)
   if (strcmp(arg[2],"*") == 0) user_procgrid[2] = 0;
   else user_procgrid[2] = atoi(arg[2]);
 
-  if (user_procgrid[0] < 0 || user_procgrid[1] < 0 || user_procgrid[2] < 0) 
+  if (user_procgrid[0] < 0 || user_procgrid[1] < 0 || user_procgrid[2] < 0)
     error->all(FLERR,"Illegal processors command");
 
   int p = user_procgrid[0]*user_procgrid[1]*user_procgrid[2];
@@ -1557,36 +1557,36 @@ void Comm::set_processors(int narg, char **arg)
       if (iarg+2 > narg) error->all(FLERR,"Illegal processors command");
 
       if (strcmp(arg[iarg+1],"onelevel") == 0) {
-	gridflag = ONELEVEL;
-	
+        gridflag = ONELEVEL;
+
       } else if (strcmp(arg[iarg+1],"twolevel") == 0) {
-	if (iarg+6 > narg) error->all(FLERR,"Illegal processors command");
-	gridflag = TWOLEVEL;
-	
-	ncores = atoi(arg[iarg+2]);
-	if (strcmp(arg[iarg+3],"*") == 0) user_coregrid[0] = 0;
-	else user_coregrid[0] = atoi(arg[iarg+3]);
-	if (strcmp(arg[iarg+4],"*") == 0) user_coregrid[1] = 0;
-	else user_coregrid[1] = atoi(arg[iarg+4]);
-	if (strcmp(arg[iarg+5],"*") == 0) user_coregrid[2] = 0;
-	else user_coregrid[2] = atoi(arg[iarg+5]);
-	
-	if (ncores <= 0 || user_coregrid[0] < 0 || 
-	    user_coregrid[1] < 0 || user_coregrid[2] < 0) 
-	  error->all(FLERR,"Illegal processors command");
-	iarg += 4;
-	
+        if (iarg+6 > narg) error->all(FLERR,"Illegal processors command");
+        gridflag = TWOLEVEL;
+
+        ncores = atoi(arg[iarg+2]);
+        if (strcmp(arg[iarg+3],"*") == 0) user_coregrid[0] = 0;
+        else user_coregrid[0] = atoi(arg[iarg+3]);
+        if (strcmp(arg[iarg+4],"*") == 0) user_coregrid[1] = 0;
+        else user_coregrid[1] = atoi(arg[iarg+4]);
+        if (strcmp(arg[iarg+5],"*") == 0) user_coregrid[2] = 0;
+        else user_coregrid[2] = atoi(arg[iarg+5]);
+
+        if (ncores <= 0 || user_coregrid[0] < 0 ||
+            user_coregrid[1] < 0 || user_coregrid[2] < 0)
+          error->all(FLERR,"Illegal processors command");
+        iarg += 4;
+
       } else if (strcmp(arg[iarg+1],"numa") == 0) {
-	gridflag = NUMA;
-	
+        gridflag = NUMA;
+
       } else if (strcmp(arg[iarg],"custom") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal processors command");
-	gridflag = CUSTOM;
-	delete [] customfile;
-	int n = strlen(arg[iarg+2]) + 1;
-	customfile = new char[n];
-	strcpy(customfile,arg[iarg+2]);
-	iarg += 1;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal processors command");
+        gridflag = CUSTOM;
+        delete [] customfile;
+        int n = strlen(arg[iarg+2]) + 1;
+        customfile = new char[n];
+        strcpy(customfile,arg[iarg+2]);
+        iarg += 1;
 
       } else error->all(FLERR,"Illegal processors command");
       iarg += 2;
@@ -1596,49 +1596,49 @@ void Comm::set_processors(int narg, char **arg)
       if (strcmp(arg[iarg+1],"cart") == 0) mapflag = CART;
       else if (strcmp(arg[iarg+1],"cart/reorder") == 0) mapflag = CARTREORDER;
       else if (strcmp(arg[iarg+1],"xyz") == 0 ||
-	       strcmp(arg[iarg+1],"xzy") == 0 ||
-	       strcmp(arg[iarg+1],"yxz") == 0 ||
-	       strcmp(arg[iarg+1],"yzx") == 0 ||
-	       strcmp(arg[iarg+1],"zxy") == 0 ||
-	       strcmp(arg[iarg+1],"zyx") == 0) {
-	mapflag = XYZ;
-	strcpy(xyz,arg[iarg+1]);
+               strcmp(arg[iarg+1],"xzy") == 0 ||
+               strcmp(arg[iarg+1],"yxz") == 0 ||
+               strcmp(arg[iarg+1],"yzx") == 0 ||
+               strcmp(arg[iarg+1],"zxy") == 0 ||
+               strcmp(arg[iarg+1],"zyx") == 0) {
+        mapflag = XYZ;
+        strcpy(xyz,arg[iarg+1]);
       } else error->all(FLERR,"Illegal processors command");
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"part") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal processors command");
       if (universe->nworlds == 1)
-	error->all(FLERR,
-		   "Cannot use processors part command "
-		   "without using partitions");
+        error->all(FLERR,
+                   "Cannot use processors part command "
+                   "without using partitions");
       int isend = atoi(arg[iarg+1]);
       int irecv = atoi(arg[iarg+2]);
       if (isend < 1 || isend > universe->nworlds ||
-	  irecv < 1 || irecv > universe->nworlds || isend == irecv)
-	error->all(FLERR,"Invalid partitions in processors part command");
+          irecv < 1 || irecv > universe->nworlds || isend == irecv)
+        error->all(FLERR,"Invalid partitions in processors part command");
       if (isend-1 == universe->iworld) {
-	if (send_to_partition >= 0)
-	  error->all(FLERR,
-		     "Sending partition in processors part command "
-		     "is already a sender");
-	send_to_partition = irecv-1;
+        if (send_to_partition >= 0)
+          error->all(FLERR,
+                     "Sending partition in processors part command "
+                     "is already a sender");
+        send_to_partition = irecv-1;
       }
       if (irecv-1 == universe->iworld) {
-	if (recv_from_partition >= 0)
-	  error->all(FLERR,
-		     "Receiving partition in processors part command "
-		     "is already a receiver");
-	recv_from_partition = isend-1;
+        if (recv_from_partition >= 0)
+          error->all(FLERR,
+                     "Receiving partition in processors part command "
+                     "is already a receiver");
+        recv_from_partition = isend-1;
       }
 
       // only receiver has otherflag dependency
 
       if (strcmp(arg[iarg+3],"multiple") == 0) {
-	if (universe->iworld == irecv-1) {
-	  otherflag = 1;
-	  other_style = MULTIPLE;
-	}
+        if (universe->iworld == irecv-1) {
+          otherflag = 1;
+          other_style = MULTIPLE;
+        }
       } else error->all(FLERR,"Illegal processors command");
       iarg += 4;
 
@@ -1659,17 +1659,17 @@ void Comm::set_processors(int narg, char **arg)
     error->all(FLERR,"Processors grid numa and map style are incompatible");
   if (otherflag && (gridflag == NUMA || gridflag == CUSTOM))
     error->all(FLERR,
-	       "Processors part option and grid style are incompatible");
+               "Processors part option and grid style are incompatible");
 }
 
 /* ----------------------------------------------------------------------
-   return # of bytes of allocated memory 
+   return # of bytes of allocated memory
 ------------------------------------------------------------------------- */
 
 bigint Comm::memory_usage()
 {
   bigint bytes = 0;
-  for (int i = 0; i < nswap; i++) 
+  for (int i = 0; i < nswap; i++)
     bytes += memory->usage(sendlist[i],maxsendlist[i]);
   bytes += memory->usage(buf_send,maxsend+BUFEXTRA);
   bytes += memory->usage(buf_recv,maxrecv);
diff --git a/src/comm.h b/src/comm.h
index a285e80ef5..0557ccbc79 100644
--- a/src/comm.h
+++ b/src/comm.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -109,7 +109,7 @@ class Comm : protected Pointers {
   double *buf_recv;                 // recv buffer for all comm
   int maxsend,maxrecv;              // current size of send/recv buffer
   int maxforward,maxreverse;        // max # of datums in forward/reverse comm
- 
+
   int updown(int, int, int, double, int, double *);
                                             // compare cutoff to procs
   virtual void grow_send(int,int);          // reallocate send buffer
diff --git a/src/compute.cpp b/src/compute.cpp
index b33fe7595e..9261dee769 100644
--- a/src/compute.cpp
+++ b/src/compute.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,7 +45,7 @@ Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
   for (int i = 0; i < n-1; i++)
     if (!isalnum(id[i]) && id[i] != '_')
       error->all(FLERR,
-		 "Compute ID must be alphanumeric or underscore characters");
+                 "Compute ID must be alphanumeric or underscore characters");
 
   igroup = group->find(arg[1]);
   if (igroup == -1) error->all(FLERR,"Could not find compute group ID");
@@ -77,7 +77,7 @@ Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
   dynamic = 0;
 
   // setup list of timesteps
-  
+
   ntime = maxtime = 0;
   tlist = NULL;
 
@@ -139,7 +139,7 @@ void Compute::reset_extra_dof()
 void Compute::reset_extra_compute_fix(const char *)
 {
   error->all(FLERR,
-	     "Compute does not allow an extra compute or fix to be reset");
+             "Compute does not allow an extra compute or fix to be reset");
 }
 
 /* ----------------------------------------------------------------------
@@ -206,7 +206,7 @@ void Compute::clearstep()
    set molmap to NULL if molecule IDs include all in range from 1 to Ncount
    else: molecule IDs range from idlo to idhi
          set molmap to vector of length idhi-idlo+1
-	 molmap[id-idlo] = index from 0 to Ncount-1
+         molmap[id-idlo] = index from 0 to Ncount-1
          return idlo and idhi
 ------------------------------------------------------------------------- */
 
@@ -238,7 +238,7 @@ int Compute::molecules_in_group(int &idlo, int &idhi)
   MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
   if (flagall && comm->me == 0)
     error->warning(FLERR,"Atom with molecule ID = 0 included in "
-		   "compute molecule group");
+                   "compute molecule group");
 
   MPI_Allreduce(&lo,&idlo,1,MPI_INT,MPI_MIN,world);
   MPI_Allreduce(&hi,&idhi,1,MPI_INT,MPI_MAX,world);
diff --git a/src/compute.h b/src/compute.h
index e8f185ee24..734a1eefb2 100644
--- a/src/compute.h
+++ b/src/compute.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp
index d19b7e71aa..3ed2a0cb88 100644
--- a/src/compute_angle_local.cpp
+++ b/src/compute_angle_local.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -72,7 +72,7 @@ ComputeAngleLocal::~ComputeAngleLocal()
 
 void ComputeAngleLocal::init()
 {
-  if (force->angle == NULL) 
+  if (force->angle == NULL)
     error->all(FLERR,"No angle style is defined for compute angle/local");
 
   // do initial memory allocation so that memory_usage() is correct
@@ -148,38 +148,38 @@ int ComputeAngleLocal::compute_angles(int flag)
       if (angle_type[atom2][i] == 0) continue;
 
       if (flag) {
-	if (tflag >= 0) {
-	  delx1 = x[atom1][0] - x[atom2][0];
-	  dely1 = x[atom1][1] - x[atom2][1];
-	  delz1 = x[atom1][2] - x[atom2][2];
-	  domain->minimum_image(delx1,dely1,delz1);
-
-	  rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1;
-	  r1 = sqrt(rsq1);
-	  
-	  delx2 = x[atom3][0] - x[atom2][0];
-	  dely2 = x[atom3][1] - x[atom2][1];
-	  delz2 = x[atom3][2] - x[atom2][2];
-	  domain->minimum_image(delx2,dely2,delz2);
-
-	  rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2;
-	  r2 = sqrt(rsq2);
-
-	  // c = cosine of angle
-
-	  c = delx1*delx2 + dely1*dely2 + delz1*delz2;
-	  c /= r1*r2;
-	  if (c > 1.0) c = 1.0;
-	  if (c < -1.0) c = -1.0;
-	  tbuf[n] = 180.0*acos(c)/MY_PI;
-	}
-
-	if (eflag >= 0) {
-	  if (angle_type[atom2][i] > 0)
-	    ebuf[n] = angle->single(angle_type[atom2][i],atom1,atom2,atom3);
-	  else ebuf[n] = 0.0;
-	}
-	n += nvalues;
+        if (tflag >= 0) {
+          delx1 = x[atom1][0] - x[atom2][0];
+          dely1 = x[atom1][1] - x[atom2][1];
+          delz1 = x[atom1][2] - x[atom2][2];
+          domain->minimum_image(delx1,dely1,delz1);
+
+          rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1;
+          r1 = sqrt(rsq1);
+
+          delx2 = x[atom3][0] - x[atom2][0];
+          dely2 = x[atom3][1] - x[atom2][1];
+          delz2 = x[atom3][2] - x[atom2][2];
+          domain->minimum_image(delx2,dely2,delz2);
+
+          rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2;
+          r2 = sqrt(rsq2);
+
+          // c = cosine of angle
+
+          c = delx1*delx2 + dely1*dely2 + delz1*delz2;
+          c /= r1*r2;
+          if (c > 1.0) c = 1.0;
+          if (c < -1.0) c = -1.0;
+          tbuf[n] = 180.0*acos(c)/MY_PI;
+        }
+
+        if (eflag >= 0) {
+          if (angle_type[atom2][i] > 0)
+            ebuf[n] = angle->single(angle_type[atom2][i],atom1,atom2,atom3);
+          else ebuf[n] = 0.0;
+        }
+        n += nvalues;
       }
 
       m++;
diff --git a/src/compute_angle_local.h b/src/compute_angle_local.h
index 77858a418d..d70be21253 100644
--- a/src/compute_angle_local.h
+++ b/src/compute_angle_local.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_atom_molecule.cpp b/src/compute_atom_molecule.cpp
index 2bb6f7a510..5538980ab6 100644
--- a/src/compute_atom_molecule.cpp
+++ b/src/compute_atom_molecule.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -51,9 +51,9 @@ ComputeAtomMolecule(LAMMPS *lmp, int narg, char **arg) :
 
   int iarg = 3;
   while (iarg < narg) {
-    if (strncmp(arg[iarg],"c_",2) == 0 || 
-	strncmp(arg[iarg],"f_",2) == 0 || 
-	strncmp(arg[iarg],"v_",2) == 0) {
+    if (strncmp(arg[iarg],"c_",2) == 0 ||
+        strncmp(arg[iarg],"f_",2) == 0 ||
+        strncmp(arg[iarg],"v_",2) == 0) {
       if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE;
       else if (arg[iarg][0] == 'f') which[nvalues] = FIX;
       else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE;
@@ -64,10 +64,10 @@ ComputeAtomMolecule(LAMMPS *lmp, int narg, char **arg) :
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Illegal compute reduce command");
-	argindex[nvalues] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Illegal compute reduce command");
+        argindex[nvalues] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[nvalues] = 0;
 
       n = strlen(suffix) + 1;
@@ -86,47 +86,47 @@ ComputeAtomMolecule(LAMMPS *lmp, int narg, char **arg) :
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for compute atom/molecule does not exist");
+        error->all(FLERR,"Compute ID for compute atom/molecule does not exist");
       if (modify->compute[icompute]->peratom_flag == 0)
-	error->all(FLERR,"Compute atom/molecule compute does not "
-		   "calculate per-atom values");
-      if (argindex[i] == 0 && 
-	  modify->compute[icompute]->size_peratom_cols != 0)
-	error->all(FLERR,"Compute atom/molecule compute does not "
-		   "calculate a per-atom vector");
+        error->all(FLERR,"Compute atom/molecule compute does not "
+                   "calculate per-atom values");
+      if (argindex[i] == 0 &&
+          modify->compute[icompute]->size_peratom_cols != 0)
+        error->all(FLERR,"Compute atom/molecule compute does not "
+                   "calculate a per-atom vector");
       if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	error->all(FLERR,"Compute atom/molecule compute does not "
-		   "calculate a per-atom array");
-      if (argindex[i] && 
-	  argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	error->all(FLERR,"Compute atom/molecule compute array is "
-		   "accessed out-of-range");
+        error->all(FLERR,"Compute atom/molecule compute does not "
+                   "calculate a per-atom array");
+      if (argindex[i] &&
+          argindex[i] > modify->compute[icompute]->size_peratom_cols)
+        error->all(FLERR,"Compute atom/molecule compute array is "
+                   "accessed out-of-range");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for compute atom/molecule does not exist");
+        error->all(FLERR,"Fix ID for compute atom/molecule does not exist");
       if (modify->fix[ifix]->peratom_flag)
-	error->all(FLERR,"Compute atom/molecule fix does not "
-		   "calculate per-atom values");
-      if (argindex[i] == 0 && 
-	  modify->fix[ifix]->size_peratom_cols != 0)
-	error->all(FLERR,"Compute atom/molecule fix does not "
-		   "calculate a per-atom vector");
+        error->all(FLERR,"Compute atom/molecule fix does not "
+                   "calculate per-atom values");
+      if (argindex[i] == 0 &&
+          modify->fix[ifix]->size_peratom_cols != 0)
+        error->all(FLERR,"Compute atom/molecule fix does not "
+                   "calculate a per-atom vector");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	error->all(FLERR,"Compute atom/molecule fix does not "
-		   "calculate a per-atom array");
-      if (argindex[i] && 
-	  argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	error->all(FLERR,"Compute atom/molecule fix array is accessed out-of-range");
+        error->all(FLERR,"Compute atom/molecule fix does not "
+                   "calculate a per-atom array");
+      if (argindex[i] &&
+          argindex[i] > modify->fix[ifix]->size_peratom_cols)
+        error->all(FLERR,"Compute atom/molecule fix array is accessed out-of-range");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all(FLERR,"Variable name for compute atom/molecule does not exist");
+        error->all(FLERR,"Variable name for compute atom/molecule does not exist");
       if (input->variable->atomstyle(ivariable) == 0)
-	error->all(FLERR,"Compute atom/molecule variable is not "
-		   "atom-style variable");
+        error->all(FLERR,"Compute atom/molecule variable is not "
+                   "atom-style variable");
     }
   }
 
@@ -187,19 +187,19 @@ void ComputeAtomMolecule::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for compute atom/molecule does not exist");
+        error->all(FLERR,"Compute ID for compute atom/molecule does not exist");
       value2index[m] = icompute;
-      
+
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
-      if (ifix < 0) 
-	error->all(FLERR,"Fix ID for compute atom/molecule does not exist");
+      if (ifix < 0)
+        error->all(FLERR,"Fix ID for compute atom/molecule does not exist");
       value2index[m] = ifix;
 
     } else if (which[m] == VARIABLE) {
       int ivariable = input->variable->find(ids[m]);
-      if (ivariable < 0) 
-	error->all(FLERR,"Variable name for compute atom/molecule does not exist");
+      if (ivariable < 0)
+        error->all(FLERR,"Variable name for compute atom/molecule does not exist");
       value2index[m] = ivariable;
 
     } else value2index[m] = -1;
@@ -255,17 +255,17 @@ void ComputeAtomMolecule::compute_array()
     j = 0;
     for (i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	imol = molecule[i];
-	if (molmap) imol = molmap[imol-idlo];
-	else imol--;
-	aone[imol][m] += peratom[j];
+        imol = molecule[i];
+        if (molmap) imol = molmap[imol-idlo];
+        else imol--;
+        aone[imol][m] += peratom[j];
       }
       j += nstride;
     }
   }
 
   MPI_Allreduce(&aone[0][0],&array[0][0],nvalues*nmolecules,
-		MPI_DOUBLE,MPI_SUM,world);
+                MPI_DOUBLE,MPI_SUM,world);
 }
 
 /* ----------------------------------------------------------------------
@@ -283,7 +283,7 @@ void ComputeAtomMolecule::compute_one(int m)
 
   if (which[m] == COMPUTE) {
     Compute *compute = modify->compute[vidx];
-    
+
     if (!(compute->invoked_flag & INVOKED_PERATOM)) {
       compute->compute_peratom();
       compute->invoked_flag |= INVOKED_PERATOM;
@@ -302,7 +302,7 @@ void ComputeAtomMolecule::compute_one(int m)
   } else if (which[m] == FIX) {
     if (update->ntimestep % modify->fix[vidx]->peratom_freq)
       error->all(FLERR,"Fix used in compute atom/molecule not computed "
-		 "at compatible time");
+                 "at compatible time");
     Fix *fix = modify->fix[vidx];
 
     if (aidx == 0) {
@@ -312,7 +312,7 @@ void ComputeAtomMolecule::compute_one(int m)
       peratom = &fix->array_atom[0][aidx-1];
       nstride = fix->size_array_cols;
     }
-    
+
   // evaluate atom-style variable
 
   } else if (which[m] == VARIABLE) {
diff --git a/src/compute_atom_molecule.h b/src/compute_atom_molecule.h
index 7e87ca7a2a..769f58d5ec 100644
--- a/src/compute_atom_molecule.h
+++ b/src/compute_atom_molecule.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp
index 76feec4209..2ffea3556c 100644
--- a/src/compute_bond_local.cpp
+++ b/src/compute_bond_local.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -70,7 +70,7 @@ ComputeBondLocal::~ComputeBondLocal()
 
 void ComputeBondLocal::init()
 {
-  if (force->bond == NULL) 
+  if (force->bond == NULL)
     error->all(FLERR,"No bond style is defined for compute bond/local");
 
   // do initial memory allocation so that memory_usage() is correct
@@ -142,18 +142,18 @@ int ComputeBondLocal::compute_bonds(int flag)
       if (bond_type[atom1][i] == 0) continue;
 
       if (flag) {
-	delx = x[atom1][0] - x[atom2][0];
-	dely = x[atom1][1] - x[atom2][1];
-	delz = x[atom1][2] - x[atom2][2];
-	domain->minimum_image(delx,dely,delz);
-	rsq = delx*delx + dely*dely + delz*delz;
-	if (dflag >= 0) dbuf[n] = sqrt(rsq);
-	if (eflag >= 0) {
-	  if (bond_type[atom1][i] > 0)
-	    ebuf[n] = bond->single(bond_type[atom1][i],rsq,atom1,atom2);
-	  else ebuf[n] = 0.0;
-	}
-	n += nvalues;
+        delx = x[atom1][0] - x[atom2][0];
+        dely = x[atom1][1] - x[atom2][1];
+        delz = x[atom1][2] - x[atom2][2];
+        domain->minimum_image(delx,dely,delz);
+        rsq = delx*delx + dely*dely + delz*delz;
+        if (dflag >= 0) dbuf[n] = sqrt(rsq);
+        if (eflag >= 0) {
+          if (bond_type[atom1][i] > 0)
+            ebuf[n] = bond->single(bond_type[atom1][i],rsq,atom1,atom2);
+          else ebuf[n] = 0.0;
+        }
+        n += nvalues;
       }
 
       m++;
diff --git a/src/compute_bond_local.h b/src/compute_bond_local.h
index 902cd6bac2..9bb680be4f 100644
--- a/src/compute_bond_local.h
+++ b/src/compute_bond_local.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp
index 68478955c8..f5fad86bd2 100644
--- a/src/compute_centro_atom.cpp
+++ b/src/compute_centro_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ ComputeCentroAtom::ComputeCentroAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg != 4) error->all(FLERR,"Illegal compute centro/atom command");
-  
+
   if (strcmp(arg[3],"fcc") == 0) nnn = 12;
   else if (strcmp(arg[3],"bcc") == 0) nnn = 8;
   else nnn = atoi(arg[3]);
@@ -69,7 +69,7 @@ ComputeCentroAtom::~ComputeCentroAtom()
 
 void ComputeCentroAtom::init()
 {
-  if (force->pair == NULL) 
+  if (force->pair == NULL)
     error->all(FLERR,"Compute centro/atom requires a pair style be defined");
 
   int count = 0;
@@ -148,11 +148,11 @@ void ComputeCentroAtom::compute_peratom()
       // insure distsq and nearest arrays are long enough
 
       if (jnum > maxneigh) {
-	memory->destroy(distsq);
-	memory->destroy(nearest);
-	maxneigh = jnum;
-	memory->create(distsq,maxneigh,"centro/atom:distsq");
-	memory->create(nearest,maxneigh,"centro/atom:nearest");
+        memory->destroy(distsq);
+        memory->destroy(nearest);
+        maxneigh = jnum;
+        memory->create(distsq,maxneigh,"centro/atom:distsq");
+        memory->create(nearest,maxneigh,"centro/atom:nearest");
       }
 
       // loop over list of all neighbors within force cutoff
@@ -161,24 +161,24 @@ void ComputeCentroAtom::compute_peratom()
 
       n = 0;
       for (jj = 0; jj < jnum; jj++) {
-	j = jlist[jj];
-	j &= NEIGHMASK;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-	if (rsq < cutsq) {
-	  distsq[n] = rsq;
-	  nearest[n++] = j;
-	}
+        j = jlist[jj];
+        j &= NEIGHMASK;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+        if (rsq < cutsq) {
+          distsq[n] = rsq;
+          nearest[n++] = j;
+        }
       }
 
       // if not nnn neighbors, centro = 0.0
 
       if (n < nnn) {
-	centro[i] = 0.0;
-	continue;
+        centro[i] = 0.0;
+        continue;
       }
 
       // store nnn nearest neighs in 1st nnn locations of distsq and nearest
@@ -190,14 +190,14 @@ void ComputeCentroAtom::compute_peratom()
 
       n = 0;
       for (j = 0; j < nnn; j++) {
-	jj = nearest[j];
-	for (k = j+1; k < nnn; k++) {
-	  kk = nearest[k];
-	  delx = x[jj][0] + x[kk][0] - 2.0*xtmp;
-	  dely = x[jj][1] + x[kk][1] - 2.0*ytmp;
-	  delz = x[jj][2] + x[kk][2] - 2.0*ztmp;
-	  pairs[n++] = delx*delx + dely*dely + delz*delz;
-	}
+        jj = nearest[j];
+        for (k = j+1; k < nnn; k++) {
+          kk = nearest[k];
+          delx = x[jj][0] + x[kk][0] - 2.0*xtmp;
+          dely = x[jj][1] + x[kk][1] - 2.0*ytmp;
+          delz = x[jj][2] + x[kk][2] - 2.0*ztmp;
+          pairs[n++] = delx*delx + dely*dely + delz*delz;
+        }
       }
 
       // store nhalf smallest pair distances in 1st nhalf locations of pairs
@@ -235,29 +235,29 @@ void ComputeCentroAtom::select(int k, int n, double *arr)
   for (;;) {
     if (ir <= l+1) {
       if (ir == l+1 && arr[ir] < arr[l]) {
-	SWAP(arr[l],arr[ir])
+        SWAP(arr[l],arr[ir])
       }
       return;
     } else {
       mid=(l+ir) >> 1;
       SWAP(arr[mid],arr[l+1])
       if (arr[l] > arr[ir]) {
-	SWAP(arr[l],arr[ir])
+        SWAP(arr[l],arr[ir])
       }
       if (arr[l+1] > arr[ir]) {
-	SWAP(arr[l+1],arr[ir])
+        SWAP(arr[l+1],arr[ir])
       }
       if (arr[l] > arr[l+1]) {
-	SWAP(arr[l],arr[l+1])
+        SWAP(arr[l],arr[l+1])
       }
       i = l+1;
       j = ir;
       a = arr[l+1];
       for (;;) {
-	do i++; while (arr[i] < a);
-	do j--; while (arr[j] > a);
-	if (j < i) break;
-	SWAP(arr[i],arr[j])
+        do i++; while (arr[i] < a);
+        do j--; while (arr[j] > a);
+        if (j < i) break;
+        SWAP(arr[i],arr[j])
       }
       arr[l+1] = arr[j];
       arr[j] = a;
@@ -281,8 +281,8 @@ void ComputeCentroAtom::select2(int k, int n, double *arr, int *iarr)
   for (;;) {
     if (ir <= l+1) {
       if (ir == l+1 && arr[ir] < arr[l]) {
-	SWAP(arr[l],arr[ir])
-	ISWAP(iarr[l],iarr[ir])
+        SWAP(arr[l],arr[ir])
+        ISWAP(iarr[l],iarr[ir])
       }
       return;
     } else {
@@ -290,27 +290,27 @@ void ComputeCentroAtom::select2(int k, int n, double *arr, int *iarr)
       SWAP(arr[mid],arr[l+1])
       ISWAP(iarr[mid],iarr[l+1])
       if (arr[l] > arr[ir]) {
-	SWAP(arr[l],arr[ir])
-	ISWAP(iarr[l],iarr[ir])
+        SWAP(arr[l],arr[ir])
+        ISWAP(iarr[l],iarr[ir])
       }
       if (arr[l+1] > arr[ir]) {
-	SWAP(arr[l+1],arr[ir])
-	ISWAP(iarr[l+1],iarr[ir])
+        SWAP(arr[l+1],arr[ir])
+        ISWAP(iarr[l+1],iarr[ir])
       }
       if (arr[l] > arr[l+1]) {
-	SWAP(arr[l],arr[l+1])
-	ISWAP(iarr[l],iarr[l+1])
+        SWAP(arr[l],arr[l+1])
+        ISWAP(iarr[l],iarr[l+1])
       }
       i = l+1;
       j = ir;
       a = arr[l+1];
       ia = iarr[l+1];
       for (;;) {
-	do i++; while (arr[i] < a);
-	do j--; while (arr[j] > a);
-	if (j < i) break;
-	SWAP(arr[i],arr[j])
-	ISWAP(iarr[i],iarr[j])
+        do i++; while (arr[i] < a);
+        do j--; while (arr[j] > a);
+        if (j < i) break;
+        SWAP(arr[i],arr[j])
+        ISWAP(iarr[i],iarr[j])
       }
       arr[l+1] = arr[j];
       arr[j] = a;
diff --git a/src/compute_centro_atom.h b/src/compute_centro_atom.h
index 51a9a19211..a292911e36 100644
--- a/src/compute_centro_atom.h
+++ b/src/compute_centro_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_cluster_atom.cpp b/src/compute_cluster_atom.cpp
index 9b8036ad29..5911b5a88d 100644
--- a/src/compute_cluster_atom.cpp
+++ b/src/compute_cluster_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,9 +60,9 @@ void ComputeClusterAtom::init()
 {
   if (atom->tag_enable == 0)
     error->all(FLERR,"Cannot use compute cluster/atom unless atoms have IDs");
-  if (force->pair == NULL) 
+  if (force->pair == NULL)
     error->all(FLERR,"Compute cluster/atom requires a pair style be defined");
-  if (sqrt(cutsq) > force->pair->cutforce) 
+  if (sqrt(cutsq) > force->pair->cutforce)
     error->all(FLERR,"Compute cluster/atom cutoff is longer than pairwise cutoff");
 
   // need an occasional full neighbor list
@@ -146,38 +146,38 @@ void ComputeClusterAtom::compute_peratom()
     while (1) {
       done = 1;
       for (ii = 0; ii < inum; ii++) {
-	i = ilist[ii];
-	if (!(mask[i] & groupbit)) continue;
-	
-	xtmp = x[i][0];
-	ytmp = x[i][1];
-	ztmp = x[i][2];
-	jlist = firstneigh[i];
-	jnum = numneigh[i];
-	
-	n = 0;
-	for (jj = 0; jj < jnum; jj++) {
-	  j = jlist[jj];
-	  j &= NEIGHMASK;
-	  if (!(mask[j] & groupbit)) continue;
-	  if (clusterID[i] == clusterID[j]) continue;
-	  
-	  delx = xtmp - x[j][0];
-	  dely = ytmp - x[j][1];
-	  delz = ztmp - x[j][2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-	  if (rsq < cutsq) {
-	    clusterID[i] = clusterID[j] = MIN(clusterID[i],clusterID[j]);
-	    done = 0;
-	  }
-	}
+        i = ilist[ii];
+        if (!(mask[i] & groupbit)) continue;
+
+        xtmp = x[i][0];
+        ytmp = x[i][1];
+        ztmp = x[i][2];
+        jlist = firstneigh[i];
+        jnum = numneigh[i];
+
+        n = 0;
+        for (jj = 0; jj < jnum; jj++) {
+          j = jlist[jj];
+          j &= NEIGHMASK;
+          if (!(mask[j] & groupbit)) continue;
+          if (clusterID[i] == clusterID[j]) continue;
+
+          delx = xtmp - x[j][0];
+          dely = ytmp - x[j][1];
+          delz = ztmp - x[j][2];
+          rsq = delx*delx + dely*dely + delz*delz;
+          if (rsq < cutsq) {
+            clusterID[i] = clusterID[j] = MIN(clusterID[i],clusterID[j]);
+            done = 0;
+          }
+        }
       }
       if (!done) change = 1;
       if (done) break;
     }
-    
+
     // stop if all procs are done
-    
+
     MPI_Allreduce(&change,&anychange,1,MPI_INT,MPI_MAX,world);
     if (!anychange) break;
   }
@@ -185,8 +185,8 @@ void ComputeClusterAtom::compute_peratom()
 
 /* ---------------------------------------------------------------------- */
 
-int ComputeClusterAtom::pack_comm(int n, int *list, double *buf, 
-				  int pbc_flag, int *pbc)
+int ComputeClusterAtom::pack_comm(int n, int *list, double *buf,
+                                  int pbc_flag, int *pbc)
 {
   int i,j,m;
 
diff --git a/src/compute_cluster_atom.h b/src/compute_cluster_atom.h
index 510d9bf126..a88c61b45f 100644
--- a/src/compute_cluster_atom.h
+++ b/src/compute_cluster_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp
index 5df5b68919..5b274a33d3 100644
--- a/src/compute_cna_atom.cpp
+++ b/src/compute_cna_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -72,17 +72,17 @@ ComputeCNAAtom::~ComputeCNAAtom()
 
 void ComputeCNAAtom::init()
 {
-  if (force->pair == NULL) 
+  if (force->pair == NULL)
     error->all(FLERR,"Compute cna/atom requires a pair style be defined");
-  if (sqrt(cutsq) > force->pair->cutforce) 
+  if (sqrt(cutsq) > force->pair->cutforce)
     error->all(FLERR,"Compute cna/atom cutoff is longer than pairwise cutoff");
 
   // cannot use neighbor->cutneighmax b/c neighbor has not yet been init
 
-  if (2.0*sqrt(cutsq) > force->pair->cutforce + neighbor->skin && 
+  if (2.0*sqrt(cutsq) > force->pair->cutforce + neighbor->skin &&
       comm->me == 0)
     error->warning(FLERR,"Compute cna/atom cutoff may be too large to find "
-		   "ghost atom neighbors");
+                   "ghost atom neighbors");
 
   int count = 0;
   for (int i = 0; i < modify->ncompute; i++)
@@ -148,7 +148,7 @@ void ComputeCNAAtom::compute_peratom()
   // nearest[] = atom indices of nearest neighbors, up to MAXNEAR
   // do this for all atoms, not just compute group
   // since CNA calculation requires neighbors of neighbors
-  
+
   double **x = atom->x;
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
@@ -172,11 +172,11 @@ void ComputeCNAAtom::compute_peratom()
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       if (rsq < cutsq) {
-	if (n < MAXNEAR) nearest[i][n++] = j;
-	else {
-	  nerror++;
-	  break;
-	}
+        if (n < MAXNEAR) nearest[i][n++] = j;
+        else {
+          nerror++;
+          break;
+        }
       }
     }
     nnearest[i] = n;
@@ -224,52 +224,52 @@ void ComputeCNAAtom::compute_peratom()
       // in latter case, must exclude J from I's neighbor list
 
       if (j < nlocal) {
-	firstflag = 1;
-	ncommon = 0;
-	for (inear = 0; inear < nnearest[i]; inear++)
-	  for (jnear = 0; jnear < nnearest[j]; jnear++)
-	    if (nearest[i][inear] == nearest[j][jnear]) {
-	      if (ncommon < MAXCOMMON) common[ncommon++] = nearest[i][inear];
-	      else if (firstflag) {
-		nerror++;
-		firstflag = 0;
-	      }
-	    }
+        firstflag = 1;
+        ncommon = 0;
+        for (inear = 0; inear < nnearest[i]; inear++)
+          for (jnear = 0; jnear < nnearest[j]; jnear++)
+            if (nearest[i][inear] == nearest[j][jnear]) {
+              if (ncommon < MAXCOMMON) common[ncommon++] = nearest[i][inear];
+              else if (firstflag) {
+                nerror++;
+                firstflag = 0;
+              }
+            }
 
       } else {
-	xtmp = x[j][0];
-	ytmp = x[j][1];
-	ztmp = x[j][2];
-	jlist = firstneigh[i];
-	jnum = numneigh[i];
-	
-	n = 0;
-	for (kk = 0; kk < jnum; kk++) {
-	  k = jlist[kk];
-	  k &= NEIGHMASK;
-	  if (k == j) continue;
-
-	  delx = xtmp - x[k][0];
-	  dely = ytmp - x[k][1];
-	  delz = ztmp - x[k][2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-	  if (rsq < cutsq) {
-	    if (n < MAXNEAR) onenearest[n++] = k;
-	    else break;
-	  }
-	}
-
-	firstflag = 1;
-	ncommon = 0;
-	for (inear = 0; inear < nnearest[i]; inear++)
-	  for (jnear = 0; jnear < n; jnear++)
-	    if (nearest[i][inear] == onenearest[jnear]) {
-	      if (ncommon < MAXCOMMON) common[ncommon++] = nearest[i][inear];
-	      else if (firstflag) {
-		nerror++;
-		firstflag = 0;
-	      }
-	    }
+        xtmp = x[j][0];
+        ytmp = x[j][1];
+        ztmp = x[j][2];
+        jlist = firstneigh[i];
+        jnum = numneigh[i];
+
+        n = 0;
+        for (kk = 0; kk < jnum; kk++) {
+          k = jlist[kk];
+          k &= NEIGHMASK;
+          if (k == j) continue;
+
+          delx = xtmp - x[k][0];
+          dely = ytmp - x[k][1];
+          delz = ztmp - x[k][2];
+          rsq = delx*delx + dely*dely + delz*delz;
+          if (rsq < cutsq) {
+            if (n < MAXNEAR) onenearest[n++] = k;
+            else break;
+          }
+        }
+
+        firstflag = 1;
+        ncommon = 0;
+        for (inear = 0; inear < nnearest[i]; inear++)
+          for (jnear = 0; jnear < n; jnear++)
+            if (nearest[i][inear] == onenearest[jnear]) {
+              if (ncommon < MAXCOMMON) common[ncommon++] = nearest[i][inear];
+              else if (firstflag) {
+                nerror++;
+                firstflag = 0;
+              }
+            }
       }
 
       cna[m][NCOMMON] = ncommon;
@@ -282,22 +282,22 @@ void ComputeCNAAtom::compute_peratom()
 
       nbonds = 0;
       for (jj = 0; jj < ncommon; jj++) {
-	j = common[jj];
-	xtmp = x[j][0];
-	ytmp = x[j][1];
-	ztmp = x[j][2];
-	for (kk = jj+1; kk < ncommon; kk++) {
-	  k = common[kk];
-	  delx = xtmp - x[k][0];
-	  dely = ytmp - x[k][1];
-	  delz = ztmp - x[k][2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-	  if (rsq < cutsq) {
-	    nbonds++;
-	    bonds[jj]++;
-	    bonds[kk]++;
-	  }
-	}
+        j = common[jj];
+        xtmp = x[j][0];
+        ytmp = x[j][1];
+        ztmp = x[j][2];
+        for (kk = jj+1; kk < ncommon; kk++) {
+          k = common[kk];
+          delx = xtmp - x[k][0];
+          dely = ytmp - x[k][1];
+          delz = ztmp - x[k][2];
+          rsq = delx*delx + dely*dely + delz*delz;
+          if (rsq < cutsq) {
+            nbonds++;
+            bonds[jj]++;
+            bonds[kk]++;
+          }
+        }
       }
 
       cna[m][NBOND] = nbonds;
@@ -305,9 +305,9 @@ void ComputeCNAAtom::compute_peratom()
       maxbonds = 0;
       minbonds = MAXCOMMON;
       for (n = 0; n < ncommon; n++) {
-	maxbonds = MAX(bonds[n],maxbonds);
-	minbonds = MIN(bonds[n],minbonds);
-      }      
+        maxbonds = MAX(bonds[n],maxbonds);
+        minbonds = MIN(bonds[n],minbonds);
+      }
       cna[m][MAXBOND] = maxbonds;
       cna[m][MINBOND] = minbonds;
     }
@@ -319,26 +319,26 @@ void ComputeCNAAtom::compute_peratom()
 
     if (nnearest[i] == 12) {
       for (inear = 0; inear < 12; inear++) {
-	cj = cna[inear][NCOMMON];
-	ck = cna[inear][NBOND];
-	cl = cna[inear][MAXBOND];
-	cm = cna[inear][MINBOND];
-	if (cj == 4 && ck == 2 && cl == 1 && cm == 1) nfcc++;
-	else if (cj == 4 && ck == 2 && cl == 2 && cm == 0) nhcp++;
-	else if (cj == 5 && ck == 5 && cl == 2 && cm == 2) nico++;
+        cj = cna[inear][NCOMMON];
+        ck = cna[inear][NBOND];
+        cl = cna[inear][MAXBOND];
+        cm = cna[inear][MINBOND];
+        if (cj == 4 && ck == 2 && cl == 1 && cm == 1) nfcc++;
+        else if (cj == 4 && ck == 2 && cl == 2 && cm == 0) nhcp++;
+        else if (cj == 5 && ck == 5 && cl == 2 && cm == 2) nico++;
       }
       if (nfcc == 12) pattern[i] = FCC;
       else if (nfcc == 6 && nhcp == 6) pattern[i] = HCP;
       else if (nico == 12) pattern[i] = ICOS;
-      
+
     } else if (nnearest[i] == 14) {
       for (inear = 0; inear < 14; inear++) {
-	cj = cna[inear][NCOMMON];
-	ck = cna[inear][NBOND];
-	cl = cna[inear][MAXBOND];
-	cm = cna[inear][MINBOND];
-	if (cj == 4 && ck == 4 && cl == 2 && cm == 2) nbcc4++;
-	else if (cj == 6 && ck == 6 && cl == 2 && cm == 2) nbcc6++;
+        cj = cna[inear][NCOMMON];
+        ck = cna[inear][NBOND];
+        cl = cna[inear][MAXBOND];
+        cm = cna[inear][MINBOND];
+        if (cj == 4 && ck == 4 && cl == 2 && cm == 2) nbcc4++;
+        else if (cj == 6 && ck == 6 && cl == 2 && cm == 2) nbcc6++;
       }
       if (nbcc4 == 6 && nbcc6 == 8) pattern[i] = BCC;
     }
diff --git a/src/compute_cna_atom.h b/src/compute_cna_atom.h
index 3913480dca..fdb6c25702 100644
--- a/src/compute_cna_atom.h
+++ b/src/compute_cna_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_com.cpp b/src/compute_com.cpp
index d0f4296c42..e086210322 100644
--- a/src/compute_com.cpp
+++ b/src/compute_com.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_com.h b/src/compute_com.h
index 7f4cb82a95..6fe46ab6ab 100644
--- a/src/compute_com.h
+++ b/src/compute_com.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_com_molecule.cpp b/src/compute_com_molecule.cpp
index ad3ba957bd..2b52919f80 100644
--- a/src/compute_com_molecule.cpp
+++ b/src/compute_com_molecule.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -133,7 +133,7 @@ void ComputeCOMMolecule::compute_array()
     }
 
   MPI_Allreduce(&com[0][0],&comall[0][0],3*nmolecules,
-		MPI_DOUBLE,MPI_SUM,world);
+                MPI_DOUBLE,MPI_SUM,world);
   for (i = 0; i < nmolecules; i++) {
     comall[i][0] /= masstotal[i];
     comall[i][1] /= masstotal[i];
diff --git a/src/compute_com_molecule.h b/src/compute_com_molecule.h
index 80dee03030..a4f941c52a 100644
--- a/src/compute_com_molecule.h
+++ b/src/compute_com_molecule.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp
index a7296ba088..01a533e201 100644
--- a/src/compute_coord_atom.cpp
+++ b/src/compute_coord_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -57,11 +57,11 @@ ComputeCoordAtom::~ComputeCoordAtom()
 
 void ComputeCoordAtom::init()
 {
-  if (force->pair == NULL) 
+  if (force->pair == NULL)
     error->all(FLERR,"Compute coord/atom requires a pair style be defined");
-  if (sqrt(cutsq) > force->pair->cutforce) 
+  if (sqrt(cutsq) > force->pair->cutforce)
     error->all(FLERR,
-	       "Compute coord/atom cutoff is longer than pairwise cutoff");
+               "Compute coord/atom cutoff is longer than pairwise cutoff");
 
   // need an occasional full neighbor list
 
@@ -131,14 +131,14 @@ void ComputeCoordAtom::compute_peratom()
 
       n = 0;
       for (jj = 0; jj < jnum; jj++) {
-	j = jlist[jj];
-	j &= NEIGHMASK;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-	if (rsq < cutsq) n++;
+        j = jlist[jj];
+        j &= NEIGHMASK;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+        if (rsq < cutsq) n++;
       }
 
       coordination[i] = n;
diff --git a/src/compute_coord_atom.h b/src/compute_coord_atom.h
index b9b7af64c3..1b97a5dab1 100644
--- a/src/compute_coord_atom.h
+++ b/src/compute_coord_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp
index 10cac6f607..36feeca32e 100644
--- a/src/compute_dihedral_local.cpp
+++ b/src/compute_dihedral_local.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -72,7 +72,7 @@ ComputeDihedralLocal::~ComputeDihedralLocal()
 
 void ComputeDihedralLocal::init()
 {
-  if (force->dihedral == NULL) 
+  if (force->dihedral == NULL)
     error->all(FLERR,"No dihedral style is defined for compute dihedral/local");
 
   // do initial memory allocation so that memory_usage() is correct
@@ -144,55 +144,55 @@ int ComputeDihedralLocal::compute_dihedrals(int flag)
 
       if (flag) {
 
-	// phi calculation from dihedral style harmonic
-
-	if (pflag >= 0) {
-	  vb1x = x[atom1][0] - x[atom2][0];
-	  vb1y = x[atom1][1] - x[atom2][1];
-	  vb1z = x[atom1][2] - x[atom2][2];
-	  domain->minimum_image(vb1x,vb1y,vb1z);
-	  
-	  vb2x = x[atom3][0] - x[atom2][0];
-	  vb2y = x[atom3][1] - x[atom2][1];
-	  vb2z = x[atom3][2] - x[atom2][2];
-	  domain->minimum_image(vb2x,vb2y,vb2z);
-	  
-	  vb2xm = -vb2x;
-	  vb2ym = -vb2y;
-	  vb2zm = -vb2z;
-	  domain->minimum_image(vb2xm,vb2ym,vb2zm);
-	  
-	  vb3x = x[atom4][0] - x[atom3][0];
-	  vb3y = x[atom4][1] - x[atom3][1];
-	  vb3z = x[atom4][2] - x[atom3][2];
-	  domain->minimum_image(vb3x,vb3y,vb3z);
-	  
-	  ax = vb1y*vb2zm - vb1z*vb2ym;
-	  ay = vb1z*vb2xm - vb1x*vb2zm;
-	  az = vb1x*vb2ym - vb1y*vb2xm;
-	  bx = vb3y*vb2zm - vb3z*vb2ym;
-	  by = vb3z*vb2xm - vb3x*vb2zm;
-	  bz = vb3x*vb2ym - vb3y*vb2xm;
-	  
-	  rasq = ax*ax + ay*ay + az*az;
-	  rbsq = bx*bx + by*by + bz*bz;
-	  rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
-	  rg = sqrt(rgsq);
-	  
-	  rginv = ra2inv = rb2inv = 0.0;
-	  if (rg > 0) rginv = 1.0/rg;
-	  if (rasq > 0) ra2inv = 1.0/rasq;
-	  if (rbsq > 0) rb2inv = 1.0/rbsq;
-	  rabinv = sqrt(ra2inv*rb2inv);
-
-	  c = (ax*bx + ay*by + az*bz)*rabinv;
-	  s = rg*rabinv*(ax*vb3x + ay*vb3y + az*vb3z);
-
-	  if (c > 1.0) c = 1.0;
-	  if (c < -1.0) c = -1.0;
-	  pbuf[n] = 180.0*atan2(s,c)/MY_PI;
-	}
-	n += nvalues;
+        // phi calculation from dihedral style harmonic
+
+        if (pflag >= 0) {
+          vb1x = x[atom1][0] - x[atom2][0];
+          vb1y = x[atom1][1] - x[atom2][1];
+          vb1z = x[atom1][2] - x[atom2][2];
+          domain->minimum_image(vb1x,vb1y,vb1z);
+
+          vb2x = x[atom3][0] - x[atom2][0];
+          vb2y = x[atom3][1] - x[atom2][1];
+          vb2z = x[atom3][2] - x[atom2][2];
+          domain->minimum_image(vb2x,vb2y,vb2z);
+
+          vb2xm = -vb2x;
+          vb2ym = -vb2y;
+          vb2zm = -vb2z;
+          domain->minimum_image(vb2xm,vb2ym,vb2zm);
+
+          vb3x = x[atom4][0] - x[atom3][0];
+          vb3y = x[atom4][1] - x[atom3][1];
+          vb3z = x[atom4][2] - x[atom3][2];
+          domain->minimum_image(vb3x,vb3y,vb3z);
+
+          ax = vb1y*vb2zm - vb1z*vb2ym;
+          ay = vb1z*vb2xm - vb1x*vb2zm;
+          az = vb1x*vb2ym - vb1y*vb2xm;
+          bx = vb3y*vb2zm - vb3z*vb2ym;
+          by = vb3z*vb2xm - vb3x*vb2zm;
+          bz = vb3x*vb2ym - vb3y*vb2xm;
+
+          rasq = ax*ax + ay*ay + az*az;
+          rbsq = bx*bx + by*by + bz*bz;
+          rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
+          rg = sqrt(rgsq);
+
+          rginv = ra2inv = rb2inv = 0.0;
+          if (rg > 0) rginv = 1.0/rg;
+          if (rasq > 0) ra2inv = 1.0/rasq;
+          if (rbsq > 0) rb2inv = 1.0/rbsq;
+          rabinv = sqrt(ra2inv*rb2inv);
+
+          c = (ax*bx + ay*by + az*bz)*rabinv;
+          s = rg*rabinv*(ax*vb3x + ay*vb3y + az*vb3z);
+
+          if (c > 1.0) c = 1.0;
+          if (c < -1.0) c = -1.0;
+          pbuf[n] = 180.0*atan2(s,c)/MY_PI;
+        }
+        n += nvalues;
       }
 
       m++;
diff --git a/src/compute_dihedral_local.h b/src/compute_dihedral_local.h
index 3aaadb154a..82326bdf88 100644
--- a/src/compute_dihedral_local.h
+++ b/src/compute_dihedral_local.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp
index 59370ea831..f34e74c91b 100644
--- a/src/compute_displace_atom.cpp
+++ b/src/compute_displace_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -118,34 +118,34 @@ void ComputeDisplaceAtom::compute_peratom()
   if (domain->triclinic == 0) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	dx = x[i][0] + xbox*xprd - xoriginal[i][0];
-	dy = x[i][1] + ybox*yprd - xoriginal[i][1];
-	dz = x[i][2] + zbox*zprd - xoriginal[i][2];
-	displace[i][0] = dx;
-	displace[i][1] = dy;
-	displace[i][2] = dz;
-	displace[i][3] = sqrt(dx*dx + dy*dy + dz*dz);
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        dx = x[i][0] + xbox*xprd - xoriginal[i][0];
+        dy = x[i][1] + ybox*yprd - xoriginal[i][1];
+        dz = x[i][2] + zbox*zprd - xoriginal[i][2];
+        displace[i][0] = dx;
+        displace[i][1] = dy;
+        displace[i][2] = dz;
+        displace[i][3] = sqrt(dx*dx + dy*dy + dz*dz);
       } else displace[i][0] = displace[i][1] =
-	       displace[i][2] = displace[i][3] = 0.0;
+               displace[i][2] = displace[i][3] = 0.0;
 
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	dx = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - xoriginal[i][0];
-	dy = x[i][1] + h[1]*ybox + h[3]*zbox - xoriginal[i][1];
-	dz = x[i][2] + h[2]*zbox - xoriginal[i][2];
-	displace[i][0] = dx;
-	displace[i][1] = dy;
-	displace[i][2] = dz;
-	displace[i][3] = sqrt(dx*dx + dy*dy + dz*dz);
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        dx = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - xoriginal[i][0];
+        dy = x[i][1] + h[1]*ybox + h[3]*zbox - xoriginal[i][1];
+        dz = x[i][2] + h[2]*zbox - xoriginal[i][2];
+        displace[i][0] = dx;
+        displace[i][1] = dy;
+        displace[i][2] = dz;
+        displace[i][3] = sqrt(dx*dx + dy*dy + dz*dz);
       } else displace[i][0] = displace[i][1] =
-	       displace[i][2] = displace[i][3] = 0.0;
+               displace[i][2] = displace[i][3] = 0.0;
   }
 }
 
diff --git a/src/compute_displace_atom.h b/src/compute_displace_atom.h
index ba8c8b8f04..74e41cce45 100644
--- a/src/compute_displace_atom.h
+++ b/src/compute_displace_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_erotate_sphere.cpp b/src/compute_erotate_sphere.cpp
index 47bee40890..f0ba88cda6 100644
--- a/src/compute_erotate_sphere.cpp
+++ b/src/compute_erotate_sphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,7 +37,7 @@ ComputeERotateSphere::ComputeERotateSphere(LAMMPS *lmp, int narg, char **arg) :
 
   // error check
 
-  if (!atom->sphere_flag) 
+  if (!atom->sphere_flag)
     error->all(FLERR,"Compute erotate/sphere requires atom style sphere");
 }
 
@@ -64,10 +64,10 @@ double ComputeERotateSphere::compute_scalar()
   // point particles will not contribute due to radius = 0
 
   double erotate = 0.0;
-  for (int i = 0; i < nlocal; i++) 
+  for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
-      erotate += (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] + 
-		  omega[i][2]*omega[i][2]) * radius[i]*radius[i]*rmass[i];
+      erotate += (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] +
+                  omega[i][2]*omega[i][2]) * radius[i]*radius[i]*rmass[i];
 
   MPI_Allreduce(&erotate,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
   scalar *= pfactor;
diff --git a/src/compute_erotate_sphere.h b/src/compute_erotate_sphere.h
index 6194b689ec..815a665583 100644
--- a/src/compute_erotate_sphere.h
+++ b/src/compute_erotate_sphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_group_group.cpp b/src/compute_group_group.cpp
index 7981676cb3..069738e74d 100644
--- a/src/compute_group_group.cpp
+++ b/src/compute_group_group.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -41,7 +41,7 @@ using namespace MathConst;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) : 
+ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg < 4) error->all(FLERR,"Illegal compute group/group command");
@@ -56,7 +56,7 @@ ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) :
   strcpy(group2,arg[3]);
 
   jgroup = group->find(group2);
-  if (jgroup == -1) 
+  if (jgroup == -1)
     error->all(FLERR,"Compute group/group group ID does not exist");
   jgroupbit = group->bitmask[jgroup];
 
@@ -68,21 +68,21 @@ ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) :
   while (iarg < narg) {
     if (strcmp(arg[iarg],"pair") == 0) {
       if (iarg+2 > narg)
-	error->all(FLERR,"Illegal compute group/group command");
+        error->all(FLERR,"Illegal compute group/group command");
       if (strcmp(arg[iarg+1],"yes") == 0) pairflag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) pairflag = 0;
       else error->all(FLERR,"Illegal compute group/group command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"kspace") == 0) {
       if (iarg+2 > narg)
-	error->all(FLERR,"Illegal compute group/group command");
+        error->all(FLERR,"Illegal compute group/group command");
       if (strcmp(arg[iarg+1],"yes") == 0) kspaceflag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) kspaceflag = 0;
       else error->all(FLERR,"Illegal compute group/group command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"boundary") == 0) {
       if (iarg+2 > narg)
-	error->all(FLERR,"Illegal compute group/group command");
+        error->all(FLERR,"Illegal compute group/group command");
       if (strcmp(arg[iarg+1],"yes") == 0) boundaryflag = 1;
       else if (strcmp(arg[iarg+1],"no") == 0) boundaryflag  = 0;
       else error->all(FLERR,"Illegal compute group/group command");
@@ -124,26 +124,26 @@ void ComputeGroupGroup::init()
     pair = force->pair;
     cutsq = force->pair->cutsq;
   } else pair = NULL;
-  
+
   if (kspaceflag) kspace = force->kspace;
   else kspace = NULL;
-  
+
   // compute Kspace correction terms
-  
+
   if (kspaceflag) {
     kspace_correction();
     if (fabs(e_correction) > SMALL && comm->me == 0) {
       char str[128];
       sprintf(str,"Both groups in compute group/group have a net charge; "
-	      "the Kspace boundary correction to energy will be non-zero");
+              "the Kspace boundary correction to energy will be non-zero");
       error->warning(FLERR,str);
     }
   }
-  
+
   // recheck that group 2 has not been deleted
 
   jgroup = group->find(group2);
-  if (jgroup == -1) 
+  if (jgroup == -1)
     error->all(FLERR,"Compute group/group group ID does not exist");
   jgroupbit = group->bitmask[jgroup];
 
@@ -252,35 +252,35 @@ void ComputeGroupGroup::pair_contribution()
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	eng = pair->single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fpair);
-
-	// energy only computed once so tally full amount
-	// force tally is jgroup acting on igroup
-
-	if (newton_pair || j < nlocal) {
-	  one[0] += eng;
-	  if (othergroupbit == jgroupbit) {
-	    one[1] += delx*fpair;
-	    one[2] += dely*fpair;
-	    one[3] += delz*fpair;
-	  }
-	  if (othergroupbit == groupbit) {
-	    one[1] -= delx*fpair;
-	    one[2] -= dely*fpair;
-	    one[3] -= delz*fpair;
-	  }
-
-	// energy computed twice so tally half amount
-	// only tally force if I own igroup atom
-
-	} else {
-	  one[0] += 0.5*eng;
-	  if (othergroupbit == jgroupbit) {
-	    one[1] += delx*fpair;
-	    one[2] += dely*fpair;
-	    one[3] += delz*fpair;
-	  }
-	}
+        eng = pair->single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fpair);
+
+        // energy only computed once so tally full amount
+        // force tally is jgroup acting on igroup
+
+        if (newton_pair || j < nlocal) {
+          one[0] += eng;
+          if (othergroupbit == jgroupbit) {
+            one[1] += delx*fpair;
+            one[2] += dely*fpair;
+            one[3] += delz*fpair;
+          }
+          if (othergroupbit == groupbit) {
+            one[1] -= delx*fpair;
+            one[2] -= dely*fpair;
+            one[3] -= delz*fpair;
+          }
+
+        // energy computed twice so tally half amount
+        // only tally force if I own igroup atom
+
+        } else {
+          one[0] += 0.5*eng;
+          if (othergroupbit == jgroupbit) {
+            one[1] += delx*fpair;
+            one[2] += dely*fpair;
+            one[3] += delz*fpair;
+          }
+        }
       }
     }
   }
@@ -297,23 +297,23 @@ void ComputeGroupGroup::kspace_contribution()
 {
   double *vector_kspace = force->kspace->f2group;
 
-  force->kspace->compute_group_group(groupbit,jgroupbit,0); 
+  force->kspace->compute_group_group(groupbit,jgroupbit,0);
   scalar += force->kspace->e2group;
   vector[0] += vector_kspace[0];
   vector[1] += vector_kspace[1];
   vector[2] += vector_kspace[2];
-  
+
   // compute extra B <--> A Kspace interaction so energy matches
   //   real-space style of compute group-group
   // add extra Kspace term to energy
-  
-  force->kspace->compute_group_group(groupbit,jgroupbit,1); 
+
+  force->kspace->compute_group_group(groupbit,jgroupbit,1);
   scalar += force->kspace->e2group;
-  
+
   // self energy correction term
-    
+
   scalar -= e_self;
-  
+
   // k=0 boundary correction term
 
   if (boundaryflag) {
@@ -330,63 +330,63 @@ void ComputeGroupGroup::kspace_contribution()
 void ComputeGroupGroup::kspace_correction()
 {
 
-  // total charge of groups A & B, needed for correction term        
-    
+  // total charge of groups A & B, needed for correction term
+
   double qsqsum_group,qsum_A,qsum_B;
   qsqsum_group = qsum_A = qsum_B = 0.0;
-  
+
   double *q = atom->q;
   int *mask = atom->mask;
   int groupbit_A = groupbit;
   int groupbit_B = jgroupbit;
-    
+
   for (int i = 0; i < atom->nlocal; i++) {
     if ((mask[i] & groupbit_A) && (mask[i] & groupbit_B))
       qsqsum_group += q[i]*q[i];
     if (mask[i] & groupbit_A) qsum_A += q[i];
     if (mask[i] & groupbit_B) qsum_B += q[i];
   }
-    
+
   double tmp;
   MPI_Allreduce(&qsqsum_group,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
   qsqsum_group = tmp;
-  
+
   MPI_Allreduce(&qsum_A,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
   qsum_A = tmp;
-  
+
   MPI_Allreduce(&qsum_B,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
   qsum_B = tmp;
-  
+
   double g_ewald = force->kspace->g_ewald;
-  
+
   double scale = 1.0;
   const double qscale = force->qqrd2e * scale;
-  
+
   // self-energy correction
-    
+
   e_self = qscale * g_ewald*qsqsum_group/MY_PIS;
   e_correction = qsum_A*qsum_B;
-  
+
   // Extra BA terms
-  
+
   qsum_A = qsum_B = 0.0;
-  
+
   for (int i = 0; i < atom->nlocal; i++) {
     if ((mask[i] & groupbit_A) && (mask[i] & groupbit_B))
-  	  continue;
-	
-	if (mask[i] & groupbit_A) qsum_A += q[i];
+            continue;
+
+        if (mask[i] & groupbit_A) qsum_A += q[i];
     if (mask[i] & groupbit_B) qsum_B += q[i];
   }
-  
+
   MPI_Allreduce(&qsum_A,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
   qsum_A = tmp;
-  
+
   MPI_Allreduce(&qsum_B,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
   qsum_B = tmp;
-    
+
   // k=0 energy correction term (still need to divide by volume above)
-  
+
   e_correction += qsum_A*qsum_B;
-  e_correction *= qscale * MY_PI2 / (g_ewald*g_ewald); 
+  e_correction *= qscale * MY_PI2 / (g_ewald*g_ewald);
 }
diff --git a/src/compute_group_group.h b/src/compute_group_group.h
index 850532ef42..27eb7487fb 100644
--- a/src/compute_group_group.h
+++ b/src/compute_group_group.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_gyration.cpp b/src/compute_gyration.cpp
index f192ea3d69..6eb38b059c 100644
--- a/src/compute_gyration.cpp
+++ b/src/compute_gyration.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_gyration.h b/src/compute_gyration.h
index 9ecab47eef..fec374ea98 100644
--- a/src/compute_gyration.h
+++ b/src/compute_gyration.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_gyration_molecule.cpp b/src/compute_gyration_molecule.cpp
index dd96079d21..cb1b2c33f5 100644
--- a/src/compute_gyration_molecule.cpp
+++ b/src/compute_gyration_molecule.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -23,8 +23,8 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeGyrationMolecule::ComputeGyrationMolecule(LAMMPS *lmp, 
-						 int narg, char **arg) :
+ComputeGyrationMolecule::ComputeGyrationMolecule(LAMMPS *lmp,
+                                                 int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg != 3) error->all(FLERR,"Illegal compute gyration/molecule command");
@@ -138,7 +138,7 @@ void ComputeGyrationMolecule::compute_vector()
     }
 
   MPI_Allreduce(&com[0][0],&comall[0][0],3*nmolecules,
-		MPI_DOUBLE,MPI_SUM,world);
+                MPI_DOUBLE,MPI_SUM,world);
   for (i = 0; i < nmolecules; i++) {
     comall[i][0] /= masstotal[i];
     comall[i][1] /= masstotal[i];
diff --git a/src/compute_gyration_molecule.h b/src/compute_gyration_molecule.h
index 952feb2110..8c30321d89 100644
--- a/src/compute_gyration_molecule.h
+++ b/src/compute_gyration_molecule.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_heat_flux.cpp b/src/compute_heat_flux.cpp
index a575eaf5e7..335304ef9d 100644
--- a/src/compute_heat_flux.cpp
+++ b/src/compute_heat_flux.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -32,7 +32,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) : 
+ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg != 6) error->all(FLERR,"Illegal compute heat/flux command");
@@ -67,7 +67,7 @@ ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) :
     error->all(FLERR,"Compute heat/flux compute ID does not compute pe/atom");
   if (modify->compute[istress]->pressatomflag == 0)
     error->all(FLERR,
-	       "Compute heat/flux compute ID does not compute stress/atom");
+               "Compute heat/flux compute ID does not compute stress/atom");
 
   vector = new double[6];
 }
@@ -75,7 +75,7 @@ ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) :
 /* ---------------------------------------------------------------------- */
 
 ComputeHeatFlux::~ComputeHeatFlux()
-{ 
+{
   delete [] id_ke;
   delete [] id_pe;
   delete [] id_stress;
@@ -106,7 +106,7 @@ void ComputeHeatFlux::compute_vector()
   invoked_vector = update->ntimestep;
 
   // invoke 3 computes if they haven't been already
-  
+
   if (!(c_ke->invoked_flag & INVOKED_PERATOM)) {
     c_ke->compute_peratom();
     c_ke->invoked_flag |= INVOKED_PERATOM;
@@ -137,20 +137,20 @@ void ComputeHeatFlux::compute_vector()
   double jv[3] = {0.0,0.0,0.0};
   double eng;
 
-  for (int i = 0; i < nlocal; i++) { 
+  for (int i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
       eng = pe[i] + ke[i];
-      jc[0] += eng*v[i][0]; 
+      jc[0] += eng*v[i][0];
       jc[1] += eng*v[i][1];
       jc[2] += eng*v[i][2];
-      jv[0] -= stress[i][0]*v[i][0] + stress[i][3]*v[i][1] + 
-	stress[i][4]*v[i][2];
-      jv[1] -= stress[i][3]*v[i][0] + stress[i][1]*v[i][1] + 
-	stress[i][5]*v[i][2];
-      jv[2] -= stress[i][4]*v[i][0] + stress[i][5]*v[i][1] + 
-	stress[i][2]*v[i][2];
+      jv[0] -= stress[i][0]*v[i][0] + stress[i][3]*v[i][1] +
+        stress[i][4]*v[i][2];
+      jv[1] -= stress[i][3]*v[i][0] + stress[i][1]*v[i][1] +
+        stress[i][5]*v[i][2];
+      jv[2] -= stress[i][4]*v[i][0] + stress[i][5]*v[i][1] +
+        stress[i][2]*v[i][2];
     }
-  } 
+  }
 
   // convert jv from stress*volume to energy units via nktv2p factor
 
@@ -162,7 +162,7 @@ void ComputeHeatFlux::compute_vector()
   // sum across all procs
   // 1st 3 terms are total heat flux
   // 2nd 3 terms are just conductive portion
-  
+
   double data[6] = {jc[0]+jv[0],jc[1]+jv[1],jc[2]+jv[2],jc[0],jc[1],jc[2]};
   MPI_Allreduce(data,vector,6,MPI_DOUBLE,MPI_SUM,world);
 }
diff --git a/src/compute_heat_flux.h b/src/compute_heat_flux.h
index 26c5a9e778..865411776c 100644
--- a/src/compute_heat_flux.h
+++ b/src/compute_heat_flux.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp
index 3285f2561c..708b27d6f3 100644
--- a/src/compute_improper_local.cpp
+++ b/src/compute_improper_local.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -73,7 +73,7 @@ ComputeImproperLocal::~ComputeImproperLocal()
 
 void ComputeImproperLocal::init()
 {
-  if (force->improper == NULL) 
+  if (force->improper == NULL)
     error->all(FLERR,"No improper style is defined for compute improper/local");
 
   // do initial memory allocation so that memory_usage() is correct
@@ -145,52 +145,52 @@ int ComputeImproperLocal::compute_impropers(int flag)
 
       if (flag) {
 
-	// chi calculation from improper style harmonic
-
-	if (cflag >= 0) {
-	  vb1x = x[atom1][0] - x[atom2][0];
-	  vb1y = x[atom1][1] - x[atom2][1];
-	  vb1z = x[atom1][2] - x[atom2][2];
-	  domain->minimum_image(vb1x,vb1y,vb1z);
-
-	  vb2x = x[atom3][0] - x[atom2][0];
-	  vb2y = x[atom3][1] - x[atom2][1];
-	  vb2z = x[atom3][2] - x[atom2][2];
-	  domain->minimum_image(vb2x,vb2y,vb2z);
-
-	  vb3x = x[atom4][0] - x[atom3][0];
-	  vb3y = x[atom4][1] - x[atom3][1];
-	  vb3z = x[atom4][2] - x[atom3][2];
-	  domain->minimum_image(vb3x,vb3y,vb3z);
-
-	  ss1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
-	  ss2 = 1.0 / (vb2x*vb2x + vb2y*vb2y + vb2z*vb2z);
-	  ss3 = 1.0 / (vb3x*vb3x + vb3y*vb3y + vb3z*vb3z);
-        
-	  r1 = sqrt(ss1);
-	  r2 = sqrt(ss2);
-	  r3 = sqrt(ss3);
-        
-	  c0 = (vb1x * vb3x + vb1y * vb3y + vb1z * vb3z) * r1 * r3;
-	  c1 = (vb1x * vb2x + vb1y * vb2y + vb1z * vb2z) * r1 * r2;
-	  c2 = -(vb3x * vb2x + vb3y * vb2y + vb3z * vb2z) * r3 * r2;
-
-	  s1 = 1.0 - c1*c1;
-	  if (s1 < SMALL) s1 = SMALL;
-	  s1 = 1.0 / s1;
-
-	  s2 = 1.0 - c2*c2;
-	  if (s2 < SMALL) s2 = SMALL;
-	  s2 = 1.0 / s2;
-
-	  s12 = sqrt(s1*s2);
-	  c = (c1*c2 + c0) * s12;
-
-	  if (c > 1.0) c = 1.0;
-	  if (c < -1.0) c = -1.0;
-	  cbuf[n] = 180.0*acos(c)/MY_PI;
-	}
-	n += nvalues;
+        // chi calculation from improper style harmonic
+
+        if (cflag >= 0) {
+          vb1x = x[atom1][0] - x[atom2][0];
+          vb1y = x[atom1][1] - x[atom2][1];
+          vb1z = x[atom1][2] - x[atom2][2];
+          domain->minimum_image(vb1x,vb1y,vb1z);
+
+          vb2x = x[atom3][0] - x[atom2][0];
+          vb2y = x[atom3][1] - x[atom2][1];
+          vb2z = x[atom3][2] - x[atom2][2];
+          domain->minimum_image(vb2x,vb2y,vb2z);
+
+          vb3x = x[atom4][0] - x[atom3][0];
+          vb3y = x[atom4][1] - x[atom3][1];
+          vb3z = x[atom4][2] - x[atom3][2];
+          domain->minimum_image(vb3x,vb3y,vb3z);
+
+          ss1 = 1.0 / (vb1x*vb1x + vb1y*vb1y + vb1z*vb1z);
+          ss2 = 1.0 / (vb2x*vb2x + vb2y*vb2y + vb2z*vb2z);
+          ss3 = 1.0 / (vb3x*vb3x + vb3y*vb3y + vb3z*vb3z);
+
+          r1 = sqrt(ss1);
+          r2 = sqrt(ss2);
+          r3 = sqrt(ss3);
+
+          c0 = (vb1x * vb3x + vb1y * vb3y + vb1z * vb3z) * r1 * r3;
+          c1 = (vb1x * vb2x + vb1y * vb2y + vb1z * vb2z) * r1 * r2;
+          c2 = -(vb3x * vb2x + vb3y * vb2y + vb3z * vb2z) * r3 * r2;
+
+          s1 = 1.0 - c1*c1;
+          if (s1 < SMALL) s1 = SMALL;
+          s1 = 1.0 / s1;
+
+          s2 = 1.0 - c2*c2;
+          if (s2 < SMALL) s2 = SMALL;
+          s2 = 1.0 / s2;
+
+          s12 = sqrt(s1*s2);
+          c = (c1*c2 + c0) * s12;
+
+          if (c > 1.0) c = 1.0;
+          if (c < -1.0) c = -1.0;
+          cbuf[n] = 180.0*acos(c)/MY_PI;
+        }
+        n += nvalues;
       }
 
       m++;
diff --git a/src/compute_improper_local.h b/src/compute_improper_local.h
index 60028bdb84..57fe7886eb 100644
--- a/src/compute_improper_local.h
+++ b/src/compute_improper_local.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_ke.cpp b/src/compute_ke.cpp
index 629f1488e1..3efd698325 100644
--- a/src/compute_ke.cpp
+++ b/src/compute_ke.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -56,14 +56,14 @@ double ComputeKE::compute_scalar()
   double ke = 0.0;
 
   if (rmass) {
-    for (int i = 0; i < nlocal; i++) 
+    for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	ke += rmass[i] * (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
+        ke += rmass[i] * (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	ke += mass[type[i]] * 
-	  (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
+        ke += mass[type[i]] *
+          (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
   }
 
   MPI_Allreduce(&ke,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
diff --git a/src/compute_ke.h b/src/compute_ke.h
index 7bb4b4cfa5..5dbfeb3081 100644
--- a/src/compute_ke.h
+++ b/src/compute_ke.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_ke_atom.cpp b/src/compute_ke_atom.cpp
index 6d9d45268f..5709c42837 100644
--- a/src/compute_ke_atom.cpp
+++ b/src/compute_ke_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -83,16 +83,16 @@ void ComputeKEAtom::compute_peratom()
   if (rmass)
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	ke[i] = 0.5 * mvv2e * rmass[i] *
-	  (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
+        ke[i] = 0.5 * mvv2e * rmass[i] *
+          (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
       } else ke[i] = 0.0;
     }
 
   else
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	ke[i] = 0.5 * mvv2e * mass[type[i]] *
-	  (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
+        ke[i] = 0.5 * mvv2e * mass[type[i]] *
+          (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
       } else ke[i] = 0.0;
     }
 }
diff --git a/src/compute_ke_atom.h b/src/compute_ke_atom.h
index 9a1265402b..3c815ed1c3 100644
--- a/src/compute_ke_atom.h
+++ b/src/compute_ke_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp
index bf2d00332e..9941abe42a 100644
--- a/src/compute_msd.cpp
+++ b/src/compute_msd.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -140,7 +140,7 @@ void ComputeMSD::compute_vector()
   double xprd = domain->xprd;
   double yprd = domain->yprd;
   double zprd = domain->zprd;
-  
+
   double dx,dy,dz;
   int xbox,ybox,zbox;
 
@@ -150,32 +150,32 @@ void ComputeMSD::compute_vector()
   if (domain->triclinic == 0) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	dx = x[i][0] + xbox*xprd - cm[0] - xoriginal[i][0];
-	dy = x[i][1] + ybox*yprd - cm[1] - xoriginal[i][1];
-	dz = x[i][2] + zbox*zprd - cm[2] - xoriginal[i][2];
-	msd[0] += dx*dx;
-	msd[1] += dy*dy;
-	msd[2] += dz*dz;
-	msd[3] += dx*dx + dy*dy + dz*dz;
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        dx = x[i][0] + xbox*xprd - cm[0] - xoriginal[i][0];
+        dy = x[i][1] + ybox*yprd - cm[1] - xoriginal[i][1];
+        dz = x[i][2] + zbox*zprd - cm[2] - xoriginal[i][2];
+        msd[0] += dx*dx;
+        msd[1] += dy*dy;
+        msd[2] += dz*dz;
+        msd[3] += dx*dx + dy*dy + dz*dz;
       }
 
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	dx = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox - 
-	  cm[0] - xoriginal[i][0];
-	dy = x[i][1] + h[1]*ybox + h[3]*zbox - cm[1] - xoriginal[i][1];
-	dz = x[i][2] + h[2]*zbox - cm[2] - xoriginal[i][2];
-	msd[0] += dx*dx;
-	msd[1] += dy*dy;
-	msd[2] += dz*dz;
-	msd[3] += dx*dx + dy*dy + dz*dz;
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        dx = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox -
+          cm[0] - xoriginal[i][0];
+        dy = x[i][1] + h[1]*ybox + h[3]*zbox - cm[1] - xoriginal[i][1];
+        dz = x[i][2] + h[2]*zbox - cm[2] - xoriginal[i][2];
+        msd[0] += dx*dx;
+        msd[1] += dy*dy;
+        msd[2] += dz*dz;
+        msd[3] += dx*dx + dy*dy + dz*dz;
       }
   }
 
diff --git a/src/compute_msd.h b/src/compute_msd.h
index f4cc93d502..d2a35a4d62 100644
--- a/src/compute_msd.h
+++ b/src/compute_msd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_msd_molecule.cpp b/src/compute_msd_molecule.cpp
index de8d2f63c5..bd4e9960fb 100644
--- a/src/compute_msd_molecule.cpp
+++ b/src/compute_msd_molecule.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -150,7 +150,7 @@ void ComputeMSDMolecule::compute_array()
     }
 
   MPI_Allreduce(&com[0][0],&comall[0][0],3*nmolecules,
-		MPI_DOUBLE,MPI_SUM,world);
+                MPI_DOUBLE,MPI_SUM,world);
   for (i = 0; i < nmolecules; i++) {
     comall[i][0] /= masstotal[i];
     comall[i][1] /= masstotal[i];
diff --git a/src/compute_msd_molecule.h b/src/compute_msd_molecule.h
index 3c1a59f6e2..b4c5bd53a1 100644
--- a/src/compute_msd_molecule.h
+++ b/src/compute_msd_molecule.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_pair.cpp b/src/compute_pair.cpp
index 60c723b952..8c7fa0cef3 100644
--- a/src/compute_pair.cpp
+++ b/src/compute_pair.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -25,7 +25,7 @@ enum{EPAIR,EVDWL,ECOUL};
 
 /* ---------------------------------------------------------------------- */
 
-ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) : 
+ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg < 4 || narg > 5) error->all(FLERR,"Illegal compute pair command");
@@ -56,7 +56,7 @@ ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) :
     pair = force->pair_match(pstyle,1);
   }
 
-  if (!pair) 
+  if (!pair)
     error->all(FLERR,"Unrecognized pair style in compute pair command");
   npair = pair->nextra;
 
@@ -85,7 +85,7 @@ void ComputePair::init()
   // recheck for pair style in case it has been deleted
 
   pair = force->pair_match(pstyle,1);
-  if (!pair) 
+  if (!pair)
     error->all(FLERR,"Unrecognized pair style in compute pair command");
 }
 
diff --git a/src/compute_pair.h b/src/compute_pair.h
index ff37eb6e04..880d02cbd2 100644
--- a/src/compute_pair.h
+++ b/src/compute_pair.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp
index a33232db1b..4215584e4e 100644
--- a/src/compute_pair_local.cpp
+++ b/src/compute_pair_local.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -58,7 +58,7 @@ ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) :
     else if (arg[iarg][0] == 'p') {
       int n = atoi(&arg[iarg][1]);
       if (n <= 0) error->all(FLERR,
-			     "Invalid keyword in compute pair/local command");
+                             "Invalid keyword in compute pair/local command");
       pstyle[nvalues] = PN;
       pindex[nvalues++] = n-1;
     } else error->all(FLERR,"Invalid keyword in compute pair/local command");
@@ -89,7 +89,7 @@ ComputePairLocal::~ComputePairLocal()
 
 void ComputePairLocal::init()
 {
-  if (singleflag && force->pair == NULL) 
+  if (singleflag && force->pair == NULL)
     error->all(FLERR,"No pair style is defined for compute pair/local");
   if (singleflag && force->pair->single_enable == 0)
     error->all(FLERR,"Pair style does not support compute pair/local");
@@ -97,7 +97,7 @@ void ComputePairLocal::init()
   for (int i = 0; i < nvalues; i++)
     if (pstyle[i] == PN && pindex[i] >= force->pair->single_extra)
       error->all(FLERR,"Pair style does not have extra field"
-		 " requested by compute pair/local");
+                 " requested by compute pair/local");
 
   // need an occasional half neighbor list
 
@@ -195,39 +195,39 @@ int ComputePairLocal::compute_pairs(int flag)
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
       if (rsq >= cutsq[itype][jtype]) continue;
-	
+
       if (flag) {
-	if (singleflag)
-	  eng = pair->single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fpair);
-
-	if (nvalues == 1) ptr = &vector[m];
-	else ptr = array[m];
-
-	for (n = 0; n < nvalues; n++) {
-	  switch (pstyle[n]) {
-	  case DIST:
-	    ptr[n] = sqrt(rsq);
-	    break;
-	  case ENG:
-	    ptr[n] = eng;
-	    break;
-	  case FORCE:
-	    ptr[n] = sqrt(rsq)*fpair;
-	    break;
-	  case FX:
-	    ptr[n] = delx*fpair;
-	    break;
-	  case FY:
-	    ptr[n] = dely*fpair;
-	    break;
-	  case FZ:
-	    ptr[n] = delz*fpair;
-	    break;
-	  case PN:
-	    ptr[n] = pair->svector[pindex[n]];
-	    break;
-	  }
-	}
+        if (singleflag)
+          eng = pair->single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fpair);
+
+        if (nvalues == 1) ptr = &vector[m];
+        else ptr = array[m];
+
+        for (n = 0; n < nvalues; n++) {
+          switch (pstyle[n]) {
+          case DIST:
+            ptr[n] = sqrt(rsq);
+            break;
+          case ENG:
+            ptr[n] = eng;
+            break;
+          case FORCE:
+            ptr[n] = sqrt(rsq)*fpair;
+            break;
+          case FX:
+            ptr[n] = delx*fpair;
+            break;
+          case FY:
+            ptr[n] = dely*fpair;
+            break;
+          case FZ:
+            ptr[n] = delz*fpair;
+            break;
+          case PN:
+            ptr[n] = pair->svector[pindex[n]];
+            break;
+          }
+        }
       }
 
       m++;
diff --git a/src/compute_pair_local.h b/src/compute_pair_local.h
index d9ed87d947..82851861c4 100644
--- a/src/compute_pair_local.h
+++ b/src/compute_pair_local.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,7 +37,7 @@ class ComputePairLocal : public Compute {
   int nvalues,dflag,eflag,fflag;
   int ncount;
 
-  int *pstyle;              // style of each requested output 
+  int *pstyle;              // style of each requested output
   int *pindex;              // for pI, index of the output (0 to M-1)
   int singleflag;
 
diff --git a/src/compute_pe.cpp b/src/compute_pe.cpp
index 75ec66dfd6..aaa87d8204 100644
--- a/src/compute_pe.cpp
+++ b/src/compute_pe.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -31,7 +31,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputePE::ComputePE(LAMMPS *lmp, int narg, char **arg) : 
+ComputePE::ComputePE(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg < 3) error->all(FLERR,"Illegal compute pe command");
diff --git a/src/compute_pe.h b/src/compute_pe.h
index e4a45a485c..88a2b63790 100644
--- a/src/compute_pe.h
+++ b/src/compute_pe.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_pe_atom.cpp b/src/compute_pe_atom.cpp
index c16349402c..91bdb9120c 100755
--- a/src/compute_pe_atom.cpp
+++ b/src/compute_pe_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -30,7 +30,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputePEAtom::ComputePEAtom(LAMMPS *lmp, int narg, char **arg) : 
+ComputePEAtom::ComputePEAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg < 3) error->all(FLERR,"Illegal compute pe/atom command");
@@ -111,7 +111,7 @@ void ComputePEAtom::compute_peratom()
   for (i = 0; i < ntotal; i++) energy[i] = 0.0;
 
   // add in per-atom contributions from each force
-  
+
   if (pairflag && force->pair) {
     double *eatom = force->pair->eatom;
     for (i = 0; i < npair; i++) energy[i] += eatom[i];
diff --git a/src/compute_pe_atom.h b/src/compute_pe_atom.h
index 6feaa4af4a..986e16fcd2 100755
--- a/src/compute_pe_atom.h
+++ b/src/compute_pe_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp
index 1870882a18..95a66af51f 100644
--- a/src/compute_pressure.cpp
+++ b/src/compute_pressure.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,11 +54,11 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
   strcpy(id_temp,arg[3]);
 
   int icompute = modify->find_compute(id_temp);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Could not find compute pressure temperature ID");
   if (modify->compute[icompute]->tempflag == 0)
     error->all(FLERR,
-	       "Compute pressure temperature ID does not compute temperature");
+               "Compute pressure temperature ID does not compute temperature");
 
   // process optional args
 
@@ -83,9 +83,9 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
       else if (strcmp(arg[iarg],"kspace") == 0) kspaceflag = 1;
       else if (strcmp(arg[iarg],"fix") == 0) fixflag = 1;
       else if (strcmp(arg[iarg],"virial") == 0) {
-	pairflag = 1;
-	bondflag = angleflag = dihedralflag = improperflag = 1;
-	kspaceflag = fixflag = 1;
+        pairflag = 1;
+        bondflag = angleflag = dihedralflag = improperflag = 1;
+        kspaceflag = fixflag = 1;
       } else error->all(FLERR,"Illegal compute pressure command");
       iarg++;
     }
@@ -117,7 +117,7 @@ void ComputePressure::init()
   // fixes could have changed or compute_modify could have changed it
 
   int icompute = modify->find_compute(id_temp);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Could not find compute pressure temperature ID");
   temperature = modify->compute[icompute];
 
@@ -149,8 +149,8 @@ void ComputePressure::init()
       vptr[nvirial++] = force->improper->virial;
     if (fixflag)
       for (int i = 0; i < modify->nfix; i++)
-	if (modify->fix[i]->virial_flag)
-	  vptr[nvirial++] = modify->fix[i]->virial;
+        if (modify->fix[i]->virial_flag)
+          vptr[nvirial++] = modify->fix[i]->virial;
   }
 
   // flag Kspace contribution separately, since not summed across procs
@@ -182,16 +182,16 @@ double ComputePressure::compute_scalar()
     inv_volume = 1.0 / (domain->xprd * domain->yprd * domain->zprd);
     virial_compute(3,3);
     if (keflag)
-      scalar = (temperature->dof * boltz * t + 
-		virial[0] + virial[1] + virial[2]) / 3.0 * inv_volume * nktv2p;
+      scalar = (temperature->dof * boltz * t +
+                virial[0] + virial[1] + virial[2]) / 3.0 * inv_volume * nktv2p;
     else
       scalar = (virial[0] + virial[1] + virial[2]) / 3.0 * inv_volume * nktv2p;
   } else {
     inv_volume = 1.0 / (domain->xprd * domain->yprd);
     virial_compute(2,2);
     if (keflag)
-      scalar = (temperature->dof * boltz * t + 
-		virial[0] + virial[1]) / 2.0 * inv_volume * nktv2p;
+      scalar = (temperature->dof * boltz * t +
+                virial[0] + virial[1]) / 2.0 * inv_volume * nktv2p;
     else
       scalar = (virial[0] + virial[1]) / 2.0 * inv_volume * nktv2p;
   }
@@ -224,10 +224,10 @@ void ComputePressure::compute_vector()
     virial_compute(6,3);
     if (keflag) {
       for (int i = 0; i < 6; i++)
-	vector[i] = (ke_tensor[i] + virial[i]) * inv_volume * nktv2p;
+        vector[i] = (ke_tensor[i] + virial[i]) * inv_volume * nktv2p;
     } else
       for (int i = 0; i < 6; i++)
-	vector[i] = virial[i] * inv_volume * nktv2p;
+        vector[i] = virial[i] * inv_volume * nktv2p;
   } else {
     inv_volume = 1.0 / (domain->xprd * domain->yprd);
     virial_compute(4,2);
diff --git a/src/compute_pressure.h b/src/compute_pressure.h
index ab59481141..8056a1bfaa 100644
--- a/src/compute_pressure.h
+++ b/src/compute_pressure.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp
index 80efd8a5bf..4336c890a9 100644
--- a/src/compute_property_atom.cpp
+++ b/src/compute_property_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -51,8 +51,8 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
       pack_choice[i] = &ComputePropertyAtom::pack_id;
     } else if (strcmp(arg[iarg],"mol") == 0) {
       if (!atom->molecule_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_molecule;
     } else if (strcmp(arg[iarg],"type") == 0) {
       pack_choice[i] = &ComputePropertyAtom::pack_type;
@@ -66,28 +66,28 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"z") == 0) {
       pack_choice[i] = &ComputePropertyAtom::pack_z;
     } else if (strcmp(arg[iarg],"xs") == 0) {
-      if (domain->triclinic) 
-	pack_choice[i] = &ComputePropertyAtom::pack_xs_triclinic;
+      if (domain->triclinic)
+        pack_choice[i] = &ComputePropertyAtom::pack_xs_triclinic;
       else pack_choice[i] = &ComputePropertyAtom::pack_xs;
     } else if (strcmp(arg[iarg],"ys") == 0) {
-      if (domain->triclinic) 
-	pack_choice[i] = &ComputePropertyAtom::pack_ys_triclinic;
+      if (domain->triclinic)
+        pack_choice[i] = &ComputePropertyAtom::pack_ys_triclinic;
       else pack_choice[i] = &ComputePropertyAtom::pack_ys;
     } else if (strcmp(arg[iarg],"zs") == 0) {
-      if (domain->triclinic) 
-	pack_choice[i] = &ComputePropertyAtom::pack_zs_triclinic;
+      if (domain->triclinic)
+        pack_choice[i] = &ComputePropertyAtom::pack_zs_triclinic;
       else pack_choice[i] = &ComputePropertyAtom::pack_zs;
     } else if (strcmp(arg[iarg],"xu") == 0) {
-      if (domain->triclinic) 
-	pack_choice[i] = &ComputePropertyAtom::pack_xu_triclinic;
+      if (domain->triclinic)
+        pack_choice[i] = &ComputePropertyAtom::pack_xu_triclinic;
       else pack_choice[i] = &ComputePropertyAtom::pack_xu;
     } else if (strcmp(arg[iarg],"yu") == 0) {
-      if (domain->triclinic) 
-	pack_choice[i] = &ComputePropertyAtom::pack_yu_triclinic;
+      if (domain->triclinic)
+        pack_choice[i] = &ComputePropertyAtom::pack_yu_triclinic;
       else pack_choice[i] = &ComputePropertyAtom::pack_yu;
     } else if (strcmp(arg[iarg],"zu") == 0) {
-      if (domain->triclinic) 
-	pack_choice[i] = &ComputePropertyAtom::pack_zu_triclinic;
+      if (domain->triclinic)
+        pack_choice[i] = &ComputePropertyAtom::pack_zu_triclinic;
       else pack_choice[i] = &ComputePropertyAtom::pack_zu;
     } else if (strcmp(arg[iarg],"ix") == 0) {
       pack_choice[i] = &ComputePropertyAtom::pack_ix;
@@ -111,218 +111,218 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
 
     } else if (strcmp(arg[iarg],"q") == 0) {
       if (!atom->q_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_q;
     } else if (strcmp(arg[iarg],"mux") == 0) {
       if (!atom->mu_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_mux;
     } else if (strcmp(arg[iarg],"muy") == 0) {
       if (!atom->mu_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_muy;
     } else if (strcmp(arg[iarg],"muz") == 0) {
       if (!atom->mu_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_muz;
     } else if (strcmp(arg[iarg],"mu") == 0) {
       if (!atom->mu_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_mu;
 
     } else if (strcmp(arg[iarg],"radius") == 0) {
       if (!atom->radius_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_radius;
     } else if (strcmp(arg[iarg],"diameter") == 0) {
       if (!atom->radius_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_diameter;
     } else if (strcmp(arg[iarg],"omegax") == 0) {
       if (!atom->omega_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_omegax;
     } else if (strcmp(arg[iarg],"omegay") == 0) {
       if (!atom->omega_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_omegay;
     } else if (strcmp(arg[iarg],"omegaz") == 0) {
       if (!atom->omega_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_omegaz;
     } else if (strcmp(arg[iarg],"angmomx") == 0) {
       if (!atom->angmom_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_angmomx;
     } else if (strcmp(arg[iarg],"angmomy") == 0) {
       if (!atom->angmom_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_angmomy;
     } else if (strcmp(arg[iarg],"angmomz") == 0) {
       if (!atom->angmom_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_angmomz;
 
     } else if (strcmp(arg[iarg],"shapex") == 0) {
       avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
       if (!avec_ellipsoid) error->all(FLERR,"Compute property/atom for "
-				      "atom property that isn't allocated");
+                                      "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_shapex;
     } else if (strcmp(arg[iarg],"shapey") == 0) {
       avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
       if (!avec_ellipsoid) error->all(FLERR,"Compute property/atom for "
-				      "atom property that isn't allocated");
+                                      "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_shapey;
     } else if (strcmp(arg[iarg],"shapez") == 0) {
       avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
       if (!avec_ellipsoid) error->all(FLERR,"Compute property/atom for "
-				      "atom property that isn't allocated");
+                                      "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_shapez;
     } else if (strcmp(arg[iarg],"quatw") == 0) {
       avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
       if (!avec_ellipsoid) error->all(FLERR,"Compute property/atom for "
-				      "atom property that isn't allocated");
+                                      "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_quatw;
     } else if (strcmp(arg[iarg],"quati") == 0) {
       avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
       if (!avec_ellipsoid) error->all(FLERR,"Compute property/atom for "
-				      "atom property that isn't allocated");
+                                      "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_quati;
     } else if (strcmp(arg[iarg],"quatj") == 0) {
       avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
       if (!avec_ellipsoid) error->all(FLERR,"Compute property/atom for "
-				      "atom property that isn't allocated");
+                                      "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_quatj;
     } else if (strcmp(arg[iarg],"quatk") == 0) {
       avec_ellipsoid = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
       if (!avec_ellipsoid) error->all(FLERR,"Compute property/atom for "
-				      "atom property that isn't allocated");
+                                      "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_quatk;
     } else if (strcmp(arg[iarg],"tqx") == 0) {
       if (!atom->torque_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_tqx;
     } else if (strcmp(arg[iarg],"tqy") == 0) {
       if (!atom->torque_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_tqy;
     } else if (strcmp(arg[iarg],"tqz") == 0) {
       if (!atom->torque_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_tqz;
 
     } else if (strcmp(arg[iarg],"spin") == 0) {
       if (!atom->spin_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_spin;
     } else if (strcmp(arg[iarg],"eradius") == 0) {
       if (!atom->eradius_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_eradius;
     } else if (strcmp(arg[iarg],"ervel") == 0) {
       if (!atom->ervel_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_ervel;
     } else if (strcmp(arg[iarg],"erforce") == 0) {
       if (!atom->erforce_flag)
-	error->all(FLERR,"Compute property/atom for "
-		   "atom property that isn't allocated");
+        error->all(FLERR,"Compute property/atom for "
+                   "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_erforce;
 
     } else if (strcmp(arg[iarg],"end1x") == 0) {
       avec_line = (AtomVecLine *) atom->style_match("line");
       if (!avec_line) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_end1x;
     } else if (strcmp(arg[iarg],"end1y") == 0) {
       avec_line = (AtomVecLine *) atom->style_match("line");
       if (!avec_line) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_end1y;
     } else if (strcmp(arg[iarg],"end1z") == 0) {
       avec_line = (AtomVecLine *) atom->style_match("line");
       if (!avec_line) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_end1z;
     } else if (strcmp(arg[iarg],"end2x") == 0) {
       avec_line = (AtomVecLine *) atom->style_match("line");
       if (!avec_line) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_end2x;
     } else if (strcmp(arg[iarg],"end2y") == 0) {
       avec_line = (AtomVecLine *) atom->style_match("line");
       if (!avec_line) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_end2y;
     } else if (strcmp(arg[iarg],"end2z") == 0) {
       avec_line = (AtomVecLine *) atom->style_match("line");
       if (!avec_line) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_end2z;
 
     } else if (strcmp(arg[iarg],"corner1x") == 0) {
       avec_tri = (AtomVecTri *) atom->style_match("tri");
       if (!avec_tri) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_corner1x;
     } else if (strcmp(arg[iarg],"corner1y") == 0) {
       avec_tri = (AtomVecTri *) atom->style_match("tri");
       if (!avec_tri) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_corner1y;
     } else if (strcmp(arg[iarg],"corner1z") == 0) {
       avec_tri = (AtomVecTri *) atom->style_match("tri");
       if (!avec_tri) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_corner1z;
     } else if (strcmp(arg[iarg],"corner2x") == 0) {
       avec_tri = (AtomVecTri *) atom->style_match("tri");
       if (!avec_tri) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_corner2x;
     } else if (strcmp(arg[iarg],"corner2y") == 0) {
       avec_tri = (AtomVecTri *) atom->style_match("tri");
       if (!avec_tri) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_corner2y;
     } else if (strcmp(arg[iarg],"corner2z") == 0) {
       avec_tri = (AtomVecTri *) atom->style_match("tri");
       if (!avec_tri) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_corner2z;
     } else if (strcmp(arg[iarg],"corner3x") == 0) {
       avec_tri = (AtomVecTri *) atom->style_match("tri");
       if (!avec_tri) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_corner3x;
     } else if (strcmp(arg[iarg],"corner3y") == 0) {
       avec_tri = (AtomVecTri *) atom->style_match("tri");
       if (!avec_tri) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_corner3y;
     } else if (strcmp(arg[iarg],"corner3z") == 0) {
       avec_tri = (AtomVecTri *) atom->style_match("tri");
       if (!avec_tri) error->all(FLERR,"Compute property/atom for "
-				 "atom property that isn't allocated");
+                                 "atom property that isn't allocated");
       pack_choice[i] = &ComputePropertyAtom::pack_corner3z;
 
     } else error->all(FLERR,"Invalid keyword in compute property/atom command");
@@ -572,9 +572,9 @@ void ComputePropertyAtom::pack_xs_triclinic(int n)
   double *h_inv = domain->h_inv;
 
   for (int i = 0; i < nlocal; i++) {
-    if (mask[i] & groupbit) 
-      buf[n] = h_inv[0]*(x[i][0]-boxlo[0]) + 
-	h_inv[5]*(x[i][1]-boxlo[1]) + h_inv[4]*(x[i][2]-boxlo[2]);
+    if (mask[i] & groupbit)
+      buf[n] = h_inv[0]*(x[i][0]-boxlo[0]) +
+        h_inv[5]*(x[i][1]-boxlo[1]) + h_inv[4]*(x[i][2]-boxlo[2]);
     else buf[n] = 0.0;
     n += nvalues;
   }
@@ -630,7 +630,7 @@ void ComputePropertyAtom::pack_xu(int n)
   double xprd = domain->xprd;
 
   for (int i = 0; i < nlocal; i++) {
-    if (mask[i] & groupbit) 
+    if (mask[i] & groupbit)
       buf[n] = x[i][0] + ((image[i] & 1023) - 512) * xprd;
     else buf[n] = 0.0;
     n += nvalues;
diff --git a/src/compute_property_atom.h b/src/compute_property_atom.h
index 41f17b46f5..3e43bc9303 100644
--- a/src/compute_property_atom.h
+++ b/src/compute_property_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp
index 48ab145d8c..b8e6f1e5a7 100644
--- a/src/compute_property_local.cpp
+++ b/src/compute_property_local.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -52,113 +52,113 @@ ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) :
 
     if (strcmp(arg[iarg],"natom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_patom1;
-      if (kindflag != NONE && kindflag != NEIGH) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != NEIGH)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = NEIGH;
     } else if (strcmp(arg[iarg],"natom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_patom2;
-      if (kindflag != NONE && kindflag != NEIGH) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != NEIGH)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = NEIGH;
 
     } else if (strcmp(arg[iarg],"patom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_patom1;
-      if (kindflag != NONE && kindflag != PAIR) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != PAIR)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = PAIR;
     } else if (strcmp(arg[iarg],"patom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_patom2;
-      if (kindflag != NONE && kindflag != PAIR) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != PAIR)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = PAIR;
 
     } else if (strcmp(arg[iarg],"batom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_batom1;
-      if (kindflag != NONE && kindflag != BOND) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != BOND)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = BOND;
     } else if (strcmp(arg[iarg],"batom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_batom2;
-      if (kindflag != NONE && kindflag != BOND) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != BOND)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = BOND;
     } else if (strcmp(arg[iarg],"btype") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_btype;
-      if (kindflag != NONE && kindflag != BOND) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != BOND)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = BOND;
 
     } else if (strcmp(arg[iarg],"aatom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_aatom1;
-      if (kindflag != NONE && kindflag != ANGLE) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != ANGLE)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = ANGLE;
     } else if (strcmp(arg[iarg],"aatom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_aatom2;
-      if (kindflag != NONE && kindflag != ANGLE) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != ANGLE)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = ANGLE;
     } else if (strcmp(arg[iarg],"aatom3") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_aatom3;
-      if (kindflag != NONE && kindflag != ANGLE) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != ANGLE)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = ANGLE;
     } else if (strcmp(arg[iarg],"atype") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_atype;
-      if (kindflag != NONE && kindflag != ANGLE) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != ANGLE)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = ANGLE;
 
     } else if (strcmp(arg[iarg],"datom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_datom1;
-      if (kindflag != NONE && kindflag != DIHEDRAL) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != DIHEDRAL)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = DIHEDRAL;
     } else if (strcmp(arg[iarg],"datom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_datom2;
-      if (kindflag != NONE && kindflag != DIHEDRAL) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != DIHEDRAL)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = DIHEDRAL;
     } else if (strcmp(arg[iarg],"datom3") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_datom3;
-      if (kindflag != NONE && kindflag != DIHEDRAL) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != DIHEDRAL)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = DIHEDRAL;
     } else if (strcmp(arg[iarg],"datom4") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_datom4;
-      if (kindflag != NONE && kindflag != DIHEDRAL) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != DIHEDRAL)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = DIHEDRAL;
     } else if (strcmp(arg[iarg],"dtype") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_dtype;
-      if (kindflag != NONE && kindflag != DIHEDRAL) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != DIHEDRAL)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = DIHEDRAL;
 
     } else if (strcmp(arg[iarg],"iatom1") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_iatom1;
-      if (kindflag != NONE && kindflag != IMPROPER) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != IMPROPER)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = IMPROPER;
     } else if (strcmp(arg[iarg],"iatom2") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_iatom2;
-      if (kindflag != NONE && kindflag != IMPROPER) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != IMPROPER)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = IMPROPER;
     } else if (strcmp(arg[iarg],"iatom3") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_iatom3;
-      if (kindflag != NONE && kindflag != IMPROPER) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != IMPROPER)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = IMPROPER;
     } else if (strcmp(arg[iarg],"iatom4") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_iatom4;
-      if (kindflag != NONE && kindflag != IMPROPER) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != IMPROPER)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = IMPROPER;
     } else if (strcmp(arg[iarg],"itype") == 0) {
       pack_choice[i] = &ComputePropertyLocal::pack_itype;
-      if (kindflag != NONE && kindflag != IMPROPER) 
-	error->all(FLERR,"Compute property/local cannot use these inputs together");
+      if (kindflag != NONE && kindflag != IMPROPER)
+        error->all(FLERR,"Compute property/local cannot use these inputs together");
       kindflag = IMPROPER;
 
     } else error->all(FLERR,"Invalid keyword in compute property/local command");
@@ -196,7 +196,7 @@ ComputePropertyLocal::~ComputePropertyLocal()
 void ComputePropertyLocal::init()
 {
   if (kindflag == NEIGH || kindflag == PAIR) {
-    if (force->pair == NULL) 
+    if (force->pair == NULL)
       error->all(FLERR,"No pair style is defined for compute property/local");
     if (force->pair->single_enable == 0)
       error->all(FLERR,"Pair style does not support compute property/local");
@@ -333,8 +333,8 @@ int ComputePropertyLocal::count_pairs(int allflag, int forceflag)
       if (forceflag && rsq >= cutsq[itype][jtype]) continue;
 
       if (allflag) {
-	indices[m][0] = tag[i];
-	indices[m][1] = tag[j];
+        indices[m][0] = tag[i];
+        indices[m][1] = tag[j];
       }
       m++;
     }
@@ -374,8 +374,8 @@ int ComputePropertyLocal::count_bonds(int flag)
       if (bond_type[atom1][i] == 0) continue;
 
       if (flag) {
-	indices[m][0] = atom1;
-	indices[m][1] = i;
+        indices[m][0] = atom1;
+        indices[m][1] = i;
       }
       m++;
     }
@@ -418,8 +418,8 @@ int ComputePropertyLocal::count_angles(int flag)
       if (angle_type[atom2][i] == 0) continue;
 
       if (flag) {
-	indices[m][0] = atom2;
-	indices[m][1] = i;
+        indices[m][0] = atom2;
+        indices[m][1] = i;
       }
       m++;
     }
@@ -461,8 +461,8 @@ int ComputePropertyLocal::count_dihedrals(int flag)
       if (atom4 < 0 || !(mask[atom4] & groupbit)) continue;
 
       if (flag) {
-	indices[m][0] = atom2;
-	indices[m][1] = i;
+        indices[m][0] = atom2;
+        indices[m][1] = i;
       }
       m++;
     }
@@ -504,8 +504,8 @@ int ComputePropertyLocal::count_impropers(int flag)
       if (atom4 < 0 || !(mask[atom4] & groupbit)) continue;
 
       if (flag) {
-	indices[m][0] = atom2;
-	indices[m][1] = i;
+        indices[m][0] = atom2;
+        indices[m][1] = i;
       }
       m++;
     }
diff --git a/src/compute_property_local.h b/src/compute_property_local.h
index d7a2d6a612..eab19768f6 100644
--- a/src/compute_property_local.h
+++ b/src/compute_property_local.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_property_molecule.cpp b/src/compute_property_molecule.cpp
index 65ec20ef03..c0bcafc9ea 100644
--- a/src/compute_property_molecule.cpp
+++ b/src/compute_property_molecule.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,7 +65,7 @@ ComputePropertyMolecule(LAMMPS *lmp, int narg, char **arg) :
     size_array_cols = nvalues;
     extarray = 0;
   }
-  
+
   // fill vector or array with molecule values
 
   if (nvalues == 1) {
diff --git a/src/compute_property_molecule.h b/src/compute_property_molecule.h
index 9c79e93bc8..0c5ae68df0 100644
--- a/src/compute_property_molecule.h
+++ b/src/compute_property_molecule.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp
index 31776f9473..7511e1b5c3 100644
--- a/src/compute_rdf.cpp
+++ b/src/compute_rdf.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -73,7 +73,7 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
       force->bounds(arg[iarg],atom->ntypes,ilo[npairs],ihi[npairs]);
       force->bounds(arg[iarg+1],atom->ntypes,jlo[npairs],jhi[npairs]);
       if (ilo[npairs] > ihi[npairs] || jlo[npairs] > jhi[npairs])
-	error->all(FLERR,"Illegal compute rdf command");
+        error->all(FLERR,"Illegal compute rdf command");
       npairs++;
       iarg += 2;
     }
@@ -87,7 +87,7 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
   for (int m = 0; m < npairs; m++)
     for (i = ilo[m]; i <= ihi[m]; i++)
       for (j = jlo[m]; j <= jhi[m]; j++)
-	rdfpair[nrdfpair[i][j]++][i][j] = m;
+        rdfpair[nrdfpair[i][j]++][i][j] = m;
 
   memory->create(hist,npairs,nbin,"rdf:hist");
   memory->create(histall,npairs,nbin,"rdf:histall");
@@ -250,12 +250,12 @@ void ComputeRDF::compute_array()
       if (ibin >= nbin) continue;
 
       if (ipair)
-	for (ihisto = 0; ihisto < ipair; ihisto++)
-	  hist[rdfpair[ihisto][itype][jtype]][ibin] += 1.0;
+        for (ihisto = 0; ihisto < ipair; ihisto++)
+          hist[rdfpair[ihisto][itype][jtype]][ibin] += 1.0;
       if (newton_pair || j < nlocal) {
-	if (jpair)
-	  for (ihisto = 0; ihisto < jpair; ihisto++)
-	    hist[rdfpair[ihisto][jtype][itype]][ibin] += 1.0;
+        if (jpair)
+          for (ihisto = 0; ihisto < jpair; ihisto++)
+            hist[rdfpair[ihisto][jtype][itype]][ibin] += 1.0;
       }
     }
   }
@@ -276,16 +276,16 @@ void ComputeRDF::compute_array()
     for (m = 0; m < npairs; m++) {
       ncoord = 0.0;
       for (ibin = 0; ibin < nbin; ibin++) {
-	rlower = ibin*delr;
-	rupper = (ibin+1)*delr;
-	nideal = constant * 
-	  (rupper*rupper*rupper - rlower*rlower*rlower) * jcount[m];
-	if (icount[m]*nideal != 0.0) 
-	  gr = histall[m][ibin] / (icount[m]*nideal);
-	else gr = 0.0;
-	ncoord += gr*nideal;
-	array[ibin][1+2*m] = gr;
-	array[ibin][2+2*m] = ncoord;
+        rlower = ibin*delr;
+        rupper = (ibin+1)*delr;
+        nideal = constant *
+          (rupper*rupper*rupper - rlower*rlower*rlower) * jcount[m];
+        if (icount[m]*nideal != 0.0)
+          gr = histall[m][ibin] / (icount[m]*nideal);
+        else gr = 0.0;
+        ncoord += gr*nideal;
+        array[ibin][1+2*m] = gr;
+        array[ibin][2+2*m] = ncoord;
       }
     }
 
@@ -295,15 +295,15 @@ void ComputeRDF::compute_array()
     for (m = 0; m < npairs; m++) {
       ncoord = 0.0;
       for (ibin = 0; ibin < nbin; ibin++) {
-	rlower = ibin*delr;
-	rupper = (ibin+1)*delr;
-	nideal = constant * (rupper*rupper - rlower*rlower) * jcount[m];
-	if (icount[m]*nideal != 0.0) 
-	  gr = histall[m][ibin] / (icount[m]*nideal);
-	else gr = 0.0;
-	ncoord += gr*nideal;
-	array[ibin][1+2*m] = gr;
-	array[ibin][2+2*m] = ncoord;
+        rlower = ibin*delr;
+        rupper = (ibin+1)*delr;
+        nideal = constant * (rupper*rupper - rlower*rlower) * jcount[m];
+        if (icount[m]*nideal != 0.0)
+          gr = histall[m][ibin] / (icount[m]*nideal);
+        else gr = 0.0;
+        ncoord += gr*nideal;
+        array[ibin][1+2*m] = gr;
+        array[ibin][2+2*m] = ncoord;
       }
     }
   }
diff --git a/src/compute_rdf.h b/src/compute_rdf.h
index 5255abdc52..8436593c9d 100644
--- a/src/compute_rdf.h
+++ b/src/compute_rdf.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,14 +35,14 @@ class ComputeRDF : public Compute {
 
  private:
   int first;
-  int nbin;			 // # of rdf bins
-  int npairs;            	 // # of rdf pairs
-  double delr,delrinv;		 // bin width and its inverse
-  int ***rdfpair;              	 // map 2 type pair to rdf pair for each histo
+  int nbin;                         // # of rdf bins
+  int npairs;                     // # of rdf pairs
+  double delr,delrinv;                 // bin width and its inverse
+  int ***rdfpair;                       // map 2 type pair to rdf pair for each histo
   int **nrdfpair;                // # of histograms for each type pair
   int *ilo,*ihi,*jlo,*jhi;
-  double **hist;	         // histogram bins
-  double **histall;	         // summed histogram bins across all procs
+  double **hist;                 // histogram bins
+  double **histall;                 // summed histogram bins across all procs
 
   int *typecount;
   int *icount,*jcount;
diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp
index 816e551f98..645dbac738 100644
--- a/src/compute_reduce.cpp
+++ b/src/compute_reduce.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -112,9 +112,9 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
       which[nvalues] = F;
       argindex[nvalues++] = 2;
 
-    } else if (strncmp(arg[iarg],"c_",2) == 0 || 
-	       strncmp(arg[iarg],"f_",2) == 0 || 
-	       strncmp(arg[iarg],"v_",2) == 0) {
+    } else if (strncmp(arg[iarg],"c_",2) == 0 ||
+               strncmp(arg[iarg],"f_",2) == 0 ||
+               strncmp(arg[iarg],"v_",2) == 0) {
       if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE;
       else if (arg[iarg][0] == 'f') which[nvalues] = FIX;
       else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE;
@@ -125,10 +125,10 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Illegal compute reduce command");
-	argindex[nvalues] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Illegal compute reduce command");
+        argindex[nvalues] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[nvalues] = 0;
 
       n = strlen(suffix) + 1;
@@ -151,14 +151,14 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
     if (strcmp(arg[iarg],"replace") == 0) {
       if (iarg+3 > narg) error->all(FLERR,"Illegal compute reduce command");
       if (mode != MINN && mode != MAXX)
-	error->all(FLERR,"Compute reduce replace requires min or max mode");
+        error->all(FLERR,"Compute reduce replace requires min or max mode");
       int col1 = atoi(arg[iarg+1]) - 1;
       int col2 = atoi(arg[iarg+2]) - 1;
       if (col1 < 0 || col1 >= nvalues || col2 < 0 || col2 >= nvalues)
-	error->all(FLERR,"Illegal compute reduce command");
-      if (col1 == col2)	error->all(FLERR,"Illegal compute reduce command");
+        error->all(FLERR,"Illegal compute reduce command");
+      if (col1 == col2)        error->all(FLERR,"Illegal compute reduce command");
       if (replace[col1] >= 0 || replace[col2] >= 0)
-	error->all(FLERR,"Invalid replace values in compute reduce"); 
+        error->all(FLERR,"Invalid replace values in compute reduce");
       replace[col1] = col2;
       iarg += 3;
     } else error->all(FLERR,"Illegal compute reduce command");
@@ -183,69 +183,69 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
     else if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for compute reduce does not exist");
+        error->all(FLERR,"Compute ID for compute reduce does not exist");
       if (modify->compute[icompute]->peratom_flag) {
-	flavor[i] = PERATOM;
-	if (argindex[i] == 0 && 
-	    modify->compute[icompute]->size_peratom_cols != 0)
-	  error->all(FLERR,"Compute reduce compute does not "
-		     "calculate a per-atom vector");
-	if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	  error->all(FLERR,"Compute reduce compute does not "
-		     "calculate a per-atom array");
-	if (argindex[i] && 
-	    argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	  error->all(FLERR,"Compute reduce compute array is accessed out-of-range");
+        flavor[i] = PERATOM;
+        if (argindex[i] == 0 &&
+            modify->compute[icompute]->size_peratom_cols != 0)
+          error->all(FLERR,"Compute reduce compute does not "
+                     "calculate a per-atom vector");
+        if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
+          error->all(FLERR,"Compute reduce compute does not "
+                     "calculate a per-atom array");
+        if (argindex[i] &&
+            argindex[i] > modify->compute[icompute]->size_peratom_cols)
+          error->all(FLERR,"Compute reduce compute array is accessed out-of-range");
       } else if (modify->compute[icompute]->local_flag) {
-	flavor[i] = LOCAL;
-	if (argindex[i] == 0 && 
-	    modify->compute[icompute]->size_local_cols != 0)
-	  error->all(FLERR,"Compute reduce compute does not "
-		     "calculate a local vector");
-	if (argindex[i] && modify->compute[icompute]->size_local_cols == 0)
-	  error->all(FLERR,"Compute reduce compute does not "
-		     "calculate a local array");
-	if (argindex[i] && 
-	    argindex[i] > modify->compute[icompute]->size_local_cols)
-	  error->all(FLERR,"Compute reduce compute array is accessed out-of-range");
+        flavor[i] = LOCAL;
+        if (argindex[i] == 0 &&
+            modify->compute[icompute]->size_local_cols != 0)
+          error->all(FLERR,"Compute reduce compute does not "
+                     "calculate a local vector");
+        if (argindex[i] && modify->compute[icompute]->size_local_cols == 0)
+          error->all(FLERR,"Compute reduce compute does not "
+                     "calculate a local array");
+        if (argindex[i] &&
+            argindex[i] > modify->compute[icompute]->size_local_cols)
+          error->all(FLERR,"Compute reduce compute array is accessed out-of-range");
       } else error->all(FLERR,"Compute reduce compute calculates global values");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for compute reduce does not exist");
+        error->all(FLERR,"Fix ID for compute reduce does not exist");
       if (modify->fix[ifix]->peratom_flag) {
-	flavor[i] = PERATOM;
-	if (argindex[i] == 0 && 
-	    modify->fix[ifix]->size_peratom_cols != 0)
-	  error->all(FLERR,"Compute reduce fix does not "
-		     "calculate a per-atom vector");
-	if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	  error->all(FLERR,"Compute reduce fix does not "
-		     "calculate a per-atom array");
-	if (argindex[i] && 
-	    argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	  error->all(FLERR,"Compute reduce fix array is accessed out-of-range");
+        flavor[i] = PERATOM;
+        if (argindex[i] == 0 &&
+            modify->fix[ifix]->size_peratom_cols != 0)
+          error->all(FLERR,"Compute reduce fix does not "
+                     "calculate a per-atom vector");
+        if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
+          error->all(FLERR,"Compute reduce fix does not "
+                     "calculate a per-atom array");
+        if (argindex[i] &&
+            argindex[i] > modify->fix[ifix]->size_peratom_cols)
+          error->all(FLERR,"Compute reduce fix array is accessed out-of-range");
       } else if (modify->fix[ifix]->local_flag) {
-	flavor[i] = LOCAL;
-	if (argindex[i] == 0 && 
-	    modify->fix[ifix]->size_local_cols != 0)
-	  error->all(FLERR,"Compute reduce fix does not "
-		     "calculate a local vector");
-	if (argindex[i] && modify->fix[ifix]->size_local_cols == 0)
-	  error->all(FLERR,"Compute reduce fix does not "
-		     "calculate a local array");
-	if (argindex[i] && 
-	    argindex[i] > modify->fix[ifix]->size_local_cols)
-	  error->all(FLERR,"Compute reduce fix array is accessed out-of-range");
+        flavor[i] = LOCAL;
+        if (argindex[i] == 0 &&
+            modify->fix[ifix]->size_local_cols != 0)
+          error->all(FLERR,"Compute reduce fix does not "
+                     "calculate a local vector");
+        if (argindex[i] && modify->fix[ifix]->size_local_cols == 0)
+          error->all(FLERR,"Compute reduce fix does not "
+                     "calculate a local array");
+        if (argindex[i] &&
+            argindex[i] > modify->fix[ifix]->size_local_cols)
+          error->all(FLERR,"Compute reduce fix array is accessed out-of-range");
       } else error->all(FLERR,"Compute reduce fix calculates global values");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all(FLERR,"Variable name for compute reduce does not exist");
+        error->all(FLERR,"Variable name for compute reduce does not exist");
       if (input->variable->atomstyle(ivariable) == 0)
-	error->all(FLERR,"Compute reduce variable is not atom-style variable");
+        error->all(FLERR,"Compute reduce variable is not atom-style variable");
       flavor[i] = PERATOM;
     }
   }
@@ -304,19 +304,19 @@ void ComputeReduce::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for compute reduce does not exist");
+        error->all(FLERR,"Compute ID for compute reduce does not exist");
       value2index[m] = icompute;
-      
+
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
-      if (ifix < 0) 
-	error->all(FLERR,"Fix ID for compute reduce does not exist");
+      if (ifix < 0)
+        error->all(FLERR,"Fix ID for compute reduce does not exist");
       value2index[m] = ifix;
 
     } else if (which[m] == VARIABLE) {
       int ivariable = input->variable->find(ids[m]);
-      if (ivariable < 0) 
-	error->all(FLERR,"Variable name for compute reduce does not exist");
+      if (ivariable < 0)
+        error->all(FLERR,"Variable name for compute reduce does not exist");
       value2index[m] = ivariable;
 
     } else value2index[m] = -1;
@@ -373,45 +373,45 @@ void ComputeReduce::compute_vector()
   } else if (mode == MINN) {
     if (!replace) {
       for (int m = 0; m < nvalues; m++)
-	MPI_Allreduce(&onevec[m],&vector[m],1,MPI_DOUBLE,MPI_MIN,world);
+        MPI_Allreduce(&onevec[m],&vector[m],1,MPI_DOUBLE,MPI_MIN,world);
 
     } else {
       for (int m = 0; m < nvalues; m++)
-	if (replace[m] < 0) {
-	  pairme.value = onevec[m];
-	  pairme.proc = me;
-	  MPI_Allreduce(&pairme,&pairall,1,MPI_DOUBLE_INT,MPI_MINLOC,world);
-	  vector[m] = pairall.value;
-	  owner[m] = pairall.proc;
-	}
+        if (replace[m] < 0) {
+          pairme.value = onevec[m];
+          pairme.proc = me;
+          MPI_Allreduce(&pairme,&pairall,1,MPI_DOUBLE_INT,MPI_MINLOC,world);
+          vector[m] = pairall.value;
+          owner[m] = pairall.proc;
+        }
       for (int m = 0; m < nvalues; m++)
-	if (replace[m] >= 0) {
-	  if (me == owner[replace[m]])
-	    vector[m] = compute_one(m,indices[replace[m]]);
-	  MPI_Bcast(&vector[m],1,MPI_DOUBLE,owner[replace[m]],world);
-	}
+        if (replace[m] >= 0) {
+          if (me == owner[replace[m]])
+            vector[m] = compute_one(m,indices[replace[m]]);
+          MPI_Bcast(&vector[m],1,MPI_DOUBLE,owner[replace[m]],world);
+        }
     }
 
   } else if (mode == MAXX) {
     if (!replace) {
       for (int m = 0; m < nvalues; m++)
-	MPI_Allreduce(&onevec[m],&vector[m],1,MPI_DOUBLE,MPI_MAX,world);
+        MPI_Allreduce(&onevec[m],&vector[m],1,MPI_DOUBLE,MPI_MAX,world);
 
     } else {
       for (int m = 0; m < nvalues; m++)
-	if (replace[m] < 0) {
-	  pairme.value = onevec[m];
-	  pairme.proc = me;
-	  MPI_Allreduce(&pairme,&pairall,1,MPI_DOUBLE_INT,MPI_MAXLOC,world);
-	  vector[m] = pairall.value;
-	  owner[m] = pairall.proc;
-	}
+        if (replace[m] < 0) {
+          pairme.value = onevec[m];
+          pairme.proc = me;
+          MPI_Allreduce(&pairme,&pairall,1,MPI_DOUBLE_INT,MPI_MAXLOC,world);
+          vector[m] = pairall.value;
+          owner[m] = pairall.proc;
+        }
       for (int m = 0; m < nvalues; m++)
-	if (replace[m] >= 0) {
-	  if (me == owner[replace[m]])
-	    vector[m] = compute_one(m,indices[replace[m]]);
-	  MPI_Bcast(&vector[m],1,MPI_DOUBLE,owner[replace[m]],world);
-	}
+        if (replace[m] >= 0) {
+          if (me == owner[replace[m]])
+            vector[m] = compute_one(m,indices[replace[m]]);
+          MPI_Bcast(&vector[m],1,MPI_DOUBLE,owner[replace[m]],world);
+        }
     }
 
   } else if (mode == AVE) {
@@ -457,70 +457,70 @@ double ComputeReduce::compute_one(int m, int flag)
     double **x = atom->x;
     if (flag < 0) {
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) combine(one,x[i][aidx],i);
+        if (mask[i] & groupbit) combine(one,x[i][aidx],i);
     } else one = x[flag][aidx];
   } else if (which[m] == V) {
     double **v = atom->v;
     if (flag < 0) {
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) combine(one,v[i][aidx],i);
+        if (mask[i] & groupbit) combine(one,v[i][aidx],i);
     } else one = v[flag][aidx];
   } else if (which[m] == F) {
     double **f = atom->f;
     if (flag < 0) {
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) combine(one,f[i][aidx],i);
+        if (mask[i] & groupbit) combine(one,f[i][aidx],i);
     } else one = f[flag][aidx];
-    
+
   // invoke compute if not previously invoked
 
   } else if (which[m] == COMPUTE) {
     Compute *compute = modify->compute[vidx];
-    
+
     if (flavor[m] == PERATOM) {
       if (!(compute->invoked_flag & INVOKED_PERATOM)) {
-	compute->compute_peratom();
-	compute->invoked_flag |= INVOKED_PERATOM;
+        compute->compute_peratom();
+        compute->invoked_flag |= INVOKED_PERATOM;
       }
 
       if (aidx == 0) {
-	double *comp_vec = compute->vector_atom;
-	int n = nlocal;
-	if (flag < 0) {
-	  for (i = 0; i < n; i++)
-	    if (mask[i] & groupbit) combine(one,comp_vec[i],i);
-	} else one = comp_vec[flag];
+        double *comp_vec = compute->vector_atom;
+        int n = nlocal;
+        if (flag < 0) {
+          for (i = 0; i < n; i++)
+            if (mask[i] & groupbit) combine(one,comp_vec[i],i);
+        } else one = comp_vec[flag];
       } else {
-	double **carray_atom = compute->array_atom;
-	int n = nlocal;
-	int aidxm1 = aidx - 1;
-	if (flag < 0) {
-	  for (i = 0; i < n; i++)
-	    if (mask[i] & groupbit) combine(one,carray_atom[i][aidxm1],i);
-	} else one = carray_atom[flag][aidxm1];
+        double **carray_atom = compute->array_atom;
+        int n = nlocal;
+        int aidxm1 = aidx - 1;
+        if (flag < 0) {
+          for (i = 0; i < n; i++)
+            if (mask[i] & groupbit) combine(one,carray_atom[i][aidxm1],i);
+        } else one = carray_atom[flag][aidxm1];
       }
 
     } else if (flavor[m] == LOCAL) {
       if (!(compute->invoked_flag & INVOKED_LOCAL)) {
-	compute->compute_local();
-	compute->invoked_flag |= INVOKED_LOCAL;
+        compute->compute_local();
+        compute->invoked_flag |= INVOKED_LOCAL;
       }
 
       if (aidx == 0) {
-	double *comp_vec = compute->vector_local;
-	int n = compute->size_local_rows;
-	if (flag < 0)
-	  for (i = 0; i < n; i++)
-	    combine(one,comp_vec[i],i);
-	else one = comp_vec[flag];
+        double *comp_vec = compute->vector_local;
+        int n = compute->size_local_rows;
+        if (flag < 0)
+          for (i = 0; i < n; i++)
+            combine(one,comp_vec[i],i);
+        else one = comp_vec[flag];
       } else {
-	double **carray_local = compute->array_local;
-	int n = compute->size_local_rows;
-	int aidxm1 = aidx - 1;
-	if (flag < 0)
-	  for (i = 0; i < n; i++)
-	    combine(one,carray_local[i][aidxm1],i);
-	else one = carray_local[flag][aidxm1];
+        double **carray_local = compute->array_local;
+        int n = compute->size_local_rows;
+        int aidxm1 = aidx - 1;
+        if (flag < 0)
+          for (i = 0; i < n; i++)
+            combine(one,carray_local[i][aidxm1],i);
+        else one = carray_local[flag][aidxm1];
       }
     }
 
@@ -533,40 +533,40 @@ double ComputeReduce::compute_one(int m, int flag)
 
     if (flavor[m] == PERATOM) {
       if (aidx == 0) {
-	double *fix_vector = fix->vector_atom;
-	int n = nlocal;
-	if (flag < 0) {
-	  for (i = 0; i < n; i++)
-	    if (mask[i] & groupbit) combine(one,fix_vector[i],i);
-	} else one = fix_vector[flag];
+        double *fix_vector = fix->vector_atom;
+        int n = nlocal;
+        if (flag < 0) {
+          for (i = 0; i < n; i++)
+            if (mask[i] & groupbit) combine(one,fix_vector[i],i);
+        } else one = fix_vector[flag];
       } else {
-	double **fix_array = fix->array_atom;
-	int aidxm1 = aidx - 1;
-	if (flag < 0) {
-	  for (i = 0; i < nlocal; i++)
-	    if (mask[i] & groupbit) combine(one,fix_array[i][aidxm1],i);
-	} else one = fix_array[flag][aidxm1];
+        double **fix_array = fix->array_atom;
+        int aidxm1 = aidx - 1;
+        if (flag < 0) {
+          for (i = 0; i < nlocal; i++)
+            if (mask[i] & groupbit) combine(one,fix_array[i][aidxm1],i);
+        } else one = fix_array[flag][aidxm1];
       }
 
     } else if (flavor[m] == LOCAL) {
       if (aidx == 0) {
-	double *fix_vector = fix->vector_local;
-	int n = fix->size_local_rows;
-	if (flag < 0)
-	  for (i = 0; i < n; i++)
-	    combine(one,fix_vector[i],i);
-	else one = fix_vector[flag];
+        double *fix_vector = fix->vector_local;
+        int n = fix->size_local_rows;
+        if (flag < 0)
+          for (i = 0; i < n; i++)
+            combine(one,fix_vector[i],i);
+        else one = fix_vector[flag];
       } else {
-	double **fix_array = fix->array_local;
-	int n = fix->size_local_rows;
-	int aidxm1 = aidx - 1;
-	if (flag < 0)
-	  for (i = 0; i < n; i++)
-	    combine(one,fix_array[i][aidxm1],i);
-	else one = fix_array[flag][aidxm1];
+        double **fix_array = fix->array_local;
+        int n = fix->size_local_rows;
+        int aidxm1 = aidx - 1;
+        if (flag < 0)
+          for (i = 0; i < n; i++)
+            combine(one,fix_array[i][aidxm1],i);
+        else one = fix_array[flag][aidxm1];
       }
     }
-    
+
   // evaluate atom-style variable
 
   } else if (which[m] == VARIABLE) {
@@ -579,7 +579,7 @@ double ComputeReduce::compute_one(int m, int flag)
     input->variable->compute_atom(vidx,igroup,varatom,1,0);
     if (flag < 0) {
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) combine(one,varatom[i],i);
+        if (mask[i] & groupbit) combine(one,varatom[i],i);
     } else one = varatom[flag];
   }
 
diff --git a/src/compute_reduce.h b/src/compute_reduce.h
index 90621ac283..b0195d982f 100644
--- a/src/compute_reduce.h
+++ b/src/compute_reduce.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_reduce_region.cpp b/src/compute_reduce_region.cpp
index 648b90e1d8..3f54dd5bbe 100644
--- a/src/compute_reduce_region.cpp
+++ b/src/compute_reduce_region.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -80,24 +80,24 @@ double ComputeReduceRegion::compute_one(int m, int flag)
   if (which[m] == X) {
     if (flag < 0) {
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	  combine(one,x[i][j],i);
+        if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
+          combine(one,x[i][j],i);
     } else one = x[flag][j];
   } else if (which[m] == V) {
     double **v = atom->v;
     if (flag < 0) {
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	  combine(one,v[i][j],i);
+        if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
+          combine(one,v[i][j],i);
     } else one = v[flag][j];
   } else if (which[m] == F) {
     double **f = atom->f;
     if (flag < 0) {
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	  combine(one,f[i][j],i);
+        if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
+          combine(one,f[i][j],i);
     } else one = f[flag][j];
-    
+
   // invoke compute if not previously invoked
 
   } else if (which[m] == COMPUTE) {
@@ -105,50 +105,50 @@ double ComputeReduceRegion::compute_one(int m, int flag)
 
     if (flavor[m] == PERATOM) {
       if (!(compute->invoked_flag & INVOKED_PERATOM)) {
-	compute->compute_peratom();
-	compute->invoked_flag |= INVOKED_PERATOM;
+        compute->compute_peratom();
+        compute->invoked_flag |= INVOKED_PERATOM;
       }
 
       if (j == 0) {
-	double *compute_vector = compute->vector_atom;
-	int n = nlocal;
-	if (flag < 0) {
-	  for (i = 0; i < n; i++)
-	    if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	      combine(one,compute_vector[i],i);
-	} else one = compute_vector[flag];
+        double *compute_vector = compute->vector_atom;
+        int n = nlocal;
+        if (flag < 0) {
+          for (i = 0; i < n; i++)
+            if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
+              combine(one,compute_vector[i],i);
+        } else one = compute_vector[flag];
       } else {
-	double **compute_array = compute->array_atom;
-	int n = nlocal;
-	int jm1 = j - 1;
-	if (flag < 0) {
-	  for (i = 0; i < n; i++)
-	    if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	      combine(one,compute_array[i][jm1],i);
-	} else one = compute_array[flag][jm1];
+        double **compute_array = compute->array_atom;
+        int n = nlocal;
+        int jm1 = j - 1;
+        if (flag < 0) {
+          for (i = 0; i < n; i++)
+            if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
+              combine(one,compute_array[i][jm1],i);
+        } else one = compute_array[flag][jm1];
       }
 
     } else if (flavor[m] == LOCAL) {
       if (!(compute->invoked_flag & INVOKED_LOCAL)) {
-	compute->compute_local();
-	compute->invoked_flag |= INVOKED_LOCAL;
+        compute->compute_local();
+        compute->invoked_flag |= INVOKED_LOCAL;
       }
 
       if (j == 0) {
-	double *compute_vector = compute->vector_local;
-	int n = compute->size_local_rows;
-	if (flag < 0)
-	  for (i = 0; i < n; i++)
-	    combine(one,compute_vector[i],i);
-	else one = compute_vector[flag];
+        double *compute_vector = compute->vector_local;
+        int n = compute->size_local_rows;
+        if (flag < 0)
+          for (i = 0; i < n; i++)
+            combine(one,compute_vector[i],i);
+        else one = compute_vector[flag];
       } else {
-	double **compute_array = compute->array_local;
-	int n = compute->size_local_rows;
-	int jm1 = j - 1;
-	if (flag < 0)
-	  for (i = 0; i < n; i++)
-	    combine(one,compute_array[i][jm1],i);
-	else one = compute_array[flag][jm1];
+        double **compute_array = compute->array_local;
+        int n = compute->size_local_rows;
+        int jm1 = j - 1;
+        if (flag < 0)
+          for (i = 0; i < n; i++)
+            combine(one,compute_array[i][jm1],i);
+        else one = compute_array[flag][jm1];
       }
     }
 
@@ -161,42 +161,42 @@ double ComputeReduceRegion::compute_one(int m, int flag)
 
     if (flavor[m] == PERATOM) {
       if (j == 0) {
-	double *fix_vector = fix->vector_atom;
-	int n = nlocal;
-	if (flag < 0) {
-	  for (i = 0; i < n; i++)
-	    if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	      combine(one,fix_vector[i],i);
-	} else one = fix_vector[flag];
+        double *fix_vector = fix->vector_atom;
+        int n = nlocal;
+        if (flag < 0) {
+          for (i = 0; i < n; i++)
+            if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
+              combine(one,fix_vector[i],i);
+        } else one = fix_vector[flag];
       } else {
-	double **fix_array = fix->array_atom;
-	int jm1 = j - 1;
-	if (flag < 0) {
-	  for (i = 0; i < nlocal; i++)
-	    if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	      combine(one,fix_array[i][jm1],i);
-	} else one = fix_array[flag][jm1];
+        double **fix_array = fix->array_atom;
+        int jm1 = j - 1;
+        if (flag < 0) {
+          for (i = 0; i < nlocal; i++)
+            if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
+              combine(one,fix_array[i][jm1],i);
+        } else one = fix_array[flag][jm1];
       }
 
     } else if (flavor[m] == LOCAL) {
       if (j == 0) {
-	double *fix_vector = fix->vector_local;
-	int n = fix->size_local_rows;
-	if (flag < 0)
-	  for (i = 0; i < n; i++)
-	    combine(one,fix_vector[i],i);
-	else one = fix_vector[flag];
+        double *fix_vector = fix->vector_local;
+        int n = fix->size_local_rows;
+        if (flag < 0)
+          for (i = 0; i < n; i++)
+            combine(one,fix_vector[i],i);
+        else one = fix_vector[flag];
       } else {
-	double **fix_array = fix->array_local;
-	int n = fix->size_local_rows;
-	int jm1 = j - 1;
-	if (flag < 0)
-	  for (i = 0; i < n; i++)
-	    combine(one,fix_array[i][jm1],i);
-	else one = fix_array[flag][jm1];
+        double **fix_array = fix->array_local;
+        int n = fix->size_local_rows;
+        int jm1 = j - 1;
+        if (flag < 0)
+          for (i = 0; i < n; i++)
+            combine(one,fix_array[i][jm1],i);
+        else one = fix_array[flag][jm1];
       }
     }
-    
+
   // evaluate atom-style variable
 
   } else if (which[m] == VARIABLE) {
@@ -209,8 +209,8 @@ double ComputeReduceRegion::compute_one(int m, int flag)
     input->variable->compute_atom(n,igroup,varatom,1,0);
     if (flag < 0) {
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	  combine(one,varatom[i],i);
+        if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
+          combine(one,varatom[i],i);
     } else one = varatom[flag];
   }
 
diff --git a/src/compute_reduce_region.h b/src/compute_reduce_region.h
index d27c9f4f81..bba46383f4 100644
--- a/src/compute_reduce_region.h
+++ b/src/compute_reduce_region.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_slice.cpp b/src/compute_slice.cpp
index 85e9230499..76763dc50f 100644
--- a/src/compute_slice.cpp
+++ b/src/compute_slice.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -53,8 +53,8 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
   nvalues = 0;
 
   for (int iarg = 6; iarg < narg; iarg++) {
-    if (strncmp(arg[iarg],"c_",2) == 0 || 
-	strncmp(arg[iarg],"f_",2) == 0) {
+    if (strncmp(arg[iarg],"c_",2) == 0 ||
+        strncmp(arg[iarg],"f_",2) == 0) {
       if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE;
       else if (arg[iarg][0] == 'f') which[nvalues] = FIX;
 
@@ -64,10 +64,10 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Illegal compute slice command");
-	argindex[nvalues] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Illegal compute slice command");
+        argindex[nvalues] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[nvalues] = 0;
 
       n = strlen(suffix) + 1;
@@ -85,39 +85,39 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for compute slice does not exist");
+        error->all(FLERR,"Compute ID for compute slice does not exist");
       if (modify->compute[icompute]->vector_flag) {
-	if (argindex[i])
-	  error->all(FLERR,"Compute slice compute does not calculate a global array");
-	if (nstop > modify->compute[icompute]->size_vector)
-	  error->all(FLERR,"Compute slice compute vector is accessed out-of-range");
+        if (argindex[i])
+          error->all(FLERR,"Compute slice compute does not calculate a global array");
+        if (nstop > modify->compute[icompute]->size_vector)
+          error->all(FLERR,"Compute slice compute vector is accessed out-of-range");
       } else if (modify->compute[icompute]->array_flag) {
-	if (argindex[i] == 0)
-	  error->all(FLERR,"Compute slice compute does not calculate a global vector");
-	if (argindex[i] > modify->compute[icompute]->size_array_cols)
-	  error->all(FLERR,"Compute slice compute array is accessed out-of-range");
-	if (nstop > modify->compute[icompute]->size_array_rows)
-	  error->all(FLERR,"Compute slice compute array is accessed out-of-range");
+        if (argindex[i] == 0)
+          error->all(FLERR,"Compute slice compute does not calculate a global vector");
+        if (argindex[i] > modify->compute[icompute]->size_array_cols)
+          error->all(FLERR,"Compute slice compute array is accessed out-of-range");
+        if (nstop > modify->compute[icompute]->size_array_rows)
+          error->all(FLERR,"Compute slice compute array is accessed out-of-range");
       } else error->all(FLERR,"Compute slice compute does not calculate "
-			"global vector or array");
+                        "global vector or array");
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for compute slice does not exist");
+        error->all(FLERR,"Fix ID for compute slice does not exist");
       if (modify->fix[ifix]->vector_flag) {
-	if (argindex[i])
-	  error->all(FLERR,"Compute slice fix does not calculate a global array");
-	if (nstop > modify->fix[ifix]->size_vector)
-	  error->all(FLERR,"Compute slice fix vector is accessed out-of-range");
+        if (argindex[i])
+          error->all(FLERR,"Compute slice fix does not calculate a global array");
+        if (nstop > modify->fix[ifix]->size_vector)
+          error->all(FLERR,"Compute slice fix vector is accessed out-of-range");
       } else if (modify->fix[ifix]->array_flag) {
-	if (argindex[i] == 0) 
-	  error->all(FLERR,"Compute slice fix does not calculate a global vector");
-	if (argindex[i] > modify->fix[ifix]->size_array_cols)
-	  error->all(FLERR,"Compute slice fix array is accessed out-of-range");
-	if (nstop > modify->fix[ifix]->size_array_rows)
-	  error->all(FLERR,"Compute slice fix array is accessed out-of-range");
+        if (argindex[i] == 0)
+          error->all(FLERR,"Compute slice fix does not calculate a global vector");
+        if (argindex[i] > modify->fix[ifix]->size_array_cols)
+          error->all(FLERR,"Compute slice fix array is accessed out-of-range");
+        if (nstop > modify->fix[ifix]->size_array_rows)
+          error->all(FLERR,"Compute slice fix array is accessed out-of-range");
       } else error->all(FLERR,"Compute slice fix does not calculate "
-			"global vector or array");
+                        "global vector or array");
     }
   }
 
@@ -137,24 +137,24 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
     if (which[0] == COMPUTE) {
       int icompute = modify->find_compute(ids[0]);
       if (argindex[0] == 0) {
-	extvector = modify->compute[icompute]->extvector;
-	if (modify->compute[icompute]->extvector == -1) {
-	  extlist = new int[size_vector];
-	  int j = 0;
-	  for (int i = nstart; i < nstop; i += nskip)
-	    extlist[j++] = modify->compute[icompute]->extlist[i-1];
-	}
+        extvector = modify->compute[icompute]->extvector;
+        if (modify->compute[icompute]->extvector == -1) {
+          extlist = new int[size_vector];
+          int j = 0;
+          for (int i = nstart; i < nstop; i += nskip)
+            extlist[j++] = modify->compute[icompute]->extlist[i-1];
+        }
       } else extvector = modify->compute[icompute]->extarray;
     } else if (which[0] == FIX) {
       int ifix = modify->find_fix(ids[0]);
       if (argindex[0] == 0) {
-	extvector = modify->fix[ifix]->extvector;
-	if (modify->fix[ifix]->extvector == -1) {
-	  extlist = new int[size_vector];
-	  int j = 0;
-	  for (int i = nstart; i < nstop; i += nskip)
-	    extlist[j++] = modify->fix[ifix]->extlist[i-1];
-	}
+        extvector = modify->fix[ifix]->extvector;
+        if (modify->fix[ifix]->extvector == -1) {
+          extlist = new int[size_vector];
+          int j = 0;
+          for (int i = nstart; i < nstop; i += nskip)
+            extlist[j++] = modify->fix[ifix]->extlist[i-1];
+        }
       } else extvector = modify->fix[ifix]->extarray;
     }
 
@@ -167,27 +167,27 @@ ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
     extarray = 0;
     for (int i = 0; i < nvalues; i++) {
       if (which[i] == COMPUTE) {
-	int icompute = modify->find_compute(ids[i]);
-	if (argindex[i] == 0) {
-	  if (modify->compute[icompute]->extvector == 1) extarray = 1;
-	  if (modify->compute[icompute]->extvector == -1) {
-	    for (int j = 0; j < modify->compute[icompute]->size_vector; j++)
-	      if (modify->compute[icompute]->extlist[j]) extarray = 1;
-	  }
-	} else {
-	  if (modify->compute[icompute]->extarray) extarray = 1;
-	}
+        int icompute = modify->find_compute(ids[i]);
+        if (argindex[i] == 0) {
+          if (modify->compute[icompute]->extvector == 1) extarray = 1;
+          if (modify->compute[icompute]->extvector == -1) {
+            for (int j = 0; j < modify->compute[icompute]->size_vector; j++)
+              if (modify->compute[icompute]->extlist[j]) extarray = 1;
+          }
+        } else {
+          if (modify->compute[icompute]->extarray) extarray = 1;
+        }
       } else if (which[i] == FIX) {
-	int ifix = modify->find_fix(ids[i]);
-	if (argindex[i] == 0) {
-	  if (modify->fix[ifix]->extvector == 1) extarray = 1;
-	  if (modify->fix[ifix]->extvector == -1) {
-	    for (int j = 0; j < modify->fix[ifix]->size_vector; j++)
-	      if (modify->fix[ifix]->extlist[j]) extarray = 1;
-	  }
-	} else {
-	  if (modify->fix[ifix]->extarray) extarray = 1;
-	}
+        int ifix = modify->find_fix(ids[i]);
+        if (argindex[i] == 0) {
+          if (modify->fix[ifix]->extvector == 1) extarray = 1;
+          if (modify->fix[ifix]->extvector == -1) {
+            for (int j = 0; j < modify->fix[ifix]->size_vector; j++)
+              if (modify->fix[ifix]->extlist[j]) extarray = 1;
+          }
+        } else {
+          if (modify->fix[ifix]->extarray) extarray = 1;
+        }
       }
     }
   }
@@ -217,12 +217,12 @@ void ComputeSlice::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for compute slice does not exist");
+        error->all(FLERR,"Compute ID for compute slice does not exist");
       value2index[m] = icompute;
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
-      if (ifix < 0) 
-	error->all(FLERR,"Fix ID for compute slice does not exist");
+      if (ifix < 0)
+        error->all(FLERR,"Fix ID for compute slice does not exist");
       value2index[m] = ifix;
     }
   }
@@ -263,32 +263,32 @@ void ComputeSlice::extract_one(int m, double *vec, int stride)
 
     if (argindex[m] == 0) {
       if (!(compute->invoked_flag & INVOKED_VECTOR)) {
-	compute->compute_vector();
-	compute->invoked_flag |= INVOKED_VECTOR;
+        compute->compute_vector();
+        compute->invoked_flag |= INVOKED_VECTOR;
       }
       double *cvector = compute->vector;
       j = 0;
       for (i = nstart; i < nstop; i += nskip) {
-	vec[j] = cvector[i-1];
-	j += stride;
+        vec[j] = cvector[i-1];
+        j += stride;
       }
-      
+
     } else {
       if (!(compute->invoked_flag & INVOKED_ARRAY)) {
-	compute->compute_array();
-	compute->invoked_flag |= INVOKED_ARRAY;
+        compute->compute_array();
+        compute->invoked_flag |= INVOKED_ARRAY;
       }
       double **carray = compute->array;
       int icol = argindex[m]-1;
       j = 0;
       for (i = nstart; i < nstop; i += nskip) {
-	vec[j] = carray[i-1][icol];
-	j += stride;
+        vec[j] = carray[i-1][icol];
+        j += stride;
       }
     }
 
   // access fix fields, check if fix frequency is a match
-    
+
   } else if (which[m] == FIX) {
     if (update->ntimestep % modify->fix[value2index[m]]->global_freq)
       error->all(FLERR,"Fix used in compute slice not computed at compatible time");
@@ -297,15 +297,15 @@ void ComputeSlice::extract_one(int m, double *vec, int stride)
     if (argindex[m] == 0) {
       j = 0;
       for (i = nstart; i < nstop; i += nskip) {
-	vec[j] = fix->compute_vector(i-1);
-	j += stride;
+        vec[j] = fix->compute_vector(i-1);
+        j += stride;
       }
     } else {
       int icol = argindex[m]-1;
       j = 0;
       for (i = nstart; i < nstop; i += nskip) {
-	vec[j] = fix->compute_array(i-1,icol);
-	j += stride;
+        vec[j] = fix->compute_array(i-1,icol);
+        j += stride;
       }
     }
   }
diff --git a/src/compute_slice.h b/src/compute_slice.h
index e837fa945b..b112d72a3a 100644
--- a/src/compute_slice.h
+++ b/src/compute_slice.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp
index f640698700..d18d264e79 100644
--- a/src/compute_stress_atom.cpp
+++ b/src/compute_stress_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -33,7 +33,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) : 
+ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg < 3) error->all(FLERR,"Illegal compute stress/atom command");
@@ -67,9 +67,9 @@ ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) :
       else if (strcmp(arg[iarg],"kspace") == 0) kspaceflag = 1;
       else if (strcmp(arg[iarg],"fix") == 0) fixflag = 1;
       else if (strcmp(arg[iarg],"virial") == 0) {
-	pairflag = 1;
-	bondflag = angleflag = dihedralflag = improperflag = 1;
-	kspaceflag = fixflag = 1;
+        pairflag = 1;
+        bondflag = angleflag = dihedralflag = improperflag = 1;
+        kspaceflag = fixflag = 1;
       } else error->all(FLERR,"Illegal compute stress/atom command");
       iarg++;
     }
@@ -132,35 +132,35 @@ void ComputeStressAtom::compute_peratom()
     double **vatom = force->pair->vatom;
     for (i = 0; i < npair; i++)
       for (j = 0; j < 6; j++)
-	stress[i][j] += vatom[i][j];
+        stress[i][j] += vatom[i][j];
   }
 
   if (bondflag && force->bond) {
     double **vatom = force->bond->vatom;
     for (i = 0; i < nbond; i++)
       for (j = 0; j < 6; j++)
-	stress[i][j] += vatom[i][j];
+        stress[i][j] += vatom[i][j];
   }
 
   if (angleflag && force->angle) {
     double **vatom = force->angle->vatom;
     for (i = 0; i < nbond; i++)
       for (j = 0; j < 6; j++)
-	stress[i][j] += vatom[i][j];
+        stress[i][j] += vatom[i][j];
   }
 
   if (dihedralflag && force->dihedral) {
     double **vatom = force->dihedral->vatom;
     for (i = 0; i < nbond; i++)
       for (j = 0; j < 6; j++)
-	stress[i][j] += vatom[i][j];
+        stress[i][j] += vatom[i][j];
   }
 
   if (improperflag && force->improper) {
     double **vatom = force->improper->vatom;
     for (i = 0; i < nbond; i++)
       for (j = 0; j < 6; j++)
-	stress[i][j] += vatom[i][j];
+        stress[i][j] += vatom[i][j];
   }
 
   // add in per-atom contributions from relevant fixes
@@ -168,10 +168,10 @@ void ComputeStressAtom::compute_peratom()
   if (fixflag) {
     for (int ifix = 0; ifix < modify->nfix; ifix++)
       if (modify->fix[ifix]->virial_flag) {
-	double **vatom = modify->fix[ifix]->vatom;
-	for (i = 0; i < nlocal; i++)
-	  for (j = 0; j < 6; j++)
-	    stress[i][j] += vatom[i][j];
+        double **vatom = modify->fix[ifix]->vatom;
+        for (i = 0; i < nlocal; i++)
+          for (j = 0; j < 6; j++)
+            stress[i][j] += vatom[i][j];
       }
   }
 
@@ -185,7 +185,7 @@ void ComputeStressAtom::compute_peratom()
     double **vatom = force->kspace->vatom;
     for (i = 0; i < nlocal; i++)
       for (j = 0; j < 6; j++)
-	stress[i][j] += vatom[i][j];
+        stress[i][j] += vatom[i][j];
   }
 
   // zero virial of atoms not in group
@@ -215,27 +215,27 @@ void ComputeStressAtom::compute_peratom()
 
     if (rmass) {
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) {
-	  onemass = mvv2e * rmass[i];
-	  stress[i][0] += onemass*v[i][0]*v[i][0];
-	  stress[i][1] += onemass*v[i][1]*v[i][1];
-	  stress[i][2] += onemass*v[i][2]*v[i][2];
-	  stress[i][3] += onemass*v[i][0]*v[i][1];
-	  stress[i][4] += onemass*v[i][0]*v[i][2];
-	  stress[i][5] += onemass*v[i][1]*v[i][2];
-	}
+        if (mask[i] & groupbit) {
+          onemass = mvv2e * rmass[i];
+          stress[i][0] += onemass*v[i][0]*v[i][0];
+          stress[i][1] += onemass*v[i][1]*v[i][1];
+          stress[i][2] += onemass*v[i][2]*v[i][2];
+          stress[i][3] += onemass*v[i][0]*v[i][1];
+          stress[i][4] += onemass*v[i][0]*v[i][2];
+          stress[i][5] += onemass*v[i][1]*v[i][2];
+        }
 
     } else {
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) {
-	  onemass = mvv2e * mass[type[i]];
-	  stress[i][0] += onemass*v[i][0]*v[i][0];
-	  stress[i][1] += onemass*v[i][1]*v[i][1];
-	  stress[i][2] += onemass*v[i][2]*v[i][2];
-	  stress[i][3] += onemass*v[i][0]*v[i][1];
-	  stress[i][4] += onemass*v[i][0]*v[i][2];
-	  stress[i][5] += onemass*v[i][1]*v[i][2];
-	}
+        if (mask[i] & groupbit) {
+          onemass = mvv2e * mass[type[i]];
+          stress[i][0] += onemass*v[i][0]*v[i][0];
+          stress[i][1] += onemass*v[i][1]*v[i][1];
+          stress[i][2] += onemass*v[i][2]*v[i][2];
+          stress[i][3] += onemass*v[i][0]*v[i][1];
+          stress[i][4] += onemass*v[i][0]*v[i][2];
+          stress[i][5] += onemass*v[i][1]*v[i][2];
+        }
     }
   }
 
diff --git a/src/compute_stress_atom.h b/src/compute_stress_atom.h
index 5665b875b1..4592689b2a 100644
--- a/src/compute_stress_atom.h
+++ b/src/compute_stress_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_temp.cpp b/src/compute_temp.cpp
index ab63a8c9f6..0ce6b285ff 100644
--- a/src/compute_temp.cpp
+++ b/src/compute_temp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -27,7 +27,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTemp::ComputeTemp(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTemp::ComputeTemp(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg != 3) error->all(FLERR,"Illegal compute temp command");
@@ -87,12 +87,12 @@ double ComputeTemp::compute_scalar()
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * rmass[i];
+        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * rmass[i];
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * 
-	  mass[type[i]];
+        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
+          mass[type[i]];
   }
 
   MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
diff --git a/src/compute_temp.h b/src/compute_temp.h
index 7e201f8712..79533e9764 100644
--- a/src/compute_temp.h
+++ b/src/compute_temp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_temp_com.cpp b/src/compute_temp_com.cpp
index d344d3d214..6bf71d6cb1 100644
--- a/src/compute_temp_com.cpp
+++ b/src/compute_temp_com.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -29,7 +29,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTempCOM::ComputeTempCOM(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTempCOM::ComputeTempCOM(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg != 3) error->all(FLERR,"Illegal compute temp command");
@@ -100,11 +100,11 @@ double ComputeTempCOM::compute_scalar()
       vthermal[1] = v[i][1] - vbias[1];
       vthermal[2] = v[i][2] - vbias[2];
       if (rmass)
-	t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] + 
-	      vthermal[2]*vthermal[2]) * rmass[i];
+        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
+              vthermal[2]*vthermal[2]) * rmass[i];
       else
-	t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] + 
-	      vthermal[2]*vthermal[2]) * mass[type[i]];
+        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
+              vthermal[2]*vthermal[2]) * mass[type[i]];
     }
 
   MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
diff --git a/src/compute_temp_com.h b/src/compute_temp_com.h
index 364ed57d9f..8a93cbc9f6 100644
--- a/src/compute_temp_com.h
+++ b/src/compute_temp_com.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_temp_deform.cpp b/src/compute_temp_deform.cpp
index 87fcb02eae..48e3a488f4 100644
--- a/src/compute_temp_deform.cpp
+++ b/src/compute_temp_deform.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -76,10 +76,10 @@ void ComputeTempDeform::init()
 
   for (i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
-      if (((FixDeform *) modify->fix[i])->remapflag == X_REMAP && 
-	  comm->me == 0)
-	error->warning(FLERR,"Using compute temp/deform with inconsistent "
-		       "fix deform remap option");
+      if (((FixDeform *) modify->fix[i])->remapflag == X_REMAP &&
+          comm->me == 0)
+        error->warning(FLERR,"Using compute temp/deform with inconsistent "
+                       "fix deform remap option");
       break;
     }
   if (i == modify->nfix && comm->me == 0)
@@ -125,19 +125,19 @@ double ComputeTempDeform::compute_scalar()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
-	h_rate[4]*lamda[2] + h_ratelo[0];
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
+        h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       vthermal[0] = v[i][0] - vstream[0];
       vthermal[1] = v[i][1] - vstream[1];
       vthermal[2] = v[i][2] - vstream[2];
       if (rmass)
-	t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] + 
-	      vthermal[2]*vthermal[2]) * rmass[i];
+        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
+              vthermal[2]*vthermal[2]) * rmass[i];
       else
-	t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] + 
-	      vthermal[2]*vthermal[2]) * mass[type[i]];
+        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
+              vthermal[2]*vthermal[2]) * mass[type[i]];
     }
 
   MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
@@ -171,8 +171,8 @@ void ComputeTempDeform::compute_vector()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       domain->x2lamda(x[i],lamda);
-      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
-	h_rate[4]*lamda[2] + h_ratelo[0];
+      vstream[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
+        h_rate[4]*lamda[2] + h_ratelo[0];
       vstream[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vstream[2] = h_rate[2]*lamda[2] + h_ratelo[2];
       vthermal[0] = v[i][0] - vstream[0];
@@ -202,9 +202,9 @@ void ComputeTempDeform::remove_bias(int i, double *v)
   double lamda[3];
   double *h_rate = domain->h_rate;
   double *h_ratelo = domain->h_ratelo;
-    
+
   domain->x2lamda(atom->x[i],lamda);
-  vbias[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
+  vbias[0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
     h_rate[4]*lamda[2] + h_ratelo[0];
   vbias[1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
   vbias[2] = h_rate[2]*lamda[2] + h_ratelo[2];
@@ -236,8 +236,8 @@ void ComputeTempDeform::remove_bias_all()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       domain->x2lamda(atom->x[i],lamda);
-      vbiasall[i][0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] + 
-	h_rate[4]*lamda[2] + h_ratelo[0];
+      vbiasall[i][0] = h_rate[0]*lamda[0] + h_rate[5]*lamda[1] +
+        h_rate[4]*lamda[2] + h_ratelo[0];
       vbiasall[i][1] = h_rate[1]*lamda[1] + h_rate[3]*lamda[2] + h_ratelo[1];
       vbiasall[i][2] = h_rate[2]*lamda[2] + h_ratelo[2];
       v[i][0] -= vbiasall[i][0];
diff --git a/src/compute_temp_deform.h b/src/compute_temp_deform.h
index fd18cce16f..c7afaa97de 100644
--- a/src/compute_temp_deform.h
+++ b/src/compute_temp_deform.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_temp_partial.cpp b/src/compute_temp_partial.cpp
index bfb2088e56..31a55671dd 100644
--- a/src/compute_temp_partial.cpp
+++ b/src/compute_temp_partial.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -28,7 +28,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg != 6) error->all(FLERR,"Illegal compute temp/partial command");
@@ -110,13 +110,13 @@ double ComputeTempPartial::compute_scalar()
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	t += (xflag*v[i][0]*v[i][0] + yflag*v[i][1]*v[i][1] + 
-	      zflag*v[i][2]*v[i][2]) * rmass[i];
+        t += (xflag*v[i][0]*v[i][0] + yflag*v[i][1]*v[i][1] +
+              zflag*v[i][2]*v[i][2]) * rmass[i];
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	t += (xflag*v[i][0]*v[i][0] + yflag*v[i][1]*v[i][1] + 
-	      zflag*v[i][2]*v[i][2]) * mass[type[i]];
+        t += (xflag*v[i][0]*v[i][0] + yflag*v[i][1]*v[i][1] +
+              zflag*v[i][2]*v[i][2]) * mass[type[i]];
   }
 
   MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
@@ -198,22 +198,22 @@ void ComputeTempPartial::remove_bias_all()
   if (!xflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	vbiasall[i][0] = v[i][0];
-	v[i][0] = 0.0;
+        vbiasall[i][0] = v[i][0];
+        v[i][0] = 0.0;
       }
   }
   if (!yflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	vbiasall[i][1] = v[i][1];
-	v[i][1] = 0.0;
+        vbiasall[i][1] = v[i][1];
+        v[i][1] = 0.0;
       }
   }
   if (!zflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	vbiasall[i][2] = v[i][2];
-	v[i][2] = 0.0;
+        vbiasall[i][2] = v[i][2];
+        v[i][2] = 0.0;
       }
   }
 }
@@ -244,17 +244,17 @@ void ComputeTempPartial::restore_bias_all()
   if (!xflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	v[i][0] += vbiasall[i][0];
+        v[i][0] += vbiasall[i][0];
   }
   if (!yflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	v[i][1] += vbiasall[i][1];
+        v[i][1] += vbiasall[i][1];
   }
   if (!zflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	v[i][2] += vbiasall[i][2];
+        v[i][2] += vbiasall[i][2];
   }
 }
 
diff --git a/src/compute_temp_partial.h b/src/compute_temp_partial.h
index 6302d28e21..97ac60541e 100644
--- a/src/compute_temp_partial.h
+++ b/src/compute_temp_partial.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp
index a242aba339..dfd609c6c5 100644
--- a/src/compute_temp_profile.cpp
+++ b/src/compute_temp_profile.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -29,7 +29,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg < 7) error->all(FLERR,"Illegal compute temp/profile command");
@@ -96,7 +96,7 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
 
   memory->create(vbin,nbins,ncount+1,"temp/profile:vbin");
   memory->create(binave,nbins,ncount+1,"temp/profile:binave");
-  
+
   maxatom = 0;
   bin = NULL;
 
@@ -186,11 +186,11 @@ double ComputeTempProfile::compute_scalar()
       else vthermal[2] = v[i][2];
 
       if (rmass)
-	t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] + 
-	      vthermal[2]*vthermal[2]) * rmass[i];
+        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
+              vthermal[2]*vthermal[2]) * rmass[i];
       else
-	t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] + 
-	      vthermal[2]*vthermal[2]) * mass[type[i]];
+        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
+              vthermal[2]*vthermal[2]) * mass[type[i]];
     }
 
   MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
@@ -286,16 +286,16 @@ void ComputeTempProfile::remove_bias_all()
     if (mask[i] & groupbit) {
       ibin = bin[i];
       if (xflag) {
-	vbiasall[i][0] = binave[ibin][ivx];
-	v[i][0] -= vbiasall[i][0];
+        vbiasall[i][0] = binave[ibin][ivx];
+        v[i][0] -= vbiasall[i][0];
       }
       if (yflag) {
-	vbiasall[i][1] = binave[ibin][ivy];
-	v[i][1] -= vbiasall[i][1];
+        vbiasall[i][1] = binave[ibin][ivy];
+        v[i][1] -= vbiasall[i][1];
       }
       if (zflag) {
-	vbiasall[i][2] = binave[ibin][ivz];
-	v[i][2] -= vbiasall[i][2];
+        vbiasall[i][2] = binave[ibin][ivz];
+        v[i][2] -= vbiasall[i][2];
       }
     }
 }
@@ -326,17 +326,17 @@ void ComputeTempProfile::restore_bias_all()
   if (xflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	v[i][0] += vbiasall[i][0];
+        v[i][0] += vbiasall[i][0];
   }
   if (yflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	v[i][1] += vbiasall[i][1];
+        v[i][1] += vbiasall[i][1];
   }
   if (zflag) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	v[i][2] += vbiasall[i][2];
+        v[i][2] += vbiasall[i][2];
   }
 }
 
@@ -381,7 +381,7 @@ void ComputeTempProfile::bin_average()
   for (i = 0; i < nbins; i++)
     if (binave[i][ncount] > 0.0)
       for (j = 0; j < ncount; j++)
-	binave[i][j] /= binave[i][ncount];
+        binave[i][j] /= binave[i][ncount];
 }
 
 /* ----------------------------------------------------------------------
@@ -424,38 +424,38 @@ void ComputeTempProfile::bin_assign()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       if (nbinx > 1) {
-	coord = x[i][0];
-	if (periodicity[0]) {
-	  if (coord < boxlo[0]) coord += prd[0];
-	  if (coord >= boxhi[0]) coord -= prd[0];
-	}
-	ibinx = static_cast<int> ((coord - boxlo[0]) * invdelta[0]);
-	ibinx = MAX(ibinx,0);
-	ibinx = MIN(ibinx,nbinx-1);
+        coord = x[i][0];
+        if (periodicity[0]) {
+          if (coord < boxlo[0]) coord += prd[0];
+          if (coord >= boxhi[0]) coord -= prd[0];
+        }
+        ibinx = static_cast<int> ((coord - boxlo[0]) * invdelta[0]);
+        ibinx = MAX(ibinx,0);
+        ibinx = MIN(ibinx,nbinx-1);
       } else ibinx = 0;
-      
+
       if (nbiny > 1) {
-	coord = x[i][1];
-	if (periodicity[1]) {
-	  if (coord < boxlo[1]) coord += prd[1];
-	  if (coord >= boxhi[1]) coord -= prd[1];
-	}
-	ibiny = static_cast<int> ((coord - boxlo[1]) * invdelta[1]);
-	ibiny = MAX(ibiny,0);
-	ibiny = MIN(ibiny,nbiny-1);
+        coord = x[i][1];
+        if (periodicity[1]) {
+          if (coord < boxlo[1]) coord += prd[1];
+          if (coord >= boxhi[1]) coord -= prd[1];
+        }
+        ibiny = static_cast<int> ((coord - boxlo[1]) * invdelta[1]);
+        ibiny = MAX(ibiny,0);
+        ibiny = MIN(ibiny,nbiny-1);
       } else ibiny = 0;
-      
+
       if (nbinz > 1) {
-	coord = x[i][2];
-	if (periodicity[2]) {
-	  if (coord < boxlo[2]) coord += prd[2];
-	  if (coord >= boxhi[2]) coord -= prd[2];
-	}
-	ibinz = static_cast<int> ((coord - boxlo[2]) * invdelta[2]);
-	ibinz = MAX(ibinz,0);
-	ibinz = MIN(ibinz,nbinz-1);
+        coord = x[i][2];
+        if (periodicity[2]) {
+          if (coord < boxlo[2]) coord += prd[2];
+          if (coord >= boxhi[2]) coord -= prd[2];
+        }
+        ibinz = static_cast<int> ((coord - boxlo[2]) * invdelta[2]);
+        ibinz = MAX(ibinz,0);
+        ibinz = MIN(ibinz,nbinz-1);
       } else ibinz = 0;
-      
+
       bin[i] = nbinx*nbiny*ibinz + nbinx*ibiny + ibinx;
     }
 
diff --git a/src/compute_temp_profile.h b/src/compute_temp_profile.h
index 3dc8583a6b..6fa423d5db 100644
--- a/src/compute_temp_profile.h
+++ b/src/compute_temp_profile.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -53,7 +53,7 @@ class ComputeTempProfile : public Compute {
   int maxatom;
   int *bin;
   double **vbin,**binave;
-  
+
   void dof_compute();
   void bin_average();
   void bin_setup();
diff --git a/src/compute_temp_ramp.cpp b/src/compute_temp_ramp.cpp
index 135a3eea6d..a28bcc8995 100644
--- a/src/compute_temp_ramp.cpp
+++ b/src/compute_temp_ramp.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -30,7 +30,7 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg < 9) error->all(FLERR,"Illegal compute temp command");
@@ -166,11 +166,11 @@ double ComputeTempRamp::compute_scalar()
       vthermal[2] = v[i][2];
       vthermal[v_dim] -= vramp;
       if (rmass)
-	t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] + 
-	      vthermal[2]*vthermal[2]) * rmass[i];
+        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
+              vthermal[2]*vthermal[2]) * rmass[i];
       else
-	t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] + 
-	      vthermal[2]*vthermal[2]) * mass[type[i]];
+        t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
+              vthermal[2]*vthermal[2]) * mass[type[i]];
     }
 
   MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
diff --git a/src/compute_temp_ramp.h b/src/compute_temp_ramp.h
index c393346784..b470011dd7 100644
--- a/src/compute_temp_ramp.h
+++ b/src/compute_temp_ramp.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_temp_region.cpp b/src/compute_temp_region.cpp
index 964f162d9f..ba74fc0077 100644
--- a/src/compute_temp_region.cpp
+++ b/src/compute_temp_region.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -27,13 +27,13 @@ using namespace LAMMPS_NS;
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg != 4) error->all(FLERR,"Illegal compute temp/region command");
 
   iregion = domain->find_region(arg[3]);
-  if (iregion == -1) 
+  if (iregion == -1)
     error->all(FLERR,"Region ID for compute temp/region does not exist");
   int n = strlen(arg[3]) + 1;
   idregion = new char[n];
@@ -103,15 +103,15 @@ double ComputeTempRegion::compute_scalar()
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	count++;
-	t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * rmass[i];
+        count++;
+        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * rmass[i];
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	count++;
-	t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * 
-	  mass[type[i]];
+        count++;
+        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
+          mass[type[i]];
       }
   }
 
@@ -194,18 +194,18 @@ void ComputeTempRegion::remove_bias_all()
     maxbias = atom->nmax;
     memory->create(vbiasall,maxbias,3,"temp/region:vbiasall");
   }
-  
+
   Region *region = domain->regions[iregion];
 
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       if (region->match(x[i][0],x[i][1],x[i][2]))
-	vbiasall[i][0] = vbiasall[i][1] = vbiasall[i][2] = 0.0;
+        vbiasall[i][0] = vbiasall[i][1] = vbiasall[i][2] = 0.0;
       else {
-	vbiasall[i][0] = v[i][0];
-	vbiasall[i][1] = v[i][1];
-	vbiasall[i][2] = v[i][2];
-	v[i][0] = v[i][1] = v[i][2] = 0.0;
+        vbiasall[i][0] = v[i][0];
+        vbiasall[i][1] = v[i][1];
+        vbiasall[i][2] = v[i][2];
+        v[i][0] = v[i][1] = v[i][2] = 0.0;
       }
     }
 }
diff --git a/src/compute_temp_region.h b/src/compute_temp_region.h
index e0df3a8f62..ce1df7a041 100644
--- a/src/compute_temp_region.h
+++ b/src/compute_temp_region.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_temp_sphere.cpp b/src/compute_temp_sphere.cpp
index c4db2f5987..2c4b4c420d 100644
--- a/src/compute_temp_sphere.cpp
+++ b/src/compute_temp_sphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -32,7 +32,7 @@ enum{ROTATE,ALL};
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) : 
+ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) :
   Compute(lmp, narg, arg)
 {
   if (narg < 3) error->all(FLERR,"Illegal compute temp/sphere command");
@@ -46,20 +46,20 @@ ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) :
   tempbias = 0;
   id_bias = NULL;
   mode = ALL;
-  
+
   int iarg = 3;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"bias") == 0) {
-      if (iarg+2 > narg) 
-	error->all(FLERR,"Illegal compute temp/sphere command");
+      if (iarg+2 > narg)
+        error->all(FLERR,"Illegal compute temp/sphere command");
       tempbias = 1;
       int n = strlen(arg[iarg+1]) + 1;
       id_bias = new char[n];
       strcpy(id_bias,arg[iarg+1]);
       iarg += 2;
     } else if (strcmp(arg[iarg],"dof") == 0) {
-      if (iarg+2 > narg) 
-	error->all(FLERR,"Illegal compute temp/sphere command");
+      if (iarg+2 > narg)
+        error->all(FLERR,"Illegal compute temp/sphere command");
       if (strcmp(arg[iarg+1],"rotate") == 0) mode = ROTATE;
       else if (strcmp(arg[iarg+1],"all") == 0) mode = ALL;
       else error->all(FLERR,"Illegal compute temp/sphere command");
@@ -71,7 +71,7 @@ ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) :
 
   // error checks
 
-  if (!atom->sphere_flag) 
+  if (!atom->sphere_flag)
     error->all(FLERR,"Compute temp/sphere requires atom style sphere");
 }
 
@@ -89,7 +89,7 @@ void ComputeTempSphere::init()
 {
   if (tempbias) {
     int i = modify->find_compute(id_bias);
-    if (i < 0) 
+    if (i < 0)
       error->all(FLERR,"Could not find compute ID for temperature bias");
     tbias = modify->compute[i];
     if (tbias->tempflag == 0)
@@ -129,22 +129,22 @@ void ComputeTempSphere::dof_compute()
   if (domain->dimension == 3) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (radius[i] == 0.0) {
-	  if (mode == ALL) count += 3;
-	} else {
-	  if (mode == ALL) count += 6;
-	  else count += 3;
-	}
+        if (radius[i] == 0.0) {
+          if (mode == ALL) count += 3;
+        } else {
+          if (mode == ALL) count += 6;
+          else count += 3;
+        }
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (radius[i] == 0.0) {
-	  if (mode == ALL) count += 2;
-	} else {
-	  if (mode == ALL) count += 3;
-	  else count += 1;
-	}
+        if (radius[i] == 0.0) {
+          if (mode == ALL) count += 2;
+        } else {
+          if (mode == ALL) count += 3;
+          else count += 1;
+        }
       }
   }
 
@@ -166,28 +166,28 @@ void ComputeTempSphere::dof_compute()
     count = 0;
     if (domain->dimension == 3) {
       for (int i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) {
-	  if (tbias->dof_remove(i)) {
-	    if (radius[i] == 0.0) {
-	      if (mode == ALL) count += 3;
-	    } else {
-	      if (mode == ALL) count += 6;
-	      else count += 3;
-	    }
-	  }
-	}
+        if (mask[i] & groupbit) {
+          if (tbias->dof_remove(i)) {
+            if (radius[i] == 0.0) {
+              if (mode == ALL) count += 3;
+            } else {
+              if (mode == ALL) count += 6;
+              else count += 3;
+            }
+          }
+        }
     } else {
       for (int i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) {
-	  if (tbias->dof_remove(i)) {
-	    if (radius[i] == 0.0) {
-	      if (mode == ALL) count += 2;
-	    } else {
-	      if (mode == ALL) count += 3;
-	      else count += 1;
-	    }
-	  }
-	}
+        if (mask[i] & groupbit) {
+          if (tbias->dof_remove(i)) {
+            if (radius[i] == 0.0) {
+              if (mode == ALL) count += 2;
+            } else {
+              if (mode == ALL) count += 3;
+              else count += 1;
+            }
+          }
+        }
     }
 
     MPI_Allreduce(&count,&count_all,1,MPI_INT,MPI_SUM,world);
@@ -224,15 +224,15 @@ double ComputeTempSphere::compute_scalar()
   if (mode == ALL) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * rmass[i];
-	t += (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] + 
-	      omega[i][2]*omega[i][2]) * INERTIA*rmass[i]*radius[i]*radius[i];
+        t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) * rmass[i];
+        t += (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] +
+              omega[i][2]*omega[i][2]) * INERTIA*rmass[i]*radius[i]*radius[i];
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	t += (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] + 
-	      omega[i][2]*omega[i][2]) * INERTIA*rmass[i]*radius[i]*radius[i];
+        t += (omega[i][0]*omega[i][0] + omega[i][1]*omega[i][1] +
+              omega[i][2]*omega[i][2]) * INERTIA*rmass[i]*radius[i]*radius[i];
   }
 
   if (tempbias) tbias->restore_bias_all();
@@ -269,35 +269,35 @@ void ComputeTempSphere::compute_vector()
   if (mode == ALL) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	massone = rmass[i];
-	t[0] += massone * v[i][0]*v[i][0];
-	t[1] += massone * v[i][1]*v[i][1];
-	t[2] += massone * v[i][2]*v[i][2];
-	t[3] += massone * v[i][0]*v[i][1];
-	t[4] += massone * v[i][0]*v[i][2];
-	t[5] += massone * v[i][1]*v[i][2];
-	
-	inertiaone = INERTIA*rmass[i]*radius[i]*radius[i];
-	t[0] += inertiaone * omega[i][0]*omega[i][0];
-	t[1] += inertiaone * omega[i][1]*omega[i][1];
-	t[2] += inertiaone * omega[i][2]*omega[i][2];
-	t[3] += inertiaone * omega[i][0]*omega[i][1];
-	t[4] += inertiaone * omega[i][0]*omega[i][2];
-	t[5] += inertiaone * omega[i][1]*omega[i][2];
+        massone = rmass[i];
+        t[0] += massone * v[i][0]*v[i][0];
+        t[1] += massone * v[i][1]*v[i][1];
+        t[2] += massone * v[i][2]*v[i][2];
+        t[3] += massone * v[i][0]*v[i][1];
+        t[4] += massone * v[i][0]*v[i][2];
+        t[5] += massone * v[i][1]*v[i][2];
+
+        inertiaone = INERTIA*rmass[i]*radius[i]*radius[i];
+        t[0] += inertiaone * omega[i][0]*omega[i][0];
+        t[1] += inertiaone * omega[i][1]*omega[i][1];
+        t[2] += inertiaone * omega[i][2]*omega[i][2];
+        t[3] += inertiaone * omega[i][0]*omega[i][1];
+        t[4] += inertiaone * omega[i][0]*omega[i][2];
+        t[5] += inertiaone * omega[i][1]*omega[i][2];
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	inertiaone = INERTIA*rmass[i]*radius[i]*radius[i];
-	t[0] += inertiaone * omega[i][0]*omega[i][0];
-	t[1] += inertiaone * omega[i][1]*omega[i][1];
-	t[2] += inertiaone * omega[i][2]*omega[i][2];
-	t[3] += inertiaone * omega[i][0]*omega[i][1];
-	t[4] += inertiaone * omega[i][0]*omega[i][2];
-	t[5] += inertiaone * omega[i][1]*omega[i][2];
+        inertiaone = INERTIA*rmass[i]*radius[i]*radius[i];
+        t[0] += inertiaone * omega[i][0]*omega[i][0];
+        t[1] += inertiaone * omega[i][1]*omega[i][1];
+        t[2] += inertiaone * omega[i][2]*omega[i][2];
+        t[3] += inertiaone * omega[i][0]*omega[i][1];
+        t[4] += inertiaone * omega[i][0]*omega[i][2];
+        t[5] += inertiaone * omega[i][1]*omega[i][2];
       }
   }
-    
+
   if (tempbias) tbias->restore_bias_all();
 
   MPI_Allreduce(t,vector,6,MPI_DOUBLE,MPI_SUM,world);
diff --git a/src/compute_temp_sphere.h b/src/compute_temp_sphere.h
index 47241bd29a..3b5916f278 100644
--- a/src/compute_temp_sphere.h
+++ b/src/compute_temp_sphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/compute_ti.cpp b/src/compute_ti.cpp
index 035fb35767..749a169c45 100644
--- a/src/compute_ti.cpp
+++ b/src/compute_ti.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -34,9 +34,9 @@ enum{PAIR,TAIL,KSPACE};
 
 /* ---------------------------------------------------------------------- */
 
-ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) : 
-  Compute(lmp, narg, arg) 
-{ 
+ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) :
+  Compute(lmp, narg, arg)
+{
   if (narg < 4) error->all(FLERR,"Illegal compute ti command");
 
   peflag = 1;
@@ -58,7 +58,7 @@ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) :
   pstyle = new char*[nterms];
 
   for (int m = 0; m < nterms; m++) pstyle[m] = NULL;
-    
+
   // parse keywords
 
   nterms = 0;
@@ -121,7 +121,7 @@ void ComputeTI::init()
     if (ivar1[m] < 0 || ivar2 < 0)
       error->all(FLERR,"Variable name for compute ti does not exist");
     if (!input->variable->equalstyle(ivar1[m]) ||
-	!input->variable->equalstyle(ivar2[m]))
+        !input->variable->equalstyle(ivar2[m]))
       error->all(FLERR,"Variable for compute ti is invalid style");
 
     if (which[m] == PAIR) {
@@ -129,13 +129,13 @@ void ComputeTI::init()
       if (pptr[m] == NULL) error->all(FLERR,"Compute ti pair style does not exist");
 
     } else if (which[m] == TAIL) {
-      if (force->pair == NULL || force->pair->tail_flag == 0) 
-	error->all(FLERR,"Compute ti tail when pair style does not "
-		   "compute tail corrections");
+      if (force->pair == NULL || force->pair->tail_flag == 0)
+        error->all(FLERR,"Compute ti tail when pair style does not "
+                   "compute tail corrections");
 
     } else if (which[m] == KSPACE) {
-      if (force->kspace == NULL) 
-	error->all(FLERR,"Compute ti kspace style does not exist");
+      if (force->kspace == NULL)
+        error->all(FLERR,"Compute ti kspace style does not exist");
     }
   }
 }
diff --git a/src/compute_ti.h b/src/compute_ti.h
index 56d04ea8bd..79179018ae 100644
--- a/src/compute_ti.h
+++ b/src/compute_ti.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -23,9 +23,9 @@ ComputeStyle(ti,ComputeTI)
 #include "compute.h"
 
 namespace LAMMPS_NS {
-  
+
 class ComputeTI : public Compute {
- public: 
+ public:
   ComputeTI(class LAMMPS *, int, char **);
   ~ComputeTI();
   void init();
diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp
index ef1dd7f7a8..9cb7de3344 100644
--- a/src/create_atoms.cpp
+++ b/src/create_atoms.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -41,17 +41,17 @@ CreateAtoms::CreateAtoms(LAMMPS *lmp) : Pointers(lmp) {}
 
 void CreateAtoms::command(int narg, char **arg)
 {
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"Create_atoms command before simulation box is defined");
-  if (modify->nfix_restart_peratom) 
+  if (modify->nfix_restart_peratom)
     error->all(FLERR,"Cannot create_atoms after "
-	       "reading restart file with per-atom info");
+               "reading restart file with per-atom info");
 
   // parse arguments
 
   if (narg < 2) error->all(FLERR,"Illegal create_atoms command");
   itype = atoi(arg[0]);
-  if (itype <= 0 || itype > atom->ntypes) 
+  if (itype <= 0 || itype > atom->ntypes)
     error->all(FLERR,"Invalid atom type in create_atoms command");
 
   int iarg;
@@ -63,7 +63,7 @@ void CreateAtoms::command(int narg, char **arg)
     if (narg < 3) error->all(FLERR,"Illegal create_atoms command");
     nregion = domain->find_region(arg[2]);
     if (nregion == -1) error->all(FLERR,
-				  "Create_atoms region ID does not exist");
+                                  "Create_atoms region ID does not exist");
     iarg = 3;;
   } else if (strcmp(arg[1],"single") == 0) {
     style = SINGLE;
@@ -81,7 +81,7 @@ void CreateAtoms::command(int narg, char **arg)
     else {
       nregion = domain->find_region(arg[4]);
       if (nregion == -1) error->all(FLERR,
-				    "Create_atoms region ID does not exist");
+                                    "Create_atoms region ID does not exist");
     }
     iarg = 5;
   } else error->all(FLERR,"Illegal create_atoms command");
@@ -101,12 +101,12 @@ void CreateAtoms::command(int narg, char **arg)
     if (strcmp(arg[iarg],"basis") == 0) {
       if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command");
       if (domain->lattice == NULL)
-	error->all(FLERR,"Cannot create atoms with undefined lattice");
+        error->all(FLERR,"Cannot create atoms with undefined lattice");
       int ibasis = atoi(arg[iarg+1]);
       itype = atoi(arg[iarg+2]);
-      if (ibasis <= 0 || ibasis > nbasis || 
-	  itype <= 0 || itype > atom->ntypes) 
-	error->all(FLERR,"Illegal create_atoms command");
+      if (ibasis <= 0 || ibasis > nbasis ||
+          itype <= 0 || itype > atom->ntypes)
+        error->all(FLERR,"Illegal create_atoms command");
       basistype[ibasis-1] = itype;
       iarg += 3;
     } else if (strcmp(arg[iarg],"remap") == 0) {
@@ -209,7 +209,7 @@ void CreateAtoms::command(int narg, char **arg)
     Fix *fix = modify->fix[m];
     if (fix->create_attribute)
       for (int i = nlocal_previous; i < nlocal; i++)
-	fix->set_arrays(i);
+        fix->set_arrays(i);
   }
 
   // clean up
@@ -228,10 +228,10 @@ void CreateAtoms::command(int narg, char **arg)
   if (comm->me == 0) {
     if (screen)
       fprintf(screen,"Created " BIGINT_FORMAT " atoms\n",
-	      atom->natoms-natoms_previous);
+              atom->natoms-natoms_previous);
     if (logfile)
       fprintf(logfile,"Created " BIGINT_FORMAT " atoms\n",
-	      atom->natoms-natoms_previous);
+              atom->natoms-natoms_previous);
   }
 
   // reset simulation now that more atoms are defined
@@ -345,15 +345,15 @@ void CreateAtoms::add_random()
       if (domain->dimension == 2) xone[2] = zmid;
 
       valid = 1;
-      if (nregion >= 0 && 
-	  domain->regions[nregion]->match(xone[0],xone[1],xone[2]) == 0)
-	valid = 0;
+      if (nregion >= 0 &&
+          domain->regions[nregion]->match(xone[0],xone[1],xone[2]) == 0)
+        valid = 0;
       if (triclinic) {
-	domain->x2lamda(xone,lamda);
-	coord = lamda;
-	if (coord[0] < boxlo[0] || coord[0] >= boxhi[0] ||
-	    coord[1] < boxlo[1] || coord[1] >= boxhi[1] ||
-	    coord[2] < boxlo[2] || coord[2] >= boxhi[2]) valid = 0;
+        domain->x2lamda(xone,lamda);
+        coord = lamda;
+        if (coord[0] < boxlo[0] || coord[0] >= boxhi[0] ||
+            coord[1] < boxlo[1] || coord[1] >= boxhi[1] ||
+            coord[2] < boxlo[2] || coord[2] >= boxhi[2]) valid = 0;
       } else coord = xone;
 
       if (valid) break;
@@ -362,11 +362,11 @@ void CreateAtoms::add_random()
     // if triclinic, coord is now in lamda units
 
     if (coord[0] >= sublo[0] && coord[0] < subhi[0] &&
-	coord[1] >= sublo[1] && coord[1] < subhi[1] &&
-	coord[2] >= sublo[2] && coord[2] < subhi[2])
+        coord[1] >= sublo[1] && coord[1] < subhi[1] &&
+        coord[2] >= sublo[2] && coord[2] < subhi[2])
       atom->avec->create_atom(itype,xone);
   }
-  
+
   // clean-up
 
   delete random;
@@ -396,21 +396,21 @@ void CreateAtoms::add_lattice()
   xmax = ymax = zmax = -BIG;
 
   domain->lattice->bbox(1,bboxlo[0],bboxlo[1],bboxlo[2],
-			xmin,ymin,zmin,xmax,ymax,zmax);
+                        xmin,ymin,zmin,xmax,ymax,zmax);
   domain->lattice->bbox(1,bboxhi[0],bboxlo[1],bboxlo[2],
-			xmin,ymin,zmin,xmax,ymax,zmax);
+                        xmin,ymin,zmin,xmax,ymax,zmax);
   domain->lattice->bbox(1,bboxlo[0],bboxhi[1],bboxlo[2],
-			xmin,ymin,zmin,xmax,ymax,zmax);
+                        xmin,ymin,zmin,xmax,ymax,zmax);
   domain->lattice->bbox(1,bboxhi[0],bboxhi[1],bboxlo[2],
-			xmin,ymin,zmin,xmax,ymax,zmax);
+                        xmin,ymin,zmin,xmax,ymax,zmax);
   domain->lattice->bbox(1,bboxlo[0],bboxlo[1],bboxhi[2],
-			xmin,ymin,zmin,xmax,ymax,zmax);
+                        xmin,ymin,zmin,xmax,ymax,zmax);
   domain->lattice->bbox(1,bboxhi[0],bboxlo[1],bboxhi[2],
-			xmin,ymin,zmin,xmax,ymax,zmax);
+                        xmin,ymin,zmin,xmax,ymax,zmax);
   domain->lattice->bbox(1,bboxlo[0],bboxhi[1],bboxhi[2],
-			xmin,ymin,zmin,xmax,ymax,zmax);
+                        xmin,ymin,zmin,xmax,ymax,zmax);
   domain->lattice->bbox(1,bboxhi[0],bboxhi[1],bboxhi[2],
-			xmin,ymin,zmin,xmax,ymax,zmax);
+                        xmin,ymin,zmin,xmax,ymax,zmax);
 
   // ilo:ihi,jlo:jhi,klo:khi = loop bounds for lattice overlap of my subbox
   // overlap = any part of a unit cell (face,edge,pt) in common with my subbox
@@ -436,7 +436,7 @@ void CreateAtoms::add_lattice()
   // iterate on 3d periodic lattice of unit cells using loop bounds
   // iterate on nbasis atoms in each unit cell
   // convert lattice coords to box coords
-  // add atom if it meets all criteria 
+  // add atom if it meets all criteria
 
   double **basis = domain->lattice->basis;
   double x[3],lamda[3];
@@ -446,34 +446,34 @@ void CreateAtoms::add_lattice()
   for (k = klo; k <= khi; k++)
     for (j = jlo; j <= jhi; j++)
       for (i = ilo; i <= ihi; i++)
-	for (m = 0; m < nbasis; m++) {
+        for (m = 0; m < nbasis; m++) {
 
-	  x[0] = i + basis[m][0];
-	  x[1] = j + basis[m][1];
-	  x[2] = k + basis[m][2];
+          x[0] = i + basis[m][0];
+          x[1] = j + basis[m][1];
+          x[2] = k + basis[m][2];
 
-	  // convert from lattice coords to box coords
+          // convert from lattice coords to box coords
 
-	  domain->lattice->lattice2box(x[0],x[1],x[2]);
+          domain->lattice->lattice2box(x[0],x[1],x[2]);
 
-	  // if a region was specified, test if atom is in it
+          // if a region was specified, test if atom is in it
 
-	  if (style == REGION)
-	    if (!domain->regions[nregion]->match(x[0],x[1],x[2])) continue;
+          if (style == REGION)
+            if (!domain->regions[nregion]->match(x[0],x[1],x[2])) continue;
 
-	  // test if atom is in my subbox
+          // test if atom is in my subbox
 
-	  if (triclinic) {
-	    domain->x2lamda(x,lamda);
-	    coord = lamda;
-	  } else coord = x;
+          if (triclinic) {
+            domain->x2lamda(x,lamda);
+            coord = lamda;
+          } else coord = x;
 
-	  if (coord[0] < sublo[0] || coord[0] >= subhi[0] || 
-	      coord[1] < sublo[1] || coord[1] >= subhi[1] || 
-	      coord[2] < sublo[2] || coord[2] >= subhi[2]) continue;
+          if (coord[0] < sublo[0] || coord[0] >= subhi[0] ||
+              coord[1] < sublo[1] || coord[1] >= subhi[1] ||
+              coord[2] < sublo[2] || coord[2] >= subhi[2]) continue;
 
-	  // add the atom to my list of atoms
+          // add the atom to my list of atoms
 
-	  atom->avec->create_atom(basistype[m],x);
-	}
+          atom->avec->create_atom(basistype[m],x);
+        }
 }
diff --git a/src/create_atoms.h b/src/create_atoms.h
index 708abfb352..f68c0d4993 100644
--- a/src/create_atoms.h
+++ b/src/create_atoms.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/create_box.cpp b/src/create_box.cpp
index be437d0729..b8d5349419 100644
--- a/src/create_box.cpp
+++ b/src/create_box.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,7 +35,7 @@ void CreateBox::command(int narg, char **arg)
 {
   if (narg != 2) error->all(FLERR,"Illegal create_box command");
 
-  if (domain->box_exist) 
+  if (domain->box_exist)
     error->all(FLERR,"Cannot create_box after simulation box is defined");
   if (domain->dimension == 2 && domain->zperiodic == 0)
     error->all(FLERR,"Cannot run 2d simulation with nonperiodic Z dimension");
diff --git a/src/create_box.h b/src/create_box.h
index 974e1db2d2..39d89536c8 100644
--- a/src/create_box.h
+++ b/src/create_box.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp
index 48a4fa6894..dc70d8557c 100644
--- a/src/delete_atoms.cpp
+++ b/src/delete_atoms.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ DeleteAtoms::DeleteAtoms(LAMMPS *lmp) : Pointers(lmp) {}
 
 void DeleteAtoms::command(int narg, char **arg)
 {
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"Delete_atoms command before simulation box is defined");
   if (narg < 1) error->all(FLERR,"Illegal delete_atoms command");
   if (atom->tag_enable == 0)
@@ -101,12 +101,12 @@ void DeleteAtoms::command(int narg, char **arg)
   bigint ndelete = natoms_previous - atom->natoms;
 
   if (comm->me == 0) {
-    if (screen) fprintf(screen,"Deleted " BIGINT_FORMAT 
-			" atoms, new total = " BIGINT_FORMAT "\n",
-			ndelete,atom->natoms);
-    if (logfile) fprintf(logfile,"Deleted " BIGINT_FORMAT 
-			 " atoms, new total = " BIGINT_FORMAT "\n",
-			 ndelete,atom->natoms);
+    if (screen) fprintf(screen,"Deleted " BIGINT_FORMAT
+                        " atoms, new total = " BIGINT_FORMAT "\n",
+                        ndelete,atom->natoms);
+    if (logfile) fprintf(logfile,"Deleted " BIGINT_FORMAT
+                         " atoms, new total = " BIGINT_FORMAT "\n",
+                         ndelete,atom->natoms);
   }
 }
 
@@ -124,7 +124,7 @@ void DeleteAtoms::delete_group(int narg, char **arg)
   options(narg-2,&arg[2]);
 
   // allocate and initialize deletion list
-  
+
   int nlocal = atom->nlocal;
   memory->create(dlist,nlocal,"delete_atoms:dlist");
   for (int i = 0; i < nlocal; i++) dlist[i] = 0;
@@ -143,13 +143,13 @@ void DeleteAtoms::delete_group(int narg, char **arg)
 void DeleteAtoms::delete_region(int narg, char **arg)
 {
   if (narg < 2) error->all(FLERR,"Illegal delete_atoms command");
-  
+
   int iregion = domain->find_region(arg[1]);
   if (iregion == -1) error->all(FLERR,"Could not find delete_atoms region ID");
   options(narg-2,&arg[2]);
 
   // allocate and initialize deletion list
-  
+
   int nlocal = atom->nlocal;
   memory->create(dlist,nlocal,"delete_atoms:dlist");
   for (int i = 0; i < nlocal; i++) dlist[i] = 0;
@@ -170,7 +170,7 @@ void DeleteAtoms::delete_region(int narg, char **arg)
 void DeleteAtoms::delete_overlap(int narg, char **arg)
 {
   if (narg < 4) error->all(FLERR,"Illegal delete_atoms command");
-    
+
   // read args
 
   double cut = atof(arg[1]);
@@ -199,7 +199,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg)
 
   // init entire system since comm->borders and neighbor->build is done
   // comm::init needs neighbor::init needs pair::init needs kspace::init, etc
-  
+
   lmp->init();
 
   // error check on cutoff
@@ -207,7 +207,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg)
 
   if (force->pair == NULL)
     error->all(FLERR,"Delete_atoms requires a pair style be defined");
-  if (cut > neighbor->cutneighmax) 
+  if (cut > neighbor->cutneighmax)
     error->all(FLERR,"Delete_atoms cutoff > neighbor cutoff");
 
   // setup domain, communication and neighboring
@@ -228,7 +228,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg)
 
   // allocate and initialize deletion list
   // must be after exchange potentially changes nlocal
-  
+
   int nlocal = atom->nlocal;
   memory->create(dlist,nlocal,"delete_atoms:dlist");
   for (int i = 0; i < nlocal; i++) dlist[i] = 0;
@@ -298,9 +298,9 @@ void DeleteAtoms::delete_overlap(int narg, char **arg)
       //   test on tags of I,J insures that only I or J is deleted
 
       if (j < nlocal) {
-	if (dlist[j]) continue;
+        if (dlist[j]) continue;
       } else if ((mask[i] & group2bit) && (mask[j] & group1bit)) {
-	if (tag[i] > tag[j]) continue;
+        if (tag[i] > tag[j]) continue;
       }
 
       dlist[i] = 1;
@@ -310,7 +310,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   create porosity by deleting atoms in a specified region 
+   create porosity by deleting atoms in a specified region
 ------------------------------------------------------------------------- */
 
 void DeleteAtoms::delete_porosity(int narg, char **arg)
@@ -327,7 +327,7 @@ void DeleteAtoms::delete_porosity(int narg, char **arg)
   RanMars *random = new RanMars(lmp,seed + comm->me);
 
   // allocate and initialize deletion list
- 
+
   int nlocal = atom->nlocal;
   memory->create(dlist,nlocal,"delete_atoms:dlist");
   for (int i = 0; i < nlocal; i++) dlist[i] = 0;
diff --git a/src/delete_atoms.h b/src/delete_atoms.h
index 365c7507d9..a1d8104e88 100644
--- a/src/delete_atoms.h
+++ b/src/delete_atoms.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp
index 1910e1203f..6699ab7478 100644
--- a/src/delete_bonds.cpp
+++ b/src/delete_bonds.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,7 +37,7 @@ DeleteBonds::DeleteBonds(LAMMPS *lmp) : Pointers(lmp) {}
 
 void DeleteBonds::command(int narg, char **arg)
 {
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"Delete_bonds command before simulation box is defined");
   if (atom->natoms == 0)
     error->all(FLERR,"Delete_bonds command with no atoms existing");
@@ -59,7 +59,7 @@ void DeleteBonds::command(int narg, char **arg)
   int igroup = group->find(arg[0]);
   if (igroup == -1) error->all(FLERR,"Cannot find delete_bonds group ID");
   int groupbit = group->bitmask[igroup];
-  
+
   // set style and which = type value
 
   int style;
@@ -131,26 +131,26 @@ void DeleteBonds::command(int narg, char **arg)
 
     for (i = 0; i < nlocal; i++) {
       for (m = 0; m < num_bond[i]; m++) {
-	atom1 = atom->map(atom->bond_atom[i][m]);
-	if (atom1 == -1) error->one(FLERR,"Bond atom missing in delete_bonds");
-	consider = 0;
-	if (!any_flag && mask[i] & groupbit && mask[atom1] & groupbit) 
-	  consider = 1;
-	if (any_flag && (mask[i] & groupbit || mask[atom1] & groupbit)) 
-	  consider = 1;
-	if (consider) {
-	  flag = 0;
-	  if (style == MULTI) flag = 1;
-	  if (style == ATOM && 
-	      (type[i] == which || type[atom1] == which)) flag = 1;
-	  if (style == BOND && (bond_type[i][m] == which)) flag = 1;
-	  if (flag) {
-	    if (undo_flag == 0 && bond_type[i][m] > 0)
-	      bond_type[i][m] = -bond_type[i][m]; 
-	    if (undo_flag == 1 && bond_type[i][m] < 0)
-	      bond_type[i][m] = -bond_type[i][m]; 
-	  }
-	}
+        atom1 = atom->map(atom->bond_atom[i][m]);
+        if (atom1 == -1) error->one(FLERR,"Bond atom missing in delete_bonds");
+        consider = 0;
+        if (!any_flag && mask[i] & groupbit && mask[atom1] & groupbit)
+          consider = 1;
+        if (any_flag && (mask[i] & groupbit || mask[atom1] & groupbit))
+          consider = 1;
+        if (consider) {
+          flag = 0;
+          if (style == MULTI) flag = 1;
+          if (style == ATOM &&
+              (type[i] == which || type[atom1] == which)) flag = 1;
+          if (style == BOND && (bond_type[i][m] == which)) flag = 1;
+          if (flag) {
+            if (undo_flag == 0 && bond_type[i][m] > 0)
+              bond_type[i][m] = -bond_type[i][m];
+            if (undo_flag == 1 && bond_type[i][m] < 0)
+              bond_type[i][m] = -bond_type[i][m];
+          }
+        }
       }
     }
   }
@@ -161,30 +161,30 @@ void DeleteBonds::command(int narg, char **arg)
 
     for (i = 0; i < nlocal; i++) {
       for (m = 0; m < num_angle[i]; m++) {
-	atom1 = atom->map(atom->angle_atom1[i][m]);
-	atom2 = atom->map(atom->angle_atom2[i][m]);
-	atom3 = atom->map(atom->angle_atom3[i][m]);
-	if (atom1 == -1 || atom2 == -1 || atom3 == -1)
-	  error->one(FLERR,"Angle atom missing in delete_bonds");
-	consider = 0;
-	if (!any_flag && mask[atom1] & groupbit && mask[atom2] & groupbit &&
-	    mask[atom3] & groupbit) consider = 1;
-	if (any_flag && (mask[atom1] & groupbit || mask[atom2] & groupbit ||
-			  mask[atom3] & groupbit)) consider = 1;
-	if (consider) {
-	  flag = 0;
-	  if (style == MULTI) flag = 1;
-	  if (style == ATOM && 
-	      (type[atom1] == which || type[atom2] == which ||
-	       type[atom3] == which)) flag = 1;
-	  if (style == ANGLE && (angle_type[i][m] == which)) flag = 1;
-	  if (flag) {
-	    if (undo_flag == 0 && angle_type[i][m] > 0)
-	      angle_type[i][m] = -angle_type[i][m]; 
-	    if (undo_flag == 1 && angle_type[i][m] < 0)
-	      angle_type[i][m] = -angle_type[i][m]; 
-	  }
-	}
+        atom1 = atom->map(atom->angle_atom1[i][m]);
+        atom2 = atom->map(atom->angle_atom2[i][m]);
+        atom3 = atom->map(atom->angle_atom3[i][m]);
+        if (atom1 == -1 || atom2 == -1 || atom3 == -1)
+          error->one(FLERR,"Angle atom missing in delete_bonds");
+        consider = 0;
+        if (!any_flag && mask[atom1] & groupbit && mask[atom2] & groupbit &&
+            mask[atom3] & groupbit) consider = 1;
+        if (any_flag && (mask[atom1] & groupbit || mask[atom2] & groupbit ||
+                          mask[atom3] & groupbit)) consider = 1;
+        if (consider) {
+          flag = 0;
+          if (style == MULTI) flag = 1;
+          if (style == ATOM &&
+              (type[atom1] == which || type[atom2] == which ||
+               type[atom3] == which)) flag = 1;
+          if (style == ANGLE && (angle_type[i][m] == which)) flag = 1;
+          if (flag) {
+            if (undo_flag == 0 && angle_type[i][m] > 0)
+              angle_type[i][m] = -angle_type[i][m];
+            if (undo_flag == 1 && angle_type[i][m] < 0)
+              angle_type[i][m] = -angle_type[i][m];
+          }
+        }
       }
     }
   }
@@ -195,32 +195,32 @@ void DeleteBonds::command(int narg, char **arg)
 
     for (i = 0; i < nlocal; i++) {
       for (m = 0; m < num_dihedral[i]; m++) {
-	atom1 = atom->map(atom->dihedral_atom1[i][m]);
-	atom2 = atom->map(atom->dihedral_atom2[i][m]);
-	atom3 = atom->map(atom->dihedral_atom3[i][m]);
-	atom4 = atom->map(atom->dihedral_atom4[i][m]);
-	if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
-	  error->one(FLERR,"Dihedral atom missing in delete_bonds");
-	consider = 0;
-	if (!any_flag && mask[atom1] & groupbit && mask[atom2] & groupbit &&
-	    mask[atom3] & groupbit && mask[atom4] & groupbit) consider = 1;
-	if (any_flag && (mask[atom1] & groupbit || mask[atom2] & groupbit ||
-			 mask[atom3] & groupbit || mask[atom4] & groupbit))
-	  consider = 1;
-	if (consider) {
-	  flag = 0;
-	  if (style == MULTI) flag = 1;
-	  if (style == ATOM && 
-	      (type[atom1] == which || type[atom2] == which ||
-	       type[atom3] == which || type[atom4] == which)) flag = 1;
-	  if (style == DIHEDRAL && (dihedral_type[i][m] == which)) flag = 1;
-	  if (flag) {
-	    if (undo_flag == 0 && dihedral_type[i][m] > 0)
-	      dihedral_type[i][m] = -dihedral_type[i][m]; 
-	    if (undo_flag == 1 && dihedral_type[i][m] < 0)
-	      dihedral_type[i][m] = -dihedral_type[i][m]; 
-	  }
-	}
+        atom1 = atom->map(atom->dihedral_atom1[i][m]);
+        atom2 = atom->map(atom->dihedral_atom2[i][m]);
+        atom3 = atom->map(atom->dihedral_atom3[i][m]);
+        atom4 = atom->map(atom->dihedral_atom4[i][m]);
+        if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
+          error->one(FLERR,"Dihedral atom missing in delete_bonds");
+        consider = 0;
+        if (!any_flag && mask[atom1] & groupbit && mask[atom2] & groupbit &&
+            mask[atom3] & groupbit && mask[atom4] & groupbit) consider = 1;
+        if (any_flag && (mask[atom1] & groupbit || mask[atom2] & groupbit ||
+                         mask[atom3] & groupbit || mask[atom4] & groupbit))
+          consider = 1;
+        if (consider) {
+          flag = 0;
+          if (style == MULTI) flag = 1;
+          if (style == ATOM &&
+              (type[atom1] == which || type[atom2] == which ||
+               type[atom3] == which || type[atom4] == which)) flag = 1;
+          if (style == DIHEDRAL && (dihedral_type[i][m] == which)) flag = 1;
+          if (flag) {
+            if (undo_flag == 0 && dihedral_type[i][m] > 0)
+              dihedral_type[i][m] = -dihedral_type[i][m];
+            if (undo_flag == 1 && dihedral_type[i][m] < 0)
+              dihedral_type[i][m] = -dihedral_type[i][m];
+          }
+        }
       }
     }
   }
@@ -231,32 +231,32 @@ void DeleteBonds::command(int narg, char **arg)
 
     for (i = 0; i < nlocal; i++) {
       for (m = 0; m < num_improper[i]; m++) {
-	atom1 = atom->map(atom->improper_atom1[i][m]);
-	atom2 = atom->map(atom->improper_atom2[i][m]);
-	atom3 = atom->map(atom->improper_atom3[i][m]);
-	atom4 = atom->map(atom->improper_atom4[i][m]);
-	if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
-	  error->one(FLERR,"Improper atom missing in delete_bonds");
-	consider = 0;
-	if (!any_flag && mask[atom1] & groupbit && mask[atom2] & groupbit &&
-	    mask[atom3] & groupbit && mask[atom4] & groupbit) consider = 1;
-	if (any_flag && (mask[atom1] & groupbit || mask[atom2] & groupbit ||
-			 mask[atom3] & groupbit || mask[atom4] & groupbit))
-	  consider = 1;
-	if (consider) {
-	  flag = 0;
-	  if (style == MULTI) flag = 1;
-	  if (style == ATOM && 
-	      (type[atom1] == which || type[atom2] == which ||
-	       type[atom3] == which || type[atom4] == which)) flag = 1;
-	  if (style == IMPROPER && (improper_type[i][m] == which)) flag = 1;
-	  if (flag) {
-	    if (undo_flag == 0 && improper_type[i][m] > 0)
-	      improper_type[i][m] = -improper_type[i][m]; 
-	    if (undo_flag == 1 && improper_type[i][m] < 0)
-	      improper_type[i][m] = -improper_type[i][m]; 
-	  }
-	}
+        atom1 = atom->map(atom->improper_atom1[i][m]);
+        atom2 = atom->map(atom->improper_atom2[i][m]);
+        atom3 = atom->map(atom->improper_atom3[i][m]);
+        atom4 = atom->map(atom->improper_atom4[i][m]);
+        if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
+          error->one(FLERR,"Improper atom missing in delete_bonds");
+        consider = 0;
+        if (!any_flag && mask[atom1] & groupbit && mask[atom2] & groupbit &&
+            mask[atom3] & groupbit && mask[atom4] & groupbit) consider = 1;
+        if (any_flag && (mask[atom1] & groupbit || mask[atom2] & groupbit ||
+                         mask[atom3] & groupbit || mask[atom4] & groupbit))
+          consider = 1;
+        if (consider) {
+          flag = 0;
+          if (style == MULTI) flag = 1;
+          if (style == ATOM &&
+              (type[atom1] == which || type[atom2] == which ||
+               type[atom3] == which || type[atom4] == which)) flag = 1;
+          if (style == IMPROPER && (improper_type[i][m] == which)) flag = 1;
+          if (flag) {
+            if (undo_flag == 0 && improper_type[i][m] > 0)
+              improper_type[i][m] = -improper_type[i][m];
+            if (undo_flag == 1 && improper_type[i][m] < 0)
+              improper_type[i][m] = -improper_type[i][m];
+          }
+        }
       }
     }
   }
@@ -268,88 +268,88 @@ void DeleteBonds::command(int narg, char **arg)
 
     if (atom->avec->bonds_allow) {
       for (i = 0; i < nlocal; i++) {
-	m = 0;
-	while (m < atom->num_bond[i]) {
-	  if (atom->bond_type[i][m] <= 0) {
-	    atom1 = atom->map(atom->bond_atom[i][m]);
-	    if (mask[i] & groupbit && mask[atom1] & groupbit) {
-	      n = atom->num_bond[i];
-	      atom->bond_type[i][m] = atom->bond_type[i][n-1];
-	      atom->bond_atom[i][m] = atom->bond_atom[i][n-1];
-	      atom->num_bond[i]--;
-	    } else m++;
-	  } else m++;
-	}
+        m = 0;
+        while (m < atom->num_bond[i]) {
+          if (atom->bond_type[i][m] <= 0) {
+            atom1 = atom->map(atom->bond_atom[i][m]);
+            if (mask[i] & groupbit && mask[atom1] & groupbit) {
+              n = atom->num_bond[i];
+              atom->bond_type[i][m] = atom->bond_type[i][n-1];
+              atom->bond_atom[i][m] = atom->bond_atom[i][n-1];
+              atom->num_bond[i]--;
+            } else m++;
+          } else m++;
+        }
       }
     }
 
     if (atom->avec->angles_allow) {
       for (i = 0; i < nlocal; i++) {
-	m = 0;
-	while (m < atom->num_angle[i]) {
-	  if (atom->angle_type[i][m] <= 0) {
-	    atom1 = atom->map(atom->angle_atom1[i][m]);
-	    atom2 = atom->map(atom->angle_atom2[i][m]);
-	    atom3 = atom->map(atom->angle_atom3[i][m]);
-	    if (mask[atom1] & groupbit && mask[atom2] & groupbit &&
-		mask[atom3] & groupbit) {
-	      n = atom->num_angle[i];
-	      atom->angle_type[i][m] = atom->angle_type[i][n-1];
-	      atom->angle_atom1[i][m] = atom->angle_atom1[i][n-1];
-	      atom->angle_atom2[i][m] = atom->angle_atom2[i][n-1];
-	      atom->angle_atom3[i][m] = atom->angle_atom3[i][n-1];
-	      atom->num_angle[i]--;
-	    } else m++;
-	  } else m++;
-	}
+        m = 0;
+        while (m < atom->num_angle[i]) {
+          if (atom->angle_type[i][m] <= 0) {
+            atom1 = atom->map(atom->angle_atom1[i][m]);
+            atom2 = atom->map(atom->angle_atom2[i][m]);
+            atom3 = atom->map(atom->angle_atom3[i][m]);
+            if (mask[atom1] & groupbit && mask[atom2] & groupbit &&
+                mask[atom3] & groupbit) {
+              n = atom->num_angle[i];
+              atom->angle_type[i][m] = atom->angle_type[i][n-1];
+              atom->angle_atom1[i][m] = atom->angle_atom1[i][n-1];
+              atom->angle_atom2[i][m] = atom->angle_atom2[i][n-1];
+              atom->angle_atom3[i][m] = atom->angle_atom3[i][n-1];
+              atom->num_angle[i]--;
+            } else m++;
+          } else m++;
+        }
       }
     }
 
     if (atom->avec->dihedrals_allow) {
       for (i = 0; i < nlocal; i++) {
-	m = 0;
-	while (m < atom->num_dihedral[i]) {
-	  if (atom->dihedral_type[i][m] <= 0) {
-	    atom1 = atom->map(atom->dihedral_atom1[i][m]);
-	    atom2 = atom->map(atom->dihedral_atom2[i][m]);
-	    atom3 = atom->map(atom->dihedral_atom3[i][m]);
-	    atom4 = atom->map(atom->dihedral_atom4[i][m]);
-	    if (mask[atom1] & groupbit && mask[atom2] & groupbit &&
-		mask[atom3] & groupbit && mask[atom4] & groupbit) {
-	      n = atom->num_dihedral[i];
-	      atom->dihedral_type[i][m] = atom->dihedral_type[i][n-1];
-	      atom->dihedral_atom1[i][m] = atom->dihedral_atom1[i][n-1];
-	      atom->dihedral_atom2[i][m] = atom->dihedral_atom2[i][n-1];
-	      atom->dihedral_atom3[i][m] = atom->dihedral_atom3[i][n-1];
-	      atom->dihedral_atom4[i][m] = atom->dihedral_atom4[i][n-1];
-	      atom->num_dihedral[i]--;
-	    } else m++;
-	  } else m++;
-	}
+        m = 0;
+        while (m < atom->num_dihedral[i]) {
+          if (atom->dihedral_type[i][m] <= 0) {
+            atom1 = atom->map(atom->dihedral_atom1[i][m]);
+            atom2 = atom->map(atom->dihedral_atom2[i][m]);
+            atom3 = atom->map(atom->dihedral_atom3[i][m]);
+            atom4 = atom->map(atom->dihedral_atom4[i][m]);
+            if (mask[atom1] & groupbit && mask[atom2] & groupbit &&
+                mask[atom3] & groupbit && mask[atom4] & groupbit) {
+              n = atom->num_dihedral[i];
+              atom->dihedral_type[i][m] = atom->dihedral_type[i][n-1];
+              atom->dihedral_atom1[i][m] = atom->dihedral_atom1[i][n-1];
+              atom->dihedral_atom2[i][m] = atom->dihedral_atom2[i][n-1];
+              atom->dihedral_atom3[i][m] = atom->dihedral_atom3[i][n-1];
+              atom->dihedral_atom4[i][m] = atom->dihedral_atom4[i][n-1];
+              atom->num_dihedral[i]--;
+            } else m++;
+          } else m++;
+        }
       }
     }
 
     if (atom->avec->impropers_allow) {
       for (i = 0; i < nlocal; i++) {
-	m = 0;
-	while (m < atom->num_improper[i]) {
-	  if (atom->improper_type[i][m] <= 0) {
-	    atom1 = atom->map(atom->improper_atom1[i][m]);
-	    atom2 = atom->map(atom->improper_atom2[i][m]);
-	    atom3 = atom->map(atom->improper_atom3[i][m]);
-	    atom4 = atom->map(atom->improper_atom4[i][m]);
-	    if (mask[atom1] & groupbit && mask[atom2] & groupbit &&
-		mask[atom3] & groupbit && mask[atom4] & groupbit) {
-	      n = atom->num_improper[i];
-	      atom->improper_type[i][m] = atom->improper_type[i][n-1];
-	      atom->improper_atom1[i][m] = atom->improper_atom1[i][n-1];
-	      atom->improper_atom2[i][m] = atom->improper_atom2[i][n-1];
-	      atom->improper_atom3[i][m] = atom->improper_atom3[i][n-1];
-	      atom->improper_atom4[i][m] = atom->improper_atom4[i][n-1];
-	      atom->num_improper[i]--;
-	    } else m++;
-	  } else m++;
-	}
+        m = 0;
+        while (m < atom->num_improper[i]) {
+          if (atom->improper_type[i][m] <= 0) {
+            atom1 = atom->map(atom->improper_atom1[i][m]);
+            atom2 = atom->map(atom->improper_atom2[i][m]);
+            atom3 = atom->map(atom->improper_atom3[i][m]);
+            atom4 = atom->map(atom->improper_atom4[i][m]);
+            if (mask[atom1] & groupbit && mask[atom2] & groupbit &&
+                mask[atom3] & groupbit && mask[atom4] & groupbit) {
+              n = atom->num_improper[i];
+              atom->improper_type[i][m] = atom->improper_type[i][n-1];
+              atom->improper_atom1[i][m] = atom->improper_atom1[i][n-1];
+              atom->improper_atom2[i][m] = atom->improper_atom2[i][n-1];
+              atom->improper_atom3[i][m] = atom->improper_atom3[i][n-1];
+              atom->improper_atom4[i][m] = atom->improper_atom4[i][n-1];
+              atom->num_improper[i]--;
+            } else m++;
+          } else m++;
+        }
       }
     }
 
@@ -363,7 +363,7 @@ void DeleteBonds::command(int narg, char **arg)
       bigint nbonds = 0;
       for (i = 0; i < nlocal; i++) nbonds += atom->num_bond[i];
       MPI_Allreduce(&nbonds,&atom->nbonds,1,MPI_LMP_BIGINT,
-		    MPI_SUM,world);
+                    MPI_SUM,world);
       if (force->newton_bond == 0) atom->nbonds /= 2;
     }
 
@@ -371,7 +371,7 @@ void DeleteBonds::command(int narg, char **arg)
       bigint nangles = 0;
       for (i = 0; i < nlocal; i++) nangles += atom->num_angle[i];
       MPI_Allreduce(&nangles,&atom->nangles,1,MPI_LMP_BIGINT,
-		    MPI_SUM,world);
+                    MPI_SUM,world);
       if (force->newton_bond == 0) atom->nangles /= 3;
     }
 
@@ -379,7 +379,7 @@ void DeleteBonds::command(int narg, char **arg)
       bigint ndihedrals = 0;
       for (i = 0; i < nlocal; i++) ndihedrals += atom->num_dihedral[i];
       MPI_Allreduce(&ndihedrals,&atom->ndihedrals,
-		    1,MPI_LMP_BIGINT,MPI_SUM,world);
+                    1,MPI_LMP_BIGINT,MPI_SUM,world);
       if (force->newton_bond == 0) atom->ndihedrals /= 4;
     }
 
@@ -387,7 +387,7 @@ void DeleteBonds::command(int narg, char **arg)
       bigint nimpropers = 0;
       for (i = 0; i < nlocal; i++) nimpropers += atom->num_improper[i];
       MPI_Allreduce(&nimpropers,&atom->nimpropers,
-		    1,MPI_LMP_BIGINT,MPI_SUM,world);
+                    1,MPI_LMP_BIGINT,MPI_SUM,world);
       if (force->newton_bond == 0) atom->nimpropers /= 4;
     }
 
@@ -405,8 +405,8 @@ void DeleteBonds::command(int narg, char **arg)
     bond_on = bond_off = 0;
     for (i = 0; i < nlocal; i++)
       for (m = 0; m < atom->num_bond[i]; m++)
-	if (atom->bond_type[i][m] > 0) bond_on++;
-	else bond_off++;
+        if (atom->bond_type[i][m] > 0) bond_on++;
+        else bond_off++;
     MPI_Allreduce(&bond_on,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world);
     bond_on = tmp;
     MPI_Allreduce(&bond_off,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world);
@@ -421,8 +421,8 @@ void DeleteBonds::command(int narg, char **arg)
     angle_on = angle_off = 0;
     for (i = 0; i < nlocal; i++)
       for (m = 0; m < atom->num_angle[i]; m++)
-	if (atom->angle_type[i][m] > 0) angle_on++;
-	else angle_off++;
+        if (atom->angle_type[i][m] > 0) angle_on++;
+        else angle_off++;
     MPI_Allreduce(&angle_on,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world);
     angle_on = tmp;
     MPI_Allreduce(&angle_off,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world);
@@ -437,8 +437,8 @@ void DeleteBonds::command(int narg, char **arg)
     dihedral_on = dihedral_off = 0;
     for (i = 0; i < nlocal; i++)
       for (m = 0; m < atom->num_dihedral[i]; m++)
-	if (atom->dihedral_type[i][m] > 0) dihedral_on++;
-	else dihedral_off++;
+        if (atom->dihedral_type[i][m] > 0) dihedral_on++;
+        else dihedral_off++;
     MPI_Allreduce(&dihedral_on,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world);
     dihedral_on = tmp;
     MPI_Allreduce(&dihedral_off,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world);
@@ -453,8 +453,8 @@ void DeleteBonds::command(int narg, char **arg)
     improper_on = improper_off = 0;
     for (i = 0; i < nlocal; i++)
       for (m = 0; m < atom->num_improper[i]; m++)
-	if (atom->improper_type[i][m] > 0) improper_on++;
-	else improper_off++;
+        if (atom->improper_type[i][m] > 0) improper_on++;
+        else improper_off++;
     MPI_Allreduce(&improper_on,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world);
     improper_on = tmp;
     MPI_Allreduce(&improper_off,&tmp,1,MPI_LMP_BIGINT,MPI_SUM,world);
@@ -468,47 +468,47 @@ void DeleteBonds::command(int narg, char **arg)
   if (comm->me == 0) {
     if (atom->avec->bonds_allow) {
       if (screen) fprintf(screen,
-			  "  " BIGINT_FORMAT " total bonds, " BIGINT_FORMAT 
-			  " turned on, " BIGINT_FORMAT " turned off\n",
-			  atom->nbonds,bond_on,bond_off);
+                          "  " BIGINT_FORMAT " total bonds, " BIGINT_FORMAT
+                          " turned on, " BIGINT_FORMAT " turned off\n",
+                          atom->nbonds,bond_on,bond_off);
       if (logfile) fprintf(logfile,
-			   "  " BIGINT_FORMAT " total bonds, " BIGINT_FORMAT 
-			   " turned on, " BIGINT_FORMAT " turned off\n",
-			   atom->nbonds,bond_on,bond_off);
+                           "  " BIGINT_FORMAT " total bonds, " BIGINT_FORMAT
+                           " turned on, " BIGINT_FORMAT " turned off\n",
+                           atom->nbonds,bond_on,bond_off);
     }
     if (atom->avec->angles_allow) {
       if (screen) fprintf(screen,
-			  "  " BIGINT_FORMAT " total angles, " BIGINT_FORMAT 
-			  " turned on, " BIGINT_FORMAT " turned off\n",
-			  atom->nangles,angle_on,angle_off);
+                          "  " BIGINT_FORMAT " total angles, " BIGINT_FORMAT
+                          " turned on, " BIGINT_FORMAT " turned off\n",
+                          atom->nangles,angle_on,angle_off);
       if (logfile) fprintf(logfile,
-			  "  " BIGINT_FORMAT " total angles, " BIGINT_FORMAT 
-			   " turned on, " BIGINT_FORMAT " turned off\n",
-			   atom->nangles,angle_on,angle_off);
+                          "  " BIGINT_FORMAT " total angles, " BIGINT_FORMAT
+                           " turned on, " BIGINT_FORMAT " turned off\n",
+                           atom->nangles,angle_on,angle_off);
     }
     if (atom->avec->dihedrals_allow) {
       if (screen) fprintf(screen,
-			  "  " BIGINT_FORMAT " total dihedrals, " 
-			  BIGINT_FORMAT " turned on, " BIGINT_FORMAT 
-			  " turned off\n",
-			  atom->ndihedrals,dihedral_on,dihedral_off);
+                          "  " BIGINT_FORMAT " total dihedrals, "
+                          BIGINT_FORMAT " turned on, " BIGINT_FORMAT
+                          " turned off\n",
+                          atom->ndihedrals,dihedral_on,dihedral_off);
       if (logfile) fprintf(logfile,
-			  "  " BIGINT_FORMAT " total dihedrals, " 
-			  BIGINT_FORMAT " turned on, " BIGINT_FORMAT 
-			  " turned off\n",
-			  atom->ndihedrals,dihedral_on,dihedral_off);
+                          "  " BIGINT_FORMAT " total dihedrals, "
+                          BIGINT_FORMAT " turned on, " BIGINT_FORMAT
+                          " turned off\n",
+                          atom->ndihedrals,dihedral_on,dihedral_off);
     }
     if (atom->avec->impropers_allow) {
       if (screen) fprintf(screen,
-			  "  " BIGINT_FORMAT " total impropers, " 
-			  BIGINT_FORMAT " turned on, " BIGINT_FORMAT 
-			  " turned off\n",
-			  atom->nimpropers,improper_on,improper_off);
+                          "  " BIGINT_FORMAT " total impropers, "
+                          BIGINT_FORMAT " turned on, " BIGINT_FORMAT
+                          " turned off\n",
+                          atom->nimpropers,improper_on,improper_off);
       if (logfile) fprintf(logfile,
-			  "  " BIGINT_FORMAT " total impropers, " 
-			  BIGINT_FORMAT " turned on, " BIGINT_FORMAT 
-			  " turned off\n",
-			  atom->nimpropers,improper_on,improper_off);
+                          "  " BIGINT_FORMAT " total impropers, "
+                          BIGINT_FORMAT " turned on, " BIGINT_FORMAT
+                          " turned off\n",
+                          atom->nimpropers,improper_on,improper_off);
     }
   }
 
diff --git a/src/delete_bonds.h b/src/delete_bonds.h
index 39ce872e7f..50260c59a7 100644
--- a/src/delete_bonds.h
+++ b/src/delete_bonds.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/dihedral.cpp b/src/dihedral.cpp
index 80a029b94c..2e2ae9cc61 100644
--- a/src/dihedral.cpp
+++ b/src/dihedral.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -77,7 +77,7 @@ void Dihedral::ev_setup(int eflag, int vflag)
   vflag_either = vflag;
   vflag_global = vflag % 4;
   vflag_atom = vflag / 4;
-  
+
   // reallocate per-atom arrays if necessary
 
   if (eflag_atom && atom->nmax > maxeatom) {
@@ -118,15 +118,15 @@ void Dihedral::ev_setup(int eflag, int vflag)
    tally energy and virial into global and per-atom accumulators
    virial = r1F1 + r2F2 + r3F3 + r4F4 = (r1-r2) F1 + (r3-r2) F3 + (r4-r2) F4
           = (r1-r2) F1 + (r3-r2) F3 + (r4-r3 + r3-r2) F4
-	  = vb1*f1 + vb2*f3 + (vb3+vb2)*f4
+          = vb1*f1 + vb2*f3 + (vb3+vb2)*f4
 ------------------------------------------------------------------------- */
 
 void Dihedral::ev_tally(int i1, int i2, int i3, int i4,
-			int nlocal, int newton_bond,
-			double edihedral, double *f1, double *f3, double *f4,
-			double vb1x, double vb1y, double vb1z,
-			double vb2x, double vb2y, double vb2z,
-			double vb3x, double vb3y, double vb3z)
+                        int nlocal, int newton_bond,
+                        double edihedral, double *f1, double *f3, double *f4,
+                        double vb1x, double vb1y, double vb1z,
+                        double vb2x, double vb2y, double vb2z,
+                        double vb3x, double vb3y, double vb3z)
 {
   double edihedralquarter,v[6];
 
@@ -134,11 +134,11 @@ void Dihedral::ev_tally(int i1, int i2, int i3, int i4,
     if (eflag_global) {
       if (newton_bond) energy += edihedral;
       else {
-	edihedralquarter = 0.25*edihedral;
-	if (i1 < nlocal) energy += edihedralquarter;
-	if (i2 < nlocal) energy += edihedralquarter;
-	if (i3 < nlocal) energy += edihedralquarter;
-	if (i4 < nlocal) energy += edihedralquarter;
+        edihedralquarter = 0.25*edihedral;
+        if (i1 < nlocal) energy += edihedralquarter;
+        if (i2 < nlocal) energy += edihedralquarter;
+        if (i3 < nlocal) energy += edihedralquarter;
+        if (i4 < nlocal) energy += edihedralquarter;
       }
     }
     if (eflag_atom) {
@@ -160,80 +160,80 @@ void Dihedral::ev_tally(int i1, int i2, int i3, int i4,
 
     if (vflag_global) {
       if (newton_bond) {
-	virial[0] += v[0];
-	virial[1] += v[1];
-	virial[2] += v[2];
-	virial[3] += v[3];
-	virial[4] += v[4];
-	virial[5] += v[5];
+        virial[0] += v[0];
+        virial[1] += v[1];
+        virial[2] += v[2];
+        virial[3] += v[3];
+        virial[4] += v[4];
+        virial[5] += v[5];
       } else {
-	if (i1 < nlocal) {
-	  virial[0] += 0.25*v[0];
-	  virial[1] += 0.25*v[1];
-	  virial[2] += 0.25*v[2];
-	  virial[3] += 0.25*v[3];
-	  virial[4] += 0.25*v[4];
-	  virial[5] += 0.25*v[5];
-	}
-	if (i2 < nlocal) {
-	  virial[0] += 0.25*v[0];
-	  virial[1] += 0.25*v[1];
-	  virial[2] += 0.25*v[2];
-	  virial[3] += 0.25*v[3];
-	  virial[4] += 0.25*v[4];
-	  virial[5] += 0.25*v[5];
-	}
-	if (i3 < nlocal) {
-	  virial[0] += 0.25*v[0];
-	  virial[1] += 0.25*v[1];
-	  virial[2] += 0.25*v[2];
-	  virial[3] += 0.25*v[3];
-	  virial[4] += 0.25*v[4];
-	  virial[5] += 0.25*v[5];
-	}
-	if (i4 < nlocal) {
-	  virial[0] += 0.25*v[0];
-	  virial[1] += 0.25*v[1];
-	  virial[2] += 0.25*v[2];
-	  virial[3] += 0.25*v[3];
-	  virial[4] += 0.25*v[4];
-	  virial[5] += 0.25*v[5];
-	}
+        if (i1 < nlocal) {
+          virial[0] += 0.25*v[0];
+          virial[1] += 0.25*v[1];
+          virial[2] += 0.25*v[2];
+          virial[3] += 0.25*v[3];
+          virial[4] += 0.25*v[4];
+          virial[5] += 0.25*v[5];
+        }
+        if (i2 < nlocal) {
+          virial[0] += 0.25*v[0];
+          virial[1] += 0.25*v[1];
+          virial[2] += 0.25*v[2];
+          virial[3] += 0.25*v[3];
+          virial[4] += 0.25*v[4];
+          virial[5] += 0.25*v[5];
+        }
+        if (i3 < nlocal) {
+          virial[0] += 0.25*v[0];
+          virial[1] += 0.25*v[1];
+          virial[2] += 0.25*v[2];
+          virial[3] += 0.25*v[3];
+          virial[4] += 0.25*v[4];
+          virial[5] += 0.25*v[5];
+        }
+        if (i4 < nlocal) {
+          virial[0] += 0.25*v[0];
+          virial[1] += 0.25*v[1];
+          virial[2] += 0.25*v[2];
+          virial[3] += 0.25*v[3];
+          virial[4] += 0.25*v[4];
+          virial[5] += 0.25*v[5];
+        }
       }
     }
 
     if (vflag_atom) {
       if (newton_bond || i1 < nlocal) {
-	vatom[i1][0] += 0.25*v[0];
-	vatom[i1][1] += 0.25*v[1];
-	vatom[i1][2] += 0.25*v[2];
-	vatom[i1][3] += 0.25*v[3];
-	vatom[i1][4] += 0.25*v[4];
-	vatom[i1][5] += 0.25*v[5];
+        vatom[i1][0] += 0.25*v[0];
+        vatom[i1][1] += 0.25*v[1];
+        vatom[i1][2] += 0.25*v[2];
+        vatom[i1][3] += 0.25*v[3];
+        vatom[i1][4] += 0.25*v[4];
+        vatom[i1][5] += 0.25*v[5];
       }
       if (newton_bond || i2 < nlocal) {
-	vatom[i2][0] += 0.25*v[0];
-	vatom[i2][1] += 0.25*v[1];
-	vatom[i2][2] += 0.25*v[2];
-	vatom[i2][3] += 0.25*v[3];
-	vatom[i2][4] += 0.25*v[4];
-	vatom[i2][5] += 0.25*v[5];
+        vatom[i2][0] += 0.25*v[0];
+        vatom[i2][1] += 0.25*v[1];
+        vatom[i2][2] += 0.25*v[2];
+        vatom[i2][3] += 0.25*v[3];
+        vatom[i2][4] += 0.25*v[4];
+        vatom[i2][5] += 0.25*v[5];
       }
       if (newton_bond || i3 < nlocal) {
-	vatom[i3][0] += 0.25*v[0];
-	vatom[i3][1] += 0.25*v[1];
-	vatom[i3][2] += 0.25*v[2];
-	vatom[i3][3] += 0.25*v[3];
-	vatom[i3][4] += 0.25*v[4];
-	vatom[i3][5] += 0.25*v[5];
+        vatom[i3][0] += 0.25*v[0];
+        vatom[i3][1] += 0.25*v[1];
+        vatom[i3][2] += 0.25*v[2];
+        vatom[i3][3] += 0.25*v[3];
+        vatom[i3][4] += 0.25*v[4];
+        vatom[i3][5] += 0.25*v[5];
       }
       if (newton_bond || i4 < nlocal) {
-	vatom[i4][0] += 0.25*v[0];
-	vatom[i4][1] += 0.25*v[1];
-	vatom[i4][2] += 0.25*v[2];
-	vatom[i4][3] += 0.25*v[3];
-	vatom[i4][4] += 0.25*v[4];
-	vatom[i4][5] += 0.25*v[5];
+        vatom[i4][0] += 0.25*v[0];
+        vatom[i4][1] += 0.25*v[1];
+        vatom[i4][2] += 0.25*v[2];
+        vatom[i4][3] += 0.25*v[3];
+        vatom[i4][4] += 0.25*v[4];
+        vatom[i4][5] += 0.25*v[5];
       }
     }
   }
diff --git a/src/dihedral.h b/src/dihedral.h
index 0abb3afeba..87fae227a8 100644
--- a/src/dihedral.h
+++ b/src/dihedral.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,8 +50,8 @@ class Dihedral : protected Pointers {
 
   void ev_setup(int, int);
   void ev_tally(int, int, int, int, int, int, double,
-		double *, double *, double *, double, double, double,
-		double, double, double, double, double, double);
+                double *, double *, double *, double, double, double,
+                double, double, double, double, double, double);
 };
 
 }
diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp
index a46547078b..8e2a49320e 100644
--- a/src/displace_atoms.cpp
+++ b/src/displace_atoms.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -40,12 +40,12 @@ void DisplaceAtoms::command(int narg, char **arg)
 {
   int i;
 
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"Displace_atoms command before simulation box is defined");
   if (narg < 2) error->all(FLERR,"Illegal displace_atoms command");
-  if (modify->nfix_restart_peratom) 
+  if (modify->nfix_restart_peratom)
     error->all(FLERR,"Cannot displace_atoms after "
-	       "reading restart file with per-atom info");
+               "reading restart file with per-atom info");
 
   if (comm->me == 0 && screen) fprintf(screen,"Displacing atoms ...\n");
 
@@ -98,15 +98,15 @@ void DisplaceAtoms::command(int narg, char **arg)
 
     for (i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	x[i][0] += delx;
-	x[i][1] += dely;
-	x[i][2] += delz;
+        x[i][0] += delx;
+        x[i][1] += dely;
+        x[i][2] += delz;
       }
     }
   }
 
   // move atoms in ramped fashion
-    
+
   if (style == RAMP) {
 
     int d_dim;
@@ -153,18 +153,18 @@ void DisplaceAtoms::command(int narg, char **arg)
 
     for (i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	fraction = (x[i][coord_dim] - coord_lo) / (coord_hi - coord_lo);
-	fraction = MAX(fraction,0.0);
-	fraction = MIN(fraction,1.0);
-	dramp = d_lo + fraction*(d_hi - d_lo);
-	x[i][d_dim] += dramp;
+        fraction = (x[i][coord_dim] - coord_lo) / (coord_hi - coord_lo);
+        fraction = MAX(fraction,0.0);
+        fraction = MIN(fraction,1.0);
+        dramp = d_lo + fraction*(d_hi - d_lo);
+        x[i][d_dim] += dramp;
       }
     }
   }
 
   // move atoms randomly
   // makes atom result independent of what proc owns it via random->reset()
-    
+
   if (style == RANDOM) {
     RanPark *random = new RanPark(lmp,1);
 
@@ -180,10 +180,10 @@ void DisplaceAtoms::command(int narg, char **arg)
 
     for (i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	random->reset(seed,x[i]);
-	x[i][0] += dx * 2.0*(random->uniform()-0.5);
-	x[i][1] += dy * 2.0*(random->uniform()-0.5);
-	x[i][2] += dz * 2.0*(random->uniform()-0.5);
+        random->reset(seed,x[i]);
+        x[i][0] += dx * 2.0*(random->uniform()-0.5);
+        x[i][1] += dy * 2.0*(random->uniform()-0.5);
+        x[i][2] += dz * 2.0*(random->uniform()-0.5);
       }
     }
 
@@ -213,14 +213,14 @@ void DisplaceAtoms::command(int narg, char **arg)
   MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
   if (natoms != atom->natoms && comm->me == 0) {
     char str[128];
-    sprintf(str,"Lost atoms via displace_atoms: original " BIGINT_FORMAT 
-	    " current " BIGINT_FORMAT,atom->natoms,natoms);
+    sprintf(str,"Lost atoms via displace_atoms: original " BIGINT_FORMAT
+            " current " BIGINT_FORMAT,atom->natoms,natoms);
     error->warning(FLERR,str);
   }
 }
 
 /* ----------------------------------------------------------------------
-   parse optional parameters at end of displace_atoms input line 
+   parse optional parameters at end of displace_atoms input line
 ------------------------------------------------------------------------- */
 
 void DisplaceAtoms::options(int narg, char **arg)
diff --git a/src/displace_atoms.h b/src/displace_atoms.h
index cd46010218..cfab30cec8 100644
--- a/src/displace_atoms.h
+++ b/src/displace_atoms.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/domain.cpp b/src/domain.cpp
index 71c220dd07..96f3772c21 100644
--- a/src/domain.cpp
+++ b/src/domain.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,7 +45,7 @@ using namespace MathConst;
 enum{NO_REMAP,X_REMAP,V_REMAP};                   // same as fix_deform.cpp
 
 /* ----------------------------------------------------------------------
-   default is periodic 
+   default is periodic
 ------------------------------------------------------------------------- */
 
 Domain::Domain(LAMMPS *lmp) : Pointers(lmp)
@@ -70,10 +70,10 @@ Domain::Domain(LAMMPS *lmp) : Pointers(lmp)
 
   h[3] = h[4] = h[5] = 0.0;
   h_inv[3] = h_inv[4] = h_inv[5] = 0.0;
-  h_rate[0] = h_rate[1] = h_rate[2] = 
+  h_rate[0] = h_rate[1] = h_rate[2] =
     h_rate[3] = h_rate[4] = h_rate[5] = 0.0;
   h_ratelo[0] = h_ratelo[1] = h_ratelo[2] = 0.0;
-  
+
   prd_lamda[0] = prd_lamda[1] = prd_lamda[2] = 1.0;
   prd_half_lamda[0] = prd_half_lamda[1] = prd_half_lamda[2] = 0.5;
   boxlo_lamda[0] = boxlo_lamda[1] = boxlo_lamda[2] = 0.0;
@@ -112,8 +112,8 @@ void Domain::init()
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       deform_flag = 1;
       if (((FixDeform *) modify->fix[i])->remapflag == V_REMAP) {
-	deform_vremap = 1;
-	deform_groupbit = modify->fix[i]->groupbit;
+        deform_vremap = 1;
+        deform_groupbit = modify->fix[i]->groupbit;
       }
     }
 
@@ -201,7 +201,7 @@ void Domain::set_global_box()
     h_inv[3] = -h[3] / (h[1]*h[2]);
     h_inv[4] = (h[3]*h[5] - h[1]*h[4]) / (h[0]*h[1]*h[2]);
     h_inv[5] = -h[5] / (h[0]*h[1]);
-    
+
     boxlo_bound[0] = MIN(boxlo[0],boxlo[0]+xy);
     boxlo_bound[0] = MIN(boxlo_bound[0],boxlo_bound[0]+xz);
     boxlo_bound[1] = MIN(boxlo[1],boxlo[1]+yz);
@@ -290,7 +290,7 @@ void Domain::reset_box()
 
     double **x = atom->x;
     int nlocal = atom->nlocal;
-    
+
     for (int i = 0; i < nlocal; i++) {
       extent[0][0] = MIN(extent[0][0],x[i][0]);
       extent[0][1] = MAX(extent[0][1],x[i][0]);
@@ -322,67 +322,67 @@ void Domain::reset_box()
 
     if (triclinic == 0) {
       if (xperiodic == 0) {
-	if (boundary[0][0] == 2) boxlo[0] = -all[0][0] - small[0];
-	else if (boundary[0][0] == 3) 
-	  boxlo[0] = MIN(-all[0][0]-small[0],minxlo);
-	if (boundary[0][1] == 2) boxhi[0] = all[0][1] + small[0];
-	else if (boundary[0][1] == 3) boxhi[0] = MAX(all[0][1]+small[0],minxhi);
-	if (boxlo[0] > boxhi[0]) error->all(FLERR,"Illegal simulation box");
+        if (boundary[0][0] == 2) boxlo[0] = -all[0][0] - small[0];
+        else if (boundary[0][0] == 3)
+          boxlo[0] = MIN(-all[0][0]-small[0],minxlo);
+        if (boundary[0][1] == 2) boxhi[0] = all[0][1] + small[0];
+        else if (boundary[0][1] == 3) boxhi[0] = MAX(all[0][1]+small[0],minxhi);
+        if (boxlo[0] > boxhi[0]) error->all(FLERR,"Illegal simulation box");
       }
       if (yperiodic == 0) {
-	if (boundary[1][0] == 2) boxlo[1] = -all[1][0] - small[1];
-	else if (boundary[1][0] == 3)
-	  boxlo[1] = MIN(-all[1][0]-small[1],minylo);
-	if (boundary[1][1] == 2) boxhi[1] = all[1][1] + small[1];
-	else if (boundary[1][1] == 3) boxhi[1] = MAX(all[1][1]+small[1],minyhi);
-	if (boxlo[1] > boxhi[1]) error->all(FLERR,"Illegal simulation box");
+        if (boundary[1][0] == 2) boxlo[1] = -all[1][0] - small[1];
+        else if (boundary[1][0] == 3)
+          boxlo[1] = MIN(-all[1][0]-small[1],minylo);
+        if (boundary[1][1] == 2) boxhi[1] = all[1][1] + small[1];
+        else if (boundary[1][1] == 3) boxhi[1] = MAX(all[1][1]+small[1],minyhi);
+        if (boxlo[1] > boxhi[1]) error->all(FLERR,"Illegal simulation box");
       }
       if (zperiodic == 0) {
-	if (boundary[2][0] == 2) boxlo[2] = -all[2][0] - small[2];
-	else if (boundary[2][0] == 3)
-	  boxlo[2] = MIN(-all[2][0]-small[2],minzlo);
-	if (boundary[2][1] == 2) boxhi[2] = all[2][1] + small[2];
-	else if (boundary[2][1] == 3) boxhi[2] = MAX(all[2][1]+small[2],minzhi);
-	if (boxlo[2] > boxhi[2]) error->all(FLERR,"Illegal simulation box");
+        if (boundary[2][0] == 2) boxlo[2] = -all[2][0] - small[2];
+        else if (boundary[2][0] == 3)
+          boxlo[2] = MIN(-all[2][0]-small[2],minzlo);
+        if (boundary[2][1] == 2) boxhi[2] = all[2][1] + small[2];
+        else if (boundary[2][1] == 3) boxhi[2] = MAX(all[2][1]+small[2],minzhi);
+        if (boxlo[2] > boxhi[2]) error->all(FLERR,"Illegal simulation box");
       }
 
     } else {
       double lo[3],hi[3];
       if (xperiodic == 0) {
-	lo[0] = -all[0][0]; lo[1] = 0.0; lo[2] = 0.0;
-	lamda2x(lo,lo);
-	hi[0] = all[0][1]; hi[1] = 0.0; hi[2] = 0.0;
-	lamda2x(hi,hi);
-	if (boundary[0][0] == 2) boxlo[0] = lo[0] - small[0];
-	else if (boundary[0][0] == 3) boxlo[0] = MIN(lo[0]-small[0],minxlo);
-	if (boundary[0][1] == 2) boxhi[0] = hi[0] + small[0];
-	else if (boundary[0][1] == 3) boxhi[0] = MAX(hi[0]+small[0],minxhi);
-	if (boxlo[0] > boxhi[0]) error->all(FLERR,"Illegal simulation box");
+        lo[0] = -all[0][0]; lo[1] = 0.0; lo[2] = 0.0;
+        lamda2x(lo,lo);
+        hi[0] = all[0][1]; hi[1] = 0.0; hi[2] = 0.0;
+        lamda2x(hi,hi);
+        if (boundary[0][0] == 2) boxlo[0] = lo[0] - small[0];
+        else if (boundary[0][0] == 3) boxlo[0] = MIN(lo[0]-small[0],minxlo);
+        if (boundary[0][1] == 2) boxhi[0] = hi[0] + small[0];
+        else if (boundary[0][1] == 3) boxhi[0] = MAX(hi[0]+small[0],minxhi);
+        if (boxlo[0] > boxhi[0]) error->all(FLERR,"Illegal simulation box");
       }
       if (yperiodic == 0) {
-	lo[0] = 0.0; lo[1] = -all[1][0]; lo[2] = 0.0;
-	lamda2x(lo,lo);
-	hi[0] = 0.0; hi[1] = all[1][1]; hi[2] = 0.0;
-	lamda2x(hi,hi);
-	if (boundary[1][0] == 2) boxlo[1] = lo[1] - small[1];
-	else if (boundary[1][0] == 3) boxlo[1] = MIN(lo[1]-small[1],minylo);
-	if (boundary[1][1] == 2) boxhi[1] = hi[1] + small[1];
-	else if (boundary[1][1] == 3) boxhi[1] = MAX(hi[1]+small[1],minyhi);
-	if (boxlo[1] > boxhi[1]) error->all(FLERR,"Illegal simulation box");
-	//xy *= (boxhi[1]-boxlo[1]) / yprd;
+        lo[0] = 0.0; lo[1] = -all[1][0]; lo[2] = 0.0;
+        lamda2x(lo,lo);
+        hi[0] = 0.0; hi[1] = all[1][1]; hi[2] = 0.0;
+        lamda2x(hi,hi);
+        if (boundary[1][0] == 2) boxlo[1] = lo[1] - small[1];
+        else if (boundary[1][0] == 3) boxlo[1] = MIN(lo[1]-small[1],minylo);
+        if (boundary[1][1] == 2) boxhi[1] = hi[1] + small[1];
+        else if (boundary[1][1] == 3) boxhi[1] = MAX(hi[1]+small[1],minyhi);
+        if (boxlo[1] > boxhi[1]) error->all(FLERR,"Illegal simulation box");
+        //xy *= (boxhi[1]-boxlo[1]) / yprd;
       }
       if (zperiodic == 0) {
-	lo[0] = 0.0; lo[1] = 0.0; lo[2] = -all[2][0];
-	lamda2x(lo,lo);
-	hi[0] = 0.0; hi[1] = 0.0; hi[2] = all[2][1];
-	lamda2x(hi,hi);
-	if (boundary[2][0] == 2) boxlo[2] = lo[2] - small[2];
-	else if (boundary[2][0] == 3) boxlo[2] = MIN(lo[2]-small[2],minzlo);
-	if (boundary[2][1] == 2) boxhi[2] = hi[2] + small[2];
-	else if (boundary[2][1] == 3) boxhi[2] = MAX(hi[2]+small[2],minzhi);
-	if (boxlo[2] > boxhi[2]) error->all(FLERR,"Illegal simulation box");
-	//xz *= (boxhi[2]-boxlo[2]) / xprd;
-	//yz *= (boxhi[2]-boxlo[2]) / yprd;
+        lo[0] = 0.0; lo[1] = 0.0; lo[2] = -all[2][0];
+        lamda2x(lo,lo);
+        hi[0] = 0.0; hi[1] = 0.0; hi[2] = all[2][1];
+        lamda2x(hi,hi);
+        if (boundary[2][0] == 2) boxlo[2] = lo[2] - small[2];
+        else if (boundary[2][0] == 3) boxlo[2] = MIN(lo[2]-small[2],minzlo);
+        if (boundary[2][1] == 2) boxhi[2] = hi[2] + small[2];
+        else if (boundary[2][1] == 3) boxhi[2] = MAX(hi[2]+small[2],minzhi);
+        if (boxlo[2] > boxhi[2]) error->all(FLERR,"Illegal simulation box");
+        //xz *= (boxhi[2]-boxlo[2]) / xprd;
+        //yz *= (boxhi[2]-boxlo[2]) / yprd;
       }
     }
   }
@@ -435,81 +435,81 @@ void Domain::pbc()
   for (i = 0; i < nlocal; i++) {
     if (xperiodic) {
       if (x[i][0] < lo[0]) {
-	x[i][0] += period[0];
-	if (deform_vremap && mask[i] & deform_groupbit) v[i][0] += h_rate[0];
-	idim = image[i] & 1023;
+        x[i][0] += period[0];
+        if (deform_vremap && mask[i] & deform_groupbit) v[i][0] += h_rate[0];
+        idim = image[i] & 1023;
         otherdims = image[i] ^ idim;
-	idim--;
-	idim &= 1023;
-	image[i] = otherdims | idim;
+        idim--;
+        idim &= 1023;
+        image[i] = otherdims | idim;
       }
       if (x[i][0] >= hi[0]) {
-	x[i][0] -= period[0];
-	x[i][0] = MAX(x[i][0],lo[0]);
-	if (deform_vremap && mask[i] & deform_groupbit) v[i][0] -= h_rate[0];
-	idim = image[i] & 1023;
-	otherdims = image[i] ^ idim;
-	idim++;
-	idim &= 1023;
-	image[i] = otherdims | idim;
+        x[i][0] -= period[0];
+        x[i][0] = MAX(x[i][0],lo[0]);
+        if (deform_vremap && mask[i] & deform_groupbit) v[i][0] -= h_rate[0];
+        idim = image[i] & 1023;
+        otherdims = image[i] ^ idim;
+        idim++;
+        idim &= 1023;
+        image[i] = otherdims | idim;
       }
     }
 
     if (yperiodic) {
       if (x[i][1] < lo[1]) {
-	x[i][1] += period[1];
-	if (deform_vremap && mask[i] & deform_groupbit) {
-	  v[i][0] += h_rate[5];
-	  v[i][1] += h_rate[1];
-	}
-	idim = (image[i] >> 10) & 1023;
+        x[i][1] += period[1];
+        if (deform_vremap && mask[i] & deform_groupbit) {
+          v[i][0] += h_rate[5];
+          v[i][1] += h_rate[1];
+        }
+        idim = (image[i] >> 10) & 1023;
         otherdims = image[i] ^ (idim << 10);
-	idim--;
-	idim &= 1023;
-	image[i] = otherdims | (idim << 10);
+        idim--;
+        idim &= 1023;
+        image[i] = otherdims | (idim << 10);
       }
       if (x[i][1] >= hi[1]) {
-	x[i][1] -= period[1];
-	x[i][1] = MAX(x[i][1],lo[1]);
-	if (deform_vremap && mask[i] & deform_groupbit) {
-	  v[i][0] -= h_rate[5];
-	  v[i][1] -= h_rate[1];
-	}
-	idim = (image[i] >> 10) & 1023;
+        x[i][1] -= period[1];
+        x[i][1] = MAX(x[i][1],lo[1]);
+        if (deform_vremap && mask[i] & deform_groupbit) {
+          v[i][0] -= h_rate[5];
+          v[i][1] -= h_rate[1];
+        }
+        idim = (image[i] >> 10) & 1023;
         otherdims = image[i] ^ (idim << 10);
-	idim++;
-	idim &= 1023;
-	image[i] = otherdims | (idim << 10);
+        idim++;
+        idim &= 1023;
+        image[i] = otherdims | (idim << 10);
       }
     }
 
     if (zperiodic) {
       if (x[i][2] < lo[2]) {
-	x[i][2] += period[2];
-	if (deform_vremap && mask[i] & deform_groupbit) {
-	  v[i][0] += h_rate[4];
-	  v[i][1] += h_rate[3];
-	  v[i][2] += h_rate[2];
-	}
-	idim = image[i] >> 20;
+        x[i][2] += period[2];
+        if (deform_vremap && mask[i] & deform_groupbit) {
+          v[i][0] += h_rate[4];
+          v[i][1] += h_rate[3];
+          v[i][2] += h_rate[2];
+        }
+        idim = image[i] >> 20;
         otherdims = image[i] ^ (idim << 20);
-	idim--;
-	idim &= 1023;
-	image[i] = otherdims | (idim << 20);
+        idim--;
+        idim &= 1023;
+        image[i] = otherdims | (idim << 20);
       }
       if (x[i][2] >= hi[2]) {
-	x[i][2] -= period[2];
-	x[i][2] = MAX(x[i][2],lo[2]);
-	if (deform_vremap && mask[i] & deform_groupbit) {
-	  v[i][0] -= h_rate[4];
-	  v[i][1] -= h_rate[3];
-	  v[i][2] -= h_rate[2];
-	}
-	idim = image[i] >> 20;
+        x[i][2] -= period[2];
+        x[i][2] = MAX(x[i][2],lo[2]);
+        if (deform_vremap && mask[i] & deform_groupbit) {
+          v[i][0] -= h_rate[4];
+          v[i][1] -= h_rate[3];
+          v[i][2] -= h_rate[2];
+        }
+        idim = image[i] >> 20;
         otherdims = image[i] ^ (idim << 20);
-	idim++;
-	idim &= 1023;
-	image[i] = otherdims | (idim << 20);
+        idim++;
+        idim &= 1023;
+        image[i] = otherdims | (idim << 20);
       }
     }
   }
@@ -530,7 +530,7 @@ int Domain::minimum_image_check(double dx, double dy, double dz)
 
 /* ----------------------------------------------------------------------
    minimum image convention
-   use 1/2 of box size as test 
+   use 1/2 of box size as test
    for triclinic, also add/subtract tilt factors in other dims as needed
 ------------------------------------------------------------------------- */
 
@@ -539,52 +539,52 @@ void Domain::minimum_image(double &dx, double &dy, double &dz)
   if (triclinic == 0) {
     if (xperiodic) {
       if (fabs(dx) > xprd_half) {
-	if (dx < 0.0) dx += xprd;
-	else dx -= xprd;
+        if (dx < 0.0) dx += xprd;
+        else dx -= xprd;
       }
     }
     if (yperiodic) {
       if (fabs(dy) > yprd_half) {
-	if (dy < 0.0) dy += yprd;
-	else dy -= yprd;
+        if (dy < 0.0) dy += yprd;
+        else dy -= yprd;
       }
     }
     if (zperiodic) {
       if (fabs(dz) > zprd_half) {
-	if (dz < 0.0) dz += zprd;
-	else dz -= zprd;
+        if (dz < 0.0) dz += zprd;
+        else dz -= zprd;
       }
     }
 
   } else {
     if (zperiodic) {
       if (fabs(dz) > zprd_half) {
-	if (dz < 0.0) {
-	  dz += zprd;
-	  dy += yz;
-	  dx += xz;
-	} else {
-	  dz -= zprd;
-	  dy -= yz;
-	  dx -= xz;
-	}
+        if (dz < 0.0) {
+          dz += zprd;
+          dy += yz;
+          dx += xz;
+        } else {
+          dz -= zprd;
+          dy -= yz;
+          dx -= xz;
+        }
       }
     }
     if (yperiodic) {
       if (fabs(dy) > yprd_half) {
-	if (dy < 0.0) {
-	  dy += yprd;
-	  dx += xy;
-	} else {
-	  dy -= yprd;
-	  dx -= xy;
-	}
+        if (dy < 0.0) {
+          dy += yprd;
+          dx += xy;
+        } else {
+          dy -= yprd;
+          dx -= xy;
+        }
       }
     }
     if (xperiodic) {
       if (fabs(dx) > xprd_half) {
-	if (dx < 0.0) dx += xprd;
-	else dx -= xprd;
+        if (dx < 0.0) dx += xprd;
+        else dx -= xprd;
       }
     }
   }
@@ -601,52 +601,52 @@ void Domain::minimum_image(double *delta)
   if (triclinic == 0) {
     if (xperiodic) {
       if (fabs(delta[0]) > xprd_half) {
-	if (delta[0] < 0.0) delta[0] += xprd;
-	else delta[0] -= xprd;
+        if (delta[0] < 0.0) delta[0] += xprd;
+        else delta[0] -= xprd;
       }
     }
     if (yperiodic) {
       if (fabs(delta[1]) > yprd_half) {
-	if (delta[1] < 0.0) delta[1] += yprd;
-	else delta[1] -= yprd;
+        if (delta[1] < 0.0) delta[1] += yprd;
+        else delta[1] -= yprd;
       }
     }
     if (zperiodic) {
       if (fabs(delta[2]) > zprd_half) {
-	if (delta[2] < 0.0) delta[2] += zprd;
-	else delta[2] -= zprd;
+        if (delta[2] < 0.0) delta[2] += zprd;
+        else delta[2] -= zprd;
       }
     }
 
   } else {
     if (zperiodic) {
       if (fabs(delta[2]) > zprd_half) {
-	if (delta[2] < 0.0) {
-	  delta[2] += zprd;
-	  delta[1] += yz;
-	  delta[0] += xz;
-	} else {
-	  delta[2] -= zprd;
-	  delta[1] -= yz;
-	  delta[0] -= xz;
-	}
+        if (delta[2] < 0.0) {
+          delta[2] += zprd;
+          delta[1] += yz;
+          delta[0] += xz;
+        } else {
+          delta[2] -= zprd;
+          delta[1] -= yz;
+          delta[0] -= xz;
+        }
       }
     }
     if (yperiodic) {
       if (fabs(delta[1]) > yprd_half) {
-	if (delta[1] < 0.0) {
-	  delta[1] += yprd;
-	  delta[0] += xy;
-	} else {
-	  delta[1] -= yprd;
-	  delta[0] -= xy;
-	}
+        if (delta[1] < 0.0) {
+          delta[1] += yprd;
+          delta[0] += xy;
+        } else {
+          delta[1] -= yprd;
+          delta[0] -= xy;
+        }
       }
     }
     if (xperiodic) {
       if (fabs(delta[0]) > xprd_half) {
-	if (delta[0] < 0.0) delta[0] += xprd;
-	else delta[0] -= xprd;
+        if (delta[0] < 0.0) delta[0] += xprd;
+        else delta[0] -= xprd;
       }
     }
   }
@@ -658,7 +658,7 @@ void Domain::minimum_image(double *delta)
 ------------------------------------------------------------------------- */
 
 void Domain::closest_image(const double * const xi, const double * const xj,
-			   double * const xjimage)
+                           double * const xjimage)
 {
   double dx = xj[0] - xi[0];
   double dy = xj[1] - xi[1];
@@ -667,86 +667,86 @@ void Domain::closest_image(const double * const xi, const double * const xj,
   if (triclinic == 0) {
     if (xperiodic) {
       if (dx < 0.0) {
-	while (dx < 0.0) dx += xprd;
-	if (dx > xprd_half) dx -= xprd;
+        while (dx < 0.0) dx += xprd;
+        if (dx > xprd_half) dx -= xprd;
       } else {
-	while (dx > 0.0) dx -= xprd;
-	if (dx < -xprd_half) dx += xprd;
+        while (dx > 0.0) dx -= xprd;
+        if (dx < -xprd_half) dx += xprd;
       }
     }
     if (yperiodic) {
       if (dy < 0.0) {
-	while (dy < 0.0) dy += yprd;
-	if (dy > yprd_half) dy -= yprd;
+        while (dy < 0.0) dy += yprd;
+        if (dy > yprd_half) dy -= yprd;
       } else {
-	while (dy > 0.0) dy -= yprd;
-	if (dy < -yprd_half) dy += yprd;
+        while (dy > 0.0) dy -= yprd;
+        if (dy < -yprd_half) dy += yprd;
       }
     }
     if (zperiodic) {
       if (dz < 0.0) {
-	while (dz < 0.0) dz += zprd;
-	if (dz > zprd_half) dz -= zprd;
+        while (dz < 0.0) dz += zprd;
+        if (dz > zprd_half) dz -= zprd;
       } else {
-	while (dz > 0.0) dz -= zprd;
-	if (dz < -zprd_half) dz += zprd;
+        while (dz > 0.0) dz -= zprd;
+        if (dz < -zprd_half) dz += zprd;
       }
     }
 
   } else {
     if (zperiodic) {
       if (dz < 0.0) {
-	while (dz < 0.0) {
-	  dz += zprd;
-	  dy += yz;
-	  dx += xz;
-	}
-	if (dz > zprd_half) {
-	  dz -= zprd;
-	  dy -= yz;
-	  dx -= xz;
-	}
+        while (dz < 0.0) {
+          dz += zprd;
+          dy += yz;
+          dx += xz;
+        }
+        if (dz > zprd_half) {
+          dz -= zprd;
+          dy -= yz;
+          dx -= xz;
+        }
       } else {
-	while (dz > 0.0) {
-	  dz -= zprd;
-	  dy -= yz;
-	  dx -= xz;
-	}
-	if (dz < -zprd_half) {
-	  dz += zprd;
-	  dy += yz;
-	  dx += xz;
-	}
+        while (dz > 0.0) {
+          dz -= zprd;
+          dy -= yz;
+          dx -= xz;
+        }
+        if (dz < -zprd_half) {
+          dz += zprd;
+          dy += yz;
+          dx += xz;
+        }
       }
     }
     if (yperiodic) {
       if (dy < 0.0) {
-	while (dy < 0.0) {
-	  dy += yprd;
-	  dx += xy;
-	}
-	if (dy > yprd_half) {
-	  dy -= yprd;
-	  dx -= xy;
-	}
+        while (dy < 0.0) {
+          dy += yprd;
+          dx += xy;
+        }
+        if (dy > yprd_half) {
+          dy -= yprd;
+          dx -= xy;
+        }
       } else {
-	while (dy > 0.0) {
-	  dy -= yprd;
-	  dx -= xy;
-	}
-	if (dy < -yprd_half) {
-	  dy += yprd;
-	  dx += xy;
-	}
+        while (dy > 0.0) {
+          dy -= yprd;
+          dx -= xy;
+        }
+        if (dy < -yprd_half) {
+          dy += yprd;
+          dx += xy;
+        }
       }
     }
     if (xperiodic) {
       if (dx < 0.0) {
-	while (dx < 0.0) dx += xprd;
-	if (dx > xprd_half) dx -= xprd;
+        while (dx < 0.0) dx += xprd;
+        if (dx > xprd_half) dx -= xprd;
       } else {
-	while (dx > 0.0) dx -= xprd;
-	if (dx < -xprd_half) dx += xprd;
+        while (dx > 0.0) dx -= xprd;
+        if (dx < -xprd_half) dx += xprd;
       }
     }
   }
@@ -1041,7 +1041,7 @@ void Domain::image_flip(int m, int n, int p)
   int *image = atom->image;
   int nlocal = atom->nlocal;
 
-  for (int i = 0; i < nlocal; i++) { 
+  for (int i = 0; i < nlocal; i++) {
     int xbox = (image[i] & 1023) - 512;
     int ybox = (image[i] >> 10 & 1023) - 512;
     int zbox = (image[i] >> 20) - 512;
@@ -1088,7 +1088,7 @@ void Domain::add_region(int narg, char **arg)
 
   if (nregion == maxregion) {
     maxregion += DELTA;
-    regions = (Region **) 
+    regions = (Region **)
       memory->srealloc(regions,maxregion*sizeof(Region *),"domain:regions");
   }
 
@@ -1158,14 +1158,14 @@ void Domain::set_boundary(int narg, char **arg, int flag)
       else if (c == 's') boundary[idim][iside] = 2;
       else if (c == 'm') boundary[idim][iside] = 3;
       else {
-	if (flag == 0) error->all(FLERR,"Illegal boundary command");
-	if (flag == 1) error->all(FLERR,"Illegal change_box command");
+        if (flag == 0) error->all(FLERR,"Illegal boundary command");
+        if (flag == 1) error->all(FLERR,"Illegal change_box command");
       }
     }
 
   for (int idim = 0; idim < 3; idim++)
     if ((boundary[idim][0] == 0 && boundary[idim][1]) ||
-	(boundary[idim][0] && boundary[idim][1] == 0))
+        (boundary[idim][0] && boundary[idim][1] == 0))
       error->all(FLERR,"Both sides of boundary must be periodic");
 
   if (boundary[0][0] == 0) xperiodic = 1;
@@ -1183,8 +1183,8 @@ void Domain::set_boundary(int narg, char **arg, int flag)
   if (xperiodic == 0 || yperiodic == 0 || zperiodic == 0) {
     nonperiodic = 1;
     if (boundary[0][0] >= 2 || boundary[0][1] >= 2 ||
-	boundary[1][0] >= 2 || boundary[1][1] >= 2 ||
-	boundary[2][0] >= 2 || boundary[2][1] >= 2) nonperiodic = 2;
+        boundary[1][0] >= 2 || boundary[1][1] >= 2 ||
+        boundary[2][0] >= 2 || boundary[2][1] >= 2) nonperiodic = 2;
   }
 }
 
@@ -1197,26 +1197,26 @@ void Domain::print_box(const char *str)
   if (comm->me == 0) {
     if (screen) {
       if (triclinic == 0)
-	fprintf(screen,"%sorthogonal box = (%g %g %g) to (%g %g %g)\n",
-		str,boxlo[0],boxlo[1],boxlo[2],boxhi[0],boxhi[1],boxhi[2]);
+        fprintf(screen,"%sorthogonal box = (%g %g %g) to (%g %g %g)\n",
+                str,boxlo[0],boxlo[1],boxlo[2],boxhi[0],boxhi[1],boxhi[2]);
       else {
-	char *format = (char *)
-	  "%striclinic box = (%g %g %g) to (%g %g %g) with tilt (%g %g %g)\n";
-	fprintf(screen,format,
-		str,boxlo[0],boxlo[1],boxlo[2],boxhi[0],boxhi[1],boxhi[2],
-		xy,xz,yz);
+        char *format = (char *)
+          "%striclinic box = (%g %g %g) to (%g %g %g) with tilt (%g %g %g)\n";
+        fprintf(screen,format,
+                str,boxlo[0],boxlo[1],boxlo[2],boxhi[0],boxhi[1],boxhi[2],
+                xy,xz,yz);
       }
     }
     if (logfile) {
       if (triclinic == 0)
-	fprintf(logfile,"%sorthogonal box = (%g %g %g) to (%g %g %g)\n",
-		str,boxlo[0],boxlo[1],boxlo[2],boxhi[0],boxhi[1],boxhi[2]);
+        fprintf(logfile,"%sorthogonal box = (%g %g %g) to (%g %g %g)\n",
+                str,boxlo[0],boxlo[1],boxlo[2],boxhi[0],boxhi[1],boxhi[2]);
       else {
-	char *format = (char *)
-	  "%striclinic box = (%g %g %g) to (%g %g %g) with tilt (%g %g %g)\n";
-	fprintf(logfile,format,
-		str,boxlo[0],boxlo[1],boxlo[2],boxhi[0],boxhi[1],boxhi[2],
-		xy,xz,yz);
+        char *format = (char *)
+          "%striclinic box = (%g %g %g) to (%g %g %g) with tilt (%g %g %g)\n";
+        fprintf(logfile,format,
+                str,boxlo[0],boxlo[1],boxlo[2],boxhi[0],boxhi[1],boxhi[2],
+                xy,xz,yz);
       }
     }
   }
@@ -1251,7 +1251,7 @@ void Domain::lamda2x(int n)
 {
   double **x = atom->x;
 
-  for (int i = 0; i < n; i++) { 
+  for (int i = 0; i < n; i++) {
     x[i][0] = h[0]*x[i][0] + h[5]*x[i][1] + h[4]*x[i][2] + boxlo[0];
     x[i][1] = h[1]*x[i][1] + h[3]*x[i][2] + boxlo[1];
     x[i][2] = h[2]*x[i][2] + boxlo[2];
@@ -1268,7 +1268,7 @@ void Domain::x2lamda(int n)
   double delta[3];
   double **x = atom->x;
 
-  for (int i = 0; i < n; i++) { 
+  for (int i = 0; i < n; i++) {
     delta[0] = x[i][0] - boxlo[0];
     delta[1] = x[i][1] - boxlo[1];
     delta[2] = x[i][2] - boxlo[2];
@@ -1318,7 +1318,7 @@ void Domain::x2lamda(double *x, double *lamda)
 ------------------------------------------------------------------------- */
 
 void Domain::x2lamda(double *x, double *lamda,
-		     double *my_boxlo, double *my_h_inv)
+                     double *my_boxlo, double *my_h_inv)
 {
   double delta[3];
   delta[0] = x[0] - my_boxlo[0];
diff --git a/src/domain.h b/src/domain.h
index a449449d58..5922908071 100644
--- a/src/domain.h
+++ b/src/domain.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -34,7 +34,7 @@ class Domain : protected Pointers {
                                          // 2 = shrink-wrap non-periodic
                                          // 3 = shrink-wrap non-per w/ min
 
-  int triclinic;		         // 0 = orthog box, 1 = triclinic
+  int triclinic;                         // 0 = orthog box, 1 = triclinic
 
                                          // orthogonal box
   double xprd,yprd,zprd;                 // global box dimensions
@@ -70,7 +70,7 @@ class Domain : protected Pointers {
 
                                          // triclinic box
   double xy,xz,yz;                       // 3 tilt factors
-  double h[6],h_inv[6];	          	 // shape matrix in Voigt notation
+  double h[6],h_inv[6];                           // shape matrix in Voigt notation
   double h_rate[6],h_ratelo[3];          // rate of box size/shape change
 
   int box_change;                 // 1 if box bounds ever change, 0 if fixed
@@ -96,8 +96,8 @@ class Domain : protected Pointers {
   int minimum_image_check(double, double, double);
   void minimum_image(double &, double &, double &);
   void minimum_image(double *);
-  void closest_image(const double * const, const double * const, 
-		     double * const);
+  void closest_image(const double * const, const double * const,
+                     double * const);
   void remap(double *, int &);
   void remap(double *);
   void remap_near(double *, double *);
diff --git a/src/dump.cpp b/src/dump.cpp
index f5dcea53c3..7c7f2cd3a2 100644
--- a/src/dump.cpp
+++ b/src/dump.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -191,32 +191,32 @@ void Dump::init()
       int min = IBIG;
       int max = 0;
       for (int i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) {
-	  min = MIN(min,tag[i]);
-	  max = MAX(max,tag[i]);
-	}
+        if (mask[i] & groupbit) {
+          min = MIN(min,tag[i]);
+          max = MAX(max,tag[i]);
+        }
       int minall,maxall;
       MPI_Allreduce(&min,&minall,1,MPI_INT,MPI_MIN,world);
       MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
       int isize = static_cast<int> (size);
 
       if (maxall-minall+1 == isize) {
-	reorderflag = 1;
-	double range = maxall-minall + EPSILON;
-	idlo = static_cast<int> (range*me/nprocs + minall);
-	int idhi = static_cast<int> (range*(me+1)/nprocs + minall);
-
-	int lom1 = static_cast<int> ((idlo-1-minall)/range * nprocs);
-	int lo = static_cast<int> ((idlo-minall)/range * nprocs);
-	int him1 = static_cast<int> ((idhi-1-minall)/range * nprocs);
-	int hi = static_cast<int> ((idhi-minall)/range * nprocs);
-	if (me && me == lom1) idlo--;
-	else if (me && me != lo) idlo++;
-	if (me+1 == him1) idhi--;
-	else if (me+1 != hi) idhi++;
-
-	nme_reorder = idhi-idlo;
-	ntotal_reorder = isize;
+        reorderflag = 1;
+        double range = maxall-minall + EPSILON;
+        idlo = static_cast<int> (range*me/nprocs + minall);
+        int idhi = static_cast<int> (range*(me+1)/nprocs + minall);
+
+        int lom1 = static_cast<int> ((idlo-1-minall)/range * nprocs);
+        int lo = static_cast<int> ((idlo-minall)/range * nprocs);
+        int him1 = static_cast<int> ((idhi-1-minall)/range * nprocs);
+        int hi = static_cast<int> ((idhi-minall)/range * nprocs);
+        if (me && me == lom1) idlo--;
+        else if (me && me != lo) idlo++;
+        if (me+1 == him1) idhi--;
+        else if (me+1 != hi) idhi++;
+
+        nme_reorder = idhi-idlo;
+        ntotal_reorder = isize;
       }
     }
   }
@@ -309,7 +309,7 @@ void Dump::write()
   else pack(NULL);
   if (sort_flag) sort();
 
-  // multiproc = 1 = each proc writes own data to own file 
+  // multiproc = 1 = each proc writes own data to own file
   // multiproc = 0 = all procs write to one file thru proc 0
   //   proc 0 pings each proc, receives it's data, writes to file
   //   all other procs wait for ping, send their data to proc 0
@@ -322,18 +322,18 @@ void Dump::write()
 
     if (me == 0) {
       for (int iproc = 0; iproc < nprocs; iproc++) {
-	if (iproc) {
-	  MPI_Irecv(buf,maxbuf*size_one,MPI_DOUBLE,iproc,0,world,&request);
-	  MPI_Send(&tmp,0,MPI_INT,iproc,0,world);
-	  MPI_Wait(&request,&status);
-	  MPI_Get_count(&status,MPI_DOUBLE,&nlines);
-	  nlines /= size_one;
-	} else nlines = nme;
-
-	write_data(nlines,buf);
+        if (iproc) {
+          MPI_Irecv(buf,maxbuf*size_one,MPI_DOUBLE,iproc,0,world,&request);
+          MPI_Send(&tmp,0,MPI_INT,iproc,0,world);
+          MPI_Wait(&request,&status);
+          MPI_Get_count(&status,MPI_DOUBLE,&nlines);
+          nlines /= size_one;
+        } else nlines = nme;
+
+        write_data(nlines,buf);
       }
       if (flush_flag) fflush(fp);
-      
+
     } else {
       MPI_Recv(&tmp,0,MPI_INT,0,0,world,&status);
       MPI_Rsend(buf,nme*size_one,MPI_DOUBLE,0,0,world);
@@ -374,9 +374,9 @@ void Dump::openfile()
     filecurrent = new char[strlen(filename) + 16];
     char *ptr = strchr(filename,'*');
     *ptr = '\0';
-    if (padflag == 0) 
+    if (padflag == 0)
       sprintf(filecurrent,"%s" BIGINT_FORMAT "%s",
-	      filename,update->ntimestep,ptr+1);
+              filename,update->ntimestep,ptr+1);
     else {
       char bif[8],pad[16];
       strcpy(bif,BIGINT_FORMAT);
@@ -433,8 +433,8 @@ void Dump::sort()
       memory->destroy(index);
       memory->create(index,maxsort,"dump:index");
       if (sortcol == 0) {
-	memory->destroy(idsort);
-	memory->create(idsort,maxsort,"dump:idsort");
+        memory->destroy(idsort);
+        memory->create(idsort,maxsort,"dump:idsort");
       }
     }
 
@@ -449,7 +449,7 @@ void Dump::sort()
     }
 
   // if multiple procs, exchange datums between procs via irregular
-    
+
   } else {
 
     // grow proclist if necessary
@@ -459,32 +459,32 @@ void Dump::sort()
       memory->destroy(proclist);
       memory->create(proclist,maxproc,"dump:proclist");
     }
-    
+
     // proclist[i] = which proc Ith datum will be sent to
 
     if (sortcol == 0) {
       int min = IBIG;
       int max = 0;
       for (i = 0; i < nme; i++) {
-	min = MIN(min,ids[i]);
-	max = MAX(max,ids[i]);
+        min = MIN(min,ids[i]);
+        max = MAX(max,ids[i]);
       }
       int minall,maxall;
       MPI_Allreduce(&min,&minall,1,MPI_INT,MPI_MIN,world);
       MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
       double range = maxall-minall + EPSILON;
       for (i = 0; i < nme; i++) {
-	iproc = static_cast<int> ((ids[i]-minall)/range * nprocs);
-	proclist[i] = iproc;
+        iproc = static_cast<int> ((ids[i]-minall)/range * nprocs);
+        proclist[i] = iproc;
       }
 
     } else {
       double min = BIG;
       double max = -BIG;
       for (i = 0; i < nme; i++) {
-	value = buf[i*size_one + sortcolm1];
-	min = MIN(min,value);
-	max = MAX(max,value);
+        value = buf[i*size_one + sortcolm1];
+        min = MIN(min,value);
+        max = MAX(max,value);
       }
       double minall,maxall;
       MPI_Allreduce(&min,&minall,1,MPI_DOUBLE,MPI_MIN,world);
@@ -492,9 +492,9 @@ void Dump::sort()
       double range = maxall-minall + EPSILON*(maxall-minall);
       if (range == 0.0) range = EPSILON;
       for (i = 0; i < nme; i++) {
-	value = buf[i*size_one + sortcolm1];
-	iproc = static_cast<int> ((value-minall)/range * nprocs);
-	proclist[i] = iproc;
+        value = buf[i*size_one + sortcolm1];
+        iproc = static_cast<int> ((value-minall)/range * nprocs);
+        proclist[i] = iproc;
       }
     }
 
@@ -511,14 +511,14 @@ void Dump::sort()
       memory->destroy(index);
       memory->create(index,maxsort,"dump:index");
       if (sortcol == 0) {
-	memory->destroy(idsort);
-	memory->create(idsort,maxsort,"dump:idsort");
+        memory->destroy(idsort);
+        memory->create(idsort,maxsort,"dump:idsort");
       }
     }
-    
+
     irregular->exchange_data((char *) buf,size_one*sizeof(double),
-			     (char *) bufsort);
-    if (sortcol == 0) 
+                             (char *) bufsort);
+    if (sortcol == 0)
       irregular->exchange_data((char *) ids,sizeof(int),(char *) idsort);
     irregular->destroy_data();
   }
@@ -537,7 +537,7 @@ void Dump::sort()
 
     if (reorderflag)
       for (i = 0; i < nme; i++)
-	index[idsort[i]-idlo] = i;
+        index[idsort[i]-idlo] = i;
   }
 
   if (!reorderflag) {
@@ -562,7 +562,7 @@ void Dump::sort()
   }
 
   // copy data from bufsort to buf using index
-    
+
   int nbytes = size_one*sizeof(double);
   for (i = 0; i < nme; i++)
     memcpy(&buf[i*size_one],&bufsort[index[i]*size_one],nbytes);
@@ -649,17 +649,17 @@ void Dump::modify_params(int narg, char **arg)
       if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
       int idump;
       for (idump = 0; idump < output->ndump; idump++)
-	if (strcmp(id,output->dump[idump]->id) == 0) break;
+        if (strcmp(id,output->dump[idump]->id) == 0) break;
       int n;
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	delete [] output->var_dump[idump];
-	n = strlen(&arg[iarg+1][2]) + 1;
-	output->var_dump[idump] = new char[n];
-	strcpy(output->var_dump[idump],&arg[iarg+1][2]);
-	n = 0;
+        delete [] output->var_dump[idump];
+        n = strlen(&arg[iarg+1][2]) + 1;
+        output->var_dump[idump] = new char[n];
+        strcpy(output->var_dump[idump],&arg[iarg+1][2]);
+        n = 0;
       } else {
-	n = atoi(arg[iarg+1]);
-	if (n <= 0) error->all(FLERR,"Illegal dump_modify command");
+        n = atoi(arg[iarg+1]);
+        if (n <= 0) error->all(FLERR,"Illegal dump_modify command");
       }
       output->every_dump[idump] = n;
       iarg += 2;
@@ -680,9 +680,9 @@ void Dump::modify_params(int narg, char **arg)
       delete [] format_user;
       format_user = NULL;
       if (strcmp(arg[iarg+1],"none")) {
-	int n = strlen(arg[iarg+1]) + 1;
-	format_user = new char[n];
-	strcpy(format_user,arg[iarg+1]);
+        int n = strlen(arg[iarg+1]) + 1;
+        format_user = new char[n];
+        strcpy(format_user,arg[iarg+1]);
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"pad") == 0) {
@@ -694,19 +694,19 @@ void Dump::modify_params(int narg, char **arg)
       if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command");
       if (strcmp(arg[iarg+1],"off") == 0) sort_flag = 0;
       else if (strcmp(arg[iarg+1],"id") == 0) {
-	sort_flag = 1;
-	sortcol = 0;
-	sortorder = ASCEND;
+        sort_flag = 1;
+        sortcol = 0;
+        sortorder = ASCEND;
       } else {
-	sort_flag = 1;
-	sortcol = atoi(arg[iarg+1]);
-	sortorder = ASCEND;
-	if (sortcol == 0) error->all(FLERR,"Illegal dump_modify command");
-	if (sortcol < 0) {
-	  sortorder = DESCEND;
-	  sortcol = -sortcol;
-	}
-	sortcolm1 = sortcol - 1;
+        sort_flag = 1;
+        sortcol = atoi(arg[iarg+1]);
+        sortorder = ASCEND;
+        if (sortcol == 0) error->all(FLERR,"Illegal dump_modify command");
+        if (sortcol < 0) {
+          sortorder = DESCEND;
+          sortcol = -sortcol;
+        }
+        sortcolm1 = sortcol - 1;
       }
       iarg += 2;
     } else {
diff --git a/src/dump.h b/src/dump.h
index 852202544a..b54705aa93 100644
--- a/src/dump.h
+++ b/src/dump.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp
index fa951c8fcf..42ddf8f196 100644
--- a/src/dump_atom.cpp
+++ b/src/dump_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -269,7 +269,7 @@ void DumpAtom::pack_scale_noimage(int *ids)
   double invxprd = 1.0/domain->xprd;
   double invyprd = 1.0/domain->yprd;
   double invzprd = 1.0/domain->zprd;
-  
+
   m = n = 0;
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
@@ -326,7 +326,7 @@ void DumpAtom::pack_scale_noimage_triclinic(int *ids)
   int nlocal = atom->nlocal;
 
   double lamda[3];
-  
+
   m = n = 0;
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
@@ -408,9 +408,9 @@ void DumpAtom::write_image(int n, double *mybuf)
   int m = 0;
   for (int i = 0; i < n; i++) {
     fprintf(fp,format,
-	    static_cast<int> (mybuf[m]), static_cast<int> (mybuf[m+1]),
-	    mybuf[m+2],mybuf[m+3],mybuf[m+4], static_cast<int> (mybuf[m+5]),
-	    static_cast<int> (mybuf[m+6]), static_cast<int> (mybuf[m+7]));
+            static_cast<int> (mybuf[m]), static_cast<int> (mybuf[m+1]),
+            mybuf[m+2],mybuf[m+3],mybuf[m+4], static_cast<int> (mybuf[m+5]),
+            static_cast<int> (mybuf[m+6]), static_cast<int> (mybuf[m+7]));
     m += size_one;
   }
 }
@@ -422,8 +422,8 @@ void DumpAtom::write_noimage(int n, double *mybuf)
   int m = 0;
   for (int i = 0; i < n; i++) {
     fprintf(fp,format,
-	    static_cast<int> (mybuf[m]), static_cast<int> (mybuf[m+1]),
-	    mybuf[m+2],mybuf[m+3],mybuf[m+4]);
+            static_cast<int> (mybuf[m]), static_cast<int> (mybuf[m+1]),
+            mybuf[m+2],mybuf[m+3],mybuf[m+4]);
     m += size_one;
   }
 }
diff --git a/src/dump_atom.h b/src/dump_atom.h
index 54a57784dc..c792f8c0ab 100644
--- a/src/dump_atom.h
+++ b/src/dump_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp
index 940e34549f..3792ee5c57 100755
--- a/src/dump_cfg.cpp
+++ b/src/dump_cfg.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -15,7 +15,7 @@
    Contributing author: Liang Wan (Chinese Academy of Sciences)
 ------------------------------------------------------------------------- */
 
-#include "math.h" 
+#include "math.h"
 #include "stdlib.h"
 #include "string.h"
 #include "dump_cfg.h"
@@ -43,11 +43,11 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) :
 {
   if (narg < 10 ||
       strcmp(arg[5],"id") != 0 || strcmp(arg[6],"type") != 0 ||
-      (strcmp(arg[7],"xs") != 0 && strcmp(arg[7],"xsu") != 0) || 
+      (strcmp(arg[7],"xs") != 0 && strcmp(arg[7],"xsu") != 0) ||
       (strcmp(arg[8],"ys") != 0 && strcmp(arg[8],"ysu") != 0) ||
       (strcmp(arg[9],"zs") != 0 && strcmp(arg[9],"zsu") != 0))
     error->all(FLERR,"Dump cfg arguments must start with "
-	       "'id type xs ys zs' or 'id type xsu ysu zsu'");
+               "'id type xs ys zs' or 'id type xsu ysu zsu'");
 
   if (strcmp(arg[7],"xs") == 0)
     if (strcmp(arg[8],"ysu") == 0 || strcmp(arg[9],"zsu") == 0)
@@ -56,7 +56,7 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) :
   else if (strcmp(arg[8],"ys") == 0 || strcmp(arg[9],"zs") == 0)
     error->all(FLERR,"Dump cfg arguments can not mix xs|ys|zs with xsu|ysu|zsu");
   else unwrapflag = 1;
-    
+
   // arrays for data rearrangement
 
   rbuf = NULL;
@@ -71,25 +71,25 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) :
   int i = 0;
   for (int iarg = 10; iarg < narg; iarg++, i++) {
     if (strncmp(arg[iarg],"c_",2) == 0 ||
-	strncmp(arg[iarg],"f_",2) == 0 ||
-	strncmp(arg[iarg],"v_",2) == 0) {
+        strncmp(arg[iarg],"f_",2) == 0 ||
+        strncmp(arg[iarg],"v_",2) == 0) {
       int n = strlen(arg[iarg]);
       char *suffix = new char[n];
       strcpy(suffix,&arg[iarg][2]);
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Invalid keyword in dump cfg command");
-	*ptr = '\0';
-	*(ptr+2) = '\0';
-	auxname[i] = new char[strlen(suffix) + 3];
-	strcpy(auxname[i],suffix);
-	strcat(auxname[i],"_");
-	strcat(auxname[i],ptr+1);
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Invalid keyword in dump cfg command");
+        *ptr = '\0';
+        *(ptr+2) = '\0';
+        auxname[i] = new char[strlen(suffix) + 3];
+        strcpy(auxname[i],suffix);
+        strcat(auxname[i],"_");
+        strcat(auxname[i],ptr+1);
       } else {
-	auxname[i] = new char[strlen(suffix) + 1];
-	strcpy(auxname[i],suffix);
+        auxname[i] = new char[strlen(suffix) + 1];
+        strcpy(auxname[i],suffix);
       }
 
       delete [] suffix;
@@ -128,7 +128,7 @@ void DumpCFG::write_header(bigint n)
 {
   // special handling for atom style peri
   //   use average volume of particles to scale particles to mimic C atoms
-  //   scale box dimension to sc lattice for C with sigma = 1.44 Angstroms  
+  //   scale box dimension to sc lattice for C with sigma = 1.44 Angstroms
   // special handling for unwrapped coordinates
 
   double scale;
@@ -137,12 +137,12 @@ void DumpCFG::write_header(bigint n)
     double vone = 0.0;
     for (int i = 0; i < nlocal; i++) vone += atom->vfrac[i];
     double vave;
-    MPI_Allreduce(&vone,&vave,1,MPI_DOUBLE,MPI_SUM,world); 
-    if (atom->natoms) vave /= atom->natoms; 
-    if (vave > 0.0) scale = 1.44 / pow(vave,1.0/3.0); 
+    MPI_Allreduce(&vone,&vave,1,MPI_DOUBLE,MPI_SUM,world);
+    if (atom->natoms) vave /= atom->natoms;
+    if (vave > 0.0) scale = 1.44 / pow(vave,1.0/3.0);
   } else if (unwrapflag == 1) scale = UNWRAPEXPAND;
   else scale = 1.0;
-    
+
   if (me == 0 || multiproc) {
     char str[64];
     sprintf(str,"Number of particles = %s\n",BIGINT_FORMAT);
@@ -198,46 +198,46 @@ void DumpCFG::write_data(int n, double *mybuf)
   }
 
   // write data lines in rbuf to file after transfer is done
-  
+
   double unwrap_coord;
 
   if (nlines == nchosen) {
     for (itype = 1; itype <= ntypes; itype++) {
       for (i = 0; i < nchosen; i++)
-	if (rbuf[i][1] == itype) break;
+        if (rbuf[i][1] == itype) break;
       if (i < nchosen) {
-	if (rmass) fprintf(fp,"%g\n",rmass[i]);
-	else fprintf(fp,"%g\n",mass[itype]);
-	fprintf(fp,"%s\n",typenames[itype]);
-	for (; i < nchosen; i++) {
-	  if (rbuf[i][1] == itype) {
-	    if (unwrapflag == 0)
-	      for (j = 2; j < size_one; j++) {
-		if (vtype[j] == INT)
-		  fprintf(fp,vformat[j],static_cast<int> (rbuf[i][j]));
-		else fprintf(fp,vformat[j],rbuf[i][j]);
-	      }
-	    else {
-
-	      // Unwrapped scaled coordinates are shifted to
-	      // center of expanded box, to prevent
-	      // rewrapping by AtomEye. Dividing by 
-	      // expansion factor restores correct
-	      // interatomic distances.
-
-	      for (j = 2; j < 5; j++) {
-		unwrap_coord = (rbuf[i][j] - 0.5)/UNWRAPEXPAND + 0.5;
-		fprintf(fp,vformat[j],unwrap_coord);
-	      }
-	      for (j = 5; j < size_one; j++) {
-		if (vtype[j] == INT)
-		  fprintf(fp,vformat[j],static_cast<int> (rbuf[i][j]));
-		else fprintf(fp,vformat[j],rbuf[i][j]);
-	      }
-	    }
-	    fprintf(fp,"\n");
-	  }
-	}
+        if (rmass) fprintf(fp,"%g\n",rmass[i]);
+        else fprintf(fp,"%g\n",mass[itype]);
+        fprintf(fp,"%s\n",typenames[itype]);
+        for (; i < nchosen; i++) {
+          if (rbuf[i][1] == itype) {
+            if (unwrapflag == 0)
+              for (j = 2; j < size_one; j++) {
+                if (vtype[j] == INT)
+                  fprintf(fp,vformat[j],static_cast<int> (rbuf[i][j]));
+                else fprintf(fp,vformat[j],rbuf[i][j]);
+              }
+            else {
+
+              // Unwrapped scaled coordinates are shifted to
+              // center of expanded box, to prevent
+              // rewrapping by AtomEye. Dividing by
+              // expansion factor restores correct
+              // interatomic distances.
+
+              for (j = 2; j < 5; j++) {
+                unwrap_coord = (rbuf[i][j] - 0.5)/UNWRAPEXPAND + 0.5;
+                fprintf(fp,vformat[j],unwrap_coord);
+              }
+              for (j = 5; j < size_one; j++) {
+                if (vtype[j] == INT)
+                  fprintf(fp,vformat[j],static_cast<int> (rbuf[i][j]));
+                else fprintf(fp,vformat[j],rbuf[i][j]);
+              }
+            }
+            fprintf(fp,"\n");
+          }
+        }
       }
     }
     nlines = 0;
diff --git a/src/dump_cfg.h b/src/dump_cfg.h
index 576448a695..654582b1c6 100755
--- a/src/dump_cfg.h
+++ b/src/dump_cfg.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp
index c5ed749f08..32c51d5e34 100644
--- a/src/dump_custom.cpp
+++ b/src/dump_custom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -256,7 +256,7 @@ void DumpCustom::init_style()
   int ivariable;
   for (int i = 0; i < nvariable; i++) {
     ivariable = input->variable->find(id_variable[i]);
-    if (ivariable < 0) 
+    if (ivariable < 0)
       error->all(FLERR,"Could not find dump custom variable name");
     variable[i] = ivariable;
   }
@@ -265,7 +265,7 @@ void DumpCustom::init_style()
 
   if (iregion >= 0) {
     iregion = domain->find_region(idregion);
-    if (iregion == -1) 
+    if (iregion == -1)
       error->all(FLERR,"Region ID for dump custom does not exist");
   }
 
@@ -387,8 +387,8 @@ int DumpCustom::count()
   if (ncompute) {
     for (i = 0; i < ncompute; i++)
       if (!(compute[i]->invoked_flag & INVOKED_PERATOM)) {
-	compute[i]->compute_peratom();
-	compute[i]->invoked_flag |= INVOKED_PERATOM;
+        compute[i]->compute_peratom();
+        compute[i]->invoked_flag |= INVOKED_PERATOM;
       }
   }
 
@@ -397,7 +397,7 @@ int DumpCustom::count()
   if (nvariable)
     for (i = 0; i < nvariable; i++)
       input->variable->compute_atom(variable[i],igroup,vbuf[i],1,0);
-  
+
   // choose all local atoms for output
 
   for (i = 0; i < nlocal; i++) choose[i] = 1;
@@ -408,7 +408,7 @@ int DumpCustom::count()
     int *mask = atom->mask;
     for (i = 0; i < nlocal; i++)
       if (!(mask[i] & groupbit))
-	choose[i] = 0;
+        choose[i] = 0;
   }
 
   // un-choose if not in region
@@ -417,8 +417,8 @@ int DumpCustom::count()
     Region *region = domain->regions[iregion];
     double **x = atom->x;
     for (i = 0; i < nlocal; i++)
-      if (choose[i] && region->match(x[i][0],x[i][1],x[i][2]) == 0) 
-	choose[i] = 0;
+      if (choose[i] && region->match(x[i][0],x[i][1],x[i][2]) == 0)
+        choose[i] = 0;
   }
 
   // un-choose if any threshhold criterion isn't met
@@ -428,424 +428,424 @@ int DumpCustom::count()
     double value;
     int nstride;
     int nlocal = atom->nlocal;
-    
+
     for (int ithresh = 0; ithresh < nthresh; ithresh++) {
 
       // customize by adding to if statement
 
       if (thresh_array[ithresh] == ID) {
-	int *tag = atom->tag;
-	for (i = 0; i < nlocal; i++) dchoose[i] = tag[i];
-	ptr = dchoose;
-	nstride = 1;
+        int *tag = atom->tag;
+        for (i = 0; i < nlocal; i++) dchoose[i] = tag[i];
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == MOL) {
-	if (!atom->molecule_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	int *molecule = atom->molecule;
-	for (i = 0; i < nlocal; i++) dchoose[i] = molecule[i];
-	ptr = dchoose;
-	nstride = 1;
+        if (!atom->molecule_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        int *molecule = atom->molecule;
+        for (i = 0; i < nlocal; i++) dchoose[i] = molecule[i];
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == TYPE) {
-	int *type = atom->type;
-	for (i = 0; i < nlocal; i++) dchoose[i] = type[i];
-	ptr = dchoose;
-	nstride = 1;
+        int *type = atom->type;
+        for (i = 0; i < nlocal; i++) dchoose[i] = type[i];
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == ELEMENT) {
-	int *type = atom->type;
-	for (i = 0; i < nlocal; i++) dchoose[i] = type[i];
-	ptr = dchoose;
-	nstride = 1;
+        int *type = atom->type;
+        for (i = 0; i < nlocal; i++) dchoose[i] = type[i];
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == MASS) {
-	if (atom->rmass) {
-	  ptr = atom->rmass;
-	  nstride = 1;
-	} else {
-	  double *mass = atom->mass;
-	  int *type = atom->type;
-	  for (i = 0; i < nlocal; i++) dchoose[i] = mass[type[i]];
-	  ptr = dchoose;
-	  nstride = 1;
-	}
+        if (atom->rmass) {
+          ptr = atom->rmass;
+          nstride = 1;
+        } else {
+          double *mass = atom->mass;
+          int *type = atom->type;
+          for (i = 0; i < nlocal; i++) dchoose[i] = mass[type[i]];
+          ptr = dchoose;
+          nstride = 1;
+        }
 
       } else if (thresh_array[ithresh] == X) {
-	ptr = &atom->x[0][0];
-	nstride = 3;
+        ptr = &atom->x[0][0];
+        nstride = 3;
       } else if (thresh_array[ithresh] == Y) {
-	ptr = &atom->x[0][1];
-	nstride = 3;
+        ptr = &atom->x[0][1];
+        nstride = 3;
       } else if (thresh_array[ithresh] == Z) {
-	ptr = &atom->x[0][2];
-	nstride = 3;
+        ptr = &atom->x[0][2];
+        nstride = 3;
 
       } else if (thresh_array[ithresh] == XS) {
         double **x = atom->x;
-	double boxxlo = domain->boxlo[0];
-	double invxprd = 1.0/domain->xprd;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = (x[i][0] - boxxlo) * invxprd;
-	ptr = dchoose;
-	nstride = 1;
+        double boxxlo = domain->boxlo[0];
+        double invxprd = 1.0/domain->xprd;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = (x[i][0] - boxxlo) * invxprd;
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == YS) {
         double **x = atom->x;
-	double boxylo = domain->boxlo[1];
-	double invyprd = 1.0/domain->yprd;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = (x[i][1] - boxylo) * invyprd;
-	ptr = dchoose;
-	nstride = 1;
+        double boxylo = domain->boxlo[1];
+        double invyprd = 1.0/domain->yprd;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = (x[i][1] - boxylo) * invyprd;
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == ZS) {
         double **x = atom->x;
-	double boxzlo = domain->boxlo[2];
-	double invzprd = 1.0/domain->zprd;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = (x[i][2] - boxzlo) * invzprd;
-	ptr = dchoose;
-	nstride = 1;
+        double boxzlo = domain->boxlo[2];
+        double invzprd = 1.0/domain->zprd;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = (x[i][2] - boxzlo) * invzprd;
+        ptr = dchoose;
+        nstride = 1;
 
       } else if (thresh_array[ithresh] == XSTRI) {
         double **x = atom->x;
-	double *boxlo = domain->boxlo;
-	double *h_inv = domain->h_inv;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = h_inv[0]*(x[i][0]-boxlo[0]) + 
-	    h_inv[5]*(x[i][1]-boxlo[1]) + h_inv[4]*(x[i][2]-boxlo[2]);
-	ptr = dchoose;
-	nstride = 1;
+        double *boxlo = domain->boxlo;
+        double *h_inv = domain->h_inv;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = h_inv[0]*(x[i][0]-boxlo[0]) +
+            h_inv[5]*(x[i][1]-boxlo[1]) + h_inv[4]*(x[i][2]-boxlo[2]);
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == YSTRI) {
         double **x = atom->x;
-	double *boxlo = domain->boxlo;
-	double *h_inv = domain->h_inv;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = h_inv[1]*(x[i][1]-boxlo[1]) + 
-	    h_inv[3]*(x[i][2]-boxlo[2]);
-	ptr = dchoose;
-	nstride = 1;
+        double *boxlo = domain->boxlo;
+        double *h_inv = domain->h_inv;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = h_inv[1]*(x[i][1]-boxlo[1]) +
+            h_inv[3]*(x[i][2]-boxlo[2]);
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == ZSTRI) {
         double **x = atom->x;
-	double *boxlo = domain->boxlo;
-	double *h_inv = domain->h_inv;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = h_inv[2]*(x[i][2]-boxlo[2]);
-	ptr = dchoose;
-	nstride = 1;
+        double *boxlo = domain->boxlo;
+        double *h_inv = domain->h_inv;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = h_inv[2]*(x[i][2]-boxlo[2]);
+        ptr = dchoose;
+        nstride = 1;
 
       } else if (thresh_array[ithresh] == XU) {
         double **x = atom->x;
-	int *image = atom->image;
-	double xprd = domain->xprd;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = x[i][0] + ((image[i] & 1023) - 512) * xprd;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double xprd = domain->xprd;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = x[i][0] + ((image[i] & 1023) - 512) * xprd;
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == YU) {
         double **x = atom->x;
-	int *image = atom->image;
-	double yprd = domain->yprd;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = x[i][1] + ((image[i] >> 10 & 1023) - 512) * yprd;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double yprd = domain->yprd;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = x[i][1] + ((image[i] >> 10 & 1023) - 512) * yprd;
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == ZU) {
         double **x = atom->x;
-	int *image = atom->image;
-	double zprd = domain->zprd;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = x[i][2] + ((image[i] >> 20) - 512) * zprd;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double zprd = domain->zprd;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = x[i][2] + ((image[i] >> 20) - 512) * zprd;
+        ptr = dchoose;
+        nstride = 1;
 
       } else if (thresh_array[ithresh] == XUTRI) {
         double **x = atom->x;
-	int *image = atom->image;
-	double *h = domain->h;
-	int xbox,ybox,zbox;
-	for (i = 0; i < nlocal; i++) {
-	  xbox = (image[i] & 1023) - 512;
-	  ybox = (image[i] >> 10 & 1023) - 512;
-	  zbox = (image[i] >> 20) - 512;
-	  dchoose[i] = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox;
-	}
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double *h = domain->h;
+        int xbox,ybox,zbox;
+        for (i = 0; i < nlocal; i++) {
+          xbox = (image[i] & 1023) - 512;
+          ybox = (image[i] >> 10 & 1023) - 512;
+          zbox = (image[i] >> 20) - 512;
+          dchoose[i] = x[i][0] + h[0]*xbox + h[5]*ybox + h[4]*zbox;
+        }
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == YUTRI) {
         double **x = atom->x;
-	int *image = atom->image;
-	double *h = domain->h;
-	int ybox,zbox;
-	for (i = 0; i < nlocal; i++) {
-	  ybox = (image[i] >> 10 & 1023) - 512;
-	  zbox = (image[i] >> 20) - 512;
-	  dchoose[i] = x[i][1] + h[1]*ybox + h[3]*zbox;
-	}
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double *h = domain->h;
+        int ybox,zbox;
+        for (i = 0; i < nlocal; i++) {
+          ybox = (image[i] >> 10 & 1023) - 512;
+          zbox = (image[i] >> 20) - 512;
+          dchoose[i] = x[i][1] + h[1]*ybox + h[3]*zbox;
+        }
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == ZUTRI) {
         double **x = atom->x;
-	int *image = atom->image;
-	double *h = domain->h;
-	int zbox;
-	for (i = 0; i < nlocal; i++) {
-	  zbox = (image[i] >> 20) - 512;
-	  dchoose[i] = x[i][2] + h[2]*zbox;
-	}
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double *h = domain->h;
+        int zbox;
+        for (i = 0; i < nlocal; i++) {
+          zbox = (image[i] >> 20) - 512;
+          dchoose[i] = x[i][2] + h[2]*zbox;
+        }
+        ptr = dchoose;
+        nstride = 1;
 
       } else if (thresh_array[ithresh] == XSU) {
         double **x = atom->x;
-	int *image = atom->image;
-	double boxxlo = domain->boxlo[0];
-	double invxprd = 1.0/domain->xprd;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = (x[i][0] - boxxlo) * invxprd + (image[i] & 1023) - 512;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double boxxlo = domain->boxlo[0];
+        double invxprd = 1.0/domain->xprd;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = (x[i][0] - boxxlo) * invxprd + (image[i] & 1023) - 512;
+        ptr = dchoose;
+        nstride = 1;
 
       } else if (thresh_array[ithresh] == YSU) {
         double **x = atom->x;
-	int *image = atom->image;
-	double boxylo = domain->boxlo[1];
-	double invyprd = 1.0/domain->yprd;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = 
-	    (x[i][1] - boxylo) * invyprd + (image[i] >> 10 & 1023) - 512;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double boxylo = domain->boxlo[1];
+        double invyprd = 1.0/domain->yprd;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] =
+            (x[i][1] - boxylo) * invyprd + (image[i] >> 10 & 1023) - 512;
+        ptr = dchoose;
+        nstride = 1;
 
       } else if (thresh_array[ithresh] == ZSU) {
         double **x = atom->x;
-	int *image = atom->image;
-	double boxzlo = domain->boxlo[2];
-	double invzprd = 1.0/domain->zprd;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = (x[i][2] - boxzlo) * invzprd + (image[i] >> 20) - 512;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double boxzlo = domain->boxlo[2];
+        double invzprd = 1.0/domain->zprd;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = (x[i][2] - boxzlo) * invzprd + (image[i] >> 20) - 512;
+        ptr = dchoose;
+        nstride = 1;
 
       } else if (thresh_array[ithresh] == XSUTRI) {
         double **x = atom->x;
-	int *image = atom->image;
-	double *boxlo = domain->boxlo;
-	double *h_inv = domain->h_inv;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = h_inv[0]*(x[i][0]-boxlo[0]) + 
-	    h_inv[5]*(x[i][1]-boxlo[1]) + 
-	    h_inv[4]*(x[i][2]-boxlo[2]) + 
-	    (image[i] & 1023) - 512;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double *boxlo = domain->boxlo;
+        double *h_inv = domain->h_inv;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = h_inv[0]*(x[i][0]-boxlo[0]) +
+            h_inv[5]*(x[i][1]-boxlo[1]) +
+            h_inv[4]*(x[i][2]-boxlo[2]) +
+            (image[i] & 1023) - 512;
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == YSUTRI) {
         double **x = atom->x;
-	int *image = atom->image;
-	double *boxlo = domain->boxlo;
-	double *h_inv = domain->h_inv;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = h_inv[1]*(x[i][1]-boxlo[1]) + 
-	    h_inv[3]*(x[i][2]-boxlo[2]) + 
-	    (image[i] >> 10 & 1023) - 512;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double *boxlo = domain->boxlo;
+        double *h_inv = domain->h_inv;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = h_inv[1]*(x[i][1]-boxlo[1]) +
+            h_inv[3]*(x[i][2]-boxlo[2]) +
+            (image[i] >> 10 & 1023) - 512;
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == ZSUTRI) {
         double **x = atom->x;
-	int *image = atom->image;
-	double *boxlo = domain->boxlo;
-	double *h_inv = domain->h_inv;
-	for (i = 0; i < nlocal; i++) 
-	  dchoose[i] = h_inv[2]*(x[i][2]-boxlo[2]) +
-	    (image[i] >> 20) - 512;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        double *boxlo = domain->boxlo;
+        double *h_inv = domain->h_inv;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = h_inv[2]*(x[i][2]-boxlo[2]) +
+            (image[i] >> 20) - 512;
+        ptr = dchoose;
+        nstride = 1;
 
       } else if (thresh_array[ithresh] == IX) {
-	int *image = atom->image;
-	for (i = 0; i < nlocal; i++)
-	  dchoose[i] = (image[i] & 1023) - 512;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = (image[i] & 1023) - 512;
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == IY) {
-	int *image = atom->image;
-	for (i = 0; i < nlocal; i++)
-	  dchoose[i] = (image[i] >> 10 & 1023) - 512;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = (image[i] >> 10 & 1023) - 512;
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == IZ) {
-	int *image = atom->image;
-	for (i = 0; i < nlocal; i++)
-	  dchoose[i] = (image[i] >> 20) - 512;
-	ptr = dchoose;
-	nstride = 1;
+        int *image = atom->image;
+        for (i = 0; i < nlocal; i++)
+          dchoose[i] = (image[i] >> 20) - 512;
+        ptr = dchoose;
+        nstride = 1;
 
       } else if (thresh_array[ithresh] == VX) {
-	ptr = &atom->v[0][0];
-	nstride = 3;
+        ptr = &atom->v[0][0];
+        nstride = 3;
       } else if (thresh_array[ithresh] == VY) {
-	ptr = &atom->v[0][1];
-	nstride = 3;
+        ptr = &atom->v[0][1];
+        nstride = 3;
       } else if (thresh_array[ithresh] == VZ) {
-	ptr = &atom->v[0][2];
-	nstride = 3;
+        ptr = &atom->v[0][2];
+        nstride = 3;
       } else if (thresh_array[ithresh] == FX) {
-	ptr = &atom->f[0][0];
-	nstride = 3;
+        ptr = &atom->f[0][0];
+        nstride = 3;
       } else if (thresh_array[ithresh] == FY) {
-	ptr = &atom->f[0][1];
-	nstride = 3;
+        ptr = &atom->f[0][1];
+        nstride = 3;
       } else if (thresh_array[ithresh] == FZ) {
-	ptr = &atom->f[0][2];
-	nstride = 3;
+        ptr = &atom->f[0][2];
+        nstride = 3;
 
       } else if (thresh_array[ithresh] == Q) {
-	if (!atom->q_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = atom->q;
-	nstride = 1;
+        if (!atom->q_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = atom->q;
+        nstride = 1;
       } else if (thresh_array[ithresh] == MUX) {
-	if (!atom->mu_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->mu[0][0];
-	nstride = 4;
+        if (!atom->mu_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->mu[0][0];
+        nstride = 4;
       } else if (thresh_array[ithresh] == MUY) {
-	if (!atom->mu_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->mu[0][1];
-	nstride = 4;
+        if (!atom->mu_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->mu[0][1];
+        nstride = 4;
       } else if (thresh_array[ithresh] == MUZ) {
-	if (!atom->mu_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->mu[0][2];
-	nstride = 4;
+        if (!atom->mu_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->mu[0][2];
+        nstride = 4;
       } else if (thresh_array[ithresh] == MU) {
-	if (!atom->mu_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->mu[0][3];
-	nstride = 4;
+        if (!atom->mu_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->mu[0][3];
+        nstride = 4;
 
       } else if (thresh_array[ithresh] == RADIUS) {
-	if (!atom->radius_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = atom->radius;
-	nstride = 1;
+        if (!atom->radius_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = atom->radius;
+        nstride = 1;
       } else if (thresh_array[ithresh] == DIAMETER) {
-	if (!atom->radius_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	double *radius = atom->radius;
-	for (i = 0; i < nlocal; i++) dchoose[i] = 2.0*radius[i];
-	ptr = dchoose;
-	nstride = 1;
+        if (!atom->radius_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        double *radius = atom->radius;
+        for (i = 0; i < nlocal; i++) dchoose[i] = 2.0*radius[i];
+        ptr = dchoose;
+        nstride = 1;
       } else if (thresh_array[ithresh] == OMEGAX) {
-	if (!atom->omega_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->omega[0][0];
-	nstride = 3;
+        if (!atom->omega_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->omega[0][0];
+        nstride = 3;
       } else if (thresh_array[ithresh] == OMEGAY) {
-	if (!atom->omega_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->omega[0][1];
-	nstride = 3;
+        if (!atom->omega_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->omega[0][1];
+        nstride = 3;
       } else if (thresh_array[ithresh] == OMEGAZ) {
-	if (!atom->omega_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->omega[0][2];
-	nstride = 3;
+        if (!atom->omega_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->omega[0][2];
+        nstride = 3;
       } else if (thresh_array[ithresh] == ANGMOMX) {
-	if (!atom->angmom_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->angmom[0][0];
-	nstride = 3;
+        if (!atom->angmom_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->angmom[0][0];
+        nstride = 3;
       } else if (thresh_array[ithresh] == ANGMOMY) {
-	if (!atom->angmom_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->angmom[0][1];
-	nstride = 3;
+        if (!atom->angmom_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->angmom[0][1];
+        nstride = 3;
       } else if (thresh_array[ithresh] == ANGMOMZ) {
-	if (!atom->angmom_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->angmom[0][2];
-	nstride = 3;
+        if (!atom->angmom_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->angmom[0][2];
+        nstride = 3;
       } else if (thresh_array[ithresh] == TQX) {
-	if (!atom->torque_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->torque[0][0];
-	nstride = 3;
+        if (!atom->torque_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->torque[0][0];
+        nstride = 3;
       } else if (thresh_array[ithresh] == TQY) {
-	if (!atom->torque_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->torque[0][1];
-	nstride = 3;
+        if (!atom->torque_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->torque[0][1];
+        nstride = 3;
       } else if (thresh_array[ithresh] == TQZ) {
-	if (!atom->torque_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
-	ptr = &atom->torque[0][2];
-	nstride = 3;
+        if (!atom->torque_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
+        ptr = &atom->torque[0][2];
+        nstride = 3;
 
       } else if (thresh_array[ithresh] == SPIN) {
-	if (!atom->spin_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
+        if (!atom->spin_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
         int *spin = atom->spin;
         for (i = 0; i < nlocal; i++) dchoose[i] = spin[i];
         ptr = dchoose;
         nstride = 1;
       } else if (thresh_array[ithresh] == ERADIUS) {
-	if (!atom->eradius_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
+        if (!atom->eradius_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
         ptr = atom->eradius;
         nstride = 1;
       } else if (thresh_array[ithresh] == ERVEL) {
-	if (!atom->ervel_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
+        if (!atom->ervel_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
         ptr = atom->ervel;
         nstride = 1;
       } else if (thresh_array[ithresh] == ERFORCE) {
-	if (!atom->erforce_flag)
-	  error->all(FLERR,
-		     "Threshhold for an atom property that isn't allocated");
+        if (!atom->erforce_flag)
+          error->all(FLERR,
+                     "Threshhold for an atom property that isn't allocated");
         ptr = atom->erforce;
-        nstride = 1;				
+        nstride = 1;
 
       } else if (thresh_array[ithresh] == COMPUTE) {
-	i = nfield + ithresh;
-	if (argindex[i] == 0) {
-	  ptr = compute[field2index[i]]->vector_atom;
-	  nstride = 1;
-	} else {
-	  ptr = &compute[field2index[i]]->array_atom[0][argindex[i]-1];
-	  nstride = compute[field2index[i]]->size_peratom_cols;
-	}
+        i = nfield + ithresh;
+        if (argindex[i] == 0) {
+          ptr = compute[field2index[i]]->vector_atom;
+          nstride = 1;
+        } else {
+          ptr = &compute[field2index[i]]->array_atom[0][argindex[i]-1];
+          nstride = compute[field2index[i]]->size_peratom_cols;
+        }
 
       } else if (thresh_array[ithresh] == FIX) {
-	i = nfield + ithresh;
-	if (argindex[i] == 0) {
-	  ptr = fix[field2index[i]]->vector_atom;
-	  nstride = 1;
-	} else {
-	  ptr = &fix[field2index[i]]->array_atom[0][argindex[i]-1];
-	  nstride = fix[field2index[i]]->size_peratom_cols;
-	}
+        i = nfield + ithresh;
+        if (argindex[i] == 0) {
+          ptr = fix[field2index[i]]->vector_atom;
+          nstride = 1;
+        } else {
+          ptr = &fix[field2index[i]]->array_atom[0][argindex[i]-1];
+          nstride = fix[field2index[i]]->size_peratom_cols;
+        }
 
       } else if (thresh_array[ithresh] == VARIABLE) {
-	i = nfield + ithresh;
-	ptr = vbuf[field2index[i]];
-	nstride = 1;
+        i = nfield + ithresh;
+        ptr = vbuf[field2index[i]];
+        nstride = 1;
       }
 
       // unselect atoms that don't meet threshhold criterion
@@ -853,23 +853,23 @@ int DumpCustom::count()
       value = thresh_value[ithresh];
 
       if (thresh_op[ithresh] == LT) {
-	for (i = 0; i < nlocal; i++, ptr += nstride)
-	  if (choose[i] && *ptr >= value) choose[i] = 0;
+        for (i = 0; i < nlocal; i++, ptr += nstride)
+          if (choose[i] && *ptr >= value) choose[i] = 0;
       } else if (thresh_op[ithresh] == LE) {
-	for (i = 0; i < nlocal; i++, ptr += nstride)
-	  if (choose[i] && *ptr > value) choose[i] = 0;
+        for (i = 0; i < nlocal; i++, ptr += nstride)
+          if (choose[i] && *ptr > value) choose[i] = 0;
       } else if (thresh_op[ithresh] == GT) {
-	for (i = 0; i < nlocal; i++, ptr += nstride)
-	  if (choose[i] && *ptr <= value) choose[i] = 0;
+        for (i = 0; i < nlocal; i++, ptr += nstride)
+          if (choose[i] && *ptr <= value) choose[i] = 0;
       } else if (thresh_op[ithresh] == GE) {
-	for (i = 0; i < nlocal; i++, ptr += nstride)
-	  if (choose[i] && *ptr < value) choose[i] = 0;
+        for (i = 0; i < nlocal; i++, ptr += nstride)
+          if (choose[i] && *ptr < value) choose[i] = 0;
       } else if (thresh_op[ithresh] == EQ) {
-	for (i = 0; i < nlocal; i++, ptr += nstride)
-	  if (choose[i] && *ptr != value) choose[i] = 0;
+        for (i = 0; i < nlocal; i++, ptr += nstride)
+          if (choose[i] && *ptr != value) choose[i] = 0;
       } else if (thresh_op[ithresh] == NEQ) {
-	for (i = 0; i < nlocal; i++, ptr += nstride)
-	  if (choose[i] && *ptr == value) choose[i] = 0;
+        for (i = 0; i < nlocal; i++, ptr += nstride)
+          if (choose[i] && *ptr == value) choose[i] = 0;
       }
     }
   }
@@ -924,8 +924,8 @@ void DumpCustom::write_text(int n, double *mybuf)
     for (j = 0; j < size_one; j++) {
       if (vtype[j] == INT) fprintf(fp,vformat[j],static_cast<int> (mybuf[m]));
       else if (vtype[j] == DOUBLE) fprintf(fp,vformat[j],mybuf[m]);
-      else if (vtype[j] == STRING) 
-	fprintf(fp,vformat[j],typenames[(int) mybuf[m]]);
+      else if (vtype[j] == STRING)
+        fprintf(fp,vformat[j],typenames[(int) mybuf[m]]);
       m++;
     }
     fprintf(fp,"\n");
@@ -947,7 +947,7 @@ int DumpCustom::parse_fields(int narg, char **arg)
       vtype[i] = INT;
     } else if (strcmp(arg[iarg],"mol") == 0) {
       if (!atom->molecule_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_molecule;
       vtype[i] = INT;
     } else if (strcmp(arg[iarg],"type") == 0) {
@@ -1036,83 +1036,83 @@ int DumpCustom::parse_fields(int narg, char **arg)
 
     } else if (strcmp(arg[iarg],"q") == 0) {
       if (!atom->q_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_q;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"mux") == 0) {
       if (!atom->mu_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_mux;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"muy") == 0) {
       if (!atom->mu_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_muy;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"muz") == 0) {
       if (!atom->mu_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_muz;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"mu") == 0) {
       if (!atom->mu_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_mu;
       vtype[i] = DOUBLE;
 
     } else if (strcmp(arg[iarg],"radius") == 0) {
       if (!atom->radius_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_radius;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"diameter") == 0) {
       if (!atom->radius_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_diameter;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"omegax") == 0) {
       if (!atom->omega_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_omegax;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"omegay") == 0) {
       if (!atom->omega_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_omegay;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"omegaz") == 0) {
       if (!atom->omega_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_omegaz;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"angmomx") == 0) {
       if (!atom->angmom_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_angmomx;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"angmomy") == 0) {
       if (!atom->angmom_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_angmomy;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"angmomz") == 0) {
       if (!atom->angmom_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_angmomz;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"tqx") == 0) {
       if (!atom->torque_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_tqx;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"tqy") == 0) {
       if (!atom->torque_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_tqy;
       vtype[i] = DOUBLE;
     } else if (strcmp(arg[iarg],"tqz") == 0) {
       if (!atom->torque_flag)
-	error->all(FLERR,"Dumping an atom property that isn't allocated");
+        error->all(FLERR,"Dumping an atom property that isn't allocated");
       pack_choice[i] = &DumpCustom::pack_tqz;
       vtype[i] = DOUBLE;
 
@@ -1150,27 +1150,27 @@ int DumpCustom::parse_fields(int narg, char **arg)
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Invalid attribute in dump custom command");
-	argindex[i] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Invalid attribute in dump custom command");
+        argindex[i] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[i] = 0;
 
       n = modify->find_compute(suffix);
       if (n < 0) error->all(FLERR,"Could not find dump custom compute ID");
       if (modify->compute[n]->peratom_flag == 0)
-	error->all(FLERR,"Dump custom compute does not compute per-atom info");
+        error->all(FLERR,"Dump custom compute does not compute per-atom info");
       if (argindex[i] == 0 && modify->compute[n]->size_peratom_cols > 0)
-	error->all(FLERR,"Dump custom compute does not calculate per-atom vector");
+        error->all(FLERR,"Dump custom compute does not calculate per-atom vector");
       if (argindex[i] > 0 && modify->compute[n]->size_peratom_cols == 0)
-	error->all(FLERR,"Dump custom compute does not calculate per-atom array");
-      if (argindex[i] > 0 && 
-	  argindex[i] > modify->compute[n]->size_peratom_cols)
-	error->all(FLERR,"Dump custom compute vector is accessed out-of-range");
+        error->all(FLERR,"Dump custom compute does not calculate per-atom array");
+      if (argindex[i] > 0 &&
+          argindex[i] > modify->compute[n]->size_peratom_cols)
+        error->all(FLERR,"Dump custom compute vector is accessed out-of-range");
 
       field2index[i] = add_compute(suffix);
       delete [] suffix;
-      
+
     // fix value = f_ID
     // if no trailing [], then arg is set to 0, else arg is between []
 
@@ -1184,23 +1184,23 @@ int DumpCustom::parse_fields(int narg, char **arg)
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Invalid attribute in dump custom command");
-	argindex[i] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Invalid attribute in dump custom command");
+        argindex[i] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[i] = 0;
 
       n = modify->find_fix(suffix);
       if (n < 0) error->all(FLERR,"Could not find dump custom fix ID");
       if (modify->fix[n]->peratom_flag == 0)
-	error->all(FLERR,"Dump custom fix does not compute per-atom info");
+        error->all(FLERR,"Dump custom fix does not compute per-atom info");
       if (argindex[i] == 0 && modify->fix[n]->size_peratom_cols > 0)
-	error->all(FLERR,"Dump custom fix does not compute per-atom vector");
+        error->all(FLERR,"Dump custom fix does not compute per-atom vector");
       if (argindex[i] > 0 && modify->fix[n]->size_peratom_cols == 0)
-	error->all(FLERR,"Dump custom fix does not compute per-atom array");
-      if (argindex[i] > 0 && 
-	  argindex[i] > modify->fix[n]->size_peratom_cols)
-	error->all(FLERR,"Dump custom fix vector is accessed out-of-range");
+        error->all(FLERR,"Dump custom fix does not compute per-atom array");
+      if (argindex[i] > 0 &&
+          argindex[i] > modify->fix[n]->size_peratom_cols)
+        error->all(FLERR,"Dump custom fix vector is accessed out-of-range");
 
       field2index[i] = add_fix(suffix);
       delete [] suffix;
@@ -1220,7 +1220,7 @@ int DumpCustom::parse_fields(int narg, char **arg)
       n = input->variable->find(suffix);
       if (n < 0) error->all(FLERR,"Could not find dump custom variable name");
       if (input->variable->atomstyle(n) == 0)
-	error->all(FLERR,"Dump custom variable is not atom-style variable");
+        error->all(FLERR,"Dump custom variable is not atom-style variable");
 
       field2index[i] = add_variable(suffix);
       delete [] suffix;
@@ -1243,7 +1243,7 @@ int DumpCustom::add_compute(char *id)
   for (icompute = 0; icompute < ncompute; icompute++)
     if (strcmp(id,id_compute[icompute]) == 0) break;
   if (icompute < ncompute) return icompute;
-  
+
   id_compute = (char **)
     memory->srealloc(id_compute,(ncompute+1)*sizeof(char *),"dump:id_compute");
   delete [] compute;
@@ -1268,7 +1268,7 @@ int DumpCustom::add_fix(char *id)
   for (ifix = 0; ifix < nfix; ifix++)
     if (strcmp(id,id_fix[ifix]) == 0) break;
   if (ifix < nfix) return ifix;
-  
+
   id_fix = (char **)
     memory->srealloc(id_fix,(nfix+1)*sizeof(char *),"dump:id_fix");
   delete [] fix;
@@ -1293,10 +1293,10 @@ int DumpCustom::add_variable(char *id)
   for (ivariable = 0; ivariable < nvariable; ivariable++)
     if (strcmp(id,id_variable[ivariable]) == 0) break;
   if (ivariable < nvariable) return ivariable;
-  
+
   id_variable = (char **)
     memory->srealloc(id_variable,(nvariable+1)*sizeof(char *),
-		     "dump:id_variable");
+                     "dump:id_variable");
   delete [] variable;
   variable = new int[nvariable+1];
   delete [] vbuf;
@@ -1319,8 +1319,8 @@ int DumpCustom::modify_param(int narg, char **arg)
     if (strcmp(arg[1],"none") == 0) iregion = -1;
     else {
       iregion = domain->find_region(arg[1]);
-      if (iregion == -1) 
-	error->all(FLERR,"Dump_modify region ID does not exist");
+      if (iregion == -1)
+        error->all(FLERR,"Dump_modify region ID does not exist");
       int n = strlen(arg[1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[1]);
@@ -1351,28 +1351,28 @@ int DumpCustom::modify_param(int narg, char **arg)
     if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     if (strcmp(arg[1],"none") == 0) {
       if (nthresh) {
-	memory->destroy(thresh_array);
-	memory->destroy(thresh_op);
-	memory->destroy(thresh_value);
-	thresh_array = NULL;
-	thresh_op = NULL;
-	thresh_value = NULL;
+        memory->destroy(thresh_array);
+        memory->destroy(thresh_op);
+        memory->destroy(thresh_value);
+        thresh_array = NULL;
+        thresh_op = NULL;
+        thresh_value = NULL;
       }
       nthresh = 0;
       return 2;
     }
 
     if (narg < 4) error->all(FLERR,"Illegal dump_modify command");
-    
+
     // grow threshhold arrays
-    
+
     memory->grow(thresh_array,nthresh+1,"dump:thresh_array");
     memory->grow(thresh_op,(nthresh+1),"dump:thresh_op");
     memory->grow(thresh_value,(nthresh+1),"dump:thresh_value");
 
     // set attribute type of threshhold
     // customize by adding to if statement
-    
+
     if (strcmp(arg[1],"id") == 0) thresh_array[nthresh] = ID;
     else if (strcmp(arg[1],"mol") == 0) thresh_array[nthresh] = MOL;
     else if (strcmp(arg[1],"type") == 0) thresh_array[nthresh] = TYPE;
@@ -1465,32 +1465,32 @@ int DumpCustom::modify_param(int narg, char **arg)
       int n = strlen(arg[1]);
       char *suffix = new char[n];
       strcpy(suffix,&arg[1][2]);
-    
+
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Invalid attribute in dump modify command");
-	argindex[nfield+nthresh] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Invalid attribute in dump modify command");
+        argindex[nfield+nthresh] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[nfield+nthresh] = 0;
-      
+
       n = modify->find_compute(suffix);
       if (n < 0) error->all(FLERR,"Could not find dump modify compute ID");
 
       if (modify->compute[n]->peratom_flag == 0)
-	error->all(FLERR,
-		   "Dump modify compute ID does not compute per-atom info");
-      if (argindex[nfield+nthresh] == 0 && 
-	  modify->compute[n]->size_peratom_cols > 0)
-	error->all(FLERR,
-		   "Dump modify compute ID does not compute per-atom vector");
-      if (argindex[nfield+nthresh] > 0 && 
-	  modify->compute[n]->size_peratom_cols == 0)
-	error->all(FLERR,
-		   "Dump modify compute ID does not compute per-atom array");
-      if (argindex[nfield+nthresh] > 0 && 
-	  argindex[nfield+nthresh] > modify->compute[n]->size_peratom_cols)
-	error->all(FLERR,"Dump modify compute ID vector is not large enough");
+        error->all(FLERR,
+                   "Dump modify compute ID does not compute per-atom info");
+      if (argindex[nfield+nthresh] == 0 &&
+          modify->compute[n]->size_peratom_cols > 0)
+        error->all(FLERR,
+                   "Dump modify compute ID does not compute per-atom vector");
+      if (argindex[nfield+nthresh] > 0 &&
+          modify->compute[n]->size_peratom_cols == 0)
+        error->all(FLERR,
+                   "Dump modify compute ID does not compute per-atom array");
+      if (argindex[nfield+nthresh] > 0 &&
+          argindex[nfield+nthresh] > modify->compute[n]->size_peratom_cols)
+        error->all(FLERR,"Dump modify compute ID vector is not large enough");
 
       field2index[nfield+nthresh] = add_compute(suffix);
       delete [] suffix;
@@ -1506,29 +1506,29 @@ int DumpCustom::modify_param(int narg, char **arg)
       int n = strlen(arg[1]);
       char *suffix = new char[n];
       strcpy(suffix,&arg[1][2]);
-    
+
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Invalid attribute in dump modify command");
-	argindex[nfield+nthresh] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Invalid attribute in dump modify command");
+        argindex[nfield+nthresh] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[nfield+nthresh] = 0;
-      
+
       n = modify->find_fix(suffix);
       if (n < 0) error->all(FLERR,"Could not find dump modify fix ID");
 
       if (modify->fix[n]->peratom_flag == 0)
-	error->all(FLERR,"Dump modify fix ID does not compute per-atom info");
-      if (argindex[nfield+nthresh] == 0 && 
-	  modify->fix[n]->size_peratom_cols > 0)
-	error->all(FLERR,"Dump modify fix ID does not compute per-atom vector");
-      if (argindex[nfield+nthresh] > 0 && 
-	  modify->fix[n]->size_peratom_cols == 0)
-	error->all(FLERR,"Dump modify fix ID does not compute per-atom array");
-      if (argindex[nfield+nthresh] > 0 && 
-	  argindex[nfield+nthresh] > modify->fix[n]->size_peratom_cols)
-	error->all(FLERR,"Dump modify fix ID vector is not large enough");
+        error->all(FLERR,"Dump modify fix ID does not compute per-atom info");
+      if (argindex[nfield+nthresh] == 0 &&
+          modify->fix[n]->size_peratom_cols > 0)
+        error->all(FLERR,"Dump modify fix ID does not compute per-atom vector");
+      if (argindex[nfield+nthresh] > 0 &&
+          modify->fix[n]->size_peratom_cols == 0)
+        error->all(FLERR,"Dump modify fix ID does not compute per-atom array");
+      if (argindex[nfield+nthresh] > 0 &&
+          argindex[nfield+nthresh] > modify->fix[n]->size_peratom_cols)
+        error->all(FLERR,"Dump modify fix ID vector is not large enough");
 
       field2index[nfield+nthresh] = add_fix(suffix);
       delete [] suffix;
@@ -1543,13 +1543,13 @@ int DumpCustom::modify_param(int narg, char **arg)
       int n = strlen(arg[1]);
       char *suffix = new char[n];
       strcpy(suffix,&arg[1][2]);
-    
+
       argindex[nfield+nthresh] = 0;
-      
+
       n = input->variable->find(suffix);
       if (n < 0) error->all(FLERR,"Could not find dump modify variable name");
       if (input->variable->atomstyle(n) == 0)
-	error->all(FLERR,"Dump modify variable is not atom-style variable");
+        error->all(FLERR,"Dump modify variable is not atom-style variable");
 
       field2index[nfield+nthresh] = add_variable(suffix);
       delete [] suffix;
@@ -1803,7 +1803,7 @@ void DumpCustom::pack_xs_triclinic(int n)
 
   for (int i = 0; i < nchoose; i++) {
     j = clist[i];
-    buf[n] = h_inv[0]*(x[j][0]-boxlo[0]) + h_inv[5]*(x[j][1]-boxlo[1]) + 
+    buf[n] = h_inv[0]*(x[j][0]-boxlo[0]) + h_inv[5]*(x[j][1]-boxlo[1]) +
       h_inv[4]*(x[j][2]-boxlo[2]);
     n += size_one;
   }
@@ -2019,7 +2019,7 @@ void DumpCustom::pack_xsu_triclinic(int n)
 
   for (int i = 0; i < nchoose; i++) {
     j = clist[i];
-    buf[n] = h_inv[0]*(x[j][0]-boxlo[0]) + h_inv[5]*(x[j][1]-boxlo[1]) + 
+    buf[n] = h_inv[0]*(x[j][0]-boxlo[0]) + h_inv[5]*(x[j][1]-boxlo[1]) +
       h_inv[4]*(x[j][2]-boxlo[2]) + (image[j] & 1023) - 512;
     n += size_one;
   }
@@ -2367,7 +2367,7 @@ void DumpCustom::pack_tqz(int n)
 void DumpCustom::pack_spin(int n)
 {
   int *spin = atom->spin;
-  
+
   for (int i = 0; i < nchoose; i++) {
     buf[n] = spin[clist[i]];
     n += size_one;
diff --git a/src/dump_custom.h b/src/dump_custom.h
index 1679aaf125..00b5bb4dab 100644
--- a/src/dump_custom.h
+++ b/src/dump_custom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -70,7 +70,7 @@ class DumpCustom : public Dump {
   double **vbuf;             // local storage for variable evaluation
 
   int ntypes;                // # of atom types
-  char **typenames;	     // array of element names for each type
+  char **typenames;             // array of element names for each type
 
   // private methods
 
diff --git a/src/dump_dcd.cpp b/src/dump_dcd.cpp
index 6512229735..a758f1a6e8 100644
--- a/src/dump_dcd.cpp
+++ b/src/dump_dcd.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,7 +64,7 @@ DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg)
 
   unwrap_flag = 0;
   format_default = NULL;
-    
+
   // allocate global array for atom coords
 
   bigint n = group->count(igroup);
@@ -162,11 +162,11 @@ void DumpDCD::write_header(bigint n)
     dim[5] = domain->zprd;
     dim[1] = dim[3] = dim[4] = 0.0;
   }
-  
+
   if (me == 0) {
     uint32_t out_integer = 48;
     fwrite_int32(fp,out_integer);
-    fwrite(dim,out_integer,1,fp); 
+    fwrite(dim,out_integer,1,fp);
     fwrite_int32(fp,out_integer);
     if (flush_flag) fflush(fp);
   }
@@ -195,30 +195,30 @@ void DumpDCD::pack(int *ids)
 
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	int ix = (image[i] & 1023) - 512;
-	int iy = (image[i] >> 10 & 1023) - 512;
-	int iz = (image[i] >> 20) - 512;
-
-	if (domain->triclinic) {
-	  buf[m++] = x[i][0] + ix * xprd + iy * xy + iz * xz;
-	  buf[m++] = x[i][1] + iy * yprd + iz * yz;
-	  buf[m++] = x[i][2] + iz * zprd;
-	} else {
-	  buf[m++] = x[i][0] + ix * xprd;
-	  buf[m++] = x[i][1] + iy * yprd;
-	  buf[m++] = x[i][2] + iz * zprd;
-	}
-	ids[n++] = tag[i];
+        int ix = (image[i] & 1023) - 512;
+        int iy = (image[i] >> 10 & 1023) - 512;
+        int iz = (image[i] >> 20) - 512;
+
+        if (domain->triclinic) {
+          buf[m++] = x[i][0] + ix * xprd + iy * xy + iz * xz;
+          buf[m++] = x[i][1] + iy * yprd + iz * yz;
+          buf[m++] = x[i][2] + iz * zprd;
+        } else {
+          buf[m++] = x[i][0] + ix * xprd;
+          buf[m++] = x[i][1] + iy * yprd;
+          buf[m++] = x[i][2] + iz * zprd;
+        }
+        ids[n++] = tag[i];
       }
     }
 
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	buf[m++] = x[i][0];
-	buf[m++] = x[i][1];
-	buf[m++] = x[i][2];
-	ids[n++] = tag[i];
+        buf[m++] = x[i][0];
+        buf[m++] = x[i][1];
+        buf[m++] = x[i][2];
+        ids[n++] = tag[i];
       }
   }
 }
@@ -286,7 +286,7 @@ void DumpDCD::write_frame()
   fwrite_int32(fp,out_integer);
   fwrite(zf,out_integer,1,fp);
   fwrite_int32(fp,out_integer);
-  
+
   // update NFILE and NSTEP fields in DCD header
 
   nframes++;
@@ -319,7 +319,7 @@ void DumpDCD::write_dcd_header(const char *remarks)
   fwrite_int32(fp,ntimestep);            // START = timestep of first snapshot
   fwrite_int32(fp,nevery_save);          // SKIP = interval between snapshots
   fwrite_int32(fp,ntimestep);            // NSTEP = timestep of last snapshot
-  fwrite_int32(fp,0);			 // NAMD writes NSTEP or ISTART
+  fwrite_int32(fp,0);                         // NAMD writes NSTEP or ISTART
   fwrite_int32(fp,0);
   fwrite_int32(fp,0);
   fwrite_int32(fp,0);
diff --git a/src/dump_dcd.h b/src/dump_dcd.h
index 6915068579..a5b88f3caf 100644
--- a/src/dump_dcd.h
+++ b/src/dump_dcd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/dump_image.cpp b/src/dump_image.cpp
index d30db48a34..c06b35e6c2 100644
--- a/src/dump_image.cpp
+++ b/src/dump_image.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -42,7 +42,7 @@ enum{NO,YES};
 
 /* ---------------------------------------------------------------------- */
 
-DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : 
+DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
   DumpCustom(lmp, narg, arg)
 {
   if (binary || multiproc) error->all(FLERR,"Invalid dump image filename");
@@ -127,16 +127,16 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"bond") == 0) {
       if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
       if (atom->nbondtypes == 0)
-	error->all(FLERR,"Dump image bond not allowed with no bond types");
+        error->all(FLERR,"Dump image bond not allowed with no bond types");
       bondflag = YES;
       if (strcmp(arg[iarg+1],"none") == 0) bondflag = NO;
       else if (strcmp(arg[iarg+1],"atom") == 0) bcolor = ATOM;
       else if (strcmp(arg[iarg+1],"type") == 0) bcolor = TYPE;
       else error->all(FLERR,"Illegal dump image command");
       if (!islower(arg[iarg+2][0])) {
-	  bdiam = NUMERIC;
-	  bdiamvalue = atof(arg[iarg+2]);
-	  if (bdiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
+          bdiam = NUMERIC;
+          bdiamvalue = atof(arg[iarg+2]);
+          if (bdiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command");
       } else if (strcmp(arg[iarg+2],"atom") == 0) bdiam = ATOM;
       else if (strcmp(arg[iarg+2],"type") == 0) bdiam = TYPE;
       else if (strcmp(arg[iarg+2],"none") == 0) bondflag = NO;
@@ -147,8 +147,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
       if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
       int width = atoi(arg[iarg+1]);
       int height = atoi(arg[iarg+2]);
-      if (width <= 0 || height <= 0) 
-	error->all(FLERR,"Illegal dump image command");
+      if (width <= 0 || height <= 0)
+        error->all(FLERR,"Illegal dump image command");
       image->width = width;
       image->height = height;
       iarg += 3;
@@ -156,24 +156,24 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"view") == 0) {
       if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	thetastr = new char[n];
-	strcpy(thetastr,&arg[iarg+1][2]);
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        thetastr = new char[n];
+        strcpy(thetastr,&arg[iarg+1][2]);
       } else {
-	double theta = atof(arg[iarg+1]);
-	if (theta < 0.0 || theta > 180.0)
-	  error->all(FLERR,"Invalid dump image theta value");
-	theta *= MY_PI/180.0;
-	image->theta = theta;
+        double theta = atof(arg[iarg+1]);
+        if (theta < 0.0 || theta > 180.0)
+          error->all(FLERR,"Invalid dump image theta value");
+        theta *= MY_PI/180.0;
+        image->theta = theta;
       }
       if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
-	int n = strlen(&arg[iarg+2][2]) + 1;
-	phistr = new char[n];
-	strcpy(phistr,&arg[iarg+2][2]);
+        int n = strlen(&arg[iarg+2][2]) + 1;
+        phistr = new char[n];
+        strcpy(phistr,&arg[iarg+2][2]);
       } else {
-	double phi = atof(arg[iarg+2]);
-	phi *= MY_PI/180.0;
-	image->phi = phi;
+        double phi = atof(arg[iarg+2]);
+        phi *= MY_PI/180.0;
+        image->phi = phi;
       }
       iarg += 3;
 
@@ -183,54 +183,54 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
       else if (strcmp(arg[iarg+1],"d") == 0) cflag = DYNAMIC;
       else error->all(FLERR,"Illegal dump image command");
       if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
-	int n = strlen(&arg[iarg+2][2]) + 1;
-	cxstr = new char[n];
-	strcpy(cxstr,&arg[iarg+2][2]);
-	cflag = DYNAMIC;
+        int n = strlen(&arg[iarg+2][2]) + 1;
+        cxstr = new char[n];
+        strcpy(cxstr,&arg[iarg+2][2]);
+        cflag = DYNAMIC;
       } else cx = atof(arg[iarg+2]);
       if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
-	int n = strlen(&arg[iarg+3][2]) + 1;
-	cystr = new char[n];
-	strcpy(cystr,&arg[iarg+3][2]);
-	cflag = DYNAMIC;
+        int n = strlen(&arg[iarg+3][2]) + 1;
+        cystr = new char[n];
+        strcpy(cystr,&arg[iarg+3][2]);
+        cflag = DYNAMIC;
       } else cy = atof(arg[iarg+3]);
       if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
-	int n = strlen(&arg[iarg+4][2]) + 1;
-	czstr = new char[n];
-	strcpy(czstr,&arg[iarg+4][2]);
-	cflag = DYNAMIC;
+        int n = strlen(&arg[iarg+4][2]) + 1;
+        czstr = new char[n];
+        strcpy(czstr,&arg[iarg+4][2]);
+        cflag = DYNAMIC;
       } else cz = atof(arg[iarg+4]);
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"up") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal dump image command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	upxstr = new char[n];
-	strcpy(upxstr,&arg[iarg+1][2]);
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        upxstr = new char[n];
+        strcpy(upxstr,&arg[iarg+1][2]);
       } else image->up[0] = atof(arg[iarg+1]);
       if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
-	int n = strlen(&arg[iarg+2][2]) + 1;
-	upystr = new char[n];
-	strcpy(upystr,&arg[iarg+2][2]);
+        int n = strlen(&arg[iarg+2][2]) + 1;
+        upystr = new char[n];
+        strcpy(upystr,&arg[iarg+2][2]);
       } else image->up[1] = atof(arg[iarg+2]);
       if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
-	int n = strlen(&arg[iarg+3][2]) + 1;
-	upzstr = new char[n];
-	strcpy(upzstr,&arg[iarg+3][2]);
+        int n = strlen(&arg[iarg+3][2]) + 1;
+        upzstr = new char[n];
+        strcpy(upzstr,&arg[iarg+3][2]);
       } else image->up[2] = atof(arg[iarg+3]);
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"zoom") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	zoomstr = new char[n];
-	strcpy(zoomstr,&arg[iarg+1][2]);
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        zoomstr = new char[n];
+        strcpy(zoomstr,&arg[iarg+1][2]);
       } else {
-	double zoom = atof(arg[iarg+1]);
-	if (zoom <= 0.0) error->all(FLERR,"Illegal dump image command");
-	image->zoom = zoom;
+        double zoom = atof(arg[iarg+1]);
+        if (zoom <= 0.0) error->all(FLERR,"Illegal dump image command");
+        image->zoom = zoom;
       }
       iarg += 2;
 
@@ -238,13 +238,13 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
       error->all(FLERR,"Dump image persp option is not yet supported");
       if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	perspstr = new char[n];
-	strcpy(perspstr,&arg[iarg+1][2]);
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        perspstr = new char[n];
+        strcpy(perspstr,&arg[iarg+1][2]);
       } else {
-	double persp = atof(arg[iarg+1]);
-	if (persp < 0.0) error->all(FLERR,"Illegal dump image command");
-	image->persp = persp;
+        double persp = atof(arg[iarg+1]);
+        if (persp < 0.0) error->all(FLERR,"Illegal dump image command");
+        image->persp = persp;
       }
       iarg += 2;
 
@@ -265,14 +265,14 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
       axeslen = atof(arg[iarg+2]);
       axesdiam = atof(arg[iarg+3]);
       if (axeslen < 0.0 || axesdiam < 0.0)
-	error->all(FLERR,"Illegal dump image command");
+        error->all(FLERR,"Illegal dump image command");
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"shiny") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command");
       double shiny = atof(arg[iarg+1]);
       if (shiny < 0.0 || shiny > 1.0)
-	error->all(FLERR,"Illegal dump image command");
+        error->all(FLERR,"Illegal dump image command");
       image->shiny = shiny;
       iarg += 2;
 
@@ -286,7 +286,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
       image->seed = seed;
       double ssaoint = atof(arg[iarg+3]);
       if (ssaoint < 0.0 || ssaoint > 1.0)
-	error->all(FLERR,"Illegal dump image command");
+        error->all(FLERR,"Illegal dump image command");
       image->ssaoint = ssaoint;
       iarg += 4;
 
@@ -341,7 +341,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) :
   // viewflag = DYNAMIC if any view parameter is dynamic
 
   viewflag = STATIC;
-  if (thetastr || phistr || cflag == DYNAMIC || 
+  if (thetastr || phistr || cflag == DYNAMIC ||
       upxstr || upystr || upzstr || zoomstr || perspstr) viewflag = DYNAMIC;
 
   box_bounds();
@@ -372,7 +372,7 @@ DumpImage::~DumpImage()
 
 void DumpImage::init_style()
 {
-  if (multifile == 0) 
+  if (multifile == 0)
     error->all(FLERR,"Dump image requires one snapshot per file");
   if (sort_flag) error->all(FLERR,"Dump image cannot perform sorting");
 
@@ -382,70 +382,70 @@ void DumpImage::init_style()
 
   if (thetastr) {
     thetavar = input->variable->find(thetastr);
-    if (thetavar < 0) 
+    if (thetavar < 0)
       error->all(FLERR,"Variable name for dump image theta does not exist");
     if (!input->variable->equalstyle(thetavar))
       error->all(FLERR,"Variable for dump image theta is invalid style");
   }
   if (phistr) {
     phivar = input->variable->find(phistr);
-    if (phivar < 0) 
+    if (phivar < 0)
       error->all(FLERR,"Variable name for dump image phi does not exist");
     if (!input->variable->equalstyle(phivar))
       error->all(FLERR,"Variable for dump image phi is invalid style");
   }
   if (cxstr) {
     cxvar = input->variable->find(cxstr);
-    if (cxvar < 0) 
+    if (cxvar < 0)
       error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(cxvar))
       error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (cystr) {
     cyvar = input->variable->find(cystr);
-    if (cyvar < 0) 
+    if (cyvar < 0)
       error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(cyvar))
       error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (czstr) {
     czvar = input->variable->find(czstr);
-    if (czvar < 0) 
+    if (czvar < 0)
       error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(czvar))
       error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (upxstr) {
     upxvar = input->variable->find(upxstr);
-    if (upxvar < 0) 
+    if (upxvar < 0)
       error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(upxvar))
       error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (upystr) {
     upyvar = input->variable->find(upystr);
-    if (upyvar < 0) 
+    if (upyvar < 0)
       error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(upyvar))
       error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (upzstr) {
     upzvar = input->variable->find(upzstr);
-    if (upzvar < 0) 
+    if (upzvar < 0)
       error->all(FLERR,"Variable name for dump image center does not exist");
     if (!input->variable->equalstyle(upzvar))
       error->all(FLERR,"Variable for dump image center is invalid style");
   }
   if (zoomstr) {
     zoomvar = input->variable->find(zoomstr);
-    if (zoomvar < 0) 
+    if (zoomvar < 0)
       error->all(FLERR,"Variable name for dump image zoom does not exist");
     if (!input->variable->equalstyle(zoomvar))
       error->all(FLERR,"Variable for dump image zoom is invalid style");
   }
   if (perspstr) {
     perspvar = input->variable->find(perspstr);
-    if (perspvar < 0) 
+    if (perspvar < 0)
       error->all(FLERR,"Variable name for dump image persp does not exist");
     if (!input->variable->equalstyle(perspvar))
       error->all(FLERR,"Variable for dump image persp is invalid style");
@@ -457,7 +457,7 @@ void DumpImage::init_style()
     for (int i = 1; i <= ntypes; i++) {
       colorelement[i] = image->element2color(typenames[i]);
       if (colorelement[i] == NULL)
-	error->all(FLERR,"Invalid dump image element name");
+        error->all(FLERR,"Invalid dump image element name");
     }
   }
 
@@ -465,7 +465,7 @@ void DumpImage::init_style()
     for (int i = 1; i <= ntypes; i++) {
       diamelement[i] = image->element2diam(typenames[i]);
       if (diamelement[i] == 0.0)
-	error->all(FLERR,"Invalid dump image element name");
+        error->all(FLERR,"Invalid dump image element name");
     }
   }
 }
@@ -488,7 +488,7 @@ void DumpImage::write()
   // pack buf with x,y,z,color,diameter
   // set minmax color range if using color map
   // create my portion of image for my particles
-  
+
   nme = count();
 
   if (nme > maxbuf) {
@@ -602,7 +602,7 @@ void DumpImage::view_params()
 
 /* ----------------------------------------------------------------------
    create image for atoms on this proc
-   every pixel has depth 
+   every pixel has depth
 ------------------------------------------------------------------------- */
 
 void DumpImage::create_image()
@@ -620,27 +620,27 @@ void DumpImage::create_image()
     m = 0;
     for (i = 0; i < nchoose; i++) {
       j = clist[i];
-      
+
       if (acolor == TYPE) {
-	itype = static_cast<int> (buf[m]);
-	color = colortype[itype];
+        itype = static_cast<int> (buf[m]);
+        color = colortype[itype];
       } else if (acolor == ELEMENT) {
-	itype = static_cast<int> (buf[m]);
-	color = colorelement[itype];
+        itype = static_cast<int> (buf[m]);
+        color = colorelement[itype];
       } else if (acolor == ATTRIBUTE) {
-	color = image->value2color(buf[m]);
+        color = image->value2color(buf[m]);
       }
 
       if (adiam == NUMERIC) {
-	diameter = adiamvalue;
+        diameter = adiamvalue;
       } else if (adiam == TYPE) {
-	itype = static_cast<int> (buf[m+1]);
-	diameter = diamtype[itype];
+        itype = static_cast<int> (buf[m+1]);
+        diameter = diamtype[itype];
       } else if (adiam == ELEMENT) {
-	itype = static_cast<int> (buf[m+1]);
-	diameter = diamelement[itype];
+        itype = static_cast<int> (buf[m+1]);
+        diameter = diamelement[itype];
       } else if (adiam == ATTRIBUTE) {
-	diameter = buf[m+1];
+        diameter = buf[m+1];
       }
 
       image->draw_sphere(x[j],color,diameter);
@@ -671,18 +671,18 @@ void DumpImage::create_image()
 
     if (comm_forward == 3) {
       if (nall > maxbufcopy) {
-	maxbufcopy = atom->nmax;
-	memory->destroy(bufcopy);
-	memory->create(bufcopy,maxbufcopy,2,"dump:bufcopy");
+        maxbufcopy = atom->nmax;
+        memory->destroy(bufcopy);
+        memory->create(bufcopy,maxbufcopy,2,"dump:bufcopy");
       }
 
       for (i = 0; i < nlocal; i++) bufcopy[i][0] = bufcopy[i][1] = 0.0;
       m = 0;
       for (i = 0; i < nchoose; i++) {
-	j = clist[i];
-	bufcopy[j][0] = buf[m];
-	bufcopy[j][1] = buf[m+1];
-	m += size_one;
+        j = clist[i];
+        bufcopy[j][0] = buf[m];
+        bufcopy[j][1] = buf[m+1];
+        m += size_one;
       }
     }
 
@@ -691,69 +691,69 @@ void DumpImage::create_image()
     for (i = 0; i < nchoose; i++) {
       atom1 = clist[i];
       for (m = 0; m < num_bond[atom1]; m++) {
-	atom2 = atom->map(bond_atom[atom1][m]);
-	if (atom2 < 0 || !choose[atom2]) continue;
-	if (newton_bond == 0 && tag[atom1] > tag[atom2]) continue;
-	if (bond_type[atom1][m] == 0) continue;
-
-	if (bcolor == ATOM) {
-	  if (acolor == TYPE) {
-	    color1 = colortype[type[atom1]];
-	    color2 = colortype[type[atom2]];
-	  } else if (acolor == ELEMENT) {
-	    color1 = colorelement[type[atom1]];
-	    color2 = colorelement[type[atom2]];
-	  } else if (acolor == ATTRIBUTE) {
-	    color1 = image->value2color(bufcopy[atom1][0]);
-	    color2 = image->value2color(bufcopy[atom2][0]);
-	  }
-	} else if (bcolor == TYPE) {
-	  itype = bond_type[atom1][m];
-	  if (itype < 0) itype = -itype;
-	  color = bcolortype[itype];
-	}
-
-	if (bdiam == NUMERIC) {
-	  diameter = bdiamvalue;
-	} else if (bdiam == ATOM) {
-	  if (adiam == NUMERIC) {
-	    diameter = adiamvalue;
-	  } else if (adiam == TYPE) {
-	    diameter = MIN(diamtype[type[atom1]],diamtype[type[atom1]]);
-	  } else if (adiam == ELEMENT) {
-	    diameter = MIN(diamelement[type[atom1]],diamelement[type[atom1]]);
-	  } else if (adiam == ATTRIBUTE) {
-	    diameter = MIN(bufcopy[atom1][1],bufcopy[atom2][1]);
-	  }
-	} else if (bdiam == TYPE) {
-	  itype = bond_type[atom1][m];
-	  if (itype < 0) itype = -itype;
-	  diameter = bdiamtype[itype];
-	}
-
-	// draw cylinder in 2 pieces if bcolor = ATOM
-	// or bond crosses periodic boundary
-
-	delx = x[atom2][0] - x[atom1][0];
-	dely = x[atom2][1] - x[atom1][1];
-	delz = x[atom2][2] - x[atom1][2];
-
-	if (bcolor == ATOM || domain->minimum_image_check(delx,dely,delz)) {
-	  domain->minimum_image(delx,dely,delz);
-	  xmid[0] = x[atom1][0] + 0.5*delx;
-	  xmid[1] = x[atom1][1] + 0.5*dely;
-	  xmid[2] = x[atom1][2] + 0.5*delz;
-	  if (bcolor == ATOM) 
-	    image->draw_cylinder(x[atom1],xmid,color1,diameter,3);
-	  else image->draw_cylinder(x[atom1],xmid,color,diameter,3);
-	  xmid[0] = x[atom2][0] - 0.5*delx;
-	  xmid[1] = x[atom2][1] - 0.5*dely;
-	  xmid[2] = x[atom2][2] - 0.5*delz;
-	  if (bcolor == ATOM) 
-	    image->draw_cylinder(xmid,x[atom2],color2,diameter,3);
-	  else image->draw_cylinder(xmid,x[atom2],color,diameter,3);
-
-	} else image->draw_cylinder(x[atom1],x[atom2],color,diameter,3);
+        atom2 = atom->map(bond_atom[atom1][m]);
+        if (atom2 < 0 || !choose[atom2]) continue;
+        if (newton_bond == 0 && tag[atom1] > tag[atom2]) continue;
+        if (bond_type[atom1][m] == 0) continue;
+
+        if (bcolor == ATOM) {
+          if (acolor == TYPE) {
+            color1 = colortype[type[atom1]];
+            color2 = colortype[type[atom2]];
+          } else if (acolor == ELEMENT) {
+            color1 = colorelement[type[atom1]];
+            color2 = colorelement[type[atom2]];
+          } else if (acolor == ATTRIBUTE) {
+            color1 = image->value2color(bufcopy[atom1][0]);
+            color2 = image->value2color(bufcopy[atom2][0]);
+          }
+        } else if (bcolor == TYPE) {
+          itype = bond_type[atom1][m];
+          if (itype < 0) itype = -itype;
+          color = bcolortype[itype];
+        }
+
+        if (bdiam == NUMERIC) {
+          diameter = bdiamvalue;
+        } else if (bdiam == ATOM) {
+          if (adiam == NUMERIC) {
+            diameter = adiamvalue;
+          } else if (adiam == TYPE) {
+            diameter = MIN(diamtype[type[atom1]],diamtype[type[atom1]]);
+          } else if (adiam == ELEMENT) {
+            diameter = MIN(diamelement[type[atom1]],diamelement[type[atom1]]);
+          } else if (adiam == ATTRIBUTE) {
+            diameter = MIN(bufcopy[atom1][1],bufcopy[atom2][1]);
+          }
+        } else if (bdiam == TYPE) {
+          itype = bond_type[atom1][m];
+          if (itype < 0) itype = -itype;
+          diameter = bdiamtype[itype];
+        }
+
+        // draw cylinder in 2 pieces if bcolor = ATOM
+        // or bond crosses periodic boundary
+
+        delx = x[atom2][0] - x[atom1][0];
+        dely = x[atom2][1] - x[atom1][1];
+        delz = x[atom2][2] - x[atom1][2];
+
+        if (bcolor == ATOM || domain->minimum_image_check(delx,dely,delz)) {
+          domain->minimum_image(delx,dely,delz);
+          xmid[0] = x[atom1][0] + 0.5*delx;
+          xmid[1] = x[atom1][1] + 0.5*dely;
+          xmid[2] = x[atom1][2] + 0.5*delz;
+          if (bcolor == ATOM)
+            image->draw_cylinder(x[atom1],xmid,color1,diameter,3);
+          else image->draw_cylinder(x[atom1],xmid,color,diameter,3);
+          xmid[0] = x[atom2][0] - 0.5*delx;
+          xmid[1] = x[atom2][1] - 0.5*dely;
+          xmid[2] = x[atom2][2] - 0.5*delz;
+          if (bcolor == ATOM)
+            image->draw_cylinder(xmid,x[atom2],color2,diameter,3);
+          else image->draw_cylinder(xmid,x[atom2],color,diameter,3);
+
+        } else image->draw_cylinder(x[atom1],x[atom2],color,diameter,3);
       }
     }
   }
@@ -803,17 +803,17 @@ void DumpImage::create_image()
     } else {
       domain->box_corners();
       boxcorners = domain->corners;
-      axes[0][0] = boxcorners[0][0]; 
-      axes[0][1] = boxcorners[0][1]; 
+      axes[0][0] = boxcorners[0][0];
+      axes[0][1] = boxcorners[0][1];
       axes[0][2] = boxcorners[0][2];
-      axes[1][0] = boxcorners[1][0]; 
-      axes[1][1] = boxcorners[1][1]; 
+      axes[1][0] = boxcorners[1][0];
+      axes[1][1] = boxcorners[1][1];
       axes[1][2] = boxcorners[1][2];
-      axes[2][0] = boxcorners[2][0]; 
-      axes[2][1] = boxcorners[2][1]; 
+      axes[2][0] = boxcorners[2][0];
+      axes[2][1] = boxcorners[2][1];
       axes[2][2] = boxcorners[2][2];
-      axes[3][0] = boxcorners[4][0]; 
-      axes[3][1] = boxcorners[4][1]; 
+      axes[3][0] = boxcorners[4][0];
+      axes[3][1] = boxcorners[4][1];
       axes[3][2] = boxcorners[4][2];
     }
 
@@ -917,7 +917,7 @@ int DumpImage::modify_param(int narg, char **arg)
     for (int i = nlo; i <= nhi; i++) {
       colortype[i] = image->color2rgb(ptrs[m%ncount]);
       if (colortype[i] == NULL)
-	error->all(FLERR,"Invalid color in dump_modify command");
+        error->all(FLERR,"Invalid color in dump_modify command");
       m++;
     }
 
@@ -970,21 +970,21 @@ int DumpImage::modify_param(int narg, char **arg)
     ptrs[ncount++] = strtok(arg[2],"/");
     while (ptrs[ncount++] = strtok(NULL,"/"));
     ncount--;
-    
+
     // assign each of ncount colors in round-robin fashion to types
-    
+
     int m = 0;
     for (int i = nlo; i <= nhi; i++) {
       bcolortype[i] = image->color2rgb(ptrs[m%ncount]);
       if (bcolortype[i] == NULL)
-	error->all(FLERR,"Invalid color in dump_modify command");
+        error->all(FLERR,"Invalid color in dump_modify command");
       m++;
     }
-    
+
     delete [] ptrs;
     return 3;
   }
-    
+
   if (strcmp(arg[0],"bdiam") == 0) {
     if (narg < 3) error->all(FLERR,"Illegal dump_modify command");
     if (atom->nbondtypes == 0)
@@ -1010,7 +1010,7 @@ int DumpImage::modify_param(int narg, char **arg)
   if (strcmp(arg[0],"boxcolor") == 0) {
     if (narg < 2) error->all(FLERR,"Illegal dump_modify command");
     image->boxcolor = image->color2rgb(arg[1]);
-    if (image->boxcolor == NULL) 
+    if (image->boxcolor == NULL)
       error->all(FLERR,"Invalid color in dump_modify command");
     return 2;
   }
diff --git a/src/dump_image.h b/src/dump_image.h
index fe9ad7f13c..f8ea748d93 100644
--- a/src/dump_image.h
+++ b/src/dump_image.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/dump_local.cpp b/src/dump_local.cpp
index f44781194a..331ee1e4d4 100644
--- a/src/dump_local.cpp
+++ b/src/dump_local.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -32,7 +32,7 @@ enum{INT,DOUBLE};
 
 /* ---------------------------------------------------------------------- */
 
-DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : 
+DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) :
   Dump(lmp, narg, arg)
 {
   if (narg == 5) error->all(FLERR,"No dump local arguments specified");
@@ -209,8 +209,8 @@ int DumpLocal::count()
   if (ncompute) {
     for (i = 0; i < ncompute; i++) {
       if (!(compute[i]->invoked_flag & INVOKED_LOCAL)) {
-	compute[i]->compute_local();
-	compute[i]->invoked_flag |= INVOKED_LOCAL;
+        compute[i]->compute_local();
+        compute[i]->invoked_flag |= INVOKED_LOCAL;
       }
     }
   }
@@ -289,27 +289,27 @@ void DumpLocal::parse_fields(int narg, char **arg)
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Invalid attribute in dump local command");
-	argindex[i] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Invalid attribute in dump local command");
+        argindex[i] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[i] = 0;
 
       n = modify->find_compute(suffix);
       if (n < 0) error->all(FLERR,"Could not find dump local compute ID");
       if (modify->compute[n]->local_flag == 0)
-	error->all(FLERR,"Dump local compute does not compute local info");
+        error->all(FLERR,"Dump local compute does not compute local info");
       if (argindex[i] == 0 && modify->compute[n]->size_local_cols > 0)
-	error->all(FLERR,"Dump local compute does not calculate local vector");
+        error->all(FLERR,"Dump local compute does not calculate local vector");
       if (argindex[i] > 0 && modify->compute[n]->size_local_cols == 0)
-	error->all(FLERR,"Dump local compute does not calculate local array");
-      if (argindex[i] > 0 && 
-	  argindex[i] > modify->compute[n]->size_local_cols)
-	error->all(FLERR,"Dump local compute vector is accessed out-of-range");
+        error->all(FLERR,"Dump local compute does not calculate local array");
+      if (argindex[i] > 0 &&
+          argindex[i] > modify->compute[n]->size_local_cols)
+        error->all(FLERR,"Dump local compute vector is accessed out-of-range");
 
       field2index[i] = add_compute(suffix);
       delete [] suffix;
-      
+
     // fix value = f_ID
     // if no trailing [], then arg is set to 0, else arg is between []
 
@@ -324,23 +324,23 @@ void DumpLocal::parse_fields(int narg, char **arg)
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Invalid attribute in dump local command");
-	argindex[i] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Invalid attribute in dump local command");
+        argindex[i] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[i] = 0;
 
       n = modify->find_fix(suffix);
       if (n < 0) error->all(FLERR,"Could not find dump local fix ID");
       if (modify->fix[n]->local_flag == 0)
-	error->all(FLERR,"Dump local fix does not compute local info");
+        error->all(FLERR,"Dump local fix does not compute local info");
       if (argindex[i] == 0 && modify->fix[n]->size_local_cols > 0)
-	error->all(FLERR,"Dump local fix does not compute local vector");
+        error->all(FLERR,"Dump local fix does not compute local vector");
       if (argindex[i] > 0 && modify->fix[n]->size_local_cols == 0)
-	error->all(FLERR,"Dump local fix does not compute local array");
-      if (argindex[i] > 0 && 
-	  argindex[i] > modify->fix[n]->size_local_cols)
-	error->all(FLERR,"Dump local fix vector is accessed out-of-range");
+        error->all(FLERR,"Dump local fix does not compute local array");
+      if (argindex[i] > 0 &&
+          argindex[i] > modify->fix[n]->size_local_cols)
+        error->all(FLERR,"Dump local fix vector is accessed out-of-range");
 
       field2index[i] = add_fix(suffix);
       delete [] suffix;
@@ -364,7 +364,7 @@ int DumpLocal::add_compute(char *id)
   for (icompute = 0; icompute < ncompute; icompute++)
     if (strcmp(id,id_compute[icompute]) == 0) break;
   if (icompute < ncompute) return icompute;
-  
+
   id_compute = (char **)
     memory->srealloc(id_compute,(ncompute+1)*sizeof(char *),"dump:id_compute");
   delete [] compute;
@@ -389,7 +389,7 @@ int DumpLocal::add_fix(char *id)
   for (ifix = 0; ifix < nfix; ifix++)
     if (strcmp(id,id_fix[ifix]) == 0) break;
   if (ifix < nfix) return ifix;
-  
+
   id_fix = (char **)
     memory->srealloc(id_fix,(nfix+1)*sizeof(char *),"dump:id_fix");
   delete [] fix;
diff --git a/src/dump_local.h b/src/dump_local.h
index 8fe10ca136..75ea54c8e3 100644
--- a/src/dump_local.h
+++ b/src/dump_local.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/dump_xyz.cpp b/src/dump_xyz.cpp
index 8d9cd6b151..65504b6798 100644
--- a/src/dump_xyz.cpp
+++ b/src/dump_xyz.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -98,7 +98,7 @@ int DumpXYZ::modify_param(int narg, char **arg)
 
     if (typenames) {
       for (int i = 1; i <= ntypes; i++)
-	delete [] typenames[i];
+        delete [] typenames[i];
 
       delete [] typenames;
       typenames = NULL;
@@ -158,8 +158,8 @@ void DumpXYZ::write_data(int n, double *mybuf)
   int m = 0;
   for (int i = 0; i < n; i++) {
     fprintf(fp,format,
-	    typenames[static_cast<int> (mybuf[m+1])],
-	    mybuf[m+2],mybuf[m+3],mybuf[m+4]);
+            typenames[static_cast<int> (mybuf[m+1])],
+            mybuf[m+2],mybuf[m+3],mybuf[m+4]);
     m += size_one;
   }
 }
diff --git a/src/dump_xyz.h b/src/dump_xyz.h
index 4824ed6df4..eab50b8215 100644
--- a/src/dump_xyz.h
+++ b/src/dump_xyz.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/error.cpp b/src/error.cpp
index 3686ab3ecf..6c4fb2e062 100644
--- a/src/error.cpp
+++ b/src/error.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,9 +35,9 @@ void Error::universe_all(const char *file, int line, const char *str)
 
   if (universe->me == 0) {
     if (universe->uscreen) fprintf(universe->uscreen,
-				   "ERROR: %s (%s:%d)\n",str,file,line);
+                                   "ERROR: %s (%s:%d)\n",str,file,line);
     if (universe->ulogfile) fprintf(universe->ulogfile,
-				    "ERROR: %s (%s:%d)\n",str,file,line);
+                                    "ERROR: %s (%s:%d)\n",str,file,line);
   }
 
   if (output) delete output;
@@ -60,7 +60,7 @@ void Error::universe_one(const char *file, int line, const char *str)
 {
   if (universe->uscreen)
     fprintf(universe->uscreen,"ERROR on proc %d: %s (%s:%d)\n",
-	    universe->me,str,file,line);
+            universe->me,str,file,line);
   MPI_Abort(universe->uworld,1);
 }
 
@@ -95,7 +95,7 @@ void Error::all(const char *file, int line, const char *str)
 /* ----------------------------------------------------------------------
    called by one proc in world
    write to world screen only if non-NULL on this proc
-   always write to universe screen 
+   always write to universe screen
    forces abort of entire world (and universe) if any proc in world calls
 ------------------------------------------------------------------------- */
 
@@ -104,24 +104,24 @@ void Error::one(const char *file, int line, const char *str)
   int me;
   MPI_Comm_rank(world,&me);
   if (screen) fprintf(screen,"ERROR on proc %d: %s (%s:%d)\n",
-		      me,str,file,line);
+                      me,str,file,line);
   if (universe->nworlds > 1)
     if (universe->uscreen)
       fprintf(universe->uscreen,"ERROR on proc %d: %s (%s:%d)\n",
-	      universe->me,str,file,line);
+              universe->me,str,file,line);
   MPI_Abort(world,1);
 }
 
 /* ----------------------------------------------------------------------
    called by one proc in world
-   only write to screen if non-NULL on this proc since could be file 
+   only write to screen if non-NULL on this proc since could be file
 ------------------------------------------------------------------------- */
 
 void Error::warning(const char *file, int line, const char *str, int logflag)
 {
   if (screen) fprintf(screen,"WARNING: %s (%s:%d)\n",str,file,line);
   if (logflag && logfile) fprintf(logfile,"WARNING: %s (%s:%d)\n",
-				  str,file,line);
+                                  str,file,line);
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/error.h b/src/error.h
index 66d83feccf..8a70a691f0 100644
--- a/src/error.h
+++ b/src/error.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/finish.cpp b/src/finish.cpp
index 3ca6f4888f..3c063aefc5 100644
--- a/src/finish.cpp
+++ b/src/finish.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ void Finish::end(int flag)
 
   bigint nblocal = atom->nlocal;
   MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
-  
+
   // choose flavors of statistical output
   // flag determines caller
   // flag = 0 = just loop summary
@@ -70,9 +70,9 @@ void Finish::end(int flag)
     if (update->whichflag == 2) minflag = 1;
     timeflag = histoflag = 1;
     neighflag = 1;
-    if (update->whichflag == 1 && 
-	strcmp(update->integrate_style,"verlet/split") == 0 && 
-	universe->iworld == 1) neighflag = 0;
+    if (update->whichflag == 1 &&
+        strcmp(update->integrate_style,"verlet/split") == 0 &&
+        universe->iworld == 1) neighflag = 0;
     if (force->kspace && force->kspace_match("pppm",0)) fftflag = 1;
   }
   if (flag == 2) prdflag = histoflag = neighflag = 1;
@@ -82,40 +82,40 @@ void Finish::end(int flag)
 
   if (loopflag) {
     time_other = timer->array[TIME_LOOP] -
-      (timer->array[TIME_PAIR] + timer->array[TIME_BOND] + 
+      (timer->array[TIME_PAIR] + timer->array[TIME_BOND] +
        timer->array[TIME_KSPACE] + timer->array[TIME_NEIGHBOR] +
        timer->array[TIME_COMM] + timer->array[TIME_OUTPUT]);
-    
+
     time_loop = timer->array[TIME_LOOP];
     MPI_Allreduce(&time_loop,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time_loop = tmp/nprocs;
 
     // overall loop time
 
-#if defined(_OPENMP)    
+#if defined(_OPENMP)
     if (me == 0) {
       int ntasks = nprocs * comm->nthreads;
       if (screen) fprintf(screen,
-			  "Loop time of %g on %d procs (%d MPI x %d OpenMP) "
-			  "for %d steps with " BIGINT_FORMAT " atoms\n",
-			  time_loop,ntasks,nprocs,comm->nthreads,
-			  update->nsteps,atom->natoms);
+                          "Loop time of %g on %d procs (%d MPI x %d OpenMP) "
+                          "for %d steps with " BIGINT_FORMAT " atoms\n",
+                          time_loop,ntasks,nprocs,comm->nthreads,
+                          update->nsteps,atom->natoms);
       if (logfile) fprintf(logfile,
-			  "Loop time of %g on %d procs (%d MPI x %d OpenMP) "
-			  "for %d steps with " BIGINT_FORMAT " atoms\n",
-			  time_loop,ntasks,nprocs,comm->nthreads,
-			  update->nsteps,atom->natoms);
+                          "Loop time of %g on %d procs (%d MPI x %d OpenMP) "
+                          "for %d steps with " BIGINT_FORMAT " atoms\n",
+                          time_loop,ntasks,nprocs,comm->nthreads,
+                          update->nsteps,atom->natoms);
     }
 #else
     if (me == 0) {
       if (screen) fprintf(screen,
-			  "Loop time of %g on %d procs for %d steps with " 
-			  BIGINT_FORMAT " atoms\n",
-			  time_loop,nprocs,update->nsteps,atom->natoms);
+                          "Loop time of %g on %d procs for %d steps with "
+                          BIGINT_FORMAT " atoms\n",
+                          time_loop,nprocs,update->nsteps,atom->natoms);
       if (logfile) fprintf(logfile,
-			   "Loop time of %g on %d procs for %d steps with " 
-			   BIGINT_FORMAT " atoms\n",
-			   time_loop,nprocs,update->nsteps,atom->natoms);
+                           "Loop time of %g on %d procs for %d steps with "
+                           BIGINT_FORMAT " atoms\n",
+                           time_loop,nprocs,update->nsteps,atom->natoms);
     }
 #endif
 
@@ -132,44 +132,44 @@ void Finish::end(int flag)
 
     if (me == 0) {
       if (screen) {
-	fprintf(screen,"Minimization stats:\n");
-	fprintf(screen,"  Stopping criterion = %s\n",
-		update->minimize->stopstr);
-	fprintf(screen,"  Energy initial, next-to-last, final = \n"
-		"    %18.12g %18.12g %18.12g\n",
-		update->minimize->einitial,update->minimize->eprevious,
-		update->minimize->efinal);
-	fprintf(screen,"  Force two-norm initial, final = %g %g\n",
-		update->minimize->fnorm2_init,update->minimize->fnorm2_final);
-	fprintf(screen,"  Force max component initial, final = %g %g\n",
-		update->minimize->fnorminf_init,
-		update->minimize->fnorminf_final);
-	fprintf(screen,"  Final line search alpha, max atom move = %g %g\n",
-		update->minimize->alpha_final,
-		update->minimize->alpha_final*
-		update->minimize->fnorminf_final);
-	fprintf(screen,"  Iterations, force evaluations = %d %d\n",
-		update->minimize->niter,update->minimize->neval);
+        fprintf(screen,"Minimization stats:\n");
+        fprintf(screen,"  Stopping criterion = %s\n",
+                update->minimize->stopstr);
+        fprintf(screen,"  Energy initial, next-to-last, final = \n"
+                "    %18.12g %18.12g %18.12g\n",
+                update->minimize->einitial,update->minimize->eprevious,
+                update->minimize->efinal);
+        fprintf(screen,"  Force two-norm initial, final = %g %g\n",
+                update->minimize->fnorm2_init,update->minimize->fnorm2_final);
+        fprintf(screen,"  Force max component initial, final = %g %g\n",
+                update->minimize->fnorminf_init,
+                update->minimize->fnorminf_final);
+        fprintf(screen,"  Final line search alpha, max atom move = %g %g\n",
+                update->minimize->alpha_final,
+                update->minimize->alpha_final*
+                update->minimize->fnorminf_final);
+        fprintf(screen,"  Iterations, force evaluations = %d %d\n",
+                update->minimize->niter,update->minimize->neval);
       }
       if (logfile) {
-	fprintf(logfile,"Minimization stats:\n");
-	fprintf(logfile,"  Stopping criterion = %s\n",
-		update->minimize->stopstr);
-	fprintf(logfile,"  Energy initial, next-to-last, final = \n"
-		"    %18.12g %18.12g %18.12g\n",
-		update->minimize->einitial,update->minimize->eprevious,
-		update->minimize->efinal);
-	fprintf(logfile,"  Force two-norm initial, final = %g %g\n",
-		update->minimize->fnorm2_init,update->minimize->fnorm2_final);
-	fprintf(logfile,"  Force max component initial, final = %g %g\n",
-		update->minimize->fnorminf_init,
-		update->minimize->fnorminf_final);
-	fprintf(logfile,"  Final line search alpha, max atom move = %g %g\n",
-		update->minimize->alpha_final,
-		update->minimize->alpha_final*
-		update->minimize->fnorminf_final);
-	fprintf(logfile,"  Iterations, force evaluations = %d %d\n",
-		update->minimize->niter,update->minimize->neval);
+        fprintf(logfile,"Minimization stats:\n");
+        fprintf(logfile,"  Stopping criterion = %s\n",
+                update->minimize->stopstr);
+        fprintf(logfile,"  Energy initial, next-to-last, final = \n"
+                "    %18.12g %18.12g %18.12g\n",
+                update->minimize->einitial,update->minimize->eprevious,
+                update->minimize->efinal);
+        fprintf(logfile,"  Force two-norm initial, final = %g %g\n",
+                update->minimize->fnorm2_init,update->minimize->fnorm2_final);
+        fprintf(logfile,"  Force max component initial, final = %g %g\n",
+                update->minimize->fnorminf_init,
+                update->minimize->fnorminf_final);
+        fprintf(logfile,"  Final line search alpha, max atom move = %g %g\n",
+                update->minimize->alpha_final,
+                update->minimize->alpha_final*
+                update->minimize->fnorminf_final);
+        fprintf(logfile,"  Iterations, force evaluations = %d %d\n",
+                update->minimize->niter,update->minimize->neval);
       }
     }
   }
@@ -189,48 +189,48 @@ void Finish::end(int flag)
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"  Dephase  time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"  Dephase  time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"  Dephase  time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"  Dephase  time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
 
     time = timer->array[TIME_BOND];
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"  Dynamics time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"  Dynamics time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"  Dynamics time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"  Dynamics time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
 
     time = timer->array[TIME_KSPACE];
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"  Quench   time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"  Quench   time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"  Quench   time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"  Quench   time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
 
     time = time_other;
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"  Other    time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"  Other    time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"  Other    time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"  Other    time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
   }
 
@@ -249,36 +249,36 @@ void Finish::end(int flag)
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"  NEB      time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"  NEB      time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"  NEB      time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"  NEB      time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
 
     time = timer->array[TIME_BOND];
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"  Dynamics time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"  Dynamics time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"  Dynamics time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"  Dynamics time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
 
     time = timer->array[TIME_KSPACE];
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"  Quench   time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"  Quench   time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"  Quench   time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"  Quench   time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
 
 
@@ -286,12 +286,12 @@ void Finish::end(int flag)
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"  Comm     time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"  Comm     time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"  Comm     time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"  Comm     time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
 
 
@@ -299,24 +299,24 @@ void Finish::end(int flag)
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"  Output   time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"  Output   time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"  Output   time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"  Output   time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
 
     time = time_other;
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"  Other    time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"  Other    time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"  Other    time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"  Other    time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
   }
 
@@ -332,12 +332,12 @@ void Finish::end(int flag)
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"Pair  time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"Pair  time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"Pair  time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"Pair  time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
 
     if (atom->molecular) {
@@ -345,78 +345,78 @@ void Finish::end(int flag)
       MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
       time = tmp/nprocs;
       if (me == 0) {
-	if (screen) 
-	  fprintf(screen,"Bond  time (%%) = %g (%g)\n",
-		  time,time/time_loop*100.0);
-	if (logfile)
-	  fprintf(logfile,"Bond  time (%%) = %g (%g)\n",
-		  time,time/time_loop*100.0);
+        if (screen)
+          fprintf(screen,"Bond  time (%%) = %g (%g)\n",
+                  time,time/time_loop*100.0);
+        if (logfile)
+          fprintf(logfile,"Bond  time (%%) = %g (%g)\n",
+                  time,time/time_loop*100.0);
       }
     }
-    
+
     if (force->kspace) {
       time = timer->array[TIME_KSPACE];
       MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
       time = tmp/nprocs;
       if (me == 0) {
-	if (screen) 
-	  fprintf(screen,"Kspce time (%%) = %g (%g)\n",
-		  time,time/time_loop*100.0);
-	if (logfile)
-	  fprintf(logfile,"Kspce time (%%) = %g (%g)\n",
-		  time,time/time_loop*100.0);
+        if (screen)
+          fprintf(screen,"Kspce time (%%) = %g (%g)\n",
+                  time,time/time_loop*100.0);
+        if (logfile)
+          fprintf(logfile,"Kspce time (%%) = %g (%g)\n",
+                  time,time/time_loop*100.0);
       }
     }
-    
+
     time = timer->array[TIME_NEIGHBOR];
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"Neigh time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"Neigh time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-    }
-    
+      if (screen)
+        fprintf(screen,"Neigh time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"Neigh time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+    }
+
     time = timer->array[TIME_COMM];
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"Comm  time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"Comm  time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-    }
-    
+      if (screen)
+        fprintf(screen,"Comm  time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"Comm  time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+    }
+
     time = timer->array[TIME_OUTPUT];
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"Outpt time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"Outpt time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-    }
-    
+      if (screen)
+        fprintf(screen,"Outpt time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"Outpt time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+    }
+
     time = time_other;
     MPI_Allreduce(&time,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time = tmp/nprocs;
     if (me == 0) {
-      if (screen) 
-	fprintf(screen,"Other time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
-      if (logfile) 
-	fprintf(logfile,"Other time (%%) = %g (%g)\n",
-		time,time/time_loop*100.0);
+      if (screen)
+        fprintf(screen,"Other time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
+      if (logfile)
+        fprintf(logfile,"Other time (%%) = %g (%g)\n",
+                time,time/time_loop*100.0);
     }
   }
-  
+
   // FFT timing statistics
   // time3d,time1d = total time during run for 3d and 1d FFTs
   // time_kspace may be 0.0 if another partition is doing Kspace
@@ -432,15 +432,15 @@ void Finish::end(int flag)
     int nsample = 5;
     double time3d,time1d;
     force->kspace->timing(nsample,time3d,time1d);
-    
+
     time3d = nsteps * time3d / nsample;
     MPI_Allreduce(&time3d,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time3d = tmp/nprocs;
-    
+
     time1d = nsteps * time1d / nsample;
     MPI_Allreduce(&time1d,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time1d = tmp/nprocs;
-    
+
     double time_kspace = timer->array[TIME_KSPACE];
     MPI_Allreduce(&time_kspace,&tmp,1,MPI_DOUBLE,MPI_SUM,world);
     time_kspace = tmp/nprocs;
@@ -459,12 +459,12 @@ void Finish::end(int flag)
 
     if (me == 0) {
       if (screen) {
-	fprintf(screen,"FFT time (%% of Kspce) = %g (%g)\n",time3d,fraction);
-	fprintf(screen,"FFT Gflps 3d (1d only) = %g %g\n",flop3,flop1);
+        fprintf(screen,"FFT time (%% of Kspce) = %g (%g)\n",time3d,fraction);
+        fprintf(screen,"FFT Gflps 3d (1d only) = %g %g\n",flop3,flop1);
       }
       if (logfile) {
-	fprintf(logfile,"FFT time (%% of Kspce) = %g (%g)\n",time3d,fraction);
-	fprintf(logfile,"FFT Gflps 3d (1d only) = %g %g\n",flop3,flop1);
+        fprintf(logfile,"FFT time (%% of Kspce) = %g (%g)\n",time3d,fraction);
+        fprintf(logfile,"FFT Gflps 3d (1d only) = %g %g\n",flop3,flop1);
       }
     }
   }
@@ -479,46 +479,46 @@ void Finish::end(int flag)
     stats(1,&tmp,&ave,&max,&min,10,histo);
     if (me == 0) {
       if (screen) {
-	fprintf(screen,"Nlocal:    %g ave %g max %g min\n",ave,max,min);
-	fprintf(screen,"Histogram:");
-	for (i = 0; i < 10; i++) fprintf(screen," %d",histo[i]);
-	fprintf(screen,"\n");
+        fprintf(screen,"Nlocal:    %g ave %g max %g min\n",ave,max,min);
+        fprintf(screen,"Histogram:");
+        for (i = 0; i < 10; i++) fprintf(screen," %d",histo[i]);
+        fprintf(screen,"\n");
       }
       if (logfile) {
-	fprintf(logfile,"Nlocal:    %g ave %g max %g min\n",ave,max,min);
-	fprintf(logfile,"Histogram:");
-	for (i = 0; i < 10; i++) fprintf(logfile," %d",histo[i]);
-	fprintf(logfile,"\n");
+        fprintf(logfile,"Nlocal:    %g ave %g max %g min\n",ave,max,min);
+        fprintf(logfile,"Histogram:");
+        for (i = 0; i < 10; i++) fprintf(logfile," %d",histo[i]);
+        fprintf(logfile,"\n");
       }
     }
-    
+
     tmp = atom->nghost;
     stats(1,&tmp,&ave,&max,&min,10,histo);
     if (me == 0) {
       if (screen) {
-	fprintf(screen,"Nghost:    %g ave %g max %g min\n",ave,max,min);
-	fprintf(screen,"Histogram:");
-	for (i = 0; i < 10; i++) fprintf(screen," %d",histo[i]);
-	fprintf(screen,"\n");
+        fprintf(screen,"Nghost:    %g ave %g max %g min\n",ave,max,min);
+        fprintf(screen,"Histogram:");
+        for (i = 0; i < 10; i++) fprintf(screen," %d",histo[i]);
+        fprintf(screen,"\n");
       }
       if (logfile) {
-	fprintf(logfile,"Nghost:    %g ave %g max %g min\n",ave,max,min);
-	fprintf(logfile,"Histogram:");
-	for (i = 0; i < 10; i++) fprintf(logfile," %d",histo[i]);
-	fprintf(logfile,"\n");
+        fprintf(logfile,"Nghost:    %g ave %g max %g min\n",ave,max,min);
+        fprintf(logfile,"Histogram:");
+        for (i = 0; i < 10; i++) fprintf(logfile," %d",histo[i]);
+        fprintf(logfile,"\n");
       }
     }
-    
+
     // find a non-skip neighbor list containing half the pairwise interactions
     // count neighbors in that list for stats purposes
-    
+
     for (m = 0; m < neighbor->old_nrequest; m++)
-      if ((neighbor->old_requests[m]->half || 
-	   neighbor->old_requests[m]->gran ||
-	   neighbor->old_requests[m]->respaouter ||
-	   neighbor->old_requests[m]->half_from_full) &&
-	  neighbor->old_requests[m]->skip == 0 &&
-	  neighbor->lists[m]->numneigh) break;
+      if ((neighbor->old_requests[m]->half ||
+           neighbor->old_requests[m]->gran ||
+           neighbor->old_requests[m]->respaouter ||
+           neighbor->old_requests[m]->half_from_full) &&
+          neighbor->old_requests[m]->skip == 0 &&
+          neighbor->lists[m]->numneigh) break;
 
     nneigh = 0;
     if (m < neighbor->old_nrequest) {
@@ -526,58 +526,58 @@ void Finish::end(int flag)
       int *ilist = neighbor->lists[m]->ilist;
       int *numneigh = neighbor->lists[m]->numneigh;
       for (i = 0; i < inum; i++)
-	nneigh += numneigh[ilist[i]];
+        nneigh += numneigh[ilist[i]];
     }
-    
+
     tmp = nneigh;
     stats(1,&tmp,&ave,&max,&min,10,histo);
     if (me == 0) {
       if (screen) {
-	fprintf(screen,"Neighs:    %g ave %g max %g min\n",ave,max,min);
-	fprintf(screen,"Histogram:");
-	for (i = 0; i < 10; i++) fprintf(screen," %d",histo[i]);
-	fprintf(screen,"\n");
+        fprintf(screen,"Neighs:    %g ave %g max %g min\n",ave,max,min);
+        fprintf(screen,"Histogram:");
+        for (i = 0; i < 10; i++) fprintf(screen," %d",histo[i]);
+        fprintf(screen,"\n");
       }
       if (logfile) {
-	fprintf(logfile,"Neighs:    %g ave %g max %g min\n",ave,max,min);
-	fprintf(logfile,"Histogram:");
-	for (i = 0; i < 10; i++) fprintf(logfile," %d",histo[i]);
-	fprintf(logfile,"\n");
+        fprintf(logfile,"Neighs:    %g ave %g max %g min\n",ave,max,min);
+        fprintf(logfile,"Histogram:");
+        for (i = 0; i < 10; i++) fprintf(logfile," %d",histo[i]);
+        fprintf(logfile,"\n");
       }
     }
-    
+
     // find a non-skip neighbor list containing full pairwise interactions
     // count neighbors in that list for stats purposes
 
     for (m = 0; m < neighbor->old_nrequest; m++)
       if (neighbor->old_requests[m]->full &&
-	  neighbor->old_requests[m]->skip == 0) break;
-    
+          neighbor->old_requests[m]->skip == 0) break;
+
     nneighfull = 0;
     if (m < neighbor->old_nrequest) {
       if (neighbor->lists[m]->numneigh > 0) {
-	int inum = neighbor->lists[m]->inum;
-	int *ilist = neighbor->lists[m]->ilist;
-	int *numneigh = neighbor->lists[m]->numneigh;
-	for (i = 0; i < inum; i++)
-	  nneighfull += numneigh[ilist[i]];
+        int inum = neighbor->lists[m]->inum;
+        int *ilist = neighbor->lists[m]->ilist;
+        int *numneigh = neighbor->lists[m]->numneigh;
+        for (i = 0; i < inum; i++)
+          nneighfull += numneigh[ilist[i]];
       }
 
       tmp = nneighfull;
       stats(1,&tmp,&ave,&max,&min,10,histo);
       if (me == 0) {
-	if (screen) {
-	  fprintf(screen,"FullNghs:  %g ave %g max %g min\n",ave,max,min);
-	  fprintf(screen,"Histogram:");
-	  for (i = 0; i < 10; i++) fprintf(screen," %d",histo[i]);
-	  fprintf(screen,"\n");
-	}
-	if (logfile) {
-	  fprintf(logfile,"FullNghs:  %g ave %g max %g min\n",ave,max,min);
-	  fprintf(logfile,"Histogram:");
-	  for (i = 0; i < 10; i++) fprintf(logfile," %d",histo[i]);
-	  fprintf(logfile,"\n");
-	}
+        if (screen) {
+          fprintf(screen,"FullNghs:  %g ave %g max %g min\n",ave,max,min);
+          fprintf(screen,"Histogram:");
+          for (i = 0; i < 10; i++) fprintf(screen," %d",histo[i]);
+          fprintf(screen,"\n");
+        }
+        if (logfile) {
+          fprintf(logfile,"FullNghs:  %g ave %g max %g min\n",ave,max,min);
+          fprintf(logfile,"Histogram:");
+          for (i = 0; i < 10; i++) fprintf(logfile," %d",histo[i]);
+          fprintf(logfile,"\n");
+        }
       }
     }
   }
@@ -587,11 +587,11 @@ void Finish::end(int flag)
       if (screen) fprintf(screen,"\n");
       if (logfile) fprintf(logfile,"\n");
     }
-    
+
     tmp = MAX(nneigh,nneighfull);
     double nall;
     MPI_Allreduce(&tmp,&nall,1,MPI_DOUBLE,MPI_SUM,world);
-    
+
     int nspec;
     double nspec_all;
     if (atom->molecular) {
@@ -601,45 +601,45 @@ void Finish::end(int flag)
       tmp = nspec;
       MPI_Allreduce(&tmp,&nspec_all,1,MPI_DOUBLE,MPI_SUM,world);
     }
-    
+
     if (me == 0) {
       if (screen) {
-	if (nall < 2.0e9) 
-	  fprintf(screen,
-		  "Total # of neighbors = %d\n",static_cast<int> (nall));
-	else fprintf(screen,"Total # of neighbors = %g\n",nall);
-	if (atom->natoms > 0) 
-	  fprintf(screen,"Ave neighs/atom = %g\n",nall/atom->natoms);
-	if (atom->molecular && atom->natoms > 0) 
-	  fprintf(screen,"Ave special neighs/atom = %g\n",
-		  nspec_all/atom->natoms);
-	fprintf(screen,"Neighbor list builds = %d\n",neighbor->ncalls);
-	fprintf(screen,"Dangerous builds = %d\n",neighbor->ndanger);
+        if (nall < 2.0e9)
+          fprintf(screen,
+                  "Total # of neighbors = %d\n",static_cast<int> (nall));
+        else fprintf(screen,"Total # of neighbors = %g\n",nall);
+        if (atom->natoms > 0)
+          fprintf(screen,"Ave neighs/atom = %g\n",nall/atom->natoms);
+        if (atom->molecular && atom->natoms > 0)
+          fprintf(screen,"Ave special neighs/atom = %g\n",
+                  nspec_all/atom->natoms);
+        fprintf(screen,"Neighbor list builds = %d\n",neighbor->ncalls);
+        fprintf(screen,"Dangerous builds = %d\n",neighbor->ndanger);
       }
       if (logfile) {
-	if (nall < 2.0e9) 
-	  fprintf(logfile,
-		  "Total # of neighbors = %d\n",static_cast<int> (nall));
-	else fprintf(logfile,"Total # of neighbors = %g\n",nall);
-	if (atom->natoms > 0) 
-	  fprintf(logfile,"Ave neighs/atom = %g\n",nall/atom->natoms);
-	if (atom->molecular && atom->natoms > 0) 
-	  fprintf(logfile,"Ave special neighs/atom = %g\n",
-		  nspec_all/atom->natoms);
-	fprintf(logfile,"Neighbor list builds = %d\n",neighbor->ncalls);
-	fprintf(logfile,"Dangerous builds = %d\n",neighbor->ndanger);
+        if (nall < 2.0e9)
+          fprintf(logfile,
+                  "Total # of neighbors = %d\n",static_cast<int> (nall));
+        else fprintf(logfile,"Total # of neighbors = %g\n",nall);
+        if (atom->natoms > 0)
+          fprintf(logfile,"Ave neighs/atom = %g\n",nall/atom->natoms);
+        if (atom->molecular && atom->natoms > 0)
+          fprintf(logfile,"Ave special neighs/atom = %g\n",
+                  nspec_all/atom->natoms);
+        fprintf(logfile,"Neighbor list builds = %d\n",neighbor->ncalls);
+        fprintf(logfile,"Dangerous builds = %d\n",neighbor->ndanger);
       }
     }
   }
-  
+
   if (logfile) fflush(logfile);
 }
 
 /* ---------------------------------------------------------------------- */
 
-void Finish::stats(int n, double *data, 
-		   double *pave, double *pmax, double *pmin,
-		   int nhisto, int *histo)
+void Finish::stats(int n, double *data,
+                   double *pave, double *pmax, double *pmin,
+                   int nhisto, int *histo)
 {
   int i,m;
   int *histotmp;
diff --git a/src/finish.h b/src/finish.h
index 09c28f975e..9036aef3b9 100644
--- a/src/finish.h
+++ b/src/finish.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix.cpp b/src/fix.cpp
index 5f19d75dca..50b30869d4 100644
--- a/src/fix.cpp
+++ b/src/fix.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -119,7 +119,7 @@ void Fix::v_setup(int vflag)
   vflag_atom = vflag / 4;
 
   // reallocate per-atom array if necessary
-  
+
   if (vflag_atom && atom->nlocal > maxvatom) {
     maxvatom = atom->nmax;
     memory->destroy(vatom);
diff --git a/src/fix.h b/src/fix.h
index 25ee41b587..4214ba355b 100644
--- a/src/fix.h
+++ b/src/fix.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp
index 380eb8c8e5..e8af253f6a 100644
--- a/src/fix_adapt.cpp
+++ b/src/fix_adapt.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -84,13 +84,13 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       adapt[nadapt].pparam = new char[n];
       strcpy(adapt[nadapt].pparam,arg[iarg+2]);
       force->bounds(arg[iarg+3],atom->ntypes,
-		    adapt[nadapt].ilo,adapt[nadapt].ihi);
+                    adapt[nadapt].ilo,adapt[nadapt].ihi);
       force->bounds(arg[iarg+4],atom->ntypes,
-		    adapt[nadapt].jlo,adapt[nadapt].jhi);
+                    adapt[nadapt].jlo,adapt[nadapt].jhi);
       if (strstr(arg[iarg+5],"v_") == arg[iarg+5]) {
-	n = strlen(&arg[iarg+5][2]) + 1;
-	adapt[nadapt].var = new char[n];
-	strcpy(adapt[nadapt].var,&arg[iarg+5][2]);
+        n = strlen(&arg[iarg+5][2]) + 1;
+        adapt[nadapt].var = new char[n];
+        strcpy(adapt[nadapt].var,&arg[iarg+5][2]);
       } else error->all(FLERR,"Illegal fix adapt command");
       nadapt++;
       iarg += 6;
@@ -98,9 +98,9 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix adapt command");
       adapt[nadapt].which = KSPACE;
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	adapt[nadapt].var = new char[n];
-	strcpy(adapt[nadapt].var,&arg[iarg+1][2]);
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        adapt[nadapt].var = new char[n];
+        strcpy(adapt[nadapt].var,&arg[iarg+1][2]);
       } else error->all(FLERR,"Illegal fix adapt command");
       nadapt++;
       iarg += 2;
@@ -108,13 +108,13 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       if (iarg+3 > narg) error->all(FLERR,"Illegal fix adapt command");
       adapt[nadapt].which = ATOM;
       if (strcmp(arg[iarg+1],"diameter") == 0) {
-	adapt[nadapt].aparam = DIAMETER;
-	diamflag = 1;
+        adapt[nadapt].aparam = DIAMETER;
+        diamflag = 1;
       } else error->all(FLERR,"Illegal fix adapt command");
       if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
-	int n = strlen(&arg[iarg+2][2]) + 1;
-	adapt[nadapt].var = new char[n];
-	strcpy(adapt[nadapt].var,&arg[iarg+2][2]);
+        int n = strlen(&arg[iarg+2][2]) + 1;
+        adapt[nadapt].var = new char[n];
+        strcpy(adapt[nadapt].var,&arg[iarg+2][2]);
       } else error->all(FLERR,"Illegal fix adapt command");
       nadapt++;
       iarg += 3;
@@ -205,28 +205,28 @@ void FixAdapt::init()
       ad->pdim = 2;
       if (ad->pdim == 0) ad->scalar = (double *) ptr;
       if (ad->pdim == 2) ad->array = (double **) ptr;
-      
+
       // if pair hybrid, test that ilo,ihi,jlo,jhi are valid for sub-style
 
       if (ad->pdim == 2 && (strcmp(force->pair_style,"hybrid") == 0 ||
-			    strcmp(force->pair_style,"hybrid/overlay") == 0)) {
-	PairHybrid *pair = (PairHybrid *) force->pair;
-	for (i = ad->ilo; i <= ad->ihi; i++)
-	  for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
-	    if (!pair->check_ijtype(i,j,ad->pstyle))
-	      error->all(FLERR,"Fix adapt type pair range is not valid for "
-			 "pair hybrid sub-style");
+                            strcmp(force->pair_style,"hybrid/overlay") == 0)) {
+        PairHybrid *pair = (PairHybrid *) force->pair;
+        for (i = ad->ilo; i <= ad->ihi; i++)
+          for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
+            if (!pair->check_ijtype(i,j,ad->pstyle))
+              error->all(FLERR,"Fix adapt type pair range is not valid for "
+                         "pair hybrid sub-style");
       }
 
     } else if (ad->which == KSPACE) {
-      if (force->kspace == NULL) 
-	error->all(FLERR,"Fix adapt kspace style does not exist");
+      if (force->kspace == NULL)
+        error->all(FLERR,"Fix adapt kspace style does not exist");
       kspace_scale = (double *) force->kspace->extract("scale");
 
     } else if (ad->which == ATOM) {
       if (ad->aparam == DIAMETER) {
-	if (!atom->radius_flag)
-	  error->all(FLERR,"Fix adapt requires atom attribute diameter");
+        if (!atom->radius_flag)
+          error->all(FLERR,"Fix adapt requires atom attribute diameter");
       }
     }
   }
@@ -237,8 +237,8 @@ void FixAdapt::init()
     Adapt *ad = &adapt[m];
     if (ad->which == PAIR && ad->pdim == 2) {
       for (i = ad->ilo; i <= ad->ihi; i++)
-	for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
-	  ad->array_orig[i][j] = ad->array[i][j];
+        for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
+          ad->array_orig[i][j] = ad->array[i][j];
     }
   }
 }
@@ -281,22 +281,22 @@ void FixAdapt::change_settings()
   for (int m = 0; m < nadapt; m++) {
     Adapt *ad = &adapt[m];
     double value = input->variable->compute_equal(ad->ivar);
-    
+
     // set global scalar or type pair array values
 
     if (ad->which == PAIR) {
       if (ad->pdim == 0) {
-	if (scaleflag) *ad->scalar = value * ad->scalar_orig;
-	else *ad->scalar = value;
+        if (scaleflag) *ad->scalar = value * ad->scalar_orig;
+        else *ad->scalar = value;
       } else if (ad->pdim == 2) {
-	if (scaleflag)
-	  for (i = ad->ilo; i <= ad->ihi; i++)
-	    for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
-	      ad->array[i][j] = value*ad->array_orig[i][j];
-	else
-	  for (i = ad->ilo; i <= ad->ihi; i++)
-	    for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
-	      ad->array[i][j] = value;
+        if (scaleflag)
+          for (i = ad->ilo; i <= ad->ihi; i++)
+            for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
+              ad->array[i][j] = value*ad->array_orig[i][j];
+        else
+          for (i = ad->ilo; i <= ad->ihi; i++)
+            for (j = MAX(ad->jlo,i); j <= ad->jhi; j++)
+              ad->array[i][j] = value;
       }
 
     // set kspace scale factor
@@ -310,29 +310,29 @@ void FixAdapt::change_settings()
       // also scale rmass to new value
 
       if (ad->aparam == DIAMETER) {
-	int mflag = 0;
-	if (atom->rmass_flag) mflag = 1;
-	double density;
-
-	double *radius = atom->radius;
-	double *rmass = atom->rmass;
-	int *mask = atom->mask;
-	int nlocal = atom->nlocal;
-
-	if (mflag == 0) {
-	  for (i = 0; i < nlocal; i++)
-	    if (mask[i] & groupbit)
-	      radius[i] = 0.5*value;
-	} else {
-	  for (i = 0; i < nlocal; i++)
-	    if (mask[i] & groupbit) {
-	      density = rmass[i] / (4.0*MY_PI/3.0 * 
-				    radius[i]*radius[i]*radius[i]);
-	      radius[i] = 0.5*value;
-	      rmass[i] = 4.0*MY_PI/3.0 * 
-		radius[i]*radius[i]*radius[i] * density;
-	    }
-	}
+        int mflag = 0;
+        if (atom->rmass_flag) mflag = 1;
+        double density;
+
+        double *radius = atom->radius;
+        double *rmass = atom->rmass;
+        int *mask = atom->mask;
+        int nlocal = atom->nlocal;
+
+        if (mflag == 0) {
+          for (i = 0; i < nlocal; i++)
+            if (mask[i] & groupbit)
+              radius[i] = 0.5*value;
+        } else {
+          for (i = 0; i < nlocal; i++)
+            if (mask[i] & groupbit) {
+              density = rmass[i] / (4.0*MY_PI/3.0 *
+                                    radius[i]*radius[i]*radius[i]);
+              radius[i] = 0.5*value;
+              rmass[i] = 4.0*MY_PI/3.0 *
+                radius[i]*radius[i]*radius[i] * density;
+            }
+        }
       }
     }
   }
@@ -357,9 +357,9 @@ void FixAdapt::restore_settings()
     if (ad->which == PAIR) {
       if (ad->pdim == 0) *ad->scalar = ad->scalar_orig;
       else if (ad->pdim == 2) {
-	for (int i = ad->ilo; i <= ad->ihi; i++)
-	  for (int j = MAX(ad->jlo,i); j <= ad->jhi; j++)
-	    ad->array[i][j] = ad->array_orig[i][j];
+        for (int i = ad->ilo; i <= ad->ihi; i++)
+          for (int j = MAX(ad->jlo,i); j <= ad->jhi; j++)
+            ad->array[i][j] = ad->array_orig[i][j];
       }
 
     } else if (ad->which == KSPACE) {
diff --git a/src/fix_adapt.h b/src/fix_adapt.h
index 2fb9987cd6..658932c96a 100644
--- a/src/fix_adapt.h
+++ b/src/fix_adapt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp
index f86a4f847c..cb1e7ca1aa 100644
--- a/src/fix_addforce.cpp
+++ b/src/fix_addforce.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -83,7 +83,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce command");
       iregion = domain->find_region(arg[iarg+1]);
       if (iregion == -1)
-	error->all(FLERR,"Region ID for fix addforce does not exist");
+        error->all(FLERR,"Region ID for fix addforce does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
@@ -91,9 +91,9 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"energy") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix addforce command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	estr = new char[n];
-	strcpy(estr,&arg[iarg+1][2]);
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        estr = new char[n];
+        strcpy(estr,&arg[iarg+1][2]);
       } else error->all(FLERR,"Illegal fix addforce command");
       iarg += 2;
     } else error->all(FLERR,"Illegal fix addforce command");
@@ -138,7 +138,7 @@ void FixAddForce::init()
 
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) 
+    if (xvar < 0)
       error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
     else if (input->variable->atomstyle(xvar)) xstyle = ATOM;
@@ -146,7 +146,7 @@ void FixAddForce::init()
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) 
+    if (yvar < 0)
       error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
     else if (input->variable->atomstyle(yvar)) ystyle = ATOM;
@@ -154,7 +154,7 @@ void FixAddForce::init()
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) 
+    if (zvar < 0)
       error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
     else if (input->variable->atomstyle(zvar)) zstyle = ATOM;
@@ -162,7 +162,7 @@ void FixAddForce::init()
   }
   if (estr) {
     evar = input->variable->find(estr);
-    if (evar < 0) 
+    if (evar < 0)
       error->all(FLERR,"Variable name for fix addforce does not exist");
     if (input->variable->atomstyle(evar)) estyle = ATOM;
     else error->all(FLERR,"Variable for fix addforce is invalid style");
@@ -176,7 +176,7 @@ void FixAddForce::init()
       error->all(FLERR,"Region ID for fix addforce does not exist");
   }
 
-  if (xstyle == ATOM || ystyle == ATOM || zstyle == ATOM) 
+  if (xstyle == ATOM || ystyle == ATOM || zstyle == ATOM)
     varflag = ATOM;
   else if (xstyle == EQUAL || ystyle == EQUAL || zstyle == EQUAL)
     varflag = EQUAL;
@@ -184,8 +184,8 @@ void FixAddForce::init()
 
   if (varflag == CONSTANT && estyle != NONE)
     error->all(FLERR,"Cannot use variable energy with "
-	       "constant force in fix addforce");
-  if ((varflag == EQUAL || varflag == ATOM) && 
+               "constant force in fix addforce");
+  if ((varflag == EQUAL || varflag == ATOM) &&
       update->whichflag == 2 && estyle == NONE)
     error->all(FLERR,"Must use variable energy with fix addforce");
 
@@ -249,22 +249,22 @@ void FixAddForce::post_force(int vflag)
   if (varflag == CONSTANT) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (iregion >= 0 && 
-	    !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
-	  continue;
-	
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	foriginal[0] -= xvalue * (x[i][0]+xbox*xprd) + 
-	  yvalue * (x[i][1]+ybox*yprd) + zvalue * (x[i][2]+zbox*zprd);
-
-	foriginal[1] += f[i][0];
-	foriginal[2] += f[i][1];
-	foriginal[3] += f[i][2];
-	f[i][0] += xvalue;
-	f[i][1] += yvalue;
-	f[i][2] += zvalue;
+        if (iregion >= 0 &&
+            !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
+          continue;
+
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        foriginal[0] -= xvalue * (x[i][0]+xbox*xprd) +
+          yvalue * (x[i][1]+ybox*yprd) + zvalue * (x[i][2]+zbox*zprd);
+
+        foriginal[1] += f[i][0];
+        foriginal[2] += f[i][1];
+        foriginal[3] += f[i][2];
+        f[i][0] += xvalue;
+        f[i][1] += yvalue;
+        f[i][2] += zvalue;
       }
 
   // variable force, wrap with clear/add
@@ -279,7 +279,7 @@ void FixAddForce::post_force(int vflag)
     else if (xstyle == ATOM && sforce)
       input->variable->compute_atom(xvar,igroup,&sforce[0][0],4,0);
     if (ystyle == EQUAL) yvalue = input->variable->compute_equal(yvar);
-    else if (ystyle == ATOM && sforce) 
+    else if (ystyle == ATOM && sforce)
       input->variable->compute_atom(yvar,igroup,&sforce[0][1],4,0);
     if (zstyle == EQUAL) zvalue = input->variable->compute_equal(zvar);
     else if (zstyle == ATOM && sforce)
@@ -291,20 +291,20 @@ void FixAddForce::post_force(int vflag)
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (iregion >= 0 && 
-	    !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
-	  continue;
-	
-	if (estyle == ATOM) foriginal[0] += sforce[i][3];
-	foriginal[1] += f[i][0];
-	foriginal[2] += f[i][1];
-	foriginal[3] += f[i][2];
-	if (xstyle == ATOM) f[i][0] += sforce[i][0];
-	else if (xstyle) f[i][0] += xvalue;
-	if (ystyle == ATOM) f[i][1] += sforce[i][1];
-	else if (ystyle) f[i][1] += yvalue;
-	if (zstyle == ATOM) f[i][2] += sforce[i][2];
-	else if (zstyle) f[i][2] += zvalue;
+        if (iregion >= 0 &&
+            !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
+          continue;
+
+        if (estyle == ATOM) foriginal[0] += sforce[i][3];
+        foriginal[1] += f[i][0];
+        foriginal[2] += f[i][1];
+        foriginal[3] += f[i][2];
+        if (xstyle == ATOM) f[i][0] += sforce[i][0];
+        else if (xstyle) f[i][0] += xvalue;
+        if (ystyle == ATOM) f[i][1] += sforce[i][1];
+        else if (ystyle) f[i][1] += yvalue;
+        if (zstyle == ATOM) f[i][2] += sforce[i][2];
+        else if (zstyle) f[i][2] += zvalue;
       }
   }
 }
diff --git a/src/fix_addforce.h b/src/fix_addforce.h
index a8c283369b..b4ca9839d7 100644
--- a/src/fix_addforce.h
+++ b/src/fix_addforce.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp
index 66622684bc..561a903904 100644
--- a/src/fix_ave_atom.cpp
+++ b/src/fix_ave_atom.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -86,9 +86,9 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
       which[nvalues] = F;
       argindex[nvalues++] = 2;
 
-    } else if (strncmp(arg[iarg],"c_",2) == 0 || 
-	       strncmp(arg[iarg],"f_",2) == 0 || 
-	       strncmp(arg[iarg],"v_",2) == 0) {
+    } else if (strncmp(arg[iarg],"c_",2) == 0 ||
+               strncmp(arg[iarg],"f_",2) == 0 ||
+               strncmp(arg[iarg],"v_",2) == 0) {
       if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE;
       else if (arg[iarg][0] == 'f') which[nvalues] = FIX;
       else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE;
@@ -99,10 +99,10 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Illegal fix ave/atom command");
-	argindex[nvalues] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Illegal fix ave/atom command");
+        argindex[nvalues] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[nvalues] = 0;
 
       n = strlen(suffix) + 1;
@@ -128,41 +128,41 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/atom does not exist");
+        error->all(FLERR,"Compute ID for fix ave/atom does not exist");
       if (modify->compute[icompute]->peratom_flag == 0)
-	error->all(FLERR,"Fix ave/atom compute does not calculate per-atom values");
-      if (argindex[i] == 0 && 
-	  modify->compute[icompute]->size_peratom_cols != 0)
-	error->all(FLERR,"Fix ave/atom compute does not "
-		   "calculate a per-atom vector");
+        error->all(FLERR,"Fix ave/atom compute does not calculate per-atom values");
+      if (argindex[i] == 0 &&
+          modify->compute[icompute]->size_peratom_cols != 0)
+        error->all(FLERR,"Fix ave/atom compute does not "
+                   "calculate a per-atom vector");
       if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	error->all(FLERR,"Fix ave/atom compute does not "
-		   "calculate a per-atom array");
-      if (argindex[i] && 
-	  argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	error->all(FLERR,"Fix ave/atom compute array is accessed out-of-range");
+        error->all(FLERR,"Fix ave/atom compute does not "
+                   "calculate a per-atom array");
+      if (argindex[i] &&
+          argindex[i] > modify->compute[icompute]->size_peratom_cols)
+        error->all(FLERR,"Fix ave/atom compute array is accessed out-of-range");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for fix ave/atom does not exist");
+        error->all(FLERR,"Fix ID for fix ave/atom does not exist");
       if (modify->fix[ifix]->peratom_flag == 0)
-	error->all(FLERR,"Fix ave/atom fix does not calculate per-atom values");
+        error->all(FLERR,"Fix ave/atom fix does not calculate per-atom values");
       if (argindex[i] == 0 && modify->fix[ifix]->size_peratom_cols != 0)
-	error->all(FLERR,"Fix ave/atom fix does not calculate a per-atom vector");
+        error->all(FLERR,"Fix ave/atom fix does not calculate a per-atom vector");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	error->all(FLERR,"Fix ave/atom fix does not calculate a per-atom array");
+        error->all(FLERR,"Fix ave/atom fix does not calculate a per-atom array");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	error->all(FLERR,"Fix ave/atom fix array is accessed out-of-range");
+        error->all(FLERR,"Fix ave/atom fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->peratom_freq)
-	error->all(FLERR,"Fix for fix ave/atom not computed at compatible time");
+        error->all(FLERR,"Fix for fix ave/atom not computed at compatible time");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all(FLERR,"Variable name for fix ave/atom does not exist");
+        error->all(FLERR,"Variable name for fix ave/atom does not exist");
       if (input->variable->atomstyle(ivariable) == 0)
-	error->all(FLERR,"Fix ave/atom variable is not atom-style variable");
+        error->all(FLERR,"Fix ave/atom variable is not atom-style variable");
     }
   }
 
@@ -186,7 +186,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
   for (int i = 0; i < nlocal; i++)
     for (int m = 0; m < nvalues; m++)
       array[i][m] = 0.0;
-  
+
   // nvalid = next step on which end_of_step does something
   // add nvalid to all computes that store invocation times
   // since don't know a priori which are invoked by this fix
@@ -202,7 +202,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) :
 FixAveAtom::~FixAveAtom()
 {
   // unregister callback to this fix from Atom class
- 
+
   atom->delete_callback(id,0);
 
   delete [] which;
@@ -233,19 +233,19 @@ void FixAveAtom::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/atom does not exist");
+        error->all(FLERR,"Compute ID for fix ave/atom does not exist");
       value2index[m] = icompute;
-      
+
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
-      if (ifix < 0) 
-	error->all(FLERR,"Fix ID for fix ave/atom does not exist");
+      if (ifix < 0)
+        error->all(FLERR,"Fix ID for fix ave/atom does not exist");
       value2index[m] = ifix;
 
     } else if (which[m] == VARIABLE) {
       int ivariable = input->variable->find(ids[m]);
-      if (ivariable < 0) 
-	error->all(FLERR,"Variable name for fix ave/atom does not exist");
+      if (ivariable < 0)
+        error->all(FLERR,"Variable name for fix ave/atom does not exist");
       value2index[m] = ivariable;
 
     } else value2index[m] = -1;
@@ -287,8 +287,8 @@ void FixAveAtom::end_of_step()
   if (irepeat == 0)
     for (i = 0; i < nlocal; i++)
       for (m = 0; m < nvalues; m++)
-	array[i][m] = 0.0;
-  
+        array[i][m] = 0.0;
+
   // accumulate results of attributes,computes,fixes,variables to local copy
   // compute/fix/variable may invoke computes so wrap with clear/add
 
@@ -303,50 +303,50 @@ void FixAveAtom::end_of_step()
     if (which[m] == X) {
       double **x = atom->x;
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) array[i][m] += x[i][j];
+        if (mask[i] & groupbit) array[i][m] += x[i][j];
 
     } else if (which[m] == V) {
       double **v = atom->v;
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) array[i][m] += v[i][j];
+        if (mask[i] & groupbit) array[i][m] += v[i][j];
 
     } else if (which[m] == F) {
       double **f = atom->f;
       for (i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit) array[i][m] += f[i][j];
+        if (mask[i] & groupbit) array[i][m] += f[i][j];
 
     // invoke compute if not previously invoked
 
     } else if (which[m] == COMPUTE) {
       Compute *compute = modify->compute[n];
       if (!(compute->invoked_flag & INVOKED_PERATOM)) {
-	compute->compute_peratom();
-	compute->invoked_flag |= INVOKED_PERATOM;
+        compute->compute_peratom();
+        compute->invoked_flag |= INVOKED_PERATOM;
       }
 
       if (j == 0) {
-	double *compute_vector = compute->vector_atom;
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit) array[i][m] += compute_vector[i];
+        double *compute_vector = compute->vector_atom;
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit) array[i][m] += compute_vector[i];
       } else {
-	int jm1 = j - 1;
-	double **compute_array = compute->array_atom;
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit) array[i][m] += compute_array[i][jm1];
+        int jm1 = j - 1;
+        double **compute_array = compute->array_atom;
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit) array[i][m] += compute_array[i][jm1];
       }
 
     // access fix fields, guaranteed to be ready
 
     } else if (which[m] == FIX) {
       if (j == 0) {
-	double *fix_vector = modify->fix[n]->vector_atom;
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit) array[i][m] += fix_vector[i];
+        double *fix_vector = modify->fix[n]->vector_atom;
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit) array[i][m] += fix_vector[i];
       } else {
-	int jm1 = j - 1;
-	double **fix_array = modify->fix[n]->array_atom;
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit) array[i][m] += fix_array[i][jm1];
+        int jm1 = j - 1;
+        double **fix_array = modify->fix[n]->array_atom;
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit) array[i][m] += fix_array[i][jm1];
       }
 
     // evaluate atom-style variable
diff --git a/src/fix_ave_atom.h b/src/fix_ave_atom.h
index 10bfb34fad..67d760660a 100644
--- a/src/fix_ave_atom.h
+++ b/src/fix_ave_atom.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp
index 390ce63f54..a08f537bd4 100644
--- a/src/fix_ave_correlate.cpp
+++ b/src/fix_ave_correlate.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -65,9 +65,9 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
 
   int iarg = 6;
   while (iarg < narg) {
-    if (strncmp(arg[iarg],"c_",2) == 0 || 
-	strncmp(arg[iarg],"f_",2) == 0 || 
-	strncmp(arg[iarg],"v_",2) == 0) {
+    if (strncmp(arg[iarg],"c_",2) == 0 ||
+        strncmp(arg[iarg],"f_",2) == 0 ||
+        strncmp(arg[iarg],"v_",2) == 0) {
       if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE;
       else if (arg[iarg][0] == 'f') which[nvalues] = FIX;
       else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE;
@@ -78,10 +78,10 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Illegal fix ave/correlate command");
-	argindex[nvalues] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Illegal fix ave/correlate command");
+        argindex[nvalues] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[nvalues] = 0;
 
       n = strlen(suffix) + 1;
@@ -133,12 +133,12 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
     } else if (strcmp(arg[iarg],"file") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command");
       if (me == 0) {
-	fp = fopen(arg[iarg+1],"w");
-	if (fp == NULL) {
-	  char str[128];
-	  sprintf(str,"Cannot open fix ave/correlate file %s",arg[iarg+1]);
-	  error->one(FLERR,str);
-	}
+        fp = fopen(arg[iarg+1],"w");
+        if (fp == NULL) {
+          char str[128];
+          sprintf(str,"Cannot open fix ave/correlate file %s",arg[iarg+1]);
+          error->one(FLERR,str);
+        }
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"title1") == 0) {
@@ -179,39 +179,39 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/correlate does not exist");
+        error->all(FLERR,"Compute ID for fix ave/correlate does not exist");
       if (argindex[i] == 0 && modify->compute[icompute]->scalar_flag == 0)
-	error->all(FLERR,
-		   "Fix ave/correlate compute does not calculate a scalar");
+        error->all(FLERR,
+                   "Fix ave/correlate compute does not calculate a scalar");
       if (argindex[i] && modify->compute[icompute]->vector_flag == 0)
-	error->all(FLERR,
-		   "Fix ave/correlate compute does not calculate a vector");
+        error->all(FLERR,
+                   "Fix ave/correlate compute does not calculate a vector");
       if (argindex[i] && argindex[i] > modify->compute[icompute]->size_vector)
-	error->all(FLERR,"Fix ave/correlate compute vector "
-		   "is accessed out-of-range");
+        error->all(FLERR,"Fix ave/correlate compute vector "
+                   "is accessed out-of-range");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for fix ave/correlate does not exist");
+        error->all(FLERR,"Fix ID for fix ave/correlate does not exist");
       if (argindex[i] == 0 && modify->fix[ifix]->scalar_flag == 0)
-	error->all(FLERR,"Fix ave/correlate fix does not calculate a scalar");
+        error->all(FLERR,"Fix ave/correlate fix does not calculate a scalar");
       if (argindex[i] && modify->fix[ifix]->vector_flag == 0)
-	error->all(FLERR,"Fix ave/correlate fix does not calculate a vector");
+        error->all(FLERR,"Fix ave/correlate fix does not calculate a vector");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_vector)
-	error->all(FLERR,
-		   "Fix ave/correlate fix vector is accessed out-of-range");
+        error->all(FLERR,
+                   "Fix ave/correlate fix vector is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all(FLERR,"Fix for fix ave/correlate "
-		   "not computed at compatible time");
+        error->all(FLERR,"Fix for fix ave/correlate "
+                   "not computed at compatible time");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all(FLERR,"Variable name for fix ave/correlate does not exist");
+        error->all(FLERR,"Variable name for fix ave/correlate does not exist");
       if (input->variable->equalstyle(ivariable) == 0)
-	error->all(FLERR,
-		   "Fix ave/correlate variable is not equal-style variable");
+        error->all(FLERR,
+                   "Fix ave/correlate variable is not equal-style variable");
     }
   }
 
@@ -233,28 +233,28 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
     else {
       fprintf(fp,"# Index TimeDelta Ncount");
       if (type == AUTO)
-	for (int i = 0; i < nvalues; i++)
-	  fprintf(fp," %s*%s",arg[6+i],arg[6+i]);
+        for (int i = 0; i < nvalues; i++)
+          fprintf(fp," %s*%s",arg[6+i],arg[6+i]);
       else if (type == UPPER)
-	for (int i = 0; i < nvalues; i++)
-	  for (int j = i+1; j < nvalues; j++)
-	    fprintf(fp," %s*%s",arg[6+i],arg[6+j]);
-      else if (type == LOWER) 
-	for (int i = 0; i < nvalues; i++)
-	  for (int j = 0; j < i-1; j++)
-	    fprintf(fp," %s*%s",arg[6+i],arg[6+j]);
+        for (int i = 0; i < nvalues; i++)
+          for (int j = i+1; j < nvalues; j++)
+            fprintf(fp," %s*%s",arg[6+i],arg[6+j]);
+      else if (type == LOWER)
+        for (int i = 0; i < nvalues; i++)
+          for (int j = 0; j < i-1; j++)
+            fprintf(fp," %s*%s",arg[6+i],arg[6+j]);
       else if (type == AUTOUPPER)
-	for (int i = 0; i < nvalues; i++)
-	  for (int j = i; j < nvalues; j++)
-	    fprintf(fp," %s*%s",arg[6+i],arg[6+j]);
-      else if (type == AUTOLOWER) 
-	for (int i = 0; i < nvalues; i++)
-	  for (int j = 0; j < i; j++)
-	    fprintf(fp," %s*%s",arg[6+i],arg[6+j]);
+        for (int i = 0; i < nvalues; i++)
+          for (int j = i; j < nvalues; j++)
+            fprintf(fp," %s*%s",arg[6+i],arg[6+j]);
+      else if (type == AUTOLOWER)
+        for (int i = 0; i < nvalues; i++)
+          for (int j = 0; j < i; j++)
+            fprintf(fp," %s*%s",arg[6+i],arg[6+j]);
       else if (type == FULL)
-	for (int i = 0; i < nvalues; i++)
-	  for (int j = 0; j < nvalues; j++)
-	    fprintf(fp," %s*%s",arg[6+i],arg[6+j]);
+        for (int i = 0; i < nvalues; i++)
+          for (int j = 0; j < nvalues; j++)
+            fprintf(fp," %s*%s",arg[6+i],arg[6+j]);
       fprintf(fp,"\n");
     }
   }
@@ -262,7 +262,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg):
   delete [] title1;
   delete [] title2;
   delete [] title3;
-  
+
   // allocate and initialize memory for averaging
   // set count and corr to zero since they accumulate
   // also set save versions to zero in case accessed via compute_array()
@@ -337,19 +337,19 @@ void FixAveCorrelate::init()
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/correlate does not exist");
+        error->all(FLERR,"Compute ID for fix ave/correlate does not exist");
       value2index[i] = icompute;
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
-      if (ifix < 0) 
-	error->all(FLERR,"Fix ID for fix ave/correlate does not exist");
+      if (ifix < 0)
+        error->all(FLERR,"Fix ID for fix ave/correlate does not exist");
       value2index[i] = ifix;
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
-      if (ivariable < 0) 
-	error->all(FLERR,"Variable name for fix ave/correlate does not exist");
+      if (ivariable < 0)
+        error->all(FLERR,"Variable name for fix ave/correlate does not exist");
       value2index[i] = ivariable;
     }
   }
@@ -398,39 +398,39 @@ void FixAveCorrelate::end_of_step()
 
   for (i = 0; i < nvalues; i++) {
     m = value2index[i];
-    
+
     // invoke compute if not previously invoked
-    
+
     if (which[i] == COMPUTE) {
       Compute *compute = modify->compute[m];
-      
+
       if (argindex[i] == 0) {
-	if (!(compute->invoked_flag & INVOKED_SCALAR)) {
-	  compute->compute_scalar();
-	  compute->invoked_flag |= INVOKED_SCALAR;
-	}
-	scalar = compute->scalar;
+        if (!(compute->invoked_flag & INVOKED_SCALAR)) {
+          compute->compute_scalar();
+          compute->invoked_flag |= INVOKED_SCALAR;
+        }
+        scalar = compute->scalar;
       } else {
-	if (!(compute->invoked_flag & INVOKED_VECTOR)) {
-	  compute->compute_vector();
-	  compute->invoked_flag |= INVOKED_VECTOR;
-	}
-	scalar = compute->vector[argindex[i]-1];
+        if (!(compute->invoked_flag & INVOKED_VECTOR)) {
+          compute->compute_vector();
+          compute->invoked_flag |= INVOKED_VECTOR;
+        }
+        scalar = compute->vector[argindex[i]-1];
       }
-      
+
     // access fix fields, guaranteed to be ready
-      
+
     } else if (which[i] == FIX) {
-      if (argindex[i] == 0) 
-	scalar = modify->fix[m]->compute_scalar();
+      if (argindex[i] == 0)
+        scalar = modify->fix[m]->compute_scalar();
       else
-	scalar = modify->fix[m]->compute_vector(argindex[i]-1);
-      
+        scalar = modify->fix[m]->compute_vector(argindex[i]-1);
+
     // evaluate equal-style variable
-      
+
     } else if (which[i] == VARIABLE)
       scalar = input->variable->compute_equal(m);
-    
+
     values[lastindex][i] = scalar;
   }
 
@@ -457,10 +457,10 @@ void FixAveCorrelate::end_of_step()
     save_count[i] = count[i];
     if (count[i])
       for (j = 0; j < npair; j++)
-	save_corr[i][j] = prefactor*corr[i][j]/count[i];
+        save_corr[i][j] = prefactor*corr[i][j]/count[i];
     else
       for (j = 0; j < npair; j++)
-	save_corr[i][j] = 0.0;
+        save_corr[i][j] = 0.0;
   }
 
   // output to file
@@ -470,11 +470,11 @@ void FixAveCorrelate::end_of_step()
     for (i = 0; i < nrepeat; i++) {
       fprintf(fp,"%d %d %d",i+1,i*nevery,count[i]);
       if (count[i])
-	for (j = 0; j < npair; j++)
-	  fprintf(fp," %g",prefactor*corr[i][j]/count[i]);
+        for (j = 0; j < npair; j++)
+          fprintf(fp," %g",prefactor*corr[i][j]/count[i]);
       else
-	for (j = 0; j < npair; j++)
-	  fprintf(fp," 0.0");
+        for (j = 0; j < npair; j++)
+          fprintf(fp," 0.0");
       fprintf(fp,"\n");
     }
     fflush(fp);
@@ -487,7 +487,7 @@ void FixAveCorrelate::end_of_step()
     for (i = 0; i < nrepeat; i++) {
       count[i] = 0;
       for (j = 0; j < npair; j++)
-	corr[i][j] = 0.0;
+        corr[i][j] = 0.0;
     }
     nsample = 1;
     accumulate();
@@ -509,7 +509,7 @@ void FixAveCorrelate::accumulate()
     for (k = 0; k < nsample; k++) {
       ipair = 0;
       for (i = 0; i < nvalues; i++) {
-	corr[k][ipair++] += values[m][i]*values[n][i];
+        corr[k][ipair++] += values[m][i]*values[n][i];
       }
       m--;
       if (m < 0) m = nrepeat-1;
@@ -519,8 +519,8 @@ void FixAveCorrelate::accumulate()
     for (k = 0; k < nsample; k++) {
       ipair = 0;
       for (i = 0; i < nvalues; i++)
-	for (j = i+1; j < nvalues; j++)
-	  corr[k][ipair++] += values[m][i]*values[n][j];
+        for (j = i+1; j < nvalues; j++)
+          corr[k][ipair++] += values[m][i]*values[n][j];
       m--;
       if (m < 0) m = nrepeat-1;
     }
@@ -529,8 +529,8 @@ void FixAveCorrelate::accumulate()
     for (k = 0; k < nsample; k++) {
       ipair = 0;
       for (i = 0; i < nvalues; i++)
-	for (j = 0; j < i-1; j++)
-	  corr[k][ipair++] += values[m][i]*values[n][j];
+        for (j = 0; j < i-1; j++)
+          corr[k][ipair++] += values[m][i]*values[n][j];
       m--;
       if (m < 0) m = nrepeat-1;
     }
@@ -539,8 +539,8 @@ void FixAveCorrelate::accumulate()
     for (k = 0; k < nsample; k++) {
       ipair = 0;
       for (i = 0; i < nvalues; i++)
-	for (j = i; j < nvalues; j++)
-	  corr[k][ipair++] += values[m][i]*values[n][j];
+        for (j = i; j < nvalues; j++)
+          corr[k][ipair++] += values[m][i]*values[n][j];
       m--;
       if (m < 0) m = nrepeat-1;
     }
@@ -549,8 +549,8 @@ void FixAveCorrelate::accumulate()
     for (k = 0; k < nsample; k++) {
       ipair = 0;
       for (i = 0; i < nvalues; i++)
-	for (j = 0; j < i; j++)
-	  corr[k][ipair++] += values[m][i]*values[n][j];
+        for (j = 0; j < i; j++)
+          corr[k][ipair++] += values[m][i]*values[n][j];
       m--;
       if (m < 0) m = nrepeat-1;
     }
@@ -559,8 +559,8 @@ void FixAveCorrelate::accumulate()
     for (k = 0; k < nsample; k++) {
       ipair = 0;
       for (i = 0; i < nvalues; i++)
-	for (j = 0; j < nvalues; j++)
-	  corr[k][ipair++] += values[m][i]*values[n][j];
+        for (j = 0; j < nvalues; j++)
+          corr[k][ipair++] += values[m][i]*values[n][j];
       m--;
       if (m < 0) m = nrepeat-1;
     }
diff --git a/src/fix_ave_correlate.h b/src/fix_ave_correlate.h
index cae02b83e4..b54a68c908 100644
--- a/src/fix_ave_correlate.h
+++ b/src/fix_ave_correlate.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -57,7 +57,7 @@ class FixAveCorrelate : public Fix {
 
   int *save_count;     // saved values at Nfreq for output via compute_array()
   double **save_corr;
-    
+
   void accumulate();
   bigint nextvalid();
 };
diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp
index 7dd5a1f6d7..05d5a43431 100644
--- a/src/fix_ave_histo.cpp
+++ b/src/fix_ave_histo.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -74,17 +74,17 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 9;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"x") == 0 ||
-	strcmp(arg[iarg],"y") == 0 ||
-	strcmp(arg[iarg],"z") == 0 || 
-	strcmp(arg[iarg],"vx") == 0 ||
-	strcmp(arg[iarg],"vy") == 0 ||
-	strcmp(arg[iarg],"vz") == 0 ||
-	strcmp(arg[iarg],"fx") == 0 ||
-	strcmp(arg[iarg],"fy") == 0 ||
-	strcmp(arg[iarg],"fz") == 0 ||
-	strncmp(arg[iarg],"c_",2) == 0 || 
-	strncmp(arg[iarg],"f_",2) == 0 || 
-	strncmp(arg[iarg],"v_",2) == 0) {
+        strcmp(arg[iarg],"y") == 0 ||
+        strcmp(arg[iarg],"z") == 0 ||
+        strcmp(arg[iarg],"vx") == 0 ||
+        strcmp(arg[iarg],"vy") == 0 ||
+        strcmp(arg[iarg],"vz") == 0 ||
+        strcmp(arg[iarg],"fx") == 0 ||
+        strcmp(arg[iarg],"fy") == 0 ||
+        strcmp(arg[iarg],"fz") == 0 ||
+        strncmp(arg[iarg],"c_",2) == 0 ||
+        strncmp(arg[iarg],"f_",2) == 0 ||
+        strncmp(arg[iarg],"v_",2) == 0) {
       nvalues++;
       iarg++;
     } else break;
@@ -162,9 +162,9 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
       nvalues++;
       iarg++;
 
-    } else if ((strncmp(arg[iarg],"c_",2) == 0) || 
-	(strncmp(arg[iarg],"f_",2) == 0) || 
-	(strncmp(arg[iarg],"v_",2) == 0)) {
+    } else if ((strncmp(arg[iarg],"c_",2) == 0) ||
+        (strncmp(arg[iarg],"f_",2) == 0) ||
+        (strncmp(arg[iarg],"v_",2) == 0)) {
       if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE;
       else if (arg[iarg][0] == 'f') which[nvalues] = FIX;
       else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE;
@@ -175,10 +175,10 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Illegal fix ave/histo command");
-	argindex[nvalues] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Illegal fix ave/histo command");
+        argindex[nvalues] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[nvalues] = 0;
 
       n = strlen(suffix) + 1;
@@ -186,45 +186,45 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
       strcpy(ids[nvalues],suffix);
       delete [] suffix;
 
-      if (mode == VECTOR && which[nvalues] == COMPUTE && 
-	  argindex[nvalues] == 0) {
-	int icompute = modify->find_compute(ids[nvalues]);
-	if (icompute < 0)
-	  error->all(FLERR,"Compute ID for fix ave/histo does not exist");
-	if (modify->compute[icompute]->array_flag) {
-	  int ncols = modify->compute[icompute]->size_array_cols;
-	  maxvalues += ncols-1;
-	  allocate_values(maxvalues);
-	  argindex[nvalues] = 1;
-	  for (int icol = 1; icol < ncols; icol++) {
-	    which[nvalues+icol] = which[nvalues];
-	    argindex[nvalues+icol] = icol+1;
-	    n = strlen(ids[nvalues]) + 1;
-	    ids[nvalues+icol] = new char[n];
-	    strcpy(ids[nvalues+icol],ids[nvalues]);
-	  }
-	  nvalues += ncols-1;
-	}
-
-      } else if (mode == VECTOR && which[nvalues] == FIX && 
-		 argindex[nvalues] == 0) {
-	int ifix = modify->find_fix(ids[nvalues]);
-	if (ifix < 0)
-	  error->all(FLERR,"Fix ID for fix ave/histo does not exist");
-	if (modify->fix[ifix]->array_flag) {
-	  int ncols = modify->fix[ifix]->size_array_cols;
-	  maxvalues += ncols-1;
-	  allocate_values(maxvalues);
-	  argindex[nvalues] = 1;
-	  for (int icol = 1; icol < ncols; icol++) {
-	    which[nvalues+icol] = which[nvalues];
-	    argindex[nvalues+icol] = icol+1;
-	    n = strlen(ids[nvalues]) + 1;
-	    ids[nvalues+icol] = new char[n];
-	    strcpy(ids[nvalues+icol],ids[nvalues]);
-	  }
-	  nvalues += ncols-1;
-	}
+      if (mode == VECTOR && which[nvalues] == COMPUTE &&
+          argindex[nvalues] == 0) {
+        int icompute = modify->find_compute(ids[nvalues]);
+        if (icompute < 0)
+          error->all(FLERR,"Compute ID for fix ave/histo does not exist");
+        if (modify->compute[icompute]->array_flag) {
+          int ncols = modify->compute[icompute]->size_array_cols;
+          maxvalues += ncols-1;
+          allocate_values(maxvalues);
+          argindex[nvalues] = 1;
+          for (int icol = 1; icol < ncols; icol++) {
+            which[nvalues+icol] = which[nvalues];
+            argindex[nvalues+icol] = icol+1;
+            n = strlen(ids[nvalues]) + 1;
+            ids[nvalues+icol] = new char[n];
+            strcpy(ids[nvalues+icol],ids[nvalues]);
+          }
+          nvalues += ncols-1;
+        }
+
+      } else if (mode == VECTOR && which[nvalues] == FIX &&
+                 argindex[nvalues] == 0) {
+        int ifix = modify->find_fix(ids[nvalues]);
+        if (ifix < 0)
+          error->all(FLERR,"Fix ID for fix ave/histo does not exist");
+        if (modify->fix[ifix]->array_flag) {
+          int ncols = modify->fix[ifix]->size_array_cols;
+          maxvalues += ncols-1;
+          allocate_values(maxvalues);
+          argindex[nvalues] = 1;
+          for (int icol = 1; icol < ncols; icol++) {
+            which[nvalues+icol] = which[nvalues];
+            argindex[nvalues+icol] = icol+1;
+            n = strlen(ids[nvalues]) + 1;
+            ids[nvalues+icol] = new char[n];
+            strcpy(ids[nvalues+icol],ids[nvalues]);
+          }
+          nvalues += ncols-1;
+        }
       }
 
       nvalues++;
@@ -249,14 +249,14 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
     else if (which[i] == COMPUTE) {
       Compute *compute = modify->compute[modify->find_compute(ids[0])];
       if (compute->scalar_flag || compute->vector_flag || compute->array_flag)
-	kindflag = GLOBAL;
+        kindflag = GLOBAL;
       else if (compute->peratom_flag) kindflag = PERATOM;
       else if (compute->local_flag) kindflag = LOCAL;
       else error->all(FLERR,"Fix ave/histo input is invalid compute");
     } else if (which[i] == FIX) {
       Fix *fix = modify->fix[modify->find_fix(ids[0])];
       if (fix->scalar_flag || fix->vector_flag || fix->array_flag)
-	kindflag = GLOBAL;
+        kindflag = GLOBAL;
       else if (fix->peratom_flag) kindflag = PERATOM;
       else if (fix->local_flag) kindflag = LOCAL;
       else error->all(FLERR,"Fix ave/histo input is invalid fix");
@@ -271,7 +271,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
       error->all(FLERR,"Fix ave/histo inputs are not all global, peratom, or local");
   }
 
-  if (kind == PERATOM && mode == SCALAR) 
+  if (kind == PERATOM && mode == SCALAR)
     error->all(FLERR,"Fix ave/histo cannot input per-atom values in scalar mode");
   if (kind == LOCAL && mode == SCALAR)
     error->all(FLERR,"Fix ave/histo cannot input local values in scalar mode");
@@ -280,133 +280,133 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
     if (which[i] == COMPUTE && kind == GLOBAL && mode == SCALAR) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/histo does not exist");
+        error->all(FLERR,"Compute ID for fix ave/histo does not exist");
       if (argindex[i] == 0 && modify->compute[icompute]->scalar_flag == 0)
-	error->all(FLERR,"Fix ave/histo compute does not calculate a global scalar");
+        error->all(FLERR,"Fix ave/histo compute does not calculate a global scalar");
       if (argindex[i] && modify->compute[icompute]->vector_flag == 0)
-	error->all(FLERR,"Fix ave/histo compute does not calculate a global vector");
+        error->all(FLERR,"Fix ave/histo compute does not calculate a global vector");
       if (argindex[i] && argindex[i] > modify->compute[icompute]->size_vector)
-	error->all(FLERR,"Fix ave/histo compute vector is accessed out-of-range");
+        error->all(FLERR,"Fix ave/histo compute vector is accessed out-of-range");
 
     } else if (which[i] == COMPUTE && kind == GLOBAL && mode == VECTOR) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/histo does not exist");
+        error->all(FLERR,"Compute ID for fix ave/histo does not exist");
       if (argindex[i] == 0 && modify->compute[icompute]->vector_flag == 0)
-	error->all(FLERR,"Fix ave/histo compute does not calculate a global vector");
+        error->all(FLERR,"Fix ave/histo compute does not calculate a global vector");
       if (argindex[i] && modify->compute[icompute]->array_flag == 0)
-	error->all(FLERR,"Fix ave/histo compute does not calculate a global array");
-      if (argindex[i] && 
-	  argindex[i] > modify->compute[icompute]->size_array_cols)
-	error->all(FLERR,"Fix ave/histo compute array is accessed out-of-range");
+        error->all(FLERR,"Fix ave/histo compute does not calculate a global array");
+      if (argindex[i] &&
+          argindex[i] > modify->compute[icompute]->size_array_cols)
+        error->all(FLERR,"Fix ave/histo compute array is accessed out-of-range");
 
     } else if (which[i] == COMPUTE && kind == PERATOM) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/histo does not exist");
+        error->all(FLERR,"Compute ID for fix ave/histo does not exist");
       if (modify->compute[icompute]->peratom_flag == 0)
-	error->all(FLERR,"Fix ave/histo compute does not calculate per-atom values");
-      if (argindex[i] == 0 && 
-	  modify->compute[icompute]->size_peratom_cols != 0)
-	error->all(FLERR,"Fix ave/histo compute does not "
-		   "calculate a per-atom vector");
+        error->all(FLERR,"Fix ave/histo compute does not calculate per-atom values");
+      if (argindex[i] == 0 &&
+          modify->compute[icompute]->size_peratom_cols != 0)
+        error->all(FLERR,"Fix ave/histo compute does not "
+                   "calculate a per-atom vector");
       if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	error->all(FLERR,"Fix ave/histo compute does not "
-		   "calculate a per-atom array");
-      if (argindex[i] && 
-	  argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	error->all(FLERR,"Fix ave/histo compute array is accessed out-of-range");
+        error->all(FLERR,"Fix ave/histo compute does not "
+                   "calculate a per-atom array");
+      if (argindex[i] &&
+          argindex[i] > modify->compute[icompute]->size_peratom_cols)
+        error->all(FLERR,"Fix ave/histo compute array is accessed out-of-range");
 
     } else if (which[i] == COMPUTE && kind == LOCAL) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/histo does not exist");
+        error->all(FLERR,"Compute ID for fix ave/histo does not exist");
       if (modify->compute[icompute]->local_flag == 0)
-	error->all(FLERR,"Fix ave/histo compute does not calculate local values");
-      if (argindex[i] == 0 && 
-	  modify->compute[icompute]->size_local_cols != 0)
-	error->all(FLERR,"Fix ave/histo compute does not "
-		   "calculate a local vector");
+        error->all(FLERR,"Fix ave/histo compute does not calculate local values");
+      if (argindex[i] == 0 &&
+          modify->compute[icompute]->size_local_cols != 0)
+        error->all(FLERR,"Fix ave/histo compute does not "
+                   "calculate a local vector");
       if (argindex[i] && modify->compute[icompute]->size_local_cols == 0)
-	error->all(FLERR,"Fix ave/histo compute does not "
-		   "calculate a local array");
-      if (argindex[i] && 
-	  argindex[i] > modify->compute[icompute]->size_local_cols)
-	error->all(FLERR,"Fix ave/histo compute array is accessed out-of-range");
+        error->all(FLERR,"Fix ave/histo compute does not "
+                   "calculate a local array");
+      if (argindex[i] &&
+          argindex[i] > modify->compute[icompute]->size_local_cols)
+        error->all(FLERR,"Fix ave/histo compute array is accessed out-of-range");
 
     } else if (which[i] == FIX && kind == GLOBAL && mode == SCALAR) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for fix ave/histo does not exist");
+        error->all(FLERR,"Fix ID for fix ave/histo does not exist");
       if (argindex[i] == 0 && modify->fix[ifix]->scalar_flag == 0)
-	error->all(FLERR,"Fix ave/histo fix does not calculate a global scalar");
+        error->all(FLERR,"Fix ave/histo fix does not calculate a global scalar");
       if (argindex[i] && modify->fix[ifix]->vector_flag == 0)
-	error->all(FLERR,"Fix ave/histo fix does not calculate a global vector");
+        error->all(FLERR,"Fix ave/histo fix does not calculate a global vector");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_vector)
-	error->all(FLERR,"Fix ave/histo fix vector is accessed out-of-range");
+        error->all(FLERR,"Fix ave/histo fix vector is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
+        error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
 
     } else if (which[i] == FIX && kind == GLOBAL && mode == VECTOR) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for fix ave/histo does not exist");
+        error->all(FLERR,"Fix ID for fix ave/histo does not exist");
       if (argindex[i] == 0 && modify->fix[ifix]->vector_flag == 0)
-	error->all(FLERR,"Fix ave/histo fix does not calculate a global vector");
+        error->all(FLERR,"Fix ave/histo fix does not calculate a global vector");
       if (argindex[i] && modify->fix[ifix]->array_flag == 0)
-	error->all(FLERR,"Fix ave/histo fix does not calculate a global array");
+        error->all(FLERR,"Fix ave/histo fix does not calculate a global array");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_array_cols)
-	error->all(FLERR,"Fix ave/histo fix array is accessed out-of-range");
+        error->all(FLERR,"Fix ave/histo fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
+        error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
 
     } else if (which[i] == FIX && kind == PERATOM) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for fix ave/histo does not exist");
+        error->all(FLERR,"Fix ID for fix ave/histo does not exist");
       if (modify->fix[ifix]->peratom_flag == 0)
-	error->all(FLERR,"Fix ave/histo fix does not calculate per-atom values");
-      if (argindex[i] == 0 && 
-	  modify->fix[ifix]->size_peratom_cols != 0)
-	error->all(FLERR,"Fix ave/histo fix does not "
-		   "calculate a per-atom vector");
+        error->all(FLERR,"Fix ave/histo fix does not calculate per-atom values");
+      if (argindex[i] == 0 &&
+          modify->fix[ifix]->size_peratom_cols != 0)
+        error->all(FLERR,"Fix ave/histo fix does not "
+                   "calculate a per-atom vector");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	error->all(FLERR,"Fix ave/histo fix does not "
-		   "calculate a per-atom array");
-      if (argindex[i] && 
-	  argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	error->all(FLERR,"Fix ave/histo fix array is accessed out-of-range");
+        error->all(FLERR,"Fix ave/histo fix does not "
+                   "calculate a per-atom array");
+      if (argindex[i] &&
+          argindex[i] > modify->fix[ifix]->size_peratom_cols)
+        error->all(FLERR,"Fix ave/histo fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
+        error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
 
     } else if (which[i] == FIX && kind == LOCAL) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for fix ave/histo does not exist");
+        error->all(FLERR,"Fix ID for fix ave/histo does not exist");
       if (modify->fix[ifix]->local_flag == 0)
-	error->all(FLERR,"Fix ave/histo fix does not calculate local values");
-      if (argindex[i] == 0 && 
-	  modify->fix[ifix]->size_local_cols != 0)
-	error->all(FLERR,"Fix ave/histo fix does not "
-		   "calculate a local vector");
+        error->all(FLERR,"Fix ave/histo fix does not calculate local values");
+      if (argindex[i] == 0 &&
+          modify->fix[ifix]->size_local_cols != 0)
+        error->all(FLERR,"Fix ave/histo fix does not "
+                   "calculate a local vector");
       if (argindex[i] && modify->fix[ifix]->size_local_cols == 0)
-	error->all(FLERR,"Fix ave/histo fix does not "
-		   "calculate a local array");
-      if (argindex[i] && 
-	  argindex[i] > modify->fix[ifix]->size_local_cols)
-	error->all(FLERR,"Fix ave/histo fix array is accessed out-of-range");
+        error->all(FLERR,"Fix ave/histo fix does not "
+                   "calculate a local array");
+      if (argindex[i] &&
+          argindex[i] > modify->fix[ifix]->size_local_cols)
+        error->all(FLERR,"Fix ave/histo fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
+        error->all(FLERR,"Fix for fix ave/histo not computed at compatible time");
 
     } else if (which[i] == VARIABLE && kind == GLOBAL) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all(FLERR,"Variable name for fix ave/histo does not exist");
+        error->all(FLERR,"Variable name for fix ave/histo does not exist");
 
     } else if (which[i] == VARIABLE && kind == PERATOM) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all(FLERR,"Variable name for fix ave/histo does not exist");
+        error->all(FLERR,"Variable name for fix ave/histo does not exist");
     }
   }
 
@@ -417,7 +417,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) :
     else fprintf(fp,"# Histogrammed data for fix %s\n",id);
     if (title2) fprintf(fp,"%s\n",title2);
     else fprintf(fp,"# TimeStep Number-of-bins "
-		 "Total-counts Missing-counts Min-value Max-value\n");
+                 "Total-counts Missing-counts Min-value Max-value\n");
     if (title3) fprintf(fp,"%s\n",title3);
     else fprintf(fp,"# Bin Coord Count Count/Total\n");
   }
@@ -521,19 +521,19 @@ void FixAveHisto::init()
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/histo does not exist");
+        error->all(FLERR,"Compute ID for fix ave/histo does not exist");
       value2index[i] = icompute;
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
-      if (ifix < 0) 
-	error->all(FLERR,"Fix ID for fix ave/histo does not exist");
+      if (ifix < 0)
+        error->all(FLERR,"Fix ID for fix ave/histo does not exist");
       value2index[i] = ifix;
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
-      if (ivariable < 0) 
-	error->all(FLERR,"Variable name for fix ave/histo does not exist");
+      if (ivariable < 0)
+        error->all(FLERR,"Variable name for fix ave/histo does not exist");
       value2index[i] = ivariable;
     }
   }
@@ -595,103 +595,103 @@ void FixAveHisto::end_of_step()
       bin_atoms(&atom->f[0][j],3);
 
     // invoke compute if not previously invoked
-    
+
     if (which[i] == COMPUTE) {
       Compute *compute = modify->compute[m];
 
       if (kind == GLOBAL && mode == SCALAR) {
-	if (j == 0) {
-	  if (!(compute->invoked_flag & INVOKED_SCALAR)) {
-	    compute->compute_scalar();
-	    compute->invoked_flag |= INVOKED_SCALAR;
-	  }
-	  bin_one(compute->scalar);
-	} else {
-	  if (!(compute->invoked_flag & INVOKED_VECTOR)) {
-	    compute->compute_vector();
-	    compute->invoked_flag |= INVOKED_VECTOR;
-	  }
-	  bin_one(compute->vector[j-1]);
-	}
+        if (j == 0) {
+          if (!(compute->invoked_flag & INVOKED_SCALAR)) {
+            compute->compute_scalar();
+            compute->invoked_flag |= INVOKED_SCALAR;
+          }
+          bin_one(compute->scalar);
+        } else {
+          if (!(compute->invoked_flag & INVOKED_VECTOR)) {
+            compute->compute_vector();
+            compute->invoked_flag |= INVOKED_VECTOR;
+          }
+          bin_one(compute->vector[j-1]);
+        }
       } else if (kind == GLOBAL && mode == VECTOR) {
-	if (j == 0) {
-	  if (!(compute->invoked_flag & INVOKED_VECTOR)) {
-	    compute->compute_vector();
-	    compute->invoked_flag |= INVOKED_VECTOR;
-	  }
-	  bin_vector(compute->size_vector,compute->vector,1);
-	} else {
-	  if (!(compute->invoked_flag & INVOKED_ARRAY)) {
-	    compute->compute_array();
-	    compute->invoked_flag |= INVOKED_ARRAY;
-	  }
-	  bin_vector(compute->size_array_rows,&compute->array[0][j-1],
-		     compute->size_array_cols);
-	}
+        if (j == 0) {
+          if (!(compute->invoked_flag & INVOKED_VECTOR)) {
+            compute->compute_vector();
+            compute->invoked_flag |= INVOKED_VECTOR;
+          }
+          bin_vector(compute->size_vector,compute->vector,1);
+        } else {
+          if (!(compute->invoked_flag & INVOKED_ARRAY)) {
+            compute->compute_array();
+            compute->invoked_flag |= INVOKED_ARRAY;
+          }
+          bin_vector(compute->size_array_rows,&compute->array[0][j-1],
+                     compute->size_array_cols);
+        }
 
       } else if (kind == PERATOM) {
-	if (!(compute->invoked_flag & INVOKED_PERATOM)) {
-	  compute->compute_peratom();
-	  compute->invoked_flag |= INVOKED_PERATOM;
-	}
-	if (j == 0)
-	  bin_atoms(compute->vector_atom,1);
-	else
-	  bin_atoms(compute->array_atom[j-1],
-		    compute->size_peratom_cols);
+        if (!(compute->invoked_flag & INVOKED_PERATOM)) {
+          compute->compute_peratom();
+          compute->invoked_flag |= INVOKED_PERATOM;
+        }
+        if (j == 0)
+          bin_atoms(compute->vector_atom,1);
+        else
+          bin_atoms(compute->array_atom[j-1],
+                    compute->size_peratom_cols);
 
       } else if (kind == LOCAL) {
-	if (!(compute->invoked_flag & INVOKED_LOCAL)) {
-	  compute->compute_local();
-	  compute->invoked_flag |= INVOKED_LOCAL;
-	}
-	if (j == 0)
-	  bin_vector(compute->size_local_rows,compute->vector_local,1);
-	else
-	  bin_vector(compute->size_local_rows,&compute->array_local[0][j-1],
-		     compute->size_local_cols);
+        if (!(compute->invoked_flag & INVOKED_LOCAL)) {
+          compute->compute_local();
+          compute->invoked_flag |= INVOKED_LOCAL;
+        }
+        if (j == 0)
+          bin_vector(compute->size_local_rows,compute->vector_local,1);
+        else
+          bin_vector(compute->size_local_rows,&compute->array_local[0][j-1],
+                     compute->size_local_cols);
       }
 
       // access fix fields, guaranteed to be ready
-      
+
     } else if (which[i] == FIX) {
 
       Fix *fix = modify->fix[m];
 
       if (kind == GLOBAL && mode == SCALAR) {
-	if (j == 0) bin_one(fix->compute_scalar());
-	else bin_one(fix->compute_vector(j-1));
+        if (j == 0) bin_one(fix->compute_scalar());
+        else bin_one(fix->compute_vector(j-1));
 
       } else if (kind == GLOBAL && mode == VECTOR) {
-	if (j == 0) {
-	  int n = fix->size_vector;
-	  for (i = 0; i < n; i++) bin_one(fix->compute_vector(i));
-	} else {
-	  int n = fix->size_vector;
-	  for (i = 0; i < n; i++) bin_one(fix->compute_array(i,j-1));
-	}
+        if (j == 0) {
+          int n = fix->size_vector;
+          for (i = 0; i < n; i++) bin_one(fix->compute_vector(i));
+        } else {
+          int n = fix->size_vector;
+          for (i = 0; i < n; i++) bin_one(fix->compute_array(i,j-1));
+        }
 
       } else if (kind == PERATOM) {
-	if (j == 0) bin_atoms(fix->vector_atom,1);
-	else bin_atoms(fix->array_atom[j-1],fix->size_peratom_cols);
+        if (j == 0) bin_atoms(fix->vector_atom,1);
+        else bin_atoms(fix->array_atom[j-1],fix->size_peratom_cols);
 
       } else if (kind == LOCAL) {
-	if (j == 0) bin_vector(fix->size_local_rows,fix->vector_local,1);
-	else 
-	  bin_vector(fix->size_local_rows,&fix->array_local[0][j-1],
-		     fix->size_local_cols);
+        if (j == 0) bin_vector(fix->size_local_rows,fix->vector_local,1);
+        else
+          bin_vector(fix->size_local_rows,&fix->array_local[0][j-1],
+                     fix->size_local_cols);
       }
 
       // evaluate equal-style variable
-      
+
     } else if (which[i] == VARIABLE && kind == GLOBAL) {
       bin_one(input->variable->compute_equal(m));
 
     } else if (which[i] == VARIABLE && kind == PERATOM) {
       if (atom->nlocal > maxatom) {
-	memory->destroy(vector);
-	maxatom = atom->nmax;
-	memory->create(vector,maxatom,"ave/histo:vector");
+        memory->destroy(vector);
+        maxatom = atom->nmax;
+        memory->create(vector,maxatom,"ave/histo:vector");
       }
       input->variable->compute_atom(m,igroup,vector,1,0);
       bin_atoms(vector,1);
@@ -737,14 +737,14 @@ void FixAveHisto::end_of_step()
     stats_total[2] = stats[2];
     stats_total[3] = stats[3];
     for (i = 0; i < nbins; i++) bin_total[i] = bin[i];
-    
+
   } else if (ave == RUNNING) {
     stats_total[0] += stats[0];
     stats_total[1] += stats[1];
     stats_total[2] = MIN(stats_total[2],stats[2]);
     stats_total[3] = MAX(stats_total[3],stats[3]);
     for (i = 0; i < nbins; i++) bin_total[i] += bin[i];
-    
+
   } else if (ave == WINDOW) {
     stats_total[0] += stats[0];
     if (window_limit) stats_total[0] -= stats_list[iwindow][0];
@@ -752,25 +752,25 @@ void FixAveHisto::end_of_step()
     stats_total[1] += stats[1];
     if (window_limit) stats_total[1] -= stats_list[iwindow][1];
     stats_list[iwindow][1] = stats[1];
-    
+
     if (window_limit) m = nwindow;
     else m = iwindow+1;
-    
+
     stats_list[iwindow][2] = stats[2];
     stats_total[2] = stats_list[0][2];
-    for (i = 1; i < m; i++) 
+    for (i = 1; i < m; i++)
       stats_total[2] = MIN(stats_total[2],stats_list[i][2]);
     stats_list[iwindow][3] = stats[3];
     stats_total[3] = stats_list[0][3];
-    for (i = 1; i < m; i++) 
+    for (i = 1; i < m; i++)
       stats_total[3] = MAX(stats_total[3],stats_list[i][3]);
-    
+
     for (i = 0; i < nbins; i++) {
       bin_total[i] += bin[i];
       if (window_limit) bin_total[i] -= bin_list[iwindow][i];
       bin_list[iwindow][i] = bin[i];
     }
-    
+
     iwindow++;
     if (iwindow == nwindow) {
       iwindow = 0;
@@ -782,14 +782,14 @@ void FixAveHisto::end_of_step()
 
   if (fp && me == 0) {
     fprintf(fp,BIGINT_FORMAT " %d %g %g %g %g\n",ntimestep,nbins,
-	    stats_total[0],stats_total[1],stats_total[2],stats_total[3]);
+            stats_total[0],stats_total[1],stats_total[2],stats_total[3]);
     if (stats_total[0] != 0.0)
       for (i = 0; i < nbins; i++)
-	fprintf(fp,"%d %g %g %g\n",
-		i+1,coord[i],bin_total[i],bin_total[i]/stats_total[0]);
+        fprintf(fp,"%d %g %g %g\n",
+                i+1,coord[i],bin_total[i],bin_total[i]/stats_total[0]);
     else
       for (i = 0; i < nbins; i++)
-	fprintf(fp,"%d %g %g %g\n",i+1,coord[i],0.0,0.0);
+        fprintf(fp,"%d %g %g %g\n",i+1,coord[i],0.0,0.0);
     fflush(fp);
   }
 }
@@ -898,12 +898,12 @@ void FixAveHisto::options(int narg, char **arg)
     if (strcmp(arg[iarg],"file") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command");
       if (me == 0) {
-	fp = fopen(arg[iarg+1],"w");
-	if (fp == NULL) {
-	  char str[128];
-	  sprintf(str,"Cannot open fix ave/histo file %s",arg[iarg+1]);
-	  error->one(FLERR,str);
-	}
+        fp = fopen(arg[iarg+1],"w");
+        if (fp == NULL) {
+          char str[128];
+          sprintf(str,"Cannot open fix ave/histo file %s",arg[iarg+1]);
+          error->one(FLERR,str);
+        }
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"ave") == 0) {
@@ -913,9 +913,9 @@ void FixAveHisto::options(int narg, char **arg)
       else if (strcmp(arg[iarg+1],"window") == 0) ave = WINDOW;
       else error->all(FLERR,"Illegal fix ave/histo command");
       if (ave == WINDOW) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/histo command");
-	nwindow = atoi(arg[iarg+2]);
-	if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/histo command");
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/histo command");
+        nwindow = atoi(arg[iarg+2]);
+        if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/histo command");
       }
       iarg += 2;
       if (ave == WINDOW) iarg++;
diff --git a/src/fix_ave_histo.h b/src/fix_ave_histo.h
index 4316bd72e7..106224b3d2 100644
--- a/src/fix_ave_histo.h
+++ b/src/fix_ave_histo.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_ave_spatial.cpp b/src/fix_ave_spatial.cpp
index 51e91a47f3..35624863bf 100644
--- a/src/fix_ave_spatial.cpp
+++ b/src/fix_ave_spatial.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -86,7 +86,7 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
   if (!ndim) error->all(FLERR,"Illegal fix ave/spatial command");
   if (ndim == 2 && dim[0] == dim[1])
     error->all(FLERR,"Same dimension twice in fix ave/spatial");
-  if (ndim == 3 && (dim[0] == dim[1] || dim[1] == dim[2] || dim[0] == dim[2])) 
+  if (ndim == 3 && (dim[0] == dim[1] || dim[1] == dim[2] || dim[0] == dim[2]))
     error->all(FLERR,"Same dimension twice in fix ave/spatial");
 
   // parse values until one isn't recognized
@@ -127,9 +127,9 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
       which[nvalues] = DENSITY_MASS;
       argindex[nvalues++] = 0;
 
-    } else if (strncmp(arg[iarg],"c_",2) == 0 || 
-	       strncmp(arg[iarg],"f_",2) == 0 || 
-	       strncmp(arg[iarg],"v_",2) == 0) {
+    } else if (strncmp(arg[iarg],"c_",2) == 0 ||
+               strncmp(arg[iarg],"f_",2) == 0 ||
+               strncmp(arg[iarg],"v_",2) == 0) {
       if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE;
       else if (arg[iarg][0] == 'f') which[nvalues] = FIX;
       else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE;
@@ -140,10 +140,10 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Illegal fix ave/spatial command");
-	argindex[nvalues] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Illegal fix ave/spatial command");
+        argindex[nvalues] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[nvalues] = 0;
 
       n = strlen(suffix) + 1;
@@ -187,8 +187,8 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"region") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       iregion = domain->find_region(arg[iarg+1]);
-      if (iregion == -1) 
-	error->all(FLERR,"Region ID for fix ave/spatial does not exist");
+      if (iregion == -1)
+        error->all(FLERR,"Region ID for fix ave/spatial does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
@@ -197,12 +197,12 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"file") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
       if (me == 0) {
-	fp = fopen(arg[iarg+1],"w");
-	if (fp == NULL) {
-	  char str[128];
-	  sprintf(str,"Cannot open fix ave/spatial file %s",arg[iarg+1]);
-	  error->one(FLERR,str);
-	}
+        fp = fopen(arg[iarg+1],"w");
+        if (fp == NULL) {
+          char str[128];
+          sprintf(str,"Cannot open fix ave/spatial file %s",arg[iarg+1]);
+          error->one(FLERR,str);
+        }
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"ave") == 0) {
@@ -212,9 +212,9 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
       else if (strcmp(arg[iarg+1],"window") == 0) ave = WINDOW;
       else error->all(FLERR,"Illegal fix ave/spatial command");
       if (ave == WINDOW) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
-	nwindow = atoi(arg[iarg+2]);
-	if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/spatial command");
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/spatial command");
+        nwindow = atoi(arg[iarg+2]);
+        if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/spatial command");
       }
       iarg += 2;
       if (ave == WINDOW) iarg++;
@@ -249,52 +249,52 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
   if (nfreq % nevery || (nrepeat-1)*nevery >= nfreq)
     error->all(FLERR,"Illegal fix ave/spatial command");
   if (delta[0] <= 0.0) error->all(FLERR,"Illegal fix ave/spatial command");
-  if (ndim >= 2 && delta[1] <= 0.0) 
+  if (ndim >= 2 && delta[1] <= 0.0)
     error->all(FLERR,"Illegal fix ave/spatial command");
-  if (ndim == 3 && delta[2] <= 0.0) 
+  if (ndim == 3 && delta[2] <= 0.0)
     error->all(FLERR,"Illegal fix ave/spatial command");
 
   for (int i = 0; i < nvalues; i++) {
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/spatial does not exist");
+        error->all(FLERR,"Compute ID for fix ave/spatial does not exist");
       if (modify->compute[icompute]->peratom_flag == 0)
-	error->all(FLERR,"Fix ave/spatial compute does not "
-		   "calculate per-atom values");
-      if (argindex[i] == 0 && 
-	  modify->compute[icompute]->size_peratom_cols != 0)
-	error->all(FLERR,"Fix ave/spatial compute does not "
-		   "calculate a per-atom vector");
+        error->all(FLERR,"Fix ave/spatial compute does not "
+                   "calculate per-atom values");
+      if (argindex[i] == 0 &&
+          modify->compute[icompute]->size_peratom_cols != 0)
+        error->all(FLERR,"Fix ave/spatial compute does not "
+                   "calculate a per-atom vector");
       if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	error->all(FLERR,"Fix ave/spatial compute does not "
-		   "calculate a per-atom array");
-      if (argindex[i] && 
-	  argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	error->all(FLERR,
-		   "Fix ave/spatial compute vector is accessed out-of-range");
+        error->all(FLERR,"Fix ave/spatial compute does not "
+                   "calculate a per-atom array");
+      if (argindex[i] &&
+          argindex[i] > modify->compute[icompute]->size_peratom_cols)
+        error->all(FLERR,
+                   "Fix ave/spatial compute vector is accessed out-of-range");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for fix ave/spatial does not exist");
+        error->all(FLERR,"Fix ID for fix ave/spatial does not exist");
       if (modify->fix[ifix]->peratom_flag == 0)
-	error->all(FLERR,
-		   "Fix ave/spatial fix does not calculate per-atom values");
+        error->all(FLERR,
+                   "Fix ave/spatial fix does not calculate per-atom values");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols != 0)
-	error->all(FLERR,
-		   "Fix ave/spatial fix does not calculate a per-atom vector");
+        error->all(FLERR,
+                   "Fix ave/spatial fix does not calculate a per-atom vector");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	error->all(FLERR,
-		   "Fix ave/spatial fix does not calculate a per-atom array");
+        error->all(FLERR,
+                   "Fix ave/spatial fix does not calculate a per-atom array");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	error->all(FLERR,"Fix ave/spatial fix vector is accessed out-of-range");
+        error->all(FLERR,"Fix ave/spatial fix vector is accessed out-of-range");
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all(FLERR,"Variable name for fix ave/spatial does not exist");
+        error->all(FLERR,"Variable name for fix ave/spatial does not exist");
       if (input->variable->atomstyle(ivariable) == 0)
-	error->all(FLERR,"Fix ave/spatial variable is not atom-style variable");
+        error->all(FLERR,"Fix ave/spatial variable is not atom-style variable");
     }
   }
 
@@ -303,7 +303,7 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
   if (fp && me == 0) {
     if (title1) fprintf(fp,"%s\n",title1);
     else fprintf(fp,"# Spatial-averaged data for fix %s and group %s\n",
-		 id,arg[1]);
+                 id,arg[1]);
     if (title2) fprintf(fp,"%s\n",title2);
     else fprintf(fp,"# Timestep Number-of-bins\n");
     if (title3) fprintf(fp,"%s\n",title3);
@@ -332,7 +332,7 @@ FixAveSpatial::FixAveSpatial(LAMMPS *lmp, int narg, char **arg) :
   int triclinic = domain->triclinic;
   if (triclinic == 1 && scaleflag != REDUCED)
     error->all(FLERR,
-	       "Fix ave/spatial for triclinic boxes requires units reduced");
+               "Fix ave/spatial for triclinic boxes requires units reduced");
 
   if (scaleflag == LATTICE && domain->lattice == NULL)
     error->all(FLERR,"Use of fix ave/spatial with undefined lattice");
@@ -449,23 +449,23 @@ void FixAveSpatial::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/spatial does not exist");
+        error->all(FLERR,"Compute ID for fix ave/spatial does not exist");
       value2index[m] = icompute;
-      
+
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
-      if (ifix < 0) 
-	error->all(FLERR,"Fix ID for fix ave/spatial does not exist");
+      if (ifix < 0)
+        error->all(FLERR,"Fix ID for fix ave/spatial does not exist");
       value2index[m] = ifix;
 
       if (nevery % modify->fix[ifix]->peratom_freq)
-	error->all(FLERR,
-		   "Fix for fix ave/spatial not computed at compatible time");
+        error->all(FLERR,
+                   "Fix for fix ave/spatial not computed at compatible time");
 
     } else if (which[m] == VARIABLE) {
       int ivariable = input->variable->find(ids[m]);
-      if (ivariable < 0) 
-	error->all(FLERR,"Variable name for fix ave/spatial does not exist");
+      if (ivariable < 0)
+        error->all(FLERR,"Variable name for fix ave/spatial does not exist");
       value2index[m] = ivariable;
 
     } else value2index[m] = -1;
@@ -553,15 +553,15 @@ void FixAveSpatial::end_of_step()
       double **attribute;
       if (which[m] == V) attribute = atom->v;
       else attribute = atom->f;
-      
+
       if (regionflag == 0) {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit)
-	    values_one[bin[i]][m] += attribute[i][j];
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit)
+            values_one[bin[i]][m] += attribute[i][j];
       } else {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	    values_one[bin[i]][m] += attribute[i][j];
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
+            values_one[bin[i]][m] += attribute[i][j];
       }
 
     // DENSITY_NUMBER adds 1 to values
@@ -569,13 +569,13 @@ void FixAveSpatial::end_of_step()
     } else if (which[m] == DENSITY_NUMBER) {
 
       if (regionflag == 0) {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit)
-	    values_one[bin[i]][m] += 1.0;
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit)
+            values_one[bin[i]][m] += 1.0;
       } else {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	    values_one[bin[i]][m] += 1.0;
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
+            values_one[bin[i]][m] += 1.0;
       }
 
     // DENSITY_MASS adds mass to values
@@ -586,17 +586,17 @@ void FixAveSpatial::end_of_step()
       double *rmass = atom->rmass;
 
       if (regionflag == 0) {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit) {
-	    if (rmass) values_one[bin[i]][m] += rmass[i];
-	    else values_one[bin[i]][m] += mass[type[i]];
-	  }
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit) {
+            if (rmass) values_one[bin[i]][m] += rmass[i];
+            else values_one[bin[i]][m] += mass[type[i]];
+          }
       } else {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	    if (rmass) values_one[bin[i]][m] += rmass[i];
-	    else values_one[bin[i]][m] += mass[type[i]];
-	  }
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
+            if (rmass) values_one[bin[i]][m] += rmass[i];
+            else values_one[bin[i]][m] += mass[type[i]];
+          }
       }
 
     // COMPUTE adds its scalar or vector component to values
@@ -605,25 +605,25 @@ void FixAveSpatial::end_of_step()
     } else if (which[m] == COMPUTE) {
       Compute *compute = modify->compute[n];
       if (!(compute->invoked_flag & INVOKED_PERATOM)) {
-	compute->compute_peratom();
-	compute->invoked_flag |= INVOKED_PERATOM;
+        compute->compute_peratom();
+        compute->invoked_flag |= INVOKED_PERATOM;
       }
       double *vector = compute->vector_atom;
       double **array = compute->array_atom;
       int jm1 = j - 1;
 
       if (regionflag == 0) {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit) {
-	    if (j == 0) values_one[bin[i]][m] += vector[i];
-	    else values_one[bin[i]][m] += array[i][jm1];
-	  }
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit) {
+            if (j == 0) values_one[bin[i]][m] += vector[i];
+            else values_one[bin[i]][m] += array[i][jm1];
+          }
       } else {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	    if (j == 0) values_one[bin[i]][m] += vector[i];
-	    else values_one[bin[i]][m] += array[i][jm1];
-	  }
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
+            if (j == 0) values_one[bin[i]][m] += vector[i];
+            else values_one[bin[i]][m] += array[i][jm1];
+          }
       }
 
     // FIX adds its scalar or vector component to values
@@ -635,17 +635,17 @@ void FixAveSpatial::end_of_step()
       int jm1 = j - 1;
 
       if (regionflag == 0) {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit) {
-	    if (j == 0) values_one[bin[i]][m] += vector[i];
-	    else values_one[bin[i]][m] += array[i][jm1];
-	  }
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit) {
+            if (j == 0) values_one[bin[i]][m] += vector[i];
+            else values_one[bin[i]][m] += array[i][jm1];
+          }
       } else {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	    if (j == 0) values_one[bin[i]][m] += vector[i];
-	    else values_one[bin[i]][m] += array[i][jm1];
-	  }
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
+            if (j == 0) values_one[bin[i]][m] += vector[i];
+            else values_one[bin[i]][m] += array[i][jm1];
+          }
       }
 
     // VARIABLE adds its per-atom quantities to values
@@ -653,21 +653,21 @@ void FixAveSpatial::end_of_step()
 
     } else if (which[m] == VARIABLE) {
       if (nlocal > maxvar) {
-	maxvar = atom->nmax;
-	memory->destroy(varatom);
-	memory->create(varatom,maxvar,"ave/spatial:varatom");
+        maxvar = atom->nmax;
+        memory->destroy(varatom);
+        memory->create(varatom,maxvar,"ave/spatial:varatom");
       }
 
       input->variable->compute_atom(n,igroup,varatom,1,0);
 
       if (regionflag == 0) {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit)
-	    values_one[bin[i]][m] += varatom[i];
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit)
+            values_one[bin[i]][m] += varatom[i];
       } else {
-	for (i = 0; i < nlocal; i++)
-	  if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	    values_one[bin[i]][m] += varatom[i];
+        for (i = 0; i < nlocal; i++)
+          if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
+            values_one[bin[i]][m] += varatom[i];
       }
     }
   }
@@ -681,17 +681,17 @@ void FixAveSpatial::end_of_step()
     for (m = 0; m < nbins; m++) {
       count_many[m] += count_one[m];
       for (j = 0; j < nvalues; j++)
-	values_many[m][j] += values_one[m][j];
+        values_many[m][j] += values_one[m][j];
     }
   } else {
     MPI_Allreduce(count_one,count_many,nbins,MPI_DOUBLE,MPI_SUM,world);
     for (m = 0; m < nbins; m++) {
       if (count_many[m] > 0.0)
-	for (j = 0; j < nvalues; j++) {
-	  if (which[j] == DENSITY_NUMBER || which[j] == DENSITY_MASS)
-	    values_many[m][j] += values_one[m][j];
-	  else values_many[m][j] += values_one[m][j]/count_many[m];
-	}
+        for (j = 0; j < nvalues; j++) {
+          if (which[j] == DENSITY_NUMBER || which[j] == DENSITY_MASS)
+            values_many[m][j] += values_one[m][j];
+          else values_many[m][j] += values_one[m][j]/count_many[m];
+        }
       count_sum[m] += count_many[m];
     }
   }
@@ -721,21 +721,21 @@ void FixAveSpatial::end_of_step()
   if (normflag == ALL) {
     MPI_Allreduce(count_many,count_sum,nbins,MPI_DOUBLE,MPI_SUM,world);
     MPI_Allreduce(&values_many[0][0],&values_sum[0][0],nbins*nvalues,
-		  MPI_DOUBLE,MPI_SUM,world);
+                  MPI_DOUBLE,MPI_SUM,world);
     for (m = 0; m < nbins; m++) {
       if (count_sum[m] > 0.0)
-	for (j = 0; j < nvalues; j++)
-	  if (which[j] == DENSITY_NUMBER) values_sum[m][j] /= repeat;
-	  else if (which[j] == DENSITY_MASS) values_sum[m][j] *= mv2d/repeat;
-	  else values_sum[m][j] /= count_sum[m];
+        for (j = 0; j < nvalues; j++)
+          if (which[j] == DENSITY_NUMBER) values_sum[m][j] /= repeat;
+          else if (which[j] == DENSITY_MASS) values_sum[m][j] *= mv2d/repeat;
+          else values_sum[m][j] /= count_sum[m];
       count_sum[m] /= repeat;
     }
   } else {
     MPI_Allreduce(&values_many[0][0],&values_sum[0][0],nbins*nvalues,
-		  MPI_DOUBLE,MPI_SUM,world);
+                  MPI_DOUBLE,MPI_SUM,world);
     for (m = 0; m < nbins; m++) {
       for (j = 0; j < nvalues; j++)
-	values_sum[m][j] /= repeat;
+        values_sum[m][j] /= repeat;
       count_sum[m] /= repeat;
     }
   }
@@ -745,7 +745,7 @@ void FixAveSpatial::end_of_step()
   for (j = 0; j < nvalues; j++)
     if (which[j] == DENSITY_NUMBER || which[j] == DENSITY_MASS)
       for (m = 0; m < nbins; m++)
-	values_sum[m][j] /= bin_volume;
+        values_sum[m][j] /= bin_volume;
 
   // if ave = ONE, only single Nfreq timestep value is needed
   // if ave = RUNNING, combine with all previous Nfreq timestep values
@@ -753,8 +753,8 @@ void FixAveSpatial::end_of_step()
 
   if (ave == ONE) {
     for (m = 0; m < nbins; m++) {
-      for (i = 0; i < nvalues; i++) 
-	values_total[m][i] = values_sum[m][i];
+      for (i = 0; i < nvalues; i++)
+        values_total[m][i] = values_sum[m][i];
       count_total[m] = count_sum[m];
     }
     norm = 1;
@@ -762,7 +762,7 @@ void FixAveSpatial::end_of_step()
   } else if (ave == RUNNING) {
     for (m = 0; m < nbins; m++) {
       for (i = 0; i < nvalues; i++)
-	values_total[m][i] += values_sum[m][i];
+        values_total[m][i] += values_sum[m][i];
       count_total[m] += count_sum[m];
     }
     norm++;
@@ -770,9 +770,9 @@ void FixAveSpatial::end_of_step()
   } else if (ave == WINDOW) {
     for (m = 0; m < nbins; m++) {
       for (i = 0; i < nvalues; i++) {
-	values_total[m][i] += values_sum[m][i];
-	if (window_limit) values_total[m][i] -= values_list[iwindow][m][i];
-	values_list[iwindow][m][i] = values_sum[m][i];
+        values_total[m][i] += values_sum[m][i];
+        if (window_limit) values_total[m][i] -= values_list[iwindow][m][i];
+        values_list[iwindow][m][i] = values_sum[m][i];
       }
       count_total[m] += count_sum[m];
       if (window_limit) count_total[m] -= count_list[iwindow][m];
@@ -789,32 +789,32 @@ void FixAveSpatial::end_of_step()
   }
 
   // output result to file
-  
+
   if (fp && me == 0) {
     fprintf(fp,BIGINT_FORMAT " %d\n",ntimestep,nbins);
     if (ndim == 1)
       for (m = 0; m < nbins; m++) {
-	fprintf(fp,"  %d %g %g",m+1,coord[m][0],
-		count_total[m]/norm);
-	for (i = 0; i < nvalues; i++) 
-	  fprintf(fp," %g",values_total[m][i]/norm);
-	fprintf(fp,"\n");
+        fprintf(fp,"  %d %g %g",m+1,coord[m][0],
+                count_total[m]/norm);
+        for (i = 0; i < nvalues; i++)
+          fprintf(fp," %g",values_total[m][i]/norm);
+        fprintf(fp,"\n");
       }
     else if (ndim == 2)
       for (m = 0; m < nbins; m++) {
-	fprintf(fp,"  %d %g %g %g",m+1,coord[m][0],coord[m][1],
-		count_total[m]/norm);
-	for (i = 0; i < nvalues; i++) 
-	  fprintf(fp," %g",values_total[m][i]/norm);
-	fprintf(fp,"\n");
+        fprintf(fp,"  %d %g %g %g",m+1,coord[m][0],coord[m][1],
+                count_total[m]/norm);
+        for (i = 0; i < nvalues; i++)
+          fprintf(fp," %g",values_total[m][i]/norm);
+        fprintf(fp,"\n");
       }
     else
       for (m = 0; m < nbins; m++) {
-	fprintf(fp,"  %d %g %g %g %g",m+1,coord[m][0],coord[m][1],coord[m][2],
-		count_total[m]/norm);
-	for (i = 0; i < nvalues; i++) 
-	  fprintf(fp," %g",values_total[m][i]/norm);
-	fprintf(fp,"\n");
+        fprintf(fp,"  %d %g %g %g %g",m+1,coord[m][0],coord[m][1],coord[m][2],
+                count_total[m]/norm);
+        for (i = 0; i < nvalues; i++)
+          fprintf(fp," %g",values_total[m][i]/norm);
+        fprintf(fp,"\n");
       }
 
     fflush(fp);
@@ -854,9 +854,9 @@ void FixAveSpatial::setup_bins()
   for (m = 0; m < ndim; m++) {
     if (originflag[m] == LOWER) origin[m] = boxlo[dim[m]];
     else if (originflag[m] == UPPER) origin[m] = boxhi[dim[m]];
-    else if (originflag[m] == CENTER) 
+    else if (originflag[m] == CENTER)
       origin[m] = 0.5 * (boxlo[dim[m]] + boxhi[dim[m]]);
-    
+
     if (origin[m] < boxlo[dim[m]]) {
       n = static_cast<int> ((boxlo[dim[m]] - origin[m]) * invdelta[m]);
       lo = origin[m] + n*delta[m];
@@ -873,7 +873,7 @@ void FixAveSpatial::setup_bins()
       n = static_cast<int> ((origin[m] - boxhi[dim[m]]) * invdelta[m]);
       hi = origin[m] - n*delta[m];
     }
-    
+
     offset[m] = lo;
     nlayers[m] = static_cast<int> ((hi-lo) * invdelta[m] + 0.5);
     nbins *= nlayers[m];
@@ -888,19 +888,19 @@ void FixAveSpatial::setup_bins()
     memory->grow(count_many,nbins,"ave/spatial:count_many");
     memory->grow(count_sum,nbins,"ave/spatial:count_sum");
     memory->grow(count_total,nbins,"ave/spatial:count_total");
-    
+
     memory->grow(coord,nbins,ndim,"ave/spatial:coord");
     memory->grow(values_one,nbins,nvalues,"ave/spatial:values_one");
     memory->grow(values_many,nbins,nvalues,"ave/spatial:values_many");
     memory->grow(values_sum,nbins,nvalues,"ave/spatial:values_sum");
     memory->grow(values_total,nbins,nvalues,"ave/spatial:values_total");
-    
+
     // only allocate count and values list for ave = WINDOW
-    
+
     if (ave == WINDOW) {
       memory->create(count_list,nwindow,nbins,"ave/spatial:count_list");
       memory->create(values_list,nwindow,nbins,nvalues,
-		     "ave/spatial:values_list");
+                     "ave/spatial:values_list");
     }
 
     // reinitialize regrown count/values total since they accumulate
@@ -921,9 +921,9 @@ void FixAveSpatial::setup_bins()
     for (i = 0; i < nlayers[0]; i++) {
       coord1 = offset[0] + (i+0.5)*delta[0];
       for (j = 0; j < nlayers[1]; j++) {
-	coord[m][0] = coord1;
-	coord[m][1] = offset[1] + (j+0.5)*delta[1];
-	m++;
+        coord[m][0] = coord1;
+        coord[m][1] = offset[1] + (j+0.5)*delta[1];
+        m++;
       }
     }
   } else if (ndim == 3) {
@@ -931,13 +931,13 @@ void FixAveSpatial::setup_bins()
     for (i = 0; i < nlayers[0]; i++) {
       coord1 = offset[0] + (i+0.5)*delta[0];
       for (j = 0; j < nlayers[1]; j++) {
-	coord2 = offset[1] + (j+0.5)*delta[1];
-	for (k = 0; k < nlayers[2]; k++) {
-	  coord[m][0] = coord1;
-	  coord[m][1] = coord2;
-	  coord[m][2] = offset[2] + (k+0.5)*delta[2];
-	  m++;
-	}
+        coord2 = offset[1] + (j+0.5)*delta[1];
+        for (k = 0; k < nlayers[2]; k++) {
+          coord[m][0] = coord1;
+          coord[m][1] = coord2;
+          coord[m][2] = offset[2] + (k+0.5)*delta[2];
+          m++;
+        }
       }
     }
   }
@@ -981,35 +981,35 @@ void FixAveSpatial::atom2bin1d()
     if (scaleflag == REDUCED) domain->x2lamda(nlocal);
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xremap = x[i][idim];
-	if (periodicity) {
-	  if (xremap < boxlo[idim]) xremap += prd[idim];
-	  if (xremap >= boxhi[idim]) xremap -= prd[idim];
-	}
-	ibin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
-	ibin = MAX(ibin,0);
-	ibin = MIN(ibin,nlayerm1);
-	bin[i] = ibin;
-	count_one[ibin] += 1.0;
+        xremap = x[i][idim];
+        if (periodicity) {
+          if (xremap < boxlo[idim]) xremap += prd[idim];
+          if (xremap >= boxhi[idim]) xremap -= prd[idim];
+        }
+        ibin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
+        ibin = MAX(ibin,0);
+        ibin = MIN(ibin,nlayerm1);
+        bin[i] = ibin;
+        count_one[ibin] += 1.0;
       }
     if (scaleflag == REDUCED) domain->lamda2x(nlocal);
 
   } else {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	if (scaleflag == REDUCED) {
-	  domain->x2lamda(x[i],lamda);
-	  xremap = lamda[idim];
-	} else xremap = x[i][idim];
-	if (periodicity) {
-	  if (xremap < boxlo[idim]) xremap += prd[idim];
-	  if (xremap >= boxhi[idim]) xremap -= prd[idim];
-	}
-	ibin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
-	ibin = MAX(ibin,0);
-	ibin = MIN(ibin,nlayerm1);
-	bin[i] = ibin;
-	count_one[ibin] += 1.0;
+        if (scaleflag == REDUCED) {
+          domain->x2lamda(x[i],lamda);
+          xremap = lamda[idim];
+        } else xremap = x[i][idim];
+        if (periodicity) {
+          if (xremap < boxlo[idim]) xremap += prd[idim];
+          if (xremap >= boxhi[idim]) xremap -= prd[idim];
+        }
+        ibin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
+        ibin = MAX(ibin,0);
+        ibin = MIN(ibin,nlayerm1);
+        bin[i] = ibin;
+        count_one[ibin] += 1.0;
       }
   }
 }
@@ -1054,61 +1054,61 @@ void FixAveSpatial::atom2bin2d()
     if (scaleflag == REDUCED) domain->x2lamda(nlocal);
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xremap = x[i][idim];
-	if (periodicity[idim]) {
-	  if (xremap < boxlo[idim]) xremap += prd[idim];
-	  if (xremap >= boxhi[idim]) xremap -= prd[idim];
-	}
-	i1bin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
-	i1bin = MAX(i1bin,0);
-	i1bin = MIN(i1bin,nlayer1m1);
-
-	yremap = x[i][jdim];
-	if (periodicity[jdim]) {
-	  if (yremap < boxlo[jdim]) yremap += prd[jdim];
-	  if (yremap >= boxhi[jdim]) yremap -= prd[jdim];
-	}
-	i2bin = static_cast<int> ((yremap - offset[1]) * invdelta[1]);
-	i2bin = MAX(i2bin,0);
-	i2bin = MIN(i2bin,nlayer2m1);
-
-	ibin = i1bin*nlayers[1] + i2bin;
-	bin[i] = ibin;
-	count_one[ibin] += 1.0;
+        xremap = x[i][idim];
+        if (periodicity[idim]) {
+          if (xremap < boxlo[idim]) xremap += prd[idim];
+          if (xremap >= boxhi[idim]) xremap -= prd[idim];
+        }
+        i1bin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
+        i1bin = MAX(i1bin,0);
+        i1bin = MIN(i1bin,nlayer1m1);
+
+        yremap = x[i][jdim];
+        if (periodicity[jdim]) {
+          if (yremap < boxlo[jdim]) yremap += prd[jdim];
+          if (yremap >= boxhi[jdim]) yremap -= prd[jdim];
+        }
+        i2bin = static_cast<int> ((yremap - offset[1]) * invdelta[1]);
+        i2bin = MAX(i2bin,0);
+        i2bin = MIN(i2bin,nlayer2m1);
+
+        ibin = i1bin*nlayers[1] + i2bin;
+        bin[i] = ibin;
+        count_one[ibin] += 1.0;
       }
     if (scaleflag == REDUCED) domain->lamda2x(nlocal);
 
   } else {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	if (scaleflag == REDUCED) {
-	  domain->x2lamda(x[i],lamda);
-	  xremap = lamda[idim];
-	  yremap = lamda[jdim];
-	} else {
-	  xremap = x[i][idim];
-	  yremap = x[i][jdim];
-	}
-
-	if (periodicity[idim]) {
-	  if (xremap < boxlo[idim]) xremap += prd[idim];
-	  if (xremap >= boxhi[idim]) xremap -= prd[idim];
-	}
-	i1bin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
-	i1bin = MAX(i1bin,0);
-	i1bin = MIN(i1bin,nlayer1m1-1);
-
-	if (periodicity[jdim]) {
-	  if (yremap < boxlo[jdim]) yremap += prd[jdim];
-	  if (yremap >= boxhi[jdim]) yremap -= prd[jdim];
-	}
-	i2bin = static_cast<int> ((yremap - offset[1]) * invdelta[1]);
-	i2bin = MAX(i2bin,0);
-	i2bin = MIN(i2bin,nlayer2m1-1);
-
-	ibin = i1bin*nlayers[1] + i2bin;
-	bin[i] = ibin;
-	count_one[ibin] += 1.0;
+        if (scaleflag == REDUCED) {
+          domain->x2lamda(x[i],lamda);
+          xremap = lamda[idim];
+          yremap = lamda[jdim];
+        } else {
+          xremap = x[i][idim];
+          yremap = x[i][jdim];
+        }
+
+        if (periodicity[idim]) {
+          if (xremap < boxlo[idim]) xremap += prd[idim];
+          if (xremap >= boxhi[idim]) xremap -= prd[idim];
+        }
+        i1bin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
+        i1bin = MAX(i1bin,0);
+        i1bin = MIN(i1bin,nlayer1m1-1);
+
+        if (periodicity[jdim]) {
+          if (yremap < boxlo[jdim]) yremap += prd[jdim];
+          if (yremap >= boxhi[jdim]) yremap -= prd[jdim];
+        }
+        i2bin = static_cast<int> ((yremap - offset[1]) * invdelta[1]);
+        i2bin = MAX(i2bin,0);
+        i2bin = MIN(i2bin,nlayer2m1-1);
+
+        ibin = i1bin*nlayers[1] + i2bin;
+        bin[i] = ibin;
+        count_one[ibin] += 1.0;
       }
   }
 }
@@ -1155,80 +1155,80 @@ void FixAveSpatial::atom2bin3d()
     if (scaleflag == REDUCED) domain->x2lamda(nlocal);
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xremap = x[i][idim];
-	if (periodicity[idim]) {
-	  if (xremap < boxlo[idim]) xremap += prd[idim];
-	  if (xremap >= boxhi[idim]) xremap -= prd[idim];
-	}
-	i1bin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
-	i1bin = MAX(i1bin,0);
-	i1bin = MIN(i1bin,nlayer1m1);
-
-	yremap = x[i][jdim];
-	if (periodicity[jdim]) {
-	  if (yremap < boxlo[jdim]) yremap += prd[jdim];
-	  if (yremap >= boxhi[jdim]) yremap -= prd[jdim];
-	}
-	i2bin = static_cast<int> ((yremap - offset[1]) * invdelta[1]);
-	i2bin = MAX(i2bin,0);
-	i2bin = MIN(i2bin,nlayer2m1);
-
-	zremap = x[i][kdim];
-	if (periodicity[kdim]) {
-	  if (zremap < boxlo[kdim]) yremap += prd[kdim];
-	  if (zremap >= boxhi[kdim]) yremap -= prd[kdim];
-	}
-	i3bin = static_cast<int> ((zremap - offset[2]) * invdelta[2]);
-	i3bin = MAX(i3bin,0);
-	i3bin = MIN(i3bin,nlayer3m1);
-
-	ibin = i1bin*nlayers[1]*nlayers[2] + i2bin*nlayers[2] + i3bin;
-	bin[i] = ibin;
-	count_one[ibin] += 1.0;
+        xremap = x[i][idim];
+        if (periodicity[idim]) {
+          if (xremap < boxlo[idim]) xremap += prd[idim];
+          if (xremap >= boxhi[idim]) xremap -= prd[idim];
+        }
+        i1bin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
+        i1bin = MAX(i1bin,0);
+        i1bin = MIN(i1bin,nlayer1m1);
+
+        yremap = x[i][jdim];
+        if (periodicity[jdim]) {
+          if (yremap < boxlo[jdim]) yremap += prd[jdim];
+          if (yremap >= boxhi[jdim]) yremap -= prd[jdim];
+        }
+        i2bin = static_cast<int> ((yremap - offset[1]) * invdelta[1]);
+        i2bin = MAX(i2bin,0);
+        i2bin = MIN(i2bin,nlayer2m1);
+
+        zremap = x[i][kdim];
+        if (periodicity[kdim]) {
+          if (zremap < boxlo[kdim]) yremap += prd[kdim];
+          if (zremap >= boxhi[kdim]) yremap -= prd[kdim];
+        }
+        i3bin = static_cast<int> ((zremap - offset[2]) * invdelta[2]);
+        i3bin = MAX(i3bin,0);
+        i3bin = MIN(i3bin,nlayer3m1);
+
+        ibin = i1bin*nlayers[1]*nlayers[2] + i2bin*nlayers[2] + i3bin;
+        bin[i] = ibin;
+        count_one[ibin] += 1.0;
       }
     if (scaleflag == REDUCED) domain->lamda2x(nlocal);
 
   } else {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	if (scaleflag == REDUCED) {
-	  domain->x2lamda(x[i],lamda);
-	  xremap = lamda[idim];
-	  yremap = lamda[jdim];
-	  zremap = lamda[kdim];
-	} else {
-	  xremap = x[i][idim];
-	  yremap = x[i][jdim];
-	  zremap = x[i][kdim];
-	}
-
-	if (periodicity[idim]) {
-	  if (xremap < boxlo[idim]) xremap += prd[idim];
-	  if (xremap >= boxhi[idim]) xremap -= prd[idim];
-	}
-	i1bin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
-	i1bin = MAX(i1bin,0);
-	i1bin = MIN(i1bin,nlayer1m1);
-
-	if (periodicity[jdim]) {
-	  if (yremap < boxlo[jdim]) yremap += prd[jdim];
-	  if (yremap >= boxhi[jdim]) yremap -= prd[jdim];
-	}
-	i2bin = static_cast<int> ((yremap - offset[1]) * invdelta[1]);
-	i2bin = MAX(i2bin,0);
-	i2bin = MIN(i2bin,nlayer2m1);
-
-	if (periodicity[kdim]) {
-	  if (zremap < boxlo[kdim]) yremap += prd[kdim];
-	  if (zremap >= boxhi[kdim]) yremap -= prd[kdim];
-	}
-	i3bin = static_cast<int> ((zremap - offset[2]) * invdelta[2]);
-	i3bin = MAX(i3bin,0);
-	i3bin = MIN(i3bin,nlayer3m1);
-
-	ibin = i1bin*nlayers[1]*nlayers[2] + i2bin*nlayers[2] + i3bin;
-	bin[i] = ibin;
-	count_one[ibin] += 1.0;
+        if (scaleflag == REDUCED) {
+          domain->x2lamda(x[i],lamda);
+          xremap = lamda[idim];
+          yremap = lamda[jdim];
+          zremap = lamda[kdim];
+        } else {
+          xremap = x[i][idim];
+          yremap = x[i][jdim];
+          zremap = x[i][kdim];
+        }
+
+        if (periodicity[idim]) {
+          if (xremap < boxlo[idim]) xremap += prd[idim];
+          if (xremap >= boxhi[idim]) xremap -= prd[idim];
+        }
+        i1bin = static_cast<int> ((xremap - offset[0]) * invdelta[0]);
+        i1bin = MAX(i1bin,0);
+        i1bin = MIN(i1bin,nlayer1m1);
+
+        if (periodicity[jdim]) {
+          if (yremap < boxlo[jdim]) yremap += prd[jdim];
+          if (yremap >= boxhi[jdim]) yremap -= prd[jdim];
+        }
+        i2bin = static_cast<int> ((yremap - offset[1]) * invdelta[1]);
+        i2bin = MAX(i2bin,0);
+        i2bin = MIN(i2bin,nlayer2m1);
+
+        if (periodicity[kdim]) {
+          if (zremap < boxlo[kdim]) yremap += prd[kdim];
+          if (zremap >= boxhi[kdim]) yremap -= prd[kdim];
+        }
+        i3bin = static_cast<int> ((zremap - offset[2]) * invdelta[2]);
+        i3bin = MAX(i3bin,0);
+        i3bin = MIN(i3bin,nlayer3m1);
+
+        ibin = i1bin*nlayers[1]*nlayers[2] + i2bin*nlayers[2] + i3bin;
+        bin[i] = ibin;
+        count_one[ibin] += 1.0;
       }
   }
 }
diff --git a/src/fix_ave_spatial.h b/src/fix_ave_spatial.h
index ece55f48fc..fb0420a7d6 100644
--- a/src/fix_ave_spatial.h
+++ b/src/fix_ave_spatial.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ class FixAveSpatial : public Fix {
 
   int dim[3],originflag[3],nlayers[3];
   double origin[3],delta[3];
-  double offset[3],invdelta[3]; 
+  double offset[3],invdelta[3];
 
   int maxvar;
   double *varatom;
diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp
index 12e779cc64..b113c0163b 100644
--- a/src/fix_ave_time.cpp
+++ b/src/fix_ave_time.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -61,9 +61,9 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
 
   int iarg = 6;
   while (iarg < narg) {
-    if ((strncmp(arg[iarg],"c_",2) == 0) || 
-	(strncmp(arg[iarg],"f_",2) == 0) || 
-	(strncmp(arg[iarg],"v_",2) == 0)) {
+    if ((strncmp(arg[iarg],"c_",2) == 0) ||
+        (strncmp(arg[iarg],"f_",2) == 0) ||
+        (strncmp(arg[iarg],"v_",2) == 0)) {
       nvalues++;
       iarg++;
     } else break;
@@ -84,9 +84,9 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
 
   iarg = 6;
   while (iarg < narg) {
-    if (strncmp(arg[iarg],"c_",2) == 0 || 
-	strncmp(arg[iarg],"f_",2) == 0 || 
-	strncmp(arg[iarg],"v_",2) == 0) {
+    if (strncmp(arg[iarg],"c_",2) == 0 ||
+        strncmp(arg[iarg],"f_",2) == 0 ||
+        strncmp(arg[iarg],"v_",2) == 0) {
       if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE;
       else if (arg[iarg][0] == 'f') which[nvalues] = FIX;
       else if (arg[iarg][0] == 'v') which[nvalues] = VARIABLE;
@@ -97,10 +97,10 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Illegal fix ave/time command");
-	argindex[nvalues] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Illegal fix ave/time command");
+        argindex[nvalues] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[nvalues] = 0;
 
       n = strlen(suffix) + 1;
@@ -108,45 +108,45 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
       strcpy(ids[nvalues],suffix);
       delete [] suffix;
 
-      if (mode == VECTOR && which[nvalues] == COMPUTE && 
-	  argindex[nvalues] == 0) {
-	int icompute = modify->find_compute(ids[nvalues]);
-	if (icompute < 0)
-	  error->all(FLERR,"Compute ID for fix ave/time does not exist");
-	if (modify->compute[icompute]->array_flag) {
-	  int ncols = modify->compute[icompute]->size_array_cols;
-	  maxvalues += ncols-1;
-	  allocate_values(maxvalues);
-	  argindex[nvalues] = 1;
-	  for (int icol = 1; icol < ncols; icol++) {
-	    which[nvalues+icol] = which[nvalues];
-	    argindex[nvalues+icol] = icol+1;
-	    n = strlen(ids[nvalues]) + 1;
-	    ids[nvalues+icol] = new char[n];
-	    strcpy(ids[nvalues+icol],ids[nvalues]);
-	  }
-	  nvalues += ncols-1;
-	}
-
-      } else if (mode == VECTOR && which[nvalues] == FIX && 
-		 argindex[nvalues] == 0) {
-	int ifix = modify->find_fix(ids[nvalues]);
-	if (ifix < 0)
-	  error->all(FLERR,"Fix ID for fix ave/time does not exist");
-	if (modify->fix[ifix]->array_flag) {
-	  int ncols = modify->fix[ifix]->size_array_cols;
-	  maxvalues += ncols-1;
-	  allocate_values(maxvalues);
-	  argindex[nvalues] = 1;
-	  for (int icol = 1; icol < ncols; icol++) {
-	    which[nvalues+icol] = which[nvalues];
-	    argindex[nvalues+icol] = icol+1;
-	    n = strlen(ids[nvalues]) + 1;
-	    ids[nvalues+icol] = new char[n];
-	    strcpy(ids[nvalues+icol],ids[nvalues]);
-	  }
-	  nvalues += ncols-1;
-	}
+      if (mode == VECTOR && which[nvalues] == COMPUTE &&
+          argindex[nvalues] == 0) {
+        int icompute = modify->find_compute(ids[nvalues]);
+        if (icompute < 0)
+          error->all(FLERR,"Compute ID for fix ave/time does not exist");
+        if (modify->compute[icompute]->array_flag) {
+          int ncols = modify->compute[icompute]->size_array_cols;
+          maxvalues += ncols-1;
+          allocate_values(maxvalues);
+          argindex[nvalues] = 1;
+          for (int icol = 1; icol < ncols; icol++) {
+            which[nvalues+icol] = which[nvalues];
+            argindex[nvalues+icol] = icol+1;
+            n = strlen(ids[nvalues]) + 1;
+            ids[nvalues+icol] = new char[n];
+            strcpy(ids[nvalues+icol],ids[nvalues]);
+          }
+          nvalues += ncols-1;
+        }
+
+      } else if (mode == VECTOR && which[nvalues] == FIX &&
+                 argindex[nvalues] == 0) {
+        int ifix = modify->find_fix(ids[nvalues]);
+        if (ifix < 0)
+          error->all(FLERR,"Fix ID for fix ave/time does not exist");
+        if (modify->fix[ifix]->array_flag) {
+          int ncols = modify->fix[ifix]->size_array_cols;
+          maxvalues += ncols-1;
+          allocate_values(maxvalues);
+          argindex[nvalues] = 1;
+          for (int icol = 1; icol < ncols; icol++) {
+            which[nvalues+icol] = which[nvalues];
+            argindex[nvalues+icol] = icol+1;
+            n = strlen(ids[nvalues]) + 1;
+            ids[nvalues+icol] = new char[n];
+            strcpy(ids[nvalues+icol],ids[nvalues]);
+          }
+          nvalues += ncols-1;
+        }
       }
 
       nvalues++;
@@ -175,60 +175,60 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
     if (which[i] == COMPUTE && mode == SCALAR) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/time does not exist");
+        error->all(FLERR,"Compute ID for fix ave/time does not exist");
       if (argindex[i] == 0 && modify->compute[icompute]->scalar_flag == 0)
-	error->all(FLERR,"Fix ave/time compute does not calculate a scalar");
+        error->all(FLERR,"Fix ave/time compute does not calculate a scalar");
       if (argindex[i] && modify->compute[icompute]->vector_flag == 0)
-	error->all(FLERR,"Fix ave/time compute does not calculate a vector");
+        error->all(FLERR,"Fix ave/time compute does not calculate a vector");
       if (argindex[i] && argindex[i] > modify->compute[icompute]->size_vector)
-	error->all(FLERR,"Fix ave/time compute vector is accessed out-of-range");
+        error->all(FLERR,"Fix ave/time compute vector is accessed out-of-range");
 
     } else if (which[i] == COMPUTE && mode == VECTOR) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/time does not exist");
+        error->all(FLERR,"Compute ID for fix ave/time does not exist");
       if (argindex[i] == 0 && modify->compute[icompute]->vector_flag == 0)
-	error->all(FLERR,"Fix ave/time compute does not calculate a vector");
+        error->all(FLERR,"Fix ave/time compute does not calculate a vector");
       if (argindex[i] && modify->compute[icompute]->array_flag == 0)
-	error->all(FLERR,"Fix ave/time compute does not calculate an array");
-      if (argindex[i] && 
-	  argindex[i] > modify->compute[icompute]->size_array_cols)
-	error->all(FLERR,"Fix ave/time compute array is accessed out-of-range");
+        error->all(FLERR,"Fix ave/time compute does not calculate an array");
+      if (argindex[i] &&
+          argindex[i] > modify->compute[icompute]->size_array_cols)
+        error->all(FLERR,"Fix ave/time compute array is accessed out-of-range");
 
     } else if (which[i] == FIX && mode == SCALAR) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for fix ave/time does not exist");
+        error->all(FLERR,"Fix ID for fix ave/time does not exist");
       if (argindex[i] == 0 && modify->fix[ifix]->scalar_flag == 0)
-	error->all(FLERR,"Fix ave/time fix does not calculate a scalar");
+        error->all(FLERR,"Fix ave/time fix does not calculate a scalar");
       if (argindex[i] && modify->fix[ifix]->vector_flag == 0)
-	error->all(FLERR,"Fix ave/time fix does not calculate a vector");
+        error->all(FLERR,"Fix ave/time fix does not calculate a vector");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_vector)
-	error->all(FLERR,"Fix ave/time fix vector is accessed out-of-range");
+        error->all(FLERR,"Fix ave/time fix vector is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all(FLERR,"Fix for fix ave/time not computed at compatible time");
+        error->all(FLERR,"Fix for fix ave/time not computed at compatible time");
 
     } else if (which[i] == FIX && mode == VECTOR) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for fix ave/time does not exist");
+        error->all(FLERR,"Fix ID for fix ave/time does not exist");
       if (argindex[i] == 0 && modify->fix[ifix]->vector_flag == 0)
-	error->all(FLERR,"Fix ave/time fix does not calculate a vector");
+        error->all(FLERR,"Fix ave/time fix does not calculate a vector");
       if (argindex[i] && modify->fix[ifix]->array_flag == 0)
-	error->all(FLERR,"Fix ave/time fix does not calculate an array");
+        error->all(FLERR,"Fix ave/time fix does not calculate an array");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_array_cols)
-	error->all(FLERR,"Fix ave/time fix array is accessed out-of-range");
+        error->all(FLERR,"Fix ave/time fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->global_freq)
-	error->all(FLERR,"Fix for fix ave/time not computed at compatible time");
+        error->all(FLERR,"Fix for fix ave/time not computed at compatible time");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all(FLERR,"Variable name for fix ave/time does not exist");
+        error->all(FLERR,"Variable name for fix ave/time does not exist");
       if (input->variable->equalstyle(ivariable) == 0)
-	error->all(FLERR,"Fix ave/time variable is not equal-style variable");
+        error->all(FLERR,"Fix ave/time variable is not equal-style variable");
       if (mode == VECTOR)
-	error->all(FLERR,"Fix ave/time cannot use variable with vector mode");
+        error->all(FLERR,"Fix ave/time cannot use variable with vector mode");
     }
   }
 
@@ -240,17 +240,17 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
 
     for (int i = 0; i < nvalues; i++) {
       if (which[i] == COMPUTE) {
-	int icompute = modify->find_compute(ids[i]);
-	if (argindex[i] == 0) length = modify->compute[icompute]->size_vector;
-	else length = modify->compute[icompute]->size_array_rows;
+        int icompute = modify->find_compute(ids[i]);
+        if (argindex[i] == 0) length = modify->compute[icompute]->size_vector;
+        else length = modify->compute[icompute]->size_array_rows;
       } else if (which[i] == FIX) {
-	int ifix = modify->find_fix(ids[i]);
-	if (argindex[i] == 0) length = modify->fix[ifix]->size_vector;
-	else length = modify->fix[ifix]->size_array_rows;
+        int ifix = modify->find_fix(ids[i]);
+        if (argindex[i] == 0) length = modify->fix[ifix]->size_vector;
+        else length = modify->fix[ifix]->size_array_rows;
       }
       if (i == 0) nrows = length;
       else if (length != nrows)
-	error->all(FLERR,"Fix ave/time columns are inconsistent lengths");
+        error->all(FLERR,"Fix ave/time columns are inconsistent lengths");
     }
 
     column = new double[nrows];
@@ -273,10 +273,10 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
     else if (mode == VECTOR) {
       fprintf(fp,"# Row");
       for (int i = 0; i < nvalues; i++) {
-	if (which[i] == COMPUTE) fprintf(fp," c_%s",ids[i]);
-	else if (which[i] == FIX) fprintf(fp," f_%s",ids[i]);
-	else if (which[i] == VARIABLE) fprintf(fp," v_%s",ids[i]);
-	if (argindex[i]) fprintf(fp,"[%d]",argindex[i]);
+        if (which[i] == COMPUTE) fprintf(fp," c_%s",ids[i]);
+        else if (which[i] == FIX) fprintf(fp," f_%s",ids[i]);
+        else if (which[i] == VARIABLE) fprintf(fp," v_%s",ids[i]);
+        if (argindex[i]) fprintf(fp,"[%d]",argindex[i]);
       }
       fprintf(fp,"\n");
     }
@@ -292,7 +292,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
   vector_list = NULL;
   array = array_total = NULL;
   array_list = NULL;
-  
+
   if (mode == SCALAR) {
     vector = new double[nvalues];
     vector_total = new double[nvalues];
@@ -309,43 +309,43 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
   // SCALAR mode produces either a scalar or vector
   // VECTOR mode produces either a vector or array
   // intensive/extensive flags set by compute,fix,variable that produces value
-  
+
   extlist = NULL;
 
   if (mode == SCALAR) {
     if (nvalues == 1) {
       scalar_flag = 1;
       if (which[0] == COMPUTE) {
-	Compute *compute = modify->compute[modify->find_compute(ids[0])];
-	if (argindex[0] == 0) extscalar = compute->extscalar;
-	else if (compute->extvector >= 0) extscalar = compute->extvector;
-	else extscalar = compute->extlist[argindex[0]-1];
+        Compute *compute = modify->compute[modify->find_compute(ids[0])];
+        if (argindex[0] == 0) extscalar = compute->extscalar;
+        else if (compute->extvector >= 0) extscalar = compute->extvector;
+        else extscalar = compute->extlist[argindex[0]-1];
       } else if (which[0] == FIX) {
-	Fix *fix = modify->fix[modify->find_fix(ids[0])];
-	if (argindex[0] == 0) extscalar = fix->extscalar;
-	else if (fix->extvector >= 0) extscalar = fix->extvector;
-	else extscalar = fix->extlist[argindex[0]-1];
+        Fix *fix = modify->fix[modify->find_fix(ids[0])];
+        if (argindex[0] == 0) extscalar = fix->extscalar;
+        else if (fix->extvector >= 0) extscalar = fix->extvector;
+        else extscalar = fix->extlist[argindex[0]-1];
       } else if (which[0] == VARIABLE)
-	extscalar = 0;
-      
+        extscalar = 0;
+
     } else {
       vector_flag = 1;
       size_vector = nvalues;
       extvector = -1;
       extlist = new int[nvalues];
       for (int i = 0; i < nvalues; i++) {
-	if (which[i] == COMPUTE) {
-	  Compute *compute = modify->compute[modify->find_compute(ids[i])];
-	  if (argindex[i] == 0) extlist[i] = compute->extscalar;
-	  else if (compute->extvector >= 0) extlist[i] = compute->extvector;
-	  else extlist[i] = compute->extlist[argindex[i]-1];
-	} else if (which[i] == FIX) {
-	  Fix *fix = modify->fix[modify->find_fix(ids[i])];
-	  if (argindex[i] == 0) extlist[i] = fix->extscalar;
-	  else if (fix->extvector >= 0) extlist[i] = fix->extvector;
-	  else extlist[i] = fix->extlist[argindex[i]-1];
-	} else if (which[i] == VARIABLE)
-	  extlist[i] = 0;
+        if (which[i] == COMPUTE) {
+          Compute *compute = modify->compute[modify->find_compute(ids[i])];
+          if (argindex[i] == 0) extlist[i] = compute->extscalar;
+          else if (compute->extvector >= 0) extlist[i] = compute->extvector;
+          else extlist[i] = compute->extlist[argindex[i]-1];
+        } else if (which[i] == FIX) {
+          Fix *fix = modify->fix[modify->find_fix(ids[i])];
+          if (argindex[i] == 0) extlist[i] = fix->extscalar;
+          else if (fix->extvector >= 0) extlist[i] = fix->extvector;
+          else extlist[i] = fix->extlist[argindex[i]-1];
+        } else if (which[i] == VARIABLE)
+          extlist[i] = 0;
       }
     }
 
@@ -354,23 +354,23 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
       vector_flag = 1;
       size_vector = nrows;
       if (which[0] == COMPUTE) {
-	Compute *compute = modify->compute[modify->find_compute(ids[0])];
-	if (argindex[0] == 0) {
-	  extvector = compute->extvector;
-	  if (extvector == -1) {
-	    extlist = new int[nrows];
-	    for (int i = 0; i < nrows; i++) extlist[i] = compute->extlist[i];
-	  }
-	} else extvector = compute->extarray;
+        Compute *compute = modify->compute[modify->find_compute(ids[0])];
+        if (argindex[0] == 0) {
+          extvector = compute->extvector;
+          if (extvector == -1) {
+            extlist = new int[nrows];
+            for (int i = 0; i < nrows; i++) extlist[i] = compute->extlist[i];
+          }
+        } else extvector = compute->extarray;
       } else if (which[0] == FIX) {
-	Fix *fix = modify->fix[modify->find_fix(ids[0])];
-	if (argindex[0] == 0) {
-	  extvector = fix->extvector;
-	  if (extvector == -1) {
-	    extlist = new int[nrows];
-	    for (int i = 0; i < nrows; i++) extlist[i] = fix->extlist[i];
-	  }
-	} else extvector = fix->extarray;
+        Fix *fix = modify->fix[modify->find_fix(ids[0])];
+        if (argindex[0] == 0) {
+          extvector = fix->extvector;
+          if (extvector == -1) {
+            extlist = new int[nrows];
+            for (int i = 0; i < nrows; i++) extlist[i] = fix->extlist[i];
+          }
+        } else extvector = fix->extarray;
       }
 
     } else {
@@ -379,22 +379,22 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) :
       size_array_cols = nvalues;
       int value;
       for (int i = 0; i < nvalues; i++) {
-	if (which[i] == COMPUTE) {
-	  Compute *compute = modify->compute[modify->find_compute(ids[i])];
-	  if (argindex[i] == 0) value = compute->extvector;
-	  else value = compute->extarray;
-	} else if (which[i] == FIX) {
-	  Fix *fix = modify->fix[modify->find_fix(ids[i])];
-	  if (argindex[i] == 0) value = fix->extvector;
-	  else value = fix->extarray;
-	}
-	if (value == -1) 
-	  error->all(FLERR,"Fix ave/time cannot set output array "
-		     "intensive/extensive from these inputs");
-	if (i == 0) extarray = value;
-	else if (value != extarray)
-	  error->all(FLERR,"Fix ave/time cannot set output array "
-		     "intensive/extensive from these inputs");
+        if (which[i] == COMPUTE) {
+          Compute *compute = modify->compute[modify->find_compute(ids[i])];
+          if (argindex[i] == 0) value = compute->extvector;
+          else value = compute->extarray;
+        } else if (which[i] == FIX) {
+          Fix *fix = modify->fix[modify->find_fix(ids[i])];
+          if (argindex[i] == 0) value = fix->extvector;
+          else value = fix->extarray;
+        }
+        if (value == -1)
+          error->all(FLERR,"Fix ave/time cannot set output array "
+                     "intensive/extensive from these inputs");
+        if (i == 0) extarray = value;
+        else if (value != extarray)
+          error->all(FLERR,"Fix ave/time cannot set output array "
+                     "intensive/extensive from these inputs");
       }
     }
   }
@@ -463,19 +463,19 @@ void FixAveTime::init()
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix ave/time does not exist");
+        error->all(FLERR,"Compute ID for fix ave/time does not exist");
       value2index[i] = icompute;
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
-      if (ifix < 0) 
-	error->all(FLERR,"Fix ID for fix ave/time does not exist");
+      if (ifix < 0)
+        error->all(FLERR,"Fix ID for fix ave/time does not exist");
       value2index[i] = ifix;
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
-      if (ivariable < 0) 
-	error->all(FLERR,"Variable name for fix ave/time does not exist");
+      if (ivariable < 0)
+        error->all(FLERR,"Variable name for fix ave/time does not exist");
       value2index[i] = ivariable;
     }
   }
@@ -530,41 +530,41 @@ void FixAveTime::invoke_scalar(bigint ntimestep)
 
   for (i = 0; i < nvalues; i++) {
     m = value2index[i];
-    
+
     // invoke compute if not previously invoked
-    
+
     if (which[i] == COMPUTE) {
       Compute *compute = modify->compute[m];
-      
+
       if (argindex[i] == 0) {
-	if (!(compute->invoked_flag & INVOKED_SCALAR)) {
-	  compute->compute_scalar();
-	  compute->invoked_flag |= INVOKED_SCALAR;
-	}
-	scalar = compute->scalar;
+        if (!(compute->invoked_flag & INVOKED_SCALAR)) {
+          compute->compute_scalar();
+          compute->invoked_flag |= INVOKED_SCALAR;
+        }
+        scalar = compute->scalar;
       } else {
-	if (!(compute->invoked_flag & INVOKED_VECTOR)) {
-	  compute->compute_vector();
-	  compute->invoked_flag |= INVOKED_VECTOR;
-	}
-	scalar = compute->vector[argindex[i]-1];
+        if (!(compute->invoked_flag & INVOKED_VECTOR)) {
+          compute->compute_vector();
+          compute->invoked_flag |= INVOKED_VECTOR;
+        }
+        scalar = compute->vector[argindex[i]-1];
       }
-      
+
     // access fix fields, guaranteed to be ready
-      
+
     } else if (which[i] == FIX) {
-      if (argindex[i] == 0) 
-	scalar = modify->fix[m]->compute_scalar();
+      if (argindex[i] == 0)
+        scalar = modify->fix[m]->compute_scalar();
       else
-	scalar = modify->fix[m]->compute_vector(argindex[i]-1);
-      
+        scalar = modify->fix[m]->compute_vector(argindex[i]-1);
+
     // evaluate equal-style variable
-      
+
     } else if (which[i] == VARIABLE)
       scalar = input->variable->compute_equal(m);
-    
+
     // add value to vector or just set directly if offcol is set
-    
+
     if (offcol[i]) vector[i] = scalar;
     else vector[i] += scalar;
   }
@@ -596,18 +596,18 @@ void FixAveTime::invoke_scalar(bigint ntimestep)
   if (ave == ONE) {
     for (i = 0; i < nvalues; i++) vector_total[i] = vector[i];
     norm = 1;
-    
+
   } else if (ave == RUNNING) {
     for (i = 0; i < nvalues; i++) vector_total[i] += vector[i];
     norm++;
-    
+
   } else if (ave == WINDOW) {
     for (i = 0; i < nvalues; i++) {
       vector_total[i] += vector[i];
       if (window_limit) vector_total[i] -= vector_list[iwindow][i];
       vector_list[iwindow][i] = vector[i];
     }
-    
+
     iwindow++;
     if (iwindow == nwindow) {
       iwindow = 0;
@@ -616,7 +616,7 @@ void FixAveTime::invoke_scalar(bigint ntimestep)
     if (window_limit) norm = nwindow;
     else norm = iwindow;
   }
-  
+
   // insure any columns with offcol set are effectively set to last value
 
   for (i = 0; i < nvalues; i++)
@@ -637,114 +637,114 @@ void FixAveTime::invoke_scalar(bigint ntimestep)
 void FixAveTime::invoke_vector(bigint ntimestep)
 {
   int i,j,m;
-  
+
   // zero if first step
 
   if (irepeat == 0)
     for (i = 0; i < nrows; i++)
       for (j = 0; j < nvalues; j++) array[i][j] = 0.0;
-  
+
   // accumulate results of computes,fixes,variables to local copy
   // compute/fix/variable may invoke computes so wrap with clear/add
-  
+
   modify->clearstep_compute();
-  
+
   for (j = 0; j < nvalues; j++) {
     m = value2index[j];
-    
+
     // invoke compute if not previously invoked
-    
+
     if (which[j] == COMPUTE) {
       Compute *compute = modify->compute[m];
-      
+
       if (argindex[j] == 0) {
-	if (!(compute->invoked_flag & INVOKED_VECTOR)) {
-	  compute->compute_vector();
-	  compute->invoked_flag |= INVOKED_VECTOR;
-	}
-	double *cvector = compute->vector;
-	for (i = 0; i < nrows; i++)
-	  column[i] = cvector[i];
-	
+        if (!(compute->invoked_flag & INVOKED_VECTOR)) {
+          compute->compute_vector();
+          compute->invoked_flag |= INVOKED_VECTOR;
+        }
+        double *cvector = compute->vector;
+        for (i = 0; i < nrows; i++)
+          column[i] = cvector[i];
+
       } else {
-	if (!(compute->invoked_flag & INVOKED_ARRAY)) {
-	  compute->compute_array();
-	  compute->invoked_flag |= INVOKED_ARRAY;
-	}
-	double **carray = compute->array;
-	int icol = argindex[j]-1;
-	for (i = 0; i < nrows; i++)
-	  column[i] = carray[i][icol];
+        if (!(compute->invoked_flag & INVOKED_ARRAY)) {
+          compute->compute_array();
+          compute->invoked_flag |= INVOKED_ARRAY;
+        }
+        double **carray = compute->array;
+        int icol = argindex[j]-1;
+        for (i = 0; i < nrows; i++)
+          column[i] = carray[i][icol];
       }
-      
+
     // access fix fields, guaranteed to be ready
-      
+
     } else if (which[j] == FIX) {
       Fix *fix = modify->fix[m];
       if (argindex[j] == 0)
-	for (i = 0; i < nrows; i++)
-	  column[i] = fix->compute_vector(i);
+        for (i = 0; i < nrows; i++)
+          column[i] = fix->compute_vector(i);
       else {
-	int icol = argindex[j]-1;
-	for (i = 0; i < nrows; i++)
-	  column[i] = fix->compute_array(i,icol);
+        int icol = argindex[j]-1;
+        for (i = 0; i < nrows; i++)
+          column[i] = fix->compute_array(i,icol);
       }
     }
-    
+
     // add columns of values to array or just set directly if offcol is set
-    
+
     if (offcol[j]) {
       for (i = 0; i < nrows; i++)
-	array[i][j] = column[i];
+        array[i][j] = column[i];
     } else {
       for (i = 0; i < nrows; i++)
-	array[i][j] += column[i];
+        array[i][j] += column[i];
     }
   }
-  
+
   // done if irepeat < nrepeat
   // else reset irepeat and nvalid
-  
+
   irepeat++;
   if (irepeat < nrepeat) {
     nvalid += nevery;
     modify->addstep_compute(nvalid);
     return;
   }
-  
+
   irepeat = 0;
   nvalid = ntimestep+nfreq - (nrepeat-1)*nevery;
   modify->addstep_compute(nvalid);
-  
+
   // average the final result for the Nfreq timestep
-  
+
   double repeat = nrepeat;
   for (i = 0; i < nrows; i++)
     for (j = 0; j < nvalues; j++)
       if (offcol[j] == 0) array[i][j] /= repeat;
-  
+
   // if ave = ONE, only single Nfreq timestep value is needed
   // if ave = RUNNING, combine with all previous Nfreq timestep values
   // if ave = WINDOW, combine with nwindow most recent Nfreq timestep values
-  
+
   if (ave == ONE) {
     for (i = 0; i < nrows; i++)
       for (j = 0; j < nvalues; j++) array_total[i][j] = array[i][j];
     norm = 1;
-    
+
   } else if (ave == RUNNING) {
     for (i = 0; i < nrows; i++)
       for (j = 0; j < nvalues; j++) array_total[i][j] += array[i][j];
     norm++;
-    
+
   } else if (ave == WINDOW) {
     for (i = 0; i < nrows; i++)
       for (j = 0; j < nvalues; j++) {
-	array_total[i][j] += array[i][j];
-	if (window_limit) array_total[i][j] -= array_list[iwindow][i][j];
-	array_list[iwindow][i][j] = array[i][j];
+        array_total[i][j] += array[i][j];
+        if (window_limit) array_total[i][j] -= array_list[iwindow][i][j];
+        array_list[iwindow][i][j] = array[i][j];
       }
-    
+
     iwindow++;
     if (iwindow == nwindow) {
       iwindow = 0;
@@ -753,15 +753,15 @@ void FixAveTime::invoke_vector(bigint ntimestep)
     if (window_limit) norm = nwindow;
     else norm = iwindow;
   }
-  
+
   // insure any columns with offcol set are effectively set to last value
-  
+
   for (i = 0; i < nrows; i++)
     for (j = 0; j < nvalues; j++)
       if (offcol[j]) array_total[i][j] = norm*array[i][j];
-  
+
   // output result to file
-      
+
   if (fp && me == 0) {
     fprintf(fp,BIGINT_FORMAT " %d\n",ntimestep,nrows);
     for (i = 0; i < nrows; i++) {
@@ -831,12 +831,12 @@ void FixAveTime::options(int narg, char **arg)
     if (strcmp(arg[iarg],"file") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command");
       if (me == 0) {
-	fp = fopen(arg[iarg+1],"w");
-	if (fp == NULL) {
-	  char str[128];
-	  sprintf(str,"Cannot open fix ave/time file %s",arg[iarg+1]);
-	  error->one(FLERR,str);
-	}
+        fp = fopen(arg[iarg+1],"w");
+        if (fp == NULL) {
+          char str[128];
+          sprintf(str,"Cannot open fix ave/time file %s",arg[iarg+1]);
+          error->one(FLERR,str);
+        }
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"ave") == 0) {
@@ -846,9 +846,9 @@ void FixAveTime::options(int narg, char **arg)
       else if (strcmp(arg[iarg+1],"window") == 0) ave = WINDOW;
       else error->all(FLERR,"Illegal fix ave/time command");
       if (ave == WINDOW) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/time command");
-	nwindow = atoi(arg[iarg+2]);
-	if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/time command");
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/time command");
+        nwindow = atoi(arg[iarg+2]);
+        if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/time command");
       }
       iarg += 2;
       if (ave == WINDOW) iarg++;
diff --git a/src/fix_ave_time.h b/src/fix_ave_time.h
index 0423bee3e2..2493f98e76 100644
--- a/src/fix_ave_time.h
+++ b/src/fix_ave_time.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_aveforce.cpp b/src/fix_aveforce.cpp
index 274820a0e3..7fa07b299f 100644
--- a/src/fix_aveforce.cpp
+++ b/src/fix_aveforce.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -86,7 +86,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) :
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix aveforce command");
       iregion = domain->find_region(arg[iarg+1]);
       if (iregion == -1)
-	error->all(FLERR,"Region ID for fix aveforce does not exist");
+        error->all(FLERR,"Region ID for fix aveforce does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
@@ -95,7 +95,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) :
 
   }
 
-  foriginal_all[0] = foriginal_all[1] = 
+  foriginal_all[0] = foriginal_all[1] =
     foriginal_all[2] = foriginal_all[3] = 0.0;
 }
 
@@ -196,9 +196,9 @@ void FixAveForce::post_force(int vflag)
 
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
-      if (iregion >= 0 && 
+      if (iregion >= 0 &&
           !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
-	continue;
+        continue;
 
       foriginal[0] += f[i][0];
       foriginal[1] += f[i][1];
@@ -233,9 +233,9 @@ void FixAveForce::post_force(int vflag)
 
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
-      if (iregion >= 0 && 
+      if (iregion >= 0 &&
           !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
-	continue;
+        continue;
 
       if (xstyle) f[i][0] = fave[0];
       if (ystyle) f[i][1] = fave[1];
@@ -262,14 +262,14 @@ void FixAveForce::post_force_respa(int vflag, int ilevel, int iloop)
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (iregion >= 0 && 
-	    !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
-	  continue;
-
-	foriginal[0] += f[i][0];
-	foriginal[1] += f[i][1];
-	foriginal[2] += f[i][2];
-	foriginal[3] += 1.0;
+        if (iregion >= 0 &&
+            !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
+          continue;
+
+        foriginal[0] += f[i][0];
+        foriginal[1] += f[i][1];
+        foriginal[2] += f[i][2];
+        foriginal[3] += 1.0;
       }
 
     MPI_Allreduce(foriginal,foriginal_all,4,MPI_DOUBLE,MPI_SUM,world);
@@ -284,13 +284,13 @@ void FixAveForce::post_force_respa(int vflag, int ilevel, int iloop)
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (iregion >= 0 && 
-	    !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
-	  continue;
+        if (iregion >= 0 &&
+            !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
+          continue;
 
-	if (xstyle) f[i][0] = fave[0];
-	if (ystyle) f[i][1] = fave[1];
-	if (zstyle) f[i][2] = fave[2];
+        if (xstyle) f[i][0] = fave[0];
+        if (ystyle) f[i][1] = fave[1];
+        if (zstyle) f[i][2] = fave[2];
       }
   }
 }
diff --git a/src/fix_aveforce.h b/src/fix_aveforce.h
index f4bda6d910..ba5aa37640 100644
--- a/src/fix_aveforce.h
+++ b/src/fix_aveforce.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_box_relax.cpp b/src/fix_box_relax.cpp
index 24891ee950..b40284acef 100644
--- a/src/fix_box_relax.cpp
+++ b/src/fix_box_relax.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -59,9 +59,9 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
   deviatoric_flag = 0;
   nreset_h0 = 0;
 
-  p_target[0] = p_target[1] = p_target[2] = 
+  p_target[0] = p_target[1] = p_target[2] =
     p_target[3] = p_target[4] = p_target[5] = 0.0;
-  p_flag[0] = p_flag[1] = p_flag[2] = 
+  p_flag[0] = p_flag[1] = p_flag[2] =
     p_flag[3] = p_flag[4] = p_flag[5] = 0;
 
   // process keywords
@@ -77,18 +77,18 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
       p_target[0] = p_target[1] = p_target[2] = atof(arg[iarg+1]);
       p_flag[0] = p_flag[1] = p_flag[2] = 1;
       if (dimension == 2) {
-	p_target[2] = 0.0;
-	p_flag[2] = 0;
+        p_target[2] = 0.0;
+        p_flag[2] = 0;
       }
-      iarg += 2; 
+      iarg += 2;
     } else if (strcmp(arg[iarg],"aniso") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       pcouple = NONE;
       p_target[0] = p_target[1] = p_target[2] = atof(arg[iarg+1]);
       p_flag[0] = p_flag[1] = p_flag[2] = 1;
       if (dimension == 2) {
-	p_target[2] = 0.0;
-	p_flag[2] = 0;
+        p_target[2] = 0.0;
+        p_flag[2] = 0;
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"tri") == 0) {
@@ -99,8 +99,8 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
       p_target[3] = p_target[4] = p_target[5] = 0.0;
       p_flag[3] = p_flag[4] = p_flag[5] = 1;
       if (dimension == 2) {
-	p_target[2] = p_target[3] = p_target[4] = 0.0;
-	p_flag[2] = p_flag[3] = p_flag[4] = 0;
+        p_target[2] = p_target[3] = p_target[4] = 0.0;
+        p_flag[2] = p_flag[3] = p_flag[4] = 0;
       }
       iarg += 2;
 
@@ -109,44 +109,44 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
       p_target[0] = atof(arg[iarg+1]);
       p_flag[0] = 1;
       deviatoric_flag = 1;
-      iarg += 2; 
+      iarg += 2;
     } else if (strcmp(arg[iarg],"y") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       p_target[1] = atof(arg[iarg+1]);
       p_flag[1] = 1;
       deviatoric_flag = 1;
-      iarg += 2; 
+      iarg += 2;
     } else if (strcmp(arg[iarg],"z") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       p_target[2] = atof(arg[iarg+1]);
       p_flag[2] = 1;
       deviatoric_flag = 1;
-      iarg += 2; 
+      iarg += 2;
       if (dimension == 2)
-	error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
+        error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
 
     } else if (strcmp(arg[iarg],"yz") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       p_target[3] = atof(arg[iarg+1]);
       p_flag[3] = 1;
       deviatoric_flag = 1;
-      iarg += 2; 
+      iarg += 2;
       if (dimension == 2)
-	error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
+        error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xz") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       p_target[4] = atof(arg[iarg+1]);
       p_flag[4] = 1;
       deviatoric_flag = 1;
-      iarg += 2; 
+      iarg += 2;
       if (dimension == 2)
-	error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
+        error->all(FLERR,"Invalid fix box/relax command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xy") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
       p_target[5] = atof(arg[iarg+1]);
       p_flag[5] = 1;
       deviatoric_flag = 1;
-      iarg += 2; 
+      iarg += 2;
 
     } else if (strcmp(arg[iarg],"couple") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command");
@@ -211,17 +211,17 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) :
 
   if (p_flag[3] && domain->zperiodic == 0)
     error->all(FLERR,
-	       "Cannot use fix box/relax on a 2nd non-periodic dimension");
+               "Cannot use fix box/relax on a 2nd non-periodic dimension");
   if (p_flag[4] && domain->zperiodic == 0)
     error->all(FLERR,
-	       "Cannot use fix box/relax on a 2nd non-periodic dimension");
+               "Cannot use fix box/relax on a 2nd non-periodic dimension");
   if (p_flag[5] && domain->yperiodic == 0)
     error->all(FLERR,
-	       "Cannot use fix box/relax on a 2nd non-periodic dimension");
+               "Cannot use fix box/relax on a 2nd non-periodic dimension");
 
-  if (!domain->triclinic && (p_flag[3] || p_flag[4] || p_flag[5])) 
+  if (!domain->triclinic && (p_flag[3] || p_flag[4] || p_flag[5]))
     error->all(FLERR,"Can not specify Pxy/Pxz/Pyz in "
-	       "fix box/relax with non-triclinic box");
+               "fix box/relax with non-triclinic box");
 
   if (pcouple == XYZ && dimension == 3 &&
       (p_target[0] != p_target[1] || p_target[0] != p_target[2]))
@@ -319,12 +319,12 @@ void FixBoxRelax::init()
   // set temperature and pressure ptrs
 
   int icompute = modify->find_compute(id_temp);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Temperature ID for fix box/relax does not exist");
   temperature = modify->compute[icompute];
 
   icompute = modify->find_compute(id_press);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Pressure ID for fix box/relax does not exist");
   pressure = modify->compute[icompute];
 
@@ -415,11 +415,11 @@ double FixBoxRelax::min_energy(double *fextra)
     if (pstyle == TRICLINIC) {
       fextra[3] = fextra[4] = fextra[5] = 0.0;
       if (p_flag[3])
-	fextra[3] = pv2e*p_current[3]*scaley*yprdinit*scalex*xprdinit*yprdinit;
-      if (p_flag[4]) 
-	fextra[4] = pv2e*p_current[4]*scalex*xprdinit*scaley*yprdinit*xprdinit;
-      if (p_flag[5]) 
-	fextra[5] = pv2e*p_current[5]*scalex*xprdinit*scalez*zprdinit*xprdinit;
+        fextra[3] = pv2e*p_current[3]*scaley*yprdinit*scalex*xprdinit*yprdinit;
+      if (p_flag[4])
+        fextra[4] = pv2e*p_current[4]*scalex*xprdinit*scaley*yprdinit*xprdinit;
+      if (p_flag[5])
+        fextra[5] = pv2e*p_current[5]*scalex*xprdinit*scalez*zprdinit*xprdinit;
     }
 
     if (deviatoric_flag) {
@@ -428,9 +428,9 @@ double FixBoxRelax::min_energy(double *fextra)
       if (p_flag[1]) fextra[1] -= fdev[1]*yprdinit;
       if (p_flag[2]) fextra[2] -= fdev[2]*zprdinit;
       if (pstyle == TRICLINIC) {
-	if (p_flag[3]) fextra[3] -= fdev[3]*yprdinit;
-	if (p_flag[4]) fextra[4] -= fdev[4]*xprdinit;
-	if (p_flag[5]) fextra[5] -= fdev[5]*xprdinit;
+        if (p_flag[3]) fextra[3] -= fdev[3]*yprdinit;
+        if (p_flag[4]) fextra[4] -= fdev[4]*xprdinit;
+        if (p_flag[5]) fextra[5] -= fdev[5]*xprdinit;
       }
 
       eng += compute_strain_energy();
@@ -586,7 +586,7 @@ void FixBoxRelax::remap()
 {
   int i,n;
   double ctr;
-  
+
   // ctr = geometric center of box in a dimension
   // rescale simulation box from linesearch starting point
   // scale atom coords for all atoms or only for fix group atoms
@@ -601,7 +601,7 @@ void FixBoxRelax::remap()
   else {
     for (i = 0; i < n; i++)
       if (mask[i] & groupbit)
-	domain->x2lamda(x[i],x[i]);
+        domain->x2lamda(x[i],x[i]);
   }
 
   if (nrigid)
@@ -618,7 +618,7 @@ void FixBoxRelax::remap()
       domain->boxlo[i] = currentBoxLo0 + (currentBoxLo0-ctr)*ds[i]/s0[i];
       domain->boxhi[i] = currentBoxHi0 + (currentBoxHi0-ctr)*ds[i]/s0[i];
       if (domain->boxlo[i] >= domain->boxhi[i])
-	error->all(FLERR,"Fix box/relax generated negative box length");
+        error->all(FLERR,"Fix box/relax generated negative box length");
     }
 
   if (pstyle == TRICLINIC) {
@@ -636,7 +636,7 @@ void FixBoxRelax::remap()
   else {
     for (i = 0; i < n; i++)
       if (mask[i] & groupbit)
-	domain->lamda2x(x[i],x[i]);
+        domain->lamda2x(x[i],x[i]);
   }
 
   if (nrigid)
@@ -673,8 +673,8 @@ void FixBoxRelax::couple()
     p_current[2] = tensor[2];
   }
 
-  // switch order from xy-xz-yz to Voigt 
-  
+  // switch order from xy-xz-yz to Voigt
+
   if (pstyle == TRICLINIC) {
     p_current[3] = tensor[5];
     p_current[4] = tensor[4];
@@ -698,20 +698,20 @@ int FixBoxRelax::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(arg[1]);
-    if (icompute < 0) 
+    if (icompute < 0)
       error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
       error->all(FLERR,
-		 "Fix_modify temperature ID does not compute temperature");
+                 "Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != 0 && comm->me == 0)
       error->warning(FLERR,"Temperature for fix modify is not for group all");
 
     // reset id_temp of pressure to new temperature ID
-    
+
     icompute = modify->find_compute(id_press);
-    if (icompute < 0) 
+    if (icompute < 0)
       error->all(FLERR,"Pressure ID for fix modify does not exist");
     modify->compute[icompute]->reset_extra_compute_fix(id_temp);
 
@@ -769,7 +769,7 @@ void FixBoxRelax::compute_sigma()
   h0_inv[3] = domain->h_inv[3];
   h0_inv[4] = domain->h_inv[4];
   h0_inv[5] = domain->h_inv[5];
-  
+
   htmp[0][0] = h0[0];
   htmp[1][1] = h0[1];
   htmp[2][2] = h0[2];
@@ -835,26 +835,26 @@ void FixBoxRelax::compute_sigma()
 
 double FixBoxRelax::compute_strain_energy()
 {
-  // compute strain energy = 0.5*Tr(sigma*h*h^t) in energy units 
+  // compute strain energy = 0.5*Tr(sigma*h*h^t) in energy units
 
   double* h = domain->h;
   double d0,d1,d2;
 
   if (dimension == 3) {
-    d0 = 
+    d0 =
       sigma[0]*(h[0]*h[0]+h[5]*h[5]+h[4]*h[4]) +
       sigma[5]*(          h[1]*h[5]+h[3]*h[4]) +
       sigma[4]*(                    h[2]*h[4]);
-    d1 = 
+    d1 =
       sigma[5]*(          h[5]*h[1]+h[4]*h[3]) +
       sigma[1]*(          h[1]*h[1]+h[3]*h[3]) +
       sigma[3]*(                    h[2]*h[3]);
-    d2 = 
+    d2 =
       sigma[4]*(                    h[4]*h[2]) +
       sigma[3]*(                    h[3]*h[2]) +
       sigma[2]*(                    h[2]*h[2]);
   } else {
-    d0 = sigma[0]*(h[0]*h[0]+h[5]*h[5]) + sigma[5]*h[1]*h[5];    
+    d0 = sigma[0]*(h[0]*h[0]+h[5]*h[5]) + sigma[5]*h[1]*h[5];
     d1 = sigma[5]*h[5]*h[1] + sigma[1]*h[1]*h[1];
     d2 = 0.0;
   }
@@ -870,7 +870,7 @@ double FixBoxRelax::compute_strain_energy()
 void FixBoxRelax::compute_deviatoric()
 {
   double* h = domain->h;
-    
+
   // [ 0 5 4 ]   [ 0 5 4 ] [ 0 5 4 ]
   // [ 5 1 3 ] = [ - 1 3 ] [ 5 1 3 ]
   // [ 4 3 2 ]   [ - - 2 ] [ 4 3 2 ]
diff --git a/src/fix_box_relax.h b/src/fix_box_relax.h
index 53caf18ef3..566beb1fd9 100644
--- a/src/fix_box_relax.h
+++ b/src/fix_box_relax.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -67,7 +67,7 @@ class FixBoxRelax : public Fix {
   int *rfix;
 
   double sigma[6];                 // scaled target stress
-  double utsigma[3];               // weighting for upper-tri elements 
+  double utsigma[3];               // weighting for upper-tri elements
                                    // of modified sigma
   int sigmamod_flag;               // 1 if modified sigma to be used
   double fdev[6];                  // Deviatoric force on cell
diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp
index 2c9edcf7de..56a24723d2 100644
--- a/src/fix_deform.cpp
+++ b/src/fix_deform.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -59,11 +59,11 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   // set defaults
 
   set = new Set[6];
-  set[0].style = set[1].style = set[2].style = 
+  set[0].style = set[1].style = set[2].style =
     set[3].style = set[4].style = set[5].style = NONE;
-  set[0].hstr = set[1].hstr = set[2].hstr = 
+  set[0].hstr = set[1].hstr = set[2].hstr =
     set[3].hstr = set[4].hstr = set[5].hstr = NULL;
-  set[0].hratestr = set[1].hratestr = set[2].hratestr = 
+  set[0].hratestr = set[1].hratestr = set[2].hratestr =
     set[3].hratestr = set[4].hratestr = set[5].hratestr = NULL;
 
   // parse arguments
@@ -73,9 +73,9 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   int index;
   int iarg = 4;
   while (iarg < narg) {
-    if (strcmp(arg[iarg],"x") == 0 || 
-	strcmp(arg[iarg],"y") == 0 ||
-	strcmp(arg[iarg],"z") == 0) {
+    if (strcmp(arg[iarg],"x") == 0 ||
+        strcmp(arg[iarg],"y") == 0 ||
+        strcmp(arg[iarg],"z") == 0) {
 
       if (strcmp(arg[iarg],"x") == 0) index = 0;
       else if (strcmp(arg[iarg],"y") == 0) index = 1;
@@ -83,126 +83,126 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix deform command");
       if (strcmp(arg[iarg+1],"final") == 0) {
-	if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = FINAL;
-	set[index].flo = atof(arg[iarg+2]);
-	set[index].fhi = atof(arg[iarg+3]);
-	iarg += 4;
+        if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = FINAL;
+        set[index].flo = atof(arg[iarg+2]);
+        set[index].fhi = atof(arg[iarg+3]);
+        iarg += 4;
       } else if (strcmp(arg[iarg+1],"delta") == 0) {
-	if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = DELTA;
-	set[index].dlo = atof(arg[iarg+2]);
-	set[index].dhi = atof(arg[iarg+3]);
-	iarg += 4;
+        if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = DELTA;
+        set[index].dlo = atof(arg[iarg+2]);
+        set[index].dhi = atof(arg[iarg+3]);
+        iarg += 4;
       } else if (strcmp(arg[iarg+1],"scale") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = SCALE;
-	set[index].scale = atof(arg[iarg+2]);
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = SCALE;
+        set[index].scale = atof(arg[iarg+2]);
+        iarg += 3;
       } else if (strcmp(arg[iarg+1],"vel") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = VEL;
-	set[index].vel = atof(arg[iarg+2]);
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = VEL;
+        set[index].vel = atof(arg[iarg+2]);
+        iarg += 3;
       } else if (strcmp(arg[iarg+1],"erate") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = ERATE;
-	set[index].rate = atof(arg[iarg+2]);
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = ERATE;
+        set[index].rate = atof(arg[iarg+2]);
+        iarg += 3;
       } else if (strcmp(arg[iarg+1],"trate") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = TRATE;
-	set[index].rate = atof(arg[iarg+2]);
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = TRATE;
+        set[index].rate = atof(arg[iarg+2]);
+        iarg += 3;
       } else if (strcmp(arg[iarg+1],"volume") == 0) {
-	set[index].style = VOLUME;
-	iarg += 2;
+        set[index].style = VOLUME;
+        iarg += 2;
       } else if (strcmp(arg[iarg+1],"wiggle") == 0) {
-	if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = WIGGLE;
-	set[index].amplitude = atof(arg[iarg+2]);
-	set[index].tperiod = atof(arg[iarg+3]);
-	if (set[index].tperiod <= 0.0) 
-	  error->all(FLERR,"Illegal fix deform command");
-	iarg += 4;
+        if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = WIGGLE;
+        set[index].amplitude = atof(arg[iarg+2]);
+        set[index].tperiod = atof(arg[iarg+3]);
+        if (set[index].tperiod <= 0.0)
+          error->all(FLERR,"Illegal fix deform command");
+        iarg += 4;
       } else if (strcmp(arg[iarg+1],"variable") == 0) {
-	if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = VARIABLE;
-	if (strstr(arg[iarg+2],"v_") != arg[iarg+2])
-	  error->all(FLERR,"Illegal fix deform command");
-	if (strstr(arg[iarg+3],"v_") != arg[iarg+3])
-	  error->all(FLERR,"Illegal fix deform command");
-	delete [] set[index].hstr;
-	delete [] set[index].hratestr;
-	int n = strlen(&arg[iarg+2][2]) + 1;
-	set[index].hstr = new char[n];
-	strcpy(set[index].hstr,&arg[iarg+2][2]);
-	n = strlen(&arg[iarg+3][2]) + 1;
-	set[index].hratestr = new char[n];
-	strcpy(set[index].hratestr,&arg[iarg+3][2]);
-	iarg += 4;
+        if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = VARIABLE;
+        if (strstr(arg[iarg+2],"v_") != arg[iarg+2])
+          error->all(FLERR,"Illegal fix deform command");
+        if (strstr(arg[iarg+3],"v_") != arg[iarg+3])
+          error->all(FLERR,"Illegal fix deform command");
+        delete [] set[index].hstr;
+        delete [] set[index].hratestr;
+        int n = strlen(&arg[iarg+2][2]) + 1;
+        set[index].hstr = new char[n];
+        strcpy(set[index].hstr,&arg[iarg+2][2]);
+        n = strlen(&arg[iarg+3][2]) + 1;
+        set[index].hratestr = new char[n];
+        strcpy(set[index].hratestr,&arg[iarg+3][2]);
+        iarg += 4;
       } else error->all(FLERR,"Illegal fix deform command");
-      
-    } else if (strcmp(arg[iarg],"xy") == 0 || 
-	       strcmp(arg[iarg],"xz") == 0 ||
-	       strcmp(arg[iarg],"yz") == 0) {
+
+    } else if (strcmp(arg[iarg],"xy") == 0 ||
+               strcmp(arg[iarg],"xz") == 0 ||
+               strcmp(arg[iarg],"yz") == 0) {
 
       if (triclinic == 0)
-	error->all(FLERR,"Fix deform tilt factors require triclinic box");
+        error->all(FLERR,"Fix deform tilt factors require triclinic box");
       if (strcmp(arg[iarg],"xy") == 0) index = 5;
       else if (strcmp(arg[iarg],"xz") == 0) index = 4;
       else if (strcmp(arg[iarg],"yz") == 0) index = 3;
 
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix deform command");
       if (strcmp(arg[iarg+1],"final") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = FINAL;
-	set[index].ftilt = atof(arg[iarg+2]);
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = FINAL;
+        set[index].ftilt = atof(arg[iarg+2]);
+        iarg += 3;
       } else if (strcmp(arg[iarg+1],"delta") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = DELTA;
-	set[index].dtilt = atof(arg[iarg+2]);
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = DELTA;
+        set[index].dtilt = atof(arg[iarg+2]);
+        iarg += 3;
       } else if (strcmp(arg[iarg+1],"vel") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = VEL;
-	set[index].vel = atof(arg[iarg+2]);
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = VEL;
+        set[index].vel = atof(arg[iarg+2]);
+        iarg += 3;
       } else if (strcmp(arg[iarg+1],"erate") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = ERATE;
-	set[index].rate = atof(arg[iarg+2]);
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = ERATE;
+        set[index].rate = atof(arg[iarg+2]);
+        iarg += 3;
       } else if (strcmp(arg[iarg+1],"trate") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = TRATE;
-	set[index].rate = atof(arg[iarg+2]);
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = TRATE;
+        set[index].rate = atof(arg[iarg+2]);
+        iarg += 3;
       } else if (strcmp(arg[iarg+1],"wiggle") == 0) {
-	if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = WIGGLE;
-	set[index].amplitude = atof(arg[iarg+2]);
-	set[index].tperiod = atof(arg[iarg+3]);
-	if (set[index].tperiod <= 0.0) 
-	  error->all(FLERR,"Illegal fix deform command");
-	iarg += 4;
+        if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = WIGGLE;
+        set[index].amplitude = atof(arg[iarg+2]);
+        set[index].tperiod = atof(arg[iarg+3]);
+        if (set[index].tperiod <= 0.0)
+          error->all(FLERR,"Illegal fix deform command");
+        iarg += 4;
       } else if (strcmp(arg[iarg+1],"variable") == 0) {
-	if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
-	set[index].style = VARIABLE;
-	if (strstr(arg[iarg+2],"v_") != arg[iarg+2])
-	  error->all(FLERR,"Illegal fix deform command");
-	if (strstr(arg[iarg+3],"v_") != arg[iarg+3])
-	  error->all(FLERR,"Illegal fix deform command");
-	delete [] set[index].hstr;
-	delete [] set[index].hratestr;
-	int n = strlen(&arg[iarg+2][2]) + 1;
-	set[index].hstr = new char[n];
-	strcpy(set[index].hstr,&arg[iarg+2][2]);
-	n = strlen(&arg[iarg+3][2]) + 1;
-	set[index].hratestr = new char[n];
-	strcpy(set[index].hratestr,&arg[iarg+3][2]);
-	iarg += 4;
+        if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command");
+        set[index].style = VARIABLE;
+        if (strstr(arg[iarg+2],"v_") != arg[iarg+2])
+          error->all(FLERR,"Illegal fix deform command");
+        if (strstr(arg[iarg+3],"v_") != arg[iarg+3])
+          error->all(FLERR,"Illegal fix deform command");
+        delete [] set[index].hstr;
+        delete [] set[index].hratestr;
+        int n = strlen(&arg[iarg+2][2]) + 1;
+        set[index].hstr = new char[n];
+        strcpy(set[index].hstr,&arg[iarg+2][2]);
+        n = strlen(&arg[iarg+3][2]) + 1;
+        set[index].hratestr = new char[n];
+        strcpy(set[index].hratestr,&arg[iarg+3][2]);
+        iarg += 4;
       } else error->all(FLERR,"Illegal fix deform command");
 
     } else break;
@@ -226,26 +226,26 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   // no tensile deformation on shrink-wrapped dims
   // b/c shrink wrap will change box-length
 
-  if (set[0].style && 
+  if (set[0].style &&
       (domain->boundary[0][0] >= 2 || domain->boundary[0][1] >= 2))
       error->all(FLERR,"Cannot use fix deform on a shrink-wrapped boundary");
-  if (set[1].style && 
+  if (set[1].style &&
       (domain->boundary[1][0] >= 2 || domain->boundary[1][1] >= 2))
       error->all(FLERR,"Cannot use fix deform on a shrink-wrapped boundary");
-  if (set[2].style && 
+  if (set[2].style &&
       (domain->boundary[2][0] >= 2 || domain->boundary[2][1] >= 2))
       error->all(FLERR,"Cannot use fix deform on a shrink-wrapped boundary");
 
   // no tilt deformation on shrink-wrapped 2nd dim
   // b/c shrink wrap will change tilt factor in domain::reset_box()
 
-  if (set[3].style && 
+  if (set[3].style &&
       (domain->boundary[2][0] >= 2 || domain->boundary[2][1] >= 2))
     error->all(FLERR,"Cannot use fix deform tilt on a shrink-wrapped 2nd dim");
-  if (set[4].style && 
+  if (set[4].style &&
       (domain->boundary[2][0] >= 2 || domain->boundary[2][1] >= 2))
     error->all(FLERR,"Cannot use fix deform tilt on a shrink-wrapped 2nd dim");
-  if (set[4].style && 
+  if (set[4].style &&
       (domain->boundary[1][0] >= 2 || domain->boundary[1][1] >= 2))
     error->all(FLERR,"Cannot use fix deform tilt on a shrink-wrapped 2nd dim");
 
@@ -253,8 +253,8 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 
   int flag = 0;
   for (int i = 0; i < 6; i++)
-    if (set[i].style == FINAL || set[i].style == DELTA || 
-	set[i].style == VEL || set[i].style == WIGGLE) flag = 1;
+    if (set[i].style == FINAL || set[i].style == DELTA ||
+        set[i].style == VEL || set[i].style == WIGGLE) flag = 1;
 
   if (flag && scaleflag && domain->lattice == NULL)
     error->all(FLERR,"Use of fix deform with undefined lattice");
@@ -304,25 +304,25 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 
     if (set[other1].style == NONE) {
       if (set[other2].style == NONE || set[other2].style == VOLUME)
-	error->all(FLERR,"Fix deform volume setting is invalid");
+        error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = ONE_FROM_ONE;
       set[i].fixed = other1;
       set[i].dynamic1 = other2;
     } else if (set[other2].style == NONE) {
       if (set[other1].style == NONE || set[other1].style == VOLUME)
-	error->all(FLERR,"Fix deform volume setting is invalid");
+        error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = ONE_FROM_ONE;
       set[i].fixed = other2;
       set[i].dynamic1 = other1;
     } else if (set[other1].style == VOLUME) {
       if (set[other2].style == NONE || set[other2].style == VOLUME)
-	error->all(FLERR,"Fix deform volume setting is invalid");
+        error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = TWO_FROM_ONE;
       set[i].fixed = other1;
       set[i].dynamic1 = other2;
     } else if (set[other2].style == VOLUME) {
       if (set[other1].style == NONE || set[other1].style == VOLUME)
-	error->all(FLERR,"Fix deform volume setting is invalid");
+        error->all(FLERR,"Fix deform volume setting is invalid");
       set[i].substyle = TWO_FROM_ONE;
       set[i].fixed = other2;
       set[i].dynamic1 = other1;
@@ -360,7 +360,7 @@ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   nrigid = 0;
   rfix = NULL;
   flip = 0;
-  
+
   if (force_reneighbor) irregular = new Irregular(lmp);
   else irregular = NULL;
 
@@ -385,7 +385,7 @@ FixDeform::~FixDeform()
   double *h_rate = domain->h_rate;
   double *h_ratelo = domain->h_ratelo;
 
-  h_rate[0] = h_rate[1] = h_rate[2] = 
+  h_rate[0] = h_rate[1] = h_rate[2] =
     h_rate[3] = h_rate[4] = h_rate[5] = 0.0;
   h_ratelo[0] = h_ratelo[1] = h_ratelo[2] = 0.0;
 }
@@ -426,12 +426,12 @@ void FixDeform::init()
   for (int i = 0; i < 6; i++) {
     if (set[i].style != VARIABLE) continue;
     set[i].hvar = input->variable->find(set[i].hstr);
-    if (set[i].hvar < 0) 
+    if (set[i].hvar < 0)
       error->all(FLERR,"Variable name for fix deform does not exist");
     if (!input->variable->equalstyle(set[i].hvar))
       error->all(FLERR,"Variable for fix deform is invalid style");
     set[i].hratevar = input->variable->find(set[i].hratestr);
-    if (set[i].hratevar < 0) 
+    if (set[i].hratevar < 0)
       error->all(FLERR,"Variable name for fix deform does not exist");
     if (!input->variable->equalstyle(set[i].hratevar))
       error->all(FLERR,"Variable for fix deform is invalid style");
@@ -461,30 +461,30 @@ void FixDeform::init()
       set[i].lo_stop = set[i].lo_start + set[i].dlo;
       set[i].hi_stop = set[i].hi_start + set[i].dhi;
     } else if (set[i].style == SCALE) {
-      set[i].lo_stop = 0.5*(set[i].lo_start+set[i].hi_start) - 
-	0.5*set[i].scale*(set[i].hi_start-set[i].lo_start);
-      set[i].hi_stop = 0.5*(set[i].lo_start+set[i].hi_start) + 
-	0.5*set[i].scale*(set[i].hi_start-set[i].lo_start);
+      set[i].lo_stop = 0.5*(set[i].lo_start+set[i].hi_start) -
+        0.5*set[i].scale*(set[i].hi_start-set[i].lo_start);
+      set[i].hi_stop = 0.5*(set[i].lo_start+set[i].hi_start) +
+        0.5*set[i].scale*(set[i].hi_start-set[i].lo_start);
     } else if (set[i].style == VEL) {
       set[i].lo_stop = set[i].lo_start - 0.5*delt*set[i].vel;
       set[i].hi_stop = set[i].hi_start + 0.5*delt*set[i].vel;
     } else if (set[i].style == ERATE) {
-      set[i].lo_stop = set[i].lo_start - 
-	0.5*delt*set[i].rate * (set[i].hi_start-set[i].lo_start);
-      set[i].hi_stop = set[i].hi_start + 
-	0.5*delt*set[i].rate * (set[i].hi_start-set[i].lo_start);
+      set[i].lo_stop = set[i].lo_start -
+        0.5*delt*set[i].rate * (set[i].hi_start-set[i].lo_start);
+      set[i].hi_stop = set[i].hi_start +
+        0.5*delt*set[i].rate * (set[i].hi_start-set[i].lo_start);
       if (set[i].hi_stop <= set[i].lo_stop)
-	error->all(FLERR,"Final box dimension due to fix deform is < 0.0");
+        error->all(FLERR,"Final box dimension due to fix deform is < 0.0");
     } else if (set[i].style == TRATE) {
-      set[i].lo_stop = 0.5*(set[i].lo_start+set[i].hi_start) - 
-	0.5*((set[i].hi_start-set[i].lo_start) * exp(set[i].rate*delt));
-      set[i].hi_stop = 0.5*(set[i].lo_start+set[i].hi_start) + 
-	0.5*((set[i].hi_start-set[i].lo_start) * exp(set[i].rate*delt));
+      set[i].lo_stop = 0.5*(set[i].lo_start+set[i].hi_start) -
+        0.5*((set[i].hi_start-set[i].lo_start) * exp(set[i].rate*delt));
+      set[i].hi_stop = 0.5*(set[i].lo_start+set[i].hi_start) +
+        0.5*((set[i].hi_start-set[i].lo_start) * exp(set[i].rate*delt));
     } else if (set[i].style == WIGGLE) {
       set[i].lo_stop = set[i].lo_start -
-	0.5*set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
+        0.5*set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
       set[i].hi_stop = set[i].hi_start +
-	0.5*set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
+        0.5*set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
     }
   }
 
@@ -502,52 +502,52 @@ void FixDeform::init()
     } else if (set[i].style == VEL) {
       set[i].tilt_stop = set[i].tilt_start + delt*set[i].vel;
     } else if (set[i].style == ERATE) {
-      if (i == 3) set[i].tilt_stop = set[i].tilt_start + 
-		    delt*set[i].rate * (set[2].hi_start-set[2].lo_start);
-      if (i == 4) set[i].tilt_stop = set[i].tilt_start + 
-		    delt*set[i].rate * (set[2].hi_start-set[2].lo_start);
-      if (i == 5) set[i].tilt_stop = set[i].tilt_start + 
-		    delt*set[i].rate * (set[1].hi_start-set[1].lo_start);
+      if (i == 3) set[i].tilt_stop = set[i].tilt_start +
+                    delt*set[i].rate * (set[2].hi_start-set[2].lo_start);
+      if (i == 4) set[i].tilt_stop = set[i].tilt_start +
+                    delt*set[i].rate * (set[2].hi_start-set[2].lo_start);
+      if (i == 5) set[i].tilt_stop = set[i].tilt_start +
+                    delt*set[i].rate * (set[1].hi_start-set[1].lo_start);
     } else if (set[i].style == TRATE) {
       set[i].tilt_stop = set[i].tilt_start * exp(set[i].rate*delt);
     } else if (set[i].style == WIGGLE) {
       set[i].tilt_stop = set[i].tilt_start +
-	set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
+        set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
 
       // compute min/max for WIGGLE = extrema tilt factor will ever reach
 
       if (set[i].amplitude >= 0.0) {
-	if (delt < 0.25*set[i].tperiod) {
-	  set[i].tilt_min = set[i].tilt_start;
-	  set[i].tilt_max = set[i].tilt_start + 
-	    set[i].amplitude*sin(TWOPI*delt/set[i].tperiod);
-	} else if (delt < 0.5*set[i].tperiod) {
-	  set[i].tilt_min = set[i].tilt_start;
-	  set[i].tilt_max = set[i].tilt_start + set[i].amplitude;
-	} else if (delt < 0.75*set[i].tperiod) {
-	  set[i].tilt_min = set[i].tilt_start - 
-	    set[i].amplitude*sin(TWOPI*delt/set[i].tperiod);
-	  set[i].tilt_max = set[i].tilt_start + set[i].amplitude;
-	} else {
-	  set[i].tilt_min = set[i].tilt_start - set[i].amplitude;
-	  set[i].tilt_max = set[i].tilt_start + set[i].amplitude;
-	}
+        if (delt < 0.25*set[i].tperiod) {
+          set[i].tilt_min = set[i].tilt_start;
+          set[i].tilt_max = set[i].tilt_start +
+            set[i].amplitude*sin(TWOPI*delt/set[i].tperiod);
+        } else if (delt < 0.5*set[i].tperiod) {
+          set[i].tilt_min = set[i].tilt_start;
+          set[i].tilt_max = set[i].tilt_start + set[i].amplitude;
+        } else if (delt < 0.75*set[i].tperiod) {
+          set[i].tilt_min = set[i].tilt_start -
+            set[i].amplitude*sin(TWOPI*delt/set[i].tperiod);
+          set[i].tilt_max = set[i].tilt_start + set[i].amplitude;
+        } else {
+          set[i].tilt_min = set[i].tilt_start - set[i].amplitude;
+          set[i].tilt_max = set[i].tilt_start + set[i].amplitude;
+        }
       } else {
-	if (delt < 0.25*set[i].tperiod) {
-	  set[i].tilt_min = set[i].tilt_start - 
-	    set[i].amplitude*sin(TWOPI*delt/set[i].tperiod);
-	  set[i].tilt_max = set[i].tilt_start;
-	} else if (delt < 0.5*set[i].tperiod) {
-	  set[i].tilt_min = set[i].tilt_start - set[i].amplitude;
-	  set[i].tilt_max = set[i].tilt_start;
-	} else if (delt < 0.75*set[i].tperiod) {
-	  set[i].tilt_min = set[i].tilt_start - set[i].amplitude;
-	  set[i].tilt_max = set[i].tilt_start + 
-	    set[i].amplitude*sin(TWOPI*delt/set[i].tperiod);
-	} else {
-	  set[i].tilt_min = set[i].tilt_start - set[i].amplitude;
-	  set[i].tilt_max = set[i].tilt_start + set[i].amplitude;
-	}
+        if (delt < 0.25*set[i].tperiod) {
+          set[i].tilt_min = set[i].tilt_start -
+            set[i].amplitude*sin(TWOPI*delt/set[i].tperiod);
+          set[i].tilt_max = set[i].tilt_start;
+        } else if (delt < 0.5*set[i].tperiod) {
+          set[i].tilt_min = set[i].tilt_start - set[i].amplitude;
+          set[i].tilt_max = set[i].tilt_start;
+        } else if (delt < 0.75*set[i].tperiod) {
+          set[i].tilt_min = set[i].tilt_start - set[i].amplitude;
+          set[i].tilt_max = set[i].tilt_start +
+            set[i].amplitude*sin(TWOPI*delt/set[i].tperiod);
+        } else {
+          set[i].tilt_min = set[i].tilt_start - set[i].amplitude;
+          set[i].tilt_max = set[i].tilt_start + set[i].amplitude;
+        }
       }
     }
   }
@@ -576,10 +576,10 @@ void FixDeform::init()
       hi = set[3].tilt_max;
     } else lo = hi = set[3].tilt_stop;
     if (lo/(set[1].hi_start-set[1].lo_start) < -0.5 ||
-	hi/(set[1].hi_start-set[1].lo_start) > 0.5) flag = 1;
+        hi/(set[1].hi_start-set[1].lo_start) > 0.5) flag = 1;
     if (set[1].style) {
       if (lo/(set[1].hi_stop-set[1].lo_stop) < -0.5 ||
-	  hi/(set[1].hi_stop-set[1].lo_stop) > 0.5) flag = 1;
+          hi/(set[1].hi_stop-set[1].lo_stop) > 0.5) flag = 1;
     }
     if (flag) error->all(FLERR,"Fix deform is changing yz too much with xy");
   }
@@ -594,12 +594,12 @@ void FixDeform::init()
   for (int i = 0; i < 3; i++) {
     h_rate[i] = h_ratelo[i] = 0.0;
     if (set[i].style == FINAL || set[i].style == DELTA ||
-	set[i].style == SCALE || set[i].style == VEL || 
-	set[i].style == ERATE) {
+        set[i].style == SCALE || set[i].style == VEL ||
+        set[i].style == ERATE) {
       double dlo_dt,dhi_dt;
       if (delt != 0.0) {
-	dlo_dt = (set[i].lo_stop - set[i].lo_start) / delt;
-	dhi_dt = (set[i].hi_stop - set[i].hi_start) / delt;
+        dlo_dt = (set[i].lo_stop - set[i].lo_start) / delt;
+        dhi_dt = (set[i].hi_stop - set[i].hi_start) / delt;
       } else dlo_dt = dhi_dt = 0.0;
       h_rate[i] = dhi_dt - dlo_dt;
       h_ratelo[i] = dlo_dt;
@@ -608,13 +608,13 @@ void FixDeform::init()
 
   for (int i = 3; i < 6; i++) {
     h_rate[i] = 0.0;
-    if (set[i].style == FINAL || set[i].style == DELTA || 
-	set[i].style == VEL || set[i].style == ERATE) {
+    if (set[i].style == FINAL || set[i].style == DELTA ||
+        set[i].style == VEL || set[i].style == ERATE) {
       if (delt != 0.0)
-	h_rate[i] = (set[i].tilt_stop - set[i].tilt_start) / delt;
+        h_rate[i] = (set[i].tilt_stop - set[i].tilt_start) / delt;
       else h_rate[i] = 0.0;
     }
-  }    
+  }
 
   // detect if any rigid fixes exist so rigid bodies can be rescaled
   // rfix[] = indices to each fix rigid
@@ -693,20 +693,20 @@ void FixDeform::end_of_step()
       set[i].hi_target = domain->boxhi[i];
     } else if (set[i].style == TRATE) {
       double delt = (update->ntimestep - update->beginstep) * update->dt;
-      set[i].lo_target = 0.5*(set[i].lo_start+set[i].hi_start) - 
-	0.5*((set[i].hi_start-set[i].lo_start) * exp(set[i].rate*delt));
-      set[i].hi_target = 0.5*(set[i].lo_start+set[i].hi_start) + 
-	0.5*((set[i].hi_start-set[i].lo_start) * exp(set[i].rate*delt));
+      set[i].lo_target = 0.5*(set[i].lo_start+set[i].hi_start) -
+        0.5*((set[i].hi_start-set[i].lo_start) * exp(set[i].rate*delt));
+      set[i].hi_target = 0.5*(set[i].lo_start+set[i].hi_start) +
+        0.5*((set[i].hi_start-set[i].lo_start) * exp(set[i].rate*delt));
       h_rate[i] = set[i].rate * domain->h[i];
       h_ratelo[i] = -0.5*h_rate[i];
     } else if (set[i].style == WIGGLE) {
       double delt = (update->ntimestep - update->beginstep) * update->dt;
       set[i].lo_target = set[i].lo_start -
-	0.5*set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
+        0.5*set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
       set[i].hi_target = set[i].hi_start +
-	0.5*set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
-      h_rate[i] = TWOPI/set[i].tperiod * set[i].amplitude * 
-	cos(TWOPI*delt/set[i].tperiod);
+        0.5*set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
+      h_rate[i] = TWOPI/set[i].tperiod * set[i].amplitude *
+        cos(TWOPI*delt/set[i].tperiod);
       h_ratelo[i] = -0.5*h_rate[i];
     } else if (set[i].style == VARIABLE) {
       double del = input->variable->compute_equal(set[i].hvar);
@@ -715,10 +715,10 @@ void FixDeform::end_of_step()
       h_rate[i] = input->variable->compute_equal(set[i].hratevar);
       h_ratelo[i] = -0.5*h_rate[i];
     } else if (set[i].style != VOLUME) {
-      set[i].lo_target = set[i].lo_start + 
-	delta*(set[i].lo_stop - set[i].lo_start);
-      set[i].hi_target = set[i].hi_start + 
-	delta*(set[i].hi_stop - set[i].hi_start);
+      set[i].lo_target = set[i].lo_start +
+        delta*(set[i].lo_stop - set[i].lo_start);
+      set[i].hi_target = set[i].hi_start +
+        delta*(set[i].hi_stop - set[i].hi_start);
     }
   }
 
@@ -730,45 +730,45 @@ void FixDeform::end_of_step()
 
     if (set[i].substyle == ONE_FROM_ONE) {
       set[i].lo_target = 0.5*(set[i].lo_start+set[i].hi_start) -
-	0.5*(set[i].vol_start /
-	     (set[set[i].dynamic1].hi_target -
-	      set[set[i].dynamic1].lo_target) /
-	     (set[set[i].fixed].hi_start-set[set[i].fixed].lo_start));
+        0.5*(set[i].vol_start /
+             (set[set[i].dynamic1].hi_target -
+              set[set[i].dynamic1].lo_target) /
+             (set[set[i].fixed].hi_start-set[set[i].fixed].lo_start));
       set[i].hi_target = 0.5*(set[i].lo_start+set[i].hi_start) +
-	0.5*(set[i].vol_start /
-	     (set[set[i].dynamic1].hi_target -
-	      set[set[i].dynamic1].lo_target) /
-	     (set[set[i].fixed].hi_start-set[set[i].fixed].lo_start));
+        0.5*(set[i].vol_start /
+             (set[set[i].dynamic1].hi_target -
+              set[set[i].dynamic1].lo_target) /
+             (set[set[i].fixed].hi_start-set[set[i].fixed].lo_start));
 
     } else if (set[i].substyle == ONE_FROM_TWO) {
       set[i].lo_target = 0.5*(set[i].lo_start+set[i].hi_start) -
-	0.5*(set[i].vol_start /
-	     (set[set[i].dynamic1].hi_target - 
-	      set[set[i].dynamic1].lo_target) /
-	     (set[set[i].dynamic2].hi_target - 
-	      set[set[i].dynamic2].lo_target));
+        0.5*(set[i].vol_start /
+             (set[set[i].dynamic1].hi_target -
+              set[set[i].dynamic1].lo_target) /
+             (set[set[i].dynamic2].hi_target -
+              set[set[i].dynamic2].lo_target));
       set[i].hi_target = 0.5*(set[i].lo_start+set[i].hi_start) +
-	0.5*(set[i].vol_start /
-	     (set[set[i].dynamic1].hi_target -
-	      set[set[i].dynamic1].lo_target) /
-	     (set[set[i].dynamic2].hi_target - 
-	      set[set[i].dynamic2].lo_target));
-      
+        0.5*(set[i].vol_start /
+             (set[set[i].dynamic1].hi_target -
+              set[set[i].dynamic1].lo_target) /
+             (set[set[i].dynamic2].hi_target -
+              set[set[i].dynamic2].lo_target));
+
     } else if (set[i].substyle == TWO_FROM_ONE) {
       set[i].lo_target = 0.5*(set[i].lo_start+set[i].hi_start) -
-	0.5*sqrt(set[i].vol_start /
-		 (set[set[i].dynamic1].hi_target - 
-		  set[set[i].dynamic1].lo_target) /
-		 (set[set[i].fixed].hi_start - 
-		  set[set[i].fixed].lo_start) *
-		 (set[i].hi_start - set[i].lo_start));
+        0.5*sqrt(set[i].vol_start /
+                 (set[set[i].dynamic1].hi_target -
+                  set[set[i].dynamic1].lo_target) /
+                 (set[set[i].fixed].hi_start -
+                  set[set[i].fixed].lo_start) *
+                 (set[i].hi_start - set[i].lo_start));
       set[i].hi_target = 0.5*(set[i].lo_start+set[i].hi_start) +
-	0.5*sqrt(set[i].vol_start /
-		 (set[set[i].dynamic1].hi_target - 
-		  set[set[i].dynamic1].lo_target) /
-		 (set[set[i].fixed].hi_start - 
-		  set[set[i].fixed].lo_start) *
-		 (set[i].hi_start - set[i].lo_start));
+        0.5*sqrt(set[i].vol_start /
+                 (set[set[i].dynamic1].hi_target -
+                  set[set[i].dynamic1].lo_target) /
+                 (set[set[i].fixed].hi_start -
+                  set[set[i].fixed].lo_start) *
+                 (set[i].hi_start - set[i].lo_start));
     }
   }
 
@@ -784,26 +784,26 @@ void FixDeform::end_of_step()
 
     for (i = 3; i < 6; i++) {
       if (set[i].style == NONE) {
-	if (i == 5) set[i].tilt_target = domain->xy;
-	else if (i == 4) set[i].tilt_target = domain->xz;
-	else if (i == 3) set[i].tilt_target = domain->yz;
+        if (i == 5) set[i].tilt_target = domain->xy;
+        else if (i == 4) set[i].tilt_target = domain->xz;
+        else if (i == 3) set[i].tilt_target = domain->yz;
       } else if (set[i].style == TRATE) {
-	double delt = (update->ntimestep - update->beginstep) * update->dt;
-	set[i].tilt_target = set[i].tilt_start * exp(set[i].rate*delt);
-	h_rate[i] = set[i].rate * domain->h[i];
+        double delt = (update->ntimestep - update->beginstep) * update->dt;
+        set[i].tilt_target = set[i].tilt_start * exp(set[i].rate*delt);
+        h_rate[i] = set[i].rate * domain->h[i];
       } else if (set[i].style == WIGGLE) {
-	double delt = (update->ntimestep - update->beginstep) * update->dt;
-	set[i].tilt_target = set[i].tilt_start +
-	  set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
-	h_rate[i] = TWOPI/set[i].tperiod * set[i].amplitude * 
-	  cos(TWOPI*delt/set[i].tperiod);
+        double delt = (update->ntimestep - update->beginstep) * update->dt;
+        set[i].tilt_target = set[i].tilt_start +
+          set[i].amplitude * sin(TWOPI*delt/set[i].tperiod);
+        h_rate[i] = TWOPI/set[i].tperiod * set[i].amplitude *
+          cos(TWOPI*delt/set[i].tperiod);
       } else if (set[i].style == VARIABLE) {
-	double delta_tilt = input->variable->compute_equal(set[i].hvar);
-	set[i].tilt_target = set[i].tilt_start + delta_tilt;
-	h_rate[i] = input->variable->compute_equal(set[i].hratevar);
+        double delta_tilt = input->variable->compute_equal(set[i].hvar);
+        set[i].tilt_target = set[i].tilt_start + delta_tilt;
+        h_rate[i] = input->variable->compute_equal(set[i].hratevar);
       } else {
-	set[i].tilt_target = set[i].tilt_start + 
-	  delta*(set[i].tilt_stop - set[i].tilt_start);
+        set[i].tilt_target = set[i].tilt_start +
+          delta*(set[i].tilt_stop - set[i].tilt_start);
       }
 
       // tilt_target can be large positive or large negative value
@@ -818,12 +818,12 @@ void FixDeform::end_of_step()
       double current = h[i]/h[idenom];
 
       while (set[i].tilt_target/denom - current > 0.0)
-	set[i].tilt_target -= denom;
+        set[i].tilt_target -= denom;
       while (set[i].tilt_target/denom - current < 0.0)
-	set[i].tilt_target += denom;
-      if (fabs(set[i].tilt_target/denom - 1.0 - current) < 
-	  fabs(set[i].tilt_target/denom - current))
-	set[i].tilt_target -= denom;
+        set[i].tilt_target += denom;
+      if (fabs(set[i].tilt_target/denom - 1.0 - current) <
+          fabs(set[i].tilt_target/denom - current))
+        set[i].tilt_target -= denom;
     }
   }
 
@@ -843,46 +843,46 @@ void FixDeform::end_of_step()
     double yprd = set[1].hi_target - set[1].lo_target;
     double xprdinv = 1.0 / xprd;
     double yprdinv = 1.0 / yprd;
-    if (set[3].tilt_target*yprdinv < -0.5 || 
-				     set[3].tilt_target*yprdinv > 0.5 ||
-	set[4].tilt_target*xprdinv < -0.5 || 
-				     set[4].tilt_target*xprdinv > 0.5 ||
-	set[5].tilt_target*xprdinv < -0.5 || 
-				     set[5].tilt_target*xprdinv > 0.5) {
+    if (set[3].tilt_target*yprdinv < -0.5 ||
+                                     set[3].tilt_target*yprdinv > 0.5 ||
+        set[4].tilt_target*xprdinv < -0.5 ||
+                                     set[4].tilt_target*xprdinv > 0.5 ||
+        set[5].tilt_target*xprdinv < -0.5 ||
+                                     set[5].tilt_target*xprdinv > 0.5) {
       set[3].tilt_flip = set[3].tilt_target;
       set[4].tilt_flip = set[4].tilt_target;
       set[5].tilt_flip = set[5].tilt_target;
-      
+
       flipxy = flipxz = flipyz = 0;
 
       if (domain->yperiodic) {
-	if (set[3].tilt_flip*yprdinv < -0.5) {
-	  set[3].tilt_flip += yprd;
-	  set[4].tilt_flip += set[5].tilt_flip;
-	  flipyz = 1;
-	} else if (set[3].tilt_flip*yprdinv > 0.5) {
-	  set[3].tilt_flip -= yprd;
-	  set[4].tilt_flip -= set[5].tilt_flip;
-	  flipyz = -1;
-	}
+        if (set[3].tilt_flip*yprdinv < -0.5) {
+          set[3].tilt_flip += yprd;
+          set[4].tilt_flip += set[5].tilt_flip;
+          flipyz = 1;
+        } else if (set[3].tilt_flip*yprdinv > 0.5) {
+          set[3].tilt_flip -= yprd;
+          set[4].tilt_flip -= set[5].tilt_flip;
+          flipyz = -1;
+        }
       }
       if (domain->xperiodic) {
-	if (set[4].tilt_flip*xprdinv < -0.5) {
-	  set[4].tilt_flip += xprd;
-	  flipxz = 1;
-	}
-	if (set[4].tilt_flip*xprdinv > 0.5) {
-	  set[4].tilt_flip -= xprd;
-	  flipxz = -1;
-	}
-	if (set[5].tilt_flip*xprdinv < -0.5) {
-	  set[5].tilt_flip += xprd;
-	  flipxy = 1;
-	}
-	if (set[5].tilt_flip*xprdinv > 0.5) {
-	  set[5].tilt_flip -= xprd;
-	  flipxy = -1;
-	}
+        if (set[4].tilt_flip*xprdinv < -0.5) {
+          set[4].tilt_flip += xprd;
+          flipxz = 1;
+        }
+        if (set[4].tilt_flip*xprdinv > 0.5) {
+          set[4].tilt_flip -= xprd;
+          flipxz = -1;
+        }
+        if (set[5].tilt_flip*xprdinv < -0.5) {
+          set[5].tilt_flip += xprd;
+          flipxy = 1;
+        }
+        if (set[5].tilt_flip*xprdinv > 0.5) {
+          set[5].tilt_flip -= xprd;
+          flipxy = -1;
+        }
       }
 
       flip = 0;
@@ -900,11 +900,11 @@ void FixDeform::end_of_step()
 
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	domain->x2lamda(x[i],x[i]);
+        domain->x2lamda(x[i],x[i]);
 
     if (nrigid)
       for (i = 0; i < nrigid; i++)
-	modify->fix[rfix[i]]->deform(0);
+        modify->fix[rfix[i]]->deform(0);
   }
 
   // reset global and local box to new size/shape
@@ -940,11 +940,11 @@ void FixDeform::end_of_step()
 
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	domain->lamda2x(x[i],x[i]);
+        domain->lamda2x(x[i],x[i]);
 
     if (nrigid)
       for (i = 0; i < nrigid; i++)
-	modify->fix[rfix[i]]->deform(1);
+        modify->fix[rfix[i]]->deform(1);
   }
 
   // redo KSpace coeffs since box has changed
diff --git a/src/fix_deform.h b/src/fix_deform.h
index 33a86b375b..d4ee95be97 100644
--- a/src/fix_deform.h
+++ b/src/fix_deform.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_deposit.cpp b/src/fix_deposit.cpp
index b3f403a8d4..106b293d42 100644
--- a/src/fix_deposit.cpp
+++ b/src/fix_deposit.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -84,14 +84,14 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
   zhi = domain->regions[iregion]->extent_zhi;
 
   if (domain->triclinic == 0) {
-    if (xlo < domain->boxlo[0] || xhi > domain->boxhi[0] || 
-	ylo < domain->boxlo[1] || yhi > domain->boxhi[1] || 
-	zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
+    if (xlo < domain->boxlo[0] || xhi > domain->boxhi[0] ||
+        ylo < domain->boxlo[1] || yhi > domain->boxhi[1] ||
+        zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
       error->all(FLERR,"Deposition region extends outside simulation box");
   } else {
-    if (xlo < domain->boxlo_bound[0] || xhi > domain->boxhi_bound[0] || 
-	ylo < domain->boxlo_bound[1] || yhi > domain->boxhi_bound[1] || 
-	zlo < domain->boxlo_bound[2] || zhi > domain->boxhi_bound[2])
+    if (xlo < domain->boxlo_bound[0] || xhi > domain->boxhi_bound[0] ||
+        ylo < domain->boxlo_bound[1] || yhi > domain->boxhi_bound[1] ||
+        zlo < domain->boxlo_bound[2] || zhi > domain->boxhi_bound[2])
       error->all(FLERR,"Deposition region extends outside simulation box");
   }
 
@@ -167,7 +167,7 @@ void FixDeposit::init()
   // set index and check validity of region
 
   iregion = domain->find_region(idregion);
-  if (iregion == -1) 
+  if (iregion == -1)
     error->all(FLERR,"Region ID for fix deposit does not exist");
 }
 
@@ -235,34 +235,34 @@ void FixDeposit::pre_exchange()
       double max,maxall,delx,dely,delz,rsq;
 
       if (domain->dimension == 2) {
-	dim = 1;
-	max = domain->boxlo[1];
+        dim = 1;
+        max = domain->boxlo[1];
       } else {
-	dim = 2;
-	max = domain->boxlo[2];
+        dim = 2;
+        max = domain->boxlo[2];
       }
 
       double **x = atom->x;
       int nlocal = atom->nlocal;
       for (i = 0; i < nlocal; i++) {
-	if (localflag) {
-	  delx = coord[0] - x[i][0];
-	  dely = coord[1] - x[i][1];
-	  delz = 0.0;
-	  domain->minimum_image(delx,dely,delz);
-	  if (domain->dimension == 2) rsq = delx*delx;
-	  else rsq = delx*delx + dely*dely;
-	  if (rsq > deltasq) continue;
-	}
-	if (x[i][dim] > max) max = x[i][dim];
+        if (localflag) {
+          delx = coord[0] - x[i][0];
+          dely = coord[1] - x[i][1];
+          delz = 0.0;
+          domain->minimum_image(delx,dely,delz);
+          if (domain->dimension == 2) rsq = delx*delx;
+          else rsq = delx*delx + dely*dely;
+          if (rsq > deltasq) continue;
+        }
+        if (x[i][dim] > max) max = x[i][dim];
       }
 
       MPI_Allreduce(&max,&maxall,1,MPI_DOUBLE,MPI_MAX,world);
       if (domain->dimension == 2)
-	coord[1] = maxall + lo + random->uniform()*(hi-lo);
+        coord[1] = maxall + lo + random->uniform()*(hi-lo);
       else
-	coord[2] = maxall + lo + random->uniform()*(hi-lo);
-    }      
+        coord[2] = maxall + lo + random->uniform()*(hi-lo);
+    }
 
     // now have final coord
     // if distance to any atom is less than near, try again
@@ -297,10 +297,10 @@ void FixDeposit::pre_exchange()
       delz = tz - coord[2];
       double rsq = delx*delx + dely*dely + delz*delz;
       if (rsq > 0.0) {
-	double rinv = sqrt(1.0/rsq);
-	vxtmp = delx*rinv*vel;
-	vytmp = dely*rinv*vel;
-	vztmp = delz*rinv*vel;
+        double rinv = sqrt(1.0/rsq);
+        vxtmp = delx*rinv*vel;
+        vytmp = dely*rinv*vel;
+        vztmp = delz*rinv*vel;
       }
     }
 
@@ -308,7 +308,7 @@ void FixDeposit::pre_exchange()
     // if so, add to my list via create_atom()
     // initialize info about the atoms
     // set group mask to "all" plus fix group
-    
+
     if (domain->triclinic) {
       domain->x2lamda(coord,lamda);
       newcoord = lamda;
@@ -316,15 +316,15 @@ void FixDeposit::pre_exchange()
 
     flag = 0;
     if (newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] &&
-	newcoord[1] >= sublo[1] && newcoord[1] < subhi[1] &&
-	newcoord[2] >= sublo[2] && newcoord[2] < subhi[2]) flag = 1;
+        newcoord[1] >= sublo[1] && newcoord[1] < subhi[1] &&
+        newcoord[2] >= sublo[2] && newcoord[2] < subhi[2]) flag = 1;
     else if (domain->dimension == 3 && newcoord[2] >= domain->boxhi[2] &&
-	     comm->myloc[2] == comm->procgrid[2]-1 &&
-	     newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] &&
-	     newcoord[1] >= sublo[1] && newcoord[1] < subhi[1]) flag = 1;
+             comm->myloc[2] == comm->procgrid[2]-1 &&
+             newcoord[0] >= sublo[0] && newcoord[0] < subhi[0] &&
+             newcoord[1] >= sublo[1] && newcoord[1] < subhi[1]) flag = 1;
     else if (domain->dimension == 2 && newcoord[1] >= domain->boxhi[1] &&
-	     comm->myloc[1] == comm->procgrid[1]-1 &&
-	     newcoord[0] >= sublo[0] && newcoord[0] < subhi[0]) flag = 1;
+             comm->myloc[1] == comm->procgrid[1]-1 &&
+             newcoord[0] >= sublo[0] && newcoord[0] < subhi[0]) flag = 1;
 
     if (flag) {
       atom->avec->create_atom(ntype,coord);
@@ -335,7 +335,7 @@ void FixDeposit::pre_exchange()
       atom->v[m][1] = vytmp;
       atom->v[m][2] = vztmp;
       for (j = 0; j < nfix; j++)
-	if (fix[j]->create_attribute) fix[j]->set_arrays(m);
+        if (fix[j]->create_attribute) fix[j]->set_arrays(m);
     }
     MPI_Allreduce(&flag,&success,1,MPI_INT,MPI_MAX,world);
     break;
@@ -356,9 +356,9 @@ void FixDeposit::pre_exchange()
     if (atom->tag_enable) {
       atom->tag_extend();
       if (atom->map_style) {
-	atom->nghost = 0;
-	atom->map_init();
-	atom->map_set();
+        atom->nghost = 0;
+        atom->map_init();
+        atom->map_set();
       }
     }
   }
@@ -372,7 +372,7 @@ void FixDeposit::pre_exchange()
 }
 
 /* ----------------------------------------------------------------------
-   parse optional parameters at end of input line 
+   parse optional parameters at end of input line
 ------------------------------------------------------------------------- */
 
 void FixDeposit::options(int narg, char **arg)
@@ -385,7 +385,7 @@ void FixDeposit::options(int narg, char **arg)
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command");
       iregion = domain->find_region(arg[iarg+1]);
       if (iregion == -1)
-	error->all(FLERR,"Region ID for fix deposit does not exist");
+        error->all(FLERR,"Region ID for fix deposit does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
@@ -451,7 +451,7 @@ void FixDeposit::options(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   pack entire state of Fix into one write 
+   pack entire state of Fix into one write
 ------------------------------------------------------------------------- */
 
 void FixDeposit::write_restart(FILE *fp)
@@ -471,7 +471,7 @@ void FixDeposit::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix 
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixDeposit::restart(char *buf)
diff --git a/src/fix_deposit.h b/src/fix_deposit.h
index 0b1f4b8028..b379d4db49 100644
--- a/src/fix_deposit.h
+++ b/src/fix_deposit.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_drag.cpp b/src/fix_drag.cpp
index 30c886ae71..0abdf0d3d2 100644
--- a/src/fix_drag.cpp
+++ b/src/fix_drag.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -97,7 +97,7 @@ void FixDrag::post_force(int vflag)
 
   ftotal[0] = ftotal[1] = ftotal[2] = 0.0;
   force_flag = 0;
-  
+
   double dx,dy,dz,r,prefactor,fx,fy,fz;
 
   for (int i = 0; i < nlocal; i++)
@@ -111,16 +111,16 @@ void FixDrag::post_force(int vflag)
       domain->minimum_image(dx,dy,dz);
       r = sqrt(dx*dx + dy*dy + dz*dz);
       if (r > delta) {
-	prefactor = f_mag/r;
-	fx = prefactor*dx;
-	fy = prefactor*dy;
-	fz = prefactor*dz;
-	f[i][0] -= fx;
-	f[i][1] -= fy;
-	f[i][2] -= fz;
-	ftotal[0] -= fx;
-	ftotal[1] -= fy;
-	ftotal[2] -= fz;
+        prefactor = f_mag/r;
+        fx = prefactor*dx;
+        fy = prefactor*dy;
+        fz = prefactor*dz;
+        f[i][0] -= fx;
+        f[i][1] -= fy;
+        f[i][2] -= fz;
+        ftotal[0] -= fx;
+        ftotal[1] -= fy;
+        ftotal[2] -= fz;
       }
     }
 }
diff --git a/src/fix_drag.h b/src/fix_drag.h
index 49df06e9bb..e6b05d8039 100644
--- a/src/fix_drag.h
+++ b/src/fix_drag.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_dt_reset.cpp b/src/fix_dt_reset.cpp
index b0a95a6100..60e9e0b449 100644
--- a/src/fix_dt_reset.cpp
+++ b/src/fix_dt_reset.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -43,7 +43,7 @@ FixDtReset::FixDtReset(LAMMPS *lmp, int narg, char **arg) :
 
   // set time_depend, else elapsed time accumulation can be messed up
 
-  time_depend = 1;   
+  time_depend = 1;
   scalar_flag = 1;
   vector_flag = 1;
   size_vector = 2;
@@ -116,9 +116,9 @@ void FixDtReset::init()
 
   for (int i = 0; i < output->ndump; i++)
     if ((strcmp(output->dump[i]->style,"dcd") == 0 ||
-	strcmp(output->dump[i]->style,"xtc") == 0) && comm->me == 0)
+        strcmp(output->dump[i]->style,"xtc") == 0) && comm->me == 0)
       error->warning(FLERR,
-		     "Dump dcd/xtc timestamp may be wrong with fix dt/reset");
+                     "Dump dcd/xtc timestamp may be wrong with fix dt/reset");
 
   ftm2v = force->ftm2v;
   dt = update->dt;
@@ -183,7 +183,7 @@ void FixDtReset::end_of_step()
 
   if (minbound) dt = MAX(dt,tmin);
   if (maxbound) dt = MIN(dt,tmax);
-  
+
   // if timestep didn't change, just return
   // else reset update->dt and other classes that depend on it
   // rRESPA, pair style, fixes
diff --git a/src/fix_dt_reset.h b/src/fix_dt_reset.h
index 5198afa820..4679163291 100644
--- a/src/fix_dt_reset.h
+++ b/src/fix_dt_reset.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_efield.cpp b/src/fix_efield.cpp
index ac953950f1..d6e7158528 100644
--- a/src/fix_efield.cpp
+++ b/src/fix_efield.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -106,7 +106,7 @@ void FixEfield::init()
   if (xstr) {
     xvar = input->variable->find(xstr);
     if (xvar < 0) error->all(FLERR,
-			     "Variable name for fix efield does not exist");
+                             "Variable name for fix efield does not exist");
     if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
     else if (input->variable->atomstyle(xvar)) xstyle = ATOM;
     else error->all(FLERR,"Variable for fix efield is invalid style");
@@ -114,7 +114,7 @@ void FixEfield::init()
   if (ystr) {
     yvar = input->variable->find(ystr);
     if (yvar < 0) error->all(FLERR,
-			     "Variable name for fix efield does not exist");
+                             "Variable name for fix efield does not exist");
     if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
     else if (input->variable->atomstyle(yvar)) ystyle = ATOM;
     else error->all(FLERR,"Variable for fix efield is invalid style");
@@ -122,7 +122,7 @@ void FixEfield::init()
   if (zstr) {
     zvar = input->variable->find(zstr);
     if (zvar < 0) error->all(FLERR,
-			     "Variable name for fix efield does not exist");
+                             "Variable name for fix efield does not exist");
     if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
     else if (input->variable->atomstyle(zvar)) zstyle = ATOM;
     else error->all(FLERR,"Variable for fix efield is invalid style");
@@ -173,9 +173,9 @@ void FixEfield::post_force(int vflag)
   if (varflag == CONSTANT) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	f[i][0] += q[i]*ex;
-	f[i][1] += q[i]*ey;
-	f[i][2] += q[i]*ez;
+        f[i][0] += q[i]*ex;
+        f[i][1] += q[i]*ey;
+        f[i][2] += q[i]*ez;
       }
 
   // variable efield, wrap with clear/add
@@ -198,12 +198,12 @@ void FixEfield::post_force(int vflag)
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (xstyle == ATOM) f[i][0] += qe2f * q[i]*efield[i][0];
-	else f[i][0] += q[i]*ex;
-	if (ystyle == ATOM) f[i][1] += qe2f * q[i]*efield[i][1];
-	else f[i][1] += q[i]*ey;
-	if (zstyle == ATOM) f[i][2] += qe2f * q[i]*efield[i][2];
-	else f[i][2] += q[i]*ez;
+        if (xstyle == ATOM) f[i][0] += qe2f * q[i]*efield[i][0];
+        else f[i][0] += q[i]*ex;
+        if (ystyle == ATOM) f[i][1] += qe2f * q[i]*efield[i][1];
+        else f[i][1] += q[i]*ey;
+        if (zstyle == ATOM) f[i][2] += qe2f * q[i]*efield[i][2];
+        else f[i][2] += q[i]*ez;
       }
   }
 }
diff --git a/src/fix_efield.h b/src/fix_efield.h
index ba70cbae54..dabda61b41 100644
--- a/src/fix_efield.h
+++ b/src/fix_efield.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_enforce2d.cpp b/src/fix_enforce2d.cpp
index d6f02b0188..ed169d36e5 100644
--- a/src/fix_enforce2d.cpp
+++ b/src/fix_enforce2d.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -94,8 +94,8 @@ void FixEnforce2D::post_force(int vflag)
     double **omega = atom->omega;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	omega[i][0] = 0.0;
-	omega[i][1] = 0.0;
+        omega[i][0] = 0.0;
+        omega[i][1] = 0.0;
       }
   }
 
@@ -103,8 +103,8 @@ void FixEnforce2D::post_force(int vflag)
     double **angmom = atom->angmom;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	angmom[i][0] = 0.0;
-	angmom[i][1] = 0.0;
+        angmom[i][0] = 0.0;
+        angmom[i][1] = 0.0;
       }
   }
 
@@ -112,8 +112,8 @@ void FixEnforce2D::post_force(int vflag)
     double **torque = atom->torque;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	torque[i][0] = 0.0;
-	torque[i][1] = 0.0;
+        torque[i][0] = 0.0;
+        torque[i][1] = 0.0;
       }
   }
 }
diff --git a/src/fix_enforce2d.h b/src/fix_enforce2d.h
index d1df796dfc..f3f56dbb92 100644
--- a/src/fix_enforce2d.h
+++ b/src/fix_enforce2d.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_evaporate.cpp b/src/fix_evaporate.cpp
index eee0418b84..7eb5093d3f 100644
--- a/src/fix_evaporate.cpp
+++ b/src/fix_evaporate.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -143,17 +143,17 @@ void FixEvaporate::init()
     int flag = 0;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	if (molecule[i]) flag = 1;
+        if (molecule[i]) flag = 1;
     int flagall;
     MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
     if (flagall && comm->me == 0)
       error->warning(FLERR,
-		     "Fix evaporate may delete atom with non-zero molecule ID");
+                     "Fix evaporate may delete atom with non-zero molecule ID");
   }
 
   if (molflag && atom->molecule_flag == 0)
       error->all(FLERR,
-		 "Fix evaporate molecule requires atom attribute molecule");
+                 "Fix evaporate molecule requires atom attribute molecule");
 }
 
 /* ----------------------------------------------------------------------
@@ -193,7 +193,7 @@ void FixEvaporate::pre_exchange()
   for (i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
-	list[ncount++] = i;
+        list[ncount++] = i;
 
   int nall,nbefore;
   MPI_Allreduce(&ncount,&nall,1,MPI_INT,MPI_SUM,world);
@@ -217,10 +217,10 @@ void FixEvaporate::pre_exchange()
       iwhichglobal = static_cast<int> (nall*random->uniform());
       if (iwhichglobal < nbefore) nbefore--;
       else if (iwhichglobal < nbefore + ncount) {
-	iwhichlocal = iwhichglobal - nbefore;
-	mark[list[iwhichlocal]] = 1;
-	list[iwhichlocal] = list[ncount-1];
-	ncount--;
+        iwhichlocal = iwhichglobal - nbefore;
+        mark[list[iwhichlocal]] = 1;
+        list[iwhichlocal] = list[ncount-1];
+        ncount--;
       }
       ndel++;
       nall--;
@@ -245,10 +245,10 @@ void FixEvaporate::pre_exchange()
 
       iwhichglobal = static_cast<int> (nall*random->uniform());
       if (iwhichglobal >= nbefore && iwhichglobal < nbefore + ncount) {
-	iwhichlocal = iwhichglobal - nbefore;
-	iatom = list[iwhichlocal];
-	imolecule = molecule[iatom];
-	me = comm->me;
+        iwhichlocal = iwhichglobal - nbefore;
+        iatom = list[iwhichlocal];
+        imolecule = molecule[iatom];
+        me = comm->me;
       } else me = -1;
 
       // bcast mol ID to delete all atoms from
@@ -260,60 +260,60 @@ void FixEvaporate::pre_exchange()
       MPI_Bcast(&imolecule,1,MPI_INT,proc,world);
       ndelone = 0;
       for (i = 0; i < nlocal; i++) {
-	if (imolecule && molecule[i] == imolecule) {
-	  mark[i] = 1;
-	  ndelone++;
-
-	  if (atom->avec->bonds_allow) {
-	    if (force->newton_bond) ndeltopo[0] += atom->num_bond[i];
-	    else {
-	      for (j = 0; j < atom->num_bond[i]; j++) {
-		if (tag[i] < atom->bond_atom[i][j]) ndeltopo[0]++;
-	      }
-	    }
-	  }
-	  if (atom->avec->angles_allow) {
-	    if (force->newton_bond) ndeltopo[1] += atom->num_angle[i];
-	    else {
-	      for (j = 0; j < atom->num_angle[i]; j++) {
-		m = atom->map(atom->angle_atom2[i][j]);
-		if (m >= 0 && m < nlocal) ndeltopo[1]++;
-	      }
-	    }
-	  }
-	  if (atom->avec->dihedrals_allow) {
-	    if (force->newton_bond) ndeltopo[2] += atom->num_dihedral[i];
-	    else {
-	      for (j = 0; j < atom->num_dihedral[i]; j++) {
-		m = atom->map(atom->dihedral_atom2[i][j]);
-		if (m >= 0 && m < nlocal) ndeltopo[2]++;
-	      }
-	    }
-	  }
-	  if (atom->avec->impropers_allow) {
-	    if (force->newton_bond) ndeltopo[3] += atom->num_improper[i];
-	    else {
-	      for (j = 0; j < atom->num_improper[i]; j++) {
-		m = atom->map(atom->improper_atom2[i][j]);
-		if (m >= 0 && m < nlocal) ndeltopo[3]++;
-	      }
-	    }
-	  }
-
-	} else if (me == proc && i == iatom) {
-	  mark[i] = 1;
-	  ndelone++;
-	}
+        if (imolecule && molecule[i] == imolecule) {
+          mark[i] = 1;
+          ndelone++;
+
+          if (atom->avec->bonds_allow) {
+            if (force->newton_bond) ndeltopo[0] += atom->num_bond[i];
+            else {
+              for (j = 0; j < atom->num_bond[i]; j++) {
+                if (tag[i] < atom->bond_atom[i][j]) ndeltopo[0]++;
+              }
+            }
+          }
+          if (atom->avec->angles_allow) {
+            if (force->newton_bond) ndeltopo[1] += atom->num_angle[i];
+            else {
+              for (j = 0; j < atom->num_angle[i]; j++) {
+                m = atom->map(atom->angle_atom2[i][j]);
+                if (m >= 0 && m < nlocal) ndeltopo[1]++;
+              }
+            }
+          }
+          if (atom->avec->dihedrals_allow) {
+            if (force->newton_bond) ndeltopo[2] += atom->num_dihedral[i];
+            else {
+              for (j = 0; j < atom->num_dihedral[i]; j++) {
+                m = atom->map(atom->dihedral_atom2[i][j]);
+                if (m >= 0 && m < nlocal) ndeltopo[2]++;
+              }
+            }
+          }
+          if (atom->avec->impropers_allow) {
+            if (force->newton_bond) ndeltopo[3] += atom->num_improper[i];
+            else {
+              for (j = 0; j < atom->num_improper[i]; j++) {
+                m = atom->map(atom->improper_atom2[i][j]);
+                if (m >= 0 && m < nlocal) ndeltopo[3]++;
+              }
+            }
+          }
+
+        } else if (me == proc && i == iatom) {
+          mark[i] = 1;
+          ndelone++;
+        }
       }
 
       // remove any atoms marked for deletion from my eligible list
 
       i = 0;
       while (i < ncount) {
-	if (mark[list[i]]) {
-	  list[i] = list[ncount-1];
-	  ncount--;
-	} else i++;
+        if (mark[list[i]]) {
+          list[i] = list[ncount-1];
+          ncount--;
+        } else i++;
       }
 
       // update ndel,ncount,nall,nbefore
@@ -330,9 +330,9 @@ void FixEvaporate::pre_exchange()
 
   // delete my marked atoms
   // loop in reverse order to avoid copying marked atoms
-  
+
   AtomVec *avec = atom->avec;
-  
+
   for (i = nlocal-1; i >= 0; i--) {
     if (mark[i]) {
       avec->copy(atom->nlocal-1,i,1);
@@ -361,7 +361,7 @@ void FixEvaporate::pre_exchange()
   }
 
   // statistics
-  
+
   ndeleted += ndel;
   next_reneighbor = update->ntimestep + nevery;
 }
diff --git a/src/fix_evaporate.h b/src/fix_evaporate.h
index 065e92d702..f59558103a 100644
--- a/src/fix_evaporate.h
+++ b/src/fix_evaporate.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_external.cpp b/src/fix_external.cpp
index 85cd2f6505..0e787d078d 100644
--- a/src/fix_external.cpp
+++ b/src/fix_external.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -56,7 +56,7 @@ int FixExternal::setmask()
 
 void FixExternal::init()
 {
-  if (callback == NULL) 
+  if (callback == NULL)
     error->all(FLERR,"Fix external callback function not set");
 }
 
@@ -88,7 +88,7 @@ void FixExternal::post_force(int vflag)
   // it will fill fexternal with forces
 
   (this->callback)(ptr_caller,update->ntimestep,
-		   atom->nlocal,atom->tag,atom->x,fexternal);
+                   atom->nlocal,atom->tag,atom->x,fexternal);
 
   // add forces from fexternal to atoms in group
 
diff --git a/src/fix_external.h b/src/fix_external.h
index 8cd798a72f..8dce882216 100644
--- a/src/fix_external.h
+++ b/src/fix_external.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp
index f03ded78c7..bc72f5b113 100644
--- a/src/fix_gravity.cpp
+++ b/src/fix_gravity.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -167,57 +167,57 @@ void FixGravity::init()
 
   if (mstr) {
     mvar = input->variable->find(mstr);
-    if (mvar < 0) 
+    if (mvar < 0)
       error->all(FLERR,"Variable name for fix gravity does not exist");
     if (!input->variable->equalstyle(mvar))
       error->all(FLERR,"Variable for fix gravity is invalid style");
   }
   if (vstr) {
     vvar = input->variable->find(vstr);
-    if (vvar < 0) 
+    if (vvar < 0)
       error->all(FLERR,"Variable name for fix gravity does not exist");
     if (!input->variable->equalstyle(vvar))
       error->all(FLERR,"Variable for fix gravity is invalid style");
   }
   if (pstr) {
     pvar = input->variable->find(pstr);
-    if (pvar < 0) 
+    if (pvar < 0)
       error->all(FLERR,"Variable name for fix gravity does not exist");
     if (!input->variable->equalstyle(pvar))
       error->all(FLERR,"Variable for fix gravity is invalid style");
   }
   if (tstr) {
     tvar = input->variable->find(tstr);
-    if (tvar < 0) 
+    if (tvar < 0)
       error->all(FLERR,"Variable name for fix gravity does not exist");
     if (!input->variable->equalstyle(tvar))
       error->all(FLERR,"Variable for fix gravity is invalid style");
   }
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) 
+    if (xvar < 0)
       error->all(FLERR,"Variable name for fix gravity does not exist");
     if (!input->variable->equalstyle(xvar))
       error->all(FLERR,"Variable for fix gravity is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) 
+    if (yvar < 0)
       error->all(FLERR,"Variable name for fix gravity does not exist");
     if (!input->variable->equalstyle(yvar))
       error->all(FLERR,"Variable for fix gravity is invalid style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) 
+    if (zvar < 0)
       error->all(FLERR,"Variable name for fix gravity does not exist");
     if (!input->variable->equalstyle(zvar))
       error->all(FLERR,"Variable for fix gravity is invalid style");
   }
 
   varflag = CONSTANT;
-  if (mstyle != CONSTANT || vstyle != CONSTANT || pstyle != CONSTANT || 
-      tstyle != CONSTANT || xstyle != CONSTANT || ystyle != CONSTANT || 
+  if (mstyle != CONSTANT || vstyle != CONSTANT || pstyle != CONSTANT ||
+      tstyle != CONSTANT || xstyle != CONSTANT || ystyle != CONSTANT ||
       zstyle != CONSTANT) varflag = EQUAL;
 
   // set gravity components once and for all
@@ -273,20 +273,20 @@ void FixGravity::post_force(int vflag)
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	massone = rmass[i];
-	f[i][0] += massone*xacc;
-	f[i][1] += massone*yacc;
-	f[i][2] += massone*zacc;
-	egrav -= massone * (xacc*x[i][0] + yacc*x[i][1] + zacc*x[i][2]);
+        massone = rmass[i];
+        f[i][0] += massone*xacc;
+        f[i][1] += massone*yacc;
+        f[i][2] += massone*zacc;
+        egrav -= massone * (xacc*x[i][0] + yacc*x[i][1] + zacc*x[i][2]);
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	massone = mass[type[i]];
-	f[i][0] += massone*xacc;
-	f[i][1] += massone*yacc;
-	f[i][2] += massone*zacc;
-	egrav -= massone * (xacc*x[i][0] + yacc*x[i][1] + zacc*x[i][2]);
+        massone = mass[type[i]];
+        f[i][0] += massone*xacc;
+        f[i][1] += massone*yacc;
+        f[i][2] += massone*zacc;
+        egrav -= massone * (xacc*x[i][0] + yacc*x[i][1] + zacc*x[i][2]);
       }
   }
 }
diff --git a/src/fix_gravity.h b/src/fix_gravity.h
index 410f044093..fedab3b14b 100644
--- a/src/fix_gravity.h
+++ b/src/fix_gravity.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp
index 275b306eb0..52ec746b20 100644
--- a/src/fix_heat.cpp
+++ b/src/fix_heat.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -55,8 +55,8 @@ FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
     if (strcmp(arg[iarg],"region") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix heat command");
       iregion = domain->find_region(arg[iarg+1]);
-      if (iregion == -1) 
-	error->all(FLERR,"Region ID for fix heat does not exist");
+      if (iregion == -1)
+        error->all(FLERR,"Region ID for fix heat does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
@@ -91,13 +91,13 @@ void FixHeat::init()
 
   if (iregion >= 0) {
     iregion = domain->find_region(idregion);
-    if (iregion == -1) 
+    if (iregion == -1)
       error->all(FLERR,"Region ID for fix heat does not exist");
   }
 
   // cannot have 0 atoms in group
 
-  if (group->count(igroup) == 0) 
+  if (group->count(igroup) == 0)
     error->all(FLERR,"Fix heat group has no atoms");
   masstotal = group->mass(igroup);
 }
@@ -105,12 +105,12 @@ void FixHeat::init()
 /* ---------------------------------------------------------------------- */
 
 void FixHeat::end_of_step()
-{ 
+{
   double heat,ke;
   double vsub[3],vcm[3];
   Region *region = NULL;
   if (iregion >= 0) region = domain->regions[iregion];
-  
+
   if (iregion < 0) {
     heat = heat_input*nevery*update->dt*force->ftm2v;
     ke = group->ke(igroup)*force->ftm2v;
@@ -140,16 +140,16 @@ void FixHeat::end_of_step()
   if (iregion < 0) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	v[i][0] = scale*v[i][0] - vsub[0];
-	v[i][1] = scale*v[i][1] - vsub[1];
-	v[i][2] = scale*v[i][2] - vsub[2];
+        v[i][0] = scale*v[i][0] - vsub[0];
+        v[i][1] = scale*v[i][1] - vsub[1];
+        v[i][2] = scale*v[i][2] - vsub[2];
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	v[i][0] = scale*v[i][0] - vsub[0];
-	v[i][1] = scale*v[i][1] - vsub[1];
-	v[i][2] = scale*v[i][2] - vsub[2];
+        v[i][0] = scale*v[i][0] - vsub[0];
+        v[i][1] = scale*v[i][1] - vsub[1];
+        v[i][2] = scale*v[i][2] - vsub[2];
       }
   }
 }
diff --git a/src/fix_heat.h b/src/fix_heat.h
index 045c486490..83551e6637 100644
--- a/src/fix_heat.h
+++ b/src/fix_heat.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp
index a0fdceed38..6f4700c2ad 100644
--- a/src/fix_indent.cpp
+++ b/src/fix_indent.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -119,35 +119,35 @@ void FixIndent::init()
 {
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) 
+    if (xvar < 0)
       error->all(FLERR,"Variable name for fix indent does not exist");
     if (!input->variable->equalstyle(xvar))
       error->all(FLERR,"Variable for fix indent is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) 
+    if (yvar < 0)
       error->all(FLERR,"Variable name for fix indent does not exist");
     if (!input->variable->equalstyle(yvar))
       error->all(FLERR,"Variable for fix indent is not equal style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) 
+    if (zvar < 0)
       error->all(FLERR,"Variable name for fix indent does not exist");
     if (!input->variable->equalstyle(zvar))
       error->all(FLERR,"Variable for fix indent is not equal style");
   }
   if (rstr) {
     rvar = input->variable->find(rstr);
-    if (rvar < 0) 
+    if (rvar < 0)
       error->all(FLERR,"Variable name for fix indent does not exist");
     if (!input->variable->equalstyle(rvar))
       error->all(FLERR,"Variable for fix indent is not equal style");
   }
   if (pstr) {
     pvar = input->variable->find(pstr);
-    if (pvar < 0) 
+    if (pvar < 0)
       error->all(FLERR,"Variable name for fix indent does not exist");
     if (!input->variable->equalstyle(pvar))
       error->all(FLERR,"Variable for fix indent is not equal style");
@@ -183,7 +183,7 @@ void FixIndent::post_force(int vflag)
 {
   // indenter values, 0 = energy, 1-3 = force components
   // wrap variable evaluations with clear/add
-  
+
   if (varflag) modify->clearstep_compute();
 
   indenter_flag = 0;
@@ -218,29 +218,29 @@ void FixIndent::post_force(int vflag)
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	delx = x[i][0] - ctr[0];
-	dely = x[i][1] - ctr[1];
-	delz = x[i][2] - ctr[2];
-	domain->minimum_image(delx,dely,delz);
-	r = sqrt(delx*delx + dely*dely + delz*delz);
-	if (side == OUTSIDE) {
-	  dr = r - radius;
-	  fmag = k*dr*dr;
-	} else {
-	  dr = radius - r;
-	  fmag = -k*dr*dr;
-	}
-	if (dr >= 0.0) continue;
-	fx = delx*fmag/r;
-	fy = dely*fmag/r;
-	fz = delz*fmag/r;
-	f[i][0] += fx;
-	f[i][1] += fy;
-	f[i][2] += fz;
-	indenter[0] -= k3 * dr*dr*dr;
-	indenter[1] -= fx;
-	indenter[2] -= fy;
-	indenter[3] -= fz;
+        delx = x[i][0] - ctr[0];
+        dely = x[i][1] - ctr[1];
+        delz = x[i][2] - ctr[2];
+        domain->minimum_image(delx,dely,delz);
+        r = sqrt(delx*delx + dely*dely + delz*delz);
+        if (side == OUTSIDE) {
+          dr = r - radius;
+          fmag = k*dr*dr;
+        } else {
+          dr = radius - r;
+          fmag = -k*dr*dr;
+        }
+        if (dr >= 0.0) continue;
+        fx = delx*fmag/r;
+        fy = dely*fmag/r;
+        fz = delz*fmag/r;
+        f[i][0] += fx;
+        f[i][1] += fy;
+        f[i][2] += fz;
+        indenter[0] -= k3 * dr*dr*dr;
+        indenter[1] -= fx;
+        indenter[2] -= fy;
+        indenter[3] -= fz;
       }
 
   // cylindrical indenter
@@ -250,7 +250,7 @@ void FixIndent::post_force(int vflag)
     // ctr = current indenter axis
     // remap into periodic box
     // 3rd coord is just near box for remap(), since isn't used
-	   
+
     double ctr[3];
     if (cdim == 0) {
       ctr[0] = domain->boxlo[0];
@@ -281,44 +281,44 @@ void FixIndent::post_force(int vflag)
     double **f = atom->f;
     int *mask = atom->mask;
     int nlocal = atom->nlocal;
-    
+
     double delx,dely,delz,r,dr,fmag,fx,fy,fz;
-    
+
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (cdim == 0) {
-	  delx = 0;
-	  dely = x[i][1] - ctr[1];
-	  delz = x[i][2] - ctr[2];
-	} else if (cdim == 1) {
-	  delx = x[i][0] - ctr[0];
-	  dely = 0;
-	  delz = x[i][2] - ctr[2];
-	} else {
-	  delx = x[i][0] - ctr[0];
-	  dely = x[i][1] - ctr[1];
-	  delz = 0;
-	}
-	domain->minimum_image(delx,dely,delz);
-	r = sqrt(delx*delx + dely*dely + delz*delz);
-	if (side == OUTSIDE) {
-	  dr = r - radius;
-	  fmag = k*dr*dr;
-	} else {
-	  dr = radius - r;
-	  fmag = -k*dr*dr;
-	}
-	if (dr >= 0.0) continue;
-	fx = delx*fmag/r;
-	fy = dely*fmag/r;
-	fz = delz*fmag/r;
-	f[i][0] += fx;
-	f[i][1] += fy;
-	f[i][2] += fz;
-	indenter[0] -= k3 * dr*dr*dr;
-	indenter[1] -= fx;
-	indenter[2] -= fy;
-	indenter[3] -= fz;
+        if (cdim == 0) {
+          delx = 0;
+          dely = x[i][1] - ctr[1];
+          delz = x[i][2] - ctr[2];
+        } else if (cdim == 1) {
+          delx = x[i][0] - ctr[0];
+          dely = 0;
+          delz = x[i][2] - ctr[2];
+        } else {
+          delx = x[i][0] - ctr[0];
+          dely = x[i][1] - ctr[1];
+          delz = 0;
+        }
+        domain->minimum_image(delx,dely,delz);
+        r = sqrt(delx*delx + dely*dely + delz*delz);
+        if (side == OUTSIDE) {
+          dr = r - radius;
+          fmag = k*dr*dr;
+        } else {
+          dr = radius - r;
+          fmag = -k*dr*dr;
+        }
+        if (dr >= 0.0) continue;
+        fx = delx*fmag/r;
+        fy = dely*fmag/r;
+        fz = delz*fmag/r;
+        f[i][0] += fx;
+        f[i][1] += fy;
+        f[i][2] += fz;
+        indenter[0] -= k3 * dr*dr*dr;
+        indenter[1] -= fx;
+        indenter[2] -= fy;
+        indenter[3] -= fz;
       }
 
   // planar indenter
@@ -326,26 +326,26 @@ void FixIndent::post_force(int vflag)
   } else {
 
     // plane = current plane position
-	      
+
     double plane;
     if (pstr) plane = input->variable->compute_equal(pvar);
     else plane = pvalue;
-    
+
     double **x = atom->x;
     double **f = atom->f;
     int *mask = atom->mask;
     int nlocal = atom->nlocal;
-    
+
     double dr,fatom;
-    
+
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	dr = planeside * (plane - x[i][cdim]);
-	if (dr >= 0.0) continue;
-	fatom = -planeside * k*dr*dr;
-	f[i][cdim] += fatom;
-	indenter[0] -= k3 * dr*dr*dr;
-	indenter[cdim+1] -= fatom;
+        dr = planeside * (plane - x[i][cdim]);
+        if (dr >= 0.0) continue;
+        fatom = -planeside * k*dr*dr;
+        f[i][cdim] += fatom;
+        indenter[0] -= k3 * dr*dr*dr;
+        indenter[cdim+1] -= fatom;
       }
   }
 
@@ -397,7 +397,7 @@ double FixIndent::compute_vector(int n)
 }
 
 /* ----------------------------------------------------------------------
-   parse optional parameters at end of input line 
+   parse optional parameters at end of input line
 ------------------------------------------------------------------------- */
 
 void FixIndent::options(int narg, char **arg)
@@ -416,24 +416,24 @@ void FixIndent::options(int narg, char **arg)
       if (iarg+5 > narg) error->all(FLERR,"Illegal fix indent command");
 
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	xstr = new char[n];
-	strcpy(xstr,&arg[iarg+1][2]);
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        xstr = new char[n];
+        strcpy(xstr,&arg[iarg+1][2]);
       } else xvalue = atof(arg[iarg+1]);
       if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
-	int n = strlen(&arg[iarg+2][2]) + 1;
-	ystr = new char[n];
-	strcpy(ystr,&arg[iarg+2][2]);
+        int n = strlen(&arg[iarg+2][2]) + 1;
+        ystr = new char[n];
+        strcpy(ystr,&arg[iarg+2][2]);
       } else yvalue = atof(arg[iarg+2]);
       if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
-	int n = strlen(&arg[iarg+3][2]) + 1;
-	zstr = new char[n];
-	strcpy(zstr,&arg[iarg+3][2]);
+        int n = strlen(&arg[iarg+3][2]) + 1;
+        zstr = new char[n];
+        strcpy(zstr,&arg[iarg+3][2]);
       } else zvalue = atof(arg[iarg+3]);
       if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
-	int n = strlen(&arg[iarg+4][2]) + 1;
-	rstr = new char[n];
-	strcpy(rstr,&arg[iarg+4][2]);
+        int n = strlen(&arg[iarg+4][2]) + 1;
+        rstr = new char[n];
+        strcpy(rstr,&arg[iarg+4][2]);
       } else rvalue = atof(arg[iarg+4]);
 
       istyle = SPHERE;
@@ -443,47 +443,47 @@ void FixIndent::options(int narg, char **arg)
       if (iarg+5 > narg) error->all(FLERR,"Illegal fix indent command");
 
       if (strcmp(arg[iarg+1],"x") == 0) {
-	cdim = 0;
-	if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
-	  int n = strlen(&arg[iarg+2][2]) + 1;
-	  ystr = new char[n];
-	  strcpy(ystr,&arg[iarg+2][2]);
-	} else yvalue = atof(arg[iarg+2]);
-	if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
-	  int n = strlen(&arg[iarg+3][2]) + 1;
-	  zstr = new char[n];
-	  strcpy(zstr,&arg[iarg+3][2]);
-	} else zvalue = atof(arg[iarg+3]);
+        cdim = 0;
+        if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
+          int n = strlen(&arg[iarg+2][2]) + 1;
+          ystr = new char[n];
+          strcpy(ystr,&arg[iarg+2][2]);
+        } else yvalue = atof(arg[iarg+2]);
+        if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
+          int n = strlen(&arg[iarg+3][2]) + 1;
+          zstr = new char[n];
+          strcpy(zstr,&arg[iarg+3][2]);
+        } else zvalue = atof(arg[iarg+3]);
       } else if (strcmp(arg[iarg+1],"y") == 0) {
-	cdim = 1;
-	if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
-	  int n = strlen(&arg[iarg+2][2]) + 1;
-	  xstr = new char[n];
-	  strcpy(xstr,&arg[iarg+2][2]);
-	} else xvalue = atof(arg[iarg+2]);
-	if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
-	  int n = strlen(&arg[iarg+3][2]) + 1;
-	  zstr = new char[n];
-	  strcpy(zstr,&arg[iarg+3][2]);
-	} else zvalue = atof(arg[iarg+3]);
+        cdim = 1;
+        if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
+          int n = strlen(&arg[iarg+2][2]) + 1;
+          xstr = new char[n];
+          strcpy(xstr,&arg[iarg+2][2]);
+        } else xvalue = atof(arg[iarg+2]);
+        if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
+          int n = strlen(&arg[iarg+3][2]) + 1;
+          zstr = new char[n];
+          strcpy(zstr,&arg[iarg+3][2]);
+        } else zvalue = atof(arg[iarg+3]);
       } else if (strcmp(arg[iarg+1],"z") == 0) {
-	cdim = 2;
-	if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
-	  int n = strlen(&arg[iarg+2][2]) + 1;
-	  xstr = new char[n];
-	  strcpy(xstr,&arg[iarg+2][2]);
-	} else xvalue = atof(arg[iarg+2]);
-	if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
-	  int n = strlen(&arg[iarg+3][2]) + 1;
-	  ystr = new char[n];
-	  strcpy(ystr,&arg[iarg+3][2]);
-	} else yvalue = atof(arg[iarg+3]);
+        cdim = 2;
+        if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
+          int n = strlen(&arg[iarg+2][2]) + 1;
+          xstr = new char[n];
+          strcpy(xstr,&arg[iarg+2][2]);
+        } else xvalue = atof(arg[iarg+2]);
+        if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) {
+          int n = strlen(&arg[iarg+3][2]) + 1;
+          ystr = new char[n];
+          strcpy(ystr,&arg[iarg+3][2]);
+        } else yvalue = atof(arg[iarg+3]);
       } else error->all(FLERR,"Illegal fix indent command");
 
       if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) {
-	int n = strlen(&arg[iarg+4][2]) + 1;
-	rstr = new char[n];
-	strcpy(rstr,&arg[iarg+4][2]);
+        int n = strlen(&arg[iarg+4][2]) + 1;
+        rstr = new char[n];
+        strcpy(rstr,&arg[iarg+4][2]);
       } else rvalue = atof(arg[iarg+4]);
 
       istyle = CYLINDER;
@@ -497,9 +497,9 @@ void FixIndent::options(int narg, char **arg)
       else error->all(FLERR,"Illegal fix indent command");
 
       if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) {
-	int n = strlen(&arg[iarg+2][2]) + 1;
-	pstr = new char[n];
-	strcpy(pstr,&arg[iarg+2][2]);
+        int n = strlen(&arg[iarg+2][2]) + 1;
+        pstr = new char[n];
+        strcpy(pstr,&arg[iarg+2][2]);
       } else pvalue = atof(arg[iarg+2]);
 
       if (strcmp(arg[iarg+3],"lo") == 0) planeside = -1;
diff --git a/src/fix_indent.h b/src/fix_indent.h
index af7efadd35..6e0bad8ec8 100644
--- a/src/fix_indent.h
+++ b/src/fix_indent.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp
index 9387a07a6d..98f827dfdd 100644
--- a/src/fix_langevin.cpp
+++ b/src/fix_langevin.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -86,7 +86,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
   gfactor1 = new double[atom->ntypes+1];
   gfactor2 = new double[atom->ntypes+1];
   ratio = new double[atom->ntypes+1];
-  
+
   // optional args
 
   for (int i = 1; i <= atom->ntypes; i++) ratio[i] = 1.0;
@@ -113,7 +113,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
       int itype = atoi(arg[iarg+1]);
       double scale = atof(arg[iarg+2]);
       if (itype <= 0 || itype > atom->ntypes)
-	error->all(FLERR,"Illegal fix langevin command");
+        error->all(FLERR,"Illegal fix langevin command");
       ratio[itype] = scale;
       iarg += 3;
     } else if (strcmp(arg[iarg],"tally") == 0) {
@@ -135,7 +135,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
 
   if (aflag) {
     avec = (AtomVecEllipsoid *) atom->style_match("ellipsoid");
-    if (!avec) 
+    if (!avec)
       error->all(FLERR,"Fix langevin angmom requires atom style ellipsoid");
   }
 
@@ -192,7 +192,7 @@ void FixLangevin::init()
 
   if (tstr) {
     tvar = input->variable->find(tstr);
-    if (tvar < 0) 
+    if (tvar < 0)
       error->all(FLERR,"Variable name for fix langevin does not exist");
     if (input->variable->equalstyle(tvar)) tstyle = EQUAL;
     else if (input->variable->atomstyle(tvar)) tstyle = ATOM;
@@ -208,8 +208,8 @@ void FixLangevin::init()
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	if (radius[i] == 0.0)
-	  error->one(FLERR,"Fix langevin omega requires extended particles");
+        if (radius[i] == 0.0)
+          error->one(FLERR,"Fix langevin omega requires extended particles");
   }
 
   if (aflag) {
@@ -219,8 +219,8 @@ void FixLangevin::init()
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	if (ellipsoid[i] < 0)
-	  error->one(FLERR,"Fix langevin angmom requires extended particles");
+        if (ellipsoid[i] < 0)
+          error->one(FLERR,"Fix langevin angmom requires extended particles");
   }
 
   // set force prefactors
@@ -228,9 +228,9 @@ void FixLangevin::init()
   if (!atom->rmass) {
     for (int i = 1; i <= atom->ntypes; i++) {
       gfactor1[i] = -atom->mass[i] / t_period / force->ftm2v;
-      gfactor2[i] = sqrt(atom->mass[i]) * 
-	sqrt(24.0*force->boltz/t_period/update->dt/force->mvv2e) / 
-	force->ftm2v;
+      gfactor2[i] = sqrt(atom->mass[i]) *
+        sqrt(24.0*force->boltz/t_period/update->dt/force->mvv2e) /
+        force->ftm2v;
       gfactor1[i] *= 1.0/ratio[i];
       gfactor2[i] *= 1.0/sqrt(ratio[i]);
     }
@@ -299,20 +299,20 @@ void FixLangevin::post_force_no_tally()
     if (tstyle == EQUAL) {
       t_target = input->variable->compute_equal(tvar);
       if (t_target < 0.0)
-	error->one(FLERR,"Fix langevin variable returned negative temperature");
+        error->one(FLERR,"Fix langevin variable returned negative temperature");
       tsqrt = sqrt(t_target);
     } else {
       if (nlocal > maxatom2) {
-	maxatom2 = atom->nmax;
-	memory->destroy(tforce);
-	memory->create(tforce,maxatom2,"langevin:tforce");
+        maxatom2 = atom->nmax;
+        memory->destroy(tforce);
+        memory->create(tforce,maxatom2,"langevin:tforce");
       }
       input->variable->compute_atom(tvar,igroup,tforce,1,0);
       for (int i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit)
-	    if (tforce[i] < 0.0) 
-	      error->one(FLERR,
-			 "Fix langevin variable returned negative temperature");
+        if (mask[i] & groupbit)
+            if (tforce[i] < 0.0)
+              error->one(FLERR,
+                         "Fix langevin variable returned negative temperature");
     }
     modify->addstep_compute(update->ntimestep + 1);
   }
@@ -325,7 +325,7 @@ void FixLangevin::post_force_no_tally()
   //   and added force has extra term not multiplied by v = 0
   // for ZEROFLAG:
   //   sum random force over all atoms in group
-  //   subtract sum/count from each atom in group    
+  //   subtract sum/count from each atom in group
 
   double fran[3],fsum[3],fsumall[3];
   fsum[0] = fsum[1] = fsum[2] = 0.0;
@@ -335,103 +335,103 @@ void FixLangevin::post_force_no_tally()
   double dt = update->dt;
   double mvv2e = force->mvv2e;
   double ftm2v = force->ftm2v;
-  
+
   if (zeroflag) {
     count = group->count(igroup);
     if (count == 0)
       error->all(FLERR,"Cannot zero Langevin force of 0 atoms");
   }
-  
+
   if (rmass) {
     if (which == NOBIAS) {
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	  gamma1 = -rmass[i] / t_period / ftm2v;
-	  gamma2 = sqrt(rmass[i]) * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
-	  gamma1 *= 1.0/ratio[type[i]];
-	  gamma2 *= 1.0/sqrt(ratio[type[i]]) * tsqrt;
-	  fran[0] = gamma2*(random->uniform()-0.5);
-	  fran[1] = gamma2*(random->uniform()-0.5);
-	  fran[2] = gamma2*(random->uniform()-0.5);
-	  f[i][0] += gamma1*v[i][0] + fran[0];
-	  f[i][1] += gamma1*v[i][1] + fran[1];
-	  f[i][2] += gamma1*v[i][2] + fran[2];
-	  fsum[0] += fran[0];
-	  fsum[1] += fran[1];
-	  fsum[2] += fran[2];
-	}
+        if (mask[i] & groupbit) {
+          if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
+          gamma1 = -rmass[i] / t_period / ftm2v;
+          gamma2 = sqrt(rmass[i]) * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
+          gamma1 *= 1.0/ratio[type[i]];
+          gamma2 *= 1.0/sqrt(ratio[type[i]]) * tsqrt;
+          fran[0] = gamma2*(random->uniform()-0.5);
+          fran[1] = gamma2*(random->uniform()-0.5);
+          fran[2] = gamma2*(random->uniform()-0.5);
+          f[i][0] += gamma1*v[i][0] + fran[0];
+          f[i][1] += gamma1*v[i][1] + fran[1];
+          f[i][2] += gamma1*v[i][2] + fran[2];
+          fsum[0] += fran[0];
+          fsum[1] += fran[1];
+          fsum[2] += fran[2];
+        }
       }
 
     } else if (which == BIAS) {
       temperature->compute_scalar();
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	  gamma1 = -rmass[i] / t_period / ftm2v;
-	  gamma2 = sqrt(rmass[i]) * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
-	  gamma1 *= 1.0/ratio[type[i]];
-	  gamma2 *= 1.0/sqrt(ratio[type[i]]) * tsqrt;
-	  temperature->remove_bias(i,v[i]);
-	  fran[0] = gamma2*(random->uniform()-0.5);
-	  fran[1] = gamma2*(random->uniform()-0.5);
-	  fran[2] = gamma2*(random->uniform()-0.5);
-	  if (v[i][0] != 0.0)
-	    f[i][0] += gamma1*v[i][0] + fran[0];
-	  if (v[i][1] != 0.0)
-	    f[i][1] += gamma1*v[i][1] + fran[1];
-	  if (v[i][2] != 0.0)
-	    f[i][2] += gamma1*v[i][2] + fran[2];
-	  fsum[0] += fran[0];
-	  fsum[1] += fran[1];
-	  fsum[2] += fran[2];
-	  temperature->restore_bias(i,v[i]);
-	}
+        if (mask[i] & groupbit) {
+          if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
+          gamma1 = -rmass[i] / t_period / ftm2v;
+          gamma2 = sqrt(rmass[i]) * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
+          gamma1 *= 1.0/ratio[type[i]];
+          gamma2 *= 1.0/sqrt(ratio[type[i]]) * tsqrt;
+          temperature->remove_bias(i,v[i]);
+          fran[0] = gamma2*(random->uniform()-0.5);
+          fran[1] = gamma2*(random->uniform()-0.5);
+          fran[2] = gamma2*(random->uniform()-0.5);
+          if (v[i][0] != 0.0)
+            f[i][0] += gamma1*v[i][0] + fran[0];
+          if (v[i][1] != 0.0)
+            f[i][1] += gamma1*v[i][1] + fran[1];
+          if (v[i][2] != 0.0)
+            f[i][2] += gamma1*v[i][2] + fran[2];
+          fsum[0] += fran[0];
+          fsum[1] += fran[1];
+          fsum[2] += fran[2];
+          temperature->restore_bias(i,v[i]);
+        }
       }
     }
 
   } else {
-    
+
     if (which == NOBIAS) {
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	  gamma1 = gfactor1[type[i]];
-	  gamma2 = gfactor2[type[i]] * tsqrt;
-	  fran[0] = gamma2*(random->uniform()-0.5);
-	  fran[1] = gamma2*(random->uniform()-0.5);
-	  fran[2] = gamma2*(random->uniform()-0.5);
-	  f[i][0] += gamma1*v[i][0] + fran[0];
-	  f[i][1] += gamma1*v[i][1] + fran[1];
-	  f[i][2] += gamma1*v[i][2] + fran[2];
-	  fsum[0] += fran[0];
-	  fsum[1] += fran[1];
-	  fsum[2] += fran[2];
-	}
+        if (mask[i] & groupbit) {
+          if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
+          gamma1 = gfactor1[type[i]];
+          gamma2 = gfactor2[type[i]] * tsqrt;
+          fran[0] = gamma2*(random->uniform()-0.5);
+          fran[1] = gamma2*(random->uniform()-0.5);
+          fran[2] = gamma2*(random->uniform()-0.5);
+          f[i][0] += gamma1*v[i][0] + fran[0];
+          f[i][1] += gamma1*v[i][1] + fran[1];
+          f[i][2] += gamma1*v[i][2] + fran[2];
+          fsum[0] += fran[0];
+          fsum[1] += fran[1];
+          fsum[2] += fran[2];
+        }
       }
 
     } else if (which == BIAS) {
       temperature->compute_scalar();
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	  gamma1 = gfactor1[type[i]];
-	  gamma2 = gfactor2[type[i]] * tsqrt;
-	  temperature->remove_bias(i,v[i]);
-	  fran[0] = gamma2*(random->uniform()-0.5);
-	  fran[1] = gamma2*(random->uniform()-0.5);
-	  fran[2] = gamma2*(random->uniform()-0.5);
-	  if (v[i][0] != 0.0)
-	    f[i][0] += gamma1*v[i][0] + fran[0];
-	  if (v[i][1] != 0.0)
-	    f[i][1] += gamma1*v[i][1] + fran[1];
-	  if (v[i][2] != 0.0)
-	    f[i][2] += gamma1*v[i][2] + fran[2];
-	  fsum[0] += fran[0];
-	  fsum[1] += fran[1];
-	  fsum[2] += fran[2];
-	  temperature->restore_bias(i,v[i]);
-	}
+        if (mask[i] & groupbit) {
+          if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
+          gamma1 = gfactor1[type[i]];
+          gamma2 = gfactor2[type[i]] * tsqrt;
+          temperature->remove_bias(i,v[i]);
+          fran[0] = gamma2*(random->uniform()-0.5);
+          fran[1] = gamma2*(random->uniform()-0.5);
+          fran[2] = gamma2*(random->uniform()-0.5);
+          if (v[i][0] != 0.0)
+            f[i][0] += gamma1*v[i][0] + fran[0];
+          if (v[i][1] != 0.0)
+            f[i][1] += gamma1*v[i][1] + fran[1];
+          if (v[i][2] != 0.0)
+            f[i][2] += gamma1*v[i][2] + fran[2];
+          fsum[0] += fran[0];
+          fsum[1] += fran[1];
+          fsum[2] += fran[2];
+          temperature->restore_bias(i,v[i]);
+        }
       }
     }
   }
@@ -445,9 +445,9 @@ void FixLangevin::post_force_no_tally()
     fsumall[2] /= count;
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	f[i][0] -= fsumall[0];
-	f[i][1] -= fsumall[1];
-	f[i][2] -= fsumall[2];
+        f[i][0] -= fsumall[0];
+        f[i][1] -= fsumall[1];
+        f[i][2] -= fsumall[2];
       }
     }
   }
@@ -494,20 +494,20 @@ void FixLangevin::post_force_tally()
     if (tstyle == EQUAL) {
       t_target = input->variable->compute_equal(tvar);
       if (t_target < 0.0)
-	error->one(FLERR,"Fix langevin variable returned negative temperature");
+        error->one(FLERR,"Fix langevin variable returned negative temperature");
       tsqrt = sqrt(t_target);
     } else {
       if (nlocal > maxatom2) {
-	maxatom2 = atom->nmax;
-	memory->destroy(tforce);
-	memory->create(tforce,maxatom2,"langevin:tforce");
+        maxatom2 = atom->nmax;
+        memory->destroy(tforce);
+        memory->create(tforce,maxatom2,"langevin:tforce");
       }
       input->variable->compute_atom(tvar,igroup,tforce,1,0);
       for (int i = 0; i < nlocal; i++)
-	if (mask[i] & groupbit)
-	    if (tforce[i] < 0.0) 
-	      error->one(FLERR,
-			 "Fix langevin variable returned negative temperature");
+        if (mask[i] & groupbit)
+            if (tforce[i] < 0.0)
+              error->one(FLERR,
+                         "Fix langevin variable returned negative temperature");
     }
     modify->addstep_compute(update->ntimestep + 1);
   }
@@ -527,80 +527,80 @@ void FixLangevin::post_force_tally()
   if (rmass) {
     if (which == NOBIAS) {
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	  gamma1 = -rmass[i] / t_period / ftm2v;
-	  gamma2 = sqrt(rmass[i]) * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
-	  gamma1 *= 1.0/ratio[type[i]];
-	  gamma2 *= 1.0/sqrt(ratio[type[i]]) * tsqrt;
-	  flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
-	  flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
-	  flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
-	  f[i][0] += flangevin[i][0];
-	  f[i][1] += flangevin[i][1];
-	  f[i][2] += flangevin[i][2];
-	}
+        if (mask[i] & groupbit) {
+          if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
+          gamma1 = -rmass[i] / t_period / ftm2v;
+          gamma2 = sqrt(rmass[i]) * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
+          gamma1 *= 1.0/ratio[type[i]];
+          gamma2 *= 1.0/sqrt(ratio[type[i]]) * tsqrt;
+          flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
+          flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
+          flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
+          f[i][0] += flangevin[i][0];
+          f[i][1] += flangevin[i][1];
+          f[i][2] += flangevin[i][2];
+        }
       }
 
     } else if (which == BIAS) {
       temperature->compute_scalar();
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	  gamma1 = -rmass[i] / t_period / ftm2v;
-	  gamma2 = sqrt(rmass[i]) * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
-	  gamma1 *= 1.0/ratio[type[i]];
-	  gamma2 *= 1.0/sqrt(ratio[type[i]]) * tsqrt;
-	  temperature->remove_bias(i,v[i]);
-	  flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
-	  flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
-	  flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
-	  if (v[i][0] != 0.0) f[i][0] += flangevin[i][0];
-	  else flangevin[i][0] = 0;
-	  if (v[i][1] != 0.0) f[i][1] += flangevin[i][1];
-	  else flangevin[i][1] = 0;
-	  if (v[i][2] != 0.0) f[i][2] += flangevin[i][2];
-	  else flangevin[i][2] = 0;
-	  temperature->restore_bias(i,v[i]);
-	}
+        if (mask[i] & groupbit) {
+          if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
+          gamma1 = -rmass[i] / t_period / ftm2v;
+          gamma2 = sqrt(rmass[i]) * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
+          gamma1 *= 1.0/ratio[type[i]];
+          gamma2 *= 1.0/sqrt(ratio[type[i]]) * tsqrt;
+          temperature->remove_bias(i,v[i]);
+          flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
+          flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
+          flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
+          if (v[i][0] != 0.0) f[i][0] += flangevin[i][0];
+          else flangevin[i][0] = 0;
+          if (v[i][1] != 0.0) f[i][1] += flangevin[i][1];
+          else flangevin[i][1] = 0;
+          if (v[i][2] != 0.0) f[i][2] += flangevin[i][2];
+          else flangevin[i][2] = 0;
+          temperature->restore_bias(i,v[i]);
+        }
       }
     }
 
   } else {
     if (which == NOBIAS) {
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	  gamma1 = gfactor1[type[i]];
-	  gamma2 = gfactor2[type[i]] * tsqrt;
-	  flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
-	  flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
-	  flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
-	  f[i][0] += flangevin[i][0];
-	  f[i][1] += flangevin[i][1];
-	  f[i][2] += flangevin[i][2];
-	}
+        if (mask[i] & groupbit) {
+          if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
+          gamma1 = gfactor1[type[i]];
+          gamma2 = gfactor2[type[i]] * tsqrt;
+          flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
+          flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
+          flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
+          f[i][0] += flangevin[i][0];
+          f[i][1] += flangevin[i][1];
+          f[i][2] += flangevin[i][2];
+        }
       }
 
     } else if (which == BIAS) {
       temperature->compute_scalar();
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
-	  gamma1 = gfactor1[type[i]];
-	  gamma2 = gfactor2[type[i]] * tsqrt;
-	  temperature->remove_bias(i,v[i]);
-	  flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
-	  flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
-	  flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
-	  if (v[i][0] != 0.0) f[i][0] += flangevin[i][0];
-	  else flangevin[i][0] = 0.0;
-	  if (v[i][1] != 0.0) f[i][1] += flangevin[i][1];
-	  else flangevin[i][1] = 0.0;
-	  if (v[i][2] != 0.0) f[i][2] += flangevin[i][2];
-	  else flangevin[i][2] = 0.0;
-	  temperature->restore_bias(i,v[i]);
-	}
+        if (mask[i] & groupbit) {
+          if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
+          gamma1 = gfactor1[type[i]];
+          gamma2 = gfactor2[type[i]] * tsqrt;
+          temperature->remove_bias(i,v[i]);
+          flangevin[i][0] = gamma1*v[i][0] + gamma2*(random->uniform()-0.5);
+          flangevin[i][1] = gamma1*v[i][1] + gamma2*(random->uniform()-0.5);
+          flangevin[i][2] = gamma1*v[i][2] + gamma2*(random->uniform()-0.5);
+          if (v[i][0] != 0.0) f[i][0] += flangevin[i][0];
+          else flangevin[i][0] = 0.0;
+          if (v[i][1] != 0.0) f[i][1] += flangevin[i][1];
+          else flangevin[i][1] = 0.0;
+          if (v[i][2] != 0.0) f[i][2] += flangevin[i][2];
+          else flangevin[i][2] = 0.0;
+          temperature->restore_bias(i,v[i]);
+        }
       }
     }
   }
@@ -686,7 +686,7 @@ void FixLangevin::angmom_thermostat()
       inertia[2] = EINERTIA*rmass[i] * (shape[0]*shape[0]+shape[1]*shape[1]);
       quat = bonus[ellipsoid[i]].quat;
       MathExtra::mq_to_omega(angmom[i],quat,inertia,omega);
-      
+
       if (tstyle == ATOM) tsqrt = sqrt(tforce[i]);
       gamma1 = -1.0 / t_period / ftm2v;
       gamma2 = sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
@@ -712,14 +712,14 @@ void FixLangevin::end_of_step()
 
   double **v = atom->v;
   int *mask = atom->mask;
-  int nlocal = atom->nlocal;  
+  int nlocal = atom->nlocal;
 
   energy_onestep = 0.0;
- 
+
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
-      energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] + 
-	flangevin[i][2]*v[i][2];
+      energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] +
+        flangevin[i][2]*v[i][2];
 
   energy += energy_onestep*update->dt;
 }
@@ -737,9 +737,9 @@ void FixLangevin::reset_dt()
 {
   if (atom->mass) {
     for (int i = 1; i <= atom->ntypes; i++) {
-      gfactor2[i] = sqrt(atom->mass[i]) * 
-	sqrt(24.0*force->boltz/t_period/update->dt/force->mvv2e) / 
-	force->ftm2v;
+      gfactor2[i] = sqrt(atom->mass[i]) *
+        sqrt(24.0*force->boltz/t_period/update->dt/force->mvv2e) /
+        force->ftm2v;
       gfactor2[i] *= 1.0/sqrt(ratio[i]);
     }
   }
@@ -757,13 +757,13 @@ int FixLangevin::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) 
+    if (icompute < 0)
       error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
       error->all(FLERR,
-		 "Fix_modify temperature ID does not compute temperature");
+                 "Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
       error->warning(FLERR,"Group for fix_modify temp != fix group");
     return 2;
@@ -781,21 +781,21 @@ double FixLangevin::compute_scalar()
 
   double **v = atom->v;
   int *mask = atom->mask;
-  int nlocal = atom->nlocal;  
+  int nlocal = atom->nlocal;
 
   if (update->ntimestep == update->beginstep) {
     energy_onestep = 0.0;
-    for (int i = 0; i < nlocal; i++) 
-      if (mask[i] & groupbit) 
-	energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] + 
-	  flangevin[i][2]*v[i][2];
+    for (int i = 0; i < nlocal; i++)
+      if (mask[i] & groupbit)
+        energy_onestep += flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] +
+          flangevin[i][2]*v[i][2];
     energy = 0.5*energy_onestep*update->dt;
   }
 
   double energy_me = energy - 0.5*energy_onestep*update->dt;
 
-  double energy_all;	 
-  MPI_Allreduce(&energy_me,&energy_all,1,MPI_DOUBLE,MPI_SUM,world);	
+  double energy_all;
+  MPI_Allreduce(&energy_me,&energy_all,1,MPI_DOUBLE,MPI_SUM,world);
   return -energy_all;
 }
 
@@ -808,7 +808,7 @@ void *FixLangevin::extract(const char *str, int &dim)
   dim=0;
   if (strcmp(str,"t_target") == 0) {
     return &t_target;
-  } 
+  }
   return NULL;
 }
 
diff --git a/src/fix_langevin.h b/src/fix_langevin.h
index 790f81dc08..69c144ce7b 100644
--- a/src/fix_langevin.h
+++ b/src/fix_langevin.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_lineforce.cpp b/src/fix_lineforce.cpp
index 5da729f84f..a778ac13c5 100644
--- a/src/fix_lineforce.cpp
+++ b/src/fix_lineforce.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_lineforce.h b/src/fix_lineforce.h
index ddcff23462..2e367333f1 100644
--- a/src/fix_lineforce.h
+++ b/src/fix_lineforce.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_minimize.cpp b/src/fix_minimize.cpp
index c0c61098d5..26e2d7efc0 100644
--- a/src/fix_minimize.cpp
+++ b/src/fix_minimize.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -110,7 +110,7 @@ void FixMinimize::reset_coords()
 {
   box_swap();
   domain->set_global_box();
-    
+
   double **x = atom->x;
   double *x0 = vectors[0];
   int nlocal = atom->nlocal;
@@ -127,7 +127,7 @@ void FixMinimize::reset_coords()
     if (dz != dz0) x0[n+2] = x[i][2] - dz;
     n += 3;
   }
-  
+
   box_swap();
   domain->set_global_box();
 }
@@ -162,7 +162,7 @@ void FixMinimize::box_swap()
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double FixMinimize::memory_usage()
@@ -174,7 +174,7 @@ double FixMinimize::memory_usage()
 }
 
 /* ----------------------------------------------------------------------
-   allocate local atom-based arrays 
+   allocate local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixMinimize::grow_arrays(int nmax)
@@ -184,7 +184,7 @@ void FixMinimize::grow_arrays(int nmax)
 }
 
 /* ----------------------------------------------------------------------
-   copy values within local atom-based arrays 
+   copy values within local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixMinimize::copy_arrays(int i, int j)
@@ -200,7 +200,7 @@ void FixMinimize::copy_arrays(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   pack values in local atom-based arrays for exchange with another proc 
+   pack values in local atom-based arrays for exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixMinimize::pack_exchange(int i, double *buf)
@@ -217,7 +217,7 @@ int FixMinimize::pack_exchange(int i, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   unpack values in local atom-based arrays from exchange with another proc 
+   unpack values in local atom-based arrays from exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixMinimize::unpack_exchange(int nlocal, double *buf)
diff --git a/src/fix_minimize.h b/src/fix_minimize.h
index 8cb96ea25b..e4b1634b84 100644
--- a/src/fix_minimize.h
+++ b/src/fix_minimize.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_momentum.cpp b/src/fix_momentum.cpp
index a2067a516d..590a55dbc0 100644
--- a/src/fix_momentum.cpp
+++ b/src/fix_momentum.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -56,8 +56,8 @@ FixMomentum::FixMomentum(LAMMPS *lmp, int narg, char **arg) :
     error->all(FLERR,"Illegal fix momentum command");
 
   if (linear)
-    if (xflag < 0 || xflag > 1 || yflag < 0 || yflag > 1 || 
-	zflag < 0 || zflag > 1) error->all(FLERR,"Illegal fix momentum command");
+    if (xflag < 0 || xflag > 1 || yflag < 0 || yflag > 1 ||
+        zflag < 0 || zflag > 1) error->all(FLERR,"Illegal fix momentum command");
 
   // cannot have 0 atoms in group
 
@@ -91,16 +91,16 @@ void FixMomentum::end_of_step()
 
     // adjust velocities by vcm to zero linear momentum
     // only adjust a component if flag is set
-    
+
     double **v = atom->v;
     int *mask = atom->mask;
     int nlocal = atom->nlocal;
-    
+
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (xflag) v[i][0] -= vcm[0];
-	if (yflag) v[i][1] -= vcm[1];
-	if (zflag) v[i][2] -= vcm[2];
+        if (xflag) v[i][0] -= vcm[0];
+        if (yflag) v[i][1] -= vcm[1];
+        if (zflag) v[i][2] -= vcm[2];
       }
   }
 
@@ -110,7 +110,7 @@ void FixMomentum::end_of_step()
     group->angmom(igroup,xcm,angmom);
     group->inertia(igroup,xcm,inertia);
     group->omega(angmom,inertia,omega);
-    
+
     // adjust velocities to zero omega
     // vnew_i = v_i - w x r_i
     // must use unwrapped coords to compute r_i correctly
@@ -129,15 +129,15 @@ void FixMomentum::end_of_step()
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	dx = (x[i][0] + xbox*xprd) - xcm[0];
-	dy = (x[i][1] + ybox*yprd) - xcm[1];
-	dz = (x[i][2] + zbox*zprd) - xcm[2];
-	v[i][0] -= omega[1]*dz - omega[2]*dy;
-	v[i][1] -= omega[2]*dx - omega[0]*dz;
-	v[i][2] -= omega[0]*dy - omega[1]*dx;
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        dx = (x[i][0] + xbox*xprd) - xcm[0];
+        dy = (x[i][1] + ybox*yprd) - xcm[1];
+        dz = (x[i][2] + zbox*zprd) - xcm[2];
+        v[i][0] -= omega[1]*dz - omega[2]*dy;
+        v[i][1] -= omega[2]*dx - omega[0]*dz;
+        v[i][2] -= omega[0]*dy - omega[1]*dx;
       }
   }
 }
diff --git a/src/fix_momentum.h b/src/fix_momentum.h
index a15d98b601..c647b18422 100644
--- a/src/fix_momentum.h
+++ b/src/fix_momentum.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_move.cpp b/src/fix_move.cpp
index ff938a5e28..0740fdf4fe 100644
--- a/src/fix_move.cpp
+++ b/src/fix_move.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -151,7 +151,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
       vzvarstr = new char[n];
       strcpy(vzvarstr,&arg[9][2]);
     } else error->all(FLERR,"Illegal fix move command");
-    
+
   } else error->all(FLERR,"Illegal fix move command");
 
   // optional args
@@ -177,10 +177,10 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
       error->all(FLERR,"Fix move cannot set wiggle z motion for 2d problem");
     if (mstyle == ROTATE && (axis[0] != 0.0 || axis[1] != 0.0))
       error->all(FLERR,
-		 "Fix move cannot rotate aroung non z-axis for 2d problem");
+                 "Fix move cannot rotate aroung non z-axis for 2d problem");
     if (mstyle == VARIABLE && (zvarstr || vzvarstr))
       error->all(FLERR,
-		 "Fix move cannot define z or vz variable for 2d problem");
+                 "Fix move cannot define z or vz variable for 2d problem");
   }
 
   if (atom->angmom_flag && comm->me == 0)
@@ -190,7 +190,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
 
   // setup scaling and apply scaling factors to velocity & amplitude
 
-  if ((mstyle == LINEAR || mstyle == WIGGLE || mstyle == ROTATE) && 
+  if ((mstyle == LINEAR || mstyle == WIGGLE || mstyle == ROTATE) &&
       scaleflag) {
     if (domain->lattice == NULL)
       error->all(FLERR,"Use of fix move with undefined lattice");
@@ -226,7 +226,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
 
   if (mstyle == ROTATE) {
     double len = sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
-    if (len == 0.0) 
+    if (len == 0.0)
       error->all(FLERR,"Fix move cannot have 0 length rotation vector");
     runit[0] = axis[0]/len;
     runit[1] = axis[1]/len;
@@ -236,7 +236,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
   // set omega_flag if particles store omega
 
   omega_flag = atom->omega_flag;
- 
+
   // perform initial allocation of atom-based array
   // register with Atom class
 
@@ -268,7 +268,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
 FixMove::~FixMove()
 {
   // unregister callbacks to this fix from Atom class
- 
+
   atom->delete_callback(id,0);
   atom->delete_callback(id,1);
 
@@ -312,7 +312,7 @@ void FixMove::init()
     if (xvarstr) {
       xvar = input->variable->find(xvarstr);
       if (xvar < 0) error->all(FLERR,
-			       "Variable name for fix move does not exist");
+                               "Variable name for fix move does not exist");
       if (input->variable->equalstyle(xvar)) xvarstyle = EQUAL;
       else if (input->variable->atomstyle(xvar)) xvarstyle = ATOM;
       else error->all(FLERR,"Variable for fix move is invalid style");
@@ -320,7 +320,7 @@ void FixMove::init()
     if (yvarstr) {
       yvar = input->variable->find(yvarstr);
       if (yvar < 0) error->all(FLERR,
-			       "Variable name for fix move does not exist");
+                               "Variable name for fix move does not exist");
       if (input->variable->equalstyle(yvar)) yvarstyle = EQUAL;
       else if (input->variable->atomstyle(yvar)) yvarstyle = ATOM;
       else error->all(FLERR,"Variable for fix move is invalid style");
@@ -328,7 +328,7 @@ void FixMove::init()
     if (zvarstr) {
       zvar = input->variable->find(zvarstr);
       if (zvar < 0) error->all(FLERR,
-			       "Variable name for fix move does not exist");
+                               "Variable name for fix move does not exist");
       if (input->variable->equalstyle(zvar)) zvarstyle = EQUAL;
       else if (input->variable->atomstyle(zvar)) zvarstyle = ATOM;
       else error->all(FLERR,"Variable for fix move is invalid style");
@@ -336,7 +336,7 @@ void FixMove::init()
     if (vxvarstr) {
       vxvar = input->variable->find(vxvarstr);
       if (vxvar < 0) error->all(FLERR,
-				"Variable name for fix move does not exist");
+                                "Variable name for fix move does not exist");
       if (input->variable->equalstyle(vxvar)) vxvarstyle = EQUAL;
       else if (input->variable->atomstyle(vxvar)) vxvarstyle = ATOM;
       else error->all(FLERR,"Variable for fix move is invalid style");
@@ -344,7 +344,7 @@ void FixMove::init()
     if (vyvarstr) {
       vyvar = input->variable->find(vyvarstr);
       if (vyvar < 0) error->all(FLERR,
-				"Variable name for fix move does not exist");
+                                "Variable name for fix move does not exist");
       if (input->variable->equalstyle(vyvar)) vyvarstyle = EQUAL;
       else if (input->variable->atomstyle(vyvar)) vyvarstyle = ATOM;
       else error->all(FLERR,"Variable for fix move is invalid style");
@@ -352,7 +352,7 @@ void FixMove::init()
     if (vzvarstr) {
       vzvar = input->variable->find(vzvarstr);
       if (vzvar < 0) error->all(FLERR,
-				"Variable name for fix move does not exist");
+                                "Variable name for fix move does not exist");
       if (input->variable->equalstyle(vzvar)) vzvarstyle = EQUAL;
       else if (input->variable->atomstyle(vzvar)) vzvarstyle = ATOM;
       else error->all(FLERR,"Variable for fix move is invalid style");
@@ -398,50 +398,50 @@ void FixMove::initial_integrate(int vflag)
   if (mstyle == LINEAR) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	xold[0] = x[i][0];
-	xold[1] = x[i][1];
-	xold[2] = x[i][2];
-
-	if (vxflag) {
-	  v[i][0] = vx;
-	  x[i][0] = xoriginal[i][0] + vx*delta;
-	} else if (rmass) {
-	  dtfm = dtf / rmass[i];
-	  v[i][0] += dtfm * f[i][0];
-	  x[i][0] += dtv * v[i][0];
-	} else {
-	  dtfm = dtf / mass[type[i]];
-	  v[i][0] += dtfm * f[i][0];
-	  x[i][0] += dtv * v[i][0];
-	}
-
-	if (vyflag) {
-	  v[i][1] = vy;
-	  x[i][1] = xoriginal[i][1] + vy*delta;
-	} else if (rmass) {
-	  dtfm = dtf / rmass[i];
-	  v[i][1] += dtfm * f[i][1];
-	  x[i][1] += dtv * v[i][1];
-	} else {
-	  dtfm = dtf / mass[type[i]];
-	  v[i][1] += dtfm * f[i][1];
-	  x[i][1] += dtv * v[i][1];
-	}
-
-	if (vzflag) {
-	  v[i][2] = vz;
-	  x[i][2] = xoriginal[i][2] + vz*delta;
-	} else if (rmass) {
-	  dtfm = dtf / rmass[i];
-	  v[i][2] += dtfm * f[i][2];
-	  x[i][2] += dtv * v[i][2];
-	} else {
-	  dtfm = dtf / mass[type[i]];
-	  v[i][2] += dtfm * f[i][2];
-	  x[i][2] += dtv * v[i][2];
-	}
-
-	domain->remap_near(x[i],xold);
+        xold[0] = x[i][0];
+        xold[1] = x[i][1];
+        xold[2] = x[i][2];
+
+        if (vxflag) {
+          v[i][0] = vx;
+          x[i][0] = xoriginal[i][0] + vx*delta;
+        } else if (rmass) {
+          dtfm = dtf / rmass[i];
+          v[i][0] += dtfm * f[i][0];
+          x[i][0] += dtv * v[i][0];
+        } else {
+          dtfm = dtf / mass[type[i]];
+          v[i][0] += dtfm * f[i][0];
+          x[i][0] += dtv * v[i][0];
+        }
+
+        if (vyflag) {
+          v[i][1] = vy;
+          x[i][1] = xoriginal[i][1] + vy*delta;
+        } else if (rmass) {
+          dtfm = dtf / rmass[i];
+          v[i][1] += dtfm * f[i][1];
+          x[i][1] += dtv * v[i][1];
+        } else {
+          dtfm = dtf / mass[type[i]];
+          v[i][1] += dtfm * f[i][1];
+          x[i][1] += dtv * v[i][1];
+        }
+
+        if (vzflag) {
+          v[i][2] = vz;
+          x[i][2] = xoriginal[i][2] + vz*delta;
+        } else if (rmass) {
+          dtfm = dtf / rmass[i];
+          v[i][2] += dtfm * f[i][2];
+          x[i][2] += dtv * v[i][2];
+        } else {
+          dtfm = dtf / mass[type[i]];
+          v[i][2] += dtfm * f[i][2];
+          x[i][2] += dtv * v[i][2];
+        }
+
+        domain->remap_near(x[i],xold);
       }
     }
 
@@ -454,50 +454,50 @@ void FixMove::initial_integrate(int vflag)
 
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	xold[0] = x[i][0];
-	xold[1] = x[i][1];
-	xold[2] = x[i][2];
-
-	if (axflag) {
-	  v[i][0] = ax*omega_rotate*cosine;
-	  x[i][0] = xoriginal[i][0] + ax*sine;
-	} else if (rmass) {
-	  dtfm = dtf / rmass[i];
-	  v[i][0] += dtfm * f[i][0];
-	  x[i][0] += dtv * v[i][0];
-	} else {
-	  dtfm = dtf / mass[type[i]];
-	  v[i][0] += dtfm * f[i][0];
-	  x[i][0] += dtv * v[i][0];
-	}
-
-	if (ayflag) {
-	  v[i][1] = ay*omega_rotate*cosine;
-	  x[i][1] = xoriginal[i][1] + ay*sine;
-	} else if (rmass) {
-	  dtfm = dtf / rmass[i];
-	  v[i][1] += dtfm * f[i][1];
-	  x[i][1] += dtv * v[i][1];
-	} else {
-	  dtfm = dtf / mass[type[i]];
-	  v[i][1] += dtfm * f[i][1];
-	  x[i][1] += dtv * v[i][1];
-	}
-
-	if (azflag) {
-	  v[i][2] = az*omega_rotate*cosine;
-	  x[i][2] = xoriginal[i][2] + az*sine;
-	} else if (rmass) {
-	  dtfm = dtf / rmass[i];
-	  v[i][2] += dtfm * f[i][2];
-	  x[i][2] += dtv * v[i][2];
-	} else {
-	  dtfm = dtf / mass[type[i]];
-	  v[i][2] += dtfm * f[i][2];
-	  x[i][2] += dtv * v[i][2];
-	}
-
-	domain->remap_near(x[i],xold);
+        xold[0] = x[i][0];
+        xold[1] = x[i][1];
+        xold[2] = x[i][2];
+
+        if (axflag) {
+          v[i][0] = ax*omega_rotate*cosine;
+          x[i][0] = xoriginal[i][0] + ax*sine;
+        } else if (rmass) {
+          dtfm = dtf / rmass[i];
+          v[i][0] += dtfm * f[i][0];
+          x[i][0] += dtv * v[i][0];
+        } else {
+          dtfm = dtf / mass[type[i]];
+          v[i][0] += dtfm * f[i][0];
+          x[i][0] += dtv * v[i][0];
+        }
+
+        if (ayflag) {
+          v[i][1] = ay*omega_rotate*cosine;
+          x[i][1] = xoriginal[i][1] + ay*sine;
+        } else if (rmass) {
+          dtfm = dtf / rmass[i];
+          v[i][1] += dtfm * f[i][1];
+          x[i][1] += dtv * v[i][1];
+        } else {
+          dtfm = dtf / mass[type[i]];
+          v[i][1] += dtfm * f[i][1];
+          x[i][1] += dtv * v[i][1];
+        }
+
+        if (azflag) {
+          v[i][2] = az*omega_rotate*cosine;
+          x[i][2] = xoriginal[i][2] + az*sine;
+        } else if (rmass) {
+          dtfm = dtf / rmass[i];
+          v[i][2] += dtfm * f[i][2];
+          x[i][2] += dtv * v[i][2];
+        } else {
+          dtfm = dtf / mass[type[i]];
+          v[i][2] += dtfm * f[i][2];
+          x[i][2] += dtv * v[i][2];
+        }
+
+        domain->remap_near(x[i],xold);
       }
     }
 
@@ -522,40 +522,40 @@ void FixMove::initial_integrate(int vflag)
 
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	xold[0] = x[i][0];
-	xold[1] = x[i][1];
-	xold[2] = x[i][2];
-
-	d[0] = xoriginal[i][0] - point[0];
-	d[1] = xoriginal[i][1] - point[1];
-	d[2] = xoriginal[i][2] - point[2];
-	ddotr = d[0]*runit[0] + d[1]*runit[1] + d[2]*runit[2]; 
-	c[0] = ddotr*runit[0];
-	c[1] = ddotr*runit[1];
-	c[2] = ddotr*runit[2];
-	a[0] = d[0] - c[0];
-	a[1] = d[1] - c[1];
-	a[2] = d[2] - c[2];
-	b[0] = runit[1]*a[2] - runit[2]*a[1];
-	b[1] = runit[2]*a[0] - runit[0]*a[2];
-	b[2] = runit[0]*a[1] - runit[1]*a[0];
-	disp[0] = a[0]*cosine  + b[0]*sine;
-	disp[1] = a[1]*cosine  + b[1]*sine;
-	disp[2] = a[2]*cosine  + b[2]*sine;
-
-	x[i][0] = point[0] + c[0] + disp[0];
-	x[i][1] = point[1] + c[1] + disp[1];
-	x[i][2] = point[2] + c[2] + disp[2];
-	v[i][0] = omega_rotate * (runit[1]*disp[2] - runit[2]*disp[1]);
-	v[i][1] = omega_rotate * (runit[2]*disp[0] - runit[0]*disp[2]);
-	v[i][2] = omega_rotate * (runit[0]*disp[1] - runit[1]*disp[0]);
-	if (omega_flag) {
-	  omega[i][0] = omega_rotate*runit[0];
-	  omega[i][1] = omega_rotate*runit[1];
-	  omega[i][2] = omega_rotate*runit[2];
-	}
-
-	domain->remap_near(x[i],xold);
+        xold[0] = x[i][0];
+        xold[1] = x[i][1];
+        xold[2] = x[i][2];
+
+        d[0] = xoriginal[i][0] - point[0];
+        d[1] = xoriginal[i][1] - point[1];
+        d[2] = xoriginal[i][2] - point[2];
+        ddotr = d[0]*runit[0] + d[1]*runit[1] + d[2]*runit[2];
+        c[0] = ddotr*runit[0];
+        c[1] = ddotr*runit[1];
+        c[2] = ddotr*runit[2];
+        a[0] = d[0] - c[0];
+        a[1] = d[1] - c[1];
+        a[2] = d[2] - c[2];
+        b[0] = runit[1]*a[2] - runit[2]*a[1];
+        b[1] = runit[2]*a[0] - runit[0]*a[2];
+        b[2] = runit[0]*a[1] - runit[1]*a[0];
+        disp[0] = a[0]*cosine  + b[0]*sine;
+        disp[1] = a[1]*cosine  + b[1]*sine;
+        disp[2] = a[2]*cosine  + b[2]*sine;
+
+        x[i][0] = point[0] + c[0] + disp[0];
+        x[i][1] = point[1] + c[1] + disp[1];
+        x[i][2] = point[2] + c[2] + disp[2];
+        v[i][0] = omega_rotate * (runit[1]*disp[2] - runit[2]*disp[1]);
+        v[i][1] = omega_rotate * (runit[2]*disp[0] - runit[0]*disp[2]);
+        v[i][2] = omega_rotate * (runit[0]*disp[1] - runit[1]*disp[0]);
+        if (omega_flag) {
+          omega[i][0] = omega_rotate*runit[0];
+          omega[i][1] = omega_rotate*runit[1];
+          omega[i][2] = omega_rotate*runit[2];
+        }
+
+        domain->remap_near(x[i],xold);
       }
     }
 
@@ -568,12 +568,12 @@ void FixMove::initial_integrate(int vflag)
     if ((displaceflag || velocityflag) && nlocal > maxatom) {
       maxatom = atom->nmax;
       if (displaceflag) {
-	memory->destroy(displace);
-	memory->create(displace,maxatom,3,"move:displace");
+        memory->destroy(displace);
+        memory->create(displace,maxatom,3,"move:displace");
       }
       if (velocityflag) {
-	memory->destroy(velocity);
-	memory->create(velocity,maxatom,3,"move:velocity");
+        memory->destroy(velocity);
+        memory->create(velocity,maxatom,3,"move:velocity");
       }
     }
 
@@ -584,32 +584,32 @@ void FixMove::initial_integrate(int vflag)
     if (xvarstr) {
       if (xvarstyle == EQUAL) dx = input->variable->compute_equal(xvar);
       else if (displace)
-	input->variable->compute_atom(xvar,igroup,&displace[0][0],3,0);
+        input->variable->compute_atom(xvar,igroup,&displace[0][0],3,0);
     }
     if (yvarstr) {
       if (yvarstyle == EQUAL) dy = input->variable->compute_equal(yvar);
       else if (displace)
-	input->variable->compute_atom(yvar,igroup,&displace[0][1],3,0);
+        input->variable->compute_atom(yvar,igroup,&displace[0][1],3,0);
     }
     if (zvarstr) {
       if (zvarstyle == EQUAL) dz = input->variable->compute_equal(zvar);
       else if (displace)
-	input->variable->compute_atom(zvar,igroup,&displace[0][2],3,0);
+        input->variable->compute_atom(zvar,igroup,&displace[0][2],3,0);
     }
     if (vxvarstr) {
       if (vxvarstyle == EQUAL) vx = input->variable->compute_equal(vxvar);
       else if (velocity)
-	input->variable->compute_atom(vxvar,igroup,&velocity[0][0],3,0);
+        input->variable->compute_atom(vxvar,igroup,&velocity[0][0],3,0);
     }
     if (vyvarstr) {
       if (vyvarstyle == EQUAL) vy = input->variable->compute_equal(vyvar);
       else if (velocity)
-	input->variable->compute_atom(vyvar,igroup,&velocity[0][1],3,0);
+        input->variable->compute_atom(vyvar,igroup,&velocity[0][1],3,0);
     }
     if (vzvarstr) {
       if (vzvarstyle == EQUAL) vz = input->variable->compute_equal(vzvar);
       else if (velocity)
-	input->variable->compute_atom(vzvar,igroup,&velocity[0][2],3,0);
+        input->variable->compute_atom(vzvar,igroup,&velocity[0][2],3,0);
     }
 
     modify->addstep_compute(update->ntimestep + 1);
@@ -618,101 +618,101 @@ void FixMove::initial_integrate(int vflag)
 
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	xold[0] = x[i][0];
-	xold[1] = x[i][1];
-	xold[2] = x[i][2];
-
-	if (xvarstr && vxvarstr) {
-	  if (vxvarstyle == EQUAL) v[i][0] = vx;
-	  else v[i][0] = velocity[i][0];
-	  if (xvarstyle == EQUAL) x[i][0] = xoriginal[i][0] + dx;
-	  else x[i][0] = xoriginal[i][0] + displace[i][0];
-	} else if (xvarstr) {
-	  if (xvarstyle == EQUAL) x[i][0] = xoriginal[i][0] + dx;
-	  else x[i][0] = xoriginal[i][0] + displace[i][0];
-	} else if (vxvarstr) {
-	  if (vxvarstyle == EQUAL) v[i][0] = vx;
-	  else v[i][0] = velocity[i][0];
-	  if (rmass) {
-	    dtfm = dtf / rmass[i];
-	    x[i][0] += dtv * v[i][0];
-	  } else {
-	    dtfm = dtf / mass[type[i]];
-	    x[i][0] += dtv * v[i][0];
-	  }
-	} else {
-	  if (rmass) {
-	    dtfm = dtf / rmass[i];
-	    v[i][0] += dtfm * f[i][0];
-	    x[i][0] += dtv * v[i][0];
-	  } else {
-	    dtfm = dtf / mass[type[i]];
-	    v[i][0] += dtfm * f[i][0];
-	    x[i][0] += dtv * v[i][0];
-	  }
-	}
-
-	if (yvarstr && vyvarstr) {
-	  if (vyvarstyle == EQUAL) v[i][1] = vy;
-	  else v[i][1] = velocity[i][1];
-	  if (yvarstyle == EQUAL) x[i][1] = xoriginal[i][1] + dy;
-	  else x[i][1] = xoriginal[i][1] + displace[i][1];
-	} else if (yvarstr) {
-	  if (yvarstyle == EQUAL) x[i][1] = xoriginal[i][1] + dy;
-	  else x[i][1] = xoriginal[i][1] + displace[i][1];
-	} else if (vyvarstr) {
-	  if (vyvarstyle == EQUAL) v[i][1] = vy;
-	  else v[i][1] = velocity[i][1];
-	  if (rmass) {
-	    dtfm = dtf / rmass[i];
-	    x[i][1] += dtv * v[i][1];
-	  } else {
-	    dtfm = dtf / mass[type[i]];
-	    x[i][1] += dtv * v[i][1];
-	  }
-	} else {
-	  if (rmass) {
-	    dtfm = dtf / rmass[i];
-	    v[i][1] += dtfm * f[i][1];
-	    x[i][1] += dtv * v[i][1];
-	  } else {
-	    dtfm = dtf / mass[type[i]];
-	    v[i][1] += dtfm * f[i][1];
-	    x[i][1] += dtv * v[i][1];
-	  }
-	}
-
-	if (zvarstr && vzvarstr) {
-	  if (vzvarstyle == EQUAL) v[i][2] = vz;
-	  else v[i][2] = velocity[i][2];
-	  if (zvarstyle == EQUAL) x[i][2] = xoriginal[i][2] + dz;
-	  else x[i][2] = xoriginal[i][2] + displace[i][2];
-	} else if (zvarstr) {
-	  if (zvarstyle == EQUAL) x[i][2] = xoriginal[i][2] + dz;
-	  else x[i][2] = xoriginal[i][2] + displace[i][2];
-	} else if (vzvarstr) {
-	  if (vzvarstyle == EQUAL) v[i][2] = vz;
-	  else v[i][2] = velocity[i][2];
-	  if (rmass) {
-	    dtfm = dtf / rmass[i];
-	    x[i][2] += dtv * v[i][2];
-	  } else {
-	    dtfm = dtf / mass[type[i]];
-	    x[i][2] += dtv * v[i][2];
-	  }
-	} else {
-	  if (rmass) {
-	    dtfm = dtf / rmass[i];
-	    v[i][2] += dtfm * f[i][2];
-	    x[i][2] += dtv * v[i][2];
-	  } else {
-	    dtfm = dtf / mass[type[i]];
-	    v[i][2] += dtfm * f[i][2];
-	    x[i][2] += dtv * v[i][2];
-	  }
-	}
-
-	domain->remap_near(x[i],xold);
+        xold[0] = x[i][0];
+        xold[1] = x[i][1];
+        xold[2] = x[i][2];
+
+        if (xvarstr && vxvarstr) {
+          if (vxvarstyle == EQUAL) v[i][0] = vx;
+          else v[i][0] = velocity[i][0];
+          if (xvarstyle == EQUAL) x[i][0] = xoriginal[i][0] + dx;
+          else x[i][0] = xoriginal[i][0] + displace[i][0];
+        } else if (xvarstr) {
+          if (xvarstyle == EQUAL) x[i][0] = xoriginal[i][0] + dx;
+          else x[i][0] = xoriginal[i][0] + displace[i][0];
+        } else if (vxvarstr) {
+          if (vxvarstyle == EQUAL) v[i][0] = vx;
+          else v[i][0] = velocity[i][0];
+          if (rmass) {
+            dtfm = dtf / rmass[i];
+            x[i][0] += dtv * v[i][0];
+          } else {
+            dtfm = dtf / mass[type[i]];
+            x[i][0] += dtv * v[i][0];
+          }
+        } else {
+          if (rmass) {
+            dtfm = dtf / rmass[i];
+            v[i][0] += dtfm * f[i][0];
+            x[i][0] += dtv * v[i][0];
+          } else {
+            dtfm = dtf / mass[type[i]];
+            v[i][0] += dtfm * f[i][0];
+            x[i][0] += dtv * v[i][0];
+          }
+        }
+
+        if (yvarstr && vyvarstr) {
+          if (vyvarstyle == EQUAL) v[i][1] = vy;
+          else v[i][1] = velocity[i][1];
+          if (yvarstyle == EQUAL) x[i][1] = xoriginal[i][1] + dy;
+          else x[i][1] = xoriginal[i][1] + displace[i][1];
+        } else if (yvarstr) {
+          if (yvarstyle == EQUAL) x[i][1] = xoriginal[i][1] + dy;
+          else x[i][1] = xoriginal[i][1] + displace[i][1];
+        } else if (vyvarstr) {
+          if (vyvarstyle == EQUAL) v[i][1] = vy;
+          else v[i][1] = velocity[i][1];
+          if (rmass) {
+            dtfm = dtf / rmass[i];
+            x[i][1] += dtv * v[i][1];
+          } else {
+            dtfm = dtf / mass[type[i]];
+            x[i][1] += dtv * v[i][1];
+          }
+        } else {
+          if (rmass) {
+            dtfm = dtf / rmass[i];
+            v[i][1] += dtfm * f[i][1];
+            x[i][1] += dtv * v[i][1];
+          } else {
+            dtfm = dtf / mass[type[i]];
+            v[i][1] += dtfm * f[i][1];
+            x[i][1] += dtv * v[i][1];
+          }
+        }
+
+        if (zvarstr && vzvarstr) {
+          if (vzvarstyle == EQUAL) v[i][2] = vz;
+          else v[i][2] = velocity[i][2];
+          if (zvarstyle == EQUAL) x[i][2] = xoriginal[i][2] + dz;
+          else x[i][2] = xoriginal[i][2] + displace[i][2];
+        } else if (zvarstr) {
+          if (zvarstyle == EQUAL) x[i][2] = xoriginal[i][2] + dz;
+          else x[i][2] = xoriginal[i][2] + displace[i][2];
+        } else if (vzvarstr) {
+          if (vzvarstyle == EQUAL) v[i][2] = vz;
+          else v[i][2] = velocity[i][2];
+          if (rmass) {
+            dtfm = dtf / rmass[i];
+            x[i][2] += dtv * v[i][2];
+          } else {
+            dtfm = dtf / mass[type[i]];
+            x[i][2] += dtv * v[i][2];
+          }
+        } else {
+          if (rmass) {
+            dtfm = dtf / rmass[i];
+            v[i][2] += dtfm * f[i][2];
+            x[i][2] += dtv * v[i][2];
+          } else {
+            dtfm = dtf / mass[type[i]];
+            v[i][2] += dtfm * f[i][2];
+            x[i][2] += dtv * v[i][2];
+          }
+        }
+
+        domain->remap_near(x[i],xold);
       }
     }
   }
@@ -755,31 +755,31 @@ void FixMove::final_integrate()
   for (int i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
       if (xflag)
-	if (rmass) {
-	  dtfm = dtf / rmass[i];
-	  v[i][0] += dtfm * f[i][0];
-	} else {
-	  dtfm = dtf / mass[type[i]];
-	  v[i][0] += dtfm * f[i][0];
-	}
-      
+        if (rmass) {
+          dtfm = dtf / rmass[i];
+          v[i][0] += dtfm * f[i][0];
+        } else {
+          dtfm = dtf / mass[type[i]];
+          v[i][0] += dtfm * f[i][0];
+        }
+
       if (yflag)
-	if (rmass) {
-	  dtfm = dtf / rmass[i];
-	  v[i][1] += dtfm * f[i][1];
-	} else {
-	  dtfm = dtf / mass[type[i]];
-	  v[i][1] += dtfm * f[i][1];
-	}
-      
+        if (rmass) {
+          dtfm = dtf / rmass[i];
+          v[i][1] += dtfm * f[i][1];
+        } else {
+          dtfm = dtf / mass[type[i]];
+          v[i][1] += dtfm * f[i][1];
+        }
+
       if (zflag)
-	if (rmass) {
-	  dtfm = dtf / rmass[i];
-	  v[i][2] += dtfm * f[i][2];
-	} else {
-	  dtfm = dtf / mass[type[i]];
-	  v[i][2] += dtfm * f[i][2];
-	}
+        if (rmass) {
+          dtfm = dtf / rmass[i];
+          v[i][2] += dtfm * f[i][2];
+        } else {
+          dtfm = dtf / mass[type[i]];
+          v[i][2] += dtfm * f[i][2];
+        }
     }
   }
 }
@@ -814,7 +814,7 @@ double FixMove::memory_usage()
 }
 
 /* ----------------------------------------------------------------------
-   pack entire state of Fix into one write 
+   pack entire state of Fix into one write
 ------------------------------------------------------------------------- */
 
 void FixMove::write_restart(FILE *fp)
@@ -831,7 +831,7 @@ void FixMove::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix 
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixMove::restart(char *buf)
@@ -917,7 +917,7 @@ void FixMove::set_arrays(int i)
     c[0] = ddotr*runit[0];
     c[1] = ddotr*runit[1];
     c[2] = ddotr*runit[2];
-    
+
     a[0] = d[0] - c[0];
     a[1] = d[1] - c[1];
     a[2] = d[2] - c[2];
@@ -927,7 +927,7 @@ void FixMove::set_arrays(int i)
     disp[0] = a[0]*cosine  + b[0]*sine;
     disp[1] = a[1]*cosine  + b[1]*sine;
     disp[2] = a[2]*cosine  + b[2]*sine;
-    
+
     xoriginal[i][0] = point[0] + c[0] + disp[0];
     xoriginal[i][1] = point[1] + c[1] + disp[1];
     xoriginal[i][2] = point[2] + c[2] + disp[2];
diff --git a/src/fix_move.h b/src/fix_move.h
index 632839340e..118a617ecd 100644
--- a/src/fix_move.h
+++ b/src/fix_move.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp
index 1e4a4de236..6548045ff4 100644
--- a/src/fix_nh.cpp
+++ b/src/fix_nh.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -46,7 +46,7 @@ enum{NONE,XYZ,XY,YZ,XZ};
 enum{ISO,ANISO,TRICLINIC};
 
 /* ----------------------------------------------------------------------
-   NVT,NPH,NPT integrators for improved Nose-Hoover equations of motion 
+   NVT,NPH,NPT integrators for improved Nose-Hoover equations of motion
  ---------------------------------------------------------------------- */
 
 FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
@@ -93,7 +93,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
   fixedpoint[1] = 0.5*(domain->boxlo[1]+domain->boxhi[1]);
   fixedpoint[2] = 0.5*(domain->boxlo[2]+domain->boxhi[2]);
 
-  // used by FixNVTSllod to preserve non-default value  
+  // used by FixNVTSllod to preserve non-default value
 
   mtchain_default_flag = 1;
 
@@ -119,8 +119,8 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       t_stop = atof(arg[iarg+2]);
       t_period = atof(arg[iarg+3]);
       if (t_start < 0.0 || t_stop <= 0.0)
-	error->all(FLERR,
-		   "Target temperature for fix nvt/npt/nph cannot be 0.0");
+        error->all(FLERR,
+                   "Target temperature for fix nvt/npt/nph cannot be 0.0");
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"iso") == 0) {
@@ -131,10 +131,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
       p_flag[0] = p_flag[1] = p_flag[2] = 1;
       if (dimension == 2) {
-	p_start[2] = p_stop[2] = p_period[2] = 0.0;
-	p_flag[2] = 0;
+        p_start[2] = p_stop[2] = p_period[2] = 0.0;
+        p_flag[2] = 0;
       }
-      iarg += 4; 
+      iarg += 4;
     } else if (strcmp(arg[iarg],"aniso") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       pcouple = NONE;
@@ -143,8 +143,8 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
       p_flag[0] = p_flag[1] = p_flag[2] = 1;
       if (dimension == 2) {
-	p_start[2] = p_stop[2] = p_period[2] = 0.0;
-	p_flag[2] = 0;
+        p_start[2] = p_stop[2] = p_period[2] = 0.0;
+        p_flag[2] = 0;
       }
       iarg += 4;
     } else if (strcmp(arg[iarg],"tri") == 0) {
@@ -160,12 +160,12 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[3] = p_period[4] = p_period[5] = atof(arg[iarg+3]);
       p_flag[3] = p_flag[4] = p_flag[5] = 1;
       if (dimension == 2) {
-	p_start[2] = p_stop[2] = p_period[2] = 0.0;
-	p_flag[2] = 0;
-	p_start[3] = p_stop[3] = p_period[3] = 0.0;
-	p_flag[3] = 0;
-	p_start[4] = p_stop[4] = p_period[4] = 0.0;
-	p_flag[4] = 0;
+        p_start[2] = p_stop[2] = p_period[2] = 0.0;
+        p_flag[2] = 0;
+        p_start[3] = p_stop[3] = p_period[3] = 0.0;
+        p_flag[3] = 0;
+        p_start[4] = p_stop[4] = p_period[4] = 0.0;
+        p_flag[4] = 0;
       }
       iarg += 4;
     } else if (strcmp(arg[iarg],"x") == 0) {
@@ -175,7 +175,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[0] = atof(arg[iarg+3]);
       p_flag[0] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
     } else if (strcmp(arg[iarg],"y") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[1] = atof(arg[iarg+1]);
@@ -183,7 +183,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[1] = atof(arg[iarg+3]);
       p_flag[1] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
     } else if (strcmp(arg[iarg],"z") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       p_start[2] = atof(arg[iarg+1]);
@@ -191,9 +191,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[2] = atof(arg[iarg+3]);
       p_flag[2] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
       if (dimension == 2)
-	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
+        error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
 
     } else if (strcmp(arg[iarg],"yz") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
@@ -203,9 +203,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[3] = atof(arg[iarg+3]);
       p_flag[3] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
       if (dimension == 2)
-	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
+        error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xz") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       scalexz = 0;
@@ -214,9 +214,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[4] = atof(arg[iarg+3]);
       p_flag[4] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
       if (dimension == 2)
-	error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
+        error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation");
     } else if (strcmp(arg[iarg],"xy") == 0) {
       scalexy = 0;
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
@@ -225,7 +225,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       p_period[5] = atof(arg[iarg+3]);
       p_flag[5] = 1;
       deviatoric_flag = 1;
-      iarg += 4; 
+      iarg += 4;
 
     } else if (strcmp(arg[iarg],"couple") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
@@ -246,21 +246,21 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       if (strcmp(arg[iarg+1],"all") == 0) allremap = 1;
       else {
-	allremap = 0;
-	delete [] id_dilate;
-	int n = strlen(arg[iarg+2]) + 1;
-	id_dilate = new char[n];
-	strcpy(id_dilate,arg[iarg+2]);
-	int idilate = group->find(id_dilate);
-	if (idilate == -1) 
-	  error->all(FLERR,"Fix nvt/npt/nph dilate group ID does not exist"); 
+        allremap = 0;
+        delete [] id_dilate;
+        int n = strlen(arg[iarg+2]) + 1;
+        id_dilate = new char[n];
+        strcpy(id_dilate,arg[iarg+2]);
+        int idilate = group->find(id_dilate);
+        if (idilate == -1)
+          error->all(FLERR,"Fix nvt/npt/nph dilate group ID does not exist");
       }
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"tchain") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       mtchain = atoi(arg[iarg+1]);
-      // used by FixNVTSllod to preserve non-default value  
+      // used by FixNVTSllod to preserve non-default value
       mtchain_default_flag = 0;
       if (mtchain < 1) error->all(FLERR,"Illegal fix nvt/npt/nph command");
       iarg += 2;
@@ -350,66 +350,66 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 
   if (p_flag[3] && domain->zperiodic == 0)
     error->all(FLERR,
-	       "Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
+               "Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
   if (p_flag[4] && domain->zperiodic == 0)
     error->all(FLERR,
-	       "Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
+               "Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
   if (p_flag[5] && domain->yperiodic == 0)
     error->all(FLERR,
-	       "Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
+               "Cannot use fix nvt/npt/nph on a 2nd non-periodic dimension");
 
   if (scaleyz == 1 && domain->zperiodic == 0)
     error->all(FLERR,"Cannot use fix nvt/npt/nph "
-	       "with yz dynamics when z is non-periodic dimension");
+               "with yz dynamics when z is non-periodic dimension");
   if (scalexz == 1 && domain->zperiodic == 0)
     error->all(FLERR,"Cannot use fix nvt/npt/nph "
-	       "with xz dynamics when z is non-periodic dimension");
+               "with xz dynamics when z is non-periodic dimension");
   if (scalexy == 1 && domain->yperiodic == 0)
     error->all(FLERR,"Cannot use fix nvt/npt/nph "
-	       "with xy dynamics when y is non-periodic dimension");
+               "with xy dynamics when y is non-periodic dimension");
 
   if (p_flag[3] && scaleyz == 1)
     error->all(FLERR,"Cannot use fix nvt/npt/nph with "
-	       "both yz dynamics and yz scaling");
+               "both yz dynamics and yz scaling");
   if (p_flag[4] && scalexz == 1)
     error->all(FLERR,"Cannot use fix nvt/npt/nph with "
-	       "both xz dynamics and xz scaling");
+               "both xz dynamics and xz scaling");
   if (p_flag[5] && scalexy == 1)
     error->all(FLERR,"Cannot use fix nvt/npt/nph with "
-	       "both xy dynamics and xy scaling");
+               "both xy dynamics and xy scaling");
 
-  if (!domain->triclinic && (p_flag[3] || p_flag[4] || p_flag[5])) 
+  if (!domain->triclinic && (p_flag[3] || p_flag[4] || p_flag[5]))
     error->all(FLERR,"Can not specify Pxy/Pxz/Pyz in "
-	       "fix nvt/npt/nph with non-triclinic box");
+               "fix nvt/npt/nph with non-triclinic box");
 
   if (pcouple == XYZ && dimension == 3 &&
-      (p_start[0] != p_start[1] || p_start[0] != p_start[2] || 
-       p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] || 
+      (p_start[0] != p_start[1] || p_start[0] != p_start[2] ||
+       p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] ||
        p_period[0] != p_period[1] || p_period[0] != p_period[2]))
     error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
   if (pcouple == XYZ && dimension == 2 &&
-      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
+      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] ||
        p_period[0] != p_period[1]))
     error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
-  if (pcouple == XY && 
-      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
+  if (pcouple == XY &&
+      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] ||
        p_period[0] != p_period[1]))
     error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
-  if (pcouple == YZ && 
+  if (pcouple == YZ &&
       (p_start[1] != p_start[2] || p_stop[1] != p_stop[2] ||
        p_period[1] != p_period[2]))
     error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
-  if (pcouple == XZ && 
+  if (pcouple == XZ &&
       (p_start[0] != p_start[2] || p_stop[0] != p_stop[2] ||
        p_period[0] != p_period[2]))
     error->all(FLERR,"Invalid fix nvt/npt/nph pressure settings");
 
-  if ((tstat_flag && t_period <= 0.0) || 
-      (p_flag[0] && p_period[0] <= 0.0) || 
-      (p_flag[1] && p_period[1] <= 0.0) || 
+  if ((tstat_flag && t_period <= 0.0) ||
+      (p_flag[0] && p_period[0] <= 0.0) ||
+      (p_flag[1] && p_period[1] <= 0.0) ||
       (p_flag[2] && p_period[2] <= 0.0) ||
-      (p_flag[3] && p_period[3] <= 0.0) || 
-      (p_flag[4] && p_period[4] <= 0.0) || 
+      (p_flag[3] && p_period[3] <= 0.0) ||
+      (p_flag[4] && p_period[4] <= 0.0) ||
       (p_flag[5] && p_period[5] <= 0.0))
     error->all(FLERR,"Fix nvt/npt/nph damping parameters must be > 0.0");
 
@@ -483,7 +483,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
     if (pstyle == ISO) size_vector += 2*2*1;
     else if (pstyle == ANISO) size_vector += 2*2*3;
     else if (pstyle == TRICLINIC) size_vector += 2*2*6;
-    
+
     if (mpchain) {
       int ich;
       etap = new double[mpchain];
@@ -494,8 +494,8 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
       etap_dot[mpchain] = 0.0;
       etap_dotdot = new double[mpchain];
       for (ich = 0; ich < mpchain; ich++) {
-	etap[ich] = etap_dot[ich] = 
-	  etap_dotdot[ich] = 0.0;
+        etap[ich] = etap_dot[ich] =
+          etap_dotdot[ich] = 0.0;
       }
       etap_mass = new double[mpchain];
       size_vector += 2*2*mpchain;
@@ -515,9 +515,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
 
   vol0 = t0 = 0.0;
 }
-  
+
 /* ---------------------------------------------------------------------- */
-  
+
 FixNH::~FixNH()
 {
   delete [] id_dilate;
@@ -571,28 +571,28 @@ void FixNH::init()
 
   if (allremap == 0) {
     int idilate = group->find(id_dilate);
-    if (idilate == -1) 
-      error->all(FLERR,"Fix nvt/npt/nph dilate group ID does not exist"); 
+    if (idilate == -1)
+      error->all(FLERR,"Fix nvt/npt/nph dilate group ID does not exist");
     dilate_group_bit = group->bitmask[idilate];
   }
-  
+
   // ensure no conflict with fix deform
 
   if (pstat_flag)
     for (int i = 0; i < modify->nfix; i++)
       if (strcmp(modify->fix[i]->style,"deform") == 0) {
-	int *dimflag = ((FixDeform *) modify->fix[i])->dimflag;
-	if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || 
-	    (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) || 
-	    (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
-	  error->all(FLERR,"Cannot use fix npt and fix deform on "
-		     "same component of stress tensor");
+        int *dimflag = ((FixDeform *) modify->fix[i])->dimflag;
+        if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
+            (p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) ||
+            (p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
+          error->all(FLERR,"Cannot use fix npt and fix deform on "
+                     "same component of stress tensor");
       }
 
   // set temperature and pressure ptrs
 
   int icompute = modify->find_compute(id_temp);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Temperature ID for fix nvt/nph/npt does not exist");
   temperature = modify->compute[icompute];
 
@@ -601,7 +601,7 @@ void FixNH::init()
 
   if (pstat_flag) {
     icompute = modify->find_compute(id_press);
-    if (icompute < 0) 
+    if (icompute < 0)
       error->all(FLERR,"Pressure ID for fix npt/nph does not exist");
     pressure = modify->compute[icompute];
   }
@@ -677,7 +677,7 @@ void FixNH::init()
 }
 
 /* ----------------------------------------------------------------------
-   compute T,P before integrator starts 
+   compute T,P before integrator starts
 ------------------------------------------------------------------------- */
 
 void FixNH::setup(int vflag)
@@ -687,7 +687,7 @@ void FixNH::setup(int vflag)
   tdof = temperature->dof;
 
   // t_target is needed by NPH and NPT in compute_scalar()
-  // If no thermostat or using fix nphug, 
+  // If no thermostat or using fix nphug,
   // t_target must be defined by other means.
 
   if (tstat_flag && strcmp(style,"nphug") != 0) {
@@ -703,8 +703,8 @@ void FixNH::setup(int vflag)
     if (t0 == 0.0) {
       t0 = temperature->compute_scalar();
       if (t0 == 0.0) {
-	if (strcmp(update->unit_style,"lj") == 0) t0 = 1.0;
-	else t0 = 300.0;
+        if (strcmp(update->unit_style,"lj") == 0) t0 = 1.0;
+        else t0 = 300.0;
       }
     }
     t_target = t0;
@@ -728,7 +728,7 @@ void FixNH::setup(int vflag)
       eta_mass[ich] = boltz * t_target / (t_freq*t_freq);
     for (int ich = 1; ich < mtchain; ich++) {
       eta_dotdot[ich] = (eta_mass[ich-1]*eta_dot[ich-1]*eta_dot[ich-1] -
-			 boltz * t_target) / eta_mass[ich];
+                         boltz * t_target) / eta_mass[ich];
     }
   }
 
@@ -740,11 +740,11 @@ void FixNH::setup(int vflag)
 
     for (int i = 0; i < 3; i++)
       if (p_flag[i])
-	omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
+        omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
 
     if (pstyle == TRICLINIC) {
       for (int i = 3; i < 6; i++)
-	if (p_flag[i]) omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
+        if (p_flag[i]) omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
     }
 
   // masses and initial forces on barostat thermostat variables
@@ -752,18 +752,18 @@ void FixNH::setup(int vflag)
     if (mpchain) {
       etap_mass[0] = boltz * t_target / (p_freq_max*p_freq_max);
       for (int ich = 1; ich < mpchain; ich++)
-	etap_mass[ich] = boltz * t_target / (p_freq_max*p_freq_max);
+        etap_mass[ich] = boltz * t_target / (p_freq_max*p_freq_max);
       for (int ich = 1; ich < mpchain; ich++)
-	etap_dotdot[ich] = 
-	  (etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] -
-	   boltz * t_target) / etap_mass[ich];
+        etap_dotdot[ich] =
+          (etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] -
+           boltz * t_target) / etap_mass[ich];
     }
 
   }
 }
 
 /* ----------------------------------------------------------------------
-   1st half of Verlet update 
+   1st half of Verlet update
 ------------------------------------------------------------------------- */
 
 void FixNH::initial_integrate(int vflag)
@@ -819,7 +819,7 @@ void FixNH::initial_integrate(int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   2nd half of Verlet update 
+   2nd half of Verlet update
 ------------------------------------------------------------------------- */
 
 void FixNH::final_integrate()
@@ -865,7 +865,7 @@ void FixNH::initial_integrate_respa(int vflag, int ilevel, int iloop)
   if (ilevel == nlevels_respa-1) {
 
     // update eta_press_dot
-    
+
     if (pstat_flag && mpchain) nhc_press_integrate();
 
     // update eta_dot
@@ -881,16 +881,16 @@ void FixNH::initial_integrate_respa(int vflag, int ilevel, int iloop)
 
     if (pstat_flag) {
       if (pstyle == ISO) {
-	temperature->compute_scalar();
-	pressure->compute_scalar();
+        temperature->compute_scalar();
+        pressure->compute_scalar();
       } else {
-       	temperature->compute_vector();
-	pressure->compute_vector();
+               temperature->compute_vector();
+        pressure->compute_vector();
       }
       couple();
       pressure->addstep(update->ntimestep+1);
     }
-    
+
     if (pstat_flag) {
       compute_press_target();
       nh_omega_dot();
@@ -910,10 +910,10 @@ void FixNH::initial_integrate_respa(int vflag, int ilevel, int iloop)
     if (pstat_flag) remap();
   }
 
-  // if barostat, redo KSpace coeffs at outermost level, 
+  // if barostat, redo KSpace coeffs at outermost level,
   // since volume has changed
 
-  if (ilevel == nlevels_respa-1 && kspace_flag && pstat_flag) 
+  if (ilevel == nlevels_respa-1 && kspace_flag && pstat_flag)
     force->kspace->setup();
 }
 
@@ -961,9 +961,9 @@ void FixNH::couple()
     p_current[1] = tensor[1];
     p_current[2] = tensor[2];
   }
-  
-  // switch order from xy-xz-yz to Voigt 
-  
+
+  // switch order from xy-xz-yz to Voigt
+
   if (pstyle == TRICLINIC) {
     p_current[3] = tensor[5];
     p_current[4] = tensor[4];
@@ -998,7 +998,7 @@ void FixNH::remap()
   else {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & dilate_group_bit)
-	domain->x2lamda(x[i],x[i]);
+        domain->x2lamda(x[i],x[i]);
   }
 
   if (nrigid)
@@ -1008,16 +1008,16 @@ void FixNH::remap()
   // reset global and local box to new size/shape
 
   // this operation corresponds to applying the
-  // translate and scale operations 
+  // translate and scale operations
   // corresponding to the solution of the following ODE:
   //
   // h_dot = omega_dot * h
   //
   // where h_dot, omega_dot and h are all upper-triangular
-  // 3x3 tensors. In Voigt notation, the elements of the 
+  // 3x3 tensors. In Voigt notation, the elements of the
   // RHS product tensor are:
   // h_dot = [0*0, 1*1, 2*2, 1*3+3*2, 0*4+5*3+4*2, 0*5+5*1]
-  // 
+  //
   // Ordering of operations preserves time symmetry.
 
   double dto2 = dto/2.0;
@@ -1031,28 +1031,28 @@ void FixNH::remap()
     if (p_flag[4]) {
       expfac = exp(dto8*omega_dot[0]);
       h[4] *= expfac;
-      h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); 
+      h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
       h[4] *= expfac;
     }
 
     if (p_flag[3]) {
       expfac = exp(dto4*omega_dot[1]);
       h[3] *= expfac;
-      h[3] += dto2*(omega_dot[3]*h[2]); 
+      h[3] += dto2*(omega_dot[3]*h[2]);
       h[3] *= expfac;
     }
 
     if (p_flag[5]) {
       expfac = exp(dto4*omega_dot[0]);
       h[5] *= expfac;
-      h[5] += dto2*(omega_dot[5]*h[1]); 
+      h[5] += dto2*(omega_dot[5]*h[1]);
       h[5] *= expfac;
     }
 
     if (p_flag[4]) {
       expfac = exp(dto8*omega_dot[0]);
       h[4] *= expfac;
-      h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); 
+      h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
       h[4] *= expfac;
     }
   }
@@ -1094,28 +1094,28 @@ void FixNH::remap()
     if (p_flag[4]) {
       expfac = exp(dto8*omega_dot[0]);
       h[4] *= expfac;
-      h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); 
+      h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
       h[4] *= expfac;
     }
 
     if (p_flag[3]) {
       expfac = exp(dto4*omega_dot[1]);
       h[3] *= expfac;
-      h[3] += dto2*(omega_dot[3]*h[2]); 
+      h[3] += dto2*(omega_dot[3]*h[2]);
       h[3] *= expfac;
     }
 
     if (p_flag[5]) {
       expfac = exp(dto4*omega_dot[0]);
       h[5] *= expfac;
-      h[5] += dto2*(omega_dot[5]*h[1]); 
+      h[5] += dto2*(omega_dot[5]*h[1]);
       h[5] *= expfac;
     }
 
     if (p_flag[4]) {
       expfac = exp(dto8*omega_dot[0]);
       h[4] *= expfac;
-      h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]); 
+      h[4] += dto4*(omega_dot[5]*h[3]+omega_dot[4]*h[2]);
       h[4] *= expfac;
     }
 
@@ -1127,14 +1127,14 @@ void FixNH::remap()
 
   // tilt factor to cell length ratio can not exceed TILTMAX in one step
 
-  if (domain->yz < -TILTMAX*domain->yprd || 
+  if (domain->yz < -TILTMAX*domain->yprd ||
       domain->yz > TILTMAX*domain->yprd ||
-      domain->xz < -TILTMAX*domain->xprd || 
+      domain->xz < -TILTMAX*domain->xprd ||
       domain->xz > TILTMAX*domain->xprd ||
-      domain->xy < -TILTMAX*domain->xprd || 
+      domain->xy < -TILTMAX*domain->xprd ||
       domain->xy > TILTMAX*domain->xprd)
     error->all(FLERR,"Fix npt/nph has tilted box too far in one step - "
-	       "periodic cell is too far from equilibrium state");
+               "periodic cell is too far from equilibrium state");
 
   domain->set_global_box();
   domain->set_local_box();
@@ -1145,7 +1145,7 @@ void FixNH::remap()
   else {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & dilate_group_bit)
-	domain->lamda2x(x[i],x[i]);
+        domain->lamda2x(x[i],x[i]);
   }
 
   if (nrigid)
@@ -1154,7 +1154,7 @@ void FixNH::remap()
 }
 
 /* ----------------------------------------------------------------------
-   pack entire state of Fix into one write 
+   pack entire state of Fix into one write
 ------------------------------------------------------------------------- */
 
 void FixNH::write_restart(FILE *fp)
@@ -1192,7 +1192,7 @@ int FixNH::size_restart_global()
 }
 
 /* ----------------------------------------------------------------------
-   pack restart data 
+   pack restart data
 ------------------------------------------------------------------------- */
 
 int FixNH::pack_restart_data(double *list)
@@ -1227,9 +1227,9 @@ int FixNH::pack_restart_data(double *list)
     list[n++] = mpchain;
     if (mpchain) {
       for (int ich = 0; ich < mpchain; ich++)
-	list[n++] = etap[ich];
+        list[n++] = etap[ich];
       for (int ich = 0; ich < mpchain; ich++)
-	list[n++] = etap_dot[ich];
+        list[n++] = etap_dot[ich];
     }
 
     list[n++] = deviatoric_flag;
@@ -1247,7 +1247,7 @@ int FixNH::pack_restart_data(double *list)
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix 
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixNH::restart(char *buf)
@@ -1259,9 +1259,9 @@ void FixNH::restart(char *buf)
     int m = static_cast<int> (list[n++]);
     if (tstat_flag && m == mtchain) {
       for (int ich = 0; ich < mtchain; ich++)
-	eta[ich] = list[n++];
+        eta[ich] = list[n++];
       for (int ich = 0; ich < mtchain; ich++)
-	eta_dot[ich] = list[n++];
+        eta_dot[ich] = list[n++];
     } else n += 2*m;
   }
   flag = static_cast<int> (list[n++]);
@@ -1283,9 +1283,9 @@ void FixNH::restart(char *buf)
     int m = static_cast<int> (list[n++]);
     if (pstat_flag && m == mpchain) {
       for (int ich = 0; ich < mpchain; ich++)
-	etap[ich] = list[n++];
+        etap[ich] = list[n++];
       for (int ich = 0; ich < mpchain; ich++)
-	etap_dot[ich] = list[n++];
+        etap_dot[ich] = list[n++];
     } else n+=2*m;
     flag = static_cast<int> (list[n++]);
     if (flag) {
@@ -1315,13 +1315,13 @@ int FixNH::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(arg[1]);
-    if (icompute < 0) 
+    if (icompute < 0)
       error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
       error->all(FLERR,
-		 "Fix_modify temperature ID does not compute temperature");
+                 "Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != 0 && comm->me == 0)
       error->warning(FLERR,"Temperature for fix modify is not for group all");
 
@@ -1329,8 +1329,8 @@ int FixNH::modify_param(int narg, char **arg)
 
     if (pstat_flag) {
       icompute = modify->find_compute(id_press);
-      if (icompute < 0) 
-	error->all(FLERR,"Pressure ID for fix modify does not exist");
+      if (icompute < 0)
+        error->all(FLERR,"Pressure ID for fix modify does not exist");
       modify->compute[icompute]->reset_extra_compute_fix(id_temp);
     }
 
@@ -1382,7 +1382,7 @@ double FixNH::compute_scalar()
   //       M = mtchain
   //       p_eta_k = Q_k*eta_dot[k-1]
   //       Q_1 = L*k*T/t_freq^2
-  //       Q_k = k*T/t_freq^2, k > 1 
+  //       Q_k = k*T/t_freq^2, k > 1
 
   if (tstat_flag) {
     energy += ke_target * eta[0] + 0.5*eta_mass[0]*eta_dot[0]*eta_dot[0];
@@ -1398,16 +1398,16 @@ double FixNH::compute_scalar()
   //       W = N*k*T/p_freq^2
   //       sum is over barostatted dimensions
 
-  if (pstat_flag) { 
+  if (pstat_flag) {
     for (i = 0; i < 3; i++)
       if (p_flag[i])
-	energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i] +
-	  p_hydro*(volume-vol0) / (pdim*nktv2p);
+        energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i] +
+          p_hydro*(volume-vol0) / (pdim*nktv2p);
 
     if (pstyle == TRICLINIC) {
       for (i = 3; i < 6; i++)
-	if (p_flag[i])
-	  energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i]; 
+        if (p_flag[i])
+          energy += 0.5*omega_dot[i]*omega_dot[i]*omega_mass[i];
     }
 
     // extra contributions from thermostat chain for barostat
@@ -1415,8 +1415,8 @@ double FixNH::compute_scalar()
     if (mpchain) {
       energy += lkt_press * etap[0] + 0.5*etap_mass[0]*etap_dot[0]*etap_dot[0];
       for (ich = 1; ich < mpchain; ich++)
-	energy += kt * etap[ich] + 
-	  0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
+        energy += kt * etap[ich] +
+          0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
     }
 
     // extra contribution from strain energy
@@ -1442,7 +1442,7 @@ double FixNH::compute_vector(int n)
 {
   int ilen;
 
-  if (tstat_flag) { 
+  if (tstat_flag) {
     ilen = mtchain;
     if (n < ilen) return eta[n];
     n -= ilen;
@@ -1451,7 +1451,7 @@ double FixNH::compute_vector(int n)
     n -= ilen;
   }
 
-  if (pstat_flag) { 
+  if (pstat_flag) {
     if (pstyle == ISO) {
       ilen = 1;
       if (n < ilen) return omega[n];
@@ -1465,7 +1465,7 @@ double FixNH::compute_vector(int n)
       if (n < ilen) return omega[n];
       n -= ilen;
     }
-    
+
     if (pstyle == ISO) {
       ilen = 1;
       if (n < ilen) return omega_dot[n];
@@ -1479,7 +1479,7 @@ double FixNH::compute_vector(int n)
       if (n < ilen) return omega_dot[n];
       n -= ilen;
     }
-    
+
     if (mpchain) {
       ilen = mpchain;
       if (n < ilen) return etap[n];
@@ -1497,88 +1497,88 @@ double FixNH::compute_vector(int n)
   if (dimension == 3) volume = domain->xprd * domain->yprd * domain->zprd;
   else volume = domain->xprd * domain->yprd;
 
-  if (tstat_flag) { 
+  if (tstat_flag) {
     ilen = mtchain;
-    if (n < ilen) { 
+    if (n < ilen) {
       ich = n;
       if (ich == 0)
-	return ke_target * eta[0];
+        return ke_target * eta[0];
       else
-	return kt * eta[ich];
+        return kt * eta[ich];
     }
     n -= ilen;
     ilen = mtchain;
     if (n < ilen) {
       ich = n;
       if (ich == 0)
-	return 0.5*eta_mass[0]*eta_dot[0]*eta_dot[0];
+        return 0.5*eta_mass[0]*eta_dot[0]*eta_dot[0];
       else
-	return 0.5*eta_mass[ich]*eta_dot[ich]*eta_dot[ich];
+        return 0.5*eta_mass[ich]*eta_dot[ich]*eta_dot[ich];
     }
     n -= ilen;
   }
 
-  if (pstat_flag) { 
+  if (pstat_flag) {
     if (pstyle == ISO) {
       ilen = 1;
-      if (n < ilen) 
-	return p_hydro*(volume-vol0) / nktv2p;
+      if (n < ilen)
+        return p_hydro*(volume-vol0) / nktv2p;
       n -= ilen;
     } else if (pstyle == ANISO) {
       ilen = 3;
-      if (n < ilen) 
-	if (p_flag[n])
-	  return p_hydro*(volume-vol0) / (pdim*nktv2p);
-	else
-	  return 0.0;
+      if (n < ilen)
+        if (p_flag[n])
+          return p_hydro*(volume-vol0) / (pdim*nktv2p);
+        else
+          return 0.0;
       n -= ilen;
     } else {
       ilen = 6;
       if (n < ilen)
-	if (n > 2) return 0.0;
-	else if (p_flag[n])
-	  return p_hydro*(volume-vol0) / (pdim*nktv2p);
-	else
-	  return 0.0;
+        if (n > 2) return 0.0;
+        else if (p_flag[n])
+          return p_hydro*(volume-vol0) / (pdim*nktv2p);
+        else
+          return 0.0;
       n -= ilen;
     }
-    
+
     if (pstyle == ISO) {
       ilen = 1;
-      if (n < ilen) 
-	return pdim*0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
+      if (n < ilen)
+        return pdim*0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
       n -= ilen;
     } else if (pstyle == ANISO) {
       ilen = 3;
-      if (n < ilen) 
-	if (p_flag[n])
-	  return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
-	else return 0.0;
+      if (n < ilen)
+        if (p_flag[n])
+          return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
+        else return 0.0;
       n -= ilen;
     } else {
       ilen = 6;
       if (n < ilen)
-	if (p_flag[n])
-	  return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
-	else return 0.0;
+        if (p_flag[n])
+          return 0.5*omega_dot[n]*omega_dot[n]*omega_mass[n];
+        else return 0.0;
       n -= ilen;
     }
-    
+
     if (mpchain) {
       ilen = mpchain;
       if (n < ilen) {
-	ich = n;
-	if (ich == 0) return lkt_press * etap[0];
-	else return kt * etap[ich];
+        ich = n;
+        if (ich == 0) return lkt_press * etap[0];
+        else return kt * etap[ich];
       }
       n -= ilen;
       ilen = mpchain;
       if (n < ilen) {
-	ich = n;
-	if (ich == 0)
-	  return 0.5*etap_mass[0]*etap_dot[0]*etap_dot[0];
-	else
-	  return 0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
+        ich = n;
+        if (ich == 0)
+          return 0.5*etap_mass[0]*etap_dot[0]*etap_dot[0];
+        else
+          return 0.5*etap_mass[ich]*etap_dot[ich]*etap_dot[ich];
       }
       n -= ilen;
     }
@@ -1586,7 +1586,7 @@ double FixNH::compute_vector(int n)
     if (deviatoric_flag) {
       ilen = 1;
       if (n < ilen)
-	return compute_strain_energy();
+        return compute_strain_energy();
       n -= ilen;
     }
   }
@@ -1613,13 +1613,13 @@ void FixNH::reset_dt()
   dto = dthalf;
 
   // If using respa, then remap is performed in innermost level
-  
+
   if (strstr(update->integrate_style,"respa"))
     dto = 0.5*step_respa[0];
 
   if (pstat_flag)
     pdrag_factor = 1.0 - (update->dt * p_freq_max * drag / nc_pchain);
-  
+
   if (tstat_flag)
     tdrag_factor = 1.0 - (update->dt * t_freq * drag / nc_tchain);
 }
@@ -1633,7 +1633,7 @@ void *FixNH::extract(const char *str, int &dim)
   dim=0;
   if (strcmp(str,"t_target") == 0) {
     return &t_target;
-  } 
+  }
   return NULL;
 }
 
@@ -1649,7 +1649,7 @@ void FixNH::nhc_temp_integrate()
 
   // Update masses, to preserve initial freq, if flag set
 
-  if (eta_mass_flag) { 
+  if (eta_mass_flag) {
     eta_mass[0] = tdof * boltz * t_target / (t_freq*t_freq);
     for (int ich = 1; ich < mtchain; ich++)
       eta_mass[ich] = boltz * t_target / (t_freq*t_freq);
@@ -1675,12 +1675,12 @@ void FixNH::nhc_temp_integrate()
     eta_dot[0] += eta_dotdot[0] * ncfac*dt4;
     eta_dot[0] *= tdrag_factor;
     eta_dot[0] *= expfac;
-    
+
     factor_eta = exp(-ncfac*dthalf*eta_dot[0]);
     nh_v_temp();
 
     // rescale temperature due to velocity scaling
-    // should not be necessary to explicitly recompute the temperature 
+    // should not be necessary to explicitly recompute the temperature
 
     t_current *= factor_eta*factor_eta;
     kecurrent = tdof * boltz * t_current;
@@ -1691,16 +1691,16 @@ void FixNH::nhc_temp_integrate()
 
     for (ich = 0; ich < mtchain; ich++)
       eta[ich] += ncfac*dthalf*eta_dot[ich];
-    
+
     eta_dot[0] *= expfac;
     eta_dot[0] += eta_dotdot[0] * ncfac*dt4;
     eta_dot[0] *= expfac;
-    
+
     for (ich = 1; ich < mtchain; ich++) {
       expfac = exp(-ncfac*dt8*eta_dot[ich+1]);
       eta_dot[ich] *= expfac;
-      eta_dotdot[ich] = (eta_mass[ich-1]*eta_dot[ich-1]*eta_dot[ich-1] 
-			 - boltz * t_target)/eta_mass[ich];
+      eta_dotdot[ich] = (eta_mass[ich-1]*eta_dot[ich-1]*eta_dot[ich-1]
+                         - boltz * t_target)/eta_mass[ich];
       eta_dot[ich] += eta_dotdot[ich] * ncfac*dt4;
       eta_dot[ich] *= expfac;
     }
@@ -1721,27 +1721,27 @@ void FixNH::nhc_press_integrate()
 
   // Update masses, to preserve initial freq, if flag set
 
-  if (omega_mass_flag) { 
+  if (omega_mass_flag) {
     double nkt = atom->natoms * kt;
     for (int i = 0; i < 3; i++)
       if (p_flag[i])
-	omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
+        omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
 
     if (pstyle == TRICLINIC) {
       for (int i = 3; i < 6; i++)
-	if (p_flag[i]) omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
+        if (p_flag[i]) omega_mass[i] = nkt/(p_freq[i]*p_freq[i]);
     }
   }
 
-  if (etap_mass_flag) { 
+  if (etap_mass_flag) {
     if (mpchain) {
       etap_mass[0] = boltz * t_target / (p_freq_max*p_freq_max);
       for (int ich = 1; ich < mpchain; ich++)
-	etap_mass[ich] = boltz * t_target / (p_freq_max*p_freq_max);
+        etap_mass[ich] = boltz * t_target / (p_freq_max*p_freq_max);
       for (int ich = 1; ich < mpchain; ich++)
-	etap_dotdot[ich] = 
-	  (etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] -
-	   boltz * t_target) / etap_mass[ich];
+        etap_dotdot[ich] =
+          (etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] -
+           boltz * t_target) / etap_mass[ich];
     }
   }
 
@@ -1750,7 +1750,7 @@ void FixNH::nhc_press_integrate()
     if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
 
   if (pstyle == TRICLINIC) {
-    for (i = 3; i < 6; i++) 
+    for (i = 3; i < 6; i++)
       if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
   }
 
@@ -1766,46 +1766,46 @@ void FixNH::nhc_press_integrate()
       etap_dot[ich] *= pdrag_factor;
       etap_dot[ich] *= expfac;
     }
-    
+
     expfac = exp(-ncfac*dt8*etap_dot[1]);
     etap_dot[0] *= expfac;
     etap_dot[0] += etap_dotdot[0] * ncfac*dt4;
     etap_dot[0] *= pdrag_factor;
     etap_dot[0] *= expfac;
-    
+
     for (ich = 0; ich < mpchain; ich++)
       etap[ich] += ncfac*dthalf*etap_dot[ich];
-    
+
     factor_etap = exp(-ncfac*dthalf*etap_dot[0]);
     for (i = 0; i < 3; i++)
       if (p_flag[i]) omega_dot[i] *= factor_etap;
-    
+
     if (pstyle == TRICLINIC) {
       for (i = 3; i < 6; i++)
-	if (p_flag[i]) omega_dot[i] *= factor_etap;
+        if (p_flag[i]) omega_dot[i] *= factor_etap;
     }
-    
+
     kecurrent = 0.0;
     for (i = 0; i < 3; i++)
       if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
-    
+
     if (pstyle == TRICLINIC) {
-      for (i = 3; i < 6; i++) 
-	if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
+      for (i = 3; i < 6; i++)
+        if (p_flag[i]) kecurrent += omega_mass[i]*omega_dot[i]*omega_dot[i];
     }
-    
+
     etap_dotdot[0] = (kecurrent - lkt_press)/etap_mass[0];
-    
+
     etap_dot[0] *= expfac;
     etap_dot[0] += etap_dotdot[0] * ncfac*dt4;
     etap_dot[0] *= expfac;
-    
+
     for (ich = 1; ich < mpchain; ich++) {
       expfac = exp(-ncfac*dt8*etap_dot[ich+1]);
       etap_dot[ich] *= expfac;
-      etap_dotdot[ich] = 
-	(etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] - boltz*t_target) / 
-	etap_mass[ich];
+      etap_dotdot[ich] =
+        (etap_mass[ich-1]*etap_dot[ich-1]*etap_dot[ich-1] - boltz*t_target) /
+        etap_mass[ich];
       etap_dot[ich] += etap_dotdot[ich] * ncfac*dt4;
       etap_dot[ich] *= expfac;
     }
@@ -1831,33 +1831,33 @@ void FixNH::nh_v_press()
   if (which == NOBIAS) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	v[i][0] *= factor[0];
-	v[i][1] *= factor[1];
-	v[i][2] *= factor[2];
-	if (pstyle == TRICLINIC) {
-	  v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
-	  v[i][1] += -dthalf*v[i][2]*omega_dot[3];
-	}
-	v[i][0] *= factor[0];
-	v[i][1] *= factor[1];
-	v[i][2] *= factor[2];
+        v[i][0] *= factor[0];
+        v[i][1] *= factor[1];
+        v[i][2] *= factor[2];
+        if (pstyle == TRICLINIC) {
+          v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
+          v[i][1] += -dthalf*v[i][2]*omega_dot[3];
+        }
+        v[i][0] *= factor[0];
+        v[i][1] *= factor[1];
+        v[i][2] *= factor[2];
       }
     }
   } else if (which == BIAS) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	temperature->remove_bias(i,v[i]);
-	v[i][0] *= factor[0];
-	v[i][1] *= factor[1];
-	v[i][2] *= factor[2];
-	if (pstyle == TRICLINIC) {
-	  v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
-	  v[i][1] += -dthalf*v[i][2]*omega_dot[3];
-	}
-	v[i][0] *= factor[0];
-	v[i][1] *= factor[1];
-	v[i][2] *= factor[2];
-	temperature->restore_bias(i,v[i]);
+        temperature->remove_bias(i,v[i]);
+        v[i][0] *= factor[0];
+        v[i][1] *= factor[1];
+        v[i][2] *= factor[2];
+        if (pstyle == TRICLINIC) {
+          v[i][0] += -dthalf*(v[i][1]*omega_dot[5] + v[i][2]*omega_dot[4]);
+          v[i][1] += -dthalf*v[i][2]*omega_dot[3];
+        }
+        v[i][0] *= factor[0];
+        v[i][1] *= factor[1];
+        v[i][2] *= factor[2];
+        temperature->restore_bias(i,v[i]);
       }
     }
   }
@@ -1882,19 +1882,19 @@ void FixNH::nve_v()
   if (rmass) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	dtfm = dtf / rmass[i];
-	v[i][0] += dtfm*f[i][0];
-	v[i][1] += dtfm*f[i][1];
-	v[i][2] += dtfm*f[i][2];
+        dtfm = dtf / rmass[i];
+        v[i][0] += dtfm*f[i][0];
+        v[i][1] += dtfm*f[i][1];
+        v[i][2] += dtfm*f[i][2];
       }
     }
   } else {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	dtfm = dtf / mass[type[i]];
-	v[i][0] += dtfm*f[i][0];
-	v[i][1] += dtfm*f[i][1];
-	v[i][2] += dtfm*f[i][2];
+        dtfm = dtf / mass[type[i]];
+        v[i][0] += dtfm*f[i][0];
+        v[i][1] += dtfm*f[i][1];
+        v[i][2] += dtfm*f[i][2];
       }
     }
   }
@@ -1937,24 +1937,24 @@ void FixNH::nh_v_temp()
   if (which == NOBIAS) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	v[i][0] *= factor_eta;
-	v[i][1] *= factor_eta;
-	v[i][2] *= factor_eta;
+        v[i][0] *= factor_eta;
+        v[i][1] *= factor_eta;
+        v[i][2] *= factor_eta;
       }
     }
   } else if (which == BIAS) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	temperature->remove_bias(i,v[i]);
-	v[i][0] *= factor_eta;
-	v[i][1] *= factor_eta;
-	v[i][2] *= factor_eta;
-	temperature->restore_bias(i,v[i]);
+        temperature->remove_bias(i,v[i]);
+        v[i][0] *= factor_eta;
+        v[i][1] *= factor_eta;
+        v[i][2] *= factor_eta;
+        temperature->restore_bias(i,v[i]);
       }
     }
   }
 }
-  
+
 /* ----------------------------------------------------------------------
    compute sigma tensor
    needed whenever p_target or h0_inv changes
@@ -1962,7 +1962,7 @@ void FixNH::nh_v_temp()
 
 void FixNH::compute_sigma()
 {
-  // if nreset_h0 > 0, reset vol0 and h0_inv 
+  // if nreset_h0 > 0, reset vol0 and h0_inv
   // every nreset_h0 timesteps
 
   if (nreset_h0 > 0) {
@@ -1981,37 +1981,37 @@ void FixNH::compute_sigma()
 
   // generate upper-triangular half of
   // sigma = vol0*h0inv*(p_target-p_hydro)*h0inv^t
-  // units of sigma are are PV/L^2 e.g. atm.A 
+  // units of sigma are are PV/L^2 e.g. atm.A
   //
   // [ 0 5 4 ]   [ 0 5 4 ] [ 0 5 4 ] [ 0 - - ]
   // [ 5 1 3 ] = [ - 1 3 ] [ 5 1 3 ] [ 5 1 - ]
   // [ 4 3 2 ]   [ - - 2 ] [ 4 3 2 ] [ 4 3 2 ]
 
-  sigma[0] = 
+  sigma[0] =
     vol0*(h0_inv[0]*((p_target[0]-p_hydro)*h0_inv[0] +
-		     p_target[5]*h0_inv[5]+p_target[4]*h0_inv[4]) +
-	  h0_inv[5]*(p_target[5]*h0_inv[0] +
-		     (p_target[1]-p_hydro)*h0_inv[5]+p_target[3]*h0_inv[4]) +
-	  h0_inv[4]*(p_target[4]*h0_inv[0]+p_target[3]*h0_inv[5] +
-		     (p_target[2]-p_hydro)*h0_inv[4]));
-  sigma[1] = 
+                     p_target[5]*h0_inv[5]+p_target[4]*h0_inv[4]) +
+          h0_inv[5]*(p_target[5]*h0_inv[0] +
+                     (p_target[1]-p_hydro)*h0_inv[5]+p_target[3]*h0_inv[4]) +
+          h0_inv[4]*(p_target[4]*h0_inv[0]+p_target[3]*h0_inv[5] +
+                     (p_target[2]-p_hydro)*h0_inv[4]));
+  sigma[1] =
     vol0*(h0_inv[1]*((p_target[1]-p_hydro)*h0_inv[1] +
-		     p_target[3]*h0_inv[3]) +
-	  h0_inv[3]*(p_target[3]*h0_inv[1] + 
-		     (p_target[2]-p_hydro)*h0_inv[3]));
-  sigma[2] = 
+                     p_target[3]*h0_inv[3]) +
+          h0_inv[3]*(p_target[3]*h0_inv[1] +
+                     (p_target[2]-p_hydro)*h0_inv[3]));
+  sigma[2] =
     vol0*(h0_inv[2]*((p_target[2]-p_hydro)*h0_inv[2]));
-  sigma[3] = 
+  sigma[3] =
     vol0*(h0_inv[1]*(p_target[3]*h0_inv[2]) +
-	  h0_inv[3]*((p_target[2]-p_hydro)*h0_inv[2]));
-  sigma[4] = 
+          h0_inv[3]*((p_target[2]-p_hydro)*h0_inv[2]));
+  sigma[4] =
     vol0*(h0_inv[0]*(p_target[4]*h0_inv[2]) +
-	  h0_inv[5]*(p_target[3]*h0_inv[2]) +
-	  h0_inv[4]*((p_target[2]-p_hydro)*h0_inv[2]));
-  sigma[5] = 
+          h0_inv[5]*(p_target[3]*h0_inv[2]) +
+          h0_inv[4]*((p_target[2]-p_hydro)*h0_inv[2]));
+  sigma[5] =
     vol0*(h0_inv[0]*(p_target[5]*h0_inv[1]+p_target[4]*h0_inv[3]) +
-	  h0_inv[5]*((p_target[1]-p_hydro)*h0_inv[1]+p_target[3]*h0_inv[3]) +
-	  h0_inv[4]*(p_target[3]*h0_inv[1]+(p_target[2]-p_hydro)*h0_inv[3]));
+          h0_inv[5]*((p_target[1]-p_hydro)*h0_inv[1]+p_target[3]*h0_inv[3]) +
+          h0_inv[4]*(p_target[3]*h0_inv[1]+(p_target[2]-p_hydro)*h0_inv[3]));
 }
 
 /* ----------------------------------------------------------------------
@@ -2020,20 +2020,20 @@ void FixNH::compute_sigma()
 
 double FixNH::compute_strain_energy()
 {
-  // compute strain energy = 0.5*Tr(sigma*h*h^t) in energy units 
+  // compute strain energy = 0.5*Tr(sigma*h*h^t) in energy units
 
   double* h = domain->h;
   double d0,d1,d2;
 
-  d0 = 
+  d0 =
     sigma[0]*(h[0]*h[0]+h[5]*h[5]+h[4]*h[4]) +
     sigma[5]*(          h[1]*h[5]+h[3]*h[4]) +
     sigma[4]*(                    h[2]*h[4]);
-  d1 = 
+  d1 =
     sigma[5]*(          h[5]*h[1]+h[4]*h[3]) +
     sigma[1]*(          h[1]*h[1]+h[3]*h[3]) +
     sigma[3]*(                    h[2]*h[3]);
-  d2 = 
+  d2 =
     sigma[4]*(                    h[4]*h[2]) +
     sigma[3]*(                    h[3]*h[2]) +
     sigma[2]*(                    h[2]*h[2]);
@@ -2049,30 +2049,30 @@ double FixNH::compute_strain_energy()
 void FixNH::compute_deviatoric()
 {
   // generate upper-triangular part of h*sigma*h^t
-  // units of fdev are are PV, e.g. atm*A^3 
+  // units of fdev are are PV, e.g. atm*A^3
   // [ 0 5 4 ]   [ 0 5 4 ] [ 0 5 4 ] [ 0 - - ]
   // [ 5 1 3 ] = [ - 1 3 ] [ 5 1 3 ] [ 5 1 - ]
   // [ 4 3 2 ]   [ - - 2 ] [ 4 3 2 ] [ 4 3 2 ]
-  
+
   double* h = domain->h;
-   
-  fdev[0] = 
+
+  fdev[0] =
     h[0]*(sigma[0]*h[0]+sigma[5]*h[5]+sigma[4]*h[4]) +
     h[5]*(sigma[5]*h[0]+sigma[1]*h[5]+sigma[3]*h[4]) +
     h[4]*(sigma[4]*h[0]+sigma[3]*h[5]+sigma[2]*h[4]);
-  fdev[1] = 
+  fdev[1] =
     h[1]*(              sigma[1]*h[1]+sigma[3]*h[3]) +
     h[3]*(              sigma[3]*h[1]+sigma[2]*h[3]);
-  fdev[2] = 
+  fdev[2] =
     h[2]*(                            sigma[2]*h[2]);
-  fdev[3] = 
+  fdev[3] =
     h[1]*(                            sigma[3]*h[2]) +
     h[3]*(                            sigma[2]*h[2]);
-  fdev[4] = 
+  fdev[4] =
     h[0]*(                            sigma[4]*h[2]) +
     h[5]*(                            sigma[3]*h[2]) +
     h[4]*(                            sigma[2]*h[2]);
-  fdev[5] = 
+  fdev[5] =
     h[0]*(              sigma[5]*h[1]+sigma[4]*h[3]) +
     h[5]*(              sigma[1]*h[1]+sigma[3]*h[3]) +
     h[4]*(              sigma[3]*h[1]+sigma[2]*h[3]);
@@ -2088,7 +2088,7 @@ void FixNH::compute_temp_target()
   if (update->endstep > update->beginstep)
     delta /= update->endstep - update->beginstep;
   else delta = 0.0;
-      
+
   t_target = t_start + delta * (t_stop-t_start);
   ke_target = tdof * boltz * t_target;
 }
@@ -2103,7 +2103,7 @@ void FixNH::compute_press_target()
   if (update->endstep > update->beginstep)
     delta /= update->endstep - update->beginstep;
   else delta = 0.0;
-      
+
   p_hydro = 0.0;
   for (int i = 0; i < 3; i++)
     if (p_flag[i]) {
@@ -2136,21 +2136,21 @@ void FixNH::nh_omega_dot()
 
   mtk_term1 = 0.0;
   if (mtk_flag)
-    if (pstyle == ISO) { 
+    if (pstyle == ISO) {
       mtk_term1 = tdof * boltz * t_current;
       mtk_term1 /= pdim * atom->natoms;
     } else {
       double *mvv_current = temperature->vector;
       for (int i = 0; i < 3; i++)
-	if (p_flag[i])
-	  mtk_term1 += mvv_current[i];
+        if (p_flag[i])
+          mtk_term1 += mvv_current[i];
       mtk_term1 /= pdim * atom->natoms;
     }
-  
+
   for (int i = 0; i < 3; i++)
     if (p_flag[i]) {
       f_omega = (p_current[i]-p_hydro)*volume /
-	(omega_mass[i] * nktv2p) + mtk_term1 / omega_mass[i];
+        (omega_mass[i] * nktv2p) + mtk_term1 / omega_mass[i];
       if (deviatoric_flag) f_omega -= fdev[i]/(omega_mass[i] * nktv2p);
       omega_dot[i] += f_omega*dthalf;
       omega_dot[i] *= pdrag_factor;
@@ -2160,20 +2160,20 @@ void FixNH::nh_omega_dot()
   if (mtk_flag) {
     for (int i = 0; i < 3; i++)
       if (p_flag[i])
-	mtk_term2 += omega_dot[i];
+        mtk_term2 += omega_dot[i];
     mtk_term2 /= pdim * atom->natoms;
   }
 
   if (pstyle == TRICLINIC) {
     for (int i = 3; i < 6; i++) {
       if (p_flag[i]) {
-	f_omega = p_current[i]*volume/(omega_mass[i] * nktv2p);
-	if (deviatoric_flag) 
-	  f_omega -= fdev[i]/(omega_mass[i] * nktv2p);
-	omega_dot[i] += f_omega*dthalf;
-	omega_dot[i] *= pdrag_factor;
+        f_omega = p_current[i]*volume/(omega_mass[i] * nktv2p);
+        if (deviatoric_flag)
+          f_omega -= fdev[i]/(omega_mass[i] * nktv2p);
+        omega_dot[i] += f_omega*dthalf;
+        omega_dot[i] *= pdrag_factor;
       }
-    } 
+    }
   }
 }
 
diff --git a/src/fix_nh.h b/src/fix_nh.h
index e87b695898..819260c1d1 100644
--- a/src/fix_nh.h
+++ b/src/fix_nh.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,7 +45,7 @@ class FixNH : public Fix {
   double dtv,dtf,dthalf,dt4,dt8,dto;
   double boltz,nktv2p,tdof;
   double vol0;                      // reference volume
-  double t0;                        // reference temperature 
+  double t0;                        // reference temperature
                                     // used for barostat mass
   double t_start,t_stop;
   double t_current,t_target,ke_target;
@@ -81,14 +81,14 @@ class FixNH : public Fix {
   double *eta_dotdot;
   double *eta_mass;
   int mtchain;                     // length of chain
-  int mtchain_default_flag;        // 1 = mtchain is default   
-                                   
+  int mtchain_default_flag;        // 1 = mtchain is default
+
   double *etap;                    // chain thermostat for barostat
   double *etap_dot;
   double *etap_dotdot;
   double *etap_mass;
   int mpchain;                     // length of chain
-                                   
+
   int mtk_flag;                    // 0 if using Hoover barostat
   int pdim;                        // number of barostatted dims
   double p_freq_max;               // maximum barostat frequency
@@ -109,9 +109,9 @@ class FixNH : public Fix {
   int omega_mass_flag;             // 1 if omega_mass updated, 0 if not.
   int etap_mass_flag;              // 1 if etap_mass updated, 0 if not.
 
-  int scaleyz;                     // 1 if yz scaled with lz 
-  int scalexz;                     // 1 if xz scaled with lz 
-  int scalexy;                     // 1 if xy scaled with ly 
+  int scaleyz;                     // 1 if yz scaled with lz
+  int scalexz;                     // 1 if xz scaled with lz
+  int scalexy;                     // 1 if xy scaled with ly
 
   double fixedpoint[3];            // Location of dilation fixed-point
 
diff --git a/src/fix_nh_sphere.cpp b/src/fix_nh_sphere.cpp
index 5380508097..c6a09f2954 100644
--- a/src/fix_nh_sphere.cpp
+++ b/src/fix_nh_sphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,7 +50,7 @@ void FixNHSphere::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (radius[i] == 0.0)
-	error->one(FLERR,"Fix nvt/sphere requires extended particles");
+        error->one(FLERR,"Fix nvt/sphere requires extended particles");
 
   FixNH::init();
 }
@@ -106,7 +106,7 @@ void FixNHSphere::nh_v_temp()
   int nlocal = atom->nlocal;
   if (igroup == atom->firstgroup) nlocal = atom->nfirst;
 
-  for (int i = 0; i < nlocal; i++) {    
+  for (int i = 0; i < nlocal; i++) {
     if (mask[i] & groupbit) {
       omega[i][0] *= factor_eta;
       omega[i][1] *= factor_eta;
diff --git a/src/fix_nh_sphere.h b/src/fix_nh_sphere.h
index ed360a23c8..126f040054 100644
--- a/src/fix_nh_sphere.h
+++ b/src/fix_nh_sphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_nph.cpp b/src/fix_nph.cpp
index b9e0f9e223..419a6980a0 100644
--- a/src/fix_nph.cpp
+++ b/src/fix_nph.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ FixNPH::FixNPH(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = (char *) "all";
@@ -56,7 +56,7 @@ FixNPH::FixNPH(LAMMPS *lmp, int narg, char **arg) :
   id_press = new char[n];
   strcpy(id_press,id);
   strcat(id_press,"_press");
-  
+
   newarg = new char*[4];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";
diff --git a/src/fix_nph.h b/src/fix_nph.h
index a42d7f087c..c9ff742dc8 100644
--- a/src/fix_nph.h
+++ b/src/fix_nph.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_nph_sphere.cpp b/src/fix_nph_sphere.cpp
index cdc7801cf5..2c87e6b34f 100644
--- a/src/fix_nph_sphere.cpp
+++ b/src/fix_nph_sphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ FixNPHSphere::FixNPHSphere(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = (char *) "all";
@@ -56,7 +56,7 @@ FixNPHSphere::FixNPHSphere(LAMMPS *lmp, int narg, char **arg) :
   id_press = new char[n];
   strcpy(id_press,id);
   strcat(id_press,"_press");
-  
+
   newarg = new char*[4];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";
diff --git a/src/fix_nph_sphere.h b/src/fix_nph_sphere.h
index db8d5d743e..dd75f6b3fd 100644
--- a/src/fix_nph_sphere.h
+++ b/src/fix_nph_sphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_npt.cpp b/src/fix_npt.cpp
index a412bc9c6f..cf83ded491 100644
--- a/src/fix_npt.cpp
+++ b/src/fix_npt.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ FixNPT::FixNPT(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = (char *) "all";
@@ -56,7 +56,7 @@ FixNPT::FixNPT(LAMMPS *lmp, int narg, char **arg) :
   id_press = new char[n];
   strcpy(id_press,id);
   strcat(id_press,"_press");
-  
+
   newarg = new char*[4];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";
diff --git a/src/fix_npt.h b/src/fix_npt.h
index 6cdd1b37c0..75d6c26f29 100644
--- a/src/fix_npt.h
+++ b/src/fix_npt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_npt_sphere.cpp b/src/fix_npt_sphere.cpp
index 4fafcccbb5..81c0e3c799 100644
--- a/src/fix_npt_sphere.cpp
+++ b/src/fix_npt_sphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ FixNPTSphere::FixNPTSphere(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = (char *) "all";
@@ -56,7 +56,7 @@ FixNPTSphere::FixNPTSphere(LAMMPS *lmp, int narg, char **arg) :
   id_press = new char[n];
   strcpy(id_press,id);
   strcat(id_press,"_press");
-  
+
   newarg = new char*[4];
   newarg[0] = id_press;
   newarg[1] = (char *) "all";
diff --git a/src/fix_npt_sphere.h b/src/fix_npt_sphere.h
index efcd47b2ad..06522716cd 100644
--- a/src/fix_npt_sphere.h
+++ b/src/fix_npt_sphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_nve.cpp b/src/fix_nve.cpp
index cf4044ab07..d1431a4e8d 100644
--- a/src/fix_nve.cpp
+++ b/src/fix_nve.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -80,25 +80,25 @@ void FixNVE::initial_integrate(int vflag)
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	dtfm = dtf / rmass[i];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
-	x[i][0] += dtv * v[i][0];
-	x[i][1] += dtv * v[i][1];
-	x[i][2] += dtv * v[i][2];
+        dtfm = dtf / rmass[i];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
+        x[i][0] += dtv * v[i][0];
+        x[i][1] += dtv * v[i][1];
+        x[i][2] += dtv * v[i][2];
       }
 
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	dtfm = dtf / mass[type[i]];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
-	x[i][0] += dtv * v[i][0];
-	x[i][1] += dtv * v[i][1];
-	x[i][2] += dtv * v[i][2];
+        dtfm = dtf / mass[type[i]];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
+        x[i][0] += dtv * v[i][0];
+        x[i][1] += dtv * v[i][1];
+        x[i][2] += dtv * v[i][2];
       }
   }
 }
@@ -123,19 +123,19 @@ void FixNVE::final_integrate()
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	dtfm = dtf / rmass[i];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
+        dtfm = dtf / rmass[i];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
       }
 
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	dtfm = dtf / mass[type[i]];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
+        dtfm = dtf / mass[type[i]];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
       }
   }
 }
diff --git a/src/fix_nve.h b/src/fix_nve.h
index 838f79b995..9e8dd06fbd 100644
--- a/src/fix_nve.h
+++ b/src/fix_nve.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_nve_limit.cpp b/src/fix_nve_limit.cpp
index 8a47113f3c..13cf558002 100644
--- a/src/fix_nve_limit.cpp
+++ b/src/fix_nve_limit.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -88,46 +88,46 @@ void FixNVELimit::initial_integrate(int vflag)
   if (rmass) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	dtfm = dtf / rmass[i];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
-
-	vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
-	if (vsq > vlimitsq) {
-	  ncount++;
-	  scale = sqrt(vlimitsq/vsq);
-	  v[i][0] *= scale;
-	  v[i][1] *= scale;
-	  v[i][2] *= scale;
-	}
-
-	x[i][0] += dtv * v[i][0];
-	x[i][1] += dtv * v[i][1];
-	x[i][2] += dtv * v[i][2];
+        dtfm = dtf / rmass[i];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
+
+        vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
+        if (vsq > vlimitsq) {
+          ncount++;
+          scale = sqrt(vlimitsq/vsq);
+          v[i][0] *= scale;
+          v[i][1] *= scale;
+          v[i][2] *= scale;
+        }
+
+        x[i][0] += dtv * v[i][0];
+        x[i][1] += dtv * v[i][1];
+        x[i][2] += dtv * v[i][2];
       }
     }
 
   } else {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	dtfm = dtf / mass[type[i]];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
-
-	vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
-	if (vsq > vlimitsq) {
-	  ncount++;
-	  scale = sqrt(vlimitsq/vsq);
-	  v[i][0] *= scale;
-	  v[i][1] *= scale;
-	  v[i][2] *= scale;
-	}
-
-	x[i][0] += dtv * v[i][0];
-	x[i][1] += dtv * v[i][1];
-	x[i][2] += dtv * v[i][2];
+        dtfm = dtf / mass[type[i]];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
+
+        vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
+        if (vsq > vlimitsq) {
+          ncount++;
+          scale = sqrt(vlimitsq/vsq);
+          v[i][0] *= scale;
+          v[i][1] *= scale;
+          v[i][2] *= scale;
+        }
+
+        x[i][0] += dtv * v[i][0];
+        x[i][1] += dtv * v[i][1];
+        x[i][2] += dtv * v[i][2];
       }
     }
   }
@@ -151,38 +151,38 @@ void FixNVELimit::final_integrate()
   if (rmass) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	dtfm = dtf / rmass[i];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
-
-	vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
-	if (vsq > vlimitsq) {
-	  ncount++;
-	  scale = sqrt(vlimitsq/vsq);
-	  v[i][0] *= scale;
-	  v[i][1] *= scale;
-	  v[i][2] *= scale;
-	}
+        dtfm = dtf / rmass[i];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
+
+        vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
+        if (vsq > vlimitsq) {
+          ncount++;
+          scale = sqrt(vlimitsq/vsq);
+          v[i][0] *= scale;
+          v[i][1] *= scale;
+          v[i][2] *= scale;
+        }
       }
     }
 
   } else {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	dtfm = dtf / mass[type[i]];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
-
-	vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
-	if (vsq > vlimitsq) {
-	  ncount++;
-	  scale = sqrt(vlimitsq/vsq);
-	  v[i][0] *= scale;
-	  v[i][1] *= scale;
-	  v[i][2] *= scale;
-	}
+        dtfm = dtf / mass[type[i]];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
+
+        vsq = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
+        if (vsq > vlimitsq) {
+          ncount++;
+          scale = sqrt(vlimitsq/vsq);
+          v[i][0] *= scale;
+          v[i][1] *= scale;
+          v[i][2] *= scale;
+        }
       }
     }
   }
diff --git a/src/fix_nve_limit.h b/src/fix_nve_limit.h
index 68927155d7..0ab45afaad 100644
--- a/src/fix_nve_limit.h
+++ b/src/fix_nve_limit.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_nve_noforce.cpp b/src/fix_nve_noforce.cpp
index ffffd01235..e373e00b19 100644
--- a/src/fix_nve_noforce.cpp
+++ b/src/fix_nve_noforce.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_nve_noforce.h b/src/fix_nve_noforce.h
index 29d198564a..92452f7b1a 100644
--- a/src/fix_nve_noforce.h
+++ b/src/fix_nve_noforce.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_nve_sphere.cpp b/src/fix_nve_sphere.cpp
index a3d270155f..0ad787a27f 100644
--- a/src/fix_nve_sphere.cpp
+++ b/src/fix_nve_sphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -76,7 +76,7 @@ void FixNVESphere::init()
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit)
       if (radius[i] == 0.0)
-	error->one(FLERR,"Fix nve/sphere requires extended particles");
+        error->one(FLERR,"Fix nve/sphere requires extended particles");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -113,7 +113,7 @@ void FixNVESphere::initial_integrate(int vflag)
       x[i][0] += dtv * v[i][0];
       x[i][1] += dtv * v[i][1];
       x[i][2] += dtv * v[i][2];
-      
+
       dtirotate = dtfrotate / (radius[i]*radius[i]*rmass[i]);
       omega[i][0] += dtirotate * torque[i][0];
       omega[i][1] += dtirotate * torque[i][1];
@@ -129,16 +129,16 @@ void FixNVESphere::initial_integrate(int vflag)
     double **mu = atom->mu;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	if (mu[i][3] > 0.0) {
-	  g[0] = mu[i][0] + dtv * (omega[i][1]*mu[i][2]-omega[i][2]*mu[i][1]);
-	  g[1] = mu[i][1] + dtv * (omega[i][2]*mu[i][0]-omega[i][0]*mu[i][2]);
-	  g[2] = mu[i][2] + dtv * (omega[i][0]*mu[i][1]-omega[i][1]*mu[i][0]);
-	  msq = g[0]*g[0] + g[1]*g[1] + g[2]*g[2];
-	  scale = mu[i][3]/sqrt(msq);
-	  mu[i][0] = g[0]*scale;
-	  mu[i][1] = g[1]*scale;
-	  mu[i][2] = g[2]*scale;
-	}
+        if (mu[i][3] > 0.0) {
+          g[0] = mu[i][0] + dtv * (omega[i][1]*mu[i][2]-omega[i][2]*mu[i][1]);
+          g[1] = mu[i][1] + dtv * (omega[i][2]*mu[i][0]-omega[i][0]*mu[i][2]);
+          g[2] = mu[i][2] + dtv * (omega[i][0]*mu[i][1]-omega[i][1]*mu[i][0]);
+          msq = g[0]*g[0] + g[1]*g[1] + g[2]*g[2];
+          scale = mu[i][3]/sqrt(msq);
+          mu[i][0] = g[0]*scale;
+          mu[i][1] = g[1]*scale;
+          mu[i][2] = g[2]*scale;
+        }
   }
 }
 
@@ -171,7 +171,7 @@ void FixNVESphere::final_integrate()
       v[i][0] += dtfm * f[i][0];
       v[i][1] += dtfm * f[i][1];
       v[i][2] += dtfm * f[i][2];
-      
+
       dtirotate = dtfrotate / (radius[i]*radius[i]*rmass[i]);
       omega[i][0] += dtirotate * torque[i][0];
       omega[i][1] += dtirotate * torque[i][1];
diff --git a/src/fix_nve_sphere.h b/src/fix_nve_sphere.h
index 4fbb0bfcce..1938b0f855 100644
--- a/src/fix_nve_sphere.h
+++ b/src/fix_nve_sphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_nvt.cpp b/src/fix_nvt.cpp
index c7d7f054e8..839b7ce0a3 100644
--- a/src/fix_nvt.cpp
+++ b/src/fix_nvt.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,7 +37,7 @@ FixNVT::FixNVT(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = group->names[igroup];
diff --git a/src/fix_nvt.h b/src/fix_nvt.h
index e0aa289a47..3f2df5f72f 100644
--- a/src/fix_nvt.h
+++ b/src/fix_nvt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_nvt_sllod.cpp b/src/fix_nvt_sllod.cpp
index a18787f177..460ba7a393 100644
--- a/src/fix_nvt_sllod.cpp
+++ b/src/fix_nvt_sllod.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -55,7 +55,7 @@ FixNVTSllod::FixNVTSllod(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = group->names[igroup];
@@ -84,8 +84,8 @@ void FixNVTSllod::init()
   for (i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       if (((FixDeform *) modify->fix[i])->remapflag != V_REMAP)
-	error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform "
-		   "remap option");
+        error->all(FLERR,"Using fix nvt/sllod with inconsistent fix deform "
+                   "remap option");
       break;
     }
   if (i == modify->nfix)
diff --git a/src/fix_nvt_sllod.h b/src/fix_nvt_sllod.h
index a95065f8b7..77911b0b89 100644
--- a/src/fix_nvt_sllod.h
+++ b/src/fix_nvt_sllod.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_nvt_sphere.cpp b/src/fix_nvt_sphere.cpp
index b90fc23ffc..58dbbb782c 100644
--- a/src/fix_nvt_sphere.cpp
+++ b/src/fix_nvt_sphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,7 +37,7 @@ FixNVTSphere::FixNVTSphere(LAMMPS *lmp, int narg, char **arg) :
   id_temp = new char[n];
   strcpy(id_temp,id);
   strcat(id_temp,"_temp");
-  
+
   char **newarg = new char*[3];
   newarg[0] = id_temp;
   newarg[1] = group->names[igroup];
diff --git a/src/fix_nvt_sphere.h b/src/fix_nvt_sphere.h
index daf1cc9225..15eaeff115 100644
--- a/src/fix_nvt_sphere.h
+++ b/src/fix_nvt_sphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_orient_fcc.cpp b/src/fix_orient_fcc.cpp
index e9f4c8fbde..5f8193c10f 100644
--- a/src/fix_orient_fcc.cpp
+++ b/src/fix_orient_fcc.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,7 +50,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) :
   scalar_flag = 1;
   global_freq = 1;
   extscalar = 1;
-  
+
   peratom_flag = 1;
   size_peratom_cols = 2;
   peratom_freq = 1;
@@ -297,27 +297,27 @@ void FixOrientFCC::post_force(int vflag)
       rsq = dx*dx + dy*dy + dz*dz;
 
       if (rsq < cutsq) {
-	sort[nsort].id = j;
-	sort[nsort].rsq = rsq;
-	sort[nsort].delta[0] = dx;
-	sort[nsort].delta[1] = dy;
-	sort[nsort].delta[2] = dz;
-	if (use_xismooth) {
-	  xismooth = (xicutoffsq - 2.0*rsq/(a*a)) / (xicutoffsq - 1.0);
-	  sort[nsort].xismooth = 1.0 - fabs(1.0-xismooth);
-	}
-	nsort++;
+        sort[nsort].id = j;
+        sort[nsort].rsq = rsq;
+        sort[nsort].delta[0] = dx;
+        sort[nsort].delta[1] = dy;
+        sort[nsort].delta[2] = dz;
+        if (use_xismooth) {
+          xismooth = (xicutoffsq - 2.0*rsq/(a*a)) / (xicutoffsq - 1.0);
+          sort[nsort].xismooth = 1.0 - fabs(1.0-xismooth);
+        }
+        nsort++;
       }
     }
 
     // sort neighbors by rsq distance
     // no need to sort if nsort <= 12
-    
+
     if (nsort > 12) qsort(sort,nsort,sizeof(Sort),compare);
 
     // copy up to 12 nearest neighbors into nbr data structure
     // operate on delta vector via find_best_ref() to compute dxi
-    
+
     n = MIN(12,nsort);
     nbr[i].n = n;
     if (n == 0) continue;
@@ -353,9 +353,9 @@ void FixOrientFCC::post_force(int vflag)
     }
     added_energy += edelta;
   }
-  
+
   if (maxcount) delete [] sort;
-  
+
   // communicate to acquire nbr data for ghost atoms
 
   comm->forward_comm_fix(this);
@@ -372,12 +372,12 @@ void FixOrientFCC::post_force(int vflag)
     for (j = 0; j < n; j++) {
       dxiptr = &nbr[i].dxi[j][0];
       if (use_xismooth) {
-	xismooth = nbr[i].xismooth[j];
+        xismooth = nbr[i].xismooth[j];
         f[i][0] += duxi * dxiptr[0] * xismooth;
         f[i][1] += duxi * dxiptr[1] * xismooth;
         f[i][2] += duxi * dxiptr[2] * xismooth;
       } else {
-	f[i][0] += duxi * dxiptr[0];
+        f[i][0] += duxi * dxiptr[0];
         f[i][1] += duxi * dxiptr[1];
         f[i][2] += duxi * dxiptr[2];
       }
@@ -387,29 +387,29 @@ void FixOrientFCC::post_force(int vflag)
       // if M is local atom, id_self will be local ID of atom I
       // if M is ghost atom, id_self will be global ID of atom I
 
-      m = nbr[i].id[j]; 
+      m = nbr[i].id[j];
       if (m < nlocal) id_self = i;
       else id_self = tag[i];
       found_myself = false;
       nn = nbr[m].n;
 
       for (k = 0; k < nn; k++) {
-	if (id_self == nbr[m].id[k]) {
-	  if (found_myself) error->one(FLERR,"Fix orient/fcc found self twice");
-	  found_myself = true;
-	  duxi_other = nbr[m].duxi;
-	  dxiptr = &nbr[m].dxi[k][0];
-	  if (use_xismooth) {
-	    xismooth = nbr[m].xismooth[k];
-	    f[i][0] -= duxi_other * dxiptr[0] * xismooth;
-	    f[i][1] -= duxi_other * dxiptr[1] * xismooth;
-	    f[i][2] -= duxi_other * dxiptr[2] * xismooth;
-	  } else {
-	    f[i][0] -= duxi_other * dxiptr[0];
-	    f[i][1] -= duxi_other * dxiptr[1];
-	    f[i][2] -= duxi_other * dxiptr[2];
-	  }
-	}
+        if (id_self == nbr[m].id[k]) {
+          if (found_myself) error->one(FLERR,"Fix orient/fcc found self twice");
+          found_myself = true;
+          duxi_other = nbr[m].duxi;
+          dxiptr = &nbr[m].dxi[k][0];
+          if (use_xismooth) {
+            xismooth = nbr[m].xismooth[k];
+            f[i][0] -= duxi_other * dxiptr[0] * xismooth;
+            f[i][1] -= duxi_other * dxiptr[1] * xismooth;
+            f[i][2] -= duxi_other * dxiptr[2] * xismooth;
+          } else {
+            f[i][0] -= duxi_other * dxiptr[0];
+            f[i][1] -= duxi_other * dxiptr[1];
+            f[i][2] -= duxi_other * dxiptr[2];
+          }
+        }
       }
     }
   }
@@ -425,21 +425,21 @@ void FixOrientFCC::post_force(int vflag)
     MPI_Allreduce(&mincount,&min,1,MPI_INT,MPI_MIN,world);
     MPI_Allreduce(&maxcount,&max,1,MPI_INT,MPI_MAX,world);
 
-    if (me == 0) { 
+    if (me == 0) {
       if (screen) fprintf(screen,
-			  "orient step " BIGINT_FORMAT ": " BIGINT_FORMAT 
-			  " atoms have %d neighbors\n",
-			  update->ntimestep,atom->natoms,total);
+                          "orient step " BIGINT_FORMAT ": " BIGINT_FORMAT
+                          " atoms have %d neighbors\n",
+                          update->ntimestep,atom->natoms,total);
       if (logfile) fprintf(logfile,
-			   "orient step " BIGINT_FORMAT ": " BIGINT_FORMAT 
-			   " atoms have %d neighbors\n",
-			   update->ntimestep,atom->natoms,total);
+                           "orient step " BIGINT_FORMAT ": " BIGINT_FORMAT
+                           " atoms have %d neighbors\n",
+                           update->ntimestep,atom->natoms,total);
       if (screen)
-	fprintf(screen,"  neighs: min = %d, max = %d, ave = %g\n",
-		min,max,ave);
+        fprintf(screen,"  neighs: min = %d, max = %d, ave = %g\n",
+                min,max,ave);
       if (logfile)
-	fprintf(logfile,"  neighs: min = %d, max = %d, ave = %g\n",
-		min,max,ave);
+        fprintf(logfile,"  neighs: min = %d, max = %d, ave = %g\n",
+                min,max,ave);
     }
   }
 }
@@ -463,7 +463,7 @@ double FixOrientFCC::compute_scalar()
 /* ---------------------------------------------------------------------- */
 
 int FixOrientFCC::pack_comm(int n, int *list, double *buf,
-			    int pbc_flag, int *pbc)
+                            int pbc_flag, int *pbc)
 {
   int i,j,k,id,num;
   int *tag = atom->tag;
@@ -526,8 +526,8 @@ void FixOrientFCC::unpack_comm(int n, int first, double *buf)
 
 /* ---------------------------------------------------------------------- */
 
-void FixOrientFCC::find_best_ref(double *displs, int which_crystal, 
-				 double &xi_sq, double *dxi)
+void FixOrientFCC::find_best_ref(double *displs, int which_crystal,
+                                 double &xi_sq, double *dxi)
 {
   int i;
   double dot,tmp;
@@ -557,8 +557,8 @@ void FixOrientFCC::find_best_ref(double *displs, int which_crystal,
   if (xi_sq > 0.0) {
     double xi = sqrt(xi_sq);
     for (i = 0; i < 3; i++)
-      dxi[i] = (best_sign * half_xi_chi_vec[which_crystal][best_i][i] - 
-		displs[i]) / xi;
+      dxi[i] = (best_sign * half_xi_chi_vec[which_crystal][best_i][i] -
+                displs[i]) / xi;
   } else dxi[0] = dxi[1] = dxi[2] = 0.0;
 }
 
@@ -581,7 +581,7 @@ int FixOrientFCC::compare(const void *pi, const void *pj)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double FixOrientFCC::memory_usage()
diff --git a/src/fix_orient_fcc.h b/src/fix_orient_fcc.h
index d565ca47b3..727be00539 100644
--- a/src/fix_orient_fcc.h
+++ b/src/fix_orient_fcc.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -36,7 +36,7 @@ class FixOrientFCC : public Fix {
     double duxi;            // d Energy / d order-parameter for atom
   };
 
-  struct Sort {             // data structure for sorting to find 12 closest 
+  struct Sort {             // data structure for sorting to find 12 closest
     int id;                 // ID of neighbor atom
     double rsq;             // distance between center and neighbor atom
     double delta[3];        // displacement between center and neighbor atom
diff --git a/src/fix_planeforce.cpp b/src/fix_planeforce.cpp
index 43fe933c1c..7f12590cf4 100644
--- a/src/fix_planeforce.cpp
+++ b/src/fix_planeforce.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_planeforce.h b/src/fix_planeforce.h
index 78c66382da..021078f077 100644
--- a/src/fix_planeforce.h
+++ b/src/fix_planeforce.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_press_berendsen.cpp b/src/fix_press_berendsen.cpp
index f01e38bf37..e9ffbdfb1c 100644
--- a/src/fix_press_berendsen.cpp
+++ b/src/fix_press_berendsen.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -68,62 +68,62 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
 
   while (iarg < narg) {
     if (strcmp(arg[iarg],"iso") == 0) {
-      if (iarg+4 > narg) 
-	error->all(FLERR,"Illegal fix press/berendsen command");
+      if (iarg+4 > narg)
+        error->all(FLERR,"Illegal fix press/berendsen command");
       pcouple = XYZ;
       p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
       p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
       p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
       p_flag[0] = p_flag[1] = p_flag[2] = 1;
       if (dimension == 2) {
-	p_start[2] = p_stop[2] = p_period[2] = 0.0;
-	p_flag[2] = 0;
+        p_start[2] = p_stop[2] = p_period[2] = 0.0;
+        p_flag[2] = 0;
       }
-      iarg += 4; 
+      iarg += 4;
     } else if (strcmp(arg[iarg],"aniso") == 0) {
-      if (iarg+4 > narg) 
-	error->all(FLERR,"Illegal fix press/berendsen command");
+      if (iarg+4 > narg)
+        error->all(FLERR,"Illegal fix press/berendsen command");
       pcouple = NONE;
       p_start[0] = p_start[1] = p_start[2] = atof(arg[iarg+1]);
       p_stop[0] = p_stop[1] = p_stop[2] = atof(arg[iarg+2]);
       p_period[0] = p_period[1] = p_period[2] = atof(arg[iarg+3]);
       p_flag[0] = p_flag[1] = p_flag[2] = 1;
       if (dimension == 2) {
-	p_start[2] = p_stop[2] = p_period[2] = 0.0;
-	p_flag[2] = 0;
+        p_start[2] = p_stop[2] = p_period[2] = 0.0;
+        p_flag[2] = 0;
       }
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"x") == 0) {
       if (iarg+4 > narg)
-	error->all(FLERR,"Illegal fix press/berendsen command");
+        error->all(FLERR,"Illegal fix press/berendsen command");
       p_start[0] = atof(arg[iarg+1]);
       p_stop[0] = atof(arg[iarg+2]);
       p_period[0] = atof(arg[iarg+3]);
       p_flag[0] = 1;
-      iarg += 4; 
+      iarg += 4;
     } else if (strcmp(arg[iarg],"y") == 0) {
       if (iarg+4 > narg)
-	error->all(FLERR,"Illegal fix press/berendsen command");
+        error->all(FLERR,"Illegal fix press/berendsen command");
       p_start[1] = atof(arg[iarg+1]);
       p_stop[1] = atof(arg[iarg+2]);
       p_period[1] = atof(arg[iarg+3]);
       p_flag[1] = 1;
-      iarg += 4; 
+      iarg += 4;
     } else if (strcmp(arg[iarg],"z") == 0) {
-      if (iarg+4 > narg) 
-	error->all(FLERR,"Illegal fix press/berendsen command");
+      if (iarg+4 > narg)
+        error->all(FLERR,"Illegal fix press/berendsen command");
       p_start[2] = atof(arg[iarg+1]);
       p_stop[2] = atof(arg[iarg+2]);
       p_period[2] = atof(arg[iarg+3]);
       p_flag[2] = 1;
-      iarg += 4; 
+      iarg += 4;
       if (dimension == 2)
-	error->all(FLERR,"Invalid fix press/berendsen for a 2d simulation");
+        error->all(FLERR,"Invalid fix press/berendsen for a 2d simulation");
 
     } else if (strcmp(arg[iarg],"couple") == 0) {
-      if (iarg+2 > narg) 
-	error->all(FLERR,"Illegal fix press/berendsen command");
+      if (iarg+2 > narg)
+        error->all(FLERR,"Illegal fix press/berendsen command");
       if (strcmp(arg[iarg+1],"xyz") == 0) pcouple = XYZ;
       else if (strcmp(arg[iarg+1],"xy") == 0) pcouple = XY;
       else if (strcmp(arg[iarg+1],"yz") == 0) pcouple = YZ;
@@ -133,15 +133,15 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
       iarg += 2;
 
     } else if (strcmp(arg[iarg],"modulus") == 0) {
-      if (iarg+2 > narg) 
-	error->all(FLERR,"Illegal fix press/berendsen command");
+      if (iarg+2 > narg)
+        error->all(FLERR,"Illegal fix press/berendsen command");
       bulkmodulus = atof(arg[iarg+1]);
-      if (bulkmodulus <= 0.0) 
-	error->all(FLERR,"Illegal fix press/berendsen command");
+      if (bulkmodulus <= 0.0)
+        error->all(FLERR,"Illegal fix press/berendsen command");
       iarg += 2;
     } else if (strcmp(arg[iarg],"dilate") == 0) {
-      if (iarg+2 > narg) 
-	error->all(FLERR,"Illegal fix press/berendsen command");
+      if (iarg+2 > narg)
+        error->all(FLERR,"Illegal fix press/berendsen command");
       if (strcmp(arg[iarg+1],"all") == 0) allremap = 1;
       else if (strcmp(arg[iarg+1],"partial") == 0) allremap = 0;
       else error->all(FLERR,"Illegal fix press/berendsen command");
@@ -171,38 +171,38 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) :
 
   if (p_flag[0] && domain->xperiodic == 0)
     error->all(FLERR,
-	       "Cannot use fix press/berendsen on a non-periodic dimension");
+               "Cannot use fix press/berendsen on a non-periodic dimension");
   if (p_flag[1] && domain->yperiodic == 0)
     error->all(FLERR,
-	       "Cannot use fix press/berendsen on a non-periodic dimension");
+               "Cannot use fix press/berendsen on a non-periodic dimension");
   if (p_flag[2] && domain->zperiodic == 0)
     error->all(FLERR,
-	       "Cannot use fix press/berendsen on a non-periodic dimension");
+               "Cannot use fix press/berendsen on a non-periodic dimension");
 
   if (pcouple == XYZ && dimension == 3 &&
-      (p_start[0] != p_start[1] || p_start[0] != p_start[2] || 
-       p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] || 
+      (p_start[0] != p_start[1] || p_start[0] != p_start[2] ||
+       p_stop[0] != p_stop[1] || p_stop[0] != p_stop[2] ||
        p_period[0] != p_period[1] || p_period[0] != p_period[2]))
     error->all(FLERR,"Invalid fix press/berendsen pressure settings");
   if (pcouple == XYZ && dimension == 2 &&
-      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
+      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] ||
        p_period[0] != p_period[1]))
     error->all(FLERR,"Invalid fix press/berendsen pressure settings");
-  if (pcouple == XY && 
-      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] || 
+  if (pcouple == XY &&
+      (p_start[0] != p_start[1] || p_stop[0] != p_stop[1] ||
        p_period[0] != p_period[1]))
     error->all(FLERR,"Invalid fix press/berendsen pressure settings");
-  if (pcouple == YZ && 
+  if (pcouple == YZ &&
       (p_start[1] != p_start[2] || p_stop[1] != p_stop[2] ||
        p_period[1] != p_period[2]))
     error->all(FLERR,"Invalid fix press/berendsen pressure settings");
-  if (pcouple == XZ && 
+  if (pcouple == XZ &&
       (p_start[0] != p_start[2] || p_stop[0] != p_stop[2] ||
        p_period[0] != p_period[2]))
     error->all(FLERR,"Invalid fix press/berendsen pressure settings");
 
-  if ((p_flag[0] && p_period[0] <= 0.0) || 
-      (p_flag[1] && p_period[1] <= 0.0) || 
+  if ((p_flag[0] && p_period[0] <= 0.0) ||
+      (p_flag[1] && p_period[1] <= 0.0) ||
       (p_flag[2] && p_period[2] <= 0.0))
     error->all(FLERR,"Fix press/berendsen damping parameters must be > 0.0");
 
@@ -279,7 +279,7 @@ int FixPressBerendsen::setmask()
 
 void FixPressBerendsen::init()
 {
-  if (domain->triclinic) 
+  if (domain->triclinic)
     error->all(FLERR,"Cannot use fix press/berendsen with triclinic box");
 
   // insure no conflict with fix deform
@@ -287,16 +287,16 @@ void FixPressBerendsen::init()
   for (int i = 0; i < modify->nfix; i++)
     if (strcmp(modify->fix[i]->style,"deform") == 0) {
       int *dimflag = ((FixDeform *) modify->fix[i])->dimflag;
-      if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || 
-	  (p_flag[2] && dimflag[2]))
-	error->all(FLERR,"Cannot use fix press/berendsen and "
-		   "fix deform on same component of stress tensor");
+      if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
+          (p_flag[2] && dimflag[2]))
+        error->all(FLERR,"Cannot use fix press/berendsen and "
+                   "fix deform on same component of stress tensor");
     }
 
   // set temperature and pressure ptrs
 
   int icompute = modify->find_compute(id_temp);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Temperature ID for fix press/berendsen does not exist");
   temperature = modify->compute[icompute];
 
@@ -331,7 +331,7 @@ void FixPressBerendsen::init()
 }
 
 /* ----------------------------------------------------------------------
-   compute T,P before integrator starts 
+   compute T,P before integrator starts
 ------------------------------------------------------------------------- */
 
 void FixPressBerendsen::setup(int vflag)
@@ -362,9 +362,9 @@ void FixPressBerendsen::end_of_step()
   for (int i = 0; i < 3; i++) {
     if (p_flag[i]) {
       p_target[i] = p_start[i] + delta * (p_stop[i]-p_start[i]);
-      dilation[i] = 
-	pow(1.0 - update->dt/p_period[i] * 
-	    (p_target[i]-p_current[i])/bulkmodulus,1.0/3.0);
+      dilation[i] =
+        pow(1.0 - update->dt/p_period[i] *
+            (p_target[i]-p_current[i])/bulkmodulus,1.0/3.0);
     }
   }
 
@@ -430,7 +430,7 @@ void FixPressBerendsen::remap()
   else {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	domain->x2lamda(x[i],x[i]);
+        domain->x2lamda(x[i],x[i]);
   }
 
   if (nrigid)
@@ -458,7 +458,7 @@ void FixPressBerendsen::remap()
   else {
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	domain->lamda2x(x[i],x[i]);
+        domain->lamda2x(x[i],x[i]);
   }
 
   if (nrigid)
@@ -491,9 +491,9 @@ int FixPressBerendsen::modify_param(int narg, char **arg)
       error->warning(FLERR,"Temperature for NPT is not for group all");
 
     // reset id_temp of pressure to new temperature ID
-    
+
     icompute = modify->find_compute(id_press);
-    if (icompute < 0) 
+    if (icompute < 0)
       error->all(FLERR,"Pressure ID for fix press/berendsen does not exist");
     modify->compute[icompute]->reset_extra_compute_fix(id_temp);
 
diff --git a/src/fix_press_berendsen.h b/src/fix_press_berendsen.h
index 2caf9ea61c..e54e5d35b0 100644
--- a/src/fix_press_berendsen.h
+++ b/src/fix_press_berendsen.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_print.cpp b/src/fix_print.cpp
index 7d2d5116a3..d422e4b843 100644
--- a/src/fix_print.cpp
+++ b/src/fix_print.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -51,13 +51,13 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) :
     if (strcmp(arg[iarg],"file") == 0 || strcmp(arg[iarg],"append") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix print command");
       if (me == 0) {
-	if (strcmp(arg[iarg],"file") == 0) fp = fopen(arg[iarg+1],"w");
-	else fp = fopen(arg[iarg+1],"a");
-	if (fp == NULL) {
-	  char str[128];
-	  sprintf(str,"Cannot open fix print file %s",arg[iarg+1]);
-	  error->one(FLERR,str);
-	}
+        if (strcmp(arg[iarg],"file") == 0) fp = fopen(arg[iarg+1],"w");
+        else fp = fopen(arg[iarg+1],"a");
+        if (fp == NULL) {
+          char str[128];
+          sprintf(str,"Cannot open fix print file %s",arg[iarg+1]);
+          error->one(FLERR,str);
+        }
       }
       iarg += 2;
     } else if (strcmp(arg[iarg],"screen") == 0) {
diff --git a/src/fix_print.h b/src/fix_print.h
index c874d2dcde..35c18d78f2 100644
--- a/src/fix_print.h
+++ b/src/fix_print.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_read_restart.cpp b/src/fix_read_restart.cpp
index e4d29a0a3b..30ca3d3acb 100644
--- a/src/fix_read_restart.cpp
+++ b/src/fix_read_restart.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) :
 FixReadRestart::~FixReadRestart()
 {
   // unregister callback to this fix from Atom class
- 
+
   atom->delete_callback(id,0);
 
   // delete locally stored arrays
diff --git a/src/fix_read_restart.h b/src/fix_read_restart.h
index 897fc468a9..4a97d60afd 100644
--- a/src/fix_read_restart.h
+++ b/src/fix_read_restart.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_recenter.cpp b/src/fix_recenter.cpp
index a93c1b7893..dbdbb19744 100644
--- a/src/fix_recenter.cpp
+++ b/src/fix_recenter.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_recenter.h b/src/fix_recenter.h
index ea78c09e3d..9b0977787f 100644
--- a/src/fix_recenter.h
+++ b/src/fix_recenter.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -66,7 +66,7 @@ Self-explanatory.
 
 W: Fix recenter should come after all other integration fixes
 
-Other fixes may change the position of the center-of-mass, so 
+Other fixes may change the position of the center-of-mass, so
 fix recenter should come last.
 
 */
diff --git a/src/fix_respa.cpp b/src/fix_respa.cpp
index f2fd4d1756..3a4afb09c2 100644
--- a/src/fix_respa.cpp
+++ b/src/fix_respa.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -58,7 +58,7 @@ int FixRespa::setmask()
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double FixRespa::memory_usage()
@@ -68,7 +68,7 @@ double FixRespa::memory_usage()
 }
 
 /* ----------------------------------------------------------------------
-   allocate local atom-based arrays 
+   allocate local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixRespa::grow_arrays(int nmax)
@@ -77,7 +77,7 @@ void FixRespa::grow_arrays(int nmax)
 }
 
 /* ----------------------------------------------------------------------
-   copy values within local atom-based arrays 
+   copy values within local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixRespa::copy_arrays(int i, int j)
@@ -90,7 +90,7 @@ void FixRespa::copy_arrays(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   pack values in local atom-based arrays for exchange with another proc 
+   pack values in local atom-based arrays for exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixRespa::pack_exchange(int i, double *buf)
@@ -105,7 +105,7 @@ int FixRespa::pack_exchange(int i, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   unpack values in local atom-based arrays from exchange with another proc 
+   unpack values in local atom-based arrays from exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixRespa::unpack_exchange(int nlocal, double *buf)
diff --git a/src/fix_respa.h b/src/fix_respa.h
index 74f53f1a6c..8eb6194028 100644
--- a/src/fix_respa.h
+++ b/src/fix_respa.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp
index b4af6c45e5..1c2080a50e 100644
--- a/src/fix_restrain.cpp
+++ b/src/fix_restrain.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -114,7 +114,7 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) :
 
   // require atom map to lookup atom IDs
 
-  if (atom->map_style == 0) 
+  if (atom->map_style == 0)
     error->all(FLERR,"Fix restrain requires an atom map, see atom_modify");
 }
 
@@ -227,9 +227,9 @@ void FixRestrain::restrain_bond(int m)
     if (i1 == -1) {
       char str[128];
       sprintf(str,
-	      "Restrain atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
-	      ids[m][0],ids[m][1],
-	      comm->me,update->ntimestep);
+              "Restrain atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
+              ids[m][0],ids[m][1],
+              comm->me,update->ntimestep);
       error->one(FLERR,str);
     }
   } else {
@@ -237,38 +237,38 @@ void FixRestrain::restrain_bond(int m)
     if (i1 == -1 || i2 == -1)  {
       char str[128];
       sprintf(str,
-	      "Restrain atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
-	      ids[m][0],ids[m][1],
-	      comm->me,update->ntimestep);
+              "Restrain atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
+              ids[m][0],ids[m][1],
+              comm->me,update->ntimestep);
       error->one(FLERR,str);
     }
   }
-  
+
   delx = x[i1][0] - x[i2][0];
   dely = x[i1][1] - x[i2][1];
   delz = x[i1][2] - x[i2][2];
   domain->minimum_image(delx,dely,delz);
-  
+
   rsq = delx*delx + dely*dely + delz*delz;
   r = sqrt(rsq);
   dr = r - target[m];
   rk = k * dr;
-  
+
   // force & energy
-  
+
   if (r > 0.0) fbond = -2.0*rk/r;
   else fbond = 0.0;
-  
+
   energy = rk*dr;
-  
+
   // apply force to each of 2 atoms
-  
+
   if (newton_bond || i1 < nlocal) {
     f[i1][0] += delx*fbond;
     f[i1][1] += dely*fbond;
     f[i1][2] += delz*fbond;
   }
-  
+
   if (newton_bond || i2 < nlocal) {
     f[i2][0] -= delx*fbond;
     f[i2][1] -= dely*fbond;
@@ -303,97 +303,97 @@ void FixRestrain::restrain_angle(int m)
 
   // newton_bond on: only processor owning i2 computes restraint
   // newton_bond off: only processors owning any of i1-i3 computes restraint
-  
+
   if (newton_bond) {
     if (i2 == -1 || i2 >= nlocal) return;
     if (i1 == -1 || i3 == -1) {
       char str[128];
       sprintf(str,
-	      "Restrain atoms %d %d %d missing on proc %d at step "
-	      BIGINT_FORMAT,
-	      ids[m][0],ids[m][1],ids[m][2],
-	      comm->me,update->ntimestep);
+              "Restrain atoms %d %d %d missing on proc %d at step "
+              BIGINT_FORMAT,
+              ids[m][0],ids[m][1],ids[m][2],
+              comm->me,update->ntimestep);
       error->one(FLERR,str);
     }
   } else {
     if ((i1 == -1 || i1 >= nlocal) && (i2 == -1 || i2 >= nlocal) &&
-	(i3 == -1 || i3 >= nlocal)) return;
+        (i3 == -1 || i3 >= nlocal)) return;
     if (i1 == -1 || i2 == -1 || i3 == -1) {
       char str[128];
       sprintf(str,
-	      "Restrain atoms %d %d %d missing on proc %d at step "
-	      BIGINT_FORMAT,
-	      ids[m][0],ids[m][1],ids[m][2],
-	      comm->me,update->ntimestep);
+              "Restrain atoms %d %d %d missing on proc %d at step "
+              BIGINT_FORMAT,
+              ids[m][0],ids[m][1],ids[m][2],
+              comm->me,update->ntimestep);
       error->one(FLERR,str);
     }
   }
- 
+
   // 1st bond
 
   delx1 = x[i1][0] - x[i2][0];
   dely1 = x[i1][1] - x[i2][1];
   delz1 = x[i1][2] - x[i2][2];
   domain->minimum_image(delx1,dely1,delz1);
-  
+
   rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1;
   r1 = sqrt(rsq1);
-  
+
   // 2nd bond
-  
+
   delx2 = x[i3][0] - x[i2][0];
   dely2 = x[i3][1] - x[i2][1];
   delz2 = x[i3][2] - x[i2][2];
   domain->minimum_image(delx2,dely2,delz2);
-  
+
   rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2;
   r2 = sqrt(rsq2);
-  
+
   // angle (cos and sin)
-  
+
   c = delx1*delx2 + dely1*dely2 + delz1*delz2;
   c /= r1*r2;
-  
+
   if (c > 1.0) c = 1.0;
   if (c < -1.0) c = -1.0;
-  
+
   s = sqrt(1.0 - c*c);
   if (s < SMALL) s = SMALL;
   s = 1.0/s;
-  
+
   // force & energy
-  
+
   dtheta = acos(c) - target[m];
   tk = k * dtheta;
-  
+
   energy = tk*dtheta;
-  
+
   a = -2.0 * tk * s;
   a11 = a*c / rsq1;
   a12 = -a / (r1*r2);
   a22 = a*c / rsq2;
-  
+
   f1[0] = a11*delx1 + a12*delx2;
   f1[1] = a11*dely1 + a12*dely2;
   f1[2] = a11*delz1 + a12*delz2;
   f3[0] = a22*delx2 + a12*delx1;
   f3[1] = a22*dely2 + a12*dely1;
   f3[2] = a22*delz2 + a12*delz1;
-  
+
   // apply force to each of 3 atoms
-  
+
   if (newton_bond || i1 < nlocal) {
     f[i1][0] += f1[0];
     f[i1][1] += f1[1];
     f[i1][2] += f1[2];
   }
-  
+
   if (newton_bond || i2 < nlocal) {
     f[i2][0] -= f1[0] + f3[0];
     f[i2][1] -= f1[1] + f3[1];
     f[i2][2] -= f1[2] + f3[2];
   }
-  
+
   if (newton_bond || i3 < nlocal) {
     f[i3][0] += f3[0];
     f[i3][1] += f3[1];
@@ -413,7 +413,7 @@ void FixRestrain::restrain_dihedral(int m)
   double 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 dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;  
+  double dtfx,dtfy,dtfz,dtgx,dtgy,dtgz,dthx,dthy,dthz;
   double c,s,p,sx2,sy2,sz2;
 
   double **x = atom->x;
@@ -438,22 +438,22 @@ void FixRestrain::restrain_dihedral(int m)
     if (i1 == -1 || i3 == -1 || i4 == -1) {
       char str[128];
       sprintf(str,
-	      "Restrain atoms %d %d %d %d missing on proc %d at step " 
-	      BIGINT_FORMAT,
-	      ids[m][0],ids[m][1],ids[m][2],ids[m][3],
-	      comm->me,update->ntimestep);
+              "Restrain atoms %d %d %d %d missing on proc %d at step "
+              BIGINT_FORMAT,
+              ids[m][0],ids[m][1],ids[m][2],ids[m][3],
+              comm->me,update->ntimestep);
       error->one(FLERR,str);
     }
   } else {
     if ((i1 == -1 || i1 >= nlocal) && (i2 == -1 || i2 >= nlocal) &&
-	(i3 == -1 || i3 >= nlocal) && (i4 == -1 || i3 >= nlocal)) return;
+        (i3 == -1 || i3 >= nlocal) && (i4 == -1 || i3 >= nlocal)) return;
     if (i1 == -1 || i2 == -1 || i3 == -1 || i4 == -1) {
       char str[128];
       sprintf(str,
-	      "Restrain atoms %d %d %d %d missing on proc %d at step " 
-	      BIGINT_FORMAT,
-	      ids[m][0],ids[m][1],ids[m][2],ids[m][3],
-	      comm->me,update->ntimestep);
+              "Restrain atoms %d %d %d %d missing on proc %d at step "
+              BIGINT_FORMAT,
+              ids[m][0],ids[m][1],ids[m][2],ids[m][3],
+              comm->me,update->ntimestep);
       error->one(FLERR,str);
     }
   }
@@ -464,96 +464,96 @@ void FixRestrain::restrain_dihedral(int m)
   vb1y = x[i1][1] - x[i2][1];
   vb1z = x[i1][2] - x[i2][2];
   domain->minimum_image(vb1x,vb1y,vb1z);
-  
+
   // 2nd bond
-  
+
   vb2x = x[i3][0] - x[i2][0];
   vb2y = x[i3][1] - x[i2][1];
   vb2z = x[i3][2] - x[i2][2];
   domain->minimum_image(vb2x,vb2y,vb2z);
-  
+
   vb2xm = -vb2x;
   vb2ym = -vb2y;
   vb2zm = -vb2z;
   domain->minimum_image(vb2xm,vb2ym,vb2zm);
-  
+
   // 3rd bond
-  
+
   vb3x = x[i4][0] - x[i3][0];
   vb3y = x[i4][1] - x[i3][1];
   vb3z = x[i4][2] - x[i3][2];
   domain->minimum_image(vb3x,vb3y,vb3z);
-  
+
   ax = vb1y*vb2zm - vb1z*vb2ym;
   ay = vb1z*vb2xm - vb1x*vb2zm;
   az = vb1x*vb2ym - vb1y*vb2xm;
   bx = vb3y*vb2zm - vb3z*vb2ym;
   by = vb3z*vb2xm - vb3x*vb2zm;
   bz = vb3x*vb2ym - vb3y*vb2xm;
-  
+
   rasq = ax*ax + ay*ay + az*az;
   rbsq = bx*bx + by*by + bz*bz;
   rgsq = vb2xm*vb2xm + vb2ym*vb2ym + vb2zm*vb2zm;
   rg = sqrt(rgsq);
-  
+
   rginv = ra2inv = rb2inv = 0.0;
   if (rg > 0) rginv = 1.0/rg;
   if (rasq > 0) ra2inv = 1.0/rasq;
   if (rbsq > 0) rb2inv = 1.0/rbsq;
   rabinv = sqrt(ra2inv*rb2inv);
-  
+
   c = (ax*bx + ay*by + az*bz)*rabinv;
   s = rg*rabinv*(ax*vb3x + ay*vb3y + az*vb3z);
-  
+
   // error check
-  
+
   if (c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) {
     int me;
     MPI_Comm_rank(world,&me);
     if (screen) {
       char str[128];
       sprintf(str,"Restrain problem: %d " BIGINT_FORMAT " %d %d %d %d",
-	      me,update->ntimestep,
-	      atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+              me,update->ntimestep,
+              atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
       error->warning(FLERR,str);
       fprintf(screen,"  1st atom: %d %g %g %g\n",
-	      me,x[i1][0],x[i1][1],x[i1][2]);
+              me,x[i1][0],x[i1][1],x[i1][2]);
       fprintf(screen,"  2nd atom: %d %g %g %g\n",
-	      me,x[i2][0],x[i2][1],x[i2][2]);
+              me,x[i2][0],x[i2][1],x[i2][2]);
       fprintf(screen,"  3rd atom: %d %g %g %g\n",
-	      me,x[i3][0],x[i3][1],x[i3][2]);
+              me,x[i3][0],x[i3][1],x[i3][2]);
       fprintf(screen,"  4th atom: %d %g %g %g\n",
-	      me,x[i4][0],x[i4][1],x[i4][2]);
+              me,x[i4][0],x[i4][1],x[i4][2]);
     }
   }
-  
+
   if (c > 1.0) c = 1.0;
   if (c < -1.0) c = -1.0;
-  
+
   mult = 1;  // multiplicity
   p = 1.0;
   df1 = 0.0;
-  
+
   for (i = 0; i < mult; i++) {
     ddf1 = p*c - df1*s;
     df1 = p*s + df1*c;
     p = ddf1;
   }
-  
+
   p = p*cos_target[m] + df1*sin_target[m];
   df1 = df1*cos_target[m] - ddf1*sin_target[m];
   df1 *= -mult;
   p += 1.0;
-  
-  energy = k * p; 
-  
+
+  energy = k * p;
+
   fg = vb1x*vb2xm + vb1y*vb2ym + vb1z*vb2zm;
   hg = vb3x*vb2xm + vb3y*vb2ym + vb3z*vb2zm;
   fga = fg*ra2inv*rginv;
   hgb = hg*rb2inv*rginv;
   gaa = -ra2inv*rg;
   gbb = rb2inv*rg;
-  
+
   dtfx = gaa*ax;
   dtfy = gaa*ay;
   dtfz = gaa*az;
@@ -563,49 +563,49 @@ void FixRestrain::restrain_dihedral(int m)
   dthx = gbb*bx;
   dthy = gbb*by;
   dthz = gbb*bz;
-  
+
   df = -k * df1;
-  
+
   sx2 = df*dtgx;
   sy2 = df*dtgy;
   sz2 = df*dtgz;
-  
+
   f1[0] = df*dtfx;
   f1[1] = df*dtfy;
   f1[2] = df*dtfz;
-  
+
   f2[0] = sx2 - f1[0];
   f2[1] = sy2 - f1[1];
   f2[2] = sz2 - f1[2];
-  
+
   f4[0] = df*dthx;
   f4[1] = df*dthy;
   f4[2] = df*dthz;
-  
+
   f3[0] = -sx2 - f4[0];
   f3[1] = -sy2 - f4[1];
   f3[2] = -sz2 - f4[2];
-  
+
   // apply force to each of 4 atoms
-  
+
   if (newton_bond || i1 < nlocal) {
     f[i1][0] += f1[0];
     f[i1][1] += f1[1];
     f[i1][2] += f1[2];
   }
-  
+
   if (newton_bond || i2 < nlocal) {
     f[i2][0] += f2[0];
     f[i2][1] += f2[1];
     f[i2][2] += f2[2];
   }
-  
+
   if (newton_bond || i3 < nlocal) {
     f[i3][0] += f3[0];
     f[i3][1] += f3[1];
     f[i3][2] += f3[2];
   }
-  
+
   if (newton_bond || i4 < nlocal) {
     f[i4][0] += f4[0];
     f[i4][1] += f4[1];
diff --git a/src/fix_restrain.h b/src/fix_restrain.h
index c1093bbce9..a36f95cc50 100644
--- a/src/fix_restrain.h
+++ b/src/fix_restrain.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_rigid.cpp b/src/fix_rigid.cpp
index 795cd49567..7b5cc0099f 100644
--- a/src/fix_rigid.cpp
+++ b/src/fix_rigid.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -156,8 +156,8 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
     int *igroups = new int[nbody];
     for (ibody = 0; ibody < nbody; ibody++) {
       igroups[ibody] = group->find(arg[5+ibody]);
-      if (igroups[ibody] == -1) 
-	error->all(FLERR,"Could not find fix rigid group ID");
+      if (igroups[ibody] == -1)
+        error->all(FLERR,"Could not find fix rigid group ID");
     }
 
     int *mask = atom->mask;
@@ -167,16 +167,16 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
     for (i = 0; i < nlocal; i++) {
       body[i] = -1;
       if (mask[i] & groupbit)
-	for (ibody = 0; ibody < nbody; ibody++)
-	  if (mask[i] & group->bitmask[igroups[ibody]]) {
-	    if (body[i] >= 0) flag = 1;
-	    body[i] = ibody;
-	  }
+        for (ibody = 0; ibody < nbody; ibody++)
+          if (mask[i] & group->bitmask[igroups[ibody]]) {
+            if (body[i] >= 0) flag = 1;
+            body[i] = ibody;
+          }
     }
 
     int flagall;
     MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
-    if (flagall) 
+    if (flagall)
       error->all(FLERR,"One or more atoms belong to multiple rigid bodies");
 
     delete [] igroups;
@@ -256,14 +256,14 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
       else error->all(FLERR,"Illegal fix rigid command");
 
       if (domain->dimension == 2 && zflag == 1.0)
-	error->all(FLERR,"Fix rigid z force cannot be on for 2d simulation");
+        error->all(FLERR,"Fix rigid z force cannot be on for 2d simulation");
 
       int count = 0;
       for (int m = mlo; m <= mhi; m++) {
-	fflag[m-1][0] = xflag;
-	fflag[m-1][1] = yflag;
-	fflag[m-1][2] = zflag;
-	count++;
+        fflag[m-1][0] = xflag;
+        fflag[m-1][1] = yflag;
+        fflag[m-1][2] = zflag;
+        count++;
       }
       if (count == 0) error->all(FLERR,"Illegal fix rigid command");
 
@@ -287,14 +287,14 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
       else error->all(FLERR,"Illegal fix rigid command");
 
       if (domain->dimension == 2 && (xflag == 1.0 || yflag == 1.0))
-	error->all(FLERR,"Fix rigid xy torque cannot be on for 2d simulation");
+        error->all(FLERR,"Fix rigid xy torque cannot be on for 2d simulation");
 
       int count = 0;
       for (int m = mlo; m <= mhi; m++) {
-	tflag[m-1][0] = xflag;
-	tflag[m-1][1] = yflag;
-	tflag[m-1][2] = zflag;
-	count++;
+        tflag[m-1][0] = xflag;
+        tflag[m-1][1] = yflag;
+        tflag[m-1][2] = zflag;
+        count++;
       }
       if (count == 0) error->all(FLERR,"Illegal fix rigid command");
 
@@ -303,21 +303,21 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"langevin") == 0) {
       if (iarg+5 > narg) error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(style,"rigid") != 0 && strcmp(style,"rigid/nve") != 0)
-	error->all(FLERR,"Illegal fix rigid command");
+        error->all(FLERR,"Illegal fix rigid command");
       langflag = 1;
       t_start = atof(arg[iarg+1]);
       t_stop = atof(arg[iarg+2]);
       t_period = atof(arg[iarg+3]);
       seed = atoi(arg[iarg+4]);
-      if (t_period <= 0.0) 
-	error->all(FLERR,"Fix rigid langevin period must be > 0.0");
+      if (t_period <= 0.0)
+        error->all(FLERR,"Fix rigid langevin period must be > 0.0");
       if (seed <= 0) error->all(FLERR,"Illegal fix rigid command");
       iarg += 5;
 
     } else if (strcmp(arg[iarg],"temp") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(style,"rigid/nvt") != 0 && strcmp(style,"rigid/npt") != 0)
-	error->all(FLERR,"Illegal fix rigid command");
+        error->all(FLERR,"Illegal fix rigid command");
       tempflag = 1;
       t_start = atof(arg[iarg+1]);
       t_stop = atof(arg[iarg+2]);
@@ -327,7 +327,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"press") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(style,"rigid/npt") != 0)
-	error->all(FLERR,"Illegal fix rigid command");
+        error->all(FLERR,"Illegal fix rigid command");
       pressflag = 1;
       p_start = atof(arg[iarg+1]);
       p_stop = atof(arg[iarg+2]);
@@ -337,7 +337,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"tparam") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(style,"rigid/nvt") != 0)
-	error->all(FLERR,"Illegal fix rigid command");
+        error->all(FLERR,"Illegal fix rigid command");
       t_chain = atoi(arg[iarg+1]);
       t_iter = atoi(arg[iarg+2]);
       t_order = atoi(arg[iarg+3]);
@@ -346,7 +346,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"pparam") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid command");
       if (strcmp(style,"rigid/npt") != 0)
-	error->all(FLERR,"Illegal fix rigid command");
+        error->all(FLERR,"Illegal fix rigid command");
       p_chain = atoi(arg[iarg+1]);
       iarg += 2;
 
@@ -370,7 +370,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
 
   // nrigid[n] = # of atoms in Nth rigid body
   // error if one or zero atoms
-  
+
   int *ncount = new int[nbody];
   for (ibody = 0; ibody < nbody; ibody++) ncount[ibody] = 0;
 
@@ -378,7 +378,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
 
   for (i = 0; i < nlocal; i++)
     if (body[i] >= 0) ncount[body[i]]++;
-  
+
   MPI_Allreduce(ncount,nrigid,nbody,MPI_INT,MPI_SUM,world);
   delete [] ncount;
 
@@ -417,7 +417,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
 
   int nsum = 0;
   for (ibody = 0; ibody < nbody; ibody++) nsum += nrigid[ibody];
-  
+
   if (me == 0) {
     if (screen) fprintf(screen,"%d rigid bodies with %d atoms\n",nbody,nsum);
     if (logfile) fprintf(logfile,"%d rigid bodies with %d atoms\n",nbody,nsum);
@@ -431,17 +431,17 @@ FixRigid::~FixRigid()
   // unregister callbacks to this fix from Atom class
 
   atom->delete_callback(id,0);
-  
+
   delete random;
 
   // delete locally stored arrays
-  
+
   memory->destroy(body);
   memory->destroy(displace);
   memory->destroy(eflags);
   memory->destroy(orient);
   memory->destroy(dorient);
-  
+
   // delete nbody-length arrays
 
   memory->destroy(nrigid);
@@ -505,7 +505,7 @@ void FixRigid::init()
   if (i < modify->nfix) {
     for (int j = i; j < modify->nfix; j++)
       if (strcmp(modify->fix[j]->style,"rigid") == 0)
-	error->all(FLERR,"Rigid fix must come before NPT/NPH fix");
+        error->all(FLERR,"Rigid fix must come before NPT/NPH fix");
   }
 
   // timestep info
@@ -538,7 +538,7 @@ void FixRigid::init()
   int *type = atom->type;
   int nlocal = atom->nlocal;
 
-  if (atom->radius_flag || atom->ellipsoid_flag || atom->line_flag || 
+  if (atom->radius_flag || atom->ellipsoid_flag || atom->line_flag ||
       atom->tri_flag || atom->mu_flag) {
     int flag = 0;
     for (i = 0; i < nlocal; i++) {
@@ -572,27 +572,27 @@ void FixRigid::init()
       // set to POINT or SPHERE or ELLIPSOID or LINE
 
       if (radius && radius[i] > 0.0) {
-	eflags[i] |= SPHERE;
-	eflags[i] |= OMEGA;
-	eflags[i] |= TORQUE;
+        eflags[i] |= SPHERE;
+        eflags[i] |= OMEGA;
+        eflags[i] |= TORQUE;
       } else if (ellipsoid && ellipsoid[i] >= 0) {
-	eflags[i] |= ELLIPSOID;
-	eflags[i] |= ANGMOM;
-	eflags[i] |= TORQUE;
+        eflags[i] |= ELLIPSOID;
+        eflags[i] |= ANGMOM;
+        eflags[i] |= TORQUE;
       } else if (line && line[i] >= 0) {
-	eflags[i] |= LINE;
-	eflags[i] |= OMEGA;
-	eflags[i] |= TORQUE;
+        eflags[i] |= LINE;
+        eflags[i] |= OMEGA;
+        eflags[i] |= TORQUE;
       } else if (tri && tri[i] >= 0) {
-	eflags[i] |= TRIANGLE;
-	eflags[i] |= ANGMOM;
-	eflags[i] |= TORQUE;
+        eflags[i] |= TRIANGLE;
+        eflags[i] |= ANGMOM;
+        eflags[i] |= TORQUE;
       } else eflags[i] |= POINT;
 
       // set DIPOLE if atom->mu and mu[3] > 0.0
 
       if (atom->mu_flag && mu[i][3] > 0.0)
-	eflags[i] |= DIPOLE;
+        eflags[i] |= DIPOLE;
     }
   }
 
@@ -601,7 +601,7 @@ void FixRigid::init()
 
   double **x = atom->x;
   int *image = atom->image;
-  
+
   int *periodicity = domain->periodicity;
   double xprd = domain->xprd;
   double yprd = domain->yprd;
@@ -614,7 +614,7 @@ void FixRigid::init()
     for (i = 0; i < 6; i++) sum[ibody][i] = 0.0;
   int xbox,ybox,zbox;
   double massone,xunwrap,yunwrap,zunwrap;
-  
+
   for (i = 0; i < nlocal; i++) {
     if (body[i] < 0) continue;
     ibody = body[i];
@@ -626,9 +626,9 @@ void FixRigid::init()
     else massone = mass[type[i]];
 
     if ((xbox && !periodicity[0]) || (ybox && !periodicity[1]) ||
-	(zbox && !periodicity[2]))
+        (zbox && !periodicity[2]))
       error->one(FLERR,"Fix rigid atom has non-zero image flag "
-		 "in a non-periodic dimension");
+                 "in a non-periodic dimension");
 
     if (triclinic == 0) {
       xunwrap = x[i][0] + xbox*xprd;
@@ -647,7 +647,7 @@ void FixRigid::init()
   }
 
   MPI_Allreduce(sum[0],all[0],6*nbody,MPI_DOUBLE,MPI_SUM,world);
-  
+
   for (ibody = 0; ibody < nbody; ibody++) {
     masstotal[ibody] = all[ibody][3];
     xcm[ibody][0] = all[ibody][0]/masstotal[ibody];
@@ -716,45 +716,45 @@ void FixRigid::init()
       else massone = mass[type[i]];
 
       if (eflags[i] & SPHERE) {
-	sum[ibody][0] += SINERTIA*massone * radius[i]*radius[i];
-	sum[ibody][1] += SINERTIA*massone * radius[i]*radius[i];
-	sum[ibody][2] += SINERTIA*massone * radius[i]*radius[i];
+        sum[ibody][0] += SINERTIA*massone * radius[i]*radius[i];
+        sum[ibody][1] += SINERTIA*massone * radius[i]*radius[i];
+        sum[ibody][2] += SINERTIA*massone * radius[i]*radius[i];
       } else if (eflags[i] & ELLIPSOID) {
-	shape = ebonus[ellipsoid[i]].shape;
-	quatatom = ebonus[ellipsoid[i]].quat;
-	MathExtra::inertia_ellipsoid(shape,quatatom,massone,ivec);
-	sum[ibody][0] += ivec[0];
-	sum[ibody][1] += ivec[1];
-	sum[ibody][2] += ivec[2];
-	sum[ibody][3] += ivec[3];
-	sum[ibody][4] += ivec[4];
-	sum[ibody][5] += ivec[5];
+        shape = ebonus[ellipsoid[i]].shape;
+        quatatom = ebonus[ellipsoid[i]].quat;
+        MathExtra::inertia_ellipsoid(shape,quatatom,massone,ivec);
+        sum[ibody][0] += ivec[0];
+        sum[ibody][1] += ivec[1];
+        sum[ibody][2] += ivec[2];
+        sum[ibody][3] += ivec[3];
+        sum[ibody][4] += ivec[4];
+        sum[ibody][5] += ivec[5];
       } else if (eflags[i] & LINE) {
-	length = lbonus[line[i]].length;
-	theta = lbonus[line[i]].theta;
-	MathExtra::inertia_line(length,theta,massone,ivec);
-	sum[ibody][0] += ivec[0];
-	sum[ibody][1] += ivec[1];
-	sum[ibody][2] += ivec[2];
-	sum[ibody][3] += ivec[3];
-	sum[ibody][4] += ivec[4];
-	sum[ibody][5] += ivec[5];
+        length = lbonus[line[i]].length;
+        theta = lbonus[line[i]].theta;
+        MathExtra::inertia_line(length,theta,massone,ivec);
+        sum[ibody][0] += ivec[0];
+        sum[ibody][1] += ivec[1];
+        sum[ibody][2] += ivec[2];
+        sum[ibody][3] += ivec[3];
+        sum[ibody][4] += ivec[4];
+        sum[ibody][5] += ivec[5];
       } else if (eflags[i] & TRIANGLE) {
-	inertiaatom = tbonus[tri[i]].inertia;
-	quatatom = tbonus[tri[i]].quat;
-	MathExtra::inertia_triangle(inertiaatom,quatatom,massone,ivec);
-	sum[ibody][0] += ivec[0];
-	sum[ibody][1] += ivec[1];
-	sum[ibody][2] += ivec[2];
-	sum[ibody][3] += ivec[3];
-	sum[ibody][4] += ivec[4];
-	sum[ibody][5] += ivec[5];
+        inertiaatom = tbonus[tri[i]].inertia;
+        quatatom = tbonus[tri[i]].quat;
+        MathExtra::inertia_triangle(inertiaatom,quatatom,massone,ivec);
+        sum[ibody][0] += ivec[0];
+        sum[ibody][1] += ivec[1];
+        sum[ibody][2] += ivec[2];
+        sum[ibody][3] += ivec[3];
+        sum[ibody][4] += ivec[4];
+        sum[ibody][5] += ivec[5];
       }
     }
   }
-  
+
   MPI_Allreduce(sum[0],all[0],6*nbody,MPI_DOUBLE,MPI_SUM,world);
-  
+
   // diagonalize inertia tensor for each body via Jacobi rotations
   // inertia = 3 eigenvalues = principal moments of inertia
   // evectors and exzy_space = 3 evectors = principal axes of rigid body
@@ -773,7 +773,7 @@ void FixRigid::init()
 
     ierror = MathExtra::jacobi(tensor,inertia[ibody],evectors);
     if (ierror) error->all(FLERR,
-			   "Insufficient Jacobi rotations for rigid body");
+                           "Insufficient Jacobi rotations for rigid body");
 
     ex_space[ibody][0] = evectors[0][0];
     ex_space[ibody][1] = evectors[1][0];
@@ -786,11 +786,11 @@ void FixRigid::init()
     ez_space[ibody][2] = evectors[2][2];
 
     // if any principal moment < scaled EPSILON, set to 0.0
-  
+
     double max;
     max = MAX(inertia[ibody][0],inertia[ibody][1]);
     max = MAX(max,inertia[ibody][2]);
-  
+
     if (inertia[ibody][0] < EPSILON*max) inertia[ibody][0] = 0.0;
     if (inertia[ibody][1] < EPSILON*max) inertia[ibody][1] = 0.0;
     if (inertia[ibody][2] < EPSILON*max) inertia[ibody][2] = 0.0;
@@ -803,9 +803,9 @@ void FixRigid::init()
       MathExtra::negate3(ez_space[ibody]);
 
     // create initial quaternion
-  
+
     MathExtra::exyz_to_q(ex_space[ibody],ey_space[ibody],ez_space[ibody],
-			 quat[ibody]);
+                         quat[ibody]);
   }
 
   // displace = initial atom coords in basis of principal axes
@@ -827,7 +827,7 @@ void FixRigid::init()
     xbox = (image[i] & 1023) - 512;
     ybox = (image[i] >> 10 & 1023) - 512;
     zbox = (image[i] >> 20) - 512;
-    
+
     if (triclinic == 0) {
       xunwrap = x[i][0] + xbox*xprd;
       yunwrap = x[i][1] + ybox*yprd;
@@ -837,65 +837,65 @@ void FixRigid::init()
       yunwrap = x[i][1] + ybox*yprd + zbox*yz;
       zunwrap = x[i][2] + zbox*zprd;
     }
-    
+
     delta[0] = xunwrap - xcm[ibody][0];
     delta[1] = yunwrap - xcm[ibody][1];
     delta[2] = zunwrap - xcm[ibody][2];
     MathExtra::transpose_matvec(ex_space[ibody],ey_space[ibody],
-				ez_space[ibody],delta,displace[i]);
+                                ez_space[ibody],delta,displace[i]);
 
     if (extended) {
       if (eflags[i] & ELLIPSOID) {
-	quatatom = ebonus[ellipsoid[i]].quat;
-	MathExtra::qconjugate(quat[ibody],qc);
-	MathExtra::quatquat(qc,quatatom,orient[i]);
-	MathExtra::qnormalize(orient[i]);
+        quatatom = ebonus[ellipsoid[i]].quat;
+        MathExtra::qconjugate(quat[ibody],qc);
+        MathExtra::quatquat(qc,quatatom,orient[i]);
+        MathExtra::qnormalize(orient[i]);
       } else if (eflags[i] & LINE) {
-	if (quat[ibody][3] >= 0.0) theta_body = 2.0*acos(quat[ibody][0]);
-	else theta_body = -2.0*acos(quat[ibody][0]);
-	orient[i][0] = lbonus[line[i]].theta - theta_body;
-	while (orient[i][0] <= MINUSPI) orient[i][0] += TWOPI;
-	while (orient[i][0] > MY_PI) orient[i][0] -= TWOPI;
-	if (orientflag == 4) orient[i][1] = orient[i][2] = orient[i][3] = 0.0;
+        if (quat[ibody][3] >= 0.0) theta_body = 2.0*acos(quat[ibody][0]);
+        else theta_body = -2.0*acos(quat[ibody][0]);
+        orient[i][0] = lbonus[line[i]].theta - theta_body;
+        while (orient[i][0] <= MINUSPI) orient[i][0] += TWOPI;
+        while (orient[i][0] > MY_PI) orient[i][0] -= TWOPI;
+        if (orientflag == 4) orient[i][1] = orient[i][2] = orient[i][3] = 0.0;
       } else if (eflags[i] & TRIANGLE) {
-	quatatom = tbonus[tri[i]].quat;
-	MathExtra::qconjugate(quat[ibody],qc);
-	MathExtra::quatquat(qc,quatatom,orient[i]);
-	MathExtra::qnormalize(orient[i]);
+        quatatom = tbonus[tri[i]].quat;
+        MathExtra::qconjugate(quat[ibody],qc);
+        MathExtra::quatquat(qc,quatatom,orient[i]);
+        MathExtra::qnormalize(orient[i]);
       } else if (orientflag == 4) {
-	orient[i][0] = orient[i][1] = orient[i][2] = orient[i][3] = 0.0;
+        orient[i][0] = orient[i][1] = orient[i][2] = orient[i][3] = 0.0;
       } else if (orientflag == 1)
-	orient[i][0] = 0.0;
+        orient[i][0] = 0.0;
 
       if (eflags[i] & DIPOLE) {
-	MathExtra::transpose_matvec(ex_space[ibody],ey_space[ibody],
-				    ez_space[ibody],mu[i],dorient[i]);
-	MathExtra::snormalize3(mu[i][3],dorient[i],dorient[i]);
+        MathExtra::transpose_matvec(ex_space[ibody],ey_space[ibody],
+                                    ez_space[ibody],mu[i],dorient[i]);
+        MathExtra::snormalize3(mu[i][3],dorient[i],dorient[i]);
       } else if (dorientflag)
-	dorient[i][0] = dorient[i][1] = dorient[i][2] = 0.0;
+        dorient[i][0] = dorient[i][1] = dorient[i][2] = 0.0;
     }
   }
-  
+
   // test for valid principal moments & axes
   // recompute moments of inertia around new axes
   // 3 diagonal moments should equal principal moments
   // 3 off-diagonal moments should be 0.0
   // extended particles may contribute extra terms to moments of inertia
-  
+
   for (ibody = 0; ibody < nbody; ibody++)
     for (i = 0; i < 6; i++) sum[ibody][i] = 0.0;
-  
+
   for (i = 0; i < nlocal; i++) {
     if (body[i] < 0) continue;
     ibody = body[i];
     if (rmass) massone = rmass[i];
     else massone = mass[type[i]];
 
-    sum[ibody][0] += massone * 
+    sum[ibody][0] += massone *
       (displace[i][1]*displace[i][1] + displace[i][2]*displace[i][2]);
-    sum[ibody][1] += massone * 
+    sum[ibody][1] += massone *
       (displace[i][0]*displace[i][0] + displace[i][2]*displace[i][2]);
-    sum[ibody][2] += massone * 
+    sum[ibody][2] += massone *
       (displace[i][0]*displace[i][0] + displace[i][1]*displace[i][1]);
     sum[ibody][3] -= massone * displace[i][1]*displace[i][2];
     sum[ibody][4] -= massone * displace[i][0]*displace[i][2];
@@ -914,36 +914,36 @@ void FixRigid::init()
       else massone = mass[type[i]];
 
       if (eflags[i] & SPHERE) {
-	sum[ibody][0] += SINERTIA*massone * radius[i]*radius[i];
-	sum[ibody][1] += SINERTIA*massone * radius[i]*radius[i];
-	sum[ibody][2] += SINERTIA*massone * radius[i]*radius[i];
+        sum[ibody][0] += SINERTIA*massone * radius[i]*radius[i];
+        sum[ibody][1] += SINERTIA*massone * radius[i]*radius[i];
+        sum[ibody][2] += SINERTIA*massone * radius[i]*radius[i];
       } else if (eflags[i] & ELLIPSOID) {
-	shape = ebonus[ellipsoid[i]].shape;
-	MathExtra::inertia_ellipsoid(shape,orient[i],massone,ivec);
-	sum[ibody][0] += ivec[0];
-	sum[ibody][1] += ivec[1];
-	sum[ibody][2] += ivec[2];
-	sum[ibody][3] += ivec[3];
-	sum[ibody][4] += ivec[4];
-	sum[ibody][5] += ivec[5];
+        shape = ebonus[ellipsoid[i]].shape;
+        MathExtra::inertia_ellipsoid(shape,orient[i],massone,ivec);
+        sum[ibody][0] += ivec[0];
+        sum[ibody][1] += ivec[1];
+        sum[ibody][2] += ivec[2];
+        sum[ibody][3] += ivec[3];
+        sum[ibody][4] += ivec[4];
+        sum[ibody][5] += ivec[5];
       } else if (eflags[i] & LINE) {
-	length = lbonus[line[i]].length;
-	MathExtra::inertia_line(length,orient[i][0],massone,ivec);
-	sum[ibody][0] += ivec[0];
-	sum[ibody][1] += ivec[1];
-	sum[ibody][2] += ivec[2];
-	sum[ibody][3] += ivec[3];
-	sum[ibody][4] += ivec[4];
-	sum[ibody][5] += ivec[5];
+        length = lbonus[line[i]].length;
+        MathExtra::inertia_line(length,orient[i][0],massone,ivec);
+        sum[ibody][0] += ivec[0];
+        sum[ibody][1] += ivec[1];
+        sum[ibody][2] += ivec[2];
+        sum[ibody][3] += ivec[3];
+        sum[ibody][4] += ivec[4];
+        sum[ibody][5] += ivec[5];
       } else if (eflags[i] & TRIANGLE) {
-	inertiaatom = tbonus[tri[i]].inertia;
-	MathExtra::inertia_triangle(inertiaatom,orient[i],massone,ivec);
-	sum[ibody][0] += ivec[0];
-	sum[ibody][1] += ivec[1];
-	sum[ibody][2] += ivec[2];
-	sum[ibody][3] += ivec[3];
-	sum[ibody][4] += ivec[4];
-	sum[ibody][5] += ivec[5];
+        inertiaatom = tbonus[tri[i]].inertia;
+        MathExtra::inertia_triangle(inertiaatom,orient[i],massone,ivec);
+        sum[ibody][0] += ivec[0];
+        sum[ibody][1] += ivec[1];
+        sum[ibody][2] += ivec[2];
+        sum[ibody][3] += ivec[3];
+        sum[ibody][4] += ivec[4];
+        sum[ibody][5] += ivec[5];
       }
     }
   }
@@ -954,29 +954,29 @@ void FixRigid::init()
   for (ibody = 0; ibody < nbody; ibody++) {
     if (inertia[ibody][0] == 0.0) {
       if (fabs(all[ibody][0]) > TOLERANCE)
-	error->all(FLERR,"Fix rigid: Bad principal moments");
+        error->all(FLERR,"Fix rigid: Bad principal moments");
     } else {
-      if (fabs((all[ibody][0]-inertia[ibody][0])/inertia[ibody][0]) > 
-	  TOLERANCE) error->all(FLERR,"Fix rigid: Bad principal moments");
+      if (fabs((all[ibody][0]-inertia[ibody][0])/inertia[ibody][0]) >
+          TOLERANCE) error->all(FLERR,"Fix rigid: Bad principal moments");
     }
     if (inertia[ibody][1] == 0.0) {
       if (fabs(all[ibody][1]) > TOLERANCE)
-	error->all(FLERR,"Fix rigid: Bad principal moments");
+        error->all(FLERR,"Fix rigid: Bad principal moments");
     } else {
-      if (fabs((all[ibody][1]-inertia[ibody][1])/inertia[ibody][1]) > 
-	  TOLERANCE) error->all(FLERR,"Fix rigid: Bad principal moments");
+      if (fabs((all[ibody][1]-inertia[ibody][1])/inertia[ibody][1]) >
+          TOLERANCE) error->all(FLERR,"Fix rigid: Bad principal moments");
     }
     if (inertia[ibody][2] == 0.0) {
       if (fabs(all[ibody][2]) > TOLERANCE)
-	error->all(FLERR,"Fix rigid: Bad principal moments");
+        error->all(FLERR,"Fix rigid: Bad principal moments");
     } else {
-      if (fabs((all[ibody][2]-inertia[ibody][2])/inertia[ibody][2]) > 
-	  TOLERANCE) error->all(FLERR,"Fix rigid: Bad principal moments");
+      if (fabs((all[ibody][2]-inertia[ibody][2])/inertia[ibody][2]) >
+          TOLERANCE) error->all(FLERR,"Fix rigid: Bad principal moments");
     }
     norm = (inertia[ibody][0] + inertia[ibody][1] + inertia[ibody][2]) / 3.0;
-    if (fabs(all[ibody][3]/norm) > TOLERANCE || 
-	fabs(all[ibody][4]/norm) > TOLERANCE ||
-	fabs(all[ibody][5]/norm) > TOLERANCE)
+    if (fabs(all[ibody][3]/norm) > TOLERANCE ||
+        fabs(all[ibody][4]/norm) > TOLERANCE ||
+        fabs(all[ibody][5]/norm) > TOLERANCE)
       error->all(FLERR,"Fix rigid: Bad principal moments");
   }
 
@@ -997,7 +997,7 @@ void FixRigid::setup(int vflag)
 {
   int i,n,ibody;
   double massone,radone;
-  
+
   // vcm = velocity of center-of-mass of each rigid body
   // fcm = force on center-of-mass of each rigid body
 
@@ -1010,7 +1010,7 @@ void FixRigid::setup(int vflag)
 
   for (ibody = 0; ibody < nbody; ibody++)
     for (i = 0; i < 6; i++) sum[ibody][i] = 0.0;
-  
+
   for (i = 0; i < nlocal; i++) {
     if (body[i] < 0) continue;
     ibody = body[i];
@@ -1024,7 +1024,7 @@ void FixRigid::setup(int vflag)
     sum[ibody][4] += f[i][1];
     sum[ibody][5] += f[i][2];
   }
-  
+
   MPI_Allreduce(sum[0],all[0],6*nbody,MPI_DOUBLE,MPI_SUM,world);
 
   for (ibody = 0; ibody < nbody; ibody++) {
@@ -1038,10 +1038,10 @@ void FixRigid::setup(int vflag)
 
   // angmom = angular momentum of each rigid body
   // torque = torque on each rigid body
-  
+
   int *image = atom->image;
   double **x = atom->x;
-  
+
   double xprd = domain->xprd;
   double yprd = domain->yprd;
   double zprd = domain->zprd;
@@ -1053,7 +1053,7 @@ void FixRigid::setup(int vflag)
     for (i = 0; i < 6; i++) sum[ibody][i] = 0.0;
   int xbox,ybox,zbox;
   double xunwrap,yunwrap,zunwrap,dx,dy,dz;
-  
+
   for (i = 0; i < nlocal; i++) {
     if (body[i] < 0) continue;
     ibody = body[i];
@@ -1075,7 +1075,7 @@ void FixRigid::setup(int vflag)
     dx = xunwrap - xcm[ibody][0];
     dy = yunwrap - xcm[ibody][1];
     dz = zunwrap - xcm[ibody][2];
-    
+
     if (rmass) massone = rmass[i];
     else massone = mass[type[i]];
 
@@ -1103,29 +1103,29 @@ void FixRigid::setup(int vflag)
       ibody = body[i];
 
       if (eflags[i] & OMEGA) {
-	if (eflags[i] & SPHERE) {
-	  radone = radius[i];
-	  sum[ibody][0] += SINERTIA*rmass[i] * radone*radone * omega_one[i][0];
-	  sum[ibody][1] += SINERTIA*rmass[i] * radone*radone * omega_one[i][1];
-	  sum[ibody][2] += SINERTIA*rmass[i] * radone*radone * omega_one[i][2];
-	} else if (eflags[i] & LINE) {
-	  radone = lbonus[line[i]].length;
-	  sum[ibody][2] += LINERTIA*rmass[i] * radone*radone * omega_one[i][2];
-	}
+        if (eflags[i] & SPHERE) {
+          radone = radius[i];
+          sum[ibody][0] += SINERTIA*rmass[i] * radone*radone * omega_one[i][0];
+          sum[ibody][1] += SINERTIA*rmass[i] * radone*radone * omega_one[i][1];
+          sum[ibody][2] += SINERTIA*rmass[i] * radone*radone * omega_one[i][2];
+        } else if (eflags[i] & LINE) {
+          radone = lbonus[line[i]].length;
+          sum[ibody][2] += LINERTIA*rmass[i] * radone*radone * omega_one[i][2];
+        }
       }
       if (eflags[i] & ANGMOM) {
-	sum[ibody][0] += angmom_one[i][0];
-	sum[ibody][1] += angmom_one[i][1];
-	sum[ibody][2] += angmom_one[i][2];
+        sum[ibody][0] += angmom_one[i][0];
+        sum[ibody][1] += angmom_one[i][1];
+        sum[ibody][2] += angmom_one[i][2];
       }
       if (eflags[i] & TORQUE) {
-	sum[ibody][3] += torque_one[i][0];
-	sum[ibody][4] += torque_one[i][1];
-	sum[ibody][5] += torque_one[i][2];
+        sum[ibody][3] += torque_one[i][0];
+        sum[ibody][4] += torque_one[i][1];
+        sum[ibody][5] += torque_one[i][2];
       }
     }
   }
-  
+
   MPI_Allreduce(sum[0],all[0],6*nbody,MPI_DOUBLE,MPI_SUM,world);
 
   for (ibody = 0; ibody < nbody; ibody++) {
@@ -1153,7 +1153,7 @@ void FixRigid::setup(int vflag)
 
   for (ibody = 0; ibody < nbody; ibody++)
     MathExtra::angmom_to_omega(angmom[ibody],ex_space[ibody],ey_space[ibody],
-			       ez_space[ibody],inertia[ibody],omega[ibody]);
+                               ez_space[ibody],inertia[ibody],omega[ibody]);
   set_v();
 
   // guesstimate virial as 2x the set_v contribution
@@ -1163,7 +1163,7 @@ void FixRigid::setup(int vflag)
   if (vflag_atom) {
     for (i = 0; i < nlocal; i++)
       for (n = 0; n < 6; n++)
-	vatom[i][n] *= 2.0;
+        vatom[i][n] *= 2.0;
   }
 }
 
@@ -1176,20 +1176,20 @@ void FixRigid::initial_integrate(int vflag)
   for (int ibody = 0; ibody < nbody; ibody++) {
 
     // update vcm by 1/2 step
-  
+
     dtfm = dtf / masstotal[ibody];
     vcm[ibody][0] += dtfm * fcm[ibody][0] * fflag[ibody][0];
     vcm[ibody][1] += dtfm * fcm[ibody][1] * fflag[ibody][1];
     vcm[ibody][2] += dtfm * fcm[ibody][2] * fflag[ibody][2];
-  
+
     // update xcm by full step
-  
+
     xcm[ibody][0] += dtv * vcm[ibody][0];
     xcm[ibody][1] += dtv * vcm[ibody][1];
     xcm[ibody][2] += dtv * vcm[ibody][2];
-  
+
     // update angular momentum by 1/2 step
-    
+
     angmom[ibody][0] += dtf * torque[ibody][0] * tflag[ibody][0];
     angmom[ibody][1] += dtf * torque[ibody][1] * tflag[ibody][1];
     angmom[ibody][2] += dtf * torque[ibody][2] * tflag[ibody][2];
@@ -1200,11 +1200,11 @@ void FixRigid::initial_integrate(int vflag)
     // update ex,ey,ez to reflect new quaternion
 
     MathExtra::angmom_to_omega(angmom[ibody],ex_space[ibody],ey_space[ibody],
-			       ez_space[ibody],inertia[ibody],omega[ibody]);
+                               ez_space[ibody],inertia[ibody],omega[ibody]);
     MathExtra::richardson(quat[ibody],angmom[ibody],omega[ibody],
-			  inertia[ibody],dtq);
+                          inertia[ibody],dtq);
     MathExtra::q_to_exyz(quat[ibody],
-			 ex_space[ibody],ey_space[ibody],ez_space[ibody]);
+                         ex_space[ibody],ey_space[ibody],ez_space[ibody]);
   }
 
   // virial setup before call to set_xv
@@ -1214,7 +1214,7 @@ void FixRigid::initial_integrate(int vflag)
 
   // set coords/orient and velocity/rotation of atoms in rigid bodies
   // from quarternion and omega
-  
+
   set_xv();
 }
 
@@ -1239,23 +1239,23 @@ void FixRigid::post_force(int vflag)
     double dt = update->dt;
     double mvv2e = force->mvv2e;
     double ftm2v = force->ftm2v;
-    
+
     for (int i = 0; i < nbody; i++) {
       gamma1 = -masstotal[i] / t_period / ftm2v;
-      gamma2 = sqrt(masstotal[i]) * tsqrt * 
-	sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
+      gamma2 = sqrt(masstotal[i]) * tsqrt *
+        sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
       langextra[i][0] = gamma1*vcm[i][0] + gamma2*(random->uniform()-0.5);
       langextra[i][1] = gamma1*vcm[i][1] + gamma2*(random->uniform()-0.5);
       langextra[i][2] = gamma1*vcm[i][2] + gamma2*(random->uniform()-0.5);
 
       gamma1 = -1.0 / t_period / ftm2v;
       gamma2 = tsqrt * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;
-      langextra[i][3] = inertia[i][0]*gamma1*omega[i][0] + 
-	sqrt(inertia[i][0])*gamma2*(random->uniform()-0.5);
-      langextra[i][4] = inertia[i][1]*gamma1*omega[i][1] + 
-	sqrt(inertia[i][1])*gamma2*(random->uniform()-0.5);
-      langextra[i][5] = inertia[i][2]*gamma1*omega[i][2] + 
-	sqrt(inertia[i][2])*gamma2*(random->uniform()-0.5);
+      langextra[i][3] = inertia[i][0]*gamma1*omega[i][0] +
+        sqrt(inertia[i][0])*gamma2*(random->uniform()-0.5);
+      langextra[i][4] = inertia[i][1]*gamma1*omega[i][1] +
+        sqrt(inertia[i][1])*gamma2*(random->uniform()-0.5);
+      langextra[i][5] = inertia[i][2]*gamma1*omega[i][2] +
+        sqrt(inertia[i][2])*gamma2*(random->uniform()-0.5);
     }
   }
 
@@ -1270,12 +1270,12 @@ void FixRigid::final_integrate()
   double dtfm,xy,xz,yz;
 
   // sum over atoms to get force and torque on rigid body
-  
+
   int *image = atom->image;
   double **x = atom->x;
   double **f = atom->f;
   int nlocal = atom->nlocal;
-  
+
   double xprd = domain->xprd;
   double yprd = domain->yprd;
   double zprd = domain->zprd;
@@ -1289,7 +1289,7 @@ void FixRigid::final_integrate()
   double xunwrap,yunwrap,zunwrap,dx,dy,dz;
   for (ibody = 0; ibody < nbody; ibody++)
     for (i = 0; i < 6; i++) sum[ibody][i] = 0.0;
-  
+
   for (i = 0; i < nlocal; i++) {
     if (body[i] < 0) continue;
     ibody = body[i];
@@ -1297,7 +1297,7 @@ void FixRigid::final_integrate()
     sum[ibody][0] += f[i][0];
     sum[ibody][1] += f[i][1];
     sum[ibody][2] += f[i][2];
-      
+
     xbox = (image[i] & 1023) - 512;
     ybox = (image[i] >> 10 & 1023) - 512;
     zbox = (image[i] >> 20) - 512;
@@ -1315,7 +1315,7 @@ void FixRigid::final_integrate()
     dx = xunwrap - xcm[ibody][0];
     dy = yunwrap - xcm[ibody][1];
     dz = zunwrap - xcm[ibody][2];
-    
+
     sum[ibody][3] += dy*f[i][2] - dz*f[i][1];
     sum[ibody][4] += dz*f[i][0] - dx*f[i][2];
     sum[ibody][5] += dx*f[i][1] - dy*f[i][0];
@@ -1331,15 +1331,15 @@ void FixRigid::final_integrate()
       ibody = body[i];
 
       if (eflags[i] & TORQUE) {
-	sum[ibody][3] += torque_one[i][0];
-	sum[ibody][4] += torque_one[i][1];
-	sum[ibody][5] += torque_one[i][2];
+        sum[ibody][3] += torque_one[i][0];
+        sum[ibody][4] += torque_one[i][1];
+        sum[ibody][5] += torque_one[i][2];
       }
     }
   }
 
   MPI_Allreduce(sum[0],all[0],6*nbody,MPI_DOUBLE,MPI_SUM,world);
-  
+
   // update vcm and angmom
   // include Langevin thermostat forces
   // fflag,tflag = 0 for some dimensions in 2d
@@ -1353,20 +1353,20 @@ void FixRigid::final_integrate()
     torque[ibody][2] = all[ibody][5] + langextra[ibody][5];
 
     // update vcm by 1/2 step
-  
+
     dtfm = dtf / masstotal[ibody];
     vcm[ibody][0] += dtfm * fcm[ibody][0] * fflag[ibody][0];
     vcm[ibody][1] += dtfm * fcm[ibody][1] * fflag[ibody][1];
     vcm[ibody][2] += dtfm * fcm[ibody][2] * fflag[ibody][2];
-  
+
     // update angular momentum by 1/2 step
-    
+
     angmom[ibody][0] += dtf * torque[ibody][0] * tflag[ibody][0];
     angmom[ibody][1] += dtf * torque[ibody][1] * tflag[ibody][1];
     angmom[ibody][2] += dtf * torque[ibody][2] * tflag[ibody][2];
 
     MathExtra::angmom_to_omega(angmom[ibody],ex_space[ibody],ey_space[ibody],
-			       ez_space[ibody],inertia[ibody],omega[ibody]);
+                               ez_space[ibody],inertia[ibody],omega[ibody]);
   }
 
   // set velocity/rotation of atoms in rigid bodies
@@ -1380,11 +1380,11 @@ void FixRigid::final_integrate()
    see Miller paper cited in fix rigid/nvt and fix rigid/npt
 ------------------------------------------------------------------------- */
 
-void FixRigid::no_squish_rotate(int k, double *p, double *q, 
-				double *inertia, double dt)
+void FixRigid::no_squish_rotate(int k, double *p, double *q,
+                                double *inertia, double dt)
 {
   double phi,c_phi,s_phi,kp[4],kq[4];
-  
+
   // apply permuation operator on p and q, get kp and kq
 
   if (k == 1) {
@@ -1403,22 +1403,22 @@ void FixRigid::no_squish_rotate(int k, double *p, double *q,
     kq[2] = -q[1];  kp[2] = -p[1];
     kq[3] =  q[0];  kp[3] =  p[0];
   }
-    
+
   // obtain phi, cosines and sines
-  
+
   phi = p[0]*kq[0] + p[1]*kq[1] + p[2]*kq[2] + p[3]*kq[3];
-  if (fabs(inertia[k-1]) < 1e-6) phi *= 0.0;	
+  if (fabs(inertia[k-1]) < 1e-6) phi *= 0.0;
   else phi /= 4.0 * inertia[k-1];
   c_phi = cos(dt * phi);
   s_phi = sin(dt * phi);
-  
+
   // advance p and q
-  
+
   p[0] = c_phi*p[0] + s_phi*kp[0];
   p[1] = c_phi*p[1] + s_phi*kp[1];
   p[2] = c_phi*p[2] + s_phi*kp[2];
   p[3] = c_phi*p[3] + s_phi*kp[3];
-  
+
   q[0] = c_phi*q[0] + s_phi*kq[0];
   q[1] = c_phi*q[1] + s_phi*kq[1];
   q[2] = c_phi*q[2] + s_phi*kq[2];
@@ -1464,7 +1464,7 @@ void FixRigid::pre_neighbor()
   for (int ibody = 0; ibody < nbody; ibody++) {
     original = imagebody[ibody];
     domain->remap(xcm[ibody],imagebody[ibody]);
-    
+
     if (original == imagebody[ibody]) remapflag[ibody][3] = 0;
     else {
       oldimage = original & 1023;
@@ -1517,7 +1517,7 @@ void FixRigid::pre_neighbor()
 }
 
 /* ----------------------------------------------------------------------
-   count # of degrees-of-freedom removed by fix_rigid for atoms in igroup 
+   count # of degrees-of-freedom removed by fix_rigid for atoms in igroup
 ------------------------------------------------------------------------- */
 
 int FixRigid::dof(int igroup)
@@ -1551,8 +1551,8 @@ int FixRigid::dof(int igroup)
 
   int flag = 0;
   for (int ibody = 0; ibody < nbody; ibody++) {
-    if (nall[ibody]+mall[ibody] > 0 && 
-	nall[ibody]+mall[ibody] != nrigid[ibody]) flag = 1;
+    if (nall[ibody]+mall[ibody] > 0 &&
+        nall[ibody]+mall[ibody] != nrigid[ibody]) flag = 1;
   }
   if (flag && me == 0)
     error->warning(FLERR,"Computing temperature of portions of rigid bodies");
@@ -1572,14 +1572,14 @@ int FixRigid::dof(int igroup)
   if (domain->dimension == 3) {
     for (int ibody = 0; ibody < nbody; ibody++)
       if (nall[ibody]+mall[ibody] == nrigid[ibody]) {
-	n += 3*nall[ibody] + 6*mall[ibody] - 6;
-	if (inertia[ibody][0] == 0.0 || inertia[ibody][1] == 0.0 || 
-	    inertia[ibody][2] == 0.0) n++;
+        n += 3*nall[ibody] + 6*mall[ibody] - 6;
+        if (inertia[ibody][0] == 0.0 || inertia[ibody][1] == 0.0 ||
+            inertia[ibody][2] == 0.0) n++;
       }
   } else if (domain->dimension == 2) {
     for (int ibody = 0; ibody < nbody; ibody++)
       if (nall[ibody]+mall[ibody] == nrigid[ibody])
-	n += 2*nall[ibody] + 3*mall[ibody] - 3;
+        n += 2*nall[ibody] + 3*mall[ibody] - 3;
   }
 
   delete [] ncount;
@@ -1598,7 +1598,7 @@ int FixRigid::dof(int igroup)
 
 void FixRigid::deform(int flag)
 {
-  if (flag == 0) 
+  if (flag == 0)
     for (int ibody = 0; ibody < nbody; ibody++)
       domain->x2lamda(xcm[ibody],xcm[ibody]);
   else
@@ -1625,11 +1625,11 @@ void FixRigid::set_xv()
   double **x = atom->x;
   double **v = atom->v;
   double **f = atom->f;
-  double *rmass = atom->rmass; 
-  double *mass = atom->mass; 
+  double *rmass = atom->rmass;
+  double *mass = atom->mass;
   int *type = atom->type;
   int nlocal = atom->nlocal;
-  
+
   double xprd = domain->xprd;
   double yprd = domain->yprd;
   double zprd = domain->zprd;
@@ -1641,7 +1641,7 @@ void FixRigid::set_xv()
   }
 
   // set x and v of each atom
-  
+
   for (int i = 0; i < nlocal; i++) {
     if (body[i] < 0) continue;
     ibody = body[i];
@@ -1654,13 +1654,13 @@ void FixRigid::set_xv()
 
     if (evflag) {
       if (triclinic == 0) {
-	x0 = x[i][0] + xbox*xprd;
-	x1 = x[i][1] + ybox*yprd;
-	x2 = x[i][2] + zbox*zprd;
+        x0 = x[i][0] + xbox*xprd;
+        x1 = x[i][1] + ybox*yprd;
+        x2 = x[i][2] + zbox*zprd;
       } else {
-	x0 = x[i][0] + xbox*xprd + ybox*xy + zbox*xz;
-	x1 = x[i][1] + ybox*yprd + zbox*yz;
-	x2 = x[i][2] + zbox*zprd;
+        x0 = x[i][0] + xbox*xprd + ybox*xy + zbox*xz;
+        x1 = x[i][1] + ybox*yprd + zbox*yz;
+        x2 = x[i][2] + zbox*zprd;
       }
       v0 = v[i][0];
       v1 = v[i][1];
@@ -1671,7 +1671,7 @@ void FixRigid::set_xv()
     // v = vcm + omega around center-of-mass
 
     MathExtra::matvec(ex_space[ibody],ey_space[ibody],
-		      ez_space[ibody],displace[i],x[i]);
+                      ez_space[ibody],displace[i],x[i]);
 
     v[i][0] = omega[ibody][1]*x[i][2] - omega[ibody][2]*x[i][1] +
       vcm[ibody][0];
@@ -1705,7 +1705,7 @@ void FixRigid::set_xv()
       else massone = mass[type[i]];
       fc0 = massone*(v[i][0] - v0)/dtf - f[i][0];
       fc1 = massone*(v[i][1] - v1)/dtf - f[i][1];
-      fc2 = massone*(v[i][2] - v2)/dtf - f[i][2]; 
+      fc2 = massone*(v[i][2] - v2)/dtf - f[i][2];
 
       vr[0] = 0.5*x0*fc0;
       vr[1] = 0.5*x1*fc1;
@@ -1719,7 +1719,7 @@ void FixRigid::set_xv()
   }
 
   // set orientation, omega, angmom of each extended particle
-  
+
   if (extended) {
     double theta_body,theta;
     double *shape,*quatatom,*inertiaatom;
@@ -1742,43 +1742,43 @@ void FixRigid::set_xv()
       ibody = body[i];
 
       if (eflags[i] & SPHERE) {
-	omega_one[i][0] = omega[ibody][0];
-	omega_one[i][1] = omega[ibody][1];
-	omega_one[i][2] = omega[ibody][2];
+        omega_one[i][0] = omega[ibody][0];
+        omega_one[i][1] = omega[ibody][1];
+        omega_one[i][2] = omega[ibody][2];
       } else if (eflags[i] & ELLIPSOID) {
-	shape = ebonus[ellipsoid[i]].shape;
-	quatatom = ebonus[ellipsoid[i]].quat;
-	MathExtra::quatquat(quat[ibody],orient[i],quatatom);
-	MathExtra::qnormalize(quatatom);
-	ione[0] = EINERTIA*rmass[i] * (shape[1]*shape[1] + shape[2]*shape[2]);
-	ione[1] = EINERTIA*rmass[i] * (shape[0]*shape[0] + shape[2]*shape[2]);
-	ione[2] = EINERTIA*rmass[i] * (shape[0]*shape[0] + shape[1]*shape[1]);
-	MathExtra::q_to_exyz(quatatom,exone,eyone,ezone);
-	MathExtra::omega_to_angmom(omega[ibody],exone,eyone,ezone,ione,
-				   angmom_one[i]);
+        shape = ebonus[ellipsoid[i]].shape;
+        quatatom = ebonus[ellipsoid[i]].quat;
+        MathExtra::quatquat(quat[ibody],orient[i],quatatom);
+        MathExtra::qnormalize(quatatom);
+        ione[0] = EINERTIA*rmass[i] * (shape[1]*shape[1] + shape[2]*shape[2]);
+        ione[1] = EINERTIA*rmass[i] * (shape[0]*shape[0] + shape[2]*shape[2]);
+        ione[2] = EINERTIA*rmass[i] * (shape[0]*shape[0] + shape[1]*shape[1]);
+        MathExtra::q_to_exyz(quatatom,exone,eyone,ezone);
+        MathExtra::omega_to_angmom(omega[ibody],exone,eyone,ezone,ione,
+                                   angmom_one[i]);
       } else if (eflags[i] & LINE) {
-	if (quat[ibody][3] >= 0.0) theta_body = 2.0*acos(quat[ibody][0]);
-	else theta_body = -2.0*acos(quat[ibody][0]);
-	theta = orient[i][0] + theta_body;
-	while (theta <= MINUSPI) theta += TWOPI;
-	while (theta > MY_PI) theta -= TWOPI;
-	lbonus[line[i]].theta = theta;
-	omega_one[i][0] = omega[ibody][0];
-	omega_one[i][1] = omega[ibody][1];
-	omega_one[i][2] = omega[ibody][2];
+        if (quat[ibody][3] >= 0.0) theta_body = 2.0*acos(quat[ibody][0]);
+        else theta_body = -2.0*acos(quat[ibody][0]);
+        theta = orient[i][0] + theta_body;
+        while (theta <= MINUSPI) theta += TWOPI;
+        while (theta > MY_PI) theta -= TWOPI;
+        lbonus[line[i]].theta = theta;
+        omega_one[i][0] = omega[ibody][0];
+        omega_one[i][1] = omega[ibody][1];
+        omega_one[i][2] = omega[ibody][2];
       } else if (eflags[i] & TRIANGLE) {
-	inertiaatom = tbonus[tri[i]].inertia;
-	quatatom = tbonus[tri[i]].quat;
-	MathExtra::quatquat(quat[ibody],orient[i],quatatom);
-	MathExtra::qnormalize(quatatom);
-	MathExtra::q_to_exyz(quatatom,exone,eyone,ezone);
-	MathExtra::omega_to_angmom(omega[ibody],exone,eyone,ezone,
-				   inertiaatom,angmom_one[i]);
+        inertiaatom = tbonus[tri[i]].inertia;
+        quatatom = tbonus[tri[i]].quat;
+        MathExtra::quatquat(quat[ibody],orient[i],quatatom);
+        MathExtra::qnormalize(quatatom);
+        MathExtra::q_to_exyz(quatatom,exone,eyone,ezone);
+        MathExtra::omega_to_angmom(omega[ibody],exone,eyone,ezone,
+                                   inertiaatom,angmom_one[i]);
       }
       if (eflags[i] & DIPOLE) {
-	MathExtra::quat_to_mat(quat[ibody],p);
-	MathExtra::matvec(p,dorient[i],mu[i]);
-	MathExtra::snormalize3(mu[i][3],mu[i],mu[i]);
+        MathExtra::quat_to_mat(quat[ibody],p);
+        MathExtra::matvec(p,dorient[i],mu[i]);
+        MathExtra::snormalize3(mu[i][3],mu[i],mu[i]);
       }
     }
   }
@@ -1802,8 +1802,8 @@ void FixRigid::set_v()
   double **x = atom->x;
   double **v = atom->v;
   double **f = atom->f;
-  double *rmass = atom->rmass; 
-  double *mass = atom->mass; 
+  double *rmass = atom->rmass;
+  double *mass = atom->mass;
   int *type = atom->type;
   int *image = atom->image;
   int nlocal = atom->nlocal;
@@ -1824,7 +1824,7 @@ void FixRigid::set_v()
     ibody = body[i];
 
     MathExtra::matvec(ex_space[ibody],ey_space[ibody],
-		      ez_space[ibody],displace[i],delta);
+                      ez_space[ibody],displace[i],delta);
 
     // save old velocities for virial
 
@@ -1834,11 +1834,11 @@ void FixRigid::set_v()
       v2 = v[i][2];
     }
 
-    v[i][0] = omega[ibody][1]*delta[2] - omega[ibody][2]*delta[1] + 
+    v[i][0] = omega[ibody][1]*delta[2] - omega[ibody][2]*delta[1] +
       vcm[ibody][0];
-    v[i][1] = omega[ibody][2]*delta[0] - omega[ibody][0]*delta[2] + 
+    v[i][1] = omega[ibody][2]*delta[0] - omega[ibody][0]*delta[2] +
       vcm[ibody][1];
-    v[i][2] = omega[ibody][0]*delta[1] - omega[ibody][1]*delta[0] + 
+    v[i][2] = omega[ibody][0]*delta[1] - omega[ibody][1]*delta[0] +
       vcm[ibody][2];
 
     // virial = unwrapped coords dotted into body constraint force
@@ -1852,20 +1852,20 @@ void FixRigid::set_v()
       else massone = mass[type[i]];
       fc0 = massone*(v[i][0] - v0)/dtf - f[i][0];
       fc1 = massone*(v[i][1] - v1)/dtf - f[i][1];
-      fc2 = massone*(v[i][2] - v2)/dtf - f[i][2]; 
+      fc2 = massone*(v[i][2] - v2)/dtf - f[i][2];
 
       xbox = (image[i] & 1023) - 512;
       ybox = (image[i] >> 10 & 1023) - 512;
       zbox = (image[i] >> 20) - 512;
 
       if (triclinic == 0) {
-	x0 = x[i][0] + xbox*xprd;
-	x1 = x[i][1] + ybox*yprd;
-	x2 = x[i][2] + zbox*zprd;
+        x0 = x[i][0] + xbox*xprd;
+        x1 = x[i][1] + ybox*yprd;
+        x2 = x[i][2] + zbox*zprd;
       } else {
-	x0 = x[i][0] + xbox*xprd + ybox*xy + zbox*xz;
-	x1 = x[i][1] + ybox*yprd + zbox*yz;
-	x2 = x[i][2] + zbox*zprd;
+        x0 = x[i][0] + xbox*xprd + ybox*xy + zbox*xz;
+        x1 = x[i][1] + ybox*yprd + zbox*yz;
+        x2 = x[i][2] + zbox*zprd;
       }
 
       vr[0] = 0.5*x0*fc0;
@@ -1880,7 +1880,7 @@ void FixRigid::set_v()
   }
 
   // set omega, angmom of each extended particle
-  
+
   if (extended) {
     double *shape,*quatatom,*inertiaatom;
 
@@ -1898,35 +1898,35 @@ void FixRigid::set_v()
       ibody = body[i];
 
       if (eflags[i] & SPHERE) {
-	omega_one[i][0] = omega[ibody][0];
-	omega_one[i][1] = omega[ibody][1];
-	omega_one[i][2] = omega[ibody][2];
+        omega_one[i][0] = omega[ibody][0];
+        omega_one[i][1] = omega[ibody][1];
+        omega_one[i][2] = omega[ibody][2];
       } else if (eflags[i] & ELLIPSOID) {
-	shape = ebonus[ellipsoid[i]].shape;
-	quatatom = ebonus[ellipsoid[i]].quat;
-	ione[0] = EINERTIA*rmass[i] * (shape[1]*shape[1] + shape[2]*shape[2]);
-	ione[1] = EINERTIA*rmass[i] * (shape[0]*shape[0] + shape[2]*shape[2]);
-	ione[2] = EINERTIA*rmass[i] * (shape[0]*shape[0] + shape[1]*shape[1]);
-	MathExtra::q_to_exyz(quatatom,exone,eyone,ezone);
-	MathExtra::omega_to_angmom(omega[ibody],exone,eyone,ezone,ione,
-				   angmom_one[i]);
+        shape = ebonus[ellipsoid[i]].shape;
+        quatatom = ebonus[ellipsoid[i]].quat;
+        ione[0] = EINERTIA*rmass[i] * (shape[1]*shape[1] + shape[2]*shape[2]);
+        ione[1] = EINERTIA*rmass[i] * (shape[0]*shape[0] + shape[2]*shape[2]);
+        ione[2] = EINERTIA*rmass[i] * (shape[0]*shape[0] + shape[1]*shape[1]);
+        MathExtra::q_to_exyz(quatatom,exone,eyone,ezone);
+        MathExtra::omega_to_angmom(omega[ibody],exone,eyone,ezone,ione,
+                                   angmom_one[i]);
       } else if (eflags[i] & LINE) {
-	omega_one[i][0] = omega[ibody][0];
-	omega_one[i][1] = omega[ibody][1];
-	omega_one[i][2] = omega[ibody][2];
+        omega_one[i][0] = omega[ibody][0];
+        omega_one[i][1] = omega[ibody][1];
+        omega_one[i][2] = omega[ibody][2];
       } else if (eflags[i] & TRIANGLE) {
-	inertiaatom = tbonus[tri[i]].inertia;
-	quatatom = tbonus[tri[i]].quat;
-	MathExtra::q_to_exyz(quatatom,exone,eyone,ezone);
-	MathExtra::omega_to_angmom(omega[ibody],exone,eyone,ezone,
-				   inertiaatom,angmom_one[i]);
+        inertiaatom = tbonus[tri[i]].inertia;
+        quatatom = tbonus[tri[i]].quat;
+        MathExtra::q_to_exyz(quatatom,exone,eyone,ezone);
+        MathExtra::omega_to_angmom(omega[ibody],exone,eyone,ezone,
+                                   inertiaatom,angmom_one[i]);
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double FixRigid::memory_usage()
@@ -1941,10 +1941,10 @@ double FixRigid::memory_usage()
     if (dorientflag) bytes = nmax*3 * sizeof(double);
   }
   return bytes;
-} 
+}
 
 /* ----------------------------------------------------------------------
-   allocate local atom-based arrays 
+   allocate local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixRigid::grow_arrays(int nmax)
@@ -1959,7 +1959,7 @@ void FixRigid::grow_arrays(int nmax)
 }
 
 /* ----------------------------------------------------------------------
-   copy values within local atom-based arrays 
+   copy values within local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixRigid::copy_arrays(int i, int j)
@@ -1993,7 +1993,7 @@ void FixRigid::set_arrays(int i)
 }
 
 /* ----------------------------------------------------------------------
-   pack values in local atom-based arrays for exchange with another proc 
+   pack values in local atom-based arrays for exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixRigid::pack_exchange(int i, double *buf)
@@ -2017,7 +2017,7 @@ int FixRigid::pack_exchange(int i, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   unpack values in local atom-based arrays from exchange with another proc 
+   unpack values in local atom-based arrays from exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixRigid::unpack_exchange(int nlocal, double *buf)
@@ -2061,12 +2061,12 @@ double FixRigid::compute_scalar()
   double t = 0.0;
 
   for (int i = 0; i < nbody; i++) {
-    t += masstotal[i] * (fflag[i][0]*vcm[i][0]*vcm[i][0] + 
-    			 fflag[i][1]*vcm[i][1]*vcm[i][1] +	\
-    			 fflag[i][2]*vcm[i][2]*vcm[i][2]);
-    
+    t += masstotal[i] * (fflag[i][0]*vcm[i][0]*vcm[i][0] +
+                             fflag[i][1]*vcm[i][1]*vcm[i][1] +        \
+                             fflag[i][2]*vcm[i][2]*vcm[i][2]);
+
     // wbody = angular velocity in body frame
-      
+
     MathExtra::quat_to_mat(quat[i],rot);
     MathExtra::transpose_matvec(rot,angmom[i],wbody);
     if (inertia[i][0] == 0.0) wbody[0] = 0.0;
@@ -2075,9 +2075,9 @@ double FixRigid::compute_scalar()
     else wbody[1] /= inertia[i][1];
     if (inertia[i][2] == 0.0) wbody[2] = 0.0;
     else wbody[2] /= inertia[i][2];
-    
+
     t += tflag[i][0]*inertia[i][0]*wbody[0]*wbody[0] +
-      tflag[i][1]*inertia[i][1]*wbody[1]*wbody[1] + 
+      tflag[i][1]*inertia[i][1]*wbody[1]*wbody[1] +
       tflag[i][2]*inertia[i][2]*wbody[2]*wbody[2];
   }
 
@@ -2094,7 +2094,7 @@ void *FixRigid::extract(const char *str, int &dim)
   dim=0;
   if (strcmp(str,"t_target") == 0) {
     return &t_target;
-  } 
+  }
   return NULL;
 }
 
diff --git a/src/fix_rigid.h b/src/fix_rigid.h
index 26fce86a7b..a50bb00f6d 100644
--- a/src/fix_rigid.h
+++ b/src/fix_rigid.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_rigid_nve.cpp b/src/fix_rigid_nve.cpp
index 39af01b2f5..cd04526d89 100644
--- a/src/fix_rigid_nve.cpp
+++ b/src/fix_rigid_nve.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -14,7 +14,7 @@
 /* ----------------------------------------------------------------------
    Contributing author: Tony Sheh (U Michigan), Trung Dac Nguyen (U Michigan)
    references: Kamberaj et al., J. Chem. Phys. 122, 224114 (2005)
-               Miller et al., J Chem Phys. 116, 8649-8659 
+               Miller et al., J Chem Phys. 116, 8649-8659
 ------------------------------------------------------------------------- */
 
 #include "math.h"
@@ -40,7 +40,7 @@ using namespace FixConst;
 
 FixRigidNVE::FixRigidNVE(LAMMPS *lmp, int narg, char **arg) :
   FixRigid(lmp, narg, arg)
-{ 
+{
   memory->create(conjqm,nbody,4,"rigid/nve:conjqm");
 }
 
@@ -56,11 +56,11 @@ FixRigidNVE::~FixRigidNVE()
 void FixRigidNVE::setup(int vflag)
 {
   FixRigid::setup(vflag);
-  
+
   double mbody[3];
   for (int ibody = 0; ibody < nbody; ibody++) {
     MathExtra::transpose_matvec(ex_space[ibody],ey_space[ibody],ez_space[ibody],
-				angmom[ibody],mbody);
+                                angmom[ibody],mbody);
     MathExtra::quatvec(quat[ibody],mbody,conjqm[ibody]);
     conjqm[ibody][0] *= 2.0;
     conjqm[ibody][1] *= 2.0;
@@ -78,71 +78,71 @@ void FixRigidNVE::initial_integrate(int vflag)
 {
   double dtfm,mbody[3],tbody[3],fquat[4];
   double dtf2 = dtf * 2.0;
-  
+
   for (int ibody = 0; ibody < nbody; ibody++) {
-    
+
     // step 1.1 - update vcm by 1/2 step
-    
+
     dtfm = dtf / masstotal[ibody];
     vcm[ibody][0] += dtfm * fcm[ibody][0] * fflag[ibody][0];
     vcm[ibody][1] += dtfm * fcm[ibody][1] * fflag[ibody][1];
     vcm[ibody][2] += dtfm * fcm[ibody][2] * fflag[ibody][2];
-    
+
     // step 1.2 - update xcm by full step
-    
+
     xcm[ibody][0] += dtv * vcm[ibody][0];
     xcm[ibody][1] += dtv * vcm[ibody][1];
     xcm[ibody][2] += dtv * vcm[ibody][2];
-    
+
     // step 1.3 - apply torque (body coords) to quaternion momentum
-    
+
     torque[ibody][0] *= tflag[ibody][0];
     torque[ibody][1] *= tflag[ibody][1];
     torque[ibody][2] *= tflag[ibody][2];
-    
+
     MathExtra::transpose_matvec(ex_space[ibody],ey_space[ibody],ez_space[ibody],
-				torque[ibody],tbody);
+                                torque[ibody],tbody);
     MathExtra::quatvec(quat[ibody],tbody,fquat);
-    
+
     conjqm[ibody][0] += dtf2 * fquat[0];
     conjqm[ibody][1] += dtf2 * fquat[1];
     conjqm[ibody][2] += dtf2 * fquat[2];
     conjqm[ibody][3] += dtf2 * fquat[3];
-  
+
     // step 1.4 to 1.13 - use no_squish rotate to update p and q
-  
+
     no_squish_rotate(3,conjqm[ibody],quat[ibody],inertia[ibody],dtq);
     no_squish_rotate(2,conjqm[ibody],quat[ibody],inertia[ibody],dtq);
     no_squish_rotate(1,conjqm[ibody],quat[ibody],inertia[ibody],dtv);
     no_squish_rotate(2,conjqm[ibody],quat[ibody],inertia[ibody],dtq);
     no_squish_rotate(3,conjqm[ibody],quat[ibody],inertia[ibody],dtq);
-  
+
     // update exyz_space
     // transform p back to angmom
     // update angular velocity
-    
+
     MathExtra::q_to_exyz(quat[ibody],ex_space[ibody],ey_space[ibody],
-			 ez_space[ibody]);
+                         ez_space[ibody]);
     MathExtra::invquatvec(quat[ibody],conjqm[ibody],mbody);
     MathExtra::matvec(ex_space[ibody],ey_space[ibody],ez_space[ibody],
-		      mbody,angmom[ibody]);
-    
+                      mbody,angmom[ibody]);
+
     angmom[ibody][0] *= 0.5;
     angmom[ibody][1] *= 0.5;
     angmom[ibody][2] *= 0.5;
-    
+
     MathExtra::angmom_to_omega(angmom[ibody],ex_space[ibody],ey_space[ibody],
-			       ez_space[ibody],inertia[ibody],omega[ibody]);
+                               ez_space[ibody],inertia[ibody],omega[ibody]);
   }
-  
+
   // virial setup before call to set_xv
 
   if (vflag) v_setup(vflag);
   else evflag = 0;
-  
+
   // set coords/orient and velocity/rotation of atoms in rigid bodies
   // from quarternion and omega
-  
+
   set_xv();
 }
 
@@ -154,12 +154,12 @@ void FixRigidNVE::final_integrate()
   double dtfm,xy,xz,yz;
 
   // sum over atoms to get force and torque on rigid body
-  
+
   int *image = atom->image;
   double **x = atom->x;
   double **f = atom->f;
   int nlocal = atom->nlocal;
-  
+
   double xprd = domain->xprd;
   double yprd = domain->yprd;
   double zprd = domain->zprd;
@@ -173,7 +173,7 @@ void FixRigidNVE::final_integrate()
   double xunwrap,yunwrap,zunwrap,dx,dy,dz;
   for (ibody = 0; ibody < nbody; ibody++)
     for (i = 0; i < 6; i++) sum[ibody][i] = 0.0;
-  
+
   for (i = 0; i < nlocal; i++) {
     if (body[i] < 0) continue;
     ibody = body[i];
@@ -181,7 +181,7 @@ void FixRigidNVE::final_integrate()
     sum[ibody][0] += f[i][0];
     sum[ibody][1] += f[i][1];
     sum[ibody][2] += f[i][2];
-      
+
     xbox = (image[i] & 1023) - 512;
     ybox = (image[i] >> 10 & 1023) - 512;
     zbox = (image[i] >> 20) - 512;
@@ -199,12 +199,12 @@ void FixRigidNVE::final_integrate()
     dx = xunwrap - xcm[ibody][0];
     dy = yunwrap - xcm[ibody][1];
     dz = zunwrap - xcm[ibody][2];
-    
+
     sum[ibody][3] += dy*f[i][2] - dz*f[i][1];
     sum[ibody][4] += dz*f[i][0] - dx*f[i][2];
     sum[ibody][5] += dx*f[i][1] - dy*f[i][0];
   }
-  
+
   // extended particles add their torque to torque of body
 
   if (extended) {
@@ -215,15 +215,15 @@ void FixRigidNVE::final_integrate()
       ibody = body[i];
 
       if (eflags[i] & TORQUE) {
-	sum[ibody][3] += torque_one[i][0];
-	sum[ibody][4] += torque_one[i][1];
-	sum[ibody][5] += torque_one[i][2];
+        sum[ibody][3] += torque_one[i][0];
+        sum[ibody][4] += torque_one[i][1];
+        sum[ibody][5] += torque_one[i][2];
       }
     }
   }
 
   MPI_Allreduce(sum[0],all[0],6*nbody,MPI_DOUBLE,MPI_SUM,world);
-  
+
   // update vcm and angmom
   // include Langevin thermostat forces
   // fflag,tflag = 0 for some dimensions in 2d
@@ -240,40 +240,40 @@ void FixRigidNVE::final_integrate()
     torque[ibody][2] = all[ibody][5] + langextra[ibody][5];
 
     // update vcm by 1/2 step
-  
+
     dtfm = dtf / masstotal[ibody];
     vcm[ibody][0] += dtfm * fcm[ibody][0] * fflag[ibody][0];
     vcm[ibody][1] += dtfm * fcm[ibody][1] * fflag[ibody][1];
     vcm[ibody][2] += dtfm * fcm[ibody][2] * fflag[ibody][2];
-    
+
     // update conjqm, then transform to angmom, set velocity again
     // virial is already setup from initial_integrate
-    
+
     torque[ibody][0] *= tflag[ibody][0];
     torque[ibody][1] *= tflag[ibody][1];
     torque[ibody][2] *= tflag[ibody][2];
-    
+
     MathExtra::transpose_matvec(ex_space[ibody],ey_space[ibody],ez_space[ibody],
-				torque[ibody],tbody);
+                                torque[ibody],tbody);
     MathExtra::quatvec(quat[ibody],tbody,fquat);
-    
+
     conjqm[ibody][0] += dtf2 * fquat[0];
     conjqm[ibody][1] += dtf2 * fquat[1];
     conjqm[ibody][2] += dtf2 * fquat[2];
     conjqm[ibody][3] += dtf2 * fquat[3];
-    
+
     MathExtra::invquatvec(quat[ibody],conjqm[ibody],mbody);
     MathExtra::matvec(ex_space[ibody],ey_space[ibody],ez_space[ibody],
-		      mbody,angmom[ibody]);
-    
+                      mbody,angmom[ibody]);
+
     angmom[ibody][0] *= 0.5;
     angmom[ibody][1] *= 0.5;
-    angmom[ibody][2] *= 0.5;  
-    
+    angmom[ibody][2] *= 0.5;
+
     MathExtra::angmom_to_omega(angmom[ibody],ex_space[ibody],ey_space[ibody],
-			       ez_space[ibody],inertia[ibody],omega[ibody]);
+                               ez_space[ibody],inertia[ibody],omega[ibody]);
   }
-  
+
   // set velocity/rotation of atoms in rigid bodies
   // virial is already setup from initial_integrate
 
diff --git a/src/fix_rigid_nve.h b/src/fix_rigid_nve.h
index 3c30e6c5df..ef7105bc83 100644
--- a/src/fix_rigid_nve.h
+++ b/src/fix_rigid_nve.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_rigid_nvt.cpp b/src/fix_rigid_nvt.cpp
index a6f1d07e03..a02ab54669 100644
--- a/src/fix_rigid_nvt.cpp
+++ b/src/fix_rigid_nvt.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -14,7 +14,7 @@
 /* ----------------------------------------------------------------------
    Contributing author: Tony Sheh (U Michigan), Trung Dac Nguyen (U Michigan)
    references: Kamberaj et al., J. Chem. Phys. 122, 224114 (2005)
-               Miller et al., J Chem Phys. 116, 8649-8659 
+               Miller et al., J Chem Phys. 116, 8649-8659
 ------------------------------------------------------------------------- */
 
 #include "math.h"
@@ -41,13 +41,13 @@ using namespace FixConst;
 
 FixRigidNVT::FixRigidNVT(LAMMPS *lmp, int narg, char **arg) :
   FixRigid(lmp, narg, arg)
-{ 
+{
   // other settings are made by FixRigid parent
 
   scalar_flag = 1;
   restart_global = 1;
   extscalar = 1;
-  
+
   // error checking
   // convert input period to frequency
 
@@ -60,19 +60,19 @@ FixRigidNVT::FixRigidNVT(LAMMPS *lmp, int narg, char **arg) :
 
   if (t_chain < 1) error->all(FLERR,"Illegal fix_modify command");
   if (t_iter < 1) error->all(FLERR,"Illegal fix_modify command");
-  if (t_order != 3 && t_order != 5) 
-    error->all(FLERR,"Fix_modify order must be 3 or 5"); 
-  
+  if (t_order != 3 && t_order != 5)
+    error->all(FLERR,"Fix_modify order must be 3 or 5");
+
   allocate_chain();
   allocate_order();
   memory->create(conjqm,nbody,4,"nve_rigid:conjqm");
-  
+
   // one-time initialize of thermostat variables
-  
+
   eta_t[0] = eta_r[0] = 0.0;
   eta_dot_t[0] = eta_dot_r[0] = 0.0;
   f_eta_t[0] = f_eta_r[0] = 0.0;
-  
+
   for (int i = 1; i < t_chain; i++) {
     eta_t[i] = eta_r[i] = 0.0;
     eta_dot_t[i] = eta_dot_r[i] = 0.0;
@@ -109,20 +109,20 @@ void FixRigidNVT::init()
   FixRigid::init();
 
   // initialize thermostats
-  // set timesteps, constants 
+  // set timesteps, constants
   // store Yoshida-Suzuki integrator parameters
-  
+
   dtv = update->dt;
   dtf = 0.5 * update->dt * force->ftm2v;
   dtq = 0.5 * update->dt;
-  
+
   boltz = force->boltz;
   nf_t = nf_r = domain->dimension * nbody;
-	
+
   for (int ibody = 0; ibody < nbody; ibody++)
     for (int k = 0; k < domain->dimension; k++)
       if (fabs(inertia[ibody][k]) < 1e-6) nf_r--;
-  
+
   // see Table 1 in Kamberaj et al
 
   if (t_order == 3) {
@@ -136,9 +136,9 @@ void FixRigidNVT::init()
     w[3] = w[0];
     w[4] = w[0];
   }
-  
+
   // initialize thermostat settings
-  
+
   t_target = t_start;
   double kt = boltz * t_target;
   double t_mass = kt / (t_freq*t_freq);
@@ -146,9 +146,9 @@ void FixRigidNVT::init()
   q_r[0] = nf_r * t_mass;
   for (int i = 1; i < t_chain; i++)
     q_t[i] = q_r[i] = t_mass;
-  
+
   // initialize thermostat chain positions, velocites, forces
-  
+
   for (int i = 1; i < t_chain; i++) {
     f_eta_t[i] = q_t[i-1] * eta_dot_t[i-1] * eta_dot_t[i-1] - kt;
     f_eta_r[i] = q_r[i-1] * eta_dot_r[i-1] * eta_dot_r[i-1] - kt;
@@ -162,11 +162,11 @@ void FixRigidNVT::setup(int vflag)
   FixRigid::setup(vflag);
 
   t_target = t_start;
-  
+
   double mbody[3];
   for (int ibody = 0; ibody < nbody; ibody++) {
     MathExtra::transpose_matvec(ex_space[ibody],ey_space[ibody],ez_space[ibody],
-				angmom[ibody],mbody);
+                                angmom[ibody],mbody);
     MathExtra::quatvec(quat[ibody],mbody,conjqm[ibody]);
     conjqm[ibody][0] *= 2.0;
     conjqm[ibody][1] *= 2.0;
@@ -185,23 +185,23 @@ void FixRigidNVT::initial_integrate(int vflag)
   double tmp,akin_t,akin_r,scale_t,scale_r;
   double dtfm,mbody[3],tbody[3],fquat[4];
   double dtf2 = dtf * 2.0;
-  
+
   double delta = update->ntimestep - update->beginstep;
   delta /= update->endstep - update->beginstep;
   t_target = t_start + delta * (t_stop - t_start);
-  
+
   // intialize velocity scale for translation and rotation
-  
+
   akin_t = akin_r = 0.0;
   tmp = -1.0 * dtq * eta_dot_t[0];
   scale_t = exp(tmp);
   tmp = -1.0 * dtq * eta_dot_r[0];
   scale_r = exp(tmp);
-  
+
   for (int ibody = 0; ibody < nbody; ibody++) {
-    
+
     // step 1.1 - update vcm by 1/2 step
-    
+
     dtfm = dtf / masstotal[ibody];
     vcm[ibody][0] += dtfm * fcm[ibody][0] * fflag[ibody][0];
     vcm[ibody][1] += dtfm * fcm[ibody][1] * fflag[ibody][1];
@@ -209,27 +209,27 @@ void FixRigidNVT::initial_integrate(int vflag)
     vcm[ibody][0] *= scale_t;
     vcm[ibody][1] *= scale_t;
     vcm[ibody][2] *= scale_t;
-    
+
     tmp = vcm[ibody][0]*vcm[ibody][0] + vcm[ibody][1]*vcm[ibody][1] +
       vcm[ibody][2]*vcm[ibody][2];
     akin_t += masstotal[ibody]*tmp;
-    
+
     // step 1.2 - update xcm by full step
-    
+
     xcm[ibody][0] += dtv * vcm[ibody][0];
     xcm[ibody][1] += dtv * vcm[ibody][1];
     xcm[ibody][2] += dtv * vcm[ibody][2];
-    
+
     torque[ibody][0] *= tflag[ibody][0];
     torque[ibody][1] *= tflag[ibody][1];
     torque[ibody][2] *= tflag[ibody][2];
-    
+
     // step 1.3 - apply torque (body coords) to quaternion momentum
 
     MathExtra::transpose_matvec(ex_space[ibody],ey_space[ibody],ez_space[ibody],
-				torque[ibody],tbody);
+                                torque[ibody],tbody);
     MathExtra::quatvec(quat[ibody],tbody,fquat);
-    
+
     conjqm[ibody][0] += dtf2 * fquat[0];
     conjqm[ibody][1] += dtf2 * fquat[1];
     conjqm[ibody][2] += dtf2 * fquat[2];
@@ -238,48 +238,48 @@ void FixRigidNVT::initial_integrate(int vflag)
     conjqm[ibody][1] *= scale_r;
     conjqm[ibody][2] *= scale_r;
     conjqm[ibody][3] *= scale_r;
-  
+
     // step 1.4 to 1.8 - use no_squish rotate to update p (i.e. conjqm) and q
-  
+
     no_squish_rotate(3,conjqm[ibody],quat[ibody],inertia[ibody],dtq);
     no_squish_rotate(2,conjqm[ibody],quat[ibody],inertia[ibody],dtq);
     no_squish_rotate(1,conjqm[ibody],quat[ibody],inertia[ibody],dtv);
     no_squish_rotate(2,conjqm[ibody],quat[ibody],inertia[ibody],dtq);
     no_squish_rotate(3,conjqm[ibody],quat[ibody],inertia[ibody],dtq);
-  
+
     // update the exyz_space from new quaternion
     // transform p back to angmom
     // update angular velocity
-    
+
     MathExtra::q_to_exyz(quat[ibody],ex_space[ibody],ey_space[ibody],
-			 ez_space[ibody]);
+                         ez_space[ibody]);
     MathExtra::invquatvec(quat[ibody],conjqm[ibody],mbody);
     MathExtra::matvec(ex_space[ibody],ey_space[ibody],ez_space[ibody],
-		      mbody,angmom[ibody]);
-    
+                      mbody,angmom[ibody]);
+
     angmom[ibody][0] *= 0.5;
     angmom[ibody][1] *= 0.5;
     angmom[ibody][2] *= 0.5;
-    
+
     MathExtra::angmom_to_omega(angmom[ibody],ex_space[ibody],ey_space[ibody],
-			       ez_space[ibody],inertia[ibody],omega[ibody]);
-    
-    akin_r += angmom[ibody][0]*omega[ibody][0] + 
+                               ez_space[ibody],inertia[ibody],omega[ibody]);
+
+    akin_r += angmom[ibody][0]*omega[ibody][0] +
       angmom[ibody][1]*omega[ibody][1] + angmom[ibody][2]*omega[ibody][2];
   }
-  
+
   // update thermostat chains
-  
+
   update_nhcp(akin_t,akin_r);
-  
+
   // virial setup before call to set_xv
-  
+
   if (vflag) v_setup(vflag);
   else evflag = 0;
-  
+
   // set coords/orient and velocity/rotation of atoms in rigid bodies
   // from quarternion and omega
-  
+
   set_xv();
 }
 
@@ -290,21 +290,21 @@ void FixRigidNVT::final_integrate()
   int i,ibody;
   double tmp,scale_t,scale_r;
   double dtfm,xy,xz,yz;
-  
+
   // compute velocity scales for translation and rotation
-  
+
   tmp = -1.0 * dtq * eta_dot_t[0];
   scale_t = exp(tmp);
   tmp = -1.0 * dtq * eta_dot_r[0];
   scale_r = exp(tmp);
 
   // sum over atoms to get force and torque on rigid body
-  
+
   int *image = atom->image;
   double **x = atom->x;
   double **f = atom->f;
   int nlocal = atom->nlocal;
-  
+
   double xprd = domain->xprd;
   double yprd = domain->yprd;
   double zprd = domain->zprd;
@@ -318,15 +318,15 @@ void FixRigidNVT::final_integrate()
   double xunwrap,yunwrap,zunwrap,dx,dy,dz;
   for (ibody = 0; ibody < nbody; ibody++)
     for (i = 0; i < 6; i++) sum[ibody][i] = 0.0;
-  
+
   for (i = 0; i < nlocal; i++) {
     if (body[i] < 0) continue;
     ibody = body[i];
-    
+
     sum[ibody][0] += f[i][0];
     sum[ibody][1] += f[i][1];
     sum[ibody][2] += f[i][2];
-      
+
     xbox = (image[i] & 1023) - 512;
     ybox = (image[i] >> 10 & 1023) - 512;
     zbox = (image[i] >> 20) - 512;
@@ -344,12 +344,12 @@ void FixRigidNVT::final_integrate()
     dx = xunwrap - xcm[ibody][0];
     dy = yunwrap - xcm[ibody][1];
     dz = zunwrap - xcm[ibody][2];
-    
+
     sum[ibody][3] += dy*f[i][2] - dz*f[i][1];
     sum[ibody][4] += dz*f[i][0] - dx*f[i][2];
     sum[ibody][5] += dx*f[i][1] - dy*f[i][0];
   }
-  
+
   // extended particles add their torque to torque of body
 
   if (extended) {
@@ -360,18 +360,18 @@ void FixRigidNVT::final_integrate()
       ibody = body[i];
 
       if (eflags[i] & TORQUE) {
-	sum[ibody][3] += torque_one[i][0];
-	sum[ibody][4] += torque_one[i][1];
-	sum[ibody][5] += torque_one[i][2];
+        sum[ibody][3] += torque_one[i][0];
+        sum[ibody][4] += torque_one[i][1];
+        sum[ibody][5] += torque_one[i][2];
       }
     }
   }
 
   MPI_Allreduce(sum[0],all[0],6*nbody,MPI_DOUBLE,MPI_SUM,world);
-  
+
   double mbody[3],tbody[3],fquat[4];
   double dtf2 = dtf * 2.0;
-  
+
   for (ibody = 0; ibody < nbody; ibody++) {
     fcm[ibody][0] = all[ibody][0];
     fcm[ibody][1] = all[ibody][1];
@@ -381,7 +381,7 @@ void FixRigidNVT::final_integrate()
     torque[ibody][2] = all[ibody][5];
 
     // 2.5-2.6 update vcm by 1/2 step
-  
+
     dtfm = dtf / masstotal[ibody];
     vcm[ibody][0] *= scale_t;
     vcm[ibody][1] *= scale_t;
@@ -389,47 +389,47 @@ void FixRigidNVT::final_integrate()
     vcm[ibody][0] += dtfm * fcm[ibody][0] * fflag[ibody][0];
     vcm[ibody][1] += dtfm * fcm[ibody][1] * fflag[ibody][1];
     vcm[ibody][2] += dtfm * fcm[ibody][2] * fflag[ibody][2];
-    
+
     // 2.1-2.4 update conjqm, angular momentum and angular velocity
-    // apply body torque flags  
-    
+    // apply body torque flags
+
     torque[ibody][0] *= tflag[ibody][0];
     torque[ibody][1] *= tflag[ibody][1];
     torque[ibody][2] *= tflag[ibody][2];
-    
-    // convert torque to the body frame 
-    
+
+    // convert torque to the body frame
+
     MathExtra::transpose_matvec(ex_space[ibody],ey_space[ibody],ez_space[ibody],
-				torque[ibody],tbody);
-    
+                                torque[ibody],tbody);
+
     // compute "force" for quaternion
-    
+
     MathExtra::quatvec(quat[ibody],tbody,fquat);
-    
+
     // update the conjugate quaternion momentum (conjqm)
-    
+
     conjqm[ibody][0] = scale_r * conjqm[ibody][0] + dtf2 * fquat[0];
     conjqm[ibody][1] = scale_r * conjqm[ibody][1] + dtf2 * fquat[1];
     conjqm[ibody][2] = scale_r * conjqm[ibody][2] + dtf2 * fquat[2];
     conjqm[ibody][3] = scale_r * conjqm[ibody][3] + dtf2 * fquat[3];
-    
+
     // compute angular momentum in the body frame
     // then convert to the space-fixed frame
-    
+
     MathExtra::invquatvec(quat[ibody],conjqm[ibody],mbody);
     MathExtra::matvec(ex_space[ibody],ey_space[ibody],ez_space[ibody],
-		      mbody,angmom[ibody]);
-    
+                      mbody,angmom[ibody]);
+
     angmom[ibody][0] *= 0.5;
     angmom[ibody][1] *= 0.5;
-    angmom[ibody][2] *= 0.5;  
-    
+    angmom[ibody][2] *= 0.5;
+
     // compute new angular velocity
-    
+
     MathExtra::angmom_to_omega(angmom[ibody],ex_space[ibody],ey_space[ibody],
-			       ez_space[ibody],inertia[ibody],omega[ibody]);
+                               ez_space[ibody],inertia[ibody],omega[ibody]);
   }
-  
+
   // set velocity/rotation of atoms in rigid bodies
   // virial is already setup from initial_integrate
 
@@ -442,97 +442,97 @@ void FixRigidNVT::update_nhcp(double akin_t, double akin_r)
 {
   int i,j,k;
   double kt,gfkt_t,gfkt_r,tmp,ms,s,s2;
-  
+
   kt = boltz * t_target;
   gfkt_t = nf_t * kt;
   gfkt_r = nf_r * kt;
-  
+
   akin_t *= force->mvv2e;
   akin_r *= force->mvv2e;
-  
+
   // update thermostat masses
-  
+
   double t_mass = boltz * t_target / (t_freq * t_freq);
   q_t[0] = nf_t * t_mass;
   q_r[0] = nf_r * t_mass;
   for (i = 1; i < t_chain; i++)
     q_t[i] = q_r[i] = t_mass;
-  
+
   // update order/timestep dependent coefficients
-  
+
   for (i = 0; i < t_order; i++) {
     wdti1[i] = w[i] * dtv / t_iter;
     wdti2[i] = wdti1[i] / 2.0;
     wdti4[i] = wdti1[i] / 4.0;
   }
-  
+
   // update force of thermostats coupled to particles
-  
+
   f_eta_t[0] = (akin_t - gfkt_t) / q_t[0];
   f_eta_r[0] = (akin_r - gfkt_r) / q_r[0];
-  
+
   // multiple timestep iteration
-  
+
   for (i = 0; i < t_iter; i++) {
     for (j = 0; j < t_order; j++) {
-  
+
       // update thermostat velocities half step
-  
+
       eta_dot_t[t_chain-1] += wdti2[j] * f_eta_t[t_chain-1];
       eta_dot_r[t_chain-1] += wdti2[j] * f_eta_r[t_chain-1];
-      
+
       for (k = 1; k < t_chain; k++) {
-	tmp = wdti4[j] * eta_dot_t[t_chain-k];
-	ms = maclaurin_series(tmp);
-	s = exp(-1.0 * tmp);
-	s2 = s * s;
-	eta_dot_t[t_chain-k-1] = eta_dot_t[t_chain-k-1] * s2 + 
-	  wdti2[j] * f_eta_t[t_chain-k-1] * s * ms;
-	
-	tmp = wdti4[j] * eta_dot_r[t_chain-k];
-	ms = maclaurin_series(tmp);
-	s = exp(-1.0 * tmp);
-	s2 = s * s;
-	eta_dot_r[t_chain-k-1] = eta_dot_r[t_chain-k-1] * s2 + 
-	  wdti2[j] * f_eta_r[t_chain-k-1] * s * ms;
+        tmp = wdti4[j] * eta_dot_t[t_chain-k];
+        ms = maclaurin_series(tmp);
+        s = exp(-1.0 * tmp);
+        s2 = s * s;
+        eta_dot_t[t_chain-k-1] = eta_dot_t[t_chain-k-1] * s2 +
+          wdti2[j] * f_eta_t[t_chain-k-1] * s * ms;
+
+        tmp = wdti4[j] * eta_dot_r[t_chain-k];
+        ms = maclaurin_series(tmp);
+        s = exp(-1.0 * tmp);
+        s2 = s * s;
+        eta_dot_r[t_chain-k-1] = eta_dot_r[t_chain-k-1] * s2 +
+          wdti2[j] * f_eta_r[t_chain-k-1] * s * ms;
       }
-      
+
       // update thermostat positions a full step
-      
+
       for (k = 0; k < t_chain; k++) {
-	eta_t[k] += wdti1[j] * eta_dot_t[k];
-	eta_r[k] += wdti1[j] * eta_dot_r[k];
+        eta_t[k] += wdti1[j] * eta_dot_t[k];
+        eta_r[k] += wdti1[j] * eta_dot_r[k];
       }
-      
-      // update thermostat forces 
-      
+
+      // update thermostat forces
+
       for (k = 1; k < t_chain; k++) {
-	f_eta_t[k] = q_t[k-1] * eta_dot_t[k-1] * eta_dot_t[k-1] - kt;
-	f_eta_t[k] /= q_t[k];
-	f_eta_r[k] = q_r[k-1] * eta_dot_r[k-1] * eta_dot_r[k-1] - kt;
-	f_eta_r[k] /= q_r[k];
+        f_eta_t[k] = q_t[k-1] * eta_dot_t[k-1] * eta_dot_t[k-1] - kt;
+        f_eta_t[k] /= q_t[k];
+        f_eta_r[k] = q_r[k-1] * eta_dot_r[k-1] * eta_dot_r[k-1] - kt;
+        f_eta_r[k] /= q_r[k];
       }
-      
+
       // update thermostat velocities a full step
-      
+
       for (k = 0; k < t_chain-1; k++) {
-	tmp = wdti4[j] * eta_dot_t[k+1];
-	ms = maclaurin_series(tmp);
-	s = exp(-1.0 * tmp);
-	s2 = s * s;
-	eta_dot_t[k] = eta_dot_t[k] * s2 + wdti2[j] * f_eta_t[k] * s * ms;
-	tmp = q_t[k] * eta_dot_t[k] * eta_dot_t[k] - kt;
-	f_eta_t[k+1] = tmp / q_t[k+1];
-	
-	tmp = wdti4[j] * eta_dot_r[k+1];
-	ms = maclaurin_series(tmp);
-	s = exp(-1.0 * tmp);
-	s2 = s * s;
-	eta_dot_r[k] = eta_dot_r[k] * s2 + wdti2[j] * f_eta_r[k] * s * ms;
-	tmp = q_r[k] * eta_dot_r[k] * eta_dot_r[k] - kt;
-	f_eta_r[k+1] = tmp / q_r[k+1];
+        tmp = wdti4[j] * eta_dot_t[k+1];
+        ms = maclaurin_series(tmp);
+        s = exp(-1.0 * tmp);
+        s2 = s * s;
+        eta_dot_t[k] = eta_dot_t[k] * s2 + wdti2[j] * f_eta_t[k] * s * ms;
+        tmp = q_t[k] * eta_dot_t[k] * eta_dot_t[k] - kt;
+        f_eta_t[k+1] = tmp / q_t[k+1];
+
+        tmp = wdti4[j] * eta_dot_r[k+1];
+        ms = maclaurin_series(tmp);
+        s = exp(-1.0 * tmp);
+        s2 = s * s;
+        eta_dot_r[k] = eta_dot_r[k] * s2 + wdti2[j] * f_eta_r[k] * s * ms;
+        tmp = q_r[k] * eta_dot_r[k] * eta_dot_r[k] - kt;
+        f_eta_r[k+1] = tmp / q_r[k+1];
       }
-      
+
       eta_dot_t[t_chain-1] += wdti2[j] * f_eta_t[t_chain-1];
       eta_dot_r[t_chain-1] += wdti2[j] * f_eta_r[t_chain-1];
     }
@@ -540,7 +540,7 @@ void FixRigidNVT::update_nhcp(double akin_t, double akin_r)
 }
 
 /* ----------------------------------------------------------------------
-   pack entire state of Fix into one write 
+   pack entire state of Fix into one write
 ------------------------------------------------------------------------- */
 
 void FixRigidNVT::write_restart(FILE *fp)
@@ -557,17 +557,17 @@ void FixRigidNVT::write_restart(FILE *fp)
     list[n++] = f_eta_t[i];
     list[n++] = f_eta_r[i];
   }
-  
+
   if (comm->me == 0) {
     int size = (1 + 6*t_chain)*sizeof(double);
     fwrite(&size,sizeof(int),1,fp);
     fwrite(list,sizeof(double),1+6*t_chain,fp);
   }
-  
+
   delete list;
 }
 
-/* ---------------------------------------------------------------------- 
+/* ----------------------------------------------------------------------
    compute kinetic energy in the extended Hamiltonian
    conserved quantity = sum of returned energy and potential energy
 -----------------------------------------------------------------------*/
@@ -577,17 +577,17 @@ double FixRigidNVT::compute_scalar()
   int i,k,ibody;
   double kt = boltz * t_target;
   double energy,ke_t,ke_q,tmp,Pkq[4];
-  
+
   // compute the kinetic parts of H_NVE in Kameraj et al (JCP 2005, pp 224114)
-  
+
   // translational kinetic energy
 
   ke_t = 0.0;
   for (ibody = 0; ibody < nbody; ibody++)
     ke_t += 0.5 * masstotal[ibody] * (vcm[ibody][0]*vcm[ibody][0] +
-				      vcm[ibody][1]*vcm[ibody][1] +
-				      vcm[ibody][2]*vcm[ibody][2]);
-  
+                                      vcm[ibody][1]*vcm[ibody][1] +
+                                      vcm[ibody][2]*vcm[ibody][2]);
+
   // rotational kinetic energy
 
   ke_q = 0.0;
@@ -607,45 +607,45 @@ double FixRigidNVT::compute_scalar()
         Pkq[0] = -quat[ibody][3];
         Pkq[1] =  quat[ibody][2];
         Pkq[2] = -quat[ibody][1];
-        Pkq[3] =  quat[ibody][0];      
+        Pkq[3] =  quat[ibody][0];
       }
-   
+
       tmp = conjqm[ibody][0]*Pkq[0] + conjqm[ibody][1]*Pkq[1] +
-	conjqm[ibody][2]*Pkq[2] + conjqm[ibody][3]*Pkq[3];
+        conjqm[ibody][2]*Pkq[2] + conjqm[ibody][3]*Pkq[3];
       tmp *= tmp;
-    
+
       if (fabs(inertia[ibody][k-1]) < 1e-6) tmp = 0.0;
-      else tmp /= (8.0 * inertia[ibody][k-1]); 
+      else tmp /= (8.0 * inertia[ibody][k-1]);
       ke_q += tmp;
     }
   }
-  
+
   energy = ke_t + ke_q;
-  
+
   // thermostat chain energy: from equation 12 in Kameraj et al (JCP 2005)
 
   energy += kt * (nf_t * eta_t[0] + nf_r * eta_r[0]);
-  
-  for (i = 1; i < t_chain; i++) 
+
+  for (i = 1; i < t_chain; i++)
     energy += kt * (eta_t[i] + eta_r[i]);
-  
+
   for (i = 0;  i < t_chain; i++) {
     energy += 0.5 * q_t[i] * (eta_dot_t[i] * eta_dot_t[i]);
     energy += 0.5 * q_r[i] * (eta_dot_r[i] * eta_dot_r[i]);
   }
-    
+
   return energy;
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix 
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixRigidNVT::restart(char *buf)
 {
   int n = 0;
   double *list = (double *) buf;
-  
+
   int t_chain_prev = static_cast<int> (list[n++]);
   if (t_chain_prev != t_chain)
     error->all(FLERR,"Cannot restart fix rigid/nvt with different # of chains");
diff --git a/src/fix_rigid_nvt.h b/src/fix_rigid_nvt.h
index e65f281082..9286e0fa02 100644
--- a/src/fix_rigid_nvt.h
+++ b/src/fix_rigid_nvt.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,7 +37,7 @@ class FixRigidNVT : public FixRigid {
   void write_restart(FILE *);
   void restart(char *);
   void reset_target(double);
-  
+
  private:
   double **conjqm;                      // conjugate quaternion momentum
   double boltz;                         // boltzman constant
diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp
index ee843fbbce..6522e59579 100644
--- a/src/fix_setforce.cpp
+++ b/src/fix_setforce.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -86,7 +86,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) :
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix setforce command");
       iregion = domain->find_region(arg[iarg+1]);
       if (iregion == -1)
-	error->all(FLERR,"Region ID for fix setforce does not exist");
+        error->all(FLERR,"Region ID for fix setforce does not exist");
       int n = strlen(arg[iarg+1]) + 1;
       idregion = new char[n];
       strcpy(idregion,arg[iarg+1]);
@@ -131,7 +131,7 @@ void FixSetForce::init()
 
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) 
+    if (xvar < 0)
       error->all(FLERR,"Variable name for fix setforce does not exist");
     if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
     else if (input->variable->atomstyle(xvar)) xstyle = ATOM;
@@ -139,7 +139,7 @@ void FixSetForce::init()
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) 
+    if (yvar < 0)
       error->all(FLERR,"Variable name for fix setforce does not exist");
     if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
     else if (input->variable->atomstyle(yvar)) ystyle = ATOM;
@@ -147,7 +147,7 @@ void FixSetForce::init()
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) 
+    if (zvar < 0)
       error->all(FLERR,"Variable name for fix setforce does not exist");
     if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
     else if (input->variable->atomstyle(zvar)) zstyle = ATOM;
@@ -158,11 +158,11 @@ void FixSetForce::init()
 
   if (iregion >= 0) {
     iregion = domain->find_region(idregion);
-    if (iregion == -1) 
+    if (iregion == -1)
       error->all(FLERR,"Region ID for fix setforce does not exist");
   }
 
-  if (xstyle == ATOM || ystyle == ATOM || zstyle == ATOM) 
+  if (xstyle == ATOM || ystyle == ATOM || zstyle == ATOM)
     varflag = ATOM;
   else if (xstyle == EQUAL || ystyle == EQUAL || zstyle == EQUAL)
     varflag = EQUAL;
@@ -183,7 +183,7 @@ void FixSetForce::init()
     if (ystyle == CONSTANT && yvalue != 0.0) flag = 1;
     if (zstyle == CONSTANT && zvalue != 0.0) flag = 1;
   }
-  if (flag) 
+  if (flag)
     error->all(FLERR,"Cannot use non-zero forces in an energy minimization");
 }
 
@@ -231,16 +231,16 @@ void FixSetForce::post_force(int vflag)
   if (varflag == CONSTANT) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (iregion >= 0 && 
-	    !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
-	  continue;
-
-	foriginal[0] += f[i][0];
-	foriginal[1] += f[i][1];
-	foriginal[2] += f[i][2];
-	if (xstyle) f[i][0] = xvalue;
-	if (ystyle) f[i][1] = yvalue;
-	if (zstyle) f[i][2] = zvalue;
+        if (iregion >= 0 &&
+            !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
+          continue;
+
+        foriginal[0] += f[i][0];
+        foriginal[1] += f[i][1];
+        foriginal[2] += f[i][2];
+        if (xstyle) f[i][0] = xvalue;
+        if (ystyle) f[i][1] = yvalue;
+        if (zstyle) f[i][2] = zvalue;
       }
 
   // variable force, wrap with clear/add
@@ -253,7 +253,7 @@ void FixSetForce::post_force(int vflag)
     else if (xstyle == ATOM && sforce)
       input->variable->compute_atom(xvar,igroup,&sforce[0][0],3,0);
     if (ystyle == EQUAL) yvalue = input->variable->compute_equal(yvar);
-    else if (ystyle == ATOM && sforce) 
+    else if (ystyle == ATOM && sforce)
       input->variable->compute_atom(yvar,igroup,&sforce[0][1],3,0);
     if (zstyle == EQUAL) zvalue = input->variable->compute_equal(zvar);
     else if (zstyle == ATOM && sforce)
@@ -263,19 +263,19 @@ void FixSetForce::post_force(int vflag)
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (iregion >= 0 && 
-	    !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
-	  continue;
-
-	foriginal[0] += f[i][0];
-	foriginal[1] += f[i][1];
-	foriginal[2] += f[i][2];
-	if (xstyle == ATOM) f[i][0] = sforce[i][0];
-	else if (xstyle) f[i][0] = xvalue;
-	if (ystyle == ATOM) f[i][1] = sforce[i][1];
-	else if (ystyle) f[i][1] = yvalue;
-	if (zstyle == ATOM) f[i][2] = sforce[i][2];
-	else if (zstyle) f[i][2] = zvalue;
+        if (iregion >= 0 &&
+            !domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
+          continue;
+
+        foriginal[0] += f[i][0];
+        foriginal[1] += f[i][1];
+        foriginal[2] += f[i][2];
+        if (xstyle == ATOM) f[i][0] = sforce[i][0];
+        else if (xstyle) f[i][0] = xvalue;
+        if (ystyle == ATOM) f[i][1] = sforce[i][1];
+        else if (ystyle) f[i][1] = yvalue;
+        if (zstyle == ATOM) f[i][2] = sforce[i][2];
+        else if (zstyle) f[i][2] = zvalue;
       }
   }
 }
@@ -291,12 +291,12 @@ void FixSetForce::post_force_respa(int vflag, int ilevel, int iloop)
     double **f = atom->f;
     int *mask = atom->mask;
     int nlocal = atom->nlocal;
-    
+
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (xstyle) f[i][0] = 0.0;
-	if (ystyle) f[i][1] = 0.0;
-	if (zstyle) f[i][2] = 0.0;
+        if (xstyle) f[i][0] = 0.0;
+        if (ystyle) f[i][1] = 0.0;
+        if (zstyle) f[i][2] = 0.0;
       }
   }
 }
diff --git a/src/fix_setforce.h b/src/fix_setforce.h
index 7221397fc9..5ced70a473 100644
--- a/src/fix_setforce.h
+++ b/src/fix_setforce.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_shake.cpp b/src/fix_shake.cpp
index db40a67da6..cb27eb3d7e 100644
--- a/src/fix_shake.cpp
+++ b/src/fix_shake.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -107,20 +107,20 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) :
 
     } else if (mode == 'b') {
       int i = atoi(arg[next]);
-      if (i < 1 || i > atom->nbondtypes) 
-	error->all(FLERR,"Invalid bond type index for fix shake");
+      if (i < 1 || i > atom->nbondtypes)
+        error->all(FLERR,"Invalid bond type index for fix shake");
       bond_flag[i] = 1;
 
     } else if (mode == 'a') {
       int i = atoi(arg[next]);
-      if (i < 1 || i > atom->nangletypes) 
-	error->all(FLERR,"Invalid angle type index for fix shake");
+      if (i < 1 || i > atom->nangletypes)
+        error->all(FLERR,"Invalid angle type index for fix shake");
       angle_flag[i] = 1;
 
     } else if (mode == 't') {
       int i = atoi(arg[next]);
-      if (i < 1 || i > atom->ntypes) 
-	error->all(FLERR,"Invalid atom type index for fix shake");
+      if (i < 1 || i > atom->ntypes)
+        error->all(FLERR,"Invalid atom type index for fix shake");
       type_flag[i] = 1;
 
     } else if (mode == 'm') {
@@ -266,7 +266,7 @@ int FixShake::setmask()
 
 /* ----------------------------------------------------------------------
    set bond and angle distances
-   this init must happen after force->bond and force->angle inits 
+   this init must happen after force->bond and force->angle inits
 ------------------------------------------------------------------------- */
 
 void FixShake::init()
@@ -296,7 +296,7 @@ void FixShake::init()
   if (i < modify->nfix) {
     for (int j = i; j < modify->nfix; j++)
       if (strcmp(modify->fix[j]->style,"shake") == 0)
-	error->all(FLERR,"Shake fix must come before NPT/NPH fix");
+        error->all(FLERR,"Shake fix must come before NPT/NPH fix");
   }
 
   // if rRESPA, find associated fix that must exist
@@ -315,7 +315,7 @@ void FixShake::init()
 
   if (force->bond == NULL)
     error->all(FLERR,"Bond potential must be defined for SHAKE");
-  for (i = 1; i <= atom->nbondtypes; i++) 
+  for (i = 1; i <= atom->nbondtypes; i++)
     bond_distance[i] = force->bond->equilibrium_distance(i);
 
   // set equilibrium angle distances
@@ -331,7 +331,7 @@ void FixShake::init()
     // extract bond types for the 2 bonds in the cluster
     // bond types must be same in all clusters of this angle type,
     //   else set error flag
-    
+
     flag = 0;
     bond1_type = bond2_type = 0;
     for (m = 0; m < nlocal; m++) {
@@ -340,46 +340,46 @@ void FixShake::init()
       type1 = MIN(shake_type[m][0],shake_type[m][1]);
       type2 = MAX(shake_type[m][0],shake_type[m][1]);
       if (bond1_type > 0) {
-	if (type1 != bond1_type || type2 != bond2_type) {
-	  flag = 1;
-	  break;
-	}
+        if (type1 != bond1_type || type2 != bond2_type) {
+          flag = 1;
+          break;
+        }
       }
       bond1_type = type1;
       bond2_type = type2;
     }
 
     // error check for any bond types that are not the same
-    
+
     MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_MAX,world);
     if (flag_all) error->all(FLERR,"Shake angles have different bond types");
-    
+
     // insure all procs have bond types
-    
+
     MPI_Allreduce(&bond1_type,&flag_all,1,MPI_INT,MPI_MAX,world);
     bond1_type = flag_all;
     MPI_Allreduce(&bond2_type,&flag_all,1,MPI_INT,MPI_MAX,world);
     bond2_type = flag_all;
-    
+
     // if bond types are 0, no SHAKE angles of this type exist
     // just skip this angle
-    
+
     if (bond1_type == 0) {
       angle_distance[i] = 0.0;
       continue;
     }
 
     // compute the angle distance as a function of 2 bond distances
-    
+
     angle = force->angle->equilibrium_angle(i);
-    rsq = 2.0*bond_distance[bond1_type]*bond_distance[bond2_type] * 
+    rsq = 2.0*bond_distance[bond1_type]*bond_distance[bond2_type] *
       (1.0-cos(angle));
     angle_distance[i] = sqrt(rsq);
   }
 }
 
 /* ----------------------------------------------------------------------
-   SHAKE as pre-integrator constraint 
+   SHAKE as pre-integrator constraint
 ------------------------------------------------------------------------- */
 
 void FixShake::setup(int vflag)
@@ -417,7 +417,7 @@ void FixShake::setup(int vflag)
 /* ----------------------------------------------------------------------
    build list of SHAKE clusters to constrain
    if one or more atoms in cluster are on this proc,
-     this proc lists the cluster exactly once 
+     this proc lists the cluster exactly once
 ------------------------------------------------------------------------- */
 
 void FixShake::pre_neighbor()
@@ -450,53 +450,53 @@ void FixShake::pre_neighbor()
   for (int i = 0; i < nlocal; i++)
     if (shake_flag[i]) {
       if (shake_flag[i] == 2) {
-	atom1 = atom->map(shake_atom[i][0]);
-	atom2 = atom->map(shake_atom[i][1]);
-	if (atom1 == -1 || atom2 == -1) {
-	  char str[128];
-	  sprintf(str,
-		  "Shake atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
-		  shake_atom[i][0],shake_atom[i][1],me,update->ntimestep);
-	  error->one(FLERR,str);
-	}
-	if (i <= atom1 && i <= atom2) list[nlist++] = i;
+        atom1 = atom->map(shake_atom[i][0]);
+        atom2 = atom->map(shake_atom[i][1]);
+        if (atom1 == -1 || atom2 == -1) {
+          char str[128];
+          sprintf(str,
+                  "Shake atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
+                  shake_atom[i][0],shake_atom[i][1],me,update->ntimestep);
+          error->one(FLERR,str);
+        }
+        if (i <= atom1 && i <= atom2) list[nlist++] = i;
       } else if (shake_flag[i] % 2 == 1) {
-	atom1 = atom->map(shake_atom[i][0]);
-	atom2 = atom->map(shake_atom[i][1]);
-	atom3 = atom->map(shake_atom[i][2]);
-	if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
-	  char str[128];
-	  sprintf(str,
-		  "Shake atoms %d %d %d missing on proc %d at step " 
-		  BIGINT_FORMAT,
-		  shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],
-		  me,update->ntimestep);
-	  error->one(FLERR,str);
-	}
-	if (i <= atom1 && i <= atom2 && i <= atom3) list[nlist++] = i;
+        atom1 = atom->map(shake_atom[i][0]);
+        atom2 = atom->map(shake_atom[i][1]);
+        atom3 = atom->map(shake_atom[i][2]);
+        if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
+          char str[128];
+          sprintf(str,
+                  "Shake atoms %d %d %d missing on proc %d at step "
+                  BIGINT_FORMAT,
+                  shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],
+                  me,update->ntimestep);
+          error->one(FLERR,str);
+        }
+        if (i <= atom1 && i <= atom2 && i <= atom3) list[nlist++] = i;
       } else {
-	atom1 = atom->map(shake_atom[i][0]);
-	atom2 = atom->map(shake_atom[i][1]);
-	atom3 = atom->map(shake_atom[i][2]);
-	atom4 = atom->map(shake_atom[i][3]);
-	if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
-	  char str[128];
-	  sprintf(str,
-		  "Shake atoms %d %d %d %d missing on proc %d at step " 
-		  BIGINT_FORMAT,
-		  shake_atom[i][0],shake_atom[i][1],
-		  shake_atom[i][2],shake_atom[i][3],
-		  me,update->ntimestep);
-	  error->one(FLERR,str);
-	}
-	if (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4) 
-	  list[nlist++] = i;
+        atom1 = atom->map(shake_atom[i][0]);
+        atom2 = atom->map(shake_atom[i][1]);
+        atom3 = atom->map(shake_atom[i][2]);
+        atom4 = atom->map(shake_atom[i][3]);
+        if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
+          char str[128];
+          sprintf(str,
+                  "Shake atoms %d %d %d %d missing on proc %d at step "
+                  BIGINT_FORMAT,
+                  shake_atom[i][0],shake_atom[i][1],
+                  shake_atom[i][2],shake_atom[i][3],
+                  me,update->ntimestep);
+          error->one(FLERR,str);
+        }
+        if (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)
+          list[nlist++] = i;
       }
     }
 }
 
 /* ----------------------------------------------------------------------
-   compute the force adjustment for SHAKE constraint 
+   compute the force adjustment for SHAKE constraint
 ------------------------------------------------------------------------- */
 
 void FixShake::post_force(int vflag)
@@ -566,7 +566,7 @@ void FixShake::post_force_respa(int vflag, int ilevel, int iloop)
 }
 
 /* ----------------------------------------------------------------------
-   count # of degrees-of-freedom removed by SHAKE for atoms in igroup 
+   count # of degrees-of-freedom removed by SHAKE for atoms in igroup
 ------------------------------------------------------------------------- */
 
 int FixShake::dof(int igroup)
@@ -601,7 +601,7 @@ int FixShake::dof(int igroup)
    only include atoms in fix group and those bonds/angles specified in input
    test whether all clusters are valid
    set shake_flag, shake_atom, shake_type values
-   set bond,angle types negative so will be ignored in neighbor lists 
+   set bond,angle types negative so will be ignored in neighbor lists
 ------------------------------------------------------------------------- */
 
 void FixShake::find_clusters()
@@ -633,7 +633,7 @@ void FixShake::find_clusters()
   // setup ring of procs
 
   int next = me + 1;
-  int prev = me -1; 
+  int prev = me -1;
   if (next == nprocs) next = 0;
   if (prev < 0) prev = nprocs - 1;
 
@@ -700,19 +700,19 @@ void FixShake::find_clusters()
 
       m = atom->map(partner_tag[i][j]);
       if (m >= 0 && m < nlocal) {
-	partner_mask[i][j] = mask[m];
-	partner_type[i][j] = type[m];
-	if (nmass) {
-	  if (rmass) massone = rmass[m];
-	  else massone = mass[type[m]];
-	  partner_massflag[i][j] = masscheck(massone);
-	}
-	n = bondfind(i,tag[i],partner_tag[i][j]);
-	if (n >= 0) partner_bondtype[i][j] = bond_type[i][n];
-	else {
-	  n = bondfind(m,tag[i],partner_tag[i][j]);
-	  if (n >= 0) partner_bondtype[i][j] = bond_type[m][n];
-	}
+        partner_mask[i][j] = mask[m];
+        partner_type[i][j] = type[m];
+        if (nmass) {
+          if (rmass) massone = rmass[m];
+          else massone = mass[type[m]];
+          partner_massflag[i][j] = masscheck(massone);
+        }
+        n = bondfind(i,tag[i],partner_tag[i][j]);
+        if (n >= 0) partner_bondtype[i][j] = bond_type[i][n];
+        else {
+          n = bondfind(m,tag[i],partner_tag[i][j]);
+          if (n >= 0) partner_bondtype[i][j] = bond_type[m][n];
+        }
       } else nbuf += nper;
     }
   }
@@ -729,15 +729,15 @@ void FixShake::find_clusters()
     for (j = 0; j < npartner[i]; j++) {
       m = atom->map(partner_tag[i][j]);
       if (m < 0 || m >= nlocal) {
-	buf[size] = tag[i];
-	buf[size+1] = partner_tag[i][j];
-	buf[size+2] = 0;
-	buf[size+3] = 0;
-	buf[size+4] = 0;
-	n = bondfind(i,tag[i],partner_tag[i][j]);
-	if (n >= 0) buf[size+5] = bond_type[i][n];
-	else buf[size+5] = 0;
-	size += nper;
+        buf[size] = tag[i];
+        buf[size+1] = partner_tag[i][j];
+        buf[size+2] = 0;
+        buf[size+3] = 0;
+        buf[size+4] = 0;
+        n = bondfind(i,tag[i],partner_tag[i][j]);
+        if (n >= 0) buf[size+5] = bond_type[i][n];
+        else buf[size+5] = 0;
+        size += nper;
       }
     }
   }
@@ -754,17 +754,17 @@ void FixShake::find_clusters()
     while (i < size) {
       m = atom->map(buf[i+1]);
       if (m >= 0 && m < nlocal) {
-	buf[i+2] = mask[m];
-	buf[i+3] = type[m];
-	if (nmass) {
-	  if (rmass) massone = rmass[m];
-	  else massone = mass[type[m]];
-	  buf[i+4] = masscheck(massone);
-	}
-	if (buf[i+5] == 0) {
-	  n = bondfind(m,buf[i],buf[i+1]);
-	  if (n >= 0) buf[i+5] = bond_type[m][n];
-	}
+        buf[i+2] = mask[m];
+        buf[i+3] = type[m];
+        if (nmass) {
+          if (rmass) massone = rmass[m];
+          else massone = mass[type[m]];
+          buf[i+4] = masscheck(massone);
+        }
+        if (buf[i+5] == 0) {
+          n = bondfind(m,buf[i],buf[i+1]);
+          if (n >= 0) buf[i+5] = bond_type[m][n];
+        }
       }
       i += nper;
     }
@@ -837,29 +837,29 @@ void FixShake::find_clusters()
       if (partner_bondtype[i][j] <= 0) continue;
 
       if (bond_flag[partner_bondtype[i][j]]) {
-	partner_shake[i][j] = 1;
-	nshake[i]++;
-	continue;
+        partner_shake[i][j] = 1;
+        nshake[i]++;
+        continue;
       }
       if (type_flag[type[i]] || type_flag[partner_type[i][j]]) {
-	partner_shake[i][j] = 1;
-	nshake[i]++;
-	continue;
+        partner_shake[i][j] = 1;
+        nshake[i]++;
+        continue;
       }
       if (nmass) {
-	if (partner_massflag[i][j]) {
-	  partner_shake[i][j] = 1;
-	  nshake[i]++;
-	  continue;
-	} else {
-	  if (rmass) massone = rmass[i];
-	  else massone = mass[type[i]];
-	  if (masscheck(massone)) {
-	    partner_shake[i][j] = 1;
-	    nshake[i]++;
-	    continue;
-	  }
-	}
+        if (partner_massflag[i][j]) {
+          partner_shake[i][j] = 1;
+          nshake[i]++;
+          continue;
+        } else {
+          if (rmass) massone = rmass[i];
+          else massone = mass[type[i]];
+          if (masscheck(massone)) {
+            partner_shake[i][j] = 1;
+            nshake[i]++;
+            continue;
+          }
+        }
       }
     }
   }
@@ -882,7 +882,7 @@ void FixShake::find_clusters()
       else nbuf += 3;
     }
   }
-  
+
   MPI_Allreduce(&nbuf,&nbufmax,1,MPI_INT,MPI_MAX,world);
 
   buf = new int[nbufmax];
@@ -895,9 +895,9 @@ void FixShake::find_clusters()
     for (j = 0; j < npartner[i]; j++) {
       m = atom->map(partner_tag[i][j]);
       if (m < 0 || m >= nlocal) {
-	buf[size] = tag[i];
-	buf[size+1] = partner_tag[i][j];
-	size += 3;
+        buf[size] = tag[i];
+        buf[size+1] = partner_tag[i][j];
+        size += 3;
       }
     }
   }
@@ -960,7 +960,7 @@ void FixShake::find_clusters()
   // -----------------------------------------------------
   // set SHAKE arrays that are stored with atoms & add angle constraints
   // zero shake arrays for all owned atoms
-  // if I am central atom set shake_flag & shake_atom & shake_type 
+  // if I am central atom set shake_flag & shake_atom & shake_type
   // for 2-atom clusters, I am central atom if my atom ID < partner ID
   // for 3-atom clusters, test for angle constraint
   //   angle will be stored by this atom if it exists
@@ -987,12 +987,12 @@ void FixShake::find_clusters()
 
     if (nshake[i] == 1) {
       for (j = 0; j < npartner[i]; j++)
-	if (partner_shake[i][j]) break;
+        if (partner_shake[i][j]) break;
       if (partner_nshake[i][j] == 1 && tag[i] < partner_tag[i][j]) {
-	shake_flag[i] = 2;
-	shake_atom[i][0] = tag[i];
-	shake_atom[i][1] = partner_tag[i][j];
-	shake_type[i][0] = partner_bondtype[i][j];
+        shake_flag[i] = 2;
+        shake_atom[i][0] = tag[i];
+        shake_atom[i][1] = partner_tag[i][j];
+        shake_type[i][0] = partner_bondtype[i][j];
       }
     }
 
@@ -1000,12 +1000,12 @@ void FixShake::find_clusters()
       shake_flag[i] = 1;
       shake_atom[i][0] = tag[i];
       for (j = 0; j < npartner[i]; j++)
-	if (partner_shake[i][j]) {
-	  m = shake_flag[i];
-	  shake_atom[i][m] = partner_tag[i][j];
-	  shake_type[i][m-1] = partner_bondtype[i][j];
-	  shake_flag[i]++;
-	}
+        if (partner_shake[i][j]) {
+          m = shake_flag[i];
+          shake_atom[i][m] = partner_tag[i][j];
+          shake_type[i][m-1] = partner_bondtype[i][j];
+          shake_flag[i]++;
+        }
     }
 
     if (nshake[i] == 2 && angles_allow) {
@@ -1013,8 +1013,8 @@ void FixShake::find_clusters()
       if (n < 0) continue;
       if (angle_type[i][n] < 0) continue;
       if (angle_flag[angle_type[i][n]]) {
-	shake_flag[i] = 1;
-	shake_type[i][2] = angle_type[i][n];
+        shake_flag[i] = 1;
+        shake_type[i][2] = angle_type[i][n];
       }
     }
   }
@@ -1036,14 +1036,14 @@ void FixShake::find_clusters()
       if (partner_shake[i][j] == 0) continue;
       m = atom->map(partner_tag[i][j]);
       if (m >= 0 && m < nlocal) {
-	shake_flag[m] = shake_flag[i];
-	shake_atom[m][0] = shake_atom[i][0];
-	shake_atom[m][1] = shake_atom[i][1];
-	shake_atom[m][2] = shake_atom[i][2];
-	shake_atom[m][3] = shake_atom[i][3];
-	shake_type[m][0] = shake_type[i][0];
-	shake_type[m][1] = shake_type[i][1];
-	shake_type[m][2] = shake_type[i][2];
+        shake_flag[m] = shake_flag[i];
+        shake_atom[m][0] = shake_atom[i][0];
+        shake_atom[m][1] = shake_atom[i][1];
+        shake_atom[m][2] = shake_atom[i][2];
+        shake_atom[m][3] = shake_atom[i][3];
+        shake_type[m][0] = shake_type[i][0];
+        shake_type[m][1] = shake_type[i][1];
+        shake_type[m][2] = shake_type[i][2];
       } else nbuf += 9;
     }
   }
@@ -1062,16 +1062,16 @@ void FixShake::find_clusters()
       if (partner_shake[i][j] == 0) continue;
       m = atom->map(partner_tag[i][j]);
       if (m < 0 || m >= nlocal) {
-	buf[size] = partner_tag[i][j];
-	buf[size+1] = shake_flag[i];
-	buf[size+2] = shake_atom[i][0];
-	buf[size+3] = shake_atom[i][1];
-	buf[size+4] = shake_atom[i][2];
-	buf[size+5] = shake_atom[i][3];
-	buf[size+6] = shake_type[i][0];
-	buf[size+7] = shake_type[i][1];
-	buf[size+8] = shake_type[i][2];
-	size += 9;
+        buf[size] = partner_tag[i][j];
+        buf[size+1] = shake_flag[i];
+        buf[size+2] = shake_atom[i][0];
+        buf[size+3] = shake_atom[i][1];
+        buf[size+4] = shake_atom[i][2];
+        buf[size+5] = shake_atom[i][3];
+        buf[size+6] = shake_type[i][0];
+        buf[size+7] = shake_type[i][1];
+        buf[size+8] = shake_type[i][2];
+        size += 9;
       }
     }
   }
@@ -1086,14 +1086,14 @@ void FixShake::find_clusters()
     while (i < size) {
       m = atom->map(buf[i]);
       if (m >= 0 && m < nlocal) {
-	shake_flag[m] = buf[i+1];
-	shake_atom[m][0] = buf[i+2];
-	shake_atom[m][1] = buf[i+3];
-	shake_atom[m][2] = buf[i+4];
-	shake_atom[m][3] = buf[i+5];
-	shake_type[m][0] = buf[i+6];
-	shake_type[m][1] = buf[i+7];
-	shake_type[m][2] = buf[i+8];
+        shake_flag[m] = buf[i+1];
+        shake_atom[m][0] = buf[i+2];
+        shake_atom[m][1] = buf[i+3];
+        shake_atom[m][2] = buf[i+4];
+        shake_atom[m][3] = buf[i+5];
+        shake_type[m][0] = buf[i+6];
+        shake_type[m][1] = buf[i+7];
+        shake_type[m][2] = buf[i+8];
       }
       i += 9;
     }
@@ -1209,29 +1209,29 @@ int FixShake::masscheck(double massone)
 /* ----------------------------------------------------------------------
    update the unconstrained position of each atom
    only for SHAKE clusters, else set to 0.0
-   assumes NVE update, seems to be accurate enough for NVT,NPT,NPH as well 
+   assumes NVE update, seems to be accurate enough for NVT,NPT,NPH as well
 ------------------------------------------------------------------------- */
 
 void FixShake::unconstrained_update()
 {
   double dtfmsq;
-  
+
   if (rmass) {
     for (int i = 0; i < nlocal; i++) {
       if (shake_flag[i]) {
-	dtfmsq = dtfsq / rmass[i];
-	xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
-	xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
-	xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
+        dtfmsq = dtfsq / rmass[i];
+        xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
+        xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
+        xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
       } else xshake[i][2] = xshake[i][1] = xshake[i][0] = 0.0;
     }
   } else {
     for (int i = 0; i < nlocal; i++) {
       if (shake_flag[i]) {
-	dtfmsq = dtfsq / mass[type[i]];
-	xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
-	xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
-	xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
+        dtfmsq = dtfsq / mass[type[i]];
+        xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
+        xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
+        xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
       } else xshake[i][2] = xshake[i][1] = xshake[i][0] = 0.0;
     }
   }
@@ -1240,7 +1240,7 @@ void FixShake::unconstrained_update()
 /* ----------------------------------------------------------------------
    update the unconstrained position of each atom in a rRESPA step
    only for SHAKE clusters, else set to 0.0
-   assumes NVE update, seems to be accurate enough for NVT,NPT,NPH as well 
+   assumes NVE update, seems to be accurate enough for NVT,NPT,NPH as well
 ------------------------------------------------------------------------- */
 
 void FixShake::unconstrained_update_respa(int ilevel)
@@ -1261,34 +1261,34 @@ void FixShake::unconstrained_update_respa(int ilevel)
   if (rmass) {
     for (int i = 0; i < nlocal; i++) {
       if (shake_flag[i]) {
-	invmass = 1.0 / rmass[i];
-	dtfmsq = dtfsq * invmass;
-	xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
-	xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
-	xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
-	for (jlevel = 0; jlevel < ilevel; jlevel++) {
-	  dtfmsq = dtf_innerhalf * step_respa[jlevel] * invmass;
-	  xshake[i][0] += dtfmsq*f_level[i][jlevel][0];
-	  xshake[i][1] += dtfmsq*f_level[i][jlevel][1];
-	  xshake[i][2] += dtfmsq*f_level[i][jlevel][2];
-	}
+        invmass = 1.0 / rmass[i];
+        dtfmsq = dtfsq * invmass;
+        xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
+        xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
+        xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
+        for (jlevel = 0; jlevel < ilevel; jlevel++) {
+          dtfmsq = dtf_innerhalf * step_respa[jlevel] * invmass;
+          xshake[i][0] += dtfmsq*f_level[i][jlevel][0];
+          xshake[i][1] += dtfmsq*f_level[i][jlevel][1];
+          xshake[i][2] += dtfmsq*f_level[i][jlevel][2];
+        }
       } else xshake[i][2] = xshake[i][1] = xshake[i][0] = 0.0;
     }
 
   } else {
     for (int i = 0; i < nlocal; i++) {
       if (shake_flag[i]) {
-	invmass = 1.0 / mass[type[i]];
-	dtfmsq = dtfsq * invmass;
-	xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
-	xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
-	xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
-	for (jlevel = 0; jlevel < ilevel; jlevel++) {
-	  dtfmsq = dtf_innerhalf * step_respa[jlevel] * invmass;
-	  xshake[i][0] += dtfmsq*f_level[i][jlevel][0];
-	  xshake[i][1] += dtfmsq*f_level[i][jlevel][1];
-	  xshake[i][2] += dtfmsq*f_level[i][jlevel][2];
-	}
+        invmass = 1.0 / mass[type[i]];
+        dtfmsq = dtfsq * invmass;
+        xshake[i][0] = x[i][0] + dtv*v[i][0] + dtfmsq*f[i][0];
+        xshake[i][1] = x[i][1] + dtv*v[i][1] + dtfmsq*f[i][1];
+        xshake[i][2] = x[i][2] + dtv*v[i][2] + dtfmsq*f[i][2];
+        for (jlevel = 0; jlevel < ilevel; jlevel++) {
+          dtfmsq = dtf_innerhalf * step_respa[jlevel] * invmass;
+          xshake[i][0] += dtfmsq*f_level[i][jlevel][0];
+          xshake[i][1] += dtfmsq*f_level[i][jlevel][1];
+          xshake[i][2] += dtfmsq*f_level[i][jlevel][2];
+        }
       } else xshake[i][2] = xshake[i][1] = xshake[i][0] = 0.0;
     }
   }
@@ -1330,7 +1330,7 @@ void FixShake::shake2(int m)
   double s01sq = s01[0]*s01[0] + s01[1]*s01[1] + s01[2]*s01[2];
 
   // a,b,c = coeffs in quadratic equation for lamda
-  
+
   if (rmass) {
     invmass0 = 1.0/rmass[i0];
     invmass1 = 1.0/rmass[i1];
@@ -1470,7 +1470,7 @@ void FixShake::shake3(int m)
   double determ = a11*a22 - a12*a21;
   if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
-  
+
   double a11inv = a22*determinv;
   double a12inv = -a12*determinv;
   double a21inv = -a21*determinv;
@@ -1498,14 +1498,14 @@ void FixShake::shake3(int m)
   double quad1,quad2,b1,b2,lamda01_new,lamda02_new;
 
   while (!done && niter < max_iter) {
-    quad1 = quad1_0101 * lamda01*lamda01 + quad1_0202 * lamda02*lamda02 + 
+    quad1 = quad1_0101 * lamda01*lamda01 + quad1_0202 * lamda02*lamda02 +
       quad1_0102 * lamda01*lamda02;
-    quad2 = quad2_0101 * lamda01*lamda01 + quad2_0202 * lamda02*lamda02 + 
+    quad2 = quad2_0101 * lamda01*lamda01 + quad2_0202 * lamda02*lamda02 +
       quad2_0102 * lamda01*lamda02;
-        
+
     b1 = bond1*bond1 - s01sq - quad1;
     b2 = bond2*bond2 - s02sq - quad2;
-        
+
     lamda01_new = a11inv*b1 + a12inv*b2;
     lamda02_new = a21inv*b1 + a22inv*b2;
 
@@ -1657,14 +1657,14 @@ void FixShake::shake4(int m)
     (s03[0]*r02[0] + s03[1]*r02[1] + s03[2]*r02[2]);
   double a33 = 2.0 * (invmass0+invmass3) *
     (s03[0]*r03[0] + s03[1]*r03[1] + s03[2]*r03[2]);
-  
+
   // inverse of matrix;
 
   double determ = a11*a22*a33 + a12*a23*a31 + a13*a21*a32 -
     a11*a23*a32 - a12*a21*a33 - a13*a22*a31;
   if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
-  
+
   double a11inv = determinv * (a22*a33 - a23*a32);
   double a12inv = -determinv * (a12*a33 - a13*a32);
   double a13inv = determinv * (a12*a23 - a13*a22);
@@ -1713,23 +1713,23 @@ void FixShake::shake4(int m)
   double quad1,quad2,quad3,b1,b2,b3,lamda01_new,lamda02_new,lamda03_new;
 
   while (!done && niter < max_iter) {
-    quad1 = quad1_0101 * lamda01*lamda01 + 
+    quad1 = quad1_0101 * lamda01*lamda01 +
       quad1_0202 * lamda02*lamda02 +
-      quad1_0303 * lamda03*lamda03 + 
+      quad1_0303 * lamda03*lamda03 +
       quad1_0102 * lamda01*lamda02 +
       quad1_0103 * lamda01*lamda03 +
       quad1_0203 * lamda02*lamda03;
 
-    quad2 = quad2_0101 * lamda01*lamda01 + 
+    quad2 = quad2_0101 * lamda01*lamda01 +
       quad2_0202 * lamda02*lamda02 +
-      quad2_0303 * lamda03*lamda03 + 
+      quad2_0303 * lamda03*lamda03 +
       quad2_0102 * lamda01*lamda02 +
       quad2_0103 * lamda01*lamda03 +
       quad2_0203 * lamda02*lamda03;
 
-    quad3 = quad3_0101 * lamda01*lamda01 + 
+    quad3 = quad3_0101 * lamda01*lamda01 +
       quad3_0202 * lamda02*lamda02 +
-      quad3_0303 * lamda03*lamda03 + 
+      quad3_0303 * lamda03*lamda03 +
       quad3_0102 * lamda01*lamda02 +
       quad3_0103 * lamda01*lamda03 +
       quad3_0203 * lamda02*lamda03;
@@ -1737,7 +1737,7 @@ void FixShake::shake4(int m)
     b1 = bond1*bond1 - s01sq - quad1;
     b2 = bond2*bond2 - s02sq - quad2;
     b3 = bond3*bond3 - s03sq - quad3;
-        
+
     lamda01_new = a11inv*b1 + a12inv*b2 + a13inv*b3;
     lamda02_new = a21inv*b1 + a22inv*b2 + a23inv*b3;
     lamda03_new = a31inv*b1 + a32inv*b2 + a33inv*b3;
@@ -1904,7 +1904,7 @@ void FixShake::shake3angle(int m)
     a11*a23*a32 - a12*a21*a33 - a13*a22*a31;
   if (determ == 0.0) error->one(FLERR,"Shake determinant = 0.0");
   double determinv = 1.0/determ;
-  
+
   double a11inv = determinv * (a22*a33 - a23*a32);
   double a12inv = -determinv * (a12*a33 - a13*a32);
   double a13inv = determinv * (a12*a23 - a13*a22);
@@ -1953,23 +1953,23 @@ void FixShake::shake3angle(int m)
   double quad1,quad2,quad3,b1,b2,b3,lamda01_new,lamda02_new,lamda12_new;
 
   while (!done && niter < max_iter) {
-    quad1 = quad1_0101 * lamda01*lamda01 + 
+    quad1 = quad1_0101 * lamda01*lamda01 +
       quad1_0202 * lamda02*lamda02 +
-      quad1_1212 * lamda12*lamda12 + 
+      quad1_1212 * lamda12*lamda12 +
       quad1_0102 * lamda01*lamda02 +
       quad1_0112 * lamda01*lamda12 +
       quad1_0212 * lamda02*lamda12;
 
-    quad2 = quad2_0101 * lamda01*lamda01 + 
+    quad2 = quad2_0101 * lamda01*lamda01 +
       quad2_0202 * lamda02*lamda02 +
-      quad2_1212 * lamda12*lamda12 + 
+      quad2_1212 * lamda12*lamda12 +
       quad2_0102 * lamda01*lamda02 +
       quad2_0112 * lamda01*lamda12 +
       quad2_0212 * lamda02*lamda12;
-      
-    quad3 = quad3_0101 * lamda01*lamda01 + 
+
+    quad3 = quad3_0101 * lamda01*lamda01 +
       quad3_0202 * lamda02*lamda02 +
-      quad3_1212 * lamda12*lamda12 + 
+      quad3_1212 * lamda12*lamda12 +
       quad3_0102 * lamda01*lamda02 +
       quad3_0112 * lamda01*lamda12 +
       quad3_0212 * lamda02*lamda12;
@@ -1977,7 +1977,7 @@ void FixShake::shake3angle(int m)
     b1 = bond1*bond1 - s01sq - quad1;
     b2 = bond2*bond2 - s02sq - quad2;
     b3 = bond12*bond12 - s12sq - quad3;
-        
+
     lamda01_new = a11inv*b1 + a12inv*b2 + a13inv*b3;
     lamda02_new = a21inv*b1 + a22inv*b2 + a23inv*b3;
     lamda12_new = a31inv*b1 + a32inv*b2 + a33inv*b3;
@@ -2035,7 +2035,7 @@ void FixShake::shake3angle(int m)
 }
 
 /* ----------------------------------------------------------------------
-   print-out bond & angle statistics 
+   print-out bond & angle statistics
 ------------------------------------------------------------------------- */
 
 void FixShake::stats()
@@ -2081,7 +2081,7 @@ void FixShake::stats()
       delz = x[iatom][2] - x[jatom][2];
       domain->minimum_image(delx,dely,delz);
       r = sqrt(delx*delx + dely*dely + delz*delz);
-      
+
       m = shake_type[i][j-1];
       b_count[m]++;
       b_ave[m] += r;
@@ -2142,29 +2142,29 @@ void FixShake::stats()
 
     if (screen) {
       fprintf(screen,
-	      "SHAKE stats (type/ave/delta) on step " BIGINT_FORMAT "\n",
-	      update->ntimestep);
-      for (i = 1; i < nb; i++) 
-	if (b_count_all[i])
-	  fprintf(screen,"  %d %g %g\n",i,
-		  b_ave_all[i]/b_count_all[i],b_max_all[i]-b_min_all[i]);
-      for (i = 1; i < na; i++) 
-	if (a_count_all[i])
-	  fprintf(screen,"  %d %g %g\n",i,
-		  a_ave_all[i]/a_count_all[i],a_max_all[i]-a_min_all[i]);
+              "SHAKE stats (type/ave/delta) on step " BIGINT_FORMAT "\n",
+              update->ntimestep);
+      for (i = 1; i < nb; i++)
+        if (b_count_all[i])
+          fprintf(screen,"  %d %g %g\n",i,
+                  b_ave_all[i]/b_count_all[i],b_max_all[i]-b_min_all[i]);
+      for (i = 1; i < na; i++)
+        if (a_count_all[i])
+          fprintf(screen,"  %d %g %g\n",i,
+                  a_ave_all[i]/a_count_all[i],a_max_all[i]-a_min_all[i]);
     }
     if (logfile) {
       fprintf(logfile,
-	      "SHAKE stats (type/ave/delta) on step " BIGINT_FORMAT "\n",
-	      update->ntimestep);
-      for (i = 0; i < nb; i++) 
-	if (b_count_all[i])
-	  fprintf(logfile,"  %d %g %g\n",i,
-		  b_ave_all[i]/b_count_all[i],b_max_all[i]-b_min_all[i]);
-      for (i = 0; i < na; i++) 
-	if (a_count_all[i])
-	  fprintf(logfile,"  %d %g %g\n",i,
-		  a_ave_all[i]/a_count_all[i],a_max_all[i]-a_min_all[i]);
+              "SHAKE stats (type/ave/delta) on step " BIGINT_FORMAT "\n",
+              update->ntimestep);
+      for (i = 0; i < nb; i++)
+        if (b_count_all[i])
+          fprintf(logfile,"  %d %g %g\n",i,
+                  b_ave_all[i]/b_count_all[i],b_max_all[i]-b_min_all[i]);
+      for (i = 0; i < na; i++)
+        if (a_count_all[i])
+          fprintf(logfile,"  %d %g %g\n",i,
+                  a_ave_all[i]/a_count_all[i],a_max_all[i]-a_min_all[i]);
     }
   }
 
@@ -2216,7 +2216,7 @@ int FixShake::anglefind(int i, int n1, int n2)
 }
 
 /* ----------------------------------------------------------------------
-   memory usage of local atom-based arrays 
+   memory usage of local atom-based arrays
 ------------------------------------------------------------------------- */
 
 double FixShake::memory_usage()
@@ -2231,7 +2231,7 @@ double FixShake::memory_usage()
 }
 
 /* ----------------------------------------------------------------------
-   allocate local atom-based arrays 
+   allocate local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixShake::grow_arrays(int nmax)
@@ -2244,7 +2244,7 @@ void FixShake::grow_arrays(int nmax)
 }
 
 /* ----------------------------------------------------------------------
-   copy values within local atom-based arrays 
+   copy values within local atom-based arrays
 ------------------------------------------------------------------------- */
 
 void FixShake::copy_arrays(int i, int j)
@@ -2288,7 +2288,7 @@ void FixShake::set_arrays(int i)
 }
 
 /* ----------------------------------------------------------------------
-   pack values in local atom-based arrays for exchange with another proc 
+   pack values in local atom-based arrays for exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixShake::pack_exchange(int i, double *buf)
@@ -2326,7 +2326,7 @@ int FixShake::pack_exchange(int i, double *buf)
 }
 
 /* ----------------------------------------------------------------------
-   unpack values in local atom-based arrays from exchange with another proc 
+   unpack values in local atom-based arrays from exchange with another proc
 ------------------------------------------------------------------------- */
 
 int FixShake::unpack_exchange(int nlocal, double *buf)
diff --git a/src/fix_shake.h b/src/fix_shake.h
index a752357c06..e7db5b0794 100644
--- a/src/fix_shake.h
+++ b/src/fix_shake.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_shear_history.cpp b/src/fix_shear_history.cpp
index b1ef95806f..4f073ee655 100644
--- a/src/fix_shear_history.cpp
+++ b/src/fix_shear_history.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -86,7 +86,7 @@ int FixShearHistory::setmask()
 
 void FixShearHistory::init()
 {
-  if (atom->tag_enable == 0) 
+  if (atom->tag_enable == 0)
     error->all(FLERR,"Pair style granular with history requires atoms have IDs");
 }
 
@@ -135,27 +135,27 @@ void FixShearHistory::pre_exchange()
 
     for (jj = 0; jj < jnum; jj++) {
       if (touch[jj]) {
-	shear = &allshear[3*jj];
-	j = jlist[jj];
-	j &= NEIGHMASK;
-	if (npartner[i] < MAXTOUCH) {
-	  m = npartner[i];
-	  partner[i][m] = tag[j];
-	  shearpartner[i][m][0] = shear[0];
-	  shearpartner[i][m][1] = shear[1];
-	  shearpartner[i][m][2] = shear[2];
-	}
-	npartner[i]++;
-	if (j < nlocal) {
-	  if (npartner[j] < MAXTOUCH) {
-	    m = npartner[j];
-	    partner[j][m] = tag[i];
-	    shearpartner[j][m][0] = -shear[0];
-	    shearpartner[j][m][1] = -shear[1];
-	    shearpartner[j][m][2] = -shear[2];
-	  }
-	  npartner[j]++;
-	}
+        shear = &allshear[3*jj];
+        j = jlist[jj];
+        j &= NEIGHMASK;
+        if (npartner[i] < MAXTOUCH) {
+          m = npartner[i];
+          partner[i][m] = tag[j];
+          shearpartner[i][m][0] = shear[0];
+          shearpartner[i][m][1] = shear[1];
+          shearpartner[i][m][2] = shear[2];
+        }
+        npartner[i]++;
+        if (j < nlocal) {
+          if (npartner[j] < MAXTOUCH) {
+            m = npartner[j];
+            partner[j][m] = tag[i];
+            shearpartner[j][m][0] = -shear[0];
+            shearpartner[j][m][1] = -shear[1];
+            shearpartner[j][m][2] = -shear[2];
+          }
+          npartner[j]++;
+        }
       }
     }
   }
diff --git a/src/fix_shear_history.h b/src/fix_shear_history.h
index 259a560b50..58e7bcfb2d 100644
--- a/src/fix_shear_history.h
+++ b/src/fix_shear_history.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_spring.cpp b/src/fix_spring.cpp
index 28a5b74a5e..7b214074ca 100644
--- a/src/fix_spring.cpp
+++ b/src/fix_spring.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -71,10 +71,10 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) :
     group2 = new char[n];
     strcpy(group2,arg[4]);
     igroup2 = group->find(arg[4]);
-    if (igroup2 == -1) 
-      error->all(FLERR,"Fix spring couple group ID does not exist"); 
-    if (igroup2 == igroup) 
-      error->all(FLERR,"Two groups cannot be the same in fix spring couple"); 
+    if (igroup2 == -1)
+      error->all(FLERR,"Fix spring couple group ID does not exist");
+    if (igroup2 == igroup)
+      error->all(FLERR,"Two groups cannot be the same in fix spring couple");
     group2bit = group->bitmask[igroup2];
 
     k_spring = atof(arg[5]);
@@ -120,14 +120,14 @@ void FixSpring::init()
 
   if (group2) {
     igroup2 = group->find(group2);
-    if (igroup2 == -1) 
-      error->all(FLERR,"Fix spring couple group ID does not exist"); 
+    if (igroup2 == -1)
+      error->all(FLERR,"Fix spring couple group ID does not exist");
     group2bit = group->bitmask[igroup2];
   }
 
   masstotal = group->mass(igroup);
   if (styleflag == COUPLE) masstotal2 = group->mass(igroup2);
-  
+
   if (strstr(update->integrate_style,"respa"))
     nlevels_respa = ((Respa *) update->integrate)->nlevels;
 }
@@ -168,9 +168,9 @@ void FixSpring::spring_tether()
   group->xcm(igroup,masstotal,xcm);
 
   // fx,fy,fz = components of k * (r-r0) / masstotal
-  
+
   double dx,dy,dz,fx,fy,fz,r,dr;
-  
+
   dx = xcm[0] - xc;
   dy = xcm[1] - yc;
   dz = xcm[2] - zc;
@@ -188,7 +188,7 @@ void FixSpring::spring_tether()
   ftotal[1] = -fy;
   ftotal[2] = -fz;
   ftotal[3] = sqrt(fx*fx + fy*fy + fz*fz);
-  if (dr < 0.0) ftotal[3] = -ftotal[3]; 
+  if (dr < 0.0) ftotal[3] = -ftotal[3];
   espring = 0.5*k_spring * dr*dr;
 
   fx /= masstotal;
@@ -203,24 +203,24 @@ void FixSpring::spring_tether()
   double *mass = atom->mass;
   double *rmass = atom->rmass;
   int nlocal = atom->nlocal;
-  
+
   double massone;
 
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	massone = rmass[i];
-	f[i][0] -= fx*massone;
-	f[i][1] -= fy*massone;
-	f[i][2] -= fz*massone;
+        massone = rmass[i];
+        f[i][0] -= fx*massone;
+        f[i][1] -= fy*massone;
+        f[i][2] -= fz*massone;
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	massone = mass[type[i]];
-	f[i][0] -= fx*massone;
-	f[i][1] -= fy*massone;
-	f[i][2] -= fz*massone;
+        massone = mass[type[i]];
+        f[i][0] -= fx*massone;
+        f[i][1] -= fy*massone;
+        f[i][2] -= fz*massone;
       }
   }
 }
@@ -232,22 +232,22 @@ void FixSpring::spring_couple()
   double xcm[3],xcm2[3];
   group->xcm(igroup,masstotal,xcm);
   group->xcm(igroup2,masstotal2,xcm2);
-  
+
   // fx,fy,fz = components of k * (r-r0) / masstotal
   // fx2,fy2,fz2 = components of k * (r-r0) / masstotal2
-  
+
   double dx,dy,dz,fx,fy,fz,fx2,fy2,fz2,r,dr;
-  
+
   dx = xcm2[0] - xcm[0] - xc;
   dy = xcm2[1] - xcm[1] - yc;
-  dz = xcm2[2] - xcm[2] - zc;  
+  dz = xcm2[2] - xcm[2] - zc;
   if (!xflag) dx = 0.0;
   if (!yflag) dy = 0.0;
   if (!zflag) dz = 0.0;
   r = sqrt(dx*dx + dy*dy + dz*dz);
   r = MAX(r,SMALL);
   dr = r - r0;
-  
+
   fx = k_spring*dx*dr/r;
   fy = k_spring*dy*dr/r;
   fz = k_spring*dz*dr/r;
@@ -255,7 +255,7 @@ void FixSpring::spring_couple()
   ftotal[1] = fy;
   ftotal[2] = fz;
   ftotal[3] = sqrt(fx*fx + fy*fy + fz*fz);
-  if (dr < 0.0) ftotal[3] = -ftotal[3]; 
+  if (dr < 0.0) ftotal[3] = -ftotal[3];
   espring = 0.5*k_spring * dr*dr;
 
   fx2 = fx/masstotal2;
@@ -278,33 +278,33 @@ void FixSpring::spring_couple()
   double massone;
 
   if (rmass) {
-    for (int i = 0; i < nlocal; i++) {         
+    for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	massone = rmass[i];
-	f[i][0] += fx*massone;
-	f[i][1] += fy*massone;
-	f[i][2] += fz*massone;
+        massone = rmass[i];
+        f[i][0] += fx*massone;
+        f[i][1] += fy*massone;
+        f[i][2] += fz*massone;
       }
       if (mask[i] & group2bit) {
-	massone = rmass[i];
-	f[i][0] -= fx2*massone;
-	f[i][1] -= fy2*massone;
-	f[i][2] -= fz2*massone;
+        massone = rmass[i];
+        f[i][0] -= fx2*massone;
+        f[i][1] -= fy2*massone;
+        f[i][2] -= fz2*massone;
       }
     }
   } else {
-    for (int i = 0; i < nlocal; i++) {         
+    for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	massone = mass[type[i]];
-	f[i][0] += fx*massone;
-	f[i][1] += fy*massone;
-	f[i][2] += fz*massone;
+        massone = mass[type[i]];
+        f[i][0] += fx*massone;
+        f[i][1] += fy*massone;
+        f[i][2] += fz*massone;
       }
       if (mask[i] & group2bit) {
-	massone = mass[type[i]];
-	f[i][0] -= fx2*massone;
-	f[i][1] -= fy2*massone;
-	f[i][2] -= fz2*massone;
+        massone = mass[type[i]];
+        f[i][0] -= fx2*massone;
+        f[i][1] -= fy2*massone;
+        f[i][2] -= fz2*massone;
       }
     }
   }
diff --git a/src/fix_spring.h b/src/fix_spring.h
index 92b5fb6673..c1fe8ec499 100644
--- a/src/fix_spring.h
+++ b/src/fix_spring.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_spring_rg.cpp b/src/fix_spring_rg.cpp
index c9c6322c6f..785fd40e3e 100644
--- a/src/fix_spring_rg.cpp
+++ b/src/fix_spring_rg.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -108,12 +108,12 @@ void FixSpringRG::post_force(int vflag)
   int *image = atom->image;
   double *mass = atom->mass;
   int nlocal = atom->nlocal;
-  
+
   double massfrac;
   double xprd = domain->xprd;
   double yprd = domain->yprd;
   double zprd = domain->zprd;
-   
+
   int xbox,ybox,zbox;
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
diff --git a/src/fix_spring_rg.h b/src/fix_spring_rg.h
index 9abc90fbd4..9ffe9d9583 100644
--- a/src/fix_spring_rg.h
+++ b/src/fix_spring_rg.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp
index 0b5378d4fe..675a53e495 100644
--- a/src/fix_spring_self.cpp
+++ b/src/fix_spring_self.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -72,7 +72,7 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) :
   atom->add_callback(1);
 
   // xoriginal = initial unwrapped positions of atoms
-  
+
   double **x = atom->x;
   int *mask = atom->mask;
   int *image = atom->image;
diff --git a/src/fix_spring_self.h b/src/fix_spring_self.h
index e545b8fbf5..aa6b546608 100644
--- a/src/fix_spring_self.h
+++ b/src/fix_spring_self.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_store_force.cpp b/src/fix_store_force.cpp
index 20a0ea412c..3f132be8f2 100644
--- a/src/fix_store_force.cpp
+++ b/src/fix_store_force.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_store_force.h b/src/fix_store_force.h
index cced61884d..f68ba8d17b 100644
--- a/src/fix_store_force.h
+++ b/src/fix_store_force.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp
index 87f382b7db..1554bf5191 100644
--- a/src/fix_store_state.cpp
+++ b/src/fix_store_state.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -66,7 +66,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
       pack_choice[nvalues++] = &FixStoreState::pack_id;
     } else if (strcmp(arg[iarg],"mol") == 0) {
       if (!atom->molecule_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_molecule;
     } else if (strcmp(arg[iarg],"type") == 0) {
       pack_choice[nvalues++] = &FixStoreState::pack_type;
@@ -80,28 +80,28 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
     } else if (strcmp(arg[iarg],"z") == 0) {
       pack_choice[nvalues++] = &FixStoreState::pack_z;
     } else if (strcmp(arg[iarg],"xs") == 0) {
-      if (domain->triclinic) 
-	pack_choice[nvalues++] = &FixStoreState::pack_xs_triclinic;
+      if (domain->triclinic)
+        pack_choice[nvalues++] = &FixStoreState::pack_xs_triclinic;
       else pack_choice[nvalues++] = &FixStoreState::pack_xs;
     } else if (strcmp(arg[iarg],"ys") == 0) {
-      if (domain->triclinic) 
-	pack_choice[nvalues++] = &FixStoreState::pack_ys_triclinic;
+      if (domain->triclinic)
+        pack_choice[nvalues++] = &FixStoreState::pack_ys_triclinic;
       else pack_choice[nvalues++] = &FixStoreState::pack_ys;
     } else if (strcmp(arg[iarg],"zs") == 0) {
-      if (domain->triclinic) 
-	pack_choice[nvalues++] = &FixStoreState::pack_zs_triclinic;
+      if (domain->triclinic)
+        pack_choice[nvalues++] = &FixStoreState::pack_zs_triclinic;
       else pack_choice[nvalues++] = &FixStoreState::pack_zs;
     } else if (strcmp(arg[iarg],"xu") == 0) {
-      if (domain->triclinic) 
-	pack_choice[nvalues++] = &FixStoreState::pack_xu_triclinic;
+      if (domain->triclinic)
+        pack_choice[nvalues++] = &FixStoreState::pack_xu_triclinic;
       else pack_choice[nvalues++] = &FixStoreState::pack_xu;
     } else if (strcmp(arg[iarg],"yu") == 0) {
-      if (domain->triclinic) 
-	pack_choice[nvalues++] = &FixStoreState::pack_yu_triclinic;
+      if (domain->triclinic)
+        pack_choice[nvalues++] = &FixStoreState::pack_yu_triclinic;
       else pack_choice[nvalues++] = &FixStoreState::pack_yu;
     } else if (strcmp(arg[iarg],"zu") == 0) {
-      if (domain->triclinic) 
-	pack_choice[nvalues++] = &FixStoreState::pack_zu_triclinic;
+      if (domain->triclinic)
+        pack_choice[nvalues++] = &FixStoreState::pack_zu_triclinic;
       else pack_choice[nvalues++] = &FixStoreState::pack_zu;
     } else if (strcmp(arg[iarg],"ix") == 0) {
       pack_choice[nvalues++] = &FixStoreState::pack_ix;
@@ -125,65 +125,65 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
 
     } else if (strcmp(arg[iarg],"q") == 0) {
       if (!atom->q_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_q;
     } else if (strcmp(arg[iarg],"mux") == 0) {
       if (!atom->mu_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_mux;
     } else if (strcmp(arg[iarg],"muy") == 0) {
       if (!atom->mu_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_muy;
     } else if (strcmp(arg[iarg],"muz") == 0) {
       if (!atom->mu_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_muz;
 
     } else if (strcmp(arg[iarg],"radius") == 0) {
       if (!atom->radius_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_radius;
     } else if (strcmp(arg[iarg],"omegax") == 0) {
       if (!atom->omega_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_omegax;
     } else if (strcmp(arg[iarg],"omegay") == 0) {
       if (!atom->omega_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_omegay;
     } else if (strcmp(arg[iarg],"omegaz") == 0) {
       if (!atom->omega_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_omegaz;
     } else if (strcmp(arg[iarg],"angmomx") == 0) {
       if (!atom->angmom_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_angmomx;
     } else if (strcmp(arg[iarg],"angmomy") == 0) {
       if (!atom->angmom_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_angmomy;
     } else if (strcmp(arg[iarg],"angmomz") == 0) {
       if (!atom->angmom_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_angmomz;
     } else if (strcmp(arg[iarg],"tqx") == 0) {
       if (!atom->torque_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_tqx;
     } else if (strcmp(arg[iarg],"tqy") == 0) {
       if (!atom->torque_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_tqy;
     } else if (strcmp(arg[iarg],"tqz") == 0) {
       if (!atom->torque_flag)
-	error->all(FLERR,"Fix store/state for atom property that isn't allocated");
+        error->all(FLERR,"Fix store/state for atom property that isn't allocated");
       pack_choice[nvalues++] = &FixStoreState::pack_tqz;
 
-    } else if (strncmp(arg[iarg],"c_",2) == 0 || 
-	       strncmp(arg[iarg],"f_",2) == 0 || 
-	       strncmp(arg[iarg],"v_",2) == 0) {
+    } else if (strncmp(arg[iarg],"c_",2) == 0 ||
+               strncmp(arg[iarg],"f_",2) == 0 ||
+               strncmp(arg[iarg],"v_",2) == 0) {
       cfv_any = 1;
       if (arg[iarg][0] == 'c') which[nvalues] = COMPUTE;
       else if (arg[iarg][0] == 'f') which[nvalues] = FIX;
@@ -195,10 +195,10 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
 
       char *ptr = strchr(suffix,'[');
       if (ptr) {
-	if (suffix[strlen(suffix)-1] != ']')
-	  error->all(FLERR,"Illegal fix store/state command");
-	argindex[nvalues] = atoi(ptr+1);
-	*ptr = '\0';
+        if (suffix[strlen(suffix)-1] != ']')
+          error->all(FLERR,"Illegal fix store/state command");
+        argindex[nvalues] = atoi(ptr+1);
+        *ptr = '\0';
       } else argindex[nvalues] = 0;
 
       n = strlen(suffix) + 1;
@@ -232,42 +232,42 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
     if (which[i] == COMPUTE) {
       int icompute = modify->find_compute(ids[i]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix store/state does not exist");
+        error->all(FLERR,"Compute ID for fix store/state does not exist");
       if (modify->compute[icompute]->peratom_flag == 0)
-	error->all(FLERR,"Fix store/state compute "
-		   "does not calculate per-atom values");
-      if (argindex[i] == 0 && 
-	  modify->compute[icompute]->size_peratom_cols != 0)
-	error->all(FLERR,"Fix store/state compute does not "
-		   "calculate a per-atom vector");
+        error->all(FLERR,"Fix store/state compute "
+                   "does not calculate per-atom values");
+      if (argindex[i] == 0 &&
+          modify->compute[icompute]->size_peratom_cols != 0)
+        error->all(FLERR,"Fix store/state compute does not "
+                   "calculate a per-atom vector");
       if (argindex[i] && modify->compute[icompute]->size_peratom_cols == 0)
-	error->all(FLERR,"Fix store/state compute does not "
-		   "calculate a per-atom array");
-      if (argindex[i] && 
-	  argindex[i] > modify->compute[icompute]->size_peratom_cols)
-	error->all(FLERR,"Fix store/state compute array is accessed out-of-range");
+        error->all(FLERR,"Fix store/state compute does not "
+                   "calculate a per-atom array");
+      if (argindex[i] &&
+          argindex[i] > modify->compute[icompute]->size_peratom_cols)
+        error->all(FLERR,"Fix store/state compute array is accessed out-of-range");
 
     } else if (which[i] == FIX) {
       int ifix = modify->find_fix(ids[i]);
       if (ifix < 0)
-	error->all(FLERR,"Fix ID for fix store/state does not exist");
+        error->all(FLERR,"Fix ID for fix store/state does not exist");
       if (modify->fix[ifix]->peratom_flag == 0)
-	error->all(FLERR,"Fix store/state fix does not calculate per-atom values");
+        error->all(FLERR,"Fix store/state fix does not calculate per-atom values");
       if (argindex[i] == 0 && modify->fix[ifix]->size_peratom_cols != 0)
-	error->all(FLERR,"Fix store/state fix does not calculate a per-atom vector");
+        error->all(FLERR,"Fix store/state fix does not calculate a per-atom vector");
       if (argindex[i] && modify->fix[ifix]->size_peratom_cols == 0)
-	error->all(FLERR,"Fix store/state fix does not calculate a per-atom array");
+        error->all(FLERR,"Fix store/state fix does not calculate a per-atom array");
       if (argindex[i] && argindex[i] > modify->fix[ifix]->size_peratom_cols)
-	error->all(FLERR,"Fix store/state fix array is accessed out-of-range");
+        error->all(FLERR,"Fix store/state fix array is accessed out-of-range");
       if (nevery % modify->fix[ifix]->peratom_freq)
-	error->all(FLERR,"Fix for fix store/state not computed at compatible time");
+        error->all(FLERR,"Fix for fix store/state not computed at compatible time");
 
     } else if (which[i] == VARIABLE) {
       int ivariable = input->variable->find(ids[i]);
       if (ivariable < 0)
-	error->all(FLERR,"Variable name for fix store/state does not exist");
+        error->all(FLERR,"Variable name for fix store/state does not exist");
       if (input->variable->atomstyle(ivariable) == 0)
-	error->all(FLERR,"Fix store/state variable is not atom-style variable");
+        error->all(FLERR,"Fix store/state variable is not atom-style variable");
     }
   }
 
@@ -306,7 +306,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) :
 FixStoreState::~FixStoreState()
 {
   // unregister callbacks to this fix from Atom class
- 
+
   atom->delete_callback(id,0);
   atom->delete_callback(id,1);
 
@@ -339,19 +339,19 @@ void FixStoreState::init()
     if (which[m] == COMPUTE) {
       int icompute = modify->find_compute(ids[m]);
       if (icompute < 0)
-	error->all(FLERR,"Compute ID for fix store/state does not exist");
+        error->all(FLERR,"Compute ID for fix store/state does not exist");
       value2index[m] = icompute;
-      
+
     } else if (which[m] == FIX) {
       int ifix = modify->find_fix(ids[m]);
-      if (ifix < 0) 
-	error->all(FLERR,"Fix ID for fix store/state does not exist");
+      if (ifix < 0)
+        error->all(FLERR,"Fix ID for fix store/state does not exist");
       value2index[m] = ifix;
 
     } else if (which[m] == VARIABLE) {
       int ivariable = input->variable->find(ids[m]);
-      if (ivariable < 0) 
-	error->all(FLERR,"Variable name for fix store/state does not exist");
+      if (ivariable < 0)
+        error->all(FLERR,"Variable name for fix store/state does not exist");
       value2index[m] = ivariable;
     }
   }
@@ -407,41 +407,41 @@ void FixStoreState::end_of_step()
       // invoke compute if not previously invoked
 
       if (which[m] == COMPUTE) {
-	Compute *compute = modify->compute[n];
-	if (!(compute->invoked_flag & INVOKED_PERATOM)) {
-	  compute->compute_peratom();
-	  compute->invoked_flag |= INVOKED_PERATOM;
-	}
-
-	if (j == 0) {
-	  double *compute_vector = compute->vector_atom;
-	  for (i = 0; i < nlocal; i++)
-	    if (mask[i] & groupbit) values[i][m] += compute_vector[i];
-	} else {
-	  int jm1 = j - 1;
-	  double **compute_array = compute->array_atom;
-	  for (i = 0; i < nlocal; i++)
-	    if (mask[i] & groupbit) values[i][m] += compute_array[i][jm1];
-	}
-	
+        Compute *compute = modify->compute[n];
+        if (!(compute->invoked_flag & INVOKED_PERATOM)) {
+          compute->compute_peratom();
+          compute->invoked_flag |= INVOKED_PERATOM;
+        }
+
+        if (j == 0) {
+          double *compute_vector = compute->vector_atom;
+          for (i = 0; i < nlocal; i++)
+            if (mask[i] & groupbit) values[i][m] += compute_vector[i];
+        } else {
+          int jm1 = j - 1;
+          double **compute_array = compute->array_atom;
+          for (i = 0; i < nlocal; i++)
+            if (mask[i] & groupbit) values[i][m] += compute_array[i][jm1];
+        }
+
       // access fix fields, guaranteed to be ready
-	
+
       } else if (which[m] == FIX) {
-	if (j == 0) {
-	  double *fix_vector = modify->fix[n]->vector_atom;
-	  for (i = 0; i < nlocal; i++)
-	    if (mask[i] & groupbit) values[i][m] += fix_vector[i];
-	} else {
-	  int jm1 = j - 1;
-	  double **fix_array = modify->fix[n]->array_atom;
-	  for (i = 0; i < nlocal; i++)
-	    if (mask[i] & groupbit) values[i][m] += fix_array[i][jm1];
-	}
+        if (j == 0) {
+          double *fix_vector = modify->fix[n]->vector_atom;
+          for (i = 0; i < nlocal; i++)
+            if (mask[i] & groupbit) values[i][m] += fix_vector[i];
+        } else {
+          int jm1 = j - 1;
+          double **fix_array = modify->fix[n]->array_atom;
+          for (i = 0; i < nlocal; i++)
+            if (mask[i] & groupbit) values[i][m] += fix_array[i][jm1];
+        }
 
       // evaluate atom-style variable
-      
+
       } else if (which[m] == VARIABLE)
-	input->variable->compute_atom(n,igroup,&values[0][m],nvalues,0);
+        input->variable->compute_atom(n,igroup,&values[0][m],nvalues,0);
     }
   }
 
@@ -738,9 +738,9 @@ void FixStoreState::pack_xs_triclinic(int n)
   double *h_inv = domain->h_inv;
 
   for (int i = 0; i < nlocal; i++) {
-    if (mask[i] & groupbit) 
-      vbuf[n] = h_inv[0]*(x[i][0]-boxlo[0]) + 
-	h_inv[5]*(x[i][1]-boxlo[1]) + h_inv[4]*(x[i][2]-boxlo[2]);
+    if (mask[i] & groupbit)
+      vbuf[n] = h_inv[0]*(x[i][0]-boxlo[0]) +
+        h_inv[5]*(x[i][1]-boxlo[1]) + h_inv[4]*(x[i][2]-boxlo[2]);
     else vbuf[n] = 0.0;
     n += nvalues;
   }
diff --git a/src/fix_store_state.h b/src/fix_store_state.h
index 807c55af10..39eaf183a3 100644
--- a/src/fix_store_state.h
+++ b/src/fix_store_state.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp
index 9594ae1227..4cd6599eec 100644
--- a/src/fix_temp_berendsen.cpp
+++ b/src/fix_temp_berendsen.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -63,7 +63,7 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) :
 
   // error checks
 
-  if (t_period <= 0.0) 
+  if (t_period <= 0.0)
     error->all(FLERR,"Fix temp/berendsen period must be > 0.0");
 
   // create a new compute temp style
@@ -115,7 +115,7 @@ void FixTempBerendsen::init()
 
   if (tstr) {
     tvar = input->variable->find(tstr);
-    if (tvar < 0) 
+    if (tvar < 0)
       error->all(FLERR,"Variable name for fix temp/berendsen does not exist");
     if (input->variable->equalstyle(tvar)) tstyle = EQUAL;
     else error->all(FLERR,"Variable for fix temp/berendsen is invalid style");
@@ -137,7 +137,7 @@ void FixTempBerendsen::end_of_step()
   double t_current = temperature->compute_scalar();
   if (t_current == 0.0)
     error->all(FLERR,
-	       "Computed temperature for fix temp/berendsen cannot be 0.0");
+               "Computed temperature for fix temp/berendsen cannot be 0.0");
 
   double delta = update->ntimestep - update->beginstep;
   delta /= update->endstep - update->beginstep;
@@ -152,7 +152,7 @@ void FixTempBerendsen::end_of_step()
     t_target = input->variable->compute_equal(tvar);
     if (t_target < 0.0)
       error->one(FLERR,
-		 "Fix temp/berendsen variable returned negative temperature");
+                 "Fix temp/berendsen variable returned negative temperature");
     modify->addstep_compute(update->ntimestep + nevery);
   }
 
@@ -172,19 +172,19 @@ void FixTempBerendsen::end_of_step()
   if (which == NOBIAS) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	v[i][0] *= lamda;
-	v[i][1] *= lamda;
-	v[i][2] *= lamda;
+        v[i][0] *= lamda;
+        v[i][1] *= lamda;
+        v[i][2] *= lamda;
       }
     }
   } else {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	temperature->remove_bias(i,v[i]);
-	v[i][0] *= lamda;
-	v[i][1] *= lamda;
-	v[i][2] *= lamda;
-	temperature->restore_bias(i,v[i]);
+        temperature->remove_bias(i,v[i]);
+        v[i][0] *= lamda;
+        v[i][1] *= lamda;
+        v[i][2] *= lamda;
+        temperature->restore_bias(i,v[i]);
       }
     }
   }
@@ -206,13 +206,13 @@ int FixTempBerendsen::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) 
+    if (icompute < 0)
       error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
       error->all(FLERR,
-		 "Fix_modify temperature ID does not compute temperature");
+                 "Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
       error->warning(FLERR,"Group for fix_modify temp != fix group");
     return 2;
@@ -232,7 +232,7 @@ void FixTempBerendsen::reset_target(double t_new)
 double FixTempBerendsen::compute_scalar()
 {
   return energy;
-}  
+}
 
 /* ----------------------------------------------------------------------
    extract thermostat properties
@@ -243,6 +243,6 @@ void *FixTempBerendsen::extract(const char *str, int &dim)
   dim=0;
   if (strcmp(str,"t_target") == 0) {
     return &t_target;
-  } 
+  }
   return NULL;
 }
diff --git a/src/fix_temp_berendsen.h b/src/fix_temp_berendsen.h
index 31ca302cbb..8fa2d4a3ab 100644
--- a/src/fix_temp_berendsen.h
+++ b/src/fix_temp_berendsen.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp
index bfa8194be0..f28a25f6bc 100644
--- a/src/fix_temp_rescale.cpp
+++ b/src/fix_temp_rescale.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -113,14 +113,14 @@ void FixTempRescale::init()
 
   if (tstr) {
     tvar = input->variable->find(tstr);
-    if (tvar < 0) 
+    if (tvar < 0)
       error->all(FLERR,"Variable name for fix temp/rescale does not exist");
     if (input->variable->equalstyle(tvar)) tstyle = EQUAL;
     else error->all(FLERR,"Variable for fix temp/rescale is invalid style");
   }
 
   int icompute = modify->find_compute(id_temp);
-  if (icompute < 0) 
+  if (icompute < 0)
     error->all(FLERR,"Temperature ID for fix temp/rescale does not exist");
   temperature = modify->compute[icompute];
 
@@ -149,7 +149,7 @@ void FixTempRescale::end_of_step()
     t_target = input->variable->compute_equal(tvar);
     if (t_target < 0.0)
       error->one(FLERR,
-		 "Fix temp/rescale variable returned negative temperature");
+                 "Fix temp/rescale variable returned negative temperature");
     modify->addstep_compute(update->ntimestep + nevery);
   }
 
@@ -171,21 +171,21 @@ void FixTempRescale::end_of_step()
 
     if (which == NOBIAS) {
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  v[i][0] *= factor;
-	  v[i][1] *= factor;
-	  v[i][2] *= factor;
-	}
+        if (mask[i] & groupbit) {
+          v[i][0] *= factor;
+          v[i][1] *= factor;
+          v[i][2] *= factor;
+        }
       }
     } else {
       for (int i = 0; i < nlocal; i++) {
-	if (mask[i] & groupbit) {
-	  temperature->remove_bias(i,v[i]);
-	  v[i][0] *= factor;
-	  v[i][1] *= factor;
-	  v[i][2] *= factor;
-	  temperature->restore_bias(i,v[i]);
-	}
+        if (mask[i] & groupbit) {
+          temperature->remove_bias(i,v[i]);
+          v[i][0] *= factor;
+          v[i][1] *= factor;
+          v[i][2] *= factor;
+          temperature->restore_bias(i,v[i]);
+        }
       }
     }
   }
@@ -207,13 +207,13 @@ int FixTempRescale::modify_param(int narg, char **arg)
     strcpy(id_temp,arg[1]);
 
     int icompute = modify->find_compute(id_temp);
-    if (icompute < 0) 
+    if (icompute < 0)
       error->all(FLERR,"Could not find fix_modify temperature ID");
     temperature = modify->compute[icompute];
 
     if (temperature->tempflag == 0)
       error->all(FLERR,
-		 "Fix_modify temperature ID does not compute temperature");
+                 "Fix_modify temperature ID does not compute temperature");
     if (temperature->igroup != igroup && comm->me == 0)
       error->warning(FLERR,"Group for fix_modify temp != fix group");
     return 2;
@@ -244,6 +244,6 @@ void *FixTempRescale::extract(const char *str, int &dim)
   dim=0;
   if (strcmp(str,"t_target") == 0) {
     return &t_target;
-  } 
+  }
   return NULL;
 }
diff --git a/src/fix_temp_rescale.h b/src/fix_temp_rescale.h
index 1b8d0f8f55..3b4e4cb2c9 100644
--- a/src/fix_temp_rescale.h
+++ b/src/fix_temp_rescale.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_thermal_conductivity.cpp b/src/fix_thermal_conductivity.cpp
index e3ec944e6d..c1f4258a8f 100644
--- a/src/fix_thermal_conductivity.cpp
+++ b/src/fix_thermal_conductivity.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,7 +35,7 @@ using namespace FixConst;
 /* ---------------------------------------------------------------------- */
 
 FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp,
-					       int narg, char **arg) :
+                                               int narg, char **arg) :
   Fix(lmp, narg, arg)
 {
   if (narg < 6) error->all(FLERR,"Illegal fix thermal/conductivity command");
@@ -55,7 +55,7 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp,
   else error->all(FLERR,"Illegal fix thermal/conductivity command");
 
   nbin = atoi(arg[5]);
-  if (nbin % 2 || nbin <= 2) 
+  if (nbin % 2 || nbin <= 2)
     error->all(FLERR,"Illegal fix thermal/conductivity command");
 
   // optional keywords
@@ -66,10 +66,10 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp,
   while (iarg < narg) {
     if (strcmp(arg[iarg],"swap") == 0) {
       if (iarg+2 > narg)
-	error->all(FLERR,"Illegal fix thermal/conductivity command");
+        error->all(FLERR,"Illegal fix thermal/conductivity command");
       nswap = atoi(arg[iarg+1]);
       if (nswap <= 0)
-	error->all(FLERR,"Fix thermal/conductivity swap value must be positive");
+        error->all(FLERR,"Fix thermal/conductivity swap value must be positive");
       iarg += 2;
     } else error->all(FLERR,"Illegal fix thermal/conductivity command");
   }
@@ -184,39 +184,39 @@ void FixThermalConductivity::end_of_step()
       else if (coord >= boxhi && periodicity) coord -= prd;
 
       if (coord >= slablo_lo && coord < slablo_hi) {
-	ke = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
-	if (rmass) ke *= 0.5*rmass[i];
-	else ke *= 0.5*mass[type[i]];
-	if (nlo < nswap || ke > ke_lo[nswap-1]) {
-	  for (insert = nlo-1; insert >= 0; insert--)
-	    if (ke < ke_lo[insert]) break;
-	  insert++;
-	  for (m = nlo-1; m >= insert; m--) {
-	    ke_lo[m+1] = ke_lo[m];
-	    index_lo[m+1] = index_lo[m];
-	  }
-	  ke_lo[insert] = ke;
-	  index_lo[insert] = i;
-	  if (nlo < nswap) nlo++;
-	}
+        ke = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
+        if (rmass) ke *= 0.5*rmass[i];
+        else ke *= 0.5*mass[type[i]];
+        if (nlo < nswap || ke > ke_lo[nswap-1]) {
+          for (insert = nlo-1; insert >= 0; insert--)
+            if (ke < ke_lo[insert]) break;
+          insert++;
+          for (m = nlo-1; m >= insert; m--) {
+            ke_lo[m+1] = ke_lo[m];
+            index_lo[m+1] = index_lo[m];
+          }
+          ke_lo[insert] = ke;
+          index_lo[insert] = i;
+          if (nlo < nswap) nlo++;
+        }
       }
 
       if (coord >= slabhi_lo && coord < slabhi_hi) {
-	ke = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
-	if (rmass) ke *= 0.5*rmass[i];
-	else ke *= 0.5*mass[type[i]];
-	if (nhi < nswap || ke < ke_hi[nswap-1]) {
-	  for (insert = nhi-1; insert >= 0; insert--)
-	    if (ke > ke_hi[insert]) break;
-	  insert++;
-	  for (m = nhi-1; m >= insert; m--) {
-	    ke_hi[m+1] = ke_hi[m];
-	    index_hi[m+1] = index_hi[m];
-	  }
-	  ke_hi[insert] = ke;
-	  index_hi[insert] = i;
-	  if (nhi < nswap) nhi++;
-	}
+        ke = v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
+        if (rmass) ke *= 0.5*rmass[i];
+        else ke *= 0.5*mass[type[i]];
+        if (nhi < nswap || ke < ke_hi[nswap-1]) {
+          for (insert = nhi-1; insert >= 0; insert--)
+            if (ke > ke_hi[insert]) break;
+          insert++;
+          for (m = nhi-1; m >= insert; m--) {
+            ke_hi[m+1] = ke_hi[m];
+            index_hi[m+1] = index_hi[m];
+          }
+          ke_hi[insert] = ke;
+          index_hi[insert] = i;
+          if (nhi < nswap) nhi++;
+        }
       }
     }
 
@@ -240,7 +240,7 @@ void FixThermalConductivity::end_of_step()
     else mine[0].value = BIG;
     if (ihi < nhi) mine[1].value = ke_hi[ihi];
     else mine[1].value = BIG;
-    
+
     MPI_Allreduce(mine,all,2,MPI_DOUBLE_INT,MPI_MINLOC,world);
     if (all[0].value == BIG || all[1].value == BIG) continue;
 
@@ -272,7 +272,7 @@ void FixThermalConductivity::end_of_step()
       eswap -= rbuf[3] * (vcm[0] * (vcm[0] - rbuf[0]) +
                           vcm[1] * (vcm[1] - rbuf[1]) +
                           vcm[2] * (vcm[2] - rbuf[2]));
-      
+
     } else if (me == all[0].proc) {
       j = index_lo[ilo++];
       sbuf[0] = v[j][0];
@@ -281,7 +281,7 @@ void FixThermalConductivity::end_of_step()
       if (rmass) sbuf[3] = rmass[j];
       else sbuf[3] = mass[type[j]];
       MPI_Sendrecv(sbuf,4,MPI_DOUBLE,all[1].proc,0,
-		   rbuf,4,MPI_DOUBLE,all[1].proc,0,world,&status);
+                   rbuf,4,MPI_DOUBLE,all[1].proc,0,world,&status);
       vcm[0] = (sbuf[3]*sbuf[0] + rbuf[3]*rbuf[0]) / (sbuf[3] + rbuf[3]);
       vcm[1] = (sbuf[3]*sbuf[1] + rbuf[3]*rbuf[1]) / (sbuf[3] + rbuf[3]);
       vcm[2] = (sbuf[3]*sbuf[2] + rbuf[3]*rbuf[2]) / (sbuf[3] + rbuf[3]);
@@ -300,7 +300,7 @@ void FixThermalConductivity::end_of_step()
       if (rmass) sbuf[3] = rmass[j];
       else sbuf[3] = mass[type[j]];
       MPI_Sendrecv(sbuf,4,MPI_DOUBLE,all[0].proc,0,
-		   rbuf,4,MPI_DOUBLE,all[0].proc,0,world,&status);
+                   rbuf,4,MPI_DOUBLE,all[0].proc,0,world,&status);
       vcm[0] = (sbuf[3]*sbuf[0] + rbuf[3]*rbuf[0]) / (sbuf[3] + rbuf[3]);
       vcm[1] = (sbuf[3]*sbuf[1] + rbuf[3]*rbuf[1]) / (sbuf[3] + rbuf[3]);
       vcm[2] = (sbuf[3]*sbuf[2] + rbuf[3]*rbuf[2]) / (sbuf[3] + rbuf[3]);
diff --git a/src/fix_thermal_conductivity.h b/src/fix_thermal_conductivity.h
index 7528762477..22688bb7c0 100644
--- a/src/fix_thermal_conductivity.h
+++ b/src/fix_thermal_conductivity.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp
index 5627802b7c..1e5ec70e78 100644
--- a/src/fix_tmd.cpp
+++ b/src/fix_tmd.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -47,7 +47,7 @@ FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) :
 
   rho_stop = atof(arg[3]);
   nfileevery = atoi(arg[5]);
-  if (rho_stop < 0 || nfileevery < 0) 
+  if (rho_stop < 0 || nfileevery < 0)
     error->all(FLERR,"Illegal fix tmd command");
   if (nfileevery && narg != 7) error->all(FLERR,"Illegal fix tmd command");
 
@@ -63,7 +63,7 @@ FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) :
 
   // make sure an atom map exists before reading in target coordinates
 
-  if (atom->map_style == 0) 
+  if (atom->map_style == 0)
     error->all(FLERR,"Cannot use fix TMD unless atom map exists");
 
   // read from arg[4] and store coordinates of final target in xf
@@ -77,12 +77,12 @@ FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) :
     if (me == 0) {
       fp = fopen(arg[6],"w");
       if (fp == NULL) {
-	char str[128];
-	sprintf(str,"Cannot open fix tmd file %s",arg[6]);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,"Cannot open fix tmd file %s",arg[6]);
+        error->one(FLERR,str);
       }
       fprintf(fp,"%s %s\n","# Step rho_target rho_old gamma_back",
-	      "gamma_forward lambda work_lambda work_analytical");
+              "gamma_forward lambda work_lambda work_analytical");
     }
   }
 
@@ -236,7 +236,7 @@ void FixTMD::initial_integrate(int vflag)
   b = 2.0*abetotal[1]/masstotal;
   e = abetotal[2]/masstotal;
   c = e - rho_old*rho_old;
-  d = b*b - 4*a*c;  
+  d = b*b - 4*a*c;
 
   if (d < 0) d = 0;
   if (b >= 0) gamma_max = (-b - sqrt(d))/(2*a);
@@ -245,7 +245,7 @@ void FixTMD::initial_integrate(int vflag)
   if (a == 0.0) gamma_back = 0;
 
   c = e - rho_target*rho_target;
-  d = b*b - 4*a*c;  
+  d = b*b - 4*a*c;
   if (d < 0) d = 0;
   if (b >= 0) gamma_max = (-b - sqrt(d))/(2*a);
   else        gamma_max = (-b + sqrt(d))/(2*a);
@@ -280,16 +280,16 @@ void FixTMD::initial_integrate(int vflag)
 
   // stat write of mean constraint force based on previous time step constraint
 
-  if (nfileevery && me == 0) {   
-    work_analytical += 
+  if (nfileevery && me == 0) {
+    work_analytical +=
       (-frtotal - kttotal/dtv/dtf)*(rho_target - rho_old)/rho_old;
     lambda = gamma_back*rho_old*masstotal/dtv/dtf;
     work_lambda += lambda*(rho_target - rho_old);
-    if (!(update->ntimestep % nfileevery) && 
-	(previous_stat != update->ntimestep)) {
+    if (!(update->ntimestep % nfileevery) &&
+        (previous_stat != update->ntimestep)) {
       fprintf(fp,
-	      BIGINT_FORMAT " %g %g %g %g %g %g %g\n",
-	      update->ntimestep,rho_target,rho_old,
+              BIGINT_FORMAT " %g %g %g %g %g %g %g\n",
+              update->ntimestep,rho_target,rho_old,
               gamma_back,gamma_forward,lambda,work_lambda,work_analytical);
       fflush(fp);
       previous_stat = update->ntimestep;
@@ -428,9 +428,9 @@ void FixTMD::readfile(char *file)
     if (me == 0) {
       m = 0;
       for (nlines = 0; nlines < CHUNK; nlines++) {
-	ptr = fgets(&buffer[m],MAXLINE,fp);
-	if (ptr == NULL) break;
-	m += strlen(&buffer[m]);
+        ptr = fgets(&buffer[m],MAXLINE,fp);
+        if (ptr == NULL) break;
+        m += strlen(&buffer[m]);
       }
       if (ptr == NULL) eof = 1;
       buffer[m++] = '\n';
@@ -447,54 +447,54 @@ void FixTMD::readfile(char *file)
       *next = '\0';
 
       if (firstline) {
-	if (strstr(bufptr,"xlo xhi")) {
-	  double lo,hi;
-	  sscanf(bufptr,"%lg %lg",&lo,&hi);
-	  xprd = hi - lo;
-	  bufptr = next + 1;
-	  continue;
-	} else if (strstr(bufptr,"ylo yhi")) {
-	  double lo,hi;
-	  sscanf(bufptr,"%lg %lg",&lo,&hi);
-	  yprd = hi - lo;
-	  bufptr = next + 1;
-	  continue;
-	} else if (strstr(bufptr,"zlo zhi")) {
-	  double lo,hi;
-	  sscanf(bufptr,"%lg %lg",&lo,&hi);
-	  zprd = hi - lo;
-	  bufptr = next + 1;
-	  continue;
-	} else if (atom->count_words(bufptr) == 4) {
-	  if (xprd >= 0.0 || yprd >= 0.0 || zprd >= 0.0) 
-	    error->all(FLERR,"Incorrect format in TMD target file");
-	  imageflag = 0;
-	  firstline = 0;
-	} else if (atom->count_words(bufptr) == 7) {
-	  if (xprd < 0.0 || yprd < 0.0 || zprd < 0.0) 
-	    error->all(FLERR,"Incorrect format in TMD target file");
-	  imageflag = 1;
-	  firstline = 0;
-	} else error->all(FLERR,"Incorrect format in TMD target file");
+        if (strstr(bufptr,"xlo xhi")) {
+          double lo,hi;
+          sscanf(bufptr,"%lg %lg",&lo,&hi);
+          xprd = hi - lo;
+          bufptr = next + 1;
+          continue;
+        } else if (strstr(bufptr,"ylo yhi")) {
+          double lo,hi;
+          sscanf(bufptr,"%lg %lg",&lo,&hi);
+          yprd = hi - lo;
+          bufptr = next + 1;
+          continue;
+        } else if (strstr(bufptr,"zlo zhi")) {
+          double lo,hi;
+          sscanf(bufptr,"%lg %lg",&lo,&hi);
+          zprd = hi - lo;
+          bufptr = next + 1;
+          continue;
+        } else if (atom->count_words(bufptr) == 4) {
+          if (xprd >= 0.0 || yprd >= 0.0 || zprd >= 0.0)
+            error->all(FLERR,"Incorrect format in TMD target file");
+          imageflag = 0;
+          firstline = 0;
+        } else if (atom->count_words(bufptr) == 7) {
+          if (xprd < 0.0 || yprd < 0.0 || zprd < 0.0)
+            error->all(FLERR,"Incorrect format in TMD target file");
+          imageflag = 1;
+          firstline = 0;
+        } else error->all(FLERR,"Incorrect format in TMD target file");
       }
 
       if (imageflag)
-	sscanf(bufptr,"%d %lg %lg %lg %d %d %d",&tag,&x,&y,&z,&ix,&iy,&iz);
+        sscanf(bufptr,"%d %lg %lg %lg %d %d %d",&tag,&x,&y,&z,&ix,&iy,&iz);
       else
-	sscanf(bufptr,"%d %lg %lg %lg",&tag,&x,&y,&z);
+        sscanf(bufptr,"%d %lg %lg %lg",&tag,&x,&y,&z);
 
       m = atom->map(tag);
       if (m >= 0 && m < nlocal && mask[m] & groupbit) {
-	if (imageflag) {
-	  xf[m][0] = x + ix*xprd;
-	  xf[m][1] = y + iy*yprd;
-	  xf[m][2] = z + iz*zprd;
-	} else {
-	  xf[m][0] = x;
-	  xf[m][1] = y;
-	  xf[m][2] = z;
-	}
-	ncount++;
+        if (imageflag) {
+          xf[m][0] = x + ix*xprd;
+          xf[m][1] = y + iy*yprd;
+          xf[m][2] = z + iz*zprd;
+        } else {
+          xf[m][0] = x;
+          xf[m][1] = y;
+          xf[m][2] = z;
+        }
+        ncount++;
       }
 
       bufptr = next + 1;
diff --git a/src/fix_tmd.h b/src/fix_tmd.h
index 49768293e6..4bfae04ecb 100644
--- a/src/fix_tmd.h
+++ b/src/fix_tmd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_ttm.cpp b/src/fix_ttm.cpp
index 8f5eecfc7a..405842d6a4 100644
--- a/src/fix_ttm.cpp
+++ b/src/fix_ttm.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -89,9 +89,9 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) :
   // error check
 
   if (seed <= 0) error->all(FLERR,"Invalid random number seed in fix ttm command");
-  if (electronic_specific_heat <= 0.0) 
+  if (electronic_specific_heat <= 0.0)
     error->all(FLERR,"Fix ttm electronic_specific_heat must be > 0.0");
-  if (electronic_density <= 0.0) 
+  if (electronic_density <= 0.0)
     error->all(FLERR,"Fix ttm electronic_density must be > 0.0");
   if (electronic_thermal_conductivity < 0.0)
     error->all(FLERR,"Fix ttm electronic_thermal_conductivity must be >= 0.0");
@@ -123,14 +123,14 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) :
   memory->create(sum_mass_vsq,nxnodes,nynodes,nznodes,"ttm:sum_mass_vsq");
   memory->create(sum_vsq_all,nxnodes,nynodes,nznodes,"ttm:sum_vsq_all");
   memory->create(sum_mass_vsq_all,nxnodes,nynodes,nznodes,
-		 "ttm:sum_mass_vsq_all");
+                 "ttm:sum_mass_vsq_all");
   memory->create(T_electron_old,nxnodes,nynodes,nznodes,"ttm:T_electron_old");
   memory->create(T_electron,nxnodes,nynodes,nznodes,"ttm:T_electron");
   memory->create(net_energy_transfer,nxnodes,nynodes,nznodes,
-		 "TTM:net_energy_transfer");
+                 "TTM:net_energy_transfer");
   memory->create(net_energy_transfer_all,nxnodes,nynodes,nznodes,
-		 "TTM:net_energy_transfer_all");
- 
+                 "TTM:net_energy_transfer_all");
+
   flangevin = NULL;
   grow_arrays(atom->nmax);
 
@@ -173,7 +173,7 @@ FixTTM::~FixTTM()
   memory->destroy(T_electron);
   memory->destroy(flangevin);
   memory->destroy(net_energy_transfer);
-  memory->destroy(net_energy_transfer_all); 
+  memory->destroy(net_energy_transfer_all);
 }
 
 /* ---------------------------------------------------------------------- */
@@ -202,7 +202,7 @@ void FixTTM::init()
 
   for (int i = 1; i <= atom->ntypes; i++) {
     gfactor1[i] = - gamma_p / force->ftm2v;
-    gfactor2[i] = 
+    gfactor2[i] =
       sqrt(24.0*force->boltz*gamma_p/update->dt/force->mvv2e) / force->ftm2v;
   }
 
@@ -259,7 +259,7 @@ void FixTTM::post_force(int vflag)
       while (iynode < 0) iynode += nynodes;
       while (iznode < 0) iznode += nznodes;
 
-      if (T_electron[ixnode][iynode][iznode] < 0) 
+      if (T_electron[ixnode][iynode][iznode] < 0)
         error->all(FLERR,"Electronic temperature dropped below zero");
 
       double tsqrt = sqrt(T_electron[ixnode][iynode][iznode]);
@@ -318,7 +318,7 @@ void FixTTM::post_force_respa_setup(int vflag, int ilevel, int iloop)
 void FixTTM::reset_dt()
 {
   for (int i = 1; i <= atom->ntypes; i++)
-    gfactor2[i] = 
+    gfactor2[i] =
       sqrt(24.0*force->boltz*gamma_p/update->dt/force->mvv2e) / force->ftm2v;
 }
 
@@ -370,12 +370,12 @@ void FixTTM::end_of_step()
   int *type = atom->type;
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
- 
+
   for (int ixnode = 0; ixnode < nxnodes; ixnode++)
     for (int iynode = 0; iynode < nynodes; iynode++)
       for (int iznode = 0; iznode < nznodes; iznode++)
         net_energy_transfer[ixnode][iynode][iznode] = 0;
-      
+
   for (int i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       double xscale = (x[i][0] - domain->boxlo[0])/domain->xprd;
@@ -390,14 +390,14 @@ void FixTTM::end_of_step()
       while (ixnode < 0) ixnode += nxnodes;
       while (iynode < 0) iynode += nynodes;
       while (iznode < 0) iznode += nznodes;
-      net_energy_transfer[ixnode][iynode][iznode] += 
-	(flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] + 
-	 flangevin[i][2]*v[i][2]);
+      net_energy_transfer[ixnode][iynode][iznode] +=
+        (flangevin[i][0]*v[i][0] + flangevin[i][1]*v[i][1] +
+         flangevin[i][2]*v[i][2]);
     }
-  
+
   MPI_Allreduce(&net_energy_transfer[0][0][0],
-		&net_energy_transfer_all[0][0][0],
-		total_nnodes,MPI_DOUBLE,MPI_SUM,world);
+                &net_energy_transfer_all[0][0][0],
+                total_nnodes,MPI_DOUBLE,MPI_SUM,world);
 
   double dx = domain->xprd/nxnodes;
   double dy = domain->yprd/nynodes;
@@ -409,19 +409,19 @@ void FixTTM::end_of_step()
 
   int num_inner_timesteps = 1;
   double inner_dt = update->dt;
-  double stability_criterion = 1.0 - 
-    2.0*inner_dt/(electronic_specific_heat*electronic_density) * 
+  double stability_criterion = 1.0 -
+    2.0*inner_dt/(electronic_specific_heat*electronic_density) *
     (electronic_thermal_conductivity*(1.0/dx/dx + 1.0/dy/dy + 1.0/dz/dz));
   if (stability_criterion < 0.0) {
-    inner_dt = 0.5*(electronic_specific_heat*electronic_density) / 
+    inner_dt = 0.5*(electronic_specific_heat*electronic_density) /
       (electronic_thermal_conductivity*(1.0/dx/dx + 1.0/dy/dy + 1.0/dz/dz));
     num_inner_timesteps = static_cast<int>(update->dt/inner_dt) + 1;
     inner_dt = update->dt/double(num_inner_timesteps);
-    if (num_inner_timesteps > 1000000) 
+    if (num_inner_timesteps > 1000000)
       error->warning(FLERR,"Too many inner timesteps in fix ttm",0);
   }
 
-  for (int ith_inner_timestep = 0; ith_inner_timestep < num_inner_timesteps; 
+  for (int ith_inner_timestep = 0; ith_inner_timestep < num_inner_timesteps;
        ith_inner_timestep++) {
 
     for (int ixnode = 0; ixnode < nxnodes; ixnode++)
@@ -429,7 +429,7 @@ void FixTTM::end_of_step()
         for (int iznode = 0; iznode < nznodes; iznode++)
           T_electron_old[ixnode][iynode][iznode] =
             T_electron[ixnode][iynode][iznode];
-    
+
     // compute new electron T profile
 
     for (int ixnode = 0; ixnode < nxnodes; ixnode++)
@@ -447,41 +447,41 @@ void FixTTM::end_of_step()
           if (left_xnode == -1) left_xnode = nxnodes - 1;
           if (left_ynode == -1) left_ynode = nynodes - 1;
           if (left_znode == -1) left_znode = nznodes - 1;
-          T_electron[ixnode][iynode][iznode] = 
-            T_electron_old[ixnode][iynode][iznode] + 
-            inner_dt/(electronic_specific_heat*electronic_density) * 
+          T_electron[ixnode][iynode][iznode] =
+            T_electron_old[ixnode][iynode][iznode] +
+            inner_dt/(electronic_specific_heat*electronic_density) *
             (electronic_thermal_conductivity *
-             ((T_electron_old[right_xnode][iynode][iznode] + 
-               T_electron_old[left_xnode][iynode][iznode] - 
+             ((T_electron_old[right_xnode][iynode][iznode] +
+               T_electron_old[left_xnode][iynode][iznode] -
                2*T_electron_old[ixnode][iynode][iznode])/dx/dx +
-              (T_electron_old[ixnode][right_ynode][iznode] + 
-               T_electron_old[ixnode][left_ynode][iznode] - 
+              (T_electron_old[ixnode][right_ynode][iznode] +
+               T_electron_old[ixnode][left_ynode][iznode] -
                2*T_electron_old[ixnode][iynode][iznode])/dy/dy +
-              (T_electron_old[ixnode][iynode][right_znode] + 
-               T_electron_old[ixnode][iynode][left_znode] - 
+              (T_electron_old[ixnode][iynode][right_znode] +
+               T_electron_old[ixnode][iynode][left_znode] -
                2*T_electron_old[ixnode][iynode][iznode])/dz/dz) -
-              (net_energy_transfer_all[ixnode][iynode][iznode])/del_vol);   
+              (net_energy_transfer_all[ixnode][iynode][iznode])/del_vol);
         }
   }
 
   // output nodal temperatures for current timestep
 
-  if ((nfileevery) && !(update->ntimestep % nfileevery)) { 
+  if ((nfileevery) && !(update->ntimestep % nfileevery)) {
 
     // compute atomic Ta for each grid point
-  
+
     for (int ixnode = 0; ixnode < nxnodes; ixnode++)
       for (int iynode = 0; iynode < nynodes; iynode++)
         for (int iznode = 0; iznode < nznodes; iznode++) {
           nsum[ixnode][iynode][iznode] = 0;
           nsum_all[ixnode][iynode][iznode] = 0;
-          sum_vsq[ixnode][iynode][iznode] = 0.0; 
+          sum_vsq[ixnode][iynode][iznode] = 0.0;
           sum_mass_vsq[ixnode][iynode][iznode] = 0.0;
           sum_vsq_all[ixnode][iynode][iznode] = 0.0;
           sum_mass_vsq_all[ixnode][iynode][iznode] = 0.0;
-        } 
+        }
 
-    double massone;  
+    double massone;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
         if (rmass) massone = rmass[i];
@@ -503,14 +503,14 @@ void FixTTM::end_of_step()
         sum_vsq[ixnode][iynode][iznode] += vsq;
         sum_mass_vsq[ixnode][iynode][iznode] += massone*vsq;
       }
-  
+
     MPI_Allreduce(&nsum[0][0][0],&nsum_all[0][0][0],total_nnodes,
                   MPI_INT,MPI_SUM,world);
     MPI_Allreduce(&sum_vsq[0][0][0],&sum_vsq_all[0][0][0],total_nnodes,
                   MPI_DOUBLE,MPI_SUM,world);
     MPI_Allreduce(&sum_mass_vsq[0][0][0],&sum_mass_vsq_all[0][0][0],
                   total_nnodes,MPI_DOUBLE,MPI_SUM,world);
-  
+
     if (me == 0) {
       fprintf(fp,BIGINT_FORMAT,update->ntimestep);
 
@@ -524,7 +524,7 @@ void FixTTM::end_of_step()
                 (3.0*force->boltz*nsum_all[ixnode][iynode][iznode]/force->mvv2e);
             fprintf(fp," %f",T_a);
           }
-            
+
       fprintf(fp,"\t");
       for (int ixnode = 0; ixnode < nxnodes; ixnode++)
         for (int iynode = 0; iynode < nynodes; iynode++)
@@ -549,10 +549,10 @@ double FixTTM::memory_usage()
 
 /* ---------------------------------------------------------------------- */
 
-void FixTTM::grow_arrays(int ngrow) 
+void FixTTM::grow_arrays(int ngrow)
 {
 
- memory->grow(flangevin,ngrow,3,"TTM:flangevin");  
+ memory->grow(flangevin,ngrow,3,"TTM:flangevin");
 
 }
 
@@ -574,11 +574,11 @@ double FixTTM::compute_vector(int n)
   for (int ixnode = 0; ixnode < nxnodes; ixnode++)
     for (int iynode = 0; iynode < nynodes; iynode++)
       for (int iznode = 0; iznode < nznodes; iznode++) {
-        e_energy += 
-	  T_electron[ixnode][iynode][iznode]*electronic_specific_heat* 
-	  electronic_density*del_vol;
-        transfer_energy += 
-	  net_energy_transfer_all[ixnode][iynode][iznode]*update->dt;
+        e_energy +=
+          T_electron[ixnode][iynode][iznode]*electronic_specific_heat*
+          electronic_density*del_vol;
+        transfer_energy +=
+          net_energy_transfer_all[ixnode][iynode][iznode]*update->dt;
   }
 
   if (n == 0) return e_energy;
@@ -587,7 +587,7 @@ double FixTTM::compute_vector(int n)
 }
 
 /* ----------------------------------------------------------------------
-   pack entire state of Fix into one write 
+   pack entire state of Fix into one write
 ------------------------------------------------------------------------- */
 
 void FixTTM::write_restart(FILE *fp)
@@ -597,12 +597,12 @@ void FixTTM::write_restart(FILE *fp)
 
   int n = 0;
   rlist[n++] = seed;
- 
+
   for (int ixnode = 0; ixnode < nxnodes; ixnode++)
     for (int iynode = 0; iynode < nynodes; iynode++)
       for (int iznode = 0; iznode < nznodes; iznode++)
         rlist[n++] =  T_electron[ixnode][iynode][iznode];
-  
+
   if (comm->me == 0) {
     int size = n * sizeof(double);
     fwrite(&size,sizeof(int),1,fp);
@@ -613,23 +613,23 @@ void FixTTM::write_restart(FILE *fp)
 }
 
 /* ----------------------------------------------------------------------
-   use state info from restart file to restart the Fix 
+   use state info from restart file to restart the Fix
 ------------------------------------------------------------------------- */
 
 void FixTTM::restart(char *buf)
 {
   int n = 0;
   double *rlist = (double *) buf;
-  
+
   // the seed must be changed from the initial seed
 
   seed = static_cast<int> (0.5*rlist[n++]);
-  
+
   for (int ixnode = 0; ixnode < nxnodes; ixnode++)
     for (int iynode = 0; iynode < nynodes; iynode++)
       for (int iznode = 0; iznode < nznodes; iznode++)
         T_electron[ixnode][iynode][iznode] = rlist[n++];
-  
+
   delete random;
   random = new RanMars(lmp,seed+comm->me);
 }
diff --git a/src/fix_ttm.h b/src/fix_ttm.h
index 6669e21d63..f8ed2e626b 100644
--- a/src/fix_ttm.h
+++ b/src/fix_ttm.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -44,7 +44,7 @@ class FixTTM : public Fix {
   int size_restart(int);
   int maxsize_restart();
   double memory_usage();
-  void grow_arrays(int); 
+  void grow_arrays(int);
   double compute_vector(int);
 
  private:
@@ -58,7 +58,7 @@ class FixTTM : public Fix {
   int ***nsum;
   int ***nsum_all,***T_initial_set;
   double *gfactor1,*gfactor2,*ratio;
-  double **flangevin; 
+  double **flangevin;
   double ***T_electron,***T_electron_old;
   double ***sum_vsq,***sum_mass_vsq;
   double ***sum_vsq_all,***sum_mass_vsq_all;
diff --git a/src/fix_viscosity.cpp b/src/fix_viscosity.cpp
index e566a5057e..24f0a911c5 100644
--- a/src/fix_viscosity.cpp
+++ b/src/fix_viscosity.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -79,7 +79,7 @@ FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) :
       if (strcmp(arg[iarg+1],"INF") == 0) vtarget = BIG;
       else vtarget = atof(arg[iarg+1]);
       if (vtarget <= 0.0)
-	error->all(FLERR,"Fix viscosity vtarget value must be positive");
+        error->all(FLERR,"Fix viscosity vtarget value must be positive");
       iarg += 2;
     } else error->all(FLERR,"Illegal fix viscosity command");
   }
@@ -192,37 +192,37 @@ void FixViscosity::end_of_step()
       else if (coord >= boxhi && periodicity) coord -= prd;
 
       if (coord >= slablo_lo && coord < slablo_hi) {
-	if (v[i][vdim] < 0.0) continue;
-	delta = fabs(v[i][vdim] - vtarget);
-	if (npositive < nswap || delta < pos_delta[nswap-1]) {
-	  for (insert = npositive-1; insert >= 0; insert--)
-	    if (delta > pos_delta[insert]) break;
-	  insert++;
-	  for (m = npositive-1; m >= insert; m--) {
-	    pos_delta[m+1] = pos_delta[m];
-	    pos_index[m+1] = pos_index[m];
-	  }
-	  pos_delta[insert] = delta;
-	  pos_index[insert] = i;
-	  if (npositive < nswap) npositive++;
-	}
+        if (v[i][vdim] < 0.0) continue;
+        delta = fabs(v[i][vdim] - vtarget);
+        if (npositive < nswap || delta < pos_delta[nswap-1]) {
+          for (insert = npositive-1; insert >= 0; insert--)
+            if (delta > pos_delta[insert]) break;
+          insert++;
+          for (m = npositive-1; m >= insert; m--) {
+            pos_delta[m+1] = pos_delta[m];
+            pos_index[m+1] = pos_index[m];
+          }
+          pos_delta[insert] = delta;
+          pos_index[insert] = i;
+          if (npositive < nswap) npositive++;
+        }
       }
 
       if (coord >= slabhi_lo && coord < slabhi_hi) {
-	if (v[i][vdim] > 0.0) continue;
-	delta = fabs(v[i][vdim] + vtarget);
-	if (nnegative < nswap || delta < neg_delta[nswap-1]) {
-	  for (insert = nnegative-1; insert >= 0; insert--)
-	    if (delta > neg_delta[insert]) break;
-	  insert++;
-	  for (m = nnegative-1; m >= insert; m--) {
-	    neg_delta[m+1] = neg_delta[m];
-	    neg_index[m+1] = neg_index[m];
-	  }
-	  neg_delta[insert] = delta;
-	  neg_index[insert] = i;
-	  if (nnegative < nswap) nnegative++;
-	}
+        if (v[i][vdim] > 0.0) continue;
+        delta = fabs(v[i][vdim] + vtarget);
+        if (nnegative < nswap || delta < neg_delta[nswap-1]) {
+          for (insert = nnegative-1; insert >= 0; insert--)
+            if (delta > neg_delta[insert]) break;
+          insert++;
+          for (m = nnegative-1; m >= insert; m--) {
+            neg_delta[m+1] = neg_delta[m];
+            neg_index[m+1] = neg_index[m];
+          }
+          neg_delta[insert] = delta;
+          neg_index[insert] = i;
+          if (nnegative < nswap) nnegative++;
+        }
       }
     }
 
@@ -249,7 +249,7 @@ void FixViscosity::end_of_step()
     else mine[0].value = BIG;
     if (inegative < nnegative) mine[1].value = neg_delta[inegative];
     else mine[1].value = BIG;
-    
+
     MPI_Allreduce(mine,all,2,MPI_DOUBLE_INT,MPI_MINLOC,world);
 
     if (all[0].value == BIG || all[1].value == BIG) continue;
@@ -267,14 +267,14 @@ void FixViscosity::end_of_step()
       v[ineg][vdim] = 2.0 * vcm - sbuf[0];
       v[ipos][vdim] = 2.0 * vcm - rbuf[0];
       pswap += rbuf[1] * (vcm - rbuf[0]) - sbuf[1] * (vcm - sbuf[0]);
-      
+
     } else if (me == all[0].proc) {
       ipos = pos_index[ipositive++];
       sbuf[0] = v[ipos][vdim];
       if (rmass) sbuf[1] = rmass[ipos];
       else sbuf[1] = mass[type[ipos]];
       MPI_Sendrecv(sbuf,2,MPI_DOUBLE,all[1].proc,0,
-		   rbuf,2,MPI_DOUBLE,all[1].proc,0,world,&status);
+                   rbuf,2,MPI_DOUBLE,all[1].proc,0,world,&status);
       vcm = (sbuf[1]*sbuf[0] + rbuf[1]*rbuf[0]) / (sbuf[1] + rbuf[1]);
       v[ipos][vdim] = 2.0 * vcm - sbuf[0];
       pswap += sbuf[1] * (vcm - sbuf[0]);
@@ -285,7 +285,7 @@ void FixViscosity::end_of_step()
       if (rmass) sbuf[1] = rmass[ineg];
       else sbuf[1] = mass[type[ineg]];
       MPI_Sendrecv(sbuf,2,MPI_DOUBLE,all[0].proc,0,
-		   rbuf,2,MPI_DOUBLE,all[0].proc,0,world,&status);
+                   rbuf,2,MPI_DOUBLE,all[0].proc,0,world,&status);
       vcm = (sbuf[1]*sbuf[0] + rbuf[1]*rbuf[0]) / (sbuf[1] + rbuf[1]);
       v[ineg][vdim] = 2.0 * vcm - sbuf[0];
       pswap -= sbuf[1] * (vcm - sbuf[0]);
diff --git a/src/fix_viscosity.h b/src/fix_viscosity.h
index 46ae4727a3..6f694d4f94 100644
--- a/src/fix_viscosity.h
+++ b/src/fix_viscosity.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_viscous.cpp b/src/fix_viscous.cpp
index f54140db02..f6a6f2d66a 100644
--- a/src/fix_viscous.cpp
+++ b/src/fix_viscous.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -43,7 +43,7 @@ FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) :
       int itype = atoi(arg[iarg+1]);
       double scale = atof(arg[iarg+2]);
       if (itype <= 0 || itype > atom->ntypes)
-	error->all(FLERR,"Illegal fix viscous command");
+        error->all(FLERR,"Illegal fix viscous command");
       gamma[itype] = gamma_one * scale;
       iarg += 3;
     } else error->all(FLERR,"Illegal fix viscous command");
@@ -109,7 +109,7 @@ void FixViscous::post_force(int vflag)
   int *mask = atom->mask;
   int *type = atom->type;
   int nlocal = atom->nlocal;
-  
+
   double drag;
 
   for (int i = 0; i < nlocal; i++)
@@ -134,4 +134,3 @@ void FixViscous::min_post_force(int vflag)
 {
   post_force(vflag);
 }
-
diff --git a/src/fix_viscous.h b/src/fix_viscous.h
index 06b67c1299..437b93f2cc 100644
--- a/src/fix_viscous.h
+++ b/src/fix_viscous.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp
index 5a145a8b08..7a031634c2 100644
--- a/src/fix_wall.cpp
+++ b/src/fix_wall.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -51,8 +51,8 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 3;
   while (iarg < narg) {
     if ((strcmp(arg[iarg],"xlo") == 0) || (strcmp(arg[iarg],"xhi") == 0) ||
-	(strcmp(arg[iarg],"ylo") == 0) || (strcmp(arg[iarg],"yhi") == 0) ||
-	(strcmp(arg[iarg],"zlo") == 0) || (strcmp(arg[iarg],"zhi") == 0)) {
+        (strcmp(arg[iarg],"ylo") == 0) || (strcmp(arg[iarg],"yhi") == 0) ||
+        (strcmp(arg[iarg],"zlo") == 0) || (strcmp(arg[iarg],"zhi") == 0)) {
       if (iarg+5 > narg) error->all(FLERR,"Illegal fix wall command");
 
       int newwall;
@@ -64,24 +64,24 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
       else if (strcmp(arg[iarg],"zhi") == 0) newwall = ZHI;
 
       for (int m = 0; m < nwall; m++)
-	if (newwall == wallwhich[m])
-	  error->all(FLERR,"Wall defined twice in fix wall command");
+        if (newwall == wallwhich[m])
+          error->all(FLERR,"Wall defined twice in fix wall command");
 
       wallwhich[nwall] = newwall;
       if (strcmp(arg[iarg+1],"EDGE") == 0) {
-	wallstyle[nwall] = EDGE;
-	int dim = wallwhich[nwall] / 2;
-	int side = wallwhich[nwall] % 2;
-	if (side == 0) coord0[nwall] = domain->boxlo[dim];
-	else coord0[nwall] = domain->boxhi[dim];
+        wallstyle[nwall] = EDGE;
+        int dim = wallwhich[nwall] / 2;
+        int side = wallwhich[nwall] % 2;
+        if (side == 0) coord0[nwall] = domain->boxlo[dim];
+        else coord0[nwall] = domain->boxhi[dim];
       } else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	wallstyle[nwall] = VARIABLE;
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	varstr[nwall] = new char[n];
-	strcpy(varstr[nwall],&arg[iarg+1][2]);
+        wallstyle[nwall] = VARIABLE;
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        varstr[nwall] = new char[n];
+        strcpy(varstr[nwall],&arg[iarg+1][2]);
       } else {
-	wallstyle[nwall] = CONSTANT;
-	coord0[nwall] = atof(arg[iarg+1]);
+        wallstyle[nwall] = CONSTANT;
+        coord0[nwall] = atof(arg[iarg+1]);
       }
 
       epsilon[nwall] = atof(arg[iarg+2]);
@@ -126,7 +126,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) :
   for (int m = 0; m < nwall; m++)
     if ((wallwhich[m] == ZLO || wallwhich[m] == ZHI) && domain->dimension == 2)
       error->all(FLERR,"Cannot use fix wall zlo/zhi for a 2d simulation");
-  
+
   // scale factors for CONSTANT and VARIABLE walls
 
   int flag = 0;
diff --git a/src/fix_wall.h b/src/fix_wall.h
index 185edea237..84f824b6e8 100644
--- a/src/fix_wall.h
+++ b/src/fix_wall.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -35,7 +35,7 @@ class FixWall : public Fix {
 
   virtual void precompute(int) = 0;
   virtual void wall_particle(int, int, double) = 0;
-  
+
   int nwall;
   int wallwhich[6];
   double coord0[6];
@@ -43,7 +43,7 @@ class FixWall : public Fix {
   int wallstyle[6];
   int varindex[6];
   char *varstr[6];
- 
+
 
  protected:
   double epsilon[6],sigma[6],cutoff[6];
diff --git a/src/fix_wall_harmonic.cpp b/src/fix_wall_harmonic.cpp
index 48a32331b5..1766fa63c9 100644
--- a/src/fix_wall_harmonic.cpp
+++ b/src/fix_wall_harmonic.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -21,7 +21,7 @@ using namespace FixConst;
 
 /* ---------------------------------------------------------------------- */
 
-FixWallHarmonic::FixWallHarmonic(LAMMPS *lmp, int narg, char **arg) : 
+FixWallHarmonic::FixWallHarmonic(LAMMPS *lmp, int narg, char **arg) :
   FixWall(lmp, narg, arg) {}
 
 /* ----------------------------------------------------------------------
@@ -52,8 +52,8 @@ void FixWallHarmonic::wall_particle(int m, int which, double coord)
       else delta = coord - x[i][dim];
       if (delta >= cutoff[m]) continue;
       if (delta <= 0.0) {
-	onflag = 1;
-	continue;
+        onflag = 1;
+        continue;
       }
       dr = cutoff[m]-delta;
       fwall = side * 2.0*epsilon[m]*dr;
diff --git a/src/fix_wall_harmonic.h b/src/fix_wall_harmonic.h
index 23947b4e6b..d8d7b309d6 100644
--- a/src/fix_wall_harmonic.h
+++ b/src/fix_wall_harmonic.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_wall_lj126.cpp b/src/fix_wall_lj126.cpp
index 4aa87e07cc..c942a34acd 100644
--- a/src/fix_wall_lj126.cpp
+++ b/src/fix_wall_lj126.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -21,7 +21,7 @@ using namespace FixConst;
 
 /* ---------------------------------------------------------------------- */
 
-FixWallLJ126::FixWallLJ126(LAMMPS *lmp, int narg, char **arg) : 
+FixWallLJ126::FixWallLJ126(LAMMPS *lmp, int narg, char **arg) :
   FixWall(lmp, narg, arg) {}
 
 /* ---------------------------------------------------------------------- */
@@ -66,8 +66,8 @@ void FixWallLJ126::wall_particle(int m, int which, double coord)
       else delta = coord - x[i][dim];
       if (delta >= cutoff[m]) continue;
       if (delta <= 0.0) {
-	onflag = 1;
-	continue;
+        onflag = 1;
+        continue;
       }
       rinv = 1.0/delta;
       r2inv = rinv*rinv;
diff --git a/src/fix_wall_lj126.h b/src/fix_wall_lj126.h
index 37fb89446d..8455345708 100644
--- a/src/fix_wall_lj126.h
+++ b/src/fix_wall_lj126.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_wall_lj93.cpp b/src/fix_wall_lj93.cpp
index d2f92825e8..a4cd6b6516 100644
--- a/src/fix_wall_lj93.cpp
+++ b/src/fix_wall_lj93.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -21,7 +21,7 @@ using namespace FixConst;
 
 /* ---------------------------------------------------------------------- */
 
-FixWallLJ93::FixWallLJ93(LAMMPS *lmp, int narg, char **arg) : 
+FixWallLJ93::FixWallLJ93(LAMMPS *lmp, int narg, char **arg) :
   FixWall(lmp, narg, arg) {}
 
 /* ---------------------------------------------------------------------- */
@@ -67,8 +67,8 @@ void FixWallLJ93::wall_particle(int m, int which, double coord)
       else delta = coord - x[i][dim];
       if (delta >= cutoff[m]) continue;
       if (delta <= 0.0) {
-	onflag = 1;
-	continue;
+        onflag = 1;
+        continue;
       }
       rinv = 1.0/delta;
       r2inv = rinv*rinv;
@@ -76,8 +76,8 @@ void FixWallLJ93::wall_particle(int m, int which, double coord)
       r10inv = r4inv*r4inv*r2inv;
       fwall = side * (coeff1[m]*r10inv - coeff2[m]*r4inv);
       f[i][dim] -= fwall;
-      ewall[0] += coeff3[m]*r4inv*r4inv*rinv - 
-	coeff4[m]*r2inv*rinv - offset[m];
+      ewall[0] += coeff3[m]*r4inv*r4inv*rinv -
+        coeff4[m]*r2inv*rinv - offset[m];
       ewall[m+1] += fwall;
     }
 
diff --git a/src/fix_wall_lj93.h b/src/fix_wall_lj93.h
index 30e2788c02..a2ab52ba60 100644
--- a/src/fix_wall_lj93.h
+++ b/src/fix_wall_lj93.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_wall_reflect.cpp b/src/fix_wall_reflect.cpp
index ddca6887cc..a79333ad14 100644
--- a/src/fix_wall_reflect.cpp
+++ b/src/fix_wall_reflect.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,8 +45,8 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) :
   int iarg = 3;
   while (iarg < narg) {
     if ((strcmp(arg[iarg],"xlo") == 0) || (strcmp(arg[iarg],"xhi") == 0) ||
-	(strcmp(arg[iarg],"ylo") == 0) || (strcmp(arg[iarg],"yhi") == 0) ||
-	(strcmp(arg[iarg],"zlo") == 0) || (strcmp(arg[iarg],"zhi") == 0)) {
+        (strcmp(arg[iarg],"ylo") == 0) || (strcmp(arg[iarg],"yhi") == 0) ||
+        (strcmp(arg[iarg],"zlo") == 0) || (strcmp(arg[iarg],"zhi") == 0)) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall/reflect command");
 
       int newwall;
@@ -58,24 +58,24 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) :
       else if (strcmp(arg[iarg],"zhi") == 0) newwall = ZHI;
 
       for (int m = 0; m < nwall; m++)
-	if (newwall == wallwhich[m])
-	  error->all(FLERR,"Wall defined twice in fix wall/reflect command");
+        if (newwall == wallwhich[m])
+          error->all(FLERR,"Wall defined twice in fix wall/reflect command");
 
       wallwhich[nwall] = newwall;
       if (strcmp(arg[iarg+1],"EDGE") == 0) {
-	wallstyle[nwall] = EDGE;
-	int dim = wallwhich[nwall] / 2;
-	int side = wallwhich[nwall] % 2;
-	if (side == 0) coord0[nwall] = domain->boxlo[dim];
-	else coord0[nwall] = domain->boxhi[dim];
+        wallstyle[nwall] = EDGE;
+        int dim = wallwhich[nwall] / 2;
+        int side = wallwhich[nwall] % 2;
+        if (side == 0) coord0[nwall] = domain->boxlo[dim];
+        else coord0[nwall] = domain->boxhi[dim];
       } else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	wallstyle[nwall] = VARIABLE;
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	varstr[nwall] = new char[n];
-	strcpy(varstr[nwall],&arg[iarg+1][2]);
+        wallstyle[nwall] = VARIABLE;
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        varstr[nwall] = new char[n];
+        strcpy(varstr[nwall],&arg[iarg+1][2]);
       } else {
-	wallstyle[nwall] = CONSTANT;
-	coord0[nwall] = atof(arg[iarg+1]);
+        wallstyle[nwall] = CONSTANT;
+        coord0[nwall] = atof(arg[iarg+1]);
       }
 
       nwall++;
@@ -106,7 +106,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) :
   for (int m = 0; m < nwall; m++)
     if ((wallwhich[m] == ZLO || wallwhich[m] == ZHI) && domain->dimension == 2)
       error->all(FLERR,
-		 "Cannot use fix wall/reflect zlo/zhi for a 2d simulation");
+                 "Cannot use fix wall/reflect zlo/zhi for a 2d simulation");
 
   // scale factors for CONSTANT and VARIABLE walls
 
@@ -124,7 +124,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) :
       zscale = domain->lattice->zlattice;
     }
     else xscale = yscale = zscale = 1.0;
-    
+
     for (int m = 0; m < nwall; m++) {
       if (wallstyle[m] != CONSTANT) continue;
       if (wallwhich[m] < YLO) coord0[m] *= xscale;
@@ -175,9 +175,9 @@ void FixWallReflect::init()
   for (int i = 0; i < modify->nfix; i++)
     if (modify->fix[i]->rigid_flag) nrigid++;
 
-  if (nrigid && comm->me == 0) 
+  if (nrigid && comm->me == 0)
     error->warning(FLERR,"Should not allow rigid bodies to bounce off "
-		   "relecting walls");
+                   "relecting walls");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -210,17 +210,17 @@ void FixWallReflect::post_integrate()
 
     for (i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (side == 0) {
-	  if (x[i][dim] < coord) {
-	    x[i][dim] = coord + (coord - x[i][dim]);
-	    v[i][dim] = -v[i][dim];
-	  }
-	} else {
-	  if (x[i][dim] > coord) {
-	    x[i][dim] = coord - (x[i][dim] - coord);
-	    v[i][dim] = -v[i][dim];
-	  }
-	}
+        if (side == 0) {
+          if (x[i][dim] < coord) {
+            x[i][dim] = coord + (coord - x[i][dim]);
+            v[i][dim] = -v[i][dim];
+          }
+        } else {
+          if (x[i][dim] > coord) {
+            x[i][dim] = coord - (x[i][dim] - coord);
+            v[i][dim] = -v[i][dim];
+          }
+        }
       }
   }
 
diff --git a/src/fix_wall_reflect.h b/src/fix_wall_reflect.h
index 475c4a3382..d1d345c531 100644
--- a/src/fix_wall_reflect.h
+++ b/src/fix_wall_reflect.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp
index bd5b3ea98b..e4572e8fed 100644
--- a/src/fix_wall_region.cpp
+++ b/src/fix_wall_region.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -102,21 +102,21 @@ void FixWallRegion::init()
   // insure all particles in group are extended particles
 
   if (style == COLLOID) {
-    if (!atom->sphere_flag) 
+    if (!atom->sphere_flag)
       error->all(FLERR,"Fix wall/region colloid requires atom style sphere");
 
     double *radius = atom->radius;
     int *mask = atom->mask;
     int nlocal = atom->nlocal;
-    
+
     int flag = 0;
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	if (radius[i] == 0.0) flag = 1;
-    
+        if (radius[i] == 0.0) flag = 1;
+
     int flagall;
     MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world);
-    if (flagall) 
+    if (flagall)
       error->all(FLERR,"Fix wall/region colloid requires extended particles");
   }
 
@@ -196,12 +196,12 @@ void FixWallRegion::post_force(int vflag)
   // region->match() insures particle is in region or on surface, else error
   // if returned contact dist r = 0, is on surface, also an error
   // in COLLOID case, r <= radius is an error
-  
+
   for (i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       if (!region->match(x[i][0],x[i][1],x[i][2])) {
-	onflag = 1;
-	continue;
+        onflag = 1;
+        continue;
       }
       if (style == COLLOID) tooclose = radius[i];
       else tooclose = 0.0;
@@ -209,31 +209,31 @@ void FixWallRegion::post_force(int vflag)
       n = region->surface(x[i][0],x[i][1],x[i][2],cutoff);
 
       for (m = 0; m < n; m++) {
-	if (region->contact[m].r <= tooclose) {
-	  onflag = 1;
-	  continue;
-	} else rinv = 1.0/region->contact[m].r;
-
-	if (style == LJ93) lj93(region->contact[m].r);
-	else if (style == LJ126) lj126(region->contact[m].r);
-	else if (style == COLLOID) colloid(region->contact[m].r,radius[i]);
-	else harmonic(region->contact[m].r);
-
-	ewall[0] += eng;
-	fx = fwall * region->contact[m].delx * rinv;
-	fy = fwall * region->contact[m].dely * rinv;
-	fz = fwall * region->contact[m].delz * rinv;
-	f[i][0] += fx;
-	f[i][1] += fy;
-	f[i][2] += fz;
-	ewall[1] -= fx;
-	ewall[2] -= fy;
-	ewall[3] -= fz;
+        if (region->contact[m].r <= tooclose) {
+          onflag = 1;
+          continue;
+        } else rinv = 1.0/region->contact[m].r;
+
+        if (style == LJ93) lj93(region->contact[m].r);
+        else if (style == LJ126) lj126(region->contact[m].r);
+        else if (style == COLLOID) colloid(region->contact[m].r,radius[i]);
+        else harmonic(region->contact[m].r);
+
+        ewall[0] += eng;
+        fx = fwall * region->contact[m].delx * rinv;
+        fy = fwall * region->contact[m].dely * rinv;
+        fz = fwall * region->contact[m].delz * rinv;
+        f[i][0] += fx;
+        f[i][1] += fy;
+        f[i][2] += fz;
+        ewall[1] -= fx;
+        ewall[2] -= fy;
+        ewall[3] -= fz;
       }
     }
 
   if (onflag) error->one(FLERR,"Particle on or inside surface of region "
-			 "used in fix wall/region");
+                         "used in fix wall/region");
 }
 
 /* ---------------------------------------------------------------------- */
@@ -328,8 +328,8 @@ void FixWallRegion::colloid(double r, double rad)
   double r4inv = r2inv*r2inv;
   double r8inv = r4inv*r4inv;
   fwall = coeff1*(rad8*rad + 27.0*rad4*rad2*rad*pow(r,2.0)
-		  + 63.0*rad4*rad*pow(r,4.0)
-		  + 21.0*rad2*rad*pow(r,6.0))*r8inv - new_coeff2*r2inv;
+                  + 63.0*rad4*rad*pow(r,4.0)
+                  + 21.0*rad2*rad*pow(r,6.0))*r8inv - new_coeff2*r2inv;
 
   double r2 = 0.5*diam - r;
   double rinv2 = 1.0/r2;
@@ -340,9 +340,9 @@ void FixWallRegion::colloid(double r, double rad)
   double r2inv3 = rinv3*rinv3;
   double r4inv3 = r2inv3*r2inv3;
   eng = coeff3*((-3.5*diam+r)*r4inv2*r2inv2*rinv2
-		+ (3.5*diam+r)*r4inv3*r2inv3*rinv3) -
+                + (3.5*diam+r)*r4inv3*r2inv3*rinv3) -
     coeff4*((-diam*r+r2*r3*(log(-r2)-log(r3)))*
-	    (-rinv2)*rinv3) - offset;
+            (-rinv2)*rinv3) - offset;
 }
 
 /* ----------------------------------------------------------------------
diff --git a/src/fix_wall_region.h b/src/fix_wall_region.h
index 15a667af64..92d7b393d3 100644
--- a/src/fix_wall_region.h
+++ b/src/fix_wall_region.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/force.cpp b/src/force.cpp
index 98a972dd71..8170c874f8 100644
--- a/src/force.cpp
+++ b/src/force.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -188,20 +188,20 @@ Pair *Force::pair_match(const char *word, int exact)
     count = 0;
     for (int i = 0; i < hybrid->nstyles; i++)
       if ((exact && strcmp(hybrid->keywords[i],word) == 0) ||
-	  (!exact && strstr(hybrid->keywords[i],word))) {
-	iwhich = i;
-	count++;
+          (!exact && strstr(hybrid->keywords[i],word))) {
+        iwhich = i;
+        count++;
       }
     if (count == 1) return hybrid->styles[iwhich];
-    
+
   } else if (strstr(pair_style,"hybrid")) {
     PairHybrid *hybrid = (PairHybrid *) pair;
     count = 0;
     for (int i = 0; i < hybrid->nstyles; i++)
       if ((exact && strcmp(hybrid->keywords[i],word) == 0) ||
-	  (!exact && strstr(hybrid->keywords[i],word))) {
-	iwhich = i;
-	count++;
+          (!exact && strstr(hybrid->keywords[i],word))) {
+        iwhich = i;
+        count++;
       }
     if (count == 1) return hybrid->styles[iwhich];
   }
@@ -469,7 +469,7 @@ Improper *Force::new_improper(const char *style, const char *suffix, int &sflag)
 }
 
 /* ----------------------------------------------------------------------
-   new kspace style 
+   new kspace style
 ------------------------------------------------------------------------- */
 
 void Force::create_kspace(int narg, char **arg, const char *suffix)
@@ -544,7 +544,7 @@ KSpace *Force::kspace_match(const char *word, int exact)
 }
 
 /* ----------------------------------------------------------------------
-   set special bond values 
+   set special bond values
 ------------------------------------------------------------------------- */
 
 void Force::set_special(int narg, char **arg)
@@ -628,7 +628,7 @@ void Force::set_special(int narg, char **arg)
 
   for (int i = 1; i <= 3; i++)
     if (special_lj[i] < 0.0 || special_lj[i] > 1.0 ||
-	special_coul[i] < 0.0 || special_coul[i] > 1.0)
+        special_coul[i] < 0.0 || special_coul[i] > 1.0)
       error->all(FLERR,"Illegal special_bonds command");
 
   if (special_extra < 0) error->all(FLERR,"Illegal special_bonds command");
@@ -680,7 +680,7 @@ double Force::numeric(char *str)
     if (str[i] == '-' || str[i] == '+' || str[i] == '.') continue;
     if (str[i] == 'e' || str[i] == 'E') continue;
     error->all(FLERR,"Expected floating point parameter in "
-	       "input script or data file");
+               "input script or data file");
   }
 
   return atof(str);
diff --git a/src/force.h b/src/force.h
index d219226e6e..0a84cd869b 100644
--- a/src/force.h
+++ b/src/force.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -34,7 +34,7 @@ class Force : protected Pointers {
   double qqrd2e;                     // q^2/r to energy w/ dielectric constant
   double e_mass;                     // electron mass
   double hhmrr2e;                    // conversion of (hbar)^2/(mr^2) to energy
-  double mvh2r;                      // conversion of mv/hbar to distance 
+  double mvh2r;                      // conversion of mv/hbar to distance
                                      // hbar = h/(2*pi)
   double angstrom;                   // 1 angstrom in native units
   double femtosecond;                // 1 femtosecond in native units
@@ -78,7 +78,7 @@ class Force : protected Pointers {
 
   void create_bond(const char *, const char *suffix = NULL);
   class Bond *new_bond(const char *, const char *, int &);
-  class Bond *bond_match(const char *); 
+  class Bond *bond_match(const char *);
 
   void create_angle(const char *, const char *suffix = NULL);
   class Angle *new_angle(const char *, const char *, int &);
diff --git a/src/group.cpp b/src/group.cpp
index 7c52a5d368..dfccc77f46 100644
--- a/src/group.cpp
+++ b/src/group.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -82,7 +82,7 @@ void Group::assign(int narg, char **arg)
 {
   int i;
 
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"Group command before simulation box is defined");
   if (narg < 2) error->all(FLERR,"Illegal group command");
 
@@ -95,16 +95,16 @@ void Group::assign(int narg, char **arg)
     if (igroup == 0) error->all(FLERR,"Cannot delete group all");
     for (i = 0; i < modify->nfix; i++)
       if (modify->fix[i]->igroup == igroup)
-	error->all(FLERR,"Cannot delete group currently used by a fix");
+        error->all(FLERR,"Cannot delete group currently used by a fix");
     for (i = 0; i < modify->ncompute; i++)
       if (modify->compute[i]->igroup == igroup)
-	error->all(FLERR,"Cannot delete group currently used by a compute");
+        error->all(FLERR,"Cannot delete group currently used by a compute");
     for (i = 0; i < output->ndump; i++)
       if (output->dump[i]->igroup == igroup)
-	error->all(FLERR,"Cannot delete group currently used by a dump");
+        error->all(FLERR,"Cannot delete group currently used by a dump");
     if (atom->firstgroupname && strcmp(arg[0],atom->firstgroupname) == 0)
       error->all(FLERR,
-		 "Cannot delete group currently used by atom_modify first");
+                 "Cannot delete group currently used by atom_modify first");
 
     int *mask = atom->mask;
     int nlocal = atom->nlocal;
@@ -136,7 +136,7 @@ void Group::assign(int narg, char **arg)
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
   int bit = bitmask[igroup];
-    
+
   // style = region
   // add to group if atom is in region
   // init all regions via domain->init() to insure region can perform match()
@@ -144,21 +144,21 @@ void Group::assign(int narg, char **arg)
   if (strcmp(arg[1],"region") == 0) {
 
     if (narg != 3) error->all(FLERR,"Illegal group command");
-    
+
     int iregion = domain->find_region(arg[2]);
     if (iregion == -1) error->all(FLERR,"Group region ID does not exist");
     domain->init();
 
     for (i = 0; i < nlocal; i++)
       if (domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
-	mask[i] |= bit;
+        mask[i] |= bit;
 
   // style = logical condition
 
-  } else if (narg >= 3 && 
-	     (strcmp(arg[2],"<") == 0 || strcmp(arg[2],">") == 0 || 
-	      strcmp(arg[2],"<=") == 0 || strcmp(arg[2],">=") == 0 || 
-	      strcmp(arg[2],"<>") == 0)) {
+  } else if (narg >= 3 &&
+             (strcmp(arg[2],"<") == 0 || strcmp(arg[2],">") == 0 ||
+              strcmp(arg[2],"<=") == 0 || strcmp(arg[2],">=") == 0 ||
+              strcmp(arg[2],"<>") == 0)) {
 
     if (narg < 4 || narg > 5) error->all(FLERR,"Illegal group command");
     int category,condition,bound1,bound2;
@@ -167,7 +167,7 @@ void Group::assign(int narg, char **arg)
     else if (strcmp(arg[1],"molecule") == 0) category = MOLECULE;
     else if (strcmp(arg[1],"id") == 0) category = ID;
     else error->all(FLERR,"Illegal group command");
-    
+
     if (strcmp(arg[2],"<") == 0) condition = LT;
     else if (strcmp(arg[2],"<=") == 0) condition = LE;
     else if (strcmp(arg[2],">") == 0) condition = GT;
@@ -206,13 +206,13 @@ void Group::assign(int narg, char **arg)
       for (i = 0; i < nlocal; i++) if (attribute[i] != bound1) mask[i] |= bit;
     } else if (condition == BETWEEN) {
       for (i = 0; i < nlocal; i++)
-	if (attribute[i] >= bound1 && attribute[i] <= bound2) mask[i] |= bit;
+        if (attribute[i] >= bound1 && attribute[i] <= bound2) mask[i] |= bit;
     }
 
   // style = list of values
 
   } else if (strcmp(arg[1],"type") == 0 || strcmp(arg[1],"molecule") == 0 ||
-	     strcmp(arg[1],"id") == 0) {
+             strcmp(arg[1],"id") == 0) {
 
     if (narg < 3) error->all(FLERR,"Illegal group command");
 
@@ -224,7 +224,7 @@ void Group::assign(int narg, char **arg)
     else if (strcmp(arg[1],"molecule") == 0) category = MOLECULE;
     else if (strcmp(arg[1],"id") == 0) category = ID;
     else error->all(FLERR,"Illegal group command");
-    
+
     length = narg - 2;
     for (int iarg = 2; iarg < narg; iarg++) list[iarg-2] = atoi(arg[iarg]);
 
@@ -237,16 +237,16 @@ void Group::assign(int narg, char **arg)
 
     for (int ilist = 0; ilist < length; ilist++)
       for (i = 0; i < nlocal; i++)
-	if (attribute[i] == list[ilist]) mask[i] |= bit;
+        if (attribute[i] == list[ilist]) mask[i] |= bit;
 
     delete [] list;
-    
+
   // style = subtract
 
   } else if (strcmp(arg[1],"subtract") == 0) {
 
     if (narg < 4) error->all(FLERR,"Illegal group command");
-    
+
     int length = narg-2;
     int *list = new int[length];
 
@@ -261,7 +261,7 @@ void Group::assign(int narg, char **arg)
 
     int otherbit = bitmask[list[0]];
 
-    for (i = 0; i < nlocal; i++) 
+    for (i = 0; i < nlocal; i++)
       if (mask[i] & otherbit) mask[i] |= bit;
 
     // remove atoms if they are in any of the other groups
@@ -271,8 +271,8 @@ void Group::assign(int narg, char **arg)
 
     for (int ilist = 1; ilist < length; ilist++) {
       otherbit = bitmask[list[ilist]];
-      for (i = 0; i < nlocal; i++) 
-	if (mask[i] & otherbit) mask[i] &= inverse;
+      for (i = 0; i < nlocal; i++)
+        if (mask[i] & otherbit) mask[i] &= inverse;
     }
 
     delete [] list;
@@ -282,7 +282,7 @@ void Group::assign(int narg, char **arg)
   } else if (strcmp(arg[1],"union") == 0) {
 
     if (narg < 3) error->all(FLERR,"Illegal group command");
-    
+
     int length = narg-2;
     int *list = new int[length];
 
@@ -299,8 +299,8 @@ void Group::assign(int narg, char **arg)
 
     for (int ilist = 0; ilist < length; ilist++) {
       otherbit = bitmask[list[ilist]];
-      for (i = 0; i < nlocal; i++) 
-	if (mask[i] & otherbit) mask[i] |= bit;
+      for (i = 0; i < nlocal; i++)
+        if (mask[i] & otherbit) mask[i] |= bit;
     }
 
     delete [] list;
@@ -310,7 +310,7 @@ void Group::assign(int narg, char **arg)
   } else if (strcmp(arg[1],"intersect") == 0) {
 
     if (narg < 4) error->all(FLERR,"Illegal group command");
-    
+
     int length = narg-2;
     int *list = new int[length];
 
@@ -328,8 +328,8 @@ void Group::assign(int narg, char **arg)
     for (i = 0; i < nlocal; i++) {
       ok = 1;
       for (ilist = 0; ilist < length; ilist++) {
-	otherbit = bitmask[list[ilist]];
-	if ((mask[i] & otherbit) == 0) ok = 0;
+        otherbit = bitmask[list[ilist]];
+        if ((mask[i] & otherbit) == 0) ok = 0;
       }
       if (ok) mask[i] |= bit;
     }
@@ -356,7 +356,7 @@ void Group::assign(int narg, char **arg)
       fprintf(logfile,"%.15g atoms in group %s\n",all,names[igroup]);
   }
 }
- 
+
 /* ----------------------------------------------------------------------
    add flagged atoms to a new or existing group
 ------------------------------------------------------------------------- */
@@ -385,7 +385,7 @@ void Group::create(char *name, int *flag)
   int nlocal = atom->nlocal;
   int bit = bitmask[igroup];
 
-  for (i = 0; i < nlocal; i++) 
+  for (i = 0; i < nlocal; i++)
     if (flag[i]) mask[i] |= bit;
 }
 
@@ -575,11 +575,11 @@ double Group::mass(int igroup, int iregion)
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	one += rmass[i];
+        one += rmass[i];
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	one += mass[type[i]];
+        one += mass[type[i]];
   }
 
   double all;
@@ -644,7 +644,7 @@ void Group::bounds(int igroup, double *minmax)
   double extent[6];
   extent[0] = extent[2] = extent[4] = BIG;
   extent[1] = extent[3] = extent[5] = -BIG;
-  
+
   double **x = atom->x;
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
@@ -659,15 +659,15 @@ void Group::bounds(int igroup, double *minmax)
       extent[5] = MAX(extent[5],x[i][2]);
     }
   }
-  
+
   // compute extent across all procs
   // flip sign of MIN to do it in one Allreduce MAX
   // set box by extent in shrink-wrapped dims
-  
+
   extent[0] = -extent[0];
   extent[2] = -extent[2];
   extent[4] = -extent[4];
-  
+
   MPI_Allreduce(extent,minmax,6,MPI_DOUBLE,MPI_MAX,world);
 
   minmax[0] = -minmax[0];
@@ -688,7 +688,7 @@ void Group::bounds(int igroup, double *minmax, int iregion)
   double extent[6];
   extent[0] = extent[2] = extent[4] = BIG;
   extent[1] = extent[3] = extent[5] = -BIG;
-  
+
   double **x = atom->x;
   int *mask = atom->mask;
   int nlocal = atom->nlocal;
@@ -703,15 +703,15 @@ void Group::bounds(int igroup, double *minmax, int iregion)
       extent[5] = MAX(extent[5],x[i][2]);
     }
   }
-  
+
   // compute extent across all procs
   // flip sign of MIN to do it in one Allreduce MAX
   // set box by extent in shrink-wrapped dims
-  
+
   extent[0] = -extent[0];
   extent[2] = -extent[2];
   extent[4] = -extent[4];
-  
+
   MPI_Allreduce(extent,minmax,6,MPI_DOUBLE,MPI_MAX,world);
 
   minmax[0] = -minmax[0];
@@ -750,24 +750,24 @@ void Group::xcm(int igroup, double masstotal, double *cm)
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	massone = rmass[i];
-	cmone[0] += (x[i][0] + xbox*xprd) * massone;
-	cmone[1] += (x[i][1] + ybox*yprd) * massone;
-	cmone[2] += (x[i][2] + zbox*zprd) * massone;
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        massone = rmass[i];
+        cmone[0] += (x[i][0] + xbox*xprd) * massone;
+        cmone[1] += (x[i][1] + ybox*yprd) * massone;
+        cmone[2] += (x[i][2] + zbox*zprd) * massone;
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	massone = mass[type[i]];
-	cmone[0] += (x[i][0] + xbox*xprd) * massone;
-	cmone[1] += (x[i][1] + ybox*yprd) * massone;
-	cmone[2] += (x[i][2] + zbox*zprd) * massone;
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        massone = mass[type[i]];
+        cmone[0] += (x[i][0] + xbox*xprd) * massone;
+        cmone[1] += (x[i][1] + ybox*yprd) * massone;
+        cmone[2] += (x[i][2] + zbox*zprd) * massone;
       }
   }
 
@@ -811,24 +811,24 @@ void Group::xcm(int igroup, double masstotal, double *cm, int iregion)
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	massone = rmass[i];
-	cmone[0] += (x[i][0] + xbox*xprd) * massone;
-	cmone[1] += (x[i][1] + ybox*yprd) * massone;
-	cmone[2] += (x[i][2] + zbox*zprd) * massone;
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        massone = rmass[i];
+        cmone[0] += (x[i][0] + xbox*xprd) * massone;
+        cmone[1] += (x[i][1] + ybox*yprd) * massone;
+        cmone[2] += (x[i][2] + zbox*zprd) * massone;
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	xbox = (image[i] & 1023) - 512;
-	ybox = (image[i] >> 10 & 1023) - 512;
-	zbox = (image[i] >> 20) - 512;
-	massone = mass[type[i]];
-	cmone[0] += (x[i][0] + xbox*xprd) * massone;
-	cmone[1] += (x[i][1] + ybox*yprd) * massone;
-	cmone[2] += (x[i][2] + zbox*zprd) * massone;
+        xbox = (image[i] & 1023) - 512;
+        ybox = (image[i] >> 10 & 1023) - 512;
+        zbox = (image[i] >> 20) - 512;
+        massone = mass[type[i]];
+        cmone[0] += (x[i][0] + xbox*xprd) * massone;
+        cmone[1] += (x[i][1] + ybox*yprd) * massone;
+        cmone[2] += (x[i][2] + zbox*zprd) * massone;
       }
   }
 
@@ -863,18 +863,18 @@ void Group::vcm(int igroup, double masstotal, double *cm)
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	massone = rmass[i];
-	p[0] += v[i][0]*massone;
-	p[1] += v[i][1]*massone;
-	p[2] += v[i][2]*massone;
+        massone = rmass[i];
+        p[0] += v[i][0]*massone;
+        p[1] += v[i][1]*massone;
+        p[2] += v[i][2]*massone;
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	massone = mass[type[i]];
-	p[0] += v[i][0]*massone;
-	p[1] += v[i][1]*massone;
-	p[2] += v[i][2]*massone;
+        massone = mass[type[i]];
+        p[0] += v[i][0]*massone;
+        p[1] += v[i][1]*massone;
+        p[2] += v[i][2]*massone;
       }
   }
 
@@ -911,18 +911,18 @@ void Group::vcm(int igroup, double masstotal, double *cm, int iregion)
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	massone = rmass[i];
-	p[0] += v[i][0]*massone;
-	p[1] += v[i][1]*massone;
-	p[2] += v[i][2]*massone;
+        massone = rmass[i];
+        p[0] += v[i][0]*massone;
+        p[1] += v[i][1]*massone;
+        p[2] += v[i][2]*massone;
       }
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
-	massone = mass[type[i]];
-	p[0] += v[i][0]*massone;
-	p[1] += v[i][1]*massone;
-	p[2] += v[i][2]*massone;
+        massone = mass[type[i]];
+        p[0] += v[i][0]*massone;
+        p[1] += v[i][1]*massone;
+        p[2] += v[i][2]*massone;
       }
   }
 
@@ -1006,15 +1006,15 @@ double Group::ke(int igroup)
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	one += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
-	  rmass[i];
+        one += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
+          rmass[i];
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit)
-	one += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
-	  mass[type[i]];
+        one += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
+          mass[type[i]];
   }
-  
+
   double all;
   MPI_Allreduce(&one,&all,1,MPI_DOUBLE,MPI_SUM,world);
   all *= 0.5 * force->mvv2e;
@@ -1043,15 +1043,15 @@ double Group::ke(int igroup, int iregion)
   if (rmass) {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	one += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
-	  rmass[i];
+        one += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
+          rmass[i];
   } else {
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2]))
-	one += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
-	  mass[type[i]];
+        one += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
+          mass[type[i]];
   }
-  
+
   double all;
   MPI_Allreduce(&one,&all,1,MPI_DOUBLE,MPI_SUM,world);
   all *= 0.5 * force->mvv2e;
@@ -1097,7 +1097,7 @@ double Group::gyration(int igroup, double masstotal, double *cm)
     }
   double rg_all;
   MPI_Allreduce(&rg,&rg_all,1,MPI_DOUBLE,MPI_SUM,world);
-  
+
   if (masstotal > 0.0) return sqrt(rg_all/masstotal);
   return 0.0;
 }
@@ -1142,7 +1142,7 @@ double Group::gyration(int igroup, double masstotal, double *cm, int iregion)
     }
   double rg_all;
   MPI_Allreduce(&rg,&rg_all,1,MPI_DOUBLE,MPI_SUM,world);
-  
+
   if (masstotal > 0.0) return sqrt(rg_all/masstotal);
   return 0.0;
 }
@@ -1447,22 +1447,22 @@ void Group::omega(double *angmom, double inertia[3][3], double *w)
   inverse[2][1] = -(inertia[0][0]*inertia[2][1] - inertia[0][1]*inertia[2][0]);
   inverse[2][2] = inertia[0][0]*inertia[1][1] - inertia[0][1]*inertia[1][0];
 
-  double determinant = inertia[0][0]*inertia[1][1]*inertia[2][2] + 
-    inertia[0][1]*inertia[1][2]*inertia[2][0] + 
-    inertia[0][2]*inertia[1][0]*inertia[2][1] - 
+  double determinant = inertia[0][0]*inertia[1][1]*inertia[2][2] +
+    inertia[0][1]*inertia[1][2]*inertia[2][0] +
+    inertia[0][2]*inertia[1][0]*inertia[2][1] -
     inertia[0][0]*inertia[1][2]*inertia[2][1] -
-    inertia[0][1]*inertia[1][0]*inertia[2][2] - 
-    inertia[2][0]*inertia[1][1]*inertia[0][2]; 
+    inertia[0][1]*inertia[1][0]*inertia[2][2] -
+    inertia[2][0]*inertia[1][1]*inertia[0][2];
 
   if (determinant > 0.0)
     for (int i = 0; i < 3; i++)
       for (int j = 0; j < 3; j++)
-	inverse[i][j] /= determinant;
+        inverse[i][j] /= determinant;
 
-  w[0] = inverse[0][0]*angmom[0] + inverse[0][1]*angmom[1] + 
+  w[0] = inverse[0][0]*angmom[0] + inverse[0][1]*angmom[1] +
     inverse[0][2]*angmom[2];
-  w[1] = inverse[1][0]*angmom[0] + inverse[1][1]*angmom[1] + 
+  w[1] = inverse[1][0]*angmom[0] + inverse[1][1]*angmom[1] +
     inverse[1][2]*angmom[2];
-  w[2] = inverse[2][0]*angmom[0] + inverse[2][1]*angmom[1] + 
+  w[2] = inverse[2][0]*angmom[0] + inverse[2][1]*angmom[1] +
     inverse[2][2]*angmom[2];
 }
diff --git a/src/group.h b/src/group.h
index 6c3ea74bca..6cb64a902d 100644
--- a/src/group.h
+++ b/src/group.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -109,7 +109,7 @@ Self-explanatory.
 
 E: Too many groups
 
-The maximum number of atom groups (including the "all" group) is 
+The maximum number of atom groups (including the "all" group) is
 given by MAX_GROUP in group.cpp and is 32.
 
 E: Group region ID does not exist
diff --git a/src/image.cpp b/src/image.cpp
index 0792e70d5a..5efe67b9f8 100644
--- a/src/image.cpp
+++ b/src/image.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -102,7 +102,7 @@ Image::Image(LAMMPS *lmp) : Pointers(lmp)
   keyLightColor[2] = 0.9;
 
   fillLightPhi = MY_PI/6.0;     // 30 degrees
-  fillLightTheta = 0; 
+  fillLightTheta = 0;
   fillLightColor[0] = 0.45;
   fillLightColor[1] = 0.45;
   fillLightColor[2] = 0.45;
@@ -115,7 +115,7 @@ Image::Image(LAMMPS *lmp) : Pointers(lmp)
 
   // RNG for SSAO depth shading
 
-  if (ssao) random = new RanMars(lmp,seed+me); 
+  if (ssao) random = new RanMars(lmp,seed+me);
   else random = NULL;
 }
 
@@ -135,7 +135,7 @@ Image::~Image()
   memory->destroy(surfacecopy);
   memory->destroy(rgbcopy);
 
-  delete random; 
+  delete random;
 }
 
 /* ----------------------------------------------------------------------
@@ -161,7 +161,7 @@ void Image::buffers()
 ------------------------------------------------------------------------- */
 
 void Image::view_params(double boxxlo, double boxxhi, double boxylo,
-			double boxyhi, double boxzlo, double boxzhi)
+                        double boxyhi, double boxzlo, double boxzhi)
 {
   // camDir points at the camera, view direction = -camDir
 
@@ -258,7 +258,7 @@ void Image::view_params(double boxxlo, double boxxhi, double boxylo,
     ambientColor[1] = 0.5;
     ambientColor[2] = 0.5;
   }
-  
+
   // param for rasterizing spheres
 
   tanPerPixel = -(maxdel / (double) height);
@@ -302,12 +302,12 @@ void Image::color_minmax(int n, double *buf, int stride)
   } else if (mstyle == DISCRETE) {
     for (int i = 0; i < nentry; i++) {
       if (mentry[i].lo == MINVALUE) {
-	if (mrange == ABSOLUTE) mentry[i].lvalue = locurrent;
-	else mentry[i].lvalue = 0.0;
+        if (mrange == ABSOLUTE) mentry[i].lvalue = locurrent;
+        else mentry[i].lvalue = 0.0;
       }
       if (mentry[i].hi == MAXVALUE) {
-	if (mrange == ABSOLUTE) mentry[i].hvalue = hicurrent;
-	else mentry[i].hvalue = 1.0;
+        if (mrange == ABSOLUTE) mentry[i].hvalue = hicurrent;
+        else mentry[i].hvalue = 1.0;
       }
     }
   }
@@ -354,14 +354,14 @@ void Image::merge()
       MPI_Irecv(rgbcopy,npixels*3,MPI_BYTE,me+nhalf,0,world,&requests[0]);
       MPI_Irecv(depthcopy,npixels,MPI_DOUBLE,me+nhalf,0,world,&requests[1]);
       if (ssao)
-	MPI_Irecv(surfacecopy,npixels*2,MPI_DOUBLE,
-		  me+nhalf,0,world,&requests[2]);
+        MPI_Irecv(surfacecopy,npixels*2,MPI_DOUBLE,
+                  me+nhalf,0,world,&requests[2]);
       if (ssao) MPI_Waitall(3,requests,statuses);
       else MPI_Waitall(2,requests,statuses);
 
       for (int i = 0; i < npixels; i++) {
-        if (depthBuffer[i] < 0 || (depthcopy[i] >= 0 && 
-				   depthcopy[i] < depthBuffer[i])) {
+        if (depthBuffer[i] < 0 || (depthcopy[i] >= 0 &&
+                                   depthcopy[i] < depthBuffer[i])) {
           depthBuffer[i] = depthcopy[i];
           imageBuffer[i*3+0] = rgbcopy[i*3+0];
           imageBuffer[i*3+1] = rgbcopy[i*3+1];
@@ -455,7 +455,7 @@ void Image::draw_sphere(double *x, double *surfaceColor, double diameter)
 
   double radius = 0.5*diameter;
   double radsq = radius*radius;
-  double pixelWidth = (tanPerPixel > 0) ? tanPerPixel * dist : 
+  double pixelWidth = (tanPerPixel > 0) ? tanPerPixel * dist :
     -tanPerPixel / zoom;
   double pixelRadiusFull = radius / pixelWidth;
   int pixelRadius = static_cast<int> (pixelRadiusFull + 0.5) + 1;
@@ -479,9 +479,9 @@ void Image::draw_sphere(double *x, double *surfaceColor, double diameter)
       surface[1] = ((iy - yc) - height_error) * pixelWidth;
       surface[0] = ((ix - xc) - width_error) * pixelWidth;
       projRad = surface[0]*surface[0] + surface[1]*surface[1];
-      
+
       // outside the sphere in the projected image
-      
+
       if (projRad > radsq) continue;
       surface[2] = sqrt(radsq - projRad);
       depth = dist - surface[2];
@@ -515,7 +515,7 @@ void Image::draw_cube(double *x, double *surfaceColor, double diameter)
   double dist = MathExtra::dot3(camPos,camDir) - MathExtra::dot3(xlocal,camDir);
 
   double radius = 0.5*diameter;
-  double pixelWidth = (tanPerPixel > 0) ? tanPerPixel * dist : 
+  double pixelWidth = (tanPerPixel > 0) ? tanPerPixel * dist :
     -tanPerPixel / zoom;
 
   double halfWidth = diameter;
@@ -537,7 +537,7 @@ void Image::draw_cube(double *x, double *surfaceColor, double diameter)
   for (int iy = yc - pixelHalfWidth; iy <= yc + pixelHalfWidth; iy ++) {
     for (int ix = xc - pixelHalfWidth; ix <= xc + pixelHalfWidth; ix ++) {
       if (iy < 0 || iy >= height || ix < 0 || ix >= width) continue;
-      
+
       double sy = ((iy - yc) - height_error) * pixelWidth;
       double sx = ((ix - xc) - width_error) * pixelWidth;
       surface[0] = camRight[0] * sx + camUp[0] * sy;
@@ -565,32 +565,32 @@ void Image::draw_cube(double *x, double *surfaceColor, double diameter)
           tdir[1] = camDir[1] * t;
           tdir[2] = camDir[2] * t;
 
-          bool xin = ((surface[0]+tdir[0]) >= -radius) && 
-	    ((surface[0]+tdir[0]) <= radius);
-          bool yin = ((surface[1]+tdir[1]) >= -radius) && 
-	    ((surface[1]+tdir[1]) <= radius);
-          bool zin = ((surface[2]+tdir[2]) >= -radius) && 
-	    ((surface[2]+tdir[2]) <= radius);
+          bool xin = ((surface[0]+tdir[0]) >= -radius) &&
+            ((surface[0]+tdir[0]) <= radius);
+          bool yin = ((surface[1]+tdir[1]) >= -radius) &&
+            ((surface[1]+tdir[1]) <= radius);
+          bool zin = ((surface[2]+tdir[2]) >= -radius) &&
+            ((surface[2]+tdir[2]) <= radius);
 
           switch (dim) {
-	  case 0:
-	    if (yin & zin) {
-	      depth = dist - t;
-	      draw_pixel (ix, iy, depth, normal, surfaceColor);
-	    }
-	    break;
-	  case 1:
-	    if (xin & zin) {
-	      depth = dist - t;
-	      draw_pixel (ix, iy, depth, normal, surfaceColor);
-	    }
-	    break;
-	  case 2:
-	    if (xin & yin) {
-	      depth = dist - t;
-	      draw_pixel (ix, iy, depth, normal, surfaceColor);
-	    }
-	    break;
+          case 0:
+            if (yin & zin) {
+              depth = dist - t;
+              draw_pixel (ix, iy, depth, normal, surfaceColor);
+            }
+            break;
+          case 1:
+            if (xin & zin) {
+              depth = dist - t;
+              draw_pixel (ix, iy, depth, normal, surfaceColor);
+            }
+            break;
+          case 2:
+            if (xin & yin) {
+              depth = dist - t;
+              draw_pixel (ix, iy, depth, normal, surfaceColor);
+            }
+            break;
           }
         }
       }
@@ -608,7 +608,7 @@ void Image::draw_cube(double *x, double *surfaceColor, double diameter)
 ------------------------------------------------------------------------- */
 
 void Image::draw_cylinder(double *x, double *y,
-			  double *surfaceColor, double diameter, int sflag)
+                          double *surfaceColor, double diameter, int sflag)
 {
   double surface[3], normal[3];
   double mid[3],xaxis[3],yaxis[3],zaxis[3];
@@ -642,7 +642,7 @@ void Image::draw_cylinder(double *x, double *y,
   double ymap = MathExtra::dot3(camUp,mid);
   double dist = MathExtra::dot3(camPos,camDir) - MathExtra::dot3(mid,camDir);
 
-  double pixelWidth = (tanPerPixel > 0) ? tanPerPixel * dist : 
+  double pixelWidth = (tanPerPixel > 0) ? tanPerPixel * dist :
     -tanPerPixel / zoom;
 
   double xf = xmap / pixelWidth;
@@ -664,7 +664,7 @@ void Image::draw_cylinder(double *x, double *y,
 
   if (zaxis[0] == camDir[0] && zaxis[1] == camDir[1] && zaxis[2] == camDir[2])
     return;
-  if (zaxis[0] == -camDir[0] && zaxis[1] == -camDir[1] && 
+  if (zaxis[0] == -camDir[0] && zaxis[1] == -camDir[1] &&
       zaxis[2] == -camDir[2]) return;
 
   MathExtra::cross3(zaxis,camDir,yaxis);
@@ -691,7 +691,7 @@ void Image::draw_cylinder(double *x, double *y,
   for (int iy = yc - pixelHalfHeight; iy <= yc + pixelHalfHeight; iy ++) {
     for (int ix = xc - pixelHalfWidth; ix <= xc + pixelHalfWidth; ix ++) {
       if (iy < 0 || iy >= height || ix < 0 || ix >= width) continue;
-      
+
       double sy = ((iy - yc) - height_error) * pixelWidth;
       double sx = ((ix - xc) - width_error) * pixelWidth;
       surface[0] = camLRight[0] * sx + camLUp[0] * sy;
@@ -721,7 +721,7 @@ void Image::draw_cylinder(double *x, double *y,
       normal[1] = surface[1] / radius;
       normal[2] = 0.0;
 
-      // in camera space 
+      // in camera space
 
       surface[0] = MathExtra::dot3 (normal, camLRight);
       surface[1] = MathExtra::dot3 (normal, camLUp);
@@ -793,7 +793,7 @@ void Image::draw_triangle(double *x, double *y, double *z, double *surfaceColor)
   double ymap = MathExtra::dot3(camUp,xlocal);
   double dist = MathExtra::dot3(camPos,camDir) - MathExtra::dot3(xlocal,camDir);
 
-  double pixelWidth = (tanPerPixel > 0) ? tanPerPixel * dist : 
+  double pixelWidth = (tanPerPixel > 0) ? tanPerPixel * dist :
     -tanPerPixel / zoom;
 
   double xf = xmap / pixelWidth;
@@ -873,50 +873,50 @@ void Image::draw_triangle(double *x, double *y, double *z, double *surfaceColor)
 
 /* ---------------------------------------------------------------------- */
 
-void Image::draw_pixel(int ix, int iy, double depth, 
-			   double *surface, double *surfaceColor)
+void Image::draw_pixel(int ix, int iy, double depth,
+                           double *surface, double *surfaceColor)
 {
   double diffuseKey,diffuseFill,diffuseBack,specularKey;
-  if (depth < 0 || (depthBuffer[ix + iy*width] >= 0 && 
-		    depth >= depthBuffer[ix + iy*width])) return;
+  if (depth < 0 || (depthBuffer[ix + iy*width] >= 0 &&
+                    depth >= depthBuffer[ix + iy*width])) return;
   depthBuffer[ix + iy*width] = depth;
-      
+
   // store only the tangent relative to the camera normal (0,0,-1)
 
   surfaceBuffer[0 + ix * 2 + iy*width * 2] = surface[1];
   surfaceBuffer[1 + ix * 2 + iy*width * 2] = -surface[0];
-      
+
   diffuseKey = saturate(MathExtra::dot3(surface, keyLightDir));
   diffuseFill = saturate(MathExtra::dot3(surface, fillLightDir));
   diffuseBack = saturate(MathExtra::dot3(surface, backLightDir));
   specularKey = pow(saturate(MathExtra::dot3(surface, keyHalfDir)),
-		    specularHardness) * specularIntensity;
-  
+                    specularHardness) * specularIntensity;
+
   double c[3];
   c[0] = surfaceColor[0] * ambientColor[0];
   c[1] = surfaceColor[1] * ambientColor[1];
   c[2] = surfaceColor[2] * ambientColor[2];
-      
+
   c[0] += surfaceColor[0] * keyLightColor[0] * diffuseKey;
   c[1] += surfaceColor[1] * keyLightColor[1] * diffuseKey;
   c[2] += surfaceColor[2] * keyLightColor[2] * diffuseKey;
-  
+
   c[0] += keyLightColor[0] * specularKey;
   c[1] += keyLightColor[1] * specularKey;
   c[2] += keyLightColor[2] * specularKey;
-      
+
   c[0] += surfaceColor[0] * fillLightColor[0] * diffuseFill;
   c[1] += surfaceColor[1] * fillLightColor[1] * diffuseFill;
   c[2] += surfaceColor[2] * fillLightColor[2] * diffuseFill;
-      
+
   c[0] += surfaceColor[0] * backLightColor[0] * diffuseBack;
   c[1] += surfaceColor[1] * backLightColor[1] * diffuseBack;
   c[2] += surfaceColor[2] * backLightColor[2] * diffuseBack;
-      
+
   c[0] = saturate(c[0]);
   c[1] = saturate(c[1]);
   c[2] = saturate(c[2]);
-      
+
   imageBuffer[0 + ix*3 + iy*width*3] = static_cast<int>(c[0] * 255.0);
   imageBuffer[1 + ix*3 + iy*width*3] = static_cast<int>(c[1] * 255.0);
   imageBuffer[2 + ix*3 + iy*width*3] = static_cast<int>(c[2] * 255.0);
@@ -932,8 +932,8 @@ void Image::compute_SSAO()
 
   // typical neighborhood value for shading
 
-  double pixelWidth = (tanPerPixel > 0) ? tanPerPixel : 
-	-tanPerPixel / zoom;
+  double pixelWidth = (tanPerPixel > 0) ? tanPerPixel :
+        -tanPerPixel / zoom;
   int pixelRadius = (int) trunc (SSAORadius / pixelWidth + 0.5);
 
   int x,y,s;
@@ -956,8 +956,8 @@ void Image::compute_SSAO()
         double hy = sin(mytheta);
         mytheta += delTheta;
 
-	// multiply by z cross surface tangent
-	// so that dot (aka cos) works here
+        // multiply by z cross surface tangent
+        // so that dot (aka cos) works here
 
         double scaled_sin_t = sin_t * (hx*sy + hy*sx);
 
@@ -969,7 +969,7 @@ void Image::compute_SSAO()
         if (ex < 0) { ex = 0; } if (ex >= width) { ex = width - 1; }
         int ey = y + dy;
         if (ey < 0) { ey = 0; } if (ey >= height) { ey = height - 1; }
-        double delta; 
+        double delta;
         int small, large;
         double lenIncr;
         if (fabs(hx) > fabs(hy)) {
@@ -984,7 +984,7 @@ void Image::compute_SSAO()
         lenIncr = sqrt (1 + delta * delta) * pixelWidth;
 
         // initialize with one step
-	// because the center point doesn't need testing
+        // because the center point doesn't need testing
 
         int end = ex + ey * width;
         int ind = index + small;
@@ -1005,8 +1005,8 @@ void Image::compute_SSAO()
 
           // cdepth - depthBuffer B/C we want it in the negative z direction
 
-          if (minPeak < 0 || (depthBuffer[ind] >= 0 && 
-			      depthBuffer[ind] < minPeak)) {
+          if (minPeak < 0 || (depthBuffer[ind] >= 0 &&
+                              depthBuffer[ind] < minPeak)) {
             minPeak = depthBuffer[ind];
             peakLen = len;
           }
@@ -1028,7 +1028,7 @@ void Image::compute_SSAO()
         }
       }
       ao /= (double)SSAOSamples;
-      
+
       double c[3];
       c[0] = (double) (*(unsigned char *) &imageBuffer[index * 3 + 0]);
       c[1] = (double) (*(unsigned char *) &imageBuffer[index * 3 + 1]);
@@ -1045,7 +1045,7 @@ void Image::compute_SSAO()
 
 /* ---------------------------------------------------------------------- */
 
-void Image::write_JPG(FILE *fp) 
+void Image::write_JPG(FILE *fp)
 {
 #ifdef LAMMPS_JPEG
   struct jpeg_compress_struct cinfo;
@@ -1065,7 +1065,7 @@ void Image::write_JPG(FILE *fp)
   jpeg_start_compress(&cinfo, 1);
 
   while (cinfo.next_scanline < cinfo.image_height) {
-    row_pointer = (JSAMPROW) 
+    row_pointer = (JSAMPROW)
       &writeBuffer[(cinfo.image_height - 1 - cinfo.next_scanline) * 3 * width];
     jpeg_write_scanlines(&cinfo,&row_pointer,1);
   }
@@ -1077,7 +1077,7 @@ void Image::write_JPG(FILE *fp)
 
 /* ---------------------------------------------------------------------- */
 
-void Image::write_PPM(FILE *fp) 
+void Image::write_PPM(FILE *fp)
 {
   fprintf (fp,"P6\n%d %d\n255\n",width,height);
 
@@ -1085,9 +1085,9 @@ void Image::write_PPM(FILE *fp)
   for (y = height-1; y >= 0; y --)
     for (x = 0; x < width; x ++)
       fprintf(fp,"%c%c%c",
-	      writeBuffer[0 + x*3 + y*width*3],
-	      writeBuffer[1 + x*3 + y*width*3],
-	      writeBuffer[2 + x*3 + y*width*3]);
+              writeBuffer[0 + x*3 + y*width*3],
+              writeBuffer[1 + x*3 + y*width*3],
+              writeBuffer[2 + x*3 + y*width*3]);
 }
 
 /* ----------------------------------------------------------------------
@@ -1126,7 +1126,7 @@ int Image::colormap(int narg, char **arg)
     if (mbinsize <= 0.0) return 1;
     mbinsizeinv = 1.0/mbinsize;
   }
-    
+
   nentry = atoi(arg[4]);
   if (nentry < 1) return 1;
   mentry = new MapEntry[nentry];
@@ -1136,8 +1136,8 @@ int Image::colormap(int narg, char **arg)
     if (mstyle == CONTINUOUS) {
       if (n+2 > narg) return 1;
       if (!islower(arg[n][0])) {
-	mentry[i].single = NUMERIC;
-	mentry[i].svalue = atof(arg[n]);
+        mentry[i].single = NUMERIC;
+        mentry[i].svalue = atof(arg[n]);
       } else if (strcmp(arg[n],"min") == 0) mentry[i].single = MINVALUE;
       else if (strcmp(arg[n],"max") == 0) mentry[i].single = MAXVALUE;
       else return 1;
@@ -1146,14 +1146,14 @@ int Image::colormap(int narg, char **arg)
     } else if (mstyle == DISCRETE) {
       if (n+3 > narg) return 1;
       if (!islower(arg[n][0])) {
-	mentry[i].lo = NUMERIC;
-	mentry[i].lvalue = atof(arg[n]);
+        mentry[i].lo = NUMERIC;
+        mentry[i].lvalue = atof(arg[n]);
       } else if (strcmp(arg[n],"min") == 0) mentry[i].single = MINVALUE;
       else if (strcmp(arg[n],"max") == 0) mentry[i].single = MAXVALUE;
       else return 1;
       if (!islower(arg[n+1][0])) {
-	mentry[i].hi = NUMERIC;
-	mentry[i].hvalue = atof(arg[n+1]);
+        mentry[i].hi = NUMERIC;
+        mentry[i].hvalue = atof(arg[n+1]);
       } else if (strcmp(arg[n+1],"min") == 0) mentry[i].single = MINVALUE;
       else if (strcmp(arg[n+1],"max") == 0) mentry[i].single = MAXVALUE;
       else return 1;
@@ -1166,7 +1166,7 @@ int Image::colormap(int narg, char **arg)
     }
     if (mentry[i].color == NULL) return 1;
   }
-  
+
   if (mstyle == CONTINUOUS) {
     if (nentry < 2) return 1;
     if (mentry[0].single != MINVALUE || mentry[nentry-1].single != MAXVALUE)
@@ -1180,7 +1180,7 @@ int Image::colormap(int narg, char **arg)
   } else if (mstyle == SEQUENTIAL) {
     if (nentry < 1) return 1;
   }
-  
+
   return 0;
 }
 
@@ -1197,7 +1197,7 @@ int Image::addcolor(char *name, double r, double g, double b)
     if (strcmp(name,username[icolor]) == 0) break;
 
   if (icolor == ncolors) {
-    username = (char **) 
+    username = (char **)
       memory->srealloc(username,(ncolors+1)*sizeof(char *),"image:username");
     memory->grow(userrgb,ncolors+1,3,"image:userrgb");
     ncolors++;
@@ -1241,20 +1241,20 @@ double *Image::value2color(double value)
   if (mstyle == CONTINUOUS) {
     for (int i = 0; i < nentry-1; i++)
       if (value >= mentry[i].svalue && value <= mentry[i+1].svalue) {
-	double fraction = (value-mentry[i].svalue) / 
-	  (mentry[i+1].svalue-mentry[i].svalue);
-	interpolate[0] = mentry[i].color[0] + 
-	  fraction*(mentry[i+1].color[0]-mentry[i].color[0]);
-	interpolate[1] = mentry[i].color[1] + 
-	  fraction*(mentry[i+1].color[1]-mentry[i].color[1]);
-	interpolate[2] = mentry[i].color[2] + 
-	  fraction*(mentry[i+1].color[2]-mentry[i].color[2]);
-	return interpolate;
+        double fraction = (value-mentry[i].svalue) /
+          (mentry[i+1].svalue-mentry[i].svalue);
+        interpolate[0] = mentry[i].color[0] +
+          fraction*(mentry[i+1].color[0]-mentry[i].color[0]);
+        interpolate[1] = mentry[i].color[1] +
+          fraction*(mentry[i+1].color[1]-mentry[i].color[1]);
+        interpolate[2] = mentry[i].color[2] +
+          fraction*(mentry[i+1].color[2]-mentry[i].color[2]);
+        return interpolate;
       }
   } else if (mstyle == DISCRETE) {
     for (int i = 0; i < nentry; i++)
       if (value >= mentry[i].lvalue && value <= mentry[i].hvalue)
-	return mentry[i].color;
+        return mentry[i].color;
   } else {
     int ibin = static_cast<int> ((value-lo) * mbinsizeinv);
     return mentry[ibin%nentry].color;
@@ -1271,7 +1271,7 @@ double *Image::value2color(double value)
 
 double *Image::color2rgb(const char *color, int index)
 {
-  static const char *name[NCOLORS] = { 
+  static const char *name[NCOLORS] = {
     "aliceblue",
     "antiquewhite",
     "aqua",
@@ -1583,7 +1583,7 @@ int Image::default_colors()
 
 double *Image::element2color(char *element)
 {
-  static const char *name[NELEMENTS] = { 
+  static const char *name[NELEMENTS] = {
     "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne",
     "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca",
     "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn",
@@ -1722,7 +1722,7 @@ double *Image::element2color(char *element)
 
 double Image::element2diam(char *element)
 {
-  static const char *name[NELEMENTS] = { 
+  static const char *name[NELEMENTS] = {
     "H", "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne",
     "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", "Ca",
     "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", "Zn",
@@ -1754,4 +1754,3 @@ double Image::element2diam(char *element)
     if (strcmp(element,name[i]) == 0) return diameter[i];
   return 0.0;
 }
-
diff --git a/src/image.h b/src/image.h
index 3474fcee9e..59d9360796 100644
--- a/src/image.h
+++ b/src/image.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -142,9 +142,9 @@ class Image : protected Pointers {
   }
 
   inline double distance(double* a, double* b) {
-    return sqrt((a[0] - b[0]) * (a[0] - b[0]) + 
-		(a[1] - b[1]) * (a[1] - b[1]) + 
-		(a[2] - b[2]) * (a[2] - b[2]));
+    return sqrt((a[0] - b[0]) * (a[0] - b[0]) +
+                (a[1] - b[1]) * (a[1] - b[1]) +
+                (a[2] - b[2]) * (a[2] - b[2]));
   }
 };
 
diff --git a/src/improper.cpp b/src/improper.cpp
index 47ae5c69ed..7225d34709 100644
--- a/src/improper.cpp
+++ b/src/improper.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -73,7 +73,7 @@ void Improper::ev_setup(int eflag, int vflag)
   vflag_either = vflag;
   vflag_global = vflag % 4;
   vflag_atom = vflag / 4;
-  
+
   // reallocate per-atom arrays if necessary
 
   if (eflag_atom && atom->nmax > maxeatom) {
@@ -114,15 +114,15 @@ void Improper::ev_setup(int eflag, int vflag)
    tally energy and virial into global and per-atom accumulators
    virial = r1F1 + r2F2 + r3F3 + r4F4 = (r1-r2) F1 + (r3-r2) F3 + (r4-r2) F4
           = (r1-r2) F1 + (r3-r2) F3 + (r4-r3 + r3-r2) F4
-	  = vb1*f1 + vb2*f3 + (vb3+vb2)*f4
+          = vb1*f1 + vb2*f3 + (vb3+vb2)*f4
 ------------------------------------------------------------------------- */
 
 void Improper::ev_tally(int i1, int i2, int i3, int i4,
-			int nlocal, int newton_bond,
-			double eimproper, double *f1, double *f3, double *f4,
-			double vb1x, double vb1y, double vb1z,
-			double vb2x, double vb2y, double vb2z,
-			double vb3x, double vb3y, double vb3z)
+                        int nlocal, int newton_bond,
+                        double eimproper, double *f1, double *f3, double *f4,
+                        double vb1x, double vb1y, double vb1z,
+                        double vb2x, double vb2y, double vb2z,
+                        double vb3x, double vb3y, double vb3z)
 {
   double eimproperquarter,v[6];
 
@@ -130,11 +130,11 @@ void Improper::ev_tally(int i1, int i2, int i3, int i4,
     if (eflag_global) {
       if (newton_bond) energy += eimproper;
       else {
-	eimproperquarter = 0.25*eimproper;
-	if (i1 < nlocal) energy += eimproperquarter;
-	if (i2 < nlocal) energy += eimproperquarter;
-	if (i3 < nlocal) energy += eimproperquarter;
-	if (i4 < nlocal) energy += eimproperquarter;
+        eimproperquarter = 0.25*eimproper;
+        if (i1 < nlocal) energy += eimproperquarter;
+        if (i2 < nlocal) energy += eimproperquarter;
+        if (i3 < nlocal) energy += eimproperquarter;
+        if (i4 < nlocal) energy += eimproperquarter;
       }
     }
     if (eflag_atom) {
@@ -156,80 +156,80 @@ void Improper::ev_tally(int i1, int i2, int i3, int i4,
 
     if (vflag_global) {
       if (newton_bond) {
-	virial[0] += v[0];
-	virial[1] += v[1];
-	virial[2] += v[2];
-	virial[3] += v[3];
-	virial[4] += v[4];
-	virial[5] += v[5];
+        virial[0] += v[0];
+        virial[1] += v[1];
+        virial[2] += v[2];
+        virial[3] += v[3];
+        virial[4] += v[4];
+        virial[5] += v[5];
       } else {
-	if (i1 < nlocal) {
-	  virial[0] += 0.25*v[0];
-	  virial[1] += 0.25*v[1];
-	  virial[2] += 0.25*v[2];
-	  virial[3] += 0.25*v[3];
-	  virial[4] += 0.25*v[4];
-	  virial[5] += 0.25*v[5];
-	}
-	if (i2 < nlocal) {
-	  virial[0] += 0.25*v[0];
-	  virial[1] += 0.25*v[1];
-	  virial[2] += 0.25*v[2];
-	  virial[3] += 0.25*v[3];
-	  virial[4] += 0.25*v[4];
-	  virial[5] += 0.25*v[5];
-	}
-	if (i3 < nlocal) {
-	  virial[0] += 0.25*v[0];
-	  virial[1] += 0.25*v[1];
-	  virial[2] += 0.25*v[2];
-	  virial[3] += 0.25*v[3];
-	  virial[4] += 0.25*v[4];
-	  virial[5] += 0.25*v[5];
-	}
-	if (i4 < nlocal) {
-	  virial[0] += 0.25*v[0];
-	  virial[1] += 0.25*v[1];
-	  virial[2] += 0.25*v[2];
-	  virial[3] += 0.25*v[3];
-	  virial[4] += 0.25*v[4];
-	  virial[5] += 0.25*v[5];
-	}
+        if (i1 < nlocal) {
+          virial[0] += 0.25*v[0];
+          virial[1] += 0.25*v[1];
+          virial[2] += 0.25*v[2];
+          virial[3] += 0.25*v[3];
+          virial[4] += 0.25*v[4];
+          virial[5] += 0.25*v[5];
+        }
+        if (i2 < nlocal) {
+          virial[0] += 0.25*v[0];
+          virial[1] += 0.25*v[1];
+          virial[2] += 0.25*v[2];
+          virial[3] += 0.25*v[3];
+          virial[4] += 0.25*v[4];
+          virial[5] += 0.25*v[5];
+        }
+        if (i3 < nlocal) {
+          virial[0] += 0.25*v[0];
+          virial[1] += 0.25*v[1];
+          virial[2] += 0.25*v[2];
+          virial[3] += 0.25*v[3];
+          virial[4] += 0.25*v[4];
+          virial[5] += 0.25*v[5];
+        }
+        if (i4 < nlocal) {
+          virial[0] += 0.25*v[0];
+          virial[1] += 0.25*v[1];
+          virial[2] += 0.25*v[2];
+          virial[3] += 0.25*v[3];
+          virial[4] += 0.25*v[4];
+          virial[5] += 0.25*v[5];
+        }
       }
     }
 
     if (vflag_atom) {
       if (newton_bond || i1 < nlocal) {
-	vatom[i1][0] += 0.25*v[0];
-	vatom[i1][1] += 0.25*v[1];
-	vatom[i1][2] += 0.25*v[2];
-	vatom[i1][3] += 0.25*v[3];
-	vatom[i1][4] += 0.25*v[4];
-	vatom[i1][5] += 0.25*v[5];
+        vatom[i1][0] += 0.25*v[0];
+        vatom[i1][1] += 0.25*v[1];
+        vatom[i1][2] += 0.25*v[2];
+        vatom[i1][3] += 0.25*v[3];
+        vatom[i1][4] += 0.25*v[4];
+        vatom[i1][5] += 0.25*v[5];
       }
       if (newton_bond || i2 < nlocal) {
-	vatom[i2][0] += 0.25*v[0];
-	vatom[i2][1] += 0.25*v[1];
-	vatom[i2][2] += 0.25*v[2];
-	vatom[i2][3] += 0.25*v[3];
-	vatom[i2][4] += 0.25*v[4];
-	vatom[i2][5] += 0.25*v[5];
+        vatom[i2][0] += 0.25*v[0];
+        vatom[i2][1] += 0.25*v[1];
+        vatom[i2][2] += 0.25*v[2];
+        vatom[i2][3] += 0.25*v[3];
+        vatom[i2][4] += 0.25*v[4];
+        vatom[i2][5] += 0.25*v[5];
       }
       if (newton_bond || i3 < nlocal) {
-	vatom[i3][0] += 0.25*v[0];
-	vatom[i3][1] += 0.25*v[1];
-	vatom[i3][2] += 0.25*v[2];
-	vatom[i3][3] += 0.25*v[3];
-	vatom[i3][4] += 0.25*v[4];
-	vatom[i3][5] += 0.25*v[5];
+        vatom[i3][0] += 0.25*v[0];
+        vatom[i3][1] += 0.25*v[1];
+        vatom[i3][2] += 0.25*v[2];
+        vatom[i3][3] += 0.25*v[3];
+        vatom[i3][4] += 0.25*v[4];
+        vatom[i3][5] += 0.25*v[5];
       }
       if (newton_bond || i4 < nlocal) {
-	vatom[i4][0] += 0.25*v[0];
-	vatom[i4][1] += 0.25*v[1];
-	vatom[i4][2] += 0.25*v[2];
-	vatom[i4][3] += 0.25*v[3];
-	vatom[i4][4] += 0.25*v[4];
-	vatom[i4][5] += 0.25*v[5];
+        vatom[i4][0] += 0.25*v[0];
+        vatom[i4][1] += 0.25*v[1];
+        vatom[i4][2] += 0.25*v[2];
+        vatom[i4][3] += 0.25*v[3];
+        vatom[i4][4] += 0.25*v[4];
+        vatom[i4][5] += 0.25*v[5];
       }
     }
   }
diff --git a/src/improper.h b/src/improper.h
index 56f38e7641..dcf0703563 100644
--- a/src/improper.h
+++ b/src/improper.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -49,8 +49,8 @@ class Improper : protected Pointers {
 
   void ev_setup(int, int);
   void ev_tally(int, int, int, int, int, int, double,
-		double *, double *, double *, double, double, double,
-		double, double, double, double, double, double);
+                double *, double *, double *, double, double, double,
+                double, double, double, double, double, double);
 };
 
 }
diff --git a/src/input.cpp b/src/input.cpp
index d506ddacc3..8eda9eab56 100644
--- a/src/input.cpp
+++ b/src/input.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -93,8 +93,8 @@ Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp)
       while (jarg < argc && argv[jarg][0] != '-') jarg++;
       variable->set(argv[iarg+1],jarg-iarg-2,&argv[iarg+2]);
       iarg = jarg;
-    } else if (strcmp(argv[iarg],"-echo") == 0 || 
-	       strcmp(argv[iarg],"-e") == 0) {
+    } else if (strcmp(argv[iarg],"-echo") == 0 ||
+               strcmp(argv[iarg],"-e") == 0) {
       narg = 1;
       char **tmp = arg;        // trick echo() into using argv instead of arg
       arg = &argv[iarg+1];
@@ -131,7 +131,7 @@ void Input::file()
   int m,n;
 
   while (1) {
-    
+
     // read a line from input script
     // if line ends in continuation char '&', concatenate next line(s)
     // n = length of line including str terminator, 0 if end of file
@@ -140,12 +140,12 @@ void Input::file()
     if (me == 0) {
       m = 0;
       while (1) {
-	if (fgets(&line[m],MAXLINE-m,infile) == NULL) n = 0;
-	else n = strlen(line) + 1;
-	if (n == 0) break;
-	m = n-2;
-	while (m >= 0 && isspace(line[m])) m--;
-	if (m < 0 || line[m] != '&') break;
+        if (fgets(&line[m],MAXLINE-m,infile) == NULL) n = 0;
+        else n = strlen(line) + 1;
+        if (n == 0) break;
+        m = n-2;
+        while (m >= 0 && isspace(line[m])) m--;
+        if (m < 0 || line[m] != '&') break;
       }
     }
 
@@ -159,8 +159,8 @@ void Input::file()
     if (n == 0) {
       if (label_active) error->all(FLERR,"Label wasn't found in input script");
       if (me == 0) {
-	if (infile != stdin) fclose(infile);
-	nfile--;
+        if (infile != stdin) fclose(infile);
+        nfile--;
       }
       MPI_Bcast(&nfile,1,MPI_INT,0,world);
       if (nfile == 0) break;
@@ -181,7 +181,7 @@ void Input::file()
     // echo the command unless scanning for label
 
     if (me == 0 && label_active == 0) {
-      if (echo_screen && screen) fprintf(screen,"%s",line); 
+      if (echo_screen && screen) fprintf(screen,"%s",line);
       if (echo_log && logfile) fprintf(logfile,"%s",line);
     }
 
@@ -241,9 +241,9 @@ char *Input::one(const char *single)
   strcpy(line,single);
 
   // echo the command unless scanning for label
-  
+
   if (me == 0 && label_active == 0) {
-    if (echo_screen && screen) fprintf(screen,"%s\n",line); 
+    if (echo_screen && screen) fprintf(screen,"%s\n",line);
     if (echo_log && logfile) fprintf(logfile,"%s\n",line);
   }
 
@@ -383,17 +383,17 @@ void Input::substitute(char *str, int flag)
   while (*ptr) {
     if (*ptr == '$' && !quote) {
       if (*(ptr+1) == '{') {
-	var = ptr+2;
-	int i = 0;
-	while (var[i] != '\0' && var[i] != '}') i++;
-	if (var[i] == '\0') error->one(FLERR,"Invalid variable name");
-	var[i] = '\0';
-	beyond = ptr + strlen(var) + 3;
+        var = ptr+2;
+        int i = 0;
+        while (var[i] != '\0' && var[i] != '}') i++;
+        if (var[i] == '\0') error->one(FLERR,"Invalid variable name");
+        var[i] = '\0';
+        beyond = ptr + strlen(var) + 3;
       } else {
-	var = ptr;
-	var[0] = var[1];
-	var[1] = '\0';
-	beyond = ptr + strlen(var) + 1;
+        var = ptr;
+        var[0] = var[1];
+        var[1] = '\0';
+        beyond = ptr + strlen(var) + 1;
       }
       value = variable->retrieve(var);
       if (value == NULL) error->one(FLERR,"Substitution for illegal variable");
@@ -401,16 +401,16 @@ void Input::substitute(char *str, int flag)
       *ptr = '\0';
       strcpy(work,str);
       if (strlen(work)+strlen(value) >= MAXLINE)
-	error->one(FLERR,"Input line too long after variable substitution");
+        error->one(FLERR,"Input line too long after variable substitution");
       strcat(work,value);
       if (strlen(work)+strlen(beyond) >= MAXLINE)
-	error->one(FLERR,"Input line too long after variable substitution");
+        error->one(FLERR,"Input line too long after variable substitution");
       strcat(work,beyond);
       strcpy(str,work);
       ptr += strlen(value);
       if (flag && me == 0 && label_active == 0) {
-	if (echo_screen && screen) fprintf(screen,"%s",str); 
-	if (echo_log && logfile) fprintf(logfile,"%s",str);
+        if (echo_screen && screen) fprintf(screen,"%s",str);
+        if (echo_log && logfile) fprintf(logfile,"%s",str);
       }
       continue;
     }
@@ -507,7 +507,7 @@ int Input::execute_command()
 #define COMMAND_CLASS
 #define CommandStyle(key,Class)         \
   else if (strcmp(command,#key) == 0) { \
-    Class key(lmp);			\
+    Class key(lmp);                        \
     key.command(narg,arg);              \
     return 0;                           \
   }
@@ -578,8 +578,8 @@ void Input::ifthenelse()
 
   int first = 2;
   int iarg = first;
-  while (iarg < narg && 
-	 (strcmp(arg[iarg],"elif") != 0 && strcmp(arg[iarg],"else") != 0))
+  while (iarg < narg &&
+         (strcmp(arg[iarg],"elif") != 0 && strcmp(arg[iarg],"else") != 0))
     iarg++;
   int last = iarg-1;
 
@@ -600,9 +600,9 @@ void Input::ifthenelse()
       strcpy(commands[ncommands],arg[i]);
       ncommands++;
     }
-    
+
     for (int i = 0; i < ncommands; i++) one(commands[i]);
-    
+
     for (int i = 0; i < ncommands; i++) delete [] commands[i];
     delete [] commands;
     delete [] scopy;
@@ -635,8 +635,8 @@ void Input::ifthenelse()
     }
 
     iarg = first;
-    while (iarg < narg && 
-	   (strcmp(arg[iarg],"elif") != 0 && strcmp(arg[iarg],"else") != 0))
+    while (iarg < narg &&
+           (strcmp(arg[iarg],"elif") != 0 && strcmp(arg[iarg],"else") != 0))
       iarg++;
     last = iarg-1;
 
@@ -654,11 +654,11 @@ void Input::ifthenelse()
       strcpy(commands[ncommands],arg[i]);
       ncommands++;
     }
-    
+
     // execute the list of commands
-    
+
     for (int i = 0; i < ncommands; i++) one(commands[i]);
-    
+
     // clean up
 
     for (int i = 0; i < ncommands; i++) delete [] commands[i];
@@ -678,7 +678,7 @@ void Input::include()
   if (me == 0) {
     if (nfile == maxfile) {
       maxfile++;
-      infiles = (FILE **) 
+      infiles = (FILE **)
         memory->srealloc(infiles,maxfile*sizeof(FILE *),"input:infiles");
     }
     infile = fopen(arg[0],"r");
@@ -708,9 +708,9 @@ void Input::jump()
       if (infile != stdin) fclose(infile);
       infile = fopen(arg[0],"r");
       if (infile == NULL) {
-	char str[128];
-	sprintf(str,"Cannot open input script %s",arg[0]);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,"Cannot open input script %s",arg[0]);
+        error->one(FLERR,str);
       }
       infiles[nfile-1] = infile;
     }
@@ -745,9 +745,9 @@ void Input::log()
     else {
       logfile = fopen(arg[0],"w");
       if (logfile == NULL) {
-	char str[128];
-	sprintf(str,"Cannot open logfile %s",arg[0]);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,"Cannot open logfile %s",arg[0]);
+        error->one(FLERR,str);
       }
     }
     if (universe->nworlds == 1) universe->ulogfile = logfile;
@@ -830,10 +830,10 @@ void Input::shell()
 
   } else if (strcmp(arg[0],"mkdir") == 0) {
     if (narg < 2) error->all(FLERR,"Illegal shell command");
-#if !defined(WINDOWS) && !defined(__MINGW32_VERSION) 
+#if !defined(WINDOWS) && !defined(__MINGW32_VERSION)
     if (me == 0)
       for (int i = 1; i < narg; i++)
-	mkdir(arg[i], S_IRWXU | S_IRGRP | S_IXGRP);
+        mkdir(arg[i], S_IRWXU | S_IRGRP | S_IXGRP);
 #endif
 
   } else if (strcmp(arg[0],"mv") == 0) {
@@ -884,9 +884,9 @@ void Input::angle_coeff()
 {
   if (domain->box_exist == 0)
     error->all(FLERR,"Angle_coeff command before simulation box is defined");
-  if (force->angle == NULL) 
+  if (force->angle == NULL)
     error->all(FLERR,"Angle_coeff command before angle_style is defined");
-  if (atom->avec->angles_allow == 0) 
+  if (atom->avec->angles_allow == 0)
     error->all(FLERR,"Angle_coeff command when no angles allowed");
   force->angle->coeff(narg,arg);
 }
@@ -896,7 +896,7 @@ void Input::angle_coeff()
 void Input::angle_style()
 {
   if (narg < 1) error->all(FLERR,"Illegal angle_style command");
-  if (atom->avec->angles_allow == 0) 
+  if (atom->avec->angles_allow == 0)
     error->all(FLERR,"Angle_style command when no angles allowed");
   force->create_angle(arg[0],lmp->suffix);
   if (force->angle) force->angle->settings(narg-1,&arg[1]);
@@ -914,7 +914,7 @@ void Input::atom_modify()
 void Input::atom_style()
 {
   if (narg < 1) error->all(FLERR,"Illegal atom_style command");
-  if (domain->box_exist) 
+  if (domain->box_exist)
     error->all(FLERR,"Atom_style command after simulation box is defined");
   atom->create_avec(arg[0],narg-1,&arg[1],lmp->suffix);
 }
@@ -925,9 +925,9 @@ void Input::bond_coeff()
 {
   if (domain->box_exist == 0)
     error->all(FLERR,"Bond_coeff command before simulation box is defined");
-  if (force->bond == NULL) 
+  if (force->bond == NULL)
     error->all(FLERR,"Bond_coeff command before bond_style is defined");
-  if (atom->avec->bonds_allow == 0) 
+  if (atom->avec->bonds_allow == 0)
     error->all(FLERR,"Bond_coeff command when no bonds allowed");
   force->bond->coeff(narg,arg);
 }
@@ -937,7 +937,7 @@ void Input::bond_coeff()
 void Input::bond_style()
 {
   if (narg < 1) error->all(FLERR,"Illegal bond_style command");
-  if (atom->avec->bonds_allow == 0) 
+  if (atom->avec->bonds_allow == 0)
     error->all(FLERR,"Bond_style command when no bonds allowed");
   force->create_bond(arg[0],lmp->suffix);
   if (force->bond) force->bond->settings(narg-1,&arg[1]);
@@ -987,9 +987,9 @@ void Input::dihedral_coeff()
 {
   if (domain->box_exist == 0)
     error->all(FLERR,"Dihedral_coeff command before simulation box is defined");
-  if (force->dihedral == NULL) 
+  if (force->dihedral == NULL)
     error->all(FLERR,"Dihedral_coeff command before dihedral_style is defined");
-  if (atom->avec->dihedrals_allow == 0) 
+  if (atom->avec->dihedrals_allow == 0)
     error->all(FLERR,"Dihedral_coeff command when no dihedrals allowed");
   force->dihedral->coeff(narg,arg);
 }
@@ -999,7 +999,7 @@ void Input::dihedral_coeff()
 void Input::dihedral_style()
 {
   if (narg < 1) error->all(FLERR,"Illegal dihedral_style command");
-  if (atom->avec->dihedrals_allow == 0) 
+  if (atom->avec->dihedrals_allow == 0)
     error->all(FLERR,"Dihedral_style command when no dihedrals allowed");
   force->create_dihedral(arg[0],lmp->suffix);
   if (force->dihedral) force->dihedral->settings(narg-1,&arg[1]);
@@ -1010,7 +1010,7 @@ void Input::dihedral_style()
 void Input::dimension()
 {
   if (narg != 1) error->all(FLERR,"Illegal dimension command");
-  if (domain->box_exist) 
+  if (domain->box_exist)
     error->all(FLERR,"Dimension command after simulation box is defined");
   domain->dimension = atoi(arg[0]);
   if (domain->dimension != 2 && domain->dimension != 3)
@@ -1064,9 +1064,9 @@ void Input::improper_coeff()
 {
   if (domain->box_exist == 0)
     error->all(FLERR,"Improper_coeff command before simulation box is defined");
-  if (force->improper == NULL) 
+  if (force->improper == NULL)
     error->all(FLERR,"Improper_coeff command before improper_style is defined");
-  if (atom->avec->impropers_allow == 0) 
+  if (atom->avec->impropers_allow == 0)
     error->all(FLERR,"Improper_coeff command when no impropers allowed");
   force->improper->coeff(narg,arg);
 }
@@ -1076,7 +1076,7 @@ void Input::improper_coeff()
 void Input::improper_style()
 {
   if (narg < 1) error->all(FLERR,"Illegal improper_style command");
-  if (atom->avec->impropers_allow == 0) 
+  if (atom->avec->impropers_allow == 0)
     error->all(FLERR,"Improper_style command when no impropers allowed");
   force->create_improper(arg[0],lmp->suffix);
   if (force->improper) force->improper->settings(narg-1,&arg[1]);
@@ -1086,7 +1086,7 @@ void Input::improper_style()
 
 void Input::kspace_modify()
 {
-  if (force->kspace == NULL) 
+  if (force->kspace == NULL)
     error->all(FLERR,"KSpace style has not yet been set");
   force->kspace->modify_params(narg,arg);
 }
@@ -1167,11 +1167,11 @@ void Input::newton()
   force->newton_pair = newton_pair;
 
   if (newton_bond == 0) {
-    if (domain->box_exist && force->newton_bond == 1) 
+    if (domain->box_exist && force->newton_bond == 1)
       error->all(FLERR,"Newton bond change after simulation box is defined");
     force->newton_bond = 0;
   } else {
-    if (domain->box_exist && force->newton_bond == 0) 
+    if (domain->box_exist && force->newton_bond == 0)
       error->all(FLERR,"Newton bond change after simulation box is defined");
     force->newton_bond = 1;
   }
@@ -1184,7 +1184,7 @@ void Input::newton()
 
 void Input::package()
 {
-  if (domain->box_exist) 
+  if (domain->box_exist)
     error->all(FLERR,"Package command after simulation box is defined");
   if (narg < 1) error->all(FLERR,"Illegal package command");
 
@@ -1220,7 +1220,7 @@ void Input::pair_coeff()
 {
   if (domain->box_exist == 0)
     error->all(FLERR,"Pair_coeff command before simulation box is defined");
-  if (force->pair == NULL) 
+  if (force->pair == NULL)
     error->all(FLERR,"Pair_coeff command before pair_style is defined");
   force->pair->coeff(narg,arg);
 }
@@ -1229,7 +1229,7 @@ void Input::pair_coeff()
 
 void Input::pair_modify()
 {
-  if (force->pair == NULL) 
+  if (force->pair == NULL)
     error->all(FLERR,"Pair_modify command before pair_style is defined");
   force->pair->modify_params(narg,arg);
 }
@@ -1254,7 +1254,7 @@ void Input::pair_style()
 
 void Input::pair_write()
 {
-  if (force->pair == NULL) 
+  if (force->pair == NULL)
     error->all(FLERR,"Pair_write command before pair_style is defined");
   force->pair->write_file(narg,arg);
 }
@@ -1319,10 +1319,10 @@ void Input::special_bonds()
 
   if (domain->box_exist && atom->molecular) {
     if (lj2 != force->special_lj[2] || lj3 != force->special_lj[3] ||
-	coul2 != force->special_coul[2] || coul3 != force->special_coul[3] ||
-	angle != force->special_angle || 
-	dihedral != force->special_dihedral || 
-	extra != force->special_extra) {
+        coul2 != force->special_coul[2] || coul3 != force->special_coul[3] ||
+        angle != force->special_angle ||
+        dihedral != force->special_dihedral ||
+        extra != force->special_extra) {
       Special special(lmp);
       special.build();
     }
@@ -1334,7 +1334,7 @@ void Input::special_bonds()
 void Input::suffix()
 {
   if (narg != 1) error->all(FLERR,"Illegal suffix command");
-  
+
   if (strcmp(arg[0],"off") == 0) lmp->suffix_enable = 0;
   else if (strcmp(arg[0],"on") == 0) lmp->suffix_enable = 1;
   else {
@@ -1407,7 +1407,7 @@ void Input::unfix()
 void Input::units()
 {
   if (narg != 1) error->all(FLERR,"Illegal units command");
-  if (domain->box_exist) 
+  if (domain->box_exist)
     error->all(FLERR,"Units command after simulation box is defined");
   update->set_units(arg[0]);
 }
diff --git a/src/input.h b/src/input.h
index 1c83a01a51..ca1f0a56b3 100644
--- a/src/input.h
+++ b/src/input.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/integrate.cpp b/src/integrate.cpp
index beef03c302..0a10ef22d2 100644
--- a/src/integrate.cpp
+++ b/src/integrate.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/integrate.h b/src/integrate.h
index bc5a43fd9e..5b58185946 100644
--- a/src/integrate.h
+++ b/src/integrate.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/irregular.cpp b/src/irregular.cpp
index f02c401acb..5e28aa554d 100644
--- a/src/irregular.cpp
+++ b/src/irregular.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -121,16 +121,16 @@ void Irregular::migrate_atoms()
   int i = 0;
   while (i < nlocal) {
     if (x[i][0] < sublo[0] || x[i][0] >= subhi[0] ||
-	x[i][1] < sublo[1] || x[i][1] >= subhi[1] ||
-	x[i][2] < sublo[2] || x[i][2] >= subhi[2]) {
+        x[i][1] < sublo[1] || x[i][1] >= subhi[1] ||
+        x[i][2] < sublo[2] || x[i][2] >= subhi[2]) {
       proclist[nsendatom] = coord2proc(x[i]);
       if (proclist[nsendatom] != me) {
-	if (nsend > maxsend) grow_send(nsend,1);
-	sizes[nsendatom] = avec->pack_exchange(i,&buf_send[nsend]);
-	nsend += sizes[nsendatom];
-	nsendatom++;
-	avec->copy(nlocal-1,i,1);
-	nlocal--;
+        if (nsend > maxsend) grow_send(nsend,1);
+        sizes[nsendatom] = avec->pack_exchange(i,&buf_send[nsend]);
+        nsend += sizes[nsendatom];
+        nsendatom++;
+        avec->copy(nlocal-1,i,1);
+        nlocal--;
       } else i++;
     } else i++;
   }
@@ -285,7 +285,7 @@ int Irregular::create_atom(int n, int *sizes, int *proclist)
 
   delete [] count;
   delete [] list;
-    
+
   // initialize plan
 
   aplan->nsend = nsend;
@@ -322,7 +322,7 @@ void Irregular::exchange_atom(double *sendbuf, int *sizes, double *recvbuf)
   offset = 0;
   for (int irecv = 0; irecv < aplan->nrecv; irecv++) {
     MPI_Irecv(&recvbuf[offset],aplan->length_recv[irecv],MPI_DOUBLE,
-	      aplan->proc_recv[irecv],0,world,&aplan->request[irecv]);
+              aplan->proc_recv[irecv],0,world,&aplan->request[irecv]);
     offset += aplan->length_recv[irecv];
   }
 
@@ -345,12 +345,12 @@ void Irregular::exchange_atom(double *sendbuf, int *sizes, double *recvbuf)
     for (i = 0; i < num_send; i++) {
       m = index_send[n++];
       memcpy(&buf[offset],&sendbuf[aplan->offset_send[m]],
-	     sizes[m]*sizeof(double));
+             sizes[m]*sizeof(double));
       offset += sizes[m];
     }
     MPI_Send(buf,aplan->length_send[isend],MPI_DOUBLE,
-	     aplan->proc_send[isend],0,world);
-  }       
+             aplan->proc_send[isend],0,world);
+  }
 
   // free temporary send buffer
 
@@ -507,7 +507,7 @@ int Irregular::create_data(int n, int *proclist)
 
   delete [] count;
   delete [] list;
-    
+
   // initialize plan and return it
 
   dplan->nsend = nsend;
@@ -544,7 +544,7 @@ void Irregular::exchange_data(char *sendbuf, int nbytes, char *recvbuf)
   offset = dplan->num_self*nbytes;
   for (int irecv = 0; irecv < dplan->nrecv; irecv++) {
     MPI_Irecv(&recvbuf[offset],dplan->num_recv[irecv]*nbytes,MPI_CHAR,
-	      dplan->proc_recv[irecv],0,world,&dplan->request[irecv]);
+              dplan->proc_recv[irecv],0,world,&dplan->request[irecv]);
     offset += dplan->num_recv[irecv]*nbytes;
   }
 
@@ -568,8 +568,8 @@ void Irregular::exchange_data(char *sendbuf, int nbytes, char *recvbuf)
       memcpy(&buf[i*nbytes],&sendbuf[m*nbytes],nbytes);
     }
     MPI_Send(buf,dplan->num_send[isend]*nbytes,MPI_CHAR,
-	     dplan->proc_send[isend],0,world);
-  }       
+             dplan->proc_send[isend],0,world);
+  }
 
   // free temporary send buffer
 
@@ -622,8 +622,8 @@ int Irregular::coord2proc(double *x)
   if (uniform) {
     if (triclinic == 0) {
       loc[0] = static_cast<int> (procgrid[0] * (x[0]-boxlo[0]) / prd[0]);
-      loc[1] = static_cast<int>	(procgrid[1] * (x[1]-boxlo[1]) / prd[1]);
-      loc[2] = static_cast<int>	(procgrid[2] * (x[2]-boxlo[2]) / prd[2]);
+      loc[1] = static_cast<int>        (procgrid[1] * (x[1]-boxlo[1]) / prd[1]);
+      loc[2] = static_cast<int>        (procgrid[2] * (x[2]-boxlo[2]) / prd[2]);
     } else {
       loc[0] = static_cast<int> (procgrid[0] * x[0]);
       loc[1] = static_cast<int> (procgrid[1] * x[1]);
@@ -683,7 +683,7 @@ int Irregular::binary(double value, int n, double *vec)
 }
 
 /* ----------------------------------------------------------------------
-   realloc the size of the send buffer as needed with BUFFACTOR & BUFEXTRA 
+   realloc the size of the send buffer as needed with BUFFACTOR & BUFEXTRA
    if flag = 1, realloc
    if flag = 0, don't need to realloc with copy, just free/malloc
 ------------------------------------------------------------------------- */
@@ -700,7 +700,7 @@ void Irregular::grow_send(int n, int flag)
 }
 
 /* ----------------------------------------------------------------------
-   free/malloc the size of the recv buffer as needed with BUFFACTOR 
+   free/malloc the size of the recv buffer as needed with BUFFACTOR
 ------------------------------------------------------------------------- */
 
 void Irregular::grow_recv(int n)
diff --git a/src/irregular.h b/src/irregular.h
index 1b1477872b..c3ebcea6c6 100644
--- a/src/irregular.h
+++ b/src/irregular.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -36,7 +36,7 @@ class Irregular : protected Pointers {
   double *xsplit,*ysplit,*zsplit;   // ptrs to comm
   int *procgrid;                    // ptr to comm
   int ***grid2proc;                 // ptr to comm
-  double *boxlo;                    // ptr to domain 
+  double *boxlo;                    // ptr to domain
   double *prd;                      // ptr to domain
 
   int maxsend,maxrecv;              // size of buffers in # of doubles
diff --git a/src/kspace.cpp b/src/kspace.cpp
index f6ec055520..b0b345bdfc 100644
--- a/src/kspace.cpp
+++ b/src/kspace.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -42,8 +42,8 @@ KSpace::KSpace(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
   suffix_flag = Suffix::NONE;
 
   accuracy_absolute = -1.0;
-  two_charge_force = force->qqr2e * 
-    (force->qelectron * force->qelectron) / 
+  two_charge_force = force->qqr2e *
+    (force->qelectron * force->qelectron) /
     (force->angstrom * force->angstrom);
 
   maxeatom = maxvatom = 0;
@@ -64,8 +64,8 @@ KSpace::~KSpace()
 void KSpace::compute_dummy(int eflag, int vflag)
 {
   if (eflag || vflag) ev_setup(eflag,vflag);
-  else evflag = evflag_atom = eflag_global = vflag_global = 
-	 eflag_atom = vflag_atom = 0;
+  else evflag = evflag_atom = eflag_global = vflag_global =
+         eflag_atom = vflag_atom = 0;
 }
 
 /* ----------------------------------------------------------------------
@@ -86,7 +86,7 @@ void KSpace::ev_setup(int eflag, int vflag)
   vflag_either = vflag;
   vflag_global = vflag % 4;
   vflag_atom = vflag / 4;
-  
+
   if (eflag_atom || vflag_atom) evflag_atom = 1;
   else evflag_atom = 0;
 
@@ -125,7 +125,7 @@ void KSpace::ev_setup(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   modify parameters of the KSpace style 
+   modify parameters of the KSpace style
 ------------------------------------------------------------------------- */
 
 void KSpace::modify_params(int narg, char **arg)
@@ -159,10 +159,10 @@ void KSpace::modify_params(int narg, char **arg)
       slab_volfactor = atof(arg[iarg+1]);
       iarg += 2;
       if (slab_volfactor <= 1.0)
-	error->all(FLERR,"Bad kspace_modify slab parameter");
-      if (slab_volfactor < 2.0 && comm->me == 0) 
-	error->warning(FLERR,"Kspace_modify slab param < 2.0 may "
-		       "cause unphysical behavior");
+        error->all(FLERR,"Bad kspace_modify slab parameter");
+      if (slab_volfactor < 2.0 && comm->me == 0)
+        error->warning(FLERR,"Kspace_modify slab param < 2.0 may "
+                       "cause unphysical behavior");
       slabflag = 1;
     } else if (strcmp(arg[iarg],"compute") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command");
diff --git a/src/kspace.h b/src/kspace.h
index 851cad7dd3..c5ea971d4d 100644
--- a/src/kspace.h
+++ b/src/kspace.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -56,7 +56,7 @@ class KSpace : protected Pointers {
   int suffix_flag;                  // suffix compatibility flag
   double scale;
   double slab_volfactor;
- 
+
   double accuracy;                  // accuracy of KSpace solver (force units)
   double accuracy_absolute;         // user-specifed accuracy in force units
   double accuracy_relative;         // user-specified dimensionless accuracy
diff --git a/src/lammps.cpp b/src/lammps.cpp
index 3b188392c3..1202939a98 100644
--- a/src/lammps.cpp
+++ b/src/lammps.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -78,87 +78,87 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
 
   int iarg = 1;
   while (iarg < narg) {
-    if (strcmp(arg[iarg],"-partition") == 0 || 
-	strcmp(arg[iarg],"-p") == 0) {
+    if (strcmp(arg[iarg],"-partition") == 0 ||
+        strcmp(arg[iarg],"-p") == 0) {
       universe->existflag = 1;
-      if (iarg+2 > narg) 
-	error->universe_all(FLERR,"Invalid command-line argument");
+      if (iarg+2 > narg)
+        error->universe_all(FLERR,"Invalid command-line argument");
       iarg++;
       while (iarg < narg && arg[iarg][0] != '-') {
-	universe->add_world(arg[iarg]);
-	iarg++;
+        universe->add_world(arg[iarg]);
+        iarg++;
       }
-    } else if (strcmp(arg[iarg],"-in") == 0 || 
-	       strcmp(arg[iarg],"-i") == 0) {
-      if (iarg+2 > narg) 
-	error->universe_all(FLERR,"Invalid command-line argument");
+    } else if (strcmp(arg[iarg],"-in") == 0 ||
+               strcmp(arg[iarg],"-i") == 0) {
+      if (iarg+2 > narg)
+        error->universe_all(FLERR,"Invalid command-line argument");
       inflag = iarg + 1;
       iarg += 2;
-    } else if (strcmp(arg[iarg],"-screen") == 0 || 
-	       strcmp(arg[iarg],"-sc") == 0) {
-      if (iarg+2 > narg) 
-	error->universe_all(FLERR,"Invalid command-line argument");
+    } else if (strcmp(arg[iarg],"-screen") == 0 ||
+               strcmp(arg[iarg],"-sc") == 0) {
+      if (iarg+2 > narg)
+        error->universe_all(FLERR,"Invalid command-line argument");
       screenflag = iarg + 1;
       iarg += 2;
-    } else if (strcmp(arg[iarg],"-log") == 0 || 
-	       strcmp(arg[iarg],"-l") == 0) {
-      if (iarg+2 > narg) 
-	error->universe_all(FLERR,"Invalid command-line argument");
+    } else if (strcmp(arg[iarg],"-log") == 0 ||
+               strcmp(arg[iarg],"-l") == 0) {
+      if (iarg+2 > narg)
+        error->universe_all(FLERR,"Invalid command-line argument");
       logflag = iarg + 1;
       iarg += 2;
-    } else if (strcmp(arg[iarg],"-var") == 0 || 
-	       strcmp(arg[iarg],"-v") == 0) {
-      if (iarg+3 > narg) 
-	error->universe_all(FLERR,"Invalid command-line argument");
+    } else if (strcmp(arg[iarg],"-var") == 0 ||
+               strcmp(arg[iarg],"-v") == 0) {
+      if (iarg+3 > narg)
+        error->universe_all(FLERR,"Invalid command-line argument");
       iarg += 3;
       while (iarg < narg && arg[iarg][0] != '-') iarg++;
-    } else if (strcmp(arg[iarg],"-echo") == 0 || 
-	       strcmp(arg[iarg],"-e") == 0) {
-      if (iarg+2 > narg) 
-	error->universe_all(FLERR,"Invalid command-line argument");
+    } else if (strcmp(arg[iarg],"-echo") == 0 ||
+               strcmp(arg[iarg],"-e") == 0) {
+      if (iarg+2 > narg)
+        error->universe_all(FLERR,"Invalid command-line argument");
       iarg += 2;
-    } else if (strcmp(arg[iarg],"-pscreen") == 0 || 
-	       strcmp(arg[iarg],"-ps") == 0) {
-      if (iarg+2 > narg) 
+    } else if (strcmp(arg[iarg],"-pscreen") == 0 ||
+               strcmp(arg[iarg],"-ps") == 0) {
+      if (iarg+2 > narg)
        error->universe_all(FLERR,"Invalid command-line argument");
       partscreenflag = iarg + 1;
       iarg += 2;
-    } else if (strcmp(arg[iarg],"-plog") == 0 || 
-	       strcmp(arg[iarg],"-pl") == 0) {
-      if (iarg+2 > narg) 
+    } else if (strcmp(arg[iarg],"-plog") == 0 ||
+               strcmp(arg[iarg],"-pl") == 0) {
+      if (iarg+2 > narg)
        error->universe_all(FLERR,"Invalid command-line argument");
       partlogflag = iarg + 1;
       iarg += 2;
-    } else if (strcmp(arg[iarg],"-cuda") == 0 || 
-	       strcmp(arg[iarg],"-c") == 0) {
-      if (iarg+2 > narg) 
-	error->universe_all(FLERR,"Invalid command-line argument");
+    } else if (strcmp(arg[iarg],"-cuda") == 0 ||
+               strcmp(arg[iarg],"-c") == 0) {
+      if (iarg+2 > narg)
+        error->universe_all(FLERR,"Invalid command-line argument");
       if (strcmp(arg[iarg+1],"on") == 0) cudaflag = 1;
       else if (strcmp(arg[iarg+1],"off") == 0) cudaflag = 0;
       else error->universe_all(FLERR,"Invalid command-line argument");
       iarg += 2;
-    } else if (strcmp(arg[iarg],"-suffix") == 0 || 
-	       strcmp(arg[iarg],"-sf") == 0) {
-      if (iarg+2 > narg) 
-	error->universe_all(FLERR,"Invalid command-line argument");
+    } else if (strcmp(arg[iarg],"-suffix") == 0 ||
+               strcmp(arg[iarg],"-sf") == 0) {
+      if (iarg+2 > narg)
+        error->universe_all(FLERR,"Invalid command-line argument");
       delete [] suffix;
       int n = strlen(arg[iarg+1]) + 1;
       suffix = new char[n];
       strcpy(suffix,arg[iarg+1]);
       suffix_enable = 1;
       iarg += 2;
-    } else if (strcmp(arg[iarg],"-reorder") == 0 || 
-	       strcmp(arg[iarg],"-r") == 0) {
-      if (iarg+3 > narg) 
-	error->universe_all(FLERR,"Invalid command-line argument");
+    } else if (strcmp(arg[iarg],"-reorder") == 0 ||
+               strcmp(arg[iarg],"-r") == 0) {
+      if (iarg+3 > narg)
+        error->universe_all(FLERR,"Invalid command-line argument");
       if (universe->existflag)
-	error->universe_all(FLERR,"Cannot use -reorder after -partition");
+        error->universe_all(FLERR,"Cannot use -reorder after -partition");
       universe->reorder(arg[iarg+1],arg[iarg+2]);
       iarg += 3;
-    } else if (strcmp(arg[iarg],"-help") == 0 || 
-	       strcmp(arg[iarg],"-h") == 0) {
-      if (iarg+1 > narg) 
-	error->universe_all(FLERR,"Invalid command-line argument");
+    } else if (strcmp(arg[iarg],"-help") == 0 ||
+               strcmp(arg[iarg],"-h") == 0) {
+      if (iarg+1 > narg)
+        error->universe_all(FLERR,"Invalid command-line argument");
       helpflag = 1;
       iarg += 1;
     } else error->universe_all(FLERR,"Invalid command-line argument");
@@ -197,19 +197,19 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
       universe->uscreen = NULL;
     else {
       universe->uscreen = fopen(arg[screenflag],"w");
-      if (universe->uscreen == NULL) 
-	error->universe_one(FLERR,"Cannot open universe screen file");
+      if (universe->uscreen == NULL)
+        error->universe_one(FLERR,"Cannot open universe screen file");
     }
     if (logflag == 0) {
       universe->ulogfile = fopen("log.lammps","w");
-      if (universe->ulogfile == NULL) 
-	error->universe_one(FLERR,"Cannot open log.lammps");
+      if (universe->ulogfile == NULL)
+        error->universe_one(FLERR,"Cannot open log.lammps");
     } else if (strcmp(arg[logflag],"none") == 0)
       universe->ulogfile = NULL;
     else {
       universe->ulogfile = fopen(arg[logflag],"w");
-      if (universe->ulogfile == NULL) 
-	error->universe_one(FLERR,"Cannot open universe log file");
+      if (universe->ulogfile == NULL)
+        error->universe_one(FLERR,"Cannot open universe log file");
     }
   }
 
@@ -234,9 +234,9 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
       if (inflag == 0) infile = stdin;
       else infile = fopen(arg[inflag],"r");
       if (infile == NULL) {
-	char str[128];
-	sprintf(str,"Cannot open input script %s",arg[inflag]);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,"Cannot open input script %s",arg[inflag]);
+        error->one(FLERR,str);
       }
     }
 
@@ -271,14 +271,14 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
          if (screen == NULL) error->one(FLERR,"Cannot open screen file");
        }
       else if (strcmp(arg[partscreenflag],"none") == 0)
-	screen = NULL;
+        screen = NULL;
       else {
-	char str[128];
-	sprintf(str,"%s.%d",arg[partscreenflag],universe->iworld);
-	screen = fopen(str,"w");
-	if (screen == NULL) error->one(FLERR,"Cannot open screen file");
+        char str[128];
+        sprintf(str,"%s.%d",arg[partscreenflag],universe->iworld);
+        screen = fopen(str,"w");
+        if (screen == NULL) error->one(FLERR,"Cannot open screen file");
       } else screen = NULL;
-    
+
     if (me == 0)
       if (partlogflag == 0)
        if (logflag == 0) {
@@ -295,46 +295,46 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
          if (logfile == NULL) error->one(FLERR,"Cannot open logfile");
        }
       else if (strcmp(arg[partlogflag],"none") == 0)
-	logfile = NULL;
+        logfile = NULL;
       else {
-	char str[128];
-	sprintf(str,"%s.%d",arg[partlogflag],universe->iworld);
-	logfile = fopen(str,"w");
-	if (logfile == NULL) error->one(FLERR,"Cannot open logfile");
+        char str[128];
+        sprintf(str,"%s.%d",arg[partlogflag],universe->iworld);
+        logfile = fopen(str,"w");
+        if (logfile == NULL) error->one(FLERR,"Cannot open logfile");
       } else logfile = NULL;
-    
+
     if (me == 0) {
       infile = fopen(arg[inflag],"r");
       if (infile == NULL) {
-	char str[128];
-	sprintf(str,"Cannot open input script %s",arg[inflag]);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,"Cannot open input script %s",arg[inflag]);
+        error->one(FLERR,str);
       }
     } else infile = NULL;
-    
+
     // screen and logfile messages for universe and world
-    
+
     if (universe->me == 0) {
       if (universe->uscreen) {
-	fprintf(universe->uscreen,"LAMMPS (%s)\n",universe->version);
-	fprintf(universe->uscreen,"Running on %d partitions of processors\n",
-		universe->nworlds);
+        fprintf(universe->uscreen,"LAMMPS (%s)\n",universe->version);
+        fprintf(universe->uscreen,"Running on %d partitions of processors\n",
+                universe->nworlds);
       }
       if (universe->ulogfile) {
-	fprintf(universe->ulogfile,"LAMMPS (%s)\n",universe->version);
-	fprintf(universe->ulogfile,"Running on %d partitions of processors\n",
-		universe->nworlds);
+        fprintf(universe->ulogfile,"LAMMPS (%s)\n",universe->version);
+        fprintf(universe->ulogfile,"Running on %d partitions of processors\n",
+                universe->nworlds);
       }
     }
-    
+
     if (me == 0) {
       if (screen) {
-	fprintf(screen,"LAMMPS (%s)\n",universe->version);
-	fprintf(screen,"Processor partition = %d\n",universe->iworld);
+        fprintf(screen,"LAMMPS (%s)\n",universe->version);
+        fprintf(screen,"Processor partition = %d\n",universe->iworld);
       }
       if (logfile) {
-	fprintf(logfile,"LAMMPS (%s)\n",universe->version);
-	fprintf(logfile,"Processor partition = %d\n",universe->iworld);
+        fprintf(logfile,"LAMMPS (%s)\n",universe->version);
+        fprintf(logfile,"Processor partition = %d\n",universe->iworld);
       }
     }
   }
@@ -352,11 +352,11 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
   MPI_Type_size(MPI_LMP_TAGINT,&mpisize);
   if (mpisize != sizeof(tagint))
       error->all(FLERR,
-		 "MPI_LMP_TAGINT and tagint in lmptype.h are not compatible");
+                 "MPI_LMP_TAGINT and tagint in lmptype.h are not compatible");
   MPI_Type_size(MPI_LMP_BIGINT,&mpisize);
   if (mpisize != sizeof(bigint))
       error->all(FLERR,
-		 "MPI_LMP_BIGINT and bigint in lmptype.h are not compatible");
+                 "MPI_LMP_BIGINT and bigint in lmptype.h are not compatible");
 
 #ifdef LAMMPS_SMALLBIG
   if (sizeof(smallint) != 4 || sizeof(tagint) != 4 || sizeof(bigint) != 8)
@@ -371,7 +371,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
     error->all(FLERR,"Small, tag, big integers are not sized correctly");
 #endif
 
-  if (sizeof(tagint) == 8) 
+  if (sizeof(tagint) == 8)
     error->all(FLERR,"64-bit atom IDs are not yet supported");
 
   // create CUDA class if USER-CUDA installed, unless explicitly switched off
@@ -390,7 +390,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
       cuda = NULL;
     }
   }
-  
+
   int me;
   MPI_Comm_rank(world,&me);
   if (cuda && me == 0) error->message(FLERR,"USER-CUDA mode is enabled");
@@ -496,7 +496,7 @@ void LAMMPS::post_create()
 void LAMMPS::init()
 {
   if (cuda) cuda->accelerator(0,NULL);
- 
+
   update->init();
   force->init();         // pair must come after update due to minimizer
   domain->init();
diff --git a/src/lammps.h b/src/lammps.h
index cfc00edb4b..9809dc508e 100644
--- a/src/lammps.h
+++ b/src/lammps.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/lattice.cpp b/src/lattice.cpp
index 9157dfa273..5b8a5aed34 100644
--- a/src/lattice.cpp
+++ b/src/lattice.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -61,7 +61,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
   int dimension = domain->dimension;
   if (dimension == 2) {
     if (style == SC || style == BCC || style == FCC || style == HCP ||
-	style == DIAMOND)
+        style == DIAMOND)
       error->all(FLERR,"Lattice style incompatible with simulation dimension");
   }
   if (dimension == 3) {
@@ -143,9 +143,9 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
       origin[1] = atof(arg[iarg+2]);
       origin[2] = atof(arg[iarg+3]);
       if (origin[0] < 0.0 || origin[0] >= 1.0 ||
-	  origin[1] < 0.0 || origin[1] >= 1.0 ||
-	  origin[2] < 0.0 || origin[2] >= 1.0)
-	error->all(FLERR,"Illegal lattice command");
+          origin[1] < 0.0 || origin[1] >= 1.0 ||
+          origin[2] < 0.0 || origin[2] >= 1.0)
+        error->all(FLERR,"Illegal lattice command");
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"orient") == 0) {
@@ -174,27 +174,27 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
 
     } else if (strcmp(arg[iarg],"a1") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command");
-      if (style != CUSTOM) 
-	error->all(FLERR,
-		   "Invalid option in lattice command for non-custom style");
+      if (style != CUSTOM)
+        error->all(FLERR,
+                   "Invalid option in lattice command for non-custom style");
       a1[0] = atof(arg[iarg+1]);
       a1[1] = atof(arg[iarg+2]);
       a1[2] = atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"a2") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command");
-      if (style != CUSTOM) 
-	error->all(FLERR,
-		   "Invalid option in lattice command for non-custom style");
+      if (style != CUSTOM)
+        error->all(FLERR,
+                   "Invalid option in lattice command for non-custom style");
       a2[0] = atof(arg[iarg+1]);
       a2[1] = atof(arg[iarg+2]);
       a2[2] = atof(arg[iarg+3]);
       iarg += 4;
     } else if (strcmp(arg[iarg],"a3") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command");
-      if (style != CUSTOM) 
-	error->all(FLERR,
-		   "Invalid option in lattice command for non-custom style");
+      if (style != CUSTOM)
+        error->all(FLERR,
+                   "Invalid option in lattice command for non-custom style");
       a3[0] = atof(arg[iarg+1]);
       a3[1] = atof(arg[iarg+2]);
       a3[2] = atof(arg[iarg+3]);
@@ -202,14 +202,14 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
 
     } else if (strcmp(arg[iarg],"basis") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command");
-      if (style != CUSTOM) 
-	error->all(FLERR,
-		   "Invalid option in lattice command for non-custom style");
+      if (style != CUSTOM)
+        error->all(FLERR,
+                   "Invalid option in lattice command for non-custom style");
       double x = atof(arg[iarg+1]);
       double y = atof(arg[iarg+2]);
       double z = atof(arg[iarg+3]);
       if (x < 0.0 || x >= 1.0 || y < 0.0 || y >= 1.0 || z < 0.0 || z >= 1.0)
-	error->all(FLERR,"Illegal lattice command");
+        error->all(FLERR,"Illegal lattice command");
       add_basis(x,y,z);
       iarg += 4;
     } else error->all(FLERR,"Illegal lattice command");
@@ -228,14 +228,14 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
   if (dimension == 2) {
     if (origin[2] != 0.0)
       error->all(FLERR,
-		 "Lattice settings are not compatible with 2d simulation");
-    if (orientx[2] != 0 || orienty[2] != 0 || 
-	orientz[0] != 0 || orientz[1] != 0)
+                 "Lattice settings are not compatible with 2d simulation");
+    if (orientx[2] != 0 || orienty[2] != 0 ||
+        orientz[0] != 0 || orientz[1] != 0)
       error->all(FLERR,
-		 "Lattice settings are not compatible with 2d simulation");
+                 "Lattice settings are not compatible with 2d simulation");
     if (a1[2] != 0.0 || a2[2] != 0.0 || a3[0] != 0.0 || a3[1] != 0.0)
       error->all(FLERR,
-		 "Lattice settings are not compatible with 2d simulation");
+                 "Lattice settings are not compatible with 2d simulation");
   }
 
   if (spaceflag) {
@@ -293,10 +293,10 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
   if (comm->me == 0) {
     if (screen)
       fprintf(screen,"Lattice spacing in x,y,z = %g %g %g\n",
-	      xlattice,ylattice,zlattice);
+              xlattice,ylattice,zlattice);
     if (logfile)
       fprintf(logfile,"Lattice spacing in x,y,z = %g %g %g\n",
-	      xlattice,ylattice,zlattice);
+              xlattice,ylattice,zlattice);
   }
 }
 
@@ -308,23 +308,23 @@ Lattice::~Lattice()
 }
 
 /* ----------------------------------------------------------------------
-   check if 3 orientation vectors are mutually orthogonal 
+   check if 3 orientation vectors are mutually orthogonal
 ------------------------------------------------------------------------- */
 
 int Lattice::orthogonal()
 {
-  if (orientx[0]*orienty[0] + orientx[1]*orienty[1] + 
+  if (orientx[0]*orienty[0] + orientx[1]*orienty[1] +
       orientx[2]*orienty[2]) return 0;
-  if (orienty[0]*orientz[0] + orienty[1]*orientz[1] + 
+  if (orienty[0]*orientz[0] + orienty[1]*orientz[1] +
       orienty[2]*orientz[2]) return 0;
-  if (orientx[0]*orientz[0] + orientx[1]*orientz[1] + 
+  if (orientx[0]*orientz[0] + orientx[1]*orientz[1] +
       orientx[2]*orientz[2]) return 0;
   return 1;
 }
 
 /* ----------------------------------------------------------------------
    check righthandedness of orientation vectors
-   x cross y must be in same direction as z 
+   x cross y must be in same direction as z
 ------------------------------------------------------------------------- */
 
 int Lattice::right_handed()
@@ -381,29 +381,29 @@ void Lattice::setup_transform()
     primitive[0][1]*primitive[1][0]*primitive[2][2] -
     primitive[0][2]*primitive[1][1]*primitive[2][0];
 
-  if (determinant == 0.0) 
+  if (determinant == 0.0)
     error->all(FLERR,"Degenerate lattice primitive vectors");
 
-  priminv[0][0] = (primitive[1][1]*primitive[2][2] - 
-		   primitive[1][2]*primitive[2][1]) / determinant;
-  priminv[1][0] = (primitive[1][2]*primitive[2][0] - 
-		   primitive[1][0]*primitive[2][2]) / determinant;
-  priminv[2][0] = (primitive[1][0]*primitive[2][1] - 
-		   primitive[1][1]*primitive[2][0]) / determinant;
-
-  priminv[0][1] = (primitive[0][2]*primitive[2][1] - 
-		   primitive[0][1]*primitive[2][2]) / determinant;
-  priminv[1][1] = (primitive[0][0]*primitive[2][2] - 
-		   primitive[0][2]*primitive[2][0]) / determinant;
-  priminv[2][1] = (primitive[0][1]*primitive[2][0] - 
-		   primitive[0][0]*primitive[2][1]) / determinant;
-
-  priminv[0][2] = (primitive[0][1]*primitive[1][2] - 
-		   primitive[0][2]*primitive[1][1]) / determinant;
-  priminv[1][2] = (primitive[0][2]*primitive[1][0] - 
-		   primitive[0][0]*primitive[1][2]) / determinant;
-  priminv[2][2] = (primitive[0][0]*primitive[1][1] - 
-		   primitive[0][1]*primitive[1][0]) / determinant;
+  priminv[0][0] = (primitive[1][1]*primitive[2][2] -
+                   primitive[1][2]*primitive[2][1]) / determinant;
+  priminv[1][0] = (primitive[1][2]*primitive[2][0] -
+                   primitive[1][0]*primitive[2][2]) / determinant;
+  priminv[2][0] = (primitive[1][0]*primitive[2][1] -
+                   primitive[1][1]*primitive[2][0]) / determinant;
+
+  priminv[0][1] = (primitive[0][2]*primitive[2][1] -
+                   primitive[0][1]*primitive[2][2]) / determinant;
+  priminv[1][1] = (primitive[0][0]*primitive[2][2] -
+                   primitive[0][2]*primitive[2][0]) / determinant;
+  priminv[2][1] = (primitive[0][1]*primitive[2][0] -
+                   primitive[0][0]*primitive[2][1]) / determinant;
+
+  priminv[0][2] = (primitive[0][1]*primitive[1][2] -
+                   primitive[0][2]*primitive[1][1]) / determinant;
+  priminv[1][2] = (primitive[0][2]*primitive[1][0] -
+                   primitive[0][0]*primitive[1][2]) / determinant;
+  priminv[2][2] = (primitive[0][0]*primitive[1][1] -
+                   primitive[0][1]*primitive[1][0]) / determinant;
 
   // rotaterow = 3x3 matrix with normalized orient vectors as rows
 
@@ -420,11 +420,11 @@ void Lattice::setup_transform()
     orienty[2]*orienty[2];
   length = sqrt((double) lensq);
   if (length == 0.0) error->all(FLERR,"Zero-length lattice orient vector");
-  
+
   rotaterow[1][0] = orienty[0] / length;
   rotaterow[1][1] = orienty[1] / length;
   rotaterow[1][2] = orienty[2] / length;
-  
+
   lensq = orientz[0]*orientz[0] + orientz[1]*orientz[1] +
     orientz[2]*orientz[2];
   length = sqrt((double) lensq);
@@ -549,12 +549,12 @@ void Lattice::cross(double *x, double *y, double *z)
 
 /* ----------------------------------------------------------------------
    convert x,y,z from lattice coords to box coords (flag = 0) or vice versa
-   use new point to expand bounding box (min to max) 
+   use new point to expand bounding box (min to max)
 ------------------------------------------------------------------------- */
 
 void Lattice::bbox(int flag, double x, double y, double z,
-		   double &xmin, double &ymin, double &zmin,
-		   double &xmax, double &ymax, double &zmax)
+                   double &xmin, double &ymin, double &zmin,
+                   double &xmax, double &ymax, double &zmax)
 {
   if (flag == 0) lattice2box(x,y,z);
   else box2lattice(x,y,z);
diff --git a/src/lattice.h b/src/lattice.h
index a293d835a0..d1ba972fcd 100644
--- a/src/lattice.h
+++ b/src/lattice.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -32,7 +32,7 @@ class Lattice : protected Pointers {
   void lattice2box(double &, double &, double &);
   void box2lattice(double &, double &, double &);
   void bbox(int, double, double, double,
-	    double &, double &, double &, double &, double &, double &);
+            double &, double &, double &, double &, double &, double &);
 
 private:
   double scale;
diff --git a/src/library.cpp b/src/library.cpp
index fd58515d29..6a861a60aa 100644
--- a/src/library.cpp
+++ b/src/library.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -177,19 +177,19 @@ void *lammps_extract_compute(void *ptr, char *id, int style, int type)
     if (type == 0) {
       if (!compute->scalar_flag) return NULL;
       if (compute->invoked_scalar != lmp->update->ntimestep)
-	compute->compute_scalar();
+        compute->compute_scalar();
       return (void *) &compute->scalar;
     }
     if (type == 1) {
       if (!compute->vector_flag) return NULL;
       if (compute->invoked_vector != lmp->update->ntimestep)
-	compute->compute_vector();
+        compute->compute_vector();
       return (void *) compute->vector;
     }
     if (type == 2) {
       if (!compute->array_flag) return NULL;
       if (compute->invoked_array != lmp->update->ntimestep)
-	compute->compute_array();
+        compute->compute_array();
       return (void *) compute->array;
     }
   }
@@ -198,12 +198,12 @@ void *lammps_extract_compute(void *ptr, char *id, int style, int type)
     if (!compute->peratom_flag) return NULL;
     if (type == 1) {
       if (compute->invoked_peratom != lmp->update->ntimestep)
-	compute->compute_peratom();
+        compute->compute_peratom();
       return (void *) compute->vector_atom;
     }
     if (type == 2) {
       if (compute->invoked_peratom != lmp->update->ntimestep)
-	compute->compute_peratom();
+        compute->compute_peratom();
       return (void *) compute->array_atom;
     }
   }
@@ -212,12 +212,12 @@ void *lammps_extract_compute(void *ptr, char *id, int style, int type)
     if (!compute->local_flag) return NULL;
     if (type == 1) {
       if (compute->invoked_local != lmp->update->ntimestep)
-	compute->compute_local();
+        compute->compute_local();
       return (void *) compute->vector_local;
     }
     if (type == 2) {
       if (compute->invoked_local != lmp->update->ntimestep)
-	compute->compute_local();
+        compute->compute_local();
       return (void *) compute->array_local;
     }
   }
@@ -234,7 +234,7 @@ void *lammps_extract_compute(void *ptr, char *id, int style, int type)
    for global data, returns a pointer to a memory location
      which is allocated by this function
      which the caller can cast to a (double *) which points to the value
-   for per-atom or local data, returns a pointer to the 
+   for per-atom or local data, returns a pointer to the
      fix's internal data structure for the entity
      which the caller can cast to the proper data type
    returns a NULL if id is not recognized or style/type not supported
@@ -249,7 +249,7 @@ void *lammps_extract_compute(void *ptr, char *id, int style, int type)
 ------------------------------------------------------------------------- */
 
 void *lammps_extract_fix(void *ptr, char *id, int style, int type,
-			 int i, int j)
+                         int i, int j)
 {
   LAMMPS *lmp = (LAMMPS *) ptr;
 
@@ -298,7 +298,7 @@ void *lammps_extract_fix(void *ptr, char *id, int style, int type,
    for equal-style variable, returns a pointer to a memory location
      which is allocated by this function
      which the caller can cast to a (double *) which points to the value
-   for atom-style variable, returns a pointer to the 
+   for atom-style variable, returns a pointer to the
      vector of per-atom values on each processor,
      which the caller can cast to the proper data type
    returns a NULL if name is not recognized or not equal-style or atom-style
diff --git a/src/library.h b/src/library.h
index 213a004c25..86882bda75 100644
--- a/src/library.h
+++ b/src/library.h
@@ -5,13 +5,13 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
-/* 
+/*
    C or Fortran style library interface to LAMMPS
    new LAMMPS-specific functions can be added
 */
diff --git a/src/lmptype.h b/src/lmptype.h
index 3e015a9aa8..5eca877ec9 100644
--- a/src/lmptype.h
+++ b/src/lmptype.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/lmpwindows.h b/src/lmpwindows.h
index 8cecf8a7e3..e4431547de 100644
--- a/src/lmpwindows.h
+++ b/src/lmpwindows.h
@@ -17,7 +17,7 @@
 #define pclose _pclose
 #define __restrict__ __restrict
 
-// the following functions ared defined to get rid of 
+// the following functions ared defined to get rid of
 // 'ambiguous call to overloaded function' error in VSS for mismathched type arguments
 
 #if defined(__MINGW32_VERSION)
diff --git a/src/main.cpp b/src/main.cpp
index 13b391e121..471be9aa46 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/math_const.h b/src/math_const.h
index 2d1cb3819f..89437510e3 100644
--- a/src/math_const.h
+++ b/src/math_const.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/math_extra.cpp b/src/math_extra.cpp
index 32acc8ed08..1c9ff749e1 100644
--- a/src/math_extra.cpp
+++ b/src/math_extra.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -79,7 +79,7 @@ int mldivide3(const double m[3][3], const double *v, double *ans)
   }
 
   if (aug[2][2] == 0.0) return 1;
-  
+
   // back substitution
 
   ans[2] = aug[2][3]/aug[2][2];
@@ -102,7 +102,7 @@ int jacobi(double matrix[3][3], double *evalues, double evectors[3][3])
 {
   int i,j,k;
   double tresh,theta,tau,t,sm,s,h,g,c,b[3],z[3];
-  
+
   for (i = 0; i < 3; i++) {
     for (j = 0; j < 3; j++) evectors[i][j] = 0.0;
     evectors[i][i] = 1.0;
@@ -111,48 +111,48 @@ int jacobi(double matrix[3][3], double *evalues, double evectors[3][3])
     b[i] = evalues[i] = matrix[i][i];
     z[i] = 0.0;
   }
-  
+
   for (int iter = 1; iter <= MAXJACOBI; iter++) {
     sm = 0.0;
     for (i = 0; i < 2; i++)
       for (j = i+1; j < 3; j++)
-	sm += fabs(matrix[i][j]);
+        sm += fabs(matrix[i][j]);
     if (sm == 0.0) return 0;
-    
+
     if (iter < 4) tresh = 0.2*sm/(3*3);
     else tresh = 0.0;
-    
+
     for (i = 0; i < 2; i++) {
       for (j = i+1; j < 3; j++) {
-	g = 100.0*fabs(matrix[i][j]);
-	if (iter > 4 && fabs(evalues[i])+g == fabs(evalues[i])
-	    && fabs(evalues[j])+g == fabs(evalues[j]))
-	  matrix[i][j] = 0.0;
-	else if (fabs(matrix[i][j]) > tresh) {
-	  h = evalues[j]-evalues[i];
-	  if (fabs(h)+g == fabs(h)) t = (matrix[i][j])/h;
-	  else {
-	    theta = 0.5*h/(matrix[i][j]);
-	    t = 1.0/(fabs(theta)+sqrt(1.0+theta*theta));
-	    if (theta < 0.0) t = -t;
-	  }
-	  c = 1.0/sqrt(1.0+t*t);
-	  s = t*c;
-	  tau = s/(1.0+c);
-	  h = t*matrix[i][j];
-	  z[i] -= h;
-	  z[j] += h;
-	  evalues[i] -= h;
-	  evalues[j] += h;
-	  matrix[i][j] = 0.0;
-	  for (k = 0; k < i; k++) rotate(matrix,k,i,k,j,s,tau);
-	  for (k = i+1; k < j; k++) rotate(matrix,i,k,k,j,s,tau);
-	  for (k = j+1; k < 3; k++) rotate(matrix,i,k,j,k,s,tau);
-	  for (k = 0; k < 3; k++) rotate(evectors,k,i,k,j,s,tau);
-	}
+        g = 100.0*fabs(matrix[i][j]);
+        if (iter > 4 && fabs(evalues[i])+g == fabs(evalues[i])
+            && fabs(evalues[j])+g == fabs(evalues[j]))
+          matrix[i][j] = 0.0;
+        else if (fabs(matrix[i][j]) > tresh) {
+          h = evalues[j]-evalues[i];
+          if (fabs(h)+g == fabs(h)) t = (matrix[i][j])/h;
+          else {
+            theta = 0.5*h/(matrix[i][j]);
+            t = 1.0/(fabs(theta)+sqrt(1.0+theta*theta));
+            if (theta < 0.0) t = -t;
+          }
+          c = 1.0/sqrt(1.0+t*t);
+          s = t*c;
+          tau = s/(1.0+c);
+          h = t*matrix[i][j];
+          z[i] -= h;
+          z[j] += h;
+          evalues[i] -= h;
+          evalues[j] += h;
+          matrix[i][j] = 0.0;
+          for (k = 0; k < i; k++) rotate(matrix,k,i,k,j,s,tau);
+          for (k = i+1; k < j; k++) rotate(matrix,i,k,k,j,s,tau);
+          for (k = j+1; k < 3; k++) rotate(matrix,i,k,j,k,s,tau);
+          for (k = 0; k < 3; k++) rotate(evectors,k,i,k,j,s,tau);
+        }
       }
     }
-    
+
     for (i = 0; i < 3; i++) {
       evalues[i] = b[i] += z[i];
       z[i] = 0.0;
@@ -166,7 +166,7 @@ int jacobi(double matrix[3][3], double *evalues, double evectors[3][3])
 ------------------------------------------------------------------------- */
 
 void rotate(double matrix[3][3], int i, int j, int k, int l,
-	    double s, double tau)
+            double s, double tau)
 {
   double g = matrix[i][j];
   double h = matrix[k][l];
@@ -238,7 +238,7 @@ void richardson(double *q, double *m, double *w, double *moments, double dtq)
 ------------------------------------------------------------------------- */
 
 void angmom_to_omega(double *m, double *ex, double *ey, double *ez,
-		     double *idiag, double *w)
+                     double *idiag, double *w)
 {
   double wbody[3];
 
@@ -288,7 +288,7 @@ void mq_to_omega(double *m, double *q, double *moments, double *w)
 ------------------------------------------------------------------------- */
 
 void omega_to_angmom(double *w, double *ex, double *ey, double *ez,
-		     double *idiag, double *m)
+                     double *idiag, double *m)
 {
   double mbody[3];
 
@@ -309,15 +309,15 @@ void omega_to_angmom(double *w, double *ex, double *ey, double *ez,
 void exyz_to_q(double *ex, double *ey, double *ez, double *q)
 {
   // squares of quaternion components
-  
+
   double q0sq = 0.25 * (ex[0] + ey[1] + ez[2] + 1.0);
   double q1sq = q0sq - 0.5 * (ey[1] + ez[2]);
   double q2sq = q0sq - 0.5 * (ex[0] + ez[2]);
   double q3sq = q0sq - 0.5 * (ex[0] + ey[1]);
-  
+
   // some component must be greater than 1/4 since they sum to 1
   // compute other components from it
-  
+
   if (q0sq >= 0.25) {
     q[0] = sqrt(q0sq);
     q[1] = (ey[2] - ez[1]) / (4.0*q[0]);
@@ -354,11 +354,11 @@ void q_to_exyz(double *q, double *ex, double *ey, double *ez)
   ex[0] = q[0]*q[0] + q[1]*q[1] - q[2]*q[2] - q[3]*q[3];
   ex[1] = 2.0 * (q[1]*q[2] + q[0]*q[3]);
   ex[2] = 2.0 * (q[1]*q[3] - q[0]*q[2]);
-  
+
   ey[0] = 2.0 * (q[1]*q[2] - q[0]*q[3]);
   ey[1] = q[0]*q[0] - q[1]*q[1] + q[2]*q[2] - q[3]*q[3];
   ey[2] = 2.0 * (q[2]*q[3] + q[0]*q[1]);
-  
+
   ez[0] = 2.0 * (q[1]*q[3] + q[0]*q[2]);
   ez[1] = 2.0 * (q[2]*q[3] - q[0]*q[1]);
   ez[2] = q[0]*q[0] - q[1]*q[1] - q[2]*q[2] + q[3]*q[3];
@@ -389,7 +389,7 @@ void quat_to_mat(const double *quat, double mat[3][3])
   mat[1][0] = twoij+twokw;
   mat[1][1] = w2-i2+j2-k2;
   mat[1][2] = twojk-twoiw;
-	
+
   mat[2][0] = twoik-twojw;
   mat[2][1] = twojk+twoiw;
   mat[2][2] = w2-i2-j2+k2;
@@ -420,7 +420,7 @@ void quat_to_mat_trans(const double *quat, double mat[3][3])
   mat[0][1] = twoij+twokw;
   mat[1][1] = w2-i2+j2-k2;
   mat[2][1] = twojk-twoiw;
-	
+
   mat[0][2] = twoik-twojw;
   mat[1][2] = twojk+twoiw;
   mat[2][2] = w2-i2-j2+k2;
@@ -434,7 +434,7 @@ void quat_to_mat_trans(const double *quat, double mat[3][3])
 ------------------------------------------------------------------------- */
 
 void inertia_ellipsoid(double *radii, double *quat, double mass,
-		       double *inertia)
+                       double *inertia)
 {
   double p[3][3],ptrans[3][3],itemp[3][3],tensor[3][3];
   double idiag[3];
@@ -500,7 +500,7 @@ void inertia_line(double length, double theta, double mass, double *inertia)
 ------------------------------------------------------------------------- */
 
 void inertia_triangle(double *v0, double *v1, double *v2,
-		      double mass, double *inertia)
+                      double mass, double *inertia)
 {
   double s[3][3] = {{2.0, 1.0, 1.0}, {1.0, 2.0, 1.0}, {1.0, 1.0, 2.0}};
   double v[3][3],sv[3][3],vtsv[3][3];
@@ -541,7 +541,7 @@ void inertia_triangle(double *v0, double *v1, double *v2,
 ------------------------------------------------------------------------- */
 
 void inertia_triangle(double *idiag, double *quat, double mass,
-		      double *inertia)
+                      double *inertia)
 {
   double p[3][3],ptrans[3][3],itemp[3][3],tensor[3][3];
 
diff --git a/src/math_extra.h b/src/math_extra.h
index c161b40f15..515e55f5f8 100755
--- a/src/math_extra.h
+++ b/src/math_extra.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -48,31 +48,31 @@ namespace MathExtra {
                     double ans[3][3]);
   inline void times3(const double m[3][3], const double m2[3][3],
                      double ans[3][3]);
-  inline void transpose_times3(const double mat1[3][3], 
+  inline void transpose_times3(const double mat1[3][3],
+                               const double mat2[3][3],
+                               double ans[3][3]);
+  inline void times3_transpose(const double mat1[3][3],
                                const double mat2[3][3],
                                double ans[3][3]);
-  inline void times3_transpose(const double mat1[3][3], 
-			       const double mat2[3][3],
-			       double ans[3][3]);
   inline void invert3(const double mat[3][3], double ans[3][3]);
   inline void matvec(const double mat[3][3], const double*vec, double *ans);
   inline void matvec(const double *ex, const double *ey, const double *ez,
-		     const double *vec, double *ans);
+                     const double *vec, double *ans);
   inline void transpose_matvec(const double mat[3][3], const double*vec,
-			       double *ans);
-  inline void transpose_matvec(const double *ex, const double *ey, 
-			       const double *ez, const double *v,
-			       double *ans);
+                               double *ans);
+  inline void transpose_matvec(const double *ex, const double *ey,
+                               const double *ez, const double *v,
+                               double *ans);
   inline void transpose_diag3(const double mat[3][3], const double*vec,
-			      double ans[3][3]);
+                              double ans[3][3]);
   inline void vecmat(const double *v, const double m[3][3], double *ans);
-  inline void scalar_times3(const double f, double m[3][3]); 
+  inline void scalar_times3(const double f, double m[3][3]);
 
   void write3(const double mat[3][3]);
   int mldivide3(const double mat[3][3], const double *vec, double *ans);
   int jacobi(double matrix[3][3], double *evalues, double evectors[3][3]);
   void rotate(double matrix[3][3], int i, int j, int k, int l,
-	      double s, double tau);
+              double s, double tau);
   void richardson(double *q, double *m, double *w, double *moments, double dtq);
 
   // shape matrix operations
@@ -93,9 +93,9 @@ namespace MathExtra {
                                 double *quat);
 
   void angmom_to_omega(double *m, double *ex, double *ey, double *ez,
-		       double *idiag, double *w);
+                       double *idiag, double *w);
   void omega_to_angmom(double *w, double *ex, double *ey, double *ez,
-		       double *idiag, double *m);
+                       double *idiag, double *m);
   void mq_to_omega(double *m, double *q, double *moments, double *w);
   void exyz_to_q(double *ex, double *ey, double *ez, double *q);
   void q_to_exyz(double *q, double *ex, double *ey, double *ez);
@@ -103,7 +103,7 @@ namespace MathExtra {
   void quat_to_mat_trans(const double *quat, double mat[3][3]);
 
   // rotation operations
-  
+
   inline void rotation_generator_x(const double m[3][3], double ans[3][3]);
   inline void rotation_generator_y(const double m[3][3], double ans[3][3]);
   inline void rotation_generator_z(const double m[3][3], double ans[3][3]);
@@ -111,13 +111,13 @@ namespace MathExtra {
   // moment of inertia operations
 
   void inertia_ellipsoid(double *shape, double *quat, double mass,
-			 double *inertia);
+                         double *inertia);
   void inertia_line(double length, double theta, double mass,
-		    double *inertia);
-  void inertia_triangle(double *v0, double *v1, double *v2, 
-			double mass, double *inertia);
-  void inertia_triangle(double *idiag, double *quat, double mass, 
-			double *inertia); 
+                    double *inertia);
+  void inertia_triangle(double *v0, double *v1, double *v2,
+                        double mass, double *inertia);
+  void inertia_triangle(double *idiag, double *quat, double mass,
+                        double *inertia);
 }
 
 /* ----------------------------------------------------------------------
@@ -244,8 +244,8 @@ void MathExtra::cross3(const double *v1, const double *v2, double *ans)
 
 double MathExtra::det3(const double m[3][3])
 {
-  double ans = m[0][0]*m[1][1]*m[2][2] - m[0][0]*m[1][2]*m[2][1] - 
-    m[1][0]*m[0][1]*m[2][2] + m[1][0]*m[0][2]*m[2][1] + 
+  double ans = m[0][0]*m[1][1]*m[2][2] - m[0][0]*m[1][2]*m[2][1] -
+    m[1][0]*m[0][1]*m[2][2] + m[1][0]*m[0][2]*m[2][1] +
     m[2][0]*m[0][1]*m[1][2] - m[2][0]*m[0][2]*m[1][1];
   return ans;
 }
@@ -255,7 +255,7 @@ double MathExtra::det3(const double m[3][3])
 ------------------------------------------------------------------------- */
 
 void MathExtra::diag_times3(const double *d, const double m[3][3],
-			    double ans[3][3])
+                            double ans[3][3])
 {
   ans[0][0] = d[0]*m[0][0];
   ans[0][1] = d[0]*m[0][1];
@@ -273,7 +273,7 @@ void MathExtra::diag_times3(const double *d, const double m[3][3],
 ------------------------------------------------------------------------- */
 
 void MathExtra::plus3(const double m[3][3], const double m2[3][3],
-		      double ans[3][3])
+                      double ans[3][3])
 {
   ans[0][0] = m[0][0]+m2[0][0];
   ans[0][1] = m[0][1]+m2[0][1];
@@ -366,7 +366,7 @@ void MathExtra::invert3(const double m[3][3], double ans[3][3])
    matrix times vector
 ------------------------------------------------------------------------- */
 
-void MathExtra::matvec(const double m[3][3], const double *v, double *ans) 
+void MathExtra::matvec(const double m[3][3], const double *v, double *ans)
 {
   ans[0] = m[0][0]*v[0] + m[0][1]*v[1] + m[0][2]*v[2];
   ans[1] = m[1][0]*v[0] + m[1][1]*v[1] + m[1][2]*v[2];
@@ -378,7 +378,7 @@ void MathExtra::matvec(const double m[3][3], const double *v, double *ans)
 ------------------------------------------------------------------------- */
 
 void MathExtra::matvec(const double *ex, const double *ey, const double *ez,
-		       const double *v, double *ans) 
+                       const double *v, double *ans)
 {
   ans[0] = ex[0]*v[0] + ey[0]*v[1] + ez[0]*v[2];
   ans[1] = ex[1]*v[0] + ey[1]*v[1] + ez[1]*v[2];
@@ -390,7 +390,7 @@ void MathExtra::matvec(const double *ex, const double *ey, const double *ez,
 ------------------------------------------------------------------------- */
 
 void MathExtra::transpose_matvec(const double m[3][3], const double *v,
-				 double *ans)
+                                 double *ans)
 {
   ans[0] = m[0][0]*v[0] + m[1][0]*v[1] + m[2][0]*v[2];
   ans[1] = m[0][1]*v[0] + m[1][1]*v[1] + m[2][1]*v[2];
@@ -401,9 +401,9 @@ void MathExtra::transpose_matvec(const double m[3][3], const double *v,
    transposed matrix times vector
 ------------------------------------------------------------------------- */
 
-void MathExtra::transpose_matvec(const double *ex, const double *ey, 
-				 const double *ez, const double *v,
-				 double *ans)
+void MathExtra::transpose_matvec(const double *ex, const double *ey,
+                                 const double *ez, const double *v,
+                                 double *ans)
 {
   ans[0] = ex[0]*v[0] + ex[1]*v[1] + ex[2]*v[2];
   ans[1] = ey[0]*v[0] + ey[1]*v[1] + ey[2]*v[2];
@@ -414,8 +414,8 @@ void MathExtra::transpose_matvec(const double *ex, const double *ey,
    transposed matrix times diagonal matrix
 ------------------------------------------------------------------------- */
 
-void MathExtra::transpose_diag3(const double m[3][3], const double *d, 
-				double ans[3][3])
+void MathExtra::transpose_diag3(const double m[3][3], const double *d,
+                                double ans[3][3])
 {
   ans[0][0] = m[0][0]*d[0];
   ans[0][1] = m[1][0]*d[1];
@@ -443,7 +443,7 @@ void MathExtra::vecmat(const double *v, const double m[3][3], double *ans)
    matrix times scalar, in place
 ------------------------------------------------------------------------- */
 
-inline void MathExtra::scalar_times3(const double f, double m[3][3]) 
+inline void MathExtra::scalar_times3(const double f, double m[3][3])
 {
   m[0][0] *= f; m[0][1] *= f; m[0][2] *= f;
   m[1][0] *= f; m[1][1] *= f; m[1][2] *= f;
@@ -536,7 +536,7 @@ void MathExtra::quatquat(double *a, double *b, double *c)
 ------------------------------------------------------------------------- */
 
 void MathExtra::invquatvec(double *a, double *b, double *c)
-{ 
+{
   c[0] = -a[1]*b[0] + a[0]*b[1] + a[3]*b[2] - a[2]*b[3];
   c[1] = -a[2]*b[0] - a[3]*b[1] + a[0]*b[2] + a[1]*b[3];
   c[2] = -a[3]*b[0] + a[2]*b[1] - a[1]*b[2] + a[0]*b[3];
@@ -548,7 +548,7 @@ void MathExtra::invquatvec(double *a, double *b, double *c)
 ------------------------------------------------------------------------- */
 
 void MathExtra::axisangle_to_quat(const double *v, const double angle,
-				  double *quat)
+                                  double *quat)
 {
   double halfa = 0.5*angle;
   double sina = sin(halfa);
diff --git a/src/memory.cpp b/src/memory.cpp
index f56b4bdcd3..b8f71016e0 100644
--- a/src/memory.cpp
+++ b/src/memory.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -24,7 +24,7 @@ using namespace LAMMPS_NS;
 Memory::Memory(LAMMPS *lmp) : Pointers(lmp) {}
 
 /* ----------------------------------------------------------------------
-   safe malloc 
+   safe malloc
 ------------------------------------------------------------------------- */
 
 void *Memory::smalloc(bigint nbytes, const char *name)
@@ -41,14 +41,14 @@ void *Memory::smalloc(bigint nbytes, const char *name)
   if (ptr == NULL) {
     char str[128];
     sprintf(str,"Failed to allocate " BIGINT_FORMAT " bytes for array %s",
-	    nbytes,name);
+            nbytes,name);
     error->one(FLERR,str);
   }
   return ptr;
 }
 
 /* ----------------------------------------------------------------------
-   safe realloc 
+   safe realloc
 ------------------------------------------------------------------------- */
 
 void *Memory::srealloc(void *ptr, bigint nbytes, const char *name)
@@ -62,14 +62,14 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name)
   if (ptr == NULL) {
     char str[128];
     sprintf(str,"Failed to reallocate " BIGINT_FORMAT " bytes for array %s",
-	    nbytes,name);
+            nbytes,name);
     error->one(FLERR,str);
   }
   return ptr;
 }
 
 /* ----------------------------------------------------------------------
-   safe free 
+   safe free
 ------------------------------------------------------------------------- */
 
 void Memory::sfree(void *ptr)
diff --git a/src/memory.h b/src/memory.h
index aa1ec6e197..4a89a9cefa 100644
--- a/src/memory.h
+++ b/src/memory.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -31,13 +31,13 @@ class Memory : protected Pointers {
 /* ----------------------------------------------------------------------
    create/grow/destroy vecs and multidim arrays with contiguous memory blocks
    only use with primitive data types, e.g. 1d vec of ints, 2d array of doubles
-   cannot use with pointers, e.g. 1d vec of int*, due to mismatched destroy 
+   cannot use with pointers, e.g. 1d vec of int*, due to mismatched destroy
    avoid use with non-primitive data types to avoid code bloat
    for these other cases, use smalloc/srealloc/sfree directly
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   create a 1d array 
+   create a 1d array
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
@@ -47,7 +47,7 @@ class Memory : protected Pointers {
       array = (TYPE *) smalloc(nbytes,name);
       return array;
     }
-  
+
   template <typename TYPE>
     TYPE **create(TYPE **&array, int n, const char *name) {fail(name);}
 
@@ -56,10 +56,10 @@ class Memory : protected Pointers {
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    TYPE *grow(TYPE *&array, int n, const char *name) 
+    TYPE *grow(TYPE *&array, int n, const char *name)
     {
       if (array == NULL) return create(array,n,name);
-      
+
       bigint nbytes = ((bigint) sizeof(TYPE)) * n;
       array = (TYPE *) srealloc(array,nbytes,name);
       return array;
@@ -69,22 +69,22 @@ class Memory : protected Pointers {
     TYPE **grow(TYPE **&array, int n, const char *name) {fail(name);}
 
 /* ----------------------------------------------------------------------
-   destroy a 1d array 
+   destroy a 1d array
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    void destroy(TYPE *array) 
+    void destroy(TYPE *array)
     {
       sfree(array);
     }
 
 /* ----------------------------------------------------------------------
-   create a 1d array with index from nlo to nhi inclusive 
+   create a 1d array with index from nlo to nhi inclusive
    cannot grow it
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    TYPE *create1d_offset(TYPE *&array, int nlo, int nhi, const char *name) 
+    TYPE *create1d_offset(TYPE *&array, int nlo, int nhi, const char *name)
     {
       bigint nbytes = ((bigint) sizeof(TYPE)) * (nhi-nlo+1);
       array = (TYPE *) smalloc(nbytes,name);
@@ -97,31 +97,31 @@ class Memory : protected Pointers {
     {fail(name);}
 
 /* ----------------------------------------------------------------------
-   destroy a 1d array with index offset 
+   destroy a 1d array with index offset
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    void destroy1d_offset(TYPE *array, int offset) 
+    void destroy1d_offset(TYPE *array, int offset)
     {
       if (array) sfree(&array[offset]);
     }
 
 /* ----------------------------------------------------------------------
-   create a 2d array 
+   create a 2d array
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    TYPE **create(TYPE **&array, int n1, int n2, const char *name) 
+    TYPE **create(TYPE **&array, int n1, int n2, const char *name)
     {
       bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2;
       TYPE *data = (TYPE *) smalloc(nbytes,name);
       nbytes = ((bigint) sizeof(TYPE *)) * n1;
       array = (TYPE **) smalloc(nbytes,name);
-      
+
       bigint n = 0;
       for (int i = 0; i < n1; i++) {
-	array[i] = &data[n];
-	n += n2;
+        array[i] = &data[n];
+        n += n2;
       }
       return array;
     }
@@ -136,19 +136,19 @@ class Memory : protected Pointers {
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    TYPE **grow(TYPE **&array, int n1, int n2, const char *name) 
+    TYPE **grow(TYPE **&array, int n1, int n2, const char *name)
     {
       if (array == NULL) return create(array,n1,n2,name);
-      
+
       bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2;
       TYPE *data = (TYPE *) srealloc(array[0],nbytes,name);
       nbytes = ((bigint) sizeof(TYPE *)) * n1;
       array = (TYPE **) srealloc(array,nbytes,name);
-      
+
       bigint n = 0;
       for (int i = 0; i < n1; i++) {
-	array[i] = &data[n];
-	n += n2;
+        array[i] = &data[n];
+        n += n2;
       }
       return array;
     }
@@ -158,7 +158,7 @@ class Memory : protected Pointers {
     {fail(name);}
 
 /* ----------------------------------------------------------------------
-   destroy a 2d array 
+   destroy a 2d array
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
@@ -174,7 +174,7 @@ class Memory : protected Pointers {
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    TYPE **create_ragged(TYPE **&array, int n1, int *n2, const char *name) 
+    TYPE **create_ragged(TYPE **&array, int n1, int *n2, const char *name)
     {
       bigint n2sum = 0;
       for (int i = 0; i < n1; i++) n2sum += n2[i];
@@ -183,11 +183,11 @@ class Memory : protected Pointers {
       TYPE *data = (TYPE *) smalloc(nbytes,name);
       nbytes = ((bigint) sizeof(TYPE *)) * n1;
       array = (TYPE **) smalloc(nbytes,name);
-      
+
       bigint n = 0;
       for (int i = 0; i < n1; i++) {
-	array[i] = &data[n];
-	n += n2[i];
+        array[i] = &data[n];
+        n += n2[i];
       }
       return array;
     }
@@ -197,13 +197,13 @@ class Memory : protected Pointers {
     {fail(name);}
 
 /* ----------------------------------------------------------------------
-   create a 2d array with 2nd index from n2lo to n2hi inclusive 
+   create a 2d array with 2nd index from n2lo to n2hi inclusive
    cannot grow it
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
     TYPE **create2d_offset(TYPE **&array, int n1, int n2lo, int n2hi,
-			   const char *name)
+                           const char *name)
     {
       int n2 = n2hi - n2lo + 1;
       create(array,n1,n2,name);
@@ -213,10 +213,10 @@ class Memory : protected Pointers {
 
   template <typename TYPE>
     TYPE ***create2d_offset(TYPE ***&array, int n1, int n2lo, int n2hi,
-			    const char *name) {fail(name);}
+                            const char *name) {fail(name);}
 
 /* ----------------------------------------------------------------------
-   destroy a 2d array with 2nd index offset 
+   destroy a 2d array with 2nd index offset
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
@@ -228,11 +228,11 @@ class Memory : protected Pointers {
     }
 
 /* ----------------------------------------------------------------------
-   create a 3d array 
+   create a 3d array
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    TYPE ***create(TYPE ***&array, int n1, int n2, int n3, const char *name) 
+    TYPE ***create(TYPE ***&array, int n1, int n2, int n3, const char *name)
     {
       bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3;
       TYPE *data = (TYPE *) smalloc(nbytes,name);
@@ -240,23 +240,23 @@ class Memory : protected Pointers {
       TYPE **plane = (TYPE **) smalloc(nbytes,name);
       nbytes = ((bigint) sizeof(TYPE **)) * n1;
       array = (TYPE ***) smalloc(nbytes,name);
-      
+
       int i,j;
       bigint m;
       bigint n = 0;
       for (i = 0; i < n1; i++) {
-	m = ((bigint) i) * n2;
-	array[i] = &plane[m];
-	for (j = 0; j < n2; j++) {
-	  plane[m+j] = &data[n];
-	  n += n3;
-	}
+        m = ((bigint) i) * n2;
+        array[i] = &plane[m];
+        for (j = 0; j < n2; j++) {
+          plane[m+j] = &data[n];
+          n += n3;
+        }
       }
       return array;
     }
 
   template <typename TYPE>
-    TYPE ****create(TYPE ****&array, int n1, int n2, int n3, const char *name) 
+    TYPE ****create(TYPE ****&array, int n1, int n2, int n3, const char *name)
     {fail(name);}
 
 /* ----------------------------------------------------------------------
@@ -265,41 +265,41 @@ class Memory : protected Pointers {
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    TYPE ***grow(TYPE ***&array, int n1, int n2, int n3, const char *name) 
+    TYPE ***grow(TYPE ***&array, int n1, int n2, int n3, const char *name)
     {
       if (array == NULL) return create(array,n1,n2,n3,name);
-      
+
       bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3;
       TYPE *data = (TYPE *) srealloc(array[0][0],nbytes,name);
       nbytes = ((bigint) sizeof(TYPE *)) * n1*n2;
       TYPE **plane = (TYPE **) srealloc(array[0],nbytes,name);
       nbytes = ((bigint) sizeof(TYPE **)) * n1;
       array = (TYPE ***) srealloc(array,nbytes,name);
-      
+
       int i,j;
       bigint m;
       bigint n = 0;
       for (i = 0; i < n1; i++) {
-	m = ((bigint) i) * n2;
-	array[i] = &plane[m];
-	for (j = 0; j < n2; j++) {
-	  plane[m+j] = &data[n];
-	  n += n3;
-	}
+        m = ((bigint) i) * n2;
+        array[i] = &plane[m];
+        for (j = 0; j < n2; j++) {
+          plane[m+j] = &data[n];
+          n += n3;
+        }
       }
       return array;
     }
 
   template <typename TYPE>
-    TYPE ****grow(TYPE ****&array, int n1, int n2, int n3, const char *name) 
+    TYPE ****grow(TYPE ****&array, int n1, int n2, int n3, const char *name)
     {fail(name);}
 
 /* ----------------------------------------------------------------------
-   destroy a 3d array 
+   destroy a 3d array
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    void destroy(TYPE ***array) 
+    void destroy(TYPE ***array)
     {
       if (array == NULL) return;
       sfree(array[0][0]);
@@ -308,13 +308,13 @@ class Memory : protected Pointers {
     }
 
 /* ----------------------------------------------------------------------
-   create a 3d array with 1st index from n1lo to n1hi inclusive 
+   create a 3d array with 1st index from n1lo to n1hi inclusive
    cannot grow it
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, 
-			    int n2, int n3, const char *name)
+    TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi,
+                            int n2, int n3, const char *name)
     {
       int n1 = n1hi - n1lo + 1;
       create(array,n1,n2,n3,name);
@@ -323,12 +323,12 @@ class Memory : protected Pointers {
     }
 
   template <typename TYPE>
-    TYPE ****create3d_offset(TYPE ****&array, int n1lo, int n1hi, 
-			     int n2, int n3, const char *name)
+    TYPE ****create3d_offset(TYPE ****&array, int n1lo, int n1hi,
+                             int n2, int n3, const char *name)
     {fail(name);}
 
 /* ----------------------------------------------------------------------
-   free a 3d array with 1st index offset 
+   free a 3d array with 1st index offset
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
@@ -341,20 +341,20 @@ class Memory : protected Pointers {
    create a 3d array with
    1st index from n1lo to n1hi inclusive,
    2nd index from n2lo to n2hi inclusive,
-   3rd index from n3lo to n3hi inclusive 
+   3rd index from n3lo to n3hi inclusive
    cannot grow it
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi, 
-			    int n2lo, int n2hi, int n3lo, int n3hi,
-			    const char *name)
+    TYPE ***create3d_offset(TYPE ***&array, int n1lo, int n1hi,
+                            int n2lo, int n2hi, int n3lo, int n3hi,
+                            const char *name)
     {
       int n1 = n1hi - n1lo + 1;
       int n2 = n2hi - n2lo + 1;
       int n3 = n3hi - n3lo + 1;
       create(array,n1,n2,n3,name);
-      
+
       bigint m = ((bigint) n1) * n2;
       for (bigint i = 0; i < m; i++) array[0][i] -= n3lo;
       for (int i = 0; i < n1; i++) array[i] -= n2lo;
@@ -363,18 +363,18 @@ class Memory : protected Pointers {
     }
 
   template <typename TYPE>
-    TYPE ****create3d_offset(TYPE ****&array, int n1lo, int n1hi, 
-			     int n2lo, int n2hi, int n3lo, int n3hi,
-			     const char *name)
+    TYPE ****create3d_offset(TYPE ****&array, int n1lo, int n1hi,
+                             int n2lo, int n2hi, int n3lo, int n3hi,
+                             const char *name)
     {fail(name);}
 
 /* ----------------------------------------------------------------------
-   free a 3d array with all 3 indices offset 
+   free a 3d array with all 3 indices offset
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
-    void destroy3d_offset(TYPE ***array, 
-			  int n1_offset, int n2_offset, int n3_offset)
+    void destroy3d_offset(TYPE ***array,
+                          int n1_offset, int n2_offset, int n3_offset)
     {
       if (array == NULL) return;
       sfree(&array[n1_offset][n2_offset][n3_offset]);
@@ -383,12 +383,12 @@ class Memory : protected Pointers {
     }
 
 /* ----------------------------------------------------------------------
-   create a 4d array 
+   create a 4d array
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
     TYPE ****create(TYPE ****&array, int n1, int n2, int n3, int n4,
-		    const char *name)
+                    const char *name)
     {
       bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4;
       TYPE *data = (TYPE *) smalloc(nbytes,name);
@@ -398,34 +398,34 @@ class Memory : protected Pointers {
       TYPE ***plane = (TYPE ***) smalloc(nbytes,name);
       nbytes = ((bigint) sizeof(TYPE ***)) * n1;
       array = (TYPE ****) smalloc(nbytes,name);
-      
+
       int i,j,k;
       bigint m1,m2,m3;
       bigint n = 0;
       for (i = 0; i < n1; i++) {
-	m2 = ((bigint) i) * n2;
-	array[i] = &plane[m2];
-	for (j = 0; j < n2; j++) {
-	  m1 = ((bigint) i) * n2 + j;
-	  m2 = ((bigint) i) * n2*n3 + j*n3;
-	  plane[m1] = &cube[m2];
-	  for (k = 0; k < n3; k++) {
-	    m1 = ((bigint) i) * n2*n3 + j*n3 + k;
-	    cube[m1] = &data[n];
-	    n += n4;
-	  }
-	}
+        m2 = ((bigint) i) * n2;
+        array[i] = &plane[m2];
+        for (j = 0; j < n2; j++) {
+          m1 = ((bigint) i) * n2 + j;
+          m2 = ((bigint) i) * n2*n3 + j*n3;
+          plane[m1] = &cube[m2];
+          for (k = 0; k < n3; k++) {
+            m1 = ((bigint) i) * n2*n3 + j*n3 + k;
+            cube[m1] = &data[n];
+            n += n4;
+          }
+        }
       }
       return array;
     }
 
   template <typename TYPE>
     TYPE *****create(TYPE *****&array, int n1, int n2, int n3, int n4,
-		     const char *name)
+                     const char *name)
     {fail(name);}
 
 /* ----------------------------------------------------------------------
-   destroy a 4d array 
+   destroy a 4d array
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
@@ -439,12 +439,12 @@ class Memory : protected Pointers {
     }
 
 /* ----------------------------------------------------------------------
-   create a 5d array 
+   create a 5d array
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
     TYPE *****create(TYPE *****&array, int n1, int n2, int n3, int n4,
-		     int n5, const char *name)
+                     int n5, const char *name)
     {
       bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4*n5;
       TYPE *data = (TYPE *) smalloc(nbytes,name);
@@ -456,41 +456,41 @@ class Memory : protected Pointers {
       TYPE ****level2 = (TYPE ****) smalloc(nbytes,name);
       nbytes = ((bigint) sizeof(TYPE ****)) * n1;
       array = (TYPE *****) smalloc(nbytes,name);
-      
+
       int i,j,k,l;
       bigint m1,m2,m3,m4,m5;
       bigint n = 0;
       for (i = 0; i < n1; i++) {
-	m2 = ((bigint) i) * n2;
-	array[i] = &level2[m2];
-	for (j = 0; j < n2; j++) {
-	  m1 = ((bigint) i) * n2 + j;
-	  m2 = ((bigint) i) * n2*n3 +  ((bigint) j) * n3;
-	  level2[m1] = &level3[m2];
-	  for (k = 0; k < n3; k++) {
-	    m1 = ((bigint) i) * n2*n3 +  ((bigint) j) * n3 + k;
-	    m2 = ((bigint) i) * n2*n3*n4 + 
-	      ((bigint) j) * n3*n4 + ((bigint) k) * n4;
-	    level3[m1] = &level4[m2];
-	    for (l = 0; l < n4; l++) {
-	      m1 = ((bigint) i) * n2*n3*n4 + 
-		((bigint) j) * n3*n4 + ((bigint) k) * n4 + l;
-	      level4[m1] = &data[n];
-	      n += n5;
-	    }
-	  }
-	}
+        m2 = ((bigint) i) * n2;
+        array[i] = &level2[m2];
+        for (j = 0; j < n2; j++) {
+          m1 = ((bigint) i) * n2 + j;
+          m2 = ((bigint) i) * n2*n3 +  ((bigint) j) * n3;
+          level2[m1] = &level3[m2];
+          for (k = 0; k < n3; k++) {
+            m1 = ((bigint) i) * n2*n3 +  ((bigint) j) * n3 + k;
+            m2 = ((bigint) i) * n2*n3*n4 +
+              ((bigint) j) * n3*n4 + ((bigint) k) * n4;
+            level3[m1] = &level4[m2];
+            for (l = 0; l < n4; l++) {
+              m1 = ((bigint) i) * n2*n3*n4 +
+                ((bigint) j) * n3*n4 + ((bigint) k) * n4 + l;
+              level4[m1] = &data[n];
+              n += n5;
+            }
+          }
+        }
       }
       return array;
     }
 
   template <typename TYPE>
     TYPE ******create(TYPE ******&array, int n1, int n2, int n3, int n4,
-		      int n5, const char *name)
+                      int n5, const char *name)
     {fail(name);}
 
 /* ----------------------------------------------------------------------
-   destroy a 5d array 
+   destroy a 5d array
 ------------------------------------------------------------------------- */
 
   template <typename TYPE>
diff --git a/src/min.cpp b/src/min.cpp
index 945c1a2f51..83468936cd 100644
--- a/src/min.cpp
+++ b/src/min.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -167,11 +167,11 @@ void Min::init()
   neigh_every = neighbor->every;
   neigh_delay = neighbor->delay;
   neigh_dist_check = neighbor->dist_check;
-  
+
   if (neigh_every != 1 || neigh_delay != 0 || neigh_dist_check != 1) {
-    if (comm->me == 0) 
+    if (comm->me == 0)
       error->warning(FLERR,
-		     "Resetting reneighboring criteria during minimization");
+                     "Resetting reneighboring criteria during minimization");
   }
 
   neighbor->every = 1;
@@ -238,10 +238,10 @@ void Min::setup()
 
   if (nextra_global && searchflag == 0)
     error->all(FLERR,
-	       "Cannot use a damped dynamics min style with fix box/relax");
+               "Cannot use a damped dynamics min style with fix box/relax");
   if (nextra_atom && searchflag == 0)
     error->all(FLERR,
-	       "Cannot use a damped dynamics min style with per-atom DOF");
+               "Cannot use a damped dynamics min style with per-atom DOF");
 
   // atoms may have migrated in comm->exchange()
 
@@ -285,7 +285,7 @@ void Min::setup()
   ecurrent = pe_compute->compute_scalar();
   if (nextra_global) ecurrent += modify->min_energy(fextra);
   if (output->thermo->normflag) ecurrent /= atom->natoms;
-	
+
   einitial = ecurrent;
   fnorm2_init = sqrt(fnorm_sqr());
   fnorminf_init = fnorm_inf();
@@ -357,7 +357,7 @@ void Min::setup_minimal(int flag)
   ecurrent = pe_compute->compute_scalar();
   if (nextra_global) ecurrent += modify->min_energy(fextra);
   if (output->thermo->normflag) ecurrent /= atom->natoms;
-	
+
   einitial = ecurrent;
   fnorm2_init = sqrt(fnorm_sqr());
   fnorminf_init = fnorm_inf();
@@ -387,14 +387,14 @@ void Min::run(int n)
 
     if (update->restrict_output == 0) {
       for (int idump = 0; idump < output->ndump; idump++)
-	output->next_dump[idump] = update->ntimestep;
+        output->next_dump[idump] = update->ntimestep;
       output->next_dump_any = update->ntimestep;
       if (output->restart_flag) {
-	output->next_restart = update->ntimestep;
-	if (output->restart_every_single) 
-	  output->next_restart_single = update->ntimestep;
-	if (output->restart_every_double)
-	  output->next_restart_double = update->ntimestep;
+        output->next_restart = update->ntimestep;
+        if (output->restart_every_single)
+          output->next_restart_single = update->ntimestep;
+        if (output->restart_every_double)
+          output->next_restart_double = update->ntimestep;
       }
     }
     output->next_thermo = update->ntimestep;
@@ -410,7 +410,7 @@ void Min::run(int n)
 void Min::cleanup()
 {
   // stats for Finish to print
-	
+
   efinal = ecurrent;
   fnorm2_final = sqrt(fnorm_sqr());
   fnorminf_final = fnorm_inf();
@@ -456,8 +456,8 @@ double Min::energy_force(int resetflag)
     }
     timer->stamp();
     comm->exchange();
-    if (atom->sortfreq > 0 && 
-	update->ntimestep >= atom->nextsort) atom->sort();
+    if (atom->sortfreq > 0 &&
+        update->ntimestep >= atom->nextsort) atom->sort();
     comm->borders();
     if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
     timer->stamp(TIME_COMM);
@@ -565,14 +565,14 @@ int Min::request(Pair *pair, int peratom, double maxvalue)
 {
   int n = nextra_atom + 1;
   xextra_atom = (double **) memory->srealloc(xextra_atom,n*sizeof(double *),
-					     "min:xextra_atom");
+                                             "min:xextra_atom");
   fextra_atom = (double **) memory->srealloc(fextra_atom,n*sizeof(double *),
-					     "min:fextra_atom");
+                                             "min:fextra_atom");
   memory->grow(extra_peratom,n,"min:extra_peratom");
   memory->grow(extra_nlen,n,"min:extra_nlen");
   memory->grow(extra_max,n,"min:extra_max");
   requestor = (Pair **) memory->srealloc(requestor,n*sizeof(Pair *),
-					 "min:requestor");
+                                         "min:requestor");
 
   requestor[nextra_atom] = pair;
   extra_peratom[nextra_atom] = peratom;
@@ -712,7 +712,7 @@ double Min::fnorm_sqr()
       fatom = fextra_atom[m];
       n = extra_nlen[m];
       for (i = 0; i < n; i++)
-	local_norm2_sqr += fatom[i]*fatom[i];
+        local_norm2_sqr += fatom[i]*fatom[i];
     }
   }
 
@@ -720,9 +720,9 @@ double Min::fnorm_sqr()
   MPI_Allreduce(&local_norm2_sqr,&norm2_sqr,1,MPI_DOUBLE,MPI_SUM,world);
 
   if (nextra_global)
-    for (i = 0; i < nextra_global; i++) 
+    for (i = 0; i < nextra_global; i++)
       norm2_sqr += fextra[i]*fextra[i];
-  
+
   return norm2_sqr;
 }
 
@@ -743,7 +743,7 @@ double Min::fnorm_inf()
       fatom = fextra_atom[m];
       n = extra_nlen[m];
       for (i = 0; i < n; i++)
-	local_norm_inf = MAX(fabs(fatom[i]),local_norm_inf);
+        local_norm_inf = MAX(fabs(fatom[i]),local_norm_inf);
     }
   }
 
@@ -751,7 +751,7 @@ double Min::fnorm_inf()
   MPI_Allreduce(&local_norm_inf,&norm_inf,1,MPI_DOUBLE,MPI_MAX,world);
 
   if (nextra_global)
-    for (i = 0; i < nextra_global; i++) 
+    for (i = 0; i < nextra_global; i++)
       norm_inf = MAX(fabs(fextra[i]),norm_inf);
 
   return norm_inf;
@@ -764,14 +764,14 @@ double Min::fnorm_inf()
 char *Min::stopstrings(int n)
 {
   const char *strings[] = {"max iterations",
-			   "max force evaluations",
-			   "energy tolerance",
-			   "force tolerance",
-			   "search direction is not downhill",
-			   "linesearch alpha is zero",
-			   "forces are zero",
-			   "quadratic factors are zero",
-			   "trust region too small",
-			   "HFTN minimizer error"};
+                           "max force evaluations",
+                           "energy tolerance",
+                           "force tolerance",
+                           "search direction is not downhill",
+                           "linesearch alpha is zero",
+                           "forces are zero",
+                           "quadratic factors are zero",
+                           "trust region too small",
+                           "HFTN minimizer error"};
   return (char *) strings[n];
 }
diff --git a/src/min.h b/src/min.h
index bb21df0580..2ba3e5cb22 100644
--- a/src/min.h
+++ b/src/min.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/min_cg.cpp b/src/min_cg.cpp
index f2b1a666f5..a9887a6cec 100644
--- a/src/min_cg.cpp
+++ b/src/min_cg.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -73,7 +73,7 @@ int MinCG::iterate(int maxiter)
     // line minimization along direction h from current atom->x
 
     eprevious = ecurrent;
-    fail = (this->*linemin)(ecurrent,alpha_final);    
+    fail = (this->*linemin)(ecurrent,alpha_final);
     if (fail) return fail;
 
     // function evaluation criterion
@@ -82,8 +82,8 @@ int MinCG::iterate(int maxiter)
 
     // energy tolerance criterion
 
-    if (fabs(ecurrent-eprevious) < 
-	update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
+    if (fabs(ecurrent-eprevious) <
+        update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
       return ETOL;
 
     // force tolerance criterion
@@ -95,19 +95,19 @@ int MinCG::iterate(int maxiter)
     }
     if (nextra_atom)
       for (m = 0; m < nextra_atom; m++) {
-	fatom = fextra_atom[m];
-	gatom = gextra_atom[m];
-	n = extra_nlen[m];
-	for (i = 0; i < n; i++) {
-	  dot[0] += fatom[i]*fatom[i];
-	  dot[1] += fatom[i]*gatom[i];
-	}
+        fatom = fextra_atom[m];
+        gatom = gextra_atom[m];
+        n = extra_nlen[m];
+        for (i = 0; i < n; i++) {
+          dot[0] += fatom[i]*fatom[i];
+          dot[1] += fatom[i]*gatom[i];
+        }
       }
     MPI_Allreduce(dot,dotall,2,MPI_DOUBLE,MPI_SUM,world);
     if (nextra_global)
       for (i = 0; i < nextra_global; i++) {
-	dotall[0] += fextra[i]*fextra[i];
-	dotall[1] += fextra[i]*gextra[i];
+        dotall[0] += fextra[i]*fextra[i];
+        dotall[1] += fextra[i]*gextra[i];
       }
 
     if (dotall[0] < update->ftol*update->ftol) return FTOL;
@@ -127,19 +127,19 @@ int MinCG::iterate(int maxiter)
     }
     if (nextra_atom)
       for (m = 0; m < nextra_atom; m++) {
-	fatom = fextra_atom[m];
-	gatom = gextra_atom[m];
-	hatom = hextra_atom[m];
-	n = extra_nlen[m];
-	for (i = 0; i < n; i++) {
-	  gatom[i] = fatom[i];
-	  hatom[i] = gatom[i] + beta*hatom[i];
-	}
+        fatom = fextra_atom[m];
+        gatom = gextra_atom[m];
+        hatom = hextra_atom[m];
+        n = extra_nlen[m];
+        for (i = 0; i < n; i++) {
+          gatom[i] = fatom[i];
+          hatom[i] = gatom[i] + beta*hatom[i];
+        }
       }
     if (nextra_global)
       for (i = 0; i < nextra_global; i++) {
-	gextra[i] = fextra[i];
-	hextra[i] = gextra[i] + beta*hextra[i];
+        gextra[i] = fextra[i];
+        hextra[i] = gextra[i] + beta*hextra[i];
       }
 
     // reinitialize CG if new search direction h is not downhill
@@ -148,27 +148,27 @@ int MinCG::iterate(int maxiter)
     for (i = 0; i < nvec; i++) dot[0] += g[i]*h[i];
     if (nextra_atom)
       for (m = 0; m < nextra_atom; m++) {
-	gatom = gextra_atom[m];
-	hatom = hextra_atom[m];
-	n = extra_nlen[m];
-	for (i = 0; i < n; i++) dot[0] += gatom[i]*hatom[i];
+        gatom = gextra_atom[m];
+        hatom = hextra_atom[m];
+        n = extra_nlen[m];
+        for (i = 0; i < n; i++) dot[0] += gatom[i]*hatom[i];
       }
     MPI_Allreduce(dot,dotall,1,MPI_DOUBLE,MPI_SUM,world);
     if (nextra_global)
       for (i = 0; i < nextra_global; i++)
-	dotall[0] += gextra[i]*hextra[i];
+        dotall[0] += gextra[i]*hextra[i];
 
     if (dotall[0] <= 0.0) {
       for (i = 0; i < nvec; i++) h[i] = g[i];
       if (nextra_atom)
-	for (m = 0; m < nextra_atom; m++) {
-	  gatom = gextra_atom[m];
-	  hatom = hextra_atom[m];
-	  n = extra_nlen[m];
-	  for (i = 0; i < n; i++) hatom[i] = gatom[i];
-	}
+        for (m = 0; m < nextra_atom; m++) {
+          gatom = gextra_atom[m];
+          hatom = hextra_atom[m];
+          n = extra_nlen[m];
+          for (i = 0; i < n; i++) hatom[i] = gatom[i];
+        }
       if (nextra_global)
-	for (i = 0; i < nextra_global; i++) hextra[i] = gextra[i];
+        for (i = 0; i < nextra_global; i++) hextra[i] = gextra[i];
     }
 
     // output for thermo, dump, restart files
diff --git a/src/min_cg.h b/src/min_cg.h
index 5588e4f3fb..6ac8901d24 100644
--- a/src/min_cg.h
+++ b/src/min_cg.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/min_fire.cpp b/src/min_fire.cpp
index c061eceeda..c8ade7dcb2 100644
--- a/src/min_fire.cpp
+++ b/src/min_fire.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -123,42 +123,42 @@ int MinFire::iterate(int maxiter)
     if (vdotfall > 0.0) {
       vdotv = 0.0;
       for (int i = 0; i < nlocal; i++)
-	vdotv += v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
+        vdotv += v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2];
       MPI_Allreduce(&vdotv,&vdotvall,1,MPI_DOUBLE,MPI_SUM,world);
 
       // sum vdotv over replicas, if necessary
       // this communicator would be invalid for multiprocess replicas
 
       if (update->multireplica == 1) {
-	vdotv = vdotvall;
-	MPI_Allreduce(&vdotv,&vdotvall,1,MPI_DOUBLE,MPI_SUM,universe->uworld);
+        vdotv = vdotvall;
+        MPI_Allreduce(&vdotv,&vdotvall,1,MPI_DOUBLE,MPI_SUM,universe->uworld);
       }
 
       fdotf = 0.0;
       for (int i = 0; i < nlocal; i++)
-	fdotf += f[i][0]*f[i][0] + f[i][1]*f[i][1] + f[i][2]*f[i][2];
+        fdotf += f[i][0]*f[i][0] + f[i][1]*f[i][1] + f[i][2]*f[i][2];
       MPI_Allreduce(&fdotf,&fdotfall,1,MPI_DOUBLE,MPI_SUM,world);
 
       // sum fdotf over replicas, if necessary
       // this communicator would be invalid for multiprocess replicas
-      
+
       if (update->multireplica == 1) {
-	fdotf = fdotfall;
-	MPI_Allreduce(&fdotf,&fdotfall,1,MPI_DOUBLE,MPI_SUM,universe->uworld);
+        fdotf = fdotfall;
+        MPI_Allreduce(&fdotf,&fdotfall,1,MPI_DOUBLE,MPI_SUM,universe->uworld);
       }
 
       scale1 = 1.0 - alpha;
       if (fdotfall == 0.0) scale2 = 0.0;
       else scale2 = alpha * sqrt(vdotvall/fdotfall);
       for (int i = 0; i < nlocal; i++) {
-	v[i][0] = scale1*v[i][0] + scale2*f[i][0];
-	v[i][1] = scale1*v[i][1] + scale2*f[i][1];
-	v[i][2] = scale1*v[i][2] + scale2*f[i][2];
+        v[i][0] = scale1*v[i][0] + scale2*f[i][0];
+        v[i][1] = scale1*v[i][1] + scale2*f[i][1];
+        v[i][2] = scale1*v[i][2] + scale2*f[i][2];
       }
 
       if (ntimestep - last_negative > DELAYSTEP) {
-	dt = MIN(dt*DT_GROW,dtmax);
-	alpha *= ALPHA_SHRINK;
+        dt = MIN(dt*DT_GROW,dtmax);
+        alpha *= ALPHA_SHRINK;
       }
 
     // else (v dot f) <= 0:
@@ -169,7 +169,7 @@ int MinFire::iterate(int maxiter)
       dt *= DT_SHRINK;
       alpha = ALPHA0;
       for (int i = 0; i < nlocal; i++)
-	v[i][0] = v[i][1] = v[i][2] = 0.0;
+        v[i][0] = v[i][1] = v[i][2] = 0.0;
     }
 
     // limit timestep so no particle moves further than dmax
@@ -198,29 +198,29 @@ int MinFire::iterate(int maxiter)
     // Euler integration step
 
     double **x = atom->x;
-    
+
     if (rmass) {
       for (int i = 0; i < nlocal; i++) {
-	dtfm = dtv / rmass[i];
-	x[i][0] += dtv * v[i][0];
-	x[i][1] += dtv * v[i][1];
-	x[i][2] += dtv * v[i][2];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
+        dtfm = dtv / rmass[i];
+        x[i][0] += dtv * v[i][0];
+        x[i][1] += dtv * v[i][1];
+        x[i][2] += dtv * v[i][2];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
       }
     } else {
       for (int i = 0; i < nlocal; i++) {
-	dtfm = dtv / mass[type[i]];
-	x[i][0] += dtv * v[i][0];
-	x[i][1] += dtv * v[i][1];
-	x[i][2] += dtv * v[i][2];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
+        dtfm = dtv / mass[type[i]];
+        x[i][0] += dtv * v[i][0];
+        x[i][1] += dtv * v[i][1];
+        x[i][2] += dtv * v[i][2];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
       }
     }
-    
+
     eprevious = ecurrent;
     ecurrent = energy_force(0);
     neval++;
@@ -231,16 +231,16 @@ int MinFire::iterate(int maxiter)
 
     if (update->etol > 0.0 && ntimestep-last_negative > DELAYSTEP) {
       if (update->multireplica == 0) {
-	if (fabs(ecurrent-eprevious) < 
-	    update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
-	  return ETOL;
+        if (fabs(ecurrent-eprevious) <
+            update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
+          return ETOL;
       } else {
-	if (fabs(ecurrent-eprevious) < 
-	    update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
-	  flag = 0;
-	else flag = 1;
-	MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,universe->uworld);
-	if (flagall == 0) return ETOL;
+        if (fabs(ecurrent-eprevious) <
+            update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
+          flag = 0;
+        else flag = 1;
+        MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,universe->uworld);
+        if (flagall == 0) return ETOL;
       }
     }
 
@@ -250,12 +250,12 @@ int MinFire::iterate(int maxiter)
     if (update->ftol > 0.0) {
       fdotf = fnorm_sqr();
       if (update->multireplica == 0) {
-	if (fdotf < update->ftol*update->ftol) return FTOL;
+        if (fdotf < update->ftol*update->ftol) return FTOL;
       } else {
-	if (fdotf < update->ftol*update->ftol) flag = 0;
-	else flag = 1;
-	MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,universe->uworld);
-	if (flagall == 0) return FTOL;
+        if (fdotf < update->ftol*update->ftol) flag = 0;
+        else flag = 1;
+        MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,universe->uworld);
+        if (flagall == 0) return FTOL;
       }
     }
 
@@ -267,6 +267,6 @@ int MinFire::iterate(int maxiter)
       timer->stamp(TIME_OUTPUT);
     }
   }
-  
+
   return MAXITER;
 }
diff --git a/src/min_fire.h b/src/min_fire.h
index 926b1e6ecc..54867d6c6b 100644
--- a/src/min_fire.h
+++ b/src/min_fire.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/min_hftn.cpp b/src/min_hftn.cpp
index 60e4890bd4..cb47934380 100644
--- a/src/min_hftn.cpp
+++ b/src/min_hftn.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -81,9 +81,9 @@ MinHFTN::MinHFTN(LAMMPS *lmp) : Min(lmp)
     _daExtraGlobal[i] = NULL;
   for (int  i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++)
     _daExtraAtom[i] = NULL;
-  
+
   _fpPrint = NULL;
-  
+
   return;
 }
 
@@ -99,7 +99,7 @@ MinHFTN::~MinHFTN (void)
   for (int  i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++)
     if (_daExtraAtom[i] != NULL)
       delete [] _daExtraAtom[i];
-  
+
   return;
 }
 
@@ -121,7 +121,7 @@ void MinHFTN::init()
       delete [] _daExtraAtom[i];
     _daExtraAtom[i] = NULL;
   }
-  
+
   return;
 }
 
@@ -134,7 +134,7 @@ void MinHFTN::setup_style()
   //---- ALLOCATE MEMORY FOR ATOMIC DEGREES OF FREEDOM.
   for (int  i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++)
     fix_minimize->add_vector(3);
-  
+
   //---- ALLOCATE MEMORY FOR EXTRA GLOBAL DEGREES OF FREEDOM.
   //---- THE FIX MODULE TAKES CARE OF THE FIRST VECTOR, X0 (XK).
   if (nextra_global) {
@@ -146,13 +146,13 @@ void MinHFTN::setup_style()
   if (nextra_atom) {
     for (int  i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++)
       _daExtraAtom[i] = new double*[nextra_atom];
-    
+
     for (int m = 0; m < nextra_atom; m++) {
       for (int  i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++)
-	fix_minimize->add_vector (extra_peratom[m]);
+        fix_minimize->add_vector (extra_peratom[m]);
     }
   }
-  
+
   return;
 }
 
@@ -167,7 +167,7 @@ void MinHFTN::setup_style()
 void MinHFTN::reset_vectors()
 {
   nvec = 3 * atom->nlocal;
-  
+
   //---- ATOMIC DEGREES OF FREEDOM.
   if (nvec > 0) {
     xvec = atom->x[0];
@@ -175,7 +175,7 @@ void MinHFTN::reset_vectors()
   }
   for (int  i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++)
     _daAVectors[i] = fix_minimize->request_vector (i);
-  
+
   //---- EXTRA PER-ATOM DEGREES OF FREEDOM.
   if (nextra_atom) {
     int  n = NUM_HFTN_ATOM_BASED_VECTORS;
@@ -183,10 +183,10 @@ void MinHFTN::reset_vectors()
       extra_nlen[m] = extra_peratom[m] * atom->nlocal;
       requestor[m]->min_xf_pointers(m,&xextra_atom[m],&fextra_atom[m]);
       for (int  i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++)
-	_daExtraAtom[i][m] = fix_minimize->request_vector (n++);
+        _daExtraAtom[i][m] = fix_minimize->request_vector (n++);
     }
   }
-  
+
   return;
 }
 
@@ -201,22 +201,22 @@ int MinHFTN::iterate(int)
 {
   //---- TURN THIS ON TO GENERATE AN OPTIMIZATION PROGRESS FILE.
   bool  bPrintProgress = false;
-  
+
   if (bPrintProgress)
     open_hftn_print_file_();
-  
+
   double  dFinalEnergy = 0.0;
   double  dFinalFnorm2 = 0.0;
   modify->min_clearstore();
   int  nStopCode = execute_hftn_ (bPrintProgress,
-				  einitial,
-				  fnorm2_init,
-				  dFinalEnergy,
-				  dFinalFnorm2);
+                                  einitial,
+                                  fnorm2_init,
+                                  dFinalEnergy,
+                                  dFinalFnorm2);
   modify->min_clearstore();
   if (bPrintProgress)
     close_hftn_print_file_();
-  
+
   return( nStopCode );
 }
 
@@ -234,20 +234,20 @@ int MinHFTN::iterate(int)
      atom->f  - forces evaluated at output x
 ------------------------------------------------------------------------- */
 int MinHFTN::execute_hftn_(const bool      bPrintProgress,
-			   const double    dInitialEnergy,
-			   const double    dInitialForce2,
-			   double &  dFinalEnergy,
-			   double &  dFinalForce2)
+                           const double    dInitialEnergy,
+                           const double    dInitialForce2,
+                           double &  dFinalEnergy,
+                           double &  dFinalForce2)
 {
   //---- DEFINE OUTPUTS PRINTED BY "Finish".
   eprevious = dInitialEnergy;
   alpha_final = 0.0;
   dFinalEnergy = dInitialEnergy;
   dFinalForce2 = dInitialForce2;
-  
+
   if (dInitialForce2 < update->ftol)
     return( STOP_FORCE_TOL );
-  
+
   //---- SAVE ATOM POSITIONS BEFORE AN ITERATION.
   fix_minimize->store_box();
   for (int  i = 0; i < nvec; i++)
@@ -258,295 +258,295 @@ int MinHFTN::execute_hftn_(const bool      bPrintProgress,
       double *  xkAtom = _daExtraAtom[VEC_XK][m];
       int  n = extra_nlen[m];
       for (int  i = 0; i < n; i++)
-	xkAtom[i] = xatom[i];
+        xkAtom[i] = xatom[i];
     }
   }
   if (nextra_global)
     modify->min_store();
-  
+
   double  dXInf = calc_xinf_using_mpi_();
-  
+
   //---- FIND THE NUMBER OF UNKNOWNS.
   int  nLocalNumUnknowns = nvec + nextra_atom;
   MPI_Allreduce (&nLocalNumUnknowns, &_nNumUnknowns,
-		 1, MPI_INT, MPI_SUM, world);
-  
+                 1, MPI_INT, MPI_SUM, world);
+
   //---- INITIALIZE THE TRUST RADIUS BASED ON THE GRADIENT.
   double  dTrustRadius = 1.5 * dInitialForce2;
-  
+
   //---- TRUST RADIUS MUST KEEP STEPS FROM LETTING ATOMS MOVE SO FAR THEY
   //---- VIOLATE PHYSICS OR JUMP BEYOND A PARALLEL PROCESSING DOMAIN.
   //---- LINE SEARCH METHODS DO THIS BY RESTRICTING THE LARGEST CHANGE
   //---- OF ANY ATOM'S COMPONENT TO dmax.  AN EXACT CHECK IS MADE LATER,
   //---- BUT THIS GUIDES DETERMINATION OF A MAX TRUST RADIUS.
   double  dMaxTrustRadius = dmax * sqrt((double) _nNumUnknowns);
-  
+
   dTrustRadius = MIN (dTrustRadius, dMaxTrustRadius);
   double  dLastNewtonStep2 = dMaxTrustRadius;
-  
+
   if (bPrintProgress)
     hftn_print_line_ (false, -1, neval, dInitialEnergy, dInitialForce2,
-		      -1, dTrustRadius, 0.0, 0.0, 0.0);
-  
+                      -1, dTrustRadius, 0.0, 0.0, 0.0);
+
   bool    bHaveEvaluatedAtX = true;
   double  dCurrentEnergy    = dInitialEnergy;
   double  dCurrentForce2    = dInitialForce2;
   for (niter = 0; niter < update->nsteps; niter++) {
     (update->ntimestep)++;
-    
+
     //---- CALL THE INNER LOOP TO GET THE NEXT TRUST REGION STEP.
-    
+
     double  dCgForce2StopTol = MIN ((dCurrentForce2 / 2.0), 0.1 / (niter+1));
     dCgForce2StopTol = MAX (dCgForce2StopTol, update->ftol);
-    
+
     double  dNewEnergy;
     double  dNewForce2;
     int     nStepType;
     double  dStepLength2;
     double  dStepLengthInf;
     if (compute_inner_cg_step_ (dTrustRadius,
-				dCgForce2StopTol,
-				update->max_eval,
-				bHaveEvaluatedAtX,
-				dCurrentEnergy, dCurrentForce2,
-				dNewEnergy, dNewForce2,
-				nStepType,
-				dStepLength2, dStepLengthInf) == false) {
+                                dCgForce2StopTol,
+                                update->max_eval,
+                                bHaveEvaluatedAtX,
+                                dCurrentEnergy, dCurrentForce2,
+                                dNewEnergy, dNewForce2,
+                                nStepType,
+                                dStepLength2, dStepLengthInf) == false) {
       //---- THERE WAS AN ERROR.  RESTORE TO LAST ACCEPTED STEP.
       if (nextra_global)
-	modify->min_step (0.0, _daExtraGlobal[VEC_CG_P]);
+        modify->min_step (0.0, _daExtraGlobal[VEC_CG_P]);
       for (int i = 0; i < nvec; i++)
-	xvec[i] = _daAVectors[VEC_XK][i];
+        xvec[i] = _daAVectors[VEC_XK][i];
       if (nextra_atom) {
-	for (int  m = 0; m < nextra_atom; m++) {
-	  double *  xatom  = xextra_atom[m];
-	  double *  xkAtom = _daExtraAtom[VEC_XK][m];
-	  int  n = extra_nlen[m];
-	  for (int  i = 0; i < n; i++)
-	    xatom[i] = xkAtom[i];
-	  requestor[m]->min_x_set(m);
-	}
+        for (int  m = 0; m < nextra_atom; m++) {
+          double *  xatom  = xextra_atom[m];
+          double *  xkAtom = _daExtraAtom[VEC_XK][m];
+          int  n = extra_nlen[m];
+          for (int  i = 0; i < n; i++)
+            xatom[i] = xkAtom[i];
+          requestor[m]->min_x_set(m);
+        }
       }
       dFinalEnergy = energy_force (0);
       neval++;
       dFinalForce2 = sqrt (fnorm_sqr());
       return( STOP_ERROR );
     }
-    
+
     //---- STOP IF THE CURRENT POSITION WAS FOUND TO BE ALREADY GOOD ENOUGH.
     //---- IN THIS CASE THE ENERGY AND FORCES ARE ALREADY COMPUTED.
     if (nStepType == NO_CGSTEP_BECAUSE_F_TOL_SATISFIED) {
       if (bPrintProgress)
-	hftn_print_line_ (true, niter+1, neval, dNewEnergy, dNewForce2,
-			  nStepType, dTrustRadius, dStepLength2,
-			  0.0, 0.0);
+        hftn_print_line_ (true, niter+1, neval, dNewEnergy, dNewForce2,
+                          nStepType, dTrustRadius, dStepLength2,
+                          0.0, 0.0);
       dFinalEnergy = dNewEnergy;
       dFinalForce2 = dNewForce2;
       return( STOP_FORCE_TOL );
     }
-    
+
     //---- COMPUTE THE DIRECTIONAL DERIVATIVE H(x_k) p.
     bool  bUseForwardDiffs = (dCurrentForce2 > 1000.0 * sqrt (MACHINE_EPS));
     evaluate_dir_der_ (bUseForwardDiffs,
-		       VEC_CG_P,
-		       VEC_CG_HD,
-		       true,
-		       dCurrentEnergy);
-    
+                       VEC_CG_P,
+                       VEC_CG_HD,
+                       true,
+                       dCurrentEnergy);
+
     //---- COMPUTE p^T grad(x_k) AND SAVE IT FOR PRED.
     double  dGradDotP = calc_grad_dot_v_using_mpi_ (VEC_CG_P);
-    
+
     //---- MOVE TO THE NEW POINT AND EVALUATE ENERGY AND FORCES.
     //---- THIS IS THE PLACE WHERE energy_force IS ALLOWED TO RESET.
     for (int i = 0; i < nvec; i++)
       xvec[i] = _daAVectors[VEC_XK][i] + _daAVectors[VEC_CG_P][i];
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  xatom  = xextra_atom[m];
-	double *  xkAtom = _daExtraAtom[VEC_XK][m];
-	double *  pAtom  = _daExtraAtom[VEC_CG_P][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  xatom[i] = xkAtom[i] + pAtom[i];
-	requestor[m]->min_x_set(m);
+        double *  xatom  = xextra_atom[m];
+        double *  xkAtom = _daExtraAtom[VEC_XK][m];
+        double *  pAtom  = _daExtraAtom[VEC_CG_P][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          xatom[i] = xkAtom[i] + pAtom[i];
+        requestor[m]->min_x_set(m);
       }
     }
     if (nextra_global)
       modify->min_step (1.0, _daExtraGlobal[VEC_CG_P]);
     dNewEnergy = energy_force (1);
     neval++;
-    
+
     dNewForce2 = sqrt (fnorm_sqr());
-    
+
     double  dAred = dCurrentEnergy - dNewEnergy;
-    
+
     //---- STOP IF THE FORCE TOLERANCE IS MET.
     if (dNewForce2 < update->ftol) {
       if (bPrintProgress)
-	hftn_print_line_ (true, niter+1, neval, dNewEnergy, dNewForce2,
-			  nStepType, dTrustRadius, dStepLength2,
-			  dAred, -1.0);
+        hftn_print_line_ (true, niter+1, neval, dNewEnergy, dNewForce2,
+                          nStepType, dTrustRadius, dStepLength2,
+                          dAred, -1.0);
       //---- (IMPLICITLY ACCEPT THE LAST STEP TO THE NEW POINT.)
       dFinalEnergy = dNewEnergy;
       dFinalForce2 = dNewForce2;
       return( STOP_FORCE_TOL );
     }
-    
+
     //---- STOP IF THE ACTUAL ENERGY REDUCTION IS TINY.
     if (nStepType != CGSTEP_TO_DMAX) {
       double  dMag = 0.5 * (fabs (dCurrentEnergy) + fabs (dNewEnergy));
       dMag = MAX (dMag, MIN_ETOL_MAG);
       if (   (fabs (dAred) < (update->etol * dMag))
-	     || (dStepLengthInf == 0.0) ) {
-	if (bPrintProgress)
-	  hftn_print_line_ (true, niter+1, neval,
-			    dNewEnergy, dNewForce2,
-			    nStepType, dTrustRadius, dStepLength2,
-			    dAred, -1.0);
-	//---- (IMPLICITLY ACCEPT THE LAST STEP TO THE NEW POINT.)
-	dFinalEnergy = dNewEnergy;
-	dFinalForce2 = dNewForce2;
-	return( STOP_ENERGY_TOL );
+             || (dStepLengthInf == 0.0) ) {
+        if (bPrintProgress)
+          hftn_print_line_ (true, niter+1, neval,
+                            dNewEnergy, dNewForce2,
+                            nStepType, dTrustRadius, dStepLength2,
+                            dAred, -1.0);
+        //---- (IMPLICITLY ACCEPT THE LAST STEP TO THE NEW POINT.)
+        dFinalEnergy = dNewEnergy;
+        dFinalForce2 = dNewForce2;
+        return( STOP_ENERGY_TOL );
       }
     }
-    
+
     //---- COMPUTE THE PREDICTED REDUCTION  - p^T grad - 0.5 p^T Hp
     double  dPHP = calc_dot_prod_using_mpi_ (VEC_CG_P, VEC_CG_HD);
     double  dPred = - dGradDotP - (0.5 * dPHP);
-    
+
     //---- ACCEPT OR REJECT THE STEP PROPOSED BY THE INNER CG LOOP.
     //---- WHEN NEAR A SOLUTION, THE FORCE NORM IS PROBABLY MORE ACCURATE,
     //---- SO DON'T ACCEPT A STEP THAT REDUCES ENERGY SOME TINY AMOUNT
     //---- WHILE INCREASING THE FORCE NORM.
     bool  bStepAccepted = (dAred > 0.0)
       && (   (dNewForce2 < dCurrentForce2)
-	     || (dCurrentForce2 > 1.0e-6));
+             || (dCurrentForce2 > 1.0e-6));
     if (bStepAccepted) {
       //---- THE STEP IS ACCEPTED.
       if (bPrintProgress)
-	hftn_print_line_ (true, niter+1, neval, dNewEnergy, dNewForce2,
-			  nStepType, dTrustRadius, dStepLength2,
-			  dAred, dPred);
-      
+        hftn_print_line_ (true, niter+1, neval, dNewEnergy, dNewForce2,
+                          nStepType, dTrustRadius, dStepLength2,
+                          dAred, dPred);
+
       fix_minimize->store_box();
       modify->min_clearstore();
       for (int  i = 0; i < nvec; i++)
-	_daAVectors[VEC_XK][i] = xvec[i];
+        _daAVectors[VEC_XK][i] = xvec[i];
       if (nextra_atom) {
-	for (int  m = 0; m < nextra_atom; m++) {
-	  double *  xatom  = xextra_atom[m];
-	  double *  xkAtom = _daExtraAtom[VEC_XK][m];
-	  int  n = extra_nlen[m];
-	  for (int  i = 0; i < n; i++)
-	    xkAtom[i] = xatom[i];
-	}
+        for (int  m = 0; m < nextra_atom; m++) {
+          double *  xatom  = xextra_atom[m];
+          double *  xkAtom = _daExtraAtom[VEC_XK][m];
+          int  n = extra_nlen[m];
+          for (int  i = 0; i < n; i++)
+            xkAtom[i] = xatom[i];
+        }
       }
       if (nextra_global)
-	modify->min_store();
-      
+        modify->min_store();
+
       if (niter > 0)
-	eprevious = dCurrentEnergy;
+        eprevious = dCurrentEnergy;
       dCurrentEnergy = dNewEnergy;
       dCurrentForce2 = dNewForce2;
       bHaveEvaluatedAtX = true;
-      
+
       if (nStepType == CGSTEP_NEWTON)
-	dLastNewtonStep2 = dStepLength2;
-      
+        dLastNewtonStep2 = dStepLength2;
+
       //---- UPDATE THE TRUST REGION BASED ON AGREEMENT BETWEEN
       //---- THE ACTUAL REDUCTION AND THE PREDICTED MODEL REDUCTION.
       if ((dAred > 0.75 * dPred) && (dStepLength2 >= 0.99 * dTrustRadius))
-	dTrustRadius = 2.0 * dTrustRadius;
+        dTrustRadius = 2.0 * dTrustRadius;
       dTrustRadius = MIN (dTrustRadius, dMaxTrustRadius);
-      
+
       //---- DMAX VIOLATIONS TRUNCATE THE CG STEP WITHOUT COMPARISONS;
       //---- BETTER TO ADJUST THE TRUST REGION SO DMAX STOPS HAPPENING.
       if (nStepType == CGSTEP_TO_DMAX) {
-	if (dStepLength2 <= MACHINE_EPS)
-	  dTrustRadius = 0.1 * dTrustRadius;
-	else
-	  dTrustRadius = MIN (dTrustRadius, 2.0 * dStepLength2);
+        if (dStepLength2 <= MACHINE_EPS)
+          dTrustRadius = 0.1 * dTrustRadius;
+        else
+          dTrustRadius = MIN (dTrustRadius, 2.0 * dStepLength2);
       }
     }
     else {
       //---- THE STEP IS REJECTED.
       if (bPrintProgress)
-	hftn_print_line_ (false, niter+1, neval,
-			  dCurrentEnergy, dCurrentForce2,
-			  nStepType, dTrustRadius, dStepLength2,
-			  dAred, dPred);
-      
+        hftn_print_line_ (false, niter+1, neval,
+                          dCurrentEnergy, dCurrentForce2,
+                          nStepType, dTrustRadius, dStepLength2,
+                          dAred, dPred);
+
       //---- RESTORE THE LAST X_K POSITION.
       if (nextra_global)
-	modify->min_step (0.0, _daExtraGlobal[VEC_CG_P]);
+        modify->min_step (0.0, _daExtraGlobal[VEC_CG_P]);
       for (int  i = 0; i < nvec; i++)
-	xvec[i] = _daAVectors[VEC_XK][i];
+        xvec[i] = _daAVectors[VEC_XK][i];
       if (nextra_atom) {
-	for (int  m = 0; m < nextra_atom; m++) {
-	  double *  xatom  = xextra_atom[m];
-	  double *  xkAtom = _daExtraAtom[VEC_XK][m];
-	  int  n = extra_nlen[m];
-	  for (int  i = 0; i < n; i++)
-	    xatom[i] = xkAtom[i];
-	  requestor[m]->min_x_set(m);
-	}
+        for (int  m = 0; m < nextra_atom; m++) {
+          double *  xatom  = xextra_atom[m];
+          double *  xkAtom = _daExtraAtom[VEC_XK][m];
+          int  n = extra_nlen[m];
+          for (int  i = 0; i < n; i++)
+            xatom[i] = xkAtom[i];
+          requestor[m]->min_x_set(m);
+        }
       }
       modify->min_clearstore();
       bHaveEvaluatedAtX = false;
-      
+
       //---- UPDATE THE TRUST REGION.
       //---- EXPERIMENTS INDICATE NEGATIVE CURVATURE CAN TAKE A BAD
       //---- STEP A LONG WAY, SO BE MORE AGGRESSIVE IN THIS CASE.
       //---- ALSO, IF NEAR A SOLUTION AND DONE WITH NEWTON STEPS,
       //---- THEN REDUCE TO SOMETHING NEAR THE LAST GOOD NEWTON STEP.
       if ((nStepType == CGSTEP_NEGATIVE_CURVATURE) && (-dAred > dPred))
-	dTrustRadius = 0.10 * MIN (dTrustRadius, dStepLength2);
+        dTrustRadius = 0.10 * MIN (dTrustRadius, dStepLength2);
       else if (   (nStepType == CGSTEP_TO_DMAX)
-		  && (dStepLength2 <= MACHINE_EPS))
-	dTrustRadius = 0.10 * dTrustRadius;
+                  && (dStepLength2 <= MACHINE_EPS))
+        dTrustRadius = 0.10 * dTrustRadius;
       else if (-dAred > dPred)
-	dTrustRadius = 0.20 * MIN (dTrustRadius, dStepLength2);
+        dTrustRadius = 0.20 * MIN (dTrustRadius, dStepLength2);
       else
-	dTrustRadius = 0.25 * MIN (dTrustRadius, dStepLength2);
-      
+        dTrustRadius = 0.25 * MIN (dTrustRadius, dStepLength2);
+
       if (   (nStepType != CGSTEP_NEWTON)
-	     && (dCurrentForce2 < sqrt (MACHINE_EPS)))
-	dTrustRadius = MIN (dTrustRadius, 2.0 * dLastNewtonStep2);
-      
+             && (dCurrentForce2 < sqrt (MACHINE_EPS)))
+        dTrustRadius = MIN (dTrustRadius, 2.0 * dLastNewtonStep2);
+
       dLastNewtonStep2 = dMaxTrustRadius;
-      
+
       //---- STOP IF THE TRUST RADIUS IS TOO SMALL TO CONTINUE.
       if (   (dTrustRadius <= 0.0)
-	     || (dTrustRadius <= MACHINE_EPS * MAX (1.0, dXInf))) {
-	dFinalEnergy = dCurrentEnergy;
-	dFinalForce2 = dCurrentForce2;
-	return( STOP_TR_TOO_SMALL );
+             || (dTrustRadius <= MACHINE_EPS * MAX (1.0, dXInf))) {
+        dFinalEnergy = dCurrentEnergy;
+        dFinalForce2 = dCurrentForce2;
+        return( STOP_TR_TOO_SMALL );
       }
     }
-    
+
     //---- OUTPUT FOR thermo, dump, restart FILES.
     if (output->next == update->ntimestep) {
       //---- IF THE LAST STEP WAS REJECTED, THEN REEVALUATE ENERGY AND
       //---- FORCES AT THE OLD POINT SO THE OUTPUT DOES NOT DISPLAY
       //---- THE INCREASED ENERGY OF THE REJECTED STEP.
       if (bStepAccepted == false) {
-	dCurrentEnergy = energy_force (1);
-	neval++;
+        dCurrentEnergy = energy_force (1);
+        neval++;
       }
       timer->stamp();
       output->write (update->ntimestep);
       timer->stamp (TIME_OUTPUT);
     }
-    
+
     //---- RETURN IF NUMBER OF EVALUATIONS EXCEEDED.
     if (neval >= update->max_eval) {
       dFinalEnergy = dCurrentEnergy;
       dFinalForce2 = dCurrentForce2;
       return( STOP_MAX_FORCE_EVALS );
     }
-    
+
   }     //-- END for LOOP OVER niter
-  
+
   dFinalEnergy = dCurrentEnergy;
   dFinalForce2 = dCurrentForce2;
   return( STOP_MAX_ITER );
@@ -592,16 +592,16 @@ int MinHFTN::execute_hftn_(const bool      bPrintProgress,
 ------------------------------------------------------------------------- */
 
 bool MinHFTN::compute_inner_cg_step_(const double    dTrustRadius,
-				     const double    dForceTol,
-				     const int       nMaxEvals,
-				     const bool      bHaveEvalAtXin,
-				     const double    dEnergyAtXin,
-				     const double    dForce2AtXin,
-				     double &  dEnergyAtXout,
-				     double &  dForce2AtXout,
-				     int    &  nStepType,
-				     double &  dStepLength2,
-				     double &  dStepLengthInf)
+                                     const double    dForceTol,
+                                     const int       nMaxEvals,
+                                     const bool      bHaveEvalAtXin,
+                                     const double    dEnergyAtXin,
+                                     const double    dForce2AtXin,
+                                     double &  dEnergyAtXout,
+                                     double &  dForce2AtXout,
+                                     int    &  nStepType,
+                                     double &  dStepLength2,
+                                     double &  dStepLengthInf)
 {
   //---- SET  p_0 = 0.
   if (nextra_global) {
@@ -615,11 +615,11 @@ bool MinHFTN::compute_inner_cg_step_(const double    dTrustRadius,
       double *  pAtom = _daExtraAtom[VEC_CG_P][m];
       int  n = extra_nlen[m];
       for (int  i = 0; i < n; i++)
-	pAtom[i] = 0.0;
+        pAtom[i] = 0.0;
     }
   }
   double  dPP = 0.0;
-  
+
   //---- OBTAIN THE ENERGY AND FORCES AT THE INPUT POSITION.
   double  dEnergyAtX = dEnergyAtXin;
   double  dForce2AtX = dForce2AtXin;
@@ -628,7 +628,7 @@ bool MinHFTN::compute_inner_cg_step_(const double    dTrustRadius,
     neval++;
     dForce2AtX = sqrt (fnorm_sqr());
   }
-  
+
   //---- RETURN IMMEDIATELY IF THE FORCE TOLERANCE IS ALREADY MET.
   //---- THE STEP TYPE INFORMS THE CALLER THAT ENERGY AND FORCES HAVE
   //---- BEEN EVALUATED.
@@ -640,7 +640,7 @@ bool MinHFTN::compute_inner_cg_step_(const double    dTrustRadius,
     dStepLengthInf = 0.0;
     return( true );
   }
-  
+
   //---- r_0 = -grad  (FIRST SEARCH DIRECTION IS STEEPEST DESCENT)
   //---- d_0 = r_0
   //---- REMEMBER THAT FORCES = -GRADIENT.
@@ -661,14 +661,14 @@ bool MinHFTN::compute_inner_cg_step_(const double    dTrustRadius,
       double *  dAtom = _daExtraAtom[VEC_CG_D][m];
       int  n = extra_nlen[m];
       for (int  i = 0; i < n; i++) {
-	rAtom[i] = fatom[i];
-	dAtom[i] = fatom[i];
+        rAtom[i] = fatom[i];
+        dAtom[i] = fatom[i];
       }
     }
   }
   double  dRR = dForce2AtX * dForce2AtX;
   double  dR0norm2 = sqrt (dRR);
-  
+
   //---- LIMIT THE NUMBER OF INNER CG ITERATIONS.
   //---- BASE IT ON THE NUMBER OF UNKNOWNS, OR MAXIMUM EVALUATIONS ASSUMING
   //---- FORWARD DIFFERENCES ARE USED.
@@ -678,92 +678,92 @@ bool MinHFTN::compute_inner_cg_step_(const double    dTrustRadius,
     nLimit1 = MIN (_nNumUnknowns, 100);
   int  nLimit2 = (nMaxEvals - neval) / 2;
   int  nMaxInnerIters = MIN (nLimit1, nLimit2);
-  
+
   //---- FURTHER LIMIT ITERATIONS IF NEAR MACHINE ROUNDOFF.
   //---- THE METHOD CAN WASTE A LOT EVALUATIONS WITH LITTLE PAYOFF PROSPECT.
   if (dForce2AtX < (sqrt (MACHINE_EPS) * MAX (1.0, fabs (dEnergyAtX))) )
     nMaxInnerIters = MIN (nMaxInnerIters, _nNumUnknowns / 20);
-  
+
   bool  bUseForwardDiffs = (dForce2AtX > 1000.0 * sqrt (MACHINE_EPS));
-  
+
   //---- MAIN CG LOOP.
   for (int  nInnerIter = 0; nInnerIter < nMaxInnerIters; nInnerIter++) {
     //---- COMPUTE HESSIAN-VECTOR PRODUCT:  H(x_k) d_i.
     double  dDummyEnergy;
     evaluate_dir_der_ (bUseForwardDiffs,
-		       VEC_CG_D,
-		       VEC_CG_HD,
-		       false,
-		       dDummyEnergy);
-    
+                       VEC_CG_D,
+                       VEC_CG_HD,
+                       false,
+                       dDummyEnergy);
+
     //---- CALCULATE  d_i^T H d_i AND d_i^T d_i.
     double  dDHD;
     double  dDD;
     calc_dhd_dd_using_mpi_ (dDHD, dDD);
-    
+
     //---- HANDLE NEGATIVE CURVATURE.
     if (dDHD <= (MACHINE_EPS * dDD)) {
       //---- PROJECT BOTH DIRECTIONS TO THE TRUST RADIUS AND DECIDE
       //---- WHICH MAKES A BETTER PREDICTED REDUCTION.
       //---- p_i^T H(x_k) d_i AND grad_i^T d_i.
-      
+
       double  dPdotD  = calc_dot_prod_using_mpi_ (VEC_CG_P, VEC_CG_D);
       double  dPdotHD = calc_dot_prod_using_mpi_ (VEC_CG_P, VEC_CG_HD);
-      
+
       //---- MOVE TO X_K AND COMPUTE ENERGY AND FORCES.
       if (nextra_global)
-	modify->min_step (0.0, _daExtraGlobal[VEC_CG_P]);
+        modify->min_step (0.0, _daExtraGlobal[VEC_CG_P]);
       for (int  i = 0; i < nvec; i++)
-	xvec[i] = _daAVectors[VEC_XK][i];
+        xvec[i] = _daAVectors[VEC_XK][i];
       if (nextra_atom) {
-	for (int  m = 0; m < nextra_atom; m++) {
-	  double *  xatom  = xextra_atom[m];
-	  double *  xkAtom = _daExtraAtom[VEC_XK][m];
-	  int  n = extra_nlen[m];
-	  for (int  i = 0; i < n; i++)
-	    xatom[i] = xkAtom[i];
-	  requestor[m]->min_x_set(m);
-	}
+        for (int  m = 0; m < nextra_atom; m++) {
+          double *  xatom  = xextra_atom[m];
+          double *  xkAtom = _daExtraAtom[VEC_XK][m];
+          int  n = extra_nlen[m];
+          for (int  i = 0; i < n; i++)
+            xatom[i] = xkAtom[i];
+          requestor[m]->min_x_set(m);
+        }
       }
       dEnergyAtX = energy_force (0);
       neval++;
-      
+
       double  dGradDotD = calc_grad_dot_v_using_mpi_ (VEC_CG_D);
-      
+
       double  tau = compute_to_tr_ (dPP, dPdotD, dDD, dTrustRadius,
-				    true, dDHD, dPdotHD, dGradDotD);
-      
+                                    true, dDHD, dPdotHD, dGradDotD);
+
       //---- MOVE THE POINT.
       if (nextra_global) {
-	double *  pGlobal = _daExtraGlobal[VEC_CG_P];
-	double *  dGlobal = _daExtraGlobal[VEC_CG_D];
-	for (int  i = 0; i < nextra_global; i++) {
-	  pGlobal[i] += tau * dGlobal[i];
-	}
+        double *  pGlobal = _daExtraGlobal[VEC_CG_P];
+        double *  dGlobal = _daExtraGlobal[VEC_CG_D];
+        for (int  i = 0; i < nextra_global; i++) {
+          pGlobal[i] += tau * dGlobal[i];
+        }
       }
       for (int  i = 0; i < nvec; i++)
-	_daAVectors[VEC_CG_P][i] += tau * _daAVectors[VEC_CG_D][i];
+        _daAVectors[VEC_CG_P][i] += tau * _daAVectors[VEC_CG_D][i];
       if (nextra_atom) {
-	for (int  m = 0; m < nextra_atom; m++) {
-	  double *  pAtom = _daExtraAtom[VEC_CG_P][m];
-	  double *  dAtom = _daExtraAtom[VEC_CG_D][m];
-	  int  n = extra_nlen[m];
-	  for (int  i = 0; i < n; i++)
-	    pAtom[i] += tau * dAtom[i];
-	}
+        for (int  m = 0; m < nextra_atom; m++) {
+          double *  pAtom = _daExtraAtom[VEC_CG_P][m];
+          double *  dAtom = _daExtraAtom[VEC_CG_D][m];
+          int  n = extra_nlen[m];
+          for (int  i = 0; i < n; i++)
+            pAtom[i] += tau * dAtom[i];
+        }
       }
-      
+
       nStepType = CGSTEP_NEGATIVE_CURVATURE;
       calc_plengths_using_mpi_ (dStepLength2, dStepLengthInf);
       return( true );
     }
-    
+
     //---- COMPUTE THE OPTIMAL STEP LENGTH BASED ON THE QUADRATIC CG MODEL.
     double  dAlpha = dRR / dDHD;
-    
+
     //---- MIGHT WANT TO ENABLE THIS TO DEBUG INTERNAL CG STEPS.
     //fprintf (_fpPrint, "     alpha = %11.8f  neval=%4d\n", dAlpha, neval);
-    
+
     //---- p_i+1 = p_i + alpha_i d_i
     //---- (SAVE THE CURRENT p_i IN CASE THE STEP HAS TO BE SHORTENED.)
     if (nextra_global) {
@@ -771,8 +771,8 @@ bool MinHFTN::compute_inner_cg_step_(const double    dTrustRadius,
       double *  dGlobal  = _daExtraGlobal[VEC_CG_D];
       double *  d1Global = _daExtraGlobal[VEC_DIF1];
       for (int  i = 0; i < nextra_global; i++) {
-	d1Global[i] = pGlobal[i];
-	pGlobal[i] += dAlpha * dGlobal[i];
+        d1Global[i] = pGlobal[i];
+        pGlobal[i] += dAlpha * dGlobal[i];
       }
     }
     for (int  i = 0; i < nvec; i++) {
@@ -781,24 +781,24 @@ bool MinHFTN::compute_inner_cg_step_(const double    dTrustRadius,
     }
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  pAtom  = _daExtraAtom[VEC_CG_P][m];
-	double *  dAtom  = _daExtraAtom[VEC_CG_D][m];
-	double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++) {
-	  d1Atom[i] = pAtom[i];
-	  pAtom[i] += dAlpha * dAtom[i];
-	}
+        double *  pAtom  = _daExtraAtom[VEC_CG_P][m];
+        double *  dAtom  = _daExtraAtom[VEC_CG_D][m];
+        double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++) {
+          d1Atom[i] = pAtom[i];
+          pAtom[i] += dAlpha * dAtom[i];
+        }
       }
     }
-    
+
     //---- COMPUTE VECTOR PRODUCTS  p_i+1^T p_i+1 AND p_i^T d_i.
     double  dPnewDotPnew;
     double  dPoldDotD;
     calc_ppnew_pdold_using_mpi_ (dPnewDotPnew, dPoldDotD);
-    
+
     nStepType = CGSTEP_UNDETERMINED;
-    
+
     //---- IF STEP LENGTH IS TOO LARGE, THEN REDUCE IT AND RETURN.
     double  tau;
     if (step_exceeds_TR_ (dTrustRadius, dPP, dPoldDotD, dDD, tau)) {
@@ -813,36 +813,36 @@ bool MinHFTN::compute_inner_cg_step_(const double    dTrustRadius,
       calc_plengths_using_mpi_ (dStepLength2, dStepLengthInf);
       return( true );
     }
-    
+
     dStepLength2 = sqrt (dPnewDotPnew);
-    
+
     //---- r_i+1 = r_i - alpha * H d_i
     if (nextra_global) {
       double *  rGlobal  = _daExtraGlobal[VEC_CG_R];
       double *  hdGlobal = _daExtraGlobal[VEC_CG_HD];
       for (int  i = 0; i < nextra_global; i++)
-	rGlobal[i] -= dAlpha * hdGlobal[i];
+        rGlobal[i] -= dAlpha * hdGlobal[i];
     }
     for (int  i = 0; i < nvec; i++)
       _daAVectors[VEC_CG_R][i] -= dAlpha * _daAVectors[VEC_CG_HD][i];
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  rAtom  = _daExtraAtom[VEC_CG_R][m];
-	double *  hdAtom = _daExtraAtom[VEC_CG_HD][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  rAtom[i] -= dAlpha * hdAtom[i];
+        double *  rAtom  = _daExtraAtom[VEC_CG_R][m];
+        double *  hdAtom = _daExtraAtom[VEC_CG_HD][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          rAtom[i] -= dAlpha * hdAtom[i];
       }
     }
     double  dRnewDotRnew = calc_dot_prod_using_mpi_ (VEC_CG_R, VEC_CG_R);
-    
+
     //---- IF RESIDUAL IS SMALL ENOUGH, THEN RETURN THE CURRENT STEP.
     if (sqrt (dRnewDotRnew) < dForceTol * dR0norm2) {
       nStepType = CGSTEP_NEWTON;
       calc_plengths_using_mpi_ (dStepLength2, dStepLengthInf);
       return( true );
     }
-    
+
     //---- beta = r_i+1^T r_i+1 / r_i^T r_i
     //---- d_i+1 = r_i+1 + beta d_i
     double  dBeta = dRnewDotRnew / dRR;
@@ -850,29 +850,29 @@ bool MinHFTN::compute_inner_cg_step_(const double    dTrustRadius,
       double *  rGlobal = _daExtraGlobal[VEC_CG_R];
       double *  dGlobal = _daExtraGlobal[VEC_CG_D];
       for (int  i = 0; i < nextra_global; i++)
-	dGlobal[i] = rGlobal[i] + dBeta * dGlobal[i];
+        dGlobal[i] = rGlobal[i] + dBeta * dGlobal[i];
     }
     for (int  i = 0; i < nvec; i++)
       _daAVectors[VEC_CG_D][i] = _daAVectors[VEC_CG_R][i]
-	+ dBeta * _daAVectors[VEC_CG_D][i];
+        + dBeta * _daAVectors[VEC_CG_D][i];
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  rAtom = _daExtraAtom[VEC_CG_R][m];
-	double *  dAtom = _daExtraAtom[VEC_CG_D][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  dAtom[i] = rAtom[i] + dBeta * dAtom[i];
+        double *  rAtom = _daExtraAtom[VEC_CG_R][m];
+        double *  dAtom = _daExtraAtom[VEC_CG_D][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          dAtom[i] = rAtom[i] + dBeta * dAtom[i];
       }
     }
-    
+
     //---- CONTINUE THE LOOP.
     dRR = dRnewDotRnew;
     dPP = dPnewDotPnew;
   }
-  
+
   nStepType = CGSTEP_MAX_INNER_ITERS;
   calc_plengths_using_mpi_ (dStepLength2, dStepLengthInf);
-  return( true );    
+  return( true );
 }
 
 /* ----------------------------------------------------------------------
@@ -884,24 +884,24 @@ double MinHFTN::calc_xinf_using_mpi_(void) const
   double dXInfLocal = 0.0;
   for (int  i = 0; i < nvec; i++)
     dXInfLocal = MAX(dXInfLocal,fabs(xvec[i]));
-  
+
   double  dXInf;
   MPI_Allreduce (&dXInfLocal, &dXInf, 1, MPI_DOUBLE, MPI_MAX, world);
-  
+
   if (nextra_atom) {
     for (int  m = 0; m < nextra_atom; m++) {
       double *  xatom = xextra_atom[m];
       int  n = extra_nlen[m];
       double  dXInfLocalExtra = 0.0;
       for (int  i = 0; i < n; i++)
-	dXInfLocalExtra = MAX (dXInfLocalExtra, fabs (xatom[i]));
+        dXInfLocalExtra = MAX (dXInfLocalExtra, fabs (xatom[i]));
       double  dXInfExtra;
       MPI_Allreduce (&dXInfLocalExtra, &dXInfExtra,
-		     1, MPI_DOUBLE, MPI_MAX, world);
+                     1, MPI_DOUBLE, MPI_MAX, world);
       dXInf = MAX (dXInf, dXInfExtra);
     }
   }
-  
+
   return( dXInf );
 }
 
@@ -911,7 +911,7 @@ double MinHFTN::calc_xinf_using_mpi_(void) const
 ------------------------------------------------------------------------- */
 
 double MinHFTN::calc_dot_prod_using_mpi_(const int  nIx1,
-					  const int  nIx2) const
+                                          const int  nIx2) const
 {
   double dDotLocal = 0.0;
   for (int  i = 0; i < nvec; i++)
@@ -922,13 +922,13 @@ double MinHFTN::calc_dot_prod_using_mpi_(const int  nIx1,
       double *  i2Atom = _daExtraAtom[nIx2][m];
       int  n = extra_nlen[m];
       for (int  i = 0; i < n; i++)
-	dDotLocal += i1Atom[i] * i2Atom[i];
+        dDotLocal += i1Atom[i] * i2Atom[i];
     }
   }
-  
+
   double  dDot;
   MPI_Allreduce (&dDotLocal, &dDot, 1, MPI_DOUBLE, MPI_SUM, world);
-  
+
   if (nextra_global) {
     for (int  i = 0; i < nextra_global; i++) {
       double *  i1Global = _daExtraGlobal[nIx1];
@@ -936,7 +936,7 @@ double MinHFTN::calc_dot_prod_using_mpi_(const int  nIx1,
       dDot += i1Global[i] * i2Global[i];
     }
   }
-  
+
   return( dDot );
 }
 
@@ -948,7 +948,7 @@ double MinHFTN::calc_grad_dot_v_using_mpi_(const int  nIx) const
 {
   //---- ASSUME THAT FORCES HAVE BEEN EVALUATED AT DESIRED ATOM POSITIONS.
   //---- REMEMBER THAT FORCES = -GRADIENT.
-  
+
   double dGradDotVLocal = 0.0;
   for (int i = 0; i < nvec; i++)
     dGradDotVLocal += - _daAVectors[nIx][i] * fvec[i];
@@ -958,20 +958,20 @@ double MinHFTN::calc_grad_dot_v_using_mpi_(const int  nIx) const
       double *  iAtom = _daExtraAtom[nIx][m];
       int  n = extra_nlen[m];
       for (int i = 0; i < n; i++)
-	dGradDotVLocal += - iAtom[i] * fatom[i];
+        dGradDotVLocal += - iAtom[i] * fatom[i];
     }
   }
-  
+
   double  dGradDotV;
   MPI_Allreduce (&dGradDotVLocal, &dGradDotV, 1, MPI_DOUBLE, MPI_SUM, world);
-  
+
   if (nextra_global) {
     for (int  i = 0; i < nextra_global; i++) {
       double *  iGlobal = _daExtraGlobal[nIx];
       dGradDotV += - iGlobal[i] * fextra[i];
     }
   }
-  
+
   return( dGradDotV );
 }
 
@@ -980,7 +980,7 @@ double MinHFTN::calc_grad_dot_v_using_mpi_(const int  nIx) const
 ------------------------------------------------------------------------- */
 
 void MinHFTN::calc_dhd_dd_using_mpi_(double &  dDHD,
-				     double &  dDD) const
+                                     double &  dDD) const
 {
   double dDHDLocal = 0.0;
   double dDDLocal  = 0.0;
@@ -994,18 +994,18 @@ void MinHFTN::calc_dhd_dd_using_mpi_(double &  dDHD,
       double *  hdAtom = _daExtraAtom[VEC_CG_HD][m];
       int  n = extra_nlen[m];
       for (int  i = 0; i < n; i++) {
-	dDHDLocal += dAtom[i] * hdAtom[i];
-	dDDLocal += dAtom[i] * dAtom[i];
+        dDHDLocal += dAtom[i] * hdAtom[i];
+        dDDLocal += dAtom[i] * dAtom[i];
       }
     }
   }
-  
+
   double  daDotsLocal[2];
   daDotsLocal[0] = dDHDLocal;
   daDotsLocal[1] = dDDLocal;
   double  daDots[2];
   MPI_Allreduce (daDotsLocal, daDots, 2, MPI_DOUBLE, MPI_SUM, world);
-  
+
   if (nextra_global) {
     double *  dGlobal  = _daExtraGlobal[VEC_CG_D];
     double *  hdGlobal = _daExtraGlobal[VEC_CG_HD];
@@ -1016,7 +1016,7 @@ void MinHFTN::calc_dhd_dd_using_mpi_(double &  dDHD,
   }
   dDHD = daDots[0];
   dDD  = daDots[1];
-  
+
   return;
 }
 
@@ -1025,7 +1025,7 @@ void MinHFTN::calc_dhd_dd_using_mpi_(double &  dDHD,
 ------------------------------------------------------------------------- */
 
 void MinHFTN::calc_ppnew_pdold_using_mpi_(double &  dPnewDotPnew,
-					  double &  dPoldDotD) const
+                                          double &  dPoldDotD) const
 {
   double dPnewDotPnewLocal = 0.0;
   double dPoldDotDLocal    = 0.0;
@@ -1042,18 +1042,18 @@ void MinHFTN::calc_ppnew_pdold_using_mpi_(double &  dPnewDotPnew,
       double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
       int  n = extra_nlen[m];
       for (int  i = 0; i < n; i++) {
-	dPnewDotPnewLocal += pAtom[i] * pAtom[i];
-	dPoldDotDLocal += d1Atom[i] * dAtom[i];
+        dPnewDotPnewLocal += pAtom[i] * pAtom[i];
+        dPoldDotDLocal += d1Atom[i] * dAtom[i];
       }
     }
   }
-  
+
   double  daDotsLocal[2];
   daDotsLocal[0] = dPnewDotPnewLocal;
   daDotsLocal[1] = dPoldDotDLocal;
   double  daDots[2];
   MPI_Allreduce (daDotsLocal, daDots, 2, MPI_DOUBLE, MPI_SUM, world);
-  
+
   if (nextra_global) {
     for (int  i = 0; i < nextra_global; i++) {
       double *  dGlobal  = _daExtraGlobal[VEC_CG_D];
@@ -1063,10 +1063,10 @@ void MinHFTN::calc_ppnew_pdold_using_mpi_(double &  dPnewDotPnew,
       daDots[1] += d1Global[i] * dGlobal[i];
     }
   }
-  
+
   dPnewDotPnew = daDots[0];
   dPoldDotD    = daDots[1];
-  
+
   return;
 }
 
@@ -1075,7 +1075,7 @@ void MinHFTN::calc_ppnew_pdold_using_mpi_(double &  dPnewDotPnew,
 ------------------------------------------------------------------------- */
 
 void MinHFTN::calc_plengths_using_mpi_(double &  dStepLength2,
-				       double &  dStepLengthInf) const
+                                       double &  dStepLengthInf) const
 {
   double dPPLocal   = 0.0;
   double dPInfLocal = 0.0;
@@ -1088,18 +1088,18 @@ void MinHFTN::calc_plengths_using_mpi_(double &  dStepLength2,
       double *  pAtom = _daExtraAtom[VEC_CG_P][m];
       int  n = extra_nlen[m];
       for (int  i = 0; i < n; i++) {
-	dPPLocal += pAtom[i] * pAtom[i];
-	dPInfLocal = MAX (dPInfLocal, fabs (pAtom[i]));
+        dPPLocal += pAtom[i] * pAtom[i];
+        dPInfLocal = MAX (dPInfLocal, fabs (pAtom[i]));
       }
     }
   }
-  
+
   double  dPP;
   MPI_Allreduce (&dPPLocal, &dPP, 1, MPI_DOUBLE, MPI_SUM, world);
-  
+
   double  dPInf;
   MPI_Allreduce (&dPInfLocal, &dPInf, 1, MPI_DOUBLE, MPI_MAX, world);
-  
+
   if (nextra_global) {
     for (int  i = 0; i < nextra_global; i++) {
       double *  pGlobal = _daExtraGlobal[VEC_CG_P];
@@ -1107,7 +1107,7 @@ void MinHFTN::calc_plengths_using_mpi_(double &  dStepLength2,
       dPInf = MAX (dPInf, fabs (pGlobal[i]));
     }
   }
-  
+
   dStepLength2 = sqrt (dPP);
   dStepLengthInf = dPInf;
   return;
@@ -1118,21 +1118,21 @@ void MinHFTN::calc_plengths_using_mpi_(double &  dStepLength2,
 ------------------------------------------------------------------------- */
 
 bool MinHFTN::step_exceeds_TR_(const double    dTrustRadius,
-			       const double    dPP,
-			       const double    dPD,
-			       const double    dDD,
-			       double &  dTau) const
+                               const double    dPP,
+                               const double    dPD,
+                               const double    dDD,
+                               double &  dTau) const
 {
   double  dPnewNorm2;
   double  dPnewNormInf;
   calc_plengths_using_mpi_ (dPnewNorm2, dPnewNormInf);
-  
+
   if (dPnewNorm2 > dTrustRadius) {
     dTau = compute_to_tr_ (dPP, dPD, dDD, dTrustRadius,
-			   false, 0.0, 0.0, 0.0);
+                           false, 0.0, 0.0, 0.0);
     return( true );
   }
-  
+
   //---- STEP LENGTH IS NOT TOO LONG.
   dTau = 0.0;
   return( false );
@@ -1151,7 +1151,7 @@ bool MinHFTN::step_exceeds_TR_(const double    dTrustRadius,
 bool MinHFTN::step_exceeds_DMAX_(void) const
 {
   double  dAlpha = dmax * sqrt((double) _nNumUnknowns);
-  
+
   double  dPInfLocal = 0.0;
   for (int  i = 0; i < nvec; i++)
     dPInfLocal = MAX (dPInfLocal, fabs (_daAVectors[VEC_CG_P][i]));
@@ -1161,22 +1161,22 @@ bool MinHFTN::step_exceeds_DMAX_(void) const
     return( true );
   if (dPInf > MACHINE_EPS)
     dAlpha = MIN (dAlpha, dmax / dPInf);
-  
+
   if (nextra_atom) {
     for (int  m = 0; m < nextra_atom; m++) {
       double *  pAtom = _daExtraAtom[VEC_CG_P][m];
       dPInfLocal = 0.0;
       int  n = extra_nlen[m];
       for (int  i = 0; i < n; i++)
-	dPInfLocal = MAX (dPInfLocal, fabs (pAtom[i]));
+        dPInfLocal = MAX (dPInfLocal, fabs (pAtom[i]));
       MPI_Allreduce (&dPInfLocal, &dPInf, 1, MPI_DOUBLE, MPI_MAX, world);
       if (dPInf > extra_max[m])
-	return( true );
+        return( true );
       if (dPInf > MACHINE_EPS)
-	dAlpha = MIN (dAlpha, extra_max[m] / dPInf);
+        dAlpha = MIN (dAlpha, extra_max[m] / dPInf);
     }
   }
-  
+
   if (nextra_global) {
     //---- IF THE MAXIMUM DISTANCE THAT THE GLOBAL BOX CONSTRAINT WILL
     //---- ALLOW IS SMALLER THAN THE PROPOSED DISTANCE, THEN THE STEP
@@ -1185,7 +1185,7 @@ bool MinHFTN::step_exceeds_DMAX_(void) const
     if (dAlphaExtra < dAlpha)
       return( true );
   }
-  
+
   //---- STEP LENGTH IS NOT TOO LONG.
   return( false );
 }
@@ -1215,7 +1215,7 @@ void MinHFTN::adjust_step_to_tau_(const double tau)
       double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
       int  n = extra_nlen[m];
       for (int  i = 0; i < n; i++)
-	pAtom[i] = d1Atom[i] + (tau * dAtom[i]);
+        pAtom[i] = d1Atom[i] + (tau * dAtom[i]);
     }
   }
   return;
@@ -1240,41 +1240,41 @@ void MinHFTN::adjust_step_to_tau_(const double tau)
 ------------------------------------------------------------------------- */
 
 double MinHFTN::compute_to_tr_(const double  dPP,
-			       const double  dPD,
-			       const double  dDD,
-			       const double  dTrustRadius,
-			       const bool    bConsiderBothRoots,
-			       const double  dDHD,
-			       const double  dPdotHD,
-			       const double  dGradDotD) const
+                               const double  dPD,
+                               const double  dDD,
+                               const double  dTrustRadius,
+                               const bool    bConsiderBothRoots,
+                               const double  dDHD,
+                               const double  dPdotHD,
+                               const double  dGradDotD) const
 {
   //---- SOLVE A QUADRATIC EQUATION FOR TAU.
   //---- THE COEFFICIENTS ARE SUCH THAT THERE ARE ALWAYS TWO REAL ROOTS,
   //---- ONE POSITIVE AND ONE NEGATIVE.
-  
+
   //---- CHECK FOR ERRONEOUS DATA.
   if (   (dDD <= 0.0) || (dPP < 0.0) || (dTrustRadius < 0.0)
-	 || (dTrustRadius * dTrustRadius < dPP) ) {
+         || (dTrustRadius * dTrustRadius < dPP) ) {
     printf ("HFTN internal error - bad data given to compute_to_tr_()\n");
     return( 0.0 );
   }
-  
+
   double  dTRsqrd = dTrustRadius * dTrustRadius;
   double  dDiscr = (dPD * dPD) - (dDD * (dPP - dTRsqrd));
   dDiscr = MAX (0.0, dDiscr);    //-- SHOULD NEVER BE NEGATIVE
   dDiscr = sqrt (dDiscr);
-  
+
   double  dRootPos = (-dPD + dDiscr) / dDD;
   double  dRootNeg = (-dPD - dDiscr) / dDD;
-  
+
   if (bConsiderBothRoots == false)
     return( dRootPos );
-  
+
   //---- EVALUATE THE CG OBJECTIVE FUNCTION FOR EACH ROOT.
   double  dTmpTerm = dGradDotD + dPdotHD;
   double  dCgRedPos = (dRootPos * dTmpTerm) + (0.5 * dRootPos*dRootPos * dDHD);
   double  dCgRedNeg = (dRootNeg * dTmpTerm) + (0.5 * dRootNeg*dRootNeg * dDHD);
-  
+
   if ((-dCgRedPos) > (-dCgRedNeg))
     return( dRootPos );
   else
@@ -1286,7 +1286,7 @@ double MinHFTN::compute_to_tr_(const double  dPP,
    Compute the directional derivative using a finite difference approximation.
    This is equivalent to the Hessian times direction vector p.
    As a side effect, the method computes the energy and forces at x.
- 
+
    On input these must be defined:
      atom->x   - positions at x
      atom->f   - ignored
@@ -1300,7 +1300,7 @@ double MinHFTN::compute_to_tr_(const double  dPP,
    During processing these are modified:
      VEC_DIF1
      VEC_DIF2
- 
+
    @param[in] bUseForwardDiffs - if true use forward difference approximation,
                                  else use central difference
    @param[in] nIxDir           - VEC_ index of the direction
@@ -1312,10 +1312,10 @@ double MinHFTN::compute_to_tr_(const double  dPP,
 ------------------------------------------------------------------------- */
 
 void MinHFTN::evaluate_dir_der_(const bool      bUseForwardDiffs,
-				const int       nIxDir,
-				const int       nIxResult,
-				const bool      bEvaluateAtX,
-				double &  dNewEnergy)
+                                const int       nIxDir,
+                                const int       nIxResult,
+                                const bool      bEvaluateAtX,
+                                double &  dNewEnergy)
 {
   //---- COMPUTE THE MAGNITUDE OF THE DIRECTION VECTOR:  |p|_2.
   double dDirNorm2SqrdLocal = 0.0;
@@ -1327,12 +1327,12 @@ void MinHFTN::evaluate_dir_der_(const bool      bUseForwardDiffs,
       double *  iAtom = _daExtraAtom[nIxDir][m];
       int  n = extra_nlen[m];
       for (int  i = 0; i < n; i++)
-	dDirNorm2SqrdLocal += iAtom[i] * iAtom[i];
+        dDirNorm2SqrdLocal += iAtom[i] * iAtom[i];
     }
   }
   double  dDirNorm2Sqrd = 0.0;
   MPI_Allreduce (&dDirNorm2SqrdLocal, &dDirNorm2Sqrd,
-		 1, MPI_DOUBLE, MPI_SUM, world);
+                 1, MPI_DOUBLE, MPI_SUM, world);
   if (nextra_global) {
     for (int  i = 0; i < nextra_global; i++) {
       double *  iGlobal = _daExtraGlobal[nIxDir];
@@ -1340,58 +1340,58 @@ void MinHFTN::evaluate_dir_der_(const bool      bUseForwardDiffs,
     }
   }
   double  dDirNorm2 = sqrt (dDirNorm2Sqrd);
-  
+
   //---- IF THE STEP IS TOO SMALL, RETURN ZERO FOR THE DERIVATIVE.
   if (dDirNorm2 == 0.0) {
     for (int  i = 0; i < nvec; i++)
       _daAVectors[nIxResult][i] = 0.0;
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  iAtom = _daExtraAtom[nIxDir][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  iAtom[i] = 0;
+        double *  iAtom = _daExtraAtom[nIxDir][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          iAtom[i] = 0;
       }
     }
     if (nextra_global) {
       for (int  i = 0; i < nextra_global; i++)
-	_daExtraGlobal[nIxDir][i] = 0.0;
+        _daExtraGlobal[nIxDir][i] = 0.0;
     }
-    
+
     if (bEvaluateAtX) {
       dNewEnergy = energy_force (0);
       neval++;
     }
-    
+
     return;
   }
-  
+
   //---- FORWARD DIFFERENCES ARE LESS ACCURATE THAN CENTRAL DIFFERENCES,
   //---- BUT REQUIRE ONLY 2 ENERGY+FORCE EVALUATIONS VERSUS 3 EVALUATIONS.
   //---- STORAGE REQUIREMENTS ARE THE SAME.
-  
+
   if (bUseForwardDiffs) {
     //---- EQUATION IS FROM THE OLD LAMMPS VERSION, SAND98-8201.
     double  dEps = 2.0 * sqrt (1000.0 * MACHINE_EPS) / dDirNorm2;
-    
+
     //---- SAVE A COPY OF x.
     fix_minimize->store_box();
     for (int  i = 0; i < nvec; i++)
       _daAVectors[VEC_DIF1][i] = xvec[i];
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  xatom  = xextra_atom[m];
-	double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  d1Atom[i] = xatom[i];
+        double *  xatom  = xextra_atom[m];
+        double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          d1Atom[i] = xatom[i];
       }
     }
     if (nextra_global) {
       modify->min_pushstore();
       modify->min_store();
     }
-    
+
     //---- EVALUATE FORCES AT x + eps*p.
     if (nextra_global)
       modify->min_step (dEps, _daExtraGlobal[nIxDir]);
@@ -1399,34 +1399,34 @@ void MinHFTN::evaluate_dir_der_(const bool      bUseForwardDiffs,
       xvec[i] += dEps * _daAVectors[nIxDir][i];
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  xatom = xextra_atom[m];
-	double *  iAtom = _daExtraAtom[nIxDir][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  xatom[i] += dEps * iAtom[i];
-	requestor[m]->min_x_set(m);
+        double *  xatom = xextra_atom[m];
+        double *  iAtom = _daExtraAtom[nIxDir][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          xatom[i] += dEps * iAtom[i];
+        requestor[m]->min_x_set(m);
       }
     }
     energy_force (0);
     neval++;
-    
+
     //---- STORE THE FORCE IN DIF2.
     if (nextra_global) {
       for (int  i = 0; i < nextra_global; i++)
-	_daExtraGlobal[VEC_DIF2][i] = fextra[i];
+        _daExtraGlobal[VEC_DIF2][i] = fextra[i];
     }
     for (int  i = 0; i < nvec; i++)
       _daAVectors[VEC_DIF2][i] = fvec[i];
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  fatom  = fextra_atom[m];
-	double *  d2Atom = _daExtraAtom[VEC_DIF2][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  d2Atom[i] = fatom[i];
+        double *  fatom  = fextra_atom[m];
+        double *  d2Atom = _daExtraAtom[VEC_DIF2][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          d2Atom[i] = fatom[i];
       }
     }
-    
+
     //---- MOVE BACK TO x AND EVALUATE FORCES.
     if (nextra_global) {
       modify->min_step (0.0, _daExtraGlobal[VEC_DIF1]);
@@ -1436,59 +1436,59 @@ void MinHFTN::evaluate_dir_der_(const bool      bUseForwardDiffs,
       xvec[i] = _daAVectors[VEC_DIF1][i];
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  xatom  = xextra_atom[m];
-	double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  xatom[i] += d1Atom[i];
-	requestor[m]->min_x_set(m);
+        double *  xatom  = xextra_atom[m];
+        double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          xatom[i] += d1Atom[i];
+        requestor[m]->min_x_set(m);
       }
     }
     dNewEnergy = energy_force (0);
     neval++;
-    
+
     //---- COMPUTE THE DIFFERENCE VECTOR:  [grad(x + eps*p) - grad(x)] / eps.
     //---- REMEMBER THAT FORCES = -GRADIENT.
     for (int  i = 0; i < nvec; i++)
       _daAVectors[nIxResult][i] = (fvec[i] - _daAVectors[VEC_DIF2][i]) / dEps;
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  iAtom  = _daExtraAtom[nIxResult][m];
-	double *  d2Atom = _daExtraAtom[VEC_DIF2][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  iAtom[i] = (fextra_atom[m][i] - d2Atom[i]) / dEps;
+        double *  iAtom  = _daExtraAtom[nIxResult][m];
+        double *  d2Atom = _daExtraAtom[VEC_DIF2][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          iAtom[i] = (fextra_atom[m][i] - d2Atom[i]) / dEps;
       }
     }
     if (nextra_global) {
       for (int  i = 0; i < nextra_global; i++)
-	_daExtraGlobal[nIxResult][i]
-	  = (fextra[i] - _daExtraGlobal[VEC_DIF2][i]) / dEps;
+        _daExtraGlobal[nIxResult][i]
+          = (fextra[i] - _daExtraGlobal[VEC_DIF2][i]) / dEps;
     }
   }
-  
+
   else {    //-- bUseForwardDiffs == false
     //---- EQUATION IS FROM THE OLD LAMMPS VERSION, SAND98-8201.
     double  dEps = pow (3000.0 * MACHINE_EPS, 0.33333333) / dDirNorm2;
-    
+
     //---- SAVE A COPY OF x.
     fix_minimize->store_box();
     for (int  i = 0; i < nvec; i++)
       _daAVectors[VEC_DIF1][i] = xvec[i];
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  xatom  = xextra_atom[m];
-	double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  d1Atom[i] = xatom[i];
+        double *  xatom  = xextra_atom[m];
+        double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          d1Atom[i] = xatom[i];
       }
     }
     if (nextra_global) {
       modify->min_pushstore();
       modify->min_store();
     }
-    
+
     //---- EVALUATE FORCES AT x + eps*p.
     if (nextra_global)
       modify->min_step (dEps, _daExtraGlobal[nIxDir]);
@@ -1496,54 +1496,54 @@ void MinHFTN::evaluate_dir_der_(const bool      bUseForwardDiffs,
       xvec[i] += dEps * _daAVectors[nIxDir][i];
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  xatom = xextra_atom[m];
-	double *  iAtom = _daExtraAtom[nIxDir][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  xatom[i] += dEps * iAtom[i];
-	requestor[m]->min_x_set(m);
+        double *  xatom = xextra_atom[m];
+        double *  iAtom = _daExtraAtom[nIxDir][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          xatom[i] += dEps * iAtom[i];
+        requestor[m]->min_x_set(m);
       }
     }
     energy_force (0);
     neval++;
-    
+
     //---- STORE THE FORCE IN DIF2.
     if (nextra_global) {
       for (int  i = 0; i < nextra_global; i++)
-	_daExtraGlobal[VEC_DIF2][i] = fextra[i];
+        _daExtraGlobal[VEC_DIF2][i] = fextra[i];
     }
     for (int  i = 0; i < nvec; i++)
       _daAVectors[VEC_DIF2][i] = fvec[i];
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  fatom  = fextra_atom[m];
-	double *  d2Atom = _daExtraAtom[VEC_DIF2][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  d2Atom[i] = fatom[i];
+        double *  fatom  = fextra_atom[m];
+        double *  d2Atom = _daExtraAtom[VEC_DIF2][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          d2Atom[i] = fatom[i];
       }
     }
-    
+
     //---- EVALUATE FORCES AT x - eps*p.
     if (nextra_global)
       modify->min_step (-dEps, _daExtraGlobal[nIxDir]);
     for (int  i = 0; i < nvec; i++)
       xvec[i] = _daAVectors[VEC_DIF1][i]
-	- dEps * _daAVectors[nIxDir][i];
+        - dEps * _daAVectors[nIxDir][i];
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  xatom  = xextra_atom[m];
-	double *  iAtom  = _daExtraAtom[nIxDir][m];
-	double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  xatom[i] = d1Atom[i] - dEps * iAtom[i];
-	requestor[m]->min_x_set(m);
+        double *  xatom  = xextra_atom[m];
+        double *  iAtom  = _daExtraAtom[nIxDir][m];
+        double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          xatom[i] = d1Atom[i] - dEps * iAtom[i];
+        requestor[m]->min_x_set(m);
       }
     }
     energy_force (0);
     neval++;
-    
+
     //---- COMPUTE THE DIFFERENCE VECTOR:
     //----     [grad(x + eps*p) - grad(x - eps*p)] / 2*eps.
     //---- REMEMBER THAT FORCES = -GRADIENT.
@@ -1551,45 +1551,45 @@ void MinHFTN::evaluate_dir_der_(const bool      bUseForwardDiffs,
       double *  iGlobal  = _daExtraGlobal[nIxResult];
       double *  d2Global = _daExtraGlobal[VEC_DIF2];
       for (int  i = 0; i < nextra_global; i++)
-	iGlobal[i] = (fextra[i] - d2Global[i]) / (2.0 + dEps);
+        iGlobal[i] = (fextra[i] - d2Global[i]) / (2.0 + dEps);
     }
     for (int  i = 0; i < nvec; i++)
-      _daAVectors[nIxResult][i] = 
-	(fvec[i] - _daAVectors[VEC_DIF2][i]) / (2.0 * dEps);
+      _daAVectors[nIxResult][i] =
+        (fvec[i] - _daAVectors[VEC_DIF2][i]) / (2.0 * dEps);
     if (nextra_atom) {
       for (int  m = 0; m < nextra_atom; m++) {
-	double *  fatom  = fextra_atom[m];
-	double *  iAtom  = _daExtraAtom[nIxResult][m];
-	double *  d2Atom = _daExtraAtom[VEC_DIF2][m];
-	int  n = extra_nlen[m];
-	for (int  i = 0; i < n; i++)
-	  iAtom[i] = (fatom[i] - d2Atom[i]) / (2.0 + dEps);
+        double *  fatom  = fextra_atom[m];
+        double *  iAtom  = _daExtraAtom[nIxResult][m];
+        double *  d2Atom = _daExtraAtom[VEC_DIF2][m];
+        int  n = extra_nlen[m];
+        for (int  i = 0; i < n; i++)
+          iAtom[i] = (fatom[i] - d2Atom[i]) / (2.0 + dEps);
       }
     }
-    
+
     if (bEvaluateAtX) {
       //---- EVALUATE FORCES AT x.
       if (nextra_global) {
-	modify->min_step (0.0, _daExtraGlobal[VEC_DIF1]);
-	modify->min_popstore();
+        modify->min_step (0.0, _daExtraGlobal[VEC_DIF1]);
+        modify->min_popstore();
       }
       for (int  i = 0; i < nvec; i++)
-	xvec[i] = _daAVectors[VEC_DIF1][i];
+        xvec[i] = _daAVectors[VEC_DIF1][i];
       if (nextra_atom) {
-	for (int  m = 0; m < nextra_atom; m++) {
-	  double *  xatom  = xextra_atom[m];
-	  double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
-	  int  n = extra_nlen[m];
-	  for (int  i = 0; i < n; i++)
-	    xatom[i] = d1Atom[i];
-	  requestor[m]->min_x_set(m);
-	}
+        for (int  m = 0; m < nextra_atom; m++) {
+          double *  xatom  = xextra_atom[m];
+          double *  d1Atom = _daExtraAtom[VEC_DIF1][m];
+          int  n = extra_nlen[m];
+          for (int  i = 0; i < n; i++)
+            xatom[i] = d1Atom[i];
+          requestor[m]->min_x_set(m);
+        }
       }
       dNewEnergy = energy_force (0);
       neval++;
     }
   }
-  
+
   return;
 }
 
@@ -1601,7 +1601,7 @@ void MinHFTN::open_hftn_print_file_(void)
 {
   int  nMyRank;
   MPI_Comm_rank (world, &nMyRank);
-  
+
   char  szTmp[50];
   sprintf (szTmp, "progress_MinHFTN_%d.txt", nMyRank);
   _fpPrint = fopen (szTmp, "w");
@@ -1610,9 +1610,9 @@ void MinHFTN::open_hftn_print_file_(void)
     printf ("*** continuing...\n");
     return;
   }
-  
+
   fprintf (_fpPrint, "  Iter   Evals      Energy         |F|_2"
-	   "    Step   TR used    |step|_2      ared      pred\n");
+           "    Step   TR used    |step|_2      ared      pred\n");
   return;
 }
 
@@ -1625,15 +1625,15 @@ void MinHFTN::open_hftn_print_file_(void)
 ------------------------------------------------------------------------- */
 
 void MinHFTN::hftn_print_line_(const bool    bIsStepAccepted,
-			       const int     nIteration,
-			       const int     nTotalEvals,
-			       const double  dEnergy,
-			       const double  dForce2,
-			       const int     nStepType,
-			       const double  dTrustRadius,
-			       const double  dStepLength2,
-			       const double  dActualRed,
-			       const double  dPredictedRed) const
+                               const int     nIteration,
+                               const int     nTotalEvals,
+                               const double  dEnergy,
+                               const double  dForce2,
+                               const int     nStepType,
+                               const double  dTrustRadius,
+                               const double  dStepLength2,
+                               const double  dActualRed,
+                               const double  dPredictedRed) const
 {
   const char  sFormat1[]
     = "  %4d   %5d  %14.8f  %11.5e\n";
@@ -1641,10 +1641,10 @@ void MinHFTN::hftn_print_line_(const bool    bIsStepAccepted,
     = "  %4d   %5d  %14.8f  %11.5e  %3s  %9.3e   %8.2e  %10.3e %10.3e\n";
   const char  sFormatR[]
     = "r %4d   %5d  %14.8f  %11.5e  %3s  %9.3e   %8.2e  %10.3e %10.3e\n";
-  
+
   if (_fpPrint == NULL)
     return;
-  
+
   char  sStepType[4];
   if (nStepType == NO_CGSTEP_BECAUSE_F_TOL_SATISFIED)
     strcpy (sStepType, " - ");
@@ -1660,24 +1660,24 @@ void MinHFTN::hftn_print_line_(const bool    bIsStepAccepted,
     strcpy (sStepType, "its");
   else
     strcpy (sStepType, "???");
-  
+
   if (nIteration == -1) {
     fprintf (_fpPrint, sFormat1,
-	     0, nTotalEvals, dEnergy, dForce2);
+             0, nTotalEvals, dEnergy, dForce2);
   }
   else {
     if (bIsStepAccepted)
       fprintf (_fpPrint, sFormatA,
-	       nIteration, nTotalEvals, dEnergy, dForce2,
-	       sStepType, dTrustRadius, dStepLength2,
-	       dActualRed, dPredictedRed);
+               nIteration, nTotalEvals, dEnergy, dForce2,
+               sStepType, dTrustRadius, dStepLength2,
+               dActualRed, dPredictedRed);
     else
       fprintf (_fpPrint, sFormatR,
-	       nIteration, nTotalEvals, dEnergy, dForce2,
-	       sStepType, dTrustRadius, dStepLength2,
-	       dActualRed, dPredictedRed);
+               nIteration, nTotalEvals, dEnergy, dForce2,
+               sStepType, dTrustRadius, dStepLength2,
+               dActualRed, dPredictedRed);
   }
-  
+
   fflush (_fpPrint);
   return;
 }
diff --git a/src/min_hftn.h b/src/min_hftn.h
index 42c181930c..9d9932572b 100644
--- a/src/min_hftn.h
+++ b/src/min_hftn.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -39,7 +39,7 @@ namespace LAMMPS_NS
 class MinHFTN : public Min
 {
   public:
-  
+
   MinHFTN (LAMMPS *);
   ~MinHFTN (void);
   void init();
@@ -52,73 +52,73 @@ class MinHFTN : public Min
   //---- ATOM-BASED STORAGE VECTORS.
   double *   _daAVectors[NUM_HFTN_ATOM_BASED_VECTORS];
   double **  _daExtraAtom[NUM_HFTN_ATOM_BASED_VECTORS];
-  
+
   //---- GLOBAL DOF STORAGE.  ELEMENT [0] IS X0 (XK), NOT USED IN THIS ARRAY.
   double *   _daExtraGlobal[NUM_HFTN_ATOM_BASED_VECTORS];
-  
+
   int     _nNumUnknowns;
   FILE *  _fpPrint;
-  
+
   int   execute_hftn_ (const bool      bPrintProgress,
-		       const double    dInitialEnergy,
-		       const double    dInitialForce2,
-		       double &  dFinalEnergy,
-		       double &  dFinalForce2);
+                       const double    dInitialEnergy,
+                       const double    dInitialForce2,
+                       double &  dFinalEnergy,
+                       double &  dFinalForce2);
   bool    compute_inner_cg_step_ (const double    dTrustRadius,
-				  const double    dForceTol,
-				  const int       nMaxEvals,
-				  const bool      bHaveEvalAtXin,
-				  const double    dEnergyAtXin,
-				  const double    dForce2AtXin,
-				  double &  dEnergyAtXout,
-				  double &  dForce2AtXout,
-				  int    &  nStepType,
-				  double &  dStepLength2,
-				  double &  dStepLengthInf);
+                                  const double    dForceTol,
+                                  const int       nMaxEvals,
+                                  const bool      bHaveEvalAtXin,
+                                  const double    dEnergyAtXin,
+                                  const double    dForce2AtXin,
+                                  double &  dEnergyAtXout,
+                                  double &  dForce2AtXout,
+                                  int    &  nStepType,
+                                  double &  dStepLength2,
+                                  double &  dStepLengthInf);
   double  calc_xinf_using_mpi_ (void) const;
   double  calc_dot_prod_using_mpi_ (const int  nIx1,
-				    const int  nIx2) const;
+                                    const int  nIx2) const;
   double  calc_grad_dot_v_using_mpi_ (const int  nIx) const;
   void    calc_dhd_dd_using_mpi_ (double &  dDHD,
-				  double &  dDD) const;
+                                  double &  dDD) const;
   void    calc_ppnew_pdold_using_mpi_ (double &  dPnewDotPnew,
-				       double &  dPoldDotD) const;
+                                       double &  dPoldDotD) const;
   void    calc_plengths_using_mpi_ (double &  dStepLength2,
-				    double &  dStepLengthInf) const;
+                                    double &  dStepLengthInf) const;
   bool    step_exceeds_TR_ (const double    dTrustRadius,
-			    const double    dPP,
-			    const double    dPD,
-			    const double    dDD,
-			    double &  dTau) const;
+                            const double    dPP,
+                            const double    dPD,
+                            const double    dDD,
+                            double &  dTau) const;
   bool    step_exceeds_DMAX_ (void) const;
   void    adjust_step_to_tau_ (const double  tau);
   double  compute_to_tr_ (const double  dPP,
-			  const double  dPD,
-			  const double  dDD,
-			  const double  dTrustRadius,
-			  const bool    bConsiderBothRoots,
-			  const double  dDHD,
-			  const double  dPdotHD,
-			  const double  dGradDotD) const;
+                          const double  dPD,
+                          const double  dDD,
+                          const double  dTrustRadius,
+                          const bool    bConsiderBothRoots,
+                          const double  dDHD,
+                          const double  dPdotHD,
+                          const double  dGradDotD) const;
   void    evaluate_dir_der_ (const bool      bUseForwardDiffs,
-			     const int       nIxDir,
-			     const int       nIxResult,
-			     const bool      bEvaluateAtX,
-			     double &  dNewEnergy);
+                             const int       nIxDir,
+                             const int       nIxResult,
+                             const bool      bEvaluateAtX,
+                             double &  dNewEnergy);
   void  open_hftn_print_file_ (void);
   void  hftn_print_line_ (const bool    bIsStepAccepted,
-			  const int     nIteration,
-			  const int     nTotalEvals,
-			  const double  dEnergy,
-			  const double  dForce2,
-			  const int     nStepType,
-			  const double  dTrustRadius,
-			  const double  dStepLength2,
-			  const double  dActualRed,
-			  const double  dPredictedRed) const;
+                          const int     nIteration,
+                          const int     nTotalEvals,
+                          const double  dEnergy,
+                          const double  dForce2,
+                          const int     nStepType,
+                          const double  dTrustRadius,
+                          const double  dStepLength2,
+                          const double  dActualRed,
+                          const double  dPredictedRed) const;
   void  close_hftn_print_file_ (void);
 };
- 
+
 }
 
 #endif
diff --git a/src/min_linesearch.cpp b/src/min_linesearch.cpp
index b50971a35b..5ddf719ca9 100644
--- a/src/min_linesearch.cpp
+++ b/src/min_linesearch.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -267,8 +267,8 @@ int MinLineSearch::linemin_backtrack(double eoriginal, double &alpha)
     de = ecurrent - eoriginal;
     if (de <= de_ideal) {
       if (nextra_global) {
-	int itmp = modify->min_reset_ref();
-	if (itmp) ecurrent = energy_force(1);
+        int itmp = modify->min_reset_ref();
+        if (itmp) ecurrent = energy_force(1);
       }
       return 0;
     }
@@ -289,16 +289,16 @@ int MinLineSearch::linemin_backtrack(double eoriginal, double &alpha)
 
 /* ----------------------------------------------------------------------
     // linemin: quadratic line search (adapted from Dennis and Schnabel)
-    // The objective function is approximated by a quadratic 
-    // function in alpha, for sufficiently small alpha. 
+    // The objective function is approximated by a quadratic
+    // function in alpha, for sufficiently small alpha.
     // This idea is the same as that used in the well-known secant
-    // method. However, since the change in the objective function 
-    // (difference of two finite numbers) is not known as accurately 
-    // as the gradient (which is close to zero), all the expressions 
-    // are written in terms of gradients. In this way, we can converge 
-    // the LAMMPS forces much closer to zero. 
+    // method. However, since the change in the objective function
+    // (difference of two finite numbers) is not known as accurately
+    // as the gradient (which is close to zero), all the expressions
+    // are written in terms of gradients. In this way, we can converge
+    // the LAMMPS forces much closer to zero.
     //
-    // We know E,Eprev,fh,fhprev. The Taylor series about alpha_prev 
+    // We know E,Eprev,fh,fhprev. The Taylor series about alpha_prev
     // truncated at the quadratic term is:
     //
     //     E = Eprev - del_alpha*fhprev + (1/2)del_alpha^2*Hprev
@@ -317,7 +317,7 @@ int MinLineSearch::linemin_backtrack(double eoriginal, double &alpha)
     //
     //      relerr = |(Esolve-E)/Eprev|
     //             = |1.0 - (0.5*del_alpha*(f+fprev)+E)/Eprev|
-    // 
+    //
     // If this is accurate to within a reasonable tolerance, then
     // we go ahead and use a secant step to fh = 0:
     //
@@ -331,7 +331,7 @@ int MinLineSearch::linemin_quadratic(double eoriginal, double &alpha)
   double fdothall,fdothme,hme,hmax,hmaxall;
   double de_ideal,de;
   double delfh,engprev,relerr,alphaprev,fhprev,ff,fh,alpha0;
-  double dot[2],dotall[2]; 
+  double dot[2],dotall[2];
   double *xatom,*x0atom,*fatom,*hatom;
   double alphamax;
 
@@ -426,19 +426,19 @@ int MinLineSearch::linemin_quadratic(double eoriginal, double &alpha)
     }
     if (nextra_atom)
       for (m = 0; m < nextra_atom; m++) {
-	fatom = fextra_atom[m];
-	hatom = hextra_atom[m];
-	n = extra_nlen[m];
-	for (i = 0; i < n; i++) {
-	  dot[0] += fatom[i]*fatom[i];
-	  dot[1] += fatom[i]*hatom[i];
-	}
+        fatom = fextra_atom[m];
+        hatom = hextra_atom[m];
+        n = extra_nlen[m];
+        for (i = 0; i < n; i++) {
+          dot[0] += fatom[i]*fatom[i];
+          dot[1] += fatom[i]*hatom[i];
+        }
       }
     MPI_Allreduce(dot,dotall,2,MPI_DOUBLE,MPI_SUM,world);
     if (nextra_global) {
       for (i = 0; i < nextra_global; i++) {
-	dotall[0] += fextra[i]*fextra[i];
-	dotall[1] += fextra[i]*hextra[i];
+        dotall[0] += fextra[i]*fextra[i];
+        dotall[1] += fextra[i]*hextra[i];
       }
     }
     ff = dotall[0];
@@ -466,11 +466,11 @@ int MinLineSearch::linemin_quadratic(double eoriginal, double &alpha)
     if (relerr <= QUADRATIC_TOL && alpha0 > 0.0 && alpha0 < alphamax) {
       ecurrent = alpha_step(alpha0,1);
       if (ecurrent - eoriginal < EMACH) {
-	if (nextra_global) {
-	  int itmp = modify->min_reset_ref();
-	  if (itmp) ecurrent = energy_force(1);
-	}
-	return 0;
+        if (nextra_global) {
+          int itmp = modify->min_reset_ref();
+          if (itmp) ecurrent = energy_force(1);
+        }
+        return 0;
       }
     }
 
@@ -481,8 +481,8 @@ int MinLineSearch::linemin_quadratic(double eoriginal, double &alpha)
 
     if (de <= de_ideal) {
       if (nextra_global) {
-	int itmp = modify->min_reset_ref();
-	if (itmp) ecurrent = energy_force(1);
+        int itmp = modify->min_reset_ref();
+        if (itmp) ecurrent = energy_force(1);
       }
       return 0;
     }
@@ -509,76 +509,76 @@ int MinLineSearch::linemin_quadratic(double eoriginal, double &alpha)
 
 /* ----------------------------------------------------------------------
 
-forcezero linesearch method - seeks a zero of force in a robust manner. 
+forcezero linesearch method - seeks a zero of force in a robust manner.
     (motivated by a line minimization routine of f77 DYNAMO code)
 
-central idea: 
-  In each linesearch we attempt to converge to a zero of force 
+central idea:
+  In each linesearch we attempt to converge to a zero of force
   (usual case) or reduces forces (worst case).
-  Energy does not play any role in the search procedure, 
+  Energy does not play any role in the search procedure,
   except we ensure that it doesn't increase.
 
 pseudo code:
   i)  Fix an alpha max:
-        // also account for nextra atom & global 
-	alpha_max <= dmax/hmaxall 
+        // also account for nextra atom & global
+        alpha_max <= dmax/hmaxall
 
   ii) Initialize:
         fhCurr = current_force.dot.search_direction
         fhoriginal = fhCurr
         // try decreasing the energy to 1/10 of initial
-        alpha_init = 0.1*fabs(eoriginal)/fhCurr; 
+        alpha_init = 0.1*fabs(eoriginal)/fhCurr;
         // initial alpha is smaller than alpha_max
         alpha_del = MIN(alpha_init, 0.5*alpha_max);
         alpha = 0.0
   iii) Loop:
         backtrack = false
-	alpha += alpha_del
-	if (alpha > alpha_max):
-	   // we have done enough in the search space
-	   EXIT with success
+        alpha += alpha_del
+        if (alpha > alpha_max):
+           // we have done enough in the search space
+           EXIT with success
 
         Step with the new alpha
-	Compute:
-	   current energy and 'fhCurr'
-	   de = ecurrent - eprev
-
-	   // ZERO_ENERGY = 1e-12, is max allowed energy increase
-	   if (de > ZERO_ENERGY):
-	      bactrack = true
-
-	   // GRAD_TOL = 0.1
-	   if ( (not backtrack) && (fabs(fhCurr/fh0) <= GRAD_TOL) ): 
-	      // forces sufficiently reduced without energy increase
-	      EXIT with success
-
-	   // projected force changed sign but didn't become small enough
-	   if ( fhCurr < 0):
-	      backtrack = true
-
-	   if (bactrack):
-	      // forces along search direction changed sign
-	      if (fhCurr < 0):
-	         Get alpha_del by solving for zero 
+        Compute:
+           current energy and 'fhCurr'
+           de = ecurrent - eprev
+
+           // ZERO_ENERGY = 1e-12, is max allowed energy increase
+           if (de > ZERO_ENERGY):
+              bactrack = true
+
+           // GRAD_TOL = 0.1
+           if ( (not backtrack) && (fabs(fhCurr/fh0) <= GRAD_TOL) ):
+              // forces sufficiently reduced without energy increase
+              EXIT with success
+
+           // projected force changed sign but didn't become small enough
+           if ( fhCurr < 0):
+              backtrack = true
+
+           if (bactrack):
+              // forces along search direction changed sign
+              if (fhCurr < 0):
+                 Get alpha_del by solving for zero
                     of force (1D Newton's Method)
-	      else:
-	         // force didn't change sign but only energy increased,
-		 // we overshot a minimum which is very close to a 
+              else:
+                 // force didn't change sign but only energy increased,
+                 // we overshot a minimum which is very close to a
                  // maximum (or there is an inflection point)
 
-		 // New alpha_del should be much smaller
-		 // ALPHA_FACT = 0.1
-		 alpha_del *= ALPHA_FACT
+                 // New alpha_del should be much smaller
+                 // ALPHA_FACT = 0.1
+                 alpha_del *= ALPHA_FACT
 
-		 // Check to see if new 'alpha_del' isn't too small
-		 if (alpha_del < MIN_ALPHA):
-		    EXIT with failure("linesearch alpha is zero")
+                 // Check to see if new 'alpha_del' isn't too small
+                 if (alpha_del < MIN_ALPHA):
+                    EXIT with failure("linesearch alpha is zero")
 
-	       Undo the step of alpha.
+               Undo the step of alpha.
 
-	   // continue the loop with a new alpha_del
-	   else:   
-	      Get new alpha_del by linearizing force and solving for its zero
+           // continue the loop with a new alpha_del
+           else:
+              Get new alpha_del by linearizing force and solving for its zero
 
  ---------------------------------------------------------------------- */
 
@@ -589,8 +589,8 @@ int MinLineSearch::linemin_forcezero(double eoriginal, double &alpha)
   double de_ideal,de;
   double *xatom,*x0atom,*fatom,*hatom;
 
-  double alpha_max, alpha_init, alpha_del; 
-  // projection of: force on itself, current force on search direction, 
+  double alpha_max, alpha_init, alpha_del;
+  // projection of: force on itself, current force on search direction,
   double ffCurr, fhCurr;
   // previous force on search direction, initial force on search direction
   double fhPrev, fhoriginal;
@@ -620,13 +620,13 @@ int MinLineSearch::linemin_forcezero(double eoriginal, double &alpha)
       fatom = fextra_atom[m];
       hatom = hextra_atom[m];
       n = extra_nlen[m];
-      for (i = 0; i < n; i++) 
-	fdothme += fatom[i]*hatom[i];
+      for (i = 0; i < n; i++)
+        fdothme += fatom[i]*hatom[i];
     }
 
   MPI_Allreduce(&fdothme,&fdothall,1,MPI_DOUBLE,MPI_SUM,world);
   if (nextra_global)
-    for (i = 0; i < nextra_global; i++) 
+    for (i = 0; i < nextra_global; i++)
       fdothall += fextra[i]*hextra[i];
   if (output->thermo->normflag) fdothall /= atom->natoms;
   if (fdothall <= 0.0) return DOWNHILL;
@@ -636,13 +636,13 @@ int MinLineSearch::linemin_forcezero(double eoriginal, double &alpha)
   // for extra per-atom dof, max amount = extra_max[]
   // for extra global dof, max amount is set by fix
 
-  // also insure alpha <= ALPHA_MAX else will have 
+  // also insure alpha <= ALPHA_MAX else will have
   // to backtrack from huge value when forces are tiny
 
   // if all search dir components are already 0.0, exit with error
 
   hme = 0.0;
-  for (i = 0; i < nvec; i++) 
+  for (i = 0; i < nvec; i++)
     hme = MAX(hme,fabs(h[i]));
 
   MPI_Allreduce(&hme,&hmaxall,1,MPI_DOUBLE,MPI_MAX,world);
@@ -682,12 +682,12 @@ int MinLineSearch::linemin_forcezero(double eoriginal, double &alpha)
 
   if (nextra_global) modify->min_store();
 
-  // initialize important variables before main linesearch loop 
+  // initialize important variables before main linesearch loop
 
   ffCurr = 0.0;
   fhCurr = fdothall;
   fhoriginal = fhCurr;
-  engCurr = eoriginal; 
+  engCurr = eoriginal;
 
   // stores energy difference due to the current move
 
@@ -698,16 +698,16 @@ int MinLineSearch::linemin_forcezero(double eoriginal, double &alpha)
 
   alpha_init = 0.1*fabs(eoriginal)/fdothall;
 
-  // initialize aplha to 0.0 
+  // initialize aplha to 0.0
 
   alpha = 0.0;
-  
-  // compute increment to alpha, ensure that we 
+
+  // compute increment to alpha, ensure that we
   // don't take the largest allowed alpha
   // first alpha that will actually apply
 
   alpha_del = MIN(alpha_init,0.5*alpha_max);
- 
+
   // main linesearch loop
 
   while (1) {
@@ -715,27 +715,27 @@ int MinLineSearch::linemin_forcezero(double eoriginal, double &alpha)
     fhPrev = fhCurr;
     engPrev = engCurr;
 
-    // apply the increment to alpha, but first 
+    // apply the increment to alpha, but first
     // check whether we are still in allowed search space
 
     alpha += alpha_del;
     if (alpha > alpha_max) {
 
-      // undo the increment 
+      // undo the increment
 
-      alpha -= alpha_del; 
+      alpha -= alpha_del;
       if (nextra_global) {
-	int itmp = modify->min_reset_ref();
-	if (itmp) ecurrent = energy_force(1);
+        int itmp = modify->min_reset_ref();
+        if (itmp) ecurrent = energy_force(1);
       }
 
-      // exit linesearch with success: have done 
+      // exit linesearch with success: have done
       // enough in allowed search space
 
       return 0;
     }
 
-    // move the system 
+    // move the system
 
     // '1' updates coordinates of atoms which cross PBC
 
@@ -750,7 +750,7 @@ int MinLineSearch::linemin_forcezero(double eoriginal, double &alpha)
 
     de = engCurr - engPrev;
 
-    // if the function value increases measurably, 
+    // if the function value increases measurably,
     // then we have to reduce alpha
 
     if (de >= ZERO_ENERGY)
@@ -761,8 +761,8 @@ int MinLineSearch::linemin_forcezero(double eoriginal, double &alpha)
 
     if ((!backtrack) && (fabs(fhCurr/fhoriginal) <= GRAD_TOL)) {
       if (nextra_global) {
-	int itmp = modify->min_reset_ref();
-	if (itmp) ecurrent = energy_force(1);
+        int itmp = modify->min_reset_ref();
+        if (itmp) ecurrent = energy_force(1);
       }
 
       // we are done
@@ -770,7 +770,7 @@ int MinLineSearch::linemin_forcezero(double eoriginal, double &alpha)
       return 0;
     }
 
-    // check if the directional derivative changed sign 
+    // check if the directional derivative changed sign
     // but it's not small: we overshot the minima -- BACKTRACK
 
     if (fhCurr < 0.0)
@@ -783,21 +783,21 @@ int MinLineSearch::linemin_forcezero(double eoriginal, double &alpha)
       // move back
 
       alpha -= alpha_del;
-      
-      // choose new alpha 
-      // if the force changed sign, linearize force and 
+
+      // choose new alpha
+      // if the force changed sign, linearize force and
       // solve for new alpha_del
 
       if (fhCurr < 0.0)
-	alpha_del *= fhPrev/(fhPrev - fhCurr);
+        alpha_del *= fhPrev/(fhPrev - fhCurr);
       else
 
-    // force didn't change sign but only energy increased, 
-    // we overshot a minimum which is very close to a maxima 
+    // force didn't change sign but only energy increased,
+    // we overshot a minimum which is very close to a maxima
     // (or there is an inflection point)
     // new alpha_del should be much smaller
 
-	alpha_del *= ALPHA_FACT;
+        alpha_del *= ALPHA_FACT;
 
       // since we moved back ...
 
@@ -805,33 +805,33 @@ int MinLineSearch::linemin_forcezero(double eoriginal, double &alpha)
       ecurrent = engCurr;
       fhCurr = fhPrev;
 
-      // if new move is too small then we have failed; 
+      // if new move is too small then we have failed;
       // exit with 'failed_linesearch'
 
       if (hmaxall*alpha_del <= MIN_ALPHA_FAC) {
 
-	// undo all line minization moves
+        // undo all line minization moves
 
-	engCurr = alpha_step(0.0,1); 
-	ecurrent= engCurr;
-	return ZEROALPHA;
+        engCurr = alpha_step(0.0,1);
+        ecurrent= engCurr;
+        return ZEROALPHA;
       }
 
-    } else { 
+    } else {
+
+      // get a new alpha by linearizing force and start over
 
-      // get a new alpha by linearizing force and start over 
-       
       double boostFactor = LIMIT_BOOST;
-      
-      // avoids problems near an energy inflection point 
-      
+
+      // avoids problems near an energy inflection point
+
       if (fhPrev > fhCurr)
-	boostFactor = fhCurr/(fhPrev - fhCurr);
+        boostFactor = fhCurr/(fhPrev - fhCurr);
 
-      // don't want to boost too much 
+      // don't want to boost too much
 
-      boostFactor = MIN(boostFactor, LIMIT_BOOST); 
-      alpha_del *= boostFactor; 
+      boostFactor = MIN(boostFactor, LIMIT_BOOST);
+      alpha_del *= boostFactor;
     }
   }
 }
@@ -855,7 +855,7 @@ double MinLineSearch::alpha_step(double alpha, int resetflag)
       for (i = 0; i < n; i++) xatom[i] = x0atom[i];
       requestor[m]->min_x_set(m);
     }
-  
+
   // step forward along h
 
   if (alpha > 0.0) {
@@ -863,11 +863,11 @@ double MinLineSearch::alpha_step(double alpha, int resetflag)
     for (i = 0; i < nvec; i++) xvec[i] += alpha*h[i];
     if (nextra_atom)
       for (m = 0; m < nextra_atom; m++) {
-	xatom = xextra_atom[m];
-	hatom = hextra_atom[m];
-	n = extra_nlen[m];
-	for (i = 0; i < n; i++) xatom[i] += alpha*hatom[i];
-	requestor[m]->min_x_set(m);
+        xatom = xextra_atom[m];
+        hatom = hextra_atom[m];
+        n = extra_nlen[m];
+        for (i = 0; i < n; i++) xatom[i] += alpha*hatom[i];
+        requestor[m]->min_x_set(m);
       }
   }
 
@@ -879,7 +879,7 @@ double MinLineSearch::alpha_step(double alpha, int resetflag)
 
 /* ---------------------------------------------------------------------- */
 
-// compute projection of force on: itself and the search direction 
+// compute projection of force on: itself and the search direction
 
 double MinLineSearch::compute_dir_deriv(double &ff)
 {
diff --git a/src/min_linesearch.h b/src/min_linesearch.h
index 55dbad17a6..51e1277506 100644
--- a/src/min_linesearch.h
+++ b/src/min_linesearch.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/min_quickmin.cpp b/src/min_quickmin.cpp
index 80479827da..ee6766af2f 100644
--- a/src/min_quickmin.cpp
+++ b/src/min_quickmin.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -114,28 +114,28 @@ int MinQuickMin::iterate(int maxiter)
     if (vdotfall < 0.0) {
       last_negative = ntimestep;
       for (int i = 0; i < nlocal; i++)
-	v[i][0] = v[i][1] = v[i][2] = 0.0;
+        v[i][0] = v[i][1] = v[i][2] = 0.0;
 
     } else {
       fdotf = 0.0;
       for (int i = 0; i < nlocal; i++)
-	fdotf += f[i][0]*f[i][0] + f[i][1]*f[i][1] + f[i][2]*f[i][2];
+        fdotf += f[i][0]*f[i][0] + f[i][1]*f[i][1] + f[i][2]*f[i][2];
       MPI_Allreduce(&fdotf,&fdotfall,1,MPI_DOUBLE,MPI_SUM,world);
 
       // sum fdotf over replicas, if necessary
       // this communicator would be invalid for multiprocess replicas
 
       if (update->multireplica == 1) {
-	fdotf = fdotfall;
-	MPI_Allreduce(&fdotf,&fdotfall,1,MPI_DOUBLE,MPI_SUM,universe->uworld);
+        fdotf = fdotfall;
+        MPI_Allreduce(&fdotf,&fdotfall,1,MPI_DOUBLE,MPI_SUM,universe->uworld);
       }
 
       if (fdotfall == 0.0) scale = 0.0;
       else scale = vdotfall/fdotfall;
       for (int i = 0; i < nlocal; i++) {
-	v[i][0] = scale * f[i][0];
-	v[i][1] = scale * f[i][1];
-	v[i][2] = scale * f[i][2];
+        v[i][0] = scale * f[i][0];
+        v[i][1] = scale * f[i][1];
+        v[i][2] = scale * f[i][2];
       }
     }
 
@@ -165,29 +165,29 @@ int MinQuickMin::iterate(int maxiter)
     // Euler integration step
 
     double **x = atom->x;
-    
+
     if (rmass) {
       for (int i = 0; i < nlocal; i++) {
-	dtfm = dtv / rmass[i];
-	x[i][0] += dtv * v[i][0];
-	x[i][1] += dtv * v[i][1];
-	x[i][2] += dtv * v[i][2];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
+        dtfm = dtv / rmass[i];
+        x[i][0] += dtv * v[i][0];
+        x[i][1] += dtv * v[i][1];
+        x[i][2] += dtv * v[i][2];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
       }
     } else {
       for (int i = 0; i < nlocal; i++) {
-	dtfm = dtv / mass[type[i]];
-	x[i][0] += dtv * v[i][0];
-	x[i][1] += dtv * v[i][1];
-	x[i][2] += dtv * v[i][2];
-	v[i][0] += dtfm * f[i][0];
-	v[i][1] += dtfm * f[i][1];
-	v[i][2] += dtfm * f[i][2];
+        dtfm = dtv / mass[type[i]];
+        x[i][0] += dtv * v[i][0];
+        x[i][1] += dtv * v[i][1];
+        x[i][2] += dtv * v[i][2];
+        v[i][0] += dtfm * f[i][0];
+        v[i][1] += dtfm * f[i][1];
+        v[i][2] += dtfm * f[i][2];
       }
     }
-    
+
     eprevious = ecurrent;
     ecurrent = energy_force(0);
     neval++;
@@ -198,16 +198,16 @@ int MinQuickMin::iterate(int maxiter)
 
     if (update->etol > 0.0 && ntimestep-last_negative > DELAYSTEP) {
       if (update->multireplica == 0) {
-	if (fabs(ecurrent-eprevious) < 
-	    update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
-	  return ETOL;
+        if (fabs(ecurrent-eprevious) <
+            update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
+          return ETOL;
       } else {
-	if (fabs(ecurrent-eprevious) < 
-	    update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
-	  flag = 0;
-	else flag = 1;
-	MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,universe->uworld);
-	if (flagall == 0) return ETOL;
+        if (fabs(ecurrent-eprevious) <
+            update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
+          flag = 0;
+        else flag = 1;
+        MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,universe->uworld);
+        if (flagall == 0) return ETOL;
       }
     }
 
@@ -217,12 +217,12 @@ int MinQuickMin::iterate(int maxiter)
     if (update->ftol > 0.0) {
       fdotf = fnorm_sqr();
       if (update->multireplica == 0) {
-	if (fdotf < update->ftol*update->ftol) return FTOL;
+        if (fdotf < update->ftol*update->ftol) return FTOL;
       } else {
-	if (fdotf < update->ftol*update->ftol) flag = 0;
-	else flag = 1;
-	MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,universe->uworld);
-	if (flagall == 0) return FTOL;
+        if (fdotf < update->ftol*update->ftol) flag = 0;
+        else flag = 1;
+        MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,universe->uworld);
+        if (flagall == 0) return FTOL;
       }
     }
 
@@ -234,6 +234,6 @@ int MinQuickMin::iterate(int maxiter)
       timer->stamp(TIME_OUTPUT);
     }
   }
-  
+
   return MAXITER;
 }
diff --git a/src/min_quickmin.h b/src/min_quickmin.h
index a69c30f616..bfb2af941e 100644
--- a/src/min_quickmin.h
+++ b/src/min_quickmin.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/min_sd.cpp b/src/min_sd.cpp
index 02020f83db..80cad3e135 100644
--- a/src/min_sd.cpp
+++ b/src/min_sd.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -73,8 +73,8 @@ int MinSD::iterate(int maxiter)
 
     // energy tolerance criterion
 
-    if (fabs(ecurrent-eprevious) < 
-	update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
+    if (fabs(ecurrent-eprevious) <
+        update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
       return ETOL;
 
     // force tolerance criterion
@@ -87,10 +87,10 @@ int MinSD::iterate(int maxiter)
     for (i = 0; i < nvec; i++) h[i] = fvec[i];
     if (nextra_atom)
       for (m = 0; m < nextra_atom; m++) {
-	fatom = fextra_atom[m];
-	hatom = hextra_atom[m];
-	n = extra_nlen[m];
-	for (i = 0; i < n; i++) hatom[i] = fatom[i];
+        fatom = fextra_atom[m];
+        hatom = hextra_atom[m];
+        n = extra_nlen[m];
+        for (i = 0; i < n; i++) hatom[i] = fatom[i];
       }
     if (nextra_global)
       for (i = 0; i < nextra_global; i++) hextra[i] = fextra[i];
@@ -103,6 +103,6 @@ int MinSD::iterate(int maxiter)
       timer->stamp(TIME_OUTPUT);
     }
   }
-  
+
   return MAXITER;
 }
diff --git a/src/min_sd.h b/src/min_sd.h
index 75928b191c..2104280729 100644
--- a/src/min_sd.h
+++ b/src/min_sd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/minimize.cpp b/src/minimize.cpp
index 4e3fc4da1e..98dfa6e558 100644
--- a/src/minimize.cpp
+++ b/src/minimize.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/minimize.h b/src/minimize.h
index 8a4fa36f48..2f41291563 100644
--- a/src/minimize.h
+++ b/src/minimize.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,7 +50,7 @@ or create_box command.
 
 E: Too many iterations
 
-You must use a number of iterations that fit in a 32-bit integer 
+You must use a number of iterations that fit in a 32-bit integer
 for minimization.
 
 */
diff --git a/src/modify.cpp b/src/modify.cpp
index 9c19816821..1dc6a04dd7 100644
--- a/src/modify.cpp
+++ b/src/modify.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -56,7 +56,7 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp)
   list_initial_integrate_respa = list_post_integrate_respa = NULL;
   list_pre_force_respa = list_post_force_respa = NULL;
   list_final_integrate_respa = NULL;
-  list_min_pre_exchange = list_min_pre_force = 
+  list_min_pre_exchange = list_min_pre_force =
   list_min_post_force = list_min_energy = NULL;
 
   end_of_step_every = NULL;
@@ -139,15 +139,15 @@ void Modify::init()
   list_init_thermo_energy(THERMO_ENERGY,n_thermo_energy,list_thermo_energy);
 
   list_init(INITIAL_INTEGRATE_RESPA,
-	    n_initial_integrate_respa,list_initial_integrate_respa);
+            n_initial_integrate_respa,list_initial_integrate_respa);
   list_init(POST_INTEGRATE_RESPA,
-	    n_post_integrate_respa,list_post_integrate_respa);
+            n_post_integrate_respa,list_post_integrate_respa);
   list_init(POST_FORCE_RESPA,
-	    n_post_force_respa,list_post_force_respa);
+            n_post_force_respa,list_post_force_respa);
   list_init(PRE_FORCE_RESPA,
-	    n_pre_force_respa,list_pre_force_respa);
+            n_pre_force_respa,list_pre_force_respa);
   list_init(FINAL_INTEGRATE_RESPA,
-	    n_final_integrate_respa,list_final_integrate_respa);
+            n_final_integrate_respa,list_final_integrate_respa);
 
   list_init(MIN_PRE_EXCHANGE,n_min_pre_exchange,list_min_pre_exchange);
   list_init(MIN_PRE_FORCE,n_min_pre_force,list_min_pre_force);
@@ -214,7 +214,7 @@ void Modify::init()
   MPI_Allreduce(&check,&checkall,1,MPI_INT,MPI_SUM,world);
   if (comm->me == 0 && checkall)
     error->warning(FLERR,
-		   "One or more atoms are time integrated more than once");
+                   "One or more atoms are time integrated more than once");
 }
 
 /* ----------------------------------------------------------------------
@@ -669,13 +669,13 @@ void Modify::add_fix(int narg, char **arg, char *suffix)
 
   for (int i = 0; i < nfix_restart_global; i++)
     if (strcmp(id_restart_global[i],fix[ifix]->id) == 0 &&
-	strcmp(style_restart_global[i],fix[ifix]->style) == 0) {
+        strcmp(style_restart_global[i],fix[ifix]->style) == 0) {
       fix[ifix]->restart(state_restart_global[i]);
       if (comm->me == 0) {
-	char *str = (char *) ("Resetting global state of Fix %s Style %s "
-			      "from restart file info\n");
-	if (screen) fprintf(screen,str,fix[ifix]->id,fix[ifix]->style);
-	if (logfile) fprintf(logfile,str,fix[ifix]->id,fix[ifix]->style);
+        char *str = (char *) ("Resetting global state of Fix %s Style %s "
+                              "from restart file info\n");
+        if (screen) fprintf(screen,str,fix[ifix]->id,fix[ifix]->style);
+        if (logfile) fprintf(logfile,str,fix[ifix]->id,fix[ifix]->style);
       }
     }
 
@@ -684,14 +684,14 @@ void Modify::add_fix(int narg, char **arg, char *suffix)
 
   for (int i = 0; i < nfix_restart_peratom; i++)
     if (strcmp(id_restart_peratom[i],fix[ifix]->id) == 0 &&
-	strcmp(style_restart_peratom[i],fix[ifix]->style) == 0) {
+        strcmp(style_restart_peratom[i],fix[ifix]->style) == 0) {
       for (int j = 0; j < atom->nlocal; j++)
-	fix[ifix]->unpack_restart(j,index_restart_peratom[i]);
+        fix[ifix]->unpack_restart(j,index_restart_peratom[i]);
       if (comm->me == 0) {
-	char *str = (char *) ("Resetting per-atom state of Fix %s Style %s "
-		     "from restart file info\n");
-	if (screen) fprintf(screen,str,fix[ifix]->id,fix[ifix]->style);
-	if (logfile) fprintf(logfile,str,fix[ifix]->id,fix[ifix]->style);
+        char *str = (char *) ("Resetting per-atom state of Fix %s Style %s "
+                     "from restart file info\n");
+        if (screen) fprintf(screen,str,fix[ifix]->id,fix[ifix]->style);
+        if (logfile) fprintf(logfile,str,fix[ifix]->id,fix[ifix]->style);
       }
     }
 }
@@ -710,7 +710,7 @@ void Modify::modify_fix(int narg, char **arg)
   for (ifix = 0; ifix < nfix; ifix++)
     if (strcmp(arg[0],fix[ifix]->id) == 0) break;
   if (ifix == nfix) error->all(FLERR,"Could not find fix_modify ID");
-  
+
   fix[ifix]->modify_params(narg-1,&arg[1]);
 }
 
@@ -822,7 +822,7 @@ void Modify::modify_compute(int narg, char **arg)
   for (icompute = 0; icompute < ncompute; icompute++)
     if (strcmp(arg[0],compute[icompute]->id) == 0) break;
   if (icompute == ncompute) error->all(FLERR,"Could not find compute_modify ID");
-  
+
   compute[icompute]->modify_params(narg-1,&arg[1]);
 }
 
@@ -906,7 +906,7 @@ void Modify::write_restart(FILE *fp)
   int me = comm->me;
 
   int count = 0;
-  for (int i = 0; i < nfix; i++) 
+  for (int i = 0; i < nfix; i++)
     if (fix[i]->restart_global) count++;
 
   if (me == 0) fwrite(&count,sizeof(int),1,fp);
@@ -915,18 +915,18 @@ void Modify::write_restart(FILE *fp)
   for (int i = 0; i < nfix; i++)
     if (fix[i]->restart_global) {
       if (me == 0) {
-	n = strlen(fix[i]->id) + 1;
-	fwrite(&n,sizeof(int),1,fp);
-	fwrite(fix[i]->id,sizeof(char),n,fp);
-	n = strlen(fix[i]->style) + 1;
-	fwrite(&n,sizeof(int),1,fp);
-	fwrite(fix[i]->style,sizeof(char),n,fp);
+        n = strlen(fix[i]->id) + 1;
+        fwrite(&n,sizeof(int),1,fp);
+        fwrite(fix[i]->id,sizeof(char),n,fp);
+        n = strlen(fix[i]->style) + 1;
+        fwrite(&n,sizeof(int),1,fp);
+        fwrite(fix[i]->style,sizeof(char),n,fp);
       }
       fix[i]->write_restart(fp);
     }
 
   count = 0;
-  for (int i = 0; i < nfix; i++) 
+  for (int i = 0; i < nfix; i++)
     if (fix[i]->restart_peratom) count++;
 
   if (me == 0) fwrite(&count,sizeof(int),1,fp);
@@ -934,14 +934,14 @@ void Modify::write_restart(FILE *fp)
   for (int i = 0; i < nfix; i++)
     if (fix[i]->restart_peratom) {
       if (me == 0) {
-	n = strlen(fix[i]->id) + 1;
-	fwrite(&n,sizeof(int),1,fp);
-	fwrite(fix[i]->id,sizeof(char),n,fp);
-	n = strlen(fix[i]->style) + 1;
-	fwrite(&n,sizeof(int),1,fp);
-	fwrite(fix[i]->style,sizeof(char),n,fp);
-	n = fix[i]->maxsize_restart();
-	fwrite(&n,sizeof(int),1,fp);
+        n = strlen(fix[i]->id) + 1;
+        fwrite(&n,sizeof(int),1,fp);
+        fwrite(fix[i]->id,sizeof(char),n,fp);
+        n = strlen(fix[i]->style) + 1;
+        fwrite(&n,sizeof(int),1,fp);
+        fwrite(fix[i]->style,sizeof(char),n,fp);
+        n = fix[i]->maxsize_restart();
+        fwrite(&n,sizeof(int),1,fp);
       }
     }
 }
@@ -1149,9 +1149,9 @@ void Modify::list_init_compute()
 bigint Modify::memory_usage()
 {
   bigint bytes = 0;
-  for (int i = 0; i < nfix; i++) 
+  for (int i = 0; i < nfix; i++)
     bytes += static_cast<bigint> (fix[i]->memory_usage());
-  for (int i = 0; i < ncompute; i++) 
+  for (int i = 0; i < ncompute; i++)
     bytes += static_cast<bigint> (compute[i]->memory_usage());
   return bytes;
 }
diff --git a/src/modify.h b/src/modify.h
index c95f3f282c..9172f577d9 100644
--- a/src/modify.h
+++ b/src/modify.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/neigh_bond.cpp b/src/neigh_bond.cpp
index dd307bd670..df95e272cb 100644
--- a/src/neigh_bond.cpp
+++ b/src/neigh_bond.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -41,21 +41,21 @@ void Neighbor::bond_all()
     for (m = 0; m < num_bond[i]; m++) {
       atom1 = atom->map(bond_atom[i][m]);
       if (atom1 == -1) {
-	char str[128];
-	sprintf(str,
-		"Bond atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
-		tag[i],bond_atom[i][m],me,update->ntimestep);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,
+                "Bond atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
+                tag[i],bond_atom[i][m],me,update->ntimestep);
+        error->one(FLERR,str);
       }
       if (newton_bond || i < atom1) {
-	if (nbondlist == maxbond) {
-	  maxbond += BONDDELTA;
-	  memory->grow(bondlist,maxbond,3,"neighbor:bondlist");
-	}
-	bondlist[nbondlist][0] = i;
-	bondlist[nbondlist][1] = atom1;
-	bondlist[nbondlist][2] = bond_type[i][m];
-	nbondlist++;
+        if (nbondlist == maxbond) {
+          maxbond += BONDDELTA;
+          memory->grow(bondlist,maxbond,3,"neighbor:bondlist");
+        }
+        bondlist[nbondlist][0] = i;
+        bondlist[nbondlist][1] = atom1;
+        bondlist[nbondlist][2] = bond_type[i][m];
+        nbondlist++;
       }
     }
 }
@@ -80,21 +80,21 @@ void Neighbor::bond_partial()
       if (bond_type[i][m] <= 0) continue;
       atom1 = atom->map(bond_atom[i][m]);
       if (atom1 == -1) {
-	char str[128];
-	sprintf(str,
-		"Bond atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
-		tag[i],bond_atom[i][m],me,update->ntimestep);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,
+                "Bond atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
+                tag[i],bond_atom[i][m],me,update->ntimestep);
+        error->one(FLERR,str);
       }
       if (newton_bond || i < atom1) {
-	if (nbondlist == maxbond) {
-	  maxbond += BONDDELTA;
-	  memory->grow(bondlist,maxbond,3,"neighbor:bondlist");
-	}
-	bondlist[nbondlist][0] = i;
-	bondlist[nbondlist][1] = atom1;
-	bondlist[nbondlist][2] = bond_type[i][m];
-	nbondlist++;
+        if (nbondlist == maxbond) {
+          maxbond += BONDDELTA;
+          memory->grow(bondlist,maxbond,3,"neighbor:bondlist");
+        }
+        bondlist[nbondlist][0] = i;
+        bondlist[nbondlist][1] = atom1;
+        bondlist[nbondlist][2] = bond_type[i][m];
+        nbondlist++;
       }
     }
 }
@@ -121,24 +121,24 @@ void Neighbor::angle_all()
       atom2 = atom->map(angle_atom2[i][m]);
       atom3 = atom->map(angle_atom3[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
-	char str[128];
-	sprintf(str,
-		"Angle atoms %d %d %d missing on proc %d at step " 
-		BIGINT_FORMAT,
-		angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m],
-		me,update->ntimestep);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,
+                "Angle atoms %d %d %d missing on proc %d at step "
+                BIGINT_FORMAT,
+                angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m],
+                me,update->ntimestep);
+        error->one(FLERR,str);
       }
       if (newton_bond || (i <= atom1 && i <= atom2 && i <= atom3)) {
-	if (nanglelist == maxangle) {
-	  maxangle += BONDDELTA;
-	  memory->grow(anglelist,maxangle,4,"neighbor:anglelist");
-	}
-	anglelist[nanglelist][0] = atom1;
-	anglelist[nanglelist][1] = atom2;
-	anglelist[nanglelist][2] = atom3;
-	anglelist[nanglelist][3] = angle_type[i][m];
-	nanglelist++;
+        if (nanglelist == maxangle) {
+          maxangle += BONDDELTA;
+          memory->grow(anglelist,maxangle,4,"neighbor:anglelist");
+        }
+        anglelist[nanglelist][0] = atom1;
+        anglelist[nanglelist][1] = atom2;
+        anglelist[nanglelist][2] = atom3;
+        anglelist[nanglelist][3] = angle_type[i][m];
+        nanglelist++;
       }
     }
 }
@@ -166,24 +166,24 @@ void Neighbor::angle_partial()
       atom2 = atom->map(angle_atom2[i][m]);
       atom3 = atom->map(angle_atom3[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
-	char str[128];
-	sprintf(str,
-		"Angle atoms %d %d %d missing on proc %d at step " 
-		BIGINT_FORMAT,
-		angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m],
-		me,update->ntimestep);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,
+                "Angle atoms %d %d %d missing on proc %d at step "
+                BIGINT_FORMAT,
+                angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m],
+                me,update->ntimestep);
+        error->one(FLERR,str);
       }
       if (newton_bond || (i <= atom1 && i <= atom2 && i <= atom3)) {
-	if (nanglelist == maxangle) {
-	  maxangle += BONDDELTA;
-	  memory->grow(anglelist,maxangle,4,"neighbor:anglelist");
-	}
-	anglelist[nanglelist][0] = atom1;
-	anglelist[nanglelist][1] = atom2;
-	anglelist[nanglelist][2] = atom3;
-	anglelist[nanglelist][3] = angle_type[i][m];
-	nanglelist++;
+        if (nanglelist == maxangle) {
+          maxangle += BONDDELTA;
+          memory->grow(anglelist,maxangle,4,"neighbor:anglelist");
+        }
+        anglelist[nanglelist][0] = atom1;
+        anglelist[nanglelist][1] = atom2;
+        anglelist[nanglelist][2] = atom3;
+        anglelist[nanglelist][3] = angle_type[i][m];
+        nanglelist++;
       }
     }
 }
@@ -212,27 +212,27 @@ void Neighbor::dihedral_all()
       atom3 = atom->map(dihedral_atom3[i][m]);
       atom4 = atom->map(dihedral_atom4[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
-	char str[128];
-	sprintf(str,
-		"Dihedral atoms %d %d %d %d missing on proc %d at step " 
-		BIGINT_FORMAT,
-		dihedral_atom1[i][m],dihedral_atom2[i][m],
-		dihedral_atom3[i][m],dihedral_atom4[i][m],
-		me,update->ntimestep);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,
+                "Dihedral atoms %d %d %d %d missing on proc %d at step "
+                BIGINT_FORMAT,
+                dihedral_atom1[i][m],dihedral_atom2[i][m],
+                dihedral_atom3[i][m],dihedral_atom4[i][m],
+                me,update->ntimestep);
+        error->one(FLERR,str);
       }
-      if (newton_bond || 
-	  (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
-	if (ndihedrallist == maxdihedral) {
-	  maxdihedral += BONDDELTA;
-	  memory->grow(dihedrallist,maxdihedral,5,"neighbor:dihedrallist");
-	}
-	dihedrallist[ndihedrallist][0] = atom1;
-	dihedrallist[ndihedrallist][1] = atom2;
-	dihedrallist[ndihedrallist][2] = atom3;
-	dihedrallist[ndihedrallist][3] = atom4;
-	dihedrallist[ndihedrallist][4] = dihedral_type[i][m];
-	ndihedrallist++;
+      if (newton_bond ||
+          (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
+        if (ndihedrallist == maxdihedral) {
+          maxdihedral += BONDDELTA;
+          memory->grow(dihedrallist,maxdihedral,5,"neighbor:dihedrallist");
+        }
+        dihedrallist[ndihedrallist][0] = atom1;
+        dihedrallist[ndihedrallist][1] = atom2;
+        dihedrallist[ndihedrallist][2] = atom3;
+        dihedrallist[ndihedrallist][3] = atom4;
+        dihedrallist[ndihedrallist][4] = dihedral_type[i][m];
+        ndihedrallist++;
       }
     }
 }
@@ -262,27 +262,27 @@ void Neighbor::dihedral_partial()
       atom3 = atom->map(dihedral_atom3[i][m]);
       atom4 = atom->map(dihedral_atom4[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
-	char str[128];
-	sprintf(str,
-		"Dihedral atoms %d %d %d %d missing on proc %d at step " 
-		BIGINT_FORMAT,
-		dihedral_atom1[i][m],dihedral_atom2[i][m],
-		dihedral_atom3[i][m],dihedral_atom4[i][m],
-		me,update->ntimestep);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,
+                "Dihedral atoms %d %d %d %d missing on proc %d at step "
+                BIGINT_FORMAT,
+                dihedral_atom1[i][m],dihedral_atom2[i][m],
+                dihedral_atom3[i][m],dihedral_atom4[i][m],
+                me,update->ntimestep);
+        error->one(FLERR,str);
       }
-      if (newton_bond || 
-	  (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
-	if (ndihedrallist == maxdihedral) {
-	  maxdihedral += BONDDELTA;
-	  memory->grow(dihedrallist,maxdihedral,5,"neighbor:dihedrallist");
-	}
-	dihedrallist[ndihedrallist][0] = atom1;
-	dihedrallist[ndihedrallist][1] = atom2;
-	dihedrallist[ndihedrallist][2] = atom3;
-	dihedrallist[ndihedrallist][3] = atom4;
-	dihedrallist[ndihedrallist][4] = dihedral_type[i][m];
-	ndihedrallist++;
+      if (newton_bond ||
+          (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
+        if (ndihedrallist == maxdihedral) {
+          maxdihedral += BONDDELTA;
+          memory->grow(dihedrallist,maxdihedral,5,"neighbor:dihedrallist");
+        }
+        dihedrallist[ndihedrallist][0] = atom1;
+        dihedrallist[ndihedrallist][1] = atom2;
+        dihedrallist[ndihedrallist][2] = atom3;
+        dihedrallist[ndihedrallist][3] = atom4;
+        dihedrallist[ndihedrallist][4] = dihedral_type[i][m];
+        ndihedrallist++;
       }
     }
 }
@@ -311,27 +311,27 @@ void Neighbor::improper_all()
       atom3 = atom->map(improper_atom3[i][m]);
       atom4 = atom->map(improper_atom4[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
-	char str[128];
-	sprintf(str,
-		"Improper atoms %d %d %d %d missing on proc %d at step " 
-		BIGINT_FORMAT,
-		improper_atom1[i][m],improper_atom2[i][m],
-		improper_atom3[i][m],improper_atom4[i][m],
-		me,update->ntimestep);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,
+                "Improper atoms %d %d %d %d missing on proc %d at step "
+                BIGINT_FORMAT,
+                improper_atom1[i][m],improper_atom2[i][m],
+                improper_atom3[i][m],improper_atom4[i][m],
+                me,update->ntimestep);
+        error->one(FLERR,str);
       }
-      if (newton_bond || 
-	  (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
-	if (nimproperlist == maximproper) {
-	  maximproper += BONDDELTA;
-	  memory->grow(improperlist,maximproper,5,"neighbor:improperlist");
-	}
-	improperlist[nimproperlist][0] = atom1;
-	improperlist[nimproperlist][1] = atom2;
-	improperlist[nimproperlist][2] = atom3;
-	improperlist[nimproperlist][3] = atom4;
-	improperlist[nimproperlist][4] = improper_type[i][m];
-	nimproperlist++;
+      if (newton_bond ||
+          (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
+        if (nimproperlist == maximproper) {
+          maximproper += BONDDELTA;
+          memory->grow(improperlist,maximproper,5,"neighbor:improperlist");
+        }
+        improperlist[nimproperlist][0] = atom1;
+        improperlist[nimproperlist][1] = atom2;
+        improperlist[nimproperlist][2] = atom3;
+        improperlist[nimproperlist][3] = atom4;
+        improperlist[nimproperlist][4] = improper_type[i][m];
+        nimproperlist++;
       }
     }
 }
@@ -361,27 +361,27 @@ void Neighbor::improper_partial()
       atom3 = atom->map(improper_atom3[i][m]);
       atom4 = atom->map(improper_atom4[i][m]);
       if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
-	char str[128];
-	sprintf(str,
-		"Improper atoms %d %d %d %d missing on proc %d at step " 
-		BIGINT_FORMAT,
-		improper_atom1[i][m],improper_atom2[i][m],
-		improper_atom3[i][m],improper_atom4[i][m],
-		me,update->ntimestep);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,
+                "Improper atoms %d %d %d %d missing on proc %d at step "
+                BIGINT_FORMAT,
+                improper_atom1[i][m],improper_atom2[i][m],
+                improper_atom3[i][m],improper_atom4[i][m],
+                me,update->ntimestep);
+        error->one(FLERR,str);
       }
-      if (newton_bond || 
-	  (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
-	if (nimproperlist == maximproper) {
-	  maximproper += BONDDELTA;
-	  memory->grow(improperlist,maximproper,5,"neighbor:improperlist");
-	}
-	improperlist[nimproperlist][0] = atom1;
-	improperlist[nimproperlist][1] = atom2;
-	improperlist[nimproperlist][2] = atom3;
-	improperlist[nimproperlist][3] = atom4;
-	improperlist[nimproperlist][4] = improper_type[i][m];
-	nimproperlist++;
+      if (newton_bond ||
+          (i <= atom1 && i <= atom2 && i <= atom3 && i <= atom4)) {
+        if (nimproperlist == maximproper) {
+          maximproper += BONDDELTA;
+          memory->grow(improperlist,maximproper,5,"neighbor:improperlist");
+        }
+        improperlist[nimproperlist][0] = atom1;
+        improperlist[nimproperlist][1] = atom2;
+        improperlist[nimproperlist][2] = atom3;
+        improperlist[nimproperlist][3] = atom4;
+        improperlist[nimproperlist][4] = improper_type[i][m];
+        nimproperlist++;
       }
     }
 }
diff --git a/src/neigh_bond.h b/src/neigh_bond.h
index a79fa16ef3..b9446c7c3c 100644
--- a/src/neigh_bond.h
+++ b/src/neigh_bond.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/neigh_derive.cpp b/src/neigh_derive.cpp
index 7c83088b82..4bda3d71d0 100644
--- a/src/neigh_derive.cpp
+++ b/src/neigh_derive.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -135,13 +135,13 @@ void Neighbor::half_from_full_newton(NeighList *list)
       joriginal = jlist[jj];
       j = joriginal & NEIGHMASK;
       if (j < nlocal) {
-	if (i > j) continue;
+        if (i > j) continue;
       } else {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        }
       }
       neighptr[n++] = joriginal;
     }
@@ -289,9 +289,9 @@ void Neighbor::skip_from_granular(NeighList *list)
       npnt = 0;
       npage++;
       if (npage == list->maxpage) {
-	pages = list->add_pages();
-	pages_touch = listgranhistory->add_pages();
-	pages_shear = listgranhistory->dpages;
+        pages = list->add_pages();
+        pages_touch = listgranhistory->add_pages();
+        pages_shear = listgranhistory->dpages;
       }
     }
 
@@ -406,17 +406,17 @@ void Neighbor::skip_from_respa(NeighList *list)
       npnt_inner = 0;
       npage_inner++;
       if (npage_inner == listinner->maxpage)
-	pages_inner = listinner->add_pages();
+        pages_inner = listinner->add_pages();
     }
     neighptr_inner = &pages_inner[npage_inner][npnt_inner];
     n_inner = 0;
 
     if (respamiddle) {
       if (pgsize - npnt_middle < oneatom) {
-	npnt_middle = 0;
-	npage_middle++;
-	if (npage_middle == listmiddle->maxpage)
-	  pages_middle = listmiddle->add_pages();
+        npnt_middle = 0;
+        npage_middle++;
+        if (npage_middle == listmiddle->maxpage)
+          pages_middle = listmiddle->add_pages();
       }
       neighptr_middle = &pages_middle[npage_middle][npnt_middle];
       n_middle = 0;
@@ -453,10 +453,10 @@ void Neighbor::skip_from_respa(NeighList *list)
       jnum = numneigh_middle_skip[i];
 
       for (jj = 0; jj < jnum; jj++) {
-	joriginal = jlist[jj];
-	j = joriginal & NEIGHMASK;
-	if (ijskip[itype][type[j]]) continue;
-	neighptr_middle[n_middle++] = joriginal;
+        joriginal = jlist[jj];
+        j = joriginal & NEIGHMASK;
+        if (ijskip[itype][type[j]]) continue;
+        neighptr_middle[n_middle++] = joriginal;
       }
     }
 
@@ -478,7 +478,7 @@ void Neighbor::skip_from_respa(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (n_middle > oneatom)
-	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
+        error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
     }
   }
 
diff --git a/src/neigh_derive.h b/src/neigh_derive.h
index 2b9b9d420c..5ad76c98af 100644
--- a/src/neigh_derive.h
+++ b/src/neigh_derive.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/neigh_full.cpp b/src/neigh_full.cpp
index 76e2888ae0..15ca926340 100644
--- a/src/neigh_full.cpp
+++ b/src/neigh_full.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -87,10 +87,10 @@ void Neighbor::full_nsq(NeighList *list)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
       }
     }
 
@@ -162,34 +162,34 @@ void Neighbor::full_nsq_ghost(NeighList *list)
 
     if (i < nlocal) {
       for (j = 0; j < nall; j++) {
-	if (i == j) continue;
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-	
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        if (i == j) continue;
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     } else {
       for (j = 0; j < nall; j++) {
-	if (i == j) continue;
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-	
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighghostsq[itype][jtype])
-	  neighptr[n++] = j;
+        if (i == j) continue;
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighghostsq[itype][jtype])
+          neighptr[n++] = j;
       }
     }
 
@@ -268,22 +268,22 @@ void Neighbor::full_bin(NeighList *list)
 
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (i == j) continue;
-
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        if (i == j) continue;
+
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
@@ -365,49 +365,49 @@ void Neighbor::full_bin_ghost(NeighList *list)
     if (i < nlocal) {
       ibin = coord2bin(x[i]);
       for (k = 0; k < nstencil; k++) {
-	for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	  if (i == j) continue;
-	  
-	  jtype = type[j];
-	  if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-	
-	  delx = xtmp - x[j][0];
-	  dely = ytmp - x[j][1];
-	  delz = ztmp - x[j][2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-	
-	  if (rsq <= cutneighsq[itype][jtype]) {
-	    if (molecular) {
-	      which = find_special(special[i],nspecial[i],tag[j]);
-	      if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	    } else neighptr[n++] = j;
-	  }
-	}
+        for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
+          if (i == j) continue;
+
+          jtype = type[j];
+          if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+          delx = xtmp - x[j][0];
+          dely = ytmp - x[j][1];
+          delz = ztmp - x[j][2];
+          rsq = delx*delx + dely*dely + delz*delz;
+
+          if (rsq <= cutneighsq[itype][jtype]) {
+            if (molecular) {
+              which = find_special(special[i],nspecial[i],tag[j]);
+              if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+            } else neighptr[n++] = j;
+          }
+        }
       }
 
     } else {
       ibin = coord2bin(x[i],xbin,ybin,zbin);
       for (k = 0; k < nstencil; k++) {
-	xbin2 = xbin + stencilxyz[k][0];
-	ybin2 = ybin + stencilxyz[k][1];
-	zbin2 = zbin + stencilxyz[k][2];
-	if (xbin2 < 0 || xbin2 >= mbinx ||
-	    ybin2 < 0 || ybin2 >= mbiny ||
-	    zbin2 < 0 || zbin2 >= mbinz) continue;
-	for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	  if (i == j) continue;
-	  
-	  jtype = type[j];
-	  if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-	
-	  delx = xtmp - x[j][0];
-	  dely = ytmp - x[j][1];
-	  delz = ztmp - x[j][2];
-	  rsq = delx*delx + dely*dely + delz*delz;
-
-	  if (rsq <= cutneighghostsq[itype][jtype])
-	    neighptr[n++] = j;
-	}
+        xbin2 = xbin + stencilxyz[k][0];
+        ybin2 = ybin + stencilxyz[k][1];
+        zbin2 = zbin + stencilxyz[k][2];
+        if (xbin2 < 0 || xbin2 >= mbinx ||
+            ybin2 < 0 || ybin2 >= mbiny ||
+            zbin2 < 0 || zbin2 >= mbinz) continue;
+        for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
+          if (i == j) continue;
+
+          jtype = type[j];
+          if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+          delx = xtmp - x[j][0];
+          dely = ytmp - x[j][1];
+          delz = ztmp - x[j][2];
+          rsq = delx*delx + dely*dely + delz*delz;
+
+          if (rsq <= cutneighghostsq[itype][jtype])
+            neighptr[n++] = j;
+        }
       }
     }
 
@@ -493,23 +493,23 @@ void Neighbor::full_multi(NeighList *list)
     ns = nstencil_multi[itype];
     for (k = 0; k < ns; k++) {
       for (j = binhead[ibin+s[k]]; j >= 0; j = bins[j]) {
-	jtype = type[j];
-	if (cutsq[jtype] < distsq[k]) continue;
-	if (i == j) continue;
-
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        jtype = type[j];
+        if (cutsq[jtype] < distsq[k]) continue;
+        if (i == j) continue;
+
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
diff --git a/src/neigh_full.h b/src/neigh_full.h
index 2b9b9d420c..5ad76c98af 100644
--- a/src/neigh_full.h
+++ b/src/neigh_full.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/neigh_gran.cpp b/src/neigh_gran.cpp
index 1c8f8338ab..a5a70b2b40 100644
--- a/src/neigh_gran.cpp
+++ b/src/neigh_gran.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -84,11 +84,11 @@ void Neighbor::granular_nsq_no_newton(NeighList *list)
       npnt = 0;
       npage++;
       if (npage == list->maxpage) {
-	pages = list->add_pages();
-	if (fix_history) {
-	  pages_touch = listgranhistory->add_pages();
-	  pages_shear = listgranhistory->dpages;
-	}
+        pages = list->add_pages();
+        if (fix_history) {
+          pages_touch = listgranhistory->add_pages();
+          pages_shear = listgranhistory->dpages;
+        }
       }
     }
 
@@ -119,34 +119,34 @@ void Neighbor::granular_nsq_no_newton(NeighList *list)
       cutsq = (radsum+skin) * (radsum+skin);
 
       if (rsq <= cutsq) {
-	neighptr[n] = j;
-
-	if (fix_history) {
-	  if (rsq < radsum*radsum) {
-	    for (m = 0; m < npartner[i]; m++)
-	      if (partner[i][m] == tag[j]) break;
-	    if (m < npartner[i]) {
-	      touchptr[n] = 1;
-	      shearptr[nn++] = shearpartner[i][m][0];
-	      shearptr[nn++] = shearpartner[i][m][1];
-	      shearptr[nn++] = shearpartner[i][m][2];
-	    } else {
-	      touchptr[n] = 0;
-	      shearptr[nn++] = 0.0;
-	      shearptr[nn++] = 0.0;
-	      shearptr[nn++] = 0.0;
-	    }
-	  } else {
-	    touchptr[n] = 0;
-	    shearptr[nn++] = 0.0;
-	    shearptr[nn++] = 0.0;
-	    shearptr[nn++] = 0.0;
-	  }
-	}
-
-	n++;
+        neighptr[n] = j;
+
+        if (fix_history) {
+          if (rsq < radsum*radsum) {
+            for (m = 0; m < npartner[i]; m++)
+              if (partner[i][m] == tag[j]) break;
+            if (m < npartner[i]) {
+              touchptr[n] = 1;
+              shearptr[nn++] = shearpartner[i][m][0];
+              shearptr[nn++] = shearpartner[i][m][1];
+              shearptr[nn++] = shearpartner[i][m][2];
+            } else {
+              touchptr[n] = 0;
+              shearptr[nn++] = 0.0;
+              shearptr[nn++] = 0.0;
+              shearptr[nn++] = 0.0;
+            }
+          } else {
+            touchptr[n] = 0;
+            shearptr[nn++] = 0.0;
+            shearptr[nn++] = 0.0;
+            shearptr[nn++] = 0.0;
+          }
+        }
+
+        n++;
       }
-    }	       
+    }
 
     ilist[inum++] = i;
     firstneigh[i] = neighptr;
@@ -224,18 +224,18 @@ void Neighbor::granular_nsq_newton(NeighList *list)
       if (includegroup && !(mask[j] & bitmask)) continue;
 
       if (j >= nlocal) {
-	jtag = tag[j];
-	if (itag > jtag) {
-	  if ((itag+jtag) % 2 == 0) continue;
-	} else if (itag < jtag) {
-	  if ((itag+jtag) % 2 == 1) continue;
-	} else {
-	  if (x[j][2] < ztmp) continue;
-	  if (x[j][2] == ztmp) {
-	    if (x[j][1] < ytmp) continue;
-	    if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	  }
-	}
+        jtag = tag[j];
+        if (itag > jtag) {
+          if ((itag+jtag) % 2 == 0) continue;
+        } else if (itag < jtag) {
+          if ((itag+jtag) % 2 == 1) continue;
+        } else {
+          if (x[j][2] < ztmp) continue;
+          if (x[j][2] == ztmp) {
+            if (x[j][1] < ytmp) continue;
+            if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+          }
+        }
       }
 
       if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
@@ -246,7 +246,7 @@ void Neighbor::granular_nsq_newton(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
       radsum = radi + radius[j];
       cutsq = (radsum+skin) * (radsum+skin);
-      
+
       if (rsq <= cutsq) neighptr[n++] = j;
     }
 
@@ -330,11 +330,11 @@ void Neighbor::granular_bin_no_newton(NeighList *list)
       npnt = 0;
       npage++;
       if (npage == list->maxpage) {
-	pages = list->add_pages();
-	if (fix_history) {
-	  pages_touch = listgranhistory->add_pages();
-	  pages_shear = listgranhistory->dpages;
-	}
+        pages = list->add_pages();
+        if (fix_history) {
+          pages_touch = listgranhistory->add_pages();
+          pages_shear = listgranhistory->dpages;
+        }
       }
     }
 
@@ -359,44 +359,44 @@ void Neighbor::granular_bin_no_newton(NeighList *list)
 
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (j <= i) continue;
-	if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-	radsum = radi + radius[j];
-	cutsq = (radsum+skin) * (radsum+skin);
-
-	if (rsq <= cutsq) {
-	  neighptr[n] = j;
-
-	  if (fix_history) {
-	    if (rsq < radsum*radsum) {
-	      for (m = 0; m < npartner[i]; m++)
-		if (partner[i][m] == tag[j]) break;
-	      if (m < npartner[i]) {
-		touchptr[n] = 1;
-		shearptr[nn++] = shearpartner[i][m][0];
-		shearptr[nn++] = shearpartner[i][m][1];
-		shearptr[nn++] = shearpartner[i][m][2];
-	      } else {
-		touchptr[n] = 0;
-		shearptr[nn++] = 0.0;
-		shearptr[nn++] = 0.0;
-		shearptr[nn++] = 0.0;
-	      }
-	    } else {
-	      touchptr[n] = 0;
-	      shearptr[nn++] = 0.0;
-	      shearptr[nn++] = 0.0;
-	      shearptr[nn++] = 0.0;
-	    }
-	  }
-
-	  n++;
-	}
+        if (j <= i) continue;
+        if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+        radsum = radi + radius[j];
+        cutsq = (radsum+skin) * (radsum+skin);
+
+        if (rsq <= cutsq) {
+          neighptr[n] = j;
+
+          if (fix_history) {
+            if (rsq < radsum*radsum) {
+              for (m = 0; m < npartner[i]; m++)
+                if (partner[i][m] == tag[j]) break;
+              if (m < npartner[i]) {
+                touchptr[n] = 1;
+                shearptr[nn++] = shearpartner[i][m][0];
+                shearptr[nn++] = shearpartner[i][m][1];
+                shearptr[nn++] = shearpartner[i][m][2];
+              } else {
+                touchptr[n] = 0;
+                shearptr[nn++] = 0.0;
+                shearptr[nn++] = 0.0;
+                shearptr[nn++] = 0.0;
+              }
+            } else {
+              touchptr[n] = 0;
+              shearptr[nn++] = 0.0;
+              shearptr[nn++] = 0.0;
+              shearptr[nn++] = 0.0;
+            }
+          }
+
+          n++;
+        }
       }
     }
 
@@ -477,11 +477,11 @@ void Neighbor::granular_bin_newton(NeighList *list)
 
     for (j = bins[i]; j >= 0; j = bins[j]) {
       if (j >= nlocal) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        }
       }
 
       if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
@@ -501,16 +501,16 @@ void Neighbor::granular_bin_newton(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
+        if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
 
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-	radsum = radi + radius[j];
-	cutsq = (radsum+skin) * (radsum+skin);
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+        radsum = radi + radius[j];
+        cutsq = (radsum+skin) * (radsum+skin);
 
-	if (rsq <= cutsq) neighptr[n++] = j;
+        if (rsq <= cutsq) neighptr[n++] = j;
       }
     }
 
@@ -590,25 +590,25 @@ void Neighbor::granular_bin_newton_tri(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp) {
-	    if (x[j][0] < xtmp) continue;
-	    if (x[j][0] == xtmp && j <= i) continue;
-	  }
-	}
-
-	if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-	radsum = radi + radius[j];
-	cutsq = (radsum+skin) * (radsum+skin);
-
-	if (rsq <= cutsq) neighptr[n++] = j;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp) {
+            if (x[j][0] < xtmp) continue;
+            if (x[j][0] == xtmp && j <= i) continue;
+          }
+        }
+
+        if (exclude && exclusion(i,j,type[i],type[j],mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+        radsum = radi + radius[j];
+        cutsq = (radsum+skin) * (radsum+skin);
+
+        if (rsq <= cutsq) neighptr[n++] = j;
       }
     }
 
diff --git a/src/neigh_gran.h b/src/neigh_gran.h
index 2b9b9d420c..5ad76c98af 100644
--- a/src/neigh_gran.h
+++ b/src/neigh_gran.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/neigh_half_bin.cpp b/src/neigh_half_bin.cpp
index 45f84f9af4..09a5ccab92 100644
--- a/src/neigh_half_bin.cpp
+++ b/src/neigh_half_bin.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -85,22 +85,22 @@ void Neighbor::half_bin_no_newton(NeighList *list)
 
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (j <= i) continue;
-
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        if (j <= i) continue;
+
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
@@ -151,7 +151,7 @@ void Neighbor::half_bin_newton(NeighList *list)
   int **pages = list->pages;
   int nstencil = list->nstencil;
   int *stencil = list->stencil;
-  
+
   int inum = 0;
   int npage = 0;
   int npnt = 0;
@@ -178,11 +178,11 @@ void Neighbor::half_bin_newton(NeighList *list)
 
     for (j = bins[i]; j >= 0; j = bins[j]) {
       if (j >= nlocal) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        }
       }
 
       jtype = type[j];
@@ -194,10 +194,10 @@ void Neighbor::half_bin_newton(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
       }
     }
 
@@ -206,20 +206,20 @@ void Neighbor::half_bin_newton(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
@@ -300,29 +300,29 @@ void Neighbor::half_bin_newton_tri(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp) {
-	    if (x[j][0] < xtmp) continue;
-	    if (x[j][0] == xtmp && j <= i) continue;
-	  }
-	}
-
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp) {
+            if (x[j][0] < xtmp) continue;
+            if (x[j][0] == xtmp && j <= i) continue;
+          }
+        }
+
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
diff --git a/src/neigh_half_bin.h b/src/neigh_half_bin.h
index 2b9b9d420c..5ad76c98af 100644
--- a/src/neigh_half_bin.h
+++ b/src/neigh_half_bin.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/neigh_half_multi.cpp b/src/neigh_half_multi.cpp
index bc9404793c..917699c444 100644
--- a/src/neigh_half_multi.cpp
+++ b/src/neigh_half_multi.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -92,23 +92,23 @@ void Neighbor::half_multi_no_newton(NeighList *list)
     ns = nstencil_multi[itype];
     for (k = 0; k < ns; k++) {
       for (j = binhead[ibin+s[k]]; j >= 0; j = bins[j]) {
-	if (j <= i) continue;
-	jtype = type[j];
-	if (cutsq[jtype] < distsq[k]) continue;
-
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        if (j <= i) continue;
+        jtype = type[j];
+        if (cutsq[jtype] < distsq[k]) continue;
+
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
@@ -189,11 +189,11 @@ void Neighbor::half_multi_newton(NeighList *list)
 
     for (j = bins[i]; j >= 0; j = bins[j]) {
       if (j >= nlocal) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        }
       }
 
       jtype = type[j];
@@ -205,10 +205,10 @@ void Neighbor::half_multi_newton(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
       }
     }
 
@@ -222,22 +222,22 @@ void Neighbor::half_multi_newton(NeighList *list)
     ns = nstencil_multi[itype];
     for (k = 0; k < ns; k++) {
       for (j = binhead[ibin+s[k]]; j >= 0; j = bins[j]) {
-	jtype = type[j];
-	if (cutsq[jtype] < distsq[k]) continue;
-
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        jtype = type[j];
+        if (cutsq[jtype] < distsq[k]) continue;
+
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
@@ -327,30 +327,30 @@ void Neighbor::half_multi_newton_tri(NeighList *list)
     ns = nstencil_multi[itype];
     for (k = 0; k < ns; k++) {
       for (j = binhead[ibin+s[k]]; j >= 0; j = bins[j]) {
-	jtype = type[j];
-	if (cutsq[jtype] < distsq[k]) continue;
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp) {
-	    if (x[j][0] < xtmp) continue;
-	    if (x[j][0] == xtmp && j <= i) continue;
-	  }
-	}
-
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-	}
+        jtype = type[j];
+        if (cutsq[jtype] < distsq[k]) continue;
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp) {
+            if (x[j][0] < xtmp) continue;
+            if (x[j][0] == xtmp && j <= i) continue;
+          }
+        }
+
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+        }
       }
     }
 
diff --git a/src/neigh_half_multi.h b/src/neigh_half_multi.h
index 2b9b9d420c..5ad76c98af 100644
--- a/src/neigh_half_multi.h
+++ b/src/neigh_half_multi.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/neigh_half_nsq.cpp b/src/neigh_half_nsq.cpp
index c3361736ef..22f0952d15 100644
--- a/src/neigh_half_nsq.cpp
+++ b/src/neigh_half_nsq.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -87,10 +87,10 @@ void Neighbor::half_nsq_no_newton(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
       }
     }
 
@@ -168,18 +168,18 @@ void Neighbor::half_nsq_newton(NeighList *list)
       if (includegroup && !(mask[j] & bitmask)) continue;
 
       if (j >= nlocal) {
-	jtag = tag[j];
-	if (itag > jtag) {
-	  if ((itag+jtag) % 2 == 0) continue;
-	} else if (itag < jtag) {
-	  if ((itag+jtag) % 2 == 1) continue;
-	} else {
-	  if (x[j][2] < ztmp) continue;
-	  if (x[j][2] == ztmp) {
-	    if (x[j][1] < ytmp) continue;
-	    if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	  }
-	}
+        jtag = tag[j];
+        if (itag > jtag) {
+          if ((itag+jtag) % 2 == 0) continue;
+        } else if (itag < jtag) {
+          if ((itag+jtag) % 2 == 1) continue;
+        } else {
+          if (x[j][2] < ztmp) continue;
+          if (x[j][2] == ztmp) {
+            if (x[j][1] < ytmp) continue;
+            if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+          }
+        }
       }
 
       jtype = type[j];
@@ -191,10 +191,10 @@ void Neighbor::half_nsq_newton(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
       }
     }
 
diff --git a/src/neigh_half_nsq.h b/src/neigh_half_nsq.h
index 2b9b9d420c..5ad76c98af 100644
--- a/src/neigh_half_nsq.h
+++ b/src/neigh_half_nsq.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/neigh_list.cpp b/src/neigh_list.cpp
index a70b626f7f..e294dcaf48 100644
--- a/src/neigh_list.cpp
+++ b/src/neigh_list.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -123,11 +123,11 @@ void NeighList::grow(int nmax)
   memory->create(ilist,maxatoms,"neighlist:ilist");
   memory->create(numneigh,maxatoms,"neighlist:numneigh");
   firstneigh = (int **) memory->smalloc(maxatoms*sizeof(int *),
-					"neighlist:firstneigh");
+                                        "neighlist:firstneigh");
 
-  if (dnum) 
+  if (dnum)
     firstdouble = (double **) memory->smalloc(maxatoms*sizeof(double *),
-					      "neighlist:firstdouble");
+                                              "neighlist:firstdouble");
 }
 
 /* ----------------------------------------------------------------------
@@ -145,8 +145,8 @@ void NeighList::stencil_allocate(int smax, int style)
       memory->destroy(stencil);
       memory->create(stencil,maxstencil,"neighlist:stencil");
       if (ghostflag) {
-	memory->destroy(stencilxyz);
-	memory->create(stencilxyz,maxstencil,3,"neighlist:stencilxyz");
+        memory->destroy(stencilxyz);
+        memory->create(stencilxyz,maxstencil,3,"neighlist:stencilxyz");
       }
     }
 
@@ -157,20 +157,20 @@ void NeighList::stencil_allocate(int smax, int style)
       stencil_multi = new int*[n+1];
       distsq_multi = new double*[n+1];
       for (i = 1; i <= n; i++) {
-	nstencil_multi[i] = 0;
-	stencil_multi[i] = NULL;
-	distsq_multi[i] = NULL;
+        nstencil_multi[i] = 0;
+        stencil_multi[i] = NULL;
+        distsq_multi[i] = NULL;
       }
     }
     if (smax > maxstencil_multi) {
       maxstencil_multi = smax;
       for (i = 1; i <= n; i++) {
-	memory->destroy(stencil_multi[i]);
-	memory->destroy(distsq_multi[i]);
-	memory->create(stencil_multi[i],maxstencil_multi,
-		       "neighlist:stencil_multi");
-	memory->create(distsq_multi[i],maxstencil_multi,
-		       "neighlist:distsq_multi");
+        memory->destroy(stencil_multi[i]);
+        memory->destroy(distsq_multi[i]);
+        memory->create(stencil_multi[i],maxstencil_multi,
+                       "neighlist:stencil_multi");
+        memory->create(distsq_multi[i],maxstencil_multi,
+                       "neighlist:distsq_multi");
       }
     }
   }
@@ -185,13 +185,13 @@ int **NeighList::add_pages(int howmany)
   int toppage = maxpage;
   maxpage += howmany*PGDELTA;
 
-  pages = (int **) 
+  pages = (int **)
     memory->srealloc(pages,maxpage*sizeof(int *),"neighlist:pages");
   for (int i = toppage; i < maxpage; i++)
     memory->create(pages[i],pgsize,"neighlist:pages[i]");
 
   if (dnum) {
-    dpages = (double **) 
+    dpages = (double **)
       memory->srealloc(dpages,maxpage*sizeof(double *),"neighlist:dpages");
     for (int i = toppage; i < maxpage; i++)
       memory->create(dpages[i],dnum*pgsize,"neighlist:dpages[i]");
diff --git a/src/neigh_list.h b/src/neigh_list.h
index a8857811a3..ddecb4bbf2 100644
--- a/src/neigh_list.h
+++ b/src/neigh_list.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -52,7 +52,7 @@ class NeighList : protected Pointers {
   // settings and pointers for related neighbor lists and fixes
 
   NeighList *listgranhistory;          // point at history list
-  class FixShearHistory *fix_history;  // fix that stores history info 
+  class FixShearHistory *fix_history;  // fix that stores history info
 
   int respamiddle;              // 1 if this respaouter has middle list
   NeighList *listinner;         // me = respaouter, point to respainner
diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp
index 2146009a99..da334da65e 100644
--- a/src/neigh_request.cpp
+++ b/src/neigh_request.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -83,7 +83,7 @@ int NeighRequest::identical(NeighRequest *other)
 
   if (requestor != other->requestor) same = 0;
   if (id != other->id) same = 0;
-  
+
   if (pair != other->pair) same = 0;
   if (fix != other->fix) same = 0;
   if (compute != other->compute) same = 0;
@@ -156,7 +156,7 @@ int NeighRequest::same_skip(NeighRequest *other)
       if (iskip[i] != other->iskip[i]) same = 0;
     for (i = 1; i <= ntypes; i++)
       for (j = 1; j <= ntypes; j++)
-	if (ijskip[i][j] != other->ijskip[i][j]) same = 0;
+        if (ijskip[i][j] != other->ijskip[i][j]) same = 0;
   }
 
   return same;
diff --git a/src/neigh_request.h b/src/neigh_request.h
index e3dcc915a7..f5947cf729 100644
--- a/src/neigh_request.h
+++ b/src/neigh_request.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -40,7 +40,7 @@ class NeighRequest : protected Pointers {
   int gran;              // 1 if granular list
   int granhistory;       // 1 if granular history list
 
-  int respainner;        // 1 if a rRESPA inner list        
+  int respainner;        // 1 if a rRESPA inner list
   int respamiddle;       // 1 if a rRESPA middle list
   int respaouter;        // 1 if a rRESPA outer list
 
diff --git a/src/neigh_respa.cpp b/src/neigh_respa.cpp
index c71d3c583a..6770b26a51 100644
--- a/src/neigh_respa.cpp
+++ b/src/neigh_respa.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -96,17 +96,17 @@ void Neighbor::respa_nsq_no_newton(NeighList *list)
       npnt_inner = 0;
       npage_inner++;
       if (npage_inner == listinner->maxpage)
-	pages_inner = listinner->add_pages();
+        pages_inner = listinner->add_pages();
     }
     neighptr_inner = &pages_inner[npage_inner][npnt_inner];
     n_inner = 0;
 
     if (respamiddle) {
       if (pgsize - npnt_middle < oneatom) {
-	npnt_middle = 0;
-	npage_middle++;
-	if (npage_middle == listmiddle->maxpage)
-	  pages_middle = listmiddle->add_pages();
+        npnt_middle = 0;
+        npage_middle++;
+        if (npage_middle == listmiddle->maxpage)
+          pages_middle = listmiddle->add_pages();
       }
       neighptr_middle = &pages_middle[npage_middle][npnt_middle];
       n_middle = 0;
@@ -130,20 +130,20 @@ void Neighbor::respa_nsq_no_newton(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
 
         if (rsq < cut_inner_sq) {
-	  if (which == 0) neighptr_inner[n_inner++] = j;
-	  else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          if (which == 0) neighptr_inner[n_inner++] = j;
+          else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
         }
 
         if (respamiddle && rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	  if (which == 0) neighptr_middle[n_middle++] = j;
-	  else if (which > 0) 
-	    neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+          if (which == 0) neighptr_middle[n_middle++] = j;
+          else if (which > 0)
+            neighptr_middle[n_middle++] = j ^ (which << SBBITS);
         }
       }
     }
@@ -168,7 +168,7 @@ void Neighbor::respa_nsq_no_newton(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (n_middle > oneatom)
-	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
+        error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
     }
 
     inum++;
@@ -257,17 +257,17 @@ void Neighbor::respa_nsq_newton(NeighList *list)
       npnt_inner = 0;
       npage_inner++;
       if (npage_inner == listinner->maxpage)
-	pages_inner = listinner->add_pages();
+        pages_inner = listinner->add_pages();
     }
     neighptr_inner = &pages_inner[npage_inner][npnt_inner];
     n_inner = 0;
 
     if (respamiddle) {
       if (pgsize - npnt_middle < oneatom) {
-	npnt_middle = 0;
-	npage_middle++;
-	if (npage_middle == listmiddle->maxpage)
-	  pages_middle = listmiddle->add_pages();
+        npnt_middle = 0;
+        npage_middle++;
+        if (npage_middle == listmiddle->maxpage)
+          pages_middle = listmiddle->add_pages();
       }
       neighptr_middle = &pages_middle[npage_middle][npnt_middle];
       n_middle = 0;
@@ -285,18 +285,18 @@ void Neighbor::respa_nsq_newton(NeighList *list)
       if (includegroup && !(mask[j] & bitmask)) continue;
 
       if (j >= nlocal) {
-	jtag = tag[j];
-	if (itag > jtag) {
-	  if ((itag+jtag) % 2 == 0) continue;
-	} else if (itag < jtag) {
-	  if ((itag+jtag) % 2 == 1) continue;
-	} else {
-	  if (x[j][2] < ztmp) continue;
-	  if (x[j][2] == ztmp) {
-	    if (x[j][1] < ytmp) continue;
-	    if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	  }
-	}
+        jtag = tag[j];
+        if (itag > jtag) {
+          if ((itag+jtag) % 2 == 0) continue;
+        } else if (itag < jtag) {
+          if ((itag+jtag) % 2 == 1) continue;
+        } else {
+          if (x[j][2] < ztmp) continue;
+          if (x[j][2] == ztmp) {
+            if (x[j][1] < ytmp) continue;
+            if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+          }
+        }
       }
 
       jtype = type[j];
@@ -308,21 +308,21 @@ void Neighbor::respa_nsq_newton(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
 
         if (rsq < cut_inner_sq) {
-	  if (which == 0) neighptr_inner[n_inner++] = j;
-	  else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          if (which == 0) neighptr_inner[n_inner++] = j;
+          else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
         }
 
-        if (respamiddle && 
-	    rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	  if (which == 0) neighptr_middle[n_middle++] = j;
-	  else if (which > 0) 
-	    neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+        if (respamiddle &&
+            rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
+          if (which == 0) neighptr_middle[n_middle++] = j;
+          else if (which > 0)
+            neighptr_middle[n_middle++] = j ^ (which << SBBITS);
         }
       }
     }
@@ -347,7 +347,7 @@ void Neighbor::respa_nsq_newton(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (n_middle > oneatom)
-	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
+        error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
     }
 
     inum++;
@@ -438,17 +438,17 @@ void Neighbor::respa_bin_no_newton(NeighList *list)
       npnt_inner = 0;
       npage_inner++;
       if (npage_inner == listinner->maxpage)
-	pages_inner = listinner->add_pages();
+        pages_inner = listinner->add_pages();
     }
     neighptr_inner = &pages_inner[npage_inner][npnt_inner];
     n_inner = 0;
 
     if (respamiddle) {
       if (pgsize - npnt_middle < oneatom) {
-	npnt_middle = 0;
-	npage_middle++;
-	if (npage_middle == listmiddle->maxpage)
-	  pages_middle = listmiddle->add_pages();
+        npnt_middle = 0;
+        npage_middle++;
+        if (npage_middle == listmiddle->maxpage)
+          pages_middle = listmiddle->add_pages();
       }
       neighptr_middle = &pages_middle[npage_middle][npnt_middle];
       n_middle = 0;
@@ -467,35 +467,35 @@ void Neighbor::respa_bin_no_newton(NeighList *list)
 
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (j <= i) continue;
-
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-
-	  if (rsq < cut_inner_sq) {
-	    if (which == 0) neighptr_inner[n_inner++] = j;
-	    else if (which > 0) 
-	      neighptr_inner[n_inner++] = j ^ (which << SBBITS);
-	  }
-
-	  if (respamiddle && 
-	      rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	    if (which == 0) neighptr_middle[n_middle++] = j;
-	    else if (which > 0) 
-	      neighptr_middle[n_middle++] = j ^ (which << SBBITS);
-	  }
-	}
+        if (j <= i) continue;
+
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+
+          if (rsq < cut_inner_sq) {
+            if (which == 0) neighptr_inner[n_inner++] = j;
+            else if (which > 0)
+              neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          }
+
+          if (respamiddle &&
+              rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
+            if (which == 0) neighptr_middle[n_middle++] = j;
+            else if (which > 0)
+              neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+          }
+        }
       }
     }
 
@@ -519,7 +519,7 @@ void Neighbor::respa_bin_no_newton(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (n_middle > oneatom)
-	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
+        error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
     }
 
     inum++;
@@ -529,7 +529,7 @@ void Neighbor::respa_bin_no_newton(NeighList *list)
   listinner->inum = inum;
   if (respamiddle) listmiddle->inum = inum;
 }
-      
+
 /* ----------------------------------------------------------------------
    multiple respa lists
    binned neighbor list construction with full Newton's 3rd law
@@ -609,17 +609,17 @@ void Neighbor::respa_bin_newton(NeighList *list)
       npnt_inner = 0;
       npage_inner++;
       if (npage_inner == listinner->maxpage)
-	pages_inner = listinner->add_pages();
+        pages_inner = listinner->add_pages();
     }
     neighptr_inner = &pages_inner[npage_inner][npnt_inner];
     n_inner = 0;
 
     if (respamiddle) {
       if (pgsize - npnt_middle < oneatom) {
-	npnt_middle = 0;
-	npage_middle++;
-	if (npage_middle == listmiddle->maxpage)
-	  pages_middle = listmiddle->add_pages();
+        npnt_middle = 0;
+        npage_middle++;
+        if (npage_middle == listmiddle->maxpage)
+          pages_middle = listmiddle->add_pages();
       }
       neighptr_middle = &pages_middle[npage_middle][npnt_middle];
       n_middle = 0;
@@ -636,11 +636,11 @@ void Neighbor::respa_bin_newton(NeighList *list)
 
     for (j = bins[i]; j >= 0; j = bins[j]) {
       if (j >= nlocal) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp && x[j][0] < xtmp) continue;
+        }
       }
 
       jtype = type[j];
@@ -652,21 +652,21 @@ void Neighbor::respa_bin_newton(NeighList *list)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq <= cutneighsq[itype][jtype]) {
-	if (molecular) {
-	  which = find_special(special[i],nspecial[i],tag[j]);
-	  if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	} else neighptr[n++] = j;
+        if (molecular) {
+          which = find_special(special[i],nspecial[i],tag[j]);
+          if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+        } else neighptr[n++] = j;
 
         if (rsq < cut_inner_sq) {
-	  if (which == 0) neighptr_inner[n_inner++] = j;
-	  else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          if (which == 0) neighptr_inner[n_inner++] = j;
+          else if (which > 0) neighptr_inner[n_inner++] = j ^ (which << SBBITS);
         }
 
-        if (respamiddle && 
-	    rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	  if (which == 0) neighptr_middle[n_middle++] = j;
-	  else if (which > 0) 
-	    neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+        if (respamiddle &&
+            rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
+          if (which == 0) neighptr_middle[n_middle++] = j;
+          else if (which > 0)
+            neighptr_middle[n_middle++] = j ^ (which << SBBITS);
         }
       }
     }
@@ -676,33 +676,33 @@ void Neighbor::respa_bin_newton(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-
-	  if (rsq < cut_inner_sq) {
-	    if (which == 0) neighptr_inner[n_inner++] = j;
-	    else if (which > 0) 
-	      neighptr_inner[n_inner++] = j ^ (which << SBBITS);
-	  }
-
-	  if (respamiddle && 
-	      rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	    if (which == 0) neighptr_middle[n_middle++] = j;
-	    else if (which > 0) 
-	      neighptr_middle[n_middle++] = j ^ (which << SBBITS);
-	  }
-	}
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+
+          if (rsq < cut_inner_sq) {
+            if (which == 0) neighptr_inner[n_inner++] = j;
+            else if (which > 0)
+              neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          }
+
+          if (respamiddle &&
+              rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
+            if (which == 0) neighptr_middle[n_middle++] = j;
+            else if (which > 0)
+              neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+          }
+        }
       }
     }
 
@@ -726,7 +726,7 @@ void Neighbor::respa_bin_newton(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (n_middle > oneatom)
-	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
+        error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
     }
 
     inum++;
@@ -816,17 +816,17 @@ void Neighbor::respa_bin_newton_tri(NeighList *list)
       npnt_inner = 0;
       npage_inner++;
       if (npage_inner == listinner->maxpage)
-	pages_inner = listinner->add_pages();
+        pages_inner = listinner->add_pages();
     }
     neighptr_inner = &pages_inner[npage_inner][npnt_inner];
     n_inner = 0;
 
     if (respamiddle) {
       if (pgsize - npnt_middle < oneatom) {
-	npnt_middle = 0;
-	npage_middle++;
-	if (npage_middle == listmiddle->maxpage)
-	  pages_middle = listmiddle->add_pages();
+        npnt_middle = 0;
+        npage_middle++;
+        if (npage_middle == listmiddle->maxpage)
+          pages_middle = listmiddle->add_pages();
       }
       neighptr_middle = &pages_middle[npage_middle][npnt_middle];
       n_middle = 0;
@@ -846,42 +846,42 @@ void Neighbor::respa_bin_newton_tri(NeighList *list)
     ibin = coord2bin(x[i]);
     for (k = 0; k < nstencil; k++) {
       for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) {
-	if (x[j][2] < ztmp) continue;
-	if (x[j][2] == ztmp) {
-	  if (x[j][1] < ytmp) continue;
-	  if (x[j][1] == ytmp) {
-	    if (x[j][0] < xtmp) continue;
-	    if (x[j][0] == xtmp && j <= i) continue;
-	  }
-	}
-
-	jtype = type[j];
-	if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
-
-	delx = xtmp - x[j][0];
-	dely = ytmp - x[j][1];
-	delz = ztmp - x[j][2];
-	rsq = delx*delx + dely*dely + delz*delz;
-
-	if (rsq <= cutneighsq[itype][jtype]) {
-	  if (molecular) {
-	    which = find_special(special[i],nspecial[i],tag[j]);
-	    if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
-	  } else neighptr[n++] = j;
-
-	  if (rsq < cut_inner_sq) {
-	    if (which == 0) neighptr_inner[n_inner++] = j;
-	    else if (which > 0) 
-	      neighptr_inner[n_inner++] = j ^ (which << SBBITS);
-	  }
-
-	  if (respamiddle &&
-	      rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
-	    if (which == 0) neighptr_middle[n_middle++] = j;
-	    else if (which > 0) 
-	      neighptr_middle[n_middle++] = j ^ (which << SBBITS);
-	  }
-	}
+        if (x[j][2] < ztmp) continue;
+        if (x[j][2] == ztmp) {
+          if (x[j][1] < ytmp) continue;
+          if (x[j][1] == ytmp) {
+            if (x[j][0] < xtmp) continue;
+            if (x[j][0] == xtmp && j <= i) continue;
+          }
+        }
+
+        jtype = type[j];
+        if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue;
+
+        delx = xtmp - x[j][0];
+        dely = ytmp - x[j][1];
+        delz = ztmp - x[j][2];
+        rsq = delx*delx + dely*dely + delz*delz;
+
+        if (rsq <= cutneighsq[itype][jtype]) {
+          if (molecular) {
+            which = find_special(special[i],nspecial[i],tag[j]);
+            if (which >= 0) neighptr[n++] = j ^ (which << SBBITS);
+          } else neighptr[n++] = j;
+
+          if (rsq < cut_inner_sq) {
+            if (which == 0) neighptr_inner[n_inner++] = j;
+            else if (which > 0)
+              neighptr_inner[n_inner++] = j ^ (which << SBBITS);
+          }
+
+          if (respamiddle &&
+              rsq < cut_middle_sq && rsq > cut_middle_inside_sq) {
+            if (which == 0) neighptr_middle[n_middle++] = j;
+            else if (which > 0)
+              neighptr_middle[n_middle++] = j ^ (which << SBBITS);
+          }
+        }
       }
     }
 
@@ -905,7 +905,7 @@ void Neighbor::respa_bin_newton_tri(NeighList *list)
       numneigh_middle[i] = n_middle;
       npnt_middle += n_middle;
       if (n_middle > oneatom)
-	error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
+        error->one(FLERR,"Neighbor list overflow, boost neigh_modify one");
     }
 
     inum++;
diff --git a/src/neigh_respa.h b/src/neigh_respa.h
index 2b9b9d420c..5ad76c98af 100644
--- a/src/neigh_respa.h
+++ b/src/neigh_respa.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/neigh_stencil.cpp b/src/neigh_stencil.cpp
index c72974a43e..34a5ddc305 100644
--- a/src/neigh_stencil.cpp
+++ b/src/neigh_stencil.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,7 +45,7 @@ using namespace LAMMPS_NS;
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_bin_2d_no_newton(NeighList *list,
-					     int sx, int sy, int sz)
+                                             int sx, int sy, int sz)
 {
   int i,j;
   int *stencil = list->stencil;
@@ -54,7 +54,7 @@ void Neighbor::stencil_half_bin_2d_no_newton(NeighList *list,
   for (j = -sy; j <= sy; j++)
     for (i = -sx; i <= sx; i++)
       if (bin_distance(i,j,0) < cutneighmaxsq)
-	stencil[nstencil++] = j*mbinx + i;
+        stencil[nstencil++] = j*mbinx + i;
 
   list->nstencil = nstencil;
 }
@@ -62,7 +62,7 @@ void Neighbor::stencil_half_bin_2d_no_newton(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_bin_3d_no_newton(NeighList *list,
-					     int sx, int sy, int sz)
+                                             int sx, int sy, int sz)
 {
   int i,j,k;
   int *stencil = list->stencil;
@@ -71,8 +71,8 @@ void Neighbor::stencil_half_bin_3d_no_newton(NeighList *list,
   for (k = -sz; k <= sz; k++)
     for (j = -sy; j <= sy; j++)
       for (i = -sx; i <= sx; i++)
-	if (bin_distance(i,j,k) < cutneighmaxsq)
-	  stencil[nstencil++] = k*mbiny*mbinx + j*mbinx + i;
+        if (bin_distance(i,j,k) < cutneighmaxsq)
+          stencil[nstencil++] = k*mbiny*mbinx + j*mbinx + i;
 
   list->nstencil = nstencil;
 }
@@ -80,7 +80,7 @@ void Neighbor::stencil_half_bin_3d_no_newton(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_bin_2d_newton(NeighList *list,
-					  int sx, int sy, int sz)
+                                          int sx, int sy, int sz)
 {
   int i,j;
   int *stencil = list->stencil;
@@ -89,8 +89,8 @@ void Neighbor::stencil_half_bin_2d_newton(NeighList *list,
   for (j = 0; j <= sy; j++)
     for (i = -sx; i <= sx; i++)
       if (j > 0 || (j == 0 && i > 0))
-	if (bin_distance(i,j,0) < cutneighmaxsq)
-	  stencil[nstencil++] = j*mbinx + i;
+        if (bin_distance(i,j,0) < cutneighmaxsq)
+          stencil[nstencil++] = j*mbinx + i;
 
   list->nstencil = nstencil;
 }
@@ -98,7 +98,7 @@ void Neighbor::stencil_half_bin_2d_newton(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_bin_3d_newton(NeighList *list,
-					  int sx, int sy, int sz)
+                                          int sx, int sy, int sz)
 {
   int i,j,k;
   int *stencil = list->stencil;
@@ -107,9 +107,9 @@ void Neighbor::stencil_half_bin_3d_newton(NeighList *list,
   for (k = 0; k <= sz; k++)
     for (j = -sy; j <= sy; j++)
       for (i = -sx; i <= sx; i++)
-	if (k > 0 || j > 0 || (j == 0 && i > 0))
-	  if (bin_distance(i,j,k) < cutneighmaxsq)
-	    stencil[nstencil++] = k*mbiny*mbinx + j*mbinx + i;
+        if (k > 0 || j > 0 || (j == 0 && i > 0))
+          if (bin_distance(i,j,k) < cutneighmaxsq)
+            stencil[nstencil++] = k*mbiny*mbinx + j*mbinx + i;
 
   list->nstencil = nstencil;
 }
@@ -117,7 +117,7 @@ void Neighbor::stencil_half_bin_3d_newton(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_bin_2d_newton_tri(NeighList *list,
-					      int sx, int sy, int sz)
+                                              int sx, int sy, int sz)
 {
   int i,j;
   int *stencil = list->stencil;
@@ -126,7 +126,7 @@ void Neighbor::stencil_half_bin_2d_newton_tri(NeighList *list,
   for (j = 0; j <= sy; j++)
     for (i = -sx; i <= sx; i++)
       if (bin_distance(i,j,0) < cutneighmaxsq)
-	stencil[nstencil++] = j*mbinx + i;
+        stencil[nstencil++] = j*mbinx + i;
 
   list->nstencil = nstencil;
 }
@@ -134,7 +134,7 @@ void Neighbor::stencil_half_bin_2d_newton_tri(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_bin_3d_newton_tri(NeighList *list,
-					      int sx, int sy, int sz)
+                                              int sx, int sy, int sz)
 {
   int i,j,k;
   int *stencil = list->stencil;
@@ -143,8 +143,8 @@ void Neighbor::stencil_half_bin_3d_newton_tri(NeighList *list,
   for (k = 0; k <= sz; k++)
     for (j = -sy; j <= sy; j++)
       for (i = -sx; i <= sx; i++)
-	if (bin_distance(i,j,k) < cutneighmaxsq)
-	  stencil[nstencil++] = k*mbiny*mbinx + j*mbinx + i;
+        if (bin_distance(i,j,k) < cutneighmaxsq)
+          stencil[nstencil++] = k*mbiny*mbinx + j*mbinx + i;
 
   list->nstencil = nstencil;
 }
@@ -152,7 +152,7 @@ void Neighbor::stencil_half_bin_3d_newton_tri(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_multi_2d_no_newton(NeighList *list,
-					       int sx, int sy, int sz)
+                                               int sx, int sy, int sz)
 {
   int i,j,n;
   double rsq,typesq;
@@ -171,11 +171,11 @@ void Neighbor::stencil_half_multi_2d_no_newton(NeighList *list,
     n = 0;
     for (j = -sy; j <= sy; j++)
       for (i = -sx; i <= sx; i++) {
-	rsq = bin_distance(i,j,0);
-	if (rsq < typesq) {
-	  distsq[n] = rsq;
-	  s[n++] = j*mbinx + i;
-	}
+        rsq = bin_distance(i,j,0);
+        if (rsq < typesq) {
+          distsq[n] = rsq;
+          s[n++] = j*mbinx + i;
+        }
       }
     nstencil_multi[itype] = n;
   }
@@ -184,7 +184,7 @@ void Neighbor::stencil_half_multi_2d_no_newton(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_multi_3d_no_newton(NeighList *list,
-					       int sx, int sy, int sz)
+                                               int sx, int sy, int sz)
 {
   int i,j,k,n;
   double rsq,typesq;
@@ -203,13 +203,13 @@ void Neighbor::stencil_half_multi_3d_no_newton(NeighList *list,
     n = 0;
     for (k = -sz; k <= sz; k++)
       for (j = -sy; j <= sy; j++)
-	for (i = -sx; i <= sx; i++) {
-	  rsq = bin_distance(i,j,k);
-	  if (rsq < typesq) {
-	    distsq[n] = rsq;
-	    s[n++] = k*mbiny*mbinx + j*mbinx + i;
-	  }
-	}
+        for (i = -sx; i <= sx; i++) {
+          rsq = bin_distance(i,j,k);
+          if (rsq < typesq) {
+            distsq[n] = rsq;
+            s[n++] = k*mbiny*mbinx + j*mbinx + i;
+          }
+        }
     nstencil_multi[itype] = n;
   }
 }
@@ -217,7 +217,7 @@ void Neighbor::stencil_half_multi_3d_no_newton(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_multi_2d_newton(NeighList *list,
-					    int sx, int sy, int sz)
+                                            int sx, int sy, int sz)
 {
   int i,j,n;
   double rsq,typesq;
@@ -236,13 +236,13 @@ void Neighbor::stencil_half_multi_2d_newton(NeighList *list,
     n = 0;
     for (j = 0; j <= sy; j++)
       for (i = -sx; i <= sx; i++)
-	if (j > 0 || (j == 0 && i > 0)) {
-	  rsq = bin_distance(i,j,0);
-	  if (rsq < typesq) {
-	    distsq[n] = rsq;
-	    s[n++] = j*mbinx + i;
-	  }
-	}
+        if (j > 0 || (j == 0 && i > 0)) {
+          rsq = bin_distance(i,j,0);
+          if (rsq < typesq) {
+            distsq[n] = rsq;
+            s[n++] = j*mbinx + i;
+          }
+        }
     nstencil_multi[itype] = n;
   }
 }
@@ -250,7 +250,7 @@ void Neighbor::stencil_half_multi_2d_newton(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_multi_3d_newton(NeighList *list,
-					    int sx, int sy, int sz)
+                                            int sx, int sy, int sz)
 {
   int i,j,k,n;
   double rsq,typesq;
@@ -269,14 +269,14 @@ void Neighbor::stencil_half_multi_3d_newton(NeighList *list,
     n = 0;
     for (k = 0; k <= sz; k++)
       for (j = -sy; j <= sy; j++)
-	for (i = -sx; i <= sx; i++)
-	  if (k > 0 || j > 0 || (j == 0 && i > 0)) {
-	    rsq = bin_distance(i,j,k);
-	    if (rsq < typesq) {
-	      distsq[n] = rsq;
-	      s[n++] = k*mbiny*mbinx + j*mbinx + i;
-	    }
-	  }
+        for (i = -sx; i <= sx; i++)
+          if (k > 0 || j > 0 || (j == 0 && i > 0)) {
+            rsq = bin_distance(i,j,k);
+            if (rsq < typesq) {
+              distsq[n] = rsq;
+              s[n++] = k*mbiny*mbinx + j*mbinx + i;
+            }
+          }
     nstencil_multi[itype] = n;
   }
 }
@@ -284,7 +284,7 @@ void Neighbor::stencil_half_multi_3d_newton(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_multi_2d_newton_tri(NeighList *list,
-						int sx, int sy, int sz)
+                                                int sx, int sy, int sz)
 {
   int i,j,n;
   double rsq,typesq;
@@ -303,11 +303,11 @@ void Neighbor::stencil_half_multi_2d_newton_tri(NeighList *list,
     n = 0;
     for (j = 0; j <= sy; j++)
       for (i = -sx; i <= sx; i++) {
-	rsq = bin_distance(i,j,0);
-	if (rsq < typesq) {
-	  distsq[n] = rsq;
-	  s[n++] = j*mbinx + i;
-	}
+        rsq = bin_distance(i,j,0);
+        if (rsq < typesq) {
+          distsq[n] = rsq;
+          s[n++] = j*mbinx + i;
+        }
       }
     nstencil_multi[itype] = n;
   }
@@ -317,7 +317,7 @@ void Neighbor::stencil_half_multi_2d_newton_tri(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_half_multi_3d_newton_tri(NeighList *list,
-						int sx, int sy, int sz)
+                                                int sx, int sy, int sz)
 {
   int i,j,k,n;
   double rsq,typesq;
@@ -336,13 +336,13 @@ void Neighbor::stencil_half_multi_3d_newton_tri(NeighList *list,
     n = 0;
     for (k = 0; k <= sz; k++)
       for (j = -sy; j <= sy; j++)
-	for (i = -sx; i <= sx; i++) {
-	  rsq = bin_distance(i,j,k);
-	  if (rsq < typesq) {
-	    distsq[n] = rsq;
-	    s[n++] = k*mbiny*mbinx + j*mbinx + i;
-	  }
-	}
+        for (i = -sx; i <= sx; i++) {
+          rsq = bin_distance(i,j,k);
+          if (rsq < typesq) {
+            distsq[n] = rsq;
+            s[n++] = k*mbiny*mbinx + j*mbinx + i;
+          }
+        }
     nstencil_multi[itype] = n;
   }
 }
@@ -350,7 +350,7 @@ void Neighbor::stencil_half_multi_3d_newton_tri(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_full_bin_2d(NeighList *list,
-				   int sx, int sy, int sz)
+                                   int sx, int sy, int sz)
 {
   int i,j;
   int *stencil = list->stencil;
@@ -359,7 +359,7 @@ void Neighbor::stencil_full_bin_2d(NeighList *list,
   for (j = -sy; j <= sy; j++)
     for (i = -sx; i <= sx; i++)
       if (bin_distance(i,j,0) < cutneighmaxsq)
-	stencil[nstencil++] = j*mbinx + i;
+        stencil[nstencil++] = j*mbinx + i;
 
   list->nstencil = nstencil;
 }
@@ -367,7 +367,7 @@ void Neighbor::stencil_full_bin_2d(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_full_ghost_bin_2d(NeighList *list,
-					 int sx, int sy, int sz)
+                                         int sx, int sy, int sz)
 {
   int i,j;
   int *stencil = list->stencil;
@@ -377,10 +377,10 @@ void Neighbor::stencil_full_ghost_bin_2d(NeighList *list,
   for (j = -sy; j <= sy; j++)
     for (i = -sx; i <= sx; i++)
       if (bin_distance(i,j,0) < cutneighmaxsq) {
-	stencilxyz[nstencil][0] = i;
-	stencilxyz[nstencil][1] = j;
-	stencilxyz[nstencil][2] = 0;
-	stencil[nstencil++] = j*mbinx + i;
+        stencilxyz[nstencil][0] = i;
+        stencilxyz[nstencil][1] = j;
+        stencilxyz[nstencil][2] = 0;
+        stencil[nstencil++] = j*mbinx + i;
       }
 
   list->nstencil = nstencil;
@@ -389,7 +389,7 @@ void Neighbor::stencil_full_ghost_bin_2d(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_full_bin_3d(NeighList *list,
-				   int sx, int sy, int sz)
+                                   int sx, int sy, int sz)
 {
   int i,j,k;
   int *stencil = list->stencil;
@@ -398,8 +398,8 @@ void Neighbor::stencil_full_bin_3d(NeighList *list,
   for (k = -sz; k <= sz; k++)
     for (j = -sy; j <= sy; j++)
       for (i = -sx; i <= sx; i++)
-	if (bin_distance(i,j,k) < cutneighmaxsq)
-	  stencil[nstencil++] = k*mbiny*mbinx + j*mbinx + i;
+        if (bin_distance(i,j,k) < cutneighmaxsq)
+          stencil[nstencil++] = k*mbiny*mbinx + j*mbinx + i;
 
   list->nstencil = nstencil;
 }
@@ -407,7 +407,7 @@ void Neighbor::stencil_full_bin_3d(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_full_ghost_bin_3d(NeighList *list,
-					 int sx, int sy, int sz)
+                                         int sx, int sy, int sz)
 {
   int i,j,k;
   int *stencil = list->stencil;
@@ -417,12 +417,12 @@ void Neighbor::stencil_full_ghost_bin_3d(NeighList *list,
   for (k = -sz; k <= sz; k++)
     for (j = -sy; j <= sy; j++)
       for (i = -sx; i <= sx; i++)
-	if (bin_distance(i,j,k) < cutneighmaxsq) {
-	  stencilxyz[nstencil][0] = i;
-	  stencilxyz[nstencil][1] = j;
-	  stencilxyz[nstencil][2] = k;
-	  stencil[nstencil++] = k*mbiny*mbinx + j*mbinx + i;
-	}
+        if (bin_distance(i,j,k) < cutneighmaxsq) {
+          stencilxyz[nstencil][0] = i;
+          stencilxyz[nstencil][1] = j;
+          stencilxyz[nstencil][2] = k;
+          stencil[nstencil++] = k*mbiny*mbinx + j*mbinx + i;
+        }
 
   list->nstencil = nstencil;
 }
@@ -430,7 +430,7 @@ void Neighbor::stencil_full_ghost_bin_3d(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_full_multi_2d(NeighList *list,
-				     int sx, int sy, int sz)
+                                     int sx, int sy, int sz)
 {
   int i,j,n;
   double rsq,typesq;
@@ -449,11 +449,11 @@ void Neighbor::stencil_full_multi_2d(NeighList *list,
     n = 0;
     for (j = -sy; j <= sy; j++)
       for (i = -sx; i <= sx; i++) {
-	rsq = bin_distance(i,j,0);
-	if (rsq < typesq) {
-	  distsq[n] = rsq;
-	  s[n++] = j*mbinx + i;
-	}
+        rsq = bin_distance(i,j,0);
+        if (rsq < typesq) {
+          distsq[n] = rsq;
+          s[n++] = j*mbinx + i;
+        }
       }
     nstencil_multi[itype] = n;
   }
@@ -462,7 +462,7 @@ void Neighbor::stencil_full_multi_2d(NeighList *list,
 /* ---------------------------------------------------------------------- */
 
 void Neighbor::stencil_full_multi_3d(NeighList *list,
-				     int sx, int sy, int sz)
+                                     int sx, int sy, int sz)
 {
   int i,j,k,n;
   double rsq,typesq;
@@ -481,13 +481,13 @@ void Neighbor::stencil_full_multi_3d(NeighList *list,
     n = 0;
     for (k = -sz; k <= sz; k++)
       for (j = -sy; j <= sy; j++)
-	for (i = -sx; i <= sx; i++) {
-	  rsq = bin_distance(i,j,k);
-	  if (rsq < typesq) {
-	    distsq[n] = rsq;
-	    s[n++] = k*mbiny*mbinx + j*mbinx + i;
-	  }
-	}
+        for (i = -sx; i <= sx; i++) {
+          rsq = bin_distance(i,j,k);
+          if (rsq < typesq) {
+            distsq[n] = rsq;
+            s[n++] = k*mbiny*mbinx + j*mbinx + i;
+          }
+        }
     nstencil_multi[itype] = n;
   }
 }
diff --git a/src/neighbor.cpp b/src/neighbor.cpp
index 106b4f26b7..8c8183bf2d 100644
--- a/src/neighbor.cpp
+++ b/src/neighbor.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -219,10 +219,10 @@ void Neighbor::init()
 
   triggersq = 0.25*skin*skin;
   boxcheck = 0;
-  if (domain->box_change && (domain->xperiodic || domain->yperiodic || 
-			     (dimension == 3 && domain->zperiodic)))
+  if (domain->box_change && (domain->xperiodic || domain->yperiodic ||
+                             (dimension == 3 && domain->zperiodic)))
       boxcheck = 1;
-      
+
   n = atom->ntypes;
   if (cutneighsq == NULL) {
     memory->create(cutneighsq,n+1,n+1,"neigh:cutneighsq");
@@ -251,8 +251,8 @@ void Neighbor::init()
       cutneighmax = MAX(cutneighmax,cut);
 
       if (force->pair && force->pair->ghostneigh) {
-	cut = force->pair->cutghost[i][j] + skin;
-	cutneighghostsq[i][j] = cut*cut;
+        cut = force->pair->cutghost[i][j] + skin;
+        cutneighghostsq[i][j] = cut*cut;
       }
     }
   }
@@ -284,21 +284,21 @@ void Neighbor::init()
   // flag = 2 otherwise or if KSpace solver is enabled
   // pairwise portion of KSpace solver uses all 1-2,1-3,1-4 neighbors
 
-  if (force->special_lj[1] == 0.0 && force->special_coul[1] == 0.0) 
+  if (force->special_lj[1] == 0.0 && force->special_coul[1] == 0.0)
     special_flag[1] = 0;
-  else if (force->special_lj[1] == 1.0 && force->special_coul[1] == 1.0) 
+  else if (force->special_lj[1] == 1.0 && force->special_coul[1] == 1.0)
     special_flag[1] = 1;
   else special_flag[1] = 2;
 
-  if (force->special_lj[2] == 0.0 && force->special_coul[2] == 0.0) 
+  if (force->special_lj[2] == 0.0 && force->special_coul[2] == 0.0)
     special_flag[2] = 0;
-  else if (force->special_lj[2] == 1.0 && force->special_coul[2] == 1.0) 
+  else if (force->special_lj[2] == 1.0 && force->special_coul[2] == 1.0)
     special_flag[2] = 1;
   else special_flag[2] = 2;
 
-  if (force->special_lj[3] == 0.0 && force->special_coul[3] == 0.0) 
+  if (force->special_lj[3] == 0.0 && force->special_coul[3] == 0.0)
     special_flag[3] = 0;
-  else if (force->special_lj[3] == 1.0 && force->special_coul[3] == 1.0) 
+  else if (force->special_lj[3] == 1.0 && force->special_coul[3] == 1.0)
     special_flag[3] = 1;
   else special_flag[3] = 2;
 
@@ -360,7 +360,7 @@ void Neighbor::init()
       memory->create(bins,maxbin,"bins");
     }
   }
-    
+
   // exclusion lists for type, group, molecule settings from neigh_modify
 
   n = atom->ntypes;
@@ -374,12 +374,12 @@ void Neighbor::init()
 
     for (i = 1; i <= n; i++)
       for (j = 1; j <= n; j++)
-	ex_type[i][j] = 0;
+        ex_type[i][j] = 0;
 
     for (i = 0; i < nex_type; i++) {
-      if (ex1_type[i] <= 0 || ex1_type[i] > n || 
-	  ex2_type[i] <= 0 || ex2_type[i] > n)
-	error->all(FLERR,"Invalid atom type in neighbor exclusion list");
+      if (ex1_type[i] <= 0 || ex1_type[i] > n ||
+          ex2_type[i] <= 0 || ex2_type[i] > n)
+        error->all(FLERR,"Invalid atom type in neighbor exclusion list");
       ex_type[ex1_type[i]][ex2_type[i]] = 1;
       ex_type[ex2_type[i]][ex1_type[i]] = 1;
     }
@@ -451,14 +451,14 @@ void Neighbor::init()
       lists[i]->dnum = requests[i]->dnum;
 
       if (requests[i]->pair) {
-	Pair *pair = (Pair *) requests[i]->requestor;
-	pair->init_list(requests[i]->id,lists[i]);
+        Pair *pair = (Pair *) requests[i]->requestor;
+        pair->init_list(requests[i]->id,lists[i]);
       } else if (requests[i]->fix) {
-	Fix *fix = (Fix *) requests[i]->requestor;
-	fix->init_list(requests[i]->id,lists[i]);
+        Fix *fix = (Fix *) requests[i]->requestor;
+        fix->init_list(requests[i]->id,lists[i]);
       } else if (requests[i]->compute) {
-	Compute *compute = (Compute *) requests[i]->requestor;
-	compute->init_list(requests[i]->id,lists[i]);
+        Compute *compute = (Compute *) requests[i]->requestor;
+        compute->init_list(requests[i]->id,lists[i]);
       }
     }
 
@@ -487,68 +487,68 @@ void Neighbor::init()
 
     for (i = 0; i < nlist; i++) {
       if (requests[i]->copy)
-	lists[i]->listcopy = lists[requests[i]->otherlist];
+        lists[i]->listcopy = lists[requests[i]->otherlist];
 
       else if (requests[i]->skip) {
-	lists[i]->listskip = lists[requests[i]->otherlist];
-	lists[i]->copy_skip_info(requests[i]->iskip,requests[i]->ijskip);
+        lists[i]->listskip = lists[requests[i]->otherlist];
+        lists[i]->copy_skip_info(requests[i]->iskip,requests[i]->ijskip);
 
       } else if (requests[i]->half_from_full)
-	lists[i]->listfull = lists[i-1];
+        lists[i]->listfull = lists[i-1];
 
       else if (requests[i]->granhistory) {
-	lists[i-1]->listgranhistory = lists[i];
-	for (int ifix = 0; ifix < modify->nfix; ifix++)
-	  if (strcmp(modify->fix[ifix]->style,"SHEAR_HISTORY") == 0) 
-	    lists[i-1]->fix_history = (FixShearHistory *) modify->fix[ifix];
- 
+        lists[i-1]->listgranhistory = lists[i];
+        for (int ifix = 0; ifix < modify->nfix; ifix++)
+          if (strcmp(modify->fix[ifix]->style,"SHEAR_HISTORY") == 0)
+            lists[i-1]->fix_history = (FixShearHistory *) modify->fix[ifix];
+
       } else if (requests[i]->respaouter) {
-	if (requests[i-1]->respainner) {
-	  lists[i]->respamiddle = 0;
-	  lists[i]->listinner = lists[i-1];
-	} else {
-	  lists[i]->respamiddle = 1;
-	  lists[i]->listmiddle = lists[i-1];
-	  lists[i]->listinner = lists[i-2];
-	}
+        if (requests[i-1]->respainner) {
+          lists[i]->respamiddle = 0;
+          lists[i]->listinner = lists[i-1];
+        } else {
+          lists[i]->respamiddle = 1;
+          lists[i]->listmiddle = lists[i-1];
+          lists[i]->listinner = lists[i-2];
+        }
 
       } else if (requests[i]->pair && requests[i]->half) {
-	for (j = 0; j < nlist; j++)
-	  if (requests[j]->full && requests[j]->occasional == 0 &&
-	      requests[j]->skip == 0) break;
-	if (j < nlist) {
-	  requests[i]->half = 0;
-	  requests[i]->half_from_full = 1;
-	  lists[i]->listfull = lists[j];
-	}
+        for (j = 0; j < nlist; j++)
+          if (requests[j]->full && requests[j]->occasional == 0 &&
+              requests[j]->skip == 0) break;
+        if (j < nlist) {
+          requests[i]->half = 0;
+          requests[i]->half_from_full = 1;
+          lists[i]->listfull = lists[j];
+        }
 
       } else if (requests[i]->fix || requests[i]->compute) {
-	for (j = 0; j < nlist; j++) {
-	  if (requests[i]->half && requests[j]->pair &&
-	      requests[j]->skip == 0 && requests[j]->half) break;
-	  if (requests[i]->full && requests[j]->pair &&
-	      requests[j]->skip == 0 && requests[j]->full) break;
-	  if (requests[i]->half && requests[j]->pair &&
-	      requests[j]->skip == 0 && requests[j]->respaouter) break;
-	}
-	if (j < nlist && requests[j]->cudable != requests[i]->cudable)
-	  j = nlist;
-	if (j < nlist) {
-	  requests[i]->copy = 1;
-	  lists[i]->listcopy = lists[j];
-	} else {
-	  for (j = 0; j < nlist; j++) {
-	    if (requests[i]->half && requests[j]->pair &&
-		requests[j]->skip == 0 && requests[j]->full) break;
-	  }
-	  if (j < nlist && requests[j]->cudable != requests[i]->cudable)
-	    j = nlist;
-	  if (j < nlist) {
-	    requests[i]->half = 0;
-	    requests[i]->half_from_full = 1;
-	    lists[i]->listfull = lists[j];
-	  }
-	}
+        for (j = 0; j < nlist; j++) {
+          if (requests[i]->half && requests[j]->pair &&
+              requests[j]->skip == 0 && requests[j]->half) break;
+          if (requests[i]->full && requests[j]->pair &&
+              requests[j]->skip == 0 && requests[j]->full) break;
+          if (requests[i]->half && requests[j]->pair &&
+              requests[j]->skip == 0 && requests[j]->respaouter) break;
+        }
+        if (j < nlist && requests[j]->cudable != requests[i]->cudable)
+          j = nlist;
+        if (j < nlist) {
+          requests[i]->copy = 1;
+          lists[i]->listcopy = lists[j];
+        } else {
+          for (j = 0; j < nlist; j++) {
+            if (requests[i]->half && requests[j]->pair &&
+                requests[j]->skip == 0 && requests[j]->full) break;
+          }
+          if (j < nlist && requests[j]->cudable != requests[i]->cudable)
+            j = nlist;
+          if (j < nlist) {
+            requests[i]->half = 0;
+            requests[i]->half_from_full = 1;
+            lists[i]->listfull = lists[j];
+          }
+        }
       }
     }
 
@@ -597,8 +597,8 @@ void Neighbor::init()
     maxatom = atom->nmax;
     for (i = 0; i < nlist; i++)
       if (lists[i]->growflag) {
-	lists[i]->grow(maxatom);
-	lists[i]->add_pages();
+        lists[i]->grow(maxatom);
+        lists[i]->add_pages();
       }
 
     // setup 3 vectors of pairwise neighbor lists
@@ -619,9 +619,9 @@ void Neighbor::init()
     for (i = 0; i < nlist; i++) {
       if (lists[i]->buildflag) blist[nblist++] = i;
       if (lists[i]->growflag && requests[i]->occasional == 0)
-	glist[nglist++] = i;
+        glist[nglist++] = i;
       if (lists[i]->stencilflag && requests[i]->occasional == 0)
-	slist[nslist++] = i;
+        slist[nslist++] = i;
     }
 
 #ifdef NEIGH_LIST_DEBUG
@@ -639,21 +639,21 @@ void Neighbor::init()
     while (!done) {
       done = 1;
       for (i = 0; i < nblist; i++) {
-	NeighList *ptr = NULL;
-	if (lists[blist[i]]->listfull) ptr = lists[blist[i]]->listfull;
-	if (lists[blist[i]]->listcopy) ptr = lists[blist[i]]->listcopy;
-	if (lists[blist[i]]->listskip) ptr = lists[blist[i]]->listskip;
-	if (ptr == NULL) continue;
-	for (m = 0; m < nlist; m++)
-	  if (ptr == lists[m]) break;
-	for (j = 0; j < nblist; j++)
-	  if (m == blist[j]) break;
-	if (j < i) continue;
-	int tmp = blist[i];
-	blist[i] = blist[j];
-	blist[j] = tmp;
-	done = 0;
-	break;
+        NeighList *ptr = NULL;
+        if (lists[blist[i]]->listfull) ptr = lists[blist[i]]->listfull;
+        if (lists[blist[i]]->listcopy) ptr = lists[blist[i]]->listcopy;
+        if (lists[blist[i]]->listskip) ptr = lists[blist[i]]->listskip;
+        if (ptr == NULL) continue;
+        for (m = 0; m < nlist; m++)
+          if (ptr == lists[m]) break;
+        for (j = 0; j < nblist; j++)
+          if (m == blist[j]) break;
+        if (j < i) continue;
+        int tmp = blist[i];
+        blist[i] = blist[j];
+        blist[j] = tmp;
+        done = 0;
+        break;
       }
     }
 
@@ -664,7 +664,7 @@ void Neighbor::init()
 
   // delete old requests
   // copy current requests and style to old for next run
-  
+
   for (i = 0; i < old_nrequest; i++) delete old_requests[i];
   memory->sfree(old_requests);
   old_nrequest = nrequest;
@@ -693,15 +693,15 @@ void Neighbor::init()
 
   if (atom->molecular && atom->ndihedrals && maxdihedral == 0) {
     if (nprocs == 1) maxdihedral = atom->ndihedrals;
-    else maxdihedral = static_cast<int> 
-	   (LB_FACTOR * atom->ndihedrals / nprocs);
+    else maxdihedral = static_cast<int>
+           (LB_FACTOR * atom->ndihedrals / nprocs);
     memory->create(dihedrallist,maxdihedral,5,"neigh:dihedrallist");
   }
 
   if (atom->molecular && atom->nimpropers && maximproper == 0) {
     if (nprocs == 1) maximproper = atom->nimpropers;
     else maximproper = static_cast<int>
-	   (LB_FACTOR * atom->nimpropers / nprocs);
+           (LB_FACTOR * atom->nimpropers / nprocs);
     memory->create(improperlist,maximproper,5,"neigh:improperlist");
   }
 
@@ -721,7 +721,7 @@ void Neighbor::init()
     for (i = 0; i < atom->nlocal; i++) {
       if (bond_off) break;
       for (m = 0; m < atom->num_bond[i]; m++)
-	if (atom->bond_type[i][m] <= 0) bond_off = 1;
+        if (atom->bond_type[i][m] <= 0) bond_off = 1;
     }
   }
 
@@ -729,7 +729,7 @@ void Neighbor::init()
     for (i = 0; i < atom->nlocal; i++) {
       if (angle_off) break;
       for (m = 0; m < atom->num_angle[i]; m++)
-	if (atom->angle_type[i][m] <= 0) angle_off = 1;
+        if (atom->angle_type[i][m] <= 0) angle_off = 1;
     }
   }
 
@@ -738,7 +738,7 @@ void Neighbor::init()
     for (i = 0; i < atom->nlocal; i++) {
       if (dihedral_off) break;
       for (m = 0; m < atom->num_dihedral[i]; m++)
-	if (atom->dihedral_type[i][m] <= 0) dihedral_off = 1;
+        if (atom->dihedral_type[i][m] <= 0) dihedral_off = 1;
     }
   }
 
@@ -747,7 +747,7 @@ void Neighbor::init()
     for (i = 0; i < atom->nlocal; i++) {
       if (improper_off) break;
       for (m = 0; m < atom->num_improper[i]; m++)
-	if (atom->improper_type[i][m] <= 0) improper_off = 1;
+        if (atom->improper_type[i][m] <= 0) improper_off = 1;
     }
   }
 
@@ -777,9 +777,9 @@ int Neighbor::request(void *requestor)
 {
   if (nrequest == maxrequest) {
     maxrequest += RQDELTA;
-    requests = (NeighRequest **) 
+    requests = (NeighRequest **)
       memory->srealloc(requests,maxrequest*sizeof(NeighRequest *),
-		       "neighbor:requests");
+                       "neighbor:requests");
   }
 
   requests[nrequest] = new NeighRequest(lmp);
@@ -794,7 +794,7 @@ int Neighbor::request(void *requestor)
    copy -> copy_from function
    skip -> granular function if gran with granhistory,
            respa function if respaouter,
-	   skip_from function for everything else
+           skip_from function for everything else
    half_from_full, half, full, gran, respaouter ->
      choose by newton and rq->newton and tri settings
      style NSQ options = newton off, newton on
@@ -814,7 +814,7 @@ void Neighbor::choose_build(int index, NeighRequest *rq)
 
     else if (rq->skip) {
       if (rq->gran && lists[index]->listgranhistory)
-	pb = &Neighbor::skip_from_granular;
+        pb = &Neighbor::skip_from_granular;
       else if (rq->respaouter) pb = &Neighbor::skip_from_respa;
       else pb = &Neighbor::skip_from;
 
@@ -824,74 +824,74 @@ void Neighbor::choose_build(int index, NeighRequest *rq)
 
     } else if (rq->half) {
       if (style == NSQ) {
-	if (rq->newton == 0) {
-	  if (newton_pair == 0) pb = &Neighbor::half_nsq_no_newton;
-	  else if (newton_pair == 1) pb = &Neighbor::half_nsq_newton;
-	} else if (rq->newton == 1) {
-	  pb = &Neighbor::half_nsq_newton;
-	} else if (rq->newton == 2) {
-	  pb = &Neighbor::half_nsq_no_newton;
-	}
+        if (rq->newton == 0) {
+          if (newton_pair == 0) pb = &Neighbor::half_nsq_no_newton;
+          else if (newton_pair == 1) pb = &Neighbor::half_nsq_newton;
+        } else if (rq->newton == 1) {
+          pb = &Neighbor::half_nsq_newton;
+        } else if (rq->newton == 2) {
+          pb = &Neighbor::half_nsq_no_newton;
+        }
       } else if (style == BIN) {
-	if (rq->newton == 0) {
-	  if (newton_pair == 0) pb = &Neighbor::half_bin_no_newton;
-	  else if (triclinic == 0) pb = &Neighbor::half_bin_newton;
-	  else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri;
-	} else if (rq->newton == 1) {
-	  if (triclinic == 0) pb = &Neighbor::half_bin_newton;
-	  else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri;
-	} else if (rq->newton == 2) pb = &Neighbor::half_bin_no_newton;
+        if (rq->newton == 0) {
+          if (newton_pair == 0) pb = &Neighbor::half_bin_no_newton;
+          else if (triclinic == 0) pb = &Neighbor::half_bin_newton;
+          else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri;
+        } else if (rq->newton == 1) {
+          if (triclinic == 0) pb = &Neighbor::half_bin_newton;
+          else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri;
+        } else if (rq->newton == 2) pb = &Neighbor::half_bin_no_newton;
       } else if (style == MULTI) {
-	if (rq->newton == 0) {
-	  if (newton_pair == 0) pb = &Neighbor::half_multi_no_newton;
-	  else if (triclinic == 0) pb = &Neighbor::half_multi_newton;
-	  else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri;
-	} else if (rq->newton == 1) {
-	  if (triclinic == 0) pb = &Neighbor::half_multi_newton;
-	  else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri;
-	} else if (rq->newton == 2) pb = &Neighbor::half_multi_no_newton;
+        if (rq->newton == 0) {
+          if (newton_pair == 0) pb = &Neighbor::half_multi_no_newton;
+          else if (triclinic == 0) pb = &Neighbor::half_multi_newton;
+          else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri;
+        } else if (rq->newton == 1) {
+          if (triclinic == 0) pb = &Neighbor::half_multi_newton;
+          else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri;
+        } else if (rq->newton == 2) pb = &Neighbor::half_multi_no_newton;
       }
 
     } else if (rq->full) {
       if (style == NSQ) {
-	if (rq->ghost == 0) pb = &Neighbor::full_nsq;
-	else if (includegroup) 
-	  error->all(FLERR,
-		     "Neighbor include group not allowed with ghost neighbors");
-	else if (rq->ghost == 1) pb = &Neighbor::full_nsq_ghost;
+        if (rq->ghost == 0) pb = &Neighbor::full_nsq;
+        else if (includegroup)
+          error->all(FLERR,
+                     "Neighbor include group not allowed with ghost neighbors");
+        else if (rq->ghost == 1) pb = &Neighbor::full_nsq_ghost;
       } else if (style == BIN) {
-	if (rq->ghost == 0) pb = &Neighbor::full_bin;
-	else if (includegroup) 
-	  error->all(FLERR,
-		     "Neighbor include group not allowed with ghost neighbors");
-	else if (rq->ghost == 1) pb = &Neighbor::full_bin_ghost;
+        if (rq->ghost == 0) pb = &Neighbor::full_bin;
+        else if (includegroup)
+          error->all(FLERR,
+                     "Neighbor include group not allowed with ghost neighbors");
+        else if (rq->ghost == 1) pb = &Neighbor::full_bin_ghost;
       } else if (style == MULTI) {
-	if (rq->ghost == 0) pb = &Neighbor::full_multi;
-	else error->all(FLERR,
-			"Neighbor multi not yet enabled for ghost neighbors");
+        if (rq->ghost == 0) pb = &Neighbor::full_multi;
+        else error->all(FLERR,
+                        "Neighbor multi not yet enabled for ghost neighbors");
       }
 
     } else if (rq->gran) {
       if (style == NSQ) {
-	if (newton_pair == 0) pb = &Neighbor::granular_nsq_no_newton;
-	else if (newton_pair == 1) pb = &Neighbor::granular_nsq_newton;
+        if (newton_pair == 0) pb = &Neighbor::granular_nsq_no_newton;
+        else if (newton_pair == 1) pb = &Neighbor::granular_nsq_newton;
       } else if (style == BIN) {
-	if (newton_pair == 0) pb = &Neighbor::granular_bin_no_newton;
-	else if (triclinic == 0) pb = &Neighbor::granular_bin_newton;
-	else if (triclinic == 1) pb = &Neighbor::granular_bin_newton_tri;
+        if (newton_pair == 0) pb = &Neighbor::granular_bin_no_newton;
+        else if (triclinic == 0) pb = &Neighbor::granular_bin_newton;
+        else if (triclinic == 1) pb = &Neighbor::granular_bin_newton_tri;
       } else if (style == MULTI)
-	error->all(FLERR,"Neighbor multi not yet enabled for granular");
+        error->all(FLERR,"Neighbor multi not yet enabled for granular");
 
     } else if (rq->respaouter) {
       if (style == NSQ) {
-	if (newton_pair == 0) pb = &Neighbor::respa_nsq_no_newton;
-	else if (newton_pair == 1) pb = &Neighbor::respa_nsq_newton;
+        if (newton_pair == 0) pb = &Neighbor::respa_nsq_no_newton;
+        else if (newton_pair == 1) pb = &Neighbor::respa_nsq_newton;
       } else if (style == BIN) {
-	if (newton_pair == 0) pb = &Neighbor::respa_bin_no_newton;
-	else if (triclinic == 0) pb = &Neighbor::respa_bin_newton;
-	else if (triclinic == 1) pb = &Neighbor::respa_bin_newton_tri;
+        if (newton_pair == 0) pb = &Neighbor::respa_bin_no_newton;
+        else if (triclinic == 0) pb = &Neighbor::respa_bin_newton;
+        else if (triclinic == 1) pb = &Neighbor::respa_bin_newton_tri;
       } else if (style == MULTI)
-	error->all(FLERR,"Neighbor multi not yet enabled for rRESPA");
+        error->all(FLERR,"Neighbor multi not yet enabled for rRESPA");
     }
   } else {
 
@@ -899,7 +899,7 @@ void Neighbor::choose_build(int index, NeighRequest *rq)
 
     else if (rq->skip) {
       if (rq->gran && lists[index]->listgranhistory)
-	pb = &Neighbor::skip_from_granular;
+        pb = &Neighbor::skip_from_granular;
       else if (rq->respaouter) pb = &Neighbor::skip_from_respa;
       else pb = &Neighbor::skip_from;
 
@@ -909,74 +909,74 @@ void Neighbor::choose_build(int index, NeighRequest *rq)
 
     } else if (rq->half) {
       if (style == NSQ) {
-	if (rq->newton == 0) {
-	  if (newton_pair == 0) pb = &Neighbor::half_nsq_no_newton_omp;
-	  else if (newton_pair == 1) pb = &Neighbor::half_nsq_newton_omp;
-	} else if (rq->newton == 1) {
-	  pb = &Neighbor::half_nsq_newton_omp;
-	} else if (rq->newton == 2) {
-	  pb = &Neighbor::half_nsq_no_newton_omp;
-	}
+        if (rq->newton == 0) {
+          if (newton_pair == 0) pb = &Neighbor::half_nsq_no_newton_omp;
+          else if (newton_pair == 1) pb = &Neighbor::half_nsq_newton_omp;
+        } else if (rq->newton == 1) {
+          pb = &Neighbor::half_nsq_newton_omp;
+        } else if (rq->newton == 2) {
+          pb = &Neighbor::half_nsq_no_newton_omp;
+        }
       } else if (style == BIN) {
-	if (rq->newton == 0) {
-	  if (newton_pair == 0) pb = &Neighbor::half_bin_no_newton_omp;
-	  else if (triclinic == 0) pb = &Neighbor::half_bin_newton_omp;
-	  else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri_omp;
-	} else if (rq->newton == 1) {
-	  if (triclinic == 0) pb = &Neighbor::half_bin_newton_omp;
-	  else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri_omp;
-	} else if (rq->newton == 2) pb = &Neighbor::half_bin_no_newton_omp;
+        if (rq->newton == 0) {
+          if (newton_pair == 0) pb = &Neighbor::half_bin_no_newton_omp;
+          else if (triclinic == 0) pb = &Neighbor::half_bin_newton_omp;
+          else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri_omp;
+        } else if (rq->newton == 1) {
+          if (triclinic == 0) pb = &Neighbor::half_bin_newton_omp;
+          else if (triclinic == 1) pb = &Neighbor::half_bin_newton_tri_omp;
+        } else if (rq->newton == 2) pb = &Neighbor::half_bin_no_newton_omp;
       } else if (style == MULTI) {
-	if (rq->newton == 0) {
-	  if (newton_pair == 0) pb = &Neighbor::half_multi_no_newton_omp;
-	  else if (triclinic == 0) pb = &Neighbor::half_multi_newton_omp;
-	  else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri_omp;
-	} else if (rq->newton == 1) {
-	  if (triclinic == 0) pb = &Neighbor::half_multi_newton_omp;
-	  else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri_omp;
-	} else if (rq->newton == 2) pb = &Neighbor::half_multi_no_newton_omp;
+        if (rq->newton == 0) {
+          if (newton_pair == 0) pb = &Neighbor::half_multi_no_newton_omp;
+          else if (triclinic == 0) pb = &Neighbor::half_multi_newton_omp;
+          else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri_omp;
+        } else if (rq->newton == 1) {
+          if (triclinic == 0) pb = &Neighbor::half_multi_newton_omp;
+          else if (triclinic == 1) pb = &Neighbor::half_multi_newton_tri_omp;
+        } else if (rq->newton == 2) pb = &Neighbor::half_multi_no_newton_omp;
       }
 
     } else if (rq->full) {
       if (style == NSQ) {
-	if (rq->ghost == 0) pb = &Neighbor::full_nsq_omp;
-	else if (includegroup) 
-	  error->all(FLERR,
-		     "Neighbor include group not allowed with ghost neighbors");
-	else if (rq->ghost == 1) pb = &Neighbor::full_nsq_ghost_omp;
+        if (rq->ghost == 0) pb = &Neighbor::full_nsq_omp;
+        else if (includegroup)
+          error->all(FLERR,
+                     "Neighbor include group not allowed with ghost neighbors");
+        else if (rq->ghost == 1) pb = &Neighbor::full_nsq_ghost_omp;
       } else if (style == BIN) {
-	if (rq->ghost == 0) pb = &Neighbor::full_bin_omp;
-	else if (includegroup) 
-	  error->all(FLERR,
-		     "Neighbor include group not allowed with ghost neighbors");
-	else if (rq->ghost == 1) pb = &Neighbor::full_bin_ghost_omp;
+        if (rq->ghost == 0) pb = &Neighbor::full_bin_omp;
+        else if (includegroup)
+          error->all(FLERR,
+                     "Neighbor include group not allowed with ghost neighbors");
+        else if (rq->ghost == 1) pb = &Neighbor::full_bin_ghost_omp;
       } else if (style == MULTI) {
-	if (rq->ghost == 0) pb = &Neighbor::full_multi_omp;
-	else error->all(FLERR,
-			"Neighbor multi not yet enabled for ghost neighbors");
+        if (rq->ghost == 0) pb = &Neighbor::full_multi_omp;
+        else error->all(FLERR,
+                        "Neighbor multi not yet enabled for ghost neighbors");
       }
 
     } else if (rq->gran) {
       if (style == NSQ) {
-	if (newton_pair == 0) pb = &Neighbor::granular_nsq_no_newton_omp;
-	else if (newton_pair == 1) pb = &Neighbor::granular_nsq_newton_omp;
+        if (newton_pair == 0) pb = &Neighbor::granular_nsq_no_newton_omp;
+        else if (newton_pair == 1) pb = &Neighbor::granular_nsq_newton_omp;
       } else if (style == BIN) {
-	if (newton_pair == 0) pb = &Neighbor::granular_bin_no_newton_omp;
-	else if (triclinic == 0) pb = &Neighbor::granular_bin_newton_omp;
-	else if (triclinic == 1) pb = &Neighbor::granular_bin_newton_tri_omp;
+        if (newton_pair == 0) pb = &Neighbor::granular_bin_no_newton_omp;
+        else if (triclinic == 0) pb = &Neighbor::granular_bin_newton_omp;
+        else if (triclinic == 1) pb = &Neighbor::granular_bin_newton_tri_omp;
       } else if (style == MULTI)
-	error->all(FLERR,"Neighbor multi not yet enabled for granular");
+        error->all(FLERR,"Neighbor multi not yet enabled for granular");
 
     } else if (rq->respaouter) {
       if (style == NSQ) {
-	if (newton_pair == 0) pb = &Neighbor::respa_nsq_no_newton_omp;
-	else if (newton_pair == 1) pb = &Neighbor::respa_nsq_newton_omp;
+        if (newton_pair == 0) pb = &Neighbor::respa_nsq_no_newton_omp;
+        else if (newton_pair == 1) pb = &Neighbor::respa_nsq_newton_omp;
       } else if (style == BIN) {
-	if (newton_pair == 0) pb = &Neighbor::respa_bin_no_newton_omp;
-	else if (triclinic == 0) pb = &Neighbor::respa_bin_newton_omp;
-	else if (triclinic == 1) pb = &Neighbor::respa_bin_newton_tri_omp;
+        if (newton_pair == 0) pb = &Neighbor::respa_bin_no_newton_omp;
+        else if (triclinic == 0) pb = &Neighbor::respa_bin_newton_omp;
+        else if (triclinic == 1) pb = &Neighbor::respa_bin_newton_tri_omp;
       } else if (style == MULTI)
-	error->all(FLERR,"Neighbor multi not yet enabled for rRESPA");
+        error->all(FLERR,"Neighbor multi not yet enabled for rRESPA");
     }
   }
 
@@ -984,7 +984,7 @@ void Neighbor::choose_build(int index, NeighRequest *rq)
 
   if (rq->ghost && !rq->full)
     error->all(FLERR,
-	       "Neighbors of ghost atoms only allowed for full neighbor lists");
+               "Neighbors of ghost atoms only allowed for full neighbor lists");
 
   pair_build[index] = pb;
 }
@@ -1007,88 +1007,88 @@ void Neighbor::choose_stencil(int index, NeighRequest *rq)
   else if (rq->half || rq->gran || rq->respaouter) {
     if (style == BIN) {
       if (rq->newton == 0) {
-	if (newton_pair == 0) {
-	  if (dimension == 2)
-	    sc = &Neighbor::stencil_half_bin_2d_no_newton;
-	  else if (dimension == 3)
-	    sc = &Neighbor::stencil_half_bin_3d_no_newton;
-	} else if (triclinic == 0) {
-	  if (dimension == 2)
-	    sc = &Neighbor::stencil_half_bin_2d_newton;
-	  else if (dimension == 3)
-	    sc = &Neighbor::stencil_half_bin_3d_newton;
-	} else if (triclinic == 1) {
-	  if (dimension == 2)
-	    sc = &Neighbor::stencil_half_bin_2d_newton_tri;
-	  else if (dimension == 3) 
-	    sc = &Neighbor::stencil_half_bin_3d_newton_tri;
-	}
+        if (newton_pair == 0) {
+          if (dimension == 2)
+            sc = &Neighbor::stencil_half_bin_2d_no_newton;
+          else if (dimension == 3)
+            sc = &Neighbor::stencil_half_bin_3d_no_newton;
+        } else if (triclinic == 0) {
+          if (dimension == 2)
+            sc = &Neighbor::stencil_half_bin_2d_newton;
+          else if (dimension == 3)
+            sc = &Neighbor::stencil_half_bin_3d_newton;
+        } else if (triclinic == 1) {
+          if (dimension == 2)
+            sc = &Neighbor::stencil_half_bin_2d_newton_tri;
+          else if (dimension == 3)
+            sc = &Neighbor::stencil_half_bin_3d_newton_tri;
+        }
       } else if (rq->newton == 1) {
-	if (triclinic == 0) {
-	  if (dimension == 2)
-	    sc = &Neighbor::stencil_half_bin_2d_newton;
-	  else if (dimension == 3)
-	    sc = &Neighbor::stencil_half_bin_3d_newton;
-	} else if (triclinic == 1) {
-	  if (dimension == 2)
-	    sc = &Neighbor::stencil_half_bin_2d_newton_tri;
-	  else if (dimension == 3) 
-	    sc = &Neighbor::stencil_half_bin_3d_newton_tri;
-	}
+        if (triclinic == 0) {
+          if (dimension == 2)
+            sc = &Neighbor::stencil_half_bin_2d_newton;
+          else if (dimension == 3)
+            sc = &Neighbor::stencil_half_bin_3d_newton;
+        } else if (triclinic == 1) {
+          if (dimension == 2)
+            sc = &Neighbor::stencil_half_bin_2d_newton_tri;
+          else if (dimension == 3)
+            sc = &Neighbor::stencil_half_bin_3d_newton_tri;
+        }
       } else if (rq->newton == 2) {
-	if (dimension == 2)
-	  sc = &Neighbor::stencil_half_bin_2d_no_newton;
-	else if (dimension == 3)
-	  sc = &Neighbor::stencil_half_bin_3d_no_newton;
+        if (dimension == 2)
+          sc = &Neighbor::stencil_half_bin_2d_no_newton;
+        else if (dimension == 3)
+          sc = &Neighbor::stencil_half_bin_3d_no_newton;
       }
 
     } else if (style == MULTI) {
       if (rq->newton == 0) {
-	if (newton_pair == 0) {
-	  if (dimension == 2) 
-	    sc = &Neighbor::stencil_half_multi_2d_no_newton;
-	  else if (dimension == 3)
-	    sc = &Neighbor::stencil_half_multi_3d_no_newton;
-	} else if (triclinic == 0) {
-	  if (dimension == 2) 
-	    sc = &Neighbor::stencil_half_multi_2d_newton;
-	  else if (dimension == 3)
-	    sc = &Neighbor::stencil_half_multi_3d_newton;
-	} else if (triclinic == 1) {
-	  if (dimension == 2)
-	    sc = &Neighbor::stencil_half_multi_2d_newton_tri;
-	  else if (dimension == 3) 
-	    sc = &Neighbor::stencil_half_multi_3d_newton_tri;
-	}
+        if (newton_pair == 0) {
+          if (dimension == 2)
+            sc = &Neighbor::stencil_half_multi_2d_no_newton;
+          else if (dimension == 3)
+            sc = &Neighbor::stencil_half_multi_3d_no_newton;
+        } else if (triclinic == 0) {
+          if (dimension == 2)
+            sc = &Neighbor::stencil_half_multi_2d_newton;
+          else if (dimension == 3)
+            sc = &Neighbor::stencil_half_multi_3d_newton;
+        } else if (triclinic == 1) {
+          if (dimension == 2)
+            sc = &Neighbor::stencil_half_multi_2d_newton_tri;
+          else if (dimension == 3)
+            sc = &Neighbor::stencil_half_multi_3d_newton_tri;
+        }
       } else if (rq->newton == 1) {
-	if (triclinic == 0) {
-	  if (dimension == 2) 
-	    sc = &Neighbor::stencil_half_multi_2d_newton;
-	  else if (dimension == 3)
-	    sc = &Neighbor::stencil_half_multi_3d_newton;
-	} else if (triclinic == 1) {
-	  if (dimension == 2)
-	    sc = &Neighbor::stencil_half_multi_2d_newton_tri;
-	  else if (dimension == 3) 
-	    sc = &Neighbor::stencil_half_multi_3d_newton_tri;
-	}
+        if (triclinic == 0) {
+          if (dimension == 2)
+            sc = &Neighbor::stencil_half_multi_2d_newton;
+          else if (dimension == 3)
+            sc = &Neighbor::stencil_half_multi_3d_newton;
+        } else if (triclinic == 1) {
+          if (dimension == 2)
+            sc = &Neighbor::stencil_half_multi_2d_newton_tri;
+          else if (dimension == 3)
+            sc = &Neighbor::stencil_half_multi_3d_newton_tri;
+        }
       } else if (rq->newton == 2) {
-	if (dimension == 2) 
-	  sc = &Neighbor::stencil_half_multi_2d_no_newton;
-	else if (dimension == 3)
-	  sc = &Neighbor::stencil_half_multi_3d_no_newton;
+        if (dimension == 2)
+          sc = &Neighbor::stencil_half_multi_2d_no_newton;
+        else if (dimension == 3)
+          sc = &Neighbor::stencil_half_multi_3d_no_newton;
       }
     }
 
   } else if (rq->full) {
     if (style == BIN) {
       if (dimension == 2) {
-	if (rq->ghost) sc = &Neighbor::stencil_full_ghost_bin_2d;
-	else sc = &Neighbor::stencil_full_bin_2d;
+        if (rq->ghost) sc = &Neighbor::stencil_full_ghost_bin_2d;
+        else sc = &Neighbor::stencil_full_bin_2d;
       }
       else if (dimension == 3) {
-	if (rq->ghost) sc = &Neighbor::stencil_full_ghost_bin_3d;
-	else sc = &Neighbor::stencil_full_bin_3d;
+        if (rq->ghost) sc = &Neighbor::stencil_full_ghost_bin_3d;
+        else sc = &Neighbor::stencil_full_bin_3d;
       }
     } else if (style == MULTI) {
       if (dimension == 2) sc = &Neighbor::stencil_full_multi_2d;
@@ -1167,12 +1167,12 @@ int Neighbor::check_distance()
       domain->box_corners();
       delta1 = delta2 = 0.0;
       for (int i = 0; i < 8; i++) {
-	delx = corners[i][0] - corners_hold[i][0];
-	dely = corners[i][1] - corners_hold[i][1];
-	delz = corners[i][2] - corners_hold[i][2];
-	delta = sqrt(delx*delx + dely*dely + delz*delz);
-	if (delta > delta1) delta1 = delta;
-	else if (delta > delta2) delta2 = delta;
+        delx = corners[i][0] - corners_hold[i][0];
+        dely = corners[i][1] - corners_hold[i][1];
+        delz = corners[i][2] - corners_hold[i][2];
+        delta = sqrt(delx*delx + dely*dely + delz*delz);
+        if (delta > delta1) delta1 = delta;
+        else if (delta > delta2) delta2 = delta;
       }
       delta = 0.5 * (skin - (delta1+delta2));
       deltasq = delta*delta;
@@ -1228,20 +1228,20 @@ void Neighbor::build()
     }
     if (boxcheck) {
       if (triclinic == 0) {
-	boxlo_hold[0] = bboxlo[0];
-	boxlo_hold[1] = bboxlo[1];
-	boxlo_hold[2] = bboxlo[2];
-	boxhi_hold[0] = bboxhi[0];
-	boxhi_hold[1] = bboxhi[1];
-	boxhi_hold[2] = bboxhi[2];
+        boxlo_hold[0] = bboxlo[0];
+        boxlo_hold[1] = bboxlo[1];
+        boxlo_hold[2] = bboxlo[2];
+        boxhi_hold[0] = bboxhi[0];
+        boxhi_hold[1] = bboxhi[1];
+        boxhi_hold[2] = bboxhi[2];
       } else {
-	domain->box_corners();
-	corners = domain->corners;
-	for (i = 0; i < 8; i++) {
-	  corners_hold[i][0] = corners[i][0];
-	  corners_hold[i][1] = corners[i][1];
-	  corners_hold[i][2] = corners[i][2];
-	}
+        domain->box_corners();
+        corners = domain->corners;
+        for (i = 0; i < 8; i++) {
+          corners_hold[i][0] = corners[i][0];
+          corners_hold[i][1] = corners[i][1];
+          corners_hold[i][2] = corners[i][2];
+        }
       }
     }
   }
@@ -1258,7 +1258,7 @@ void Neighbor::build()
     maxatom = atom->nmax;
     for (i = 0; i < nglist; i++) lists[glist[i]]->grow(maxatom);
   }
-  
+
   // extend atom bin list if necessary
 
   if (style != NSQ && atom->nmax > maxbin) {
@@ -1325,7 +1325,7 @@ void Neighbor::build_one(int i)
   if (dist_check && update->whichflag) flag = check_distance();
   if (flag && me == 0)
     error->warning(FLERR,"Building an occasional neighobr list when "
-		   "atoms may have moved too far");
+                   "atoms may have moved too far");
 
   (this->*pair_build[i])(lists[i]);
 }
@@ -1430,12 +1430,12 @@ void Neighbor::setup_bins()
   bininvx = 1.0 / binsizex;
   bininvy = 1.0 / binsizey;
   bininvz = 1.0 / binsizez;
-  
-  if (binsize_optimal*bininvx > CUT2BIN_RATIO || 
-      binsize_optimal*bininvy > CUT2BIN_RATIO || 
+
+  if (binsize_optimal*bininvx > CUT2BIN_RATIO ||
+      binsize_optimal*bininvy > CUT2BIN_RATIO ||
       binsize_optimal*bininvz > CUT2BIN_RATIO)
     error->all(FLERR,"Cannot use neighbor bins - box size << cutoff");
-  
+
   // mbinlo/hi = lowest and highest global bins my ghost atoms could be in
   // coord = lowest and highest values of coords for my ghost atoms
   // static_cast(-1.5) = -1, so subract additional -1
@@ -1534,7 +1534,7 @@ double Neighbor::bin_distance(int i, int j, int k)
   if (k > 0) delz = (k-1)*binsizez;
   else if (k == 0) delz = 0.0;
   else delz = (k+1)*binsizez;
- 
+
   return (delx*delx + dely*dely + delz*delz);
 }
 
@@ -1603,59 +1603,59 @@ void Neighbor::modify_params(int narg, char **arg)
       if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
       includegroup = group->find(arg[iarg+1]);
       if (includegroup < 0)
-	error->all(FLERR,"Invalid group ID in neigh_modify command");
+        error->all(FLERR,"Invalid group ID in neigh_modify command");
       if (includegroup && (atom->firstgroupname == NULL ||
-			    strcmp(arg[iarg+1],atom->firstgroupname) != 0))
-	error->all(FLERR,
-		   "Neigh_modify include group != atom_modify first group");
+                            strcmp(arg[iarg+1],atom->firstgroupname) != 0))
+        error->all(FLERR,
+                   "Neigh_modify include group != atom_modify first group");
       iarg += 2;
     } else if (strcmp(arg[iarg],"exclude") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command");
 
       if (strcmp(arg[iarg+1],"type") == 0) {
-	if (iarg+4 > narg) error->all(FLERR,"Illegal neigh_modify command");
-	if (nex_type == maxex_type) {
-	  maxex_type += EXDELTA;
-	  memory->grow(ex1_type,maxex_type,"neigh:ex1_type");
-	  memory->grow(ex2_type,maxex_type,"neigh:ex2_type");
-	}
-	ex1_type[nex_type] = atoi(arg[iarg+2]);
-	ex2_type[nex_type] = atoi(arg[iarg+3]);
-	nex_type++;
-	iarg += 4;
+        if (iarg+4 > narg) error->all(FLERR,"Illegal neigh_modify command");
+        if (nex_type == maxex_type) {
+          maxex_type += EXDELTA;
+          memory->grow(ex1_type,maxex_type,"neigh:ex1_type");
+          memory->grow(ex2_type,maxex_type,"neigh:ex2_type");
+        }
+        ex1_type[nex_type] = atoi(arg[iarg+2]);
+        ex2_type[nex_type] = atoi(arg[iarg+3]);
+        nex_type++;
+        iarg += 4;
 
       } else if (strcmp(arg[iarg+1],"group") == 0) {
-	if (iarg+4 > narg) error->all(FLERR,"Illegal neigh_modify command");
-	if (nex_group == maxex_group) {
-	  maxex_group += EXDELTA;
-	  memory->grow(ex1_group,maxex_group,"neigh:ex1_group");
-	  memory->grow(ex2_group,maxex_group,"neigh:ex2_group");
-	}
-	ex1_group[nex_group] = group->find(arg[iarg+2]);
-	ex2_group[nex_group] = group->find(arg[iarg+3]);
-	if (ex1_group[nex_group] == -1 || ex2_group[nex_group] == -1)
-	  error->all(FLERR,"Invalid group ID in neigh_modify command");
-	nex_group++;
-	iarg += 4;
+        if (iarg+4 > narg) error->all(FLERR,"Illegal neigh_modify command");
+        if (nex_group == maxex_group) {
+          maxex_group += EXDELTA;
+          memory->grow(ex1_group,maxex_group,"neigh:ex1_group");
+          memory->grow(ex2_group,maxex_group,"neigh:ex2_group");
+        }
+        ex1_group[nex_group] = group->find(arg[iarg+2]);
+        ex2_group[nex_group] = group->find(arg[iarg+3]);
+        if (ex1_group[nex_group] == -1 || ex2_group[nex_group] == -1)
+          error->all(FLERR,"Invalid group ID in neigh_modify command");
+        nex_group++;
+        iarg += 4;
 
       } else if (strcmp(arg[iarg+1],"molecule") == 0) {
-	if (iarg+3 > narg) error->all(FLERR,"Illegal neigh_modify command");
-	if (atom->molecule_flag == 0)
-	  error->all(FLERR,"Neigh_modify exclude molecule "
-		     "requires atom attribute molecule");
-	if (nex_mol == maxex_mol) {
-	  maxex_mol += EXDELTA;
-	  memory->grow(ex_mol_group,maxex_mol,"neigh:ex_mol_group");
-	}
-	ex_mol_group[nex_mol] = group->find(arg[iarg+2]);
-	if (ex_mol_group[nex_mol] == -1)
-	  error->all(FLERR,"Invalid group ID in neigh_modify command");
-	nex_mol++;
-	iarg += 3;
+        if (iarg+3 > narg) error->all(FLERR,"Illegal neigh_modify command");
+        if (atom->molecule_flag == 0)
+          error->all(FLERR,"Neigh_modify exclude molecule "
+                     "requires atom attribute molecule");
+        if (nex_mol == maxex_mol) {
+          maxex_mol += EXDELTA;
+          memory->grow(ex_mol_group,maxex_mol,"neigh:ex_mol_group");
+        }
+        ex_mol_group[nex_mol] = group->find(arg[iarg+2]);
+        if (ex_mol_group[nex_mol] == -1)
+          error->all(FLERR,"Invalid group ID in neigh_modify command");
+        nex_mol++;
+        iarg += 3;
 
       } else if (strcmp(arg[iarg+1],"none") == 0) {
-	nex_type = nex_group = nex_mol = 0;
-	iarg += 2;
+        nex_type = nex_group = nex_mol = 0;
+        iarg += 2;
       } else error->all(FLERR,"Illegal neigh_modify command");
 
     } else error->all(FLERR,"Illegal neigh_modify command");
@@ -1684,9 +1684,9 @@ void Neighbor::bin_atoms()
     int bitmask = group->bitmask[includegroup];
     for (i = nall-1; i >= nlocal; i--) {
       if (mask[i] & bitmask) {
-	ibin = coord2bin(x[i]);
-	bins[i] = binhead[ibin];
-	binhead[ibin] = i;
+        ibin = coord2bin(x[i]);
+        bins[i] = binhead[ibin];
+        binhead[ibin] = i;
       }
     }
     for (i = atom->nfirst-1; i >= 0; i--) {
@@ -1727,7 +1727,7 @@ int Neighbor::coord2bin(double *x)
     ix = MIN(ix,nbinx-1);
   } else
     ix = static_cast<int> ((x[0]-bboxlo[0])*bininvx) - 1;
-  
+
   if (x[1] >= bboxhi[1])
     iy = static_cast<int> ((x[1]-bboxhi[1])*bininvy) + nbiny;
   else if (x[1] >= bboxlo[1]) {
@@ -1735,7 +1735,7 @@ int Neighbor::coord2bin(double *x)
     iy = MIN(iy,nbiny-1);
   } else
     iy = static_cast<int> ((x[1]-bboxlo[1])*bininvy) - 1;
-  
+
   if (x[2] >= bboxhi[2])
     iz = static_cast<int> ((x[2]-bboxhi[2])*bininvz) + nbinz;
   else if (x[2] >= bboxlo[2]) {
@@ -1760,7 +1760,7 @@ int Neighbor::coord2bin(double *x, int &ix, int &iy, int &iz)
     ix = MIN(ix,nbinx-1);
   } else
     ix = static_cast<int> ((x[0]-bboxlo[0])*bininvx) - 1;
-  
+
   if (x[1] >= bboxhi[1])
     iy = static_cast<int> ((x[1]-bboxhi[1])*bininvy) + nbiny;
   else if (x[1] >= bboxlo[1]) {
@@ -1768,7 +1768,7 @@ int Neighbor::coord2bin(double *x, int &ix, int &iy, int &iz)
     iy = MIN(iy,nbiny-1);
   } else
     iy = static_cast<int> ((x[1]-bboxlo[1])*bininvy) - 1;
-  
+
   if (x[2] >= bboxhi[2])
     iz = static_cast<int> ((x[2]-bboxhi[2])*bininvz) + nbinz;
   else if (x[2] >= bboxlo[2]) {
@@ -1790,7 +1790,7 @@ int Neighbor::coord2bin(double *x, int &ix, int &iy, int &iz)
 ------------------------------------------------------------------------- */
 
 int Neighbor::exclusion(int i, int j, int itype, int jtype,
-			int *mask, int *molecule) const {
+                        int *mask, int *molecule) const {
   int m;
 
   if (nex_type && ex_type[itype][jtype]) return 1;
@@ -1805,7 +1805,7 @@ int Neighbor::exclusion(int i, int j, int itype, int jtype,
   if (nex_mol) {
     for (m = 0; m < nex_mol; m++)
       if (mask[i] & ex_mol_bit[m] && mask[j] & ex_mol_bit[m] &&
-	  molecule[i] == molecule[j]) return 1;
+          molecule[i] == molecule[j]) return 1;
   }
 
   return 0;
diff --git a/src/neighbor.h b/src/neighbor.h
index 36d80fb7e2..3cffa42bf8 100644
--- a/src/neighbor.h
+++ b/src/neighbor.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -49,7 +49,7 @@ class Neighbor : protected Pointers {
   int old_nrequest;                // re-creation of pairwise neighbor lists
   int old_triclinic;
   class NeighRequest **old_requests;
-  
+
   int nlist;                       // pairwise neighbor lists
   class NeighList **lists;
 
@@ -76,7 +76,7 @@ class Neighbor : protected Pointers {
   void modify_params(int, char**);  // modify parameters that control builds
   bigint memory_usage();
   int exclude_setting();
-  
+
  protected:
   int me,nprocs;
 
@@ -129,7 +129,7 @@ class Neighbor : protected Pointers {
   double (*corners)[3];            // ptr to 8 corners of triclinic box
 
   double inner[2],middle[2];       // rRESPA cutoffs for extra lists
-  double cut_inner_sq;		   // outer cutoff for inner neighbor list
+  double cut_inner_sq;                   // outer cutoff for inner neighbor list
   double cut_middle_sq;            // outer cutoff for middle neighbor list
   double cut_middle_inside_sq;     // inner cutoff for middle neighbor list
 
@@ -165,8 +165,8 @@ class Neighbor : protected Pointers {
   int coord2bin(double *);              // mapping atom coord to a bin
   int coord2bin(double *, int &, int &, int&); // ditto
 
-  int exclusion(int, int, int, 
-		int, int *, int *) const;  // test for pair exclusion
+  int exclusion(int, int, int,
+                int, int *, int *) const;  // test for pair exclusion
 
   virtual void choose_build(int, class NeighRequest *);
   void choose_stencil(int, class NeighRequest *);
@@ -269,27 +269,27 @@ class Neighbor : protected Pointers {
   // if it is and special flag is 2 (otherwise), return 1,2,3
   //   for which level of neighbor it is (and which coeff it maps to)
 
-  inline int find_special(const int *list, const int *nspecial, 
-			  const int tag) const {
+  inline int find_special(const int *list, const int *nspecial,
+                          const int tag) const {
     const int n1 = nspecial[0];
     const int n2 = nspecial[1];
     const int n3 = nspecial[2];
 
     for (int i = 0; i < n3; i++) {
       if (list[i] == tag) {
-	if (i < n1) {
-	  if (special_flag[1] == 0) return -1;
-	  else if (special_flag[1] == 1) return 0;
-	  else return 1;
-	} else if (i < n2) {
-	  if (special_flag[2] == 0) return -1;
-	  else if (special_flag[2] == 1) return 0;
-	  else return 2;
-	} else {
-	  if (special_flag[3] == 0) return -1;
-	  else if (special_flag[3] == 1) return 0;
-	  else return 3;
-	}
+        if (i < n1) {
+          if (special_flag[1] == 0) return -1;
+          else if (special_flag[1] == 1) return 0;
+          else return 1;
+        } else if (i < n2) {
+          if (special_flag[2] == 0) return -1;
+          else if (special_flag[2] == 1) return 0;
+          else return 2;
+        } else {
+          if (special_flag[3] == 0) return -1;
+          else if (special_flag[3] == 1) return 0;
+          else return 3;
+        }
       }
     }
     return 0;
diff --git a/src/output.cpp b/src/output.cpp
index 859aaa5dd1..7cb5f44db5 100644
--- a/src/output.cpp
+++ b/src/output.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -39,7 +39,7 @@ using namespace LAMMPS_NS;
 #define DELTA 1
 
 /* ----------------------------------------------------------------------
-   initialize all output 
+   initialize all output
 ------------------------------------------------------------------------- */
 
 Output::Output(LAMMPS *lmp) : Pointers(lmp)
@@ -71,10 +71,10 @@ Output::Output(LAMMPS *lmp) : Pointers(lmp)
   newarg[0] = (char *) "one";
   thermo = new Thermo(lmp,1,newarg);
   delete [] newarg;
-    
+
   thermo_every = 0;
   var_thermo = NULL;
-  
+
   ndump = 0;
   max_dump = 0;
   every_dump = NULL;
@@ -92,7 +92,7 @@ Output::Output(LAMMPS *lmp) : Pointers(lmp)
 }
 
 /* ----------------------------------------------------------------------
-   free all memory 
+   free all memory
 ------------------------------------------------------------------------- */
 
 Output::~Output()
@@ -136,9 +136,9 @@ void Output::init()
     if (every_dump[i] == 0) {
       ivar_dump[i] = input->variable->find(var_dump[i]);
       if (ivar_dump[i] < 0)
-	error->all(FLERR,"Variable name for dump every does not exist");
+        error->all(FLERR,"Variable name for dump every does not exist");
       if (!input->variable->equalstyle(ivar_dump[i]))
-	error->all(FLERR,"Variable for dump every is invalid style");
+        error->all(FLERR,"Variable for dump every is invalid style");
     }
 
   if (restart_flag_single && restart_every_single == 0) {
@@ -182,26 +182,26 @@ void Output::setup(int flag)
     for (int idump = 0; idump < ndump; idump++) {
       if (dump[idump]->clearstep) modify->clearstep_compute();
       writeflag = 0;
-      if (every_dump[idump] && ntimestep % every_dump[idump] == 0 && 
-	  last_dump[idump] != ntimestep) writeflag = 1;
+      if (every_dump[idump] && ntimestep % every_dump[idump] == 0 &&
+          last_dump[idump] != ntimestep) writeflag = 1;
       if (last_dump[idump] < 0 && dump[idump]->first_flag == 1) writeflag = 1;
       if (writeflag) {
-	dump[idump]->write();
-	last_dump[idump] = ntimestep;
+        dump[idump]->write();
+        last_dump[idump] = ntimestep;
       }
       if (every_dump[idump])
-	next_dump[idump] = 
-	  (ntimestep/every_dump[idump])*every_dump[idump] + every_dump[idump];
+        next_dump[idump] =
+          (ntimestep/every_dump[idump])*every_dump[idump] + every_dump[idump];
       else {
-	bigint nextdump = static_cast<bigint> 
-	  (input->variable->compute_equal(ivar_dump[idump]));
-	if (nextdump <= ntimestep)
-	  error->all(FLERR,"Dump every variable returned a bad timestep");
-	next_dump[idump] = nextdump;
+        bigint nextdump = static_cast<bigint>
+          (input->variable->compute_equal(ivar_dump[idump]));
+        if (nextdump <= ntimestep)
+          error->all(FLERR,"Dump every variable returned a bad timestep");
+        next_dump[idump] = nextdump;
       }
       if (dump[idump]->clearstep) {
-	if (writeflag) modify->addstep_compute(next_dump[idump]);
-	else modify->addstep_compute_all(next_dump[idump]);
+        if (writeflag) modify->addstep_compute(next_dump[idump]);
+        else modify->addstep_compute_all(next_dump[idump]);
       }
       if (idump) next_dump_any = MIN(next_dump_any,next_dump[idump]);
       else next_dump_any = next_dump[0];
@@ -216,28 +216,28 @@ void Output::setup(int flag)
   if (restart_flag && update->restrict_output == 0) {
     if (restart_flag_single) {
       if (restart_every_single)
-	next_restart_single = 
-	  (ntimestep/restart_every_single)*restart_every_single + 
-	  restart_every_single;
+        next_restart_single =
+          (ntimestep/restart_every_single)*restart_every_single +
+          restart_every_single;
       else {
-	bigint nextrestart = static_cast<bigint> 
-	  (input->variable->compute_equal(ivar_restart_single));
-	if (nextrestart <= ntimestep)
-	  error->all(FLERR,"Restart variable returned a bad timestep");
-	next_restart_single = nextrestart;
+        bigint nextrestart = static_cast<bigint>
+          (input->variable->compute_equal(ivar_restart_single));
+        if (nextrestart <= ntimestep)
+          error->all(FLERR,"Restart variable returned a bad timestep");
+        next_restart_single = nextrestart;
       }
     } else next_restart_single = update->laststep + 1;
     if (restart_flag_double) {
       if (restart_every_double)
-	next_restart_double = 
-	  (ntimestep/restart_every_double)*restart_every_double + 
-	  restart_every_double;
+        next_restart_double =
+          (ntimestep/restart_every_double)*restart_every_double +
+          restart_every_double;
       else {
-	bigint nextrestart = static_cast<bigint> 
-	  (input->variable->compute_equal(ivar_restart_double));
-	if (nextrestart <= ntimestep)
-	  error->all(FLERR,"Restart variable returned a bad timestep");
-	next_restart_double = nextrestart;
+        bigint nextrestart = static_cast<bigint>
+          (input->variable->compute_equal(ivar_restart_double));
+        if (nextrestart <= ntimestep)
+          error->all(FLERR,"Restart variable returned a bad timestep");
+        next_restart_double = nextrestart;
       }
     } else next_restart_double = update->laststep + 1;
     next_restart = MIN(next_restart_single,next_restart_double);
@@ -262,7 +262,7 @@ void Output::setup(int flag)
     next_thermo = (ntimestep/thermo_every)*thermo_every + thermo_every;
     next_thermo = MIN(next_thermo,update->laststep);
   } else if (var_thermo) {
-    next_thermo = static_cast<bigint> 
+    next_thermo = static_cast<bigint>
       (input->variable->compute_equal(ivar_thermo));
     if (next_thermo <= ntimestep)
       error->all(FLERR,"Thermo every variable returned a bad timestep");
@@ -289,21 +289,21 @@ void Output::write(bigint ntimestep)
   // download data from GPU if necessary
 
   if (next_dump_any == ntimestep) {
-    if (lmp->cuda && !lmp->cuda->oncpu) lmp->cuda->downloadAll();    
-    
+    if (lmp->cuda && !lmp->cuda->oncpu) lmp->cuda->downloadAll();
+
     for (int idump = 0; idump < ndump; idump++) {
       if (next_dump[idump] == ntimestep && last_dump[idump] != ntimestep) {
         if (dump[idump]->clearstep) modify->clearstep_compute();
-	dump[idump]->write();
-	last_dump[idump] = ntimestep;
-	if (every_dump[idump]) next_dump[idump] += every_dump[idump];
-	else {
-	  bigint nextdump = static_cast<bigint> 
-	    (input->variable->compute_equal(ivar_dump[idump]));
-	  if (nextdump <= ntimestep)
-	    error->all(FLERR,"Dump every variable returned a bad timestep");
-	  next_dump[idump] = nextdump;
-	}
+        dump[idump]->write();
+        last_dump[idump] = ntimestep;
+        if (every_dump[idump]) next_dump[idump] += every_dump[idump];
+        else {
+          bigint nextdump = static_cast<bigint>
+            (input->variable->compute_equal(ivar_dump[idump]));
+          if (nextdump <= ntimestep)
+            error->all(FLERR,"Dump every variable returned a bad timestep");
+          next_dump[idump] = nextdump;
+        }
         if (dump[idump]->clearstep) modify->addstep_compute(next_dump[idump]);
       }
       if (idump) next_dump_any = MIN(next_dump_any,next_dump[idump]);
@@ -316,8 +316,8 @@ void Output::write(bigint ntimestep)
   // download data from GPU if necessary
 
   if (next_restart == ntimestep && last_restart != ntimestep) {
-    if (lmp->cuda && !lmp->cuda->oncpu) lmp->cuda->downloadAll();    
-    
+    if (lmp->cuda && !lmp->cuda->oncpu) lmp->cuda->downloadAll();
+
     if (next_restart_single == ntimestep) {
       char *file = new char[strlen(restart1) + 16];
       char *ptr = strchr(restart1,'*');
@@ -328,28 +328,28 @@ void Output::write(bigint ntimestep)
       delete [] file;
       if (restart_every_single) next_restart_single += restart_every_single;
       else {
-	bigint nextrestart = static_cast<bigint> 
-	  (input->variable->compute_equal(ivar_restart_single));
-	if (nextrestart <= ntimestep)
-	  error->all(FLERR,"Restart variable returned a bad timestep");
-	next_restart_single = nextrestart;
+        bigint nextrestart = static_cast<bigint>
+          (input->variable->compute_equal(ivar_restart_single));
+        if (nextrestart <= ntimestep)
+          error->all(FLERR,"Restart variable returned a bad timestep");
+        next_restart_single = nextrestart;
       }
     }
     if (next_restart_double == ntimestep) {
       if (restart_toggle == 0) {
-	restart->write(restart2a);
-	restart_toggle = 1;
+        restart->write(restart2a);
+        restart_toggle = 1;
       } else {
-	restart->write(restart2b);
-	restart_toggle = 0;
+        restart->write(restart2b);
+        restart_toggle = 0;
       }
       if (restart_every_double) next_restart_double += restart_every_double;
       else {
-	bigint nextrestart = static_cast<bigint> 
-	  (input->variable->compute_equal(ivar_restart_double));
-	if (nextrestart <= ntimestep)
-	  error->all(FLERR,"Restart variable returned a bad timestep");
-	next_restart_double = nextrestart;
+        bigint nextrestart = static_cast<bigint>
+          (input->variable->compute_equal(ivar_restart_double));
+        if (nextrestart <= ntimestep)
+          error->all(FLERR,"Restart variable returned a bad timestep");
+        next_restart_double = nextrestart;
       }
     }
     last_restart = ntimestep;
@@ -365,10 +365,10 @@ void Output::write(bigint ntimestep)
     last_thermo = ntimestep;
     if (thermo_every) next_thermo += thermo_every;
     else if (var_thermo) {
-      next_thermo = static_cast<bigint> 
-	(input->variable->compute_equal(ivar_thermo));
+      next_thermo = static_cast<bigint>
+        (input->variable->compute_equal(ivar_thermo));
       if (next_thermo <= ntimestep)
-	error->all(FLERR,"Thermo every variable returned a bad timestep");
+        error->all(FLERR,"Thermo every variable returned a bad timestep");
     } else next_thermo = update->laststep;
     next_thermo = MIN(next_thermo,update->laststep);
     modify->addstep_compute(next_thermo);
@@ -423,7 +423,7 @@ void Output::write_restart(bigint ntimestep)
 }
 
 /* ----------------------------------------------------------------------
-   add a Dump to list of Dumps 
+   add a Dump to list of Dumps
 ------------------------------------------------------------------------- */
 
 void Output::add_dump(int narg, char **arg)
@@ -433,7 +433,7 @@ void Output::add_dump(int narg, char **arg)
   // error checks
 
   for (int idump = 0; idump < ndump; idump++)
-    if (strcmp(arg[0],dump[idump]->id) == 0) 
+    if (strcmp(arg[0],dump[idump]->id) == 0)
       error->all(FLERR,"Reuse of dump ID");
   int igroup = group->find(arg[1]);
   if (igroup == -1) error->all(FLERR,"Could not find dump group ID");
@@ -473,7 +473,7 @@ void Output::add_dump(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   modify parameters of a Dump 
+   modify parameters of a Dump
 ------------------------------------------------------------------------- */
 
 void Output::modify_dump(int narg, char **arg)
@@ -491,7 +491,7 @@ void Output::modify_dump(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   delete a Dump from list of Dumps 
+   delete a Dump from list of Dumps
 ------------------------------------------------------------------------- */
 
 void Output::delete_dump(char *id)
@@ -520,7 +520,7 @@ void Output::delete_dump(char *id)
 }
 
 /* ----------------------------------------------------------------------
-   new Thermo style 
+   new Thermo style
 ------------------------------------------------------------------------- */
 
 void Output::create_thermo(int narg, char **arg)
@@ -529,14 +529,14 @@ void Output::create_thermo(int narg, char **arg)
 
   // don't allow this so that dipole style can safely allocate inertia vector
 
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"Thermo_style command before simulation box is defined");
 
   // warn if previous thermo had been modified via thermo_modify command
 
   if (thermo->modified && comm->me == 0)
     error->warning(FLERR,"New thermo_style command, "
-		   "previous thermo_modify settings will be lost");
+                   "previous thermo_modify settings will be lost");
 
   // set thermo = NULL in case new Thermo throws an error
 
@@ -553,7 +553,7 @@ void Output::create_thermo(int narg, char **arg)
 void Output::create_restart(int narg, char **arg)
 {
   if (narg < 1) error->all(FLERR,"Illegal restart command");
-  
+
   int every = 0;
   int varflag = 0;
 
@@ -642,7 +642,7 @@ void Output::memory_usage()
   if (comm->me == 0) {
     if (screen)
       fprintf(screen,"Memory usage per processor = %g Mbytes\n",mbytes);
-    if (logfile) 
+    if (logfile)
       fprintf(logfile,"Memory usage per processor = %g Mbytes\n",mbytes);
   }
 }
diff --git a/src/output.h b/src/output.h
index 673ea08537..2511d42331 100644
--- a/src/output.h
+++ b/src/output.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pack.h b/src/pack.h
index 5f032e68c7..5db35117c5 100644
--- a/src/pack.h
+++ b/src/pack.h
@@ -5,21 +5,21 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
 ------------------------------------------------------------------------- */
 
-// loop counters for doing a pack/unpack 
+// loop counters for doing a pack/unpack
 
 struct pack_plan_3d {
-  int nfast;                 // # of elements in fast index 
-  int nmid;                  // # of elements in mid index 
-  int nslow;                 // # of elements in slow index 
-  int nstride_line;          // stride between successive mid indices 
+  int nfast;                 // # of elements in fast index
+  int nmid;                  // # of elements in mid index
+  int nslow;                 // # of elements in slow index
+  int nstride_line;          // stride between successive mid indices
   int nstride_plane;         // stride between successive slow indices
-  int nqty;                  // # of values/element 
+  int nqty;                  // # of values/element
 };
 
 
@@ -44,13 +44,13 @@ struct pack_plan_3d {
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   pack/unpack with array indices 
+   pack/unpack with array indices
 ------------------------------------------------------------------------- */
 
 #ifdef PACK_ARRAY
 
 /* ----------------------------------------------------------------------
-   pack from data -> buf 
+   pack from data -> buf
 ------------------------------------------------------------------------- */
 
 static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan)
@@ -70,13 +70,13 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan)
     for (mid = 0; mid < nmid; mid++) {
       out = plane + mid*nstride_line;
       for (fast = 0; fast < nfast; fast++)
-	buf[in++] = data[out++];
+        buf[in++] = data[out++];
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data 
+   unpack from buf -> data
 ------------------------------------------------------------------------- */
 
 static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -96,13 +96,13 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan
     for (mid = 0; mid < nmid; mid++) {
       in = plane + mid*nstride_line;
       for (fast = 0; fast < nfast; fast++)
-	data[in++] = buf[out++];
+        data[in++] = buf[out++];
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, one axis permutation, 1 value/element 
+   unpack from buf -> data, one axis permutation, 1 value/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -122,13 +122,13 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
     for (mid = 0; mid < nmid; mid++) {
       in = plane + mid;
       for (fast = 0; fast < nfast; fast++, in += nstride_plane)
-	data[in] = buf[out++];
+        data[in] = buf[out++];
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, one axis permutation, 2 values/element 
+   unpack from buf -> data, one axis permutation, 2 values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -148,15 +148,15 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
     for (mid = 0; mid < nmid; mid++) {
       in = plane + 2*mid;
       for (fast = 0; fast < nfast; fast++, in += nstride_plane) {
-	data[in] = buf[out++];
-	data[in+1] = buf[out++];
+        data[in] = buf[out++];
+        data[in+1] = buf[out++];
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, one axis permutation, nqty values/element 
+   unpack from buf -> data, one axis permutation, nqty values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -178,15 +178,15 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
     for (mid = 0; mid < nmid; mid++) {
       instart = plane + nqty*mid;
       for (fast = 0; fast < nfast; fast++, instart += nstride_plane) {
-	in = instart;
-	for (iqty = 0; iqty < nqty; iqty++) data[in++] = buf[out++];
+        in = instart;
+        for (iqty = 0; iqty < nqty; iqty++) data[in++] = buf[out++];
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, two axis permutation, 1 value/element 
+   unpack from buf -> data, two axis permutation, 1 value/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -206,13 +206,13 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
     for (mid = 0; mid < nmid; mid++) {
       in = slow + mid*nstride_plane;
       for (fast = 0; fast < nfast; fast++, in += nstride_line)
-	data[in] = buf[out++];
+        data[in] = buf[out++];
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, two axis permutation, 2 values/element 
+   unpack from buf -> data, two axis permutation, 2 values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -232,15 +232,15 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
     for (mid = 0; mid < nmid; mid++) {
       in = 2*slow + mid*nstride_plane;
       for (fast = 0; fast < nfast; fast++, in += nstride_line) {
-	data[in] = buf[out++];
-	data[in+1] = buf[out++];
+        data[in] = buf[out++];
+        data[in+1] = buf[out++];
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, two axis permutation, nqty values/element 
+   unpack from buf -> data, two axis permutation, nqty values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -261,8 +261,8 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
     for (mid = 0; mid < nmid; mid++) {
       instart = nqty*slow + mid*nstride_plane;
       for (fast = 0; fast < nfast; fast++, instart += nstride_line) {
-	in = instart;
-	for (iqty = 0; iqty < nqty; iqty++) data[in++] = buf[out++];
+        in = instart;
+        for (iqty = 0; iqty < nqty; iqty++) data[in++] = buf[out++];
       }
     }
   }
@@ -271,13 +271,13 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
 #endif
 
 /* ----------------------------------------------------------------------
-   pack/unpack with pointers 
+   pack/unpack with pointers
 ------------------------------------------------------------------------- */
 
 #ifdef PACK_POINTER
 
 /* ----------------------------------------------------------------------
-   pack from data -> buf 
+   pack from data -> buf
 ------------------------------------------------------------------------- */
 
 static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan)
@@ -300,13 +300,13 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan)
       begin = &(data[plane+mid*nstride_line]);
       end = begin + nfast;
       for (out = begin; out < end; out++)
-	*(in++) = *out;
+        *(in++) = *out;
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data 
+   unpack from buf -> data
 ------------------------------------------------------------------------- */
 
 static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -329,13 +329,13 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan
       begin = &(data[plane+mid*nstride_line]);
       end = begin + nfast;
       for (in = begin; in < end; in++)
-	*in = *(out++);
+        *in = *(out++);
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, one axis permutation, 1 value/element 
+   unpack from buf -> data, one axis permutation, 1 value/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -358,13 +358,13 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[plane+mid]);
       end = begin + nfast*nstride_plane;
       for (in = begin; in < end; in += nstride_plane)
-	*in = *(out++);
+        *in = *(out++);
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, one axis permutation, 2 values/element 
+   unpack from buf -> data, one axis permutation, 2 values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -387,15 +387,15 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[plane+2*mid]);
       end = begin + nfast*nstride_plane;
       for (in = begin; in < end; in += nstride_plane) {
-	*in = *(out++);
-	*(in+1) = *(out++);
+        *in = *(out++);
+        *(in+1) = *(out++);
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, one axis permutation, nqty values/element 
+   unpack from buf -> data, one axis permutation, nqty values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -419,15 +419,15 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[plane+nqty*mid]);
       end = begin + nfast*nstride_plane;
       for (instart = begin; instart < end; instart += nstride_plane) {
-	in = instart;
-	for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++);
+        in = instart;
+        for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++);
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, two axis permutation, 1 value/element 
+   unpack from buf -> data, two axis permutation, 1 value/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -449,13 +449,13 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[slow+mid*nstride_plane]);
       end = begin + nfast*nstride_line;
       for (in = begin; in < end; in += nstride_line)
-	*in = *(out++);
+        *in = *(out++);
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, two axis permutation, 2 values/element 
+   unpack from buf -> data, two axis permutation, 2 values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -477,15 +477,15 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[2*slow+mid*nstride_plane]);
       end = begin + nfast*nstride_line;
       for (in = begin; in < end; in += nstride_line) {
-	*in = *(out++);
-	*(in+1) = *(out++);
+        *in = *(out++);
+        *(in+1) = *(out++);
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, two axis permutation, nqty values/element 
+   unpack from buf -> data, two axis permutation, nqty values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -508,8 +508,8 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[nqty*slow+mid*nstride_plane]);
       end = begin + nfast*nstride_line;
       for (instart = begin; instart < end; instart += nstride_line) {
-	in = instart;
-	for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++);
+        in = instart;
+        for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++);
       }
     }
   }
@@ -518,15 +518,15 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
 #endif
 
 /* ----------------------------------------------------------------------
-   pack/unpack with pointers and memcpy function 
+   pack/unpack with pointers and memcpy function
    no memcpy version of unpack_permute routines,
-     just use PACK_POINTER versions 
+     just use PACK_POINTER versions
 ------------------------------------------------------------------------- */
 
 #ifdef PACK_MEMCPY
 
 /* ----------------------------------------------------------------------
-   pack from data -> buf 
+   pack from data -> buf
 ------------------------------------------------------------------------- */
 
 static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan)
@@ -555,7 +555,7 @@ static void pack_3d(PACK_DATA *data, PACK_DATA *buf, struct pack_plan_3d *plan)
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data 
+   unpack from buf -> data
 ------------------------------------------------------------------------- */
 
 static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -584,7 +584,7 @@ static void unpack_3d(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, one axis permutation, 1 value/element 
+   unpack from buf -> data, one axis permutation, 1 value/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -607,13 +607,13 @@ static void unpack_3d_permute1_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[plane+mid]);
       end = begin + nfast*nstride_plane;
       for (in = begin; in < end; in += nstride_plane)
-	*in = *(out++);
+        *in = *(out++);
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, one axis permutation, 2 values/element 
+   unpack from buf -> data, one axis permutation, 2 values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -636,15 +636,15 @@ static void unpack_3d_permute1_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[plane+2*mid]);
       end = begin + nfast*nstride_plane;
       for (in = begin; in < end; in += nstride_plane) {
-	*in = *(out++);
-	*(in+1) = *(out++);
+        *in = *(out++);
+        *(in+1) = *(out++);
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, one axis permutation, nqty values/element 
+   unpack from buf -> data, one axis permutation, nqty values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -668,15 +668,15 @@ static void unpack_3d_permute1_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[plane+nqty*mid]);
       end = begin + nfast*nstride_plane;
       for (instart = begin; instart < end; instart += nstride_plane) {
-	in = instart;
-	for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++);
+        in = instart;
+        for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++);
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, two axis permutation, 1 value/element 
+   unpack from buf -> data, two axis permutation, 1 value/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -698,13 +698,13 @@ static void unpack_3d_permute2_1(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[slow+mid*nstride_plane]);
       end = begin + nfast*nstride_line;
       for (in = begin; in < end; in += nstride_line)
-	*in = *(out++);
+        *in = *(out++);
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, two axis permutation, 2 values/element 
+   unpack from buf -> data, two axis permutation, 2 values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -726,15 +726,15 @@ static void unpack_3d_permute2_2(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[2*slow+mid*nstride_plane]);
       end = begin + nfast*nstride_line;
       for (in = begin; in < end; in += nstride_line) {
-	*in = *(out++);
-	*(in+1) = *(out++);
+        *in = *(out++);
+        *(in+1) = *(out++);
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   unpack from buf -> data, two axis permutation, nqty values/element 
+   unpack from buf -> data, two axis permutation, nqty values/element
 ------------------------------------------------------------------------- */
 
 static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_plan_3d *plan)
@@ -757,8 +757,8 @@ static void unpack_3d_permute2_n(PACK_DATA *buf, PACK_DATA *data, struct pack_pl
       begin = &(data[nqty*slow+mid*nstride_plane]);
       end = begin + nfast*nstride_line;
       for (instart = begin; instart < end; instart += nstride_line) {
-	in = instart;
-	for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++);
+        in = instart;
+        for (iqty = 0; iqty < nqty; iqty++) *(in++) = *(out++);
       }
     }
   }
diff --git a/src/pair.cpp b/src/pair.cpp
index 4cdc7a8542..96c6cc9feb 100644
--- a/src/pair.cpp
+++ b/src/pair.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -114,7 +114,7 @@ void Pair::modify_params(int narg, char **arg)
     } else if (strcmp(arg[iarg],"table") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command");
       ncoultablebits = atoi(arg[iarg+1]);
-      if (ncoultablebits > sizeof(float)*CHAR_BIT) 
+      if (ncoultablebits > sizeof(float)*CHAR_BIT)
         error->all(FLERR,"Too many total bits for bitmapped lookup table");
       iarg += 2;
     } else if (strcmp(arg[iarg],"tabinner") == 0) {
@@ -176,12 +176,12 @@ void Pair::init()
       cutsq[i][j] = cutsq[j][i] = cut*cut;
       cutforce = MAX(cutforce,cut);
       if (tail_flag) {
-	etail += etail_ij;
-	ptail += ptail_ij;
-	if (i != j) {
-	  etail += etail_ij;
-	  ptail += ptail_ij;
-	}
+        etail += etail_ij;
+        ptail += ptail_ij;
+        if (i != j) {
+          etail += etail_ij;
+          ptail += ptail_ij;
+        }
       }
     }
 }
@@ -202,12 +202,12 @@ void Pair::reinit()
     for (j = i; j <= atom->ntypes; j++) {
       tmp = init_one(i,j);
       if (tail_flag) {
-	etail += etail_ij;
-	ptail += ptail_ij;
-	if (i != j) {
-	  etail += etail_ij;
-	  ptail += ptail_ij;
-	}
+        etail += etail_ij;
+        ptail += ptail_ij;
+        if (i != j) {
+          etail += etail_ij;
+          ptail += ptail_ij;
+        }
       }
     }
 }
@@ -372,27 +372,27 @@ void Pair::ev_unset()
 ------------------------------------------------------------------------- */
 
 void Pair::ev_tally(int i, int j, int nlocal, int newton_pair,
-		    double evdwl, double ecoul, double fpair,
-		    double delx, double dely, double delz)
+                    double evdwl, double ecoul, double fpair,
+                    double delx, double dely, double delz)
 {
   double evdwlhalf,ecoulhalf,epairhalf,v[6];
 
   if (eflag_either) {
     if (eflag_global) {
       if (newton_pair) {
-	eng_vdwl += evdwl;
-	eng_coul += ecoul;
+        eng_vdwl += evdwl;
+        eng_coul += ecoul;
       } else {
-	evdwlhalf = 0.5*evdwl;
-	ecoulhalf = 0.5*ecoul;
-	if (i < nlocal) {
-	  eng_vdwl += evdwlhalf;
-	  eng_coul += ecoulhalf;
-	}
-	if (j < nlocal) {
-	  eng_vdwl += evdwlhalf;
-	  eng_coul += ecoulhalf;
-	}
+        evdwlhalf = 0.5*evdwl;
+        ecoulhalf = 0.5*ecoul;
+        if (i < nlocal) {
+          eng_vdwl += evdwlhalf;
+          eng_coul += ecoulhalf;
+        }
+        if (j < nlocal) {
+          eng_vdwl += evdwlhalf;
+          eng_coul += ecoulhalf;
+        }
       }
     }
     if (eflag_atom) {
@@ -412,59 +412,59 @@ void Pair::ev_tally(int i, int j, int nlocal, int newton_pair,
 
     if (vflag_global) {
       if (newton_pair) {
-	virial[0] += v[0];
-	virial[1] += v[1];
-	virial[2] += v[2];
-	virial[3] += v[3];
-	virial[4] += v[4];
-	virial[5] += v[5];
+        virial[0] += v[0];
+        virial[1] += v[1];
+        virial[2] += v[2];
+        virial[3] += v[3];
+        virial[4] += v[4];
+        virial[5] += v[5];
       } else {
-	if (i < nlocal) {
-	  virial[0] += 0.5*v[0];
-	  virial[1] += 0.5*v[1];
-	  virial[2] += 0.5*v[2];
-	  virial[3] += 0.5*v[3];
-	  virial[4] += 0.5*v[4];
-	  virial[5] += 0.5*v[5];
-	}
-	if (j < nlocal) {
-	  virial[0] += 0.5*v[0];
-	  virial[1] += 0.5*v[1];
-	  virial[2] += 0.5*v[2];
-	  virial[3] += 0.5*v[3];
-	  virial[4] += 0.5*v[4];
-	  virial[5] += 0.5*v[5];
-	}
+        if (i < nlocal) {
+          virial[0] += 0.5*v[0];
+          virial[1] += 0.5*v[1];
+          virial[2] += 0.5*v[2];
+          virial[3] += 0.5*v[3];
+          virial[4] += 0.5*v[4];
+          virial[5] += 0.5*v[5];
+        }
+        if (j < nlocal) {
+          virial[0] += 0.5*v[0];
+          virial[1] += 0.5*v[1];
+          virial[2] += 0.5*v[2];
+          virial[3] += 0.5*v[3];
+          virial[4] += 0.5*v[4];
+          virial[5] += 0.5*v[5];
+        }
       }
     }
 
     if (vflag_atom) {
       if (newton_pair || i < nlocal) {
-	vatom[i][0] += 0.5*v[0];
-	vatom[i][1] += 0.5*v[1];
-	vatom[i][2] += 0.5*v[2];
-	vatom[i][3] += 0.5*v[3];
-	vatom[i][4] += 0.5*v[4];
-	vatom[i][5] += 0.5*v[5];
+        vatom[i][0] += 0.5*v[0];
+        vatom[i][1] += 0.5*v[1];
+        vatom[i][2] += 0.5*v[2];
+        vatom[i][3] += 0.5*v[3];
+        vatom[i][4] += 0.5*v[4];
+        vatom[i][5] += 0.5*v[5];
       }
       if (newton_pair || j < nlocal) {
-	vatom[j][0] += 0.5*v[0];
-	vatom[j][1] += 0.5*v[1];
-	vatom[j][2] += 0.5*v[2];
-	vatom[j][3] += 0.5*v[3];
-	vatom[j][4] += 0.5*v[4];
-	vatom[j][5] += 0.5*v[5];
+        vatom[j][0] += 0.5*v[0];
+        vatom[j][1] += 0.5*v[1];
+        vatom[j][2] += 0.5*v[2];
+        vatom[j][3] += 0.5*v[3];
+        vatom[j][4] += 0.5*v[4];
+        vatom[j][5] += 0.5*v[5];
       }
     }
   }
 }
 
-/* ---------------------------------------------------------------------- 
+/* ----------------------------------------------------------------------
    tally eng_vdwl and virial into global and per-atom accumulators
    can use this version with full neighbor lists
 ------------------------------------------------------------------------- */
 
-void Pair::ev_tally_full(int i, double evdwl, double ecoul, double fpair, 
+void Pair::ev_tally_full(int i, double evdwl, double ecoul, double fpair,
                          double delx, double dely, double delz)
 {
   double v[6];
@@ -511,28 +511,28 @@ void Pair::ev_tally_full(int i, double evdwl, double ecoul, double fpair,
 ------------------------------------------------------------------------- */
 
 void Pair::ev_tally_xyz(int i, int j, int nlocal, int newton_pair,
-			double evdwl, double ecoul,
-			double fx, double fy, double fz,
-			double delx, double dely, double delz)
+                        double evdwl, double ecoul,
+                        double fx, double fy, double fz,
+                        double delx, double dely, double delz)
 {
   double evdwlhalf,ecoulhalf,epairhalf,v[6];
-  
+
   if (eflag_either) {
     if (eflag_global) {
       if (newton_pair) {
-	eng_vdwl += evdwl;
-	eng_coul += ecoul;
+        eng_vdwl += evdwl;
+        eng_coul += ecoul;
       } else {
-	evdwlhalf = 0.5*evdwl;
-	ecoulhalf = 0.5*ecoul;
-	if (i < nlocal) {
-	  eng_vdwl += evdwlhalf;
-	  eng_coul += ecoulhalf;
-	}
-	if (j < nlocal) {
-	  eng_vdwl += evdwlhalf;
-	  eng_coul += ecoulhalf;
-	}
+        evdwlhalf = 0.5*evdwl;
+        ecoulhalf = 0.5*ecoul;
+        if (i < nlocal) {
+          eng_vdwl += evdwlhalf;
+          eng_coul += ecoulhalf;
+        }
+        if (j < nlocal) {
+          eng_vdwl += evdwlhalf;
+          eng_coul += ecoulhalf;
+        }
       }
     }
     if (eflag_atom) {
@@ -552,48 +552,48 @@ void Pair::ev_tally_xyz(int i, int j, int nlocal, int newton_pair,
 
     if (vflag_global) {
       if (newton_pair) {
-	virial[0] += v[0];
-	virial[1] += v[1];
-	virial[2] += v[2];
-	virial[3] += v[3];
-	virial[4] += v[4];
-	virial[5] += v[5];
+        virial[0] += v[0];
+        virial[1] += v[1];
+        virial[2] += v[2];
+        virial[3] += v[3];
+        virial[4] += v[4];
+        virial[5] += v[5];
       } else {
-	if (i < nlocal) {
-	  virial[0] += 0.5*v[0];
-	  virial[1] += 0.5*v[1];
-	  virial[2] += 0.5*v[2];
-	  virial[3] += 0.5*v[3];
-	  virial[4] += 0.5*v[4];
-	  virial[5] += 0.5*v[5];
-	}
-	if (j < nlocal) {
-	  virial[0] += 0.5*v[0];
-	  virial[1] += 0.5*v[1];
-	  virial[2] += 0.5*v[2];
-	  virial[3] += 0.5*v[3];
-	  virial[4] += 0.5*v[4];
-	  virial[5] += 0.5*v[5];
-	}
+        if (i < nlocal) {
+          virial[0] += 0.5*v[0];
+          virial[1] += 0.5*v[1];
+          virial[2] += 0.5*v[2];
+          virial[3] += 0.5*v[3];
+          virial[4] += 0.5*v[4];
+          virial[5] += 0.5*v[5];
+        }
+        if (j < nlocal) {
+          virial[0] += 0.5*v[0];
+          virial[1] += 0.5*v[1];
+          virial[2] += 0.5*v[2];
+          virial[3] += 0.5*v[3];
+          virial[4] += 0.5*v[4];
+          virial[5] += 0.5*v[5];
+        }
       }
     }
 
     if (vflag_atom) {
       if (newton_pair || i < nlocal) {
-	vatom[i][0] += 0.5*v[0];
-	vatom[i][1] += 0.5*v[1];
-	vatom[i][2] += 0.5*v[2];
-	vatom[i][3] += 0.5*v[3];
-	vatom[i][4] += 0.5*v[4];
-	vatom[i][5] += 0.5*v[5];
+        vatom[i][0] += 0.5*v[0];
+        vatom[i][1] += 0.5*v[1];
+        vatom[i][2] += 0.5*v[2];
+        vatom[i][3] += 0.5*v[3];
+        vatom[i][4] += 0.5*v[4];
+        vatom[i][5] += 0.5*v[5];
       }
       if (newton_pair || j < nlocal) {
-	vatom[j][0] += 0.5*v[0];
-	vatom[j][1] += 0.5*v[1];
-	vatom[j][2] += 0.5*v[2];
-	vatom[j][3] += 0.5*v[3];
-	vatom[j][4] += 0.5*v[4];
-	vatom[j][5] += 0.5*v[5];
+        vatom[j][0] += 0.5*v[0];
+        vatom[j][1] += 0.5*v[1];
+        vatom[j][2] += 0.5*v[2];
+        vatom[j][3] += 0.5*v[3];
+        vatom[j][4] += 0.5*v[4];
+        vatom[j][5] += 0.5*v[5];
       }
     }
   }
@@ -606,11 +606,11 @@ void Pair::ev_tally_xyz(int i, int j, int nlocal, int newton_pair,
 ------------------------------------------------------------------------- */
 
 void Pair::ev_tally_xyz_full(int i, double evdwl, double ecoul,
-			     double fx, double fy, double fz,
-			     double delx, double dely, double delz)
+                             double fx, double fy, double fz,
+                             double delx, double dely, double delz)
 {
   double evdwlhalf,ecoulhalf,epairhalf,v[6];
-  
+
   if (eflag_either) {
     if (eflag_global) {
       evdwlhalf = 0.5*evdwl;
@@ -640,7 +640,7 @@ void Pair::ev_tally_xyz_full(int i, double evdwl, double ecoul,
       virial[4] += v[4];
       virial[5] += v[5];
     }
-    
+
     if (vflag_atom) {
       vatom[i][0] += v[0];
       vatom[i][1] += v[1];
@@ -659,7 +659,7 @@ void Pair::ev_tally_xyz_full(int i, double evdwl, double ecoul,
  ------------------------------------------------------------------------- */
 
 void Pair::ev_tally3(int i, int j, int k, double evdwl, double ecoul,
-		     double *fj, double *fk, double *drji, double *drki)
+                     double *fj, double *fk, double *drji, double *drki)
 {
   double epairthird,v[6];
 
@@ -683,7 +683,7 @@ void Pair::ev_tally3(int i, int j, int k, double evdwl, double ecoul,
     v[3] = drji[0]*fj[1] + drki[0]*fk[1];
     v[4] = drji[0]*fj[2] + drki[0]*fk[2];
     v[5] = drji[1]*fj[2] + drki[1]*fk[2];
-      
+
     if (vflag_global) {
       virial[0] += v[0];
       virial[1] += v[1];
@@ -695,7 +695,7 @@ void Pair::ev_tally3(int i, int j, int k, double evdwl, double ecoul,
 
     if (vflag_atom) {
       vatom[i][0] += THIRD*v[0]; vatom[i][1] += THIRD*v[1];
-      vatom[i][2] += THIRD*v[2]; vatom[i][3] += THIRD*v[3]; 
+      vatom[i][2] += THIRD*v[2]; vatom[i][3] += THIRD*v[3];
       vatom[i][4] += THIRD*v[4]; vatom[i][5] += THIRD*v[5];
 
       vatom[j][0] += THIRD*v[0]; vatom[j][1] += THIRD*v[1];
@@ -715,8 +715,8 @@ void Pair::ev_tally3(int i, int j, int k, double evdwl, double ecoul,
  ------------------------------------------------------------------------- */
 
 void Pair::ev_tally4(int i, int j, int k, int m, double evdwl,
-		     double *fi, double *fj, double *fk,
-		     double *drim, double *drjm, double *drkm)
+                     double *fi, double *fj, double *fk,
+                     double *drim, double *drjm, double *drkm)
 {
   double epairfourth,v[6];
 
@@ -738,7 +738,7 @@ void Pair::ev_tally4(int i, int j, int k, int m, double evdwl,
     v[3] = 0.25 * (drim[0]*fi[1] + drjm[0]*fj[1] + drkm[0]*fk[1]);
     v[4] = 0.25 * (drim[0]*fi[2] + drjm[0]*fj[2] + drkm[0]*fk[2]);
     v[5] = 0.25 * (drim[1]*fi[2] + drjm[1]*fj[2] + drkm[1]*fk[2]);
-    
+
     vatom[i][0] += v[0]; vatom[i][1] += v[1]; vatom[i][2] += v[2];
     vatom[i][3] += v[3]; vatom[i][4] += v[4]; vatom[i][5] += v[5];
     vatom[j][0] += v[0]; vatom[j][1] += v[1]; vatom[j][2] += v[2];
@@ -786,13 +786,13 @@ void Pair::ev_tally_list(int n, int *list, double ecoul, double *v)
       v[4] /= n;
       v[5] /= n;
       for (i = 0; i < n; i++) {
-	j = list[i];
-	vatom[j][0] += v[0];
-	vatom[j][1] += v[1];
-	vatom[j][2] += v[2];
-	vatom[j][3] += v[3];
-	vatom[j][4] += v[4];
-	vatom[j][5] += v[5];
+        j = list[i];
+        vatom[j][0] += v[0];
+        vatom[j][1] += v[1];
+        vatom[j][2] += v[2];
+        vatom[j][3] += v[3];
+        vatom[j][4] += v[4];
+        vatom[j][5] += v[5];
       }
     }
   }
@@ -807,7 +807,7 @@ void Pair::ev_tally_list(int n, int *list, double ecoul, double *v)
 void Pair::v_tally(int i, double *fi, double *deli)
 {
   double v[6];
-  
+
   v[0] = 0.5*deli[0]*fi[0];
   v[1] = 0.5*deli[1]*fi[1];
   v[2] = 0.5*deli[2]*fi[2];
@@ -828,7 +828,7 @@ void Pair::v_tally(int i, double *fi, double *deli)
 void Pair::v_tally2(int i, int j, double fpair, double *drij)
 {
   double v[6];
-  
+
   v[0] = 0.5 * drij[0]*drij[0]*fpair;
   v[1] = 0.5 * drij[1]*drij[1]*fpair;
   v[2] = 0.5 * drij[2]*drij[2]*fpair;
@@ -848,10 +848,10 @@ void Pair::v_tally2(int i, int j, double fpair, double *drij)
 ------------------------------------------------------------------------- */
 
 void Pair::v_tally3(int i, int j, int k,
-		    double *fi, double *fj, double *drik, double *drjk)
+                    double *fi, double *fj, double *drik, double *drjk)
 {
   double v[6];
-  
+
   v[0] = THIRD * (drik[0]*fi[0] + drjk[0]*fj[0]);
   v[1] = THIRD * (drik[1]*fi[1] + drjk[1]*fj[1]);
   v[2] = THIRD * (drik[2]*fi[2] + drjk[2]*fj[2]);
@@ -873,8 +873,8 @@ void Pair::v_tally3(int i, int j, int k,
 ------------------------------------------------------------------------- */
 
 void Pair::v_tally4(int i, int j, int k, int m,
-		    double *fi, double *fj, double *fk,
-		    double *drim, double *drjm, double *drkm)
+                    double *fi, double *fj, double *fk,
+                    double *drim, double *drjm, double *drkm)
 {
   double v[6];
 
@@ -901,8 +901,8 @@ void Pair::v_tally4(int i, int j, int k, int m,
 ------------------------------------------------------------------------- */
 
 void Pair::v_tally_tensor(int i, int j, int nlocal, int newton_pair,
-			  double vxx, double vyy, double vzz,
-			  double vxy, double vxz, double vyz)
+                          double vxx, double vyy, double vzz,
+                          double vxy, double vxz, double vyz)
 {
   double v[6];
 
@@ -912,7 +912,7 @@ void Pair::v_tally_tensor(int i, int j, int nlocal, int newton_pair,
   v[3] = vxy;
   v[4] = vxz;
   v[5] = vyz;
-  
+
   if (vflag_global) {
     if (newton_pair) {
       virial[0] += v[0];
@@ -923,20 +923,20 @@ void Pair::v_tally_tensor(int i, int j, int nlocal, int newton_pair,
       virial[5] += v[5];
     } else {
       if (i < nlocal) {
-	virial[0] += 0.5*v[0];
-	virial[1] += 0.5*v[1];
-	virial[2] += 0.5*v[2];
-	virial[3] += 0.5*v[3];
-	virial[4] += 0.5*v[4];
-	virial[5] += 0.5*v[5];
+        virial[0] += 0.5*v[0];
+        virial[1] += 0.5*v[1];
+        virial[2] += 0.5*v[2];
+        virial[3] += 0.5*v[3];
+        virial[4] += 0.5*v[4];
+        virial[5] += 0.5*v[5];
       }
       if (j < nlocal) {
-	virial[0] += 0.5*v[0];
-	virial[1] += 0.5*v[1];
-	virial[2] += 0.5*v[2];
-	virial[3] += 0.5*v[3];
-	virial[4] += 0.5*v[4];
-	virial[5] += 0.5*v[5];
+        virial[0] += 0.5*v[0];
+        virial[1] += 0.5*v[1];
+        virial[2] += 0.5*v[2];
+        virial[3] += 0.5*v[3];
+        virial[4] += 0.5*v[4];
+        virial[5] += 0.5*v[5];
       }
     }
   }
@@ -1017,7 +1017,7 @@ void Pair::virial_fdotr_compute()
 void Pair::write_file(int narg, char **arg)
 {
   if (narg < 8) error->all(FLERR,"Illegal pair_write command");
-  if (single_enable == 0) 
+  if (single_enable == 0)
     error->all(FLERR,"Pair style does not support pair_write");
 
   // parse arguments
@@ -1050,10 +1050,10 @@ void Pair::write_file(int narg, char **arg)
     fp = fopen(arg[6],"a");
     if (fp == NULL) error->one(FLERR,"Cannot open pair_write file");
     fprintf(fp,"# Pair potential %s for atom types %d %d: i,r,energy,force\n",
-	    force->pair_style,itype,jtype);
-    if (style == RLINEAR) 
+            force->pair_style,itype,jtype);
+    if (style == RLINEAR)
       fprintf(fp,"\n%s\nN %d R %g %g\n\n",arg[7],n,inner,outer);
-    if (style == RSQ) 
+    if (style == RSQ)
       fprintf(fp,"\n%s\nN %d RSQ %g %g\n\n",arg[7],n,inner,outer);
   }
 
@@ -1097,7 +1097,7 @@ void Pair::write_file(int narg, char **arg)
     n = ntable;
   }
 
-  double r,e,f,rsq;  
+  double r,e,f,rsq;
   union_int_float_t rsq_lookup;
 
   for (int i = 0; i < n; i++) {
@@ -1130,7 +1130,7 @@ void Pair::write_file(int narg, char **arg)
   double *tmp;
   if (epair) epair->swap_eam(eamfp_hold,&tmp);
   if (atom->q) atom->q = q_hold;
-  
+
   if (me == 0) fclose(fp);
 }
 
@@ -1138,20 +1138,20 @@ void Pair::write_file(int narg, char **arg)
    define bitmap parameters based on inner and outer cutoffs
 ------------------------------------------------------------------------- */
 
-void Pair::init_bitmap(double inner, double outer, int ntablebits, 
+void Pair::init_bitmap(double inner, double outer, int ntablebits,
              int &masklo, int &maskhi, int &nmask, int &nshiftbits)
 {
   if (sizeof(int) != sizeof(float))
     error->all(FLERR,"Bitmapped lookup tables require int/float be same size");
-  
-  if (ntablebits > sizeof(float)*CHAR_BIT) 
+
+  if (ntablebits > sizeof(float)*CHAR_BIT)
     error->all(FLERR,"Too many total bits for bitmapped lookup table");
-          
-  if (inner >= outer) 
+
+  if (inner >= outer)
     error->warning(FLERR,"Table inner cutoff >= outer cutoff");
-    
+
   int nlowermin = 1;
-  while (!((pow(double(2),(double)nlowermin) <= inner*inner) && 
+  while (!((pow(double(2),(double)nlowermin) <= inner*inner) &&
            (pow(double(2),(double)nlowermin+1.0) > inner*inner))) {
     if (pow(double(2),(double)nlowermin) <= inner*inner) nlowermin++;
     else nlowermin--;
@@ -1160,15 +1160,15 @@ void Pair::init_bitmap(double inner, double outer, int ntablebits,
   int nexpbits = 0;
   double required_range = outer*outer / pow(double(2),(double)nlowermin);
   double available_range = 2.0;
-  
+
   while (available_range < required_range) {
     nexpbits++;
     available_range = pow(double(2),pow(double(2),(double)nexpbits));
   }
-     
+
   int nmantbits = ntablebits - nexpbits;
 
-  if (nexpbits > sizeof(float)*CHAR_BIT - FLT_MANT_DIG) 
+  if (nexpbits > sizeof(float)*CHAR_BIT - FLT_MANT_DIG)
     error->all(FLERR,"Too many exponent bits for lookup table");
   if (nmantbits+1 > FLT_MANT_DIG)
     error->all(FLERR,"Too many mantissa bits for lookup table");
diff --git a/src/pair.h b/src/pair.h
index a2f7746287..2c67e9bdb0 100644
--- a/src/pair.h
+++ b/src/pair.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -63,7 +63,7 @@ class Pair : protected Pointers {
 
   int single_extra;              // number of extra single values calculated
   double *svector;               // vector of extra single quantities
-  
+
   class NeighList *list;         // standard neighbor list used by most pairs
   class NeighList *listhalf;     // half list used by some pairs
   class NeighList *listfull;     // full list used by some pairs
@@ -92,14 +92,14 @@ class Pair : protected Pointers {
 
   void v_tally(int, double *, double *);
   void ev_tally(int, int, int, int, double, double, double,
-		double, double, double);
+                double, double, double);
   void ev_tally3(int, int, int, double, double,
-		 double *, double *, double *, double *);
+                 double *, double *, double *, double *);
   void v_tally3(int, int, int, double *, double *, double *, double *);
   void v_tally4(int, int, int, int, double *, double *, double *,
-		double *, double *, double *);
+                double *, double *, double *);
   void ev_tally_xyz(int, int, int, int, double, double,
-		    double, double, double, double, double, double);
+                    double, double, double, double, double, double);
 
   // general child-class methods
 
@@ -109,7 +109,7 @@ class Pair : protected Pointers {
   virtual void compute_outer(int, int) {}
 
   virtual double single(int, int, int, int,
-			double, double, double, double &) {return 0.0;}
+                        double, double, double, double &) {return 0.0;}
 
   virtual void settings(int, char **) = 0;
   virtual void coeff(int, char **) = 0;
@@ -130,7 +130,7 @@ class Pair : protected Pointers {
   virtual double memory_usage();
 
   // specific child-class methods for certain Pair styles
-  
+
   virtual void *extract(const char *, int &) {return NULL;}
   virtual void swap_eam(double *, double **) {}
   virtual void reset_dt() {}
@@ -162,13 +162,13 @@ class Pair : protected Pointers {
   void ev_unset();
   void ev_tally_full(int, double, double, double, double, double, double);
   void ev_tally_xyz_full(int, double, double,
-			 double, double, double, double, double, double);
+                         double, double, double, double, double, double);
   void ev_tally4(int, int, int, int, double,
-		 double *, double *, double *, double *, double *, double *);
+                 double *, double *, double *, double *, double *, double *);
   void ev_tally_list(int, int *, double, double *);
   void v_tally2(int, int, double, double *);
   void v_tally_tensor(int, int, int, int,
-		      double, double, double, double, double, double);
+                      double, double, double, double, double, double);
   void virial_fdotr_compute();
 
   inline int sbmask(int j) {
diff --git a/src/pair_beck.cpp b/src/pair_beck.cpp
index d96cae416c..696fb6c79c 100644
--- a/src/pair_beck.cpp
+++ b/src/pair_beck.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -59,7 +59,7 @@ void PairBeck::compute(int eflag, int vflag)
   double aaij,alphaij,betaij;
   double term1,term1inv,term2,term3,term4,term5,term6;
   int *ilist,*jlist,*numneigh,**firstneigh;
-  
+
   evdwl = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
@@ -70,12 +70,12 @@ void PairBeck::compute(int eflag, int vflag)
   int nlocal = atom->nlocal;
   double *special_lj = force->special_lj;
   int newton_pair = force->newton_pair;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -97,10 +97,10 @@ void PairBeck::compute(int eflag, int vflag)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq < cutsq[itype][jtype]) {
         r = sqrt(rsq);
-        r5 = rsq*rsq*r; 
+        r5 = rsq*rsq*r;
         aaij = aa[itype][jtype];
         alphaij = alpha[itype][jtype];
         betaij = beta[itype][jtype];
@@ -108,31 +108,31 @@ void PairBeck::compute(int eflag, int vflag)
         term2 = 1.0/pow(term1,5.0);
         term3 = 21.672 + 30.0*aaij*aaij + 6.0*rsq;
         term4 = alphaij + r5*betaij;
-        term5 = alphaij + 6.0*r5*betaij; 
+        term5 = alphaij + 6.0*r5*betaij;
         rinv  = 1.0/r;
-	force_beck = AA[itype][jtype]*exp(-1.0*r*term4)*term5;
-        force_beck -= BB[itype][jtype]*r*term2*term3; 
- 
-	fpair = factor_lj*force_beck*rinv;
-        
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-	
-	if (eflag) {
+        force_beck = AA[itype][jtype]*exp(-1.0*r*term4)*term5;
+        force_beck -= BB[itype][jtype]*r*term2*term3;
+
+        fpair = factor_lj*force_beck*rinv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
           term6 = 1.0/pow(term1,3.0);
           term1inv = 1.0/term1;
           evdwl = AA[itype][jtype]*exp(-1.0*r*term4);
           evdwl -= BB[itype][jtype]*term6*(1.0+(2.709+3.0*aaij*aaij)*term1inv);
-	}
+        }
 
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -141,7 +141,7 @@ void PairBeck::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairBeck::allocate()
@@ -165,7 +165,7 @@ void PairBeck::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairBeck::settings(int narg, char **arg)
@@ -180,9 +180,9 @@ void PairBeck::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) {
-	  cut[i][j] = cut_global; 
-	}
+        if (setflag[i][j]) {
+          cut[i][j] = cut_global;
+        }
   }
 }
 
@@ -205,7 +205,7 @@ void PairBeck::coeff(int narg, char **arg)
   double aa_one = atof(arg[4]);
   double alpha_one = atof(arg[5]);
   double beta_one = atof(arg[6]);
-  
+
   double cut_one = cut_global;
   if (narg == 8) cut_one = atof(arg[7]);
 
@@ -245,7 +245,7 @@ double PairBeck::init_one(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairBeck::write_restart(FILE *fp)
@@ -257,12 +257,12 @@ void PairBeck::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&AA[i][j],sizeof(double),1,fp);
-	fwrite(&BB[i][j],sizeof(double),1,fp);
-	fwrite(&aa[i][j],sizeof(double),1,fp);
-	fwrite(&alpha[i][j],sizeof(double),1,fp);
-	fwrite(&beta[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&AA[i][j],sizeof(double),1,fp);
+        fwrite(&BB[i][j],sizeof(double),1,fp);
+        fwrite(&aa[i][j],sizeof(double),1,fp);
+        fwrite(&alpha[i][j],sizeof(double),1,fp);
+        fwrite(&beta[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -283,20 +283,20 @@ void PairBeck::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&AA[i][j],sizeof(double),1,fp);
-	  fread(&BB[i][j],sizeof(double),1,fp);
-	  fread(&aa[i][j],sizeof(double),1,fp);
-	  fread(&alpha[i][j],sizeof(double),1,fp);
-	  fread(&beta[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&AA[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&BB[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&aa[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&beta[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&AA[i][j],sizeof(double),1,fp);
+          fread(&BB[i][j],sizeof(double),1,fp);
+          fread(&aa[i][j],sizeof(double),1,fp);
+          fread(&alpha[i][j],sizeof(double),1,fp);
+          fread(&beta[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&AA[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&BB[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&aa[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&beta[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -328,10 +328,10 @@ void PairBeck::read_restart_settings(FILE *fp)
 
 /* ---------------------------------------------------------------------- */
 
-double PairBeck::single(int i, int j, int itype, int jtype, 
-				  double rsq,
-				  double factor_coul, double factor_lj,
-				  double &fforce)
+double PairBeck::single(int i, int j, int itype, int jtype,
+                                  double rsq,
+                                  double factor_coul, double factor_lj,
+                                  double &fforce)
 {
   double phi_beck,r,rinv;
   double r5,force_beck;
diff --git a/src/pair_beck.h b/src/pair_beck.h
index 8790d67d95..922dac7507 100644
--- a/src/pair_beck.h
+++ b/src/pair_beck.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_born.cpp b/src/pair_born.cpp
index 68905a95d2..08aa6a96db 100644
--- a/src/pair_born.cpp
+++ b/src/pair_born.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -82,7 +82,7 @@ void PairBorn::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -106,31 +106,31 @@ void PairBorn::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r = sqrt(rsq);
-	rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
-	forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
-	  + born3[itype][jtype]*r2inv*r6inv;
-	fpair = factor_lj*forceborn*r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv 
-	    + d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r = sqrt(rsq);
+        rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
+        forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
+          + born3[itype][jtype]*r2inv*r6inv;
+        fpair = factor_lj*forceborn*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv
+            + d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -183,7 +183,7 @@ void PairBorn::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -238,8 +238,8 @@ double PairBorn::init_one(int i, int j)
   rhoinv[i][j] = 1.0/rho[i][j];
   born1[i][j] = a[i][j]/rho[i][j];
   born2[i][j] = 6.0*c[i][j];
-  born3[i][j] = 8.0*d[i][j]; 
-     
+  born3[i][j] = 8.0*d[i][j];
+
   if (offset_flag) {
     double rexp = exp((sigma[i][j]-cut[i][j])*rhoinv[i][j]);
     offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut[i][j],6.0) +
@@ -256,19 +256,19 @@ double PairBorn::init_one(int i, int j)
   born3[j][i] = born3[i][j];
   offset[j][i] = offset[i][j];
 
-  // compute I,J contribution to long-range tail correction 
-  // count total # of atoms of type I and J via Allreduce 
+  // compute I,J contribution to long-range tail correction
+  // count total # of atoms of type I and J via Allreduce
 
-  if (tail_flag) { 
-     int *type = atom->type; 
-     int nlocal = atom->nlocal; 
+  if (tail_flag) {
+     int *type = atom->type;
+     int nlocal = atom->nlocal;
 
-     double count[2],all[2]; 
-     count[0] = count[1] = 0.0; 
-     for (int k = 0; k < nlocal; k++) { 
-       if (type[k] == i) count[0] += 1.0; 
-       if (type[k] == j) count[1] += 1.0; 
-     } 
+     double count[2],all[2];
+     count[0] = count[1] = 0.0;
+     for (int k = 0; k < nlocal; k++) {
+       if (type[k] == i) count[0] += 1.0;
+       if (type[k] == j) count[1] += 1.0;
+     }
      MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
 
      double rho1 = rho[i][j];
@@ -278,15 +278,15 @@ double PairBorn::init_one(int i, int j)
      double rc2 = rc*rc;
      double rc3 = rc2*rc;
      double rc5 = rc3*rc2;
-     etail_ij = 2.0*MY_PI*all[0]*all[1] * 
-       (a[i][j]*exp((sigma[i][j]-rc)/rho1)*rho1* 
-	(rc2 + 2.0*rho1*rc + 2.0*rho2) - 
-	c[i][j]/(3.0*rc3) + d[i][j]/(5.0*rc5));
-     ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1] * 
-       (-a[i][j]*exp((sigma[i][j]-rc)/rho1) * 
-	(rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) + 
-	2.0*c[i][j]/rc3 - 8.0*d[i][j]/(5.0*rc5)); 
-   } 
+     etail_ij = 2.0*MY_PI*all[0]*all[1] *
+       (a[i][j]*exp((sigma[i][j]-rc)/rho1)*rho1*
+        (rc2 + 2.0*rho1*rc + 2.0*rho2) -
+        c[i][j]/(3.0*rc3) + d[i][j]/(5.0*rc5));
+     ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1] *
+       (-a[i][j]*exp((sigma[i][j]-rc)/rho1) *
+        (rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) +
+        2.0*c[i][j]/rc3 - 8.0*d[i][j]/(5.0*rc5));
+   }
 
    return cut[i][j];
 }
@@ -304,12 +304,12 @@ void PairBorn::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&a[i][j],sizeof(double),1,fp);
-	fwrite(&rho[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&c[i][j],sizeof(double),1,fp);
+        fwrite(&a[i][j],sizeof(double),1,fp);
+        fwrite(&rho[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&c[i][j],sizeof(double),1,fp);
         fwrite(&d[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -331,20 +331,20 @@ void PairBorn::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&a[i][j],sizeof(double),1,fp);
-	  fread(&rho[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&c[i][j],sizeof(double),1,fp);
+        if (me == 0) {
+          fread(&a[i][j],sizeof(double),1,fp);
+          fread(&rho[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&c[i][j],sizeof(double),1,fp);
           fread(&d[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
         MPI_Bcast(&d[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -379,8 +379,8 @@ void PairBorn::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairBorn::single(int i, int j, int itype, int jtype,
-			double rsq, double factor_coul, double factor_lj,
-			double &fforce)
+                        double rsq, double factor_coul, double factor_lj,
+                        double &fforce)
 {
   double r2inv,r6inv,r,rexp,forceborn,phiborn;
 
@@ -391,7 +391,7 @@ double PairBorn::single(int i, int j, int itype, int jtype,
   forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv +
     born3[itype][jtype]*r2inv*r6inv;
   fforce = factor_lj*forceborn*r2inv;
-  
+
   phiborn = a[itype][jtype]*rexp - c[itype][jtype]*r6inv +
     d[itype][jtype]*r2inv*r6inv - offset[itype][jtype];
   return factor_lj*phiborn;
diff --git a/src/pair_born.h b/src/pair_born.h
index 566fdc7c44..a37dd91650 100644
--- a/src/pair_born.h
+++ b/src/pair_born.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -45,7 +45,7 @@ class PairBorn : public Pair {
   double **cut;
   double **a,**rho,**sigma,**c, **d;
   double **rhoinv,**born1,**born2,**born3,**offset;
- 
+
   void allocate();
 };
 
diff --git a/src/pair_born_coul_wolf.cpp b/src/pair_born_coul_wolf.cpp
index db4a884910..7acb117b73 100644
--- a/src/pair_born_coul_wolf.cpp
+++ b/src/pair_born_coul_wolf.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -88,16 +88,16 @@ void PairBornCoulWolf::compute(int eflag, int vflag)
 
   // self and shifted coulombic energy
 
-  e_self = v_sh = 0.0; 
+  e_self = v_sh = 0.0;
   e_shift = erfc(alf*cut_coul)/cut_coul;
-  f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) / 
-    cut_coul; 
+  f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) /
+    cut_coul;
 
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
- 
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -127,52 +127,52 @@ void PairBornCoulWolf::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
+        r2inv = 1.0/rsq;
 
-	if (rsq < cut_coulsq) {
-	  r = sqrt(rsq);
+        if (rsq < cut_coulsq) {
+          r = sqrt(rsq);
           prefactor = qqrd2e*qtmp*q[j]/r;
-          erfcc = erfc(alf*r); 
+          erfcc = erfc(alf*r);
           erfcd = exp(-alf*alf*r*r);
-          v_sh = (erfcc - e_shift*r) * prefactor; 
+          v_sh = (erfcc - e_shift*r) * prefactor;
           dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
           forcecoul = dvdrr*rsq*prefactor;
-	  if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	} else forcecoul = 0.0;
+          if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        } else forcecoul = 0.0;
 
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
           r = sqrt(rsq);
-	  rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
-	  forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
-	    + born3[itype][jtype]*r2inv*r6inv;
-	} else forceborn = 0.0;
-
-	fpair = (forcecoul + factor_lj*forceborn) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = v_sh;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv +
-	      d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+          rexp = exp((sigma[itype][jtype]-r)*rhoinv[itype][jtype]);
+          forceborn = born1[itype][jtype]*r*rexp - born2[itype][jtype]*r6inv
+            + born3[itype][jtype]*r2inv*r6inv;
+        } else forceborn = 0.0;
+
+        fpair = (forcecoul + factor_lj*forceborn) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            ecoul = v_sh;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv +
+              d[itype][jtype]*r6inv*r2inv - offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -227,7 +227,7 @@ void PairBornCoulWolf::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
+        if (setflag[i][j]) cut_lj[i][j] = cut_lj_global;
   }
 }
 
@@ -237,7 +237,7 @@ void PairBornCoulWolf::settings(int narg, char **arg)
 
 void PairBornCoulWolf::coeff(int narg, char **arg)
 {
-  if (narg < 7 || narg > 8) 
+  if (narg < 7 || narg > 8)
     error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
@@ -301,7 +301,7 @@ double PairBornCoulWolf::init_one(int i, int j)
   born1[i][j] = a[i][j]/rho[i][j];
   born2[i][j] = 6.0*c[i][j];
   born3[i][j] = 8.0*d[i][j];
-     
+
   if (offset_flag) {
     double rexp = exp(-cut_lj[i][j]/rho[i][j]);
     offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0)
@@ -335,12 +335,12 @@ void PairBornCoulWolf::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&a[i][j],sizeof(double),1,fp);
-	fwrite(&rho[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&c[i][j],sizeof(double),1,fp);
-	fwrite(&d[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj[i][j],sizeof(double),1,fp);
+        fwrite(&a[i][j],sizeof(double),1,fp);
+        fwrite(&rho[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&c[i][j],sizeof(double),1,fp);
+        fwrite(&d[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -362,20 +362,20 @@ void PairBornCoulWolf::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&a[i][j],sizeof(double),1,fp);
-	  fread(&rho[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&c[i][j],sizeof(double),1,fp);
-	  fread(&d[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&d[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&a[i][j],sizeof(double),1,fp);
+          fread(&rho[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&c[i][j],sizeof(double),1,fp);
+          fread(&d[i][j],sizeof(double),1,fp);
+          fread(&cut_lj[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&d[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -418,23 +418,23 @@ void PairBornCoulWolf::read_restart_settings(FILE *fp)
 ------------------------------------------------------------------------- */
 
 double PairBornCoulWolf::single(int i, int j, int itype, int jtype,
-				double rsq, 
-				double factor_coul, double factor_lj,
-				double &fforce)
+                                double rsq,
+                                double factor_coul, double factor_lj,
+                                double &fforce)
 {
   double r2inv,r6inv,r,prefactor,rexp;
   double forcecoul,forceborn,phicoul,phiborn;
-  double e_shift,f_shift,dvdrr,erfcc,erfcd; 
+  double e_shift,f_shift,dvdrr,erfcc,erfcd;
 
   r2inv = 1.0/rsq;
   e_shift = erfc(alf*cut_coul) / cut_coul;
-  f_shift = -(e_shift+2*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) / 
-    cut_coul; 
- 
+  f_shift = -(e_shift+2*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) /
+    cut_coul;
+
   if (rsq < cut_coulsq) {
     r = sqrt(rsq);
     prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
-    erfcc = erfc(alf*r); 
+    erfcc = erfc(alf*r);
     erfcd = exp(-alf*alf*r*r);
     dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
     forcecoul = dvdrr*rsq*prefactor;
@@ -450,7 +450,7 @@ double PairBornCoulWolf::single(int i, int j, int itype, int jtype,
   } else forceborn = 0.0;
 
   fforce = (forcecoul + factor_lj*forceborn) * r2inv;
-  
+
   double eng = 0.0;
   if (rsq < cut_coulsq) {
     phicoul = prefactor * (erfcc-e_shift*r);
@@ -458,7 +458,7 @@ double PairBornCoulWolf::single(int i, int j, int itype, int jtype,
     eng += phicoul;
   }
   if (rsq < cut_ljsq[itype][jtype]) {
-    phiborn = a[itype][jtype]*rexp - c[itype][jtype]*r6inv 
+    phiborn = a[itype][jtype]*rexp - c[itype][jtype]*r6inv
       + d[itype][jtype]*r2inv*r6inv - offset[itype][jtype];
     eng += factor_lj*phiborn;
   }
diff --git a/src/pair_born_coul_wolf.h b/src/pair_born_coul_wolf.h
index 1042e68800..3428432542 100644
--- a/src/pair_born_coul_wolf.h
+++ b/src/pair_born_coul_wolf.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -38,7 +38,7 @@ class PairBornCoulWolf : public Pair {
   void write_restart_settings(FILE *);
   void read_restart_settings(FILE *);
   double single(int, int, int, int, double, double, double, double &);
-  
+
  protected:
   double cut_lj_global,alf;
   double **cut_lj,**cut_ljsq;
diff --git a/src/pair_buck.cpp b/src/pair_buck.cpp
index abd3d2dada..4fba27257e 100644
--- a/src/pair_buck.cpp
+++ b/src/pair_buck.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -75,7 +75,7 @@ void PairBuck::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -99,30 +99,30 @@ void PairBuck::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r = sqrt(rsq);
-	rexp = exp(-r*rhoinv[itype][jtype]);
-	forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
-	fpair = factor_lj*forcebuck*r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r = sqrt(rsq);
+        rexp = exp(-r*rhoinv[itype][jtype]);
+        forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
+        fpair = factor_lj*forcebuck*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -172,7 +172,7 @@ void PairBuck::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -223,7 +223,7 @@ double PairBuck::init_one(int i, int j)
   rhoinv[i][j] = 1.0/rho[i][j];
   buck1[i][j] = a[i][j]/rho[i][j];
   buck2[i][j] = 6.0*c[i][j];
-     
+
   if (offset_flag) {
     double rexp = exp(-cut[i][j]/rho[i][j]);
     offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut[i][j],6.0);
@@ -236,8 +236,8 @@ double PairBuck::init_one(int i, int j)
   buck2[j][i] = buck2[i][j];
   offset[j][i] = offset[i][j];
 
-  // compute I,J contribution to long-range tail correction 
-  // count total # of atoms of type I and J via Allreduce 
+  // compute I,J contribution to long-range tail correction
+  // count total # of atoms of type I and J via Allreduce
 
   if (tail_flag) {
     int *type = atom->type;
@@ -258,13 +258,13 @@ double PairBuck::init_one(int i, int j)
     double rc2 = rc*rc;
     double rc3 = rc2*rc;
     etail_ij = 2.0*MY_PI*all[0]*all[1]*
-      (a[i][j]*exp(-rc/rho1)*rho1*(rc2 + 2.0*rho1*rc + 2.0*rho2) - 
+      (a[i][j]*exp(-rc/rho1)*rho1*(rc2 + 2.0*rho1*rc + 2.0*rho2) -
        c[i][j]/(3.0*rc3));
     ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1]*
       (-a[i][j]*exp(-rc/rho1)*
        (rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) + 2.0*c[i][j]/rc3);
   }
-  
+
   return cut[i][j];
 }
 
@@ -281,10 +281,10 @@ void PairBuck::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&a[i][j],sizeof(double),1,fp);
-	fwrite(&rho[i][j],sizeof(double),1,fp);
-	fwrite(&c[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&a[i][j],sizeof(double),1,fp);
+        fwrite(&rho[i][j],sizeof(double),1,fp);
+        fwrite(&c[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -306,16 +306,16 @@ void PairBuck::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&a[i][j],sizeof(double),1,fp);
-	  fread(&rho[i][j],sizeof(double),1,fp);
-	  fread(&c[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&a[i][j],sizeof(double),1,fp);
+          fread(&rho[i][j],sizeof(double),1,fp);
+          fread(&c[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -350,8 +350,8 @@ void PairBuck::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairBuck::single(int i, int j, int itype, int jtype,
-			double rsq, double factor_coul, double factor_lj,
-			double &fforce)
+                        double rsq, double factor_coul, double factor_lj,
+                        double &fforce)
 {
   double r2inv,r6inv,r,rexp,forcebuck,phibuck;
 
@@ -361,7 +361,7 @@ double PairBuck::single(int i, int j, int itype, int jtype,
   rexp = exp(-r*rhoinv[itype][jtype]);
   forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
   fforce = factor_lj*forcebuck*r2inv;
-  
+
   phibuck = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
     offset[itype][jtype];
   return factor_lj*phibuck;
diff --git a/src/pair_buck.h b/src/pair_buck.h
index fe9034329c..8ed41fb28e 100644
--- a/src/pair_buck.h
+++ b/src/pair_buck.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp
index a2f0784a3d..612539465b 100644
--- a/src/pair_buck_coul_cut.cpp
+++ b/src/pair_buck_coul_cut.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -85,7 +85,7 @@ void PairBuckCoulCut::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -111,43 +111,43 @@ void PairBuckCoulCut::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
+        r2inv = 1.0/rsq;
         r = sqrt(rsq);
 
-	if (rsq < cut_coulsq[itype][jtype])
-	  forcecoul = qqrd2e * qtmp*q[j]/r;
-	else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  rexp = exp(-r*rhoinv[itype][jtype]);
-	  forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
-	} else forcebuck = 0.0;
-
-	fpair = (factor_coul*forcecoul + factor_lj*forcebuck) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq[itype][jtype])
-	    ecoul = factor_coul * qqrd2e * qtmp*q[j]/r;
-	  else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        if (rsq < cut_coulsq[itype][jtype])
+          forcecoul = qqrd2e * qtmp*q[j]/r;
+        else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          rexp = exp(-r*rhoinv[itype][jtype]);
+          forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
+        } else forcebuck = 0.0;
+
+        fpair = (factor_coul*forcecoul + factor_lj*forcebuck) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq[itype][jtype])
+            ecoul = factor_coul * qqrd2e * qtmp*q[j]/r;
+          else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = a[itype][jtype]*rexp - c[itype][jtype]*r6inv -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -203,10 +203,10 @@ void PairBuckCoulCut::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) {
-	  cut_lj[i][j] = cut_lj_global;
-	  cut_coul[i][j] = cut_coul_global;
-	}
+        if (setflag[i][j]) {
+          cut_lj[i][j] = cut_lj_global;
+          cut_coul[i][j] = cut_coul_global;
+        }
   }
 }
 
@@ -276,7 +276,7 @@ double PairBuckCoulCut::init_one(int i, int j)
   rhoinv[i][j] = 1.0/rho[i][j];
   buck1[i][j] = a[i][j]/rho[i][j];
   buck2[i][j] = 6.0*c[i][j];
-     
+
   if (offset_flag) {
     double rexp = exp(-cut_lj[i][j]/rho[i][j]);
     offset[i][j] = a[i][j]*rexp - c[i][j]/pow(cut_lj[i][j],6.0);
@@ -291,8 +291,8 @@ double PairBuckCoulCut::init_one(int i, int j)
   buck2[j][i] = buck2[i][j];
   offset[j][i] = offset[i][j];
 
-  // compute I,J contribution to long-range tail correction 
-  // count total # of atoms of type I and J via Allreduce 
+  // compute I,J contribution to long-range tail correction
+  // count total # of atoms of type I and J via Allreduce
 
   if (tail_flag) {
     int *type = atom->type;
@@ -313,13 +313,13 @@ double PairBuckCoulCut::init_one(int i, int j)
     double rc2 = rc*rc;
     double rc3 = rc2*rc;
     etail_ij = 2.0*MY_PI*all[0]*all[1]*
-      (a[i][j]*exp(-rc/rho1)*rho1*(rc2 + 2.0*rho1*rc + 2.0*rho2) - 
+      (a[i][j]*exp(-rc/rho1)*rho1*(rc2 + 2.0*rho1*rc + 2.0*rho2) -
        c[i][j]/(3.0*rc3));
     ptail_ij = (-1/3.0)*2.0*MY_PI*all[0]*all[1]*
       (-a[i][j]*exp(-rc/rho1)*
        (rc3 + 3.0*rho1*rc2 + 6.0*rho2*rc + 6.0*rho3) + 2.0*c[i][j]/rc3);
   }
-  
+
   return cut;
 }
 
@@ -336,11 +336,11 @@ void PairBuckCoulCut::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&a[i][j],sizeof(double),1,fp);
-	fwrite(&rho[i][j],sizeof(double),1,fp);
-	fwrite(&c[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj[i][j],sizeof(double),1,fp);
-	fwrite(&cut_coul[i][j],sizeof(double),1,fp);
+        fwrite(&a[i][j],sizeof(double),1,fp);
+        fwrite(&rho[i][j],sizeof(double),1,fp);
+        fwrite(&c[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj[i][j],sizeof(double),1,fp);
+        fwrite(&cut_coul[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -362,18 +362,18 @@ void PairBuckCoulCut::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&a[i][j],sizeof(double),1,fp);
-	  fread(&rho[i][j],sizeof(double),1,fp);
-	  fread(&c[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj[i][j],sizeof(double),1,fp);
-	  fread(&cut_coul[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_coul[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&a[i][j],sizeof(double),1,fp);
+          fread(&rho[i][j],sizeof(double),1,fp);
+          fread(&c[i][j],sizeof(double),1,fp);
+          fread(&cut_lj[i][j],sizeof(double),1,fp);
+          fread(&cut_coul[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&c[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_coul[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -411,9 +411,9 @@ void PairBuckCoulCut::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairBuckCoulCut::single(int i, int j, int itype, int jtype,
-			       double rsq,
-			       double factor_coul, double factor_lj,
-			       double &fforce)
+                               double rsq,
+                               double factor_coul, double factor_lj,
+                               double &fforce)
 {
   double r2inv,r6inv,r,rexp,forcecoul,forcebuck,phicoul,phibuck;
 
@@ -428,7 +428,7 @@ double PairBuckCoulCut::single(int i, int j, int itype, int jtype,
     forcebuck = buck1[itype][jtype]*r*rexp - buck2[itype][jtype]*r6inv;
   } else forcebuck = 0.0;
   fforce = (factor_coul*forcecoul + factor_lj*forcebuck) * r2inv;
-  
+
   double eng = 0.0;
   if (rsq < cut_coulsq[itype][jtype]) {
     phicoul = force->qqrd2e * atom->q[i]*atom->q[j]*sqrt(r2inv);
diff --git a/src/pair_buck_coul_cut.h b/src/pair_buck_coul_cut.h
index d4db4f8cae..df2d407c72 100644
--- a/src/pair_buck_coul_cut.h
+++ b/src/pair_buck_coul_cut.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_coul_cut.cpp b/src/pair_coul_cut.cpp
index 2fb10dabd6..4bca683b23 100644
--- a/src/pair_coul_cut.cpp
+++ b/src/pair_coul_cut.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,7 +69,7 @@ void PairCoulCut::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -94,25 +94,25 @@ void PairCoulCut::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	rinv = sqrt(r2inv);
-	forcecoul = qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
-	fpair = factor_coul*forcecoul * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag)
-	  ecoul = factor_coul * qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     0.0,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        rinv = sqrt(r2inv);
+        forcecoul = qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
+        fpair = factor_coul*forcecoul * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag)
+          ecoul = factor_coul * qqrd2e * scale[itype][jtype] * qtmp*q[j]*rinv;
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             0.0,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -156,7 +156,7 @@ void PairCoulCut::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -248,8 +248,8 @@ void PairCoulCut::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) fread(&cut[i][j],sizeof(double),1,fp);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) fread(&cut[i][j],sizeof(double),1,fp);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -284,8 +284,8 @@ void PairCoulCut::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairCoulCut::single(int i, int j, int itype, int jtype,
-			   double rsq, double factor_coul, double factor_lj,
-			   double &fforce)
+                           double rsq, double factor_coul, double factor_lj,
+                           double &fforce)
 {
   double r2inv,rinv,forcecoul,phicoul;
 
diff --git a/src/pair_coul_cut.h b/src/pair_coul_cut.h
index 6e3e1fdc85..fbd76c4bb3 100644
--- a/src/pair_coul_cut.h
+++ b/src/pair_coul_cut.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_coul_debye.cpp b/src/pair_coul_debye.cpp
index 2606a1f3cb..81d8a9e905 100644
--- a/src/pair_coul_debye.cpp
+++ b/src/pair_coul_debye.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -56,7 +56,7 @@ void PairCoulDebye::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -81,26 +81,26 @@ void PairCoulDebye::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	screening = exp(-kappa*r);
-	forcecoul = qqrd2e * qtmp*q[j] * screening * (kappa + rinv);
-	fpair = factor_coul*forcecoul * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) ecoul = factor_coul * qqrd2e * qtmp*q[j] * rinv * screening;
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     0.0,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        screening = exp(-kappa*r);
+        forcecoul = qqrd2e * qtmp*q[j] * screening * (kappa + rinv);
+        fpair = factor_coul*forcecoul * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) ecoul = factor_coul * qqrd2e * qtmp*q[j] * rinv * screening;
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             0.0,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -125,7 +125,7 @@ void PairCoulDebye::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -162,8 +162,8 @@ void PairCoulDebye::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairCoulDebye::single(int i, int j, int itype, int jtype,
-			   double rsq, double factor_coul, double factor_lj,
-			   double &fforce)
+                           double rsq, double factor_coul, double factor_lj,
+                           double &fforce)
 {
   double r2inv,r,rinv,forcecoul,phicoul,screening;
 
diff --git a/src/pair_coul_debye.h b/src/pair_coul_debye.h
index 33f2785b24..9e7cca67b6 100644
--- a/src/pair_coul_debye.h
+++ b/src/pair_coul_debye.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_coul_wolf.cpp b/src/pair_coul_wolf.cpp
index a1382913c9..af9751fa11 100644
--- a/src/pair_coul_wolf.cpp
+++ b/src/pair_coul_wolf.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -74,16 +74,16 @@ void PairCoulWolf::compute(int eflag, int vflag)
 
   // self and shifted coulombic energy
 
-  e_self = v_sh = 0.0; 
+  e_self = v_sh = 0.0;
   e_shift = erfc(alf*cut_coul)/cut_coul;
-  f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) / 
-    cut_coul; 
+  f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) /
+    cut_coul;
 
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
- 
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -112,38 +112,38 @@ void PairCoulWolf::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cut_coulsq) {
-	r = sqrt(rsq);
-	prefactor = qqrd2e*qtmp*q[j]/r;
-	erfcc = erfc(alf*r); 
-	erfcd = exp(-alf*alf*r*r);
-	v_sh = (erfcc - e_shift*r) * prefactor; 
-	dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
-	forcecoul = dvdrr*rsq*prefactor;
-	if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
-	fpair = forcecoul / rsq;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = v_sh;
-	    if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
-	  } else ecoul = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     0.0,ecoul,fpair,delx,dely,delz);
+        r = sqrt(rsq);
+        prefactor = qqrd2e*qtmp*q[j]/r;
+        erfcc = erfc(alf*r);
+        erfcd = exp(-alf*alf*r*r);
+        v_sh = (erfcc - e_shift*r) * prefactor;
+        dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
+        forcecoul = dvdrr*rsq*prefactor;
+        if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+        fpair = forcecoul / rsq;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            ecoul = v_sh;
+            if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+          } else ecoul = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             0.0,ecoul,fpair,delx,dely,delz);
       }
     }
   }
-  
+
   if (vflag_fdotr) virial_fdotr_compute();
 }
 
@@ -179,7 +179,7 @@ void PairCoulWolf::settings(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   set cutoffs for one or more type pairs, optional 
+   set cutoffs for one or more type pairs, optional
 ------------------------------------------------------------------------- */
 
 void PairCoulWolf::coeff(int narg, char **arg)
@@ -203,7 +203,7 @@ void PairCoulWolf::coeff(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   init specific to this pair style 
+   init specific to this pair style
 ------------------------------------------------------------------------- */
 
 void PairCoulWolf::init_style()
@@ -291,29 +291,29 @@ void PairCoulWolf::read_restart_settings(FILE *fp)
    only the pair part is calculated here
 ------------------------------------------------------------------------- */
 
-double PairCoulWolf::single(int i, int j, int itype, int jtype, double rsq, 
-			    double factor_coul, double factor_lj,
-			    double &fforce)
+double PairCoulWolf::single(int i, int j, int itype, int jtype, double rsq,
+                            double factor_coul, double factor_lj,
+                            double &fforce)
 {
   double r6inv,r,prefactor,rexp;
   double forcecoul,forceborn,phicoul;
-  double e_shift,f_shift,dvdrr,erfcc,erfcd; 
+  double e_shift,f_shift,dvdrr,erfcc,erfcd;
 
   e_shift = erfc(alf*cut_coul) / cut_coul;
-  f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) / 
-    cut_coul; 
- 
+  f_shift = -(e_shift+ 2.0*alf/MY_PIS * exp(-alf*alf*cut_coul*cut_coul)) /
+    cut_coul;
+
   if (rsq < cut_coulsq) {
     r = sqrt(rsq);
     prefactor = force->qqrd2e * atom->q[i]*atom->q[j]/r;
-    erfcc = erfc(alf*r); 
+    erfcc = erfc(alf*r);
     erfcd = exp(-alf*alf*r*r);
     dvdrr = (erfcc/rsq + 2.0*alf/MY_PIS * erfcd/r) + f_shift;
     forcecoul = dvdrr*rsq*prefactor;
     if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
   } else forcecoul = 0.0;
   fforce = forcecoul / rsq;
-  
+
   double eng = 0.0;
   if (rsq < cut_coulsq) {
     phicoul = prefactor * (erfcc-e_shift*r);
diff --git a/src/pair_coul_wolf.h b/src/pair_coul_wolf.h
index d73602ca87..89391ffc77 100644
--- a/src/pair_coul_wolf.h
+++ b/src/pair_coul_wolf.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -40,7 +40,7 @@ class PairCoulWolf : public Pair {
   double single(int, int, int, int, double, double, double, double &);
 
  protected:
-  double cut_coul,cut_coulsq,alf; 
+  double cut_coul,cut_coulsq,alf;
 
   void allocate();
 };
diff --git a/src/pair_dpd.cpp b/src/pair_dpd.cpp
index 5c701a89e1..04f216ec85 100644
--- a/src/pair_dpd.cpp
+++ b/src/pair_dpd.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -85,7 +85,7 @@ void PairDPD::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -112,44 +112,44 @@ void PairDPD::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	if (r < EPSILON) continue;     // r can be 0.0 in DPD systems
-	rinv = 1.0/r;
-	delvx = vxtmp - v[j][0];
-	delvy = vytmp - v[j][1];
-	delvz = vztmp - v[j][2];
-	dot = delx*delvx + dely*delvy + delz*delvz;
-	wd = 1.0 - r/cut[itype][jtype];
-	randnum = random->gaussian();
-
-	// conservative force = a0 * wd
-	// drag force = -gamma * wd^2 * (delx dot delv) / r
-	// random force = sigma * wd * rnd * dtinvsqrt;
-
-	fpair = a0[itype][jtype]*wd;
-	fpair -= gamma[itype][jtype]*wd*wd*dot*rinv;
-	fpair += sigma[itype][jtype]*wd*randnum*dtinvsqrt;
-	fpair *= factor_dpd*rinv;	
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
+        r = sqrt(rsq);
+        if (r < EPSILON) continue;     // r can be 0.0 in DPD systems
+        rinv = 1.0/r;
+        delvx = vxtmp - v[j][0];
+        delvy = vytmp - v[j][1];
+        delvz = vztmp - v[j][2];
+        dot = delx*delvx + dely*delvy + delz*delvz;
+        wd = 1.0 - r/cut[itype][jtype];
+        randnum = random->gaussian();
+
+        // conservative force = a0 * wd
+        // drag force = -gamma * wd^2 * (delx dot delv) / r
+        // random force = sigma * wd * rnd * dtinvsqrt;
+
+        fpair = a0[itype][jtype]*wd;
+        fpair -= gamma[itype][jtype]*wd*wd*dot*rinv;
+        fpair += sigma[itype][jtype]*wd*randnum*dtinvsqrt;
+        fpair *= factor_dpd*rinv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
           // unshifted eng of conservative term:
-	  // evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]);
-	  // eng shifted to 0.0 at cutoff
-	  evdwl = 0.5*a0[itype][jtype]*cut[itype][jtype] * wd*wd;
-	  evdwl *= factor_dpd;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+          // evdwl = -a0[itype][jtype]*r * (1.0-0.5*r/cut[itype][jtype]);
+          // eng shifted to 0.0 at cutoff
+          evdwl = 0.5*a0[itype][jtype]*cut[itype][jtype] * wd*wd;
+          evdwl *= factor_dpd;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -158,7 +158,7 @@ void PairDPD::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairDPD::allocate()
@@ -180,7 +180,7 @@ void PairDPD::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairDPD::settings(int narg, char **arg)
@@ -203,7 +203,7 @@ void PairDPD::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -267,7 +267,7 @@ double PairDPD::init_one(int i, int j)
   if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   sigma[i][j] = sqrt(2.0*force->boltz*temperature*gamma[i][j]);
-     
+
   cut[j][i] = cut[i][j];
   a0[j][i] = a0[i][j];
   gamma[j][i] = gamma[i][j];
@@ -289,9 +289,9 @@ void PairDPD::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&a0[i][j],sizeof(double),1,fp);
-	fwrite(&gamma[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&a0[i][j],sizeof(double),1,fp);
+        fwrite(&gamma[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -313,14 +313,14 @@ void PairDPD::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&a0[i][j],sizeof(double),1,fp);
-	  fread(&gamma[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&gamma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&a0[i][j],sizeof(double),1,fp);
+          fread(&gamma[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&gamma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -364,7 +364,7 @@ void PairDPD::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairDPD::single(int i, int j, int itype, int jtype, double rsq,
-		       double factor_coul, double factor_dpd, double &fforce)
+                       double factor_coul, double factor_dpd, double &fforce)
 {
   double r,rinv,wd,phi;
 
diff --git a/src/pair_dpd.h b/src/pair_dpd.h
index 9ee8ead873..0a6cf243fb 100644
--- a/src/pair_dpd.h
+++ b/src/pair_dpd.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_dpd_tstat.cpp b/src/pair_dpd_tstat.cpp
index 4151ecc5b1..4bcccede18 100644
--- a/src/pair_dpd_tstat.cpp
+++ b/src/pair_dpd_tstat.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ void PairDPDTstat::compute(int eflag, int vflag)
     double boltz = force->boltz;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i; j <= atom->ntypes; j++)
-	sigma[i][j] = sigma[j][i] = sqrt(2.0*boltz*temperature*gamma[i][j]);
+        sigma[i][j] = sigma[j][i] = sqrt(2.0*boltz*temperature*gamma[i][j]);
   }
 
   double **x = atom->x;
@@ -70,7 +70,7 @@ void PairDPDTstat::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -97,34 +97,34 @@ void PairDPDTstat::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	if (r < EPSILON) continue;     // r can be 0.0 in DPD systems
-	rinv = 1.0/r;
-	delvx = vxtmp - v[j][0];
-	delvy = vytmp - v[j][1];
-	delvz = vztmp - v[j][2];
-	dot = delx*delvx + dely*delvy + delz*delvz;
-	wd = 1.0 - r/cut[itype][jtype];
-	randnum = random->gaussian();
-
-	// drag force = -gamma * wd^2 * (delx dot delv) / r
-	// random force = sigma * wd * rnd * dtinvsqrt;
-
-	fpair = -gamma[itype][jtype]*wd*wd*dot*rinv;
-	fpair += sigma[itype][jtype]*wd*randnum*dtinvsqrt;
-	fpair *= factor_dpd*rinv;	
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     0.0,0.0,fpair,delx,dely,delz);
+        r = sqrt(rsq);
+        if (r < EPSILON) continue;     // r can be 0.0 in DPD systems
+        rinv = 1.0/r;
+        delvx = vxtmp - v[j][0];
+        delvy = vytmp - v[j][1];
+        delvz = vztmp - v[j][2];
+        dot = delx*delvx + dely*delvy + delz*delvz;
+        wd = 1.0 - r/cut[itype][jtype];
+        randnum = random->gaussian();
+
+        // drag force = -gamma * wd^2 * (delx dot delv) / r
+        // random force = sigma * wd * rnd * dtinvsqrt;
+
+        fpair = -gamma[itype][jtype]*wd*wd*dot*rinv;
+        fpair += sigma[itype][jtype]*wd*randnum*dtinvsqrt;
+        fpair *= factor_dpd*rinv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             0.0,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -133,7 +133,7 @@ void PairDPDTstat::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairDPDTstat::settings(int narg, char **arg)
@@ -159,7 +159,7 @@ void PairDPDTstat::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -234,4 +234,3 @@ void PairDPDTstat::read_restart_settings(FILE *fp)
   if (random) delete random;
   random = new RanMars(lmp,seed + comm->me);
 }
-
diff --git a/src/pair_dpd_tstat.h b/src/pair_dpd_tstat.h
index d4383c56bc..86d2565027 100644
--- a/src/pair_dpd_tstat.h
+++ b/src/pair_dpd_tstat.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_gauss.cpp b/src/pair_gauss.cpp
index 820d1e8b7e..81b03a8a2c 100644
--- a/src/pair_gauss.cpp
+++ b/src/pair_gauss.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,12 +60,12 @@ PairGauss::~PairGauss()
 /* ---------------------------------------------------------------------- */
 
 void PairGauss::compute(int eflag, int vflag)
-{   
+{
   int i,j,ii,jj,inum,jnum,itype,jtype;
   double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
   double r,rsq,r2inv,forcelj;
   int *ilist,*jlist,*numneigh,**firstneigh;
-  
+
   evdwl = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
@@ -76,7 +76,7 @@ void PairGauss::compute(int eflag, int vflag)
   int *type = atom->type;
   int nlocal = atom->nlocal;
   int newton_pair = force->newton_pair;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
@@ -93,45 +93,45 @@ void PairGauss::compute(int eflag, int vflag)
     jlist = firstneigh[i];
     jnum = numneigh[i];
 
-    for (jj = 0; jj < jnum; jj++) { 
+    for (jj = 0; jj < jnum; jj++) {
       j = jlist[jj];
       j &= NEIGHMASK;
-	
+
       delx = xtmp - x[j][0];
       dely = ytmp - x[j][1];
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       // define a Gaussian well to be occupied if
-      // the site it interacts with is within the force maximum    
-    
+      // the site it interacts with is within the force maximum
+
       if (eflag_global && rsq < 0.5/b[itype][jtype]) occ++;
 
       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 = forcelj*r2inv;
-		  
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}	
-
-	if (eflag)
-	  evdwl = -(a[itype][jtype]*exp(-b[itype][jtype]*rsq) -
-		    offset[itype][jtype]);
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+        forcelj = - 2.0*a[itype][jtype]*b[itype][jtype] * rsq *
+          exp(-b[itype][jtype]*rsq);
+        fpair = forcelj*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag)
+          evdwl = -(a[itype][jtype]*exp(-b[itype][jtype]*rsq) -
+                    offset[itype][jtype]);
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
-    }    
+    }
   }
 
   if (eflag_global) pvector[0] = occ;
@@ -146,18 +146,18 @@ void PairGauss::allocate()
 {
   allocated = 1;
   int n = atom->ntypes;
-  
+
   memory->create(setflag,n+1,n+1,"pair:setflag");
   for (int i = 1; i <= n; i++)
     for (int j = 1; j <= n; j++)
       setflag[i][j] = 0;
-  
+
   memory->create(cutsq,n+1,n+1,"pair:cutsq");
-  
+
   memory->create(cut,n+1,n+1,"pair:cut_gauss");
   memory->create(a,n+1,n+1,"pair:a");
   memory->create(b,n+1,n+1,"pair:b");
-  memory->create(offset,n+1,n+1,"pair:offset");  
+  memory->create(offset,n+1,n+1,"pair:offset");
 }
 
 /* ----------------------------------------------------------------------
@@ -165,18 +165,18 @@ void PairGauss::allocate()
 ------------------------------------------------------------------------- */
 
 void PairGauss::settings(int narg, char **arg)
-{ 
+{
   if (narg != 1) error->all(FLERR,"Illegal pair_style command");
-  
+
   cut_global = atof(arg[0]);
 
   // reset cutoffs that have been explicity set
-  
+
   if (allocated) {
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global; 
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -192,24 +192,24 @@ void PairGauss::coeff(int narg, char **arg)
   int ilo, ihi, jlo, jhi;
   force->bounds(arg[0],atom->ntypes,ilo,ihi);
   force->bounds(arg[1],atom->ntypes,jlo,jhi);
-  
+
   double a_one = atof(arg[2]);
   double b_one = atof(arg[3]);
 
   double cut_one = cut_global;
   if (narg == 5) cut_one = atof(arg[4]);
-  
+
   int count = 0;
   for (int i = ilo; i <= ihi; i++) {
     for (int j = MAX(jlo,i); j<=jhi; j++) {
-      a[i][j] = a_one; 
+      a[i][j] = a_one;
       b[i][j] = b_one;
       cut[i][j] = cut_one;
       setflag[i][j] = 1;
       count++ ;
     }
   }
- 
+
   if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
 }
 
@@ -220,15 +220,15 @@ void PairGauss::coeff(int narg, char **arg)
 double PairGauss::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
-  
+
   if (offset_flag) offset[i][j] = a[i][j]*exp(-b[i][j]*cut[i][j]*cut[i][j]);
   else offset[i][j] = 0.0;
-  
+
   a[j][i] = a[i][j];
   b[j][i] = b[i][j];
   offset[j][i] = offset[i][j];
-  
-  return cut[i][j]; 
+
+  return cut[i][j];
 }
 
 /* ----------------------------------------------------------------------
@@ -244,9 +244,9 @@ void PairGauss::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&a[i][j],sizeof(double),1,fp);
-	fwrite(&b[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&a[i][j],sizeof(double),1,fp);
+        fwrite(&b[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -268,14 +268,14 @@ void PairGauss::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&a[i][j],sizeof(double),1,fp);
-	  fread(&b[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&b[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&a[i][j],sizeof(double),1,fp);
+          fread(&b[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&b[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -310,16 +310,16 @@ void PairGauss::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairGauss::single(int i, int j, int itype, int jtype, double rsq,
-			 double factor_coul, double factor_lj,
-			 double &fforce)
+                         double factor_coul, double factor_lj,
+                         double &fforce)
 {
   double r2inv,forcelj,philj,r;
 
   r = sqrt(rsq);
-  
+
   r2inv = 1.0/rsq;
   philj = -(a[itype][jtype]*exp(-b[itype][jtype]*rsq) - offset[itype][jtype]);
-  
+
   forcelj = -2.0*a[itype][jtype]*b[itype][jtype]*rsq*exp(-b[itype][jtype]*rsq);
   fforce = forcelj*r2inv;
   return philj;
diff --git a/src/pair_gauss.h b/src/pair_gauss.h
index 115a8948be..d38c8a477e 100644
--- a/src/pair_gauss.h
+++ b/src/pair_gauss.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -31,20 +31,20 @@ class PairGauss : public Pair {
   virtual void compute(int,int);
   void settings(int, char **);
   void coeff(int, char **);
-  double init_one(int, int);  
+  double init_one(int, int);
   void write_restart(FILE *);
   void read_restart(FILE *);
   void write_restart_settings(FILE *);
   void read_restart_settings(FILE *);
   double single(int, int, int, int, double, double, double, double &);
   void *extract(const char *, int &);
- 
- protected: 
+
+ protected:
   double cut_global;
   double **cut;
   double **a,**b;
   double **offset;
-  
+
   void allocate();
 };
 
diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp
index 00e530d5a2..4fdf8161b4 100644
--- a/src/pair_hybrid.cpp
+++ b/src/pair_hybrid.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -82,12 +82,12 @@ void PairHybrid::compute(int eflag, int vflag)
   //   incoming vflag = 2, then
   // reset vflag as if global component were 1
   // necessary since one or more sub-styles cannot compute virial as F dot r
-  
+
   if (no_virial_fdotr_compute && vflag % 4 == 2) vflag = 1 + vflag/4 * 4;
 
   if (eflag || vflag) ev_setup(eflag,vflag);
-  else evflag = vflag_fdotr = eflag_global = vflag_global = 
-	 eflag_atom = vflag_atom = 0;
+  else evflag = vflag_fdotr = eflag_global = vflag_global =
+         eflag_atom = vflag_atom = 0;
 
   // check if global component of incoming vflag = 2
   // if so, reset vflag passed to substyle as if it were 0
@@ -118,8 +118,8 @@ void PairHybrid::compute(int eflag, int vflag)
       if (force->newton_pair) n += atom->nghost;
       double **vatom_substyle = styles[m]->vatom;
       for (i = 0; i < n; i++)
-	for (j = 0; j < 6; j++)
-	  vatom[i][j] += vatom_substyle[i][j];
+        for (j = 0; j < 6; j++)
+          vatom[i][j] += vatom_substyle[i][j];
     }
   }
 
@@ -151,7 +151,7 @@ void PairHybrid::compute_outer(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairHybrid::allocate()
@@ -221,9 +221,9 @@ void PairHybrid::settings(int narg, char **arg)
   iarg = 0;
   nstyles = 0;
   while (iarg < narg) {
-    if (strcmp(arg[iarg],"hybrid") == 0) 
+    if (strcmp(arg[iarg],"hybrid") == 0)
       error->all(FLERR,"Pair style hybrid cannot have hybrid as an argument");
-    if (strcmp(arg[iarg],"none") == 0) 
+    if (strcmp(arg[iarg],"none") == 0)
       error->all(FLERR,"Pair style hybrid cannot have none as an argument");
     styles[nstyles] = force->new_pair(arg[iarg],lmp->suffix,dummy);
     int n = strlen(arg[iarg]) + 1;
@@ -248,7 +248,7 @@ void PairHybrid::settings(int narg, char **arg)
     for (int j = 0; j < nstyles; j++) {
       if (strcmp(keywords[j],keywords[i]) == 0) count++;
       if (j == i) multiple[i] = count;
-    } 
+    }
     if (count == 1) multiple[i] = 0;
   }
 
@@ -258,7 +258,7 @@ void PairHybrid::settings(int narg, char **arg)
     if (styles[m]) comm_forward = MAX(comm_forward,styles[m]->comm_forward);
     if (styles[m]) comm_reverse = MAX(comm_reverse,styles[m]->comm_reverse);
     if (styles[m]) comm_reverse_off = MAX(comm_reverse_off,
-					  styles[m]->comm_reverse_off);
+                                          styles[m]->comm_reverse_off);
   }
 
   // single_enable = 1 if any sub-style is set
@@ -313,13 +313,13 @@ void PairHybrid::coeff(int narg, char **arg)
     multflag = 0;
     if (strcmp(arg[2],keywords[m]) == 0) {
       if (multiple[m]) {
-	multflag = 1;
-	if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients");
-	if (!isdigit(arg[3][0]))
-	  error->all(FLERR,"Incorrect args for pair coefficients");
-	int index = atoi(arg[3]);
-	if (index == multiple[m]) break;
-	else continue;
+        multflag = 1;
+        if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients");
+        if (!isdigit(arg[3][0]))
+          error->all(FLERR,"Incorrect args for pair coefficients");
+        int index = atoi(arg[3]);
+        if (index == multiple[m]) break;
+        else continue;
       } else break;
     }
   }
@@ -348,10 +348,10 @@ void PairHybrid::coeff(int narg, char **arg)
   if (!none && styles[m]->one_coeff)
     for (int i = 1; i <= atom->ntypes; i++)
       for (int j = i; j <= atom->ntypes; j++)
-	if (nmap[i][j] && map[i][j][0] == m) {
-	  setflag[i][j] = 0;
-	  nmap[i][j] = 0;
-	}
+        if (nmap[i][j] && map[i][j][0] == m) {
+          setflag[i][j] = 0;
+          nmap[i][j] = 0;
+        }
 
   // set setflag and which type pairs map to which sub-style
   // if sub-style is none: set hybrid setflag, wipe out map
@@ -362,14 +362,14 @@ void PairHybrid::coeff(int narg, char **arg)
   for (int i = ilo; i <= ihi; i++) {
     for (int j = MAX(jlo,i); j <= jhi; j++) {
       if (none) {
-	setflag[i][j] = 1;
-	nmap[i][j] = 0;
-	count++;
+        setflag[i][j] = 1;
+        nmap[i][j] = 0;
+        count++;
       } else if (styles[m]->setflag[i][j]) {
-	setflag[i][j] = 1;
-	nmap[i][j] = 1;
-	map[i][j][0] = m;
-	count++;
+        setflag[i][j] = 1;
+        nmap[i][j] = 1;
+        map[i][j][0] = m;
+        count++;
       }
     }
   }
@@ -393,8 +393,8 @@ void PairHybrid::init_style()
     used = 0;
     for (itype = 1; itype <= ntypes; itype++)
       for (jtype = itype; jtype <= ntypes; jtype++)
-	for (m = 0; m < nmap[itype][jtype]; m++)
-	  if (map[itype][jtype][m] == istyle) used = 1;
+        for (m = 0; m < nmap[itype][jtype]; m++)
+          if (map[itype][jtype][m] == istyle) used = 1;
     if (used == 0) error->all(FLERR,"Pair hybrid sub-style is not used");
   }
 
@@ -428,23 +428,23 @@ void PairHybrid::init_style()
 
     for (itype = 1; itype <= ntypes; itype++)
       for (jtype = 1; jtype <= ntypes; jtype++)
-	ijskip[itype][jtype] = 1;
+        ijskip[itype][jtype] = 1;
 
     for (itype = 1; itype <= ntypes; itype++)
       for (jtype = itype; jtype <= ntypes; jtype++) {
-	for (m = 0; m < nmap[itype][jtype]; m++)
-	  if (map[itype][jtype][m] == istyle) 
-	    ijskip[itype][jtype] = ijskip[jtype][itype] = 0;
-	if (nmap[itype][jtype] == 0 &&
-	    nmap[itype][itype] == 1 && map[itype][itype][0] == istyle &&
-	    nmap[jtype][jtype] == 1 && map[jtype][jtype][0] == istyle)
-	  ijskip[itype][jtype] = ijskip[jtype][itype] = 0;
+        for (m = 0; m < nmap[itype][jtype]; m++)
+          if (map[itype][jtype][m] == istyle)
+            ijskip[itype][jtype] = ijskip[jtype][itype] = 0;
+        if (nmap[itype][jtype] == 0 &&
+            nmap[itype][itype] == 1 && map[itype][itype][0] == istyle &&
+            nmap[jtype][jtype] == 1 && map[jtype][jtype][0] == istyle)
+          ijskip[itype][jtype] = ijskip[jtype][itype] = 0;
       }
 
     for (itype = 1; itype <= ntypes; itype++) {
       iskip[itype] = 1;
       for (jtype = 1; jtype <= ntypes; jtype++)
-	if (ijskip[itype][jtype] == 0) iskip[itype] = 0;
+        if (ijskip[itype][jtype] == 0) iskip[itype] = 0;
     }
 
     // if any skipping occurs
@@ -454,7 +454,7 @@ void PairHybrid::init_style()
     skip = 0;
     for (itype = 1; itype <= ntypes; itype++)
       for (jtype = 1; jtype <= ntypes; jtype++)
-	if (ijskip[itype][jtype] == 1) skip = 1;
+        if (ijskip[itype][jtype] == 1) skip = 1;
 
     if (skip) {
       neighbor->requests[i]->skip = 1;
@@ -504,11 +504,11 @@ double PairHybrid::init_one(int i, int j)
   for (int k = 0; k < nmap[i][j]; k++) {
     map[j][i][k] = map[i][j][k];
     double cut = styles[map[i][j][k]]->init_one(i,j);
-    styles[map[i][j][k]]->cutsq[i][j] = 
+    styles[map[i][j][k]]->cutsq[i][j] =
       styles[map[i][j][k]]->cutsq[j][i] = cut*cut;
     if (styles[map[i][j][k]]->ghostneigh)
-      cutghost[i][j] = cutghost[j][i] = 
-	MAX(cutghost[i][j],styles[map[i][j][k]]->cutghost[i][j]);
+      cutghost[i][j] = cutghost[j][i] =
+        MAX(cutghost[i][j],styles[map[i][j][k]]->cutghost[i][j]);
     if (tail_flag) {
       etail_ij += styles[map[i][j][k]]->etail_ij;
       ptail_ij += styles[map[i][j][k]]->ptail_ij;
@@ -639,8 +639,8 @@ void PairHybrid::read_restart(FILE *fp)
 ------------------------------------------------------------------------- */
 
 double PairHybrid::single(int i, int j, int itype, int jtype,
-			  double rsq, double factor_coul, double factor_lj,
-			  double &fforce)
+                          double rsq, double factor_coul, double factor_lj,
+                          double &fforce)
 {
   if (nmap[itype][jtype] == 0)
     error->one(FLERR,"Invoked pair single on pair style none");
@@ -652,17 +652,17 @@ double PairHybrid::single(int i, int j, int itype, int jtype,
   for (int m = 0; m < nmap[itype][jtype]; m++) {
     if (rsq < styles[map[itype][jtype][m]]->cutsq[itype][jtype]) {
       if (styles[map[itype][jtype][m]]->single_enable == 0)
-	error->one(FLERR,"Pair hybrid sub-style does not support single call");
+        error->one(FLERR,"Pair hybrid sub-style does not support single call");
 
       esum += styles[map[itype][jtype][m]]->
-	single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fone);
+        single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fone);
       fforce += fone;
 
       // copy substyle extra values into hybrid's svector
 
       if (single_extra && styles[map[itype][jtype][m]]->single_extra)
-	for (m = 0; m < single_extra; m++)
-	  svector[m] = styles[map[itype][jtype][m]]->svector[m];
+        for (m = 0; m < single_extra; m++)
+          svector[m] = styles[map[itype][jtype][m]]->svector[m];
     }
   }
 
@@ -700,8 +700,8 @@ void *PairHybrid::extract(const char *str, int &dim)
       double *p_newvalue = (double *) ptr;
       double newvalue = *p_newvalue;
       if (cutptr && newvalue != cutvalue)
-	error->all(FLERR,
-		   "Coulomb cutoffs of pair hybrid sub-styles do not match");
+        error->all(FLERR,
+                   "Coulomb cutoffs of pair hybrid sub-styles do not match");
       cutptr = ptr;
       cutvalue = newvalue;
     } else if (ptr) return ptr;
diff --git a/src/pair_hybrid.h b/src/pair_hybrid.h
index 78cd09a9d0..225869cb21 100644
--- a/src/pair_hybrid.h
+++ b/src/pair_hybrid.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_hybrid_overlay.cpp b/src/pair_hybrid_overlay.cpp
index ede18ef748..327c395b22 100644
--- a/src/pair_hybrid_overlay.cpp
+++ b/src/pair_hybrid_overlay.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -51,13 +51,13 @@ void PairHybridOverlay::coeff(int narg, char **arg)
     multflag = 0;
     if (strcmp(arg[2],keywords[m]) == 0) {
       if (multiple[m]) {
-	multflag = 1;
-	if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients");
-	if (!isdigit(arg[3][0]))
-	  error->all(FLERR,"Incorrect args for pair coefficients");
-	int index = atoi(arg[3]);
-	if (index == multiple[m]) break;
-	else continue;
+        multflag = 1;
+        if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients");
+        if (!isdigit(arg[3][0]))
+          error->all(FLERR,"Incorrect args for pair coefficients");
+        int index = atoi(arg[3]);
+        if (index == multiple[m]) break;
+        else continue;
       } else break;
     }
   }
@@ -89,16 +89,16 @@ void PairHybridOverlay::coeff(int narg, char **arg)
   for (int i = ilo; i <= ihi; i++) {
     for (int j = MAX(jlo,i); j <= jhi; j++) {
       if (none) {
-	setflag[i][j] = 1;
-	nmap[i][j] = 0;
-	count++;
+        setflag[i][j] = 1;
+        nmap[i][j] = 0;
+        count++;
       } else if (styles[m]->setflag[i][j]) {
-	int k;
-	for (k = 0; k < nmap[i][j]; k++)
-	  if (map[i][j][k] == m) break;
-	if (k == nmap[i][j]) map[i][j][nmap[i][j]++] = m;
-	setflag[i][j] = 1;
-	count++;
+        int k;
+        for (k = 0; k < nmap[i][j]; k++)
+          if (map[i][j][k] == m) break;
+        if (k == nmap[i][j]) map[i][j][nmap[i][j]++] = m;
+        setflag[i][j] = 1;
+        count++;
       }
     }
   }
@@ -129,9 +129,9 @@ void PairHybridOverlay::modify_requests()
       if (!neighbor->requests[j]->pair) continue;
       jrq = neighbor->requests[j];
       if (irq->same_kind(jrq) && irq->same_skip(jrq)) {
-	irq->copy = 1;
-	irq->otherlist = j;
-	break;
+        irq->copy = 1;
+        irq->otherlist = j;
+        break;
       }
     }
   }
diff --git a/src/pair_hybrid_overlay.h b/src/pair_hybrid_overlay.h
index a3da3254b8..b79bd97a18 100644
--- a/src/pair_hybrid_overlay.h
+++ b/src/pair_hybrid_overlay.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_lj96_cut.cpp b/src/pair_lj96_cut.cpp
index 0ccc343a4e..5fe152ab45 100644
--- a/src/pair_lj96_cut.cpp
+++ b/src/pair_lj96_cut.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -86,7 +86,7 @@ void PairLJ96Cut::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -110,29 +110,29 @@ void PairLJ96Cut::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r3inv = sqrt(r6inv);
-	forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r3inv = sqrt(r6inv);
+        forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -155,7 +155,7 @@ void PairLJ96Cut::compute_inner()
   int nlocal = atom->nlocal;
   double *special_lj = force->special_lj;
   int newton_pair = force->newton_pair;
-  
+
   inum = listinner->inum;
   ilist = listinner->ilist;
   numneigh = listinner->numneigh;
@@ -163,11 +163,11 @@ void PairLJ96Cut::compute_inner()
 
   double cut_out_on = cut_respa[0];
   double cut_out_off = cut_respa[1];
-  
+
   double cut_out_diff = cut_out_off - cut_out_on;
   double cut_out_on_sq = cut_out_on*cut_out_on;
   double cut_out_off_sq = cut_out_off*cut_out_off;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -190,25 +190,25 @@ void PairLJ96Cut::compute_inner()
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_out_off_sq) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r3inv = sqrt(r6inv);
-	jtype = type[j];
-	forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r3inv = sqrt(r6inv);
+        jtype = type[j];
+        forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
         if (rsq > cut_out_on_sq) {
-	  rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	  fpair *= 1.0 - rsw*rsw*(3.0 - 2.0*rsw);
-	}
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+          rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+          fpair *= 1.0 - rsw*rsw*(3.0 - 2.0*rsw);
+        }
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
       }
     }
   }
@@ -269,29 +269,29 @@ void PairLJ96Cut::compute_middle()
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_out_off_sq && rsq > cut_in_off_sq) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	r3inv = sqrt(r6inv);
-	jtype = type[j];
-	forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        r3inv = sqrt(r6inv);
+        jtype = type[j];
+        forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
         if (rsq < cut_in_on_sq) {
-	  rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
-	  fpair *= rsw*rsw*(3.0 - 2.0*rsw);
-	}
+          rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
+          fpair *= rsw*rsw*(3.0 - 2.0*rsw);
+        }
         if (rsq > cut_out_on_sq) {
-	  rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	  fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
-	}
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+          rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+          fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
+        }
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
       }
     }
   }
@@ -352,56 +352,56 @@ void PairLJ96Cut::compute_outer(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	if (rsq > cut_in_off_sq) {
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  r3inv = sqrt(r6inv);
-	  forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	  fpair = factor_lj*forcelj*r2inv;
+        if (rsq > cut_in_off_sq) {
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          r3inv = sqrt(r6inv);
+          forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+          fpair = factor_lj*forcelj*r2inv;
           if (rsq < cut_in_on_sq) {
-	    rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
-	    fpair *= rsw*rsw*(3.0 - 2.0*rsw);
-	  }
-
-	  f[i][0] += delx*fpair;
-	  f[i][1] += dely*fpair;
-	  f[i][2] += delz*fpair;
-	  if (newton_pair || j < nlocal) {
-	    f[j][0] -= delx*fpair;
-	    f[j][1] -= dely*fpair;
-	    f[j][2] -= delz*fpair;
-	  }
-	}
-	
-	if (eflag) {
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  r3inv = sqrt(r6inv);
-	  evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-	
-	if (vflag) {
-	  if (rsq <= cut_in_off_sq) {
-	    r2inv = 1.0/rsq;
-	    r6inv = r2inv*r2inv*r2inv;
-	    r3inv = sqrt(r6inv);
-	    forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
-	    fpair = factor_lj*forcelj*r2inv;
-	  } else if (rsq < cut_in_on_sq)
-	    fpair = factor_lj*forcelj*r2inv;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+            rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
+            fpair *= rsw*rsw*(3.0 - 2.0*rsw);
+          }
+
+          f[i][0] += delx*fpair;
+          f[i][1] += dely*fpair;
+          f[i][2] += delz*fpair;
+          if (newton_pair || j < nlocal) {
+            f[j][0] -= delx*fpair;
+            f[j][1] -= dely*fpair;
+            f[j][2] -= delz*fpair;
+          }
+        }
+
+        if (eflag) {
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          r3inv = sqrt(r6inv);
+          evdwl = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (vflag) {
+          if (rsq <= cut_in_off_sq) {
+            r2inv = 1.0/rsq;
+            r6inv = r2inv*r2inv*r2inv;
+            r3inv = sqrt(r6inv);
+            forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
+            fpair = factor_lj*forcelj*r2inv;
+          } else if (rsq < cut_in_on_sq)
+            fpair = factor_lj*forcelj*r2inv;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLJ96Cut::allocate()
@@ -427,7 +427,7 @@ void PairLJ96Cut::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLJ96Cut::settings(int narg, char **arg)
@@ -442,7 +442,7 @@ void PairLJ96Cut::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -452,7 +452,7 @@ void PairLJ96Cut::settings(int narg, char **arg)
 
 void PairLJ96Cut::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) 
+  if (narg < 4 || narg > 5)
     error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
@@ -551,7 +551,7 @@ double PairLJ96Cut::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
   }
@@ -591,23 +591,23 @@ double PairLJ96Cut::init_one(int i, int j)
       if (type[k] == j) count[1] += 1.0;
     }
     MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
-        
+
     double sig3 = sigma[i][j]*sigma[i][j]*sigma[i][j];
     double sig6 = sig3*sig3;
     double rc3 = cut[i][j]*cut[i][j]*cut[i][j];
     double rc6 = rc3*rc3;
-    
-    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
-      sig6 * (sig3 - 2.0*rc3) / (6.0*rc6); 
-    ptail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
-      sig6 * (3.0*sig3 - 4.0*rc3) / (6.0*rc6); 
-  } 
+
+    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
+      sig6 * (sig3 - 2.0*rc3) / (6.0*rc6);
+    ptail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
+      sig6 * (3.0*sig3 - 4.0*rc3) / (6.0*rc6);
+  }
 
   return cut[i][j];
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairLJ96Cut::write_restart(FILE *fp)
@@ -619,9 +619,9 @@ void PairLJ96Cut::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -642,14 +642,14 @@ void PairLJ96Cut::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -685,8 +685,8 @@ void PairLJ96Cut::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJ96Cut::single(int i, int j, int itype, int jtype, double rsq,
-			   double factor_coul, double factor_lj,
-			   double &fforce)
+                           double factor_coul, double factor_lj,
+                           double &fforce)
 {
   double r2inv,r3inv,r6inv,forcelj,philj;
 
diff --git a/src/pair_lj96_cut.h b/src/pair_lj96_cut.h
index 4d2f619477..56430cc5d7 100644
--- a/src/pair_lj96_cut.h
+++ b/src/pair_lj96_cut.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_lj_cubic.cpp b/src/pair_lj_cubic.cpp
index df06f7deda..2fd224239d 100644
--- a/src/pair_lj_cubic.cpp
+++ b/src/pair_lj_cubic.cpp
@@ -6,7 +6,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -81,7 +81,7 @@ void PairLJCubic::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -105,38 +105,38 @@ void PairLJCubic::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
+        r2inv = 1.0/rsq;
         if (rsq <= cut_inner_sq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	} else {
-	  r = sqrt(rsq); 
-	  rmin = sigma[itype][jtype]*RT6TWO;
-	  t = (r - cut_inner[itype][jtype])/rmin;
-	  forcelj = epsilon[itype][jtype]*(-DPHIDS + A3*t*t/2.0)*r/rmin;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        } else {
+          r = sqrt(rsq);
+          rmin = sigma[itype][jtype]*RT6TWO;
+          t = (r - cut_inner[itype][jtype])/rmin;
+          forcelj = epsilon[itype][jtype]*(-DPHIDS + A3*t*t/2.0)*r/rmin;
+        }
+        fpair = factor_lj*forcelj*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
         }
-	fpair = factor_lj*forcelj*r2inv;
-	  
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
+
+        if (eflag) {
           if (rsq <= cut_inner_sq[itype][jtype])
-	    evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]); 
-	  else
-	    evdwl = epsilon[itype][jtype]*
-	      (PHIS + DPHIDS*t - A3*t*t*t/6.0);
-	  evdwl *= factor_lj;
-
-	  if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
-	}
+            evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+          else
+            evdwl = epsilon[itype][jtype]*
+              (PHIS + DPHIDS*t - A3*t*t*t/6.0);
+          evdwl *= factor_lj;
+
+          if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
+        }
       }
     }
   }
@@ -185,7 +185,7 @@ void PairLJCubic::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = 0.0;
+        if (setflag[i][j]) cut[i][j] = 0.0;
   }
 }
 
@@ -230,7 +230,7 @@ double PairLJCubic::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut_inner[i][j] = mix_distance(cut_inner[i][i],cut_inner[j][j]);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
@@ -265,10 +265,10 @@ void PairLJCubic::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut_inner[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut_inner[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -289,16 +289,16 @@ void PairLJCubic::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut_inner[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut_inner[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -328,9 +328,9 @@ void PairLJCubic::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJCubic::single(int i, int j, int itype, int jtype,
-			     double rsq,
-			     double factor_coul, double factor_lj,
-			     double &fforce)
+                             double rsq,
+                             double factor_coul, double factor_lj,
+                             double &fforce)
 {
   double r2inv,r6inv,forcelj,philj;
   double r,t;
@@ -341,7 +341,7 @@ double PairLJCubic::single(int i, int j, int itype, int jtype,
     r6inv = r2inv*r2inv*r2inv;
     forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
   } else {
-    r = sqrt(rsq); 
+    r = sqrt(rsq);
     rmin = sigma[itype][jtype]*RT6TWO;
     t = (r - cut_inner[itype][jtype])/rmin;
     forcelj = epsilon[itype][jtype]*(-DPHIDS + A3*t*t/2.0)*r/rmin;
diff --git a/src/pair_lj_cubic.h b/src/pair_lj_cubic.h
index 0b90f25ff5..cdb311c41b 100644
--- a/src/pair_lj_cubic.h
+++ b/src/pair_lj_cubic.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -50,14 +50,14 @@ class PairLJCubic : public Pair {
 namespace PairLJCubicConstants {
 
   // LJ quantities scaled by epsilon and rmin = sigma*2^1/6
-  
+
   static const double RT6TWO = 1.1224621;  // 2^1/6
   static const double SS = 1.1086834;      // inflection point (13/7)^1/6
   static const double PHIS = -0.7869823;   // energy at s
   static const double DPHIDS = 2.6899009;  // gradient at s
   static const double A3 = 27.93357;       // cubic coefficient
   static const double SM = 1.5475375;      // cubic cutoff = s*67/48
-  
+
 }
 
 }
diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp
index 69add0d110..29d0531ca7 100644
--- a/src/pair_lj_cut.cpp
+++ b/src/pair_lj_cut.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -86,7 +86,7 @@ void PairLJCut::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -110,28 +110,28 @@ void PairLJCut::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -154,7 +154,7 @@ void PairLJCut::compute_inner()
   int nlocal = atom->nlocal;
   double *special_lj = force->special_lj;
   int newton_pair = force->newton_pair;
-  
+
   inum = listinner->inum;
   ilist = listinner->ilist;
   numneigh = listinner->numneigh;
@@ -162,11 +162,11 @@ void PairLJCut::compute_inner()
 
   double cut_out_on = cut_respa[0];
   double cut_out_off = cut_respa[1];
-  
+
   double cut_out_diff = cut_out_off - cut_out_on;
   double cut_out_on_sq = cut_out_on*cut_out_on;
   double cut_out_off_sq = cut_out_off*cut_out_off;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -189,24 +189,24 @@ void PairLJCut::compute_inner()
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_out_off_sq) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	jtype = type[j];
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        jtype = type[j];
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
         if (rsq > cut_out_on_sq) {
-	  rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	  fpair *= 1.0 - rsw*rsw*(3.0 - 2.0*rsw);
-	}
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+          rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+          fpair *= 1.0 - rsw*rsw*(3.0 - 2.0*rsw);
+        }
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
       }
     }
   }
@@ -267,28 +267,28 @@ void PairLJCut::compute_middle()
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_out_off_sq && rsq > cut_in_off_sq) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	jtype = type[j];
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj*r2inv;
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        jtype = type[j];
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj*r2inv;
         if (rsq < cut_in_on_sq) {
-	  rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
-	  fpair *= rsw*rsw*(3.0 - 2.0*rsw);
-	}
+          rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
+          fpair *= rsw*rsw*(3.0 - 2.0*rsw);
+        }
         if (rsq > cut_out_on_sq) {
-	  rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff; 
-	  fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
-	}
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+          rsw = (sqrt(rsq) - cut_out_on)/cut_out_diff;
+          fpair *= 1.0 + rsw*rsw*(2.0*rsw - 3.0);
+        }
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
       }
     }
   }
@@ -349,53 +349,53 @@ void PairLJCut::compute_outer(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	if (rsq > cut_in_off_sq) {
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	  fpair = factor_lj*forcelj*r2inv;
+        if (rsq > cut_in_off_sq) {
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+          fpair = factor_lj*forcelj*r2inv;
           if (rsq < cut_in_on_sq) {
-	    rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff; 
-	    fpair *= rsw*rsw*(3.0 - 2.0*rsw);
-	  }
-
-	  f[i][0] += delx*fpair;
-	  f[i][1] += dely*fpair;
-	  f[i][2] += delz*fpair;
-	  if (newton_pair || j < nlocal) {
-	    f[j][0] -= delx*fpair;
-	    f[j][1] -= dely*fpair;
-	    f[j][2] -= delz*fpair;
-	  }
-	}
-
-	if (eflag) {
-	  r2inv = 1.0/rsq;
-	  r6inv = r2inv*r2inv*r2inv;
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (vflag) {
-	  if (rsq <= cut_in_off_sq) {
-	    r2inv = 1.0/rsq;
-	    r6inv = r2inv*r2inv*r2inv;
-	    forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	    fpair = factor_lj*forcelj*r2inv;
-	  } else if (rsq < cut_in_on_sq)
-	    fpair = factor_lj*forcelj*r2inv;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+            rsw = (sqrt(rsq) - cut_in_off)/cut_in_diff;
+            fpair *= rsw*rsw*(3.0 - 2.0*rsw);
+          }
+
+          f[i][0] += delx*fpair;
+          f[i][1] += dely*fpair;
+          f[i][2] += delz*fpair;
+          if (newton_pair || j < nlocal) {
+            f[j][0] -= delx*fpair;
+            f[j][1] -= dely*fpair;
+            f[j][2] -= delz*fpair;
+          }
+        }
+
+        if (eflag) {
+          r2inv = 1.0/rsq;
+          r6inv = r2inv*r2inv*r2inv;
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (vflag) {
+          if (rsq <= cut_in_off_sq) {
+            r2inv = 1.0/rsq;
+            r6inv = r2inv*r2inv*r2inv;
+            forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+            fpair = factor_lj*forcelj*r2inv;
+          } else if (rsq < cut_in_on_sq)
+            fpair = factor_lj*forcelj*r2inv;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLJCut::allocate()
@@ -421,7 +421,7 @@ void PairLJCut::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLJCut::settings(int narg, char **arg)
@@ -431,12 +431,12 @@ void PairLJCut::settings(int narg, char **arg)
   cut_global = force->numeric(arg[0]);
 
   // reset cutoffs that have been explicitly set
-  
+
   if (allocated) {
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -446,7 +446,7 @@ void PairLJCut::settings(int narg, char **arg)
 
 void PairLJCut::coeff(int narg, char **arg)
 {
-  if (narg < 4 || narg > 5) 
+  if (narg < 4 || narg > 5)
     error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
@@ -545,7 +545,7 @@ double PairLJCut::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
   }
@@ -585,23 +585,23 @@ double PairLJCut::init_one(int i, int j)
       if (type[k] == j) count[1] += 1.0;
     }
     MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
-        
+
     double sig2 = sigma[i][j]*sigma[i][j];
     double sig6 = sig2*sig2*sig2;
     double rc3 = cut[i][j]*cut[i][j]*cut[i][j];
     double rc6 = rc3*rc3;
     double rc9 = rc3*rc6;
-    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
-      sig6 * (sig6 - 3.0*rc6) / (9.0*rc9); 
-    ptail_ij = 16.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
-      sig6 * (2.0*sig6 - 3.0*rc6) / (9.0*rc9); 
-  } 
+    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
+      sig6 * (sig6 - 3.0*rc6) / (9.0*rc9);
+    ptail_ij = 16.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
+      sig6 * (2.0*sig6 - 3.0*rc6) / (9.0*rc9);
+  }
 
   return cut[i][j];
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairLJCut::write_restart(FILE *fp)
@@ -613,9 +613,9 @@ void PairLJCut::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -636,14 +636,14 @@ void PairLJCut::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -679,8 +679,8 @@ void PairLJCut::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJCut::single(int i, int j, int itype, int jtype, double rsq,
-			 double factor_coul, double factor_lj,
-			 double &fforce)
+                         double factor_coul, double factor_lj,
+                         double &fforce)
 {
   double r2inv,r6inv,forcelj,philj;
 
diff --git a/src/pair_lj_cut.h b/src/pair_lj_cut.h
index 8eb4a4867e..97a1212965 100644
--- a/src/pair_lj_cut.h
+++ b/src/pair_lj_cut.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_lj_cut_coul_cut.cpp b/src/pair_lj_cut_coul_cut.cpp
index c6973b2580..50ee7dc99f 100644
--- a/src/pair_lj_cut_coul_cut.cpp
+++ b/src/pair_lj_cut_coul_cut.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -81,7 +81,7 @@ void PairLJCutCoulCut::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -107,41 +107,41 @@ void PairLJCutCoulCut::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq[itype][jtype])
-	  forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
-	else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	} else forcelj = 0.0;
-
-	fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq[itype][jtype])
-	    ecoul = factor_coul * qqrd2e * qtmp*q[j]*sqrt(r2inv);
-	  else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq[itype][jtype])
+          forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
+        else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        } else forcelj = 0.0;
+
+        fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq[itype][jtype])
+            ecoul = factor_coul * qqrd2e * qtmp*q[j]*sqrt(r2inv);
+          else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -196,10 +196,10 @@ void PairLJCutCoulCut::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) {
-	  cut_lj[i][j] = cut_lj_global;
-	  cut_coul[i][j] = cut_coul_global;
-	}
+        if (setflag[i][j]) {
+          cut_lj[i][j] = cut_lj_global;
+          cut_coul[i][j] = cut_coul_global;
+        }
   }
 }
 
@@ -259,7 +259,7 @@ double PairLJCutCoulCut::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut_lj[i][j] = mix_distance(cut_lj[i][i],cut_lj[j][j]);
     cut_coul[i][j] = mix_distance(cut_coul[i][i],cut_coul[j][j]);
@@ -273,12 +273,12 @@ double PairLJCutCoulCut::init_one(int i, int j)
   lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
   lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
   lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
-     
+
   if (offset_flag) {
     double ratio = sigma[i][j] / cut_lj[i][j];
     offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
   } else offset[i][j] = 0.0;
-  
+
   cut_ljsq[j][i] = cut_ljsq[i][j];
   cut_coulsq[j][i] = cut_coulsq[i][j];
   lj1[j][i] = lj1[i][j];
@@ -301,17 +301,17 @@ double PairLJCutCoulCut::init_one(int i, int j)
       if (type[k] == j) count[1] += 1.0;
     }
     MPI_Allreduce(count,all,2,MPI_DOUBLE,MPI_SUM,world);
-        
+
     double sig2 = sigma[i][j]*sigma[i][j];
     double sig6 = sig2*sig2*sig2;
     double rc3 = cut_lj[i][j]*cut_lj[i][j]*cut_lj[i][j];
     double rc6 = rc3*rc3;
     double rc9 = rc3*rc6;
-    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
-      sig6 * (sig6 - 3.0*rc6) / (9.0*rc9); 
-    ptail_ij = 16.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
-      sig6 * (2.0*sig6 - 3.0*rc6) / (9.0*rc9); 
-  } 
+    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
+      sig6 * (sig6 - 3.0*rc6) / (9.0*rc9);
+    ptail_ij = 16.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
+      sig6 * (2.0*sig6 - 3.0*rc6) / (9.0*rc9);
+  }
 
   return cut;
 }
@@ -329,10 +329,10 @@ void PairLJCutCoulCut::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut_lj[i][j],sizeof(double),1,fp);
-	fwrite(&cut_coul[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut_lj[i][j],sizeof(double),1,fp);
+        fwrite(&cut_coul[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -353,16 +353,16 @@ void PairLJCutCoulCut::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut_lj[i][j],sizeof(double),1,fp);
-	  fread(&cut_coul[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_coul[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut_lj[i][j],sizeof(double),1,fp);
+          fread(&cut_coul[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_lj[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_coul[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -400,9 +400,9 @@ void PairLJCutCoulCut::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJCutCoulCut::single(int i, int j, int itype, int jtype,
-				double rsq,
-				double factor_coul, double factor_lj,
-				double &fforce)
+                                double rsq,
+                                double factor_coul, double factor_lj,
+                                double &fforce)
 {
   double r2inv,r6inv,forcecoul,forcelj,phicoul,philj;
 
diff --git a/src/pair_lj_cut_coul_cut.h b/src/pair_lj_cut_coul_cut.h
index 3746df9f91..28f4664df5 100644
--- a/src/pair_lj_cut_coul_cut.h
+++ b/src/pair_lj_cut_coul_cut.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_lj_cut_coul_debye.cpp b/src/pair_lj_cut_coul_debye.cpp
index 023d866542..7a892ad7f7 100644
--- a/src/pair_lj_cut_coul_debye.cpp
+++ b/src/pair_lj_cut_coul_debye.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ void PairLJCutCoulDebye::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -80,44 +80,44 @@ void PairLJCutCoulDebye::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-
-	if (rsq < cut_coulsq[itype][jtype]) {
-	  r = sqrt(rsq);
-	  rinv = 1.0/r;
-	  screening = exp(-kappa*r);
-	  forcecoul = qqrd2e * qtmp*q[j] * screening * (kappa + rinv);
-	} else forcecoul = 0.0;
-
-	if (rsq < cut_ljsq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	} else forcelj = 0.0;
-
-	fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq[itype][jtype])
-	    ecoul = factor_coul * qqrd2e * qtmp*q[j] * rinv * screening;
-	  else ecoul = 0.0;
-	  if (rsq < cut_ljsq[itype][jtype]) {
-	    evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	      offset[itype][jtype];
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+
+        if (rsq < cut_coulsq[itype][jtype]) {
+          r = sqrt(rsq);
+          rinv = 1.0/r;
+          screening = exp(-kappa*r);
+          forcecoul = qqrd2e * qtmp*q[j] * screening * (kappa + rinv);
+        } else forcecoul = 0.0;
+
+        if (rsq < cut_ljsq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        } else forcelj = 0.0;
+
+        fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq[itype][jtype])
+            ecoul = factor_coul * qqrd2e * qtmp*q[j] * rinv * screening;
+          else ecoul = 0.0;
+          if (rsq < cut_ljsq[itype][jtype]) {
+            evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+              offset[itype][jtype];
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -126,7 +126,7 @@ void PairLJCutCoulDebye::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLJCutCoulDebye::settings(int narg, char **arg)
@@ -144,10 +144,10 @@ void PairLJCutCoulDebye::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j] == 1) {
-	  cut_lj[i][j] = cut_lj_global;
-	  cut_coul[i][j] = cut_coul_global;
-	}
+        if (setflag[i][j] == 1) {
+          cut_lj[i][j] = cut_lj_global;
+          cut_coul[i][j] = cut_coul_global;
+        }
   }
 }
 
@@ -187,9 +187,9 @@ void PairLJCutCoulDebye::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJCutCoulDebye::single(int i, int j, int itype, int jtype,
-				  double rsq,
-				  double factor_coul, double factor_lj,
-				  double &fforce)
+                                  double rsq,
+                                  double factor_coul, double factor_lj,
+                                  double &fforce)
 {
   double r2inv,r6inv,r,rinv,screening,forcecoul,forcelj,phicoul,philj;
 
diff --git a/src/pair_lj_cut_coul_debye.h b/src/pair_lj_cut_coul_debye.h
index 073c1b5b02..4dd41080c7 100644
--- a/src/pair_lj_cut_coul_debye.h
+++ b/src/pair_lj_cut_coul_debye.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_lj_expand.cpp b/src/pair_lj_expand.cpp
index 10e69ba977..0cb2598cd2 100644
--- a/src/pair_lj_expand.cpp
+++ b/src/pair_lj_expand.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -75,7 +75,7 @@ void PairLJExpand::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -99,31 +99,31 @@ void PairLJExpand::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	rshift = r - shift[itype][jtype];
-	rshiftsq = rshift*rshift;
-	r2inv = 1.0/rshiftsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
-	fpair = factor_lj*forcelj/rshift/r;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r = sqrt(rsq);
+        rshift = r - shift[itype][jtype];
+        rshiftsq = rshift*rshift;
+        r2inv = 1.0/rshiftsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        fpair = factor_lj*forcelj/rshift/r;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -132,7 +132,7 @@ void PairLJExpand::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLJExpand::allocate()
@@ -159,7 +159,7 @@ void PairLJExpand::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLJExpand::settings(int narg, char **arg)
@@ -174,7 +174,7 @@ void PairLJExpand::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -223,7 +223,7 @@ double PairLJExpand::init_one(int i, int j)
 
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
     shift[i][j] = 0.5 * (shift[i][i] + shift[j][j]);
@@ -233,7 +233,7 @@ double PairLJExpand::init_one(int i, int j)
   lj2[i][j] = 24.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
   lj3[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],12.0);
   lj4[i][j] = 4.0 * epsilon[i][j] * pow(sigma[i][j],6.0);
-  
+
   if (offset_flag) {
     double ratio = sigma[i][j] / cut[i][j];
     offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
@@ -274,16 +274,16 @@ double PairLJExpand::init_one(int i, int j)
     double rc12 = rc11*shiftcut;
     double shift2 = shift[i][j]*shift[i][j];
     double shift3 = shift2*shift[i][j];
-    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
+    etail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
       sig6*((-1.0/(9.0*rc9) + shift[i][j]/(5.0*rc10) -
-             shift2/(11.0*rc11))*sig6 + 
-	    1.0/(3.0*rc3) - shift[i][j]/(2.0*rc4) + shift2/(5.0*rc5));
-    ptail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] * 
+             shift2/(11.0*rc11))*sig6 +
+            1.0/(3.0*rc3) - shift[i][j]/(2.0*rc4) + shift2/(5.0*rc5));
+    ptail_ij = 8.0*MY_PI*all[0]*all[1]*epsilon[i][j] *
       sig6* ((-4.0/(3.0*rc9) + 18.0*shift[i][j]/(5.0*rc10) -
-	     36.0*shift2/(11.0*rc11) + shift3/rc12)*sig6 + 
-	     2.0/rc3 - 9.0*shift[i][j]/(2.0*rc4) + 
-	     18.0*shift2/(5.0*rc5) - shift3/rc6)/3.0; 
-  }    
+             36.0*shift2/(11.0*rc11) + shift3/rc12)*sig6 +
+             2.0/rc3 - 9.0*shift[i][j]/(2.0*rc4) +
+             18.0*shift2/(5.0*rc5) - shift3/rc6)/3.0;
+  }
 
   return cut[i][j] + shift[i][j];
 }
@@ -301,10 +301,10 @@ void PairLJExpand::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&shift[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&shift[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -326,16 +326,16 @@ void PairLJExpand::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&shift[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&shift[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&shift[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&shift[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -370,8 +370,8 @@ void PairLJExpand::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJExpand::single(int i, int j, int itype, int jtype, double rsq,
-			    double factor_coul, double factor_lj,
-			    double &fforce)
+                            double factor_coul, double factor_lj,
+                            double &fforce)
 {
   double r,rshift,rshiftsq,r2inv,r6inv,forcelj,philj;
 
diff --git a/src/pair_lj_expand.h b/src/pair_lj_expand.h
index a0babd99dc..f132857e7e 100644
--- a/src/pair_lj_expand.h
+++ b/src/pair_lj_expand.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_lj_gromacs.cpp b/src/pair_lj_gromacs.cpp
index 5b43ff2acc..f62e2e879a 100644
--- a/src/pair_lj_gromacs.cpp
+++ b/src/pair_lj_gromacs.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -84,7 +84,7 @@ void PairLJGromacs::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -108,39 +108,39 @@ void PairLJGromacs::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
-	forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
+        forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
         if (rsq > cut_inner_sq[itype][jtype]) {
-          r = sqrt(rsq); 
-	  t = r - cut_inner[itype][jtype];
-	  fswitch = r*t*t*(ljsw1[itype][jtype] + ljsw2[itype][jtype]*t);
-	  forcelj += fswitch;
+          r = sqrt(rsq);
+          t = r - cut_inner[itype][jtype];
+          fswitch = r*t*t*(ljsw1[itype][jtype] + ljsw2[itype][jtype]*t);
+          forcelj += fswitch;
         }
 
-	fpair = factor_lj*forcelj*r2inv;
+        fpair = factor_lj*forcelj*r2inv;
 
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
 
-	if (eflag) {
-	  evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]); 
-	  evdwl += ljsw5[itype][jtype];
+        if (eflag) {
+          evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+          evdwl += ljsw5[itype][jtype];
           if (rsq > cut_inner_sq[itype][jtype]) {
             eswitch = t*t*t*(ljsw3[itype][jtype] + ljsw4[itype][jtype]*t);
             evdwl += eswitch;
           }
-	  evdwl *= factor_lj;
-	}
+          evdwl *= factor_lj;
+        }
 
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -200,10 +200,10 @@ void PairLJGromacs::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) {
-	  cut_inner[i][j] = cut_inner_global;
-	  cut[i][j] = cut_global;
-	}
+        if (setflag[i][j]) {
+          cut_inner[i][j] = cut_inner_global;
+          cut[i][j] = cut_global;
+        }
   }
 }
 
@@ -257,7 +257,7 @@ double PairLJGromacs::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut_inner[i][j] = mix_distance(cut_inner[i][i],cut_inner[j][j]);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
@@ -316,10 +316,10 @@ void PairLJGromacs::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut_inner[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut_inner[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -340,16 +340,16 @@ void PairLJGromacs::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut_inner[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut_inner[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -388,9 +388,9 @@ void PairLJGromacs::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJGromacs::single(int i, int j, int itype, int jtype,
-			     double rsq,
-			     double factor_coul, double factor_lj,
-			     double &fforce)
+                             double rsq,
+                             double factor_coul, double factor_lj,
+                             double &fforce)
 {
   double r2inv,r6inv,forcelj,philj;
   double r,t,fswitch,phiswitch;
@@ -399,7 +399,7 @@ double PairLJGromacs::single(int i, int j, int itype, int jtype,
   r6inv = r2inv*r2inv*r2inv;
   forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
   if (rsq > cut_inner_sq[itype][jtype]) {
-    r = sqrt(rsq); 
+    r = sqrt(rsq);
     t = r - cut_inner[itype][jtype];
     fswitch = r*t*t*(ljsw1[itype][jtype] + ljsw2[itype][jtype]*t);
     forcelj += fswitch;
diff --git a/src/pair_lj_gromacs.h b/src/pair_lj_gromacs.h
index 3e61d76450..9e3e55de7a 100644
--- a/src/pair_lj_gromacs.h
+++ b/src/pair_lj_gromacs.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_lj_gromacs_coul_gromacs.cpp b/src/pair_lj_gromacs_coul_gromacs.cpp
index af681aeab0..7f973708e3 100644
--- a/src/pair_lj_gromacs_coul_gromacs.cpp
+++ b/src/pair_lj_gromacs_coul_gromacs.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -84,7 +84,7 @@ void PairLJGromacsCoulGromacs::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -109,68 +109,68 @@ void PairLJGromacsCoulGromacs::compute(int eflag, int vflag)
       rsq = delx*delx + dely*dely + delz*delz;
 
       if (rsq < cut_bothsq) {
-	r2inv = 1.0/rsq;
+        r2inv = 1.0/rsq;
 
-	// skip if qi or qj = 0.0 since this potential may be used as
-	// coarse-grain model with many uncharged atoms
+        // skip if qi or qj = 0.0 since this potential may be used as
+        // coarse-grain model with many uncharged atoms
 
-	if (rsq < cut_coulsq && qtmp != 0.0 && q[j] != 0.0) {
-	  forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
+        if (rsq < cut_coulsq && qtmp != 0.0 && q[j] != 0.0) {
+          forcecoul = qqrd2e * qtmp*q[j]*sqrt(r2inv);
           if (rsq > cut_coul_innersq) {
-            r = sqrt(rsq); 
-	    tc = r - cut_coul_inner;
+            r = sqrt(rsq);
+            tc = r - cut_coul_inner;
             fswitchcoul = qqrd2e * qtmp*q[j]*r*tc*tc*(coulsw1 + coulsw2*tc);
             forcecoul += fswitchcoul;
           }
-	} else forcecoul = 0.0;
+        } else forcecoul = 0.0;
 
-	if (rsq < cut_ljsq) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  jtype = type[j];
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
+        if (rsq < cut_ljsq) {
+          r6inv = r2inv*r2inv*r2inv;
+          jtype = type[j];
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
           if (rsq > cut_lj_innersq) {
-            r = sqrt(rsq); 
-	    tlj = r - cut_lj_inner;
-	    fswitch = r*tlj*tlj*(ljsw1[itype][jtype] + 
-				 ljsw2[itype][jtype]*tlj);
-	    forcelj += fswitch;
+            r = sqrt(rsq);
+            tlj = r - cut_lj_inner;
+            fswitch = r*tlj*tlj*(ljsw1[itype][jtype] +
+                                 ljsw2[itype][jtype]*tlj);
+            forcelj += fswitch;
           }
-	} else forcelj = 0.0;
-
-	fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (rsq < cut_coulsq) {
-	    ecoul = qqrd2e * qtmp*q[j] * (sqrt(r2inv) - coulsw5);
+        } else forcelj = 0.0;
+
+        fpair = (factor_coul*forcecoul + factor_lj*forcelj) * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_coulsq) {
+            ecoul = qqrd2e * qtmp*q[j] * (sqrt(r2inv) - coulsw5);
             if (rsq > cut_coul_innersq) {
               ecoulswitch = tc*tc*tc * (coulsw3 + coulsw4*tc);
               ecoul += qqrd2e*qtmp*q[j]*ecoulswitch;
             }
-	    ecoul *= factor_coul;
-	  } else ecoul = 0.0;
-	  if (rsq < cut_ljsq) {
-	    evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
-	    evdwl += ljsw5[itype][jtype];
+            ecoul *= factor_coul;
+          } else ecoul = 0.0;
+          if (rsq < cut_ljsq) {
+            evdwl = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
+            evdwl += ljsw5[itype][jtype];
             if (rsq > cut_lj_innersq) {
-              eswitch = tlj*tlj*tlj * 
-		(ljsw3[itype][jtype] + ljsw4[itype][jtype]*tlj);
+              eswitch = tlj*tlj*tlj *
+                (ljsw3[itype][jtype] + ljsw4[itype][jtype]*tlj);
               evdwl += eswitch;
             }
-	    evdwl *= factor_lj;
-	  } else evdwl = 0.0;
-	}
+            evdwl *= factor_lj;
+          } else evdwl = 0.0;
+        }
 
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,ecoul,fpair,delx,dely,delz);
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,ecoul,fpair,delx,dely,delz);
       }
     }
   }
@@ -213,7 +213,7 @@ void PairLJGromacsCoulGromacs::allocate()
 
 void PairLJGromacsCoulGromacs::settings(int narg, char **arg)
 {
-  if (narg != 2 && narg != 4) 
+  if (narg != 2 && narg != 4)
     error->all(FLERR,"Illegal pair_style command");
 
   cut_lj_inner = force->numeric(arg[0]);
@@ -287,7 +287,7 @@ double PairLJGromacsCoulGromacs::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
   }
 
@@ -355,8 +355,8 @@ void PairLJGromacsCoulGromacs::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -377,12 +377,12 @@ void PairLJGromacsCoulGromacs::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -426,21 +426,21 @@ void PairLJGromacsCoulGromacs::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJGromacsCoulGromacs::single(int i, int j, int itype, int jtype,
-				double rsq,
-				double factor_coul, double factor_lj,
-				double &fforce)
+                                double rsq,
+                                double factor_coul, double factor_lj,
+                                double &fforce)
 {
   double r2inv,r6inv,forcecoul,forcelj,phicoul,philj;
-  double r,tlj,tc,fswitch,phiswitch,fswitchcoul,phiswitchcoul; 
+  double r,tlj,tc,fswitch,phiswitch,fswitchcoul,phiswitchcoul;
 
   r2inv = 1.0/rsq;
   if (rsq < cut_coulsq) {
     forcecoul = force->qqrd2e * atom->q[i]*atom->q[j]*sqrt(r2inv);
     if (rsq > cut_coul_innersq) {
-      r = sqrt(rsq); 
+      r = sqrt(rsq);
       tc = r - cut_coul_inner;
-      fswitchcoul =  force->qqrd2e * 
-	atom->q[i]*atom->q[j] * r*tc*tc * (coulsw1 + coulsw2*tc);
+      fswitchcoul =  force->qqrd2e *
+        atom->q[i]*atom->q[j] * r*tc*tc * (coulsw1 + coulsw2*tc);
       forcecoul += fswitchcoul;
     }
   } else forcecoul = 0.0;
@@ -449,7 +449,7 @@ double PairLJGromacsCoulGromacs::single(int i, int j, int itype, int jtype,
     r6inv = r2inv*r2inv*r2inv;
     forcelj = r6inv * (lj1[itype][jtype]*r6inv - lj2[itype][jtype]);
     if (rsq > cut_lj_innersq) {
-      r = sqrt(rsq); 
+      r = sqrt(rsq);
       tlj = r - cut_lj_inner;
       fswitch = r*tlj*tlj*(ljsw1[itype][jtype] + ljsw2[itype][jtype]*tlj);
       forcelj += fswitch;
@@ -463,7 +463,7 @@ double PairLJGromacsCoulGromacs::single(int i, int j, int itype, int jtype,
     phicoul = force->qqrd2e * atom->q[i]*atom->q[j] * (sqrt(r2inv)-coulsw5);
     if (rsq > cut_coul_innersq) {
       phiswitchcoul = force->qqrd2e * atom->q[i]*atom->q[j] *
-	tc*tc*tc * (coulsw3 + coulsw4*tc);
+        tc*tc*tc * (coulsw3 + coulsw4*tc);
       phicoul += phiswitchcoul;
     }
     eng += factor_coul*phicoul;
@@ -473,8 +473,8 @@ double PairLJGromacsCoulGromacs::single(int i, int j, int itype, int jtype,
     philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]);
     philj += ljsw5[itype][jtype];
     if (rsq > cut_lj_innersq) {
-      phiswitch = tlj*tlj*tlj * 
-	(ljsw3[itype][jtype] + ljsw4[itype][jtype]*tlj);
+      phiswitch = tlj*tlj*tlj *
+        (ljsw3[itype][jtype] + ljsw4[itype][jtype]*tlj);
       philj += phiswitch;
     }
     eng += factor_lj*philj;
diff --git a/src/pair_lj_gromacs_coul_gromacs.h b/src/pair_lj_gromacs_coul_gromacs.h
index bb6d28ba04..fb7d97bbb5 100644
--- a/src/pair_lj_gromacs_coul_gromacs.h
+++ b/src/pair_lj_gromacs_coul_gromacs.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_lj_smooth.cpp b/src/pair_lj_smooth.cpp
index de1276991c..3465c3ca19 100644
--- a/src/pair_lj_smooth.cpp
+++ b/src/pair_lj_smooth.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -67,7 +67,7 @@ void PairLJSmooth::compute(int eflag, int vflag)
   double rsq,r2inv,r6inv,forcelj,factor_lj;
   double r,t,tsq,fskin;
   int *ilist,*jlist,*numneigh,**firstneigh;
-  
+
   evdwl = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
@@ -78,12 +78,12 @@ void PairLJSmooth::compute(int eflag, int vflag)
   int nlocal = atom->nlocal;
   double *special_lj = force->special_lj;
   int newton_pair = force->newton_pair;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -105,45 +105,45 @@ void PairLJSmooth::compute(int eflag, int vflag)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	if (rsq < cut_inner_sq[itype][jtype]) {
-	  r6inv = r2inv*r2inv*r2inv;
-	  forcelj = r6inv * (lj1[itype][jtype]*r6inv-lj2[itype][jtype]);
-	} else {
-	  r = sqrt(rsq); 
-	  t = r - cut_inner[itype][jtype];
-	  tsq = t*t;
-	  fskin = ljsw1[itype][jtype] + ljsw2[itype][jtype]*t +
-	    ljsw3[itype][jtype]*tsq + ljsw4[itype][jtype]*tsq*t; 
-	  forcelj = fskin*r;
-	}
-        
-	fpair = factor_lj*forcelj*r2inv;
-        
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-	
-	if (eflag) {
-	  if (rsq < cut_inner_sq[itype][jtype])
-	    evdwl = r6inv * (lj3[itype][jtype]*r6inv - 
-			     lj4[itype][jtype]) - offset[itype][jtype];
-	  else
-	    evdwl = ljsw0[itype][jtype] - ljsw1[itype][jtype]*t -
-	      ljsw2[itype][jtype]*tsq/2.0 - ljsw3[itype][jtype]*tsq*t/3.0 -
-	      ljsw4[itype][jtype]*tsq*tsq/4.0 - offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        if (rsq < cut_inner_sq[itype][jtype]) {
+          r6inv = r2inv*r2inv*r2inv;
+          forcelj = r6inv * (lj1[itype][jtype]*r6inv-lj2[itype][jtype]);
+        } else {
+          r = sqrt(rsq);
+          t = r - cut_inner[itype][jtype];
+          tsq = t*t;
+          fskin = ljsw1[itype][jtype] + ljsw2[itype][jtype]*t +
+            ljsw3[itype][jtype]*tsq + ljsw4[itype][jtype]*tsq*t;
+          forcelj = fskin*r;
+        }
+
+        fpair = factor_lj*forcelj*r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (rsq < cut_inner_sq[itype][jtype])
+            evdwl = r6inv * (lj3[itype][jtype]*r6inv -
+                             lj4[itype][jtype]) - offset[itype][jtype];
+          else
+            evdwl = ljsw0[itype][jtype] - ljsw1[itype][jtype]*t -
+              ljsw2[itype][jtype]*tsq/2.0 - ljsw3[itype][jtype]*tsq*t/3.0 -
+              ljsw4[itype][jtype]*tsq*tsq/4.0 - offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -152,7 +152,7 @@ void PairLJSmooth::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLJSmooth::allocate()
@@ -185,7 +185,7 @@ void PairLJSmooth::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLJSmooth::settings(int narg, char **arg)
@@ -204,10 +204,10 @@ void PairLJSmooth::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) {
-	  cut_inner[i][j] = cut_inner_global;
-	  cut[i][j] = cut_global;
-	}
+        if (setflag[i][j]) {
+          cut_inner[i][j] = cut_inner_global;
+          cut[i][j] = cut_global;
+        }
   }
 }
 
@@ -227,7 +227,7 @@ void PairLJSmooth::coeff(int narg, char **arg)
 
   double epsilon_one = force->numeric(arg[2]);
   double sigma_one = force->numeric(arg[3]);
-  
+
   double cut_inner_one = cut_inner_global;
   double cut_one = cut_global;
   if (narg == 6) {
@@ -261,7 +261,7 @@ double PairLJSmooth::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut_inner[i][j] = mix_distance(cut_inner[i][i],cut_inner[j][j]);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
@@ -286,7 +286,7 @@ double PairLJSmooth::init_one(int i, int j)
     ljsw4[i][j] = -1.0/(3.0*tsq) * (ljsw2[i][j] + 2.0*ljsw3[i][j]*t);
     if (offset_flag)
       offset[i][j] = ljsw0[i][j] - ljsw1[i][j]*t - ljsw2[i][j]*tsq/2.0 -
-	ljsw3[i][j]*tsq*t/3.0 - ljsw4[i][j]*tsq*tsq/4.0;
+        ljsw3[i][j]*tsq*t/3.0 - ljsw4[i][j]*tsq*tsq/4.0;
     else offset[i][j] = 0.0;
   } else {
     ljsw0[i][j] = 0.0;
@@ -299,7 +299,7 @@ double PairLJSmooth::init_one(int i, int j)
       offset[i][j] = 4.0 * epsilon[i][j] * (pow(ratio,12.0) - pow(ratio,6.0));
     else offset[i][j] = 0.0;
   }
-              
+
   cut_inner[j][i] = cut_inner[i][j];
   cut_inner_sq[j][i] = cut_inner_sq[i][j];
   lj1[j][i] = lj1[i][j];
@@ -317,7 +317,7 @@ double PairLJSmooth::init_one(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairLJSmooth::write_restart(FILE *fp)
@@ -329,10 +329,10 @@ void PairLJSmooth::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut_inner[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut_inner[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -353,16 +353,16 @@ void PairLJSmooth::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut_inner[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut_inner[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -401,8 +401,8 @@ void PairLJSmooth::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairLJSmooth::single(int i, int j, int itype, int jtype, double rsq,
-			    double factor_coul, double factor_lj,
-			    double &fforce)
+                            double factor_coul, double factor_lj,
+                            double &fforce)
 {
   double r2inv,r6inv,forcelj,philj,r,t,tsq,fskin;
 
@@ -411,15 +411,15 @@ double PairLJSmooth::single(int i, int j, int itype, int jtype, double rsq,
     r6inv = r2inv*r2inv*r2inv;
     forcelj = r6inv * (lj1[itype][jtype]*r6inv-lj2[itype][jtype]);
   } else {
-    r = sqrt(rsq); 
+    r = sqrt(rsq);
     t = r - cut_inner[itype][jtype];
     tsq = t*t;
-    fskin = ljsw1[itype][jtype] + ljsw2[itype][jtype]*t + 
-      ljsw3[itype][jtype]*tsq + ljsw4[itype][jtype]*tsq*t; 
+    fskin = ljsw1[itype][jtype] + ljsw2[itype][jtype]*t +
+      ljsw3[itype][jtype]*tsq + ljsw4[itype][jtype]*tsq*t;
     forcelj = fskin*r;
   }
   fforce = factor_lj*forcelj*r2inv;
-    
+
   if (rsq < cut_inner_sq[itype][jtype])
     philj = r6inv * (lj3[itype][jtype]*r6inv - lj4[itype][jtype]) -
       offset[itype][jtype];
diff --git a/src/pair_lj_smooth.h b/src/pair_lj_smooth.h
index b81a1b79ff..d68f3568d4 100644
--- a/src/pair_lj_smooth.h
+++ b/src/pair_lj_smooth.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_lj_smooth_linear.cpp b/src/pair_lj_smooth_linear.cpp
index ed18f12964..7e8a8cab1b 100644
--- a/src/pair_lj_smooth_linear.cpp
+++ b/src/pair_lj_smooth_linear.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -60,7 +60,7 @@ void PairLJSmoothLinear::compute(int eflag, int vflag)
   double rsq,r2inv,r6inv,forcelj,factor_lj;
   double r,rinv;
   int *ilist,*jlist,*numneigh,**firstneigh;
-  
+
   evdwl = 0.0;
   if (eflag || vflag) ev_setup(eflag,vflag);
   else evflag = vflag_fdotr = 0;
@@ -72,12 +72,12 @@ void PairLJSmoothLinear::compute(int eflag, int vflag)
   int nall = nlocal + atom->nghost;
   double *special_lj = force->special_lj;
   int newton_pair = force->newton_pair;
-  
+
   inum = list->inum;
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -99,34 +99,34 @@ void PairLJSmoothLinear::compute(int eflag, int vflag)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r6inv = r2inv*r2inv*r2inv;
+        r2inv = 1.0/rsq;
+        r6inv = r2inv*r2inv*r2inv;
         rinv  = sqrt(r2inv);
-	forcelj = r6inv*(lj1[itype][jtype]*r6inv-lj2[itype][jtype]);
-	forcelj = rinv*forcelj - dljcut[itype][jtype];
- 
-	fpair = factor_lj*forcelj*rinv;
-        
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-	
-	if (eflag) {
+        forcelj = r6inv*(lj1[itype][jtype]*r6inv-lj2[itype][jtype]);
+        forcelj = rinv*forcelj - dljcut[itype][jtype];
+
+        fpair = factor_lj*forcelj*rinv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
           r = sqrt(rsq);
-	  evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
+          evdwl = r6inv*(lj3[itype][jtype]*r6inv-lj4[itype][jtype]);
           evdwl = evdwl - ljcut[itype][jtype]
-	  		+ (r-cut[itype][jtype])*dljcut[itype][jtype]; 
-	}
+                          + (r-cut[itype][jtype])*dljcut[itype][jtype];
+        }
 
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -135,7 +135,7 @@ void PairLJSmoothLinear::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairLJSmoothLinear::allocate()
@@ -162,7 +162,7 @@ void PairLJSmoothLinear::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairLJSmoothLinear::settings(int narg, char **arg)
@@ -177,9 +177,9 @@ void PairLJSmoothLinear::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) {
-	  cut[i][j] = cut_global;
-	}
+        if (setflag[i][j]) {
+          cut[i][j] = cut_global;
+        }
   }
 }
 
@@ -199,7 +199,7 @@ void PairLJSmoothLinear::coeff(int narg, char **arg)
 
   double epsilon_one = atof(arg[2]);
   double sigma_one = atof(arg[3]);
-  
+
   double cut_one = cut_global;
   if (narg == 5) {
     cut_one = atof(arg[4]);
@@ -227,7 +227,7 @@ double PairLJSmoothLinear::init_one(int i, int j)
 {
   if (setflag[i][j] == 0) {
     epsilon[i][j] = mix_energy(epsilon[i][i],epsilon[j][j],
-			       sigma[i][i],sigma[j][j]);
+                               sigma[i][i],sigma[j][j]);
     sigma[i][j] = mix_distance(sigma[i][i],sigma[j][j]);
     cut[i][j] = mix_distance(cut[i][i],cut[j][j]);
   }
@@ -252,7 +252,7 @@ double PairLJSmoothLinear::init_one(int i, int j)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes to restart file 
+   proc 0 writes to restart file
 ------------------------------------------------------------------------- */
 
 void PairLJSmoothLinear::write_restart(FILE *fp)
@@ -264,9 +264,9 @@ void PairLJSmoothLinear::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&epsilon[i][j],sizeof(double),1,fp);
-	fwrite(&sigma[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&epsilon[i][j],sizeof(double),1,fp);
+        fwrite(&sigma[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -287,14 +287,14 @@ void PairLJSmoothLinear::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&epsilon[i][j],sizeof(double),1,fp);
-	  fread(&sigma[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&epsilon[i][j],sizeof(double),1,fp);
+          fread(&sigma[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -326,10 +326,10 @@ void PairLJSmoothLinear::read_restart_settings(FILE *fp)
 
 /* ---------------------------------------------------------------------- */
 
-double PairLJSmoothLinear::single(int i, int j, int itype, int jtype, 
-				  double rsq,
-				  double factor_coul, double factor_lj,
-				  double &fforce)
+double PairLJSmoothLinear::single(int i, int j, int itype, int jtype,
+                                  double rsq,
+                                  double factor_coul, double factor_lj,
+                                  double &fforce)
 {
   double r2inv,r6inv,forcelj,philj,r,rinv;
 
diff --git a/src/pair_lj_smooth_linear.h b/src/pair_lj_smooth_linear.h
index 43d9238a77..0e3376b789 100644
--- a/src/pair_lj_smooth_linear.h
+++ b/src/pair_lj_smooth_linear.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_morse.cpp b/src/pair_morse.cpp
index d05235a978..080f19fe5e 100644
--- a/src/pair_morse.cpp
+++ b/src/pair_morse.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,7 +69,7 @@ void PairMorse::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -93,28 +93,28 @@ void PairMorse::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	dr = r - r0[itype][jtype];
-	dexp = exp(-alpha[itype][jtype] * dr);
-	fpair = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) -
-	    offset[itype][jtype];
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r = sqrt(rsq);
+        dr = r - r0[itype][jtype];
+        dexp = exp(-alpha[itype][jtype] * dr);
+        fpair = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          evdwl = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) -
+            offset[itype][jtype];
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -123,7 +123,7 @@ void PairMorse::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairMorse::allocate()
@@ -147,7 +147,7 @@ void PairMorse::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairMorse::settings(int narg, char **arg)
@@ -162,7 +162,7 @@ void PairMorse::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -211,7 +211,7 @@ double PairMorse::init_one(int i, int j)
   if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
 
   morse1[i][j] = 2.0*d0[i][j]*alpha[i][j];
-     
+
   if (offset_flag) {
     double alpha_dr = -alpha[i][j] * (cut[i][j] - r0[i][j]);
     offset[i][j] = d0[i][j] * (exp(2.0*alpha_dr) - 2.0*exp(alpha_dr));
@@ -239,10 +239,10 @@ void PairMorse::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&d0[i][j],sizeof(double),1,fp);
-	fwrite(&alpha[i][j],sizeof(double),1,fp);
-	fwrite(&r0[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&d0[i][j],sizeof(double),1,fp);
+        fwrite(&alpha[i][j],sizeof(double),1,fp);
+        fwrite(&r0[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -264,16 +264,16 @@ void PairMorse::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&d0[i][j],sizeof(double),1,fp);
-	  fread(&alpha[i][j],sizeof(double),1,fp);
-	  fread(&r0[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&d0[i][j],sizeof(double),1,fp);
+          fread(&alpha[i][j],sizeof(double),1,fp);
+          fread(&r0[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -308,8 +308,8 @@ void PairMorse::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairMorse::single(int i, int j, int itype, int jtype, double rsq,
-			 double factor_coul, double factor_lj,
-			 double &fforce)
+                         double factor_coul, double factor_lj,
+                         double &fforce)
 {
   double r,dr,dexp,phi;
 
@@ -317,7 +317,7 @@ double PairMorse::single(int i, int j, int itype, int jtype, double rsq,
   dr = r - r0[itype][jtype];
   dexp = exp(-alpha[itype][jtype] * dr);
   fforce = factor_lj * morse1[itype][jtype] * (dexp*dexp - dexp) / r;
-  
+
   phi = d0[itype][jtype] * (dexp*dexp - 2.0*dexp) - offset[itype][jtype];
   return factor_lj*phi;
 }
diff --git a/src/pair_morse.h b/src/pair_morse.h
index 2110237b7d..fbc2df8509 100644
--- a/src/pair_morse.h
+++ b/src/pair_morse.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_soft.cpp b/src/pair_soft.cpp
index fb2889ddfc..c6d38c7055 100644
--- a/src/pair_soft.cpp
+++ b/src/pair_soft.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -69,7 +69,7 @@ void PairSoft::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -93,26 +93,26 @@ void PairSoft::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r = sqrt(rsq);
-	arg = MY_PI*r/cut[itype][jtype];
-	if (r > 0.0) fpair = factor_lj * prefactor[itype][jtype] * 
-		       sin(arg) * MY_PI/cut[itype][jtype]/r;
-	else fpair = 0.0;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag)
-	  evdwl = factor_lj * prefactor[itype][jtype] * (1.0+cos(arg));
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r = sqrt(rsq);
+        arg = MY_PI*r/cut[itype][jtype];
+        if (r > 0.0) fpair = factor_lj * prefactor[itype][jtype] *
+                       sin(arg) * MY_PI/cut[itype][jtype]/r;
+        else fpair = 0.0;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag)
+          evdwl = factor_lj * prefactor[itype][jtype] * (1.0+cos(arg));
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -121,7 +121,7 @@ void PairSoft::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairSoft::allocate()
@@ -141,7 +141,7 @@ void PairSoft::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairSoft::settings(int narg, char **arg)
@@ -156,7 +156,7 @@ void PairSoft::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -223,8 +223,8 @@ void PairSoft::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&prefactor[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&prefactor[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -246,12 +246,12 @@ void PairSoft::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&prefactor[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&prefactor[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&prefactor[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&prefactor[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -283,16 +283,16 @@ void PairSoft::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairSoft::single(int i, int j, int itype, int jtype, double rsq,
-			double factor_coul, double factor_lj,
-			double &fforce)
+                        double factor_coul, double factor_lj,
+                        double &fforce)
 {
   double r,arg,philj;
 
   r = sqrt(rsq);
   arg = MY_PI*r/cut[itype][jtype];
-  fforce = factor_lj * prefactor[itype][jtype] * 
+  fforce = factor_lj * prefactor[itype][jtype] *
     sin(arg) * MY_PI/cut[itype][jtype]/r;
-  
+
   philj = prefactor[itype][jtype] * (1.0+cos(arg));
   return factor_lj*philj;
 }
diff --git a/src/pair_soft.h b/src/pair_soft.h
index c5927cefda..9027c83c8e 100644
--- a/src/pair_soft.h
+++ b/src/pair_soft.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_table.cpp b/src/pair_table.cpp
index 4585f18142..17e9058b6f 100644
--- a/src/pair_table.cpp
+++ b/src/pair_table.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -64,7 +64,7 @@ void PairTable::compute(int eflag, int vflag)
   double rsq,factor_lj,fraction,value,a,b;
   int *ilist,*jlist,*numneigh,**firstneigh;
   Table *tb;
-  
+
   union_int_float_t rsq_lookup;
   int tlm1 = tablength - 1;
 
@@ -83,7 +83,7 @@ void PairTable::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -105,66 +105,66 @@ void PairTable::compute(int eflag, int vflag)
       delz = ztmp - x[j][2];
       rsq = delx*delx + dely*dely + delz*delz;
       jtype = type[j];
-      
+
       if (rsq < cutsq[itype][jtype]) {
-	tb = &tables[tabindex[itype][jtype]];
-	if (rsq < tb->innersq)
-	  error->one(FLERR,"Pair distance < table inner cutoff");
- 
-	if (tabstyle == LOOKUP) {
-	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
-	  if (itable >= tlm1)
-	    error->one(FLERR,"Pair distance > table outer cutoff");
-	  fpair = factor_lj * tb->f[itable];
-	} else if (tabstyle == LINEAR) {
-	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
-	  if (itable >= tlm1)
-	    error->one(FLERR,"Pair distance > table outer cutoff");
-	  fraction = (rsq - tb->rsq[itable]) * tb->invdelta;
-	  value = tb->f[itable] + fraction*tb->df[itable];
-	  fpair = factor_lj * value;
-	} else if (tabstyle == SPLINE) {
-	  itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
-	  if (itable >= tlm1)
-	    error->one(FLERR,"Pair distance > table outer cutoff");
-	  b = (rsq - tb->rsq[itable]) * tb->invdelta;
-	  a = 1.0 - b;
-	  value = a * tb->f[itable] + b * tb->f[itable+1] + 
-	    ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) * 
+        tb = &tables[tabindex[itype][jtype]];
+        if (rsq < tb->innersq)
+          error->one(FLERR,"Pair distance < table inner cutoff");
+
+        if (tabstyle == LOOKUP) {
+          itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
+          if (itable >= tlm1)
+            error->one(FLERR,"Pair distance > table outer cutoff");
+          fpair = factor_lj * tb->f[itable];
+        } else if (tabstyle == LINEAR) {
+          itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
+          if (itable >= tlm1)
+            error->one(FLERR,"Pair distance > table outer cutoff");
+          fraction = (rsq - tb->rsq[itable]) * tb->invdelta;
+          value = tb->f[itable] + fraction*tb->df[itable];
+          fpair = factor_lj * value;
+        } else if (tabstyle == SPLINE) {
+          itable = static_cast<int> ((rsq - tb->innersq) * tb->invdelta);
+          if (itable >= tlm1)
+            error->one(FLERR,"Pair distance > table outer cutoff");
+          b = (rsq - tb->rsq[itable]) * tb->invdelta;
+          a = 1.0 - b;
+          value = a * tb->f[itable] + b * tb->f[itable+1] +
+            ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) *
             tb->deltasq6;
-	  fpair = factor_lj * value;
-	} else {
-	  rsq_lookup.f = rsq;
-	  itable = rsq_lookup.i & tb->nmask;
-	  itable >>= tb->nshiftbits;
-	  fraction = (rsq_lookup.f - tb->rsq[itable]) * tb->drsq[itable];
-	  value = tb->f[itable] + fraction*tb->df[itable];
-	  fpair = factor_lj * value;
-	}
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  if (tabstyle == LOOKUP)
-	    evdwl = tb->e[itable];
-	  else if (tabstyle == LINEAR || tabstyle == BITMAP)
-	    evdwl = tb->e[itable] + fraction*tb->de[itable];
-	  else
-	    evdwl = a * tb->e[itable] + b * tb->e[itable+1] + 
-	      ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * 
-	      tb->deltasq6;
-	  evdwl *= factor_lj;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+          fpair = factor_lj * value;
+        } else {
+          rsq_lookup.f = rsq;
+          itable = rsq_lookup.i & tb->nmask;
+          itable >>= tb->nshiftbits;
+          fraction = (rsq_lookup.f - tb->rsq[itable]) * tb->drsq[itable];
+          value = tb->f[itable] + fraction*tb->df[itable];
+          fpair = factor_lj * value;
+        }
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          if (tabstyle == LOOKUP)
+            evdwl = tb->e[itable];
+          else if (tabstyle == LINEAR || tabstyle == BITMAP)
+            evdwl = tb->e[itable] + fraction*tb->de[itable];
+          else
+            evdwl = a * tb->e[itable] + b * tb->e[itable+1] +
+              ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) *
+              tb->deltasq6;
+          evdwl *= factor_lj;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -173,7 +173,7 @@ void PairTable::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairTable::allocate()
@@ -191,7 +191,7 @@ void PairTable::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairTable::settings(int narg, char **arg)
@@ -237,10 +237,10 @@ void PairTable::coeff(int narg, char **arg)
   int ilo,ihi,jlo,jhi;
   force->bounds(arg[0],atom->ntypes,ilo,ihi);
   force->bounds(arg[1],atom->ntypes,jlo,jhi);
-  
+
   int me;
   MPI_Comm_rank(world,&me);
-  tables = (Table *) 
+  tables = (Table *)
     memory->srealloc(tables,(ntables+1)*sizeof(Table),"pair:tables");
   Table *tb = &tables[ntables];
   null_table(tb);
@@ -276,9 +276,9 @@ void PairTable::coeff(int narg, char **arg)
   // for tabstyle SPLINE, always need to build spline tables
 
   tb->match = 0;
-  if (tabstyle == LINEAR && tb->ninput == tablength && 
+  if (tabstyle == LINEAR && tb->ninput == tablength &&
       tb->rflag == RSQ && tb->rhi == tb->cut) tb->match = 1;
-  if (tabstyle == BITMAP && tb->ninput == 1 << tablength && 
+  if (tabstyle == BITMAP && tb->ninput == 1 << tablength &&
       tb->rflag == BMP && tb->rhi == tb->cut) tb->match = 1;
   if (tb->rflag == BMP && tb->match == 0)
     error->all(FLERR,"Bitmapped table in file does not match requested table");
@@ -319,7 +319,7 @@ double PairTable::init_one(int i, int j)
 /* ----------------------------------------------------------------------
    read a table section from a tabulated potential file
    only called by proc 0
-   this function sets these values in Table: 
+   this function sets these values in Table:
      ninput,rfile,efile,ffile,rflag,rlo,rhi,fpflag,fplo,fphi,ntablebits
 ------------------------------------------------------------------------- */
 
@@ -386,8 +386,8 @@ void PairTable::read_table(Table *tb, char *file, char *keyword)
     if (tb->rflag == RLINEAR)
       rtmp = tb->rlo + (tb->rhi - tb->rlo)*i/(tb->ninput-1);
     else if (tb->rflag == RSQ) {
-      rtmp = tb->rlo*tb->rlo + 
-	(tb->rhi*tb->rhi - tb->rlo*tb->rlo)*i/(tb->ninput-1);
+      rtmp = tb->rlo*tb->rlo +
+        (tb->rhi*tb->rhi - tb->rlo*tb->rlo)*i/(tb->ninput-1);
       rtmp = sqrt(rtmp);
     } else if (tb->rflag == BMP) {
       rsq_lookup.i = i << nshiftbits;
@@ -457,7 +457,7 @@ void PairTable::spline_table(Table *tb)
 
   if (tb->fpflag == 0) {
     tb->fplo = (tb->ffile[1] - tb->ffile[0]) / (tb->rfile[1] - tb->rfile[0]);
-    tb->fphi = (tb->ffile[tb->ninput-1] - tb->ffile[tb->ninput-2]) / 
+    tb->fphi = (tb->ffile[tb->ninput-1] - tb->ffile[tb->ninput-2]) /
       (tb->rfile[tb->ninput-1] - tb->rfile[tb->ninput-2]);
   }
 
@@ -477,14 +477,14 @@ void PairTable::param_extract(Table *tb, char *line)
   tb->ninput = 0;
   tb->rflag = NONE;
   tb->fpflag = 0;
-  
+
   char *word = strtok(line," \t\n\r\f");
   while (word) {
     if (strcmp(word,"N") == 0) {
       word = strtok(NULL," \t\n\r\f");
       tb->ninput = atoi(word);
     } else if (strcmp(word,"R") == 0 || strcmp(word,"RSQ") == 0 ||
-	       strcmp(word,"BITMAP") == 0) {
+               strcmp(word,"BITMAP") == 0) {
       if (strcmp(word,"R") == 0) tb->rflag = RLINEAR;
       else if (strcmp(word,"RSQ") == 0) tb->rflag = RSQ;
       else if (strcmp(word,"BITMAP") == 0) tb->rflag = BMP;
@@ -568,14 +568,14 @@ void PairTable::compute_table(Table *tb)
       r = sqrt(rsq);
       tb->rsq[i] = rsq;
       if (tb->match) {
-	tb->e[i] = tb->efile[i];
-	tb->f[i] = tb->ffile[i]/r;
+        tb->e[i] = tb->efile[i];
+        tb->f[i] = tb->ffile[i]/r;
       } else {
-	tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
-	tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r)/r;
+        tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
+        tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r)/r;
       }
     }
-    
+
     for (int i = 0; i < tlm1; i++) {
       tb->de[i] = tb->e[i+1] - tb->e[i];
       tb->df[i] = tb->f[i+1] - tb->f[i];
@@ -605,11 +605,11 @@ void PairTable::compute_table(Table *tb)
       r = sqrt(rsq);
       tb->rsq[i] = rsq;
       if (tb->match) {
-	tb->e[i] = tb->efile[i];
-	tb->f[i] = tb->ffile[i]/r;
+        tb->e[i] = tb->efile[i];
+        tb->f[i] = tb->ffile[i]/r;
       } else {
-	tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
-	tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r);
+        tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
+        tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r);
       }
     }
 
@@ -634,7 +634,7 @@ void PairTable::compute_table(Table *tb)
       double rsq1 = tb->innersq;
       double rsq2 = rsq1 + secant_factor*tb->delta;
       fp0 = (splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,sqrt(rsq2)) /
-	     sqrt(rsq2) - tb->f[0] / sqrt(rsq1)) / (secant_factor*tb->delta);
+             sqrt(rsq2) - tb->f[0] / sqrt(rsq1)) / (secant_factor*tb->delta);
     }
 
     if (tb->fpflag && tb->cut == tb->rfile[tb->ninput-1]) fpn =
@@ -642,9 +642,9 @@ void PairTable::compute_table(Table *tb)
     else {
       double rsq2 = tb->cut * tb->cut;
       double rsq1 = rsq2 - secant_factor*tb->delta;
-      fpn = (tb->f[tlm1] / sqrt(rsq2) - 
-	     splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,sqrt(rsq1)) /
-	     sqrt(rsq1)) / (secant_factor*tb->delta);
+      fpn = (tb->f[tlm1] / sqrt(rsq2) -
+             splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,sqrt(rsq1)) /
+             sqrt(rsq1)) / (secant_factor*tb->delta);
     }
 
     for (int i = 0; i < tablength; i++) tb->f[i] /= sqrt(tb->rsq[i]);
@@ -663,7 +663,7 @@ void PairTable::compute_table(Table *tb)
 
     // linear lookup tables of length ntable = 2^n
     // stored value = value at lower edge of bin
-	
+
     init_bitmap(inner,tb->cut,tablength,masklo,maskhi,tb->nmask,tb->nshiftbits);
     int ntable = 1 << tablength;
     int ntablem1 = ntable - 1;
@@ -674,7 +674,7 @@ void PairTable::compute_table(Table *tb)
     memory->create(tb->de,ntable,"pair:de");
     memory->create(tb->df,ntable,"pair:df");
     memory->create(tb->drsq,ntable,"pair:drsq");
-  
+
     union_int_float_t minrsq_lookup;
     minrsq_lookup.i = 0 << tb->nshiftbits;
     minrsq_lookup.i |= maskhi;
@@ -689,56 +689,56 @@ void PairTable::compute_table(Table *tb)
       r = sqrtf(rsq_lookup.f);
       tb->rsq[i] = rsq_lookup.f;
       if (tb->match) {
-	tb->e[i] = tb->efile[i];
-	tb->f[i] = tb->ffile[i]/r;
+        tb->e[i] = tb->efile[i];
+        tb->f[i] = tb->ffile[i]/r;
       } else {
-	tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
-	tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r)/r;
+        tb->e[i] = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
+        tb->f[i] = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r)/r;
       }
       minrsq_lookup.f = MIN(minrsq_lookup.f,rsq_lookup.f);
     }
 
     tb->innersq = minrsq_lookup.f;
-    
+
     for (int i = 0; i < ntablem1; i++) {
       tb->de[i] = tb->e[i+1] - tb->e[i];
       tb->df[i] = tb->f[i+1] - tb->f[i];
       tb->drsq[i] = 1.0/(tb->rsq[i+1] - tb->rsq[i]);
-    } 
+    }
 
-    // get the delta values for the last table entries 
+    // get the delta values for the last table entries
     // tables are connected periodically between 0 and ntablem1
-    
+
     tb->de[ntablem1] = tb->e[0] - tb->e[ntablem1];
     tb->df[ntablem1] = tb->f[0] - tb->f[ntablem1];
     tb->drsq[ntablem1] = 1.0/(tb->rsq[0] - tb->rsq[ntablem1]);
 
-    // get the correct delta values at itablemax    
+    // get the correct delta values at itablemax
     // smallest r is in bin itablemin
     // largest r is in bin itablemax, which is itablemin-1,
     //   or ntablem1 if itablemin=0
 
     // deltas at itablemax only needed if corresponding rsq < cut*cut
-    // if so, compute deltas between rsq and cut*cut 
+    // if so, compute deltas between rsq and cut*cut
     //   if tb->match, data at cut*cut is unavailable, so we'll take
     //   deltas at itablemax-1 as a good approximation
-	
+
     double e_tmp,f_tmp;
     int itablemin = minrsq_lookup.i & tb->nmask;
-    itablemin >>= tb->nshiftbits;  
-    int itablemax = itablemin - 1; 
-    if (itablemin == 0) itablemax = ntablem1;     
-    int itablemaxm1 = itablemax - 1; 
-    if (itablemax == 0) itablemaxm1 = ntablem1;       
+    itablemin >>= tb->nshiftbits;
+    int itablemax = itablemin - 1;
+    if (itablemin == 0) itablemax = ntablem1;
+    int itablemaxm1 = itablemax - 1;
+    if (itablemax == 0) itablemaxm1 = ntablem1;
     rsq_lookup.i = itablemax << tb->nshiftbits;
-    rsq_lookup.i |= maskhi;          
+    rsq_lookup.i |= maskhi;
     if (rsq_lookup.f < tb->cut*tb->cut) {
       if (tb->match) {
         tb->de[itablemax] = tb->de[itablemaxm1];
         tb->df[itablemax] = tb->df[itablemaxm1];
         tb->drsq[itablemax] = tb->drsq[itablemaxm1];
       } else {
-	    rsq_lookup.f = tb->cut*tb->cut;   
+            rsq_lookup.f = tb->cut*tb->cut;
         r = sqrtf(rsq_lookup.f);
         e_tmp = splint(tb->rfile,tb->efile,tb->e2file,tb->ninput,r);
         f_tmp = splint(tb->rfile,tb->ffile,tb->f2file,tb->ninput,r)/r;
@@ -747,7 +747,7 @@ void PairTable::compute_table(Table *tb)
         tb->drsq[itablemax] = 1.0/(rsq_lookup.f - tb->rsq[itablemax]);
       }
     }
-  } 
+  }
 }
 
 /* ----------------------------------------------------------------------
@@ -789,7 +789,7 @@ void PairTable::free_table(Table *tb)
 ------------------------------------------------------------------------- */
 
 void PairTable::spline(double *x, double *y, int n,
-		       double yp1, double ypn, double *y2)
+                       double yp1, double ypn, double *y2)
 {
   int i,k;
   double p,qn,sig,un;
@@ -835,7 +835,7 @@ double PairTable::splint(double *xa, double *ya, double *y2a, int n, double x)
   h = xa[khi]-xa[klo];
   a = (xa[khi]-x) / h;
   b = (x-xa[klo]) / h;
-  y = a*ya[klo] + b*ya[khi] + 
+  y = a*ya[klo] + b*ya[khi] +
     ((a*a*a-a)*y2a[klo] + (b*b*b-b)*y2a[khi]) * (h*h)/6.0;
   return y;
 }
@@ -886,8 +886,8 @@ void PairTable::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairTable::single(int i, int j, int itype, int jtype, double rsq,
-			 double factor_coul, double factor_lj,
-			 double &fforce)
+                         double factor_coul, double factor_lj,
+                         double &fforce)
 {
   int itable;
   double fraction,value,a,b,phi;
@@ -911,8 +911,8 @@ double PairTable::single(int i, int j, int itype, int jtype, double rsq,
     if (itable >= tlm1) error->one(FLERR,"Pair distance > table outer cutoff");
     b = (rsq - tb->rsq[itable]) * tb->invdelta;
     a = 1.0 - b;
-    value = a * tb->f[itable] + b * tb->f[itable+1] + 
-      ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) * 
+    value = a * tb->f[itable] + b * tb->f[itable+1] +
+      ((a*a*a-a)*tb->f2[itable] + (b*b*b-b)*tb->f2[itable+1]) *
       tb->deltasq6;
     fforce = factor_lj * value;
   } else {
@@ -930,7 +930,7 @@ double PairTable::single(int i, int j, int itype, int jtype, double rsq,
   else if (tabstyle == LINEAR || tabstyle == BITMAP)
     phi = tb->e[itable] + fraction*tb->de[itable];
   else
-    phi = a * tb->e[itable] + b * tb->e[itable+1] + 
+    phi = a * tb->e[itable] + b * tb->e[itable+1] +
       ((a*a*a-a)*tb->e2[itable] + (b*b*b-b)*tb->e2[itable+1]) * tb->deltasq6;
   return factor_lj*phi;
 }
@@ -951,7 +951,7 @@ void *PairTable::extract(const char *str, int &dim)
   for (int m = 1; m < ntables; m++)
     if (tables[m].cut != cut_coul)
       error->all(FLERR,
-		 "Pair table cutoffs must all be equal to use with KSpace");
+                 "Pair table cutoffs must all be equal to use with KSpace");
   dim = 0;
   return &tables[0].cut;
 }
diff --git a/src/pair_table.h b/src/pair_table.h
index ac5d28ec6c..09d81fb037 100644
--- a/src/pair_table.h
+++ b/src/pair_table.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pair_yukawa.cpp b/src/pair_yukawa.cpp
index f631fc4416..e7682dacb4 100644
--- a/src/pair_yukawa.cpp
+++ b/src/pair_yukawa.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -66,7 +66,7 @@ void PairYukawa::compute(int eflag, int vflag)
   ilist = list->ilist;
   numneigh = list->numneigh;
   firstneigh = list->firstneigh;
-  
+
   // loop over neighbors of my atoms
 
   for (ii = 0; ii < inum; ii++) {
@@ -90,30 +90,30 @@ void PairYukawa::compute(int eflag, int vflag)
       jtype = type[j];
 
       if (rsq < cutsq[itype][jtype]) {
-	r2inv = 1.0/rsq;
-	r = sqrt(rsq);
-	rinv = 1.0/r;
-	screening = exp(-kappa*r);
-	forceyukawa = a[itype][jtype] * screening * (kappa + rinv);
-
-	fpair = factor*forceyukawa * r2inv;
-
-	f[i][0] += delx*fpair;
-	f[i][1] += dely*fpair;
-	f[i][2] += delz*fpair;
-	if (newton_pair || j < nlocal) {
-	  f[j][0] -= delx*fpair;
-	  f[j][1] -= dely*fpair;
-	  f[j][2] -= delz*fpair;
-	}
-
-	if (eflag) {
-	  evdwl = a[itype][jtype] * screening * rinv - offset[itype][jtype];
-	  evdwl *= factor;
-	}
-
-	if (evflag) ev_tally(i,j,nlocal,newton_pair,
-			     evdwl,0.0,fpair,delx,dely,delz);
+        r2inv = 1.0/rsq;
+        r = sqrt(rsq);
+        rinv = 1.0/r;
+        screening = exp(-kappa*r);
+        forceyukawa = a[itype][jtype] * screening * (kappa + rinv);
+
+        fpair = factor*forceyukawa * r2inv;
+
+        f[i][0] += delx*fpair;
+        f[i][1] += dely*fpair;
+        f[i][2] += delz*fpair;
+        if (newton_pair || j < nlocal) {
+          f[j][0] -= delx*fpair;
+          f[j][1] -= dely*fpair;
+          f[j][2] -= delz*fpair;
+        }
+
+        if (eflag) {
+          evdwl = a[itype][jtype] * screening * rinv - offset[itype][jtype];
+          evdwl *= factor;
+        }
+
+        if (evflag) ev_tally(i,j,nlocal,newton_pair,
+                             evdwl,0.0,fpair,delx,dely,delz);
       }
     }
   }
@@ -122,7 +122,7 @@ void PairYukawa::compute(int eflag, int vflag)
 }
 
 /* ----------------------------------------------------------------------
-   allocate all arrays 
+   allocate all arrays
 ------------------------------------------------------------------------- */
 
 void PairYukawa::allocate()
@@ -144,7 +144,7 @@ void PairYukawa::allocate()
 }
 
 /* ----------------------------------------------------------------------
-   global settings 
+   global settings
 ------------------------------------------------------------------------- */
 
 void PairYukawa::settings(int narg, char **arg)
@@ -160,7 +160,7 @@ void PairYukawa::settings(int narg, char **arg)
     int i,j;
     for (i = 1; i <= atom->ntypes; i++)
       for (j = i+1; j <= atom->ntypes; j++)
-	if (setflag[i][j]) cut[i][j] = cut_global;
+        if (setflag[i][j]) cut[i][j] = cut_global;
   }
 }
 
@@ -170,7 +170,7 @@ void PairYukawa::settings(int narg, char **arg)
 
 void PairYukawa::coeff(int narg, char **arg)
 {
-  if (narg < 3 || narg > 4) 
+  if (narg < 3 || narg > 4)
     error->all(FLERR,"Incorrect args for pair coefficients");
   if (!allocated) allocate();
 
@@ -231,8 +231,8 @@ void PairYukawa::write_restart(FILE *fp)
     for (j = i; j <= atom->ntypes; j++) {
       fwrite(&setflag[i][j],sizeof(int),1,fp);
       if (setflag[i][j]) {
-	fwrite(&a[i][j],sizeof(double),1,fp);
-	fwrite(&cut[i][j],sizeof(double),1,fp);
+        fwrite(&a[i][j],sizeof(double),1,fp);
+        fwrite(&cut[i][j],sizeof(double),1,fp);
       }
     }
 }
@@ -254,12 +254,12 @@ void PairYukawa::read_restart(FILE *fp)
       if (me == 0) fread(&setflag[i][j],sizeof(int),1,fp);
       MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
       if (setflag[i][j]) {
-	if (me == 0) {
-	  fread(&a[i][j],sizeof(double),1,fp);
-	  fread(&cut[i][j],sizeof(double),1,fp);
-	}
-	MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
-	MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
+        if (me == 0) {
+          fread(&a[i][j],sizeof(double),1,fp);
+          fread(&cut[i][j],sizeof(double),1,fp);
+        }
+        MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world);
+        MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
       }
     }
 }
@@ -297,8 +297,8 @@ void PairYukawa::read_restart_settings(FILE *fp)
 /* ---------------------------------------------------------------------- */
 
 double PairYukawa::single(int i, int j, int itype, int jtype, double rsq,
-			  double factor_coul, double factor_lj,
-			  double &fforce)
+                          double factor_coul, double factor_lj,
+                          double &fforce)
 {
   double r2inv,r,rinv,screening,forceyukawa,phi;
 
diff --git a/src/pair_yukawa.h b/src/pair_yukawa.h
index 2c07456c8f..18b72790f5 100644
--- a/src/pair_yukawa.h
+++ b/src/pair_yukawa.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/pointers.h b/src/pointers.h
index 963561792f..981b5ccd83 100644
--- a/src/pointers.h
+++ b/src/pointers.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -36,7 +36,7 @@ namespace LAMMPS_NS {
 
 class Pointers {
  public:
-  Pointers(LAMMPS *ptr) : 
+  Pointers(LAMMPS *ptr) :
     lmp(ptr),
     memory(ptr->memory),
     error(ptr->error),
diff --git a/src/procmap.cpp b/src/procmap.cpp
index b0bd120fa6..6703b08d25 100644
--- a/src/procmap.cpp
+++ b/src/procmap.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -40,8 +40,8 @@ ProcMap::ProcMap(LAMMPS *lmp) : Pointers(lmp) {}
 ------------------------------------------------------------------------- */
 
 void ProcMap::onelevel_grid(int nprocs, int *user_procgrid, int *procgrid,
-			    int otherflag, int other_style,
-			    int *other_procgrid, int *other_coregrid)
+                            int otherflag, int other_style,
+                            int *other_procgrid, int *other_coregrid)
 {
   int **factors;
 
@@ -56,8 +56,8 @@ void ProcMap::onelevel_grid(int nprocs, int *user_procgrid, int *procgrid,
   if (domain->dimension == 2) npossible = cull_2d(npossible,factors,3);
   npossible = cull_user(npossible,factors,3,user_procgrid);
   if (otherflag) npossible = cull_other(npossible,factors,3,
-					other_style,other_procgrid,
-					other_coregrid);
+                                        other_style,other_procgrid,
+                                        other_coregrid);
 
   // user/other constraints make failure possible
 
@@ -78,15 +78,15 @@ void ProcMap::onelevel_grid(int nprocs, int *user_procgrid, int *procgrid,
 ------------------------------------------------------------------------- */
 
 void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid,
-			    int ncores, int *user_coregrid, int *coregrid,
-			    int otherflag, int other_style, 
-			    int *other_procgrid, int *other_coregrid)
+                            int ncores, int *user_coregrid, int *coregrid,
+                            int otherflag, int other_style,
+                            int *other_procgrid, int *other_coregrid)
 {
   int **nfactors,**cfactors,**factors;
 
-  if (nprocs % ncores) 
+  if (nprocs % ncores)
     error->all(FLERR,"Processors twogrid requires proc count "
-	       "be a multiple of core count");
+               "be a multiple of core count");
 
   // nfactors = list of all possible 3 factors of node count
   // constrain by 2d
@@ -117,8 +117,8 @@ void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid,
 
   npossible = cull_user(npossible,factors,4,user_procgrid);
   if (otherflag) npossible = cull_other(npossible,factors,4,
-					other_style,other_procgrid,
-					other_coregrid);
+                                        other_style,other_procgrid,
+                                        other_coregrid);
 
   // user/other constraints make failure possible
 
@@ -147,7 +147,7 @@ void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid,
 ------------------------------------------------------------------------- */
 
 void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid,
-			int *numagrid)
+                        int *numagrid)
 {
   // hardwire this for now
 
@@ -163,7 +163,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid,
   MPI_Allgather(node_name,MPI_MAX_PROCESSOR_NAME,MPI_CHAR,node_names,
                 MPI_MAX_PROCESSOR_NAME,MPI_CHAR,world);
   std::string node_string = std::string(node_name);
-  
+
   // get number of procs per node
   // NOTE: could do this without STL map
 
@@ -177,17 +177,17 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid,
   }
   procs_per_node = name_map.begin()->second;
   procs_per_numa = procs_per_node / numa_nodes;
-  
+
   delete [] node_names;
 
   // error if any of these conditions met
-  
+
   if (nprocs % procs_per_numa ||       // total procs not a multiple of node
       user_procgrid[0] > 1 ||          // user specified grid > 1 in any dim
       user_procgrid[1] > 1 ||
       user_procgrid[2] > 1)
     error->all(FLERR,"Could not create numa grid of processors");
-  
+
   // user settings for the factorization per numa node
   // currently not user settable
   // if user specifies 1 for a proc grid dimension,
@@ -199,7 +199,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid,
   if (user_procgrid[0] == 1) user_numagrid[0] = 1;
   if (user_procgrid[1] == 1) user_numagrid[1] = 1;
   if (user_procgrid[2] == 1) user_numagrid[2] = 1;
-  
+
   // initial factorization within NUMA node
 
   int **numafactors;
@@ -207,7 +207,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid,
   memory->create(numafactors,numapossible,3,"procmap:numafactors");
   numapossible = factor(procs_per_numa,numafactors);
 
-  if (domain->dimension == 2) 
+  if (domain->dimension == 2)
     numapossible = cull_2d(numapossible,numafactors,3);
   numapossible = cull_user(numapossible,numafactors,3,user_numagrid);
 
@@ -232,7 +232,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid,
   memory->create(nodefactors,nodepossible,3,"procmap:nodefactors");
   nodepossible = factor(node_count,nodefactors);
 
-  if (domain->dimension == 2) 
+  if (domain->dimension == 2)
     nodepossible = cull_2d(nodepossible,nodefactors,3);
   nodepossible = cull_user(nodepossible,nodefactors,3,user_nodegrid);
 
@@ -240,14 +240,14 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid,
     error->all(FLERR,"Could not create numa grid of processors");
 
   best_factors(nodepossible,nodefactors,nodegrid,
-	       numagrid[0],numagrid[1],numagrid[2]);
-  
+               numagrid[0],numagrid[1],numagrid[2]);
+
   // repeat NUMA node factorization using subdomain sizes
   // refines the factorization if the user specified the node layout
   // NOTE: this will not re-enforce user-procgrid constraint will it?
 
   best_factors(numapossible,numafactors,numagrid,
-	       nodegrid[0],nodegrid[1],nodegrid[2]);
+               nodegrid[0],nodegrid[1],nodegrid[2]);
 
   memory->destroy(numafactors);
   memory->destroy(nodefactors);
@@ -273,7 +273,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid,
 ------------------------------------------------------------------------- */
 
 void ProcMap::custom_grid(char *cfile, int nprocs,
-			  int *user_procgrid, int *procgrid)
+                          int *user_procgrid, int *procgrid)
 {
   FILE *fp;
   char line[MAXLINE];
@@ -286,7 +286,7 @@ void ProcMap::custom_grid(char *cfile, int nprocs,
     if (fp == NULL) error->one(FLERR,"Cannot open custom file");
 
     // skip header = blank and comment lines
-    
+
     char *ptr;
     if (!fgets(line,MAXLINE,fp))
       error->one(FLERR,"Unexpected end of custom file");
@@ -294,7 +294,7 @@ void ProcMap::custom_grid(char *cfile, int nprocs,
       if (ptr = strchr(line,'#')) *ptr = '\0';
       if (strspn(line," \t\n\r") != strlen(line)) break;
       if (!fgets(line,MAXLINE,fp))
-	error->one(FLERR,"Unexpected end of custom file");
+        error->one(FLERR,"Unexpected end of custom file");
     }
   }
 
@@ -320,9 +320,9 @@ void ProcMap::custom_grid(char *cfile, int nprocs,
   if (me == 0) {
     for (int i = 0; i < nprocs; i++) {
       if (!fgets(line,MAXLINE,fp))
-	error->one(FLERR,"Unexpected end of custom file");
+        error->one(FLERR,"Unexpected end of custom file");
       sscanf(line,"%d %d %d %d",
-	     &cmap[i][0],&cmap[i][1],&cmap[i][2],&cmap[i][3]);
+             &cmap[i][0],&cmap[i][1],&cmap[i][2],&cmap[i][3]);
     }
     fclose(fp);
   }
@@ -349,12 +349,12 @@ void ProcMap::custom_grid(char *cfile, int nprocs,
 ------------------------------------------------------------------------- */
 
 void ProcMap::cart_map(int reorder, int *procgrid,
-		       int *myloc, int procneigh[3][2], int ***grid2proc)
+                       int *myloc, int procneigh[3][2], int ***grid2proc)
 {
   int periods[3];
   periods[0] = periods[1] = periods[2] = 1;
   MPI_Comm cartesian;
-      
+
   MPI_Cart_create(world,3,procgrid,periods,reorder,&cartesian);
   MPI_Cart_get(cartesian,3,procgrid,periods,myloc);
   MPI_Cart_shift(cartesian,0,1,&procneigh[0][0],&procneigh[0][1]);
@@ -366,10 +366,10 @@ void ProcMap::cart_map(int reorder, int *procgrid,
   for (i = 0; i < procgrid[0]; i++)
     for (j = 0; j < procgrid[1]; j++)
       for (k = 0; k < procgrid[2]; k++) {
-	coords[0] = i; coords[1] = j; coords[2] = k;
-	MPI_Cart_rank(cartesian,coords,&grid2proc[i][j][k]);
+        coords[0] = i; coords[1] = j; coords[2] = k;
+        MPI_Cart_rank(cartesian,coords,&grid2proc[i][j][k]);
       }
-  
+
   MPI_Comm_free(&cartesian);
 }
 
@@ -380,7 +380,7 @@ void ProcMap::cart_map(int reorder, int *procgrid,
 ------------------------------------------------------------------------- */
 
 void ProcMap::cart_map(int reorder, int *procgrid, int ncores, int *coregrid,
-		       int *myloc, int procneigh[3][2], int ***grid2proc)
+                       int *myloc, int procneigh[3][2], int ***grid2proc)
 {
   // setup NUMA params that numa_grid() sets up
 
@@ -405,7 +405,7 @@ void ProcMap::cart_map(int reorder, int *procgrid, int ncores, int *coregrid,
 ------------------------------------------------------------------------- */
 
 void ProcMap::xyz_map(char *xyz, int *procgrid,
-		      int *myloc, int procneigh[3][2], int ***grid2proc)
+                      int *myloc, int procneigh[3][2], int ***grid2proc)
 {
   int me;
   MPI_Comm_rank(world,&me);
@@ -414,22 +414,22 @@ void ProcMap::xyz_map(char *xyz, int *procgrid,
   for (i = 0; i < procgrid[0]; i++)
     for (j = 0; j < procgrid[1]; j++)
       for (k = 0; k < procgrid[2]; k++) {
-	if (xyz[0] == 'x' && xyz[1] == 'y' && xyz[2] == 'z')
-	  grid2proc[i][j][k] = k*procgrid[1]*procgrid[0] + j*procgrid[0] + i;
-	else if (xyz[0] == 'x' && xyz[1] == 'z' && xyz[2] == 'y')
-	  grid2proc[i][j][k] = j*procgrid[2]*procgrid[0] + k*procgrid[0] + i;
-	else if (xyz[0] == 'y' && xyz[1] == 'x' && xyz[2] == 'z')
-	  grid2proc[i][j][k] = k*procgrid[0]*procgrid[1] + i*procgrid[1] + j;
-	else if (xyz[0] == 'y' && xyz[1] == 'z' && xyz[2] == 'x')
-	  grid2proc[i][j][k] = i*procgrid[2]*procgrid[1] + k*procgrid[1] + j;
-	else if (xyz[0] == 'z' && xyz[1] == 'x' && xyz[2] == 'y')
-	  grid2proc[i][j][k] = j*procgrid[0]*procgrid[2] + i*procgrid[2] + k;
-	else if (xyz[0] == 'z' && xyz[1] == 'y' && xyz[2] == 'x')
-	  grid2proc[i][j][k] = i*procgrid[1]*procgrid[2] + j*procgrid[2] + k;
-
-	if (grid2proc[i][j][k] == me) {
-	  myloc[0] = i; myloc[1] = j, myloc[2] = k;
-	}
+        if (xyz[0] == 'x' && xyz[1] == 'y' && xyz[2] == 'z')
+          grid2proc[i][j][k] = k*procgrid[1]*procgrid[0] + j*procgrid[0] + i;
+        else if (xyz[0] == 'x' && xyz[1] == 'z' && xyz[2] == 'y')
+          grid2proc[i][j][k] = j*procgrid[2]*procgrid[0] + k*procgrid[0] + i;
+        else if (xyz[0] == 'y' && xyz[1] == 'x' && xyz[2] == 'z')
+          grid2proc[i][j][k] = k*procgrid[0]*procgrid[1] + i*procgrid[1] + j;
+        else if (xyz[0] == 'y' && xyz[1] == 'z' && xyz[2] == 'x')
+          grid2proc[i][j][k] = i*procgrid[2]*procgrid[1] + k*procgrid[1] + j;
+        else if (xyz[0] == 'z' && xyz[1] == 'x' && xyz[2] == 'y')
+          grid2proc[i][j][k] = j*procgrid[0]*procgrid[2] + i*procgrid[2] + k;
+        else if (xyz[0] == 'z' && xyz[1] == 'y' && xyz[2] == 'x')
+          grid2proc[i][j][k] = i*procgrid[1]*procgrid[2] + j*procgrid[2] + k;
+
+        if (grid2proc[i][j][k] == me) {
+          myloc[0] = i; myloc[1] = j, myloc[2] = k;
+        }
       }
 
   // proc IDs of neighbors
@@ -455,7 +455,7 @@ void ProcMap::xyz_map(char *xyz, int *procgrid,
 ------------------------------------------------------------------------- */
 
 void ProcMap::xyz_map(char *xyz, int *procgrid, int ncores, int *coregrid,
-		      int *myloc, int procneigh[3][2], int ***grid2proc)
+                      int *myloc, int procneigh[3][2], int ***grid2proc)
 {
   int me;
   MPI_Comm_rank(world,&me);
@@ -468,41 +468,41 @@ void ProcMap::xyz_map(char *xyz, int *procgrid, int ncores, int *coregrid,
   for (i = 0; i < procgrid[0]; i++)
     for (j = 0; j < procgrid[1]; j++)
       for (k = 0; k < procgrid[2]; k++) {
-	inode = i/coregrid[0];
-	jnode = j/coregrid[1];
-	knode = k/coregrid[2];
-	icore = i % coregrid[0];
-	jcore = j % coregrid[1];
-	kcore = k % coregrid[2];
-
-	if (xyz[0] == 'x' && xyz[1] == 'y' && xyz[2] == 'z') {
-	  grid2proc[i][j][k] = ncores * 
-	    (knode*nodegrid[1]*nodegrid[0] + jnode*nodegrid[0] + inode) +
-	    (kcore*coregrid[1]*coregrid[0] + jcore*coregrid[0] + icore);
-	} else if (xyz[0] == 'x' && xyz[1] == 'z' && xyz[2] == 'y')
-	  grid2proc[i][j][k] = ncores * 
-	    (jnode*nodegrid[2]*nodegrid[0] + knode*nodegrid[0] + inode) + 
-	    (jcore*coregrid[2]*coregrid[0] + kcore*coregrid[0] + icore);
-	else if (xyz[0] == 'y' && xyz[1] == 'x' && xyz[2] == 'z')
-	  grid2proc[i][j][k] = ncores *
-	    (knode*nodegrid[0]*nodegrid[1] + inode*nodegrid[1] + jnode) +
-	    (kcore*coregrid[0]*coregrid[1] + icore*coregrid[1] + jcore);
-	else if (xyz[0] == 'y' && xyz[1] == 'z' && xyz[2] == 'x')
-	  grid2proc[i][j][k] = ncores *
-	    (inode*nodegrid[2]*nodegrid[1] + knode*nodegrid[1] + jnode) +
-	    (icore*coregrid[2]*coregrid[1] + kcore*coregrid[1] + jcore);
-	else if (xyz[0] == 'z' && xyz[1] == 'x' && xyz[2] == 'y')
-	  grid2proc[i][j][k] = ncores *
-	    (jnode*nodegrid[0]*nodegrid[2] + inode*nodegrid[2] + knode) +
-	    (jcore*coregrid[0]*coregrid[2] + icore*coregrid[2] + kcore);
-	else if (xyz[0] == 'z' && xyz[1] == 'y' && xyz[2] == 'x')
-	  grid2proc[i][j][k] = ncores *
-	    (inode*nodegrid[1]*nodegrid[2] + jnode*nodegrid[2] + knode) +
-	    (icore*coregrid[1]*coregrid[2] + jcore*coregrid[2] + kcore);
-
-	if (grid2proc[i][j][k] == me) {
-	  myloc[0] = i; myloc[1] = j, myloc[2] = k;
-	}
+        inode = i/coregrid[0];
+        jnode = j/coregrid[1];
+        knode = k/coregrid[2];
+        icore = i % coregrid[0];
+        jcore = j % coregrid[1];
+        kcore = k % coregrid[2];
+
+        if (xyz[0] == 'x' && xyz[1] == 'y' && xyz[2] == 'z') {
+          grid2proc[i][j][k] = ncores *
+            (knode*nodegrid[1]*nodegrid[0] + jnode*nodegrid[0] + inode) +
+            (kcore*coregrid[1]*coregrid[0] + jcore*coregrid[0] + icore);
+        } else if (xyz[0] == 'x' && xyz[1] == 'z' && xyz[2] == 'y')
+          grid2proc[i][j][k] = ncores *
+            (jnode*nodegrid[2]*nodegrid[0] + knode*nodegrid[0] + inode) +
+            (jcore*coregrid[2]*coregrid[0] + kcore*coregrid[0] + icore);
+        else if (xyz[0] == 'y' && xyz[1] == 'x' && xyz[2] == 'z')
+          grid2proc[i][j][k] = ncores *
+            (knode*nodegrid[0]*nodegrid[1] + inode*nodegrid[1] + jnode) +
+            (kcore*coregrid[0]*coregrid[1] + icore*coregrid[1] + jcore);
+        else if (xyz[0] == 'y' && xyz[1] == 'z' && xyz[2] == 'x')
+          grid2proc[i][j][k] = ncores *
+            (inode*nodegrid[2]*nodegrid[1] + knode*nodegrid[1] + jnode) +
+            (icore*coregrid[2]*coregrid[1] + kcore*coregrid[1] + jcore);
+        else if (xyz[0] == 'z' && xyz[1] == 'x' && xyz[2] == 'y')
+          grid2proc[i][j][k] = ncores *
+            (jnode*nodegrid[0]*nodegrid[2] + inode*nodegrid[2] + knode) +
+            (jcore*coregrid[0]*coregrid[2] + icore*coregrid[2] + kcore);
+        else if (xyz[0] == 'z' && xyz[1] == 'y' && xyz[2] == 'x')
+          grid2proc[i][j][k] = ncores *
+            (inode*nodegrid[1]*nodegrid[2] + jnode*nodegrid[2] + knode) +
+            (icore*coregrid[1]*coregrid[2] + jcore*coregrid[2] + kcore);
+
+        if (grid2proc[i][j][k] == me) {
+          myloc[0] = i; myloc[1] = j, myloc[2] = k;
+        }
       }
 
   // proc IDs of neighbors
@@ -526,28 +526,28 @@ void ProcMap::xyz_map(char *xyz, int *procgrid, int ncores, int *coregrid,
 ------------------------------------------------------------------------- */
 
 void ProcMap::numa_map(int reorder, int *numagrid,
-		       int *myloc, int procneigh[3][2], int ***grid2proc)
+                       int *myloc, int procneigh[3][2], int ***grid2proc)
 {
   // setup a per node communicator and find rank within
 
   MPI_Comm node_comm;
-  MPI_Comm_split(world,node_id,0,&node_comm);  
+  MPI_Comm_split(world,node_id,0,&node_comm);
   int node_rank;
   MPI_Comm_rank(node_comm,&node_rank);
-  
+
   // setup a per numa communicator and find rank within
 
   MPI_Comm numa_comm;
   int local_numa = node_rank / procs_per_numa;
-  MPI_Comm_split(node_comm,local_numa,0,&numa_comm);     
+  MPI_Comm_split(node_comm,local_numa,0,&numa_comm);
   int numa_rank;
   MPI_Comm_rank(numa_comm,&numa_rank);
-  
+
   // setup a communicator with the rank 0 procs from each numa node
 
   MPI_Comm numa_leaders;
   MPI_Comm_split(world,numa_rank,0,&numa_leaders);
-  
+
   // use the MPI Cartesian routines to map the nodes to the grid
 
   int periods[3];
@@ -557,11 +557,11 @@ void ProcMap::numa_map(int reorder, int *numagrid,
     MPI_Cart_create(numa_leaders,3,nodegrid,periods,reorder,&cartesian);
     MPI_Cart_get(cartesian,3,nodegrid,periods,myloc);
   }
-  
+
   // broadcast numa node location in grid to other procs in numa node
 
   MPI_Bcast(myloc,3,MPI_INT,0,numa_comm);
-  
+
   // compute my location within the node grid
 
   int z_offset = numa_rank / (numagrid[0] * numagrid[1]);
@@ -570,7 +570,7 @@ void ProcMap::numa_map(int reorder, int *numagrid,
   myloc[0] = myloc[0] * numagrid[0] + x_offset;
   myloc[1] = myloc[1] * numagrid[1] + y_offset;
   myloc[2] = myloc[2] * numagrid[2] + z_offset;
-  
+
   // allgather of myloc into gridi to fill grid2proc
 
   int nprocs;
@@ -582,7 +582,7 @@ void ProcMap::numa_map(int reorder, int *numagrid,
   for (int i = 0; i < nprocs; i++)
     grid2proc[gridi[i][0]][gridi[i][1]][gridi[i][2]] = i;
   memory->destroy(gridi);
-  
+
   // proc IDs of neighbors
 
   int minus,plus;
@@ -611,7 +611,7 @@ void ProcMap::numa_map(int reorder, int *numagrid,
 ------------------------------------------------------------------------- */
 
 void ProcMap::custom_map(int *procgrid,
-			 int *myloc, int procneigh[3][2], int ***grid2proc)
+                         int *myloc, int procneigh[3][2], int ***grid2proc)
 {
   int me,nprocs;
   MPI_Comm_rank(world,&me);
@@ -670,9 +670,9 @@ void ProcMap::output(char *file, int *procgrid, int ***grid2proc)
   for (int i = 0; i < procgrid[0]; i++)
     for (int j = 0; j < procgrid[1]; j++)
       for (int k = 0; k < procgrid[2]; k++)
-	if (grid2proc[i][j][k] == me) {
-	  ime = i; jme = j; kme = k;
-	}
+        if (grid2proc[i][j][k] == me) {
+          ime = i; jme = j; kme = k;
+        }
 
   // polled comm of grid mapping info from each proc to proc 0
 
@@ -695,16 +695,16 @@ void ProcMap::output(char *file, int *procgrid, int ***grid2proc)
   if (me == 0) {
     for (int iproc = 0; iproc < nprocs; iproc++) {
       if (iproc) {
-	MPI_Send(&tmp,0,MPI_INT,iproc,0,world);
-	MPI_Recv(vec,6,MPI_INT,iproc,0,world,&status);
-	MPI_Recv(procname,MPI_MAX_PROCESSOR_NAME+1,MPI_CHAR,
-		 iproc,0,world,&status);
+        MPI_Send(&tmp,0,MPI_INT,iproc,0,world);
+        MPI_Recv(vec,6,MPI_INT,iproc,0,world,&status);
+        MPI_Recv(procname,MPI_MAX_PROCESSOR_NAME+1,MPI_CHAR,
+                 iproc,0,world,&status);
       }
 
       fprintf(fp,"%d %d %d: %d %d %d: %s\n",
-	      vec[0],vec[1],vec[2],vec[3],vec[4],vec[5],procname);
+              vec[0],vec[1],vec[2],vec[3],vec[4],vec[5],procname);
     }
-    
+
   } else {
     MPI_Recv(&tmp,0,MPI_INT,0,0,world,&status);
     MPI_Send(vec,6,MPI_INT,0,0,world);
@@ -733,9 +733,9 @@ int ProcMap::factor(int n, int **factors)
     for (j = 1; j <= nyz; j++) {
       if (nyz % j) continue;
       if (factors) {
-	factors[m][0] = i;
-	factors[m][1] = j;
-	factors[m][2] = nyz/j;
+        factors[m][0] = i;
+        factors[m][1] = j;
+        factors[m][2] = nyz/j;
       }
       m++;
     }
@@ -750,7 +750,7 @@ int ProcMap::factor(int n, int **factors)
 ------------------------------------------------------------------------- */
 
 int ProcMap::combine_factors(int n1, int **factors1, int n2, int **factors2,
-			     int **factors)
+                             int **factors)
 {
   int m = 0;
   for (int i = 0; i < n1; i++)
@@ -806,9 +806,9 @@ int ProcMap::cull_user(int n, int **factors, int m, int *user_factors)
               where Nx,Ny,Nz = node grid = procgrid/coregrid
 ------------------------------------------------------------------------- */
 
-int ProcMap::cull_other(int n, int **factors, int m, 
-			int other_style, int *other_procgrid,
-			int *other_coregrid)
+int ProcMap::cull_other(int n, int **factors, int m,
+                        int other_style, int *other_procgrid,
+                        int *other_coregrid)
 {
   int i = 0;
   while (i < n) {
@@ -818,8 +818,8 @@ int ProcMap::cull_other(int n, int **factors, int m,
       if ((other_procgrid[1]/other_coregrid[1]) % factors[i][1]) flag = 1;
       if ((other_procgrid[2]/other_coregrid[2]) % factors[i][2]) flag = 1;
       if (flag) {
-	for (int j = 0; j < m; j++) factors[i][j] = factors[n-1][j];
-	n--;
+        for (int j = 0; j < m; j++) factors[i][j] = factors[n-1][j];
+        n--;
       } else i++;
     }
   }
@@ -834,13 +834,13 @@ int ProcMap::cull_other(int n, int **factors, int m,
 ------------------------------------------------------------------------- */
 
 int ProcMap::best_factors(int npossible, int **factors, int *best,
-			  const int sx, const int sy, const int sz)
+                          const int sx, const int sy, const int sz)
 {
   // determine cross-sectional areas for orthogonal and triclinic boxes
   // for triclinic, area = cross product of 2 edge vectors stored in h matrix
   // area[3] = surface area 3 box faces divided by sx,sy,sz
   // area[0] = xy, area[1] = xz, area[2] = yz
-  
+
   double area[3];
   if (domain->triclinic == 0) {
     area[0] = domain->xprd * domain->yprd / (sx*sy);
@@ -868,8 +868,8 @@ int ProcMap::best_factors(int npossible, int **factors, int *best,
   double bestsurf = 2.0 * (area[0]+area[1]+area[2]);
 
   for (int m = 0; m < npossible; m++) {
-    surf = area[0]/factors[m][0]/factors[m][1] + 
-      area[1]/factors[m][0]/factors[m][2] + 
+    surf = area[0]/factors[m][0]/factors[m][1] +
+      area[1]/factors[m][0]/factors[m][2] +
       area[2]/factors[m][1]/factors[m][2];
     if (surf < bestsurf) {
       bestsurf = surf;
@@ -887,11 +887,10 @@ int ProcMap::best_factors(int npossible, int **factors, int *best,
    minus,plus = indices of neighboring processors in a dimension
 ------------------------------------------------------------------------- */
 
-void ProcMap::grid_shift(int myloc, int nprocs, int &minus, int &plus) 
+void ProcMap::grid_shift(int myloc, int nprocs, int &minus, int &plus)
 {
   minus = myloc - 1;
   if (minus < 0) minus = nprocs - 1;
   plus = myloc + 1;
   if (plus == nprocs) plus = 0;
 }
-
diff --git a/src/procmap.h b/src/procmap.h
index d8376040df..c7e3c02fbc 100644
--- a/src/procmap.h
+++ b/src/procmap.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -23,8 +23,8 @@ class ProcMap : protected Pointers {
   ProcMap(class LAMMPS *);
   ~ProcMap() {}
   void onelevel_grid(int, int *, int *, int, int, int *, int *);
-  void twolevel_grid(int, int *, int *, int, int *, int *, int, int, 
-		     int *, int *);
+  void twolevel_grid(int, int *, int *, int, int *, int *, int, int,
+                     int *, int *);
   void numa_grid(int, int *, int *, int *);
   void custom_grid(char *, int, int *, int *);
   void cart_map(int, int *, int *, int [3][2], int ***);
diff --git a/src/random_mars.cpp b/src/random_mars.cpp
index 0dd5990362..387cf6a781 100644
--- a/src/random_mars.cpp
+++ b/src/random_mars.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -68,7 +68,7 @@ RanMars::~RanMars()
 }
 
 /* ----------------------------------------------------------------------
-   uniform RN 
+   uniform RN
 ------------------------------------------------------------------------- */
 
 double RanMars::uniform()
@@ -88,7 +88,7 @@ double RanMars::uniform()
 }
 
 /* ----------------------------------------------------------------------
-   gaussian RN 
+   gaussian RN
 ------------------------------------------------------------------------- */
 
 double RanMars::gaussian()
diff --git a/src/random_mars.h b/src/random_mars.h
index 6c183bcc5f..b31999f68c 100644
--- a/src/random_mars.h
+++ b/src/random_mars.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/random_park.cpp b/src/random_park.cpp
index bc46cde4f3..8e1c88a246 100644
--- a/src/random_park.cpp
+++ b/src/random_park.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -36,7 +36,7 @@ RanPark::RanPark(LAMMPS *lmp, int seed_init) : Pointers(lmp)
 }
 
 /* ----------------------------------------------------------------------
-   uniform RN 
+   uniform RN
 ------------------------------------------------------------------------- */
 
 double RanPark::uniform()
@@ -49,7 +49,7 @@ double RanPark::uniform()
 }
 
 /* ----------------------------------------------------------------------
-   gaussian RN 
+   gaussian RN
 ------------------------------------------------------------------------- */
 
 double RanPark::gaussian()
diff --git a/src/random_park.h b/src/random_park.h
index 7b17184983..d43fbe10be 100644
--- a/src/random_park.h
+++ b/src/random_park.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/read_data.cpp b/src/read_data.cpp
index ded09669a0..23c423c706 100644
--- a/src/read_data.cpp
+++ b/src/read_data.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -86,7 +86,7 @@ void ReadData::command(int narg, char **arg)
 {
   if (narg < 1) error->all(FLERR,"Illegal read_data command");
 
-  if (domain->box_exist) 
+  if (domain->box_exist)
     error->all(FLERR,"Cannot read_data after simulation box is defined");
   if (domain->dimension == 2 && domain->zperiodic == 0)
     error->all(FLERR,"Cannot run 2d simulation with nonperiodic Z dimension");
@@ -102,17 +102,17 @@ void ReadData::command(int narg, char **arg)
   while (iarg < narg) {
     if (strcmp(arg[iarg],"fix") == 0) {
       if (iarg+4 > narg)
-	error->all(FLERR,"Illegal read_data command");
+        error->all(FLERR,"Illegal read_data command");
       memory->grow(fix_index,nfix+1,"read_data:fix_index");
-      fix_header = (char **) 
-	memory->srealloc(fix_header,(nfix+1)*sizeof(char *),
-			 "read_data:fix_header");
-      fix_section = (char **) 
-	memory->srealloc(fix_section,(nfix+1)*sizeof(char *),
-			 "read_data:fix_section");
+      fix_header = (char **)
+        memory->srealloc(fix_header,(nfix+1)*sizeof(char *),
+                         "read_data:fix_header");
+      fix_section = (char **)
+        memory->srealloc(fix_section,(nfix+1)*sizeof(char *),
+                         "read_data:fix_section");
       fix_index[nfix] = modify->find_fix(arg[iarg+1]);
-      if (fix_index[nfix] < 0) 
-	error->all(FLERR,"Fix ID for Read_data does not exist");
+      if (fix_index[nfix] < 0)
+        error->all(FLERR,"Fix ID for Read_data does not exist");
       int n = strlen(arg[iarg+2]) + 1;
       fix_header[nfix] = new char[n];
       strcpy(fix_header[nfix],arg[iarg+2]);
@@ -124,7 +124,7 @@ void ReadData::command(int narg, char **arg)
     } else error->all(FLERR,"Illegal read_data command");
   }
 
-  // scan data file to determine max topology needed per atom 
+  // scan data file to determine max topology needed per atom
   // allocate initial topology arrays
 
   if (atom->molecular) {
@@ -133,7 +133,7 @@ void ReadData::command(int narg, char **arg)
       open(arg[0]);
       header(0);
       scan(atom->bond_per_atom,atom->angle_per_atom,
-	   atom->dihedral_per_atom,atom->improper_per_atom);
+           atom->dihedral_per_atom,atom->improper_per_atom);
       if (compressed) pclose(fp);
       else fclose(fp);
       atom->bond_per_atom += atom->extra_bond_per_atom;
@@ -187,13 +187,13 @@ void ReadData::command(int narg, char **arg)
 
     if (nfix) {
       for (n = 0; n < nfix; n++)
-	if (strstr(line,fix_section[n])) {
-	  bigint nlines = 
-	    modify->fix[fix_index[n]]->read_data_skip_lines(keyword);
-	  fix(n,keyword,nlines);
-	  parse_keyword(0,1);
-	  break;
-	}
+        if (strstr(line,fix_section[n])) {
+          bigint nlines =
+            modify->fix[fix_index[n]]->read_data_skip_lines(keyword);
+          fix(n,keyword,nlines);
+          parse_keyword(0,1);
+          break;
+        }
       if (n < nfix) continue;
     }
 
@@ -205,128 +205,128 @@ void ReadData::command(int narg, char **arg)
       velocities();
 
     } else if (strcmp(keyword,"Ellipsoids") == 0) {
-      if (!avec_ellipsoid) 
-	error->all(FLERR,"Invalid data file section: Ellipsoids");
+      if (!avec_ellipsoid)
+        error->all(FLERR,"Invalid data file section: Ellipsoids");
       if (atomflag == 0) error->all(FLERR,"Must read Atoms before Ellipsoids");
       bonus(nellipsoids,(AtomVec *) avec_ellipsoid,"ellipsoids");
     } else if (strcmp(keyword,"Lines") == 0) {
-      if (!avec_line) 
-	error->all(FLERR,"Invalid data file section: Lines");
+      if (!avec_line)
+        error->all(FLERR,"Invalid data file section: Lines");
       if (atomflag == 0) error->all(FLERR,"Must read Atoms before Lines");
       bonus(nlines,(AtomVec *) avec_line,"lines");
     } else if (strcmp(keyword,"Triangles") == 0) {
-      if (!avec_tri) 
-	error->all(FLERR,"Invalid data file section: Triangles");
+      if (!avec_tri)
+        error->all(FLERR,"Invalid data file section: Triangles");
       if (atomflag == 0) error->all(FLERR,"Must read Atoms before Triangles");
       bonus(ntris,(AtomVec *) avec_tri,"triangles");
 
     } else if (strcmp(keyword,"Bonds") == 0) {
-      if (atom->avec->bonds_allow == 0) 
-	error->all(FLERR,"Invalid data file section: Bonds");
+      if (atom->avec->bonds_allow == 0)
+        error->all(FLERR,"Invalid data file section: Bonds");
       if (atomflag == 0) error->all(FLERR,"Must read Atoms before Bonds");
       bonds();
     } else if (strcmp(keyword,"Angles") == 0) {
       if (atom->avec->angles_allow == 0)
-	error->all(FLERR,"Invalid data file section: Angles");
+        error->all(FLERR,"Invalid data file section: Angles");
       if (atomflag == 0) error->all(FLERR,"Must read Atoms before Angles");
       angles();
     } else if (strcmp(keyword,"Dihedrals") == 0) {
       if (atom->avec->dihedrals_allow == 0)
-	error->all(FLERR,"Invalid data file section: Dihedrals");
+        error->all(FLERR,"Invalid data file section: Dihedrals");
       if (atomflag == 0) error->all(FLERR,"Must read Atoms before Dihedrals");
       dihedrals();
     } else if (strcmp(keyword,"Impropers") == 0) {
-      if (atom->avec->impropers_allow == 0) 
-	error->all(FLERR,"Invalid data file section: Impropers");
+      if (atom->avec->impropers_allow == 0)
+        error->all(FLERR,"Invalid data file section: Impropers");
       if (atomflag == 0) error->all(FLERR,"Must read Atoms before Impropers");
       impropers();
 
     } else if (strcmp(keyword,"Masses") == 0) {
       mass();
     } else if (strcmp(keyword,"Pair Coeffs") == 0) {
-      if (force->pair == NULL) 
-	error->all(FLERR,"Must define pair_style before Pair Coeffs");
+      if (force->pair == NULL)
+        error->all(FLERR,"Must define pair_style before Pair Coeffs");
       paircoeffs();
     } else if (strcmp(keyword,"Bond Coeffs") == 0) {
-      if (atom->avec->bonds_allow == 0) 
-	error->all(FLERR,"Invalid data file section: Bond Coeffs");
-      if (force->bond == NULL) 
-	error->all(FLERR,"Must define bond_style before Bond Coeffs");
+      if (atom->avec->bonds_allow == 0)
+        error->all(FLERR,"Invalid data file section: Bond Coeffs");
+      if (force->bond == NULL)
+        error->all(FLERR,"Must define bond_style before Bond Coeffs");
       bondcoeffs();
     } else if (strcmp(keyword,"Angle Coeffs") == 0) {
-      if (atom->avec->angles_allow == 0) 
-	error->all(FLERR,"Invalid data file section: Angle Coeffs");
-      if (force->angle == NULL) 
-	error->all(FLERR,"Must define angle_style before Angle Coeffs");
+      if (atom->avec->angles_allow == 0)
+        error->all(FLERR,"Invalid data file section: Angle Coeffs");
+      if (force->angle == NULL)
+        error->all(FLERR,"Must define angle_style before Angle Coeffs");
       anglecoeffs(0);
     } else if (strcmp(keyword,"Dihedral Coeffs") == 0) {
-      if (atom->avec->dihedrals_allow == 0) 
-	error->all(FLERR,"Invalid data file section: Dihedral Coeffs");
-      if (force->dihedral == NULL) 
-	error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->all(FLERR,"Invalid data file section: Dihedral Coeffs");
+      if (force->dihedral == NULL)
+        error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs");
       dihedralcoeffs(0);
     } else if (strcmp(keyword,"Improper Coeffs") == 0) {
-      if (atom->avec->impropers_allow == 0) 
-	error->all(FLERR,"Invalid data file section: Improper Coeffs");
-      if (force->improper == NULL) 
-	error->all(FLERR,"Must define improper_style before Improper Coeffs");
+      if (atom->avec->impropers_allow == 0)
+        error->all(FLERR,"Invalid data file section: Improper Coeffs");
+      if (force->improper == NULL)
+        error->all(FLERR,"Must define improper_style before Improper Coeffs");
       impropercoeffs(0);
 
     } else if (strcmp(keyword,"BondBond Coeffs") == 0) {
-      if (atom->avec->angles_allow == 0) 
-	error->all(FLERR,"Invalid data file section: BondBond Coeffs");
-      if (force->angle == NULL) 
-	error->all(FLERR,"Must define angle_style before BondBond Coeffs");
+      if (atom->avec->angles_allow == 0)
+        error->all(FLERR,"Invalid data file section: BondBond Coeffs");
+      if (force->angle == NULL)
+        error->all(FLERR,"Must define angle_style before BondBond Coeffs");
       anglecoeffs(1);
     } else if (strcmp(keyword,"BondAngle Coeffs") == 0) {
-      if (atom->avec->angles_allow == 0) 
-	error->all(FLERR,"Invalid data file section: BondAngle Coeffs");
-      if (force->angle == NULL) 
-	error->all(FLERR,"Must define angle_style before BondAngle Coeffs");
+      if (atom->avec->angles_allow == 0)
+        error->all(FLERR,"Invalid data file section: BondAngle Coeffs");
+      if (force->angle == NULL)
+        error->all(FLERR,"Must define angle_style before BondAngle Coeffs");
       anglecoeffs(2);
 
     } else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) {
-      if (atom->avec->dihedrals_allow == 0) 
-	error->all(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
-      if (force->dihedral == NULL) 
-	error->all(FLERR,
-		   "Must define dihedral_style before "
-		   "MiddleBondTorsion Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->all(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
+      if (force->dihedral == NULL)
+        error->all(FLERR,
+                   "Must define dihedral_style before "
+                   "MiddleBondTorsion Coeffs");
       dihedralcoeffs(1);
     } else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
-      if (atom->avec->dihedrals_allow == 0) 
-	error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
-      if (force->dihedral == NULL) 
-	error->all(FLERR,
-		   "Must define dihedral_style before EndBondTorsion Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
+      if (force->dihedral == NULL)
+        error->all(FLERR,
+                   "Must define dihedral_style before EndBondTorsion Coeffs");
       dihedralcoeffs(2);
     } else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
-      if (atom->avec->dihedrals_allow == 0) 
-	error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs");
-      if (force->dihedral == NULL) 
-	error->all(FLERR,
-		   "Must define dihedral_style before AngleTorsion Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs");
+      if (force->dihedral == NULL)
+        error->all(FLERR,
+                   "Must define dihedral_style before AngleTorsion Coeffs");
       dihedralcoeffs(3);
     } else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
-      if (atom->avec->dihedrals_allow == 0) 
-	error->all(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
-      if (force->dihedral == NULL) 
-	error->all(FLERR,
-		   "Must define dihedral_style before "
-		   "AngleAngleTorsion Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->all(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
+      if (force->dihedral == NULL)
+        error->all(FLERR,
+                   "Must define dihedral_style before "
+                   "AngleAngleTorsion Coeffs");
       dihedralcoeffs(4);
     } else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
-      if (atom->avec->dihedrals_allow == 0) 
-	error->all(FLERR,"Invalid data file section: BondBond13 Coeffs");
-      if (force->dihedral == NULL) 
-	error->all(FLERR,"Must define dihedral_style before BondBond13 Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->all(FLERR,"Invalid data file section: BondBond13 Coeffs");
+      if (force->dihedral == NULL)
+        error->all(FLERR,"Must define dihedral_style before BondBond13 Coeffs");
       dihedralcoeffs(5);
 
     } else if (strcmp(keyword,"AngleAngle Coeffs") == 0) {
-      if (atom->avec->impropers_allow == 0) 
-	error->all(FLERR,"Invalid data file section: AngleAngle Coeffs");
-      if (force->improper == NULL) 
-	error->all(FLERR,"Must define improper_style before AngleAngle Coeffs");
+      if (atom->avec->impropers_allow == 0)
+        error->all(FLERR,"Invalid data file section: AngleAngle Coeffs");
+      if (force->improper == NULL)
+        error->all(FLERR,"Must define improper_style before AngleAngle Coeffs");
       impropercoeffs(1);
 
     } else {
@@ -344,10 +344,10 @@ void ReadData::command(int narg, char **arg)
     if (compressed) pclose(fp);
     else fclose(fp);
   }
-  
+
   // error if natoms > 0 yet no atoms were read
 
-  if (atom->natoms > 0 && atomflag == 0) 
+  if (atom->natoms > 0 && atomflag == 0)
     error->all(FLERR,"No atoms in data file");
 
   // create bond topology now that system is defined
@@ -376,7 +376,7 @@ void ReadData::header(int flag)
 
   // customize for new sections
 
-  const char *section_keywords[NSECTIONS] = 
+  const char *section_keywords[NSECTIONS] =
     {"Atoms","Velocities","Ellipsoids","Lines","Triangles",
      "Bonds","Angles","Dihedrals","Impropers",
      "Masses","Pair Coeffs","Bond Coeffs","Angle Coeffs",
@@ -426,10 +426,10 @@ void ReadData::header(int flag)
 
     if (nfix) {
       for (n = 0; n < nfix; n++)
-	if (strstr(line,fix_header[n])) {
-	  modify->fix[fix_index[n]]->read_data_header(line);
-	  break;
-	}
+        if (strstr(line,fix_header[n])) {
+          modify->fix[fix_index[n]]->read_data_header(line);
+          break;
+        }
       if (n < nfix) continue;
     }
 
@@ -442,41 +442,41 @@ void ReadData::header(int flag)
 
     else if (strstr(line,"ellipsoids")) {
       if (!avec_ellipsoid && me == 0)
-	error->one(FLERR,"No ellipsoids allowed with this atom style");
+        error->one(FLERR,"No ellipsoids allowed with this atom style");
       sscanf(line,BIGINT_FORMAT,&nellipsoids);
     } else if (strstr(line,"lines")) {
       if (!avec_line && me == 0)
-	error->one(FLERR,"No lines allowed with this atom style");
+        error->one(FLERR,"No lines allowed with this atom style");
       sscanf(line,BIGINT_FORMAT,&nlines);
     } else if (strstr(line,"triangles")) {
       if (!avec_tri && me == 0)
-	error->one(FLERR,"No triangles allowed with this atom style");
+        error->one(FLERR,"No triangles allowed with this atom style");
       sscanf(line,BIGINT_FORMAT,&ntris);
     }
 
     else if (strstr(line,"bonds")) sscanf(line,BIGINT_FORMAT,&atom->nbonds);
     else if (strstr(line,"angles")) sscanf(line,BIGINT_FORMAT,&atom->nangles);
     else if (strstr(line,"dihedrals")) sscanf(line,BIGINT_FORMAT,
-					      &atom->ndihedrals);
+                                              &atom->ndihedrals);
     else if (strstr(line,"impropers")) sscanf(line,BIGINT_FORMAT,
-					      &atom->nimpropers);
+                                              &atom->nimpropers);
 
     else if (strstr(line,"atom types")) sscanf(line,"%d",&atom->ntypes);
     else if (strstr(line,"bond types")) sscanf(line,"%d",&atom->nbondtypes);
     else if (strstr(line,"angle types")) sscanf(line,"%d",&atom->nangletypes);
-    else if (strstr(line,"dihedral types")) 
+    else if (strstr(line,"dihedral types"))
       sscanf(line,"%d",&atom->ndihedraltypes);
-    else if (strstr(line,"improper types")) 
+    else if (strstr(line,"improper types"))
       sscanf(line,"%d",&atom->nimpropertypes);
 
     else if (strstr(line,"extra bond per atom"))
       sscanf(line,"%d",&atom->extra_bond_per_atom);
 
-    else if (strstr(line,"xlo xhi")) 
+    else if (strstr(line,"xlo xhi"))
       sscanf(line,"%lg %lg",&domain->boxlo[0],&domain->boxhi[0]);
-    else if (strstr(line,"ylo yhi")) 
+    else if (strstr(line,"ylo yhi"))
       sscanf(line,"%lg %lg",&domain->boxlo[1],&domain->boxhi[1]);
-    else if (strstr(line,"zlo zhi")) 
+    else if (strstr(line,"zlo zhi"))
       sscanf(line,"%lg %lg",&domain->boxlo[2],&domain->boxhi[2]);
     else if (strstr(line,"xy xz yz")) {
       domain->triclinic = 1;
@@ -507,16 +507,16 @@ void ReadData::header(int flag)
 
   // error check on consistency of header values
 
-  if ((atom->nbonds || atom->nbondtypes) && 
+  if ((atom->nbonds || atom->nbondtypes) &&
       atom->avec->bonds_allow == 0 && me == 0)
     error->one(FLERR,"No bonds allowed with this atom style");
-  if ((atom->nangles || atom->nangletypes) && 
+  if ((atom->nangles || atom->nangletypes) &&
       atom->avec->angles_allow == 0 && me == 0)
     error->one(FLERR,"No angles allowed with this atom style");
-  if ((atom->ndihedrals || atom->ndihedraltypes) && 
+  if ((atom->ndihedrals || atom->ndihedraltypes) &&
       atom->avec->dihedrals_allow == 0 && me == 0)
     error->one(FLERR,"No dihedrals allowed with this atom style");
-  if ((atom->nimpropers || atom->nimpropertypes) && 
+  if ((atom->nimpropers || atom->nimpropertypes) &&
       atom->avec->impropers_allow == 0 && me == 0)
     error->one(FLERR,"No impropers allowed with this atom style");
 
@@ -537,7 +537,7 @@ void ReadData::header(int flag)
 void ReadData::atoms()
 {
   int i,m,nchunk;
-  
+
   bigint nread = 0;
   bigint natoms = atom->natoms;
 
@@ -548,9 +548,9 @@ void ReadData::atoms()
       char *eof;
       m = 0;
       for (i = 0; i < nchunk; i++) {
-	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	m += strlen(&buffer[m]);
+        eof = fgets(&buffer[m],MAXLINE,fp);
+        if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+        m += strlen(&buffer[m]);
       }
       m++;
     }
@@ -571,14 +571,14 @@ void ReadData::atoms()
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " atoms\n",natoms);
   }
 
-  if (natoms != atom->natoms) 
+  if (natoms != atom->natoms)
     error->all(FLERR,"Did not assign all atoms correctly");
-  
+
   // if any atom ID < 0, error
   // if all atom IDs = 0, tag_enable = 0
   // if any atom ID > 0, error if any atom ID == 0
   // not checking if atom IDs > natoms or are unique
-  
+
   int nlocal = atom->nlocal;
   int *tag = atom->tag;
 
@@ -615,7 +615,7 @@ void ReadData::atoms()
 
 /* ----------------------------------------------------------------------
    read all velocities
-   to find atoms, must build atom map if not a molecular system 
+   to find atoms, must build atom map if not a molecular system
 ------------------------------------------------------------------------- */
 
 void ReadData::velocities()
@@ -640,9 +640,9 @@ void ReadData::velocities()
       char *eof;
       m = 0;
       for (i = 0; i < nchunk; i++) {
-	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	m += strlen(&buffer[m]);
+        eof = fgets(&buffer[m],MAXLINE,fp);
+        if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+        m += strlen(&buffer[m]);
       }
       m++;
     }
@@ -666,7 +666,7 @@ void ReadData::velocities()
 
 /* ----------------------------------------------------------------------
    read all bonus data
-   to find atoms, must build atom map if not a molecular system 
+   to find atoms, must build atom map if not a molecular system
 ------------------------------------------------------------------------- */
 
 void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type)
@@ -691,9 +691,9 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type)
       char *eof;
       m = 0;
       for (i = 0; i < nchunk; i++) {
-	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	m += strlen(&buffer[m]);
+        eof = fgets(&buffer[m],MAXLINE,fp);
+        if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+        m += strlen(&buffer[m]);
       }
       m++;
     }
@@ -730,9 +730,9 @@ void ReadData::bonds()
       char *eof;
       m = 0;
       for (i = 0; i < nchunk; i++) {
-	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	m += strlen(&buffer[m]);
+        eof = fgets(&buffer[m],MAXLINE,fp);
+        if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+        m += strlen(&buffer[m]);
       }
       m++;
     }
@@ -757,7 +757,7 @@ void ReadData::bonds()
     if (screen) fprintf(screen,"  " BIGINT_FORMAT " bonds\n",sum/factor);
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " bonds\n",sum/factor);
   }
-  if (sum != factor*atom->nbonds) 
+  if (sum != factor*atom->nbonds)
     error->all(FLERR,"Bonds assigned incorrectly");
 }
 
@@ -776,9 +776,9 @@ void ReadData::angles()
       char *eof;
       m = 0;
       for (i = 0; i < nchunk; i++) {
-	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	m += strlen(&buffer[m]);
+        eof = fgets(&buffer[m],MAXLINE,fp);
+        if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+        m += strlen(&buffer[m]);
       }
       m++;
     }
@@ -803,7 +803,7 @@ void ReadData::angles()
     if (screen) fprintf(screen,"  " BIGINT_FORMAT " angles\n",sum/factor);
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " angles\n",sum/factor);
   }
-  if (sum != factor*atom->nangles) 
+  if (sum != factor*atom->nangles)
     error->all(FLERR,"Angles assigned incorrectly");
 }
 
@@ -822,9 +822,9 @@ void ReadData::dihedrals()
       char *eof;
       m = 0;
       for (i = 0; i < nchunk; i++) {
-	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	m += strlen(&buffer[m]);
+        eof = fgets(&buffer[m],MAXLINE,fp);
+        if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+        m += strlen(&buffer[m]);
       }
       m++;
     }
@@ -849,7 +849,7 @@ void ReadData::dihedrals()
     if (screen) fprintf(screen,"  " BIGINT_FORMAT " dihedrals\n",sum/factor);
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " dihedrals\n",sum/factor);
   }
-  if (sum != factor*atom->ndihedrals) 
+  if (sum != factor*atom->ndihedrals)
     error->all(FLERR,"Dihedrals assigned incorrectly");
 }
 
@@ -868,9 +868,9 @@ void ReadData::impropers()
       char *eof;
       m = 0;
       for (i = 0; i < nchunk; i++) {
-	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	m += strlen(&buffer[m]);
+        eof = fgets(&buffer[m],MAXLINE,fp);
+        if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+        m += strlen(&buffer[m]);
       }
       m++;
     }
@@ -895,7 +895,7 @@ void ReadData::impropers()
     if (screen) fprintf(screen,"  " BIGINT_FORMAT " impropers\n",sum/factor);
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " impropers\n",sum/factor);
   }
-  if (sum != factor*atom->nimpropers) 
+  if (sum != factor*atom->nimpropers)
     error->all(FLERR,"Impropers assigned incorrectly");
 }
 
@@ -1109,9 +1109,9 @@ void ReadData::fix(int ifix, char *line, bigint nlines)
       char *eof;
       m = 0;
       for (i = 0; i < nchunk; i++) {
-	eof = fgets(&buffer[m],MAXLINE,fp);
-	if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	m += strlen(&buffer[m]);
+        eof = fgets(&buffer[m],MAXLINE,fp);
+        if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+        m += strlen(&buffer[m]);
       }
       m++;
     }
@@ -1124,11 +1124,11 @@ void ReadData::fix(int ifix, char *line, bigint nlines)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 scans the data file for topology maximums 
+   proc 0 scans the data file for topology maximums
 ------------------------------------------------------------------------- */
 
 void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
-		    int &dihedral_per_atom, int &improper_per_atom)
+                    int &dihedral_per_atom, int &improper_per_atom)
 {
   int i,tmp1,tmp2,atom1,atom2,atom3,atom4;
   char *eof;
@@ -1160,14 +1160,14 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
 
     if (nfix) {
       for (i = 0; i < nfix; i++) {
-	printf("LINE SECTION %s %s\n",line,fix_section[i]);
-	if (strstr(line,fix_section[i])) {
-	  int n = modify->fix[fix_index[i]]->read_data_skip_lines(keyword);
-	  printf("NLINES SKIP %d\n",n);
-	  skip_lines(n);
-	  parse_keyword(0,0);
-	  break;
-	}
+        printf("LINE SECTION %s %s\n",line,fix_section[i]);
+        if (strstr(line,fix_section[i])) {
+          int n = modify->fix[fix_index[i]]->read_data_skip_lines(keyword);
+          printf("NLINES SKIP %d\n",n);
+          skip_lines(n);
+          parse_keyword(0,0);
+          break;
+        }
       }
       if (i < nfix) continue;
     }
@@ -1177,8 +1177,8 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
     else if (strcmp(keyword,"Velocities") == 0) skip_lines(natoms);
 
     else if (strcmp(keyword,"Ellipsoids") == 0) {
-      if (!avec_ellipsoid) 
-	error->one(FLERR,"Invalid data file section: Ellipsoids");
+      if (!avec_ellipsoid)
+        error->one(FLERR,"Invalid data file section: Ellipsoids");
       ellipsoid_flag = 1;
       skip_lines(nellipsoids);
     } else if (strcmp(keyword,"Lines") == 0) {
@@ -1191,109 +1191,109 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
       skip_lines(ntris);
 
     } else if (strcmp(keyword,"Pair Coeffs") == 0) {
-      if (force->pair == NULL) 
-	error->one(FLERR,"Must define pair_style before Pair Coeffs");
+      if (force->pair == NULL)
+        error->one(FLERR,"Must define pair_style before Pair Coeffs");
       skip_lines(atom->ntypes);
     } else if (strcmp(keyword,"Bond Coeffs") == 0) {
-      if (atom->avec->bonds_allow == 0) 
-	error->one(FLERR,"Invalid data file section: Bond Coeffs");
-      if (force->bond == NULL) 
-	error->one(FLERR,"Must define bond_style before Bond Coeffs");
+      if (atom->avec->bonds_allow == 0)
+        error->one(FLERR,"Invalid data file section: Bond Coeffs");
+      if (force->bond == NULL)
+        error->one(FLERR,"Must define bond_style before Bond Coeffs");
       skip_lines(atom->nbondtypes);
     } else if (strcmp(keyword,"Angle Coeffs") == 0) {
-      if (atom->avec->angles_allow == 0) 
-	error->one(FLERR,"Invalid data file section: Angle Coeffs");
-      if (force->angle == NULL) 
-	error->one(FLERR,"Must define angle_style before Angle Coeffs");
+      if (atom->avec->angles_allow == 0)
+        error->one(FLERR,"Invalid data file section: Angle Coeffs");
+      if (force->angle == NULL)
+        error->one(FLERR,"Must define angle_style before Angle Coeffs");
       skip_lines(atom->nangletypes);
     } else if (strcmp(keyword,"Dihedral Coeffs") == 0) {
       skip_lines(atom->ndihedraltypes);
-      if (atom->avec->dihedrals_allow == 0) 
-	error->one(FLERR,"Invalid data file section: Dihedral Coeffs");
-      if (force->dihedral == NULL) 
-	error->one(FLERR,"Must define dihedral_style before Dihedral Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->one(FLERR,"Invalid data file section: Dihedral Coeffs");
+      if (force->dihedral == NULL)
+        error->one(FLERR,"Must define dihedral_style before Dihedral Coeffs");
     }  else if (strcmp(keyword,"Improper Coeffs") == 0) {
-      if (atom->avec->impropers_allow == 0) 
-	error->one(FLERR,"Invalid data file section: Improper Coeffs");
-      if (force->improper == NULL) 
-	error->one(FLERR,"Must define improper_style before Improper Coeffs");
+      if (atom->avec->impropers_allow == 0)
+        error->one(FLERR,"Invalid data file section: Improper Coeffs");
+      if (force->improper == NULL)
+        error->one(FLERR,"Must define improper_style before Improper Coeffs");
       skip_lines(atom->nimpropertypes);
 
     } else if (strcmp(keyword,"BondBond Coeffs") == 0) {
-      if (atom->avec->angles_allow == 0) 
-	error->one(FLERR,"Invalid data file section: BondBond Coeffs");
-      if (force->angle == NULL) 
-	error->one(FLERR,"Must define angle_style before BondBond Coeffs");
+      if (atom->avec->angles_allow == 0)
+        error->one(FLERR,"Invalid data file section: BondBond Coeffs");
+      if (force->angle == NULL)
+        error->one(FLERR,"Must define angle_style before BondBond Coeffs");
       skip_lines(atom->nangletypes);
     } else if (strcmp(keyword,"BondAngle Coeffs") == 0) {
-      if (atom->avec->angles_allow == 0) 
-	error->one(FLERR,"Invalid data file section: BondAngle Coeffs");
-      if (force->angle == NULL) 
-	error->one(FLERR,"Must define angle_style before BondAngle Coeffs");
+      if (atom->avec->angles_allow == 0)
+        error->one(FLERR,"Invalid data file section: BondAngle Coeffs");
+      if (force->angle == NULL)
+        error->one(FLERR,"Must define angle_style before BondAngle Coeffs");
       skip_lines(atom->nangletypes);
     } else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) {
-      if (atom->avec->dihedrals_allow == 0) 
-	error->one(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
-      if (force->dihedral == NULL) 
-	error->one(FLERR,
-		   "Must define dihedral_style before "
-		   "MiddleBondTorsion Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->one(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
+      if (force->dihedral == NULL)
+        error->one(FLERR,
+                   "Must define dihedral_style before "
+                   "MiddleBondTorsion Coeffs");
       skip_lines(atom->ndihedraltypes);
     } else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
-      if (atom->avec->dihedrals_allow == 0) 
-	error->one(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
-      if (force->dihedral == NULL) 
-	error->one(FLERR,
-		   "Must define dihedral_style before EndBondTorsion Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->one(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
+      if (force->dihedral == NULL)
+        error->one(FLERR,
+                   "Must define dihedral_style before EndBondTorsion Coeffs");
       skip_lines(atom->ndihedraltypes);
     } else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
-      if (atom->avec->dihedrals_allow == 0) 
-	error->one(FLERR,"Invalid data file section: AngleTorsion Coeffs");
-      if (force->dihedral == NULL) 
-	error->one(FLERR,
-		   "Must define dihedral_style before AngleTorsion Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->one(FLERR,"Invalid data file section: AngleTorsion Coeffs");
+      if (force->dihedral == NULL)
+        error->one(FLERR,
+                   "Must define dihedral_style before AngleTorsion Coeffs");
       skip_lines(atom->ndihedraltypes);
     } else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
-      if (atom->avec->dihedrals_allow == 0) 
-	error->one(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
-      if (force->dihedral == NULL) 
-	error->one(FLERR,
-		   "Must define dihedral_style before "
-		   "AngleAngleTorsion Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->one(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
+      if (force->dihedral == NULL)
+        error->one(FLERR,
+                   "Must define dihedral_style before "
+                   "AngleAngleTorsion Coeffs");
       skip_lines(atom->ndihedraltypes);
     } else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
-      if (atom->avec->dihedrals_allow == 0) 
-	error->one(FLERR,"Invalid data file section: BondBond13 Coeffs");
-      if (force->dihedral == NULL) 
-	error->one(FLERR,"Must define dihedral_style before BondBond13 Coeffs");
+      if (atom->avec->dihedrals_allow == 0)
+        error->one(FLERR,"Invalid data file section: BondBond13 Coeffs");
+      if (force->dihedral == NULL)
+        error->one(FLERR,"Must define dihedral_style before BondBond13 Coeffs");
       skip_lines(atom->ndihedraltypes);
     } else if (strcmp(keyword,"AngleAngle Coeffs") == 0) {
-      if (atom->avec->impropers_allow == 0) 
-	error->one(FLERR,"Invalid data file section: AngleAngle Coeffs");
-      if (force->improper == NULL) 
-	error->one(FLERR,"Must define improper_style before AngleAngle Coeffs");
+      if (atom->avec->impropers_allow == 0)
+        error->one(FLERR,"Invalid data file section: AngleAngle Coeffs");
+      if (force->improper == NULL)
+        error->one(FLERR,"Must define improper_style before AngleAngle Coeffs");
       skip_lines(atom->nimpropertypes);
 
     } else if (strcmp(keyword,"Bonds") == 0) {
       for (i = 1; i < cmax; i++) count[i] = 0;
       if (force->newton_bond)
-	for (i = 0; i < atom->nbonds; i++) {
-	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	  sscanf(line,"%d %d %d %d",&tmp1,&tmp2,&atom1,&atom2);
-	  if (atom1 >= cmax) cmax = reallocate(&count,cmax,atom1);
-	  count[atom1]++;
-	}
+        for (i = 0; i < atom->nbonds; i++) {
+          eof = fgets(line,MAXLINE,fp);
+          if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+          sscanf(line,"%d %d %d %d",&tmp1,&tmp2,&atom1,&atom2);
+          if (atom1 >= cmax) cmax = reallocate(&count,cmax,atom1);
+          count[atom1]++;
+        }
       else
-	for (i = 0; i < atom->nbonds; i++) {
-	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	  sscanf(line,"%d %d %d %d",&tmp1,&tmp2,&atom1,&atom2);
-	  int amax = MAX(atom1,atom2);
-	  if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
-	  count[atom1]++;
-	  count[atom2]++;
-	}
+        for (i = 0; i < atom->nbonds; i++) {
+          eof = fgets(line,MAXLINE,fp);
+          if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+          sscanf(line,"%d %d %d %d",&tmp1,&tmp2,&atom1,&atom2);
+          int amax = MAX(atom1,atom2);
+          if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
+          count[atom1]++;
+          count[atom2]++;
+        }
       for (i = 1; i < cmax; i++) bond_per_atom = MAX(bond_per_atom,count[i]);
       if (screen) fprintf(screen,"  %d = max bonds/atom\n",bond_per_atom);
       if (logfile) fprintf(logfile,"  %d = max bonds/atom\n",bond_per_atom);
@@ -1301,25 +1301,25 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
     } else if (strcmp(keyword,"Angles") == 0) {
       for (i = 1; i < cmax; i++) count[i] = 0;
       if (force->newton_bond)
-	for (i = 0; i < atom->nangles; i++) {
-	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	  sscanf(line,"%d %d %d %d %d",&tmp1,&tmp2,&atom1,&atom2,&atom3);
-	  if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
-	  count[atom2]++;
-	}
+        for (i = 0; i < atom->nangles; i++) {
+          eof = fgets(line,MAXLINE,fp);
+          if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+          sscanf(line,"%d %d %d %d %d",&tmp1,&tmp2,&atom1,&atom2,&atom3);
+          if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
+          count[atom2]++;
+        }
       else
-	for (i = 0; i < atom->nangles; i++) {
-	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	  sscanf(line,"%d %d %d %d %d",&tmp1,&tmp2,&atom1,&atom2,&atom3);
-	  int amax = MAX(atom1,atom2);
-	  amax = MAX(amax,atom3);
-	  if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
-	  count[atom1]++;
-	  count[atom2]++;
-	  count[atom3]++;
-	}
+        for (i = 0; i < atom->nangles; i++) {
+          eof = fgets(line,MAXLINE,fp);
+          if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+          sscanf(line,"%d %d %d %d %d",&tmp1,&tmp2,&atom1,&atom2,&atom3);
+          int amax = MAX(atom1,atom2);
+          amax = MAX(amax,atom3);
+          if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
+          count[atom1]++;
+          count[atom2]++;
+          count[atom3]++;
+        }
       for (i = 1; i < cmax; i++) angle_per_atom = MAX(angle_per_atom,count[i]);
       if (screen) fprintf(screen,"  %d = max angles/atom\n",angle_per_atom);
       if (logfile) fprintf(logfile,"  %d = max angles/atom\n",angle_per_atom);
@@ -1327,68 +1327,68 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
     } else if (strcmp(keyword,"Dihedrals") == 0) {
       for (i = 1; i < cmax; i++) count[i] = 0;
       if (force->newton_bond)
-	for (i = 0; i < atom->ndihedrals; i++) {
-	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	  sscanf(line,"%d %d %d %d %d %d",
-		 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
-	  if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
-	  count[atom2]++;
-	}
+        for (i = 0; i < atom->ndihedrals; i++) {
+          eof = fgets(line,MAXLINE,fp);
+          if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+          sscanf(line,"%d %d %d %d %d %d",
+                 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
+          if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
+          count[atom2]++;
+        }
       else
-	for (i = 0; i < atom->ndihedrals; i++) {
-	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	  sscanf(line,"%d %d %d %d %d %d",
-		 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
-	  int amax = MAX(atom1,atom2);
-	  amax = MAX(amax,atom3);
-	  amax = MAX(amax,atom4);
-	  if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
-	  count[atom1]++;
-	  count[atom2]++;
-	  count[atom3]++;
-	  count[atom4]++;
-	}
-      for (i = 1; i < cmax; i++) 
-	dihedral_per_atom = MAX(dihedral_per_atom,count[i]);
-      if (screen) 
-	fprintf(screen,"  %d = max dihedrals/atom\n",dihedral_per_atom);
-      if (logfile) 
-	fprintf(logfile,"  %d = max dihedrals/atom\n",dihedral_per_atom);
+        for (i = 0; i < atom->ndihedrals; i++) {
+          eof = fgets(line,MAXLINE,fp);
+          if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+          sscanf(line,"%d %d %d %d %d %d",
+                 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
+          int amax = MAX(atom1,atom2);
+          amax = MAX(amax,atom3);
+          amax = MAX(amax,atom4);
+          if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
+          count[atom1]++;
+          count[atom2]++;
+          count[atom3]++;
+          count[atom4]++;
+        }
+      for (i = 1; i < cmax; i++)
+        dihedral_per_atom = MAX(dihedral_per_atom,count[i]);
+      if (screen)
+        fprintf(screen,"  %d = max dihedrals/atom\n",dihedral_per_atom);
+      if (logfile)
+        fprintf(logfile,"  %d = max dihedrals/atom\n",dihedral_per_atom);
 
     } else if (strcmp(keyword,"Impropers") == 0) {
       for (i = 1; i < cmax; i++) count[i] = 0;
       if (force->newton_bond)
-	for (i = 0; i < atom->nimpropers; i++) {
-	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	  sscanf(line,"%d %d %d %d %d %d",
-		 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
-	  if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
-	  count[atom2]++;
-	}
+        for (i = 0; i < atom->nimpropers; i++) {
+          eof = fgets(line,MAXLINE,fp);
+          if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+          sscanf(line,"%d %d %d %d %d %d",
+                 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
+          if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
+          count[atom2]++;
+        }
       else
-	for (i = 0; i < atom->nimpropers; i++) {
-	  eof = fgets(line,MAXLINE,fp);
-	  if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
-	  sscanf(line,"%d %d %d %d %d %d",
-		 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
-	  int amax = MAX(atom1,atom2);
-	  amax = MAX(amax,atom3);
-	  amax = MAX(amax,atom4);
-	  if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
-	  count[atom1]++;
-	  count[atom2]++;
-	  count[atom3]++;
-	  count[atom4]++;
-	}
+        for (i = 0; i < atom->nimpropers; i++) {
+          eof = fgets(line,MAXLINE,fp);
+          if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
+          sscanf(line,"%d %d %d %d %d %d",
+                 &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
+          int amax = MAX(atom1,atom2);
+          amax = MAX(amax,atom3);
+          amax = MAX(amax,atom4);
+          if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
+          count[atom1]++;
+          count[atom2]++;
+          count[atom3]++;
+          count[atom4]++;
+        }
       for (i = 1; i < cmax; i++)
-	improper_per_atom = MAX(improper_per_atom,count[i]);
-      if (screen) 
-	fprintf(screen,"  %d = max impropers/atom\n",improper_per_atom);
-      if (logfile) 
-	fprintf(logfile,"  %d = max impropers/atom\n",improper_per_atom);
+        improper_per_atom = MAX(improper_per_atom,count[i]);
+      if (screen)
+        fprintf(screen,"  %d = max impropers/atom\n",improper_per_atom);
+      if (logfile)
+        fprintf(logfile,"  %d = max impropers/atom\n",improper_per_atom);
 
     } else {
       char str[128];
@@ -1408,7 +1408,7 @@ void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
   if ((atom->nbonds && !bond_per_atom) ||
       (atom->nangles && !angle_per_atom) ||
       (atom->ndihedrals && !dihedral_per_atom) ||
-      (atom->nimpropers && !improper_per_atom)) 
+      (atom->nimpropers && !improper_per_atom))
     error->one(FLERR,"Needed topology not in data file");
 
   // customize for new sections
@@ -1513,8 +1513,8 @@ void ReadData::parse_keyword(int first, int flag)
 
   int start = strspn(line," \t\n\r");
   int stop = strlen(line) - 1;
-  while (line[stop] == ' ' || line[stop] == '\t' 
-	 || line[stop] == '\n' || line[stop] == '\r') stop--;
+  while (line[stop] == ' ' || line[stop] == '\t'
+         || line[stop] == '\n' || line[stop] == '\r') stop--;
   line[stop+1] = '\0';
   strcpy(keyword,&line[start]);
 }
@@ -1550,8 +1550,8 @@ void ReadData::parse_coeffs(char *line, const char *addstr, int dupflag)
   while (word) {
     if (narg == maxarg) {
       maxarg += DELTA;
-      arg = (char **) 
-	memory->srealloc(arg,maxarg*sizeof(char *),"read_data:arg");
+      arg = (char **)
+        memory->srealloc(arg,maxarg*sizeof(char *),"read_data:arg");
     }
     if (addstr && narg == 1 && !islower(word[0])) arg[narg++] = (char *) addstr;
     arg[narg++] = word;
diff --git a/src/read_data.h b/src/read_data.h
index f3edaf4423..169a4cd54a 100644
--- a/src/read_data.h
+++ b/src/read_data.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/read_dump.cpp b/src/read_dump.cpp
index 1b1434c3b4..128902e76c 100644
--- a/src/read_dump.cpp
+++ b/src/read_dump.cpp
@@ -12,7 +12,7 @@
 ------------------------------------------------------------------------- */
 
 /* ----------------------------------------------------------------------
-   Contributing author: Timothy Sirk (U Vermont)
+   Contributing author: Timothy Sirk (ARL)
 ------------------------------------------------------------------------- */
 
 #include "lmptype.h"
@@ -45,6 +45,38 @@ ReadDump::ReadDump(LAMMPS *lmp) : Pointers(lmp)
 {
   MPI_Comm_rank(world,&me);
   MPI_Comm_size(world,&nprocs);
+
+  dimension = domain->dimension;
+  triclinic = domain->triclinic;
+
+  nfiles = 0;
+  files = NULL;
+
+  nfield = 0;
+  fieldtype = NULL;
+  fieldlabel = NULL;
+  fields = NULL;
+  uflag = ucflag = ucflag_all = NULL;
+
+  reader = NULL;
+}
+
+/* ---------------------------------------------------------------------- */
+
+ReadDump::~ReadDump()
+{
+  for (int i = 0; i < nfiles; i++) delete [] files[i];
+  delete [] files;
+  for (int i = 0; i < nfield; i++) delete [] fieldlabel[i];
+  delete [] fieldlabel;
+  delete [] fieldtype;
+
+  memory->destroy(fields);
+  memory->destroy(uflag);
+  memory->destroy(ucflag);
+  memory->destroy(ucflag_all);
+
+  delete reader;
 }
 
 /* ---------------------------------------------------------------------- */
@@ -53,168 +85,200 @@ void ReadDump::command(int narg, char **arg)
 {
   if (narg < 2) error->all(FLERR,"Illegal read_dump command");
 
-  nstep = ATOBIGINT(arg[1]);
+  store_files(1,&arg[0]);
+  bigint nstep = ATOBIGINT(arg[1]);
+  fields_and_keywords(narg-2,&arg[2]);
+  setup_reader();
 
-  // per-field vectors
+  // find the snapshot and read/bcast/process header info
 
-  int firstfield = 2;
-  fieldtype = new int[narg];
-  fieldlabel = new char*[narg];
+  if (me == 0 && screen) fprintf(screen,"Scanning dump file ...\n");
 
-  // scan ahead to see if "add yes" keyword/value is used
-  // requires extra "type" field from from dump file
-  // add id and type fields as needed
+  bigint ntimestep = seek(nstep,1);
+  if (ntimestep < 0)
+    error->all(FLERR,"Dump file does not contain requested snapshot");
+  header(1);
 
-  int iarg;
-  for (iarg = firstfield; iarg < narg; iarg++)
-    if (strcmp(arg[iarg],"add") == 0)
-      if (iarg < narg-1 && strcmp(arg[iarg+1],"yes") == 0) break;
+  // reset timestep to nstep
 
-  nfield = 0;
-  fieldtype[nfield++] = ID;
-  if (iarg < narg) fieldtype[nfield++] = TYPE;
+  update->reset_timestep(nstep);
 
-  // parse fields
+  // counters
 
-  iarg = firstfield;
-  while (iarg < narg) {
-    if (strcmp(arg[iarg],"x") == 0) fieldtype[nfield++] = X;
-    else if (strcmp(arg[iarg],"y") == 0) fieldtype[nfield++] = Y;
-    else if (strcmp(arg[iarg],"z") == 0) fieldtype[nfield++] = Z;
-    else if (strcmp(arg[iarg],"vx") == 0) fieldtype[nfield++] = VX;
-    else if (strcmp(arg[iarg],"vy") == 0) fieldtype[nfield++] = VY;
-    else if (strcmp(arg[iarg],"vz") == 0) fieldtype[nfield++] = VZ;
-    else if (strcmp(arg[iarg],"ix") == 0) fieldtype[nfield++] = IX;
-    else if (strcmp(arg[iarg],"iy") == 0) fieldtype[nfield++] = IY;
-    else if (strcmp(arg[iarg],"iz") == 0) fieldtype[nfield++] = IZ;
-    else break;
-    iarg++;
-  }
+  // read in the snapshot and reset system
 
-  dimension = domain->dimension;
-  triclinic = domain->triclinic;
+  if (me == 0 && screen)
+    fprintf(screen,"Reading snapshot from dump file ...\n");
 
-  if (fieldtype[nfield-1] == ID || fieldtype[nfield-1] == TYPE)
-    error->all(FLERR,"Illegal read_dump command");
+  bigint natoms_prev = atom->natoms;
+  atoms();
 
-  if (dimension == 2) {
-    for (int i = 0; i < nfield; i++)
-      if (fieldtype[i] == Z || fieldtype[i] == VZ || fieldtype[i] == IZ)
-	error->all(FLERR,"Illegal read_dump command");
-  }
+  // NOTE: this logic is not yet right
+  if (me == 0) close();
 
-  for (int i = 0; i < nfield; i++)
-    for (int j = i+1; j < nfield; j++)
-      if (fieldtype[i] == fieldtype[j])
-	error->all(FLERR,"Duplicate fields in read_dump command");
+  // print out stats
 
-  // parse optional args
+  bigint npurge_all,nreplace_all,ntrim_all,nadd_all;
 
-  boxflag = 1;
-  replaceflag = 1;
-  purgeflag = 0;
-  trimflag = 0;
-  addflag = 0;
-  for (int i = 0; i < nfield; i++) fieldlabel[i] = NULL;
-  scaledflag = UNSCALED;
-  format = NATIVE;
+  bigint tmp;
+  tmp = npurge;
+  MPI_Allreduce(&tmp,&npurge_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
+  tmp = nreplace;
+  MPI_Allreduce(&tmp,&nreplace_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
+  tmp = ntrim;
+  MPI_Allreduce(&tmp,&ntrim_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
+  tmp = nadd;
+  MPI_Allreduce(&tmp,&nadd_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
 
-  while (iarg < narg) {
-    if (strcmp(arg[iarg],"box") == 0) {
-      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
-      if (strcmp(arg[iarg+1],"yes") == 0) boxflag = 1;
-      else if (strcmp(arg[iarg+1],"no") == 0) boxflag = 0;
-      else error->all(FLERR,"Illegal read_dump command");
-      iarg += 2;
-    } else if (strcmp(arg[iarg],"replace") == 0) {
-      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
-      if (strcmp(arg[iarg+1],"yes") == 0) replaceflag = 1;
-      else if (strcmp(arg[iarg+1],"no") == 0) replaceflag = 0;
-      else error->all(FLERR,"Illegal read_dump command");
-      iarg += 2;
-    } else if (strcmp(arg[iarg],"purge") == 0) {
-      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
-      if (strcmp(arg[iarg+1],"yes") == 0) purgeflag = 1;
-      else if (strcmp(arg[iarg+1],"no") == 0) purgeflag = 0;
-      else error->all(FLERR,"Illegal read_dump command");
-      iarg += 2;
-    } else if (strcmp(arg[iarg],"trim") == 0) {
-      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
-      if (strcmp(arg[iarg+1],"yes") == 0) trimflag = 1;
-      else if (strcmp(arg[iarg+1],"no") == 0) trimflag = 0;
-      else error->all(FLERR,"Illegal read_dump command");
-      iarg += 2;
-    } else if (strcmp(arg[iarg],"add") == 0) {
-      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
-      if (strcmp(arg[iarg+1],"yes") == 0) addflag = 1;
-      else if (strcmp(arg[iarg+1],"no") == 0) addflag = 0;
-      else error->all(FLERR,"Illegal read_dump command");
-      iarg += 2;
-    } else if (strcmp(arg[iarg],"label") == 0) {
-      if (iarg+3 > narg) error->all(FLERR,"Illegal read_dump command");
-      int i;
-      for (i = 0; i < nfield; i++)
-	if (strcmp(arg[firstfield+i],arg[iarg+1]) == 0) break;
-      if (i == nfield) error->all(FLERR,"Illegal read_dump command");
-      fieldlabel[i] = arg[iarg+2];
-      iarg += 3;
-    } else if (strcmp(arg[iarg],"scaled") == 0) {
-      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
-      if (strcmp(arg[iarg+1],"yes") == 0) scaledflag = SCALED;
-      else if (strcmp(arg[iarg+1],"no") == 0) scaledflag = UNSCALED;
-      else error->all(FLERR,"Illegal read_dump command");
-      iarg += 2;
-    } else if (strcmp(arg[iarg],"format") == 0) {
-      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
-      if (strcmp(arg[iarg+1],"native") == 0) format = NATIVE;
-      else error->all(FLERR,"Illegal read_dump command");
-      iarg += 2;
-    } else error->all(FLERR,"Illegal read_dump command");
+  domain->print_box("  ");
+
+  if (me == 0) {
+    if (screen) {
+      fprintf(screen,"  " BIGINT_FORMAT " atoms before read\n",natoms_prev);
+      fprintf(screen,"  " BIGINT_FORMAT " atoms in snapshot\n",nsnapatoms);
+      fprintf(screen,"  " BIGINT_FORMAT " atoms purged\n",npurge_all);
+      fprintf(screen,"  " BIGINT_FORMAT " atoms replaced\n",nreplace_all);
+      fprintf(screen,"  " BIGINT_FORMAT " atoms trimmed\n",ntrim_all);
+      fprintf(screen,"  " BIGINT_FORMAT " atoms added\n",nadd_all);
+      fprintf(screen,"  " BIGINT_FORMAT " atoms after read\n",atom->natoms);
+    }
+    if (logfile) {
+      fprintf(logfile,"  " BIGINT_FORMAT " atoms before read\n",natoms_prev);
+      fprintf(logfile,"  " BIGINT_FORMAT " atoms in snapshot\n",nsnapatoms);
+      fprintf(logfile,"  " BIGINT_FORMAT " atoms purged\n",npurge_all);
+      fprintf(logfile,"  " BIGINT_FORMAT " atoms replaced\n",nreplace_all);
+      fprintf(logfile,"  " BIGINT_FORMAT " atoms trimmed\n",ntrim_all);
+      fprintf(logfile,"  " BIGINT_FORMAT " atoms added\n",nadd_all);
+      fprintf(logfile,"  " BIGINT_FORMAT " atoms after read\n",atom->natoms);
+    }
   }
+}
 
-  if (purgeflag && (replaceflag || trimflag))
-    error->all(FLERR,"If read_dump purges it cannot replace or trim");
+/* ---------------------------------------------------------------------- */
 
-  // allocate snapshot field buffer
+void ReadDump::store_files(int nstr, char **str)
+{
+  nfiles = nstr;
+  files = new char*[nfiles];
 
-  memory->create(fields,CHUNK,nfield,"read_dump:fields");
+  for (int i = 0; i < nfiles; i++) {
+    int n = strlen(str[i]) + 1;
+    files[i] = new char[n];
+    strcpy(files[i],str[i]);
+  }
+}
+
+/* ---------------------------------------------------------------------- */
 
+void ReadDump::setup_reader()
+{
   // create reader class
   // could make this a parent class and customize with other readers
 
   if (format == NATIVE) reader = new ReadDumpNative(lmp);
 
-  // proc 0 opens dump file and scans to correct snapshot
-  // after scan these values are set, so Bcast them:
-  // nsnapatoms, box[3][3], scaled
-  // NOTE: fieldlabel is just ptrs to input args in read_dump command
-  //       will not persist if want to use labels in rerun() command
+  // allocate snapshot field buffer
+
+  memory->create(fields,CHUNK,nfield,"read_dump:fields");
+}
+
+/* ----------------------------------------------------------------------
+   seek Nrequest timestep in one or more dump files
+   Nrequest can be a timestamp or -1 to match first step with exact = 0
+   if exact = 1, must find exactly Nrequest
+   if exact = 0, find first step >= Nrequest
+   return matching ntimestep or -1 if did not find a match
+------------------------------------------------------------------------- */
+
+bigint ReadDump::seek(bigint nrequest, int exact)
+{
+  int ifile,eofflag;
+  bigint ntimestep;
 
   if (me == 0) {
-    if (screen) fprintf(screen,"Scanning dump file ...\n");
-    open(arg[0]);
-    reader->init(fp);
-    reader->scan(nstep,nfield,fieldtype,fieldlabel,scaledflag,
-		 nsnapatoms,box,scaled);
+    for (ifile = 0; ifile < nfiles; ifile++) {
+      ntimestep = -1;
+      open(files[ifile]);
+      reader->file(fp);
+      while (1) {
+        eofflag = reader->read_time(ntimestep);
+        if (eofflag) break;
+        if (ntimestep >= nrequest) break;
+        reader->skip();
+      }
+      if (ntimestep >= nrequest) break;
+      close();
+    }
+
+    currentfile = ifile;
+    if (ntimestep < nrequest) close();
+    if (ntimestep < nrequest) ntimestep = -1;
+    if (exact && ntimestep != nrequest) ntimestep = -1;
   }
 
-  MPI_Bcast(&nsnapatoms,1,MPI_LMP_BIGINT,0,world);
-  MPI_Bcast(&box[0][0],9,MPI_DOUBLE,0,world);
-  MPI_Bcast(&scaled,1,MPI_INT,0,world);
+  MPI_Bcast(&ntimestep,1,MPI_LMP_BIGINT,0,world);
+  return ntimestep;
+}
 
-  // for scaled coords and triclinic box:
-  // yindex,zindex = index of Y and Z fields
-  // already known to exist because checked in scan()
-  // needed for unscaling to absolute coords in xfield(), yfield(), zfield()
+/* ----------------------------------------------------------------------
+   find next matching snapshot in one or more dump files
+   Ncurrent = current timestep from last snapshot
+   Nstop = match no timestep bigger than Nstop
+   Nevery = only match timesteps that are a multiple of Nevery
+   Nskip = skip every this many timesteps
+   return matching ntimestep or -1 if did not find a match
+------------------------------------------------------------------------- */
 
-  if (scaled == SCALED && triclinic) {
-    for (int i = 0; i < nfield; i++) {
-      if (fieldtype[i] == Y) yindex = i;
-      if (fieldtype[i] == Z) zindex = i;
+bigint ReadDump::next(bigint ncurrent, bigint nstop, int nevery, int nskip)
+{
+  int ifile,eofflag;
+  bigint ntimestep;
+
+  // NOTE: this logic is not yet right
+
+  if (me == 0) {
+    for (ifile = currentfile; ifile < nfiles; ifile++) {
+      ntimestep = -1;
+      if (ifile != currentfile) open(files[ifile]);
+      reader->file(fp);
+      while (1) {
+        eofflag = reader->read_time(ntimestep);
+        if (eofflag) ntimestep = -1;
+        break;
+      }
+      if (ntimestep > ncurrent) break;
+      close();
     }
+
+    currentfile = ifile;
   }
 
-  // make local copy of snapshot box params
+  MPI_Bcast(&ntimestep,1,MPI_LMP_BIGINT,0,world);
+  return ntimestep;
+}
+
+/* ----------------------------------------------------------------------
+   read and broadcast and store snapshot header info
+   set nsnapatoms = # of atoms in snapshot
+   set yindex,zindex
+------------------------------------------------------------------------- */
+
+void ReadDump::header(int fieldinfo)
+{
+  int triclinic_snap;
+  int fieldflag,xflag,yflag,zflag;
+
+  if (me == 0)
+    nsnapatoms = reader->read_header(box,triclinic_snap,
+                                     fieldinfo,nfield,fieldtype,fieldlabel,
+                                     scaledflag,fieldflag,xflag,yflag,zflag);
+
+  MPI_Bcast(&nsnapatoms,1,MPI_LMP_BIGINT,0,world);
+  MPI_Bcast(&triclinic_snap,1,MPI_INT,0,world);
+  MPI_Bcast(&box[0][0],9,MPI_DOUBLE,0,world);
+
+  // local copy of snapshot box parameters
+  // used in xfield,yfield,zfield when converting dump atom to absolute coords
 
   xlo = box[0][0];
   xhi = box[0][1];
@@ -225,56 +289,68 @@ void ReadDump::command(int narg, char **arg)
   xprd = xhi - xlo;
   yprd = yhi - ylo;
   zprd = zhi - zlo;
-  if (triclinic) {
+  if (triclinic_snap) {
     xy = box[0][2];
     xz = box[1][2];
     yz = box[2][2];
   }
 
-  // reset timestep to nstep
+  // done if not checking fields
 
-  char *tstr[1];
-  char str[32];
-  sprintf(str,BIGINT_FORMAT,nstep);
-  tstr[0] = str;
-  update->reset_timestep(1,tstr);
+  if (!fieldinfo) return;
 
-  // reset simulation box from snapshot box parameters if requested
-  // do it now, so if adding atoms, procs will have correct sub-domains
-  // call domain->reset_box() later,
-  //   since can't shrink wrap until atom coords change and atoms are added
+  MPI_Bcast(&fieldflag,1,MPI_INT,0,world);
+  MPI_Bcast(&xflag,1,MPI_INT,0,world);
+  MPI_Bcast(&yflag,1,MPI_INT,0,world);
+  MPI_Bcast(&zflag,1,MPI_INT,0,world);
 
-  if (boxflag) {
-    domain->boxlo[0] = xlo;
-    domain->boxhi[0] = xhi;
-    domain->boxlo[1] = ylo;
-    domain->boxhi[1] = yhi;
-    if (dimension == 3) {
-      domain->boxlo[2] = zlo;
-      domain->boxhi[2] = zhi;
-    }
-    if (triclinic) {
-      domain->xy = xy;
-      if (dimension == 3) {
-	domain->xz = xz;
-	domain->yz = yz;
-      }
-    }
+  // error check on current vs new box and fields
 
-    domain->set_initial_box();
-    domain->set_global_box();
-    comm->set_proc_grid();
-    domain->set_local_box();
-  }
+  if ((triclinic_snap && !triclinic) ||
+      (!triclinic_snap && triclinic))
+    error->one(FLERR,"Read_dump triclinic status does not match simulation");
 
-  // read in the snapshot
+  // error check field and scaling info
 
-  if (me == 0)
-    if (screen) fprintf(screen,"Reading snapshot from dump file ...\n");
+  if (fieldflag < 0)
+    error->one(FLERR,"Read_dump field not found in dump file");
 
-  // counters
+  // set overall scaling of coordinates
+  // error if x,y,z scaling are not the same
+
+  scaled = MAX(xflag,yflag);
+  scaled = MAX(zflag,scaled);
+  if ((xflag != UNSET && xflag != scaled) ||
+      (yflag != UNSET && yflag != scaled) ||
+      (zflag != UNSET && zflag != scaled))
+    error->one(FLERR,"Read_dump x,y,z fields do not have consistent scaling");
+
+  // scaled, triclinic coords require all 3 x,y,z fields, to perform unscaling
+  // set yindex,zindex = column index of Y and Z fields in fields array
+  // needed for unscaling to absolute coords in xfield(), yfield(), zfield()
+
+  if (scaled == SCALED && triclinic) {
+    int flag = 0;
+    if (xflag != scaled) flag = 1;
+    if (yflag != scaled) flag = 1;
+    if (dimension == 3 && zflag != scaled) flag = 1;
+    if (flag)
+      error->one(FLERR,"All read_dump x,y,z fields must be specified for "
+                 "scaled, triclinic coords");
+
+    for (int i = 0; i < nfield; i++) {
+      if (fieldtype[i] == Y) yindex = i;
+      if (fieldtype[i] == Z) zindex = i;
+    }
+  }
+}
+
+/* ---------------------------------------------------------------------- */
+
+void ReadDump::atoms()
+{
+  // initialize counters
 
-  bigint natoms_prev = atom->natoms;
   npurge = nreplace = ntrim = nadd = 0;
 
   // if purgeflag set, delete all current atoms
@@ -300,12 +376,19 @@ void ReadDump::command(int narg, char **arg)
   // uflag[i] = 1 for each owned atom appearing in dump
   // ucflag = similar flag for each chunk atom, used in process_atoms()
 
+  // NOTE: this logic is sloppy
+
+  memory->destroy(uflag);
+  memory->destroy(ucflag);
+  memory->destroy(ucflag_all);
+  uflag = ucflag = ucflag_all = NULL;
+
   int nlocal = atom->nlocal;
   memory->create(uflag,nlocal,"read_dump:uflag");
   for (int i = 0; i < nlocal; i++) uflag[i] = 0;
   memory->create(ucflag,CHUNK,"read_dump:ucflag");
   memory->create(ucflag_all,CHUNK,"read_dump:ucflag");
-  
+
   // read, broadcast, and process atoms from snapshot in chunks
 
   addproc = -1;
@@ -314,7 +397,7 @@ void ReadDump::command(int narg, char **arg)
   bigint nread = 0;
   while (nread < nsnapatoms) {
     nchunk = MIN(nsnapatoms-nread,CHUNK);
-    if (me == 0) reader->read(nchunk,fields);
+    if (me == 0) reader->read_atoms(nchunk,nfield,fields);
     MPI_Bcast(&fields[0][0],nchunk*nfield,MPI_DOUBLE,0,world);
     process_atoms(nchunk);
     nread += nchunk;
@@ -334,7 +417,7 @@ void ReadDump::command(int narg, char **arg)
   // if trimflag set, delete atoms not replaced by snapshot atoms
 
   if (trimflag) {
-    delete_atoms(uflag);
+    delete_atoms();
     bigint nblocal = atom->nlocal;
     MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
   }
@@ -352,11 +435,29 @@ void ReadDump::command(int narg, char **arg)
     atom->map_set();
   }
 
-  // close dump file
+  // overwrite simulation box with dump snapshot box if requested
 
-  if (me == 0) {
-    if (compressed) pclose(fp);
-    else fclose(fp);
+  if (boxflag) {
+    domain->boxlo[0] = xlo;
+    domain->boxhi[0] = xhi;
+    domain->boxlo[1] = ylo;
+    domain->boxhi[1] = yhi;
+    if (dimension == 3) {
+      domain->boxlo[2] = zlo;
+      domain->boxhi[2] = zhi;
+    }
+    if (triclinic) {
+      domain->xy = xy;
+      if (dimension == 3) {
+        domain->xz = xz;
+        domain->yz = yz;
+      }
+    }
+
+    domain->set_initial_box();
+    domain->set_global_box();
+    comm->set_proc_grid();
+    domain->set_local_box();
   }
 
   // move atoms back inside simulation box and to new processors
@@ -375,55 +476,134 @@ void ReadDump::command(int narg, char **arg)
   irregular->migrate_atoms();
   delete irregular;
   if (triclinic) domain->lamda2x(atom->nlocal);
+}
 
-  domain->print_box("  ");
+/* ----------------------------------------------------------------------
+   process arg list for dump file fields and optional keywords
+------------------------------------------------------------------------- */
 
-  // clean up
+void ReadDump::fields_and_keywords(int narg, char **arg)
+{
+  // per-field vectors, leave space for ID + TYPE
 
-  delete reader;
-  delete [] fieldtype;
-  delete [] fieldlabel;
-  memory->destroy(fields);
-  memory->destroy(uflag);
-  memory->destroy(ucflag);
-  memory->destroy(ucflag_all);
+  fieldtype = new int[narg+2];
+  fieldlabel = new char*[narg+2];
 
-  // print out stats
+  // add id and type fields as needed
+  // scan ahead to see if "add yes" keyword/value is used
+  // requires extra "type" field from from dump file
 
-  bigint npurge_all,nreplace_all,ntrim_all,nadd_all;
+  int iarg;
+  for (iarg = 0; iarg < narg; iarg++)
+    if (strcmp(arg[iarg],"add") == 0)
+      if (iarg < narg-1 && strcmp(arg[iarg+1],"yes") == 0) break;
 
-  bigint tmp;
-  tmp = npurge;
-  MPI_Allreduce(&tmp,&npurge_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
-  tmp = nreplace;
-  MPI_Allreduce(&tmp,&nreplace_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
-  tmp = ntrim;
-  MPI_Allreduce(&tmp,&ntrim_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
-  tmp = nadd;
-  MPI_Allreduce(&tmp,&nadd_all,1,MPI_LMP_BIGINT,MPI_SUM,world);
+  nfield = 0;
+  fieldtype[nfield++] = ID;
+  if (iarg < narg) fieldtype[nfield++] = TYPE;
 
-  if (me == 0) {
-    if (screen) {
-      fprintf(screen,"  " BIGINT_FORMAT " atoms before read\n",natoms_prev);
-      fprintf(screen,"  " BIGINT_FORMAT " atoms in snapshot\n",nsnapatoms);
-      fprintf(screen,"  " BIGINT_FORMAT " atoms purged\n",npurge_all);
-      fprintf(screen,"  " BIGINT_FORMAT " atoms replaced\n",nreplace_all);
-      fprintf(screen,"  " BIGINT_FORMAT " atoms trimmed\n",ntrim_all);
-      fprintf(screen,"  " BIGINT_FORMAT " atoms added\n",nadd_all);
-      fprintf(screen,"  " BIGINT_FORMAT " atoms after read\n",atom->natoms);
-    }
-    if (logfile) {
-      fprintf(logfile,"  " BIGINT_FORMAT " atoms before read\n",natoms_prev);
-      fprintf(logfile,"  " BIGINT_FORMAT " atoms in snapshot\n",nsnapatoms);
-      fprintf(logfile,"  " BIGINT_FORMAT " atoms purged\n",npurge_all);
-      fprintf(logfile,"  " BIGINT_FORMAT " atoms replaced\n",nreplace_all);
-      fprintf(logfile,"  " BIGINT_FORMAT " atoms trimmed\n",ntrim_all);
-      fprintf(logfile,"  " BIGINT_FORMAT " atoms added\n",nadd_all);
-      fprintf(logfile,"  " BIGINT_FORMAT " atoms after read\n",atom->natoms);
-    }
+  // parse fields
+
+  iarg = 0;
+  while (iarg < narg) {
+    if (strcmp(arg[iarg],"x") == 0) fieldtype[nfield++] = X;
+    else if (strcmp(arg[iarg],"y") == 0) fieldtype[nfield++] = Y;
+    else if (strcmp(arg[iarg],"z") == 0) fieldtype[nfield++] = Z;
+    else if (strcmp(arg[iarg],"vx") == 0) fieldtype[nfield++] = VX;
+    else if (strcmp(arg[iarg],"vy") == 0) fieldtype[nfield++] = VY;
+    else if (strcmp(arg[iarg],"vz") == 0) fieldtype[nfield++] = VZ;
+    else if (strcmp(arg[iarg],"ix") == 0) fieldtype[nfield++] = IX;
+    else if (strcmp(arg[iarg],"iy") == 0) fieldtype[nfield++] = IY;
+    else if (strcmp(arg[iarg],"iz") == 0) fieldtype[nfield++] = IZ;
+    else break;
+    iarg++;
   }
-}
 
+  // check for no fields
+
+  if (fieldtype[nfield-1] == ID || fieldtype[nfield-1] == TYPE)
+    error->all(FLERR,"Illegal read_dump command");
+
+  if (dimension == 2) {
+    for (int i = 0; i < nfield; i++)
+      if (fieldtype[i] == Z || fieldtype[i] == VZ || fieldtype[i] == IZ)
+        error->all(FLERR,"Illegal read_dump command");
+  }
+
+  for (int i = 0; i < nfield; i++)
+    for (int j = i+1; j < nfield; j++)
+      if (fieldtype[i] == fieldtype[j])
+        error->all(FLERR,"Duplicate fields in read_dump command");
+
+  // parse optional args
+
+  boxflag = 1;
+  replaceflag = 1;
+  purgeflag = 0;
+  trimflag = 0;
+  addflag = 0;
+  for (int i = 0; i < nfield; i++) fieldlabel[i] = NULL;
+  scaledflag = UNSCALED;
+  format = NATIVE;
+
+  while (iarg < narg) {
+    if (strcmp(arg[iarg],"box") == 0) {
+      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
+      if (strcmp(arg[iarg+1],"yes") == 0) boxflag = 1;
+      else if (strcmp(arg[iarg+1],"no") == 0) boxflag = 0;
+      else error->all(FLERR,"Illegal read_dump command");
+      iarg += 2;
+    } else if (strcmp(arg[iarg],"replace") == 0) {
+      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
+      if (strcmp(arg[iarg+1],"yes") == 0) replaceflag = 1;
+      else if (strcmp(arg[iarg+1],"no") == 0) replaceflag = 0;
+      else error->all(FLERR,"Illegal read_dump command");
+      iarg += 2;
+    } else if (strcmp(arg[iarg],"purge") == 0) {
+      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
+      if (strcmp(arg[iarg+1],"yes") == 0) purgeflag = 1;
+      else if (strcmp(arg[iarg+1],"no") == 0) purgeflag = 0;
+      else error->all(FLERR,"Illegal read_dump command");
+      iarg += 2;
+    } else if (strcmp(arg[iarg],"trim") == 0) {
+      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
+      if (strcmp(arg[iarg+1],"yes") == 0) trimflag = 1;
+      else if (strcmp(arg[iarg+1],"no") == 0) trimflag = 0;
+      else error->all(FLERR,"Illegal read_dump command");
+      iarg += 2;
+    } else if (strcmp(arg[iarg],"add") == 0) {
+      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
+      if (strcmp(arg[iarg+1],"yes") == 0) addflag = 1;
+      else if (strcmp(arg[iarg+1],"no") == 0) addflag = 0;
+      else error->all(FLERR,"Illegal read_dump command");
+      iarg += 2;
+    } else if (strcmp(arg[iarg],"label") == 0) {
+      if (iarg+3 > narg) error->all(FLERR,"Illegal read_dump command");
+      int i;
+      for (i = 0; i < nfield; i++)
+        if (fieldlabel[i] && strcmp(arg[iarg+1],fieldlabel[i]) == 0) break;
+      if (i == nfield) error->all(FLERR,"Illegal read_dump command");
+      int n = strlen(arg[iarg+2]) + 1;
+      fieldlabel[i] = new char[n];
+      strcpy(fieldlabel[i],arg[iarg+2]);
+      iarg += 3;
+    } else if (strcmp(arg[iarg],"scaled") == 0) {
+      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
+      if (strcmp(arg[iarg+1],"yes") == 0) scaledflag = SCALED;
+      else if (strcmp(arg[iarg+1],"no") == 0) scaledflag = UNSCALED;
+      else error->all(FLERR,"Illegal read_dump command");
+      iarg += 2;
+    } else if (strcmp(arg[iarg],"format") == 0) {
+      if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command");
+      if (strcmp(arg[iarg+1],"native") == 0) format = NATIVE;
+      else error->all(FLERR,"Illegal read_dump command");
+      iarg += 2;
+    } else error->all(FLERR,"Illegal read_dump command");
+  }
+
+  if (purgeflag && (replaceflag || trimflag))
+    error->all(FLERR,"If read_dump purges it cannot replace or trim");
+}
 
 /* ----------------------------------------------------------------------
    process each of N atoms in chunk read from dump file
@@ -462,48 +642,48 @@ void ReadDump::process_atoms(int n)
       nreplace++;
 
       // current image flags
-      
+
       xbox = (image[m] & 1023) - 512;
       ybox = (image[m] >> 10 & 1023) - 512;
       zbox = (image[m] >> 20) - 512;
-    
+
       // overwrite atom attributes with field info
       // start from field 1 since 0 = id, 1 will be skipped if type
-      
+
       for (ifield = 1; ifield < nfield; ifield++) {
-	switch (fieldtype[ifield]) {
-	case X:
-	  x[m][0] = xfield(i,ifield);
-	  break;
-	case Y:
-	  x[m][1] = yfield(i,ifield);
-	  break;
-	case Z:
-	  x[m][2] = zfield(i,ifield);
-	  break;
-	case VX:
-	  v[m][0] = fields[i][ifield];
-	  break;
-	case VY:
-	  v[m][1] = fields[i][ifield];
-	  break;
-	case VZ:
-	  v[m][2] = fields[i][ifield];
-	  break;
-	case IX:
-	  xbox = static_cast<int> (fields[i][ifield]);
-	  break;
-	case IY:
-	  ybox = static_cast<int> (fields[i][ifield]);
-	  break;
-	case IZ:
-	  zbox = static_cast<int> (fields[i][ifield]);
-	  break;
-	}
+        switch (fieldtype[ifield]) {
+        case X:
+          x[m][0] = xfield(i,ifield);
+          break;
+        case Y:
+          x[m][1] = yfield(i,ifield);
+          break;
+        case Z:
+          x[m][2] = zfield(i,ifield);
+          break;
+        case VX:
+          v[m][0] = fields[i][ifield];
+          break;
+        case VY:
+          v[m][1] = fields[i][ifield];
+          break;
+        case VZ:
+          v[m][2] = fields[i][ifield];
+          break;
+        case IX:
+          xbox = static_cast<int> (fields[i][ifield]);
+          break;
+        case IY:
+          ybox = static_cast<int> (fields[i][ifield]);
+          break;
+        case IZ:
+          zbox = static_cast<int> (fields[i][ifield]);
+          break;
+        }
       }
-      
+
       // replace image flag in case changed by ix,iy,iz fields
-      
+
       image[m] = (xbox << 20) | (ybox << 10) | zbox;
     }
   }
@@ -535,17 +715,17 @@ void ReadDump::process_atoms(int n)
     for (ifield = 1; ifield < nfield; ifield++) {
       switch (fieldtype[ifield]) {
       case TYPE:
-	itype = static_cast<int> (fields[i][ifield]);
-	break;
+        itype = static_cast<int> (fields[i][ifield]);
+        break;
       case X:
-	one[0] = xfield(i,ifield);
-	break;
+        one[0] = xfield(i,ifield);
+        break;
       case Y:
-	one[1] = yfield(i,ifield);
-	break;
+        one[1] = yfield(i,ifield);
+        break;
       case Z:
-	one[2] = zfield(i,ifield);
-	break;
+        one[2] = zfield(i,ifield);
+        break;
       }
     }
 
@@ -554,7 +734,7 @@ void ReadDump::process_atoms(int n)
 
     atom->avec->create_atom(itype,one);
     nadd++;
-    
+
     v = atom->v;
     image = atom->image;
     m = atom->nlocal;
@@ -567,27 +747,27 @@ void ReadDump::process_atoms(int n)
     for (ifield = 1; ifield < nfield; ifield++) {
       switch (fieldtype[ifield]) {
       case VX:
-	v[m][0] = fields[i][ifield];
-	break;
+        v[m][0] = fields[i][ifield];
+        break;
       case VY:
-	v[m][1] = fields[i][ifield];
-	break;
+        v[m][1] = fields[i][ifield];
+        break;
       case VZ:
-	v[m][2] = fields[i][ifield];
-	break;
+        v[m][2] = fields[i][ifield];
+        break;
       case IX:
-	xbox = static_cast<int> (fields[i][ifield]);
-	break;
+        xbox = static_cast<int> (fields[i][ifield]);
+        break;
       case IY:
-	ybox = static_cast<int> (fields[i][ifield]);
-	break;
+        ybox = static_cast<int> (fields[i][ifield]);
+        break;
       case IZ:
-	zbox = static_cast<int> (fields[i][ifield]);
-	break;
+        zbox = static_cast<int> (fields[i][ifield]);
+        break;
       }
 
       // replace image flag in case changed by ix,iy,iz fields
-      
+
       image[m] = (xbox << 20) | (ybox << 10) | zbox;
     }
   }
@@ -597,7 +777,7 @@ void ReadDump::process_atoms(int n)
    delete atoms not flagged as replaced by dump atoms
 ------------------------------------------------------------------------- */
 
-void ReadDump::delete_atoms(int *uflag)
+void ReadDump::delete_atoms()
 {
   AtomVec *avec = atom->avec;
   int nlocal = atom->nlocal;
@@ -625,7 +805,7 @@ double ReadDump::xfield(int i, int j)
 {
   if (scaled == UNSCALED) return fields[i][j];
   else if (!triclinic) return fields[i][j]*xprd + xlo;
-  else if (dimension == 2) 
+  else if (dimension == 2)
     return xprd*fields[i][j] + xy*fields[i][yindex] + xlo;
   return xprd*fields[i][j] + xy*fields[i][yindex] + xz*fields[i][zindex] + xlo;
 }
@@ -671,3 +851,14 @@ void ReadDump::open(char *file)
     error->one(FLERR,str);
   }
 }
+
+/* ----------------------------------------------------------------------
+   close current dump file
+   only called by proc 0
+------------------------------------------------------------------------- */
+
+void ReadDump::close()
+{
+  if (compressed) pclose(fp);
+  else fclose(fp);
+}
diff --git a/src/read_dump.h b/src/read_dump.h
index 94f9f9bb8b..19e2323e76 100644
--- a/src/read_dump.h
+++ b/src/read_dump.h
@@ -30,17 +30,29 @@ namespace LAMMPS_NS {
 class ReadDump : protected Pointers {
  public:
   ReadDump(class LAMMPS *);
-  ~ReadDump() {}
+  ~ReadDump();
   void command(int, char **);
 
+  void store_files(int, char **);
+  void setup_reader();
+  bigint seek(bigint, int);
+  void header(int);
+  bigint next(bigint, bigint, int, int);
+  void atoms();
+  void fields_and_keywords(int, char **);
+
 private:
   int me,nprocs;
   FILE *fp;
+
   int dimension;
   int triclinic;
 
-  bigint nstep;            // timestep to find in dump file
-  int boxflag;             // use dump file box params
+  int nfiles;              // # of dump files to process
+  char **files;            // list of file names
+  int currentfile;         // currently open file
+
+  int boxflag;             // overwrite simulation with dump file box params
   int replaceflag,addflag; // flags for processing dump snapshot atoms
   int trimflag,purgeflag;
   int scaledflag;          // user setting for coordinate scaling
@@ -54,7 +66,7 @@ private:
   double **fields;         // per-atom field values
 
   double box[3][3];         // dump file box parameters
-  double xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz;
+  double xlo,xhi,ylo,yhi,zlo,zhi,xy,xz,yz;  // dump snapshot box params
   double xprd,yprd,zprd;
 
   bigint nsnapatoms;        // # of atoms in dump file shapshot
@@ -69,13 +81,14 @@ private:
   class ReadDumpNative *reader;     // class that reads native dump file
 
   void process_atoms(int);
-  void delete_atoms(int *);
+  void delete_atoms();
 
   double xfield(int, int);
   double yfield(int, int);
   double zfield(int, int);
 
   void open(char *);
+  void close();
 };
 
 }
diff --git a/src/read_dump_native.cpp b/src/read_dump_native.cpp
index 8d0424a18d..695a680d3e 100644
--- a/src/read_dump_native.cpp
+++ b/src/read_dump_native.cpp
@@ -15,7 +15,7 @@
 #include "stdlib.h"
 #include "read_dump_native.h"
 #include "atom.h"
-#include "domain.h"
+#include "memory.h"
 #include "error.h"
 
 using namespace LAMMPS_NS;
@@ -29,9 +29,6 @@ enum{UNSET,UNSCALED,SCALED};
 
 ReadDumpNative::ReadDumpNative(LAMMPS *lmp) : Pointers(lmp)
 {
-  dimension = domain->dimension;
-  triclinic = domain->triclinic;
-
   line = new char[MAXLINE];
   words = NULL;
   fieldindex = NULL;
@@ -43,117 +40,132 @@ ReadDumpNative::~ReadDumpNative()
 {
   delete [] line;
   delete [] words;
-  delete [] fieldindex;
+  memory->destroy(fieldindex);
 }
 
-/* ---------------------------------------------------------------------- */
+/* ----------------------------------------------------------------------
+   set file ptr
+   caller opens/closes dump files
+------------------------------------------------------------------------- */
 
-void ReadDumpNative::init(FILE *fpcaller)
+void ReadDumpNative::file(FILE *fpcaller)
 {
   fp = fpcaller;
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 scans dump file until reaching snapshot with timestamp = Nstep
-   extract natoms and box bounds from snapshot
-   set fieldindex for specified fields and overall scaled setting
-   error check on current vs new box and fields
-   NOTE: error checking should maybe be moved to parent
+   read and return time stamp from dump file
+   if first read reaches end-of-file, return 1 so caller can open next file
+   only called by proc 0
 ------------------------------------------------------------------------- */
 
-void ReadDumpNative::scan(bigint nstep, 
-			  int nfield_caller, int *fieldtype, 
-			  char **fieldlabel, int scaledflag,
-			  bigint &natoms, double box[3][3], int &scaled)
+int ReadDumpNative::read_time(bigint &ntimestep)
 {
-  int nchunk,triclinic_snap,s_index,u_index,su_index;
-  bigint ntimestep,nremain;
-  char *bc,*names;
-
-  nfield = nfield_caller;
+  char *eof = fgets(line,MAXLINE,fp);
+  if (eof == NULL) return 1;
 
+  if (strstr(line,"ITEM: TIMESTEP") != line)
+    error->one(FLERR,"Dump file is incorrectly formatted");
   read_lines(1);
+  sscanf(line,BIGINT_FORMAT,&ntimestep);
 
-  while (1) {
-    if (strstr(line,"ITEM: TIMESTEP") != line)
-      error->one(FLERR,"Incorrectly formatted dump file");
-    read_lines(1);
-    sscanf(line,BIGINT_FORMAT,&ntimestep);
-
-    if (ntimestep > nstep)
-      error->one(FLERR,"Dump file does not contain requested snapshot");
+  return 0;
+}
 
-    read_lines(2);
-    sscanf(line,BIGINT_FORMAT,&natoms);
+/* ----------------------------------------------------------------------
+   skip snapshot from timestamp onward
+   only called by proc 0
+------------------------------------------------------------------------- */
 
-    // skip snapshot
-    // invoke read_lines() in chunks no larger than MAXSMALLINT
+void ReadDumpNative::skip()
+{
+  read_lines(2);
+  bigint natoms;
+  sscanf(line,BIGINT_FORMAT,&natoms);
 
-    if (ntimestep < nstep) {
-      read_lines(5);
+  read_lines(5);
 
-      nremain = natoms;
-      while (nremain) {
-	nchunk = MIN(nremain,MAXSMALLINT);
-	read_lines(nchunk);
-	nremain -= nchunk;
-      }
+  // invoke read_lines() in chunks no larger than MAXSMALLINT
 
-      read_lines(1);
-    } else break;
+  int nchunk;
+  bigint nremain = natoms;
+  while (nremain) {
+    nchunk = MIN(nremain,MAXSMALLINT);
+    read_lines(nchunk);
+    nremain -= nchunk;
   }
+}
 
-  // found correct snapshot
-  // read box size and boundary conditions
+/* ----------------------------------------------------------------------
+   read remaining header info:
+     return natoms
+     box bounds, triclinic (inferred), fieldflag (1 if any fields not found),
+     xyz flag = UNSET (not a requested field), SCALED, UNSCALED
+   if fieldflag set:
+     match Nfield fields to per-atom column labels
+     allocate and set fieldindex = which column each field maps to
+     fieldtype = X,VX,IZ etc
+     fieldlabel = user-specified label or NULL if use fieldtype default
+   xyz flag = scaledflag if has fieldlabel name, else set by x,xs,xu,xsu
+   only called by proc 0
+------------------------------------------------------------------------- */
+
+bigint ReadDumpNative::read_header(double box[3][3], int &triclinic,
+                                   int fieldinfo, int nfield,
+                                   int *fieldtype, char **fieldlabel,
+                                   int scaledflag, int &fieldflag,
+                                   int &xflag, int &yflag, int &zflag)
+{
+  bigint natoms;
+  read_lines(2);
+  sscanf(line,BIGINT_FORMAT,&natoms);
 
-  triclinic_snap = 0;
+  triclinic = 0;
   box[0][2] = box[1][2] = box[2][2] = 0.0;
   read_lines(1);
-  bc = &line[strlen("ITEM: BOX BOUNDS ")];
-  if (bc[0] == 'x') {
-    triclinic_snap = 1;
-    bc = &bc[9];
-  }
-  
-  char boundstr[9];
-  domain->boundary_string(boundstr);
-  if (strstr(bc,boundstr) != bc) 
-    error->warning(FLERR,"Read_dump boundary flags do not match simulation");
-  
+  if (line[strlen("ITEM: BOX BOUNDS ")] == 'x') triclinic = 1;
+
   read_lines(1);
-  if (!triclinic_snap) sscanf(line,"%lg %lg",&box[0][0],&box[0][1]);
+  if (!triclinic) sscanf(line,"%lg %lg",&box[0][0],&box[0][1]);
   else sscanf(line,"%lg %lg %lg",&box[0][0],&box[0][1],&box[0][2]);
   read_lines(1);
-  if (!triclinic_snap) sscanf(line,"%lg %lg",&box[1][0],&box[1][1]);
+  if (!triclinic) sscanf(line,"%lg %lg",&box[1][0],&box[1][1]);
   else sscanf(line,"%lg %lg %lg",&box[1][0],&box[1][1],&box[1][2]);
   read_lines(1);
-  if (!triclinic_snap) sscanf(line,"%lg %lg",&box[2][0],&box[2][1]);
+  if (!triclinic) sscanf(line,"%lg %lg",&box[2][0],&box[2][1]);
   else sscanf(line,"%lg %lg %lg",&box[2][0],&box[2][1],&box[2][2]);
-  
-  // read ITEM: ATOMS line
-  // labels = column labels
-  
+
   read_lines(1);
-  names = &line[strlen("ITEM: ATOMS ")];
-  
-  nwords = atom->count_words(names);
+
+  // if no field info requested, just return
+
+  if (!fieldinfo) return natoms;
+
+  // exatract column labels and match to requested fields
+
+  char *labelline = &line[strlen("ITEM: ATOMS ")];
+
+  nwords = atom->count_words(labelline);
   char **labels = new char*[nwords];
-  labels[0] = strtok(names," \t\n\r\f");
-  if (labels[0] == NULL) 
-    error->one(FLERR,"Incorrect atom format in dump file");
+  labels[0] = strtok(labelline," \t\n\r\f");
+  if (labels[0] == NULL) return 1;
   for (int m = 1; m < nwords; m++) {
     labels[m] = strtok(NULL," \t\n\r\f");
-    if (labels[m] == NULL) 
-      error->one(FLERR,"Incorrect atom format in dump file");
+    if (labels[m] == NULL) return 1;
   }
-  
-  // match each field with column
-  
-  fieldindex = new int[nfield];
-  int xflag = UNSET;
-  int yflag = UNSET;
-  int zflag = UNSET;
-  
+
+  // match each field with a column of per-atom data
+  // if fieldlabel set, match with explicit column
+  // else infer one or more column matches from fieldtype
+  // xyz flag set by scaledflag (if fieldlabel set) or column label
+
+  memory->create(fieldindex,nfield,"read_dump:fieldindex");
+
+  int s_index,u_index,su_index;
+  xflag = UNSET;
+  yflag = UNSET;
+  zflag = UNSET;
+
   for (int i = 0; i < nfield; i++) {
     if (fieldlabel[i]) {
       fieldindex[i] = find_label(fieldlabel[i],nwords,labels);
@@ -161,81 +173,81 @@ void ReadDumpNative::scan(bigint nstep,
       else if (fieldtype[i] == Y) yflag = scaledflag;
       else if (fieldtype[i] == Z) zflag = scaledflag;
     }
-    
+
     else if (fieldtype[i] == ID)
       fieldindex[i] = find_label("id",nwords,labels);
     else if (fieldtype[i] == TYPE)
       fieldindex[i] = find_label("type",nwords,labels);
-    
+
     else if (fieldtype[i] == X) {
       fieldindex[i] = find_label("x",nwords,labels);
       xflag = UNSCALED;
       if (fieldindex[i] < 0) {
-	fieldindex[i] = nwords;
-	s_index = find_label("xs",nwords,labels);
-	u_index = find_label("xu",nwords,labels);
-	su_index = find_label("xsu",nwords,labels);
-	if (s_index >= 0 && s_index < fieldindex[i]) {
-	  fieldindex[i] = s_index;
-	  xflag = SCALED;
-	}
-	if (u_index >= 0 && u_index < fieldindex[i]) {
-	  fieldindex[i] = u_index;
-	  xflag = UNSCALED;
-	}
-	if (su_index >= 0 && su_index < fieldindex[i]) {
-	  fieldindex[i] = su_index;
-	  xflag = SCALED;
-	}
+        fieldindex[i] = nwords;
+        s_index = find_label("xs",nwords,labels);
+        u_index = find_label("xu",nwords,labels);
+        su_index = find_label("xsu",nwords,labels);
+        if (s_index >= 0 && s_index < fieldindex[i]) {
+          fieldindex[i] = s_index;
+          xflag = SCALED;
+        }
+        if (u_index >= 0 && u_index < fieldindex[i]) {
+          fieldindex[i] = u_index;
+          xflag = UNSCALED;
+        }
+        if (su_index >= 0 && su_index < fieldindex[i]) {
+          fieldindex[i] = su_index;
+          xflag = SCALED;
+        }
       }
       if (fieldindex[i] == nwords) fieldindex[i] = -1;
-      
+
     } else if (fieldtype[i] == Y) {
       fieldindex[i] = find_label("y",nwords,labels);
       yflag = UNSCALED;
       if (fieldindex[i] < 0) {
-	fieldindex[i] = nwords;
-	s_index = find_label("ys",nwords,labels);
-	u_index = find_label("yu",nwords,labels);
-	su_index = find_label("ysu",nwords,labels);
-	if (s_index >= 0 && s_index < fieldindex[i]) {
-	  fieldindex[i] = s_index;
-	  yflag = SCALED;
-	}
-	if (u_index >= 0 && u_index < fieldindex[i]) {
-	  fieldindex[i] = u_index;
-	  yflag = UNSCALED;
-	}
-	if (su_index >= 0 && su_index < fieldindex[i]) {
-	  fieldindex[i] = su_index;
-	  yflag = SCALED;
-	}
+        fieldindex[i] = nwords;
+        s_index = find_label("ys",nwords,labels);
+        u_index = find_label("yu",nwords,labels);
+        su_index = find_label("ysu",nwords,labels);
+        if (s_index >= 0 && s_index < fieldindex[i]) {
+          fieldindex[i] = s_index;
+          yflag = SCALED;
+        }
+        if (u_index >= 0 && u_index < fieldindex[i]) {
+          fieldindex[i] = u_index;
+          yflag = UNSCALED;
+        }
+        if (su_index >= 0 && su_index < fieldindex[i]) {
+          fieldindex[i] = su_index;
+          yflag = SCALED;
+        }
       }
       if (fieldindex[i] == nwords) fieldindex[i] = -1;
-      
+
     } else if (fieldtype[i] == Z) {
       fieldindex[i] = find_label("z",nwords,labels);
       zflag = UNSCALED;
       if (fieldindex[i] < 0) {
-	fieldindex[i] = nwords;
-	s_index = find_label("zs",nwords,labels);
-	u_index = find_label("zu",nwords,labels);
-	su_index = find_label("zsu",nwords,labels);
-	if (s_index >= 0 && s_index < fieldindex[i]) {
-	  fieldindex[i] = s_index;
-	  zflag = SCALED;
-	}
-	if (u_index >= 0 && u_index < fieldindex[i]) {
-	  fieldindex[i] = u_index;
-	  zflag = UNSCALED;
-	}
-	if (su_index >= 0 && su_index < fieldindex[i]) {
-	  fieldindex[i] = su_index;
-	  zflag = SCALED;
-	}
+        fieldindex[i] = nwords;
+        s_index = find_label("zs",nwords,labels);
+        u_index = find_label("zu",nwords,labels);
+        su_index = find_label("zsu",nwords,labels);
+        if (s_index >= 0 && s_index < fieldindex[i]) {
+          fieldindex[i] = s_index;
+          zflag = SCALED;
+        }
+        if (u_index >= 0 && u_index < fieldindex[i]) {
+          fieldindex[i] = u_index;
+          zflag = UNSCALED;
+        }
+        if (su_index >= 0 && su_index < fieldindex[i]) {
+          fieldindex[i] = su_index;
+          zflag = SCALED;
+        }
       }
       if (fieldindex[i] == nwords) fieldindex[i] = -1;
-      
+
     } else if (fieldtype[i] == VX)
       fieldindex[i] = find_label("vx",nwords,labels);
     else if (fieldtype[i] == VY)
@@ -249,52 +261,30 @@ void ReadDumpNative::scan(bigint nstep,
     else if (fieldtype[i] == IZ)
       fieldindex[i] = find_label("iz",nwords,labels);
   }
-  
-  // error checks
-  
-  if ((triclinic_snap && !triclinic) || 
-      (!triclinic_snap && triclinic))
-    error->one(FLERR,"Read_dump triclinic setting does not match simulation");
-  
-  for (int i = 0; i < nfield; i++)
-    if (fieldindex[i] < 0) 
-      error->one(FLERR,"Read_dump field not found in dump file");
-  
-  // set overall scaling of coordinates
-  // error if x,y,z scaling is not the same
-  
-  scaled = MAX(xflag,yflag);
-  scaled = MAX(zflag,scaled);
-  if ((xflag != UNSET && xflag != scaled) ||
-      (yflag != UNSET && yflag != scaled) ||
-      (zflag != UNSET && zflag != scaled))
-    error->one(FLERR,"Read_dump x,y,z fields do not have consistent scaling");
-  
-  // scaled, triclinic coords require all 3 x,y,z fields to perform unscaling
-  
-  if (scaled == SCALED && triclinic) {
-    int flag = 0;
-    if (xflag != scaled) flag = 1;
-    if (yflag != scaled) flag = 1;
-    if (dimension == 3 && zflag != scaled) flag = 1;
-    if (flag)
-      error->one(FLERR,"All read_dump x,y,z fields must be specified for "
-		 "scaled, triclinic coords");
-  }
-  
+
   delete [] labels;
-  
-  // create vector of word ptrs for future parsing of per-atom lines
-  
+
+  // set fieldflag = 1 if any unfound fields
+
+  fieldflag = 0;
+  for (int i = 0; i < nfield; i++)
+    if (fieldindex[i] < 0) fieldflag = 1;
+
+  // create internal vector of word ptrs for future parsing of per-atom lines
+
   words = new char*[nwords];
+
+  return natoms;
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads N atom lines from dump file
+   read N atom lines from dump file
    stores appropriate values in fields array
+   return 0 if success, 1 if error
+   only called by proc 0
 ------------------------------------------------------------------------- */
 
-void ReadDumpNative::read(int n, double **fields)
+void ReadDumpNative::read_atoms(int n, int nfield, double **fields)
 {
   int i,m;
   char *eof;
@@ -329,13 +319,15 @@ int ReadDumpNative::find_label(const char *label, int n, char **labels)
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 reads N lines from file
+   read N lines from dump file
    only last one is saved in line
+   return NULL if end-of-file error, else non-NULL
+   only called by proc 0
 ------------------------------------------------------------------------- */
 
 void ReadDumpNative::read_lines(int n)
 {
   char *eof;
   for (int i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp);
-  if (eof == NULL) error->one(FLERR,"Unexpected end of dump file");
+  if (eof == NULL) error->all(FLERR,"Unexpected end of dump file");
 }
diff --git a/src/read_dump_native.h b/src/read_dump_native.h
index 183710ebdf..e7295c2535 100644
--- a/src/read_dump_native.h
+++ b/src/read_dump_native.h
@@ -26,21 +26,20 @@ class ReadDumpNative : protected Pointers {
   ReadDumpNative(class LAMMPS *);
   ~ReadDumpNative();
 
-  void init(FILE *);
-  void scan(bigint, int, int *, char **, int, bigint &, double [3][3], int &);
-  void read(int, double **);
+  void file(FILE *);
+  int read_time(bigint &);
+  void skip();
+  bigint read_header(double [3][3], int &, int, int, int *, char **,
+                     int, int &, int &, int &, int &);
+  void read_atoms(int, int, double **);
 
 private:
   FILE *fp;                // pointer to file opened by caller
   char *line;              // line read from dump file
-  int dimension;
-  int triclinic;
 
   int nwords;              // # of per-atom columns in dump file
-  char **words;            // ptrs to words in parsed per-atom line
-
-  int nfield;              // # of fields to extract for each atom
-  int *fieldindex;         // index into words for each field
+  char **words;            // ptrs to values in parsed per-atom line
+  int *fieldindex;         //
 
   int find_label(const char *, int, char **);
   void read_lines(int);
diff --git a/src/read_restart.cpp b/src/read_restart.cpp
index accb4b9458..3afd4c42e2 100644
--- a/src/read_restart.cpp
+++ b/src/read_restart.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -71,7 +71,7 @@ void ReadRestart::command(int narg, char **arg)
 {
   if (narg != 1) error->all(FLERR,"Illegal read_restart command");
 
-  if (domain->box_exist) 
+  if (domain->box_exist)
     error->all(FLERR,"Cannot read_restart after simulation box is defined");
 
   MPI_Comm_rank(world,&me);
@@ -181,30 +181,30 @@ void ReadRestart::command(int narg, char **arg)
     for (int iproc = 0; iproc < nprocs_file; iproc++) {
       n = read_int();
       if (n > maxbuf) {
-	maxbuf = n;
-	memory->destroy(buf);
-	memory->create(buf,maxbuf,"read_restart:buf");
+        maxbuf = n;
+        memory->destroy(buf);
+        memory->create(buf,maxbuf,"read_restart:buf");
       }
 
       if (n > 0) {
-	if (me == 0) nread_double(buf,n,fp);
-	MPI_Bcast(buf,n,MPI_DOUBLE,0,world);
+        if (me == 0) nread_double(buf,n,fp);
+        MPI_Bcast(buf,n,MPI_DOUBLE,0,world);
       }
 
       m = 0;
       while (m < n) {
-	x = &buf[m+1];
-	if (triclinic) {
-	  domain->x2lamda(x,lamda);
-	  coord = lamda;
-	} else coord = x;
-	
-	if (coord[0] >= sublo[0] && coord[0] < subhi[0] &&
-	    coord[1] >= sublo[1] && coord[1] < subhi[1] &&
-	    coord[2] >= sublo[2] && coord[2] < subhi[2]) {
-	  m += avec->unpack_restart(&buf[m]);
-	}
-	else m += static_cast<int> (buf[m]);
+        x = &buf[m+1];
+        if (triclinic) {
+          domain->x2lamda(x,lamda);
+          coord = lamda;
+        } else coord = x;
+
+        if (coord[0] >= sublo[0] && coord[0] < subhi[0] &&
+            coord[1] >= sublo[1] && coord[1] < subhi[1] &&
+            coord[2] >= sublo[2] && coord[2] < subhi[2]) {
+          m += avec->unpack_restart(&buf[m]);
+        }
+        else m += static_cast<int> (buf[m]);
       }
     }
 
@@ -227,16 +227,16 @@ void ReadRestart::command(int narg, char **arg)
       *ptr = '%';
       fp = fopen(perproc,"rb");
       if (fp == NULL) {
-	char str[128];
-	sprintf(str,"Cannot open restart file %s",perproc);
-	error->one(FLERR,str);
+        char str[128];
+        sprintf(str,"Cannot open restart file %s",perproc);
+        error->one(FLERR,str);
       }
 
       nread_int(&n,1,fp);
       if (n > maxbuf) {
-	maxbuf = n;
-	memory->destroy(buf);
-	memory->create(buf,maxbuf,"read_restart:buf");
+        maxbuf = n;
+        memory->destroy(buf);
+        memory->create(buf,maxbuf,"read_restart:buf");
       }
       if (n > 0) nread_double(buf,n,fp);
 
@@ -288,8 +288,8 @@ void ReadRestart::command(int narg, char **arg)
       double **atom_extra = atom->extra;
       int nlocal = atom->nlocal;
       for (int i = 0; i < nlocal; i++)
-	for (int j = 0; j < count[i]; j++)
-	  atom_extra[i][j] = extra[i][j];
+        for (int j = 0; j < count[i]; j++)
+          atom_extra[i][j] = extra[i][j];
       modify->delete_fix("_read_restart");
     }
   }
@@ -310,7 +310,7 @@ void ReadRestart::command(int narg, char **arg)
     if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " atoms\n",natoms);
   }
 
-  if (natoms != atom->natoms) 
+  if (natoms != atom->natoms)
     error->all(FLERR,"Did not assign all atoms correctly");
 
   if (me == 0) {
@@ -320,21 +320,21 @@ void ReadRestart::command(int narg, char **arg)
     }
     if (atom->nangles) {
       if (screen) fprintf(screen,"  " BIGINT_FORMAT " angles\n",
-			  atom->nangles);
+                          atom->nangles);
       if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " angles\n",
-			   atom->nangles);
+                           atom->nangles);
     }
     if (atom->ndihedrals) {
       if (screen) fprintf(screen,"  " BIGINT_FORMAT " dihedrals\n",
-			  atom->ndihedrals);
+                          atom->ndihedrals);
       if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " dihedrals\n",
-			   atom->ndihedrals);
+                           atom->ndihedrals);
     }
     if (atom->nimpropers) {
       if (screen) fprintf(screen,"  " BIGINT_FORMAT " impropers\n",
-			  atom->nimpropers);
+                          atom->nimpropers);
       if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " impropers\n",
-			   atom->nimpropers);
+                           atom->nimpropers);
     }
   }
 
@@ -414,7 +414,7 @@ void ReadRestart::file_search(char *infile, char *outfile)
 
   struct dirent *ep;
   DIR *dp = opendir(dirname);
-  if (dp == NULL) 
+  if (dp == NULL)
     error->one(FLERR,"Cannot open dir to search for restart file");
   while (ep = readdir(dp)) {
     if (strstr(ep->d_name,begin) != ep->d_name) continue;
@@ -448,7 +448,7 @@ void ReadRestart::file_search(char *infile, char *outfile)
 }
 
 /* ----------------------------------------------------------------------
-   read header of restart file 
+   read header of restart file
 ------------------------------------------------------------------------- */
 
 void ReadRestart::header()
@@ -467,27 +467,27 @@ void ReadRestart::header()
     if (flag == VERSION) {
       char *version = read_char();
       if (strcmp(version,universe->version) != 0 && me == 0) {
-	error->warning(FLERR,
-		       "Restart file version does not match LAMMPS version");
-	if (screen) fprintf(screen,"  restart file = %s, LAMMPS = %s\n",
-			    version,universe->version);
+        error->warning(FLERR,
+                       "Restart file version does not match LAMMPS version");
+        if (screen) fprintf(screen,"  restart file = %s, LAMMPS = %s\n",
+                            version,universe->version);
       }
       delete [] version;
-      
+
       // check lmptype.h sizes, error if different
 
     } else if (flag == SMALLINT) {
       int size = read_int();
       if (size != sizeof(smallint))
-	error->all(FLERR,"Smallint setting in lmptype.h is not compatible");
+        error->all(FLERR,"Smallint setting in lmptype.h is not compatible");
     } else if (flag == TAGINT) {
       int size = read_int();
       if (size != sizeof(tagint))
-	error->all(FLERR,"Tagint setting in lmptype.h is not compatible");
+        error->all(FLERR,"Tagint setting in lmptype.h is not compatible");
     } else if (flag == BIGINT) {
       int size = read_int();
       if (size != sizeof(bigint))
-	error->all(FLERR,"Bigint setting in lmptype.h is not compatible");
+        error->all(FLERR,"Bigint setting in lmptype.h is not compatible");
 
       // reset unit_style only if different
       // so that timestep,neighbor-skin are not changed
@@ -506,15 +506,15 @@ void ReadRestart::header()
       int dimension = read_int();
       domain->dimension = dimension;
       if (domain->dimension == 2 && domain->zperiodic == 0)
-	error->all(FLERR,
-		   "Cannot run 2d simulation with nonperiodic Z dimension");
+        error->all(FLERR,
+                   "Cannot run 2d simulation with nonperiodic Z dimension");
 
       // read nprocs from restart file, warn if different
 
     } else if (flag == NPROCS) {
       nprocs_file = read_int();
       if (nprocs_file != comm->nprocs && me == 0)
-	error->warning(FLERR,"Restart file used different # of processors");
+        error->warning(FLERR,"Restart file used different # of processors");
 
       // don't set procgrid, warn if different
 
@@ -524,10 +524,10 @@ void ReadRestart::header()
       py = read_int();
     } else if (flag == PROCGRID_2) {
       pz = read_int();
-      if (comm->user_procgrid[0] != 0 && 
-	  (px != comm->user_procgrid[0] || py != comm->user_procgrid[1] || 
-	   pz != comm->user_procgrid[2]) && me == 0)
-	error->warning(FLERR,"Restart file used different 3d processor grid");
+      if (comm->user_procgrid[0] != 0 &&
+          (px != comm->user_procgrid[0] || py != comm->user_procgrid[1] ||
+           pz != comm->user_procgrid[2]) && me == 0)
+        error->warning(FLERR,"Restart file used different 3d processor grid");
 
     // don't set newton_pair, leave input script value unchanged
     // set newton_bond from restart file
@@ -536,18 +536,18 @@ void ReadRestart::header()
     } else if (flag == NEWTON_PAIR) {
       int newton_pair_file = read_int();
       if (force->newton_pair != 1) {
-	if (newton_pair_file != force->newton_pair && me == 0)
-	  error->warning(FLERR,
-			 "Restart file used different newton pair setting, "
-			 "using input script value");
+        if (newton_pair_file != force->newton_pair && me == 0)
+          error->warning(FLERR,
+                         "Restart file used different newton pair setting, "
+                         "using input script value");
       }
     } else if (flag == NEWTON_BOND) {
       int newton_bond_file = read_int();
       if (force->newton_bond != 1) {
-	if (newton_bond_file != force->newton_bond && me == 0)
-	  error->warning(FLERR,
-			 "Restart file used different newton bond setting, "
-			 "using restart file value");
+        if (newton_bond_file != force->newton_bond && me == 0)
+          error->warning(FLERR,
+                         "Restart file used different newton bond setting, "
+                         "using restart file value");
       }
       force->newton_bond = newton_bond_file;
       if (force->newton_pair || force->newton_bond) force->newton = 1;
@@ -575,20 +575,20 @@ void ReadRestart::header()
     } else if (flag == BOUNDARY_21) {
       boundary[2][1] = read_int();
 
-      if (domain->boundary[0][0] || domain->boundary[0][1] || 
-	  domain->boundary[1][0] || domain->boundary[1][1] || 
-	  domain->boundary[2][0] || domain->boundary[2][1]) {
-	if (boundary[0][0] != domain->boundary[0][0] ||
-	    boundary[0][1] != domain->boundary[0][1] ||
-	    boundary[1][0] != domain->boundary[1][0] ||
-	    boundary[1][1] != domain->boundary[1][1] ||
-	    boundary[2][0] != domain->boundary[2][0] ||
-	    boundary[2][1] != domain->boundary[2][1]) {
-	  if (me == 0) 
-	    error->warning(FLERR,
-			   "Restart file used different boundary settings, "
-			   "using restart file values");
-	}
+      if (domain->boundary[0][0] || domain->boundary[0][1] ||
+          domain->boundary[1][0] || domain->boundary[1][1] ||
+          domain->boundary[2][0] || domain->boundary[2][1]) {
+        if (boundary[0][0] != domain->boundary[0][0] ||
+            boundary[0][1] != domain->boundary[0][1] ||
+            boundary[1][0] != domain->boundary[1][0] ||
+            boundary[1][1] != domain->boundary[1][1] ||
+            boundary[2][0] != domain->boundary[2][0] ||
+            boundary[2][1] != domain->boundary[2][1]) {
+          if (me == 0)
+            error->warning(FLERR,
+                           "Restart file used different boundary settings, "
+                           "using restart file values");
+        }
       }
 
       domain->boundary[0][0] = boundary[0][0];
@@ -601,14 +601,14 @@ void ReadRestart::header()
       domain->periodicity[0] = domain->xperiodic = xperiodic;
       domain->periodicity[1] = domain->yperiodic = yperiodic;
       domain->periodicity[2] = domain->zperiodic = zperiodic;
-  
+
       domain->nonperiodic = 0;
       if (xperiodic == 0 || yperiodic == 0 || zperiodic == 0) {
-	domain->nonperiodic = 1;
-	if (boundary[0][0] >= 2 || boundary[0][1] >= 2 ||
-	    boundary[1][0] >= 2 || boundary[1][1] >= 2 ||
-	    boundary[2][0] >= 2 || boundary[2][1] >= 2)
-	  domain->nonperiodic = 2;
+        domain->nonperiodic = 1;
+        if (boundary[0][0] >= 2 || boundary[0][1] >= 2 ||
+            boundary[1][0] >= 2 || boundary[1][1] >= 2 ||
+            boundary[2][0] >= 2 || boundary[2][1] >= 2)
+          domain->nonperiodic = 2;
       }
 
       // create new AtomVec class
@@ -621,9 +621,9 @@ void ReadRestart::header()
       char **words = NULL;
 
       if (strcmp(style,"hybrid") == 0) {
-	nwords = read_int();
-	words = new char*[nwords];
-	for (int i = 0; i < nwords; i++) words[i] = read_char();
+        nwords = read_int();
+        words = new char*[nwords];
+        for (int i = 0; i < nwords; i++) words[i] = read_char();
       }
 
       atom->create_avec(style,nwords,words);
@@ -717,7 +717,7 @@ void ReadRestart::type_arrays()
       delete [] mass;
 
     } else error->all(FLERR,
-		      "Invalid flag in type arrays section of restart file");
+                      "Invalid flag in type arrays section of restart file");
 
     flag = read_int();
   }
@@ -743,8 +743,8 @@ void ReadRestart::force_fields()
       delete [] style;
       if (force->pair->restartinfo) force->pair->read_restart(fp);
       else {
-	delete force->pair;
-	force->pair = NULL;
+        delete force->pair;
+        force->pair = NULL;
       }
 
     } else if (flag == BOND) {
@@ -752,7 +752,7 @@ void ReadRestart::force_fields()
       style = new char[n];
       if (me == 0) nread_char(style,n,fp);
       MPI_Bcast(style,n,MPI_CHAR,0,world);
-      
+
       force->create_bond(style);
       delete [] style;
       force->bond->read_restart(fp);
@@ -788,7 +788,7 @@ void ReadRestart::force_fields()
       force->improper->read_restart(fp);
 
     } else error->all(FLERR,
-		      "Invalid flag in force field section of restart file");
+                      "Invalid flag in force field section of restart file");
 
     flag = read_int();
   }
diff --git a/src/read_restart.h b/src/read_restart.h
index c7186a771d..d49189075c 100644
--- a/src/read_restart.h
+++ b/src/read_restart.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/region.cpp b/src/region.cpp
index d73ebd368a..9ce1d9fd2a 100644
--- a/src/region.cpp
+++ b/src/region.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -116,7 +116,7 @@ int Region::match(double x, double y, double z)
      before: inverse transform x,y,z (unmove, then unrotate)
      after: forward transform contact point xs,yx,zs (rotate, then move),
             then reset contact delx,dely,delz based on new contact point
-	    no need to do this if no rotation since delxyz doesn't change
+            no need to do this if no rotation since delxyz doesn't change
 ------------------------------------------------------------------------- */
 
 int Region::surface(double x, double y, double z, double cutoff)
@@ -183,7 +183,7 @@ void Region::forward_transform(double &x, double &y, double &z)
       theta = input->variable->compute_equal(tvar);
     rotate(x,y,z,theta);
   }
-  
+
   if (moveflag) {
     if (update->ntimestep != laststep) {
       if (xstr) dx = input->variable->compute_equal(xvar);
@@ -221,7 +221,7 @@ void Region::inverse_transform(double &x, double &y, double &z)
       theta = input->variable->compute_equal(tvar);
     rotate(x,y,z,-theta);
   }
-  
+
   laststep = update->ntimestep;
 }
 
@@ -248,7 +248,7 @@ void Region::rotate(double &x, double &y, double &z, double angle)
 
   double sine = sin(angle);
   double cosine = cos(angle);
-  double x0dotr = x*runit[0] + y*runit[1] + z*runit[2]; 
+  double x0dotr = x*runit[0] + y*runit[1] + z*runit[2];
   c[0] = x0dotr * runit[0];
   c[1] = x0dotr * runit[1];
   c[2] = x0dotr * runit[2];
@@ -301,33 +301,33 @@ void Region::options(int narg, char **arg)
     } else if (strcmp(arg[iarg],"move") == 0) {
       if (iarg+4 > narg) error->all(FLERR,"Illegal region command");
       if (strcmp(arg[iarg+1],"NULL") != 0) {
-	if (strstr(arg[iarg+1],"v_") != arg[iarg+1]) 
-	  error->all(FLERR,"Illegal region command");
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	xstr = new char[n];
-	strcpy(xstr,&arg[iarg+1][2]);
+        if (strstr(arg[iarg+1],"v_") != arg[iarg+1])
+          error->all(FLERR,"Illegal region command");
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        xstr = new char[n];
+        strcpy(xstr,&arg[iarg+1][2]);
       }
       if (strcmp(arg[iarg+2],"NULL") != 0) {
-	if (strstr(arg[iarg+2],"v_") != arg[iarg+2]) 
-	  error->all(FLERR,"Illegal region command");
-	int n = strlen(&arg[iarg+2][2]) + 1;
-	ystr = new char[n];
-	strcpy(ystr,&arg[iarg+2][2]);
+        if (strstr(arg[iarg+2],"v_") != arg[iarg+2])
+          error->all(FLERR,"Illegal region command");
+        int n = strlen(&arg[iarg+2][2]) + 1;
+        ystr = new char[n];
+        strcpy(ystr,&arg[iarg+2][2]);
       }
       if (strcmp(arg[iarg+3],"NULL") != 0) {
-	if (strstr(arg[iarg+3],"v_") != arg[iarg+3]) 
-	  error->all(FLERR,"Illegal region command");
-	int n = strlen(&arg[iarg+3][2]) + 1;
-	zstr = new char[n];
-	strcpy(zstr,&arg[iarg+3][2]);
+        if (strstr(arg[iarg+3],"v_") != arg[iarg+3])
+          error->all(FLERR,"Illegal region command");
+        int n = strlen(&arg[iarg+3][2]) + 1;
+        zstr = new char[n];
+        strcpy(zstr,&arg[iarg+3][2]);
       }
       moveflag = 1;
       iarg += 4;
 
     } else if (strcmp(arg[iarg],"rotate") == 0) {
       if (iarg+8 > narg) error->all(FLERR,"Illegal region command");
-      if (strstr(arg[iarg+1],"v_") != arg[iarg+1]) 
-	error->all(FLERR,"Illegal region command");
+      if (strstr(arg[iarg+1],"v_") != arg[iarg+1])
+        error->all(FLERR,"Illegal region command");
       int n = strlen(&arg[iarg+1][2]) + 1;
       tstr = new char[n];
       strcpy(tstr,&arg[iarg+1][2]);
@@ -343,8 +343,8 @@ void Region::options(int narg, char **arg)
   }
 
   // error check
-  
-  if ((moveflag || rotateflag) && 
+
+  if ((moveflag || rotateflag) &&
       (strcmp(style,"union") == 0 || strcmp(style,"intersect") == 0))
     error->all(FLERR,"Region union or intersect cannot be dynamic");
 
@@ -370,7 +370,7 @@ void Region::options(int narg, char **arg)
 
   if (rotateflag) {
     double len = sqrt(axis[0]*axis[0] + axis[1]*axis[1] + axis[2]*axis[2]);
-    if (len == 0.0) 
+    if (len == 0.0)
       error->all(FLERR,"Region cannot have 0 length rotation vector");
     runit[0] = axis[0]/len;
     runit[1] = axis[1]/len;
diff --git a/src/region.h b/src/region.h
index 7a61f9b7b1..9b04bfd9c3 100644
--- a/src/region.h
+++ b/src/region.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -37,7 +37,7 @@ class Region : protected Pointers {
   };
   Contact *contact;           // list of contacts
   int cmax;                   // max # of contacts possible with region
- 
+
   Region(class LAMMPS *, int, char **);
   virtual ~Region();
   void init();
diff --git a/src/region_block.cpp b/src/region_block.cpp
index 9a714f5321..3a295472f9 100644
--- a/src/region_block.cpp
+++ b/src/region_block.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -26,9 +26,9 @@ using namespace LAMMPS_NS;
 RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
 {
   options(narg-8,&arg[8]);
-  
+
   if (strcmp(arg[2],"INF") == 0 || strcmp(arg[2],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[2],"INF") == 0) xlo = -BIG;
     else if (domain->triclinic == 0) xlo = domain->boxlo[0];
@@ -36,7 +36,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
   } else xlo = xscale*atof(arg[2]);
 
   if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[3],"INF") == 0) xhi = BIG;
     else if (domain->triclinic == 0) xhi = domain->boxhi[0];
@@ -44,7 +44,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
   } else xhi = xscale*atof(arg[3]);
 
   if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[4],"INF") == 0) ylo = -BIG;
     else if (domain->triclinic == 0) ylo = domain->boxlo[1];
@@ -52,7 +52,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
   } else ylo = yscale*atof(arg[4]);
 
   if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[5],"INF") == 0) yhi = BIG;
     else if (domain->triclinic == 0) yhi = domain->boxhi[1];
@@ -60,7 +60,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
   } else yhi = yscale*atof(arg[5]);
 
   if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[6],"INF") == 0) zlo = -BIG;
     else if (domain->triclinic == 0) zlo = domain->boxlo[2];
@@ -68,7 +68,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
   } else zlo = zscale*atof(arg[6]);
 
   if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[7],"INF") == 0) zhi = BIG;
     else if (domain->triclinic == 0) zhi = domain->boxhi[2];
diff --git a/src/region_block.h b/src/region_block.h
index 111051a3e3..1d1c065e6c 100644
--- a/src/region_block.h
+++ b/src/region_block.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/region_cone.cpp b/src/region_cone.cpp
index adb409118e..f692839c8f 100644
--- a/src/region_cone.cpp
+++ b/src/region_cone.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -33,7 +33,7 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
 {
   options(narg-9,&arg[9]);
 
-  if (strcmp(arg[2],"x") && strcmp(arg[2],"y") && strcmp(arg[2],"z")) 
+  if (strcmp(arg[2],"x") && strcmp(arg[2],"y") && strcmp(arg[2],"z"))
     error->all(FLERR,"Illegal region cylinder command");
   axis = arg[2][0];
 
@@ -55,7 +55,7 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
   }
 
   if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (axis == 'x') {
       if (strcmp(arg[7],"INF") == 0) lo = -BIG;
@@ -79,7 +79,7 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) :
   }
 
   if (strcmp(arg[8],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (axis == 'x') {
       if (strcmp(arg[8],"INF") == 0) hi = BIG;
@@ -218,7 +218,7 @@ int RegCone::surface_interior(double *x, double cutoff)
     currentradius = radiuslo + (x[0]-lo)*(radiushi-radiuslo)/(hi-lo);
 
     // x is exterior to cone
-    
+
     if (r > currentradius || x[0] < lo || x[0] > hi) return 0;
 
     // x is interior to cone or on its surface
@@ -238,11 +238,11 @@ int RegCone::surface_interior(double *x, double cutoff)
       delz = x[2] - xs[2];
       dist = sqrt(delx*delx + dely*dely + delz*delz);
       if (dist < cutoff) {
-	contact[n].r = dist;
-	contact[n].delx = delx;
-	contact[n].dely = dely;
-	contact[n].delz = delz;
-	n++;
+        contact[n].r = dist;
+        contact[n].delx = delx;
+        contact[n].dely = dely;
+        contact[n].delz = delz;
+        n++;
       }
     }
 
@@ -268,7 +268,7 @@ int RegCone::surface_interior(double *x, double cutoff)
     currentradius = radiuslo + (x[1]-lo)*(radiushi-radiuslo)/(hi-lo);
 
     // y is exterior to cone
-    
+
     if (r > currentradius || x[1] < lo || x[1] > hi) return 0;
 
     // y is interior to cone or on its surface
@@ -288,11 +288,11 @@ int RegCone::surface_interior(double *x, double cutoff)
       delz = x[2] - xs[2];
       dist = sqrt(delx*delx + dely*dely + delz*delz);
       if (dist < cutoff) {
-	contact[n].r = dist;
-	contact[n].delx = delx;
-	contact[n].dely = dely;
-	contact[n].delz = delz;
-	n++;
+        contact[n].r = dist;
+        contact[n].delx = delx;
+        contact[n].dely = dely;
+        contact[n].delz = delz;
+        n++;
       }
     }
 
@@ -318,7 +318,7 @@ int RegCone::surface_interior(double *x, double cutoff)
     currentradius = radiuslo + (x[2]-lo)*(radiushi-radiuslo)/(hi-lo);
 
     // z is exterior to cone
-    
+
     if (r > currentradius || x[2] < lo || x[2] > hi) return 0;
 
     // z is interior to cone or on its surface
@@ -338,11 +338,11 @@ int RegCone::surface_interior(double *x, double cutoff)
       delz = x[2] - xs[2];
       dist = sqrt(delx*delx + dely*dely + delz*delz);
       if (dist < cutoff) {
-	contact[n].r = dist;
-	contact[n].delx = delx;
-	contact[n].dely = dely;
-	contact[n].delz = delz;
-	n++;
+        contact[n].r = dist;
+        contact[n].delx = delx;
+        contact[n].dely = dely;
+        contact[n].delz = delz;
+        n++;
       }
     }
 
@@ -385,8 +385,8 @@ int RegCone::surface_exterior(double *x, double cutoff)
     // x is far enough from cone that there is no contact
     // x is interior to cone
 
-    if (r >= maxradius+cutoff || 
-	x[0] <= lo-cutoff || x[0] >= hi+cutoff) return 0;
+    if (r >= maxradius+cutoff ||
+        x[0] <= lo-cutoff || x[0] >= hi+cutoff) return 0;
     if (r < currentradius && x[0] > lo && x[0] < hi) return 0;
 
     // x is exterior to cone or on its surface
@@ -430,8 +430,8 @@ int RegCone::surface_exterior(double *x, double cutoff)
     // y is far enough from cone that there is no contact
     // y is interior to cone
 
-    if (r >= maxradius+cutoff || 
-	x[1] <= lo-cutoff || x[1] >= hi+cutoff) return 0;
+    if (r >= maxradius+cutoff ||
+        x[1] <= lo-cutoff || x[1] >= hi+cutoff) return 0;
     if (r < currentradius && x[1] > lo && x[1] < hi) return 0;
 
     // y is exterior to cone or on its surface
@@ -475,8 +475,8 @@ int RegCone::surface_exterior(double *x, double cutoff)
     // z is far enough from cone that there is no contact
     // z is interior to cone
 
-    if (r >= maxradius+cutoff || 
-	x[2] <= lo-cutoff || x[2] >= hi+cutoff) return 0;
+    if (r >= maxradius+cutoff ||
+        x[2] <= lo-cutoff || x[2] >= hi+cutoff) return 0;
     if (r < currentradius && x[2] > lo && x[2] < hi) return 0;
 
     // z is exterior to cone or on its surface
@@ -522,8 +522,8 @@ int RegCone::surface_exterior(double *x, double cutoff)
    else closest point is between A and B
 ------------------------------------------------------------------------- */
 
-void RegCone::point_on_line_segment(double *a, double *b, 
-				    double *c, double *d)
+void RegCone::point_on_line_segment(double *a, double *b,
+                                    double *c, double *d)
 {
   double ba[3],ca[3];
 
diff --git a/src/region_cone.h b/src/region_cone.h
index 782ebf2b3c..30f9c38fb7 100644
--- a/src/region_cone.h
+++ b/src/region_cone.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp
index 9aafb9ca87..d6d71ba9b9 100644
--- a/src/region_cylinder.cpp
+++ b/src/region_cylinder.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -29,7 +29,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
 {
   options(narg-8,&arg[8]);
 
-  if (strcmp(arg[2],"x") && strcmp(arg[2],"y") && strcmp(arg[2],"z")) 
+  if (strcmp(arg[2],"x") && strcmp(arg[2],"y") && strcmp(arg[2],"z"))
     error->all(FLERR,"Illegal region cylinder command");
   axis = arg[2][0];
 
@@ -48,7 +48,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
   }
 
   if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (axis == 'x') {
       if (strcmp(arg[6],"INF") == 0) lo = -BIG;
@@ -72,7 +72,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
   }
 
   if (strcmp(arg[7],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (axis == 'x') {
       if (strcmp(arg[7],"INF") == 0) hi = BIG;
@@ -195,7 +195,7 @@ int RegCylinder::surface_interior(double *x, double cutoff)
     r = sqrt(del1*del1 + del2*del2);
 
     // x is exterior to cylinder
-    
+
     if (r > radius || x[0] < lo || x[0] > hi) return 0;
 
     // x is interior to cylinder or on its surface
@@ -229,7 +229,7 @@ int RegCylinder::surface_interior(double *x, double cutoff)
     r = sqrt(del1*del1 + del2*del2);
 
     // y is exterior to cylinder
-    
+
     if (r > radius || x[1] < lo || x[1] > hi) return 0;
 
     // y is interior to cylinder or on its surface
@@ -263,7 +263,7 @@ int RegCylinder::surface_interior(double *x, double cutoff)
     r = sqrt(del1*del1 + del2*del2);
 
     // z is exterior to cylinder
-    
+
     if (r > radius || x[2] < lo || x[2] > hi) return 0;
 
     // z is interior to cylinder or on its surface
diff --git a/src/region_cylinder.h b/src/region_cylinder.h
index 63de0f1aed..93bb74aaff 100644
--- a/src/region_cylinder.h
+++ b/src/region_cylinder.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/region_intersect.cpp b/src/region_intersect.cpp
index 5618b46b27..1d3d78d186 100644
--- a/src/region_intersect.cpp
+++ b/src/region_intersect.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -56,13 +56,13 @@ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) :
     for (int ilist = 0; ilist < nregion; ilist++) {
       if (regions[list[ilist]]->bboxflag == 0) continue;
       if (first) {
-	extent_xlo = regions[list[ilist]]->extent_xlo;
-	extent_ylo = regions[list[ilist]]->extent_ylo;
-	extent_zlo = regions[list[ilist]]->extent_zlo;
-	extent_xhi = regions[list[ilist]]->extent_xhi;
-	extent_yhi = regions[list[ilist]]->extent_yhi;
-	extent_zhi = regions[list[ilist]]->extent_zhi;
-	first = 0;
+        extent_xlo = regions[list[ilist]]->extent_xlo;
+        extent_ylo = regions[list[ilist]]->extent_ylo;
+        extent_zlo = regions[list[ilist]]->extent_zlo;
+        extent_xhi = regions[list[ilist]]->extent_xhi;
+        extent_yhi = regions[list[ilist]]->extent_yhi;
+        extent_zhi = regions[list[ilist]]->extent_zhi;
+        first = 0;
       }
 
       extent_xlo = MAX(extent_xlo,regions[list[ilist]]->extent_xlo);
@@ -141,20 +141,20 @@ int RegIntersect::surface_interior(double *x, double cutoff)
       ys = x[1] - regions[iregion]->contact[m].dely;
       zs = x[2] - regions[iregion]->contact[m].delz;
       for (jlist = 0; jlist < nregion; jlist++) {
-	if (jlist == ilist) continue;
-	jregion = list[jlist];
-	if (!regions[jregion]->match(xs,ys,zs)) break;
+        if (jlist == ilist) continue;
+        jregion = list[jlist];
+        if (!regions[jregion]->match(xs,ys,zs)) break;
       }
       if (jlist == nregion) {
-	contact[n].r = regions[iregion]->contact[m].r;
-	contact[n].delx = regions[iregion]->contact[m].delx;
-	contact[n].dely = regions[iregion]->contact[m].dely;
-	contact[n].delz = regions[iregion]->contact[m].delz;
-	n++;
+        contact[n].r = regions[iregion]->contact[m].r;
+        contact[n].delx = regions[iregion]->contact[m].delx;
+        contact[n].dely = regions[iregion]->contact[m].dely;
+        contact[n].delz = regions[iregion]->contact[m].delz;
+        n++;
       }
     }
   }
-  
+
   return n;
 }
 
@@ -186,22 +186,22 @@ int RegIntersect::surface_exterior(double *x, double cutoff)
       ys = x[1] - regions[iregion]->contact[m].dely;
       zs = x[2] - regions[iregion]->contact[m].delz;
       for (jlist = 0; jlist < nregion; jlist++) {
-	if (jlist == ilist) continue;
-	jregion = list[jlist];
-	if (regions[jregion]->match(xs,ys,zs)) break;
+        if (jlist == ilist) continue;
+        jregion = list[jlist];
+        if (regions[jregion]->match(xs,ys,zs)) break;
       }
       if (jlist == nregion) {
-	contact[n].r = regions[iregion]->contact[m].r;
-	contact[n].delx = regions[iregion]->contact[m].delx;
-	contact[n].dely = regions[iregion]->contact[m].dely;
-	contact[n].delz = regions[iregion]->contact[m].delz;
-	n++;
+        contact[n].r = regions[iregion]->contact[m].r;
+        contact[n].delx = regions[iregion]->contact[m].delx;
+        contact[n].dely = regions[iregion]->contact[m].dely;
+        contact[n].delz = regions[iregion]->contact[m].delz;
+        n++;
       }
     }
   }
 
   for (ilist = 0; ilist < nregion; ilist++)
     regions[list[ilist]]->interior ^= 1;
-  
+
   return n;
 }
diff --git a/src/region_intersect.h b/src/region_intersect.h
index c5ad1a0b0d..a8bd460f34 100644
--- a/src/region_intersect.h
+++ b/src/region_intersect.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/region_plane.cpp b/src/region_plane.cpp
index aa2827422d..2a79553327 100644
--- a/src/region_plane.cpp
+++ b/src/region_plane.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/region_plane.h b/src/region_plane.h
index 8443a4c55e..a3445f2aaf 100644
--- a/src/region_plane.h
+++ b/src/region_plane.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/region_prism.cpp b/src/region_prism.cpp
index 72f40987cd..041865c632 100644
--- a/src/region_prism.cpp
+++ b/src/region_prism.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -34,42 +34,42 @@ RegPrism::RegPrism(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
   options(narg-11,&arg[11]);
 
   if (strcmp(arg[2],"INF") == 0 || strcmp(arg[2],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[2],"INF") == 0) xlo = -BIG;
     else xlo = domain->boxlo[0];
   } else xlo = xscale*atof(arg[2]);
 
   if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[3],"INF") == 0) xhi = BIG;
     else xhi = domain->boxhi[0];
   } else xhi = xscale*atof(arg[3]);
 
   if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[4],"INF") == 0) ylo = -BIG;
     else ylo = domain->boxlo[1];
   } else ylo = yscale*atof(arg[4]);
 
   if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[5],"INF") == 0) yhi = BIG;
     else yhi = domain->boxhi[1];
   } else yhi = yscale*atof(arg[5]);
 
   if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[6],"INF") == 0) zlo = -BIG;
     else zlo = domain->boxlo[2];
   } else zlo = zscale*atof(arg[6]);
 
   if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
-    if (domain->box_exist == 0) 
+    if (domain->box_exist == 0)
       error->all(FLERR,"Cannot use region INF or EDGE when box does not exist");
     if (strcmp(arg[7],"INF") == 0) zhi = BIG;
     else zhi = domain->boxhi[2];
@@ -102,14 +102,14 @@ RegPrism::RegPrism(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
     error->all(FLERR,"Illegal region prism command");
 
   // extent of prism
-  
+
   if (interior) {
     bboxflag = 1;
     extent_xlo = MIN(xlo,xlo+xy);
     extent_xlo = MIN(extent_xlo,extent_xlo+xz);
     extent_ylo = MIN(ylo,ylo+yz);
     extent_zlo = zlo;
-    
+
     extent_xhi = MAX(xhi,xhi+xy);
     extent_xhi = MAX(extent_xhi,extent_xhi+xz);
     extent_yhi = MAX(yhi,yhi+yz);
@@ -266,7 +266,7 @@ int RegPrism::surface_interior(double *x, double cutoff)
   for (i = 0; i < 6; i++) {
     if (i % 2) corner = chi;
     else corner = clo;
-    dot = (x[0]-corner[0])*face[i][0] + (x[1]-corner[1])*face[i][1] + 
+    dot = (x[0]-corner[0])*face[i][0] + (x[1]-corner[1])*face[i][1] +
       (x[2]-corner[2])*face[i][2];
     if (dot < 0.0) return 0;
   }
@@ -278,7 +278,7 @@ int RegPrism::surface_interior(double *x, double cutoff)
   for (int i = 0; i < 6; i++) {
     if (i % 2) corner = chi;
     else corner = clo;
-    dot = (x[0]-corner[0])*face[i][0] + (x[1]-corner[1])*face[i][1] + 
+    dot = (x[0]-corner[0])*face[i][0] + (x[1]-corner[1])*face[i][1] +
       (x[2]-corner[2])*face[i][2];
     if (dot < cutoff) {
       contact[n].r = dot;
@@ -310,7 +310,7 @@ int RegPrism::surface_exterior(double *x, double cutoff)
   for (i = 0; i < 6; i++) {
     if (i % 2) corner = chi;
     else corner = clo;
-    dot = (x[0]-corner[0])*face[i][0] + (x[1]-corner[1])*face[i][1] + 
+    dot = (x[0]-corner[0])*face[i][0] + (x[1]-corner[1])*face[i][1] +
       (x[2]-corner[2])*face[i][2];
     if (dot <= -cutoff) return 0;
   }
@@ -320,7 +320,7 @@ int RegPrism::surface_exterior(double *x, double cutoff)
   for (i = 0; i < 6; i++) {
     if (i % 2) corner = chi;
     else corner = clo;
-    dot = (x[0]-corner[0])*face[i][0] + (x[1]-corner[1])*face[i][1] + 
+    dot = (x[0]-corner[0])*face[i][0] + (x[1]-corner[1])*face[i][1] +
       (x[2]-corner[2])*face[i][2];
     if (dot <= 0.0) break;
   }
@@ -364,8 +364,8 @@ void RegPrism::find_nearest(double *x, double &xp, double &yp, double &zp)
     i = tri[itri][0];
     j = tri[itri][1];
     k = tri[itri][2];
-    dot = (x[0]-corners[i][0])*face[iface][0] + 
-      (x[1]-corners[i][1])*face[iface][1] + 
+    dot = (x[0]-corners[i][0])*face[iface][0] +
+      (x[1]-corners[i][1])*face[iface][1] +
       (x[2]-corners[i][2])*face[iface][2];
     xproj[0] = x[0] - dot*face[iface][0];
     xproj[1] = x[1] - dot*face[iface][1];
@@ -381,7 +381,7 @@ void RegPrism::find_nearest(double *x, double &xp, double &yp, double &zp)
       distsq = closest(x,xline,nearest,distsq);
     }
   }
-  
+
   xp = nearest[0];
   yp = nearest[1];
   zp = nearest[2];
@@ -397,7 +397,7 @@ void RegPrism::find_nearest(double *x, double &xp, double &yp, double &zp)
 ------------------------------------------------------------------------- */
 
 int RegPrism::inside_tri(double *x, double *v1, double *v2, double *v3,
-			 double *norm)
+                         double *norm)
 {
   double edge[3],pvec[3],xproduct[3];
 
@@ -428,8 +428,8 @@ int RegPrism::inside_tri(double *x, double *v1, double *v2, double *v3,
    else closest point is between A and B
 ------------------------------------------------------------------------- */
 
-void RegPrism::point_on_line_segment(double *a, double *b, 
-				     double *c, double *d)
+void RegPrism::point_on_line_segment(double *a, double *b,
+                                     double *c, double *d)
 {
   double ba[3],ca[3];
 
diff --git a/src/region_prism.h b/src/region_prism.h
index 01f813c5fc..b4ceb0e9b6 100644
--- a/src/region_prism.h
+++ b/src/region_prism.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp
index 80446b55a8..e90704dd74 100644
--- a/src/region_sphere.cpp
+++ b/src/region_sphere.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/region_sphere.h b/src/region_sphere.h
index 53bbafd44a..73556d07c3 100644
--- a/src/region_sphere.h
+++ b/src/region_sphere.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/region_union.cpp b/src/region_union.cpp
index ff566087ef..ca1e693f37 100644
--- a/src/region_union.cpp
+++ b/src/region_union.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -133,20 +133,20 @@ int RegUnion::surface_interior(double *x, double cutoff)
       ys = x[1] - regions[iregion]->contact[m].dely;
       zs = x[2] - regions[iregion]->contact[m].delz;
       for (jlist = 0; jlist < nregion; jlist++) {
-	if (jlist == ilist) continue;
-	jregion = list[jlist];
-	if (regions[jregion]->match(xs,ys,zs)) break;
+        if (jlist == ilist) continue;
+        jregion = list[jlist];
+        if (regions[jregion]->match(xs,ys,zs)) break;
       }
       if (jlist == nregion) {
-	contact[n].r = regions[iregion]->contact[m].r;
-	contact[n].delx = regions[iregion]->contact[m].delx;
-	contact[n].dely = regions[iregion]->contact[m].dely;
-	contact[n].delz = regions[iregion]->contact[m].delz;
-	n++;
+        contact[n].r = regions[iregion]->contact[m].r;
+        contact[n].delx = regions[iregion]->contact[m].delx;
+        contact[n].dely = regions[iregion]->contact[m].dely;
+        contact[n].delz = regions[iregion]->contact[m].delz;
+        n++;
       }
     }
   }
-  
+
   return n;
 }
 
@@ -178,22 +178,22 @@ int RegUnion::surface_exterior(double *x, double cutoff)
       ys = x[1] - regions[iregion]->contact[m].dely;
       zs = x[2] - regions[iregion]->contact[m].delz;
       for (jlist = 0; jlist < nregion; jlist++) {
-	if (jlist == ilist) continue;
-	jregion = list[jlist];
-	if (!regions[jregion]->match(xs,ys,zs)) break;
+        if (jlist == ilist) continue;
+        jregion = list[jlist];
+        if (!regions[jregion]->match(xs,ys,zs)) break;
       }
       if (jlist == nregion) {
-	contact[n].r = regions[iregion]->contact[m].r;
-	contact[n].delx = regions[iregion]->contact[m].delx;
-	contact[n].dely = regions[iregion]->contact[m].dely;
-	contact[n].delz = regions[iregion]->contact[m].delz;
-	n++;
+        contact[n].r = regions[iregion]->contact[m].r;
+        contact[n].delx = regions[iregion]->contact[m].delx;
+        contact[n].dely = regions[iregion]->contact[m].dely;
+        contact[n].delz = regions[iregion]->contact[m].delz;
+        n++;
       }
     }
   }
 
   for (ilist = 0; ilist < nregion; ilist++)
     regions[list[ilist]]->interior ^= 1;
-  
+
   return n;
 }
diff --git a/src/region_union.h b/src/region_union.h
index aace98bfc4..44d99375c9 100644
--- a/src/region_union.h
+++ b/src/region_union.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/replicate.cpp b/src/replicate.cpp
index d430be744d..90101668b0 100644
--- a/src/replicate.cpp
+++ b/src/replicate.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -57,13 +57,13 @@ void Replicate::command(int narg, char **arg)
 
   // error and warning checks
 
-  if (nx <= 0 || ny <= 0 || nz <= 0) 
+  if (nx <= 0 || ny <= 0 || nz <= 0)
     error->all(FLERR,"Illegal replicate command");
   if (domain->dimension == 2 && nz != 1)
     error->all(FLERR,"Cannot replicate 2d simulation in z dimension");
-  if ((nx > 1 && domain->xperiodic == 0) || 
+  if ((nx > 1 && domain->xperiodic == 0) ||
       (ny > 1 && domain->yperiodic == 0) ||
-      (nz > 1 && domain->zperiodic == 0)) { 
+      (nz > 1 && domain->zperiodic == 0)) {
     if (comm->me == 0)
       error->warning(FLERR,"Replicating in a non-periodic dimension");
   }
@@ -137,9 +137,9 @@ void Replicate::command(int narg, char **arg)
       atom->tag[i] = 0;
 
   if (nrep*old->natoms < 0 || nrep*old->natoms > MAXBIGINT ||
-      nrep*old->nbonds < 0 || nrep*old->nbonds > MAXBIGINT || 
-      nrep*old->nangles < 0 || nrep*old->nangles > MAXBIGINT || 
-      nrep*old->ndihedrals < 0 || nrep*old->ndihedrals > MAXBIGINT || 
+      nrep*old->nbonds < 0 || nrep*old->nbonds > MAXBIGINT ||
+      nrep*old->nangles < 0 || nrep*old->nangles > MAXBIGINT ||
+      nrep*old->ndihedrals < 0 || nrep*old->ndihedrals > MAXBIGINT ||
       nrep*old->nimpropers < 0 || nrep*old->nimpropers > MAXBIGINT)
     error->all(FLERR,"Replicated system is too big");
 
@@ -156,7 +156,7 @@ void Replicate::command(int narg, char **arg)
   atom->nangletypes = old->nangletypes;
   atom->ndihedraltypes = old->ndihedraltypes;
   atom->nimpropertypes = old->nimpropertypes;
-  
+
   atom->bond_per_atom = old->bond_per_atom;
   atom->angle_per_atom = old->angle_per_atom;
   atom->dihedral_per_atom = old->dihedral_per_atom;
@@ -270,77 +270,77 @@ void Replicate::command(int narg, char **arg)
 
     for (ix = 0; ix < nx; ix++) {
       for (iy = 0; iy < ny; iy++) {
-	for (iz = 0; iz < nz; iz++) {
-
-	  // while loop over one proc's atom list
-
-	  m = 0;
-	  while (m < n) {
-	    image = (512 << 20) | (512 << 10) | 512;
-	    if (triclinic == 0) {
-	      x[0] = buf[m+1] + ix*old_xprd;
-	      x[1] = buf[m+2] + iy*old_yprd;
-	      x[2] = buf[m+3] + iz*old_zprd;
-	    } else {
-	      x[0] = buf[m+1] + ix*old_xprd + iy*old_xy + iz*old_xz;
-	      x[1] = buf[m+2] + iy*old_yprd + iz*old_yz;
-	      x[2] = buf[m+3] + iz*old_zprd;
-	    }
-	    domain->remap(x,image);
-	    if (triclinic) {
-	      domain->x2lamda(x,lamda);
-	      coord = lamda;
-	    } else coord = x;
-
-	    if (coord[0] >= sublo[0] && coord[0] < subhi[0] && 
-		coord[1] >= sublo[1] && coord[1] < subhi[1] && 
-		coord[2] >= sublo[2] && coord[2] < subhi[2]) {
-
-	      m += avec->unpack_restart(&buf[m]);
-
-	      i = atom->nlocal - 1;
-	      if (tag_enable)
-		atom_offset = iz*ny*nx*maxtag + iy*nx*maxtag + ix*maxtag;
-	      else atom_offset = 0;
-	      mol_offset = iz*ny*nx*maxmol + iy*nx*maxmol + ix*maxmol;
-
-	      atom->x[i][0] = x[0];
-	      atom->x[i][1] = x[1];
-	      atom->x[i][2] = x[2];
-
-	      atom->tag[i] += atom_offset;
-	      atom->image[i] = image;
-
-	      if (atom->molecular) {
-		if (atom->molecule[i] > 0)
-		  atom->molecule[i] += mol_offset;
-		if (atom->avec->bonds_allow)
-		  for (j = 0; j < atom->num_bond[i]; j++)
-		    atom->bond_atom[i][j] += atom_offset;
-		if (atom->avec->angles_allow)
-		  for (j = 0; j < atom->num_angle[i]; j++) {
-		    atom->angle_atom1[i][j] += atom_offset;
-		    atom->angle_atom2[i][j] += atom_offset;
-		    atom->angle_atom3[i][j] += atom_offset;
-		  }
-		if (atom->avec->dihedrals_allow)
-		  for (j = 0; j < atom->num_dihedral[i]; j++) {
-		    atom->dihedral_atom1[i][j] += atom_offset;
-		    atom->dihedral_atom2[i][j] += atom_offset;
-		    atom->dihedral_atom3[i][j] += atom_offset;
-		    atom->dihedral_atom4[i][j] += atom_offset;
-		  }
-		if (atom->avec->impropers_allow)
-		  for (j = 0; j < atom->num_improper[i]; j++) {
-		    atom->improper_atom1[i][j] += atom_offset;
-		    atom->improper_atom2[i][j] += atom_offset;
-		    atom->improper_atom3[i][j] += atom_offset;
-		    atom->improper_atom4[i][j] += atom_offset;
-		  }
-	      }
-	    } else m += static_cast<int> (buf[m]);
-	  }
-	}
+        for (iz = 0; iz < nz; iz++) {
+
+          // while loop over one proc's atom list
+
+          m = 0;
+          while (m < n) {
+            image = (512 << 20) | (512 << 10) | 512;
+            if (triclinic == 0) {
+              x[0] = buf[m+1] + ix*old_xprd;
+              x[1] = buf[m+2] + iy*old_yprd;
+              x[2] = buf[m+3] + iz*old_zprd;
+            } else {
+              x[0] = buf[m+1] + ix*old_xprd + iy*old_xy + iz*old_xz;
+              x[1] = buf[m+2] + iy*old_yprd + iz*old_yz;
+              x[2] = buf[m+3] + iz*old_zprd;
+            }
+            domain->remap(x,image);
+            if (triclinic) {
+              domain->x2lamda(x,lamda);
+              coord = lamda;
+            } else coord = x;
+
+            if (coord[0] >= sublo[0] && coord[0] < subhi[0] &&
+                coord[1] >= sublo[1] && coord[1] < subhi[1] &&
+                coord[2] >= sublo[2] && coord[2] < subhi[2]) {
+
+              m += avec->unpack_restart(&buf[m]);
+
+              i = atom->nlocal - 1;
+              if (tag_enable)
+                atom_offset = iz*ny*nx*maxtag + iy*nx*maxtag + ix*maxtag;
+              else atom_offset = 0;
+              mol_offset = iz*ny*nx*maxmol + iy*nx*maxmol + ix*maxmol;
+
+              atom->x[i][0] = x[0];
+              atom->x[i][1] = x[1];
+              atom->x[i][2] = x[2];
+
+              atom->tag[i] += atom_offset;
+              atom->image[i] = image;
+
+              if (atom->molecular) {
+                if (atom->molecule[i] > 0)
+                  atom->molecule[i] += mol_offset;
+                if (atom->avec->bonds_allow)
+                  for (j = 0; j < atom->num_bond[i]; j++)
+                    atom->bond_atom[i][j] += atom_offset;
+                if (atom->avec->angles_allow)
+                  for (j = 0; j < atom->num_angle[i]; j++) {
+                    atom->angle_atom1[i][j] += atom_offset;
+                    atom->angle_atom2[i][j] += atom_offset;
+                    atom->angle_atom3[i][j] += atom_offset;
+                  }
+                if (atom->avec->dihedrals_allow)
+                  for (j = 0; j < atom->num_dihedral[i]; j++) {
+                    atom->dihedral_atom1[i][j] += atom_offset;
+                    atom->dihedral_atom2[i][j] += atom_offset;
+                    atom->dihedral_atom3[i][j] += atom_offset;
+                    atom->dihedral_atom4[i][j] += atom_offset;
+                  }
+                if (atom->avec->impropers_allow)
+                  for (j = 0; j < atom->num_improper[i]; j++) {
+                    atom->improper_atom1[i][j] += atom_offset;
+                    atom->improper_atom2[i][j] += atom_offset;
+                    atom->improper_atom3[i][j] += atom_offset;
+                    atom->improper_atom4[i][j] += atom_offset;
+                  }
+              }
+            } else m += static_cast<int> (buf[m]);
+          }
+        }
       }
     }
   }
@@ -363,7 +363,7 @@ void Replicate::command(int narg, char **arg)
 
   if (natoms != atom->natoms)
     error->all(FLERR,"Replicate did not assign all atoms correctly");
-  
+
   if (me == 0) {
     if (atom->nbonds) {
       if (screen) fprintf(screen,"  " BIGINT_FORMAT " bonds\n",atom->nbonds);
@@ -371,21 +371,21 @@ void Replicate::command(int narg, char **arg)
     }
     if (atom->nangles) {
       if (screen) fprintf(screen,"  " BIGINT_FORMAT " angles\n",
-			  atom->nangles);
+                          atom->nangles);
       if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " angles\n",
-			   atom->nangles);
+                           atom->nangles);
     }
     if (atom->ndihedrals) {
       if (screen) fprintf(screen,"  " BIGINT_FORMAT " dihedrals\n",
-			  atom->ndihedrals);
+                          atom->ndihedrals);
       if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " dihedrals\n",
-			   atom->ndihedrals);
+                           atom->ndihedrals);
     }
     if (atom->nimpropers) {
       if (screen) fprintf(screen,"  " BIGINT_FORMAT " impropers\n",
-			  atom->nimpropers);
+                          atom->nimpropers);
       if (logfile) fprintf(logfile,"  " BIGINT_FORMAT " impropers\n",
-			   atom->nimpropers);
+                           atom->nimpropers);
     }
   }
 
diff --git a/src/replicate.h b/src/replicate.h
index 5c8f8eb967..79350cdfb3 100644
--- a/src/replicate.h
+++ b/src/replicate.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/respa.cpp b/src/respa.cpp
index aedfa03027..51be81ebe8 100644
--- a/src/respa.cpp
+++ b/src/respa.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -112,13 +112,13 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg)
 
   // cannot specify both pair and inner/middle/outer
 
-  if (level_pair >= 0 && 
+  if (level_pair >= 0 &&
       (level_inner >= 0 || level_middle >= 0 || level_outer >= 0))
     error->all(FLERR,"Cannot set both respa pair and inner/middle/outer");
 
   // if either inner and outer is specified, then both must be
 
-  if ((level_inner >= 0 && level_outer == -1) || 
+  if ((level_inner >= 0 && level_outer == -1) ||
       (level_outer >= 0 && level_inner == -1))
     error->all(FLERR,"Must set both respa inner and outer");
 
@@ -148,39 +148,39 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg)
     if (screen) {
       fprintf(screen,"Respa levels:\n");
       for (int i = 0; i < nlevels; i++) {
-	fprintf(screen,"  %d =",i);
-	if (level_bond == i) fprintf(screen," bond");
-	if (level_angle == i) fprintf(screen," angle");
-	if (level_dihedral == i) fprintf(screen," dihedral");
-	if (level_improper == i) fprintf(screen," improper");
-	if (level_pair == i) fprintf(screen," pair");
-	if (level_inner == i) fprintf(screen," pair-inner");
-	if (level_middle == i) fprintf(screen," pair-middle");
-	if (level_outer == i) fprintf(screen," pair-outer");
-	if (level_kspace == i) fprintf(screen," kspace");
-	fprintf(screen,"\n");
+        fprintf(screen,"  %d =",i);
+        if (level_bond == i) fprintf(screen," bond");
+        if (level_angle == i) fprintf(screen," angle");
+        if (level_dihedral == i) fprintf(screen," dihedral");
+        if (level_improper == i) fprintf(screen," improper");
+        if (level_pair == i) fprintf(screen," pair");
+        if (level_inner == i) fprintf(screen," pair-inner");
+        if (level_middle == i) fprintf(screen," pair-middle");
+        if (level_outer == i) fprintf(screen," pair-outer");
+        if (level_kspace == i) fprintf(screen," kspace");
+        fprintf(screen,"\n");
       }
     }
     if (logfile) {
       fprintf(logfile,"Respa levels:\n");
       for (int i = 0; i < nlevels; i++) {
-	fprintf(logfile,"  %d =",i);
-	if (level_bond == i) fprintf(logfile," bond");
-	if (level_angle == i) fprintf(logfile," angle");
-	if (level_dihedral == i) fprintf(logfile," dihedral");
-	if (level_improper == i) fprintf(logfile," improper");
-	if (level_pair == i) fprintf(logfile," pair");
-	if (level_inner == i) fprintf(logfile," pair-inner");
-	if (level_middle == i) fprintf(logfile," pair-middle");
-	if (level_outer == i) fprintf(logfile," pair-outer");
-	if (level_kspace == i) fprintf(logfile," kspace");
-	fprintf(logfile,"\n");
+        fprintf(logfile,"  %d =",i);
+        if (level_bond == i) fprintf(logfile," bond");
+        if (level_angle == i) fprintf(logfile," angle");
+        if (level_dihedral == i) fprintf(logfile," dihedral");
+        if (level_improper == i) fprintf(logfile," improper");
+        if (level_pair == i) fprintf(logfile," pair");
+        if (level_inner == i) fprintf(logfile," pair-inner");
+        if (level_middle == i) fprintf(logfile," pair-middle");
+        if (level_outer == i) fprintf(logfile," pair-outer");
+        if (level_kspace == i) fprintf(logfile," kspace");
+        fprintf(logfile,"\n");
       }
     }
   }
 
   // check that levels are in correct order
-  
+
   if (level_angle < level_bond || level_dihedral < level_angle ||
       level_improper < level_dihedral)
     error->all(FLERR,"Invalid order of forces within respa levels");
@@ -190,12 +190,12 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg)
   }
   if (level_pair == -1 && level_middle == -1) {
     if (level_inner < level_improper || level_outer < level_inner ||
-	level_kspace != level_outer)
+        level_kspace != level_outer)
       error->all(FLERR,"Invalid order of forces within respa levels");
   }
   if (level_pair == -1 && level_middle >= 0) {
     if (level_inner < level_improper || level_middle < level_inner ||
-	level_outer < level_inner || level_kspace != level_outer)
+        level_outer < level_inner || level_kspace != level_outer)
       error->all(FLERR,"Invalid order of forces within respa levels");
   }
 
@@ -204,9 +204,9 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg)
   int flag = 0;
   for (int i = 0; i < nlevels; i++)
     if (level_bond != i && level_angle != i && level_dihedral != i &&
-	level_improper != i && level_pair != i && level_inner != i &&
-	level_middle != i && level_outer != i && level_kspace != i) flag = 1;
-  if (flag && comm->me == 0) 
+        level_improper != i && level_pair != i && level_inner != i &&
+        level_middle != i && level_outer != i && level_kspace != i) flag = 1;
+  if (flag && comm->me == 0)
     error->warning(FLERR,"One or more respa levels compute no forces");
 
   // check cutoff consistency if inner/middle/outer are enabled
@@ -294,7 +294,7 @@ void Respa::init()
   // step[] = timestep for each level
 
   step[nlevels-1] = update->dt;
-  for (int ilevel = nlevels-2; ilevel >= 0; ilevel--) 
+  for (int ilevel = nlevels-2; ilevel >= 0; ilevel--)
     step[ilevel] = step[ilevel+1]/loop[ilevel];
 
   // set newton flag for each level
@@ -302,14 +302,14 @@ void Respa::init()
   for (int ilevel = 0; ilevel < nlevels; ilevel++) {
     newton[ilevel] = 0;
     if (force->newton_bond) {
-      if (level_bond == ilevel || level_angle == ilevel || 
-	  level_dihedral == ilevel || level_improper == ilevel)
-	newton[ilevel] = 1;
+      if (level_bond == ilevel || level_angle == ilevel ||
+          level_dihedral == ilevel || level_improper == ilevel)
+        newton[ilevel] = 1;
     }
     if (force->newton_pair) {
-      if (level_pair == ilevel || level_inner == ilevel || 
-	  level_middle == ilevel || level_outer == ilevel)
-	newton[ilevel] = 1;
+      if (level_pair == ilevel || level_inner == ilevel ||
+          level_middle == ilevel || level_outer == ilevel)
+        newton[ilevel] = 1;
     }
   }
 
@@ -355,11 +355,11 @@ void Respa::setup()
     modify->setup_pre_force_respa(vflag,ilevel);
     if (level_bond == ilevel && force->bond)
       force->bond->compute(eflag,vflag);
-    if (level_angle == ilevel && force->angle) 
+    if (level_angle == ilevel && force->angle)
       force->angle->compute(eflag,vflag);
-    if (level_dihedral == ilevel && force->dihedral) 
+    if (level_dihedral == ilevel && force->dihedral)
       force->dihedral->compute(eflag,vflag);
-    if (level_improper == ilevel && force->improper) 
+    if (level_improper == ilevel && force->improper)
       force->improper->compute(eflag,vflag);
     if (level_pair == ilevel && pair_compute_flag)
       force->pair->compute(eflag,vflag);
@@ -376,7 +376,7 @@ void Respa::setup()
     if (newton[ilevel]) comm->reverse_comm();
     copy_f_flevel(ilevel);
   }
-  
+
   modify->setup(vflag);
   sum_flevel_f();
   output->setup(1);
@@ -419,11 +419,11 @@ void Respa::setup_minimal(int flag)
     modify->setup_pre_force_respa(vflag,ilevel);
     if (level_bond == ilevel && force->bond)
       force->bond->compute(eflag,vflag);
-    if (level_angle == ilevel && force->angle) 
+    if (level_angle == ilevel && force->angle)
       force->angle->compute(eflag,vflag);
-    if (level_dihedral == ilevel && force->dihedral) 
+    if (level_dihedral == ilevel && force->dihedral)
       force->dihedral->compute(eflag,vflag);
-    if (level_improper == ilevel && force->improper) 
+    if (level_improper == ilevel && force->improper)
       force->improper->compute(eflag,vflag);
     if (level_pair == ilevel && pair_compute_flag)
       force->pair->compute(eflag,vflag);
@@ -440,7 +440,7 @@ void Respa::setup_minimal(int flag)
     if (newton[ilevel]) comm->reverse_comm();
     copy_f_flevel(ilevel);
   }
-  
+
   modify->setup(vflag);
   sum_flevel_f();
   update->setupflag = 0;
@@ -487,7 +487,7 @@ void Respa::cleanup()
 void Respa::reset_dt()
 {
   step[nlevels-1] = update->dt;
-  for (int ilevel = nlevels-2; ilevel >= 0; ilevel--) 
+  for (int ilevel = nlevels-2; ilevel >= 0; ilevel--)
     step[ilevel] = step[ilevel+1]/loop[ilevel];
 }
 
@@ -512,24 +512,24 @@ void Respa::recurse(int ilevel)
     if (ilevel == nlevels-1) {
       int nflag = neighbor->decide();
       if (nflag) {
-	if (modify->n_pre_exchange) modify->pre_exchange();
-	if (triclinic) domain->x2lamda(atom->nlocal);
-	domain->pbc();
-	if (domain->box_change) {
-	  domain->reset_box();
-	  comm->setup();
-	  if (neighbor->style) neighbor->setup_bins();
-	}
-	timer->stamp();
-	comm->exchange();
-	if (atom->sortfreq > 0 && 
-	    update->ntimestep >= atom->nextsort) atom->sort();
-	comm->borders();
-	if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
-	timer->stamp(TIME_COMM);
-	if (modify->n_pre_neighbor) modify->pre_neighbor();
-	neighbor->build();
-	timer->stamp(TIME_NEIGHBOR);
+        if (modify->n_pre_exchange) modify->pre_exchange();
+        if (triclinic) domain->x2lamda(atom->nlocal);
+        domain->pbc();
+        if (domain->box_change) {
+          domain->reset_box();
+          comm->setup();
+          if (neighbor->style) neighbor->setup_bins();
+        }
+        timer->stamp();
+        comm->exchange();
+        if (atom->sortfreq > 0 &&
+            update->ntimestep >= atom->nextsort) atom->sort();
+        comm->borders();
+        if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
+        timer->stamp(TIME_COMM);
+        if (modify->n_pre_neighbor) modify->pre_neighbor();
+        neighbor->build();
+        timer->stamp(TIME_NEIGHBOR);
       }
 
     } else if (ilevel == 0) {
@@ -584,7 +584,7 @@ void Respa::recurse(int ilevel)
       comm->reverse_comm();
       timer->stamp(TIME_COMM);
     }
-  
+
     if (modify->n_post_force_respa)
       modify->post_force_respa(vflag,ilevel,iloop);
     modify->final_integrate_respa(ilevel,iloop);
@@ -636,7 +636,7 @@ void Respa::force_clear(int newtonflag)
     double *de = atom->de;
     for (i = 0; i < nall; i++) de[i] = 0.0;
   }
-  
+
   if (rho_flag) {
     double *drho = atom->drho;
     for (i = 0; i < nall; i++) drho[i] = 0.0;
diff --git a/src/respa.h b/src/respa.h
index 126a56cfc0..e54bd2a669 100644
--- a/src/respa.h
+++ b/src/respa.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/run.cpp b/src/run.cpp
index 6ec64fe174..781001ae9f 100644
--- a/src/run.cpp
+++ b/src/run.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -54,7 +54,7 @@ void Run::command(int narg, char **arg)
   int nevery = 0;
   int ncommands = 0;
   int first,last;
-    
+
   int iarg = 1;
   while (iarg < narg) {
     if (strcmp(arg[iarg],"upto") == 0) {
@@ -101,7 +101,7 @@ void Run::command(int narg, char **arg)
   }
 
   // set nsteps as integer, using upto value if specified
-  
+
   int nsteps;
   if (!uptoflag) {
     if (nsteps_input < 0 || nsteps_input > MAXSMALLINT)
@@ -195,7 +195,7 @@ void Run::command(int narg, char **arg)
       update->firststep = update->ntimestep;
       update->laststep = update->ntimestep + nsteps;
       if (update->laststep < 0 || update->laststep > MAXBIGINT)
-	error->all(FLERR,"Too many timesteps");
+        error->all(FLERR,"Too many timesteps");
 
       if (startflag) update->beginstep = start;
       else update->beginstep = update->firststep;
@@ -203,8 +203,8 @@ void Run::command(int narg, char **arg)
       else update->endstep = update->laststep;
 
       if (preflag || iter == 0) {
-	lmp->init();
-	update->integrate->setup();
+        lmp->init();
+        update->integrate->setup();
       } else output->setup(0);
 
       timer->init();
@@ -222,9 +222,9 @@ void Run::command(int narg, char **arg)
       // since a command may invoke computes via variables
 
       if (ncommands) {
-	modify->clearstep_compute();
-	for (int i = 0; i < ncommands; i++) input->one(commands[i]);
-	modify->addstep_compute(update->ntimestep + nevery);
+        modify->clearstep_compute();
+        for (int i = 0; i < ncommands; i++) input->one(commands[i]);
+        modify->addstep_compute(update->ntimestep + nevery);
       }
 
       nleft -= nsteps;
diff --git a/src/run.h b/src/run.h
index 8d2b8ad0eb..00a24d4999 100644
--- a/src/run.h
+++ b/src/run.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/set.cpp b/src/set.cpp
index 4b2d7f0b04..eaa34538ba 100644
--- a/src/set.cpp
+++ b/src/set.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -79,12 +79,12 @@ void Set::command(int narg, char **arg)
   while (iarg < narg) {
     count = 0;
     origarg = iarg;
-    
+
     if (strcmp(arg[iarg],"type") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (ivalue <= 0 || ivalue > atom->ntypes)
-	error->all(FLERR,"Invalid value in set command");
+        error->all(FLERR,"Invalid value in set command");
       set(TYPE);
       iarg += 2;
     } else if (strcmp(arg[iarg],"type/fraction") == 0) {
@@ -93,18 +93,18 @@ void Set::command(int narg, char **arg)
       fraction = atof(arg[iarg+2]);
       ivalue = atoi(arg[iarg+3]);
       if (newtype <= 0 || newtype > atom->ntypes)
-	error->all(FLERR,"Invalid value in set command");
-      if (fraction < 0.0 || fraction > 1.0) 
-	error->all(FLERR,"Invalid value in set command");
-      if (ivalue <= 0) 
-	error->all(FLERR,"Invalid random number seed in set command");
+        error->all(FLERR,"Invalid value in set command");
+      if (fraction < 0.0 || fraction > 1.0)
+        error->all(FLERR,"Invalid value in set command");
+      if (ivalue <= 0)
+        error->all(FLERR,"Invalid random number seed in set command");
       setrandom(TYPE_FRACTION);
       iarg += 4;
     } else if (strcmp(arg[iarg],"mol") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (!atom->molecule_flag)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       set(MOLECULE);
       iarg += 2;
     } else if (strcmp(arg[iarg],"x") == 0) {
@@ -126,14 +126,14 @@ void Set::command(int narg, char **arg)
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->q_flag)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       set(CHARGE);
       iarg += 2;
     } else if (strcmp(arg[iarg],"mass") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->rmass_flag)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       if (dvalue <= 0.0) error->all(FLERR,"Invalid mass in set command");
       set(MASS);
       iarg += 2;
@@ -143,12 +143,12 @@ void Set::command(int narg, char **arg)
       yvalue = atof(arg[iarg+2]);
       zvalue = atof(arg[iarg+3]);
       if (!atom->ellipsoid_flag)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       if (xvalue < 0.0 || yvalue < 0.0 || zvalue < 0.0)
-	error->all(FLERR,"Invalid shape in set command");
+        error->all(FLERR,"Invalid shape in set command");
       if (xvalue > 0.0 || yvalue > 0.0 || zvalue > 0.0) {
-	if (xvalue == 0.0 || yvalue == 0.0 || zvalue == 0.0)
-	  error->one(FLERR,"Invalid shape in set command");
+        if (xvalue == 0.0 || yvalue == 0.0 || zvalue == 0.0)
+          error->one(FLERR,"Invalid shape in set command");
       }
       set(SHAPE);
       iarg += 4;
@@ -174,7 +174,7 @@ void Set::command(int narg, char **arg)
       yvalue = atof(arg[iarg+2]);
       zvalue = atof(arg[iarg+3]);
       if (!atom->mu_flag)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       set(DIPOLE);
       iarg += 4;
     } else if (strcmp(arg[iarg],"dipole/random") == 0) {
@@ -182,11 +182,11 @@ void Set::command(int narg, char **arg)
       ivalue = atoi(arg[iarg+1]);
       dvalue = atof(arg[iarg+2]);
       if (!atom->mu_flag)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
-      if (ivalue <= 0) 
-	error->all(FLERR,"Invalid random number seed in set command");
-      if (dvalue <= 0.0) 
-	error->all(FLERR,"Invalid dipole length in set command");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
+      if (ivalue <= 0)
+        error->all(FLERR,"Invalid random number seed in set command");
+      if (dvalue <= 0.0)
+        error->all(FLERR,"Invalid dipole length in set command");
       setrandom(DIPOLE_RANDOM);
       iarg += 3;
     } else if (strcmp(arg[iarg],"quat") == 0) {
@@ -196,16 +196,16 @@ void Set::command(int narg, char **arg)
       zvalue = atof(arg[iarg+3]);
       wvalue = atof(arg[iarg+4]);
       if (!atom->ellipsoid_flag && !atom->tri_flag)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       set(QUAT);
       iarg += 5;
     } else if (strcmp(arg[iarg],"quat/random") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (!atom->ellipsoid_flag && !atom->tri_flag)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
-      if (ivalue <= 0) 
-	error->all(FLERR,"Invalid random number seed in set command");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
+      if (ivalue <= 0)
+        error->all(FLERR,"Invalid random number seed in set command");
       setrandom(QUAT_RANDOM);
       iarg += 2;
     } else if (strcmp(arg[iarg],"theta") == 0) {
@@ -251,96 +251,96 @@ void Set::command(int narg, char **arg)
       if (iarg+4 > narg) error->all(FLERR,"Illegal set command");
       ximageflag = yimageflag = zimageflag = 0;
       if (strcmp(arg[iarg+1],"NULL") != 0) {
-	ximageflag = 1;
-	ximage = atoi(arg[iarg+1]);
+        ximageflag = 1;
+        ximage = atoi(arg[iarg+1]);
       }
       if (strcmp(arg[iarg+2],"NULL") != 0) {
-	yimageflag = 1;
-	yimage = atoi(arg[iarg+2]);
+        yimageflag = 1;
+        yimage = atoi(arg[iarg+2]);
       }
       if (strcmp(arg[iarg+3],"NULL") != 0) {
-	zimageflag = 1;
-	zimage = atoi(arg[iarg+3]);
+        zimageflag = 1;
+        zimage = atoi(arg[iarg+3]);
       }
-      if (ximageflag && ximage && !domain->xperiodic) 
-	error->all(FLERR,
-		   "Cannot set non-zero image flag for non-periodic dimension");
-      if (yimageflag && yimage && !domain->yperiodic) 
-	error->all(FLERR,
-		   "Cannot set non-zero image flag for non-periodic dimension");
-      if (zimageflag && zimage && !domain->zperiodic) 
-	error->all(FLERR,
-		   "Cannot set non-zero image flag for non-periodic dimension");
+      if (ximageflag && ximage && !domain->xperiodic)
+        error->all(FLERR,
+                   "Cannot set non-zero image flag for non-periodic dimension");
+      if (yimageflag && yimage && !domain->yperiodic)
+        error->all(FLERR,
+                   "Cannot set non-zero image flag for non-periodic dimension");
+      if (zimageflag && zimage && !domain->zperiodic)
+        error->all(FLERR,
+                   "Cannot set non-zero image flag for non-periodic dimension");
       set(IMAGE);
       iarg += 4;
     } else if (strcmp(arg[iarg],"bond") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (atom->avec->bonds_allow == 0)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       if (ivalue <= 0 || ivalue > atom->nbondtypes)
-	error->all(FLERR,"Invalid value in set command");
+        error->all(FLERR,"Invalid value in set command");
       topology(BOND);
       iarg += 2;
     } else if (strcmp(arg[iarg],"angle") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (atom->avec->angles_allow == 0)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       if (ivalue <= 0 || ivalue > atom->nangletypes)
-	error->all(FLERR,"Invalid value in set command");
+        error->all(FLERR,"Invalid value in set command");
       topology(ANGLE);
       iarg += 2;
     } else if (strcmp(arg[iarg],"dihedral") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (atom->avec->dihedrals_allow == 0)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       if (ivalue <= 0 || ivalue > atom->ndihedraltypes)
-	error->all(FLERR,"Invalid value in set command");
+        error->all(FLERR,"Invalid value in set command");
       topology(DIHEDRAL);
       iarg += 2;
     } else if (strcmp(arg[iarg],"improper") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       ivalue = atoi(arg[iarg+1]);
       if (atom->avec->impropers_allow == 0)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       if (ivalue <= 0 || ivalue > atom->nimpropertypes)
-	error->all(FLERR,"Invalid value in set command");
+        error->all(FLERR,"Invalid value in set command");
       topology(IMPROPER);
       iarg += 2;
     } else if (strcmp(arg[iarg],"meso_e") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->e_flag)
-	error->all(FLERR,"Cannot set this attribute for this atom style");
+        error->all(FLERR,"Cannot set this attribute for this atom style");
       set(MESO_E);
       iarg += 2;
     } else if (strcmp(arg[iarg],"meso_cv") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->cv_flag)
-    	error->all(FLERR,"Cannot set this attribute for this atom style");
+            error->all(FLERR,"Cannot set this attribute for this atom style");
       set(MESO_CV);
       iarg += 2;
     } else if (strcmp(arg[iarg],"meso_rho") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
       dvalue = atof(arg[iarg+1]);
       if (!atom->rho_flag)
-	error->all(FLERR,"Cannot set meso_rho for this atom style");
+        error->all(FLERR,"Cannot set meso_rho for this atom style");
       set(MESO_RHO);
       iarg += 2;
-    } else error->all(FLERR,"Illegal set command");    
+    } else error->all(FLERR,"Illegal set command");
 
     // statistics
 
     MPI_Allreduce(&count,&allcount,1,MPI_INT,MPI_SUM,world);
-    
+
     if (comm->me == 0) {
       if (screen) fprintf(screen,"  %d settings made for %s\n",
-			  allcount,arg[origarg]);
+                          allcount,arg[origarg]);
       if (logfile) fprintf(logfile,"  %d settings made for %s\n",
-			   allcount,arg[origarg]);
+                           allcount,arg[origarg]);
     }
   }
 
@@ -407,7 +407,7 @@ void Set::selection(int n)
     double **x = atom->x;
     for (int i = 0; i < n; i++)
       if (domain->regions[iregion]->match(x[i][0],x[i][1],x[i][2]))
-	select[i] = 1;
+        select[i] = 1;
       else select[i] = 0;
   }
 }
@@ -418,7 +418,7 @@ void Set::selection(int n)
 
 void Set::set(int keyword)
 {
-  AtomVecEllipsoid *avec_ellipsoid = 
+  AtomVecEllipsoid *avec_ellipsoid =
     (AtomVecEllipsoid *) atom->style_match("ellipsoid");
   AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line");
   AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri");
@@ -466,29 +466,29 @@ void Set::set(int keyword)
 
     else if (keyword == DENSITY) {
       if (atom->radius_flag && atom->radius[i] > 0.0)
-	atom->rmass[i] = 4.0*MY_PI/3.0 * 
-	  atom->radius[i]*atom->radius[i]*atom->radius[i] * dvalue;
+        atom->rmass[i] = 4.0*MY_PI/3.0 *
+          atom->radius[i]*atom->radius[i]*atom->radius[i] * dvalue;
       else if (atom->ellipsoid_flag && atom->ellipsoid[i] >= 0) {
-	double *shape = avec_ellipsoid->bonus[atom->ellipsoid[i]].shape;
-	atom->rmass[i] = 4.0*MY_PI/3.0 * shape[0]*shape[1]*shape[2] * dvalue;
+        double *shape = avec_ellipsoid->bonus[atom->ellipsoid[i]].shape;
+        atom->rmass[i] = 4.0*MY_PI/3.0 * shape[0]*shape[1]*shape[2] * dvalue;
       } else if (atom->line_flag && atom->line[i] >= 0) {
-	double length = avec_line->bonus[atom->line[i]].length;
-	atom->rmass[i] = length * dvalue;
+        double length = avec_line->bonus[atom->line[i]].length;
+        atom->rmass[i] = length * dvalue;
       } else if (atom->tri_flag && atom->tri[i] >= 0) {
-	double *c1 = avec_tri->bonus[atom->tri[i]].c1;
-	double *c2 = avec_tri->bonus[atom->tri[i]].c2;
-	double *c3 = avec_tri->bonus[atom->tri[i]].c3;
-	double c2mc1[2],c3mc1[3];
-	MathExtra::sub3(c2,c1,c2mc1);
-	MathExtra::sub3(c3,c1,c3mc1);
-	double norm[3];
-	MathExtra::cross3(c2mc1,c3mc1,norm);
-	double area = 0.5 * MathExtra::len3(norm);
-	atom->rmass[i] = area * dvalue;
+        double *c1 = avec_tri->bonus[atom->tri[i]].c1;
+        double *c2 = avec_tri->bonus[atom->tri[i]].c2;
+        double *c3 = avec_tri->bonus[atom->tri[i]].c3;
+        double c2mc1[2],c3mc1[3];
+        MathExtra::sub3(c2,c1,c2mc1);
+        MathExtra::sub3(c3,c1,c3mc1);
+        double norm[3];
+        MathExtra::cross3(c2mc1,c3mc1,norm);
+        double area = 0.5 * MathExtra::len3(norm);
+        atom->rmass[i] = area * dvalue;
       } else atom->rmass[i] = dvalue;
 
     // reset any or all of 3 image flags
-      
+
     } else if (keyword == IMAGE) {
       int xbox = (atom->image[i] & 1023) - 512;
       int ybox = (atom->image[i] >> 10 & 1023) - 512;
@@ -497,28 +497,28 @@ void Set::set(int keyword)
       if (yimageflag) ybox = yimage;
       if (zimageflag) zbox = zimage;
       atom->image[i] = ((zbox + 512 & 1023) << 20) |
-	((ybox + 512 & 1023) << 10) | (xbox + 512 & 1023);
-      
+        ((ybox + 512 & 1023) << 10) | (xbox + 512 & 1023);
+
     // set dipole moment
-      
+
     } else if (keyword == DIPOLE) {
       double **mu = atom->mu;
       mu[i][0] = xvalue;
       mu[i][1] = yvalue;
       mu[i][2] = zvalue;
-      mu[i][3] = sqrt(mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] + 
-		      mu[i][2]*mu[i][2]);
-      
+      mu[i][3] = sqrt(mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] +
+                      mu[i][2]*mu[i][2]);
+
     // set quaternion orientation of ellipsoid or tri particle
 
     } else if (keyword == QUAT) {
       double *quat;
       if (avec_ellipsoid && atom->ellipsoid[i] >= 0)
-	quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat;
+        quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat;
       else if (avec_tri && atom->tri[i] >= 0)
-	quat = avec_tri->bonus[atom->tri[i]].quat;
+        quat = avec_tri->bonus[atom->tri[i]].quat;
       else
-	error->one(FLERR,"Cannot set quaternion for atom that has none");
+        error->one(FLERR,"Cannot set quaternion for atom that has none");
 
       double theta2 = MY_PI2 * wvalue/180.0;
       double sintheta2 = sin(theta2);
@@ -532,7 +532,7 @@ void Set::set(int keyword)
 
     } else if (keyword == THETA) {
       if (atom->line[i] < 0)
-	error->one(FLERR,"Cannot set theta for atom that is not a line");
+        error->one(FLERR,"Cannot set theta for atom that is not a line");
       avec_line->bonus[atom->line[i]].theta = dvalue;
 
     // set angmom of ellipsoidal or tri particle
@@ -557,7 +557,7 @@ void Set::setrandom(int keyword)
 {
   int i;
 
-  AtomVecEllipsoid *avec_ellipsoid = 
+  AtomVecEllipsoid *avec_ellipsoid =
     (AtomVecEllipsoid *) atom->style_match("ellipsoid");
   AtomVecLine *avec_line = (AtomVecLine *) atom->style_match("line");
   AtomVecTri *avec_tri = (AtomVecTri *) atom->style_match("tri");
@@ -574,9 +574,9 @@ void Set::setrandom(int keyword)
 
     for (i = 0; i < nlocal; i++)
       if (select[i]) {
-	random->reset(seed,x[i]);
-	if (random->uniform() > fraction) continue;
-	atom->type[i] = newtype;
+        random->reset(seed,x[i]);
+        if (random->uniform() > fraction) continue;
+        atom->type[i] = newtype;
         count++;
       }
 
@@ -591,34 +591,34 @@ void Set::setrandom(int keyword)
 
     if (domain->dimension == 3) {
       for (i = 0; i < nlocal; i++)
-	if (select[i]) {
-	  random->reset(seed,x[i]);
-	  mu[i][0] = random->uniform() - 0.5;
-	  mu[i][1] = random->uniform() - 0.5;
-	  mu[i][2] = random->uniform() - 0.5;
-	  msq = mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] + mu[i][2]*mu[i][2];
-	  scale = dvalue/sqrt(msq);
-	  mu[i][0] *= scale;
-	  mu[i][1] *= scale;
-	  mu[i][2] *= scale;
-	  mu[i][3] = dvalue;
-	  count++;
-	}
+        if (select[i]) {
+          random->reset(seed,x[i]);
+          mu[i][0] = random->uniform() - 0.5;
+          mu[i][1] = random->uniform() - 0.5;
+          mu[i][2] = random->uniform() - 0.5;
+          msq = mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] + mu[i][2]*mu[i][2];
+          scale = dvalue/sqrt(msq);
+          mu[i][0] *= scale;
+          mu[i][1] *= scale;
+          mu[i][2] *= scale;
+          mu[i][3] = dvalue;
+          count++;
+        }
 
     } else {
       for (i = 0; i < nlocal; i++)
-	if (select[i]) {
-	  random->reset(seed,x[i]);
-	  mu[i][0] = random->uniform() - 0.5;
-	  mu[i][1] = random->uniform() - 0.5;
-	  mu[i][2] = 0.0;
-	  msq = mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1];
-	  scale = dvalue/sqrt(msq);
-	  mu[i][0] *= scale;
-	  mu[i][1] *= scale;
-	  mu[i][3] = dvalue;
-	  count++;
-	}
+        if (select[i]) {
+          random->reset(seed,x[i]);
+          mu[i][0] = random->uniform() - 0.5;
+          mu[i][1] = random->uniform() - 0.5;
+          mu[i][2] = 0.0;
+          msq = mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1];
+          scale = dvalue/sqrt(msq);
+          mu[i][0] *= scale;
+          mu[i][1] *= scale;
+          mu[i][3] = dvalue;
+          count++;
+        }
     }
 
   // set quaternions to random orientations in 3d or 2d
@@ -632,44 +632,44 @@ void Set::setrandom(int keyword)
     if (domain->dimension == 3) {
       double s,t1,t2,theta1,theta2;
       for (i = 0; i < nlocal; i++)
-	if (select[i]) {
-	  if (avec_ellipsoid && atom->ellipsoid[i] >= 0)
-	    quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat;
-	  else if (avec_tri && atom->tri[i] >= 0)
-	    quat = avec_tri->bonus[atom->tri[i]].quat;
-	  else
-	    error->one(FLERR,"Cannot set quaternion for atom that has none");
-
-	  random->reset(seed,x[i]);
-	  s = random->uniform();
-	  t1 = sqrt(1.0-s);
-	  t2 = sqrt(s);
-	  theta1 = 2.0*MY_PI*random->uniform();
-	  theta2 = 2.0*MY_PI*random->uniform();
-	  quat[0] = cos(theta2)*t2;
-	  quat[1] = sin(theta1)*t1;
-	  quat[2] = cos(theta1)*t1;
-	  quat[3] = sin(theta2)*t2;
-	  count++;
-	}
+        if (select[i]) {
+          if (avec_ellipsoid && atom->ellipsoid[i] >= 0)
+            quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat;
+          else if (avec_tri && atom->tri[i] >= 0)
+            quat = avec_tri->bonus[atom->tri[i]].quat;
+          else
+            error->one(FLERR,"Cannot set quaternion for atom that has none");
+
+          random->reset(seed,x[i]);
+          s = random->uniform();
+          t1 = sqrt(1.0-s);
+          t2 = sqrt(s);
+          theta1 = 2.0*MY_PI*random->uniform();
+          theta2 = 2.0*MY_PI*random->uniform();
+          quat[0] = cos(theta2)*t2;
+          quat[1] = sin(theta1)*t1;
+          quat[2] = cos(theta1)*t1;
+          quat[3] = sin(theta2)*t2;
+          count++;
+        }
 
     } else {
       double theta2;
       for (i = 0; i < nlocal; i++)
-	if (select[i]) {
-	  if (avec_ellipsoid && atom->ellipsoid[i] >= 0)
-	    quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat;
-	  else
-	    error->one(FLERR,"Cannot set quaternion for atom that has none");
-
-	  random->reset(seed,x[i]);
-	  theta2 = MY_PI*random->uniform();
-	  quat[0] = cos(theta2);
-	  quat[1] = 0.0;
-	  quat[2] = 0.0;
-	  quat[3] = sin(theta2);
-	  count++;
-	}
+        if (select[i]) {
+          if (avec_ellipsoid && atom->ellipsoid[i] >= 0)
+            quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat;
+          else
+            error->one(FLERR,"Cannot set quaternion for atom that has none");
+
+          random->reset(seed,x[i]);
+          theta2 = MY_PI*random->uniform();
+          quat[0] = cos(theta2);
+          quat[1] = 0.0;
+          quat[2] = 0.0;
+          quat[3] = sin(theta2);
+          count++;
+        }
     }
   }
 
@@ -686,7 +686,7 @@ void Set::topology(int keyword)
   // enforce PBC before in case atoms are outside box
   // init entire system since comm->exchange is done
   // comm::init needs neighbor::init needs pair::init needs kspace::init, etc
-  
+
   if (comm->me == 0 && screen) fprintf(screen,"  system init for set ...\n");
   lmp->init();
 
@@ -708,12 +708,12 @@ void Set::topology(int keyword)
     int nlocal = atom->nlocal;
     for (int i = 0; i < nlocal; i++)
       for (m = 0; m < atom->num_bond[i]; m++) {
-	atom1 = atom->map(atom->bond_atom[i][m]);
-	if (atom1 == -1) error->one(FLERR,"Bond atom missing in set command");
-	if (select[i] && select[atom1]) {
-	  atom->bond_type[i][m] = ivalue;
-	  count++;
-	}
+        atom1 = atom->map(atom->bond_atom[i][m]);
+        if (atom1 == -1) error->one(FLERR,"Bond atom missing in set command");
+        if (select[i] && select[atom1]) {
+          atom->bond_type[i][m] = ivalue;
+          count++;
+        }
       }
   }
 
@@ -723,15 +723,15 @@ void Set::topology(int keyword)
     int nlocal = atom->nlocal;
     for (int i = 0; i < nlocal; i++)
       for (m = 0; m < atom->num_angle[i]; m++) {
-	atom1 = atom->map(atom->angle_atom1[i][m]);
-	atom2 = atom->map(atom->angle_atom2[i][m]);
-	atom3 = atom->map(atom->angle_atom3[i][m]);
-	if (atom1 == -1 || atom2 == -1 || atom3 == -1)
-	  error->one(FLERR,"Angle atom missing in set command");
-	if (select[atom1] && select[atom2] && select[atom3]) {
-	  atom->angle_type[i][m] = ivalue;
-	  count++;
-	}
+        atom1 = atom->map(atom->angle_atom1[i][m]);
+        atom2 = atom->map(atom->angle_atom2[i][m]);
+        atom3 = atom->map(atom->angle_atom3[i][m]);
+        if (atom1 == -1 || atom2 == -1 || atom3 == -1)
+          error->one(FLERR,"Angle atom missing in set command");
+        if (select[atom1] && select[atom2] && select[atom3]) {
+          atom->angle_type[i][m] = ivalue;
+          count++;
+        }
       }
   }
 
@@ -741,16 +741,16 @@ void Set::topology(int keyword)
     int nlocal = atom->nlocal;
     for (int i = 0; i < nlocal; i++)
       for (m = 0; m < atom->num_dihedral[i]; m++) {
-	atom1 = atom->map(atom->dihedral_atom1[i][m]);
-	atom2 = atom->map(atom->dihedral_atom2[i][m]);
-	atom3 = atom->map(atom->dihedral_atom3[i][m]);
-	atom4 = atom->map(atom->dihedral_atom4[i][m]);
-	if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
-	  error->one(FLERR,"Dihedral atom missing in set command");
-	if (select[atom1] && select[atom2] && select[atom3] && select[atom4]) {
-	  atom->dihedral_type[i][m] = ivalue;
-	  count++;
-	}
+        atom1 = atom->map(atom->dihedral_atom1[i][m]);
+        atom2 = atom->map(atom->dihedral_atom2[i][m]);
+        atom3 = atom->map(atom->dihedral_atom3[i][m]);
+        atom4 = atom->map(atom->dihedral_atom4[i][m]);
+        if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
+          error->one(FLERR,"Dihedral atom missing in set command");
+        if (select[atom1] && select[atom2] && select[atom3] && select[atom4]) {
+          atom->dihedral_type[i][m] = ivalue;
+          count++;
+        }
       }
   }
 
@@ -760,16 +760,16 @@ void Set::topology(int keyword)
     int nlocal = atom->nlocal;
     for (int i = 0; i < nlocal; i++)
       for (m = 0; m < atom->num_improper[i]; m++) {
-	atom1 = atom->map(atom->improper_atom1[i][m]);
-	atom2 = atom->map(atom->improper_atom2[i][m]);
-	atom3 = atom->map(atom->improper_atom3[i][m]);
-	atom4 = atom->map(atom->improper_atom4[i][m]);
-	if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
-	  error->one(FLERR,"Improper atom missing in set command");
-	if (select[atom1] && select[atom2] && select[atom3] && select[atom4]) {
-	  atom->improper_type[i][m] = ivalue;
-	  count++;
-	}
+        atom1 = atom->map(atom->improper_atom1[i][m]);
+        atom2 = atom->map(atom->improper_atom2[i][m]);
+        atom3 = atom->map(atom->improper_atom3[i][m]);
+        atom4 = atom->map(atom->improper_atom4[i][m]);
+        if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1)
+          error->one(FLERR,"Improper atom missing in set command");
+        if (select[atom1] && select[atom2] && select[atom3] && select[atom4]) {
+          atom->improper_type[i][m] = ivalue;
+          count++;
+        }
       }
   }
 }
diff --git a/src/set.h b/src/set.h
index b1951b4523..abbbeeceeb 100644
--- a/src/set.h
+++ b/src/set.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/special.cpp b/src/special.cpp
index 189b2374fb..195d5188a0 100644
--- a/src/special.cpp
+++ b/src/special.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -44,7 +44,7 @@ Special::~Special()
 /* ----------------------------------------------------------------------
    create 1-2, 1-3, 1-4 lists of topology neighbors
    store in onetwo, onethree, onefour for each atom
-   store 3 counters in nspecial[i] 
+   store 3 counters in nspecial[i]
 ------------------------------------------------------------------------- */
 
 void Special::build()
@@ -70,7 +70,7 @@ void Special::build()
   // setup ring of procs
 
   int next = me + 1;
-  int prev = me -1; 
+  int prev = me -1;
   if (next == nprocs) next = 0;
   if (prev < 0) prev = nprocs - 1;
 
@@ -110,7 +110,7 @@ void Special::build()
     size = 0;
     for (i = 0; i < nlocal; i++)
       for (j = 0; j < num_bond[i]; j++)
-	buf[size++] = bond_atom[i][j];
+        buf[size++] = bond_atom[i][j];
 
     // cycle buffer around ring of procs back to self
     // when receive buffer, scan tags for atoms I own
@@ -119,15 +119,15 @@ void Special::build()
     messtag = 1;
     for (loop = 0; loop < nprocs; loop++) {
       for (i = 0; i < size; i++) {
-	m = atom->map(buf[i]);
-	if (m >= 0 && m < nlocal) nspecial[m][0]++;
+        m = atom->map(buf[i]);
+        if (m >= 0 && m < nlocal) nspecial[m][0]++;
       }
       if (me != next) {
-	MPI_Irecv(bufcopy,nbufmax,MPI_INT,prev,messtag,world,&request);
-	MPI_Send(buf,size,MPI_INT,next,messtag,world);
-	MPI_Wait(&request,&status);
-	MPI_Get_count(&status,MPI_INT,&size);
-	for (j = 0; j < size; j++) buf[j] = bufcopy[j];
+        MPI_Irecv(bufcopy,nbufmax,MPI_INT,prev,messtag,world,&request);
+        MPI_Send(buf,size,MPI_INT,next,messtag,world);
+        MPI_Wait(&request,&status);
+        MPI_Get_count(&status,MPI_INT,&size);
+        for (j = 0; j < size; j++) buf[j] = bufcopy[j];
       }
     }
 
@@ -182,8 +182,8 @@ void Special::build()
     size = 0;
     for (i = 0; i < nlocal; i++)
       for (j = 0; j < num_bond[i]; j++) {
-	buf[size++] = tag[i];
-	buf[size++] = bond_atom[i][j];
+        buf[size++] = tag[i];
+        buf[size++] = bond_atom[i][j];
       }
 
     // cycle buffer around ring of procs back to self
@@ -193,15 +193,15 @@ void Special::build()
     messtag = 2;
     for (loop = 0; loop < nprocs; loop++) {
       for (i = 1; i < size; i += 2) {
-	m = atom->map(buf[i]);
-	if (m >= 0 && m < nlocal) onetwo[m][count[m]++] = buf[i-1];
+        m = atom->map(buf[i]);
+        if (m >= 0 && m < nlocal) onetwo[m][count[m]++] = buf[i-1];
       }
       if (me != next) {
-	MPI_Irecv(bufcopy,nbufmax,MPI_INT,prev,messtag,world,&request);
-	MPI_Send(buf,size,MPI_INT,next,messtag,world);
-	MPI_Wait(&request,&status);
-	MPI_Get_count(&status,MPI_INT,&size);
-	for (j = 0; j < size; j++) buf[j] = bufcopy[j];
+        MPI_Irecv(bufcopy,nbufmax,MPI_INT,prev,messtag,world,&request);
+        MPI_Send(buf,size,MPI_INT,next,messtag,world);
+        MPI_Wait(&request,&status);
+        MPI_Get_count(&status,MPI_INT,&size);
+        for (j = 0; j < size; j++) buf[j] = bufcopy[j];
       }
     }
 
@@ -259,8 +259,8 @@ void Special::build()
       n = buf[i];
       num12 = buf[i+1];
       for (j = 0; j < num12; j++) {
-	m = atom->map(buf[i+2+j]);
-	if (m >= 0 && m < nlocal) n += nspecial[m][0] - 1;
+        m = atom->map(buf[i+2+j]);
+        if (m >= 0 && m < nlocal) n += nspecial[m][0] - 1;
       }
       buf[i] = n;
       i += 2 + num12;
@@ -346,11 +346,11 @@ void Special::build()
       num13 = buf[i+2];
       n = buf[i+3];
       for (j = 0; j < num12; j++) {
-	m = atom->map(buf[i+4+j]);
-	if (m >= 0 && m < nlocal)
-	  for (k = 0; k < nspecial[m][0]; k++)
-	    if (onetwo[m][k] != original)
-	      buf[i+4+num12+(n++)] = onetwo[m][k];
+        m = atom->map(buf[i+4+j]);
+        if (m >= 0 && m < nlocal)
+          for (k = 0; k < nspecial[m][0]; k++)
+            if (onetwo[m][k] != original)
+              buf[i+4+num12+(n++)] = onetwo[m][k];
       }
       buf[i+3] = n;
       i += 4 + num12 + num13;
@@ -373,7 +373,7 @@ void Special::build()
     if (buf[j+3] != nspecial[i][1])
       error->one(FLERR,"1-3 bond count is inconsistent");
     j += 4 + nspecial[i][0];
-    for (k = 0; k < nspecial[i][1]; k++) 
+    for (k = 0; k < nspecial[i][1]; k++)
       onethree[i][k] = buf[j++];
   }
 
@@ -426,8 +426,8 @@ void Special::build()
       n = buf[i];
       num13 = buf[i+1];
       for (j = 0; j < num13; j++) {
-	m = atom->map(buf[i+2+j]);
-	if (m >= 0 && m < nlocal) n += nspecial[m][0];
+        m = atom->map(buf[i+2+j]);
+        if (m >= 0 && m < nlocal) n += nspecial[m][0];
       }
       buf[i] = n;
       i += 2 + num13;
@@ -473,7 +473,7 @@ void Special::build()
   // info for each atom = 3 scalars + list of 1-3 neighs + list of 1-4 neighs
 
   nbuf = 0;
-  for (i = 0; i < nlocal; i++) 
+  for (i = 0; i < nlocal; i++)
     nbuf += 3 + nspecial[i][1] + nspecial[i][2];
   MPI_Allreduce(&nbuf,&nbufmax,1,MPI_INT,MPI_MAX,world);
 
@@ -510,10 +510,10 @@ void Special::build()
       num14 = buf[i+1];
       n = buf[i+2];
       for (j = 0; j < num13; j++) {
-	m = atom->map(buf[i+3+j]);
-	if (m >= 0 && m < nlocal)
-	  for (k = 0; k < nspecial[m][0]; k++)
-	    buf[i+3+num13+(n++)] = onetwo[m][k];
+        m = atom->map(buf[i+3+j]);
+        if (m >= 0 && m < nlocal)
+          for (k = 0; k < nspecial[m][0]; k++)
+            buf[i+3+num13+(n++)] = onetwo[m][k];
       }
       buf[i+2] = n;
       i += 3 + num13 + num14;
@@ -536,7 +536,7 @@ void Special::build()
     if (buf[j+2] != nspecial[i][2])
       error->one(FLERR,"1-4 bond count is inconsistent");
     j += 3 + nspecial[i][1];
-    for (k = 0; k < nspecial[i][2]; k++) 
+    for (k = 0; k < nspecial[i][2]; k++)
       onefour[i][k] = buf[j++];
   }
 
@@ -551,7 +551,7 @@ void Special::build()
 /* ----------------------------------------------------------------------
    concatenate onetwo, onethree, onefour into master atom->special list
    remove duplicates
-   convert nspecial[0], nspecial[1], nspecial[2] into cumulative counters 
+   convert nspecial[0], nspecial[1], nspecial[2] into cumulative counters
 ------------------------------------------------------------------------- */
 
 void Special::combine()
@@ -589,22 +589,22 @@ void Special::combine()
     for (j = 0; j < nspecial[i][0]; j++) {
       m = onetwo[i][j];
       if (atom->map(m) < 0) {
-	unique++;
-	atom->map_one(m,0);
+        unique++;
+        atom->map_one(m,0);
       }
     }
     for (j = 0; j < nspecial[i][1]; j++) {
       m = onethree[i][j];
       if (atom->map(m) < 0) {
-	unique++;
-	atom->map_one(m,0);
+        unique++;
+        atom->map_one(m,0);
       }
     }
     for (j = 0; j < nspecial[i][2]; j++) {
       m = onefour[i][j];
       if (atom->map(m) < 0) {
-	unique++;
-	atom->map_one(m,0);
+        unique++;
+        atom->map_one(m,0);
       }
     }
 
@@ -657,8 +657,8 @@ void Special::combine()
     for (j = 0; j < nspecial[i][0]; j++) {
       m = onetwo[i][j];
       if (atom->map(m) < 0) {
-	special[i][unique++] = m;
-	atom->map_one(m,0);
+        special[i][unique++] = m;
+        atom->map_one(m,0);
       }
     }
     nspecial[i][0] = unique;
@@ -666,8 +666,8 @@ void Special::combine()
     for (j = 0; j < nspecial[i][1]; j++) {
       m = onethree[i][j];
       if (atom->map(m) < 0) {
-	special[i][unique++] = m;
-	atom->map_one(m,0);
+        special[i][unique++] = m;
+        atom->map_one(m,0);
       }
     }
     nspecial[i][1] = unique;
@@ -675,8 +675,8 @@ void Special::combine()
     for (j = 0; j < nspecial[i][2]; j++) {
       m = onefour[i][j];
       if (atom->map(m) < 0) {
-	special[i][unique++] = m;
-	atom->map_one(m,0);
+        special[i][unique++] = m;
+        atom->map_one(m,0);
       }
     }
     nspecial[i][2] = unique;
@@ -702,7 +702,7 @@ void Special::angle_trim()
   int i,j,m,n,iglobal,jglobal,ilocal,jlocal;
   MPI_Request request;
   MPI_Status status;
-  
+
   int *num_angle = atom->num_angle;
   int *num_dihedral = atom->num_dihedral;
   int **angle_atom1 = atom->angle_atom1;
@@ -720,19 +720,19 @@ void Special::angle_trim()
   double onethreecount = 0.0;
   for (i = 0; i < nlocal; i++)
     onethreecount += nspecial[i][1] - nspecial[i][0];
-  
+
   double allcount;
   MPI_Allreduce(&onethreecount,&allcount,1,MPI_DOUBLE,MPI_SUM,world);
-  
+
   if (me == 0) {
     if (screen)
       fprintf(screen,
-	      "  %g = # of 1-3 neighbors before angle trim\n",allcount);
+              "  %g = # of 1-3 neighbors before angle trim\n",allcount);
     if (logfile)
       fprintf(logfile,
-	      "  %g = # of 1-3 neighbors before angle trim\n",allcount);
+              "  %g = # of 1-3 neighbors before angle trim\n",allcount);
   }
-  
+
   // if angles or dihedrals are defined,
   // flag each 1-3 neigh if it appears in an angle or dihedral
 
@@ -745,7 +745,7 @@ void Special::angle_trim()
       maxcount = MAX(maxcount,nspecial[i][1]-nspecial[i][0]);
     int **dflag;
     memory->create(dflag,nlocal,maxcount,"special::dflag");
-    
+
     for (i = 0; i < nlocal; i++) {
       n = nspecial[i][1] - nspecial[i][0];
       for (j = 0; j < n; j++) dflag[i][j] = 0;
@@ -754,31 +754,31 @@ void Special::angle_trim()
     // nbufmax = largest buffer needed to hold info from any proc
     // info for each atom = list of 1,3 atoms in each angle stored by atom
     //   and list of 1,3 and 2,4 atoms in each dihedral stored by atom
-    
+
     int nbuf = 0;
     for (i = 0; i < nlocal; i++) nbuf += 2*num_angle[i] + 2*2*num_dihedral[i];
-    
+
     int nbufmax;
     MPI_Allreduce(&nbuf,&nbufmax,1,MPI_INT,MPI_MAX,world);
-    
+
     int *buf = new int[nbufmax];
     int *bufcopy = new int[nbufmax];
-    
+
     // fill buffer with list of 1,3 atoms in each angle
     // and with list of 1,3 and 2,4 atoms in each dihedral
 
     int size = 0;
     for (i = 0; i < nlocal; i++)
       for (j = 0; j < num_angle[i]; j++) {
-	buf[size++] = angle_atom1[i][j];
-	buf[size++] = angle_atom3[i][j];
+        buf[size++] = angle_atom1[i][j];
+        buf[size++] = angle_atom3[i][j];
       }
     for (i = 0; i < nlocal; i++)
       for (j = 0; j < num_dihedral[i]; j++) {
-	buf[size++] = dihedral_atom1[i][j];
-	buf[size++] = dihedral_atom3[i][j];
-	buf[size++] = dihedral_atom2[i][j];
-	buf[size++] = dihedral_atom4[i][j];
+        buf[size++] = dihedral_atom1[i][j];
+        buf[size++] = dihedral_atom3[i][j];
+        buf[size++] = dihedral_atom2[i][j];
+        buf[size++] = dihedral_atom4[i][j];
       }
 
     // cycle buffer around ring of procs back to self
@@ -786,7 +786,7 @@ void Special::angle_trim()
     // when find one, scan its 1-3 neigh list and mark I,J as in an angle
 
     int next = me + 1;
-    int prev = me -1; 
+    int prev = me -1;
     if (next == nprocs) next = 0;
     if (prev < 0) prev = nprocs - 1;
 
@@ -794,48 +794,48 @@ void Special::angle_trim()
     for (int loop = 0; loop < nprocs; loop++) {
       i = 0;
       while (i < size) {
-	iglobal = buf[i];
-	jglobal = buf[i+1];
-	ilocal = atom->map(iglobal);
-	jlocal = atom->map(jglobal);
-	if (ilocal >= 0 && ilocal < nlocal)
-	  for (m = nspecial[ilocal][0]; m < nspecial[ilocal][1]; m++)
-	    if (jglobal == special[ilocal][m]) {
-	      dflag[ilocal][m-nspecial[ilocal][0]] = 1;
-	      break;
-	    }
-	if (jlocal >= 0 && jlocal < nlocal)
-	  for (m = nspecial[jlocal][0]; m < nspecial[jlocal][1]; m++)
-	    if (iglobal == special[jlocal][m]) {
-	      dflag[jlocal][m-nspecial[jlocal][0]] = 1;
-	      break;
-	    }
-	i += 2;
+        iglobal = buf[i];
+        jglobal = buf[i+1];
+        ilocal = atom->map(iglobal);
+        jlocal = atom->map(jglobal);
+        if (ilocal >= 0 && ilocal < nlocal)
+          for (m = nspecial[ilocal][0]; m < nspecial[ilocal][1]; m++)
+            if (jglobal == special[ilocal][m]) {
+              dflag[ilocal][m-nspecial[ilocal][0]] = 1;
+              break;
+            }
+        if (jlocal >= 0 && jlocal < nlocal)
+          for (m = nspecial[jlocal][0]; m < nspecial[jlocal][1]; m++)
+            if (iglobal == special[jlocal][m]) {
+              dflag[jlocal][m-nspecial[jlocal][0]] = 1;
+              break;
+            }
+        i += 2;
       }
       if (me != next) {
-	MPI_Irecv(bufcopy,nbufmax,MPI_INT,prev,messtag,world,&request);
-	MPI_Send(buf,size,MPI_INT,next,messtag,world);
-	MPI_Wait(&request,&status);
-	MPI_Get_count(&status,MPI_INT,&size);
-	for (j = 0; j < size; j++) buf[j] = bufcopy[j];
+        MPI_Irecv(bufcopy,nbufmax,MPI_INT,prev,messtag,world,&request);
+        MPI_Send(buf,size,MPI_INT,next,messtag,world);
+        MPI_Wait(&request,&status);
+        MPI_Get_count(&status,MPI_INT,&size);
+        for (j = 0; j < size; j++) buf[j] = bufcopy[j];
       }
     }
-   
+
     // delete 1-3 neighbors if they are not flagged in dflag
     // preserve 1-4 neighbors
-    
+
     int offset;
     for (i = 0; i < nlocal; i++) {
       offset = m = nspecial[i][0];
       for (j = nspecial[i][0]; j < nspecial[i][1]; j++)
-	if (dflag[i][j-offset]) special[i][m++] = special[i][j];
+        if (dflag[i][j-offset]) special[i][m++] = special[i][j];
       offset = m;
       for (j = nspecial[i][1]; j < nspecial[i][2]; j++)
-	special[i][m++] = special[i][j];
+        special[i][m++] = special[i][j];
       nspecial[i][1] = offset;
       nspecial[i][2] = m;
     }
-    
+
     // clean up
 
     memory->destroy(dflag);
@@ -849,7 +849,7 @@ void Special::angle_trim()
     for (i = 0; i < nlocal; i++) {
       m = nspecial[i][0];
       for (j = nspecial[i][1]; j < nspecial[i][2]; j++)
-	special[i][m++] = special[i][j];
+        special[i][m++] = special[i][j];
       nspecial[i][1] = nspecial[i][0];
       nspecial[i][2] = m;
     }
@@ -860,17 +860,17 @@ void Special::angle_trim()
   onethreecount = 0.0;
   for (i = 0; i < nlocal; i++)
     onethreecount += nspecial[i][1] - nspecial[i][0];
-  
+
   MPI_Allreduce(&onethreecount,&allcount,1,MPI_DOUBLE,MPI_SUM,world);
 
   if (me == 0) {
     if (screen)
       fprintf(screen,
-	      "  %g = # of 1-3 neighbors after angle trim\n",allcount);
+              "  %g = # of 1-3 neighbors after angle trim\n",allcount);
     if (logfile)
       fprintf(logfile,
-	      "  %g = # of 1-3 neighbors after angle trim\n",allcount);
-  }  
+              "  %g = # of 1-3 neighbors after angle trim\n",allcount);
+  }
 }
 
 /* ----------------------------------------------------------------------
@@ -903,10 +903,10 @@ void Special::dihedral_trim()
   if (me == 0) {
     if (screen)
       fprintf(screen,
-	      "  %g = # of 1-4 neighbors before dihedral trim\n",allcount);
+              "  %g = # of 1-4 neighbors before dihedral trim\n",allcount);
     if (logfile)
       fprintf(logfile,
-	      "  %g = # of 1-4 neighbors before dihedral trim\n",allcount);
+              "  %g = # of 1-4 neighbors before dihedral trim\n",allcount);
   }
 
   // if dihedrals are defined, flag each 1-4 neigh if it appears in a dihedral
@@ -943,8 +943,8 @@ void Special::dihedral_trim()
     int size = 0;
     for (i = 0; i < nlocal; i++)
       for (j = 0; j < num_dihedral[i]; j++) {
-	buf[size++] = dihedral_atom1[i][j];
-	buf[size++] = dihedral_atom4[i][j];
+        buf[size++] = dihedral_atom1[i][j];
+        buf[size++] = dihedral_atom4[i][j];
       }
 
     // cycle buffer around ring of procs back to self
@@ -952,7 +952,7 @@ void Special::dihedral_trim()
     // when find one, scan its 1-4 neigh list and mark I,J as in a dihedral
 
     int next = me + 1;
-    int prev = me -1; 
+    int prev = me -1;
     if (next == nprocs) next = 0;
     if (prev < 0) prev = nprocs - 1;
 
@@ -960,43 +960,43 @@ void Special::dihedral_trim()
     for (int loop = 0; loop < nprocs; loop++) {
       i = 0;
       while (i < size) {
-	iglobal = buf[i];
-	jglobal = buf[i+1];
-	ilocal = atom->map(iglobal);
-	jlocal = atom->map(jglobal);
-	if (ilocal >= 0 && ilocal < nlocal)
-	  for (m = nspecial[ilocal][1]; m < nspecial[ilocal][2]; m++)
-	    if (jglobal == special[ilocal][m]) {
-	      dflag[ilocal][m-nspecial[ilocal][1]] = 1;
-	      break;
-	    }
-	if (jlocal >= 0 && jlocal < nlocal)
-	  for (m = nspecial[jlocal][1]; m < nspecial[jlocal][2]; m++)
-	    if (iglobal == special[jlocal][m]) {
-	      dflag[jlocal][m-nspecial[jlocal][1]] = 1;
-	      break;
-	    }
-	i += 2;
+        iglobal = buf[i];
+        jglobal = buf[i+1];
+        ilocal = atom->map(iglobal);
+        jlocal = atom->map(jglobal);
+        if (ilocal >= 0 && ilocal < nlocal)
+          for (m = nspecial[ilocal][1]; m < nspecial[ilocal][2]; m++)
+            if (jglobal == special[ilocal][m]) {
+              dflag[ilocal][m-nspecial[ilocal][1]] = 1;
+              break;
+            }
+        if (jlocal >= 0 && jlocal < nlocal)
+          for (m = nspecial[jlocal][1]; m < nspecial[jlocal][2]; m++)
+            if (iglobal == special[jlocal][m]) {
+              dflag[jlocal][m-nspecial[jlocal][1]] = 1;
+              break;
+            }
+        i += 2;
       }
       if (me != next) {
-	MPI_Irecv(bufcopy,nbufmax,MPI_INT,prev,messtag,world,&request);
-	MPI_Send(buf,size,MPI_INT,next,messtag,world);
-	MPI_Wait(&request,&status);
-	MPI_Get_count(&status,MPI_INT,&size);
-	for (j = 0; j < size; j++) buf[j] = bufcopy[j];
+        MPI_Irecv(bufcopy,nbufmax,MPI_INT,prev,messtag,world,&request);
+        MPI_Send(buf,size,MPI_INT,next,messtag,world);
+        MPI_Wait(&request,&status);
+        MPI_Get_count(&status,MPI_INT,&size);
+        for (j = 0; j < size; j++) buf[j] = bufcopy[j];
       }
     }
 
     // delete 1-4 neighbors if they are not flagged in dflag
-    
+
     int offset;
     for (i = 0; i < nlocal; i++) {
       offset = m = nspecial[i][1];
       for (j = nspecial[i][1]; j < nspecial[i][2]; j++)
-	if (dflag[i][j-offset]) special[i][m++] = special[i][j];
+        if (dflag[i][j-offset]) special[i][m++] = special[i][j];
       nspecial[i][2] = m;
     }
-    
+
     // clean up
 
     memory->destroy(dflag);
@@ -1018,9 +1018,9 @@ void Special::dihedral_trim()
   if (me == 0) {
     if (screen)
       fprintf(screen,
-	      "  %g = # of 1-4 neighbors after dihedral trim\n",allcount);
+              "  %g = # of 1-4 neighbors after dihedral trim\n",allcount);
     if (logfile)
       fprintf(logfile,
-	      "  %g = # of 1-4 neighbors after dihedral trim\n",allcount);
+              "  %g = # of 1-4 neighbors after dihedral trim\n",allcount);
   }
 }
diff --git a/src/special.h b/src/special.h
index b269f01fe6..b550f1ac47 100644
--- a/src/special.h
+++ b/src/special.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/suffix.h b/src/suffix.h
index 9dd105ed53..2a150ed5ef 100644
--- a/src/suffix.h
+++ b/src/suffix.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/thermo.cpp b/src/thermo.cpp
index 9167cd8928..36501c1503 100644
--- a/src/thermo.cpp
+++ b/src/thermo.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -248,7 +248,7 @@ void Thermo::init()
   int ivariable;
   for (i = 0; i < nvariable; i++) {
     ivariable = input->variable->find(id_variable[i]);
-    if (ivariable < 0) 
+    if (ivariable < 0)
       error->all(FLERR,"Could not find thermo variable name");
     variables[i] = ivariable;
   }
@@ -271,7 +271,7 @@ void Thermo::header()
   for (int i = 0; i < nfield; i++)
     loc += sprintf(&line[loc],"%s ",keyword[i]);
   sprintf(&line[loc],"\n");
-  
+
   if (me == 0) {
     if (screen) fprintf(screen,line);
     if (logfile) fprintf(logfile,line);
@@ -299,18 +299,18 @@ void Thermo::compute(int flag)
   for (i = 0; i < ncompute; i++)
     if (compute_which[i] == SCALAR) {
       if (!(computes[i]->invoked_flag & INVOKED_SCALAR)) {
-	computes[i]->compute_scalar();
-	computes[i]->invoked_flag |= INVOKED_SCALAR;
+        computes[i]->compute_scalar();
+        computes[i]->invoked_flag |= INVOKED_SCALAR;
       }
     } else if (compute_which[i] == VECTOR) {
       if (!(computes[i]->invoked_flag & INVOKED_VECTOR)) {
-	computes[i]->compute_vector();
-	computes[i]->invoked_flag |= INVOKED_VECTOR;
+        computes[i]->compute_vector();
+        computes[i]->invoked_flag |= INVOKED_VECTOR;
       }
     } else if (compute_which[i] == ARRAY) {
       if (!(computes[i]->invoked_flag & INVOKED_ARRAY)) {
-	computes[i]->compute_array();
-	computes[i]->invoked_flag |= INVOKED_ARRAY;
+        computes[i]->compute_array();
+        computes[i]->invoked_flag |= INVOKED_ARRAY;
       }
     }
 
@@ -330,7 +330,7 @@ void Thermo::compute(int flag)
     (this->*vfunc[ifield])();
     if (vtype[ifield] == FLOAT)
       loc += sprintf(&line[loc],format[ifield],dvalue);
-    else if (vtype[ifield] == INT) 
+    else if (vtype[ifield] == INT)
       loc += sprintf(&line[loc],format[ifield],ivalue);
     else if (vtype[ifield] == BIGINT) {
       loc += sprintf(&line[loc],format[ifield],bivalue);
@@ -362,7 +362,7 @@ bigint Thermo::lost_check()
   bigint ntotal;
   bigint nblocal = atom->nlocal;
   MPI_Allreduce(&nblocal,&ntotal,1,MPI_LMP_BIGINT,MPI_SUM,world);
-  if (ntotal < 0 || ntotal > MAXBIGINT) 
+  if (ntotal < 0 || ntotal > MAXBIGINT)
     error->all(FLERR,"Too many total atoms");
   if (ntotal == atom->natoms) return ntotal;
 
@@ -380,8 +380,8 @@ bigint Thermo::lost_check()
   if (lostflag == ERROR) {
     char str[64];
     sprintf(str,
-	    "Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT,
-	    atom->natoms,ntotal);
+            "Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT,
+            atom->natoms,ntotal);
     error->all(FLERR,str);
   }
 
@@ -389,8 +389,8 @@ bigint Thermo::lost_check()
 
   char str[64];
   sprintf(str,
-	  "Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT,
-	  atom->natoms,ntotal);
+          "Lost atoms: original " BIGINT_FORMAT " current " BIGINT_FORMAT,
+          atom->natoms,ntotal);
   if (me == 0) error->warning(FLERR,str,0);
 
   // reset total atom count
@@ -415,10 +415,10 @@ void Thermo::modify_params(int narg, char **arg)
     if (strcmp(arg[iarg],"every") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
       if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) {
-	delete [] output->var_thermo;
-	int n = strlen(&arg[iarg+1][2]) + 1;
-	output->var_thermo = new char[n];
-	strcpy(output->var_thermo,&arg[iarg+1][2]);
+        delete [] output->var_thermo;
+        int n = strlen(&arg[iarg+1][2]) + 1;
+        output->var_thermo = new char[n];
+        strcpy(output->var_thermo,&arg[iarg+1][2]);
       } else error->all(FLERR,"Illegal thermo_modify command");
       output->thermo_every = 0;
       iarg += 2;
@@ -431,28 +431,28 @@ void Thermo::modify_params(int narg, char **arg)
       strcpy(id_compute[index_temp],arg[iarg+1]);
 
       int icompute = modify->find_compute(arg[iarg+1]);
-      if (icompute < 0) 
-	error->all(FLERR,"Could not find thermo_modify temperature ID");
+      if (icompute < 0)
+        error->all(FLERR,"Could not find thermo_modify temperature ID");
       temperature = modify->compute[icompute];
 
       if (temperature->tempflag == 0)
-	error->all(FLERR,"Thermo_modify temperature ID does not "
-		   "compute temperature");
+        error->all(FLERR,"Thermo_modify temperature ID does not "
+                   "compute temperature");
       if (temperature->igroup != 0 && comm->me == 0)
-	error->warning(FLERR,
-		       "Temperature for thermo pressure is not for group all");
+        error->warning(FLERR,
+                       "Temperature for thermo pressure is not for group all");
 
       // reset id_temp of pressure to new temperature ID
       // either pressure currently being used by thermo or "thermo_press"
 
       if (index_press_scalar >= 0) {
-	icompute = modify->find_compute(id_compute[index_press_scalar]);
-	if (icompute < 0) error->all(FLERR,
-				     "Pressure ID for thermo does not exist");
+        icompute = modify->find_compute(id_compute[index_press_scalar]);
+        if (icompute < 0) error->all(FLERR,
+                                     "Pressure ID for thermo does not exist");
       } else if (index_press_vector >= 0) {
-	icompute = modify->find_compute(id_compute[index_press_vector]);
-	if (icompute < 0) error->all(FLERR,
-				     "Pressure ID for thermo does not exist");
+        icompute = modify->find_compute(id_compute[index_press_vector]);
+        if (icompute < 0) error->all(FLERR,
+                                     "Pressure ID for thermo does not exist");
       } else icompute = modify->find_compute((char *) "thermo_press");
 
       modify->compute[icompute]->reset_extra_compute_fix(arg[iarg+1]);
@@ -462,28 +462,28 @@ void Thermo::modify_params(int narg, char **arg)
     } else if (strcmp(arg[iarg],"press") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal thermo_modify command");
       if (index_press_scalar < 0 && index_press_vector < 0)
-	error->all(FLERR,"Thermo style does not use press");
+        error->all(FLERR,"Thermo style does not use press");
 
       if (index_press_scalar >= 0) {
-	delete [] id_compute[index_press_scalar];
-	int n = strlen(arg[iarg+1]) + 1;
-	id_compute[index_press_scalar] = new char[n];
-	strcpy(id_compute[index_press_scalar],arg[iarg+1]);
+        delete [] id_compute[index_press_scalar];
+        int n = strlen(arg[iarg+1]) + 1;
+        id_compute[index_press_scalar] = new char[n];
+        strcpy(id_compute[index_press_scalar],arg[iarg+1]);
       }
       if (index_press_vector >= 0) {
-	delete [] id_compute[index_press_vector];
-	int n = strlen(arg[iarg+1]) + 1;
-	id_compute[index_press_vector] = new char[n];
-	strcpy(id_compute[index_press_vector],arg[iarg+1]);
+        delete [] id_compute[index_press_vector];
+        int n = strlen(arg[iarg+1]) + 1;
+        id_compute[index_press_vector] = new char[n];
+        strcpy(id_compute[index_press_vector],arg[iarg+1]);
       }
 
       int icompute = modify->find_compute(arg[iarg+1]);
       if (icompute < 0) error->all(FLERR,
-				   "Could not find thermo_modify pressure ID");
+                                   "Could not find thermo_modify pressure ID");
       pressure = modify->compute[icompute];
 
       if (pressure->pressflag == 0)
-	error->all(FLERR,"Thermo_modify pressure ID does not compute pressure");
+        error->all(FLERR,"Thermo_modify pressure ID does not compute pressure");
 
       iarg += 2;
 
@@ -520,34 +520,34 @@ void Thermo::modify_params(int narg, char **arg)
     } else if (strcmp(arg[iarg],"format") == 0) {
       if (iarg+3 > narg) error->all(FLERR,"Illegal thermo_modify command");
       if (strcmp(arg[iarg+1],"int") == 0) {
-	if (format_int_user) delete [] format_int_user;
-	int n = strlen(arg[iarg+2]) + 1;
-	format_int_user = new char[n];
-	strcpy(format_int_user,arg[iarg+2]);
-	if (format_bigint_user) delete [] format_bigint_user;
-	n = strlen(format_int_user) + 3;
-	format_bigint_user = new char[n];
-	char *ptr = strchr(format_int_user,'d');
-	if (ptr == NULL) 
-	  error->all(FLERR,
-		     "Thermo_modify int format does not contain d character");
-	*ptr = '\0';
-	sprintf(format_bigint_user,"%s%s%s",format_int_user,
-		BIGINT_FORMAT,ptr+1);
-	*ptr = 'd';
+        if (format_int_user) delete [] format_int_user;
+        int n = strlen(arg[iarg+2]) + 1;
+        format_int_user = new char[n];
+        strcpy(format_int_user,arg[iarg+2]);
+        if (format_bigint_user) delete [] format_bigint_user;
+        n = strlen(format_int_user) + 3;
+        format_bigint_user = new char[n];
+        char *ptr = strchr(format_int_user,'d');
+        if (ptr == NULL)
+          error->all(FLERR,
+                     "Thermo_modify int format does not contain d character");
+        *ptr = '\0';
+        sprintf(format_bigint_user,"%s%s%s",format_int_user,
+                BIGINT_FORMAT,ptr+1);
+        *ptr = 'd';
       } else if (strcmp(arg[iarg+1],"float") == 0) {
-	if (format_float_user) delete [] format_float_user;
-	int n = strlen(arg[iarg+2]) + 1;
-	format_float_user = new char[n];
-	strcpy(format_float_user,arg[iarg+2]);
+        if (format_float_user) delete [] format_float_user;
+        int n = strlen(arg[iarg+2]) + 1;
+        format_float_user = new char[n];
+        strcpy(format_float_user,arg[iarg+2]);
       } else {
-	int i = atoi(arg[iarg+1]) - 1;
-	if (i < 0 || i >= nfield_initial)
-	  error->all(FLERR,"Illegal thermo_modify command");
-	if (format_user[i]) delete [] format_user[i];
-	int n = strlen(arg[iarg+2]) + 1;
-	format_user[i] = new char[n];
-	strcpy(format_user[i],arg[iarg+2]);
+        int i = atoi(arg[iarg+1]) - 1;
+        if (i < 0 || i >= nfield_initial)
+          error->all(FLERR,"Illegal thermo_modify command");
+        if (format_user[i]) delete [] format_user[i];
+        int n = strlen(arg[iarg+2]) + 1;
+        format_user[i] = new char[n];
+        strcpy(format_user[i],arg[iarg+2]);
       }
       iarg += 3;
 
@@ -745,16 +745,16 @@ void Thermo::parse_fields(char *str)
       addfield("Yz",&Thermo::compute_yz,FLOAT);
 
     } else if (strcmp(word,"xlat") == 0) {
-      if (domain->lattice == NULL) 
-	error->all(FLERR,"Thermo keyword requires lattice be defined");
+      if (domain->lattice == NULL)
+        error->all(FLERR,"Thermo keyword requires lattice be defined");
       addfield("Xlat",&Thermo::compute_xlat,FLOAT);
     } else if (strcmp(word,"ylat") == 0) {
-      if (domain->lattice == NULL) 
-	error->all(FLERR,"Thermo keyword requires lattice be defined");
+      if (domain->lattice == NULL)
+        error->all(FLERR,"Thermo keyword requires lattice be defined");
       addfield("Ylat",&Thermo::compute_ylat,FLOAT);
     } else if (strcmp(word,"zlat") == 0) {
-      if (domain->lattice == NULL) 
-	error->all(FLERR,"Thermo keyword requires lattice be defined");
+      if (domain->lattice == NULL)
+        error->all(FLERR,"Thermo keyword requires lattice be defined");
       addfield("Zlat",&Thermo::compute_zlat,FLOAT);
 
     } else if (strcmp(word,"pxx") == 0) {
@@ -799,7 +799,7 @@ void Thermo::parse_fields(char *str)
     // copy = at most 8 chars of ID to pass to addfield
 
     } else if ((strncmp(word,"c_",2) == 0) || (strncmp(word,"f_",2) == 0) ||
-	       (strncmp(word,"v_",2) == 0)) {
+               (strncmp(word,"v_",2) == 0)) {
 
       int n = strlen(word);
       char *id = new char[n];
@@ -814,74 +814,74 @@ void Thermo::parse_fields(char *str)
       char *ptr = strchr(id,'[');
       if (ptr == NULL) argindex1[nfield] = 0;
       else {
-	*ptr = '\0';
-	argindex1[nfield] = input->variable->int_between_brackets(ptr);
-	ptr++;
-	if (*ptr == '[') {
-	  argindex2[nfield] = input->variable->int_between_brackets(ptr);
-	  ptr++;
-	} else argindex2[nfield] = 0;
+        *ptr = '\0';
+        argindex1[nfield] = input->variable->int_between_brackets(ptr);
+        ptr++;
+        if (*ptr == '[') {
+          argindex2[nfield] = input->variable->int_between_brackets(ptr);
+          ptr++;
+        } else argindex2[nfield] = 0;
       }
 
       if (word[0] == 'c') {
-	n = modify->find_compute(id);
-	if (n < 0) error->all(FLERR,"Could not find thermo custom compute ID");
-	if (argindex1[nfield] == 0 && modify->compute[n]->scalar_flag == 0)
-	  error->all(FLERR,"Thermo compute does not compute scalar");
-	if (argindex1[nfield] > 0 && argindex2[nfield] == 0) {
-	  if (modify->compute[n]->vector_flag == 0)
-	    error->all(FLERR,"Thermo compute does not compute vector");
-	  if (argindex1[nfield] > modify->compute[n]->size_vector)
-	    error->all(FLERR,"Thermo compute vector is accessed out-of-range");
-	}
-	if (argindex1[nfield] > 0 && argindex2[nfield] > 0) {
-	  if (modify->compute[n]->array_flag == 0)
-	    error->all(FLERR,"Thermo compute does not compute array");
-	  if (argindex1[nfield] > modify->compute[n]->size_array_rows ||
-	      argindex2[nfield] > modify->compute[n]->size_array_cols)
-	    error->all(FLERR,"Thermo compute array is accessed out-of-range");
-	}
-
-	if (argindex1[nfield] == 0)
-	  field2index[nfield] = add_compute(id,SCALAR);
-	else if (argindex2[nfield] == 0)
-	  field2index[nfield] = add_compute(id,VECTOR);
-	else 
-	  field2index[nfield] = add_compute(id,ARRAY);
-	addfield(copy,&Thermo::compute_compute,FLOAT);
+        n = modify->find_compute(id);
+        if (n < 0) error->all(FLERR,"Could not find thermo custom compute ID");
+        if (argindex1[nfield] == 0 && modify->compute[n]->scalar_flag == 0)
+          error->all(FLERR,"Thermo compute does not compute scalar");
+        if (argindex1[nfield] > 0 && argindex2[nfield] == 0) {
+          if (modify->compute[n]->vector_flag == 0)
+            error->all(FLERR,"Thermo compute does not compute vector");
+          if (argindex1[nfield] > modify->compute[n]->size_vector)
+            error->all(FLERR,"Thermo compute vector is accessed out-of-range");
+        }
+        if (argindex1[nfield] > 0 && argindex2[nfield] > 0) {
+          if (modify->compute[n]->array_flag == 0)
+            error->all(FLERR,"Thermo compute does not compute array");
+          if (argindex1[nfield] > modify->compute[n]->size_array_rows ||
+              argindex2[nfield] > modify->compute[n]->size_array_cols)
+            error->all(FLERR,"Thermo compute array is accessed out-of-range");
+        }
+
+        if (argindex1[nfield] == 0)
+          field2index[nfield] = add_compute(id,SCALAR);
+        else if (argindex2[nfield] == 0)
+          field2index[nfield] = add_compute(id,VECTOR);
+        else
+          field2index[nfield] = add_compute(id,ARRAY);
+        addfield(copy,&Thermo::compute_compute,FLOAT);
 
       } else if (word[0] == 'f') {
-	n = modify->find_fix(id);
-	if (n < 0) error->all(FLERR,"Could not find thermo custom fix ID");
-	if (argindex1[nfield] == 0 && modify->fix[n]->scalar_flag == 0)
-	  error->all(FLERR,"Thermo fix does not compute scalar");
-	if (argindex1[nfield] > 0 && argindex2[nfield] == 0) {
-	  if (modify->fix[n]->vector_flag == 0)
-	    error->all(FLERR,"Thermo fix does not compute vector");
-	  if (argindex1[nfield] > modify->fix[n]->size_vector)
-	    error->all(FLERR,"Thermo fix vector is accessed out-of-range");
-	}
-	if (argindex1[nfield] > 0 && argindex2[nfield] > 0) {
-	  if (modify->fix[n]->array_flag == 0)
-	    error->all(FLERR,"Thermo fix does not compute array");
-	  if (argindex1[nfield] > modify->fix[n]->size_array_rows ||
-	      argindex2[nfield] > modify->fix[n]->size_array_cols)
-	    error->all(FLERR,"Thermo fix array is accessed out-of-range");
-	}
-
-	field2index[nfield] = add_fix(id);
-	addfield(copy,&Thermo::compute_fix,FLOAT);
+        n = modify->find_fix(id);
+        if (n < 0) error->all(FLERR,"Could not find thermo custom fix ID");
+        if (argindex1[nfield] == 0 && modify->fix[n]->scalar_flag == 0)
+          error->all(FLERR,"Thermo fix does not compute scalar");
+        if (argindex1[nfield] > 0 && argindex2[nfield] == 0) {
+          if (modify->fix[n]->vector_flag == 0)
+            error->all(FLERR,"Thermo fix does not compute vector");
+          if (argindex1[nfield] > modify->fix[n]->size_vector)
+            error->all(FLERR,"Thermo fix vector is accessed out-of-range");
+        }
+        if (argindex1[nfield] > 0 && argindex2[nfield] > 0) {
+          if (modify->fix[n]->array_flag == 0)
+            error->all(FLERR,"Thermo fix does not compute array");
+          if (argindex1[nfield] > modify->fix[n]->size_array_rows ||
+              argindex2[nfield] > modify->fix[n]->size_array_cols)
+            error->all(FLERR,"Thermo fix array is accessed out-of-range");
+        }
+
+        field2index[nfield] = add_fix(id);
+        addfield(copy,&Thermo::compute_fix,FLOAT);
 
       } else if (word[0] == 'v') {
-	n = input->variable->find(id);
-	if (n < 0) error->all(FLERR,"Could not find thermo custom variable name");
-	if (input->variable->equalstyle(n) == 0)
-	  error->all(FLERR,"Thermo custom variable is not equal-style variable");
-	if (argindex1[nfield]) 
-	  error->all(FLERR,"Thermo custom variable cannot be indexed");
-
-	field2index[nfield] = add_variable(id);
-	addfield(copy,&Thermo::compute_variable,FLOAT);
+        n = input->variable->find(id);
+        if (n < 0) error->all(FLERR,"Could not find thermo custom variable name");
+        if (input->variable->equalstyle(n) == 0)
+          error->all(FLERR,"Thermo custom variable is not equal-style variable");
+        if (argindex1[nfield])
+          error->all(FLERR,"Thermo custom variable cannot be indexed");
+
+        field2index[nfield] = add_variable(id);
+        addfield(copy,&Thermo::compute_variable,FLOAT);
       }
 
       delete [] id;
@@ -914,8 +914,8 @@ int Thermo::add_compute(const char *id, int which)
 {
   int icompute;
   for (icompute = 0; icompute < ncompute; icompute++)
-    if ((strcmp(id,id_compute[icompute]) == 0) && 
-	which == compute_which[icompute]) break;
+    if ((strcmp(id,id_compute[icompute]) == 0) &&
+        which == compute_which[icompute]) break;
   if (icompute < ncompute) return icompute;
 
   int n = strlen(id) + 1;
@@ -967,7 +967,7 @@ int Thermo::evaluate_keyword(char *word, double *answer)
   // if inbetween runs and needed compute is not current, error
   // if in middle of run and needed compute is not current, invoke it
   // for keywords that use pe indirectly (evdwl, ebond, etc):
-  //   check if energy was tallied on this timestep and set pe->invoked_flag 
+  //   check if energy was tallied on this timestep and set pe->invoked_flag
   //   this will trigger next timestep for energy tallying via addstep()
 
   if (strcmp(word,"step") == 0) {
@@ -975,13 +975,13 @@ int Thermo::evaluate_keyword(char *word, double *answer)
     dvalue = bivalue;
 
   } else if (strcmp(word,"elapsed") == 0) {
-    if (update->whichflag == 0) 
+    if (update->whichflag == 0)
       error->all(FLERR,"This variable thermo keyword cannot be used between runs");
     compute_elapsed();
     dvalue = bivalue;
 
   } else if (strcmp(word,"elaplong") == 0) {
-    if (update->whichflag == 0) 
+    if (update->whichflag == 0)
       error->all(FLERR,"This variable thermo keyword cannot be used between runs");
     compute_elapsed_long();
     dvalue = bivalue;
@@ -990,17 +990,17 @@ int Thermo::evaluate_keyword(char *word, double *answer)
     compute_dt();
 
   } else if (strcmp(word,"cpu") == 0) {
-    if (update->whichflag == 0) 
+    if (update->whichflag == 0)
       error->all(FLERR,"This variable thermo keyword cannot be used between runs");
     compute_cpu();
 
   } else if (strcmp(word,"tpcpu") == 0) {
-    if (update->whichflag == 0) 
+    if (update->whichflag == 0)
       error->all(FLERR,"This variable thermo keyword cannot be used between runs");
     compute_tpcpu();
 
   } else if (strcmp(word,"spcpu") == 0) {
-    if (update->whichflag == 0) 
+    if (update->whichflag == 0)
       error->all(FLERR,"This variable thermo keyword cannot be used between runs");
     compute_spcpu();
 
@@ -1011,25 +1011,25 @@ int Thermo::evaluate_keyword(char *word, double *answer)
   } else if (strcmp(word,"temp") == 0) {
     if (!temperature)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init temp");	  
+                 "thermo to use/init temp");
     if (update->whichflag == 0) {
       if (temperature->invoked_scalar != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
       temperature->compute_scalar();
       temperature->invoked_flag |= INVOKED_SCALAR;
     }
     compute_temp();
-    
+
   } else if (strcmp(word,"press") == 0) {
     if (!pressure)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init press");
+                 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_scalar != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_SCALAR)) {
       pressure->compute_scalar();
       pressure->invoked_flag |= INVOKED_SCALAR;
@@ -1041,8 +1041,8 @@ int Thermo::evaluate_keyword(char *word, double *answer)
       error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     if (update->whichflag == 0) {
       if (pe->invoked_scalar != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(pe->invoked_flag & INVOKED_SCALAR)) {
       pe->compute_scalar();
       pe->invoked_flag |= INVOKED_SCALAR;
@@ -1052,11 +1052,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
   } else if (strcmp(word,"ke") == 0) {
     if (!temperature)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init temp");
+                 "thermo to use/init temp");
     if (update->whichflag == 0) {
       if (temperature->invoked_scalar != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
       temperature->compute_scalar();
       temperature->invoked_flag |= INVOKED_SCALAR;
@@ -1068,19 +1068,19 @@ int Thermo::evaluate_keyword(char *word, double *answer)
       error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     if (update->whichflag == 0) {
       if (pe->invoked_scalar != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(pe->invoked_flag & INVOKED_SCALAR)) {
       pe->compute_scalar();
       pe->invoked_flag |= INVOKED_SCALAR;
     }
     if (!temperature)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init temp");
+                 "thermo to use/init temp");
     if (update->whichflag == 0) {
       if (temperature->invoked_scalar != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
       temperature->compute_scalar();
       temperature->invoked_flag |= INVOKED_SCALAR;
@@ -1092,30 +1092,30 @@ int Thermo::evaluate_keyword(char *word, double *answer)
       error->all(FLERR,"Thermo keyword in variable requires thermo to use/init pe");
     if (update->whichflag == 0) {
       if (pe->invoked_scalar != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(pe->invoked_flag & INVOKED_SCALAR)) {
       pe->compute_scalar();
       pe->invoked_flag |= INVOKED_SCALAR;
     }
     if (!temperature)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init temp");
+                 "thermo to use/init temp");
     if (update->whichflag == 0) {
       if (temperature->invoked_scalar != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(temperature->invoked_flag & INVOKED_SCALAR)) {
       temperature->compute_scalar();
       temperature->invoked_flag |= INVOKED_SCALAR;
     }
     if (!pressure)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init press");
+                 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_scalar != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_SCALAR)) {
       pressure->compute_scalar();
       pressure->invoked_flag |= INVOKED_SCALAR;
@@ -1219,26 +1219,26 @@ int Thermo::evaluate_keyword(char *word, double *answer)
   else if (strcmp(word,"yz") == 0) compute_yz();
 
   else if (strcmp(word,"xlat") == 0) {
-    if (domain->lattice == NULL) 
+    if (domain->lattice == NULL)
       error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
     compute_xlat();
   } else if (strcmp(word,"ylat") == 0) {
-    if (domain->lattice == NULL) 
+    if (domain->lattice == NULL)
       error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
-    compute_ylat(); 
+    compute_ylat();
   } else if (strcmp(word,"zlat") == 0) {
-    if (domain->lattice == NULL) 
+    if (domain->lattice == NULL)
       error->all(FLERR,"Thermo keyword in variable requires lattice be defined");
     compute_zlat();
 
   } else if (strcmp(word,"pxx") == 0) {
     if (!pressure)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init press");
+                 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
       pressure->invoked_flag |= INVOKED_VECTOR;
@@ -1248,11 +1248,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
   } else if (strcmp(word,"pyy") == 0) {
     if (!pressure)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init press");
+                 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
       pressure->invoked_flag |= INVOKED_VECTOR;
@@ -1262,11 +1262,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
   } else if (strcmp(word,"pzz") == 0) {
     if (!pressure)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init press");
+                 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
       pressure->invoked_flag |= INVOKED_VECTOR;
@@ -1276,11 +1276,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
   } else if (strcmp(word,"pxy") == 0) {
     if (!pressure)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init press");
+                 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
       pressure->invoked_flag |= INVOKED_VECTOR;
@@ -1290,11 +1290,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
   } else if (strcmp(word,"pxz") == 0) {
     if (!pressure)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init press");
+                 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
       pressure->invoked_flag |= INVOKED_VECTOR;
@@ -1304,11 +1304,11 @@ int Thermo::evaluate_keyword(char *word, double *answer)
   } else if (strcmp(word,"pyz") == 0) {
     if (!pressure)
       error->all(FLERR,"Thermo keyword in variable requires "
-		 "thermo to use/init press");
+                 "thermo to use/init press");
     if (update->whichflag == 0) {
       if (pressure->invoked_vector != update->ntimestep)
-	error->all(FLERR,"Compute used in variable thermo keyword between runs "
-		   "is not current");
+        error->all(FLERR,"Compute used in variable thermo keyword between runs "
+                   "is not current");
     } else if (!(pressure->invoked_flag & INVOKED_VECTOR)) {
       pressure->compute_vector();
       pressure->invoked_flag |= INVOKED_VECTOR;
@@ -1900,7 +1900,7 @@ void Thermo::compute_cellalpha()
     double cosalpha = (h[5]*h[4]+h[1]*h[3])/
       sqrt((h[1]*h[1]+h[5]*h[5])*(h[2]*h[2]+h[3]*h[3]+h[4]*h[4]));
     dvalue = acos(cosalpha)*180.0/MY_PI;
-  }    
+  }
 }
 
 /* ---------------------------------------------------------------------- */
diff --git a/src/thermo.h b/src/thermo.h
index ceac5be9cb..ca920758d2 100644
--- a/src/thermo.h
+++ b/src/thermo.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/timer.cpp b/src/timer.cpp
index eb38d5d249..329de00d60 100644
--- a/src/timer.cpp
+++ b/src/timer.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/timer.h b/src/timer.h
index 95851dfd23..1c421cb631 100644
--- a/src/timer.h
+++ b/src/timer.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/universe.cpp b/src/universe.cpp
index b9d88ca700..62048c55a9 100644
--- a/src/universe.cpp
+++ b/src/universe.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -78,9 +78,9 @@ void Universe::reorder(char *style, char *arg)
 
   if (strcmp(style,"nth") == 0) {
     int n = atoi(arg);
-    if (n <= 0) 
+    if (n <= 0)
       error->universe_all(FLERR,"Invalid -reorder N value");
-    if (nprocs % n) 
+    if (nprocs % n)
       error->universe_all(FLERR,"Nprocs not a multiple of N for -reorder");
     for (int i = 0; i < nprocs; i++) {
       if (i < (n-1)*nprocs/n) uni2orig[i] = i/(n-1) * n + (i % (n-1));
@@ -97,12 +97,12 @@ void Universe::reorder(char *style, char *arg)
 
       char *ptr;
       if (!fgets(line,MAXLINE,fp))
-	error->one(FLERR,"Unexpected end of -reorder file");
+        error->one(FLERR,"Unexpected end of -reorder file");
       while (1) {
-	if (ptr = strchr(line,'#')) *ptr = '\0';
-	if (strspn(line," \t\n\r") != strlen(line)) break;
-	if (!fgets(line,MAXLINE,fp))
-	  error->one(FLERR,"Unexpected end of -reorder file");
+        if (ptr = strchr(line,'#')) *ptr = '\0';
+        if (strspn(line," \t\n\r") != strlen(line)) break;
+        if (!fgets(line,MAXLINE,fp))
+          error->one(FLERR,"Unexpected end of -reorder file");
       }
 
       // read nprocs lines
@@ -111,24 +111,24 @@ void Universe::reorder(char *style, char *arg)
       int me_orig,me_new;
       sscanf(line,"%d %d",&me_orig,&me_new);
       if (me_orig < 0 || me_orig >= nprocs ||
-	  me_new < 0 || me_new >= nprocs)
-	error->one(FLERR,"Invalid entry in -reorder file");
+          me_new < 0 || me_new >= nprocs)
+        error->one(FLERR,"Invalid entry in -reorder file");
       uni2orig[me_new] = me_orig;
 
       for (int i = 1; i < nprocs; i++) {
-	if (!fgets(line,MAXLINE,fp))
-	  error->one(FLERR,"Unexpected end of -reorder file");
-	sscanf(line,"%d %d",&me_orig,&me_new);
-	if (me_orig < 0 || me_orig >= nprocs ||
-	    me_new < 0 || me_new >= nprocs)
-	  error->one(FLERR,"Invalid entry in -reorder file");
-	uni2orig[me_new] = me_orig;
+        if (!fgets(line,MAXLINE,fp))
+          error->one(FLERR,"Unexpected end of -reorder file");
+        sscanf(line,"%d %d",&me_orig,&me_new);
+        if (me_orig < 0 || me_orig >= nprocs ||
+            me_new < 0 || me_new >= nprocs)
+          error->one(FLERR,"Invalid entry in -reorder file");
+        uni2orig[me_new] = me_orig;
       }
       fclose(fp);
     }
 
     // bcast uni2org from proc 0 to all other universe procs
-    
+
     MPI_Bcast(uni2orig,nprocs,MPI_INT,0,uorig);
 
   } else error->universe_all(FLERR,"Invalid command-line argument");
diff --git a/src/universe.h b/src/universe.h
index 7d831d0b0b..b997859668 100644
--- a/src/universe.h
+++ b/src/universe.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -36,7 +36,7 @@ class Universe : protected Pointers {
   int *root_proc;         // root proc in each world
 
   MPI_Comm uorig;         // original communicator passed to LAMMPS instance
-  int *uni2orig;          // proc I in universe uworld is 
+  int *uni2orig;          // proc I in universe uworld is
                           // proc uni2orig[I] in original communicator
 
   Universe(class LAMMPS *, MPI_Comm);
diff --git a/src/update.cpp b/src/update.cpp
index d1f084f91f..5135214b68 100644
--- a/src/update.cpp
+++ b/src/update.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -116,7 +116,7 @@ void Update::set_units(const char *style)
   // physical constants from:
   // http://physics.nist.gov/cuu/Constants/Table/allascii.txt
   // using thermochemical calorie = 4.184 J
-  
+
   if (strcmp(style,"lj") == 0) {
     force->boltz = 1.0;
     force->hplanck = 0.18292026;  // using LJ parameters for argon
@@ -137,7 +137,7 @@ void Update::set_units(const char *style)
 
     dt = 0.005;
     neighbor->skin = 0.3;
-    
+
   } else if (strcmp(style,"real") == 0) {
     force->boltz = 0.0019872067;
     force->hplanck = 95.306976368;
@@ -146,7 +146,7 @@ void Update::set_units(const char *style)
     force->mv2d = 1.0 / 0.602214179;
     force->nktv2p = 68568.415;
     force->qqr2e = 332.06371;
-    force->qe2f = 23.060549; 
+    force->qe2f = 23.060549;
     force->vxmu2f = 1.4393264316e4;
     force->xxt2kmu = 0.1;
     force->e_mass = 1.0/1836.1527556560675;
@@ -223,15 +223,15 @@ void Update::set_units(const char *style)
     neighbor->skin = 0.1;
 
   } else if (strcmp(style,"electron") == 0) {
-    force->boltz = 3.16681534e-6;  
+    force->boltz = 3.16681534e-6;
     force->hplanck = 0.1519829846;
-    force->mvv2e = 1.06657236;     
-    force->ftm2v = 0.937582899;    
-    force->mv2d = 1.0;             
-    force->nktv2p = 2.94210108e13; 
-    force->qqr2e = 1.0;            
-    force->qe2f = 1.94469051e-10;  
-    force->vxmu2f = 3.39893149e1;  
+    force->mvv2e = 1.06657236;
+    force->ftm2v = 0.937582899;
+    force->mv2d = 1.0;
+    force->nktv2p = 2.94210108e13;
+    force->qqr2e = 1.0;
+    force->qe2f = 1.94469051e-10;
+    force->vxmu2f = 3.39893149e1;
     force->xxt2kmu = 3.13796367e-2;
     force->e_mass = 0.0;    // not yet set
     force->hhmrr2e = 0.0;
@@ -242,7 +242,7 @@ void Update::set_units(const char *style)
 
     dt = 0.001;
     neighbor->skin = 2.0;
-    
+
   } else error->all(FLERR,"Illegal units command");
 
   delete [] unit_style;
@@ -281,7 +281,7 @@ void Update::create_integrate(int narg, char **arg, char *suffix)
 ------------------------------------------------------------------------- */
 
 void Update::new_integrate(char *style, int narg, char **arg,
-			   char *suffix, int &sflag)
+                           char *suffix, int &sflag)
 {
   int success = 0;
 
@@ -370,16 +370,16 @@ void Update::reset_timestep(bigint newstep)
   for (int i = 0; i < output->ndump; i++)
     if (output->last_dump[i] >= 0)
       error->all(FLERR,
-		 "Cannot reset timestep with dump file already written to");
+                 "Cannot reset timestep with dump file already written to");
 
   if (output->restart && output->last_restart >= 0)
     error->all(FLERR,
-	       "Cannot reset timestep with restart file already written");
+               "Cannot reset timestep with restart file already written");
 
   for (int i = 0; i < modify->nfix; i++)
     if (modify->fix[i]->time_depend)
       error->all(FLERR,
-		 "Cannot reset timestep with a time-dependent fix defined");
+                 "Cannot reset timestep with a time-dependent fix defined");
 
   for (int i = 0; i < domain->nregion; i++)
     if (domain->regions[i]->dynamic_check())
diff --git a/src/update.h b/src/update.h
index 9f9e1388c3..954e9357a2 100644
--- a/src/update.h
+++ b/src/update.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/variable.cpp b/src/variable.cpp
index 1f50a3af36..82b3276504 100644
--- a/src/variable.cpp
+++ b/src/variable.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -157,18 +157,18 @@ void Variable::set(int narg, char **arg)
       nlast = atoi(arg[2]);
       if (nlast <= 0) error->all(FLERR,"Illegal variable command");
       if (narg == 4 && strcmp(arg[3],"pad") == 0) {
-	char digits[12];
-	sprintf(digits,"%d",nlast);
-	pad[nvar] = strlen(digits);
+        char digits[12];
+        sprintf(digits,"%d",nlast);
+        pad[nvar] = strlen(digits);
       } else pad[nvar] = 0;
     } else if (narg == 4 || (narg == 5 && strcmp(arg[4],"pad") == 0)) {
       nfirst = atoi(arg[2]);
       nlast = atoi(arg[3]);
       if (nfirst > nlast || nlast <= 0) error->all(FLERR,"Illegal variable command");
       if (narg == 5 && strcmp(arg[4],"pad") == 0) {
-	char digits[12];
-	sprintf(digits,"%d",nlast);
-	pad[nvar] = strlen(digits);
+        char digits[12];
+        sprintf(digits,"%d",nlast);
+        pad[nvar] = strlen(digits);
       } else pad[nvar] = 0;
     } else error->all(FLERR,"Illegal variable command");
     num[nvar] = nlast;
@@ -212,7 +212,7 @@ void Variable::set(int narg, char **arg)
       copy(num[nvar],&arg[2],data[nvar]);
     } else if (strcmp(arg[1],"uloop") == 0) {
       if (narg < 3 || narg > 4 || (narg == 4 && strcmp(arg[3],"pad") != 0))
-	error->all(FLERR,"Illegal variable command");
+        error->all(FLERR,"Illegal variable command");
       if (find(arg[0]) >= 0) return;
       if (nvar == maxvar) extend();
       style[nvar] = ULOOP;
@@ -220,9 +220,9 @@ void Variable::set(int narg, char **arg)
       data[nvar] = new char*[1];
       data[nvar][0] = NULL;
       if (narg == 4) {
-	char digits[12];
-	sprintf(digits,"%d",num[nvar]);
-	pad[nvar] = strlen(digits);
+        char digits[12];
+        sprintf(digits,"%d",num[nvar]);
+        pad[nvar] = strlen(digits);
       } else pad[nvar] = 0;
     }
 
@@ -237,9 +237,9 @@ void Variable::set(int narg, char **arg)
     }
 
     for (int jvar = 0; jvar < nvar; jvar++)
-      if (num[jvar] && (style[jvar] == UNIVERSE || style[jvar] == ULOOP) && 
-	  num[nvar] != num[jvar])
-	error->all(FLERR,"All universe/uloop variables must have same # of values");
+      if (num[jvar] && (style[jvar] == UNIVERSE || style[jvar] == ULOOP) &&
+          num[nvar] != num[jvar])
+        error->all(FLERR,"All universe/uloop variables must have same # of values");
 
   // STRING
   // remove pre-existing var if also style STRING (allows it to be reset)
@@ -250,7 +250,7 @@ void Variable::set(int narg, char **arg)
     if (narg != 3) error->all(FLERR,"Illegal variable command");
     if (find(arg[0]) >= 0) {
       if (style[find(arg[0])] != STRING)
-	error->all(FLERR,"Cannot redefine variable as a different style");
+        error->all(FLERR,"Cannot redefine variable as a different style");
       remove(find(arg[0]));
     }
     if (nvar == maxvar) extend();
@@ -260,7 +260,7 @@ void Variable::set(int narg, char **arg)
     pad[nvar] = 0;
     data[nvar] = new char*[num[nvar]];
     copy(1,&arg[2],data[nvar]);
-    
+
   // EQUAL
   // remove pre-existing var if also style EQUAL (allows it to be reset)
   // num = 2, which = 1st value
@@ -270,7 +270,7 @@ void Variable::set(int narg, char **arg)
     if (narg != 3) error->all(FLERR,"Illegal variable command");
     if (find(arg[0]) >= 0) {
       if (style[find(arg[0])] != EQUAL)
-	error->all(FLERR,"Cannot redefine variable as a different style");
+        error->all(FLERR,"Cannot redefine variable as a different style");
       remove(find(arg[0]));
     }
     if (nvar == maxvar) extend();
@@ -281,7 +281,7 @@ void Variable::set(int narg, char **arg)
     data[nvar] = new char*[num[nvar]];
     copy(1,&arg[2],data[nvar]);
     data[nvar][1] = NULL;
-    
+
   // ATOM
   // remove pre-existing var if also style ATOM (allows it to be reset)
   // num = 1, which = 1st value
@@ -291,7 +291,7 @@ void Variable::set(int narg, char **arg)
     if (narg != 3) error->all(FLERR,"Illegal variable command");
     if (find(arg[0]) >= 0) {
       if (style[find(arg[0])] != ATOM)
-	error->all(FLERR,"Cannot redefine variable as a different style");
+        error->all(FLERR,"Cannot redefine variable as a different style");
       remove(find(arg[0]));
     }
     if (nvar == maxvar) extend();
@@ -301,7 +301,7 @@ void Variable::set(int narg, char **arg)
     pad[nvar] = 0;
     data[nvar] = new char*[num[nvar]];
     copy(1,&arg[2],data[nvar]);
-    
+
   } else error->all(FLERR,"Illegal variable command");
 
   // set name of variable
@@ -315,7 +315,7 @@ void Variable::set(int narg, char **arg)
   for (int i = 0; i < n-1; i++)
     if (!isalnum(names[nvar][i]) && names[nvar][i] != '_')
       error->all(FLERR,"Variable name must be alphanumeric or "
-		 "underscore characters");
+                 "underscore characters");
   nvar++;
 }
 
@@ -374,8 +374,8 @@ int Variable::next(int narg, char **arg)
       ivar = find(arg[iarg]);
       which[ivar]++;
       if (which[ivar] >= num[ivar]) {
-	flag = 1;
-	remove(ivar);
+        flag = 1;
+        remove(ivar);
       }
     }
 
@@ -388,8 +388,8 @@ int Variable::next(int narg, char **arg)
     int nextindex;
     if (me == 0) {
       while (1) {
-	if (!rename("tmp.lammps.variable","tmp.lammps.variable.lock")) break;
-	usleep(100000);
+        if (!rename("tmp.lammps.variable","tmp.lammps.variable.lock")) break;
+        usleep(100000);
       }
       FILE *fp = fopen("tmp.lammps.variable.lock","r");
       fscanf(fp,"%d",&nextindex);
@@ -399,13 +399,13 @@ int Variable::next(int narg, char **arg)
       fclose(fp);
       rename("tmp.lammps.variable.lock","tmp.lammps.variable");
       if (universe->uscreen)
-	fprintf(universe->uscreen,
-		"Increment via next: value %d on partition %d\n",
-		nextindex+1,universe->iworld);
+        fprintf(universe->uscreen,
+                "Increment via next: value %d on partition %d\n",
+                nextindex+1,universe->iworld);
       if (universe->ulogfile)
-	fprintf(universe->ulogfile,
-		"Increment via next: value %d on partition %d\n",
-		nextindex+1,universe->iworld);
+        fprintf(universe->ulogfile,
+                "Increment via next: value %d on partition %d\n",
+                nextindex+1,universe->iworld);
     }
     MPI_Bcast(&nextindex,1,MPI_INT,0,world);
 
@@ -413,8 +413,8 @@ int Variable::next(int narg, char **arg)
       ivar = find(arg[iarg]);
       which[ivar] = nextindex;
       if (which[ivar] >= num[ivar]) {
-	flag = 1;
-	remove(ivar);
+        flag = 1;
+        remove(ivar);
       }
     }
   }
@@ -438,7 +438,7 @@ char *Variable::retrieve(char *name)
   if (which[ivar] >= num[ivar]) return NULL;
 
   char *str;
-  if (style[ivar] == INDEX || style[ivar] == WORLD || 
+  if (style[ivar] == INDEX || style[ivar] == WORLD ||
       style[ivar] == UNIVERSE || style[ivar] == STRING) {
     str = data[ivar][which[ivar]];
   } else if (style[ivar] == LOOP || style[ivar] == ULOOP) {
@@ -485,7 +485,7 @@ double Variable::compute_equal(int ivar)
 ------------------------------------------------------------------------- */
 
 void Variable::compute_atom(int ivar, int igroup,
-			    double *result, int stride, int sumflag)
+                            double *result, int stride, int sumflag)
 {
   Tree *tree;
   double tmp = evaluate(data[ivar][0],&tree);
@@ -518,7 +518,7 @@ void Variable::compute_atom(int ivar, int igroup,
    search for name in list of variables names
    return index or -1 if not found
 ------------------------------------------------------------------------- */
-  
+
 int Variable::find(char *name)
 {
   for (int i = 0; i < nvar; i++)
@@ -529,7 +529,7 @@ int Variable::find(char *name)
 /* ----------------------------------------------------------------------
    return 1 if variable is EQUAL style, 0 if not
 ------------------------------------------------------------------------- */
-  
+
 int Variable::equalstyle(int ivar)
 {
   if (style[ivar] == EQUAL) return 1;
@@ -539,7 +539,7 @@ int Variable::equalstyle(int ivar)
 /* ----------------------------------------------------------------------
    return 1 if variable is ATOM style, 0 if not
 ------------------------------------------------------------------------- */
-  
+
 int Variable::atomstyle(int ivar)
 {
   if (style[ivar] == ATOM) return 1;
@@ -549,7 +549,7 @@ int Variable::atomstyle(int ivar)
 /* ----------------------------------------------------------------------
    remove Nth variable from list and compact list
 ------------------------------------------------------------------------- */
-  
+
 void Variable::remove(int n)
 {
   delete [] names[n];
@@ -581,14 +581,14 @@ void Variable::extend()
   memory->grow(num,maxvar,"var:num");
   memory->grow(which,maxvar,"var:which");
   memory->grow(pad,maxvar,"var:pad");
-  data = (char ***) 
+  data = (char ***)
     memory->srealloc(data,maxvar*sizeof(char **),"var:data");
 }
 
 /* ----------------------------------------------------------------------
    copy narg strings from **from to **to, and allocate space for them
 ------------------------------------------------------------------------- */
-  
+
 void Variable::copy(int narg, char **from, char **to)
 {
   int n;
@@ -608,7 +608,7 @@ void Variable::copy(int narg, char **from, char **to)
      math operation = (),-x,x+y,x-y,x*y,x/y,x^y,
                       x==y,x!=y,x<y,x<=y,x>y,x>=y,x&&y,x||y,
                       sqrt(x),exp(x),ln(x),log(x),
-		      sin(x),cos(x),tan(x),asin(x),atan2(y,x),...
+                      sin(x),cos(x),tan(x),asin(x),atan2(y,x),...
      group function = count(group), mass(group), xcm(group,x), ...
      special function = sum(x),min(x), ...
      atom value = x[i], y[i], vx[i], ...
@@ -662,9 +662,9 @@ double Variable::evaluate(char *str, Tree **tree)
       // evaluate contents and push on stack
 
       if (tree) {
-	Tree *newtree;
-	evaluate(contents,&newtree);
-	treestack[ntreestack++] = newtree;
+        Tree *newtree;
+        evaluate(contents,&newtree);
+        treestack[ntreestack++] = newtree;
       } else argstack[nargstack++] = evaluate(contents,NULL);
 
       delete [] contents;
@@ -682,9 +682,9 @@ double Variable::evaluate(char *str, Tree **tree)
       int istart = i;
       while (isdigit(str[i]) || str[i] == '.') i++;
       if (str[i] == 'e' || str[i] == 'E') {
-	i++;
-	if (str[i] == '+' || str[i] == '-') i++;
-	while (isdigit(str[i])) i++;
+        i++;
+        if (str[i] == '+' || str[i] == '-') i++;
+        while (isdigit(str[i])) i++;
       }
       int istop = i - 1;
 
@@ -695,10 +695,10 @@ double Variable::evaluate(char *str, Tree **tree)
 
       if (tree) {
         Tree *newtree = new Tree();
-	newtree->type = VALUE;
-	newtree->value = atof(number);
-	newtree->left = newtree->middle = newtree->right = NULL;
-	treestack[ntreestack++] = newtree;
+        newtree->type = VALUE;
+        newtree->value = atof(number);
+        newtree->left = newtree->middle = newtree->right = NULL;
+        treestack[ntreestack++] = newtree;
       } else argstack[nargstack++] = atof(number);
 
       delete [] number;
@@ -729,438 +729,438 @@ double Variable::evaluate(char *str, Tree **tree)
       // ----------------
 
       if (strncmp(word,"c_",2) == 0) {
-	if (domain->box_exist == 0)
-	  error->all(FLERR,"Variable evaluation before simulation box is defined");
- 
-	n = strlen(word) - 2 + 1;
-	char *id = new char[n];
-	strcpy(id,&word[2]);
-
-	int icompute = modify->find_compute(id);
-	if (icompute < 0) error->all(FLERR,"Invalid compute ID in variable formula");
-	Compute *compute = modify->compute[icompute];
-	delete [] id;
-
-	// parse zero or one or two trailing brackets
-	// point i beyond last bracket
-	// nbracket = # of bracket pairs
-	// index1,index2 = int inside each bracket pair
-
-	int nbracket,index1,index2;
-	if (str[i] != '[') nbracket = 0;
-	else {
-	  nbracket = 1;
-	  ptr = &str[i];
-	  index1 = int_between_brackets(ptr);
-	  i = ptr-str+1;
-	  if (str[i] == '[') {
-	    nbracket = 2;
-	    ptr = &str[i];
-	    index2 = int_between_brackets(ptr);
-	    i = ptr-str+1;
-	  }
-	}
+        if (domain->box_exist == 0)
+          error->all(FLERR,"Variable evaluation before simulation box is defined");
+
+        n = strlen(word) - 2 + 1;
+        char *id = new char[n];
+        strcpy(id,&word[2]);
+
+        int icompute = modify->find_compute(id);
+        if (icompute < 0) error->all(FLERR,"Invalid compute ID in variable formula");
+        Compute *compute = modify->compute[icompute];
+        delete [] id;
+
+        // parse zero or one or two trailing brackets
+        // point i beyond last bracket
+        // nbracket = # of bracket pairs
+        // index1,index2 = int inside each bracket pair
+
+        int nbracket,index1,index2;
+        if (str[i] != '[') nbracket = 0;
+        else {
+          nbracket = 1;
+          ptr = &str[i];
+          index1 = int_between_brackets(ptr);
+          i = ptr-str+1;
+          if (str[i] == '[') {
+            nbracket = 2;
+            ptr = &str[i];
+            index2 = int_between_brackets(ptr);
+            i = ptr-str+1;
+          }
+        }
 
         // c_ID = scalar from global scalar
 
-	if (nbracket == 0 && compute->scalar_flag) {
-
-	  if (update->whichflag == 0) {
-	    if (compute->invoked_scalar != update->ntimestep)
-	      error->all(FLERR,"Compute used in variable between runs "
-			 "is not current");
-	  } else if (!(compute->invoked_flag & INVOKED_SCALAR)) {
-	    compute->compute_scalar();
-	    compute->invoked_flag |= INVOKED_SCALAR;
-	  }
-
-	  value1 = compute->scalar;
-	  if (tree) {
-	    Tree *newtree = new Tree();
-	    newtree->type = VALUE;
-	    newtree->value = value1;
-	    newtree->left = newtree->middle = newtree->right = NULL;
-	    treestack[ntreestack++] = newtree;
-	  } else argstack[nargstack++] = value1;
+        if (nbracket == 0 && compute->scalar_flag) {
+
+          if (update->whichflag == 0) {
+            if (compute->invoked_scalar != update->ntimestep)
+              error->all(FLERR,"Compute used in variable between runs "
+                         "is not current");
+          } else if (!(compute->invoked_flag & INVOKED_SCALAR)) {
+            compute->compute_scalar();
+            compute->invoked_flag |= INVOKED_SCALAR;
+          }
+
+          value1 = compute->scalar;
+          if (tree) {
+            Tree *newtree = new Tree();
+            newtree->type = VALUE;
+            newtree->value = value1;
+            newtree->left = newtree->middle = newtree->right = NULL;
+            treestack[ntreestack++] = newtree;
+          } else argstack[nargstack++] = value1;
 
         // c_ID[i] = scalar from global vector
 
-	} else if (nbracket == 1 && compute->vector_flag) {
-
-	  if (index1 > compute->size_vector)
-	    error->all(FLERR,"Variable formula compute vector "
-		       "is accessed out-of-range");
-	  if (update->whichflag == 0) {
-	    if (compute->invoked_vector != update->ntimestep)
-	      error->all(FLERR,"Compute used in variable between runs "
-			 "is not current");
-	  } else if (!(compute->invoked_flag & INVOKED_VECTOR)) {
-	    compute->compute_vector();
-	    compute->invoked_flag |= INVOKED_VECTOR;
-	  }
-
-	  value1 = compute->vector[index1-1];
-	  if (tree) {
-	    Tree *newtree = new Tree();
-	    newtree->type = VALUE;
-	    newtree->value = value1;
-	    newtree->left = newtree->middle = newtree->right = NULL;
-	    treestack[ntreestack++] = newtree;
-	  } else argstack[nargstack++] = value1;
+        } else if (nbracket == 1 && compute->vector_flag) {
+
+          if (index1 > compute->size_vector)
+            error->all(FLERR,"Variable formula compute vector "
+                       "is accessed out-of-range");
+          if (update->whichflag == 0) {
+            if (compute->invoked_vector != update->ntimestep)
+              error->all(FLERR,"Compute used in variable between runs "
+                         "is not current");
+          } else if (!(compute->invoked_flag & INVOKED_VECTOR)) {
+            compute->compute_vector();
+            compute->invoked_flag |= INVOKED_VECTOR;
+          }
+
+          value1 = compute->vector[index1-1];
+          if (tree) {
+            Tree *newtree = new Tree();
+            newtree->type = VALUE;
+            newtree->value = value1;
+            newtree->left = newtree->middle = newtree->right = NULL;
+            treestack[ntreestack++] = newtree;
+          } else argstack[nargstack++] = value1;
 
         // c_ID[i][j] = scalar from global array
 
-	} else if (nbracket == 2 && compute->array_flag) {
-
-	  if (index1 > compute->size_array_rows)
-	    error->all(FLERR,"Variable formula compute array "
-		       "is accessed out-of-range");
-	  if (index2 > compute->size_array_cols)
-	    error->all(FLERR,"Variable formula compute array "
-		       "is accessed out-of-range");
-	  if (update->whichflag == 0) {
-	    if (compute->invoked_array != update->ntimestep)
-	      error->all(FLERR,"Compute used in variable between runs "
-			 "is not current");
-	  } else if (!(compute->invoked_flag & INVOKED_ARRAY)) {
-	    compute->compute_array();
-	    compute->invoked_flag |= INVOKED_ARRAY;
-	  }
-
-	  value1 = compute->array[index1-1][index2-1];
-	  if (tree) {
-	    Tree *newtree = new Tree();
-	    newtree->type = VALUE;
-	    newtree->value = value1;
-	    newtree->left = newtree->middle = newtree->right = NULL;
-	    treestack[ntreestack++] = newtree;
-	  } else argstack[nargstack++] = value1;
+        } else if (nbracket == 2 && compute->array_flag) {
+
+          if (index1 > compute->size_array_rows)
+            error->all(FLERR,"Variable formula compute array "
+                       "is accessed out-of-range");
+          if (index2 > compute->size_array_cols)
+            error->all(FLERR,"Variable formula compute array "
+                       "is accessed out-of-range");
+          if (update->whichflag == 0) {
+            if (compute->invoked_array != update->ntimestep)
+              error->all(FLERR,"Compute used in variable between runs "
+                         "is not current");
+          } else if (!(compute->invoked_flag & INVOKED_ARRAY)) {
+            compute->compute_array();
+            compute->invoked_flag |= INVOKED_ARRAY;
+          }
+
+          value1 = compute->array[index1-1][index2-1];
+          if (tree) {
+            Tree *newtree = new Tree();
+            newtree->type = VALUE;
+            newtree->value = value1;
+            newtree->left = newtree->middle = newtree->right = NULL;
+            treestack[ntreestack++] = newtree;
+          } else argstack[nargstack++] = value1;
 
         // c_ID[i] = scalar from per-atom vector
 
-	} else if (nbracket == 1 && compute->peratom_flag && 
-		   compute->size_peratom_cols == 0) {
+        } else if (nbracket == 1 && compute->peratom_flag &&
+                   compute->size_peratom_cols == 0) {
 
-	  if (update->whichflag == 0) {
-	    if (compute->invoked_peratom != update->ntimestep)
-	      error->all(FLERR,"Compute used in variable between runs "
-			 "is not current");
-	  } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
-	    compute->compute_peratom();
-	    compute->invoked_flag |= INVOKED_PERATOM;
-	  }
+          if (update->whichflag == 0) {
+            if (compute->invoked_peratom != update->ntimestep)
+              error->all(FLERR,"Compute used in variable between runs "
+                         "is not current");
+          } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
+            compute->compute_peratom();
+            compute->invoked_flag |= INVOKED_PERATOM;
+          }
 
-	  peratom2global(1,NULL,compute->vector_atom,1,index1,
-			 tree,treestack,ntreestack,argstack,nargstack);
+          peratom2global(1,NULL,compute->vector_atom,1,index1,
+                         tree,treestack,ntreestack,argstack,nargstack);
 
         // c_ID[i][j] = scalar from per-atom array
 
-	} else if (nbracket == 2 && compute->peratom_flag &&
-		   compute->size_peratom_cols > 0) {
-
-	  if (index2 > compute->size_peratom_cols)
-	    error->all(FLERR,"Variable formula compute array "
-		       "is accessed out-of-range");
-	  if (update->whichflag == 0) {
-	    if (compute->invoked_peratom != update->ntimestep)
-	      error->all(FLERR,"Compute used in variable between runs "
-			 "is not current");
-	  } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
-	    compute->compute_peratom();
-	    compute->invoked_flag |= INVOKED_PERATOM;
-	  }
-
-	  peratom2global(1,NULL,&compute->array_atom[0][index2-1],
-			 compute->size_peratom_cols,index1,
-			 tree,treestack,ntreestack,argstack,nargstack);
+        } else if (nbracket == 2 && compute->peratom_flag &&
+                   compute->size_peratom_cols > 0) {
+
+          if (index2 > compute->size_peratom_cols)
+            error->all(FLERR,"Variable formula compute array "
+                       "is accessed out-of-range");
+          if (update->whichflag == 0) {
+            if (compute->invoked_peratom != update->ntimestep)
+              error->all(FLERR,"Compute used in variable between runs "
+                         "is not current");
+          } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
+            compute->compute_peratom();
+            compute->invoked_flag |= INVOKED_PERATOM;
+          }
+
+          peratom2global(1,NULL,&compute->array_atom[0][index2-1],
+                         compute->size_peratom_cols,index1,
+                         tree,treestack,ntreestack,argstack,nargstack);
 
         // c_ID = vector from per-atom vector
 
-	} else if (nbracket == 0 && compute->peratom_flag && 
-		   compute->size_peratom_cols == 0) {
-
-	  if (tree == NULL)
-	    error->all(FLERR,
-		       "Per-atom compute in equal-style variable formula");
-	  if (update->whichflag == 0) {
-	    if (compute->invoked_peratom != update->ntimestep)
-	      error->all(FLERR,"Compute used in variable between runs "
-			 "is not current");
-	  } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
-	    compute->compute_peratom();
-	    compute->invoked_flag |= INVOKED_PERATOM;
-	  }
-
-	  Tree *newtree = new Tree();
-	  newtree->type = ATOMARRAY;
-	  newtree->array = compute->vector_atom;
-	  newtree->nstride = 1;
-	  newtree->left = newtree->middle = newtree->right = NULL;
-	  treestack[ntreestack++] = newtree;
+        } else if (nbracket == 0 && compute->peratom_flag &&
+                   compute->size_peratom_cols == 0) {
+
+          if (tree == NULL)
+            error->all(FLERR,
+                       "Per-atom compute in equal-style variable formula");
+          if (update->whichflag == 0) {
+            if (compute->invoked_peratom != update->ntimestep)
+              error->all(FLERR,"Compute used in variable between runs "
+                         "is not current");
+          } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
+            compute->compute_peratom();
+            compute->invoked_flag |= INVOKED_PERATOM;
+          }
+
+          Tree *newtree = new Tree();
+          newtree->type = ATOMARRAY;
+          newtree->array = compute->vector_atom;
+          newtree->nstride = 1;
+          newtree->left = newtree->middle = newtree->right = NULL;
+          treestack[ntreestack++] = newtree;
 
         // c_ID[i] = vector from per-atom array
 
-	} else if (nbracket == 1 && compute->peratom_flag &&
-		   compute->size_peratom_cols > 0) {
-
-	  if (tree == NULL)
-	    error->all(FLERR,
-		       "Per-atom compute in equal-style variable formula");
-	  if (index1 > compute->size_peratom_cols)
-	    error->all(FLERR,"Variable formula compute array "
-		       "is accessed out-of-range");
-	  if (update->whichflag == 0) {
-	    if (compute->invoked_peratom != update->ntimestep)
-	      error->all(FLERR,"Compute used in variable between runs "
-			 "is not current");
-	  } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
-	    compute->compute_peratom();
-	    compute->invoked_flag |= INVOKED_PERATOM;
-	  }
-
-	  Tree *newtree = new Tree();
-	  newtree->type = ATOMARRAY;
-	  newtree->array = &compute->array_atom[0][index1-1];
-	  newtree->nstride = compute->size_peratom_cols;
-	  newtree->left = newtree->middle = newtree->right = NULL;
-	  treestack[ntreestack++] = newtree;
-
-	} else error->all(FLERR,"Mismatched compute in variable formula");
+        } else if (nbracket == 1 && compute->peratom_flag &&
+                   compute->size_peratom_cols > 0) {
+
+          if (tree == NULL)
+            error->all(FLERR,
+                       "Per-atom compute in equal-style variable formula");
+          if (index1 > compute->size_peratom_cols)
+            error->all(FLERR,"Variable formula compute array "
+                       "is accessed out-of-range");
+          if (update->whichflag == 0) {
+            if (compute->invoked_peratom != update->ntimestep)
+              error->all(FLERR,"Compute used in variable between runs "
+                         "is not current");
+          } else if (!(compute->invoked_flag & INVOKED_PERATOM)) {
+            compute->compute_peratom();
+            compute->invoked_flag |= INVOKED_PERATOM;
+          }
+
+          Tree *newtree = new Tree();
+          newtree->type = ATOMARRAY;
+          newtree->array = &compute->array_atom[0][index1-1];
+          newtree->nstride = compute->size_peratom_cols;
+          newtree->left = newtree->middle = newtree->right = NULL;
+          treestack[ntreestack++] = newtree;
+
+        } else error->all(FLERR,"Mismatched compute in variable formula");
 
       // ----------------
       // fix
       // ----------------
 
       } else if (strncmp(word,"f_",2) == 0) {
-	if (domain->box_exist == 0)
-	  error->all(FLERR,
-		     "Variable evaluation before simulation box is defined");
- 
-	n = strlen(word) - 2 + 1;
-	char *id = new char[n];
-	strcpy(id,&word[2]);
-
-	int ifix = modify->find_fix(id);
-	if (ifix < 0) error->all(FLERR,"Invalid fix ID in variable formula");
-	Fix *fix = modify->fix[ifix];
-	delete [] id;
-
-	// parse zero or one or two trailing brackets
-	// point i beyond last bracket
-	// nbracket = # of bracket pairs
-	// index1,index2 = int inside each bracket pair
-
-	int nbracket,index1,index2;
-	if (str[i] != '[') nbracket = 0;
-	else {
-	  nbracket = 1;
-	  ptr = &str[i];
-	  index1 = int_between_brackets(ptr);
-	  i = ptr-str+1;
-	  if (str[i] == '[') {
-	    nbracket = 2;
-	    ptr = &str[i];
-	    index2 = int_between_brackets(ptr);
-	    i = ptr-str+1;
-	  }
-	}
+        if (domain->box_exist == 0)
+          error->all(FLERR,
+                     "Variable evaluation before simulation box is defined");
+
+        n = strlen(word) - 2 + 1;
+        char *id = new char[n];
+        strcpy(id,&word[2]);
+
+        int ifix = modify->find_fix(id);
+        if (ifix < 0) error->all(FLERR,"Invalid fix ID in variable formula");
+        Fix *fix = modify->fix[ifix];
+        delete [] id;
+
+        // parse zero or one or two trailing brackets
+        // point i beyond last bracket
+        // nbracket = # of bracket pairs
+        // index1,index2 = int inside each bracket pair
+
+        int nbracket,index1,index2;
+        if (str[i] != '[') nbracket = 0;
+        else {
+          nbracket = 1;
+          ptr = &str[i];
+          index1 = int_between_brackets(ptr);
+          i = ptr-str+1;
+          if (str[i] == '[') {
+            nbracket = 2;
+            ptr = &str[i];
+            index2 = int_between_brackets(ptr);
+            i = ptr-str+1;
+          }
+        }
 
         // f_ID = scalar from global scalar
 
-	if (nbracket == 0 && fix->scalar_flag) {
+        if (nbracket == 0 && fix->scalar_flag) {
 
-	  if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
-	    error->all(FLERR,"Fix in variable not computed at compatible time");
+          if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
+            error->all(FLERR,"Fix in variable not computed at compatible time");
 
-	  value1 = fix->compute_scalar();
-	  if (tree) {
-	    Tree *newtree = new Tree();
-	    newtree->type = VALUE;
-	    newtree->value = value1;
-	    newtree->left = newtree->middle = newtree->right = NULL;
-	    treestack[ntreestack++] = newtree;
-	  } else argstack[nargstack++] = value1;
+          value1 = fix->compute_scalar();
+          if (tree) {
+            Tree *newtree = new Tree();
+            newtree->type = VALUE;
+            newtree->value = value1;
+            newtree->left = newtree->middle = newtree->right = NULL;
+            treestack[ntreestack++] = newtree;
+          } else argstack[nargstack++] = value1;
 
         // f_ID[i] = scalar from global vector
 
-	} else if (nbracket == 1 && fix->vector_flag) {
+        } else if (nbracket == 1 && fix->vector_flag) {
 
-	  if (index1 > fix->size_vector)
-	    error->all(FLERR,
-		       "Variable formula fix vector is accessed out-of-range");
-	  if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
-	    error->all(FLERR,"Fix in variable not computed at compatible time");
+          if (index1 > fix->size_vector)
+            error->all(FLERR,
+                       "Variable formula fix vector is accessed out-of-range");
+          if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
+            error->all(FLERR,"Fix in variable not computed at compatible time");
 
-	  value1 = fix->compute_vector(index1-1);
-	  if (tree) {
-	    Tree *newtree = new Tree();
-	    newtree->type = VALUE;
-	    newtree->value = value1;
-	    newtree->left = newtree->middle = newtree->right = NULL;
-	    treestack[ntreestack++] = newtree;
-	  } else argstack[nargstack++] = value1;
+          value1 = fix->compute_vector(index1-1);
+          if (tree) {
+            Tree *newtree = new Tree();
+            newtree->type = VALUE;
+            newtree->value = value1;
+            newtree->left = newtree->middle = newtree->right = NULL;
+            treestack[ntreestack++] = newtree;
+          } else argstack[nargstack++] = value1;
 
         // f_ID[i][j] = scalar from global array
 
-	} else if (nbracket == 2 && fix->array_flag) {
-
-	  if (index1 > fix->size_array_rows)
-	    error->all(FLERR,
-		       "Variable formula fix array is accessed out-of-range");
-	  if (index2 > fix->size_array_cols)
-	    error->all(FLERR,
-		       "Variable formula fix array is accessed out-of-range");
-	  if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
-	    error->all(FLERR,"Fix in variable not computed at compatible time");
-
-	  value1 = fix->compute_array(index1-1,index2-1);
-	  if (tree) {
-	    Tree *newtree = new Tree();
-	    newtree->type = VALUE;
-	    newtree->value = value1;
-	    newtree->left = newtree->middle = newtree->right = NULL;
-	    treestack[ntreestack++] = newtree;
-	  } else argstack[nargstack++] = value1;
+        } else if (nbracket == 2 && fix->array_flag) {
+
+          if (index1 > fix->size_array_rows)
+            error->all(FLERR,
+                       "Variable formula fix array is accessed out-of-range");
+          if (index2 > fix->size_array_cols)
+            error->all(FLERR,
+                       "Variable formula fix array is accessed out-of-range");
+          if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
+            error->all(FLERR,"Fix in variable not computed at compatible time");
+
+          value1 = fix->compute_array(index1-1,index2-1);
+          if (tree) {
+            Tree *newtree = new Tree();
+            newtree->type = VALUE;
+            newtree->value = value1;
+            newtree->left = newtree->middle = newtree->right = NULL;
+            treestack[ntreestack++] = newtree;
+          } else argstack[nargstack++] = value1;
 
         // f_ID[i] = scalar from per-atom vector
 
-	} else if (nbracket == 1 && fix->peratom_flag && 
-		   fix->size_peratom_cols == 0) {
+        } else if (nbracket == 1 && fix->peratom_flag &&
+                   fix->size_peratom_cols == 0) {
 
-	  if (update->whichflag > 0 && 
-	      update->ntimestep % fix->peratom_freq)
-	    error->all(FLERR,
-		       "Fix in variable not computed at compatible time");
+          if (update->whichflag > 0 &&
+              update->ntimestep % fix->peratom_freq)
+            error->all(FLERR,
+                       "Fix in variable not computed at compatible time");
 
-	  peratom2global(1,NULL,fix->vector_atom,1,index1,
-			 tree,treestack,ntreestack,argstack,nargstack);
+          peratom2global(1,NULL,fix->vector_atom,1,index1,
+                         tree,treestack,ntreestack,argstack,nargstack);
 
         // f_ID[i][j] = scalar from per-atom array
 
-	} else if (nbracket == 2 && fix->peratom_flag &&
-		   fix->size_peratom_cols > 0) {
+        } else if (nbracket == 2 && fix->peratom_flag &&
+                   fix->size_peratom_cols > 0) {
 
-	  if (index2 > fix->size_peratom_cols)
-	    error->all(FLERR,
-		       "Variable formula fix array is accessed out-of-range");
-	  if (update->whichflag > 0 && 
-	      update->ntimestep % fix->peratom_freq)
-	    error->all(FLERR,"Fix in variable not computed at compatible time");
+          if (index2 > fix->size_peratom_cols)
+            error->all(FLERR,
+                       "Variable formula fix array is accessed out-of-range");
+          if (update->whichflag > 0 &&
+              update->ntimestep % fix->peratom_freq)
+            error->all(FLERR,"Fix in variable not computed at compatible time");
 
-	  peratom2global(1,NULL,&fix->array_atom[0][index2-1],
-			 fix->size_peratom_cols,index1,
-			 tree,treestack,ntreestack,argstack,nargstack);
+          peratom2global(1,NULL,&fix->array_atom[0][index2-1],
+                         fix->size_peratom_cols,index1,
+                         tree,treestack,ntreestack,argstack,nargstack);
 
         // f_ID = vector from per-atom vector
 
-	} else if (nbracket == 0 && fix->peratom_flag && 
-		   fix->size_peratom_cols == 0) {
+        } else if (nbracket == 0 && fix->peratom_flag &&
+                   fix->size_peratom_cols == 0) {
 
-	  if (tree == NULL)
-	    error->all(FLERR,"Per-atom fix in equal-style variable formula");
-	  if (update->whichflag > 0 && 
-	      update->ntimestep % fix->peratom_freq)
-	    error->all(FLERR,"Fix in variable not computed at compatible time");
+          if (tree == NULL)
+            error->all(FLERR,"Per-atom fix in equal-style variable formula");
+          if (update->whichflag > 0 &&
+              update->ntimestep % fix->peratom_freq)
+            error->all(FLERR,"Fix in variable not computed at compatible time");
 
-	  Tree *newtree = new Tree();
-	  newtree->type = ATOMARRAY;
-	  newtree->array = fix->vector_atom;
-	  newtree->nstride = 1;
-	  newtree->left = newtree->middle = newtree->right = NULL;
-	  treestack[ntreestack++] = newtree;
+          Tree *newtree = new Tree();
+          newtree->type = ATOMARRAY;
+          newtree->array = fix->vector_atom;
+          newtree->nstride = 1;
+          newtree->left = newtree->middle = newtree->right = NULL;
+          treestack[ntreestack++] = newtree;
 
         // f_ID[i] = vector from per-atom array
 
-	} else if (nbracket == 1 && fix->peratom_flag &&
-		   fix->size_peratom_cols > 0) {
+        } else if (nbracket == 1 && fix->peratom_flag &&
+                   fix->size_peratom_cols > 0) {
 
-	  if (tree == NULL)
-	    error->all(FLERR,"Per-atom fix in equal-style variable formula");
-	  if (index1 > fix->size_peratom_cols)
-	    error->all(FLERR,
-		       "Variable formula fix array is accessed out-of-range");
-	  if (update->whichflag > 0 && 
-	      update->ntimestep % fix->peratom_freq)
-	    error->all(FLERR,"Fix in variable not computed at compatible time");
+          if (tree == NULL)
+            error->all(FLERR,"Per-atom fix in equal-style variable formula");
+          if (index1 > fix->size_peratom_cols)
+            error->all(FLERR,
+                       "Variable formula fix array is accessed out-of-range");
+          if (update->whichflag > 0 &&
+              update->ntimestep % fix->peratom_freq)
+            error->all(FLERR,"Fix in variable not computed at compatible time");
 
-	  Tree *newtree = new Tree();
-	  newtree->type = ATOMARRAY;
-	  newtree->array = &fix->array_atom[0][index1-1];
-	  newtree->nstride = fix->size_peratom_cols;
-	  newtree->left = newtree->middle = newtree->right = NULL;
-	  treestack[ntreestack++] = newtree;
+          Tree *newtree = new Tree();
+          newtree->type = ATOMARRAY;
+          newtree->array = &fix->array_atom[0][index1-1];
+          newtree->nstride = fix->size_peratom_cols;
+          newtree->left = newtree->middle = newtree->right = NULL;
+          treestack[ntreestack++] = newtree;
 
-	} else error->all(FLERR,"Mismatched fix in variable formula");
+        } else error->all(FLERR,"Mismatched fix in variable formula");
 
       // ----------------
       // variable
       // ----------------
 
       } else if (strncmp(word,"v_",2) == 0) {
-	n = strlen(word) - 2 + 1;
-	char *id = new char[n];
-	strcpy(id,&word[2]);
-
-	int ivar = find(id);
-	if (ivar < 0) 
-	  error->all(FLERR,"Invalid variable name in variable formula");
-
-	// parse zero or one trailing brackets
-	// point i beyond last bracket
-	// nbracket = # of bracket pairs
-	// index = int inside bracket
-
-	int nbracket,index;
-	if (str[i] != '[') nbracket = 0;
-	else {
-	  nbracket = 1;
-	  ptr = &str[i];
-	  index = int_between_brackets(ptr);
-	  i = ptr-str+1;
-	}
+        n = strlen(word) - 2 + 1;
+        char *id = new char[n];
+        strcpy(id,&word[2]);
+
+        int ivar = find(id);
+        if (ivar < 0)
+          error->all(FLERR,"Invalid variable name in variable formula");
+
+        // parse zero or one trailing brackets
+        // point i beyond last bracket
+        // nbracket = # of bracket pairs
+        // index = int inside bracket
+
+        int nbracket,index;
+        if (str[i] != '[') nbracket = 0;
+        else {
+          nbracket = 1;
+          ptr = &str[i];
+          index = int_between_brackets(ptr);
+          i = ptr-str+1;
+        }
 
         // v_name = scalar from non atom-style global scalar
 
-	if (nbracket == 0 && style[ivar] != ATOM) {
+        if (nbracket == 0 && style[ivar] != ATOM) {
 
-	  char *var = retrieve(id);
-	  if (var == NULL)
-	    error->all(FLERR,"Invalid variable evaluation in variable formula");
-	  if (tree) {
-	    Tree *newtree = new Tree();
-	    newtree->type = VALUE;
-	    newtree->value = atof(var);
-	    newtree->left = newtree->middle = newtree->right = NULL;
-	    treestack[ntreestack++] = newtree;
-	  } else argstack[nargstack++] = atof(var);
+          char *var = retrieve(id);
+          if (var == NULL)
+            error->all(FLERR,"Invalid variable evaluation in variable formula");
+          if (tree) {
+            Tree *newtree = new Tree();
+            newtree->type = VALUE;
+            newtree->value = atof(var);
+            newtree->left = newtree->middle = newtree->right = NULL;
+            treestack[ntreestack++] = newtree;
+          } else argstack[nargstack++] = atof(var);
 
         // v_name = vector from atom-style per-atom vector
 
-	} else if (nbracket == 0 && style[ivar] == ATOM) {
+        } else if (nbracket == 0 && style[ivar] == ATOM) {
 
-	  if (tree == NULL)
-	    error->all(FLERR,
-		       "Atom-style variable in equal-style variable formula");
-	  Tree *newtree;
-	  evaluate(data[ivar][0],&newtree);
-	  treestack[ntreestack++] = newtree;
+          if (tree == NULL)
+            error->all(FLERR,
+                       "Atom-style variable in equal-style variable formula");
+          Tree *newtree;
+          evaluate(data[ivar][0],&newtree);
+          treestack[ntreestack++] = newtree;
 
         // v_name[N] = scalar from atom-style per-atom vector
-	// compute the per-atom variable in result
-	// use peratom2global to extract single value from result
+        // compute the per-atom variable in result
+        // use peratom2global to extract single value from result
 
-	} else if (nbracket && style[ivar] == ATOM) {
+        } else if (nbracket && style[ivar] == ATOM) {
 
-	  double *result;
-	  memory->create(result,atom->nlocal,"variable:result");
-	  compute_atom(ivar,0,result,1,0);
-	  peratom2global(1,NULL,result,1,index,
-			 tree,treestack,ntreestack,argstack,nargstack);
-	  memory->destroy(result);
+          double *result;
+          memory->create(result,atom->nlocal,"variable:result");
+          compute_atom(ivar,0,result,1,0);
+          peratom2global(1,NULL,result,1,index,
+                         tree,treestack,ntreestack,argstack,nargstack);
+          memory->destroy(result);
 
-	} else error->all(FLERR,"Mismatched variable in variable formula");
+        } else error->all(FLERR,"Mismatched variable in variable formula");
 
-	delete [] id;
+        delete [] id;
 
       // ----------------
       // math/group/special function or atom value/vector or
@@ -1169,86 +1169,86 @@ double Variable::evaluate(char *str, Tree **tree)
 
       } else {
 
-	// ----------------
-	// math or group or special function
-	// ----------------
-
-	if (str[i] == '(') {
-	  char *contents;
-	  i = find_matching_paren(str,i,contents);
-	  i++;
-
-	  if (math_function(word,contents,tree,
-			    treestack,ntreestack,argstack,nargstack));
-	  else if (group_function(word,contents,tree,
-				  treestack,ntreestack,argstack,nargstack));
-	  else if (special_function(word,contents,tree,
-				    treestack,ntreestack,argstack,nargstack));
-	  else error->all(FLERR,"Invalid math/group/special function "
-			  "in variable formula");
-	  delete [] contents;
-
-	// ----------------
-	// atom value
-	// ----------------
-
-	} else if (str[i] == '[') {
-	  if (domain->box_exist == 0)
-	    error->all(FLERR,
-		       "Variable evaluation before simulation box is defined");
-
-	  ptr = &str[i];
-	  int id = int_between_brackets(ptr);
-	  i = ptr-str+1;
- 
-	  peratom2global(0,word,NULL,0,id,
-			 tree,treestack,ntreestack,argstack,nargstack);
-
-	// ----------------
-	// atom vector
-	// ----------------
-
-	} else if (is_atom_vector(word)) {
-	  if (domain->box_exist == 0)
-	    error->all(FLERR,
-		       "Variable evaluation before simulation box is defined");
-
-	  atom_vector(word,tree,treestack,ntreestack);
-
-	// ----------------
-	// constant
-	// ----------------
-
-	} else if (is_constant(word)) {
-	  value1 = constant(word);
-	  if (tree) {
-	    Tree *newtree = new Tree();
-	    newtree->type = VALUE;
-	    newtree->value = value1;
-	    newtree->left = newtree->middle = newtree->right = NULL;
-	    treestack[ntreestack++] = newtree;
-	  } else argstack[nargstack++] = value1;
-
-	// ----------------
-	// thermo keyword
-	// ----------------
-
-	} else {
-	  if (domain->box_exist == 0)
-	    error->all(FLERR,
-		       "Variable evaluation before simulation box is defined");
- 
-	  int flag = output->thermo->evaluate_keyword(word,&value1);
-	  if (flag) 
-	    error->all(FLERR,"Invalid thermo keyword in variable formula");
-	  if (tree) {
-	    Tree *newtree = new Tree();
-	    newtree->type = VALUE;
-	    newtree->value = value1;
-	    newtree->left = newtree->middle = newtree->right = NULL;
-	    treestack[ntreestack++] = newtree;
-	  } else argstack[nargstack++] = value1;
-	}
+        // ----------------
+        // math or group or special function
+        // ----------------
+
+        if (str[i] == '(') {
+          char *contents;
+          i = find_matching_paren(str,i,contents);
+          i++;
+
+          if (math_function(word,contents,tree,
+                            treestack,ntreestack,argstack,nargstack));
+          else if (group_function(word,contents,tree,
+                                  treestack,ntreestack,argstack,nargstack));
+          else if (special_function(word,contents,tree,
+                                    treestack,ntreestack,argstack,nargstack));
+          else error->all(FLERR,"Invalid math/group/special function "
+                          "in variable formula");
+          delete [] contents;
+
+        // ----------------
+        // atom value
+        // ----------------
+
+        } else if (str[i] == '[') {
+          if (domain->box_exist == 0)
+            error->all(FLERR,
+                       "Variable evaluation before simulation box is defined");
+
+          ptr = &str[i];
+          int id = int_between_brackets(ptr);
+          i = ptr-str+1;
+
+          peratom2global(0,word,NULL,0,id,
+                         tree,treestack,ntreestack,argstack,nargstack);
+
+        // ----------------
+        // atom vector
+        // ----------------
+
+        } else if (is_atom_vector(word)) {
+          if (domain->box_exist == 0)
+            error->all(FLERR,
+                       "Variable evaluation before simulation box is defined");
+
+          atom_vector(word,tree,treestack,ntreestack);
+
+        // ----------------
+        // constant
+        // ----------------
+
+        } else if (is_constant(word)) {
+          value1 = constant(word);
+          if (tree) {
+            Tree *newtree = new Tree();
+            newtree->type = VALUE;
+            newtree->value = value1;
+            newtree->left = newtree->middle = newtree->right = NULL;
+            treestack[ntreestack++] = newtree;
+          } else argstack[nargstack++] = value1;
+
+        // ----------------
+        // thermo keyword
+        // ----------------
+
+        } else {
+          if (domain->box_exist == 0)
+            error->all(FLERR,
+                       "Variable evaluation before simulation box is defined");
+
+          int flag = output->thermo->evaluate_keyword(word,&value1);
+          if (flag)
+            error->all(FLERR,"Invalid thermo keyword in variable formula");
+          if (tree) {
+            Tree *newtree = new Tree();
+            newtree->type = VALUE;
+            newtree->value = value1;
+            newtree->left = newtree->middle = newtree->right = NULL;
+            treestack[ntreestack++] = newtree;
+          } else argstack[nargstack++] = value1;
+        }
       }
 
       delete [] word;
@@ -1264,48 +1264,48 @@ double Variable::evaluate(char *str, Tree **tree)
       else if (onechar == '/') op = DIVIDE;
       else if (onechar == '^') op = CARAT;
       else if (onechar == '=') {
-	if (str[i+1] != '=') 
-	  error->all(FLERR,"Invalid syntax in variable formula");
-	op = EQ;
-	i++;
+        if (str[i+1] != '=')
+          error->all(FLERR,"Invalid syntax in variable formula");
+        op = EQ;
+        i++;
       } else if (onechar == '!') {
-	if (str[i+1] == '=') {
-	  op = NE;
-	  i++;
-	} else op = NOT;
+        if (str[i+1] == '=') {
+          op = NE;
+          i++;
+        } else op = NOT;
       } else if (onechar == '<') {
-	if (str[i+1] != '=') op = LT;
-	else {
-	  op = LE;
-	  i++;
-	}
+        if (str[i+1] != '=') op = LT;
+        else {
+          op = LE;
+          i++;
+        }
       } else if (onechar == '>') {
-	if (str[i+1] != '=') op = GT;
-	else {
-	  op = GE;
-	  i++;
-	}
+        if (str[i+1] != '=') op = GT;
+        else {
+          op = GE;
+          i++;
+        }
       } else if (onechar == '&') {
-	if (str[i+1] != '&') 
-	  error->all(FLERR,"Invalid syntax in variable formula");
-	op = AND;
-	i++;
+        if (str[i+1] != '&')
+          error->all(FLERR,"Invalid syntax in variable formula");
+        op = AND;
+        i++;
       } else if (onechar == '|') {
-	if (str[i+1] != '|') 
-	  error->all(FLERR,"Invalid syntax in variable formula");
-	op = OR;
-	i++;
+        if (str[i+1] != '|')
+          error->all(FLERR,"Invalid syntax in variable formula");
+        op = OR;
+        i++;
       } else op = DONE;
 
       i++;
 
       if (op == SUBTRACT && expect == ARG) {
-	opstack[nopstack++] = UNARY;
-	continue;
+        opstack[nopstack++] = UNARY;
+        continue;
       }
       if (op == NOT && expect == ARG) {
-	opstack[nopstack++] = op;
-	continue;
+        opstack[nopstack++] = op;
+        continue;
       }
 
       if (expect == ARG) error->all(FLERR,"Invalid syntax in variable formula");
@@ -1315,71 +1315,71 @@ double Variable::evaluate(char *str, Tree **tree)
       // before pushing current op onto stack
 
       while (nopstack && precedence[opstack[nopstack-1]] >= precedence[op]) {
-	opprevious = opstack[--nopstack];
-
-	if (tree) {
-	  Tree *newtree = new Tree();
-	  newtree->type = opprevious;
-	  if (opprevious == UNARY) {
-	    newtree->left = treestack[--ntreestack];
-	    newtree->middle = newtree->right = NULL;
-	  } else {
-	    newtree->right = treestack[--ntreestack];
-	    newtree->middle = NULL;
-	    newtree->left = treestack[--ntreestack];
-	  }
-	  treestack[ntreestack++] = newtree;
-
-	} else {
-	  value2 = argstack[--nargstack];
-	  if (opprevious != UNARY && opprevious != NOT)
-	    value1 = argstack[--nargstack];
-
-	  if (opprevious == ADD)
-	    argstack[nargstack++] = value1 + value2;
-	  else if (opprevious == SUBTRACT)
-	    argstack[nargstack++] = value1 - value2;
-	  else if (opprevious == MULTIPLY)
-	    argstack[nargstack++] = value1 * value2;
-	  else if (opprevious == DIVIDE) {
-	    if (value2 == 0.0) 
-	      error->all(FLERR,"Divide by 0 in variable formula");
-	    argstack[nargstack++] = value1 / value2;
-	  } else if (opprevious == CARAT) {
-	    if (value2 == 0.0) 
-	      error->all(FLERR,"Power by 0 in variable formula");
-	    argstack[nargstack++] = pow(value1,value2);
-	  } else if (opprevious == UNARY) {
-	    argstack[nargstack++] = -value2;
-	  } else if (opprevious == NOT) {
-	    if (value2 == 0.0) argstack[nargstack++] = 1.0;
-	    else argstack[nargstack++] = 0.0;
-	  } else if (opprevious == EQ) {
-	    if (value1 == value2) argstack[nargstack++] = 1.0;
-	    else argstack[nargstack++] = 0.0;
-	  } else if (opprevious == NE) {
-	    if (value1 != value2) argstack[nargstack++] = 1.0;
-	    else argstack[nargstack++] = 0.0;
-	  } else if (opprevious == LT) {
-	    if (value1 < value2) argstack[nargstack++] = 1.0;
-	    else argstack[nargstack++] = 0.0;
-	  } else if (opprevious == LE) {
-	    if (value1 <= value2) argstack[nargstack++] = 1.0;
-	    else argstack[nargstack++] = 0.0;
-	  } else if (opprevious == GT) {
-	    if (value1 > value2) argstack[nargstack++] = 1.0;
-	    else argstack[nargstack++] = 0.0;
-	  } else if (opprevious == GE) {
-	    if (value1 >= value2) argstack[nargstack++] = 1.0;
-	    else argstack[nargstack++] = 0.0;
-	  } else if (opprevious == AND) {
-	    if (value1 != 0.0 && value2 != 0.0) argstack[nargstack++] = 1.0;
-	    else argstack[nargstack++] = 0.0;
-	  } else if (opprevious == OR) {
-	    if (value1 != 0.0 || value2 != 0.0) argstack[nargstack++] = 1.0;
-	    else argstack[nargstack++] = 0.0;
-	  }
-	}
+        opprevious = opstack[--nopstack];
+
+        if (tree) {
+          Tree *newtree = new Tree();
+          newtree->type = opprevious;
+          if (opprevious == UNARY) {
+            newtree->left = treestack[--ntreestack];
+            newtree->middle = newtree->right = NULL;
+          } else {
+            newtree->right = treestack[--ntreestack];
+            newtree->middle = NULL;
+            newtree->left = treestack[--ntreestack];
+          }
+          treestack[ntreestack++] = newtree;
+
+        } else {
+          value2 = argstack[--nargstack];
+          if (opprevious != UNARY && opprevious != NOT)
+            value1 = argstack[--nargstack];
+
+          if (opprevious == ADD)
+            argstack[nargstack++] = value1 + value2;
+          else if (opprevious == SUBTRACT)
+            argstack[nargstack++] = value1 - value2;
+          else if (opprevious == MULTIPLY)
+            argstack[nargstack++] = value1 * value2;
+          else if (opprevious == DIVIDE) {
+            if (value2 == 0.0)
+              error->all(FLERR,"Divide by 0 in variable formula");
+            argstack[nargstack++] = value1 / value2;
+          } else if (opprevious == CARAT) {
+            if (value2 == 0.0)
+              error->all(FLERR,"Power by 0 in variable formula");
+            argstack[nargstack++] = pow(value1,value2);
+          } else if (opprevious == UNARY) {
+            argstack[nargstack++] = -value2;
+          } else if (opprevious == NOT) {
+            if (value2 == 0.0) argstack[nargstack++] = 1.0;
+            else argstack[nargstack++] = 0.0;
+          } else if (opprevious == EQ) {
+            if (value1 == value2) argstack[nargstack++] = 1.0;
+            else argstack[nargstack++] = 0.0;
+          } else if (opprevious == NE) {
+            if (value1 != value2) argstack[nargstack++] = 1.0;
+            else argstack[nargstack++] = 0.0;
+          } else if (opprevious == LT) {
+            if (value1 < value2) argstack[nargstack++] = 1.0;
+            else argstack[nargstack++] = 0.0;
+          } else if (opprevious == LE) {
+            if (value1 <= value2) argstack[nargstack++] = 1.0;
+            else argstack[nargstack++] = 0.0;
+          } else if (opprevious == GT) {
+            if (value1 > value2) argstack[nargstack++] = 1.0;
+            else argstack[nargstack++] = 0.0;
+          } else if (opprevious == GE) {
+            if (value1 >= value2) argstack[nargstack++] = 1.0;
+            else argstack[nargstack++] = 0.0;
+          } else if (opprevious == AND) {
+            if (value1 != 0.0 && value2 != 0.0) argstack[nargstack++] = 1.0;
+            else argstack[nargstack++] = 0.0;
+          } else if (opprevious == OR) {
+            if (value1 != 0.0 || value2 != 0.0) argstack[nargstack++] = 1.0;
+            else argstack[nargstack++] = 0.0;
+          }
+        }
       }
 
       // if end-of-string, break out of entire formula evaluation loop
@@ -1579,7 +1579,7 @@ double Variable::collapse_tree(Tree *tree)
     arg1 = collapse_tree(tree->left);
     if (tree->left->type != VALUE) return 0.0;
     tree->type = VALUE;
-    if (arg1 < 0.0) 
+    if (arg1 < 0.0)
       error->one(FLERR,"Sqrt of negative value in variable formula");
     tree->value = sqrt(arg1);
     return tree->value;
@@ -1597,7 +1597,7 @@ double Variable::collapse_tree(Tree *tree)
     arg1 = collapse_tree(tree->left);
     if (tree->left->type != VALUE) return 0.0;
     tree->type = VALUE;
-    if (arg1 <= 0.0) 
+    if (arg1 <= 0.0)
       error->one(FLERR,"Log of zero/negative value in variable formula");
     tree->value = log(arg1);
     return tree->value;
@@ -1607,7 +1607,7 @@ double Variable::collapse_tree(Tree *tree)
     arg1 = collapse_tree(tree->left);
     if (tree->left->type != VALUE) return 0.0;
     tree->type = VALUE;
-    if (arg1 <= 0.0) 
+    if (arg1 <= 0.0)
       error->one(FLERR,"Log of zero/negative value in variable formula");
     tree->value = log10(arg1);
     return tree->value;
@@ -1681,8 +1681,8 @@ double Variable::collapse_tree(Tree *tree)
     collapse_tree(tree->middle);
     if (randomatom == NULL) {
       int seed = static_cast<int> (collapse_tree(tree->right));
-      if (seed <= 0) 
-	error->one(FLERR,"Invalid math function in variable formula");
+      if (seed <= 0)
+        error->one(FLERR,"Invalid math function in variable formula");
       randomatom = new RanMars(lmp,seed+me);
     }
     return 0.0;
@@ -1691,12 +1691,12 @@ double Variable::collapse_tree(Tree *tree)
   if (tree->type == NORMAL) {
     collapse_tree(tree->left);
     double sigma = collapse_tree(tree->middle);
-    if (sigma < 0.0) 
+    if (sigma < 0.0)
       error->one(FLERR,"Invalid math function in variable formula");
     if (randomatom == NULL) {
       int seed = static_cast<int> (collapse_tree(tree->right));
-      if (seed <= 0) 
-	error->one(FLERR,"Invalid math function in variable formula");
+      if (seed <= 0)
+        error->one(FLERR,"Invalid math function in variable formula");
       randomatom = new RanMars(lmp,seed+me);
     }
     return 0.0;
@@ -1756,7 +1756,7 @@ double Variable::collapse_tree(Tree *tree)
     int ivalue2 = static_cast<int> (collapse_tree(tree->middle));
     int ivalue3 = static_cast<int> (collapse_tree(tree->right));
     if (tree->left->type != VALUE || tree->middle->type != VALUE ||
-	tree->right->type != VALUE) return 0.0;
+        tree->right->type != VALUE) return 0.0;
     tree->type = VALUE;
     if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3)
       error->one(FLERR,"Invalid math function in variable formula");
@@ -1776,7 +1776,7 @@ double Variable::collapse_tree(Tree *tree)
     int ivalue2 = static_cast<int> (collapse_tree(tree->middle));
     int ivalue3 = static_cast<int> (collapse_tree(tree->right));
     if (tree->left->type != VALUE || tree->middle->type != VALUE ||
-	tree->right->type != VALUE) return 0.0;
+        tree->right->type != VALUE) return 0.0;
     tree->type = VALUE;
     if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2)
       error->one(FLERR,"Invalid math function in variable formula");
@@ -1804,9 +1804,9 @@ double Variable::collapse_tree(Tree *tree)
     double arg2 = collapse_tree(tree->middle);
     double arg3 = collapse_tree(tree->right);
     if (tree->left->type != VALUE || tree->middle->type != VALUE ||
-	tree->right->type != VALUE) return 0.0;
+        tree->right->type != VALUE) return 0.0;
     tree->type = VALUE;
-    if (arg3 == 0.0) 
+    if (arg3 == 0.0)
       error->one(FLERR,"Invalid math function in variable formula");
     double delta = update->ntimestep - update->beginstep;
     double omega = 2.0*MY_PI/arg3;
@@ -1819,9 +1819,9 @@ double Variable::collapse_tree(Tree *tree)
     double arg2 = collapse_tree(tree->middle);
     double arg3 = collapse_tree(tree->right);
     if (tree->left->type != VALUE || tree->middle->type != VALUE ||
-	tree->right->type != VALUE) return 0.0;
+        tree->right->type != VALUE) return 0.0;
     tree->type = VALUE;
-    if (arg3 == 0.0) 
+    if (arg3 == 0.0)
       error->one(FLERR,"Invalid math function in variable formula");
     double delta = update->ntimestep - update->beginstep;
     double omega = 2.0*MY_PI/arg3;
@@ -1917,7 +1917,7 @@ double Variable::eval_tree(Tree *tree, int i)
 
   if (tree->type == SQRT) {
     arg1 = eval_tree(tree->left,i);
-    if (arg1 < 0.0) 
+    if (arg1 < 0.0)
       error->one(FLERR,"Sqrt of negative value in variable formula");
     return sqrt(arg1);
   }
@@ -1925,13 +1925,13 @@ double Variable::eval_tree(Tree *tree, int i)
     return exp(eval_tree(tree->left,i));
   if (tree->type == LN) {
     arg1 = eval_tree(tree->left,i);
-    if (arg1 <= 0.0) 
+    if (arg1 <= 0.0)
       error->one(FLERR,"Log of zero/negative value in variable formula");
     return log(arg1);
   }
   if (tree->type == LOG) {
     arg1 = eval_tree(tree->left,i);
-    if (arg1 <= 0.0) 
+    if (arg1 <= 0.0)
       error->one(FLERR,"Log of zero/negative value in variable formula");
     return log10(arg1);
   }
@@ -1965,8 +1965,8 @@ double Variable::eval_tree(Tree *tree, int i)
     double upper = eval_tree(tree->middle,i);
     if (randomatom == NULL) {
       int seed = static_cast<int> (eval_tree(tree->right,i));
-      if (seed <= 0) 
-	error->one(FLERR,"Invalid math function in variable formula");
+      if (seed <= 0)
+        error->one(FLERR,"Invalid math function in variable formula");
       randomatom = new RanMars(lmp,seed+me);
     }
     return randomatom->uniform()*(upper-lower)+lower;
@@ -1974,12 +1974,12 @@ double Variable::eval_tree(Tree *tree, int i)
   if (tree->type == NORMAL) {
     double mu = eval_tree(tree->left,i);
     double sigma = eval_tree(tree->middle,i);
-    if (sigma < 0.0) 
+    if (sigma < 0.0)
       error->one(FLERR,"Invalid math function in variable formula");
     if (randomatom == NULL) {
       int seed = static_cast<int> (eval_tree(tree->right,i));
       if (seed <= 0)
-	error->one(FLERR,"Invalid math function in variable formula");
+        error->one(FLERR,"Invalid math function in variable formula");
       randomatom = new RanMars(lmp,seed+me);
     }
     return mu + sigma*randomatom->gaussian();
@@ -2057,7 +2057,7 @@ double Variable::eval_tree(Tree *tree, int i)
     arg1 = eval_tree(tree->left,i);
     arg2 = eval_tree(tree->middle,i);
     arg3 = eval_tree(tree->right,i);
-    if (arg3 == 0.0) 
+    if (arg3 == 0.0)
       error->one(FLERR,"Invalid math function in variable formula");
     double delta = update->ntimestep - update->beginstep;
     double omega = 2.0*MY_PI/arg3;
@@ -2069,7 +2069,7 @@ double Variable::eval_tree(Tree *tree, int i)
     arg1 = eval_tree(tree->left,i);
     arg2 = eval_tree(tree->middle,i);
     arg3 = eval_tree(tree->right,i);
-    if (arg3 == 0.0) 
+    if (arg3 == 0.0)
       error->one(FLERR,"Invalid math function in variable formula");
     double delta = update->ntimestep - update->beginstep;
     double omega = 2.0*MY_PI/arg3;
@@ -2084,16 +2084,16 @@ double Variable::eval_tree(Tree *tree, int i)
 
   if (tree->type == RMASK) {
     if (domain->regions[tree->ivalue1]->inside(atom->x[i][0],
-					       atom->x[i][1],
-					       atom->x[i][2])) return 1.0;
+                                               atom->x[i][1],
+                                               atom->x[i][2])) return 1.0;
     else return 0.0;
   }
 
   if (tree->type == GRMASK) {
     if ((atom->mask[i] & tree->ivalue1) &&
-	(domain->regions[tree->ivalue2]->inside(atom->x[i][0],
-						atom->x[i][1],
-						atom->x[i][2]))) return 1.0;
+        (domain->regions[tree->ivalue2]->inside(atom->x[i][0],
+                                                atom->x[i][1],
+                                                atom->x[i][2]))) return 1.0;
     else return 0.0;
   }
 
@@ -2153,7 +2153,7 @@ int Variable::int_between_brackets(char *&ptr)
   char *start = ++ptr;
 
   while (*ptr && *ptr != ']') {
-    if (!isdigit(*ptr)) 
+    if (!isdigit(*ptr))
       error->all(FLERR,"Non digit character between brackets in variable");
     ptr++;
   }
@@ -2165,7 +2165,7 @@ int Variable::int_between_brackets(char *&ptr)
   int index = atoi(start);
   *ptr = ']';
 
-  if (index == 0) 
+  if (index == 0)
     error->all(FLERR,"Index between variable brackets must be positive");
   return index;
 }
@@ -2184,21 +2184,21 @@ int Variable::int_between_brackets(char *&ptr)
 ------------------------------------------------------------------------- */
 
 int Variable::math_function(char *word, char *contents, Tree **tree,
-			    Tree **treestack, int &ntreestack,
-			    double *argstack, int &nargstack)
+                            Tree **treestack, int &ntreestack,
+                            double *argstack, int &nargstack)
 {
   // word not a match to any math function
 
-  if (strcmp(word,"sqrt") && strcmp(word,"exp") && 
+  if (strcmp(word,"sqrt") && strcmp(word,"exp") &&
       strcmp(word,"ln") && strcmp(word,"log") &&
       strcmp(word,"sin") && strcmp(word,"cos") &&
       strcmp(word,"tan") && strcmp(word,"asin") &&
-      strcmp(word,"acos") && strcmp(word,"atan") && 
-      strcmp(word,"atan2") && strcmp(word,"random") && 
-      strcmp(word,"normal") && strcmp(word,"ceil") && 
+      strcmp(word,"acos") && strcmp(word,"atan") &&
+      strcmp(word,"atan2") && strcmp(word,"random") &&
+      strcmp(word,"normal") && strcmp(word,"ceil") &&
       strcmp(word,"floor") && strcmp(word,"round") &&
       strcmp(word,"ramp") && strcmp(word,"stagger") &&
-      strcmp(word,"logfreq") && strcmp(word,"stride") && 
+      strcmp(word,"logfreq") && strcmp(word,"stride") &&
       strcmp(word,"vdisplace") &&
       strcmp(word,"swiggle") && strcmp(word,"cwiggle"))
     return 0;
@@ -2234,7 +2234,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
   } else arg3 = NULL;
 
   // evaluate args
-    
+
   Tree *newtree;
   double tmp,value1,value2,value3;
 
@@ -2272,135 +2272,135 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
       value3 = evaluate(arg3,NULL);
     }
   }
-    
+
   if (strcmp(word,"sqrt") == 0) {
     if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = SQRT;
     else {
-      if (value1 < 0.0) 
-	error->all(FLERR,"Sqrt of negative value in variable formula");
+      if (value1 < 0.0)
+        error->all(FLERR,"Sqrt of negative value in variable formula");
       argstack[nargstack++] = sqrt(value1);
     }
 
   } else if (strcmp(word,"exp") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = EXP;
     else argstack[nargstack++] = exp(value1);
   } else if (strcmp(word,"ln") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = LN;
     else {
-      if (value1 <= 0.0) 
-	error->all(FLERR,"Log of zero/negative value in variable formula");
+      if (value1 <= 0.0)
+        error->all(FLERR,"Log of zero/negative value in variable formula");
       argstack[nargstack++] = log(value1);
     }
   } else if (strcmp(word,"log") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = LOG;
     else {
-      if (value1 <= 0.0) 
-	error->all(FLERR,"Log of zero/negative value in variable formula");
+      if (value1 <= 0.0)
+        error->all(FLERR,"Log of zero/negative value in variable formula");
       argstack[nargstack++] = log10(value1);
     }
 
   } else if (strcmp(word,"sin") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = SIN;
     else argstack[nargstack++] = sin(value1);
   } else if (strcmp(word,"cos") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = COS;
     else argstack[nargstack++] = cos(value1);
   } else if (strcmp(word,"tan") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = TAN;
     else argstack[nargstack++] = tan(value1);
 
   } else if (strcmp(word,"asin") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = ASIN;
     else {
-      if (value1 < -1.0 || value1 > 1.0) 
-	error->all(FLERR,"Arcsin of invalid value in variable formula");
+      if (value1 < -1.0 || value1 > 1.0)
+        error->all(FLERR,"Arcsin of invalid value in variable formula");
       argstack[nargstack++] = asin(value1);
     }
   } else if (strcmp(word,"acos") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = ACOS;
     else {
-      if (value1 < -1.0 || value1 > 1.0) 
-	error->all(FLERR,"Arccos of invalid value in variable formula");
+      if (value1 < -1.0 || value1 > 1.0)
+        error->all(FLERR,"Arccos of invalid value in variable formula");
       argstack[nargstack++] = acos(value1);
     }
   } else if (strcmp(word,"atan") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = ATAN;
     else argstack[nargstack++] = atan(value1);
   } else if (strcmp(word,"atan2") == 0) {
-    if (narg != 2) 
+    if (narg != 2)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = ATAN2;
     else argstack[nargstack++] = atan2(value1,value2);
 
   } else if (strcmp(word,"random") == 0) {
-    if (narg != 3) 
+    if (narg != 3)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = RANDOM;
     else {
       if (randomequal == NULL) {
-	int seed = static_cast<int> (value3);
-	if (seed <= 0) 
-	  error->all(FLERR,"Invalid math function in variable formula");
-	randomequal = new RanMars(lmp,seed);
+        int seed = static_cast<int> (value3);
+        if (seed <= 0)
+          error->all(FLERR,"Invalid math function in variable formula");
+        randomequal = new RanMars(lmp,seed);
       }
       argstack[nargstack++] = randomequal->uniform()*(value2-value1) + value1;
     }
   } else if (strcmp(word,"normal") == 0) {
-    if (narg != 3) 
+    if (narg != 3)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = NORMAL;
     else {
-      if (value2 < 0.0) 
-	error->all(FLERR,"Invalid math function in variable formula");
+      if (value2 < 0.0)
+        error->all(FLERR,"Invalid math function in variable formula");
       if (randomequal == NULL) {
-	int seed = static_cast<int> (value3);
-	if (seed <= 0) 
-	  error->all(FLERR,"Invalid math function in variable formula");
-	randomequal = new RanMars(lmp,seed);
+        int seed = static_cast<int> (value3);
+        if (seed <= 0)
+          error->all(FLERR,"Invalid math function in variable formula");
+        randomequal = new RanMars(lmp,seed);
       }
       argstack[nargstack++] = value1 + value2*randomequal->gaussian();
     }
 
   } else if (strcmp(word,"ceil") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = CEIL;
     else argstack[nargstack++] = ceil(value1);
 
   } else if (strcmp(word,"floor") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = FLOOR;
     else argstack[nargstack++] = floor(value1);
 
   } else if (strcmp(word,"round") == 0) {
-    if (narg != 1) 
+    if (narg != 1)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = ROUND;
     else argstack[nargstack++] = MYROUND(value1);
 
   } else if (strcmp(word,"ramp") == 0) {
-    if (narg != 2) 
+    if (narg != 2)
       error->all(FLERR,"Invalid math function in variable formula");
     if (update->whichflag == 0)
       error->all(FLERR,"Cannot use ramp in variable formula between runs");
@@ -2413,14 +2413,14 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
     }
 
   } else if (strcmp(word,"stagger") == 0) {
-    if (narg != 2) 
+    if (narg != 2)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = STAGGER;
     else {
       int ivalue1 = static_cast<int> (value1);
       int ivalue2 = static_cast<int> (value2);
       if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2)
-	error->all(FLERR,"Invalid math function in variable formula");
+        error->all(FLERR,"Invalid math function in variable formula");
       int lower = update->ntimestep/ivalue1 * ivalue1;
       int delta = update->ntimestep - lower;
       double value;
@@ -2438,21 +2438,21 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
       int ivalue2 = static_cast<int> (value2);
       int ivalue3 = static_cast<int> (value3);
       if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue3 <= 0 || ivalue2 >= ivalue3)
-	error->all(FLERR,"Invalid math function in variable formula");
+        error->all(FLERR,"Invalid math function in variable formula");
       double value;
       if (update->ntimestep < ivalue1) value = ivalue1;
       else {
-	int lower = ivalue1;
-	while (update->ntimestep >= ivalue3*lower) lower *= ivalue3;
-	int multiple = update->ntimestep/lower;
-	if (multiple < ivalue2) value = (multiple+1)*lower;
-	else value = lower*ivalue3;
+        int lower = ivalue1;
+        while (update->ntimestep >= ivalue3*lower) lower *= ivalue3;
+        int multiple = update->ntimestep/lower;
+        if (multiple < ivalue2) value = (multiple+1)*lower;
+        else value = lower*ivalue3;
       }
       argstack[nargstack++] = value;
     }
 
   } else if (strcmp(word,"stride") == 0) {
-    if (narg != 3) 
+    if (narg != 3)
       error->all(FLERR,"Invalid math function in variable formula");
     if (tree) newtree->type = STRIDE;
     else {
@@ -2460,19 +2460,19 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
       int ivalue2 = static_cast<int> (value2);
       int ivalue3 = static_cast<int> (value3);
       if (ivalue1 < 0 || ivalue2 < 0 || ivalue3 <= 0 || ivalue1 > ivalue2)
-	error->one(FLERR,"Invalid math function in variable formula");
+        error->one(FLERR,"Invalid math function in variable formula");
       double value;
       if (update->ntimestep < ivalue1) value = ivalue1;
       else if (update->ntimestep < ivalue2) {
-	int offset = update->ntimestep - ivalue1;
-	value = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
-	if (value > ivalue2) value = 9.0e18;
+        int offset = update->ntimestep - ivalue1;
+        value = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
+        if (value > ivalue2) value = 9.0e18;
       } else value = 9.0e18;
       argstack[nargstack++] = value;
     }
-    
+
   } else if (strcmp(word,"vdisplace") == 0) {
-    if (narg != 2) 
+    if (narg != 2)
       error->all(FLERR,"Invalid math function in variable formula");
     if (update->whichflag == 0)
       error->all(FLERR,"Cannot use vdisplace in variable formula between runs");
@@ -2484,14 +2484,14 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
     }
 
   } else if (strcmp(word,"swiggle") == 0) {
-    if (narg != 3) 
+    if (narg != 3)
       error->all(FLERR,"Invalid math function in variable formula");
     if (update->whichflag == 0)
       error->all(FLERR,"Cannot use swiggle in variable formula between runs");
     if (tree) newtree->type = CWIGGLE;
     else {
       if (value3 == 0.0)
-	error->all(FLERR,"Invalid math function in variable formula");
+        error->all(FLERR,"Invalid math function in variable formula");
       double delta = update->ntimestep - update->beginstep;
       double omega = 2.0*MY_PI/value3;
       double value = value1 + value2*sin(omega*delta*update->dt);
@@ -2499,14 +2499,14 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
     }
 
   } else if (strcmp(word,"cwiggle") == 0) {
-    if (narg != 3) 
+    if (narg != 3)
       error->all(FLERR,"Invalid math function in variable formula");
     if (update->whichflag == 0)
       error->all(FLERR,"Cannot use cwiggle in variable formula between runs");
     if (tree) newtree->type = CWIGGLE;
     else {
       if (value3 == 0.0)
-	error->all(FLERR,"Invalid math function in variable formula");
+        error->all(FLERR,"Invalid math function in variable formula");
       double delta = update->ntimestep - update->beginstep;
       double omega = 2.0*MY_PI/value3;
       double value = value1 + value2*(1.0-cos(omega*delta*update->dt));
@@ -2535,17 +2535,17 @@ int Variable::math_function(char *word, char *contents, Tree **tree,
 ------------------------------------------------------------------------- */
 
 int Variable::group_function(char *word, char *contents, Tree **tree,
-			     Tree **treestack, int &ntreestack,
-			     double *argstack, int &nargstack)
+                             Tree **treestack, int &ntreestack,
+                             double *argstack, int &nargstack)
 {
   // word not a match to any group function
 
-  if (strcmp(word,"count") && strcmp(word,"mass") && 
+  if (strcmp(word,"count") && strcmp(word,"mass") &&
       strcmp(word,"charge") && strcmp(word,"xcm") &&
       strcmp(word,"vcm") && strcmp(word,"fcm") &&
       strcmp(word,"bound") && strcmp(word,"gyration") &&
       strcmp(word,"ke") && strcmp(word,"angmom") &&
-      strcmp(word,"torque") && strcmp(word,"inertia") && 
+      strcmp(word,"torque") && strcmp(word,"inertia") &&
       strcmp(word,"omega"))
     return 0;
 
@@ -2757,7 +2757,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree,
     else if (strcmp(arg2,"z") == 0) value = omega[2];
     else error->all(FLERR,"Invalid group function in variable formula");
   }
-    
+
   delete [] arg1;
   delete [] arg2;
   delete [] arg3;
@@ -2796,8 +2796,8 @@ int Variable::region_function(char *id)
 ------------------------------------------------------------------------- */
 
 int Variable::special_function(char *word, char *contents, Tree **tree,
-			       Tree **treestack, int &ntreestack,
-			       double *argstack, int &nargstack)
+                               Tree **treestack, int &ntreestack,
+                               double *argstack, int &nargstack)
 {
   // word not a match to any special function
 
@@ -2848,9 +2848,9 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
     else if (strcmp(word,"max") == 0) method = XMAX;
     else if (strcmp(word,"ave") == 0) method = AVE;
     else if (strcmp(word,"trap") == 0) method = TRAP;
-    
+
     if (narg != 1) error->all(FLERR,"Invalid special function in variable formula");
-  
+
     Compute *compute = NULL;
     Fix *fix = NULL;
     int index,nvec,nstride;
@@ -2858,113 +2858,113 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
     if (strstr(arg1,"c_") == arg1) {
       ptr1 = strchr(arg1,'[');
       if (ptr1) {
-	ptr2 = ptr1;
-	index = int_between_brackets(ptr2);
-	*ptr1 = '\0';
+        ptr2 = ptr1;
+        index = int_between_brackets(ptr2);
+        *ptr1 = '\0';
       } else index = 0;
 
       int icompute = modify->find_compute(&arg1[2]);
       if (icompute < 0) error->all(FLERR,"Invalid compute ID in variable formula");
       compute = modify->compute[icompute];
       if (index == 0 && compute->vector_flag) {
-	if (update->whichflag == 0) {
-	  if (compute->invoked_vector != update->ntimestep)
-	    error->all(FLERR,"Compute used in variable between runs is not current");
-	} else if (!(compute->invoked_flag & INVOKED_VECTOR)) {
-	  compute->compute_vector();
-	  compute->invoked_flag |= INVOKED_VECTOR;
-	}
-	nvec = compute->size_vector;
-	nstride = 1;
+        if (update->whichflag == 0) {
+          if (compute->invoked_vector != update->ntimestep)
+            error->all(FLERR,"Compute used in variable between runs is not current");
+        } else if (!(compute->invoked_flag & INVOKED_VECTOR)) {
+          compute->compute_vector();
+          compute->invoked_flag |= INVOKED_VECTOR;
+        }
+        nvec = compute->size_vector;
+        nstride = 1;
       } else if (index && compute->array_flag) {
-	if (index > compute->size_array_cols)
-	  error->all(FLERR,"Variable formula compute array "
-		     "is accessed out-of-range");
-	if (update->whichflag == 0) {
-	  if (compute->invoked_array != update->ntimestep)
-	    error->all(FLERR,"Compute used in variable between runs is not current");
-	} else if (!(compute->invoked_flag & INVOKED_ARRAY)) {
-	  compute->compute_array();
-	  compute->invoked_flag |= INVOKED_ARRAY;
-	}
-	nvec = compute->size_array_rows;
-	nstride = compute->size_array_cols;
+        if (index > compute->size_array_cols)
+          error->all(FLERR,"Variable formula compute array "
+                     "is accessed out-of-range");
+        if (update->whichflag == 0) {
+          if (compute->invoked_array != update->ntimestep)
+            error->all(FLERR,"Compute used in variable between runs is not current");
+        } else if (!(compute->invoked_flag & INVOKED_ARRAY)) {
+          compute->compute_array();
+          compute->invoked_flag |= INVOKED_ARRAY;
+        }
+        nvec = compute->size_array_rows;
+        nstride = compute->size_array_cols;
       } else error->all(FLERR,"Mismatched compute in variable formula");
-      
+
     } else if (strstr(arg1,"f_") == arg1) {
       ptr1 = strchr(arg1,'[');
       if (ptr1) {
-	ptr2 = ptr1;
-	index = int_between_brackets(ptr2);
-	*ptr1 = '\0';
+        ptr2 = ptr1;
+        index = int_between_brackets(ptr2);
+        *ptr1 = '\0';
       } else index = 0;
-      
+
       int ifix = modify->find_fix(&arg1[2]);
       if (ifix < 0) error->all(FLERR,"Invalid fix ID in variable formula");
       fix = modify->fix[ifix];
       if (index == 0 && fix->vector_flag) {
-	if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
-	  error->all(FLERR,"Fix in variable not computed at compatible time");
-	nvec = fix->size_vector;
-	nstride = 1;
+        if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
+          error->all(FLERR,"Fix in variable not computed at compatible time");
+        nvec = fix->size_vector;
+        nstride = 1;
       } else if (index && fix->array_flag) {
-	if (index > fix->size_array_cols)
-	  error->all(FLERR,"Variable formula fix array is accessed out-of-range");
-	if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
-	  error->all(FLERR,"Fix in variable not computed at compatible time");
-	nvec = fix->size_array_rows;
-	nstride = fix->size_array_cols;
+        if (index > fix->size_array_cols)
+          error->all(FLERR,"Variable formula fix array is accessed out-of-range");
+        if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
+          error->all(FLERR,"Fix in variable not computed at compatible time");
+        nvec = fix->size_array_rows;
+        nstride = fix->size_array_cols;
       } else error->all(FLERR,"Mismatched fix in variable formula");
-      
+
     } else error->all(FLERR,"Invalid special function in variable formula");
-    
+
     double value = 0.0;
     if (method == XMIN) value = BIG;
     if (method == XMAX) value = -BIG;
-    
+
     if (compute) {
       double *vec;
       if (index) vec = &compute->array[0][index-1];
-      else vec = compute->vector; 
-      
+      else vec = compute->vector;
+
       int j = 0;
       for (int i = 0; i < nvec; i++) {
-	if (method == SUM) value += vec[j];
-	else if (method == XMIN) value = MIN(value,vec[j]);
-	else if (method == XMAX) value = MAX(value,vec[j]);
-	else if (method == AVE) value += vec[j];
-	else if (method == TRAP) {
-	  if (i > 0 && i < nvec-1) value += vec[j];
-	  else value += 0.5*vec[j];
-	}
-	j += nstride;
+        if (method == SUM) value += vec[j];
+        else if (method == XMIN) value = MIN(value,vec[j]);
+        else if (method == XMAX) value = MAX(value,vec[j]);
+        else if (method == AVE) value += vec[j];
+        else if (method == TRAP) {
+          if (i > 0 && i < nvec-1) value += vec[j];
+          else value += 0.5*vec[j];
+        }
+        j += nstride;
       }
     }
-    
+
     if (fix) {
       double one;
       for (int i = 0; i < nvec; i++) {
-	if (index) one = fix->compute_array(i,index-1);
-	else one = fix->compute_vector(i);
-	if (method == SUM) value += one;
-	else if (method == XMIN) value = MIN(value,one);
-	else if (method == XMAX) value = MAX(value,one);
-	else if (method == AVE) value += one;
-	else if (method == TRAP) {
-	  if (i > 1 && i < nvec) value += one;
-	  else value += 0.5*one;
-	}
+        if (index) one = fix->compute_array(i,index-1);
+        else one = fix->compute_vector(i);
+        if (method == SUM) value += one;
+        else if (method == XMIN) value = MIN(value,one);
+        else if (method == XMAX) value = MAX(value,one);
+        else if (method == AVE) value += one;
+        else if (method == TRAP) {
+          if (i > 1 && i < nvec) value += one;
+          else value += 0.5*one;
+        }
       }
     }
-    
+
     if (method == AVE) value /= nvec;
-    
+
     delete [] arg1;
     delete [] arg2;
     delete [] arg3;
-    
+
     // save value in tree or on argstack
-    
+
     if (tree) {
       Tree *newtree = new Tree();
       newtree->type = VALUE;
@@ -2983,7 +2983,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
     int igroup = group->find(arg1);
     if (igroup == -1)
       error->all(FLERR,"Group ID in variable formula does not exist");
-    
+
     Tree *newtree = new Tree();
     newtree->type = GMASK;
     newtree->ivalue1 = group->bitmask[igroup];
@@ -2996,7 +2996,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
     if (narg != 1) error->all(FLERR,"Invalid special function in variable formula");
 
     int iregion = region_function(arg1);
-    
+
     Tree *newtree = new Tree();
     newtree->type = RMASK;
     newtree->ivalue1 = iregion;
@@ -3012,7 +3012,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
     if (igroup == -1)
       error->all(FLERR,"Group ID in variable formula does not exist");
     int iregion = region_function(arg2);
-    
+
     Tree *newtree = new Tree();
     newtree->type = RMASK;
     newtree->ivalue1 = group->bitmask[igroup];
@@ -3035,9 +3035,9 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
 ------------------------------------------------------------------------- */
 
 void Variable::peratom2global(int flag, char *word,
-			      double *vector, int nstride, int id,
-			      Tree **tree, Tree **treestack, int &ntreestack,
-			      double *argstack, int &nargstack)
+                              double *vector, int nstride, int id,
+                              Tree **tree, Tree **treestack, int &ntreestack,
+                              double *argstack, int &nargstack)
 {
   if (atom->map_style == 0)
     error->all(FLERR,"Indexed per-atom vector in variable formula without atom map");
@@ -3049,8 +3049,8 @@ void Variable::peratom2global(int flag, char *word,
 
     if (flag == 0) {
       if (strcmp(word,"mass") == 0) {
-	if (atom->rmass) mine = atom->rmass[index];
-	else mine = atom->mass[atom->type[index]];
+        if (atom->rmass) mine = atom->rmass[index];
+        else mine = atom->mass[atom->type[index]];
       }
       else if (strcmp(word,"type") == 0) mine = atom->type[index];
       else if (strcmp(word,"x") == 0) mine = atom->x[index][0];
@@ -3062,16 +3062,16 @@ void Variable::peratom2global(int flag, char *word,
       else if (strcmp(word,"fx") == 0) mine = atom->f[index][0];
       else if (strcmp(word,"fy") == 0) mine = atom->f[index][1];
       else if (strcmp(word,"fz") == 0) mine = atom->f[index][2];
-      
+
       else error->one(FLERR,"Invalid atom vector in variable formula");
 
     } else mine = vector[index*nstride];
-    
+
   } else mine = 0.0;
 
   double value;
   MPI_Allreduce(&mine,&value,1,MPI_DOUBLE,MPI_SUM,world);
-  
+
   if (tree) {
     Tree *newtree = new Tree();
     newtree->type = VALUE;
@@ -3113,7 +3113,7 @@ int Variable::is_atom_vector(char *word)
 ------------------------------------------------------------------------- */
 
 void Variable::atom_vector(char *word, Tree **tree,
-			   Tree **treestack, int &ntreestack)
+                           Tree **treestack, int &ntreestack)
 {
   if (tree == NULL)
     error->all(FLERR,"Atom vector in equal-style variable formula");
@@ -3123,7 +3123,7 @@ void Variable::atom_vector(char *word, Tree **tree,
   newtree->nstride = 3;
   newtree->left = newtree->middle = newtree->right = NULL;
   treestack[ntreestack++] = newtree;
-	    
+
   if (strcmp(word,"mass") == 0) {
     if (atom->rmass) {
       newtree->nstride = 1;
@@ -3215,7 +3215,7 @@ char *Variable::find_next_comma(char *str)
 {
   int level = 0;
   for (char *p = str; *p; ++p) {
-    if ('(' == *p) level++; 
+    if ('(' == *p) level++;
     else if (')' == *p) level--;
     else if (',' == *p && !level) return p;
   }
@@ -3259,151 +3259,151 @@ double Variable::evaluate_boolean(char *str)
 
   while (1) {
     onechar = str[i];
-    
+
     // whitespace: just skip
-    
+
     if (isspace(onechar)) i++;
-    
+
     // ----------------
     // parentheses: recursively evaluate contents of parens
     // ----------------
-    
+
     else if (onechar == '(') {
       if (expect == OP) error->all(FLERR,"Invalid Boolean syntax in if command");
       expect = OP;
-      
+
       char *contents;
       i = find_matching_paren(str,i,contents);
       i++;
-      
+
       // evaluate contents and push on stack
-      
+
       argstack[nargstack++] = evaluate_boolean(contents);
-      
+
       delete [] contents;
-      
+
     // ----------------
     // number: push value onto stack
     // ----------------
-      
+
     } else if (isdigit(onechar) || onechar == '.' || onechar == '-') {
       if (expect == OP) error->all(FLERR,"Invalid Boolean syntax in if command");
       expect = OP;
-      
+
       // istop = end of number, including scientific notation
-      
+
       int istart = i++;
       while (isdigit(str[i]) || str[i] == '.') i++;
       if (str[i] == 'e' || str[i] == 'E') {
-	i++;
-	if (str[i] == '+' || str[i] == '-') i++;
-	while (isdigit(str[i])) i++;
+        i++;
+        if (str[i] == '+' || str[i] == '-') i++;
+        while (isdigit(str[i])) i++;
       }
       int istop = i - 1;
-      
+
       int n = istop - istart + 1;
       char *number = new char[n+1];
       strncpy(number,&str[istart],n);
       number[n] = '\0';
-      
+
       argstack[nargstack++] = atof(number);
-      
+
       delete [] number;
-      
+
     // ----------------
     // Boolean operator, including end-of-string
     // ----------------
-      
+
     } else if (strchr("<>=!&|\0",onechar)) {
       if (onechar == '=') {
-	if (str[i+1] != '=') 
-	  error->all(FLERR,"Invalid Boolean syntax in if command");
-	op = EQ;
-	i++;
+        if (str[i+1] != '=')
+          error->all(FLERR,"Invalid Boolean syntax in if command");
+        op = EQ;
+        i++;
       } else if (onechar == '!') {
-	if (str[i+1] == '=') {
-	  op = NE;
-	  i++;
-	} else op = NOT;
+        if (str[i+1] == '=') {
+          op = NE;
+          i++;
+        } else op = NOT;
       } else if (onechar == '<') {
-	if (str[i+1] != '=') op = LT;
-	else {
-	  op = LE;
-	  i++;
-	}
+        if (str[i+1] != '=') op = LT;
+        else {
+          op = LE;
+          i++;
+        }
       } else if (onechar == '>') {
-	if (str[i+1] != '=') op = GT;
-	else {
-	  op = GE;
-	  i++;
-	}
+        if (str[i+1] != '=') op = GT;
+        else {
+          op = GE;
+          i++;
+        }
       } else if (onechar == '&') {
-	if (str[i+1] != '&') 
-	  error->all(FLERR,"Invalid Boolean syntax in if command");
-	op = AND;
-	i++;
+        if (str[i+1] != '&')
+          error->all(FLERR,"Invalid Boolean syntax in if command");
+        op = AND;
+        i++;
       } else if (onechar == '|') {
-	if (str[i+1] != '|') 
-	  error->all(FLERR,"Invalid Boolean syntax in if command");
-	op = OR;
-	i++;
+        if (str[i+1] != '|')
+          error->all(FLERR,"Invalid Boolean syntax in if command");
+        op = OR;
+        i++;
       } else op = DONE;
-      
+
       i++;
-      
+
       if (op == NOT && expect == ARG) {
-	opstack[nopstack++] = op;
-	continue;
+        opstack[nopstack++] = op;
+        continue;
       }
 
       if (expect == ARG) error->all(FLERR,"Invalid Boolean syntax in if command");
       expect = ARG;
-      
+
       // evaluate stack as deep as possible while respecting precedence
       // before pushing current op onto stack
 
       while (nopstack && precedence[opstack[nopstack-1]] >= precedence[op]) {
-	opprevious = opstack[--nopstack];
-	
-	value2 = argstack[--nargstack];
-	if (opprevious != NOT) value1 = argstack[--nargstack];
-	
-	if (opprevious == NOT) {
-	  if (value2 == 0.0) argstack[nargstack++] = 1.0;
-	  else argstack[nargstack++] = 0.0;
-	} else if (opprevious == EQ) {
-	  if (value1 == value2) argstack[nargstack++] = 1.0;
-	  else argstack[nargstack++] = 0.0;
-	} else if (opprevious == NE) {
-	  if (value1 != value2) argstack[nargstack++] = 1.0;
-	  else argstack[nargstack++] = 0.0;
-	} else if (opprevious == LT) {
-	  if (value1 < value2) argstack[nargstack++] = 1.0;
-	  else argstack[nargstack++] = 0.0;
-	} else if (opprevious == LE) {
-	  if (value1 <= value2) argstack[nargstack++] = 1.0;
-	  else argstack[nargstack++] = 0.0;
-	} else if (opprevious == GT) {
-	  if (value1 > value2) argstack[nargstack++] = 1.0;
-	  else argstack[nargstack++] = 0.0;
-	} else if (opprevious == GE) {
-	  if (value1 >= value2) argstack[nargstack++] = 1.0;
-	  else argstack[nargstack++] = 0.0;
-	} else if (opprevious == AND) {
-	  if (value1 != 0.0 && value2 != 0.0) argstack[nargstack++] = 1.0;
-	  else argstack[nargstack++] = 0.0;
-	} else if (opprevious == OR) {
-	  if (value1 != 0.0 || value2 != 0.0) argstack[nargstack++] = 1.0;
-	  else argstack[nargstack++] = 0.0;
-	}
+        opprevious = opstack[--nopstack];
+
+        value2 = argstack[--nargstack];
+        if (opprevious != NOT) value1 = argstack[--nargstack];
+
+        if (opprevious == NOT) {
+          if (value2 == 0.0) argstack[nargstack++] = 1.0;
+          else argstack[nargstack++] = 0.0;
+        } else if (opprevious == EQ) {
+          if (value1 == value2) argstack[nargstack++] = 1.0;
+          else argstack[nargstack++] = 0.0;
+        } else if (opprevious == NE) {
+          if (value1 != value2) argstack[nargstack++] = 1.0;
+          else argstack[nargstack++] = 0.0;
+        } else if (opprevious == LT) {
+          if (value1 < value2) argstack[nargstack++] = 1.0;
+          else argstack[nargstack++] = 0.0;
+        } else if (opprevious == LE) {
+          if (value1 <= value2) argstack[nargstack++] = 1.0;
+          else argstack[nargstack++] = 0.0;
+        } else if (opprevious == GT) {
+          if (value1 > value2) argstack[nargstack++] = 1.0;
+          else argstack[nargstack++] = 0.0;
+        } else if (opprevious == GE) {
+          if (value1 >= value2) argstack[nargstack++] = 1.0;
+          else argstack[nargstack++] = 0.0;
+        } else if (opprevious == AND) {
+          if (value1 != 0.0 && value2 != 0.0) argstack[nargstack++] = 1.0;
+          else argstack[nargstack++] = 0.0;
+        } else if (opprevious == OR) {
+          if (value1 != 0.0 || value2 != 0.0) argstack[nargstack++] = 1.0;
+          else argstack[nargstack++] = 0.0;
+        }
       }
-      
+
       // if end-of-string, break out of entire formula evaluation loop
-      
+
       if (op == DONE) break;
-      
+
       // push current operation onto stack
-      
+
       opstack[nopstack++] = op;
 
     } else error->all(FLERR,"Invalid Boolean syntax in if command");
diff --git a/src/variable.h b/src/variable.h
index dac3939668..407fd17b3c 100644
--- a/src/variable.h
+++ b/src/variable.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -72,10 +72,10 @@ class Variable : protected Pointers {
   int math_function(char *, char *, Tree **, Tree **, int &, double *, int &);
   int group_function(char *, char *, Tree **, Tree **, int &, double *, int &);
   int region_function(char *);
-  int special_function(char *, char *, Tree **, Tree **, 
-		       int &, double *, int &);
+  int special_function(char *, char *, Tree **, Tree **,
+                       int &, double *, int &);
   void peratom2global(int, char *, double *, int, int,
-		      Tree **, Tree **, int &, double *, int &);
+                      Tree **, Tree **, int &, double *, int &);
   int is_atom_vector(char *);
   void atom_vector(char *, Tree **, Tree **, int &);
   int is_constant(char *);
diff --git a/src/velocity.cpp b/src/velocity.cpp
index eb46bc0f6b..fa3712bbbd 100644
--- a/src/velocity.cpp
+++ b/src/velocity.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -53,7 +53,7 @@ void Velocity::command(int narg, char **arg)
 {
   if (narg < 2) error->all(FLERR,"Illegal velocity command");
 
-  if (domain->box_exist == 0) 
+  if (domain->box_exist == 0)
     error->all(FLERR,"Velocity command before simulation box is defined");
   if (atom->natoms == 0)
     error->all(FLERR,"Velocity command with no atoms existing");
@@ -194,7 +194,7 @@ void Velocity::create(double t_desired, int seed)
   int m;
   double vx,vy,vz,factor;
   RanPark *random;
-  
+
   if (loop_flag == ALL) {
 
     // create an atom map if one doesn't exist already
@@ -213,9 +213,11 @@ void Velocity::create(double t_desired, int seed)
     if (atom->natoms > MAXSMALLINT)
       error->all(FLERR,"Too big a problem to use velocity create loop all");
     if (atom->tag_enable == 0)
-      error->all(FLERR,"Cannot use velocity create loop all unless atoms have IDs");
+      error->all(FLERR,
+                 "Cannot use velocity create loop all unless atoms have IDs");
     if (atom->tag_consecutive() == 0)
-      error->all(FLERR,"Atom IDs must be consecutive for velocity create loop all");
+      error->all(FLERR,
+                 "Atom IDs must be consecutive for velocity create loop all");
 
     // loop over all atoms in system
     // generate RNGs for all atoms, only assign to ones I own
@@ -226,24 +228,24 @@ void Velocity::create(double t_desired, int seed)
 
     for (i = 1; i <= natoms; i++) {
       if (dist_flag == 0) {
-	vx = random->uniform();
-	vy = random->uniform();
-	vz = random->uniform();
+        vx = random->uniform();
+        vy = random->uniform();
+        vz = random->uniform();
       } else {
-	vx = random->gaussian();
-	vy = random->gaussian();
-	vz = random->gaussian();
+        vx = random->gaussian();
+        vy = random->gaussian();
+        vz = random->gaussian();
       }
       m = atom->map(i);
       if (m >= 0 && m < nlocal) {
-	if (mask[m] & groupbit) {
-	  if (rmass) factor = 1.0/sqrt(rmass[m]);
-	  else factor = 1.0/sqrt(mass[type[m]]);
-	  v[m][0] = vx * factor;
-	  v[m][1] = vy * factor;
-	  if (dimension == 3) v[m][2] = vz * factor;
-	  else v[m][2] = 0.0;
-	}
+        if (mask[m] & groupbit) {
+          if (rmass) factor = 1.0/sqrt(rmass[m]);
+          else factor = 1.0/sqrt(mass[type[m]]);
+          v[m][0] = vx * factor;
+          v[m][1] = vy * factor;
+          if (dimension == 3) v[m][2] = vz * factor;
+          else v[m][2] = 0.0;
+        }
       }
     }
 
@@ -260,47 +262,47 @@ void Velocity::create(double t_desired, int seed)
 
     for (i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	if (dist_flag == 0) {
-	  vx = random->uniform();
-	  vy = random->uniform();
-	  vz = random->uniform();
-	} else {
-	  vx = random->gaussian();
-	  vy = random->gaussian();
-	  vz = random->gaussian();
-	}
-	if (rmass) factor = 1.0/sqrt(rmass[i]);
-	else factor = 1.0/sqrt(mass[type[i]]);
-	v[i][0] = vx * factor;
-	v[i][1] = vy * factor;
-	if (dimension == 3) v[i][2] = vz * factor;
-	else v[i][2] = 0.0;
+        if (dist_flag == 0) {
+          vx = random->uniform();
+          vy = random->uniform();
+          vz = random->uniform();
+        } else {
+          vx = random->gaussian();
+          vy = random->gaussian();
+          vz = random->gaussian();
+        }
+        if (rmass) factor = 1.0/sqrt(rmass[i]);
+        else factor = 1.0/sqrt(mass[type[i]]);
+        v[i][0] = vx * factor;
+        v[i][1] = vy * factor;
+        if (dimension == 3) v[i][2] = vz * factor;
+        else v[i][2] = 0.0;
       }
     }
 
   } else if (loop_flag == GEOM) {
     random = new RanPark(lmp,1);
     double **x = atom->x;
-    
+
     for (i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	random->reset(seed,x[i]);
-	if (dist_flag == 0) {
-	  vx = random->uniform();
-	  vy = random->uniform();
-	  vz = random->uniform();
-	} else {
-	  vx = random->gaussian();
-	  vy = random->gaussian();
-	  vz = random->gaussian();
-	}
-
-	if (rmass) factor = 1.0/sqrt(rmass[i]);
-	else factor = 1.0/sqrt(mass[type[i]]);
-	v[i][0] = vx * factor;
-	v[i][1] = vy * factor;
-	if (dimension == 3) v[i][2] = vz * factor;
-	else v[i][2] = 0.0;
+        random->reset(seed,x[i]);
+        if (dist_flag == 0) {
+          vx = random->uniform();
+          vy = random->uniform();
+          vz = random->uniform();
+        } else {
+          vx = random->gaussian();
+          vy = random->gaussian();
+          vz = random->gaussian();
+        }
+
+        if (rmass) factor = 1.0/sqrt(rmass[i]);
+        else factor = 1.0/sqrt(mass[type[i]]);
+        v[i][0] = vx * factor;
+        v[i][1] = vy * factor;
+        if (dimension == 3) v[i][2] = vz * factor;
+        else v[i][2] = 0.0;
       }
     }
   }
@@ -315,14 +317,14 @@ void Velocity::create(double t_desired, int seed)
   double t = temperature->compute_scalar();
   rescale(t,t_desired);
 
-  // if sum_flag set, add back in previous velocities 
+  // if sum_flag set, add back in previous velocities
 
   if (sum_flag) {
     for (i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	v[i][0] += vhold[i][0];
-	v[i][1] += vhold[i][1];
-	v[i][2] += vhold[i][2];
+        v[i][0] += vhold[i][0];
+        v[i][1] += vhold[i][1];
+        v[i][2] += vhold[i][2];
       }
     }
   }
@@ -397,21 +399,24 @@ void Velocity::set(int narg, char **arg)
 
   if (xstr) {
     xvar = input->variable->find(xstr);
-    if (xvar < 0) error->all(FLERR,"Variable name for velocity set does not exist");
+    if (xvar < 0)
+      error->all(FLERR,"Variable name for velocity set does not exist");
     if (input->variable->equalstyle(xvar)) xstyle = EQUAL;
     else if (input->variable->atomstyle(xvar)) xstyle = ATOM;
     else error->all(FLERR,"Variable for velocity set is invalid style");
   }
   if (ystr) {
     yvar = input->variable->find(ystr);
-    if (yvar < 0) error->all(FLERR,"Variable name for velocity set does not exist");
+    if (yvar < 0)
+      error->all(FLERR,"Variable name for velocity set does not exist");
     if (input->variable->equalstyle(yvar)) ystyle = EQUAL;
     else if (input->variable->atomstyle(yvar)) ystyle = ATOM;
     else error->all(FLERR,"Variable for velocity set is invalid style");
   }
   if (zstr) {
     zvar = input->variable->find(zstr);
-    if (zvar < 0) error->all(FLERR,"Variable name for velocity set does not exist");
+    if (zvar < 0)
+      error->all(FLERR,"Variable name for velocity set does not exist");
     if (input->variable->equalstyle(zvar)) zstyle = EQUAL;
     else if (input->variable->atomstyle(zvar)) zstyle = ATOM;
     else error->all(FLERR,"Variable for velocity set is invalid style");
@@ -446,15 +451,15 @@ void Velocity::set(int narg, char **arg)
   if (varflag == CONSTANT) {
     for (int i = 0; i < nlocal; i++) {
       if (mask[i] & groupbit) {
-	if (sum_flag == 0) {
-	  if (xstyle) v[i][0] = vx;
-	  if (ystyle) v[i][1] = vy;
-	  if (zstyle) v[i][2] = vz;
-	} else {
-	  if (xstyle) v[i][0] += vx;
-	  if (ystyle) v[i][1] += vy;
-	  if (zstyle) v[i][2] += vz;
-	}
+        if (sum_flag == 0) {
+          if (xstyle) v[i][0] = vx;
+          if (ystyle) v[i][1] = vy;
+          if (zstyle) v[i][2] = vz;
+        } else {
+          if (xstyle) v[i][0] += vx;
+          if (ystyle) v[i][1] += vy;
+          if (zstyle) v[i][2] += vz;
+        }
       }
     }
 
@@ -473,21 +478,21 @@ void Velocity::set(int narg, char **arg)
 
     for (int i = 0; i < nlocal; i++)
       if (mask[i] & groupbit) {
-	if (sum_flag == 0) {
-	  if (xstyle == ATOM) v[i][0] = vfield[i][0];
-	  else if (xstyle) v[i][0] = vx;
-	  if (ystyle == ATOM) v[i][1] = vfield[i][1];
-	  else if (ystyle) v[i][1] = vy;
-	  if (zstyle == ATOM) v[i][2] = vfield[i][2];
-	  else if (zstyle) v[i][2] = vz;
-	} else {
-	  if (xstyle == ATOM) v[i][0] += vfield[i][0];
-	  else if (xstyle) v[i][0] += vx;
-	  if (ystyle == ATOM) v[i][1] += vfield[i][1];
-	  else if (ystyle) v[i][1] += vy;
-	  if (zstyle == ATOM) v[i][2] += vfield[i][2];
-	  else if (zstyle) v[i][2] += vz;
-	}
+        if (sum_flag == 0) {
+          if (xstyle == ATOM) v[i][0] = vfield[i][0];
+          else if (xstyle) v[i][0] = vx;
+          if (ystyle == ATOM) v[i][1] = vfield[i][1];
+          else if (ystyle) v[i][1] = vy;
+          if (zstyle == ATOM) v[i][2] = vfield[i][2];
+          else if (zstyle) v[i][2] = vz;
+        } else {
+          if (xstyle == ATOM) v[i][0] += vfield[i][0];
+          else if (xstyle) v[i][0] += vx;
+          if (ystyle == ATOM) v[i][1] += vfield[i][1];
+          else if (ystyle) v[i][1] += vy;
+          if (zstyle == ATOM) v[i][2] += vfield[i][2];
+          else if (zstyle) v[i][2] += vz;
+        }
       }
   }
 
@@ -500,7 +505,7 @@ void Velocity::set(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   rescale velocities of a group after computing its temperature 
+   rescale velocities of a group after computing its temperature
 ------------------------------------------------------------------------- */
 
 void Velocity::scale(int narg, char **arg)
@@ -538,7 +543,7 @@ void Velocity::scale(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   apply a ramped set of velocities 
+   apply a ramped set of velocities
 ------------------------------------------------------------------------- */
 
 void Velocity::ramp(int narg, char **arg)
@@ -563,7 +568,7 @@ void Velocity::ramp(int narg, char **arg)
   else if (strcmp(arg[0],"vz") == 0) v_dim = 2;
   else error->all(FLERR,"Illegal velocity command");
 
-  if (v_dim == 2 && domain->dimension == 2) 
+  if (v_dim == 2 && domain->dimension == 2)
     error->all(FLERR,"Velocity ramp in z for a 2d problem");
 
   double v_lo,v_hi;
@@ -598,7 +603,7 @@ void Velocity::ramp(int narg, char **arg)
 
   // vramp = ramped velocity component for v_dim
   // add or set based on sum_flag
-  
+
   double **x = atom->x;
   double **v = atom->v;
   int *mask = atom->mask;
@@ -629,7 +634,7 @@ void Velocity::zero(int narg, char **arg)
 }
 
 /* ----------------------------------------------------------------------
-   rescale velocities of group atoms to t_new from t_old 
+   rescale velocities of group atoms to t_new from t_old
 ------------------------------------------------------------------------- */
 
 void Velocity::rescale(double t_old, double t_new)
@@ -712,13 +717,13 @@ void Velocity::zero_rotation()
   int *mask = atom->mask;
   int *image = atom->image;
   int nlocal = atom->nlocal;
-  
+
   int xbox,ybox,zbox;
   double dx,dy,dz;
   double xprd = domain->xprd;
   double yprd = domain->yprd;
   double zprd = domain->zprd;
-  
+
   for (i = 0; i < nlocal; i++)
     if (mask[i] & groupbit) {
       xbox = (image[i] & 1023) - 512;
@@ -734,7 +739,7 @@ void Velocity::zero_rotation()
 }
 
 /* ----------------------------------------------------------------------
-   parse optional parameters at end of velocity input line 
+   parse optional parameters at end of velocity input line
 ------------------------------------------------------------------------- */
 
 void Velocity::options(int narg, char **arg)
@@ -771,12 +776,13 @@ void Velocity::options(int narg, char **arg)
       if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
       int icompute;
       for (icompute = 0; icompute < modify->ncompute; icompute++)
-	if (strcmp(arg[iarg+1],modify->compute[icompute]->id) == 0) break;
-      if (icompute == modify->ncompute) 
-	error->all(FLERR,"Could not find velocity temperature ID");
+        if (strcmp(arg[iarg+1],modify->compute[icompute]->id) == 0) break;
+      if (icompute == modify->ncompute)
+        error->all(FLERR,"Could not find velocity temperature ID");
       temperature = modify->compute[icompute];
       if (temperature->tempflag == 0)
-	error->all(FLERR,"Velocity temperature ID does not compute temperature");
+        error->all(FLERR,
+                   "Velocity temperature ID does not compute temperature");
       iarg += 2;
     } else if (strcmp(arg[iarg],"loop") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal velocity command");
diff --git a/src/velocity.h b/src/velocity.h
index c640433946..7d249d16d5 100644
--- a/src/velocity.h
+++ b/src/velocity.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/verlet.cpp b/src/verlet.cpp
index 5190281173..6ed4f40b0c 100644
--- a/src/verlet.cpp
+++ b/src/verlet.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -240,9 +240,9 @@ void Verlet::run(int n)
       if (triclinic) domain->x2lamda(atom->nlocal);
       domain->pbc();
       if (domain->box_change) {
-	domain->reset_box();
-	comm->setup();
-	if (neighbor->style) neighbor->setup_bins();
+        domain->reset_box();
+        comm->setup();
+        if (neighbor->style) neighbor->setup_bins();
       }
       timer->stamp();
       comm->exchange();
@@ -354,13 +354,13 @@ void Verlet::force_clear()
       f[i][1] = 0.0;
       f[i][2] = 0.0;
     }
-    
+
     if (torqueflag) {
       double **torque = atom->torque;
       for (i = 0; i < nall; i++) {
-	torque[i][0] = 0.0;
-	torque[i][1] = 0.0;
-	torque[i][2] = 0.0;
+        torque[i][0] = 0.0;
+        torque[i][1] = 0.0;
+        torque[i][2] = 0.0;
       }
     }
 
@@ -383,33 +383,33 @@ void Verlet::force_clear()
       nall = atom->nlocal + atom->nghost;
 
       for (i = atom->nlocal; i < nall; i++) {
-	f[i][0] = 0.0;
-	f[i][1] = 0.0;
-	f[i][2] = 0.0;
+        f[i][0] = 0.0;
+        f[i][1] = 0.0;
+        f[i][2] = 0.0;
       }
-    
+
       if (torqueflag) {
-	double **torque = atom->torque;
-	for (i = atom->nlocal; i < nall; i++) {
-	  torque[i][0] = 0.0;
-	  torque[i][1] = 0.0;
-	  torque[i][2] = 0.0;
-	}
+        double **torque = atom->torque;
+        for (i = atom->nlocal; i < nall; i++) {
+          torque[i][0] = 0.0;
+          torque[i][1] = 0.0;
+          torque[i][2] = 0.0;
+        }
       }
 
       if (erforceflag) {
-	double *erforce = atom->erforce;
-	for (i = atom->nlocal; i < nall; i++) erforce[i] = 0.0;
+        double *erforce = atom->erforce;
+        for (i = atom->nlocal; i < nall; i++) erforce[i] = 0.0;
       }
 
       if (e_flag) {
-	double *de = atom->de;
-	for (i = 0; i < nall; i++) de[i] = 0.0;
+        double *de = atom->de;
+        for (i = 0; i < nall; i++) de[i] = 0.0;
       }
 
       if (rho_flag) {
-	double *drho = atom->drho;
-	for (i = 0; i < nall; i++) drho[i] = 0.0;
+        double *drho = atom->drho;
+        for (i = 0; i < nall; i++) drho[i] = 0.0;
       }
     }
   }
diff --git a/src/verlet.h b/src/verlet.h
index 9dbcf32723..1f3bb1767b 100644
--- a/src/verlet.h
+++ b/src/verlet.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
diff --git a/src/write_restart.cpp b/src/write_restart.cpp
index 6dcec7659f..1471a8ba16 100644
--- a/src/write_restart.cpp
+++ b/src/write_restart.cpp
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
@@ -131,7 +131,7 @@ void WriteRestart::write(char *file)
 
   bigint nblocal = atom->nlocal;
   MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
-  if (natoms != atom->natoms && output->thermo->lostflag == ERROR) 
+  if (natoms != atom->natoms && output->thermo->lostflag == ERROR)
     error->all(FLERR,"Atom count is inconsistent, cannot write restart file");
 
   // check if filename contains "%"
@@ -218,19 +218,19 @@ void WriteRestart::write(char *file)
       if (triclinic) domain->x2lamda(x,x);
 
       if (xperiodic) {
-	if (x[0] < lo[0]) x[0] += period[0];
-	if (x[0] >= hi[0]) x[0] -= period[0];
-	x[0] = MAX(x[0],lo[0]);
+        if (x[0] < lo[0]) x[0] += period[0];
+        if (x[0] >= hi[0]) x[0] -= period[0];
+        x[0] = MAX(x[0],lo[0]);
       }
       if (yperiodic) {
-	if (x[1] < lo[1]) x[1] += period[1];
-	if (x[1] >= hi[1]) x[1] -= period[1];
-	x[1] = MAX(x[1],lo[1]);
+        if (x[1] < lo[1]) x[1] += period[1];
+        if (x[1] >= hi[1]) x[1] -= period[1];
+        x[1] = MAX(x[1],lo[1]);
       }
       if (zperiodic) {
-	if (x[2] < lo[2]) x[2] += period[2];
-	if (x[2] >= hi[2]) x[2] -= period[2];
-	x[2] = MAX(x[2],lo[2]);
+        if (x[2] < lo[2]) x[2] += period[2];
+        if (x[2] >= hi[2]) x[2] -= period[2];
+        x[2] = MAX(x[2],lo[2]);
       }
 
       if (triclinic) domain->lamda2x(x,x);
@@ -252,15 +252,15 @@ void WriteRestart::write(char *file)
 
     if (me == 0) {
       for (int iproc = 0; iproc < nprocs; iproc++) {
-	if (iproc) {
-	  MPI_Irecv(buf,max_size,MPI_DOUBLE,iproc,0,world,&request);
-	  MPI_Send(&tmp,0,MPI_INT,iproc,0,world);
-	  MPI_Wait(&request,&status);
-	  MPI_Get_count(&status,MPI_DOUBLE,&recv_size);
-	} else recv_size = send_size;
-	
-	fwrite(&recv_size,sizeof(int),1,fp);
-	fwrite(buf,sizeof(double),recv_size,fp);
+        if (iproc) {
+          MPI_Irecv(buf,max_size,MPI_DOUBLE,iproc,0,world,&request);
+          MPI_Send(&tmp,0,MPI_INT,iproc,0,world);
+          MPI_Wait(&request,&status);
+          MPI_Get_count(&status,MPI_DOUBLE,&recv_size);
+        } else recv_size = send_size;
+
+        fwrite(&recv_size,sizeof(int),1,fp);
+        fwrite(buf,sizeof(double),recv_size,fp);
       }
       fclose(fp);
 
@@ -288,12 +288,12 @@ void WriteRestart::write(char *file)
     fwrite(buf,sizeof(double),send_size,fp);
     fclose(fp);
   }
-    
+
   memory->destroy(buf);
 }
 
 /* ----------------------------------------------------------------------
-   proc 0 writes out problem description 
+   proc 0 writes out problem description
 ------------------------------------------------------------------------- */
 
 void WriteRestart::header()
@@ -452,7 +452,7 @@ void WriteRestart::force_fields()
 }
 
 /* ----------------------------------------------------------------------
-   write a flag and an int into restart file 
+   write a flag and an int into restart file
 ------------------------------------------------------------------------- */
 
 void WriteRestart::write_int(int flag, int value)
@@ -462,7 +462,7 @@ void WriteRestart::write_int(int flag, int value)
 }
 
 /* ----------------------------------------------------------------------
-   write a flag and a double into restart file 
+   write a flag and a double into restart file
 ------------------------------------------------------------------------- */
 
 void WriteRestart::write_double(int flag, double value)
@@ -472,7 +472,7 @@ void WriteRestart::write_double(int flag, double value)
 }
 
 /* ----------------------------------------------------------------------
-   write a flag and a char str into restart file 
+   write a flag and a char str into restart file
 ------------------------------------------------------------------------- */
 
 void WriteRestart::write_char(int flag, char *value)
@@ -484,7 +484,7 @@ void WriteRestart::write_char(int flag, char *value)
 }
 
 /* ----------------------------------------------------------------------
-   write a flag and a bigint into restart file 
+   write a flag and a bigint into restart file
 ------------------------------------------------------------------------- */
 
 void WriteRestart::write_bigint(int flag, bigint value)
diff --git a/src/write_restart.h b/src/write_restart.h
index d473141895..812c756283 100644
--- a/src/write_restart.h
+++ b/src/write_restart.h
@@ -5,7 +5,7 @@
 
    Copyright (2003) Sandia Corporation.  Under the terms of Contract
    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
-   certain rights in this software.  This software is distributed under 
+   certain rights in this software.  This software is distributed under
    the GNU General Public License.
 
    See the README file in the top-level LAMMPS directory.
-- 
GitLab