[GRASS-SVN] r73245 - grass-addons/grass7/imagery/i.rh

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 4 02:03:38 PDT 2018


Author: ychemin
Date: 2018-09-04 02:03:38 -0700 (Tue, 04 Sep 2018)
New Revision: 73245

Modified:
   grass-addons/grass7/imagery/i.rh/main.c
   grass-addons/grass7/imagery/i.rh/rh.c
Log:
fixed typos

Modified: grass-addons/grass7/imagery/i.rh/main.c
===================================================================
--- grass-addons/grass7/imagery/i.rh/main.c	2018-09-04 08:37:38 UTC (rev 73244)
+++ grass-addons/grass7/imagery/i.rh/main.c	2018-09-04 09:03:38 UTC (rev 73245)
@@ -128,7 +128,7 @@
     /* Process pixels */ 
     for (row = 0; row < nrows; row++)
     {
-	CELL d;
+	CELL d, d_rh, d_esat, d_eact;
 	DCELL d_pw;
 	DCELL d_pa;
 	DCELL d_ta;
@@ -193,8 +193,8 @@
 		Rast_set_c_null_value(&outrast1[col], 1);
 	    }
 	    else {
-		d_rh = rh(pw,pa,ta,dem);
-		d_esat = esat(ta);
+		d_rh = rh(d_pw,d_pa,d_ta,d_dem);
+		d_esat = esat(d_ta);
 		d_eact = eact(d_esat,d_rh);
 		if(flag1->answer) d=d_esat;
 		else if(flag2->answer) d=d_eact;

Modified: grass-addons/grass7/imagery/i.rh/rh.c
===================================================================
--- grass-addons/grass7/imagery/i.rh/rh.c	2018-09-04 08:37:38 UTC (rev 73244)
+++ grass-addons/grass7/imagery/i.rh/rh.c	2018-09-04 09:03:38 UTC (rev 73245)
@@ -14,9 +14,9 @@
 	https{//ladsweb.modaps.eosdis.nasa.gov/archive/allData/61/MOD07_L2/
 	*/
 	/*Specific Humidity*/
-	q=0.001*(-0.0762*PW*PW+1.753*PW+12.405);
-	ta=-0.0065*dem+Ta;
-	a=17.2694*ta/(ta+238.3);
+	double q=0.001*(-0.0762*PW*PW+1.753*PW+12.405);
+	double ta=-0.0065*dem+Ta;
+	double a=17.2694*ta/(ta+238.3);
 	return(q*Pa/(380*exp(a)));
 }
 
@@ -25,7 +25,7 @@
 	esat{ saturated vapour pressure
 	tamean{ air temperature daily mean
 	*/
-	return(610.78*exp(17.2694*tamean/(tamean+238.3));
+	return(610.78*exp(17.2694*tamean/(tamean+238.3)));
 }
 double eact(double esat,double rh){
 	/*



More information about the grass-commit mailing list