wiki:CleanOrchidee

Version 6 (modified by dsolyga, 13 years ago) (diff)

--

This page will list the parts of the code of ORCHIDEE we should "clean" for the version 2.0 and can be considered as a starting point for this work.

Cleaning ORCHIDEE consists in two steps : reorganizing the stomate module and deleting/simplifying some parts of the code.

All people working on the code can modify this page.

Restructuration of Stomate

In Orchidee 2.0, we want to make the organization of stomate similar as sechiba. More precisely, we want that :

  1. to clear the file stomate.f90 from variables which could be defined in another module. For example a dozen variables are only used in stomate_season.f90.
  1. to move the readstart and the writerestart of the variables in the modules they are defined and not anymore in stomate_io.f90

A list was made about the variables which could be moved. Look at the attached files below (see attached file Synthèse_variables_stomate.pdf). (Warning : this file need to be updated!).

A version of ORCHIDEE including these modifications was created in 2010; This work is not finished. You could find this version called Restruct_Stomate on the svn server.

Cleaning ORCHIDEE

A lot of simplifications have already been made in the externalized version of ORCHIDEE(regrouping R_Earth,pi,delete unused argument, etc...). Ask Didier Solyga about them.

  • Simplification : as the parameters min_sechiba and min_stomate are equal, we could replace these two parameters by an unique one (min_orchidee for example)
  • Simplification : two different allowed_err are defined in the hydrology modules : should we keep one ?
  • Clear all unuseful comments in the code
  • Unused parameters : ito_natagri and ito_total in stomate_constants.f90. ldveget_ori_on_restart and tsnow in constantes_veg.f90. Should we delete them ?
  • stomate_litter.f90 : it seems that the variables litter_inc and litter_inc_PFT are the same :
        litter_inc(:,:,:,:) = zero
        lignin_struc_inc(:,:,:) = zero
    
        DO j = 2,nvm
    
           ! 2.2.1 litter
    
           DO k = 1, nlitt    ! metabolic and structural
    
              ! 2.2.2 calculate litter increase (per m**2 of ground).
              !       Only a given fracion of fruit turnover is directly coverted into litter.
              !       Litter increase for each PFT, structural and metabolic, above/below
    
              litter_inc_PFT(:,j,k,iabove) = &
                   litterfrac(ileaf,k) * bm_to_litter(:,j,ileaf) + &
                   litterfrac(isapabove,k) * bm_to_litter(:,j,isapabove) + &
                   litterfrac(iheartabove,k) * bm_to_litter(:,j,iheartabove) + &
                   litterfrac(ifruit,k) * bm_to_litter(:,j,ifruit) + &
                   litterfrac(icarbres,k) * bm_to_litter(:,j,icarbres) + &
                   litterfrac(ileaf,k) * turnover(:,j,ileaf) + &
                   litterfrac(isapabove,k) * turnover(:,j,isapabove) + &
                   litterfrac(iheartabove,k) * turnover(:,j,iheartabove) + &
                   litterfrac(ifruit,k) * turnover(:,j,ifruit) + &
                   litterfrac(icarbres,k) * turnover(:,j,icarbres)
    
              litter_inc_PFT(:,j,k,ibelow) = &
                   litterfrac(isapbelow,k) * bm_to_litter(:,j,isapbelow) + &
                   litterfrac(iheartbelow,k) * bm_to_litter(:,j,iheartbelow) + &
                   litterfrac(iroot,k) * bm_to_litter(:,j,iroot) + &
                   litterfrac(isapbelow,k) * turnover(:,j,isapbelow) + &
                   litterfrac(iheartbelow,k) * turnover(:,j,iheartbelow) + &
                   litterfrac(iroot,k) * turnover(:,j,iroot)
    
              ! litter increase, met/struct, above/below
    
              litter_inc(:,k,j,iabove) = litter_inc(:,k,j,iabove) + litter_inc_PFT(:,j,k,iabove)
              litter_inc(:,k,j,ibelow) = litter_inc(:,k,j,ibelow) + litter_inc_PFT(:,j,k,ibelow)
    
    
  • in lpj_crown.f90 : copy of the variable height_presc in height_presc12. Then height_presc12 is no more used in ORCHIDEE 1.9.5.2 .
        ! no convertion, just cop
        height_presc_12(1:nvm) = height_presc(1:nvm)
    
    
  • in weather.f90 : an error message should be changed and translated in english :
      IF ( nbindex == 0 ) THEN
        WRITE(numout,*) 'Couillon! On est au plein milieu de l''ocean.'
        STOP 'Ou est-ce un bug?'
    
  • in hydrol.f90 : drain_rest_cste is declared but not used
      REAL(r_std), PARAMETER                             :: drain_rest_cste = 15.0  !! time constant in days to return to free drainage after return flow
    
  • in stomate_lpj.f90 : the harvest subroutine is bad coded for vectorization
    DO i = 1, npts
       DO j=1, nvm
          IF (j > 11) THEN
             above_old = turnover_daily(i,j,ileaf) + turnover_daily(i,j,isapabove) + &
                  &       turnover_daily(i,j,iheartabove) + turnover_daily(i,j,ifruit) + &
                  &       turnover_daily(i,j,icarbres) + turnover_daily(i,j,isapbelow) + &
                  &       turnover_daily(i,j,iheartbelow) + turnover_daily(i,j,iroot)

             turnover_daily(i,j,ileaf) = turnover_daily(i,j,ileaf)*0.55
             turnover_daily(i,j,isapabove) = turnover_daily(i,j,isapabove)*0.55
             turnover_daily(i,j,isapbelow) = turnover_daily(i,j,isapbelow)*0.55
             turnover_daily(i,j,iheartabove) = turnover_daily(i,j,iheartabove)*0.55
             turnover_daily(i,j,iheartbelow) = turnover_daily(i,j,iheartbelow)*0.55
             turnover_daily(i,j,iroot) = turnover_daily(i,j,iroot)*0.55
             turnover_daily(i,j,ifruit) = turnover_daily(i,j,ifruit)*0.55
             turnover_daily(i,j,icarbres) = turnover_daily(i,j,icarbres)*0.55
             harvest_above(i)  = harvest_above(i) + veget_max(i,j) * above_old *0.45

          ENDIF
       ENDDO
    ENDDO

Attachments (1)

Download all attachments as: .zip