瀏覽代碼

Fixed wrong manin_val computation. Added verbose outputs.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@45674 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 14 年之前
父節點
當前提交
74ddeba529
共有 2 個文件被更改,包括 13 次插入8 次删除
  1. 4 4
      raster/simwe/r.sim.water/main.c
  2. 9 4
      raster/simwe/simlib/input.c

+ 4 - 4
raster/simwe/r.sim.water/main.c

@@ -394,7 +394,7 @@ int main(int argc, char *argv[])
 	}
     }
     /* Report the final value of manin_val */
-    G_debug(3, "manin_val is set to: %f\n", manin_val);
+    G_debug(1, "manin_val is set to: %f\n", manin_val);
 
     /* if no infiltration map, then: */
     if (parm.infil->answer == NULL) {
@@ -423,7 +423,7 @@ int main(int argc, char *argv[])
 	}
     }
     /* Report the final value of infil_val */
-    G_debug(3, "infil_val is set to: %f\n", infil_val);
+    G_debug(1, "infil_val is set to: %f\n", infil_val);
 
     /* Recompute timesec from user input in minutes
      * to real timesec in seconds */
@@ -457,14 +457,14 @@ int main(int argc, char *argv[])
 
 
     /* memory allocation for output grids */
-    G_debug(2, "beginning memory allocation for output grids");
+    G_debug(1, "beginning memory allocation for output grids");
 
     gama = G_alloc_matrix(my, mx);
     if (err != NULL)
 	gammas = G_alloc_matrix(my, mx);
     dif = G_alloc_fmatrix(my, mx);
 
-    G_debug(2, "seeding randoms");
+    G_debug(1, "seeding randoms");
     seeds(rand1, rand2);
     grad_check();
     main_loop();

+ 9 - 4
raster/simwe/simlib/input.c

@@ -38,6 +38,7 @@ int input_data(void)
     int if_rain = 0;
 
     G_debug(1, "Running MAR 2011 version, started modifications on 20080211");
+    G_debug(1, "Reading input data");
     
     /* Elevation and gradients are mandatory */
     zz = read_float_raster_map(rows, cols, elevin, 1.0);
@@ -52,7 +53,7 @@ int input_data(void)
     if(manin != NULL) {
     	cchez = read_float_raster_map(rows, cols, manin, 1.0);
      } else if(manin_val >= 0.0) { /* If no value set its set to -999.99 */
-	cchez = create_float_matrix(rows, cols, manin_val * unitconv);
+	cchez = create_float_matrix(rows, cols, manin_val);
     }else{
         G_fatal_error(_("Raster map <%s> not found, and manin_val undefined, choose one to be allowed to process"), manin);
     }
@@ -374,6 +375,8 @@ float ** create_float_matrix(int rows, int cols, float fill_value)
     int col = 0, row = 0;
     float **matrix = NULL;
 
+    G_verbose_message("Creating float matrix with value %g", fill_value);
+
     /* Allocate the float marix */
     matrix = G_alloc_fmatrix(rows, cols);
 
@@ -393,6 +396,8 @@ double ** create_double_matrix(int rows, int cols, double fill_value)
     int col = 0, row = 0;
     double **matrix = NULL;
 
+    G_verbose_message("Creating double matrix with value %g", fill_value);
+
     /* Allocate the float marix */
     matrix = G_alloc_matrix(rows, cols);
 
@@ -414,7 +419,7 @@ float ** read_float_raster_map(int rows, int cols, char *name, float unitconv)
     int col = 0, row = 0, row_rev = 0;
     float **matrix = NULL;
 
-    G_message("Reading float map %s into memory", name);
+    G_verbose_message("Reading float map %s into memory", name);
 
     /* Open raster map */
     fd = Rast_open_old(name, "");
@@ -457,7 +462,7 @@ double ** read_double_raster_map(int rows, int cols, char *name, double unitconv
     int col = 0, row = 0, row_rev;
     double **matrix = NULL;
 
-    G_message("Reading double map %s into memory", name);
+    G_verbose_message("Reading double map %s into memory", name);
 
     /* Open raster map */
     fd = Rast_open_old(name, "");
@@ -489,4 +494,4 @@ double ** read_double_raster_map(int rows, int cols, char *name, double unitconv
     Rast_close(fd);
 
     return matrix;
-}
+}