2.4. Input files
For routing runoff throughout the river network without any lakes, mizuRoute expects several input data depending on how runoff data is provided. For advanced features such as lake, water management, solute transport, simple data assimilation, please refer to xxx for additional input data. This section describe input data required for river routing without those advanced features.
All the input data (except for a fews - gauge meta and spatially constant parameter namelist) is in netCDF (any netCDF formats such as classic, 64-bit offset, CDF5, or netCDF-4).
Basic netCDF requirements (variable, dimension, attributes etc) are discussed below.
Dimension and variable names have default names but can be whatever.
If the default names are not used, the user is required to specify them in the control file. If the default names as specified in the tables are used in the netCDF, there is no need to speciy them in the control file.
2.4.1. River data file (required)
River netCDF data holds river reach-reach topology, reach-hru topology, and river reach and HRU physical parameters.
With minimum topological parameters (downSegId and hruSegId), mizuRoute computes additional river network topological parameters necessary to efficiently navigate the computations through river network from upstream to downstream.
MizuRoute also requires minimum physical parameters of reach and HRU (length and slope for reach and area for HRU).
With minimum physical parameters, mizuRoute compute bottom width and bankful depth for each reach with simple functions and uses default values for the other parameters.
For additional reach physical parameters, please see full list of river physical parameters
The tables below dimensions and variables in the river data netCDF with minimum requirement, and control keys used in the control file to specify the variable/dimension names if the names are not same as the defaults.
Control key |
Type |
default name |
Description |
|---|---|---|---|
|
NetCDF dimension name |
seg |
Dimension name for river reach variables |
|
NetCDF dimension name |
hru |
Dimension name for HRU variables |
Control key |
Type |
default name |
Variable type |
dimension(s) |
unit |
Description |
|---|---|---|---|---|---|---|
|
NetCDF variable name |
segId |
int |
seg |
|
reach ID |
|
NetCDF variable name |
downSegId |
int |
seg |
|
id of the downstream reach |
|
NetCDF variable name |
hruSegId |
int |
hru |
|
id of the reach the HRU flows into |
|
NetCDF variable name |
HRUid |
int |
hru |
|
id of HRU |
|
NetCDF variable name |
length |
real |
seg |
|
reach length |
|
NetCDF variable name |
slope |
real |
seg |
|
reach slope (elevation drop/length) |
|
NetCDF variable name |
area |
real |
hru |
|
HRU area |
Negative or zero (<=0) value for downSegId and hruSegId is reserved for no downstream reach, meaning that such reach or hru does not flow into any reach (i.e., basin outlet or closed HRU). For this reason, segId is required to use positive integer value. Currently no string ID is allowed, but integer type can be either 32bit or 64bit (long integer)
The user has an option to provide all the topological variables from the netCDF, though it is recommended that river network topology is built within mizuRoute instead of computing outside.
To use the topological parameters from the netCDF, make sure that the key <topoNetworkOption> is included in the control file and must be set to 0. The default values is 1 (compute topological parameters internally).
Control key |
Type |
Default |
Description |
|---|---|---|---|
|
int |
|
Options for network topological parameters estimations
|
The channel physical parameters are ideally provided per reach from the netCDF. See full list of river physical parameters for the instruction of how to enable reading option for physical parameters.
2.4.2. Runoff file(s) (required)
There are three cases for spatial configurations of runoff data:
Option 1. runoff is given at each river network HRU
Option 2. runoff is given at each hydrologic model HRU (non-grid)
Option 3. runoff is given at grid
For options 2 and 3, mizuRoute needs to remap runoff at hydrologic model HRU or grid to river network HRU with areal weight averaging. In this case, remapping data is required. See remapping data.
Requirement of control keys for runoff netCDF information depends on the options as bellow.
Option 1 river network HRU mean runoff:
Control key |
Type |
default name |
Description |
|---|---|---|---|
|
NetCDF dimension name |
time |
Dimension name for datetime |
|
NetCDF dimension name |
hru |
Dimension name for river network’s HRU |
Control key |
Type |
default name |
Variable type |
dimension(s) |
unit |
Description |
|---|---|---|---|---|---|---|
|
NetCDF variable name |
time |
real |
time |
[time-unit] since yyy-mm-dd 00:00:00 |
name of time variable |
|
NetCDF variable name |
hru |
int |
hru |
|
name of river network HRU |
|
NetCDF variable name |
runoff |
real |
time, hru |
|
name of river network HRU mean runoff variable |
Option 2 hydrologic model HRU mean runoff:
Control key |
Type |
default name |
Description |
|---|---|---|---|
|
NetCDF dimension name |
time |
Dimension name for datetime |
|
NetCDF dimension name |
hru |
Dimension name for hydrologic model HRU |
Control key |
Type |
default name |
Variable type |
dimension(s) |
unit |
Description |
|---|---|---|---|---|---|---|
|
NetCDF variable name |
time |
real |
time |
|
name of time variable |
|
NetCDF variable name |
hru |
int |
hru |
|
name of hydrologic model HRU |
|
NetCDF variable name |
runoff |
real |
time, hru |
|
name of hydrologic model HRU mean runoff variable |
Option 3 gridded runoff:
Control key |
Type |
default name |
Description |
|---|---|---|---|
|
NetCDF dimension name |
time |
Dimension name for datetime |
|
NetCDF dimension name |
lon |
Dimension name for x (horizontal) direction grid |
|
NetCDF dimension name |
lat |
Dimension name for y (vertical) direction of grid |
Control key |
Type |
default name |
Variable type |
dimension(s) |
unit |
Description |
|---|---|---|---|---|---|---|
|
NetCDF variable name |
time |
real |
time |
[time-unit] since yyy-mm-dd 00:00:00 |
name of time variable |
|
NetCDF variable name |
runoff |
real |
time, lon, lat |
[length-unit]/[time-unit] |
name of gridded runoff variable |
Attributes: Time variable needs two attributes- units and calendar. Four types of calendar are allowed. These are noleap, standard, gregorian, and proleptic_gregorian.
Time unit format is shown in the table. Runoff variable needs units, as shown in the table. m or mm is allowed for length-unit, while s, h or day is allowed for time-unit.
2.4.3. Runoff remapping file (required for runoff input option 2 and 3)
MizuRoute has a capability to remap runoff at different HRU (i.e., hydrologic model HRU - option 2 runoff data) or grid (option 3 runoff data) to HRU defined in river network using areal weighted average. The user is required to provide a mapping file in netCDF. If runoff is provided at each river network HRU (option 1 runoff data) no mapping data is required.
To activate remapping capablilty, the user needs to include the two control keys in the control file:
Control key |
Type |
Default |
Description |
|---|---|---|---|
|
logical |
F |
Logical to indicate runoff needs to be remapped to river network HRU. Set T to activate remapping option |
|
char |
None |
Name of remapping netCDF |
Both runoff input option 3 (vector runoff) and option 3 (gridded runoff) have common dimensions for mapping files.
Control key |
Type |
default name |
Description |
|---|---|---|---|
|
NetCDF dimension name |
polyid |
Dimension corresponding to river network HRU |
|
NetCDF dimension name |
data |
Dimension corresponding to concatnenated overlapping HRU or grid boxes |
However, hydrologic model HRU runoff and gridded runoff requires a different set of remapping variables, as shown in talbes below.
Option 2 hydrologic model HRU mean runoff:
Control key |
Type |
default name |
Variable type |
dimension(s) |
Description of variable |
|---|---|---|---|---|---|
|
NetCDF variable name |
polyid |
int |
polyid |
HRU Id corresponding to river network HRU |
|
NetCDF variable name |
nOverlaps |
int |
polyid |
count of overlapping hydrologic model HRUs per river network HRU |
|
NetCDF variable name |
weight |
real |
data |
areal weight of overlapping hydrologic model HRUs |
|
NetCDF variable name |
overlapPolyId |
int |
data |
HRU Id corresponding to Hydrologic model |
Option 3 gridded runoff:
Control key |
Type |
default name |
Variable type |
dimension(s) |
Description of variable |
|---|---|---|---|---|---|
|
NetCDF variable name |
polyId |
int |
polyid |
HRU Id corresponding to river network HRU |
|
NetCDF variable name |
nOverlaps |
int |
polyid |
count of overlapping grid boxes per river network HRU |
|
NetCDF variable name |
weight |
real |
data |
areal weight of overlapping grid boxes |
|
NetCDF variable name |
i_index |
int |
data |
x or longitudinal direction index of overlapping grid boxes (1 from left) |
|
NetCDF variable name |
j_index |
int |
data |
y or latitudinal direction index of overlapping grid boxes (1 from bottom) |
Creating a mapping is basically GIS intersection of two geometries. The figure below visualizes intersection between runoff grid (option 3) and river network HRU polygons. This example (right bottom) shows river network HRU, ck, has 11 overlapping grid boxes (nOverlaps=11 in a mapping netCDF. see table above) and corresponding weights (i.e., fractions of each overlapped grid boxes to total area of ck) as well as i_index and j_index. In a mapping netCDF, all 1D arrays of weights (and i_index and j_index) from each grid box (or hydrologic model HRU) are combined for a large single 1D array. The order of the arrays from each HRU must match the order of river network HRU
There are a few tools available to create the netCDF with required data:
mizuRoute_remapping (https://github.com/ShervanGharari/mizuRoute_remapping)
2.4.4. Spatially-constant parameter namelist (required)
For convinence purpose, the user can provide a spatially constant routing parameters in a namelist as below. Manning coefficient and channel bottom width can be provided to individual reach through river data netCDF. See Channel physical parameters for instructions on how to provide the channel phsycal parameters for each reach. See river routing schemes in Technical note for meaning of each parameters. However, currently, assignment to IRF routing parameters and hillslope routing parameters to indivisual reaches and HRUs, respectively are not implemented. Therefore, this namelist is required currently.
&HSLOPE
! gamma distribution parameters for hillslope routing
fshape = 2.5 ! shape parameter (>0) [-]
tscale = 86400 ! scale parameter [sec]
/
&IRF_UH
! Unit hydrograph derived from diffusive wave equation
velo = 1.5 ! wave celerity [m/s]
diff = 5000.0 ! diffusivity [m2/s]
/
&KWT
! channel physical parameter
mann_n = 0.01 ! manning coefficient [-]
wscale = 0.001 ! channel width parameter [-]: W=wclae*(Aups)**b where Aups=upstream area, b=0.5
/
2.4.5. Restart file (optional)
By default, mizuRoute initializes channel states as empty when no restart file is provided. To perform a continuous simulation—where a run is stopped and later resumed from its previous endpoint—a restart must be provided (see the table below). A restart file contains channel states from the time step immediately preceding the start of the resumed simulation.
Restart netCDF files are not written by default. To enable restart output, the user must spefiy several control keys listed in the table beflow.
Restart files are named using the convention <case_name>.r.<restart_datetime>.nc, where <restart_datetime> represents the start datetime of the next simulation
(NOT the datetime at which the restart file is written), formatted as yyyy-mm-dd-sssss. The sssss field denotes seconds since midnight, e.g., 43200 second = 12:00:00.
If a user examines the restart netCDf, it should be noticed that state variables in the restart netCDF correspond to the time step immediately preceding <restart_datetime>
For example, in hourly simulation, the file <case_name>.r.1981-01-01-00000.nc should contain the states at 1980-12-31 23:00:00.
Restart netCDF may be used to initialize simulations at arbitary datetime, e.g., warmed-up river states, but are primarily intended for continuous simulations.
The timing of restart file output is controlled by the control key <restart_write> (see the table below).
For periodic restart output (yearly, monthly, or daily), the user may specify the month, day, and hour at which restart files are written.
For example, with yearly output, 2 for <restart_mon>, 4 for <restart_day>, and 11 for <restart_hour>, a restart file are written each year on February 4th at 11:00:00.
For <restart_hour> to take effec, the simulation time step (<dt_qsim>) must evenly divided the specified <restart_hour> in second within a day.
Control key |
Type |
Default |
Description |
|---|---|---|---|
|
char |
|
restart write option (case-insensitive).
|
|
char |
The same as <output_dir> |
Directory where restart netCDFs are output and also restar file to be read is located. |
|
char |
None |
restart datetime in yyyy-mm-dd (hh:mm:ss) format. Effective with |
|
int |
1 |
month used for periodic restart output. Effective with |
|
int |
1 |
day used for periodic restart output. Effective with |
|
int |
0 |
hour used for periodic restart output. Effective with |
|
char |
None |
Name of restart netCDF to be used for initialization. If not specified, simulation start with cold start. |
2.4.6. Water management file (optional)
2.4.7. Gauge data file (optional)
mizuRoute can read gauge meta ascii data. Gauge meta ascii file is in csv format, and should include at least gauge id and corresponding reach id. With gauge metadata provided, a user can output the simulation only at gauge, in addition to at the entire river network.
To read and use gauge metadata, the following control variables need to be specified.
Control key |
Type |
Default |
Description |
|---|---|---|---|
|
char |
None |
name of gage meta csv file including two columns : gauge_id (non-numeric ID is accepted), seg_id |
|
logical |
F |
logical value (T or F) to output history variable at gauged reaches. |
|
int |
30 |
maximum gauge name string length |
In addition to the gauge metadata, gauge discharge data (netCDF) can be read to modify discharge whenever/wherever observed discharge is available.
Control key |
Type |
Default |
Description |
|---|---|---|---|
|
char |
None |
name of gauge discharge netCDF |
The observed discharge data is stored in netCDF and specifications are given in the control files as below.
Control key |
Type |
default name |
Description |
|---|---|---|---|
|
NetCDF dimension name |
time |
Dimension name for time variables |
|
NetCDF dimension name |
site |
Dimension name for site |
Control key |
Type |
default name |
Variable type |
dimension(s) |
Description of variable |
|---|---|---|---|---|---|
|
NetCDF variable name |
flow |
real |
time,site |
Observed flow [m3/s] at gauge |
|
NetCDF variable name |
time |
float |
time |
time variable in a unit of <time_unit> since yyyy-mm-dd hh:mm:ss |
|
NetCDF variable name |
site |
char |
site |
guage site name (character array) |
Currently, direct insertion, the simplest data assimilation, is implemented as an experiment.
Direct insertion can be performed at a list of reaches in the metadata. Two parameters, <QerrTrend> and <ntsQmodStop>, are needed.
<QerrTrend> tells how bias computed at observation time at each reach evolves in the subsequent future <ntsQmodStop> time steps.
The evolution of the bias is computed only at time step when observation get unavailable.
To activate direct insertion of observed discharge into simulated discharge, the following control variables need to be specified.
control variable |
Description |
|---|---|
<qmodOption> |
activation of direct insertion. 0 -> do nothing, 1=> discharge direct insertion |
<ntsQmodStop> |
the number of time steps when flow correction stops |
<QerrTrend> |
temporal discharge error trend. 1->constant, 2->linear, 3->logistic, 4->exponential |