As this weekend’s storm threatens to swell the Merced River to well above flood stage in Yosemite Valley, the National Park Service and residents of the high Sierra are hoping nature isn’t planning a repeat of the disaster of 1997.

Twenty years ago this week, Yosemite National Park was shut down for what would turn out to be a record 2½ months because of the devastation that a flooding Merced River caused.

For nearly three days, starting on New Year’s, rain pounded the parks mountains and meadows, sending the Merced River up and above roads and bridges in Yosemite Valley. Hundreds of visitors were trapped as high water swamped cars and pooled around hotels. When the water receded, buildings were damaged and sewer lines were broken, and much of the valley was covered with mud. Dead fish littered the roads near the river.

A week after the storm, a story in The Chronicle described a scene that could have been the aftermath of a Midwestern twister combined with a California temblor:

“Roads are buckled as if from an earthquake,” read the Jan. 9 story. “Wind and driving water left some camping and picnic areas looking like they had been in a tornado’s path. Tree branches and bridge railings are scattered everywhere.”

Even hibernating bears were awakened by the storm. A Chronicle reporter found the animals feasting on leftovers from smashed food lockers.

Congress would soon approve $178 million to repair the park’s wrecked infrastructure, including campgrounds and tent cabins, employee housing, the Yosemite Valley Lodge and the park’s oldest building, the Yosemite chapel.

A 2013 flood recovery report prepared by the park service described the 1997 flood as the most destructive in Yosemite in at least a generation.

During the storm, the Merced River was estimated to have risen to a record 23.4 feet, well above its 10-foot flood stage. The volume of water pouring through the valley hit 24,600 cubic feet per second, the highest flow in nearly a century of record-keeping.

“One of my most vivid memories was Yosemite Falls falls just roaring,” said Scott Gediman, a longtime park employee. “It was going so strong that the walls were literally shaking in the (office) building because of the water.”

Weather experts say the surging creeks and river were the result of heavy snowfall in December followed by warm rains that melted the snow.

This weekend, forecasters again expect the river to run above flood stage. Initial estimates called for water levels to reach 23.7 feet by Sunday, but the projection has since been downgraded to 15.5 feet.

Yosemite officials say they’ve made improvements to infrastructure since the flood of 1997, enabling the park to better withstand extreme weather. But they’re still considering closing the park when the storm hits.

“Yosemite National Park officials continue to monitor the weather forecast and will make decisions in the next day or two based on the forecast, and the ability of the park to safely accommodate visitors and employees,” a spokesman said in statement. “People planning trips to the park, beginning Thursday, should make alternate plans if the park does close.”

Kurtis Alexander is a San Francisco Chronicle staff writer. Email: kalexander@sfchronicle.com Twitter: @kurtisalexander