Japan will try to fall in line with an American drive for sanctions against Iran despite a new threat of a sudden cutoff of Iranian oil, government sources said today.

Japan, however, is seeking a way to maintain a huge, expensive petrochemical plant in Iran and it was unclear whether it could do so and still comply with the economic boycott outlined by the United States.

It was understood, however, that the U.S. sanctions would not exclude the plant from the embargo, although an informed source said Japan would be permitted to continue paying salaries and use material already on the site to keep the project going.

The sanctions issue has caught Japan in a tight squeeze between its traditional partner, the United States, and Iran, a major source of oil.

Japanese fears of a punitive reprisal from Iran were heightened today when their ambassador to Tehran was quoted as reporting a new threat to slash oil shipments.

The ambassador, Tsutomu Wada, reportedly was told by Iranian Oil Minister Ali Akbar Moinfar that oil supplies would be cut if Japan joined in economic sanctions, Moinfar also reportedly demanded that construction on the petrochemical plant be resumed immediately.

Japan, which has no oul resources of its own, imported 10 percent of its petroleum from Iran last year and recently negotiated an agreement providing a substantial increase for 1980. Any Iranian repirsal, if carried out, could leave this country with a serious shortfall this year.

The two leading European multinational oil firms, British Petroleum and Royal Dutch Shell, also negotiated new agreements for Iranian oil, but will receive drastically reduced amounts.

The petrochemical plant had been Japan's biggest carrot in a long-term diplomatic effort designed to establish close relations with Iran and make that country a secure source of oil in the future. Officials fear that this hope may go down the drain if the facility is shut down and some are concerned that the plant might be sabotaged by irate Iranian demonstrators.

Any disruption of Japanese-Iranian trade could mean a loss to Iran of millions of dollars' worth of passenger cars and industrial items, principally steel plates, rolled steel, iron structures, plant machinery and laboratory equipment. In 1978, Japan exported $2.4 billion to Iran, with steel being the largest single item. The trade dropped radically after the Islamic revolution and as of last November the 1978 exports amounted to only about $700 million.

The petrochemical plant was planned as a massive $3 billion facility at Bandar-Shahpur, near the Persian Gulf oil center of Abaden. It is a vital element in Iran's modernization program begun under the shah. Although Japan officially denies that its interest in the plant was to promote future oil supplies, officials have said it was hoped that the facility would seal Japanese-Iranian friendship for years and help assure Japan of a petroleum source.

The new Iranian government has insited that construction be resumed. Japan must send about 2,000 technicians and about $540 million to complete it.

Details of the American sanctions plan will be discussed Thursday with Japanese officials by Philip C. Habib, a special assistant to the secretary of state who arrived here tonight.

Reliable sources said Japan at first hoped to exempt the petrochemical plant from the U.S.-proposed ban, contending that hughe investment might be lost forever if it were not allowed to go forward.

Today, however, an informed source said, "Japan has been made to understand by the U.S. and other parties that an embargo involves all imports and that if you have an exception for a specidic complex, than you don't have an embargo."

This source said Japan would be able to keep the project going, but no new materials could be shipped in.

The Japanese response was to wait and see what Habib has to say. One official said it "may be possible" for Japanese contractors to maintain the plant without exporting new materials into Iran.

"We are trying to find a way to go along with U.S. sanctions and still avoid having to start from scratch on the plant," the Japanese official said.

Japan had not responses to the latest reported Iranian threat to cut off oil and was awaiting clarification from Ambassador Wada in Tehran.

Assuming, however, that the threat is serious, Japan already has asked for emergency help through the International Energy Agency. U.S. officials said today the agency has assured Japan that its emergency needs will be met in the case of an Iranian cutoff.

Nevertheless, Iran's latest threat could have devastating effects for Japan and particularly for the administration of Prime Minister Massayoshi Ohira. Endangering a key petroleum source in order to support the United States is not a popular idea in this oil-starved country and government officials anticipate a political backlash, not only from opposition parties but from some members of Ohira's Liberal Democratic Party.

These officals say it would have been easier to go along with sanctions imposed by the United Nations, because of broad public support here for that organization. But applying sanctions only at the American request will be much harder to sell politically, they said.

Meanwhile, news services reported these related developments:

U.S. Deputy Secretary of State Warren Christopher arrived in Paris from Bonn today on the last leg of a three-day European tour to discuss the crises in Iran and Afghanistan and possible allied responses.

In Washington, the Treasury Department said financial officials of the West German, Britain, French, Japanese and U.S. governements held closed-door talks on international issues. Participants in the talks said their was conesiderable discussion of efforts by Washington to apply sanctions against the Soviet Union and Iran.