Do you love the smell of a chlorinated pool in the summertime? Unfortunately, urine for a surprise.

That nostalgia-inspiring aroma is actually a result of disinfection byproducts, or DBPs, created when people skip the bathroom and pee in the pool – and those DBPs are not good for you.

A new video produced by the American Chemical Society explains that when urine and other organic matter mix with the disinfectants we use in pools, they set off chemical reactions that produce compounds such as cyanogen chloride, chloroform, dichloramine, trichloramine and bromoform – AKA the unwanted DBPs.

Chloramines can cause irritation to the skin, eyes and respiratory tract, according to the Centers for Disease Control and Prevention.

DBPs are also the result of dirt, sweat and lotion that swimmers bring into the pool, but urine accounts for about half of them, which is why the video calls using a toilet before diving in “your civic duty”.

The tricky art of pool chemistry has made international headlines this summer, thanks to the startling metamorphosis of Rio’s Olympic diving pool from azure to emerald.

Though Olympics officials have attributed the murky green waters to the accidental introduction of 160 liters of hydrogen peroxide into the pool, chances are there was a good amount of urine in there as well.

Seventeen percent of Americans admit to peeing in the pool, according to a 2009 survey by Water Quality and Health Council, but among elite athletes the number is probably much higher.

“Nearly 100% of elite competitive swimmers pee in the pool. Regularly,” Carly Geehr, a former member of the US swimming national team, wrote on Quora in 2012.

“Some deny it, some proudly embrace it, but everyone does.”

Among those in the latter camp are Olympians Michael Phelps and Ryan Lochte.

In 2012, Lochte responded to a question about peeing in the pool, saying: “Of course. We always do. I think there’s just something about getting into chlorine water that you just automatically go.”

Lochte went on to admit that he had befouled the pool during the London Olympics: “Not during the races, but I sure did before in warm-up.”

Phelps subsequently backed up his sometime rival, telling the Telegraph: “I think everybody pees in the pool. It’s kind of a normal thing to do for swimmers. When we’re in the water for two hours, we don’t really get out to pee.”

Such brazen pee-havior is unwelcome to Ernest R Blatchley III, a professor of engineering at Purdue University who studies DBPs.

“High-profile swimmers have a real opportunity to take a position of leadership and responsibility,” he told Chemical & Engineering News. The scientist urged swimmers “to practice commonsense hygiene”.