Package 'PEcAn.SIPNET'

Title: PEcAn Functions Used for Ecological Forecasts and Reanalysis
Description: The Predictive Ecosystem Carbon Analyzer (PEcAn) is a scientific workflow management tool that is designed to simplify the management of model parameterization, execution, and analysis. The goal of PECAn is to streamline the interaction between data and models, and to improve the efficacy of scientific investigation.
Authors: Mike Dietze [aut, cre], University of Illinois, NCSA [cph]
Maintainer: Mike Dietze <[email protected]>
License: BSD_3_clause + file LICENSE
Version: 1.8.0.9000
Built: 2024-11-04 07:27:52 UTC
Source: https://github.com/PecanProject/pecan

Help Index


Merge multiple NetCDF files into one

Description

Merge multiple NetCDF files into one

Usage

mergeNC(files, outfile)

Arguments

files

character. List of filepaths, which should lead to NetCDF files.

outfile

character. Output filename of the merged data.

Value

A NetCDF file containing all of the merged data.

Source

https://github.com/RS-eco/processNC/blob/main/R/mergeNC.R

Examples

## Not run: 
files <- list.files(paste0(system.file(package="processNC"), "/extdata"), 
                    pattern="tas.*\\.nc", full.names=TRUE)
temp <- tempfile(fileext=".nc")
mergeNC(files=files, outfile=temp)
terra::rast(temp) 

## End(Not run)

met2model.SIPNET

Description

met2model wrapper for SIPNET

Usage

met2model.SIPNET(
  in.path,
  in.prefix,
  outfolder,
  start_date,
  end_date,
  overwrite = FALSE,
  verbose = FALSE,
  year.fragment = FALSE,
  ...
)

Arguments

in.path

location on disk where inputs are stored

in.prefix

prefix of input and output files OR the full file name if year.fragment = TRUE

outfolder

location on disk where outputs will be stored

start_date

the start date of the data to be downloaded (will only use the year part of the date)

end_date

the end date of the data to be downloaded (will only use the year part of the date)

overwrite

should existing files be overwritten

verbose

should the function be very verbose

year.fragment

the function should ignore whether or not the data is stored as a set of complete years (such as for forecasts).

...

Additional arguments, currently ignored

Author(s)

Luke Dramko, Michael Dietze, Alexey Shiklomanov, Rob Kooper


Convert SIPNET output to netCDF

Description

Converts all output contained in a folder to netCDF.

Usage

model2netcdf.SIPNET(
  outdir,
  sitelat,
  sitelon,
  start_date,
  end_date,
  delete.raw = FALSE,
  revision,
  prefix = "sipnet.out",
  overwrite = FALSE,
  conflict = FALSE
)

Arguments

outdir

Location of SIPNET 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

delete.raw

logical: remove sipnet.out files after converting?

revision

model revision

prefix

prefix to read the output files

overwrite

Flag for overwriting nc files or not

conflict

Flag for dealing with conflicted nc files, if T we then will merge those, if F we will jump to the next.

Author(s)

Shawn Serbin, Michael Dietze


Read restart function for SDA with SIPNET

Description

Read Restart for SIPNET

Usage

read_restart.SIPNET(outdir, runid, stop.time, settings, var.names, params)

Arguments

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

Value

X.vec vector of forecasts

Author(s)

Ann Raiho [email protected]


Clear out previous SIPNET config and parameter files.

Description

Clear out previous SIPNET config and parameter files.

Usage

remove.config.SIPNET(main.outdir, settings)

Arguments

main.outdir

Primary PEcAn output directory (will be depreciated)

settings

PEcAn settings file

Value

nothing, removes config files as side effect

Author(s)

Shawn Serbin, David LeBauer


Sample initial conditions for SIPNET

Description

Sample initial conditions for SIPNET

Usage

sample.IC.SIPNET(ne, state, year = 1)

Arguments

ne

number of ensembles

state

state variables you want to pull

year

year to pull from

Value

IC matrix of initial conditions

Author(s)

Mike Dietze and Ann Raiho


Convert SIPNET DOY to datetime

Description

Convert SIPNET DOY to datetime

Usage

sipnet2datetime(sipnet_tval, base_year, base_month = 1, force_cf = FALSE)

Arguments

sipnet_tval

vector of SIPNET DOY values

base_year

base year to calculate datetime from DOY

base_month

reference month for converting from DOY to datetime

force_cf

force output to follow CF convention. Default FALSE

Author(s)

Alexey Shiklomanov, Shawn Serbin


split_inputs.SIPNET

Description

Splits climate met for SIPNET

Usage

split_inputs.SIPNET(
  settings,
  start.time,
  stop.time,
  inputs,
  overwrite = FALSE,
  outpath = NULL
)

Arguments

settings

PEcAn settings object

start.time

start date and time for each SDA ensemble

stop.time

stop date and time for each SDA ensemble

inputs

list of model inputs to use in write.configs.SIPNET

overwrite

Default FALSE

outpath

if specified, write output to a new directory. Default NULL writes back to the directory being read

Value

file split up climate file

Author(s)

Mike Dietze and Ann Raiho


veg2model.SIPNET

Description

veg2model.SIPNET

Usage

veg2model.SIPNET(outfolder, poolinfo, siteid, ens)

Arguments

outfolder

location to store ncdf files

poolinfo

object passed from write_ic contains output from cohort2pool function

siteid

object passed from write_ic contains site id

ens

number of ensemble members

Value

result object with filepaths to ncdf files

Author(s)

Alexis Helgeson


write_restart.SIPNET

Description

Write restart files for SIPNET. WARNING: Some variables produce illegal values < 0 and have been hardcoded to correct these values!!

Usage

write_restart.SIPNET(
  outdir,
  runid,
  start.time,
  stop.time,
  settings,
  new.state,
  RENAME = TRUE,
  new.params = FALSE,
  inputs,
  verbose = FALSE
)

Arguments

outdir

output directory

runid

run ID

start.time

start date and time for each SDA ensemble

stop.time

stop date and time for each SDA ensemble

settings

PEcAn settings object

new.state

analysis state vector

RENAME

flag to either rename output file or not

new.params

list of parameters to convert between different states

inputs

list of model inputs to use in write.configs.SIPNET

verbose

decide if we want to print the outputs.

Value

NONE

Author(s)

Ann Raiho [email protected]


Writes a configuration files for SIPNET model

Description

Writes a configuration files for your model

Usage

write.config.SIPNET(
  defaults,
  trait.values,
  settings,
  run.id,
  inputs = NULL,
  IC = NULL,
  restart = NULL,
  spinup = NULL
)

Arguments

defaults

pft

trait.values

vector of samples for a given trait

settings

PEcAn settings object

run.id

run ID

inputs

list of model inputs

IC

initial condition

restart

In case this is a continuation of an old simulation. restart needs to be a list with name tags of runid, inputs, new.params (parameters), new.state (initial condition), ensemble.id (ensemble id), start.time and stop.time.See Details.

spinup

currently unused, included for compatibility with other models

Author(s)

Michael Dietze