Remove unnecessary config.h includes
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_msd.c
index 22126a69a2459d688713d2794d7e65cb915da0d8..701f412114e164f4963288aee2fa1c41b8205439 100644 (file)
@@ -1,62 +1,63 @@
 /*
+ * 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 <string.h>
-#include <ctype.h>
 #include <math.h>
+#include <string.h>
 
-#include "sysstuff.h"
-#include "smalloc.h"
-#include "macros.h"
-#include "statutil.h"
-#include "maths.h"
-#include "futil.h"
-#include "index.h"
-#include "typedefs.h"
-#include "xvgr.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/topology/index.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/viewit.h"
 #include "gstat.h"
-#include "gmx_statistics.h"
-#include "tpxio.h"
-#include "pbc.h"
-#include "vec.h"
-#include "confio.h"
+#include "gromacs/statistics/statistics.h"
+#include "gromacs/fileio/tpxio.h"
+#include "gromacs/fileio/trxio.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/fileio/confio.h"
 #include "gmx_ana.h"
 
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
 
 #define FACTOR  1000.0  /* Convert nm^2/ps to 10e-5 cm^2/s */
 /* NORMAL = total diffusion coefficient (default). X,Y,Z is diffusion
@@ -213,7 +214,7 @@ static void corr_print(t_corr *curr, gmx_bool bTen, const char *fn, const char *
         }
         fprintf(out, "\n");
     }
-    ffclose(out);
+    gmx_ffclose(out);
 }
 
 /* called from corr_loop, to do the main calculations */
@@ -607,7 +608,7 @@ void printmol(t_corr *curr, const char *fn,
             }
         }
     }
-    ffclose(out);
+    gmx_ffclose(out);
     do_view(oenv, fn, "-graphtype bar");
 
     /* Compute variance, stddev and error */
@@ -1027,7 +1028,7 @@ void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
 int gmx_msd(int argc, char *argv[])
 {
     const char        *desc[] = {
-        "[TT]g_msd[tt] computes the mean square displacement (MSD) of atoms from",
+        "[THISMODULE] computes the mean square displacement (MSD) of atoms from",
         "a set of initial positions. This provides an easy way to compute",
         "the diffusion constant using the Einstein relation.",
         "The time between the reference points for the MSD calculation",
@@ -1042,7 +1043,7 @@ int gmx_msd(int argc, char *argv[])
         "types of mean square displacement: [TT]-type[tt], [TT]-lateral[tt]",
         "and [TT]-ten[tt]. Option [TT]-ten[tt] writes the full MSD tensor for",
         "each group, the order in the output is: trace xx yy zz yx zx zy.[PAR]",
-        "If [TT]-mol[tt] is set, [TT]g_msd[tt] plots the MSD for individual molecules",
+        "If [TT]-mol[tt] is set, [THISMODULE] plots the MSD for individual molecules",
         "(including making molecules whole across periodic boundaries): ",
         "for each individual molecule a diffusion constant is computed for ",
         "its center of mass. The chosen index group will be split into ",
@@ -1052,7 +1053,7 @@ int gmx_msd(int argc, char *argv[])
         "With the option [TT]-rmcomm[tt], the center of mass motion of a ",
         "specific group can be removed. For trajectories produced with ",
         "GROMACS this is usually not necessary, ",
-        "as [TT]mdrun[tt] usually already removes the center of mass motion.",
+        "as [gmx-mdrun] usually already removes the center of mass motion.",
         "When you use this option be sure that the whole system is stored",
         "in the trajectory file.[PAR]",
         "The diffusion coefficient is determined by linear regression of the MSD,",
@@ -1124,9 +1125,12 @@ int gmx_msd(int argc, char *argv[])
     real            dim_factor;
     output_env_t    oenv;
 
-    parse_common_args(&argc, argv,
-                      PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END | PCA_TIME_UNIT | PCA_BE_NICE,
-                      NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv);
+    if (!parse_common_args(&argc, argv,
+                           PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END | PCA_TIME_UNIT,
+                           NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
+    {
+        return 0;
+    }
     trx_file = ftp2fn_null(efTRX, NFILE, fnm);
     tps_file = ftp2fn_null(efTPS, NFILE, fnm);
     ndx_file = ftp2fn_null(efNDX, NFILE, fnm);