ext_output: Extract outputs from a DYRESM-CAEDYM model run

View source: R/Fun_Extract-simulation.R

ext_outputR Documentation

Extract outputs from a DYRESM-CAEDYM model run

Description

Extract simulation outputs from a DYRESM-CAEDYM model run.

Usage

ext_output(dycd.output, var.extract, verbose = FALSE)

Arguments

dycd.output

a string of characters describing the file path to the output netcdf file of DYRESM-CAEDYM model.

var.extract

a vector of variables to be extracted from the output. Please refer to the var.name of data(output_name) for accepted variable name. Apart from the user nominated variables, simulation period and layer height data are also extracted.

verbose

if TRUE, the information about the extraction process is printed.

Value

a list of values of those variables of interest, as well as two compulsory variables (i.e. simulation period, layer height)

Examples

 # extract simulated temperature values from DYRESM-CAEDYM simulation file
 var.values<-ext_output(dycd.output=system.file("extdata", "dysim.nc",
                                                 package = "dycdtools"),
                       var.extract=c("TEMP"))

 for(i in 1:length(var.values)){
  expres<-paste0(names(var.values)[i],"<-data.frame(var.values[[",i,"]])")
  eval(parse(text=expres))
 }


dycdtools documentation built on Nov. 22, 2022, 1:12 a.m.