For the second time in six months, the Justice Department sought and a U.S. judge granted an order forbidding the publication of an article the government contends would reveal the secrets of the hydrogen bomb.

Hours after the Justice Department filed suit yesterday in San Francisco against the Daily Californian, a newspaper published in Berkeley and distributed at the University of California, U.S. District Judge Robert H. Schnacke issued a temporary restraining order barring publication of a 17-page letter written by a 32-year-old computer programmer and sent to a number of newspapers and politicians.

The government alleges that the letter, from Charles Hansen of Mountain View, Calif., contains "secret restricted data."

Schnacke said last night that Justice Department lawyers "satisfied me" that a temporary restraining order "was required under the circumstances." He set a hearing for next Friday on the government's request for a permanent restraining order against the Daily Californian.

Charles Burress, editor of the newspaper's editorial page, said last night that his publication would abide by the temporary order but did not intend to turn the Hansen letter over to the government.

Last March the Justice Department sued the Progressive Magazine to bar publication of an article on the H-bomb by freelance writer Howard Morland. Though the magazine argued that the article was written from material in the public domain, a U.S. judge on March 26 granted a temporary restraining order against its publication.

The Justice Department said yesterday that Hansen sent copies of his letter to Sen. Charles Percy (R-Ill.), Rep. Paul McCloskey (R-Calif.) the Wall Street Journal, the Progressive Magazine, the San Jose Mercury, the Oakland Tribune, the Milwaukee Sentinel, the Daily Californian and the Peninsula Times Tribune of Palo Alto, Calif.

On Aug. 30, the Peninsula Times Tribune published a news article on Hansen's letter and reprinted its only drawing, a diagram that editor David Burgin described as "more like a cartoon than anything."

Burgin said his newspaper paraphrased from Hansen's H-bomb letter and "explained what the letter was." The letter, Burgin said, "is highly technical."

"Nobody said anything was classified. We felt it was public domain and still do," he added.

Last Wednesday, Department of Energy lawyers notified Hansen that his letter and diagram had been classified under the secrecy requirements of the 1954 Atomic Energy Act, the same requirements, cited yesterday in the Justice Department suit.

"Hansen told us that. We wrote a story on it," Burgin said. Last Thursday, he said, government lawyers told him that "we should see counsel and there was some possible violation" of the Atomic Energy Act.

"I took the letter and the drawing and turned it over to our lawyer." Burgin said. He said DOE lawyers "have asked us to turn over the property but we have no intention of doing that."

A Department of Justice spokesman said yesterday that one reason the Daily Californian was sued was that the newspaper refused to confirm to the government whether it had received a copy of the Hansen letter.

It was learned that the Berkeley newspaper did receive it, and on the advice of attorneys refused to respond directly to the DOE request that the Hansen letter be turned over.

In a telephone interview last night, Hansen said he was unaware of the suit against the Daily Californian, but he declined to go into detail about his letter, which was dated Aug. 27. "I am trying to get some legal assistance at this time, and am on orders not to speak to anyone," he said.

According to news service reports, Percy said that he intended to turn his copy of the Hansen letter over to the Senate Energy Committee tomorrow, and the Milwaukee Sentinel had refused to surrender its copy to the federal government.

However, Robert Wills, editor of the Sentinel, said that the newspaper "does not intend to publish any classified information" from the document.

According to the Sentinel, the Hansen letter goes into technical aspects of the H-bomb and charges that the government's national security, classification procedures are faulty.

Last week, the 7th U.S. Circuit Court of Appeals in Chicago held a hearing on the Progressive magazine's petition to overturn the lower court order against publication of the Morland H-bomb article.