source: tags/ORCHIDEE_1_9_6/ORCHIDEE/src_stomate/lpj_constraints.f90 @ 880

Last change on this file since 880 was 720, checked in by didier.solyga, 12 years ago

Add svn headers for all modules. Improve documentation of the parameters. Replace two values by the corresponding parameters.

  • Property svn:keywords set to HeadURL Date Author Revision
File size: 5.6 KB
Line 
1! determine whether a PFT is adapted and can regenerate
2!
3!< $HeadURL$
4!< $Date$
5!< $Author$
6!< $Revision$
7! IPSL (2006)
8!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC
9!
10MODULE lpj_constraints
11
12  ! modules used:
13
14  USE ioipsl
15  USE stomate_data
16  USE constantes
17  USE pft_parameters
18
19  IMPLICIT NONE
20
21  ! private & public routines
22
23  PRIVATE
24  PUBLIC constraints,constraints_clear
25
26  ! first call
27  LOGICAL, SAVE                                    :: firstcall = .TRUE.
28CONTAINS
29
30
31  SUBROUTINE constraints_clear
32    firstcall = .TRUE. 
33  END SUBROUTINE constraints_clear
34
35  SUBROUTINE constraints (npts, dt, &
36       t2m_month, t2m_min_daily, when_growthinit, &
37       adapted, regenerate)
38
39    !
40    ! 0 declarations
41    !
42
43    ! 0.1 input
44
45    ! Domain size
46    INTEGER(i_std), INTENT(in)                        :: npts
47    ! time step (in days)
48    REAL(r_std), INTENT(in)                           :: dt
49    ! "monthly" 2-meter temperature (K)
50    REAL(r_std), DIMENSION(npts), INTENT(in)          :: t2m_month
51    ! Daily minimum 2-meter temperature (K)
52    REAL(r_std), DIMENSION(npts), INTENT(in)          :: t2m_min_daily
53    ! how many days ago was the beginning of the growing season
54    REAL(r_std), DIMENSION(npts,nvm), INTENT(in)     :: when_growthinit
55
56    ! 0.2 output fields
57
58    ! Winter too cold? between 0 and 1
59    REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)  :: adapted
60    ! Winter sufficiently cold? between 0 and 1
61    REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)  :: regenerate
62
63    ! 0.3 local
64
65    ! Memory length for adaption (d)
66    REAL(r_std)                                       :: tau_adapt
67    ! Memory length for regeneration (d)
68    REAL(r_std)                                       :: tau_regenerate 
69    ! critical value of "regenerate" below which plant dies
70    REAL(r_std)                                       :: regenerate_min
71    ! index
72    INTEGER(i_std)                                    :: j
73
74    ! =========================================================================
75
76    IF (bavard.GE.3) WRITE(numout,*) 'Entering constraints'
77
78    !
79    ! 1 Initializations
80    !
81    tau_adapt = one_year
82    tau_regenerate = one_year
83    !
84    ! 1.1 Messages
85    !
86
87    IF ( firstcall ) THEN
88
89       WRITE(numout,*) 'constraints:'
90
91       WRITE(numout,*) '   > Memory length for adaption (d): ',tau_adapt
92       WRITE(numout,*) '   > Memory length for regeneration (d): ',tau_regenerate
93       WRITE(numout,*) '   > Longest sustainable time without vernalization (y):', too_long
94       WRITE(numout,*) '   > For trees, longest sustainable time without growth init (y):', &
95            too_long
96
97       firstcall = .FALSE.
98
99    ENDIF
100
101    !
102    ! 1.2 critical value for "regenerate": below this value, the last vernalization
103    !     belong to a too distant past. PFT is then not adapted.
104    !
105
106    regenerate_min = exp ( - too_long * one_year / tau_regenerate )
107
108    !
109    ! 2 Loop over all PFTs
110    !
111
112    DO j = 2,nvm
113
114       IF ( natural(j) .OR. agriculture ) THEN
115
116          !
117          ! 2.1 climate criteria
118          !
119
120          ! 2.1.1 Test if PFT is adapted: check daily temperature.
121          !       If too cold, PFT is not adapted.
122
123          IF ( tmin_crit(j) .EQ. undef ) THEN
124
125             ! 2.1.1.1 some PFTs always survive.
126
127             adapted(:,j) = un
128
129          ELSE
130
131             ! 2.1.1.2 frost-sensitive PFTs
132
133             WHERE ( t2m_min_daily(:) .LT. tmin_crit(j) )
134                adapted(:,j) = zero
135             ENDWHERE
136
137             ! limited memory: after some time, the cold shock is forgotten.
138             !  ( adapted will approach 1)
139
140             adapted(:,j) = un - ( un - adapted(:,j) ) * (tau_adapt- dt)/tau_adapt
141
142          ENDIF
143
144          !
145          ! 2.1.2 seasonal trees die if leafage does not show a clear seasonality.
146          !       (i.e. if the start of the growing season is never detected).
147          !
148
149          IF ( tree(j) .AND. ( pheno_model(j) .NE. 'none' ) ) THEN
150
151             WHERE ( when_growthinit(:,j) .GT. too_long*one_year .AND. when_growthinit(:,j).LT. large_value)
152                adapted(:,j) = zero
153             ENDWHERE
154
155          ENDIF
156
157          ! 2.1.3 Test if PFT is regenerative
158          !       check monthly temperature. If sufficiently cold, PFT will be able to
159          !       regenerate for some time.
160
161          IF ( tcm_crit(j) .EQ. undef ) THEN
162
163             ! 2.1.3.1 several PFTs (ex: evergreen) don't need vernalization
164
165             regenerate(:,j) = un
166
167          ELSE
168
169             ! 2.1.3.2 PFT needs vernaliztion
170
171             WHERE ( t2m_month(:) .LE. tcm_crit(j) )
172                regenerate(:,j) = un
173             ENDWHERE
174
175             ! limited memory: after some time, the winter is forgotten.
176             !  (regenerate will approach 0)
177
178             regenerate(:,j) = regenerate(:,j) * (tau_regenerate-dt)/tau_regenerate
179
180          ENDIF
181
182          ! 2.1.4 Plants that need vernalization die after a few years if they don't
183          !       vernalize (even if they would not loose their leaves).
184
185          WHERE ( regenerate(:,j) .LE. regenerate_min )
186             adapted(:,j) = zero
187          ENDWHERE
188
189       ELSE
190
191          !
192          ! 2.2 PFT is not natural and agriculture is not allowed -> remove
193          !
194
195          adapted(:,j) = zero
196
197          regenerate(:,j) = zero
198
199       ENDIF
200
201    ENDDO
202
203    CALL histwrite (hist_id_stomate, 'ADAPTATION', itime, &
204         adapted, npts*nvm, horipft_index)
205    CALL histwrite (hist_id_stomate, 'REGENERATION', itime, &
206         regenerate, npts*nvm, horipft_index)
207
208    IF (bavard.GE.4) WRITE(numout,*) 'Leaving constraints'
209
210  END SUBROUTINE constraints
211
212END MODULE lpj_constraints
Note: See TracBrowser for help on using the repository browser.