The Reagan administration appeared yesterday to have resigned itself quickly to the successful coup against Sudanese President Jaafar Nimeri, the United States' closest ally in black Africa, who had left here less than 24 hours earlier after a 10-day private visit that included a meeting with President Reagan.

White House spokesman Larry Speakes, commenting from Santa Barbara where Reagan is vacationing, noted that it had been a "bloodless coup." He said there would be no change in U.S. policy toward Sudan. "We are assessing the new government as we go forward," he said, refusing to give reporters any U.S. view of the new ruling military group.

"The president was aware it was a situation that was touch-and-go at times," Speakes said of the mounting political and economic difficulties that led to the outbreak of widespread demonstrations 12 days ago in the Sudanese capital, Khartoum.

A State Department spokesman said U.S. diplomatic relations with the new Sudanese government would continue "without interruption."

"We have had a close relationship with the Sudan based on a convergence of enduring national interests," he said. "We expect that this relationship will continue."

Reagan was advised of the coup by his national security affairs adviser Robert C. McFarlane at 7 a.m. local time and was kept informed of developments there throughout the day, Speakes said. "The president's major concern was that all Americans were safe," he said.

The White House spokesman said that there were no reports of Americans having been hurt and that the U.S. Embassy in Khartoum continued to function normally.

Speakes said the administration had noted that Libya's Muammar Qaddafi, a sworn enemy of Nimeri and the United States, quickly recognized the new military leadership in Sudan. But he refused to speculate on whether Libya was involved in the coup.

The largest U.S. aid recipient, and undoubtedly the most important U.S. ally in black Africa, Nimeri had become a problem for the administration. The United States had become seriously divided over how to deal with the increasingly erratic Sudanese leader.

Nimeri had adopted Moslem Sufi mystic advisers and is said to believe that because of his failing health he had to atone for his earlier dissolute life and bring himself and his country, including the Christian minority, under strict Moslem rule.

Since last year, U.S. policy-makers had wrestled with the issue of what to do about growing economic troubles into which Sudan had fallen under Nimeri's leadership and the impact of a four-year drought that has driven more than a million refugees to Sudan from neighboring countries.

In mid-December, the administration informed the Nimeri government that the United States could no longer proceed with the already delayed disbursement of most of the $120 million in economic support funds earmarked for Sudan during fiscal 1984.

This decision also effectively froze $114 million in funds planned for this fiscal year.

Some within the administration, led by the Treasury Department, had insisted that U.S. aid remain frozen until Nimeri took far-reaching measures to change his chaotic economic policies, which were widely held as primarily responsible for leading Sudan to the brink of bankruptcy.

Others, mainly within the State Department, were far more sympathetic to Nimeri's plight, largely out of regional political considerations and concern for his fate lest "the medicine kill the patient," as one State Department official put it. They urged leniency and a more positive U.S. response to help bolster his embattled regime.

Administration hard-liners, led by Treasury officials, argued against the release of U.S. funds during Vice President Bush's trip to Africa in early March, saying it would undermine U.S. and International Monetary Fund (IMF) efforts to squeeze Nimeri into making necessary sweeping reforms.

Ironically, the triumph of the hard-liners led to the crisis triggering Nimeri's fall.

The crisis was touched off by food and gasoline price increases of up to 60 percent. Nimeri announced the increases just before coming to Washington in a bid to gain release of the remaining $180 million in frozen U.S. aid, a rescheduling of Sudan's $9 billion in foreign debts and a new IMF standby agreement.

Last Monday, Reagan, after meeting with Nimeri, announced that all the delayed U.S. aid was being freed in light of the Sudanese leader's "highly commendable actions worthy of international donor support" to abolish government subsidies on food, institute budget cuts and make exchange-rate adjustments.

The U.S. help, as it turned out, came too late. Demonstrations that had begun as a spontaneous outburst of rage over the food and gasoline price increases had by the end of last week turned into a widening political protest.

The administration also misread the "street signs" in Khartoum. U.S. officials at first thought police and security forces had the situation under control. Their success, until a general strike began Wednesday, appeared to lend credence to this initial assessment.

The officials also assumed that the army's keeping out of the fray and showing no inclination to side with the demonstrators was a sign of its loyalty to Nimeri. Instead, the army apparently was just busy laying plans to take over the government and prevent Nimeri's return.