Index: /branches/ORCHIDEE_EXT/ORCHIDEE/src_parameters/constantes.f90
===================================================================
--- /branches/ORCHIDEE_EXT/ORCHIDEE/src_parameters/constantes.f90	(revision 342)
+++ /branches/ORCHIDEE_EXT/ORCHIDEE/src_parameters/constantes.f90	(revision 343)
@@ -28,8 +28,4 @@
   ! we provide here a way to catch that in the calling procedure. (JP)
   LOGICAL,PARAMETER :: diag_qsat = .TRUE.
-
-!!$  ! One of the most frequent problems is a temperature out of range
-!!$  ! we provide here a way to catch that in the calling procedure. (JP)
-!!$  LOGICAL,SAVE :: diag_qsat = .TRUE.
 
   !-
@@ -1147,5 +1143,5 @@
  CONTAINS
 
-   SUBROUTINE activate_sub_models(active_sechiba,active_routing, active_stomate)
+   SUBROUTINE activate_sub_models(ok_sechiba,ok_routing, ok_stomate)
 
      IMPLICIT NONE
@@ -1153,11 +1149,11 @@
      LOGICAL, SAVE ::  first_call = .TRUE.   
      ! input
-     LOGICAL, INTENT(in) :: active_sechiba
-     LOGICAL, INTENT(in) :: active_routing
-     LOGICAL, INTENT(in) :: active_stomate    
+     LOGICAL, INTENT(in) :: ok_sechiba
+     LOGICAL, INTENT(in) :: ok_routing
+     LOGICAL, INTENT(in) :: ok_stomate    
 
      IF (first_call) THEN 
 
-        IF(active_sechiba .AND. active_routing) THEN
+        IF(ok_sechiba .AND. ok_routing) THEN
            
            !Config Key  = DO_IRRIGATION
@@ -1184,5 +1180,5 @@
 
            
-        IF(active_stomate) THEN
+        IF(ok_stomate) THEN
 
            !Config  Key  = HERBIVORES
@@ -1227,5 +1223,5 @@
         ! Check consistency (see later)
         !
-!!$        IF(.NOT.(active_routing) .AND. (doirrigation .OR. dofloodplains)) THEN
+!!$        IF(.NOT.(ok_routing) .AND. (doirrigation .OR. dofloodplains)) THEN
 !!$           CALL ipslerr (2,'activate_sub_models', &
 !!$               &     'Problem :you tried to activate the irrigation and floodplains without activating the routing',&
@@ -1234,5 +1230,5 @@
 !!$        ENDIF
        
-!!$        IF(.NOT.(active_stomate) .AND. (ok_herbivores .OR. treat_expansion .OR. lpj_gap_const_mort &
+!!$        IF(.NOT.(ok_stomate) .AND. (ok_herbivores .OR. treat_expansion .OR. lpj_gap_const_mort &
 !!$            & .OR. harvest_agri .OR. disable_fire)) THEN
 !!$          CALL ipslerr (2,'activate_sub_models', &
@@ -1279,24 +1275,17 @@
         !
         CALL getin_p('IMPOSE_VEG', impveg)
-        !
-        !Config Key  = IMPOSE_SOILT
-        !Config Desc = Should the soil typ be prescribed
-        !Config Def  = n
-        !Config If   = IMPOSE_VEG
-        !Config Help = This flag allows the user to impose a soil type distribution.
-        !Config        It is espacially interesting for 0D
-        !Config        simulations. On the globe it does not make too much sense as
-        !Config        it imposes the same soil everywhere
-        CALL getin_p('IMPOSE_SOILT', impsoilt)     
-        !
-        !Config  Key  = LAND_COVER_CHANGE
-        !Config  Desc = treat land use modifications
-        !Config  If   = LAND_USE
-        !Config  Def  = y
-        !Config  Help = With this variable, you can use a Land Use map
-        !Config         to simulate anthropic modifications such as 
-        !Config         deforestation.
-        CALL getin_p('LAND_COVER_CHANGE', lcchange)
-        !
+
+        IF(impveg) THEN
+           !Config Key  = IMPOSE_SOILT
+           !Config Desc = Should the soil typ be prescribed
+           !Config Def  = n
+           !Config If   = IMPOSE_VEG
+           !Config Help = This flag allows the user to impose a soil type distribution.
+           !Config        It is espacially interesting for 0D
+           !Config        simulations. On the globe it does not make too much sense as
+           !Config        it imposes the same soil everywhere
+           CALL getin_p('IMPOSE_SOILT', impsoilt)     
+        ENDIF
+
         !Config Key  = LAI_MAP
         !Config Desc = Read the LAI map
@@ -1305,20 +1294,15 @@
         !Config        then be interpolated to daily values as needed.
         CALL getin_p('LAI_MAP',read_lai)
-        !
-        !Config Key  = SLOWPROC_LAI_OLD_INTERPOL
-        !Config Desc = Flag to use old "interpolation" of LAI
-        !Config If   = LAI_MAP
-        !Config Def  = FALSE
-        !Config Help = If you want to recover the old (ie orchidee_1_2 branch) 
-        !Config        "interpolation" of LAI map.
-        CALL getin_p('SLOWPROC_LAI_OLD_INTERPOL',old_lai)      
+
+        IF(read_lai) THEN
+           !Config Key  = SLOWPROC_LAI_OLD_INTERPOL
+           !Config Desc = Flag to use old "interpolation" of LAI
+           !Config If   = LAI_MAP
+           !Config Def  = FALSE
+           !Config Help = If you want to recover the old (ie orchidee_1_2 branch) 
+           !Config        "interpolation" of LAI map.
+           CALL getin_p('SLOWPROC_LAI_OLD_INTERPOL',old_lai)
+        ENDIF
  
-        !Config Key  = SLOWPROC_VEGET_OLD_INTERPOL
-        !Config Desc = Flag to use old "interpolation" of vegetation map.
-        !Config If   = NOT IMPOSE_VEG and NOT LAND_USE
-        !Config Def  = FALSE
-        !Config Help = If you want to recover the old (ie orchidee_1_2 branch) 
-        !Config        "interpolation" of vegetation map.
-        CALL getin_p('SLOWPROC_VEGET_OLD_INTERPOL',old_veget)
         !
         !Config Key  = LAND_USE
@@ -1327,26 +1311,57 @@
         !Config Help = pft values are needed, max time axis is 293
         CALL getin_p('LAND_USE',land_use)
-        !
-        !Config Key  = VEGET_REINIT
-        !Config Desc = booleen to indicate that a new LAND USE file will be used.
-        !Config If   = LAND_USE
-        !Config Def  = n
-        !Config Help = The parameter is used to bypass veget_year count 
-        !Config Help   and reinitialize it with VEGET_YEAR parameter.
-        !Config Help   Then it is possible to change LAND USE file.
-        CALL getin_p('VEGET_REINIT', veget_reinit)
+
+        IF(land_use) THEN
+           !Config Key  = VEGET_REINIT
+           !Config Desc = booleen to indicate that a new LAND USE file will be used.
+           !Config If   = LAND_USE
+           !Config Def  = n
+           !Config Help = The parameter is used to bypass veget_year count 
+           !Config Help   and reinitialize it with VEGET_YEAR parameter.
+           !Config Help   Then it is possible to change LAND USE file.
+           CALL getin_p('VEGET_REINIT', veget_reinit)
+           !
+           !Config  Key  = LAND_COVER_CHANGE
+           !Config  Desc = treat land use modifications
+           !Config  If   = LAND_USE
+           !Config  Def  = y
+           !Config  Help = With this variable, you can use a Land Use map
+           !Config         to simulate anthropic modifications such as 
+           !Config         deforestation.
+           CALL getin_p('LAND_COVER_CHANGE', lcchange)
+           !
+           !Config Key  = VEGET_YEAR
+           !Config Desc = Year of the land_use vegetation map to be read (0 == NO TIME AXIS)
+           !Config If   = LAND_USE
+           !Config Def  = 282
+           !Config Help = First year for landuse vegetation (2D map by pft).
+           !Config Help   If VEGET_YEAR == 0, this means there is no time axis.
+           CALL getin_p('VEGET_YEAR', veget_year_orig)
+        ENDIF
+
+        IF(.NOT. impveg .AND. .NOT. land_use) THEN
+           !Config Key  = SLOWPROC_VEGET_OLD_INTERPOL
+           !Config Desc = Flag to use old "interpolation" of vegetation map.
+           !Config If   = NOT IMPOSE_VEG and NOT LAND_USE
+           !Config Def  = FALSE
+           !Config Help = If you want to recover the old (ie orchidee_1_2 branch) 
+           !Config        "interpolation" of vegetation map.
+           CALL getin_p('SLOWPROC_VEGET_OLD_INTERPOL',old_veget)
+         ENDIF  
+
+         !
+         ! Check consistency
+         !
+         ! 1. You have to activate agriculture and land_use
+         IF ( .NOT. agriculture .AND. land_use ) THEN 
+            CALL ipslerr (2,'veget_config', &
+                 &     'Problem with agriculture desactivated and Land Use activated.',&
+                 &     'Are you sure ?', &
+                 &     '(check your parameters).')
+         ENDIF
+
 
         first_call = .FALSE.
 
-     ENDIF
-
-     ! Check consistency
-
-     ! 1. You have to activate agriculture and land_use
-     IF ( .NOT. agriculture .AND. land_use ) THEN 
-        CALL ipslerr (2,'veget_config', &
-             &     'Problem with agriculture desactivated and Land Use activated.',&
-             &     'Are you sure ?', &
-             &     '(check your parameters).')
      ENDIF
 
@@ -1464,13 +1479,4 @@
         CALL getin_p('ALB_BARE_MODEL', alb_bare_model)
         !
-        !Config Key  = IMPOSE_AZE
-        !Config Desc = Should the surface parameters be prescribed
-        !Config Def  = n
-        !Config Help = This flag allows the user to impose the surface parameters
-        !Config        (Albedo Roughness and Emissivity). It is espacially interesting for 0D
-        !Config        simulations. On the globe it does not make too much sense as
-        !Config        it imposes the same vegetation everywhere
-        CALL getin_p('IMPOSE_AZE', impaze)
-        !
         !Config Key  = Z0CDRAG_AVE
         !Config Desc = Average method for z0
@@ -1483,52 +1489,65 @@
         CALL getin_p('Z0CDRAG_AVE', z0cdrag_ave)
         !
-        !Config Key  = CONDVEG_Z0
-        !Config Desc = Surface roughness (m)
-        !Config Def  = 0.15
-        !Config If   = IMPOSE_AZE
-        !Config Help = Surface rougness to be used on the point if a 0-dim version
-        !Config        of SECHIBA is used. Look at the description of the forcing  
-        !Config        data for the correct value.
-        CALL getin_p('CONDVEG_Z0', z0_scal)  
+        !Config Key  = IMPOSE_AZE
+        !Config Desc = Should the surface parameters be prescribed
+        !Config Def  = n
+        !Config Help = This flag allows the user to impose the surface parameters
+        !Config        (Albedo Roughness and Emissivity). It is espacially interesting for 0D
+        !Config        simulations. On the globe it does not make too much sense as
+        !Config        it imposes the same vegetation everywhere
+        CALL getin_p('IMPOSE_AZE', impaze)
         !
-        !Config Key  = ROUGHHEIGHT
-        !Config Desc = Height to be added to the height of the first level (m)
-        !Config Def  = 0.0
-        !Config If   = IMPOSE_AZE
-        !Config Help = ORCHIDEE assumes that the atmospheric level height is counted
-        !Config        from the zero wind level. Thus to take into account the roughness
-        !Config        of tall vegetation we need to correct this by a certain fraction
-        !Config        of the vegetation height. This is called the roughness height in
-        !Config        ORCHIDEE talk.
-        CALL getin_p('ROUGHHEIGHT', roughheight_scal)
-        ! 
-        !Config Key  = CONDVEG_ALBVIS
-        !Config Desc = SW visible albedo for the surface
-        !Config Def  = 0.25
-        !Config If   = IMPOSE_AZE
-        !Config Help = Surface albedo in visible wavelengths to be used 
-        !Config        on the point if a 0-dim version of SECHIBA is used. 
-        !Config        Look at the description of the forcing data for 
-        !Config        the correct value.
-        CALL getin_p('CONDVEG_ALBVIS', albedo_scal(ivis))
+        IF(impaze) THEN
+           !
+           !Config Key  = CONDVEG_Z0
+           !Config Desc = Surface roughness (m)
+           !Config Def  = 0.15
+           !Config If   = IMPOSE_AZE
+           !Config Help = Surface rougness to be used on the point if a 0-dim version
+           !Config        of SECHIBA is used. Look at the description of the forcing  
+           !Config        data for the correct value.
+           CALL getin_p('CONDVEG_Z0', z0_scal)  
+           !
+           !Config Key  = ROUGHHEIGHT
+           !Config Desc = Height to be added to the height of the first level (m)
+           !Config Def  = 0.0
+           !Config If   = IMPOSE_AZE
+           !Config Help = ORCHIDEE assumes that the atmospheric level height is counted
+           !Config        from the zero wind level. Thus to take into account the roughness
+           !Config        of tall vegetation we need to correct this by a certain fraction
+           !Config        of the vegetation height. This is called the roughness height in
+           !Config        ORCHIDEE talk.
+           CALL getin_p('ROUGHHEIGHT', roughheight_scal)
+           ! 
+           !Config Key  = CONDVEG_ALBVIS
+           !Config Desc = SW visible albedo for the surface
+           !Config Def  = 0.25
+           !Config If   = IMPOSE_AZE
+           !Config Help = Surface albedo in visible wavelengths to be used 
+           !Config        on the point if a 0-dim version of SECHIBA is used. 
+           !Config        Look at the description of the forcing data for 
+           !Config        the correct value.
+           CALL getin_p('CONDVEG_ALBVIS', albedo_scal(ivis))
+           !
+           !Config Key  = CONDVEG_ALBNIR
+           !Config Desc = SW near infrared albedo for the surface
+           !Config Def  = 0.25
+           !Config If   = IMPOSE_AZE
+           !Config Help = Surface albedo in near infrared wavelengths to be used 
+           !Config        on the point if a 0-dim version of SECHIBA is used. 
+           !Config        Look at the description of the forcing data for 
+           !Config        the correct value.
+           CALL getin_p('CONDVEG_ALBNIR', albedo_scal(inir))
+           !
+           !Config Key  = CONDVEG_EMIS
+           !Config Desc = Emissivity of the surface for LW radiation
+           !Config Def  = 1.0
+           !Config If   = IMPOSE_AZE
+           !Config Help = The surface emissivity used for compution the LE emission
+           !Config        of the surface in a 0-dim version. Values range between 
+           !Config        0.97 and 1.. The GCM uses 0.98.
+           CALL getin_p('CONDVEG_EMIS', emis_scal)
+        ENDIF
         !
-        !Config Key  = CONDVEG_ALBNIR
-        !Config Desc = SW near infrared albedo for the surface
-        !Config Def  = 0.25
-        !Config If   = IMPOSE_AZE
-        !Config Help = Surface albedo in near infrared wavelengths to be used 
-        !Config        on the point if a 0-dim version of SECHIBA is used. 
-        !Config        Look at the description of the forcing data for 
-        !Config        the correct value.
-        CALL getin_p('CONDVEG_ALBNIR', albedo_scal(inir))
-        !
-        !Config Key  = CONDVEG_EMIS
-        !Config Desc = Emissivity of the surface for LW radiation
-        !Config Def  = 1.0
-        !Config If   = IMPOSE_AZE
-        !Config Help = The surface emissivity used for compution the LE emission
-        !Config        of the surface in a 0-dim version. Values range between 
-        !Config        0.97 and 1.. The GCM uses 0.98.
-        CALL getin_p('CONDVEG_EMIS', emis_scal)
         !-
         ! diffuco 
@@ -1544,12 +1563,4 @@
         CALL getin_p('MIN_VEGFRAC',min_vegfrac)
         CALL getin_p('SOILTYPE_DEFAULT',soiltype_default)
-        !
-        !Config Key  = VEGET_YEAR
-        !Config Desc = Year of the land_use vegetation map to be read (0 == NO TIME AXIS)
-        !Config If   = LAND_USE
-        !Config Def  = 282
-        !Config Help = First year for landuse vegetation (2D map by pft).
-        !Config Help   If VEGET_YEAR == 0, this means there is no time axis.
-        CALL getin_p('VEGET_YEAR', veget_year_orig)
         !
         first_call =.FALSE.
Index: /branches/ORCHIDEE_EXT/ORCHIDEE/src_parameters/pft_parameters.f90
===================================================================
--- /branches/ORCHIDEE_EXT/ORCHIDEE/src_parameters/pft_parameters.f90	(revision 342)
+++ /branches/ORCHIDEE_EXT/ORCHIDEE/src_parameters/pft_parameters.f90	(revision 343)
@@ -512,164 +512,8 @@
 
    !
-   ! 1. Initialisation !! not all the parameters are initialized 
-   !
-
-   !-
-   ! Vegetation structure 
-   !-
-   !
-   ! 1 .Sechiba
-   !
-   veget_ori_fixed_test_1(:) = zero
-   llaimax(:) = zero
-   llaimin(:) = zero
-   height_presc(:) = zero
-   rveg_pft(:) = zero
-   !
-   ! 2 .Stomate
-   !
-   leaf_tab(:) = zero_int
-   sla(:) = zero   
-   !-
-   ! Evapotranspiration -  sechiba
-   !-
-   rstruct_const(:) = zero
-   kzero(:) = zero
-   !-
-   ! Water - sechiba
-   !-
-   wmax_veg(:) = zero
-   humcste(:) = zero
-   throughfall_by_pft(:) = zero
-   !-
-   ! Albedo - sechiba
-   !-
-   snowa_ini(:) = zero
-   snowa_dec(:) = zero
-   alb_leaf_vis(:) = zero
-   alb_leaf_nir(:) = zero
-   !-
-   ! Soil - vegetation
-   !-
-   pref_soil_veg_sand(:) = zero_int
-   pref_soil_veg_loan(:) = zero_int
-   pref_soil_veg_clay(:) = zero_int
-   !-
-   ! Photosynthesis
-   !-
-   !
-   ! 1 .CO2
-   !
-   gsslope(:) = zero
-   gsoffset(:) = zero
-   vcmax_fix(:) = zero
-   vjmax_fix(:) = zero
-   co2_tmin_fix(:) = zero
-   co2_topt_fix(:) = zero
-   co2_tmax_fix(:) = zero
-   ext_coeff(:) = zero
-   !
-   ! 2 .Stomate
-   !
-   vcmax_opt(:) = zero
-   vjmax_opt(:) = zero
-   tphoto_min_a(:) = zero
-   tphoto_min_b(:) = zero
-   tphoto_min_c(:) = zero
-   tphoto_opt_a(:) = zero
-   tphoto_opt_b(:) = zero
-   tphoto_opt_c(:) = zero
-   tphoto_max_a(:) = zero
-   tphoto_max_b(:) = zero
-   tphoto_max_c(:) = zero
-   !-
-   ! Respiration - stomate
-   !-
-   maint_resp_slope_c(:) = zero
-   maint_resp_slope_b(:) = zero
-   maint_resp_slope_a(:) = zero
-   cm_zero_leaf(:) = zero
-   cm_zero_sapabove(:) = zero
-   cm_zero_sapbelow(:) = zero
-   cm_zero_heartabove(:) = zero
-   cm_zero_heartbelow(:) = zero
-   cm_zero_root(:) = zero
-   cm_zero_fruit(:) = zero
-   cm_zero_carbres(:) = zero
-   !-
-   ! Fire - stomate
-   !-
-   ! 
-   flam(:) = zero
-   resist(:) = zero
-   !-
-   ! Flux - LUC
-   !-
-   coeff_lcchange_1(:) = zero
-   coeff_lcchange_10(:) = zero
-   coeff_lcchange_100(:) = zero
-   !-
-   ! Phenology
-   !-
-   !
-   ! 1 .Stomate
-   !
-   lai_max(:) = zero
-   pheno_type(:) = zero_int
-   !
-   ! 2. Leaf Onset
-   !
-   pheno_gdd_crit_c(:) = zero
-   pheno_gdd_crit_b(:) = zero
-   pheno_gdd_crit_a(:) = zero
-   ngd_crit(:) = zero
-   ncdgdd_temp(:) = zero
-   hum_frac(:) = zero
-   lowgpp_time(:) = zero
-   hum_min_time(:) = zero
-   tau_sap(:) = zero
-   tau_fruit(:) = zero
-   ecureuil(:) = zero
-   alloc_min(:) = zero
-   alloc_max(:) = zero
-   demi_alloc(:) = zero  
-  !>> DS new for merge in the trunk 15/06/2011
-   leaflife_tab(:) = zero
-   !
-   ! 3. Senescence
-   !
-   leaffall(:) = zero
-   leafagecrit(:) = zero
-   senescence_hum(:) = zero
-   nosenescence_hum(:) = zero
-   max_turnover_time(:) = zero   
-   min_turnover_time(:) = zero 
-   min_leaf_age_for_senescence(:) = zero 
-   senescence_temp_c(:) = zero 
-   senescence_temp_b(:) = zero 
-   senescence_temp_a(:) = zero 
-   !-
-   ! DGVM
-   !-
-   residence_time(:) = zero
-   tmin_crit(:) = zero
-   tcm_crit(:) = zero
-   !-
-   !  Internal_parameters
-   !-
-   lai_initmin(:) = zero
-   bm_sapl(:,:) = zero
-   migrate(:) = zero
-   maxdia(:) = zero
-   cn_sapl(:) = zero
-   leaf_timecst(:) = zero  
-
-
-   !
-   ! 2. Correspondance between the PFTs values and thes MTCs values 
+   ! 1. Correspondance between the PFTs values and thes MTCs values 
    !
  
    DO j= 1, nvm
-
 
       PFT_name(j) = MTC_name(pft_to_mtc(j))
@@ -1099,11 +943,10 @@
   IF(first_call) THEN
 
-     ! No calling to getin for veget_ori_fixed_test_1, llaimax and height_presc
-     ! use of setvar in slowproc.f90
-
      !-
      ! Vegetation structure
      !-
+     CALL getin_p('SECHIBA_LAI',llaimax)
      CALL getin_p('LLAIMIN',llaimin)
+     CALL getin_p('SLOWPROC_HEIGHT', height_presc)
      CALL getin('TYPE_OF_LAI',type_of_lai)
      CALL getin_p('IS_TREE',is_tree)
