They may be designed to set spillway crest heights in dams, to adjust flow rates in sluices and canals, or they may be designed to stop water flow entirely as part of a levee or storm surge system.Since most of these devices operate by controlling the water surface elevation being stored or routed, they are also known as crest gates.In the case of flood bypass systems, floodgates sometimes are also used to lower the water levels in a main river or canal channels by allowing more water to flow into a flood bypass or detention basin when the main river or canal is approaching a flood stage.[clarification needed] Valves used in floodgate applications have a variety of design requirements and are usually located at the base of dams.Unless this energy is dissipated, the flow can erode nearby rock and soil and damage structures.