The development of high-order numerical technologies for CFD is underway for many years now. In many contributions, it is shown that the accuracy of the method strongly depends of the accuracy of the geometrical discretization. In other words, the following question is raised:we have the high order methods, but how do we get the meshes? This talk focus on the generation of highly curved ocean meshes. We propose a robust procedure that allows to build a curvilinear mesh for which every element is guaranteed to be valid. The technique builds on standard optimization method (BICG) combined with a log-barrier objective function to guarantee the positivity of the elements Jacobian. To be valid is not the only requirement for a good-quality mesh. If the temporal discretization is explicit, even a valid element can lead to a very stringent constraint on the stable time step. The optimization of the curvilinear ocean meshes to obtain large stable time steps is also analyzed.