How to calculate rotational diffusion in gromacs?

GROMACS version:
GROMACS modification: Yes/No
Dear all,

Diffusion coefficient of water especially in porous medias like polymer is multiple of translational and rotational diffusion coefficient (DT + DR). In Gromacs we can have just translational diffusion coefficient using MSD. I want to calculate rotational diffusion coefficient in gromacs.I know I have to calculate mean squared angular displacement. is there any specific module to calculate MSAD like MSD or I have to use other method?

Thank you very much