Statistical Analysis for the Detection of Change Points and the Evaluation of Monthly Mean Temperature Trends of the Moulouya Basin (Morocco)

,


Introduction
Various reports by the Intergovernmental Panel on Climate Change (IPCC) predict that the increase in greenhouse gas emissions has led to a remarkable rise in global temperature.Since 1900, global surface temperatures have already risen by 1.1 °C, a phenomenon unequivocally caused by human activities and primarily by greenhouse gas emissions.Te temperature rise is greater on land (1.59 °C) than on the sea (0.88 °C) [1].Mudelsee discussed that the application of the most modern statistical methods to the GISTEMP time series of global surface temperature reveals accelerated warming since 1974 [2].Hansen et al. showed that global temperature rose as rapidly in the decade 2000-2010 as in the previous two decades, and the record of 12-month global mean temperature for the period covered by instrumental data was reached in 2010 [3].
Furthermore, changes in global surface temperature have been used as a major indicator of global climate change [4,5].Change in climate variables, including temperature, is not uniform on a global scale, and large-scale spatial and temporal variations may exist in climatically diverse regions [6].
Local climate change is due to a number of factors, such as urban expansion partly caused by rapid population growth rates and the migration of rural populations to urban areas, all of which represent a major challenge for managers and also contribute via greenhouse gas emissions and loss of natural vegetation to the worsening of global warming and consequent rise in global temperature [7].
While understanding climate change has become a key issue in many scientifc felds [8][9][10], knowledge of air temperature and its variability/trend is crucial to the various areas of decision-making by public managers.Tis knowledge is also important for defning adaptation and mitigation actions in response to air pollution trends and air temperature change [11].
Te analysis of air temperature is important because of its direct and major efects on the various climatic processes occurring on earth.Indeed, air temperature variability can infuence a number of elements, such as relative air humidity [12], evapotranspiration [13], atmospheric pressure and convective movements [14], soil water availability and/or drought [15,16], and environmental and human discomfort [17].
Overall, rising temperatures can cause a variety of ecological and social problems, particularly in economically vulnerable regions such as the Mediterranean [18].Te southern part of the Mediterranean Basin is most likely to be afected by the efects of rising temperatures, due to its adoption of the agricultural sector as the basis for economic development.Te impact of this phenomenon on crop yields, which depend largely on variations in atmospheric temperature, has been observed in other regions of the world.Indeed, agricultural incomes have been reduced by 15-35% in Africa and West Asia and by 25-35% in the Middle East, due to a temperature rise of only 2-4 °C [19,20].
Studies have been carried out in many parts of the world to measure trends/changes in air temperature behavior and/ or the respective associated impacts.In its sixth report published in 2021, the IPCC [21] shows that temperatures have risen faster over the last 50 years than over the last two millennia and that a warming of 1.1 °C has occurred over the last 150 years, with fossil fuel combustion being the main cause.It has also been pointed out that, on current trends, the planet will warm by 1.5 °C in all scenarios, reaching this level in the 2030s [22].
Furthermore, the variability and trends in air temperature were the subject of several scientifc publications worldwide.Te main common conclusion is that there are signifcant trends towards an increase in mean annual temperature.Tis result has been observed in South America [23], Central America [16], Kenya [24], Russia [25], Japan [26], East and West Africa [27,28], Canada [23], the southwestern USA [29], and Nepal [30].Schaefer and Domroes (2009) [31] analyzed the mean daily temperature of numerous stations in Japan and observed an upward trend in annual temperature from 0.35 °C to 2.93 °C over a 100 year period (1991)(1992)(1993)(1994)(1995)(1996)(1997)(1998)(1999)(2000).Caloiero [32] concluded that there is a positive trend in maximum and minimum temperatures, particularly for the autumn-winter period at the New Zealand level.
In the Mediterranean region, classifed as one of the areas likely to be most afected by climate change, several studies have shown a positive and statistically signifcant trend in mean annual temperature.Examples include the study by Chaouche et al. on the Mediterranean part of France [33], Rio et al. [34] and Hidalgo et al. [35] on Spain, Yılmaz [36] on Turkey, Brunetti et al. [37] on Italy, Kalamaras et al. [38] on Greece, and Boudiaf et al. [39] on Algeria.
However, the observation of rising air temperature trends is not unanimous.Some studies have observed signs of opposite air temperature trends (increases and decreases) and nonuniformity, both in time (between months and/or between seasons) and in space (when comparing the same region).Tis behavior has been observed in Ireland [11], China [17,40], the USA [20], Aguascalientes, Mexico [41], and Chhattisgarh, India [42], although positive trends have been more common and widespread.
Previous climate studies identify Morocco as one of the countries most afected by the efects of climate change [43].Recently, Morocco has experienced one of the most extensive periods of drought in its contemporary history, marked by high temperatures and reduced rainfall [43][44][45][46].
Other scientifc research indicates that this rise in temperatures will continue in the future, although trends in precipitation remain uncertain.Filahi et al. [47] examined the RCP4.5 and RCP8.5 emission scenarios for two future periods, 2036-2065 and 2066-2095.Teir conclusion was that, in most regions of Morocco, the minimum temperature will increase more than the maximum temperature.Recent projections for certain regions of Morocco predict a future reduction in precipitation, with negative implications for water resources and worsening drought [47][48][49].In addition, several drought analyses and future temperature projections predict a systematic increase in maximum and minimum temperatures, ranging from 1 to 6 °C [50,51].Ouhamdouch et al. [52] predict a sharp increase in the estimated mean annual temperature of 0.72 °C between 2010 and 2050 in the Essaouira Basin, west-central Morocco.Khomsi et al. [50] suggested that extreme temperature trends are predominantly positive in the country's two major watersheds, Tensift and Bou Regreg.Te same result was observed by Hadri et al. [18] in the Chichaoua region.
Although numerous studies have been carried out on climate change in various regions of Morocco, particularly in the center of the country, there is a lack of studies concerning the Moulouya Basin, which encompasses the northeastern part of the country.In this context, the main aim of the present work is to fll this gap by examining trends in mean monthly temperature and its spatial and temporal variability.Moulouya's water supply plays a signifcant role in the national agricultural economy [54].According to data from the French Ministry of Agriculture, Maritime Fishing, Rural Development, and Water and Forestry, the eastern administrative region, which comprises the frst seven provinces mentioned, contributes approximately 14% to citrus fruit production, 10% to olive production, 9% to sugar beet production, and 8% to red meat production [55].

Materials and Methods
Te expansive and diverse topography of the Moulouya watershed gives rise to a wide range of climatic conditions.Tese conditions span from a Mediterranean climate in the lower Moulouya to a relatively cooler continental climate in the upper Moulouya and even to an arid, Saharan-like climate in the Guercif Basin and the mountainous regions of the middle Moulouya [56][57][58].Annual rainfall levels are relatively low and erratic, with cumulative annual precipitation ranging from less than 100 mm to slightly over 600 mm, depending on the specifc region [59].Snowfall is generally observed at altitudes above 1,500 meters and persists primarily above 2,000 meters, primarily on the peaks of the Middle and High Atlas, with an occasional presence on the high plateaus.

Observed Climate Data Sources and Station Selection.
Te data used in this research relate to monthly average air temperatures measured at 2 m above the surface.Tese temperature records were obtained, as daily data, from the archives of the Moulouya Hydraulic Basin Agency (ABHM) and the Météorologie Nationale, encompassing data collected by nine recording stations located in and around the Moulouya Basin (as shown in Figure 1 and detailed in Table 1).Tese datasets were selected based on several criteria, including data quality, reliability, geographical distribution, and the extent of temporal gaps in their records.Consequently, the length of time over which temperature records were taken was a crucial factor in capturing the temporal variability of mean monthly temperatures, and our dataset covers the period from 1980 to 2020.
Unfortunately, the coverage of measuring stations in the catchment is not optimal, with a notable shortage of stations in the eastern part of the catchment.It should also be noted that the majority of these monitoring stations are located at relatively low altitudes, which may impose certain limitations on the applicability of the results generated in our study.
In addition, as is the case in many parts of the world, some of our data series have gaps that need to be flled.Indeed, to obtain optimum results, we have exclusively used series with data gaps of between 2% and 10%.In this context, the stations presenting the longest time series are those of Guercif (S2), Dar Ben Driouech (S8), Ain Bni Mathar (S6), Oujda (S5), and Louggarh (S7) with a percentage of missing data of 2.5%, 3.4%, 2.7%, 5.4%, and 4%, respectively.
Furthermore, the stations of Melg El Ouidane (S9), Belpahar (S1), Bab Marzouka (S4), and Outat El Haj (S3) present percentages of missing data estimated at 6.7%, 7.4%, 8.7%, and 8.9%, respectively.Tese values are already considered acceptable for the application of some of the most widely recognized quality methods and tests, enabling gaps to be flled efectively.To this end, in order to test data quality, we opted for the Climatol tool (version 3.1.1,https:// www.climatol.eu/,downloaded on December 15, 2022).Tis tool is recommended by several climatologists [56,[60][61][62].Te stations where data were collected are summarized in the table as follows.
Te mean annual temperature in the Moulouya watershed varies between 18 and 20 °C at six stations: S1, S2, S3, S4, S8, and S9.Tese stations are mainly located in the center or downstream of the watershed, at altitudes below 1000 meters.Upstream, however, temperatures are lower, reaching 11.2 °C at station S7, which is located at an altitude of over 2,500 meters.
Te average monthly temperature can reach 30 °C during July at station S2, but does not exceed 19.7 °C at station S7 for the same month.Te coldest month in the Moulouya Basin is January, with average temperatures ranging from 11.5 °C at Melg El Ouidane Station (S9) to 3.4 °C at Louggarh Station (S7).

Methodology Adopted.
A review of the scientifc literature reveals that the majority of climate researchers have used recommended statistical tests to analyze variability, trends, and breakpoints within time series [63][64][65][66][67].In this context, to accurately identify the variability, trends, and change points in mean monthly temperature in the Moulouya watershed, we have selected the following statistical tests.

Mann-Kendall Trend Test.
As we mentioned in the introduction, to analyze trends in monthly data series, the classic Mann-Kendall test [68,69] is used.Statistical trend tests identify and/or estimate the existence or not of a trend in a time series according to the desired degree of signifcance.Mann-Kendall is a nonparametric test requiring only that the data be serially independent, without assuming the normality of the distribution [70,71].Te Mann-Kendall statistic S is calculated as follows:

Advances in Meteorology
where n is the length of the data series and x i and x j are the data value in time series i and j (j > i), respectively, with sgn (x j − x i ) responding to the following sign function: Te variance (V) of S is calculated as follows: In the above equation, n is the number of data points, m is the number of linked groups, and t k is the number of links of extent k.A related group is a set of data samples with the same value.In cases where the sample size n is greater than 10, the standard normal test statistic ZS is calculated using the following equation: Positive Z values indicate increasing trends, while negative values indicate decreasing trends.Te trend test is performed at a specifc α signifcance level.When |Z| > Z 1 − α/2, the null hypothesis is rejected and a signifcant   [73], respectively.Kisi and Ay [74] stated that in the case of long-term rainfall trend analysis, the MK test performs better than parametric tests.Te magnitude of a trend in a time series, such as the amount of change per year, can be estimated using a nonparametric method known as Sen's estimator [75].A positive value of Sen's slope indicates an upward trend, and a negative value indicates a downward trend in the time series.

Mann-Kendall Sequential Test (SQMK).
Using the traditional Mann-Kendall test to detect the general trend of a statistical series over an extended period does not provide an exhaustive picture of the trend structure across the whole series.Tese fuctuations can be detected by applying the sequential test for each individual subperiod [76].Makokha and Shisanya [77] have shown that negative or positive trends are not always signifcant for the entire time series, but can be detected using sequential Mann-Kendall plots.Tis test was proposed by Sneyers [78] to determine the approximate year of the start of a signifcant trend.Te SQMK test is calculated using the ranked values, y i of the original values in the analysis (x 1 , x 2 , x 3 , . . ., x n ).Te amplitudes of y i (i � 1, 2, 3, ..., n) are compared with y j (j � 1, 2, 3, ..., i − 1).For each comparison, the cases where y i > y j are counted and denoted by n i .Te SQMK test establishes two series, a progressive series of u(t i ) and a retrospective series of u′(t i ).Te test statistic t is then given by the following equation: Te distribution of the test statistic ti has a mean given as follows: Te variance is calculated as follows: Te sequential values of the u(t i ) statistic are then calculated as in following equation: Te retrospective sequential statistic u ′ (t i ) is estimated in the same way, but starting from the end of the series.Te estimated year (time) of onset of the trend is identifed by locating the intersection of the progressive u(t i ) and retrograde u ′ (t i ) curves.Te critical value for a 95% confdence level is ±1.96.

Innovative Trend Analysis.
Te innovative trend analysis (ITA) method, as introduced by S ¸en in 2012 [79], has been employed to identify trends in weather series.Te ITA method is one of several approaches devised to uncover deterministic trends within observed time series [80].
In the ITA method, the time series is partitioned into two equal segments from the initial date to the end.Tese two subseries are then sorted in ascending order.Te frst half of the series is plotted along the X-axis, while the second half is plotted along the Y-axis on a Cartesian coordinate system.When data points align along a 1 : 1 line, it indicates the absence of a discernible trend.If the data points appear above the 1 : 1 line, it suggests a positive trend, while points accumulating below the 1 : 1 line indicate a negative trend [81].
For the ITA, we utilized the "trendchange" package within R software version 4.0.2(R Core Team 2020).In this study, we tested the null hypothesis of no trend against the alternative hypothesis of the presence of a trend in the precipitation time series at two diferent signifcance levels (α): α � 5% and α � 1%.

Pettitt's Test.
Tis is a powerful method for highlighting the stationary or nonstationary nature of time series.Te test examines the existence of a break at an unknown time (t) in the series, using a formula derived from Mann-Whitney.According to the Pettitt test, x 1 , x 2 , x 3 , . . . .x n is an observed data series that has a change point at t such that x 1 , x 2 , . . ., x t has a distribution function F 1 (x) that is different from the distribution function F 2 (x) of the second part of the series x t+1 , x t+2 , x t+3 . . ., x n [82].Te U t nonparametric test statistic for this test can be described as follows: Te test statistic K and the associated confdence level (ρ) for the sample length (n) can be described as follows: When ρ is below the specifc confdence level, the null hypothesis is rejected.Te approximate probability of signifcance (p) for a point of change is defned as follows: Advances in Meteorology p � 1 − ρ. (11) Clearly, when there is a signifcant change point, the series is segmented at the change point into two subseries.Te K test statistic can also be compared with standard values at diferent confdence levels for the detection of a change point in a series.
2.3.5.Buishand's Range Test.Tis approach was proposed by Buishand in 1982 [83].It applies to normal distributions and assumes no change in the variance of the distribution.Assume an a priori uniform distribution for the position of the change point.Te adjusted partial sum (S k ), i.e., the cumulative deviation from the mean for the k th observation of a series x 1 , x 2 , x 3 , . . ., x k , . . ., x n with mean x, can be calculated using the following equation: A series can be homogeneous, with no change point, if S k � 0, because in a random series, the deviation from the mean will be distributed on either side of the series mean.Te signifcance of the change can be assessed by calculating the adjusted revaluation range (R) using the following equation: [84] is also one of the statistical tests used to detect points of change within time series.Te statistics of this test in a series of observations x 1 , x 2 , x 3 , . . ., x n can be described as follows:

von Neumann Ratio Test. Te von Neumann ratio test
According to this test, if the sample or series is homogeneous, then the expected value E(N) � 2 under the null hypothesis of constant mean.If the sample shows a point of change, then the value of N must be less than 2, otherwise we can assume that the sample shows a rapid variation in the mean.
Te P value was used to determine the degree of signifcance of each point of change in the time series.

Results
Te results of the Mann-Kendall test show that, in the Moulouya watershed, the average monthly temperature between 1980 and 2020 is increasing across the board.Z values exceed the 5% signifcance level for April, May, June, July, August, and October (Table 2).According to the Sen slope test, mean monthly temperatures show an annual increase of between 0 and 0.13 °C.Te maximum value is recorded in July, specifcally at station S5.On an overall watershed scale, May, August, and July show a rapid warming trend, with average rates of 0.093, 0.086, and 0.8 °C per year, respectively.By contrast, the series for the other months shows no signifcant trend (Table 3).
Te Mann-Kendall sequential test is a method essentially designed to determine the start dates of each trend and identify any shorter trends present.According to the results of the analysis (Figure 2), the most signifcant trends during January were observed at stations S1, S3, S4, and S8.Tese trends were initiated in 1995 at all four stations and continued until 2015, 2018, 2009, and 2020, respectively (Figure 2).However, no signifcant trend was observed in the February data series for the entire study area.For March, only station S7 showed a signifcant upward trend between 2010 and 2020.For April, almost all stations showed a signifcant trend between 2014 and 2020.Similarly, May follows a comparable trend, with signifcant trends appearing at certain stations from 1995 onward.During the summer months, particularly signifcant and widespread trends were observed at all stations, with the exception of station S7, located in the watershed uplands at an altitude of 1925 meters.Tese trends began between 2000 and 2010 and continued until the end of the study period.A similar pattern emerges in October, although the degree of signifcance is relatively lower than in the summer months.For September, November, and December, no signifcant trend was detected.Te U(t) curves oscillated between the two test thresholds, i.e., ±1.96 times the standard error.
Te ITA method was only applied to mean annual temperatures.Te results show that most data points lie above the 1 : 1 line, indicating an overall upward trend between the frst and second halves of the time series.However, the patterns observed at individual stations show distinct characteristics (Figure 3).Tis result confrms that of the classic Mann-Kendall test.
In this study, the Mann-Kendall sequential test was used to extract partial trends from the data series, while the Pettitt, Buishand, and von Neumann tests were applied to detect points of change.Te results of the Pettitt test revealed signifcant change points in 5 stations for the data series for January, a single point for February, and 2 signifcant points for March.From April to October, the data series appear to be heterogeneous, with the widespread emergence of change points.Te dates of these points are not similar at all stations and for all months (Tables 4 and 5).However, it is notable that most of these points of change occurred around 2000 and 2010.
Te results obtained from the Buishand test refect similar conclusions to those of the Pettitt test.Tey also indicate that most of the signifcant change points are located in the data series corresponding to the spring and summer seasons, extending from April to August.Te dates of these change points show similarities with those detected by the Pettitt test (Tables 4 and 5).
Te von Neumann test has also proven its efectiveness in identifying change points.Its results show that the majority of change points are detected during the summer season.On the one hand, the data series corresponding to January and December are also heterogeneous and present 6 Advances in Meteorology statistically signifcant change points (Tables 4 and 5).On the other hand, the data series for the other months are relatively homogeneous and show no statistically signifcant points of change.
On an annual scale, all mean annual temperature series recorded at the 9 stations in the Moulouya watershed are statistically heterogeneous.Te points of change are signifcant at the 1% threshold.Teir dates vary from station to station, depending on geographical location, recording conditions, and data reliability (Table 6).

Discussion
Te aim of our study is to highlight the spatiotemporal variability of mean monthly temperature in the Moulouya watershed, while analyzing the resulting trends.We used monthly mean temperature data from nine measuring stations belonging to the Moulouya Watershed Agency (ABHM), carefully selected based on their reliability, the length of their records, and their geographical location within the basin.Despite eforts to homogenize and improve data quality, the spatial coverage of measuring stations in the study area is relatively poor, and their geographical distribution is unbalanced, with a greater concentration in the downstream part of the basin than in the upstream part.Tis observation raises the possibility that the reality of spatial temperature variability throughout the basin may be signifcantly obscured.However, adding temperature data from other major watersheds in Morocco could help clarify differences in warming rates across elevations.
Te results reveal signifcant upward trends across the board, particularly observed in the summer months.Te results reveal signifcant upward trends across the board, particularly observed in the summer months.Application of the Mann-Kendall sequential test to the monthly mean temperature series indicates that this upward trend began in 2000.On average, this increase is estimated at 0.093 °C/year across the entire Moulouya watershed.Tese consistent results are in line with the conclusions of the IPCC report published in 2021, which demonstrated an increase in average air temperature of around 0.85 °C between 1880 and 2012.Te same report addressed the fact that between 2011 and 2020, the average temperature of the earth's surface was 1.1 °C higher than the average temperature at the end of the nineteenth century (before the rapid increase in greenhouse gas concentrations).It was also the highest in the last 100,000 years [21].Te last three decades are considered the warmest since 1850.Tese data clearly show that the rise in temperatures over the last 50 years has been faster than over the last two millennia, with a warming of 1.1 °C over the last 150 years.
While the IPCC reports have been produced in summary form, several researchers have carried out studies of air temperature variability and trends in specifc terrains.Te main conclusions concur in showing signifcant trends towards an increase in mean annual temperature.In this context, Eybekoglu and Aktürk found that summer temperatures increased in a watershed located in the central part of Turkey.Tese trends were statistically signifcant at the 95% confdence level at all stations [85].Swain et al. observed    1980 1983 1986 1989 1992 1995 1998 2001 2004 2007 2010 2013 2016 2019 1980 1983 1986 1989 1992 1995 1998 2001 2004 2007   8 Advances in Meteorology that the mean annual temperature increased by 1.44% between 1901 and 2002 in the Chhattisgarh area of western India [86].Moreover, the increase in mean annual temperature appears to be global in character.In fact, rising trends have been observed in America [16,23,29], Canada [28], Africa [24,27], Russia [25], and Japan [26].

Advances in Meteorology
In the same context, in the Mediterranean region, the majority of studies carried out on the analysis of temperature trends have shown a signifcant trend towards an increase in mean annual temperature [33][34][35][36][37][38][39].It should be noted that, on a seasonal scale, most of these studies have focused on an increase in summer or autumn temperatures.

Conclusion
Te aim of this study was to examine spatiotemporal variability and trends in mean monthly temperature at the scale of the Moulouya watershed, an area renowned for its vulnerability to the efects of climate change.To this end, statistical methods widely recommended by climate researchers were adopted.Te results obtained show a signifcant upward trend in mean monthly temperature, mainly pronounced during the summer months, in the Moulouya watershed.Application of the Mann-Kendall sequential test to the temperature series revealed that this increase began in 2000.Signifcant trend change points were also identifed at the watershed scale, mainly around 2000, with a marked infuence on the summer months.
Tese results demonstrate the relevance and power of the methods used to analyze spatiotemporal temperature variability in this region, as well as to detect the possible impacts of global warming on water resources in a vulnerable area such as the Moulouya Basin.It is important to stress that this study area is characterized by an expansion of irrigated agricultural land, which reinforces the importance of the conclusions obtained for the sustainable management of water resources in this region.In this context, the future of agriculture and the region's water situation remain uncertain.Moreover, adaptation to the challenges of global warming is a crucial issue in Morocco's arid environments, particularly in the Moulouya Basin, which encompasses large tracts of agricultural land.

Figure 1 :
Figure 1: Geographical location of the Moulouya watershed.

Figure 2 :
Figure 2: Results of the Mann-Kendall sequential test applied to monthly mean temperature data between 1980 and 2020 in the Moulouya watershed.(a) Between January and June and (b) between July and December.

Figure 3 :
Figure 3: Results of the ITA method applied to mean annual temperature data between 1980 and 2020 in the Moulouya watershed.

Table 2 :
Results of the Mann-Kendall test applied to monthly mean temperature data between 1980 and 2020 in the Moulouya watershed.Trends at the 0.1 signifcance level if 1.64_Z < 1.96.* * Trends at the 0.05 signifcance level if 1.96_Z < 2.57.* * * Trends at the 0.01 signifcance level if 2.57 < Z.

Table 3 :
Results of Sen's slope estimator (in degrees per year) applied to monthly mean temperature data between 1980 and 2020 in the Moulouya watershed.

Table 4 :
Results of the 3 change point detection methods applied to monthly mean temperature data, January-June, between 1980 and 2020 in the Moulouya watershed.

Table 5 :
Results of the 3 change point detection methods applied to monthly mean temperature data, July-December, between 1980 and 2020 in the Moulouya watershed.

Table 6 :
Results of the 3 change point detection methods applied to mean annual temperature data between 1980 and 2020 in the Moulouya watershed.