And you wonder why they call him "Joe Cool"?

Today, San Francisco quarterback Joe Montana opened his book of resourcefulness and passed for a record 331 yards and three touchdowns to lead the 49ers to a 38-16 victory over the Miami Dolphins in Super Bowl XIX before 84,059 at Stanford Stadium.

Not only did he complete 24 of 35 passes in breaking the Super Bowl record of 318 yards set by Pittsburgh's Terry Bradshaw (Super Bowl XII versus Dallas), but he rushed 59 yards on five tries, another record for quarterbacks. Imagine, he ran for more than double the yardage of Miami (59-25).

He was named the game's most valuable player as the 49ers (18-1) became the first team in league history to win 18 games in one season. "He hurt us in every way," Miami Coach Don Shula said. So did Roger Craig, who scored three touchdowns for the 49ers.

"All we heard all week long was Miami's offense; 'how you going to stop them?' " said Montana, who was voted most valuable player in the 49ers' 26-21 victory over Cincinnati three Januarys ago. "Deep inside we knew we had a great offense, too. Nobody was thinking about how to stop us."

Maybe Montana ought to engrave the names of the 49ers defensive players on his trophy. It seemed that Miami quarterback Dan Marino, the record-breaking second-year professional who averaged three scoring passes a game this season, barely had a chance today.

The 49ers broke from their normal 3-4 alignment and deployed five defensive backs (a nickel defense) and added pass-rushing phenomenon Fred Dean to a four-man line early in the game. The dividends? Marino was dusted.

"They played better than any team played us defensively this year," said Marino, his season-long magic carpet ride at an end. "I didn't make the plays on some occasions when I had a chance to."

And Shula, now 2-4 as a Super Bowl coach, added: "It was our poorest offensive game of the year."

Maybe so. But surely this was the greatest moment for San Francisco's defense, the first unit to hold Miami under 21 points this season. Today's equation of Montana plus the 49ers defense equaled San Francisco 537 total yards, Miami 314.

Marino appeared more rattled than regal today, completing 29 of 50 passes for 318 yards. When he tried to revive his dying Dolphins (16-3) after a 28-16 halftime deficit, he found he couldn't. "We knew all week, among us in the secondary," safety Eric Wright of the 49ers said, "that we would be the key to beating those guys."

Marino was sacked three times on the first two drives of the second half alone, falling into the arms of defensive linemen such as Dwaine Board and Manu Tuiasosopo. In fact, Marino was sacked four times today (all in the second half) after being sacked only 14 times in the previous 18 games.

And remember those two marvelous Miami receivers called the Marks Brothers? You probably couldn't have found Mark Duper and Mark Clayton with a search party. Duper caught one pass and Clayton six, most late in the game.

When Marino tried to find Clayton with a 34-yard scoring pass late in the third quarter, already trailing by a desperate score of 38-16, Wright intercepted, with arms outstretched, at the one-yard line.

The bell tolled one final time for Marino when, one play after San Francisco's Dana McLemore had fumbled away a punt at the San Francisco 21 early in the fourth quarter. This was when Marino was flushed from the pocket and heaved a sickly toss into the end zone. Safety Carlton Williamson intercepted.

Perhaps sometime late tonight, folks in Miami will sing something sad and soft, such as "Danny Boy." By late in the game a fog swept over Stanford Stadium and Marino, only 23, barely was visible on the far sideline.

And now the football world spins gently for Joe Montana. "Montana had an awful lot to do with this," Shula said. "Every time we seemed to have good pressure on him, he scrambled and made big plays on his own, or he scrambled and passed for big plays."

After the game, President Reagan was on the phone, telling San Francisco Coach Bill Walsh: "I guess, as a coach, you couldn't have asked for anything greater than what they gave you tonight."

And Walsh responded: "It's the greatest football team I've ever been around."

San Francisco's offense was a deadly concoction, mixing runs by Wendell Tyler (65 yards) and Craig (58) with Montana's short, high-percentage passes.

Craig's three touchdowns broke the Super Bowl record of two, held by 10 others. He rushed two yards for one score and caught Montana's passes from eight and 16 yards to account for the other scores.

The 38 points scored by the 49ers matched the Super Bowl record set by the Los Angeles Raiders in their 38-9 victory over the Redskins last January. And to think that, after the game, Walsh said: "I was a little haunted, and I was wondering if we would even score."

How strange, too, that one of the Dolphins' greatest strengths, punter Reggie Roby, became a genuine weakness in this game. He is the all-pro punter with the sonic boom punts that netted the best average in the league this season.

His performance in the second quarter was horrific. When the quarter began, Miami led by 10-7 and it seemed Marino was ready to break every passing record set on the planet Earth. He had completed nine of 10 for 103 yards and a touchdown in the first quarter.

Roby and the Miami punt coverage team failed thrice in the second quarter. First, Roby dragged a punt 37 yards that rolled dead at the San Francisco 47. Four plays later, Montana threw a touchdown pass to Craig for a 14-10 lead.

Next, Roby looped a 40-yard punt that McLemore returned 28 yards to the San Francisco 45. This represented only a 12-yard net. Six plays later, Montana scrambled for his six-yard score and a 21-10 edge.

Finally, Roby slapped a punt 39 yards and McLemore made a 10-yard return, to the San Francisco 48. This represented only a 29-yard net. Ah, field position. Nine plays later, Craig ran over left guard and it was 28-10 and the 49ers seemed going, going, gone.

"He's the best punter in the league," Shula said, "but he didn't punt like the best punter."

Both teams seethed during the first half. Miami's ire was raised when 49ers receiver Freddie Solomon caught Montana's pass, was hit and fumbled at the Miami 20. The Dolphins recovered. Officials ruled the pass incomplete, however, and the 49ers drove for the touchdown that made it 28-10.

"You can't complain about one call in the game," said Miami linebacker Bob Brudzinski. "I don't know if it would have been a turning point in the game."

The 49ers were, in truth, angry at one of their own. Marino led the Dolphins 72 yards on 11 passing plays to arrange Uwe von Schamann's 31-yard field goal that brought Miami to 28-13 with 13 seconds left in the half. It seemed the half would end that way.

On von Schamann's grounded kickoff, however, San Francisco guard Guy McIntyre picked up the ball and sat on the ground, safely, trying to avoid a fumble. For some reason, McIntyre arose and immediately was hit by Miami running back Joe Carter.

McIntyre fumbled and Miami's Jim Jensen recovered at the 13 with four seconds left. Von Schamann then kicked a 30-yard field goal to pull Miami to 28-16 as the half expired.

But the second half brought nothing more than a second wave of 49ers momentum. "They dictated to us when they went to a four-man line," Marino said. He finished with Super Bowl records for attempts, 50, and completions, 29, but most came long after the fog and the 49ers had rolled in.

"Basically, we broke down their pass protection and in the third quarter our pressure began to split the seams . . . as soon as we saw they could move the ball on us, we came up with the three-man line," Walsh said. Asked about the game's turning point, he said: "Turning point? There was no turning point othen than us rolling up the score."

"Dan Marino had some problems," Shula said. "He didn't play the way he did during the regular season . . . Our offense had a tough time. We hadn't been stopped all year, but we were stopped today. We would have liked to go to our running game (only 25 yards on nine carries), but the runs we tried didn't work and we got behind. Their defensive backs were playing so far off, it was tough to think about going deep."

There was keen symbolism among Walsh's final comments. He said the very glorious things about Montana that the football observers had been saying about Marino all week long.

Said Walsh: "Montana is the greatest quarterback in this league, maybe of all time. This was his year."

For sure, it was his game.