Previous Ricardian analyses of agriculture have either omitted irrigation or treated irrigation as though it is exogenous. In practice, it is a choice by farmers that is sensitive to climate. This paper develops a choice model of irrigation in the context of a Ricardian model of cropland. The authors examine how climate affects the decision to use irrigation and then how climate affects the net revenues of dryland and irrigated land. This Ricardian "selection" model, using a modified Heckman model, is then estimated across 8,400 farmers in Africa. The analysis explicitly models irrigation but controls for the endogeneity of irrigation. The authors find that the choice of irrigation is sensitive to both temperature and precipitation. Simulations of the welfare impacts of several climate scenarios demonstrate that a model which assumes irrigation is exogenous provides a biased estimate of the welfare effects of climate change. If dryland and irrigation are to be estimated separately in the Ricardian model, irrigation must be modeled endogenously. The results also indicate that African agriculture is sensitive to climate change. Many farmers in Africa will experience net revenue losses from warming. Irrigated farms, on the other hand, are more resilient to temperature change and, on the margin, are likely to realize slight gains in productivity. But any reduction in precipitation will be especially deleterious to dryland farmers, generally the poorest segment of the agriculture community. The results indicate that irrigation is an effective adaptation against loss of rainfall and higher temperatures provided there is sufficient water available. This will be an effective remedy in select regions of Africa with water. However, for many regions there is no available surface water, so that warming scenarios with reduced rainfall are particularly deleterious.