!! IPSL (2006)
!! This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC
MODULE stomate_alloc
! Modules used:
USE ioipsl
USE stomate_constants
USE constantes_veg
IMPLICIT NONE
! Private & public routines
PRIVATE
PUBLIC alloc,alloc_clear
! Variables shared by all subroutines in this module
! Is this the first call? (true/false)
LOGICAL, SAVE :: firstcall = .TRUE.
CONTAINS
!! ==============================================================================\n
!! SUBROUTINE : alloc_clear
!! AUTHOR : P. Friedlingstein
!! CREATION DATE:
!!
!> BRIEF : Set the flag ::firstcall to .TRUE. and as such activate section
!! 1.1 of the subroutine alloc (see below).\n
!! ==============================================================================
SUBROUTINE alloc_clear
firstcall = .TRUE.
END SUBROUTINE alloc_clear
!! ==============================================================================\n
!! SUBROUTINE : alloc
!! AUTHOR : P. Friedlingstein
!! CREATION DATE:
!!
!> BRIEF : Allocate net primairy production (= photosynthesis
!! minus autothrophic respiration) to: carbon reserves, aboveground sapwood,
!! belowground sapwood, root, fruits and leaves following Friedlingstein et al. (1999).\n
!!
!! DESCRIPTION (definitions, functional, design, flags):\n
!! The philosophy underluying the scheme is that allocation patterns result from
!! evolved responses that adjust carbon investments to facilitate capture of most
!! limiting resources i.e. light, water and mineral nitrogen. The implemented scheme
!! calculates the limitation of light, water and nitrogen. However, nitrogen is not a
!! prognostic variable of the model and therefore soil temperature and soil moisture
!! are used as a proxy for soil nitrogen availability.\n
!! Sharpe & Rykiel (1991) proposed a generic relationship between the allocation of
!! carbon to a given plant compartment and the availability of a particular resource:\n
!! \latexonly
!! \input{alloc1.tex}
!! \endlatexonly
!! \n
!! where A is the allocation of biomass production (NPP) to a given compartment (either
!! leaves, stem, or roots). Xi and Yj are resource availabilities (e.g. light, water,
!! nutrient). For a given plant compartment, a resource can be of type X or Y. An increase
!! in a X-type resource will increase the allocation to compartment A. An increase in a
!! Y-type resource will, however, lead to a decrease in carbon allocation to that compartment.
!! In other words, Y-type resources are those for which uptake increases with increased
!! investment in the compartment in question. X-type resources, as a consequence of
!! trade-offs, are the opposite. For example, water is a Y-type resource for root allocation.
!! Water-limited conditions should promote carbon allocation to roots, which enhance water
!! uptake and hence minimize plant water stress. Negative relationships between investment
!! and uptake arise when increased investment in one compartment leads, as required for
!! conservation of mass, to decreased investment in a component involved in uptake of
!! that resource.\n
!!
!! The implemented scheme allocates carbon to the following components:\n
!! - Carbon reserves;\n
!! - Aboveground sapwood;\n
!! - Belowground sapwood;\n
!! - Roots;\n
!! - Fruits/seeds and\n
!! - Leaves.
!! \n
!!
!! The allocation to fruits and seeds is simply a 10% "tax" of the total biomass
!! production.\n
! This 'tax' could be made PFT-dependent as higher values are
! likely for crops. Further it should depend on the limitations that the plant
! experiences. If the PFT fares well, it should grow more fruits. However, this
! could only work if PFTs are also rewarded for having grown fruits i.e. by making
! the reproduction rate depend on the fruit growth of the past years. Otherwise,
! the fruit allocation would be a punishment for plants that are doing well.
!! Following carbohydrate use to support budburst and initial growth, the
!! carbohydrate reserve is refilled. The daily amount of carbon allocated to the
!! reserve pool is proportional to leaf+root allocation (::LtoLSR and ::RtoLSR).\n
!! Sapwood and root allocation (respectively ::StoLSR and ::RtoLSR) are proportional
!! to the estimated light and soil (water and nitrogen) stress (::Limit_L and
!! ::Limit_NtoW). Further, Sapwood allocation is separated in belowground sapwood
!! and aboveground sapwood making use of the parameter (:: alloc_sap_above_tree
!! or ::alloc_sap_above_grass). For trees partitioning between above and
!! belowground compartments is a function of PFT age.\n
!! Leaf allocation (::LtoLSR) is calculated as the residual of root and sapwood
!! allocation (LtoLSR(:) = 1. - RtoLSR(:) - StoLSR(:).\n
!!
!! MAIN OUTPUT VARIABLE(S): :: f_alloc; fraction of NPP that is allocated to the
!! six different biomass compartments (leaves, roots, above and belowground wood,
!! carbohydrate reserves and fruits). DIMENSION(npts,nvm,nparts).\n
!!
!! REFERENCES :
!! - Friedlingstein, P., G. Joel, C.B. Field, and Y. Fung (1999), Towards an allocation
!! scheme for global terrestrial carbon models, Global Change Biology, 5, 755-770.
!! - Sharpe, P.J.H., and Rykiel, E.J. (1991), Modelling integrated response of plants
!! to multiple stresses. In: Response of Plants to Multiple Stresses (eds Mooney, H.A.,
!! Winner, W.E., Pell, E.J.), pp. 205-224, Academic Press, San Diego, CA.
!!
!! FLOWCHART :
!! \latexonly
!! \includegraphics(scale=0.5){allocflow.jpg}
!! \endlatexonly
!! ==============================================================================
SUBROUTINE alloc (npts, dt, &
lai, veget_max, senescence, when_growthinit, &
moiavail_week, tsoil_month, soilhum_month, &
biomass, age, leaf_age, leaf_frac, rprof, f_alloc)
!! Input variables
!! Domain size - number of pixels (dimensionless)
INTEGER(i_std), INTENT(in) :: npts
!! Time step of the simulations for stomate (days)
REAL(r_std), INTENT(in) :: dt
!! PFT leaf area index (m**2/m**2)
REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: lai
!! PFT "Maximal" coverage fraction of a PFT (= ind*cn_ind) (m**2/m**2)
REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: veget_max
!! Is the PFT senescent? (true/false) - only for deciduous trees
LOGICAL, DIMENSION(npts,nvm), INTENT(in) :: senescence
!! Days since beginning of growing season (days)
REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: when_growthinit
!! PFT moisture availability (??units??) - integrated over a week
REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: moiavail_week
!! PFT soil temperature (K) - integrated over a month
REAL(r_std), DIMENSION(npts,nbdl), INTENT(in) :: tsoil_month
!! PFT soil humidity (??units??) - integrated over a month
REAL(r_std), DIMENSION(npts,nbdl), INTENT(in) :: soilhum_month
!! PFT age (days)
REAL(r_std), DIMENSION(npts,nvm), INTENT(in) :: age
!! PFT total biomass (gC/m**2)
REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout) :: biomass
!! PFT age of different leaf classes (days)
REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout) :: leaf_age
!! PFT fraction of leaves in leaf age class (dimensionless; 1)
REAL(r_std), DIMENSION(npts,nvm,nleafages), INTENT(inout) :: leaf_frac
!! Output variables
!! [DISPENSABLE] PFT rooting depth - not calculated in the current version of the model (m)
REAL(r_std), DIMENSION(npts,nvm), INTENT(inout) :: rprof
!! PFT fraction of NPP that is allocated to the different components (dimensionless; 1)
REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(out) :: f_alloc
!! Local variables
!! Lai threshold below which carbohydrate reserve may be used (m**2/m**2)
REAL(r_std), DIMENSION(nvm) :: lai_happy
!! Lights stress (dimensionless; 1)
REAL(r_std), DIMENSION(npts) :: limit_L
!! Total nitrogen stress (dimensionless; 1)
REAL(r_std), DIMENSION(npts) :: limit_N
!! Stress from soil temperature on nitrogen mineralisation (dimensionless; 1)
REAL(r_std), DIMENSION(npts) :: limit_N_temp
!! Stress from soil humidity on nitrogen mineralisation (dimensionless; 1)
REAL(r_std), DIMENSION(npts) :: limit_N_hum
!! Soil water stress (dimensionless; 1)
REAL(r_std), DIMENSION(npts) :: limit_W
!! Most limiting factor in the soil: nitrogen or water (dimensionless; 1)
REAL(r_std), DIMENSION(npts) :: limit_WorN
!! Most limiting factor: amongst limit_N, limit_W and limit_L
REAL(r_std), DIMENSION(npts) :: limit
!! Preliminairy soil temperature stress used as a proxy for niterogen stress (K)
REAL(r_std), DIMENSION(npts) :: t_nitrogen
!! Preliminairy soil humidity stress used as a proxy for nitrogen stress (??units??)
REAL(r_std), DIMENSION(npts) :: h_nitrogen
!! Scaling factor for integrating vertical soil profiles (-)
REAL(r_std), DIMENSION(npts) :: rpc
!! Ratio between leaf-allocation and (leaf+sapwood+root)-allocation (dimensionless; 1)
REAL(r_std), DIMENSION(npts) :: LtoLSR
!! Ratio between sapwood-allocation and (leaf+sapwood+root)-allocation (dimensionless; 1)
REAL(r_std), DIMENSION(npts) :: StoLSR
!! Ratio between root-allocation and (leaf+sapwood+root)-allocation (dimensionless; 1)
REAL(r_std), DIMENSION(npts) :: RtoLSR
!! Rescaling factor for allocation factors is carbon is allocated to carbohydrate reserve (dimensionless; 1)
REAL(r_std), DIMENSION(npts) :: carb_rescale
!! Mass of carbohydrate reserve used to support growth (gC/m**2)
REAL(r_std), DIMENSION(npts) :: use_reserve
!! Fraction of carbohydrate reserve used (::use_reserve) to support leaf growth (gC/m**2)
REAL(r_std), DIMENSION(npts) :: transloc_leaf
!! Leaf biomass in youngest leaf age class (gC/m**2)
REAL(r_std), DIMENSION(npts) :: leaf_mass_young
!! Variable to store leaf biomass from previous time step (gC/m**2)
REAL(r_std), DIMENSION(npts,nvm) :: lm_old
!! Maximum number of days during which carbohydrate reserve may be used (days)
REAL(r_std) :: reserve_time
!! lai on natural part of the grid cell, or of agricultural PFTs
REAL(r_std), DIMENSION(npts,nvm) :: lai_around
!! Vegetation cover of natural PFTs on the grid cell (agriculture masked)
REAL(r_std), DIMENSION(npts,nvm) :: veget_max_nat
!! Total natural vegetation cover on natural part of the grid cell
REAL(r_std), DIMENSION(npts) :: natveg_tot
!! Average LAI on natural part of the grid cell
REAL(r_std), DIMENSION(npts) :: lai_nat
!! [DISPENSABLE] intermediate array for looking for minimum
REAL(r_std), DIMENSION(npts) :: zdiff_min
!! Prescribed fraction of sapwood allocation to above ground sapwood (dimensionless; 1)
REAL(r_std), DIMENSION(npts) :: alloc_sap_above
!! Variable to store depth of the different soil layers (m)
REAL(r_std), SAVE, DIMENSION(0:nbdl) :: z_soil
!! Indeces
INTEGER(i_std) :: i,j,l,m
!! Define local parameters
!! [DISPENSABLE] Do we try to reach a minimum reservoir even if we are severely stressed? (true/false)
! Duplicates bavard - no other function in this routine
LOGICAL, PARAMETER :: ok_minres = .TRUE.
!! Time required to develop a minimal LAI using the carbohydrate reserve (days)
REAL(r_std), PARAMETER :: tau_leafinit = 10.
!! Maximum number of days during which carbohydrate reserve may be used for trees (days)
REAL(r_std), PARAMETER :: reserve_time_tree = 30.
!! Maximum number of days during which carbohydrate reserve may be used for grasses (days)
REAL(r_std), PARAMETER :: reserve_time_grass = 20.
!! Default root allocation (dimensionless; 1)
REAL(r_std), PARAMETER :: R0 = 0.3
!! Default sapwood allocation (dimensionless; 1)
REAL(r_std), PARAMETER :: S0 = 0.3
!! Default leaf allocation (dimensionless; 1)
REAL(r_std), PARAMETER :: L0 = 1. - R0 - S0
!! Default fruit allocation (dimensionless; 1)
REAL(r_std), PARAMETER :: f_fruit = 0.1
!! Fraction of sapwood allocation above ground for trees (dimensionless; 1)
REAL(r_std), PARAMETER :: alloc_sap_above_tree = 0.5
!! Fraction of sapwood allocation above ground for trees (dimensionless; 1)
REAL(r_std), PARAMETER :: alloc_sap_above_grass = 1.0
!! Prescribed lower and upper bounds for leaf allocation (dimensionless; 1)
REAL(r_std), PARAMETER :: min_LtoLSR = 0.2
REAL(r_std), PARAMETER :: max_LtoLSR = 0.5
!! Curvature of the root profile (m)
REAL(r_std), PARAMETER :: z_nitrogen = 0.2
!! =========================================================================
!> @addtogroup Allocation Resource limitation and C-allocation
!> @{
!> @}
IF (bavard.GE.3) WRITE(numout,*) 'Entering alloc'
!> @addtogroup Allocation
!> 1. Initialize\n
!> 1.1 First call only\n
IF ( firstcall ) THEN
!> @addtogroup Allocation
!> 1.1.1 Copy the depth of the different soil layers from ??constantes??\n
z_soil(0) = 0.
z_soil(1:nbdl) = diaglev(1:nbdl)
!> @addtogroup Allocation
! 1.1.2 Print flags and parameter settings\n
!!?? Should we mention the variable neame between brackets? Could help to link message
!!?? to variables??
WRITE(numout,*) 'alloc:'
WRITE(numout,'(a,$)') ' > We'
IF ( .NOT. ok_minres ) WRITE(numout,'(a,$)') ' do NOT'
WRITE(numout,*) 'try to reach a minumum reservoir when severely stressed.'
WRITE(numout,*) ' > Time delay (days) to build leaf mass (::tau_leafinit): ', &
tau_leafinit
WRITE(numout,*) ' > Curvature of root mass with increasing soil depth (::z_nitrogen): ', &
z_nitrogen
WRITE(numout,*) ' > Sap allocation above the ground / total sap allocation (dimensionless; 1): '
WRITE(numout,*) ' trees (::alloc_sap_above_tree):', alloc_sap_above_tree
WRITE(numout,*) ' grasses (::alloc_sap_above_grass) :', alloc_sap_above_grass
WRITE(numout,*) ' > Default root alloc fraction (1; ::R0): ', R0
WRITE(numout,*) ' > Default sapwood alloc fraction (1; ::S0): ', S0
WRITE(numout,*) ' > Default fruit allocation (1, ::f_fruit): ', f_fruit
WRITE(numout,*) ' > Minimum (min_LtoLSR)/maximum (::max_LtoLSR)leaf alloc fraction (dimensionless; 1): ',&
min_LtoLSR,max_LtoLSR
WRITE(numout,*) ' > Maximum time (days) the carbon reserve can be used:'
WRITE(numout,*) ' trees (reserve_time_tree):',reserve_time_tree
WRITE(numout,*) ' grasses (reserve_time_grass):',reserve_time_grass
firstcall = .FALSE.
ENDIF
!> @addtogroup Allocation
!> 1.2 Every call\n
!> 1.2.1 Reset output variable (::f_alloc)\n
f_alloc(:,:,:) = 0.0
f_alloc(:,:,icarbres) = 1.0
!> @addtogroup Allocation
!> 1.2.2 Proxy for soil nitrogen stress\n
!> Nitrogen availability and thus N-stress can not be calculated by the model. Water and
!> temperature stress are used as proxy under the assumption that microbial activity is
!> determined by soil temperature and water availability. In turn, microbial activity is
!> assumed to be an indicator for nitrogen mineralisation and thus its availability.\n
!> 1.2.2.1 Convolution of nitrogen stress with root profile\n
!> The capacity of roots to take up nitrogen is assumed to decrease exponentially with
!> increasing soil depth. The curvature of the exponential function describing the
!> nitrogen-uptake capacity of roots (= root mass * uptake capacity) is given by
!> ::z_nitrogen. Strictly speaking its unit is meters (m). Despite its units this parameter
!> has no physical meaning.\n
!> Because the roots are described by an exponential function but the soil depth is limited to
!> ::z_soil(nbdl), the root profile is truncated at ::z_soil(nbdl). For numerical reasons,
!> the total capacity of the soil profile for nitrogen uptake should be 1. To this aim a scaling
!> factor (::rpc) is calculated as follows:\n
!! \latexonly
!! \input{alloc2.tex}
!! \endlatexonly
!> \n
!> Following, mean weighted (weighted by nitrogen uptake capacity) soil temperature
!> (::tsoil_month) or soil moisture (::t_soil_month) are calculated. In this calculation
!> ::rpc is used for scaling.\n
! Scaling factor for integration
rpc(:) = 1. / ( 1. - EXP( -z_soil(nbdl) / z_nitrogen ) )
! Integrate over # soil layers
t_nitrogen(:) = 0.
DO l = 1, nbdl ! Loop over # soil layers
t_nitrogen(:) = &
t_nitrogen(:) + tsoil_month(:,l) * rpc(:) * &
( EXP( -z_soil(l-1)/z_nitrogen ) - EXP( -z_soil(l)/z_nitrogen ) )
ENDDO ! Loop over # soil layers
!> @addtogroup Allocation
!> 1.2.2.2 Convolution for soil moisture
! Scaling factor for integration
rpc(:) = 1. / ( 1. - EXP( -z_soil(nbdl) / z_nitrogen ) )
! Integrate over # soil layers
h_nitrogen(:) = 0.0
DO l = 1, nbdl ! Loop over # soil layers
h_nitrogen(:) = &
h_nitrogen(:) + soilhum_month(:,l) * rpc(:) * &
( EXP( -z_soil(l-1)/z_nitrogen ) - EXP( -z_soil(l)/z_nitrogen ) )
ENDDO ! Loop over # soil layers
!> @addtogroup Allocation
!> 1.2.3 Separate between natural and agrigultural LAI\n
!> The models distinguishes different natural PFTs but does not contain information
!> on whether these PFTs are spatially separated or mixed. In line with the DGVM the
!> models treats the natural PFT's as mixed. Therefore, the average LAI over the
!> natural PFTs is calculated to estimate light stress. Agricultural PFTs are spatially
!> separated.
natveg_tot(:) = 0.0
lai_nat(:) = 0.0
DO j = 2, nvm ! Loop over # PFTs
IF ( natural(j) ) THEN
! Mask agricultural vegetation
veget_max_nat(:,j) = veget_max(:,j)
ELSE
! Mask natural vegetation
veget_max_nat(:,j) = 0.0
ENDIF
! Sum up fraction of natural space covered by vegetation
natveg_tot(:) = natveg_tot(:) + veget_max_nat(:,j)
! Sum up lai
lai_nat(:) = lai_nat(:) + veget_max_nat(:,j) * lai(:,j)
ENDDO ! Loop over # PFTs
DO j = 2, nvm ! Loop over # PFTs
IF ( natural(j) ) THEN
! Use the mean LAI over all natural PFTs when estimating light stress
! on a specific natural PFT
lai_around(:,j) = lai_nat(:)
ELSE
! Use the actual LAI (specific for that PFT) when estimating light
! stress on a specific agricultural PFT
lai_around(:,j) = lai(:,j)
ENDIF
ENDDO ! Loop over # PFTs
!> @addtogroup Allocation
!> 1.2.4 Calculate LAI threshold (m**2/m**2) below which carbohydrate reserve is used.
! Lai_max is a PFT-dependent parameter specified in ??WHERE??
lai_happy(:) = lai_max(:) * 0.5
!> @addtogroup Allocation
!> 2. Use carbohydrate reserve to support growth and update leaf age\n
! Save old leaf mass, biomass got last updated in ??WHERE??
lm_old(:,:) = biomass(:,:,ileaf)
DO j = 2, nvm ! Loop over # PFTs
!> @addtogroup Allocation
!> 2.1 Calculate demand for carbonhydrate reserve to support leaf and root growth.\n
! Maximum time (days) since start of the growing season during which carbohydrate
! may be used
IF ( tree(j) ) THEN
reserve_time = reserve_time_tree
ELSE
reserve_time = reserve_time_grass
ENDIF
!> @addtogroup Allocation
!> Growth is only supported by the use of carbohydrate reserves if the following
!> conditions are statisfied:\n
!> - PFT is not senescent;\n
!> - LAI must be low (i.e. below ::lai_happy) and\n
!> - Day of year of the simulation is in the beginning of the growing season.\n
WHERE ( ( biomass(:,j,ileaf) .GT. 0.0 ) .AND. &
( .NOT. senescence(:,j) ) .AND. &
( lai(:,j) .LT. lai_happy(j) ) .AND. &
( when_growthinit(:,j) .LT. reserve_time ) )
! Determine the mass from the carbohydrate reserve that can be used (gC/m**2).
! Satisfy the demand or use everything that is available
! (i.e. ::biomass(:,j,icarbres)). Distribute the demand evenly over the time
! required (::tau_leafinit) to develop a minimal canopy from reserves (::lai_happy).
use_reserve(:) = &
MIN( biomass(:,j,icarbres), &
2._r_std * dt/tau_leafinit * lai_happy(j)/ sla(j) )
! Distribute the reserve over leaves and fine roots
transloc_leaf(:) = L0/(L0+R0) * use_reserve(:)
biomass(:,j,ileaf) = biomass(:,j,ileaf) + transloc_leaf(:)
biomass(:,j,iroot) = biomass(:,j,iroot) + ( use_reserve(:) - transloc_leaf(:) )
! Adjust the carbohydrate reserve mass by accounting for the reserves used during
! this time step
biomass(:,j,icarbres) = biomass(:,j,icarbres) - use_reserve(:)
ELSEWHERE
transloc_leaf(:) = 0.0
ENDWHERE
!> @addtogroup Allocation
!> 2.2 Update leaf age\n
!> 2.2.1 Decrease leaf age in youngest class\n
! Adjust the mass of the youngest leaves by the newly grown leaves (gC/m**2)
leaf_mass_young(:) = leaf_frac(:,j,1) * lm_old(:,j) + transloc_leaf(:)
WHERE ( ( transloc_leaf(:) .GT. min_stomate ) .AND. ( leaf_mass_young(:) .GT. min_stomate ) )
! Adjust leaf age by the ratio of leaf_mass_young (t-1)/leaf_mass_young (t)
leaf_age(:,j,1) = MAX( zero, leaf_age(:,j,1) * ( leaf_mass_young(:) - transloc_leaf(:) ) / &
leaf_mass_young(:) )
ENDWHERE
!> @addtogroup Allocation
!> 2.2.2 Update leaf mass fraction for the different age classes\n
!> Mass fraction in the youngest age class is calculated as the ratio between
!> the new mass in the youngest class and the total leaf biomass
!> (inc. the new leaves)\n
WHERE ( biomass(:,j,ileaf) .GT. min_stomate )
leaf_frac(:,j,1) = leaf_mass_young(:) / biomass(:,j,ileaf)
ENDWHERE
!> @addtogroup Allocation
!> Mass fraction in the other classes is calculated as the ratio bewteen
!> the current mass in that age and the total leaf biomass
!> (inc. the new leaves)\n
DO m = 2, nleafages ! Loop over # leaf age classes
WHERE ( biomass(:,j,ileaf) .GT. min_stomate )
leaf_frac(:,j,m) = leaf_frac(:,j,m) * lm_old(:,j) / biomass(:,j,ileaf)
ENDWHERE
ENDDO ! Loop over # leaf age classes
ENDDO ! loop over # PFTs
!> @addtogroup Allocation
!> 3. Calculate fractions of biomass production (NPP) to be allocated to the different
!> biomass components.\n
!> The fractions of NPP allocated (dimensionless; 1) to the different compartments depend on the
!> availability of light, water, and nitrogen.
DO j = 2, nvm ! Loop over # PFTs
! Reset values
RtoLSR(:)=0
LtoLSR(:)=0
StoLSR(:)=0
! For trees, partitioning between above and belowground sapwood biomass is a function
! of age. For the other PFTs it is prescribed.
! ?? WHERE DO ::alloc_min, ::alloc_mx and ::demi_alloc come from??
IF ( tree(j) ) THEN
alloc_sap_above (:) = alloc_min(j)+(alloc_max(j)-alloc_min(j))*(1.-EXP(-age(:,j)/demi_alloc(j)))
!IF (j .EQ. 3) WRITE(*,*) '%allocated above = 'alloc_sap_above(dimensionless; 1),'age = ',age(1,j)
ELSE
alloc_sap_above(:) = alloc_sap_above_grass
ENDIF
!> @addtogroup Allocation
!> 3.1 Calculate light, water and proxy for nitrogen stress.\n
! For the limiting factors a low value indicates a strong limitation
WHERE ( biomass(:,j,ileaf) .GT. min_stomate )
!> 3.1.1 Light stress\n
!> Light stress is a function of the mean lai on the natural part of the grid box
!> and of the PFT-specific LAI for agricultural crops. In line with the DGVM, natural
!> PFTs in the same gridbox are treated as if they were spatially mixed whereas
!> agricultural PFTs are considered to be spatially separated.
WHERE( lai_around(:,j) < 10 )
limit_L(:) = MAX( 0.1_r_std, EXP( -0.5_r_std * lai_around(:,j) ) )
ELSEWHERE
limit_L(:) = 0.1_r_std
ENDWHERE
!> @addtogroup Allocation
!> 3.1.2 Water stress\n
!> Water stress is calculated as the weekly moisture availability.\n
limit_W(:) = MAX( 0.1_r_std, MIN( 1._r_std, moiavail_week(:,j) ) )
!> @addtogroup Allocation
!> 3.1.3 Proxy for nitrogen stress
!> The proxy for nitrogen stress depends on monthly soil water availability
!> (::soilhum_month) and monthly soil temperature (::tsoil_month). See section
!> 1.2.2 for details on how ::t_nitrogen and ::h_nitrogen were calculated.\n
! Currently nitrogen-stress is calculated for both natural and agricultural PFTs.
! Due to intense fertilization of agricultural PFTs this is a strong
! assumption for several agricultural regions in the world (US, Europe, India, ...)
! Water stress on nitrogen mineralisation
limit_N_hum(:) = MAX( 0.5_r_std, MIN( 1._r_std, h_nitrogen(:) ) )
! Temperature stress on nitrogen mineralisation using a Q10 decomposition model
! where Q10 was set to 2
limit_N_temp(:) = 2.**((t_nitrogen(:)-ZeroCelsius-25.)/10.)
limit_N_temp(:) = MAX( 0.1_r_std, MIN( 1._r_std, limit_N_temp(:) ) )
! Combine water and temperature factors to get total nitrogen stress
limit_N(:) = MAX( 0.1_r_std, MIN( 1._r_std, limit_N_hum(:) * limit_N_temp(:) ) )
! Take the most limiting factor among soil water and nitrogen
limit_WorN(:) = MIN( limit_W(:), limit_N(:) )
! Take the most limiting factor among aboveground (i.e. light) and belowground
! (i.e. water & nitrogen) limitations
limit(:) = MIN( limit_WorN(:), limit_L(:) )
!> @addtogroup Allocation
!> 3.2 Calculate ratio between allocation to leaves, sapwood and roots\n
!> Partitioning between belowground and aboveground biomass components is assumed
!> to be proportional to the ratio of belowground and aboveground stresses.\n
!! \latexonly
!! \input{alloc1.tex}
!! \endlatexonly
!! \n
! Root allocation
RtoLSR(:) = &
MAX( .15_r_std, &
R0 * 3._r_std * limit_L(:) / ( limit_L(:) + 2._r_std * limit_WorN(:) ) )
! Sapwood allocation
StoLSR(:) = S0 * 3. * limit_WorN(:) / ( 2._r_std * limit_L(:) + limit_WorN(:) )
! Leaf allocation
LtoLSR(:) = 1. - RtoLSR(:) - StoLSR(:)
LtoLSR(:) = MAX( min_LtoLSR, MIN( max_LtoLSR, LtoLSR(:) ) )
! Recalculate roots allocation as the residual carbon
RtoLSR(:) = 1. - LtoLSR(:) - StoLSR(:)
ENDWHERE
! Check whether allocation needs to be adjusted. If LAI exceeds maximum LAI
! (::lai_max), no addition carbon should be allocated to leaf biomass. Allocation is
! then partioned between root and sapwood biomass.
WHERE ( (biomass(:,j,ileaf) .GT. min_stomate) .AND. (lai(:,j) .GT. lai_max(j)) )
StoLSR(:) = StoLSR(:) + LtoLSR(:)
LtoLSR(:) = 0.0
ENDWHERE
!> @addtogroup Allocation
!> 3.3 Calculate the allocation factors
!> The allocation factors (::f_alloc) are an output variable (dimensionless; 1). f_alloc
!> has three dimensions (npts,nvm,nparts). Where ::npts is the # of pixels, ::nvm is the
!> number of PFTs and ::nparts the number of biomass comoponents. Currently six biomass
!> are distinhuished: (dimensionless; 1) Carbon reserves, (2) Aboveground sapwood, (3) Belowground
!> sapwood, (4) Roots, (5) fruits/seeds and (6) Leaves.\n
DO i = 1, npts ! Loop over # pixels - domain size
IF ( biomass(i,j,ileaf) .GT. min_stomate ) THEN
IF ( senescence(i,j) ) THEN
!> @addtogroup Allocation
!> 3.3.1 If the PFT is senescent allocate all C to carbohydrate reserve.\n
f_alloc(i,j,icarbres) = 1.0
ELSE
!> @addtogroup Allocation
!> 3.3.2 Allocation during the growing season
f_alloc(i,j,ifruit) = f_fruit
!> @addtogroup Allocation
!> Allocation to the carbohydrate reserve is proportional to leaf and root
!> allocation. If carbon is allocated to the carbohydtae reserve, rescaling
!> of allocation factors is required to ensure carbon mass preservation.\n
!> Carbon is allocated to the carbohydrate reserve when the pool size of the
!> reserve is less than the carbon needed to grow a canopy twice the size of
!> the maximum LAI (::lai_max). Twice the size was used as a threshold because
!> the reserves needs to be sufficiently to grow a canopy and roots. In case
!> the carbohydrate pool is full, there is no need to rescale the other
!> allocation factors.
!!?? Where does ecureuil come from??
!!?? current equation of (f_alloc(i,j,icarbes) is equivalent to:
!!?? reserve alloc = ecureuil*(LtoLSR+StoLSR)*(1-fruit_alloc)*carb_rescale
IF ( ( biomass(i,j,icarbres)*sla(j) ) .LT. 2*lai_max(j) ) THEN
!!??NEED to know what is in ecureuil to understand this line??
carb_rescale(i) = 1. / ( 1. + ecureuil(j) * ( LtoLSR(i) + RtoLSR(i) ) )
ELSE
carb_rescale(i) = 1.
ENDIF
f_alloc(i,j,ileaf) = LtoLSR(i) * ( 1.-f_alloc(i,j,ifruit) ) * carb_rescale(i)
f_alloc(i,j,isapabove) = StoLSR(i) * alloc_sap_above(i) * &
( 1. - f_alloc(i,j,ifruit) ) * carb_rescale(i)
f_alloc(i,j,isapbelow) = StoLSR(i) * ( 1. - alloc_sap_above(i) ) * &
( 1. - f_alloc(i,j,ifruit) ) * carb_rescale(i)
f_alloc(i,j,iroot) = RtoLSR(i) * ( 1.-f_alloc(i,j,ifruit) ) * carb_rescale(i)
f_alloc(i,j,icarbres) = ( 1. - carb_rescale(i) ) * ( 1.-f_alloc(i,j,ifruit) )
ENDIF ! Is senescent?
ENDIF ! There are leaves
ENDDO ! Loop over # pixels - domain size
ENDDO ! loop over # PFTs
IF (bavard.GE.3) WRITE(numout,*) 'Leaving alloc'
END SUBROUTINE alloc
END MODULE stomate_alloc