It was cold, raining and still dark as midnight when people began crowding in the mud outside the coal yard here one recent morning. They hoped to fuel their heating stoves after weeks of bitter waiting, but what they half-expected was more bad luck. "Look for yourself," said one stout worker. "There's no coal left in this town."

The daily scrambling for fuel in this town just an hour's drive west of Warsaw is symptomatic of conditions around the country this winter. Despite Poland's position as a leading world coal producer, its domestic industries, electric power plants and homes are starved by an energy crisis for which authorities seem to have no reasonable solution.

"Coal supply will be the number one problem for the national economy in the months to come," said the government daily Rzeczpospolita last month. Acknowledging that "most fuel stores in rural areas are empty," it said that the supply of coal was expected to fall short of domestic needs by 2.3 million tons in the first three months of this year, threatening disruption of industry and schools.

The drama played out in the coal yard reflected the national dilemma.

Soon to arrive was the volunteer manager of the waiting list, an elderly local woman named Zuzanna Pawlowska. She keeps the names of would-be buyers and determines who is next "in line." A crowd quickly pressed around Pawlowska and her thick, dog-eared notebook. But the few newcomers only could be discouraged: Their place numbers, at the bottom of the list, meant a wait of up to three months.

Then, just before 7, the manager and his team arrived, and Pawlowska and her followers launched their daily battle. First, they shouted down a yard employe who refused to open the gates because there was no electricity in the sales building. Then, they overcame the resistance of the manager, who told the first man he met, a private craftsman, that there was no coal to buy that day.

"This is an outrage," shouted one infuriated housewife. "For days, I've had no fuel, and yesterday I burned my old shoes." The craftsman, undeterred, reentered the manager's office with a gift from his shop.

Finally, the day's bargain was struck. The first 20 present from the more than 2,000 on Pawlowska's list were allowed to buy their designated ration of coal, usually enough to heat their homes for the remainder of the winter. The rest would have to make do and wait for another early morning.

Perhaps more than any other country, Poland cannot function without coal. Eighty-three percent of all energy in the country is produced by coal, and 97 percent of electricity is generated by coal-burning plants. During long winters, heating of both public apartment blocks and private homes is almost exclusively dependent on the fuel.

Pampered by the government above all other workers, Poland's coal miners last year managed to meet their production goal of 191 million tons of hard coal, despite increasingly difficult mining conditions. But the debt-burdened state's need to sell coal abroad for hard currency, the failure of conservation programs and the depletion of reserves during last year's hard winter have created a bind that officials acknowledge may endure for years.

"It is a fact that we have made our entire economy dependent on hard coal and lignite," Mining Minister Gen. Czeslaw Piotrowski recently told a press conference. "Unfortunately, not everyone understands that it is time to sound the alarm on this account."

The shortage of coal is, in fact, only the beginning of Poland's energy problems. As the economy has slowly recovered from a deep recession in 1981, demand for energy has reached the capacity of the nation's power plants. According to official reports, the national power grid already failed once this winter to meet the demand of a cold night, forcing power cuts even though coal was available.

Although Poland is planning both new coal-fired and nuclear energy plants, experts believe they may not even cover the expected increase in the demand for electricity in the coming years. At the same time, the government planning commission recently ruled out a major increase of investments in power plants on political grounds, concluding that "the public would never accept" the necessary draining of resources from housing and consumer goods, according to an official report.

As a result, authorities have concluded that Poland's growth must be limited in the coming five years according to the shortage of energy, and even the modest growth now planned will require unprecedented savings through forced conservation measures.

Private experts are far more pessimistic. "Nobody in Poland has any complete and full concept of how to meet the national demand for fuels and energy by the end of the century," wrote Czeslaw Mejro in the technical journal Przeglad Techniczny. "All we know for sure is that there can be no talk of overcoming all these barriers. Quite simply, belts will have to be tightened."