GW.nc: MODFLOW results to NetCDF data set

Description Usage Arguments Value Examples

Description

MODFLOW results to NetCDF data set

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
GW.nc(dir, mfrt, ncrt = mfrt, DIS = paste0(mfrt, ".dis"),
  HDS = paste0(mfrt, ".hds"), CBB = paste0(mfrt, ".cbb"),
  CBW = paste0(mfrt, ".cbw"), CRC = paste0(mfrt, ".crc"),
  CRV = paste0(mfrt, ".crv"), CBD = paste0(mfrt, ".cbd"),
  CBG = paste0(mfrt, ".cbg"), CS1 = paste0(mfrt, ".cs1"),
  BAS = paste0(mfrt, ".bas"), LPF = paste0(mfrt, ".lpf"),
  BCF = paste0(mfrt, ".bcf"), HNOFLO, HDRY,
  title = "untitled MODFLOW data set", author = "", datum = "",
  length.unit = "metre", time.unit = "day", xyt0 = c(0, 0, 0),
  start_date = "", updating = TRUE, .FillValue = 1e+30,
  split.tss = NULL, ch = TRUE)

Arguments

dir

character string; directory in which reside the MODFLOW output and input files

mfrt

character string; non-extended filename to use as root for finding default MODFLOW input and output file names

ncrt

character string; filename (minus extension) for resulting NetCDF data set (default is mfrt)

DIS, BAS, LPF, BCF

character string; File names for DIS, BAS, LPF and BCF package files. The latter three are only used for finding HNOFLO and HDRY if these are not given.

HDS

character string; File name for head array.

CBB, CBW, CRC, CRV, CBD, CBG, CS1

character string; File names for budget files, cell-by-cell flows and those relating to specific boundary conditions. If a file doesn't exist it is simply ignored.

HNOFLO

numeric [1]; value to interpret as inactive cells in head array, automatically gleaned from BAS package file if not given

HDRY

numeric [1]; value to interpret as dry cell in head array, automatically gleaned from LPF or BCF package file if not given

title

character string; title of the model, optional but recommended

author

character string; who constructed the MODFLOW model? (Not who performed the conversion to NetCDF.)

datum

character string; description of the reference datum for height/ head values, for example "Ordnance Datum"

length.unit, time.unit

character string; implied length and time units of the model, recommended to use full name (e.g. "metre" not "m")

xyt0

numeric [3]; global x and y values at the bottom left corner of the model and the absolute time value that the start of the model refers to

start_date

character string; purely explanatory, enables the author to describe what start_time refers to

updating

logical [1]; Get meta data (global attributes) from existing NetCDF data set? Will only attempt if the NetCDF data set already exists, so the default is TRUE. This can save rewriting meta data such as title and origin.

split.tss

integer []; time steps at which to split into multiple NetCDFs; the end time step of the split group is to be given; an integer vector if this feature is to be used

ch

logical [1]; whether to save the constant head flux (in a simulation with no CHs, there will still be arrays for constant head in the budget files, which waste space as all the elements are 0; it is not possible to know a priori whether the CH array is needed, so the user should say if s/he knows)

Value

NULL

Prints a summary of the final NetCDF data set using print.nc.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# find the directory
wkdir <- paste0(system.file("inst", package = "Rflow"))

# make fresh
GW.nc(wkdir, "rflow_mf_demo", "RFLOW_EXAMPLE", title = "example",
      author = "model builder's name", datum = "OD or something",
      xyt0 = c(0, 0, 0), start_date = "the start time descriptively")

# update results, but keep metadata, with updating = TRUE (default)
GW.nc(wkdir, "rflow_mf_demo", "RFLOW_EXAMPLE")

library(RNetCDF)
mfdata <- open.nc(paste0(wkdir, "/rflow_mf_demo.nc"))
print.nc(mfdata)

CJBarry/Rflow documentation built on June 16, 2019, 12:35 p.m.