Updated June 29 at 6:50 p.m.

The sea is everything in Gloucester, Massachusetts: the source of lobsters, livelihoods and tourist dollars. At the same time, rising water as oceans warm is probably the biggest existential threat to the community’s future. Students can see rising water levels quite literally lapping at the doorstep of the city's public high school.

That's one reason many of Amanda Pastel's students in her environmental science class have come eager to learn. On a recent morning, they examined samples of dirt from the schoolyard on the Annisquam River under a microscope to better understand what the soil under their feet is made from — and what is being lost to erosion along the city's 62 miles of shoreline.

"We are really in danger here on, like, the coast and we have so much water there's so many communities that would be underwater if the predictions are true," said Cammi Cooper, 18, a senior. "I think that there isn't enough urgency. I think we're just talking about getting bike lanes and and rental bikes all around town and more access to public transportation, and those are good, but not enough."

With climate change shifting the relationship of humans with the Earth, the work in Pastel's classroom is vital, but earth and environmental science classes are offered unevenly across Massachusetts and the nation, often taking a backseat to competing priorities.

Glenn Branch, deputy director of the National Center for Science Education, said while a basic understanding of how the Earth works is increasingly necessary for students, it's not always taught in schools. That's true even in Massachusetts, a hotbed of the science and biotech sectors. Biology, chemistry and introductory physics, a course sequence created around the time of World War I, usually takes precedence over a subject derided as "rocks for jocks."

"What I would really like to see is a lot of high school earth sciences classes," Branch said. "For states to make taking a high school level earth science class as a prerequisite for graduation, would do a lot to move the dial, I think, on climate change.

Branch is not optimistic. "I'd also like a pony," he said.

In Massachusetts, the state has issued science frameworks that include a smattering of mentions of climate change but don't mandate what districts must teach. To graduate from high school, students must pass tests showing core proficiency in English, mathematics and one science or technology field of their choice. Corporate forces are partly at work. Exxon, for example, has funded efforts to increase computer science courses in schools. Business groups push for more engineering and STEM coursework. But exactly who advocates for environmental teaching?

Often it's teachers, which brings up another problem.

Janet Hogan, president of the Massachusetts Science Education Leadership Association, said there's a shortage of science teachers, which makes it difficult for districts to offer students what they need for a solid science education. She said she's not even aiming for earth science or environmental classes but basic science literacy.

"We really need to help our students become better consumers of science," she said. "What we really need to do is we really need to teach our students to not take everything at face value when it comes to science and really think about what is out there and think about our role and our responsibility to the planet and into others on the planet."

Hogan teaches in Mansfield, Massachusetts, where she said the student population has declined in recent years, while school funding for science has remained steady. She said the high school can now offer an array of courses like field ecology and Advanced Placement environmental science classes that focus on habitat and species or marine science. Yes, marine science in landlocked Mansfield.

A review of online curricula from various high schools around the state shows they have vastly different approaches. Earth or environmental science is optional in Martha’s Vineyard, Plymouth and Marshfield, a sampling of coastal districts. But it's not an option beyond Advanced Placement work in Worcester, Belmont and even Dartmouth, where the sea level is expected to rise by more than two feet by 2050.

Back in Pastel's class in coastal Gloucester, the lab work on the minerals, insects and air that make up dirt can lead to broader conversations about erosion, its causes and increasing pace. Pastel said she invites experts to speak with students and help them understand the deep impact of air pollution and carbon emissions on climate change.

"I feel like we live in this world where a lot of companies don't want us to know. They don't want us to think about it. They want us to keep consuming," she said. "So we talk a lot about greenwashing in this class and how companies make you think they're good and healthy and good for this planet — and they're out for profit."

Students said it's empowering to understand what's at stake in Gloucester, where floodwalls have to be built and battered seawalls replaced, costing taxpayers many millions now and into the foreseeable future. Ocean levels in the area are projected to rise four feet between 1992 and 2100, putting hundreds of homes and businesses at risk too, according to the Program on Sea Level Rise at Climate Central, whose funders include the National Science Foundation.

In the high school's backyard, where the Annisquam River extends to the ocean, salt water has rushed over Gloucester's seawall during storms and across high school playing fields and gushed into the school's parking lot. A 2018 storm destroyed dozens of cars parked in the same lot, which had historically been a safe place to park off-street in a storm.

Senior Eliana Feria was in middle school when that happened. She said she and her family have talked about the obvious erosion at Good Harbor Beach, a favorite since her childhood. The environmental science class has helped her understand what's going on in a scientific context and explain it to her family.

"Being in the class and learning about it, it made me realize, I actually want to make a difference, and at least do whatever I can to lessen the impacts of what's going on," she said.

While Gloucester city officials face expensive climate mitigation projects going forward, the district is unable to unleash a flood of money for the kind of hands-on lab work done in Pastel's class.

The school's science department paid for the environmental science labs this year with a grant from the Gloucester Education Foundation.

This story was updated to correct a mistranscription.