His former office, which researches topics like air pollution and chemical testing, has lost 250 scientists and technical staff members since Mr. Trump came to office, while hiring 124. Those who have remained in the office of roughly 1,500 people continue to do their work, Dr. Kavlock said, but are not going out of their way to promote findings on lightning-rod topics like climate change.

“You can see that they’re trying not to ruffle any feathers,” Dr. Kavlock said.

The same can’t be said of Patrick Gonzalez, the National Park Service’s principal climate change scientist, whose work involves helping national parks protect against damages from rising temperatures.

In February, Dr. Gonzalez testified before Congress about the risks of global warming, saying he was speaking in his capacity as an associate adjunct professor at the University of California, Berkeley. He is also using his Berkeley affiliation to participate as a co-author on a coming report by the Intergovernmental Panel on Climate Change, a United Nations body that synthesizes climate science for world leaders.

But in March, shortly after testifying, Dr. Gonzalez’s supervisor at the National Park Service sent the cease-and-desist letter warning him that his Berkeley affiliation was not separate from his government work and that his actions were violating agency policy. Dr. Gonzalez said he viewed the letter as an attempt to deter him from speaking out.

The Interior Department, asked to comment, said the letter did not indicate an intent to sanction Dr. Gonzalez and that he was free to speak as a private citizen.

Dr. Gonzalez, with the support of Berkeley, continues to warn about the dangers of climate change and work with the United Nations climate change panel using his vacation time, and he spoke again to Congress in June. “I’d like to provide a positive example for other scientists,” he said.

Still, he noted that not everyone may be in a position to be similarly outspoken. “How many others are not speaking up?” Dr. Gonzalez said.