------------------------------------------------------------------ D8-LTD: A path-based method for the determination of nondispersive drainage directions in grid-based digital elevation models ------------------------------------------------------------------ November 28, 2005 Stefano Orlandini Dipartimento di Scienze Agrarie Università degli Studi di Modena e Reggio Emilia Via Kennedy 17, I-42100 Reggio Emilia, Italy Work phone: +39 0522 522048 Fax: +39 0522 522027 E-mail: stefano.orlandini@unimore.it URL: http://www.idrologia.unimore.it/orlandini This "readme" file contains the following sections: 1. The D8-LTD Method 2. Distribution and Copyright 3. The Archive d8-ltd.tar.gz 4. How to Use the Fortran Codes That Implement the D8-LTD Method 5. References 1. The D8-LTD Method -------------------- The D8-LTD method is described in Orlandini et al. (2003). The .pdf file of this paper (file 2002WR001639.pdf) and the Fortran codes that implement the D8-LTD method are provided in the archive d8-ltd.tar.gz described below. 2. Distribution and Copyright ----------------------------- Copyright (C) 2003 Stefano Orlandini This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License version 2, 1991 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. Without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A copy of the full GNU General Public License is available at the address: http://www.gnu.org/copyleft/gpl.html, or from: The Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. If you wish to use or incorporate this program (or parts of it) into other software that does not meet the GNU General Public License conditions contact the author to request permission. Stefano Orlandini Dipartimento di Scienze Agrarie Università degli Studi di Modena e Reggio Emilia Via Kennedy 17, I-42100 Reggio Emilia, Italy Work phone: +39 0522 522048 Fax: +39 0522 522027 E-mail: stefano.orlandini@unimore.it URL: http://www.idrologia.unimore.it/orlandini 3. The Archive d8-ltd.tar.gz ---------------------------- All the material mentioned in this "readme" file is contained in the tar format archive compressed with gzip "d8-ltd.tar.gz". The gzip and tar programs can be obtained as free software on the Web for any operating system. To extract the "d8-ltd" directory from "d8-ltd.tar.gz" use the command lines: gzip -d d8-ltd.tar.gz tar xf d8-ltd.tar Alternatively, with Windows systems, one can use the Winzip program. Fortran codes can be found in "d8-ltd/v8.12". Data related to a real case application can be found in "d8-ltd/liro-30x30". 4. How to Use the Fortran Codes That Implement the D8-LTD Method ---------------------------------------------------------------- The material provided in this package includes: A) Four main programs written in Fortran 90 and related modules/subroutines (directory "v8.12"). B) The input files "hap.in" and "dtm_13.val" for the real case example of the Liro catchment (directory "liro-30x30", see Orlandini et al., 2003). C) Examples of the output files that one may obtain from the Fortran programs and of the related files that can be used for the visualization of grid data in a GIS environment (e.g., ArcView 3.2/8.2). The steps required to run the Liro catchment example are finally summarized. Fortran Programs ---------------- Four main programs written in Fortran 90 are provided to manage the input files, to create a binary database, to incorporate input DEM data in this binary database, to run the D8-LTD method and the related pre/postprocessing steps (see Orlandini et al., 2003, section 2.2), and to export the results from the binary database so as to obtain ASCII files that can be imported into a GIS environment (e.g., ArcView 3.2/8.2) for their visualization and analysis. These programs are: 1) wpar (file wpar.f90) 2) wbb (file wbb.f90) 3) rn (file rn.f90) 4) rbb (file rbb.f90) These programs compile successfully with the following Fortran 90 compilers: a) Sun Forte Fortran 90 Compiler Update 2 b) Compaq Visual Fortran 90 Compiler Version 6.5 c) Lahey/Fujitsu Fortran 95 Compiler Release 5.70c The related command lines are provided in the file "v8.12/compf90". Modules and subroutines associated to each program are those used in the file "v8.12/compf90". Short comments on the operations performed by programs, modules, and subroutines are provided within the .f90 files contained in the directory "v8.12". Input Files ----------- Two input files are provided in the directory "liro-30x30": 1) hap.in 2) dtm_13.val The file "hap.in" contains all the structural and terrain analysis parameters needed to implement the D8-LTD method in real case applications. The programs provided in this package are part of a more comprehensive hydrologic model (the "hap" model) and only part of the parameters included in the file "hap.in" have to be used for the calculation of drainage directions and drainage areas. The program "wpar" reads an original (unformatted) version of "hap.in" and provides a (more) formatted version of this file (see the file "wpar.f90"). The description of each parameter that need to be considered for running the D8-LTD method is given in the file "hap.in". The following parameters must be considered: 1) Grid spacing along the x-direction 2) Grid spacing along the y-direction 3) DEM rectangle size along the x-direction 4) DEM rectangle size along the y-direction 5) Number of cells within the catchment 6) Depit threshold slope 7) Path threshold slope 8) Drainage directions method (LAD:1,LTD:2) 9) D8-LAD/D8-LTD method dampening factor The "depit threshold slope" is the ratio between that quantity used to raise depressed cells and the grid size (see the file "depit.f90"). The "path threshold slope" is the minimum slope assigned to elemental drainage paths when the calculated slope is (for some reason) less than this value. Messages are provided to the user when this filter is applied (see the file "lpf.f90"). The file "dtm_13.val" contains the DEM data of the Liro catchment with grid resolution of 30 m x 30 m. Elevations are expressed in meters above sea level. To allow the program "rn" to run it is essential (1) that the input DEM data consists of cell elevations for all the catchment cells and nodata values for the other cells of the rectangle and (2) that the catchment has a unique cell with lowermost elevation (this cell is identified by the program "rn" as the outlet cell). Files similar to "dtm_13.val" may be generated using a GIS program (e.g., ArcView 3.2/8.2) and by removing (if necessary) the headers. Output Files ------------ Output files are generated by the Fortran programs as described shortly hereafter: 1) The program "wpar" reads the ASCII file "hap.in" and rewrites it in a (more) formatted form. 2) The program "wbb" reads an ASCII file containing the DEM data (e.g. "dtm_13.val") and creates the binary files "basin_b", "basin_i", "qoi", and "ioi". DEM data are incorporated in the files "basin_b"/"basin_i". 3) The program "rn" performs all the steps required to implement the D8-LTD method. Drainage directions and drainage areas are stored in the binary files "basin_b"/"basin_i". Drainage directions can be identified by pointers to the downslope cells. The rule employed in the program "rn" is shown in the following sketch: 3---6---9 | | | j 2---0---8 | | | 1---4---7 i Drainage areas are expressed as numbers of drained cells. 4) The program "rbb" reads the binary files "basin_b"/"basin_i" and produces ASCII DTM files containing the variables of interest (e.g., (14) drainage directions or (17) drainage areas expressed in cells). Short descriptions for the variables that one can export using the program "rbb" are reported in the file "mbbio.f90". For the determination of drainage directions, the program "rbb" can provide pointers that follow the rule employed in ArcView, that is: 32--64--128 | | | j 16---0---1 | | | 8---4---2 i Other rules can be easily incorporated in the file "rbb.f90". From the ASCII DTM files generated by "rbb", grid files that can be imported by a GIS can be easily produced. For example, using ArcView 3.2/8.2 a header must be added and nodata value must be set accordingly. Example ------- To run the D8-LTD method with the DEM data of the Liro catchment one can perform the following steps: 1) Compile the Fortran 90 codes in "d8-ltd/v8.12" using the command lines reported in the file "compf90" (or a Windows-based development environment). 2) Go to the directory "d8-ltd/liro-30x30" and edit the input file "hap.in". In this file the following parameters must be set: Grid spacing along the x-direction = 30.00 Grid spacing along the y-direction = 30.00 DEM rectangle size along the x-direction = 951 DEM rectangle size along the y-direction = 1255 Number of cells within the catchment = 214369 Depit threshold slope = 0.600E-03 Path threshold slope = 0.100E-03 Drainage directions method (LAD:1,LTD:2) = 2 D8-LAD/D8-LTD method dampening factor = 1.00 The first four of them characterize the input DEM data. The "number of cells within the catchment" may be known or may be evaluated using the program "wbb" and subsequently updated in "hap.in", before running "rn". It is remarked here that DEM data used by this package must consider a delimited catchment with a unique outlet cell. This outlet cell is identified by "rn" as the lowermost catchment cell. In case there are two lowermost cells with the same elevation in the input DEM data, the program "rn" provides a message and stop running. In this case one can slightly modify the elevation of one of these two cells manually (of a physically insignificant quantity) to allow a unique lowermost cell. The last four parameters are two threshold values used by "rn" and two parameters that select the use of the D8-LAD or D8-LTD method (see Orlandini et al., 2003). 3) Run the programs "wpar", "wbb", "rn", and "rbb" using the command lines reported in the file "command-lines". The program "rbb" allows one to create an ASCII DTM file containing the flow directions according to the ArcView rule (e.g., flow_dir_D8_LTD.dat). 4) The generated file (e.g., flow_dir_D8_LTD.dat) can be modified to be imported into a GIS (e.g., for ArcView, flow_dir_D8_LTD.asc). The analysis of the results produced by the D8-LTD method can then proceed by using GIS tools or other specific programs. 5. References ------------- Orlandini, S., G. Moretti, M. Franchini, B. Aldighieri, and B. Testa, Path-based methods for the determination of nondispersive drainage directions in grid-based digital elevation models, Water Resour. Res., 39(6), 1144, DOI: 10.1029/2002WR001639, 2003.