Gmx dipoles and index groups vs molecules

GROMACS version: 2024.4
GROMACS modification: No

I have an MD trajectory for a system (protein+explicit solvent+ions) and would like to calculate the dipole moment of the protein, including some of the ions that are bound to the protein, using:

gmx dipoles -f traj.xtc -s md.tpr -n index.ndx

If I include all atom numbers of the protein in a single index group and select this group when prompted by gmx dipoles then I do get the expected results. However, when I make a new index group including, next to the protein, also some ions, I get exactly the same results as in the first case.

Turns out, in the doc for gmx dipoles it says:
“For molecules with a net charge, the net charge is subtracted at center of mass of the molecule.”

So I expect what’s happening is that the ions that are included in the index group, being individual molecules, are individually moved to the origin (which is where gmx dipoles moves the center of mass of my system) resulting in a zero contribution to the total dipole moment. Since I would like to know the dipole moment of the total system (protein+ions) this is not what I want to happen.

Any ideas how to deal with this situation highly appreciated!

regards
Michael