The remove_ion_solvant() function is not necessary:
The deletion of found ions or solvent should be performed in the find_ion_solvant() function
The output of the gro file without H, ions and solvent should be done only once, after all ions and solvent have been searched and removed (in function count_remove_ion_solvant()).
The
remove_ion_solvant()
function is not necessary:find_ion_solvant()
functioncount_remove_ion_solvant()
).