rmf_read_array
reads a MODFLOW array from a separate file. Binary and ASCII formats are supported
rmf_read_array( file, nrow = NULL, ncol = NULL, nlay = 1, nstp = 1, binary = FALSE, kper = NULL, integer = FALSE, header = binary, precision = "single" )
file | filename to read the array from |
---|---|
nrow | number of rows in the array |
ncol | number of columns in the array |
nlay | number of layers in the array that should be read (3th dimension); defaults to 1 |
nstp | number of timesteps in the array that should be read (4th dimension); defaults to 1 |
binary | logical; is the array read from a binary file. |
kper | integer vector specifying the stress periods in which the array is active. Defaults to |
integer | logical; does the array hold integer values. Only used for binary files. Might not work optimally. |
header | logical; should a MODFLOW style header be read for the array (see 'Details'). Defaults to TRUE if |
precision | character: either |
a rmf_array with optional attributes if a header was read.
nrow
, ncol
, nlay
, nstp
have to be specified if header is FALSE. They are used to dimension the array.
The integer
flag is only used when reading binary files.
The header file consists of the following elements:
KSTP
, KPER
,PERTIM
,DESC
,NCOL
, NROW
, ILAY
and FMTIN
(see https://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?frequently_asked_questions.htm for their respective meaning.)
The FMTIN
element is not read for binary files.
If a header is read, the values are set as attributes to the array.