reduce compiler warnings by avoiding to redeclare variables so they shadow others

This commit is contained in:
Axel Kohlmeyer
2021-04-23 15:35:45 -04:00
parent 5a12baeef9
commit 8541b0da3e
18 changed files with 60 additions and 76 deletions

View File

@ -119,7 +119,7 @@ void ComputeDipoleChunk::compute_array()
// zero local per-chunk values
for (int i = 0; i < nchunk; i++) {
for (i = 0; i < nchunk; i++) {
massproc[i] = chrgproc[i] = 0.0;
com[i][0] = com[i][1] = com[i][2] = 0.0;
dipole[i][0] = dipole[i][1] = dipole[i][2] = dipole[i][3] = 0.0;
@ -138,7 +138,7 @@ void ComputeDipoleChunk::compute_array()
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++)
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
index = ichunk[i]-1;
if (index < 0) continue;
@ -159,7 +159,7 @@ void ComputeDipoleChunk::compute_array()
MPI_Allreduce(chrgproc,chrgtotal,nchunk,MPI_DOUBLE,MPI_SUM,world);
MPI_Allreduce(&com[0][0],&comall[0][0],3*nchunk,MPI_DOUBLE,MPI_SUM,world);
for (int i = 0; i < nchunk; i++) {
for (i = 0; i < nchunk; i++) {
if (masstotal[i] > 0.0) {
comall[i][0] /= masstotal[i];
comall[i][1] /= masstotal[i];