/*
+ * This file is part of the GROMACS molecular simulation package.
*
- * This source code is part of
- *
- * G R O M A C S
- *
- * GROningen MAchine for Chemical Simulations
- *
- * VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
*
- * And Hey:
- * Green Red Orange Magenta Azure Cyan Skyblue
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
#include <math.h>
#include <stdio.h>
#include <string.h>
-#include "physics.h"
-#include "smalloc.h"
-#include "macros.h"
-#include "txtdump.h"
-#include "bondf.h"
-#include "xvgr.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "gstat.h"
+
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gstat.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/listed-forces/bonded.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
void print_one(const output_env_t oenv, const char *base, const char *name,
const char *title, const char *ylabel, int nf, real time[],
{
fprintf(fp, "%10g %10g\n", time[k], data[k]);
}
- ffclose(fp);
+ gmx_ffclose(fp);
}
static int calc_RBbin(real phi, int gmx_unused multiplicity, real gmx_unused core_frac)
{
fprintf(fp, "%10.3f %10d\n", time[j], tr_f[j]);
}
- ffclose(fp);
+ gmx_ffclose(fp);
}
/* Compute histogram from # transitions per dihedral */
fprintf(fp, "%10.3f %10d\n", ttime/i, tr_f[i]);
}
}
- ffclose(fp);
+ gmx_ffclose(fp);
}
sfree(tr_f);
int i, j, Dih, Chi;
j = 0;
- for (Dih = 0; (Dih < NONCHI+maxchi); Dih++)
+ /* NONCHI points to chi1, therefore we have to start counting there. */
+ for (Dih = NONCHI; (Dih < NONCHI+maxchi); Dih++)
{
for (i = 0; (i < nlist); i++)
{
sprintf(histitle, "cumulative rotamer distribution for %s", dlist[i].name);
fprintf(stderr, " and %s ", hisfile);
fp = xvgropen(hisfile, histitle, "number", "", oenv);
- fprintf(fp, "@ xaxis tick on\n");
- fprintf(fp, "@ xaxis tick major 1\n");
- fprintf(fp, "@ type xy\n");
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(fp, "@ xaxis tick on\n");
+ fprintf(fp, "@ xaxis tick major 1\n");
+ fprintf(fp, "@ type xy\n");
+ }
for (k = 0; (k < nbin); k++)
{
if (bNormalize)
fprintf(fp, "%5d %10d\n", k, chi_prhist[k]);
}
}
- fprintf(fp, "&\n");
- ffclose(fp);
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
+ gmx_ffclose(fp);
}
/* and finally print out occupancies to a single file */
}
sfree(chi_prtrj);
- ffclose(fpall);
+ gmx_ffclose(fpall);
fprintf(stderr, "\n");
}
*S2 = tdc*tdc+tds*tds;
}
-static void calc_angles(t_pbc *pbc,
+static void calc_angles(struct t_pbc *pbc,
int n3, atom_id index[], real ang[], rvec x_s[])
{
int i, ix, t1, t2;
}
}
-static void calc_dihs(t_pbc *pbc,
+static void calc_dihs(struct t_pbc *pbc,
int n4, atom_id index[], real ang[], rvec x_s[])
{
int i, ix, t1, t2, t3;
real *dih[],
const output_env_t oenv)
{
- t_pbc *pbc;
- t_trxstatus *status;
- int i, angind, natoms, total, teller;
- int nangles, n_alloc;
- real t, fraction, pifac, aa, angle;
- real *angles[2];
- matrix box;
- rvec *x;
- int cur = 0;
+ struct t_pbc *pbc;
+ t_trxstatus *status;
+ int i, angind, natoms, total, teller;
+ int nangles, n_alloc;
+ real t, fraction, pifac, aa, angle;
+ real *angles[2];
+ matrix box;
+ rvec *x;
+ int cur = 0;
#define prev (1-cur)
snew(pbc, 1);