Description Usage Arguments Value Author(s) See Also Examples
View source: R/write.river.append2Inflow.R
New river inflow data of the the Fortran format 'F8.6' (width=8; 6 digits in front of the '.') is appended to an existing file. One file per day is modified.
1 2 | write.river.append2Inflow(riverNames, riverInfos, riverData, grids, dIn, dOt,
year, month = 0, day = 0, overwrite = TRUE, warn = TRUE)
|
riverNames |
character array with river names |
riverInfos |
list() of grid-information-lists(); to each element in riverNames one list element with the same name needs to exist in riverInfos |
riverData |
list() of river-inflow-data-lists(); to each element in riverData one list element with the same name needs to exist in riverInfos |
grids |
character array with grid names |
dIn |
character; directory containing the input file (to which data should be appended) |
dOt |
character; directory into which the final file should be written |
year |
integer; year to write out |
month |
integer; month to write out; if month==0 => write all months |
day |
integer; day to write out; if day==0 => write all days |
overwrite |
logical; overwrite 'dOt/filename' it already exists |
warn |
logical; allow/suppress warnings |
file written
Daniel Neumann, daniel.neumann@io-warnemuende.de
write.river.newInflow, write.river.append2NML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # read a file:
test.mom.monthly <- list()
test.mom.monthly$Warnow <- read.river.mom('files/GER_Dan_Str_Warnow.dat')
test.mom.monthly$Trave <- read.river.mom('files/GER_Dan_Str_Trave.dat')
# calculate annual means from monthly data
test.mom.daily <- list()
test.mom.daily$Warnow <- interpolate.river.mom(test.mom.monthly$Warnow, to = 'daily', method = 'step')
test.mom.daily$Trave <- interpolate.river.mom(test.mom.monthly$Trave, to = 'daily', method = 'step')
# get grid info
grid_info <- get.infos.grids.hbm.basic()
# get river infos
file <- 'files/river_list.dat'
riverInfos <- read.infos.rivers(file, grid_info)
# (you will get some warnings here)
# write new namelist
write.river.append2Inflow(c('Warnow', 'Trave'), riverInfos, test.mom.daily, grid_info, 'files', 'out_dir', 2012, month = 1, day = 1:5, overwrite=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.