# Agroclimatic Evolution web application as a powerful solution for managing climate data

### Websites analysis

There are two types of web-based weather information systems:

1. a)

Private stations: These allow data to be obtained close to each farmer’s plot, provided that as many weather stations as are of interest are invested. This is an advantage in terms of the representativeness of the data for each farmer; however, it has the disadvantage of the high cost of the investment.

1. i.

An example is the service offered by Sencrop (www.sencrop.com), which centralises all the data from privately installed stations on one platform (if the owner so wishes) and makes them available to other users, thus reducing the investment cost.

2. ii.

Another example is offered by Envira IOT (www.enviraiot.es/monitorizacion-meteorologica-agricultura-precision/), which installs a private weather station and offers data provided with algorithms that facilitate user interpretation.

2. b)

Public stations: There are numerous web services that offer historical weather data collected from the existing network of weather stations in Spain. In general, access to these data is free of charge, but the microclimate of a particular farm may differ from the data provided by the nearest weather station.

1. i.

SIAR (Agro-climatic Information System for Irrigation) (https://eportal.mapa.gob.es/websiar/Inicio.aspx) offers data from stations located throughout Spain, through its website (and even has a mobile App).

2. ii.

At the level of autonomous communities, some offer this service through their own portals, with data from the same stations: SIAM of the Region of Murcia (www.siam.imida.es), InfoRiego of the “Junta de Castilla y León” (www.inforiego.org/opencms/opencms/info_meteo/index.html), RIA of the “Junta de Andalucía” (https://www.juntadeandalucia.es/agriculturaypesca/ifapa/riaweb/web/), among others.

The potential of the data collected in these services lies in their free access, and in the quality of the data coming from a Spanish network. On the other hand, the consultation of data is, in general, not user-friendly, nor is it adapted to mobile devices. In addition, data are consulted whose processing requires considerable office skills to be interpreted. These services lack the ability to graph the data, and the possibility of easily storing them in their own database.

Taking into account the study carried out, the AgroClimatic Evolution web application was developed, designed to provide free access to data to users, in a user-friendly and simple way. But this application is part of a broader project, the GENHIDRO platform (www.genhidro.es), aimed at the efficient and autonomous management of fertigation systems.

Therefore, the aim of this project is to ensure that the data obtained through AgroClimatic Evolution are not merely a mere visualisation and storage of data, but feed a more complex decision-making system for advice and even the direct management of fertigation systems. GENHIDRO is a platform under continuous development and aims to offer the user the possibility of interacting with the irrigation system based on data collected, among others, from meteorological information services such as those consulted through AgroClimatic Evolution.

### Theorical background

The ETo was calculated in this project. This ETo concept occurs under certain conditions, on a reference surface and with no water restrictions. The ETo is a variable to study atmospheric ET demand regardless of crop type and crop development.

By relating ET to a given surface, a reference ET is obtained. From this value, ET values on other surfaces can be related. This will allow analyses based on ET alone, and independent of other site-specific variables. Thus, ETo will be the reference ET under certain growing conditions, for a reference crop. The ETo value will express the evapotranspiration capacity of the atmosphere at a given location and time of year; but it does not take into account the characteristics of the crop or soil type. The great advantage of using ETo to estimate water requirements is that its value only depends on climatic parameters, which are easy to obtain.

To understand the ETo concept, it is necessary to define what a reference surface is. According to FAO-56, it is a “hypothetical reference crop with crop height of 0.12 m, a fixed surface resistance of 70 s m-1 and an albedo value (i.e., portion of light reflected by the leaf surface) of 0.23”15.

To calculate this parameter, the FAO Penman–Monteith method is recommended because it is the only standardized method that determines ETo with climate parameters16. This method of Zotarelli was selected because it roughly approaches the ETo of any town, has robust physical bases, and explicitly incorporates physiological and aerodynamic parameters. The data required to apply the FAO Penman–Monteith method are location, temperature, relative humidity, radiation and wind.

Determining ETo is extremely important for estimating a crop’s water requirements or for conducting studies regardless of the crop type to be grown. Knowledge about ETo and the grown crop allows adjusted irrigation doses to be established and crop performance to improve.

To calculate the ETo, we applied the equations of the FAO Penman–Monteith method available in FAO-56. We began with daily ETo, calculated by the expression below:

$$ET_o = \frac0.408 \Delta \left( R_n – G \right) + \gamma \frac900T + 273 u_2 \left( e_s – e_a \right)\Delta + \gamma \left( 1 + 0.3 u_2 \right)$$

(1)

where:

ET Reference evapotranspiration [mm day-1]

RnNet radiation the crop’s surface(MJ m-2day-1)

G Ground heat flow(MJ m-2day-1)

T Mean air temperature at a heigjt of 2 m (°C)

U2 Wind speed at a height of 2m (m s-1)

Es  Vapour saturation pressure (kPa)

ea  Real vapor pressure (kPa)

es-ea No vapor pressure (kPa)

$$\Delta$$ Vapor pressure curve slope (kPa °C-1)

$$\gamma$$ Psychometric constant (kPa °C-1)

For the calculation of each and every one of the parameters involved in Eq. (1), the methodology established by Zotarelli et al.16 has been followed. Thus, the daily ETo estimate is obtained, expressed in mm·day-1.

To obtain the ETo value at the hourly level, the expressions indicated by Zotarelli et al.16 vary slightly. Thus, for hourly periods, the FAO Penman–Monteith equation for the calculation of ET is modified as follows:

$$ET_o = \frac{0.408 \Delta \left( R_n – G \right) + \gamma \frac37T_hr + 273 u_2 \left( e^o \left( T_hr \right) – e_a \right)}\Delta + \gamma \left( 1 + 0.24 u_2 \right)$$

(2)

where:

ETo  Reference evapotranspiration [mm hour-1]

Rn Net radiation on the reference surface [MJ m-2 hour-1]

G Ground heat flow density [MJ m-2 hour-1]

Thr Mean air temperature every hour [°C]

$$\Delta$$ Vapor saturation pressure curve slope in Thr [kPaC-1] and psychometric constant[kPa °C-1]

e (Thr) Vapor saturation pressure at Thr

ea Average real vapor pressure times [kPa]

U2 Average wind spee times [m s-1]

The adjustments made to the equations proposed by Zoratelli et al.16, in order to obtain the hourly ETo values, are shown below:

Real vapor pressure (ea) is calculated as:

$$e_a = e^o \left( T_hr \right)\fracHR_hr 100$$

(3)

where:

ea Average real vapor pressure times [kPa]

e (Thr) Vapor saturation pressure at Thr

HRhr Average relative humidity time [%]

The net radiation calculation varies for time periods; first, the expression to calculate extraterrestrial radiation (Ra) becomes:

$$R_a = \frac24 \cdot 60\uppi G_sc d_r \left[ \left( w_2 – w_1 \right)\sin \left( \varphi \right)\sin \left( \delta \right) + \cos \left( \varphi \right)\cos \left( \delta \right)\textsin\left( w_1 \right) \right]$$

(4)

where:

Ra Extraterrestial radiation per hour [MJ m-2 hour-1]

Gsc Solar constant =0.082 MJ m-2 min1

dr Realative inverse Earth −  Sun distance

$$\delta$$ Solar declination [rad]

$$\phi$$ Latitude [rad]

The initial and final radiation angles are given by:

$$w_1 = w – \frac\pi t_1 24$$

(5)

$$w_2 = w + \frac\pi t_1 24$$

(6)

where:

w Sun angle when the midpoint of the considered period is reached [rad]

t1 Duration of the considered period, 1 for time periods

The procedure followed to calculate net radiation is the same as that for daily period, except for Eqs. 4, 5 and 6.

In this case, heat flux is not longer negligible. The G value, according to FAO-5615, can be reached during light periods by:

$$G_hr = 0.1 R_n$$

(7)

and for night periods:

$$G_hr = 0.5 R_n$$

(8)

With these changes in the expressions, the hourly ETo can be properly estimated. As it is now known which calculation procedure is to be used, it is possible to study how the web application works.

### Web application

This web application can be used with the link that follows: (http://josemiguel.myqnapcloud.com:49169/AgroClimatic-Evolution/).

The AgroClimatic Evolution (v1.0), web application can be used in a PC or a mobile device (Android or IOS). As this web application is executed by means of a server, a web browser is necessary, and Chrome is recommended. This tools’ operation is outlined in the figure below (Fig. 1).

Node-RED (https://nodered.org/) is the core of the web application’s operation. It is a programming tool designed to communicate with different hardware, simplifying the processes of sending and receiving information as much as possible. It allows to connect different hardware devices, use APIs to perform communications, and connect with other services, in a very innovative and interesting way. The programming is visual, based on flows, so it does not require a very advanced level of programming.

Node-RED uses the “http request” node to request data from a specific weather station to the corresponding meteorological service. The data collected are: weather station, date, temperature, relative humidity, radiation, wind speed, wind direction and dew point temperature. This information is stored in the database, and phpMyAdmin (https://www.phpmyadmin.net/), which is a free open-source software tool, is used to manage and administer the database. Another Node-RED node is in charge of calculating the hourly or daily ETo values from the obtained meteorological data. This information is stored in the database. With the “uibuilder” node, the user interface interprets the information request made by the user, and extracts the appropriate information from the database to display it on the interface. This whole process works on the back-end.

The system is connected to different APIs and/or web services to acquire interesting weather data: (i) the API that OpenWeather (https://openweathermap.org/) provides for weather forecasts; (ii) the API that the “Junta de Andalucía” (the Regional Government of Andalusia, Spain) provides for weather data; (iii) obtaining data from websites of SIAM (the Farming Information System of Murcia) and SIAR (the Agroclimate Information System for Irrigation) by scraping every 6 min (Table 1). The public stations used respect the WMO standards (World Meteorological Organization, https://community.wmo.int/standards-and-requirements-climate-observations), and its main characteristics of equipment and data management is described by María del Carmen Caro Vela from SIAR 17.

The data provided by all the stations are validated by applying filters at levels 0 and 1 as indicated in Standard UNE 500540:2004 “Automatic weather stations networks: Guidance for the validation of the weather data from the station networks. Real time validation”. At level 0, the structure of the data record is validated, i.e. that the number of data received is the same as the number of data expected, as well as the date and/or time, taking as invalid those that do not comply. Level 1 establishes the physical limits within which the different climate variables must move, beyond which data are considered null. Table 2 shows the physical and instrumental limits established by the UNE 500540:2004 standard. With the filtered data, and once the ETo calculations have been obtained, the user is provided with a comparison made with the raw data supplied by the public stations.

To validate the correct execution of the process of obtaining data from the meteorological services mentioned, the following test was carried out: a weather station was taken at random, during a randomly chosen month, and the data provided directly by the service were compared with those generated by the web application developed (Tables 3, 4, and 5).

To achieve an attractive and practical front-end, the information has been organised with HTML, CSS and JavaScript programming.