I cannot recall if I have linked to this Ricardo Reis paper (pdf) before, but it is the place to start reading on this topic. Here is the abstract:
The Portuguese Slump and Crash and the Euro CrisisBetween 2000 and 2012, the Portuguese economy grew less than the United States during the Great Depression or than Japan during the Lost Decade. This paper asks why this happened. It makes four contributions. First, it describes the main facts between 2000 and 2007, proposing a narrative for why the country did not grow. Second, it puts forward a model of credit frictions where capital inflows are misallocated, so that more integrated capital markets can lead to losses in productivity and an expansion of unproductive nontradables at the expense of productive tradables. Third, it argues that this model can account for the Portuguese slump, as a result of misallocated capital inflows and increases in taxes. Fourth, it shows that the crash after 2010 came with a sudden stop of capital flows, combined with fiscal austerity, downward nominal rigidities, and a diabolic loop between banks and sovereigns.