gcs: Grid line co-ordinates

Description Usage Arguments Details Value Examples

Description

Find the co-ordinates of column (gccs) or row (grcs) dividers from the DIS package or the NetCDF-format output data.

Usage

1
2
3
4
5

Arguments

data

DIS.MFpackage or NetCDF object; MODFLOW data relating to the model

absolute

logical [1]; TRUE if the absolute, or global co-ordinates should be returned. The default is FALSE, so that the first co-ordinate is always 0

x0, y0

numeric [1]; If data is a DIS package and absolute = TRUE, then the value of x (gccs) or y (grcs) at the model origin (bottom left corner) must be given. Not needed with NetCDFs because this information is stored in the NetCDF output generated from Rflow.

v

numeric []; a vector of grid divider co-ordinates

Details

gccs and grcs return the x co-ordinates of the column dividers and the y co-ordinates of the row dividers respectively, in each case in ascending order, which will be the reverse of the row order in the latter case. Wrap with mids to find the midpoints, that is the node centres.

Value

gccs: numeric [NCOL + 1]
grcs: numeric [NROW + 1]
mids: numeric [length(v) - 1]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# using DIS.MFpackage
dis <- read.DIS(system.file("rflow_mf_demo.dis",
                            package = "Rflow"))
gccs(dis)
grcs(dis)

# arbitrary origin
gccs(dis, TRUE, 1000)

# using NetCDF
mfdata <- RNetCDF::open.nc({
  system.file("rflow_mf_demo.nc", package = "Rflow")
})

gccs(mfdata)
grcs(mfdata)

# origin is in fact 0,0 for the demo, so these will show no difference
gccs(mfdata, TRUE)
grcs(mfdata, TRUE)

# - if t0 is given with a NetCDF, a warning is given to avoid
#    ambiguity
## Not run: gccs(mfdata, TRUE, 1000)

# node centre x and y co-ordinates:
# - x
mids(gccs(mfdata, TRUE))
# - y
mids(grcs(mfdata, TRUE))

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