1. It smells bad in here.

2. It smells bad.
3. It smells bad in this room.
----------------------
What does it refer to in each sentence?

I take "it" to be referring to the smell, the atmosphere. In other words, the smell in here is bad.

Then, "it" doesn't refer to a specific thing as in the following?

e.g. How is it going?

No, nothing specific.

"How is it going?" is just a casual question someone might ask when meeting someone in a hallway! There is no particular antecedent for "it."

In each sentence, the pronoun "it" refers to something that is causing a bad smell. To determine what "it" refers to in each sentence, we can analyze the context and the information provided.

1. "It smells bad in here."
In this sentence, "it" refers to the overall atmosphere or air quality in the place where the speaker is currently located. The phrase "in here" indicates that the bad smell is present in the immediate surroundings of the speaker.

2. "It smells bad."
Here, "it" is a general reference to an unspecified source or cause of the bad smell. Without additional context, it is not clear what specifically is producing the unpleasant odor.

3. "It smells bad in this room."
In this sentence, "it" refers to the air quality within a specific room. The phrase "in this room" specifies the location where the bad smell is being noticed.

In order to find out more about what specifically is causing the bad smell in each case, further investigation or clarification would be needed.