Skip to content

Input Files

jschoate edited this page Dec 24, 2024 · 10 revisions

Generate input files needed to run RHESSys

  1. Worldfile Header
  2. TecFile (Temporal Event Control File)
    Standard Daily
    All options

IOin_hdr()

  • Creates a header file based on specified parameter definition files and climate basestations.
  • Supply the path to and name of the definition file associated with the function option.
  • Path and file name string must be enclosed in quotation marks.
  • When multiple definition files are being listed, use the concatenate c() function to combine the list of files
  • list each path/name separated by a comma

Main branch of code - enclose each string (each def file) in quotation marks, i.e.
stratum = c("../defs/veg_X.def", "../defs/veg_X.def", "../defs/veg_X.def")

Develop branch of code - enclose full string list in quotation marks, i.e.
stratum = c("../defs/veg_X.def, ../defs/veg_X.def, ../defs/veg_X.def")

When creating a Header file with IOin_hdr, the concatenate c() function must be used to create a character vector when multiple definition files for a level (i.e. multiple soil, veg, landuse, climate stations) are included. The entire string of def files within the concatenate function must be enclosed by parentheses, and each element must be separated by commas with no spaces between elements, for example:

stratum = c("../defs/veg_Pine.def,../defs/veg_Deciduous.def,../defs/veg_Grass.def"),

Important

Enclose entire list of def files in parenthesis - do not put parenthesis around each def file.
Separate each def file by a comma - do not include spaces between elements. List a def file path/name followed by a comma followed immediately by the next def file path/name.

Function options:

Option Expression File
basin = Path to basin parameter definition file.
hillslope = Path to hillslope parameter definition file.(s)
zone = Path to zone parameter definition file(s).
soil = Path to soil parameter definition file(s).
landuse = Path to landuse parameter definition file(s).
stratum = Path to stratum parameter definition file(s).
fire = Path to fire parameter definition file.
fire_grid_prefix = Path and basename/prefix name of the fire grid files used for the RHESSys WMFire model.
spinup = Path to spinup parameter definition file(s).
basestations = Path to basin climate basestation file(s).

Usage
example:

input_hdr = IOin_hdr(
basin = "../defs/basin.def",
hillslope = "../defs/hillslope.def",
zone = "../defs/zone.def",
soil = "../defs/soil_sandylaom.def",
landuse = "../defs/lu_undev.def",
stratum = c("../defs/veg_blueoak.def, ../defs/veg_liveoak.def, ../defs/veg_sagebrush.def, ../defs/veg_grass.def"),
basestations = "../clim/ClimateStation_base"
)

Standard

IOin_tec_std

Use the IOin_tec_std input function to construct a dataframe of standard DAILY tec events, including start, grow start, and output state

Argument Entry
start start date of run
end End date of run - the last entire day to be run
output_state TRUE/FALSE if an output_current_state tec event should be scheduled at the end of the simulation

Set your start and end dates as objects to use in the IOin_tec command:

start_tec_date = "1980 10 1 1"
end_tec_date = "2010 10 1 1"
input_tec_data = IOin_tec_std(start = start_tec_date, end = end_tec_date, output_state = FALSE )

Or write the dates explicitly in the command:

input_tec_data = IOin_tec_std(start = "1988 10 1 2", end = "2000 9 30 24", output_state = TRUE)

This will return a DAILY TecFile (IOin_tec_std will only produce a daily TecFile - for other options (monthly, yearly) see the IOin_tec_all_options tool below).

Multiple tec events can NOT be executed on the exact same day/time. When multiple events are going to occur on the same day, differentiate the events by the hour, i.e. event1 occurs on hour 1, event2 on the same day occurs on hour2, etc...
The IOin_tec_std function automatically increases the hour by 1 if there are multiple events occuring on the same day, i.e.

Generated TecFile contents:

year month day hour name
1980 10 1 1 print_daily_on
1980 10 1 2 print_daily_growth_on
2180 9 30 1 output_current_state

The TecFile will not have a header - it consist only of the date (in the standard RHESSys date format Year/Month/Day/Hour) and the event/action to occur:

1980 10 1 1 print_daily_on
1980 10 1 2 print_growth_daily_on
2180 9 30 1 output_current_state

All options

IOin_tec_all_options

Use the IOin_tec_all_options function to generate results other than standard daily results (i.e. monthly, yearly, redefine).
Generic input function to construct a dataframe for ALL possible RHESSys temporal event control (TEC) commands (except csv commands). The function is flexible, allowing the user to construct complex tec files. However, due to the number of potential combinations of tec events, there are few checks on appropriateness of tec event sequences (for example, turning off a tec event before it is turned on). Full list of tec commands in RHESSys is available at init/construct_tec.c

Note: All arguments accept a date or vector of dates in the format of
"year month day hour" e.g. c("2000 10 1 1", "2001 9 30 1").

Argument Action
print_hourly_on Start printing hourly output data
print_hourly_growth_on Start printing hourly carbon-related output data
print_hourly_off Stop printing hourly output data
print_hourly_growth_off Stop printing hourly carbon-related output data
print_daily_on Start printing daily output data
print_daily_growth_on Start printing daily carbon-related output data
print_daily_off Stop printing daily output data
print_daily_growth_off Stop printing daily carbon-related output data
print_monthly_on Start printing monthly output data
print_monthly_off Stop printing monthly output data
print_yearly_on Start printing yearly output data
print_yearly_growth_on Start printing yearly carbon-related output data
print_yearly_off Stop printing yearly output data
print_yearly_growth_off Stop printing yearly carbon-related output data
redefine_strata Redefine strata based on a file
redefine_world Redefine world based on a file
redefine_world_multiplier Redefine world based on a multiplier of existing worldfile values
redefine_world_thin_remain Redefine world based on a thinning event where removed vegetation is transferred to CWD and litter stores
redefine_world_thin_harvest Redefine world based on a thinning event where removed vegetation exits watershed
redefine_world_thin_snags Redefine world based on a thinning event where stems are left in place.
roads_on Start processing roads
roads_off Stop processing roads
output_current_state Outputs the state of the world at a specified time

Important

the IOin_tec_all_options function DOES NOT automatically increase the hour by 1 for multiple events, so this must be entered.

Usage:
Set your start and end dates as objects to use in the IOin_tec command:

start_tec_date = "1980 10 1 1"
start_tec_grow_date = "1980 10 1 2"
end_tec_date = "2010 10 1 1"
input_tec_data = IOin_tec_all_options(print_yearly_on = start_tec_date, print_yearly_growth_on = start_tec_grow_date)

Or write the dates explicitly in the command:
input_tec_data = IOin_tec_all_options(print_yearly_on = "1980 10 1 1", print_yearly_growth_on = "1980 10 1 2")

Clone this wiki locally