Image copyright Getty Images Image caption Heavy flows from the Oroville dam spillway push debris into the river

On the banks of California's Feather River, way below the tallest dam in the United States, is a ballet of steel and stone.

The dancers are huge earth-moving machines, their costumes bright yellow.

The movement is constant and mesmerising. The lorries trundle down to the water from the left, pause to accept their loads of rock, mud and debris, and then exit to the right.

For weeks now this performance has been constant, day and night, as construction workers repair the Oroville Dam, once an engineering marvel, now an embarrassment.

Last month, nearly 200,000 people were told to leave their homes when the dam overflowed amid fears that water pouring over a weakened emergency spillway was eroding the hillside beneath the structure.

In desperation, engineers diverted a torrent of storm water away from the danger area and down the dam's main sluice. The decision prevented disaster but at the cost of tearing huge chunks out of the spillway.

Now, with repairs to clear up the detritus and fix the giant scars underway, the worry is that this will happen again, somewhere in the United States, and that next time the consequences could be deadly.

The average age of the 90,000 dams in the United States is 56 years. By 2025, seven out of 10 of them will be more than half a century old.

Media playback is unsupported on your device Media caption Aerial views of one of the Oroville Dam's two damaged spillways

The American Society of Civil Engineers (ASCE) warns that "many dams are not expected to safely withstand current predictions regarding large floods and earthquakes".

Overall, says the society, $4.6tn (£3.6tn) will be needed by 2025 to bring US infrastructure to an acceptable standard. Less than half that amount has so far been allocated for the work.

Earlier this month the ASCE published its quadrennial report card on the nation's infrastructure, awarding the US a grade of D+ on a scale of A to F - no change from its previous report in 2013 - and warning that continuing on the present path would cost the US $3.9tn in lost GDP and 2.5 million jobs over the next eight years.

The report concluded that over the previous four years there had been no overall improvement in aviation, bridges, dams, drinking water, energy and roads.

The situation with parks, solid waste and transit had worsened, while there had been some improvements in hazardous waste, inland waterways, levees, ports, rail, schools and wastewater.

"We have been doing what we thought was enough but clearly we missed a few things," says Bill Croyle, acting director of California's Department of Water Resources and the person responsible for the Oroville Dam.

Mr Croyle is reluctant to admit any specific mistake, insisting, for example, that years of warnings about risks to the dam are not relevant.

"This is a catastrophic event but we're all learning from this," he says.

Bridges in Danger 4 in 10 US bridges are more than 50 years old 56,000 were structurally deficient in 2016

188m trips across a structurally deficient bridge per day (average)

$123bn estimated backlog funding to rehabilitate bridges Getty Images

But is the US learning fast enough?

The country has 15,500 "high-hazard potential dams", meaning that loss of life would be probable if they failed. Of those high-hazard dams, 2,170 are rated as deficient.

Federal legislation to repair dams has been passed but, says the ASCE, it is not properly funded and an extra $45bn is needed for repairs now.

The problem, and not just for dams, is that much of America's infrastructure is coming to the end of its lifespan.

The US saw two major building booms in the past century.

The first came under President Franklin Roosevelt's New Deal during the Great Depression of the 1930s.

The second was in the 1950s and 1960s with the construction of the interstate highway system. And, minutes after he was elected President, Donald Trump promised a third.

American infrastructure, he pledged, would become "second to none".

That will be an epic challenge.

The ASCE report says US roads are "chronically underfunded and becoming more dangerous" and assesses that one in every five miles of highway is in poor condition.

More than two of every five miles of urban interstates are congested, contributing to an estimated $160bn in wasted time and fuel in 2014.

Deaths on the roads, falling for years, rose by 7% in 2015.

There are also problems with the power grid. More than 640,000 miles of high-voltage lines are at full capacity. Most US power lines were constructed in the 1950s and 1960s and are already past their life expectancy.

Public transit is also "chronically underfunded", ASCE says, with a $90bn rehabilitation backlog.

And airports in the US serve more than two million passengers every day. But airport infrastructure and air traffic control systems are "not keeping up," ASCE says, resulting in increased congestion.

On the campaign trail Mr Trump had been particularly scathing about the country's airports, suggesting that several, including Los Angeles International (LAX), made the US look like a third-world country.

Any frequent flier at LAX would tell you that he had a point. Traffic is jammed, wires hang from terminal ceilings and there are delays, delays, delays.

Ageing water infrastructure Two trillion gallons of drinking water lost every year from water main breaks $1tn estimated funds need to maintain and expand pipe system

75-100 years Average life span of US water mains, many laid in early-to-mid 20th Century Getty Images

However, according to the operators, change is already coming and it has nothing to do with the Trump White House.

Since 2009, LAX has been spending billions on more gates, new rail links and smarter terminals.

The funding, says an airport spokesman, is mainly from passenger fees and private capital.

"We are an incredible, robust airport," insists Deborah Flint, chief executive of Los Angeles World Airports. "We have fantastic facilities here already but we are taking them to that next level which will be the gold standard airport."

Ms Flint is reluctant to be drawn into politics, but when pressed she rejects the president's characterisation of LAX.

"Are we where we want to be? No, we certainly are not. But is today's experience third world? No, it is absolutely not," she says.

An hour's flight to the north, a fountain plays in front of the Hoover Institution, a public-policy think tank at Stanford University.

The water comes from one of two huge and ageing projects to provide drinking water and irrigation to the state's central valley, in a network that includes the Oroville Dam.

Image copyright Getty Images Image caption Travellers at Los Angeles International Airport in December

Victor Davis Hanson, a senior fellow here, calls Oroville the "canary in the mine".

He is not optimistic about the future of US infrastructure, unconvinced that fiscal conservatives in President Trump's party will approve a huge spending splurge.

Nor does he think Mr Trump's talk about doubling economic growth to fund big improvements is realistic.

Instead, he says, higher fuel taxes would be sensible, along with tax reform to encourage American companies to invest some of the massive wealth they are holding offshore in the United States. But the problems will not be solved, he argues, until the ballooning cost of Social Security and pensions are brought under control.

If that doesn't happen, says Dr Hanson, the US risks becoming a "19th Century country".

"Life as we knew it in the 21st Century of the United States is going to increasingly look like what's normal in other parts of the world, especially in Latin America, Asia and Africa," he says.

"It's just not going to be a 21st Century western country."

The immediate challenge, it seems, is not to make America great again, but to stop it from falling apart.