User Manual for Distributed Hydrological Model: 1K-DHM-event
Version 2.22, Jun 28, 2018
Yasuto TACHIKAWA and Tomohiro TANAKA
Dept. of Civil and Earth Resources Eng., Kyoto University, Kyoto 615-8540, Japantachikawa@hywr.kuciv.kyoto-u.ac.jp

1. Introduction
1K-DHM-event is a distributed hydrologic model based on kinematic wave theory. The
model structure is the same as the 1K-FRM-event; only the discharge-stage relationship isdifferent. 1K-FRM adopts a surface flow momentum equation; 1K-DHM includes a surfacesubsurface flow momentum equation. From version 2.22, a relation between slope and river
channel components are amended so that a river channel component can be included in all thecells with 30 second resolution. The source programs are coded using C++ language andworks under Microsoft windows environment and the Linux environment. All program source
codes and input topography data in the Asian region are provided from the home page of
Hydrology and Water Resources Research Laboratory at Department of Civil and Earth
Resources Engineering, Kyoto University:
http://hywr.kuciv.kyoto-u.ac.jp/products/1K-DHM/1K-DHM.html
The input topography data is generated using HydroSHED 30 second digital elevation modeland flow direction data. Forcing data to drive 1K-DHM-event such as runoff generation or
precipitation is supposed to be hourly gridded data. At first, a method to develop topography
data for 1K-DHM-event is described. Then, by using the developed data, an example ofrainfall-runoff simulation using 1K-DHM-event is demonstrated. Figure 1 shows entire
structure of the coordinate system used for 1K-DHM-event flow routing simulation.

Figure 1: Geographic relation of flow routing simulation area and forcing data grid region.
12. Preparation of Topographic Data for 1K-DHM-event
1) Hydroshed2topo
Hydroshed2topo is a program to generate input topography data for 1K-DHM-event, which is
obtained from 1K-DHM homepage.
2) Input data
The topographic data for a flow routing model 1K-DHM-event is generated by using theHydroSHED (http://hydrosheds.cr.usgs.gov/) 30-second digital elevation and flow direction
data. The DEM and flow direction data with ESRI grid format data for entire Asia (55E,-10S
to 180E, 60N) from HydroSHED were downloaded and they were converted to short integer
2-bite binary data format to reduce the file size. These two files:
as_dem_30s_clipped_55—10-180-60.bin (246MB)
as_dir_30s_clipped_55—10-180-60.bin (246MB)
are obtained from 1K-DHM homepage. These two data are input files for hydroshed2topo.
3) Parameter data
All Necessary topographic input files to run the 1K-DHM-event are created by executing thehydroshed2topo.cc. The program creates additional ESRI ASCII files and those files can beimported to ArcGIS to prepare maps of the study area. First, you need to specify the study
area by editing the parameter data filehydroshed2topo/clipArea.dat
This file is a text data file. The study area is determined as a rectangular region by setting
longitude and latitude as shown in Figure 2.
The first row specifies the number of columns for the study region. The value must be an
integer value.
The second row specifies the number of rows for the study region. The value must be an
integer value.
The third row specifies Longitude (degree) of South West (lower left) corner of the study
area. The value is a real value.
The forth row specifies Latitude (degree) of South West (lower left) corner of the study
area. The value is a real value.

The grid size is supposed to 30 second. The longitude (second) of j-th cell center is set as
follows:
longitude = (int)(SWlon*3600) + 30*j + 15;
latitude = (int)(SWlat*3600) + 30*i + 15;

2

120
60
138
35.5
Figure 2: Setting study area. An example of clipArea.dat.

4) Generation of topographic information for 1K-DHM-event
Compile hydroshed2topo.cc and run hydroshed2topo.exe.
5) Output files
All output files used for the 1K-DHM-event are created in the folder:hydroshed2topo/output
The files generated are below:
 modDem.bin: This is the corrected (pit removed) elevation information of the study area.
The data was written in real 4-byte binary data format.

Figure 3: A sample of modem.bin.
3

flowDir.bin: Flow direction information. The direction convention is shown in Figure 3.
The data format is integer 4-bite binary.

Figure 4: A sample of flowDir.bin.
8

1

7
6

2
3

5

4

Figure 5: Flow direction specified by the integer value.
flowAcc.bin: Flow accumulation information. The data format is integer 4-bite binary.

Figure 6: A sample of flowAcc.bin.
4riverNum.bin: Each river basin is numbered starting from 1 and then each grid cell is
assign a value corresponding to the basin number which the cell is belongs to. The data
format is integer 4-bite binary.

Figure 7: A sample of riverNum.bin.
riverNumList.txt: This is a text file which contains:
Column 1: river basin number of the study area,
Column 2: the basin area (acmulated number of grids).
Column 3: column number starting from 1 (starting from West),
Column 4: row number starting from 1 (starting from South),
Column 5: longitude (second),
Column 6: latitude (second),
Column 7: longitude (degree), andColumn 8: latitude (degree)
If you want to calculate the discharge data only at some selected basins using 1K-DHMevent or 1K-DHM, you can delete all the other basins from this text file and keep only thenecessary basins.

All data begins from the South-West grid and lining to East, then, moving to the North in thenext line, which are typical GrADS data format. Sample GrADS control files are attached inhydroshed2topo to visualize the data.

5

1 5 10 59 497085 129555 138.079 35.9875
2 3 14 59 497205 129555 138.113 35.9875
3 4 16 59 497265 129555 138.129 35.9875
4 4 17 59 497295 129555 138.137 35.9875
5 4 18 59 497325 129555 138.146 35.9875…

Figure 8: An example of riverNumList.txt.

Additional files are also created, which are ESRI ASCII files to be imported to ArcGIS tovisualize the study region:








cutDem.asc: The DEM data for the study region. This is the original data clipped for the
study region.
cutDir.asc: The DIR data for the study region. This is the original data clipped for the
study region.
modDem.asc: The DEM data for the study region. This is the corrected (pit removed)
elevation information of the study area, which corresponds to moDem.bin.
flowDir.asc: The Flow Direction data for the study region, which corresponds toflowDir.bin.
flowAcc.asc: Flow accumulation value information, which corresponds to flowAcc.bin.
riverNum.asc: The river basin numbers of the study area, which corresponds toriverNum.bin.
distance.asc: The distance from the river mouth.

3. Preparation of Forcing Data
It is necessary to create a text file of effective hourly forcing data (spatially distributed lateral
input data to slope and river such as rainfall intensity or runoff generation intensity data). If
the data duration is shorter than simulation time, remaining rainfall is assumed to zero. A partof a sample data file is shown in Figure 9. The rainfall data file name is “rain.dat” and shouldbe placed at
1k-dhm-event/input/rain.dat
The first line of “rain.dat” is Year, Month, Day, Hour, Column Number, and Row Number ofspatially gridded rainfall data. From the next line, rainfall intensity values (mm/hr) are stored
beginning from the North-West grid and lining to East, then, moving to the South in the next
line. Each data is delimited by white space characters (SPACE, TAB, or CR). You can change
the rainfall intensity data for your study purpose.

6

1979 12 1 1 5 6
0.1 0.2 0.3 0.4 0.5
0.6 0.7 0.8 0.9 1.0
1.1 1.2 1.3 1.4 1.5
1.6 1.7 1.8 1.9 2.0
2.1 2.2 2.3 2.4 2.5
2.6 2.7 2.8 2.9 3.0…

Figure 9: Part of rain.dat. The 1st Row is: Year, Month, Day, Hour, Column Number, Row
Number. From the 2nd to 7th Rows, effective rainfall intensities (5 columns and 6 rows) in
mm/hr are stored.

The geographic structure is shown in Figure 10. The rainfall intensity data represents theintensity of each grid center. The time interval of the rainfall intensity must be hour. Figure 11
shows the relation between the rainfall-runoff simulation region and rainfall grid region. For
runoff simulation, the nearest grid of rainfall intensity is selected.

Figure 10: Structure of coordinate of the rainfall grid system.
7

The grid size of forcing data is set in the parameter setting file for 1K-DHM-event. The
grid center of longitude (degree) and latitude (degree) of j-th column and i-th row for input
data are set as follows:
longitude = ROF_WLON + j*Delta_x; // set longitudelatitude = ROF_SLAT + j*Delta_y;// set latitude

Figure 11: Geographic relation of rainfall-runoff simulation area and rainfall grid region.

Rainfall data could be also provided in the binary format with each value being 4-byte
floating number. The rainfall data file name is then “rain.bin” and should be placed at
1k-dhm-event/input/rain.bin
The binary data should be arranged from south to north against the above text format. Rainfall
data format is switched by changing a parameter “Format of rainfall data” to be shown below
to 2.

4. Hydrologic Simulation Using 1K-DHM-event
Figure 11 shows the geographic relation of the rainfall-runoff simulation area and the rainfall
grid region for the example data. The procedures for runoff simulation are as follows:81) Topography data setting: Copy the topographic information files (above mentioned five
files)
from hydroshed2topo/output/ to 1k-dhm-event/topoData/
2) Rainfall data setting: Set the rain data and place rainfall data file at
1k-dhm-event/input/rain.dat. (The file name must be rain.dat.)or
1k-dhm-event/input/rain.bin. (When data is prepared in the binary format.)3) Runoff simulation parameter setting: Edit the runoff simulation parameter file
1k-dhm-event/param-event-ver222.dat
by using any text editor. Delimiter of each data is white space characters.

9

10

scale ratio of topography data. 1 means 3 second, 10 means 30 seconds.

120

Number of columns of the study area

60

Number of rows of the study area

138.0

Longitude (degree) of South West corner of the study area

35.5

Latitude (degree) of South West corner of the study area.

1

Format of rainfall data (1: text, 2: 4-byte binary)

5

Number of columns of the input forcing data

6

Number of rows in the input forcing data

0.1875

Input data grid size of x-direction (degree)

0.1875

Input data grid size of y-direction (degree)

137.8

Longitude of the center of the Southwest corner of input data (degree)

35.325Latitude of the center of the Southwest corner of input data (degree)

4

Simulation duration (days)

600

simulation time step (sec)20

number of spatial divisions

0.65

0.5 < theta <= 1.0

0.5

Manning’s roughness coefficient for slope (m-s unit)

0.0046

Hydraulic conductivity (m/s)

0.3440Depth of capillary and non-capillary soil layers (m)0.2875Depth of capillary soil layers (m)6.3486

Exponent constant of unsaturated hydraulic conductivity (-)

0.03

Manning’s roughness coefficient for river (m-s unit)

0

grid accumulated number to differentiate slope and river (-) (set to zero as
default and set larger number for finer resolution less than around 3s)

500.0

Slope length (m)1000.0Slope width (m)Figure 12: An example of param-event-ver222.dat.
The parameter values to set in param-event-ver222.dat are as follows: From 1st row to 4th row, the parameters of the study region is specified:int Col=120// number of column for study area.
int Row=60// number of row for study area.
double SWLON=138.0// Longitude (degree) of north west corner of the study area.
double SWLAT=35.5// Latitude (degree) of north west corner of the study area.
 From 5th row to 10th row, the parameters of the rainfall data is specified:int ROFdata_type = 1// Format of input rainfall data (1: text, 2: 4-byte binary)
int ROFnum_col = 5// Number of column of input rainfall data10

int ROFnum_row = 6// Number of row of input rainfall data
double Delta_x = 0.1875// Input data grid size of x-direction (degree)
double Delta_y = 0.1875// Input data grid size of y-direction (degree)
double ROF_WLON = 137.75// Longitude of the center of the Southwest corner of// Input data (degree)
double ROF_SLAT = 35.25// Latitude of the center of the Southwest corner of// input data (degree) The 11th row is a parameter to determine the simulation term.
int Ndays = 4// Simulation duration (days)
From 12th row to 14th row, the parameters for the finite difference condition are specified.
Usually, you do not need to change these parameter values.
int Time_Step = 600// Simulation time step (sec)int Nspace = 20// Number of spatial divisions
double Theta = 0.65// weight value 0.5 < theta <= 1.0 From 15th row to 24th row, the parameters for the kinematic wave model are specified.
double Man_slope = 0.5// Manning’s roughness coefficient for slope (m-s)
double Ka = 0.0046// Hydraulic conductivity (m/s)
double Da = 0.3440// Depth of capillary and non-capillary soil layers (m)double Dm = 0.2875// Depth of capillary soil layers (m)double Beta = 6.3486// Exponent constant of unsaturated hydraulic conductivity (-)
double Man_channel = 0.03 // Manning’s roughness coefficient for river (m-s)
int Threshold_basin = 0// Grid accumulated number to differentiate slope and river
double Ls = 500.0// Slope length (m)double Bs = 1000.0// Slope width (m) The 25th row is a parameter to determine the initial condition.
double initialROF = 0.0// Initial runoff height (mm/hr)

4) Rainfall-runoff simulation
Move to the folder “/project/1k-dhm-event” and run“1k-dhm-event.exe”
All runoff simulation results are created in
1k-dhm-event/output
The files created are below:
 dischargeDaily.bin: The file contains the average daily flow (m3/sec).
 dischargeHourly.bin: The file contains the hourly flow (m3/sec).
11dischargeHourlyMaxInDay.bin: The file contains the maximum hourly flow value foreach day (m3/sec).

The data are stored in GRADS binary data format and can be visualized using GRADS(http://www.iges.org /grads/). All data arranges from west to east at the South row, then North
row. GrADS control file:- flowAnalysisGradsDaily.ctl- flowAnalysisGradsHourly.ctl
are attached. A sample program is also attached in ./output:- pointdata-event-ver2.cc
which extracts time series ascii data from the above binary data.

5) Dam model setting
Default model setting is no dam model. If you need to include dam operation in 1K-DHM, thefollowing dam operation is available:
1) Standard operation of Japanese dam reservoirs• Dam inflow I is released when I is smaller than a pre-determined flood discharge Qf ;• Flood control starts and release Qf when inflow discharge I exceeds Qf ;• If dam storage volume S (t ) reaches the effective total storage SSL , all inflow I isreleased to avoid overtopping, where S (t ) = S F (t ) + S S − S P ( S F (t ) is storage volume
stored until time t , S S is initial dam storage volume, and S P is the volume of preliminary
release);According to the above rules, outflow discharge at time t , Q(t ) is summarized as follows;
I (t ) (I (t ) < Qf )Q(t ) =  Qf (I (t ) ≥ Q f and S (t ) < S SL )
 I (t ) (I (t ) ≥ Q and S (t ) ≥ S )fSL2) When dam storage capacity is not considered, outflow discharge at time t , Q(t ) issummarized as follows; I (t ) (I (t ) < Qf )Q(t ) = 
 Qf (I (t ) ≥ Q f )

12

8
0

2

70

67

0.0e0 0.0e0 0.0e0 0.0e0 Seta

1

1

60

59

8.4e2 0.0e0 6.0e6 2.0e7 Amagase

2

1

82

44

1.3e3 0.0e0 1.38e7 4.92e7 Takayama

3

1

95

26

4.5e2 0.0e0 1.54e7 2.38e7 Shorenji

4

1

81

20

3.0e2 0.0e0 6.55e6 1.43e7 Murou

5

1

78

38

1.0e2 0.0e0 9.0e6 1.54e7 Nunome

6

1

23

91

1.5e2 0.0e0 1.6e7 5.8e7 Hiyoshi

Figure 12: An example of a dam configuration file.

Dam operation type and associated parameters are defined in a dam configuration file:- ./input/dam.dat
Detail of the file is as follow:
 1st line:Number of dams
 From 2nd line: Setting of each dam reservoir• 1st column: ID of dam• 2nd column: Type of dam operation (0: Read dam outflow data, 1: Standard operationof Japanese dam reservoirs, 2: When dam storage capacity is not considered)• 3rd and 4th columns: Row and column number of dam cell• 5th column: Dam inflow when dam operation starts• 6th column: Volume of preliminary release [m3]• 7th column: Average dam storage [m3]• 8th column: Effective dam storage [m3]• 9th column: Name of dam
When reading dam outflow data, please set a time series of dam release in the file named:- ./input/ realDamOutflow/Real[Dam Name].dat[Dam Name] must be the same as the 9th column of a dam configuration file. A time series
should be stated day, hour, and outflow [m3/s] at each line.
When you need new type of dam operation, please add dam setting/operation in the following
functions of the source code in C++: setDamGrid: setting the grid of dam location,
 calculateDamOutflow: dam operation,
 setDamInitialState: setting of initial state variables, and setDamParameter: setting of parameter values
13

2
1

38

77

12000 Hodu

2

92

47

1500

IwakuraFigure 12: An example of a reservoir configuration file.
These functions should be set by users depending on a study catchment.
6) Reservoir model setting
Default model setting is no reservoir model. If you need to include reservoirs in 1K-DHM, alinear reservoir model is available. A reservoir configuration file:-./input/reservoir.dat

should include the following information:
 1st line: Number of reservoirs
 From 2nd line: Setting of each dam reservoir• 1st column: ID of dam• 2rd and 3th columns: Row and column number of dam cell• 4th column: A parameter of a linear reservoir model• 5th column: Name of dam7) Compile
If you want to change the source code, compile a modified code using:Linux environment: The executable is created by using the GNU g++ compiler asfollowing command%g++ -o 1k-dhm-event-ver222 1k-dhm-event-ver222.cc cellfunc-event.cc

roffunc-event.cc
For Intel C++ compiler of Linux version%

icc -o 1k-dhm-event-ver222 1k-dhm-event-ver222.cc cellfunc-event.cc

roffunc-event.cc


MS Windows environment: Microsoft Visual Studio 2008 or 2010 with C++ compiler isuseful. You can download a free version of Visual C++ Express Edition 2008 or 2010
from Microsoft web site.
14

The solution file 1k-dhm-event.sln should be created according to the Microsoft Visual Studio touse Visual Studio environment. You can also use the command prompt window of the Microsoft
Visual Studio. In this case, after opening the command prompt window, you can compile theprogram as:% cl 1k-dhm-event-ver222.cc cellfunc-event.cc roffunc-event.cc
For Intel C++ compiler of windows version
c:\> icl 1k-dhm-event-ver222.cc cellfunc-event.cc roffunc-event.cc

3) Output Data Analysis
3.1 Visualization of time and space change of discharge using GRADSGRADS is a free visualization software mainly used by meteorologists. The software works
on Windows and Linux/Unix environment. GRADS is available from http://www.iges.org/grads/.
You can use an example of GRADS control files “flowAnalysisGradsDayly.ctl” and“flowAnalysisGradsHourly.ctl” in “/project/misc/gradsControlFiles”. Please see the detail
information at the web page. Figure 13 is a spatial distribution of discharge at the study region.
3.2 Visualization of time and space change of discharge using makeImage.exe andIrfanView
If you do not have GrADS, you can generate PPM format image files and see it using a free
image viewer IrfanView. The procedure to see the animation of time and space change ofdischarge is as follows:(1) Run the image generation program makeppm.exe, which is downloaded from 1K-DHM
home page. This program reads the GrADS format output hourly discharge data
dischargeHourly.bin and generate PPM format image files under image folder. To run
the program,
1-1) Open the folder “/project/1k-dhm-event”
1-2) Click “makeppm.exe”
1-3) Image files are gerenated under “/project/1k-dhm-event/image/”.
(2) Install IrfanView. This is a very popular free image viewer. Click
misc/irfanview/irview428_setup.exe
The viewer is installed and you will find the icon on your MS-Windows desktop.

15

Figure 13: Spatial view of simulated discharge using GrADS.

(3) Click the IrfanView icon and select [File][Slideshow]. Then, set the location of PPT
image file. You can enjoy the animation.
(4) Another method to view the animation is to select [FIle][Open], select the image folder
and click the first image. Then, select [View][Start/Stop automatic viewing]. You canselect [View][Display option (window mode)] to enlarge the image.
3.3 Time series of discharge data at specific point
The procedures to extract the time series of discharge data at the specific point is as follows:(1) Run the time series extraction program pointdata.exe. This program reads the GRADS
format output hourly discharge data dischargeHourly.bin and generates text format timeseries data under /output. To run the program,
1-1)
1-2)
1-3)

1-4)

Open the folder “1k-dhm-event”.
Click “pointdata.exe”.
You will be asked to input the column and row number to extract the data. To
determine the column and row number, it is useful to see the accumulated
catchment data “/project/hydroshed2topo/output/ESRIBasin.asc to examine thediscarge with large catchment size. The row and column number begins from theNorth West corner starting from 1.
The extracted data is genereated under \1k-dhm-event\output\Col-Rowdischarge.dat. The first column of the data is time count (hour) and thesecondcolumn is discharge (m3/sec).
16

Set image files folder

Set slideshow time interval

Slideshow start!

Figure 14: IrfanView Slideshow setting.

1

0.0882515

20.65377732.2653

4

7.359365

14.48676

20.414

7

25.6387832.4114943.863810

55.3801…

Figure 15: An example of time series discharge data extracted by using pointdata-event.exe.

(2) To draw the hydrograph, you can use Excel or GnuPlot (http://www.gnuplot.info/).
17