From 73b83321eb629092b6b9dded1af3df94658f82d9 Mon Sep 17 00:00:00 2001 From: Alexey Shvetsov Date: Sat, 29 Jun 2013 09:52:29 +0400 Subject: [PATCH] gmxana: clean up -Wunused-parameter warnings Clean up (most) of unused params Change-Id: Ic9a521924e467d3779ed8c137f7afce44b200378 Signed-off-by: Alexey Shvetsov --- src/gromacs/gmxana/anadih.c | 16 +++++++-------- src/gromacs/gmxana/autocorr.c | 8 +++----- src/gromacs/gmxana/dlist.c | 2 +- src/gromacs/gmxana/fitahx.c | 2 +- src/gromacs/gmxana/fitahx.h | 2 +- src/gromacs/gmxana/geminate.c | 2 +- src/gromacs/gmxana/geminate.h | 2 +- src/gromacs/gmxana/gmx_anadock.c | 6 ++---- src/gromacs/gmxana/gmx_analyze.c | 14 ++++++------- src/gromacs/gmxana/gmx_bar.c | 7 +++---- src/gromacs/gmxana/gmx_chi.c | 12 +++++------ src/gromacs/gmxana/gmx_cluster.c | 4 ++-- src/gromacs/gmxana/gmx_confrms.c | 12 +++++------ src/gromacs/gmxana/gmx_current.c | 4 ++-- src/gromacs/gmxana/gmx_densorder.c | 13 ++++++------ src/gromacs/gmxana/gmx_dipoles.c | 13 ++++++------ src/gromacs/gmxana/gmx_disre.c | 6 +++--- src/gromacs/gmxana/gmx_dos.c | 2 +- src/gromacs/gmxana/gmx_dyndom.c | 10 ++++----- src/gromacs/gmxana/gmx_energy.c | 12 +++++------ src/gromacs/gmxana/gmx_hbond.c | 21 +++++++++---------- src/gromacs/gmxana/gmx_helix.c | 16 +++++++-------- src/gromacs/gmxana/gmx_hydorder.c | 4 ++-- src/gromacs/gmxana/gmx_kinetics.c | 12 +++++------ src/gromacs/gmxana/gmx_mindist.c | 4 ++-- src/gromacs/gmxana/gmx_msd.c | 19 ++++++++--------- src/gromacs/gmxana/gmx_order.c | 5 ++--- src/gromacs/gmxana/gmx_pme_error.cpp | 2 +- src/gromacs/gmxana/gmx_sham.c | 8 +++----- src/gromacs/gmxana/gmx_sigeps.c | 4 ++-- src/gromacs/gmxana/gmx_sorient.c | 4 ++-- src/gromacs/gmxana/gmx_spol.c | 4 ++-- src/gromacs/gmxana/gmx_tcaf.c | 2 +- src/gromacs/gmxana/gmx_trjconv.c | 11 ++-------- src/gromacs/gmxana/gmx_wham.cpp | 14 ++++++------- src/gromacs/gmxana/gmx_wheel.c | 4 ++-- src/gromacs/gmxana/hxprops.c | 14 ++++++------- src/gromacs/gmxana/hxprops.h | 10 ++++----- src/gromacs/legacyheaders/gstat.h | 8 ++++---- src/gromacs/legacyheaders/types/simple.h | 26 ++++++++++++++++++++++++ 40 files changed, 171 insertions(+), 170 deletions(-) diff --git a/src/gromacs/gmxana/anadih.c b/src/gromacs/gmxana/anadih.c index 5c854a93f3..fdce1a092f 100644 --- a/src/gromacs/gmxana/anadih.c +++ b/src/gromacs/gmxana/anadih.c @@ -69,7 +69,7 @@ void print_one(const output_env_t oenv, const char *base, const char *name, ffclose(fp); } -static int calc_RBbin(real phi, int multiplicity, real core_frac) +static int calc_RBbin(real phi, int gmx_unused multiplicity, real gmx_unused core_frac) { /* multiplicity and core_frac NOT used, * just given to enable use of pt-to-fn in caller low_ana_dih_trans*/ @@ -338,7 +338,7 @@ void low_ana_dih_trans(gmx_bool bTrans, const char *fn_trans, } -void mk_multiplicity_lookup (int *multiplicity, int maxchi, real **dih, +void mk_multiplicity_lookup (int *multiplicity, int maxchi, int nlist, t_dlist dlist[], int nangles) { /* new by grs - for dihedral j (as in dih[j]) get multiplicity from dlist @@ -402,7 +402,7 @@ void mk_multiplicity_lookup (int *multiplicity, int maxchi, real **dih, } -void mk_chi_lookup (int **lookup, int maxchi, real **dih, +void mk_chi_lookup (int **lookup, int maxchi, int nlist, t_dlist dlist[]) { @@ -440,7 +440,7 @@ void mk_chi_lookup (int **lookup, int maxchi, real **dih, } -void get_chi_product_traj (real **dih, int nframes, int nangles, int nlist, +void get_chi_product_traj (real **dih, int nframes, int nlist, int maxchi, t_dlist dlist[], real time[], int **lookup, int *multiplicity, gmx_bool bRb, gmx_bool bNormalize, real core_frac, gmx_bool bAll, const char *fnall, @@ -667,7 +667,7 @@ void calc_distribution_props(int nh, int histo[], real start, *S2 = tdc*tdc+tds*tds; } -static void calc_angles(FILE *log, t_pbc *pbc, +static void calc_angles(t_pbc *pbc, int n3, atom_id index[], real ang[], rvec x_s[]) { int i, ix, t1, t2; @@ -721,7 +721,7 @@ static real calc_fraction(real angles[], int nangles) } } -static void calc_dihs(FILE *log, t_pbc *pbc, +static void calc_dihs(t_pbc *pbc, int n4, atom_id index[], real ang[], rvec x_s[]) { int i, ix, t1, t2, t3; @@ -870,11 +870,11 @@ void read_ang_dih(const char *trj_fn, if (bAngles) { - calc_angles(stdout, pbc, isize, index, angles[cur], x); + calc_angles(pbc, isize, index, angles[cur], x); } else { - calc_dihs(stdout, pbc, isize, index, angles[cur], x); + calc_dihs(pbc, isize, index, angles[cur], x); /* Trans fraction */ fraction = calc_fraction(angles[cur], nangles); diff --git a/src/gromacs/gmxana/autocorr.c b/src/gromacs/gmxana/autocorr.c index 5cc1e8403d..6ddced1088 100644 --- a/src/gromacs/gmxana/autocorr.c +++ b/src/gromacs/gmxana/autocorr.c @@ -55,7 +55,7 @@ typedef struct { unsigned long mode; - int nrestart, nout, P, fitfn, nskip; + int nrestart, nout, P, fitfn; gmx_bool bFour, bNormalize; real tbeginfit, tendfit; } t_acf; @@ -775,7 +775,7 @@ void low_do_autocorr(const char *fn, const output_env_t oenv, const char *title, real dt, unsigned long mode, int nrestart, gmx_bool bAver, gmx_bool bNormalize, gmx_bool bVerbose, real tbeginfit, real tendfit, - int eFitFn, int nskip) + int eFitFn) { FILE *fp, *gp = NULL; int i, k, nfour; @@ -983,8 +983,6 @@ t_pargs *add_acf_pargs(int *npargs, t_pargs *pa) "Order of Legendre polynomial for ACF (0 indicates none)" }, { "-fitfn", FALSE, etENUM, {s_ffn}, "Fit function" }, - { "-ncskip", FALSE, etINT, {&acf.nskip}, - "Skip this many points in the output file of correlation functions" }, { "-beginfit", FALSE, etREAL, {&acf.tbeginfit}, "Time where to begin the exponential fit of the correlation function" }, { "-endfit", FALSE, etREAL, {&acf.tendfit}, @@ -1051,7 +1049,7 @@ void do_autocorr(const char *fn, const output_env_t oenv, const char *title, low_do_autocorr(fn, oenv, title, nframes, nitem, acf.nout, c1, dt, mode, acf.nrestart, bAver, acf.bNormalize, bDebugMode(), acf.tbeginfit, acf.tendfit, - acf.fitfn, acf.nskip); + acf.fitfn); } int get_acfnout(void) diff --git a/src/gromacs/gmxana/dlist.c b/src/gromacs/gmxana/dlist.c index d2e7373be5..cb01f0ea75 100644 --- a/src/gromacs/gmxana/dlist.c +++ b/src/gromacs/gmxana/dlist.c @@ -322,7 +322,7 @@ gmx_bool has_dihedral(int Dih, t_dlist *dl) return b; } -static void pr_one_ro(FILE *fp, t_dlist *dl, int nDih, real dt) +static void pr_one_ro(FILE *fp, t_dlist *dl, int nDih, real gmx_unused dt) { int k; for (k = 0; k < NROT; k++) diff --git a/src/gromacs/gmxana/fitahx.c b/src/gromacs/gmxana/fitahx.c index 4c65b5032e..f4f1ac3104 100644 --- a/src/gromacs/gmxana/fitahx.c +++ b/src/gromacs/gmxana/fitahx.c @@ -70,7 +70,7 @@ static void my_sub_xcm(int nbb, atom_id bbind[], rvec x[], rvec xcm) real fit_ahx(int nres, t_bb bb[], int natoms, int nall, atom_id allindex[], rvec x[], int nca, - atom_id caindex[], matrix box, gmx_bool bFit) + atom_id caindex[], gmx_bool bFit) { static rvec *xref = NULL; static real *mass = NULL; diff --git a/src/gromacs/gmxana/fitahx.h b/src/gromacs/gmxana/fitahx.h index 0cb7137307..ad8c6191c6 100644 --- a/src/gromacs/gmxana/fitahx.h +++ b/src/gromacs/gmxana/fitahx.h @@ -41,6 +41,6 @@ #include "hxprops.h" extern real fit_ahx(int nres, t_bb bb[], int natoms, int nall, atom_id allindex[], - rvec x[], int nca, atom_id caindex[], matrix box, gmx_bool bFit); + rvec x[], int nca, atom_id caindex[], gmx_bool bFit); #endif diff --git a/src/gromacs/gmxana/geminate.c b/src/gromacs/gmxana/geminate.c index 717f5dd22c..7f852c3b32 100644 --- a/src/gromacs/gmxana/geminate.c +++ b/src/gromacs/gmxana/geminate.c @@ -525,7 +525,7 @@ static double getLogIndex(const int i, const t_gemParams *params) extern t_gemParams *init_gemParams(const double sigma, const double D, const real *t, const int len, const int nFitPoints, const real begFit, const real endFit, - const real ballistic, const int nBalExp, const gmx_bool bDt) + const real ballistic, const int nBalExp) { double tDelta; t_gemParams *p; diff --git a/src/gromacs/gmxana/geminate.h b/src/gromacs/gmxana/geminate.h index b5894c82fc..a3f5afd469 100644 --- a/src/gromacs/gmxana/geminate.h +++ b/src/gromacs/gmxana/geminate.h @@ -130,7 +130,7 @@ extern void takeAwayBallistic(double *ct, double *t, extern t_gemParams *init_gemParams(const double sigma, const double D, const real *t, const int len, const int nFitPoints, const real begFit, const real endFit, - const real ballistic, const int nBalExp, const gmx_bool bDt); + const real ballistic, const int nBalExp); /* Fit to geminate recombination model. Returns root mean square error of fit. */ diff --git a/src/gromacs/gmxana/gmx_anadock.c b/src/gromacs/gmxana/gmx_anadock.c index 1c68e21631..32859066e5 100644 --- a/src/gromacs/gmxana/gmx_anadock.c +++ b/src/gromacs/gmxana/gmx_anadock.c @@ -265,7 +265,7 @@ static void line(FILE *fp) } static void cluster_em_all(FILE *fp, int npdb, t_pdbfile *pdbf[], - const char *pdbout, gmx_bool bFree, gmx_bool bRMSD, real cutoff) + gmx_bool bFree, gmx_bool bRMSD, real cutoff) { int i, j, k; int *cndx, ncluster; @@ -353,7 +353,6 @@ int gmx_anadock(int argc, char *argv[]) }; t_filenm fnm[] = { { efPDB, "-f", NULL, ffREAD }, - { efPDB, "-ox", "cluster", ffWRITE }, { efXVG, "-od", "edocked", ffWRITE }, { efXVG, "-of", "efree", ffWRITE }, { efLOG, "-g", "anadock", ffWRITE } @@ -388,8 +387,7 @@ int gmx_anadock(int argc, char *argv[]) analyse_em_all(npdbf, pdbf, opt2fn("-od", NFILE, fnm), opt2fn("-of", NFILE, fnm), oenv); - cluster_em_all(fp, npdbf, pdbf, opt2fn("-ox", NFILE, fnm), - bFree, bRMS, cutoff); + cluster_em_all(fp, npdbf, pdbf, bFree, bRMS, cutoff); gmx_thanx(fp); ffclose(fp); diff --git a/src/gromacs/gmxana/gmx_analyze.c b/src/gromacs/gmxana/gmx_analyze.c index 6a48bb1a55..a15c074775 100644 --- a/src/gromacs/gmxana/gmx_analyze.c +++ b/src/gromacs/gmxana/gmx_analyze.c @@ -643,7 +643,7 @@ static void estimate_error(const char *eefile, int nb_min, int resol, int n, } low_do_autocorr(NULL, oenv, NULL, n, 1, -1, &ac, dt, eacNormal, 1, FALSE, TRUE, - FALSE, 0, 0, effnNONE, 0); + FALSE, 0, 0, effnNONE); fitlen = n/nb_min; @@ -737,8 +737,7 @@ static void luzar_correl(int nn, real *time, int nset, real **val, real temp, } } -static void filter(real flen, int n, int nset, real **val, real dt, - const output_env_t oenv) +static void filter(real flen, int n, int nset, real **val, real dt) { int f, s, i, j; double *filt, sum, vf, fluc, fluctot; @@ -886,11 +885,10 @@ static void do_fit(FILE *out, int n, gmx_bool bYdy, static void do_ballistic(const char *balFile, int nData, real *t, real **val, int nSet, real balTime, int nBalExp, - gmx_bool bDerivative, const output_env_t oenv) { double **ctd = NULL, *td = NULL; - t_gemParams *GP = init_gemParams(0, 0, t, nData, 0, 0, 0, balTime, nBalExp, bDerivative); + t_gemParams *GP = init_gemParams(0, 0, t, nData, 0, 0, 0, balTime, nBalExp); static char *leg[] = {"Ac'(t)"}; FILE *fp; int i, set; @@ -951,7 +949,7 @@ static void do_geminate(const char *gemFile, int nData, { double **ctd = NULL, **ctdGem = NULL, *td = NULL; t_gemParams *GP = init_gemParams(rcut, D, t, nData, nFitPoints, - begFit, endFit, balTime, 1, FALSE); + begFit, endFit, balTime, 1); const char *leg[] = {"Ac\\sgem\\N(t)"}; FILE *fp; int i, set; @@ -1326,7 +1324,7 @@ int gmx_analyze(int argc, char *argv[]) if (filtlen) { - filter(filtlen, n, nset, val, dt, oenv); + filter(filtlen, n, nset, val, dt); } if (msdfile) @@ -1378,7 +1376,7 @@ int gmx_analyze(int argc, char *argv[]) } if (balfile) { - do_ballistic(balfile, n, t, val, nset, balTime, nBalExp, bDer, oenv); + do_ballistic(balfile, n, t, val, nset, balTime, nBalExp, oenv); } /* if (gemfile) */ /* do_geminate(gemfile,n,t,val,nset,diffusion,rcut,balTime, */ diff --git a/src/gromacs/gmxana/gmx_bar.c b/src/gromacs/gmxana/gmx_bar.c index c3e86fe453..f29509423f 100644 --- a/src/gromacs/gmxana/gmx_bar.c +++ b/src/gromacs/gmxana/gmx_bar.c @@ -2433,7 +2433,6 @@ static gmx_bool read_lambda_vector(const char *str, */ static gmx_bool legend2lambda(const char *fn, const char *legend, - xvg_t *ba, lambda_vec_t *lam) { double lambda = 0; @@ -2679,7 +2678,7 @@ static gmx_bool subtitle2lambda(const char *subtitle, xvg_t *ba, const char *fn, return bFound; } -static void filename2lambda(const char *fn, xvg_t *ba) +static void filename2lambda(const char *fn) { double lambda; const char *ptr, *digitptr; @@ -2807,7 +2806,7 @@ static void read_bar_xvg_lowlevel(const char *fn, real *temp, xvg_t *ba, if (!native_lambda_read) { /* Deduce lambda from the file name */ - filename2lambda(fn, ba); + filename2lambda(fn); native_lambda_read = TRUE; } ba->lambda[0] = ba->native_lambda; @@ -2825,7 +2824,7 @@ static void read_bar_xvg_lowlevel(const char *fn, real *temp, xvg_t *ba, /* Read lambda from the legend */ lambda_vec_init( &(ba->lambda[i]), lc ); lambda_vec_copy( &(ba->lambda[i]), &(ba->native_lambda)); - use = legend2lambda(fn, legend[i], ba, &(ba->lambda[i])); + use = legend2lambda(fn, legend[i], &(ba->lambda[i])); if (use) { lambda_vec_print(&(ba->lambda[i]), buf, FALSE); diff --git a/src/gromacs/gmxana/gmx_chi.c b/src/gromacs/gmxana/gmx_chi.c index 24f2fec9c0..0bdd7446d7 100644 --- a/src/gromacs/gmxana/gmx_chi.c +++ b/src/gromacs/gmxana/gmx_chi.c @@ -995,8 +995,7 @@ static void do_rama(int nf, int nlist, t_dlist dlist[], real **dih, static void print_transitions(const char *fn, int maxchi, int nlist, - t_dlist dlist[], t_atoms *atoms, rvec x[], - matrix box, gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, real dt, + t_dlist dlist[], real dt, const output_env_t oenv) { /* based on order_params below */ @@ -1482,7 +1481,7 @@ int gmx_chi(int argc, char *argv[]) * added multiplicity */ snew(multiplicity, ndih); - mk_multiplicity_lookup(multiplicity, maxchi, dih, nlist, dlist, ndih); + mk_multiplicity_lookup(multiplicity, maxchi, nlist, dlist, ndih); strcpy(grpname, "All residues, "); if (bPhi) @@ -1533,8 +1532,7 @@ int gmx_chi(int argc, char *argv[]) /* transitions to xvg */ if (bDo_rt) { - print_transitions(opt2fn("-rt", NFILE, fnm), maxchi, nlist, dlist, - &atoms, x, box, bPhi, bPsi, bChi, traj_t_ns, oenv); + print_transitions(opt2fn("-rt", NFILE, fnm), maxchi, nlist, dlist, traj_t_ns, oenv); } /* chi_product trajectories (ie one "rotamer number" for each residue) */ @@ -1545,9 +1543,9 @@ int gmx_chi(int argc, char *argv[]) { snew(chi_lookup[i], maxchi); } - mk_chi_lookup(chi_lookup, maxchi, dih, nlist, dlist); + mk_chi_lookup(chi_lookup, maxchi, nlist, dlist); - get_chi_product_traj(dih, nf, nactdih, nlist, + get_chi_product_traj(dih, nf, nactdih, maxchi, dlist, time, chi_lookup, multiplicity, FALSE, bNormHisto, core_frac, bAll, opt2fn("-cp", NFILE, fnm), oenv); diff --git a/src/gromacs/gmxana/gmx_cluster.c b/src/gromacs/gmxana/gmx_cluster.c index 78c1634ff4..dd4b940ec5 100644 --- a/src/gromacs/gmxana/gmx_cluster.c +++ b/src/gromacs/gmxana/gmx_cluster.c @@ -781,7 +781,7 @@ rvec **read_whole_trj(const char *fn, int isize, atom_id index[], int skip, } static int plot_clusters(int nf, real **mat, t_clusters *clust, - int nlevels, int minstruct) + int minstruct) { int i, j, ncluster, ci; int *cl_id, *nstruct, *strind; @@ -1805,7 +1805,7 @@ int gmx_cluster(int argc, char *argv[]) { if (minstruct > 1) { - ncluster = plot_clusters(nf, rms->mat, &clust, nlevels, minstruct); + ncluster = plot_clusters(nf, rms->mat, &clust, minstruct); } else { diff --git a/src/gromacs/gmxana/gmx_confrms.c b/src/gromacs/gmxana/gmx_confrms.c index 40286ec398..b7a77d6922 100644 --- a/src/gromacs/gmxana/gmx_confrms.c +++ b/src/gromacs/gmxana/gmx_confrms.c @@ -123,9 +123,9 @@ int debug_strcmp(char s1[], char s2[]) return strcmp(s1, s2); } -int find_next_match_atoms_in_res(int *i1, int isize1, atom_id index1[], +int find_next_match_atoms_in_res(int *i1, atom_id index1[], int m1, char **atnms1[], - int *i2, int isize2, atom_id index2[], + int *i2, atom_id index2[], int m2, char **atnms2[]) { int dx, dy, dmax, cmp; @@ -388,8 +388,8 @@ void find_matching_names(int *isize1, atom_id index1[], t_atoms *atoms1, { fprintf(debug, " [%d<%d %d<%d]", i1, m1, i2, m2); } - atcmp = find_next_match_atoms_in_res(&i1, *isize1, index1, m1, atnms1, - &i2, *isize2, index2, m2, atnms2); + atcmp = find_next_match_atoms_in_res(&i1, index1, m1, atnms1, + &i2, index2, m2, atnms2); if (debug) { fprintf(debug, " -> %d %d %s-%s", i1, i2, @@ -425,8 +425,8 @@ void find_matching_names(int *isize1, atom_id index1[], t_atoms *atoms1, { fprintf(debug, " [%d<%d %d<%d]", i1, m1, i2, m2); } - atcmp = find_next_match_atoms_in_res(&i1, *isize1, index1, m1, atnms1, - &i2, *isize2, index2, m2, atnms2); + atcmp = find_next_match_atoms_in_res(&i1, index1, m1, atnms1, + &i2, index2, m2, atnms2); if (debug) { fprintf(debug, " -> %d %d %s-%s", i1, i2, diff --git a/src/gromacs/gmxana/gmx_current.c b/src/gromacs/gmxana/gmx_current.c index e81132b731..de82a7db1d 100644 --- a/src/gromacs/gmxana/gmx_current.c +++ b/src/gromacs/gmxana/gmx_current.c @@ -325,7 +325,7 @@ static real calc_cacf(FILE *fcacf, real prefactor, real cacf[], real time[], int } -static void calc_mjdsp(FILE *fmjdsp, real vol, real temp, real prefactor, rvec mjdsp[], real dsp2[], real time[], int nfr, real refr[]) +static void calc_mjdsp(FILE *fmjdsp, real prefactor, real dsp2[], real time[], int nfr, real refr[]) { int i; @@ -630,7 +630,7 @@ static void dielectric(FILE *fmj, FILE *fmd, FILE *outf, FILE *fcur, FILE *mcor, fprintf(stderr, "Prefactor fit E-H: 1 / 6.0*V*k_B*T: %g\n", prefactorav); - calc_mjdsp(fmjdsp, volume_av, temp, prefactorav, mjdsp, dsp2, time, nfr, xshfr); + calc_mjdsp(fmjdsp, prefactorav, dsp2, time, nfr, xshfr); /* * Now we can average and calculate the correlation functions diff --git a/src/gromacs/gmxana/gmx_densorder.c b/src/gromacs/gmxana/gmx_densorder.c index 1a61fc6caf..fee0f4915d 100644 --- a/src/gromacs/gmxana/gmx_densorder.c +++ b/src/gromacs/gmxana/gmx_densorder.c @@ -101,7 +101,7 @@ static void center_coords(t_atoms *atoms, matrix box, rvec x0[], int axis) } -static void density_in_time (const char *fn, atom_id **index, int gnx[], int grpn, real bw, real bwz, int nsttblock, real *****Densdevel, int *xslices, int *yslices, int *zslices, int *tblock, t_topology *top, int ePBC, int axis, gmx_bool bCenter, gmx_bool bps1d, const output_env_t oenv) +static void density_in_time (const char *fn, atom_id **index, int gnx[], real bw, real bwz, int nsttblock, real *****Densdevel, int *xslices, int *yslices, int *zslices, int *tblock, t_topology *top, int ePBC, int axis, gmx_bool bCenter, gmx_bool bps1d, const output_env_t oenv) { /* @@ -667,7 +667,6 @@ int gmx_densorder(int argc, char *argv[]) static int nsttblock = 100; static int axis = 2; static char *axtitle = "Z"; - static int ngrps = 1; atom_id **index; /* Index list for single group*/ int xslices, yslices, zslices, tblock; static gmx_bool bGraph = FALSE; @@ -736,16 +735,16 @@ int gmx_densorder(int argc, char *argv[]) bGraph = opt2bSet("-og", NFILE, fnm); bOut = opt2bSet("-o", NFILE, fnm); top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); - snew(grpname, ngrps); - snew(index, ngrps); - snew(ngx, ngrps); + snew(grpname, 1); + snew(index, 1); + snew(ngx, 1); /* Calculate axis */ axis = toupper(axtitle[0]) - 'X'; - get_index(&top->atoms, ftp2fn_null(efNDX, NFILE, fnm), ngrps, ngx, index, grpname); + get_index(&top->atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, ngx, index, grpname); - density_in_time(ftp2fn(efTRX, NFILE, fnm), index, ngx, ngrps, binw, binwz, nsttblock, &Densmap, &xslices, &yslices, &zslices, &tblock, top, ePBC, axis, bCenter, b1d, oenv); + density_in_time(ftp2fn(efTRX, NFILE, fnm), index, ngx, binw, binwz, nsttblock, &Densmap, &xslices, &yslices, &zslices, &tblock, top, ePBC, axis, bCenter, b1d, oenv); if (ftorder > 0) { diff --git a/src/gromacs/gmxana/gmx_dipoles.c b/src/gromacs/gmxana/gmx_dipoles.c index 473ffc4e5b..b4fc0d7a02 100644 --- a/src/gromacs/gmxana/gmx_dipoles.c +++ b/src/gromacs/gmxana/gmx_dipoles.c @@ -726,7 +726,7 @@ static void do_dip(t_topology *top, int ePBC, real volume, gmx_bool bPhi, int *nlevels, int ndegrees, int ncos, const char *cmap, real rcmax, - gmx_bool bQuad, const char *quadfn, + gmx_bool bQuad, gmx_bool bMU, const char *mufn, int *gnx, int *molindex[], real mu_max, real mu_aver, @@ -1530,7 +1530,7 @@ int gmx_dipoles(int argc, char *argv[]) }; real mu_max = 5, mu_aver = -1, rcmax = 0; real epsilonRF = 0.0, temp = 300; - gmx_bool bAverCorr = FALSE, bMolCorr = FALSE, bPairs = TRUE, bPhi = FALSE; + gmx_bool bAverCorr = FALSE, bMolCorr = FALSE, bPairs = TRUE, bPhi = FALSE, bQuad = FALSE; const char *corrtype[] = {NULL, "none", "mol", "molsep", "total", NULL}; const char *axtitle = "Z"; int nslices = 10; /* nr of slices defined */ @@ -1552,6 +1552,8 @@ int gmx_dipoles(int argc, char *argv[]) "Correlation function to calculate" }, { "-pairs", FALSE, etBOOL, {&bPairs}, "Calculate [MAG][COS][GRK]theta[grk][cos][mag] between all pairs of molecules. May be slow" }, + { "-quad", FALSE, etBOOL, {&bQuad}, + "Take quadrupole into account"}, { "-ncos", FALSE, etINT, {&ncos}, "Must be 1 or 2. Determines whether the [CHEVRON][COS][GRK]theta[grk][cos][chevron] is computed between all molecules in one group, or between molecules in two different groups. This turns on the [TT]-g[tt] flag." }, { "-axis", FALSE, etSTR, {&axtitle}, @@ -1575,7 +1577,7 @@ int gmx_dipoles(int argc, char *argv[]) int nFF[2]; atom_id **grpindex; char **grpname = NULL; - gmx_bool bCorr, bQuad, bGkr, bMU, bSlab; + gmx_bool bCorr, bGkr, bMU, bSlab; t_filenm fnm[] = { { efEDR, "-en", NULL, ffOPTRD }, { efTRX, "-f", NULL, ffREAD }, @@ -1591,7 +1593,6 @@ int gmx_dipoles(int argc, char *argv[]) { efXVG, "-dip3d", "dip3d", ffOPTWR }, { efXVG, "-cos", "cosaver", ffOPTWR }, { efXPM, "-cmap", "cmap", ffOPTWR }, - { efXVG, "-q", "quadrupole", ffOPTWR }, { efXVG, "-slab", "slab", ffOPTWR } }; #define NFILE asize(fnm) @@ -1619,7 +1620,6 @@ int gmx_dipoles(int argc, char *argv[]) { gmx_fatal(FARGS, "Due to new ways of treating molecules in GROMACS the total dipole in the energy file may be incorrect, because molecules can be split over periodic boundary conditions before computing the dipole. Please use your trajectory file."); } - bQuad = opt2bSet("-q", NFILE, fnm); bGkr = opt2bSet("-g", NFILE, fnm); if (opt2parg_bSet("-ncos", asize(pa), pa)) { @@ -1679,8 +1679,7 @@ int gmx_dipoles(int argc, char *argv[]) bPhi, &nlevels, ndegrees, ncos, opt2fn("-cmap", NFILE, fnm), rcmax, - bQuad, opt2fn("-q", NFILE, fnm), - bMU, opt2fn("-en", NFILE, fnm), + bQuad, bMU, opt2fn("-en", NFILE, fnm), gnx, grpindex, mu_max, mu_aver, epsilonRF, temp, nFF, skip, bSlab, nslices, axtitle, opt2fn("-slab", NFILE, fnm), oenv); diff --git a/src/gromacs/gmxana/gmx_disre.c b/src/gromacs/gmxana/gmx_disre.c index 0dea4511aa..87bf8639e4 100644 --- a/src/gromacs/gmxana/gmx_disre.c +++ b/src/gromacs/gmxana/gmx_disre.c @@ -144,7 +144,7 @@ static void print5(FILE *fp) static void check_viol(FILE *log, t_commrec *cr, t_ilist *disres, t_iparams forceparams[], - t_functype functype[], rvec x[], rvec f[], + rvec x[], rvec f[], t_forcerec *fr, t_pbc *pbc, t_graph *g, t_dr_result dr[], int clust_id, int isize, atom_id index[], real vvindex[], t_fcdata *fcd) @@ -859,13 +859,13 @@ int gmx_disre(int argc, char *argv[]) my_clust = clust->inv_clust[j]; range_check(my_clust, 0, clust->clust->nr); check_viol(fplog, cr, &(top->idef.il[F_DISRES]), - top->idef.iparams, top->idef.functype, + top->idef.iparams, x, f, fr, pbc_null, g, dr_clust, my_clust, isize, index, vvindex, &fcd); } else { check_viol(fplog, cr, &(top->idef.il[F_DISRES]), - top->idef.iparams, top->idef.functype, + top->idef.iparams, x, f, fr, pbc_null, g, &dr, 0, isize, index, vvindex, &fcd); } if (bPDB) diff --git a/src/gromacs/gmxana/gmx_dos.c b/src/gromacs/gmxana/gmx_dos.c index 3a03d45418..42c5384e7e 100644 --- a/src/gromacs/gmxana/gmx_dos.c +++ b/src/gromacs/gmxana/gmx_dos.c @@ -407,7 +407,7 @@ int gmx_dos(int argc, char *argv[]) gnx, nframes); } low_do_autocorr(NULL, oenv, NULL, nframes, gnx, nframes, c1, dt, eacNormal, 0, FALSE, - FALSE, FALSE, -1, -1, 0, 0); + FALSE, FALSE, -1, -1, 0); snew(dos, DOS_NR); for (j = 0; (j < DOS_NR); j++) { diff --git a/src/gromacs/gmxana/gmx_dyndom.c b/src/gromacs/gmxana/gmx_dyndom.c index a72bb7a61f..e5cae1a55f 100644 --- a/src/gromacs/gmxana/gmx_dyndom.c +++ b/src/gromacs/gmxana/gmx_dyndom.c @@ -50,13 +50,13 @@ static void rot_conf(t_atoms *atoms, rvec x[], rvec v[], real trans, real angle, - rvec head, rvec tail, matrix box, int isize, atom_id index[], + rvec head, rvec tail, int isize, atom_id index[], rvec xout[], rvec vout[]) { - rvec arrow, center, xcm; + rvec arrow, xcm; real theta, phi, arrow_len; - mat4 Rx, Ry, Rz, Rinvy, Rinvz, Mtot, Tcm, Tinvcm, Tx; - mat4 temp1, temp2, temp3, temp4, temp21, temp43; + mat4 Rx, Ry, Rz, Rinvy, Rinvz, Mtot; + mat4 temp1, temp2, temp3; vec4 xv; int i, j, ai; @@ -229,7 +229,7 @@ int gmx_dyndom(int argc, char *argv[]) trans = trans0*0.1*angle/maxangle; printf("Frame: %2d (label %c), angle: %8.3f deg., trans: %8.3f nm\n", i, label, angle, trans); - rot_conf(&atoms, x, v, trans, angle, head, tail, box, isize, index, xout, vout); + rot_conf(&atoms, x, v, trans, angle, head, tail, isize, index, xout, vout); if (label > 'Z') { diff --git a/src/gromacs/gmxana/gmx_energy.c b/src/gromacs/gmxana/gmx_energy.c index 0ee09ca6e1..409319c07e 100644 --- a/src/gromacs/gmxana/gmx_energy.c +++ b/src/gromacs/gmxana/gmx_energy.c @@ -973,7 +973,7 @@ static void remove_drift(int nset, int nbmin, int nbmax, real dt, enerdata_t *ed static void calc_fluctuation_props(FILE *fp, gmx_bool bDriftCorr, real dt, - int nset, int set[], int nmol, + int nset, int nmol, char **leg, enerdata_t *edat, int nbmin, int nbmax) { @@ -1129,7 +1129,7 @@ static void calc_fluctuation_props(FILE *fp, } static void analyse_ener(gmx_bool bCorr, const char *corrfn, - gmx_bool bFee, gmx_bool bSum, gmx_bool bFluct, gmx_bool bTempFluct, + gmx_bool bFee, gmx_bool bSum, gmx_bool bFluct, gmx_bool bVisco, const char *visfn, int nmol, gmx_large_int_t start_step, double start_t, gmx_large_int_t step, double t, @@ -1385,13 +1385,13 @@ static void analyse_ener(gmx_bool bCorr, const char *corrfn, strcpy(buf, "Shear Viscosity"); low_do_autocorr(corrfn, oenv, buf, edat->nframes, 3, (edat->nframes+1)/2, eneset, Dt, - eacNormal, 1, TRUE, FALSE, FALSE, 0.0, 0.0, 0, 1); + eacNormal, 1, TRUE, FALSE, FALSE, 0.0, 0.0, 0); /* Now for bulk viscosity */ strcpy(buf, "Bulk Viscosity"); low_do_autocorr(corrfn, oenv, buf, edat->nframes, 1, (edat->nframes+1)/2, &(eneset[11]), Dt, - eacNormal, 1, TRUE, FALSE, FALSE, 0.0, 0.0, 0, 1); + eacNormal, 1, TRUE, FALSE, FALSE, 0.0, 0.0, 0); factor = (Vaver*1e-26/(BOLTZMANN*Temp))*Dt; fp = xvgropen(visfn, buf, "Time (ps)", "\\8h\\4 (cp)", oenv); @@ -2791,7 +2791,7 @@ int gmx_energy(int argc, char *argv[]) { double dt = (frame[cur].t-start_t)/(edat.nframes-1); analyse_ener(opt2bSet("-corr", NFILE, fnm), opt2fn("-corr", NFILE, fnm), - bFee, bSum, bFluct, opt2parg_bSet("-nmol", npargs, ppa), + bFee, bSum, opt2parg_bSet("-nmol", npargs, ppa), bVisco, opt2fn("-vis", NFILE, fnm), nmol, start_step, start_t, frame[cur].step, frame[cur].t, @@ -2800,7 +2800,7 @@ int gmx_energy(int argc, char *argv[]) oenv); if (bFluctProps) { - calc_fluctuation_props(stdout, bDriftCorr, dt, nset, set, nmol, leg, &edat, + calc_fluctuation_props(stdout, bDriftCorr, dt, nset, nmol, leg, &edat, nbmin, nbmax); } } diff --git a/src/gromacs/gmxana/gmx_hbond.c b/src/gromacs/gmxana/gmx_hbond.c index 5fff37049f..8c9cd720b9 100644 --- a/src/gromacs/gmxana/gmx_hbond.c +++ b/src/gromacs/gmxana/gmx_hbond.c @@ -352,7 +352,7 @@ static t_hbdata *mk_hbdata(gmx_bool bHBmap, gmx_bool bDAnr, gmx_bool oneHB, gmx_ return hb; } -static void mk_hbmap(t_hbdata *hb, gmx_bool bTwo) +static void mk_hbmap(t_hbdata *hb) { int i, j; @@ -2718,7 +2718,7 @@ static void normalizeACF(real *ct, real *gt, int nhb, int len) static void do_hbac(const char *fn, t_hbdata *hb, int nDump, gmx_bool bMerge, gmx_bool bContact, real fit_start, real temp, gmx_bool R2, real smooth_tail_start, const output_env_t oenv, - t_gemParams *params, const char *gemType, int nThreads, + const char *gemType, int nThreads, const int NN, const gmx_bool bBallistic, const gmx_bool bGemFit) { FILE *fp; @@ -3142,7 +3142,7 @@ static void do_hbac(const char *fn, t_hbdata *hb, if (rHbExGem[m][0] > 0 && n0+poff[m] < nn /* && m==0 */) { low_do_autocorr(NULL, oenv, NULL, nframes, 1, -1, &(rHbExGem[m]), hb->time[1]-hb->time[0], - eacNormal, 1, FALSE, bNorm, FALSE, 0, -1, 0, 1); + eacNormal, 1, FALSE, bNorm, FALSE, 0, -1, 0); for (j = 0; (j < nn); j++) { __ACDATA[j] += rHbExGem[m][j]; @@ -3337,7 +3337,7 @@ static void do_hbac(const char *fn, t_hbdata *hb, /* The autocorrelation function is normalized after summation only */ low_do_autocorr(NULL, oenv, NULL, nframes, 1, -1, &rhbex, hb->time[1]-hb->time[0], - eacNormal, 1, FALSE, bNorm, FALSE, 0, -1, 0, 1); + eacNormal, 1, FALSE, bNorm, FALSE, 0, -1, 0); /* Cross correlation analysis for thermodynamics */ for (j = nframes; (j < n2); j++) @@ -3619,8 +3619,7 @@ static void dump_hbmap(t_hbdata *hb, /* sync_hbdata() updates the parallel t_hbdata p_hb using hb as template. * It mimics add_frames() and init_frame() to some extent. */ -static void sync_hbdata(t_hbdata *hb, t_hbdata *p_hb, - int nframes, real t) +static void sync_hbdata(t_hbdata *p_hb, int nframes) { int i; if (nframes >= p_hb->max_frames) @@ -3729,7 +3728,7 @@ int gmx_hbond(int argc, char *argv[]) static int nDump = 0, nFitPoints = 100; static int nThreads = 0, nBalExp = 4; - static gmx_bool bContact = FALSE, bBallistic = FALSE, bBallisticDt = FALSE, bGemFit = FALSE; + static gmx_bool bContact = FALSE, bBallistic = FALSE, bGemFit = FALSE; static real logAfterTime = 10, gemBallistic = 0.2; /* ps */ static const char *NNtype[] = {NULL, "none", "binary", "oneOverR3", "dipole", NULL}; @@ -4090,7 +4089,7 @@ int gmx_hbond(int argc, char *argv[]) { printf("Making hbmap structure..."); /* Generate hbond data structure */ - mk_hbmap(hb, bTwo); + mk_hbmap(hb); printf("done.\n"); } @@ -4270,7 +4269,7 @@ int gmx_hbond(int argc, char *argv[]) if (bOMP) { - sync_hbdata(hb, p_hb[threadNr], nframes, t); + sync_hbdata(p_hb[threadNr], nframes); } #pragma omp single { @@ -4746,7 +4745,7 @@ int gmx_hbond(int argc, char *argv[]) if (bGem || bNN) { params = init_gemParams(rcut, D, hb->time, hb->nframes/2, nFitPoints, fit_start, fit_end, - gemBallistic, nBalExp, bBallisticDt); + gemBallistic, nBalExp); if (params == NULL) { gmx_fatal(FARGS, "Could not initiate t_gemParams params."); @@ -4755,7 +4754,7 @@ int gmx_hbond(int argc, char *argv[]) gemstring = strdup(gemType[hb->per->gemtype]); do_hbac(opt2fn("-ac", NFILE, fnm), hb, nDump, bMerge, bContact, fit_start, temp, r2cut > 0, smooth_tail_start, oenv, - params, gemstring, nThreads, NN, bBallistic, bGemFit); + gemstring, nThreads, NN, bBallistic, bGemFit); } if (opt2bSet("-life", NFILE, fnm)) { diff --git a/src/gromacs/gmxana/gmx_helix.c b/src/gromacs/gmxana/gmx_helix.c index 54b0bafc29..883ff82b7f 100644 --- a/src/gromacs/gmxana/gmx_helix.c +++ b/src/gromacs/gmxana/gmx_helix.c @@ -260,8 +260,8 @@ int gmx_helix(int argc, char *argv[]) snew(xref, top->atoms.nr); read_tpx(ftp2fn(efTPX, NFILE, fnm), NULL, NULL, &natoms, xref, NULL, NULL, NULL); - calc_hxprops(nres, bb, xref, box); - do_start_end(nres, bb, xref, &nbb, bbindex, &nca, caindex, bRange, rStart, rEnd); + calc_hxprops(nres, bb, xref); + do_start_end(nres, bb, &nbb, bbindex, &nca, caindex, bRange, rStart, rEnd); sfree(xref); if (bDBG) { @@ -282,15 +282,15 @@ int gmx_helix(int argc, char *argv[]) gmx_rmpbc(gpbc, natoms, box, x); - calc_hxprops(nres, bb, x, box); + calc_hxprops(nres, bb, x); if (bCheck) { - do_start_end(nres, bb, x, &nbb, bbindex, &nca, caindex, FALSE, 0, 0); + do_start_end(nres, bb, &nbb, bbindex, &nca, caindex, FALSE, 0, 0); } if (nca >= 5) { - rms = fit_ahx(nres, bb, natoms, nall, allindex, x, nca, caindex, box, bFit); + rms = fit_ahx(nres, bb, natoms, nall, allindex, x, nca, caindex, bFit); if (teller == 1) { @@ -299,13 +299,13 @@ int gmx_helix(int argc, char *argv[]) } xf[efhRAD].val = radius(xf[efhRAD].fp2, nca, caindex, x); - xf[efhTWIST].val = twist(xf[efhTWIST].fp2, nca, caindex, x); + xf[efhTWIST].val = twist(nca, caindex, x); xf[efhRISE].val = rise(nca, caindex, x); - xf[efhLEN].val = ahx_len(nca, caindex, x, box); + xf[efhLEN].val = ahx_len(nca, caindex, x); xf[efhCD222].val = ellipticity(nres, bb); xf[efhDIP].val = dip(nbb, bbindex, x, top->atoms.atom); xf[efhRMS].val = rms; - xf[efhCPHI].val = ca_phi(nca, caindex, x, box); + xf[efhCPHI].val = ca_phi(nca, caindex, x); xf[efhPPRMS].val = pprms(xf[efhPPRMS].fp2, nres, bb); for (j = 0; (j <= efhCPHI); j++) diff --git a/src/gromacs/gmxana/gmx_hydorder.c b/src/gromacs/gmxana/gmx_hydorder.c index abf30f4eca..e742d16182 100644 --- a/src/gromacs/gmxana/gmx_hydorder.c +++ b/src/gromacs/gmxana/gmx_hydorder.c @@ -87,7 +87,7 @@ static void check_length(real length, int a, int b) static void find_tetra_order_grid(t_topology top, int ePBC, int natoms, matrix box, rvec x[], int maxidx, atom_id index[], - real time, real *sgmean, real *skmean, + real *sgmean, real *skmean, int nslicex, int nslicey, int nslicez, real ***sggrid, real ***skgrid) { @@ -367,7 +367,7 @@ static void calc_tetra_order_interface(const char *fnNDX, const char *fnTPS, con } } - find_tetra_order_grid(top, ePBC, natoms, box, x, isize[0], index[0], t, + find_tetra_order_grid(top, ePBC, natoms, box, x, isize[0], index[0], &sg, &sk, *nslicex, *nslicey, nslicez, sg_grid, sk_grid); for (i = 0; i < *nslicex; i++) { diff --git a/src/gromacs/gmxana/gmx_kinetics.c b/src/gromacs/gmxana/gmx_kinetics.c index f3da5028a5..f3a3168828 100644 --- a/src/gromacs/gmxana/gmx_kinetics.c +++ b/src/gromacs/gmxana/gmx_kinetics.c @@ -377,7 +377,7 @@ static double my_f(const gsl_vector *v, void *params) } } -static void optimize_remd_parameters(FILE *fp, t_remd_data *d, int maxiter, +static void optimize_remd_parameters(t_remd_data *d, int maxiter, real tol) { real size, d2; @@ -1002,7 +1002,7 @@ int gmx_kinetics(int argc, char *argv[]) preprocess_remd(fp, &remd, cutoff, tref, ucut, bBack, Euf, Efu, Ei, t0, t1, bSum, bDiscrete, nmult); - optimize_remd_parameters(fp, &remd, maxiter, tol); + optimize_remd_parameters(&remd, maxiter, tol); dump_remd_parameters(fp, &remd, opt2fn("-o", NFILE, fnm), opt2fn_null("-o2", NFILE, fnm), @@ -1024,7 +1024,7 @@ int gmx_kinetics(int argc, char *argv[]) remd.nmask++; } sum_ft(&remd); - optimize_remd_parameters(fp, &remd, maxiter, tol); + optimize_remd_parameters(&remd, maxiter, tol); dump_remd_parameters(fp, &remd, "test1.xvg", NULL, NULL, NULL, NULL, skip, tref, oenv); for (i = 0; (i < remd.nreplica); i++) @@ -1034,7 +1034,7 @@ int gmx_kinetics(int argc, char *argv[]) remd.nmask = remd.nreplica - remd.nmask; sum_ft(&remd); - optimize_remd_parameters(fp, &remd, maxiter, tol); + optimize_remd_parameters(&remd, maxiter, tol); dump_remd_parameters(fp, &remd, "test2.xvg", NULL, NULL, NULL, NULL, skip, tref, oenv); for (i = 0; (i < remd.nreplica); i++) @@ -1048,7 +1048,7 @@ int gmx_kinetics(int argc, char *argv[]) remd.nmask++; } sum_ft(&remd); - optimize_remd_parameters(fp, &remd, maxiter, tol); + optimize_remd_parameters(&remd, maxiter, tol); dump_remd_parameters(fp, &remd, "test1.xvg", NULL, NULL, NULL, NULL, skip, tref, oenv); for (i = 0; (i < remd.nreplica); i++) @@ -1062,7 +1062,7 @@ int gmx_kinetics(int argc, char *argv[]) remd.nmask++; } sum_ft(&remd); - optimize_remd_parameters(fp, &remd, maxiter, tol); + optimize_remd_parameters(&remd, maxiter, tol); dump_remd_parameters(fp, &remd, "test1.xvg", NULL, NULL, NULL, NULL, skip, tref, oenv); } ffclose(fp); diff --git a/src/gromacs/gmxana/gmx_mindist.c b/src/gromacs/gmxana/gmx_mindist.c index 536094832f..2d5543f261 100644 --- a/src/gromacs/gmxana/gmx_mindist.c +++ b/src/gromacs/gmxana/gmx_mindist.c @@ -598,7 +598,7 @@ int find_residues(t_atoms *atoms, int n, atom_id index[], atom_id **resindex) return nres; } -void dump_res(FILE *out, int nres, atom_id *resindex, int n, atom_id index[]) +void dump_res(FILE *out, int nres, atom_id *resindex, atom_id index[]) { int i, j; @@ -768,7 +768,7 @@ int gmx_mindist(int argc, char *argv[]) gnx[0], index[0], &residues); if (debug) { - dump_res(debug, nres, residues, gnx[0], index[0]); + dump_res(debug, nres, residues, index[0]); } } diff --git a/src/gromacs/gmxana/gmx_msd.c b/src/gromacs/gmxana/gmx_msd.c index ac7dcb658b..8718b180d8 100644 --- a/src/gromacs/gmxana/gmx_msd.c +++ b/src/gromacs/gmxana/gmx_msd.c @@ -95,8 +95,8 @@ typedef struct { point. */ } t_corr; -typedef real t_calc_func (t_corr *, int, atom_id[], int, rvec[], rvec, gmx_bool, matrix, - const output_env_t oenv); +typedef real t_calc_func (t_corr *curr, int nx, atom_id index[], int nx0, rvec xc[], + rvec dcom, gmx_bool bTen, matrix mat); static real thistime(t_corr *curr) { @@ -218,8 +218,7 @@ static void corr_print(t_corr *curr, gmx_bool bTen, const char *fn, const char * /* called from corr_loop, to do the main calculations */ static void calc_corr(t_corr *curr, int nr, int nx, atom_id index[], rvec xc[], - gmx_bool bRmCOMM, rvec com, t_calc_func *calc1, gmx_bool bTen, - const output_env_t oenv) + gmx_bool bRmCOMM, rvec com, t_calc_func *calc1, gmx_bool bTen) { int nx0; real g; @@ -251,7 +250,7 @@ static void calc_corr(t_corr *curr, int nr, int nx, atom_id index[], rvec xc[], { clear_rvec(dcom); } - g = calc1(curr, nx, index, nx0, xc, dcom, bTen, mat, oenv); + g = calc1(curr, nx, index, nx0, xc, dcom, bTen, mat); #ifdef DEBUG2 printf("g[%d]=%g\n", nx0, g); #endif @@ -267,7 +266,7 @@ static void calc_corr(t_corr *curr, int nr, int nx, atom_id index[], rvec xc[], /* the non-mass-weighted mean-squared displacement calcuation */ static real calc1_norm(t_corr *curr, int nx, atom_id index[], int nx0, rvec xc[], - rvec dcom, gmx_bool bTen, matrix mat, const output_env_t oenv) + rvec dcom, gmx_bool bTen, matrix mat) { int i, ix, m, m2; real g, r, r2; @@ -405,7 +404,7 @@ static real calc_one_mw(t_corr *curr, int ix, int nx0, rvec xc[], real *tm, /* the normal, mass-weighted mean-squared displacement calcuation */ static real calc1_mw(t_corr *curr, int nx, atom_id index[], int nx0, rvec xc[], - rvec dcom, gmx_bool bTen, matrix mat, const output_env_t oenv) + rvec dcom, gmx_bool bTen, matrix mat) { int i; real g, tm; @@ -521,8 +520,8 @@ static void calc_com(gmx_bool bMol, int gnx, atom_id index[], } -static real calc1_mol(t_corr *curr, int nx, atom_id index[], int nx0, rvec xc[], - rvec dcom, gmx_bool bTen, matrix mat, const output_env_t oenv) +static real calc1_mol(t_corr *curr, int nx, atom_id gmx_unused index[], int nx0, rvec xc[], + rvec dcom, gmx_bool bTen, matrix mat) { int i; real g, tm, gtot, tt; @@ -815,7 +814,7 @@ int corr_loop(t_corr *curr, const char *fn, t_topology *top, int ePBC, { /* calculate something useful, like mean square displacements */ calc_corr(curr, i, gnx[i], index[i], xa[cur], (gnx_com != NULL), com, - calc1, bTen, oenv); + calc1, bTen); } cur = prev; t_prev = t; diff --git a/src/gromacs/gmxana/gmx_order.c b/src/gromacs/gmxana/gmx_order.c index 417f37db88..1ff165a2f1 100644 --- a/src/gromacs/gmxana/gmx_order.c +++ b/src/gromacs/gmxana/gmx_order.c @@ -68,10 +68,9 @@ /* P.J. van Maaren, November 2005 Added tetrahedral stuff */ /****************************************************************************/ -static void find_nearest_neighbours(t_topology top, int ePBC, +static void find_nearest_neighbours(int ePBC, int natoms, matrix box, rvec x[], int maxidx, atom_id index[], - real time, real *sgmean, real *skmean, int nslice, int slice_dim, real sgslice[], real skslice[], @@ -306,7 +305,7 @@ static void calc_tetra_order_parm(const char *fnNDX, const char *fnTPS, nframes = 0; do { - find_nearest_neighbours(top, ePBC, natoms, box, x, isize[0], index[0], t, + find_nearest_neighbours(ePBC, natoms, box, x, isize[0], index[0], &sg, &sk, nslice, slice_dim, sg_slice, sk_slice, gpbc); for (i = 0; (i < nslice); i++) { diff --git a/src/gromacs/gmxana/gmx_pme_error.cpp b/src/gromacs/gmxana/gmx_pme_error.cpp index a27ed7ed66..ed92c87dbb 100644 --- a/src/gromacs/gmxana/gmx_pme_error.cpp +++ b/src/gromacs/gmxana/gmx_pme_error.cpp @@ -421,7 +421,7 @@ static real estimate_reciprocal( rvec x[], /* array of particles */ real q[], /* array of charges */ int nr, /* number of charges = size of the charge array */ - FILE *fp_out, + FILE gmx_unused *fp_out, gmx_bool bVerbose, unsigned int seed, /* The seed for the random number generator */ int *nsamples, /* Return the number of samples used if Monte Carlo diff --git a/src/gromacs/gmxana/gmx_sham.c b/src/gromacs/gmxana/gmx_sham.c index 2f54909d2f..7b6dcc109f 100644 --- a/src/gromacs/gmxana/gmx_sham.c +++ b/src/gromacs/gmxana/gmx_sham.c @@ -418,7 +418,7 @@ static void do_sham(const char *fn, const char *ndx, real Tref, real pmax, real gmax, real *emin, real *emax, int nlevels, real pmin, - const char *mname, gmx_bool bSham, int *idim, int *ibox, + const char *mname, int *idim, int *ibox, gmx_bool bXmin, real *xmin, gmx_bool bXmax, real *xmax) { FILE *fp; @@ -965,7 +965,7 @@ int gmx_sham(int argc, char *argv[]) "is the natural quantity to use, as it will produce bins of the same", "volume." }; - static real tb = -1, te = -1, frac = 0.5, filtlen = 0, binwidth = 0.1; + static real tb = -1, te = -1, frac = 0.5, filtlen = 0; static gmx_bool bHaveT = TRUE, bDer = FALSE, bSubAv = TRUE, bAverCorr = FALSE, bXYdy = FALSE; static gmx_bool bEESEF = FALSE, bEENLC = FALSE, bEeFitAc = FALSE, bPower = FALSE; static gmx_bool bShamEner = TRUE, bSham = TRUE; @@ -988,8 +988,6 @@ int gmx_sham(int argc, char *argv[]) "Read this number of sets separated by lines containing only an ampersand" }, { "-d", FALSE, etBOOL, {&bDer}, "Use the derivative" }, - { "-bw", FALSE, etREAL, {&binwidth}, - "Binwidth for the distribution" }, { "-sham", FALSE, etBOOL, {&bSham}, "Turn off energy weighting even if energies are given" }, { "-tsham", FALSE, etREAL, {&Tref}, @@ -1164,7 +1162,7 @@ int gmx_sham(int argc, char *argv[]) opt2parg_bSet("-emin", NPA, pa) ? &emin : NULL, opt2parg_bSet("-emax", NPA, pa) ? &emax : NULL, nlevels, pmin, - mname, bSham, idim, ibox, + mname, idim, ibox, opt2parg_bSet("-xmin", NPA, pa), rmin, opt2parg_bSet("-xmax", NPA, pa), rmax); diff --git a/src/gromacs/gmxana/gmx_sigeps.c b/src/gromacs/gmxana/gmx_sigeps.c index 09481d0a49..61ea4a6473 100644 --- a/src/gromacs/gmxana/gmx_sigeps.c +++ b/src/gromacs/gmxana/gmx_sigeps.c @@ -62,7 +62,7 @@ real pot(real x, real qq, real c6, real cn, int npow) return cn*pow(x, -npow)-c6*pow(x, -6)+qq*ONE_4PI_EPS0/x; } -real bhpot(real x, real qq, real A, real B, real C) +real bhpot(real x, real A, real B, real C) { return A*exp(-B*x) - C*pow(x, -6.0); } @@ -173,7 +173,7 @@ int gmx_sigeps(int argc, char *argv[]) x = sigfac*sig+sig*i*0.02; dp[next] = dpot(x, qq, c6, cn, npow); fprintf(fp, "%10g %10g %10g\n", x, pot(x, qq, c6, cn, npow), - bhpot(x, qq, Abh, Bbh, Cbh)); + bhpot(x, Abh, Bbh, Cbh)); if (qq != 0) { if ((i > 0) && (dp[cur]*dp[next] < 0)) diff --git a/src/gromacs/gmxana/gmx_sorient.c b/src/gromacs/gmxana/gmx_sorient.c index 2ac9537768..aefb2380dc 100644 --- a/src/gromacs/gmxana/gmx_sorient.c +++ b/src/gromacs/gmxana/gmx_sorient.c @@ -49,7 +49,7 @@ static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc, - atom_id index[], rvec xref, gmx_bool bPBC, matrix box) + atom_id index[], rvec xref, gmx_bool bPBC) { const real tol = 1e-4; gmx_bool bChanged; @@ -288,7 +288,7 @@ int gmx_sorient(int argc, char *argv[]) { if (bCom) { - calc_com_pbc(nrefat, &top, x, &pbc, index[0], xref, bPBC, box); + calc_com_pbc(nrefat, &top, x, &pbc, index[0], xref, bPBC); } else { diff --git a/src/gromacs/gmxana/gmx_spol.c b/src/gromacs/gmxana/gmx_spol.c index 67dabb39cc..abccd8de06 100644 --- a/src/gromacs/gmxana/gmx_spol.c +++ b/src/gromacs/gmxana/gmx_spol.c @@ -50,7 +50,7 @@ static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc, - atom_id index[], rvec xref, int ePBC, matrix box) + atom_id index[], rvec xref, int ePBC) { const real tol = 1e-4; gmx_bool bChanged; @@ -273,7 +273,7 @@ int gmx_spol(int argc, char *argv[]) set_pbc(&pbc, ir->ePBC, box); if (bCom) { - calc_com_pbc(nrefat, top, x, &pbc, index[0], xref, ir->ePBC, box); + calc_com_pbc(nrefat, top, x, &pbc, index[0], xref, ir->ePBC); } for (m = 0; m < isize[1]; m++) diff --git a/src/gromacs/gmxana/gmx_tcaf.c b/src/gromacs/gmxana/gmx_tcaf.c index 96ee7e1364..9e3dc7592b 100644 --- a/src/gromacs/gmxana/gmx_tcaf.c +++ b/src/gromacs/gmxana/gmx_tcaf.c @@ -129,7 +129,7 @@ static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac, low_do_autocorr(fn_tca, oenv, "Transverse Current Autocorrelation Functions", nframes, ntc, ncorr, tc, dt, eacNormal, - 1, FALSE, FALSE, FALSE, 0, 0, 0, 0); + 1, FALSE, FALSE, FALSE, 0, 0, 0); do_view(oenv, fn_tca, "-nxy"); fp = xvgropen(fn_tc, "Transverse Current Autocorrelation Functions", diff --git a/src/gromacs/gmxana/gmx_trjconv.c b/src/gromacs/gmxana/gmx_trjconv.c index d5c1246ca9..3313a9a8f8 100644 --- a/src/gromacs/gmxana/gmx_trjconv.c +++ b/src/gromacs/gmxana/gmx_trjconv.c @@ -72,8 +72,7 @@ enum { static void calc_pbc_cluster(int ecenter, int nrefat, t_topology *top, int ePBC, - rvec x[], atom_id index[], - rvec clust_com, matrix box, rvec clustercenter) + rvec x[], atom_id index[], matrix box) { int m, i, j, j0, j1, jj, ai, aj; int imin, jmin; @@ -734,7 +733,6 @@ int gmx_trjconv(int argc, char *argv[]) static char *exec_command = NULL; static real dropunder = 0, dropover = 0; static gmx_bool bRound = FALSE; - static rvec clustercenter = {0, 0, 0}; t_pargs pa[] = @@ -766,9 +764,6 @@ int gmx_trjconv(int argc, char *argv[]) { "-box", FALSE, etRVEC, { newbox }, "Size for new cubic box (default: read from input)" }, - { "-clustercenter", FALSE, etRVEC, - { clustercenter }, - "Optional starting point for pbc cluster option" }, { "-trans", FALSE, etRVEC, { trans }, "All coordinates will be translated by trans. This " @@ -1449,9 +1444,7 @@ int gmx_trjconv(int argc, char *argv[]) } else if (bCluster) { - rvec com; - - calc_pbc_cluster(ecenter, ifit, &top, ePBC, fr.x, ind_fit, com, fr.box, clustercenter); + calc_pbc_cluster(ecenter, ifit, &top, ePBC, fr.x, ind_fit, fr.box); } if (bPFit) diff --git a/src/gromacs/gmxana/gmx_wham.cpp b/src/gromacs/gmxana/gmx_wham.cpp index 7fb0ec3b1e..238de2b230 100644 --- a/src/gromacs/gmxana/gmx_wham.cpp +++ b/src/gromacs/gmxana/gmx_wham.cpp @@ -2528,8 +2528,7 @@ void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles, * Note: Here we consider tau[int] := int_0^inf ACF(t) as the integrated autocorrelation times. * The factor `g := 1 + 2*tau[int]` subsequently enters the uncertainty. */ -void readIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, t_UmbrellaOptions *opt, - const char* fn) +void readIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, const char* fn) { int nlines, ny, i, ig; double **iact; @@ -2787,7 +2786,7 @@ void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, /*! \brief * compute average and sigma of each umbrella histogram */ -void averageSigma(t_UmbrellaWindow *window, int nwins, t_UmbrellaOptions *opt) +void averageSigma(t_UmbrellaWindow *window, int nwins) { int i, ig, ntot, k; real av, sum2, sig, diff, *ztime, nSamplesIndep; @@ -2942,8 +2941,7 @@ void checkReactionCoordinateCovered(t_UmbrellaWindow *window, int nwins, * * This speeds up the convergence by roughly a factor of 2 */ -void guessPotByIntegration(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt, - char *fn) +void guessPotByIntegration(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt) { int i, j, ig, bins = opt->bins, nHist, winmin, groupmin; double dz, min = opt->min, *pot, pos, hispos, dist, diff, fAv, distmin, *f; @@ -3552,7 +3550,7 @@ int gmx_wham(int argc, char *argv[]) /* Integrated autocorrelation times provided ? */ if (opt.bTauIntGiven) { - readIntegratedAutocorrelationTimes(window, nwins, &opt, opt2fn("-iiact", NFILE, fnm)); + readIntegratedAutocorrelationTimes(window, nwins, opt2fn("-iiact", NFILE, fnm)); } /* Compute integrated autocorrelation times */ @@ -3565,13 +3563,13 @@ int gmx_wham(int argc, char *argv[]) (maybe required for bootstrapping. If not, this is fast anyhow) */ if (opt.nBootStrap && opt.bsMethod == bsMethod_trajGauss) { - averageSigma(window, nwins, &opt); + averageSigma(window, nwins); } /* Get initial potential by simple integration */ if (opt.bInitPotByIntegration) { - guessPotByIntegration(window, nwins, &opt, 0); + guessPotByIntegration(window, nwins, &opt); } /* Check if complete reaction coordinate is covered */ diff --git a/src/gromacs/gmxana/gmx_wheel.c b/src/gromacs/gmxana/gmx_wheel.c index d720a046bd..b310b9905c 100644 --- a/src/gromacs/gmxana/gmx_wheel.c +++ b/src/gromacs/gmxana/gmx_wheel.c @@ -156,7 +156,7 @@ void wheel(const char *fn, int nres, char *resnm[], int r0, real rot0, char *tit ps_close(out); } -void wheel2(const char *fn, int nres, char *resnm[], int r0, real rot0, char *title) +void wheel2(const char *fn, int nres, char *resnm[], real rot0, char *title) { const real fontsize = 14; const real gray = 0.9; @@ -287,7 +287,7 @@ int gmx_wheel(int argc, char *argv[]) } else { - wheel2(ftp2fn(efEPS, NFILE, fnm), nres, resnm, r0, rot0, title); + wheel2(ftp2fn(efEPS, NFILE, fnm), nres, resnm, rot0, title); } return 0; diff --git a/src/gromacs/gmxana/hxprops.c b/src/gromacs/gmxana/hxprops.c index 8752929c7f..21d01f6281 100644 --- a/src/gromacs/gmxana/hxprops.c +++ b/src/gromacs/gmxana/hxprops.c @@ -93,7 +93,7 @@ real ellipticity(int nres, t_bb bb[]) return ell; } -real ahx_len(int gnx, atom_id index[], rvec x[], matrix box) +real ahx_len(int gnx, atom_id index[], rvec x[]) /* Assume we have a list of Calpha atoms only! */ { rvec dx; @@ -146,7 +146,7 @@ static real rot(rvec x1, rvec x2) return dphi; } -real twist(FILE *fp, int nca, atom_id caindex[], rvec x[]) +real twist(int nca, atom_id caindex[], rvec x[]) { real pt, dphi; int i, a0, a1; @@ -169,7 +169,7 @@ real twist(FILE *fp, int nca, atom_id caindex[], rvec x[]) return (pt/(nca-1)); } -real ca_phi(int gnx, atom_id index[], rvec x[], matrix box) +real ca_phi(int gnx, atom_id index[], rvec x[]) /* Assume we have a list of Calpha atoms only! */ { real phi, phitot; @@ -473,7 +473,7 @@ real pprms(FILE *fp, int nbb, t_bb bb[]) return rms; } -void calc_hxprops(int nres, t_bb bb[], rvec x[], matrix box) +void calc_hxprops(int nres, t_bb bb[], rvec x[]) { int i, ao, an, t1, t2, t3; rvec dx, r_ij, r_kj, r_kl, m, n; @@ -519,7 +519,7 @@ void calc_hxprops(int nres, t_bb bb[], rvec x[], matrix box) } } -static void check_ahx(int nres, t_bb bb[], rvec x[], +static void check_ahx(int nres, t_bb bb[], int *hstart, int *hend) { int h0, h1, h0sav, h1sav; @@ -552,7 +552,7 @@ static void check_ahx(int nres, t_bb bb[], rvec x[], *hend = h1sav; } -void do_start_end(int nres, t_bb bb[], rvec x[], int *nbb, atom_id bbindex[], +void do_start_end(int nres, t_bb bb[], int *nbb, atom_id bbindex[], int *nca, atom_id caindex[], gmx_bool bRange, int rStart, int rEnd) { @@ -579,7 +579,7 @@ void do_start_end(int nres, t_bb bb[], rvec x[], int *nbb, atom_id bbindex[], else { /* Find start and end of longest helix fragment */ - check_ahx(nres, bb, x, &hstart, &hend); + check_ahx(nres, bb, &hstart, &hend); } fprintf(stderr, "helix from: %d through %d\n", bb[hstart].resno, bb[hend].resno); diff --git a/src/gromacs/gmxana/hxprops.h b/src/gromacs/gmxana/hxprops.h index 48152b0306..033e9e35ad 100644 --- a/src/gromacs/gmxana/hxprops.h +++ b/src/gromacs/gmxana/hxprops.h @@ -63,7 +63,7 @@ enum { efhAHX, efhNR }; -extern real ahx_len(int gnx, atom_id index[], rvec x[], matrix box); +extern real ahx_len(int gnx, atom_id index[], rvec x[]); /* Assume we have a list of Calpha atoms only! */ extern real ellipticity(int nres, t_bb bb[]); @@ -71,7 +71,7 @@ extern real ellipticity(int nres, t_bb bb[]); extern real radius(FILE *fp, int nca, atom_id ca_index[], rvec x[]); /* Assume we have calphas */ -extern real twist(FILE *fp, int nca, atom_id caindex[], rvec x[]); +extern real twist(int nca, atom_id caindex[], rvec x[]); /* Calculate the twist of the helix */ extern real pprms(FILE *fp, int nbb, t_bb bb[]); @@ -79,7 +79,7 @@ extern real pprms(FILE *fp, int nbb, t_bb bb[]); * and the distance per residue */ -extern real ca_phi(int gnx, atom_id index[], rvec x[], matrix box); +extern real ca_phi(int gnx, atom_id index[], rvec x[]); /* Assume we have a list of Calpha atoms only! */ extern real dip(int nbb, atom_id bbind[], rvec x[], t_atom atom[]); @@ -100,11 +100,11 @@ extern t_bb *mkbbind(const char *fn, int *nres, int *nbb, int res0, char ***atomname, t_atom atom[], t_resinfo *resinfo); -extern void do_start_end(int nres, t_bb bb[], rvec x[], int *nbb, +extern void do_start_end(int nres, t_bb bb[], int *nbb, atom_id bbindex[], int *nca, atom_id caindex[], gmx_bool bRange, int rStart, int rEnd); -extern void calc_hxprops(int nres, t_bb bb[], rvec x[], matrix box); +extern void calc_hxprops(int nres, t_bb bb[], rvec x[]); extern void pr_bb(FILE *fp, int nres, t_bb bb[]); diff --git a/src/gromacs/legacyheaders/gstat.h b/src/gromacs/legacyheaders/gstat.h index aa991441b6..bc0ecd8a8a 100644 --- a/src/gromacs/legacyheaders/gstat.h +++ b/src/gromacs/legacyheaders/gstat.h @@ -133,7 +133,7 @@ void low_do_autocorr(const char *fn, const output_env_t oenv, int nout, real **c1, real dt, unsigned long mode, int nrestart, gmx_bool bAver, gmx_bool bNormalize, gmx_bool bVerbose, real tbeginfit, real tendfit, - int nfitparm, int nskip); + int nfitparm); /* * do_autocorr calculates autocorrelation functions for many things. * It takes a 2 d array containing nitem arrays of length nframes @@ -403,13 +403,13 @@ void pr_dlist(FILE *fp, int nl, t_dlist dl[], real dt, int printtype, int pr_trans(FILE *fp, int nl, t_dlist dl[], real dt, int Xi); -void mk_chi_lookup (int **lookup, int maxchi, real **dih, +void mk_chi_lookup (int **lookup, int maxchi, int nlist, t_dlist dlist[]); -void mk_multiplicity_lookup (int *multiplicity, int maxchi, real **dih, +void mk_multiplicity_lookup (int *multiplicity, int maxchi, int nlist, t_dlist dlist[], int nangle); -void get_chi_product_traj (real **dih, int nframes, int nangles, +void get_chi_product_traj (real **dih, int nframes, int nlist, int maxchi, t_dlist dlist[], real time[], int **lookup, int *multiplicity, gmx_bool bRb, gmx_bool bNormalize, diff --git a/src/gromacs/legacyheaders/types/simple.h b/src/gromacs/legacyheaders/types/simple.h index 317efeeba0..a58ca74fd8 100644 --- a/src/gromacs/legacyheaders/types/simple.h +++ b/src/gromacs/legacyheaders/types/simple.h @@ -287,6 +287,32 @@ typedef int gmx_large_int_t; #endif +/* + * These attributes suppress compiler warnings about unused function arguments + * by marking them as possibly unused. Some arguments are unused but + * have to be retained to preserve a function signature + * that must match that of another function. + * Some arguments are only used in *some* code paths (e.g. MPI) + */ + +#ifndef gmx_unused +#ifdef __GNUC__ +/* GCC, clang, and some ICC pretending to be GCC */ +# define gmx_unused __attribute__ ((unused)) +#elif (defined(__INTEL_COMPILER) || defined(__ECC)) && !defined(_MSC_VER) +/* ICC on *nix */ +# define gmx_unused __attribute__ ((unused)) +#elif defined _MSC_VER +/* MSVC */ +# define gmx_unused /*@unused@*/ +#elif defined(__xlC__) +/* IBM */ +# define gmx_unused __attribute__ ((unused)) +#else +# define gmx_unused +#endif +#endif + /* Standard sizes for char* string buffers */ #define STRLEN 4096 #define BIG_STRLEN 1048576 -- 2.22.0