Think of the District Building as the Pentagon, and it is easy to understand the story of the city's new Financial Management System. It is like a new missile that will revolutionize combat -- if it ever flies.

Five years of bureaucratic trench warfare and $38 million have gone into the design and development of FMS, a computerized accounting and financial reporting system designed to be the ultimate weapon in the battle of the budget.

The result is an electronic marvel. Its concept combines the latest sophisticated computer programming with rigid organization to impose order on the District's chaotic accounting.

Congress and the city are committed to it. The old accounting system has been scrapped, and FMS terminals have been installed in every District government department. All financial transactions are coded into the system, and the computer writes the checks.

The system is so sophisticated that the operating manuals fill entire bookcases, and it stores and gives back information about city spending that is more detailed and voluminous than ever before. Anyone with a key to the codes and access to a terminal can find the payments to Blackstone Florists and Harry's Liquor charged to Mayor Marion Barry's office.

But Barry and other city officials say, and the designer of FMS concedes, that the system still does not give the mayor the information he needs to manage the city's finances.

It puts out exhaustive reports every month, thousands of pages of eye-glazing numbers. But those reports do not tell the mayor or the city administrator how much money the city has spent or how much is left in the budget.

FMS does not tell clearly where the money came from, nor does it mesh yet with the city's payroll accounting system.

An intense effort has been going on for months to rewrite the computer programs and reorganize the information the city puts into them to make FMS the powerful weapon it was intended to be. The participants, some of whom are personally and professionally antagonistic to each other, say that progress has been made and that FMS can succeed. Barry said in a recent interview that he had been assured that the system he calls "the Rolls-Royce of accounting" can work completely by October -- the most optimistic assessment available.

In late May, Jan M. Lodal, executive vice president of American Management Systems Inc., the Arlington consulting firm that designed FMS, acknowledged in a letter to Barry that "FMS is not adequately serving your needs or those of other top District managers."

In the long-range financial plan for the District that he proposed last month, Barry said that defects in FMS have "led to serious difficulty with the availability of expenditure data in the face of serious budget and revenue problems we are facing."

And last week, city administrator Elijah B. Rogers, in a memo to top city officials, said that "the first year of operation of the Financial Management System has shown that there are a number of improvements in the accounting and fiscal management structure which must be made to provide a clearer picture of agency fiscal management."

Confusion and frustration are normal in the shakedown period of any complex computer system, but the District's problems with FMS go beyond what would be considered normal delays and breakdowns. They were caused partly by the fact that the system was put into operation before its design was completed and tested -- the accounting equivalent of firing a missile in combat before any test models had been launched.

Even more critical is a fundamental disagreement over how FMS should work and what it should do. FMS was designed for one accounting method and the District has insisted on using another.

Who's to blame for the problems depends on whom you ask.

City officials say that American Management Systems and the congressional commission that ordered the system failed to consult them about what it should include AMS consultants and commission staff members say that city officials were consulted, but lacked the competence to guide AMS in developing the program.

All agree that the program was crippled by sloppy operations at the District government's computer center where "system software" -- periodic instructions from IBM on revisions in computer programming and operations -- was ignored for more than a year and the machines were out of operation half the time.

Even if the system were operating perfectly, however, District government officials would not be satisfied with it.

In the words of David Splitt, director of the city's Office of Documents who is part of the team trying to reorganize FMS, "it tells you everything about every leaf on every tree, but there's no map of the forest."

FMS was put into operation Oct. 1, the beginning of the 1980 fiscal year, but as late as last month there was serious doubt about whether it would ever justify the investment or produce the information required.

Lodal, a former strategy analyst on the White House's National Security Council staff under Henry Kissinger, told the mayor the FMS "cannot successfully operate" under the conditions that prevailed in the computer center. He said that the city's employes were not competent to deal with "the more sophisticated functions of the system," and that 'in an environment in which very little operates reliably . . . it makes little sense to continue efforts to implement these."

Splitt said the system was 'a bulldozer when we needed a pail and shovel," and that he had "serious doubts about whether we're going to pull it off or not. We may be carted off to the rubber room, but we're going to give it our best shot."

Other city officials spoke in even stronger language. One called FMS a $38 million turkey, totally unworkable." Another said that "the damn thing is another C5A, right here on Pennsylvania Avenue." Supporters of FMS -- whose numbers are growing as the system is refined -- agreed that it was not functioning properly but said that was because city employes were incompetent. They suggested that some city officials were refusing to cooperate with the FMS because they did not like the ease with which information about how city money is spent could now be made available to the mayor, Congress and the public.

One admirer of FMS, trying to demonstrate its potential for embarrassing officials who have been able to hide their transactions in the past, pushed the buttons to call up on the screen of his terminal a page of Department of Human Services expenditures that had been charged against day-care funds. Up came bills paid to Eastern and Texas International Airlines.

"Airline tickets," he exclaimed. "Who's using day-care money for airline tickets? Let's find out." He then punched onto his keyboard the voucher numbers accompanying the tickets to find out who had signed them -- only to have the numbers disappear from the screen, replaced by a notice that the computer was shutting down because of air-conditioning problems.

Splitt gave another demonstration: trying to pay a bill for $68.30 owed to a supplier of computer training manuals. The FMS computer would not issue the check because the original purchase order, stored in its data bank, had been for only $65. The difference, Splitt said, was for shipping charges, but the computer's controls are so tight that it held up payment until special instructions were fed in that overrode the original purchase authorization.

Since all purchase and payment orders must now go through the computer, and will be stopped there unless the computer determines that they have been approved and are within budget, the system contains minute details on what the money is being used for -- details no amount of study of the city's printed budget would reveal.

It also allows Barry's financial managers to control expenditures by changing the codes, as they recently did to require that all new contracts and purchase orders be approved by City Controller Al Hill.

But the system's problems do not involve the specific transactions. They are caused by the differing views of the consultants and the District government on how the city's financial picture should be computed.

"It's a difference between philosophies of budgeting," Splitt said. "But contractors aren't supposed to have philosophies. Their customers have philosophies."

The contractor, however, does not work for the District government. American Management Systems' contract was issued by the Temporary Commission on Financial Oversight of the District of Columbia, an agency established by, and responsible to, Congress.

The commission was created in the mid-1970s when it was discovered, shortly after the start of the new home rule government, that the city's records could not be audited. The commission hired the consultants to revamp the city's bookkeeping and accounting practices so that independent auditors could give an unqualified report on the state of the District's finances.

That audit is now in preparation, and FMS is the key to it. By law, the audit is to be completed by February.

The commission accepted a "system design concept" that would report the District's finances on a "gross budget" basis -- that is, report every expenditure and every item of revenue, from whatever source, as one total spending program. The District, however, does not operate that way; it leaves out of its budget document about $500 million a year in expenditures funded by direct federal grants, rather than appropriated by Congress.

This has led to a continuing and highly esoteric dispute in which, District officials complain, FMS' failure to distinguish between revenue sources makes it difficult, if not impossible, for them to obtain reimbursements to which the city is entitled.

The dispute is complicated by the fact that the Barry administration came into office just as the system design was being completed and that key staff members under Mayor Walter Washington quit or were fired when they were the only ones who understood it.

Robert Stephens, the commission's executive director, said that "we told them for five years that this system would require a substantial increase in the number of experienced financial management people in the city government. The system is only a tool, only as good as the people using it. In my view, they have not responded sufficiently to this need."

But Stephens said he was "much more optimistic" now than three months ago as Splitt and assistant city administrator Edward Winner have worked with the consultants to rewrite the programs and force city workers to comply with them.

"This is now an excellent system," Winner said. "It's vastly more complex than just something that gives us reports of expenditures. It's vastly superior to what we had before. Saying it doesn't do this or that is not saying it's therefore a bad system." But Winner added, "I suspect it will take another year before we get the bugs out."