1 Introduction

On a global scale, climate change represents one of the major challenges of our time, exerting considerable impacts on the world’s ecosystems (Giannakopoulos et al., 2009; Giorgi & Lionello, 2008; Ozturk et al., 2015). This climate change has a strong influence on the variability of hydrometeorological factors such as temperature, precipitation, and evaporation (Wang et al., 2020). According to the Intergovernmental Panel on Climate Change (IPCC), human activity has accelerated this process, leading to an increase in the frequency and severity of risks associated with extreme events over time (IPCC, 2014).

Today, there is an undeniable need to understand the transformations impacting our ecosystems and species, as well as the subtle but persistent repercussions on our environment and vital resources such as agriculture and water. Subtle but persistent changes in temperature patterns have important implications for the natural environment, agriculture, water resources, and human well-being. In the global context of climate change, the Mediterranean region, particularly the northern areas of Africa, is emerging as a hotspot, experiencing significant increases in temperature and changes in precipitation patterns (Tuel et al., 2021). Manifestations of climate change include notable variations in temperature and sea level, greenhouse gas emissions, and increasingly inconsistent, unpredictable, and unreliable seasons and precipitation (Esit et al., 2023a, 2023b). These observations are supported by specialist literature, which focuses on aspects such as melting ice, floods, droughts, and global warming (IPCC, 2018).

Within the Mediterranean region, studies focusing on the impact of climate change and extreme events have been numerous. Research has highlighted significant changes in climate variability, with an increase in extreme temperature events (Baldi et al., 2006; Deniz & Gonencgil, 2015; Efthymiadis et al., 2011; Giorgi & Lionello, 2008; Kostopoulou & Jones, 2005; Vargas–Yanez et al., 2010; Xoplaki et al., 2003; Yacoub & Tayfur, 2017, 2020). Further work in the Mediterranean Basin reports an increase in warm extremes and a decrease in cold extremes (Efthymiadis et al., 2011; Frich et al., 2002; Klein et al., 2003). Recent studies have also attempted to explain temperature anomalies and changes in extreme temperature events in this region (Lopez–Moreno et al., 2011; Unkasevic & Tosic, 2009). In addition, the understanding of temperature fluctuations and extreme temperature events in the Mediterranean region has been extensively researched (Baldi et al., 2006; Deniz & Gonencgil, 2015). Regarding North Africa, several studies have examined trends and aspects of climate change, focusing in particular on rainfall and temperature. Statistical tests have been used to detect climate trends in this region (Belaassal, 1998; Mehdaoui et al., 2018; 2011). These analyses have highlighted significant changes in the region's climate patterns, underlining the importance of closely monitoring climate change in North Africa.

In the Moroccan context, where oceanic Mediterranean and Saharan climates meet, the impacts of climate change are tangible. Recent studies have revealed significant changes in temperature indices, indicating an increasing frequency and intensity of heat waves (Driouech et al., 2021; Khomsi et al., 2015). Climate variability in Morocco is manifested through an increase in maximum and minimum temperatures, exposing the country to hotter and drier conditions (Driouech et al., 2010; Khomsi et al., 2015; Knippertz et al., 2003; Sebbar et al., 2022; Tramblay et al., 2012; Tuel et al., 2021). These worrying climate trends have a direct impact on crucial sectors such as agriculture, water management, and biodiversity in Morocco. The agricultural sector, in particular, is emerging as particularly vulnerable, requiring a detailed analysis of climate impacts and adaptation options (Filahi et al., 2016). In-depth studies have assessed the impact of climate change on the Moroccan landscape, highlighting increased vulnerability and underlining the need to develop specific mitigation and adaptation strategies (Tramblay et al., 2012).

To design effective climate change mitigation strategies on a regional and global scale, it is crucial to predict temperature trends (Yenice & Yaqub, 2022). An in-depth understanding of the impacts of climate change requires the exploration of innovative and robust analytical methods. Among these approaches, the ITA (Sen, 2012) the IPTA (Sen et al., 2019), and the Mann–Kendall (MK) (Kendall, 1975; Mann, 1945) test stand out as essential tools in the analysis of climate trends, offering a crucial fusion between statistical rigor and innovation (Giannakopoulos et al., 2009; Giorgi & Lionello, 2008). These methodologies provide robust means of detecting and analyzing trends within complex time series associated with climate data, thereby enhancing our understanding of the climate system and predicting future changes (Ozturk et al., 2015; Vargas-Yanez et al., 2010).

In this context, various research studies have examined innovative trend analysis methods with improved versions (ITA) that use percentage trend change calculations to investigate trends in hydrometeorological variables such as precipitation and temperature (Alashan, 2020; Esit, 2023; Serencam, 2019), winds and waves (Akcay et al., 2022) and groundwater resources (Mandal et al., 2023). Studies have also shown that the ITA techniques, compared with conventional trend analysis tests such as the Mann–Kendall (MK), possess enhanced sensitivity for detecting trends in precipitation, temperature and relative humidity (Ahmed et al., 2023; Alifujiang et al., 2023; Chowdari et al., 2023; Pastagia & Mehta, 2022). This has improved capacity challenges in long-term climate change models and plays a crucial role in water resource planning and management.

The objective of this study is to estimate long-term temperature trends and variability of maximum and minimum temperatures in Morocco by employing various statistical methods and indices (ITA, IPTA, MK-test, Sen’s slope estimator) over the period from 1970 to 2019 by using the data from four stations located in different areas having different conditions of topographies and climates. This study would make a unique contribution to the understanding of climate trends, enriching our understanding of local climate dynamics, assessing impacts of climate change, and designing adaptation strategies.

2 Study Area, Data Description, and Temperature Variations at Various Time Scales

The analysis of maximum and minimum temperature trends was carried out using four meteorological stations located in different topographical units across Morocco. These stations are distributed in different coastal and continental geographical regions (Fig. 1) and contain a 50-year data series from 1970 to 2019 (Table 1). The spatial distribution of these stations varies according to altitude and specific climatic regions, with a significant contrast at each location depending on their proximity to the ocean and the variations in elevation that characterize them. At these stations, and because of their position in the north of Morocco, climatic variability, and in particular temperature, is particularly pronounced (Fig. 1 and Table 1).

Figure 1
figure 1

Geographical location of weather stations

Table 1 Data on the four stations and the statistics for monthly Tmax and Tmin from 1970 to 2019

Table 1 presents a complete compilation of minimum and maximum temperature data for the period from 1970 to 2019 for four stations: Rabat-Sale, Fes-Sais, Meknes and Taza. Analysis of the Tmin and Tmax characteristics for the period in question reveals distinct variations at each station. At the topographical level, significant disparities appear, with the Rabat-Sale station located at an altitude of 74 m in a coastal region, while the continental stations of Fez-Sais occupy the highest position at 571 m and the Meknes station at an altitude of 556 m and 509 m for the Taza station (Table 1). These altitudinal differences play a crucial role in modulating the recorded temperatures.

The medians for the period studied of Tmin and Tmax reveal subtle differences between stations. At Rabat-Sale, the medians are 12.2 °C and 22.0 °C respectively, indicating relative stability. Fez-Sais and Meknes show slightly lower median temperatures, while Taza displays slightly higher median values.

For minimum temperatures, Rabat-Sale and Taza stand out with respective averages of 12.58 °C and 12.57 °C, indicating relatively high values compared with Fez_Sais (10.21 °C) and Meknes (11.32 °C) (Table 1). For maximum temperatures, Fez_Sais had the highest average at 24.06, suggesting warmer days compared with the other stations. The standard deviations (SD) of minimum and maximum temperatures show greater variability at Fez_Sais (5.08 °C and 6.93 °C respectively) and Taza (5.49 °C and 7.61 °C respectively), highlighting potentially more pronounced climatic fluctuations (Table 1).

Extreme values deserve particular attention, with Fez_Sais standing out with a minimum temperature of 0.01 °C and a maximum temperature of 38.79 °C for the period 1970 to 2019 (Table 1 and Fig. 2). These extremes testify to the diversity of climatic conditions in this specific region. The statistical characteristics of the data highlight substantial differences among weather stations, both in terms of location and meteorological parameters such as altitude, and minimum and maximum temperatures.

Figure 2
figure 2

Variability of minimum and maximum temperatures based on monthly averages from 1970 to 2019

The data analysis reveals distinct trends; and temperature increases at different weather stations. In particular, the coastal station of Rabat_Sale, located at an altitude of only 74 m above sea level, shows relatively modest increases in average temperatures over the entire period studied. Indeed, for Rabat_Sale, the average increase in minimum temperature is around − 0.53 °C, while the average increase in maximum temperature is around 0.21 °C. These figures indicate a slightly negative trend for the minimum temperature and a moderate increase for the maximum temperature over time (Fig. 2). In contrast, the other weather stations, located in continental regions at altitudes of over 500 m, show more significant temperature increases. For example, at Fez_Sais, an average increase in minimum temperature of around 0.58 °C and in maximum temperature of around 2.60 °C was observed. These results suggest that climate change is more marked in continental regions, where variations in altitude and distance from the moderating influence of the ocean can lead to more extreme climatic conditions.

Monthly data and seasonal variation in temperatures reveal significant insights into regional climatic changes among the four stations, highlighting the distinct characteristics of each locality. In general, monthly temperatures peak in July and August, with a minimum recorded in December and January at all the stations (Fig. 3).

Figure 3
figure 3

Monthly temperature variability from 1970 to 2019

Taza station stands out as having the highest average maximum temperature, reaching 36 °C in July, while the lowest temperature is recorded at 15.9 °C in December. The highest average maximum temperatures in July were also recorded in Fez (35.9 °C), Meknes (35.8 °C) and Rabat (31.7 °C) (Fig. 3). On the other hand, the lowest average maximum temperatures in December were recorded in Taza (15.9 °C), Fès (16.3 °C), Meknes (16.5 °C) and Rabat (17.2 °C in January) (Fig. 3). The warmest months are July and August, with average minimum temperatures over 20 °C. Conversely, the coldest months are December and January, with average minimum temperatures falling below 5 °C. Fez-Sais stands out as the warmest city, with average minimum temperatures above 10 °C throughout the year, while Taza is identified as the coldest city, with average minimum temperatures below 10 °C throughout the calendar (Fig. 3).

Analysis of the average seasonal maximum and minimum temperatures over the period 1979–2019 shows that all the stations have the same trend patterns from one season to the next (Fig. 4). In spring, the Fez Sais station recorded the highest average seasonal maximum temperatures at 22.5 °C, followed by Meknes (22 °C), Rabat (21.5 °C) and Taza (21 °C) (Fig. 4).

Figure 4
figure 4

Seasonal temperature variation

The lowest seasonal minimum temperatures were recorded in Taza (8 °C), followed by Meknes (9 °C), Fez (10 °C) and Rabat (11 °C). During the summer, Fez maintained its position with the highest maximum temperatures at 35 °C, followed by Meknes (34.5 °C), Rabat (34 °C) and Taza (33.5 °C). The lowest minimum temperatures were recorded in Taza (18 °C), followed by Meknes (19 °C), Fez (20 °C) and Rabat (21 °C) (Fig. 4). Data for autumn and winter followed a similar pattern, with Fez showing the highest temperatures and Taza the lowest. In short, Fez recorded the highest temperatures, with an average of 25 °C in summer and 7 °C in winter, while Taza experienced the lowest temperatures, with an average of 23.5 °C in summer and 5 °C in winter (Fig. 4). Overall, average seasonal maximum and minimum temperatures remained relatively stable over the period, with a slight upward trend.

3 Methodology Using Classic and Innovative Tests

This study examines the minimum and maximum temperature trends using both classical and innovative tests. To detect trends and significant variations in climatological time series, there are two distinct approaches: Parametric tests and non-parametric tests (Gocic & Trajkovic, 2012). Parametric tests are more powerful than non-parametric tests, but the data must be independent and normally distributed (Touhedi et al., 2023). Non-parametric tests only require independent data and can tolerate outliers (Chen et al., 2007). This methodological decision is relevant in the context of the analysis of temperature trends, where one seeks to understand changes in the temperature of weather stations in topographic units at various altitudes. The methodologies employed in this paper include the classical MK tests and the Sen’s slope estimator, and the ITA and the IPTA methods.

3.1 Mann–Kendall Test (MK)

The MK trend analysis is a statistical technique for examining upward and downward trends in a time series (Alashan, 2018, 2023). It is introduced by Mann in 1945 and developed by Kendall in 1975 to identify changes in hydrometeorological time series, particularly in the fields of climatology and hydrology (Deniz & Gonencgil, 2015; Guclu, 2018; Touhedi et al., 2023; Yacoub & Tayfur, 2020; Zeybekoglu, 2023).

It is based on a rank correlation test for two sets of observations (Hamed, 2008). The null hypothesis of the MK test rules out the existence of trends or serial correlation structures among the observations because the data are independent and randomly ordered (Hamed, 2008). The MK test is calculated as follows (Kendall, 1975; Mann, 1945):

$$\begin{array}{c}\text{sgn}\left({x}_{i}-{x}_{j}\right)=\left\{\begin{array}{cc}1& \text{ if }{x}_{j}>{x}_{i}\\ 0& \text{ if }{x}_{j}=xi\\ -1& \text{ if }{x}_{j}<xi\end{array}\right.\\ \\ S=\sum_{\text{i}=1}^{n-1}\sum_{j=i+1}^{n}\text{sgn}\left({x}_{i}-{x}_{j}\right)\end{array}$$
(1)

where the data values xi and xj are indicated at times i and j, and n is the number of the data. A positive value of S indicates a rising trend, while a negative value of S indicates a falling trend.

3.2 Sen’s Slope Estimator

This statistical non-parametric method computes the magnitude of slope in a time series data developed by Sen (1968). The Sen’s slope estimator computes the slope (S) of a data \(x\) as follows:

$${T}_{i}=\left({x}_{j}-{x}_{k}\right)/\left(j-k\right)$$
(2)

where,\({x}_{j}\) is the data value at time j and \({x}_{k}is the\) data value at time k and j = 2,…,N and k = 1,…,N-1.

$${Q}_{i}=\left\{\begin{array}{c}{T}_{(N+1)/2}\quad N\; is\; odd\\ 1/2({T}_\frac{N}{2}+{T}_{\frac{N+2}{2}}\quad N\; is\; even\end{array}\right\}$$
(3)

where, \({Q}_{i}>0,\) positive values show increasing trend and \({Q}_{i}<0,\) negative values show decreasing trend, and \({Q}_{i}=0\) suggests the absence of any discernible trend (Rahman & Dawood, 2017; Salmi et al., 2002).

3.3 Innovative Trends Analysis (ITA)

Sen (2012) developed a graphical method, called Innovative Trend Analysis (ITA), which offers an innovative approach to studying variations within successive time series (Fig. 5). None assumption in this model makes it adaptable to the interpretation of trends in data series of various sizes. The ITA methods involves two steps: 1. The annual time series data is first divided into two equal halves, and then the data in each sub-series is ranked from the highest to the lowest. 2. The resulting each sub-series is then plotted against each-other (Sen, 2012). If all data fall on the 45° line, then there is no trend. If points fall above the 45° line, then there is an increasing trend, otherwise, there is decreasing trend (Sen, 2012). Figure 5 presents an example of the ITA approach for the Rabat-Sale station.

Figure 5
figure 5

Example of description of the ITA Method with an Application Span from 1970 to 2019 for Tmin Station in Rabat-Sale

It should be noted that the ITA method does not involve percent change calculations (Guclu, 2018; Oztopal & Sen, 2017; Sen, 2012). The slope of the linear model, together with the associated t-test, is used to determine the existence and significance of the trend, as follows:

$$S = (2 (x[j] - x[i])) / n$$
(4)

where S is the slope of the trend line, n is the total number of data series used, and xi and xj are the average of the first and second subseries of the dependent variable.

3.4 Innovative Polygon Trend Analysis (IPTA)

The IPTA method, developed by Sen et al. (2019), can be applied to time series at different time scales, such as monthly and seasonal (Achite et al., 2021; Ceribasi et al., 2021; Karacosta et al., 2023; Koycegiz & Buyukyildiz, 2023; Yenice & Yaqub, 2022). The monthly time series x1, x2,, ……xn, where n is the number of years, should be organized in a matrix form, as follows (Sen et al., 2019).

$$\left[\begin{array}{cccccc}{X}_{\text{1,1}}& {X}_{\text{2,1}}& \dots & {X}_{i,1}& \dots & {X}_{\text{12,1}}\\ {X}_{\text{1,2}}& {X}_{\text{2,2}}& \dots & {X}_{i,2}& \dots & {X}_{\text{12,2}}\\ {X}_{\text{1,3}}& {X}_{\text{2,3}}& \dots & {X}_{i,3}& \dots & {X}_{\text{12,3}}\\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ {X}_{1,n}& {X}_{2,n}& \dots & {X}_{i,n}& \dots & {X}_{12,n}\end{array}\right\}\left\{\begin{array}{c} \, {\text{U}}{\text{p}}{\text{p}}{\text{e}}{\text{r}} \, {\text{S}}{\text{e}}{\text{r}}{\text{i}}{\text{e}}{\text{s}} \, \text{(}{\text{F}}{\text{i}}{\text{r}}{\text{s}}{\text{t}} \, {\text{H}}{\text{a}}{\text{l}}{\text{f}}\text{)} \, \\ n=\text{1,2},3,\dots \dots ,n/2\\ \, {\text{L}}{\text{o}}{\text{w}}{\text{e}}{\text{r}} \, {\text{S}}{\text{e}}{\text{r}}{\text{i}}{\text{e}}{\text{s}} \, \text{(}{\text{S}}{\text{e}}{\text{c}}{\text{o}}{\text{n}}{\text{d}} \, {\text{H}}{\text{a}}{\text{l}}{\text{f}}\text{)} \, \\ n=n/2+1,n/2+2,\dots ,n,\end{array}\right.$$
(5)

where, the first half, referred to as the upper series, encompasses the years \(n=\text{1,2},3,\dots ,\frac{n}{2}\) and the second half, known as the lower series, includes the years \(n=\frac{n}{2}+1,\frac{n}{2}+2,\dots ,n.\)

To carry out the IPTA, on a monthly and seasonal scale, a multi-stage process is followed by which the model uses a pre-established format with 12 points of dispersion to represent each month of the year. It also includes arithmetic mean and standard deviation values. Trends between two successive months are identified by using the IPTA model, which enables one to calculate the slopes, lengths, and values associated with these monthly trends. Then, the trend polylines were constructed by using the successive segments of Tmin and Tmax time series. Finally, to interpret the results, the trend polylines obtained as a basis for further analysis were used. This allowed us to obtain both numerical and linguistic interpretations of the time series examined, which in turn gave us a better understanding of the climatic variations observed.

4 Results and Discussion

4.1 Mann–Kendall (MK) Test, Sen’s Slope, and P-value

Results of the MK test, the Sen’s slope, and the P-values are presented in Table 3 and Figs. 6, 7, 8. These results demonstrate the effectiveness of the MK rates and the significance of the trends between the four stations over the period 1970–2019. The conclusions drawn from these tests highlight the significant variations and the direction of the trends.

Figure 6
figure 6

Types of trends through Mann–Kendall, Sen’s Slope, and P-value on a monthly scale over the period from 1970 to 2019

Figure 7
figure 7

Heat maps of trend result through Mann–Kendall, Sen’s Slope, and P-value on a seasonal scale for four stations over the period from 1970 to 2019

Figure 8
figure 8

Seasonal Trend Analysis (1970–2019): Mann–Kendall and Sen’s Slope Tests with P-value Significance Interpretation

4.1.1 Station-wise Analysis

The results of the conventional tests carried out on minimum and maximum temperatures over the period are presented in Table 3. The values of MK_Tmin, Sen’s_Tmin, and P-value_Tmin, by the interpretation criteria in Table 2, indicate the trends, Sen’s slopes, and P-values, respectively, associated with the minimum temperatures. Similarly, MK_Tmax, Sen’s_Tmax, and P-value_Tmax provide the same data for maximum temperatures. The results show that minimum temperatures are trending upwards, which is confirmed by the positive values of MK_Tmin and Sen’s_Tmin.

Table 2 Interpretation Criteria for MK, Sen’s Slope, and P-value

The statistically significant nature of these positive trends was confirmed by P-values for Rabat-Sale, Fez_Sais, and Taza (Table 3), with a P-value_Tmin of 0.05. Similarly, the analyses show significant upward trends in maximum temperatures, with P-values all below 0.05, suggesting significant climatic changes over the decades in all the regions studied.

Table 3 Statistical trends in Tmin and Tmax temperatures at four stations over the period (1970–2019)

The results show significant increasing trends for Tmin and Tmax, indicating that minimum and maximum temperatures are increasing in all regions of each station. Tmax at Taza was observed with Kendall’s tau value of 0.1035 and a P-value of 0.0002. This suggests that the Taza region is particularly likely to be affected by the effects of climate change. In Rabat-Sale, Tmin shows the lowest increasing trends, with Kendall’s tau value of 0.0221 and a p-value of 0.4222.

4.1.2 Monthly Analysis

The trend in monthly mean minimum and maximum temperatures using conventional tests is shown in Fig. 6. Kendall diagrams represent the data and show the slope of the trend (positive or negative), as well as its statistical significance (P-value). The results of the analysis show significant variations in various regions. There are months with a downward trend at the Rabat-Sale station, such as January and February, with Kendall’s tau values of − 0.1020 and − 0.1037, respectively. However, the months of March, June, July, September, November and December showed a strong upward trend, with Kendall’s tau values ranging from 0.1470 to 0.2180 (Fig. 6).

Meknes station, located to the east of Rabat-Sale station, shows a general upward trend, particularly in January (with a Kendall rate of 0.0024) and July (with a Kendall rate of 0.1053). For Fez-Sais, temperatures are falling in February with a Kendall’s ratio of − 0.0710, while temperatures in December are rising with a Kendall’s ratio of 0.1339. Finally, temperatures at the Taza station increased in January, with Kendall’s ratio of 0.1331 (Fig. 6). These monthly variations highlight the complexity of regional climate change.

Monthly trends in maximum temperatures in the different regions of Morocco have been analyzed in-depth, revealing important climate patterns. For six months of the year, there is a notable upward trend in Rabat-Sale, with significant figures such as a Sen slope of 0.0146 in June, indicating a statistically significant increase in maximum temperatures.

Meknes shows more marked trends, especially in January, February, September, November, and December, with significant values for the Sen slope and P values. Maximum temperatures increase in certain months, such as February, September, and November, according to the Fez-Sais station. Finally, the Taza station shows a clear and statistically significant trend with a Sen slope of 0.0504, confirming a notable increase in November.

4.1.3 Seasonal Analysis

Figures 7 and 8 present the seasonal trend results that show a wide variety of microclimates in the regions, highlighting significant variations between stations. Seasonal trends in lowest temperatures show significant patterns. In spring and summer, there was a significant increase in Rabat-Sale (Kendall’s tau = 0.110, P-value = 0.046) and a significant increase in summer (Kendall’s tau = 0.116, P-value = 0.036). However, these trends decrease in intensity in autumn (Kendall’s tau = 0.034, P-value = 0.534) and become insignificant in winter (Kendall’s tau = − 0.056, P-value = 0.305) (Figs. 7 and 8). Minimum temperatures in Meknes show significant positive trends in spring (Kendall’s tau = 0.151, P-value = 0.006) and summer (Kendall’s tau = 0.161, P-value = 0.003), while in autumn and winter the trends are persistent but insignificant (Figs. 7 and 8). The trends at Fez Sais and Taza are similar, with significant increases in Tmin in spring and summer, although the significance varies between autumn and winter stations. This analysis shows a regional upward trend in minimum temperatures in spring and summer, with stationary nuances, and a relative decrease in trends in autumn and winter. These results highlight the importance of understanding seasonal changes in minimum temperatures to assess the impact on ecosystems and human activities.

Seasonal trends in maximum temperatures at all the stations show significant upward variations. In spring and autumn, increases were observed in Rabat-Sale (Kendall’s tau = 0.051, P-value < 0.001), while in autumn the trends are weaker (Kendall’s tau = 0.085). In addition, there is a significant upward trend in winter (Kendall’s tau = 0.097, P-value = 0.081) (Figs. 7 and 8). Similar patterns are observed at the Meknes station, with increases in Tmax in spring and summer, but no significant variations in autumn and winter. In addition, Fez and Taza confirm increasing trends for Tmax in spring and summer, while the results vary in autumn and winter. These results suggest a significant increase in maximum temperatures at all stations in spring and summer, with seasonal and regional variations.

All stations show significant upward trends in spring. Kendall’s tau values vary from 0.100 to 0.211 depending on the station. Temperatures always rise during the summer, but the variations between stations are more obvious. Taza has the highest results, with a Kendall tau of 0.318, highlighting a significant increase in summer, compared to the other stations (Figs. 7 and 8). Positive trends persist in autumn but differ from station to station. Meknes and Fez-Sais show greater autumn increases than Rabat-Sale. This diversity highlights the impact of local factors on seasonal changes. During the winter, there are variations in trends between stations. Taza and Fez-Sais show significant increases in minimum and maximum temperatures, with Kendall’s tau values as high as 0.320, highlighting the contrasting impact of climate change in winter and the need for adaptation strategies that take account of specific features.

The integration of simple tests such as Mann–Kendall and the Sen-slope estimator confirms and reinforces the trends observed in the previous analysis, underlining the robustness of the results in assessing climate change at various scales. The significant variations in temperatures underline the importance of taking adaptation measures to cope with the potential impacts of climate change in the region.

4.2 Innovative Trend Analysis (ITA)

Innovative Trend Analysis results for minimum and maximum temperature trends for the stations are shown in Fig. 9. In order to interpret these graphs, it is worth noting that the blue line shows no trend; 1.1 (45°). In order to compare Tmax and Tmin series, the first half period (from 1970 to 1994) was plotted against the second part (1995 to 2019).

Figure 9
figure 9

Annual ITA results based on means for the period 1970 to 2019

There is a rising trend in maximum temperatures in the region, characterized by positive trend indices and significant correlations, which is revealed by a meticulous analysis of the ITA results in Fig. 9 for the first half from 1970 to 1994. There appears to be a consistent pattern over this period in the upward trend. However, in the second half from 1995 to 2019, the dynamics changed (Fig. 9). Some locations, such as Rabat-Sale, show a slight decrease in maximum temperature, while others, such as Meknes, Fes-Sais, and Taza, show a significant increase, supported by positive trend indicators and significant links. In general, maximum temperature trends have evolved, with a general increase from the first half of 1970 to 1994, followed by a more complex second half from 1995 to 2019 (Fig. 9).

A trend analysis carried out between 1970 and 2019 revealed a significant increase in annual maximum temperature at all weather stations, with a P-value < 0.05 and varying trend slopes ranging from 0.0015 °C per year in Rabat-Sale to 0.0076 °C per year in Taza (Fig. 9). Notably, the increase is greater in the second half of the period compared with the first half. This is underlined by strong correlations with time and values greater than 0.99, suggesting a close correlation with climate change. A significant increase in annual maximum temperature, with estimates of 0.0003 to 0.0004 °C per year for the 90 and 95% confidence intervals, and 0.0005 to 0.0006 °C per year for the 99% confidence interval, over the coming decades (Fig. 9) underlines the importance climate change in the region.

Analysis of the results for the first half of the 1970–1994 period reveals positive interstation correlations for increases in minimum temperatures at all stations. However, between 1995 and 2019, the trends are more varied, with some stations experiencing slight reductions and others increasing (Fig. 9). All stations show a general upward trend in annual minimum temperatures over the whole period, confirmed by positive trend indicators and high correlations, despite seasonal variations. For example, there is a positive trend throughout the year in Meknes. These results indicate that, despite seasonal variations, annual minimum temperatures would increase in the long term.

4.3 Innovative Polygon Trend Analysis (IPTA)

The IPTA was applied at monthly and seasonal scales and the results were presented in Figs. 10 and 11 and Tables 4, 5, and 6.

Figure 10
figure 10

IPTA graph for Mean Tmin and Tmax (1970–2019)

Figure 11
figure 11

IPTA graph of mean Tmin and Tmax per season (1970–2019)

Table 4 IPTA monthly statistical values
Table 5 Result of IPTA monthly statistical values of arithmetic mean and standard deviation
Table 6 Seasonal IPTA results for the period 1970 to 2019

4.3.1 IPTA Monthly Analysis

Results of the IPTA for minimum temperatures show an upward trend for most months of the year at all stations, except Rabat_Sale and Meknes, where a downward trend is observed for January and February. Meknes also shows a downward trend in February (Fig. 10 and Table 5). On the other hand, the months that showed no trend were February for the Fez station, September and July for the Meknes station, and September and July for the Rabat-Sale station (Fig. 10 and Table 5). Concerning maximum temperatures, the IPTA results show that all the stations for the year have an upward trend, except September for Meknes and Fez-Sais, which showed no trend, and July for Rabat-Sale (Fig. 10 and Table 5).

Table 4 shows the results of IPTA Tmin and Tmax for the first half of 1970–1994 and the second half of 1995–2019. The first half of the period shows that standard deviations for maximum temperatures at Taza increase progressively from January to March, with an average of 1.4 °C in January, rising to 3.0 °C in March (Table 4). On the other hand, at the Fez-Sais station, the standard deviations for Tmax are relatively stable, with an average of 1.8 °C in March. At Meknes, the standard deviations for Tmax increase from 1.4 °C in January to 2.5 °C in March, then decrease slightly. In Rabat-Sale, the standard deviations for Tmax vary from 0.8 °C to 1.7 °C from January to March (Table 4).

As regards to the minimum temperatures for the first half of the year, the standard deviations at Taza increase slightly from January to March, with an average of 1.7 °C in January, falling to 1.3 °C in March. At Fez-Sais, standard deviations for Tmin remain relatively stable, with an average of 1.1 °C in January. Meknes showed a slight increase in standard deviations for Tmin, rising from 1.9 °C in January to 2.1 °C in March. For Rabat-Sale, the standard deviations for Tmin vary from 0.8 °C to 1.8 °C from January to March (Table 4). For the second half, the standard deviations for Tmax at Taza increase significantly from July to September, with an average of 2.1 °C in July, decreasing to 1.1 °C in December. In Fez-Sais, the standard deviations for Tmax increase from 1.7 °C in July to 2.7 °C in August, then gradually decrease.

In Meknes, standard deviations for Tmax vary from 0.8 °C to 3.3 °C from July to September, then decrease towards the end of the year. Rabat-Sale shows standard deviations for Tmax that vary from 0.9 °C to 1.8 °C from July to September (Table 4).

As regards minimum temperatures for the second half of the period, the standard deviations at Taza increase gradually from July to November, with an average of 1.0 °C in July, reaching 1.7 °C in November. At Fez-Sais, the standard deviations for Tmin vary from 1.0 °C to 1.5 °C from July to November. The Meknes station shows a slight increase in standard deviations for Tmin, rising from 0.4 °C in September to 1.4 °C in December. Rabat-Sale shows standard deviations for Tmin that vary from 0.7 °C to 1.6 °C from July to November (Table 4).

Table 5 shows significant variations between stations in terms of mean trend length and mean trend slope. At Taza, the September–October pair of months have an average trend length of 2.10 and the May-Jun pair of months have maximum slopes of 3.83, indicating pronounced seasonal variations and rapid increases in minimum temperatures. However, Rabat-Sale has lower trend length values, with a maximum of 1.66 for the May-Jun and September–October pair of months, and smaller variations in mean trend slopes, which could indicate a downward trend in minimum temperatures during some months (Table 5).

The differences between stations are also noticeable for maximum temperatures. With a maximum trend length of 2.61 for the September–October pair and a maximum slope of 5.59 for the June-July pair (Table 5). Taza shows relatively high values of trend length and mean slope, indicating pronounced seasonal variations and a tendency for maximum temperatures to increase during the summer months. However, Rabat-Sale shows lower values of trend length, with a maximum of 1.74 for the Jun-July pair of months (Table 5). There is also less variation in the mean trend slopes, suggesting a smaller increase in maximum temperatures in some months.

Comparisons between stations show similar trends in seasonal variations in minimum and maximum temperatures, but differences in the amplitude of the trend. Climate trends at continental stations such as Taza and Meknes are more variable than those at coastal stations such as Rabat-Sale. These differences highlight the importance of local and regional conditions in the interpretation of climate trends and in studies of spatiotemporal temperature variation. IPTA monthly results show that local geographical and climatic conditions are essential in determining climate trends. Due to its unique geographical location, Taza appears to be more exposed to extreme temperature variations than any of the other stations examined.

4.3.2 IPTA Seasonal Analysis

Seasonal analysis of IPTA results for minimum and maximum temperatures reveals significant trends at most of the stations. In general, the trend observed is upwards throughout the year, as shown in Fig. 11 and Table 6. Stations located in continental regions show marked upward trends throughout the year for both half’s, according to IPTA results on seasonal minimum temperature scales. The stations at Taza, Fez-Sais and Meknes stand out in particular for these upward trends throughout the year. However, the Rabat-Sale coastal station shows different trends depending on the season, due to its geographical location. During the winter season, there is a downward trend, while during the other seasons, there is an upward trend (Fig. 11).

The results of IPTA on a seasonal scale for the period from 1970 to 2019 are shown in Table 6, which highlights significant trends in variations in minimum and maximum temperatures for different seasons (Fig. 11 and Table 6). Analysis of these data reveals consistent seasonal trends in minimum and maximum temperatures. For example, standard deviations of temperatures are generally higher in summer than in winter at all stations, with values as high as 5.2 °C for Taza in autumn (Table 6). In addition, mean temperatures for the first and second halves of the seasons show significant variations, reflecting seasonal changes in weather conditions. For example, in Fez-Sais, minimum and maximum temperatures increase steadily from autumn to summer, with maximum values reaching up to 35.6 °C during the summer in Taza (Table 6).

Variations between stations also provide valuable information about regional differences in climate trends. Taza, for example, generally has higher standard deviations and higher mean temperatures than the other stations for all seasons, with standard deviations of up to 5.2 °C for minimum temperatures in autumn (Table 6). Rabat-Sale, on the other hand, has lower standard deviations and mean temperatures, probably due to its coastal location.

Finally, the IPTA results on a seasonal scale confirm a general upward trend in temperatures at most of the stations, with seasonal variations that may be influenced by the specific geographical characteristics of each station (Figs. 4 and 11, and Table 6). A comparison of the results between the different stations shows that the seasonal variations in temperatures are generally consistent, but with nuances depending on the geographical characteristics of each station. For example, stations located in continental regions, such as Taza and Meknes, generally have higher temperatures than coastal stations such as Rabat-Sale, particularly during the summer seasons.

5 Discussion

This study investigated maximum and minimum temperature trends between 1970 and 2019 recorded at several climate stations located in different regions of Morocco. The stations included Rabat-Sale, Meknes, Fez-Sais, and Taza, representing different geographical regions and geographical units of the country. Trend analysis used both the classical tests of the Mann–Kendall and Sen's slope estimator, as well as the innovative approaches of the ITA and the IPTA, at different time scales.

The results of the Mann–Kendall tests and the Sen’s slope estimator at the periodic, monthly and seasonal scales revealed a significant diversity of microclimates between regions. Seasonal trends revealed the consistent patterns of temperature increases in spring and summer, with inter-station and seasonal variations.

The ITA results confirmed the increase or decrease in maximum and minimum temperatures obtained by the classic tests. The ITA showed a significant increase in annual maximum temperatures at all stations. This trend was more pronounced in the second half period (1995–2019) in the coastal region. The IPTA at different time scales confirmed the results obtained by the MK and the ITA tests. The IPTA showed varied trends in most months of the year with an upward trend, with the exception of January and February for Rabat_Sale. According to the IPTA seasonal analysis, most stations have significant minimum and maximum temperatures that increase throughout the year.

On a monthly scale, the Mann–Kendall revealed significant variations between regions. For example, at Rabat_Sale as a coastal station, the months of January and February showed a downward trend in minimum temperatures, while other months such as March, June, July, September, November, and December showed a significant upward trend. Overall, the results mainly showed positive upward trends of Tmin and Tmax on an annual, seasonal and monthly scale, highlighting a significant change in temperatures in these different regions.

The ITA annual results, based on averages for the period from 1970 to 2019, showed a significant increase in annual maximum temperature, with estimates ranging from 0.0003 to 0.0006 °C/year. In particular, this increase was more marked in the second half of the period. From 1995 to 2019, trends became more disparate, with a slight decrease in minimum temperature observed in Rabat-Sale and Fez-Sais, but a marked increase in Meknes and Taza. These results suggested a change in minimum temperature trends over time, with a general upward trend from 1970 to 1994 and more pronounced variability from 1995 to 2019.

These results have been overall confirmed by other studies on global temperature trends. Several studies have pointed to an upward trend on annual, seasonal and monthly scales, highlighting significant temperature change in different regions around the world (Arnell et al., 2019; Gagnon, 2022; IPCC, 2018; Jones, 1995; Tabari & Hosseinzadeh Talaee, 2011).

Regarding the Mediterranean region, several studies have shown a persistent warming trend in extreme temperatures since the mid-twentieth century (Donat et al., 2014). On the other hand, positive trends have been observed in sea level rise and sea surface temperature (Knobler et al., 2023). Overall, the impact of accelerating climate change effects has become a reality in the Mediterranean region, including increased frequency of extreme weather events, sea level rise and their effects on ecosystems, economic activities and human health (Pardo et al., 2023). This region could experience drought episodes as a result of rising temperatures, which would considerably reduce the amount of water available due to increased evapotranspiration (Stathi et al., 2023).

Regarding the Morocco, significant temperature increases have been observed from the mountains to the plains (Hadri et al., 2021). On the other hand, one study has predicted an increase in mean annual temperature towards the 2050s, with simulations indicating a rise under RCP scenarios 2.6, 4.5, and 8.5 (Ouhamdouch & Bahir, 2017).

6 Conclusions

Following conclusions are drawn from this study.

  1. 1.

    The upward temperature trends support the hypothesis of significant climate change in Morocco.

  2. 2.

    The results reveal significant variations between regions, highlighting the complexity of climate variability from one region to another and underline the role of analysis of trends at different scales.

  3. 3.

    The results reveal a significant diversity of microclimates between regions.

  4. 4.

    Overall, the results of the tests revealed mainly positive upward trends on an annual, seasonal and monthly scale, highlighting a significant change in temperatures in these different regions.

  5. 5.

    At the scale of Morocco, this study could make a significant contribution to understanding temperature variations and trends in North Africa.

  6. 6.

    The results of the MK, ITA and IPTA tests at minimum and maximum temperatures underline their usefulness.

  7. 7.

    Future studies should aim to identify the causes of the observed changes, whether global climate change or local factors such as urbanization or degradation of vegetation cover. An in-depth study of these trends would provide a better understanding of the underlying mechanisms, which in turn would help to better apprehend climate impacts in the region.

  8. 8.

    Deeper understanding of the data would lay the foundations for a more accurate interpretation of the climatic conditions specific to each location in Morocco. Further exploration, by comparing these data with other meteorological variables over a longer period, would be recommended for an in-depth analysis of climate trends.