load_nc_physics: Load Atlantis outputfiles (netcdf)

Description Usage Arguments Details Value See Also Examples

View source: R/load-nc-physics.R

Description

This function loads Atlantis outputfiles (netcdf) and converts them to a dataframe.

Usage

1
2
load_nc_physics(nc, select_physics, prm_run, bboxes, aggregate_layers = FALSE,
  warn_zeros = FALSE)

Arguments

nc

Character string giving the connection of the netcdf file to read in. The filename usually contains output and ends in .nc".

select_physics

Character vector of physical variables which shall be read in. Names have to match the ones used in the ncdf file.

prm_run

Character string giving the connection of the run parameterfile. The filename usually contains run_fishing and ends in .prm".

bboxes

Integer vector giving the box-id of the boundary boxes. Can be created with get_boundary.

aggregate_layers

Logical indicating if values for layers should be aggregated (TRUE) or not (FALSE). Default is FALSE.

warn_zeros

Logical indicating if check for actual zeros in the data shall be printed or not. Default is FALSE.

Details

This functions converts the ATLANTIS output to a dataframe which can be processed in R.

Value

A data.frame in long format with the following column names: variable, time, polygon, layer, and atoutput (i.e., variable).

See Also

Other load functions: load_box, load_bps, load_dietcheck, load_fgs, load_init_age, load_init, load_nc, load_rec, load_spec_mort, load_txt

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
d <- system.file("extdata", "setas-model-new-becdev", package = "atlantistools")
nc <- file.path(d, "outputSETAS.nc")
prm_run <- file.path(d, "VMPA_setas_run_fishing_F_New.prm")
bboxes <- get_boundary(boxinfo = load_box(file.path(d, bgm = "VMPA_setas.bgm")))
select_physics <- c("salt", "NO3", "volume")

test <- load_nc_physics(nc, select_physics, prm_run, bboxes)
str(test)

d <- system.file("extdata", "setas-model-new-trunk", package = "atlantistools")
nc <- file.path(d, "outputSETAS.nc")
prm_run <- file.path(d, "VMPA_setas_run_fishing_F_Trunk.prm")
bboxes <- get_boundary(boxinfo = load_box(file.path(d, bgm = "VMPA_setas.bgm")))

test <- load_nc_physics(nc, select_physics, prm_run, bboxes)
str(test)

test <- load_nc_physics(nc, select_physics = "nominal_dz", prm_run, bboxes)

atlantistools documentation built on Aug. 16, 2017, 9:05 a.m.