[GRASS-SVN] r62849 - grass/trunk/raster/r.uslek

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 21 08:13:00 PST 2014


Author: neteler
Date: 2014-11-21 08:13:00 -0800 (Fri, 21 Nov 2014)
New Revision: 62849

Modified:
   grass/trunk/raster/r.uslek/prct2tex.c
   grass/trunk/raster/r.uslek/r.uslek.html
   grass/trunk/raster/r.uslek/tex2usle_k.c
Log:
r.uslek: trying to generate a working test case

Modified: grass/trunk/raster/r.uslek/prct2tex.c
===================================================================
--- grass/trunk/raster/r.uslek/prct2tex.c	2014-11-21 15:48:14 UTC (rev 62848)
+++ grass/trunk/raster/r.uslek/prct2tex.c	2014-11-21 16:13:00 UTC (rev 62849)
@@ -1,4 +1,5 @@
-#include<stdio.h>
+#include <stdio.h>
+#include <grass/gis.h>
 
 #define POLYGON_DIMENSION 20
 /* From FAOSOIL CD, after USDA 1951, p209 */
@@ -15,8 +16,8 @@
 			 double t2_y, double t2_z, double t3_x, double t3_y,
 			 double t3_z)
 {
-    /*G_message("in function: sand=%5.3f clay=%5.3f silt=%5.3f",
-				point_x,point_y,point_z); */
+    G_debug(1, "in function: sand=%5.3f clay=%5.3f silt=%5.3f",
+				point_x,point_y,point_z);
     double answer;
     double answer1_x, answer1_y, answer1_z;
     double answer2_x, answer2_y, answer2_z;
@@ -100,7 +101,7 @@
 
 int prct2tex(double sand_input, double clay_input, double silt_input)
 {
-    /*G_message("%5.3f||%5.3f||%5.3f",sand_input,clay_input,silt_input); */
+    G_debug(1, "%5.3f||%5.3f||%5.3f",sand_input,clay_input,silt_input);
     
     /* set up index for soil texture classes */
     int index = 20;
@@ -660,7 +661,7 @@
 	    /* G_message("Silt: index labelled as 11"); */
 	}
     }
-    /* if(index==0){
+    if(index==0){
        G_message("clay");
        } else if (index==1){
        G_message("sandy clay");
@@ -686,6 +687,6 @@
        G_message("silt");
        } else {
        G_message("Unable to allocate class");
-       } */
+       }
     return index;
 }

Modified: grass/trunk/raster/r.uslek/r.uslek.html
===================================================================
--- grass/trunk/raster/r.uslek/r.uslek.html	2014-11-21 15:48:14 UTC (rev 62848)
+++ grass/trunk/raster/r.uslek/r.uslek.html	2014-11-21 16:13:00 UTC (rev 62849)
@@ -12,9 +12,24 @@
 <h2>NOTES</h2>
 <em>r.watershed</em> provides for USLE L, S, LS factors.
 
-<h2>TODO</h2>
+<h2>EXAMPLE</h2>
 
+TBD.
 
+<!--
+# TODO: change to meaningful values
+
+# NC data
+g.region rural_1m -p
+r.mapcalc "sand = 0.30"
+r.mapcalc "clay = 0.15"
+r.mapcalc "silt = 0.52"
+r.mapcalc "organ = 0.03"
+
+r.uslek psand=sand pclay=clay psilt=silt pomat=organ output=usle_k
+r.univar usle_k
+-->
+
 <h2>SEE ALSO</h2>
 
 <em>

Modified: grass/trunk/raster/r.uslek/tex2usle_k.c
===================================================================
--- grass/trunk/raster/r.uslek/tex2usle_k.c	2014-11-21 15:48:14 UTC (rev 62848)
+++ grass/trunk/raster/r.uslek/tex2usle_k.c	2014-11-21 16:13:00 UTC (rev 62849)
@@ -1,4 +1,5 @@
-#include<stdio.h>
+#include <stdio.h>
+#include <grass/gis.h>
 
 /* From FAOSOIL CD, after USDA 1951, p209 */
 
@@ -6,7 +7,7 @@
 {
     double usle_k = 200.0; /* Initial value */
 
-    /*G_message("texture=%i, om=%5.3f",texture, om_in); */
+    G_debug(1, "texture=%i, om=%5.3f",texture, om_in);
     if (om_in < 0.5) {
 	if (texture == 0) /* G_message("clay"); */
 	    usle_k = 0.29;	/*Took max value @0.2 */



More information about the grass-commit mailing list