Introduction

Prevention and control of river nitrogen and phosphorus pollution is one of the key issues to achieve sustainable river basin planning and management (Reichwaldt & Ghadouani, 2016; Srinivas et al., 2020). While the effectiveness of the prevention and control depends on the accurate identification of main influencing factors of pollution. Previous studies shows that the concentration of nitrogen and phosphorus in streams are regulated by a complex suite of anthropogenic activities and natural attributes (Dupas et al., 2018; Hobbie et al., 2017; Liu et al., 2018; Outram et al., 2016; Pathak et al., 2018; Pennino et al., 2016; Xia et al., 2018). However, the relative importance of different influencing factors varies in different studies especially for the upper reaches of rivers. To identify the main influencing factors which affect the spatiotemporal variation of nitrogen and phosphorus in the upper reaches of rivers, it is essential to analyze based on key physical processes. In general, the spatiotemporal variation of nitrogen and phosphorus in riverine water is driven by three key processes (Guo et al., 2019) (Fig. 1): (1) Source: the amount of the constituent within the catchment. Different land use types and socioeconomic development factors (such as the distribution of population, livestock and gross regional domestic product) are related to source and load of nitrogen and phosphorous (Li et al., 2020). (2) Mobilization: the detachment of these constituents from the source, due to weathering, erosion or biogeochemical process. The precipitation or streamflow influences the mobilization of constituents in the catchment (Mellander et al., 2015). Different land use types may cause different biogeochemical processes of nitrogen and phosphorous (Pellerin et al., 2004; Zhou et al., 2012). The basic physical and chemical parameters of water quality such as pH, DO, and CODMn influence the transformation and mobilization of nitrogen and phosphorus in rivers (Shi et al., 2016; Zhang et al., 2011). (3) Delivery: the transport of mobilized constituents from the catchment to receiving waters. The precipitation or streamflow affects the temporal variability in the delivery of the constituent to receiving waters (Guo et al., 2019). Land use types conversion significantly impacts hydrological variables, and landscape patterns affect the transport rates of allochthonous material, which both influence the transportation of nitrogen and phosphorous (Nielsen et al., 2012; Xu et al., 2019a, b). Topographic characteristics, such as elevation and slope, partly determine the transport path of pollutants from diffuse sources to rivers, especially on slope (Shi et al., 2016).

Fig. 1
figure 1

Schematic diagram of the key processes which drive the spatiotemporal variation of nitrogen and phosphorus in river

Some scholars have carried out investigations based on the identification of the abovementioned key physical processes. The impacts of basic physical and chemical parameters of water quality (Shi et al., 2016; Zhang et al., 2011), precipitation or runoff (Guo et al., 2019; Nobre et al., 2020; Shi et al., 2016), land use (Ai et al., 2015; Alvarez-Cobelas et al., 2008; Jabbar & Grote, 2019; Nobre et al., 2020; Rodrigues et al., 2018; Shi et al., 2016; Xu et al., 2019b), landscape patterns (Ai et al., 2015; Li et al., 2020; Nobre et al., 2020; Xiao et al., 2016; Xu et al., 2019a), topography (Jabbar & Grote, 2019; Shi et al., 2016), and socioeconomic development (Alvarez-Cobelas et al., 2008; Rattan et al., 2017; Wang et al., 2019) factors on the spatiotemporal variation of nitrogen or phosphorous were analyzed. However, the existing studies seldom consider the influence of rainfall-runoff relationship in the upper reaches of rivers and focus on a few aforementioned factors. There is a lack of a more comprehensive set of influencing factors which includes rainfall-runoff relationship to explore its impact on the spatiotemporal variation of nitrogen and phosphorus and to identify the key factors. Regarding the identification method of key factors, gray relational analysis (Zhang et al., 2011), redundancy analysis (Xu et al., 2019a), factor analysis (Luo et al., 2017), correlation analysis (Cui et al., 2020; Xiao et al., 2016), Bayesian networks (BNs) (Xu et al., 2019b), Bayesian hierarchical model methods (Guo et al., 2019), multiple linear regression analysis (Mayora et al., 2018; Shi et al., 2016), principal component analysis (Han et al., 2020), and partial least squares regression (Alvarez-Cobelas et al., 2008; Rattan et al., 2017) were used in various studies. The gray relational analysis method is deficient in non-standardization and non-isotonicity in the calculation of the correlation degree (Zhou, 2007). The redundancy analysis model searches for the linear combination of the independent set that maximizes the redundancy index (Oliveira et al., 2004). Factor analysis is a statistical method to extract common factors from variable groups, and correlation analysis focuses on discovering the correlation characteristics between random variables. Bayesian networks and Bayesian hierarchical model methods are suitable for large-scale data sets with vast parameters (Guo et al., 2019; Xu et al., 2019b) Although both belong to multiple linear regression analysis, partial least squares regression performs better in solving the multicollinearity problem of independent variables than Principal component analysis (Carrascal et al., 2009).

In this study, a comprehensive set of influencing factors which consisted of six types of factors including rainfall-runoff relationship (represented by runoff coefficient), basic physical and chemical parameters of water quality, land use types, landscape patterns, topography, and socioeconomic development were constructed. To test whether it is applicable to the upper reaches of rivers, we selected Huangshui River basin in the upper reaches of the Yellow River as an example. According to China Ecological and Environmental Status Bulletin from 2015 to 2018 (Ministry of Ecology and Environment of the People’s Republic of China, 2018), the main water quality pollution indexes in the Yellow River basin, NH3-N, and TP, were selected as the indicators of nitrogen and phosphorus pollution in this study. Based on Matlab platform, the temporal mutation characteristics and the spatial clustering characteristics of NH3-N and TP were obtained through M–K test and cluster analysis, respectively. Due to the interdependence of multiple factors (land use types, landscape patterns and socioeconomic development), Partial least squares regression (PLSR) was used to quantify the impacts of the influencing factor set on spatiotemporal variation of NH3-N and TP concentration in the Huangshui River basin from 2015 to 2018. The importance rankings of the influencing factors on NH3-N and TP were obtained and then the main influencing factors were acquired. The main objectives of this paper are to (1) identify temporal and spatial variation patterns of ammonia nitrogen and total phosphorus in Huangshui River basin with the available monitoring dataset and (2) determine how the temporal and spatial variation of specific water contaminant attributed to multiple factors referred in this study using PLSR. This work can provide theoretical basis and technical support for the control and management of nitrogen and phosphorus pollution in upper reaches of rivers.

Materials and methods

Study area

This study was conducted in Huangshui River basin, which rises in the Haibei Tibetan Autonomous Prefecture of Qinghai Province (Fig. 2). Huangshui River is a first-degree tributary of the upper reaches of the Yellow River. The river is located within 36° 02′ E–37° 8′ E and 100° 42′ N–103° 04′ N, which also lies in the transition zone between the Qinghai-Tibet Plateau and the Loess Plateau. Ecological fragility is the typical feature of this area. The total length of the main stream is 374 km, with a drainage area of 17,733 km2. The study site covers most of Huangshui River basin from the upper reaches of Yellow River to Minhe County, flowing through counties such as Haiyan, Huangyuan, Huangzhong, Datong, Xining, Huzhu, Ping An, Ledu, Minhe. As of 2017, the total population of the Huangshui River Basin was 3.5329 million, accounting for 60.2% of the total population of Qinghai Province (5.87 million). With the rapid development of Xining urban agglomeration in recent years, the water environment and aquatic ecology of the Huangshui River Basin have been threatened. The main stream length of this region is 278 km with a drainage area of 15,558 km2, as shown in Fig. 2. The terrain of the region is relative lower in the southeast and higher in the northwestern. The region has high topographic relief (elevation change of 3107 m from river source to mouth) with complex landform types (Liu et al., 2020). The region experiences an arid and semi-arid continental climate with the mean average precipitation of 381.1 mm (1960–2017 records) (Yu et al., 2015). The mean average air temperature ranged from 3.1 to 7.9 °C (1960–2017 records). The mean annual runoff at the Minhe hydrological station (the outlet of the research basin) was approximately 2053 million m3 (1956–2000 records). According to the land use classification results of 2017, forest was the mainly type of land use, followed by grasslands and cropland, occupying 92.91% in total.

Fig. 2
figure 2

Location of Huangshui River basin

Materials

Water contamination

We collected all water contaminant data and other spatial data from several government agencies (details in the “Water contamination,” “Potential controlling factors,” and “Spatial data” sections), statistical analysis and PLSR were combined to link them. The water contaminant dataset was supplied by the Department of Ecological Environment of Qinghai Province, China, at monthly intervals from 2015 to 2018 at 13 monitoring sites, as shown in Fig. 3. Measurements were performed on standard water samples, and all analytical techniques and calculation methods were performed according to the environmental quality standards for surface water (CSEPB, 2002). Five variables, including ammonia nitrogen (NH3-N), total phosphorus (TP), pondus hydrogenii (pH), the dissolved oxygen (DO), and potassium permanganate index (CODMn) were analyzed in this study. The specific analysis methods for water quality items were presented as follows: NH3-N, spectrophotometric method with salicylic acid; TP, spectrophotometric method with ammonium molybdate; pH, glass electrode method; DO, electrochemical probe method; CODMn, acidic (alkaline) potassium permanganate method.

Fig. 3
figure 3

Study area and the catchments distribution based on water quality monitoring stations

Potential controlling factors

Based on previous hypothesis, the spatiotemporal variation of ammonia nitrogen and total phosphorus concentration are affected by six categories of factors. A total of 21 factors (Table 1), which belong to six aforementioned categories, were extracted as potential controlling factors in the statistical analysis. Rainfall-runoff relationship factor (that is runoff coefficient) was calculated based on the monthly outputs of rainfall and runoff from distributed hydrological model (WEP) (He et al., 2019). The land cover maps in 2015 and 2017 were used for characterizing land use type and landscape patterns were analyzed by ArcGIS 10.2 platform and the Fragstats 4.2 software, which were widely used for landscape metrics calculation (McGarigal et al., 2015). The topography data including average slope and HI were obtained by processing dem and slope data through zonal statistics module in ArcGIS 10.2. The basic data of population, livestock, regional GDP, and the added value of the primary, secondary, and tertiary industries in each district or county of the basin have three main sources. They are the National Economic and Social Development Statistical Bulletin of each district or county from 2015 to 2018, the Statistical Yearbook of each district or county from 2016 to 2019 and the China County Statistical Yearbook from 2016 to 2019. The population number, livestock quantity, regional gross product value, primary, secondary, and tertiary industries within each catchment were obtained by weighted average method. The weights were set according to the proportion of the area of each district or county in each catchment. For the convenience of comparison, livestock quantities of different species were uniformly converted into pig equivalent, and the corresponding conversion coefficients referred to the monograph of Huang et al. (2014). The values of Pop_Den, Liv_Den, PPI, PSI, and PTI in each catchment were calculated accordingly.

Table 1 Categories, abbreviation, and description of the selected factors in the influencing factor set

Spatial data

For the basin scale, the boundary of each catchment was depicted by means of the DEM data in the ArcGIS, and each water quality monitoring station was deemed to be the outlet of the corresponding catchments (Fig. 3). Digital elevation model (DEM) data used in this study derived from National Geomatic Centre of China with resolution of 90 m*90 m. Land cover map of the basin in 2015 derived from Tsinghua University (http://data.ess.tsinghua.edu.cn/), and that in 2017 was from Department of Natural Resources of Qinghai Province, China.

Methods

In this paper, an influencing factor set which includes the rainfall-runoff relationship, basic physical and chemical parameters of water quality, land use types, landscape patterns, topography, and socioeconomic development was constructed. Based on Matlab algorithms, the temporal mutation characteristics of NH3-N and TP in each catchment were obtained through M–K test. Moreover, the spatial clustering characteristics of NH3-N and TP in catchments were obtained by cluster analysis. On this basis, PLSR was used to quantify the complex interdependencies between the influencing factor set, and spatiotemporal variation of ammonia nitrogen and total phosphorus concentration in the basin. From the perspectives of temporal and spatial variation, the importance rankings of the influencing factors on NH3-N and TP were obtained and the main controlling factors were acquired accordingly, which lay the foundation for the accurate attribution of the temporal and spatial variation of NH3-N and TP (Fig. 4).

Fig. 4
figure 4

Research workflow of spatiotemporal variation of nitrogen and phosphorus concentration in Huangshui River basin and identification of main controlling factors

M–K test

The Mann–Kendall test, which is a robust and non-parametric test method, was used to diagnose the temporal trends of water quality parameters (Buendia et al., 2016; Fathian et al., 2016; Li et al., 2018). In this study, it was applied to analyze the temporal mutation characteristics of concentration of NH3-N and TP at each monitoring station through Matlab algorithm. Through UF statistics and UB statistics, trend and mutation time of the variable can be obtained. If UF statistics >0 (<0), the sequence of NH3-N or TP is on the rise (down) trend, when it exceeds the critical line (p < 0.05), it indicates the rise or fall of the trend is significant.

Cluster analysis

CA is a reduction statistical method which is commonly used to classify objects into groups according to their nearness. The objects are categorized by linking inter-sample commonalities so that the outcome demonstrates the general similarity of the components in a given set of data (Razmkhah et al., 2010). The most common approach is hierarchical agglomerative cluster analysis, which build the solution by initially assigning each document to its own cluster and then repeatedly selecting and merging pairs of clusters, to obtain a single all-inclusive cluster (Al-Murairi et al., 2014; Zhao & Karypis, 2005). The output of this cluster process is a dendrogram, and the similarities and dissimilarities are quantified through Euclidean distance measurement. In this study, hierarchical agglomerative cluster analysis was carried out to ascertain the multivariate similarity between different water quality monitoring stations based on the time series of concentration of NH3-N and TP in the Huangshui River basin. The CA was performed through programming and calculation on Matlab platform.

PLSR

The PLSR is an extension of multiple regression analysis which the effects of linear combinations of several predictors on a response variable (or multiple response variables) are analyzed. PLSR was developed for econometric modeling of multivariate time series and later was applied in chemometrics (Wold, 1995) and hyperspectral remote sensing (Min & Lee, 2005). PLSR can handle highly correlated variables on the principle of variable compression and is particularly suitable for cases in which the number of observations is less than the possible variables (Carrascal et al., 2009; Luedeling & Gassner, 2012). Mathematically, PLSR is achieved by maximizing the covariance between y and all possible linear functions of x. It is often called as the “better PCA” as it often gives improved prediction results (Luedeling & Gassner, 2012).

A PLSR model for ammonia nitrogen (NH3-N) and total phosphorus (TP) was established respectively to identify the main influencing factors temporally and spatially in order to obtain the attribution of spatiotemporal variation of NH3-N and TP. Before PLSR analyses, predictors were centered and scaled to unit variance to give them the same relative importance. The percentage of variance explained for the response variables, the cross-validated root mean squared error (RMSE), which is the difference between the predicted and observed values of each individual pass. The predictor coefficients (magnitude and direction) were used to examine the influence of predictors on responses. The PLSR was performed using Matlab algorithm.

Results

Temporal mutation characteristics of NH3-N and TP

Less than a quarter of the 13 water quality monitoring stations showed a significant decline in the concentration of NH3-N and TP. As shown in Figs. 5 and 6, Xinningqiao-Datong, Minheqiao catchment showed a significant decline of NH3-N concentration and Runzeqiao, Xiaoxiaqiao, and Minheqiao exhibited a significant decline of TP concentration. As listed in Table S1 (Supplement Materials), the number of mutations of NH3-N concentration in the middle reaches of the Huangshui River basin was generally higher than that in the upper and lower reaches. Specifically, the numbers of mutations of NH3-N in Runzeqiao, Chaoyangqiao, Sanqiqiao, and Shatangchuanqiao catchments were all larger than 4. The numbers of mutations of NH3-N of the catchments in the upstream section except Jintan were less than 3, and the numbers of mutations of NH3-N in catchments of the downstream section were all less than 3. The numbers of mutations of TP in 11 catchments out of 13 catchments in the basin were less than that of NH3-N. Specifically, in the middle reaches, the numbers of mutations of TP in Runzeqiao and Chaoyangqiao catchments were equal or larger than 3. Moreover, in the upper reaches, the numbers of mutations of TP in Jintan and Taerqiao catchments were equal or larger than 3. However, the numbers of mutations of TP in catchments of the lower reaches were less.

Fig. 5
figure 5

Temporal mutation characteristics of NH3-N in each catchment based on M–K test

Fig. 6
figure 6

Temporal mutation characteristics of TP in each catchment based on M–K test

Spatial cluster characteristics

The results of cluster analysis of NH3-N showed that Jintan, Zhamalong, and Taerqiao catchments at the upstream section belonged to entire qualified class (subject to Class III standards for surface water bodies in GB3838-2002) (CSEPB, 2002). Xinningqiao-Datong, Runzeqiao, and Minheqiao catchments belonged to basic compliance class. Wanziqiao and Laoyaxiakou catchments belonged to basic excess class. Other catchments belonged to the different categories, respectively. All of them were sectional excess categories, with the different length of the excessing period (Fig. 7, Table 2).

Fig. 7
figure 7

Dendrogram of cluster analysis of NH3-N at different water quality monitoring stations. Z1–Z13 represent the number of catchments controlled by the water quality monitoring station

Table 2 Summary of cluster analysis results of NH3-N in each catchment

The results of cluster analysis of TP showed that Jintan, Zhamalong, and Taerqiao catchment at the upstream section belonged to nearly entire qualified class (subject to Class III standards for surface water bodies in GB3838-2002) (CSEPB, 2002). Runzeqiao, Sanqiqiao and Minheqiao catchments belonged to basic compliance class. Wanziqiao and Laoyaxiakou catchments fall into sectional excess class. Xiaoxiaqiao catchment pertain to basic excess class. Other catchments belonged to the different categories respectively, all of which were sectional excess categories, with the different length of the excessing period (Fig. 8, Table 3).

Fig. 8
figure 8

Dendrogram of cluster analysis of TP at different water quality monitoring stations. Z1–Z13 represent the number of catchments controlled by the water quality monitoring station

Table 3 Summary of cluster analysis results of TP in each catchment

In comparison, the cluster analysis results of NH3-N and TP of each catchment were similar.

There were slightly differences in the basic compliance class of the two (Group 2). The basic excess class of NH3-N was different from the sectional excess class of TP in Group.5. This may be due to the differences in the types of pollutants and the characteristics of the catchment.

Attribution analysis of temporal and spatial variation

Attribution analysis of temporal variation of concentration of NH3-N and TP

The temporal variation characteristics of NH3-N in 7 catchments out of 13 catchments were mainly affected by three factors: PWA, PIA, PPI. The importance rankings of these three factors were different among catchments. The temporal variation characteristics of NH3-N in other catchments were significantly affected by RC, PSI, PTI, SHDI, and PGA factors (Tables 4 and 5).

Table 4 Values of the regression coefficients from PLSR models which describe the relationships (direction and magnitude) between influencing factors and temporal variation of NH3-N in each catchment
Table 5 Results from the PLSR models for temporal variation of NH3-N in each catchment

The temporal variation characteristics of TP in 8 catchments out of 13 catchments were mainly affected by three factors: PWA, PIA, PPI. The importance rankings of the three factors were different in different catchments. The temporal variation characteristics of TP in other catchments were significantly affected by PSI, PTI, PCA, PGA and RC factors (Table S2, Table 6).

Table 6 Results from the PLSR models for temporal variation of TP in each catchment

Attribution analysis of spatial variation of concentration of NH3-N and TP

As listed in Table 7, the spatial variation characteristics of NH3-N in the basin were mainly affected by PWA, PSI and HI. Besides, the spatial variation characteristics of TP in the basin were significantly influenced by PWA, PSI and PTI, as shown in Table 8.

Table 7 Values of the regression coefficients and other results from PLSR models which describe the relationships (direction and magnitude) between influencing factors and spatial variation of NH3-N of the whole basin
Table 8 Values of the regression coefficients and other results from PLSR models which describe the relationships (direction and magnitude) between influencing factors and spatial variation of TP of the whole basin

Discussion

Analysis of main controlling factors of temporal variation of NH3-N and TP

The temporal variation of NH3-N and TP in Xiaoxiaqiao, Runzeqiao, Sanqiqiao, Shatangchuanqiao, Qiyiqiao, Laoyaxiakou catchment in Huangshui Basin were mainly influenced by factors of PWA, PIA, and PPI. These catchment areas are located in the middle reaches of Huangshui River except Laoyaxiakou. The average concentration of NH3-N and TP in this kind of catchment area was relatively high, which may be related to the higher population density (greater than 123 p/km2), which was similar to the relevant studies (Alvarez-Cobelas et al., 2008; Wang et al., 2019; Cui et al., 2020). Two thirds of the abovementioned catchments were found with relatively high value of PIA (more than 0.05), and low values of the elevations. The significant influences of PWA and PIA on the temporal change of NH3-N and TP in these catchments reflected that the land use type was the main factor affecting the NH3-N and TP concentration in the middle reaches of the Huangshui watershed. Because land use types can conceivably affect the runoff processes which carry anthropogenic substances such as nutrients into rivers; therefore, certain land use types can influence on water contaminant concentrations (Zhou et al., 2012).

Pellerin et al. (2004) found that the nitrogen export through streams may be related with the ratio of wetland areas in the catchments, which promotes nitrogen retention and volatilization. Li et al. (2020) concluded that the ratio of urban areas, and the ratio of forest areas were major influential indicators that affected TN and TP in river water. Jabbar and Grote (2019) hold the view that water quality parameters P were also correlated with the percentage of urban land. Similarly, our research found that the temporal variations of ammonia nitrogen and total phosphorus were significantly influenced by PWA and PIA. The PPI of Xiaoxiaqiao and Sanqiqiao catchment in the upper reaches were higher (greater than 0.17) and the PPI of the remaining catchments were all less than 0.09. It was shown that PPI with too high or low values may make it the main controlling factor for the temporal change of NH3-N and TP.

The temporal change of TP in Xinningqiao-Datong catchment was significantly affected by PPI and PIA, which may be related to the higher PPI (close to 0.16) and middle PIA (about 0.06). Moreover, the temporal variation of NH3-N in Chaoyangqiao catchment was also mainly affected by three factors: PWA, PIA, and PPI. While the temporal change of TP was affected by RC obviously, which may be related to the low degree of human development and the distribution of temperate deciduous broad-leaved forest in the northwest of the catchment.

The temporal change of NH3-N in Jintan catchment was significantly affected by PWA, PIA, and RC. The Jintan catchment was located in the upper reaches of the Huangshui River with low average concentration of NH3-N. It may due to its lowest population density and livestock density among all the catchments. Meanwhile, the land use type of this catchment was mainly grassland and woodland (>0.85), and the impervious ground area only accounted for a small proportion (<0.01). This is in accord with that agriculture land and urban land were negatively correlated with surface water quality, whereas forested land, water area, and grassland were positively correlated with water quality (Chen et al., 2016; Lee et al., 2020; Xu et al., 2019a). The PPI was relatively high (>0.09), and the secondary industry was underdeveloped (PSI was approximately equal 0.37). In addition, the temporal change of NH3-N was obviously affected by the runoff coefficient, which may be closely related to the low degree of socioeconomic development in this catchment. The temporal change of TP in Jintan catchment was significantly affected by PWA, PIA and PPI, followed by PCA, COHESION and RC, which indicated that agricultural non-point source pollution in the catchment may have a relatively large contribution to the total phosphorus load.

The temporal variations of NH3-N and TP in Zhamalong and Wanziqiao catchments were significantly affected by PTI, of which Wanziqiao catchment was also significantly affected by PSI. This may be related to the small value of average PTI of Zhamalong catchment (<0.3), and the larger value of the sum of PTI and PSI in Wanziqiao catchment (>0.9). The results were similar with (Xu et al., 2019b), which found wastewater from sewage outfalls was the largest contributor (26.2%) to AN pollution in dry seasons in Huaihe River basin.

The temporal change of NH3-N in the Taerqiao catchment and the temporal change of TP in the Minheqiao catchment were both significantly affected by PTI, which indicated that socioeconomic activities, especially NH3-N and TP discharge from the tertiary industry, have become a serious problem for the entire Huangshui basin. Meanwhile, the temporal change of TP in the Taerqiao catchment was obviously affected by PCA, which may be related to the lower average PCA (close to 0.16) in the catchment. The temporal variation of TP in the Minheqiao catchment was obviously affected by PGA which maybe related with the lower mean value of PGA.

Analysis of main controlling factors of spatial variation of NH3-N and TP

There was a certain correlation between the spatial variation and the temporal change of NH3-N concentration. The temporal changes of NH3-N in 12 catchments out of 13 catchments were significantly influenced by PWA. Therefore, the spatial variability of NH3-N concentration was also affected by PWA to some extent. The natural attributes of the watershed (topography, land use) are closely related to the factor HI. According to Yu et al. (2020), the large-scale vegetation restoration engineering in Loess Plateau since 1990s converted slope farmlands into forests or grasslands. This indicated that the land use change can be reflected by HD of the catchments to some degree. Considering the distinct influences of land use types on water contaminant concentrations, the relevant factor HI could be the significant factor for spatial variation of NH3-N. The intensity of socioeconomic development and industrial structure layout of a basin both correlated with PSI, which contributes a lot to point sources of ammonia nitrogen pollution discharge. According to incomplete statistics, more than 70% of the industrial and mining enterprises in Qinghai Province are distributed in the Huangshui River basin, which is called the “Mother River” of Qinghai. Therefore, PSI in the Huangshui River basin undoubtedly contributes significantly to the spatial variation of ammonia nitrogen in this basin, which was similar with the conclusion of Xu et al. (2019a). The spatial variability of NH3-N concentration was mainly affected by the three factors: PWA, HI and PSI, which were similar to the findings of Ai et al. (2015) and Rattan et al. (2017) (Figs. 9, 10, and 11).

Fig. 9
figure 9

Distribution map of population density in each catchment of Huangshui River basin

Fig. 10
figure 10

Distribution map of livestock density in each catchment of Huangshui River basin

Fig. 11
figure 11

Proportion of area of main land use types in each catchment of Huangshui River basin

The certain correlation also existed between the spatial variation and the temporal change of TP concentration. The temporal change of TP in 11 catchments out of 13 catchments was significantly affected by PWA. Thus, the spatial variability of TP concentration was also affected by PWA obviously. Similar to the research of Zhou (2012), the sources of total phosphorus pollution load in Huangshui River Basin from 1997 to 2000 were mainly domestic, industrial wastewater, and fertilizer use, followed by livestock and poultry breeding. It showed that the total phosphorus pollution load of the secondary and tertiary industries was higher than that of the primary industry. Moreover, most of the sewage treatment plants and polluting enterprises in the basin are located along the river or close to the river net (Fig. 12). This type of discharge belongs to point source pollution, which may explain that the spatial variation of total phosphorus concentration was significantly affected by PSI and PTI. It also indicated that socioeconomic activities, especially NH3-N and TP discharge from the secondary and tertiary industry, have become a serious problem for the entire basin.

Fig. 12
figure 12

A preliminary statistics of sewage treatment plants and polluting enterprise distribution in Huangshui River basin

Conclusions

In this study, 4 out of 7 catchments in the middle reaches of the Huangshui River basin were found to have a larger number of mutations of NH3-N (>4) through the M–K test. The catchments in the upstream and downstream areas except Jintan and Taerqiao had fewer mutations of NH3-N and TP. The cluster analysis results of NH3-N and TP of all catchments were similar according to hierarchical agglomerative cluster analysis. The concentration of NH3-N and TP in the upstream and at the outlet of the basin has a higher possibility to meet the Class III standards for surface water bodies in GB3838-2002) (CSEPB, 2002).

This study showed that although the Huangshui River Basin was located in the upper reaches of the Yellow River, the influences of rainfall-runoff relationship on spatiotemporal changes of NH3-N and TP in its sub-basins were limited. Only the temporal change of NH3-N in Jintan catchment in the upstream area was significantly affected by runoff coefficient. Based on PLSR, land use types and socioeconomic development were the two main categories of factors which affect the temporal changes of NH3-N and TP in Huangshui River basin, of which PWA, PIA, and PPI were the top three independent factors for most catchments in the middle reaches. The temporal variations of NH3-N and TP in the large majority (12/13 of total catchments for NH3-N, 11/13 for TP) of all catchments were significantly affected by PWA. In the middle reaches of the Huangshui River basin, the temporal variations of NH3-N and TP in most catchments (6/7 of total catchments for NH3-N, 5/7 of total catchments for TP) were also significantly affected by PIA and PPI. The temporal variation characteristics of TP in other catchments were significantly affected by PCA and PGA factors. The spatial variation of NH3-N was mainly affected by PWA, HI, and PSI. The spatial variation of TP was significantly affected by PWA, PSI, and PTI. The conclusions of this study may provide a reference for the control and management of nitrogen and phosphorus pollution in similar upstream river basins.