Package 'PEcAn.dvmdostem'

Title: PEcAn Package for Integration of the Dvmdostem Model
Description: This module provides functions to link the dvmdostem model to PEcAn.
Authors: Tobey Carman, Shawn Serbin
Maintainer: Tobey Carman <[email protected]>, Shawn Serbin <[email protected]>
License: BSD_3_clause + file LICENSE
Version: 1.7.3.9000
Built: 2024-11-20 21:29:03 UTC
Source: https://github.com/PecanProject/pecan

Help Index


Adjust runmask for dvmdostem.

Description

Adjust the runmask for dvmdostem. This is necessary if you are using a mutisite dvmdostem dataset (more than one grid cell/pixel) and you are not forcing the community (cmt or vegetation) type. In other words you are using a vegetation map to determine the pixel's cmt type. In this case you must make sure that for the site and PFTs you have selected, the underlying veg map classifies the site as the same community type of the PFT you have chosen to run.

Usage

adjust.runmask.dvmdostem(siteDataPath, rundir, pixel_X, pixel_Y)

Arguments

siteDataPath

path to expected/default runmask (one of dvmdostem standard input files)

rundir

path to the location for this run (local run directory)

pixel_X

the X coordinate of the pixel to turn on (1 based!)

pixel_Y

the Y coordinate of the pixel to turn on (1 based!)

Author(s)

Tobey Carman


Convert samples for dvmdostem

Description

convert parameters, do unit conversions and update parameter names from PEcAn database default to units/names within dvmdostem

Usage

convert.samples.dvmdostem(trait_values)

Arguments

trait_values

a matrix or dataframe of samples from the trait distribution

Details

Performs model specific unit conversions on a a list of trait values, such as those provided to write.config

Value

matrix or dataframe with values transformed

Author(s)

Shawn Serbin, Tobey Carman


Make sure that selected run mask pixel, veg map pixel value and CMT type are all copasetic. The function calls stop() if there is anything inconsistent, for example more tha one pixel is enabled in the run mask, or the enabled pixel's vegetation type does not match the vegetation/community type of the chosen PFTs.

Description

Make sure that selected run mask pixel, veg map pixel value and CMT type are all copasetic. The function calls stop() if there is anything inconsistent, for example more tha one pixel is enabled in the run mask, or the enabled pixel's vegetation type does not match the vegetation/community type of the chosen PFTs.

Usage

enforce.runmask.cmt.vegmap.harmony(siteDataPath, rundir, cmtnum)

Arguments

siteDataPath

is the path to the folder where we expect to find the dvmdostem input data files.

rundir

is the path to the local running directory where customized files (config, parameters, runmask etc) are copied to.

cmtnum

is the community type (vegetation type) that should be used for the run. Based on the chosen PFT, and required to look up the correct parameters in the parameter files.

Value

none

Author(s)

Tobey Carman


Code to convert dvmdostem netcdf output into into CF standard

Description

Code to convert dvmdostem netcdf output into into CF standard

Usage

model2netcdf.dvmdostem(outdir, runstart, runend, pecan_requested_vars)

Arguments

outdir

Location of dvmdostem model output

runstart

??

runend

??

pecan_requested_vars

a space separated string with names of the PEcAn variables to output.

Author(s)

Tobey Carman, Shawn Serbin

Examples

## Not run: 
# example code here?

## End(Not run)

Requested variables string to list conversion.

Description

Look up the "depends_on" in the output variable mapping, accumulate a list of dvmdostem variables to turn on to support the requested variables in the pecan.xml tag

Usage

requested_vars_string2list(req_v_str, outspec_path)

Arguments

req_v_str

A string, (comma or space separated?) of variables

outspec_path

The path to an outspec file

Value

a list of the requested variables

Author(s)

Tobey Carman


Setup outputs to be generated by dvmdostem and analyzed by PEcAn.

Description

Setup the output variables that dvmdostem will generate and PEcAn will analyze. This function handles the interplay between output variables and output spec file. There are custom tags in the <model> section of the pecan xml file for dvmdostem that allow the user to specifiy a list of variables to generate and process, and a custom path to an output spec file. The need for a custom path to an output spec file is mostly gone with the addition of the variable list, but will be left in place in case there is a future need for it. This function looks at the client supplied settings for output spec path and variable list and returns the path to the final run specific output spec file and the list of variables to process. The run specific output spec file is copied into place and adjusted using the dvmdostem script for working with output spec files.

Usage

setup.outputs.dvmdostem(
  dvmdostem_calibration,
  pecan_requested_outputs,
  dvmdostem_output_spec,
  run_directory,
  run_id,
  appbinary_path
)

Arguments

dvmdostem_calibration

a string with 'yes' or 'YES'

pecan_requested_outputs

a space separated string of variables to process or NULL.

dvmdostem_output_spec

a path to a custom output spec file or NULL.

run_directory

a path to the direcotory containing the PEcAn run.

run_id

the identifier for this individual run (usually a 10 digit number).

appbinary_path

path to the dvmdostem application.

Value

Vector containing path to the run specific output spec file and the final space separated string of out variables to pecanify.

Author(s)

Tobey Carman


Build a mapping from dvmdostem names to PEcAn names, units, etc. The temunits should be (are) looked up from the dvmdostem output file's units attributes.

Description

This data structure allows us to keep track of PEcAn output variables that might depend on more than one DVMDOSTEM files.

Usage

vmap_reverse

Format

An object of class list of length 19.


Write dvmdostem model configuration files

Description

Writes a dvmdostem PEcAn config file.

Usage

write.config.dvmdostem(defaults = NULL, trait.values, settings, run.id)

Arguments

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

Details

Requires a pft xml object, a list of trait values for a single model run, and the name of the file to create

Value

none

Author(s)

Tobey Carman, Shawn Serbin


Write data into PEcAn shaped output file.

Description

Write data into PEcAn shaped output file.

Usage

write.data2pecan.file(
  y_starts,
  outdir,
  pecan_requested_vars,
  monthly_dvmdostem_outputs,
  yearly_dvmdostem_outputs,
  px_Y,
  px_X
)

Arguments

y_starts

a list of years, i.e.: 1901, 1902, 1903, etc.

outdir

a path to the location where were we will look for dvmdostem outputs and write PEcAn outputs.

pecan_requested_vars

comma separated string listing the variables to process (PEcAn names).

monthly_dvmdostem_outputs

list of files available from dvmdostem at monthly resolution.

yearly_dvmdostem_outputs

list of files available from dvmdostem at yearly resolution.

px_Y

the pixel offset, Y (latitude) dimension.

px_X

the pixel offset, X (longitude) dimension.

Author(s)

Tobey Carman