*Article* **Development of Novel QAPEX Analysis System Using Open-Source GIS**

**Jayoung Koo 1, Jonggun Kim 2, Jicheol Ryu 3, Dong-Suk Shin 1, Seoro Lee 2, Min-Kyeong Kim 4, Jaehak Jeong <sup>5</sup> and Kyoung-Jae Lim 2,\***


**Abstract:** The Agricultural Policy/Environmental eXtender (APEX) model has been used for farm/small watershed management, and the ArcAPEX interface was developed using the ArcGIS extension. However, the interface requires a paid license and limits dynamic applications that reflect various agricultural farming practices. In this study, a novel APEX model interface using Quantum GIS, the QAPEX analysis system, was developed by incorporating open-source-based GIS software for the simulation of water quality impacts of various best management practices reflecting local farming activities. The watershed delineation process running on the QAPEX interface is more flexible than that on the ArcAPEX interface, which renders simulations on hydrology and water quality with considerable precision. The newly developed system can be used to visually interpret simulation results (e.g., flow and load duration curve functions). Therefore, the open-source-based model can be used to derive data for sustainable agricultural policies, with a focus on the field-level application of management practices.

**Keywords:** APEX; open-source software; QGIS; QAPEX; best management practice; LDC

#### **1. Introduction**

An increase in air temperature, torrential heavy rainfall, and changes in rainfall patterns resulting from climate change affect the overall farming environment, including the rearing period and characteristics of crops [1]. In particular, concentrated heavy rainfall can increase the effect of water pollution from nonpoint pollution sources (NPSs) in agricultural regions, which necessitates the management of NPSs [2]. The Ministry of Environment (MOE) of South Korea has designated control areas of NPSs to reduce pollution from such sources, and is implementing numerous control measures and projects, such as establishing turbidity reduction measures and expanding NPS treatment facilities [3–5]. Furthermore, to establish control methods for NPSs, the MOE of South Korea has categorized 17 representative land covers through the Environmental Fundamental Data Examination project starting in 2008. Based on the findings from seven years of monitoring, the Ministry has determined the event mean concentration and NPS basic unit value by land cover, which provides basic data necessary for watershed management and watershed model operation [6,7].

The Soil and Water Assessment Tool (SWAT) [8] and Hydrological Simulation Program-FORTRAN [9] are used in watershed models in Korea to manage NPSs. In the Conservation Effects Assessment Project, a national project run by the Agricultural Research Service of

**Citation:** Koo, J.; Kim, J.; Ryu, J.; Shin, D.-S.; Lee, S.; Kim, M.-K.; Jeong, J.; Lim, K.-J. Development of Novel QAPEX Analysis System Using Open-Source GIS. *Sustainability* **2022**, *14*, 8199. https:// doi.org/10.3390/su14138199

Academic Editor: Christian N. Madu

Received: 31 March 2022 Accepted: 30 May 2022 Published: 5 July 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

the United States Department of Agriculture, Natural Resources Conservation Service, and Texas A&M AgriLife Research, the Agricultural Policy/Environmental eXtender (APEX) model and SWAT model were used to assess the effect of agricultural NPSs, and the Best Management Practices (BMPs) were applied to analyze conservation effects. Consequently, the findings have been used as national policy data for the United States [10].

The APEX model was developed with support from the USA Environmental Protection Agency (USEPA) to investigate the management effects of farming areas in small-scale watersheds. The model applies and evaluates BMPs because it can reflect various farming activities, including erosion from wind and water, economic feasibility, drainage for irrigation, intertilling, buffer strips, fertilizer and compost usage, crop rotation, pasturing, pesticide application, and plowing [11,12]. Furthermore, the Rural Development Administration (RDA) and Texas A&M AgriLife Research, the developer of the Environmental Policy Integrated Climate (EPIC)/APEX model, collaborated on the development of the APEX-Paddy model, which can be used to assess and control NPSs while considering the growing conditions of rice paddies, such as ponding water and transplanting [11,13]. The APEX model was improved into various models, such as WinAPEX [14], which is a basic APEX model with a simple and user-friendly interface; ArcAPEX [15], in which the ArcGIS software and APEX model are combined; and a web-based APEX model [16].

However, the WinAPEX system exhibits numerous shortcomings, such as the manual input of watershed characteristics, including soil properties, land use, slope, and waterway length, and searching through a long list of variables to modify them. In particular, the visual verification of the watershed information and simulation results of WinAPEX is required. Accordingly, the ArcAPEX interface improved on such shortcomings, enabled the automatic input and visualization of watershed information, and offered various geographic information system (GIS) functions. Nonetheless, the interface does not provide a visualization function for interpreting simulation results, and users are required to manually search and modify the necessary variables when applying BMPs in watersheds. Moreover, because the ArcGIS software, which is the base of the ArcAPEX interface, is a commercial program, users must purchase an expensive license. Because of the high cost of acquiring a license, the ArcGIS software is not widely used, and institutions such as the National Disaster Management Institute (NDMI) have substituted it with SuperMap (www.supermap.com, accessed on 1 February 2018) and Quantum GIS (QGIS) (www.qgis.org, accessed on 1 February 2018) [17].

Chen et al. [18] analyzed the functions of 31 open-source GIS software and revealed that, as an open-source GIS software, QGIS superior and the most appropriate option for use in the water resource field. In addition to data visualization, editing, and analysis functions, QGIS is capable of running most tasks available on commercial software. QGIS can be combined with other open-source GIS packages, such as PostGIS, GRASS, and MapServer, boosting its utility in various areas [18,19]. Furthermore, QGIS can be run on a number of operating systems, including Mac OS X, Linux, and Microsoft Windows.

This study linked the APEX model with open-source-based GIS software to develop the QAPEX analysis system, which includes the functions of the automatic input of watershed information, BMP-applicable interface, and visualization of simulation results.

The novelty of this study is the development of a user-friendly QAPEX analysis system for agricultural nonpoint pollution prediction and BMP evaluation by linking the APEX model and open-source-based GIS software for the first time. This QAPEX system provides multiple land use and soil combinations, which was not possible with previous WinAPEX and ArcAPEX interfaces, to provide an accurate representation of various land uses within the subbasin. Furthermore, the QAPEX system provides Flow Duration Curve (FDC)/Load–Duration Curve (LDC) analysis functions to be directly used for watershed management by considering flow regimes and water quality/quantity. The QAPEX analysis system developed in this study can quantify nonpoint pollution loads on agricultural lands based on a field scale and evaluate the effects of agricultural nonpoint pollution reduction for various structural and nonstructural BMPs. Furthermore, from the perspective of sustainable agricultural hydrological environment management, QAPEX could be used as an environmental tool to support policy decision-making necessary for various environmental impact assessments and strategic management plans.

#### **2. Materials and Methods**

#### *2.1. Description of APEX Model and BMPs*

Factors for operating lands in the APEX model originate from the EPIC model [20], which was developed in the early 1980s to evaluate the impact of erosion on productivity. The drainage area considered in the EPIC model is generally set at a maximum of 100 ha under the condition that the weather, soil, and management system remain constant [12]. The main components of the EPIC model are weather simulation, floodgate, erosion– sedimentation, nutrient cycling, decomposition of pesticides, crop growth, soil temperature, cultivation, economic feasibility, and control over the crop environment. Management factors that may be modified are crop rotation, plowing, irrigation schedule management, drainage, embankment work, soil improvement, grazing, pruning, thinning, harvesting, and controlling the amount and timing of fertilizer and pesticide use [12].

The APEX model was developed to apply the functions of the EPIC model to an entire farm or a small-scale watershed. This model is also equipped with the function of tracking water, sediments, nutrients, and pesticides that exist in various areas, such as complex terrains, watercourse systems, and watershed exits [10,12]. Using this tracking mechanism, the interactions among the surface runoff, return flow, sedimentation and decomposition of deposits, transfer of nutrients, and groundwater flow can be monitored. The evaluation enables the estimation of water quality that considers nitrogen (ammonia, nitrate, and organic form), phosphorus (soluble, adhesive, mineral, and organic), and pesticide concentrations [12].

BMPs are methods used to control pollutants that occur from NPSs to reduce their concentration levels and satisfy the standards of the target water quality. In the United States, numerous states, including New York and South Carolina, promulgate manuals that specify the actions and education required to apply BMPs. Furthermore, government agencies require forest and land owners and the forestry department to work together to implement BMPs [21].

P. Tuppad et al. [22] evaluated the effects of various BMPs, such as nutrient management, brush management, range planting, conservation cropping, contour farming, terrace, ponds, grade stabilization structures, and grassed waterways, using the APEX model on Mill Creek Basin (280 km2), Texas.

#### *2.2. Development of the QAPEX Analysis System*

The QAPEX analysis system was developed using Python (www.python.org, accessed on 1 February 2018), based on the QGIS platform. Python exhibits considerable potential for future use because it is free, its grammar is easy, and it contains various libraries that include open-source packages, such as PyQT. The QAPEX analysis system uses a terrain analysis with digital elevation models (DEMs; TauDEM, http://hydrology.usu.edu/ taudem/taudem5, accessed on 1 February 2018) [23], which offer numerous functions to process geographical information, and the QGIS software. The system is based on QSWAT developed by Dile et al. [19].

The QGIS software provides numerous functions to the QAPEX analysis system, including layer panels that indicate legend information and canvases that enable visualization for users. In particular, the QGIS software uses the geospatial data abstraction library (GDAL, www.gdal.org, accessed on 1 February 2018) to process data in the form of raster and shape. The GDAL supports 26 vector data formats, including the ESRI shapefile, and 72 raster file formats, including ArcInfo ASCII Grid and GeoTIFF. Because the QAPEX analysis system uses TauDEM, it requires a DEM in GeoTIFF format. If a raster file provided by a user is not in the GeoTIFF format, then GDAL may be used to convert file formats.

The main functions of the QAPEX analysis system are to (1) delineate watershed, (2) create hydrological landuse units (HLUs), (3) edit inputs and run APEX, and (4) visualize the output, as displayed in Figures 1 and 2. The first and second steps are performed using QSWAT functions developed by Dile et al. [19].

**Figure 1.** Flow chart of QAPEX analysis system [19].


**Figure 2.** Major functions of the QAPEX analysis system.

2.2.1. Linking the Tool (Watershed Delineation and HLU Creation) from QSWAT to QAPEX Analysis System

The script used to estimate the watershed in QSWAT is also used in the QAPEX analysis system. The script uses various functions to estimate and delineate watersheds, such as the pit removal of TauDEM, calculation of the flow path and slope, estimation of the catchment area with the flow direction method, and delineation of a drainage network using the threshold value of a catchment area [19,23–25]. In TauDEM 5.1.2 version, the QAPEX analysis system is used for realizing the message passing interface (MPI), which allows the division of a single task into multiple processes [19,26]. However, to use the MPI function in the QAPEX analysis system, users must install the free MPI program offered by Microsoft.

The QAPEX analysis system is equipped with the QSWAT function of defining a stream using a stream file (vector file) held by users [19]. This function is useful for accurately identifying the location of a stream because it is difficult to do so with the TauDEM function, which exhibits a flat DEM. To form a stream network within the model, a threshold value (or the number of DEM cells) is required. In the QAPEX analysis system, the basic threshold value is set as 1% of the DEM size, and users can adjust the threshold value to either increase or decrease the number of streams [19]. To delineate a basin in TauDEM, at least one outflow gate defined with a point is required. In the QAPEX analysis system that uses QSWAT functions, users can use an outflow gate file (vector file) of a stream and specify outflow gates within the QGIS software canvas [19]. The APEX model creates models after homogeneous properties in territorial units of HLUs, such as weather, soil, land use (farming management schedule), and topographic maps [12]. However, as in the case of ArcAPEX, assigning HLUs to each subwatershed after delineating a watershed limits the simulation of the main HLU when multiple HLUs exist within a subwatershed. Therefore, this study applied hydrological response units (HRUs) used in the SWAT model to develop a method of simulating multiple HLUs within each subwatershed, instead of selecting a representative HLU from multiple HLUs. The "multiple HLUs within each subwatershed" method is useful because it can precisely reflect actual conditions in the model by considering HLUs that exclude the representative HLU (land use and soil information).

The QAPEX analysis system adopted the function used in the QSWAT to reduce the number of HRUs. This function can be categorized into two areas. In the first area, as in the case of the ArcAPEX model, we can assign the representative HLU within a watershed using either of the following steps: (1) selecting the largest value among land use, soil, and slope range or (2) selecting the largest HLU within a subwatershed. In the second area, the simulation of the "multiple HLUs within each subwatershed" method is performed by defining the number of subwatershed by (3) filtering the range of land use, soil, and slope; (4) filtering according to the surface area; or (5) directly designating a number [19]. This function enables users to select one of the five methods to automatically apply either an HLU or multiple HLUs.

2.2.2. Developement of Input Data Building Tool and BMP Application Tool in the QAPEX Analysis System

In this study, to run the QAPEX analysis system within the QGIS software, the database built into the APEX model was used to construct data files on crop properties, plowing properties, fertilizer properties, pesticide properties, soil properties, season information, and meteorological sites. In addition, a database using TauDEM was used to develop a data file (\*.SUB) on the properties of each HLU and watershed. In particular, the APEX-CONT.DAT file used to manage the operation of the QAPEX analysis system may be created based on the database built within the APEX model, and users can write variables for the new control file. In addition, users can input meteorological data and the farming management schedule required to run the QAPEX analysis system. The APEX model uses the engine of the WINAPEX0806 model, provided by Texas A&M AgriLife Research

(https://epicapex.tamu.edu, accessed on 1 February 2018), at no charge to run the QAPEX analysis system.

Koo et al. [27] developed farming management schedules for beans, corn, potatoes, sweet potatoes, red beans, napa cabbage, white radishes, peppers, onions, green onions, garlic, spinach, lettuce, pumpkins, cabbage, cucumbers, watermelons, carrots, sesames, perillas, and peanuts. Furthermore, Choi et al. [11] devised farming management schedules for 25 regions in South Korea by considering each region's rice field characteristics.

As a model that was developed to analyze the effects of farmland management on small watersheds, the APEX model can consider not only various farming activities, such as drainage for irrigation, intertilling, buffer strips, fertilizer and manure use, and plowing, but also a variety of BMPs. The BMPs that can be applied in the APEX model are as follows: (1) structural preservation methods, such as check dams, diversion dikes, filter strips, grassed waterways, and interceptor swales/rain gardens; (2) nonstructural preservation methods, such as cropland conversion to pasture, no till, rainwater harvesting, and vegetation; and (3) waterway preservation methods, such as channel protection, riparian forest buffer, mulching, and stream restoration [28].

The interface to apply BMPs, however, is not available on the WinAPEX system and ArcAPEX interface, which causes inconvenience because of the manual search and modification of all variables related to BMPs. Furthermore, the variable-adjusting interface on the WinAPEX system simply lists numerous variables, which renders it difficult for users to determine certain variables from the list. Therefore, this study addressed this inconvenience by developing an interface within the QAPEX analysis system, such that variables related to BMPs can be easily adjusted.

#### 2.2.3. Development of Visualization Function in QAPEX Analysis System

In 2004, South Korea first introduced total maximum daily loads (TMDLs), a scientific water quality management method that sets and manages the total discharge of contaminants by region, in the Nakdong River water system, and gradually expanded its application to water systems in the Geumgang, Yeongsangang, and Seomjingang rivers [29]. A commonly used method for planning TMDLs is schematizing an LDC to establish appropriate control methods according to flow duration conditions [30]. The LDC displays the relationship between the individual water quality and target water quality under the total flow condition of a stream [31]. The LDC can identify the effects of seasonal flow changes on the water quality and provides an easy understanding of the frequency and volume of target water quality and volume of allowed reduced loads. Therefore, investigating the cause of pollutants exceeding the target water quality is critical [32]. Numerous states in the United States use the LDC in TMDL setup, data analysis, and load management techniques for points and NPSs based on the flow size [33].

The results of the APEX model are generated through the variable set in PRNT\*\*\*\*.DAT files. Furthermore, simulation results can be generated from a subwatershed or an entire watershed according to the day, month, and year; a summary file of a watershed can be obtained [10]. However, the simulation results from the existing APEX model are displayed in the text form, requiring users to perform additional study to visualize the results. The QAPEX analysis system includes the QGIS software, which enables users to visualize simulation results using the PyLab library of the Python programming language. This system incorporates an interface that can graph the information in \*.RCH files for GIS-related specialized downstream areas. The interface is equipped with a general plot function that chronologically graphs simulation results by day, month, and year, and the FDC and LDC plot functions that graph simulation results on the FDC and LDC.

The LDC produced by the QAPEX analysis system follows the methods outlined by the NIER. (1) The FDC is created using flow data from the QAPEX analysis system results, (2) the target water quality input by users is converted into a target LDC, and (3) an LDC is produced for variables selected by users.

#### *2.3. Demonstrative Application of the QAPEX Analysis System*

This study compared the results obtained using the main HLU method and multiple HLU functions on the QAPEX analysis system. The QAPEX analysis system was applied to a model area to provide an example of the visualization function of the analysis system. The model area selected in this study is the Jaun-ri watershed located in Nae-myeon, Hongcheon-gun, Gangwon-do Province, South Korea. Along with the Mandae and Ga-a districts, Jaun district, which includes Jaun-ri, was re-designated as an NPS control area in October 2015. The NPS reduction project was performed in the Jaun-ri area, located in the upper Soyangho Lake (MOE, nonpoint.me.go.kr). The Jaun-ri watershed covered an area of 78.25 km2 and its average elevation was 812.74 m, ranging between 570 and 1476 m.

The DEM used in the QAPEX analysis system to create a watershed and HLU/multiple HLUs is based on the system developed by Koo et al. [34], and it is processed into a 30 m × 30 m DEM. Koo et al. [34] previously produced a digital map on a 1:5000 scale into a 5 m × 5 m DEM suggested by Park et al. [35] by following DEM creation methods provided by the National Geographic Information Institute. The data to create an HLU/multiple HLUs used major classifications of land use maps provided by the MOE and detailed soil maps provided by the National Institute of Agricultural Science of Korea RDA. This study used data on soil characteristics according to each soil series produced by Koo et al. [27], which used information available on the Korean Soil Information System (soil.rda.go.kr). A farming management schedule for potatoes was applied to the farming area. Nonfarming areas, including built-up and dry areas, forest areas, grasslands, wetlands, bare land, and water bodies, used farming management schedules established in the ArcAPEX interface to simulate respective soil use. Furthermore, the variables used in Choi et al. [11] to simulate South Korea's environment in the APEX-Paddy development were used as input variables required to run the QAPEX analysis system.

#### **3. Results**

#### *3.1. Comparing Characteristics According to the Classification Units of Subwatersheds*

This study compared the characteristics between classification units (HLU/multiple HLUs) of the subwatershed by implementing the main HLU/multiple HLU methods of the QAPEX analysis system for the model area of Jaun-ri (Nae-myeon, Hongcheon-gun). Based on the analysis, 41 main HLUs were present in Jaun-ri, which were further divided into 821 multiple HLUs (Figure 3). Among the 41 main HLUs, 39 were forests (FRSD) and two were agricultural areas (AGRL), indicating that 99.92% of the area are forests and 0.08% are used for farming. The outcome revealed the phenomenon where forests are applied as the main HLUs within a subwatershed because the majority of land use in South Korea is defined as so. Through the implementation of the multiple HLU function, 0.7% of land use was for build-up and dry areas (URBN), 13.1% for agricultural areas (AGRL), 83.0% for forests (FRSD), 1.8% for grasslands (PAST), 1.0% for wetlands (WETN), 0.3% for bare land (AGRC), and 0.1% for water bodies (Table 1). The simulation outcomes are similar to those of actual land use areas. Therefore, in the case where multiple forms of land use exist within a subwatershed, creating uncertainties toward the implementation of the main HLU method, it is accurate to apply the multiple HLU method to replicate actual circumstances within the simulation model.

**Table 1.** Results of land use classification using HLU/multiple HLUs.


URBN: build-up and dry areas AGRL: agricultural areas FRSD: forests PAST: grasslands WETN: wetlands AGRC: bare land WATR: water.

**Figure 3.** Results of HLU/multiple HLU function in the QAPEX analysis system for the study area (Jaun-ri). (**a**) HLU, (**b**) Full HLU (multiple HLUs).

#### *3.2. Editing Database and Running the QAPEX Analysis System*

#### 3.2.1. Integrated Interface

An integrated interface (Figure 4) was developed to input and edit the data required to run the QAPEX analysis system in the QGIS software. The user first selected the database file of the APEX model, weather data from meteorological observation sites, and farming management schedule data through the integrated interface to run the QAPEX analysis system. The user then created a control file (APEXCONT.DAT) to manage the operation of the system. The control file can be created using two methods: applying variables entered into the APEX model database and entering and applying new variables through the control file variable adjustment interface. After following the aforementioned procedure, data files necessary for running the QAPEX analysis system were created by clicking on the "Apply" button displayed in Figure 4.


**Figure 4.** User interface for connecting the database of the APEX model and running QAPEX.

The "Edit parms" function on the integrated interface leads users to an interface where they can edit data files created through the integrated interface, such as the watershed variable adjustment interface and BMP interface of the QAPEX analysis system. Finally, after naming the file and saving the folder through the "Scenario name," the "Run" button is clicked to run and save the QAPEX analysis system.

#### 3.2.2. Control File Variable Adjustment Interface

The control file (APEXCONT.DAT) used to adjust the variables necessary to run the APEX model was developed so that it could be created in two methods. The first method involves fetching variables entered in the APEX model database, and the second method is the user creating the APEXCONT.DAT file by adjusting variables using the control file variable adjustment interface (Figure 5). In the second method, the initial set points of the entered variables were set as the default values of the WinAPEX system. The interface to adjust variables in the control file was organized in the same layout (order and line) as the APEXCONT.DAT file for user convenience.


**Figure 5.** User interface for creating and editing the control file (APEXCONT.DAT).

Furthermore, to have access to the explanations of variables within the QAPEX analysis system, "Parameter description" was added to the interface so that users could read descriptions on a searched variable.

#### 3.2.3. Watershed Variable Adjustment Interface

Similar to the case of QSWAT using TauDEM to derive the characteristics of a watershed, the QAPEX analysis system applies computed results of TauDEM, HLU/multiple HLUs, and weather and farming management schedule data entered by users to develop a data file (\*.SUB) on the characteristics of a watershed, including soil characteristics (INPS), farming management schedule (IOPS), meteorological sites (IWTH), latitude (YCT) and longitude (XCT), watershed surface area, waterway length from the farthest point away from the watershed exit (CHL), waterway depth (CHD), inclination of main waterways (CHS), waterway length of tracking downstream area (RCHL), and waterway slope of tracking downstream area (RCHN). The initial set points for the moisture content in the deposited snow (SNO), residues in dead crops (STDO), number of manning related to fields (UPN), and irrigation code (NIRR) applied in \*.SUB used default values in the WinAPEX model.

The SUB file created through the QAPEX analysis system may be modified to fit the characteristics of relevant watersheds by users through the watershed variable adjustment interface. The user selects the subwatershed number to edit and its appropriate HLU and clicks on the "Read" button (Figure 6), and the interface reveals the HLU with applied variables. The user may adjust the necessary variables and click on "Save" to edit the variables of the HLU. Furthermore, to change the same variable for the entire watershed area, select "All" from the "Select subbasin" combo box to edit the variable for all HLUs. The changes are applied to all variables, except those marked "-".


**Figure 6.** User interface for adjusting the subbasin (\*.SUB)—related parameters.

The description of variables displayed in the interface can be verified by typing the name in "Parameter description." Two lines are organized per tab in the interface, such that the variables used in the \*.SUB file can be easily located.

#### 3.2.4. BMP Variable Adjustment Interface

This study developed a user interface (Figure 7) that can adjust variables related to BMPs within the QAPEX analysis system for user convenience. Among the BMPs that are considered in the APEX model, this study first applied BMPs on structural installation: check dams, diversion dikes, filter strips, grade stabilization structures, grassed waterways, interceptor swales/rain gardens, pipe slope drains, sediment basins, silt fences, terraces, triangular sediment dikes, and wetland creation. When users select the HLU and BMP of a subwatershed through the interface, the variables relevant only to the watershed appear on the right, and they may adjust the variables to consider the BMP.

#### *3.3. Development of the Visualization Function Interface*

#### 3.3.1. Integrated Interface

This study developed an integrated interface (Figure 8) to provide users with functions to graph the general plot, FDC plot, and LDC plot. To use the visualization function in the QAPEX analysis system, users must set the scenario, subbasin, HLU, and graph period to be displayed on the graph, and then enter relevant data for each function. Next, clicking on "Plot" in Figure 8 produces a graph for each function. The "Form" function is added to allow users to change the layout of graphs, such as the inclusion of the auxiliary axis, inclusion of a legend and its location, line style and color, axis titles, unit of the *Y*-axis, and graph title.


**Figure 7.** User interface for adjusting BMP-related parameters.


**Figure 8.** User interface for the visualization of results in the QAPEX analysis system.

#### 3.3.2. General Plot

The "general plot" function in the QAPEX analysis system graphs simulation results in a chronological manner of day, month, and year. This function can selectively visualize the variables generated in the \*.RCH file yielded by the simulation results of the QAPEX analysis system. Not only can this system graph a number of variables simultaneously, but it can also retrieve \*.RCH files from other scenarios and visualize two or more scenarios simultaneously. Furthermore, by entering csv-format observation data, the "general plot" function can plot the observation data and simulation results within the same graph. Therefore, not only is it possible to visualize simulation results through the "general plot" function, it is also possible to perform various analyses, such as comparing scenarios, observation data, and simulation results.

Figure 9 displays the application of the "general plot" function on the model area (Jaun-ri) for the water yield outflow (CMS). The layout of the graph is set at default values, which may be changed by users through the "Form" function to edit the graph title, axis titles, legend, variable names, and units.

**Figure 9.** General plot function among the visualization results of the QAPEX analysis system for the water yield outflow (CMS).

#### 3.3.3. FDC/LDC Plot

The QAPEX analysis system is equipped with the functions "FDC plot" and "LDC plot" to display the simulation results (\*.RCH) for the FDC and LDC, respectively. The "FDC plot" function can be run without an additional data input. The LDC plot function requires users to select the variables and target water quality to be demonstrated through the LDC. By adding the input data of the observation date, CMS, and observation data in csv format, the FDC/LDC plot functions produce FDC/LDC only composed of the observation data in addition to FDC/LDC generated by simulation results. Because the FDC/LDC plot functions developed in this study can indicate FDCs and LDCs of areas that partially or completely lack observation data, the two functions can compensate for the absence of monitoring data from temporal and locational limitations.

Figure 10 displays the application of "FDC plot" and "LDC plot" functions for the model area (Jaun-ri), where the LDC plot reveals the results for nitrogen (NO3O, kg) transferred with water out of the downstream area. The default values were used for the layout of the graph.

**Figure 10.** LDC plot function among the visualization results of the QAPEX analysis system for the study area (Jaun-ri).

#### **4. Conclusions**

Based on the EPIC model, the APEX model was improved and expanded into various models, such as WinAPEX, ArcAPEX, and i\_APEX. This study synced the APEX model with the QGIS software, an open-source GIS software, and developed the QAPEX analysis system that can use GIS functions without a fee. The study also reduced the inconvenience of users manually inputting data of watersheds, as in the case of the WinAPEX system. Furthermore, the system created the "multiple HLUs within each subwatershed" method to consider multiple land uses and soil maps, which is an improvement on the ArcAPEX interface where a subwatershed is calculated as a single land use/soil map through the main HLU method. The "multiple HLUs within each subwatershed" method eliminates uncertainties resulting from single land use/soil map simulation. This study also developed an interface to adjust variables for BMPs that are performed as control methods for NPSs so that BMPs may be applied and run in the model. Furthermore, the visualizations of the comparison between the simulation results of multiple scenarios and the functions of FDC/LDC were added. Such visualization functions express the water quality and water yield outflow through graphs, rendering it easy for users to understand. In particular, the LDC is advantageous for use in identifying the cause of pollutants exceeding the target water quality. Therefore, the QAPEX analysis system can be used as a tool to gather national policy data by analyzing NPS control areas or reducing the effects of applying BMPs.

**Author Contributions:** Conceptualization, J.K. (Jayoung Koo) and J.K. (Jonggun Kim); Data curation, J.J.; Formal analysis, J.K. (Jayoung Koo) and M.-K.K.; Funding acquisition, K.-J.L.; Investigation, J.K. (Jayoung Koo) and S.L.; Methodology, J.K. (Jayoung Koo), D.-S.S. and S.L.; Project administration, K.-J.L.; Resources, J.K. (Jayoung Koo) and J.J.; Supervision, K.-J.L.; Validation, J.K. (Jayoung Koo), J.K. (Jonggun Kim) and J.R.; Visualization, J.K. (Jayoung Koo); Writing—original draft, J.K. (Jayoung Koo); Writing—review & editing, J.K. (Jayoung Koo), J.K. (Jonggun Kim) and S.L. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was supported by the Korea Environment Industry and Technology Institute (KEITI) through the Aquatic Ecosystem Conservation Research Program funded by the Korean Ministry of Environment (MOE), grant number 2020003030004.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** QAPEX analysis system described in the manuscript will be downloaded from https://github.com/Bong67/QAPEX (accessed on 1 February 2018).

**Acknowledgments:** The authors gratefully acknowledge contributions from the Ministry of Environment of Korea for supporting this work. Finally, we would like to thank the anonymous reviewers, whose comments and suggestions helped improve the manuscript.

**Conflicts of Interest:** The authors declare no known competing financial interests or personal relationships that could have influenced the work reported in this paper.

#### **References**


MDPI St. Alban-Anlage 66 4052 Basel Switzerland Tel. +41 61 683 77 34 Fax +41 61 302 89 18 www.mdpi.com

*Sustainability* Editorial Office E-mail: sustainability@mdpi.com www.mdpi.com/journal/sustainability

MDPI St. Alban-Anlage 66 4052 Basel Switzerland Tel: +41 61 683 77 34

www.mdpi.com

ISBN 978-3-0365-5102-9