Rafael Nadal reached the semi-finals of the Brazil Open but needed to draw on his reserves to see off Argentine Carlos Berlocq 3-6 6-4 6-4.