repo.or.cz
/
WRF.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
Update version info for release v4.6.1 (#2122)
[WRF.git]
/
chem
/
KPP
/
kpp
/
kpp-2.1
/
util
/
UpdateSun.m
blob
dbfab58abce4d16649691671d5f82a0c22add22a
1
function Update_SUN( )
2
3
global TIME SUN
4
5
SunRise = 4.5;
6
SunSet = 19.5;
7
Thour = TIME/3600.;
8
Tlocal = Thour - floor(Thour/24)*24;
9
10
if ( (Tlocal>=SunRise) & (Tlocal<=SunSet) )
11
Ttmp = (2.0*Tlocal-SunRise-SunSet)/(SunSet-SunRise);
12
if (Ttmp>0)
13
Ttmp = Ttmp*Ttmp;
14
else
15
Ttmp = -Ttmp*Ttmp;
16
end
17
SUN = ( 1.0 + cos(pi*Ttmp) )/2.0 ;
18
else
19
SUN = 0.0;
20
end
21
22
return % Update_SUN
23