SARDIM: a real-time hydrological monitoring platform of South American rivers

ABSTRACT Due to the frequent occurrence of extreme hydrological events in the South American rivers, this work aims to develop a hydrological monitoring platform open to the public, with a wide and intuitive access, using resources of an online geographic information system, in order to contribute to a better understanding of the behavior of these natural disasters. SARDIM (South America River DIscharge Monitor) has been developed using programming resources in languages such as Python and JavaScript. The data of the platform are derived from results of a continental scale hydrological simulation model (MGB - South America) that uses, among other information, precipitation data from the GPM (Global Precipitation Measurement) mission and from the MSWEP (Multi-Source Weighted Ensemble Precipitation) product. After a statistical analysis of the model results, the platform is updated daily and operationally, with new data on the flow duration and the return period of river flows, allowing the identification, monitoring and evaluation of the intensity of extreme hydrological events in South America.


INTRODUCTION
In the year of 2021 the Brazilian population faced the worst period of drought in almost a century due to lack of rainfall in the south-central region of the country (Cuartas et al., 2022).The socio-economic implications of this scenario were worrying, given the dependence of the Brazilian economy on water use.One of the main sectors affected was the electricity generation, since, according to data from the National Operator of the Electric System (ONS), approximately 65.2% of the electric energy used in the country comes from hydroelectric power plants (Empresa de Pesquisa Energética, 2021).In addition, the agricultural sector has also been heavily affected in recent years, as it is responsible for about 66,1% of the flow consumed in the country (Agência Nacional de Águas e Saneamento Básico, 2020).
According to data from EM-DAT (The Emergency Events Database, 2021) released for the period of 1900-2021, drought events recorded in South America affected about 90 million people and accumulated a total loss of approximately USD 21 billion.Flood events during the same period affected approximately 71 million people, including 49,000 deaths, with a total loss of USD 38 billion.
Aiming at the regular and periodic monitoring of the drought situation in Brazil, the National Water and Sanitation Agency (ANA) began to provide monthly consolidated information on the evolution of drought events through an online platform called "Monitor de Secas".The development of such system was driven by the successive drought events that occurred during an extremely dry period in the northeast region of the country in the year 2012 (Martins et al., 2015).
Similar tools aiming to monitor and analyze hydrological events through online platforms are increasingly being developed by the scientific community.The United Nations University -Institute for Water, Environment and Health (UNU-INWEH) in Canada recently launched a tool (https://floodmapping.inweh.unu.edu/) that generates instant, accurate street-level resolution maps of floods worldwide since 1985 (Mehmood et al., 2021).Another example of a tool where data is made available using a WebGIS platform is the GEOGloWS -ECMWF (Global Water Sustainability -European Centre for Medium-Range Weather Forecasts) flow forecasting system (https://geoglows.ecmwf.int/), which provides daily flow forecast data for a period of up to 15 days and historical information related to hydrological simulations for a period of 40 years for a large number of rivers in the world (Souffront Alcantara et al., 2019).However, available real-time information on current river conditions of South America as a whole comes only from global systems that do not focus on a specific region of the globe, and therefore it becomes important to produce and disseminate hydrological information also at other spatial scales, including local, national, and continental, using techniques focused on regionally relevant hydrological processes.New WebGIS experiences together with recent advances in continental-scale hydrological modeling based on regional knowledge (Siqueira et al., 2018) bring new opportunities for the development of hydrological monitoring systems specifically for the South American domain.
Easily accessible monitoring tools can play an important role in increasing the awareness level of river floods and droughts.
Therefore, the aim of the present work is to develop an online platform that provides real-time hydrological estimates for South American rivers, called SARDIM (South America River DIscharge Monitor).This platform uses a Geographic Information System applied to the Web to contribute with a better understanding of extreme hydrological events, both by the technical-scientific community and by society in general.Unlike traditional databases, the SARDIM platform enables the user to have more interactive access to the information provided, allowing the visualization of hydrological variables such as the current state of streamflow, flow duration curve, and return periods related to the rivers through informative tables and dynamic maps.

Model description
In order to develop the SARDIM platform, it was necessary to use a hydrological model that allows the estimation of river flows, as these values serve as background information for the estimation of statistical indices, such as the percentile of the flow duration curve and return period of drought and flood events.Considering the continental scale of the SARDIM platform, the use of observed data only would not be sufficient to adequately represent the hydrological situation in South America, given the large disparity between the number of gauging stations that are currently operating in real-time, in relation to the number of river reaches that compose the continent's main drainage network.Thus, the present study opted for the use of a computational modelling tool for the calculation of river flows.The hydrological estimates available through the SARDIM platform are derived by running the continental-scale version of the MGB model developed for South America (MGB-SA) (Siqueira et al., 2018) with precipitation data updated every day.
MGB is a conceptual, semi-distributed hydrological model developed for applications in large basins (Collischonn et al., 2007).To simulate the soil water balance, the current version of the model divides the basin into unit-catchments, which are subdivided into hydrological response units (HRUs), according to the type of soil and vegetation cover.Thus, it is possible to represent the spatial variation of physical characteristics in watersheds, which is one of the major challenges on distributed hydrological models' application.Evapotranspiration from soil, vegetation and canopy to the atmosphere is estimated by the Penman-Monteith equation.To represent the damping and attenuation effects of the flow generated within the unit-catchment, the model uses linear reservoirs to propagate surface and groundwater runoff to the stream network.Hydrodynamic propagation in rivers is based on the Saint-Venant formulations, solved explicitly, and approximated by despising the convective acceleration terms in the dynamic equation, according to a study presented by Pontes et al. (2015).
In the MGB-SA version, the pre-processing of the databases was carried out with the help of the GIS (Geographic Information System) package IPH-Hydro Tools (Siqueira et al., 2016), resulting in the discretization of 33,749 unit-catchments, considering a threshold of 1,000 km 2 to delimit the beginning of the drainage network.For the numerical stability of the model, such a network was segmented into river reaches with similar lengths of approximately 15 km.Reis et al.

3/8
The MGB-SA model was originally calibrated using the Multi-Source Weighted Ensemble Precipitation (MSWEP) data, a product that merges estimates of rainfall from gauge observations, satellite, and reanalysis data (Beck et al., 2017).The MSEWP data was used in the hydrological model simulations performed from 1980 to 2014.To enable model runs from 2015 up to the present day and provision of real-time hydrological estimations, MGB-SA was set up with the Global Precipitation Measurement (GPM) mission data processed by the IMERG (Integrated Multisatellite Retrievals for GPM) algorithm (Huffman et al., 2020).It is automatically selected the best GPM data available, i.e. by giving preference to the GPM Final Run, following by the Late Run, and finally the Early Run products .The latter allows the distribution of precipitation data in near real time, with approximately 4 hours of latency.However, as the MGB-SA was calibrated with the MSWEP database it is important that both MSWEP and GPM precipitation data present similar probability distributions.Otherwise, the hydrological model would present considerable streamflow biases.Therefore, a parametric quantile mapping method is applied, which fits a gamma distribution to the cumulative distribution of both precipitation databases.It is possible then to obtain GPM data and adjust it to the other distribution so that it becomes equivalent to the MSWEP data.A similar method was applied in the study developed by Piani et al. (2010).
The choice to use the MGB-SA model was also motivated due to its development focused on hydrological processes of large tropical rivers.The model was calibrated for the period from 1990 to 2010 and presented acceptable performance mainly in the southern and southeastern regions of Brazil, in addition to the central Amazon.The calibration stage was performed by analyzing more than 600 gauging stations, presenting for daily discharge the Nash-Sutcliffe and Kling-Gupta efficiencies greater than 0.6 in 55% and 70% of the cases, respectively (Siqueira et al., 2018).

Hydrological indices
To allow a proper assessment of the current hydrological conditions of South American rivers, the streamflow outputs resulting from the real-time application of the MGB-SA model are statistically analyzed, enabling the calculation of hydrological indices such as the state of the flow duration curve (hereafter referred to as flow duration) and the return periods of recent flood and drought events simulated.
The flow duration of a MGB-SA river reach is obtained by analyzing its flow duration curve.This curve graphically indicates how often (% of the time) a given streamflow magnitude is equaled or exceeded during a period of interest.In the case of the SARDIM platform, the period analyzed corresponds to the period between 01/01/1980 and the last update of the platform.The flow duration (%) calculated for each river reach in the SARDIM platform is given by three indices, as listed below: -Current flow duration: this index refers to the flow duration of the last simulated flow in the platform.
-Maximum or minimum flow duration in the last 30 days: this index refers to the flow duration of the most extreme flood or drought event that occurred in the river reach during the last month analyzed.
-Current seasonal flow duration: this index indicates, in a similar way, the flow duration of the last simulated flow, but taking into account the date of the platform update.
In this case, the flow duration is based solely on the historical flow data for the month under analysis, making it possible to consider the seasonal characteristics of the rivers.
The return period is the estimated time interval in years, on average, in which a given event is expected to occur or to be exceeded.The analysis of the return period of the simulated flows is given considering the extreme values of both the minimum and maximum flows for all reaches, in order to identify the possible incidence of a drought or flood phenomenon that may be occurring in the present time.This analysis is performed by selecting minimum and maximum annual flow values and distributing them according to a statistical function that adjusts a certain return period for each flow value.In this study, the minimum values were adjusted following the Weibull distribution, while the maximum values followed the Gumbel distribution.As documented by Tucci (1993), both distributions are commonly applied for statistical analysis of historical series of hydrological variables such as precipitation and streamflow.Distribution adjustments are not applicable to all river reaches in the stream network, as in some cases the distribution function may not satisfactorily represent the selected annual values.In these cases, when the mean quadratic error of the adjustment was greater than 50%, it was considered that the return period of the event had an undetermined value.The return period computed for each river reach in the SARDIM platform is given by two indices, as listed below: -Current return period: this index refers to the return period of the last simulated flow in the platform.
-Maximum or minimum return period in the last 30 days: this index refers to the return period of the flow related to the most extreme flood or drought event that occurred in this river reach during the last month analyzed.
In this way, the SARDIM platform makes it possible to evaluate which were the most extreme simulated results in the last month and to highlight on the platform map the occurrence of a drought or flood event during this period.

Programming and updating
The SARDIM platform was developed by using JavaScript language programming resources, in conjunction with an API (Application Programming Interface) distributed by ESRI (Environmental Systems Research Institute) through the ArcGIS Developer platform, which offers a complete set of development tools and location services at building mapping solutions.
Updating of the data available for visualization on the map is possible thanks to the hosting and data storage services on ArcGIS Online servers.Python programming language offers several features that can be used to facilitate the access to this hosted data, allowing it to be updated remotely via simple Python scripts.
Thus, the operation of the SARDIM platform can be understood from three basic steps.1) Downloading GPM/IMERG data and performing an MGB-SA model run to obtain streamflow estimates.
RBRH, Porto Alegre, v. 28, e10, 2023 4/8 SARDIM: a real-time hydrological monitoring platform of South American rivers 2) Statistical analysis of the simulated streamflow, aiming at obtaining hydrological indices such as the flow duration and return periods of flood and drought events.3) Updating data related to shapefile which is hosted on ArcGIS Online servers and connected to the platform via an external code written in Python.This script is responsible for replacing the information of each attribute of the river shapefile with the new information generated by the latest hydrological simulation.These 3 operation steps aim to ensure that the SARDIM platform will be properly updated, and for this purpose, all of them are scheduled to run daily and at a predetermined time of the day.Figure 1 shows the flowchart of the operational steps related to the platform updating process.

User survey
Aiming to collect information from SARDIM platform users, a survey was conducted with 18 professionals working in various areas of activity.Almost 90% of the participants had positions in engineering consulting sectors or in government agencies, mainly in the areas of water resources, environment, natural disasters, and sanitation.The survey also collected other relevant information, such as the main motivations of users for using the platform and suggestions for new features that would make the tool more useful and effective for their applications.

Platform functionalities
The home page of the SARDIM platform can be accessed from any browser at: https://www.ufrgs.br/sardim/.In the main menu it is possible to see basic information on the functioning of the platform and the related publications in "About" and "Publications" buttons.Note that the most recent version of the platform is available in four languages: English, Spanish, French and Portuguese.In the upper right corner, the date of the last hydrological simulation performed is highlighted.
The results of the SARDIM platform can be viewed by selecting the MGB-SA river reach for which hydrological information should be provided to the user.The main hydrological characteristics and indices of each river reach are presented in a summary table, as shown in Figure 2, highlighting information such as the accumulated upstream catchment area, current flow duration, current seasonal flow duration, maximum or minimum flow duration on the last 30 days, current return period, maximum or minimum return period in the last 30 days, in addition to the numerical code of the respective unit-catchment of the MGB-SA model that includes the selected river reach.Together with the summary table of hydrological information, a graph showing the average weekly streamflow for the last two months is also presented, as shown in Figure 3.The results of flow duration and return period are also presented on the map by configuring a predefined color scale for the rivers.

5/8
As shown in Figure 4, it is possible to select one of the five available result options using the layer list tool to view the color variation in the rivers according to the chosen attribute.Reaches in blue highlight events of different flood scales, while red reaches highlight drought events.Reaches in gray represent low intensity events that cannot be classified as either flood or a drought.

Case studies
This topic presents two case studies concerning flood and drought events that occurred in 2020.The analysis of these events served to evaluate the functioning of the SARDIM platform, where it was possible to identify the location and magnitude of these hydrological events through the flow duration map available on the platform.
The flood events analyzed occurred in July 2020 in the main river basins of the state of Rio Grande do Sul.The Taquari-Antas, Caí, Sinos, and Uruguai Rivers were mainly affected.According to the data recorded in the monitoring stations operated by CPRM (Geological Survey of Brazil), many of these rivers reached historical levels at different points, as in the case of the Taquari River, where the water level reached 22 meters on July 8 in the city of Muçum, being the highest level recorded in the local gauge station since 1940 (Giacomelli et al., 2020).
Figure 5 shows the map provided by the SARDIM platform on 19 July 2020, where although the level of many rivers has slowly declined, it was still possible to observe the high percentage of flow duration in these rivers, in addition to the floods that occurred later in the Baixo Jacuí basin and Guaíba lake after the flow contribution of its tributaries.The drought event analyzed occurred in the Pantanal Matogrossense in the period between 2019 and 2021, with this extreme drought being the worst recorded in the last 50 years.This event was directly related to the increase in the number of wildfires in the region, which resulted in the loss of about 26% of the total area of the biome and affected at least 4.6 billion animals, of which at least 10 million ended up dying (G1, 2021).
According to a survey conducted by the CEMADEN (National Center for Monitoring and Warning of Disasters), the main cause for the occurrence of this event can be explained by a phenomenon known as meteorological blocking, where the combination of lack of rain with high temperatures and very low relative humidity increased the risk of wildfires, that spread over the agricultural and natural areas of the biome (Marengo et al., 2021).Such a meteorological phenomenon is related to the emergence of a high-pressure area that halted the formation of rain throughout the Midwest region of South America.
Figure 6 shows the map provided by the SARDIM platform in October 2020, where it is possible to visualize high values of flow duration in several river reaches of the Paraguay River and other tributaries located in the area directly impacted by the drought in the Brazilian Pantanal.

Connecting the SARDIM platform to users
In general terms, the survey showed positive feedback since many of the users considered as fundamental characteristics for their respective applications the ease of viewing results and the regularity of operation associated with the SARDIM platform.However, about 40% of the users reported that the access to the database would be extremely important for the applicability of the platform, which is not fully available today.
Figure 7 shows a bar graph that indicates the most important features of a hydrological monitoring platform, as in the case of the SARDIM platform, according to the users' evaluation.

CONCLUSIONS
In the present study, it has been shown that the real-time information on the hydrological state of the major rivers in South America is a tool with great potential for application at a national and regional levels.Given the ease with which information can be accessed and interpreted on the SARDIM platform, it is a tool that can be used not only by professionals, researchers, and technicians in the field of hydrology, but also by other sectors of the general public.Having regard to the analysis of the droughts and floods events that took place in 2020, which have been widely publicized and documented by the Brazilian press, it can be seen that the platform showed coherent results and allowed a good representation of the real situation of river flows, enabling the visualization of the occurrence, location and magnitude of flood and drought events in the South American continent.
However, it is important to mention that the results provided in the SARDIM platform are derived from continental hydrological modeling techniques, which result in simulated discharges with lower accuracy than those of locally or even regionally calibrated models, in addition to the substantial uncertainties emerging from the real-time GPM/IMERG precipitation.

7/8
In a future perspective, it may be interesting to add validation information of the flows provided by SARDIM with a more recent data period, given that the calibration period of the base model is considerably outdated.In addition, the implementation of other functionalities in the platform, such as the possibility to analyze past performance regarding the estimated flow duration and return periods in locations where observed data is available, could provide more credibility to the SARDIM platform.

Figure 2 .
Figure 2. Example table summary of available hydrological information.

Figure 3 .
Figure 3. Example chart of average weekly discharge.

Figure 4 .
Figure 4. Flow duration results categorized by a color ramp on the map in August 2021.

Figure 5 .
Figure 5. Map of flow duration of rivers in the state of Rio Grande do Sul during the flood event occurred in July 2020.

Figure 6 .
Figure 6.Map of flow duration of rivers in Brazilian Pantanal during the drought event occurred in 2020.

Figure 7 .
Figure 7.Most important characteristics of a hydrological monitoring platform.