After virtually ignoring the American presidential campaign for several weeks, the Soviet press has blossomed with election reports that seem designed to avoid the slightest hint of Moscow's preference.

Since the end of the Democratic convention, President Carter and his Republican challenger, Ronald Reagan, are being portrayed here as clones of Barry Goldwater, who in Soviet parlance is the epitome of a superhawk representing the "military-industrial complex."

The defeat of Sen. Edward Kennedy and the failure of liberals to change the foreign policy planks in the Democratic platform apparently disabused the Soviets of any hopes that the current hard line in the United States is likely to change in the foreseeable future. The American voters, said Moscow television after Carter's renomination, will have a choice "between two Goldwaters."

The Communist Party newspaper Pravda today said both Carter and Reagan seem to be in competition as to "who will place more nuclear mines under the foundations of international security that were established in the 1970s."

But the apparently studied effort to cast both candidates as equally committed to the destruction of detente reflects Soviet consternation at what is publicly described as a growing anti-Soviet popular mood in the United States.

Publicly, this is explained as an attempt by "reactionary forces" to give new impetus to the "myth" of the Soviet threat.This in turn would justify increased military expenditures to gain strategic superiority over the Soviet Union.

Privately, however, well-informed sources concede that Moscow was completely surprised by the intensity of American reaction to the Afghani stan invasion.

The Institute of United States and Canadian Studies, the Kremlin think tank for experts on American, affairs, was reportedly by the sources to have been severely criticized for having failed to forecast Carter's sustained opposition, which has led to a sharp deterioration in Soviet-Americn relations and contributed to the prospects of a new arms race.

Apart from that, Moscow is having difficulties assessing the Reagan inner circle. Most of his advisers are unknown here in contrast to the institute's long experience with virtually all key officials in the Carter administration. l

This may explain a rather gingerly treatment given to the Republican convention last month as well as the absence of any hints in the controlled Soviet media of which candidate would be regarded here as more acceptable.

Perhaps the most disturbing development from Moscow's standpoint was the press leak of Carter's new nuclear strategy suggesting that the United States was shifting its aim from military parity to superiority -- regardless of the outcome of the Nov. 4 elections.

An outpouring of vitriolic public attacts indicated the extent of Soviet concern.

Now Reagan has also become the subject of similar attacks. The Government newspaper Izvestia described him yesterday as "an aggressive and ignorant Californian who does not remember the name of the president of France, who mixes up North Vietnam and north Korea and who repeatedly refers to Indonesia as Indochina."

Despite their attack, the Soviets are believed to be carefully studying the current American political scene. Soviet commentators and officials point out that the Republicans are against the U.S. grain boycott and that their stand toward Taiwan must be "carefully studied;" and while attacking the Democrats, the Republicans also stress that they remain committed to ratification of the second strategic arms limitation treaty.

It will come down eventually, as Izvestia put it in reference to the American voter, "to the choice of the lesser of two evils."

Although the Soviet press does not endorse candidates in U.S. presidential elections, its coverage of the 1972 campaign had definite tilt toward Richard Nixon.

In 1976, the Soviets initially favored Gerald Ford's re-election and officials said privately that he would be easier to deal with because he was a known quantity. But once they determined that Carter would emerge victorious, they adopted an evenhanded press treatment.

The current tone in the press here, however, appears to suggest that Carter and Reagan are equally unpalatable to the Kremlin. Both are identified as enemies of detent, and there are no suggestions of "positive" openings that could lead to what the Soviets call a realistic approach to international problems.

There is a sense of frustration about this. Izevstia's correspondent in New York reports that he talked with American futurologist Herman Kahn recently.

Kahn, Izvestia said, believes that the United States is facing a new round of arms race irrespective of who gets elected in November.

"Well, Herman Kahn knows what he is talking about because he is a frequent consultant of the Pentagon," Izvestia said.