## 3 Materials and Methods
### Data Collection  
Several datasets and both the national and sub national scales were employed in this study. Data collection started at the national scale as the main unit of analysis, down to the sub-national scale, based on the data from nine stations from the south to the north of Morocco. All data on the different sub-components of vulnerability were collected to attain the objectives of this study. The annual yield data for the national scale assessment for the three crops chosen: wheat, barley, and maize over the period 1991-2019 in hg/ha/year were collected from FAOSTAT [46], aiming to calculate the national scale sensitivity index. At the sub national scale, crop yield data (hg/ha/year) for the period 1989-2014 were downloaded from the Global Yield Gap Atlas [47] ([[https://www.yieldgap.org/](https://www.yieldgap.org/)]([https://www.yieldgap.org/](https://www.yieldgap.org/)) accessed on 3 November 2021) for nine stations in Morocco where these crops are mainly grown:Agadir, Beni Mellal, Fe Sais, Marrakesh, Meknes, Nador Arwi, Nouasser, Safi, and Tanger. The historical period for this sub national scale perspective was limited to 1989-2014 due to data availability. As with the national scale, the sub national perspectives helped to give us a spatial context of changes in the sensitivity index.  
Furthermore, the mean annual precipitation data and the mean crop growing season precipitation for each crop over the periods 1991-2019 and 1998-2014 for the national and sub national scale assessments were collected from the World Bank Climate Change Knowledge Portal [48] ([[https://climateknowledgeportal.worldbank.org/download-data](https://climateknowledgeportal.worldbank.org/download-data)]([https://climateknowledgeportal.worldbank.org/download-data](https://climateknowledgeportal.worldbank.org/download-data)) accessed on 31 October 2021). The latter were used to compute the exposure index. As shown in Figure 3, the growing seasons for wheat and barley are the same, but different for maize. On the other hand, the mean growing season precipitation data for each year is an average aggregate for that year's growing season months. The national scale exposure index was validated at the sub-national scale using the mean annual crop growing season precipitation and the mean annual precipitation data collected from the World Bank Climate Change Knowledge Portal [48].  
To compute the adaptive capacity index, two proxies of adaptive capacity were used. It turns out that poverty (%) and literacy rates (%) are major indicators of the variations in the adaptive capacity and resilience to climate disturbances. These two proxies were selected to assess the adaptive capacity. The poverty rate involves the material and financial assets that reflect the capacity of populations to maintain their functioning in the face of the external constraints imposed by climate change by appealing to resilience and evolving  
Figure 3: Crop calendar for wheat, barley, and maize in Morocco.  
Figure 2: Spatial distribution of pluviometry across Morocco under (**a**) and (**b**).  
more desirable tools and livelihoods that help improve the sustainability of the crop system. The literacy rate on the other hand involves the ability of a farmer to read and be able to grasp knowledge on climate change. The national-scale poverty and literacy rate data were collected for the period 1991-2019 from [49] (doi.org/10.6084/m9.figshare.16903483.v1 accessed 31 October 2021), while those for the sub-national scale sites were collected for the period 1989-2014 from the Regional Disparities in Development in Morocco [50]. Since the vulnerability index is a composite index, it is a function of the three indexes already mentioned (the sensitivity index, exposure index, and adaptive capacity index). Therefore, the simulation of the vulnerability index will be based on the data collected from these three indexes. This computation will be explained in the subsequent parts of this paper.