Let $X$ be a compact Riemann surface of genus $g\geq 1$. If $f$ is a meromorphic function on $X$ then, the meromorphic differential $\omega=\frac{df}{f}$ is a differential of the third kind with integral residues.

**Q** Let $\omega$ be a meromorphic differential of the third kind on $X$ with integral
residues. Is there a general **algebraic** criterion to decide when is $\omega$ the logarithmic derivative of a meromorphic function $f$?

P.S. One may give an analytic criterion by observing that $\omega$ is a logarithmic derivative if and only if the periods of $\omega$ lie in $2\pi\sqrt{-1}\cdot\mathbb{Z}$. Indeed, if all the periods lie in $2\pi\sqrt{-1}\cdot\mathbb{Z}$, then the function $z\mapsto e^{\int_{z_0}^z \omega}$ is a well defined meromorphic function on $X$. If the curve is given by the zero locus of polynomials, it is probably possible to rephrase artificially this analytic criterion in terms of an algebraic cup product.