Model S owners say that the Air filter is usually the cause of the moldy odor in your car.
There is one easy thing you can do. If the cause of the moldy smell in your car is the air filter, then turn your AC off a few minutes before you arrive at your destination. This allows the moisture in the system to dry. Don't turn off your fan when you turn off the AC though. Otherwise the air filter will not dry and the moldy odor will not be eliminated.
Tesla Motors Model S Air Filter Replacement
Alternatively, you can switch the air from interior to exterior every 15 minutes or so while driving. It lubricates the hoses and odor should go away. According to people who have tried this method of moldy odor removal, the smell should go away and it should work perfectly after 3-4 days.
Another cause of the moldy odor can be a clogged AC drain line. Just like the home HVAC systems get clogged all the time, the same can happen with a car. To check it look under your Tesla after the AC has been running for a few minutes to see if water is running out the bottom.
If these things don't help and the moldy odor is not removed, you may need to take your Model S to the nearby service center to be checked professionally.