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

IrrigationTable.h

Go to the documentation of this file.
00001 #ifndef _IRRIGATIONTABLE_ 
00002 #include "CommonTable.h"
00003 #include "IrrigationEfficiency.h"
00004 
00005 #define _IRRIGATIONTABLE_ 
00006 class TimeHandler;
00007 
00008 // Extracted from first part of WASIM-file modef.h
00009 
00010 #include <iostream>
00011 #include <iomanip>
00012 #include <cstdio>
00013 #include <vector>
00014 #include <string.h>
00015 
00016 #include"MatrixDouble.h"        
00017 using namespace std; 
00018 #define _MAXCHAR_ 200
00019 
00020 typedef void (*functionpointer) (int);
00021 
00022 
00023 class irrigationtabletype 
00024 { 
00025         public:
00026   int     Code;    /* Code for the corresponding grid containing irrigation codes */
00027   char   *Name;    /* name of the land use/crop type or other to be irrigated */
00028   //string  strName;
00029   int     methode; /* 0=no irrigation, 1=irrigation from table, 2=irrigation according to demand (optimal management) */
00030   int     origin;  /* 1=from groundwater, 2=from rivers/lakes/reservoirs (surface water) */ 
00031   double  psi_dry, /* maximum allowed suction */
00032           psi_wet; /* suction to which soil is irrigated if psi was below psi_dry */
00033   int     tabcnt;  /* if irrigation control according to a irrigation table, this is the number of entries in this table */
00034   
00035   // Redefinition of daily irrigation plan, as read from control file and interpolated.
00036   // ... Parallel structure. Works, is already read in. The original structure is not 
00037   // ... yet switched off in irrigation module, so data is read in from  
00038   // ... irrigationtable.amount[indexDay].
00039   // ... This part is actually still fully redundant!
00040   MatrixDouble matrixMonths;
00041   MatrixDouble matrixDays;
00042   MatrixDouble matrixAmount;
00043   
00044   
00045   bool isSpecifiedIrrigationMethod;
00046   IrrigationEfficiency efficiency;
00047   
00048   long   *month,   
00049          *day;     /* date of irrigation, month and day are arrays with dimension of "tabcnt" */
00050   double *amount;  /* array for the amounts of irrigation water for each irrigation termin */
00051   
00052   irrigationtabletype();
00053 
00054   ~irrigationtabletype();
00055   void allocateVectors(int lenVect);
00056   
00057   // Get Functions
00058   int  getCode() const {return Code;}
00059   string getName() const  
00060   { string s=Name; return s;  }
00061   
00062   bool efficiencyIsSpecified() {return isSpecifiedIrrigationMethod;}
00063   void printToScreen();
00064   int getMethod()       {return methode;};
00065   int getOrigin()       {return origin;};
00066   
00067   
00068 };
00069 
00070 
00071 int  GetIrrigTable(irrigationtabletype *&IRRIGtable);
00072 int  GetIrrigTable(string dateinameein, irrigationtabletype *&irrigationtable);
00073 int  GetIrrigTableFromStream( ostream*& WSstream, FILE*& steuerdatei,   irrigationtabletype *&IRRIGtable);
00074 
00075 void irrigationTable_errorOutput( ostream*& WSstream, string name, string subStr);
00076 void addIrrigationEfficiencyToIrrgationTable(
00077                 ostream*& WSstream, 
00078                 int usenr,
00079                 irrigationtabletype *&IRRIGtable, 
00080                 int numEntriesIrrigationMethods, 
00081                 IrrigationEfficiency*& irrigEfficiencyArray);
00082 
00083 void irrigationtable_error(int i);
00084 
00085 void WriteIrrigTable(string filenameOut, irrigationtabletype *&irrigationtable);
00086 void writeSingleSet(ofstream& stream , int startmonth, int startday, double startamount, int endmonth, int endday, double endamount, int deltaDays);
00087 
00088 void  writeIrrigationTableFromMatrixAndString(string fn, MatrixDouble& vectorCropIDs, MatrixDouble& indexValueAndColumn, MatrixDouble& monthlyWaterRequirements, string*& strNames, TimeHandler& timeHandlerLocal);
00089 
00090 #endif

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