| Title: | ORYZA Rice Crop Growth Simulation Model |
|---|---|
| Description: | An R/C++ implementation of the ORYZA rice crop growth model. ORYZA is a dynamic simulation model that uses daily weather data and crop, soil and management parameters to simulate rice growth and development. See Bouman et al. (2001) ORYZA2000: modeling lowland rice. IRRI / Wageningen University. |
| Authors: | Bas A.M. Bouman [aut], Martin J. Kropff [aut], To Phuc Tuong [aut], Marco Wopereis [aut], H.F.M. ten Berge [aut], H.H. van Laar [aut], Robert J. Hijmans [cre, aut] |
| Maintainer: | Robert J. Hijmans <[email protected]> |
| License: | GPL (>=3) |
| Version: | 0.1-2 |
| Built: | 2026-09-12 13:48:47 UTC |
| Source: | https://github.com/cropmodels/Roryza |
This package provides an R interface to a C++ implementation of the ORYZA simulation model of rice growth and development.
Bouman, B.A.M., Kropff, M.J., Tuong, T.P., Wopereis, M.C.S., ten Berge, H.F.M., & van Laar, H.H. (2001). ORYZA2000 : modeling lowland rice. International Rice Research Institute / Wageningen University. https://books.irri.org/9712201716_content.pdf
Run the ORYZA rice crop growth model (potential or water-limited).
oryza(crop, weather, soil, control)oryza(crop, weather, soil, control)
crop |
list. Crop parameters (see |
weather |
data.frame with weather data |
soil |
list. Soil parameters (see |
control |
list. Model control options (see |
Weather variables
date |
Date | - |
srad |
Solar radiation | kJ m-2 day-1 |
tmin, tmax |
Temperature | degrees C |
vapr |
Vapor pressure | kPa |
wind |
Wind speed | m s-1 |
prec |
Precipitation | mm day-1 |
Set control$water_limited <- TRUE and supply a PADDY soil for water-limited production.
Irrigation is controlled by control$SWITIR (0=rainfed, 2=pond depth, 3=soil KPa, 6=stage thresholds).
data.frame with daily simulation results.
oryza_model, oryza_crop, oryza_soil, oryza_control
# weather data (IRRI, Los Banos) f <- system.file("extdata/Philippines_IRRI.csv", package="meteor") wth <- read.csv(f) wth$date <- as.Date(wth$date) head(wth) crop <- oryza_crop("IR72") soil <- oryza_soil("potential") control <- oryza_control() control$modelstart <- as.Date("1991-01-15") control$latitude <- 14.18 control$elevation <- 21 # potential production out <- oryza(crop, wth, soil, control) tail(out) plot(out$date, out$LAI, type="l", xlab="Date", ylab="LAI") # water-limited (rainfed PADDY) soil <- oryza_soil("paddy") control$water_limited <- TRUE control$SWITIR <- 0L outw <- oryza(crop, wth, soil, control) plot(outw$date, outw$WSO, type="l", xlab="Date", ylab="Storage organs (kg/ha)")# weather data (IRRI, Los Banos) f <- system.file("extdata/Philippines_IRRI.csv", package="meteor") wth <- read.csv(f) wth$date <- as.Date(wth$date) head(wth) crop <- oryza_crop("IR72") soil <- oryza_soil("potential") control <- oryza_control() control$modelstart <- as.Date("1991-01-15") control$latitude <- 14.18 control$elevation <- 21 # potential production out <- oryza(crop, wth, soil, control) tail(out) plot(out$date, out$LAI, type="l", xlab="Date", ylab="LAI") # water-limited (rainfed PADDY) soil <- oryza_soil("paddy") control$water_limited <- TRUE control$SWITIR <- 0L outw <- oryza(crop, wth, soil, control) plot(outw$date, outw$WSO, type="l", xlab="Date", ylab="Storage organs (kg/ha)")
Returns a list of control and experiment parameters to run the ORYZA model. Important fields include modelstart, cropstart, max_duration, latitude, CO2, water_limited, and WATBAL. See Bouman et al. (2001) .
oryza_control(filename = "")oryza_control(filename = "")
filename |
character. Path to a control INI file. If empty, default values are returned |
list
In the FORTRAN versions of ORYZA these parameters in the "experiment" file, not in the "control" file.
contr <- oryza_control() str(contr)contr <- oryza_control() str(contr)
Returns a list of crop parameters for the ORYZA model. Built-in varieties are
provided as INI files under inst/oryza/crop. See Bouman et al. (2001) for
parameter interpretation.
oryza_crop(name = "")oryza_crop(name = "")
name |
character. Either the name of a crop that comes with the package (see examples) or a path to a similarly formatted INI file. If empty, the available crop names are returned |
list
oryza_crop("") crop <- oryza_crop("IR72") str(crop)oryza_crop("") crop <- oryza_crop("IR72") str(crop)
Create an ORYZA model object and run it. Through this interface you first create a model object and then you run it. You can change single parameters and run the model again.
oryza_model(crop, weather, soil, control) run(x, ...) crop(x) <- value soil(x) <- value control(x) <- value weather(x) <- valueoryza_model(crop, weather, soil, control) run(x, ...) crop(x) <- value soil(x) <- value control(x) <- value weather(x) <- value
crop |
list. Crop parameters (see |
weather |
data.frame with weather data. See Details |
soil |
list. Soil parameters (see |
control |
list. Model control options (see |
x |
ORYZA model object ( |
value |
crop, weather, soil, or control data, as above |
... |
additional arguments. |
The weather data must be passed as a data.frame with the following variables and units.
| variable | description | class / unit | |
date |
"Date" class variable | - | |
srad |
Solar radiation | kJ m-2 day-1 | |
tmin |
Minimum temperature | degrees C | |
tmax |
Maximum temperature | degrees C | |
vapr |
Vapor pressure | kPa | |
wind |
Wind speed | m s-1 | |
prec |
Precipitation | mm day-1 |
There should be no time gaps between the days in the data.frame.
oryza_model returns an OryzaModel object.
run returns a data.frame of daily simulation results.
Bouman, B.A.M., Kropff, M.J., Tuong, T.P., Wopereis, M.C.S., ten Berge, H.F.M., & van Laar, H.H. (2001). ORYZA2000 : modeling lowland rice. International Rice Research Institute / Wageningen University. https://books.irri.org/9712201716_content.pdf
oryza, oryza_crop, oryza_soil,
oryza_control, predict
# weather data (IRRI, Los Banos) f <- system.file("extdata/Philippines_IRRI.csv", package="meteor") wth <- read.csv(f) wth$date <- as.Date(wth$date) crop <- oryza_crop("IR72") soil <- oryza_soil("paddy") control <- oryza_control() control$modelstart <- as.Date("1991-01-15") control$latitude <- 14.18 control$elevation <- 21 control$water_limited <- TRUE control$SWITIR <- 0L m <- oryza_model(crop, wth, soil, control) out <- run(m) plot(out$date, out$LAI, type="l", xlab="Date", ylab="LAI") # change soil / control and re-run soil(m) <- oryza_soil("potential") control$water_limited <- FALSE control(m) <- control out2 <- run(m) plot(out2$date, out2$WSO, type="l", xlab="Date", ylab="Storage organs (kg/ha)")# weather data (IRRI, Los Banos) f <- system.file("extdata/Philippines_IRRI.csv", package="meteor") wth <- read.csv(f) wth$date <- as.Date(wth$date) crop <- oryza_crop("IR72") soil <- oryza_soil("paddy") control <- oryza_control() control$modelstart <- as.Date("1991-01-15") control$latitude <- 14.18 control$elevation <- 21 control$water_limited <- TRUE control$SWITIR <- 0L m <- oryza_model(crop, wth, soil, control) out <- run(m) plot(out$date, out$LAI, type="l", xlab="Date", ylab="LAI") # change soil / control and re-run soil(m) <- oryza_soil("potential") control$water_limited <- FALSE control(m) <- control out2 <- run(m) plot(out2$date, out2$WSO, type="l", xlab="Date", ylab="Storage organs (kg/ha)")
Returns a list of soil parameters for the ORYZA model. Built-in soils are
provided as INI files under inst/oryza/soil. Use "potential" when
running potential production (water balance not used). See Bouman et al. (2001)
for parameter interpretation.
oryza_soil(name = "")oryza_soil(name = "")
name |
character. Either the name of a soil that comes with the package (see examples) or a path to a similarly formatted INI file. If empty, the available soil names are returned |
list
oryza_soil("") soil <- oryza_soil("paddy") str(soil)oryza_soil("") soil <- oryza_soil("paddy") str(soil)
Make spatial predictions with an ORYZA model. First create a model object with crop and control settings, then call predict with a weather SpatRasterDataset and a soils SpatRaster.
## S4 method for signature 'Rcpp_OryzaModel' predict(object, weather, mstart, soils = NULL, soiltypes = NULL, filename = "", overwrite = FALSE, ...)## S4 method for signature 'Rcpp_OryzaModel' predict(object, weather, mstart, soils = NULL, soiltypes = NULL, filename = "", overwrite = FALSE, ...)
object |
ORYZA model ( |
weather |
SpatRasterDataset with daily weather. Required sub-datasets: |
mstart |
Date. Simulation start dates (one output layer per date) |
soils |
SpatRaster. Must include layers |
soiltypes |
list of soil parameter lists (see |
filename |
character. Optional output filename |
overwrite |
logical. If |
... |
additional arguments passed to |
SpatRaster with one layer per element of mstart. Cell values are final grain biomass at 14% humidty (WRR14, kg ha, rounded).
Weather variables and units are the same as for the point simulation:
srad in kJ m d, vapr in kPa, prec in mm d, temperatures in C, wind in m s.
f <- system.file("extdata/Philippines_IRRI.csv", package="meteor") w <- read.csv(f)[1:600, ] w$date <- as.Date(w$date) r <- terra::rast(nrow=2, ncol=2, nlyr=nrow(w)) v <- c("srad", "tmin", "tmax", "vapr", "wind", "prec") wthfun <- function(i) { a <- rep(0, 4) if ((i == "tmin") || (i == "tmax")) { a <- c(-2, 0, 2, 4) } out <- terra::setValues(r, rbind(w[,i]+a[1], w[,i]+a[2], w[,i]+a[3], w[,i]+a[4])) terra::time(out) <- as.Date(w$date) out } wth <- terra::sds(lapply(v, wthfun)) names(wth) <- v crop <- oryza_crop("IR72") soil <- oryza_soil("paddy") control <- oryza_control() control$water_limited <- FALSE control$SWITIR <- 0L mod <- oryza_model(crop, w, soil, control) soils <- terra::rast(nrow=2, ncol=2, nlyr=3, names=c("latitude", "elevation", "soils")) terra::values(soils) <- cbind(0, 100, 1:4) p <- predict(mod, wth, mstart=as.Date(c("1979-01-05", "1979-05-05")), soils=soils)f <- system.file("extdata/Philippines_IRRI.csv", package="meteor") w <- read.csv(f)[1:600, ] w$date <- as.Date(w$date) r <- terra::rast(nrow=2, ncol=2, nlyr=nrow(w)) v <- c("srad", "tmin", "tmax", "vapr", "wind", "prec") wthfun <- function(i) { a <- rep(0, 4) if ((i == "tmin") || (i == "tmax")) { a <- c(-2, 0, 2, 4) } out <- terra::setValues(r, rbind(w[,i]+a[1], w[,i]+a[2], w[,i]+a[3], w[,i]+a[4])) terra::time(out) <- as.Date(w$date) out } wth <- terra::sds(lapply(v, wthfun)) names(wth) <- v crop <- oryza_crop("IR72") soil <- oryza_soil("paddy") control <- oryza_control() control$water_limited <- FALSE control$SWITIR <- 0L mod <- oryza_model(crop, w, soil, control) soils <- terra::rast(nrow=2, ncol=2, nlyr=3, names=c("latitude", "elevation", "soils")) terra::values(soils) <- cbind(0, 100, 1:4) p <- predict(mod, wth, mstart=as.Date(c("1979-01-05", "1979-05-05")), soils=soils)