Iran appears to be backing away from its implied promise of military aid to Somalia as the United States moves to an active diplomatic role in the Horn of Africa.

Just two months ago the shah, after meeting with President Carter in Tehran, indicated that Iran would step up its military aid to Somalia. Earlier the shah had said Iran was sending light arms to the government in Mogadishu.

The decision was based on a longstanding conviction here that the Horn of Africa is vital to Iran's security.

Since then, however, Iran's foreign minister, Abbas Ali Khalatbari, has said that Iran's help to Somalia has been limited to humanitarian aid. There has been no official explanation about the apparent change of policy.

Observers noted, however, that Carter himself has been more outspokenly critical of the Soviet and Cuban role in the Horn since his meeting here with the shah.

The shah, in his statement at the time, went no further than promising that Iran would not stand idly by if Somalia were invaded by the Soviet and Cuban-backed Ethiopians. He made no commitment to aid Somalia's activities in the disputed Ogaden region of Ethiopia, where all the fighting so far has taken place.

Even that Iranian stand led to a break in diplomatic relations with Kenya after the Kenyan press and Foreign Minister Munyua Walyake criticized what they called the shah's "meddling" in African affairs.

Although the Iranians justified their stand "in the name of national pride," it is widely believed they learned a lesson about African sensitivities concerning anything smacking of outside support for changing boundaries inherited from the departing colonial powers.

Any fears moderate countries like Kenya may have about the Cuban and Soviet role in Ethiopia are diluted by concerns about Somalia's irrendentism. This concern is especially felt in Kenya, which fears Somali claims on its sprawling northern frontier district inhabited largely by ethnic Somalis.

Even at the high tide of Iranian rhetoric about aiding Somalia last fall, the shah was noting American restrictions against transfering U.S. military equipment to dodge any arms shipment to Mogadishu.

At no point were the Iranians though likely to send ground troops to Somalia despite the precedent of their expeditionary force's active combat role in the Dhofar rebellion in Oman in the mid-1970s.

That exercise gave the shah's previously untried troops their first battle experience with their largely American-supplied modern weaponry.

In any case, the shah was credited with wanting to exhaust all other possibilities before making such a decision.

Somali diplomats have made known their disappointment with the shah's promises, which they claim have produced little of either financial or military value to their cause.

Nonetheless, Eastern European diplomatic sources here have circulated suggestions that the shah has secretly delivered obsolescent materal to Somalia.

Old model American-manufactured tanks were specifically mentioned, along with alleged promises that the United States would replace them with more modern equipment.

Other variations on the same general theme suggest that the shah has provided financing for weapons bought on the free market and earmarked for Somalia.