Last change
on this file since 4797 was
2696,
checked in by kanani, 7 years ago
|
Merge of branch palm4u into trunk
|
File size:
704 bytes
|
Line | |
---|
1 | SUBROUTINE Update_SUN() |
---|
2 | !USE KPP_ROOT_Parameters |
---|
3 | !USE KPP_ROOT_Global |
---|
4 | |
---|
5 | IMPLICIT NONE |
---|
6 | |
---|
7 | KPP_REAL :: SunRise, SunSet |
---|
8 | KPP_REAL :: Thour, Tlocal, Ttmp |
---|
9 | ! PI - Value of pi |
---|
10 | KPP_REAL, PARAMETER :: PI = 3.14159265358979d0 |
---|
11 | |
---|
12 | SunRise = 4.5_dp |
---|
13 | SunSet = 19.5_dp |
---|
14 | Thour = TIME/3600.0_dp |
---|
15 | Tlocal = Thour - (INT(Thour)/24)*24 |
---|
16 | |
---|
17 | IF ((Tlocal>=SunRise).AND.(Tlocal<=SunSet)) THEN |
---|
18 | Ttmp = (2.0*Tlocal-SunRise-SunSet)/(SunSet-SunRise) |
---|
19 | IF (Ttmp.GT.0) THEN |
---|
20 | Ttmp = Ttmp*Ttmp |
---|
21 | ELSE |
---|
22 | Ttmp = -Ttmp*Ttmp |
---|
23 | END IF |
---|
24 | SUN = ( 1.0_dp + COS(PI*Ttmp) )/2.0_dp |
---|
25 | ELSE |
---|
26 | SUN = 0.0_dp |
---|
27 | END IF |
---|
28 | |
---|
29 | END SUBROUTINE Update_SUN |
---|
30 | |
---|
Note: See
TracBrowser
for help on using the repository browser.