Merge gromacs-4-6 into master
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / topio.c
index 0db87349d95cca21c8c85ad3d0e53f50d5e58785..1a3101e4bb57d58874668e99fa27c17a5b1aa53c 100644 (file)
@@ -531,7 +531,10 @@ static char **read_topol(const char *infile,const char *outfile,
   gmx_cpp_t  handle;
   char     *tmp_line=NULL;
   char       warn_buf[STRLEN];
-
+  const char *floating_point_arithmetic_tip =
+      "Total charge should normally be an integer. See\n"
+      "http://www.gromacs.org/Documentation/Floating_Point_Arithmetic\n"
+      "for discussion on how close it should be to an integer.\n";
   /* We need to open the output file before opening the input file,
    * because cpp_open_file can change the current working directory.
    */
@@ -922,11 +925,11 @@ static char **read_topol(const char *infile,const char *outfile,
   if(!title)
     title=put_symtab(symtab,"");
   if (fabs(qt) > 1e-4) {
-    sprintf(warn_buf,"System has non-zero total charge: %e\n\n",qt);
+    sprintf(warn_buf,"System has non-zero total charge: %.6f\n%s\n",qt,floating_point_arithmetic_tip);
     warning_note(wi,warn_buf);
   }
   if (fabs(qBt) > 1e-4 && !gmx_within_tol(qBt,qt,1e-6)) {
-    sprintf(warn_buf,"State B has non-zero total charge: %e\n\n",qBt);
+    sprintf(warn_buf,"State B has non-zero total charge: %.6f\n%s\n",qBt,floating_point_arithmetic_tip);
     warning_note(wi,warn_buf);
   }
   DS_Done (&DS);