source: branches/ORCHIDEE_3_CMIP6/ORCHIDEE/src_stomate/lpj_establish.f90 @ 8367

Last change on this file since 8367 was 6008, checked in by josefine.ghattas, 5 years ago

Use area instead of resolution.

  • Property svn:keywords set to HeadURL Date Author Revision
File size: 45.9 KB
Line 
1! =================================================================================================================================
2! MODULE       : lpj_establish
3!
4! CONTACT      : orchidee-help _at_ listes.ipsl.fr
5!
6! LICENCE      : IPSL (2006)
7! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC
8!
9!>\BRIEF        Establish pft's
10!!
11!!\n DESCRIPTION: None
12!!
13!! RECENT CHANGE(S): None
14!!
15!! REFERENCE(S) :
16!! - Sitch, S., B. Smith, et al. (2003), Evaluation of ecosystem dynamics,
17!!        plant geography and terrestrial carbon cycling in the LPJ dynamic
18!!        global vegetation model, Global Change Biology, 9, 161-185.\n
19!! - Haxeltine, A. and I. C. Prentice (1996), BIOME3: An equilibrium
20!!        terrestrial biosphere model based on ecophysiological constraints,
21!!        resource availability, and competition among plant functional types,
22!!        Global Biogeochemical Cycles, 10(4), 693-709.\n
23!! - Smith, B., I. C. Prentice, et al. (2001), Representation of vegetation
24!!        dynamics in the modelling of terrestrial ecosystems: comparing two
25!!        contrasting approaches within European climate space,
26!!        Global Ecology and Biogeography, 10, 621-637.\n
27!!
28!! SVN          :
29!! $HeadURL$
30!! $Date$
31!! $Revision$
32!! \n
33!_ ================================================================================================================================
34
35MODULE lpj_establish
36
37  ! modules used:
38  USE xios_orchidee
39  USE ioipsl_para
40  USE stomate_data
41  USE constantes
42  USE grid
43  USE function_library,    ONLY: biomass_to_lai
44
45  IMPLICIT NONE
46
47  ! private & public routines
48  PRIVATE
49  PUBLIC establish,establish_clear
50
51  LOGICAL, SAVE                          :: firstcall_establish = .TRUE.           !! first call
52!$OMP THREADPRIVATE(firstcall_establish)
53CONTAINS
54
55
56!! ================================================================================================================================
57!! SUBROUTINE   : fire_clear
58!!
59!>\BRIEF       Set the firstcall_establish flag to .TRUE. and activate initialization
60!_ ================================================================================================================================
61
62  SUBROUTINE establish_clear
63    firstcall_establish = .TRUE.
64  END SUBROUTINE establish_clear
65
66
67! =================================================================================================================================
68! SUBROUTINE   : establish
69!
70!>\BRIEF       Calculate sstablishment of new woody PFT and herbaceous PFTs
71!!
72!! DESCRIPTION : Establishments of new woody and herbaceous PFT are simulated.
73!! Maximum establishment rate (0.12) declines due to competition for light (space).
74!! There are two establishment estimates: one for the for DGVM and one for the
75!! static cases.\n
76!! In the case of DGVM, competitive process of establishment for the area of
77!! available space is represented using more detailed description compared with static
78!! one. Biomass and distribution of plant age are updated on the basis of changes
79!! in number of individuals. Finally excess sapwood of is converted to heartwood.
80!!
81!! \latexonly
82!! \input{equation_lpj_establish.tex}
83!! \endlatexonly
84!! \n
85!!
86!! RECENT CHANGE(S): None
87!!
88!! REFERENCE(S)    :
89!! Smith, B., I. C. Prentice, et al. (2001), Representation of vegetation
90!!    dynamics in the modelling of terrestrial ecosystems: comparing two
91!!    contrasting approaches within European climate space,
92!!    Global Ecology and Biogeography, 10, 621-637.
93!!
94!! FLOWCHART       :
95!! \latexonly
96!! \includegraphics[scale = 0.7]{establish.png}
97!! \endlatexonly
98!! \n
99!_ ================================================================================================================================
100 
101  SUBROUTINE establish (npts, dt, PFTpresent, regenerate, &
102       neighbours, resolution, need_adjacent, herbivores, &
103       precip_annual, gdd0, lm_lastyearmax, &
104       cn_ind, lai, avail_tree, avail_grass,  npp_longterm, &
105       leaf_age, leaf_frac, &
106       ind, biomass, age, everywhere, co2_to_bm, &
107       soil_n_min, n_uptake, nstress_season, veget_cov_max, woodmass_ind, &
108       mortality, bm_sapl_2D, bm_to_litter)
109
110    !! 0. Variable and parameter declaration
111   
112    !! 0.1 Input variables
113   
114    INTEGER(i_std), INTENT(in)                                :: npts            !! Domain size - number of pixels (dimensionless)   
115    REAL(r_std), INTENT(in)                                   :: dt              !! Time step of vegetation dynamics for stomate
116                                                                                 !! (days)           
117    LOGICAL, DIMENSION(npts,nvm), INTENT(in)                  :: PFTpresent      !! Is pft there (unitless)   
118    REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: regenerate      !! Winter sufficiently cold (unitless)   
119    INTEGER(i_std), DIMENSION(npts,NbNeighb), INTENT(in)      :: neighbours      !! indices of the neighbours of each grid point
120                                                                                 !! (unitless); 
121                                                                                 !! [1=North and then clockwise] 
122    REAL(r_std), DIMENSION(npts,2), INTENT(in)                :: resolution      !! resolution at each grid point (m); 1=E-W, 2=N-S     
123    LOGICAL, DIMENSION(npts,nvm), INTENT(in)                  :: need_adjacent   !! in order for this PFT to be introduced, does it
124                                                                                 !! have to be present in an adjacent grid box? 
125    REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: herbivores      !! time constant of probability of a leaf to
126                                                                                 !! be eaten by a herbivore (days)     
127    REAL(r_std), DIMENSION(npts), INTENT(in)                  :: precip_annual   !! annual precipitation (mm year^{-1})
128    REAL(r_std), DIMENSION(npts), INTENT(in)                  :: gdd0            !! growing degree days (degree C)
129    REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: lm_lastyearmax  !! last year's maximum leaf mass for each PFT
130                                                                                 !! (gC m^{-2 })
131    REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: cn_ind          !! crown area of individuals (m^2)       
132    REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: lai             !! leaf area index OF an individual plant
133                                                                                 !! (m^2 m^{-2})           
134    REAL(r_std), DIMENSION(npts), INTENT(in)                  :: avail_tree      !! space availability for trees (unitless)     
135    REAL(r_std), DIMENSION(npts), INTENT(in)                  :: avail_grass     !! space availability for grasses (unitless) 
136    REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: npp_longterm    !! longterm NPP, for each PFT (gC m^{-2})   
137    REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: veget_cov_max   !! "maximal" coverage fraction of a PFT
138                                                                                 !! (LAI -> infinity) on ground (unitless)
139    REAL(r_std), DIMENSION(npts,nvm),INTENT(in)               :: mortality       !! Fraction of individual dying this time
140                                                                                 !! step (0 to 1, unitless)
141    REAL(r_std), DIMENSION(npts,nvm,nparts,nelements),INTENT(in)  :: bm_sapl_2D
142
143    !! 0.2 Output variables
144   
145    !! 0.3 Modified variables
146
147    REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout) :: leaf_age        !! leaf age (days)     
148    REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout) :: leaf_frac       !! fraction of leaves in leaf age class (unitless)   
149    REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: ind             !! Number of individuals (individuals m^{-2})         
150    REAL(r_std), DIMENSION(npts,nvm,nparts,nelements), INTENT(inout):: biomass   !! biomass (gC m^{-2 })     
151    REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: age             !! mean age (years)       
152    REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: everywhere      !! is the PFT everywhere in the grid box or very
153                                                                                 !! localized (unitless)   
154    REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: co2_to_bm       !! biomass up take for establishment i.e.
155                                                                                 !! pseudo-photosynthesis (gC m^{-2} day^{-1})
156    REAL(r_std), DIMENSION(npts,nvm,nnspec), INTENT(inout)    :: soil_n_min      !! Nitrogen in mineral soil,   
157 !! (gN/(m**2 of PFT))
158 !! to correct for nitrogen creation associated with establishmnet   
159    REAL(r_std), DIMENSION(npts,nvm,nionspec), INTENT(inout)  :: n_uptake        !! Plant uptake of ammonium and nitrate 
160 !! (gN/m**2/day)
161    REAL(r_std), DIMENSION(npts,nvm), INTENT(in)              :: nstress_season  !! seasonal nitrogen stress 
162 !! (unitless)
163 !! (get's initialised at first establishment)
164    REAL(r_std), DIMENSION(npts,nvm), INTENT(inout)           :: woodmass_ind    !! woodmass of the individual, needed to calculate
165                                                                                 !! crownarea in lpj_crownarea (gC m^{-2 }) 
166    REAL(r_std), DIMENSION(npts,nvm,nparts,nelements), INTENT(inout) :: bm_to_litter !!Biomass transfer to litter
167
168    !! 0.4 Local variables
169
170    REAL(r_std)                                               :: tau_eatup       !! time during which a sapling can be entirely
171                                                                                 !! eaten by herbivores (days)
172    REAL(r_std), DIMENSION(npts,nvm)                          :: fpc_nat         !! new fpc, foliage projective cover: fractional
173                                                                                 !! coverage (unitless)       
174    REAL(r_std), DIMENSION(npts)                              :: estab_rate_max_climate_tree  !! maximum tree establishment rate,
175                                                                                              !! based on climate only (unitless) 
176    REAL(r_std), DIMENSION(npts)                              :: estab_rate_max_climate_grass !! maximum grass establishment rate,
177                                                                                              !! based on climate only (unitless)
178    REAL(r_std), DIMENSION(npts)                              :: estab_rate_max_tree          !! maximum tree establishment rate,
179                                                                                              !! based on climate and fpc
180                                                                                              !! (unitless)
181    REAL(r_std), DIMENSION(npts)                              :: estab_rate_max_grass         !! maximum grass establishment rate,
182                                                                                              !! based on climate and fpc
183                                                                                              !! (unitless)
184    REAL(r_std), DIMENSION(npts)                              :: sumfpc          !! total natural fpc (unitless)
185    REAL(r_std), DIMENSION(npts)                              :: fracnat         !! total fraction occupied by natural
186                                                                                 !! vegetation (unitless) 
187    REAL(r_std), DIMENSION(npts)                              :: sumfpc_wood     !! total woody fpc (unitless)   
188    REAL(r_std), DIMENSION(npts)                              :: spacefight_grass!! for grasses, measures the total concurrence
189                                                                                 !! for available space (unitless)
190    REAL(r_std), DIMENSION(npts,nvm)                          :: d_ind           !! change in number of individuals per time step
191                                                                                 !! (individuals m^{-2} day{-1})         
192    REAL(r_std), DIMENSION(npts,nelements)                    :: bm_new          !! biomass increase (gC m^{-2 })       
193    REAL(r_std), DIMENSION(npts,nvm,nparts,nelements)         :: biomass_old     !! Save the original biomass passed into the subroutine
194    REAL(r_std), DIMENSION(npts,nelements)                    :: bm_non          !! Non-effective establishment: the "virtual" saplings that die instantly
195    REAL(r_std), DIMENSION(npts,nelements)                    :: bm_eff          !! Effective (or real) establishment 
196    REAL(r_std), DIMENSION(npts)                              :: dia             !! stem diameter (m)   
197    REAL(r_std), DIMENSION(npts)                              :: b1              !! temporary variable           
198    REAL(r_std), DIMENSION(npts)                              :: woodmass        !! woodmass of an individual (gC m^{-2}) 
199    REAL(r_std), DIMENSION(npts)                              :: leaf_mass_young !! carbon mass in youngest leaf age class
200                                                                                 !! (gC m^{-2})
201    REAL(r_std), DIMENSION(npts)                              :: factor          !! reduction factor for establishment if many
202                                                                                 !! trees or grasses are present (unitless) 
203    REAL(r_std), DIMENSION(npts,nelements)                    :: total_bm        !! Total carbon (or nitrogen) mass for all pools (gC m^{-2})   
204    REAL(r_std), DIMENSION(npts,nelements)                    :: total_bm_sapl   !! Total sappling biomass for all pools
205                                                                                 !! (gC(orN) m^{-2}) 
206    REAL(r_std), DIMENSION(npts,nelements)                    :: total_bm_sapl_non !! total non-effective sapling biomass
207
208    INTEGER(i_std)                                            :: nfrontx         !! from how many sides is the grid box invaded
209                                                                                 !! (unitless?)   
210    INTEGER(i_std)                                            :: nfronty         !! from how many sides is the grid box invaded
211                                                                                 !! (unitless?)   
212    REAL(r_std), DIMENSION(npts)                              :: vn              !! flow due to new individuals veget_cov_max after
213                                                                                 !! establishment, to get a proper estimate of
214                                                                                 !! carbon and nitrogen
215    REAL(r_std), DIMENSION(npts)                              :: lai_ind         !! lai on each PFT surface (m^2 m^{-2})   
216    REAL(r_std), DIMENSION(npts)                              :: veget_cov_max_tree  !! Sum of veget_cov_max for the pft's which are trees
217    INTEGER(i_std)                                            :: nbtree          !! Number of PFT's which are trees
218    INTEGER(i_std)                                            :: i,j,k,m         !! indices (unitless)       
219    REAL(r_std), DIMENSION(npts)                              :: soil_n_constraint !! Soil inorganic N pool (gN m-2)
220    REAL(r_std), DIMENSION(npts)                              :: ntake           !! total N associated to establishment (gN)
221    REAL(r_std), DIMENSION(npts)                              :: ntake_nitrate   !! nitrate associated to establishment (gN)
222!_ ================================================================================================================================
223
224    IF (printlev>=3) WRITE(numout,*) 'Entering establish'
225
226  !! 1. messages and initialization
227
228    ! time during which young plants can be completely eaten by herbivores after germination
229    ! (and then individual die) assume to be half year   
230    ! No reference
231    tau_eatup = one_year/2.
232   
233    ! Calculate the sum of the vegetation over the tree pft's and the number of pft's which are trees
234    veget_cov_max_tree(:) = 0.0
235    nbtree=0
236    DO j = 1, nvm 
237       IF (is_tree(j)) THEN
238          veget_cov_max_tree(:) = veget_cov_max_tree(:) + veget_cov_max(:,j)
239          nbtree = nbtree + 1
240       END IF
241    END DO
242    ! Set nbtree=1 to avoid zero division later if there are no tree PFT's.
243    ! For that case veget_cov_max_tree=0 so there will not be any impact.
244    IF (nbtree == 0) nbtree=1
245
246    !! 1.1 First call only
247    IF ( firstcall_establish ) THEN
248
249       WRITE(numout,*) 'establish:'
250
251       WRITE(numout,*) '   > time during which a sapling can be entirely eaten by herbivores (d): ', &
252            tau_eatup
253
254       firstcall_establish = .FALSE.
255
256    ENDIF
257
258  !! 2. recalculate fpc
259
260    IF (ok_dgvm) THEN
261       fracnat(:) = un
262
263       !! 2.1 Only natural part of the grid cell
264       do j = 2,nvm ! Loop over # PFTs
265         
266          IF ( .NOT. natural(j) ) THEN
267             fracnat(:) = fracnat(:) - veget_cov_max(:,j)
268          ENDIF
269       ENDDO ! Loop over # PFTs
270       
271       sumfpc(:) = zero
272
273       !! 2.2 Total natural fpc on grid
274       !      The overall fractional coverage of a PFT in a grid is calculated here.
275       !      FPC is related to mean individual leaf area index by the Lambert-Beer law.
276       !      See Eq. (1) in tex file.\n
277       DO j = 2,nvm ! Loop over # PFTs
278          IF ( natural(j) ) THEN
279             WHERE(fracnat(:).GT.min_stomate)
280                WHERE (lai(:,j) == val_exp) 
281                   fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) / fracnat(:)
282                ELSEWHERE
283                   fpc_nat(:,j) = cn_ind(:,j) * ind(:,j) / fracnat(:) & 
284                        * ( un - exp( - biomass_to_lai(lm_lastyearmax(:,j),npts,j)* ext_coeff(j) ) )
285                ENDWHERE
286             ENDWHERE
287
288             WHERE ( PFTpresent(:,j) )
289                sumfpc(:) = sumfpc(:) + fpc_nat(:,j)
290             ENDWHERE
291          ELSE
292
293             fpc_nat(:,j) = zero
294
295          ENDIF
296
297       ENDDO ! Loop over # PFTs
298       
299       !! 2.3 Total woody fpc on grid and number of regenerative tree pfts
300       !      Total woody FPC increases by adding new FPC.
301       !      Under the condition that temperature in last winter is higher than a threshold,
302       !      woody plants is exposed in higher competitive environment.
303       sumfpc_wood(:) = zero
304
305       DO j = 2,nvm ! Loop over # PFTs
306
307          IF ( is_tree(j) .AND. natural(j) ) THEN
308
309             ! total woody fpc
310             WHERE ( PFTpresent(:,j) )
311                sumfpc_wood(:) = sumfpc_wood(:) + fpc_nat(:,j)
312             ENDWHERE
313
314          ENDIF
315
316       ENDDO ! Loop over # PFTs
317
318       !! 2.4 Total number of natural grasses on grid\n
319       !     Grass increment equals 'everywhere'\n
320       spacefight_grass(:) = zero
321
322       DO j = 2,nvm ! Loop over # PFTs
323
324          IF ( .NOT. is_tree(j) .AND. natural(j) ) THEN
325
326             ! Count a PFT fully only if it is present on a grid.
327             WHERE ( PFTpresent(:,j) )
328                spacefight_grass(:) = spacefight_grass(:) + everywhere(:,j)
329             ENDWHERE
330
331          ENDIF
332
333       ENDDO ! Loop over # PFTs
334
335       !! 2.5 Maximum establishment rate, based on climate only\n
336       WHERE ( ( precip_annual(:) .GE. precip_crit ) .AND. ( gdd0(:) .GE. gdd_crit_estab ) )
337
338          estab_rate_max_climate_tree(:) = estab_max_tree ! 'estab_max_*'; see 'stomate_constants.f90'
339          estab_rate_max_climate_grass(:) = estab_max_grass
340
341       ELSEWHERE
342
343          estab_rate_max_climate_tree(:) = zero
344          estab_rate_max_climate_grass(:) = zero
345
346       ENDWHERE
347
348       !! 2.6 Reduce maximum tree establishment rate if many trees are present.
349       !      In the original DGVM, this is done using a step function which yields a
350       !      reduction by factor 4 if sumfpc_wood(i) .GT.  fpc_crit - 0.05.
351       !      This can lead to small oscillations (without consequences however).
352       !      Here, a steady linear transition is used between fpc_crit-0.075 and
353       !      fpc_crit-0.025.
354       !      factor(:) = 1. - 15. * ( sumfpc_wood(:) - (fpc_crit-.075))
355       !      factor(:) = MAX( 0.25_r_std, MIN( 1._r_std, factor(:)))
356       !      S. Zaehle modified according to Smith et al. 2001
357       !      See Eq. (2) in header
358       factor(:)=(un - exp(- establish_scal_fact * (un - sumfpc_wood(:))))*(un - sumfpc_wood(:))
359       estab_rate_max_tree(:) = estab_rate_max_climate_tree(:) * factor(:)
360
361       !! 2.7 Modulate grass establishment rate.
362       !      If canopy is not closed (fpc < fpc_crit-0.05), normal establishment.
363       !      If canopy is closed, establishment is reduced by a factor 4.
364       !      Factor is linear between these two bounds.
365       !      This is different from the original DGVM where a step function is
366       !      used at fpc_crit-0.05 (This can lead to small oscillations,
367       !      without consequences however).
368       !      factor(:) = 1. - 15. * ( sumfpc(:) - (fpc_crit-.05))
369       !      factor(:) = MAX( 0.25_r_std, MIN( 1._r_std, factor(:)))
370       !      estab_rate_max_grass(:) = estab_rate_max_climate_grass(:) * factor(:)
371       !      S. Zaehle modified to true LPJ formulation, grasses are only allowed in the
372       !      fpc fraction not occupied by trees..., 080806
373       !      estab_rate_max_grass(:)=MAX(0.98-sumfpc(:),zero)
374       !      See Eq. (3) in header
375       estab_rate_max_grass(:) = MAX(MIN(estab_rate_max_climate_grass(:), max_tree_coverage - sumfpc(:)),zero)
376
377       !! 2.8 Longterm grass NPP for competition between C4 and C3 grasses
378       !      to avoid equal veget_cov_max, the idea is that more reestablishment
379       !      is possible for the more productive PFT
380       factor(:) = min_stomate
381
382       DO j = 2,nvm ! Loop over # PFTs
383          IF ( natural(j) .AND. .NOT.is_tree(j)) & 
384               factor(:) = factor(:) + npp_longterm(:,j) * &
385               biomass_to_lai(lm_lastyearmax(:,j),npts,j)
386       ENDDO ! Loop over # PFTs
387
388       !! 2.9 Establish natural PFTs
389       d_ind(:,:) = zero
390
391       IF ( NbNeighb /= 8 ) THEN
392          CALL ipslerr(3, "establish", "This routine needs to be adapted to non rectengular grids", "Talk to Jan Polcher", " ")
393       ENDIF
394
395       DO j = 2,nvm ! Loop over # PFTs
396
397          IF ( natural(j) ) THEN ! only for natural PFTs
398
399             !! 2.9.1 PFT expansion across the grid box. Not to be confused with areal coverage.
400             IF ( treat_expansion ) THEN
401
402                ! only treat plants that are regenerative and present and still can expand
403                DO i = 1, npts ! Loop over # pixels - domain size
404
405                   IF ( PFTpresent(i,j) .AND. &
406                        ( everywhere(i,j) .LT. un ) .AND. &
407                        ( regenerate(i,j) .GT. regenerate_crit ) ) THEN
408
409                      ! from how many sides is the grid box invaded (separate x and y directions
410                      ! because resolution may be strongly anisotropic)
411                      ! For the moment we only look into 4 direction but that can be expanded (JP)
412                      nfrontx = 0
413                      IF ( neighbours(i,3) .GT. 0 ) THEN
414                         IF ( everywhere(neighbours(i,3),j) .GT. 1.-min_stomate ) nfrontx = nfrontx+1
415                      ENDIF
416                      IF ( neighbours(i,7) .GT. 0 ) THEN
417                         IF ( everywhere(neighbours(i,7),j) .GT. 1.-min_stomate ) nfrontx = nfrontx+1
418                      ENDIF
419
420                      nfronty = 0
421                      IF ( neighbours(i,1) .GT. 0 ) THEN
422                         IF ( everywhere(neighbours(i,1),j) .GT. 1.-min_stomate ) nfronty = nfronty+1
423                      ENDIF
424                      IF ( neighbours(i,5) .GT. 0 ) THEN
425                         IF ( everywhere(neighbours(i,5),j) .GT. 1.-min_stomate ) nfronty = nfronty+1
426                      ENDIF
427                     
428                      everywhere(i,j) = &
429                           everywhere(i,j) + migrate(j) * dt/one_year * &
430                           ( nfrontx / resolution(i,1) + nfronty / resolution(i,2) )
431                     
432                      IF ( .NOT. need_adjacent(i,j) ) THEN
433                         
434                         ! in that case, we also assume that the PFT expands from places within
435                         ! the grid box (e.g., oasis).
436                         ! What is this equation? No reference.
437                         everywhere(i,j) = &
438                              everywhere(i,j) + migrate(j) * dt/one_year * &
439                              2. * SQRT( pi*everywhere(i,j)/(area(i)) )
440
441                      ENDIF
442
443                      everywhere(i,j) = MIN( everywhere(i,j), un )
444
445                   ENDIF
446
447                ENDDO ! Loop over # pixels - domain size
448
449             ENDIF ! treat expansion?
450
451             !! 2.9.2 Establishment rate
452             !      - Is lower if the PFT is only present in a small part of the grid box
453             !        (after its introduction), therefore multiplied by "everywhere".
454             !      - Is divided by the number of PFTs that compete ("spacefight").
455             !      - Is modulated by space availability (avail_tree, avail_grass).
456
457             !! 2.9.2.1 present and regenerative trees
458             IF ( is_tree(j) ) THEN
459
460                WHERE ( PFTpresent(:,j) .AND. ( regenerate(:,j) .GT. regenerate_crit ) )
461                   d_ind(:,j) = estab_rate_max_tree(:)*everywhere(:,j) * &
462                        avail_tree(:) * dt/one_year
463                ENDWHERE
464
465             !! 2.9.2.2 present and regenerative grasses
466             ELSE
467                WHERE ( PFTpresent(:,j) .AND. ( regenerate(:,j) .GT. regenerate_crit )  & 
468                     .AND.factor(:).GT.min_stomate .AND. spacefight_grass(:).GT. min_stomate) 
469                   
470                   d_ind(:,j) = estab_rate_max_grass(:)*everywhere(:,j)/spacefight_grass(:) * &
471                        MAX(min_stomate,npp_longterm(:,j)*biomass_to_lai(lm_lastyearmax(:,j),npts,j)/factor(:)) * &
472                        fracnat(:) * dt/one_year
473                ENDWHERE
474               
475             ENDIF  ! tree/grass
476             
477          ENDIF ! if natural
478       ENDDO  ! Loop over # PFTs
479       
480  !! 3. Lpj establishment in static case
481
482    !     Lpj establishment in static case, S. Zaehle 080806, account for real LPJ dynamics in
483    !     prescribed vegetation, i.e. population dynamics within a given area of the grid cell.
484    ELSE
485
486       d_ind(:,:) = zero
487
488       DO j = 2,nvm ! Loop over # PFTs
489          WHERE(ind(:,j)*cn_ind(:,j).GT.min_stomate)
490             lai_ind(:) = biomass_to_lai(lm_lastyearmax(:,j),npts,j)/(ind(:,j)*cn_ind(:,j))
491          ELSEWHERE
492             lai_ind(:) = zero
493          ENDWHERE
494
495          !! 3.1 For natural woody PFTs
496          IF ( natural(j) .AND. is_tree(j)) THEN 
497
498             ! See Eq. (4) in tex file.           
499             fpc_nat(:,j) =  MIN(un, cn_ind(:,j) * ind(:,j) * & 
500                  MAX( ( un - exp( - ext_coeff(j) * lai_ind(:) ) ), min_cover ) )
501
502
503             WHERE (veget_cov_max(:,j).GT.min_stomate.AND.ind(:,j).LE.2.)
504
505                !! 3.1.1 Only establish into growing stands
506                !        Only establish into growing stands, ind can become very
507                !        large in the static mode because LAI is very low in poor
508                !        growing conditions, favouring continuous establishment.
509                !        To avoid this a maximum IND is set. BLARPP: This should be
510                !        replaced by a better stand density criteria.
511                factor(:)=(un - exp(-establish_scal_fact * (un - fpc_nat(:,j))))*(un - fpc_nat(:,j))
512
513                estab_rate_max_tree(:) = estab_max_tree * factor(:) * MAX(0.11 , nstress_season(:,j) )
514
515                !! 3.1.2 do establishment for natural PFTs\n
516                d_ind(:,j) = MAX( zero, estab_rate_max_tree(:) * dt/one_year)
517
518             ENDWHERE
519
520             !S. Zaehle: quickfix: to simulate even aged stand, uncomment the following lines...
521             !where (ind(:,j) .LE. min_stomate)
522             !d_ind(:,j) = 0.1 !MAX( 0.0, estab_rate_max_tree(:) * dt/one_year)
523             WHERE (veget_cov_max(:,j).GT.min_stomate .AND. ind(:,j).EQ.zero)
524                d_ind(:,j) = ind_0_estab
525             ENDWHERE
526
527          !! 3.2 For natural grass PFTs
528          ELSEIF ( natural(j) .AND. .NOT.is_tree(j)) THEN
529
530             WHERE (veget_cov_max(:,j).GT.min_stomate)
531
532                fpc_nat(:,j) =  cn_ind(:,j) * ind(:,j) * & 
533                     MAX( ( un - exp( - ext_coeff(j) * lai_ind(:) ) ), min_cover )
534
535                d_ind(:,j) = MAX(zero , (un - fpc_nat(:,j)) * dt/one_year )
536
537             ENDWHERE
538
539             WHERE (veget_cov_max(:,j).GT.min_stomate .AND. ind(:,j).EQ. zero)
540                d_ind(:,j) = ind_0_estab 
541             ENDWHERE
542
543          ENDIF
544
545       ENDDO ! Loop over # PFTs
546
547    ENDIF ! DGVM OR NOT
548
549  !! 4. Biomass calculation
550
551    DO j = 2,nvm ! Loop over # PFTs
552
553       IF ( natural(j) ) THEN ! only for natural PFTs
554
555          !! 4.1 Herbivores reduce establishment rate
556          !      We suppose that saplings are vulnerable during a given time after establishment.
557          !      This is taken into account by preventively reducing the establishment rate.
558          IF ( ok_herbivores ) THEN
559
560             d_ind(:,j) = d_ind(:,j) * EXP( - tau_eatup/herbivores(:,j) )
561
562          ENDIF
563
564          !! 4.2 Total biomass.
565          !      Add biomass only if d_ind, over one year, is of the order of ind.
566          !      save old leaf mass to calculate leaf age
567          leaf_mass_young(:) = leaf_frac(:,j,1) * biomass(:,j,ileaf,icarbon)
568
569          ! total biomass of existing PFT to limit biomass added from establishment
570          total_bm(:,:) = zero
571
572          DO k = 1, nparts
573             total_bm(:,:) = total_bm(:,:) + biomass(:,j,k,:)
574          ENDDO
575          ! soil nitrogen available to feed plant establishment. 
576          ! This needs to be taken from soil N. Reason: plants must not produce nitrogen by establishment
577          ! (otherwise this creates N)
578          soil_n_constraint(:)=soil_n_min(:,j,iammonium)+soil_n_min(:,j,initrate) 
579
580
581          IF(ok_dgvm) THEN
582             vn(:) = veget_cov_max(:,j)
583          ELSE
584             vn(:) = un
585          ENDIF
586
587          !! 4.3 Woodmass calculation
588
589          !! 4.3.1 with DGVM
590          IF(ok_dgvm) THEN
591
592             ! S. Zaehle calculate new woodmass_ind and veget_cov_max after establishment (needed for correct scaling!)
593             ! essential correction for MERGE!
594             IF(is_tree(j))THEN
595                DO i=1,npts ! Loop over # pixels - domain size
596                   IF((d_ind(i,j)+ind(i,j)).GT.min_stomate) THEN
597
598                      IF((total_bm(i,icarbon).LE.min_stomate) .OR. (veget_cov_max(i,j) .LE. min_stomate)) THEN
599
600                         ! new wood mass of PFT
601                         woodmass_ind(i,j) = &
602                              (((biomass(i,j,isapabove,icarbon) + biomass(i,j,isapbelow,icarbon) &
603                              + biomass(i,j,iheartabove,icarbon) + biomass(i,j,iheartbelow,icarbon))*veget_cov_max(i,j)) &
604                              + (bm_sapl_2D(i,j,isapabove,icarbon) + bm_sapl_2D(i,j,isapbelow,icarbon) &
605                              + bm_sapl_2D(i,j,iheartabove,icarbon) + &
606                                bm_sapl_2D(i,j,iheartbelow,icarbon))*d_ind(i,j))/(ind(i,j) + d_ind(i,j))
607
608                      ELSE
609 
610                         ! new biomass is added to the labile pool, hence there is no change
611                         ! in CA associated with establishment
612                         woodmass_ind(i,j) = &
613                              & (biomass(i,j,isapabove,icarbon) + biomass(i,j,isapbelow,icarbon) &
614                              & +biomass(i,j,iheartabove,icarbon) + biomass(i,j,iheartbelow,icarbon))*veget_cov_max(i,j) &
615                              & /(ind(i,j) + d_ind(i,j))
616
617                      ENDIF
618
619                      ! new diameter of PFT
620                      dia(i) = (woodmass_ind(i,j)/(pipe_density(j)*pi/4.*pipe_tune2(j))) &
621                           &                **(1./(2.+pipe_tune3(j)))
622                      vn(i) = (ind(i,j) + d_ind(i,j))*pipe_tune1(j)*MIN(dia(i),maxdia(j))**pipe_tune_exp_coeff(j)
623
624                   ENDIF
625                ENDDO ! Loop over # pixels - domain size
626             ELSE ! for grasses, cnd=1, so the above calculation cancels
627                vn(:) = ind(:,j) + d_ind(:,j)
628             ENDIF
629
630          !! 4.3.2 without DGVM (static)\n
631          ELSE
632             DO i=1,npts ! Loop over # pixels - domain size
633                IF(is_tree(j).AND.(d_ind(i,j)+ind(i,j)).GT.min_stomate) THEN
634                   IF(total_bm(i,icarbon).LE.min_stomate) THEN
635
636                      ! new wood mass of PFT
637                      woodmass_ind(i,j) = &
638                           & (((biomass(i,j,isapabove,icarbon) + biomass(i,j,isapbelow,icarbon) &
639                           & + biomass(i,j,iheartabove,icarbon) + biomass(i,j,iheartbelow,icarbon))) &
640                           & + (bm_sapl_2D(i,j,isapabove,icarbon) + bm_sapl_2D(i,j,isapbelow,icarbon) &
641                           & + bm_sapl_2D(i,j,iheartabove,icarbon) + &
642                           &   bm_sapl_2D(i,j,iheartbelow,icarbon))*d_ind(i,j))/(ind(i,j)+d_ind(i,j))
643
644                   ELSE
645 
646                      ! new biomass is added to the labile pool, hence there is no change
647                      ! in CA associated with establishment
648                      woodmass_ind(i,j) = &
649                           & (biomass(i,j,isapabove,icarbon) + biomass(i,j,isapbelow,icarbon) &
650                           & + biomass(i,j,iheartabove,icarbon) + biomass(i,j,iheartbelow,icarbon)) &
651                           & /(ind(i,j) + d_ind(i,j))
652
653                   ENDIF
654                ENDIF
655             ENDDO ! Loop over # pixels - domain size
656
657             vn(:) = un ! cannot change in static!, and veget_cov_max implicit in d_ind
658
659          ENDIF
660
661          !! 4.4 total biomass of PFT added by establishment defined over veget_cov_max ...
662
663          total_bm_sapl(:,:) = zero
664          total_bm_sapl_non(:,:) = zero
665          biomass_old(:,j,:,:)=biomass(:,j,:,:)
666          DO k = 1, nparts ! Loop over # litter tissues (nparts=8); see 'stomate_constants.f90'
667             WHERE(d_ind(:,j).GT.min_stomate.AND.total_bm(:,icarbon).GT.min_stomate.AND.vn(:).GT.min_stomate)
668
669                total_bm_sapl(:,icarbon) = total_bm_sapl(:,icarbon) + bm_sapl_2D(:,j,k,icarbon) * d_ind(:,j) / vn(:)
670                total_bm_sapl(:,initrogen) = total_bm_sapl(:,initrogen) + bm_sapl_2D(:,j,k,initrogen) * d_ind(:,j)  / vn(:) 
671
672                ! non-effective establishment
673                total_bm_sapl_non(:,icarbon) = total_bm_sapl_non(:,icarbon) + &
674                     bm_sapl_2D(:,j,k,icarbon) * (ind(:,j)+d_ind(:,j))*mortality(:,j) / vn(:)
675
676                total_bm_sapl_non(:,initrogen) = total_bm_sapl_non(:,initrogen) + &
677                     bm_sapl_2D(:,j,k,initrogen) * (ind(:,j)+d_ind(:,j))*mortality(:,j) / vn(:)
678               
679
680             ENDWHERE
681          ENDDO ! Loop over # litter tissues
682
683
684          total_bm_sapl(:,initrogen)=MIN(total_bm_sapl(:,initrogen),soil_n_constraint(:)) 
685          ntake(:)=zero 
686!Dan Zhu modification: there is a problem here, if DGVM is activated, co2_to_bm will never reach
687!0 due to establishment, where d_ind is still large at equilibrium (=ind*mortality). So we
688!need to subtract it from litter (not biomass, because the
689!corresponding biomass has been lost in lpj_gap).
690
691          !! 4.5 Update biomass at each component
692          DO k = 1, nparts ! Loop over # litter tissues
693
694             bm_new(:,:) = zero
695             bm_non(:,:) = zero
696             bm_eff(:,:) = zero
697
698             ! first ever establishment, C flows
699             WHERE( d_ind(:,j).GT.min_stomate .AND. &
700                  total_bm(:,icarbon).LE.min_stomate .AND. &
701                  veget_cov_max(:,j).GT.min_stomate)
702
703                bm_new(:,icarbon) = d_ind(:,j) * bm_sapl_2D(:,j,k,icarbon) / vn(:)
704                biomass(:,j,k,icarbon) = biomass(:,j,k,icarbon) + bm_new(:,icarbon)
705
706                bm_new(:,initrogen) = d_ind(:,j) * (bm_sapl_2D(:,j,k,initrogen)) / vn(:)
707                biomass(:,j,k,initrogen) = biomass(:,j,k,initrogen) + bm_new(:,initrogen)
708
709                ! bm_to_litter minus the 'non-effective' establishment (mortality), but cannot be less than 0
710                WHERE((veget_cov_max_tree(:) .GT. 0.1) .AND. (veget_cov_max(:,j) .LT. veget_cov_max_tree(:)/nbtree) )
711
712                   bm_non(:,icarbon) = MIN( biomass(:,j,k,icarbon)+bm_to_litter(:,j,k,icarbon), &
713                        (ind(:,j)+d_ind(:,j))*mortality(:,j) * bm_sapl_2D(:,j,k,icarbon)/vn(:) )
714                   bm_eff(:,icarbon) = MIN( npp_longterm(:,j)/one_year, bm_new(:,icarbon)-bm_non(:,icarbon) )
715                   bm_non(:,icarbon) = MIN( biomass(:,j,k,icarbon)+bm_to_litter(:,j,k,icarbon), &
716                        bm_new(:,icarbon)-bm_eff(:,icarbon) )
717
718                   bm_non(:,initrogen) = MIN( biomass(:,j,k,initrogen)+bm_to_litter(:,j,k,initrogen), &
719                        (ind(:,j)+d_ind(:,j))*mortality(:,j) * bm_sapl_2D(:,j,k,initrogen)/vn(:) )
720                   bm_eff(:,initrogen) = bm_new(:,initrogen)-bm_non(:,initrogen) 
721                   bm_non(:,initrogen) = MIN( biomass(:,j,k,initrogen)+bm_to_litter(:,j,k,initrogen), &
722                        bm_new(:,initrogen)-bm_eff(:,initrogen) )
723                   ! I think there was an error
724                   ! co2_to_bm(:,j)=co2_to_bm(:,j) + bm_new(:) - bm_non(:)
725                   co2_to_bm(:,j)=co2_to_bm(:,j) + bm_new(:,icarbon)/dt - bm_non(:,icarbon)/dt
726                   ntake(:) = ntake(:) + bm_new(:,initrogen) - bm_non(:,initrogen)
727
728                   WHERE( bm_to_litter(:,j,k,icarbon) .LT. bm_non(:,icarbon) )
729                      biomass(:,j,k,icarbon) = biomass(:,j,k,icarbon) - &
730                           ( bm_non(:,icarbon) - bm_to_litter(:,j,k,icarbon) )
731                   ENDWHERE
732                   bm_to_litter(:,j,k,icarbon) = bm_to_litter(:,j,k,icarbon) - &
733                        MIN(bm_to_litter(:,j,k,icarbon), bm_non(:,icarbon) )
734
735                   WHERE( bm_to_litter(:,j,k,initrogen) .LT. bm_non(:,initrogen) )
736                      biomass(:,j,k,initrogen) = biomass(:,j,k,initrogen) - &
737                           ( bm_non(:,initrogen) - bm_to_litter(:,j,k,initrogen) )
738                   ENDWHERE
739                   bm_to_litter(:,j,k,initrogen) = bm_to_litter(:,j,k,initrogen) - &
740                        MIN(bm_to_litter(:,j,k,initrogen), bm_non(:,initrogen) )
741
742                ELSEWHERE
743
744                   bm_non(:,icarbon) = MIN( bm_to_litter(:,j,k,icarbon), &
745                        (ind(:,j)+d_ind(:,j))*mortality(:,j) * bm_sapl_2D(:,j,k,icarbon)/vn(:) )
746                   co2_to_bm(:,j)=co2_to_bm(:,j) + bm_new(:,icarbon)/dt - bm_non(:,icarbon)/dt
747                   bm_to_litter(:,j,k,icarbon)=bm_to_litter(:,j,k,icarbon)- bm_non(:,icarbon)
748
749                   bm_non(:,initrogen) = MIN( bm_to_litter(:,j,k,initrogen), &
750                        (ind(:,j)+d_ind(:,j))*mortality(:,j) * bm_sapl_2D(:,j,k,initrogen)/vn(:) )
751                   ntake(:)= ntake(:) + bm_new(:,initrogen) - bm_non(:,initrogen)
752                   bm_to_litter(:,j,k,initrogen)=bm_to_litter(:,j,k,initrogen)- bm_non(:,initrogen)
753
754                ENDWHERE
755
756             ENDWHERE
757
758             ! establishment into existing population, C flows
759             WHERE(d_ind(:,j).GT.min_stomate.AND.total_bm(:,icarbon).GT.min_stomate)
760
761                bm_new(:,icarbon) = total_bm_sapl(:,icarbon) * biomass_old(:,j,k,icarbon) / total_bm(:,icarbon)
762                biomass(:,j,k,icarbon) = biomass(:,j,k,icarbon) + bm_new(:,icarbon)
763
764                bm_new(:,initrogen) = total_bm_sapl(:,initrogen) * biomass_old(:,j,k,initrogen) / total_bm(:,initrogen)
765                biomass(:,j,k,initrogen) = biomass(:,j,k,initrogen) + bm_new(:,initrogen)
766
767                WHERE((veget_cov_max_tree(:) .GT. 0.1) .AND. (veget_cov_max(:,j) .LT. veget_cov_max_tree(:)/nbtree) )
768
769                   bm_non(:,icarbon) = MIN( biomass(:,j,k,icarbon)+bm_to_litter(:,j,k,icarbon), &
770                        total_bm_sapl_non(:,icarbon) *biomass_old(:,j,k,icarbon)/total_bm(:,icarbon) )
771                   bm_eff(:,icarbon) = MIN( npp_longterm(:,j)/one_year, bm_new(:,icarbon)-bm_non(:,icarbon) )
772                   bm_non(:,icarbon) = MAX( zero, MIN( biomass(:,j,k,icarbon)+bm_to_litter(:,j,k,icarbon)-min_stomate, &
773                        bm_new(:,icarbon)-bm_eff(:,icarbon) ) )
774
775                   bm_non(:,initrogen) = MIN( biomass(:,j,k,initrogen)+bm_to_litter(:,j,k,initrogen), &
776                        total_bm_sapl_non(:,initrogen) *biomass_old(:,j,k,initrogen)/total_bm(:,initrogen) )
777                   bm_eff(:,initrogen) = bm_new(:,initrogen)-bm_non(:,initrogen)
778                   bm_non(:,initrogen) = MAX( zero, MIN( biomass(:,j,k,initrogen)+bm_to_litter(:,j,k,initrogen)-min_stomate, &
779                        bm_new(:,initrogen)-bm_eff(:,initrogen) ) )
780
781                   co2_to_bm(:,j)=co2_to_bm(:,j) + bm_new(:,icarbon) - bm_non(:,icarbon)
782                   ntake(:) = ntake(:) + bm_new(:,initrogen) - bm_non(:,initrogen)
783
784                   WHERE( bm_to_litter(:,j,k,icarbon) .LT. bm_non(:,icarbon) )
785                      biomass(:,j,k,icarbon) = biomass(:,j,k,icarbon) - ( bm_non(:,icarbon) - bm_to_litter(:,j,k,icarbon) )
786                   ENDWHERE
787                   bm_to_litter(:,j,k,icarbon) = bm_to_litter(:,j,k,icarbon) - MIN(bm_to_litter(:,j,k,icarbon), bm_non(:,icarbon) )
788
789                   WHERE( bm_to_litter(:,j,k,initrogen) .LT. bm_non(:,initrogen) )
790                      biomass(:,j,k,initrogen) = biomass(:,j,k,initrogen) - ( bm_non(:,initrogen) - bm_to_litter(:,j,k,initrogen) )
791                   ENDWHERE
792                   bm_to_litter(:,j,k,initrogen) = bm_to_litter(:,j,k,initrogen) - &
793                        MIN(bm_to_litter(:,j,k,initrogen), bm_non(:,initrogen) )
794
795                ELSEWHERE
796
797                   bm_non(:,icarbon) = MIN( bm_to_litter(:,j,k,icarbon), &
798                        total_bm_sapl_non(:,icarbon) *biomass_old(:,j,k,icarbon)/total_bm(:,icarbon) )
799                   co2_to_bm(:,j) = co2_to_bm(:,j) + bm_new(:,icarbon)/dt - bm_non(:,icarbon)/dt
800                   bm_to_litter(:,j,k,icarbon)=bm_to_litter(:,j,k,icarbon)- bm_non(:,icarbon)
801
802                   bm_non(:,initrogen) = MIN( bm_to_litter(:,j,k,initrogen), &
803                        total_bm_sapl_non(:,initrogen) *biomass_old(:,j,k,initrogen)/total_bm(:,initrogen) )
804                   ntake(:) = ntake(:) + bm_new(:,initrogen) - bm_non(:,initrogen)
805                   bm_to_litter(:,j,k,initrogen)=bm_to_litter(:,j,k,initrogen)- bm_non(:,initrogen)
806                ENDWHERE
807
808             ENDWHERE
809
810          ENDDO ! Loop over # litter tissues
811
812          ntake_nitrate(:)=MIN(ntake(:),MAX(soil_n_min(:,j,iammonium)-min_stomate,0.0)) 
813          soil_n_min(:,j,iammonium)=soil_n_min(:,j,iammonium)-ntake_nitrate(:) 
814          n_uptake(:,j,iammonium)=n_uptake(:,j,iammonium) + ntake_nitrate(:)/dt 
815 
816          ntake(:)=MIN(ntake(:)-ntake_nitrate(:),MAX(soil_n_min(:,j,initrate)-min_stomate,0.0)) 
817          soil_n_min(:,j,initrate)=soil_n_min(:,j,initrate)-ntake(:) 
818          n_uptake(:,j,initrate)=n_uptake(:,j,initrate) + ntake(:)/dt 
819
820          IF (ANY( bm_to_litter(:,j,:,icarbon) .LT. 0.0 ) .OR. ANY( biomass(:,j,:,icarbon) .LT. 0.0 ) ) THEN
821             CALL ipslerr_p(3,'establish','something wrong in establish/gap.','','')
822          ENDIF 
823
824          !! 4.6 Decrease leaf age in youngest class if new leaf biomass is higher than old one.
825          WHERE ( d_ind(:,j) * bm_sapl_2D(:,j,ileaf,icarbon) .GT. min_stomate )
826 
827             ! reset leaf ages. Should do a real calculation like in the npp routine,
828             ! but this case is rare and not worth messing around.
829             ! S. Zaehle 080806, added real calculation now, because otherwise leaf_age/leaf_frac
830             ! are not initialised for the calculation of vmax, and hence no growth at all.
831             ! logic follows that of stomate_npp.f90, just that it's been adjusted for the code here
832             leaf_age(:,j,1) = leaf_age(:,j,1) * leaf_mass_young(:) / &
833                  ( leaf_mass_young(:) + d_ind(:,j) * bm_sapl_2D(:,j,ileaf,icarbon) )
834
835          ENDWHERE
836
837          leaf_mass_young(:) = leaf_mass_young(:) + d_ind(:,j) * bm_sapl_2D(:,j,ileaf,icarbon)   
838
839          !! 4.7 Youngest class: new mass in youngest class divided by total new mass
840          WHERE ( biomass(:,j,ileaf,icarbon) .GT. min_stomate )
841             ! new age class fractions (fraction in youngest class increases)
842             leaf_frac(:,j,1) = leaf_mass_young(:) / biomass(:,j,ileaf,icarbon)
843
844          ENDWHERE
845
846          !! 4.8 Other classes: old mass in leaf age class divided by new mass
847          DO m = 2, nleafages
848
849             WHERE ( biomass(:,j,ileaf,icarbon) .GT. min_stomate )
850
851                leaf_frac(:,j,m) = leaf_frac(:,j,m) * & 
852                     ( biomass(:,j,ileaf,icarbon) + d_ind(:,j) * bm_sapl_2D(:,j,ileaf,icarbon) ) /  biomass(:,j,ileaf,icarbon)
853
854             ENDWHERE
855
856          ENDDO
857
858          !! 4.9 Update age and number of individuals
859          WHERE ( d_ind(:,j) .GT. min_stomate )
860
861             age(:,j) = age(:,j) * ind(:,j) / ( ind(:,j) + d_ind(:,j) )
862
863             ind(:,j) = ind(:,j) + d_ind(:,j)
864
865          ENDWHERE
866
867          !! 4.10 Convert excess sapwood to heartwood
868          !!      No longer done : supressed by S. Zaehle given that the LPJ logic of carbon allocation was
869          !!      contradictory to SLAVE allocation. See CVS tag 1_5 for initial formulation.
870
871
872       ENDIF ! natural
873
874    ENDDO ! Loop over # PFTs
875
876  !! 5. history
877
878    d_ind = d_ind / dt
879
880    CALL xios_orchidee_send_field("IND_ESTAB",d_ind)
881    CALL xios_orchidee_send_field("ESTABTREE",estab_rate_max_tree)
882    CALL xios_orchidee_send_field("ESTABGRASS",estab_rate_max_grass)
883
884    CALL histwrite_p (hist_id_stomate, 'IND_ESTAB', itime, d_ind, npts*nvm, horipft_index)
885    CALL histwrite_p (hist_id_stomate, 'ESTABTREE', itime, estab_rate_max_tree, npts, hori_index)
886    CALL histwrite_p (hist_id_stomate, 'ESTABGRASS', itime, estab_rate_max_grass, npts, hori_index)
887
888    IF (printlev>=4) WRITE(numout,*) 'Leaving establish'
889
890  END SUBROUTINE establish
891
892END MODULE lpj_establish
Note: See TracBrowser for help on using the repository browser.