The ernst equation on a riemann surface