1 Introduction

Drought is a recurring phenomenon and a pernicious natural hazard that occurs in nearly all climatic zones as a result of a seasonal or longer precipitation deficit. Global warming, rain inadequacy, low rain intensity and duration, low relative humidity, and other factors all play a part in the prevalence of drought (Zehtabian et al., 2013). Drought has a negative impact on human health, causes significant economic, social, and environmental losses, and often kills livestock, including humans (Han et al., 2012). Furthermore, variations in precipitation and temperature have a direct impact on the scarcity of surface runoff, leading to the depletion of both surface and groundwater (Praveen et al. 2020). Drought-related damages rank first among all natural disasters in China, and the United States spends 6 to 8 billion dollars a year on drought-related costs (Schubert et al. 2009). Drought affected approximately 38.09 million people in the Arab region between 1970 and 2009. (ACSAD and ISDR, 2011). Drought-related losses have been rising on a daily basis. That is why this phenomenon has piqued the interest of many researchers.

Drought comes in many forms, the most common of which is meteorological drought. Meteorological drought is typically described by comparing precipitation at a particular location and period with average rainfall at that location. Meteorological drought is caused by a lack of precipitation or by dry weather conditions in the region. When there is a meteorological drought, the consequences of a shortage of water on rivers are neglected, and instead a drop in rainfall is considered (Czerniak et al., 2020). It is eventually responsible for extreme hydrological imbalances in the affected regions, as well as significant declines in agricultural productivity, such as food production and agriculture, owing to a lack of adequate water supply (Talukdar and Pal 2017). The Middle East is one of the world's most drought-prone areas due to excessive heat and aridity. Since 1950 several regions of Asia, Africa, Europe, Australia, and the Americas have undergone longer and more severe meteorological droughts. Since 1970, insufficient precipitation, low relative humidity and adverse climate change have had a global impact on the drying trend, in particular in Arab regions, which have led to meteorological drought (Mallick et al., 2021).Saudi Arabia's freshwater availability has declined by 75% since 1950, with a further 50% projected to decrease by 2030 (Procházka et al., 2018). In Saudi Arabia, grazing land fell to around 57% (130 million hectares) of the overall (230 million hectares) area as result of widespread meteorological drought and the number of animals decreased considerably after the Second World War (Al-Taher, 1994). The herders of Saudi Arabia lost 50 to 60% of their cattle in drought between 1958 and 1966 (Allred, 1968). The decreased annual precipitation pattern is observed in most areas of Saudi Arabia, with the lowest precipitation in the Asir region (Tarawneh and Chowdhury, 2018). The winter precipitation is also forecast to be the lowest in Asir Province (Hasanean and Almazroui 2015). In Saudi Arabia, hydrological drought was the subject of most previous studies instead of meteorological drought (Mathivha et al., 2020). In this context, both of these reports reflect the analysis and prediction of meteorological drought in Saudi Arabia's Asir Region in order to mitigate the effects of drought.

To define the drought, a number of drought indices have been established (Uddin et al., 2020).The two most commonly used indexes are the standardized precipitation evapotranspiration index (SPEI) and the standardized precipitation index (SPI). SPI is used to define a region's meteorological drought state based on the likelihood of rainfall at any time scale (Shamshirband et al., 2020). Several previous researchers from around the world have used SPI to classify drought (Shamshirband et al., 2020; Islam et al., 2021). SPI output has been extensively assessed for many regions in various climate regions, with distinct results, such as in wet and arid regions in India (Pathak and Dodamani 2019), Bangladesh (Uddin et al., 2020), Uganda (Mulinde et al., 2016), Vietnam (Vu-Thanh et al., 2014), South Africa (Ndlovu and Demlie 2020), Poland (Czerniak et al., 2020), and Niger (Seybou and Acar, 2018). In the Asir region, where such research is rare, there is still a major research gap. The SPI-6 series was used to assess the meteorological drought in this study.

For investigation on drought effect and complexity, trend analysis is essential. There are many common trend detection techniques such as the Mann–Kendall (MK) test (Mann, 1945; Kendall, 1955), the Modified Mann–Kendall (MMK) test (Yue and Wang, 2004), the Trend Free Pre-Whitening Mann–Kendall (TFPW MK) test (Yue et al., 2003), the Sequential Mann–Kendall (SQMK) test (Sneyers, 1998), the Innovative Trend Analysis (Sen, 2012). There are some defects in the most often used and popular MK test, but scholars are now using methods that resolve MK test shortcomings like the MMK test, the SQMK test and the ITA test (Praveen et al. 2020; Mallick et al., 2021). Sen (2012) proposed ITA, which is widely used in water resource research. This technique was used by a number of researchers to study rainfall variations in different parts of the world (Caloiero, 2020). ITA is now looking at the trend of hydrological drought (Yilmaz, 2019). The SQMK test is widely used to detect sudden changes in major patterns (Sneyers, 1998; Rahman et al. 2017), and the MMK test is widely used to distinguish trends in hydrological and meteorological time series (Salam et al., 2019). There has been no study in the Arab Region using ITA, SQMK, and MMK approaches in drought-related research. The ITA, SQMK, and MMK tests were used to examine trends in meteorological drought in this study.

Periodicity analysis was used to examine time series data and forecast future patterns. Popular techniques for evaluating the periodicity of data from time series include Fourier transform (FT), Dynamic Time Warping (DTW), Wavelet Transform (WT), and others (Joshi et al., 2016). WT was used in the majority of previous studies to analyze the periodicity of time series data (Talukdar and Pal 2020), rainfall-runoff relationship (Labat et al., 2000), streamflow prediction (Bayazit et al., 2001), drought analysis and prediction (Maity et al., 2016; Wang et al., 2018). Several scientists have also used WT to evaluate and predict meteorological droughts in different parts of the world (Fang et al., 2018). For periodic evaluation of meteorological drought in the Asir area, the WT (morlet) method was used. The primary challenge in dealing with the situation and mitigating the effects of drought is drought forecasting. Many machine learning and ensemble machine learning algorithms-based forecasting models, such as ANN, support vector machine, random forest, bagging, and random subspace, have been used for drought prediction (Talukdar et al., 2020). Previous studies show that ensemble machine learning models outperform standalone machine learning algorithms for drought prediction (Talukdar et al., 2020). However, Islam et al. (2020) indicated that while researchers have developed, tested, and used several machine learning and ensemble machine learning algorithms for predicting various environmental components, there has been no general consensus on the best model for predicting environmental components. However, the high precision and efficiency of any model are dependent on the optimization and data types (Talukdar et al., 2020). Any model's efficiency can be improved by optimization. As a result, in the current research, we used an ANN model with particle swarm optimization (PSO) optimization to achieve improved efficiency in drought prediction. Including the fact that several researchers have already used combined ANN and PSO to forecast natural hazards in different parts of the world (Mallick et al., 2021a; Mallick et al., 2021b). They found really good performances. So far, only a few research have used PSO-ANN algorithms to estimate and forecast drought conditions; however, PSO-ANN has been commonly used in forecasting the stability of slopes in the event of an earthquake and short-term loading in power plants (Nguyen et al., 2019).

The present work includes comprehensive research on drought assessment (using SPI), monitoring (using ITA, the modified MK test, the sequential MK test, and wavelet analysis), and prediction (using the ANN model with PSO based optimization), which can be considered as all-round work. Furthermore, no researchers have used the modified MK test to evaluate drought trends. As a result, in the present study, we used not only the MMK test for the first time, but also the ITA and sequential MK tests to identify a trend in drought conditions. There have been very few studies on the periodicity assessment of drought using wavelet transformation, not just in Saudi Arabia but also around the world. To the best of the author's knowledge, no previous studies for drought estimation, tracking, and prediction have been undertaken in Saudi Arabia's Asir Region. To address the research gaps, the current study used SPI-6 to estimate short-term drought for agricultural management from time series rainfall datasets in the Asir region. The other aim was to use the MMK test, sequential MK test, ITA, and wavelet transformation to track the nature of drought conditions. The final aim was to predict drought conditions up to 2025 using an ANN model of PSO-based optimization.

Meteorological drought has a major effect on water resources and agriculture. As a consequence, accurate and high precision drought estimation, trend analysis, and forecasting can aid researchers and scientists in the fields of water resources management, food security, and future planning and management in a number of ways, such as past drought trends and high precision drought trend will help to devise strategies for agricultural management, as well as water resource management. Furthermore, drought forecasting for forthcoming days will assist in the future management of crops and water supply. Even the methods used in this study can be applied in the fields of hydrology and meteorology to produce high-quality results that can be used to develop plans.

2 Materials and methodology

2.1 Study area

The Kingdom of Saudi Arabia is divided into 13 provinces. Among the 13 provinces, the Asir region, a desert province, is a significant agriculture-dominated region that is also heavily affected by a lack of rainfall. Since 1980, the Asir area has experienced meteorological drought, which has had a significant impact on the province's agriculture and economy (Fig. 1). On the other hand, the Asir area is home to a large population of approximately 1913392 inhabitants. As a result, drought research in the Asir region, a desert province, is important to feeding its own population through agriculture production and controlling the economy. It also has a small number of surface water bodies. For these reasons, the Asir area has been chosen to undertake research on meteorological drought, which will assist in the production of water resource management and agriculture management plans. The area of Asir is situated in the southwestern part of Saudi Arabia, between latitudes of 17° 25′ north and 19° 50′ north and between longitudes of 50° 00′ east and 41° 50′ east. About 1,913,392 people lived in Asir in the area of 81,000 km2 (Mallick et al., 2021). This semiarid climate is present between Qunfudah and the Red Sea, as well as the valley of Propellants to the north and Vernier to the south (Jaber and Marzuki, 2018). Abha is the region's capital. In the Asir region, there are two rainy seasons. The main season lasts from March to April, with some summer rains. Geographically, the Asir region is situated in the tropics, with afternoon temperatures reaching 30°C even during the rainy season (Som and Al-Kassem, 2013). The diurnal temperature levels in the highlands are considered the largest in the country, and visibility in the morning is limited to 0% due to the frosty and foggy atmosphere (Mallick et al., 2021a). The annual rainfall can range between 300 and 500 mm. The Asir highland region is prone to high-intensity rainfall, and flash flooding occurs in some rural areas during the winter season (Mallick et al. 2018a). Cotton, wheat, coffee, barley, Senna, alfalfa, and fruit crops, vegetables, and palms are among its crops, which are often cultivated on steep terraced mountainside terraces. Aside from agriculture, cattle, goats, sheep, and camels raised in the area contribute to the local economy. Among all Saudi Arabian regions, the Asir region has the lowest rainfall, and rainfall trend analysis shows a downward trend in this region (Tarawneh and Chowdhury, 2018). This suggests that there is a serious meteorological drought in this providence. This will impede the production of maize, coffee, barley, Senna, alfalfa, and fruit crops, all of which contribute significantly to the region's economy, and may have a negative impact on the region's economy, biodiversity, and climate.

Fig. 1
figure 1

Location map showing the study area

2.2 Data sources and data quality control

With an average yearly precipitation of 80 to 140 mm, the Kingdom of Saudi Arabia is located in one of the world's driest areas. However some highland regions in the west and southwest of the Kingdom experience up to 500 mm of precipitation yearly because of convective events depending on topographical factors (Mallick et al. 2018b). Variability of spatial and temporal precipitation is very high for extreme weather conditions. Extreme precipitation incidents are likely to be more common than expected, especially in the Kingdom's south-west. The extremes from the southwest are far smaller than one might expect (Mallick et al. 2018b). Rainfall extent and incidence are primarily determined by climatic and topographic conditions. The southwest (highlands) of the Asir region gets unpredictable precipitation from the southwest monsoon, which brings wet oceanic winds. The elevation aspect, as seen in mountainous regions, is a major determinant of rainfall. In the Asir region of Saudi Arabia, traditional rain gauges are the prime source of precipitation data. This is one of the reasons why the distribution of metrological stations is highly unequal, with the majority of them clustered in the Asir region's south-west. The Asir region is occupied by 30 rain gauges constructed by Saudi Arabia's Ministry of Environment, Water, and Agriculture (MEWA). For the years 1970–2017 (47 years) with no missing values, MEWA provided monthly and annual rainfall data for these rain gauges. Because of various forms of error, the amount of precipitation measured by widely used gauge stations may be 10-30% or more less than the real amount. Since the rainfall gauge stations in the current study area are all in mountainous areas, rainfall measurement may be hindered by the wind, which usually produces a 2–10% error in rainfall measurement (Mallick et al. 2020). We used error-corrected rainfall datasets in this analysis. The error is adjusted by the general model originally developed by Legates and Willmott (1990) and originally suggested by WMO (1982).

The most effective activity prior to further statistical analysis is to identify and treat outliers in real-time series data. Since extreme values are always the highest and lowest, they may have an effect on other statistical analyses. We used the Grubbs test and Chi-Squared test in this analysis to identify outliers. Outliers detected in time series datasets may be viewed as missing values and these values have been treated using the imputation technique. The imputation method, on the other hand, substitutes missing values or outliers with substituted data derived from mathematical analysis. As a result, it generates a full dataset by excluding incomplete values and outliers. In the current analysis, however, we used an explicit model of imputation by mean to deal with outliers.

2.3 Meteorological drought estimation using SPI

The Standardized Precipitation Index (SPI) is a commonly used index for identifying and characterizing meteorological drought over time. SPI is used to estimate precipitation anomalies at a given area by comparing the measured average amount of precipitation over a period of interest to the long-term normal rainfall record over that period (Vu-Thanh et al., 2014). The historical record is fitted to the gamma distribution and then transformed to a regular distribution such that the mean SPI value for that location and time frame is 0.The positive SPI value indicates the excess rainfall and meteorological drought indicates the decrease of SPI below −1.0 (Silva et al., 2015). The SPI classification regarding the severity of the drought is shown in Table 1 (McKee et al., 1995). For a given X1, X2, Xn series standardized precipitation series, SPI is calculated from Eq. 1 (Omondi, 2014). “Assuming Xijas the seasonal precipitation at the ith station and jth observation, Ximas its long-term seasonal mean and σ as the standard deviation”,

$$ \mathrm{SPI}=\left({\mathrm{X}}_{\mathrm{ij}}-{\mathrm{X}}_{\mathrm{im}}\right)/\upsigma $$
(1)
Table 1 SPI value ranges for different meteorological drought conditions (McKee et al., 1995)

The present study measured and characterized meteorological droughts from 1970 to 2017 using a six-month standardized precipitation index (SPI-6) sequence. According to the World Meteorological Organization (2012), SPI has been measured for various precipitation accumulation cycles (usually ranges from 1 to 48 months, which can be termed as an indication). Different SPI indices show differing possible consequences of meteorological drought. The SPI-6 is a medium-term meteorological drought index that takes into account 6-month precipitation accumulation cycles. It is used to show the effect of drought on streamflow and reservoir capacity. The research area is situated in a semiarid zone with little water storages and experiences a heterogeneous pattern of short-duration rainfall. As a result, water storage is usually very small. However, as a result of climate change, the situation is deteriorating. The study region experiences meteorological drought, which has a significant impact on water storage. As a result, development initiatives have been slowed. Drought management is crucial in the current study to continue development activities and promote sustainable development. As a result, we selected SPI-6 as the medium drought for the study. The current research measured SPI with the “SPEI” package using R statistical tools (v 3.5.3).

2.4 Innovative trend analysis

The innovative trend analysis (ITA) approach was used to visualize various climatic data such as temperature, rainfall, relative humidity, and so on from hydrometeorological observations. Sen proposed ITA in 2012 (Şen, 2012) to transcend certain limiting premises in Mann–Kendall’s and Spearman's rho tests (Demir and Kisi, 2016). This approach separates time series into two similar sets and sorts them ascendingly. Equation 2 gives the ITA pattern indicator:

$$ \varnothing =\frac{1}{n}\sum \limits_1^n\frac{10{X}_j-{X}_i}{\mu } $$
(2)

where ⏀ is trend indicator; n is total observations; Xiis first subseries; Xjis second subseries; and μ is the value ofXi.

The two parts of data for this study are (1) 1970–1993 and (2) 1994–2017. There is no pattern in the time series when the data points are plotted on the perfect 45° line. If the data is above the line, the trend rising, and vice versa (Kişi et al., 2018). This ITA analyzed the drought pattern in the study area. The “trend change” package of R open-source software was used for the ITA of this analysis.

2.5 Modified Mann–Kendall test

The Modified Mann–Kendall test has been widely used to classify time series trends in hydrological, meteorological, and agrometeorological data. Yue and Wang (2004) developed the Modified Mann–Kendal (MMK) test, which they applied to simulated series of varying degrees of serial trend and correlations in order to eliminate the serial correlation effect in the Mann–Kendall test. Since the influence of the existing trend on sample serial correlation estimation has been effectively minimal, the MMK test allows a more precise measure of the importance of existing trends (Hamed and Rao 1997).The original equation of the MK test (Mann, 1945, Kendall, 1955) statistics (S) is expressed by following Eqs. 34:

$$ S=\sum \limits_{i=1}^{n-1}\operatorname{sgn}\left({X}_j-{X}_i\right) $$
(3)
$$ \operatorname{sgn}\left(\theta \right)=\Big\{{\displaystyle \begin{array}{ccc}1& if\theta >& 0\\ {}0& if\theta =& 0\\ {}-1& if\theta =& 0\end{array}} $$
(4)

Values of S indicate the direction of decreasing or increasing trend. The variance (Rahman et al. 2017) of S is followed by the supplementary Eqs. 13:

Test statistic Z is calculated by following Eq. 5:

$$ Z=\Big\{{\displaystyle \begin{array}{c}\frac{S-1}{\sqrt{V^{\ast }(S)}}S>0\\ {}0S=0\\ {}\frac{S+1}{\sqrt{V^{\ast }(S)}}S<0\end{array}} $$
(5)

Positive Z values mean increasing trend, and negative Z values mean decreasing trend. “modifiedmk” package of the R statistical software (v3.5.3) was used for performing the MMK test.

2.6 Sequential Mann–Kendall test

In every trend detection analysis, it's vital to keep note of when a trend began and how it evolved over time. The sequential MK (SQMK) test (Sneyers et al., 1998), which is a progressive and retrograde analysis of the Mann–Kendall test, yields sequential values u(t) and u'(t). These are standardized variables with a unit standard deviation and a zero mean. As a result, its sequential activity oscillates near zero. The SQMK on time series xi identifies known event or shift points in long-term time series. The SQMK is calculated using rank values, yi of the original values in analysis “(x1, x2, x3,…….,xn). The magnitudes of yi (i=1, 2, 3,….,n) are compared with yj, (j= 1, 2,3,..., i-1)”. For each comparison, “the cases where yi>yjare counted and represented by ni. The mathematical description can be found in supplementary file Section 2.6: “trendchange” package of the R statistical software (v 3.5.3) was used for the SQMK test.

2.7 Wavelet transformation (WT)

For periodicity analysis, this study used the WT method. In drought modeling, periodicity can be described as a propensity to be recurrent or periodic at regular intervals. WT is a mostly used method in hydrological time series for detecting periodicity. A wavelet is a small wave in space of a finite length having a mean of zero. The WT method employs a flexible window function that can be dilated and shifted to match the time and frequency domain (Joshi et al., 2016). The continuous wavelet trend (CWT) model is mostly used for the study of the periodicity of the hydroclimate time series due to its effective results. For specific wavelet families, the Morlet wavelet is used because it can effectively delineate the characteristics of hydroclimatic variables (Joshi et al., 2016). Given a time series “X (t) the CWT time-frequency transformation\( {C}_{\psi}^x\left(a,\tau \right) \)” using the Morlet wavelet, is given by the following Eq. 6:

$$ {C}_{\psi}^x\left(a,\tau \right)=\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$\sqrt{a}$}\right.\underset{-\infty }{\overset{+\infty }{\int }}X(t)\psi \ast \left(\frac{t-\tau }{a}\right) dt $$
(6)

Here,

ψ∗ Complex conjugate of the mother wavelet ψ(t)

ttime

a The scale parameter

τ Time step

Considering ω as dimensionless frequency and η as time parameter, Morlet wavelet can be expressed as (Chen et al. 2016)

$$ \psi \left(\eta \right)={\pi}^{-0.25}\exp \left( i\omega \eta -0.5{\eta}^2\right) $$
(7)

Considering ωoas the central frequency of the mother wavelet, the Fourier transforms of the Morlet Wavelet is

$$ \psi \left(\omega \right)=\mathit{\exp}\left(-\frac{{\left(\omega -{\omega}_0\right)}^2}{2}\right) $$
(8)

This morlet wavelet analysis was done by the R software (v 3.5.3) using the “biwavelet” package.

2.8 Prediction and forecasting of meteorological drought using swarm intelligence embedded neural network

Previous research has shown that ensemble machine learning algorithms outperform standalone machine learning algorithms when it comes to forecasting environmental components (Islam et al., 2020). Many researchers believe that if standalone machine learning algorithms are optimized, they will perform equally with ensemble machine learning algorithms. The optimized machine learning algorithm will achieve results with extremely high precision and robustness (Nguyen et al., 2019). According to Islam et al. (2020), no general consensus on the best machine learning algorithms for natural disaster prediction has been found. In the other hand, the ANN model is a commonly used and highly effective model (Colak et al., 2015). Similarly, the PSO optimization technique is a well-known and successful optimization technique. As a result, based on previous literature regarding the very good performance of ANN and PSO models, we combined both ANN and PSO models in the current analysis to obtain very good prediction results. The following is a description of the theoretical basis of both methods:

2.8.1 Particle swarm optimization

Particle swarm optimization (PSO) is one of the most important and stochastic optimization methods of swarm intelligence proposed by Eberhart and Kennedy (1995). This evolutionary method was inspired by the behavior of bird’s folks or schools of fish looking for food. PSO improves the particle sampling process and optimizes the sample distribution and accelerates the particle set convergence (Ning et al. 2019). PSO seeks to optimize random solutions for a population. Each particle has a position and velocity which represent the solution to the problem of optimization and search direction in the search space. Particles change velocity and location based on their best experience. The algorithm calculates the local best individually found by each particle and the global best known to the entire swarm. This model is used widely in time series forecasting and has been recently emerging. For more information about PSO, the readers are referring to (Eberhart and Kennedy 1995). PSO was shown to increase the performance of various hybrid machine learning approaches by modifying model parameters in hydrological applications.

2.8.2 Artificial neural network

Time series forecasting is a technique to predict events over a time span. Several predictive models have been proposed to find an appropriate approach which can be implemented in realistic circumstances (Colak et al., 2015). An artificial neural network (ANN) is the component of artificial intelligence, which is used to pattern recognition, handwriting recognition, face recognition, autopilot, robotics, etc. and mostly in weather forecasting or to predict events (Liu et al. 2020). ANN can model nonlinear and complicated equations using a variety of training input–output data obtained from numerical results (Kaushik et al., 2015). Among various ANN models, Feed-forward model is the most used time series forecasting model that comprises a unit system analogous to neurons arranged in layers (Djerbouai and Souag-Gamane 2016). Feed forward model and multilayer perceptron (MLP) is the most popular methods in the hydrology and water resource and management related research. As MLP is a most used model, readers can follow (Zadeh et al., 2010) and (Rezaeianzadeh et al. 2016) for more information about MLP. The optimal network architecture was determined and then the ANN model was trained and tested.

2.9 Validation of the predicted meteorological drought

2.9.1 Pearson's correlation coefficient

The Pearson correlation coefficient (r) was used to validate the correlation between observed and predicted drought. Following Eq. 9 used as the calculation statistics of the Pearson correlation coefficient (Kumar and Chong, 2018).

$$ r=\frac{\sum_{i=1}^n\left({A}_{i,m}-A{\prime}_{i,m}\right)\times \left({A}_{i,e}-A{\prime}_{i,e}\right)}{\sqrt{\sum_{i=1}^n{\left({A}_{i,m}-A{\prime}_{i,m}\right)}^2}\times \sqrt{\sum_{i=1}^n{\left({A}_{i,e}-A{\prime}_{i,e}\right)}^2}} $$
(9)

Here, Ai, m, Ai, e, and n, respectively, are the observed ith meteorological drought, predicted ith meteorological drought and total observations. Ai, m and Ai, e are the mean observed and predicted meteorological drought. Higher r values indicate more accuracy of the models.

2.9.2 Error measures

There are five statistical indicators were used for validating the meteorological drought which is root mean square error (RMSE) and mean absolute error (MAE), mean absolute percentage error (MAPE) , mean squared error (MSE) and root relative squared error (RRSE) . The following equations express the original form of these statistical indicators (Eq. 10 to Eq. 14):

$$ RMSE=\sqrt{\frac{1}{n}\sum \limits_{i=1}^n{\left({A}_{i,m}-{A}_{i,e}\right)}^2} $$
(10)
$$ MAPE=\frac{1}{n}\sum \limits_{i=1}^n\mid \frac{A_{i,m}-{A}_{i,e}}{A_{i,m}}\mid $$
(11)
$$ MAE=\frac{1}{n}\sum \limits_{i=1}^n\mid {A}_{i,m}-{A}_{i,e}\mid $$
(12)
$$ MSE=\frac{1}{n}\sum \limits_{i=1}^n{\left({A}_{i,m}-{A}_{i,e}\right)}^2 $$
(13)
$$ RRSE=\sqrt{\frac{\sum_{i=1}^n{\left({A}_{i,e}-{A}_{i,m}\right)}^2}{\sum_{i=1}^n{\left(\overline {A_{i,e}}-{A}_{i,m}\right)}^2}} $$
(14)

where, Ai, m, Ai, e, and n, respectively, are the observed meteorological drought, predicted meteorological drought and total observations. Higher values of RMSE, MAE, MAPE, and MSE indicate the lower performance of the models. On the contrary, higher values of RRSE indicate higher performance accuracy.

These statistical errors were conducted by the R open-source software (v 3.5.3) with the “metrics” package. All the mapping of statistical error values and forecasted values were done by using “ArcGis 10.5” with kriging interpolation method.

3 Results and analysis

3.1 Outlier detection and treatment

In time series data, outlier detection has been commonly utilized to detect anomalies or extreme values. In this analysis, error-corrected time series annual rainfall data has been used from 30 meteorological stations from 1970 to 2017. Following that, the Grubbs test and the Chi-squared test have been performed to identify outliers in the data. To validate the findings of outliers, two outlier identification methods were used. Supplementary Table 1 revealed that all 30 stations reported to have outliers in their time series data sets. With the exception of station number 28 (which had the lowest value as an outlier), the highest value as an outlier was held by 29 meteorological stations. 29 outliers have been excluded from the time series rainfall data sets of 29 stations (Supplementary Table 1). Both tests' p values revealed the statistical model's significance level. Grubbs' test results for 15 stations (12–15, 21, 23, 25, 27–31, 34, 514–533) became noteworthy at the <10% level, while Grubbs' test results for the remaining stations became substantial at the <5% level (Supplementary Table 1). In the Chi-Square test, the findings for all stations have been substantial at the <5% level (Supplementary Table 1). After finding outliers for all meteorological stations utilizing Grubbs' and Chi-Square measures, we used imputation by mean technique to replace the outliers with replacement values, resulting in effective and consistent data. The imputed datasets were then subjected to further analysis.

3.2 Meteorological drought analysis

This study assessed the short-term drought situation (SPI-6) in Saudi Arabia's Asir area (Fig. 2, Supplementary Figs. 1a–b). Drought scenarios ranging from mild to moderate to extreme were discovered in the study area. To be confirm about the meteorological drought, the satellite image-derived indices, such as normalized difference vegetation index (NDVI) and normalized difference water index (NDWI), were used. These satellite-derived indices have also been considered as agricultural drought. In the present study, the meteorological drought data for the year of 2018 of 32 meteorological gauge stations were compared with the same location of satellite image-derived indices. It was found that NDVI has highly negative correlation with meteorological drought conditions (r: –0.32), indicating that agricultural conditions has also been hampered due to prevalence of meteorological drought. In case of NDWI, near the location of gauge stations, no surface water bodies’ sources were available; therefore, very high negative correlation persists between them, indicating the dominance of meteorological drought in the study area. Therefore, it is confirmed that the study area has experienced meteorological drought over time. During the study period, 22 stations (13, 14, 15, 18, 20, 21, 27, 28, 30, 31, 32, 34, 38, 46, 60, 68, 77, 514, 516, 533, 534, and 538) out of 30 stations encountered all forms of drought (mild, moderate, severe, and extreme) (Fig. 2, Supplementary Figs. 1a–b). In March 1984, station 28 reported the highest SPI values (–4.94) with extreme drought. Eight stations (12, 22–26, 37, 65, and) were affected by three forms of drought: mild, moderate, and severe (Fig. 2, Supplementary Fig. 1a). During the period 1970–2017, stations 15, 18, 533, and 31 endured extreme drought (Fig. 2, Supplementary Fig. 1b). Station 13 saw the most extreme droughts (19 times). The intense meteorological drought was reported 14 times by station 533; 9 times by station 538; 8 times by stations 15, 28, and 38; 7 times by station 21; 6 times by stations 30 and 534; 4 times by stations 14, 18, 27, and 32; 3 times by stations 20, 31, and 68; 2 times by stations 34, 60, 77, and 516; and once by stations 46 and 514. The majority of the severe and extreme droughts were reported between 1980 and 2000. During the study time, the study region experienced extreme to moderate meteorological drought.

Fig. 2
figure 2

Short-term meteorological drought estimation using standard precipitation index-6 for twelve stations (station numbers 12–26).

3.3 Trend analysis of meteorological drought using ITA

ITA investigated the meteorological drought pattern in Saudi Arabia's Asir region (Table 2 and Supplementary Fig. 2). The meteorological drought trend was 99% (p<0.01) significant at all 30 stations (Table 2). Just one station (station 26) displayed a substantial positive trend of SPI-6 (s value 2.49) suggesting a declining trend of drought conditions in Asir. Station 23 (s value −88.60) has the fastest increasing rate of drought. The rate (slope) of drought rising and declining trend ranged from 0.000073 to −0.0033. (Table 2).Graphical presentation of ITA found in the Supplementary Fig. 2. In recent times (high stage), 4 stations (20, 23, 26, and 538) showed a decreasing trend of drought condition. 10 stations (13, 18, 26, 27, 28, 30, 37, 65, 68, and 534) showed no significant increasing or decreasing trend of drought condition in recent times (high stage). 16 stations showed a significant increasing trend of drought in high stages. 10 stations (14, 15, 21, 31, 32, 38, 46, 60, 514, and 516) showed a significant increasing trend of drought in all stages (high, medium, and low). Stations 14, 31, 32, 46, 60, and 516 showed a monotonic increasing trend. Overall, an increasing trend of meteorological drought condition was dominant in the study area during 1970-2017.

Table 2 Station-wise trend indicator of ITA, slope of ITA, and MMK test results of meteorological drought of Asir from 1970 to 2017

3.4 Trend analysis of meteorological drought using the MMK test

Table 2 displays the findings of the Mann–Kendall (MMK) test. Three stations out of thirty showed a major positive trend in SPI-6, suggesting a declining drought trend. Stations 23 and 27 showed a positive trend of SPI-6 with a confidence level of 99% (p<0.01), while station 26 showed a positive trend of SPI-6 with a confidence level of 95% (p<0.05). In the Asir region of Saudi Arabia, a total of 27 stations showed a major decreasing trend of SPI-6, signaling a growing trend of meteorological drought. Just one station (station 34, Z value −1.65) showed a 90% (p<0.1) significant growing trend, one station (station 28, Z value −3.06) showed a 95% (p<0.05) significant increasing trend, and the remaining 25 stations showed a 99% (p<0.01) significant increasing trend of drought. In Asir, a major growing trend of drought scenarios was dominant.

3.5 Trend analysis of meteorological drought using the SQMK test

The Sequential Mann–Kendall (SQMK) test was employed in the present study for detecting the abrupt change of meteorological drought in Asir (Fig. 3, Supplementary Fig. 3a–b). Dash line in horizontal direction indicates the 95% significance level. The vertical axis of the graphs represents the Z values of the SQMK test. No significant increasing or decreasing trend in very recent times found in stations 22, 26, 28, 30, 34, and 77 as the prograde and retrograde line converse themselves inside the dashed line (Fig. 3, Supplementary Fig. 3b). Prograde and retrograde line of stations 12, 13, 14, 15, 18, 20, 21, 23, 24, 25,27, 31, 32, 37, 38, 46, 60, 65, 68, 514, 516, 533, 534, and 538 clearly cut each other in the years of 1983, 1998,1998, 2005, 2005, 2000, 2010, 1985, 1983, 2007, 2009, 1982, 2010, 1986, 1982, 1985, 2001, 2002, 1990, 1978, 1982, 1986, and 2005, respectively, which indicates abrupt change of drought of Asir region was started from these years. Extreme abrupt change was found in 9 stations as 12, 13, 18, 32, 38, 514, 533, 534, and 538 in recent times. Overall, a significant drought increasing trend was found by the SQMK test.

Fig. 3
figure 3

Trend detection of meteorological drought using sequential Mann–Kendall test for Asir region of Saudi Arabia

3.6 Periodicity analysis

This study performed the station-wise wavelet analysis for detecting the periodicity and temporal variation of meteorological drought in Asir (Fig. 4, Supplementary Fig. 4a–b). Wavelet power spectrum shows the actual oscillation of individual waves for the SPI-6. While the contour line indicates the cone of influence which areas are free from edge effects. In the side of each graph, there is a vertical scale which shows the power of the wavelet spectrum. Deep red color indicates the high power of the wavelets and blue color indicates the low power of the wavelets. Significant (95%, p<0.05) drought period is surrounded by a bold black line. Nine stations (12, 13, 21, 22, 23, 24, 27, 533, and 534) showed significant drought period both inside and the outside of the cone of influence (Fig. 4, Supplementary Fig. 4b). 2 stations (18 and 516) showed significant drought periods outside the cone of influence. Station 34 showed no significant drought period. 4 stations (28, 38, 46, 77, and) experienced 3 times significant drought during the study period. There were two significant drought periods found in 13 stations (12, 14, 15, 20, 25, 26, 30, 31, 37, 60, 68, 533, and 538) during 1970–2017. 9 stations (13, 21, 22, 23, 24, 27, 65, 514, and 534) experienced one time significant drought period. Maximum significant period occurred in 2–6-month band. Significant prolonged drought period (10 years or more) occurred in stations 14 (3–10 band), 22 (3–10 band), 23 (7–14 band), 26 (2–6 band), 28 (4–10 band), 31 (2–4 band), 37 (5–10 band), 68 (2–4 band) and 514 (4–7 band) from the time span of 1972–1985, 1985–2005, 1985–2003, 1996–2010, 1972–1987, 1982–1993, 1989–2002, 1983–1993, and 1990–2004, respectively.

Fig. 4
figure 4

Periodicity analysis of meteorological drought using Morlet Wavelet Transformation for Asir region during 1970–2017

3.7 Prediction of meteorological drought and accuracy assessment of the model

The current study integrates the particle swarm optimization (PSO) technique with the ANN to improve the performance of time series SPI-6 prediction in the Asir area of Saudi Arabia from 1970 to 2017. In the present study, the performance of the ANN model has been optimized by PSO algorithms, which in turn predicts the drought very well rather than simple ANN model. The optimization process can help to find the best model parameters of the ANN model; therefore, it would perform very well in any field. In the present study, the time series historical meteorological drought has been predicted before forecasting of drought for incoming days. If the prediction of historical drought had very low or acceptable error between actual meteorological drought and predicted meteorological drought, the model with same configuration can be used for forecasting of future days drought. If the error between actual and predicted meteorological drought is high or unsatisfactory, then the model should be configured and performed again. The time series plot displays the actual SPI-6 and projected SPI-6 values for each station (Supplementary Fig. 6). All stations demonstrated that the expected SPI-6 values were very similar to the observed SPI-6 values (Supplementary Fig. 6). Pearson’s correlation was used to analyze the relationship between actual and predicted SPI-6 values. Many of the stations demonstrated a very close association between predicted and actual SPI-6 values (Fig. 5 and Supplementary Fig. 5). Twenty of the thirty stations produced correlation coefficients (r values) of about 0.98. The strongest correlation (r-value = 0.99) was found between actual SPI-6 and predicted SPI-6 at 10 stations (12, 31, 37, 68, 77, 514, 516, 533, 534, and 538). Both the time series plot (Supplementary Fig. 6) and the correlation by scatter plot (Fig. 5) revealed an increasing trend of meteorological drought in Saudi Arabia's Asir area.

Fig. 5
figure 5

Scatterplots of the observed and predicted meteorological drought by ANN-PSO hybrid learning algorithms for Asir region during 1970–2017

The performance of drought prediction was evaluated using five statistical indicators. Lower error values imply greater output precision. Supplementary Table 2 displays the station-wise error values. Figure 6 represents the spatial distribution of the prediction error values. The majority of the stations (20 in total) produced MAE ranging from 0.10 to 0.14. ( Supplementary Table 2). MAE values ranged from 0.160 at station 34 to 0.089 at station 37 (Fig. 6a). The root mean square error (RMSE) varied from 0.221 (station 28) to 0.1259 (station 37) (Fig. 6b). The majority of the stations (22 stations) produced RMSE within the range of 0.16–0.20. (Fig. S1). The spatial distribution of MSE is depicted in Fig. 6c. MSE values ranged from 0.049 (station 28) to 0.0158. (station 37). MSE was provided by the majority of stations (24 stations) in the range of 0.025–0.040 (Table S1). MAPE values ranged from 706.77 (station 14) to 41.4 (station 534) (Fig. 6d). The majority of the stations (26 stations) produced MAPE values between the ages of 42 and 86 (Supplementary Table 2).

Fig. 6
figure 6

Spatial distributions of test statistics, such as a MAE, b RMSE, c MSE, d MAPE, and e RRSE of the PSO-ANN based hybrid model for prediction of meteorological drought of Asir region

Station 26 has the highest performance (RRSE of 40.08), and station 24 has the worst performance (RRSE is 34.88). RRSE yielded findings greater than 30 (Fig. 6e). The RMSE, MAE, and MSE all generated values less than one. All of these discussions show that PSO-ANN's accuracy in predicting meteorological drought (SPI-6) in Asir was highly reliable, satisfactory, and preferable.

3.8 Forecasting of meteorological drought

Forecasting of meteorological drought conditions of the Asir region of Saudi Arabia for the period of 2018–2025 was performed by using the PSO-ANN ensemble learning algorithm (Fig. 7 and Supplementary Fig. 7). Time series plot of forecasted values of SPI-6 is presented by Fig. S3. No extreme drought event will occur during 2018–2025 in any station. Two stations (stations 13 and 533) will be affected by prolonged (2018–2025) severe drought (SPI values range from –1.50 to –1.99) events. 4 stations (stations 18, 31, 534, and 538) will experience moderate drought (SPI values range from –1 to –1.49) from 201 to -2025. During 2019–2020 and 2023–2025, moderate drought will occur in station 14. During 2020–2021 and 2024–2025, moderate drought will occur in station 37. Both highest SPI value (–1.81) and lowest SPI value (0.245) will be recorded in 2025 (Fig. 7h). Mild to severe levels of drought will occur in the Asir region of Saudi Arabia in the recent upcoming years (Fig. 7).

Fig. 7
figure 7

Forecasting of meteorological drought of Asir region for incoming years, such as a 2018, b 2019, c 2020, d 2021, e 2022, e 2023, f 2024, and h 2025 using PSO-ANN-based hybrid model

4 Discussion

The current research estimated the SPI-6 index to measure the meteorological drought condition of Saudi Arabia's Asir area from 1970 to 2017. Throughout the study period, 22 stations were affected by different forms of drought (mild, moderate, severe, and extreme). The majority of the severe and extreme droughts were reported between 1980 and 2000. Extreme to moderate meteorological drought was prevalent, but the research region experienced mild to extreme drought during the study time. Amin et al. (2016) investigated whether the Kingdom of Saudi Arabia had experienced sustained and severe drought events between 1950 and 2013, as revealed by SPI, which is analogous to the current research. Using SPI-3, SPI-6, SPI-12, and SPI-24, Awchi and Kalyana (2017) stated that Iraq experienced frequent and severe drought from 1937 to 2010 as the Asir region. Using SPI-3 and SPI-6, Rahman and Lateh (2016) discovered that the south-west, north-west, and western portions of Bangladesh were the most vulnerable to meteorological drought. Fu et al. (2018) discovered, using SPI-3, that China's Heilongjiang province experienced extreme drought from 1958 to 2013, which is consistent with the findings of this research. Salam et al. (2021) reported that the lower Teesta River Basin of Northern Bangladesh has been subjected to extreme drought for an extended period of time, which is identical with the present work. To detect the drought trend, the ITA, MMK test, and SQMK test were used. Just one station (station 26) showed a declining pattern of drought condition, despite the fact that all of the stations showed a 99% significant trend. The MMK test showed a strong (p<0.01, p<0.05, and p<0.1) increasing trend of 27 stations' drought. The SQMK test revealed an extreme sudden shift in trend at 9 stations (12, 13, 18, 32, 38,514, 533, 534, and 538). Both of the ITA, MMK, and SQMK tests revealed that the trend of Asir's meteorological drought has greatly increased. Mallick et al. (2021) used several trend identification methods in the same research area to detect the trend in annual rainfall and discovered that most gauge stations had detected a strongly negative trend in annual rainfall, suggesting that the negative rainfall trend had a direct impact on the meteorological drought. The current study also revealed an increasing tendency of meteorological drought over time, indicating that the current study and the analysis of Mallick et al. (2021) had a strong correlation since rainfall is the key parameter of meteorological drought. As a result, this analysis can be trusted and used for future studies and water resource management. Tosunoglu and Kisi (2017) used the MMK test and ITA to assess the drought trend of Turkey's Crouch River basin and discovered an increasing trend of drought, which is close to the findings of this analysis. Caloiero (2018) used ITA to prove that drought in New Zealand had a heavier trend (extreme meteorological drought) in both the short-term and long-term analyses. Mazhar et al. (2015) discovered similar findings in Sindh and Balochistan, Pakistan, where the meteorological drought trend increased. Raude et al. (2018) discovered, using the Mann–Kendall (MK) test, that the meteorological drought in the Tana River basin's south-eastern region increased from 1980 to 2016. Almazroui et al. (2013) used MK tests to discover that in recent years (1998-2010), Saudi Arabia has undergone an increasing trend of warming, resulting in an increased drought scenario, which is similar to this research. Caloiero et al. (2019) used ITA to account for the declining trend of rainfall in Calabria, Southern Italy, suggesting a growing risk of drought, which is consistent with the results of this research. Rahman et al. (2017) discovered an abrupt trend turning point of rainfall in Bangladesh using the SQMK measure, and the current analysis discovered an abrupt trend turning point of meteorological drought. Using SQMK, Nasri and Modarres (2009) discovered the sudden shift of dry spells in Iran's Isfahan province. The Morlet wavelet transformation was used to detect the periodicity of the drought at 30 Asir area stations. Station 34 had no major drought period. Drought had been registered at 9 stations (14, 22, 23, 26, 28, 31, 37, 68, and 514). The most important (p<0.05) duration was in the 2–6-month span. Baidu et al. (2017) discovered a substantial decreasing trend of annual rainfall in a 4–8-month band in Ghana from 1901 to 2010 using morlet wavelet transformation, suggesting a growing trend of drought events there. Sharma and Goyal (2020) discovered no substantial periodicity of drought in India using continuous wavelet transform (CWT) and discrete wavelet transform (DWT), which contradicts the findings of this research. Using wavelet transformation, Abdourahamane and Acar (2018) discovered an important (p<0.05) periodicity of drought from 2 to 32 years at 6 of 13 stations in Niger. Li et al. (2020) used cross wavelet transformation to investigate the meteorological drought periodicity in China's Henan province, which happened on a scale of 2–4a.

For the drought prediction, PSO-ANN learning algorithm was used. All stations produced SPI-6 predicted values very similar to the actual SPI-6 values. As for 10 stations and 20 stations, the association between the actual SPI-6 and the predicted SPI-6 was very high (r = 0.99) and strong (r = 0.98). The satisfactory performance of the PSO-ANN was seen in MAE, MSE, RMSE, MAPE, and RRSE for SPI-6 prediction. For the assessment of the earthquake induced landslide in China, the PSO-ANN algorithm was used by Xi et al. (2019) and preferred findings like this study. PSO-ANN was used by Gordan et al. (2016) to forecast earthquakes slope stability and it observed preferred findings with a 0.986 r square value close to the present analysis. For the prediction of short building's response during seismic activity, Nguyen et al. (2019) used the PSO-ANN algorithm. In seismographic operations, Rukhaiyar et al. (2018), which used the PSO-ANN model, also forecast slope stability with adequate results.

Using the PSO-ANN algorithm, the current study predicts the drought for the next eight years, from 2018 to 2025. Drought forecasting revealed that the Asir region of Saudi Arabia will face mild to severe drought conditions in the coming years. Abdullah et al. (2014) forecasted short-term power system loading using a PSO-ANN hybrid approach to obtain more reliable data. ShangDong and Xiang (2006) used the PSO-ANN model to predict short-term loading in China's power grid stations. Another significant explanation for using SPI-6 data is that the primary aim of this analysis is to understand the impact of drought on agriculture (as only SPI-6 data can be used to examine the agricultural effects of drought, and the related agricultural management is also based on SPI-6 data) and to take necessary and successful steps for sustainable agricultural management.

Based on the discussion so far, it is possible to conclude that drought estimation using rainfall data offers useful knowledge regarding drought conditions in data-scarce regions such as Saudi Arabia. As a result, many trend detection methods, which have very high precision and good performance, were used to obtain an overall understanding about the trend of time series meteorological drought. These results will assist planners and scientists in developing strategies for agriculture management and water resource management because hydrology and agricultural production are directly affected by them. Authorities and planners should rely on the new results since the study used extremely advanced methodological methods and its findings have been compared with prior research in the study field. In the other hand, predicting drought for upcoming days using ensemble machine learning algorithms that work well will help to devise future strategies to fix future water resource management and agriculture management under climate change conditions. As a result, the current research can be replicated in other study areas to estimate, track, and forecast meteorological drought, which will aid in the formulation of global water resource management.

5 Conclusion

Normally, the Asir region of Saudi Arabia suffers from a lack of rainfall. This area is well-known for its farming activities on a local level. The current study used short-term SPI-6 data from 1970 to 2017 to measure the meteorological drought status of this area. Throughout the research time, the study region endured significant moderate to extreme drought conditions, according to the results of this study. In March 1984, the most intense drought (SPI value −4.94) occurred at station 28. The drought trend was detected using three common and commonly used trend detection techniques (ITA, the MMK test, and the SQMK test). ITA discovered a 99% important growing trend of drought by 29 stations out of 30. According to the MMK test, the majority of the stations (27 stations) demonstrated a slightly (p<0.01, p<0.05, and p<0.1) increasing trend of drought. The SQMK test reported abrupt trend turning points in all stations, with 9 stations (stations 12, 13, 18, 32, 38, 514, 533, 534, and 538) revealing drastic trend turning points. From 1970 to 2017, Asir witnessed a large rise in drought. Morlet wavelet transformation periodicity research revealed 9 stations (12, 13, 21, 22, 23, 24, 27, 533, and 534) with major drought events both inside and outside the cone of influence. Stations 14, 22, 23, 26, 28, 31, 37, 68, and 514 endured major long-term drought events. Drought prediction by PSO-ANN revealed that forecast SPI-6 values were roughly identical to real SPI-6 values. Pearson’s correlation showed a very good correlation (r value range from 0.98 to 0.99) between actual and predicted SPI-6 values for all stations. PSO-ANN forecasted the next eight years (from 2018 to 2025) and discovered that the Asir region of Saudi Arabia will face moderate to severe drought events in the future. All of these findings will aid agricultural planners in developing accurate plans for the long-term management of agriculture in Asia. The present work can help scientists and planners to formulate plans for water resource management and agricultural management for present time based on analyzing historical data and present time data. On the other hand, future direction of drought conditions using different trend detection techniques can help to be ready for future management of water resources and agriculture. In the present study, future data of drought conditions also have been predicted, which will directly help to the planners to be get ready for future policy formulation.

Furthermore, the present study has some limitation, such as the study area is covered by 81,000km2, but only 32 meteorological gauge stations were installed. Therefore, the study area observes data scarcity. For getting more reliable results for formulation of detailed management plans, more data evenly distributed in the study area is needed. For future forecasting, ensemble machine learning can also under perform sometimes. Therefore, the future research can be conducted to improve the study by using satellite images like TRMM and CHRIPS data, which will provide pixel or grid wise rainfall data. Therefore, rainfall data from each and every points can be obtained, which in turn provides more detailed information for policy formulation. In addition, recently, deep learning algorithms can perform better than standalone and ensemble machine learning algorithms. Therefore, application of deep learning can provide more reliable information for policy implication.