Merge branch origin/release-5-0
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_covar.c
index 37e9a893cc8b1d4f97f481682669a531f74b223e..bad3518ababad410abcb8c924d8ff9d719c8dfcd 100644 (file)
  * 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 <time.h>
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
 
 #include "gromacs/commandline/pargs.h"
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "vec.h"
-#include "pbc.h"
-#include "gromacs/fileio/futil.h"
-#include "index.h"
 #include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/trnio.h"
-#include "mshift.h"
-#include "xvgr.h"
-#include "rmpbc.h"
-#include "txtdump.h"
 #include "gromacs/fileio/matio.h"
-#include "eigio.h"
-#include "physics.h"
-#include "gmx_ana.h"
-#include "gromacs/utility/cstringutil.h"
+#include "gromacs/fileio/trnio.h"
 #include "gromacs/fileio/trxio.h"
-
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/gmxana/eigio.h"
+#include "gromacs/gmxana/gmx_ana.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/linearalgebra/eigensolver.h"
 #include "gromacs/math/do_fit.h"
-#include "gromacs/legacyheaders/gmx_fatal.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/sysinfo.h"
 
 int gmx_covar(int argc, char *argv[])
 {
@@ -94,9 +83,9 @@ int gmx_covar(int argc, char *argv[])
         "Option [TT]-ascii[tt] writes the whole covariance matrix to",
         "an ASCII file. The order of the elements is: x1x1, x1y1, x1z1, x1x2, ...",
         "[PAR]",
-        "Option [TT]-xpm[tt] writes the whole covariance matrix to an [TT].xpm[tt] file.",
+        "Option [TT]-xpm[tt] writes the whole covariance matrix to an [REF].xpm[ref] file.",
         "[PAR]",
-        "Option [TT]-xpma[tt] writes the atomic covariance matrix to an [TT].xpm[tt] file,",
+        "Option [TT]-xpma[tt] writes the atomic covariance matrix to an [REF].xpm[ref] file,",
         "i.e. for each atom pair the sum of the xx, yy and zz covariances is",
         "written.",
         "[PAR]",
@@ -144,7 +133,6 @@ int gmx_covar(int argc, char *argv[])
     int             d, dj, nfit;
     atom_id        *index, *ifit;
     gmx_bool        bDiffMass1, bDiffMass2;
-    time_t          now;
     char            timebuf[STRLEN];
     t_rgb           rlo, rmi, rhi;
     real           *eigenvectors;
@@ -165,7 +153,7 @@ int gmx_covar(int argc, char *argv[])
     };
 #define NFILE asize(fnm)
 
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT | PCA_BE_NICE,
+    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT,
                            NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
     {
         return 0;
@@ -576,7 +564,7 @@ int gmx_covar(int argc, char *argv[])
     {
         fprintf (out, "%10d %g\n", (int)i+1, eigenvalues[ndim-1-i]);
     }
-    gmx_ffclose(out);
+    xvgrclose(out);
 
     if (bFit)
     {
@@ -605,8 +593,7 @@ int gmx_covar(int argc, char *argv[])
 
     out = gmx_ffopen(logfile, "w");
 
-    time(&now);
-    gmx_ctime_r(&now, timebuf, STRLEN);
+    gmx_format_current_time(timebuf, STRLEN);
     fprintf(out, "Covariance analysis log, written %s\n", timebuf);
 
     fprintf(out, "Program: %s\n", argv[0]);