Re: It's probably gas...
sorta like one of the first thing a sub crew often does when they get to periscope depth [when the situation permits] is to stick the snorkel mast up and ventilate for a while. Same idea. Equipment has a smell to it when it operates in an enclosed space for a relatively long time. Tighten up the hatches and recirculate the air and you actually start to accumulate the smells of paint, oil, and grease. Even with the best air conditioning designs possible, and with electrostatic precipitators in the ventilation system (better than anything you could get to deal with allergens in your home), and scrubbers and burners to take care of exhaled CO2 and organic smells (farts, cooking, oil, grease, paint) not all of it is dealt with completely and the stench slowly accumulates. You notice it the most if you stayed in for an underway period, and as soon as the boat pulls in you get back to the boat and it smells "like that" for a day or two. And so does the crew (and their clothing). Wives often complain "you smell like the boat".
So in reality it's not the farts. It's the equipment. At least, from my experience.