[GRASS-SVN] r32361 - grass-addons/gipe/i.eb.h_SEBAL95
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jul 29 09:17:38 EDT 2008
Author: ychemin
Date: 2008-07-29 09:17:38 -0400 (Tue, 29 Jul 2008)
New Revision: 32361
Modified:
grass-addons/gipe/i.eb.h_SEBAL95/dtair.c
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/sensi_h_z0m.c
Log:
bug fixing
Modified: grass-addons/gipe/i.eb.h_SEBAL95/dtair.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/dtair.c 2008-07-29 13:13:59 UTC (rev 32360)
+++ grass-addons/gipe/i.eb.h_SEBAL95/dtair.c 2008-07-29 13:17:38 UTC (rev 32361)
@@ -10,12 +10,11 @@
double dt_air(double t0_dem, double tempk_water, double tempk_desert, double dtair_desert)
{
double a, b, result;
-
a = (dtair_desert-0.0)/(tempk_desert-tempk_water);
- b = 0.0 - a * tempk_water;
-
+ b = dtair_desert - a * tempk_desert;
result = t0_dem * a + b;
-
+ printf("__________________________________");
+ printf("dtair=%5.3f * Tempk + (%5.3f)\n",a,b);
return result;
}
Modified: grass-addons/gipe/i.eb.h_SEBAL95/main.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/main.c 2008-07-29 13:13:59 UTC (rev 32360)
+++ grass-addons/gipe/i.eb.h_SEBAL95/main.c 2008-07-29 13:17:38 UTC (rev 32361)
@@ -1111,7 +1111,21 @@
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);
+ 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){
/* do nothing */
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-29 13:13:59 UTC (rev 32360)
+++ grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_noz0m.c 2008-07-29 13:17:38 UTC (rev 32361)
@@ -70,6 +70,7 @@
// printf("*****************************h\n");
if(debug==1){
printf("h_desert = %5.3f W/m2\n", h_desert);
+ printf("ustar_desert = %5.3f m/s\n", ustar_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]);
@@ -84,16 +85,17 @@
/*----------------------------------------------------------------*/
/*Main iteration loop of SEBAL*/
zom[0] = zom0;
+ ustar[0] = u_star(t0_dem,h[0],u_0,roh_air[0],zom[0],u_hu,hu);
for(ic=1;ic<iteration+1;ic++){
if(debug==1){
printf("\n ******** ITERATION %i *********\n",ic);
}
- ustar[ic] = u_star(t0_dem,h[ic-1],u_0,roh_air[ic-1],zom[0],u_hu,hu);
- psih = psi_h(t0_dem,h[ic-1],ustar[ic],roh_air[ic-1],hu);
- psim = psi_m(t0_dem,h[ic-1],ustar[ic],roh_air[ic-1],hu);
- rah[ic] = rah1(zom0, psih, psim, ustar[ic]);
+ psih = psi_h(t0_dem,h[ic-1],ustar[ic-1],roh_air[ic-1],hu);
+ psim = psi_m(t0_dem,h[ic-1],ustar[ic-1],roh_air[ic-1],hu);
+ rah[ic] = rah1(zom[0], psih, psim, ustar[ic]);
+ roh_air[ic] = rohair(dem, tempk, dtair[ic-1]);
if(rah[ic]<0.0)
- rah[ic]=0.0;
+ rah[ic]=1.0;
/* get desert point values from maps */
roh_air_desert = rohair(dem_desert,tempk_desert,dtair_desert);
h_desert = h1(roh_air_desert,rah_desert,dtair_desert);
@@ -105,17 +107,21 @@
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);
- /* This produces h[ic] and roh_air[ic+1] */
- roh_air[ic] = rohair(dem, tempk, dtair[ic]);
+ /* This produces h[ic] */
h[ic] = h1(roh_air[ic], rah[ic], dtair[ic]);
+ ustar[ic] = u_star(t0_dem,h[ic],ustar[ic-1],roh_air[ic],zom[0],u_hu,hu);
/* Output values of the iteration parameters */
if(debug==1){
printf("psih[%i] = %5.3f\n", ic, psih);
+ printf("psim[%i] = %5.3f\n", ic, psim);
+ printf("ustar[%i] = %5.3f\n", ic-1, ustar[ic-1]);
printf("ustar[%i] = %5.3f\n", ic, ustar[ic]);
printf("rah[%i] = %5.3f s/m\n",ic, rah[ic]);
printf("h_desert = %5.3f\n", h_desert);
printf("rohair_desert = %5.3f\n", roh_air_desert);
- printf("psih_desert = %5.3f\tustar_desert = %5.3f\trah_desert = %5.3f\n", psih_desert, ustar_desert, rah_desert);
+ printf("psih/m_desert = %5.3f %5.3f\n",psih_desert,psim_desert);
+ printf("u*d_old/new= %5.3f %5.3f\n",ustar_desertold,ustar_desert);
+ printf("rah_desert = %5.3f\n", rah_desert);
printf("dtair_desert = %8.5f\n", dtair_desert);
printf("dtair[%i] = %5.3f K\n", ic, dtair[ic]);
printf("roh_air[%i] = %5.3f kg/m3\n", ic, roh_air[ic]);
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-29 13:13:59 UTC (rev 32360)
+++ grass-addons/gipe/i.eb.h_SEBAL95/sensi_h_z0m.c 2008-07-29 13:17:38 UTC (rev 32361)
@@ -73,14 +73,15 @@
/*----------------------------------------------------------------*/
/*Main iteration loop of SEBAL*/
zom[0] = zom0;
+ ustar[0] =u_star(t0_dem,h[0],u_0,roh_air[0],zom[0],u_hu,hu);
for(ic=1;ic<iteration+1;ic++){
if(debug==1){
printf("\n ******** ITERATION %i *********\n",ic);
}
- ustar[ic] = u_star(t0_dem,h[ic-1],u_0,roh_air[ic-1],zom[0],u_hu,hu);
- psih= psi_h(t0_dem,h[ic-1],ustar[ic],roh_air[ic-1],hu);
- psim= psi_m(t0_dem,h[ic-1],ustar[ic],roh_air[ic-1],hu);
- rah[ic] = rah1(zom0,psih,psim,ustar[ic]);
+ psih= psi_h(t0_dem,h[ic-1],ustar[ic-1],roh_air[ic-1],hu);
+ psim= psi_m(t0_dem,h[ic-1],ustar[ic-1],roh_air[ic-1],hu);
+ rah[ic] = rah1(zom[0],psih,psim,ustar[ic]);
+ roh_air[ic] = rohair(dem, tempk, dtair[ic-1]);
if(rah[ic]<0.0)
rah[ic]=0.0;
/* get desert point values from maps */
@@ -95,8 +96,8 @@
/* This should find the new dtair from inversed h equation...*/
dtair[ic] = dt_air(t0_dem, tempk_water, tempk_desert, dtair_desert);
/* This produces h[ic] and roh_air[ic+1] */
- roh_air[ic] = rohair(dem, tempk, dtair[ic]);
h[ic] = h1(roh_air[ic], rah[ic], dtair[ic]);
+ ustar[ic] = u_star(t0_dem,h[ic],ustar[ic-1],roh_air[ic],zom[0],u_hu,hu);
/* Output values of the iteration parameters */
if(debug==1){
printf("psih[%i] = %5.3f\n", ic, psih);
More information about the grass-commit
mailing list