WASHINGTON — The U.S. Navy is gearing up to peel back the onion on years of delays and tens of thousands of operational days lost with ships languishing in shipyards.

The defense appropriations bill, newly approved by Congress and sent to the White House, orders the secretary of the Navy to “conduct a comprehensive and systematic analysis to identify the underlying causes of aircraft carrier, surface ship, and submarine maintenance delays,” and submit a report to Congress within 180 days.

Budget documents released by Congress say the Navy is working on ways to improve maintenance, but the efforts lack any understanding of the fundamental issues.

“Since fiscal year 2014, Navy ships have spent over 27,000 more days in maintenance than expected, with 70 percent of maintenance periods on average experiencing delays,” the documents read. “There is some preliminary evidence that the Navy has begun pilot efforts to analyze maintenance challenges for some elements of the fleet. However, these efforts are not comprehensively examining the root causes of delays across the entire fleet.”

Maintenance delays in the shipyards have been a perennial problem for the Navy, one that has ballooned as the Navy shrunk but demand for the fleet remained. This led to increased operations tempo for the remaining ships and deployment extensions that made planning shipyard availabilities difficult.

Still, Navy officials suspect that much of the issue could be bound up in poor front-end planning at the deckplate level. In comments earlier this month, Chief of Naval Operations Adm. Michael Gilday said he needs sailors and wardrooms to ensure the service is diligent about noting when repairs are needed.

“The first thing I talk about in the readiness section [of the new design] is maintenance,” Gilday said, referring to his new planning guidance. “We are getting 35 to 40 percent of our ships out of maintenance on time: That’s unacceptable. I can’t sustain the fleet I have with that kind of track record.

“It really goes back to basics. One of the things we’ve found, looking at a substantial amount of data, we’ve concluded so far that 25 to 30 percent of our delays are due to bad planning and poor casting up front. So there are things we definitely need to do within the lifelines of the United States Navy that we have to get after, and we are getting after it.”

A review of sorts is already underway. In his new guidance, Gilday ordered a 60-day review by Naval Sea Systems Command to assess the state of the ship-repair industrial base, and he tasked the fleet to reduce shipyard delays by 80 percent.

The Navy’s maintenance accounts have become a contentious subject this year. At Gilday’s confirmation hearing, Senate Armed Services Committee Chairman Sen. Jim Inhofe cited a nearly $2 billion shortfall in the Navy’s maintenance accounts.

That shortfall, sources told Defense News, was exacerbated by the Defense Department using money for President Donald Trump’s border wall, hurricane relief and fixes to crumbling base housing that ate up reprogramming authorities that limited how much the Navy could shuffle its own budget to make up the gap.