CE74.55 Modeling of Water Resources Systems
February 26th and 27th, 2011

Distributed rainfall‐runoff model: 1K‐DHM‐event
Demonstration and Project

Yasuto TACHIKAWA
Dept. of Civil and Earth Resources Eng., Kyoto University, Kyoto 615-8540, Japantachikawa@hywr.kuciv.kyoto-u.ac.jp

1. Problem Statement
Through this demonstration, a distributed rainfall-runoff model is constructed using
HydroSHED topography data set. Then, by using the developed model, an example ofrainfall-runoff simulation is presented. The goal of the example is to understand themechanism of hydrologic response at the study area through distributed rainfall-runoff
modeling.

2. Preparation of Rainfall-Runoff Simulation
Please copy the folder “project” in CD to your PC at any folder. The total file size is about
512MB.

3. Preparation of Topographic Information for 1K-DHM-event
1) Input data
The topographic information for a distributed rainfall-runoff model 1K-DHM-event isgenerated by using the HydroSHED (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
input files are included in the folder/project/hydroshed2topo/input/as_dem_30s_clipped_55—10-180-60.bin (246MB)/project/hydroshed2topo/input/as_dir_30s_clipped_55—10-180-60.bin (246MB)
2) Parameter data
First, you need to specify the study area by editing the parameter data file
/project/hydroshed2topo/clipArea.dat
1This is a text data file. The study area is determined as a rectangular region by setting
longitude and latitude as shown in Figure 1.
The first row specifies the number of rows for the study region. The value must be integer.
The second row specifies the number of columns for the study region. The value must be
integer.
The third row specifies Latitude (degree) of North West corner of the study area. The
value must be integer.
The forth row specifies Longitude (degree) of North West corner of the study area. The
value must be integer.

60
60
36
138
Figure 1: Setting study area. An example of clipArea.dat.

3) Generation of topographic information for 1K-DHM-event
Open the folder “/project/hydroshed2topo” and just click“hydroshed2topo.exe”
4) Output files
All output files used for the 1K-DHM are created in the folder:/project/hydroshed2topo/output
The files generated are below:

correctedMed.bin: This is the corrected (pit removed) elevation information of the study
area. The data was written in real 8 –byte binary data format.
down.bin: Flow direction information. The direction convention is shown in Figure 2.
The data format is integer 4-bite binary.

2

8

1

7
6

2
3

5

4

Figure 2: Flow direction information.
basin.bin: Accumulated catchment area information. The data format is integer 4-bitebinary.
riverNumber.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.
riverNumList.txt: This is a text file which contains the river basin numbers of the study
area at Column 1, location information of the outlet of each basin from Column 2 to 5
(row number starting from 1, column number starting from 1, Latitude (second),
Longitude(second), and the basin area at Column 6 (number of grids) as shown in Figure
3. If the user wants to calculate the discharge data only at some selected basins using 1KDHM model, then the user can delete all the other basins from this text file and keep only
the necessary basins.

1 2 11 497145 129585 3
2 2 13 497205 129585 5
3 2 14 497235 129585 2
4 2 16 497295 129585 136
5 2 20 497415 129585 2…

Figure 3: An example of riverNumList.txt.

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

ESRIDEMMed.asc: The DEM data for the study region. This is the corrected (pitremoved) elevation information of the study area, which corresponds tocorrectedMed.bin.
ESRIFlowDIR.asc: The Flow Direction data for the study region, which corresponds todown.bin.
3






ESRIBasin.asc: Accumulated catchment area information, which corresponds tobasin.bin.
ESRIRiverNumber.asc: The river basin numbers of the study area, which corresponds
to riverNumber.bin.
ESRIcutdem.asc: The DEM data for the study region. This is the original data clipped
for the study region.
ESRIcutdir.asc: The DIR data for the study region. This is the original data clipped forthe study region.

4. Preparation of Rainfall Data
It is necessary to create a text file of effective hourly spatially distributed rainfall data. If thedata duration is shorter than simulation time, remaining rainfall is assumed to zero. A part of asample data file is shown in Figure 4. The rainfall data file name is “rain.dat” and should beplaced at/project/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.

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 4: 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 5. The rainfall intensity data represents theintensity of each grid center. The time interval of the rainfall intensity must be hour. Figure 6
shows the relation between the rainfall-runoff simulation region and rainfall grid region. For
runoff simulation, the nearest grid of rainfall intensity is selected.
4

Figure 5: Structure of coordinate of the rainfall grid system.

(Lon=138.5625, Lat=36.075)(Lon=137.8125, Lat=36.075)(001, 006)
(Lon=138, Lat=36)

Clipped from 1 km X 1km SRTM
60 cells
DEM(Study Area )(001, 002)

60 cells

Clipped Rainfall Region(001, 001)
(Lon=137.8125, Lat=35.325)(005 001)(Lon=138.5625, Lat=35.325)

Figure 6: Geographic relation of rainfall-runoff simulation area and rainfall grid region.
55. Rainfall-Runoff Simulation Using 1K-DHM-event
Figure 6 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:
1) Topography data setting: Copy the topographic information files (above mentioned five
files)
from /project/hydroshed2topo/output/ to /project/1k-dhm-event/topoData/
2) Rainfall data setting: Set the rain data and place rainfall data file at/project/1k-dhm-event/input/rain.dat. (The file name must be rain.dat.)
3) Runoff simulation parameter setting: Edit the runoff simulation parameter file
/project/1k-dhm-event/param-event.dat
by using any text editor. Delimiter of each data is white space characters.
60

Number of rows in the clipped elevation file60

Number of columns in the clipped elevation

36

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

138

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

6

Number of rows in the input Rainfall data

5

Number of columns in the input Rainfall data

0.1875

Input data grid size of y-direction (degree)

0.1875

Input data grid size of y-direction (degree)

137.8125

West corner longitude of input data (degree)

35.325South corner latitude of input data (degree)

10

Simulation duration (days)

600

simulation time step (sec)20

number of spatial divisions

0.65

0.5 < theta <= 1.0

11.0

Manning’s roughness coefficient for slope

0.03

Manning’s roughness coefficient for river250

grid accumulated number to differentiate slope and river

0.0

Initial runoff height for kinematic wave model (mm/hr)

Figure 7: An example of param-event.dat.
6

The parameter values to set in param-event.dat are as follows: From 1st row to 4th row, the parameters of the study region is specified:int Row=60// number of row for study area.
int Col=60// number of column for study area.
int NWLAT=36// Latitude (degree) of north west corner of the study area.
int NWLON=138// Longitude (degree) of north west corner of the study area.
 From 5th row to 10th row, the parameters of the rainfall data is specified:int ROFnum_row = 6// Number of row of input rainfall data
int ROFnum_col = 5// Number of column of input rainfall data
double Delta_y = 0.1875// Input data grid size of y-direction (degree)
double Delta_x = 0.1875// Input data grid size of x-direction (degree)
double ROF_WLON = 137.8125 // West corner longitude of input data (degree)
double ROF_SLAT = 35.325 // South corner latitude of input data (degree) The 11th row is a parameter to determine the simulation term.
int Ndays = 10// 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 17th row, the parameters for the kinematic wave model are specified.
double Man_slope = 11.0 // Manning’s roughness coefficient for slope (m-s unit)
double Man_channel = 0.03 // Manning’s roughness coefficient for river (m-s unit)
int Threshold_basin = 250 // grid accumulated number to differentiate slope and river The 16th row is a parameter to determine the initial condition.
double initialROF = 0.0// Initial runoff height (mm/hr)

4) Rainfall-runoff simulation
Open the folder “/project/1k-dhm-event” and just click“1k-dhm-event.exe”
All runoff simulation results are created in/project/1k-dhm-event/output
The files created are below:
7





dischargeDaily.bin: The file contains the average daily flow (m3/sec).
dischargeHourly.bin: The file contains the hourly flow (m3/sec).
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/).
5) Compile
If you want to change the source code, compile a modified code using: MS Windows environment: Microsoft Visual Studio 2008 with C++ compiler is useful.
You can download a free version of Visual C++ Express Edition from Microsoft web site.
 Linux/Unix environment: The executable is created by using the following commandg++ -o 1k-dhm-event.exe 1k-dhm-event.cc cellfunc.cc roffunc.cc

6. Output Data Analysis
6.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 8 is a spatial distribution of discharge at the study region.

Figure 8: Spatial view of simulated
discharge using GRADS.
8

6.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. 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)
1-2)
1-3)

Open the folder “/project/1k-dhm-event”
Click “makeppm.exe”
Image files are gerenated under “/project/1k-dhm-event/image/”.

(2) Install IrfanView. This is a very popular free image viewer. Click/project/misc/irfanview/irview428_setup.exe
The viewer is installed and you will find the icon on your MS-Windows desktop.
(3) Click the IrfanView icon and select [File][Slideshow]. Then, set the location of PPT
image file. You can enjoy the animation.

Set image files folder

Set slideshow time interval

Slideshow start!

Figure 9: IrfanView Slideshow setting.
9(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.
6.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 “/project/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).

(2) To draw the hydrograph, you can use GnuPlot or Excel.
7. Project Tasks
1) Run the 1K-DHM-event model by setting different model parameters. For example,
change the Manning rouness coefficient, and see the change of time and space ofdischarge. Then, discuss why the change happens.
2) Run the 1K-DHM-event model by setting different rainfall data, and see the change oftime and space of discharge. Then, discuss why the change happens.
If you would like to learn more, let’s apply 1K-DHM-event to a different catchment. If you
can use ArcGIS, you can check visually your study area.
Each group is required to submit a project report with maximum 10 pages including
objectives of the project, simulation results, findings, discussion and conclusions.

10