source: tags/ORCHIDEE/src_stomate/stomate_litter.f90 @ 6

Last change on this file since 6 was 6, checked in by orchidee, 14 years ago

import first tag equivalent to CVS orchidee_1_9_5 + OOL_1_9_5

File size: 23.3 KB
Line 
1! Update litter and lignine content after litter fall.
2! Calculate litter decomposition.
3!
4! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_stomate/stomate_litter.f90,v 1.9 2009/06/24 10:43:21 ssipsl Exp $
5! IPSL (2006)
6!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC
7!
8MODULE stomate_litter
9
10  ! modules used:
11
12  USE ioipsl
13  USE stomate_constants
14  USE constantes_veg
15
16  IMPLICIT NONE
17
18  ! private & public routines
19
20  PRIVATE
21  PUBLIC littercalc,littercalc_clear, deadleaf
22
23  ! first call
24  LOGICAL, SAVE                                                     :: firstcall = .TRUE.
25
26CONTAINS
27
28  SUBROUTINE littercalc_clear
29    firstcall =.TRUE.
30  END SUBROUTINE littercalc_clear
31
32
33  SUBROUTINE littercalc (npts, dt, &
34       turnover, bm_to_litter, &
35       veget_max, tsurf, tsoil, soilhum, litterhum, &
36       litterpart, litter, dead_leaves, lignin_struc, &
37       deadleaf_cover, resp_hetero_litter, &
38       soilcarbon_input, control_temp, control_moist)
39
40    !
41    ! 0 declarations
42    !
43
44    ! 0.1 input
45
46    ! Domain size
47    INTEGER(i_std), INTENT(in)                                               :: npts
48    ! time step in days
49    REAL(r_std), INTENT(in)                                            :: dt
50    ! Turnover rates (gC/(m**2 of ground)/day)
51    REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in)               :: turnover
52    ! conversion of biomass to litter (gC/(m**2 of ground)) / day
53    REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(in)               :: bm_to_litter
54    ! veget_max
55    REAL(r_std),DIMENSION(npts,nvm),INTENT(in)                  :: veget_max
56    ! temperature (K) at the surface
57    REAL(r_std), DIMENSION(npts), INTENT(in)                           :: tsurf
58    ! soil temperature (K)
59    REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)                      :: tsoil
60    ! daily soil humidity
61    REAL(r_std), DIMENSION(npts,nbdl), INTENT(in)                      :: soilhum
62    ! daily litter humidity
63    REAL(r_std), DIMENSION(npts), INTENT(in)                           :: litterhum
64
65    ! 0.2 modified fields
66
67    ! fraction of litter above the ground belonging to different PFTs
68    REAL(r_std), DIMENSION(npts,nvm,nlitt), INTENT(inout)             :: litterpart
69    ! metabolic and structural litter,above and below ground (gC/m**2 of ground)
70    REAL(r_std), DIMENSION(npts,nlitt,nvm,nlevs), INTENT(inout)  :: litter
71    ! dead leaves on ground, per PFT, metabolic and structural,
72    !   in gC/(m**2 of ground)
73    REAL(r_std), DIMENSION(npts,nvm,nlitt), INTENT(inout)             :: dead_leaves
74    ! ratio Lignine/Carbon in structural litter, above and below ground, (gC/m**2)
75    REAL(r_std), DIMENSION(npts,nvm,nlevs), INTENT(inout)        :: lignin_struc
76
77    ! 0.3 output
78
79    ! fraction of soil covered by dead leaves
80    REAL(r_std), DIMENSION(npts), INTENT(out)                          :: deadleaf_cover
81    ! litter heterotrophic respiration (in gC/day/m**2 of ground)
82    REAL(r_std), DIMENSION(npts,nvm), INTENT(out)                :: resp_hetero_litter
83    ! quantity of carbon going into carbon pools from litter decomposition
84    !   (gC/(m**2 of ground)/day)
85    REAL(r_std), DIMENSION(npts,ncarb,nvm), INTENT(out)          :: soilcarbon_input
86    ! temperature control of heterotrophic respiration, above and below
87    REAL(r_std), DIMENSION(npts,nlevs), INTENT(out)                    :: control_temp
88    ! moisture control of heterotrophic respiration
89    REAL(r_std), DIMENSION(npts,nlevs), INTENT(out)                    :: control_moist
90
91    ! 0.4 local
92
93    ! C/N ratio
94    REAL(r_std), SAVE, DIMENSION(nparts)                               :: CN
95    ! what fraction of leaves, wood, etc. goes into metabolic and structural litterpools
96    REAL(r_std), SAVE, DIMENSION(nparts,nlitt)                         :: litterfrac
97    ! Lignine/C ratio of the different plant parts
98    REAL(r_std), SAVE, DIMENSION(nparts)                               :: LC
99    ! soil levels (m)
100    REAL(r_std), SAVE, DIMENSION(0:nbdl)                               :: z_soil
101    ! scaling depth for soil activity (m)
102    REAL(r_std), PARAMETER                                             :: z_decomp = 0.2
103    ! integration constant for vertical profiles
104    REAL(r_std), DIMENSION(npts)                                       :: rpc
105    ! residence time in litter pools (days)
106    REAL(r_std), SAVE, DIMENSION(nlitt)                                :: litter_tau
107    ! decomposition flux fraction that goes into soil (litter -> carbon, above and below)
108    !   rest goes into atmosphere
109    REAL(r_std), SAVE, DIMENSION(nlitt,ncarb,nlevs)                    :: frac_soil
110    ! temperature used for decompostition in soil (K)
111    REAL(r_std), DIMENSION(npts)                                       :: tsoil_decomp
112    ! humidity used for decompostition in soil
113    REAL(r_std), DIMENSION(npts)                                       :: soilhum_decomp
114    ! fraction of structural or metabolic litter decomposed
115    REAL(r_std), DIMENSION(npts)                                       :: fd
116    ! quantity of structural or metabolic litter decomposed (gC/m**2)
117    REAL(r_std), DIMENSION(npts)                                       :: qd
118    ! old structural litter, above and below (gC/m**2)
119    REAL(r_std), DIMENSION(npts,nvm,nlevs)                       :: old_struc
120    ! increase of litter, per PFT, metabolic and structural,
121    !   above and below ground (gC/m**2 of ground)
122    REAL(r_std), DIMENSION(npts,nvm,nlitt,nlevs)                      :: litter_inc_PFT
123    ! increase of metabolic and structural litter, above and below ground (gC/m**2 of ground)
124    REAL(r_std), DIMENSION(npts,nlitt,nvm,nlevs)                 :: litter_inc
125    ! lignin increase in structural litter, above and below ground (gC/m**2 of ground)
126    REAL(r_std), DIMENSION(npts,nvm,nlevs)                       :: lignin_struc_inc
127    ! metabolic and structural litter above the ground per PFT
128    REAL(r_std), DIMENSION(npts,nvm,nlitt)                            :: litter_pft
129    ! intermediate array for looking for minimum
130    REAL(r_std), DIMENSION(npts)                                       :: zdiff_min
131    ! for messages
132    CHARACTER*10, DIMENSION(nlitt)                                    :: litter_str
133    CHARACTER*22, DIMENSION(nparts)                                   :: part_str
134    CHARACTER*7, DIMENSION(ncarb)                                     :: carbon_str
135    CHARACTER*5, DIMENSION(nlevs)                                     :: level_str
136    ! Indices
137    INTEGER(i_std)                                                    :: i,j,k,l,m
138
139    ! =========================================================================
140
141    IF (bavard.GE.3) WRITE(numout,*) 'Entering littercalc'
142
143    !
144    ! 1 Initialisations
145    !
146
147    IF ( firstcall ) THEN
148
149       !
150       ! 1.1 get soil "constants"
151       !
152
153       ! 1.1.1 C/N ratios
154
155       CN(ileaf) = 40.0
156       CN(isapabove) = 40.0
157       CN(isapbelow) = 40.0
158       CN(iheartabove) = 40.0
159       CN(iheartbelow) = 40.0
160       CN(iroot) = 40.0
161       CN(ifruit) = 40.0
162       CN(icarbres) = 40.0
163
164       ! 1.1.2 Lignine/C ratios
165
166       LC(ileaf) = 0.22
167       LC(isapabove) = 0.35
168       LC(isapbelow) = 0.35
169       LC(iheartabove) = 0.35
170       LC(iheartbelow) = 0.35
171       LC(iroot) = 0.22
172       LC(ifruit) = 0.22
173       LC(icarbres) = 0.22
174
175       ! 1.1.3 litter fractions:
176       !   what fraction of leaves, wood, etc. goes into metabolic and structural litterpools
177
178       DO k = 1, nparts
179
180          litterfrac(k,imetabolic) = 0.85 - 0.018 * LC(k) * CN(k)
181          litterfrac(k,istructural) = 1. - litterfrac(k,imetabolic)
182
183       ENDDO
184
185       ! 1.1.4 residence times in litter pools (days)
186
187       litter_tau(imetabolic) = .066 * one_year      !!!!???? .5 years
188       litter_tau(istructural) = .245 * one_year     !!!!???? 3 years
189
190       ! 1.1.5 decomposition flux fraction that goes into soil
191       !       (litter -> carbon, above and below)
192       !       1-frac_soil goes into atmosphere
193
194       frac_soil(:,:,:) = zero
195
196       ! structural litter: lignin fraction goes into slow pool + respiration,
197       !                    rest into active pool + respiration
198       frac_soil(istructural,iactive,iabove) = .55
199       frac_soil(istructural,iactive,ibelow) = .45
200       frac_soil(istructural,islow,iabove) = .7
201       frac_soil(istructural,islow,ibelow) = .7
202
203       ! metabolic litter: all goes into active pool + respiration.
204       !   Nothing into slow or passive pool.
205       frac_soil(imetabolic,iactive,iabove) = .45
206       frac_soil(imetabolic,iactive,ibelow) = .45
207
208       !
209       ! 1.2 soil levels
210       !
211
212       z_soil(0) = 0.
213       z_soil(1:nbdl) = diaglev(1:nbdl)
214
215       !
216       ! 1.3 messages
217       !
218
219       litter_str(imetabolic) = 'metabolic'
220       litter_str(istructural) = 'structural'
221
222       carbon_str(iactive) = 'active'
223       carbon_str(islow) = 'slow'
224       carbon_str(ipassive) = 'passive'
225
226       level_str(iabove) = 'above'
227       level_str(ibelow) = 'below'
228
229       part_str(ileaf) = 'leaves'
230       part_str(isapabove) = 'sap above ground'
231       part_str(isapbelow) = 'sap below ground'
232       part_str(iheartabove) = 'heartwood above ground'
233       part_str(iheartbelow) = 'heartwood below ground'
234       part_str(iroot) = 'roots'
235       part_str(ifruit) = 'fruits'
236       part_str(icarbres) = 'carbohydrate reserve'
237
238       WRITE(numout,*) 'litter:'
239
240       WRITE(numout,*) '   > C/N ratios: '
241       DO k = 1, nparts
242          WRITE(numout,*) '       ', part_str(k), ': ',CN(k)
243       ENDDO
244
245       WRITE(numout,*) '   > Lignine/C ratios: '
246       DO k = 1, nparts
247          WRITE(numout,*) '       ', part_str(k), ': ',LC(k)
248       ENDDO
249
250       WRITE(numout,*) '   > fraction of compartment that goes into litter: '
251       DO k = 1, nparts
252          DO m = 1, nlitt
253             WRITE(numout,*) '       ', part_str(k), '-> ',litter_str(m), ':',litterfrac(k,m)
254          ENDDO
255       ENDDO
256
257       WRITE(numout,*) '   > scaling depth for decomposition (m): ',z_decomp
258
259       WRITE(numout,*) '   > minimal carbon residence time in litter pools (d):'
260       DO m = 1, nlitt
261          WRITE(numout,*) '       ',litter_str(m),':',litter_tau(m)
262       ENDDO
263
264       WRITE(numout,*) '   > litter decomposition flux fraction that really goes '
265       WRITE(numout,*) '     into carbon pools (rest into the atmosphere):'
266       DO m = 1, nlitt
267          DO l = 1, nlevs
268             DO k = 1, ncarb
269                WRITE(numout,*) '       ',litter_str(m),' ',level_str(l),' -> ',&
270                     carbon_str(k),':', frac_soil(m,k,l)
271             ENDDO
272          ENDDO
273       ENDDO
274
275       firstcall = .FALSE.
276
277    ENDIF
278
279    !
280    ! 1.3 litter above the ground per PFT.
281    !
282
283    DO j = 2, nvm
284
285       DO k = 1, nlitt
286          litter_pft(:,j,k) = litterpart(:,j,k) * litter(:,k,j,iabove)
287       ENDDO
288
289    ENDDO
290
291    !
292    ! 1.4 set output to zero
293    !
294
295    deadleaf_cover(:) = zero
296    resp_hetero_litter(:,:) = zero
297    soilcarbon_input(:,:,:) = zero
298
299    !
300    ! 2 Add biomass to different litterpools (per m**2 of ground)
301    !
302
303    !
304    ! 2.1 first, save old structural litter (needed for lignin fractions).
305    !     above/below
306    !
307
308    DO l = 1, nlevs
309       DO m = 2,nvm
310
311          old_struc(:,m,l) = litter(:,istructural,m,l)
312
313       ENDDO
314    ENDDO
315
316    !
317    ! 2.2 update litter, dead leaves, and lignin content in structural litter
318    !
319
320    litter_inc(:,:,:,:) = zero
321    lignin_struc_inc(:,:,:) = zero
322
323    DO j = 2,nvm
324
325       ! 2.2.1 litter
326
327       DO k = 1, nlitt    ! metabolic and structural
328
329          ! 2.2.2 calculate litter increase (per m**2 of ground).
330          !       Only a given fracion of fruit turnover is directly coverted into litter.
331          !       Litter increase for each PFT, structural and metabolic, above/below
332
333          litter_inc_PFT(:,j,k,iabove) = &
334               litterfrac(ileaf,k) * bm_to_litter(:,j,ileaf) + &
335               litterfrac(isapabove,k) * bm_to_litter(:,j,isapabove) + &
336               litterfrac(iheartabove,k) * bm_to_litter(:,j,iheartabove) + &
337               litterfrac(ifruit,k) * bm_to_litter(:,j,ifruit) + &
338               litterfrac(icarbres,k) * bm_to_litter(:,j,icarbres) + &
339               litterfrac(ileaf,k) * turnover(:,j,ileaf) + &
340               litterfrac(isapabove,k) * turnover(:,j,isapabove) + &
341               litterfrac(iheartabove,k) * turnover(:,j,iheartabove) + &
342               litterfrac(ifruit,k) * turnover(:,j,ifruit) + &
343               litterfrac(icarbres,k) * turnover(:,j,icarbres)
344
345          litter_inc_PFT(:,j,k,ibelow) = &
346               litterfrac(isapbelow,k) * bm_to_litter(:,j,isapbelow) + &
347               litterfrac(iheartbelow,k) * bm_to_litter(:,j,iheartbelow) + &
348               litterfrac(iroot,k) * bm_to_litter(:,j,iroot) + &
349               litterfrac(isapbelow,k) * turnover(:,j,isapbelow) + &
350               litterfrac(iheartbelow,k) * turnover(:,j,iheartbelow) + &
351               litterfrac(iroot,k) * turnover(:,j,iroot)
352
353          ! litter increase, met/struct, above/below
354
355          litter_inc(:,k,j,iabove) = litter_inc(:,k,j,iabove) + litter_inc_PFT(:,j,k,iabove)
356          litter_inc(:,k,j,ibelow) = litter_inc(:,k,j,ibelow) + litter_inc_PFT(:,j,k,ibelow)
357
358          ! 2.2.3 dead leaves, for soil cover.
359
360          dead_leaves(:,j,k) = &
361               dead_leaves(:,j,k) + &
362               litterfrac(ileaf,k) * ( bm_to_litter(:,j,ileaf) + turnover(:,j,ileaf) )
363
364          ! 2.2.4 lignin increase in structural litter
365
366          IF ( k .EQ. istructural ) THEN
367
368             lignin_struc_inc(:,j,iabove) = &
369                  lignin_struc_inc(:,j,iabove) + &
370                  LC(ileaf) * bm_to_litter(:,j,ileaf) + &
371                  LC(isapabove) * bm_to_litter(:,j,isapabove) + &
372                  LC(iheartabove) * bm_to_litter(:,j,iheartabove) + &
373                  LC(ifruit) * bm_to_litter(:,j,ifruit) + &
374                  LC(icarbres) * bm_to_litter(:,j,icarbres) + &
375                  LC(ileaf) * turnover(:,j,ileaf) + &
376                  LC(isapabove) * turnover(:,j,isapabove) + &
377                  LC(iheartabove) * turnover(:,j,iheartabove) + &
378                  LC(ifruit) * turnover(:,j,ifruit) + &
379                  LC(icarbres) * turnover(:,j,icarbres)
380
381             lignin_struc_inc(:,j,ibelow) = &
382                  lignin_struc_inc(:,j,ibelow) + &
383                  LC(isapbelow) * bm_to_litter(:,j,isapbelow) + &
384                  LC(iheartbelow) * bm_to_litter(:,j,iheartbelow) + &
385                  LC(iroot) * bm_to_litter(:,j,iroot) + &
386                  LC(isapbelow)*turnover(:,j,isapbelow) + &
387                  LC(iheartbelow)*turnover(:,j,iheartbelow) + &
388                  LC(iroot)*turnover(:,j,iroot)
389
390          ENDIF
391
392       ENDDO
393    ENDDO
394
395    ! 3.2.5 add new litter (struct/met, above/below)
396
397    litter(:,:,:,:) = litter(:,:,:,:) + litter_inc(:,:,:,:)
398
399    ! 3.2.6 for security: can't add more lignin than structural litter (above/below)
400
401    DO l = 1, nlevs
402       DO m = 2,nvm
403
404          lignin_struc_inc(:,m,l) = &
405               MIN( lignin_struc_inc(:,m,l), litter_inc(:,istructural,m,l) )
406
407       ENDDO
408    ENDDO
409
410    ! 3.2.7 new lignin content: add old lignin and lignin increase, divide by
411    !       total structural litter (above/below)
412
413    DO l = 1, nlevs
414       DO m = 2,nvm
415          WHERE( litter(:,istructural,m,l) .GT. min_stomate )
416
417       !MM : Soenke modif
418       ! Best vectorization ?
419!!$       lignin_struc(:,:,:) = &
420!!$            ( lignin_struc(:,:,:)*old_struc(:,:,:) + lignin_struc_inc(:,:,:) ) / &
421!!$            litter(:,istructural,:,:,icarbon)
422
423             lignin_struc(:,m,l) = lignin_struc(:,m,l) * old_struc(:,m,l)
424             lignin_struc(:,m,l) = lignin_struc(:,m,l) + lignin_struc_inc(:,m,l)
425             lignin_struc(:,m,l) = lignin_struc(:,m,l) / litter(:,istructural,m,l)
426          ELSEWHERE
427             lignin_struc(:,m,l) = zero
428          ENDWHERE
429       ENDDO
430    ENDDO
431
432    !
433    ! 3.3 new litter fraction per PFT (for structural and metabolic litter, above
434    !       the ground).
435    !
436
437    DO j = 2,nvm
438
439       WHERE ( litter(:,:,j,iabove) .GT. min_stomate )
440
441          litterpart(:,j,:) = &
442               ( litter_pft(:,j,:) + litter_inc_PFT(:,j,:,iabove) ) / litter(:,:,j,iabove)
443
444       ELSEWHERE
445
446          litterpart(:,j,:) = zero
447
448       ENDWHERE
449
450    ENDDO
451
452    !
453    ! 4 Temperature control on decay: Factor between 0 and 1
454    !
455
456    !
457    ! 4.1 above: surface temperature
458    !
459
460    control_temp(:,iabove) = control_temp_func (npts, tsurf)
461
462    !
463    ! 4.2 below: convolution of temperature and decomposer profiles
464    !            (exponential decomposer profile supposed)
465    !
466
467    ! 4.2.1 rpc is an integration constant such that the integral of the root profile is 1.
468    rpc(:) = 1. / ( 1. - EXP( -z_soil(nbdl) / z_decomp ) )
469
470    ! 4.2.2 integrate over the nbdl levels
471
472    tsoil_decomp(:) = 0.0
473
474    DO l = 1, nbdl
475
476       tsoil_decomp(:) = &
477            tsoil_decomp(:) + tsoil(:,l) * rpc(:) * &
478            ( EXP( -z_soil(l-1)/z_decomp ) - EXP( -z_soil(l)/z_decomp ) )
479
480    ENDDO
481
482    control_temp(:,ibelow) = control_temp_func (npts, tsoil_decomp)
483
484    !
485    ! 5 Moisture control. Factor between 0 and 1
486    !
487
488    !
489    ! 5.1 above the ground: litter humidity
490    !
491
492    control_moist(:,iabove) = control_moist_func (npts, litterhum)
493
494    !
495    ! 5.2 below: convolution of humidity and decomposer profiles
496    !            (exponential decomposer profile supposed)
497    !
498
499    ! 5.2.1 rpc is an integration constant such that the integral of the root profile is 1.
500    rpc(:) = 1. / ( 1. - EXP( -z_soil(nbdl) / z_decomp ) )
501
502    ! 5.2.2 integrate over the nbdl levels
503
504    soilhum_decomp(:) = 0.0
505
506    DO l = 1, nbdl
507
508       soilhum_decomp(:) = &
509            soilhum_decomp(:) + soilhum(:,l) * rpc(:) * &
510            ( EXP( -z_soil(l-1)/z_decomp ) - EXP( -z_soil(l)/z_decomp ) )
511
512    ENDDO
513
514    control_moist(:,ibelow) = control_moist_func (npts, soilhum_decomp)
515
516    !
517    ! 6 fluxes from litter to carbon pools and respiration
518    !
519
520    DO l = 1, nlevs
521       DO m = 2,nvm
522
523          !
524          ! 6.1 structural litter: goes into active and slow carbon pools + respiration
525          !
526
527          ! 6.1.1 total quantity of structural litter which is decomposed
528
529          fd(:) = dt/litter_tau(istructural) * &
530               control_temp(:,l) * control_moist(:,l) * exp( -3. * lignin_struc(:,m,l) )
531
532          qd(:) = litter(:,istructural,m,l) * fd(:)
533
534          litter(:,istructural,m,l) = litter(:,istructural,m,l) - qd(:)
535
536          ! 6.1.2 decompose same fraction of structural part of dead leaves. Not exact
537          !       as lignine content is not the same as that of the total structural litter.
538
539          ! to avoid a multiple (for ibelow and iabove) modification of dead_leaves,
540          ! we do this test to do this calcul only ones in 1,nlev loop
541          if (l == iabove)  dead_leaves(:,m,istructural) = dead_leaves(:,m,istructural) * ( 1. - fd(:) )
542
543          ! 6.1.3 non-lignin fraction of structural litter goes into
544          !       active carbon pool + respiration
545
546          soilcarbon_input(:,iactive,m) = soilcarbon_input(:,iactive,m) + &
547               frac_soil(istructural,iactive,l) * qd(:) * ( 1. - lignin_struc(:,m,l) ) / dt
548
549          resp_hetero_litter(:,m) = resp_hetero_litter(:,m) + &
550               ( 1. - frac_soil(istructural,iactive,l) ) * qd(:) * &
551               ( 1. - lignin_struc(:,m,l) ) / dt
552
553          ! 6.1.4 lignin fraction of structural litter goes into
554          !       slow carbon pool + respiration
555
556          soilcarbon_input(:,islow,m) = soilcarbon_input(:,islow,m) + &
557               frac_soil(istructural,islow,l) * qd(:) * lignin_struc(:,m,l) / dt
558
559          resp_hetero_litter(:,m) = resp_hetero_litter(:,m) + &
560               ( 1. - frac_soil(istructural,islow,l) ) * qd(:) * lignin_struc(:,m,l) / dt
561
562          !
563          ! 6.2 metabolic litter goes into active carbon pool + respiration
564          !
565
566          ! 6.2.1 total quantity of metabolic litter that is decomposed
567
568          fd(:) = dt/litter_tau(imetabolic) * control_temp(:,l) * control_moist(:,l)
569
570          qd(:) = litter(:,imetabolic,m,l) * fd(:)
571
572          litter(:,imetabolic,m,l) = litter(:,imetabolic,m,l) - qd(:)
573
574          ! 6.2.2 decompose same fraction of metabolic part of dead leaves.
575
576          ! to avoid a multiple (for ibelow and iabove) modification of dead_leaves,
577          ! we do this test to do this calcul only ones in 1,nlev loop
578          if (l == iabove)  dead_leaves(:,m,imetabolic) = dead_leaves(:,m,imetabolic) * ( 1. - fd(:) )
579
580
581          ! 6.2.3 put decomposed litter into carbon pool + respiration
582
583          soilcarbon_input(:,iactive,m) = soilcarbon_input(:,iactive,m) + &
584               frac_soil(imetabolic,iactive,l) * qd(:) / dt
585
586          resp_hetero_litter(:,m) = resp_hetero_litter(:,m) + &
587               ( 1. - frac_soil(imetabolic,iactive,l) ) * qd(:) / dt
588
589       ENDDO
590    ENDDO
591
592    !
593    ! 7 calculate fraction of total soil covered by dead leaves
594    !
595
596    CALL deadleaf (npts, veget_max, dead_leaves, deadleaf_cover)
597
598    IF (bavard.GE.4) WRITE(numout,*) 'Leaving littercalc'
599
600  END SUBROUTINE littercalc
601
602  SUBROUTINE deadleaf (npts, veget_max, dead_leaves, deadleaf_cover)
603
604    !
605    ! 0 declarations
606    !
607
608    ! 0.1 input
609
610    ! Domain size
611    INTEGER(i_std), INTENT(in)                                               :: npts
612    ! dead leaves on ground, per PFT, metabolic and structural,
613    !   in gC/(m**2 of ground)
614    REAL(r_std), DIMENSION(npts,nvm,nlitt), INTENT(in)                :: dead_leaves
615    !veget_max
616    REAL(r_std),DIMENSION(npts,nvm),INTENT(in)                 :: veget_max
617    ! 0.2. output
618    ! fraction of soil covered by dead leaves
619    REAL(r_std), DIMENSION(npts), INTENT(out)                          :: deadleaf_cover
620
621    ! 0.3. local
622
623    ! LAI of dead leaves
624    REAL(r_std), DIMENSION(npts)                                       :: dead_lai
625    ! Index
626    INTEGER(i_std)                                                    :: j
627
628    !
629    ! 1 LAI of dead leaves
630    !
631
632    dead_lai(:) = zero
633
634    DO j = 2,nvm
635       dead_lai(:) = dead_lai(:) + ( dead_leaves(:,j,imetabolic) + dead_leaves(:,j,istructural) ) * sla(j) &
636            * veget_max(:,j)
637    ENDDO
638
639    !
640    ! 2 fraction of soil covered by dead leaves
641    !
642
643    deadleaf_cover(:) = 1. - exp( - 0.5 * dead_lai(:) )
644
645    IF (bavard.GE.4) WRITE(numout,*) 'Leaving deadleaf'
646
647  END SUBROUTINE deadleaf
648
649  FUNCTION control_moist_func (npts, moist_in) RESULT (moistfunc_result)
650
651    !
652    ! 0 declarations
653    !
654
655    ! 0.1 input
656
657    ! Domain size
658    INTEGER(i_std), INTENT(in)                                               :: npts
659    ! relative humidity
660    REAL(r_std), DIMENSION(npts), INTENT(in)                           :: moist_in
661
662    ! 0.2 result
663
664    ! moisture control factor
665    REAL(r_std), DIMENSION(npts)                                       :: moistfunc_result
666
667    moistfunc_result(:) = -1.1 * moist_in(:) * moist_in(:) + 2.4 * moist_in(:) - 0.29
668    moistfunc_result(:) = MAX( 0.25_r_std, MIN( 1._r_std, moistfunc_result(:) ) )
669
670  END FUNCTION control_moist_func
671
672  FUNCTION control_temp_func (npts, temp_in) RESULT (tempfunc_result)
673
674    !
675    ! 0 declarations
676    !
677
678    ! 0.1 input
679
680    ! Domain size
681    INTEGER(i_std), INTENT(in)                                               :: npts
682    ! temperature (K)
683    REAL(r_std), DIMENSION(npts), INTENT(in)                           :: temp_in
684
685    ! 0.2 result
686
687    ! temperature control factor
688    REAL(r_std), DIMENSION(npts)                                       :: tempfunc_result
689
690    tempfunc_result(:) = exp( 0.69 * ( temp_in(:) - (ZeroCelsius+30.) ) / 10. )
691    tempfunc_result(:) = MIN( 1._r_std, tempfunc_result(:) )
692
693  END FUNCTION control_temp_func
694
695END MODULE stomate_litter
Note: See TracBrowser for help on using the repository browser.