[GRASS-SVN] r31571 - grass-addons/gipe/r.soiltex2prop

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 29 22:18:04 EDT 2008


Author: ychemin
Date: 2008-05-29 22:18:04 -0400 (Thu, 29 May 2008)
New Revision: 31571

Modified:
   grass-addons/gipe/r.soiltex2prop/main.c
   grass-addons/gipe/r.soiltex2prop/prct2hf.c
   grass-addons/gipe/r.soiltex2prop/prct2ksat.c
   grass-addons/gipe/r.soiltex2prop/prct2porosity.c
Log:
bug fixing

Modified: grass-addons/gipe/r.soiltex2prop/main.c
===================================================================
--- grass-addons/gipe/r.soiltex2prop/main.c	2008-05-29 20:58:47 UTC (rev 31570)
+++ grass-addons/gipe/r.soiltex2prop/main.c	2008-05-30 02:18:04 UTC (rev 31571)
@@ -22,9 +22,9 @@
 
 #define POLYGON_DIMENSION 50
 double point_in_triangle(double point_x, double point_y, double point_z, double t1_x, double t1_y, double t1_z, double t2_x, double t2_y, double t2_z, double t3_x, double t3_y, double t3_z);
-int prct2porosity(double sand_input, double clay_input);
-int prct2ksat(double sand_input, double clay_input);
-int prct2hf(double sand_input, double clay_input);
+double prct2porosity(double sand_input, double clay_input);
+double prct2ksat(double sand_input, double clay_input);
+double prct2hf(double sand_input, double clay_input);
 
 int main(int argc, char *argv[])
 {

Modified: grass-addons/gipe/r.soiltex2prop/prct2hf.c
===================================================================
--- grass-addons/gipe/r.soiltex2prop/prct2hf.c	2008-05-29 20:58:47 UTC (rev 31570)
+++ grass-addons/gipe/r.soiltex2prop/prct2hf.c	2008-05-30 02:18:04 UTC (rev 31571)
@@ -11,7 +11,7 @@
 
 // HF
 
-int prct2hf(double sand_input, double clay_input){
+double prct2hf(double sand_input, double clay_input){
 	int i,index;
 	double temp, hf;
 	double silt_input=0.0; 	//Rawls et al (1990)
@@ -23,9 +23,9 @@
 	struct vector cls[POLYGON_DIMENSION] = {0.0};
 	//In case silt is not == 0.0, fill up explicitly
 	for(i=0;i<POLYGON_DIMENSION;i++){
-		cls[0].sand=0.0;
-		cls[0].clay=0.0;
-		cls[0].silt=0.0;
+		cls[i].sand=0.0;
+		cls[i].clay=0.0;
+		cls[i].silt=0.0;
 	}
 	//transform input from [0,1] to [0,100]
 	sand_input *= 100.0;

Modified: grass-addons/gipe/r.soiltex2prop/prct2ksat.c
===================================================================
--- grass-addons/gipe/r.soiltex2prop/prct2ksat.c	2008-05-29 20:58:47 UTC (rev 31570)
+++ grass-addons/gipe/r.soiltex2prop/prct2ksat.c	2008-05-30 02:18:04 UTC (rev 31571)
@@ -11,7 +11,7 @@
 
 // KSAT
 
-int prct2ksat(double sand_input, double clay_input){
+double prct2ksat(double sand_input, double clay_input){
 	int i,index;
 	double temp,ksat;
 	double silt_input=0.0; 	//Rawls et al (1990)
@@ -23,9 +23,9 @@
 	struct vector cls[POLYGON_DIMENSION] = {0.0};
 	//In case silt is not == 0.0, fill up explicitly
 	for(i=0;i<POLYGON_DIMENSION;i++){
-		cls[0].sand=0.0;
-		cls[0].clay=0.0;
-		cls[0].silt=0.0;
+		cls[i].sand=0.0;
+		cls[i].clay=0.0;
+		cls[i].silt=0.0;
 	}
 	//transform input from [0,1] to [0,100]
 	sand_input *= 100.0;

Modified: grass-addons/gipe/r.soiltex2prop/prct2porosity.c
===================================================================
--- grass-addons/gipe/r.soiltex2prop/prct2porosity.c	2008-05-29 20:58:47 UTC (rev 31570)
+++ grass-addons/gipe/r.soiltex2prop/prct2porosity.c	2008-05-30 02:18:04 UTC (rev 31571)
@@ -8,7 +8,7 @@
 	double silt;
 };
 
-int prct2porosity(double sand_input, double clay_input){
+double prct2porosity(double sand_input, double clay_input){
 	int i,index;
 	double temp,porosity;
 	double silt_input=0.0; 	//Rawls et al (1990)
@@ -20,9 +20,9 @@
 	struct vector cls[POLYGON_DIMENSION] = {0.0};
 	//In case silt is not == 0.0, fill up explicitly
 	for(i=0;i<POLYGON_DIMENSION;i++){
-		cls[0].sand=0.0;
-		cls[0].clay=0.0;
-		cls[0].silt=0.0;
+		cls[i].sand=0.0;
+		cls[i].clay=0.0;
+		cls[i].silt=0.0;
 	}
 	//transform input from [0,1] to [0,100]
 	sand_input *= 100.0;



More information about the grass-commit mailing list