[GRASS-SVN] r43589 - grass/branches/releasebranch_6_4/raster/r.topmodel

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 21 09:37:59 EDT 2010


Author: neteler
Date: 2010-09-21 13:37:59 +0000 (Tue, 21 Sep 2010)
New Revision: 43589

Modified:
   grass/branches/releasebranch_6_4/raster/r.topmodel/description.html
   grass/branches/releasebranch_6_4/raster/r.topmodel/misc.c
Log:
backport: gisbase isn't needed; TODO: use G_spawn()

Modified: grass/branches/releasebranch_6_4/raster/r.topmodel/description.html
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.topmodel/description.html	2010-09-21 13:30:18 UTC (rev 43588)
+++ grass/branches/releasebranch_6_4/raster/r.topmodel/description.html	2010-09-21 13:37:59 UTC (rev 43589)
@@ -43,12 +43,27 @@
 <p>
 </dl>
 
+
+<h2>REFERENCES</h2>
+
+K. Beven, R. Lamb, P. Quinn, R. Romanowicz, and J. Freer.
+TOPMODEL, in V.P. Singh (Ed.). Computer Models of Watershed Hydrology.
+Water Resources Publications, 1995.
+<P>
+S.C. Liaw, Streamflow simulation using a physically based hydrologic
+model in humid forested watersheds (Dissertation).
+Colorado State University, CO. p163, 1988.
+
+
 <h2>SEE ALSO</h2>
-<em><a href="r.fill.dir.html">r.fill.dir</a></em>,
-<em><a href="r.mapcalc.html">r.mapcalc</a></em>,
-<em><a href="r.topidx.html">r.topidx</a></em>,
-<em><a href="http://geni.ath.cx/r.topmodel.html">How to run r.topmodel</a></em>
+<em>
+<a href="r.fill.dir.html">r.fill.dir</a>,
+<a href="r.mapcalc.html">r.mapcalc</a>,
+<a href="r.topidx.html">r.topidx</a></em>
+<br>
+<a href="http://geni.ath.cx/r.topmodel.html">How to run r.topmodel</a>
 
+
 <h2>AUTHORS</h2>
 Main algorithm sources are rewritten in C based on TMOD9502.FOR.
 <br>
@@ -57,4 +72,5 @@
 GRASS port by <a href=mailto:grass4u gmail com>Huidae Cho</a><br>
 Hydro Laboratory, Kyungpook National University, South Korea
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>

Modified: grass/branches/releasebranch_6_4/raster/r.topmodel/misc.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.topmodel/misc.c	2010-09-21 13:30:18 UTC (rev 43588)
+++ grass/branches/releasebranch_6_4/raster/r.topmodel/misc.c	2010-09-21 13:37:59 UTC (rev 43589)
@@ -15,7 +15,6 @@
 	retval = 0;
     }
 
-
     return retval;
 }
 
@@ -37,8 +36,8 @@
     }
 
     if (hdmap) {
-	sprintf(buf, "\"%s/bin/g.region\" rast=%s --quiet", gisbase, hdmap);
-	G_message("g.region rast=%s ... ", hdmap);
+	sprintf(buf, "g.region rast=%s --quiet", hdmap);
+	G_message("%s ...", buf);
 
 	if (run(buf))
 	    exit(1);
@@ -48,18 +47,15 @@
 
 void depressionless(void)
 {
-    sprintf(buf, "\"%s/bin/r.fill.dir\" "
-	    "input=%s elev=%s dir=%s type=grass --quiet",
-	    gisbase, map.elev, map.fill, map.dir);
-    G_message("r.fill.dir input=%s elev=%s dir=%s type=grass ... ",
-	      map.elev, map.fill, map.dir);
+    sprintf(buf, "r.fill.dir input=%s elev=%s dir=%s type=grass --quiet",
+	    map.elev, map.fill, map.dir);
+    G_message("%s ...", buf);
 
     if (run(buf))
 	exit(1);
 
     map.elev = map.fill;
 
-
     return;
 }
 
@@ -68,17 +64,14 @@
 {
     /* be quiet */
 /*    G_putenv("GRASS_VERBOSE", "0");   how to unset in a cross-platform way afterwards? */
-    sprintf(buf, "\"%s/bin/r.mapcalc\" "
-	    "'%s = if(%s == 0 || isnull(%s), null(), %s)'",
-	    gisbase, map.belev, map.basin, map.basin, map.elev);
+    sprintf(buf, "r.mapcalc \"%s = if(%s == 0 || isnull(%s), null(), %s)\"",
+	    map.belev, map.basin, map.basin, map.elev);
 
-    G_message("r.mapcalc '%s = if(%s == 0 || isnull(%s), null(), %s)'"
-	      " ... ", map.belev, map.basin, map.basin, map.elev);
+    G_message("%s ...", buf);
 
     if (run(buf))
 	exit(1);
 
-
     return;
 }
 
@@ -86,26 +79,22 @@
 void top_index(void)
 {
     if (map.belev) {
-	sprintf(buf, "\"%s/bin/r.topidx\" "
-		"input=%s output=%s --quiet",
-		gisbase, map.belev, map.topidx);
-	G_message("r.topidx input=%s output=%s ... ", map.belev, map.topidx);
+	sprintf(buf, "r.topidx input=%s output=%s --quiet",
+		map.belev, map.topidx);
+	G_message("%s ...", buf);
 
 	if (run(buf))
 	    exit(1);
     }
 
     if (map.topidx) {
-	sprintf(buf, "\"%s/bin/r.stats\" -Anc "
-		"input=%s nsteps=%d > %s",
-		gisbase, map.topidx, misc.nidxclass, file.idxstats);
-	G_message("r.stats -Anc input=%s nsteps=%d > %s ... ",
-		  map.topidx, misc.nidxclass, file.idxstats);
+	sprintf(buf, "r.stats -Anc input=%s nsteps=%d output=\"%s\"",
+		map.topidx, misc.nidxclass, file.idxstats);
+	G_message("%s ...", buf);
 
 	if (run(buf))
 	    exit(1);
     }
 
-
     return;
 }



More information about the grass-commit mailing list