Capital In fl ows , Resource Reallocation and the Real Exchange Rate