A federal judge ordered an end to the nation's 94-day coal strike yesterday, and President Carter said a national crisis can be averted if only a "moderate number" of the 160,000 striking miners return to work.

Even before the order came down, top officials of the coal industry and United Mine Workers met privately to discuss resumption of negotiations and thus head off a possible collapse of industrywide coal bargaining, with severe consequences for both the coal operators and the union.

One source described the bargaining, which is scheduled to begin this morning, as a "very serious" effort to reach a negotiated settlement. "There's no fooling around now," he said.

U.S. District Court Judge Aubrey Robinson issued a temporary restraining order under the Taft-Hartley Act late yesterday in response to the administration's claim that the "national health and safety" is being imperiled by the record-long national coal walkout.

The order is to take effect at 7 a.m. today and be served on 1,450 company and union officials by Monday afternoon.

The order, the first step toward an 80-day Taft-Hartley injunction, requires the coal companies to reopen their mines, and bans any activity by the union or its members to continue the strike, including picketing and interference with the transportation of coal.

But it specifically does not require individual miners to work against their will, and UMW leaders as well as many rank-and-file miners have said the order will be widely ignored.

At a news conference just before Robinson started hearing arguments on the order, Carter said he had "absolutely no plans to seek congressional authority to seize the miners" - which many miners see as Carter's only alternative if they refuse to return to work.

While this was seen as a further administration attempt to encourage compliance and end the confusing signals that have issued from the White House on the subject of seizure, it also indicated Carter may be counting on Taft-Hartley to get enough coal moving without bowing further to UMW militancy.

With production running at 50 percent of normal and stockpiles still at 45 percent of their per-strike level, said Carter, "I believe if we can get a moderate number - hopefully all, but a moderate number - of the coal miners back to work that we can prevent a crisis evolving in our country."

Said a White House aide: "We're in for a long haul. It's a matter of months, not weeks. The first thing is to get enough coal to get through the crisis in the Midwest and then try to get some long-term stability."

The administration is actively promoting company-by-company or regional settlements - which could have a devastating effect on the already crumbling UMW leadership - as an alternative to waiting for an industry-wide settlement, which could take a long time.

Against this backdrop, two top industry officials - Nicholas Camicia, president of Pittston Coal Co., and Stonie Barker, president of Island Creek Coal Co. - met with UMW President Arnold Miller at the union's headquarters to prepare for more bargaining.

The bargainers last met about two weeks ago before the Bituminous Coal Operators Association, under intense White House pressure, agreed to a package endorsed by the UMW leaders - only to have it rejected by rank-and-file miners in a referendum last weekend.

It was this overwhelming rejection vote that prompted Carter to invoke the Taft-Hartley Act for the first time in seven years and sent Attorney General Griffin B. Bell into court here yesterday morning to seek a back-to-work order.

"As a result of dwindling coal stocks in the affected region [of Mid Atlantic and Midwest states]." said Carter, "electricity curtailments are in effect, the production of materials and parts essential to manufacturing industries has decreased, and unemployment has increased and threatens to increase drastically if the coal strike is allowed to continue."

Before acting, Carter received a report from his three-member board of inquiry that found the dispute to be "unusual - if not unprecedented" in the history of 34 Taft-Hartley injunctions in the past 21 years. Not only was the union at odds with industry but it was at odds within itself.

Industrywide bargaining was at a "critical impasse," the board said, and the impact of the strike had reached "alarming proportions."

At his news conference, Carter said he expected both miners and operators to obey the law and added, "The law must be enforced."

He said he was putting Bell personally in charge in enforcement efforts and reported that Labor Secretary Ray Marshall had asked the board of inquiry to go to the coalfields to seek compliance.

"This is a time for cooling off," he said. "We will do everything in our power to be sure it does not become a time for confrontation," he added.

Neither Carter nor the government's lawyers made mention of food stamps, but the administration indicated earlier they would be denied to any miners who refuse to obey the injunction. Nor was there any mention of fines or jail, although the government has indicated it would move swiftly to get contempt-of-court citations against anyone who tries to perpetuate the strike.

Named in the government's petition for the injuction were 1,450 separate defendants, including the union's national officers executive board members, local unions and UHW district organizations as well as several hundred coal and mine construction companies.

Robinson, in issuing the temporary order, set March 17 as a date for a hearing on the final 80-day injuction. Meanwhile, both sides are under order to resume "good faith" negotiations in an attempt to end the impasse.

The Government's petition for an injunction conjured up a picture of impending doom spreading through the nation's industrial heartland if the coal strike isn't ended swiftly.

Although the Department of Energy reported recently that overall coal production is picking up, even in Appalachia, it said that daily coal production is still 1 million tons, compared to 3.2 million tons in normal times. Electric utility stockpiles have dropped from 148 million tons before the strike started Dec. 6 to 88 million tons on Feb. 18, the petition said.

A continuation of the strike, the petition said would threaten defense industries, aggravate unemployment, jeopardize education and other social services and increase the nation's reliance on imported oil.

Affidavits filed by government departments to back up the administration's claim of a national emergency projected everything from deaths caused by blacked-out traffic lights to the specter of school children without hot lunches and aged people walking up stairs because their elevators no longer work.

The Defense Department asserte that continuation of the strike will "degrade military readiness and . . . effect adversely our national security" by forcing delays in production on defense equipment and coast increases.

The State Department said it would affect foreign policy adversely by making the country more dependent on foreign oil and "could seriously damage United States efforts internationally to deal with global energy problems.

Closer to home, other departments made these contentions:

Housing and Urban Development - Continuation of the strike would "disrupt the daily living patterns of a majority of the nation's households, increase the cost of living for all our citizens and severely curtail residential construction," with "the poor, the elderly and residents of central cities [suffering] disproportionate hardships."

Health, Education and Welfare - West Virginia schools would close within three weeks and Ohio schools within 30 days; hot lunches and Head Start centers would be jeopardized in many states; the welfare caseload in seriously affected states would rise by 40 percent; lives would be threatened by a "rash of fires, explosions and asphyxiations" caused by use of gas ovens, propane heaters and autos to provide heat.

Council of Economic Advisers - Unemployoent in the East-Central region of Ohio, Indiana, West Virginia, Michigan, Kentucky and Pennsylvania would hit 3.5 million by mid-April and nearly all auto manufacturing would be halted by April. Curtailment of power for street lights would increase chances of accidents and crime, and less power for refrigeration means more risk of food poisoning because of spoilage.

Agriculture Department - A longer coal strike would have a "disastrous impact" on the nation's food supplies and food prices because of extensive use of electricity in production, processing and storage.