-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpl_tstr.f90
77 lines (59 loc) · 2.47 KB
/
pl_tstr.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 pl_tstr
!! ~ ~ ~ PURPOSE ~ ~ ~
!! computes temperature stress for crop growth - strstmp
!! ~ ~ ~ INCOMING VARIABLES ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! t_base(:) |deg C |minimum temperature for plant growth
!! t_opt(:) |deg C |optimal temperature for plant growth
!! tmp_an(:) |deg C |average annual air temperature
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ OUTGOING VARIABLES ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ LOCAL DEFINITIONS ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! rto |
!! tgx |
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ SUBROUTINES/FUNCTIONS CALLED ~ ~ ~
!! Intrinsic: Exp
!! ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~
use climate_module
use plant_data_module
use hru_module, only : ihru, ipl, iwgen
use plant_module
implicit none
integer :: j !none |HRU number
integer :: idp ! |
real :: tgx ! |
real :: rto !none |cloud cover factor
j = ihru
idp = pcom(j)%plcur(ipl)%idplt
tgx = w%tave - pldb(idp)%t_base
if (tgx <= 0.) then
pcom(j)%plstr(ipl)%strst = 0.
else
if (w%tave > pldb(idp)%t_opt) then
tgx = 2. * pldb(idp)%t_opt - pldb(idp)%t_base - w%tave
end if
rto = 0.
rto = ((pldb(idp)%t_opt - w%tave) / (tgx + 1.e-6)) ** 2
if (rto <= 200. .and. tgx > 0.) then
pcom(j)%plstr(ipl)%strst = Exp(-0.1054 * rto)
else
pcom(j)%plstr(ipl)%strst = 0.
end if
if(w%tmin <= wgn_pms(iwgen)%tmp_an - 15.) pcom(j)%plstr(ipl)%strst = 0.
end if
!! APEX temperature stress equation
rto = (w%tave - pldb(idp)%t_base) / (pldb(idp)%t_opt - pldb(idp)%t_base)
if (rto > 0. .or. rto < 2.) then
pcom(j)%plstr(ipl)%strst = Sin(1.5707 * rto)
else
pcom(j)%plstr(ipl)%strst = 0.
end if
return
end subroutine pl_tstr