[GRASS-SVN] r32281 - grass-addons/gipe/i.eb.h_SEBAL95

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 25 05:37:47 EDT 2008


Author: ychemin
Date: 2008-07-25 05:37:47 -0400 (Fri, 25 Jul 2008)
New Revision: 32281

Modified:
   grass-addons/gipe/i.eb.h_SEBAL95/functions.h
   grass-addons/gipe/i.eb.h_SEBAL95/psi_h.c
   grass-addons/gipe/i.eb.h_SEBAL95/rah1.c
   grass-addons/gipe/i.eb.h_SEBAL95/rah_0.c
   grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_noz0m.c
   grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_z0m.c
   grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c
Log:
Bug fixing in equations+include variable wind speed height

Modified: grass-addons/gipe/i.eb.h_SEBAL95/functions.h
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/functions.h	2008-07-25 09:33:20 UTC (rev 32280)
+++ grass-addons/gipe/i.eb.h_SEBAL95/functions.h	2008-07-25 09:37:47 UTC (rev 32281)
@@ -30,7 +30,7 @@
 double roh_air_0(double tempk);
 double zom_0(double ndvi, double ndvi_max);
 double U_0(double zom_0, double u_hu, double hu);
-double rah_0(double zom_0, double u_0);
+double rah_0(double zom_0, double u_0, double hu);
 double h_0(double roh_air, double rah, double dtair);
 double dt_air_approx( double temp_k );
 double dt_air_0(double t0_dem, double tempk_water, double tempk_desert);
@@ -40,7 +40,7 @@
 double h1(double roh_air, double rah, double dtair);
 double u_star(double t0_dem,double h,double ustar,double roh_air,double zom,double u_hu,double hu);
 double psi_h(double t0_dem, double h, double U_0, double roh_air);
-double rah1(double psih, double u_star);
+double rah1(double psih, double ustar, double hu);
 
 /* Final outputs */
 double evap_fr(double r_net, double g0, double h);

Modified: grass-addons/gipe/i.eb.h_SEBAL95/psi_h.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/psi_h.c	2008-07-25 09:33:20 UTC (rev 32280)
+++ grass-addons/gipe/i.eb.h_SEBAL95/psi_h.c	2008-07-25 09:37:47 UTC (rev 32281)
@@ -19,7 +19,7 @@
 
 	if(n5_temp < 0.0){
 		n12_mem = pow((1-16*(2/n5_temp)),0.25);
-		n11_mem = (2*log10((1+pow(n12_mem,2))/2));
+		n11_mem = (2*log((1+pow(n12_mem,2))/2));
 	} else {
 		n12_mem = 1.0;
 		n11_mem = -5*2/n5_temp;

Modified: grass-addons/gipe/i.eb.h_SEBAL95/rah1.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/rah1.c	2008-07-25 09:33:20 UTC (rev 32280)
+++ grass-addons/gipe/i.eb.h_SEBAL95/rah1.c	2008-07-25 09:37:47 UTC (rev 32281)
@@ -4,11 +4,11 @@
 
 #define PI 3.1415927
 
-double rah1(double psih, double ustar)
+double rah1(double psih, double ustar, double hu)
 {
 	double result;
 
-	result = (log10(2/0.01)-psih)/(ustar*0.41);
+	result = (log(hu/0.01)-psih)/(ustar*0.41);
 
 	return (result);
 }

Modified: grass-addons/gipe/i.eb.h_SEBAL95/rah_0.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/rah_0.c	2008-07-25 09:33:20 UTC (rev 32280)
+++ grass-addons/gipe/i.eb.h_SEBAL95/rah_0.c	2008-07-25 09:37:47 UTC (rev 32281)
@@ -2,11 +2,11 @@
 #include<math.h>
 #include"functions.h"
 
-double rah_0(double zom_0, double u_0)
+double rah_0(double zom_0, double u_0, double hu)
 {
 	double result;
 
-	result = log10(2/0.01)/(u_0*0.41);
+	result = log(hu/0.01)/(u_0*0.41);
 
 	return (result);
 }

Modified: grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_noz0m.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_noz0m.c	2008-07-25 09:33:20 UTC (rev 32280)
+++ grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_noz0m.c	2008-07-25 09:37:47 UTC (rev 32281)
@@ -48,7 +48,7 @@
 // 	printf("*****************************zom = %5.3f\n",zom0);
 	u_0 		= U_0(zom0, u_hu, hu);
 // 	printf("*****************************u0\n");
-	rah[0] 		= rah_0(zom0, u_0);
+	rah[0] 		= rah_0(zom0, u_0, hu);
 // 	printf("*****************************rah = %5.3f\n",rah[0]);
 	h[0] 		= h_0(roh_air[0], rah[0], dtair[0]);
 // 	printf("*****************************h\n");
@@ -72,7 +72,7 @@
 		/* Where is roh_air[i]? */
 		psih = psi_h(t0_dem,h[ic-1],u_0,roh_air[ic-1]);
 		ustar[ic] = u_star(t0_dem,h[ic-1],u_0,roh_air[ic-1],zom[0],u_hu,hu);
-		rah[ic] = rah1(psih, ustar[ic]);	
+		rah[ic] = rah1(psih, ustar[ic], hu);	
 		/* get desert point values from maps */
 		if(ic==1){
 			h_desert	= rnet_desert - g0_desert;
@@ -86,7 +86,7 @@
 			psih_desert 	= psi_h(t0_dem_desert,h_desert,ustar_desertold,roh_air_desert);
 			ustar_desert	= u_star(t0_dem_desert,h_desert,ustar_desertold,roh_air_desert,zom_desert,u_hu,hu);
 		}
-		rah_desert	= rah1(psih_desert,ustar_desert);
+		rah_desert	= rah1(psih_desert,ustar_desert, hu);
 		dtair_desert 	= dt_air_desert(h_desert, roh_air_desert, rah_desert);
 		/* This should find the new dtair from inversed h equation...*/
 		dtair[ic] 	= dt_air(t0_dem, tempk_water, tempk_desert, dtair_desert);

Modified: grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_z0m.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_z0m.c	2008-07-25 09:33:20 UTC (rev 32280)
+++ grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_z0m.c	2008-07-25 09:37:47 UTC (rev 32281)
@@ -46,7 +46,7 @@
 // 	printf("**rohairdesert = %5.3f\n",roh_air_desert);
 	u_0 		= U_0(zom0, u_hu, hu);
 // 	printf("*****************************u0\n");
-	rah[0] 		= rah_0(zom0, u_0);
+	rah[0] 		= rah_0(zom0, u_0, hu);
 // 	printf("*****************************rah = %5.3f\n",rah[0]);
 	h[0] 		= h_0(roh_air[0], rah[0], dtair[0]);
 // 	printf("*****************************h\n");
@@ -70,7 +70,7 @@
 		/* Where is roh_air[i]? */
 		psih = psi_h(t0_dem,h[ic-1],u_0,roh_air[ic-1]);
 		ustar[ic] = u_star(t0_dem,h[ic-1],u_0,roh_air[ic-1],zom[0],u_hu,hu);
-		rah[ic] = rah1(psih, ustar[ic]);	
+		rah[ic] = rah1(psih, ustar[ic],hu);	
 		/* get desert point values from maps */
 		if(ic==1){
 			h_desert	= rnet_desert - g0_desert;
@@ -84,7 +84,7 @@
 			psih_desert 	= psi_h(t0_dem_desert,h_desert,ustar_desertold,roh_air_desert);
 			ustar_desert	= u_star(t0_dem_desert,h_desert,ustar_desertold,roh_air_desert,zom_desert,u_hu,hu);
 		}
-		rah_desert	= rah1(psih_desert,ustar_desert);
+		rah_desert	= rah1(psih_desert,ustar_desert,hu);
 		dtair_desert 	= dt_air_desert(h_desert, roh_air_desert, rah_desert);
 		/* This should find the new dtair from inversed h equation...*/
 		dtair[ic] 	= dt_air(t0_dem, tempk_water, tempk_desert, dtair_desert);

Modified: grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c	2008-07-25 09:33:20 UTC (rev 32280)
+++ grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c	2008-07-25 09:37:47 UTC (rev 32281)
@@ -7,9 +7,9 @@
 	double a, b, zom;
 	double hv_ndvimax=1.5; /* crop vegetation height (m) */
 	double hv_desert=0.002; /* desert base vegetation height (m) */
-	
-	a = (log10(hv_desert)-((log10(hv_ndvimax/7)-log10(hv_desert))/(ndvi_max-0.02)*0.02));
-	b = (log10(hv_ndvimax/7)-log10(hv_desert))/(ndvi_max-0.02)* ndvi;
+
+	a = (log(hv_desert)-((log(hv_ndvimax/7)-log(hv_desert))/(ndvi_max-0.02)*0.02));
+	b = (log(hv_ndvimax/7)-log(hv_desert))/(ndvi_max-0.02)* ndvi;
 	zom = exp(a+b); 
 	
 //	printf("zom = %5.3f\n", zom);



More information about the grass-commit mailing list