A tool (SPOLERC) to guide the evaluation of phosphorus leaching for agricultural soil by using the change point value in the Xingkai Lake Basin, China

The soil P leaching change point (CP) has been widely used to evaluate soil P leaching risk. However, an automation calculation method for soil P leaching CP value, and an effective risk grading method performed for classifying soil P leaching risk evaluation have not been developed. This study optimized the calculation process for soil P leaching CP value with two different fitting models. Subsequently, based on the Python programming language, a computation tool named Soil Phosphorus Leaching Risk Calculator (SPOLERC) was developed for soil P leaching risk assessment. SPOLERC not only embedded the calculation process of the soil P leaching CP value, but also introduced the single factor index (SFI) method to grade the soil P leaching risk level. The relationships between the soil Olsen-P and leachable P were fitted by using SPOLERC in paddy soils and arid agricultural soils in the Xingkai Lake Basin, and the results showed that there was a good linear fitting relationship between the soil Olsen-P and leachable P; and the CP values were 59.63 and 35.35 mg Olsen-P kg−1 for paddy soils and arid agricultural soils, respectively. Additionally, 32.7, 21.8, and 3.64% of arid agricultural soil samples were at low risk, medium risk, and high risk of P leaching, and 40.6% of paddy soil samples were at low risk. SPOLERC can accurately fit the split-line model relationship between the soil Olsen-P and leachable P, and greatly improved the calculation efficiency for the soil P leaching CP value. Additionally, the obtained CP value can be used for soil P leaching risk assessment, which could help recognize key area of soil P leaching.


Background
Phosphorus (P) is an essential element for crop growth and one of the main controlling factors leading to water eutrophication. Soil P losses, on the one hand, degenerate soil quality and result in an imbalance of soil nutrients [8]. On the other hand, when P enters water bodies and exceeds a certain concentration (0.03 mg L −1 in inorganic P and 0.1 mg L −1 in total P), the water quality will deteriorate, and even contribute to the outbreak of water blooms [7,8,9]. Originally, most studies have concentrated on P losses by soil erosion and surface runoff because the subsurface P losses account for a small proportion [8]. In the last two decades, soil P losses by subsurface pathways, such as P leaching, have attracted substantial attention, and the subsurface pathways in some events were reported to play a dominant role in P loss from agricultural land to water [3, 15 9, 5, 17]. Consequently, it is of great significance to investigate soil P leaching loss in Open Access *Correspondence: yechbj@163.com; 297535203@qq.com † Zijian Xie and Fan Zhang contributed equally 1 National Engineering Laboratory for Lake Pollution Control and Ecological Restoration, Chinese Research Academy of Environmental Sciences, Beijing 100012, China Full list of author information is available at the end of the article farmland soil, which will strengthen the management of arable soil P and protect water ecosystem.
The CaCl 2 -P, which is soil-leachable P extracted by 0.01 M CaCl 2 solution, has a significant positive linear correlation with soil P leachates, and is effectively used to indicate the complexity of soil P entering soil solution or surface runoff [3,9,17]. The soil P leaching change point (CP) is estimated by using the split-line model to fit the relationship between the soil-leachable P and soil Olsen-P, and is often used to evaluate the P leaching risk in topsoil [3,5,20]. Recently, Xie et al. [17] proposed the cascade extraction method and verified that the soilleachable P and CP values could be used to evaluate the P leaching risk in soil profiles. Although the research on soil P leaching risk evaluation has been continuously performed, the calculation process of the soil P leaching CP value has not been clearly described in the previous literature.
The CP value is often used to evaluate the soil P leaching risk. Generally, when the soil Olsen-P is higher than the CP value, significant P losses through leaching could occur; otherwise, P leaching risk is not observed [9,17]. This method is easy to operate, but fails to classify lowrisk areas and high-risk areas, thus it is not conducive to the hierarchical management of soil P leaching risk areas. The single factor index (SFI) method is an effective method of classifying the risk level [10]. The higher the evaluation index value is, the more serious the risk level is. Therefore, the SFI method may be a meaningful approach for grading the degree of soil P leaching risk and clarifying the severity of P leaching loss at different sampling sites.
Python is a programming language that is open source, freely available, and it has high execution efficiency and strong portability [2]. Through the custom function provided by Python, the soil P leaching CP value can be automatically and quickly fitted, which is beneficial for improving the accuracy and efficiency of the CP value fitting process. However, previous research has not fit the soil P leaching CP value based on the Python programming language.
The Xingkai Lake Basin is located in southeastern Jixi city, Heilongjiang Province. It is a border lake between China and Russia. Over the past 20 years, the water quality in the Xingkai Lake basin has decreased from level II (0.025 mg L −1 ) to level V (0.1 mg L −1 ), and the increase in total P concentration is the main reason for the continuous deterioration of water quality [6,19]. There are nearly 3300 km 2 of paddy and dry land in the surrounding area, and the main planting crops include corn, soybean, rice and vegetables [19]. It is estimated that approximately 5.4 t a −1 of total P flows into the Xingkai Lake Basin, and the non-point source pollution of farming contributes more than 80% of the water pollution in the Xingkai Lake Basin [14,16]. Thus, it is of practical significance to carry out soil P leaching risk evaluations in the Xingkai Lake Basin.
The aims of this study were to (i) optimize the calculation process of soil P leaching CP value; (ii) grade the soil P leaching risk level; (iii) develop a software program for calculating the soil P leaching CP value and evaluating its risk; (iv) and evaluate the P leaching risk of farmland soils in the Xingkai Lake Basin.

Materials and methods
The SPOLERC tool has been developed by using Python. The installation package, programming language, and instruction book for SPOLERC are described in the attachment, and the user can access the software at https:// github. com/ FanZh ang08 30/ SPOLE RC. The operation interface of SPOLERC is shown in Fig. 1. Overall, SPOLERC consists of four parts: data acquisition, data preview, CP value calculation, and risk evaluation. It is worth mentioning that the results evaluated by SPOLERC software were combined with the ArcGIS 10.2 for the analysis of soil P leaching risk spatial distribution. By using the case study in the Xingkai Fig. 1 Operation interface of the SPOLERC tool for soil P leaching risk calculation Lake Basin, the principle and details of SPOLERC are described as follows.

Data acquisition
Data acquisition is the prerequisite of soil P leaching risk evaluation. It constitutes the selection of the study area, and the collection and analysis of soil samples. The main data used for soil P leaching risk evaluation are the soil Olsen-P and leachable P.

Selection of the study area
The northwest part of the Xingkai Lake Basin was selected as the study area. A border area of 62.5 km 2 among the towns of Xingkaihu and Chengzihe was chosen for sampling (Fig. 2). The soil within the study area was classified as black soil. This region has a temperate monsoon climate zone. The annual mean temperature is 3 ℃, with an average annual temperature of -18 ℃ in January and 21 ℃ in July; the annual mean rainfall is 654 mm, and almost 70% of the mean annual rainfall is concentrated in summer [11]. Six decades ago, large-scale wetland reclamation led to farmland becoming the dominant land use type in the watershed [19]. The land uses mainly include arid agricultural land (35.3 km 2 , 56.4%), paddy land (23.2 km 2 , 37.2%), and villages (4.0 km 2 , 6.4%). Within the arid agricultural land, the main vegetation species are corn (Zea mays L.) and soybean (Glycine max (Linn.) Merr.), while in the paddy land, the main species is rice (Oryza sativa L.). It is worth mentioning that some vegetable plots exist around household residential land. This area is difficult to separate from the village, and the vegetable types included Chinese cabbage (

Collection of soil samples
A total of 87 soil samples were collected in this area from sample sites (55 in arid agricultural land, and 32 in paddy land) at a 0-20 cm soil depth in October 2020 (Fig. 2). Soil was collected in the field and subsequently transported to the laboratory, where the roots and debris were removed. The samples were air dried at room temperature and then 2-mm sieved to determine the soil Olsen P and leachable P.

Soil analysis and database preparation
The soil Olsen-P was extracted with 0.5 M NaHCO 3 (pH = 8.5) solution with a soil/solution ratio of 1:20 [12]. The leachable P was extracted with 0.01 M CaCl 2 solution with a soil/solution ratio of 1:5 [9]. Then, P in the extract solution was determined using the molybdenum blue method [13]. Subsequently, the soil Olsen-P and leachable P data were saved in Excel documents for analysis; the data example is shown in "input_file.xls".

Data preview and soil P leaching change point calculation
The purpose of the data preview is to select the appropriate calculation model for the soil P leaching CP value. The selection of the calculation model depends on the linear relationship between the soil Olsen-P and leachable P. If there were two distinct linear relationships, and the linear correlation between the soil Olsen-P and leachable P above the CP value was significant (p < 0.05). The data distribution sample of the scatter diagram is shown in Additional file 1: Fig. S1. The CP value was estimated according to the intersection of the two linear equations [5,9,17]. In this case, the "M1 Change point" function in SPOLERC was used to calculate the soil P leaching CP value.
Model 1 is the most common calculation model of the soil P leaching CP value. The calculation process of the soil P leaching CP value is shown in Fig. 3. The two-segment linear relationships were defined by Eqs. (1) and (2): First, the soil Olsen-P values should be ordered from smallest to largest before the formal calculation, and the R-square of the two-segment unitary linear combination was calculated by an iterative method (Fig. 3). Subsequently, the method of least-squares regression was used to determine the optimal linear relationship of the two-segment linear model, and evaluate the parameters (a 1 , b 1 , R 1 -square, a 2 , b 2 and R 2 -square) in the equations (Fig. 3). Finally, the CP value was determined by using the optimal linear relationship between the two-segment linear model. Mostly, the CP value combined with the soil Olsen-P usually used to evaluate the soil P leaching risk level (Fig. 3).
However, if there was only one linear relationship between the soil Olsen-P and leachable P, and the linear correlation between soil Olsen-P and soil-leachable P below the CP value did not exist. Then, the CP value was estimated based on the intersection of the X axis and another linear significant relationship between the soil Olsen-P (high-value area) and soil-leachable P (p < 0.05) [18], and the data distribution sample of scatter diagram is shown in Additional file 1: Fig. S2. In this case, the "M2 (1) Change point" function in SPOLERC was used to calculate the P leaching CP value.

Soil P leaching risk level evaluation
The SFI method was introduced to grade the soil P leaching risk level, and a higher evaluation index value corresponds to more serious P leaching risk. The calculation formula of SFI method is as follows: where P i represents the evaluation index of soil P leaching; C i represents the soil Olsen-P content; CP represents the soil P leaching change point. The risk rate of soil P leaching is shown in Table 1. If P i is higher than 1, significant P losses by leaching or surface should occur. In addition, the P losses increased with an increase in P i . However, if P i is smaller than 1, this area would have a low risk of P leaching. Noticeably, if the CP value was calculated by using the "M1 Change Point", the "M1 Risk Evaluation" function in SPOLERC was used to evaluate the risk probability. Similarly, if the CP value was calculated by using the "M2 Change Point", the "M2 Risk Evaluation" function in SPOLERC was used to evaluate the risk probability.

Soil P leaching risk distribution
Based on the soil P leaching CP value and the evaluation index of soil P leaching measured by the SFI method. Subsequently, ArcGIS 10.2 was used to analyse the data by normal distribution, and an optimal model for spatial analysis was chosen.

Change point for P leaching in agricultural soils
The scatter distribution figures between the soil Olsen-P and leachable P in arid agricultural soils and paddy soils were presented by the SPOLERC tool, respectively, and the results are shown in Additional file 1: Fig. S3. Whether in Fig. S3a or S3b of Additional file 1, it seems that there are two different ranges of value distribution. The scatters of these two regions might be fitted into two different linear relations, and the soil P leaching CP value might be calculated. This result was similar to some previous figures presented by Li et al. [9] and Xie et al. [17]. Consequently, "Model 1" was selected to calculate the CP value of soil P leaching.
(3) P i = C i /CP, As shown in Fig. 4, significant linear, positive relationships between Olsen-P and leachable P in agricultural soils were calculated by SPOLERC under different land uses above the CP value. According to the statistical analysis of 55 arid agricultural soil samples, the relationships between the soil Olsen-P and leachable P were classified into two straight lines with very different slopes (Fig. 4a). There was a specific point (change point) between the two lines, which was considered to constitute the soil P leaching CP value. The fitting equations between the soil Olsen-P and leachable P in arid agricultural soils calculated by SPOLERC are as follows: Equations (4) and (5) indicate the linear relationships between the soil Olsen-P and leachable P in the low-value area (below the CP value) and high-value area (above the CP value), respectively. With regard to Eqs. (4) and (5), the intersection of the two lines (CP value) was found at 59.63 mg Olsen-P kg −1 , and the corresponding leachable P was 0.44 mg kg −1 .
Subsequently, 32 paddy soil samples were analysed by using the same procedure. The soil P leaching CP value in paddy soils was 35.35 mg Olsen-P kg −1 , and the corresponding soil-leachable P was 0.02 mg kg −1 (Fig. 4b). The CP value of soil P leaching in the arid agricultural soils was slightly higher than that in the paddy soil.

Risk evaluation and distribution of P leaching in agricultural soils
The SFI method was used to evaluate the soil P leaching risk probabilities. For the arid agricultural soil samples analysed by SPOLERC (Fig. 5a; Table 2), 41.8% of soil samples were not at risk of P leaching, while 32.7, 21.8, and 3.64% of soil samples were at low risk, medium risk, and high risk of P leaching, respectively. Similarly, the paddy soil samples were analysed by SPOLERC ( Fig. 5b; Table 2). The results demonstrated that 59.4% of the soil samples were not at risk of P leaching, while 40.6% of the soil samples were at low risk. It is worth mentioning that none of the soil was at a middle risk or high risk in the paddy soil. The risk probability of P leaching from arid agricultural soils was higher than that from paddy soils.
Subsequently, the ordinary kriging method was used to assess the P leaching probability distribution according to the land uses (Fig. 6). The low-risk areas of soil P leaching were mainly distributed in the eastern and northern parts of the study area. In addition, (4)  the medium-risk and high-risk areas were dotted in the western part of the study area. Land use and crop types could be one of the reasons for the present spatial distribution pattern. The paddy soils distributed in the eastern part of the study area and the arid agricultural soils in the western part planted with corn and soybean were at low risk, while the arid agricultural soils around the villages planted vegetables had a medium or high risk of P leaching.

Discussion
Research on the soil P leaching CP value has been continuously performed for nearly 20 years. Heckrath et al. [3] originally found the linear split-line model between the soil Olsen-P and dissolved reactive P (DRP) in drainage water with a continuous wheat experiment in Broadbalk. If the soil Olsen-P in the plough layer exceeded a certain value (60 mg Olsen-P kg −1 ), then the DRP loss amount in the drainage water were closely related to the soil Olsen-P, and the certain Olsen-P value was  defined as the CP value [3]. Subsequently, Heskrath and Brookes [4] confirmed that the CP value evaluated on Broadbalk could occur in other soils. Additionally, they found that a special linear relationship between the soil Olsen-P and DRP in drainage water could also be found between the soil Olsen-P and 0.01 M-CaCl 2 -extractable P, and the CP value for soil P leaching risk assessment was predicted (Heskrath and Brookes, 2000). Consequently, 0.01 M-CaCl 2 -extractable P was developed as an indicator for the risk of soil P leaching. Afterwards, the CP value was applied to the risk assessment of soil P leaching around the world, and some new progresses have been made. Bai et al. [1] raised the CP values for crop yield, soil fertility and environmental safety by fitting the split-line model between the soil Olsen-P and the crop yields, soil Olsen-P and total P (TP), respectively. Li et al. [9] found the CP value according to the linear relationship between 0.01 M CaCl 2 -extractable organic P and soil available P. Xie et al. [17] proposed that the CP value could be used for the risk evaluation of soil P leaching in deep soil profiles measured by a cascade extraction method. However, previous studies have not clearly described the process of calculating the soil P leaching CP value or attempted to improve the soil P leaching CP value calculation method. This study not only optimized the calculation process of the soil P leaching CP value, but also developed an automatic tool (SPOLERC) for the calculation of the soil P leaching CP value and its risk evaluation. Meanwhile, SPOLERC embedded the calculation process of the soil P leaching CP value using two different models; and introduced the SFI method to evaluate the soil P leaching risk level. The results have demonstrated that SPOLERC can accurately and quickly measure the soil P leaching CP value, and evaluate the soil P leaching risk levels. Therefore, SPOLERC is practical for the calculation of the soil P leaching CP value and the evaluation of the soil P leaching risk.
Soil types, soil land use, pH value and soil organic matter (SOM) content can pose a significant influence on Fig. 6 Spatial distribution pattern of soil P leaching risk in the study area estimated based on the soil Olsen P at sampling sites above the change-point value for P leaching in agricultural soils the soil P leaching change point. Hesketh and Brookes [4] found that the CP value in the agricultural soils of the UK varied from 10-110 mg Olsen-P kg −1 . Similarly, Zhao et al. [21] found that the CP value in 13 types of Chinese agricultural soils ranged from 30 to 160 mg Olsen-P kg −1 . The CP value in agricultural soil was slightly higher than that of forest soil. Li et al [9] and Xie et al [17] found that the CP values in agricultural soils were 85 and 30.2 mg kg −1 , which were higher than those value in forest soils (46 and 20.0 mg kg −1 , respectively). In addition, soil pH has a significant effect on the soil CP value. At soil pH < 6.0, the CP value increased with soil pH, but in soils with pH > 6.0, the CP value decreased with soil pH [21]. It is worth mentioning that biochar application can significantly increase the CP value, because there was a significant positive correlation between the SOM and P leaching CP value, and the SOM significant increased with the biochar addition. According to an indoor incubation experiment, Zhao et al. [20] demonstrated that biochar application can improve the soil CP value from 48.65 and 71.25 mg Olsen-P kg −1 to 185.07 and 98.66 mg Olsen-P kg −1 , respectively. Xie et al. [18] confirmed this result through a field trial (33.52 mg Olsen-P kg −1 vs. 25.86 mg Olsen-P kg −1 ). In the present investigation, the CP value measured in arid agricultural soils was higher than that value in paddy land soils (59.63 mg P kg −1 vs. 35.35 mg P kg −1 ). These values were slightly lower than that those reported for soils in Broadbalk (60 mg P kg −1 ) and much higher than those reported for fluvisol soils in the Chaobaihe Basin (30.4 ~ 44.4 mg P kg −1 ) [4,17,18].
The soil P leaching risk in arid agricultural soils was higher than that in paddy land soils. The difference in the fertilizer application rate may be the main factor contributing to the difference in soil P leaching risk. The main type of crops grown in arid agricultural land included vegetables, corn, and soybean. Vegetable planting is an important use in arid agricultural land.

Conclusion
This study optimized the calculation process of the soil P leaching CP value and developed an automatic tool, SPOLERC, for the calculation of the soil P leaching CP value by using the Python programming language. Similarly, the SFI method was introduced to SPOLERC for grading the soil P leaching risk level. Subsequently, SPOLERC was used to evaluate the agricultural soil P leaching risk in the Xingkai Lake Basin. The results showed that there was a good linear relationship between the soil Olsen-P and soil-leachable P, and the soil P leaching CP value and its risk level could be accurately calculated. The CP values calculated for arid agricultural soils and paddy soils of the Xingkai Lake Basin were 59.63 and 35.35 mg Olsen-P kg −1 , respectively. In addition, almost 32.7, 21.8, and 3.64% of arid agricultural soil samples were at low risk, medium risk, and high risk of soil P leaching, while 40.6% of paddy soil samples were at low risk. The risk of P leaching in the soils of arid agricultural land was higher than that in paddy soils. The mediumrisk and high-risk areas were mainly distributed in the western part of the study area. It is worth mentioning that future research is needed to investigate the mechanism of P migration in the Xingkai Lake Basin. Meanwhile, investigations were performed on the relationship between the CP value and P leaching flux, and using the CP value to evaluate soil P leaching flux. These investigations could provide more accurate guidance for agricultural soil P loss management.