Description Usage Arguments Author(s) See Also Examples
View source: R/write.RIVpackage.R
Writes Modflow-USG River Package
1 | write.RIVpackage(rivdf, filename, nSPs, IRIVCB, SPwarnings = T)
|
rivdf |
DataFrame/Geometry of drain nodes as returned by |
filename |
character, name/location of output file |
nSPs |
integer, number of stress periods in simulation |
IRIVCB |
integer, CBB flow flag. See details (or PBJ package manual) for more info |
SPwarnings |
T/F (optional) turn on (True) or off (False) warnings about reused or missing SP data |
Leland Scantlebury
calc_stream_drn
write.PBJpackage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #-- Read in shapefiles
stream <- read_sf(system.file("extdata", "straight_river.shp", package = "pbjr"))
tri <- read_sf(system.file("extdata", "straight_triangles.shp", package = "pbjr"))
vor <- read_sf(system.file("extdata", "straight_voronoi.shp", package = "pbjr"))
#-- Explode polyline
stream <- line_explode(stream)
#-- Create rivdf
rivdf <- calc_stream_drn(stream = stream, voronoi = vor)
#-- Add conductance
rivdf$cond1 <- calc_conductance_modflow(rivdf, k_streambed = 1,
str_width = 1, thickness = 0.5)
#-- Add river bottom elevation
rivdf$elev1 <- 90.0
#-- Add stage as 1 m above river bottom
rivdf$stage1 <- rivdf$elev1 + 1
#-- Write file
write.DRNpackage(rivdf, filename = paste0(tempdir(),'/straight_model.drn'), nSPs=2, IRIVCB=50)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.