fixed g_bar xvg reading issue
authorBerk Hess <hess@kth.se>
Fri, 23 Mar 2012 13:58:36 +0000 (14:58 +0100)
committerBerk Hess <hess@kth.se>
Fri, 23 Mar 2012 13:58:36 +0000 (14:58 +0100)
Due to a comparison between temperatures in single and double precision
g_bar could give a fatal error when processing xvg files.

Change-Id: Ie63187261b3f20f8e241bf606cc9f23fdd93ec2b

src/tools/gmx_bar.c

index e2fa7553f53d59ed9cf2dce92a45296fd55bb44c..a77d0cf2dec9d3788fdde7375c1bb31315e2629e 100644 (file)
@@ -2049,7 +2049,7 @@ static void read_bar_xvg(char *fn, real *temp, lambda_t *lambda_head)
         gmx_fatal(FARGS,"File '%s' contains fewer than two columns", fn);
     }
 
-    if ( ( *temp != barsim->temp) && (*temp > 0) )
+    if ( !gmx_within_tol(*temp,barsim->temp,GMX_FLOAT_EPS) && (*temp > 0) )
     {
         gmx_fatal(FARGS,"Temperature in file %s different from earlier files or setting\n", fn);
     }