Aquacropr: Crop Growth Model For R
Aquacropr: Crop Growth Model For R
Aquacropr: Crop Growth Model For R
Abstract: The Food and Agriculture Organization (FAO) AquaCrop model, run either via a
standalone graphical user interface (GUI) or via a matlab application programming interface (API)
(AquaCrop-OS), has been successfully tested on many crop species and under multiple scenarios.
However, with these current versions, it is difficult for users to adapt formulae, add functionality
or incorporate the model into other applications such as decision support tools. Here, we report on
the release of a version of AquaCrop written in R. Performance of the model was tested using
published datasets of wheat (Triticum aestivum L.) and maize (Zea mays L.), comparing output from
AquaCropR with these other versions of AquaCrop. Our goal in developing this version was to
widen the use and improvement of AquaCrop through open access.
1. Introduction
The negative impact of climate change on agricultural production and trade, combined with a
growing world population, are great concerns shared by farmers and decision-makers [1]. In the
context of changing environments, crop models are useful tools to simulate crop yields. Crop models
have been evolving to translate processes related to crop growth and development into mathematical
equations. Crop models have been used over decades for agronomic purposes and have more
recently incorporated advances in the modelling of environmental footprints, biotic constraints, trait
and gene effects and the upscaling of global change impacts [2]. Crop models can be incorporated
into tools for decision support, which can help farmers to manage crops and take corrective measures
towards improving crop performance. Therefore, adoption of climate-smart agriculture practices is
crucial to mitigate climate-related losses in yield and food quality, to reduce greenhouse gas
emissions and to increase sustainable food production [3]. The mechanistic modelling approach is
useful to improve our understanding of how crops develop, grow and produce a marketable yield,
and is valuable for describing and predicting how endogenous (e.g., genetic makeup) and exogenous
factors (e.g., weather and soil type) can impact crop performance.
AquaCrop, developed by the Food and Agriculture Organization (FAO) of the United Nations,
is one of many published mechanistic models that can describe plant development from emergence
to maturity, and how the efficiency and magnitude of physiological processes are moderated by
multiple factors [4,5]. It was designed to be a generic model, based on fundamental biophysical
principles and intended to be parsimonious and adaptable to specific crop species
(http://www.fao.org/aquacrop). AquaCrop is now one of the most widely used models to simulate
biomass and yield of different crops under a variety of climates and geographic locations.
AquaCrop v6.0 is currently available via an API provided by FAO
(http://www.fao.org/aquacrop/software/en/) or by a Matlab API for the Open Source version
AquaCrop-OS, developed by Foster et al. [6]. The FAO API runs as a standalone GUI, which allows
the user to input climate and crop management data and returns predictions on yield performance
based on the user’s inputs. Since the GUI is an executable file, users cannot modify, add or extend the
model to account for more localised constraints, emerging problems and newly available data. The
Matlab API was developed to fill this gap; however, since it is a script, the model can only be run
using Matlab, which is a licence-based platform. To solve the problem of accessibility and
extensibility, we have developed the AquaCropR API, which runs on the open source R platform [7].
AquaCropR is translated from AquaCrop-OS, which is based on an early version of AquaCrop GUI
that did not simulate crop performance well in very dry environments. The latest version of
AquaCrop GUI v6.0 addresses this and other issues.
To facilitate the use and extension of AquaCrop, we have deposited AquaCropR on the GitHub
so that others can contribute to the development and enhancement of the model.
2. AquaCropR Overview
The AquaCropR package runs under the R environment [5] and was translated from the Matlab
version of AquaCrop, AquaCrop-OS [6], which was based on equations incorporated in AquaCrop
v5.0a developed by FAO [8,9]. Key features of AquaCropR that allow for rapid and easy extensibility,
updating and integration with other systems are described in the following sections.
3.1. Installation
To install AquaCropR, follow these steps:
FileLocation = ReadFileLocations(pathname/input_wheat_tunis_cropot/filesetup.xml’)
Where pathname correspond to the location folder where the ‘AquaExamples’ repo was
installed (e.g., ‘repo/AquaExamples’)
e. Initialise the model using crop and simulation parameters
InitialiseStruct <- Initialise(FileLocation)
f. Run the simulation and view the results dataset. Check the AquaCropR tutorial for definition of
the variables returned in the Simulation Results dataset.
Outputs <- PerformSimulation(InitialiseStruct)
The output folder contains all the results from the simulation. For more details about each
variable, refer to the AquaCropR tutorial (AquaCropR.pdf), also located in the ‘AquaExamples’
repository. All the wheat simulations can be run by running ‘simulate_dummy.R’ in the same folder,
described in more detail in Section 4.
specific parameters were those given in the input file ‘WheatGDD.CRO’ (for Growing Degree Day
(GDD)) provided with the AquaCrop GUI. In each year, sowing day was on 15th October and soil
characteristics are in Table 1.
Table 1. Soil characteristics for wheat scenarios 1 and 2. Soil characteristics for scenarios 3 and 4 were
the same as scenario 1. Abbreviations: TAW, total available soil water; PWP, permanent wilting point;
FC, field capacity; SAT, water content at saturation; Ksat, saturated hydraulic conductivity.
4.3. Results
4.3.1. Maize
Simulated yield of an irrigated maize crop was on average 13.44 t/ha for both AquaCrop-OS and
AquaCropR, with no significant deviations between the model outputs observed across the tested
years (Root Mean Square Error (RSME) = 0; Pearson Correlation (R2) = 1) (Figure 1). This shows that
the functions coded in AquaCropR faithfully reproduced those in AquaCrop-OS.
Agronomy 2019, 9, 378 6 of 10
Figure 1. Simulated maize yields from 1983 to 2015. The test considers a scenario where irrigation is
triggered once soil moisture falls below 70% depletion of total available water. R2 and RMSE metrics
show the fit between AquaCrop-OS and AquaCropR.
4.3.2. Wheat
Results of the default wheat simulations are shown in Figure 2. Yield potential of rainfed wheat
was on average 8.6 ton ha−1 (Figure 2A) using the AquaCrop GUI and AquaCropR (RSME = 0.32; R2
= 0.91). Only small deviations in outputs between the models were observed across the tested years.
Further speculation on the cause of the small deviations between the two versions are discussed
below.
The soil type tests showed a decline in yield when a local soil was used (Figure 2B) in comparison
to a uniform sandy loam (Figure 2A), with all other parameters equal. This shows that AquaCropR
is sensitive to changes in soil moisture and that the yield responses are reasonable and accurate,
compared with the GUI version AquaCrop 6.0, (RSME = 0.47; R2 = 0.97). In years where there was
some discrepancy between the models, AquaCropR tended to output slightly larger yields than the
GUI, which suggests the model was supplying slightly more water to the crop than in the GUI
version.
Using the crop configuration inputs for a local variety showed greater year to year fluctuations
in yields (Figure 2C) compared with tests using the default wheat variety (Figure 2A). The main
difference can be attributed to a longer grain filling period (flowering to maturity; 2317 GDD for the
local variety versus 1150 GDD in the default setting in WheatGDD.CRO), and shorter duration from
sowing to flowering (1073 for the local variety versus 1250 GDD in the default). In years with
favourable growing conditions, the local variety yields surpassed those of the default, and in poor
years the local variety yielded less than the default (Figure 2C). It is surmised that the timings of
phenological growth stages of the local variety made it more sensitive to prevailing environmental
conditions, such as increased heat later in the crop cycle. There were also greater deviations between
the outputs of the AquaCrop GUI and AquaCropR compared with the default crop settings (Figure
2C; RSME = 0.15; R2 = 0.86). Compared with the AquaCrop GUI, AquaCropR tended to output smaller
yields in low yielding years, and output larger yields in good years using the local variety
characteristics. The AquaCrop training manual tutorial files for the Tunis scenario 3 state that the
observed grain yield in trials in the 1990/1991 season was 9.15 t/ha [8]. This agrees well with the
AquaCropR simulated yield of 9.39 t/ha (Figure 2C). In the absence of further observed yield data for
the years in these test environments, it is not clear which model output is closer to reality. However,
there are numerous reports in the literature that show validations of the AquaCrop GUI model using
observed data. If yields in the poor years were limited by moisture to a greater extent than in the
good years, this suggests that the AquaCrop GUI may overestimate soil water availability in severe
stress, which has been suggested by others [13], or the inverse case in AquaCropR. Further work is
Agronomy 2019, 9, 378 7 of 10
needed to drill down into the input conditions for those years to understand how the models deviate
in those circumstances, and to determine which model settings need to be adjusted.
The test comparing simulated yields across years using a fixed, deficit irrigation schedule shows
that the model performed under conditions of limited soil moisture supply (weather data and plots
are available on https://github.com/anyelacamargo/AquaExamples/) similarly to the AquaCrop GUI,
and the agreement between models was good (RSME = 0.95; R2 = 0.77). AquaCropR output slightly
larger yields in several years, but showed larger deviations with small yields in six of the 22 years
(Figure 2D). Since it is important for the reader and AquaCropR user to understand what factors were
important for these differences between model outputs, Table 2 is designed to highlight key
differences between AquaCropR/OS and AquaCrop GUI, v 6.0 [14]. Looking at the table, the user can
immediately realise that under no stress conditions both models are likely to simulate similar crop
growth and performance. However, under high stress conditions, AquaCrop GUI is more likely to
simulate actual crop development and performance—this was the reason for v 6.0 being developed.
As the source code for v 6.0 is not publically available, we are currently using the v6.0 manual [14] to
upgrade AquaCropR.
Figure 2. Simulated wheat yields from 1982 to 2002, according to four experimental scenarios (s1–s4):
(A) default soil; (B) local soil; (C) late-maturing wheat variety; (D) irrigation schedule. R2 and RMSE,
which measure the fit between AquaCrop GUI and AquaCropR, are shown for each test.
In addition to the grain yield plots shown here, biomass, canopy cover, soil infiltration, irrigation
(when tested) and Et0 plots are also available in the ‘AquaExamples’ repository on GitHub. The
plotted data are located in the output folder of each test (e.g., input_wheat_tunis_cropot\output).
Agronomy 2019, 9, 378 8 of 10
5. Summary
This study developed the open source R version of AquaCrop, which we called AquaCropR. To
demonstrate AquaCropR usability and versatility we used crop management data from published
sources and weather data from publicly available repositories to fit simulate five crop scenarios. The
results of the test demonstrated that AquaCropR can be easily used to simulate or predict yields
under different crop and experimental conditions.
AquaCropR is translated from AquaCrop-OS which in turn is based on an early version of
AquaCrop GUI, which did not simulate well crop performance under very dry environments.
Therefore, when comparing AquaCropR against AquaCrop-OS, we expected the same results. Yield
comparisons between AquaCrop-OS and AquaCropR outputs for maize crops growing under no
stress conditions showed highly similar values (RSME = 0; R2 = 1).
On the contrary, when comparing AquaCropR against AquaCrop GUI, we expected some
degree of disagreement because the models are slightly different (the latter has been updated to deal
with simulations of crop growing under dry environments). This behaviour was also demonstrated
in Figure 2C-D which corresponded to yield comparisons of wheat crops growing under some sort
of stress (e.g., S3 Late maturity wheat variety and S4 Water deficit).
In the current work, we are conducting collaborative maize field trials under a range of N inputs
over several seasons. These have been running for two years to collect data from maize trials. The
field data will be used to tune, test and expand the AquaCropR API.
The open access to source code in R, and the flexibility to adapt this to new conditions and crops
should further widen the use of AquaCrop. The danger of open access is that erroneous changes can
be made to formulae that become incorporated into newer versions of the software as it evolves. It is
recommended that new versions of AquaCropR use these standardised test datasets to validate
performance before using the model. In future work, addition of a soil nutrient module will permit
better simulations under nutrient-limited conditions, as the current versions assume non-limiting
conditions, or only allow election of a decline in crop coefficient due to a nitrogen ‘deficiency’.
Another future facility we are working on is the addition of mathematical optimisation to fit model
parameters instead of using constant parameters. The current AquaCropR version is able to optimise
Canopy growth coefficient (CGC) and Maximum Canopy Cover in Fraction Soil (CCx) to
AquaCropR, but a more robust optimization module is currently under expansion.
Author Contributions: A.V.C.R. conceived and performed the work; A.V.C.R. and E.S.O. wrote the paper.
Funding: This project was supported by a grant from the Bharti Foundation, “Extending Knowledge of
Increased Corn Crop Productivity to Farmers”.
Acknowledgments: We are grateful to Tim Foster who provided the AquaCrop source code for Matlab.
References
1. Porfirio, L.L.; Newth, D.; Finnigan, J.J.; Cai, Y. Economic shifts in agricultural production and trade due to
climate change. Palgrave Commun. 2018, 4, 111.
2. Chenu, K.; Porter, J.R.; Martre, P.; Basso, B.; Chapman, S.C.; Ewert, F.; Bindi, M.; Asseng, S. Contribution
of crop models to adaptation in wheat. Trends Plant Sci. 2017, 22, 472–490.
3. Lipper, L.; Thornton, P.; Campbell, B.M.; Baedeker, T.; Braimoh, A.; Bwalya, M.; Caron, P.; Cattaneo, A.;
Garrity, D.; Henry, K.; et al. Climate-smart agriculture for food security. Nat. Clim. Chang. 2014, 4, 1068.
4. Heng, L.; Steduto, P.; Rojas-Lara, B.; Raes, D.; Fereres, E.; Hsiao, T.C. Aquacrop-the fao crop model to simulate
yield response to water: Iii. parameterization and testing for maize. Agron. J. 2009, 101, 448–459.
5. Steduto, P.; Hsiao, T.C.; Raes, D. Fereres-E. American Society of Agronomy; Stanford University; SSSA.
Aquacrop-the fao crop model to simulate yield response to water: I. concepts and underlying principles.
Agron. J. 2009, 101, 426–437.
6. Foster, T.; BrozoviÄ, N.; Butler, A.P.; Neale, C.M.U.; Raes, D.; Steduto, P.; Fereres, E.; Hsiao, T.C. Aquacrop-
os: An open source version of fao’s crop water productivity model. Agric. Water Manag. 2017, 181, 18–22.
Agronomy 2019, 9, 378; doi:10.3390/agronomy9070378 www.mdpi.com/journal/agronomy
Agronomy 2019, 9, 378 10 of 10
7. R Core Team. R: A Language and Environment for Statistical Computing; R Core Team: Vienna, Austria, 2013.
8. Raes, D.; van Gaelen, H. AquaCrop Training Handbooks—Book II Running AquaCrop; Food and Agriculture
Organization of the United Nations: Rome, Italy, 2016.
9. Richard, G.; Allan, L.; Dirk Raes, P.; Smith, M. Crop Evapotranspiration-Guidelines for Computing Crop Water
Requirements-FAO Irrigation and Drainage Paper 56; FAO: Rome, Italy,1998; Volume 56.
10. Richard, G.A.; AIvan, W.; Ronald, L.E.; Terry, A.H.; Daniel, I.; Marvin, E.J.; Richard, L.S. The Asce
Standardized Reference Evapotranspiration Equation; American Society of Civil Engineers: Washington,
D.C., USA, 2005.
11. Nasa Power. Available at: http://power.larc.nasa.gov (accessed on 10 June 2019).
12. Muzathik, A.M.; Nik, W.B.W.; Ibrahim, M.Z.; Samo, K.B.; Sopian, K.; Alghoul, M.A. Daily global solar
radiation estimate based on sunshine hours. Int. J. Mech. Mater. Eng. 2011, 6, 75–80.
13. Iqbal, M.A.; Shen, Y.; Stricevic, R.; Pei, H.; Sun, H.; Amiri, E.; Penas, A., del Rio, S. Evaluation of the fao
aquacrop model for winter wheat on the north china plain under deficit irrigation from field experiment to
regional yield simulation. Agric. Water Manag. 2014, 135, 61–72.
14. Food and Agriculture Organization of the United Nations. AquaCrop update and new features, V6.0, Food
and Agriculture Organization of the United Nations: Rome, Italy, March 2017.
© 2018 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 (http://creativecommons.org/licenses/by/4.0/).