make.init.csv: Function that generates two csv initial condition templates

View source: R/initGen.R

make.init.csvR Documentation

Function that generates two csv initial condition templates

Description

Takes data from group file and box geometry file and generates two csv files that should be copied and modified. The two files generated are called [csv.name]_init.csv and [csv.name]_horiz.csv. Also required is the vector of cumulative depths, whos first element is 0. [csv.name]_init.csv provides all the variables required in the .nc initial conditions file and their default attributes. [csv.name]_horiz.csv provides box-specific values if the variable is set as customised in the [csv.name]_init file. See also make.init.nc for how these files are converted into a NetDF file.

Usage

make.init.csv(grp.file, bgm.file, cum.depths, csv.name, ice_model = FALSE)

Arguments

grp.file

Atlantis group (.bgm) file that defines groups.

bgm.file

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

cum.depths

vector of cumulative depths (starting with zero).

csv.name

String that is used to identify the two output csv files.

ice_model

Boolean string. Is the model using Fe and Ice dependent species?

Value

Null (always). Produces two csv files with the names [csv.name]_init.csv and [csv.name]_horiz.csv.

Examples

## 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 April 10, 2024, 7:19 a.m.