Consider the moduli space $\mathcal{M}_g$ of genus $g$ curves over $\mathbb{C}$. Let $d,r\geq 1$ be integers so that the Brill Noether number $\rho(g,r, d)=g-(r+1)(g-d+r)>0$ . I am mainly interested in the case when $r=1$.
Consider the locus $\mathcal{W}^r_d=\{C\in \mathcal{M}_g: W^r_d(C)\neq\emptyset\}$.
Here $W^r_d(C)=\{L\in Pic^d(C): h^0(L)\geq r+1\}$.
It is known that $\mathcal{W}^r_d$ is an open dense set in $\mathcal{M}_g$. What is the codimension of it's complement in the moduli space?
Thank you.