Soviet oil and gas output reached record levels during the first six months of this year, with oil production running slightly more than 12 million barrels a day, according to official figures published today.

The energy figures were included in an announcement of an overall national economic growth of 493 percent over 1979. The energy figures are closely watched by diplomatic analysts here because of the implications that they could have for Soviet policy toward oil-producing nations in the Middle East and the Persian Gulf.

According to the weekly Economic Gazette, oil production -- including gas condensates -- climbed to 348 million tons in the first six months, or 3 percent more than the 1979 figure. The annual target is set at 606 million tons, or about 4.3 billion barrels.

The Soviets have been the world's largest oil producer for several years, and their average daily output last year was 11.7 million barrels. A U.S. Central Intelligence Agency study had predicted that Soviet production was likely to peak at 11.9 million barrels a day this year, and then decline to 9 million barrels a day by 1985.

Such a decline was viewed as possibly leading Moscow to compete for access to the Persian Gulf oil reserves. It also would have a major impact on Moscow's relations with its allies. The Soviet Union now exports an estimated 2 million barrels daily to its allies -- ranging from Vietnam and Mongolia to Eastern Europe and Cuba.

Today, the Soviets also reported natural gas output of 250 billion cubic meters for the six-month period, up 7 percent from the 1979 figure. Their target for the year calls for 435 billion cubic meters.

The coal industry, however, has failed to meet its target, and it seems unlikely that the figure of 746 million tons would be reached by December.

Despite encouraging signs, the Economic Gazette said oil fields in western and northeastern Siberia and on the eastern shores of the Caspian Sea were lagging behind, but provided no details.

Although Soviet economists continue to predict an increased oil and gas output, Moscow publicly cautioned its allies that they will have to look for alternative energy supplies in the coming years.

Oleg Bogomolov, who heads the Institute of the Economy of the World Socialist System here, said in an article that members of the Soviet Bloc's common market, known as the Comecon, will have to import one-half of their energy imports from countries other than the Soviet Union by 1990.

In 1975, he said, Moscow's allies drew roughly 70 percent of their energy imports from the Soviet Union. This figure has declined slightly, and will probably come down to 50 percent by the end of the decade, he said. Moreover, he added, the allies were buying Soviet oil at 40 percent below the world price.

The new situation in the energy fields, he said, would require "real structural, organizational and even psychological readjustments."

According to Western experts, the Soviet Union would have to keep its oil and gas deliveries to its allies at current levels in order to use energy revenues for modernization of the Soviet economy.

The Soviets obtain more than 35 percent of their hard-currency earnings from oil and gas sales to Western Europe and Japan. But Moscow's allies lack large amounts of hard currency to buy oil on world markets, and the Eastern Europeans in particular may face increasing shortages that could produce political discontent.

Today's report on national income -- the Soviet figure nearest to gross national product -- suggests that the economy may reach the 4.5 percent target growth rate for the year. But it pointedly omitted some farm statistics normally published, indicating continued difficulties in the meat and milk product industries, partly as a result of shortage of fodder and grain feeds due to the U.S. boycott.