The effect of the longshore dimension on dune erosion