If gas, smoke or some other contaminant is released into the New York City subway, where does it go? That's the question that scientists from Brookhaven National Laboratory on Long Island and city agencies are trying to answer with a series of tests this month aimed at beefing up the city's preparedness for potential terrorist attacks or accidental leaks.

The Subway-Surface Air Flow Exchange (S-SAFE) project will take place over three nonconsecutive days in July, including today (July 9), and will involve releasing a class of "non-toxic, inert, odorless and invisible" gases called perfluorocarbons into select subway stations and street-level locations for 30 minutes, according to a Brookhaven release. These tracer gases will be monitored by about 200 sampling devices placed strategically to track where the gases flow.

Knowing where these harmless tracer gases flow will help city officials better anticipate where actual harmful contaminants might go in the event of a dangerous spill or a terrorist attack involving chemical, biological and radiological (CBR) weapons, for example, anthrax. This data will help city emergency agencies sharpen their response to an attack or accident and will help them know where to place CBR detection equipment to monitor for such events, according to the release.

"The NYPD, in partnership with the MTA, is responsible for keeping more than 5 million daily subway customers safe and secure," Fernando Ferrer, the MTA's acting chairman, said in a statement. "This study will bolster the NYPD's understanding of contaminant dispersion within the subway system as well as between the subway system and the street, thereby improving its ability to better protect both our customers and the city population at large." [What Were the Worst Subway Attacks in History?]

The July tests will involve 21 subway stations and several aboveground locations in the Bronx, Brooklyn, Queens, Staten Island and in Manhattan from 59th Street to the Battery, Brookhaven said. The other two tests dates will be determined based on weather and will be announced to the public a day in advance.

These air flow studies have been conducted since the 1980s, including a 2005 study in Manhattan, and studies of the subway systems of Boston and Washington, D.C. The current New York City study, commissioned by the NYPD and funded through a $3.4 million Department of Homeland Security Transit Security Grant, is the biggest of any of these tests yet conducted.

Follow Andrea Thompson @AndreaTOAP, Pinterest and Google+. Follow us @livescience, Facebook & Google+. Original article on LiveScience.com.