It begins as fresh snowmelt, streaming from Mount Ritter's gray granite faces into Thousand Island Lake, a bouldered mirror. The clear blue water spills out through a narrow canyon, and the San Joaquin River is born.
When conservationist and mountaineer John Muir first explored these upper reaches, the narrow gorge barely contained the power of the living river, which carried the continent's southernmost salmon run, sustained Indian tribes and set the rhythm of life in the valley below with floods and droughts.
"Certainly this Joaquin Canyon is the most remarkable in many ways of all I have entered," Muir wrote in 1873.
Today, maps still show the San Joaquin River meandering to the Pacific via San Francisco Bay -- but it is not the river Muir marveled at.
Its waters, trapped behind dams, disappear into California's intricate plumbing system, channels that most maps do not show. Diverted river water nurtures a rich agriculture economy and California's unstoppable growth, but it is also at the center of a long-running environmental battle. Should the flow be released down the old riverbed to bring back the salmon Muir described? How to balance commerce, growth and nature?
The San Joaquin's future will offer lessons for America.
The United States was still pushing westward when Muir arrived. As it edged aside those who had lived here before, towns sprang up along the railroads, and the first plows cut through California's vast Central Valley.
Muir fought the river's first diversions, inspiring early environmentalists, but he could not stop waves of migrants from fencing in the valley and building small irrigation projects and dams to curb the floods and feed their fields.
Agriculture began driving the state's economy, and California was booming. But by the early 20th century, farmers were pumping their wells dry. Between drought and the Great Depression, farmers were being forced off their land just as Dust Bowl migrants were flowing into California.
Politicians realized that with a stable water supply, California could feed and employ millions. And the San Joaquin, which drains an area larger than New York and New Jersey, could provide both water and electricity for the region.
By 1935, Congress approved emergency funds for the Central Valley Project, with the massive Friant Dam at its concrete heart and open channels radiating north and south. Friant's construction in 1944 put an end to the farmers' concerns, reviving the economy. Towns blossomed along the canals. More than a million acres of farmland came to life, producing more than 200 crops, from fruits and vegetables to cotton.
"It made this valley live," said Harvey Bailey, whose family grows 1,100 acres of oranges and lemons in Orange Cove, 50 miles south of the dam.
But the 314-foot concrete wall changed the river as well. Most years, less than 5 percent of the historic flow goes down the old riverbed -- just enough to remind locals of what they lost.
"A terrible injustice was done to that river," said Bud Rank, whose family farmed on both riverbanks before the dam was built.
His father, Everett, and other downstream farmers watched the San Joaquin's water drop out of reach of their pumps, which were left perched high on the riverbanks like giant mechanical mosquitoes. They went door to door to raise money for a lawyer, and 16 years later, their case finally reached the U.S. Supreme Court. Everett Rank borrowed money to go to Washington, but the case was turned down on a technicality. He was devastated; he suffered a heart attack on his way home and died.
"We lost," his son said, "but really, it was the river that lost, and all the things that lived in the river."
The San Joaquin now surrenders to parched gravel just 37 miles below the dam. Where spawning Chinook salmon once ran thick, lizards and tumbleweed inhabit a riverbed that often goes years without water.
That has led to another court fight, which is coming to a head. Seventeen years ago, environmentalists sued the U.S. Bureau of Reclamation, accusing the agency of violating state law by not letting enough water flow to maintain the historic salmon population.
In October 2004, a federal judge in Sacramento agreed. Angrily protesting, farmers, mayors and businesspeople pointed out that their towns, jobs and crops have relied on San Joaquin River water for decades, and that some of the state's fastest-growing cities are in the Central Valley.
"The conclusion that the bureau has violated its duty hardly begins to address the problem of remedies," Judge Lawrence K. Karlton acknowledged.
How to balance competing needs for such an essential public resource in the decades ahead? How to decide the volume of water going downriver? A February trial will take up such questions -- with consequences far beyond the region.
California grows 80 percent of the United States' eating oranges. Much of that fruit -- about 15 million 75-pound boxes -- passes through nine plants in the town of Orange Cove, where lush groves cover the surrounding hills.
Growers such as Bailey, who farms with his brother Lee Bailey, know well there is little natural water here. His fruit trees -- like Orange Cove's 9,255 residents -- are sustained by water diverted from the San Joaquin.
"Without it, we'd just dry up, the farms, the town, everything," Harvey Bailey said.
He remembers how it was in the 1940s, when so many wells were sunk the shallow aquifer was going dry. Some towns responded with lawsuits. Saboteurs blew up pipelines. It was a grim time.
Thanks to the Friant Dam, the river water now sustains more than 1,500 square miles of productive farmland on the east side of the Central Valley. Besides citrus, many of the grapes, almonds and other crops that feed the country -- about $2 billion worth a year -- are grown in an area that gets only 10 inches of rain a year.
Victor Lopez, a former farm worker and Orange Cove's mayor for 30 years, helped bring the packing plants to town, creating many reliable, though low-paying jobs. Now he is trying to diversify: He went to China to pitch Mexican food made in Orange Cove, and he is talking to Koreans about establishing a computer-parts assembly plant.
Still, he said, standing in the town's brand new rural development and job training center: "All investment, all our growth, depends on water -- not just ag. Any business that's thinking about coming here, that's the first thing they want to know: Do you have water? It's our livelihood, it's everything."
Herons, egrets and grebes seek out the river's brief run downstream of the dam, and Fresno residents come to cool down in the high heat of summer.
But even this shallow stream has new demands on it: A developer plans to replace orchards on the riverbank with a new housing complex, the first 180 homes of a 1,646-home subdivision that is expected to grow into the new city of Rio Mesa, population 100,000.
Water for the new homes would come from the San Joaquin, courtesy of decades-old contracts given by the Bureau of Reclamation to farmers. Opponents say the contracts were never intended for lawns and carwashes. But attorney Tim Jones, representing River Ranch Estates, says it is a case of some water users -- environmentalists and farmers -- wanting to limit access to another user, his client.
Such battles seem inevitable in the years ahead -- demographers predict the Central Valley's 5.5 million population will more than double to 12 million by 2040, as California's population grows from 36.5 million to a 51.5 million.
"The San Joaquin is a hardworking river, but it can't continue to take the abuse," said Bill Jennings, who ran a tobacco and fishing-gear store until a large fish kill inspired him to launch DeltaKeeper, an environmental advocacy group.
In his small motorboat, pipe protruding from his snowy beard, Jennings looks more pirate than protector of the marshy delta where the San Joaquin river ends in a maze of channels, turbines and levees.
He navigates along former wetlands lined with broken concrete and wire mesh, past pipes that pour Stockton's wastewater and urban runoff into the river. Piles of powdery sulfur used as fertilizer blow from the banks, coating the surface in a bright yellow film.
For the rest of its course, the river serves as a drain, taking leftover irrigation water from farm fields, mixing fertilizers, pesticides and other chemicals with runoff from city streets and golf courses and what little water still flows beyond the dams on the San Joaquin's tributaries. Then it empties into the delta, where water is pumped south again.
"A watery landfill," Jennings called it.
The Metropolitan Water District, serving 17 million Southern Californians, is already the largest customer for delta water and has coveted purer San Joaquin River water, especially since California's share of the Colorado River was cut by 15 percent two years ago.
For several years now, there have been discussions about a swap that would give Los Angeles upriver San Joaquin water, which now irrigates crops. Farmers on the east side of the valley, in exchange, would be allowed to use the MWD's storage facilities, providing better access to water in dry years. To make economic sense, the swap would have to involve at least 100,000 acre feet of the river's flow -- enough to serve 200,000 Los Angeles homes per year with pure mountain water.
A deal is still in its beginning stages, but could benefit both sides, said Ron Jacobsma of the Friant Water Users Authority, the agency that manages the Friant-Kern canal.
But even supporters say they are cautious. Sending farm water to the big city smacks of the backroom deal-making that diverted the Owens River to Los Angeles.
"We have to make sure that over time, it's not foolish," said Jacobsma.
Though the deal's far from done, a hand-drawn sign posted on a ranch by the river is already asking the inevitable question: "San Joaquin River Water -- Whose is it? The VALLEY's? Or LOS ANGELES'?"
DeltaKeeper and other environmental groups would add a third stakeholder: native plants and animals such as the chinook salmon.
The competing claims will be central when the trial on how much water should be released begins in U.S. District Court in Sacramento in February.
Meanwhile, Central Valley farmers, businesses and small towns hold urgent meetings, imagining a decision that could threaten their futures.
And Jennings imagines what the river and the delta could be if flushed clean by snowmelt every year, as it was back when John Muir walked the San Joaquin's banks.