In the late 1960s, J. Seward Johnson of the Johnson & Johnson pharmaceutical family learned that his friend, the noted inventor Edwin A. Link had been working with the Smithsonian Institution on the development of a pioneer minisubmarine, designed for research in deep ocean waters.

At Link's suggestion, Johnston, who had long been interested in oceanogaphy, eventually donated $2 million in stock to the Smithisonian. He also was the prime mover behind another such gift. The two, now valued at $15 million, are among the largest ever received by the institution.

Yesterday, a federal judge unraveled the long and at one time tragic history of the minisubmarine, called the Johnson-Sea-Link.

The saga, recounted by U.S. District Court Judge Barrington D. Parker in a long opinion, centers on the classic legal dilemma that occurs when gifts are made in the spirit of friendship and generosity, but without specific details concerning their use. When sprits sour, as they did in the case of the minisubmarine, the courts must determine what was intended when the gifts were made.

Johnson and a Florida laboratory that supervises the Johnson-Sea-Link research contended in court that the two gifts, held in trust, were specifically intended for development of the minisubmarine project. The Smithsonian said it was free to use the income from both gifts for general oceanographic studies.

Parker ruled yesterday that the first gift -- the Johnson & Johnson stock -- obliged the Smithsonian to use the money for the entire Johnson-Sea-Link project, including the development of a companion minisubmarine.

As to the second gift, Parker said the Smithsonian is free to use the income from that trust for general oceanographic research.

The Smithsonian should keep in mind its legal mandate to spend the money "for the increase and diffusion of knowledge among men," Parker said.

The turning point in the history of the dispute occurred in the summer of 1973, three years after the gifts were made, when four men were trapped in the Johnson-Sea-link in the wreckage of a scuttled destroyer near the Florida Keys. Two Smithsonian employes died in the accident. One of them was Edwin Link's son.

"The accident did not augur well for the relationship," Parker said. The Smithsonian became concerned about it potential legal liability for the mini-submarine operation, he said. The institution also began to wonder whether it should be in the minisub business after all, considering that the real expertise was with the Florida laboratory, Harbor Branch Foundation, a nonprofit charitable trust set up by Johnson, Parker wrote.

Finally, Parker said, the Smithonian staff was having difficulties dealing with Edwin Link and his half sister Marilyn, over management of the project. w

In 1974, with Johnson's approval, the Smithsonian gave full control of the Johnson-Sea-link project to Harbor Branch, and agreed to pool resources, including the income from the two gifts, Parker said.

In 1976 that arrangement "began to deteriorate," Parker wrote. The Smithsonian wanted independence from Harbor Branch and Johnson, "sensing a new attitude," sought to reassert his control over how the two gifts were spent, Parker said.

A year later, after various demands and pressures from both sides, the Smithsonian came to the federal court and asked Judge Parker to interpret the terms of the gifts.

There were two sources of confusion in the case, Parker wrote. One was Johnson's relationship with the Smithsonian and the other with the trustees of the Hunterdon Center School of Health, the source of the second gift to the institution.

Johnson founded the school, which is supported totally with his contributions, in Flemington, N.J., in 1965, to provide education in preventive medicine, early diagnosis and nutrition. Three years later, after plans for the school didn't develop, the trustees agreed to donate half the assets -- then valued at $3.6 million -- to the Smithsonian.

Johnson's lawyer, concerned about the tax consequences for his client once the school was dissolved, made the arrangements with the Smithsonian about the gift, Parker said. The confusion and dispute between Johnson and the trustees -- all long, close friends of Johnson's -- developed when the lawyer tried to tie the gift to development of the Johnson-Sea-Link, Parker said.

With the Smithsonian, Parker said, relations were "harmonious" at the start and Johnson played an active role in development of the Johnson-Sea-Link, Smithsonian officals were able to persuade Johnson to provide $500,000 to refit a companion vessel for the minisub, Parker said. Hopeful that Johnson would donate even more money, Parker said, the Smithsonian staff "acceded readily to his wishes and were not inclined to offend him in any way."

With the 1973 accident off the Keys, and the passage of time, Parker said, that cordial relationship "soured."