Description Usage Arguments Value Author(s) See Also Examples
View source: R/write.river.newNML.R
A new fortran namelist file is created. It contains the two nameslists 'DIMENSIONS' and 'RIVERS'. 'RIVERS', contains the variables 'KRQI' and 'RWQI'. 'KRQI' contains the x- and y-coordinates of the grid cells, in which the rivers enter the sea. 'RWQI' contains the actual inflow data of each river.
1 2 | write.river.newNML(riverInfo, riverData, dOt, year, overwrite = TRUE,
warn = TRUE)
|
riverInfo |
list with grid information |
riverData |
list with river inflow data |
dOt |
character; directory into which the final file should be written |
year |
integer; year to write out |
overwrite |
logical; overwrite 'dOt/filename' it already exists |
warn |
logical; allow/suppress warnings |
file written
Daniel Neumann, daniel.neumann@io-warnemuende.de
write.river.netCDF, 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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | # read a file:
test.mom.monthly <- read.river.mom('files/GER_Dan_Str_Warnow.dat')
# calculate annual means from monthly data
test.mom.annual <- mean.river.mom(test.mom.monthly, to = 'annual')
# 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.newNML(riverInfos$Warnow, test.mom.annual, 'out_dir', 2012, overwrite=FALSE)
## example content of an output file:
# &DIMENSIONS
# EW=0, NS=0, LAYERS=0, NZBND=0, NUBND=0, NVBND=0, NRIVERS=1, NUDAMS=0, NVDAMS=0, NWEIRS=0
# /
# &RIVERS
# KRQI=0, 0, 253, 289, RWQI=0.000000000000000000E+00, 3.53739587431693980
# /
&DIMENSIONS
EW=630, NS=387, LAYERS=25, NZBND=858, NUBND=0, NVBND=0, NRIVERS=8, NUDAMS=0, NVDAMS=0, NWEIRS=0
/
&RIVERS
KRQI=0, 0, 341, 606, 376, 82, 386, 169, 364, 302, 263, 193, 84, 579, 26, 477, 65, 159, RWQI=0.000000000000000000E+00, 522.000000000000000, 100.000000000000000, 450.000000000000000, 90
0.000000000000000, 37.0000000000000000, 48.0000000000000000, 21.0000000000000000, 125.000000000000000
/
TODOs:
- write NRIVERS in DIMENSIONS namelist
- write coordinates (grid cell indices!) and inflow to RIVERS:
--Y,X,VAL
--MONTHLY (m3/s)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.