  Using constructions of the Whitham perturbation theory of integrable system we prove a new sharp upper bound of $3g/2-2$ on the dimension of complete subvarieties of $\M_g^{ct}$. 
Real normalized differentials and compact cycles in the moduli space of   curves