apsimx_wrapper: Running .apsimx files from txt input files stored in one...

View source: R/apsimx_wrapper.R

apsimx_wrapperR Documentation

Running .apsimx files from txt input files stored in one directory per 'situation', simulated results are returned in a list

Description

This function uses ApsimX directly through a system call, can force ApsimX input parameters with values given in arguments.

Usage

apsimx_wrapper(model_options, param_values = NULL, sit_var_dates_mask = NULL)

Arguments

model_options

List containing any information needed by the model. In the case of apsimx: apsimx_path the path of apsimx executable file and apsimx_file the path of the directory containing the apsimx input data for each situation to simulate

param_values

(optional) either a named vector or a named 3D array. Use a named vector that contains the values and names of the parameters to force the same values of the parameters whatever the simulated situations (usms). If one wants to force the model with different values of parameters for the simulated situations or to simulate the situations several times but with different values of the parameters, use a 3D array containing the value(s) and names of the parameters to force for each situation to simulate. This array contains the different parameters values (first dimension) for the different parameters (second dimension) and for the different situations (third dimension). See examples for more details.

sit_var_dates_mask

(optional) List of situations: may be either a character vector of situation names or a named list containing information about variables and dates for which simulated values should be returned. Typically a list containing the observations to which simulations should be compared as provided by apsimxRFiles::read_obs_to_list

Value

A list containing simulated values ('sim_list': a vector of list (one element per values of parameters) containing usms outputs data.frames) and an error code ('error') indicating if at least one simulation ended with an error.


hol430/ApsimOnR documentation built on Feb. 6, 2024, 5:45 p.m.