Title: | PEcAn Package for Integration of the BioCro Model |
---|---|
Description: | This module provides functions to link BioCro to PEcAn. |
Authors: | David LeBauer, Deepak Jaiswal, Christopher Black |
Maintainer: | David LeBauer <[email protected]> |
License: | BSD_3_clause + file LICENSE |
Version: | 1.7.3.9000 |
Built: | 2024-11-20 21:29:23 UTC |
Source: | https://github.com/PecanProject/pecan |
Converts a CF data frame into a BioCro met input
cf2biocro(met, longitude = NULL, zulu2solarnoon = FALSE)
cf2biocro(met, longitude = NULL, zulu2solarnoon = FALSE)
met |
data.table object with met for a single site; output from
|
longitude |
in degrees east, used for calculating solar noon |
zulu2solarnoon |
logical; if TRUE, convert time from GMT to local solar time. |
data.table / data.frame with fields
day of year
hour
solar radiation (PPFD)
temperature, degrees celsius
relative humidity, as fraction (0-1)
m/s
cm/h
David LeBauer
Performs model specific unit conversions on a list of trait values, such as those provided to write.config
convert.samples.BIOCRO(trait.samples, biocro_version = 1)
convert.samples.BIOCRO(trait.samples, biocro_version = 1)
trait.samples |
a matrix or dataframe of samples from the trait distribution |
biocro_version |
numeric, but currently only checks whether version is less than 1.0 |
dataframe with values transformed
David LeBauer
When available, default parameters come in sets of three: *_initial_values, *_parameters, *_modules
get_biocro_defaults(genus)
get_biocro_defaults(genus)
genus |
Name of the genus (or really any string BioCro uses as a *_parameters prefix) |
a list in the format expected by 'BioCro::Gro()', containing four lists named 'type', 'initial_values', 'parameters', and 'modules', or NULL if genus not found
Converts a met CF file to a model specific met file. The input files are called <in.path>/<in.prefix>.YYYY.cf
met2model.BIOCRO( in.path, in.prefix, outfolder, overwrite = FALSE, lat, lon, start_date, end_date, ... )
met2model.BIOCRO( in.path, in.prefix, outfolder, overwrite = FALSE, lat, lon, start_date, end_date, ... )
in.path |
path on disk where CF file lives |
in.prefix |
prefix for each file |
outfolder |
location where model specific output is written |
overwrite |
logical: Write over any existing file of the same name? If FALSE, leaves the existing file untouched and skips to the next year. |
lat , lon
|
Site latitude and longitude |
start_date , end_date
|
Date range to convert. Each year will be written to a separate file |
... |
other arguments passed from PEcAn, currently ignored |
a dataframe of information about the written file
Rob Kooper, David LeBauer
Modified from on model2netcdf.SIPNET and model2netcdf.ED2 by
model2netcdf.BIOCRO(result, genus = NULL, outdir, lat = -9999, lon = -9999)
model2netcdf.BIOCRO(result, genus = NULL, outdir, lat = -9999, lon = -9999)
result |
a dataframe of model output to be converted |
genus |
character: What kind of plant was being simulated? Used to correct for some genus-specific differences in model output; Eventually that will be handled inside BioCro and this argument will be removed. |
outdir |
Location of model output |
lat |
Latitude of the site |
lon |
Longitude of the site |
David LeBauer, Deepak Jaiswal, Rob Kooper
Read BioCro config file
read.biocro.config(config.file = "config.xml")
read.biocro.config(config.file = "config.xml")
config.file |
Path to XML file |
list of run configuration parameters for PEcAn
David LeBauer
Clear out previous config and parameter files.
remove.config.BIOCRO(main.outdir, settings)
remove.config.BIOCRO(main.outdir, settings)
main.outdir |
Primary PEcAn output directory (will be depreciated) |
settings |
PEcAn settings file |
nothing, removes config files as side effect
Shawn Serbin, David LeBauer
Run BioCro at a point
run.biocro( lat, lon, metpath, soil.nc = NULL, config = config, coppice.interval = 1 )
run.biocro( lat, lon, metpath, soil.nc = NULL, config = config, coppice.interval = 1 )
lat |
latitude in decimal degrees |
lon |
longitude in decimal degrees |
metpath |
full path and name prefix of a csv file with hourly data in BioCro format, e.g. ‘/dir/met' if the files to be used are '/dir/met.2004.csv' and 'dir/met.2005.csv’ |
soil.nc |
full path and name of a netCDF file with soil data |
config |
full path and name of a config.xml file containing parameter values and configuration information for BioCro |
coppice.interval |
numeric, number of years between cuttings for coppice plant or perennial grass. Only used with BioCro 0.9; ignored when using later versions. |
output from one of the BioCro::*.Gro
functions (determined by config$genus
), as data.table object
David LeBauer
Writes a configuration files for the biocro model
write.config.BIOCRO(defaults = NULL, trait.values, settings, run.id)
write.config.BIOCRO(defaults = NULL, trait.values, settings, run.id)
defaults |
named list with default model parameter values |
trait.values |
named list (or dataframe of trait values)
can either be a data.frame or named list of traits, e.g.
|
settings |
pecan settings file configured for BioCro |
run.id |
integer; a unique identifier for the run. |
nothing, writes configuration file as side effect
David LeBauer