[GRASS-SVN] r40153 - grass/trunk/raster/r.watershed/ram

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Dec 28 05:18:35 EST 2009


Author: mmetz
Date: 2009-12-28 05:18:35 -0500 (Mon, 28 Dec 2009)
New Revision: 40153

Modified:
   grass/trunk/raster/r.watershed/ram/init_vars.c
   grass/trunk/raster/r.watershed/ram/usage.c
Log:
sync to changes in front r40146

Modified: grass/trunk/raster/r.watershed/ram/init_vars.c
===================================================================
--- grass/trunk/raster/r.watershed/ram/init_vars.c	2009-12-28 10:16:04 UTC (rev 40152)
+++ grass/trunk/raster/r.watershed/ram/init_vars.c	2009-12-28 10:18:35 UTC (rev 40153)
@@ -34,49 +34,52 @@
     c_fac = 5;
     abs_acc = 0;
     ele_scale = 1;
+    for (r = 0; r < argc; r++)
+	G_debug(0, "%s", argv[r]);
+
     for (r = 1; r < argc; r++) {
-	if (sscanf(argv[r], "el=%[^\n]", ele_name) == 1)
+	if (sscanf(argv[r], "elevation=%s", ele_name) == 1)
 	    ele_flag++;
-	else if (sscanf(argv[r], "ac=%[^\n]", wat_name) == 1)
+	else if (sscanf(argv[r], "accumulation=%s", wat_name) == 1)
 	    wat_flag++;
-	else if (sscanf(argv[r], "dr=%[^\n]", asp_name) == 1)
+	else if (sscanf(argv[r], "drainage=%s", asp_name) == 1)
 	    asp_flag++;
-	else if (sscanf(argv[r], "de=%[^\n]", pit_name) == 1)
+	else if (sscanf(argv[r], "depression=%s", pit_name) == 1)
 	    pit_flag++;
-	else if (sscanf(argv[r], "t=%d", &bas_thres) == 1) ;
-	else if (sscanf(argv[r], "ms=%lf", &max_length) == 1) ;
-	else if (sscanf(argv[r], "ba=%[^\n]", bas_name) == 1)
+	else if (sscanf(argv[r], "threshold=%d", &bas_thres) == 1) ;
+	else if (sscanf(argv[r], "max_slope_length=%lf", &max_length) == 1) ;
+	else if (sscanf(argv[r], "basin=%s", bas_name) == 1)
 	    bas_flag++;
-	else if (sscanf(argv[r], "se=%[^\n]", seg_name) == 1)
+	else if (sscanf(argv[r], "stream=%s", seg_name) == 1)
 	    seg_flag++;
-	else if (sscanf(argv[r], "ha=%[^\n]", haf_name) == 1)
+	else if (sscanf(argv[r], "half_basin=%s", haf_name) == 1)
 	    haf_flag++;
-	else if (sscanf(argv[r], "ov=%[^\n]", run_name) == 1)
+	else if (sscanf(argv[r], "flow=%s", run_name) == 1)
 	    run_flag++;
-	else if (sscanf(argv[r], "ar=%[^\n]", arm_name) == 1)
+	else if (sscanf(argv[r], "ar=%s", arm_name) == 1)
 	    arm_flag++;
-	else if (sscanf(argv[r], "di=%[^\n]", dis_name) == 1)
-	    dis_flag++;
+	/* slope length
 	else if (sscanf(argv[r], "sl=%[^\n]", sl_name) == 1)
-	    sl_flag++;
-	else if (sscanf(argv[r], "S=%[^\n]", sg_name) == 1)
+	    sl_flag++; */
+	else if (sscanf(argv[r], "length_slope=%s", ls_name) == 1)
+	    ls_flag++;
+	else if (sscanf(argv[r], "slope_steepness=%s", sg_name) == 1)
 	    sg_flag++;
-	else if (sscanf(argv[r], "LS=%[^\n]", ls_name) == 1)
-	    ls_flag++;
-	else if (sscanf(argv[r], "ob=%[^\n]", ob_name) == 1)
+	else if (sscanf(argv[r], "blocking=%s", ob_name) == 1)
 	    ob_flag++;
-	else if (sscanf(argv[r], "r=%[^\n]", ril_name) == 1) {
+	else if (sscanf(argv[r], "disturbed_land=%s", ril_name) == 1) {
 	    if (sscanf(ril_name, "%lf", &ril_value) == 0) {
 		ril_value = -1.0;
 		ril_flag++;
 	    }
 	}
-	/* else if (sscanf (argv[r], "sd=%[^\n]", dep_name) == 1) dep_flag++; */
+	/* slope deposition
+	else if (sscanf (argv[r], "sd=%[^\n]", dep_name) == 1) dep_flag++; */
 	else if (sscanf(argv[r], "-%d", &sides) == 1) {
 	    if (sides != 4)
 		usage(argv[0]);
 	}
-	else if (sscanf(argv[r], "conv=%d", &c_fac) == 1) ;
+	else if (sscanf(argv[r], "convergence=%d", &c_fac) == 1) ;
 	else if (strcmp(argv[r], "-s") == 0)
 	    mfd = 0;
 	else if (strcmp(argv[r], "-a") == 0)

Modified: grass/trunk/raster/r.watershed/ram/usage.c
===================================================================
--- grass/trunk/raster/r.watershed/ram/usage.c	2009-12-28 10:16:04 UTC (rev 40152)
+++ grass/trunk/raster/r.watershed/ram/usage.c	2009-12-28 10:18:35 UTC (rev 40153)
@@ -6,30 +6,22 @@
 
 void usage(char *me)
 {
-    G_fatal_error(_("USAGE for basin delineation:\n%s -4 el=elevation_map "
-		    "t=swale_threshold [ov=overland_flow_map] [dr=drain_direction_map] "
-		    "[de=depression_map] [ac=accumulation_map] [di=display_map] "
-		    "ba=watershed_basin_map [se=stream_segment_map]\n\nUSAGE for "
-		    "ARMSED FILE creation:\n%s [-4] el=elevation_map t=swale_threshold "
-		    "[ov=overland_flow_map] [dr=drain_direction_map] "
-		    "[de=depression_map] [ac=accumulation_map] [di=display_map] "
-		    "[ba=watershed_basin_map] [se=stream_segment_map] "
-		    "ha=half_basin_map ar=ARMSED_file_name\n\nUSAGE for slope length "
-		    "determination:\n%s [-4] el=elevation_map t=swale_threshold "
-		    "[dr=drain_direction_map] [de=depression_map] "
-		    "[ac=accumulation_map] [di=display_map] [ms=max_slope_length] "
-		    "[ob=overland_blocking_map] [S=slope_steepness_map] "
-		    "LS=length_slope_map [r=rill_erosion_map] "
-		    "[sd=slope_deposition value or map]"), me, me, me);
-    /*
-       G_fatal_error(_("USAGE for basin delineation:\n%s -4 el=elevation_map "
-       "t=swale_threshold [ov=overland_flow_map] [dr=drain_direction_map] "
-       "[de=depression_map] [ac=accumulation_map] [di=display_map] "
-       "ba=watershed_basin_map [se=stream_segment_map]\n\nUSAGE for "
-       "ARMSED FILE creation:\n%s [-4] el=elevation_map t=swale_threshold "
-       "[ov=overland_flow_map] [dr=drain_direction_map] "
-       "[de=depression_map] [ac=accumulation_map] [di=display_map] "
-       "[ba=watershed_basin_map] [se=stream_segment_map] "
-       "ha=half_basin_map ar=ARMSED_file_name"), me, me);
-     */
+    G_fatal_error(_("USAGE for basin delineation:\n%s -4 elevation=elevation_map "
+		    "threshold=swale_threshold [flow=overland_flow_map] "
+		    "[drainage=drain_direction_map] [depression=depression_map] "
+		    "[accumulation=accumulation_map] [basin=watershed_basin_map] "
+		    "[stream=stream_segment_map]\n\n"
+		    "USAGE for slope length determination:\n%s [-4] "
+		    "elevation=elevation_map threshold=swale_threshold "
+		    "[drainage=drain_direction_map] [depression=depression_map] "
+		    "[accumulation=accumulation_map] [max_slope_length=max_slope_length] "
+		    "[blocking=overland_blocking_map] [slope_steepness=slope_steepness_map] "
+		    "length_slope=length_slope_map [disturbed_land=rill_erosion_map] "
+		    "[slope_deposition=slope_deposition value or map]"
+		    "USAGE for ARMSED FILE creation:\n%s [-4] elevation=elevation_map "
+		    "threshold=swale_threshold [flow=overland_flow_map] "
+		    "[drainage=drain_direction_map] [depression=depression_map] "
+		    "[accumulation=accumulation_map] [basin=watershed_basin_map] "
+		    "[stream=stream_segment_map] [half_basin=half_basin_map] "
+		    "ar=ARMSED_file_name\n\n"), me, me, me);
 }



More information about the grass-commit mailing list