source: palm/trunk/UTIL/chemistry/gasphase_preproc/kpp/util/UpdateSun.c @ 2898

Last change on this file since 2898 was 2696, checked in by kanani, 7 years ago

Merge of branch palm4u into trunk

File size: 469 bytes
Line 
1void Update_SUN()
2{
3KPP_REAL SunRise, SunSet;
4KPP_REAL Thour, Tlocal, Ttmp; 
5const KPP_REAL PI = 3.14159265358979; 
6
7  SunRise = 4.5;
8  SunSet  = 19.5;
9  Thour = TIME/3600.0;
10  Tlocal = Thour - ((int)Thour/24)*24;
11
12  if ( (Tlocal >= SunRise) && (Tlocal <= SunSet) ) {
13    Ttmp = (2.0*Tlocal-SunRise-SunSet)/(SunSet-SunRise);
14    if (Ttmp > 0) Ttmp =  Ttmp*Ttmp;
15             else Ttmp = -Ttmp*Ttmp;
16    SUN = ( 1.0 + cos(PI*Ttmp) )/2.0; 
17  } else {
18    SUN=0.0;
19  }
20}
Note: See TracBrowser for help on using the repository browser.