Data structure that contains inputs (parameters pertaining to a site, to the vegetation, to the weather and to the management) to growR simulations.
Details
This class contains site parameters, weather and management data for one simulation run of growR on a given site over several years. Methods are provided to allow access to relevant data for a given year.
All inputs are read in from data files through the respective data classes
WeatherData, ManagementData and ModvegeParameters. These parameters
can be simultaneously specified through a config file using read_config().
See also
WeatherData$get_weather_for_year(),
ManagementData$get_management_for_year()
Public fields
site_nameName of site to be simulated.
run_nameName of simulation run. Allows distinguishing between different simulations at the same site. Defaults to "-" for no name.
run_name_in_filenameHow the run name will be represented in an output file. If
run_nameis the default "-", indicating no name, this will be an empty string. Otherwise, it will be therun_nameprepended by and underscore_.yearsYears for which environment data (weather & management) is present.
param_fileName of supplied parameter file.
weather_fileName of supplied weather file.
management_fileName of supplied management file.
parametersA ModvegeParameters object.
weatherA WeatherData object.
managementA ManagementData object.
input_dirDirectory in which parameter, weather and management files are searched for. Defaults to `getOption("growR.input_dir").
Methods
Method new()
Instantiate a new ModvegeEnvironment
Usage
ModvegeEnvironment$new(
site_name,
run_name = "-",
years = NULL,
param_file = "-",
weather_file = "-",
management_file = "-",
input_dir = NULL
)Arguments
site_namestring Name of the simulated site.
run_namestring Name of the simulation run. Used to differentiate between different simulation conditions at the same site. Defaults to "-", which indicates no specific run name.
yearsnumeric Vector of integer years to be simulated.
param_filestring Name of file that contains site and vegetation parameters. If default value
"-"is provided, it is assumed to be "SITENAME_parameters.csv".weather_filestring Analogous to param_file.
management_filestring Analogous to param_file.
input_dirstring Path to directory containing input files. Defaults to
getOption("growR.input_dir").
Method load_inputs()
Load simulation inputs.
Stores parameters, management and weather data from files specified in self$parameter_file, self$weather_file and self$management_file, respectively.
Method get_environment_for_year()
Get weather and environment for given year
Convenience function to retrieve environmental and management
inputs for given year from multi-year data containers self$weather
and self$management.
