-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspheroid_ti.c
46 lines (23 loc) · 1.16 KB
/
spheroid_ti.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*******************************************************************/
/* spheroid_ti.c ->void SPHEROID_TI(in,out) */
/* Jing M. Chen, [email protected] */
/* Sylvain G. Leblanc [email protected] */
/*******************************************************************/
/* Subroutine that calculates sunlit crown proportion */
/* for deciduous (spheroid) shape (based on Li & Strahler ) */
/* Latest update June 4, 1996 */
/*******************************************************************/
# include <stdio.h>
# include <math.h>
# include "data.h"
void SPHEROID_TI(in_p,out_p)
struct PARAMETER in_p;
struct RESULT *out_p;
{
double vza_prime,sza_prime,cs_prime;
vza_prime = atan(in_p.Hb/(2*in_p.R)*tan(out_p->vza));
sza_prime = atan(in_p.Hb/(2*in_p.R)*tan(in_p.SZA));
cs_prime = cos(sza_prime)*cos(vza_prime) +
sin(sza_prime)*sin(vza_prime)*cos(out_p->phi);
out_p->tib = out_p->tab*0.5*(1.+ cs_prime);
}