Commit 330f29db authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

replace variable length arrays in USER-PHONON with new/delete

parent eeee2d30
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -668,7 +668,8 @@ void FixPhonon::postprocess( )
  }

  // to get Phi = KT.G^-1; normalization of FFTW data is done here
  double boltz = force->boltz, kbtsqrt[sysdim], TempAve = 0.;
  double boltz = force->boltz, TempAve = 0.;
  double *kbtsqrt = new double[sysdim];
  double TempFac = inv_neval * inv_nTemp;
  double NormFac = TempFac * double(ntotal);

@@ -692,7 +693,7 @@ void FixPhonon::postprocess( )
  MPI_Gatherv(Phi_q[0],mynq*fft_dim2*2,MPI_DOUBLE,Phi_all[0],recvcnts,displs,MPI_DOUBLE,0,world);

  // to collect all basis info and averaged it on root
  double basis_root[fft_dim];
  double *basis_root = new double[fft_dim];
  if (fft_dim > sysdim) MPI_Reduce(&basis[1][0], &basis_root[sysdim], fft_dim-sysdim, MPI_DOUBLE, MPI_SUM, 0, world);

  if (me == 0){ // output dynamic matrix by root
@@ -772,7 +773,8 @@ void FixPhonon::postprocess( )
    }
    fflush(flog);
  }

  delete[] kbtsqrt;
  delete[] basis_root;
}   // end of postprocess

/* ----------------------------------------------------------------------