Moscow seems to be girding for a superpower test of strength over an Iran minus Ayatollah Ruhollah Khomeini.
Remarks by Moscow officials to diplomats here, and recent official news media coverage, leave little doubt the Soviets expect a United States bid for renewed influence in Iran once the Ayatollah departs. The Soviets see this as a potential threat to their own security interests, officials suggest privately, and are determined to prevent this.
Their minimum hope for developments within Iran is the emergence of a regime that values good relations with the Kremlin.
Diplomats here maintain that the intensity of superpower competition over a post-Khomeini Iran, and the extent to which the Kremlin will be ready to travel in defense of its own policy priorities there, depend in large part on imponderables.
Among them are whether a secular aya-tollah named Leonid Brezhnev survives his Iranian counterpart, the state of US-Soviet relations at the time of Khomeini's passing, and the political situation inside Iran.
In the interim, the Soviets have been balancing a drive for better relations with the present regime by, in effect, serving notice of various rules Moscow feels central to relations with Khomeini's successors.
While more than a few Kremlinologists wonder out loud about matters of transition-in-Moscow, more than a few Soviets seem to suspect a transition south of their border is not too far distant. The Soviet media have long sought to avoid overly close identification with the Khomeini regime. Recent dispatches take this further, speaking of the ''present'' or ''existing'' leadership there with the clear implication it may not be around much longer.
A March 7 dispatch from the Soviet news agency Tass included a particularly equivocal reference to the challenge antiregime militants pose to the Tehran leadership: It termed them ''members of organizations that have taken the path of armed struggle against the present regime.''
Meanwhile, the Soviets have unsheathed a carrot and a stick in a pair of lengthy commentaries on ties with the Tehran regime.
The carrot came in a recent edition of Izvestia, the Soviet government daily. It was pegged to the third anniversary of the Islamic revolution. A year ago, the magazine criticized the Khomeini regime for the absence of ''a concrete program of socioeconomic transformations'' and for its inability to deal with the nation's restive national minorities, ''on a just, democratic basis.''
The rare mention of ''the nationalities question,'' the context for past Soviet meddling in Iran, was followed with what some diplomats saw as a veiled threat: ''The Soviet people have the right to expect of Iran a friendly and good-neighborly attitude.''
This time, the Izvestia man exuded something very close to sweetness and light, celebrating the fact that Soviet-Iranian ''cooperation is developing from year to year,'' particularly in the economic sphere.
Then, from the Communist Party paper Pravda March 9 came the stick--partly, diplomats suggest, to balance the Izvestia piece and partly to set forth the rules for a future Soviet-Iranian relationship.
Prominent Mideast commentator Pavel Demchenko stopped short of threats and swore off any territorial ambitions or hankering for ''special rights'' in Iran.
Yet he criticized ''unilateral'' Iranian downgrading of some aspects of relations with Moscow: the cutback in the number of Soviet diplomats allowed in Tehran, the closing of a Soviet consulate near Iran's northern frontier, a ban on entry visas for Soviet journalists.
The Pravda commentary in effect divided the ruling Iranian clergy into good and bad. Certain ''right-leaning groupings . . . around Khomeini'' wanted to stifle the development of relations with Moscow.
In what diplomats saw as a reflection of the superpower context in which Soviet officials tend to speak of developments in Iran, the article added that such right-wingers wanted to limit Iranian-Soviet relations ''even should this damage . . . Iran's ability to withstand imperialist pressure.''