Package 'PEcAn.BASGRA'

Title: PEcAn Package for Integration of the BASGRA Model
Description: This module provides functions to link the BASGRA model to PEcAn.
Authors: Istem Fer [aut, cre], University of Illinois, NCSA [cph]
Maintainer: Istem Fer <[email protected]>
License: BSD_3_clause + file LICENSE
Version: 1.8.0.9000
Built: 2024-12-17 17:28:01 UTC
Source: https://github.com/PecanProject/pecan

Help Index


Read restart function for SDA with BASGRA

Description

Read Restart for BASGRA

Usage

read_restart.BASGRA(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)

Istem Fer


run BASGRA model

Description

BASGRA wrapper function. Runs and writes model outputs in PEcAn standard.

Usage

run_BASGRA(
  run_met,
  run_params,
  site_harvest,
  site_fertilize,
  start_date,
  end_date,
  outdir,
  sitelat,
  sitelon,
  co2_file = NULL,
  write_raw_output = FALSE
)

Arguments

run_met

path to CF met

run_params

parameter vector

site_harvest

path to harvest file

site_fertilize

path to fertilizer application file

start_date

start time of the simulation

end_date

end time of the simulation

outdir

where to write BASGRA output

sitelat

latitude of the site

sitelon

longitude of the site

co2_file

path to daily atmospheric CO2 concentration file, optional, defaults to 350 ppm when missing

write_raw_output

write raw output in csv or not

Details

BASGRA is written in fortran is run through R by wrapper functions written by Marcel Van Oijen. This function makes use of those wrappers but gives control of datastream in and out of the model to PEcAn. With this function we skip model2netcdf, we can also skip met2model but keeping it for now. write.config.BASGRA modifies args of this function through template.job then job.sh runs calls this function to run the model

Author(s)

Istem Fer, Julius Vira


write_restart.SIPNET

Description

Write restart files for BASGRA

Usage

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

Arguments

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 sda.enkf

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

Value

TRUE if successful

Author(s)

Istem Fer


Write BASGRA configuration files

Description

Writes a BASGRA config file.

Usage

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

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

IC

initial conditions list

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

configuration file for BASGRA for given run

Author(s)

Istem Fer