Trend Analysis of Meteorological Variables: Rainfall and Temperature

The Souss-Massa region in southwestern Morocco is characterized by a semi-arid climate with high variability in rainfall. Frequent droughts and flash flood events combined with overexploitation of water resources in recent decades have had a significant impact on the human security and the economy which is mainly based on agriculture, tourism and fishery. For better management of extreme events and water resources under changing climatic conditions, a study was carried out to quantify the seasonal and annual variability and trends in rainfall and temperature over the past three decades with data from three stations. Climatological representative of the Souss-Massa region. The Mann-Kendall (MK) non-parametric test and the Sen’s slope are used to estimate the monotonic trend and magnitude of the trend of the variables, respectively. Statistical analysis of the rainfall series data set highlights that the occurrence of rainfall is unpredictable and irregular and the both the seasonal and annual rainfall trend appears negative (downward) for all the three climatological stations. The minimum temperature shows a remarkable increasing trend both on annual and seasonal scale while the maximum temperature registers a slightly increasing trend. The study presents some new insights on rainfall and temperature trends that will have significant impacts on the surface and groundwater resources of the region under changing climatic conditions. The results can help to prioritize new strategies to mitigate the risk of droughts, of floods and to manage water resources to sustain the dependence of agriculture tourism and fishery sectors in the region.


Introduction
The impact of climate change on rainfall and air temperature has received much attention by the research community all around the world. Several studies have been carried out to show these changes in temperature and rainfall are becoming evident on a global scale [1]. Climate change has occurred on a global scale, but its impact often varies from region to region [2]. Hence, analyzing the change in meteorological variables represents an important task for climate change detection. As proved by numerous studies, climate change has a very strong impact on natural ecosystems, society and economy by affecting the hydrological cycle, which can lead to deficiency of water resources, and overabundance of floods and droughts frequency [3]. Due to global warming, there are strong signals of changes in rainfall are already occurring globally and locally [4].
Several studies of time series data have shown that the trend is either decreasing or increasing for both temperature and rainfall. We can define trend as the speed and direction in which individual data in a time series changes. In order to understand a phenomenon, it is important to collect the data over a desirable period of time or space and process it in order to correct gaps and missing data, it is then interpreted to study the behavior of the phenomenon. The trend is analyzed by many parametric and non-parametric methods. Parametric methods, for example, the linear regression test, the graphing method, and the least squares method. Non parametric tests, are such as Spearman's Rho (SR) and Mann-Kendall Method and Sen's slope estimator test which are the best known and most widely used among nonparametric tests to identify trends in climatic parameters.
Time series trend analysis involves analyzing the magnitude of the trend and its statistical significance. In various studies analyzing climate trends the following researchers; [5,6] explained the reasons for using non parametric tests instead of parametric methods. Parametric methods are developed on the basis of assumptions, such as normality, stationarity and independence of time series, while these assumptions are the rarest to be satisfied in a climatic and hydrological dataset. In addition, parametric tests are very sensitive to the presence of outliers in the data series, which is not the case with non-parametric methods.
Morocco belongs to one of the six regions most affected by climate change, which is noticeable in extreme weather events, such as droughts and floods [7,8]. In recent decades, researchers have observed a trend towards climatic aridity, which could lead to a decreasing of water resources. The water resource in the Souss basin has a very socioeconomic importance, since the economic activity is mainly based on agriculture and livestock activities. Another major climate risk that threatens the Souss basin is flashfloods; this phenomenon can cause loss of human lives and severe damages to infrastructures. This risk is becoming more and more frequent in the Souss basin, threatening the population, infrastructure and agricultural fields located on the banks of the Souss River [9] At the end of February 2018 in the Souss basin, the rainfall had been evaluated at 150 mm, spread over 10 days, in November 2014 the rainfall had been evaluated at 150 mm spread over three days, in 2010 a flood took place whose return period has been estimated at 114 years (Reports source ABHSM). [10], rare floods seem to become more and more frequent and cause more and more serious damage. Our study is focused on studying climate variables such as temperature and rainfall and forecasting their future trend and its impact on water resources. It is crucial to take these issues into consideration, by policy makers managers and planners when developing new mitigation strategies concerning water resource estimation and management of extreme events such as droughts and floods, for the Souss region.
In this study, the distribution of the time series is unknown, that is why we tried to apply the Mann-Kendall method to detect the trend of precipitation, minimum and maximum temperatures and the magnitude of the trends by the method of the Sen Slope estimator. Three stations were taken into account for the analysis. Before the trend analysis the data were subjected to missing data treatment in previous studies [11,12].

Study Area
The Souss basin is located in the western zone of southern High Atlas of Morocco occupying a total area of 16200 km 2 , and dominated by an arid to semi-arid climate. The dataset used in this study measured in Station ''PT; Pont Taroudant'', '' PA; Pont Aoulouz'' and '' BA; Barrage. Abdelmoumen'' (See Figure 1).

Material and Methods
Data set used in the study; are Annual and seasonal rainfall data over a period of 40 years, ranging from 1981 to 2020. Annual and seasonal minimum and maximum temperatures over 36 years from 1981 to 2016. These data were collected from the Hydraulics Basin Agency of the region of Souss Massa ABHDSM. The Mann-Kendall and Sen's slope estimator test was performed at a significance level of 5% on the average date of meteorological series from three stations. According to the change of temperature for an entire year, four seasons named winter (December to February), spring (March to May), summer (June to August) and fall (September to November) were used.

Mann-Kendall Test
The Mann Kendall test is a widely used statistical test for analyzing trends in climatological [13] and hydrological [14] data sets. There are two advantages to use this test. First, it is a nonparametric test and does not require the data to be normally distributed. Second, the test has low sensitivity to sudden breaks due to non-homogeneous time series [15]. All data reported as unobserved are included by assigning it, a common value smaller than the smallest measured value in the dataset [16].
According to this test, the null hypothesis H0 assumes that there is no monotonic trend (the data are independent and randomly ordered) and this is tested against the alternative hypothesis H1, which assumes that there is a monotonic upward or downward trend in climate time series data [17]. The trend can be assumed to be monotonic when (mathematically speaking, the trend is constantly increasing and never decreasing or never decreasing and never increasing).
Mann kendall test performs two kinds of statistics according to the number of data values, that is, S -statistic is used if the number of data values is less than 10 while Z -statistic (approximation / normal distribution ) for data values greater than or equal to 10. The Mann Kendall test calculation process considers the time series of n data points and Ti and Tj as two data subsets where i = 1,2,3,…, n-1 and j = i + 1, i + 2, i + 3,…, n. Data values are evaluated as an ordered time series. Each data value is compared against all subsequent data values.

Results and discussion
If a data value of a later period is greater than a data value of a previous period, the S statistic is incremented by 1. On the other hand, if the data value of a later period of time is less at a previously sampled data value, S is decremented by 1. The net result of all these increments and decrements gives the final value of S [18]. Thus the Mann-Kendall statistic S is calculated as shown in Equation 1: where, Tj and Ti are annual values in years j and i, j> i respectively, n is the number of data points and sign (Tj-Ti) is calculated using Equation 2: If the number of data values is less than 10, the value of | S | is compared directly to the theoretical distribution of S derived by Mann and Kendall. The bilateral test is used. At some level of probability, H0 is rejected in favor of H1 if the absolute value of S is equal to or exceeds a specified value Sα / 2, where Sα / 2 is the smallest S which has the probability less than α / 2 d appear in case of no trend.
A very high positive value of S is an indicator of an uptrend, and a very low negative value indicates a downtrend [19]. If the number of data values is equal to or greater than 10, the S statistics behave approximately as normally distributed and the test is performed with a normal distribution with the mean and variation as shown below in Equations 3 and 4.
where ti is the number of links in range i (zero difference between compared values). The sum term in the numerator is used only if the data series contains linked values. The standard test statistic Z is calculated using Equation 5.
The test is used for four α significance levels: 0.1, 0.05, 0.01 and 0.001. The 0.05 significance level means that the existence of a monotonic trend is very likely. Respectively, the significance level 0.1 means that there is a 10% probability that we will make an error when we reject H0.
It is necessary to calculate the probability associated with S and the sample size, n, to statistically quantify the significance of the trend. The procedure for calculating this probability will be described below. The probability value P of the MKS statistic of the sample data can be estimated using the normal cumulative distribution function as Based on a significance level of 5%, if the p-value is ≤ α = 0.05, then the H1 hypothesis is accepted which means the presence of a trend in the data and if the p-value is ≥ α = 0.05 then H0 will be accepted that denotes the absence of trend in the data.

Sen's Slope Estimator
The non-parametric Sen's slope estimator was developed by Sen in 1968, it is used to predict the magnitude (true slope) of hydrologic and meteorological time series data. It has been widely used to calculate the magnitude of trends in long-term temporal data [20,21]. In this study, the Sen's slope is applied to calculate the magnitude of the trend of the temporal data. It is considered to be better at detecting the linear relationship because it is not affected by outliers in the data. It uses a linear model for trend analysis. The slope (Ti) of all data pairs is calculated using Equation 7 [22].
Pour i=1,2,3,…,n where, xj and xk are data values at time j and k (j> k) separately.
The median of these n values of Ti is represented by the estimated slope of Sen (true slope) which is calculated using Equation 8.
Positive Qi values indicate an increasing trend, while negative Qi values indicate a decreasing trend in weather data. The unit of the slope of Sen Qi is the magnitude of the slope per year. The software used to perform the Mann-Kendall statistical test and Sen's slope estimator is the Addinsoft 2020.1.3 XLSTAT. The null hypothesis is tested at a 95% confidence level for both the temperature and precipitation data.
We also obtain Kendall'Tau, when running the Mann-Kendall test, which is a measure of correlation and then it measures the strength of the relationship between the two variables. Kendall's tau, will take values between ± 1 and 1, with a positive correlation indicating that the ranks of the two variables increase together while a negative correlation indicates that when the rank of one variable increases, the other decreases [1].
where; C: Concordant pairs the number of observed ranks below a particular rank which are larger than that particular rank, and D: Discordant pairs the number of observed ranks below a particular rank which are smaller in value than that particular rank.

Results and Discussions
The analysis of trends in climatological variables of the Souss basin was carried out in the first phase with rainfall data over 40 years from 1981 to 2020 and in the second phase, on minimum and maximum temperature data over a period of 36 years since 1981 to 2016. For results interpretation we have made two assumptions:  H0: There is no monotonic trend in the series;  H1: There is a trend in the series.
So, if the calculated p-value is greater than the level of significance alpha = 0.05, we need to accept the null hypothesis H0. First of all, we defined the 5% threshold with our null hypothesis (there is no trend), so we judged the trend according to this threshold. However, there may be a trend in the data behind the selected threshold. For example, we take the rainfall series of the PT station during the autumn season from Table 1, at the significance level of 5%, we got the p-value = 0.571 so , based on the null hypothesis, we have to say that there is no trend at a significance level of 5%. However, the statistic of the Mann kendall test S = -135, reveals that there is a negative trend which is significant at a significant level of 10%. Therefore, to determine the trend the Sen slope estimator Q should be applied to determine the magnitude of the trend.

Phase 1 Applying Tests on Rainfall Data
The Mann kendall test and Sen's slope estimator were applied seasonal and annual rainfall datasets.

Figure 3. Presents the Annual rainfall trend and presentation of Ten-year polynomial regression forecast
The Sen's slope estimator revealed a slight downward trend in seasonal and annual rainfall the results are shown in Tables 1 and 2 for each station and Figures 3a, 3b and 3c. To evaluate the temporal variable of the annual rainfall of the stations represented, we carried out a trend study using a ten-year polynomial regression forecast, the 2 nd degree polynomial trend curve is the one which better represents the tendency of the annual rainfall to be measured in the  Table 2. The polynomial curve predicts a decrease over the next 10 years. According to the report of Morocco's 3 rd national communication to the United Nations Framework Convention on Climate Change, predict a downward trend in annual cumulative rainfall that varies between 10 and 20% to reach 30% over regions of the arid and saharian climate by 2100 [22]. In Previous studies the distribution of annual precipitation mean during 1980-2010 shows that it rains remarkably more from the North to the South and from the West to the East in the Souss Massa Region. The dry months are defined as months with precipitation below 20 mm and the wet months are those that exceed of 20 mm [23]. Table 3 shows the results of the Mann kendall test and the Sen's slope estimator applied on the seasonal minimum temperature data for each station. P-values are less than α = 0.05 and large positive values of S, consequently confirm a strong increasing tendency of the minimum temperatures. The seasonal minimum temperature has been rising for the past 36 years. Mann kendall test and the Sen's slope estimator were applied on the minimum temperature values of each year in order to know the annual trend of the minimum temperatures.

Minimum Temperature Data
Results are shown in Table 4; according to p-values, we have accepted hypothesis H1, saying that there is an upward trend, according to the positive values of S we say that the trend is strong. Figs. 4a 4b and 4c show the variation in the minimum temperature during the 36 years, in each of the stations PT, PA and BA; the Sen curve shows a notable increase; the polynomial curve shows the forecast by regression 10 years ahead, we notice that the increase will always be maintained. In the station PT, Figure 4(a), the minimum temperature has been rising over the past 36 years, according to the Sen's slope trendline and S value presented in Table 4. According to the forecast polynomial curve this temperature will decrease by 1°C in 2026. The hottest year was in 2002 with a minimum temperature of 6°C. The coldest year was 1981 the minimum temperature was -3°C. Since 2010 the minimum temperature oscillated between 3 and 3.2°C.
At the PA station Figure 4(b) the minimum temperature has never recorded a value less than 0 °C during the past 36 years, it has stabilized around 5 °C since 2008. The Sen Curve shows a noticeable increase which is confirmed by S value Table 4. According to the polynomial curve of ten year forecasting the minimum temperature will continue to increase. Minimum temperatures in the BA station recorded large values; the highest minimum temperature was 10°C recorded in 2010 during the 36 years. The minimum temperature was still increasing according to Sen's slope Figure  4(c) and S-values Table 6. According to the polynomial curve representing the 10 years forecasting the minimum temperature will always be rising.   Figure 4. Presentations of the annual minimum temperature trend and Ten-year polynomial regression forecast in three stations

Maximum Temperature Data
For the maximum temperature we note that for the station PT the decreasing tendency is slightly noticed in autumn and winter seasons and tend to increase during the spring and the summer which is explained by the typical Mediterranean climate of the region, with mild wet winters and hot dry summers. For the PA and BA stations, respectively, there is a decrease during the winter and an increase during the spring. During all seasons there is a significant increase at the BA station, Table 5. Table 6, represents the results of the tests on the maximum temperatures of each year, there is an explicit downward trend in the PT station and slight downward trends in the other stations. Figures 5a, 5b and 5c show the Sen's slope trendline which is almost stable, a very slight evolution, but when we apply a forecast according to the polynomial regression model, we note a slight increase over the next 10 years. In station PT Figure 5(a) the lowest maximum temperature was in 2009 the recorded value was 34 °C, the highest value was 48 °C in 1986. The curve of Sen's slope is almost stable we note a very light decrease according to Q and S values Table 6. Giving the polynomial curve the temperature will be maintained from 44 and 45 °C over the next 10 years.
For the station PA Figure 5(b) the lowest temperature was 41 °C in 1997. The highest value was 48 °C recorded in 1986. The curve of Sen tends almost towards a slight decrease according to Q and S values Table 6. Giving the polynomial curve the temperature will tend towards a remarkable increase in the next 10 years. For the station BA Figure 5(c) the lowest temperature was 25 °C in 2006 and 2005. The highest value was 51 °C in 2009. The curve of Sen is almost steady according to Q values table 6. Following the polynomial curve, the temperature will tend to increase in the next 10 years.
For annual average temperatures, an increasing trend of 0.5 to 1 °C is projected for 2020 and of 1 to 1.5 °C for 2050 and 2080, across the country. In general, an increase in minimum temperature will rise the capacity of the atmosphere to retain water through the phenomenon of evaporation and transpiration which could increase rainfall. In fact, in one year, most of the flows in the Souss valley appear in the form of violent and brief floods, resulting from heavy supply rains concentrating on a few days or a few months. Vulnerability to flash floods could be further intensified by alternating periods of drought and episodes of extreme rainfall, which could also lead to soil saturation as well as problems with runoff and soil erosion. An aggravation of the geotechnical risks of foundations (collapses linked to very rainy episodes).
According to the above findings, it is extremely important to discuss the ecological, economic and social impacts that could result from continued decreasing trends in rainfall. In this region of an arid to semi-arid climate, drought events will be more and more serious; this could have severe impacts on surface water resources sustainability and groundwater recharge. The deficit in groundwater is very pronounced; the renewable potential of the Souss aquifer will decrease by 43% according to climate models; The marine intrusion has taken the lead in the coastal strip where the salinity continues to increase. Many sources and khettaras have lost their flow, or even dried up; Reservoirs of dams attest to a considerable loss by evaporation during these last years. And also, siltation is a phenomenon that worsens the security of reserves regularized [24].
As being the main economic activity in the region, agriculture will be definitely and severely affected, we expect a decrease of 1/3 of the agricultural area used (AAU), a decrease in sowing and grazing which will affect the productivity of animals and herds. The territory would become unsuitable for growing wheat in the bour areas. The demand for agricultural water is expected to increase by 8 to 15%. Agricultural yields from rain-fed crops are clearly affected and will be even more so from 2030. The oasis systems will be particularly penalized by situations of water scarcity in coming years. The rising temperature can also affect ecosystems and human life; It can lead to intense heat waves that could be difficult for the elderly and other vulnerable populations by Increasing probabilities of cardiovascular and respiratory risks. Intensifies infectious and chronic diseases, especially waterborne diseases (typhoid, viral hepatitis).   Figure 5. Presentations of the annual maximum temperature trend and Ten-year polynomial regression forecast in three stations

Conclusion
Based on the results of our study, we accept that the Mann-Kendall test and the Sen Slope estimator provide remarkable results on the presentation of the evolution of climate variables in the Souss basin. We have noticed an irregularity of rainfall and long periods of drought; we have noticed as well an obvious increasing trend of minimum temperature and a decreasing trend of rainfall in all the three stations. This Trend could be the main reason that y = 3E-05x 3  engenders the succession of extreme events such as drought and flash floods in the Souss region. In fact, an increasing temperature trend makes the atmosphere warmer; warm air can contain more water vapor than cold air. For every 1 °C increase in temperature, the air can hold about 7% more humidity, which condenses to fall as rain; the more the temperature rises, the more it causes heavy rains in a very short time interval. These results are confirmed by numerous studies and national and international reports on climate change, adopting that Morocco belongs to one of the six regions most affected by the effects of climate change, The arid climate of the Souss basin favors the appearance of violent floods, due to; the occurrence of heavy rains in a short time, the absence of plant cover and the type of soil that favors runoff. Since droughts and flash floods are inevitable, it is advisable to observe and study the changes in temperature and rainfall in order to avoid plausible devastating consequences. Along with anticipating and searching for new metrics for adapting and attenuating these problematic phenomena, which have become more and more frequent. At the end we can recommend to determine the overflow zones for floods of different return periods, by mapping as an essential element to raise awareness, secure human lives, avoid damages and support decisions and actions.

Data Availability Statement
The data presented in this study are available in article.