WHEN A German-speaking archivist named Timothy Mulligan saw the smash German film "Das Boot" about submarine warfare in World War II, he dug out the captured logs of German U-boats that had been turned over to the National Archives by the British Admiralty in 1978.

"I was curious to see what we might have on U-96, the German submarine described in the movie," Mulligan said the other day in his office at the Modern Military Branch of the National Archives. "I also anticipated that we might have inquiries about the U-96 log because of the movie, but I was really surprised to find what we had."

What Mulligan found were the complete logs of every patrol U-96 had made from September 1940 to February 1943, when the German Admiralty retired U-96 from active service and turned it into a training vessel at the St. Nazaire submarine pens on the Bay of Biscay in occupied France. The logs were scattered through 139 rolls of microfilm the British Admiralty had kept secret until four years ago, when it made them available to the U.S. Navy.

To Mulligan, the biggest surprise in the U-boat logs was how faithful the writer of the movie (Lothar-Gunther Buchheim, who also wrote the book on which the movie was based) was to reality. Most events in the film, which takes viewers inside U-96 on a long and harrowing patrol of the North Atlantic in 1941, actually happened on a 45-day mission that U-96 made in October of that year. Even the events that didn't happen on that one patrol happened on other patrols or to other U-boats.

"What Buchheim did was to sum up his experiences on several U-boats, including U-96," Mulligan said.

The patrol described at the outset of the movie suffers through endlessly rough seas in which the crew of U-96 sees no action at all. The same thing happened to the real crew of U-96. Says an entry in the U-96 log: "We've spent three weeks at sea and the only thing we've seen is another U-boat."

The action in the movie picks up when U-96 finally encounters a British convoy, just as the real U-96 did. Under a full moon partially obscured by clouds, U-96 makes a night attack from the surface on two merchant ships, then makes a submerged attack on a tanker and surfaces to watch it burn. All true, says Mulligan, except that the real crew watched the tanker burn from periscope depth and didn't see survivors on fire leaping into the sea.

"U-96 watched that tanker burn for hours," Mulligan said. "There are even descriptions of listening to the ships they've torpedoed break up and sink. One log entry refers to the 'unmistakable sounds of a ship sinking.' "

Unmistakable sounds in the film are of U-96 under attack by British destroyers. The sounds of the destroyers' propellers as they pass directly overhead. The sonar pings echoing off the submarine's hull. The submarine detection signals that sound like gravel being tossed along the topside of the hull. The "wabos" (for wasser bombes) that are the depth charges being dropped into the sea by the destroyers. All these sounds are in the logs of U-96.

Also in the logs is the rerouting of U-96 from the Atlantic to the Mediterranean, another event in the film that really happened. "Hitler made a major strategic decision to shift the focus of the U-boat war to the Med because the Italian fleet couldn't protect the supply lines over to North Africa," explained archivist Mulligan. "U-96 was one of 24 U-boats ordered to make that dangerous run through the Straits of Gibraltar and into the Mediterranean."

U-96 was one of eight U-boats that never made it through the Straits. Four were sunk and four--including U-96--damaged and forced to turn back. U-96 was attacked by a British bomber as it dove underwater to escape the attack. The log reveals that U-96 sat on the ocean floor for hours while the crew worked "coolly and doggedly" to repair the boat's damaged batteries.

While the real U-96 never suffered the fate that the submarine meets at the end of the movie, another U-boat was sunk in similar fashion by British aircraft. The real U-96 was sunk in port by American aircraft on March 30, 1945, at Wilhelmshaven, where it still rests in 60 feet of water. The captain of U-96, an old salt named Willenbrock Lehmann who was only called "Der Alte" (the old man) in the movie, is still alive in West Germany.