make.init.nc: Function that generates a NetCDF file of initial conditions

Description Usage Arguments Value Examples

View source: R/initGen.R

Description

Takes data from two csv files and generates an Atlantis initial conditions NetCDF file. The csv files should be generated using make.init.csv. init.file contains all variable names to be included in the NetCDF file and their attributes. This file also contains initial conditions and their spatial distribution (e.g., surface only, uniformly distributed in the vertical) if they are not box-specific. Box-specific values are specified in horiz.file and must be labelled as custom in init.file.

Usage

1
make.init.nc(bgm.file, cum.depths, init.file, horiz.file, nc.file)

Arguments

bgm.file

Box geometry model (.bgm) file used by Atlantis that defines box boundaries and depths.

cum.depths

Vector of cumulative depths (starting with value zero).

init.file

csv file containing all variable names and their attributes. Also includes how the values are distributed in space and the vertical.

horiz.file

csv file containing box-defined values if customised flag is set for the horizontal distribution in init.file.

nc.file

Name of the NetCDF file generated which contains the initial conditions. This file can be used as input to Atlantis.

Value

Null (always). Produces a NetCDF file with the name nc.file.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 
grp.file   <- "GBRGroups.csv"
bgm.file   <- "gbr_test.bgm"
cum.depths <- c(0,5,10,20,50,100,200,3000)
csv.name   <- "GBRtemplate"
make.init.csv(grp.file, bgm.file, cum.depths, csv.name)

# copy GBRtemplate_init.csv to GBR_init.csv
# copy GBRtemplate_horiz.csv to GBR_horiz.csv
# edit files GBR_init.csv and GBR_horiz.csv by entering initial conditions

init.file  <- "GBR_init.csv"
horiz.file <- "GBR_horiz.csv"
nc.file    <- "GBRtemplate.nc"
make.init.nc(bgm.file, cum.depths, init.file, horiz.file, nc.file)

# view the initial conditions file
init.obj <- make.sh.init.object(bgm.file, nc.file)
sh.init(init.obj)

## End(Not run)

shanearichards/shinyrAtlantis documentation built on May 29, 2019, 8:07 p.m.