Subversion Repositories public iLand

Rev

Rev 1221 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1
 
15 Werner 2
#ifndef SolarRadiation_H
3
#define SolarRadiation_H
4
//---------------------------------------------------------------------------
5
 
6
class HemiGrid;
7
/** Handles sun and radiation calculations.
8
  This class contains functions to calculate daylength, and hemipherical radiation intensities
9
  based on latitude. */
10
class SolarRadiation
11
{
12
public:
13
        SolarRadiation():  mMinDay(-1), mMaxDay(367), mDiffusRadFraction(0.5) {}
14
        void Setup(double BreiteGrad);
15
 
16
        /** calculate radiation matrix.
17
          calculates for each sector of the "Grid" the yearly radiation intensites.
18
          Intensities are influenced by latitude, vegetation period and the fraction of diffuse radiation.
19
          @param Step_deg size of one cell in degree (e.g. 5 -> each pixel has a size of 5°x5°)
20
          @param Grid results are stored in that HemiGrid (no setup required)    */
21
        void calculateRadMatrix(const float Step_deg, HemiGrid &Grid);
22
        /// set fraction of diffuse radiation (1: only diffuse rad, 0: only direct rad)
23
        void setDiffusRadFraction(double fraction_of_diffus_rad) { mDiffusRadFraction = fraction_of_diffus_rad; }
24
        /// set latitude in degree
25
        void setLatidude(const double lat_degree) { Latitude = lat_degree * M_PI/180.; }
26
        void setVegetationPeriod(int day_start, int day_end) { mMinDay=day_start; mMaxDay=day_end; }
27
private:
28
        int  FTime; ///< time of day
29
        double DayLength[366]; ///< length of day (seconds)
30
        double RadExtraTerrestrisch[366]; ///< total radiation Extraterrestrisch kJ/m2 daysum
31
        double SolarConstant; ///< radiation constant in space
32
        double Latitude;    ///< Latitude in rad
33
        int mMinDay; ///< start of vegetation period (day)
34
        int mMaxDay; ///< end of vegetation period (day)
35
        double mDiffusRadFraction;
36
        void calcDay(int day);
37
        ///< calculate daylength and daily radiation values
38
};
39
 
40
#endif