Hysteretic behavior of the flow under a vertical sluice gate