Stop mdrun printing potentially undefined value
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 7 Jul 2015 12:45:06 +0000 (14:45 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sun, 26 Jul 2015 11:50:09 +0000 (13:50 +0200)
Variable pv is only defined with conditions that need not be identical
with the presence of pressure coupling. Definitely compilers aren't
sure about it.

Change-Id: I80670e12b799c7f476caa565ef7ce9c3e38b0686

src/gromacs/mdlib/mdebin.c

index bb4809174c0fde7a3e5b9128a2b3467d865b02c6..17052da774c0c9036f7e1c2127633b60afcc1efb 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,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, 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.
@@ -1248,7 +1248,9 @@ void upd_mdebin(t_mdebin       *md,
             {
                 fprintf(md->fp_dhdl, " %#.8g", md->dE[i]);
             }
-            if ((md->epc != epcNO)  &&
+            if (md->bDynBox &&
+                md->bDiagPres &&
+                (md->epc != epcNO) &&
                 (enerd->n_lambda > 0) &&
                 (fep->init_lambda < 0))
             {