Merge "g_wham: fixed pullx.xvg reading issue with pull_geometry=cylinder" into releas...
authorRossen Apostolov <rossen@kth.se>
Fri, 16 Sep 2011 20:24:23 +0000 (22:24 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 16 Sep 2011 20:24:23 +0000 (22:24 +0200)
src/tools/gmx_wham.c

index 0538bdc388759cfd5f3337964dcb34b9b9411602..54393e27dc28f2ca2773327484b67c46d417a526 100644 (file)
@@ -1776,6 +1776,7 @@ void read_pull_xf(const char *fn, const char *fntpr, t_UmbrellaHeader * header,
        nColRefEachGrp=0;
         nColRefOnce=0;
     }
+    
     nColExpect = 1 + nColRefOnce + header->npullgrps*(nColRefEachGrp+nColPerGrp);
     bHaveForce = opt->bPullf;
     
@@ -1801,7 +1802,8 @@ void read_pull_xf(const char *fn, const char *fntpr, t_UmbrellaHeader * header,
     }
     if (ny != nColExpect)
     {
-        gmx_fatal(FARGS,"Found %d pull groups in %s,\n but %d data columns in %s (expected %d)\n",
+        gmx_fatal(FARGS,"Found %d pull groups in %s,\n but %d data columns in %s (expected %d)\n"
+                  "\nMaybe you confused options -ix and -if ?\n",
                   header->npullgrps,fntpr,ny-1,fn,nColExpect-1);
     }
     
@@ -1914,13 +1916,19 @@ void read_pull_xf(const char *fn, const char *fntpr, t_UmbrellaHeader * header,
                         pos=dist_ndim(y + 1 + nColRefOnce + g*nColPerGrp,header->pull_ndim,i);
                         break;
                     case epullgPOS:
+                        /* Columns
+                           Time ref[ndim] group1[ndim] group2[ndim] ... */                         
                     case epullgCYL:
-                        /* with geometry==position, we have the reference once (nColRefOnce==ndim), but
+                        /* Columns
+                           Time ref1[ndim] group1[ndim] ref2[ndim] group2[ndim] ... */
+
+                        /* * with geometry==position, we have the reference once (nColRefOnce==ndim), but
                            no extra reference group columns before each group (nColRefEachGrp==0)
-                           with geometry==cylinder, we have no initial ref group column (nColRefOnce==0), 
+
+                           * with geometry==cylinder, we have no initial ref group column (nColRefOnce==0), 
                            but ndim ref group colums before every group (nColRefEachGrp==ndim)
                            Distance to reference: */
-                        pos=y[1 + nColRefOnce + g*(nColRefEachGrp+nColPerGrp)][i];
+                        pos=y[1 + nColRefOnce + nColRefEachGrp + g*(nColRefEachGrp+nColPerGrp)][i];
                         break;
                     default:
                         gmx_fatal(FARGS,"Bad error, this error should have been catched before. Ups.\n");