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_name
Name of site to be simulated.
run_name
Name of simulation run. Allows distinguishing between different simulations at the same site. Defaults to "-" for no name.
run_name_in_filename
How the run name will be represented in an output file. If
run_name
is the default "-", indicating no name, this will be an empty string. Otherwise, it will be therun_name
prepended by and underscore_
.years
Years for which environment data (weather & management) is present.
param_file
Name of supplied parameter file.
weather_file
Name of supplied weather file.
management_file
Name of supplied management file.
parameters
A ModvegeParameters object.
weather
A WeatherData object.
management
A ManagementData object.
input_dir
Directory 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_name
string Name of the simulated site.
run_name
string Name of the simulation run. Used to differentiate between different simulation conditions at the same site. Defaults to "-", which indicates no specific run name.
years
numeric Vector of integer years to be simulated.
param_file
string Name of file that contains site and vegetation parameters. If default value
"-"
is provided, it is assumed to be "SITENAME_parameters.csv".weather_file
string Analogous to param_file.
management_file
string Analogous to param_file.
input_dir
string 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
.