Skip to content

Commit 5ddf8ca

Browse files
committed
Add retention limited flow accumulation function RetLimFlow
1 parent d495fcd commit 5ddf8ca

File tree

6 files changed

+597
-0
lines changed

6 files changed

+597
-0
lines changed
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|Win32">
5+
<Configuration>Debug</Configuration>
6+
<Platform>Win32</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Debug|x64">
9+
<Configuration>Debug</Configuration>
10+
<Platform>x64</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Release|Win32">
13+
<Configuration>Release</Configuration>
14+
<Platform>Win32</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|x64">
17+
<Configuration>Release</Configuration>
18+
<Platform>x64</Platform>
19+
</ProjectConfiguration>
20+
</ItemGroup>
21+
<PropertyGroup Label="Globals">
22+
<ProjectGuid>{515B82DC-EFE0-4477-9BEE-83D17B98124D}</ProjectGuid>
23+
<RootNamespace>AreaDinf</RootNamespace>
24+
<Keyword>Win32Proj</Keyword>
25+
</PropertyGroup>
26+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
27+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
28+
<ConfigurationType>Application</ConfigurationType>
29+
<CharacterSet>Unicode</CharacterSet>
30+
<WholeProgramOptimization>true</WholeProgramOptimization>
31+
<PlatformToolset>v140</PlatformToolset>
32+
</PropertyGroup>
33+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
34+
<ConfigurationType>Application</ConfigurationType>
35+
<CharacterSet>Unicode</CharacterSet>
36+
<PlatformToolset>v140</PlatformToolset>
37+
</PropertyGroup>
38+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
39+
<ConfigurationType>Application</ConfigurationType>
40+
<CharacterSet>Unicode</CharacterSet>
41+
<WholeProgramOptimization>true</WholeProgramOptimization>
42+
<PlatformToolset>v140</PlatformToolset>
43+
</PropertyGroup>
44+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
45+
<ConfigurationType>Application</ConfigurationType>
46+
<CharacterSet>Unicode</CharacterSet>
47+
<PlatformToolset>v140</PlatformToolset>
48+
</PropertyGroup>
49+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
50+
<ImportGroup Label="ExtensionSettings">
51+
</ImportGroup>
52+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
53+
<Import Project="..\TauDEM_Build_Configurations\common_release_32.props" />
54+
<Import Project="..\TauDEM_Build_Configurations\win32_library.props" />
55+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
56+
</ImportGroup>
57+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
58+
<Import Project="..\TauDEM_Build_Configurations\common_debug_32.props" />
59+
<Import Project="..\TauDEM_Build_Configurations\win32_library.props" />
60+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61+
</ImportGroup>
62+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
63+
<Import Project="..\TauDEM_Build_Configurations\common_release_64.props" />
64+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+
</ImportGroup>
66+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
67+
<Import Project="..\TauDEM_Build_Configurations\common_debug_64.props" />
68+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
69+
</ImportGroup>
70+
<PropertyGroup Label="UserMacros" />
71+
<PropertyGroup>
72+
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
73+
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
74+
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
75+
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
76+
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
77+
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
78+
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
79+
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
80+
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
81+
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
82+
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
83+
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
84+
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
85+
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
86+
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
87+
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
88+
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
89+
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
90+
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
91+
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
92+
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
93+
</PropertyGroup>
94+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
95+
<ClCompile>
96+
<Optimization>Disabled</Optimization>
97+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
98+
<MinimalRebuild>true</MinimalRebuild>
99+
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
100+
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
101+
<PrecompiledHeader>
102+
</PrecompiledHeader>
103+
</ClCompile>
104+
<Link>
105+
<AdditionalDependencies>msmpi.lib;%(AdditionalDependencies)</AdditionalDependencies>
106+
<GenerateDebugInformation>true</GenerateDebugInformation>
107+
<SubSystem>Console</SubSystem>
108+
<TargetMachine>MachineX86</TargetMachine>
109+
</Link>
110+
</ItemDefinitionGroup>
111+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
112+
<Midl>
113+
<TargetEnvironment>X64</TargetEnvironment>
114+
</Midl>
115+
<ClCompile>
116+
<Optimization>Disabled</Optimization>
117+
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
118+
<MinimalRebuild>true</MinimalRebuild>
119+
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
120+
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
121+
<PrecompiledHeader>
122+
</PrecompiledHeader>
123+
</ClCompile>
124+
<Link>
125+
<AdditionalDependencies>gdal_i.lib;msmpi.lib;%(AdditionalDependencies)</AdditionalDependencies>
126+
<GenerateDebugInformation>true</GenerateDebugInformation>
127+
<SubSystem>Console</SubSystem>
128+
<TargetMachine>MachineX64</TargetMachine>
129+
</Link>
130+
</ItemDefinitionGroup>
131+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
132+
<ClCompile>
133+
<Optimization>MaxSpeed</Optimization>
134+
<IntrinsicFunctions>true</IntrinsicFunctions>
135+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
136+
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
137+
<FunctionLevelLinking>true</FunctionLevelLinking>
138+
<PrecompiledHeader>
139+
</PrecompiledHeader>
140+
</ClCompile>
141+
<Link>
142+
<AdditionalDependencies>msmpi.lib;%(AdditionalDependencies)</AdditionalDependencies>
143+
<GenerateDebugInformation>true</GenerateDebugInformation>
144+
<SubSystem>Console</SubSystem>
145+
<OptimizeReferences>true</OptimizeReferences>
146+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
147+
<TargetMachine>MachineX86</TargetMachine>
148+
</Link>
149+
</ItemDefinitionGroup>
150+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
151+
<Midl>
152+
<TargetEnvironment>X64</TargetEnvironment>
153+
</Midl>
154+
<ClCompile>
155+
<Optimization>MaxSpeed</Optimization>
156+
<IntrinsicFunctions>true</IntrinsicFunctions>
157+
<PreprocessorDefinitions>WIN32;_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
158+
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
159+
<FunctionLevelLinking>true</FunctionLevelLinking>
160+
<PrecompiledHeader>
161+
</PrecompiledHeader>
162+
</ClCompile>
163+
<Link>
164+
<AdditionalDependencies>gdal_i.lib;msmpi.lib;%(AdditionalDependencies)</AdditionalDependencies>
165+
<GenerateDebugInformation>true</GenerateDebugInformation>
166+
<SubSystem>Console</SubSystem>
167+
<OptimizeReferences>true</OptimizeReferences>
168+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
169+
<TargetMachine>MachineX64</TargetMachine>
170+
</Link>
171+
</ItemDefinitionGroup>
172+
<ItemGroup>
173+
<ClCompile Include="..\..\src\commonLib.cpp" />
174+
<ClCompile Include="..\..\src\RetlimFlow.cpp" />
175+
<ClCompile Include="..\..\src\RetLimFlowmn.cpp" />
176+
<ClCompile Include="..\..\src\tiffIO.cpp" />
177+
</ItemGroup>
178+
<ItemGroup>
179+
<ResourceCompile Include="..\TauDEM.rc" />
180+
</ItemGroup>
181+
<ItemGroup>
182+
<None Include="ClassDiagram1.cd" />
183+
</ItemGroup>
184+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
185+
<ImportGroup Label="ExtensionTargets">
186+
</ImportGroup>
187+
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<ClCompile Include="..\..\src\commonLib.cpp">
5+
<Filter>Common</Filter>
6+
</ClCompile>
7+
<ClCompile Include="..\..\src\tiffIO.cpp">
8+
<Filter>Common</Filter>
9+
</ClCompile>
10+
</ItemGroup>
11+
<ItemGroup>
12+
<ResourceCompile Include="..\TauDEM.rc" />
13+
</ItemGroup>
14+
<ItemGroup>
15+
<None Include="ClassDiagram1.cd" />
16+
</ItemGroup>
17+
<ItemGroup>
18+
<Filter Include="Common">
19+
<UniqueIdentifier>{96b3a526-e946-4042-b9cf-f2a72ff1f772}</UniqueIdentifier>
20+
</Filter>
21+
</ItemGroup>
22+
</Project>

Taudem5PCVS2015/Taudem5PC.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EditRaster", "EditRaster\Ed
7373
EndProject
7474
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SetRegion", "SetRegion\SetRegion.vcxproj", "{F98C3328-A5F2-4B02-8E94-D9051D8D834E}"
7575
EndProject
76+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RetLimFlow", "RetLimFlow\RetLimFlow.vcxproj", "{515B82DC-EFE0-4477-9BEE-83D17B98124D}"
77+
EndProject
7678
Global
7779
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7880
Debug|Itanium = Debug|Itanium
@@ -422,6 +424,16 @@ Global
422424
{F98C3328-A5F2-4B02-8E94-D9051D8D834E}.Release|Win32.Build.0 = Release|Win32
423425
{F98C3328-A5F2-4B02-8E94-D9051D8D834E}.Release|x64.ActiveCfg = Release|x64
424426
{F98C3328-A5F2-4B02-8E94-D9051D8D834E}.Release|x64.Build.0 = Release|x64
427+
{515B82DC-EFE0-4477-9BEE-83D17B98124D}.Debug|Itanium.ActiveCfg = Debug|Win32
428+
{515B82DC-EFE0-4477-9BEE-83D17B98124D}.Debug|Win32.ActiveCfg = Debug|Win32
429+
{515B82DC-EFE0-4477-9BEE-83D17B98124D}.Debug|Win32.Build.0 = Debug|Win32
430+
{515B82DC-EFE0-4477-9BEE-83D17B98124D}.Debug|x64.ActiveCfg = Debug|x64
431+
{515B82DC-EFE0-4477-9BEE-83D17B98124D}.Debug|x64.Build.0 = Debug|x64
432+
{515B82DC-EFE0-4477-9BEE-83D17B98124D}.Release|Itanium.ActiveCfg = Release|Win32
433+
{515B82DC-EFE0-4477-9BEE-83D17B98124D}.Release|Win32.ActiveCfg = Release|Win32
434+
{515B82DC-EFE0-4477-9BEE-83D17B98124D}.Release|Win32.Build.0 = Release|Win32
435+
{515B82DC-EFE0-4477-9BEE-83D17B98124D}.Release|x64.ActiveCfg = Release|x64
436+
{515B82DC-EFE0-4477-9BEE-83D17B98124D}.Release|x64.Build.0 = Release|x64
425437
EndGlobalSection
426438
GlobalSection(SolutionProperties) = preSolution
427439
HideSolutionNode = FALSE

src/RetLimFlowmn.cpp

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
/* Retention Limited Flow main program to compute retention limited Flow based on
2+
D-infinity flow model.
3+
4+
David Tarboton and Group
5+
Utah State University
6+
Febuary 24, 2013
7+
8+
*/
9+
10+
/* Copyright (C) 2013 David Tarboton, Utah State University
11+
12+
This program is free software; you can redistribute it and/or
13+
modify it under the terms of the GNU General Public License
14+
version 2, 1991 as published by the Free Software Foundation.
15+
16+
This program is distributed in the hope that it will be useful,
17+
but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19+
GNU General Public License for more details.
20+
21+
A copy of the full GNU General Public License is included in file
22+
gpl.html. This is also available at:
23+
http://www.gnu.org/copyleft/gpl.html
24+
or from:
25+
The Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26+
Boston, MA 02111-1307, USA.
27+
28+
If you wish to use or incorporate this program (or parts of it) into
29+
other software that does not meet the GNU General Public License
30+
conditions contact the author to request permission.
31+
David G. Tarboton
32+
Utah State University
33+
8200 Old Main Hill
34+
Logan, UT 84322-8200
35+
USA
36+
http://www.engineering.usu.edu/dtarb/
37+
38+
*/
39+
40+
// This software is distributed from http://hydrology.usu.edu/taudem/
41+
42+
43+
44+
#include <time.h>
45+
#include <string.h>
46+
#include <stdio.h>
47+
#include <stdlib.h>
48+
#include "commonLib.h"
49+
#include "retlimro.h"
50+
51+
int main(int argc,char **argv)
52+
{
53+
char angfile[MAXLN],wgfile[MAXLN],rcfile[MAXLN],qrlfile[MAXLN];
54+
int err,i;
55+
56+
if(argc < 2)
57+
{
58+
printf("Error: To run this program, use either the Simple Usage option or\n");
59+
printf("the Usage with Specific file names option\n");
60+
goto errexit;
61+
}
62+
63+
else if(argc > 2)
64+
{
65+
i = 1;
66+
printf("You are running %s with the Specific File Names Usage option.\n", argv[0]);
67+
}
68+
else {
69+
i = 2;
70+
printf("You are running %s with the Simple Usage option.\n", argv[0]);
71+
}
72+
while(argc > i)
73+
{
74+
if(strcmp(argv[i],"-ang")==0)
75+
{
76+
i++;
77+
if(argc > i)
78+
{
79+
strcpy(angfile,argv[i]);
80+
i++;
81+
}
82+
else goto errexit;
83+
}
84+
else if(strcmp(argv[i],"-wg")==0)
85+
{
86+
i++;
87+
if(argc > i)
88+
{
89+
strcpy(wgfile,argv[i]);
90+
i++;
91+
}
92+
else goto errexit;
93+
}
94+
else if(strcmp(argv[i],"-rc")==0)
95+
{
96+
i++;
97+
if(argc > i)
98+
{
99+
strcpy(rcfile,argv[i]);
100+
i++;
101+
}
102+
else goto errexit;
103+
}
104+
else if(strcmp(argv[i],"-qrl")==0)
105+
{
106+
i++;
107+
if(argc > i)
108+
{
109+
strcpy(qrlfile,argv[i]);
110+
i++;
111+
}
112+
else goto errexit;
113+
}
114+
else
115+
{
116+
goto errexit;
117+
}
118+
}
119+
if( argc == 2) {
120+
nameadd(angfile,argv[1],"ang");
121+
nameadd(rcfile,argv[1],"rc");
122+
nameadd(qrlfile,argv[1],"qrl");
123+
nameadd(wgfile,argv[1],"wg");
124+
}
125+
if(err=retlimro(angfile, wgfile, rcfile, qrlfile) != 0)
126+
printf("RetlimFlow error %d\n",err);
127+
128+
return 0;
129+
130+
errexit:
131+
printf("Simple Usage:\n %s <basefilename>\n",argv[0]);
132+
printf("Usage with specific file names:\n %s -ang <angfile>",argv[0]);
133+
printf("-rc <rcfile> -wg <wgfile> -qrl <qrlfile>\n");
134+
printf("<basefilename> is the name of the raw digital elevation model\n");
135+
printf("<angfile> is the D-infinity flow direction input file.\n");
136+
printf("<rcfile> retention capacity file.\n");
137+
printf("<wgfile> is the input weight at each grid cell.\n");
138+
printf("<qrlfile> is retention limited runoff that is output.\n");
139+
printf("With simple use the following are appended to the file names\n");
140+
printf("before the files are opened:\n");
141+
printf("ang D-infinity flow direction input file\n");
142+
printf("rc retention capacity (input)\n");
143+
printf("wg weight grid (input)\n");
144+
printf("qrl retention limited runoff (output)\n");
145+
exit(0);
146+
}

0 commit comments

Comments
 (0)