[GRASS-SVN] r44991 - grass/trunk/imagery/i.evapo.pm
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 12 11:09:06 EST 2011
Author: martinl
Date: 2011-01-12 08:09:05 -0800 (Wed, 12 Jan 2011)
New Revision: 44991
Added:
grass/trunk/imagery/i.evapo.pm/i.evapo.pm.html
Removed:
grass/trunk/imagery/i.evapo.pm/i.evapo.PM.html
Modified:
grass/trunk/imagery/i.evapo.pm/Makefile
grass/trunk/imagery/i.evapo.pm/main.c
Log:
i.evapo.pm (renamed from i.evapo.PM) & clean up
Modified: grass/trunk/imagery/i.evapo.pm/Makefile
===================================================================
--- grass/trunk/imagery/i.evapo.pm/Makefile 2011-01-12 16:00:38 UTC (rev 44990)
+++ grass/trunk/imagery/i.evapo.pm/Makefile 2011-01-12 16:09:05 UTC (rev 44991)
@@ -1,6 +1,6 @@
MODULE_TOPDIR = ../..
-PGM = i.evapo.PM
+PGM = i.evapo.pm
LIBES = $(GISLIB) $(RASTERLIB)
DEPENDENCIES = $(GISDEP) $(RASTERDEP)
Deleted: grass/trunk/imagery/i.evapo.pm/i.evapo.PM.html
===================================================================
--- grass/trunk/imagery/i.evapo.pm/i.evapo.PM.html 2011-01-12 16:00:38 UTC (rev 44990)
+++ grass/trunk/imagery/i.evapo.pm/i.evapo.PM.html 2011-01-12 16:09:05 UTC (rev 44991)
@@ -1,72 +0,0 @@
-<H2>DESCRIPTION</H2>
-
-<p><EM>i.evapo.PM</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 potential evapotranspiration map (EPo).
-
-<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 gt 0 vegetation is present and evapotranspiration is calculated;<br>
-- where Vh = 0 bare ground is present and evapotranspiration is calculated;<br>
-- where Vh lt 0 water surface is present and evaporation is calculated;<br>
-
-<p>For more details on the algorithms see [1,2,3].
-
-<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 to 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>i.evapo.PM</EM> command.<br>
-example:<br>
-<br>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>r.mapcalc 'NSR=0.0036*(beam+diffuse+reflected)';
-
-
-<H2>SEE ALSO</H2>
-<ul>
- <li>The <a href="http://istgis.ist.supsi.ch:8001/geomatica/">HydroFOSS</a>
-project at IST-SUPSI (Institute of Earth Sciences - University school of applied science for the Southern Switzerland)
-
- <li><a href=r.sun.html>r.sun</a>,
- <a href=r.mapcalc.html>r.mapcalc</a>
-</ul>
-
-
-
-<H2>AUTHORS</H2>
-
- <p>Original version of program: The <a href="http://istgis.ist.supsi.ch:8001/geomatica/index.php?id=1">HydroFOSS</a> project, 2006, IST-SUPSI. (http://istgis.ist.supsi.ch:8001/geomatica/index.php?id=1)
- <i>
- <br>Massimiliano Cannata, Scuola Universitaria Professionale della Svizzera Italiana - Istituto Scienze della Terra
- <br>Maria A. Brovelli, Politecnico di Milano - Polo regionale di Como
- </i>
-
- <p>Contact: <a href="mailto:massimiliano.cannata at supsi.ch"> Massimiliano Cannata</a>
-
-
-<H2>REFERENCES</H2>
-
- <p>[1] Cannata M., 2006. <A HREF="http://istgis.ist.supsi.ch:8001/geomatica/index.php?id=1">
- GIS embedded approach for Free & Open Source Hydrological Modelling</A>. PhD thesis, Department of Geodesy and Geomatics, Polytechnic of Milan, Italy.
-
- <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$</i>
Copied: grass/trunk/imagery/i.evapo.pm/i.evapo.pm.html (from rev 44987, grass/trunk/imagery/i.evapo.pm/i.evapo.PM.html)
===================================================================
--- grass/trunk/imagery/i.evapo.pm/i.evapo.pm.html (rev 0)
+++ grass/trunk/imagery/i.evapo.pm/i.evapo.pm.html 2011-01-12 16:09:05 UTC (rev 44991)
@@ -0,0 +1,72 @@
+<H2>DESCRIPTION</H2>
+
+<p><EM>i.evapo.PM</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 potential evapotranspiration map (EPo).
+
+<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 gt 0 vegetation is present and evapotranspiration is calculated;<br>
+- where Vh = 0 bare ground is present and evapotranspiration is calculated;<br>
+- where Vh lt 0 water surface is present and evaporation is calculated;<br>
+
+<p>For more details on the algorithms see [1,2,3].
+
+<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 to 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>i.evapo.PM</EM> command.<br>
+example:<br>
+<br>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>r.mapcalc 'NSR=0.0036*(beam+diffuse+reflected)';
+
+
+<H2>SEE ALSO</H2>
+<ul>
+ <li>The <a href="http://istgis.ist.supsi.ch:8001/geomatica/">HydroFOSS</a>
+project at IST-SUPSI (Institute of Earth Sciences - University school of applied science for the Southern Switzerland)
+
+ <li><a href=r.sun.html>r.sun</a>,
+ <a href=r.mapcalc.html>r.mapcalc</a>
+</ul>
+
+
+
+<H2>AUTHORS</H2>
+
+ <p>Original version of program: The <a href="http://istgis.ist.supsi.ch:8001/geomatica/index.php?id=1">HydroFOSS</a> project, 2006, IST-SUPSI. (http://istgis.ist.supsi.ch:8001/geomatica/index.php?id=1)
+ <i>
+ <br>Massimiliano Cannata, Scuola Universitaria Professionale della Svizzera Italiana - Istituto Scienze della Terra
+ <br>Maria A. Brovelli, Politecnico di Milano - Polo regionale di Como
+ </i>
+
+ <p>Contact: <a href="mailto:massimiliano.cannata at supsi.ch"> Massimiliano Cannata</a>
+
+
+<H2>REFERENCES</H2>
+
+ <p>[1] Cannata M., 2006. <A HREF="http://istgis.ist.supsi.ch:8001/geomatica/index.php?id=1">
+ GIS embedded approach for Free & Open Source Hydrological Modelling</A>. PhD thesis, Department of Geodesy and Geomatics, Polytechnic of Milan, Italy.
+
+ <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$</i>
Modified: grass/trunk/imagery/i.evapo.pm/main.c
===================================================================
--- grass/trunk/imagery/i.evapo.pm/main.c 2011-01-12 16:00:38 UTC (rev 44990)
+++ grass/trunk/imagery/i.evapo.pm/main.c 2011-01-12 16:09:05 UTC (rev 44991)
@@ -2,14 +2,14 @@
/****************************************************************************
*
- * MODULE: i.evapo.PM
+ * MODULE: i.evapo.pm
* AUTHOR(S): Massimiliano Cannata - massimiliano.cannata AT supsi.ch
* Maria A. Brovelli
* PURPOSE: Originally r.evapo.PM from HydroFOSS
* Calculates the Penman-Monteith reference evapotranspiration
* and Open Water Evaporation.
*
- * COPYRIGHT: (C) 2006-2010 by the GRASS Development Team
+ * COPYRIGHT: (C) 2006-2011 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
@@ -33,15 +33,13 @@
/* buffer for in out raster */
DCELL *inrast_T, *inrast_RH, *inrast_u2;
DCELL *inrast_Rn, *inrast_DEM, *inrast_hc, *outrast;
- unsigned char *EPo;
+ char *EPo;
int nrows, ncols;
int row, col;
int infd_T, infd_RH, infd_u2, infd_Rn, infd_DEM, infd_hc;
int outfd;
- char *mapset_T, *mapset_RH, *mapset_u2;
- char *mapset_Rn, *mapset_DEM, *mapset_hc;
char *T, *RH, *u2, *Rn, *DEM, *hc;
DCELL d_T, d_RH, d_u2, d_Rn, d_Z, d_hc;
DCELL d_EPo;
@@ -52,78 +50,51 @@
struct GModule *module;
struct Option *input_DEM, *input_T, *input_RH;
struct Option *input_u2, *input_Rn, *input_hc, *output;
- struct Flag *flag1, *day, *zero;
+ struct Flag *day, *zero;
G_gisinit(argv[0]);
module = G_define_module();
+ G_add_keyword(_("imagery"));
+ G_add_keyword(_("evapotranspiration"));
module->description =
- _("Potontial Evapotranspiration Calculation with hourly Penman-Monteith");
+ _("Computes potontial evapotranspiration calculation with hourly Penman-Monteith.");
/* Define different options */
- 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 raster map [m a.s.l.]");
+ input_DEM = G_define_standard_option(G_OPT_R_ELEV);
+ input_DEM->description = _("Name of input elevation raster map [m a.s.l.]");
+
+ input_T = G_define_standard_option(G_OPT_R_INPUT);
+ input_T->key = "temp";
+ input_T->description = _("Name of input temperature raster map [C]");
- 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 Temperature raster map [°C]");
+ input_RH = G_define_standard_option(G_OPT_R_INPUT);
+ input_RH->key = "ru";
+ input_RH->description = _("Name of input relative umidity raster map [%]");
- input_RH = G_define_option();
- input_RH->key = "RU";
- input_RH->type = TYPE_STRING;
- input_RH->required = YES;
- input_RH->gisprompt = "old,cell,raster";
- input_RH->description = _("Name of Relative Umidity raster map [%]");
+ input_u2 = G_define_standard_option(G_OPT_R_INPUT);
+ input_u2->key = "ws";
+ input_u2->description = _("Name of input wind speed raster map [m/s]");
- input_u2 = G_define_option();
- input_u2->key = "WS";
- input_u2->type = TYPE_STRING;
- input_u2->required = YES;
- input_u2->gisprompt = "old,cell,raster";
- input_u2->description = _("Name of Wind Speed raster map [m/s]");
-
- input_Rn = G_define_option();
- input_Rn->key = "NSR";
- input_Rn->type = TYPE_STRING;
- input_Rn->required = YES;
- input_Rn->gisprompt = "old,cell,raster";
+ input_Rn = G_define_standard_option(G_OPT_R_INPUT);
+ input_Rn->key = "nsr";
input_Rn->description =
- _("Name of Net Solar Radiation raster map [MJ/m2/h]");
+ _("Name of input net solar radiation raster map [MJ/m2/h]");
- input_hc = G_define_option();
- input_hc->key = "Vh";
- input_hc->type = TYPE_STRING;
- input_hc->required = YES;
- input_hc->gisprompt = "old,cell,raster";
- input_hc->description = _("Name of crop height raster map [m]");
+ input_hc = G_define_standard_option(G_OPT_R_INPUT);
+ input_hc->key = "vh";
+ input_hc->description = _("Name of input crop height raster map [m]");
- output = G_define_option();
- output->key = "EPo";
- output->type = TYPE_STRING;
- output->required = YES;
- output->gisprompt = "new,cell,raster";
- output->description =
- _("Name of output Reference Potential Evapotranspiration layer [mm/h]");
+ output = G_define_standard_option(G_OPT_R_OUTPUT);
+ _("Name for output raster map [mm/h]");
- /* 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");
+ zero->description = _("Set negative evapo to zero");
day = G_define_flag();
day->key = 'n';
- day->description = _("night-time");
+ day->description = _("Use Night-time");
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -144,13 +115,6 @@
d_night = FALSE;
}
- /* check legal output name */
- if (G_legal_filename(EPo) < 0)
- G_fatal_error(_("[%s] is an illegal name"), EPo);
-
- /* determine the input map type (CELL/FCELL/DCELL) */
- //data_type = G_raster_map_type(T, mapset);
-
infd_T = Rast_open_old(T, "");
infd_RH = Rast_open_old(RH, "");
infd_u2 = Rast_open_old(u2, "");
More information about the grass-commit
mailing list