[GRASS-SVN] r32299 - grass-addons/gipe/i.eb.h_iter

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 25 10:47:06 EDT 2008


Author: ychemin
Date: 2008-07-25 10:47:06 -0400 (Fri, 25 Jul 2008)
New Revision: 32299

Modified:
   grass-addons/gipe/i.eb.h_iter/fixed_deltat.c
Log:
header file update

Modified: grass-addons/gipe/i.eb.h_iter/fixed_deltat.c
===================================================================
--- grass-addons/gipe/i.eb.h_iter/fixed_deltat.c	2008-07-25 14:29:08 UTC (rev 32298)
+++ grass-addons/gipe/i.eb.h_iter/fixed_deltat.c	2008-07-25 14:47:06 UTC (rev 32299)
@@ -4,7 +4,7 @@
 
 #define PI 3.14159265358979323846 
 
-double fixed_deltat(double u2m, double roh_air,double cp,double dt,double disp,double z0m,double z0h,double tempk,int iteration){
+double fixed_deltat(double u2m, double roh_air,double cp,double dt,double disp,double z0m,double z0h,double tempk,double hu, int iteration){
 	int i;
 	double ublend;
 	double length;
@@ -15,32 +15,18 @@
 	double h_in;
 	double temp1;
 	
-	/* Failsafe all the Log10 */
-	if(disp==100){
-		disp=99.99999;
-	}
-	if(disp==2){
-		disp=1.99999;
-	}
-	if(z0m==0.0){
-		z0m=0.00001;
-	}
-	if(log10(2-disp)-log10(z0m)==0.0){
-		//ublend=u2m*(log10(100-disp)-log10(z0m))/(log10(2-disp)-log10(z0m)+0.001);
-		ublend=u2m*(log(100-disp)-log(z0m))/(log(2-disp)-log(z0m)+0.001);
+	if(log(hu-disp)-log(z0m)==0.0){
+		ublend=u2m*(log(100-disp)-log(z0m))/(log(hu-disp)-log(z0m)+0.001);
 	} else {
-		ublend=u2m*(log(100-disp)-log(z0m))/(log(2-disp)-log(z0m));
-		//ublend=u2m*(log10(100-disp)-log10(z0m))/(log10(2-disp)-log10(z0m));
+		ublend=u2m*(log(100-disp)-log(z0m))/(log(hu-disp)-log(z0m));
 	}
 	psim=0.0;
 	psih=0.0;
 
 	for(i=0;i<iteration;i++){
-		if((log10((100-disp)/z0m)-psim)==0.0){
-			//ustar = 0.41*ublend/(log10((100-disp)/z0m)-psim+0.0001);
+		if((log((100-disp)/z0m)-psim)==0.0){
 			ustar = 0.41*ublend/(log((100-disp)/z0m)-psim+0.0001);
 		} else {
-			//ustar = 0.41*ublend/(log10((100-disp)/z0m)-psim);
 			ustar = 0.41*ublend/(log((100-disp)/z0m)-psim);
 		}
 		if(z0h==0.0){
@@ -49,12 +35,10 @@
 		if(ustar==0.0){
 			ustar=0.00001;
 		}
-		if(((2-disp)/z0h)-psih==0.0){
-			//rah   = (log10((2-disp)/z0h)-psih+0.00001)/(0.41*ustar);
-			rah   = (log((2-disp)/z0h)-psih+0.00001)/(0.41*ustar);
+		if(((hu-disp)/z0h)-psih==0.0){
+			rah   = (log((hu-disp)/z0h)-psih+0.00001)/(0.41*ustar);
 		} else {			
-			//rah   = (log10((2-disp)/z0h)-psih)/(0.41*ustar);
-			rah   = (log((2-disp)/z0h)-psih)/(0.41*ustar);
+			rah   = (log((hu-disp)/z0h)-psih)/(0.41*ustar);
 		}
 		if(rah==0.0){
 			rah=0.00001;
@@ -68,19 +52,15 @@
 			length=-0.00001;
 		}
 		xm    = pow(1.0-16.0*((100-disp)/length),0.25);
-		xh    = pow(1.0-16.0*((2-disp)/length),0.25);
+		xh    = pow(1.0-16.0*((hu-disp)/length),0.25);
 		if((1.0+xm)/2.0==0.0||(1+xm*xm)-2*atan(xm)+0.5*PI==0.0){
-			//psim  = 2.0*log10((1.0+xm+0.00001)/2.0)+log10((1+xm*xm)-2*atan(xm)+0.5*PI+0.00001);
 			psim  = 2.0*log((1.0+xm+0.00001)/2.0)+log((1+xm*xm)-2*atan(xm)+0.5*PI+0.00001);
 		} else {
-			//psim  = 2.0*log10((1.0+xm)/2.0)+log10((1+xm*xm)-2*atan(xm)+0.5*PI);
 			psim  = 2.0*log((1.0+xm)/2.0)+log((1+xm*xm)-2*atan(xm)+0.5*PI);
 		}
 		if((1.0+xh*xh)/2.0==0.0){
-			//psih  = 2.0*log10((1.0+xh*xh+0.00001)/2.0);
 			psih  = 2.0*log((1.0+xh*xh+0.00001)/2.0);
 		} else {
-			//psih  = 2.0*log10((1.0+xh*xh)/2.0);
 			psih  = 2.0*log((1.0+xh*xh)/2.0);
 		}
 	}



More information about the grass-commit mailing list