Ignore:
Timestamp:
2011-06-17T14:02:17+02:00 (13 years ago)
Author:
didier.solyga
Message:

Externalized version merged with the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/lpj_gap.f90

    r64 r257  
    3939  SUBROUTINE gap (npts, dt, & 
    4040       npp_longterm, turnover_longterm, lm_lastyearmax, & 
    41        PFTpresent, biomass, ind, bm_to_litter) 
     41       PFTpresent, biomass, ind, bm_to_litter, mortality) 
    4242 
    4343    ! 
     
    6868    ! biomass taken away (gC/(m**2 of ground)) 
    6969    REAL(r_std), DIMENSION(npts,nvm,nparts), INTENT(inout)  :: bm_to_litter 
     70    ! mortality (fraction of trees that is dying per time step), per day in history file 
     71    REAL(r_std), DIMENSION(npts,nvm),INTENT(out)             :: mortality 
    7072 
    7173    ! 0.3 local 
    7274 
    73     ! which kind of mortality 
    74     LOGICAL, SAVE                                           :: constant_mortality 
    7575    ! biomass increase 
    7676    REAL(r_std), DIMENSION(npts)                             :: delta_biomass 
     77    ! biomass increase 
     78    REAL(r_std), DIMENSION(npts)                             :: dmortality 
    7779    ! vigour 
    7880    REAL(r_std), DIMENSION(npts)                             :: vigour 
    7981    ! natural availability, based on vigour 
    8082    REAL(r_std), DIMENSION(npts)                             :: availability 
    81     ! mortality (fraction of trees that is dying per time step), per day in history file 
    82     REAL(r_std), DIMENSION(npts,nvm)                        :: mortality 
    8383    ! indices 
    84     INTEGER(i_std)                                           :: j,k 
     84    INTEGER(i_std)                                           :: j,k,m 
     85    REAL(r_std) :: ref_greff 
    8586 
    8687    ! ========================================================================= 
     
    9091       firstcall = .FALSE. 
    9192 
    92        !Config  Key  = LPJ_GAP_CONST_MORT 
    93        !Config  Desc = constant tree mortality 
    94        !Config  Def  = y 
    95        !Config  Help = If yes, then a constant mortality is applied to trees.  
    96        !Config         Otherwise, mortality is a function of the trees'  
    97        !Config         vigour (as in LPJ). 
    98  
    99        constant_mortality = .TRUE. 
    100        CALL getin_p('LPJ_GAP_CONST_MORT', constant_mortality)      
    101        WRITE(numout,*) 'gap: constant mortality:', constant_mortality 
    102  
    10393    ENDIF 
    10494 
    105     IF (bavard.GE.3) WRITE(numout,*) 'Entering gap' 
     95    IF (bavard.GE.3) WRITE(numout,*) 'Entering gap',lpj_gap_const_mort 
    10696 
    10797    mortality(:,:) = zero 
    10898 
     99    ref_greff =  0.035 
     100 
    109101    DO j = 2,nvm 
    110102 
     
    117109          ! 
    118110 
    119           IF ( .NOT. constant_mortality ) THEN 
     111          IF ( .NOT.  lpj_gap_const_mort ) THEN 
    120112 
    121113             ! 
     
    125117             WHERE ( PFTpresent(:,j) .AND. ( lm_lastyearmax(:,j) .GT. min_stomate ) ) 
    126118 
     119!SZ 080806, changed to LPJ formulation according to Smith et al., 2001  
     120 
    127121                ! how much did the tree grow per year? 
    128122 
    129                 delta_biomass(:) = & 
    130                      MAX( npp_longterm(:,j) - ( turnover_longterm(:,j,ileaf) + & 
    131                      turnover_longterm(:,j,iroot) + turnover_longterm(:,j,ifruit) ), & 
    132                      zero ) 
     123!!$                delta_biomass(:) = & 
     124!!$                     MAX( npp_longterm(:,j) - ( turnover_longterm(:,j,ileaf) + & 
     125!!$                     turnover_longterm(:,j,iroot) + turnover_longterm(:,j,ifruit) ), & 
     126!!$                     0._r_std ) 
     127 
     128            ! note that npp_longterm is now actually longterm growth efficiency (NPP/LAI) 
     129            ! to be fair to deciduous trees 
     130             delta_biomass(:) = MAX( npp_longterm(:,j) - ( turnover_longterm(:,j,ileaf) + & 
     131                  turnover_longterm(:,j,iroot) + turnover_longterm(:,j,ifruit) + &  
     132                  turnover_longterm(:,j,isapabove) + turnover_longterm(:,j,isapbelow) ) ,zero) 
    133133 
    134134                ! scale this to the leaf surface of the tree 
    135  
    136                 vigour(:) = delta_biomass(:) / (lm_lastyearmax(:,j)*sla(j)) / vigour_coeff 
     135!!$                vigour(:) = delta_biomass(:) / (lm_lastyearmax(:,j)*sla(j)) / vigour_coeff 
     136             vigour(:) = delta_biomass(:) / (lm_lastyearmax(:,j)*sla(j)) 
    137137 
    138138             ELSEWHERE 
     
    147147                ! low vigour. 
    148148 
    149                 availability(:) = availability_fact / ( 1.+vigour(:)/vigour_ref) 
     149!SZ 080806, changed to LPJ formulation according to Smith et al., 2001  
     150! tuned maximal mortality to 0.05 to get realistic range of avergage age to get ~100 years at GREFF=100 
     151! for the range of modelled annual NPP 
     152!!$                availability(:) = min_avail / ( 1.+vigour(:)/vigour_ref ) 
     153                availability(:) = 0.1 / ( 1.+ref_greff*vigour(:) ) 
    150154 
    151155                ! Mortality (fraction per time step). 
     
    158162                ! approximation ok as availability < 0.02 << 1 
    159163 
    160                 mortality(:,j) = availability(:) * dt/one_year 
     164                mortality(:,j) = MAX(min_avail,availability(:))  * dt/one_year   
     165!!$                mortality(:,j) = availability(:) * dt/one_year 
    161166 
    162167             ENDWHERE 
     
    199204             WHERE ( PFTpresent(:,j) ) 
    200205 
    201                 bm_to_litter(:,j,k) = bm_to_litter(:,j,k) + mortality(:,j) * biomass(:,j,k) 
    202  
    203                 biomass(:,j,k) = biomass(:,j,k) * ( 1. - mortality(:,j) ) 
     206                dmortality(:) =  mortality(:,j) * biomass(:,j,k) 
     207                bm_to_litter(:,j,k) = bm_to_litter(:,j,k) + dmortality(:) 
     208                 
     209                biomass(:,j,k) = biomass(:,j,k) - dmortality(:) 
    204210 
    205211             ENDWHERE 
     
    211217          ! 
    212218 
    213           IF ( control%ok_dgvm ) THEN 
    214  
    215              WHERE ( PFTpresent(:,j) ) 
    216  
    217                 ind(:,j) = ind(:,j) * ( 1. - mortality(:,j) ) 
    218  
    219              ENDWHERE 
    220  
     219!SZ 080806, allow changing density in static case when mortality is dynamic 
     220          IF ( control%ok_dgvm .OR. .NOT.lpj_gap_const_mort) THEN 
     221 
     222             WHERE ( PFTpresent(:,j) ) 
     223 
     224                ind(:,j) = ind(:,j) * ( un - mortality(:,j) ) 
     225 
     226             ENDWHERE 
     227 
     228          ENDIF 
     229 
     230       ELSE  
     231 
     232          IF ( .NOT.control%ok_dgvm .AND. .NOT.lpj_gap_const_mort) THEN 
     233 
     234             WHERE ( PFTpresent(:,j) .AND. ( npp_longterm(:,j) .LE. 10. ) ) 
     235 
     236                mortality(:,j) = 1. 
     237 
     238             ENDWHERE 
     239             DO k = 1, nparts 
     240 
     241                WHERE ( PFTpresent(:,j) ) 
     242 
     243                   dmortality(:) =  mortality(:,j) * biomass(:,j,k) 
     244                    
     245                   bm_to_litter(:,j,k) = bm_to_litter(:,j,k) + dmortality(:) 
     246                    
     247                   biomass(:,j,k) = biomass(:,j,k) - dmortality(:) 
     248 
     249                ENDWHERE 
     250             ENDDO 
     251              
    221252          ENDIF 
    222253 
Note: See TracChangeset for help on using the changeset viewer.