If the police smell marijuana coming from your home that gives them what is known as "probable cause" to believe there is criminal activity going on in your house.
Probable cause means that, based upon the facts and circumstances known to the officer at that time, he would have information that allows a reasonable person to conclude a criminal act was under being committed or had been committed and that marijuana would be found within the house.
But the smell of marijuana alone is not enough to allow the police to just barge into your house. For them to enter your home without a search warrant must have something called "exigent circumstances."
So, what exactly counts as exigent circumstances?
It basically means there's some sort of an emergency situation requiring swift action by the police to prevent imminent danger to life or serious damage to property or to forestall the imminent escape of a suspect, or destruction of evidence.
So, if you just answer the door to the police and they say they smell weed, they can't just bust into your house without something more. Now they may say, "we smell weed we need to come in and look around."
They may want to come in but unless they can establish there is some sort of exigent circumstance they can't legally just walk into your house.
If you feel like inviting them in so they can find your stash to arrest you, well, that's up to you. The police may tell you they're going to try to get a search warrant; if they're successful then they can come back with a warrant to search your house. Then again, they may not be able to get the search warrant.
In most cases, if the police come in without a search warrant, they're going to try to justify it in court by claiming there was some sort of emergency.For example, they may say they heard a bunch of noise that sounds like toilets flushing that led them to believe that someone was trying to destroy the evidence or that a suspect was trying to escape. If there's a dispute about whether or not the police legally entered your home, the judge would have to decide if the police were or were not- justified. Nowadays with body cams, we have more of an opportunity to see what really went on.
Be aware that some drug-related smells can allow the police to come into your home without a search warrant, particularly, the smells associated with manufacturing meth. That's because meth labs can (and do) blow up. Alabama courts consider the odor of a meth lab to provide both probable cause and emergency circumstances because of the risk of explosion and the immediate and hazardous danger to people who may be near or exposed to a meth lab. But weed doesn't blow up so, without more, the cops can't legally bust into your house without a warrant because of the smell of weed alone; for a warrantless search based on weed odor to be legal they must be either invited in or be able to establish there was some sort of exigent circumstances.