The U.S. merchandise trade deficit widened to $12.6 billion in September after a slight narrowing in August, bringing the deficit so far this year to just under the $100 billion mark.

Although exports rose modestly in September, they weren't enough to offset another sharp jump in imports, the Commerce Department said. The trade deficit was $9.9 billion in August and a record $14.1 billion in July.

Commerce Secretary Malcolm Baldrige said that "although monthly deficits will probably continue their upward trend, the deterioration in the trade balance appears to be slowing and some improvement should be evident next year."

However, private economists said that unless there is a gradual reversal in the rise of the dollar against other major currencies, the trade picture will continue to deteriorate.

"The diversion of our markets to foreign sources is astounding," said Roger Brinner, chief economist for Data Resources Inc. Brinner said he saw nothing to convince him that the trade position will improve.

Although the economies of other countries that traditionally have bought U.S. exports are improving, so far they haven't improved enough to cause a significant pickup in exported goods, economists said.

The expansion of the U.S. economy, which leads to more import purchases by Americans, is another source of the growing trade deficit. However, as the economy slows and income increases weaken, economists said, the sharp rise in imports should decline somewhat.

In addition, the strong value of the dollar makes imports comparatively less expensive than U.S. goods, and U.S. exports more expensive, hurting the overseas sales of U.S. manufacturers.

However, a decline in the dollar would probably lead to price increases at home. The relative price changes would occur before more exports are produced and sold, causing the trade deficit to worsen before it gets better.

The recent decline in prices of imported oil should help other oil-importing nations improve economic activity and buy more U.S. goods, economists said. Weaker oil prices should also put pressure on the dollar because, as an oil producer, the United States would benefit proportionately less than big oil importers if prices decline, economists said.

In September, imports rose 10.5 percent to $30.8 billion, slightly below the record high of $33.5 billion in July, the Commerce Department said. Imports averaged $30.7 billion each month during the third quarter, compared with $27.7 billion during the second quarter.

Exports rose 0.8 percent in September to $18.2 billion, just below the record of $19.4 billion chalked up in July.

The overall rise in imports in September "reflects the net effect of declines in petroleum products and increases in the nonpetroleum commodities," Commerce said.

In September, the total value of imported petroleum products dropped 5.4 percent. The average price per barrel for petroleum products was $28.70 in September, compared with $29.11 in August and $29.77 in September 1983, Commerce said. Crude petroleum declined for the second consecutive month and accounted for 44.9 percent of the fall in imported petroleum products.

The trade deficit with Japan grew from $3.1 billion in August to $4.1 billion in September. The deficit with Western Europe rose from $1.3 billion to $2.2 billion. The deficit with the countries of the Organization of Petroleum Exporting Countries declined from $1.4 billion to $1.1 billion.

The nation's trade deficit from January through September stood at $96.3 billion.