[GRASS-SVN] r32353 - grass-addons/gipe/i.eb.h_SEBAL95
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 28 19:39:56 EDT 2008
Author: ychemin
Date: 2008-07-28 19:39:54 -0400 (Mon, 28 Jul 2008)
New Revision: 32353
Modified:
grass-addons/gipe/i.eb.h_SEBAL95/main.c
grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_noz0m.c
grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c
Log:
Bugfixing
Modified: grass-addons/gipe/i.eb.h_SEBAL95/main.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/main.c 2008-07-28 22:22:28 UTC (rev 32352)
+++ grass-addons/gipe/i.eb.h_SEBAL95/main.c 2008-07-28 23:39:54 UTC (rev 32353)
@@ -98,7 +98,7 @@
/* Define different options */
input_T = G_define_standard_option(G_OPT_R_INPUT);
- input_T->key = "T";
+ input_T->key = "tempk";
input_T->description = _("Name of Surface Skin Temperature input map [K]");
input_dT = G_define_standard_option(G_OPT_R_INPUT);
@@ -412,7 +412,7 @@
//d_ndvi = ((DCELL *) inrast_ndvi)[col];
if(G_is_d_null_value(&d_ndvi)){
/* do nothing */
- } else if ((d_ndvi)>d_ndvi_max&&(d_ndvi)<0.98){
+ } else if ((d_ndvi)>d_ndvi_max&&(d_ndvi)<0.999){
d_ndvi_max = d_ndvi;
}
}
@@ -1110,6 +1110,7 @@
d_dT = -1.0;
d_dT_dry = -1.0;
}
+// printf("iteration=%i\nd_tempk_wet=%f\nd_tempk_dry=%f\nd_t0dem=%f\nd_tempk=%f\nd_z0m=%f\nd_dT=%f\nd_dem=%f\nd_Rn_dry=%f\nd_g0_dry=%f\nd_t0dem_dry=%f\nd_u_hu=%f\nd_hu=%f\nd_dem_dry=%f\nd_dT_dry=%f\n",iteration,d_tempk_wet,d_tempk_dry,d_t0dem,d_tempk,d_z0m,d_dT,d_dem,d_Rn_dry,d_g0_dry,d_t0dem_dry,d_u_hu,d_hu,d_dem_dry,d_dT_dry);
d = sensi_h_z0m(iteration,d_tempk_wet,d_tempk_dry,d_t0dem,d_tempk,d_z0m,d_dT,d_dem,d_Rn_dry,d_g0_dry,d_t0dem_dry,d_u_hu,d_hu,d_dem_dry,d_dT_dry);
} else {
if(input_dT->answer){
@@ -1120,7 +1121,24 @@
d_dT = -1.0;
d_dT_dry = -1.0;
}
- d = sensi_h_noz0m(iteration,d_tempk_wet,d_tempk_dry,d_t0dem,d_tempk,d_dT,d_ndvi,d_ndvi_max,d_dem,d_Rn_dry,d_g0_dry,d_t0dem_dry,d_u_hu,d_hu,d_dem_dry,d_dT_dry);
+// printf("***************\n");
+// printf("iteration=%i\nd_tempk_wet=%f\nd_tempk_dry=%f\nd_t0dem=%f\nd_tempk=%f\nd_dT=%f\nd_ndvi=%f\nd_ndvi_max=%f\nd_dem=%f\nd_Rn_dry=%f\nd_g0_dry=%f\nd_t0dem_dry=%f\nd_u_hu=%f\nd_hu=%f\nd_dem_dry=%f\nd_dT_dry=%f\n",iteration,d_tempk_wet,d_tempk_dry,d_t0dem,d_tempk,d_dT,d_ndvi,d_ndvi_max,d_dem,d_Rn_dry,d_g0_dry,d_t0dem_dry,d_u_hu,d_hu,d_dem_dry,d_dT_dry);
+ d = sensi_h_noz0m(iteration,
+ d_tempk_wet,
+ d_tempk_dry,
+ d_t0dem,
+ d_tempk,
+ d_dT,
+ d_ndvi,
+ d_ndvi_max,
+ d_dem,
+ d_Rn_dry,
+ d_g0_dry,
+ d_t0dem_dry,
+ d_u_hu,
+ d_hu,
+ d_dem_dry,
+ d_dT_dry);
}
// G_message(" d_h0=%5.3f",d);
if (zero->answer && d<0.0){
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-28 22:22:28 UTC (rev 32352)
+++ grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_noz0m.c 2008-07-28 23:39:54 UTC (rev 32353)
@@ -37,35 +37,47 @@
}
if(t0_dem<250.0)
t0_dem=250.0;
-// printf("*****************************dtair = %5.3f\n",dtair[0]);
roh_air[0] = roh_air_0(tempk);
-// printf("*****************************rohair=%5.3f\n",roh_air[0]);
+ //printf("*****************************rohair=%5.3f\n",roh_air[0]);
roh_air_desert = roh_air_0(tempk_desert);
-// printf("**rohairdesert = %5.3f\n",roh_air_desert);
+ //printf("**rohairdesert = %5.3f\n",roh_air_desert);
zom0 = zom_0(ndvi, ndvi_max);
-// printf("*****************************zom = %5.3f\n",zom0);
+ //printf("*****************************zom = %5.3f\n",zom0);
u_0 = U_0(zom0, u_hu, hu);
-// printf("*****************************u0\n");
+ //printf("*****************************u0 = %5.3f\n",u_0);
rah[0] = rah_0(zom0, u_hu, hu);
-// printf("*****************************rah = %5.3f\n",rah[0]);
+ //printf("*****************************rah = %5.3f\n",rah[0]);
+ h_desert= rnet_desert - g0_desert;
+ //printf("*****************************h_desert = %5.3f\n",h_desert);
if(dtair_desert < 0.0){
- h_desert= rnet_desert - g0_desert;
zom_desert= 0.002;
+ //printf("*****************************zom_desert = %5.3f\n",zom_desert);
ustar_desert= u_star(t0_dem_desert,h_desert,u_0,roh_air_desert,zom_desert,u_hu,hu);
- psih_desert= psi_h(t0_dem_desert,h_desert,ustar_desert,roh_air_desert,hu);
- psim_desert= psi_m(t0_dem_desert,h_desert,ustar_desert,roh_air_desert,hu);
- rah_desert = rah1(zom_desert,psih_desert,psim_desert,ustar_desert);
-// printf("*****************************rah_desert = %5.3f\n",rah_desert);
+
+ //psih_desert= psi_h(t0_dem_desert,h_desert,ustar_desert,roh_air_desert,hu);
+ //printf("*****************************psih_desert = %5.3f\n",psih_desert);
+ //psim_desert= psi_m(t0_dem_desert,h_desert,ustar_desert,roh_air_desert,hu);
+ //printf("*****************************psim_desert = %5.3f\n",psim_desert);
+ //rah_desert= rah1(zom_desert,psih_desert,psim_desert,ustar_desert);
+ rah_desert= rah_0(zom_desert,u_hu,hu);
+ //printf("*****************************rah_desert = %5.3f\n",rah_desert);
dtair_desert = dt_air_desert(h_desert, roh_air_desert, rah_desert);
+ //printf("*****************************dtair_desert = %5.3f\n",dtair_desert);
}
if(dtair0 < 0.0){
dtair[0] = dt_air(t0_dem,tempk_water,tempk_desert,dtair_desert);
+ if(dtair[0]<0.0)
+ dtair[0]=0.0;
+ //printf("*****************************dtair[0] = %5.3f\n",dtair[0]);
} else {
dtair[0] = dtair0;
}
h[0] = h_0(roh_air[0], rah[0], dtair[0]);
// printf("*****************************h\n");
if(debug==1){
+ printf("h_desert = %5.3f W/m2\n", h_desert);
+ printf("rah_desert = %5.3f s/m\n", rah_desert);
+ printf("dtair_desert = %5.3f K\n", dtair_desert);
printf("dtair[0] = %5.3f K\n", dtair[0]);
printf("roh_air[0] = %5.3f kg/m3\n", roh_air[0]);
printf("roh_air_desert0 = %5.3f kg/m3\n", roh_air_desert);
@@ -94,7 +106,7 @@
ustar_desertold = ustar_desert;
ustar_desert = u_star(t0_dem_desert,h_desert,ustar_desertold,roh_air_desert,zom_desert,u_hu,hu);
psih_desert = psi_h(t0_dem_desert,h_desert,ustar_desertold,roh_air_desert,hu);
- psim_desert = psi_m(t0_dem_desert,h_desert,ustar_desert,roh_air_desert,hu);
+ psim_desert = psi_m(t0_dem_desert,h_desert,ustar_desertold,roh_air_desert,hu);
rah_desert = rah1(zom_desert,psih_desert,psim_desert,ustar_desert);
dtair_desert = dt_air_desert(h_desert, roh_air_desert, rah_desert);
/* This should find the new dtair from inversed h equation...*/
Modified: grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c 2008-07-28 22:22:28 UTC (rev 32352)
+++ grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c 2008-07-28 23:39:54 UTC (rev 32353)
@@ -5,14 +5,14 @@
double zom_0(double ndvi, double ndvi_max)
{
double a, b, zom;
- double hv_ndvimax=1.5; /* crop vegetation height (m) */
+ double hv_ndvimax=1.2; /* crop vegetation height (m) */
double hv_desert=0.002; /* desert base vegetation height (m) */
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;
+ b = ((log(hv_ndvimax/7)-log(hv_desert))/(ndvi_max-0.02)) * ndvi;
zom = exp(a+b);
-// printf("zom = %5.3f\n", zom);
+// printf("****************zom = %5.3f\n", zom);
return (zom);
}
More information about the grass-commit
mailing list