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

This commit is contained in:
Axel Kohlmeyer 2018-05-04 16:26:48 -04:00
parent eeee2d3026
commit 330f29db0b
1 changed files with 5 additions and 3 deletions

View File

@ -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
/* ----------------------------------------------------------------------