-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaddinc.F90
77 lines (64 loc) · 2.67 KB
/
addinc.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
!-SUBROUTINE: addinc-------------------------------------------------
subroutine addinc ( sib, sib_loc )
use kinds
use sibtype
use physical_parameters, only: cp => spec_heat_cp
implicit none
!-Parameters-----------------------------------------------------
type(sib_t), intent(inout) :: sib
type(sib_local_vars), intent(inout) :: sib_loc
!-Local Variables------------------------------------------------
integer(kind=int_kind) :: j
!----------------------------------------------------------------
!
! Add prognostic variable increments to prognostic variables and
! diagnose heat fluxes and mixing ratios.
!
!----------------------------------------------------------------
!
! OUTPUT
!
! tc Canopy Temperature (K)
! tg Ground Surface Temperature (K)
! ta CAS Temperature (K)
! ea CAS Vapro Preassure (hPa or mb)
! td Deep Siol Temperature (K)
! fss CAS to Mixed Layer Sensible Heast Flux (W m^-2)
! fws CAS to Mixed Layer Latent Heat Flux (W m^-2)
! sh Mixed Layer Mixing Ratio (kg/kg)
! sha CAS Mixing Ratio (kg/kg)
!
!----------------------------------------------------------------
sib%prog%tc = sib%prog%tc + sib_loc%dtc
sib%prog%tg = sib%prog%tg + sib_loc%dtg
sib%prog%ta = sib%prog%ta + sib_loc%dta
sib%prog%ea = sib%prog%ea + sib_loc%dea
if ( sib%prog%tc < 0.0 .or. sib%prog%tg < 0.0 .or. &
sib%prog%ta < 0.0 .or. sib%prog%ea < 0.0 ) then
print *, 'point',sib%stat%pt_num
print *, 'BAD ta OR ea VALUE:'
print *, 'tc: ', sib%prog%tc-sib_loc%dtc, sib%prog%tc
print *, 'tg: ', sib%prog%tg-sib_loc%dtg, sib%prog%tg
print *, 'ta: ', sib%prog%ta-sib_loc%dta, sib%prog%ta
print *, 'ea: ', sib%prog%ea-sib_loc%dea, sib%prog%ea
print *, ''
endif
! Calcluate latent and sensible fluxes between CAS and
! mixed (boundary) layer
sib%diag%fss = sib%prog%ros * cp * (sib%prog%ta - sib%prog%tm) / &
sib%diag%ra
sib%diag%fws = (sib%prog%ea - sib%prog%em) / sib%diag%ra * cp * &
sib%prog%ros / sib%diag%psy
! Recalculate mixing ratios
sib%prog%sh = 0.622 / (sib%prog%ps / sib%prog%em - 1.)
sib%prog%sha = 0.622 / (sib%prog%ps / sib%prog%ea - 1.)
do j = sib%prog%nsl+1, nsoil
sib%prog%td(j) = sib%prog%td(j) + sib_loc%dtd(j)
enddo
!itb_crop...accumulate the CAS temperature for calculating Ta_bar
sib%diag%tb_indx = sib%diag%tb_indx + 1
sib%diag%tb_temp = sib%diag%tb_temp + sib%prog%ta
sib%diag%tb_assim = sib%diag%tb_assim + sib%diag%assim(6)
!daily accumulation of assim
sib%diag%tb_rst = sib%diag%tb_rst + sib%diag%rstfac(2)
end subroutine addinc