forked from adfriend45/RINGS_v3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ZONES.f90
45 lines (45 loc) · 1.73 KB
/
ZONES.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
!======================================================================!
SUBROUTINE ZONES
!----------------------------------------------------------------------!
! Compute zone edge distances from phloem based on year-day and
! daylength (µm).
!----------------------------------------------------------------------!
USE DOUBLE
USE PARAMS ! MODULE declaring model parameters.
USE STATE ! MODULE declaring model variables.
USE ENVIRON
!----------------------------------------------------------------------!
IMPLICIT NONE
!----------------------------------------------------------------------!
REAL(DP) :: a_ez
REAL(DP) :: b_ez
!----------------------------------------------------------------------!
IF (kday < 185) THEN
IF (dorm) THEN
pz = pz_a + pz_b * dlength (kday)
ez = pz
ELSE
pz = pz_a + pz_b * dlength (185)
!-----------------------------------------------------------------!
! Slope.
!-----------------------------------------------------------------!
b_ez = ((ez_a + ez_b * dlength(210)) - &
(ez_a + ez_b * dlength(185))) / &
(210.0_DP - 185.0_DP + 1.0_DP)
!-----------------------------------------------------------------!
! Intercept.
!-----------------------------------------------------------------!
a_ez = (ez_a + ez_b * dlength(185)) - b_ez * FLOAT(185)
ez = a_ez + b_ez * FLOAT(kday)
!-----------------------------------------------------------------!
END IF
ELSE
pz = pz_a + pz_b * dlength (kday)
ez = ez_a + ez_b * dlength (kday)
END IF
pz = MAX (pz_min, pz)
ez = MAX (pz , ez)
tz = MAX (ez , tz_a + tz_b * dlength (kday))
!----------------------------------------------------------------------!
END SUBROUTINE ZONES
!======================================================================!