In a separate email to a colleague, Mr. Gallaudet confided he was close to quitting.

“I’m having a hard time not departing the pattern right now,” he wrote to John D. Murphy, the chief operating officer at the National Weather Service, using aviation lingo to describe his desire to leave.

“Hang in there, sir,” Mr. Murphy replied and suggested the agency needed strong leadership to counteract the creeping political influence on science. “Is this battle to die for or better to stay and fight for what’s right. It’s latter for me … we can do more in pattern.”

The stress the White House moves placed on rank-and-file NOAA employees was evident in the reaction of Dennis Feltgen, a normally unflappable spokesman for the agency’s National Hurricane Center. In response to an inquiry by the news media about the president’s altered map, he wrote a one-word email to higher-ups: “HELP!!!”

The documents released Friday under the Freedom of Information Act offer the clearest picture to date of the turmoil brought about by Mr. Trump’s initial remark and subsequent false statements about the path of Hurricane Dorian, as well as his decision to trot out a map in the Oval Office that appeared to have been altered with a black marker to suggest Alabama was in the potential path of the storm.

The emails show top NOAA officials knew full well that the map Mr. Trump presented had been altered, even as days later the agency issued an unsigned statement essentially chastising the Birmingham forecasters for having contradicted the president.

“The chart shown in the briefing is old and doctored to extend the cone to Alabama,” Corey Pieper in NOAA’s press office told colleagues on Sept. 4, as the agency received a barrage of requests from the news media to understand the source of Mr. Trump’s comments.

“Are you sure it was doctored? Was Alabama never in the cone to that extent?” asked Susan Buchanan, another communications officer.