calc_timestep2time: Converts timestep from Atlantis output to real time

View source: R/calc_timestep2time.R

calc_timestep2timeR Documentation

Converts timestep from Atlantis output to real time

Description

Converts timestep from Atlantis output to real time

Usage

calc_timestep2time(dir = getwd(), data, file_runprm)

Arguments

dir

The directory of the atlantis model output, where the default is getwd().

data

A data frame of Atlantis output. Where the data frame can be of any structure as long as it has a column with the name "time".

file_runprm

A character value giving the file name of the biology .xml file. The file should be located in your current working directory or the folder you specify in dir. The argument can also be specified as the full path name, just as long as argument dir is specified as NULL. Usually the file is named "[...]_run.xml".. This file is output from an Atlantis run in a standard format and is based on input from the "[...]_run.prm" file.

Details

Atlantis output uses time steps, where time steps are sequential and start at zero. convert_time converts the time step to dates, where zero is January 01, 1970.

Value

A data.frame in tidy format with a column date showing the real date and year showing the real year. If there is not column "time" in the data.frame specified for the data, then the original data.frame is returned.

Author(s)

Alexander Keth

See Also

load_fgs

Other calc functions: calc_Z(), calc_age2length(), calc_avgwtstage2age(), calc_biomass_age(), calc_biomass_pool(), calc_pred_cons(), calc_pred_diet(), calc_stage2age()

Examples


d <- system.file("extdata", "SETAS_Example", package = "atlantisom")
load(file = file.path(d, "outputsrun_truth.RData"))
test <- calc_timestep2time(dir = d, data = result$biomass_ages,
  file_runprm = "Run_settings.xml")
rm(test)


r4atlantis/atlantisom documentation built on Nov. 12, 2023, 2:59 a.m.