Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_polystat.c
index 66c3887a46640d837fe233a2abe796c97bb98569..ece18dc4d198743cde35822d8b3ea3b3602aeab7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * 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.
  * 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 <string.h>
 
-#include "sysstuff.h"
-#include "physics.h"
-#include "typedefs.h"
-#include "smalloc.h"
-#include "gromacs/fileio/futil.h"
 #include "gromacs/commandline/pargs.h"
-#include "vec.h"
-#include "index.h"
-#include "macros.h"
-#include "gmx_fatal.h"
-#include "xvgr.h"
-#include "rmpbc.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "nrjac.h"
-#include "gmx_ana.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/linearalgebra/nrjac.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void gyro_eigen(double **gyr, double *eig, double **eigv, int *ord)
 {
@@ -142,7 +138,7 @@ int gmx_polystat(int argc, char *argv[])
     };
 
     t_filenm        fnm[] = {
-        { efTPX, NULL, NULL,  ffREAD  },
+        { efTPR, NULL, NULL,  ffREAD  },
         { efTRX, "-f", NULL,  ffREAD  },
         { efNDX, NULL, NULL,  ffOPTRD },
         { efXVG, "-o", "polystat",  ffWRITE },
@@ -180,14 +176,14 @@ int gmx_polystat(int argc, char *argv[])
     gmx_rmpbc_t  gpbc = NULL;
 
     if (!parse_common_args(&argc, argv,
-                           PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT | PCA_BE_NICE,
+                           PCA_CAN_VIEW | PCA_CAN_TIME | PCA_TIME_UNIT,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
     }
 
     snew(top, 1);
-    ePBC = read_tpx_top(ftp2fn(efTPX, NFILE, fnm),
+    ePBC = read_tpx_top(ftp2fn(efTPR, NFILE, fnm),
                         NULL, box, &natoms, NULL, NULL, NULL, top);
 
     fprintf(stderr, "Select a group of polymer mainchain atoms:\n");
@@ -236,7 +232,7 @@ int gmx_polystat(int argc, char *argv[])
             for (d2 = 0; d2 < DIM; d2++)
             {
                 sprintf(buf, "eig%d %c", d+1, 'x'+d2);
-                legp[d*DIM+d2] = strdup(buf);
+                legp[d*DIM+d2] = gmx_strdup(buf);
             }
         }
         xvgr_legend(outv, DIM*DIM, (const char**)legp, oenv);
@@ -468,14 +464,14 @@ int gmx_polystat(int argc, char *argv[])
 
     close_trx(status);
 
-    ffclose(out);
+    gmx_ffclose(out);
     if (outv)
     {
-        ffclose(outv);
+        gmx_ffclose(outv);
     }
     if (outp)
     {
-        ffclose(outp);
+        gmx_ffclose(outp);
     }
 
     sum_eed2_tot /= frame;
@@ -494,7 +490,10 @@ int gmx_polystat(int argc, char *argv[])
     /* Handle printing of internal distances. */
     if (outi)
     {
-        fprintf(outi, "@    xaxes scale Logarithmic\n");
+        if (output_env_get_print_xvgr_codes(oenv))
+        {
+            fprintf(outi, "@    xaxes scale Logarithmic\n");
+        }
         ymax = -1;
         ymin = 1e300;
         j    = index[molind[1]-1] - index[molind[0]]; /* Polymer length -1. */
@@ -515,7 +514,7 @@ int gmx_polystat(int argc, char *argv[])
         {
             fprintf(outi, "%d  %8.4f\n", i+1, intd[i]);
         }
-        ffclose(outi);
+        gmx_ffclose(outi);
     }
 
     do_view(oenv, opt2fn("-o", NFILE, fnm), "-nxy");