The American Lung Association gives San Diego a failing grade for air quality.

Using data from the state Air Resources Board, the Lung Association ranks San Diego County sixth in the nation for the worst ozone (smog) pollution.

Eight of the country’s 10 most-polluted cities are in California. Los Angeles-Long Beach (including the Inland Empire) is the worst offender, in the Lung Association’s latest rankings.

Bakersfield is second, followed by the Visalia, Fresno and Sacramento areas.

The Lung Association’s local director said climate change and global warming are responsible in part for California’s poor air quality.

"The drought, the heatwaves, the wildfires, we've had experiences over the past few years that have caused a pretty significant uptick in our bad ozone days,” said Debra Kelley.

But there is some good news in this latest air quality survey.

Data gathered by the Lung Association shows that San Diego County averaged 95 smoggy days per year, from 1998-2000.

That number dropped to an average of just 26 dirty air days, from 2012-14.

But the latest survey shows a three-year average of 37 smoggy days, a 42 percent increase from the 2012-14 time frame.

“We are tough graders,” Kelly says of the “F” grade given San Diego for its smog ranking. “But we think it's because we are protecting our most important resource, which is really our own health."

The Lung Association says the East County, especially Alpine, has the dirtiest air in San Diego County. That's because the mountains to the east trap the hot, dirty air.

(San Diego gets a “C” grade for particulate (soot) pollution, with an average of just 1.5 unhealthy air days caused by high levels of soot.)

Both the Air Resources and the Lung Association say Californians must do more to reduce smog and soot, and protect public health.

"Using more renewables, using our cars less, switching to zero-emission vehicles,” Kelley said. “All of those things will help reduce climate change, which is going to clean up our air."