improve setup of multiple tf tables
authorChristoph Junghans <junghans@votca.org>
Wed, 23 Jan 2013 20:57:13 +0000 (13:57 -0700)
committerChristoph Junghans <junghans@votca.org>
Tue, 5 Feb 2013 23:50:53 +0000 (16:50 -0700)
* buffer string was not initialized
* put tf table info in log instead of on the screen

Change-Id: I11ecdcd8c9a18a8931dbccef528ff02a74959ee1

src/mdlib/forcerec.c

index f110a9b9fd938b71522e2d6306b985685615017b..24e467017e120d4b104e9a95fa3ccab938c3adb2 100644 (file)
@@ -1386,12 +1386,16 @@ static void make_adress_tf_tables(FILE *fp, const output_env_t oenv,
 
     snew(fr->atf_tabs, ir->adress->n_tf_grps);
 
+    sprintf(buf, "%s", tabfn);
     for (i = 0; i < ir->adress->n_tf_grps; i++)
     {
         j = ir->adress->tf_table_index[i]; /* get energy group index */
         sprintf(buf + strlen(tabfn) - strlen(ftp2ext(efXVG)) - 1, "tf_%s.%s",
                 *(mtop->groups.grpname[mtop->groups.grps[egcENER].nm_ind[j]]), ftp2ext(efXVG));
-        printf("loading tf table for energygrp index %d from %s\n", ir->adress->tf_table_index[j], buf);
+        if(fp)
+        {
+           fprintf(fp,"loading tf table for energygrp index %d from %s\n", ir->adress->tf_table_index[i], buf);
+        }
         fr->atf_tabs[i] = make_atf_table(fp, oenv, fr, buf, box);
     }