Photosynthesis uses light energy, carbon dioxide and water to produce oxygen and glucose, which is the main food source for most living things. It occurs in two stages in the chloroplast. The light-dependent reactions use energy from sunlight to convert water to oxygen and produce ATP and NADPH. These products are then used in the light-independent Calvin cycle to reduce carbon dioxide and produce glucose from carbon dioxide absorbed from the atmosphere. Photosynthesis moderates global warming by absorbing carbon dioxide, a greenhouse gas, from the atmosphere.