-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcalculate_td.F90
85 lines (67 loc) · 2.45 KB
/
calculate_td.F90
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
subroutine calculate_td (sib, midmon, curNDVI)
! Calls mapper for each sib point. Mapper calculates the time dependent
! boundary condition data. This data is then assigned to appropriate
! variables.
! CREATED BY:
! Owen Leonard August 10, 2001
! MODIFICATIONS:
! SUBROUTINES CALLED:
! FUNCTIONS CALLED:
use sibtype
use sib_const_module
use sib_bc_module
use kinds
implicit none
! parameters
type(sib_t), dimension(subcount), intent(inout) :: sib
real(kind=real_kind), intent (in) :: midmon ! middle of month
!ndvi variables (local)
real(kind=real_kind), dimension(subcount), intent(in) :: curndvi
! local variables
integer(kind=int_kind) :: i,k ! index variable
real(kind=real_kind) :: temptran (2,2)
real(kind=real_kind) :: tempref (2,2)
type time_dep_var
real(kind=real_kind) :: fpar ! canopy absorbed fraction of par
real(kind=real_kind) :: lai ! leaf-area index
real(kind=real_kind) :: green ! canopy greeness fraction of lai
real(kind=real_kind) :: zo ! canopy roughness coeff
real(kind=real_kind) :: zp_disp ! zero plane displacement
real(kind=real_kind) :: rbc ! rb coefficient (c1)
real(kind=real_kind) :: rdc ! rc coefficient (c2)
real(kind=real_kind) :: gmudmu ! time-mean leaf projection
end type time_dep_var
type(time_dep_var) :: timevar
type(aero_var) :: tempaerovar(50,50)
do i = 1, subcount
k = int(sib(i)%param%biome)
!itb_crop...
if(sib(i)%param%biome >= 20.0) k = 12
!itb_crop...
temptran = sib(i)%param%tran(:,:)
tempref = sib(i)%param%ref(:,:)
tempaerovar = aerovar(:,:,k)
call mapper( &
latsib(subset(i)),&
midmon, &
prevndvi(i), &
curndvi(i), &
sib(i)%param%vcover, &
sib(i)%param%chil, &
temptran, &
tempref, &
morphtab(k), &
tempaerovar, &
laigrid, &
fvcovergrid, &
timevar)
sib(i)%param%aparc2 = timevar%fpar
sib(i)%param%zlt2 = timevar%lai
sib(i)%param%green2 = timevar%green
sib(i)%param%z0d2 = timevar%zo
sib(i)%param%zp_disp2 = timevar%zp_disp
sib(i)%param%rbc2 = timevar%rbc
sib(i)%param%rdc2 = timevar%rdc
sib(i)%param%gmudmu2 = timevar%gmudmu
enddo
end subroutine calculate_td