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
.
make.init.nc(
bgm.file,
cum.depths,
init.file,
horiz.file,
nc.file,
vert = NULL,
ice_model = FALSE
)
Box geometry model (.bgm) file used by Atlantis that defines box boundaries and depths.
Vector of cumulative depths (starting with value zero).
csv file containing all variable names and their attributes. Also includes how the values are distributed in space and the vertical.
csv file containing box-defined values if customised flag is set for the horizontal distribution in init.file
.
name of the NetCDF file generated which contains the initial conditions. This file can be used as input to Atlantis.
name and location of the csv file containing the functional groups' vertical distribution
Boolean string. Is the model using Fe and Ice dependent species?
Null (always). Produces a NetCDF file with the name nc.file
.
if (FALSE) {
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)
}