Free upper boundary value problems for the semi-geostrophic equations