During the revolutionary turmoil that pulled down the shah of Iran, President Carter clung to the belief that the shah could be saved, even though the shah himself had lost faith in his own power, a five-month investigation by The Washington Post has found.

Two months before the shah fled to exile, when Iran was aflame with protest, the president's national security adviser personally telephoned the Iranian ruler, urging him to use military force to smother the revolution. t

A few weeks later, the president was advised to abandon the shah by an outside foreign policy expert whom he called in for counsel. Tell the shah to take a long vacation, the president was told, and begin preparing for a new government in Iran. The president said he couldn't do that to an important allied leader and wouldn't.

Indeed, in that same period, State Department sources say they worked to soften the draft of a message from Carter to the shah, urging again the use of force against the domestic opposition, although the White House insists that no such message was ever sent.Secretary of State Cyrus R. Vance and his top aides feared such a message would lead only to considerable bloodshed and possibly civil war, turmoil that could only worsen America's position in the future of Iran.

The president held to his hope, even when most of his top foreign policy advisers were urging him to ease the shah off his throne and begin the transition to whatever political forces would follow in power. In the final weeks, the U.S. ambassador in Tehran, once one of the shah's staunchest supporters, cabled his exasperation to Washington. The president's attitude, he said, was "short-sighed and did not understand where the U.S. interests lie."

One month later, in any case, the shah was gone, permanently exiled. While the American president was surrounded by conflicting counsel on whether the peacock throne could be saved, one person, ironically, who knew with certainty that the shah was doomed was Mohammed Reza Pahlavi himself.

The shah, notwithstanding his reputation as a bloodthirsty tyrant, disregarded eleventh-hour advice from Washington to get tough with street demonstrators and opposition leaders. He was convinced in his own mind that force could not prevail for long. He knew that he was slowly dying of cancer and was anxious to leave behind a stable nation that his young son could rule. Finally, confused by conflicting signals from the United States and pressured by European leaders to abdicate, the shah in his last month in power moved to accommodate the moderate opposition, to live with some dissent and relinquish some of his vast powers.

These are hidden details from a long and complicated history, the slide of events which led to the fall of the shah and the establishment of a hostile government in what was once America's most reliable ally in the Persian Gulf. Today, perceptions of that tragic event are confused by quick assumptions about precisely what happened. President Carter, for instance, is widely accused of abandoning the shah prematurely. In fact, Carter still hoped to preserve the shah's power long after intelligence reports and top foreign policy advisers insisted, as a matter of realism, the United States must assist the orderly transition to whetever political forces were going to displace the peacock throne.

This much is certain: The fall of the shah involved a bitter though collegial contest among the president's key advisers, contending for control over foreign policy and veering back and forth in their prognoses for events, stalemating policy with their disagreements.

Zbigniew Brzezinski, the president's national security adviser, appears intransigent in this account, stoutly resisting the "unthinkable" outcome that lay ahead, demanding the toughest policy line and ultimately prevailing over others who saw the future more clearly.

Vance, preoccupied with other matters, arms talks with the Soviet Union or the Egyptian-Israeli peace talks, was strangely inattentive to the alarm bells within his own department until it was too late to make a difference.

And the U.S. intelligence community, once again, seems badly out-of-focus in perceiving the realities of popular discontent within an allied nation. Some in government did see the picture in Iran clearly, but their perceptions simply did not get through to the president and his policymakers, especially if their distasteful warnings collided with the established official view.

Still, this is not just diplomatic history. The events in Washington and Tehran that presaged the triumph of the Iranian revolution remain with us still as unresolved complications in the hostage crisis and the future of relations with Iran. Until one knows all the things that went wrong then, one may not fully appreciate why the hostility and deep differences continue between the two nations today.

From the time he took office, Carter gradually became more and more tied to the shah. Pledging as a candidate that under him the United States would no longer be arms merchant to the world, Carter as president had to find loopholes to assure the shah that he would receive more of this country's advanced weaponry than he could practically use.

The president who surprised the world with his human rights pronouncements soon found himself overlooking human rights violations in Iran. And, in the end, the president who undertook a monumental effort to achieve peace between Egypt and Israel was standing by an embattled regime that finally fell, not to a foreign army, but to mobs of angry citizens in the streets of Iran.

Early in the hostage crisis, Carter asked for a full compilation of the government documents covering the long history of the U.S. involvement in Iran's internal affairs. But when the study task force asked for specific presidential records, including that personal message drafted one month before the shah's fall, the White House refused to turn over any more papers to the study group and the top-secret project was suspended.

Holding onto the shah was a preoccupation in the autumn and winter of 1978-79, but the story really begins in the first year of the Carter administration. Beginning today, in a series of six articles, The Washington Post will describe the questions and complications that preceded the present impasse with Iran. As in all such inquires, this account can make no claim to omniscience. This history of the fall of the shah and the U.S. role in it does not presume to be the total record.

The president and his closest foreign policy adviser, Brzezinski, have refused comment on The Post's inquiry. Among the scores who have assisted -- from the White House, the National Security Council, the Defense and State departments, and the CIA -- are some who have colored their views with statements clearly designed to serve the interests of their institutions or themselves. Others seem to resent Carter and Brzezinski's treatment of former secretary of state Vance, and still others, able to tell only that part of the history with which they are familiar, appear to be rendering incomplete accounts. In only a few places, however, does one person's view of events conflict sharply with that of another.

Much of this series is based on more than 1,000 pages of documents obtained by The Washington Post. They comprise a small portion of the "Iran papers," collected by the State Department study group, which describe U.S. relations with Iran from 1941 to last November when Iranian militants took hostage the employees of the U.S. Embassy in Tehran.

More than a year before the shah's collapse, in the fall of 1977, Theodore Moran, a young economist on the State Department's policy planning staff, drafted a secret, internal memorandum suggesting a new strategy for dealing with the massive new arms requests from the shah of Iran. It was based on an analysis of publicly available economic data and press commentaries, and it was totally at variance with the conventional wisdom. It turned out to have accurately predicted the events to come.

Iran, Moran wrote in a memo dated Nov. 2, 1977, "will face rising social and economic tensions unless it reorients govenment spending." Now putting 25 percent of all public funds into the military, the shah "will have insufficient financial resources to head off mounting political dissatisfaction, including discontent among those groups that have traditionally been the bedrock of support for the monarchy.

". . . We both have a common interest in moderating and modulating the Iranian military buildup, not because this administration wants to yield to congressmen who do not like the shah, not because the United States is unable to trust Iran with our most sophisticated weapons but because we have a national interest in insuring the stable and robust evolution of a strong and dependable ally."

"We do not want to simply deny the shah particular pieces of military equipment (and have him feel hurt, or turn elsewhere). Rather we want him to slow down and stretch out the buildup ofhis military forces to give him more time and more resources to build a cohesive, prosperous (and nonrepressive) domestic base for his defense effort."

Moran pointed to the failure of the shah to provide adequate housing, transportation and energy to the people of Iran. The shah envisioned Iran as becoming an industrial power on the level of France by the year 2000, but Moran saw it as an unfinished Third World country, squandering its wealth on weaponry. In addition to direct military spending, the shah was devoting as much as 70 percent of his public housing budget on the armed forces. Oil revenues, which normally would have covered these extraordinary costs, were no longer sufficient to cover Iran's balance of payments.

"The shah and his advisers cannot avoid making the difficult tradeoffs among spending priorities that other developing countries, even richly endowed developing countries, have always had to make," Moran wrote.

While the shah was the object of continuing public controversy, a ruler accused of tyrannical repression, of leading the Organization of Petroleum Exporting Countries to its historic oil-price increases in 1973, he was not in the autumn of 1977 the cause of great worry in the State Department. Other major matters led the agenda at State: the arms negotiations with Russia, the Israeli-Egyptian peace talks, among others. The conventional wisdom on all levels -- except for Moran and a few others -- was that the shah was a stable ally and the U.S. could count on him in the Middle East.

The president was about to have his first personal meeting with the shah, 10 months after his inaugural. In a secret briefing paper prepared for the meeting in November 1977, the regional specialists in the State Department advised that during the last decade, "the shah gained full political control of his country for the first time in his long rule. Not having to be concerned with an opposition recalcitrant legislature, he tends to look well into the future and to assess current events against broad historical trends."

Moran passed his memo on to his supervisor, Anthony Lake, the chief of the planning and policy group, which was responsible for evaluating such strategic concerns. Lake signed it and sent it to Vance. The analysis was rejected. It went against all other reports that were in hand.

Moran tried another approach. He had written his doctoral dissertation at Harvard University under the guidance of Samuel Huntington, a friend of Brzezinski's. Huntington and Brzezinski had been coauthors and Huntington was currently a consultant to Brzezinski on U.S.-Soviet relations. Since one of Huntington's areas of expertise was social untest in Third World nations, Moran believed Huntington would appreciate his own appraisal of the situation in Iran.

The two met and Huntington heard Moran out. But he did not agree to pass the young desk officer's views on to Brzezinski. Huntington said he was too busy on a project of his own -- a study on how the United States could capitalize on Soviet economic problems -- to get involved.

Moran continued to push his view in the State Department. There were others in the ranks that believed the United States was taking another step down the wrong path, but the upper levels of the department were in agreement that the "shah was very firmly in power," as the secret memorandum for the president put it. Moran, who is now a professor at Georgetown University, got the distinct impression that he was considered "bizarre" by the department hierarchy for even suggesting that the shah's future was insecure.

At that point, the fervent critics of the shah were mainly on Capitol Hill, questioning the regime's repressive policies and especially the continuing abundance of U.S. arms sales. Many at State regarded the congressional critics as merely uninformed, a public relations problem. After Congress required a detailed study on the impact of the arms sales on regional stability, one classified, internal memorandum at State, dated Nov. 2, 1977, summarized options for evasive tactics.

Since Congress would likely criticize the shah's request for an additional 140 F16 fighter planes, Alfred Atherton, assistant secretary for the region, suggested at a meeting that sale of the planes could be secretly approved but the public announcement phrased "so the shah will understand the sale is approved but we will tell Congress that 'no decision has been made.'" The Defense Department demurred. It suggested approval of the sale but, instead of deceiving Congress, the sale should not be submitted to Capitol Hill "until timing is propitious."

In fact, Moran's view was supported in one corner of the State Department -- an ally who would have surprised Moran had he known about it. Ambassador William H. Sullivan, recognized generally then as an enthusiastic supporter of the shah, disagreed with Moran's bleak prognosis for the regime. But he discreetly recommended to Vance that the way to rein in the shah's more egregious spending habits was to begin more joint U.S.-Iranian planning. It was the only way to recoup the leverage over the shah that had been lost when his oil revenues made him virtually independent of U.S. influence.

But Sullivan's analysis, like Moran's, was rejected. Either one would require, closer, short-range identification with the shah's regime. It became apparent to Sullivan that no one in the administration wanted to get that much closer to the shah. Meeting the Shah

It was not until the president and the shah met for the first time, at the White House in November 1977, that Jimmy Carter fully appreciated that he must have a special relationship with the shah of Iran. Until then, Carter seemed ready to maintain cordial terms with Iran but at the same time he was willing to impose, when necessary, sharp reminders of his advocacy of human rights throughout the world and his desire to limit the sale of arms. These policies, originally at least, were meant to apply to the shah's kingdom as much as elsewhere.

The human rights criticism, in fact, had hit home. Ambassador Sullivan reported on July 18, 1977, only six months after Carter took office, that "the United States' policy in human rights has been a central feature of nerly every conversation I've had with senior Iranian officials on whom I've called during my first six weeks in Iran." Sullivan said he had discussed it twice with the shah, once at length with the empress, and with most of the shah's cabinet members.

"The assumption appeared to be that we are opposed to monarchical systems of government and seek to have them replaced by democracies," Sullivan complained. This, he said, he had set straight.

But Sullivan was unhappy with the commentary that was coming out of Washington on Iran. Much of it "seems to focus on the fact that the shah is 'autocratic' or 'undemocratic,' he reported. "This is interpreted here as an attack upon Iranian institutions and obfuscates the fact that we are concerned about practices rather than personalties or systems of government," Sullivan said.

The Carter administration and the shah were at odds over the question of armaments as well. Carter had promised to keep the worldwide sale of U.S. arms from growing any larger but, as he prepared to meet the shah, the president had on his desk a request from Iran that would put him over the limit by many billions of dollars each year for the rest of his term.

But Iran was not just any country seeking weapons, and the shah not just any power-hungry leader. The president's briefing paper cited a record of assistance provided by the shah to the United States over the years that was unique. Few nations anywhere had been as loyal as Iran, and few leaders as willing to assist the United States as the shah, the designated peace-keeper in the Persian Gulf and Indian Ocean.

The shah had intervened militarily on behalf of the United States in Oman. He had provided jets on short notice when the United States needed them in Vietnam. He had secretly provided weapons to Somalia for use against Ethiopa when the United States asked him to. He personally persuaded South Africa, which was almost totally reliant on Irian oil, to stop shipping oil to Rhodesia when the United States supported an embargo of that nation.

The shah had established peace with neighboring Iraq at the request of the United States although such a move was unpopular among many in Iran; he personally brokered the resolution of conflicts between Afghanistan and Pakistan. He had agreed to consider being the secret conduit to provide arms to Chad when the United States asked him to.

The shah provided U.S. bases along his border with Russia so that the CIA could monitor Soviet missile programs and troop movements; he had helped U.S. counterespionage against Soviet operations in the region. He helped assure an adequate flow of oil to the United States and he alone in the Middle East supplied oil to Israel.

Going into their meeting at the White House, Carter wanted even more assistance from the shah. He asked for and got the shah's pledge to try to freeze oil prices when OPEC met in December.

In addition, the shah answered many of the president's concerns about human rights violations stemmed from an Iranian law outlawing the Washington Post, the shah explained that what appeared to be violations stemmed from an Iranian law outlawing the communist party in Iran. Iran's law, the shah noted, was similar to U.S. statues prohibiting membership in groups that planned the violent overthrow of the government.

The shah said that he, too, was a human rights advocate. He had personally broken the traditionally rigid male dominance in Iranian society. He had opened the ballot, the classroom and the work place to women, who previously had been severely restricted by Islamic custom.If Iranian politics were not totally open, then a little patience was in order, the shah said. The president was inclined to grant it.

From before that first meeting, the shah was regarded by Carter with such trust that, according to the briefing memorandum, the shah was kept informed of secret negotiations and closely held policy decisions that were shared normally with only the closest allies. The shah was told the most intimate details of the SALT talks with the Soviet Union; he was told of U.S. negotiations aimed at keeping France from supplying Pakistan with material to develop a nucelar reprocessing capability -- despite U.S. assurances to France that no other government would be told of the sensitive talks.

In return for his friendship, the shah wanted to continue the "special relationship" under which President Nixon in 1972 had ordered that the United States would agree to sell Iran whatever the shah requested from the arsenal of advanced weapons systems.

The president told the shah that he would continue to have the U.S.'s unconditional support but, given the limited resources of each country, that support must be more systematic. Therefore, he asked the shah to prepare a five-year plan for military expenditures, one that would help regularize the purchases. State's bureau of political military affairs had suggested that this "upbeat language" would hold off a full commitment to the shah's shopping list and at the same time "not anger him or spoil his visit."

Washingtonians may remember that day for a different reason. The shah and the president, along with their wives and a small entourage, stood outside the White House for a brief arrival ceremony. Across the street at Lafayette Park and on the Eclipse to the south, the shah was being denounced by Iranian students wearing masks and cheered by Iranian supporters. The demonstration turned bitter, and police lobbed tear gas cannisters into the crowds.

The gas wafted into the eyes of the president and the shah. They wiped their eyes, and the president made a small joke about the incident. Dissent From the CIA

After the first meeting between the shah and president, the polite argument over arms sales, in effect, continued at the bureaucratic levels. As the various agencies of national security began to meet to prepare the "Military Balance in Iran" report required by Congress, another contingent of dissent emerged from an unexpected quarter -- the Central Intelligence Agency.

Junior CIA analysts attending the meetings joined in arguing that the Iranian military could not absorb any additional modern equipment. The Iranians simply did not have the trained manpower to operate or maintain what they had already received. Half their people flunked out of helicopter school, the rest had the equivalent of a sixth-grade education. They barely had the pilots to operate their sophisticated F5 aircraft. In order to operate the even more sophisticated F16s the shah wanted, those pilots would have to immediately shift to the F16s. And each new advanced-weapon system took the few skilled technicians away from industry.

Virtually the entire Near East bureau of the State Department disagreed.

Henry Precht, the director of the regional affairs desk concerned with Iran (and later the head of the Iran desk), was critical of the shah but he believed the current U.S. policy dictated more arms. A tenacious bureaucratic infighter, Precht challenged the CIA presentation.

The CIA analysts held their ground. State promised a bureaucratic battle. The matter would be taken to Vance. The director of the CIA would be called.

A week later, the CIA opposition to the draft folded. The young analysts would say nothing more on the subject.

Only State's human rights office continued to oppose the massive sales, but without any effect. The language of the report on Iran was modified to fit the official view. A public show of support for the shah would be the policy; all sales would be explained to Congress and defended. Another Chance

Today, Ted Moran's memorandum is part of the huge file that has become the record of this nation's relationship with Iran. Here and there may be found other documents -- not many -- that had the prescience to say that the United State's policy in Iran was headed toward a fateful turn, that the active elements for disaster were present.

Moran was depressed but not overwhelmed. A colleageue in the State Department likened the high-level spurning of his advice to the bureaucracy's handling of the Vietnam war. Factual analysis was put aside when it conflicted with high-level government policy.

Moran agreed.

They should both resign in protest, the colleague suggested.

No, Moran said, they'd get another chance to change the policy.