| Title: | PEcAn Package for Integration of the RothC Model |
|---|---|
| Description: | This module provides functions to link the Rothamstead soil carbon model "RothC" to PEcAn. Uses RothC >= 2.0, available on GitHub <https://github.com/Rothamsted-Models/RothC_Code> as well as directly from the RothC team <https://www.rothamsted.ac.uk/rothamsted-carbon-model-rothc>. |
| Authors: | Chris Black [aut, cre], Rothamsted Research [cph] |
| Maintainer: | Chris Black <[email protected]> |
| License: | BSD_3_clause + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-06-05 14:50:04 UTC |
| Source: | https://github.com/PecanProject/pecan |
Input files need to be named '<in.path>/<in.prefix>.YYYY.nc'
met2model.RothC( in.path, in.prefix, outfolder, start_date, end_date, overwrite = FALSE )met2model.RothC( in.path, in.prefix, outfolder, start_date, end_date, overwrite = FALSE )
in.path |
path on disk where CF files live |
in.prefix |
prefix for each file |
outfolder |
location where model specific output is written. |
start_date, end_date
|
When to start and end output. Specify as exact dates, but output will be padded to whole months. |
overwrite |
logical: replace output files if they already exist? |
Output files are named '<outfolder>/<in.prefix>.YY-mm.YY-mm.dat' with one line per month and columns for temperature, rainfall, and evaporation.
Note that the created file contains only weather data and not any of the soil or management data needed for RothC's single combined input file. See 'write.config.RothC()' for assembly into a model-ready RothC_input.dat'.
data frame summarizing file metadata
Chris Black
Convert RothC output to PEcAn-formatted netCDF
model2netcdf.RothC(outdir, sitelat, sitelon, start_date, end_date)model2netcdf.RothC(outdir, sitelat, sitelon, start_date, end_date)
outdir |
Location of model output |
sitelat |
Latitude of the site |
sitelon |
Longitude of the site |
start_date |
Start time of the simulation |
end_date |
End time of the simulation |
Chris Black
Reads restart files from RothC. Not implemented yet.
read_restart.RothC(outdir, runid, stop.time, settings, var.names, params)read_restart.RothC(outdir, runid, stop.time, settings, var.names, params)
outdir |
Output directory |
runid |
Run ID |
stop.time |
Year that is being read |
settings |
PEcAn settings object |
var.names |
Variable names to be extracted |
params |
Any parameters required for state calculations |
Forecast numeric matrix
Chris Black
Not implemented yet.
write_restart.RothC( outdir, runid, start.time, stop.time, settings, new.state, RENAME, new.params, inputs )write_restart.RothC( outdir, runid, start.time, stop.time, settings, new.state, RENAME, new.params, inputs )
outdir |
outout directory |
runid |
run id |
start.time |
Time of current assimilation step |
stop.time |
Time of next assimilation step |
settings |
pecan settings list |
new.state |
Analysis state matrix returned by |
RENAME |
flag to either rename output file or not |
new.params |
optional, additionals params to pass write.configs that are deterministically related to the parameters updated by the analysis |
inputs |
new input paths updated by the SDA workflow, will be passed to write.configs |
Chris Black
Requires a pft xml object, a list of trait values for a single model run, and the name of the file to create
write.config.RothC(defaults, trait.values, settings, run.id)write.config.RothC(defaults, trait.values, settings, run.id)
defaults |
list of defaults to process |
trait.values |
vector of samples for a given trait |
settings |
list of settings from pecan settings file |
run.id |
id of run |
configuration file for MODEL for given run
Chris Black