remove unused variables and reduce unused parameter warnings

This commit is contained in:
Axel Kohlmeyer 2019-10-14 16:42:21 +02:00
parent 4fca2f1f1d
commit 31aa68db31
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
12 changed files with 39 additions and 72 deletions

View File

@ -410,7 +410,7 @@ void EwaldDipole::compute(int eflag, int vflag)
int kx,ky,kz;
double cypz,sypz,exprl,expim;
double partial,partial2,partial_peratom;
double partial,partial_peratom;
double vcik[6];
double mudotk;
@ -503,7 +503,7 @@ void EwaldDipole::compute(int eflag, int vflag)
// global virial
if (vflag_global) {
double uk, vk;
double uk;
for (k = 0; k < kcount; k++) {
uk = ug[k] * (sfacrl_all[k]*sfacrl_all[k] + sfacim_all[k]*sfacim_all[k]);
for (j = 0; j < 6; j++) virial[j] += uk*vg[k][j] - vc[k][j];
@ -777,12 +777,10 @@ void EwaldDipole::slabcorr()
{
// compute local contribution to global dipole moment
double **x = atom->x;
double zprd = domain->zprd;
int nlocal = atom->nlocal;
double dipole = 0.0;
double **mu = atom->mu;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) dipole += mu[i][2];
// sum local contributions to get global dipole moment

View File

@ -482,7 +482,7 @@ void EwaldDipoleSpin::compute(int eflag, int vflag)
// global virial
if (vflag_global) {
double uk, vk;
double uk;
for (k = 0; k < kcount; k++) {
uk = ug[k] * (sfacrl_all[k]*sfacrl_all[k] + sfacim_all[k]*sfacim_all[k]);
for (j = 0; j < 6; j++) virial[j] += uk*vg[k][j] - vc[k][j];
@ -763,13 +763,11 @@ void EwaldDipoleSpin::slabcorr()
{
// compute local contribution to global dipole/spin moment
double **x = atom->x;
double zprd = domain->zprd;
int nlocal = atom->nlocal;
double spin = 0.0;
double **sp = atom->sp;
double spx,spy,spz;
double spz;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
spz = sp[i][2]*sp[i][3];
spin += spz;

View File

@ -534,10 +534,8 @@ void PPPMDipole::compute(int eflag, int vflag)
// energy includes self-energy correction
if (evflag_atom) {
double *q = atom->q;
double **mu = atom->mu;
int nlocal = atom->nlocal;
int ntotal = nlocal;
if (eflag_atom) {
for (i = 0; i < nlocal; i++) {
@ -926,11 +924,10 @@ double PPPMDipole::compute_qopt_dipole()
const double unitkz = (MY_2PI/zprd_slab);
double snx,sny,snz;
double cnx,cny,cnz;
double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz;
double sum1,sum2,dot1,dot2;
double numerator,denominator;
double u1,u2,u3,sqk;
double denominator;
double u1,sqk;
int k,l,m,nx,ny,nz,kper,lper,mper;
@ -943,22 +940,18 @@ double PPPMDipole::compute_qopt_dipole()
for (m = nzlo_fft; m <= nzhi_fft; m++) {
mper = m - nz_pppm*(2*m/nz_pppm);
snz = square(sin(0.5*unitkz*mper*zprd_slab/nz_pppm));
cnz = cos(0.5*unitkz*mper*zprd_slab/nz_pppm);
for (l = nylo_fft; l <= nyhi_fft; l++) {
lper = l - ny_pppm*(2*l/ny_pppm);
sny = square(sin(0.5*unitky*lper*yprd/ny_pppm));
cny = cos(0.5*unitky*lper*yprd/ny_pppm);
for (k = nxlo_fft; k <= nxhi_fft; k++) {
kper = k - nx_pppm*(2*k/nx_pppm);
snx = square(sin(0.5*unitkx*kper*xprd/nx_pppm));
cnx = cos(0.5*unitkx*kper*xprd/nx_pppm);
sqk = square(unitkx*kper) + square(unitky*lper) + square(unitkz*mper);
if (sqk != 0.0) {
numerator = MY_4PI/sqk;
denominator = gf_denom(snx,sny,snz);
sum1 = 0.0;
sum2 = 0.0;
@ -1021,10 +1014,9 @@ void PPPMDipole::compute_gf_dipole()
const double unitkz = (MY_2PI/zprd_slab);
double snx,sny,snz;
double cnx,cny,cnz;
double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz;
double sum1,dot1,dot2;
double numerator,denominator;
double denominator;
double sqk;
int k,l,m,n,nx,ny,nz,kper,lper,mper;
@ -1044,17 +1036,14 @@ void PPPMDipole::compute_gf_dipole()
for (m = nzlo_fft; m <= nzhi_fft; m++) {
mper = m - nz_pppm*(2*m/nz_pppm);
snz = square(sin(0.5*unitkz*mper*zprd_slab/nz_pppm));
cnz = cos(0.5*unitkz*mper*zprd_slab/nz_pppm);
for (l = nylo_fft; l <= nyhi_fft; l++) {
lper = l - ny_pppm*(2*l/ny_pppm);
sny = square(sin(0.5*unitky*lper*yprd/ny_pppm));
cny = cos(0.5*unitky*lper*yprd/ny_pppm);
for (k = nxlo_fft; k <= nxhi_fft; k++) {
kper = k - nx_pppm*(2*k/nx_pppm);
snx = square(sin(0.5*unitkx*kper*xprd/nx_pppm));
cnx = cos(0.5*unitkx*kper*xprd/nx_pppm);
sqk = square(unitkx*kper) + square(unitky*lper) + square(unitkz*mper);
@ -2389,12 +2378,10 @@ void PPPMDipole::slabcorr()
{
// compute local contribution to global dipole moment
double **x = atom->x;
double zprd = domain->zprd;
int nlocal = atom->nlocal;
double dipole = 0.0;
double **mu = atom->mu;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) dipole += mu[i][2];
// sum local contributions to get global dipole moment

View File

@ -663,13 +663,11 @@ void PPPMDipoleSpin::slabcorr()
{
// compute local contribution to global spin moment
double **x = atom->x;
double zprd = domain->zprd;
int nlocal = atom->nlocal;
double spin = 0.0;
double **sp = atom->sp;
double spx,spy,spz;
double spz;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
spz = sp[i][2]*sp[i][3];
spin += spz;

View File

@ -214,7 +214,7 @@ void ComputeHMA::init() {
neighbor->requests[irequest]->occasional = 1;
}
void ComputeHMA::init_list(int id, NeighList *ptr)
void ComputeHMA::init_list(int /* id */, NeighList *ptr)
{
list = ptr;
}
@ -318,11 +318,9 @@ void ComputeHMA::compute_vector()
double phiSum = 0.0;
if (computeCv>-1) {
comm->forward_comm_compute(this);
int *type = atom->type;
double** cutsq = force->pair->cutsq;
if (force->pair) {
double **x = atom->x;
double **f = atom->f;
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_lj = force->special_lj;
@ -459,16 +457,8 @@ double ComputeHMA::virial_compute(int n)
/* ---------------------------------------------------------------------- */
int ComputeHMA::pack_forward_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
int /* pbc_flag */, int * /* pbc */)
{
double **xoriginal = fix->astore;
imageint *image = atom->image;
double **x = atom->x;
double *h = domain->h;
double xprd = domain->xprd;
double yprd = domain->yprd;
double zprd = domain->zprd;
int m = 0;
for (int ii = 0; ii < n; ii++) {
int i = list[ii];
@ -483,7 +473,6 @@ int ComputeHMA::pack_forward_comm(int n, int *list, double *buf,
void ComputeHMA::unpack_forward_comm(int n, int first, double *buf)
{
double **xoriginal = fix->astore;
int i,m,last;
m = 0;

View File

@ -2827,7 +2827,7 @@ void FixBondReact::read(int myrxn)
// loop over sections of superimpose file
int equivflag = 0, edgeflag = 0, bondflag = 0, customedgesflag = 0;
int equivflag = 0, bondflag = 0, customedgesflag = 0;
while (strlen(keyword)) {
if (strcmp(keyword,"BondingIDs") == 0) {
bondflag = 1;
@ -2836,7 +2836,6 @@ void FixBondReact::read(int myrxn)
readline(line);
sscanf(line,"%d",&jbonding[myrxn]);
} else if (strcmp(keyword,"EdgeIDs") == 0) {
edgeflag = 1;
EdgeIDs(line, myrxn);
} else if (strcmp(keyword,"Equivalences") == 0) {
equivflag = 1;

View File

@ -446,9 +446,9 @@ void PairILPGrapheneHBN::compute(int eflag, int vflag)
van der Waals forces and energy
------------------------------------------------------------------------- */
void PairILPGrapheneHBN::calc_FvdW(int eflag, int vflag)
void PairILPGrapheneHBN::calc_FvdW(int eflag, int /* vflag */)
{
int i,j,ii,jj,inum,jnum,itype,jtype,k,l,kk,ll;
int i,j,ii,jj,inum,jnum,itype,jtype;
tagint itag,jtag;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r,Rcut,r2inv,r6inv,r8inv,Tap,dTap,Vilp,TSvdw,TSvdw2inv,fsum;
@ -544,15 +544,15 @@ void PairILPGrapheneHBN::calc_FvdW(int eflag, int vflag)
Repulsive forces and energy
------------------------------------------------------------------------- */
void PairILPGrapheneHBN::calc_FRep(int eflag, int vflag)
void PairILPGrapheneHBN::calc_FRep(int eflag, int /* vflag */)
{
int i,j,ii,jj,inum,jnum,itype,jtype,k,kk;
double prodnorm1,fkcx,fkcy,fkcz;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair,fpair1;
double rsq,r,Rcut,rhosq1,exp0,exp1,r2inv,r6inv,r8inv,Tap,dTap,Vilp;
double frho1,TSvdw,TSvdw2inv,Erep,fsum,rdsq1;
double rsq,r,Rcut,rhosq1,exp0,exp1,Tap,dTap,Vilp;
double frho1,Erep,fsum,rdsq1;
int *ilist,*jlist,*numneigh,**firstneigh;
int *ILP_neighs_i,*ILP_neighs_j;
int *ILP_neighs_i;
evdwl = 0.0;

View File

@ -448,9 +448,9 @@ void PairKolmogorovCrespiFull::compute(int eflag, int vflag)
van der Waals forces and energy
------------------------------------------------------------------------- */
void PairKolmogorovCrespiFull::calc_FvdW(int eflag, int vflag)
void PairKolmogorovCrespiFull::calc_FvdW(int eflag, int /* vflag */)
{
int i,j,ii,jj,inum,jnum,itype,jtype,k,l,kk,ll;
int i,j,ii,jj,inum,jnum,itype,jtype;
tagint itag,jtag;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r,Rcut,r2inv,r6inv,r8inv,Tap,dTap,Vkc,fsum;
@ -544,15 +544,15 @@ void PairKolmogorovCrespiFull::calc_FvdW(int eflag, int vflag)
Repulsive forces and energy
------------------------------------------------------------------------- */
void PairKolmogorovCrespiFull::calc_FRep(int eflag, int vflag)
void PairKolmogorovCrespiFull::calc_FRep(int eflag, int /* vflag */)
{
int i,j,ii,jj,inum,jnum,itype,jtype,k,kk;
double prodnorm1,fkcx,fkcy,fkcz;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair,fpair1;
double rsq,r,rhosq1,exp0,exp1,r2inv,r6inv,r8inv,Tap,dTap,Vkc;
double rsq,r,rhosq1,exp0,exp1,r2inv,r6inv,Tap,dTap,Vkc;
double frho_ij,sumC1,sumC11,sumCff,fsum,rho_ij;
int *ilist,*jlist,*numneigh,**firstneigh;
int *KC_neighs_i,*KC_neighs_j;
int *KC_neighs_i;
evdwl = 0.0;
@ -608,7 +608,7 @@ void PairKolmogorovCrespiFull::calc_FRep(int eflag, int vflag)
r = sqrt(rsq);
r2inv = 1.0/rsq;
r6inv = r2inv*r2inv*r2inv;
r8inv = r2inv*r6inv;
// turn on/off taper function
if (tap_flag) {
Tap = calc_Tap(r,sqrt(cutsq[itype][jtype]));

View File

@ -374,7 +374,7 @@ void PairLocalDensity::allocate()
global settings
------------------------------------------------------------------------- */
void PairLocalDensity::settings(int narg, char **arg)
void PairLocalDensity::settings(int narg, char ** /* arg */)
{
if (narg > 0) error->all(FLERR,"Illegal pair_style command");
}
@ -438,7 +438,7 @@ void PairLocalDensity::init_style()
init for one type pair i,j and corresponding j,i
------------------------------------------------------------------------- */
double PairLocalDensity::init_one(int i, int j)
double PairLocalDensity::init_one(int /* i */, int /* j */)
{
// single global cutoff = max of all uppercuts read in from LD file
@ -457,9 +457,9 @@ double PairLocalDensity::init_one(int i, int j)
of the LD potential without doing an actual MD run
---------------------------------------------------------------------------*/
double PairLocalDensity::single(int i, int j, int itype, int jtype, double rsq,
double factor_coul, double factor_lj,
double &fforce)
double PairLocalDensity::single(int /* i */, int /* j */, int itype, int jtype,
double rsq, double /* factor_coul */,
double /* factor_lj */, double &fforce)
{
int m, k, index;
double rsqinv, p, uLD;
@ -816,7 +816,8 @@ void PairLocalDensity::parse_file(char *filename) {
communication routines
------------------------------------------------------------------------- */
int PairLocalDensity::pack_comm(int n, int *list, double *buf, int pbc_flag, int *pbc) {
int PairLocalDensity::pack_comm(int n, int *list, double *buf,
int /* pbc_flag */, int * /* pbc */) {
int i,j,k;
int m;

View File

@ -51,13 +51,11 @@ int Init_ListsOMP( reax_system *system, control_params *control,
{
int i, total_hbonds, total_bonds, bond_cap, num_3body, cap_3body, Htop;
int *hb_top, *bond_top;
MPI_Comm comm;
int mincap = system->mincap;
double safezone = system->safezone;
double saferzone = system->saferzone;
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,

View File

@ -766,7 +766,6 @@ double PairHybrid::single(int i, int j, int itype, int jtype,
double fone;
fforce = 0.0;
double esum = 0.0;
int n = 0;
for (int m = 0; m < nmap[itype][jtype]; m++) {
if (rsq < styles[map[itype][jtype][m]]->cutsq[itype][jtype]) {

View File

@ -404,7 +404,7 @@ void Update::create_minimize(int narg, char **arg, int trysuffix)
create the Minimize style, first with suffix appended
------------------------------------------------------------------------- */
void Update::new_minimize(char *style, int narg, char **arg,
void Update::new_minimize(char *style, int /* narg */, char ** /* arg */,
int trysuffix, int &sflag)
{
if (trysuffix && lmp->suffix_enable) {