Merge branch release-5-0
[alexxy/gromacs.git] / src / programs / mdrun / repl_ex.cpp
similarity index 98%
rename from src/programs/mdrun/repl_ex.c
rename to src/programs/mdrun/repl_ex.cpp
index 5db5d309cd12f340c8a69a72eee95bcf39af6031..4b0e81063a0d383606a9bb2bcb00080d8ac89990 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 <math.h>
+#include "gmxpre.h"
+
 #include "repl_ex.h"
-#include "network.h"
+
+#include "config.h"
+
+#include <math.h>
+
+#include "gromacs/domdec/domdec.h"
+#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/main.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
 #include "gromacs/random/random.h"
 #include "gromacs/utility/smalloc.h"
-#include "physics.h"
-#include "copyrite.h"
-#include "macros.h"
-#include "vec.h"
-#include "names.h"
-#include "domdec.h"
-#include "gromacs/random/random.h"
 
 #define PROBABILITYCUTOFF 100
 /* we don't bother evaluating if events are more rare than exp(-100) = 3.7x10^-44 */
@@ -106,7 +108,7 @@ static gmx_bool repl_quantity(const gmx_multisim_t *ms,
 {
     real    *qall;
     gmx_bool bDiff;
-    int      i, s;
+    int      s;
 
     snew(qall, ms->nsim);
     qall[re->repl] = q;
@@ -142,7 +144,7 @@ gmx_repl_ex_t init_replica_exchange(FILE *fplog,
                                     const t_inputrec *ir,
                                     int nst, int nex, int init_seed)
 {
-    real                temp, pres;
+    real                pres;
     int                 i, j, k;
     struct gmx_repl_ex *re;
     gmx_bool            bTemp;
@@ -897,7 +899,7 @@ test_for_replica_exchange(FILE                 *fplog,
                           real                  time)
 {
     int       m, i, j, a, b, ap, bp, i0, i1, tmp;
-    real      ediff = 0, delta = 0, dpV = 0;
+    real      delta = 0;
     gmx_bool  bPrint, bMultiEx;
     gmx_bool *bEx      = re->bEx;
     real     *prob     = re->prob;
@@ -905,10 +907,9 @@ test_for_replica_exchange(FILE                 *fplog,
     gmx_bool  bEpot    = FALSE;
     gmx_bool  bDLambda = FALSE;
     gmx_bool  bVol     = FALSE;
-    gmx_rng_t rng;
 
     bMultiEx = (re->nex > 1);  /* multiple exchanges at each state */
-    fprintf(fplog, "Replica exchange at step " "%"GMX_PRId64 " time %.5f\n", step, time);
+    fprintf(fplog, "Replica exchange at step %" GMX_PRId64 " time %.5f\n", step, time);
 
     if (re->bNPT)
     {
@@ -1306,7 +1307,7 @@ gmx_bool replica_exchange(FILE *fplog, const t_commrec *cr, struct gmx_repl_ex *
                           t_state *state, gmx_enerdata_t *enerd,
                           t_state *state_local, gmx_int64_t step, real time)
 {
-    int i, j;
+    int j;
     int replica_id = 0;
     int exchange_partner;
     int maxswap = 0;