Gmx grompp complains about net charge but itps add up to zero

GROMACS version: 2018.8, 2019.6 and 2020.1
GROMACS modification: No

Hi all.

We are facing an issue with one ionic liquid charge model we are testing here. We have different charge models on the same and on (chemically) different liquids, with no issues.

Our systems are composed by 1,000 cations and 1,000 anions, as can be seen in the topology file reproduced below:

#############
[ defaults ]
1 2 yes 0.5 0.8333

#include “ff_amber96.gmx18.itp”
#include “ff_amber96_ils.itp”
#include “ff_BF4.itp”
#include “BF4_HMIm.itp”
#include “HMIm.itp”

[ system ]
HMIm+ and BF4-

[ molecules ]
HMIm+ 1000
BF4- 1000
##########

In this specific model, they do not add the atomic charges to integer, but rather to +0.790566 and -0.790566, respectively. We summed the atomic charges several times for certainty, and I reproduce them at the end of this message.

The issue we are facing is that all 3 different versions of gromacs tested issue the same (non-sense) warning at the “gmx grompp” step:

########
gmx grompp -f eq1.007.mdp -c 1000.HMIm.BF4.3.eq1.007.gro -p 1000.HMIm.BF4.3.top -o teste.tpr
(…)
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.
(…)
#########

What makes the issue even stranger is the fact that not only both molecules atomic charges adds up to exact same value with the opposite signal, but also that there is no way that any residual charge of any value on either or both ions would possibly lead to a net charge of -0.000149 in a systems composed by a thousand ionic pairs.

As you can see from the topology file contents, we employ several “.itp” files, but the forum unfortunately do not seems to allow for those to be uploaded. I can send them (and the other files needed) to reproduce the issue by email upon request.

Have anybody encountered such a strange error before? Any clues on what can it possibly be? We thank for any help in advance.

######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
#########

Problem solving procedure I would follow would be set up a two separate boxes, with one molecule only of each ion, see what grompp says. Then again, two separate boxes now with 1000 of only one of the ions and see what grompp says.

Charge of -0.000149 over 2,000 molecules sounds like a rounding issue with the charges, as the error has pointed out. http://manual.gromacs.org/documentation/current/user-guide/floating-point.html And not something that you need to worry about. Also see point 5 of http://manual.gromacs.org/documentation/current/user-guide/faq.html?highlight=floating%20point#questions-concerning-system-preparation-and-preprocessing

Thanks for the suggestion, Dr. DBW! We will try that asap!

Dr. DBW,

Really thanks for the tests suggestion:

A single cation yields 0.790566 net total charge.
A single anion yields -0.790566 net total charge.
A thousand cations yields 790.565938 net total charge.

“It never happened with me before”. ;)

Thanks a lot!