Grompp complains of net charge, but itps add up to zero

GROMACS version: reproduced on 2018.8, 2019.6, 2020.1
GROMACS modification: No

Hi all.

We are having a strange issue with one specific system model I’m trying to simulate.

It is composed only by 1,000 cations (individual charges of +0.790566) plus 1,000 anions (individual charges of -0.790566), all verified multiple times already.

In all three versions of gromacs we tested, the gmx grompp complains as:

###########################################
NOTE 1 [file 1000.HMIm.BF4.3.top, line 24]:
System has non-zero total charge: -0.000149
Total charge should normally be an integer. See
http://www.gromacs.org/Documentation/Floating_Point_Arithmetic
for discussion on how close it should be to an integer.

WARNING 1 [file 1000.HMIm.BF4.3.top, line 24]:
You are using Ewald electrostatics in a system with net charge. This can
lead to severe artifacts, such as ions moving into regions with low
dielectric, due to the uniform background charge. We suggest to
neutralize your system with counter ions, possibly in combination with a
physiological salt concentration.
###########################################

Two facts that are extremely odd are that a thousand equivalent molecules with any residual charge error cannot yield a total excess charge of -0.000149, and also that similar models of the same chemical system but with different total charges for cations and anions (including non-integer ones) add properly to zero on gmx grompp.

We also don’t observe any issues with other (smaller) chemical systems being modeled with either integer or non-integer ions total charges.

I just tried to upload the topologies, however it doesn’t allow itp files, and also it complains that I’m a “new user”. I will paste them as a reply just below here.

Thanks a lot for any help!

By any chance did you use MS Excel for summing and balancing charge? I am asking, as minus sign from Excel not recognized as ACSII compatible char.

Hi Marsul.

I actually summed them over by hand, rewrote the charge parts of the itp files also by hand, and imported that section into libreoffice calc: In all scenarios I got the same result for the summed charges and for the gmx grompp run.

The charges are reproduced below. Unfortunately there are two threads on this issue (Gmx grompp complains about net charge but itps add up to zero) because “askimet” didn’t like something and flagged it for verification (my bad, sorry for that).

######Atomic Charges#######
##Anion##
[ atoms ]
1 B 1 ANI B 1 1.010410 10.811
2 F 1 ANI F1 1 -0.450244 18.9984
3 F 1 ANI F2 1 -0.450244 18.9984
4 F 1 ANI F3 1 -0.450244 18.9984
5 F 1 ANI F4 1 -0.450244 18.9984
##Cation##
[ atoms ]
1 NA 1 EMI N1 1 0.223701 14.0067
2 CR 1 EMI C2 1 -0.238364 12.0116
3 NA 1 EMI N3 1 0.211230 14.0067
4 CW 1 EMI C4 1 -0.141250 12.0116
5 CW 1 EMI C5 1 -0.298724 12.0116
6 H5 1 EMI H2 1 0.275012 1.0079
7 H4 1 EMI H4 1 0.215820 1.0079
8 H4 1 EMI H5 1 0.233184 1.0079
9 CT 1 EMI C1’ 1 -0.340395 12.0116
10 H1 1 EMI H1’ 1 0.158733 1.0079
11 H1 1 EMI H1’ 1 0.158733 1.0079
12 H1 1 EMI H1’ 1 0.158733 1.0079
13 CT 1 EMI C1" 1 -0.211306 12.0116
14 H1 1 EMI H1" 1 0.102780 1.0079
15 H1 1 EMI H1" 1 0.102780 1.0079
16 CT 1 EMI C2" 1 0.226280 12.0116
17 HC 1 EMI H2" 1 -0.006821 1.0079
18 HC 1 EMI H2" 1 -0.006821 1.0079
19 CT 1 EMI C3" 1 -0.126251 12.0116
20 HC 1 EMI H3" 1 0.026788 1.0079
21 HC 1 EMI H3" 1 0.026788 1.0079
22 CT 1 EMI C4" 1 -0.017332 12.0116
23 HC 1 EMI H4" 1 0.001619 1.0079
24 HC 1 EMI H4" 1 0.001619 1.0079
25 CT 1 EMI C5" 1 0.277371 12.0116
26 HC 1 EMI H5" 1 -0.052536 1.0079
27 HC 1 EMI H5" 1 -0.052536 1.0079
28 CT 1 EMI C6" 1 -0.314907 12.0116
29 HC 1 EMI H6" 1 0.065546 1.0079
30 HC 1 EMI H6" 1 0.065546 1.0079
31 HC 1 EMI H6" 1 0.065546 1.0079
#########

Well, I think the root of problem is libreoffice calc, it uses some markup annotation to show letter. Best way to do this thing, is to use plain text file. Typically, common practice would be using vim/emacs as editor and awk as column/row wise operation. If you upload your files in cloud like google drive/dropbox providing files to invoke grommp, then it will easier to comment on.

Masrul, I think you misunderstood: we wrote the file, by hand, in ascii format. First on kate, second time using vi. We imported those files data to libreoffice calc in order to check them, not the other way around. :)

Yes, some of our atoms have single and some double quotation marks. It never yielded any trouble, although: We literally have 3 other charge sets for the same molecule with the same atom naming which all runs with no errors at all. :)

There is nothing wrong with this system. The sheer magnitude of charged species, coupled with 5 decimal places in the charges, leads to rounding issues that are substantially larger than normal.

Thanks, jalemkul. We tried today the testing suggestion from user Dr_DBW on the other topic (Gmx grompp complains about net charge but itps add up to zero) and it proves that this is indeed the cause for the “oddity” observed.