A federal judge today promised to free up to 322 Cubans who have been jailed for more than a year without having been charged with a crime unless government attorneys within 48 hours give him a good reason why he shouldn't.

"These aren't just numbers," declared U.S. District Court Judge Marvin Shoob. "These are people in jail, and they have been there for 14 months."

From his wood-paneled courtroom in the modern federal office building here, Shoob has become the first federal judge to launch a large-scale assault on the nation's changing immigration policy. Today, he labeled the administration's handling of the imprisoned Cubans "a disgrace," and characterized government attorneys' slow response to motions to free the Cubans as either "bureaucratic resistance" or "pure incompetence."

The Cubans are among 1,800 "Freedom Flotilla" refugees locked up in Atlanta's federal penitentiary. The government claims the 1,800 are "excludable" from this country because of crimes committed back home, and plans to try and send them back to Cuba, an assistant U.S. attorney said in court, even though Cuban President Fidel Castro doesn't want them.

"The government invited these people to come to this country as a refuge and now it's going to ship them back?" the judge asked incredulously.

The judge said he would free the 322 "detainees" Wednesday either because the Cubans were approved earlier for release by the Immigration and Naturalization Service or because they were being held solely for lack of entry papers. He said the government had violated federal court rulings on detaining illegal aliens because 14 months in a maximum security prison amounted to arbitrary imprisonment.

On Aug. 7, the judge gave the government 10 days to come up with a list of all Cubans held solely for no entry papers and underline any it felt might be too dangerous to release. Assistant U.S. Attorney Robert Castellani produced the names of 77 Cubans whom officials believe should remain locked up on various grounds, including some who were witnesses to alleged crimes in prison.

But he said it was impossible to come up with a list of Cubans held solely for lack of entry papers because the government was understaffed and had no authorization to pay overtime to INS employes.

"I don't think any real effort has been made to ascertain which of them should be released," scoffed Shoob.

In a "status report" on the Cubans, the government said it had "recommended" that 156 "detainees" be released and that a Justice Department review panel would begin considering their freedom Aug. 24. Review of the 156 cases would take top priority among the 1,800 imprisoned Cubans the panel plans to consider -- from hard-core felons and the mentally ill to political prisoners, petty thieves and victims of red tape -- and would be completed in four months, by Dec. 31, the "target date."

Freedom could come soon after that for those Cubans given the U.S. government seal of approval.

Shoob called the plan "patently unfair," adding, "I wouldn't be happy if I were a detainee and had to sit in a maximum security prison until December while someone in Washington made a decision."

The judge said he had lost confidence in Washington, whose policy towards the last of the 125,000 Cubans who arrived here on the boatlift has shifted and stalled with the changing administrations. In April, Attorney General William French Smith halted, pending his review, the release of imprisoned Cubans approved under the Carter administration.

"The government isn't going to do anything unless the court forces them to," Shoob declared.

He asked Castellani why Cubans were being held in a maximum security federal prison only because they lacked federal entry papers. "I don't have an answer for that," said Castellani.

"My purpose is to get those people out of there who ought to be released," said Shoob. He has divided the Cubans into 12 groups, classified by the reasons for their detention, and plans to consider freeing other categories later.

But he said he wouldn't dump anyone on the streets until relief agencies had found them sponsors. Nor, he emphasized, would he release anyone dangerous.

Russell Ahr, deputy director of the INS' Cuban processing center at the prison, compiled the working lists for the court. He testified that the Cubans in the penitentiary were asked if they had ever been imprisoned in Cuba after arriving in Key West last year. Those who said they had were then dispatched to prisons here. A number of them, he conceded, had signed statements in English, without ever having had the statements read back to them in Spanish.

He said about 100 were in solitary confinement at the prison, and that some of the mentally ill mingled freely with the general prison population -- a policy that apparently violates standards for prisons and for treatment of the mentally ill.

Asked why the INS had not complied with his order for a list of Cubans imprisoned solely for lack of entry papers, Ahr pleaded staff cutbacks and said that four INS officers were being detailed to Atlanta to help. "The lists aren't as accurate as they could have been. It was a rush job."

Raphael Fernandez Roque, one of four Cuban plaintiffs in a class action suit against the government, shifted in his chair next to an interpreter. He has spent two birthdays behind bars in America. He has no entry papers, and appeared in court here today, the day he turned 19.