Learn R Programming

inlmisc (version 0.3.2)

ReadModflowBinary: Read MODFLOW Binary File

Description

This is a utility function for MODFLOW-based models, the U.S. Geological Survey's three-dimensional finite-difference groundwater model. It reads data from binary files produced by MODFLOW.

Usage

ReadModflowBinary(path, data.type = c("array", "flow"), endian = c("little",
  "big"), rm.totim.0 = FALSE)

Arguments

path

'character'. Path to a MODFLOW binary file.

data.type

'character'. Description of how the data were saved. Specify "array" for array data (such as hydraulic heads or drawdowns) and "flow" for cell-by-cell flow data (budget data).

endian

'character'. The endian-ness (or byte-order) of the binary file.

rm.totim.0

'logical'. If true, data associated with the stress period at time zero are removed.

Value

Returns a 'list' object of length equal to the number of times data are written to the binary file. The following list components are returned:

d

matrix of values. The matrix dimensions typically coincide with the horizontal model grid. The exception is for flow data (data.type = "flow") when the cell-by-cell budget file is saved using the "COMPACT BUDGET" output option; for this case, matrix columns are: cell index ("icell"), model-grid layer ("layer"), model-grid row ("row"), model-grid column ("column"), cell-by-cell flow ("flow"), and any auxiliary variables saved using the "AUXILIARY" output option.

kstp

time step

kper

stress period

desc

description of data-type, such as "wells".

layer

model-grid layer

delt

time-step size

pertim

elapsed time in the current stress period.

totim

total elapsed time

The layer component (layer) and time components (delt, pertim, totim) are only available for flow data when the cell-by-cell budget file is saved using the "COMPACT BUDGET" output option.

See Also

SummariseBudget

Examples

Run this code
# NOT RUN {
path <- system.file("extdata", "ex.hds", package = "inlmisc")
heads <- ReadModflowBinary(path, "array")
image(heads[[1]]$d)
str(heads[[1]])

path <- system.file("extdata", "ex.bud", package = "inlmisc")
budget <- ReadModflowBinary(path, "flow")
image(budget[[1]]$d)
str(budget[[1]])
str(budget[[11]])

# }

Run the code above in your browser using DataLab