On the role of the mesoscale circulation on an idealized coastal upwelling ecosystem