[GRASS-SVN] r31613 - in grass-addons/gipe: i.eb.netrad i.eb.rah i.eb.ublend i.eb.ustar i.evapo.PT

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jun 3 00:37:20 EDT 2008


Author: ychemin
Date: 2008-06-03 00:37:20 -0400 (Tue, 03 Jun 2008)
New Revision: 31613

Modified:
   grass-addons/gipe/i.eb.netrad/r_net.c
   grass-addons/gipe/i.eb.rah/rah.c
   grass-addons/gipe/i.eb.ublend/ublend.c
   grass-addons/gipe/i.eb.ustar/ustar.c
   grass-addons/gipe/i.evapo.PT/pt_daily_et.c
Log:
bug fixing

Modified: grass-addons/gipe/i.eb.netrad/r_net.c
===================================================================
--- grass-addons/gipe/i.eb.netrad/r_net.c	2008-06-02 19:23:33 UTC (rev 31612)
+++ grass-addons/gipe/i.eb.netrad/r_net.c	2008-06-03 04:37:20 UTC (rev 31613)
@@ -20,9 +20,9 @@
 // 	printf("**rnet: bbalb = %5.3f\n\tndvi = %5.3f\n\ttempk = %5.3f\n\te0 = %5.3f\n\ttsw = %5.3f\n\tdoy = %f\n\tutc = %5.3f\n\tsunzangle = %5.3f\n\tdtair = %5.3f\n",bbalb,ndvi,tempk,e0,tsw,doy,utc,sunzangle,dtair);
 	
 	// Atmospheric emissivity (Bastiaanssen, 1995)
-	e_atm	=  1.08 * pow(-log(tsw_for_e_atm),0.265) ;
+	e_atm	=  1.08 * pow(-log10(tsw_for_e_atm),0.265) ;
 	// Atmospheric emissivity (Pawan, 2004)
-// 	e_atm	= 0.85 * pow(-log(tsw),0.09);
+// 	e_atm	= 0.85 * pow(-log10(tsw),0.09);
 // 	printf("rnet: e_atm = %5.3f\n",e_atm);
 
 	ds = 1.0 + 0.01672 * sin(2*PI*(doy-93.5)/365);

Modified: grass-addons/gipe/i.eb.rah/rah.c
===================================================================
--- grass-addons/gipe/i.eb.rah/rah.c	2008-06-02 19:23:33 UTC (rev 31612)
+++ grass-addons/gipe/i.eb.rah/rah.c	2008-06-03 04:37:20 UTC (rev 31613)
@@ -6,7 +6,7 @@
 double ra_h(double disp,double z0h,double psih,double ustar){
 	double rah;
 	
-	rah   = (log((2-disp)/z0h)-psih)/(0.41*ustar);
+	rah   = (log10((2-disp)/z0h)-psih)/(0.41*ustar);
 
 	return rah;
 }

Modified: grass-addons/gipe/i.eb.ublend/ublend.c
===================================================================
--- grass-addons/gipe/i.eb.ublend/ublend.c	2008-06-02 19:23:33 UTC (rev 31612)
+++ grass-addons/gipe/i.eb.ublend/ublend.c	2008-06-03 04:37:20 UTC (rev 31613)
@@ -7,7 +7,7 @@
 double u_blend(double u_hmoment, double disp,double hblend,double z0m, double hmoment){
 	double ublend;
 	
-	ublend=u_hmoment*(log(hblend-disp)-log(z0m))/(log(hmoment-disp)-log(z0m));
+	ublend=u_hmoment*(log10(hblend-disp)-log10(z0m))/(log10(hmoment-disp)-log10(z0m));
 
 	return ublend;
 }

Modified: grass-addons/gipe/i.eb.ustar/ustar.c
===================================================================
--- grass-addons/gipe/i.eb.ustar/ustar.c	2008-06-02 19:23:33 UTC (rev 31612)
+++ grass-addons/gipe/i.eb.ustar/ustar.c	2008-06-03 04:37:20 UTC (rev 31613)
@@ -6,7 +6,7 @@
 double u_star(double ublend,double hblend,double disp,double z0m,double psim){
 	double ustar;
 	
-	ustar = 0.41*ublend/(log((hblend-disp)/z0m)-psim);
+	ustar = 0.41*ublend/(log10((hblend-disp)/z0m)-psim);
 
 	return ustar;
 }

Modified: grass-addons/gipe/i.evapo.PT/pt_daily_et.c
===================================================================
--- grass-addons/gipe/i.evapo.PT/pt_daily_et.c	2008-06-02 19:23:33 UTC (rev 31612)
+++ grass-addons/gipe/i.evapo.PT/pt_daily_et.c	2008-06-03 04:37:20 UTC (rev 31613)
@@ -6,18 +6,19 @@
 
 double pt_daily_et(double alpha_pt,double delta_pt,double ghamma_pt,double rnet,double g0,double tempka)
 {
-	double 	result, latentHv;
+	double 	result, latentHv, t_celsius;
 	double	roh_w=1004.15;//mass density of water
 	double	vap_slope_ratio;
 
-	/*Latent Heat of vaporization*/
-	latentHv = (2.501-(0.002361*(tempka-273.15)))*1000000.0;
-
+	/*Latent Heat of vaporization (W/m2/d)*/
+ 	t_celsius = tempka - 273.15 ;
+	latentHv    = 86400/((2.501-0.002361*t_celsius)*pow(10,6));
 	/* Ratio of slope of saturation-vapour pressure Vs Temperature*/
 	/* ghamma_pt = psychrometric constant */
 	vap_slope_ratio = delta_pt / ( delta_pt + ghamma_pt );
 
-	result = (alpha_pt/(roh_w*latentHv)) * vap_slope_ratio * (rnet-g0);
+	/*(Rn-g0)/latentHv returns [-]*/
+	result = (alpha_pt/roh_w) * vap_slope_ratio * (rnet-g0)/latentHv;
 	
 	return result;
 }



More information about the grass-commit mailing list