Skip to contents

This function runs the OptirrigCORE model using the provided inputs. It can run the model in parallel or sequentially, log the process, save the outputs, and return the outputs if desired.

Usage

run_model_ptge(
  inputs,
  parallelize = TRUE,
  workers = 5,
  log = TRUE,
  save = TRUE,
  output_vars = c("P", "I1", "R", "RU", "LAI", "ratio_Y", "Fin", "PSE"),
  return_outputs = FALSE,
  force = FALSE,
  to_S3 = FALSE,
  ...,
  cfg_package,
  cfg
)

Arguments

inputs

data.frame Input data frame containing simulation parameters.

parallelize

logical Whether to run the model in parallel (default: TRUE).

workers

integer Number of parallel workers to use if 'parallelize' is TRUE (default: 5).

log

logical Whether to log the process (default: TRUE).

save

logical Whether to save the outputs to disk (default: TRUE).

output_vars

character Vector of variable names to include in the outputs (default: c("P", "I1", "R", "RU", "LAI", "ratio_Y")).

return_outputs

logical Whether to return the outputs as a list (default: FALSE).

force

logical Whether to force the creation of the uptakes data from the raw data.

...

Additional arguments passed to the model run.

cfg_package

list Configuration parameters for the package.

cfg

a config object. Configuration to use. See loadConfig for details