Maine is receiving an influx of federal funds to help prepare for future climate-driven storms and to help farmers transition to cleaner — and cheaper — forms of energy.

In Brunswick, U.S. Agriculture Secretary Tom Vilsack on Friday announced $4.3 million in grants that will help 42 farms and small businesses reduce their costs by installing things such as heat pumps and solar panels.

Then later in Portland, the Department of Commerce and National Oceanic and Atmospheric Administration announced $69 million to help Maine make investments in working waterfronts and rural and tribal communities.

“This award today is vitally important to the future of Maine’s marine economy specifically and Maine’s economy generally,” said Cape Elizabeth lobsterman Curt Brown. “Without it, so many Maine communities would not survive.”

Brown recalled the two January storms that slammed the coast, destroying causeways, bridges, wharves and docks. Those storms, along with an inland storm in December, caused more than $90 million in damage to public infrastructure.

Now the idea is to be ready for future storms and to build the type of infrastructure that can withstand it, said U.S. Sen. Angus King.

“For the first time we’re talking about preventing and dealing with the damages of climate change instead of fixing them after they happen,” he said.

The Governor’s Office of Policy Innovation and the Future will administer the funds to help blunt the future impacts of storm surge, flooding and extreme storms.

The other grants announced Friday come from the U.S. Department of Agriculture’s Rural Energy for American Program. It’s just one of several recent agriculture grants, according to Gov. Janet Mills.

“So far, USDA has awarded about $231 million in 200 projects across the state of Maine,” Mills said. “Those projects are supporting our transition to clean energy and lowering our energy costs, especially for farmers and small businesses across the state.”

Vilsack said the latest round of funds will help farmers switch to renewable energy and is also designed to create jobs.

“Somebody has to install those systems so it’s a job creator,” he said. “It’s an assistance to the farm and business owner.”