The United States has warned that it intends to "go to the source" with whatever means are necessary to shut off the flow of arms from Cuba to guerrillas in El Salvador, informed official sources said yesterday.

The Reagan administration, in conveying the warnings last week via meetings with Latin America ambassadors and other diplomatic channels, did not specify what action is being contemplated in case Cuban support continues for the Salvadoran insurgency. Secretary of State Alexander M. Haig Jr. and other senior officials made it plain, however, that various contingency plans, including military contingencies, are under active study.

There is some possibility, under close review here yesterday, that the public and private alarms from Washington are already having an effect. U.S. intelligence has failed to detect new signs of insurgent arms shipments into El Salvador since Washington's drive was unveiled a week ago.

There is "certainly a lull" in reports about shipments to El Salvador, sources said, but it is too early to tell how significant or long-lasting it will be. Senior intelligence officials said it will take another two weeks, at a minimum, to reach a firm conclusion that the arms flow has stopped.

The United States has been putting heavy pressure on Nicaragua's leftist-dominated government to choke off the munitions supply the administration says became clearly detectable in December. To spur Nicaragua into acting, the Reagan administration has threatened a total cutoff of U.S. economic aid, which is helping to keep that country afloat financially.

According to the sources, the Nicaraguans have given Washington a private pledge that they will stop the traffic through their country and have shown signs of trying to comply. But, the sources added, given Nicaragua's limited police resources and the fact that some powerful elements in the government there are avowed Marxists in sympathy with the Salvadoran guerrillas, the degree to which U.S. pressure will succeed is not yet clear.

While the immediate zone of conflict is Central America, the steamy isthmus connecting Mexico with South America, the arms supply for the insurgency is believed to come in substantial part through Fidel Castro's Cuba several hundred miles across the water to the east. This, along with the animus toward Cuba which has long been expressed by President Reagan and his backers on the Republican right, has made Cuba a major target in these first weeks of the new administration.

The administration of John F. Kennedy 20 years ago also began with conflict with Cuba, where Fidel Castro had come to power two years previously. The aborted Bay of Pigs invasion, planned by the Eisenhower administration but carried out under Kennedy in April 1961, was a disaster that deeply affected the Kennedy foreign policy in many regions, and set the mold for the bitterness and hostility that has characterized Washington-Havana relations during most of the decades since.

Among other things, the Bay of Pigs drove Cuba deeper into the arms of the Soviet Union. A year later, the Soviets began shipping medium-range nuclear missiles to the Caribbean island, bringing on the 1962 Cuban missile crisis, the most dangerous confrontation between the superpowers in the atomic age.

The Soviet reaction to the Reagan administration's hard line on Cuba remains unknown, although the Kremlin has been harshly critical of Reagan in public statements. It was noted in Washington that Marshal Nikolai V. Ogarkov, chief of staff of the Soviet military forces visited Cuba shortly after the Reagan administration came to power. "The timing [of the visit] was interesting, but we don't know what it means," said an official U.S. source.

The U.S. warnings to Cuba about the arms supply to El Salvador surfaced last Tuesday in a briefing given by Haig for Washington ambassadors of North Atlantic Treaty Organization allies plus Australia, New Zealand, Japan and Spain. Haig described Cuba then as "the immediate source of the problem" of outside support for the Salvadoran insurgency.

Haig went on to tell the diplomats that "I wish to assure you that we do not intend to have another Vietnam and engage ourselves in another bloody conflict where the source rests outside the target area."

In a briefing for Latin American diplomats the same day, William P. Clark, who has been designated to be deputy secretary of state, repeated Haig's reference to intended U.S. avoidance of a Vietnam-like situation in which arms and aid continue to flow to communist forces from outside El Salvador.

Clark went on to say, "We do intend to go to the source with whatever means may become reasonably necessary" in order to stop the arms flow, according to informed sources. Virtually the same language was used on other occasions during the week by Haig and other high officials, the sources said. It was unclear whether the message has been delivered directly to Havana as well as broached in conversations with third-country diplomats.

The substance of the contingencies being discussed as potential actions against Cuba has not been revealed. Past U.S. efforts to impose international restrictions on trade with Cuba were unsuccessful, and have been largely abandoned in recent years by nearly everyone except the United States.

As a presidential candidate, Reagan suggested a U.S. naval blockade of Cuba as a "hypothetical" counteraction to the Soviet invasion of Afghanistan. He declared in justification that "the Soviet Union owns Cuba, lock, stock and barrel." He said that such a blockade would be "a grave logistical problem" for the Soviets and Cubans.

"I'm quite sure they [the Soviets] would not come sailing over with a navy and start shooting," Reagan said in an interview with The Wall Street Journal in May 1980. His aides and official spokesmen were unable to specify the source of Reagan's confidence that the Russians would not challenge a U.S. action against their ally.