Precipitation Variability and Drought Assessment Using the SPI: Application to Long-Term Series in the Strait of Gibraltar Area

: The standardized precipitation index (SPI) provides reliable estimations about the intensity, magnitude and spatial extent of droughts in a variety of time scales based on long-term precipitation series. In this work, we assess the evolution of monthly precipitation in the Barbate River basin (S. Iberian Peninsula) between 1910/11 and 2017/18 through the generation of a representative precipitation series for the 108-year period and the subsequent application of the SPI. This extensive series was obtained after processing all the precipitation data (67 stations) available within and nearby the basin and subsequent complex gap-ﬁlling stages. The SPI identiﬁed 26 periods of drought, 12 of them severe and 6 extreme, with return periods of 9 and 18 years, respectively. Complementary analysis evidenced changes in precipitation cyclicity, with periodicities of 5 and 7–8 years during the ﬁrst and second half of the study period, respectively. Additionally, the amplitude of pluviometric oscillations increased during the second half of the period, and extreme events were more frequent. While the decade 1940–1950 was very dry, with precipitation 11% below the basin’s average, 1960–1970 was very humid, with precipitation 23% above average. Contrary to the results of climate change projections speciﬁc to this area, a clear downward trend in precipitation is not detected.


Introduction
Droughts are extreme climatic events associated with the spatiotemporal variability of precipitation regimes and have profound impacts on natural and socioeconomic systems. These natural hazards pose a threat to water security and food production, cause property damage, loss of life and displacement of communities, and affect a vast range of ecosystem services. In spite of the many ways droughts affect the environment and human lives, the concept of drought itself is elusive, and to date, there is no universal definition. For instance, the World Meteorological Organization (WMO) [1] defined droughts as sustained and extended deficiencies in precipitation and the Intergovernmental Panel on Climate Change (IPCC) [2] as periods of abnormally dry weather long enough to cause a serious hydrological imbalance. The reason for this lack of a unified definition is that droughts must be defined according to the characteristics of each climatic regime, sectors affected or the application intended for the definition [3]. Additionally, droughts can be classified into four main categories (meteorological, hydrological, agricultural and socioeconomic) [4,5], and their negative effects can be exacerbated by numerous factors, such as the demand placed on water resources or their management strategy.
Droughts are located at the tail of the distribution of climate variables and usually occur as clusters of several consecutive years; however, their timing, frequency and intensity are undergoing rapid changes as a consequence of climate change [6,7]. In recent decades, a wide variety of indexes have been developed to detect, monitor and assess droughts. These indexes are usually relevant to a given type of drought and rely on combinations of precipitation, temperature, evapotranspiration or streamflow data. One of the most widespread meteorological drought indices is the Standardized precipitation index (SPI) proposed by McKee et al. [8] to identify abnormally wet and dry periods. The SPI, which will be explained in more detail in Section 3.2.2, is the index considered in this work. Another well-known index is the Palmer drought severity index (PDSI) [9], based on a rather complex soil-water balance that considers precipitation, soil moisture and evapotranspiration for a specific region. The PDSI relates the severity of drought to the accumulated weighted differences between actual precipitation and the precipitation necessary to retain a normal water balance level. Although the PDSI provides a more comprehensive picture of the water cycle and its components, its algorithm was devised for relatively homogeneous semiarid or subhumid regions, and its extrapolation beyond these areas would lead to unrealistic results [10]. Another tool to define drought duration and severity and predict their onset and end is the reclamation drought index (RDI) [11], which is calculated at a river basin level and incorporates as inputs precipitation, snowpack, streamflow, reservoir levels and temperature to account for evaporation.
Other recent approaches are the effective drought index (EDI) [12], which considers daily water accumulation with a weighting function of time, or the reconnaissance drought index developed by Tsakiris et al. [13], which relates precipitation with the potential evapotranspiration. The amount and duration of water deficits have also been described with indexes based on precipitation anomalies. Indexes of this type are the Foley drought index (FDI) or the percent of normal rainfall. The FDI tallies the deviations of monthly precipitation measurements from long-term monthly averages and normalizes each anomaly with respect to the annual average rainfall in order to account for their magnitude [14]. On the other hand, the percent of normal precipitation (PNP) is one of the simplest and most effective methods to measure rainfall in a single region with similar geographic characteristics or in a single season. It is obtained by dividing actual precipitation by normal precipitation (usually considered a 30-year mean) and multiplying by 100%. Its main disadvantage is that PNP is based on a normal distribution where the mean and median are considered to be the same when, actually, average precipitation is often not the same as the median precipitation [15]. In spite of the limitations of these indices, they enable assimilating large volumes of data into quantitative information and constitute advantageous tools for drought forecasting, impact assessment and contingency planning [16].
Recently, drought research has headed towards the use of data-driven models such as support vector regression (SVR) and artificial neural networks (ANNs) [17][18][19]. However, these machine learning techniques are constrained by their limited ability to deal with nonstationary data, an issue that is being overcome by the application of wavelet analysis to preprocess data inputs [20,21]. This approach is demonstrated to be a useful forecasting tool, improving the results of traditional ANN and SVR models and in the case of SPI time series, reducing its sensitivity to changes in monthly precipitation.
The expected changes in drought patterns are becoming a major concern in regions with large interannual precipitation variability, such as the countries of the Mediterranean basin, considered a hot spot of climate change [22,23]. This has led to a growing body of literature on the evolution of precipitation and drought patterns using well-established indices in the Mediterranean area [24][25][26][27][28]. In the particular case of the Iberian Peninsula, drought patterns are determined by their intermediate location between temperate and subtropical climates and are characterized by their complexity and marked spatial gradients throughout the territory [29]. The number of studies on drought characterization and monitoring using indices is quite large in the context of the whole country [30][31][32][33][34][35]. However, the limited spatial density of measurements in large-scale studies, together with the remarkable climatic and topographic heterogeneity of certain regions such as Andalusia (Southern Spain), may yield unrepresentative results on smaller scales. It should be noted that the evolution of drought periods within the Iberian Peninsula can be very diverse; while the most intense episodes are usually regional, other individual droughts are restricted to concrete areas and take place as local phenomena. Thus, even the most widespread episodes of drought have affected the Iberian Peninsula in an uneven manner [36].
Although there are some works on drought indices at the Andalusian level [37], the number of detailed studies at smaller scales such as hydrographic basins in this region are very scarce, and only a few can be cited [38,39]. Therefore, it is necessary to increase efforts towards finer detail studies that may help to understand more accurately climatic variability and evolution of droughts, especially in certain regions with particular vulnerabilities and geographies, such as the Barbate River basin. In this regard, despite the great dependence of this basin on surface water resources, to date, there are no studies on the evolution of precipitation in this location.
The aim of this paper is to analyze the irregularity of precipitation between 1910/11 and 2017/18, with special emphasis on periods of drought, to identify changes in rainfall patterns potentially associated with climate change in the Barbate River Basin (province of Cádiz, Andalusia). In this regard, the main challenge was the generation of a rainfall series over a century long and representative of a large area of territory from all the available records in the basin, which were affected by numerous data gaps. For this purpose, we present a workflow for the elaboration of a 108-year monthly precipitation series and its characterization from the point of view of the occurrence, magnitude and duration of droughts using the SPI. The interest of this work also lies in the study area, whose characteristics are typical of a transition zone between temperate and subtropical climates, with marked spatial gradients, influenced by its location between the Atlantic Ocean and the Mediterranean Sea. This paper also discusses future drought and rainfall trends projected for the region by several authors and governmental agencies and compares their findings with those reported for the study area. The data produced in this study will provide valuable information for management and decision making by different entities such as water user associations (WUA) and will aid in the adoption of appropriate water policies that minimize the impact of future droughts in the study area. Additionally, the knowledge gathered from this study can be the seed for future research in this geographical area, in addition to being of great importance for the allocation of water resources and economic and agricultural development in the basin.
After briefly describing the most relevant drought indices, their applicability and limitations, the remainder of this work is structured as follows. Section 2 presents the case study and particularities of the study area. Section 3 provides a detailed description of the dataset and methodology applied. Section 4 presents the main experimental results, based on the analysis of the precipitation series and on the evolution of the SPI. In Section 5, our findings are discussed and compared with those from other studies. Finally, Section 6 summarizes the main conclusions drawn from the research.

Case Study: Climate and Context
The Barbate River Basin is located in the province of Cadiz, in the southern tip of Spain, near the Strait of Gibraltar. The basin has an area of approximately 1330 km 2 and displays a smooth orography, with more than the 70% of its area ranging between 0 and 100 m altitude, except for the NE sector, which coincides with the Alcornocales Natural Park, where mountainous reliefs reach 1090 m above sea level at some locations ( Figure 1).
According to the Köppen-Geiger classification, the climate of this Andalusian region is temperate with hot, dry summers [40]. At the local scale, the basin is characterized by a Mediterranean climate with a strong oceanic influence bolstered by the orography and a marked seasonal rainfall regime. In the study area, precipitation shows a strong interannual irregularity and mainly concentrates on autumn and winter months, with practically no precipitation between June and September. Rainfall shows average annual values of 835 mm, which can range between 365 mm during dry years and 1606 mm during wet years [41]. The average annual temperature is 18.2 • C, with milder values in mountainous areas. The area is strongly affected by intense and persistent periods of warm, dry easterly winds known as Levante, which can reach speeds over 100 km/h and blow for more than 7 consecutive days, resulting in significant evaporation processes on surface resources [42,43]. The economy in the basin is mainly based on agriculture and livestock farming, activities that are highly dependent on the supply of surface water from the reservoirs Barbate, Celemín and Almodóvar (joint capacity of 277 hm 3 ) and, to a lesser extent, on the exploitation of local aquifers [44]. According to the Köppen-Geiger classification, the climate of this Andalusian region is temperate with hot, dry summers [40]. At the local scale, the basin is characterized by a Mediterranean climate with a strong oceanic influence bolstered by the orography and a marked seasonal rainfall regime. In the study area, precipitation shows a strong interannual irregularity and mainly concentrates on autumn and winter months, with practically no precipitation between June and September. Rainfall shows average annual values of 835 mm, which can range between 365 mm during dry years and 1606 mm during wet years [41]. The average annual temperature is 18.2 °C, with milder values in mountainous areas. The area is strongly affected by intense and persistent periods of warm, dry easterly winds known as Levante, which can reach speeds over 100 km/h and blow for more than 7 consecutive days, resulting in significant evaporation processes on surface resources [42,43]. The economy in the basin is mainly based on agriculture and livestock farming, activities that are highly dependent on the supply of surface water from the reservoirs Barbate, Celemín and Almodóvar (joint capacity of 277 hm 3 ) and, to a lesser extent, on the exploitation of local aquifers [44].

Precipitation Data
Initially, monthly precipitation data were collected from a total of 67 meteorological stations distributed within the studied basin (1330 km 2 ) and in neighboring areas located less than 15 km from its limits. Of them, 63 stations belong to the State Meteorological Agency (AEMET), 3 to the Andalusian Network of Agroclimatic Stations and 1 a private farmland. Data availability was different for each station; at the stations with the longest registration periods (5 stations), the precipitation records began in 1910/11, while in most

Precipitation Data
Initially, monthly precipitation data were collected from a total of 67 meteorological stations distributed within the studied basin (1330 km 2 ) and in neighboring areas located less than 15 km from its limits. Of them, 63 stations belong to the State Meteorological Agency (AEMET), 3 to the Andalusian Network of Agroclimatic Stations and 1 a private farmland. Data availability was different for each station; at the stations with the longest registration periods (5 stations), the precipitation records began in 1910/11, while in most of them (26 stations), the records started in the 1950s. From the set of 67 stations, only 13 were finally selected for the generation of a 108-year average precipitation series comprising the years 1910/11-2017/2018, whereas the remaining 54 were used in the series completion process. It should be noted that the hydrological year in Spain starts on 1 October and ends on 30 September because the dry season takes place between June and September.

Methodology
The proposed methodology, outlined in Figure 2, aims to generate a long-time, monthly precipitation series representative of the selected basin from which to analyze the evolution of rainfall in the last century. The workflow consists of two main stages: data completion, which comprises two substages, and series analysis. (i) The first completion substage, the filling of data gaps, is carried out by substitution and linear regression. (ii) The second substage involves the completion of precipitation records through multivariate regression. (iii) In the second stage, a single monthly precipitation series representative of the basin is generated to analyze seasonal and annual precipitation trends. Finally, the application of the SPI with the 12-month windows allowed characterizing the occurrence and magnitude of droughts during the study period. Each of the workflow stages and criteria applied is described in detail in the subsequent subsections.

Methodology
The proposed methodology, outlined in Figure 2, aims to generate a long-time, monthly precipitation series representative of the selected basin from which to analyze the evolution of rainfall in the last century. The workflow consists of two main stages: data completion, which comprises two substages, and series analysis. (i) The first completion substage, the filling of data gaps, is carried out by substitution and linear regression. (ii) The second substage involves the completion of precipitation records through multivariate regression. (iii) In the second stage, a single monthly precipitation series representative of the basin is generated to analyze seasonal and annual precipitation trends. Finally, the application of the SPI with the 12-month windows allowed characterizing the occurrence and magnitude of droughts during the study period. Each of the workflow stages and criteria applied is described in detail in the subsequent subsections.

Processing of Hydrological Series and Statistical Analysis
In the first stage, the precipitation data of each of the 67 stations were examined according to criteria of record length and geographic location. After an initial screening, 52 stations were selected, and the remaining 15 were used to fill data gaps of the former, as they were located less than 1-2 km away and presented a high correlation coefficient

Processing of Hydrological Series and Statistical Analysis
In the first stage, the precipitation data of each of the 67 stations were examined according to criteria of record length and geographic location. After an initial screening, 52 stations were selected, and the remaining 15 were used to fill data gaps of the former, as they were located less than 1-2 km away and presented a high correlation coefficient (>0.95). The series was completed by substitution or by linear regression. According to several authors, the minimum length that a series must have to be eligible for completion is 15 years [45,46]. This led to the selection of 46 stations and the elimination of 6 stations whose records had less than 180 monthly data available.
The last step was the systematic completion of data gaps using the software CHAC [47], which enables completing climatic series from a bivariate regression model with a previous monthly stationarization of data series. The application of this method is conditioned by two parameters: the prioritization exponent and the prioritization threshold. The former is the value that weighs the importance of the number of common data between the three climatic stations used for the estimation. The latter is the minimum value of the multiple correlation coefficient used to designate pairs of stations for completing data gaps. The eligible stations should have more than 5 records for each of the 12 months in the period considered.
The application of this criteria led to the selection of 13 stations from which 5 have records starting in 1910/11. The remaining 8 stations were chosen from those with longer registration periods and gap-completion percentages less or near 50%. Figure 3 shows the length of the records from the selected stations prior to their completion with CHAC. several authors, the minimum length that a series must have to be eligible for completion is 15 years [45,46]. This led to the selection of 46 stations and the elimination of 6 stations whose records had less than 180 monthly data available.
The last step was the systematic completion of data gaps using the software CHAC [47], which enables completing climatic series from a bivariate regression model with a previous monthly stationarization of data series. The application of this method is conditioned by two parameters: the prioritization exponent and the prioritization threshold. The former is the value that weighs the importance of the number of common data between the three climatic stations used for the estimation. The latter is the minimum value of the multiple correlation coefficient used to designate pairs of stations for completing data gaps. The eligible stations should have more than 5 records for each of the 12 months in the period considered.
The application of this criteria led to the selection of 13 stations from which 5 have records starting in 1910/11. The remaining 8 stations were chosen from those with longer registration periods and gap-completion percentages less or near 50%. Figure 3 shows the length of the records from the selected stations prior to their completion with CHAC.  Table 1 describes the characteristics of the 13 stations selected and the percentage of data completed using CHAC.   Table 1 describes the characteristics of the 13 stations selected and the percentage of data completed using CHAC. After completion, a 108-year rainfall series representative of the entire basin was generated through the weighted average of monthly precipitation values of the stations according to their area of influence, which was determined using Thiessen polygons ( Figure 4). This rainfall series describes the temporal evolution of annual precipitation and allows analyzing its trends using moving averages. Although some stations have a reduced area of influence and no significant effect on the weighted average values, these were important in the gap-completion stage. After completion, a 108-year rainfall series representative of the entire basin was generated through the weighted average of monthly precipitation values of the stations according to their area of influence, which was determined using Thiessen polygons ( Figure 4). This rainfall series describes the temporal evolution of annual precipitation and allows analyzing its trends using moving averages. Although some stations have a reduced area of influence and no significant effect on the weighted average values, these were important in the gap-completion stage.

Integration within McKee's Standardized Precipitation Index (SPI)
To analyze the long-term precipitation pattern and the occurrence of hydrological droughts, the SPI was calculated with the SPI-Generator software [48] using a 12-month time window. The SPI is a meteorological index that depends only on precipitation and allows identifying the wet and dry periods within a series based on the deviations from the long-term mean values in a given timescale. The method consists of fitting the precipitation data to a probabilistic distribution ("gamma distribution") and transforming it into a normal distribution where the mean SPI value for that location and period is zero [49]. Thus, positive values indicate precipitation above the mean, and negative values indicate precipitation below the mean. McKee et al. [8] propose using the SPI to classify episodes of drought and/or extraordinary rainfall inputs according to the following categories (Table 2).

Integration within McKee's Standardized Precipitation Index (SPI)
To analyze the long-term precipitation pattern and the occurrence of hydrological droughts, the SPI was calculated with the SPI-Generator software [48] using a 12-month time window. The SPI is a meteorological index that depends only on precipitation and allows identifying the wet and dry periods within a series based on the deviations from the long-term mean values in a given timescale. The method consists of fitting the precipitation data to a probabilistic distribution ("gamma distribution") and transforming it into a normal distribution where the mean SPI value for that location and period is zero [49]. Thus, positive values indicate precipitation above the mean, and negative values indicate precipitation below the mean. McKee et al. [8] propose using the SPI to classify episodes of drought and/or extraordinary rainfall inputs according to the following categories (Table 2). McKee et al. [8] defined droughts as periods in which the SPI is continuously negative and presents values of −1 or less. More specifically, droughts begin when SPI ≤ −1 and end when the first positive SPI value is reached.
As the SPI values are in units of standard deviation from the long-term mean, they can be applied to compare precipitation anomalies for any geographic location and can be calculated for different timescales. The fact that the SPI only requires precipitation data is an advantage in many locations where other types of data are not available, as is the case of the study area. In addition, its temporal versatility makes it a useful tool for the analysis of drought dynamics and the determination of their onset and end, which is more difficult to track with other indices [50,51]. Owing to its flexibility and applicability, the World Meteorological Organization (WMO) in 2009 recommended this index as the main tool that meteorological and hydrological services should use to monitor and follow drought conditions in their respective countries [52].

Results: Precipitation Series Analysis and SPI Evolution
The temporal evolution of the annual precipitation was obtained for the 108-year study period. The mean annual precipitation was 808.9 mm, with values ranging between 364.6 mm in the driest year (1998/99) and 1605.8 mm in the wettest (1962/63), with a standard deviation of 228.4 mm and a coefficient of variation of 28.2%. The frequency distribution is log-normal type (Figure 5a), with an absolute maximum in the interval 750-875 mm. Precipitation equals the mean value ± one standard deviation (interval 580-1040 mm) in 62% of the studied years and is equal to the mean value ± two standard deviations (interval 350-1250 mm) in 95% of the years (with the remaining 5% being very humid). Figure 5b shows the distribution of average monthly precipitation in the study area, where rainfall mainly concentrates in autumn and winter months. The decade 1960-1969 was particularly humid and included the wettest year (1962/63) of the entire 108-year period. In 1962/63, the amount of precipitation was 98% higher than the average. The second and third wettest years were 1995/96 and 2009/10, with values 77% and 73% higher than the average, respectively. On the contrary, a prolonged drought event that spans from 1941 to 1950 stands out in the 108-year period. Between 1941 and 1950, only three years had precipitation close to the average, and seven years were dry or very dry. The driest year was 1998/99, when rainfall was 55% of the average. The second and third driest years were 1994/95 and 2004/05, with precipitation 51% and 50% lower than the average, respectively.
A noteworthy aspect is the greater irregularity in the occurrence of extreme events. While in the first half of the studied period (1910/11 to 1959/60), the wet years always presented values below 1.200 mm and the dry values always exceeded 500 mm (with the exception of a particularly dry year, 1948/49), in the second half (1960/61 to 2017/18), there were six wet years with rainfall values over 1.200 mm, two of which even exceed 1.400 mm. The number and intensity of dry years also increased, with precipitation values close to 400 mm in three of them. These findings evidence a greater annual irregularity in rainfall, with more proneness to extremes, which is in accordance with current climate projections. The precipitation series suggests a slight downward trend in the order of −15 mm/100 years; however, this value has to be considered cautiously due to the lack of statistical significance and because it is highly influenced by the extreme values of the series.
The 108-year period was treated with moving averages of 3, 5, and 7 elements ( Figure 6) in order to smooth high-frequency oscillations and identify cyclical phenomena or longterm trends in the last century. The behavior inferred from this analysis seems to be different in the first and second halves of the series.
Between 1941 and 1950, only three years had precipitation close to the average, and seven years were dry or very dry. The driest year was 1998/99, when rainfall was 55% of the average. The second and third driest years were 1994/95 and 2004/05, with precipitation 51 and 50% lower than the average, respectively.
A noteworthy aspect is the greater irregularity in the occurrence of extreme events. While in the first half of the studied period (1910/11 to 1959/60), the wet years always presented values below 1.200 mm and the dry values always exceeded 500 mm (with the exception of a particularly dry year, 1948/49), in the second half (1960/61 to 2017/18), there were six wet years with rainfall values over 1.200 mm, two of which even exceed 1.400 mm. The number and intensity of dry years also increased, with precipitation values close to 400 mm in three of them. These findings evidence a greater annual irregularity in rainfall, with more proneness to extremes, which is in accordance with current climate projections. The precipitation series suggests a slight downward trend in the order of −15 mm/100 years; however, this value has to be considered cautiously due to the lack of statistical significance and because it is highly influenced by the extreme values of the series.
The 108-year period was treated with moving averages of 3, 5, and 7 elements ( Figure  6) in order to smooth high-frequency oscillations and identify cyclical phenomena or longterm trends in the last century. The behavior inferred from this analysis seems to be different in the first and second halves of the series.  The three-element moving average (Figure 6a) allowed detecting a total of 16 oscillations and cycles with periods of approximately 7 years. However, some of these oscillations are of very small amplitude and tend to disappear when the five-element moving average is applied, especially during the first 50 years (Figure 6b). The application of a five-element moving average eliminates the high-frequency oscillations observed between 1910/11 and 1959/60 and only leaves two large oscillations. Subsequently, between 1960/61 and 2017/18, this algorithm evidences 7 clear and well-defined oscillations with amplitudes of approximately 11 years. In the case of the seven-element moving average (Figure 6c), it is difficult to identify a clear trend towards the reduction/increase of rainfall; however, a very wet period in the center of the series and three periods of intense rainfall deficit are detected.
As a complement to the previous analysis, the autocorrelation function was applied to the complete precipitation series and its two halves. The autocorrelogram of the 108-year series evidences a lack of significant time dependence (Figure 7a). Conversely, the correlogram of the first 50 years of the study period (Figure 7b) shows a significant correlation at k = 4 and k = 5, which in light of the moving average analysis, could be interpreted as a cyclicality of approximately 5 years. In that same 50-year period, a time dependence of 20 years is also identified. This 20-year dependence fits the low-frequency cyclicity observed on the left side of Figure 6b,c. Finally, the autocorrelogram of the second half of the study period (Figure 7c) shows a significant correlation at k = 6 and k = 7, which coincides with the cyclicality displayed by the five-element moving average (period of 7-8 years) in that interval of time.
oscillations and cycles with periods of approximately 7 years. However, some of these oscillations are of very small amplitude and tend to disappear when the five-element moving average is applied, especially during the first 50 years (Figure 6b). The application of a five-element moving average eliminates the high-frequency oscillations observed between 1910/11 and 1959/60 and only leaves two large oscillations. Subsequently, between 1960/61 and 2017/18, this algorithm evidences 7 clear and well-defined oscillations with amplitudes of approximately 11 years. In the case of the seven-element moving average (Figure 6c), it is difficult to identify a clear trend towards the reduction/increase of rainfall; however, a very wet period in the center of the series and three periods of intense rainfall deficit are detected.
As a complement to the previous analysis, the autocorrelation function was applied to the complete precipitation series and its two halves. The autocorrelogram of the 108year series evidences a lack of significant time dependence (Figure 7a). Conversely, the correlogram of the first 50 years of the study period (Figure 7b) shows a significant correlation at k = 4 and k = 5, which in light of the moving average analysis, could be interpreted as a cyclicality of approximately 5 years. In that same 50-year period, a time dependence of 20 years is also identified. This 20-year dependence fits the low-frequency cyclicity observed on the left side of Figure 6b,c. Finally, the autocorrelogram of the second half of the study period (Figure 7c) shows a significant correlation at k = 6 and k = 7, which coincides with the cyclicality displayed by the five-element moving average (period of 7-8 years) in that interval of time. A slight downward trend in winter and spring precipitation (−44 mm/100 years and −15 mm /100 years, respectively) was also detected. On the contrary, as Figure 8 displays, rainfall slightly increased during autumn and summer months (+20 mm/100 years and +12 mm/100 years, respectively). These changes in precipitation might affect the surface and groundwater inputs in the basin owing to a reduction in effective rainfall, which is A slight downward trend in winter and spring precipitation (−44 mm/100 years and −15 mm /100 years, respectively) was also detected. On the contrary, as Figure 8 displays, rainfall slightly increased during autumn and summer months (+20 mm/100 years and +12 mm/100 years, respectively). These changes in precipitation might affect the surface and groundwater inputs in the basin owing to a reduction in effective rainfall, which is greater for winter months for this latitude. As previously mentioned, these trends lack statistical significance and should be interpreted with caution, given the sensitivity of this type of adjustment to extreme values. Still, these values are consistent with each other.
Finally, the calculation of the SPI with 12-month windows led to the obtention of a monthly time series for the study period (Figure 9). According to Table 2, 26 periods of drought can be identified, from which 12 are categorized as "severe" (SPI < −1.5) and 6 as "extreme" (SPI < 2), with return periods of 9 and 18 years, respectively. greater for winter months for this latitude. As previously mentioned, these trends lack statistical significance and should be interpreted with caution, given the sensitivity of this type of adjustment to extreme values. Still, these values are consistent with each other. Finally, the calculation of the SPI with 12-month windows led to the obtention of a monthly time series for the study period ( Figure 9). According to Table 2, 26 periods of drought can be identified, from which 12 are categorized as "severe" (SPI <−1.5) and 6 as "extreme" (SPI < 2), with return periods of 9 and 18 years, respectively. The description of the onset and end, duration, intensity (SPI extreme values) and magnitude (indicated as the sum of the SPI) of each drought is displayed in Table 3. statistical significance and should be interpreted with caution, given the sensitivity of this type of adjustment to extreme values. Still, these values are consistent with each other. Finally, the calculation of the SPI with 12-month windows led to the obtention of a monthly time series for the study period ( Figure 9). According to Table 2, 26 periods of drought can be identified, from which 12 are categorized as "severe" (SPI <−1.5) and 6 as "extreme" (SPI < 2), with return periods of 9 and 18 years, respectively. The description of the onset and end, duration, intensity (SPI extreme values) and magnitude (indicated as the sum of the SPI) of each drought is displayed in Table 3. The description of the onset and end, duration, intensity (SPI extreme values) and magnitude (indicated as the sum of the SPI) of each drought is displayed in Table 3.
Extreme droughts presented average lengths of 21 months and average extreme SPI values of −2.49. From them, the events of 1949-1951, 1999-2000 and 2005-2008 were the most important according to their magnitude.
The characteristics of the wet periods are displayed in Table 4. In this case, the SPI shows that the decade of the 1960s, 1996-97 and 2010-11 were predominantly wet; however, these episodes were significantly shorter than dry periods in the basin. The majority (62%) of periods classified as "very wet" only lasted for 1 or 2 months. On the other hand, only four "extremely wet" periods were identified. These appear concentrated in the second half of the study period, with average lengths of 9.5 months and mean extreme SPI values of 2.96. Table 3. Main characteristics of the severe (SPI < −1.5) and extreme (SPI < −2) droughts identified in the studied basin for the period. * Note: The end of each drought corresponds to the first month with a positive SPI value after a sequence of months with SPI < −1.5 or <−2. The last month is not included in the calculation of the duration of the drought. In general, the temporal distribution of the SPI shows that the occurrence of extreme episodes, both dry and wet, increased in the second half of the analyzed series. In this regard, it is remarkable that four of the six extreme droughts (two of them with the greatest magnitudes) and two extremely wet episodes (April 1996-February 1997 and April 2010-December 2010) took place in the last 40 years, whereas no extremely humid periods were recorded in the first half of the study period.

Discussion
For the study period, the distribution of monthly mean precipitation displayed a marked seasonality throughout the year, with rainfall concentrating in autumn and winter months (October to March) and very low values during the dry season (June to September), a characteristic trait of Mediterranean climates. Regarding the evolution of annual precipitation, the moving averages and autocorrelation treatments allowed identifying a different cyclicity between the first (1910/11-1959/60) and second (1960/61-2017/18) half of the 108-year series, with periods of approximately 5 years and 7-8 years, respectively. This phenomenon was accompanied by an increase in the irregularity of annual precipitation and a greater frequency of extreme events (drought and heavy rainfall years) during the second half of the study period, which was also evidenced by the SPI analysis. These findings are in agreement with those by Merino et al. [32], who reported negative precipitation trends during the last decades for all the regions of the Iberian Peninsula, alternating with short periods of strong positive anomalies. Their results coincide with those of Peña-Gallardo et al. [37] and García-Barrón et al. [53], who also detected an increase in rainfall variability in Andalusia and in the southwest region of the Iberian Peninsula, respectively, especially during the last third of the 20th century.
It is difficult to establish comparisons with studies conducted over other regions of the Iberian Peninsula owing to the different periods, spatial scales and variables considered. In fact, there are numerous discrepancies regarding precipitation trends in the Iberian Peninsula even for similar study periods. Whereas Romero et al. [54], Bladé et al. [55] and Río et al. [56] observed a generalized decrease, Coll et al. [33] did not detect appreciable changes in annual precipitation. The lack of agreement is attributable to several factors. Firstly, different periods, spatial scales and variables are considered. Secondly, the fact that many studies are based on unique precipitation data with variable spatial density and length that are usually unpublished or have restricted access makes them difficult to reproduce. Thirdly, the statistical methods employed and different processes of series completion can act as additional sources of discrepancies. In this case, the 108-year series shows a slight decrease in precipitation (−15 mm in 100 years); however, this figure should be interpreted cautiously given its susceptibility to the extreme values of the period considered. The low magnitude of this decrease, together with its lack of statistical significance, bring into question the results of the predictive models produced by different entities for the beginning of the 21st century (at least for the first decades), as explained later.
The analysis of average annual precipitation per season suggests a slight shift of rainfall from winter towards warmer seasons with higher evapotranspiration rates. These findings are consistent with other studies that highlight a generalized downward trend in winter precipitation in the western and southern sectors of the Iberian Peninsula [56][57][58][59]. In fact, as previous research has evidenced [60][61][62], the Atlantic and Mediterranean façades of the Iberian Peninsula exhibit opposite precipitation trends; while in the western sector (where the study basin is located), spring and winter rainfall has decreased in the last decades, in the eastern sector, it has increased. These changes in precipitation distribution over the western Iberian Peninsula, and their interdecadal variability is closely linked to changes in the North Atlantic oscillation (NAO), a large-scale mode related to westerly winds, storm track and jet stream that greatly determines the variability of precipitation over the Euro-Atlantic area [63,64].
Regarding the SPI, the index allowed detecting 26 events of drought during the 108-year period analyzed, 12 of them being severe (SPI < −1.5) and 6 extreme (SPI < −2.0), with return periods of 9 and 18 years, respectively. Drought distribution was irregular over time, and from the six extreme droughts detected, four took place in the second half of the study period. The longest and most intensive droughts occurred during 1949-1951, 1999-2000 and 2005-2008, coinciding with some of the driest periods that have affected the European continent and the Mediterranean basin [65,66]. Conversely, the periods 1960-70, 1996-97 and 2010-11 were predominantly wet.
To date, the Regional Government of Andalusia has produced several reports and studies to estimate the future impacts of climate change on drought under different emission scenarios using historical series of rainfall and temperature. The first of these reports, "Climate change in Andalusia: current and future climate scenarios" [67], employed historical temperature and precipitation series from more than 2300 stations and the climate models CGCM2 and ECHAM4/OPYC3 for the periods 1960-2100 and 1990-2100, respectively. Its results point out drops of 12.8 and 16% of precipitation (with respect to the average) for the periods 2011-40 and 2041-70 in the province of Cadiz, which nearly doubles at the end of the century, with a rainfall decrease by 30% in 2071-2100. On the other hand, the "Andalusian Plan for Climate Action-Adaptation Programme" [68] applied downscaling techniques and the models CGCM2 and ECHAM4 to forecast temperature and precipitation variations under three emission scenarios from the IPCC 2007 (SRES, B2, A2) for the period 2000-2100. In this case, the limited number of stations (500) resulted in lower spatial resolution, but the general trend was similar to that from the previous report, with a relatively constant decrease in rainfall at the beginning of the century and a notable reduction in the last 30 years of the study period. According to this document, the percentage of rainfall reduction will range between 2 and 10% until 2070 depending on the scenario, reaching a 15% reduction by the last third of the century in all cases. More recently, the report "The Climate of Andalusia in the XXI century. Local Scenarios of Climate Change in Andalusia. Update to the 4th IPCC Report, 2014" [69] attempted to forecast climate variations and their effects over the Andalusian region following a similar approach, but applying a greater number of climate models (BCM2, EGMAM, CNCM3, ECHAM5) and emission scenarios (A1b, A2, B1). This report shows that drops in mean annual rainfall would vary between a minimum of 13.7% (EGMAM, scenario A2) and a maximum of 26.6% (BCM2, scenario A2) by the end of the century. For the Barbate River basin, the report forecasts a reduction in precipitation of 250-300 mm in the period 2070-2100 according to the CNCM3 model, which represents an intermediate situation between the most optimistic and the most unfavorable projections. While all of these reports provide evidence that dry periods are likely to increase and become more intense in most of the Andalusian territory, the estimated percentages and figures vary to a greater or lesser extent due to the notable uncertainty to which these models are subject. This uncertainty stems from the model chosen and other factors such as the location of the study area, its orographic complexity, the number of stations considered, periods analyzed and data inhomogeneity among others, which will influence the goodness of the predictions and aspects such as spatial resolution. In this regard, the present research also indicates an increase in the irregularity of rainfall; however, it does not evidence a clearly downward trend in precipitation in recent decades. In addition, our results reveal an increase in the frequency, duration and magnitude of drought events in the second half of the analyzed period, which coincides with findings from previous studies [32,35]. This trend, together with the detected shift of winter rainfall towards warmer months, when evapotranspiration reached very high levels, might accentuate water stress in the study area and have manifold consequences on the Barbate River basin. A reduction in effective rainfall would lead to further decline of runoff and streamflow in the already highly regulated basin, compromising the inputs to the reservoir and the possibility of meeting irrigation demands in this eminently agricultural area. Similarly, subsurface runoff and groundwater recharge could potentially decrease. These hydrological changes will also affect the current water management and reservoir operating rules, which will have to be reformulated and adapted to a scenario of greater irregularity over longer periods of time. In addition, alteration of river regimes would also affect riparian ecosystems and species composition, favoring those more drought tolerant.
Although the main limitation attributed to the SPI is the use of a single meteorological element for describing a complex phenomenon, precipitation is the major driver of meteorological droughts [70,71],s and numerous studies have demonstrated the efficiency of SPI even when compared with other indexes of greater complexity [14,72]. The SPI allows obtaining in a simple way meaningful information on the main features of droughts and identifying the onset of this creeping natural hazard, which is crucial for the development of adequate adaptation and mitigation strategies at the basin scale. The results of this research will be useful to fill climatic information gaps in the Barbate River basin (also in the province of Cádiz), where the importance of irrigated agriculture and the significant water stress requires better-informed decision making and the elaboration of early warning systems. In addition, this information can aid in the design of decision support systems, a methodology that has recently been proposed by Ruiz-Ortiz et al. [42] in the area to analyze the adequacy of several water management strategies such as the joint use of surface and groundwater under different rainfall and evaporation scenarios.

Conclusions
In this study, a representative monthly precipitation series of the Barbate River basin has been generated for a period of 108 years, from 1910/11 to 2017/18. The occurrence of droughts has been assessed based on the frequency, magnitude and duration of the events according to the standardized precipitation index (SPI) in conjunction with other analysis techniques. The main findings of this study are as follows: 1.
The distribution of monthly mean precipitation shows a marked seasonality, in line with the typical patterns of Mediterranean climates. Rainfall concentrates between the end of the autumn and winter months (October to March), with average precipitation exceeding 85 mm/month and a maximum of 140 mm/month in December. Conversely, in summer months, mean monthly rainfall is less than 20 mm/month. Seasonal analysis throughout the study period evidenced a slight shift in winter rainfall towards autumn and summer months, which could lead to a reduction in effective rainfall.

2.
The interannual variation of precipitation for the whole basin ranges between the 365 mm recorded in the dry year 1998/99 and the 1606 mm in the wet year 1962/63, with a coefficient of variation of 28.2%. The analysis of average precipitation indicated that the period 1940-1950 was very dry, with an average rainfall close to 720 mm/year (11% below the basin's average). On the contrary, the decade 1960-70 was very humid, with rainfall close to 1000 mm/year (23% higher than the average). In addition, a clear change in the precipitation pattern that affects the cyclicity, frequency and intensity of dry and wet episodes was detected. In this regard, precipitation displays greater irregularity since the 1960s, with droughts and wet periods of greater intensity and frequency.

3.
Although the 108-year series does not display a clear downward trend and precipitation remains relatively stable, a slight decrease in the order of 15 mm/100 years was detected. This figure has to be interpreted cautiously given its susceptibility to the extreme values of the period considered. In any case, no significant trend towards a decrease in precipitation was detected, contrary to the predictive models of climate change, particularized to the study area. 4.
The SPI enabled identifying 26 events of drought during the 108-year period analyzed, of which 12 were severe (SPI < −1.5) and 6 extreme (SPI < −2.0), with return periods of 9 and 18 years, respectively. The distribution of droughts was uneven over the 108-year period. Of the six extreme droughts detected, four took place in the second half of the study period. Likewise, in the case of wet episodes, of the four extremely wet periods, and three took place in the second half of the series.

5.
The study area is very likely to undergo longer and more severe drought episodes in the future; thus, having detailed information on precipitation series and drought duration, magnitude, frequency and return periods is crucial to devise early warning systems and for better water management and impact mitigation.