Iran has begun a worldwide search for large quantities of grain and other staple foods to make up for the shutdown of its supply line from the United States in the last two weeks.

The last U.S. grain shipment to Iran was a 32,000-ton cargo of barley that left Portland, Ore., on Nov. 6, according to government sources. Since then, Iranian representatives have been engaged in urgent contacts with Canada, Brazil, and European countries to line up additional quantities.

Officials said yesterday that the United States has not embargoed food deliveries to Iran. Money to pay for food is specifically exempt from the freeze on Iranian assets ordered by President Carter.

However, these foods shipments have been effectively halted by uncertainty on the part of exporters and by the announced refusal of the International Longshorsemen's Association to load grain bound for Iran.

As an example of the difficulties facing Iran's food planners, Department of Agriculture officials cited the fact that U.S. companies had not responded to a recent request by the Iranian Army for bids to provide 30,000 to 50,000 tons of rice.

"They are looking at other markets, such as Thailand and Pakistan, but those markets are not readily available," said Michael Kurtzig of the department's economics, statistics and cooperatives service.

The Iranian food economy relies on monthly imports of 100,000 tons of wheat, 100,000 tons of feedgrains, 50,000 tons of rice and 25,000 to 30,000 tons of vegetable oil. About 30 percent of the entire Iranian food supply is imported, and the largest single provider of commodities has been the United States.

This summer, Iran switched from the United States to Australia to fill its monthly wheat import needs. However, Austrailian deliveries, which are at $20 a ton above U.S. prices, run only through January and Australian officials here say they have not been approached on any new deal after that.

"We certainly would not appreciate their [the Australians] selling them more wheat in this situation," said one U.S. official.

The administration has repeatedly stressed that withholding food would not be an effective weapon against Iran. This view was reiterated yesterday by Deputy Undersecretary of Agriculture James Starkey, who said that the United States would have "nothing to gain" from such an embargo.

However, the current stoppage in Iranian food buying here poses serious problems for that country's economy.

Officials here say that even if Iran is able to meet its wheat needs from other sources, the United States is the only source for large quantities of feedgrains and rice over the next few months.

There were reports that Iranian representatives had sought barley from the Canadian Wheat Board but were told that none was available on spot markets. Barley and corn are essential to maintain Iran's poultry industry. Last month, the United States shipped 64,000 tons of corn of Iran.

In a lengthy statement yesterday, Iranian Minister of Commerce Reza Sadr said his country could obtain all the food it needed from non-American sources. But he appeared to signal a shift to a new food policy aiming at self-sufficiency.

"The present situation can make new opportunities available for us to boost domestic [food] output to enable us, at last, to stand on our own feet," he said.

Few analysts think that Iran will be able to reduce its dependence on foreign food quickly or without serious economic consequences, particularly in large cities that are especially dependent on imports.

In addition to potential food problems, Iran also may face fuel oil shortages this winter, according to State Department, Central Intelligence Agency, and oil industry analysts.

There is uncertainty over the fuel oil output of the Abadan refinery, located in southwest Iran. The Abadan refinery, which is among the world's largest, produces most of the 700,000 barrels a day of kerosene, gasoline, and fuel oil burned in Iran.

In recent months, the refinery has been beset by frequent work stoppages and sabotage. Some of the difficulties have been attributed to labor unrest spurred by the Tudeh party, Iran's leading Marxist organization. But State Department officials say that some of the sabotage is not the work of the Tudeh party but of other leftist groups.

The United States helped Iran out last summer by approving the emergency sale to that country of nearly half a million barrels of kerosene refined by Amerada Hess. A shortage of kerosene, the main cooking and heating fuel for 35 million Iranians, who must endure a severe winter, could create widespread hardship.