Inverse methods and data assimilation in nonlinear ocean models