The Program can code the drainage basin by Pfafstetter coding system (3 levels). Input: acctxt, dirtxt Output: basin0, basin1, basin2, basin3 FAQ How to use the program? 1. You should have the DEM data of the study area 2. Use GIS, get the flow direction and accumulation Ascii file, dirtxt and acctxt, that will be used as input file. Arc: fill dem_map demf Arc: dir = flowdirection ( demf ) Arc: acc = flowaccumulation ( dir ) Arc: gridascii dir dirtxt Arc: gridascii acc acctxt 3. Compile the Priver.f and make the Priver.exe. Run the Priver.exe > f77 Priver.f or ifort Priver.f -o Priver > Priver 4. The program will give the output basin0, basin1, basin2, basin3. 5. If you want to see the results under ArcMap. Arc: asciigrid basin0 wshed0 Arc: asciigrid basin1 wshed1 Arc: asciigrid basin2 wshed2 Arc: asciigrid basin3 wshed3 What's the meaning of output file, basin0, basin1, basin2, basin3? In Basin0, the grid in the river basin is given by "1", otherwise "0" In Basin1, the river basin is divided into 9 basins, coded from 1 to 9 In Basin2, the river basins 1-9 continue to be divided into 81 basins, coded from 11-99. In Basin3, the river basins 11-99 continue to be divided, coded from 111-999, if the basin is too small to be divided, the grid is coded as "0". For example, if river basin '15' can not be divided, all grids in basin'15' are coded as '150'. if the river basin '15' can be divided, then grids in basin'15' are coded as '151' to '159'. When I compile the program, there are a warning message as below, why? Priver.exe : warning LNK4084: total image size 500420608 exceeds max (268435456); image may not run The warning will not affect the result of the program as my experience. There is the warning might because the array size in the program is 5000, when we make a 2-dimension array, the array size is out of max. If you replace '5000' with '1000', then the warning will not occur. So, when the 'ncols' and 'nrows' of your DEM file are less than 5000, please replace '5000' to the suitable value. If I find some problems in the program, how can I contact with the author? Please feel free to contact with me: (TANG, Qiuhong) tangqh@iis.u-tokyo.ac.jp You can use it freely in non-commercial use.Thank you for your cooperation.