Package 'Roryza'

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

Help Index


ORYZA Rice Crop Growth Simulation Model

Description

This package provides an R interface to a C++ implementation of the ORYZA simulation model of rice growth and development.

References

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 rice crop growth model

Description

Run the ORYZA rice crop growth model (potential or water-limited).

Usage

oryza(crop, weather, soil, control)

Arguments

crop

list. Crop parameters (see oryza_crop)

weather

data.frame with weather data

soil

list. Soil parameters (see oryza_soil); used when water_limited=TRUE

control

list. Model control options (see oryza_control)

Details

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).

Value

data.frame with daily simulation results.

See Also

oryza_model, oryza_crop, oryza_soil, oryza_control

Examples

# 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)")

ORYZA control parameters

Description

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) .

Usage

oryza_control(filename = "")

Arguments

filename

character. Path to a control INI file. If empty, default values are returned

Value

list

Note

In the FORTRAN versions of ORYZA these parameters in the "experiment" file, not in the "control" file.

See Also

oryza, oryza_model

Examples

contr <- oryza_control()
str(contr)

ORYZA crop parameters

Description

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.

Usage

oryza_crop(name = "")

Arguments

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

Value

list

See Also

oryza, oryza_model

Examples

oryza_crop("")
crop <- oryza_crop("IR72")
str(crop)

ORYZA model object interface

Description

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.

Usage

oryza_model(crop, weather, soil, control)
run(x, ...)
crop(x) <- value
soil(x) <- value
control(x) <- value
weather(x) <- value

Arguments

crop

list. Crop parameters (see oryza_crop)

weather

data.frame with weather data. See Details

soil

list. Soil parameters (see oryza_soil)

control

list. Model control options (see oryza_control)

x

ORYZA model object (Rcpp_OryzaModel)

value

crop, weather, soil, or control data, as above

...

additional arguments. stopError (logical): if an error occurs and stopError is TRUE, an error is thrown; otherwise a warning is given and partial simulation data may be returned

Details

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.

Value

oryza_model returns an OryzaModel object. run returns a data.frame of daily simulation results.

References

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

See Also

oryza, oryza_crop, oryza_soil, oryza_control, predict

Examples

# 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)")

ORYZA soil parameters

Description

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.

Usage

oryza_soil(name = "")

Arguments

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

Value

list

See Also

oryza, oryza_model

Examples

oryza_soil("")
soil <- oryza_soil("paddy")
str(soil)

Spatial ORYZA model predictions

Description

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.

Usage

## S4 method for signature 'Rcpp_OryzaModel'
predict(object, weather, mstart, soils = NULL,
     soiltypes = NULL, filename = "", overwrite = FALSE, ...)

Arguments

object

ORYZA model (Rcpp_OryzaModel)

weather

SpatRasterDataset with daily weather. Required sub-datasets: tmin, tmax, srad. For water-limited runs also prec, vapr, and wind. All must share the same number of layers; tmin must have Date time stamps

mstart

Date. Simulation start dates (one output layer per date)

soils

SpatRaster. Must include layers latitude and elevation. For water-limited runs also soil (1-based index into soiltypes) and soildepth (maximum rootable depth in m; used as ZRTMS)

soiltypes

list of soil parameter lists (see oryza_soil). Required for water-limited runs; optional for potential (defaults to oryza_soil("potential"))

filename

character. Optional output filename

overwrite

logical. If TRUE, overwrite filename

...

additional arguments passed to writeRaster

Value

SpatRaster with one layer per element of mstart. Cell values are final grain biomass at 14% humidty (WRR14, kg ha−1^{-1}, rounded).

Note

Weather variables and units are the same as for the point simulation: srad in kJ m−2^{-2} d−1^{-1}, vapr in kPa, prec in mm d−1^{-1}, temperatures in ∘^\circC, wind in m s−1^{-1}.

See Also

oryza_model, oryza

Examples

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)