[GRASS-SVN] r29432 - in grass-addons/gipe: . i.eb.h_SEBAL95

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 13 20:07:29 EST 2007


Author: ychemin
Date: 2007-12-13 20:07:28 -0500 (Thu, 13 Dec 2007)
New Revision: 29432

Added:
   grass-addons/gipe/i.eb.h_SEBAL95/
   grass-addons/gipe/i.eb.h_SEBAL95/Makefile
   grass-addons/gipe/i.eb.h_SEBAL95/U_0.c
   grass-addons/gipe/i.eb.h_SEBAL95/description.html
   grass-addons/gipe/i.eb.h_SEBAL95/dtair.c
   grass-addons/gipe/i.eb.h_SEBAL95/dtair_desert.c
   grass-addons/gipe/i.eb.h_SEBAL95/functions.h
   grass-addons/gipe/i.eb.h_SEBAL95/h1.c
   grass-addons/gipe/i.eb.h_SEBAL95/h_0.c
   grass-addons/gipe/i.eb.h_SEBAL95/main.c
   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/roh_air.c
   grass-addons/gipe/i.eb.h_SEBAL95/roh_air_0.c
   grass-addons/gipe/i.eb.h_SEBAL95/sensi_h.c
   grass-addons/gipe/i.eb.h_SEBAL95/u_star.c
   grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c
Modified:
   grass-addons/gipe/Makefile
   grass-addons/gipe/gmmenu.tcl
   grass-addons/gipe/install_yanns_grass.sh
Log:
Fixed install bugs of r.evapo.PM and raster Makefile, added i.eb.h_SEBAL95 module

Modified: grass-addons/gipe/Makefile
===================================================================
--- grass-addons/gipe/Makefile	2007-12-13 21:04:23 UTC (rev 29431)
+++ grass-addons/gipe/Makefile	2007-12-14 01:07:28 UTC (rev 29432)
@@ -51,7 +51,6 @@
 	r.mode \
 	r.neighbors \
 	r.null \
-	r.nullwest \
 	r.out.arc \
 	r.out.ascii \
 	r.out.bin \
@@ -111,7 +110,6 @@
 	r.usler \
 	r.volume \
 	r.walk \
-	r.water.fea \
 	r.water.outlet \
 	r.watershed \
 	r.what \

Modified: grass-addons/gipe/gmmenu.tcl
===================================================================
--- grass-addons/gipe/gmmenu.tcl	2007-12-13 21:04:23 UTC (rev 29431)
+++ grass-addons/gipe/gmmenu.tcl	2007-12-14 01:07:28 UTC (rev 29432)
@@ -554,6 +554,7 @@
 				{command {[G_msg "Emissivity (generic from NDVI)"]} {} "i.emissivity" {} -command {execute i.emissivity }}
 				{separator}
 				{command {[G_msg "Latitude map"]} {} "i.latitude" {} -command {execute i.latitude }}
+				{command {[G_msg "Longitude map"]} {} "i.longitude" {} -command {execute i.longitude }}
 				{command {[G_msg "Sunshine hours (potential)"]} {} "i.sunhours" {} -command {execute i.sunhours }}
 				{command {[G_msg "Satellite overpass time"]} {} "i.sattime" {} -command {execute i.sattime }}
 		}}

Added: grass-addons/gipe/i.eb.h_SEBAL95/Makefile
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/Makefile	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/Makefile	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,10 @@
+MODULE_TOPDIR = ../..
+
+PGM = i.eb.h_SEBAL95
+
+LIBES = $(GISLIB)
+DEPENDENCIES = $(GISDEP)
+
+include $(MODULE_TOPDIR)/include/Make/Module.make
+
+default: cmd

Added: grass-addons/gipe/i.eb.h_SEBAL95/U_0.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/U_0.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/U_0.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,15 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+double U_0(double zom_0, double u2m)
+{
+	double u_0;
+
+	u_0 = u2m*0.41*log(200/(0.15/7))/(log(2/(0.15/7))*log(200/zom_0)); 
+
+//	printf("u_0 = %5.3f\n", u_0);
+	
+	return (u_0);
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/U_0.c
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/description.html
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/description.html	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/description.html	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,161 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>r.evapo.PM</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<link rel="stylesheet" href="grassdocs.css" type="text/css">
+</head>
+<body bgcolor="white">
+
+<img src="grass.smlogo.gif" alt="GRASS logo"><hr align=center size=6 noshade>
+
+<H2>NAME</H2> <B><I>i.eb.h_SEBAL95 </I></B>- computation of <i>sensible heat flux</i> [W/m2] after Bastiaanssen, 1995 in [1].
+
+<P><I>(GRASS Raster Program)</I>
+
+<H2>SYNOPSIS</H2>
+<B>i.eb.h_SEBAL95</B>
+<BR>
+<B>i.eb.h_SEBAL95</B> help</br>
+<BR>
+
+<B>i.eb.h_SEBAL95</b> <b>[ -qzn ]</b>
+
+<b>DEM</b>=name
+<b>T</b>=name
+<b>RH</b>=name
+<b>WS</b>=name
+<b>NSR</b>=name
+<b>Vh</b>=name
+<b>ETP</b>=name
+
+<H2>DESCRIPTION</H2>
+
+<p><EM>i.eb.h_SEBAL95</EM> given the vegetation height (hc), humidity (RU), 
+wind speed at two meters height (WS), temperature (T), digital terrain model (DEM), 
+and net radiation (NSR) raster input maps, 
+calculates the sensible heat flux map (h0).
+
+<p>Optionally the user can activate a flag (-z) 
+that allows him setting to zero all of the negative evapotranspiration cells; 
+in fact these negative values motivated by the condensation of the air water 
+vapour content, are sometime undesired because they can produce  computational 
+problems. The usage of the flag -n detect that the module is run in night hours 
+and the appropriate soil heat flux is calculated.
+
+<p>The algorithm implements well known approaches: the hourly Penman-Monteith method as presented in Allen et al. (1998) for land surfaces and the Penman method (Penman, 1948) for water surfaces.<br>
+
+<p>Land and water surfaces are idenfyied by Vh:<br>
+-	where Vh>0 vegetation is present and evapotranspiration is calculated;<br>
+-	where Vh=0 bare ground is present and evapotranspiration is calculated;<br>
+-	where Vh<0 water surface is present and evaporation is calculated;<br>
+
+<p>For more details on the algorithms see [1].
+
+
+<H2>OPTIONS</H2>
+
+The program will run non-interactively if the user specifies program
+arguments and flag settings on the command line using the following
+form:
+
+<P><B>i.eb.h_SEBAL95</b> <b>[ -qzd ]</b>
+<b>DEM</b>=name
+<b>T</b>=name
+<b>RH</b>=name
+<b>WS</b>=name
+<b>NSR</b>=name
+<b>Vh</b>=name
+<b>ETP</b>=name
+
+
+
+<P>Alternatively, the user can simply type <EM>i.eb.h_SEBAL95</EM> on the
+command line and the program will ask for parameter values and flag
+settings interactively, using the standard GRASS parser interface.
+
+
+<H3>Flags:</H3>
+<dl>
+  <dt><B>-q</B>
+   <dd>Run quietly (do not display status messages). By default
+   <EM>r.evapo.PM</EM> is run verbosely.
+ <dt><B>-z</B>
+  <dd>Set negative calculated evapotranspiration values to zero.
+ <dt><B>-n</B>
+  <dd>Calculate soil heat flux for night time. By default 
+  <EM>r.evapo.PM</EM> calculate it for day time.
+</dl>
+
+
+<H3>Parameters:</H3>
+<dl>
+ <dt><B>DEM</B>=<I>name</I>
+ <dd>Input elevation raster [m a.s.l.]. Required.</dd>
+
+ <dt><b>T</b>=<I>name</I>
+ <dd>Input temperature raster [�C]. Required.</dd>
+
+ <dt><b>RH</b> =<I>name</I>
+ <dd>Input relative humidity raster [%]. Required.</dd>
+
+ <dt><b>WS</b> =<I>name</I>
+ <dd>Input wind speed at two meters raster [m/s]. Required.</dd>
+
+ <dt><b>NSR</b> =<I>name</I>
+ <dd>Input net solar radiation raster [MJ/(m2*h)]. Required.</dd>
+
+ <dt><b>Vh</b> =<I>name</I>
+ <dd>Input vegetation heigth raster [m]. Required.</dd>
+
+ <dt><b>ETP</b> =<I>name</I>
+ <dd>Output evapotranspiration raster [mm/h]. Required.</dd>
+
+</dl>
+      
+
+<H2>NOTES</H2>
+
+<p>Net solar radiation map in MJ/(m2*h) can be computed from the combination of the r.sun , 
+run in mode 1, and the r.mapcalc commands.
+
+<p>The sum of the three radiation components outputted by r.sun (beam, diffuse, and reflected) 
+multiplied by the Wh->Mj conversion factor (0.0036) and optionally by a 
+clear sky factor [0-1] allows the generation of a map to be used as 
+an NSR input for the <EM>r.evapo.PM</EM> command.
+<dt>example:
+<br><dd>r.sun -s elevin=dem aspin=aspect slopein=slope lin=2 albedo=alb_Mar incidout=out beam_rad=beam diff_rad=diffuse refl_rad=reflected day=73 time=13:00 dist=100;
+<br><dd>r.mapcalc 'NSR=0.0036*(beam+diffuse+reflected)';
+
+
+<H2>SEE ALSO</H2>
+<ul>
+  <li><a href=i.eb.h_iter.html>i.eb.h_iter</a>,
+      <a href=i.eb.h0.html>i.eb.h0</a>
+</ul>
+
+
+
+<H2>AUTHORS</H2>
+  <p>
+  <i>
+   <br>Yann Chemin, International Rice Research Institute, Los Banos, The Philippines.
+  </i>
+  <p>Contact: <a href="mailto:y.chemin at cgiar.org"> Yann chemin</a>
+
+
+<H2>REFERENCES</H2>
+
+  <p>[1] Bastiaanssen, W.G.M., 1995.
+  Estimation of Land surface paramters by remote sensing under clear-sky conditions. PhD thesis, Wageningen University, Wageningen, The Netherlands.
+
+  <p>[2] Allen, R.G., L.S. Pereira, D. Raes, and M. Smith. 1998. 
+  Crop Evapotranspiration: Guidelines for computing crop water requirements. 
+  Irrigation and Drainage Paper 56, Food and Agriculture Organization of the 
+  United Nations, Rome, pp. 300
+       
+  <p>[3] Penman, H. L. 1948. Natural evaporation from open water, 
+  bare soil and grass. Proc. Roy. Soc. London, A193, pp. 120-146. 
+<p><i>Last changed: $Date: 2007/07/29 19:30:00 $</i>
+</body>
+</html>


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/description.html
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/dtair.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/dtair.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/dtair.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,21 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+/* Pixel-based input required are: tempk water & desert
+ * additionally, dtair in Desert point should be given
+ */ 
+
+
+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;
+	
+	result = t0_dem * a + b;
+	
+	return result;
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/dtair.c
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/dtair_desert.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/dtair_desert.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/dtair_desert.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,14 @@
+#include<stdio.h>
+#include<math.h>
+#include<stdlib.h>
+#include"functions.h"
+
+double dt_air_desert(double h_desert, double roh_air_desert, double rah_desert)
+{
+	double result;
+	
+	result = (h_desert * rah_desert)/(roh_air_desert * 1004);
+
+	return result;
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/dtair_desert.c
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/functions.h
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/functions.h	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/functions.h	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,51 @@
+/* These are the headers for the RS functions used in SEBAL */
+/* ychemin at yahoo.com - yann.chemin at ait.ac.th */
+/* LGPL - 2004 */
+
+/* Initial functions */
+double DN2Rad_landsat7( double Lmin, double LMax, double QCalMax, double QCalmin, int DN );
+double Rad2Ref_landsat7( double radiance, double doy,double sun_elevation, double k_exo );
+double tempk_landsat7( double chan6 );
+double bb_alb_aster( double greenchan, double redchan, double nirchan, double swirchan1, double swirchan2, double swirchan3, double swirchan4, double swirchan5, double swirchan6 );
+double bb_alb_landsat( double bluechan, double greenchan, double redchan, double nirchan, double chan5, double chan7 );
+double bb_alb_noaa( double redchan, double nirchan );
+double bb_alb_modis( double redchan, double nirchan, double chan3, double chan4, double chan5, double chan6, double chan7 );
+double nd_vi( double redchan, double nirchan );
+double emissivity_generic( double ndvi );
+double emissivity_modis( double e31, double e32 );
+double t0_dem( double dem, double tempk );
+double t_air_approx( double temp_k );
+
+/* Instantaneous rnet and g0 */
+double r_net( double bbalb, double ndvi, double tempk, double tair,  double e0, double tsw, double doy, double utc, double sunzangle );
+double g_0(double bbalb, double ndvi, double tempk, double rnet, double utc);
+
+/* Diurnal r_net and etpot */
+double solar_day(double lat, double doy, double tsw );
+double r_net_day( double bbalb, double solar, double tsw );
+double et_pot_day( double bbalb, double solar, double tempk, double tsw );
+
+/* Sensible heat flux functions */
+double sensi_h( double tempk_water, double tempk_desert, double t0_dem, double tempk, double ndvi, double ndvi_max, double dem, double rnet_desert, double g0_desert, double t0_dem_desert, double u2m, double dem_desert);
+double roh_air_0(double tempk);
+double zom_0(double ndvi, double ndvi_max);
+double U_0(double zom_0, double u2m);
+double rah_0(double zom_0, double u_0);
+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);
+double dt_air_desert(double h_desert, double roh_air_desert, double rah_desert);
+double dt_air(double t0_dem, double tempk_water, double tempk_desert, double dtair_desert);
+double rohair(double dem, double tempk, double dtair);
+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 u2m);
+double psi_h(double t0_dem, double h, double U_0, double roh_air);
+double rah1(double psih, double u_star);
+
+/* Final outputs */
+double evap_fr(double r_net, double g0, double h);
+double et_a(double r_net_day, double evap_f, double tempk);
+double biomass( double ndvi, double solar_day, double evap_fr, double light_use_ef );
+double soilmoisture( double ndvi, double evap_fr );
+
+

Added: grass-addons/gipe/i.eb.h_SEBAL95/h1.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/h1.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/h1.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,13 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+double h1(double roh_air, double rah, double dtair)
+{
+	double result;
+
+	result = roh_air*1004*dtair / rah;
+	
+	return result;
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/h1.c
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/h_0.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/h_0.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/h_0.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,13 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+double h_0(double roh_air, double rah, double dtair)
+{
+	double result;
+
+	result = roh_air*1004*(dtair) / rah;
+	
+	return (result);
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/h_0.c
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/main.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/main.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/main.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,358 @@
+/****************************************************************************
+ *
+ * MODULE:       i.eb.h_SEBAL95
+ * AUTHOR(S):    Yann Chemin - yann.chemin at gmail.com
+ * PURPOSE:      Calculates sensible heat flux by SEBAL iteration
+ *               Delta T will be reassessed in the iterations !
+ *               This has been seen in Bastiaanssen (1995).
+ *
+ * COPYRIGHT:    (C) 2002-2007 by the GRASS Development Team
+ *
+ *               This program is free software under the GNU General Public
+ *   	    	 License (>=v2). Read the file COPYING that comes with GRASS
+ *   	    	 for details.
+ *
+ * CHANGELOG:	
+ *
+ *****************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <grass/gis.h>
+#include <math.h>
+#include "functions.h"
+#include <grass/glocale.h>
+
+int main(int argc, char *argv[])
+{	
+	struct Cell_head cellhd;
+	
+	/* buffer for in out raster */
+	DCELL *inrast_T,*inrast_ndvi,*inrast_u2,*inrast_DEM,*inrast_Rn,*inrast_g0,*outrast;
+	unsigned char *ETa;
+	
+	int nrows, ncols;
+	int row, col;
+	int row_wet, col_wet;
+	int row_dry, col_dry;
+	int infd_T,infd_ndvi,infd_u2,infd_DEM,infd_Rn,infd_g0;
+	int outfd;
+	
+	char *mapset_T,*mapset_ndvi,*mapset_u2,*mapset_DEM,*mapset_Rn,*mapset_g0;
+	char *T, *ndvi, *u2, *DEM, *Rn, *g0; 
+	
+	int d_night;
+	
+        struct History history;
+	struct GModule *module;
+	struct Option *input_T, *input_ndvi, *input_u2, *input_DEM, *input_Rn, *input_g0, *output;
+	struct Option *input_row_wet, *input_col_wet, *input_row_dry, *input_col_dry;
+	struct Flag *flag1, *day, *zero;
+	
+	
+	G_gisinit(argv[0]);
+	
+	module = G_define_module();
+	module->description = _("Sensible Heat Flux iteration from SEBAL 95");
+	
+	/* Define different options */
+	input_T = G_define_option();
+	input_T->key	= "T";
+	input_T->type = TYPE_STRING;
+	input_T->required = YES;
+	input_T->gisprompt = "old,cell,raster";
+	input_T->description = _("Name of Surface Skin Temperature input map [K]");
+		
+	input_u2 = G_define_option();
+	input_u2->key	= "u2m";
+	input_u2->type = TYPE_STRING;
+	input_u2->required = YES;
+	input_u2->gisprompt = "old,cell,raster";
+	input_u2->description = _("Name of Wind Speed input map [m/s]");
+		
+	input_DEM = G_define_option();
+	input_DEM->key	= "DEM";
+	input_DEM->type = TYPE_STRING;
+	input_DEM->required = YES;
+	input_DEM->gisprompt = "old,cell,raster";
+	input_DEM->description = _("Name of DEM input map [m a.s.l.]");
+	
+	input_ndvi = G_define_option();
+	input_ndvi->key	= "ndvi";
+	input_ndvi->type = TYPE_STRING;
+	input_ndvi->required = YES;
+	input_ndvi->gisprompt = "old,cell,raster";
+	input_ndvi->description = _("Name of NDVI input map [%]");
+	
+	input_Rn = G_define_option();
+	input_Rn->key	= "Rn";
+	input_Rn->type = TYPE_STRING;
+	input_Rn->required = YES;
+	input_Rn->gisprompt = "old,cell,raster";
+	input_Rn->description = _("Name of Diurnal Net Solar Radiation input map [W/m2]");
+	
+	input_g0 = G_define_option();
+	input_g0->key	= "g0";
+	input_g0->type = TYPE_STRING;
+	input_g0->required = YES;
+	input_g0->gisprompt = "old,cell,raster";
+	input_g0->description = _("Name of Soil Heat Flux input map [W/m2]");	
+	
+	input_row_wet 			= G_define_option();
+	input_row_wet->key		= "row_wet";
+	input_row_wet->type 		= TYPE_INTEGER;
+	input_row_wet->required 	= YES;
+	input_row_wet->gisprompt 	= "old,value";
+	input_row_wet->description 	= _("Row value of the wet pixel");	
+	
+	input_col_wet 			= G_define_option();
+	input_col_wet->key		= "col_wet";
+	input_col_wet->type 		= TYPE_INTEGER;
+	input_col_wet->required 	= YES;
+	input_col_wet->gisprompt 	= "old,value";
+	input_col_wet->description 	= _("Column value of the wet pixel");	
+	
+	input_row_dry 			= G_define_option();
+	input_row_dry->key		= "row_dry";
+	input_row_dry->type 		= TYPE_INTEGER;
+	input_row_dry->required 	= YES;
+	input_row_dry->gisprompt 	= "old,value";
+	input_row_dry->description 	= _("Row value of the dry pixel");	
+	
+	input_col_dry 			= G_define_option();
+	input_col_dry->key		= "col_dry";
+	input_col_dry->type 		= TYPE_INTEGER;
+	input_col_dry->required 	= YES;
+	input_col_dry->gisprompt 	= "old,value";
+	input_col_dry->description 	= _("Column value of the dry pixel");	
+
+	output = G_define_option() ;
+	output->key        = "ETa";
+	output->type       = TYPE_STRING;
+	output->required   = YES;
+	output->gisprompt  = "new,cell,raster" ;
+	output->description= _("Name of output Actual Evapotranspiration layer [mm/d]");
+	
+	/* Define the different flags */
+	//flag1 = G_define_flag() ;
+	//flag1->key         = 'q' ;
+	//flag1->description = "Quiet" ;
+	
+	zero = G_define_flag() ;
+	zero->key         = 'z' ;
+	zero->description = _("set negative evapo to zero");
+	
+	day = G_define_flag() ;
+	day->key         = 'n' ;
+	day->description = _("night-time");
+	
+	if (G_parser(argc, argv))
+	  exit(EXIT_FAILURE);
+	
+	/* get entered parameters */
+	T=input_T->answer;
+	u2=input_u2->answer;
+	DEM=input_DEM->answer;
+	ndvi=input_ndvi->answer;
+	Rn=input_Rn->answer;
+	g0=input_g0->answer;
+	ETa=output->answer;
+
+	row_wet = atoi(input_row_wet->answer);
+	col_wet = atoi(input_col_wet->answer);
+	row_dry = atoi(input_row_dry->answer);
+	col_dry = atoi(input_col_dry->answer);
+	
+	if (day->answer) {
+		d_night = TRUE;
+	}
+	else {
+		d_night=FALSE;
+	}
+	
+	/* find maps in mapset */
+	mapset_T = G_find_cell2 (T, "");
+	if (mapset_T == NULL)
+	        G_fatal_error (_("cell file [%s] not found"), T);
+	mapset_u2 = G_find_cell2 (u2, "");
+	if (mapset_u2 == NULL)
+	        G_fatal_error (_("cell file [%s] not found"), u2);
+	mapset_DEM = G_find_cell2 (DEM, "");
+	if (mapset_DEM == NULL)
+	        G_fatal_error (_("cell file [%s] not found"), DEM);
+	mapset_ndvi = G_find_cell2 (ndvi, "");
+	if (mapset_ndvi == NULL)
+	        G_fatal_error (_("cell file [%s] not found"), ndvi);
+	mapset_Rn = G_find_cell2 (Rn, "");
+	if (mapset_Rn == NULL)
+	        G_fatal_error (_("cell file [%s] not found"), Rn);
+	mapset_g0 = G_find_cell2 (g0, "");
+	if (mapset_g0 == NULL)
+	        G_fatal_error (_("cell file [%s] not found"), g0);
+
+	
+	/* check legal output name */ 
+	if (G_legal_filename (ETa) < 0)
+			G_fatal_error (_("[%s] is an illegal name"), ETa);
+		
+	/* determine the input map type (CELL/FCELL/DCELL) */
+	//data_type = G_raster_map_type(T, mapset);
+
+	if ( (infd_T = G_open_cell_old (T, mapset_T)) < 0)
+		G_fatal_error (_("Cannot open cell file [%s]"), T);
+	if ( (infd_u2 = G_open_cell_old (u2, mapset_u2)) < 0)
+		G_fatal_error (_("Cannot open cell file [%s]"),u2);
+	if ( (infd_DEM = G_open_cell_old (DEM, mapset_DEM)) < 0)
+		G_fatal_error (_("Cannot open cell file [%s]"),DEM);
+	if ( (infd_ndvi = G_open_cell_old (ndvi, mapset_ndvi)) < 0)
+		G_fatal_error (_("Cannot open cell file [%s]"),ndvi);
+	if ( (infd_Rn = G_open_cell_old (Rn, mapset_Rn)) < 0)
+		G_fatal_error (_("Cannot open cell file [%s]"),Rn);
+	if ( (infd_g0 = G_open_cell_old (g0, mapset_g0)) < 0)
+		G_fatal_error (_("Cannot open cell file [%s]"),g0);
+	
+	if (G_get_cellhd (T, mapset_T, &cellhd) < 0)
+		G_fatal_error (_("Cannot read file header of [%s]"), T);
+	if (G_get_cellhd (u2, mapset_u2, &cellhd) < 0)
+		G_fatal_error (_("Cannot read file header of [%s]"), u2);
+	if (G_get_cellhd (DEM, mapset_DEM, &cellhd) < 0)
+		G_fatal_error (_("Cannot read file header of [%s]"), DEM);
+	if (G_get_cellhd (ndvi, mapset_ndvi, &cellhd) < 0)
+		G_fatal_error (_("Cannot read file header of [%s]"), ndvi);
+	if (G_get_cellhd (Rn, mapset_Rn, &cellhd) < 0)
+		G_fatal_error (_("Cannot read file header of [%s]"), Rn);
+	if (G_get_cellhd (g0, mapset_g0, &cellhd) < 0)
+		G_fatal_error (_("Cannot read file header of [%s]"), g0);
+
+	/* Allocate input buffer */
+	inrast_T  = G_allocate_d_raster_buf();
+	inrast_u2 = G_allocate_d_raster_buf();
+	inrast_DEM = G_allocate_d_raster_buf();
+	inrast_ndvi = G_allocate_d_raster_buf();
+	inrast_Rn = G_allocate_d_raster_buf();
+	inrast_g0 = G_allocate_d_raster_buf();
+	
+	/* Allocate output buffer */
+	nrows = G_window_rows();
+	ncols = G_window_cols();
+	outrast = G_allocate_d_raster_buf();
+
+	if ( (outfd = G_open_raster_new (ETa,DCELL_TYPE)) < 0)
+		G_fatal_error (_("Could not open <%s>"),ETa);
+
+
+	DCELL d_ndvi; 		/* Input raster */
+	DCELL d_ndvi_max = 0.0;	/* Generated here */
+	/* NDVI Max */
+	for (row = 0; row < nrows; row++)
+	{
+		if (G_get_d_raster_row (infd_ndvi, inrast_ndvi, row) < 0)
+			G_fatal_error (_("Could not read from <%s>"),ndvi);
+		for (col=0; col < ncols; col++)
+		{
+			d_ndvi	= ((DCELL *) inrast_ndvi)[col];
+			if ((d_ndvi)>d_ndvi_max&&(d_ndvi)<0.98){
+				d_ndvi_max	= d_ndvi;
+			}
+		}
+	}
+
+	/* Pick up wet and dry pixel values */
+	DCELL d_Rn; 		/* Input raster */
+	DCELL d_g0; 		/* Input raster */
+	DCELL d_tempk_wet;
+	DCELL d_tempk_dry;
+	DCELL d_rnet_dry;
+	DCELL d_g0_dry;
+	DCELL d_t0dem_dry;
+	DCELL d_dem_dry;
+
+	/*Process wet pixel values*/
+	if (G_get_d_raster_row (infd_T, inrast_T, row_wet) < 0)
+		G_fatal_error (_("Could not read from <%s>"),T);
+	d_tempk_wet	= ((DCELL *) inrast_T)[col_wet];
+
+	/*Process dry pixel values*/
+	if (G_get_d_raster_row (infd_T, inrast_T, row_dry) < 0)
+		G_fatal_error (_("Could not read from <%s>"),T);
+	if (G_get_d_raster_row (infd_DEM, inrast_DEM, row) < 0)
+		G_fatal_error (_("Could not read from <%s>"),DEM);
+	if (G_get_d_raster_row (infd_Rn, inrast_Rn, row_dry) < 0)
+		G_fatal_error (_("Could not read from <%s>"),Rn);
+	if (G_get_d_raster_row (infd_g0, inrast_g0, row_dry) < 0)
+		G_fatal_error (_("Could not read from <%s>"),g0);
+	d_tempk_dry	= ((DCELL *) inrast_T)[col_dry];
+	d_rnet_dry	= ((DCELL *) inrast_Rn)[col_dry];
+	d_g0_dry	= ((DCELL *) inrast_g0)[col_dry];
+	d_t0dem_dry	= ((DCELL *) inrast_DEM)[col_dry];
+	d_t0dem_dry	= d_t0dem_dry * 0.00627 + d_tempk_dry;
+	d_dem_dry	= ((DCELL *) inrast_DEM)[col_dry];
+	
+	
+	for (row = 0; row < nrows; row++)
+	{
+		DCELL d_tempk; 		/* Input raster */
+		DCELL d_u2m; 		/* Input raster */
+		DCELL d_dem; 		/* Input raster */
+		DCELL d;	/* Output pixel */
+		DCELL d_t0dem;	/* Generated here */
+
+		/* read a line input maps into buffers*/	
+		if (G_get_d_raster_row (infd_T, inrast_T, row) < 0)
+			G_fatal_error (_("Could not read from <%s>"),T);
+		if (G_get_d_raster_row (infd_u2, inrast_u2, row) < 0)
+			G_fatal_error (_("Could not read from <%s>"),u2);
+		if (G_get_d_raster_row (infd_DEM, inrast_DEM, row) < 0)
+			G_fatal_error (_("Could not read from <%s>"),DEM);
+		if (G_get_d_raster_row (infd_ndvi, inrast_ndvi, row) < 0)
+			G_fatal_error (_("Could not read from <%s>"),ndvi);
+		
+		/* read every cell in the line buffers */
+		for (col=0; col < ncols; col++)
+		{
+			d_tempk	= ((DCELL *) inrast_T)[col];
+			d_u2m	= ((DCELL *) inrast_u2)[col];
+			d_dem	= ((DCELL *) inrast_DEM)[col];
+			d_ndvi	= ((DCELL *) inrast_ndvi)[col];
+			d_Rn	= ((DCELL *) inrast_Rn)[col];
+			d_g0	= ((DCELL *) inrast_g0)[col];
+			
+			/* Calculate T0dem */
+			d_t0dem = d_dem * 0.00627 + d_tempk;
+			/* Calculate sensible heat flux */
+			d = sensi_h(d_tempk_wet,d_tempk_dry,d_t0dem,d_tempk,d_ndvi,d_ndvi_max,d_dem,d_rnet_dry,d_g0_dry,d_t0dem_dry,d_u2m,d_dem_dry);
+			
+			if (zero->answer && d<0.0){
+				d=0.0;
+			}
+			((DCELL *) outrast)[col] = d;
+		}
+		
+		if (G_put_d_raster_row (outfd, outrast) < 0)
+			G_fatal_error (_("Cannot write to <%s>"),ETa);
+			
+	}	
+	G_free(inrast_T);
+	G_free(inrast_u2);
+	G_free(inrast_DEM);
+	G_free(inrast_ndvi);
+	G_free(inrast_Rn);
+	G_free(inrast_g0);
+	G_free(outrast);
+	G_close_cell (infd_T);
+	G_close_cell (infd_u2);
+	G_close_cell (infd_DEM);
+	G_close_cell (infd_ndvi);
+	G_close_cell (infd_Rn);
+	G_close_cell (infd_g0);
+	G_close_cell (outfd);
+	
+        /* add command line incantation to history file */
+        G_short_history(output, "raster", &history);
+        G_command_history(&history);
+        G_write_history(output, &history);
+
+	exit(EXIT_SUCCESS);
+}

Added: grass-addons/gipe/i.eb.h_SEBAL95/psi_h.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/psi_h.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/psi_h.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,32 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+#define PI 3.1415927
+
+double psi_h(double t0_dem, double h, double U_0, double roh_air)
+{
+	double result;
+	double n5_temp, n11_mem, n12_mem;
+
+//	printf("h input to psih() is %5.3f\n",h);
+	
+	if(h != 0.0){
+		n5_temp = (-1004* roh_air*pow(U_0,3)* t0_dem)/(0.41*9.81* h);
+	} else {
+		n5_temp = -1000.0;
+	}
+
+	if(n5_temp < 0.0){
+		n12_mem = pow((1-16*(2/n5_temp)),0.25);
+		n11_mem = (2*log((1+pow(n12_mem,2))/2));
+	} else {
+		n12_mem = 1.0;
+		n11_mem = -5*2/n5_temp;
+	}
+
+	result = n11_mem;
+
+	return (result);
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/psi_h.c
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/rah1.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/rah1.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/rah1.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,15 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+#define PI 3.1415927
+
+double rah1(double psih, double ustar)
+{
+	double result;
+
+	result = (log(2/0.01)-psih)/(ustar*0.41);
+
+	return (result);
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/rah1.c
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/rah_0.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/rah_0.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/rah_0.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,13 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+double rah_0(double zom_0, double u_0)
+{
+	double result;
+
+	result = log(2/0.01)/(u_0*0.41);
+
+	return (result);
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/rah_0.c
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/roh_air.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/roh_air.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/roh_air.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,15 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+double rohair(double dem, double tempk, double dtair)
+{
+	double a, b, result;
+
+	a = tempk - dtair;
+	b = (( a - 0.00627*dem)/a);
+	result = 349.467 * pow( b , 5.26)/ a ;
+	
+	return result;
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/roh_air.c
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/roh_air_0.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/roh_air_0.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/roh_air_0.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,14 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+double roh_air_0(double tempk)
+{
+	double A, B, result;
+	
+	A = (24*(6.11*exp(17.27*36/(36+237.3)))/100.0);
+	B = (24*(6.11*exp(17.27*36/(36+237.3)))/100.0);
+	result = (1000.0 - A)/(tempk*2.87)+ B/(tempk*4.61);
+	return result;
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/roh_air_0.c
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/sensi_h.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/sensi_h.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/sensi_h.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,107 @@
+/* This is the main loop used in SEBAL */
+/* ychemin at yahoo.com - yann.chemin at ait.ac.th */
+/* GPL >= 2 - April 2004 */
+
+#include<stdio.h>
+#include<math.h>
+#include<stdlib.h>
+#include "functions.h"
+
+/* Arrays Declarations */
+#define ITER_MAX 10
+
+double sensi_h( double tempk_water, double tempk_desert, double t0_dem, double tempk, double ndvi, double ndvi_max, double dem, double rnet_desert, double g0_desert, double t0_dem_desert, double u2m, double dem_desert)
+{
+	/* Arrays Declarations */
+	double dtair[ITER_MAX], roh_air[ITER_MAX], rah[ITER_MAX];
+	double h[ITER_MAX];
+	double ustar[ITER_MAX], zom[ITER_MAX];
+
+	/* Declarations */
+	int	i, j, ic, debug=0;
+	double u_0, zom0;
+	double h_desert, rah_desert, roh_air_desert;
+	double dtair_desert;
+	double psih_desert,ustar_desert,ustar_desertold,zom_desert;
+	double psih;
+	double result;
+
+	if(debug==1){
+		printf("*****************************\n");
+		printf("t0_dem = %5.3f\n",t0_dem);
+		printf("ndvi = %5.3f ndvimax = %5.3f\n",ndvi,ndvi_max);
+		printf("*****************************\n");
+	}
+//	dtair[0] 	= dt_air_0(t0_dem, tempk_water, tempk_desert);
+	dtair[0] = 5.0;
+// 	printf("*****************************dtair = %5.3f\n",dtair[0]);
+	roh_air[0] 	= roh_air_0(tempk);
+// 	printf("*****************************rohair=%5.3f\n",roh_air[0]);
+	roh_air_desert 	= roh_air_0(tempk_desert);
+// 	printf("**rohairdesert = %5.3f\n",roh_air_desert);
+	zom0 		= zom_0(ndvi, ndvi_max);
+// 	printf("*****************************zom = %5.3f\n",zom0);
+	u_0 		= U_0(zom0, u2m);
+// 	printf("*****************************u0\n");
+	rah[0] 		= rah_0(zom0, u_0);
+// 	printf("*****************************rah = %5.3f\n",rah[0]);
+	h[0] 		= h_0(roh_air[0], rah[0], dtair[0]);
+// 	printf("*****************************h\n");
+	if(debug==1){
+		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);
+		printf("zom_0 		= %5.3f\n", zom0);
+		printf("u_0 		= %5.3f\n", u_0);
+		printf("rah[0] 		= %5.3f s/m\n", rah[0]);
+		printf("h[0] 		= %5.3f W/m2\n", h[0]);
+	}
+
+/*----------------------------------------------------------------*/
+/*Main iteration loop of SEBAL*/
+	zom[0] = zom0;
+	for(ic=1;ic<ITER_MAX+1;ic++){
+		if(debug==1){
+			printf("\n ******** ITERATION %i *********\n",ic);
+		}
+		/* 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],u2m);
+		rah[ic] = rah1(psih, ustar[ic]);	
+		/* get desert point values from maps */
+		if(ic==1){
+			h_desert	= rnet_desert - g0_desert;
+			zom_desert	= 0.002;
+			psih_desert 	= psi_h(t0_dem_desert,h_desert,u_0,roh_air_desert);
+			ustar_desert	= u_star(t0_dem_desert,h_desert,u_0,roh_air_desert,zom_desert,u2m);
+		} else {
+			roh_air_desert	= rohair(dem_desert,tempk_desert,dtair_desert);
+			h_desert	= h1(roh_air_desert,rah_desert,dtair_desert);
+			ustar_desertold = ustar_desert;
+			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,u2m);
+		}
+		rah_desert	= rah1(psih_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...*/
+		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]);
+		/* Output values of the iteration parameters */
+		if(debug==1){
+			printf("psih[%i] 	= %5.3f\n", ic, psih);
+			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("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]);	
+			printf("h[%i] 		= %5.3f W/m2\n",ic, h[ic]);
+		}
+	}
+	return h[ITER_MAX];
+}
+ 

Added: grass-addons/gipe/i.eb.h_SEBAL95/u_star.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/u_star.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/u_star.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,45 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+#define PI 3.1415927
+
+double u_star(double t0_dem, double h, double ustar, double roh_air, double zom, double u2m)
+{
+	double result;
+	double n5_temp; /* Monin-Obukov Length 		*/
+        double n10_mem; /* psi m 			*/
+	double n31_mem; /* x for U200 (that is bh...) 	*/
+	double hv=0.15;	/* crop height (m) 		*/
+	double bh=200;	/* blending height (m) 		*/
+
+//	printf("t0dem = %5.3f\n", t0_dem);
+//	printf("h = %5.3f\n", h);
+//	printf("U_0 = %5.3f\n", U_0);
+//	printf("roh_air = %5.3f\n", roh_air);
+//	printf("zom = %5.3f\n", zom);
+//	printf("u2m = %5.3f\n", u2m);
+	
+	if(h != 0.0){
+		n5_temp = (-1004* roh_air*pow(ustar,3)* t0_dem)/(0.41*9.81* h);
+	} else {
+		n5_temp = -1000.0;
+	}
+
+	if(n5_temp < 0.0){
+
+		n31_mem = pow((1-16*(200/n5_temp)),0.25);
+		n10_mem = (2*log((1+n31_mem)/2)+log((1+pow(n31_mem,2))/2)-2*atan(n31_mem)+0.5*PI);
+
+	} else {
+
+//		n31_mem = 1.0;
+		n10_mem = -5*2/n5_temp;
+
+	}
+
+	result = ((u2m*0.41/log(2/(hv/7)))/0.41*log(bh /(hv/7)*0.41))/(log(bh / zom)-n10_mem);
+	
+	return (result);
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/u_star.c
___________________________________________________________________
Name: svn:executable
   + *

Added: grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c	                        (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c	2007-12-14 01:07:28 UTC (rev 29432)
@@ -0,0 +1,19 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+double zom_0(double ndvi, double ndvi_max)
+{
+	double a, b, zom;
+	double hv_ndvimax=1.5; /* 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;
+	zom = exp(a+b); 
+	
+//	printf("zom = %5.3f\n", zom);
+	
+	return (zom);
+}
+


Property changes on: grass-addons/gipe/i.eb.h_SEBAL95/zom_0.c
___________________________________________________________________
Name: svn:executable
   + *

Modified: grass-addons/gipe/install_yanns_grass.sh
===================================================================
--- grass-addons/gipe/install_yanns_grass.sh	2007-12-13 21:04:23 UTC (rev 29431)
+++ grass-addons/gipe/install_yanns_grass.sh	2007-12-14 01:07:28 UTC (rev 29432)
@@ -25,6 +25,7 @@
 do
 	cp -rf $HFDIR/$directory $GRASSCVSDIR/raster/
 done
+cp -rf $HFDIR/PM_Makefile $GRASSCVSDIR/raster/r.evapo.PM/Makefile
 
 cp -f $GIPEDIR/Makefile $GRASSCVSDIR/raster/ 
 cd $GRASSCVSDIR/raster/



More information about the grass-commit mailing list