rmf_write_array writes a MODFLOW array to an output file. Binary and ASCII formats are supported

rmf_write_array(
  array,
  file,
  append = FALSE,
  binary = FALSE,
  header = binary,
  dis = NULL,
  desc = "HEAD",
  precision = "single",
  integer = FALSE,
  xsection = FALSE
)

Arguments

array

a 2D, 3D or 4D rmf_array to write.

file

filename to write to

append

logical; should the array be appended to the file

binary

logical; should the array be written to a binary file

header

logical; should a MODFLOW style header be written for the array (see 'Details'). Defaults to TRUE if binary = TRUE and FALSE otherwise.

dis

optional RMODFLOW dis object. Used when KPER, PERTIM and TOTIM in the header should be exact.

desc

character of maximum 16 characters. Used to set the desc element in the header. Default to 'HEAD'

precision

character; either 'single' or 'double'. Denotes the precision of the binary file.

integer

logical; does the binary array contain integer values? Defaults to FALSE

xsection

logical; does the array represent a NLAY x NCOL cross-section. See 'Details'.

Value

NULL

Details

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.) If the array is 2D or 3D, KSTP, KPER,PERTIM are always set to 1; otherwise they are all equal to the index of the 4th dimension.

The DESC element must be read but it not used by MODFLOW itself. Users may want to specify a different DESC value when using the array with postprocessing software.

The FMTIN element is not written for binary files. For ASCII files, RMODFLOW sets it as NCOL * F. Note that the ASCII format is irrelevant when using free-format reading and writing.

xsection can be set to TRUE if the array represents a cross-section, i.e. the ibound or strt array in the bas file. The user must make sure the array is of dimension NLAY * NCOL. The sole function of xsection is to set the ILAY argument to -1 which promts MODFLOW to write slightly different information to the listing file. xsection does not affect simulation results (assuming the array dimensions are correct)

See also