Remove .tpa, .tpb, .tpx, .trj files. Part of #1500.
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_hydorder.c
index bd093427b72bed98d150df8f079f9809a62bd2c4..74de61fc814fb52841ea9ed6de793e4746d36b2a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,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.
  * 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 <ctype.h>
-
-#include "sysstuff.h"
 #include <string.h>
-#include "typedefs.h"
-#include "gromacs/commandline/pargs.h"
-#include "smalloc.h"
-#include "macros.h"
+
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/macros.h"
 #include "gstat.h"
-#include "vec.h"
-#include "xvgr.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/topology/index.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/matio.h"
 #include "binsearch.h"
 #include "powerspect.h"
 
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/matio.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
 /* Print name of first atom in all groups in index file */
 static void print_types(atom_id index[], atom_id a[], int ngrps,
                         char *groups[], t_topology *top)
@@ -67,7 +66,7 @@ static void print_types(atom_id index[], atom_id a[], int ngrps,
     fprintf(stderr, "Using following groups: \n");
     for (i = 0; i < ngrps; i++)
     {
-        fprintf(stderr, "Groupname: %s First atomname: %s First atomnr %u\n",
+        fprintf(stderr, "Groupname: %s First atomname: %s First atomnr %d\n",
                 groups[i], *(top->atoms.atomname[a[index[i]]]), a[index[i]]);
     }
     fprintf(stderr, "\n");
@@ -505,8 +504,8 @@ static void writesurftoxpms(real ***surf, int tblocks, int xbins, int ybins, rea
         yticks[j] += bw;
     }
 
-    xpmfile1 = ffopen(outfiles[0], "w");
-    xpmfile2 = ffopen(outfiles[1], "w");
+    xpmfile1 = gmx_ffopen(outfiles[0], "w");
+    xpmfile2 = gmx_ffopen(outfiles[1], "w");
 
     max1 = max2 = 0.0;
     min1 = min2 = 1000.00;
@@ -545,8 +544,8 @@ static void writesurftoxpms(real ***surf, int tblocks, int xbins, int ybins, rea
         write_xpm(xpmfile2, 3, numbuf, "Height", "x[nm]", "y[nm]", xbins, ybins, xticks, yticks, profile2, min2, max2, lo, hi, &maplevels);
     }
 
-    ffclose(xpmfile1);
-    ffclose(xpmfile2);
+    gmx_ffclose(xpmfile1);
+    gmx_ffclose(xpmfile2);
 
 
 
@@ -562,8 +561,8 @@ static void writeraw(real ***surf, int tblocks, int xbins, int ybins, char **fnm
     FILE *raw1, *raw2;
     int   i, j, n;
 
-    raw1 = ffopen(fnms[0], "w");
-    raw2 = ffopen(fnms[1], "w");
+    raw1 = gmx_ffopen(fnms[0], "w");
+    raw2 = gmx_ffopen(fnms[1], "w");
     fprintf(raw1, "#Legend\n#TBlock\n#Xbin Ybin Z t\n");
     fprintf(raw2, "#Legend\n#TBlock\n#Xbin Ybin Z t\n");
     for (n = 0; n < tblocks; n++)
@@ -580,8 +579,8 @@ static void writeraw(real ***surf, int tblocks, int xbins, int ybins, char **fnm
         }
     }
 
-    ffclose(raw1);
-    ffclose(raw2);
+    gmx_ffclose(raw1);
+    gmx_ffclose(raw2);
 }
 
 
@@ -629,7 +628,7 @@ int gmx_hydorder(int argc, char *argv[])
     t_filenm           fnm[] = {                      /* files for g_order    */
         { efTRX, "-f", NULL,  ffREAD },               /* trajectory file              */
         { efNDX, "-n", NULL,  ffREAD },               /* index file           */
-        { efTPX, "-s", NULL,  ffREAD },               /* topology file                */
+        { efTPR, "-s", NULL,  ffREAD },               /* topology file                */
         { efXPM, "-o", "intf",  ffWRMULT},            /* XPM- surface maps     */
         { efOUT, "-or", "raw", ffOPTWRMULT },         /* xvgr output file           */
         { efOUT, "-Spect", "intfspect", ffOPTWRMULT}, /* Fourier spectrum interfaces */
@@ -642,7 +641,7 @@ int gmx_hydorder(int argc, char *argv[])
     int          nfspect, nfxpm, nfraw;
     output_env_t oenv;
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -656,7 +655,7 @@ int gmx_hydorder(int argc, char *argv[])
     }
 
     ndxfnm = ftp2fn(efNDX, NFILE, fnm);
-    tpsfnm = ftp2fn(efTPX, NFILE, fnm);
+    tpsfnm = ftp2fn(efTPR, NFILE, fnm);
     trxfnm = ftp2fn(efTRX, NFILE, fnm);
 
     /* Calculate axis */