Added check for <2 frames when autocorrelation is requested in g_hbond()
authorErik Lindahl <lindahl@cbr.su.se>
Tue, 31 Aug 2010 07:48:52 +0000 (09:48 +0200)
committerErik Lindahl <lindahl@cbr.su.se>
Tue, 31 Aug 2010 07:48:52 +0000 (09:48 +0200)
src/tools/gmx_hbond.c

index a3e5d8aac522c012ccc3fd4fa71141972e41997a..a4b2a2e44b1447ca148df0ebf5b016f6605cbd5f 100644 (file)
@@ -3892,6 +3892,10 @@ int gmx_hbond(int argc,char *argv[])
     sfree(p_rdist);
 #endif
   
+    if(nframes <2 && (opt2bSet("-ac",NFILE,fnm) || opt2bSet("-life",NFILE,fnm)))
+    {
+        gmx_fatal(FARGS,"Cannot calculate autocorrelation of life times with less than two frames");
+    }
   
     free_grid(ngrid,&grid);