Make a serious dam (digging out the sides to make a small/large/dwarvenly lake) with several sets of mechanisms and levers for floodgates so you have several options:
- "Minimum Natural Flow": Stores a lake for you, but still lets the river flow. Adds some (not much) realism.
- "Screw Elves": No water for those damnable forests! MUAHAHAHAHA!
- "Screw nobles": Opens the Emergency Overrun channel that drains dangerously high water levels into the caverns. Via your nobles quarters. Make sure you can drain them afterwards, and that you don't flood the the fort by doing this. That's a different levers job.
- "Screw Goblins": Opens every floodgate on the dam that leads into the old riverbed. Should be combined with a fiendish entrance to your fort that probably doesn't alllow it to flood, designed to channel invaders into the path of the deluge.
- "Screw you Mister Baitykins!": Links to Kitten Storage Area.
- "Emergency Self Destruct": Why do we need a lever that routes several million litres of water through EVERY BIT OF THE FORT?* Um...it looks cool when we kill everyone?
- "FTW": Powers as many pump stacks as you can fit into your magma sources, to power an unspeakable engine of doom. Probably involves lava. Definitely involves Fun.
Things to keep in mind:
If building a fortress above/attached to the dam, it'll need some sort of overflow control that shuts doors and floodgates to protect anything important (and kill anyone caught outside, but that's not important)....which shouldn't be hard. And for maximum power generation and Dwarvenly Complexity, the dam's probably got to be quite thick. That way you can fit in comple machinery that no one really understands.
Actually, with your very own massive Dam of Doom, there's nothing you CAN'T do**. Waterfalls in every single bedroom, dining room, statue garden and graveyard full of the dwarves who drowned installing the waterfalls? Sure. Killing sieges with water? Sure. Magma? Sure. Obsidian? Yup.
*Yes, including the stuff above the dam. Route the parts going underground through waterwheels to power the pump stacks that flood the surface stuff.
**Except going to space. But if that ever becomes possible, a dam probably won't hurt.