Changeset 143


Ignore:
Timestamp:
2011-03-16T10:14:01+01:00 (13 years ago)
Author:
didier.solyga
Message:

Adapte the values taken by veget_max when ok_dgvm and ok_agriculture are true for a variable number of pfts (in slowproc_init)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/slowproc.f90

    r134 r143  
    510510    LOGICAL, PARAMETER                                 :: check = .FALSE. 
    511511    ! 
     512    ! DS 15032011 add for replacing SUM(veget_max(ji,nvm-1:nvm  
     513    REAL(r_std)    :: sum_veget_max 
     514    ! 
     515 
     516 
     517    ! 
    512518    ! 1 allocation 
    513519    ! 
     
    970976                ! set to 0 as well 
    971977              
    972  !               IF (agriculture) THEN 
    973  !                 veget_max(:,2:nvm-2) = zero 
    974 !                   DO ji = 1, kjpindex 
    975  !                     veget_max(ji,1) = un - SUM(veget_max(ji,nvm-1:nvm)) & 
    976 !                           - SUM(frac_nobio(ji,:)) 
    977 !                   ENDDO 
    978 !                ELSE 
    979 !                   veget_max(:,:) = zero 
    980 !                   DO ji = 1, kjpindex 
    981 !                      veget_max(ji,1) = un  - SUM(frac_nobio(ji,:)) 
    982 !                   ENDDO 
    983 !                ENDIF 
    984  
    985 !$$$ 25/10/10 :: Modif DS & NV :: attention garde t'on la masse de C !!! 
     978                !$$$ 25/10/10 :: Modif DS & NV :: attention garde t'on la masse de C !!! 
     979                ! Modif 15/03/2011 
     980 
    986981                IF (agriculture) THEN 
    987                    DO j = 2, nvm 
    988                       WHERE( natural(:))  
    989                        veget_max (:,j) = zero 
    990                        ENDWHERE 
    991                    ENDDO 
     982                   DO jv=2,nvm 
     983                      IF (natural(jv)) THEN  
     984                         veget_max(:,jv)=zero 
     985                      ELSE 
     986                         sum_veget_max = zero 
     987                         DO ji = 1, kjpindex 
     988                            ! we sum only on the indexes corresponding to the non_natural pfts 
     989                            sum_veget_max = sum_veget_max + veget_max(ji,jv) 
     990!                            veget_max(ji,1) = un - SUM(veget_max(ji,jv))-SUM(frac_nobio(ji,:)) 
     991                         ENDDO 
     992                         veget_max(ji,1) = un - sum_veget_max - SUM(frac_nobio(ji,:)) 
     993                      ENDIF 
     994                   ENDDO !- end loop nvm 
    992995                ELSE 
    993996                   veget_max(:,:) = zero 
     997                   DO ji = 1, kjpindex 
     998                      veget_max(ji,1) = un  - SUM(frac_nobio(ji,:)) 
     999                   ENDDO 
    9941000                ENDIF 
    995  
    996                 DO ji = 1, kjpindex 
    997                    veget_max(ji,1) = un  -  SUM(veget_max(ji,2:nvm)) - SUM(frac_nobio(ji,:)) 
    998                 ENDDO 
    9991001                ! 
    10001002             ENDIF 
     
    10121014                ! set to 0 as well 
    10131015                 
    1014              !   IF (agriculture) THEN 
    1015              !      veget_max(:,2:nvm-2) = zero 
    1016              !      DO ji = 1, kjpindex 
    1017              !         veget_max(ji,1) = un - SUM(veget_max(ji,nvm-1:nvm)) & 
    1018              !              - SUM(frac_nobio(ji,:)) 
    1019              !      ENDDO 
    1020              !   ELSE 
    1021              !      veget_max(:,:) = zero 
    1022              !      DO ji = 1, kjpindex 
    1023              !         veget_max(ji,1) = un  - SUM(frac_nobio(ji,:)) 
    1024              !      ENDDO 
    1025             !    ENDIF 
    1026                 ! 
    1027 !             ENDIF 
    1028  
    1029 !$$$ 25/10/10 :: Modif DS & NV :: attention garde t'on la masse de C !!! 
    1030                IF (agriculture) THEN 
    1031                    DO j = 2, nvm 
    1032                       WHERE( natural(:))  
    1033                        veget_max (:,j) = zero 
    1034                      ENDWHERE 
    1035                    ENDDO 
     1016                !$$$ 25/10/10 :: Modif DS & NV :: attention garde t'on la masse de C !!! 
     1017                ! DS : Nouvelle correction 15/03/2011 
     1018                IF (agriculture) THEN 
     1019                   DO jv = 2, nvm 
     1020                      IF (natural(jv)) THEN  
     1021                         veget_max(:,jv)=zero 
     1022                      ELSE 
     1023                         ! Add 15/03/2011 
     1024                         sum_veget_max = zero 
     1025                         DO ji = 1, kjpindex 
     1026                            sum_veget_max = sum_veget_max + veget_max(ji,jv) 
     1027                         ENDDO                             
     1028                         veget_max(ji,1) = un - sum_veget_max- SUM(frac_nobio(ji,:))    
     1029                      ENDIF 
     1030                   ENDDO !- end loop nvm 
    10361031                ELSE 
    10371032                   veget_max(:,:) = zero 
    1038                ENDIF 
    1039  
    1040                DO ji = 1, kjpindex 
    1041                   veget_max(ji,1) = un  -  SUM(veget_max(ji,2:nvm)) - SUM(frac_nobio(ji,:)) 
    1042                ENDDO 
    1043             ENDIF 
     1033                   DO ji = 1, kjpindex 
     1034                      veget_max(ji,1) = un  - SUM(frac_nobio(ji,:)) 
     1035                   ENDDO 
     1036                ENDIF 
     1037                ! 
     1038             ENDIF 
    10441039             ! 
    10451040          ENDIF 
    1046           ! 
     1041             ! 
    10471042       ELSE 
    1048           ! WITH restarts for vegetation and DGVM and NO AGRICULTURE 
    1049           IF ( control%ok_dgvm  ) THEN 
     1043             ! WITH restarts for vegetation and DGVM and NO AGRICULTURE 
     1044             IF ( control%ok_dgvm  ) THEN 
    10501045             ! 
    10511046             ! If we are dealing with dynamic vegetation then all 
     
    10631058!$$$ 25/10/10 :: Modif DS & NV :: attention garde t'on la masse de C !!! 
    10641059             IF (.NOT. agriculture) THEN 
    1065                 DO j = 2, nvm   
     1060                DO jv = 2, nvm   
    10661061                   DO ji = 1, kjpindex 
    1067                         IF ( .NOT. natural (j))  THEN 
    1068                          veget_max(ji,1) = veget_max(ji,1) + veget_max(ji,j) 
    1069                          veget_max(ji,j) = zero 
     1062                        IF ( .NOT. natural (jv))  THEN 
     1063                         veget_max(ji,1) = veget_max(ji,1) + veget_max(ji,jv) 
     1064                         veget_max(ji,jv) = zero 
    10701065                        ENDIF   
    10711066                   ENDDO 
Note: See TracChangeset for help on using the changeset viewer.