How to center molecule along XY plane?

GROMACS version:2020.3
GROMACS modification: No

Hello all,

I am working on simulating a small anion in the water/vapor interface and after the production run in a box elongated in the z-direction, I have extracted snapshots where the ion is at the interface. The following is a representative snapshot which will be use in further analysis:

I want the molecule to be centered in the XY plane for all the snapshots but I cannot find any tool to do that. I wanted to ask if it is possible to enforce PBC along certain planes using already available GROMACS commands.

gmx trjconv -fit transxy will apply a translational fit using only X and Y components of the coordinates.