The gas (atmosphere) may be switched from nitrogen or an inert gas such as a rare gas (e.g., argon or helium) to oxygen, both oxygen and nitrogen, or the air (having a dew point of preferably lower than or equal to ???40??? C., still preferably lower than or equal to ???50??? C.) at any of the following timings: at the time when the temperature of the oxide semiconductor layer is in a constant sta