[GRASS-SVN] r58322 - grass/trunk/raster/r.topmodel

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 28 08:05:11 PST 2013


Author: hcho
Date: 2013-11-28 08:05:11 -0800 (Thu, 28 Nov 2013)
New Revision: 58322

Modified:
   grass/trunk/raster/r.topmodel/file_io.c
   grass/trunk/raster/r.topmodel/global.h
   grass/trunk/raster/r.topmodel/main.c
   grass/trunk/raster/r.topmodel/r.topmodel.html
   grass/trunk/raster/r.topmodel/topmodel.c
Log:
Renamed qobs to obsflow

Modified: grass/trunk/raster/r.topmodel/file_io.c
===================================================================
--- grass/trunk/raster/r.topmodel/file_io.c	2013-11-27 21:00:51 UTC (rev 58321)
+++ grass/trunk/raster/r.topmodel/file_io.c	2013-11-28 16:05:11 UTC (rev 58322)
@@ -173,9 +173,9 @@
     fclose(fp);
 
     /* Read Qobs file */
-    if (file.qobs) {
-	if ((fp = fopen(file.qobs, "r")) == NULL)
-	    G_fatal_error(_("Unable to open input file <%s>"), file.qobs);
+    if (file.obsflow) {
+	if ((fp = fopen(file.obsflow, "r")) == NULL)
+	    G_fatal_error(_("Unable to open input file <%s>"), file.obsflow);
 
 	misc.Qobs = (double *)G_malloc(input.ntimesteps * sizeof(double));
 
@@ -223,7 +223,7 @@
 	    ltime->tm_year, ltime->tm_mon, ltime->tm_mday,
 	    ltime->tm_hour, ltime->tm_min, ltime->tm_sec);
     fprintf(fp, "#\n");
-    if (file.qobs) {
+    if (file.obsflow) {
 	fprintf(fp, "# %-15s Model efficiency\n", "Em:");
 	fprintf(fp, "# %-15s Peak observed Q\n"
 		"# %77s\n", "Qobs_peak:", "[m^3/timestep]");
@@ -296,7 +296,7 @@
 
     fprintf(fp, "\n");
 
-    if (file.qobs) {
+    if (file.obsflow) {
 	fprintf(fp, "%-16s ", "Em:");
 	if (!Rast_is_d_null_value(&misc.Em))
 	    fprintf(fp, "%10.5lf\n", misc.Em);

Modified: grass/trunk/raster/r.topmodel/global.h
===================================================================
--- grass/trunk/raster/r.topmodel/global.h	2013-11-27 21:00:51 UTC (rev 58321)
+++ grass/trunk/raster/r.topmodel/global.h	2013-11-28 16:05:11 UTC (rev 58322)
@@ -80,7 +80,7 @@
     char *topidxstats;
     char *input;
     char *output;
-    char *qobs;
+    char *obsflow;
 };
 
 /* Miscellaneous TOPMODEL variables */

Modified: grass/trunk/raster/r.topmodel/main.c
===================================================================
--- grass/trunk/raster/r.topmodel/main.c	2013-11-27 21:00:51 UTC (rev 58321)
+++ grass/trunk/raster/r.topmodel/main.c	2013-11-28 16:05:11 UTC (rev 58322)
@@ -30,7 +30,7 @@
 	struct Option *topidxstats;
 	struct Option *input;
 	struct Option *output;
-	struct Option *qobs;
+	struct Option *obsflow;
 	struct Option *timestep;
 	struct Option *topidxclass;
 	struct Option *topidx;
@@ -68,10 +68,10 @@
     params.output = G_define_standard_option(G_OPT_F_OUTPUT);
     params.output->description = _("Name for output file");
 
-    params.qobs = G_define_standard_option(G_OPT_F_INPUT);
-    params.qobs->key = "qobs";
-    params.qobs->description = _("Name of observed flow file");
-    params.qobs->required = NO;
+    params.obsflow = G_define_standard_option(G_OPT_F_INPUT);
+    params.obsflow->key = "obsflow";
+    params.obsflow->description = _("Name of observed flow file");
+    params.obsflow->required = NO;
 
     params.timestep = G_define_option();
     params.timestep->key = "timestep";
@@ -130,7 +130,7 @@
     file.topidxstats = params.topidxstats->answer;
     file.input = params.input->answer;
     file.output = params.output->answer;
-    file.qobs = params.qobs->answer;
+    file.obsflow = params.obsflow->answer;
 
     if (!params.timestep->answer)
 	params.timestep->answer = "0";

Modified: grass/trunk/raster/r.topmodel/r.topmodel.html
===================================================================
--- grass/trunk/raster/r.topmodel/r.topmodel.html	2013-11-27 21:00:51 UTC (rev 58321)
+++ grass/trunk/raster/r.topmodel/r.topmodel.html	2013-11-28 16:05:11 UTC (rev 58322)
@@ -6,7 +6,7 @@
 <h3>Selected Parameters:</h3>
 
 <dl>
-<dt><b>qobs</b></dt>
+<dt><b>obsflow</b></dt>
 <dd>Compare simulated flows with observed flows and calculate the model
 efficiency.
 </dd>

Modified: grass/trunk/raster/r.topmodel/topmodel.c
===================================================================
--- grass/trunk/raster/r.topmodel/topmodel.c	2013-11-27 21:00:51 UTC (rev 58321)
+++ grass/trunk/raster/r.topmodel/topmodel.c	2013-11-28 16:05:11 UTC (rev 58322)
@@ -310,7 +310,7 @@
     }
     misc.Qt_mean /= input.ntimesteps;
 
-    if (file.qobs) {
+    if (file.obsflow) {
 	misc.Em = calculate_efficiency();
 	for (i = 0; i < input.ntimesteps; i++) {
 	    if (!i || misc.Qobs_peak < misc.Qobs[i]) {



More information about the grass-commit mailing list