Development of a user-friendly web-based rainfall-runoff model

The objective of this study is to develop an open access web-based conceptual Xinanjiang model for supporting calibration process with user-friendly interfaces. This makes it possible to calibrate the model for any user irrespective of the location, resource availability or technical capability. This interface not only allows the user to run the model in a user-friendly environment, but also provides useful support for better calibration by suggesting parameter settings based on observed hydro-climatic data, calculating Nash-Sutcliffe efficiency at daily, monthly and annual scales using time series of observed and simulated discharge data for every successful model run and hydrograph visualization. Moreover, the user can further verify the agreement between the observed and simulated discharge by visually inspecting the hydrograph. The interface allows rendering hydrographs using simulated and observed discharge for a respective model run or group of model runs. The user can perform repeated model runs with different parameter sets until it achieves a satisfactory accuracy. The user can download the result and parameter files for all or any specific model run.


INTRODUCTION
Rainfall-runoff models play an important role in floodforecasting, planning and water resource managements. There is a large amount of literature related to the development of rainfall-runoff models such as the Tank model (Sugawara, 1995), HBV model (Bergstom, 1995) and TOPMODEL (Beven et al., 1995). For implementation and operation of any rainfall-runoff model, parameter calibration is required. However, a major difficulty associated with the use of rainfall-runoff models in hydrology is their calibration since most of these models involve a large number of parameters. Researchers have been exploring ways to incorporate "expert knowledge" of watershed models into the calibration procedures (Madsen, 2000;Luo et al., 2011;Li and Lu, 2012;Lu and Li, 2014). As long as analysis results and models exist only on paper (e.g., in an academic journal), readers may know the advantages of a particular model and method. However, they may face technical problems in implementing a hydrological modeling simulation, the simulation is, and always was, a highly specialist application with a high degree of difficulty. Besides simulation beginners often require a large amount of time to accumulate the knowledge as well as the experience necessary to overcome the techni-cal complexity of simulation. Even for the experienced user, building, executing, and analyzing a simulation model can be a very time-consuming and error-prone process (Byrne et al., 2010). An ideal way to handle such situations is creating a transparent model with a suitable parameter estimation method which could be accessible through the Internet. Such a solution will be a real breakthrough in hydrological modelling.
During the last decade, quite a few studies have been conducted on the calibration of hydrological models integrated with a web system. Pande et al. (2000) developed an interactive web-based application to determine the impact of landuse change on hydrology through a Long-Term Hydrologic Impact Assessment model run intended to aid in policy making. Later, Muthukrishnan et al. (2006) integrated the parameter calibration support process into this system to provide a remotely accessible gateway for the users from around the globe. Bacu et al. (2013) developed gSWAT application which allows many users to access and use the computational resources provided by Grid infrastructure in the calibration process of a complex Soil Water Assessment Tool hydrologic model using a web-based environment. Additionally, some researchers focused on designing WebGIS-based systems such as a hydrograph analysis tool (Lim et al., 2005), a rainfall-runoff model (Jia et al., 2009) and a flood-forecasting system (Al-Sabhan et al., 2003;Kulkarni et al., 2014). These web-enabled applications certainly provide a lot of supports to the users. One of the advantages of a web-based system is cross platform capability, which is accessible from web browsers within different operating systems without compiling and maximizes the user benefits.
If the application is developed as platform dependent and Windows-based, it is relatively easy to implement and follow the documentation even for beginners. On the other hand, if the application is Linux-based, inexperienced users can face technical problems. In addition, as platform dependent applications rely on a desktop environment, user's machine will still have to match certain specification based on performance needs. Moreover, it may also take time to become familiar with the system for beginners. Besides these points, setting up a programming environment is also a big problem. In order to bridge these gaps and provide a lot of support to users, web technology encourages us to develop web-based rainfall-runoff model with user-friendly interface.
The XinAnJiang model (Zhao, 1992) here after referred to as the XAJ model is a physically meaningful conceptual hydrological model. The XAJ model has been extensively used in humid and semi-arid regions of China and other parts Correspondence to: K.H. Kyi, Department of Civil and Environmental Engineering, Nagaoka University of Technology, 1603-1, Kamitomioka, Nagaoka, Niigata 940-2188, Japan. E-mail: ms.khinhtaykyi@gmail.com of the world to simulate runoff generation within a catchment. However, technical problems in not only its implementation, but also its execution and calibration processes might be tremendously arduous for new users. Further, there have been no studies that have integrated the XAJ model with web technologies and parameter estimation methods to provide calibration process for general application to a user's watershed of interest. Therefore, to overcome this challenge and bridge the gap between XAJ model calibration and non-expert users by demonstrating the suitability of the web as a medium for calibration with historical data records, this study focuses on developing a user-friendly freely accessible web-based environment to support XAJ model users through calibration support, parameter suggestion after Li and Lu (2014), customized interactive visualization of hydrographs and calculation of Nash-Sutcliffe efficiency (NSE, Nash and Sutcliffe, 1970).

XAJ MODEL
The XAJ model was developed based on the concept of repletion of storage, thus, the runoff is not produced until the soil moisture content of the aeration zone reaches field capacity and, thereafter, all the rainfall excess equals the runoff without further loss. In the original XAJ model, a basin is divided into a set of sub-basins. Then outflow from each sub-basin is calculated from corresponding rainfall data independently and routed down the channels to the main basin outlet. Based on the concept of runoff formation on the repletion of storage, simulation of outflow from each sub-basin consists of four major parts: evapotranspiration, runoff production, runoff separation and flow routing. Then a Muskingum method is used for the routing of discharge from the outlet of each sub-area to the outlet of the main basin. However, for the single basin simulation, Lu and Li (2014) used a modified version of XAJ model in a pure lumped way and excluded the channel routing component. The schematic diagram of the XAJ model is illustrated in Figure 1. The XAJ model receives areal mean rainfall, P, and potential evaporation, E p as inputs. The outputs are the streamflow, Q, at the outlet of the basin and actual evapo-traspiration, ET, from the whole basin which is the sum of the evapotranspiration from three soil layers: upper soil layer (EU), lower soil layer (EL) and deeper soil layer (ED).
The runoff generation of the XAJ model is dictated by the respective soil moisture and storage capacities of three vertical soil layers: upper soil layer (WU), lower soil layer (WL) and deeper soil layer (WD). The upper soil layer is thin and represents the vegetation and water surface. The lower soil layer represents the zone where the vegetation roots dominate and the moisture transportation is mainly driven by the potential gradient. The deep soil layer represents the soil beneath the lower layer where only the deep-rooted vegetation can absorb water and the potential gradient is very small. Since the runoff is not produced until soil moisture of the aeration zone reaches the field capacity, water in unsaturated soil cannot become runoff and it can only be depleted by evapotranspiration. The soil water is evapotranspired from upper layer, lower layer and finally, the deep layer. Evapotranspiration is controlling factor for producing soil moisture deficiency. Normally, soil moisture deficits vary from place to place. To provide a non-uniform distribution of tension water capacity throughout the basin, a tension water capacity curve has been introduced in the XAJ model. Then according to model structure, runoff was separated into three components as surface runoff (R s ), inter flow (R i ) and ground water flow (R g ). Finally, these three runoff components concentrated into the main outlet of basin as Q s , Q i , and Q g respectively. The state variable areal mean tension water storage, W, is the sum of three components: WU, WL, and WD which are soil moisture storage capacity of respective layer. S is the areal mean free water storage over the runoff contribution area factor F r . R b is direct runoff produced by impervious areas while R represents runoff from pervious areas. A detail explanation and description of the model is available in Lu and Li (2014).
There are 15 parameters in the XAJ model. To compensate for errors associated with the rainfall measurements, an adjustment parameter C p is introduced to adjust the rainfall, P, from the areal mean observed rainfall, P a . Similarly, to overcome the difficulties in calculating potential evaporation, E p , another adjustment parameter C ep is introduced to adjust calculated pan evaporation, E pan to E p . The other parameters and their physical meaning are given in Table I.

WEB-BASED XAJ MODEL TO SUPPORT CALIBRATION
The web-based user interface to run and calibrate the XAJ model has been designed by PHP (Hypertext Preprocessor) programming language and open access on Debian GNU/ Linux 3.2 based Intel Xeon E5410 @ 2.33 GHz server via http://lmj.nagaokaut.ac.jp/~khin. The interface is a symbiotic example between ICT and hydrological analysis. The interface is compact, well defined and user-friendly. It provides some basic knowledge about the XAJ model, its parameters and their usual range. It also clearly guides the users to easily run and calibrate the model step by step. Starting execution of the system requires users to prepare only 1 input file (Model input; discussed in sub-section of system structure) and the name of the target basin, which provides ease in data preparation. During calibration, the system suggests the Figure 1. Schematic structure of the XAJ model parameter values for C p and C ep based on Li and Lu (2014). Additionally, it allows the user to visualize the customizable hydrograph. Moreover, it helps the user to verify the agreement between the model output and the observed streamflow through calculating NSE.

System structure
The system structure consists of 4 main components ( Figure 2) namely: pre-processing, model input, calibration of the XAJ model and model output especially for supporting calibration process. All these components are interlinked together to perform the task in a convenient way. Before starting to use the XAJ model, the user needs to register to the system. The user information is recorded in a MySQL database and used to maintain user privacy. After registration, the only necessary procedures are defining the study basin name, uploading the input data file to run the XAJ model and providing parameter values to start the calibration process.

Pre-processing
The main function of this component is preparing necessary procedures required for storing the user's previous studied record in accordance with a specific basin. In this step, the new user needs to specify the river basin name that he/ she is interested-in (Supplement Figure S1). Once, it receives the name of the river basin, the system will automatically detect the latitude and longitude of the basin of interest using Geocoding service of Google Maps Javascript API (Supplement Figure S2) and store all the information in database as previous studied record. The existing user can choose whether he/she wants to continue with the previously analyzed river basin or to start with a new one (Supplement Figure S3). In case the existing user wants to start with a new river basin, he/she needs to define the basin in similar way to a new user.

Model input
After successfully defining the river basin, the user needs to upload an input data file in a specific format. The model accepts input data in txt format (.txt extension) with four data fields. The input data should include date (yyyy/mm/ dd), P (mm d -1 ), E p (mm d -1 ) and Q (mm d -1 ) in field 1, field 2, field 3 and field 4, respectively (red-rectangle area of Supplement Figure S4). An example of input file requirement with clear instruction is added into the interface for user help (blue-rectangle area of Supplement Figure S4). Once the user clicks the upload data file, the system checks the consistency with required file format and content. Any inconsistency generates an error message and directs the user to rectify and upload the files again.

Calibration of the XAJ model
The successful upload of input file guides the user to the XAJ model calibration interface. In this step, the user needs to adjust the XAJ model parameter values and soil moisture  Figure 2. Web-based model structure initial conditions for WU, WL and WD. The physical meaning of the parameters, their usual range and sensitivity (after Li and Lu, 2014) to the model output are presented for user help (Supplement Figure S5). Out of 15 parameters, the system suggests C p and C ep values based on the user's input file after Li and Lu (2014). The user can accept the suggested parameter values or set their own set of parameters. Besides setting the parameter values, the user needs to define the model soil moisture initial conditions according to the field capacity defined for WU, WL and WD. The system also instructs the user to confirm that the model initial condition values cannot be larger than the field capacity (Supplement Figure S5). However, if the user intends to run the model with inconsistent model initial conditions, the system directs the user to check the model initial conditions once again.
Once the user defines all the model parameters, he/she can run the model on a daily timescale by selecting a pop-up menu.

Model output
After successfully running the model, the user can see the simulation success in terms of daily, monthly and annual NSE. The user can generate and visualize hydrographs by selecting the parameter set and clicking render graph button. The user can also visualize the enlarged interactive hydrograph by double clicking on the graph. The enlarged graph will be opened in a new window and the user can customize the hydrograph based on their scale of interest. The user can repeat the process until they are satisfied with the model output. The interface also allows the user to sort the parameter sets based on the NSE. Once the user finishes their calibration, they can download the output files by clicking the download tab. Clicking on the download tab directs the user to a new window where they can select the files to be downloaded. The downloadable files appear in the following format: [river basin name > input file number: parameter set number]. Double clicking on the desired file initiates the download process. The downloaded file is in ZIP format with 5 files including a description of result files in ReadMe. txt.

Background processes Executing the XAJ model
This web-based platform uses the executable conceptual XAJ model coded with FORTRAN (FORmula TRANslation) programming language, designed specifically for scientific numerical computing developed by Yamamoto and Lu (2009).

Estimating and suggesting data adjusted parameters
Recently, Lu and Li (2014) investigated the sensitivity of parameters in the XAJ model at annual, monthly and daily scales intending to identify the complex interaction among the parameters during calibration. Based on the sensitivity analysis, Li and Lu (2014) introduced a new concept of using the aridity index to narrow the parameter space. The outcome of their research has been validated and proved efficient enough to keep the same accuracy compared with other state of the art methods. However, they concluded that the efficiency is unstable and therefore suggested to use this method as a preparatory the confirming distribution of data adjusted parameter values. They pointed out that keeping the α value constant at 1.15, C p and C ep values can be determined together using Equation (1). Considering stability and robustness, estimation of C ep by keeping C p = 1 has been recommended as a starting point of calibration process.

 
where "R/P g " means runoff coefficient (ratio of annual runoff to precipitation) and ξ g,pan is pan aridity index (ratio of annual pan evaporation to precipitation).

Calculating Nash-Sutcliffe efficiency
To determine the parameter values that can provide the best fit between observed and simulated discharge, NSE of daily, monthly and annual scale is calculated by the system as an indicator of the goodness-of-fit. The system calculates NSE based on Equation (2).
where t Obs Q and t model Q are observed and modeled discharge at time step t. And n represents time steps of user's data period.

Hydrograph
To visually verify the agreement between the model output and the observed data set, and the effects of parameter changes, the system prepares a hydrograph. The system has been designed to generate the graph using gnuplot (version 4.6). The system also allows the user to render a composite graph with multiple parameter sets (maximum 5). Additionally, the system use Highcharts and Highstock packages (provided by http://www.highcharts.com; last accessed March 23, 2014) to generate enlarged interactive hydrographs. This function is enabled once the user double clicks on the hydrograph. This enlarged hydrograph allows the user to select their scale of interest and use the navigation bar to visualize in details.

CASE STUDY
To demonstrate the application of this web platform, a case study has been undertaken for the Pottawatomie Creek River basin (Supplement Figure S6), USA (stream gauge location latitude: 38.33N, longitude: 95.24W; Model Parameter Estimation Project (MOPEX) ID: 06914000). The catchment area is about 865 km 2 and lies within a mixed-humid region. This river basin specific data covering 53 years  was downloaded from Schaake et al. (2006) and used for the calibration process.
Using a Mozilla Firefox browser, we accessed the primary interface of the system (Figure 3) by inserting the web address (http://lmj.nagaokaut.ac.jp/~khin). From this interface the XAJ3F menu tab directs us to the log in or registration window link for new users (please see red-rectangle area in Figure 4). After login, the system forwards us to define the river basin (Pottawatomie for our case). Once the river basin has been defined, the system guides us into the input data upload interface. At this interface, we uploaded the 53 year  input data file according to the prescribed data format. Successful upload of input data file allowed us to move to the parameter calibration interface ( Figure 5). This interface suggested the C p and C ep values (please see red-rectangle area in Figure 5). We accepted these values to start the calibration experience. Other parameters and the initial conditions were also set based on the prior calibration experience and usual range of parameters (please see the blue-rectangle area in Figure 5). Once all the parameters and initial conditions were declared, we clicked the "Run Model" button for daily simulation scale. The successful model run generated the NSE values, recoding all the parameter values in a tabular form ( Figure 6). For our case, keeping the suggested parameter values, daily NSE was 0.54, thus suggesting the suitability of the starting calibration for this particular basin. The hydrograph (blue-rectangle area of Figure 6) was then rendered by checking the box next to the parameter set table and clicking the render graph button. We opened the enlarged hydrograph (Figure 7) by double clicking on the hydrograph and visualize the hydrograph agreement. After visualizing the hydrograph, considering the NSE, we were satisfied with the calibration process and downloaded the result file by clicking the "download" tab.

CONCLUSIONS
The computational core of the famous XAJ model has been steadily extended to an easy-to-use, compact and supportive web-based platform. All relevant steps of the XAJ  . Main interface of the system model calibration process are linked through intuitive graphic user interface. The interface provides access to all functions via buttons and interactive user input screens. In addition, it brings a complicated model to users who are not necessarily modelers with easily understandable terms, graphs and tables, and thus reduces the gap between the user and technical knowledge. Another major strength of this system is coupling it with recently developed estimation methods for data adjustment values ) of the XAJ model. This built-in feature of automatic parameter suggestion and calculation of model efficiency enables the user to achieve better simulation efficiency in less time. Later, this web-based model can be steadily extended with other relative research results which focus on estimation of XAJ parameter values to be more powerful and helpful for calibration process.
This compact model also saves time for computation. For one simulation process, while new user takes less than 2 minutes from the registration process and step by step procedures to run model, existing users who use previously analyzed river basin datasets can finish in less than 1 minute. The total time for one simulation process also includes estimation process time for data adjustment parameter values of XAJ model, model running time (less than 10 seconds), daily, monthly, annual NSE value calculation time and creation of hydrographs. This means using this model is much faster than computing all processes one by one manually. Moreover, the system provides more flexibility for checking and comparing consequences of parameter values to a hypothesis by providing historical records for a particular study area. Furthermore, simulated output data is also provided to users with downloadable zip file so that related research analysis can be done based on those data. Currently, the system can only provide calibration process for daily time-stepping but theoretically, any web browser within different operating systems can be used to run this model. However at present, only Mozilla Firefox version 35 and later on both MS-Windows and Linux operation system has been tested. In the near future, we will try to upgrade the system to be compatible for any types of web browser.
In conclusion, this application has grown into a fully functional web-based modeling system to provide technical support for calibration process of the XAJ model. This webplatform provides huge benefits to hydrologists, researchers and students who wish to do calibration anywhere and anytime the internet is accessible. It is applicable to a wide range of basins with minimum effort without any technical software needed for hydrological modelling. Figure S1. Interface for creating user's interested new catchment Figure S2. Interface for searching latitude and longitude in accordance with user's study basin name Figure S3. Interface for displaying historical record in order to provide user's option: Continuing calibration with previously analyzed river basin or starting with a new one Figure S4. Interface for uploading dataset of study basin Figure S5. Interface for adjusting parameter values and describing physical meaning, their usual range and sensi-tivity Figure S6. Location of the Pottawatomie Creek River basin, Kansas, USA (MOPEX ID: 06914000)