Less than a year ago, Shah Mohammad Reza Pahlavi was pressing ahead with massive arms purchases aimed at turning Iran into a regional military superpower.

Today that dream is shattered. The Iranian armed forces have proven unsuited to maintaining order at home, arms procurement is paralyzed and Western weapons orders worth about $20 billion face either cancellation or indefinite postponement, according to military analysts here.

With the Iranian economy on the ropes and the country's new prime minister calling for sharp military spending cuts, outright cancellation of some major weapons orders and projects seems likely, the sources say. But even so, they add, Iran could be obliged to pay heavy penalties under contract cancellation clauses.

Since the early 1970s, Iran has bought about $22 billion worth of weapons from the United States alone, most of it since 1974 after oil income quadrupled. Of this, about $12 billion worth has yet to be delivered, ranging from missiles to aircraft.

On top of these orders, Iran had planned at least $9 billion in new arms purchases over the next three years, diplomatic sources said.

Much of this is now in doubt, if not already sacrificed to the upheavals that have wracked the country for the past year.

The new prime minister, Shahpour Bakhtiar, has promised to curb the shah's unbridled military spending, which has drained manpower and resources from development projects, fueled inflation and brought to Iran thousands of American defense contract personnel.

Bakhtiar says Iran can no longer afford the shah's anbitious role of being "the policeman of the Persian Gulf." He has said the Iranian armed forces should concentrate on defending the country's borders rather than dominating the area.

Bakhtiar has asked the new finance minister to "prepare a list of what we can afford to buy and what we have to cancel."

Military analysts say that even if Bakhtiar's government survives, it cannot cut back too severely on weapons spending because it must try to accommodate the hard-line armed forces. If the Bakhtiar administration succumbs to continued disturbances or a possible military takeover, the sources said, any new regime would probably be forced to sharply reduce new purchases and projects because of the economic shambles.

Already, four military co-production projects, worth more than $1 billion combined, have been abandoned, military sources said. One of them, a $575 million Iranian-U.S. facility for assembling Bell helicopters, was under construction near Isfahan when it was canceled last month.

An ordnance complex being built by British firms at Isfahan to make spare parts for Chieftain tanks has also been canceled, along with projects in Shiraz to make American TOW antitank and Maverick air-to-ground missiles and to produce the British surface-to-air Rapier missile.

In addition, a naval base under construction by a U.S. contractor at Chah Bahar on the Gulf of Oman is being scaled down drastically from its original $2 billion cost, military sources said.

Located outside the entrance to the Persian Gulf, the base was to be a key element in the shah's efforts to control the gulf and extend Iranian naval power into the Indian Ocean.

Chah Bahar was also to be the home port of sophisticated Spruance-class destroyers worth $1.5 billion that Iran has ordered from the United States.

Now, however, there is speculation that the new government, seeking to drop its role as protector of the gulf, may not want the destroyers, through most of the money for them has already been paid.

Even more doubtful are plans to purchase six West German submarines and two dozen other war vessels worth $3.5 billion.

There has been no sign of plans to cancel a contract signed in March for six small submarines, but know-ledgeable Western military attaches doubt Iran will go through with the purchase.

"Inside the military establishment and the arms purchasing organization there is no decision-making anymore," one attache said. "They're so confused they can't decide what should be their priority in cutting back. They're just waiting and waiting, and time is slipping away."

Military analysts said that the new Iranian government might cancel a major purchase of 160 American F16 fighter planes, which are due for delivery in the early 1980s, even though Iran has already made substantial advance payments on the $3.2 billion deal.

The sources said it was unlikely now that Iran could absorb such a major purchase.

Officials stressed, however, that no contracts for U.S. aircraft deliveries have yet been canceled, although the Iranian war ministry has indefinitely postponed action on the shah's arms "wish list" presented to the Carter administration last year.

Among the major purchases still officially going ahead are seven radarequipped Airborne Warning and Control System planes, valued at $1.2 billion, with other parts of the air defense system estimated to cost another $1 billion.

Three more AWACS planes were on the shopping list presented to the Carter administration after the shah visited Washington in November 1977, sources here said.

"All major items on that list are being postponed except 70 additional F14s, which have been canceled," one said. Iran already has received 80 F14s. The planes are armed with the sophisticated Phoenix missiles and are the only aircraft in Iranian possession capable of countering the Soviet Mig 25.

Among the postponed items on the shah's list are several hundred aircraft intended to upgrade and strengthen Iran's fighting and transport capabilities. Including the F14s, aircraft on this list would cost about $9 billion.

According to the sources, the shah also expressed interest in some new warplanes still on the drawing board, and the Pentagon had encouraged him.

"That's all wonderland stuff now," one source said. The vast expenditures, the manpower required and the need for thousands more American contractor personnel in an environment increasingly hostile to them have combined to makes such orders more unlikely.

As it stands, Iran will have its hands full just trying to keep up with its existing military programs, the sources said.

With the need to purchase spare parts, maintain equipment and build facilities such as repair depots, the cost of continuing the present programs is estimated at $2 billion a year.

This is seen as enough to justify the presence here of many U.S. military personnel, who advise Iran on weapons procurement, process sales and help the armed forces use the U.S. products.

There are currently about 1,200 U.S. military and defense department personnel in Iran and about 1,500 employees of private U.S. contractors, down from a high earlier this year of about 8,000.