Learn R Programming

dycdtools (version 0.4.4)

ext_output: 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)

Value

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

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.

Examples

Run this code
 # 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))
 }

Run the code above in your browser using DataLab