For a coherent sheaf $\mathcal F$ on a smooth irreducible projective variety $X/k$, it makes sense to define the rank $\textrm{rk }\mathcal F$ as the rank of the vector bundle $\mathcal F|_U$, where $U$ is the open subset of $X$ where $\mathcal F$ is locally free.
Ideal sheaves $\mathscr I\subset\mathcal O_X$ are coherent of rank one.
Question. Is there a known criterion saying when a coherent subsheaf $\mathcal F\subset \mathcal O_X$ of rank one is an ideal sheaf?
Thanks for any suggestion, or reference.