Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

LandUseTable.h

Go to the documentation of this file.
00001 #ifndef _LANDUSETABLE_ 
00002 
00003 #define _LANDUSETABLE_ 
00004 class TimeHandler;
00005 #include "CommonTable.h"
00006 
00007 // Extracted from first part of WASIM-file modef.h
00008 
00009 #include <iostream>
00010 #include <iomanip>
00011 #include <cstdio>
00012 #include <vector>
00013 #include <string.h>
00014 
00015 
00016 #include"MatrixDouble.h"        
00017 
00018 using namespace std; 
00019 
00020 #define _MAXCHAR_ 200
00021 
00022 typedef void (*functionpointer) (int);
00023 
00024 
00025 
00026 struct KcMonthlyValuesStruct
00027 {
00028   MatrixDouble kcForAllMonth; 
00029   int code;
00030   char nameAct[100];        
00031   float cutoffFactor;
00032 };
00033 
00034 
00035 
00036 class LUSEtabletype:
00037 public CommonTableType
00038 {
00039         
00040 private:
00041   int method;
00042   
00043         int ID_cropwatTable;
00044         bool flag_useCropwatTable;
00045         KcMonthlyValuesStruct kcMonthly;
00046         
00047   int iNumFixPoints;
00048   int *days;          /* St?tzstellen der Jahresgang-Kurve */
00049   int *daystemp;        /* nach H?he korrigierten aktuellen St?tzstellen */
00050   float *rsc,     /* minimal canopy-resistance der Landnutzung als Monatswerte */
00051             *rsi,     /* minimal interception-resistance der Landnutzung als Monatswerte */
00052                 *rse,     /* minimal soil-resistance der Landnutzung als Monatswerte */
00053                 *albedo,  /* albedo if no snow is covering the crops                     */
00054         *LAI,     /* Blattflaechenindizes an den 4 Knickpunkten des Jahresganges */
00055         *z0,      /* effektive Bewuchshoehe der Landnutzung zu den Knickpunkten  */
00056         *Vbg,     /* Vegetationsbedeckung der Landnutzung an den Knickpunkten    */
00057         *Wurz,    /* Wurzeltiefe der Landnutzung                                 */
00058                 *AltDep;  /* Altitude dependency in days per m                           */
00059   float form_par, /* Wurzeldichte fuer Entnahmefunktion 0...                     */
00060         redu_parDry, /* ab welcher Bodenfeuchte im Trockenbereich beginnt Verdunstungsreduktion einlesen als suction in m, Umrechnen auf absolten Wassergehalt Theta */
00061                 redu_parWet, /* ab welcher Bodenfeuchte im Nassbereich beginnt Verdunstungsreduktion, einlesen als relativer Wassergehalt (0..1), Umrechnen auf absoluten Wassergehalt Theta */
00062                 LimitReduWet; /* minimal relative reduction of real transpiration when water content reaches saturation. The reduction factor value will go down linearly starting at 1.0 when relative Theta equals TReduWet (e.g. 0.95) to LimitReduWet when the soil is saturated (Theta rel = 1.0) */
00063   float m_fIntercepStor; // specific interception storage capacity in mm -> will be multiplied by LAI to get the effektive storage capacity
00064   int mon[14];
00065   
00066 public:
00067   LUSEtabletype(int index);
00068   LUSEtabletype(); // defaultconstructor
00069   ~LUSEtabletype();
00070 private:
00071   float interpolate(double x1,double y1,double x2,double y2,double x);
00072   int GetJulDay(int iMonthDay,int iMonth,int iYear);
00073   void AltitudeCorrection(float dhm);
00074   int GetFixPoint(int iJulDay,float height);
00075   void stripParameters(string &row,string sWhatParam,float *param,int maxIndex);
00076   void stripParametersJulDays(string &row);
00077 
00078 public:
00079 
00080   void initialize(ostream *WSstream,string row,int version);
00081   void initialize(ostream *WSstream,string row,string sVersion);
00082 
00083   void initializeKcEmpty();
00084   void deallocateKcStruct();
00085   
00086   float getFormPar();
00087   float getReduParDry();
00088   float getReduParWet();
00089   float getLimitReduWet();
00090   float getIntercepStor();
00091   char* getName();
00092   int   getCode();
00093   void  setCode(int code);
00094   void  printContent();
00095 
00096   bool  getIsActivity();
00097   void printKcMonthlyValuesStruct();
00098   int  getActivityNumberInMPMAS();
00099   void extractActivityNumberFromName();
00100   void readKcMonthlyValuesStruct(FILE* steuer);
00101   double getMonthlyKcValue(int m);
00102   double getCutoffFactor() {return (double) kcMonthly.cutoffFactor;};
00103   
00104   
00105   float GetRsc(int iJulDay, float height=0.0);
00106   float GetRsc(int iMonthDay,int iMonth,int iYear, float height=0.0);
00107 
00108   float GetRsi(int iJulDay, float height=0.0);
00109   float GetRsi(int iMonthDay,int iMonth,int iYear, float height=0.0);
00110 
00111   float GetRse(int iJulDay, float height=0.0);
00112   float GetRse(int iMonthDay,int iMonth,int iYear, float height=0.0);
00113 
00114   float GetZ0(int iJulDay, float height=0.0);
00115   float GetZ0(int iMonthDay,int iMonth,int iYear, float height=0.0);
00116 
00117   float GetLAI(int iJulDay, float height=0.0);
00118   float GetLAI(int iMonthDay,int iMonth,int iYear, float height=0.0);
00119 
00120   float GetVbg(int iJulDay, float height=0.0);
00121   float GetVbg(int iMonthDay,int iMonth,int iYear, float height=0.0);
00122 
00123   float GetWurz(int iJulDay, float height=0.0);
00124   float GetWurz(int iMonthDay,int iMonth,int iYear, float height=0.0);
00125   
00126   float GetAlbedo(int iJulDay, float height);
00127   float GetAlbedo(int iMonthDay,int iMonth, int iYear, float height=0.0);
00128 
00129 };
00130 
00131 
00132 void GetLuseTable(int version,  string , LUSEtabletype*& LUtable);
00133 void GetLuseTable(int version,  LUSEtabletype*& LUtable);
00134 //void GetReferenceTable(int version, string fn,        LUSEtabletype *&LUtable);
00135 
00136 #endif

Generated on Thu Aug 28 12:38:45 2008 for MPMAS by  doxygen 1.3.9.1