[GRASS-SVN] r30928 - grass-addons/gipe/i.eb.h_SEBAL95
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Apr 11 02:39:44 EDT 2008
Author: ychemin
Date: 2008-04-11 02:39:44 -0400 (Fri, 11 Apr 2008)
New Revision: 30928
Added:
grass-addons/gipe/i.eb.h_SEBAL95/dtair_0.c
Log:
Added variable Tsoil-Tair initialization function
Added: grass-addons/gipe/i.eb.h_SEBAL95/dtair_0.c
===================================================================
--- grass-addons/gipe/i.eb.h_SEBAL95/dtair_0.c (rev 0)
+++ grass-addons/gipe/i.eb.h_SEBAL95/dtair_0.c 2008-04-11 06:39:44 UTC (rev 30928)
@@ -0,0 +1,44 @@
+#include<stdio.h>
+#include<math.h>
+#include"functions.h"
+
+/* Pixel-based input required are: tempk water & desert
+ * additionally, dtair in Desert is vaguely initialized
+ */
+#define ZERO 273.15
+
+double dt_air_0(double t0_dem, double tempk_water, double tempk_desert)
+{
+ double a, b, result;
+ double dtair_desert_0;
+
+ if(tempk_desert > (ZERO+48.0)){
+ dtair_desert_0 = 13.0;
+ } else if(tempk_desert >= (ZERO+40.0) && tempk_desert < (ZERO+48.0)){
+ dtair_desert_0 = 10.0;
+ } else if(tempk_desert >= (ZERO+32.0) && tempk_desert < (ZERO+40.0)){
+ dtair_desert_0 = 7.0;
+ } else if(tempk_desert >= (ZERO+25.0) && tempk_desert < (ZERO+32.0)){
+ dtair_desert_0 = 5.0;
+ } else if(tempk_desert >= (ZERO+18.0) && tempk_desert < (ZERO+25.0)){
+ dtair_desert_0 = 3.0;
+ } else if(tempk_desert >= (ZERO+11.0) && tempk_desert < (ZERO+18.0)){
+ dtair_desert_0 = 1.0;
+ } else {
+ dtair_desert_0 = 0.0;
+// printf("WARNING!!! dtair_desert_0 is NOT VALID!\n");
+ }
+
+// printf("dtair0 = %.0f K\t",dtair_desert_0);
+
+ a = (dtair_desert_0-0.0)/(tempk_desert-tempk_water);
+ b = 0.0 - a * tempk_water;
+
+// printf("dt_air_0(a) = %5.3f Tempk(b) %5.3f\n",a,b);
+
+ result = t0_dem * a + b;
+// printf("dt_air_0 = %5.3f\n",result);
+
+ return result;
+}
+
More information about the grass-commit
mailing list